@ai-development-environment/server 0.0.27 → 0.0.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/prisma-runtime/prisma/migrations/20260718220000_add_build_freshness/migration.sql +1 -0
- package/prisma-runtime/prisma/schema.prisma +1 -0
- package/standalone/.next/BUILD_ID +1 -1
- package/standalone/.next/build-manifest.json +3 -3
- package/standalone/.next/prerender-manifest.json +3 -3
- package/standalone/.next/server/app/[locale]/actions/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/actions/page_client-reference-manifest.js +1 -1
- package/standalone/.next/server/app/[locale]/agents/[id]/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/agents/[id]/page_client-reference-manifest.js +1 -1
- package/standalone/.next/server/app/[locale]/agents/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/agents/page_client-reference-manifest.js +1 -1
- package/standalone/.next/server/app/[locale]/build-data/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/build-data/page_client-reference-manifest.js +1 -1
- package/standalone/.next/server/app/[locale]/builds/[buildId]/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/builds/[buildId]/page_client-reference-manifest.js +1 -1
- package/standalone/.next/server/app/[locale]/builds/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/builds/page_client-reference-manifest.js +1 -1
- package/standalone/.next/server/app/[locale]/codebases/[codebaseId]/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/codebases/[codebaseId]/page_client-reference-manifest.js +1 -1
- package/standalone/.next/server/app/[locale]/codebases/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/codebases/page_client-reference-manifest.js +1 -1
- package/standalone/.next/server/app/[locale]/codebases/repositories/[repositoryId]/page_client-reference-manifest.js +1 -1
- package/standalone/.next/server/app/[locale]/comments/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/comments/page_client-reference-manifest.js +1 -1
- package/standalone/.next/server/app/[locale]/jira/cache/page_client-reference-manifest.js +1 -1
- package/standalone/.next/server/app/[locale]/jira/cache/tickets/[issueKey]/page_client-reference-manifest.js +1 -1
- package/standalone/.next/server/app/[locale]/jira/tickets/[issueKey]/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/jira/tickets/[issueKey]/page_client-reference-manifest.js +1 -1
- package/standalone/.next/server/app/[locale]/jira/tickets/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/jira/tickets/page_client-reference-manifest.js +1 -1
- package/standalone/.next/server/app/[locale]/jobs/[jobId]/page_client-reference-manifest.js +1 -1
- package/standalone/.next/server/app/[locale]/page_client-reference-manifest.js +1 -1
- package/standalone/.next/server/app/[locale]/pull-requests/[owner]/[repository]/[number]/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/pull-requests/[owner]/[repository]/[number]/page_client-reference-manifest.js +1 -1
- package/standalone/.next/server/app/[locale]/pull-requests/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/pull-requests/page_client-reference-manifest.js +1 -1
- package/standalone/.next/server/app/[locale]/settings/page_client-reference-manifest.js +1 -1
- package/standalone/.next/server/app/[locale]/skills/[skillId]/page_client-reference-manifest.js +1 -1
- package/standalone/.next/server/app/[locale]/skills/groups/[groupId]/page_client-reference-manifest.js +1 -1
- package/standalone/.next/server/app/[locale]/skills/groups/page_client-reference-manifest.js +1 -1
- package/standalone/.next/server/app/[locale]/skills/page_client-reference-manifest.js +1 -1
- package/standalone/.next/server/app/[locale]/skills/sync/[runId]/page_client-reference-manifest.js +1 -1
- package/standalone/.next/server/app/[locale]/tools/page_client-reference-manifest.js +1 -1
- package/standalone/.next/server/app/[locale]/usage/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/usage/page_client-reference-manifest.js +1 -1
- package/standalone/.next/server/app/[locale]/worktrees/[worktreeId]/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/worktrees/[worktreeId]/page_client-reference-manifest.js +1 -1
- package/standalone/.next/server/app/[locale]/worktrees/page.js.nft.json +1 -1
- package/standalone/.next/server/app/[locale]/worktrees/page_client-reference-manifest.js +1 -1
- package/standalone/.next/server/app/_global-error.html +1 -1
- package/standalone/.next/server/app/_global-error.rsc +1 -1
- package/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/standalone/.next/server/app/_not-found.html +1 -1
- package/standalone/.next/server/app/_not-found.rsc +1 -1
- package/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
- package/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
- package/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/standalone/.next/server/app/api/build-artifact-uploads/[uploadId]/route.js +2 -2
- package/standalone/.next/server/app/api/build-artifact-uploads/[uploadId]/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/builds/[buildId]/artifacts/[artifactId]/route.js +2 -2
- package/standalone/.next/server/app/api/builds/[buildId]/artifacts/[artifactId]/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/codebases/by-path/route.js +2 -2
- package/standalone/.next/server/app/api/codebases/by-path/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/codebases/route.js +2 -2
- package/standalone/.next/server/app/api/codebases/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/graphql/route.js +2 -2
- package/standalone/.next/server/app/api/graphql/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/mcp/route.js +2 -2
- package/standalone/.next/server/app/api/mcp/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/tools/call/route.js +2 -2
- package/standalone/.next/server/app/api/tools/call/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/tools/catalog/route.js +2 -2
- package/standalone/.next/server/app/api/tools/catalog/route.js.nft.json +1 -1
- package/standalone/.next/server/chunks/{[root-of-the-server]__1iv83x0._.js → [root-of-the-server]__0-ypkf7._.js} +1 -1
- package/standalone/.next/server/chunks/{[root-of-the-server]__08w_8a-._.js → [root-of-the-server]__00ku6-v._.js} +1 -1
- package/standalone/.next/server/chunks/{[root-of-the-server]__0yfvw4a._.js → [root-of-the-server]__0138gz-._.js} +1 -1
- package/standalone/.next/server/chunks/{[root-of-the-server]__0r5s0h6._.js → [root-of-the-server]__02vqwey._.js} +2 -2
- package/standalone/.next/server/chunks/{[root-of-the-server]__098f8w4._.js → [root-of-the-server]__056cnsc._.js} +1 -1
- package/standalone/.next/server/chunks/{[root-of-the-server]__1l6ed2g._.js → [root-of-the-server]__08mfybr._.js} +2 -2
- package/standalone/.next/server/chunks/{[root-of-the-server]__0cs2bfc._.js → [root-of-the-server]__08u874i._.js} +1 -1
- package/standalone/.next/server/chunks/{[root-of-the-server]__01h2pl1._.js → [root-of-the-server]__09skp6r._.js} +1 -1
- package/standalone/.next/server/chunks/{[root-of-the-server]__14-aq4c._.js → [root-of-the-server]__0cyubup._.js} +1 -1
- package/standalone/.next/server/chunks/{[root-of-the-server]__0_l5rqe._.js → [root-of-the-server]__0da1wsf._.js} +1 -1
- package/standalone/.next/server/chunks/{[root-of-the-server]__1mgcft0._.js → [root-of-the-server]__0e1fqyr._.js} +1 -1
- package/standalone/.next/server/chunks/{[root-of-the-server]__1frrx8s._.js → [root-of-the-server]__0f3ptor._.js} +2 -2
- package/standalone/.next/server/chunks/{[root-of-the-server]__0k01mi-._.js → [root-of-the-server]__0fih0li._.js} +1 -1
- package/standalone/.next/server/chunks/{[root-of-the-server]__02qjyhj._.js → [root-of-the-server]__0g0tnct._.js} +1 -1
- package/standalone/.next/server/chunks/{[root-of-the-server]__1ehdq4c._.js → [root-of-the-server]__0gbor-2._.js} +1 -1
- package/standalone/.next/server/chunks/{[root-of-the-server]__09lyzw2._.js → [root-of-the-server]__0mj6qcr._.js} +2 -2
- package/standalone/.next/server/chunks/{[root-of-the-server]__14uwobw._.js → [root-of-the-server]__0p_h088._.js} +1 -1
- package/standalone/.next/server/chunks/{[root-of-the-server]__0i4bd9d._.js → [root-of-the-server]__0vvjqp5._.js} +1 -1
- package/standalone/.next/server/chunks/{[root-of-the-server]__04rx7b9._.js → [root-of-the-server]__0w20bq-._.js} +2 -2
- package/standalone/.next/server/chunks/{[root-of-the-server]__0hmrx3m._.js → [root-of-the-server]__0wf0pka._.js} +1 -1
- package/standalone/.next/server/chunks/{[root-of-the-server]__0nxj1ky._.js → [root-of-the-server]__0wg2umj._.js} +1 -1
- package/standalone/.next/server/chunks/{[root-of-the-server]__17bgip6._.js → [root-of-the-server]__0xa_els._.js} +1 -1
- package/standalone/.next/server/chunks/{[root-of-the-server]__0wx4-1l._.js → [root-of-the-server]__0xukz2x._.js} +2 -2
- package/standalone/.next/server/chunks/[root-of-the-server]__1-z6lg_._.js +3 -0
- package/standalone/.next/server/chunks/{[root-of-the-server]__020ggc3._.js → [root-of-the-server]__15aat79._.js} +1 -1
- package/standalone/.next/server/chunks/{[root-of-the-server]__00_-x1w._.js → [root-of-the-server]__15bbm2q._.js} +2 -2
- package/standalone/.next/server/chunks/{[root-of-the-server]__09c7zmy._.js → [root-of-the-server]__16l4wed._.js} +1 -1
- package/standalone/.next/server/chunks/{[root-of-the-server]__04hrhu3._.js → [root-of-the-server]__19zwwdv._.js} +1 -1
- package/standalone/.next/server/chunks/{[root-of-the-server]__0d4_f1e._.js → [root-of-the-server]__1a5_am-._.js} +1 -1
- package/standalone/.next/server/chunks/{[root-of-the-server]__0kxltc8._.js → [root-of-the-server]__1ajaiy1._.js} +1 -1
- package/standalone/.next/server/chunks/[root-of-the-server]__1dtlzq1._.js +3 -0
- package/standalone/.next/server/chunks/[root-of-the-server]__1kpqohm._.js +3 -0
- package/standalone/.next/server/chunks/[root-of-the-server]__1l7234r._.js +3 -0
- package/standalone/.next/server/chunks/{[root-of-the-server]__0qjhcow._.js → [root-of-the-server]__1oahp4o._.js} +2 -2
- package/standalone/.next/server/chunks/[root-of-the-server]__1vip3sa._.js +3 -0
- package/standalone/.next/server/chunks/{[root-of-the-server]__0cryh-d._.js → [root-of-the-server]__1wtng3p._.js} +1 -1
- package/standalone/.next/server/chunks/[root-of-the-server]__1wu654b._.js +3 -0
- package/standalone/.next/server/chunks/[root-of-the-server]__1x2nph5._.js +3 -0
- package/standalone/.next/server/chunks/[root-of-the-server]__1xk-0be._.js +3 -0
- package/standalone/.next/server/chunks/{[root-of-the-server]__0h0mvv8._.js → [root-of-the-server]__210dhdj._.js} +1 -1
- package/standalone/.next/server/chunks/_0exkna-._.js +29 -8
- package/standalone/.next/server/chunks/{_0bru086._.js → _0jurkow._.js} +26 -26
- package/standalone/.next/server/chunks/{_00mzn-u._.js → _0rx5rfm._.js} +27 -27
- package/standalone/.next/server/chunks/_0tufgj0._.js +68 -47
- package/standalone/.next/server/chunks/_0w2eghf._.js +29 -8
- package/standalone/.next/server/chunks/_152rnkf._.js +3 -3
- package/standalone/.next/server/chunks/{_1_g2i-t._.js → _16x77b_._.js} +27 -27
- package/standalone/.next/server/chunks/_1dbqy8c._.js +3 -3
- package/standalone/.next/server/chunks/_1vrixpc._.js +3 -3
- package/standalone/.next/server/chunks/_1yfz-9u._.js +3 -3
- package/standalone/.next/server/chunks/ssr/{[root-of-the-server]__1osx7qy._.js → [root-of-the-server]__0361lgt._.js} +8 -2
- package/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ay4_3d._.js +37 -0
- package/standalone/.next/server/chunks/ssr/[root-of-the-server]__0dm8osz._.js +3 -0
- package/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0oj1os4._.js → [root-of-the-server]__1xv798-._.js} +2 -2
- package/standalone/.next/server/chunks/ssr/[root-of-the-server]__1z955gh._.js +3 -0
- package/standalone/.next/server/chunks/ssr/_00ye62k._.js +35 -0
- package/standalone/.next/server/chunks/ssr/_07tglcd._.js +35 -0
- package/standalone/.next/server/chunks/ssr/_0bvpmhm._.js +29 -25
- package/standalone/.next/server/chunks/ssr/{_0hoc_fd._.js → _0ddgabq._.js} +2 -2
- package/standalone/.next/server/chunks/ssr/{_1x13g5y._.js → _0eb36qa._.js} +2 -2
- package/standalone/.next/server/chunks/ssr/{_1dnm1d4._.js → _0mr9u9p._.js} +2 -2
- package/standalone/.next/server/chunks/ssr/_0nm6upn._.js +3 -0
- package/standalone/.next/server/chunks/ssr/_0quhjav._.js +3 -0
- package/standalone/.next/server/chunks/ssr/_0w05v7m._.js +3 -0
- package/standalone/.next/server/chunks/ssr/_0xozjkz._.js +3 -0
- package/standalone/.next/server/chunks/ssr/_0xrpdyy._.js +3 -0
- package/standalone/.next/server/chunks/ssr/_1-2qcpf._.js +3 -0
- package/standalone/.next/server/chunks/ssr/{_1vhf014._.js → _1-grolz._.js} +2 -2
- package/standalone/.next/server/chunks/ssr/_12ws_f2._.js +11 -0
- package/standalone/.next/server/chunks/ssr/_17p59oz._.js +3 -0
- package/standalone/.next/server/chunks/ssr/_19fwji0._.js +11 -0
- package/standalone/.next/server/chunks/ssr/_1_1j9nd._.js +13 -0
- package/standalone/.next/server/chunks/ssr/_1g3i459._.js +15 -0
- package/standalone/.next/server/chunks/ssr/{_1oh35yj._.js → _1g_aflc._.js} +2 -2
- package/standalone/.next/server/chunks/ssr/{_1dsdn7w._.js → _1lcwubl._.js} +2 -2
- package/standalone/.next/server/chunks/ssr/{_0sp1ojg._.js → _1r2rmfp._.js} +8 -2
- package/standalone/.next/server/chunks/ssr/_1za3z6k._.js +28 -24
- package/standalone/.next/server/chunks/ssr/{_13jl9nw._.js → _1zyjq9y._.js} +2 -2
- package/standalone/.next/server/chunks/ssr/_20ufqtr._.js +3 -0
- package/standalone/.next/server/chunks/ssr/messages_de_json_[json]_cjs_1uig1ud._.js +1 -1
- package/standalone/.next/server/chunks/ssr/messages_en_json_[json]_cjs_206072-._.js +1 -1
- package/standalone/.next/server/chunks/ssr/messages_es_json_[json]_cjs_082yukd._.js +1 -1
- package/standalone/.next/server/chunks/ssr/messages_fr_json_[json]_cjs_0j6-w0i._.js +1 -1
- package/standalone/.next/server/chunks/ssr/src_components_agents_agent-detail_tsx_0lfa4ui._.js +2 -2
- package/standalone/.next/server/chunks/ssr/src_components_builds_build-detail-page_tsx_0q1lvps._.js +9 -13
- package/standalone/.next/server/chunks/ssr/src_components_builds_builds-page_tsx_17qzmsl._.js +8 -12
- package/standalone/.next/server/chunks/ssr/src_components_github_actions-page_tsx_18434xt._.js +5 -5
- package/standalone/.next/server/chunks/ssr/src_components_github_pull-requests-page_tsx_1il3ga-._.js +12 -12
- package/standalone/.next/server/chunks/ssr/src_components_tools_tools-page_tsx_0k1jqcz._.js +2 -2
- package/standalone/.next/server/chunks/ssr/src_components_worktrees_worktree-detail-page_tsx_1oexgu_._.js +13 -4
- package/standalone/.next/server/middleware-build-manifest.js +3 -3
- package/standalone/.next/server/pages/404.html +1 -1
- package/standalone/.next/server/pages/500.html +1 -1
- package/standalone/.next/server/server-reference-manifest.js +1 -1
- package/standalone/.next/server/server-reference-manifest.json +1 -1
- package/standalone/.next/static/chunks/{0sp_r-c6262te.js → 0newuocvg03xy.js} +1 -1
- package/standalone/.next/static/chunks/{3oyhf7rk2xr_g.js → 0rlomhlt6030e.js} +1 -1
- package/standalone/.next/static/chunks/16tfdsma_h0r5.js +33 -0
- package/standalone/.next/static/chunks/{1xjd6ye7mxyf5.js → 1802j8gq2g47d.js} +2 -2
- package/standalone/.next/static/chunks/1_tnhhn4f122y.js +9 -0
- package/standalone/.next/static/chunks/1eny65xy2ho48.js +1 -0
- package/standalone/.next/static/chunks/1l4bkigul15i3.js +25 -0
- package/standalone/.next/static/chunks/{3td_-1s61zkpa.js → 1nnp0crt0mi_-.js} +1 -1
- package/standalone/.next/static/chunks/1qd6cse_d9ae1.js +99 -0
- package/standalone/.next/static/chunks/{2dwchs_6y_o5f.js → 2-mxmazwsh-wz.js} +1 -1
- package/standalone/.next/static/chunks/2fzwgr2iq_783.css +1 -0
- package/standalone/.next/static/chunks/{278dxvyf095b_.js → 2jbygfc0lzu0t.js} +7 -7
- package/standalone/.next/static/chunks/2n7u72nxziv_5.js +7 -0
- package/standalone/.next/static/chunks/{1rivge68m21sm.js → 2rjf8o4g23no8.js} +10 -10
- package/standalone/.next/static/chunks/{42flok13o-l0b.js → 2x8qovg070057.js} +1 -1
- package/standalone/.next/static/chunks/{091l-ij_cv0b6.js → 3-u7pvogc5_bx.js} +12 -12
- package/standalone/.next/static/chunks/3-zh9b0tcttiw.js +33 -0
- package/standalone/.next/static/chunks/31wyih3wwkeid.js +1 -0
- package/standalone/.next/static/chunks/{1nqkxeuycfmrt.js → 36_1bjzx79v18.js} +5 -5
- package/standalone/.next/static/chunks/3ajj69p_sj615.js +1 -0
- package/standalone/.next/static/chunks/3jd8_7lna-j_x.js +40 -0
- package/standalone/.next/static/chunks/3jv2gnnn4vx-j.js +43 -0
- package/standalone/.next/static/chunks/3k0oakdayt9yt.js +40 -0
- package/standalone/.next/static/chunks/3pgngh8lg3be3.js +99 -0
- package/standalone/.next/static/chunks/{0w8rd_g6hnvmz.js → 4013cp3x6bvuw.js} +1 -1
- package/standalone/src/services/builds/build-freshness.test.ts +107 -0
- package/standalone/src/services/builds/build-freshness.ts +73 -0
- package/standalone/src/services/builds/builds.service.test.ts +167 -8
- package/standalone/src/services/builds/builds.service.ts +115 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__1878s0b._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__18zrtty._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__1_xz_m2._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__1mx1hqe._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__1sjjkyp._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__1vk9266._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__1yn6pds._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__1zwpjfo._.js +0 -3
- package/standalone/.next/server/chunks/ssr/[root-of-the-server]__03m5q8h._.js +0 -27
- package/standalone/.next/server/chunks/ssr/[root-of-the-server]__06bk7ik._.js +0 -3
- package/standalone/.next/server/chunks/ssr/_09l5w5d._.js +0 -3
- package/standalone/.next/server/chunks/ssr/_0_726fj._.js +0 -3
- package/standalone/.next/server/chunks/ssr/_0a1zku5._.js +0 -3
- package/standalone/.next/server/chunks/ssr/_0pu14lm._.js +0 -3
- package/standalone/.next/server/chunks/ssr/_1eol9we._.js +0 -3
- package/standalone/.next/server/chunks/ssr/_1h3t5g1._.js +0 -3
- package/standalone/.next/server/chunks/ssr/_1kemhyd._.js +0 -39
- package/standalone/.next/server/chunks/ssr/_1kmkrz5._.js +0 -3
- package/standalone/.next/server/chunks/ssr/_1r9ohdr._.js +0 -3
- package/standalone/.next/server/chunks/ssr/_1yzb5-u._.js +0 -11
- package/standalone/.next/server/chunks/ssr/src_components_0wvh73y._.js +0 -11
- package/standalone/.next/server/chunks/ssr/src_components_github_167_ydi._.js +0 -35
- package/standalone/.next/static/chunks/00dx8gu-2oyqe.js +0 -45
- package/standalone/.next/static/chunks/0j5n6p9i-vyzo.js +0 -9
- package/standalone/.next/static/chunks/0weklluydd2mf.js +0 -23
- package/standalone/.next/static/chunks/1eehbcjby4go8.js +0 -95
- package/standalone/.next/static/chunks/23_75iur2dq8p.js +0 -1
- package/standalone/.next/static/chunks/2lgsgstcvc7uk.css +0 -1
- package/standalone/.next/static/chunks/32agjzrkphjrl.js +0 -9
- package/standalone/.next/static/chunks/399uxexoo8x7f.js +0 -33
- package/standalone/.next/static/chunks/39ecics7n8z5m.js +0 -1
- package/standalone/.next/static/chunks/3_kaby2qep1pd.js +0 -34
- package/standalone/.next/static/chunks/3q7vh58-5dkv2.js +0 -25
- package/standalone/.next/static/chunks/3xkoiasuwi3ms.js +0 -95
- package/standalone/.next/static/chunks/41s57pssydrel.js +0 -43
- /package/standalone/.next/static/{AxIbPSeZUHq852SCBMR8d → 8uBWJ8MOV-OEPe88M3PhU}/_buildManifest.js +0 -0
- /package/standalone/.next/static/{AxIbPSeZUHq852SCBMR8d → 8uBWJ8MOV-OEPe88M3PhU}/_clientMiddlewareManifest.js +0 -0
- /package/standalone/.next/static/{AxIbPSeZUHq852SCBMR8d → 8uBWJ8MOV-OEPe88M3PhU}/_ssgManifest.js +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
module.exports=[610863,(e,t,i)=>{"use strict";var n;Object.defineProperty(i,"__esModule",{value:!0}),i.PrefixingKeyValueCache=void 0;let r=Symbol("prefixesAreUnnecessaryForIsolation");class a{constructor(e,t){this.wrapped=e,a.prefixesAreUnnecessaryForIsolation(e)?(this.prefix="",this[r]=!0):this.prefix=t}get(e){return this.wrapped.get(this.prefix+e)}set(e,t,i){return this.wrapped.set(this.prefix+e,t,i)}delete(e){return this.wrapped.delete(this.prefix+e)}static prefixesAreUnnecessaryForIsolation(e){return r in e}static cacheDangerouslyDoesNotNeedPrefixesForIsolation(e){return new s(e)}}i.PrefixingKeyValueCache=a;class s{constructor(e){this.wrapped=e,this[n]=!0}get(e){return this.wrapped.get(e)}set(e,t,i){return this.wrapped.set(e,t,i)}delete(e){return this.wrapped.delete(e)}}n=r},929030,(e,t,i)=>{"use strict";var n=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),r=n(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.tracing=t.metrics=void 0;var i=e.r(677652);t.metrics=(0,i.channel)("lru-cache:metrics"),t.tracing=(0,i.tracingChannel)("lru-cache")}),a=n(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.defaultPerf=void 0,e.defaultPerf="object"==typeof performance&&performance&&"function"==typeof performance.now?performance:Date});Object.defineProperty(i,"__esModule",{value:!0}),i.LRUCache=void 0;var s=r(),o=a(),l=()=>s.metrics.hasSubscribers||s.tracing.hasSubscribers,u=new Set,c="object"==typeof process&&process?process:{},d=e=>!!e&&e===Math.floor(e)&&e>0&&isFinite(e),p=e=>d(e)?e<=256?Uint8Array:e<=65536?Uint16Array:e<=0x100000000?Uint32Array:e<=Number.MAX_SAFE_INTEGER?h:null:null,h=class extends Array{constructor(e){super(e),this.fill(0)}},f=class e{heap;length;static #e=!1;static create(t){let i=p(t);if(!i)return[];e.#e=!0;let n=new e(t,i);return e.#e=!1,n}constructor(t,i){if(!e.#e)throw TypeError("instantiate Stack using Stack.create(n)");this.heap=new i(t),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}};i.LRUCache=class e{#e;#t;#i;#n;#r;#a;#s;#o;get perf(){return this.#o}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;backgroundFetchSize;#l;#u;#c;#d;#p;#h;#f;#m;#y;#v;#g;#T;#S;#E;#I;#b;#N;#_;#D;static unsafeExposeInternals(e){return{starts:e.#S,ttls:e.#E,autopurgeTimers:e.#I,sizes:e.#T,keyMap:e.#c,keyList:e.#d,valList:e.#p,next:e.#h,prev:e.#f,get head(){return e.#m},get tail(){return e.#y},free:e.#v,isBackgroundFetch:t=>e.#A(t),backgroundFetch:(t,i,n,r)=>e.#O(t,i,n,r),moveToTail:t=>e.#R(t),indexes:t=>e.#w(t),rindexes:t=>e.#L(t),isStale:t=>e.#C(t)}}get max(){return this.#e}get maxSize(){return this.#t}get calculatedSize(){return this.#u}get size(){return this.#l}get fetchMethod(){return this.#a}get memoMethod(){return this.#s}get dispose(){return this.#i}get onInsert(){return this.#n}get disposeAfter(){return this.#r}constructor(t){let{max:i=0,ttl:n,ttlResolution:r=1,ttlAutopurge:a,updateAgeOnGet:s,updateAgeOnHas:l,allowStale:h,dispose:m,onInsert:y,disposeAfter:v,noDisposeOnSet:g,noUpdateTTL:T,maxSize:S=0,maxEntrySize:E=0,sizeCalculation:I,fetchMethod:b,memoMethod:N,noDeleteOnFetchRejection:_,noDeleteOnStaleGet:D,allowStaleOnFetchRejection:A,allowStaleOnFetchAbort:O,ignoreFetchAbort:R,backgroundFetchSize:w=1,perf:L}=t;if(this.backgroundFetchSize=w,void 0!==L&&"function"!=typeof L?.now)throw TypeError("perf option must have a now() method if specified");if(this.#o=L??o.defaultPerf,0!==i&&!d(i))throw TypeError("max option must be a nonnegative integer");let C=i?p(i):Array;if(!C)throw Error("invalid max value: "+i);if(this.#e=i,this.#t=S,this.maxEntrySize=E||this.#t,this.sizeCalculation=I,this.sizeCalculation){if(!this.#t&&!this.maxEntrySize)throw TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if("function"!=typeof this.sizeCalculation)throw TypeError("sizeCalculation set to non-function")}if(void 0!==N&&"function"!=typeof N)throw TypeError("memoMethod must be a function if defined");if(this.#s=N,void 0!==b&&"function"!=typeof b)throw TypeError("fetchMethod must be a function if specified");if(this.#a=b,this.#N=!!b,this.#c=new Map,this.#d=Array.from({length:i}).fill(void 0),this.#p=Array.from({length:i}).fill(void 0),this.#h=new C(i),this.#f=new C(i),this.#m=0,this.#y=0,this.#v=f.create(i),this.#l=0,this.#u=0,"function"==typeof m&&(this.#i=m),"function"==typeof y&&(this.#n=y),"function"==typeof v?(this.#r=v,this.#g=[]):(this.#r=void 0,this.#g=void 0),this.#b=!!this.#i,this.#D=!!this.#n,this.#_=!!this.#r,this.noDisposeOnSet=!!g,this.noUpdateTTL=!!T,this.noDeleteOnFetchRejection=!!_,this.allowStaleOnFetchRejection=!!A,this.allowStaleOnFetchAbort=!!O,this.ignoreFetchAbort=!!R,0!==this.maxEntrySize){if(0!==this.#t&&!d(this.#t))throw TypeError("maxSize must be a positive integer if specified");if(!d(this.maxEntrySize))throw TypeError("maxEntrySize must be a positive integer if specified");this.#F()}if(this.allowStale=!!h,this.noDeleteOnStaleGet=!!D,this.updateAgeOnGet=!!s,this.updateAgeOnHas=!!l,this.ttlResolution=d(r)||0===r?r:1,this.ttlAutopurge=!!a,this.ttl=n||0,this.ttl){if(!d(this.ttl))throw TypeError("ttl must be a positive integer if specified");this.#k()}if(0===this.#e&&0===this.ttl&&0===this.#t)throw TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#e&&!this.#t){let t="LRU_CACHE_UNBOUNDED";(e=>!u.has(e))(t)&&(u.add(t),((e,t,i,n)=>{"function"==typeof c.emitWarning?c.emitWarning(e,t,i,n):console.error(`[${i}] ${t}: ${e}`)})("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",t,e))}}getRemainingTTL(e){return this.#c.has(e)?1/0:0}#k(){let e=new h(this.#e),t=new h(this.#e);this.#E=e,this.#S=t;let i=this.ttlAutopurge?Array.from({length:this.#e}):void 0;this.#I=i,this.#P=(i,r,a=this.#o.now())=>{t[i]=0!==r?a:0,e[i]=r,n(i,r)},this.#x=i=>{t[i]=0!==e[i]?this.#o.now():0,n(i,e[i])};let n=this.ttlAutopurge?(e,t)=>{if(i?.[e]&&(clearTimeout(i[e]),i[e]=void 0),t&&0!==t&&i){let r=setTimeout(()=>{this.#C(e)?(this.#M(this.#d[e],"expire"),i[e]=void 0):n(e,s(e))},t+1);r.unref&&r.unref(),i[e]=r}}:()=>{};this.#U=(i,n)=>{if(e[n]){let s=e[n],o=t[n];if(!s||!o)return;i.ttl=s,i.start=o,i.now=r||a();let l=i.now-o;i.remainingTTL=s-l}};let r=0,a=()=>{let e=this.#o.now();if(this.ttlResolution>0){r=e;let t=setTimeout(()=>r=0,this.ttlResolution);t.unref&&t.unref()}return e};this.getRemainingTTL=e=>{let t=this.#c.get(e);return void 0===t?0:s(t)};let s=i=>{let n=e[i],s=t[i];return n&&s?n-((r||a())-s):1/0};this.#C=i=>{let n=t[i],s=e[i];return!!s&&!!n&&(r||a())-n>s}}#x=()=>{};#U=()=>{};#P=()=>{};#C=()=>!1;#F(){let e=new h(this.#e);this.#u=0,this.#T=e,this.#$=t=>{this.#u-=e[t],e[t]=0},this.#j=(e,t,i,n)=>{if(!d(i)){if(this.#A(t))return this.backgroundFetchSize;if(n){if("function"!=typeof n)throw TypeError("sizeCalculation must be a function");if(!d(i=n(t,e)))throw TypeError("sizeCalculation return invalid (expect positive integer)")}else throw TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.")}return i},this.#V=(t,i,n)=>{if(e[t]=i,this.#t){let i=this.#t-e[t];for(;this.#u>i;)this.#G(!0)}this.#u+=e[t],n&&(n.entrySize=i,n.totalCalculatedSize=this.#u)}}#$=e=>{};#V=(e,t,i)=>{};#j=(e,t,i,n)=>{if(i||n)throw TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#w({allowStale:e=this.allowStale}={}){if(this.#l)for(let t=this.#y;this.#B(t)&&((e||!this.#C(t))&&(yield t),t!==this.#m);)t=this.#f[t]}*#L({allowStale:e=this.allowStale}={}){if(this.#l)for(let t=this.#m;this.#B(t)&&((e||!this.#C(t))&&(yield t),t!==this.#y);)t=this.#h[t]}#B(e){return void 0!==e&&this.#c.get(this.#d[e])===e}*entries(){for(let e of this.#w())void 0===this.#p[e]||void 0===this.#d[e]||this.#A(this.#p[e])||(yield[this.#d[e],this.#p[e]])}*rentries(){for(let e of this.#L())void 0===this.#p[e]||void 0===this.#d[e]||this.#A(this.#p[e])||(yield[this.#d[e],this.#p[e]])}*keys(){for(let e of this.#w()){let t=this.#d[e];void 0===t||this.#A(this.#p[e])||(yield t)}}*rkeys(){for(let e of this.#L()){let t=this.#d[e];void 0===t||this.#A(this.#p[e])||(yield t)}}*values(){for(let e of this.#w())void 0===this.#p[e]||this.#A(this.#p[e])||(yield this.#p[e])}*rvalues(){for(let e of this.#L())void 0===this.#p[e]||this.#A(this.#p[e])||(yield this.#p[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(let i of this.#w()){let n=this.#p[i],r=this.#A(n)?n.__staleWhileFetching:n;if(void 0!==r&&e(r,this.#d[i],this))return this.#K(this.#d[i],t)}}forEach(e,t=this){for(let i of this.#w()){let n=this.#p[i],r=this.#A(n)?n.__staleWhileFetching:n;void 0!==r&&e.call(t,r,this.#d[i],this)}}rforEach(e,t=this){for(let i of this.#L()){let n=this.#p[i],r=this.#A(n)?n.__staleWhileFetching:n;void 0!==r&&e.call(t,r,this.#d[i],this)}}purgeStale(){let e=!1;for(let t of this.#L({allowStale:!0}))this.#C(t)&&(this.#M(this.#d[t],"expire"),e=!0);return e}info(e){let t=this.#c.get(e);if(void 0===t)return;let i=this.#p[t],n=this.#A(i)?i.__staleWhileFetching:i;if(void 0===n)return;let r={value:n};if(this.#E&&this.#S){let e=this.#E[t],i=this.#S[t];e&&i&&(r.ttl=e-(this.#o.now()-i),r.start=Date.now())}return this.#T&&(r.size=this.#T[t]),r}dump(){let e=[];for(let t of this.#w({allowStale:!0})){let i=this.#d[t],n=this.#p[t],r=this.#A(n)?n.__staleWhileFetching:n;if(void 0===r||void 0===i)continue;let a={value:r};if(this.#E&&this.#S){a.ttl=this.#E[t];let e=this.#o.now()-this.#S[t];a.start=Math.floor(Date.now()-e)}this.#T&&(a.size=this.#T[t]),e.unshift([i,a])}return e}load(e){for(let[t,i]of(this.clear(),e)){if(i.start){let e=Date.now()-i.start;i.start=this.#o.now()-e}this.#Q(t,i.value,i)}}set(e,t,i={}){let{status:n=s.metrics.hasSubscribers?{}:void 0}=i;i.status=n,n&&(n.op="set",n.key=e,void 0!==t&&(n.value=t),n.cache=this);let r=this.#Q(e,t,i);return n&&s.metrics.hasSubscribers&&s.metrics.publish(n),r}#Q(e,t,i,n){let{ttl:r=this.ttl,start:a,noDisposeOnSet:s=this.noDisposeOnSet,sizeCalculation:o=this.sizeCalculation,status:l}=i,u=this.#A(t);if(void 0===t)return l&&(l.set="deleted"),this.delete(e),this;let{noUpdateTTL:c=this.noUpdateTTL}=i;l&&!u&&(l.value=t);let d=this.#j(e,t,i.size||0,o,l);if(this.maxEntrySize&&d>this.maxEntrySize)return this.#M(e,"set"),l&&(l.set="miss",l.maxEntrySizeExceeded=!0),this;let p=0===this.#l?void 0:this.#c.get(e);if(void 0===p)p=0===this.#l?this.#y:0!==this.#v.length?this.#v.pop():this.#l===this.#e?this.#G(!1):this.#l,this.#d[p]=e,this.#p[p]=t,this.#c.set(e,p),this.#h[this.#y]=p,this.#f[p]=this.#y,this.#y=p,this.#l++,this.#V(p,d,l),l&&(l.set="add"),c=!1,this.#D&&!u&&this.#n?.(t,e,"add");else{this.#R(p);let i=this.#p[p];if(t!==i){if(!s)if(this.#A(i)){i!==n&&i.__abortController.abort(Error("replaced"));let{__staleWhileFetching:r}=i;void 0!==r&&r!==t&&(this.#b&&this.#i?.(r,e,"set"),this.#_&&this.#g?.push([r,e,"set"]))}else this.#b&&this.#i?.(i,e,"set"),this.#_&&this.#g?.push([i,e,"set"]);if(this.#$(p),this.#V(p,d,l),this.#p[p]=t,!u){let n=i&&this.#A(i)?i.__staleWhileFetching:i,r=void 0===n?"add":t!==n?"replace":"update";l&&(l.set=r,void 0!==n&&(l.oldValue=n)),this.#D&&this.onInsert?.(t,e,r)}}else u||(l&&(l.set="update"),this.#D&&this.onInsert?.(t,e,"update"))}if(0===r||this.#E||this.#k(),this.#E&&(c||this.#P(p,r,a),l&&this.#U(l,p)),!s&&this.#_&&this.#g){let e=this.#g,t;for(;t=e?.shift();)this.#r?.(...t)}return this}pop(){try{for(;this.#l;){let e=this.#p[this.#m];if(this.#G(!0),this.#A(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(void 0!==e)return e}}finally{if(this.#_&&this.#g){let e=this.#g,t;for(;t=e?.shift();)this.#r?.(...t)}}}#G(e){let t=this.#m,i=this.#d[t],n=this.#p[t],r=this.#A(n);r&&n.__abortController.abort(Error("evicted"));let a=r?n.__staleWhileFetching:n;return(this.#b||this.#_)&&void 0!==a&&(this.#b&&this.#i?.(a,i,"evict"),this.#_&&this.#g?.push([a,i,"evict"])),this.#$(t),this.#I?.[t]&&(clearTimeout(this.#I[t]),this.#I[t]=void 0),e&&(this.#d[t]=void 0,this.#p[t]=void 0,this.#v.push(t)),1===this.#l?(this.#m=this.#y=0,this.#v.length=0):this.#m=this.#h[t],this.#c.delete(i),this.#l--,t}has(e,t={}){let{status:i=s.metrics.hasSubscribers?{}:void 0}=t;t.status=i,i&&(i.op="has",i.key=e,i.cache=this);let n=this.#q(e,t);return s.metrics.hasSubscribers&&s.metrics.publish(i),n}#q(e,t={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:n}=t,r=this.#c.get(e);if(void 0!==r){let e=this.#p[r];if(this.#A(e)&&void 0===e.__staleWhileFetching)return!1;if(!this.#C(r))return i&&this.#x(r),n&&(n.has="hit",this.#U(n,r)),!0;n&&(n.has="stale",this.#U(n,r))}else n&&(n.has="miss");return!1}peek(e,t={}){let{status:i=l()?{}:void 0}=t;i&&(i.op="peek",i.key=e,i.cache=this),t.status=i;let n=this.#H(e,t);return s.metrics.hasSubscribers&&s.metrics.publish(i),n}#H(e,t){let{status:i,allowStale:n=this.allowStale}=t,r=this.#c.get(e);if(void 0===r||!n&&this.#C(r)){i&&(i.peek=void 0===r?"miss":"stale");return}let a=this.#p[r],s=this.#A(a)?a.__staleWhileFetching:a;return i&&(void 0!==s?(i.peek="hit",i.value=s):i.peek="miss"),s}#O(e,t,i,n){let r=void 0===t?void 0:this.#p[t];if(this.#A(r))return r;let a=new AbortController,{signal:s}=i;s?.addEventListener("abort",()=>a.abort(s.reason),{signal:a.signal});let o={signal:a.signal,options:i,context:n},l=(n,r=!1)=>{let{aborted:s}=a.signal,l=i.ignoreFetchAbort&&void 0!==n,c=i.ignoreFetchAbort||!!(i.allowStaleOnFetchAbort&&void 0!==n);if(i.status&&(s&&!r?(i.status.fetchAborted=!0,i.status.fetchError=a.signal.reason,l&&(i.status.fetchAbortIgnored=!0)):i.status.fetchResolved=!0),s&&!l&&!r)return u(a.signal.reason,c);let p=this.#p[t];return(p===d||void 0===p&&l&&r)&&(void 0===n?void 0!==d.__staleWhileFetching?this.#p[t]=d.__staleWhileFetching:this.#M(e,"fetch"):(i.status&&(i.status.fetchUpdated=!0),this.#Q(e,n,o.options,d))),n},u=(n,r)=>{let{aborted:s}=a.signal,o=s&&i.allowStaleOnFetchAbort,l=o||i.allowStaleOnFetchRejection,u=l||i.noDeleteOnFetchRejection;if(this.#p[t]===d&&(u&&(r||void 0!==d.__staleWhileFetching)?o||(this.#p[t]=d.__staleWhileFetching):this.#M(e,"fetch")),l)return i.status&&void 0!==d.__staleWhileFetching&&(i.status.returnedStale=!0),d.__staleWhileFetching;if(d.__returned===d)throw n},c=(t,n)=>{let s=this.#a?.(e,r,o);a.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(t(void 0),i.allowStaleOnFetchAbort&&(t=e=>l(e,!0)))}),s&&s instanceof Promise?s.then(e=>t(void 0===e?void 0:e),n):void 0!==s&&t(s)};i.status&&(i.status.fetchDispatched=!0);let d=new Promise(c).then(l,e=>(i.status&&(i.status.fetchRejected=!0,i.status.fetchError=e),u(e,!1))),p=Object.assign(d,{__abortController:a,__staleWhileFetching:r,__returned:void 0});return void 0===t?(this.#Q(e,p,{...o.options,status:void 0}),t=this.#c.get(e)):this.#p[t]=p,p}#A(e){return!!this.#N&&!!e&&e instanceof Promise&&e.hasOwnProperty("__staleWhileFetching")&&e.__abortController instanceof AbortController}fetch(e,t={}){let i=s.tracing.hasSubscribers,{status:n=l()?{}:void 0}=t;t.status=n,n&&t.context&&(n.context=t.context);let r=this.#J(e,t);return n&&i&&(n.trace=!0,s.tracing.tracePromise(()=>r,n).catch(()=>{})),r}async #J(e,t={}){let{allowStale:i=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,ttl:a=this.ttl,noDisposeOnSet:s=this.noDisposeOnSet,size:o=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL,noDeleteOnFetchRejection:c=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:d=this.allowStaleOnFetchRejection,ignoreFetchAbort:p=this.ignoreFetchAbort,allowStaleOnFetchAbort:h=this.allowStaleOnFetchAbort,context:f,forceRefresh:m=!1,status:y,signal:v}=t;if(y&&(y.op="fetch",y.key=e,m&&(y.forceRefresh=!0),y.cache=this),!this.#N)return y&&(y.fetch="get"),this.#K(e,{allowStale:i,updateAgeOnGet:n,noDeleteOnStaleGet:r,status:y});let g={allowStale:i,updateAgeOnGet:n,noDeleteOnStaleGet:r,ttl:a,noDisposeOnSet:s,size:o,sizeCalculation:l,noUpdateTTL:u,noDeleteOnFetchRejection:c,allowStaleOnFetchRejection:d,allowStaleOnFetchAbort:h,ignoreFetchAbort:p,status:y,signal:v},T=this.#c.get(e);if(void 0===T){y&&(y.fetch="miss");let t=this.#O(e,T,g,f);return t.__returned=t}{let t=this.#p[T];if(this.#A(t)){let e=i&&void 0!==t.__staleWhileFetching;return y&&(y.fetch="inflight",e&&(y.returnedStale=!0)),e?t.__staleWhileFetching:t.__returned=t}let r=this.#C(T);if(!m&&!r)return y&&(y.fetch="hit"),this.#R(T),n&&this.#x(T),y&&this.#U(y,T),t;let a=this.#O(e,T,g,f),s=void 0!==a.__staleWhileFetching&&i;return y&&(y.fetch=r?"stale":"refresh",s&&r&&(y.returnedStale=!0)),s?a.__staleWhileFetching:a.__returned=a}}forceFetch(e,t={}){let i=s.tracing.hasSubscribers,{status:n=l()?{}:void 0}=t;t.status=n,n&&t.context&&(n.context=t.context);let r=this.#W(e,t);return n&&i&&(n.trace=!0,s.tracing.tracePromise(()=>r,n).catch(()=>{})),r}async #W(e,t={}){let i=await this.#J(e,t);if(void 0===i)throw Error("fetch() returned undefined");return i}memo(e,t={}){let{status:i=s.metrics.hasSubscribers?{}:void 0}=t;t.status=i,i&&(i.op="memo",i.key=e,t.context&&(i.context=t.context),i.cache=this);let n=this.#Y(e,t);return i&&(i.value=n),s.metrics.hasSubscribers&&s.metrics.publish(i),n}#Y(e,t={}){let i=this.#s;if(!i)throw Error("no memoMethod provided to constructor");let{context:n,status:r,forceRefresh:a,...s}=t;r&&a&&(r.forceRefresh=!0);let o=this.#K(e,s),l=a||void 0===o;if(r&&(r.memo=l?"miss":"hit",l||(r.value=o)),!l)return o;let u=i(e,o,{options:s,context:n});return r&&(r.value=u),this.#Q(e,u,s),u}get(e,t={}){let{status:i=s.metrics.hasSubscribers?{}:void 0}=t;t.status=i,i&&(i.op="get",i.key=e,i.cache=this);let n=this.#K(e,t);return i&&(void 0!==n&&(i.value=n),s.metrics.hasSubscribers&&s.metrics.publish(i)),n}#K(e,t={}){let{allowStale:i=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,status:a}=t,s=this.#c.get(e);if(void 0===s){a&&(a.get="miss");return}let o=this.#p[s],l=this.#A(o);return a&&this.#U(a,s),this.#C(s)?l?(a&&(a.get="stale-fetching"),i&&void 0!==o.__staleWhileFetching?(a&&(a.returnedStale=!0),o.__staleWhileFetching):void 0):(r||this.#M(e,"expire"),a&&(a.get="stale"),i?(a&&(a.returnedStale=!0),o):void 0):(a&&(a.get=l?"fetching":"hit"),this.#R(s),n&&this.#x(s),l?o.__staleWhileFetching:o)}#z(e,t){this.#f[t]=e,this.#h[e]=t}#R(e){e!==this.#y&&(e===this.#m?this.#m=this.#h[e]:this.#z(this.#f[e],this.#h[e]),this.#z(this.#y,e),this.#y=e)}delete(e){return this.#M(e,"delete")}#M(e,t){s.metrics.hasSubscribers&&s.metrics.publish({op:"delete",delete:t,key:e,cache:this});let i=!1;if(0!==this.#l){let n=this.#c.get(e);if(void 0!==n)if(this.#I?.[n]&&(clearTimeout(this.#I[n]),this.#I[n]=void 0),i=!0,1===this.#l)this.#X(t);else{this.#$(n);let i=this.#p[n];if(this.#A(i)?i.__abortController.abort(Error("deleted")):(this.#b||this.#_)&&(this.#b&&this.#i?.(i,e,t),this.#_&&this.#g?.push([i,e,t])),this.#c.delete(e),this.#d[n]=void 0,this.#p[n]=void 0,n===this.#y)this.#y=this.#f[n];else if(n===this.#m)this.#m=this.#h[n];else{let e=this.#f[n];this.#h[e]=this.#h[n];let t=this.#h[n];this.#f[t]=this.#f[n]}this.#l--,this.#v.push(n)}}if(this.#_&&this.#g?.length){let e=this.#g,t;for(;t=e?.shift();)this.#r?.(...t)}return i}clear(){return this.#X("delete")}#X(e){for(let t of this.#L({allowStale:!0})){let i=this.#p[t];if(this.#A(i))i.__abortController.abort(Error("deleted"));else{let n=this.#d[t];this.#b&&this.#i?.(i,n,e),this.#_&&this.#g?.push([i,n,e])}}if(this.#c.clear(),this.#p.fill(void 0),this.#d.fill(void 0),this.#E&&this.#S){for(let e of(this.#E.fill(0),this.#S.fill(0),this.#I??[]))void 0!==e&&clearTimeout(e);this.#I?.fill(void 0)}if(this.#T&&this.#T.fill(0),this.#m=0,this.#y=0,this.#v.length=0,this.#u=0,this.#l=0,this.#_&&this.#g){let e=this.#g,t;for(;t=e?.shift();)this.#r?.(...t)}}}},98142,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.InMemoryLRUCache=void 0;let n=e.r(929030);class r{constructor(e){this.cache=new n.LRUCache({sizeCalculation:r.sizeCalculation,maxSize:0x1e00000,...e})}static sizeCalculation(e){return"string"==typeof e?e.length:"object"==typeof e?Buffer.byteLength(JSON.stringify(e),"utf8"):1}async set(e,t,i){let n=i?{...i,ttl:i.ttl?1e3*i.ttl:0}:void 0;this.cache.set(e,t,n)}async get(e){return this.cache.get(e)}async delete(e){return this.cache.delete(e)}clear(){this.cache.clear()}keys(){return[...this.cache.keys()]}}i.InMemoryLRUCache=r},385258,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.ErrorsAreMissesCache=void 0,i.ErrorsAreMissesCache=class{constructor(e,t){this.cache=e,this.logger=t}async get(e){try{return await this.cache.get(e)}catch(e){this.logger&&(e instanceof Error?this.logger.error(e.message):this.logger.error(e));return}}async set(e,t,i){return this.cache.set(e,t,i)}async delete(e){return this.cache.delete(e)}}},264997,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.ErrorsAreMissesCache=i.InMemoryLRUCache=i.PrefixingKeyValueCache=void 0;var n=e.r(610863);Object.defineProperty(i,"PrefixingKeyValueCache",{enumerable:!0,get:function(){return n.PrefixingKeyValueCache}});var r=e.r(98142);Object.defineProperty(i,"InMemoryLRUCache",{enumerable:!0,get:function(){return r.InMemoryLRUCache}});var a=e.r(385258);Object.defineProperty(i,"ErrorsAreMissesCache",{enumerable:!0,get:function(){return a.ErrorsAreMissesCache}})},27145,(e,t,i)=>{!function(n,r){"use strict";if("function"==typeof define&&define.amd){let n;void 0!==(n=r(e.r,i,t))&&e.v(n)}else t.exports?t.exports=r():n.log=r()}(e.e,function(){"use strict";var e=function(){},t="undefined",i=["trace","debug","info","warn","error"],n={},r=null;function a(e,t){var i=e[t];if("function"==typeof i.bind)return i.bind(e);try{return Function.prototype.bind.call(i,e)}catch(t){return function(){return Function.prototype.apply.apply(i,[e,arguments])}}}function s(){for(var n=this.getLevel(),r=0;r<i.length;r++){var a=i[r];this[a]=r<n?e:this.methodFactory(a,n,this.name)}if(this.log=this.debug,typeof console===t&&n<this.levels.SILENT)return"No console available for logging"}function o(e){return function(){typeof console!==t&&(s.call(this),this[e].apply(this,arguments))}}function l(i,n,r){var s;return"debug"===(s=i)&&(s="log"),typeof console!==t&&(void 0!==console[s]?a(console,s):void 0!==console.log?a(console,"log"):e)||o.apply(this,arguments)}function u(e,t){var a,o,u,c=this;function d(){}function p(e){var t=e;if("string"==typeof t&&void 0!==c.levels[t.toUpperCase()]&&(t=c.levels[t.toUpperCase()]),"number"==typeof t&&t>=0&&t<=c.levels.SILENT)return t;throw TypeError("log.setLevel() called with invalid level: "+e)}c.name=e,c.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},c.methodFactory=t||l,c.getLevel=function(){return null!=u?u:null!=o?o:a},c.setLevel=function(e,t){return u=p(e),!1!==t&&(i[u]||"silent").toUpperCase(),s.call(c)},c.setDefaultLevel=function(e){o=p(e),d()||c.setLevel(e,!1)},c.resetLevel=function(){u=null,s.call(c)},c.enableAll=function(e){c.setLevel(c.levels.TRACE,e)},c.disableAll=function(e){c.setLevel(c.levels.SILENT,e)},c.rebuild=function(){if(r!==c&&(a=p(r.getLevel())),s.call(c),r===c)for(var e in n)n[e].rebuild()},a=p(r?r.getLevel():"WARN");var h=d();null!=h&&(u=p(h)),s.call(c)}return(r=new u).getLogger=function(e){if("symbol"!=typeof e&&"string"!=typeof e||""===e)throw TypeError("You must supply a name when creating a logger.");var t=n[e];return t||(t=n[e]=new u(e,r.methodFactory)),t},r.noConflict=function(){return r},r.getLoggers=function(){return n},r.default=r,r})},531906,(e,t,i)=>{"use strict";t.exports=r,t.exports.preferredCharsets=r;var n=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function r(e,t){var i=function(e){for(var t=e.split(","),i=0,r=0;i<t.length;i++){var a=function(e,t){var i=n.exec(e);if(!i)return null;var r=i[1],a=1;if(i[2])for(var s=i[2].split(";"),o=0;o<s.length;o++){var l=s[o].trim().split("=");if("q"===l[0]){a=parseFloat(l[1]);break}}return{charset:r,q:a,i:t}}(t[i].trim(),i);a&&(t[r++]=a)}return t.length=r,t}(void 0===e?"*":e||"");if(!t)return i.filter(o).sort(a).map(s);var r=t.map(function(e,t){for(var n={o:-1,q:0,s:0},r=0;r<i.length;r++){var a=function(e,t,i){var n=0;if(t.charset.toLowerCase()===e.toLowerCase())n|=1;else if("*"!==t.charset)return null;return{i:i,o:t.i,q:t.q,s:n}}(e,i[r],t);a&&0>(n.s-a.s||n.q-a.q||n.o-a.o)&&(n=a)}return n});return r.filter(o).sort(a).map(function(e){return t[r.indexOf(e)]})}function a(e,t){return t.q-e.q||t.s-e.s||e.o-t.o||e.i-t.i||0}function s(e){return e.charset}function o(e){return e.q>0}},173906,(e,t,i)=>{"use strict";t.exports=a,t.exports.preferredEncodings=a;var n=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function r(e,t,i){var n=0;if(t.encoding.toLowerCase()===e.toLowerCase())n|=1;else if("*"!==t.encoding)return null;return{encoding:e,i:i,o:t.i,q:t.q,s:n}}function a(e,t,i){var a=function(e){for(var t=e.split(","),i=!1,a=1,s=0,o=0;s<t.length;s++){var l=function(e,t){var i=n.exec(e);if(!i)return null;var r=i[1],a=1;if(i[2])for(var s=i[2].split(";"),o=0;o<s.length;o++){var l=s[o].trim().split("=");if("q"===l[0]){a=parseFloat(l[1]);break}}return{encoding:r,q:a,i:t}}(t[s].trim(),s);l&&(t[o++]=l,i=i||r("identity",l),a=Math.min(a,l.q||1))}return i||(t[o++]={encoding:"identity",q:a,i:s}),t.length=o,t}(e||""),u=i?function(e,t){if(e.q!==t.q)return t.q-e.q;var n=i.indexOf(e.encoding),r=i.indexOf(t.encoding);return -1===n&&-1===r?t.s-e.s||e.o-t.o||e.i-t.i:-1!==n&&-1!==r?n-r:-1===n?1:-1}:s;if(!t)return a.filter(l).sort(u).map(o);var c=t.map(function(e,t){for(var i={encoding:e,o:-1,q:0,s:0},n=0;n<a.length;n++){var s=r(e,a[n],t);s&&0>(i.s-s.s||i.q-s.q||i.o-s.o)&&(i=s)}return i});return c.filter(l).sort(u).map(function(e){return t[c.indexOf(e)]})}function s(e,t){return t.q-e.q||t.s-e.s||e.o-t.o||e.i-t.i}function o(e){return e.encoding}function l(e){return e.q>0}},29471,(e,t,i)=>{"use strict";t.exports=a,t.exports.preferredLanguages=a;var n=/^\s*([^\s\-;]+)(?:-([^\s;]+))?\s*(?:;(.*))?$/;function r(e,t){var i=n.exec(e);if(!i)return null;var r=i[1],a=i[2],s=r;a&&(s+="-"+a);var o=1;if(i[3])for(var l=i[3].split(";"),u=0;u<l.length;u++){var c=l[u].split("=");"q"===c[0]&&(o=parseFloat(c[1]))}return{prefix:r,suffix:a,q:o,i:t,full:s}}function a(e,t){var i=function(e){for(var t=e.split(","),i=0,n=0;i<t.length;i++){var a=r(t[i].trim(),i);a&&(t[n++]=a)}return t.length=n,t}(void 0===e?"*":e||"");if(!t)return i.filter(l).sort(s).map(o);var n=t.map(function(e,t){for(var n={o:-1,q:0,s:0},a=0;a<i.length;a++){var s=function(e,t,i){var n=r(e);if(!n)return null;var a=0;if(t.full.toLowerCase()===n.full.toLowerCase())a|=4;else if(t.prefix.toLowerCase()===n.full.toLowerCase())a|=2;else if(t.full.toLowerCase()===n.prefix.toLowerCase())a|=1;else if("*"!==t.full)return null;return{i:i,o:t.i,q:t.q,s:a}}(e,i[a],t);s&&0>(n.s-s.s||n.q-s.q||n.o-s.o)&&(n=s)}return n});return n.filter(l).sort(s).map(function(e){return t[n.indexOf(e)]})}function s(e,t){return t.q-e.q||t.s-e.s||e.o-t.o||e.i-t.i||0}function o(e){return e.full}function l(e){return e.q>0}},715035,(e,t,i)=>{"use strict";t.exports=a,t.exports.preferredMediaTypes=a;var n=/^\s*([^\s\/;]+)\/([^;\s]+)\s*(?:;(.*))?$/;function r(e,t){var i=n.exec(e);if(!i)return null;var r=Object.create(null),a=1,s=i[2],o=i[1];if(i[3])for(var l=(function(e){for(var t=e.split(";"),i=1,n=0;i<t.length;i++)u(t[n])%2==0?t[++n]=t[i]:t[n]+=";"+t[i];t.length=n+1;for(var i=0;i<t.length;i++)t[i]=t[i].trim();return t})(i[3]).map(c),d=0;d<l.length;d++){var p=l[d],h=p[0].toLowerCase(),f=p[1],m=f&&'"'===f[0]&&'"'===f[f.length-1]?f.slice(1,-1):f;if("q"===h){a=parseFloat(m);break}r[h]=m}return{type:o,subtype:s,params:r,q:a,i:t}}function a(e,t){var i=function(e){for(var t=function(e){for(var t=e.split(","),i=1,n=0;i<t.length;i++)u(t[n])%2==0?t[++n]=t[i]:t[n]+=","+t[i];return t.length=n+1,t}(e),i=0,n=0;i<t.length;i++){var a=r(t[i].trim(),i);a&&(t[n++]=a)}return t.length=n,t}(void 0===e?"*/*":e||"");if(!t)return i.filter(l).sort(s).map(o);var n=t.map(function(e,t){for(var n={o:-1,q:0,s:0},a=0;a<i.length;a++){var s=function(e,t,i){var n=r(e),a=0;if(!n)return null;if(t.type.toLowerCase()==n.type.toLowerCase())a|=4;else if("*"!=t.type)return null;if(t.subtype.toLowerCase()==n.subtype.toLowerCase())a|=2;else if("*"!=t.subtype)return null;var s=Object.keys(t.params);if(s.length>0)if(!s.every(function(e){return"*"==t.params[e]||(t.params[e]||"").toLowerCase()==(n.params[e]||"").toLowerCase()}))return null;else a|=1;return{i:i,o:t.i,q:t.q,s:a}}(e,i[a],t);s&&0>(n.s-s.s||n.q-s.q||n.o-s.o)&&(n=s)}return n});return n.filter(l).sort(s).map(function(e){return t[n.indexOf(e)]})}function s(e,t){return t.q-e.q||t.s-e.s||e.o-t.o||e.i-t.i||0}function o(e){return e.type+"/"+e.subtype}function l(e){return e.q>0}function u(e){for(var t=0,i=0;-1!==(i=e.indexOf('"',i));)t++,i++;return t}function c(e){var t,i,n=e.indexOf("=");return -1===n?t=e:(t=e.slice(0,n),i=e.slice(n+1)),[t,i]}},228069,(e,t,i)=>{"use strict";var n=e.r(531906),r=e.r(173906),a=e.r(29471),s=e.r(715035);function o(e){if(!(this instanceof o))return new o(e);this.request=e}t.exports=o,t.exports.Negotiator=o,o.prototype.charset=function(e){var t=this.charsets(e);return t&&t[0]},o.prototype.charsets=function(e){return n(this.request.headers["accept-charset"],e)},o.prototype.encoding=function(e,t){var i=this.encodings(e,t);return i&&i[0]},o.prototype.encodings=function(e,t){return r(this.request.headers["accept-encoding"],e,(t||{}).preferred)},o.prototype.language=function(e){var t=this.languages(e);return t&&t[0]},o.prototype.languages=function(e){return a(this.request.headers["accept-language"],e)},o.prototype.mediaType=function(e){var t=this.mediaTypes(e);return t&&t[0]},o.prototype.mediaTypes=function(e){return s(this.request.headers.accept,e)},o.prototype.preferredCharset=o.prototype.charset,o.prototype.preferredCharsets=o.prototype.charsets,o.prototype.preferredEncoding=o.prototype.encoding,o.prototype.preferredEncodings=o.prototype.encodings,o.prototype.preferredLanguage=o.prototype.language,o.prototype.preferredLanguages=o.prototype.languages,o.prototype.preferredMediaType=o.prototype.mediaType,o.prototype.preferredMediaTypes=o.prototype.mediaTypes},692116,(e,t,i)=>{"use strict";i.removeLeadingAndTrailingHTTPWhitespace=e=>e.replace(/^[ \t\n\r]+/u,"").replace(/[ \t\n\r]+$/u,""),i.removeTrailingHTTPWhitespace=e=>e.replace(/[ \t\n\r]+$/u,""),i.isHTTPWhitespaceChar=e=>" "===e||" "===e||"\n"===e||"\r"===e,i.solelyContainsHTTPTokenCodePoints=e=>/^[-!#$%&'*+.^_`|~A-Za-z0-9]*$/u.test(e),i.soleyContainsHTTPQuotedStringTokenCodePoints=e=>/^[\t\u0020-\u007E\u0080-\u00FF]*$/u.test(e),i.asciiLowercase=e=>e.replace(/[A-Z]/ug,e=>e.toLowerCase()),i.collectAnHTTPQuotedString=(e,t)=>{let i="";for(t++;;){for(;t<e.length&&'"'!==e[t]&&"\\"!==e[t];)i+=e[t],++t;if(t>=e.length)break;let n=e[t];if(++t,"\\"===n){if(t>=e.length){i+="\\";break}i+=e[t],++t}else break}return[i,t]}},60248,(e,t,i)=>{"use strict";let{asciiLowercase:n,solelyContainsHTTPTokenCodePoints:r,soleyContainsHTTPQuotedStringTokenCodePoints:a}=e.r(692116);t.exports=class{constructor(e){this._map=e}get size(){return this._map.size}get(e){return e=n(String(e)),this._map.get(e)}has(e){return e=n(String(e)),this._map.has(e)}set(e,t){if(e=n(String(e)),t=String(t),!r(e))throw Error(`Invalid MIME type parameter name "${e}": only HTTP token code points are valid.`);if(!a(t))throw Error(`Invalid MIME type parameter value "${t}": only HTTP quoted-string token code points are valid.`);return this._map.set(e,t)}clear(){this._map.clear()}delete(e){return e=n(String(e)),this._map.delete(e)}forEach(e,t){this._map.forEach(e,t)}keys(){return this._map.keys()}values(){return this._map.values()}entries(){return this._map.entries()}[Symbol.iterator](){return this._map[Symbol.iterator]()}}},453291,(e,t,i)=>{"use strict";let{removeLeadingAndTrailingHTTPWhitespace:n,removeTrailingHTTPWhitespace:r,isHTTPWhitespaceChar:a,solelyContainsHTTPTokenCodePoints:s,soleyContainsHTTPQuotedStringTokenCodePoints:o,asciiLowercase:l,collectAnHTTPQuotedString:u}=e.r(692116);t.exports=e=>{e=n(e);let t=0,i="";for(;t<e.length&&"/"!==e[t];)i+=e[t],++t;if(0===i.length||!s(i)||t>=e.length)return null;++t;let c="";for(;t<e.length&&";"!==e[t];)c+=e[t],++t;if(0===(c=r(c)).length||!s(c))return null;let d={type:l(i),subtype:l(c),parameters:new Map};for(;t<e.length;){for(++t;a(e[t]);)++t;let i="";for(;t<e.length&&";"!==e[t]&&"="!==e[t];)i+=e[t],++t;if(i=l(i),t<e.length){if(";"===e[t])continue;++t}let n=null;if('"'===e[t])for([n,t]=u(e,t);t<e.length&&";"!==e[t];)++t;else{for(n="";t<e.length&&";"!==e[t];)n+=e[t],++t;if(""===(n=r(n)))continue}i.length>0&&s(i)&&o(n)&&!d.parameters.has(i)&&d.parameters.set(i,n)}return d}},857717,(e,t,i)=>{"use strict";let{solelyContainsHTTPTokenCodePoints:n}=e.r(692116);t.exports=e=>{let t=`${e.type}/${e.subtype}`;if(0===e.parameters.size)return t;for(let[i,r]of e.parameters)t+=";",t+=i,t+="=",n(r)&&0!==r.length||(r=r.replace(/(["\\])/ug,"\\$1"),r=`"${r}"`),t+=r;return t}},794392,(e,t,i)=>{"use strict";let n=e.r(60248),r=e.r(453291),a=e.r(857717),{asciiLowercase:s,solelyContainsHTTPTokenCodePoints:o}=e.r(692116);t.exports=class{constructor(e){const t=r(e=String(e));if(null===t)throw Error(`Could not parse MIME type string "${e}"`);this._type=t.type,this._subtype=t.subtype,this._parameters=new n(t.parameters)}static parse(e){try{return new this(e)}catch(e){return null}}get essence(){return`${this.type}/${this.subtype}`}get type(){return this._type}set type(e){if(0===(e=s(String(e))).length)throw Error("Invalid type: must be a non-empty string");if(!o(e))throw Error(`Invalid type ${e}: must contain only HTTP token code points`);this._type=e}get subtype(){return this._subtype}set subtype(e){if(0===(e=s(String(e))).length)throw Error("Invalid subtype: must be a non-empty string");if(!o(e))throw Error(`Invalid subtype ${e}: must contain only HTTP token code points`);this._subtype=e}get parameters(){return this._parameters}toString(){return a(this)}isJavaScript({prohibitParameters:e=!1}={}){switch(this._type){case"text":switch(this._subtype){case"ecmascript":case"javascript":case"javascript1.0":case"javascript1.1":case"javascript1.2":case"javascript1.3":case"javascript1.4":case"javascript1.5":case"jscript":case"livescript":case"x-ecmascript":case"x-javascript":return!e||0===this._parameters.size;default:return!1}case"application":switch(this._subtype){case"ecmascript":case"javascript":case"x-ecmascript":case"x-javascript":return!e||0===this._parameters.size;default:return!1}default:return!1}}isXML(){return"xml"===this._subtype&&("text"===this._type||"application"===this._type)||this._subtype.endsWith("+xml")}isHTML(){return"html"===this._subtype&&"text"===this._type}}},294682,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0})},786390,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.devAssert=function(e,t){if(!e)throw Error(t)}},287547,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.mapValue=function(e,t){let i=Object.create(null);for(let n of Object.keys(e))i[n]=t(e[n],n);return i}},776887,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.isObjectLike=function(e){return"object"==typeof e&&null!==e}},119588,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.invariant=function(e,t){if(!e)throw Error(null!=t?t:"Unexpected invariant triggered.")}},192752,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.getLocation=function(e,t){let i=0,a=1;for(let s of e.body.matchAll(r)){if("number"==typeof s.index||(0,n.invariant)(!1),s.index>=t)break;i=s.index+s[0].length,a+=1}return{line:a,column:t+1-i}};var n=e.r(119588);let r=/\r\n|[\n\r]/g},515424,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.printLocation=function(e){return r(e.source,(0,n.getLocation)(e.source,e.start))},i.printSourceLocation=r;var n=e.r(192752);function r(e,t){let i=e.locationOffset.column-1,n="".padStart(i)+e.body,r=t.line-1,s=e.locationOffset.line-1,o=t.line+s,l=1===t.line?i:0,u=t.column+l,c=`${e.name}:${o}:${u}
|
|
1
|
+
module.exports=[610863,(e,t,i)=>{"use strict";var n;Object.defineProperty(i,"__esModule",{value:!0}),i.PrefixingKeyValueCache=void 0;let r=Symbol("prefixesAreUnnecessaryForIsolation");class a{constructor(e,t){this.wrapped=e,a.prefixesAreUnnecessaryForIsolation(e)?(this.prefix="",this[r]=!0):this.prefix=t}get(e){return this.wrapped.get(this.prefix+e)}set(e,t,i){return this.wrapped.set(this.prefix+e,t,i)}delete(e){return this.wrapped.delete(this.prefix+e)}static prefixesAreUnnecessaryForIsolation(e){return r in e}static cacheDangerouslyDoesNotNeedPrefixesForIsolation(e){return new s(e)}}i.PrefixingKeyValueCache=a;class s{constructor(e){this.wrapped=e,this[n]=!0}get(e){return this.wrapped.get(e)}set(e,t,i){return this.wrapped.set(e,t,i)}delete(e){return this.wrapped.delete(e)}}n=r},929030,(e,t,i)=>{"use strict";var n=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),r=n(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.tracing=t.metrics=void 0;var i=e.r(677652);t.metrics=(0,i.channel)("lru-cache:metrics"),t.tracing=(0,i.tracingChannel)("lru-cache")}),a=n(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.defaultPerf=void 0,e.defaultPerf="object"==typeof performance&&performance&&"function"==typeof performance.now?performance:Date});Object.defineProperty(i,"__esModule",{value:!0}),i.LRUCache=void 0;var s=r(),o=a(),l=()=>s.metrics.hasSubscribers||s.tracing.hasSubscribers,u=new Set,c="object"==typeof process&&process?process:{},d=e=>!!e&&e===Math.floor(e)&&e>0&&isFinite(e),p=e=>d(e)?e<=256?Uint8Array:e<=65536?Uint16Array:e<=0x100000000?Uint32Array:e<=Number.MAX_SAFE_INTEGER?h:null:null,h=class extends Array{constructor(e){super(e),this.fill(0)}},f=class e{heap;length;static #e=!1;static create(t){let i=p(t);if(!i)return[];e.#e=!0;let n=new e(t,i);return e.#e=!1,n}constructor(t,i){if(!e.#e)throw TypeError("instantiate Stack using Stack.create(n)");this.heap=new i(t),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}};i.LRUCache=class e{#e;#t;#i;#n;#r;#a;#s;#o;get perf(){return this.#o}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;backgroundFetchSize;#l;#u;#c;#d;#p;#h;#f;#m;#y;#v;#g;#T;#S;#E;#I;#b;#N;#_;#D;static unsafeExposeInternals(e){return{starts:e.#S,ttls:e.#E,autopurgeTimers:e.#I,sizes:e.#T,keyMap:e.#c,keyList:e.#d,valList:e.#p,next:e.#h,prev:e.#f,get head(){return e.#m},get tail(){return e.#y},free:e.#v,isBackgroundFetch:t=>e.#A(t),backgroundFetch:(t,i,n,r)=>e.#O(t,i,n,r),moveToTail:t=>e.#R(t),indexes:t=>e.#w(t),rindexes:t=>e.#L(t),isStale:t=>e.#C(t)}}get max(){return this.#e}get maxSize(){return this.#t}get calculatedSize(){return this.#u}get size(){return this.#l}get fetchMethod(){return this.#a}get memoMethod(){return this.#s}get dispose(){return this.#i}get onInsert(){return this.#n}get disposeAfter(){return this.#r}constructor(t){let{max:i=0,ttl:n,ttlResolution:r=1,ttlAutopurge:a,updateAgeOnGet:s,updateAgeOnHas:l,allowStale:h,dispose:m,onInsert:y,disposeAfter:v,noDisposeOnSet:g,noUpdateTTL:T,maxSize:S=0,maxEntrySize:E=0,sizeCalculation:I,fetchMethod:b,memoMethod:N,noDeleteOnFetchRejection:_,noDeleteOnStaleGet:D,allowStaleOnFetchRejection:A,allowStaleOnFetchAbort:O,ignoreFetchAbort:R,backgroundFetchSize:w=1,perf:L}=t;if(this.backgroundFetchSize=w,void 0!==L&&"function"!=typeof L?.now)throw TypeError("perf option must have a now() method if specified");if(this.#o=L??o.defaultPerf,0!==i&&!d(i))throw TypeError("max option must be a nonnegative integer");let C=i?p(i):Array;if(!C)throw Error("invalid max value: "+i);if(this.#e=i,this.#t=S,this.maxEntrySize=E||this.#t,this.sizeCalculation=I,this.sizeCalculation){if(!this.#t&&!this.maxEntrySize)throw TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if("function"!=typeof this.sizeCalculation)throw TypeError("sizeCalculation set to non-function")}if(void 0!==N&&"function"!=typeof N)throw TypeError("memoMethod must be a function if defined");if(this.#s=N,void 0!==b&&"function"!=typeof b)throw TypeError("fetchMethod must be a function if specified");if(this.#a=b,this.#N=!!b,this.#c=new Map,this.#d=Array.from({length:i}).fill(void 0),this.#p=Array.from({length:i}).fill(void 0),this.#h=new C(i),this.#f=new C(i),this.#m=0,this.#y=0,this.#v=f.create(i),this.#l=0,this.#u=0,"function"==typeof m&&(this.#i=m),"function"==typeof y&&(this.#n=y),"function"==typeof v?(this.#r=v,this.#g=[]):(this.#r=void 0,this.#g=void 0),this.#b=!!this.#i,this.#D=!!this.#n,this.#_=!!this.#r,this.noDisposeOnSet=!!g,this.noUpdateTTL=!!T,this.noDeleteOnFetchRejection=!!_,this.allowStaleOnFetchRejection=!!A,this.allowStaleOnFetchAbort=!!O,this.ignoreFetchAbort=!!R,0!==this.maxEntrySize){if(0!==this.#t&&!d(this.#t))throw TypeError("maxSize must be a positive integer if specified");if(!d(this.maxEntrySize))throw TypeError("maxEntrySize must be a positive integer if specified");this.#F()}if(this.allowStale=!!h,this.noDeleteOnStaleGet=!!D,this.updateAgeOnGet=!!s,this.updateAgeOnHas=!!l,this.ttlResolution=d(r)||0===r?r:1,this.ttlAutopurge=!!a,this.ttl=n||0,this.ttl){if(!d(this.ttl))throw TypeError("ttl must be a positive integer if specified");this.#k()}if(0===this.#e&&0===this.ttl&&0===this.#t)throw TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#e&&!this.#t){let t="LRU_CACHE_UNBOUNDED";(e=>!u.has(e))(t)&&(u.add(t),((e,t,i,n)=>{"function"==typeof c.emitWarning?c.emitWarning(e,t,i,n):console.error(`[${i}] ${t}: ${e}`)})("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",t,e))}}getRemainingTTL(e){return this.#c.has(e)?1/0:0}#k(){let e=new h(this.#e),t=new h(this.#e);this.#E=e,this.#S=t;let i=this.ttlAutopurge?Array.from({length:this.#e}):void 0;this.#I=i,this.#P=(i,r,a=this.#o.now())=>{t[i]=0!==r?a:0,e[i]=r,n(i,r)},this.#x=i=>{t[i]=0!==e[i]?this.#o.now():0,n(i,e[i])};let n=this.ttlAutopurge?(e,t)=>{if(i?.[e]&&(clearTimeout(i[e]),i[e]=void 0),t&&0!==t&&i){let r=setTimeout(()=>{this.#C(e)?(this.#M(this.#d[e],"expire"),i[e]=void 0):n(e,s(e))},t+1);r.unref&&r.unref(),i[e]=r}}:()=>{};this.#U=(i,n)=>{if(e[n]){let s=e[n],o=t[n];if(!s||!o)return;i.ttl=s,i.start=o,i.now=r||a();let l=i.now-o;i.remainingTTL=s-l}};let r=0,a=()=>{let e=this.#o.now();if(this.ttlResolution>0){r=e;let t=setTimeout(()=>r=0,this.ttlResolution);t.unref&&t.unref()}return e};this.getRemainingTTL=e=>{let t=this.#c.get(e);return void 0===t?0:s(t)};let s=i=>{let n=e[i],s=t[i];return n&&s?n-((r||a())-s):1/0};this.#C=i=>{let n=t[i],s=e[i];return!!s&&!!n&&(r||a())-n>s}}#x=()=>{};#U=()=>{};#P=()=>{};#C=()=>!1;#F(){let e=new h(this.#e);this.#u=0,this.#T=e,this.#$=t=>{this.#u-=e[t],e[t]=0},this.#j=(e,t,i,n)=>{if(!d(i)){if(this.#A(t))return this.backgroundFetchSize;if(n){if("function"!=typeof n)throw TypeError("sizeCalculation must be a function");if(!d(i=n(t,e)))throw TypeError("sizeCalculation return invalid (expect positive integer)")}else throw TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.")}return i},this.#V=(t,i,n)=>{if(e[t]=i,this.#t){let i=this.#t-e[t];for(;this.#u>i;)this.#G(!0)}this.#u+=e[t],n&&(n.entrySize=i,n.totalCalculatedSize=this.#u)}}#$=e=>{};#V=(e,t,i)=>{};#j=(e,t,i,n)=>{if(i||n)throw TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#w({allowStale:e=this.allowStale}={}){if(this.#l)for(let t=this.#y;this.#B(t)&&((e||!this.#C(t))&&(yield t),t!==this.#m);)t=this.#f[t]}*#L({allowStale:e=this.allowStale}={}){if(this.#l)for(let t=this.#m;this.#B(t)&&((e||!this.#C(t))&&(yield t),t!==this.#y);)t=this.#h[t]}#B(e){return void 0!==e&&this.#c.get(this.#d[e])===e}*entries(){for(let e of this.#w())void 0===this.#p[e]||void 0===this.#d[e]||this.#A(this.#p[e])||(yield[this.#d[e],this.#p[e]])}*rentries(){for(let e of this.#L())void 0===this.#p[e]||void 0===this.#d[e]||this.#A(this.#p[e])||(yield[this.#d[e],this.#p[e]])}*keys(){for(let e of this.#w()){let t=this.#d[e];void 0===t||this.#A(this.#p[e])||(yield t)}}*rkeys(){for(let e of this.#L()){let t=this.#d[e];void 0===t||this.#A(this.#p[e])||(yield t)}}*values(){for(let e of this.#w())void 0===this.#p[e]||this.#A(this.#p[e])||(yield this.#p[e])}*rvalues(){for(let e of this.#L())void 0===this.#p[e]||this.#A(this.#p[e])||(yield this.#p[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(let i of this.#w()){let n=this.#p[i],r=this.#A(n)?n.__staleWhileFetching:n;if(void 0!==r&&e(r,this.#d[i],this))return this.#K(this.#d[i],t)}}forEach(e,t=this){for(let i of this.#w()){let n=this.#p[i],r=this.#A(n)?n.__staleWhileFetching:n;void 0!==r&&e.call(t,r,this.#d[i],this)}}rforEach(e,t=this){for(let i of this.#L()){let n=this.#p[i],r=this.#A(n)?n.__staleWhileFetching:n;void 0!==r&&e.call(t,r,this.#d[i],this)}}purgeStale(){let e=!1;for(let t of this.#L({allowStale:!0}))this.#C(t)&&(this.#M(this.#d[t],"expire"),e=!0);return e}info(e){let t=this.#c.get(e);if(void 0===t)return;let i=this.#p[t],n=this.#A(i)?i.__staleWhileFetching:i;if(void 0===n)return;let r={value:n};if(this.#E&&this.#S){let e=this.#E[t],i=this.#S[t];e&&i&&(r.ttl=e-(this.#o.now()-i),r.start=Date.now())}return this.#T&&(r.size=this.#T[t]),r}dump(){let e=[];for(let t of this.#w({allowStale:!0})){let i=this.#d[t],n=this.#p[t],r=this.#A(n)?n.__staleWhileFetching:n;if(void 0===r||void 0===i)continue;let a={value:r};if(this.#E&&this.#S){a.ttl=this.#E[t];let e=this.#o.now()-this.#S[t];a.start=Math.floor(Date.now()-e)}this.#T&&(a.size=this.#T[t]),e.unshift([i,a])}return e}load(e){for(let[t,i]of(this.clear(),e)){if(i.start){let e=Date.now()-i.start;i.start=this.#o.now()-e}this.#Q(t,i.value,i)}}set(e,t,i={}){let{status:n=s.metrics.hasSubscribers?{}:void 0}=i;i.status=n,n&&(n.op="set",n.key=e,void 0!==t&&(n.value=t),n.cache=this);let r=this.#Q(e,t,i);return n&&s.metrics.hasSubscribers&&s.metrics.publish(n),r}#Q(e,t,i,n){let{ttl:r=this.ttl,start:a,noDisposeOnSet:s=this.noDisposeOnSet,sizeCalculation:o=this.sizeCalculation,status:l}=i,u=this.#A(t);if(void 0===t)return l&&(l.set="deleted"),this.delete(e),this;let{noUpdateTTL:c=this.noUpdateTTL}=i;l&&!u&&(l.value=t);let d=this.#j(e,t,i.size||0,o,l);if(this.maxEntrySize&&d>this.maxEntrySize)return this.#M(e,"set"),l&&(l.set="miss",l.maxEntrySizeExceeded=!0),this;let p=0===this.#l?void 0:this.#c.get(e);if(void 0===p)p=0===this.#l?this.#y:0!==this.#v.length?this.#v.pop():this.#l===this.#e?this.#G(!1):this.#l,this.#d[p]=e,this.#p[p]=t,this.#c.set(e,p),this.#h[this.#y]=p,this.#f[p]=this.#y,this.#y=p,this.#l++,this.#V(p,d,l),l&&(l.set="add"),c=!1,this.#D&&!u&&this.#n?.(t,e,"add");else{this.#R(p);let i=this.#p[p];if(t!==i){if(!s)if(this.#A(i)){i!==n&&i.__abortController.abort(Error("replaced"));let{__staleWhileFetching:r}=i;void 0!==r&&r!==t&&(this.#b&&this.#i?.(r,e,"set"),this.#_&&this.#g?.push([r,e,"set"]))}else this.#b&&this.#i?.(i,e,"set"),this.#_&&this.#g?.push([i,e,"set"]);if(this.#$(p),this.#V(p,d,l),this.#p[p]=t,!u){let n=i&&this.#A(i)?i.__staleWhileFetching:i,r=void 0===n?"add":t!==n?"replace":"update";l&&(l.set=r,void 0!==n&&(l.oldValue=n)),this.#D&&this.onInsert?.(t,e,r)}}else u||(l&&(l.set="update"),this.#D&&this.onInsert?.(t,e,"update"))}if(0===r||this.#E||this.#k(),this.#E&&(c||this.#P(p,r,a),l&&this.#U(l,p)),!s&&this.#_&&this.#g){let e=this.#g,t;for(;t=e?.shift();)this.#r?.(...t)}return this}pop(){try{for(;this.#l;){let e=this.#p[this.#m];if(this.#G(!0),this.#A(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(void 0!==e)return e}}finally{if(this.#_&&this.#g){let e=this.#g,t;for(;t=e?.shift();)this.#r?.(...t)}}}#G(e){let t=this.#m,i=this.#d[t],n=this.#p[t],r=this.#A(n);r&&n.__abortController.abort(Error("evicted"));let a=r?n.__staleWhileFetching:n;return(this.#b||this.#_)&&void 0!==a&&(this.#b&&this.#i?.(a,i,"evict"),this.#_&&this.#g?.push([a,i,"evict"])),this.#$(t),this.#I?.[t]&&(clearTimeout(this.#I[t]),this.#I[t]=void 0),e&&(this.#d[t]=void 0,this.#p[t]=void 0,this.#v.push(t)),1===this.#l?(this.#m=this.#y=0,this.#v.length=0):this.#m=this.#h[t],this.#c.delete(i),this.#l--,t}has(e,t={}){let{status:i=s.metrics.hasSubscribers?{}:void 0}=t;t.status=i,i&&(i.op="has",i.key=e,i.cache=this);let n=this.#q(e,t);return s.metrics.hasSubscribers&&s.metrics.publish(i),n}#q(e,t={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:n}=t,r=this.#c.get(e);if(void 0!==r){let e=this.#p[r];if(this.#A(e)&&void 0===e.__staleWhileFetching)return!1;if(!this.#C(r))return i&&this.#x(r),n&&(n.has="hit",this.#U(n,r)),!0;n&&(n.has="stale",this.#U(n,r))}else n&&(n.has="miss");return!1}peek(e,t={}){let{status:i=l()?{}:void 0}=t;i&&(i.op="peek",i.key=e,i.cache=this),t.status=i;let n=this.#J(e,t);return s.metrics.hasSubscribers&&s.metrics.publish(i),n}#J(e,t){let{status:i,allowStale:n=this.allowStale}=t,r=this.#c.get(e);if(void 0===r||!n&&this.#C(r)){i&&(i.peek=void 0===r?"miss":"stale");return}let a=this.#p[r],s=this.#A(a)?a.__staleWhileFetching:a;return i&&(void 0!==s?(i.peek="hit",i.value=s):i.peek="miss"),s}#O(e,t,i,n){let r=void 0===t?void 0:this.#p[t];if(this.#A(r))return r;let a=new AbortController,{signal:s}=i;s?.addEventListener("abort",()=>a.abort(s.reason),{signal:a.signal});let o={signal:a.signal,options:i,context:n},l=(n,r=!1)=>{let{aborted:s}=a.signal,l=i.ignoreFetchAbort&&void 0!==n,c=i.ignoreFetchAbort||!!(i.allowStaleOnFetchAbort&&void 0!==n);if(i.status&&(s&&!r?(i.status.fetchAborted=!0,i.status.fetchError=a.signal.reason,l&&(i.status.fetchAbortIgnored=!0)):i.status.fetchResolved=!0),s&&!l&&!r)return u(a.signal.reason,c);let p=this.#p[t];return(p===d||void 0===p&&l&&r)&&(void 0===n?void 0!==d.__staleWhileFetching?this.#p[t]=d.__staleWhileFetching:this.#M(e,"fetch"):(i.status&&(i.status.fetchUpdated=!0),this.#Q(e,n,o.options,d))),n},u=(n,r)=>{let{aborted:s}=a.signal,o=s&&i.allowStaleOnFetchAbort,l=o||i.allowStaleOnFetchRejection,u=l||i.noDeleteOnFetchRejection;if(this.#p[t]===d&&(u&&(r||void 0!==d.__staleWhileFetching)?o||(this.#p[t]=d.__staleWhileFetching):this.#M(e,"fetch")),l)return i.status&&void 0!==d.__staleWhileFetching&&(i.status.returnedStale=!0),d.__staleWhileFetching;if(d.__returned===d)throw n},c=(t,n)=>{let s=this.#a?.(e,r,o);a.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(t(void 0),i.allowStaleOnFetchAbort&&(t=e=>l(e,!0)))}),s&&s instanceof Promise?s.then(e=>t(void 0===e?void 0:e),n):void 0!==s&&t(s)};i.status&&(i.status.fetchDispatched=!0);let d=new Promise(c).then(l,e=>(i.status&&(i.status.fetchRejected=!0,i.status.fetchError=e),u(e,!1))),p=Object.assign(d,{__abortController:a,__staleWhileFetching:r,__returned:void 0});return void 0===t?(this.#Q(e,p,{...o.options,status:void 0}),t=this.#c.get(e)):this.#p[t]=p,p}#A(e){return!!this.#N&&!!e&&e instanceof Promise&&e.hasOwnProperty("__staleWhileFetching")&&e.__abortController instanceof AbortController}fetch(e,t={}){let i=s.tracing.hasSubscribers,{status:n=l()?{}:void 0}=t;t.status=n,n&&t.context&&(n.context=t.context);let r=this.#H(e,t);return n&&i&&(n.trace=!0,s.tracing.tracePromise(()=>r,n).catch(()=>{})),r}async #H(e,t={}){let{allowStale:i=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,ttl:a=this.ttl,noDisposeOnSet:s=this.noDisposeOnSet,size:o=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL,noDeleteOnFetchRejection:c=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:d=this.allowStaleOnFetchRejection,ignoreFetchAbort:p=this.ignoreFetchAbort,allowStaleOnFetchAbort:h=this.allowStaleOnFetchAbort,context:f,forceRefresh:m=!1,status:y,signal:v}=t;if(y&&(y.op="fetch",y.key=e,m&&(y.forceRefresh=!0),y.cache=this),!this.#N)return y&&(y.fetch="get"),this.#K(e,{allowStale:i,updateAgeOnGet:n,noDeleteOnStaleGet:r,status:y});let g={allowStale:i,updateAgeOnGet:n,noDeleteOnStaleGet:r,ttl:a,noDisposeOnSet:s,size:o,sizeCalculation:l,noUpdateTTL:u,noDeleteOnFetchRejection:c,allowStaleOnFetchRejection:d,allowStaleOnFetchAbort:h,ignoreFetchAbort:p,status:y,signal:v},T=this.#c.get(e);if(void 0===T){y&&(y.fetch="miss");let t=this.#O(e,T,g,f);return t.__returned=t}{let t=this.#p[T];if(this.#A(t)){let e=i&&void 0!==t.__staleWhileFetching;return y&&(y.fetch="inflight",e&&(y.returnedStale=!0)),e?t.__staleWhileFetching:t.__returned=t}let r=this.#C(T);if(!m&&!r)return y&&(y.fetch="hit"),this.#R(T),n&&this.#x(T),y&&this.#U(y,T),t;let a=this.#O(e,T,g,f),s=void 0!==a.__staleWhileFetching&&i;return y&&(y.fetch=r?"stale":"refresh",s&&r&&(y.returnedStale=!0)),s?a.__staleWhileFetching:a.__returned=a}}forceFetch(e,t={}){let i=s.tracing.hasSubscribers,{status:n=l()?{}:void 0}=t;t.status=n,n&&t.context&&(n.context=t.context);let r=this.#W(e,t);return n&&i&&(n.trace=!0,s.tracing.tracePromise(()=>r,n).catch(()=>{})),r}async #W(e,t={}){let i=await this.#H(e,t);if(void 0===i)throw Error("fetch() returned undefined");return i}memo(e,t={}){let{status:i=s.metrics.hasSubscribers?{}:void 0}=t;t.status=i,i&&(i.op="memo",i.key=e,t.context&&(i.context=t.context),i.cache=this);let n=this.#Y(e,t);return i&&(i.value=n),s.metrics.hasSubscribers&&s.metrics.publish(i),n}#Y(e,t={}){let i=this.#s;if(!i)throw Error("no memoMethod provided to constructor");let{context:n,status:r,forceRefresh:a,...s}=t;r&&a&&(r.forceRefresh=!0);let o=this.#K(e,s),l=a||void 0===o;if(r&&(r.memo=l?"miss":"hit",l||(r.value=o)),!l)return o;let u=i(e,o,{options:s,context:n});return r&&(r.value=u),this.#Q(e,u,s),u}get(e,t={}){let{status:i=s.metrics.hasSubscribers?{}:void 0}=t;t.status=i,i&&(i.op="get",i.key=e,i.cache=this);let n=this.#K(e,t);return i&&(void 0!==n&&(i.value=n),s.metrics.hasSubscribers&&s.metrics.publish(i)),n}#K(e,t={}){let{allowStale:i=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,status:a}=t,s=this.#c.get(e);if(void 0===s){a&&(a.get="miss");return}let o=this.#p[s],l=this.#A(o);return a&&this.#U(a,s),this.#C(s)?l?(a&&(a.get="stale-fetching"),i&&void 0!==o.__staleWhileFetching?(a&&(a.returnedStale=!0),o.__staleWhileFetching):void 0):(r||this.#M(e,"expire"),a&&(a.get="stale"),i?(a&&(a.returnedStale=!0),o):void 0):(a&&(a.get=l?"fetching":"hit"),this.#R(s),n&&this.#x(s),l?o.__staleWhileFetching:o)}#z(e,t){this.#f[t]=e,this.#h[e]=t}#R(e){e!==this.#y&&(e===this.#m?this.#m=this.#h[e]:this.#z(this.#f[e],this.#h[e]),this.#z(this.#y,e),this.#y=e)}delete(e){return this.#M(e,"delete")}#M(e,t){s.metrics.hasSubscribers&&s.metrics.publish({op:"delete",delete:t,key:e,cache:this});let i=!1;if(0!==this.#l){let n=this.#c.get(e);if(void 0!==n)if(this.#I?.[n]&&(clearTimeout(this.#I[n]),this.#I[n]=void 0),i=!0,1===this.#l)this.#X(t);else{this.#$(n);let i=this.#p[n];if(this.#A(i)?i.__abortController.abort(Error("deleted")):(this.#b||this.#_)&&(this.#b&&this.#i?.(i,e,t),this.#_&&this.#g?.push([i,e,t])),this.#c.delete(e),this.#d[n]=void 0,this.#p[n]=void 0,n===this.#y)this.#y=this.#f[n];else if(n===this.#m)this.#m=this.#h[n];else{let e=this.#f[n];this.#h[e]=this.#h[n];let t=this.#h[n];this.#f[t]=this.#f[n]}this.#l--,this.#v.push(n)}}if(this.#_&&this.#g?.length){let e=this.#g,t;for(;t=e?.shift();)this.#r?.(...t)}return i}clear(){return this.#X("delete")}#X(e){for(let t of this.#L({allowStale:!0})){let i=this.#p[t];if(this.#A(i))i.__abortController.abort(Error("deleted"));else{let n=this.#d[t];this.#b&&this.#i?.(i,n,e),this.#_&&this.#g?.push([i,n,e])}}if(this.#c.clear(),this.#p.fill(void 0),this.#d.fill(void 0),this.#E&&this.#S){for(let e of(this.#E.fill(0),this.#S.fill(0),this.#I??[]))void 0!==e&&clearTimeout(e);this.#I?.fill(void 0)}if(this.#T&&this.#T.fill(0),this.#m=0,this.#y=0,this.#v.length=0,this.#u=0,this.#l=0,this.#_&&this.#g){let e=this.#g,t;for(;t=e?.shift();)this.#r?.(...t)}}}},98142,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.InMemoryLRUCache=void 0;let n=e.r(929030);class r{constructor(e){this.cache=new n.LRUCache({sizeCalculation:r.sizeCalculation,maxSize:0x1e00000,...e})}static sizeCalculation(e){return"string"==typeof e?e.length:"object"==typeof e?Buffer.byteLength(JSON.stringify(e),"utf8"):1}async set(e,t,i){let n=i?{...i,ttl:i.ttl?1e3*i.ttl:0}:void 0;this.cache.set(e,t,n)}async get(e){return this.cache.get(e)}async delete(e){return this.cache.delete(e)}clear(){this.cache.clear()}keys(){return[...this.cache.keys()]}}i.InMemoryLRUCache=r},385258,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.ErrorsAreMissesCache=void 0,i.ErrorsAreMissesCache=class{constructor(e,t){this.cache=e,this.logger=t}async get(e){try{return await this.cache.get(e)}catch(e){this.logger&&(e instanceof Error?this.logger.error(e.message):this.logger.error(e));return}}async set(e,t,i){return this.cache.set(e,t,i)}async delete(e){return this.cache.delete(e)}}},264997,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.ErrorsAreMissesCache=i.InMemoryLRUCache=i.PrefixingKeyValueCache=void 0;var n=e.r(610863);Object.defineProperty(i,"PrefixingKeyValueCache",{enumerable:!0,get:function(){return n.PrefixingKeyValueCache}});var r=e.r(98142);Object.defineProperty(i,"InMemoryLRUCache",{enumerable:!0,get:function(){return r.InMemoryLRUCache}});var a=e.r(385258);Object.defineProperty(i,"ErrorsAreMissesCache",{enumerable:!0,get:function(){return a.ErrorsAreMissesCache}})},27145,(e,t,i)=>{!function(n,r){"use strict";if("function"==typeof define&&define.amd){let n;void 0!==(n=r(e.r,i,t))&&e.v(n)}else t.exports?t.exports=r():n.log=r()}(e.e,function(){"use strict";var e=function(){},t="undefined",i=["trace","debug","info","warn","error"],n={},r=null;function a(e,t){var i=e[t];if("function"==typeof i.bind)return i.bind(e);try{return Function.prototype.bind.call(i,e)}catch(t){return function(){return Function.prototype.apply.apply(i,[e,arguments])}}}function s(){for(var n=this.getLevel(),r=0;r<i.length;r++){var a=i[r];this[a]=r<n?e:this.methodFactory(a,n,this.name)}if(this.log=this.debug,typeof console===t&&n<this.levels.SILENT)return"No console available for logging"}function o(e){return function(){typeof console!==t&&(s.call(this),this[e].apply(this,arguments))}}function l(i,n,r){var s;return"debug"===(s=i)&&(s="log"),typeof console!==t&&(void 0!==console[s]?a(console,s):void 0!==console.log?a(console,"log"):e)||o.apply(this,arguments)}function u(e,t){var a,o,u,c=this;function d(){}function p(e){var t=e;if("string"==typeof t&&void 0!==c.levels[t.toUpperCase()]&&(t=c.levels[t.toUpperCase()]),"number"==typeof t&&t>=0&&t<=c.levels.SILENT)return t;throw TypeError("log.setLevel() called with invalid level: "+e)}c.name=e,c.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},c.methodFactory=t||l,c.getLevel=function(){return null!=u?u:null!=o?o:a},c.setLevel=function(e,t){return u=p(e),!1!==t&&(i[u]||"silent").toUpperCase(),s.call(c)},c.setDefaultLevel=function(e){o=p(e),d()||c.setLevel(e,!1)},c.resetLevel=function(){u=null,s.call(c)},c.enableAll=function(e){c.setLevel(c.levels.TRACE,e)},c.disableAll=function(e){c.setLevel(c.levels.SILENT,e)},c.rebuild=function(){if(r!==c&&(a=p(r.getLevel())),s.call(c),r===c)for(var e in n)n[e].rebuild()},a=p(r?r.getLevel():"WARN");var h=d();null!=h&&(u=p(h)),s.call(c)}return(r=new u).getLogger=function(e){if("symbol"!=typeof e&&"string"!=typeof e||""===e)throw TypeError("You must supply a name when creating a logger.");var t=n[e];return t||(t=n[e]=new u(e,r.methodFactory)),t},r.noConflict=function(){return r},r.getLoggers=function(){return n},r.default=r,r})},531906,(e,t,i)=>{"use strict";t.exports=r,t.exports.preferredCharsets=r;var n=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function r(e,t){var i=function(e){for(var t=e.split(","),i=0,r=0;i<t.length;i++){var a=function(e,t){var i=n.exec(e);if(!i)return null;var r=i[1],a=1;if(i[2])for(var s=i[2].split(";"),o=0;o<s.length;o++){var l=s[o].trim().split("=");if("q"===l[0]){a=parseFloat(l[1]);break}}return{charset:r,q:a,i:t}}(t[i].trim(),i);a&&(t[r++]=a)}return t.length=r,t}(void 0===e?"*":e||"");if(!t)return i.filter(o).sort(a).map(s);var r=t.map(function(e,t){for(var n={o:-1,q:0,s:0},r=0;r<i.length;r++){var a=function(e,t,i){var n=0;if(t.charset.toLowerCase()===e.toLowerCase())n|=1;else if("*"!==t.charset)return null;return{i:i,o:t.i,q:t.q,s:n}}(e,i[r],t);a&&0>(n.s-a.s||n.q-a.q||n.o-a.o)&&(n=a)}return n});return r.filter(o).sort(a).map(function(e){return t[r.indexOf(e)]})}function a(e,t){return t.q-e.q||t.s-e.s||e.o-t.o||e.i-t.i||0}function s(e){return e.charset}function o(e){return e.q>0}},173906,(e,t,i)=>{"use strict";t.exports=a,t.exports.preferredEncodings=a;var n=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function r(e,t,i){var n=0;if(t.encoding.toLowerCase()===e.toLowerCase())n|=1;else if("*"!==t.encoding)return null;return{encoding:e,i:i,o:t.i,q:t.q,s:n}}function a(e,t,i){var a=function(e){for(var t=e.split(","),i=!1,a=1,s=0,o=0;s<t.length;s++){var l=function(e,t){var i=n.exec(e);if(!i)return null;var r=i[1],a=1;if(i[2])for(var s=i[2].split(";"),o=0;o<s.length;o++){var l=s[o].trim().split("=");if("q"===l[0]){a=parseFloat(l[1]);break}}return{encoding:r,q:a,i:t}}(t[s].trim(),s);l&&(t[o++]=l,i=i||r("identity",l),a=Math.min(a,l.q||1))}return i||(t[o++]={encoding:"identity",q:a,i:s}),t.length=o,t}(e||""),u=i?function(e,t){if(e.q!==t.q)return t.q-e.q;var n=i.indexOf(e.encoding),r=i.indexOf(t.encoding);return -1===n&&-1===r?t.s-e.s||e.o-t.o||e.i-t.i:-1!==n&&-1!==r?n-r:-1===n?1:-1}:s;if(!t)return a.filter(l).sort(u).map(o);var c=t.map(function(e,t){for(var i={encoding:e,o:-1,q:0,s:0},n=0;n<a.length;n++){var s=r(e,a[n],t);s&&0>(i.s-s.s||i.q-s.q||i.o-s.o)&&(i=s)}return i});return c.filter(l).sort(u).map(function(e){return t[c.indexOf(e)]})}function s(e,t){return t.q-e.q||t.s-e.s||e.o-t.o||e.i-t.i}function o(e){return e.encoding}function l(e){return e.q>0}},29471,(e,t,i)=>{"use strict";t.exports=a,t.exports.preferredLanguages=a;var n=/^\s*([^\s\-;]+)(?:-([^\s;]+))?\s*(?:;(.*))?$/;function r(e,t){var i=n.exec(e);if(!i)return null;var r=i[1],a=i[2],s=r;a&&(s+="-"+a);var o=1;if(i[3])for(var l=i[3].split(";"),u=0;u<l.length;u++){var c=l[u].split("=");"q"===c[0]&&(o=parseFloat(c[1]))}return{prefix:r,suffix:a,q:o,i:t,full:s}}function a(e,t){var i=function(e){for(var t=e.split(","),i=0,n=0;i<t.length;i++){var a=r(t[i].trim(),i);a&&(t[n++]=a)}return t.length=n,t}(void 0===e?"*":e||"");if(!t)return i.filter(l).sort(s).map(o);var n=t.map(function(e,t){for(var n={o:-1,q:0,s:0},a=0;a<i.length;a++){var s=function(e,t,i){var n=r(e);if(!n)return null;var a=0;if(t.full.toLowerCase()===n.full.toLowerCase())a|=4;else if(t.prefix.toLowerCase()===n.full.toLowerCase())a|=2;else if(t.full.toLowerCase()===n.prefix.toLowerCase())a|=1;else if("*"!==t.full)return null;return{i:i,o:t.i,q:t.q,s:a}}(e,i[a],t);s&&0>(n.s-s.s||n.q-s.q||n.o-s.o)&&(n=s)}return n});return n.filter(l).sort(s).map(function(e){return t[n.indexOf(e)]})}function s(e,t){return t.q-e.q||t.s-e.s||e.o-t.o||e.i-t.i||0}function o(e){return e.full}function l(e){return e.q>0}},715035,(e,t,i)=>{"use strict";t.exports=a,t.exports.preferredMediaTypes=a;var n=/^\s*([^\s\/;]+)\/([^;\s]+)\s*(?:;(.*))?$/;function r(e,t){var i=n.exec(e);if(!i)return null;var r=Object.create(null),a=1,s=i[2],o=i[1];if(i[3])for(var l=(function(e){for(var t=e.split(";"),i=1,n=0;i<t.length;i++)u(t[n])%2==0?t[++n]=t[i]:t[n]+=";"+t[i];t.length=n+1;for(var i=0;i<t.length;i++)t[i]=t[i].trim();return t})(i[3]).map(c),d=0;d<l.length;d++){var p=l[d],h=p[0].toLowerCase(),f=p[1],m=f&&'"'===f[0]&&'"'===f[f.length-1]?f.slice(1,-1):f;if("q"===h){a=parseFloat(m);break}r[h]=m}return{type:o,subtype:s,params:r,q:a,i:t}}function a(e,t){var i=function(e){for(var t=function(e){for(var t=e.split(","),i=1,n=0;i<t.length;i++)u(t[n])%2==0?t[++n]=t[i]:t[n]+=","+t[i];return t.length=n+1,t}(e),i=0,n=0;i<t.length;i++){var a=r(t[i].trim(),i);a&&(t[n++]=a)}return t.length=n,t}(void 0===e?"*/*":e||"");if(!t)return i.filter(l).sort(s).map(o);var n=t.map(function(e,t){for(var n={o:-1,q:0,s:0},a=0;a<i.length;a++){var s=function(e,t,i){var n=r(e),a=0;if(!n)return null;if(t.type.toLowerCase()==n.type.toLowerCase())a|=4;else if("*"!=t.type)return null;if(t.subtype.toLowerCase()==n.subtype.toLowerCase())a|=2;else if("*"!=t.subtype)return null;var s=Object.keys(t.params);if(s.length>0)if(!s.every(function(e){return"*"==t.params[e]||(t.params[e]||"").toLowerCase()==(n.params[e]||"").toLowerCase()}))return null;else a|=1;return{i:i,o:t.i,q:t.q,s:a}}(e,i[a],t);s&&0>(n.s-s.s||n.q-s.q||n.o-s.o)&&(n=s)}return n});return n.filter(l).sort(s).map(function(e){return t[n.indexOf(e)]})}function s(e,t){return t.q-e.q||t.s-e.s||e.o-t.o||e.i-t.i||0}function o(e){return e.type+"/"+e.subtype}function l(e){return e.q>0}function u(e){for(var t=0,i=0;-1!==(i=e.indexOf('"',i));)t++,i++;return t}function c(e){var t,i,n=e.indexOf("=");return -1===n?t=e:(t=e.slice(0,n),i=e.slice(n+1)),[t,i]}},228069,(e,t,i)=>{"use strict";var n=e.r(531906),r=e.r(173906),a=e.r(29471),s=e.r(715035);function o(e){if(!(this instanceof o))return new o(e);this.request=e}t.exports=o,t.exports.Negotiator=o,o.prototype.charset=function(e){var t=this.charsets(e);return t&&t[0]},o.prototype.charsets=function(e){return n(this.request.headers["accept-charset"],e)},o.prototype.encoding=function(e,t){var i=this.encodings(e,t);return i&&i[0]},o.prototype.encodings=function(e,t){return r(this.request.headers["accept-encoding"],e,(t||{}).preferred)},o.prototype.language=function(e){var t=this.languages(e);return t&&t[0]},o.prototype.languages=function(e){return a(this.request.headers["accept-language"],e)},o.prototype.mediaType=function(e){var t=this.mediaTypes(e);return t&&t[0]},o.prototype.mediaTypes=function(e){return s(this.request.headers.accept,e)},o.prototype.preferredCharset=o.prototype.charset,o.prototype.preferredCharsets=o.prototype.charsets,o.prototype.preferredEncoding=o.prototype.encoding,o.prototype.preferredEncodings=o.prototype.encodings,o.prototype.preferredLanguage=o.prototype.language,o.prototype.preferredLanguages=o.prototype.languages,o.prototype.preferredMediaType=o.prototype.mediaType,o.prototype.preferredMediaTypes=o.prototype.mediaTypes},692116,(e,t,i)=>{"use strict";i.removeLeadingAndTrailingHTTPWhitespace=e=>e.replace(/^[ \t\n\r]+/u,"").replace(/[ \t\n\r]+$/u,""),i.removeTrailingHTTPWhitespace=e=>e.replace(/[ \t\n\r]+$/u,""),i.isHTTPWhitespaceChar=e=>" "===e||" "===e||"\n"===e||"\r"===e,i.solelyContainsHTTPTokenCodePoints=e=>/^[-!#$%&'*+.^_`|~A-Za-z0-9]*$/u.test(e),i.soleyContainsHTTPQuotedStringTokenCodePoints=e=>/^[\t\u0020-\u007E\u0080-\u00FF]*$/u.test(e),i.asciiLowercase=e=>e.replace(/[A-Z]/ug,e=>e.toLowerCase()),i.collectAnHTTPQuotedString=(e,t)=>{let i="";for(t++;;){for(;t<e.length&&'"'!==e[t]&&"\\"!==e[t];)i+=e[t],++t;if(t>=e.length)break;let n=e[t];if(++t,"\\"===n){if(t>=e.length){i+="\\";break}i+=e[t],++t}else break}return[i,t]}},60248,(e,t,i)=>{"use strict";let{asciiLowercase:n,solelyContainsHTTPTokenCodePoints:r,soleyContainsHTTPQuotedStringTokenCodePoints:a}=e.r(692116);t.exports=class{constructor(e){this._map=e}get size(){return this._map.size}get(e){return e=n(String(e)),this._map.get(e)}has(e){return e=n(String(e)),this._map.has(e)}set(e,t){if(e=n(String(e)),t=String(t),!r(e))throw Error(`Invalid MIME type parameter name "${e}": only HTTP token code points are valid.`);if(!a(t))throw Error(`Invalid MIME type parameter value "${t}": only HTTP quoted-string token code points are valid.`);return this._map.set(e,t)}clear(){this._map.clear()}delete(e){return e=n(String(e)),this._map.delete(e)}forEach(e,t){this._map.forEach(e,t)}keys(){return this._map.keys()}values(){return this._map.values()}entries(){return this._map.entries()}[Symbol.iterator](){return this._map[Symbol.iterator]()}}},453291,(e,t,i)=>{"use strict";let{removeLeadingAndTrailingHTTPWhitespace:n,removeTrailingHTTPWhitespace:r,isHTTPWhitespaceChar:a,solelyContainsHTTPTokenCodePoints:s,soleyContainsHTTPQuotedStringTokenCodePoints:o,asciiLowercase:l,collectAnHTTPQuotedString:u}=e.r(692116);t.exports=e=>{e=n(e);let t=0,i="";for(;t<e.length&&"/"!==e[t];)i+=e[t],++t;if(0===i.length||!s(i)||t>=e.length)return null;++t;let c="";for(;t<e.length&&";"!==e[t];)c+=e[t],++t;if(0===(c=r(c)).length||!s(c))return null;let d={type:l(i),subtype:l(c),parameters:new Map};for(;t<e.length;){for(++t;a(e[t]);)++t;let i="";for(;t<e.length&&";"!==e[t]&&"="!==e[t];)i+=e[t],++t;if(i=l(i),t<e.length){if(";"===e[t])continue;++t}let n=null;if('"'===e[t])for([n,t]=u(e,t);t<e.length&&";"!==e[t];)++t;else{for(n="";t<e.length&&";"!==e[t];)n+=e[t],++t;if(""===(n=r(n)))continue}i.length>0&&s(i)&&o(n)&&!d.parameters.has(i)&&d.parameters.set(i,n)}return d}},857717,(e,t,i)=>{"use strict";let{solelyContainsHTTPTokenCodePoints:n}=e.r(692116);t.exports=e=>{let t=`${e.type}/${e.subtype}`;if(0===e.parameters.size)return t;for(let[i,r]of e.parameters)t+=";",t+=i,t+="=",n(r)&&0!==r.length||(r=r.replace(/(["\\])/ug,"\\$1"),r=`"${r}"`),t+=r;return t}},794392,(e,t,i)=>{"use strict";let n=e.r(60248),r=e.r(453291),a=e.r(857717),{asciiLowercase:s,solelyContainsHTTPTokenCodePoints:o}=e.r(692116);t.exports=class{constructor(e){const t=r(e=String(e));if(null===t)throw Error(`Could not parse MIME type string "${e}"`);this._type=t.type,this._subtype=t.subtype,this._parameters=new n(t.parameters)}static parse(e){try{return new this(e)}catch(e){return null}}get essence(){return`${this.type}/${this.subtype}`}get type(){return this._type}set type(e){if(0===(e=s(String(e))).length)throw Error("Invalid type: must be a non-empty string");if(!o(e))throw Error(`Invalid type ${e}: must contain only HTTP token code points`);this._type=e}get subtype(){return this._subtype}set subtype(e){if(0===(e=s(String(e))).length)throw Error("Invalid subtype: must be a non-empty string");if(!o(e))throw Error(`Invalid subtype ${e}: must contain only HTTP token code points`);this._subtype=e}get parameters(){return this._parameters}toString(){return a(this)}isJavaScript({prohibitParameters:e=!1}={}){switch(this._type){case"text":switch(this._subtype){case"ecmascript":case"javascript":case"javascript1.0":case"javascript1.1":case"javascript1.2":case"javascript1.3":case"javascript1.4":case"javascript1.5":case"jscript":case"livescript":case"x-ecmascript":case"x-javascript":return!e||0===this._parameters.size;default:return!1}case"application":switch(this._subtype){case"ecmascript":case"javascript":case"x-ecmascript":case"x-javascript":return!e||0===this._parameters.size;default:return!1}default:return!1}}isXML(){return"xml"===this._subtype&&("text"===this._type||"application"===this._type)||this._subtype.endsWith("+xml")}isHTML(){return"html"===this._subtype&&"text"===this._type}}},294682,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0})},786390,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.devAssert=function(e,t){if(!e)throw Error(t)}},287547,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.mapValue=function(e,t){let i=Object.create(null);for(let n of Object.keys(e))i[n]=t(e[n],n);return i}},776887,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.isObjectLike=function(e){return"object"==typeof e&&null!==e}},119588,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.invariant=function(e,t){if(!e)throw Error(null!=t?t:"Unexpected invariant triggered.")}},192752,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.getLocation=function(e,t){let i=0,a=1;for(let s of e.body.matchAll(r)){if("number"==typeof s.index||(0,n.invariant)(!1),s.index>=t)break;i=s.index+s[0].length,a+=1}return{line:a,column:t+1-i}};var n=e.r(119588);let r=/\r\n|[\n\r]/g},515424,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.printLocation=function(e){return r(e.source,(0,n.getLocation)(e.source,e.start))},i.printSourceLocation=r;var n=e.r(192752);function r(e,t){let i=e.locationOffset.column-1,n="".padStart(i)+e.body,r=t.line-1,s=e.locationOffset.line-1,o=t.line+s,l=1===t.line?i:0,u=t.column+l,c=`${e.name}:${o}:${u}
|
|
2
2
|
`,d=n.split(/\r\n|[\n\r]/g),p=d[r];if(p.length>120){let e=Math.floor(u/80),t=[];for(let e=0;e<p.length;e+=80)t.push(p.slice(e,e+80));return c+a([[`${o} |`,t[0]],...t.slice(1,e+1).map(e=>["|",e]),["|","^".padStart(u%80)],["|",t[e+1]]])}return c+a([[`${o-1} |`,d[r-1]],[`${o} |`,p],["|","^".padStart(u)],[`${o+1} |`,d[r+1]]])}function a(e){let t=e.filter(([e,t])=>void 0!==t),i=Math.max(...t.map(([e])=>e.length));return t.map(([e,t])=>e.padStart(i)+(t?" "+t:"")).join("\n")}},294943,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.GraphQLError=void 0,i.formatError=function(e){return e.toJSON()},i.printError=function(e){return e.toString()};var n=e.r(776887),r=e.r(192752),a=e.r(515424);class s extends Error{constructor(e,...t){var i,a,l;const{nodes:u,source:c,positions:d,path:p,originalError:h,extensions:f}=function(e){let t=e[0];return null==t||"kind"in t||"length"in t?{nodes:t,source:e[1],positions:e[2],path:e[3],originalError:e[4],extensions:e[5]}:t}(t);super(e),this.name="GraphQLError",this.path=null!=p?p:void 0,this.originalError=null!=h?h:void 0,this.nodes=o(Array.isArray(u)?u:u?[u]:void 0);const m=o(null==(i=this.nodes)?void 0:i.map(e=>e.loc).filter(e=>null!=e));this.source=null!=c?c:null==m||null==(a=m[0])?void 0:a.source,this.positions=null!=d?d:null==m?void 0:m.map(e=>e.start),this.locations=d&&c?d.map(e=>(0,r.getLocation)(c,e)):null==m?void 0:m.map(e=>(0,r.getLocation)(e.source,e.start));const y=(0,n.isObjectLike)(null==h?void 0:h.extensions)?null==h?void 0:h.extensions:void 0;this.extensions=null!=(l=null!=f?f:y)?l: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}}),null!=h&&h.stack?Object.defineProperty(this,"stack",{value:h.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,s):Object.defineProperty(this,"stack",{value:Error().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+="\n\n"+(0,a.printLocation)(t.loc));else if(this.source&&this.locations)for(let t of this.locations)e+="\n\n"+(0,a.printSourceLocation)(this.source,t);return e}toJSON(){let e={message:this.message};return null!=this.locations&&(e.locations=this.locations),null!=this.path&&(e.path=this.path),null!=this.extensions&&Object.keys(this.extensions).length>0&&(e.extensions=this.extensions),e}}function o(e){return void 0===e||0===e.length?void 0:e}i.GraphQLError=s},463040,(e,t,i)=>{"use strict";var n,r;Object.defineProperty(i,"__esModule",{value:!0}),i.Token=i.QueryDocumentKeys=i.OperationTypeNode=i.Location=void 0,i.isNode=function(e){let t=null==e?void 0:e.kind;return"string"==typeof t&&l.has(t)};class a{constructor(e,t,i){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=i}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}}i.Location=a;class s{constructor(e,t,i,n,r,a){this.kind=e,this.start=t,this.end=i,this.line=n,this.column=r,this.value=a,this.prev=null,this.next=null}get[Symbol.toStringTag](){return"Token"}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}}i.Token=s;let o={Name:[],Document:["definitions"],OperationDefinition:["description","name","variableDefinitions","directives","selectionSet"],VariableDefinition:["description","variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["description","name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","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"]};i.QueryDocumentKeys=o;let l=new Set(Object.keys(o));i.OperationTypeNode=n,(r=n||(i.OperationTypeNode=n={})).QUERY="query",r.MUTATION="mutation",r.SUBSCRIPTION="subscription"},818123,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.inspect=function(e){return function e(t,i){switch(typeof t){case"string":return JSON.stringify(t);case"function":return t.name?`[function ${t.name}]`:"[function]";case"object":return function(t,i){let n;if(null===t)return"null";if(i.includes(t))return"[Circular]";let r=[...i,t];if("function"==typeof t.toJSON){let i=t.toJSON();if(i!==t)return"string"==typeof i?i:e(i,r)}else if(Array.isArray(t)){var a,s,o=t,l=r;if(0===o.length)return"[]";if(l.length>2)return"[Array]";let i=Math.min(10,o.length),n=o.length-i,u=[];for(let t=0;t<i;++t)u.push(e(o[t],l));return 1===n?u.push("... 1 more item"):n>1&&u.push(`... ${n} more items`),"["+u.join(", ")+"]"}return a=t,s=r,0===(n=Object.entries(a)).length?"{}":s.length>2?"["+function(e){let t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){let t=e.constructor.name;if("string"==typeof t&&""!==t)return t}return t}(a)+"]":"{ "+n.map(([t,i])=>t+": "+e(i,s)).join(", ")+" }"}(t,i);default:return String(t)}}(e,[])}},199311,(e,t,i)=>{"use strict";var n,r;Object.defineProperty(i,"__esModule",{value:!0}),i.Kind=void 0,i.Kind=n,(r=n||(i.Kind=n={})).NAME="Name",r.DOCUMENT="Document",r.OPERATION_DEFINITION="OperationDefinition",r.VARIABLE_DEFINITION="VariableDefinition",r.SELECTION_SET="SelectionSet",r.FIELD="Field",r.ARGUMENT="Argument",r.FRAGMENT_SPREAD="FragmentSpread",r.INLINE_FRAGMENT="InlineFragment",r.FRAGMENT_DEFINITION="FragmentDefinition",r.VARIABLE="Variable",r.INT="IntValue",r.FLOAT="FloatValue",r.STRING="StringValue",r.BOOLEAN="BooleanValue",r.NULL="NullValue",r.ENUM="EnumValue",r.LIST="ListValue",r.OBJECT="ObjectValue",r.OBJECT_FIELD="ObjectField",r.DIRECTIVE="Directive",r.NAMED_TYPE="NamedType",r.LIST_TYPE="ListType",r.NON_NULL_TYPE="NonNullType",r.SCHEMA_DEFINITION="SchemaDefinition",r.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",r.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",r.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",r.FIELD_DEFINITION="FieldDefinition",r.INPUT_VALUE_DEFINITION="InputValueDefinition",r.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",r.UNION_TYPE_DEFINITION="UnionTypeDefinition",r.ENUM_TYPE_DEFINITION="EnumTypeDefinition",r.ENUM_VALUE_DEFINITION="EnumValueDefinition",r.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",r.DIRECTIVE_DEFINITION="DirectiveDefinition",r.SCHEMA_EXTENSION="SchemaExtension",r.DIRECTIVE_EXTENSION="DirectiveExtension",r.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",r.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",r.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",r.UNION_TYPE_EXTENSION="UnionTypeExtension",r.ENUM_TYPE_EXTENSION="EnumTypeExtension",r.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension",r.TYPE_COORDINATE="TypeCoordinate",r.MEMBER_COORDINATE="MemberCoordinate",r.ARGUMENT_COORDINATE="ArgumentCoordinate",r.DIRECTIVE_COORDINATE="DirectiveCoordinate",r.DIRECTIVE_ARGUMENT_COORDINATE="DirectiveArgumentCoordinate"},999680,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.BREAK=void 0,i.getEnterLeaveForKind=l,i.getVisitFn=function(e,t,i){let{enter:n,leave:r}=l(e,t);return i?r:n},i.visit=function(e,t,i=a.QueryDocumentKeys){let u,c,d,p=new Map;for(let e of Object.values(s.Kind))p.set(e,l(t,e));let h=Array.isArray(e),f=[e],m=-1,y=[],v=e,g=[],T=[];do{var S,E,I;let e,s=++m===f.length,l=s&&0!==y.length;if(s){if(c=0===T.length?void 0:g[g.length-1],v=d,d=T.pop(),l)if(h){v=v.slice();let e=0;for(let[t,i]of y){let n=t-e;null===i?(v.splice(n,1),e++):v[n]=i}}else for(let[e,t]of(v={...v},y))v[e]=t;m=u.index,f=u.keys,y=u.edits,h=u.inArray,u=u.prev}else if(d){if(null==(v=d[c=h?m:f[m]]))continue;g.push(c)}if(!Array.isArray(v)){(0,a.isNode)(v)||(0,n.devAssert)(!1,`Invalid AST Node: ${(0,r.inspect)(v)}.`);let i=s?null==(S=p.get(v.kind))?void 0:S.leave:null==(E=p.get(v.kind))?void 0:E.enter;if((e=null==i?void 0:i.call(t,v,c,d,g,T))===o)break;if(!1===e){if(!s){g.pop();continue}}else if(void 0!==e&&(y.push([c,e]),!s))if((0,a.isNode)(e))v=e;else{g.pop();continue}}void 0===e&&l&&y.push([c,v]),s?g.pop():(u={inArray:h,index:m,keys:f,edits:y,prev:u},f=(h=Array.isArray(v))?v:null!=(I=i[v.kind])?I:[],m=-1,y=[],d&&T.push(d),d=v)}while(void 0!==u)return 0!==y.length?y[y.length-1][1]:e},i.visitInParallel=function(e){let t=Array(e.length).fill(null),i=Object.create(null);for(let n of Object.values(s.Kind)){let r=!1,a=Array(e.length).fill(void 0),s=Array(e.length).fill(void 0);for(let t=0;t<e.length;++t){let{enter:i,leave:o}=l(e[t],n);r||(r=null!=i||null!=o),a[t]=i,s[t]=o}if(!r)continue;let u={enter(...i){let n=i[0];for(let s=0;s<e.length;s++)if(null===t[s]){var r;let l=null==(r=a[s])?void 0:r.apply(e[s],i);if(!1===l)t[s]=n;else if(l===o)t[s]=o;else if(void 0!==l)return l}},leave(...i){let n=i[0];for(let a=0;a<e.length;a++)if(null===t[a]){var r;let n=null==(r=s[a])?void 0:r.apply(e[a],i);if(n===o)t[a]=o;else if(void 0!==n&&!1!==n)return n}else t[a]===n&&(t[a]=null)}};i[n]=u}return i};var n=e.r(786390),r=e.r(818123),a=e.r(463040),s=e.r(199311);let o=Object.freeze({});function l(e,t){let i=e[t];return"object"==typeof i?i:"function"==typeof i?{enter:i,leave:void 0}:{enter:e.enter,leave:e.leave}}i.BREAK=o},996650,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.didYouMean=function(e,t){let[i,n]=t?[e,t]:[void 0,e],r=" Did you mean ";i&&(r+=i+" ");let a=n.map(e=>`"${e}"`);switch(a.length){case 0:return"";case 1:return r+a[0]+"?";case 2:return r+a[0]+" or "+a[1]+"?"}let s=a.slice(0,5),o=s.pop();return r+s.join(", ")+", or "+o+"?"}},644568,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.identityFunc=function(e){return e}},792942,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.instanceOf=void 0;var n=e.r(818123);i.instanceOf=globalThis.process&&1?function(e,t){return e instanceof t}:function(e,t){if(e instanceof t)return!0;if("object"==typeof e&&null!==e){var i;let r=t.prototype[Symbol.toStringTag];if(r===(Symbol.toStringTag in e?e[Symbol.toStringTag]:null==(i=e.constructor)?void 0:i.name)){let t=(0,n.inspect)(e);throw Error(`Cannot use ${r} "${t}" from another module or realm.
|
|
3
3
|
|
|
4
4
|
Ensure that there is only one instance of "graphql" in the node_modules
|
|
@@ -10,26 +10,26 @@ https://yarnpkg.com/en/docs/selective-version-resolutions
|
|
|
10
10
|
Duplicate "graphql" modules cannot be used at the same time since different
|
|
11
11
|
versions may have different capabilities and behavior. The data from one
|
|
12
12
|
version used in the function from another could produce confusing and
|
|
13
|
-
spurious results.`)}}return!1}},117921,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.keyMap=function(e,t){let i=Object.create(null);for(let n of e)i[t(n)]=n;return i}},213552,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.keyValMap=function(e,t,i){let n=Object.create(null);for(let r of e)n[t(r)]=i(r);return n}},216251,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.naturalCompare=function(e,t){let i=0,a=0;for(;i<e.length&&a<t.length;){let s=e.charCodeAt(i),o=t.charCodeAt(a);if(r(s)&&r(o)){let l=0;do++i,l=10*l+s-n,s=e.charCodeAt(i);while(r(s)&&l>0)let u=0;do++a,u=10*u+o-n,o=t.charCodeAt(a);while(r(o)&&u>0)if(l<u)return -1;if(l>u)return 1}else{if(s<o)return -1;if(s>o)return 1;++i,++a}}return e.length-t.length};let n=48;function r(e){return!isNaN(e)&&n<=e&&e<=57}},529364,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.suggestionList=function(e,t){let i=Object.create(null),a=new r(e),s=Math.floor(.4*e.length)+1;for(let e of t){let t=a.measure(e,s);void 0!==t&&(i[e]=t)}return Object.keys(i).sort((e,t)=>{let r=i[e]-i[t];return 0!==r?r:(0,n.naturalCompare)(e,t)})};var n=e.r(216251);class r{constructor(e){this._input=e,this._inputLowerCase=e.toLowerCase(),this._inputArray=a(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 i=e.toLowerCase();if(this._inputLowerCase===i)return 1;let n=a(i),r=this._inputArray;if(n.length<r.length){let e=n;n=r,r=e}let s=n.length,o=r.length;if(s-o>t)return;let l=this._rows;for(let e=0;e<=o;e++)l[0][e]=e;for(let e=1;e<=s;e++){let i=l[(e-1)%3],a=l[e%3],s=a[0]=e;for(let t=1;t<=o;t++){let o=+(n[e-1]!==r[t-1]),u=Math.min(i[t]+1,a[t-1]+1,i[t-1]+o);e>1&&t>1&&n[e-1]===r[t-2]&&n[e-2]===r[t-1]&&(u=Math.min(u,l[(e-2)%3][t-2]+1)),u<s&&(s=u),a[t]=u}if(s>t)return}let u=l[s%3][o];return u<=t?u:void 0}}function a(e){let t=e.length,i=Array(t);for(let n=0;n<t;++n)i[n]=e.charCodeAt(n);return i}},605021,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.toObjMap=function(e){if(null==e)return Object.create(null);if(null===Object.getPrototypeOf(e))return e;let t=Object.create(null);for(let[i,n]of Object.entries(e))t[i]=n;return t}},64692,(e,t,i)=>{"use strict";function n(e){return e>=48&&e<=57}function r(e){return e>=97&&e<=122||e>=65&&e<=90}Object.defineProperty(i,"__esModule",{value:!0}),i.isDigit=n,i.isLetter=r,i.isNameContinue=function(e){return r(e)||n(e)||95===e},i.isNameStart=function(e){return r(e)||95===e},i.isWhiteSpace=function(e){return 9===e||32===e}},657421,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.dedentBlockStringLines=function(e){var t,i;let r=Number.MAX_SAFE_INTEGER,a=null,s=-1;for(let t=0;t<e.length;++t){let o=e[t],l=function(e){let t=0;for(;t<e.length&&(0,n.isWhiteSpace)(e.charCodeAt(t));)++t;return t}(o);l!==o.length&&(a=null!=(i=a)?i:t,s=t,0!==t&&l<r&&(r=l))}return e.map((e,t)=>0===t?e:e.slice(r)).slice(null!=(t=a)?t:0,s+1)},i.isPrintableAsBlockString=function(e){if(""===e)return!0;let t=!0,i=!1,n=!0,r=!1;for(let a=0;a<e.length;++a)switch(e.codePointAt(a)){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 11:case 12:case 14:case 15:case 13:return!1;case 10:if(t&&!r)return!1;r=!0,t=!0,i=!1;break;case 9:case 32:i||(i=t);break;default:n&&(n=i),t=!1}return!t&&(!n||!r)},i.printBlockString=function(e,t){let i=e.replace(/"""/g,'\\"""'),r=i.split(/\r\n|[\n\r]/g),a=1===r.length,s=r.length>1&&r.slice(1).every(e=>0===e.length||(0,n.isWhiteSpace)(e.charCodeAt(0))),o=i.endsWith('\\"""'),l=e.endsWith('"')&&!o,u=e.endsWith("\\"),c=l||u,d=!(null!=t&&t.minimize)&&(!a||e.length>70||c||s||o),p="",h=a&&(0,n.isWhiteSpace)(e.charCodeAt(0));return(d&&!h||s)&&(p+="\n"),p+=i,(d||c)&&(p+="\n"),'"""'+p+'"""'};var n=e.r(64692)},195426,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.printString=function(e){return`"${e.replace(n,r)}"`};let n=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function r(e){return a[e.charCodeAt(0)]}let a=["\\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"]},340647,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.print=function(e){return(0,a.visit)(e,s)};var n=e.r(657421),r=e.r(195426),a=e.r(999680);let s={Name:{leave:e=>e.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>o(e.definitions,"\n\n")},OperationDefinition:{leave(e){let t=d(e.variableDefinitions)?u("(\n",o(e.variableDefinitions,"\n"),"\n)"):u("(",o(e.variableDefinitions,", "),")"),i=u("",e.description,"\n")+o([e.operation,o([e.name,t]),o(e.directives," ")]," ");return("query"===i?"":i+" ")+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:i,directives:n,description:r})=>u("",r,"\n")+e+": "+t+u(" = ",i)+u(" ",o(n," "))},SelectionSet:{leave:({selections:e})=>l(e)},Field:{leave({alias:e,name:t,arguments:i,directives:n,selectionSet:r}){let a=u("",e,": ")+t,s=a+u("(",o(i,", "),")");return s.length>80&&(s=a+u("(\n",c(o(i,"\n")),"\n)")),o([s,o(n," "),r]," ")}},Argument:{leave:({name:e,value:t})=>e+": "+t},FragmentSpread:{leave:({name:e,directives:t})=>"..."+e+u(" ",o(t," "))},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:i})=>o(["...",u("on ",e),o(t," "),i]," ")},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:i,directives:n,selectionSet:r,description:a})=>u("",a,"\n")+`fragment ${e}${u("(",o(i,", "),")")} `+`on ${t} ${u("",o(n," ")," ")}`+r},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>t?(0,n.printBlockString)(e):(0,r.printString)(e)},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>"["+o(e,", ")+"]"},ObjectValue:{leave:({fields:e})=>"{"+o(e,", ")+"}"},ObjectField:{leave:({name:e,value:t})=>e+": "+t},Directive:{leave:({name:e,arguments:t})=>"@"+e+u("(",o(t,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({description:e,directives:t,operationTypes:i})=>u("",e,"\n")+o(["schema",o(t," "),l(i)]," ")},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+": "+t},ScalarTypeDefinition:{leave:({description:e,name:t,directives:i})=>u("",e,"\n")+o(["scalar",t,o(i," ")]," ")},ObjectTypeDefinition:{leave:({description:e,name:t,interfaces:i,directives:n,fields:r})=>u("",e,"\n")+o(["type",t,u("implements ",o(i," & ")),o(n," "),l(r)]," ")},FieldDefinition:{leave:({description:e,name:t,arguments:i,type:n,directives:r})=>u("",e,"\n")+t+(d(i)?u("(\n",c(o(i,"\n")),"\n)"):u("(",o(i,", "),")"))+": "+n+u(" ",o(r," "))},InputValueDefinition:{leave:({description:e,name:t,type:i,defaultValue:n,directives:r})=>u("",e,"\n")+o([t+": "+i,u("= ",n),o(r," ")]," ")},InterfaceTypeDefinition:{leave:({description:e,name:t,interfaces:i,directives:n,fields:r})=>u("",e,"\n")+o(["interface",t,u("implements ",o(i," & ")),o(n," "),l(r)]," ")},UnionTypeDefinition:{leave:({description:e,name:t,directives:i,types:n})=>u("",e,"\n")+o(["union",t,o(i," "),u("= ",o(n," | "))]," ")},EnumTypeDefinition:{leave:({description:e,name:t,directives:i,values:n})=>u("",e,"\n")+o(["enum",t,o(i," "),l(n)]," ")},EnumValueDefinition:{leave:({description:e,name:t,directives:i})=>u("",e,"\n")+o([t,o(i," ")]," ")},InputObjectTypeDefinition:{leave:({description:e,name:t,directives:i,fields:n})=>u("",e,"\n")+o(["input",t,o(i," "),l(n)]," ")},DirectiveDefinition:{leave:({description:e,name:t,arguments:i,directives:n,repeatable:r,locations:a})=>u("",e,"\n")+"directive @"+t+(d(i)?u("(\n",c(o(i,"\n")),"\n)"):u("(",o(i,", "),")"))+u(" ",o(n," "))+(r?" repeatable":"")+" on "+o(a," | ")},SchemaExtension:{leave:({directives:e,operationTypes:t})=>o(["extend schema",o(e," "),l(t)]," ")},ScalarTypeExtension:{leave:({name:e,directives:t})=>o(["extend scalar",e,o(t," ")]," ")},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:i,fields:n})=>o(["extend type",e,u("implements ",o(t," & ")),o(i," "),l(n)]," ")},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:i,fields:n})=>o(["extend interface",e,u("implements ",o(t," & ")),o(i," "),l(n)]," ")},UnionTypeExtension:{leave:({name:e,directives:t,types:i})=>o(["extend union",e,o(t," "),u("= ",o(i," | "))]," ")},EnumTypeExtension:{leave:({name:e,directives:t,values:i})=>o(["extend enum",e,o(t," "),l(i)]," ")},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:i})=>o(["extend input",e,o(t," "),l(i)]," ")},DirectiveExtension:{leave:({name:e,directives:t})=>o(["extend directive @"+e,o(t," ")]," ")},TypeCoordinate:{leave:({name:e})=>e},MemberCoordinate:{leave:({name:e,memberName:t})=>o([e,u(".",t)])},ArgumentCoordinate:{leave:({name:e,fieldName:t,argumentName:i})=>o([e,u(".",t),u("(",i,":)")])},DirectiveCoordinate:{leave:({name:e})=>o(["@",e])},DirectiveArgumentCoordinate:{leave:({name:e,argumentName:t})=>o(["@",e,u("(",t,":)")])}};function o(e,t=""){var i;return null!=(i=null==e?void 0:e.filter(e=>e).join(t))?i:""}function l(e){return u("{\n",c(o(e,"\n")),"\n}")}function u(e,t,i=""){return null!=t&&""!==t?e+t+i:""}function c(e){return u(" ",e.replace(/\n/g,"\n "))}function d(e){var t;return null!=(t=null==e?void 0:e.some(e=>e.includes("\n")))&&t}},156657,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.valueFromASTUntyped=function e(t,i){switch(t.kind){case r.Kind.NULL:return null;case r.Kind.INT:return parseInt(t.value,10);case r.Kind.FLOAT:return parseFloat(t.value);case r.Kind.STRING:case r.Kind.ENUM:case r.Kind.BOOLEAN:return t.value;case r.Kind.LIST:return t.values.map(t=>e(t,i));case r.Kind.OBJECT:return(0,n.keyValMap)(t.fields,e=>e.name.value,t=>e(t.value,i));case r.Kind.VARIABLE:return null==i?void 0:i[t.name.value]}};var n=e.r(213552),r=e.r(199311)},999965,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.assertEnumValueName=function(e){if("true"===e||"false"===e||"null"===e)throw new r.GraphQLError(`Enum values cannot be named: ${e}`);return s(e)},i.assertName=s;var n=e.r(786390),r=e.r(294943),a=e.r(64692);function s(e){if(null!=e||(0,n.devAssert)(!1,"Must provide name."),"string"==typeof e||(0,n.devAssert)(!1,"Expected name to be a string."),0===e.length)throw new r.GraphQLError("Expected name to be a non-empty string.");for(let t=1;t<e.length;++t)if(!(0,a.isNameContinue)(e.charCodeAt(t)))throw new r.GraphQLError(`Names must only contain [_a-zA-Z0-9] but "${e}" does not.`);if(!(0,a.isNameStart)(e.charCodeAt(0)))throw new r.GraphQLError(`Names must start with [_a-zA-Z] but "${e}" does not.`);return e}},211325,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.GraphQLUnionType=i.GraphQLScalarType=i.GraphQLObjectType=i.GraphQLNonNull=i.GraphQLList=i.GraphQLInterfaceType=i.GraphQLInputObjectType=i.GraphQLEnumType=void 0,i.argsToArgsConfig=H,i.assertAbstractType=function(e){if(!C(e))throw Error(`Expected ${(0,s.inspect)(e)} to be a GraphQL abstract type.`);return e},i.assertCompositeType=function(e){if(!L(e))throw Error(`Expected ${(0,s.inspect)(e)} to be a GraphQL composite type.`);return e},i.assertEnumType=function(e){if(!N(e))throw Error(`Expected ${(0,s.inspect)(e)} to be a GraphQL Enum type.`);return e},i.assertInputObjectType=function(e){if(!_(e))throw Error(`Expected ${(0,s.inspect)(e)} to be a GraphQL Input Object type.`);return e},i.assertInputType=function(e){if(!O(e))throw Error(`Expected ${(0,s.inspect)(e)} to be a GraphQL input type.`);return e},i.assertInterfaceType=function(e){if(!I(e))throw Error(`Expected ${(0,s.inspect)(e)} to be a GraphQL Interface type.`);return e},i.assertLeafType=function(e){if(!w(e))throw Error(`Expected ${(0,s.inspect)(e)} to be a GraphQL leaf type.`);return e},i.assertListType=function(e){if(!D(e))throw Error(`Expected ${(0,s.inspect)(e)} to be a GraphQL List type.`);return e},i.assertNamedType=function(e){if(!M(e))throw Error(`Expected ${(0,s.inspect)(e)} to be a GraphQL named type.`);return e},i.assertNonNullType=function(e){if(!A(e))throw Error(`Expected ${(0,s.inspect)(e)} to be a GraphQL Non-Null type.`);return e},i.assertNullableType=function(e){if(!x(e))throw Error(`Expected ${(0,s.inspect)(e)} to be a GraphQL nullable type.`);return e},i.assertObjectType=function(e){if(!E(e))throw Error(`Expected ${(0,s.inspect)(e)} to be a GraphQL Object type.`);return e},i.assertOutputType=function(e){if(!R(e))throw Error(`Expected ${(0,s.inspect)(e)} to be a GraphQL output type.`);return e},i.assertScalarType=function(e){if(!S(e))throw Error(`Expected ${(0,s.inspect)(e)} to be a GraphQL Scalar type.`);return e},i.assertType=function(e){if(!T(e))throw Error(`Expected ${(0,s.inspect)(e)} to be a GraphQL type.`);return e},i.assertUnionType=function(e){if(!b(e))throw Error(`Expected ${(0,s.inspect)(e)} to be a GraphQL Union type.`);return e},i.assertWrappingType=function(e){if(!P(e))throw Error(`Expected ${(0,s.inspect)(e)} to be a GraphQL wrapping type.`);return e},i.defineArguments=K,i.getNamedType=function(e){if(e){let t=e;for(;P(t);)t=t.ofType;return t}},i.getNullableType=function(e){if(e)return A(e)?e.ofType:e},i.isAbstractType=C,i.isCompositeType=L,i.isEnumType=N,i.isInputObjectType=_,i.isInputType=O,i.isInterfaceType=I,i.isLeafType=w,i.isListType=D,i.isNamedType=M,i.isNonNullType=A,i.isNullableType=x,i.isObjectType=E,i.isOutputType=R,i.isRequiredArgument=function(e){return A(e.type)&&void 0===e.defaultValue},i.isRequiredInputField=function(e){return A(e.type)&&void 0===e.defaultValue},i.isScalarType=S,i.isType=T,i.isUnionType=b,i.isWrappingType=P,i.resolveObjMapThunk=$,i.resolveReadonlyArrayThunk=U;var n=e.r(786390),r=e.r(996650),a=e.r(644568),s=e.r(818123),o=e.r(792942),l=e.r(776887),u=e.r(117921),c=e.r(213552),d=e.r(287547),p=e.r(529364),h=e.r(605021),f=e.r(294943),m=e.r(199311),y=e.r(340647),v=e.r(156657),g=e.r(999965);function T(e){return S(e)||E(e)||I(e)||b(e)||N(e)||_(e)||D(e)||A(e)}function S(e){return(0,o.instanceOf)(e,j)}function E(e){return(0,o.instanceOf)(e,V)}function I(e){return(0,o.instanceOf)(e,J)}function b(e){return(0,o.instanceOf)(e,W)}function N(e){return(0,o.instanceOf)(e,z)}function _(e){return(0,o.instanceOf)(e,ee)}function D(e){return(0,o.instanceOf)(e,F)}function A(e){return(0,o.instanceOf)(e,k)}function O(e){return S(e)||N(e)||_(e)||P(e)&&O(e.ofType)}function R(e){return S(e)||E(e)||I(e)||b(e)||N(e)||P(e)&&R(e.ofType)}function w(e){return S(e)||N(e)}function L(e){return E(e)||I(e)||b(e)}function C(e){return I(e)||b(e)}class F{constructor(e){T(e)||(0,n.devAssert)(!1,`Expected ${(0,s.inspect)(e)} to be a GraphQL type.`),this.ofType=e}get[Symbol.toStringTag](){return"GraphQLList"}toString(){return"["+String(this.ofType)+"]"}toJSON(){return this.toString()}}i.GraphQLList=F;class k{constructor(e){x(e)||(0,n.devAssert)(!1,`Expected ${(0,s.inspect)(e)} to be a GraphQL nullable type.`),this.ofType=e}get[Symbol.toStringTag](){return"GraphQLNonNull"}toString(){return String(this.ofType)+"!"}toJSON(){return this.toString()}}function P(e){return D(e)||A(e)}function x(e){return T(e)&&!A(e)}function M(e){return S(e)||E(e)||I(e)||b(e)||N(e)||_(e)}function U(e){return"function"==typeof e?e():e}function $(e){return"function"==typeof e?e():e}i.GraphQLNonNull=k;class j{constructor(e){var t,i,r,o;const l=null!=(t=e.parseValue)?t:a.identityFunc;this.name=(0,g.assertName)(e.name),this.description=e.description,this.specifiedByURL=e.specifiedByURL,this.serialize=null!=(i=e.serialize)?i:a.identityFunc,this.parseValue=l,this.parseLiteral=null!=(r=e.parseLiteral)?r:(e,t)=>l((0,v.valueFromASTUntyped)(e,t)),this.extensions=(0,h.toObjMap)(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!=(o=e.extensionASTNodes)?o:[],null==e.specifiedByURL||"string"==typeof e.specifiedByURL||(0,n.devAssert)(!1,`${this.name} must provide "specifiedByURL" as a string, but got: ${(0,s.inspect)(e.specifiedByURL)}.`),null==e.serialize||"function"==typeof e.serialize||(0,n.devAssert)(!1,`${this.name} must provide "serialize" function. If this custom Scalar is also used as an input type, ensure "parseValue" and "parseLiteral" functions are also provided.`),e.parseLiteral&&("function"==typeof e.parseValue&&"function"==typeof e.parseLiteral||(0,n.devAssert)(!1,`${this.name} must provide both "parseValue" and "parseLiteral" 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,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}i.GraphQLScalarType=j;class V{constructor(e){var t;this.name=(0,g.assertName)(e.name),this.description=e.description,this.isTypeOf=e.isTypeOf,this.extensions=(0,h.toObjMap)(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!=(t=e.extensionASTNodes)?t:[],this._fields=()=>B(e),this._interfaces=()=>G(e),null==e.isTypeOf||"function"==typeof e.isTypeOf||(0,n.devAssert)(!1,`${this.name} must provide "isTypeOf" as a function, but got: ${(0,s.inspect)(e.isTypeOf)}.`)}get[Symbol.toStringTag](){return"GraphQLObjectType"}getFields(){return"function"==typeof this._fields&&(this._fields=this._fields()),this._fields}getInterfaces(){return"function"==typeof this._interfaces&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:q(this.getFields()),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function G(e){var t;let i=U(null!=(t=e.interfaces)?t:[]);return Array.isArray(i)||(0,n.devAssert)(!1,`${e.name} interfaces must be an Array or a function which returns an Array.`),i}function B(e){let t=$(e.fields);return Q(t)||(0,n.devAssert)(!1,`${e.name} fields must be an object with field names as keys or a function which returns such an object.`),(0,d.mapValue)(t,(t,i)=>{var r;Q(t)||(0,n.devAssert)(!1,`${e.name}.${i} field config must be an object.`),null==t.resolve||"function"==typeof t.resolve||(0,n.devAssert)(!1,`${e.name}.${i} field resolver must be a function if provided, but got: ${(0,s.inspect)(t.resolve)}.`);let a=null!=(r=t.args)?r:{};return Q(a)||(0,n.devAssert)(!1,`${e.name}.${i} args must be an object with argument names as keys.`),{name:(0,g.assertName)(i),description:t.description,type:t.type,args:K(a),resolve:t.resolve,subscribe:t.subscribe,deprecationReason:t.deprecationReason,extensions:(0,h.toObjMap)(t.extensions),astNode:t.astNode}})}function K(e){return Object.entries(e).map(([e,t])=>({name:(0,g.assertName)(e),description:t.description,type:t.type,defaultValue:t.defaultValue,deprecationReason:t.deprecationReason,extensions:(0,h.toObjMap)(t.extensions),astNode:t.astNode}))}function Q(e){return(0,l.isObjectLike)(e)&&!Array.isArray(e)}function q(e){return(0,d.mapValue)(e,e=>({description:e.description,type:e.type,args:H(e.args),resolve:e.resolve,subscribe:e.subscribe,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode}))}function H(e){return(0,c.keyValMap)(e,e=>e.name,e=>({description:e.description,type:e.type,defaultValue:e.defaultValue,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode}))}i.GraphQLObjectType=V;class J{constructor(e){var t;this.name=(0,g.assertName)(e.name),this.description=e.description,this.resolveType=e.resolveType,this.extensions=(0,h.toObjMap)(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!=(t=e.extensionASTNodes)?t:[],this._fields=B.bind(void 0,e),this._interfaces=G.bind(void 0,e),null==e.resolveType||"function"==typeof e.resolveType||(0,n.devAssert)(!1,`${this.name} must provide "resolveType" as a function, but got: ${(0,s.inspect)(e.resolveType)}.`)}get[Symbol.toStringTag](){return"GraphQLInterfaceType"}getFields(){return"function"==typeof this._fields&&(this._fields=this._fields()),this._fields}getInterfaces(){return"function"==typeof this._interfaces&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:q(this.getFields()),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}i.GraphQLInterfaceType=J;class W{constructor(e){var t;this.name=(0,g.assertName)(e.name),this.description=e.description,this.resolveType=e.resolveType,this.extensions=(0,h.toObjMap)(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!=(t=e.extensionASTNodes)?t:[],this._types=Y.bind(void 0,e),null==e.resolveType||"function"==typeof e.resolveType||(0,n.devAssert)(!1,`${this.name} must provide "resolveType" as a function, but got: ${(0,s.inspect)(e.resolveType)}.`)}get[Symbol.toStringTag](){return"GraphQLUnionType"}getTypes(){return"function"==typeof this._types&&(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 Y(e){let t=U(e.types);return Array.isArray(t)||(0,n.devAssert)(!1,`Must provide Array of types or a function which returns such an array for Union ${e.name}.`),t}i.GraphQLUnionType=W;class z{constructor(e){var t;this.name=(0,g.assertName)(e.name),this.description=e.description,this.extensions=(0,h.toObjMap)(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!=(t=e.extensionASTNodes)?t:[],this._values="function"==typeof e.values?e.values:Z(this.name,e.values),this._valueLookup=null,this._nameLookup=null}get[Symbol.toStringTag](){return"GraphQLEnumType"}getValues(){return"function"==typeof this._values&&(this._values=Z(this.name,this._values())),this._values}getValue(e){return null===this._nameLookup&&(this._nameLookup=(0,u.keyMap)(this.getValues(),e=>e.name)),this._nameLookup[e]}serialize(e){null===this._valueLookup&&(this._valueLookup=new Map(this.getValues().map(e=>[e.value,e])));let t=this._valueLookup.get(e);if(void 0===t)throw new f.GraphQLError(`Enum "${this.name}" cannot represent value: ${(0,s.inspect)(e)}`);return t.name}parseValue(e){if("string"!=typeof e){let t=(0,s.inspect)(e);throw new f.GraphQLError(`Enum "${this.name}" cannot represent non-string value: ${t}.`+X(this,t))}let t=this.getValue(e);if(null==t)throw new f.GraphQLError(`Value "${e}" does not exist in "${this.name}" enum.`+X(this,e));return t.value}parseLiteral(e,t){if(e.kind!==m.Kind.ENUM){let t=(0,y.print)(e);throw new f.GraphQLError(`Enum "${this.name}" cannot represent non-enum value: ${t}.`+X(this,t),{nodes:e})}let i=this.getValue(e.value);if(null==i){let t=(0,y.print)(e);throw new f.GraphQLError(`Value "${t}" does not exist in "${this.name}" enum.`+X(this,t),{nodes:e})}return i.value}toConfig(){let e=(0,c.keyValMap)(this.getValues(),e=>e.name,e=>({description:e.description,value:e.value,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode}));return{name:this.name,description:this.description,values:e,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function X(e,t){let i=e.getValues().map(e=>e.name),n=(0,p.suggestionList)(t,i);return(0,r.didYouMean)("the enum value",n)}function Z(e,t){return Q(t)||(0,n.devAssert)(!1,`${e} values must be an object with value names as keys.`),Object.entries(t).map(([t,i])=>(Q(i)||(0,n.devAssert)(!1,`${e}.${t} must refer to an object with a "value" key representing an internal value but got: ${(0,s.inspect)(i)}.`),{name:(0,g.assertEnumValueName)(t),description:i.description,value:void 0!==i.value?i.value:t,deprecationReason:i.deprecationReason,extensions:(0,h.toObjMap)(i.extensions),astNode:i.astNode}))}i.GraphQLEnumType=z;class ee{constructor(e){var t,i;this.name=(0,g.assertName)(e.name),this.description=e.description,this.extensions=(0,h.toObjMap)(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!=(t=e.extensionASTNodes)?t:[],this.isOneOf=null!=(i=e.isOneOf)&&i,this._fields=et.bind(void 0,e)}get[Symbol.toStringTag](){return"GraphQLInputObjectType"}getFields(){return"function"==typeof this._fields&&(this._fields=this._fields()),this._fields}toConfig(){let e=(0,d.mapValue)(this.getFields(),e=>({description:e.description,type:e.type,defaultValue:e.defaultValue,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode}));return{name:this.name,description:this.description,fields:e,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,isOneOf:this.isOneOf}}toString(){return this.name}toJSON(){return this.toString()}}function et(e){let t=$(e.fields);return Q(t)||(0,n.devAssert)(!1,`${e.name} fields must be an object with field names as keys or a function which returns such an object.`),(0,d.mapValue)(t,(t,i)=>("resolve"in t&&(0,n.devAssert)(!1,`${e.name}.${i} field has a resolve property, but Input Types cannot define resolvers.`),{name:(0,g.assertName)(i),description:t.description,type:t.type,defaultValue:t.defaultValue,deprecationReason:t.deprecationReason,extensions:(0,h.toObjMap)(t.extensions),astNode:t.astNode}))}i.GraphQLInputObjectType=ee},957861,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.doTypesOverlap=function(e,t,i){return t===i||((0,n.isAbstractType)(t)?(0,n.isAbstractType)(i)?e.getPossibleTypes(t).some(t=>e.isSubType(i,t)):e.isSubType(t,i):!!(0,n.isAbstractType)(i)&&e.isSubType(i,t))},i.isEqualType=function e(t,i){return t===i||!!((0,n.isNonNullType)(t)&&(0,n.isNonNullType)(i)||(0,n.isListType)(t)&&(0,n.isListType)(i))&&e(t.ofType,i.ofType)},i.isTypeSubTypeOf=function e(t,i,r){return i===r||((0,n.isNonNullType)(r)?!!(0,n.isNonNullType)(i)&&e(t,i.ofType,r.ofType):(0,n.isNonNullType)(i)?e(t,i.ofType,r):(0,n.isListType)(r)?!!(0,n.isListType)(i)&&e(t,i.ofType,r.ofType):!(0,n.isListType)(i)&&(0,n.isAbstractType)(r)&&((0,n.isInterfaceType)(i)||(0,n.isObjectType)(i))&&t.isSubType(r,i))};var n=e.r(211325)},142478,(e,t,i)=>{"use strict";var n,r;Object.defineProperty(i,"__esModule",{value:!0}),i.DirectiveLocation=void 0,i.DirectiveLocation=n,(r=n||(i.DirectiveLocation=n={})).QUERY="QUERY",r.MUTATION="MUTATION",r.SUBSCRIPTION="SUBSCRIPTION",r.FIELD="FIELD",r.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",r.FRAGMENT_SPREAD="FRAGMENT_SPREAD",r.INLINE_FRAGMENT="INLINE_FRAGMENT",r.VARIABLE_DEFINITION="VARIABLE_DEFINITION",r.SCHEMA="SCHEMA",r.SCALAR="SCALAR",r.OBJECT="OBJECT",r.FIELD_DEFINITION="FIELD_DEFINITION",r.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",r.INTERFACE="INTERFACE",r.UNION="UNION",r.ENUM="ENUM",r.ENUM_VALUE="ENUM_VALUE",r.INPUT_OBJECT="INPUT_OBJECT",r.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION",r.DIRECTIVE_DEFINITION="DIRECTIVE_DEFINITION"},947129,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.GraphQLString=i.GraphQLInt=i.GraphQLID=i.GraphQLFloat=i.GraphQLBoolean=i.GRAPHQL_MIN_INT=i.GRAPHQL_MAX_INT=void 0,i.isSpecifiedScalarType=function(e){return f.some(({name:t})=>e.name===t)},i.specifiedScalarTypes=void 0;var n=e.r(818123),r=e.r(776887),a=e.r(294943),s=e.r(199311),o=e.r(340647),l=e.r(211325);i.GRAPHQL_MAX_INT=0x7fffffff,i.GRAPHQL_MIN_INT=-0x80000000;let u=new l.GraphQLScalarType({name:"Int",description:"The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.",serialize(e){let t=m(e);if("boolean"==typeof t)return+!!t;let i=t;if("string"==typeof t&&""!==t&&(i=Number(t)),"number"!=typeof i||!Number.isInteger(i))throw new a.GraphQLError(`Int cannot represent non-integer value: ${(0,n.inspect)(t)}`);if(i>0x7fffffff||i<-0x80000000)throw new a.GraphQLError("Int cannot represent non 32-bit signed integer value: "+(0,n.inspect)(t));return i},parseValue(e){if("number"!=typeof e||!Number.isInteger(e))throw new a.GraphQLError(`Int cannot represent non-integer value: ${(0,n.inspect)(e)}`);if(e>0x7fffffff||e<-0x80000000)throw new a.GraphQLError(`Int cannot represent non 32-bit signed integer value: ${e}`);return e},parseLiteral(e){if(e.kind!==s.Kind.INT)throw new a.GraphQLError(`Int cannot represent non-integer value: ${(0,o.print)(e)}`,{nodes:e});let t=parseInt(e.value,10);if(t>0x7fffffff||t<-0x80000000)throw new a.GraphQLError(`Int cannot represent non 32-bit signed integer value: ${e.value}`,{nodes:e});return t}});i.GraphQLInt=u;let c=new l.GraphQLScalarType({name:"Float",description:"The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).",serialize(e){let t=m(e);if("boolean"==typeof t)return+!!t;let i=t;if("string"==typeof t&&""!==t&&(i=Number(t)),"number"!=typeof i||!Number.isFinite(i))throw new a.GraphQLError(`Float cannot represent non numeric value: ${(0,n.inspect)(t)}`);return i},parseValue(e){if("number"!=typeof e||!Number.isFinite(e))throw new a.GraphQLError(`Float cannot represent non numeric value: ${(0,n.inspect)(e)}`);return e},parseLiteral(e){if(e.kind!==s.Kind.FLOAT&&e.kind!==s.Kind.INT)throw new a.GraphQLError(`Float cannot represent non numeric value: ${(0,o.print)(e)}`,e);return parseFloat(e.value)}});i.GraphQLFloat=c;let d=new l.GraphQLScalarType({name:"String",description:"The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.",serialize(e){let t=m(e);if("string"==typeof t)return t;if("boolean"==typeof t)return t?"true":"false";if("number"==typeof t&&Number.isFinite(t))return t.toString();throw new a.GraphQLError(`String cannot represent value: ${(0,n.inspect)(e)}`)},parseValue(e){if("string"!=typeof e)throw new a.GraphQLError(`String cannot represent a non string value: ${(0,n.inspect)(e)}`);return e},parseLiteral(e){if(e.kind!==s.Kind.STRING)throw new a.GraphQLError(`String cannot represent a non string value: ${(0,o.print)(e)}`,{nodes:e});return e.value}});i.GraphQLString=d;let p=new l.GraphQLScalarType({name:"Boolean",description:"The `Boolean` scalar type represents `true` or `false`.",serialize(e){let t=m(e);if("boolean"==typeof t)return t;if(Number.isFinite(t))return 0!==t;throw new a.GraphQLError(`Boolean cannot represent a non boolean value: ${(0,n.inspect)(t)}`)},parseValue(e){if("boolean"!=typeof e)throw new a.GraphQLError(`Boolean cannot represent a non boolean value: ${(0,n.inspect)(e)}`);return e},parseLiteral(e){if(e.kind!==s.Kind.BOOLEAN)throw new a.GraphQLError(`Boolean cannot represent a non boolean value: ${(0,o.print)(e)}`,{nodes:e});return e.value}});i.GraphQLBoolean=p;let h=new l.GraphQLScalarType({name:"ID",description:'The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID.',serialize(e){let t=m(e);if("string"==typeof t)return t;if(Number.isInteger(t))return String(t);throw new a.GraphQLError(`ID cannot represent value: ${(0,n.inspect)(e)}`)},parseValue(e){if("string"==typeof e)return e;if("number"==typeof e&&Number.isInteger(e))return e.toString();throw new a.GraphQLError(`ID cannot represent value: ${(0,n.inspect)(e)}`)},parseLiteral(e){if(e.kind!==s.Kind.STRING&&e.kind!==s.Kind.INT)throw new a.GraphQLError("ID cannot represent a non-string and non-integer value: "+(0,o.print)(e),{nodes:e});return e.value}});i.GraphQLID=h;let f=Object.freeze([d,u,c,p,h]);function m(e){if((0,r.isObjectLike)(e)){if("function"==typeof e.valueOf){let t=e.valueOf();if(!(0,r.isObjectLike)(t))return t}if("function"==typeof e.toJSON)return e.toJSON()}return e}i.specifiedScalarTypes=f},336081,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.GraphQLSpecifiedByDirective=i.GraphQLSkipDirective=i.GraphQLOneOfDirective=i.GraphQLIncludeDirective=i.GraphQLDirective=i.GraphQLDeprecatedDirective=i.DEFAULT_DEPRECATION_REASON=void 0,i.assertDirective=function(e){if(!p(e))throw Error(`Expected ${(0,r.inspect)(e)} to be a GraphQL directive.`);return e},i.isDirective=p,i.isSpecifiedDirective=function(e){return S.some(({name:t})=>t===e.name)},i.specifiedDirectives=void 0;var n=e.r(786390),r=e.r(818123),a=e.r(792942),s=e.r(776887),o=e.r(605021),l=e.r(142478),u=e.r(999965),c=e.r(211325),d=e.r(947129);function p(e){return(0,a.instanceOf)(e,h)}class h{constructor(e){var t,i,r;this.name=(0,u.assertName)(e.name),this.description=e.description,this.locations=e.locations,this.isRepeatable=null!=(t=e.isRepeatable)&&t,this.deprecationReason=e.deprecationReason,this.extensions=(0,o.toObjMap)(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!=(i=e.extensionASTNodes)?i:[],Array.isArray(e.locations)||(0,n.devAssert)(!1,`@${e.name} locations must be an Array.`);const a=null!=(r=e.args)?r:{};(0,s.isObjectLike)(a)&&!Array.isArray(a)||(0,n.devAssert)(!1,`@${e.name} args must be an object with argument names as keys.`),this.args=(0,c.defineArguments)(a)}get[Symbol.toStringTag](){return"GraphQLDirective"}toConfig(){return{name:this.name,description:this.description,locations:this.locations,args:(0,c.argsToArgsConfig)(this.args),isRepeatable:this.isRepeatable,deprecationReason:this.deprecationReason,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return"@"+this.name}toJSON(){return this.toString()}}i.GraphQLDirective=h;let f=new h({name:"include",description:"Directs the executor to include this field or fragment only when the `if` argument is true.",locations:[l.DirectiveLocation.FIELD,l.DirectiveLocation.FRAGMENT_SPREAD,l.DirectiveLocation.INLINE_FRAGMENT],args:{if:{type:new c.GraphQLNonNull(d.GraphQLBoolean),description:"Included when true."}}});i.GraphQLIncludeDirective=f;let m=new h({name:"skip",description:"Directs the executor to skip this field or fragment when the `if` argument is true.",locations:[l.DirectiveLocation.FIELD,l.DirectiveLocation.FRAGMENT_SPREAD,l.DirectiveLocation.INLINE_FRAGMENT],args:{if:{type:new c.GraphQLNonNull(d.GraphQLBoolean),description:"Skipped when true."}}});i.GraphQLSkipDirective=m;let y="No longer supported";i.DEFAULT_DEPRECATION_REASON=y;let v=new h({name:"deprecated",description:"Marks an element of a GraphQL schema as no longer supported.",locations:[l.DirectiveLocation.FIELD_DEFINITION,l.DirectiveLocation.ARGUMENT_DEFINITION,l.DirectiveLocation.INPUT_FIELD_DEFINITION,l.DirectiveLocation.ENUM_VALUE,l.DirectiveLocation.DIRECTIVE_DEFINITION],args:{reason:{type:d.GraphQLString,description:"Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/).",defaultValue:y}}});i.GraphQLDeprecatedDirective=v;let g=new h({name:"specifiedBy",description:"Exposes a URL that specifies the behavior of this scalar.",locations:[l.DirectiveLocation.SCALAR],args:{url:{type:new c.GraphQLNonNull(d.GraphQLString),description:"The URL that specifies the behavior of this scalar."}}});i.GraphQLSpecifiedByDirective=g;let T=new h({name:"oneOf",description:"Indicates exactly one field must be supplied and this field must not be `null`.",locations:[l.DirectiveLocation.INPUT_OBJECT],args:{}});i.GraphQLOneOfDirective=T;let S=Object.freeze([f,m,v,g,T]);i.specifiedDirectives=S},891275,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.isIterableObject=function(e){return"object"==typeof e&&"function"==typeof(null==e?void 0:e[Symbol.iterator])}},434582,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.astFromValue=function e(t,i){if((0,l.isNonNullType)(i)){let n=e(t,i.ofType);return(null==n?void 0:n.kind)===o.Kind.NULL?null:n}if(null===t)return{kind:o.Kind.NULL};if(void 0===t)return null;if((0,l.isListType)(i)){let n=i.ofType;if((0,a.isIterableObject)(t)){let i=[];for(let r of t){let t=e(r,n);null!=t&&i.push(t)}return{kind:o.Kind.LIST,values:i}}return e(t,n)}if((0,l.isInputObjectType)(i)){if(!(0,s.isObjectLike)(t))return null;let n=[];for(let r of Object.values(i.getFields())){let i=e(t[r.name],r.type);i&&n.push({kind:o.Kind.OBJECT_FIELD,name:{kind:o.Kind.NAME,value:r.name},value:i})}return{kind:o.Kind.OBJECT,fields:n}}if((0,l.isLeafType)(i)){let e=i.serialize(t);if(null==e)return null;if("boolean"==typeof e)return{kind:o.Kind.BOOLEAN,value:e};if("number"==typeof e&&Number.isFinite(e)){let t=String(e);return c.test(t)?{kind:o.Kind.INT,value:t}:{kind:o.Kind.FLOAT,value:t}}if("string"==typeof e)return(0,l.isEnumType)(i)?{kind:o.Kind.ENUM,value:e}:i===u.GraphQLID&&c.test(e)?{kind:o.Kind.INT,value:e}:{kind:o.Kind.STRING,value:e};throw TypeError(`Cannot convert value to AST: ${(0,n.inspect)(e)}.`)}(0,r.invariant)(!1,"Unexpected input type: "+(0,n.inspect)(i))};var n=e.r(818123),r=e.r(119588),a=e.r(891275),s=e.r(776887),o=e.r(199311),l=e.r(211325),u=e.r(947129);let c=/^-?(?:0|[1-9][0-9]*)$/},187936,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.introspectionTypes=i.__TypeKind=i.__Type=i.__Schema=i.__InputValue=i.__Field=i.__EnumValue=i.__DirectiveLocation=i.__Directive=i.TypeNameMetaFieldDef=i.TypeMetaFieldDef=i.TypeKind=i.SchemaMetaFieldDef=void 0,i.isIntrospectionType=function(e){return S.some(({name:t})=>e.name===t)};var n,r,a=e.r(818123),s=e.r(119588),o=e.r(142478),l=e.r(340647),u=e.r(434582),c=e.r(211325),d=e.r(947129);let p=new c.GraphQLObjectType({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:d.GraphQLString,resolve:e=>e.description},types:{description:"A list of all types supported by this server.",type:new c.GraphQLNonNull(new c.GraphQLList(new c.GraphQLNonNull(m))),resolve:e=>Object.values(e.getTypeMap())},queryType:{description:"The type that query operations will be rooted at.",type:new c.GraphQLNonNull(m),resolve:e=>e.getQueryType()},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:m,resolve:e=>e.getMutationType()},subscriptionType:{description:"If this server support subscription, the type that subscription operations will be rooted at.",type:m,resolve:e=>e.getSubscriptionType()},directives:{description:"A list of all directives supported by this server.",type:new c.GraphQLNonNull(new c.GraphQLList(new c.GraphQLNonNull(h))),args:{includeDeprecated:{type:new c.GraphQLNonNull(d.GraphQLBoolean),defaultValue:!1}},resolve:(e,{includeDeprecated:t})=>t?e.getDirectives():e.getDirectives().filter(e=>null==e.deprecationReason)}})});i.__Schema=p;let h=new c.GraphQLObjectType({name:"__Directive",description:"A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.\n\nIn 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 c.GraphQLNonNull(d.GraphQLString),resolve:e=>e.name},description:{type:d.GraphQLString,resolve:e=>e.description},isRepeatable:{type:new c.GraphQLNonNull(d.GraphQLBoolean),resolve:e=>e.isRepeatable},locations:{type:new c.GraphQLNonNull(new c.GraphQLList(new c.GraphQLNonNull(f))),resolve:e=>e.locations},args:{type:new c.GraphQLNonNull(new c.GraphQLList(new c.GraphQLNonNull(v))),args:{includeDeprecated:{type:d.GraphQLBoolean,defaultValue:!1}},resolve:(e,{includeDeprecated:t})=>t?e.args:e.args.filter(e=>null==e.deprecationReason)},isDeprecated:{type:new c.GraphQLNonNull(d.GraphQLBoolean),resolve:e=>null!=e.deprecationReason},deprecationReason:{type:d.GraphQLString,resolve:e=>e.deprecationReason}})});i.__Directive=h;let f=new c.GraphQLEnumType({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:o.DirectiveLocation.QUERY,description:"Location adjacent to a query operation."},MUTATION:{value:o.DirectiveLocation.MUTATION,description:"Location adjacent to a mutation operation."},SUBSCRIPTION:{value:o.DirectiveLocation.SUBSCRIPTION,description:"Location adjacent to a subscription operation."},FIELD:{value:o.DirectiveLocation.FIELD,description:"Location adjacent to a field."},FRAGMENT_DEFINITION:{value:o.DirectiveLocation.FRAGMENT_DEFINITION,description:"Location adjacent to a fragment definition."},FRAGMENT_SPREAD:{value:o.DirectiveLocation.FRAGMENT_SPREAD,description:"Location adjacent to a fragment spread."},INLINE_FRAGMENT:{value:o.DirectiveLocation.INLINE_FRAGMENT,description:"Location adjacent to an inline fragment."},VARIABLE_DEFINITION:{value:o.DirectiveLocation.VARIABLE_DEFINITION,description:"Location adjacent to a variable definition."},SCHEMA:{value:o.DirectiveLocation.SCHEMA,description:"Location adjacent to a schema definition."},SCALAR:{value:o.DirectiveLocation.SCALAR,description:"Location adjacent to a scalar definition."},OBJECT:{value:o.DirectiveLocation.OBJECT,description:"Location adjacent to an object type definition."},FIELD_DEFINITION:{value:o.DirectiveLocation.FIELD_DEFINITION,description:"Location adjacent to a field definition."},ARGUMENT_DEFINITION:{value:o.DirectiveLocation.ARGUMENT_DEFINITION,description:"Location adjacent to an argument definition."},INTERFACE:{value:o.DirectiveLocation.INTERFACE,description:"Location adjacent to an interface definition."},UNION:{value:o.DirectiveLocation.UNION,description:"Location adjacent to a union definition."},ENUM:{value:o.DirectiveLocation.ENUM,description:"Location adjacent to an enum definition."},ENUM_VALUE:{value:o.DirectiveLocation.ENUM_VALUE,description:"Location adjacent to an enum value definition."},INPUT_OBJECT:{value:o.DirectiveLocation.INPUT_OBJECT,description:"Location adjacent to an input object type definition."},INPUT_FIELD_DEFINITION:{value:o.DirectiveLocation.INPUT_FIELD_DEFINITION,description:"Location adjacent to an input object field definition."},DIRECTIVE_DEFINITION:{value:o.DirectiveLocation.DIRECTIVE_DEFINITION,description:"Location adjacent to a directive definition."}}});i.__DirectiveLocation=f;let m=new c.GraphQLObjectType({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 c.GraphQLNonNull(T),resolve:e=>(0,c.isScalarType)(e)?r.SCALAR:(0,c.isObjectType)(e)?r.OBJECT:(0,c.isInterfaceType)(e)?r.INTERFACE:(0,c.isUnionType)(e)?r.UNION:(0,c.isEnumType)(e)?r.ENUM:(0,c.isInputObjectType)(e)?r.INPUT_OBJECT:(0,c.isListType)(e)?r.LIST:(0,c.isNonNullType)(e)?r.NON_NULL:void(0,s.invariant)(!1,`Unexpected type: "${(0,a.inspect)(e)}".`)},name:{type:d.GraphQLString,resolve:e=>"name"in e?e.name:void 0},description:{type:d.GraphQLString,resolve:e=>"description"in e?e.description:void 0},specifiedByURL:{type:d.GraphQLString,resolve:e=>"specifiedByURL"in e?e.specifiedByURL:void 0},fields:{type:new c.GraphQLList(new c.GraphQLNonNull(y)),args:{includeDeprecated:{type:d.GraphQLBoolean,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if((0,c.isObjectType)(e)||(0,c.isInterfaceType)(e)){let i=Object.values(e.getFields());return t?i:i.filter(e=>null==e.deprecationReason)}}},interfaces:{type:new c.GraphQLList(new c.GraphQLNonNull(m)),resolve(e){if((0,c.isObjectType)(e)||(0,c.isInterfaceType)(e))return e.getInterfaces()}},possibleTypes:{type:new c.GraphQLList(new c.GraphQLNonNull(m)),resolve(e,t,i,{schema:n}){if((0,c.isAbstractType)(e))return n.getPossibleTypes(e)}},enumValues:{type:new c.GraphQLList(new c.GraphQLNonNull(g)),args:{includeDeprecated:{type:d.GraphQLBoolean,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if((0,c.isEnumType)(e)){let i=e.getValues();return t?i:i.filter(e=>null==e.deprecationReason)}}},inputFields:{type:new c.GraphQLList(new c.GraphQLNonNull(v)),args:{includeDeprecated:{type:d.GraphQLBoolean,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if((0,c.isInputObjectType)(e)){let i=Object.values(e.getFields());return t?i:i.filter(e=>null==e.deprecationReason)}}},ofType:{type:m,resolve:e=>"ofType"in e?e.ofType:void 0},isOneOf:{type:d.GraphQLBoolean,resolve:e=>{if((0,c.isInputObjectType)(e))return e.isOneOf}}})});i.__Type=m;let y=new c.GraphQLObjectType({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 c.GraphQLNonNull(d.GraphQLString),resolve:e=>e.name},description:{type:d.GraphQLString,resolve:e=>e.description},args:{type:new c.GraphQLNonNull(new c.GraphQLList(new c.GraphQLNonNull(v))),args:{includeDeprecated:{type:d.GraphQLBoolean,defaultValue:!1}},resolve:(e,{includeDeprecated:t})=>t?e.args:e.args.filter(e=>null==e.deprecationReason)},type:{type:new c.GraphQLNonNull(m),resolve:e=>e.type},isDeprecated:{type:new c.GraphQLNonNull(d.GraphQLBoolean),resolve:e=>null!=e.deprecationReason},deprecationReason:{type:d.GraphQLString,resolve:e=>e.deprecationReason}})});i.__Field=y;let v=new c.GraphQLObjectType({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 c.GraphQLNonNull(d.GraphQLString),resolve:e=>e.name},description:{type:d.GraphQLString,resolve:e=>e.description},type:{type:new c.GraphQLNonNull(m),resolve:e=>e.type},defaultValue:{type:d.GraphQLString,description:"A GraphQL-formatted string representing the default value for this input value.",resolve(e){let{type:t,defaultValue:i}=e,n=(0,u.astFromValue)(i,t);return n?(0,l.print)(n):null}},isDeprecated:{type:new c.GraphQLNonNull(d.GraphQLBoolean),resolve:e=>null!=e.deprecationReason},deprecationReason:{type:d.GraphQLString,resolve:e=>e.deprecationReason}})});i.__InputValue=v;let g=new c.GraphQLObjectType({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 c.GraphQLNonNull(d.GraphQLString),resolve:e=>e.name},description:{type:d.GraphQLString,resolve:e=>e.description},isDeprecated:{type:new c.GraphQLNonNull(d.GraphQLBoolean),resolve:e=>null!=e.deprecationReason},deprecationReason:{type:d.GraphQLString,resolve:e=>e.deprecationReason}})});i.__EnumValue=g,i.TypeKind=r,(n=r||(i.TypeKind=r={})).SCALAR="SCALAR",n.OBJECT="OBJECT",n.INTERFACE="INTERFACE",n.UNION="UNION",n.ENUM="ENUM",n.INPUT_OBJECT="INPUT_OBJECT",n.LIST="LIST",n.NON_NULL="NON_NULL";let T=new c.GraphQLEnumType({name:"__TypeKind",description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:r.SCALAR,description:"Indicates this type is a scalar."},OBJECT:{value:r.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:r.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:r.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:r.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:r.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:r.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:r.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}});i.__TypeKind=T,i.SchemaMetaFieldDef={name:"__schema",type:new c.GraphQLNonNull(p),description:"Access the current type schema of this server.",args:[],resolve:(e,t,i,{schema:n})=>n,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},i.TypeMetaFieldDef={name:"__type",type:m,description:"Request the type information of a single type.",args:[{name:"name",description:void 0,type:new c.GraphQLNonNull(d.GraphQLString),defaultValue:void 0,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0}],resolve:(e,{name:t},i,{schema:n})=>n.getType(t),deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},i.TypeNameMetaFieldDef={name:"__typename",type:new c.GraphQLNonNull(d.GraphQLString),description:"The name of the current Object type at runtime.",args:[],resolve:(e,t,i,{parentType:n})=>n.name,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0};let S=Object.freeze([p,h,f,m,y,v,g,T]);i.introspectionTypes=S},763628,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.GraphQLSchema=void 0,i.assertSchema=function(e){if(!p(e))throw Error(`Expected ${(0,r.inspect)(e)} to be a GraphQL schema.`);return e},i.isSchema=p;var n=e.r(786390),r=e.r(818123),a=e.r(792942),s=e.r(776887),o=e.r(605021),l=e.r(463040),u=e.r(211325),c=e.r(336081),d=e.r(187936);function p(e){return(0,a.instanceOf)(e,h)}class h{constructor(e){var t,i;this.__validationErrors=!0===e.assumeValid?[]:void 0,(0,s.isObjectLike)(e)||(0,n.devAssert)(!1,"Must provide configuration object."),!e.types||Array.isArray(e.types)||(0,n.devAssert)(!1,`"types" must be Array if provided but got: ${(0,r.inspect)(e.types)}.`),!e.directives||Array.isArray(e.directives)||(0,n.devAssert)(!1,`"directives" must be Array if provided but got: ${(0,r.inspect)(e.directives)}.`),this.description=e.description,this.extensions=(0,o.toObjMap)(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!=(t=e.extensionASTNodes)?t:[],this._queryType=e.query,this._mutationType=e.mutation,this._subscriptionType=e.subscription,this._directives=null!=(i=e.directives)?i:c.specifiedDirectives;const a=new Set(e.types);if(null!=e.types)for(const t of e.types)a.delete(t),f(t,a);for(const e of(null!=this._queryType&&f(this._queryType,a),null!=this._mutationType&&f(this._mutationType,a),null!=this._subscriptionType&&f(this._subscriptionType,a),this._directives))if((0,c.isDirective)(e))for(const t of e.args)f(t.type,a);for(const e of(f(d.__Schema,a),this._typeMap=Object.create(null),this._subTypeMap=Object.create(null),this._implementationsMap=Object.create(null),a)){if(null==e)continue;const t=e.name;if(t||(0,n.devAssert)(!1,"One of the provided types for building the Schema is missing a name."),void 0!==this._typeMap[t])throw Error(`Schema must contain uniquely named types but contains multiple types named "${t}".`);if(this._typeMap[t]=e,(0,u.isInterfaceType)(e)){for(const t of e.getInterfaces())if((0,u.isInterfaceType)(t)){let i=this._implementationsMap[t.name];void 0===i&&(i=this._implementationsMap[t.name]={objects:[],interfaces:[]}),i.interfaces.push(e)}}else if((0,u.isObjectType)(e)){for(const t of e.getInterfaces())if((0,u.isInterfaceType)(t)){let i=this._implementationsMap[t.name];void 0===i&&(i=this._implementationsMap[t.name]={objects:[],interfaces:[]}),i.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 l.OperationTypeNode.QUERY:return this.getQueryType();case l.OperationTypeNode.MUTATION:return this.getMutationType();case l.OperationTypeNode.SUBSCRIPTION:return this.getSubscriptionType()}}getTypeMap(){return this._typeMap}getType(e){return this.getTypeMap()[e]}getPossibleTypes(e){return(0,u.isUnionType)(e)?e.getTypes():this.getImplementations(e).objects}getImplementations(e){let t=this._implementationsMap[e.name];return null!=t?t:{objects:[],interfaces:[]}}isSubType(e,t){let i=this._subTypeMap[e.name];if(void 0===i){if(i=Object.create(null),(0,u.isUnionType)(e))for(let t of e.getTypes())i[t.name]=!0;else{let t=this.getImplementations(e);for(let e of t.objects)i[e.name]=!0;for(let e of t.interfaces)i[e.name]=!0}this._subTypeMap[e.name]=i}return void 0!==i[t.name]}getDirectives(){return this._directives}getDirective(e){return this.getDirectives().find(t=>t.name===e)}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:void 0!==this.__validationErrors}}}function f(e,t){let i=(0,u.getNamedType)(e);if(!t.has(i)){if(t.add(i),(0,u.isUnionType)(i))for(let e of i.getTypes())f(e,t);else if((0,u.isObjectType)(i)||(0,u.isInterfaceType)(i)){for(let e of i.getInterfaces())f(e,t);for(let e of Object.values(i.getFields()))for(let i of(f(e.type,t),e.args))f(i.type,t)}else if((0,u.isInputObjectType)(i))for(let e of Object.values(i.getFields()))f(e.type,t)}return t}i.GraphQLSchema=h},215956,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.assertValidSchema=function(e){let t=d(e);if(0!==t.length)throw Error(t.map(e=>e.message).join("\n\n"))},i.validateSchema=d;var n=e.r(818123),r=e.r(294943),a=e.r(463040),s=e.r(957861),o=e.r(211325),l=e.r(336081),u=e.r(187936),c=e.r(763628);function d(e){var t,i,r,d;let g,T,S,E;if((0,c.assertSchema)(e),e.__validationErrors)return e.__validationErrors;let I=new p(e);(T=(g=(t=I).schema).getQueryType())?(0,o.isObjectType)(T)||t.reportError(`Query root type must be Object type, it cannot be ${(0,n.inspect)(T)}.`,null!=(i=h(g,a.OperationTypeNode.QUERY))?i:T.astNode):t.reportError("Query root type must be provided.",g.astNode),(S=g.getMutationType())&&!(0,o.isObjectType)(S)&&t.reportError(`Mutation root type must be Object type if provided, it cannot be ${(0,n.inspect)(S)}.`,null!=(r=h(g,a.OperationTypeNode.MUTATION))?r:S.astNode),(E=g.getSubscriptionType())&&!(0,o.isObjectType)(E)&&t.reportError(`Subscription root type must be Object type if provided, it cannot be ${(0,n.inspect)(E)}.`,null!=(d=h(g,a.OperationTypeNode.SUBSCRIPTION))?d:E.astNode),function(e){for(let i of e.schema.getDirectives()){if(!(0,l.isDirective)(i)){e.reportError(`Expected directive but got: ${(0,n.inspect)(i)}.`,null==i?void 0:i.astNode);continue}for(let r of(f(e,i),0===i.locations.length&&e.reportError(`Directive @${i.name} must include 1 or more locations.`,i.astNode),i.args))if(f(e,r),(0,o.isInputType)(r.type)||e.reportError(`The type of @${i.name}(${r.name}:) must be Input Type but got: ${(0,n.inspect)(r.type)}.`,r.astNode),(0,o.isRequiredArgument)(r)&&null!=r.deprecationReason){var t;e.reportError(`Required argument @${i.name}(${r.name}:) cannot be deprecated.`,[v(r.astNode),null==(t=r.astNode)?void 0:t.type])}}}(I),function(e){var t;let i,r,a,l=(t=e,i=Object.create(null),r=[],a=Object.create(null),function e(n){if(!i[n.name]){for(let s of(i[n.name]=!0,a[n.name]=r.length,Object.values(n.getFields())))if((0,o.isNonNullType)(s.type)&&(0,o.isInputObjectType)(s.type.ofType)){let i=s.type.ofType,n=a[i.name];if(r.push(s),void 0===n)e(i);else{let e=r.slice(n),a=e.map(e=>e.name).join(".");t.reportError(`Cannot reference Input Object "${i.name}" within itself through a series of non-null fields: "${a}".`,e.map(e=>e.astNode))}r.pop()}a[n.name]=void 0}});for(let t of Object.values(e.schema.getTypeMap())){if(!(0,o.isNamedType)(t)){e.reportError(`Expected GraphQL named type but got: ${(0,n.inspect)(t)}.`,t.astNode);continue}(0,u.isIntrospectionType)(t)||f(e,t),(0,o.isObjectType)(t)||(0,o.isInterfaceType)(t)?(function(e,t){let i=Object.values(t.getFields());for(let l of(0===i.length&&e.reportError(`Type ${t.name} must define one or more fields.`,[t.astNode,...t.extensionASTNodes]),i)){var r,a,s;for(let i of(f(e,l),(0,o.isOutputType)(l.type)||e.reportError(`The type of ${t.name}.${l.name} must be Output Type but got: ${(0,n.inspect)(l.type)}.`,null==(r=l.astNode)?void 0:r.type),l.args)){let r=i.name;f(e,i),(0,o.isInputType)(i.type)||e.reportError(`The type of ${t.name}.${l.name}(${r}:) must be Input Type but got: ${(0,n.inspect)(i.type)}.`,null==(a=i.astNode)?void 0:a.type),(0,o.isRequiredArgument)(i)&&null!=i.deprecationReason&&e.reportError(`Required argument ${t.name}.${l.name}(${r}:) cannot be deprecated.`,[v(i.astNode),null==(s=i.astNode)?void 0:s.type])}}}(e,t),function(e,t){let i=Object.create(null);for(let r of t.getInterfaces()){if(!(0,o.isInterfaceType)(r)){e.reportError(`Type ${(0,n.inspect)(t)} must only implement Interface types, it cannot implement ${(0,n.inspect)(r)}.`,m(t,r));continue}if(t===r){e.reportError(`Type ${t.name} cannot implement itself because it would create a circular reference.`,m(t,r));continue}if(i[r.name]){e.reportError(`Type ${t.name} can only implement ${r.name} once.`,m(t,r));continue}i[r.name]=!0,function(e,t,i){let n=t.getInterfaces();for(let r of i.getInterfaces())n.includes(r)||e.reportError(r===t?`Type ${t.name} cannot implement ${i.name} because it would create a circular reference.`:`Type ${t.name} must implement ${r.name} because it is implemented by ${i.name}.`,[...m(i,r),...m(t,i)])}(e,t,r),function(e,t,i){let r=t.getFields();for(let d of Object.values(i.getFields())){var a,l,u,c;let p=d.name,h=r[p];if(!h){e.reportError(`Interface field ${i.name}.${p} expected but ${t.name} does not provide it.`,[d.astNode,t.astNode,...t.extensionASTNodes]);continue}for(let r of((0,s.isTypeSubTypeOf)(e.schema,h.type,d.type)||e.reportError(`Interface field ${i.name}.${p} expects type ${(0,n.inspect)(d.type)} but ${t.name}.${p} is type ${(0,n.inspect)(h.type)}.`,[null==(a=d.astNode)?void 0:a.type,null==(l=h.astNode)?void 0:l.type]),d.args)){let a=r.name,o=h.args.find(e=>e.name===a);if(!o){e.reportError(`Interface field argument ${i.name}.${p}(${a}:) expected but ${t.name}.${p} does not provide it.`,[r.astNode,h.astNode]);continue}(0,s.isEqualType)(r.type,o.type)||e.reportError(`Interface field argument ${i.name}.${p}(${a}:) expects type ${(0,n.inspect)(r.type)} but ${t.name}.${p}(${a}:) is type ${(0,n.inspect)(o.type)}.`,[null==(u=r.astNode)?void 0:u.type,null==(c=o.astNode)?void 0:c.type])}for(let n of h.args){let r=n.name;!d.args.find(e=>e.name===r)&&(0,o.isRequiredArgument)(n)&&e.reportError(`Object field ${t.name}.${p} includes required argument ${r} that is missing from the Interface field ${i.name}.${p}.`,[n.astNode,d.astNode])}}}(e,t,r)}}(e,t)):(0,o.isUnionType)(t)?function(e,t){let i=t.getTypes();0===i.length&&e.reportError(`Union type ${t.name} must define one or more member types.`,[t.astNode,...t.extensionASTNodes]);let r=Object.create(null);for(let a of i){if(r[a.name]){e.reportError(`Union type ${t.name} can only include type ${a.name} once.`,y(t,a.name));continue}r[a.name]=!0,(0,o.isObjectType)(a)||e.reportError(`Union type ${t.name} can only include Object types, it cannot include ${(0,n.inspect)(a)}.`,y(t,String(a)))}}(e,t):(0,o.isEnumType)(t)?function(e,t){let i=t.getValues();for(let n of(0===i.length&&e.reportError(`Enum type ${t.name} must define one or more values.`,[t.astNode,...t.extensionASTNodes]),i))f(e,n)}(e,t):(0,o.isInputObjectType)(t)&&(function(e,t){let i=Object.values(t.getFields());for(let s of(0===i.length&&e.reportError(`Input Object type ${t.name} must define one or more fields.`,[t.astNode,...t.extensionASTNodes]),i)){var r,a;f(e,s),(0,o.isInputType)(s.type)||e.reportError(`The type of ${t.name}.${s.name} must be Input Type but got: ${(0,n.inspect)(s.type)}.`,null==(r=s.astNode)?void 0:r.type),(0,o.isRequiredInputField)(s)&&null!=s.deprecationReason&&e.reportError(`Required input field ${t.name}.${s.name} cannot be deprecated.`,[v(s.astNode),null==(a=s.astNode)?void 0:a.type]),t.isOneOf&&function(e,t,i){if((0,o.isNonNullType)(t.type)){var n;i.reportError(`OneOf input field ${e.name}.${t.name} must be nullable.`,null==(n=t.astNode)?void 0:n.type)}void 0!==t.defaultValue&&i.reportError(`OneOf input field ${e.name}.${t.name} cannot have a default value.`,t.astNode)}(t,s,e)}}(e,t),l(t))}}(I);let b=I.getErrors();return e.__validationErrors=b,b}class p{constructor(e){this._errors=[],this.schema=e}reportError(e,t){let i=Array.isArray(t)?t.filter(Boolean):t;this._errors.push(new r.GraphQLError(e,{nodes:i}))}getErrors(){return this._errors}}function h(e,t){var i;return null==(i=[e.astNode,...e.extensionASTNodes].flatMap(e=>{var t;return null!=(t=null==e?void 0:e.operationTypes)?t:[]}).find(e=>e.operation===t))?void 0:i.type}function f(e,t){t.name.startsWith("__")&&e.reportError(`Name "${t.name}" must not begin with "__", which is reserved by GraphQL introspection.`,t.astNode)}function m(e,t){let{astNode:i,extensionASTNodes:n}=e;return(null!=i?[i,...n]:n).flatMap(e=>{var t;return null!=(t=e.interfaces)?t:[]}).filter(e=>e.name.value===t.name)}function y(e,t){let{astNode:i,extensionASTNodes:n}=e;return(null!=i?[i,...n]:n).flatMap(e=>{var t;return null!=(t=e.types)?t:[]}).filter(e=>e.name.value===t)}function v(e){var t;return null==e||null==(t=e.directives)?void 0:t.find(e=>e.name.value===l.GraphQLDeprecatedDirective.name)}},653704,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.typeFromAST=function e(t,i){switch(i.kind){case n.Kind.LIST_TYPE:{let n=e(t,i.type);return n&&new r.GraphQLList(n)}case n.Kind.NON_NULL_TYPE:{let n=e(t,i.type);return n&&new r.GraphQLNonNull(n)}case n.Kind.NAMED_TYPE:return t.getType(i.name.value)}};var n=e.r(199311),r=e.r(211325)},928241,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.TypeInfo=void 0,i.visitWithTypeInfo=function(e,t){return{enter(...i){let r=i[0];e.enter(r);let s=(0,a.getEnterLeaveForKind)(t,r.kind).enter;if(s){let a=s.apply(t,i);return void 0!==a&&(e.leave(r),(0,n.isNode)(a)&&e.enter(a)),a}},leave(...i){let n,r=i[0],s=(0,a.getEnterLeaveForKind)(t,r.kind).leave;return s&&(n=s.apply(t,i)),e.leave(r),n}}};var n=e.r(463040),r=e.r(199311),a=e.r(999680),s=e.r(211325),o=e.r(187936),l=e.r(653704);class u{constructor(e,t,i){this._schema=e,this._typeStack=[],this._parentTypeStack=[],this._inputTypeStack=[],this._fieldDefStack=[],this._defaultValueStack=[],this._directive=null,this._argument=null,this._enumValue=null,this._getFieldDef=null!=i?i:c,t&&((0,s.isInputType)(t)&&this._inputTypeStack.push(t),(0,s.isCompositeType)(t)&&this._parentTypeStack.push(t),(0,s.isOutputType)(t)&&this._typeStack.push(t))}get[Symbol.toStringTag](){return"TypeInfo"}getType(){if(this._typeStack.length>0)return this._typeStack[this._typeStack.length-1]}getParentType(){if(this._parentTypeStack.length>0)return this._parentTypeStack[this._parentTypeStack.length-1]}getInputType(){if(this._inputTypeStack.length>0)return this._inputTypeStack[this._inputTypeStack.length-1]}getParentInputType(){if(this._inputTypeStack.length>1)return this._inputTypeStack[this._inputTypeStack.length-2]}getFieldDef(){if(this._fieldDefStack.length>0)return this._fieldDefStack[this._fieldDefStack.length-1]}getDefaultValue(){if(this._defaultValueStack.length>0)return this._defaultValueStack[this._defaultValueStack.length-1]}getDirective(){return this._directive}getArgument(){return this._argument}getEnumValue(){return this._enumValue}enter(e){let t=this._schema;switch(e.kind){case r.Kind.SELECTION_SET:{let e=(0,s.getNamedType)(this.getType());this._parentTypeStack.push((0,s.isCompositeType)(e)?e:void 0);break}case r.Kind.FIELD:{let i,n,r=this.getParentType();r&&(i=this._getFieldDef(t,r,e))&&(n=i.type),this._fieldDefStack.push(i),this._typeStack.push((0,s.isOutputType)(n)?n:void 0);break}case r.Kind.DIRECTIVE:this._directive=t.getDirective(e.name.value);break;case r.Kind.OPERATION_DEFINITION:{let i=t.getRootType(e.operation);this._typeStack.push((0,s.isObjectType)(i)?i:void 0);break}case r.Kind.INLINE_FRAGMENT:case r.Kind.FRAGMENT_DEFINITION:{let i=e.typeCondition,n=i?(0,l.typeFromAST)(t,i):(0,s.getNamedType)(this.getType());this._typeStack.push((0,s.isOutputType)(n)?n:void 0);break}case r.Kind.VARIABLE_DEFINITION:{let i=(0,l.typeFromAST)(t,e.type);this._inputTypeStack.push((0,s.isInputType)(i)?i:void 0);break}case r.Kind.ARGUMENT:{var i;let t,n,r=null!=(i=this.getDirective())?i:this.getFieldDef();r&&(t=r.args.find(t=>t.name===e.name.value))&&(n=t.type),this._argument=t,this._defaultValueStack.push(t?t.defaultValue:void 0),this._inputTypeStack.push((0,s.isInputType)(n)?n:void 0);break}case r.Kind.LIST:{let e=(0,s.getNullableType)(this.getInputType()),t=(0,s.isListType)(e)?e.ofType:e;this._defaultValueStack.push(void 0),this._inputTypeStack.push((0,s.isInputType)(t)?t:void 0);break}case r.Kind.OBJECT_FIELD:{let t,i,n=(0,s.getNamedType)(this.getInputType());(0,s.isInputObjectType)(n)&&(i=n.getFields()[e.name.value])&&(t=i.type),this._defaultValueStack.push(i?i.defaultValue:void 0),this._inputTypeStack.push((0,s.isInputType)(t)?t:void 0);break}case r.Kind.ENUM:{let t,i=(0,s.getNamedType)(this.getInputType());(0,s.isEnumType)(i)&&(t=i.getValue(e.value)),this._enumValue=t}}}leave(e){switch(e.kind){case r.Kind.SELECTION_SET:this._parentTypeStack.pop();break;case r.Kind.FIELD:this._fieldDefStack.pop(),this._typeStack.pop();break;case r.Kind.DIRECTIVE:this._directive=null;break;case r.Kind.OPERATION_DEFINITION:case r.Kind.INLINE_FRAGMENT:case r.Kind.FRAGMENT_DEFINITION:this._typeStack.pop();break;case r.Kind.VARIABLE_DEFINITION:this._inputTypeStack.pop();break;case r.Kind.ARGUMENT:this._argument=null,this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case r.Kind.LIST:case r.Kind.OBJECT_FIELD:this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case r.Kind.ENUM:this._enumValue=null}}}function c(e,t,i){let n=i.name.value;return n===o.SchemaMetaFieldDef.name&&e.getQueryType()===t?o.SchemaMetaFieldDef:n===o.TypeMetaFieldDef.name&&e.getQueryType()===t?o.TypeMetaFieldDef:n===o.TypeNameMetaFieldDef.name&&(0,s.isCompositeType)(t)?o.TypeNameMetaFieldDef:(0,s.isObjectType)(t)||(0,s.isInterfaceType)(t)?t.getFields()[n]:void 0}i.TypeInfo=u},940674,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.isConstValueNode=function e(t){return a(t)&&(t.kind===n.Kind.LIST?t.values.some(e):t.kind===n.Kind.OBJECT?t.fields.some(t=>e(t.value)):t.kind!==n.Kind.VARIABLE)},i.isDefinitionNode=function(e){return r(e)||s(e)||l(e)},i.isExecutableDefinitionNode=r,i.isSchemaCoordinateNode=function(e){return e.kind===n.Kind.TYPE_COORDINATE||e.kind===n.Kind.MEMBER_COORDINATE||e.kind===n.Kind.ARGUMENT_COORDINATE||e.kind===n.Kind.DIRECTIVE_COORDINATE||e.kind===n.Kind.DIRECTIVE_ARGUMENT_COORDINATE},i.isSelectionNode=function(e){return e.kind===n.Kind.FIELD||e.kind===n.Kind.FRAGMENT_SPREAD||e.kind===n.Kind.INLINE_FRAGMENT},i.isTypeDefinitionNode=o,i.isTypeExtensionNode=u,i.isTypeNode=function(e){return e.kind===n.Kind.NAMED_TYPE||e.kind===n.Kind.LIST_TYPE||e.kind===n.Kind.NON_NULL_TYPE},i.isTypeSystemDefinitionNode=s,i.isTypeSystemExtensionNode=l,i.isValueNode=a;var n=e.r(199311);function r(e){return e.kind===n.Kind.OPERATION_DEFINITION||e.kind===n.Kind.FRAGMENT_DEFINITION}function a(e){return e.kind===n.Kind.VARIABLE||e.kind===n.Kind.INT||e.kind===n.Kind.FLOAT||e.kind===n.Kind.STRING||e.kind===n.Kind.BOOLEAN||e.kind===n.Kind.NULL||e.kind===n.Kind.ENUM||e.kind===n.Kind.LIST||e.kind===n.Kind.OBJECT}function s(e){return e.kind===n.Kind.SCHEMA_DEFINITION||o(e)||e.kind===n.Kind.DIRECTIVE_DEFINITION}function o(e){return e.kind===n.Kind.SCALAR_TYPE_DEFINITION||e.kind===n.Kind.OBJECT_TYPE_DEFINITION||e.kind===n.Kind.INTERFACE_TYPE_DEFINITION||e.kind===n.Kind.UNION_TYPE_DEFINITION||e.kind===n.Kind.ENUM_TYPE_DEFINITION||e.kind===n.Kind.INPUT_OBJECT_TYPE_DEFINITION}function l(e){return e.kind===n.Kind.SCHEMA_EXTENSION||e.kind===n.Kind.DIRECTIVE_EXTENSION||u(e)}function u(e){return e.kind===n.Kind.SCALAR_TYPE_EXTENSION||e.kind===n.Kind.OBJECT_TYPE_EXTENSION||e.kind===n.Kind.INTERFACE_TYPE_EXTENSION||e.kind===n.Kind.UNION_TYPE_EXTENSION||e.kind===n.Kind.ENUM_TYPE_EXTENSION||e.kind===n.Kind.INPUT_OBJECT_TYPE_EXTENSION}},619559,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.ExecutableDefinitionsRule=function(e){return{Document(t){for(let i of t.definitions)if(!(0,a.isExecutableDefinitionNode)(i)){let t=i.kind===r.Kind.SCHEMA_DEFINITION||i.kind===r.Kind.SCHEMA_EXTENSION?"schema":'"'+i.name.value+'"';e.reportError(new n.GraphQLError(`The ${t} definition is not executable.`,{nodes:i}))}return!1}}};var n=e.r(294943),r=e.r(199311),a=e.r(940674)},146560,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.FieldsOnCorrectTypeRule=function(e){return{Field(t){let i=e.getParentType();if(i&&!e.getFieldDef()){let l=e.getSchema(),u=t.name.value,c=(0,n.didYouMean)("to use an inline fragment on",function(e,t,i){if(!(0,o.isAbstractType)(t))return[];let n=new Set,a=Object.create(null);for(let r of e.getPossibleTypes(t))if(r.getFields()[i])for(let e of(n.add(r),a[r.name]=1,r.getInterfaces())){var s;e.getFields()[i]&&(n.add(e),a[e.name]=(null!=(s=a[e.name])?s:0)+1)}return[...n].sort((t,i)=>{let n=a[i.name]-a[t.name];return 0!==n?n:(0,o.isInterfaceType)(t)&&e.isSubType(t,i)?-1:(0,o.isInterfaceType)(i)&&e.isSubType(i,t)?1:(0,r.naturalCompare)(t.name,i.name)}).map(e=>e.name)}(l,i,u));""===c&&(c=(0,n.didYouMean)(function(e,t){if((0,o.isObjectType)(e)||(0,o.isInterfaceType)(e)){let i=Object.keys(e.getFields());return(0,a.suggestionList)(t,i)}return[]}(i,u))),e.reportError(new s.GraphQLError(`Cannot query field "${u}" on type "${i.name}".`+c,{nodes:t}))}}}};var n=e.r(996650),r=e.r(216251),a=e.r(529364),s=e.r(294943),o=e.r(211325)},610156,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.FragmentsOnCompositeTypesRule=function(e){return{InlineFragment(t){let i=t.typeCondition;if(i){let t=(0,s.typeFromAST)(e.getSchema(),i);if(t&&!(0,a.isCompositeType)(t)){let t=(0,r.print)(i);e.reportError(new n.GraphQLError(`Fragment cannot condition on non composite type "${t}".`,{nodes:i}))}}},FragmentDefinition(t){let i=(0,s.typeFromAST)(e.getSchema(),t.typeCondition);if(i&&!(0,a.isCompositeType)(i)){let i=(0,r.print)(t.typeCondition);e.reportError(new n.GraphQLError(`Fragment "${t.name.value}" cannot condition on non composite type "${i}".`,{nodes:t.typeCondition}))}}}};var n=e.r(294943),r=e.r(340647),a=e.r(211325),s=e.r(653704)},111080,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.KnownArgumentNamesOnDirectivesRule=l,i.KnownArgumentNamesRule=function(e){return{...l(e),Argument(t){let i=e.getArgument(),s=e.getFieldDef(),o=e.getParentType();if(!i&&s&&o){let i=t.name.value,l=s.args.map(e=>e.name),u=(0,r.suggestionList)(i,l);e.reportError(new a.GraphQLError(`Unknown argument "${i}" on field "${o.name}.${s.name}".`+(0,n.didYouMean)(u),{nodes:t}))}}}};var n=e.r(996650),r=e.r(529364),a=e.r(294943),s=e.r(199311),o=e.r(336081);function l(e){let t=Object.create(null),i=e.getSchema();for(let e of i?i.getDirectives():o.specifiedDirectives)t[e.name]=e.args.map(e=>e.name);for(let i of e.getDocument().definitions)if(i.kind===s.Kind.DIRECTIVE_DEFINITION){var l;let e=null!=(l=i.arguments)?l:[];t[i.name.value]=e.map(e=>e.name.value)}return{Directive(i){let s=i.name.value,o=t[s];if(i.arguments&&o)for(let t of i.arguments){let i=t.name.value;if(!o.includes(i)){let l=(0,r.suggestionList)(i,o);e.reportError(new a.GraphQLError(`Unknown argument "${i}" on directive "@${s}".`+(0,n.didYouMean)(l),{nodes:t}))}}return!1}}}},820345,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.KnownDirectivesRule=function(e){let t=Object.create(null),i=e.getSchema();for(let e of i?i.getDirectives():u.specifiedDirectives)t[e.name]=e.locations;for(let i of e.getDocument().definitions)i.kind===l.Kind.DIRECTIVE_DEFINITION&&(t[i.name.value]=i.locations.map(e=>e.value));return{Directive(i,u,c,d,p){let h=i.name.value,f=t[h];if(!f)return void e.reportError(new a.GraphQLError(`Unknown directive "@${h}".`,{nodes:i}));let m=function(e){let t=e[e.length-1];switch("kind"in t||(0,r.invariant)(!1),t.kind){case l.Kind.OPERATION_DEFINITION:var i=t.operation;switch(i){case s.OperationTypeNode.QUERY:return o.DirectiveLocation.QUERY;case s.OperationTypeNode.MUTATION:return o.DirectiveLocation.MUTATION;case s.OperationTypeNode.SUBSCRIPTION:return o.DirectiveLocation.SUBSCRIPTION}return;case l.Kind.FIELD:return o.DirectiveLocation.FIELD;case l.Kind.FRAGMENT_SPREAD:return o.DirectiveLocation.FRAGMENT_SPREAD;case l.Kind.INLINE_FRAGMENT:return o.DirectiveLocation.INLINE_FRAGMENT;case l.Kind.FRAGMENT_DEFINITION:return o.DirectiveLocation.FRAGMENT_DEFINITION;case l.Kind.VARIABLE_DEFINITION:return o.DirectiveLocation.VARIABLE_DEFINITION;case l.Kind.SCHEMA_DEFINITION:case l.Kind.SCHEMA_EXTENSION:return o.DirectiveLocation.SCHEMA;case l.Kind.SCALAR_TYPE_DEFINITION:case l.Kind.SCALAR_TYPE_EXTENSION:return o.DirectiveLocation.SCALAR;case l.Kind.OBJECT_TYPE_DEFINITION:case l.Kind.OBJECT_TYPE_EXTENSION:return o.DirectiveLocation.OBJECT;case l.Kind.FIELD_DEFINITION:return o.DirectiveLocation.FIELD_DEFINITION;case l.Kind.INTERFACE_TYPE_DEFINITION:case l.Kind.INTERFACE_TYPE_EXTENSION:return o.DirectiveLocation.INTERFACE;case l.Kind.UNION_TYPE_DEFINITION:case l.Kind.UNION_TYPE_EXTENSION:return o.DirectiveLocation.UNION;case l.Kind.ENUM_TYPE_DEFINITION:case l.Kind.ENUM_TYPE_EXTENSION:return o.DirectiveLocation.ENUM;case l.Kind.ENUM_VALUE_DEFINITION:return o.DirectiveLocation.ENUM_VALUE;case l.Kind.INPUT_OBJECT_TYPE_DEFINITION:case l.Kind.INPUT_OBJECT_TYPE_EXTENSION:return o.DirectiveLocation.INPUT_OBJECT;case l.Kind.INPUT_VALUE_DEFINITION:{let t=e[e.length-3];return"kind"in t||(0,r.invariant)(!1),t.kind===l.Kind.INPUT_OBJECT_TYPE_DEFINITION?o.DirectiveLocation.INPUT_FIELD_DEFINITION:o.DirectiveLocation.ARGUMENT_DEFINITION}case l.Kind.DIRECTIVE_DEFINITION:case l.Kind.DIRECTIVE_EXTENSION:return o.DirectiveLocation.DIRECTIVE_DEFINITION;default:(0,r.invariant)(!1,"Unexpected kind: "+(0,n.inspect)(t.kind))}}(p);m&&!f.includes(m)&&e.reportError(new a.GraphQLError(`Directive "@${h}" may not be used on ${m}.`,{nodes:i}))}}};var n=e.r(818123),r=e.r(119588),a=e.r(294943),s=e.r(463040),o=e.r(142478),l=e.r(199311),u=e.r(336081)},432098,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.KnownFragmentNamesRule=function(e){return{FragmentSpread(t){let i=t.name.value;e.getFragment(i)||e.reportError(new n.GraphQLError(`Unknown fragment "${i}".`,{nodes:t.name}))}}};var n=e.r(294943)},141097,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.KnownTypeNamesRule=function(e){let t=e.getSchema(),i=t?t.getTypeMap():Object.create(null),o=Object.create(null);for(let t of e.getDocument().definitions)(0,s.isTypeDefinitionNode)(t)&&(o[t.name.value]=!0);let u=[...Object.keys(i),...Object.keys(o)];return{NamedType(t,c,d,p,h){let f=t.name.value;if(!i[f]&&!o[f]){var m,y;let i=null!=(m=h[2])?m:d,o=null!=i&&"kind"in(y=i)&&((0,s.isTypeSystemDefinitionNode)(y)||(0,s.isTypeSystemExtensionNode)(y));if(o&&l.includes(f))return;let c=(0,r.suggestionList)(f,o?l.concat(u):u);e.reportError(new a.GraphQLError(`Unknown type "${f}".`+(0,n.didYouMean)(c),{nodes:t}))}}}};var n=e.r(996650),r=e.r(529364),a=e.r(294943),s=e.r(940674),o=e.r(187936);let l=[...e.r(947129).specifiedScalarTypes,...o.introspectionTypes].map(e=>e.name)},336446,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.LoneAnonymousOperationRule=function(e){let t=0;return{Document(e){t=e.definitions.filter(e=>e.kind===r.Kind.OPERATION_DEFINITION).length},OperationDefinition(i){!i.name&&t>1&&e.reportError(new n.GraphQLError("This anonymous operation must be the only defined operation.",{nodes:i}))}}};var n=e.r(294943),r=e.r(199311)},893600,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.LoneSchemaDefinitionRule=function(e){var t,i,r;let a=e.getSchema(),s=null!=(t=null!=(i=null!=(r=null==a?void 0:a.astNode)?r:null==a?void 0:a.getQueryType())?i:null==a?void 0:a.getMutationType())?t:null==a?void 0:a.getSubscriptionType(),o=0;return{SchemaDefinition(t){s?e.reportError(new n.GraphQLError("Cannot define a new schema within a schema extension.",{nodes:t})):(o>0&&e.reportError(new n.GraphQLError("Must provide only one schema definition.",{nodes:t})),++o)}}};var n=e.r(294943)},100876,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.MaxIntrospectionDepthRule=function(e){return{Field(t){if(("__schema"===t.name.value||"__type"===t.name.value)&&function t(i,n=Object.create(null),a=0){if(i.kind===r.Kind.FRAGMENT_SPREAD){let r=i.name.value;if(!0===n[r])return!1;let s=e.getFragment(r);if(!s)return!1;try{return n[r]=!0,t(s,n,a)}finally{n[r]=void 0}}if(i.kind===r.Kind.FIELD&&("fields"===i.name.value||"interfaces"===i.name.value||"possibleTypes"===i.name.value||"inputFields"===i.name.value)&&++a>=3)return!0;if("selectionSet"in i&&i.selectionSet){for(let e of i.selectionSet.selections)if(t(e,n,a))return!0}return!1}(t))return e.reportError(new n.GraphQLError("Maximum introspection depth exceeded",{nodes:[t]})),!1}}};var n=e.r(294943),r=e.r(199311)},74344,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.NoFragmentCyclesRule=function(e){let t=Object.create(null),i=[],r=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition:a=>((function a(s){if(t[s.name.value])return;let o=s.name.value;t[o]=!0;let l=e.getFragmentSpreads(s.selectionSet);if(0!==l.length){for(let t of(r[o]=i.length,l)){let s=t.name.value,o=r[s];if(i.push(t),void 0===o){let t=e.getFragment(s);t&&a(t)}else{let t=i.slice(o),r=t.slice(0,-1).map(e=>'"'+e.name.value+'"').join(", ");e.reportError(new n.GraphQLError(`Cannot spread fragment "${s}" within itself`+(""!==r?` via ${r}.`:"."),{nodes:t}))}i.pop()}r[o]=void 0}})(a),!1)}};var n=e.r(294943)},166380,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.NoUndefinedVariablesRule=function(e){let t=Object.create(null);return{OperationDefinition:{enter(){t=Object.create(null)},leave(i){for(let{node:r}of e.getRecursiveVariableUsages(i)){let a=r.name.value;!0!==t[a]&&e.reportError(new n.GraphQLError(i.name?`Variable "$${a}" is not defined by operation "${i.name.value}".`:`Variable "$${a}" is not defined.`,{nodes:[r,i]}))}}},VariableDefinition(e){t[e.variable.name.value]=!0}}};var n=e.r(294943)},608150,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.NoUnusedFragmentsRule=function(e){let t=[],i=[];return{OperationDefinition:e=>(t.push(e),!1),FragmentDefinition:e=>(i.push(e),!1),Document:{leave(){let r=Object.create(null);for(let i of t)for(let t of e.getRecursivelyReferencedFragments(i))r[t.name.value]=!0;for(let t of i){let i=t.name.value;!0!==r[i]&&e.reportError(new n.GraphQLError(`Fragment "${i}" is never used.`,{nodes:t}))}}}}};var n=e.r(294943)},528651,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.NoUnusedVariablesRule=function(e){let t=[];return{OperationDefinition:{enter(){t=[]},leave(i){let r=Object.create(null);for(let{node:t}of e.getRecursiveVariableUsages(i))r[t.name.value]=!0;for(let a of t){let t=a.variable.name.value;!0!==r[t]&&e.reportError(new n.GraphQLError(i.name?`Variable "$${t}" is never used in operation "${i.name.value}".`:`Variable "$${t}" is never used.`,{nodes:a}))}}},VariableDefinition(e){t.push(e)}}};var n=e.r(294943)},393939,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.sortValueNode=function e(t){switch(t.kind){case r.Kind.OBJECT:return{...t,fields:t.fields.map(t=>({...t,value:e(t.value)})).sort((e,t)=>(0,n.naturalCompare)(e.name.value,t.name.value))};case r.Kind.LIST:return{...t,values:t.values.map(e)};case r.Kind.INT:case r.Kind.FLOAT:case r.Kind.STRING:case r.Kind.BOOLEAN:case r.Kind.NULL:case r.Kind.ENUM:case r.Kind.VARIABLE:return t}};var n=e.r(216251),r=e.r(199311)},581577,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.OverlappingFieldsCanBeMergedRule=function(e){let t=new v,i=new g,n=new Map;return{SelectionSet(a){for(let[[s,o],l,u]of function(e,t,i,n,r,a){let s=[],[o,l]=m(e,t,r,a);if(function(e,t,i,n,r,a){for(let[s,o]of Object.entries(a))if(o.length>1)for(let a=0;a<o.length;a++)for(let l=a+1;l<o.length;l++){let u=h(e,i,n,r,!1,s,o[a],o[l]);u&&t.push(u)}}(e,s,t,i,n,o),0!==l.length)for(let r=0;r<l.length;r++){c(e,s,t,i,n,!1,o,l[r]);for(let a=r+1;a<l.length;a++)d(e,s,t,i,n,!1,l[r],l[a])}return s}(e,n,t,i,e.getParentType(),a)){let t=function e(t){return Array.isArray(t)?t.map(([t,i])=>`subfields "${t}" conflict because `+e(i)).join(" and "):t}(o);e.reportError(new r.GraphQLError(`Fields "${s}" conflict because ${t}. Use different aliases on the fields to fetch both if this was intentional.`,{nodes:l.concat(u)}))}}}};var n=e.r(818123),r=e.r(294943),a=e.r(199311),s=e.r(340647),o=e.r(211325),l=e.r(393939),u=e.r(653704);function c(e,t,i,n,r,a,s,o){if(n.has(s,o,a))return;n.add(s,o,a);let l=e.getFragment(o);if(!l)return;let[u,d]=y(e,i,l);if(s!==u)for(let o of(p(e,t,i,n,r,a,s,u),d))c(e,t,i,n,r,a,s,o)}function d(e,t,i,n,r,a,s,o){if(s===o||r.has(s,o,a))return;r.add(s,o,a);let l=e.getFragment(s),u=e.getFragment(o);if(!l||!u)return;let[c,h]=y(e,i,l),[f,m]=y(e,i,u);for(let o of(p(e,t,i,n,r,a,c,f),m))d(e,t,i,n,r,a,s,o);for(let s of h)d(e,t,i,n,r,a,s,o)}function p(e,t,i,n,r,a,s,o){for(let[l,u]of Object.entries(s)){let s=o[l];if(s)for(let o of u)for(let u of s){let s=h(e,i,n,r,a,l,o,u);s&&t.push(s)}}}function h(e,t,i,r,a,s,l,u){let[h,y,v]=l,[g,T,S]=u,E=a||h!==g&&(0,o.isObjectType)(h)&&(0,o.isObjectType)(g);if(!E){let e=y.name.value,t=T.name.value;if(e!==t)return[[s,`"${e}" and "${t}" are different fields`],[y],[T]];if(!function(e,t){let i=e.arguments,n=t.arguments;if(void 0===i||0===i.length)return void 0===n||0===n.length;if(void 0===n||0===n.length||i.length!==n.length)return!1;let r=new Map(n.map(({name:e,value:t})=>[e.value,t]));return i.every(e=>{let t=e.value,i=r.get(e.name.value);return void 0!==i&&f(t)===f(i)})}(y,T))return[[s,"they have differing arguments"],[y],[T]]}let I=null==v?void 0:v.type,b=null==S?void 0:S.type;if(I&&b&&function e(t,i){return(0,o.isListType)(t)?!(0,o.isListType)(i)||e(t.ofType,i.ofType):!!(0,o.isListType)(i)||((0,o.isNonNullType)(t)?!(0,o.isNonNullType)(i)||e(t.ofType,i.ofType):!!(0,o.isNonNullType)(i)||!!((0,o.isLeafType)(t)||(0,o.isLeafType)(i))&&t!==i)}(I,b))return[[s,`they return conflicting types "${(0,n.inspect)(I)}" and "${(0,n.inspect)(b)}"`],[y],[T]];let N=y.selectionSet,_=T.selectionSet;if(N&&_){var D=function(e,t,i,n,r,a,s,o,l){let u=[],[h,f]=m(e,t,a,s),[y,v]=m(e,t,o,l);for(let a of(p(e,u,t,i,n,r,h,y),v))c(e,u,t,i,n,r,h,a);for(let a of f)c(e,u,t,i,n,r,y,a);for(let a of f)for(let s of v)d(e,u,t,i,n,r,a,s);return u}(e,t,i,r,E,(0,o.getNamedType)(I),N,(0,o.getNamedType)(b),_),A=s,O=y,R=T;return D.length>0?[[A,D.map(([e])=>e)],[O,...D.map(([,e])=>e).flat()],[R,...D.map(([,,e])=>e).flat()]]:void 0}}function f(e){return(0,s.print)((0,l.sortValueNode)(e))}function m(e,t,i,n){let r=t.get(n);if(r)return r;let s=Object.create(null),l=Object.create(null);!function e(t,i,n,r,s){for(let l of n.selections)switch(l.kind){case a.Kind.FIELD:{let e,t=l.name.value;((0,o.isObjectType)(i)||(0,o.isInterfaceType)(i))&&(e=i.getFields()[t]);let n=l.alias?l.alias.value:t;r[n]||(r[n]=[]),r[n].push([i,l,e]);break}case a.Kind.FRAGMENT_SPREAD:s[l.name.value]=!0;break;case a.Kind.INLINE_FRAGMENT:{let n=l.typeCondition,a=n?(0,u.typeFromAST)(t.getSchema(),n):i;e(t,a,l.selectionSet,r,s)}}}(e,i,n,s,l);let c=[s,Object.keys(l)];return t.set(n,c),c}function y(e,t,i){let n=t.get(i.selectionSet);if(n)return n;let r=(0,u.typeFromAST)(e.getSchema(),i.typeCondition);return m(e,t,r,i.selectionSet)}class v{constructor(){this._data=new Map}has(e,t,i){var n;let r=null==(n=this._data.get(e))?void 0:n.get(t);return void 0!==r&&(!!i||i===r)}add(e,t,i){let n=this._data.get(e);void 0===n?this._data.set(e,new Map([[t,i]])):n.set(t,i)}}class g{constructor(){this._orderedPairSet=new v}has(e,t,i){return e<t?this._orderedPairSet.has(e,t,i):this._orderedPairSet.has(t,e,i)}add(e,t,i){e<t?this._orderedPairSet.add(e,t,i):this._orderedPairSet.add(t,e,i)}}},8879,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.PossibleFragmentSpreadsRule=function(e){return{InlineFragment(t){let i=e.getType(),o=e.getParentType();if((0,a.isCompositeType)(i)&&(0,a.isCompositeType)(o)&&!(0,s.doTypesOverlap)(e.getSchema(),i,o)){let a=(0,n.inspect)(o),s=(0,n.inspect)(i);e.reportError(new r.GraphQLError(`Fragment cannot be spread here as objects of type "${a}" can never be of type "${s}".`,{nodes:t}))}},FragmentSpread(t){let i=t.name.value,l=function(e,t){let i=e.getFragment(t);if(i){let t=(0,o.typeFromAST)(e.getSchema(),i.typeCondition);if((0,a.isCompositeType)(t))return t}}(e,i),u=e.getParentType();if(l&&u&&!(0,s.doTypesOverlap)(e.getSchema(),l,u)){let a=(0,n.inspect)(u),s=(0,n.inspect)(l);e.reportError(new r.GraphQLError(`Fragment "${i}" cannot be spread here as objects of type "${a}" can never be of type "${s}".`,{nodes:t}))}}}};var n=e.r(818123),r=e.r(294943),a=e.r(211325),s=e.r(957861),o=e.r(653704)},258511,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.PossibleTypeExtensionsRule=function(e){let t=e.getSchema(),i=Object.create(null);for(let t of e.getDocument().definitions)(0,u.isTypeDefinitionNode)(t)&&(i[t.name.value]=t);return{ScalarTypeExtension:p,ObjectTypeExtension:p,InterfaceTypeExtension:p,UnionTypeExtension:p,EnumTypeExtension:p,InputObjectTypeExtension:p};function p(u){var p;let h,f=u.name.value,m=i[f],y=null==t?void 0:t.getType(f);if(m?h=d[m.kind]:y&&(p=y,h=(0,c.isScalarType)(p)?l.Kind.SCALAR_TYPE_EXTENSION:(0,c.isObjectType)(p)?l.Kind.OBJECT_TYPE_EXTENSION:(0,c.isInterfaceType)(p)?l.Kind.INTERFACE_TYPE_EXTENSION:(0,c.isUnionType)(p)?l.Kind.UNION_TYPE_EXTENSION:(0,c.isEnumType)(p)?l.Kind.ENUM_TYPE_EXTENSION:(0,c.isInputObjectType)(p)?l.Kind.INPUT_OBJECT_TYPE_EXTENSION:void(0,a.invariant)(!1,"Unexpected type: "+(0,r.inspect)(p))),h){if(h!==u.kind){let t=function(e){switch(e){case l.Kind.SCALAR_TYPE_EXTENSION:return"scalar";case l.Kind.OBJECT_TYPE_EXTENSION:return"object";case l.Kind.INTERFACE_TYPE_EXTENSION:return"interface";case l.Kind.UNION_TYPE_EXTENSION:return"union";case l.Kind.ENUM_TYPE_EXTENSION:return"enum";case l.Kind.INPUT_OBJECT_TYPE_EXTENSION:return"input object";default:(0,a.invariant)(!1,"Unexpected kind: "+(0,r.inspect)(e))}}(u.kind);e.reportError(new o.GraphQLError(`Cannot extend non-${t} type "${f}".`,{nodes:m?[m,u]:u}))}}else{let r=Object.keys({...i,...null==t?void 0:t.getTypeMap()}),a=(0,s.suggestionList)(f,r);e.reportError(new o.GraphQLError(`Cannot extend type "${f}" because it is not defined.`+(0,n.didYouMean)(a),{nodes:u.name}))}}};var n=e.r(996650),r=e.r(818123),a=e.r(119588),s=e.r(529364),o=e.r(294943),l=e.r(199311),u=e.r(940674),c=e.r(211325);let d={[l.Kind.SCALAR_TYPE_DEFINITION]:l.Kind.SCALAR_TYPE_EXTENSION,[l.Kind.OBJECT_TYPE_DEFINITION]:l.Kind.OBJECT_TYPE_EXTENSION,[l.Kind.INTERFACE_TYPE_DEFINITION]:l.Kind.INTERFACE_TYPE_EXTENSION,[l.Kind.UNION_TYPE_DEFINITION]:l.Kind.UNION_TYPE_EXTENSION,[l.Kind.ENUM_TYPE_DEFINITION]:l.Kind.ENUM_TYPE_EXTENSION,[l.Kind.INPUT_OBJECT_TYPE_DEFINITION]:l.Kind.INPUT_OBJECT_TYPE_EXTENSION}},818671,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.ProvidedRequiredArgumentsOnDirectivesRule=c,i.ProvidedRequiredArgumentsRule=function(e){return{...c(e),Field:{leave(t){var i;let r=e.getFieldDef();if(!r)return!1;let s=new Set(null==(i=t.arguments)?void 0:i.map(e=>e.name.value));for(let i of r.args)if(!s.has(i.name)&&(0,l.isRequiredArgument)(i)){let s=(0,n.inspect)(i.type);e.reportError(new a.GraphQLError(`Field "${r.name}" argument "${i.name}" of type "${s}" is required, but it was not provided.`,{nodes:t}))}}}}};var n=e.r(818123),r=e.r(117921),a=e.r(294943),s=e.r(199311),o=e.r(340647),l=e.r(211325),u=e.r(336081);function c(e){var t,i;let c=Object.create(null),p=e.getSchema();for(let e of null!=(t=null==p?void 0:p.getDirectives())?t:u.specifiedDirectives)c[e.name]=(0,r.keyMap)(e.args.filter(l.isRequiredArgument),e=>e.name);for(let t of e.getDocument().definitions)if(t.kind===s.Kind.DIRECTIVE_DEFINITION){let e=null!=(i=t.arguments)?i:[];c[t.name.value]=(0,r.keyMap)(e.filter(d),e=>e.name.value)}return{Directive:{leave(t){let i=t.name.value,r=c[i];if(r){var s;let u=new Set((null!=(s=t.arguments)?s:[]).map(e=>e.name.value));for(let[s,c]of Object.entries(r))if(!u.has(s)){let r=(0,l.isType)(c.type)?(0,n.inspect)(c.type):(0,o.print)(c.type);e.reportError(new a.GraphQLError(`Directive "@${i}" argument "${s}" of type "${r}" is required, but it was not provided.`,{nodes:t}))}}}}}}function d(e){return e.type.kind===s.Kind.NON_NULL_TYPE&&null==e.defaultValue}},12773,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.ScalarLeafsRule=function(e){return{Field(t){let i=e.getType(),s=t.selectionSet;if(i)if((0,a.isLeafType)((0,a.getNamedType)(i))){if(s){let a=t.name.value,o=(0,n.inspect)(i);e.reportError(new r.GraphQLError(`Field "${a}" must not have a selection since type "${o}" has no subfields.`,{nodes:s}))}}else if(s){if(0===s.selections.length){let a=t.name.value,s=(0,n.inspect)(i);e.reportError(new r.GraphQLError(`Field "${a}" of type "${s}" must have at least one field selected.`,{nodes:t}))}}else{let a=t.name.value,s=(0,n.inspect)(i);e.reportError(new r.GraphQLError(`Field "${a}" of type "${s}" must have a selection of subfields. Did you mean "${a} { ... }"?`,{nodes:t}))}}}};var n=e.r(818123),r=e.r(294943),a=e.r(211325)},236745,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.printPathArray=function(e){return e.map(e=>"number"==typeof e?"["+e.toString()+"]":"."+e).join("")}},687008,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.addPath=function(e,t,i){return{prev:e,key:t,typename:i}},i.pathToArray=function(e){let t=[],i=e;for(;i;)t.push(i.key),i=i.prev;return t.reverse()}},291752,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.coerceInputValue=function(e,t,i=h){return function e(t,i,u,h){if((0,p.isNonNullType)(i))return null!=t?e(t,i.ofType,u,h):void u((0,l.pathToArray)(h),t,new d.GraphQLError(`Expected non-nullable type "${(0,r.inspect)(i)}" not to be null.`));if(null==t)return null;if((0,p.isListType)(i)){let n=i.ofType;return(0,s.isIterableObject)(t)?Array.from(t,(t,i)=>e(t,n,u,(0,l.addPath)(h,i,void 0))):[e(t,n,u,h)]}if((0,p.isInputObjectType)(i)){if(!(0,o.isObjectLike)(t)||Array.isArray(t))return void u((0,l.pathToArray)(h),t,new d.GraphQLError(`Expected type "${i.name}" to be an object.`));let a=Object.create(null),s=i.getFields();for(let n of Object.values(s)){let s=t[n.name];if(void 0===s){if(void 0!==n.defaultValue)a[n.name]=n.defaultValue;else if((0,p.isNonNullType)(n.type)){let e=(0,r.inspect)(n.type);u((0,l.pathToArray)(h),t,new d.GraphQLError(`Field "${n.name}" of required type "${e}" was not provided.`))}continue}a[n.name]=e(s,n.type,u,(0,l.addPath)(h,n.name,i.name))}for(let e of Object.keys(t))if(!s[e]){let r=(0,c.suggestionList)(e,Object.keys(i.getFields()));u((0,l.pathToArray)(h),t,new d.GraphQLError(`Field "${e}" is not defined by type "${i.name}".`+(0,n.didYouMean)(r)))}if(i.isOneOf){let e=Object.keys(a);1!==e.length&&u((0,l.pathToArray)(h),t,new d.GraphQLError(`Exactly one key must be specified for OneOf type "${i.name}".`));let n=e[0],r=a[n];null===r&&u((0,l.pathToArray)(h).concat(n),r,new d.GraphQLError(`Field "${n}" must be non-null.`))}return{...a}}if((0,p.isLeafType)(i)){let e;try{e=i.parseValue(t)}catch(e){e instanceof d.GraphQLError?u((0,l.pathToArray)(h),t,e):u((0,l.pathToArray)(h),t,new d.GraphQLError(`Expected type "${i.name}". `+e.message,{originalError:e}));return}return void 0===e&&u((0,l.pathToArray)(h),t,new d.GraphQLError(`Expected type "${i.name}".`)),e}(0,a.invariant)(!1,"Unexpected input type: "+(0,r.inspect)(i))}(e,t,i,void 0)};var n=e.r(996650),r=e.r(818123),a=e.r(119588),s=e.r(891275),o=e.r(776887),l=e.r(687008),u=e.r(236745),c=e.r(529364),d=e.r(294943),p=e.r(211325);function h(e,t,i){let n="Invalid value "+(0,r.inspect)(t);throw e.length>0&&(n+=` at "value${(0,u.printPathArray)(e)}"`),i.message=n+": "+i.message,i}},674275,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.valueFromAST=function e(t,i,c){if(t){if(t.kind===s.Kind.VARIABLE){let e=t.name.value;if(null==c||void 0===c[e]||!u(c,e))return;let n=c[e];if(null===n&&(0,o.isNonNullType)(i))return;return n}if((0,o.isNonNullType)(i)){if(t.kind===s.Kind.NULL)return;return e(t,i.ofType,c)}if(t.kind===s.Kind.NULL)return null;if((0,o.isListType)(i)){let n=i.ofType;if(t.kind===s.Kind.LIST){let i=[];for(let r of t.values)if(l(r,c)){if((0,o.isNonNullType)(n))return;i.push(null)}else{let t=e(r,n,c);if(void 0===t)return;i.push(t)}return i}let r=e(t,n,c);if(void 0===r)return;return[r]}if((0,o.isInputObjectType)(i)){if(t.kind!==s.Kind.OBJECT)return;let n=Object.create(null),r=(0,a.keyMap)(t.fields,e=>e.name.value);for(let t of Object.values(i.getFields())){let i=r[t.name];if(!i||l(i.value,c)){if(void 0!==t.defaultValue)n[t.name]=t.defaultValue;else if((0,o.isNonNullType)(t.type))return;continue}let a=e(i.value,t.type,c);if(void 0===a)return;n[t.name]=a}if(i.isOneOf){let e=Object.keys(n);if(1!==e.length||null===n[e[0]])return}return n}if((0,o.isLeafType)(i)){let e;try{e=i.parseLiteral(t,c)}catch(e){return}if(void 0===e)return;return e}(0,r.invariant)(!1,"Unexpected input type: "+(0,n.inspect)(i))}};var n=e.r(818123),r=e.r(119588),a=e.r(117921),s=e.r(199311),o=e.r(211325);function l(e,t){return e.kind===s.Kind.VARIABLE&&(null==t||void 0===t[e.name.value]||!u(t,e.name.value))}function u(e,t){return Object.prototype.hasOwnProperty.call(e,t)}},886375,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.getArgumentValues=h,i.getDirectiveValues=function(e,t,i){var n;let r=null==(n=t.directives)?void 0:n.find(t=>t.name.value===e.name);if(r)return h(e,r,i)},i.getVariableValues=function(e,t,i,r){let o=[],h=null==r?void 0:r.maxErrors;try{let r=function(e,t,i,r){let o=Object.create(null);for(let h of t){let t=h.variable.name.value,m=(0,d.typeFromAST)(e,h.type);if(!(0,u.isInputType)(m)){let e=(0,l.print)(h.type);r(new s.GraphQLError(`Variable "$${t}" expected value of type "${e}" which cannot be used as an input type.`,{nodes:h.type}));continue}if(!f(i,t)){if(h.defaultValue)o[t]=(0,p.valueFromAST)(h.defaultValue,m);else if((0,u.isNonNullType)(m)){let e=(0,n.inspect)(m);r(new s.GraphQLError(`Variable "$${t}" of required type "${e}" was not provided.`,{nodes:h}))}continue}let y=i[t];if(null===y&&(0,u.isNonNullType)(m)){let e=(0,n.inspect)(m);r(new s.GraphQLError(`Variable "$${t}" of non-null type "${e}" must not be null.`,{nodes:h}));continue}o[t]=(0,c.coerceInputValue)(y,m,(e,i,o)=>{let l=`Variable "$${t}" got invalid value `+(0,n.inspect)(i);e.length>0&&(l+=` at "${t}${(0,a.printPathArray)(e)}"`),r(new s.GraphQLError(l+"; "+o.message,{nodes:h,originalError:o}))})}return{...o}}(e,t,i,e=>{if(null!=h&&o.length>=h)throw new s.GraphQLError("Too many errors processing variables, error limit reached. Execution aborted.");o.push(e)});if(0===o.length)return{coerced:r}}catch(e){o.push(e)}return{errors:o}};var n=e.r(818123),r=e.r(117921),a=e.r(236745),s=e.r(294943),o=e.r(199311),l=e.r(340647),u=e.r(211325),c=e.r(291752),d=e.r(653704),p=e.r(674275);function h(e,t,i){var a;let c=Object.create(null),d=null!=(a=t.arguments)?a:[],h=(0,r.keyMap)(d,e=>e.name.value);for(let r of e.args){let e=r.name,a=r.type,d=h[e];if(!d){if(void 0!==r.defaultValue)c[e]=r.defaultValue;else if((0,u.isNonNullType)(a))throw new s.GraphQLError(`Argument "${e}" of required type "${(0,n.inspect)(a)}" was not provided.`,{nodes:t});continue}let m=d.value,y=m.kind===o.Kind.NULL;if(m.kind===o.Kind.VARIABLE){let t=m.name.value;if(null==i||!f(i,t)){if(void 0!==r.defaultValue)c[e]=r.defaultValue;else if((0,u.isNonNullType)(a))throw new s.GraphQLError(`Argument "${e}" of required type "${(0,n.inspect)(a)}" was provided the variable "$${t}" which was not provided a runtime value.`,{nodes:m});continue}y=null==i[t]}if(y&&(0,u.isNonNullType)(a))throw new s.GraphQLError(`Argument "${e}" of non-null type "${(0,n.inspect)(a)}" must not be null.`,{nodes:m});let v=(0,p.valueFromAST)(m,a,i);if(void 0===v)throw new s.GraphQLError(`Argument "${e}" has invalid value ${(0,l.print)(m)}.`,{nodes:m});c[e]=v}return{...c}}function f(e,t){return Object.prototype.hasOwnProperty.call(e,t)}},227902,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.collectFields=function(e,t,i,n,r){let a=new Map;return l(e,t,i,n,r,a,new Set),a},i.collectSubfields=function(e,t,i,n,r){let a=new Map,s=new Set;for(let o of r)o.selectionSet&&l(e,t,i,n,o.selectionSet,a,s);return a};var n=e.r(199311),r=e.r(211325),a=e.r(336081),s=e.r(653704),o=e.r(886375);function l(e,t,i,r,a,s,o){for(let p of a.selections)switch(p.kind){case n.Kind.FIELD:{var d;if(!u(i,p))continue;let e=(d=p).alias?d.alias.value:d.name.value,t=s.get(e);void 0!==t?t.push(p):s.set(e,[p]);break}case n.Kind.INLINE_FRAGMENT:if(!u(i,p)||!c(e,p,r))continue;l(e,t,i,r,p.selectionSet,s,o);break;case n.Kind.FRAGMENT_SPREAD:{let n=p.name.value;if(o.has(n)||!u(i,p))continue;o.add(n);let a=t[n];if(!a||!c(e,a,r))continue;l(e,t,i,r,a.selectionSet,s,o)}}}function u(e,t){let i=(0,o.getDirectiveValues)(a.GraphQLSkipDirective,t,e);if((null==i?void 0:i.if)===!0)return!1;let n=(0,o.getDirectiveValues)(a.GraphQLIncludeDirective,t,e);return(null==n?void 0:n.if)!==!1}function c(e,t,i){let n=t.typeCondition;if(!n)return!0;let a=(0,s.typeFromAST)(e,n);return a===i||!!(0,r.isAbstractType)(a)&&e.isSubType(a,i)}},68741,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.SingleFieldSubscriptionsRule=function(e){return{OperationDefinition(t){if("subscription"===t.operation){let i=e.getSchema(),s=i.getSubscriptionType();if(s){let o=t.name?t.name.value:null,l=Object.create(null),u=e.getDocument(),c=Object.create(null);for(let e of u.definitions)e.kind===r.Kind.FRAGMENT_DEFINITION&&(c[e.name.value]=e);let d=(0,a.collectFields)(i,c,l,s,t.selectionSet);if(d.size>1){let t=[...d.values()].slice(1).flat();e.reportError(new n.GraphQLError(null!=o?`Subscription "${o}" must select only one top level field.`:"Anonymous Subscription must select only one top level field.",{nodes:t}))}for(let t of d.values())t[0].name.value.startsWith("__")&&e.reportError(new n.GraphQLError(null!=o?`Subscription "${o}" must not select an introspection top level field.`:"Anonymous Subscription must not select an introspection top level field.",{nodes:t}))}}}}};var n=e.r(294943),r=e.r(199311),a=e.r(227902)},754680,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.groupBy=function(e,t){let i=new Map;for(let n of e){let e=t(n),r=i.get(e);void 0===r?i.set(e,[n]):r.push(n)}return i}},387128,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.UniqueArgumentDefinitionNamesRule=function(e){return{DirectiveDefinition(e){var t;let n=null!=(t=e.arguments)?t:[];return i(`@${e.name.value}`,n)},InterfaceTypeDefinition:t,InterfaceTypeExtension:t,ObjectTypeDefinition:t,ObjectTypeExtension:t};function t(e){var t,n;let r=e.name.value;for(let a of null!=(t=e.fields)?t:[]){let e=a.name.value;i(`${r}.${e}`,null!=(n=a.arguments)?n:[])}return!1}function i(t,i){for(let[a,s]of(0,n.groupBy)(i,e=>e.name.value))s.length>1&&e.reportError(new r.GraphQLError(`Argument "${t}(${a}:)" can only be defined once.`,{nodes:s.map(e=>e.name)}));return!1}};var n=e.r(754680),r=e.r(294943)},644919,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.UniqueArgumentNamesRule=function(e){return{Field:t,Directive:t};function t(t){var i;let a=null!=(i=t.arguments)?i:[];for(let[t,i]of(0,n.groupBy)(a,e=>e.name.value))i.length>1&&e.reportError(new r.GraphQLError(`There can be only one argument named "${t}".`,{nodes:i.map(e=>e.name)}))}};var n=e.r(754680),r=e.r(294943)},970672,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.UniqueDirectiveNamesRule=function(e){let t=Object.create(null),i=e.getSchema();return{DirectiveDefinition(r){let a=r.name.value;return null!=i&&i.getDirective(a)?void e.reportError(new n.GraphQLError(`Directive "@${a}" already exists in the schema. It cannot be redefined.`,{nodes:r.name})):(t[a]?e.reportError(new n.GraphQLError(`There can be only one directive named "@${a}".`,{nodes:[t[a],r.name]})):t[a]=r.name,!1)}}};var n=e.r(294943)},611443,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.UniqueDirectivesPerLocationRule=function(e){let t=Object.create(null),i=e.getSchema();for(let e of i?i.getDirectives():s.specifiedDirectives)t[e.name]=!e.isRepeatable;for(let i of e.getDocument().definitions)i.kind===r.Kind.DIRECTIVE_DEFINITION&&(t[i.name.value]=!i.repeatable);let o=Object.create(null),l=Object.create(null),u=Object.create(null);return{enter(i){let s;if("directives"in i&&i.directives){if(i.kind===r.Kind.SCHEMA_DEFINITION||i.kind===r.Kind.SCHEMA_EXTENSION)s=o;else if((0,a.isTypeDefinitionNode)(i)||(0,a.isTypeExtensionNode)(i)){let e=i.name.value;void 0===(s=l[e])&&(l[e]=s=Object.create(null))}else if(i.kind===r.Kind.DIRECTIVE_DEFINITION||i.kind===r.Kind.DIRECTIVE_EXTENSION){let e=i.name.value;void 0===(s=u[e])&&(u[e]=s=Object.create(null))}else s=Object.create(null);for(let r of i.directives){let i=r.name.value;t[i]&&(s[i]?e.reportError(new n.GraphQLError(`The directive "@${i}" can only be used once at this location.`,{nodes:[s[i],r]})):s[i]=r)}}}}};var n=e.r(294943),r=e.r(199311),a=e.r(940674),s=e.r(336081)},343685,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.UniqueEnumValueNamesRule=function(e){let t=e.getSchema(),i=t?t.getTypeMap():Object.create(null),a=Object.create(null);return{EnumTypeDefinition:s,EnumTypeExtension:s};function s(t){var s;let o=t.name.value;a[o]||(a[o]=Object.create(null));let l=null!=(s=t.values)?s:[],u=a[o];for(let t of l){let a=t.name.value,s=i[o];(0,r.isEnumType)(s)&&s.getValue(a)?e.reportError(new n.GraphQLError(`Enum value "${o}.${a}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:t.name})):u[a]?e.reportError(new n.GraphQLError(`Enum value "${o}.${a}" can only be defined once.`,{nodes:[u[a],t.name]})):u[a]=t.name}return!1}};var n=e.r(294943),r=e.r(211325)},975444,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.UniqueFieldDefinitionNamesRule=function(e){let t=e.getSchema(),i=t?t.getTypeMap():Object.create(null),a=Object.create(null);return{InputObjectTypeDefinition:s,InputObjectTypeExtension:s,InterfaceTypeDefinition:s,InterfaceTypeExtension:s,ObjectTypeDefinition:s,ObjectTypeExtension:s};function s(t){var s,o,l;let u=t.name.value;a[u]||(a[u]=Object.create(null));let c=null!=(s=t.fields)?s:[],d=a[u];for(let t of c){let a=t.name.value;(o=i[u],l=a,((0,r.isObjectType)(o)||(0,r.isInterfaceType)(o)||(0,r.isInputObjectType)(o))&&null!=o.getFields()[l])?e.reportError(new n.GraphQLError(`Field "${u}.${a}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:t.name})):d[a]?e.reportError(new n.GraphQLError(`Field "${u}.${a}" can only be defined once.`,{nodes:[d[a],t.name]})):d[a]=t.name}return!1}};var n=e.r(294943),r=e.r(211325)},971887,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.UniqueFragmentNamesRule=function(e){let t=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition(i){let r=i.name.value;return t[r]?e.reportError(new n.GraphQLError(`There can be only one fragment named "${r}".`,{nodes:[t[r],i.name]})):t[r]=i.name,!1}}};var n=e.r(294943)},845263,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.UniqueInputFieldNamesRule=function(e){let t=[],i=Object.create(null);return{ObjectValue:{enter(){t.push(i),i=Object.create(null)},leave(){let e=t.pop();e||(0,n.invariant)(!1),i=e}},ObjectField(t){let n=t.name.value;i[n]?e.reportError(new r.GraphQLError(`There can be only one input field named "${n}".`,{nodes:[i[n],t.name]})):i[n]=t.name}}};var n=e.r(119588),r=e.r(294943)},420383,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.UniqueOperationNamesRule=function(e){let t=Object.create(null);return{OperationDefinition(i){let r=i.name;return r&&(t[r.value]?e.reportError(new n.GraphQLError(`There can be only one operation named "${r.value}".`,{nodes:[t[r.value],r]})):t[r.value]=r),!1},FragmentDefinition:()=>!1}};var n=e.r(294943)},71155,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.UniqueOperationTypesRule=function(e){let t=e.getSchema(),i=Object.create(null),r=t?{query:t.getQueryType(),mutation:t.getMutationType(),subscription:t.getSubscriptionType()}:{};return{SchemaDefinition:a,SchemaExtension:a};function a(t){var a;for(let s of null!=(a=t.operationTypes)?a:[]){let t=s.operation,a=i[t];r[t]?e.reportError(new n.GraphQLError(`Type for ${t} already defined in the schema. It cannot be redefined.`,{nodes:s})):a?e.reportError(new n.GraphQLError(`There can be only one ${t} type in schema.`,{nodes:[a,s]})):i[t]=s}return!1}};var n=e.r(294943)},455960,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.UniqueTypeNamesRule=function(e){let t=Object.create(null),i=e.getSchema();return{ScalarTypeDefinition:r,ObjectTypeDefinition:r,InterfaceTypeDefinition:r,UnionTypeDefinition:r,EnumTypeDefinition:r,InputObjectTypeDefinition:r};function r(r){let a=r.name.value;return null!=i&&i.getType(a)?void e.reportError(new n.GraphQLError(`Type "${a}" already exists in the schema. It cannot also be defined in this type definition.`,{nodes:r.name})):(t[a]?e.reportError(new n.GraphQLError(`There can be only one type named "${a}".`,{nodes:[t[a],r.name]})):t[a]=r.name,!1)}};var n=e.r(294943)},698900,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.UniqueVariableNamesRule=function(e){return{OperationDefinition(t){var i;let a=null!=(i=t.variableDefinitions)?i:[];for(let[t,i]of(0,n.groupBy)(a,e=>e.variable.name.value))i.length>1&&e.reportError(new r.GraphQLError(`There can be only one variable named "$${t}".`,{nodes:i.map(e=>e.variable.name)}))}}};var n=e.r(754680),r=e.r(294943)},151009,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.ValuesOfCorrectTypeRule=function(e){return{ListValue(t){let i=(0,c.getNullableType)(e.getParentInputType());if(!(0,c.isListType)(i))return d(e,t),!1},ObjectValue(t){let i=(0,c.getNamedType)(e.getInputType());if(!(0,c.isInputObjectType)(i))return d(e,t),!1;let n=(0,a.keyMap)(t.fields,e=>e.name.value);for(let a of Object.values(i.getFields()))if(!n[a.name]&&(0,c.isRequiredInputField)(a)){let n=(0,r.inspect)(a.type);e.reportError(new o.GraphQLError(`Field "${i.name}.${a.name}" of required type "${n}" was not provided.`,{nodes:t}))}i.isOneOf&&function(e,t,i,n){var r;let a=Object.keys(n);if(1!==a.length)return e.reportError(new o.GraphQLError(`OneOf Input Object "${i.name}" must specify exactly one key.`,{nodes:[t]}));let s=null==(r=n[a[0]])?void 0:r.value;s&&s.kind!==l.Kind.NULL||e.reportError(new o.GraphQLError(`Field "${i.name}.${a[0]}" must be non-null.`,{nodes:[t]}))}(e,t,i,n)},ObjectField(t){let i=(0,c.getNamedType)(e.getParentInputType());if(!e.getInputType()&&(0,c.isInputObjectType)(i)){let r=(0,s.suggestionList)(t.name.value,Object.keys(i.getFields()));e.reportError(new o.GraphQLError(`Field "${t.name.value}" is not defined by type "${i.name}".`+(0,n.didYouMean)(r),{nodes:t}))}},NullValue(t){let i=e.getInputType();(0,c.isNonNullType)(i)&&e.reportError(new o.GraphQLError(`Expected value of type "${(0,r.inspect)(i)}", found ${(0,u.print)(t)}.`,{nodes:t}))},EnumValue:t=>d(e,t),IntValue:t=>d(e,t),FloatValue:t=>d(e,t),StringValue:t=>d(e,t),BooleanValue:t=>d(e,t)}};var n=e.r(996650),r=e.r(818123),a=e.r(117921),s=e.r(529364),o=e.r(294943),l=e.r(199311),u=e.r(340647),c=e.r(211325);function d(e,t){let i=e.getInputType();if(!i)return;let n=(0,c.getNamedType)(i);if(!(0,c.isLeafType)(n)){let n=(0,r.inspect)(i);e.reportError(new o.GraphQLError(`Expected value of type "${n}", found ${(0,u.print)(t)}.`,{nodes:t}));return}try{let a=n.parseLiteral(t,void 0);if(void 0===a){let n=(0,r.inspect)(i);e.reportError(new o.GraphQLError(`Expected value of type "${n}", found ${(0,u.print)(t)}.`,{nodes:t}))}}catch(a){let n=(0,r.inspect)(i);a instanceof o.GraphQLError?e.reportError(a):e.reportError(new o.GraphQLError(`Expected value of type "${n}", found ${(0,u.print)(t)}; `+a.message,{nodes:t,originalError:a}))}}},388275,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.VariablesAreInputTypesRule=function(e){return{VariableDefinition(t){let i=(0,s.typeFromAST)(e.getSchema(),t.type);if(void 0!==i&&!(0,a.isInputType)(i)){let i=t.variable.name.value,a=(0,r.print)(t.type);e.reportError(new n.GraphQLError(`Variable "$${i}" cannot be non-input type "${a}".`,{nodes:t.type}))}}}};var n=e.r(294943),r=e.r(340647),a=e.r(211325),s=e.r(653704)},218412,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.VariablesInAllowedPositionRule=function(e){let t=Object.create(null);return{OperationDefinition:{enter(){t=Object.create(null)},leave(i){for(let{node:u,type:c,defaultValue:d,parentType:p}of e.getRecursiveVariableUsages(i)){let i=u.name.value,h=t[i];if(h&&c){let t=e.getSchema(),f=(0,l.typeFromAST)(t,h.type);if(f&&!function(e,t,i,n,r){if((0,s.isNonNullType)(n)&&!(0,s.isNonNullType)(t)){if((null==i||i.kind===a.Kind.NULL)&&void 0===r)return!1;let s=n.ofType;return(0,o.isTypeSubTypeOf)(e,t,s)}return(0,o.isTypeSubTypeOf)(e,t,n)}(t,f,h.defaultValue,c,d)){let t=(0,n.inspect)(f),a=(0,n.inspect)(c);e.reportError(new r.GraphQLError(`Variable "$${i}" of type "${t}" used in position expecting type "${a}".`,{nodes:[h,u]}))}(0,s.isInputObjectType)(p)&&p.isOneOf&&(0,s.isNullableType)(f)&&e.reportError(new r.GraphQLError(`Variable "$${i}" is of type "${f}" but must be non-nullable to be used for OneOf Input Object "${p}".`,{nodes:[h,u]}))}}}},VariableDefinition(e){t[e.variable.name.value]=e}}};var n=e.r(818123),r=e.r(294943),a=e.r(199311),s=e.r(211325),o=e.r(957861),l=e.r(653704)},359063,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.specifiedSDLRules=i.specifiedRules=i.recommendedRules=void 0;var n=e.r(619559),r=e.r(146560),a=e.r(610156),s=e.r(111080),o=e.r(820345),l=e.r(432098),u=e.r(141097),c=e.r(336446),d=e.r(893600),p=e.r(100876),h=e.r(74344),f=e.r(166380),m=e.r(608150),y=e.r(528651),v=e.r(581577),g=e.r(8879),T=e.r(258511),S=e.r(818671),E=e.r(12773),I=e.r(68741),b=e.r(387128),N=e.r(644919),_=e.r(970672),D=e.r(611443),A=e.r(343685),O=e.r(975444),R=e.r(971887),w=e.r(845263),L=e.r(420383),C=e.r(71155),F=e.r(455960),k=e.r(698900),P=e.r(151009),x=e.r(388275),M=e.r(218412);let U=Object.freeze([p.MaxIntrospectionDepthRule]);i.recommendedRules=U,i.specifiedRules=Object.freeze([n.ExecutableDefinitionsRule,L.UniqueOperationNamesRule,c.LoneAnonymousOperationRule,I.SingleFieldSubscriptionsRule,u.KnownTypeNamesRule,a.FragmentsOnCompositeTypesRule,x.VariablesAreInputTypesRule,E.ScalarLeafsRule,r.FieldsOnCorrectTypeRule,R.UniqueFragmentNamesRule,l.KnownFragmentNamesRule,m.NoUnusedFragmentsRule,g.PossibleFragmentSpreadsRule,h.NoFragmentCyclesRule,k.UniqueVariableNamesRule,f.NoUndefinedVariablesRule,y.NoUnusedVariablesRule,o.KnownDirectivesRule,D.UniqueDirectivesPerLocationRule,s.KnownArgumentNamesRule,N.UniqueArgumentNamesRule,P.ValuesOfCorrectTypeRule,S.ProvidedRequiredArgumentsRule,M.VariablesInAllowedPositionRule,v.OverlappingFieldsCanBeMergedRule,w.UniqueInputFieldNamesRule,...U]),i.specifiedSDLRules=Object.freeze([d.LoneSchemaDefinitionRule,C.UniqueOperationTypesRule,F.UniqueTypeNamesRule,A.UniqueEnumValueNamesRule,O.UniqueFieldDefinitionNamesRule,b.UniqueArgumentDefinitionNamesRule,_.UniqueDirectiveNamesRule,u.KnownTypeNamesRule,o.KnownDirectivesRule,D.UniqueDirectivesPerLocationRule,T.PossibleTypeExtensionsRule,s.KnownArgumentNamesOnDirectivesRule,N.UniqueArgumentNamesRule,w.UniqueInputFieldNamesRule,S.ProvidedRequiredArgumentsOnDirectivesRule])},85242,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.ValidationContext=i.SDLValidationContext=i.ASTValidationContext=void 0;var n=e.r(199311),r=e.r(999680),a=e.r(928241);class s{constructor(e,t){this._ast=e,this._fragments=void 0,this._fragmentSpreads=new Map,this._recursivelyReferencedFragments=new Map,this._onError=t}get[Symbol.toStringTag](){return"ASTValidationContext"}reportError(e){this._onError(e)}getDocument(){return this._ast}getFragment(e){let t;if(this._fragments)t=this._fragments;else{for(let e of(t=Object.create(null),this.getDocument().definitions))e.kind===n.Kind.FRAGMENT_DEFINITION&&(t[e.name.value]=e);this._fragments=t}return t[e]}getFragmentSpreads(e){let t=this._fragmentSpreads.get(e);if(!t){let i;t=[];let r=[e];for(;i=r.pop();)for(let e of i.selections)e.kind===n.Kind.FRAGMENT_SPREAD?t.push(e):e.selectionSet&&r.push(e.selectionSet);this._fragmentSpreads.set(e,t)}return t}getRecursivelyReferencedFragments(e){let t=this._recursivelyReferencedFragments.get(e);if(!t){let i;t=[];let n=Object.create(null),r=[e.selectionSet];for(;i=r.pop();)for(let e of this.getFragmentSpreads(i)){let i=e.name.value;if(!0!==n[i]){n[i]=!0;let e=this.getFragment(i);e&&(t.push(e),r.push(e.selectionSet))}}this._recursivelyReferencedFragments.set(e,t)}return t}}i.ASTValidationContext=s;class o extends s{constructor(e,t,i){super(e,i),this._schema=t}get[Symbol.toStringTag](){return"SDLValidationContext"}getSchema(){return this._schema}}i.SDLValidationContext=o;class l extends s{constructor(e,t,i,n){super(t,n),this._schema=e,this._typeInfo=i,this._variableUsages=new Map,this._recursiveVariableUsages=new Map}get[Symbol.toStringTag](){return"ValidationContext"}getSchema(){return this._schema}getVariableUsages(e){let t=this._variableUsages.get(e);if(!t){let i=[],n=new a.TypeInfo(this._schema);(0,r.visit)(e,(0,a.visitWithTypeInfo)(n,{VariableDefinition:()=>!1,Variable(e){i.push({node:e,type:n.getInputType(),defaultValue:n.getDefaultValue(),parentType:n.getParentInputType()})}})),t=i,this._variableUsages.set(e,t)}return t}getRecursiveVariableUsages(e){let t=this._recursiveVariableUsages.get(e);if(!t){for(let i of(t=this.getVariableUsages(e),this.getRecursivelyReferencedFragments(e)))t=t.concat(this.getVariableUsages(i));this._recursiveVariableUsages.set(e,t)}return t}getType(){return this._typeInfo.getType()}getParentType(){return this._typeInfo.getParentType()}getInputType(){return this._typeInfo.getInputType()}getParentInputType(){return this._typeInfo.getParentInputType()}getFieldDef(){return this._typeInfo.getFieldDef()}getDirective(){return this._typeInfo.getDirective()}getArgument(){return this._typeInfo.getArgument()}getEnumValue(){return this._typeInfo.getEnumValue()}}i.ValidationContext=l},563029,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.assertValidSDL=function(e){let t=h(e);if(0!==t.length)throw Error(t.map(e=>e.message).join("\n\n"))},i.assertValidSDLExtension=function(e,t){let i=h(e,t);if(0!==i.length)throw Error(i.map(e=>e.message).join("\n\n"))},i.validate=function(e,t,i=c.specifiedRules,r,s=new u.TypeInfo(e)){var h;let f=null!=(h=null==r?void 0:r.maxErrors)?h:100;t||(0,n.devAssert)(!1,"Must provide document."),(0,l.assertValidSchema)(e);let m=Object.freeze({}),y=[],v=new d.ValidationContext(e,t,s,e=>{if(y.length>=f)throw y.push(new a.GraphQLError("Too many validation errors, error limit reached. Validation aborted.")),m;y.push(e)}),g=(0,o.visitInParallel)(i.map(e=>e(v)));try{(0,o.visit)(t,(0,u.visitWithTypeInfo)(s,g),p)}catch(e){if(e!==m)throw e}return y},i.validateSDL=h;var n=e.r(786390),r=e.r(287547),a=e.r(294943),s=e.r(463040),o=e.r(999680),l=e.r(215956),u=e.r(928241),c=e.r(359063),d=e.r(85242);let p=(0,r.mapValue)(s.QueryDocumentKeys,e=>e.filter(e=>"description"!==e));function h(e,t,i=c.specifiedSDLRules){let n=[],r=new d.SDLValidationContext(e,t,e=>{n.push(e)}),a=i.map(e=>e(r));return(0,o.visit)(e,(0,o.visitInParallel)(a)),n}},473988,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.NoDeprecatedCustomRule=function(e){return{Field(t){let i=e.getFieldDef(),a=null==i?void 0:i.deprecationReason;if(i&&null!=a){let s=e.getParentType();null!=s||(0,n.invariant)(!1),e.reportError(new r.GraphQLError(`The field ${s.name}.${i.name} is deprecated. ${a}`,{nodes:t}))}},Argument(t){let i=e.getArgument(),a=null==i?void 0:i.deprecationReason;if(i&&null!=a){let s=e.getDirective();if(null!=s)e.reportError(new r.GraphQLError(`Directive "@${s.name}" argument "${i.name}" is deprecated. ${a}`,{nodes:t}));else{let s=e.getParentType(),o=e.getFieldDef();null!=s&&null!=o||(0,n.invariant)(!1),e.reportError(new r.GraphQLError(`Field "${s.name}.${o.name}" argument "${i.name}" is deprecated. ${a}`,{nodes:t}))}}},ObjectField(t){let i=(0,a.getNamedType)(e.getParentInputType());if((0,a.isInputObjectType)(i)){let n=i.getFields()[t.name.value],a=null==n?void 0:n.deprecationReason;null!=a&&e.reportError(new r.GraphQLError(`The input field ${i.name}.${n.name} is deprecated. ${a}`,{nodes:t}))}},EnumValue(t){let i=e.getEnumValue(),s=null==i?void 0:i.deprecationReason;if(i&&null!=s){let o=(0,a.getNamedType)(e.getInputType());null!=o||(0,n.invariant)(!1),e.reportError(new r.GraphQLError(`The enum value "${o.name}.${i.name}" is deprecated. ${s}`,{nodes:t}))}}}};var n=e.r(119588),r=e.r(294943),a=e.r(211325)},583740,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.NoSchemaIntrospectionCustomRule=function(e){return{Field(t){let i=(0,r.getNamedType)(e.getType());i&&(0,a.isIntrospectionType)(i)&&e.reportError(new n.GraphQLError(`GraphQL introspection has been disabled, but the requested query contained the field "${t.name.value}".`,{nodes:t}))}}};var n=e.r(294943),r=e.r(211325),a=e.r(187936)},354836,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"ExecutableDefinitionsRule",{enumerable:!0,get:function(){return s.ExecutableDefinitionsRule}}),Object.defineProperty(i,"FieldsOnCorrectTypeRule",{enumerable:!0,get:function(){return o.FieldsOnCorrectTypeRule}}),Object.defineProperty(i,"FragmentsOnCompositeTypesRule",{enumerable:!0,get:function(){return l.FragmentsOnCompositeTypesRule}}),Object.defineProperty(i,"KnownArgumentNamesRule",{enumerable:!0,get:function(){return u.KnownArgumentNamesRule}}),Object.defineProperty(i,"KnownDirectivesRule",{enumerable:!0,get:function(){return c.KnownDirectivesRule}}),Object.defineProperty(i,"KnownFragmentNamesRule",{enumerable:!0,get:function(){return d.KnownFragmentNamesRule}}),Object.defineProperty(i,"KnownTypeNamesRule",{enumerable:!0,get:function(){return p.KnownTypeNamesRule}}),Object.defineProperty(i,"LoneAnonymousOperationRule",{enumerable:!0,get:function(){return h.LoneAnonymousOperationRule}}),Object.defineProperty(i,"LoneSchemaDefinitionRule",{enumerable:!0,get:function(){return F.LoneSchemaDefinitionRule}}),Object.defineProperty(i,"MaxIntrospectionDepthRule",{enumerable:!0,get:function(){return C.MaxIntrospectionDepthRule}}),Object.defineProperty(i,"NoDeprecatedCustomRule",{enumerable:!0,get:function(){return V.NoDeprecatedCustomRule}}),Object.defineProperty(i,"NoFragmentCyclesRule",{enumerable:!0,get:function(){return f.NoFragmentCyclesRule}}),Object.defineProperty(i,"NoSchemaIntrospectionCustomRule",{enumerable:!0,get:function(){return G.NoSchemaIntrospectionCustomRule}}),Object.defineProperty(i,"NoUndefinedVariablesRule",{enumerable:!0,get:function(){return m.NoUndefinedVariablesRule}}),Object.defineProperty(i,"NoUnusedFragmentsRule",{enumerable:!0,get:function(){return y.NoUnusedFragmentsRule}}),Object.defineProperty(i,"NoUnusedVariablesRule",{enumerable:!0,get:function(){return v.NoUnusedVariablesRule}}),Object.defineProperty(i,"OverlappingFieldsCanBeMergedRule",{enumerable:!0,get:function(){return g.OverlappingFieldsCanBeMergedRule}}),Object.defineProperty(i,"PossibleFragmentSpreadsRule",{enumerable:!0,get:function(){return T.PossibleFragmentSpreadsRule}}),Object.defineProperty(i,"PossibleTypeExtensionsRule",{enumerable:!0,get:function(){return j.PossibleTypeExtensionsRule}}),Object.defineProperty(i,"ProvidedRequiredArgumentsRule",{enumerable:!0,get:function(){return S.ProvidedRequiredArgumentsRule}}),Object.defineProperty(i,"ScalarLeafsRule",{enumerable:!0,get:function(){return E.ScalarLeafsRule}}),Object.defineProperty(i,"SingleFieldSubscriptionsRule",{enumerable:!0,get:function(){return I.SingleFieldSubscriptionsRule}}),Object.defineProperty(i,"UniqueArgumentDefinitionNamesRule",{enumerable:!0,get:function(){return U.UniqueArgumentDefinitionNamesRule}}),Object.defineProperty(i,"UniqueArgumentNamesRule",{enumerable:!0,get:function(){return b.UniqueArgumentNamesRule}}),Object.defineProperty(i,"UniqueDirectiveNamesRule",{enumerable:!0,get:function(){return $.UniqueDirectiveNamesRule}}),Object.defineProperty(i,"UniqueDirectivesPerLocationRule",{enumerable:!0,get:function(){return N.UniqueDirectivesPerLocationRule}}),Object.defineProperty(i,"UniqueEnumValueNamesRule",{enumerable:!0,get:function(){return x.UniqueEnumValueNamesRule}}),Object.defineProperty(i,"UniqueFieldDefinitionNamesRule",{enumerable:!0,get:function(){return M.UniqueFieldDefinitionNamesRule}}),Object.defineProperty(i,"UniqueFragmentNamesRule",{enumerable:!0,get:function(){return _.UniqueFragmentNamesRule}}),Object.defineProperty(i,"UniqueInputFieldNamesRule",{enumerable:!0,get:function(){return D.UniqueInputFieldNamesRule}}),Object.defineProperty(i,"UniqueOperationNamesRule",{enumerable:!0,get:function(){return A.UniqueOperationNamesRule}}),Object.defineProperty(i,"UniqueOperationTypesRule",{enumerable:!0,get:function(){return k.UniqueOperationTypesRule}}),Object.defineProperty(i,"UniqueTypeNamesRule",{enumerable:!0,get:function(){return P.UniqueTypeNamesRule}}),Object.defineProperty(i,"UniqueVariableNamesRule",{enumerable:!0,get:function(){return O.UniqueVariableNamesRule}}),Object.defineProperty(i,"ValidationContext",{enumerable:!0,get:function(){return r.ValidationContext}}),Object.defineProperty(i,"ValuesOfCorrectTypeRule",{enumerable:!0,get:function(){return R.ValuesOfCorrectTypeRule}}),Object.defineProperty(i,"VariablesAreInputTypesRule",{enumerable:!0,get:function(){return w.VariablesAreInputTypesRule}}),Object.defineProperty(i,"VariablesInAllowedPositionRule",{enumerable:!0,get:function(){return L.VariablesInAllowedPositionRule}}),Object.defineProperty(i,"recommendedRules",{enumerable:!0,get:function(){return a.recommendedRules}}),Object.defineProperty(i,"specifiedRules",{enumerable:!0,get:function(){return a.specifiedRules}}),Object.defineProperty(i,"validate",{enumerable:!0,get:function(){return n.validate}});var n=e.r(563029),r=e.r(85242),a=e.r(359063),s=e.r(619559),o=e.r(146560),l=e.r(610156),u=e.r(111080),c=e.r(820345),d=e.r(432098),p=e.r(141097),h=e.r(336446),f=e.r(74344),m=e.r(166380),y=e.r(608150),v=e.r(528651),g=e.r(581577),T=e.r(8879),S=e.r(818671),E=e.r(12773),I=e.r(68741),b=e.r(644919),N=e.r(611443),_=e.r(971887),D=e.r(845263),A=e.r(420383),O=e.r(698900),R=e.r(151009),w=e.r(388275),L=e.r(218412),C=e.r(100876),F=e.r(893600),k=e.r(71155),P=e.r(455960),x=e.r(343685),M=e.r(975444),U=e.r(387128),$=e.r(970672),j=e.r(258511),V=e.r(473988),G=e.r(583740)},629961,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.GraphQLSchemaValidationError=void 0,i.GraphQLSchemaValidationError=class extends Error{constructor(e){super(),this.errors=e,this.name=this.constructor.name,Error.captureStackTrace(this,this.constructor),this.message=e.map(e=>e.message).join("\n\n")}}},58532,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.buildSchemaFromSDL=i.addResolversToSchema=i.modulesFromSDL=i.isDocumentNode=i.isNode=void 0;let n=e.r(186846),r=e.r(354836),a=e.r(563029),s=e.r(359063),o=e.r(629961);function l(e){return null!=e}function u(e){return e&&"string"==typeof e.kind}function c(e){return u(e)&&e.kind===n.Kind.DOCUMENT}i.isNode=u,i.isDocumentNode=c;let d=[r.KnownTypeNamesRule,r.UniqueDirectivesPerLocationRule,r.PossibleTypeExtensionsRule],p=s.specifiedSDLRules.filter(e=>!d.includes(e)),h={[n.Kind.SCALAR_TYPE_EXTENSION]:n.Kind.SCALAR_TYPE_DEFINITION,[n.Kind.OBJECT_TYPE_EXTENSION]:n.Kind.OBJECT_TYPE_DEFINITION,[n.Kind.INTERFACE_TYPE_EXTENSION]:n.Kind.INTERFACE_TYPE_DEFINITION,[n.Kind.UNION_TYPE_EXTENSION]:n.Kind.UNION_TYPE_DEFINITION,[n.Kind.ENUM_TYPE_EXTENSION]:n.Kind.ENUM_TYPE_DEFINITION,[n.Kind.INPUT_OBJECT_TYPE_EXTENSION]:n.Kind.INPUT_OBJECT_TYPE_DEFINITION};function f(e){return Array.isArray(e)?e.map(e=>u(e)&&c(e)?{typeDefs:e}:e):[{typeDefs:e}]}function m(e,t){var i,r;for(let[a,s]of Object.entries(t)){let t=e.getType(a);if((0,n.isAbstractType)(t)){let e=t.extensions;for(let[n,r]of Object.entries(s))"__resolveReference"===n?t.extensions={...e,apollo:{...e.apollo,subgraph:{...null==(i=e.apollo)?void 0:i.subgraph,resolveReference:r}}}:"__resolveType"===n&&(t.resolveType=r)}if((0,n.isScalarType)(t))for(let e in s){let i=s[e];void 0!==i&&(t[e]=i)}if((0,n.isEnumType)(t)){let e=t.getValues(),i={};e.forEach(e=>{let t=s[e.name];void 0===t&&(t=e.name),i[e.name]={value:t,deprecationReason:e.deprecationReason,description:e.description,astNode:e.astNode,extensions:void 0}}),Object.assign(t,new n.GraphQLEnumType({...t.toConfig(),values:i}))}if(!(0,n.isObjectType)(t))continue;let o=t.getFields(),l=t.extensions;for(let[e,i]of Object.entries(s)){if("__resolveReference"===e){t.extensions={...l,apollo:{...l.apollo,subgraph:{...null==(r=l.apollo)?void 0:r.subgraph,resolveReference:i}}};continue}if("__isTypeOf"===e){t.isTypeOf=i;continue}let n=o[e];n&&("function"==typeof i?n.resolve=i:(n.resolve=i.resolve,n.subscribe=i.subscribe))}}}i.modulesFromSDL=f,i.addResolversToSchema=m,i.buildSchemaFromSDL=function(e,t){let i,r,s=f(e),u=(0,n.concatAST)(s.map(e=>e.typeDefs)),c=(0,a.validateSDL)(u,t,p);if(c.length>0)throw new o.GraphQLSchemaValidationError(c);let d=Object.create(null),y=Object.create(null),v=[],g=[],T=[],S=[];for(let e of u.definitions)if((0,n.isTypeDefinitionNode)(e)){let t=e.name.value;d[t]?d[t].push(e):d[t]=[e]}else if((0,n.isTypeExtensionNode)(e)){let t=e.name.value;y[t]?y[t].push(e):y[t]=[e]}else e.kind===n.Kind.DIRECTIVE_DEFINITION?v.push(e):e.kind===n.Kind.SCHEMA_DEFINITION?(g.push(e),S.push(...e.directives?e.directives:[]),i=e.description):e.kind===n.Kind.SCHEMA_EXTENSION&&(T.push(e),S.push(...e.directives?e.directives:[]));let E=t||new n.GraphQLSchema({query:void 0}),I=[];for(let[e,t]of Object.entries(y))if(!d[e]){let e=t[0],i={kind:h[e.kind],name:e.name};I.push(i)}E=(0,n.extendSchema)(E,{kind:n.Kind.DOCUMENT,definitions:[...Object.values(d).flat(),...I,...v]},{assumeValidSDL:!0}),E=(0,n.extendSchema)(E,{kind:n.Kind.DOCUMENT,definitions:Object.values(y).flat()},{assumeValidSDL:!0});let b=[...g,...T].map(e=>e.operationTypes).filter(l).flat();if(b.length>0)for(let{operation:e,type:t}of(r={},b))r[e]=t.name.value;else r={query:"Query",mutation:"Mutation",subscription:"Subscription"};for(let e of(E=new n.GraphQLSchema({...E.toConfig(),...function(e,t){let i=Object.create(null);for(let[n,r]of Object.entries(e))i[n]=t(r);return i}(r,e=>e?E.getType(e):void 0),description:null==i?void 0:i.value,astNode:{kind:n.Kind.SCHEMA_DEFINITION,description:i,directives:S,operationTypes:[]}}),s))e.resolvers&&m(E,e.resolvers);return E}},905774,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.transformSchema=void 0;let n=e.r(186846);function r(e,t){let i=Object.create(null);for(let[n,r]of Object.entries(e))i[n]=t(r);return i}i.transformSchema=function(e,t){let i=Object.create(null);for(let a of Object.values(e.getTypeMap())){if((0,n.isIntrospectionType)(a))continue;let e=t(a);if(null===e)continue;let l=e||a;i[l.name]=function(e){if((0,n.isObjectType)(e)){let t=e.toConfig();return new n.GraphQLObjectType({...t,interfaces:()=>t.interfaces.map(o),fields:()=>u(t.fields)})}if((0,n.isInterfaceType)(e)){let t=e.toConfig();return new n.GraphQLInterfaceType({...t,interfaces:()=>t.interfaces.map(o),fields:()=>u(t.fields)})}if((0,n.isUnionType)(e)){let t=e.toConfig();return new n.GraphQLUnionType({...t,types:()=>t.types.map(o)})}if((0,n.isInputObjectType)(e)){let t=e.toConfig();return new n.GraphQLInputObjectType({...t,fields:()=>r(t.fields,e=>({...e,type:s(e.type)}))})}return e}(l)}let a=e.toConfig();return new n.GraphQLSchema({...a,types:Object.values(i),query:l(a.query),mutation:l(a.mutation),subscription:l(a.subscription),directives:a.directives.map(e=>{let t=e.toConfig();return new n.GraphQLDirective({...t,args:c(t.args)})})});function s(e){return(0,n.isListType)(e)?new n.GraphQLList(s(e.ofType)):(0,n.isNonNullType)(e)?new n.GraphQLNonNull(s(e.ofType)):o(e)}function o(e){return i[e.name]||e}function l(e){return e?o(e):void 0}function u(e){return r(e,e=>({...e,type:s(e.type),args:e.args?c(e.args):void 0}))}function c(e){return r(e,e=>({...e,type:s(e.type)}))}}},242080,(e,t,i)=>{"use strict";var n=e.e&&e.e.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),r=e.e&&e.e.__exportStar||function(e,t){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(t,i)||n(t,e,i)};Object.defineProperty(i,"__esModule",{value:!0}),r(e.r(294682),i),r(e.r(58532),i),r(e.r(629961),i),r(e.r(905774),i)},678270,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.typesCanBeMerged=i.isStrictSubtype=i.isSubtype=i.isDirectSubtype=i.sameType=i.DEFAULT_SUBTYPING_RULES=i.ALL_SUBTYPING_RULES=void 0;let n=e.r(168032);function r(e,t){switch(e.kind){case"ListType":return(0,n.isListType)(t)&&r(e.ofType,t.ofType);case"NonNullType":return(0,n.isNonNullType)(t)&&r(e.ofType,t.ofType);default:return(0,n.isNamedType)(t)&&e.name===t.name}}function a(e,t,i=(e,t)=>e.hasTypeMember(t),r=(e,t)=>e.implementsInterface(t)){return(0,n.isUnionType)(e)?(0,n.isObjectType)(t)&&i(e,t):r(t,e)}function s(e,t,n=i.DEFAULT_SUBTYPING_RULES,a=(e,t)=>e.hasTypeMember(t),l=(e,t)=>e.implementsInterface(t)){return r(e,t)||o(e,t,n,a,l)}function o(e,t,r=i.DEFAULT_SUBTYPING_RULES,l=(e,t)=>e.hasTypeMember(t),u=(e,t)=>e.implementsInterface(t)){switch(t.kind){case"ListType":return r.includes("list_propagation")&&(0,n.isListType)(e)&&s(e.ofType,t.ofType,r,l,u);case"NonNullType":if((0,n.isNonNullType)(e))return r.includes("nonNullable_propagation")&&s(e.ofType,t.ofType,r,l,u);return r.includes("nonNullable_downgrade")&&s(e,t.ofType,r,l,u);case"ObjectType":case"InterfaceType":if((0,n.isListType)(e))return r.includes("list_upgrade")&&s(e.ofType,t,r,l,u);return r.includes("direct")&&((0,n.isInterfaceType)(e)||(0,n.isUnionType)(e))&&a(e,t,l,u);default:return(0,n.isListType)(e)&&r.includes("list_upgrade")&&s(e.ofType,t,r,l,u)}}i.ALL_SUBTYPING_RULES=["direct","nonNullable_downgrade","list_upgrade","list_propagation","nonNullable_propagation"],i.DEFAULT_SUBTYPING_RULES=i.ALL_SUBTYPING_RULES.filter(e=>"list_upgrade"!==e),i.sameType=r,i.isDirectSubtype=a,i.isSubtype=s,i.isStrictSubtype=o,i.typesCanBeMerged=function e(t,i){return(0,n.isNonNullType)(t)?!!(0,n.isNonNullType)(i)&&e(t.ofType,i.ofType):(0,n.isListType)(t)?!!(0,n.isListType)(i)&&e(t.ofType,i.ofType):(0,n.isCompositeType)(t)?(0,n.isCompositeType)(i):r(t,i)}},331484,(e,t,i)=>{"use strict";function n(e,t){if(!e)throw Error("string"==typeof t?t:t())}Object.defineProperty(i,"__esModule",{value:!0}),i.setsEqual=i.composeSets=i.mergeMapOrNull=i.findLast=i.isNonEmptyArray=i.removeArrayElement=i.isDefined=i.printHumanReadableList=i.joinStrings=i.validateStringContainsBoolean=i.copyWitNewLength=i.MapWithCachedArrays=i.setValues=i.mapEntries=i.mapKeys=i.mapValues=i.firstOf=i.isSubset=i.arrayEquals=i.OrderedMap=i.SetMultiMap=i.MultiMap=i.assertUnreachable=i.assert=void 0,i.assert=n,i.assertUnreachable=function(e){throw Error("Didn't expect to get here")};class r extends Map{add(e,t){let i=this.get(e);return i?i.push(t):this.set(e,[t]),this}addAll(e){for(let[t,i]of e.entries())for(let e of i)this.add(t,e);return this}}i.MultiMap=r;class a extends Map{add(e,t){let i=this.get(e);return i||(i=new Set,this.set(e,i)),i.add(t),this}addAll(e){for(let[t,i]of e.entries())for(let e of i)this.add(t,e);return this}}i.SetMultiMap=a;class s{static defaultCompareFn(e,t){return e<t?-1:+(t<e)}constructor(e=s.defaultCompareFn){this._keys=[],this._values=new Map,this._compareFn=e}add(e,t){this._values.has(e)||this.insertKeyInOrder(e),this._values.set(e,t)}get(e){return this._values.get(e)}has(e){return this._values.has(e)}get size(){return this._keys.length}keys(){return this._keys}values(){return this._keys.map(e=>{let t=this._values.get(e);return n(t,"value for known key not found in OrderedMap"),t})}insertKeyInOrder(e){let t=0,i=this._keys.length-1;for(;t<=i;){let n=Math.floor((i+t)/2);0>this._compareFn(this._keys[n],e)?t=n+1:i=n-1}this._keys=this._keys.slice(0,t).concat(e).concat(this._keys.slice(t))}*[Symbol.iterator](){for(let e=0;e<this._keys.length;e+=1){let t=this._values.get(this._keys[e]);n(t,"value for known key not found in OrderedMap"),yield t}}}function o(e){let t=Array(e.size),i=0;for(let n of e.values())t[i++]=n;return t}function l(e){let t=Array(e.size),i=0;for(let n of e.keys())t[i++]=n;return t}function u(e,t=", ",i,n=" and "){if(0==e.length)return"";let r=e[0];if(1==e.length)return r;let a=e[e.length-1];return 2==e.length?r+(i||n)+a:r+(i||t)+e.slice(1,e.length-1).join(t)+n+a}i.OrderedMap=s,i.arrayEquals=function(e,t,i){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;++n)if(!(i?i(e[n],t[n]):e[n]===t[n]))return!1;return!0},i.isSubset=function(e,t){if(e===t)return!0;for(let i of t)if(!e.has(i))return!1;return!0},i.firstOf=function(e){let t=e[Symbol.iterator]().next();return t.done?void 0:t.value},i.mapValues=o,i.mapKeys=l,i.mapEntries=function(e){let t=Array(e.size),i=0;for(let n of e.entries())t[i++]=n;return t},i.setValues=function(e){let t=Array(e.size),i=0;for(let n of e.values())t[i++]=n;return t},i.MapWithCachedArrays=class{constructor(){this.map=new Map}clearCaches(){this.cachedKeys=void 0,this.cachedValues=void 0}get size(){return this.map.size}has(e){return this.map.has(e)}get(e){return this.map.get(e)}set(e,t){return this.map.set(e,t),this.clearCaches(),this}delete(e){let t=this.map.delete(e);return t&&this.clearCaches(),t}clear(){this.map.clear(),this.clearCaches()}keys(){return this.cachedKeys||(this.cachedKeys=l(this.map)),this.cachedKeys}values(){return this.cachedValues||(this.cachedValues=o(this.map)),this.cachedValues}},i.copyWitNewLength=function(e,t){n(t>=e.length,()=>`${t} < ${e.length}`);let i=Array(t);for(let t=0;t<e.length;t++)i[t]=e[t];return i},i.validateStringContainsBoolean=function(e){if(!e)return!1;switch(e.toLocaleLowerCase()){case"true":case"yes":case"1":return!0;case"false":case"no":case"0":return!1;default:return}},i.joinStrings=u,i.printHumanReadableList=function(e,{emptyValue:t,prefix:i,prefixPlural:n,lastSeparator:r,cutoff_output_length:a}){if(0===e.length)return null!=t?t:"";if(1==e.length)return i?i+" "+e[0]:e[0];let s=null!=a?a:100,{lastIdx:o}=e.reduce(({lastIdx:e,length:t},i)=>{let n=t+i.length;return n>s?{lastIdx:e,length:n}:{lastIdx:e+1,length:n}},{lastIdx:0,length:0}),l=e.slice(0,Math.max(1,o)),c=n?n+" ":i?i+" ":"";return l.length===e.length?c+u(l,", ",void 0,r):c+u(l,", ",void 0,", ")+", ..."},i.isDefined=e=>void 0!==e,i.removeArrayElement=function(e,t){let i=t.indexOf(e);return i>=0&&(t.splice(i,1),!0)},i.isNonEmptyArray=function(e){return e.length>0},i.findLast=function(e,t){for(let i=e.length-1;i>=0;i--){let n=e[i];if(t(n))return n}},i.mergeMapOrNull=function(e,t){return e?t?new Map([...e,...t]):e:t},i.composeSets=function(e,t){if(!e&&!t)return null;let i=new Set;return null==e||e.forEach(e=>i.add(e)),null==t||t.forEach(e=>i.add(e)),i},i.setsEqual=function(e,t){if(e===t||!e&&!t)return!0;if(!e||!t||e.size!==t.size)return!1;for(let i of e)if(!t.has(i))return!1;return!0}},408470,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.REMOVED_ERRORS=i.ERRORS=i.ERROR_CATEGORIES=i.withModifiedErrorNodes=i.withModifiedErrorMessage=i.errorCodeDef=i.errorCode=i.printErrors=i.printGraphQLErrorsOrRethrow=i.errorCauses=i.aggregateError=i.extractGraphQLErrorOptions=void 0;let n=e.r(186846),r=e.r(331484),a=(e,t,i=l)=>({code:e,description:t,metadata:i,err:(t,i)=>new n.GraphQLError(t,{...i,extensions:{...null==i?void 0:i.extensions,code:e}})});i.extractGraphQLErrorOptions=function(e){return{nodes:e.nodes,source:e.source,positions:e.positions,path:e.path,originalError:e.originalError,extensions:e.extensions}};class s extends n.GraphQLError{constructor(e,t,i,n){super(t+". Caused by:\n"+i.map(e=>e.toString()).join("\n\n"),{...n,extensions:{code:e}}),this.causes=i}toString(){let e=`[${this.extensions.code}] ${super.toString()}`;for(let t of(e+="\ncaused by:",this.causes))e+="\n\n - ",e+=t.toString().split("\n").join("\n ");return e}}function o(e){return e instanceof s?e.causes:e instanceof n.GraphQLError?[e]:void 0}i.aggregateError=function(e,t,i){return new s(e,t,i)},i.errorCauses=o,i.printGraphQLErrorsOrRethrow=function(e){let t=o(e);if(!t)throw e;return t.map(e=>e.toString()).join("\n\n")},i.printErrors=function(e){return e.map(e=>e.toString()).join("\n\n")};let l={addedIn:"2.0.0"},u=(e,t,i=l)=>({createCode:n=>a(e(n),t(n),i),get:t=>{let i=e2[e(t)];return(0,r.assert)(i,`Unexpected element: ${t}`),i}}),c=(e,t,i=l)=>u(t=>`${t.toLocaleUpperCase()}_${e}`,t,i);function d(e){if(e.extensions&&"code"in e.extensions)return e.extensions.code}i.errorCode=d,i.errorCodeDef=function(e){let t="string"==typeof e?e:d(e);return t?e2[t]:void 0},i.withModifiedErrorMessage=function(e,t){return new n.GraphQLError(t,{nodes:e.nodes,source:e.source,positions:e.positions,path:e.path,originalError:e.originalError,extensions:e.extensions})},i.withModifiedErrorNodes=function(e,t){return new n.GraphQLError(e.message,{nodes:t,source:e.source,positions:e.positions,path:e.path,originalError:e.originalError,extensions:e.extensions})};let p=a("INVALID_GRAPHQL","A schema is invalid GraphQL: it violates one of the rule of the specification."),h=a("DIRECTIVE_DEFINITION_INVALID","A built-in or federation directive has an invalid definition in the schema.",{...l,replaces:["TAG_DEFINITION_INVALID"]}),f=a("TYPE_DEFINITION_INVALID","A built-in or federation type has an invalid definition in the schema."),m=a("UNSUPPORTED_LINKED_FEATURE","Indicates that a feature used in a @link is either unsupported or is used with unsupported options."),y=a("UNKNOWN_FEDERATION_LINK_VERSION","The version of federation in a @link directive on the schema is unknown."),v=a("UNKNOWN_LINK_VERSION","The version of @link set on the schema is unknown.",{addedIn:"2.1.0"}),g=c("FIELDS_HAS_ARGS",e=>`The \`fields\` argument of a \`@${e}\` directive includes a field defined with arguments (which is not currently supported).`),T=g.createCode("key"),S=g.createCode("provides"),E=c("FIELDS_MISSING_EXTERNAL",e=>`The \`fields\` argument of a \`@${e}\` directive includes a field that is not marked as \`@external\`.`,{addedIn:"0.x"}),I=E.createCode("provides"),b=E.createCode("requires"),N=c("UNSUPPORTED_ON_INTERFACE",e=>`A \`@${e}\` directive is used on an interface, which is ${"key"===e?"only supported when @linking to federation 2.3+":"not (yet) supported"}.`),_=N.createCode("key"),D=N.createCode("provides"),A=N.createCode("requires"),O=c("DIRECTIVE_IN_FIELDS_ARG",e=>`The \`fields\` argument of a \`@${e}\` directive includes some directive applications. This is not supported`,{addedIn:"2.1.0"}),R=O.createCode("key"),w=O.createCode("provides"),L=O.createCode("requires"),C=a("EXTERNAL_UNUSED","An `@external` field is not being used by any instance of `@key`, `@requires`, `@provides` or to satisfy an interface implementation.",{addedIn:"0.x"}),F=a("TYPE_WITH_ONLY_UNUSED_EXTERNAL",`A federation 1 schema has a composite type comprised only of unused external fields. Note that this error can _only_ be raised for federation 1 schema as federation 2 schema do not allow unused external fields (and errors with code ${C.code} will be raised in that case). But when federation 1 schema are automatically migrated to federation 2 ones, unused external fields are automatically removed, and in rare case this can leave a type empty. If that happens, an error with this code will be raised`),k=a("PROVIDES_ON_NON_OBJECT_FIELD","A `@provides` directive is used to mark a field whose base type is not an object type."),P=c("INVALID_FIELDS_TYPE",e=>`The value passed to the \`fields\` argument of a \`@${e}\` directive is not a string.`),x=P.createCode("key"),M=P.createCode("provides"),U=P.createCode("requires"),$=c("INVALID_FIELDS",e=>`The \`fields\` argument of a \`@${e}\` directive is invalid (it has invalid syntax, includes unknown fields, ...).`),j=$.createCode("key"),V=$.createCode("provides"),G=$.createCode("requires"),B=a("KEY_FIELDS_SELECT_INVALID_TYPE","The `fields` argument of `@key` directive includes a field whose type is a list, interface, or union type. Fields of these types cannot be part of a `@key`",{addedIn:"0.x"}),K=u(e=>`ROOT_${e.toLocaleUpperCase()}_USED`,e=>`A subgraph's schema defines a type with the name \`${e}\`, while also specifying a _different_ type name as the root query object. This is not allowed.`,{addedIn:"0.x"}),Q=K.createCode("query"),q=K.createCode("mutation"),H=K.createCode("subscription"),J=a("INVALID_SUBGRAPH_NAME",'A subgraph name is invalid (subgraph names cannot be a single underscore ("_")).'),W=a("NO_QUERIES","None of the composed subgraphs expose any query."),Y=a("INTERFACE_FIELD_NO_IMPLEM","After subgraph merging, an implementation is missing a field of one of the interface it implements (which can happen for valid subgraphs)."),z=a("TYPE_KIND_MISMATCH","A type has the same name in different subgraphs, but a different kind. For instance, one definition is an object type but another is an interface.",{...l,replaces:["VALUE_TYPE_KIND_MISMATCH","EXTENSION_OF_WRONG_KIND","ENUM_MISMATCH_TYPE"]}),X=a("CONTEXT_NOT_SET","Context is never set for context trying to be used.",{addedIn:"2.8.0"}),Z=a("CONTEXT_INVALID_SELECTION","Selection within @fromContext must resolve to a single field.",{addedIn:"2.8.0"}),ee=a("NO_CONTEXT_IN_SELECTION","Selection in @fromContext field argument does not reference a context.",{addedIn:"2.8.0"}),et=a("CONTEXT_NO_RESOLVABLE_KEY","If an ObjectType uses a @fromContext, at least one of its keys must be resolvable.",{addedIn:"2.8.0"}),ei=a("CONTEXT_NAME_INVALID","Context name is invalid.",{addedIn:"2.8.0"}),en=a("EXTERNAL_TYPE_MISMATCH","An `@external` field has a type that is incompatible with the declaration(s) of that field in other subgraphs.",{addedIn:"0.x"}),er=a("EXTERNAL_COLLISION_WITH_ANOTHER_DIRECTIVE","The @external directive collides with other directives in some situations.",{addedIn:"2.1.0"}),ea=a("EXTERNAL_ARGUMENT_MISSING","An `@external` field is missing some arguments present in the declaration(s) of that field in other subgraphs."),es=a("EXTERNAL_ARGUMENT_TYPE_MISMATCH","An `@external` field declares an argument with a type that is incompatible with the corresponding argument in the declaration(s) of that field in other subgraphs."),eo=a("EXTERNAL_ARGUMENT_DEFAULT_MISMATCH","An `@external` field declares an argument with a default that is incompatible with the corresponding argument in the declaration(s) of that field in other subgraphs."),el=a("EXTERNAL_ON_INTERFACE",'The field of an interface type is marked with `@external`: as external is about marking field not resolved by the subgraph and as interface field are not resolved (only implementations of those fields are), an "external" interface field is nonsensical'),eu=a("MERGED_DIRECTIVE_APPLICATION_ON_EXTERNAL","In a subgraph, a field is both marked @external and has a merged directive applied to it"),ec=a("FIELD_TYPE_MISMATCH","A field has a type that is incompatible with other declarations of that field in other subgraphs.",{...l,replaces:["VALUE_TYPE_FIELD_TYPE_MISMATCH"]}),ed=a("FIELD_ARGUMENT_TYPE_MISMATCH","An argument (of a field/directive) has a type that is incompatible with that of other declarations of that same argument in other subgraphs.",{...l,replaces:["VALUE_TYPE_INPUT_VALUE_MISMATCH"]}),ep=a("INPUT_FIELD_DEFAULT_MISMATCH","An input field has a default value that is incompatible with other declarations of that field in other subgraphs."),eh=a("FIELD_ARGUMENT_DEFAULT_MISMATCH","An argument (of a field/directive) has a default value that is incompatible with that of other declarations of that same argument in other subgraphs."),ef=a("EXTENSION_WITH_NO_BASE","A subgraph is attempting to `extend` a type that is not originally defined in any known subgraph.",{addedIn:"0.x"}),em=a("EXTERNAL_MISSING_ON_BASE","A field is marked as `@external` in a subgraph but with no non-external declaration in any other subgraph.",{addedIn:"0.x"}),ey=a("INVALID_FIELD_SHARING","A field that is non-shareable in at least one subgraph is resolved by multiple subgraphs."),ev=a("INVALID_SHAREABLE_USAGE","The `@shareable` federation directive is used in an invalid way.",{addedIn:"2.1.2"}),eg=a("INVALID_LINK_DIRECTIVE_USAGE","An application of the @link directive is invalid/does not respect the specification."),eT=a("INVALID_LINK_IDENTIFIER","A url/version for a @link feature is invalid/does not respect the specification.",{addedIn:"2.1.0"}),eS=a("LINK_IMPORT_NAME_MISMATCH","The import name for a merged directive (as declared by the relevant `@link(import:)` argument) is inconsistent between subgraphs."),eE=a("REFERENCED_INACCESSIBLE","An element is marked as @inaccessible but is referenced by an element visible in the API schema."),eI=a("DEFAULT_VALUE_USES_INACCESSIBLE","An element is marked as @inaccessible but is used in the default value of an element visible in the API schema."),eb=a("QUERY_ROOT_TYPE_INACCESSIBLE","An element is marked as @inaccessible but is the query root type, which must be visible in the API schema."),eN=a("REQUIRED_INACCESSIBLE","An element is marked as @inaccessible but is required by an element visible in the API schema."),e_=a("IMPLEMENTED_BY_INACCESSIBLE","An element is marked as @inaccessible but implements an element visible in the API schema."),eD=a("DISALLOWED_INACCESSIBLE","An element is marked as @inaccessible that is not allowed to be @inaccessible."),eA=a("ONLY_INACCESSIBLE_CHILDREN","A type visible in the API schema has only @inaccessible children."),eO=a("REQUIRED_INPUT_FIELD_MISSING_IN_SOME_SUBGRAPH","A field of an input object type is mandatory in some subgraphs, but the field is not defined in all the subgraphs that define the input object type."),eR=a("REQUIRED_ARGUMENT_MISSING_IN_SOME_SUBGRAPH","An argument of a field or directive definition is mandatory in some subgraphs, but the argument is not defined in all the subgraphs that define the field or directive definition."),ew=a("EMPTY_MERGED_INPUT_TYPE","An input object type has no field common to all the subgraphs that define the type. Merging that type would result in an invalid empty input object type."),eL=a("ENUM_VALUE_MISMATCH","An enum type that is used as both an input and output type has a value that is not defined in all the subgraphs that define the enum type."),eC=a("EMPTY_MERGED_ENUM_TYPE","An enum type has no value common to all the subgraphs that define the type. Merging that type would result in an invalid empty enum type."),eF=a("SHAREABLE_HAS_MISMATCHED_RUNTIME_TYPES","A shareable field return type has mismatched possible runtime types in the subgraphs in which the field is declared. As shared fields must resolve the same way in all subgraphs, this is almost surely a mistake."),ek=a("SATISFIABILITY_ERROR","Subgraphs can be merged, but the resulting supergraph API would have queries that cannot be satisfied by those subgraphs."),eP=a("OVERRIDE_FROM_SELF_ERROR",'Field with `@override` directive has "from" location that references its own subgraph.'),ex=a("OVERRIDE_SOURCE_HAS_OVERRIDE","Field which is overridden to another subgraph is also marked @override."),eM=a("OVERRIDE_COLLISION_WITH_ANOTHER_DIRECTIVE","The @override directive cannot be used on external fields, nor to override fields with either @external, @provides, or @requires."),eU=a("OVERRIDE_ON_INTERFACE","The @override directive cannot be used on the fields of an interface type.",{addedIn:"2.3.0"}),e$=a("OVERRIDE_LABEL_INVALID","The @override directive `label` argument must match the pattern /^[a-zA-Z][a-zA-Z0-9_-:./]*$/ or /^percent((d{1,2}(.d{1,8})?|100))$/",{addedIn:"2.7.0"}),ej=a("UNSUPPORTED_FEATURE","Indicates an error due to feature currently unsupported by federation.",{addedIn:"2.1.0"}),eV=a("INVALID_FEDERATION_SUPERGRAPH","Indicates that a schema provided for an Apollo Federation supergraph is not a valid supergraph schema.",{addedIn:"2.1.0"}),eG=a("DOWNSTREAM_SERVICE_ERROR","Indicates an error in a subgraph service query during query execution in a federated service.",{addedIn:"0.x"}),eB=a("DIRECTIVE_COMPOSITION_ERROR","Error when composing custom directives.",{addedIn:"2.1.0"}),eK=a("INTERFACE_OBJECT_USAGE_ERROR","Error in the usage of the @interfaceObject directive.",{addedIn:"2.3.0"}),eQ=a("INTERFACE_KEY_NOT_ON_IMPLEMENTATION","A `@key` is defined on an interface type, but is not defined (or is not resolvable) on at least one of the interface implementations",{addedIn:"2.3.0"}),eq=a("INTERFACE_KEY_MISSING_IMPLEMENTATION_TYPE","A subgraph has a `@key` on an interface type, but that subgraph does not define an implementation (in the supergraph) of that interface",{addedIn:"2.3.0"}),eH=a("CONTEXTUAL_ARGUMENT_NOT_CONTEXTUAL_IN_ALL_SUBGRAPHS","Argument on field is marked contextual in only some subgraphs",{addedIn:"2.7.0"}),eJ=a("COST_APPLIED_TO_INTERFACE_FIELD","The `@cost` directive must be applied to concrete types",{addedIn:"2.9.2"}),eW=a("LIST_SIZE_APPLIED_TO_NON_LIST","The `@listSize` directive must be applied to list types",{addedIn:"2.9.2"}),eY=a("LIST_SIZE_INVALID_ASSUMED_SIZE","The `@listSize` directive assumed size cannot be negative",{addedIn:"2.9.2"}),ez=a("LIST_SIZE_INVALID_SLICING_ARGUMENT","The `@listSize` directive must have existing integer slicing arguments",{addedIn:"2.9.2"}),eX=a("LIST_SIZE_INVALID_SIZED_FIELD","The `@listSize` directive must reference existing list fields as sized fields",{addedIn:"2.9.2"}),eZ=a("MAX_VALIDATION_SUBGRAPH_PATHS_EXCEEDED","The maximum number of validation subgraph paths has been exceeded.",{addedIn:"2.8.0"}),e0=a("AUTH_REQUIREMENTS_APPLIED_ON_INTERFACE","The @authenticated, @requiresScopes and @policy directive cannot be applied on interface, interface fields and interface object",{addedIn:"2.9.4"}),e1=a("MISSING_TRANSITIVE_AUTH_REQUIREMENTS","Field missing transitive @authenticated, @requiresScopes and/or @policy auth requirements needed to access dependent data.",{addedIn:"2.9.4"});i.ERROR_CATEGORIES={DIRECTIVE_FIELDS_MISSING_EXTERNAL:E,DIRECTIVE_UNSUPPORTED_ON_INTERFACE:N,DIRECTIVE_INVALID_FIELDS_TYPE:P,DIRECTIVE_INVALID_FIELDS:$,FIELDS_HAS_ARGS:g,ROOT_TYPE_USED:K,DIRECTIVE_IN_FIELDS_ARG:O},i.ERRORS={INVALID_GRAPHQL:p,DIRECTIVE_DEFINITION_INVALID:h,TYPE_DEFINITION_INVALID:f,UNSUPPORTED_LINKED_FEATURE:m,UNKNOWN_FEDERATION_LINK_VERSION:y,UNKNOWN_LINK_VERSION:v,KEY_FIELDS_HAS_ARGS:T,PROVIDES_FIELDS_HAS_ARGS:S,PROVIDES_MISSING_EXTERNAL:I,REQUIRES_MISSING_EXTERNAL:b,KEY_UNSUPPORTED_ON_INTERFACE:_,PROVIDES_UNSUPPORTED_ON_INTERFACE:D,REQUIRES_UNSUPPORTED_ON_INTERFACE:A,EXTERNAL_UNUSED:C,EXTERNAL_COLLISION_WITH_ANOTHER_DIRECTIVE:er,TYPE_WITH_ONLY_UNUSED_EXTERNAL:F,PROVIDES_ON_NON_OBJECT_FIELD:k,KEY_INVALID_FIELDS_TYPE:x,PROVIDES_INVALID_FIELDS_TYPE:M,REQUIRES_INVALID_FIELDS_TYPE:U,KEY_INVALID_FIELDS:j,PROVIDES_INVALID_FIELDS:V,REQUIRES_INVALID_FIELDS:G,KEY_FIELDS_SELECT_INVALID_TYPE:B,ROOT_QUERY_USED:Q,ROOT_MUTATION_USED:q,ROOT_SUBSCRIPTION_USED:H,INVALID_SUBGRAPH_NAME:J,NO_QUERIES:W,INTERFACE_FIELD_NO_IMPLEM:Y,TYPE_KIND_MISMATCH:z,CONTEXT_NOT_SET:X,CONTEXT_INVALID_SELECTION:Z,NO_CONTEXT_IN_SELECTION:ee,CONTEXT_NO_RESOLVABLE_KEY:et,CONTEXT_NAME_INVALID:ei,EXTERNAL_TYPE_MISMATCH:en,EXTERNAL_ARGUMENT_MISSING:ea,EXTERNAL_ARGUMENT_TYPE_MISMATCH:es,EXTERNAL_ARGUMENT_DEFAULT_MISMATCH:eo,EXTERNAL_ON_INTERFACE:el,MERGED_DIRECTIVE_APPLICATION_ON_EXTERNAL:eu,FIELD_TYPE_MISMATCH:ec,ARGUMENT_TYPE_MISMATCH:ed,INPUT_FIELD_DEFAULT_MISMATCH:ep,ARGUMENT_DEFAULT_MISMATCH:eh,EXTENSION_WITH_NO_BASE:ef,EXTERNAL_MISSING_ON_BASE:em,INVALID_FIELD_SHARING:ey,INVALID_SHAREABLE_USAGE:ev,INVALID_LINK_DIRECTIVE_USAGE:eg,INVALID_LINK_IDENTIFIER:eT,LINK_IMPORT_NAME_MISMATCH:eS,REFERENCED_INACCESSIBLE:eE,DEFAULT_VALUE_USES_INACCESSIBLE:eI,QUERY_ROOT_TYPE_INACCESSIBLE:eb,REQUIRED_INACCESSIBLE:eN,DISALLOWED_INACCESSIBLE:eD,IMPLEMENTED_BY_INACCESSIBLE:e_,ONLY_INACCESSIBLE_CHILDREN:eA,REQUIRED_ARGUMENT_MISSING_IN_SOME_SUBGRAPH:eR,REQUIRED_INPUT_FIELD_MISSING_IN_SOME_SUBGRAPH:eO,EMPTY_MERGED_INPUT_TYPE:ew,ENUM_VALUE_MISMATCH:eL,EMPTY_MERGED_ENUM_TYPE:eC,SHAREABLE_HAS_MISMATCHED_RUNTIME_TYPES:eF,SATISFIABILITY_ERROR:ek,OVERRIDE_COLLISION_WITH_ANOTHER_DIRECTIVE:eM,OVERRIDE_FROM_SELF_ERROR:eP,OVERRIDE_SOURCE_HAS_OVERRIDE:ex,OVERRIDE_ON_INTERFACE:eU,OVERRIDE_LABEL_INVALID:e$,UNSUPPORTED_FEATURE:ej,INVALID_FEDERATION_SUPERGRAPH:eV,DOWNSTREAM_SERVICE_ERROR:eG,KEY_HAS_DIRECTIVE_IN_FIELDS_ARGS:R,PROVIDES_HAS_DIRECTIVE_IN_FIELDS_ARGS:w,REQUIRES_HAS_DIRECTIVE_IN_FIELDS_ARGS:L,DIRECTIVE_COMPOSITION_ERROR:eB,INTERFACE_OBJECT_USAGE_ERROR:eK,INTERFACE_KEY_NOT_ON_IMPLEMENTATION:eQ,INTERFACE_KEY_MISSING_IMPLEMENTATION_TYPE:eq,CONTEXTUAL_ARGUMENT_NOT_CONTEXTUAL_IN_ALL_SUBGRAPHS:eH,COST_APPLIED_TO_INTERFACE_FIELD:eJ,LIST_SIZE_APPLIED_TO_NON_LIST:eW,LIST_SIZE_INVALID_ASSUMED_SIZE:eY,LIST_SIZE_INVALID_SIZED_FIELD:eX,LIST_SIZE_INVALID_SLICING_ARGUMENT:ez,MAX_VALIDATION_SUBGRAPH_PATHS_EXCEEDED:eZ,AUTH_REQUIREMENTS_APPLIED_ON_INTERFACE:e0,MISSING_TRANSITIVE_AUTH_REQUIREMENTS:e1};let e2=Object.values(i.ERRORS).reduce((e,t)=>(e[t.code]=t,e),{});i.REMOVED_ERRORS=[["KEY_FIELDS_MISSING_ON_BASE","Keys can now use any field from any other subgraph."],["KEY_FIELDS_MISSING_EXTERNAL","Using `@external` for key fields is now discouraged, unless the field is truly meant to be external."],["KEY_MISSING_ON_BASE","Each subgraph is now free to declare a key only if it needs it."],["MULTIPLE_KEYS_ON_EXTENSION","Every subgraph can have multiple keys, as necessary."],["KEY_NOT_SPECIFIED","Each subgraph can declare key independently of any other subgraph."],["EXTERNAL_USED_ON_BASE","As there is not type ownership anymore, there is also no particular limitation as to where a field can be external."],["PROVIDES_NOT_ON_ENTITY","@provides can now be used on any type."],["REQUIRES_FIELDS_MISSING_ON_BASE","Fields in @requires can now be from any subgraph."],["REQUIRES_USED_ON_BASE","As there is not type ownership anymore, there is also no particular limitation as to which subgraph can use a @requires."],["DUPLICATE_SCALAR_DEFINITION","As duplicate scalar definitions is invalid GraphQL, this will now be an error with code `INVALID_GRAPHQL`."],["DUPLICATE_ENUM_DEFINITION","As duplicate enum definitions is invalid GraphQL, this will now be an error with code `INVALID_GRAPHQL`."],["DUPLICATE_ENUM_VALUE","As duplicate enum values is invalid GraphQL, this will now be an error with code `INVALID_GRAPHQL`."],["ENUM_MISMATCH","Subgraph definitions for an enum are now merged by composition."],["VALUE_TYPE_NO_ENTITY","There is no strong different between entity and value types in the model (they are just usage pattern) and a type can have keys in one subgraph but not another."],["VALUE_TYPE_UNION_TYPES_MISMATCH","Subgraph definitions for an union are now merged by composition."],["PROVIDES_FIELDS_SELECT_INVALID_TYPE","@provides can now be used on field of interface, union and list types."],["RESERVED_FIELD_USED","This error was previously not correctly enforced: the _service and _entities, if present, were overridden; this is still the case."],["NON_REPEATABLE_DIRECTIVE_ARGUMENTS_MISMATCH","Since federation 2.1.0, the case this error used to cover is now a warning (with code `INCONSISTENT_NON_REPEATABLE_DIRECTIVE_ARGUMENTS`) instead of an error."],["REQUIRES_FIELDS_HAS_ARGS","Since federation 2.1.1, using fields with arguments in a @requires is fully supported."],["INTERFACE_FIELD_IMPLEM_TYPE_MISMATCH","This error was thrown by a validation introduced to avoid running into a known runtime bug. Since federation 2.3, the underlying runtime bug has been addressed and the validation/limitation was no longer necessary and has been removed."]]},990620,(e,t,i)=>{"use strict";t.exports=function(){function e(e,t,i,n,r){return e<t||i<t?e>i?i+1:e+1:n===r?t:t+1}return function(t,i){if(t===i)return 0;if(t.length>i.length){var n,r,a,s,o,l,u,c,d,p,h,f,m=t;t=i,i=m}for(var y=t.length,v=i.length;y>0&&t.charCodeAt(y-1)===i.charCodeAt(v-1);)y--,v--;for(var g=0;g<y&&t.charCodeAt(g)===i.charCodeAt(g);)g++;if(y-=g,v-=g,0===y||v<3)return v;var T=0,S=[];for(n=0;n<y;n++)S.push(n+1),S.push(t.charCodeAt(g+n));for(var E=S.length-1;T<v-3;)for(n=0,d=i.charCodeAt(g+(r=T)),p=i.charCodeAt(g+(a=T+1)),h=i.charCodeAt(g+(s=T+2)),f=i.charCodeAt(g+(o=T+3)),l=T+=4;n<E;n+=2)r=e(u=S[n],r,a,d,c=S[n+1]),a=e(r,a,s,p,c),s=e(a,s,o,h,c),l=e(s,o,l,f,c),S[n]=l,o=s,s=a,a=r,r=u;for(;T<v;)for(n=0,d=i.charCodeAt(g+(r=T)),l=++T;n<E;n+=2)u=S[n],S[n]=l=e(u,r,l,d,S[n+1]),r=u;return l}}()},308126,(e,t,i)=>{"use strict";var n=e.e&&e.e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(i,"__esModule",{value:!0}),i.didYouMean=i.suggestionList=void 0;let r=n(e.r(990620)),a=e.r(331484);i.suggestionList=function(e,t){let i=new Map,n=Math.floor(.4*e.length)+1,s=e.toLowerCase();for(let a of t){let t=s===a.toLowerCase()?1:(0,r.default)(e,a);t<=n&&i.set(a,t)}return(0,a.mapKeys)(i).sort((e,t)=>{let n=i.get(e)-i.get(t);return 0!==n?n:e.localeCompare(t)})},i.didYouMean=function(e){let t=" Did you mean ",i=e.map(e=>`"${e}"`);switch(e.length){case 0:return"";case 1:return t+i[0]+"?";case 2:return t+i[0]+" or "+i[1]+"?"}let n=i.slice(0,5),r=n.pop();return t+n.join(", ")+", or "+r+"?"}},367356,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.collectVariablesInValue=i.argumentsFromAST=i.isValidLeafValue=i.valueFromASTUntyped=i.valueFromAST=i.isValidValueApplication=i.isValidValue=i.valueToAST=i.valueNodeToConstValueNode=i.withDefaultValues=i.argumentsEquals=i.valueEquals=i.valueToString=void 0;let n=e.r(168032),r=e.r(186846),a=e.r(308126),s=e.r(224361),o=e.r(678270),l=e.r(331484),u=e.r(408470);function c(e,t){if(null==e)return"null";if(t&&(0,n.isNonNullType)(t))return c(e,t.ofType);if(t&&(0,n.isCustomScalarType)(t)&&(t=void 0),(0,n.isVariable)(e))return e.toString();if(Array.isArray(e)){let i;return t&&(0,n.isListType)(t)&&(i=t.ofType),"["+e.map(e=>c(e,i)).join(", ")+"]"}if(t&&(0,n.isListType)(t))return c(e,t.ofType);if("object"==typeof e)return t&&!(0,n.isInputObjectType)(t)&&(t=void 0),"{"+Object.keys(e).map(i=>{var n;let r=t?null==(n=t.field(i))?void 0:n.type:void 0;return`${i}: ${c(e[i],r)}`}).join(", ")+"}";if("string"==typeof e){if(t){if((0,n.isEnumType)(t))return t.value(e)?e:JSON.stringify(e);if(t===t.schema().idType()&&m.test(e))return e}return JSON.stringify(e)}return String(e)}function d(e,t){return e===t||(Array.isArray(e)?Array.isArray(t)&&function(e,t){if(e.length!==t.length)return!1;for(let i=0;i<e.length;++i)if(!d(e[i],t[i]))return!1;return!0}(e,t):null!==e&&"object"==typeof e?null!==t&&"object"==typeof t&&p(e,t):e===t)}function p(e,t){let i=Object.keys(e),n=Object.keys(t);if(i.length!=n.length)return!1;for(let r of i){let i=e[r],a=t[r];if(void 0===a&&!n.includes(r)||!d(i,a))return!1}return!0}function h(e){return Error(e)}function f(e,t){if((0,n.isVariable)(e))return e;if(null===e){if((0,n.isNonNullType)(t))throw u.ERRORS.INVALID_GRAPHQL.err(`Invalid null value for non-null type ${t} while computing default values`);return null}if((0,n.isNonNullType)(t))return f(e,t.ofType);if((0,n.isListType)(t))if(Array.isArray(e))return e.map(e=>f(e,t.ofType));else return f(e,t.ofType);if((0,n.isInputObjectType)(t)){if("object"!=typeof e)throw u.ERRORS.INVALID_GRAPHQL.err(`Expected value for type ${t} to be an object, but is ${typeof e}.`);let i=Object.create(null);for(let r of t.fields()){if(!r.type)throw h(`Cannot compute default value for field ${r.name} of ${t} as the field type is undefined`);let a=e[r.name];if(void 0===a)if(void 0!==r.defaultValue)i[r.name]=f(r.defaultValue,r.type);else if((0,n.isNonNullType)(r.type))throw u.ERRORS.INVALID_GRAPHQL.err(`Required field "${r.name}" of type ${t} was not provided.`);else i[r.name]=null;else i[r.name]=f(a,r.type)}for(let i of Object.keys(e))if(!t.field(i)){let e=(0,a.suggestionList)(i,t.fields().map(e=>e.name));throw u.ERRORS.INVALID_GRAPHQL.err(`Field "${i}" is not defined by type "${t}".`+(0,a.didYouMean)(e))}return i}return e}i.valueToString=c,i.valueEquals=d,i.argumentsEquals=function(e,t){return e===t||p(e,t)},i.withDefaultValues=function(e,t){if(!t.type)throw h(`Cannot compute default value for argument ${t} as the type is undefined`);if(void 0===e)if(void 0!==t.defaultValue)return f(t.defaultValue,t.type);else if(!(0,n.isNonNullType)(t.type))return null;else throw u.ERRORS.INVALID_GRAPHQL.err(`Required argument "${t.coordinate}" was not provided.`);return f(e,t.type)};let m=/^-?(?:0|[1-9][0-9]*)$/;function y(e,t){return(0,n.isNonNullType)(t)?!!(0,n.isNonNullType)(e)&&y(e.ofType,t.ofType):(0,n.isNonNullType)(e)?y(e.ofType,t):(0,n.isListType)(t)?!!(0,n.isListType)(e)&&y(e.ofType,t.ofType):!(0,n.isListType)(e)&&(0,o.sameType)(e,t)}function v(e,t,i,r){if((0,n.isVariable)(e)){var a,s,o;let l,u=r.definition(e);return!!u&&(a=u,s=t,o=i,l=a.type,(0,n.isNonNullType)(s)&&!(0,n.isNonNullType)(l)?(void 0!==a.defaultValue&&null!==a.defaultValue||void 0!==o)&&y(l,s.ofType):y(l,s))}if((0,n.isNonNullType)(t))return null!==e&&v(e,t.ofType,void 0,r);if(null==e)return!0;if((0,n.isListType)(t)){let n=t.ofType;return Array.isArray(e)?e.every(e=>v(e,n,void 0,r)):v(e,n,i,r)}if((0,n.isInputObjectType)(t)){if("object"!=typeof e)return!1;let i=new Set(Object.keys(e)),n=t.fields().every(t=>(i.delete(t.name),v(e[t.name],t.type,t.defaultValue,r))),a=0!==i.size;return n&&!a}return S(t.schema(),e,t)}function g(e,t){if(e.kind===r.Kind.NULL){if((0,n.isNonNullType)(t))throw u.ERRORS.INVALID_GRAPHQL.err(`Invalid null value for non-null type "${t}"`);return null}if(e.kind===r.Kind.VARIABLE)return new n.Variable(e.name.value);if((0,n.isNonNullType)(t)&&(t=t.ofType),(0,n.isListType)(t)){let i=t.ofType;return e.kind===r.Kind.LIST?e.values.map(e=>g(e,i)):[g(e,i)]}if((0,n.isIntType)(t)){if(e.kind!==r.Kind.INT)throw u.ERRORS.INVALID_GRAPHQL.err(`Int cannot represent non-integer value ${(0,r.print)(e)}.`);let t=parseInt(e.value,10);if(t>0x7fffffff||t<-0x80000000)throw u.ERRORS.INVALID_GRAPHQL.err(`Int cannot represent non 32-bit signed integer value ${t}.`);return t}if((0,n.isFloatType)(t)){let t;if(e.kind===r.Kind.INT)t=parseInt(e.value,10);else if(e.kind===r.Kind.FLOAT)t=parseFloat(e.value);else throw u.ERRORS.INVALID_GRAPHQL.err(`Float can only represent integer or float value, but got a ${e.kind}.`);if(!isFinite(t))throw u.ERRORS.INVALID_GRAPHQL.err(`Float cannot represent non numeric value ${t}.`);return t}if((0,n.isBooleanType)(t)){if(e.kind!==r.Kind.BOOLEAN)throw u.ERRORS.INVALID_GRAPHQL.err(`Boolean cannot represent a non boolean value ${(0,r.print)(e)}.`);return e.value}if((0,n.isStringType)(t)){if(e.kind!==r.Kind.STRING)throw u.ERRORS.INVALID_GRAPHQL.err(`String cannot represent non string value ${(0,r.print)(e)}.`);return e.value}if((0,n.isIDType)(t)){if(e.kind!==r.Kind.STRING&&e.kind!==r.Kind.INT)throw u.ERRORS.INVALID_GRAPHQL.err(`ID cannot represent value ${(0,r.print)(e)}.`);return e.value}if((0,n.isScalarType)(t))return T(e);if((0,n.isInputObjectType)(t)){if(e.kind!==r.Kind.OBJECT)throw u.ERRORS.INVALID_GRAPHQL.err(`Input Object Type ${t} cannot represent non-object value ${(0,r.print)(e)}.`);let i=Object.create(null);for(let n of e.fields){let e=n.name.value,r=t.field(e);if(!r)throw u.ERRORS.INVALID_GRAPHQL.err(`Unknown field "${e}" found in value for Input Object Type "${t}".`);i[e]=g(n.value,r.type)}return i}if((0,n.isEnumType)(t)){if(e.kind!==r.Kind.STRING&&e.kind!==r.Kind.ENUM)throw u.ERRORS.INVALID_GRAPHQL.err(`Enum Type ${t} cannot represent value ${(0,r.print)(e)}.`);if(!t.value(e.value))throw u.ERRORS.INVALID_GRAPHQL.err(`Enum Type ${t} has no value ${e.value}.`);return e.value}(0,l.assert)(!1,()=>`Unexpected input type ${t} of kind ${t.kind}.`)}function T(e){switch(e.kind){case r.Kind.NULL:return null;case r.Kind.INT:return parseInt(e.value,10);case r.Kind.FLOAT:return parseFloat(e.value);case r.Kind.STRING:case r.Kind.ENUM:case r.Kind.BOOLEAN:return e.value;case r.Kind.LIST:return e.values.map(T);case r.Kind.OBJECT:let t=Object.create(null);return e.fields.forEach(e=>t[e.name.value]=T(e.value)),t;case r.Kind.VARIABLE:return new n.Variable(e.name.value)}}function S(e,t,i){if((0,n.isCustomScalarType)(i))return!0;if("boolean"==typeof t)return i===e.booleanType();if("number"==typeof t&&isFinite(t)){let n=String(t);return i===e.intType()||i===e.idType()?m.test(n):i===e.floatType()}return"string"==typeof t&&((0,n.isEnumType)(i)?void 0!==i.value(t):i!==e.booleanType()&&i!==e.intType()&&i!==e.floatType())}i.valueNodeToConstValueNode=function e(t){if(t.kind===r.Kind.NULL||t.kind===r.Kind.INT||t.kind===r.Kind.FLOAT||t.kind===r.Kind.STRING||t.kind===r.Kind.BOOLEAN||t.kind===r.Kind.ENUM)return t;if(t.kind===r.Kind.LIST){let i=t.values.map(t=>e(t));return{...t,values:i}}if(t.kind===r.Kind.OBJECT){let i=t.fields.map(t=>({...t,value:e(t.value)}));return{...t,fields:i}}if(t.kind===r.Kind.VARIABLE)throw Error("Unexpected VariableNode in const AST");(0,l.assertUnreachable)(t)},i.valueToAST=function e(t,i){if(void 0!==t){if((0,n.isNonNullType)(i)){let n=e(t,i.ofType);if((null==n?void 0:n.kind)===r.Kind.NULL)throw h(`Invalid null value ${c(t)} for non-null type ${i}`);return n}if(null===t)return{kind:r.Kind.NULL};if((0,n.isVariable)(t))return{kind:r.Kind.VARIABLE,name:{kind:r.Kind.NAME,value:t.name}};if((0,n.isCustomScalarType)(i))return function e(t){if(void 0!==t){if(null===t)return{kind:r.Kind.NULL};if((0,n.isVariable)(t))return{kind:r.Kind.VARIABLE,name:{kind:r.Kind.NAME,value:t.name}};if(Array.isArray(t)){let i=[];for(let n of t){let t=e(n);void 0!==t&&i.push(t)}return{kind:r.Kind.LIST,values:i}}if("object"==typeof t){let i=[];for(let n of Object.keys(t)){let a=e(t[n]);a&&i.push({kind:r.Kind.OBJECT_FIELD,name:{kind:r.Kind.NAME,value:n},value:a})}return{kind:r.Kind.OBJECT,fields:i}}if("boolean"==typeof t)return{kind:r.Kind.BOOLEAN,value:t};if("number"==typeof t&&isFinite(t)){let e=String(t);return m.test(e)?{kind:r.Kind.INT,value:e}:{kind:r.Kind.FLOAT,value:e}}if("string"==typeof t)return{kind:r.Kind.STRING,value:t};throw h(`Invalid value, cannot be converted to AST: ${(0,s.inspect)(t,!0,10,!0)}`)}}(t);if((0,n.isListType)(i)){let n=i.ofType,a=Array.from(t);if(null!=a){let t=[];for(let i of a){let r=e(i,n);null!=r&&t.push(r)}return{kind:r.Kind.LIST,values:t}}return e(t,n)}if((0,n.isInputObjectType)(i)){if("object"!=typeof t)throw h(`Invalid non-objet value for input type ${i}, cannot be converted to AST: ${(0,s.inspect)(t,!0,10,!0)}`);let n=[];for(let a of i.fields()){if(!a.type)throw h(`Cannot convert value ${c(t)} as field ${a} has no type set`);let i=e(t[a.name],a.type);i&&n.push({kind:r.Kind.OBJECT_FIELD,name:{kind:r.Kind.NAME,value:a.name},value:i})}return{kind:r.Kind.OBJECT,fields:n}}if("boolean"==typeof t)return{kind:r.Kind.BOOLEAN,value:t};if("number"==typeof t&&isFinite(t)){let e=String(t);return m.test(e)?{kind:r.Kind.INT,value:e}:{kind:r.Kind.FLOAT,value:e}}if("string"==typeof t)return(0,n.isEnumType)(i)?{kind:r.Kind.ENUM,value:t}:i===i.schema().idType()&&m.test(t)?{kind:r.Kind.INT,value:t}:{kind:r.Kind.STRING,value:t};throw h(`Invalid value for type ${i}, cannot be converted to AST: ${(0,s.inspect)(t)}`)}},i.isValidValue=function(e,t,i){return v(e,t.type,t.defaultValue,i)},i.isValidValueApplication=v,i.valueFromAST=g,i.valueFromASTUntyped=T,i.isValidLeafValue=S,i.argumentsFromAST=function(e,t,i){var n;if(!t||0===t.length)return;let a=Object.create(null);for(let s of t){let t=s.name.value,o=null==(n=i.argument(t))?void 0:n.type;if(!o)throw u.ERRORS.INVALID_GRAPHQL.err(`Unknown argument "${t}" found in value: "${e}" has no argument named "${t}"`);try{a[t]=g(s.value,o)}catch(e){if(e instanceof r.GraphQLError)throw u.ERRORS.INVALID_GRAPHQL.err(`Invalid value for argument "${t}": ${e.message}`);throw e}}return a},i.collectVariablesInValue=function e(t,i){(0,n.isVariable)(t)?i.add(t):t&&(Array.isArray(t)&&t.forEach(t=>e(t,i)),"object"==typeof t&&Object.keys(t).forEach(n=>e(t[n],i)))}},319894,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.unregisterKnownFeatures=i.coreFeatureDefinitionIfKnown=i.registerKnownFeature=void 0;let n=new Map;i.registerKnownFeature=function(e){n.has(e.identity)||n.set(e.identity,e)},i.coreFeatureDefinitionIfKnown=function(e){var t;return null==(t=n.get(e.identity))?void 0:t.find(e.version)},i.unregisterKnownFeatures=function(e){n.delete(e.identity)}},343924,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.ensureSameTypeKind=i.createEnumTypeSpecification=i.createUnionTypeSpecification=i.createObjectTypeSpecification=i.createScalarTypeSpecification=i.createDirectiveSpecification=void 0;let n=e.r(186846),r=e.r(168032),a=e.r(408470),s=e.r(367356),o=e.r(678270),l=e.r(331484);function u(e,t){return e===t.kind?[]:[a.ERRORS.TYPE_DEFINITION_INVALID.err(`Invalid definition for type ${t.name}: ${t.name} should be a ${e} but is defined as a ${t.kind}`,{nodes:t.sourceAST})]}function c(e,t,i,n){var l;let u=null!=(l=e.args)?l:[],c=[];for(let{name:e,type:l,defaultValue:d}of u){let u=t.argument(e);if(!u){(0,r.isNonNullType)(l)&&void 0===d&&c.push(a.ERRORS.DIRECTIVE_DEFINITION_INVALID.err(`Invalid definition for ${i}: missing required argument "${e}"`,{nodes:n}));continue}let p=u.type;(0,r.isNonNullType)(p)&&!(0,r.isNonNullType)(l)&&(p=p.ofType),(0,o.sameType)(l,p)||function e(t,i){return(0,r.isListType)(t)?(0,r.isListType)(i)&&e(t.ofType,i.ofType):(0,r.isNonNullType)(t)?(0,r.isNonNullType)(i)&&e(t.ofType,i.ofType):(0,r.isCustomScalarType)(t)&&!(0,r.isCustomScalarType)(i)}(l,p)?(0,r.isNonNullType)(u.type)||(0,s.valueEquals)(d,u.defaultValue)||c.push(a.ERRORS.DIRECTIVE_DEFINITION_INVALID.err(`Invalid definition for ${i}: argument "${e}" should have default value ${(0,s.valueToString)(d)} but found default value ${(0,s.valueToString)(u.defaultValue)}`,{nodes:u.sourceAST})):c.push(a.ERRORS.DIRECTIVE_DEFINITION_INVALID.err(`Invalid definition for ${i}: argument "${e}" should have type "${l}" but found type "${u.type}"`,{nodes:u.sourceAST}))}for(let e of t.arguments())u.some(t=>t.name===e.name)||c.push(a.ERRORS.DIRECTIVE_DEFINITION_INVALID.err(`Invalid definition for ${i}: unknown/unsupported argument "${e.name}"`,{nodes:e.sourceAST}));return c}i.createDirectiveSpecification=function({name:e,locations:t,repeatable:i=!1,args:s=[],composes:o=!1,supergraphSpecification:u,useJoinDirective:d=!1,staticArgumentTransform:p}){let h;if(o){let t;(0,l.assert)(u,`Should provide a @link specification to use in supergraph for directive @${e} if it composes`);let r=new Map(s.filter(e=>e.compositionStrategy).map(e=>[e.name,e.compositionStrategy]));r.size>0&&((0,l.assert)(!i,()=>`Invalid directive specification for @${e}: @${e} is repeatable and should not define composition strategy for its arguments`),(0,l.assert)(r.size===s.length,()=>`Invalid directive specification for @${e}: not all arguments define a composition strategy`),t=(t,i)=>{for(let{name:a,type:o}of s){let s=r.get(a);(0,l.assert)(s,()=>`Should have a strategy for ${a}`);let u=o(t,i);(0,l.assert)(!Array.isArray(u),()=>`Should have gotten error getting type for @${e}(${a}:), but got ${u}`);let{valid:c,supportedMsg:d}=s.isTypeSupported(t,u);if(!c)return new n.GraphQLError(`Invalid composition strategy ${s.name} for argument @${e}(${a}:) of type ${u}; ${s.name} only supports ${d}`)}return{merge:(e,t)=>{let i=r.get(e);return(0,l.assert)(i,()=>`Should have a strategy for ${e}`),i.mergeValues(t)},toString:()=>0===r.size?"<none>":"{ "+[...r.entries()].map(([e,t])=>`"${e}": ${t.name}`).join(", ")+" }"}}),h={supergraphSpecification:u,useJoinDirective:null!=d&&d,argumentsMerger:t,staticArgumentTransform:p}}return{name:e,composition:h,checkOrAdd:(n,o,l)=>{var u,d,p;let h=null!=(u=null==o?void 0:o.directiveNameInSchema(e))?u:e,{resolvedArgs:f,errors:m}=s.reduce(({resolvedArgs:e,errors:t},i)=>{let r=i.type(n,o);return Array.isArray(r)?t.push(...r):e.push({...i,type:r}),{resolvedArgs:e,errors:t}},{resolvedArgs:[],errors:[]});if(m.length>0)return m;let y=n.directive(h);if(y){let e,n;return d={name:h,locations:t,repeatable:i,args:f},p=y,e=`"@${d.name}"`,n=c(d,p,`directive ${e}`),!d.repeatable&&p.repeatable&&(n=n.concat(a.ERRORS.DIRECTIVE_DEFINITION_INVALID.err(`Invalid definition for directive ${e}: ${e} should${d.repeatable?"":" not"} be repeatable`,{nodes:p.sourceAST}))),p.locations.every(e=>d.locations.includes(e))||(n=n.concat(a.ERRORS.DIRECTIVE_DEFINITION_INVALID.err(`Invalid definition for directive ${e}: ${e} should have locations ${d.locations.join(", ")}, but found (non-subset) ${p.locations.join(", ")}`,{nodes:p.sourceAST}))),n}{let e=n.addDirectiveDefinition(new r.DirectiveDefinition(h,l));for(let{name:n,type:r,defaultValue:a}of(e.repeatable=i,e.addLocations(...t),f))e.addArgument(n,r,a);return[]}}}},i.createScalarTypeSpecification=function({name:e}){return{name:e,checkOrAdd:(t,i,n)=>{var a;let s=null!=(a=null==i?void 0:i.typeNameInSchema(e))?a:e,o=t.type(s);return o?u("ScalarType",o):(t.addType(new r.ScalarType(s,n)),[])}}},i.createObjectTypeSpecification=function({name:e,fieldsFct:t}){return{name:e,checkOrAdd:(i,n,s)=>{var d;let p=null!=(d=null==n?void 0:n.typeNameInSchema(e))?d:e,h=t(i),f=i.type(p);if(f){let e=u("ObjectType",f);if(e.length>0)return e;for(let{name:t,type:i,args:n}of((0,l.assert)((0,r.isObjectType)(f),"Should be an object type"),h)){let s=f.field(t);if(!s){e=e.concat(a.ERRORS.TYPE_DEFINITION_INVALID.err(`Invalid definition of type ${t}: missing field ${t}`,{nodes:f.sourceAST}));continue}let l=s.type;!(0,r.isNonNullType)(i)&&(0,r.isNonNullType)(l)&&(l=l.ofType),(0,o.sameType)(i,l)||(e=e.concat(a.ERRORS.TYPE_DEFINITION_INVALID.err(`Invalid definition for field ${t} of type ${t}: should have type ${i} but found type ${s.type}`,{nodes:s.sourceAST}))),e=e.concat(c({name:t,args:n},s,`field "${s.coordinate}"`))}return e}{let e=i.addType(new r.ObjectType(p,s));for(let{name:t,type:i,args:n}of h){let r=e.addField(t,i);for(let{name:e,type:t,defaultValue:i}of null!=n?n:[])r.addArgument(e,t,i)}return[]}}}},i.createUnionTypeSpecification=function({name:e,membersFct:t}){return{name:e,checkOrAdd:(i,n,s)=>{var o;let c=null!=(o=null==n?void 0:n.typeNameInSchema(e))?o:e,d=i.type(c),p=t(i).sort((e,t)=>e.localeCompare(t));if(0===p.length)return d?[a.ERRORS.TYPE_DEFINITION_INVALID.err(`Invalid definition of type ${e}: expected the union type to not exist/have no members but it is defined.`,{nodes:d.sourceAST})]:[];if(d){let t=u("UnionType",d);if(t.length>0)return t;(0,l.assert)((0,r.isUnionType)(d),"Should be an union type");let i=d.members().map(e=>e.type.name).sort((e,t)=>e.localeCompare(t));return(0,l.arrayEquals)(p,i)||(t=t.concat(a.ERRORS.TYPE_DEFINITION_INVALID.err(`Invalid definition of type ${e}: expected members [${p}] but found [${i}].`,{nodes:d.sourceAST}))),t}{let e=i.addType(new r.UnionType(c,s));for(let t of p)e.addType(t);return[]}}}},i.createEnumTypeSpecification=function({name:e,values:t}){return{name:e,checkOrAdd:(i,n,s)=>{var o;let c=null!=(o=null==n?void 0:n.typeNameInSchema(e))?o:e,d=i.type(c),p=t.map(e=>e.name).sort((e,t)=>e.localeCompare(t));if(d){let t=u("EnumType",d);if(t.length>0)return t;(0,l.assert)((0,r.isEnumType)(d),"Should be an enum type");let i=d.values.map(e=>e.name).sort((e,t)=>e.localeCompare(t));return(0,l.arrayEquals)(p,i)||(t=t.concat(a.ERRORS.TYPE_DEFINITION_INVALID.err(`Invalid definition for type "${e}": expected values [${p.join(", ")}] but found [${i.join(", ")}].`,{nodes:d.sourceAST}))),t}{let e=i.addType(new r.EnumType(c,s));for(let{name:i,description:n}of t)e.addValue(i).description=n;return[]}}}},i.ensureSameTypeKind=u},785576,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.removeAllCoreFeatures=i.LINK_VERSIONS=i.CORE_VERSIONS=i.findCoreSpecVersion=i.FeatureUrl=i.FeatureVersion=i.FeatureDefinitions=i.CoreSpecDefinition=i.isCoreSpecDirectiveApplication=i.extractCoreFeatureImports=i.FeatureDefinition=i.corePurposes=i.ErrCoreCheckFailed=i.linkDirectiveDefaultName=i.linkIdentity=i.coreIdentity=void 0;let n=e.r(186846),r=e.r(792509),a=e.r(168032),s=e.r(678270),o=e.r(331484),l=e.r(408470),u=e.r(367356),c=e.r(319894),d=e.r(308126),p=e.r(343924);function h(e){return Error(e)}i.coreIdentity="https://specs.apollo.dev/core",i.linkIdentity="https://specs.apollo.dev/link",i.linkDirectiveDefaultName="link",i.ErrCoreCheckFailed=e=>(0,l.aggregateError)("CheckFailed","one or more checks failed",e),i.corePurposes=["SECURITY","EXECUTION"];class f{constructor(e,t){this.minimumFederationVersion=t,this._directiveSpecs=new o.MapWithCachedArrays,this._typeSpecs=new o.MapWithCachedArrays,this.url="string"==typeof e?I.parse(e):e}registerDirective(e){this._directiveSpecs.set(e.name,e)}registerType(e){this._typeSpecs.set(e.name,e)}registerSubFeature(e){for(let t of e.typeSpecs())this.registerType(t);for(let t of e.directiveSpecs())this.registerDirective(t)}directiveSpecs(){return this._directiveSpecs.values()}directiveSpec(e){return this._directiveSpecs.get(e)}typeSpecs(){return this._typeSpecs.values()}typeSpec(e){return this._typeSpecs.get(e)}get identity(){return this.url.identity}get version(){return this.url.version}isSpecType(e){let t=this.nameInSchema(e.schema());return void 0!==t&&e.name.startsWith(`${t}__`)}isSpecDirective(e){let t=this.nameInSchema(e.schema());return void 0!=t&&(e.name===t||e.name.startsWith(`${t}__`))}addElementsToSchema(e){let t=this.featureInSchema(e);(0,o.assert)(t,()=>`The ${this.url} specification should have been added to the schema before this is called`);let i=[];for(let n of this.typeSpecs())i=i.concat(n.checkOrAdd(e,t));for(let n of this.directiveSpecs())i=i.concat(n.checkOrAdd(e,t));return i}allElementNames(){return this.directiveSpecs().map(e=>`@${e.name}`).concat(this.typeSpecs().map(e=>e.name))}nameInSchema(e){let t=this.featureInSchema(e);return null==t?void 0:t.nameInSchema}directiveNameInSchema(e,t){let i=this.featureInSchema(e);return i?i.directiveNameInSchema(t):void 0}typeNameInSchema(e,t){let i=this.featureInSchema(e);return i?i.typeNameInSchema(t):void 0}rootDirective(e){let t=this.nameInSchema(e);return t?e.directive(t):void 0}directive(e,t){let i=this.directiveNameInSchema(e,t);return i?e.directive(i):void 0}type(e,t){let i=this.typeNameInSchema(e,t);return i?e.type(i):void 0}addRootDirective(e){return e.addDirectiveDefinition(this.nameInSchema(e))}addDirective(e,t){return e.addDirectiveDefinition(this.directiveNameInSchema(e,t))}addScalarType(e,t){return e.addType(new a.ScalarType(this.typeNameInSchema(e,t)))}addEnumType(e,t){return e.addType(new a.EnumType(this.typeNameInSchema(e,t)))}featureInSchema(e){let t=e.coreFeatures;if(!t)throw h("Schema is not a core schema (add @link first)");return t.getByIdentity(this.identity)}get defaultCorePurpose(){}compositionSpecification(e){let t=this._directiveSpecs.get(e);return null==t?void 0:t.composition}toString(){return`${this.identity}/${this.version}`}}i.FeatureDefinition=f;let m=/^@?[_A-Za-z][_0-9A-Za-z]*$/;function y(e,t,i,n){if(t&&!t.includes(e)){let r="";if(!e.startsWith("@")&&t.includes("@"+e))r=` Did you mean directive "@${e}"?`;else{let i=(0,d.suggestionList)(e,t);i&&(r=(0,d.didYouMean)(i))}i.push(l.ERRORS.INVALID_LINK_DIRECTIVE_USAGE.err(`Cannot import unknown element "${e}".${r}`,{nodes:n.sourceAST}))}}i.extractCoreFeatureImports=function(e,t){let i=t.arguments();if(!("import"in i)||!i.import)return[];let n=i.import,r=(0,c.coreFeatureDefinitionIfKnown)(e),s=null==r?void 0:r.allElementNames(),o=[],d=[];e:for(let e of n){let i;if("string"==typeof e){d.push({name:e}),y(e,s,o,t);continue}if("object"!=typeof e){o.push(l.ERRORS.INVALID_LINK_DIRECTIVE_USAGE.err(`Invalid sub-value ${(0,u.valueToString)(e)} for @link(import:) argument: values should be either strings or input object values of the form { name: "<importedElement>", as: "<alias>" }.`,{nodes:t.sourceAST}));continue}for(let[n,r]of Object.entries(e))switch(n){case"name":if("string"!=typeof r){o.push(l.ERRORS.INVALID_LINK_DIRECTIVE_USAGE.err(`Invalid value for the "name" field for sub-value ${(0,u.valueToString)(e)} of @link(import:) argument: must be a string.`,{nodes:t.sourceAST}));continue e}if(!m.test(r)){o.push(l.ERRORS.INVALID_LINK_DIRECTIVE_USAGE.err(`Invalid value for the "name" field for sub-value ${(0,u.valueToString)(e)} of @link(import:) argument: must use a GraphQL name.`,{nodes:t.sourceAST}));continue e}i=r;break;case"as":if("string"!=typeof r){o.push(l.ERRORS.INVALID_LINK_DIRECTIVE_USAGE.err(`Invalid value for the "as" field for sub-value ${(0,u.valueToString)(e)} of @link(import:) argument: must be a string.`,{nodes:t.sourceAST}));continue e}if(!m.test(r)){o.push(l.ERRORS.INVALID_LINK_DIRECTIVE_USAGE.err(`Invalid value for the "as" field for sub-value ${(0,u.valueToString)(e)} of @link(import:) argument: must use a GraphQL name.`,{nodes:t.sourceAST}));continue e}break;default:o.push(l.ERRORS.INVALID_LINK_DIRECTIVE_USAGE.err(`Unknown field "${n}" for sub-value ${(0,u.valueToString)(e)} of @link(import:) argument.`,{nodes:t.sourceAST}));continue e}i?(d.push(e),e.as&&("@"===e.name.charAt(0)&&"@"!==e.as.charAt(0)?o.push(l.ERRORS.INVALID_LINK_DIRECTIVE_USAGE.err(`Invalid @link import renaming: directive "${e.name}" imported name should start with a '@' character, but got "${e.as}".`,{nodes:t.sourceAST})):"@"!==e.name.charAt(0)&&"@"===e.as.charAt(0)&&o.push(l.ERRORS.INVALID_LINK_DIRECTIVE_USAGE.err(`Invalid @link import renaming: type "${e.name}" imported name should not start with a '@' character, but got "${e.as}" (or, if @${e.name} is a directive, then it should be referred to with a '@').`,{nodes:t.sourceAST}))),y(i,s,o,t)):o.push(l.ERRORS.INVALID_LINK_DIRECTIVE_USAGE.err(`Invalid sub-value ${(0,u.valueToString)(e)} for @link(import:) argument: missing mandatory "name" field.`,{nodes:t.sourceAST}))}if(o.length>0)throw(0,a.ErrGraphQLValidationFailed)(o);return d},i.isCoreSpecDirectiveApplication=function(e){var t,r,o,l,u;let c=e.definition;if(!c)return!1;let d=c.argument("as");if(d&&!(0,s.sameType)(d.type,e.schema().stringType())||!c.repeatable||1!==c.locations.length||c.locations[0]!==n.DirectiveLocation.SCHEMA)return!1;let p=null!=(t=c.argument("url"))?t:c.argument("feature");if(!p||(l=p.type,u=e.schema(),!((0,s.sameType)(l,u.stringType())||(0,s.sameType)(l,new a.NonNullType(u.stringType())))))return!1;let h=e.arguments();try{let t=I.parse(h[p.name]);if(t.identity===i.coreIdentity)return e.name===(null!=(r=h.as)?r:"core");return t.identity===i.linkIdentity&&e.name===(null!=(o=h.as)?o:i.linkDirectiveDefaultName)}catch(e){return!1}};let v=(0,p.createEnumTypeSpecification)({name:"Purpose",values:i.corePurposes.map(e=>({name:e,description:function(e){switch(e){case"SECURITY":return"`SECURITY` features provide metadata necessary to securely resolve fields.";case"EXECUTION":return"`EXECUTION` features provide metadata necessary for operation execution."}}(e)}))}),g=(0,p.createScalarTypeSpecification)({name:"Import"});class T extends f{constructor(e,t,r=i.linkIdentity,a=i.linkDirectiveDefaultName){super(new I(r,a,e),t),this.directiveDefinitionSpec=(0,p.createDirectiveSpecification)({name:a,locations:[n.DirectiveLocation.SCHEMA],repeatable:!0,args:this.createDefinitionArgumentSpecifications()}),this.registerDirective(this.directiveDefinitionSpec)}createDefinitionArgumentSpecifications(){let e=[{name:this.urlArgName(),type:e=>e.stringType()},{name:"as",type:e=>e.stringType()}];return this.supportPurposes()&&e.push({name:"for",type:(e,t)=>((0,o.assert)(t,"Shouldn't be added without being attached to a @link spec"),e.type(t.typeNameInSchema(v.name)))}),this.supportImport()&&e.push({name:"import",type:(e,t)=>((0,o.assert)(t,"Shouldn't be added without being attached to a @link spec"),new a.ListType(e.type(t.typeNameInSchema(g.name))))}),e}addElementsToSchema(e){return[]}addToSchema(e,t){let i=this.addDefinitionsToSchema(e,t);if(i.length>0)return i;let n={[this.urlArgName()]:this.toString()};t&&(n.as=t);let r=e.schemaDefinition,a=r.hasNonExtensionElements(),s=r.applyDirective(null!=t?t:this.url.name,n,!0);if(!a&&r.hasExtensionElements()){let e=(0,o.firstOf)(r.extensions());(0,o.assert)(e,"`hasExtensionElements` should not have been `true`"),s.setOfExtension(e)}return[]}addDefinitionsToSchema(e,t,i=[]){let n=e.coreFeatures;if(n)if(n.coreItself.url.identity===this.identity)return[];else return[l.ERRORS.INVALID_LINK_DIRECTIVE_USAGE.err(`Cannot add feature ${this} to the schema, it already uses ${n.coreItself.url}`)];let r=null!=t?t:this.url.name,s=new a.CoreFeature(this.url,r,new a.Directive(r),i),o=[];return(o=(o=o.concat(v.checkOrAdd(e,s))).concat(g.checkOrAdd(e,s))).concat(this.directiveDefinitionSpec.checkOrAdd(e,s))}allElementNames(){let e=[`@${this.url.name}`];return this.supportPurposes()&&e.push("Purpose"),this.supportImport()&&e.push("Import"),e}supportPurposes(){return this.version.strictlyGreaterThan(new E(0,1))}supportImport(){return this.url.name===i.linkDirectiveDefaultName}extractFeature(e){let t=e.coreFeatures;if(!t)throw h("Schema is not a core schema (add @core first)");if(!t.coreItself.url.version.equals(this.version))throw h(`Cannot use this version of @core (${this.version}), the schema uses version ${t.coreItself.url.version}`);return t.coreItself}coreDirective(e){let t=this.extractFeature(e);return e.directive(t.nameInSchema)}coreVersion(e){return this.extractFeature(e).url.version}applyFeatureToSchema(e,t,i,r,a){let s=this.coreDirective(e),o={[this.urlArgName()]:t.toString(),as:i};if(r)if(!this.supportPurposes())return[new n.GraphQLError(`Cannot apply feature ${t} with purpose since the schema's @core/@link version does not support it.`)];else o.for=r;if(a&&a.length>0)if(!this.supportImport())return[new n.GraphQLError(`Cannot apply feature ${t} with imports since the schema's @core/@link version does not support it.`)];else o.import=a.map(e=>e.as?e:e.name);return e.schemaDefinition.applyDirective(s,o),t.addElementsToSchema(e)}extractFeatureUrl(e){return I.parse(e[this.urlArgName()])}urlArgName(){return"core"===this.url.name?"feature":"url"}}i.CoreSpecDefinition=T;class S{constructor(e){this.identity=e,this._definitions=[],this._previewVersions=new Set}add(e,t){if(e.identity!==this.identity)throw h(`Cannot add definition for ${e} to the versions of definitions for ${this.identity}`);return this._definitions.find(t=>e.version.equals(t.version))||(this._definitions.push(e),this._definitions.sort((e,t)=>-e.version.compareTo(t.version)),(null==t?void 0:t.preview)&&this._previewVersions.add(e.version.toString())),this}find(e){return this._definitions.find(t=>t.version.equals(e))}versions(){return this._definitions.map(e=>e.version)}latest(){return(0,o.assert)(this._definitions.length>0,"Trying to get latest when no definitions exist"),this._definitions[0]}latestNonPreview(){var e;return(0,o.assert)(this._definitions.length>0,"Trying to get latest when no definitions exist"),null!=(e=this._definitions.find(e=>!this._previewVersions.has(e.version.toString())))?e:this._definitions[0]}getMinimumRequiredVersion(e){var t;let i=this._definitions.find(t=>!t.minimumFederationVersion||e.gte(t.minimumFederationVersion));(0,o.assert)(i,`No compatible definition exists for federation version ${e}`);let n=this.latest().version.major;return i.version.major!==n?null!=(t=(0,o.findLast)(this._definitions,e=>e.version.major===n))?t:this.latest():i}}i.FeatureDefinitions=S;class E{constructor(e,t){this.major=e,this.minor=t}static parse(e){let t=e.match(this.VERSION_RE);if(!t)throw l.ERRORS.INVALID_LINK_IDENTIFIER.err(`Expected a version string (of the form v1.2), got ${e}`);return new this(+t[1],+t[2])}static max(e){let t;for(let i of e)(!t||i.gt(t))&&(t=i);return t}satisfies(e){let{major:t,minor:i}=this,{major:n,minor:r}=e;return n==t&&(0==t?r==i:r<=i)}get series(){let{major:e}=this;return e>0?`${e}.x`:String(this)}compareTo(e){return this.major>e.major?1:this.major<e.major?-1:this.minor>e.minor?1:this.minor<e.minor?-1:0}lt(e){return 0>this.compareTo(e)}lte(e){return 0>=this.compareTo(e)}gt(e){return this.compareTo(e)>0}gte(e){return this.compareTo(e)>=0}strictlyGreaterThan(e){return this.compareTo(e)>0}toString(){return`v${this.major}.${this.minor}`}equals(e){return this.major===e.major&&this.minor===e.minor}}i.FeatureVersion=E,E.VERSION_RE=/^v(\d+)\.(\d+)$/;class I{constructor(e,t,i,n){this.identity=e,this.name=t,this.version=i,this.element=n}static maybeParse(e,t){try{return I.parse(e,t)}catch(e){return}}static parse(e,t){let i=new r.URL(e);if(!i.pathname||"/"===i.pathname)throw l.ERRORS.INVALID_LINK_IDENTIFIER.err(`Missing path in feature url '${i}'`,{nodes:t});let n=i.pathname.split("/"),a=n.pop();if(!a)throw l.ERRORS.INVALID_LINK_IDENTIFIER.err(`Missing version component in feature url '${i}'`,{nodes:t});let s=E.parse(a),o=n[n.length-1];if(!o)throw l.ERRORS.INVALID_LINK_IDENTIFIER.err(`Missing feature name component in feature url '${i}'`,{nodes:t});let u=i.hash?i.hash.slice(1):void 0;return i.hash="",i.search="",i.password="",i.username="",i.pathname=n.join("/"),new I(i.toString(),o,s,u)}static decode(e){return this.parse(e.value,e)}satisfies(e){return e.identity===this.identity&&this.version.satisfies(e.version)}equals(e){return this.identity===e.identity&&this.version.equals(e.version)}get url(){return this.element?`${this.identity}/${this.version}#${this.element}`:`${this.identity}/${this.version}`}get isDirective(){var e;return null==(e=this.element)?void 0:e.startsWith("@")}get elementName(){var e;return this.isDirective?null==(e=this.element)?void 0:e.slice(1):this.element}get base(){return this.element?new I(this.identity,this.name,this.version):this}toString(){return this.url}}i.FeatureUrl=I,i.findCoreSpecVersion=function(e){return"core"===e.name?i.CORE_VERSIONS.find(e.version):e.name===i.linkDirectiveDefaultName?i.LINK_VERSIONS.find(e.version):void 0},i.CORE_VERSIONS=new S(i.coreIdentity).add(new T(new E(0,1),void 0,i.coreIdentity,"core")).add(new T(new E(0,2),new E(2,0),i.coreIdentity,"core")),i.LINK_VERSIONS=new S(i.linkIdentity).add(new T(new E(1,0),new E(2,0))),(0,c.registerKnownFeature)(i.CORE_VERSIONS),(0,c.registerKnownFeature)(i.LINK_VERSIONS),i.removeAllCoreFeatures=function(e){var t,i;let n=[...null!=(i=null==(t=e.coreFeatures)?void 0:t.allFeatures())?i:[]],r=[];for(let t of n)e.directives().filter(e=>t.isFeatureDefinition(e)).forEach(e=>e.remove().forEach(e=>e.remove())),e.types().filter(e=>t.isFeatureDefinition(e)).forEach(e=>{let i=e.remove();i.length>0&&r.push({feature:t,type:e,references:i})});let s=[];for(let{feature:e,type:t,references:i}of r){let n=i.filter(e=>e.isAttached());n.length>0&&s.push(l.ERRORS.REFERENCED_INACCESSIBLE.err(`Cannot remove elements of feature ${e} as feature type ${t} is referenced by elements: ${n.join(", ")}`,{nodes:(0,a.sourceASTs)(...i)}))}if(s.length>0)throw(0,a.ErrGraphQLAPISchemaValidationFailed)(s)}},193151,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.TAG_VERSIONS=i.TagSpecDefinition=i.tagIdentity=void 0;let n=e.r(186846),r=e.r(785576),a=e.r(168032),s=e.r(343924),o=e.r(408470),l=e.r(319894),u=e.r(678270);i.tagIdentity="https://specs.apollo.dev/tag";class c extends r.FeatureDefinition{constructor(e,t){super(new r.FeatureUrl(i.tagIdentity,"tag",e),t),this.tagLocations=[n.DirectiveLocation.FIELD_DEFINITION,n.DirectiveLocation.OBJECT,n.DirectiveLocation.INTERFACE,n.DirectiveLocation.UNION],this.printedTagDefinition="directive @tag(name: String!) repeatable on FIELD_DEFINITION | INTERFACE | OBJECT | UNION",!this.isV01()&&(this.tagLocations.push(n.DirectiveLocation.ARGUMENT_DEFINITION,n.DirectiveLocation.SCALAR,n.DirectiveLocation.ENUM,n.DirectiveLocation.ENUM_VALUE,n.DirectiveLocation.INPUT_OBJECT,n.DirectiveLocation.INPUT_FIELD_DEFINITION),this.printedTagDefinition="directive @tag(name: String!) repeatable on FIELD_DEFINITION | INTERFACE | OBJECT | UNION | ARGUMENT_DEFINITION | SCALAR | ENUM | ENUM_VALUE | INPUT_OBJECT | INPUT_FIELD_DEFINITION",this.isV02()||(this.tagLocations.push(n.DirectiveLocation.SCHEMA),this.printedTagDefinition="directive @tag(name: String!) repeatable on FIELD_DEFINITION | INTERFACE | OBJECT | UNION | ARGUMENT_DEFINITION | SCALAR | ENUM | ENUM_VALUE | INPUT_OBJECT | INPUT_FIELD_DEFINITION | SCHEMA")),this.tagDirectiveSpec=(0,s.createDirectiveSpecification)({name:"tag",locations:this.tagLocations,repeatable:!0,args:[{name:"name",type:e=>new a.NonNullType(e.stringType())}],composes:!0,supergraphSpecification:e=>i.TAG_VERSIONS.getMinimumRequiredVersion(e)}),this.registerDirective(this.tagDirectiveSpec)}isV01(){return this.version.equals(new r.FeatureVersion(0,1))}isV02(){return this.version.equals(new r.FeatureVersion(0,2))}checkCompatibleDirective(e){let t=Object.keys(e.arguments()).length>1,i=e.argument("name"),n=i&&(0,u.sameType)(i.type,new a.NonNullType(e.schema().stringType())),r=e.locations.every(e=>this.tagLocations.includes(e));if(t||!n||!r)return o.ERRORS.DIRECTIVE_DEFINITION_INVALID.err(`Found invalid @tag directive definition. Please ensure the directive definition in your schema's definitions matches the following:
|
|
13
|
+
spurious results.`)}}return!1}},117921,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.keyMap=function(e,t){let i=Object.create(null);for(let n of e)i[t(n)]=n;return i}},213552,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.keyValMap=function(e,t,i){let n=Object.create(null);for(let r of e)n[t(r)]=i(r);return n}},216251,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.naturalCompare=function(e,t){let i=0,a=0;for(;i<e.length&&a<t.length;){let s=e.charCodeAt(i),o=t.charCodeAt(a);if(r(s)&&r(o)){let l=0;do++i,l=10*l+s-n,s=e.charCodeAt(i);while(r(s)&&l>0)let u=0;do++a,u=10*u+o-n,o=t.charCodeAt(a);while(r(o)&&u>0)if(l<u)return -1;if(l>u)return 1}else{if(s<o)return -1;if(s>o)return 1;++i,++a}}return e.length-t.length};let n=48;function r(e){return!isNaN(e)&&n<=e&&e<=57}},529364,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.suggestionList=function(e,t){let i=Object.create(null),a=new r(e),s=Math.floor(.4*e.length)+1;for(let e of t){let t=a.measure(e,s);void 0!==t&&(i[e]=t)}return Object.keys(i).sort((e,t)=>{let r=i[e]-i[t];return 0!==r?r:(0,n.naturalCompare)(e,t)})};var n=e.r(216251);class r{constructor(e){this._input=e,this._inputLowerCase=e.toLowerCase(),this._inputArray=a(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 i=e.toLowerCase();if(this._inputLowerCase===i)return 1;let n=a(i),r=this._inputArray;if(n.length<r.length){let e=n;n=r,r=e}let s=n.length,o=r.length;if(s-o>t)return;let l=this._rows;for(let e=0;e<=o;e++)l[0][e]=e;for(let e=1;e<=s;e++){let i=l[(e-1)%3],a=l[e%3],s=a[0]=e;for(let t=1;t<=o;t++){let o=+(n[e-1]!==r[t-1]),u=Math.min(i[t]+1,a[t-1]+1,i[t-1]+o);e>1&&t>1&&n[e-1]===r[t-2]&&n[e-2]===r[t-1]&&(u=Math.min(u,l[(e-2)%3][t-2]+1)),u<s&&(s=u),a[t]=u}if(s>t)return}let u=l[s%3][o];return u<=t?u:void 0}}function a(e){let t=e.length,i=Array(t);for(let n=0;n<t;++n)i[n]=e.charCodeAt(n);return i}},605021,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.toObjMap=function(e){if(null==e)return Object.create(null);if(null===Object.getPrototypeOf(e))return e;let t=Object.create(null);for(let[i,n]of Object.entries(e))t[i]=n;return t}},64692,(e,t,i)=>{"use strict";function n(e){return e>=48&&e<=57}function r(e){return e>=97&&e<=122||e>=65&&e<=90}Object.defineProperty(i,"__esModule",{value:!0}),i.isDigit=n,i.isLetter=r,i.isNameContinue=function(e){return r(e)||n(e)||95===e},i.isNameStart=function(e){return r(e)||95===e},i.isWhiteSpace=function(e){return 9===e||32===e}},657421,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.dedentBlockStringLines=function(e){var t,i;let r=Number.MAX_SAFE_INTEGER,a=null,s=-1;for(let t=0;t<e.length;++t){let o=e[t],l=function(e){let t=0;for(;t<e.length&&(0,n.isWhiteSpace)(e.charCodeAt(t));)++t;return t}(o);l!==o.length&&(a=null!=(i=a)?i:t,s=t,0!==t&&l<r&&(r=l))}return e.map((e,t)=>0===t?e:e.slice(r)).slice(null!=(t=a)?t:0,s+1)},i.isPrintableAsBlockString=function(e){if(""===e)return!0;let t=!0,i=!1,n=!0,r=!1;for(let a=0;a<e.length;++a)switch(e.codePointAt(a)){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 11:case 12:case 14:case 15:case 13:return!1;case 10:if(t&&!r)return!1;r=!0,t=!0,i=!1;break;case 9:case 32:i||(i=t);break;default:n&&(n=i),t=!1}return!t&&(!n||!r)},i.printBlockString=function(e,t){let i=e.replace(/"""/g,'\\"""'),r=i.split(/\r\n|[\n\r]/g),a=1===r.length,s=r.length>1&&r.slice(1).every(e=>0===e.length||(0,n.isWhiteSpace)(e.charCodeAt(0))),o=i.endsWith('\\"""'),l=e.endsWith('"')&&!o,u=e.endsWith("\\"),c=l||u,d=!(null!=t&&t.minimize)&&(!a||e.length>70||c||s||o),p="",h=a&&(0,n.isWhiteSpace)(e.charCodeAt(0));return(d&&!h||s)&&(p+="\n"),p+=i,(d||c)&&(p+="\n"),'"""'+p+'"""'};var n=e.r(64692)},195426,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.printString=function(e){return`"${e.replace(n,r)}"`};let n=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function r(e){return a[e.charCodeAt(0)]}let a=["\\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"]},340647,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.print=function(e){return(0,a.visit)(e,s)};var n=e.r(657421),r=e.r(195426),a=e.r(999680);let s={Name:{leave:e=>e.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>o(e.definitions,"\n\n")},OperationDefinition:{leave(e){let t=d(e.variableDefinitions)?u("(\n",o(e.variableDefinitions,"\n"),"\n)"):u("(",o(e.variableDefinitions,", "),")"),i=u("",e.description,"\n")+o([e.operation,o([e.name,t]),o(e.directives," ")]," ");return("query"===i?"":i+" ")+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:i,directives:n,description:r})=>u("",r,"\n")+e+": "+t+u(" = ",i)+u(" ",o(n," "))},SelectionSet:{leave:({selections:e})=>l(e)},Field:{leave({alias:e,name:t,arguments:i,directives:n,selectionSet:r}){let a=u("",e,": ")+t,s=a+u("(",o(i,", "),")");return s.length>80&&(s=a+u("(\n",c(o(i,"\n")),"\n)")),o([s,o(n," "),r]," ")}},Argument:{leave:({name:e,value:t})=>e+": "+t},FragmentSpread:{leave:({name:e,directives:t})=>"..."+e+u(" ",o(t," "))},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:i})=>o(["...",u("on ",e),o(t," "),i]," ")},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:i,directives:n,selectionSet:r,description:a})=>u("",a,"\n")+`fragment ${e}${u("(",o(i,", "),")")} `+`on ${t} ${u("",o(n," ")," ")}`+r},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>t?(0,n.printBlockString)(e):(0,r.printString)(e)},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>"["+o(e,", ")+"]"},ObjectValue:{leave:({fields:e})=>"{"+o(e,", ")+"}"},ObjectField:{leave:({name:e,value:t})=>e+": "+t},Directive:{leave:({name:e,arguments:t})=>"@"+e+u("(",o(t,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({description:e,directives:t,operationTypes:i})=>u("",e,"\n")+o(["schema",o(t," "),l(i)]," ")},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+": "+t},ScalarTypeDefinition:{leave:({description:e,name:t,directives:i})=>u("",e,"\n")+o(["scalar",t,o(i," ")]," ")},ObjectTypeDefinition:{leave:({description:e,name:t,interfaces:i,directives:n,fields:r})=>u("",e,"\n")+o(["type",t,u("implements ",o(i," & ")),o(n," "),l(r)]," ")},FieldDefinition:{leave:({description:e,name:t,arguments:i,type:n,directives:r})=>u("",e,"\n")+t+(d(i)?u("(\n",c(o(i,"\n")),"\n)"):u("(",o(i,", "),")"))+": "+n+u(" ",o(r," "))},InputValueDefinition:{leave:({description:e,name:t,type:i,defaultValue:n,directives:r})=>u("",e,"\n")+o([t+": "+i,u("= ",n),o(r," ")]," ")},InterfaceTypeDefinition:{leave:({description:e,name:t,interfaces:i,directives:n,fields:r})=>u("",e,"\n")+o(["interface",t,u("implements ",o(i," & ")),o(n," "),l(r)]," ")},UnionTypeDefinition:{leave:({description:e,name:t,directives:i,types:n})=>u("",e,"\n")+o(["union",t,o(i," "),u("= ",o(n," | "))]," ")},EnumTypeDefinition:{leave:({description:e,name:t,directives:i,values:n})=>u("",e,"\n")+o(["enum",t,o(i," "),l(n)]," ")},EnumValueDefinition:{leave:({description:e,name:t,directives:i})=>u("",e,"\n")+o([t,o(i," ")]," ")},InputObjectTypeDefinition:{leave:({description:e,name:t,directives:i,fields:n})=>u("",e,"\n")+o(["input",t,o(i," "),l(n)]," ")},DirectiveDefinition:{leave:({description:e,name:t,arguments:i,directives:n,repeatable:r,locations:a})=>u("",e,"\n")+"directive @"+t+(d(i)?u("(\n",c(o(i,"\n")),"\n)"):u("(",o(i,", "),")"))+u(" ",o(n," "))+(r?" repeatable":"")+" on "+o(a," | ")},SchemaExtension:{leave:({directives:e,operationTypes:t})=>o(["extend schema",o(e," "),l(t)]," ")},ScalarTypeExtension:{leave:({name:e,directives:t})=>o(["extend scalar",e,o(t," ")]," ")},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:i,fields:n})=>o(["extend type",e,u("implements ",o(t," & ")),o(i," "),l(n)]," ")},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:i,fields:n})=>o(["extend interface",e,u("implements ",o(t," & ")),o(i," "),l(n)]," ")},UnionTypeExtension:{leave:({name:e,directives:t,types:i})=>o(["extend union",e,o(t," "),u("= ",o(i," | "))]," ")},EnumTypeExtension:{leave:({name:e,directives:t,values:i})=>o(["extend enum",e,o(t," "),l(i)]," ")},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:i})=>o(["extend input",e,o(t," "),l(i)]," ")},DirectiveExtension:{leave:({name:e,directives:t})=>o(["extend directive @"+e,o(t," ")]," ")},TypeCoordinate:{leave:({name:e})=>e},MemberCoordinate:{leave:({name:e,memberName:t})=>o([e,u(".",t)])},ArgumentCoordinate:{leave:({name:e,fieldName:t,argumentName:i})=>o([e,u(".",t),u("(",i,":)")])},DirectiveCoordinate:{leave:({name:e})=>o(["@",e])},DirectiveArgumentCoordinate:{leave:({name:e,argumentName:t})=>o(["@",e,u("(",t,":)")])}};function o(e,t=""){var i;return null!=(i=null==e?void 0:e.filter(e=>e).join(t))?i:""}function l(e){return u("{\n",c(o(e,"\n")),"\n}")}function u(e,t,i=""){return null!=t&&""!==t?e+t+i:""}function c(e){return u(" ",e.replace(/\n/g,"\n "))}function d(e){var t;return null!=(t=null==e?void 0:e.some(e=>e.includes("\n")))&&t}},156657,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.valueFromASTUntyped=function e(t,i){switch(t.kind){case r.Kind.NULL:return null;case r.Kind.INT:return parseInt(t.value,10);case r.Kind.FLOAT:return parseFloat(t.value);case r.Kind.STRING:case r.Kind.ENUM:case r.Kind.BOOLEAN:return t.value;case r.Kind.LIST:return t.values.map(t=>e(t,i));case r.Kind.OBJECT:return(0,n.keyValMap)(t.fields,e=>e.name.value,t=>e(t.value,i));case r.Kind.VARIABLE:return null==i?void 0:i[t.name.value]}};var n=e.r(213552),r=e.r(199311)},999965,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.assertEnumValueName=function(e){if("true"===e||"false"===e||"null"===e)throw new r.GraphQLError(`Enum values cannot be named: ${e}`);return s(e)},i.assertName=s;var n=e.r(786390),r=e.r(294943),a=e.r(64692);function s(e){if(null!=e||(0,n.devAssert)(!1,"Must provide name."),"string"==typeof e||(0,n.devAssert)(!1,"Expected name to be a string."),0===e.length)throw new r.GraphQLError("Expected name to be a non-empty string.");for(let t=1;t<e.length;++t)if(!(0,a.isNameContinue)(e.charCodeAt(t)))throw new r.GraphQLError(`Names must only contain [_a-zA-Z0-9] but "${e}" does not.`);if(!(0,a.isNameStart)(e.charCodeAt(0)))throw new r.GraphQLError(`Names must start with [_a-zA-Z] but "${e}" does not.`);return e}},211325,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.GraphQLUnionType=i.GraphQLScalarType=i.GraphQLObjectType=i.GraphQLNonNull=i.GraphQLList=i.GraphQLInterfaceType=i.GraphQLInputObjectType=i.GraphQLEnumType=void 0,i.argsToArgsConfig=J,i.assertAbstractType=function(e){if(!C(e))throw Error(`Expected ${(0,s.inspect)(e)} to be a GraphQL abstract type.`);return e},i.assertCompositeType=function(e){if(!L(e))throw Error(`Expected ${(0,s.inspect)(e)} to be a GraphQL composite type.`);return e},i.assertEnumType=function(e){if(!N(e))throw Error(`Expected ${(0,s.inspect)(e)} to be a GraphQL Enum type.`);return e},i.assertInputObjectType=function(e){if(!_(e))throw Error(`Expected ${(0,s.inspect)(e)} to be a GraphQL Input Object type.`);return e},i.assertInputType=function(e){if(!O(e))throw Error(`Expected ${(0,s.inspect)(e)} to be a GraphQL input type.`);return e},i.assertInterfaceType=function(e){if(!I(e))throw Error(`Expected ${(0,s.inspect)(e)} to be a GraphQL Interface type.`);return e},i.assertLeafType=function(e){if(!w(e))throw Error(`Expected ${(0,s.inspect)(e)} to be a GraphQL leaf type.`);return e},i.assertListType=function(e){if(!D(e))throw Error(`Expected ${(0,s.inspect)(e)} to be a GraphQL List type.`);return e},i.assertNamedType=function(e){if(!M(e))throw Error(`Expected ${(0,s.inspect)(e)} to be a GraphQL named type.`);return e},i.assertNonNullType=function(e){if(!A(e))throw Error(`Expected ${(0,s.inspect)(e)} to be a GraphQL Non-Null type.`);return e},i.assertNullableType=function(e){if(!x(e))throw Error(`Expected ${(0,s.inspect)(e)} to be a GraphQL nullable type.`);return e},i.assertObjectType=function(e){if(!E(e))throw Error(`Expected ${(0,s.inspect)(e)} to be a GraphQL Object type.`);return e},i.assertOutputType=function(e){if(!R(e))throw Error(`Expected ${(0,s.inspect)(e)} to be a GraphQL output type.`);return e},i.assertScalarType=function(e){if(!S(e))throw Error(`Expected ${(0,s.inspect)(e)} to be a GraphQL Scalar type.`);return e},i.assertType=function(e){if(!T(e))throw Error(`Expected ${(0,s.inspect)(e)} to be a GraphQL type.`);return e},i.assertUnionType=function(e){if(!b(e))throw Error(`Expected ${(0,s.inspect)(e)} to be a GraphQL Union type.`);return e},i.assertWrappingType=function(e){if(!P(e))throw Error(`Expected ${(0,s.inspect)(e)} to be a GraphQL wrapping type.`);return e},i.defineArguments=K,i.getNamedType=function(e){if(e){let t=e;for(;P(t);)t=t.ofType;return t}},i.getNullableType=function(e){if(e)return A(e)?e.ofType:e},i.isAbstractType=C,i.isCompositeType=L,i.isEnumType=N,i.isInputObjectType=_,i.isInputType=O,i.isInterfaceType=I,i.isLeafType=w,i.isListType=D,i.isNamedType=M,i.isNonNullType=A,i.isNullableType=x,i.isObjectType=E,i.isOutputType=R,i.isRequiredArgument=function(e){return A(e.type)&&void 0===e.defaultValue},i.isRequiredInputField=function(e){return A(e.type)&&void 0===e.defaultValue},i.isScalarType=S,i.isType=T,i.isUnionType=b,i.isWrappingType=P,i.resolveObjMapThunk=$,i.resolveReadonlyArrayThunk=U;var n=e.r(786390),r=e.r(996650),a=e.r(644568),s=e.r(818123),o=e.r(792942),l=e.r(776887),u=e.r(117921),c=e.r(213552),d=e.r(287547),p=e.r(529364),h=e.r(605021),f=e.r(294943),m=e.r(199311),y=e.r(340647),v=e.r(156657),g=e.r(999965);function T(e){return S(e)||E(e)||I(e)||b(e)||N(e)||_(e)||D(e)||A(e)}function S(e){return(0,o.instanceOf)(e,j)}function E(e){return(0,o.instanceOf)(e,V)}function I(e){return(0,o.instanceOf)(e,H)}function b(e){return(0,o.instanceOf)(e,W)}function N(e){return(0,o.instanceOf)(e,z)}function _(e){return(0,o.instanceOf)(e,ee)}function D(e){return(0,o.instanceOf)(e,F)}function A(e){return(0,o.instanceOf)(e,k)}function O(e){return S(e)||N(e)||_(e)||P(e)&&O(e.ofType)}function R(e){return S(e)||E(e)||I(e)||b(e)||N(e)||P(e)&&R(e.ofType)}function w(e){return S(e)||N(e)}function L(e){return E(e)||I(e)||b(e)}function C(e){return I(e)||b(e)}class F{constructor(e){T(e)||(0,n.devAssert)(!1,`Expected ${(0,s.inspect)(e)} to be a GraphQL type.`),this.ofType=e}get[Symbol.toStringTag](){return"GraphQLList"}toString(){return"["+String(this.ofType)+"]"}toJSON(){return this.toString()}}i.GraphQLList=F;class k{constructor(e){x(e)||(0,n.devAssert)(!1,`Expected ${(0,s.inspect)(e)} to be a GraphQL nullable type.`),this.ofType=e}get[Symbol.toStringTag](){return"GraphQLNonNull"}toString(){return String(this.ofType)+"!"}toJSON(){return this.toString()}}function P(e){return D(e)||A(e)}function x(e){return T(e)&&!A(e)}function M(e){return S(e)||E(e)||I(e)||b(e)||N(e)||_(e)}function U(e){return"function"==typeof e?e():e}function $(e){return"function"==typeof e?e():e}i.GraphQLNonNull=k;class j{constructor(e){var t,i,r,o;const l=null!=(t=e.parseValue)?t:a.identityFunc;this.name=(0,g.assertName)(e.name),this.description=e.description,this.specifiedByURL=e.specifiedByURL,this.serialize=null!=(i=e.serialize)?i:a.identityFunc,this.parseValue=l,this.parseLiteral=null!=(r=e.parseLiteral)?r:(e,t)=>l((0,v.valueFromASTUntyped)(e,t)),this.extensions=(0,h.toObjMap)(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!=(o=e.extensionASTNodes)?o:[],null==e.specifiedByURL||"string"==typeof e.specifiedByURL||(0,n.devAssert)(!1,`${this.name} must provide "specifiedByURL" as a string, but got: ${(0,s.inspect)(e.specifiedByURL)}.`),null==e.serialize||"function"==typeof e.serialize||(0,n.devAssert)(!1,`${this.name} must provide "serialize" function. If this custom Scalar is also used as an input type, ensure "parseValue" and "parseLiteral" functions are also provided.`),e.parseLiteral&&("function"==typeof e.parseValue&&"function"==typeof e.parseLiteral||(0,n.devAssert)(!1,`${this.name} must provide both "parseValue" and "parseLiteral" 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,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}i.GraphQLScalarType=j;class V{constructor(e){var t;this.name=(0,g.assertName)(e.name),this.description=e.description,this.isTypeOf=e.isTypeOf,this.extensions=(0,h.toObjMap)(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!=(t=e.extensionASTNodes)?t:[],this._fields=()=>B(e),this._interfaces=()=>G(e),null==e.isTypeOf||"function"==typeof e.isTypeOf||(0,n.devAssert)(!1,`${this.name} must provide "isTypeOf" as a function, but got: ${(0,s.inspect)(e.isTypeOf)}.`)}get[Symbol.toStringTag](){return"GraphQLObjectType"}getFields(){return"function"==typeof this._fields&&(this._fields=this._fields()),this._fields}getInterfaces(){return"function"==typeof this._interfaces&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:q(this.getFields()),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function G(e){var t;let i=U(null!=(t=e.interfaces)?t:[]);return Array.isArray(i)||(0,n.devAssert)(!1,`${e.name} interfaces must be an Array or a function which returns an Array.`),i}function B(e){let t=$(e.fields);return Q(t)||(0,n.devAssert)(!1,`${e.name} fields must be an object with field names as keys or a function which returns such an object.`),(0,d.mapValue)(t,(t,i)=>{var r;Q(t)||(0,n.devAssert)(!1,`${e.name}.${i} field config must be an object.`),null==t.resolve||"function"==typeof t.resolve||(0,n.devAssert)(!1,`${e.name}.${i} field resolver must be a function if provided, but got: ${(0,s.inspect)(t.resolve)}.`);let a=null!=(r=t.args)?r:{};return Q(a)||(0,n.devAssert)(!1,`${e.name}.${i} args must be an object with argument names as keys.`),{name:(0,g.assertName)(i),description:t.description,type:t.type,args:K(a),resolve:t.resolve,subscribe:t.subscribe,deprecationReason:t.deprecationReason,extensions:(0,h.toObjMap)(t.extensions),astNode:t.astNode}})}function K(e){return Object.entries(e).map(([e,t])=>({name:(0,g.assertName)(e),description:t.description,type:t.type,defaultValue:t.defaultValue,deprecationReason:t.deprecationReason,extensions:(0,h.toObjMap)(t.extensions),astNode:t.astNode}))}function Q(e){return(0,l.isObjectLike)(e)&&!Array.isArray(e)}function q(e){return(0,d.mapValue)(e,e=>({description:e.description,type:e.type,args:J(e.args),resolve:e.resolve,subscribe:e.subscribe,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode}))}function J(e){return(0,c.keyValMap)(e,e=>e.name,e=>({description:e.description,type:e.type,defaultValue:e.defaultValue,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode}))}i.GraphQLObjectType=V;class H{constructor(e){var t;this.name=(0,g.assertName)(e.name),this.description=e.description,this.resolveType=e.resolveType,this.extensions=(0,h.toObjMap)(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!=(t=e.extensionASTNodes)?t:[],this._fields=B.bind(void 0,e),this._interfaces=G.bind(void 0,e),null==e.resolveType||"function"==typeof e.resolveType||(0,n.devAssert)(!1,`${this.name} must provide "resolveType" as a function, but got: ${(0,s.inspect)(e.resolveType)}.`)}get[Symbol.toStringTag](){return"GraphQLInterfaceType"}getFields(){return"function"==typeof this._fields&&(this._fields=this._fields()),this._fields}getInterfaces(){return"function"==typeof this._interfaces&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:q(this.getFields()),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}i.GraphQLInterfaceType=H;class W{constructor(e){var t;this.name=(0,g.assertName)(e.name),this.description=e.description,this.resolveType=e.resolveType,this.extensions=(0,h.toObjMap)(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!=(t=e.extensionASTNodes)?t:[],this._types=Y.bind(void 0,e),null==e.resolveType||"function"==typeof e.resolveType||(0,n.devAssert)(!1,`${this.name} must provide "resolveType" as a function, but got: ${(0,s.inspect)(e.resolveType)}.`)}get[Symbol.toStringTag](){return"GraphQLUnionType"}getTypes(){return"function"==typeof this._types&&(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 Y(e){let t=U(e.types);return Array.isArray(t)||(0,n.devAssert)(!1,`Must provide Array of types or a function which returns such an array for Union ${e.name}.`),t}i.GraphQLUnionType=W;class z{constructor(e){var t;this.name=(0,g.assertName)(e.name),this.description=e.description,this.extensions=(0,h.toObjMap)(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!=(t=e.extensionASTNodes)?t:[],this._values="function"==typeof e.values?e.values:Z(this.name,e.values),this._valueLookup=null,this._nameLookup=null}get[Symbol.toStringTag](){return"GraphQLEnumType"}getValues(){return"function"==typeof this._values&&(this._values=Z(this.name,this._values())),this._values}getValue(e){return null===this._nameLookup&&(this._nameLookup=(0,u.keyMap)(this.getValues(),e=>e.name)),this._nameLookup[e]}serialize(e){null===this._valueLookup&&(this._valueLookup=new Map(this.getValues().map(e=>[e.value,e])));let t=this._valueLookup.get(e);if(void 0===t)throw new f.GraphQLError(`Enum "${this.name}" cannot represent value: ${(0,s.inspect)(e)}`);return t.name}parseValue(e){if("string"!=typeof e){let t=(0,s.inspect)(e);throw new f.GraphQLError(`Enum "${this.name}" cannot represent non-string value: ${t}.`+X(this,t))}let t=this.getValue(e);if(null==t)throw new f.GraphQLError(`Value "${e}" does not exist in "${this.name}" enum.`+X(this,e));return t.value}parseLiteral(e,t){if(e.kind!==m.Kind.ENUM){let t=(0,y.print)(e);throw new f.GraphQLError(`Enum "${this.name}" cannot represent non-enum value: ${t}.`+X(this,t),{nodes:e})}let i=this.getValue(e.value);if(null==i){let t=(0,y.print)(e);throw new f.GraphQLError(`Value "${t}" does not exist in "${this.name}" enum.`+X(this,t),{nodes:e})}return i.value}toConfig(){let e=(0,c.keyValMap)(this.getValues(),e=>e.name,e=>({description:e.description,value:e.value,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode}));return{name:this.name,description:this.description,values:e,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function X(e,t){let i=e.getValues().map(e=>e.name),n=(0,p.suggestionList)(t,i);return(0,r.didYouMean)("the enum value",n)}function Z(e,t){return Q(t)||(0,n.devAssert)(!1,`${e} values must be an object with value names as keys.`),Object.entries(t).map(([t,i])=>(Q(i)||(0,n.devAssert)(!1,`${e}.${t} must refer to an object with a "value" key representing an internal value but got: ${(0,s.inspect)(i)}.`),{name:(0,g.assertEnumValueName)(t),description:i.description,value:void 0!==i.value?i.value:t,deprecationReason:i.deprecationReason,extensions:(0,h.toObjMap)(i.extensions),astNode:i.astNode}))}i.GraphQLEnumType=z;class ee{constructor(e){var t,i;this.name=(0,g.assertName)(e.name),this.description=e.description,this.extensions=(0,h.toObjMap)(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!=(t=e.extensionASTNodes)?t:[],this.isOneOf=null!=(i=e.isOneOf)&&i,this._fields=et.bind(void 0,e)}get[Symbol.toStringTag](){return"GraphQLInputObjectType"}getFields(){return"function"==typeof this._fields&&(this._fields=this._fields()),this._fields}toConfig(){let e=(0,d.mapValue)(this.getFields(),e=>({description:e.description,type:e.type,defaultValue:e.defaultValue,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode}));return{name:this.name,description:this.description,fields:e,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,isOneOf:this.isOneOf}}toString(){return this.name}toJSON(){return this.toString()}}function et(e){let t=$(e.fields);return Q(t)||(0,n.devAssert)(!1,`${e.name} fields must be an object with field names as keys or a function which returns such an object.`),(0,d.mapValue)(t,(t,i)=>("resolve"in t&&(0,n.devAssert)(!1,`${e.name}.${i} field has a resolve property, but Input Types cannot define resolvers.`),{name:(0,g.assertName)(i),description:t.description,type:t.type,defaultValue:t.defaultValue,deprecationReason:t.deprecationReason,extensions:(0,h.toObjMap)(t.extensions),astNode:t.astNode}))}i.GraphQLInputObjectType=ee},957861,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.doTypesOverlap=function(e,t,i){return t===i||((0,n.isAbstractType)(t)?(0,n.isAbstractType)(i)?e.getPossibleTypes(t).some(t=>e.isSubType(i,t)):e.isSubType(t,i):!!(0,n.isAbstractType)(i)&&e.isSubType(i,t))},i.isEqualType=function e(t,i){return t===i||!!((0,n.isNonNullType)(t)&&(0,n.isNonNullType)(i)||(0,n.isListType)(t)&&(0,n.isListType)(i))&&e(t.ofType,i.ofType)},i.isTypeSubTypeOf=function e(t,i,r){return i===r||((0,n.isNonNullType)(r)?!!(0,n.isNonNullType)(i)&&e(t,i.ofType,r.ofType):(0,n.isNonNullType)(i)?e(t,i.ofType,r):(0,n.isListType)(r)?!!(0,n.isListType)(i)&&e(t,i.ofType,r.ofType):!(0,n.isListType)(i)&&(0,n.isAbstractType)(r)&&((0,n.isInterfaceType)(i)||(0,n.isObjectType)(i))&&t.isSubType(r,i))};var n=e.r(211325)},142478,(e,t,i)=>{"use strict";var n,r;Object.defineProperty(i,"__esModule",{value:!0}),i.DirectiveLocation=void 0,i.DirectiveLocation=n,(r=n||(i.DirectiveLocation=n={})).QUERY="QUERY",r.MUTATION="MUTATION",r.SUBSCRIPTION="SUBSCRIPTION",r.FIELD="FIELD",r.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",r.FRAGMENT_SPREAD="FRAGMENT_SPREAD",r.INLINE_FRAGMENT="INLINE_FRAGMENT",r.VARIABLE_DEFINITION="VARIABLE_DEFINITION",r.SCHEMA="SCHEMA",r.SCALAR="SCALAR",r.OBJECT="OBJECT",r.FIELD_DEFINITION="FIELD_DEFINITION",r.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",r.INTERFACE="INTERFACE",r.UNION="UNION",r.ENUM="ENUM",r.ENUM_VALUE="ENUM_VALUE",r.INPUT_OBJECT="INPUT_OBJECT",r.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION",r.DIRECTIVE_DEFINITION="DIRECTIVE_DEFINITION"},947129,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.GraphQLString=i.GraphQLInt=i.GraphQLID=i.GraphQLFloat=i.GraphQLBoolean=i.GRAPHQL_MIN_INT=i.GRAPHQL_MAX_INT=void 0,i.isSpecifiedScalarType=function(e){return f.some(({name:t})=>e.name===t)},i.specifiedScalarTypes=void 0;var n=e.r(818123),r=e.r(776887),a=e.r(294943),s=e.r(199311),o=e.r(340647),l=e.r(211325);i.GRAPHQL_MAX_INT=0x7fffffff,i.GRAPHQL_MIN_INT=-0x80000000;let u=new l.GraphQLScalarType({name:"Int",description:"The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.",serialize(e){let t=m(e);if("boolean"==typeof t)return+!!t;let i=t;if("string"==typeof t&&""!==t&&(i=Number(t)),"number"!=typeof i||!Number.isInteger(i))throw new a.GraphQLError(`Int cannot represent non-integer value: ${(0,n.inspect)(t)}`);if(i>0x7fffffff||i<-0x80000000)throw new a.GraphQLError("Int cannot represent non 32-bit signed integer value: "+(0,n.inspect)(t));return i},parseValue(e){if("number"!=typeof e||!Number.isInteger(e))throw new a.GraphQLError(`Int cannot represent non-integer value: ${(0,n.inspect)(e)}`);if(e>0x7fffffff||e<-0x80000000)throw new a.GraphQLError(`Int cannot represent non 32-bit signed integer value: ${e}`);return e},parseLiteral(e){if(e.kind!==s.Kind.INT)throw new a.GraphQLError(`Int cannot represent non-integer value: ${(0,o.print)(e)}`,{nodes:e});let t=parseInt(e.value,10);if(t>0x7fffffff||t<-0x80000000)throw new a.GraphQLError(`Int cannot represent non 32-bit signed integer value: ${e.value}`,{nodes:e});return t}});i.GraphQLInt=u;let c=new l.GraphQLScalarType({name:"Float",description:"The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).",serialize(e){let t=m(e);if("boolean"==typeof t)return+!!t;let i=t;if("string"==typeof t&&""!==t&&(i=Number(t)),"number"!=typeof i||!Number.isFinite(i))throw new a.GraphQLError(`Float cannot represent non numeric value: ${(0,n.inspect)(t)}`);return i},parseValue(e){if("number"!=typeof e||!Number.isFinite(e))throw new a.GraphQLError(`Float cannot represent non numeric value: ${(0,n.inspect)(e)}`);return e},parseLiteral(e){if(e.kind!==s.Kind.FLOAT&&e.kind!==s.Kind.INT)throw new a.GraphQLError(`Float cannot represent non numeric value: ${(0,o.print)(e)}`,e);return parseFloat(e.value)}});i.GraphQLFloat=c;let d=new l.GraphQLScalarType({name:"String",description:"The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.",serialize(e){let t=m(e);if("string"==typeof t)return t;if("boolean"==typeof t)return t?"true":"false";if("number"==typeof t&&Number.isFinite(t))return t.toString();throw new a.GraphQLError(`String cannot represent value: ${(0,n.inspect)(e)}`)},parseValue(e){if("string"!=typeof e)throw new a.GraphQLError(`String cannot represent a non string value: ${(0,n.inspect)(e)}`);return e},parseLiteral(e){if(e.kind!==s.Kind.STRING)throw new a.GraphQLError(`String cannot represent a non string value: ${(0,o.print)(e)}`,{nodes:e});return e.value}});i.GraphQLString=d;let p=new l.GraphQLScalarType({name:"Boolean",description:"The `Boolean` scalar type represents `true` or `false`.",serialize(e){let t=m(e);if("boolean"==typeof t)return t;if(Number.isFinite(t))return 0!==t;throw new a.GraphQLError(`Boolean cannot represent a non boolean value: ${(0,n.inspect)(t)}`)},parseValue(e){if("boolean"!=typeof e)throw new a.GraphQLError(`Boolean cannot represent a non boolean value: ${(0,n.inspect)(e)}`);return e},parseLiteral(e){if(e.kind!==s.Kind.BOOLEAN)throw new a.GraphQLError(`Boolean cannot represent a non boolean value: ${(0,o.print)(e)}`,{nodes:e});return e.value}});i.GraphQLBoolean=p;let h=new l.GraphQLScalarType({name:"ID",description:'The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID.',serialize(e){let t=m(e);if("string"==typeof t)return t;if(Number.isInteger(t))return String(t);throw new a.GraphQLError(`ID cannot represent value: ${(0,n.inspect)(e)}`)},parseValue(e){if("string"==typeof e)return e;if("number"==typeof e&&Number.isInteger(e))return e.toString();throw new a.GraphQLError(`ID cannot represent value: ${(0,n.inspect)(e)}`)},parseLiteral(e){if(e.kind!==s.Kind.STRING&&e.kind!==s.Kind.INT)throw new a.GraphQLError("ID cannot represent a non-string and non-integer value: "+(0,o.print)(e),{nodes:e});return e.value}});i.GraphQLID=h;let f=Object.freeze([d,u,c,p,h]);function m(e){if((0,r.isObjectLike)(e)){if("function"==typeof e.valueOf){let t=e.valueOf();if(!(0,r.isObjectLike)(t))return t}if("function"==typeof e.toJSON)return e.toJSON()}return e}i.specifiedScalarTypes=f},336081,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.GraphQLSpecifiedByDirective=i.GraphQLSkipDirective=i.GraphQLOneOfDirective=i.GraphQLIncludeDirective=i.GraphQLDirective=i.GraphQLDeprecatedDirective=i.DEFAULT_DEPRECATION_REASON=void 0,i.assertDirective=function(e){if(!p(e))throw Error(`Expected ${(0,r.inspect)(e)} to be a GraphQL directive.`);return e},i.isDirective=p,i.isSpecifiedDirective=function(e){return S.some(({name:t})=>t===e.name)},i.specifiedDirectives=void 0;var n=e.r(786390),r=e.r(818123),a=e.r(792942),s=e.r(776887),o=e.r(605021),l=e.r(142478),u=e.r(999965),c=e.r(211325),d=e.r(947129);function p(e){return(0,a.instanceOf)(e,h)}class h{constructor(e){var t,i,r;this.name=(0,u.assertName)(e.name),this.description=e.description,this.locations=e.locations,this.isRepeatable=null!=(t=e.isRepeatable)&&t,this.deprecationReason=e.deprecationReason,this.extensions=(0,o.toObjMap)(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!=(i=e.extensionASTNodes)?i:[],Array.isArray(e.locations)||(0,n.devAssert)(!1,`@${e.name} locations must be an Array.`);const a=null!=(r=e.args)?r:{};(0,s.isObjectLike)(a)&&!Array.isArray(a)||(0,n.devAssert)(!1,`@${e.name} args must be an object with argument names as keys.`),this.args=(0,c.defineArguments)(a)}get[Symbol.toStringTag](){return"GraphQLDirective"}toConfig(){return{name:this.name,description:this.description,locations:this.locations,args:(0,c.argsToArgsConfig)(this.args),isRepeatable:this.isRepeatable,deprecationReason:this.deprecationReason,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return"@"+this.name}toJSON(){return this.toString()}}i.GraphQLDirective=h;let f=new h({name:"include",description:"Directs the executor to include this field or fragment only when the `if` argument is true.",locations:[l.DirectiveLocation.FIELD,l.DirectiveLocation.FRAGMENT_SPREAD,l.DirectiveLocation.INLINE_FRAGMENT],args:{if:{type:new c.GraphQLNonNull(d.GraphQLBoolean),description:"Included when true."}}});i.GraphQLIncludeDirective=f;let m=new h({name:"skip",description:"Directs the executor to skip this field or fragment when the `if` argument is true.",locations:[l.DirectiveLocation.FIELD,l.DirectiveLocation.FRAGMENT_SPREAD,l.DirectiveLocation.INLINE_FRAGMENT],args:{if:{type:new c.GraphQLNonNull(d.GraphQLBoolean),description:"Skipped when true."}}});i.GraphQLSkipDirective=m;let y="No longer supported";i.DEFAULT_DEPRECATION_REASON=y;let v=new h({name:"deprecated",description:"Marks an element of a GraphQL schema as no longer supported.",locations:[l.DirectiveLocation.FIELD_DEFINITION,l.DirectiveLocation.ARGUMENT_DEFINITION,l.DirectiveLocation.INPUT_FIELD_DEFINITION,l.DirectiveLocation.ENUM_VALUE,l.DirectiveLocation.DIRECTIVE_DEFINITION],args:{reason:{type:d.GraphQLString,description:"Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/).",defaultValue:y}}});i.GraphQLDeprecatedDirective=v;let g=new h({name:"specifiedBy",description:"Exposes a URL that specifies the behavior of this scalar.",locations:[l.DirectiveLocation.SCALAR],args:{url:{type:new c.GraphQLNonNull(d.GraphQLString),description:"The URL that specifies the behavior of this scalar."}}});i.GraphQLSpecifiedByDirective=g;let T=new h({name:"oneOf",description:"Indicates exactly one field must be supplied and this field must not be `null`.",locations:[l.DirectiveLocation.INPUT_OBJECT],args:{}});i.GraphQLOneOfDirective=T;let S=Object.freeze([f,m,v,g,T]);i.specifiedDirectives=S},891275,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.isIterableObject=function(e){return"object"==typeof e&&"function"==typeof(null==e?void 0:e[Symbol.iterator])}},434582,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.astFromValue=function e(t,i){if((0,l.isNonNullType)(i)){let n=e(t,i.ofType);return(null==n?void 0:n.kind)===o.Kind.NULL?null:n}if(null===t)return{kind:o.Kind.NULL};if(void 0===t)return null;if((0,l.isListType)(i)){let n=i.ofType;if((0,a.isIterableObject)(t)){let i=[];for(let r of t){let t=e(r,n);null!=t&&i.push(t)}return{kind:o.Kind.LIST,values:i}}return e(t,n)}if((0,l.isInputObjectType)(i)){if(!(0,s.isObjectLike)(t))return null;let n=[];for(let r of Object.values(i.getFields())){let i=e(t[r.name],r.type);i&&n.push({kind:o.Kind.OBJECT_FIELD,name:{kind:o.Kind.NAME,value:r.name},value:i})}return{kind:o.Kind.OBJECT,fields:n}}if((0,l.isLeafType)(i)){let e=i.serialize(t);if(null==e)return null;if("boolean"==typeof e)return{kind:o.Kind.BOOLEAN,value:e};if("number"==typeof e&&Number.isFinite(e)){let t=String(e);return c.test(t)?{kind:o.Kind.INT,value:t}:{kind:o.Kind.FLOAT,value:t}}if("string"==typeof e)return(0,l.isEnumType)(i)?{kind:o.Kind.ENUM,value:e}:i===u.GraphQLID&&c.test(e)?{kind:o.Kind.INT,value:e}:{kind:o.Kind.STRING,value:e};throw TypeError(`Cannot convert value to AST: ${(0,n.inspect)(e)}.`)}(0,r.invariant)(!1,"Unexpected input type: "+(0,n.inspect)(i))};var n=e.r(818123),r=e.r(119588),a=e.r(891275),s=e.r(776887),o=e.r(199311),l=e.r(211325),u=e.r(947129);let c=/^-?(?:0|[1-9][0-9]*)$/},187936,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.introspectionTypes=i.__TypeKind=i.__Type=i.__Schema=i.__InputValue=i.__Field=i.__EnumValue=i.__DirectiveLocation=i.__Directive=i.TypeNameMetaFieldDef=i.TypeMetaFieldDef=i.TypeKind=i.SchemaMetaFieldDef=void 0,i.isIntrospectionType=function(e){return S.some(({name:t})=>e.name===t)};var n,r,a=e.r(818123),s=e.r(119588),o=e.r(142478),l=e.r(340647),u=e.r(434582),c=e.r(211325),d=e.r(947129);let p=new c.GraphQLObjectType({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:d.GraphQLString,resolve:e=>e.description},types:{description:"A list of all types supported by this server.",type:new c.GraphQLNonNull(new c.GraphQLList(new c.GraphQLNonNull(m))),resolve:e=>Object.values(e.getTypeMap())},queryType:{description:"The type that query operations will be rooted at.",type:new c.GraphQLNonNull(m),resolve:e=>e.getQueryType()},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:m,resolve:e=>e.getMutationType()},subscriptionType:{description:"If this server support subscription, the type that subscription operations will be rooted at.",type:m,resolve:e=>e.getSubscriptionType()},directives:{description:"A list of all directives supported by this server.",type:new c.GraphQLNonNull(new c.GraphQLList(new c.GraphQLNonNull(h))),args:{includeDeprecated:{type:new c.GraphQLNonNull(d.GraphQLBoolean),defaultValue:!1}},resolve:(e,{includeDeprecated:t})=>t?e.getDirectives():e.getDirectives().filter(e=>null==e.deprecationReason)}})});i.__Schema=p;let h=new c.GraphQLObjectType({name:"__Directive",description:"A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.\n\nIn 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 c.GraphQLNonNull(d.GraphQLString),resolve:e=>e.name},description:{type:d.GraphQLString,resolve:e=>e.description},isRepeatable:{type:new c.GraphQLNonNull(d.GraphQLBoolean),resolve:e=>e.isRepeatable},locations:{type:new c.GraphQLNonNull(new c.GraphQLList(new c.GraphQLNonNull(f))),resolve:e=>e.locations},args:{type:new c.GraphQLNonNull(new c.GraphQLList(new c.GraphQLNonNull(v))),args:{includeDeprecated:{type:d.GraphQLBoolean,defaultValue:!1}},resolve:(e,{includeDeprecated:t})=>t?e.args:e.args.filter(e=>null==e.deprecationReason)},isDeprecated:{type:new c.GraphQLNonNull(d.GraphQLBoolean),resolve:e=>null!=e.deprecationReason},deprecationReason:{type:d.GraphQLString,resolve:e=>e.deprecationReason}})});i.__Directive=h;let f=new c.GraphQLEnumType({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:o.DirectiveLocation.QUERY,description:"Location adjacent to a query operation."},MUTATION:{value:o.DirectiveLocation.MUTATION,description:"Location adjacent to a mutation operation."},SUBSCRIPTION:{value:o.DirectiveLocation.SUBSCRIPTION,description:"Location adjacent to a subscription operation."},FIELD:{value:o.DirectiveLocation.FIELD,description:"Location adjacent to a field."},FRAGMENT_DEFINITION:{value:o.DirectiveLocation.FRAGMENT_DEFINITION,description:"Location adjacent to a fragment definition."},FRAGMENT_SPREAD:{value:o.DirectiveLocation.FRAGMENT_SPREAD,description:"Location adjacent to a fragment spread."},INLINE_FRAGMENT:{value:o.DirectiveLocation.INLINE_FRAGMENT,description:"Location adjacent to an inline fragment."},VARIABLE_DEFINITION:{value:o.DirectiveLocation.VARIABLE_DEFINITION,description:"Location adjacent to a variable definition."},SCHEMA:{value:o.DirectiveLocation.SCHEMA,description:"Location adjacent to a schema definition."},SCALAR:{value:o.DirectiveLocation.SCALAR,description:"Location adjacent to a scalar definition."},OBJECT:{value:o.DirectiveLocation.OBJECT,description:"Location adjacent to an object type definition."},FIELD_DEFINITION:{value:o.DirectiveLocation.FIELD_DEFINITION,description:"Location adjacent to a field definition."},ARGUMENT_DEFINITION:{value:o.DirectiveLocation.ARGUMENT_DEFINITION,description:"Location adjacent to an argument definition."},INTERFACE:{value:o.DirectiveLocation.INTERFACE,description:"Location adjacent to an interface definition."},UNION:{value:o.DirectiveLocation.UNION,description:"Location adjacent to a union definition."},ENUM:{value:o.DirectiveLocation.ENUM,description:"Location adjacent to an enum definition."},ENUM_VALUE:{value:o.DirectiveLocation.ENUM_VALUE,description:"Location adjacent to an enum value definition."},INPUT_OBJECT:{value:o.DirectiveLocation.INPUT_OBJECT,description:"Location adjacent to an input object type definition."},INPUT_FIELD_DEFINITION:{value:o.DirectiveLocation.INPUT_FIELD_DEFINITION,description:"Location adjacent to an input object field definition."},DIRECTIVE_DEFINITION:{value:o.DirectiveLocation.DIRECTIVE_DEFINITION,description:"Location adjacent to a directive definition."}}});i.__DirectiveLocation=f;let m=new c.GraphQLObjectType({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 c.GraphQLNonNull(T),resolve:e=>(0,c.isScalarType)(e)?r.SCALAR:(0,c.isObjectType)(e)?r.OBJECT:(0,c.isInterfaceType)(e)?r.INTERFACE:(0,c.isUnionType)(e)?r.UNION:(0,c.isEnumType)(e)?r.ENUM:(0,c.isInputObjectType)(e)?r.INPUT_OBJECT:(0,c.isListType)(e)?r.LIST:(0,c.isNonNullType)(e)?r.NON_NULL:void(0,s.invariant)(!1,`Unexpected type: "${(0,a.inspect)(e)}".`)},name:{type:d.GraphQLString,resolve:e=>"name"in e?e.name:void 0},description:{type:d.GraphQLString,resolve:e=>"description"in e?e.description:void 0},specifiedByURL:{type:d.GraphQLString,resolve:e=>"specifiedByURL"in e?e.specifiedByURL:void 0},fields:{type:new c.GraphQLList(new c.GraphQLNonNull(y)),args:{includeDeprecated:{type:d.GraphQLBoolean,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if((0,c.isObjectType)(e)||(0,c.isInterfaceType)(e)){let i=Object.values(e.getFields());return t?i:i.filter(e=>null==e.deprecationReason)}}},interfaces:{type:new c.GraphQLList(new c.GraphQLNonNull(m)),resolve(e){if((0,c.isObjectType)(e)||(0,c.isInterfaceType)(e))return e.getInterfaces()}},possibleTypes:{type:new c.GraphQLList(new c.GraphQLNonNull(m)),resolve(e,t,i,{schema:n}){if((0,c.isAbstractType)(e))return n.getPossibleTypes(e)}},enumValues:{type:new c.GraphQLList(new c.GraphQLNonNull(g)),args:{includeDeprecated:{type:d.GraphQLBoolean,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if((0,c.isEnumType)(e)){let i=e.getValues();return t?i:i.filter(e=>null==e.deprecationReason)}}},inputFields:{type:new c.GraphQLList(new c.GraphQLNonNull(v)),args:{includeDeprecated:{type:d.GraphQLBoolean,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if((0,c.isInputObjectType)(e)){let i=Object.values(e.getFields());return t?i:i.filter(e=>null==e.deprecationReason)}}},ofType:{type:m,resolve:e=>"ofType"in e?e.ofType:void 0},isOneOf:{type:d.GraphQLBoolean,resolve:e=>{if((0,c.isInputObjectType)(e))return e.isOneOf}}})});i.__Type=m;let y=new c.GraphQLObjectType({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 c.GraphQLNonNull(d.GraphQLString),resolve:e=>e.name},description:{type:d.GraphQLString,resolve:e=>e.description},args:{type:new c.GraphQLNonNull(new c.GraphQLList(new c.GraphQLNonNull(v))),args:{includeDeprecated:{type:d.GraphQLBoolean,defaultValue:!1}},resolve:(e,{includeDeprecated:t})=>t?e.args:e.args.filter(e=>null==e.deprecationReason)},type:{type:new c.GraphQLNonNull(m),resolve:e=>e.type},isDeprecated:{type:new c.GraphQLNonNull(d.GraphQLBoolean),resolve:e=>null!=e.deprecationReason},deprecationReason:{type:d.GraphQLString,resolve:e=>e.deprecationReason}})});i.__Field=y;let v=new c.GraphQLObjectType({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 c.GraphQLNonNull(d.GraphQLString),resolve:e=>e.name},description:{type:d.GraphQLString,resolve:e=>e.description},type:{type:new c.GraphQLNonNull(m),resolve:e=>e.type},defaultValue:{type:d.GraphQLString,description:"A GraphQL-formatted string representing the default value for this input value.",resolve(e){let{type:t,defaultValue:i}=e,n=(0,u.astFromValue)(i,t);return n?(0,l.print)(n):null}},isDeprecated:{type:new c.GraphQLNonNull(d.GraphQLBoolean),resolve:e=>null!=e.deprecationReason},deprecationReason:{type:d.GraphQLString,resolve:e=>e.deprecationReason}})});i.__InputValue=v;let g=new c.GraphQLObjectType({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 c.GraphQLNonNull(d.GraphQLString),resolve:e=>e.name},description:{type:d.GraphQLString,resolve:e=>e.description},isDeprecated:{type:new c.GraphQLNonNull(d.GraphQLBoolean),resolve:e=>null!=e.deprecationReason},deprecationReason:{type:d.GraphQLString,resolve:e=>e.deprecationReason}})});i.__EnumValue=g,i.TypeKind=r,(n=r||(i.TypeKind=r={})).SCALAR="SCALAR",n.OBJECT="OBJECT",n.INTERFACE="INTERFACE",n.UNION="UNION",n.ENUM="ENUM",n.INPUT_OBJECT="INPUT_OBJECT",n.LIST="LIST",n.NON_NULL="NON_NULL";let T=new c.GraphQLEnumType({name:"__TypeKind",description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:r.SCALAR,description:"Indicates this type is a scalar."},OBJECT:{value:r.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:r.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:r.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:r.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:r.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:r.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:r.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}});i.__TypeKind=T,i.SchemaMetaFieldDef={name:"__schema",type:new c.GraphQLNonNull(p),description:"Access the current type schema of this server.",args:[],resolve:(e,t,i,{schema:n})=>n,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},i.TypeMetaFieldDef={name:"__type",type:m,description:"Request the type information of a single type.",args:[{name:"name",description:void 0,type:new c.GraphQLNonNull(d.GraphQLString),defaultValue:void 0,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0}],resolve:(e,{name:t},i,{schema:n})=>n.getType(t),deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},i.TypeNameMetaFieldDef={name:"__typename",type:new c.GraphQLNonNull(d.GraphQLString),description:"The name of the current Object type at runtime.",args:[],resolve:(e,t,i,{parentType:n})=>n.name,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0};let S=Object.freeze([p,h,f,m,y,v,g,T]);i.introspectionTypes=S},763628,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.GraphQLSchema=void 0,i.assertSchema=function(e){if(!p(e))throw Error(`Expected ${(0,r.inspect)(e)} to be a GraphQL schema.`);return e},i.isSchema=p;var n=e.r(786390),r=e.r(818123),a=e.r(792942),s=e.r(776887),o=e.r(605021),l=e.r(463040),u=e.r(211325),c=e.r(336081),d=e.r(187936);function p(e){return(0,a.instanceOf)(e,h)}class h{constructor(e){var t,i;this.__validationErrors=!0===e.assumeValid?[]:void 0,(0,s.isObjectLike)(e)||(0,n.devAssert)(!1,"Must provide configuration object."),!e.types||Array.isArray(e.types)||(0,n.devAssert)(!1,`"types" must be Array if provided but got: ${(0,r.inspect)(e.types)}.`),!e.directives||Array.isArray(e.directives)||(0,n.devAssert)(!1,`"directives" must be Array if provided but got: ${(0,r.inspect)(e.directives)}.`),this.description=e.description,this.extensions=(0,o.toObjMap)(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!=(t=e.extensionASTNodes)?t:[],this._queryType=e.query,this._mutationType=e.mutation,this._subscriptionType=e.subscription,this._directives=null!=(i=e.directives)?i:c.specifiedDirectives;const a=new Set(e.types);if(null!=e.types)for(const t of e.types)a.delete(t),f(t,a);for(const e of(null!=this._queryType&&f(this._queryType,a),null!=this._mutationType&&f(this._mutationType,a),null!=this._subscriptionType&&f(this._subscriptionType,a),this._directives))if((0,c.isDirective)(e))for(const t of e.args)f(t.type,a);for(const e of(f(d.__Schema,a),this._typeMap=Object.create(null),this._subTypeMap=Object.create(null),this._implementationsMap=Object.create(null),a)){if(null==e)continue;const t=e.name;if(t||(0,n.devAssert)(!1,"One of the provided types for building the Schema is missing a name."),void 0!==this._typeMap[t])throw Error(`Schema must contain uniquely named types but contains multiple types named "${t}".`);if(this._typeMap[t]=e,(0,u.isInterfaceType)(e)){for(const t of e.getInterfaces())if((0,u.isInterfaceType)(t)){let i=this._implementationsMap[t.name];void 0===i&&(i=this._implementationsMap[t.name]={objects:[],interfaces:[]}),i.interfaces.push(e)}}else if((0,u.isObjectType)(e)){for(const t of e.getInterfaces())if((0,u.isInterfaceType)(t)){let i=this._implementationsMap[t.name];void 0===i&&(i=this._implementationsMap[t.name]={objects:[],interfaces:[]}),i.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 l.OperationTypeNode.QUERY:return this.getQueryType();case l.OperationTypeNode.MUTATION:return this.getMutationType();case l.OperationTypeNode.SUBSCRIPTION:return this.getSubscriptionType()}}getTypeMap(){return this._typeMap}getType(e){return this.getTypeMap()[e]}getPossibleTypes(e){return(0,u.isUnionType)(e)?e.getTypes():this.getImplementations(e).objects}getImplementations(e){let t=this._implementationsMap[e.name];return null!=t?t:{objects:[],interfaces:[]}}isSubType(e,t){let i=this._subTypeMap[e.name];if(void 0===i){if(i=Object.create(null),(0,u.isUnionType)(e))for(let t of e.getTypes())i[t.name]=!0;else{let t=this.getImplementations(e);for(let e of t.objects)i[e.name]=!0;for(let e of t.interfaces)i[e.name]=!0}this._subTypeMap[e.name]=i}return void 0!==i[t.name]}getDirectives(){return this._directives}getDirective(e){return this.getDirectives().find(t=>t.name===e)}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:void 0!==this.__validationErrors}}}function f(e,t){let i=(0,u.getNamedType)(e);if(!t.has(i)){if(t.add(i),(0,u.isUnionType)(i))for(let e of i.getTypes())f(e,t);else if((0,u.isObjectType)(i)||(0,u.isInterfaceType)(i)){for(let e of i.getInterfaces())f(e,t);for(let e of Object.values(i.getFields()))for(let i of(f(e.type,t),e.args))f(i.type,t)}else if((0,u.isInputObjectType)(i))for(let e of Object.values(i.getFields()))f(e.type,t)}return t}i.GraphQLSchema=h},215956,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.assertValidSchema=function(e){let t=d(e);if(0!==t.length)throw Error(t.map(e=>e.message).join("\n\n"))},i.validateSchema=d;var n=e.r(818123),r=e.r(294943),a=e.r(463040),s=e.r(957861),o=e.r(211325),l=e.r(336081),u=e.r(187936),c=e.r(763628);function d(e){var t,i,r,d;let g,T,S,E;if((0,c.assertSchema)(e),e.__validationErrors)return e.__validationErrors;let I=new p(e);(T=(g=(t=I).schema).getQueryType())?(0,o.isObjectType)(T)||t.reportError(`Query root type must be Object type, it cannot be ${(0,n.inspect)(T)}.`,null!=(i=h(g,a.OperationTypeNode.QUERY))?i:T.astNode):t.reportError("Query root type must be provided.",g.astNode),(S=g.getMutationType())&&!(0,o.isObjectType)(S)&&t.reportError(`Mutation root type must be Object type if provided, it cannot be ${(0,n.inspect)(S)}.`,null!=(r=h(g,a.OperationTypeNode.MUTATION))?r:S.astNode),(E=g.getSubscriptionType())&&!(0,o.isObjectType)(E)&&t.reportError(`Subscription root type must be Object type if provided, it cannot be ${(0,n.inspect)(E)}.`,null!=(d=h(g,a.OperationTypeNode.SUBSCRIPTION))?d:E.astNode),function(e){for(let i of e.schema.getDirectives()){if(!(0,l.isDirective)(i)){e.reportError(`Expected directive but got: ${(0,n.inspect)(i)}.`,null==i?void 0:i.astNode);continue}for(let r of(f(e,i),0===i.locations.length&&e.reportError(`Directive @${i.name} must include 1 or more locations.`,i.astNode),i.args))if(f(e,r),(0,o.isInputType)(r.type)||e.reportError(`The type of @${i.name}(${r.name}:) must be Input Type but got: ${(0,n.inspect)(r.type)}.`,r.astNode),(0,o.isRequiredArgument)(r)&&null!=r.deprecationReason){var t;e.reportError(`Required argument @${i.name}(${r.name}:) cannot be deprecated.`,[v(r.astNode),null==(t=r.astNode)?void 0:t.type])}}}(I),function(e){var t;let i,r,a,l=(t=e,i=Object.create(null),r=[],a=Object.create(null),function e(n){if(!i[n.name]){for(let s of(i[n.name]=!0,a[n.name]=r.length,Object.values(n.getFields())))if((0,o.isNonNullType)(s.type)&&(0,o.isInputObjectType)(s.type.ofType)){let i=s.type.ofType,n=a[i.name];if(r.push(s),void 0===n)e(i);else{let e=r.slice(n),a=e.map(e=>e.name).join(".");t.reportError(`Cannot reference Input Object "${i.name}" within itself through a series of non-null fields: "${a}".`,e.map(e=>e.astNode))}r.pop()}a[n.name]=void 0}});for(let t of Object.values(e.schema.getTypeMap())){if(!(0,o.isNamedType)(t)){e.reportError(`Expected GraphQL named type but got: ${(0,n.inspect)(t)}.`,t.astNode);continue}(0,u.isIntrospectionType)(t)||f(e,t),(0,o.isObjectType)(t)||(0,o.isInterfaceType)(t)?(function(e,t){let i=Object.values(t.getFields());for(let l of(0===i.length&&e.reportError(`Type ${t.name} must define one or more fields.`,[t.astNode,...t.extensionASTNodes]),i)){var r,a,s;for(let i of(f(e,l),(0,o.isOutputType)(l.type)||e.reportError(`The type of ${t.name}.${l.name} must be Output Type but got: ${(0,n.inspect)(l.type)}.`,null==(r=l.astNode)?void 0:r.type),l.args)){let r=i.name;f(e,i),(0,o.isInputType)(i.type)||e.reportError(`The type of ${t.name}.${l.name}(${r}:) must be Input Type but got: ${(0,n.inspect)(i.type)}.`,null==(a=i.astNode)?void 0:a.type),(0,o.isRequiredArgument)(i)&&null!=i.deprecationReason&&e.reportError(`Required argument ${t.name}.${l.name}(${r}:) cannot be deprecated.`,[v(i.astNode),null==(s=i.astNode)?void 0:s.type])}}}(e,t),function(e,t){let i=Object.create(null);for(let r of t.getInterfaces()){if(!(0,o.isInterfaceType)(r)){e.reportError(`Type ${(0,n.inspect)(t)} must only implement Interface types, it cannot implement ${(0,n.inspect)(r)}.`,m(t,r));continue}if(t===r){e.reportError(`Type ${t.name} cannot implement itself because it would create a circular reference.`,m(t,r));continue}if(i[r.name]){e.reportError(`Type ${t.name} can only implement ${r.name} once.`,m(t,r));continue}i[r.name]=!0,function(e,t,i){let n=t.getInterfaces();for(let r of i.getInterfaces())n.includes(r)||e.reportError(r===t?`Type ${t.name} cannot implement ${i.name} because it would create a circular reference.`:`Type ${t.name} must implement ${r.name} because it is implemented by ${i.name}.`,[...m(i,r),...m(t,i)])}(e,t,r),function(e,t,i){let r=t.getFields();for(let d of Object.values(i.getFields())){var a,l,u,c;let p=d.name,h=r[p];if(!h){e.reportError(`Interface field ${i.name}.${p} expected but ${t.name} does not provide it.`,[d.astNode,t.astNode,...t.extensionASTNodes]);continue}for(let r of((0,s.isTypeSubTypeOf)(e.schema,h.type,d.type)||e.reportError(`Interface field ${i.name}.${p} expects type ${(0,n.inspect)(d.type)} but ${t.name}.${p} is type ${(0,n.inspect)(h.type)}.`,[null==(a=d.astNode)?void 0:a.type,null==(l=h.astNode)?void 0:l.type]),d.args)){let a=r.name,o=h.args.find(e=>e.name===a);if(!o){e.reportError(`Interface field argument ${i.name}.${p}(${a}:) expected but ${t.name}.${p} does not provide it.`,[r.astNode,h.astNode]);continue}(0,s.isEqualType)(r.type,o.type)||e.reportError(`Interface field argument ${i.name}.${p}(${a}:) expects type ${(0,n.inspect)(r.type)} but ${t.name}.${p}(${a}:) is type ${(0,n.inspect)(o.type)}.`,[null==(u=r.astNode)?void 0:u.type,null==(c=o.astNode)?void 0:c.type])}for(let n of h.args){let r=n.name;!d.args.find(e=>e.name===r)&&(0,o.isRequiredArgument)(n)&&e.reportError(`Object field ${t.name}.${p} includes required argument ${r} that is missing from the Interface field ${i.name}.${p}.`,[n.astNode,d.astNode])}}}(e,t,r)}}(e,t)):(0,o.isUnionType)(t)?function(e,t){let i=t.getTypes();0===i.length&&e.reportError(`Union type ${t.name} must define one or more member types.`,[t.astNode,...t.extensionASTNodes]);let r=Object.create(null);for(let a of i){if(r[a.name]){e.reportError(`Union type ${t.name} can only include type ${a.name} once.`,y(t,a.name));continue}r[a.name]=!0,(0,o.isObjectType)(a)||e.reportError(`Union type ${t.name} can only include Object types, it cannot include ${(0,n.inspect)(a)}.`,y(t,String(a)))}}(e,t):(0,o.isEnumType)(t)?function(e,t){let i=t.getValues();for(let n of(0===i.length&&e.reportError(`Enum type ${t.name} must define one or more values.`,[t.astNode,...t.extensionASTNodes]),i))f(e,n)}(e,t):(0,o.isInputObjectType)(t)&&(function(e,t){let i=Object.values(t.getFields());for(let s of(0===i.length&&e.reportError(`Input Object type ${t.name} must define one or more fields.`,[t.astNode,...t.extensionASTNodes]),i)){var r,a;f(e,s),(0,o.isInputType)(s.type)||e.reportError(`The type of ${t.name}.${s.name} must be Input Type but got: ${(0,n.inspect)(s.type)}.`,null==(r=s.astNode)?void 0:r.type),(0,o.isRequiredInputField)(s)&&null!=s.deprecationReason&&e.reportError(`Required input field ${t.name}.${s.name} cannot be deprecated.`,[v(s.astNode),null==(a=s.astNode)?void 0:a.type]),t.isOneOf&&function(e,t,i){if((0,o.isNonNullType)(t.type)){var n;i.reportError(`OneOf input field ${e.name}.${t.name} must be nullable.`,null==(n=t.astNode)?void 0:n.type)}void 0!==t.defaultValue&&i.reportError(`OneOf input field ${e.name}.${t.name} cannot have a default value.`,t.astNode)}(t,s,e)}}(e,t),l(t))}}(I);let b=I.getErrors();return e.__validationErrors=b,b}class p{constructor(e){this._errors=[],this.schema=e}reportError(e,t){let i=Array.isArray(t)?t.filter(Boolean):t;this._errors.push(new r.GraphQLError(e,{nodes:i}))}getErrors(){return this._errors}}function h(e,t){var i;return null==(i=[e.astNode,...e.extensionASTNodes].flatMap(e=>{var t;return null!=(t=null==e?void 0:e.operationTypes)?t:[]}).find(e=>e.operation===t))?void 0:i.type}function f(e,t){t.name.startsWith("__")&&e.reportError(`Name "${t.name}" must not begin with "__", which is reserved by GraphQL introspection.`,t.astNode)}function m(e,t){let{astNode:i,extensionASTNodes:n}=e;return(null!=i?[i,...n]:n).flatMap(e=>{var t;return null!=(t=e.interfaces)?t:[]}).filter(e=>e.name.value===t.name)}function y(e,t){let{astNode:i,extensionASTNodes:n}=e;return(null!=i?[i,...n]:n).flatMap(e=>{var t;return null!=(t=e.types)?t:[]}).filter(e=>e.name.value===t)}function v(e){var t;return null==e||null==(t=e.directives)?void 0:t.find(e=>e.name.value===l.GraphQLDeprecatedDirective.name)}},653704,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.typeFromAST=function e(t,i){switch(i.kind){case n.Kind.LIST_TYPE:{let n=e(t,i.type);return n&&new r.GraphQLList(n)}case n.Kind.NON_NULL_TYPE:{let n=e(t,i.type);return n&&new r.GraphQLNonNull(n)}case n.Kind.NAMED_TYPE:return t.getType(i.name.value)}};var n=e.r(199311),r=e.r(211325)},928241,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.TypeInfo=void 0,i.visitWithTypeInfo=function(e,t){return{enter(...i){let r=i[0];e.enter(r);let s=(0,a.getEnterLeaveForKind)(t,r.kind).enter;if(s){let a=s.apply(t,i);return void 0!==a&&(e.leave(r),(0,n.isNode)(a)&&e.enter(a)),a}},leave(...i){let n,r=i[0],s=(0,a.getEnterLeaveForKind)(t,r.kind).leave;return s&&(n=s.apply(t,i)),e.leave(r),n}}};var n=e.r(463040),r=e.r(199311),a=e.r(999680),s=e.r(211325),o=e.r(187936),l=e.r(653704);class u{constructor(e,t,i){this._schema=e,this._typeStack=[],this._parentTypeStack=[],this._inputTypeStack=[],this._fieldDefStack=[],this._defaultValueStack=[],this._directive=null,this._argument=null,this._enumValue=null,this._getFieldDef=null!=i?i:c,t&&((0,s.isInputType)(t)&&this._inputTypeStack.push(t),(0,s.isCompositeType)(t)&&this._parentTypeStack.push(t),(0,s.isOutputType)(t)&&this._typeStack.push(t))}get[Symbol.toStringTag](){return"TypeInfo"}getType(){if(this._typeStack.length>0)return this._typeStack[this._typeStack.length-1]}getParentType(){if(this._parentTypeStack.length>0)return this._parentTypeStack[this._parentTypeStack.length-1]}getInputType(){if(this._inputTypeStack.length>0)return this._inputTypeStack[this._inputTypeStack.length-1]}getParentInputType(){if(this._inputTypeStack.length>1)return this._inputTypeStack[this._inputTypeStack.length-2]}getFieldDef(){if(this._fieldDefStack.length>0)return this._fieldDefStack[this._fieldDefStack.length-1]}getDefaultValue(){if(this._defaultValueStack.length>0)return this._defaultValueStack[this._defaultValueStack.length-1]}getDirective(){return this._directive}getArgument(){return this._argument}getEnumValue(){return this._enumValue}enter(e){let t=this._schema;switch(e.kind){case r.Kind.SELECTION_SET:{let e=(0,s.getNamedType)(this.getType());this._parentTypeStack.push((0,s.isCompositeType)(e)?e:void 0);break}case r.Kind.FIELD:{let i,n,r=this.getParentType();r&&(i=this._getFieldDef(t,r,e))&&(n=i.type),this._fieldDefStack.push(i),this._typeStack.push((0,s.isOutputType)(n)?n:void 0);break}case r.Kind.DIRECTIVE:this._directive=t.getDirective(e.name.value);break;case r.Kind.OPERATION_DEFINITION:{let i=t.getRootType(e.operation);this._typeStack.push((0,s.isObjectType)(i)?i:void 0);break}case r.Kind.INLINE_FRAGMENT:case r.Kind.FRAGMENT_DEFINITION:{let i=e.typeCondition,n=i?(0,l.typeFromAST)(t,i):(0,s.getNamedType)(this.getType());this._typeStack.push((0,s.isOutputType)(n)?n:void 0);break}case r.Kind.VARIABLE_DEFINITION:{let i=(0,l.typeFromAST)(t,e.type);this._inputTypeStack.push((0,s.isInputType)(i)?i:void 0);break}case r.Kind.ARGUMENT:{var i;let t,n,r=null!=(i=this.getDirective())?i:this.getFieldDef();r&&(t=r.args.find(t=>t.name===e.name.value))&&(n=t.type),this._argument=t,this._defaultValueStack.push(t?t.defaultValue:void 0),this._inputTypeStack.push((0,s.isInputType)(n)?n:void 0);break}case r.Kind.LIST:{let e=(0,s.getNullableType)(this.getInputType()),t=(0,s.isListType)(e)?e.ofType:e;this._defaultValueStack.push(void 0),this._inputTypeStack.push((0,s.isInputType)(t)?t:void 0);break}case r.Kind.OBJECT_FIELD:{let t,i,n=(0,s.getNamedType)(this.getInputType());(0,s.isInputObjectType)(n)&&(i=n.getFields()[e.name.value])&&(t=i.type),this._defaultValueStack.push(i?i.defaultValue:void 0),this._inputTypeStack.push((0,s.isInputType)(t)?t:void 0);break}case r.Kind.ENUM:{let t,i=(0,s.getNamedType)(this.getInputType());(0,s.isEnumType)(i)&&(t=i.getValue(e.value)),this._enumValue=t}}}leave(e){switch(e.kind){case r.Kind.SELECTION_SET:this._parentTypeStack.pop();break;case r.Kind.FIELD:this._fieldDefStack.pop(),this._typeStack.pop();break;case r.Kind.DIRECTIVE:this._directive=null;break;case r.Kind.OPERATION_DEFINITION:case r.Kind.INLINE_FRAGMENT:case r.Kind.FRAGMENT_DEFINITION:this._typeStack.pop();break;case r.Kind.VARIABLE_DEFINITION:this._inputTypeStack.pop();break;case r.Kind.ARGUMENT:this._argument=null,this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case r.Kind.LIST:case r.Kind.OBJECT_FIELD:this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case r.Kind.ENUM:this._enumValue=null}}}function c(e,t,i){let n=i.name.value;return n===o.SchemaMetaFieldDef.name&&e.getQueryType()===t?o.SchemaMetaFieldDef:n===o.TypeMetaFieldDef.name&&e.getQueryType()===t?o.TypeMetaFieldDef:n===o.TypeNameMetaFieldDef.name&&(0,s.isCompositeType)(t)?o.TypeNameMetaFieldDef:(0,s.isObjectType)(t)||(0,s.isInterfaceType)(t)?t.getFields()[n]:void 0}i.TypeInfo=u},940674,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.isConstValueNode=function e(t){return a(t)&&(t.kind===n.Kind.LIST?t.values.some(e):t.kind===n.Kind.OBJECT?t.fields.some(t=>e(t.value)):t.kind!==n.Kind.VARIABLE)},i.isDefinitionNode=function(e){return r(e)||s(e)||l(e)},i.isExecutableDefinitionNode=r,i.isSchemaCoordinateNode=function(e){return e.kind===n.Kind.TYPE_COORDINATE||e.kind===n.Kind.MEMBER_COORDINATE||e.kind===n.Kind.ARGUMENT_COORDINATE||e.kind===n.Kind.DIRECTIVE_COORDINATE||e.kind===n.Kind.DIRECTIVE_ARGUMENT_COORDINATE},i.isSelectionNode=function(e){return e.kind===n.Kind.FIELD||e.kind===n.Kind.FRAGMENT_SPREAD||e.kind===n.Kind.INLINE_FRAGMENT},i.isTypeDefinitionNode=o,i.isTypeExtensionNode=u,i.isTypeNode=function(e){return e.kind===n.Kind.NAMED_TYPE||e.kind===n.Kind.LIST_TYPE||e.kind===n.Kind.NON_NULL_TYPE},i.isTypeSystemDefinitionNode=s,i.isTypeSystemExtensionNode=l,i.isValueNode=a;var n=e.r(199311);function r(e){return e.kind===n.Kind.OPERATION_DEFINITION||e.kind===n.Kind.FRAGMENT_DEFINITION}function a(e){return e.kind===n.Kind.VARIABLE||e.kind===n.Kind.INT||e.kind===n.Kind.FLOAT||e.kind===n.Kind.STRING||e.kind===n.Kind.BOOLEAN||e.kind===n.Kind.NULL||e.kind===n.Kind.ENUM||e.kind===n.Kind.LIST||e.kind===n.Kind.OBJECT}function s(e){return e.kind===n.Kind.SCHEMA_DEFINITION||o(e)||e.kind===n.Kind.DIRECTIVE_DEFINITION}function o(e){return e.kind===n.Kind.SCALAR_TYPE_DEFINITION||e.kind===n.Kind.OBJECT_TYPE_DEFINITION||e.kind===n.Kind.INTERFACE_TYPE_DEFINITION||e.kind===n.Kind.UNION_TYPE_DEFINITION||e.kind===n.Kind.ENUM_TYPE_DEFINITION||e.kind===n.Kind.INPUT_OBJECT_TYPE_DEFINITION}function l(e){return e.kind===n.Kind.SCHEMA_EXTENSION||e.kind===n.Kind.DIRECTIVE_EXTENSION||u(e)}function u(e){return e.kind===n.Kind.SCALAR_TYPE_EXTENSION||e.kind===n.Kind.OBJECT_TYPE_EXTENSION||e.kind===n.Kind.INTERFACE_TYPE_EXTENSION||e.kind===n.Kind.UNION_TYPE_EXTENSION||e.kind===n.Kind.ENUM_TYPE_EXTENSION||e.kind===n.Kind.INPUT_OBJECT_TYPE_EXTENSION}},619559,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.ExecutableDefinitionsRule=function(e){return{Document(t){for(let i of t.definitions)if(!(0,a.isExecutableDefinitionNode)(i)){let t=i.kind===r.Kind.SCHEMA_DEFINITION||i.kind===r.Kind.SCHEMA_EXTENSION?"schema":'"'+i.name.value+'"';e.reportError(new n.GraphQLError(`The ${t} definition is not executable.`,{nodes:i}))}return!1}}};var n=e.r(294943),r=e.r(199311),a=e.r(940674)},146560,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.FieldsOnCorrectTypeRule=function(e){return{Field(t){let i=e.getParentType();if(i&&!e.getFieldDef()){let l=e.getSchema(),u=t.name.value,c=(0,n.didYouMean)("to use an inline fragment on",function(e,t,i){if(!(0,o.isAbstractType)(t))return[];let n=new Set,a=Object.create(null);for(let r of e.getPossibleTypes(t))if(r.getFields()[i])for(let e of(n.add(r),a[r.name]=1,r.getInterfaces())){var s;e.getFields()[i]&&(n.add(e),a[e.name]=(null!=(s=a[e.name])?s:0)+1)}return[...n].sort((t,i)=>{let n=a[i.name]-a[t.name];return 0!==n?n:(0,o.isInterfaceType)(t)&&e.isSubType(t,i)?-1:(0,o.isInterfaceType)(i)&&e.isSubType(i,t)?1:(0,r.naturalCompare)(t.name,i.name)}).map(e=>e.name)}(l,i,u));""===c&&(c=(0,n.didYouMean)(function(e,t){if((0,o.isObjectType)(e)||(0,o.isInterfaceType)(e)){let i=Object.keys(e.getFields());return(0,a.suggestionList)(t,i)}return[]}(i,u))),e.reportError(new s.GraphQLError(`Cannot query field "${u}" on type "${i.name}".`+c,{nodes:t}))}}}};var n=e.r(996650),r=e.r(216251),a=e.r(529364),s=e.r(294943),o=e.r(211325)},610156,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.FragmentsOnCompositeTypesRule=function(e){return{InlineFragment(t){let i=t.typeCondition;if(i){let t=(0,s.typeFromAST)(e.getSchema(),i);if(t&&!(0,a.isCompositeType)(t)){let t=(0,r.print)(i);e.reportError(new n.GraphQLError(`Fragment cannot condition on non composite type "${t}".`,{nodes:i}))}}},FragmentDefinition(t){let i=(0,s.typeFromAST)(e.getSchema(),t.typeCondition);if(i&&!(0,a.isCompositeType)(i)){let i=(0,r.print)(t.typeCondition);e.reportError(new n.GraphQLError(`Fragment "${t.name.value}" cannot condition on non composite type "${i}".`,{nodes:t.typeCondition}))}}}};var n=e.r(294943),r=e.r(340647),a=e.r(211325),s=e.r(653704)},111080,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.KnownArgumentNamesOnDirectivesRule=l,i.KnownArgumentNamesRule=function(e){return{...l(e),Argument(t){let i=e.getArgument(),s=e.getFieldDef(),o=e.getParentType();if(!i&&s&&o){let i=t.name.value,l=s.args.map(e=>e.name),u=(0,r.suggestionList)(i,l);e.reportError(new a.GraphQLError(`Unknown argument "${i}" on field "${o.name}.${s.name}".`+(0,n.didYouMean)(u),{nodes:t}))}}}};var n=e.r(996650),r=e.r(529364),a=e.r(294943),s=e.r(199311),o=e.r(336081);function l(e){let t=Object.create(null),i=e.getSchema();for(let e of i?i.getDirectives():o.specifiedDirectives)t[e.name]=e.args.map(e=>e.name);for(let i of e.getDocument().definitions)if(i.kind===s.Kind.DIRECTIVE_DEFINITION){var l;let e=null!=(l=i.arguments)?l:[];t[i.name.value]=e.map(e=>e.name.value)}return{Directive(i){let s=i.name.value,o=t[s];if(i.arguments&&o)for(let t of i.arguments){let i=t.name.value;if(!o.includes(i)){let l=(0,r.suggestionList)(i,o);e.reportError(new a.GraphQLError(`Unknown argument "${i}" on directive "@${s}".`+(0,n.didYouMean)(l),{nodes:t}))}}return!1}}}},820345,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.KnownDirectivesRule=function(e){let t=Object.create(null),i=e.getSchema();for(let e of i?i.getDirectives():u.specifiedDirectives)t[e.name]=e.locations;for(let i of e.getDocument().definitions)i.kind===l.Kind.DIRECTIVE_DEFINITION&&(t[i.name.value]=i.locations.map(e=>e.value));return{Directive(i,u,c,d,p){let h=i.name.value,f=t[h];if(!f)return void e.reportError(new a.GraphQLError(`Unknown directive "@${h}".`,{nodes:i}));let m=function(e){let t=e[e.length-1];switch("kind"in t||(0,r.invariant)(!1),t.kind){case l.Kind.OPERATION_DEFINITION:var i=t.operation;switch(i){case s.OperationTypeNode.QUERY:return o.DirectiveLocation.QUERY;case s.OperationTypeNode.MUTATION:return o.DirectiveLocation.MUTATION;case s.OperationTypeNode.SUBSCRIPTION:return o.DirectiveLocation.SUBSCRIPTION}return;case l.Kind.FIELD:return o.DirectiveLocation.FIELD;case l.Kind.FRAGMENT_SPREAD:return o.DirectiveLocation.FRAGMENT_SPREAD;case l.Kind.INLINE_FRAGMENT:return o.DirectiveLocation.INLINE_FRAGMENT;case l.Kind.FRAGMENT_DEFINITION:return o.DirectiveLocation.FRAGMENT_DEFINITION;case l.Kind.VARIABLE_DEFINITION:return o.DirectiveLocation.VARIABLE_DEFINITION;case l.Kind.SCHEMA_DEFINITION:case l.Kind.SCHEMA_EXTENSION:return o.DirectiveLocation.SCHEMA;case l.Kind.SCALAR_TYPE_DEFINITION:case l.Kind.SCALAR_TYPE_EXTENSION:return o.DirectiveLocation.SCALAR;case l.Kind.OBJECT_TYPE_DEFINITION:case l.Kind.OBJECT_TYPE_EXTENSION:return o.DirectiveLocation.OBJECT;case l.Kind.FIELD_DEFINITION:return o.DirectiveLocation.FIELD_DEFINITION;case l.Kind.INTERFACE_TYPE_DEFINITION:case l.Kind.INTERFACE_TYPE_EXTENSION:return o.DirectiveLocation.INTERFACE;case l.Kind.UNION_TYPE_DEFINITION:case l.Kind.UNION_TYPE_EXTENSION:return o.DirectiveLocation.UNION;case l.Kind.ENUM_TYPE_DEFINITION:case l.Kind.ENUM_TYPE_EXTENSION:return o.DirectiveLocation.ENUM;case l.Kind.ENUM_VALUE_DEFINITION:return o.DirectiveLocation.ENUM_VALUE;case l.Kind.INPUT_OBJECT_TYPE_DEFINITION:case l.Kind.INPUT_OBJECT_TYPE_EXTENSION:return o.DirectiveLocation.INPUT_OBJECT;case l.Kind.INPUT_VALUE_DEFINITION:{let t=e[e.length-3];return"kind"in t||(0,r.invariant)(!1),t.kind===l.Kind.INPUT_OBJECT_TYPE_DEFINITION?o.DirectiveLocation.INPUT_FIELD_DEFINITION:o.DirectiveLocation.ARGUMENT_DEFINITION}case l.Kind.DIRECTIVE_DEFINITION:case l.Kind.DIRECTIVE_EXTENSION:return o.DirectiveLocation.DIRECTIVE_DEFINITION;default:(0,r.invariant)(!1,"Unexpected kind: "+(0,n.inspect)(t.kind))}}(p);m&&!f.includes(m)&&e.reportError(new a.GraphQLError(`Directive "@${h}" may not be used on ${m}.`,{nodes:i}))}}};var n=e.r(818123),r=e.r(119588),a=e.r(294943),s=e.r(463040),o=e.r(142478),l=e.r(199311),u=e.r(336081)},432098,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.KnownFragmentNamesRule=function(e){return{FragmentSpread(t){let i=t.name.value;e.getFragment(i)||e.reportError(new n.GraphQLError(`Unknown fragment "${i}".`,{nodes:t.name}))}}};var n=e.r(294943)},141097,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.KnownTypeNamesRule=function(e){let t=e.getSchema(),i=t?t.getTypeMap():Object.create(null),o=Object.create(null);for(let t of e.getDocument().definitions)(0,s.isTypeDefinitionNode)(t)&&(o[t.name.value]=!0);let u=[...Object.keys(i),...Object.keys(o)];return{NamedType(t,c,d,p,h){let f=t.name.value;if(!i[f]&&!o[f]){var m,y;let i=null!=(m=h[2])?m:d,o=null!=i&&"kind"in(y=i)&&((0,s.isTypeSystemDefinitionNode)(y)||(0,s.isTypeSystemExtensionNode)(y));if(o&&l.includes(f))return;let c=(0,r.suggestionList)(f,o?l.concat(u):u);e.reportError(new a.GraphQLError(`Unknown type "${f}".`+(0,n.didYouMean)(c),{nodes:t}))}}}};var n=e.r(996650),r=e.r(529364),a=e.r(294943),s=e.r(940674),o=e.r(187936);let l=[...e.r(947129).specifiedScalarTypes,...o.introspectionTypes].map(e=>e.name)},336446,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.LoneAnonymousOperationRule=function(e){let t=0;return{Document(e){t=e.definitions.filter(e=>e.kind===r.Kind.OPERATION_DEFINITION).length},OperationDefinition(i){!i.name&&t>1&&e.reportError(new n.GraphQLError("This anonymous operation must be the only defined operation.",{nodes:i}))}}};var n=e.r(294943),r=e.r(199311)},893600,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.LoneSchemaDefinitionRule=function(e){var t,i,r;let a=e.getSchema(),s=null!=(t=null!=(i=null!=(r=null==a?void 0:a.astNode)?r:null==a?void 0:a.getQueryType())?i:null==a?void 0:a.getMutationType())?t:null==a?void 0:a.getSubscriptionType(),o=0;return{SchemaDefinition(t){s?e.reportError(new n.GraphQLError("Cannot define a new schema within a schema extension.",{nodes:t})):(o>0&&e.reportError(new n.GraphQLError("Must provide only one schema definition.",{nodes:t})),++o)}}};var n=e.r(294943)},100876,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.MaxIntrospectionDepthRule=function(e){return{Field(t){if(("__schema"===t.name.value||"__type"===t.name.value)&&function t(i,n=Object.create(null),a=0){if(i.kind===r.Kind.FRAGMENT_SPREAD){let r=i.name.value;if(!0===n[r])return!1;let s=e.getFragment(r);if(!s)return!1;try{return n[r]=!0,t(s,n,a)}finally{n[r]=void 0}}if(i.kind===r.Kind.FIELD&&("fields"===i.name.value||"interfaces"===i.name.value||"possibleTypes"===i.name.value||"inputFields"===i.name.value)&&++a>=3)return!0;if("selectionSet"in i&&i.selectionSet){for(let e of i.selectionSet.selections)if(t(e,n,a))return!0}return!1}(t))return e.reportError(new n.GraphQLError("Maximum introspection depth exceeded",{nodes:[t]})),!1}}};var n=e.r(294943),r=e.r(199311)},74344,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.NoFragmentCyclesRule=function(e){let t=Object.create(null),i=[],r=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition:a=>((function a(s){if(t[s.name.value])return;let o=s.name.value;t[o]=!0;let l=e.getFragmentSpreads(s.selectionSet);if(0!==l.length){for(let t of(r[o]=i.length,l)){let s=t.name.value,o=r[s];if(i.push(t),void 0===o){let t=e.getFragment(s);t&&a(t)}else{let t=i.slice(o),r=t.slice(0,-1).map(e=>'"'+e.name.value+'"').join(", ");e.reportError(new n.GraphQLError(`Cannot spread fragment "${s}" within itself`+(""!==r?` via ${r}.`:"."),{nodes:t}))}i.pop()}r[o]=void 0}})(a),!1)}};var n=e.r(294943)},166380,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.NoUndefinedVariablesRule=function(e){let t=Object.create(null);return{OperationDefinition:{enter(){t=Object.create(null)},leave(i){for(let{node:r}of e.getRecursiveVariableUsages(i)){let a=r.name.value;!0!==t[a]&&e.reportError(new n.GraphQLError(i.name?`Variable "$${a}" is not defined by operation "${i.name.value}".`:`Variable "$${a}" is not defined.`,{nodes:[r,i]}))}}},VariableDefinition(e){t[e.variable.name.value]=!0}}};var n=e.r(294943)},608150,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.NoUnusedFragmentsRule=function(e){let t=[],i=[];return{OperationDefinition:e=>(t.push(e),!1),FragmentDefinition:e=>(i.push(e),!1),Document:{leave(){let r=Object.create(null);for(let i of t)for(let t of e.getRecursivelyReferencedFragments(i))r[t.name.value]=!0;for(let t of i){let i=t.name.value;!0!==r[i]&&e.reportError(new n.GraphQLError(`Fragment "${i}" is never used.`,{nodes:t}))}}}}};var n=e.r(294943)},528651,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.NoUnusedVariablesRule=function(e){let t=[];return{OperationDefinition:{enter(){t=[]},leave(i){let r=Object.create(null);for(let{node:t}of e.getRecursiveVariableUsages(i))r[t.name.value]=!0;for(let a of t){let t=a.variable.name.value;!0!==r[t]&&e.reportError(new n.GraphQLError(i.name?`Variable "$${t}" is never used in operation "${i.name.value}".`:`Variable "$${t}" is never used.`,{nodes:a}))}}},VariableDefinition(e){t.push(e)}}};var n=e.r(294943)},393939,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.sortValueNode=function e(t){switch(t.kind){case r.Kind.OBJECT:return{...t,fields:t.fields.map(t=>({...t,value:e(t.value)})).sort((e,t)=>(0,n.naturalCompare)(e.name.value,t.name.value))};case r.Kind.LIST:return{...t,values:t.values.map(e)};case r.Kind.INT:case r.Kind.FLOAT:case r.Kind.STRING:case r.Kind.BOOLEAN:case r.Kind.NULL:case r.Kind.ENUM:case r.Kind.VARIABLE:return t}};var n=e.r(216251),r=e.r(199311)},581577,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.OverlappingFieldsCanBeMergedRule=function(e){let t=new v,i=new g,n=new Map;return{SelectionSet(a){for(let[[s,o],l,u]of function(e,t,i,n,r,a){let s=[],[o,l]=m(e,t,r,a);if(function(e,t,i,n,r,a){for(let[s,o]of Object.entries(a))if(o.length>1)for(let a=0;a<o.length;a++)for(let l=a+1;l<o.length;l++){let u=h(e,i,n,r,!1,s,o[a],o[l]);u&&t.push(u)}}(e,s,t,i,n,o),0!==l.length)for(let r=0;r<l.length;r++){c(e,s,t,i,n,!1,o,l[r]);for(let a=r+1;a<l.length;a++)d(e,s,t,i,n,!1,l[r],l[a])}return s}(e,n,t,i,e.getParentType(),a)){let t=function e(t){return Array.isArray(t)?t.map(([t,i])=>`subfields "${t}" conflict because `+e(i)).join(" and "):t}(o);e.reportError(new r.GraphQLError(`Fields "${s}" conflict because ${t}. Use different aliases on the fields to fetch both if this was intentional.`,{nodes:l.concat(u)}))}}}};var n=e.r(818123),r=e.r(294943),a=e.r(199311),s=e.r(340647),o=e.r(211325),l=e.r(393939),u=e.r(653704);function c(e,t,i,n,r,a,s,o){if(n.has(s,o,a))return;n.add(s,o,a);let l=e.getFragment(o);if(!l)return;let[u,d]=y(e,i,l);if(s!==u)for(let o of(p(e,t,i,n,r,a,s,u),d))c(e,t,i,n,r,a,s,o)}function d(e,t,i,n,r,a,s,o){if(s===o||r.has(s,o,a))return;r.add(s,o,a);let l=e.getFragment(s),u=e.getFragment(o);if(!l||!u)return;let[c,h]=y(e,i,l),[f,m]=y(e,i,u);for(let o of(p(e,t,i,n,r,a,c,f),m))d(e,t,i,n,r,a,s,o);for(let s of h)d(e,t,i,n,r,a,s,o)}function p(e,t,i,n,r,a,s,o){for(let[l,u]of Object.entries(s)){let s=o[l];if(s)for(let o of u)for(let u of s){let s=h(e,i,n,r,a,l,o,u);s&&t.push(s)}}}function h(e,t,i,r,a,s,l,u){let[h,y,v]=l,[g,T,S]=u,E=a||h!==g&&(0,o.isObjectType)(h)&&(0,o.isObjectType)(g);if(!E){let e=y.name.value,t=T.name.value;if(e!==t)return[[s,`"${e}" and "${t}" are different fields`],[y],[T]];if(!function(e,t){let i=e.arguments,n=t.arguments;if(void 0===i||0===i.length)return void 0===n||0===n.length;if(void 0===n||0===n.length||i.length!==n.length)return!1;let r=new Map(n.map(({name:e,value:t})=>[e.value,t]));return i.every(e=>{let t=e.value,i=r.get(e.name.value);return void 0!==i&&f(t)===f(i)})}(y,T))return[[s,"they have differing arguments"],[y],[T]]}let I=null==v?void 0:v.type,b=null==S?void 0:S.type;if(I&&b&&function e(t,i){return(0,o.isListType)(t)?!(0,o.isListType)(i)||e(t.ofType,i.ofType):!!(0,o.isListType)(i)||((0,o.isNonNullType)(t)?!(0,o.isNonNullType)(i)||e(t.ofType,i.ofType):!!(0,o.isNonNullType)(i)||!!((0,o.isLeafType)(t)||(0,o.isLeafType)(i))&&t!==i)}(I,b))return[[s,`they return conflicting types "${(0,n.inspect)(I)}" and "${(0,n.inspect)(b)}"`],[y],[T]];let N=y.selectionSet,_=T.selectionSet;if(N&&_){var D=function(e,t,i,n,r,a,s,o,l){let u=[],[h,f]=m(e,t,a,s),[y,v]=m(e,t,o,l);for(let a of(p(e,u,t,i,n,r,h,y),v))c(e,u,t,i,n,r,h,a);for(let a of f)c(e,u,t,i,n,r,y,a);for(let a of f)for(let s of v)d(e,u,t,i,n,r,a,s);return u}(e,t,i,r,E,(0,o.getNamedType)(I),N,(0,o.getNamedType)(b),_),A=s,O=y,R=T;return D.length>0?[[A,D.map(([e])=>e)],[O,...D.map(([,e])=>e).flat()],[R,...D.map(([,,e])=>e).flat()]]:void 0}}function f(e){return(0,s.print)((0,l.sortValueNode)(e))}function m(e,t,i,n){let r=t.get(n);if(r)return r;let s=Object.create(null),l=Object.create(null);!function e(t,i,n,r,s){for(let l of n.selections)switch(l.kind){case a.Kind.FIELD:{let e,t=l.name.value;((0,o.isObjectType)(i)||(0,o.isInterfaceType)(i))&&(e=i.getFields()[t]);let n=l.alias?l.alias.value:t;r[n]||(r[n]=[]),r[n].push([i,l,e]);break}case a.Kind.FRAGMENT_SPREAD:s[l.name.value]=!0;break;case a.Kind.INLINE_FRAGMENT:{let n=l.typeCondition,a=n?(0,u.typeFromAST)(t.getSchema(),n):i;e(t,a,l.selectionSet,r,s)}}}(e,i,n,s,l);let c=[s,Object.keys(l)];return t.set(n,c),c}function y(e,t,i){let n=t.get(i.selectionSet);if(n)return n;let r=(0,u.typeFromAST)(e.getSchema(),i.typeCondition);return m(e,t,r,i.selectionSet)}class v{constructor(){this._data=new Map}has(e,t,i){var n;let r=null==(n=this._data.get(e))?void 0:n.get(t);return void 0!==r&&(!!i||i===r)}add(e,t,i){let n=this._data.get(e);void 0===n?this._data.set(e,new Map([[t,i]])):n.set(t,i)}}class g{constructor(){this._orderedPairSet=new v}has(e,t,i){return e<t?this._orderedPairSet.has(e,t,i):this._orderedPairSet.has(t,e,i)}add(e,t,i){e<t?this._orderedPairSet.add(e,t,i):this._orderedPairSet.add(t,e,i)}}},8879,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.PossibleFragmentSpreadsRule=function(e){return{InlineFragment(t){let i=e.getType(),o=e.getParentType();if((0,a.isCompositeType)(i)&&(0,a.isCompositeType)(o)&&!(0,s.doTypesOverlap)(e.getSchema(),i,o)){let a=(0,n.inspect)(o),s=(0,n.inspect)(i);e.reportError(new r.GraphQLError(`Fragment cannot be spread here as objects of type "${a}" can never be of type "${s}".`,{nodes:t}))}},FragmentSpread(t){let i=t.name.value,l=function(e,t){let i=e.getFragment(t);if(i){let t=(0,o.typeFromAST)(e.getSchema(),i.typeCondition);if((0,a.isCompositeType)(t))return t}}(e,i),u=e.getParentType();if(l&&u&&!(0,s.doTypesOverlap)(e.getSchema(),l,u)){let a=(0,n.inspect)(u),s=(0,n.inspect)(l);e.reportError(new r.GraphQLError(`Fragment "${i}" cannot be spread here as objects of type "${a}" can never be of type "${s}".`,{nodes:t}))}}}};var n=e.r(818123),r=e.r(294943),a=e.r(211325),s=e.r(957861),o=e.r(653704)},258511,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.PossibleTypeExtensionsRule=function(e){let t=e.getSchema(),i=Object.create(null);for(let t of e.getDocument().definitions)(0,u.isTypeDefinitionNode)(t)&&(i[t.name.value]=t);return{ScalarTypeExtension:p,ObjectTypeExtension:p,InterfaceTypeExtension:p,UnionTypeExtension:p,EnumTypeExtension:p,InputObjectTypeExtension:p};function p(u){var p;let h,f=u.name.value,m=i[f],y=null==t?void 0:t.getType(f);if(m?h=d[m.kind]:y&&(p=y,h=(0,c.isScalarType)(p)?l.Kind.SCALAR_TYPE_EXTENSION:(0,c.isObjectType)(p)?l.Kind.OBJECT_TYPE_EXTENSION:(0,c.isInterfaceType)(p)?l.Kind.INTERFACE_TYPE_EXTENSION:(0,c.isUnionType)(p)?l.Kind.UNION_TYPE_EXTENSION:(0,c.isEnumType)(p)?l.Kind.ENUM_TYPE_EXTENSION:(0,c.isInputObjectType)(p)?l.Kind.INPUT_OBJECT_TYPE_EXTENSION:void(0,a.invariant)(!1,"Unexpected type: "+(0,r.inspect)(p))),h){if(h!==u.kind){let t=function(e){switch(e){case l.Kind.SCALAR_TYPE_EXTENSION:return"scalar";case l.Kind.OBJECT_TYPE_EXTENSION:return"object";case l.Kind.INTERFACE_TYPE_EXTENSION:return"interface";case l.Kind.UNION_TYPE_EXTENSION:return"union";case l.Kind.ENUM_TYPE_EXTENSION:return"enum";case l.Kind.INPUT_OBJECT_TYPE_EXTENSION:return"input object";default:(0,a.invariant)(!1,"Unexpected kind: "+(0,r.inspect)(e))}}(u.kind);e.reportError(new o.GraphQLError(`Cannot extend non-${t} type "${f}".`,{nodes:m?[m,u]:u}))}}else{let r=Object.keys({...i,...null==t?void 0:t.getTypeMap()}),a=(0,s.suggestionList)(f,r);e.reportError(new o.GraphQLError(`Cannot extend type "${f}" because it is not defined.`+(0,n.didYouMean)(a),{nodes:u.name}))}}};var n=e.r(996650),r=e.r(818123),a=e.r(119588),s=e.r(529364),o=e.r(294943),l=e.r(199311),u=e.r(940674),c=e.r(211325);let d={[l.Kind.SCALAR_TYPE_DEFINITION]:l.Kind.SCALAR_TYPE_EXTENSION,[l.Kind.OBJECT_TYPE_DEFINITION]:l.Kind.OBJECT_TYPE_EXTENSION,[l.Kind.INTERFACE_TYPE_DEFINITION]:l.Kind.INTERFACE_TYPE_EXTENSION,[l.Kind.UNION_TYPE_DEFINITION]:l.Kind.UNION_TYPE_EXTENSION,[l.Kind.ENUM_TYPE_DEFINITION]:l.Kind.ENUM_TYPE_EXTENSION,[l.Kind.INPUT_OBJECT_TYPE_DEFINITION]:l.Kind.INPUT_OBJECT_TYPE_EXTENSION}},818671,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.ProvidedRequiredArgumentsOnDirectivesRule=c,i.ProvidedRequiredArgumentsRule=function(e){return{...c(e),Field:{leave(t){var i;let r=e.getFieldDef();if(!r)return!1;let s=new Set(null==(i=t.arguments)?void 0:i.map(e=>e.name.value));for(let i of r.args)if(!s.has(i.name)&&(0,l.isRequiredArgument)(i)){let s=(0,n.inspect)(i.type);e.reportError(new a.GraphQLError(`Field "${r.name}" argument "${i.name}" of type "${s}" is required, but it was not provided.`,{nodes:t}))}}}}};var n=e.r(818123),r=e.r(117921),a=e.r(294943),s=e.r(199311),o=e.r(340647),l=e.r(211325),u=e.r(336081);function c(e){var t,i;let c=Object.create(null),p=e.getSchema();for(let e of null!=(t=null==p?void 0:p.getDirectives())?t:u.specifiedDirectives)c[e.name]=(0,r.keyMap)(e.args.filter(l.isRequiredArgument),e=>e.name);for(let t of e.getDocument().definitions)if(t.kind===s.Kind.DIRECTIVE_DEFINITION){let e=null!=(i=t.arguments)?i:[];c[t.name.value]=(0,r.keyMap)(e.filter(d),e=>e.name.value)}return{Directive:{leave(t){let i=t.name.value,r=c[i];if(r){var s;let u=new Set((null!=(s=t.arguments)?s:[]).map(e=>e.name.value));for(let[s,c]of Object.entries(r))if(!u.has(s)){let r=(0,l.isType)(c.type)?(0,n.inspect)(c.type):(0,o.print)(c.type);e.reportError(new a.GraphQLError(`Directive "@${i}" argument "${s}" of type "${r}" is required, but it was not provided.`,{nodes:t}))}}}}}}function d(e){return e.type.kind===s.Kind.NON_NULL_TYPE&&null==e.defaultValue}},12773,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.ScalarLeafsRule=function(e){return{Field(t){let i=e.getType(),s=t.selectionSet;if(i)if((0,a.isLeafType)((0,a.getNamedType)(i))){if(s){let a=t.name.value,o=(0,n.inspect)(i);e.reportError(new r.GraphQLError(`Field "${a}" must not have a selection since type "${o}" has no subfields.`,{nodes:s}))}}else if(s){if(0===s.selections.length){let a=t.name.value,s=(0,n.inspect)(i);e.reportError(new r.GraphQLError(`Field "${a}" of type "${s}" must have at least one field selected.`,{nodes:t}))}}else{let a=t.name.value,s=(0,n.inspect)(i);e.reportError(new r.GraphQLError(`Field "${a}" of type "${s}" must have a selection of subfields. Did you mean "${a} { ... }"?`,{nodes:t}))}}}};var n=e.r(818123),r=e.r(294943),a=e.r(211325)},236745,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.printPathArray=function(e){return e.map(e=>"number"==typeof e?"["+e.toString()+"]":"."+e).join("")}},687008,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.addPath=function(e,t,i){return{prev:e,key:t,typename:i}},i.pathToArray=function(e){let t=[],i=e;for(;i;)t.push(i.key),i=i.prev;return t.reverse()}},291752,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.coerceInputValue=function(e,t,i=h){return function e(t,i,u,h){if((0,p.isNonNullType)(i))return null!=t?e(t,i.ofType,u,h):void u((0,l.pathToArray)(h),t,new d.GraphQLError(`Expected non-nullable type "${(0,r.inspect)(i)}" not to be null.`));if(null==t)return null;if((0,p.isListType)(i)){let n=i.ofType;return(0,s.isIterableObject)(t)?Array.from(t,(t,i)=>e(t,n,u,(0,l.addPath)(h,i,void 0))):[e(t,n,u,h)]}if((0,p.isInputObjectType)(i)){if(!(0,o.isObjectLike)(t)||Array.isArray(t))return void u((0,l.pathToArray)(h),t,new d.GraphQLError(`Expected type "${i.name}" to be an object.`));let a=Object.create(null),s=i.getFields();for(let n of Object.values(s)){let s=t[n.name];if(void 0===s){if(void 0!==n.defaultValue)a[n.name]=n.defaultValue;else if((0,p.isNonNullType)(n.type)){let e=(0,r.inspect)(n.type);u((0,l.pathToArray)(h),t,new d.GraphQLError(`Field "${n.name}" of required type "${e}" was not provided.`))}continue}a[n.name]=e(s,n.type,u,(0,l.addPath)(h,n.name,i.name))}for(let e of Object.keys(t))if(!s[e]){let r=(0,c.suggestionList)(e,Object.keys(i.getFields()));u((0,l.pathToArray)(h),t,new d.GraphQLError(`Field "${e}" is not defined by type "${i.name}".`+(0,n.didYouMean)(r)))}if(i.isOneOf){let e=Object.keys(a);1!==e.length&&u((0,l.pathToArray)(h),t,new d.GraphQLError(`Exactly one key must be specified for OneOf type "${i.name}".`));let n=e[0],r=a[n];null===r&&u((0,l.pathToArray)(h).concat(n),r,new d.GraphQLError(`Field "${n}" must be non-null.`))}return{...a}}if((0,p.isLeafType)(i)){let e;try{e=i.parseValue(t)}catch(e){e instanceof d.GraphQLError?u((0,l.pathToArray)(h),t,e):u((0,l.pathToArray)(h),t,new d.GraphQLError(`Expected type "${i.name}". `+e.message,{originalError:e}));return}return void 0===e&&u((0,l.pathToArray)(h),t,new d.GraphQLError(`Expected type "${i.name}".`)),e}(0,a.invariant)(!1,"Unexpected input type: "+(0,r.inspect)(i))}(e,t,i,void 0)};var n=e.r(996650),r=e.r(818123),a=e.r(119588),s=e.r(891275),o=e.r(776887),l=e.r(687008),u=e.r(236745),c=e.r(529364),d=e.r(294943),p=e.r(211325);function h(e,t,i){let n="Invalid value "+(0,r.inspect)(t);throw e.length>0&&(n+=` at "value${(0,u.printPathArray)(e)}"`),i.message=n+": "+i.message,i}},674275,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.valueFromAST=function e(t,i,c){if(t){if(t.kind===s.Kind.VARIABLE){let e=t.name.value;if(null==c||void 0===c[e]||!u(c,e))return;let n=c[e];if(null===n&&(0,o.isNonNullType)(i))return;return n}if((0,o.isNonNullType)(i)){if(t.kind===s.Kind.NULL)return;return e(t,i.ofType,c)}if(t.kind===s.Kind.NULL)return null;if((0,o.isListType)(i)){let n=i.ofType;if(t.kind===s.Kind.LIST){let i=[];for(let r of t.values)if(l(r,c)){if((0,o.isNonNullType)(n))return;i.push(null)}else{let t=e(r,n,c);if(void 0===t)return;i.push(t)}return i}let r=e(t,n,c);if(void 0===r)return;return[r]}if((0,o.isInputObjectType)(i)){if(t.kind!==s.Kind.OBJECT)return;let n=Object.create(null),r=(0,a.keyMap)(t.fields,e=>e.name.value);for(let t of Object.values(i.getFields())){let i=r[t.name];if(!i||l(i.value,c)){if(void 0!==t.defaultValue)n[t.name]=t.defaultValue;else if((0,o.isNonNullType)(t.type))return;continue}let a=e(i.value,t.type,c);if(void 0===a)return;n[t.name]=a}if(i.isOneOf){let e=Object.keys(n);if(1!==e.length||null===n[e[0]])return}return n}if((0,o.isLeafType)(i)){let e;try{e=i.parseLiteral(t,c)}catch(e){return}if(void 0===e)return;return e}(0,r.invariant)(!1,"Unexpected input type: "+(0,n.inspect)(i))}};var n=e.r(818123),r=e.r(119588),a=e.r(117921),s=e.r(199311),o=e.r(211325);function l(e,t){return e.kind===s.Kind.VARIABLE&&(null==t||void 0===t[e.name.value]||!u(t,e.name.value))}function u(e,t){return Object.prototype.hasOwnProperty.call(e,t)}},886375,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.getArgumentValues=h,i.getDirectiveValues=function(e,t,i){var n;let r=null==(n=t.directives)?void 0:n.find(t=>t.name.value===e.name);if(r)return h(e,r,i)},i.getVariableValues=function(e,t,i,r){let o=[],h=null==r?void 0:r.maxErrors;try{let r=function(e,t,i,r){let o=Object.create(null);for(let h of t){let t=h.variable.name.value,m=(0,d.typeFromAST)(e,h.type);if(!(0,u.isInputType)(m)){let e=(0,l.print)(h.type);r(new s.GraphQLError(`Variable "$${t}" expected value of type "${e}" which cannot be used as an input type.`,{nodes:h.type}));continue}if(!f(i,t)){if(h.defaultValue)o[t]=(0,p.valueFromAST)(h.defaultValue,m);else if((0,u.isNonNullType)(m)){let e=(0,n.inspect)(m);r(new s.GraphQLError(`Variable "$${t}" of required type "${e}" was not provided.`,{nodes:h}))}continue}let y=i[t];if(null===y&&(0,u.isNonNullType)(m)){let e=(0,n.inspect)(m);r(new s.GraphQLError(`Variable "$${t}" of non-null type "${e}" must not be null.`,{nodes:h}));continue}o[t]=(0,c.coerceInputValue)(y,m,(e,i,o)=>{let l=`Variable "$${t}" got invalid value `+(0,n.inspect)(i);e.length>0&&(l+=` at "${t}${(0,a.printPathArray)(e)}"`),r(new s.GraphQLError(l+"; "+o.message,{nodes:h,originalError:o}))})}return{...o}}(e,t,i,e=>{if(null!=h&&o.length>=h)throw new s.GraphQLError("Too many errors processing variables, error limit reached. Execution aborted.");o.push(e)});if(0===o.length)return{coerced:r}}catch(e){o.push(e)}return{errors:o}};var n=e.r(818123),r=e.r(117921),a=e.r(236745),s=e.r(294943),o=e.r(199311),l=e.r(340647),u=e.r(211325),c=e.r(291752),d=e.r(653704),p=e.r(674275);function h(e,t,i){var a;let c=Object.create(null),d=null!=(a=t.arguments)?a:[],h=(0,r.keyMap)(d,e=>e.name.value);for(let r of e.args){let e=r.name,a=r.type,d=h[e];if(!d){if(void 0!==r.defaultValue)c[e]=r.defaultValue;else if((0,u.isNonNullType)(a))throw new s.GraphQLError(`Argument "${e}" of required type "${(0,n.inspect)(a)}" was not provided.`,{nodes:t});continue}let m=d.value,y=m.kind===o.Kind.NULL;if(m.kind===o.Kind.VARIABLE){let t=m.name.value;if(null==i||!f(i,t)){if(void 0!==r.defaultValue)c[e]=r.defaultValue;else if((0,u.isNonNullType)(a))throw new s.GraphQLError(`Argument "${e}" of required type "${(0,n.inspect)(a)}" was provided the variable "$${t}" which was not provided a runtime value.`,{nodes:m});continue}y=null==i[t]}if(y&&(0,u.isNonNullType)(a))throw new s.GraphQLError(`Argument "${e}" of non-null type "${(0,n.inspect)(a)}" must not be null.`,{nodes:m});let v=(0,p.valueFromAST)(m,a,i);if(void 0===v)throw new s.GraphQLError(`Argument "${e}" has invalid value ${(0,l.print)(m)}.`,{nodes:m});c[e]=v}return{...c}}function f(e,t){return Object.prototype.hasOwnProperty.call(e,t)}},227902,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.collectFields=function(e,t,i,n,r){let a=new Map;return l(e,t,i,n,r,a,new Set),a},i.collectSubfields=function(e,t,i,n,r){let a=new Map,s=new Set;for(let o of r)o.selectionSet&&l(e,t,i,n,o.selectionSet,a,s);return a};var n=e.r(199311),r=e.r(211325),a=e.r(336081),s=e.r(653704),o=e.r(886375);function l(e,t,i,r,a,s,o){for(let p of a.selections)switch(p.kind){case n.Kind.FIELD:{var d;if(!u(i,p))continue;let e=(d=p).alias?d.alias.value:d.name.value,t=s.get(e);void 0!==t?t.push(p):s.set(e,[p]);break}case n.Kind.INLINE_FRAGMENT:if(!u(i,p)||!c(e,p,r))continue;l(e,t,i,r,p.selectionSet,s,o);break;case n.Kind.FRAGMENT_SPREAD:{let n=p.name.value;if(o.has(n)||!u(i,p))continue;o.add(n);let a=t[n];if(!a||!c(e,a,r))continue;l(e,t,i,r,a.selectionSet,s,o)}}}function u(e,t){let i=(0,o.getDirectiveValues)(a.GraphQLSkipDirective,t,e);if((null==i?void 0:i.if)===!0)return!1;let n=(0,o.getDirectiveValues)(a.GraphQLIncludeDirective,t,e);return(null==n?void 0:n.if)!==!1}function c(e,t,i){let n=t.typeCondition;if(!n)return!0;let a=(0,s.typeFromAST)(e,n);return a===i||!!(0,r.isAbstractType)(a)&&e.isSubType(a,i)}},68741,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.SingleFieldSubscriptionsRule=function(e){return{OperationDefinition(t){if("subscription"===t.operation){let i=e.getSchema(),s=i.getSubscriptionType();if(s){let o=t.name?t.name.value:null,l=Object.create(null),u=e.getDocument(),c=Object.create(null);for(let e of u.definitions)e.kind===r.Kind.FRAGMENT_DEFINITION&&(c[e.name.value]=e);let d=(0,a.collectFields)(i,c,l,s,t.selectionSet);if(d.size>1){let t=[...d.values()].slice(1).flat();e.reportError(new n.GraphQLError(null!=o?`Subscription "${o}" must select only one top level field.`:"Anonymous Subscription must select only one top level field.",{nodes:t}))}for(let t of d.values())t[0].name.value.startsWith("__")&&e.reportError(new n.GraphQLError(null!=o?`Subscription "${o}" must not select an introspection top level field.`:"Anonymous Subscription must not select an introspection top level field.",{nodes:t}))}}}}};var n=e.r(294943),r=e.r(199311),a=e.r(227902)},754680,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.groupBy=function(e,t){let i=new Map;for(let n of e){let e=t(n),r=i.get(e);void 0===r?i.set(e,[n]):r.push(n)}return i}},387128,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.UniqueArgumentDefinitionNamesRule=function(e){return{DirectiveDefinition(e){var t;let n=null!=(t=e.arguments)?t:[];return i(`@${e.name.value}`,n)},InterfaceTypeDefinition:t,InterfaceTypeExtension:t,ObjectTypeDefinition:t,ObjectTypeExtension:t};function t(e){var t,n;let r=e.name.value;for(let a of null!=(t=e.fields)?t:[]){let e=a.name.value;i(`${r}.${e}`,null!=(n=a.arguments)?n:[])}return!1}function i(t,i){for(let[a,s]of(0,n.groupBy)(i,e=>e.name.value))s.length>1&&e.reportError(new r.GraphQLError(`Argument "${t}(${a}:)" can only be defined once.`,{nodes:s.map(e=>e.name)}));return!1}};var n=e.r(754680),r=e.r(294943)},644919,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.UniqueArgumentNamesRule=function(e){return{Field:t,Directive:t};function t(t){var i;let a=null!=(i=t.arguments)?i:[];for(let[t,i]of(0,n.groupBy)(a,e=>e.name.value))i.length>1&&e.reportError(new r.GraphQLError(`There can be only one argument named "${t}".`,{nodes:i.map(e=>e.name)}))}};var n=e.r(754680),r=e.r(294943)},970672,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.UniqueDirectiveNamesRule=function(e){let t=Object.create(null),i=e.getSchema();return{DirectiveDefinition(r){let a=r.name.value;return null!=i&&i.getDirective(a)?void e.reportError(new n.GraphQLError(`Directive "@${a}" already exists in the schema. It cannot be redefined.`,{nodes:r.name})):(t[a]?e.reportError(new n.GraphQLError(`There can be only one directive named "@${a}".`,{nodes:[t[a],r.name]})):t[a]=r.name,!1)}}};var n=e.r(294943)},611443,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.UniqueDirectivesPerLocationRule=function(e){let t=Object.create(null),i=e.getSchema();for(let e of i?i.getDirectives():s.specifiedDirectives)t[e.name]=!e.isRepeatable;for(let i of e.getDocument().definitions)i.kind===r.Kind.DIRECTIVE_DEFINITION&&(t[i.name.value]=!i.repeatable);let o=Object.create(null),l=Object.create(null),u=Object.create(null);return{enter(i){let s;if("directives"in i&&i.directives){if(i.kind===r.Kind.SCHEMA_DEFINITION||i.kind===r.Kind.SCHEMA_EXTENSION)s=o;else if((0,a.isTypeDefinitionNode)(i)||(0,a.isTypeExtensionNode)(i)){let e=i.name.value;void 0===(s=l[e])&&(l[e]=s=Object.create(null))}else if(i.kind===r.Kind.DIRECTIVE_DEFINITION||i.kind===r.Kind.DIRECTIVE_EXTENSION){let e=i.name.value;void 0===(s=u[e])&&(u[e]=s=Object.create(null))}else s=Object.create(null);for(let r of i.directives){let i=r.name.value;t[i]&&(s[i]?e.reportError(new n.GraphQLError(`The directive "@${i}" can only be used once at this location.`,{nodes:[s[i],r]})):s[i]=r)}}}}};var n=e.r(294943),r=e.r(199311),a=e.r(940674),s=e.r(336081)},343685,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.UniqueEnumValueNamesRule=function(e){let t=e.getSchema(),i=t?t.getTypeMap():Object.create(null),a=Object.create(null);return{EnumTypeDefinition:s,EnumTypeExtension:s};function s(t){var s;let o=t.name.value;a[o]||(a[o]=Object.create(null));let l=null!=(s=t.values)?s:[],u=a[o];for(let t of l){let a=t.name.value,s=i[o];(0,r.isEnumType)(s)&&s.getValue(a)?e.reportError(new n.GraphQLError(`Enum value "${o}.${a}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:t.name})):u[a]?e.reportError(new n.GraphQLError(`Enum value "${o}.${a}" can only be defined once.`,{nodes:[u[a],t.name]})):u[a]=t.name}return!1}};var n=e.r(294943),r=e.r(211325)},975444,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.UniqueFieldDefinitionNamesRule=function(e){let t=e.getSchema(),i=t?t.getTypeMap():Object.create(null),a=Object.create(null);return{InputObjectTypeDefinition:s,InputObjectTypeExtension:s,InterfaceTypeDefinition:s,InterfaceTypeExtension:s,ObjectTypeDefinition:s,ObjectTypeExtension:s};function s(t){var s,o,l;let u=t.name.value;a[u]||(a[u]=Object.create(null));let c=null!=(s=t.fields)?s:[],d=a[u];for(let t of c){let a=t.name.value;(o=i[u],l=a,((0,r.isObjectType)(o)||(0,r.isInterfaceType)(o)||(0,r.isInputObjectType)(o))&&null!=o.getFields()[l])?e.reportError(new n.GraphQLError(`Field "${u}.${a}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:t.name})):d[a]?e.reportError(new n.GraphQLError(`Field "${u}.${a}" can only be defined once.`,{nodes:[d[a],t.name]})):d[a]=t.name}return!1}};var n=e.r(294943),r=e.r(211325)},971887,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.UniqueFragmentNamesRule=function(e){let t=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition(i){let r=i.name.value;return t[r]?e.reportError(new n.GraphQLError(`There can be only one fragment named "${r}".`,{nodes:[t[r],i.name]})):t[r]=i.name,!1}}};var n=e.r(294943)},845263,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.UniqueInputFieldNamesRule=function(e){let t=[],i=Object.create(null);return{ObjectValue:{enter(){t.push(i),i=Object.create(null)},leave(){let e=t.pop();e||(0,n.invariant)(!1),i=e}},ObjectField(t){let n=t.name.value;i[n]?e.reportError(new r.GraphQLError(`There can be only one input field named "${n}".`,{nodes:[i[n],t.name]})):i[n]=t.name}}};var n=e.r(119588),r=e.r(294943)},420383,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.UniqueOperationNamesRule=function(e){let t=Object.create(null);return{OperationDefinition(i){let r=i.name;return r&&(t[r.value]?e.reportError(new n.GraphQLError(`There can be only one operation named "${r.value}".`,{nodes:[t[r.value],r]})):t[r.value]=r),!1},FragmentDefinition:()=>!1}};var n=e.r(294943)},71155,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.UniqueOperationTypesRule=function(e){let t=e.getSchema(),i=Object.create(null),r=t?{query:t.getQueryType(),mutation:t.getMutationType(),subscription:t.getSubscriptionType()}:{};return{SchemaDefinition:a,SchemaExtension:a};function a(t){var a;for(let s of null!=(a=t.operationTypes)?a:[]){let t=s.operation,a=i[t];r[t]?e.reportError(new n.GraphQLError(`Type for ${t} already defined in the schema. It cannot be redefined.`,{nodes:s})):a?e.reportError(new n.GraphQLError(`There can be only one ${t} type in schema.`,{nodes:[a,s]})):i[t]=s}return!1}};var n=e.r(294943)},455960,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.UniqueTypeNamesRule=function(e){let t=Object.create(null),i=e.getSchema();return{ScalarTypeDefinition:r,ObjectTypeDefinition:r,InterfaceTypeDefinition:r,UnionTypeDefinition:r,EnumTypeDefinition:r,InputObjectTypeDefinition:r};function r(r){let a=r.name.value;return null!=i&&i.getType(a)?void e.reportError(new n.GraphQLError(`Type "${a}" already exists in the schema. It cannot also be defined in this type definition.`,{nodes:r.name})):(t[a]?e.reportError(new n.GraphQLError(`There can be only one type named "${a}".`,{nodes:[t[a],r.name]})):t[a]=r.name,!1)}};var n=e.r(294943)},698900,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.UniqueVariableNamesRule=function(e){return{OperationDefinition(t){var i;let a=null!=(i=t.variableDefinitions)?i:[];for(let[t,i]of(0,n.groupBy)(a,e=>e.variable.name.value))i.length>1&&e.reportError(new r.GraphQLError(`There can be only one variable named "$${t}".`,{nodes:i.map(e=>e.variable.name)}))}}};var n=e.r(754680),r=e.r(294943)},151009,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.ValuesOfCorrectTypeRule=function(e){return{ListValue(t){let i=(0,c.getNullableType)(e.getParentInputType());if(!(0,c.isListType)(i))return d(e,t),!1},ObjectValue(t){let i=(0,c.getNamedType)(e.getInputType());if(!(0,c.isInputObjectType)(i))return d(e,t),!1;let n=(0,a.keyMap)(t.fields,e=>e.name.value);for(let a of Object.values(i.getFields()))if(!n[a.name]&&(0,c.isRequiredInputField)(a)){let n=(0,r.inspect)(a.type);e.reportError(new o.GraphQLError(`Field "${i.name}.${a.name}" of required type "${n}" was not provided.`,{nodes:t}))}i.isOneOf&&function(e,t,i,n){var r;let a=Object.keys(n);if(1!==a.length)return e.reportError(new o.GraphQLError(`OneOf Input Object "${i.name}" must specify exactly one key.`,{nodes:[t]}));let s=null==(r=n[a[0]])?void 0:r.value;s&&s.kind!==l.Kind.NULL||e.reportError(new o.GraphQLError(`Field "${i.name}.${a[0]}" must be non-null.`,{nodes:[t]}))}(e,t,i,n)},ObjectField(t){let i=(0,c.getNamedType)(e.getParentInputType());if(!e.getInputType()&&(0,c.isInputObjectType)(i)){let r=(0,s.suggestionList)(t.name.value,Object.keys(i.getFields()));e.reportError(new o.GraphQLError(`Field "${t.name.value}" is not defined by type "${i.name}".`+(0,n.didYouMean)(r),{nodes:t}))}},NullValue(t){let i=e.getInputType();(0,c.isNonNullType)(i)&&e.reportError(new o.GraphQLError(`Expected value of type "${(0,r.inspect)(i)}", found ${(0,u.print)(t)}.`,{nodes:t}))},EnumValue:t=>d(e,t),IntValue:t=>d(e,t),FloatValue:t=>d(e,t),StringValue:t=>d(e,t),BooleanValue:t=>d(e,t)}};var n=e.r(996650),r=e.r(818123),a=e.r(117921),s=e.r(529364),o=e.r(294943),l=e.r(199311),u=e.r(340647),c=e.r(211325);function d(e,t){let i=e.getInputType();if(!i)return;let n=(0,c.getNamedType)(i);if(!(0,c.isLeafType)(n)){let n=(0,r.inspect)(i);e.reportError(new o.GraphQLError(`Expected value of type "${n}", found ${(0,u.print)(t)}.`,{nodes:t}));return}try{let a=n.parseLiteral(t,void 0);if(void 0===a){let n=(0,r.inspect)(i);e.reportError(new o.GraphQLError(`Expected value of type "${n}", found ${(0,u.print)(t)}.`,{nodes:t}))}}catch(a){let n=(0,r.inspect)(i);a instanceof o.GraphQLError?e.reportError(a):e.reportError(new o.GraphQLError(`Expected value of type "${n}", found ${(0,u.print)(t)}; `+a.message,{nodes:t,originalError:a}))}}},388275,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.VariablesAreInputTypesRule=function(e){return{VariableDefinition(t){let i=(0,s.typeFromAST)(e.getSchema(),t.type);if(void 0!==i&&!(0,a.isInputType)(i)){let i=t.variable.name.value,a=(0,r.print)(t.type);e.reportError(new n.GraphQLError(`Variable "$${i}" cannot be non-input type "${a}".`,{nodes:t.type}))}}}};var n=e.r(294943),r=e.r(340647),a=e.r(211325),s=e.r(653704)},218412,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.VariablesInAllowedPositionRule=function(e){let t=Object.create(null);return{OperationDefinition:{enter(){t=Object.create(null)},leave(i){for(let{node:u,type:c,defaultValue:d,parentType:p}of e.getRecursiveVariableUsages(i)){let i=u.name.value,h=t[i];if(h&&c){let t=e.getSchema(),f=(0,l.typeFromAST)(t,h.type);if(f&&!function(e,t,i,n,r){if((0,s.isNonNullType)(n)&&!(0,s.isNonNullType)(t)){if((null==i||i.kind===a.Kind.NULL)&&void 0===r)return!1;let s=n.ofType;return(0,o.isTypeSubTypeOf)(e,t,s)}return(0,o.isTypeSubTypeOf)(e,t,n)}(t,f,h.defaultValue,c,d)){let t=(0,n.inspect)(f),a=(0,n.inspect)(c);e.reportError(new r.GraphQLError(`Variable "$${i}" of type "${t}" used in position expecting type "${a}".`,{nodes:[h,u]}))}(0,s.isInputObjectType)(p)&&p.isOneOf&&(0,s.isNullableType)(f)&&e.reportError(new r.GraphQLError(`Variable "$${i}" is of type "${f}" but must be non-nullable to be used for OneOf Input Object "${p}".`,{nodes:[h,u]}))}}}},VariableDefinition(e){t[e.variable.name.value]=e}}};var n=e.r(818123),r=e.r(294943),a=e.r(199311),s=e.r(211325),o=e.r(957861),l=e.r(653704)},359063,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.specifiedSDLRules=i.specifiedRules=i.recommendedRules=void 0;var n=e.r(619559),r=e.r(146560),a=e.r(610156),s=e.r(111080),o=e.r(820345),l=e.r(432098),u=e.r(141097),c=e.r(336446),d=e.r(893600),p=e.r(100876),h=e.r(74344),f=e.r(166380),m=e.r(608150),y=e.r(528651),v=e.r(581577),g=e.r(8879),T=e.r(258511),S=e.r(818671),E=e.r(12773),I=e.r(68741),b=e.r(387128),N=e.r(644919),_=e.r(970672),D=e.r(611443),A=e.r(343685),O=e.r(975444),R=e.r(971887),w=e.r(845263),L=e.r(420383),C=e.r(71155),F=e.r(455960),k=e.r(698900),P=e.r(151009),x=e.r(388275),M=e.r(218412);let U=Object.freeze([p.MaxIntrospectionDepthRule]);i.recommendedRules=U,i.specifiedRules=Object.freeze([n.ExecutableDefinitionsRule,L.UniqueOperationNamesRule,c.LoneAnonymousOperationRule,I.SingleFieldSubscriptionsRule,u.KnownTypeNamesRule,a.FragmentsOnCompositeTypesRule,x.VariablesAreInputTypesRule,E.ScalarLeafsRule,r.FieldsOnCorrectTypeRule,R.UniqueFragmentNamesRule,l.KnownFragmentNamesRule,m.NoUnusedFragmentsRule,g.PossibleFragmentSpreadsRule,h.NoFragmentCyclesRule,k.UniqueVariableNamesRule,f.NoUndefinedVariablesRule,y.NoUnusedVariablesRule,o.KnownDirectivesRule,D.UniqueDirectivesPerLocationRule,s.KnownArgumentNamesRule,N.UniqueArgumentNamesRule,P.ValuesOfCorrectTypeRule,S.ProvidedRequiredArgumentsRule,M.VariablesInAllowedPositionRule,v.OverlappingFieldsCanBeMergedRule,w.UniqueInputFieldNamesRule,...U]),i.specifiedSDLRules=Object.freeze([d.LoneSchemaDefinitionRule,C.UniqueOperationTypesRule,F.UniqueTypeNamesRule,A.UniqueEnumValueNamesRule,O.UniqueFieldDefinitionNamesRule,b.UniqueArgumentDefinitionNamesRule,_.UniqueDirectiveNamesRule,u.KnownTypeNamesRule,o.KnownDirectivesRule,D.UniqueDirectivesPerLocationRule,T.PossibleTypeExtensionsRule,s.KnownArgumentNamesOnDirectivesRule,N.UniqueArgumentNamesRule,w.UniqueInputFieldNamesRule,S.ProvidedRequiredArgumentsOnDirectivesRule])},85242,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.ValidationContext=i.SDLValidationContext=i.ASTValidationContext=void 0;var n=e.r(199311),r=e.r(999680),a=e.r(928241);class s{constructor(e,t){this._ast=e,this._fragments=void 0,this._fragmentSpreads=new Map,this._recursivelyReferencedFragments=new Map,this._onError=t}get[Symbol.toStringTag](){return"ASTValidationContext"}reportError(e){this._onError(e)}getDocument(){return this._ast}getFragment(e){let t;if(this._fragments)t=this._fragments;else{for(let e of(t=Object.create(null),this.getDocument().definitions))e.kind===n.Kind.FRAGMENT_DEFINITION&&(t[e.name.value]=e);this._fragments=t}return t[e]}getFragmentSpreads(e){let t=this._fragmentSpreads.get(e);if(!t){let i;t=[];let r=[e];for(;i=r.pop();)for(let e of i.selections)e.kind===n.Kind.FRAGMENT_SPREAD?t.push(e):e.selectionSet&&r.push(e.selectionSet);this._fragmentSpreads.set(e,t)}return t}getRecursivelyReferencedFragments(e){let t=this._recursivelyReferencedFragments.get(e);if(!t){let i;t=[];let n=Object.create(null),r=[e.selectionSet];for(;i=r.pop();)for(let e of this.getFragmentSpreads(i)){let i=e.name.value;if(!0!==n[i]){n[i]=!0;let e=this.getFragment(i);e&&(t.push(e),r.push(e.selectionSet))}}this._recursivelyReferencedFragments.set(e,t)}return t}}i.ASTValidationContext=s;class o extends s{constructor(e,t,i){super(e,i),this._schema=t}get[Symbol.toStringTag](){return"SDLValidationContext"}getSchema(){return this._schema}}i.SDLValidationContext=o;class l extends s{constructor(e,t,i,n){super(t,n),this._schema=e,this._typeInfo=i,this._variableUsages=new Map,this._recursiveVariableUsages=new Map}get[Symbol.toStringTag](){return"ValidationContext"}getSchema(){return this._schema}getVariableUsages(e){let t=this._variableUsages.get(e);if(!t){let i=[],n=new a.TypeInfo(this._schema);(0,r.visit)(e,(0,a.visitWithTypeInfo)(n,{VariableDefinition:()=>!1,Variable(e){i.push({node:e,type:n.getInputType(),defaultValue:n.getDefaultValue(),parentType:n.getParentInputType()})}})),t=i,this._variableUsages.set(e,t)}return t}getRecursiveVariableUsages(e){let t=this._recursiveVariableUsages.get(e);if(!t){for(let i of(t=this.getVariableUsages(e),this.getRecursivelyReferencedFragments(e)))t=t.concat(this.getVariableUsages(i));this._recursiveVariableUsages.set(e,t)}return t}getType(){return this._typeInfo.getType()}getParentType(){return this._typeInfo.getParentType()}getInputType(){return this._typeInfo.getInputType()}getParentInputType(){return this._typeInfo.getParentInputType()}getFieldDef(){return this._typeInfo.getFieldDef()}getDirective(){return this._typeInfo.getDirective()}getArgument(){return this._typeInfo.getArgument()}getEnumValue(){return this._typeInfo.getEnumValue()}}i.ValidationContext=l},563029,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.assertValidSDL=function(e){let t=h(e);if(0!==t.length)throw Error(t.map(e=>e.message).join("\n\n"))},i.assertValidSDLExtension=function(e,t){let i=h(e,t);if(0!==i.length)throw Error(i.map(e=>e.message).join("\n\n"))},i.validate=function(e,t,i=c.specifiedRules,r,s=new u.TypeInfo(e)){var h;let f=null!=(h=null==r?void 0:r.maxErrors)?h:100;t||(0,n.devAssert)(!1,"Must provide document."),(0,l.assertValidSchema)(e);let m=Object.freeze({}),y=[],v=new d.ValidationContext(e,t,s,e=>{if(y.length>=f)throw y.push(new a.GraphQLError("Too many validation errors, error limit reached. Validation aborted.")),m;y.push(e)}),g=(0,o.visitInParallel)(i.map(e=>e(v)));try{(0,o.visit)(t,(0,u.visitWithTypeInfo)(s,g),p)}catch(e){if(e!==m)throw e}return y},i.validateSDL=h;var n=e.r(786390),r=e.r(287547),a=e.r(294943),s=e.r(463040),o=e.r(999680),l=e.r(215956),u=e.r(928241),c=e.r(359063),d=e.r(85242);let p=(0,r.mapValue)(s.QueryDocumentKeys,e=>e.filter(e=>"description"!==e));function h(e,t,i=c.specifiedSDLRules){let n=[],r=new d.SDLValidationContext(e,t,e=>{n.push(e)}),a=i.map(e=>e(r));return(0,o.visit)(e,(0,o.visitInParallel)(a)),n}},473988,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.NoDeprecatedCustomRule=function(e){return{Field(t){let i=e.getFieldDef(),a=null==i?void 0:i.deprecationReason;if(i&&null!=a){let s=e.getParentType();null!=s||(0,n.invariant)(!1),e.reportError(new r.GraphQLError(`The field ${s.name}.${i.name} is deprecated. ${a}`,{nodes:t}))}},Argument(t){let i=e.getArgument(),a=null==i?void 0:i.deprecationReason;if(i&&null!=a){let s=e.getDirective();if(null!=s)e.reportError(new r.GraphQLError(`Directive "@${s.name}" argument "${i.name}" is deprecated. ${a}`,{nodes:t}));else{let s=e.getParentType(),o=e.getFieldDef();null!=s&&null!=o||(0,n.invariant)(!1),e.reportError(new r.GraphQLError(`Field "${s.name}.${o.name}" argument "${i.name}" is deprecated. ${a}`,{nodes:t}))}}},ObjectField(t){let i=(0,a.getNamedType)(e.getParentInputType());if((0,a.isInputObjectType)(i)){let n=i.getFields()[t.name.value],a=null==n?void 0:n.deprecationReason;null!=a&&e.reportError(new r.GraphQLError(`The input field ${i.name}.${n.name} is deprecated. ${a}`,{nodes:t}))}},EnumValue(t){let i=e.getEnumValue(),s=null==i?void 0:i.deprecationReason;if(i&&null!=s){let o=(0,a.getNamedType)(e.getInputType());null!=o||(0,n.invariant)(!1),e.reportError(new r.GraphQLError(`The enum value "${o.name}.${i.name}" is deprecated. ${s}`,{nodes:t}))}}}};var n=e.r(119588),r=e.r(294943),a=e.r(211325)},583740,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.NoSchemaIntrospectionCustomRule=function(e){return{Field(t){let i=(0,r.getNamedType)(e.getType());i&&(0,a.isIntrospectionType)(i)&&e.reportError(new n.GraphQLError(`GraphQL introspection has been disabled, but the requested query contained the field "${t.name.value}".`,{nodes:t}))}}};var n=e.r(294943),r=e.r(211325),a=e.r(187936)},354836,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"ExecutableDefinitionsRule",{enumerable:!0,get:function(){return s.ExecutableDefinitionsRule}}),Object.defineProperty(i,"FieldsOnCorrectTypeRule",{enumerable:!0,get:function(){return o.FieldsOnCorrectTypeRule}}),Object.defineProperty(i,"FragmentsOnCompositeTypesRule",{enumerable:!0,get:function(){return l.FragmentsOnCompositeTypesRule}}),Object.defineProperty(i,"KnownArgumentNamesRule",{enumerable:!0,get:function(){return u.KnownArgumentNamesRule}}),Object.defineProperty(i,"KnownDirectivesRule",{enumerable:!0,get:function(){return c.KnownDirectivesRule}}),Object.defineProperty(i,"KnownFragmentNamesRule",{enumerable:!0,get:function(){return d.KnownFragmentNamesRule}}),Object.defineProperty(i,"KnownTypeNamesRule",{enumerable:!0,get:function(){return p.KnownTypeNamesRule}}),Object.defineProperty(i,"LoneAnonymousOperationRule",{enumerable:!0,get:function(){return h.LoneAnonymousOperationRule}}),Object.defineProperty(i,"LoneSchemaDefinitionRule",{enumerable:!0,get:function(){return F.LoneSchemaDefinitionRule}}),Object.defineProperty(i,"MaxIntrospectionDepthRule",{enumerable:!0,get:function(){return C.MaxIntrospectionDepthRule}}),Object.defineProperty(i,"NoDeprecatedCustomRule",{enumerable:!0,get:function(){return V.NoDeprecatedCustomRule}}),Object.defineProperty(i,"NoFragmentCyclesRule",{enumerable:!0,get:function(){return f.NoFragmentCyclesRule}}),Object.defineProperty(i,"NoSchemaIntrospectionCustomRule",{enumerable:!0,get:function(){return G.NoSchemaIntrospectionCustomRule}}),Object.defineProperty(i,"NoUndefinedVariablesRule",{enumerable:!0,get:function(){return m.NoUndefinedVariablesRule}}),Object.defineProperty(i,"NoUnusedFragmentsRule",{enumerable:!0,get:function(){return y.NoUnusedFragmentsRule}}),Object.defineProperty(i,"NoUnusedVariablesRule",{enumerable:!0,get:function(){return v.NoUnusedVariablesRule}}),Object.defineProperty(i,"OverlappingFieldsCanBeMergedRule",{enumerable:!0,get:function(){return g.OverlappingFieldsCanBeMergedRule}}),Object.defineProperty(i,"PossibleFragmentSpreadsRule",{enumerable:!0,get:function(){return T.PossibleFragmentSpreadsRule}}),Object.defineProperty(i,"PossibleTypeExtensionsRule",{enumerable:!0,get:function(){return j.PossibleTypeExtensionsRule}}),Object.defineProperty(i,"ProvidedRequiredArgumentsRule",{enumerable:!0,get:function(){return S.ProvidedRequiredArgumentsRule}}),Object.defineProperty(i,"ScalarLeafsRule",{enumerable:!0,get:function(){return E.ScalarLeafsRule}}),Object.defineProperty(i,"SingleFieldSubscriptionsRule",{enumerable:!0,get:function(){return I.SingleFieldSubscriptionsRule}}),Object.defineProperty(i,"UniqueArgumentDefinitionNamesRule",{enumerable:!0,get:function(){return U.UniqueArgumentDefinitionNamesRule}}),Object.defineProperty(i,"UniqueArgumentNamesRule",{enumerable:!0,get:function(){return b.UniqueArgumentNamesRule}}),Object.defineProperty(i,"UniqueDirectiveNamesRule",{enumerable:!0,get:function(){return $.UniqueDirectiveNamesRule}}),Object.defineProperty(i,"UniqueDirectivesPerLocationRule",{enumerable:!0,get:function(){return N.UniqueDirectivesPerLocationRule}}),Object.defineProperty(i,"UniqueEnumValueNamesRule",{enumerable:!0,get:function(){return x.UniqueEnumValueNamesRule}}),Object.defineProperty(i,"UniqueFieldDefinitionNamesRule",{enumerable:!0,get:function(){return M.UniqueFieldDefinitionNamesRule}}),Object.defineProperty(i,"UniqueFragmentNamesRule",{enumerable:!0,get:function(){return _.UniqueFragmentNamesRule}}),Object.defineProperty(i,"UniqueInputFieldNamesRule",{enumerable:!0,get:function(){return D.UniqueInputFieldNamesRule}}),Object.defineProperty(i,"UniqueOperationNamesRule",{enumerable:!0,get:function(){return A.UniqueOperationNamesRule}}),Object.defineProperty(i,"UniqueOperationTypesRule",{enumerable:!0,get:function(){return k.UniqueOperationTypesRule}}),Object.defineProperty(i,"UniqueTypeNamesRule",{enumerable:!0,get:function(){return P.UniqueTypeNamesRule}}),Object.defineProperty(i,"UniqueVariableNamesRule",{enumerable:!0,get:function(){return O.UniqueVariableNamesRule}}),Object.defineProperty(i,"ValidationContext",{enumerable:!0,get:function(){return r.ValidationContext}}),Object.defineProperty(i,"ValuesOfCorrectTypeRule",{enumerable:!0,get:function(){return R.ValuesOfCorrectTypeRule}}),Object.defineProperty(i,"VariablesAreInputTypesRule",{enumerable:!0,get:function(){return w.VariablesAreInputTypesRule}}),Object.defineProperty(i,"VariablesInAllowedPositionRule",{enumerable:!0,get:function(){return L.VariablesInAllowedPositionRule}}),Object.defineProperty(i,"recommendedRules",{enumerable:!0,get:function(){return a.recommendedRules}}),Object.defineProperty(i,"specifiedRules",{enumerable:!0,get:function(){return a.specifiedRules}}),Object.defineProperty(i,"validate",{enumerable:!0,get:function(){return n.validate}});var n=e.r(563029),r=e.r(85242),a=e.r(359063),s=e.r(619559),o=e.r(146560),l=e.r(610156),u=e.r(111080),c=e.r(820345),d=e.r(432098),p=e.r(141097),h=e.r(336446),f=e.r(74344),m=e.r(166380),y=e.r(608150),v=e.r(528651),g=e.r(581577),T=e.r(8879),S=e.r(818671),E=e.r(12773),I=e.r(68741),b=e.r(644919),N=e.r(611443),_=e.r(971887),D=e.r(845263),A=e.r(420383),O=e.r(698900),R=e.r(151009),w=e.r(388275),L=e.r(218412),C=e.r(100876),F=e.r(893600),k=e.r(71155),P=e.r(455960),x=e.r(343685),M=e.r(975444),U=e.r(387128),$=e.r(970672),j=e.r(258511),V=e.r(473988),G=e.r(583740)},629961,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.GraphQLSchemaValidationError=void 0,i.GraphQLSchemaValidationError=class extends Error{constructor(e){super(),this.errors=e,this.name=this.constructor.name,Error.captureStackTrace(this,this.constructor),this.message=e.map(e=>e.message).join("\n\n")}}},58532,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.buildSchemaFromSDL=i.addResolversToSchema=i.modulesFromSDL=i.isDocumentNode=i.isNode=void 0;let n=e.r(186846),r=e.r(354836),a=e.r(563029),s=e.r(359063),o=e.r(629961);function l(e){return null!=e}function u(e){return e&&"string"==typeof e.kind}function c(e){return u(e)&&e.kind===n.Kind.DOCUMENT}i.isNode=u,i.isDocumentNode=c;let d=[r.KnownTypeNamesRule,r.UniqueDirectivesPerLocationRule,r.PossibleTypeExtensionsRule],p=s.specifiedSDLRules.filter(e=>!d.includes(e)),h={[n.Kind.SCALAR_TYPE_EXTENSION]:n.Kind.SCALAR_TYPE_DEFINITION,[n.Kind.OBJECT_TYPE_EXTENSION]:n.Kind.OBJECT_TYPE_DEFINITION,[n.Kind.INTERFACE_TYPE_EXTENSION]:n.Kind.INTERFACE_TYPE_DEFINITION,[n.Kind.UNION_TYPE_EXTENSION]:n.Kind.UNION_TYPE_DEFINITION,[n.Kind.ENUM_TYPE_EXTENSION]:n.Kind.ENUM_TYPE_DEFINITION,[n.Kind.INPUT_OBJECT_TYPE_EXTENSION]:n.Kind.INPUT_OBJECT_TYPE_DEFINITION};function f(e){return Array.isArray(e)?e.map(e=>u(e)&&c(e)?{typeDefs:e}:e):[{typeDefs:e}]}function m(e,t){var i,r;for(let[a,s]of Object.entries(t)){let t=e.getType(a);if((0,n.isAbstractType)(t)){let e=t.extensions;for(let[n,r]of Object.entries(s))"__resolveReference"===n?t.extensions={...e,apollo:{...e.apollo,subgraph:{...null==(i=e.apollo)?void 0:i.subgraph,resolveReference:r}}}:"__resolveType"===n&&(t.resolveType=r)}if((0,n.isScalarType)(t))for(let e in s){let i=s[e];void 0!==i&&(t[e]=i)}if((0,n.isEnumType)(t)){let e=t.getValues(),i={};e.forEach(e=>{let t=s[e.name];void 0===t&&(t=e.name),i[e.name]={value:t,deprecationReason:e.deprecationReason,description:e.description,astNode:e.astNode,extensions:void 0}}),Object.assign(t,new n.GraphQLEnumType({...t.toConfig(),values:i}))}if(!(0,n.isObjectType)(t))continue;let o=t.getFields(),l=t.extensions;for(let[e,i]of Object.entries(s)){if("__resolveReference"===e){t.extensions={...l,apollo:{...l.apollo,subgraph:{...null==(r=l.apollo)?void 0:r.subgraph,resolveReference:i}}};continue}if("__isTypeOf"===e){t.isTypeOf=i;continue}let n=o[e];n&&("function"==typeof i?n.resolve=i:(n.resolve=i.resolve,n.subscribe=i.subscribe))}}}i.modulesFromSDL=f,i.addResolversToSchema=m,i.buildSchemaFromSDL=function(e,t){let i,r,s=f(e),u=(0,n.concatAST)(s.map(e=>e.typeDefs)),c=(0,a.validateSDL)(u,t,p);if(c.length>0)throw new o.GraphQLSchemaValidationError(c);let d=Object.create(null),y=Object.create(null),v=[],g=[],T=[],S=[];for(let e of u.definitions)if((0,n.isTypeDefinitionNode)(e)){let t=e.name.value;d[t]?d[t].push(e):d[t]=[e]}else if((0,n.isTypeExtensionNode)(e)){let t=e.name.value;y[t]?y[t].push(e):y[t]=[e]}else e.kind===n.Kind.DIRECTIVE_DEFINITION?v.push(e):e.kind===n.Kind.SCHEMA_DEFINITION?(g.push(e),S.push(...e.directives?e.directives:[]),i=e.description):e.kind===n.Kind.SCHEMA_EXTENSION&&(T.push(e),S.push(...e.directives?e.directives:[]));let E=t||new n.GraphQLSchema({query:void 0}),I=[];for(let[e,t]of Object.entries(y))if(!d[e]){let e=t[0],i={kind:h[e.kind],name:e.name};I.push(i)}E=(0,n.extendSchema)(E,{kind:n.Kind.DOCUMENT,definitions:[...Object.values(d).flat(),...I,...v]},{assumeValidSDL:!0}),E=(0,n.extendSchema)(E,{kind:n.Kind.DOCUMENT,definitions:Object.values(y).flat()},{assumeValidSDL:!0});let b=[...g,...T].map(e=>e.operationTypes).filter(l).flat();if(b.length>0)for(let{operation:e,type:t}of(r={},b))r[e]=t.name.value;else r={query:"Query",mutation:"Mutation",subscription:"Subscription"};for(let e of(E=new n.GraphQLSchema({...E.toConfig(),...function(e,t){let i=Object.create(null);for(let[n,r]of Object.entries(e))i[n]=t(r);return i}(r,e=>e?E.getType(e):void 0),description:null==i?void 0:i.value,astNode:{kind:n.Kind.SCHEMA_DEFINITION,description:i,directives:S,operationTypes:[]}}),s))e.resolvers&&m(E,e.resolvers);return E}},905774,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.transformSchema=void 0;let n=e.r(186846);function r(e,t){let i=Object.create(null);for(let[n,r]of Object.entries(e))i[n]=t(r);return i}i.transformSchema=function(e,t){let i=Object.create(null);for(let a of Object.values(e.getTypeMap())){if((0,n.isIntrospectionType)(a))continue;let e=t(a);if(null===e)continue;let l=e||a;i[l.name]=function(e){if((0,n.isObjectType)(e)){let t=e.toConfig();return new n.GraphQLObjectType({...t,interfaces:()=>t.interfaces.map(o),fields:()=>u(t.fields)})}if((0,n.isInterfaceType)(e)){let t=e.toConfig();return new n.GraphQLInterfaceType({...t,interfaces:()=>t.interfaces.map(o),fields:()=>u(t.fields)})}if((0,n.isUnionType)(e)){let t=e.toConfig();return new n.GraphQLUnionType({...t,types:()=>t.types.map(o)})}if((0,n.isInputObjectType)(e)){let t=e.toConfig();return new n.GraphQLInputObjectType({...t,fields:()=>r(t.fields,e=>({...e,type:s(e.type)}))})}return e}(l)}let a=e.toConfig();return new n.GraphQLSchema({...a,types:Object.values(i),query:l(a.query),mutation:l(a.mutation),subscription:l(a.subscription),directives:a.directives.map(e=>{let t=e.toConfig();return new n.GraphQLDirective({...t,args:c(t.args)})})});function s(e){return(0,n.isListType)(e)?new n.GraphQLList(s(e.ofType)):(0,n.isNonNullType)(e)?new n.GraphQLNonNull(s(e.ofType)):o(e)}function o(e){return i[e.name]||e}function l(e){return e?o(e):void 0}function u(e){return r(e,e=>({...e,type:s(e.type),args:e.args?c(e.args):void 0}))}function c(e){return r(e,e=>({...e,type:s(e.type)}))}}},242080,(e,t,i)=>{"use strict";var n=e.e&&e.e.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),r=e.e&&e.e.__exportStar||function(e,t){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(t,i)||n(t,e,i)};Object.defineProperty(i,"__esModule",{value:!0}),r(e.r(294682),i),r(e.r(58532),i),r(e.r(629961),i),r(e.r(905774),i)},678270,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.typesCanBeMerged=i.isStrictSubtype=i.isSubtype=i.isDirectSubtype=i.sameType=i.DEFAULT_SUBTYPING_RULES=i.ALL_SUBTYPING_RULES=void 0;let n=e.r(168032);function r(e,t){switch(e.kind){case"ListType":return(0,n.isListType)(t)&&r(e.ofType,t.ofType);case"NonNullType":return(0,n.isNonNullType)(t)&&r(e.ofType,t.ofType);default:return(0,n.isNamedType)(t)&&e.name===t.name}}function a(e,t,i=(e,t)=>e.hasTypeMember(t),r=(e,t)=>e.implementsInterface(t)){return(0,n.isUnionType)(e)?(0,n.isObjectType)(t)&&i(e,t):r(t,e)}function s(e,t,n=i.DEFAULT_SUBTYPING_RULES,a=(e,t)=>e.hasTypeMember(t),l=(e,t)=>e.implementsInterface(t)){return r(e,t)||o(e,t,n,a,l)}function o(e,t,r=i.DEFAULT_SUBTYPING_RULES,l=(e,t)=>e.hasTypeMember(t),u=(e,t)=>e.implementsInterface(t)){switch(t.kind){case"ListType":return r.includes("list_propagation")&&(0,n.isListType)(e)&&s(e.ofType,t.ofType,r,l,u);case"NonNullType":if((0,n.isNonNullType)(e))return r.includes("nonNullable_propagation")&&s(e.ofType,t.ofType,r,l,u);return r.includes("nonNullable_downgrade")&&s(e,t.ofType,r,l,u);case"ObjectType":case"InterfaceType":if((0,n.isListType)(e))return r.includes("list_upgrade")&&s(e.ofType,t,r,l,u);return r.includes("direct")&&((0,n.isInterfaceType)(e)||(0,n.isUnionType)(e))&&a(e,t,l,u);default:return(0,n.isListType)(e)&&r.includes("list_upgrade")&&s(e.ofType,t,r,l,u)}}i.ALL_SUBTYPING_RULES=["direct","nonNullable_downgrade","list_upgrade","list_propagation","nonNullable_propagation"],i.DEFAULT_SUBTYPING_RULES=i.ALL_SUBTYPING_RULES.filter(e=>"list_upgrade"!==e),i.sameType=r,i.isDirectSubtype=a,i.isSubtype=s,i.isStrictSubtype=o,i.typesCanBeMerged=function e(t,i){return(0,n.isNonNullType)(t)?!!(0,n.isNonNullType)(i)&&e(t.ofType,i.ofType):(0,n.isListType)(t)?!!(0,n.isListType)(i)&&e(t.ofType,i.ofType):(0,n.isCompositeType)(t)?(0,n.isCompositeType)(i):r(t,i)}},331484,(e,t,i)=>{"use strict";function n(e,t){if(!e)throw Error("string"==typeof t?t:t())}Object.defineProperty(i,"__esModule",{value:!0}),i.setsEqual=i.composeSets=i.mergeMapOrNull=i.findLast=i.isNonEmptyArray=i.removeArrayElement=i.isDefined=i.printHumanReadableList=i.joinStrings=i.validateStringContainsBoolean=i.copyWitNewLength=i.MapWithCachedArrays=i.setValues=i.mapEntries=i.mapKeys=i.mapValues=i.firstOf=i.isSubset=i.arrayEquals=i.OrderedMap=i.SetMultiMap=i.MultiMap=i.assertUnreachable=i.assert=void 0,i.assert=n,i.assertUnreachable=function(e){throw Error("Didn't expect to get here")};class r extends Map{add(e,t){let i=this.get(e);return i?i.push(t):this.set(e,[t]),this}addAll(e){for(let[t,i]of e.entries())for(let e of i)this.add(t,e);return this}}i.MultiMap=r;class a extends Map{add(e,t){let i=this.get(e);return i||(i=new Set,this.set(e,i)),i.add(t),this}addAll(e){for(let[t,i]of e.entries())for(let e of i)this.add(t,e);return this}}i.SetMultiMap=a;class s{static defaultCompareFn(e,t){return e<t?-1:+(t<e)}constructor(e=s.defaultCompareFn){this._keys=[],this._values=new Map,this._compareFn=e}add(e,t){this._values.has(e)||this.insertKeyInOrder(e),this._values.set(e,t)}get(e){return this._values.get(e)}has(e){return this._values.has(e)}get size(){return this._keys.length}keys(){return this._keys}values(){return this._keys.map(e=>{let t=this._values.get(e);return n(t,"value for known key not found in OrderedMap"),t})}insertKeyInOrder(e){let t=0,i=this._keys.length-1;for(;t<=i;){let n=Math.floor((i+t)/2);0>this._compareFn(this._keys[n],e)?t=n+1:i=n-1}this._keys=this._keys.slice(0,t).concat(e).concat(this._keys.slice(t))}*[Symbol.iterator](){for(let e=0;e<this._keys.length;e+=1){let t=this._values.get(this._keys[e]);n(t,"value for known key not found in OrderedMap"),yield t}}}function o(e){let t=Array(e.size),i=0;for(let n of e.values())t[i++]=n;return t}function l(e){let t=Array(e.size),i=0;for(let n of e.keys())t[i++]=n;return t}function u(e,t=", ",i,n=" and "){if(0==e.length)return"";let r=e[0];if(1==e.length)return r;let a=e[e.length-1];return 2==e.length?r+(i||n)+a:r+(i||t)+e.slice(1,e.length-1).join(t)+n+a}i.OrderedMap=s,i.arrayEquals=function(e,t,i){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;++n)if(!(i?i(e[n],t[n]):e[n]===t[n]))return!1;return!0},i.isSubset=function(e,t){if(e===t)return!0;for(let i of t)if(!e.has(i))return!1;return!0},i.firstOf=function(e){let t=e[Symbol.iterator]().next();return t.done?void 0:t.value},i.mapValues=o,i.mapKeys=l,i.mapEntries=function(e){let t=Array(e.size),i=0;for(let n of e.entries())t[i++]=n;return t},i.setValues=function(e){let t=Array(e.size),i=0;for(let n of e.values())t[i++]=n;return t},i.MapWithCachedArrays=class{constructor(){this.map=new Map}clearCaches(){this.cachedKeys=void 0,this.cachedValues=void 0}get size(){return this.map.size}has(e){return this.map.has(e)}get(e){return this.map.get(e)}set(e,t){return this.map.set(e,t),this.clearCaches(),this}delete(e){let t=this.map.delete(e);return t&&this.clearCaches(),t}clear(){this.map.clear(),this.clearCaches()}keys(){return this.cachedKeys||(this.cachedKeys=l(this.map)),this.cachedKeys}values(){return this.cachedValues||(this.cachedValues=o(this.map)),this.cachedValues}},i.copyWitNewLength=function(e,t){n(t>=e.length,()=>`${t} < ${e.length}`);let i=Array(t);for(let t=0;t<e.length;t++)i[t]=e[t];return i},i.validateStringContainsBoolean=function(e){if(!e)return!1;switch(e.toLocaleLowerCase()){case"true":case"yes":case"1":return!0;case"false":case"no":case"0":return!1;default:return}},i.joinStrings=u,i.printHumanReadableList=function(e,{emptyValue:t,prefix:i,prefixPlural:n,lastSeparator:r,cutoff_output_length:a}){if(0===e.length)return null!=t?t:"";if(1==e.length)return i?i+" "+e[0]:e[0];let s=null!=a?a:100,{lastIdx:o}=e.reduce(({lastIdx:e,length:t},i)=>{let n=t+i.length;return n>s?{lastIdx:e,length:n}:{lastIdx:e+1,length:n}},{lastIdx:0,length:0}),l=e.slice(0,Math.max(1,o)),c=n?n+" ":i?i+" ":"";return l.length===e.length?c+u(l,", ",void 0,r):c+u(l,", ",void 0,", ")+", ..."},i.isDefined=e=>void 0!==e,i.removeArrayElement=function(e,t){let i=t.indexOf(e);return i>=0&&(t.splice(i,1),!0)},i.isNonEmptyArray=function(e){return e.length>0},i.findLast=function(e,t){for(let i=e.length-1;i>=0;i--){let n=e[i];if(t(n))return n}},i.mergeMapOrNull=function(e,t){return e?t?new Map([...e,...t]):e:t},i.composeSets=function(e,t){if(!e&&!t)return null;let i=new Set;return null==e||e.forEach(e=>i.add(e)),null==t||t.forEach(e=>i.add(e)),i},i.setsEqual=function(e,t){if(e===t||!e&&!t)return!0;if(!e||!t||e.size!==t.size)return!1;for(let i of e)if(!t.has(i))return!1;return!0}},408470,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.REMOVED_ERRORS=i.ERRORS=i.ERROR_CATEGORIES=i.withModifiedErrorNodes=i.withModifiedErrorMessage=i.errorCodeDef=i.errorCode=i.printErrors=i.printGraphQLErrorsOrRethrow=i.errorCauses=i.aggregateError=i.extractGraphQLErrorOptions=void 0;let n=e.r(186846),r=e.r(331484),a=(e,t,i=l)=>({code:e,description:t,metadata:i,err:(t,i)=>new n.GraphQLError(t,{...i,extensions:{...null==i?void 0:i.extensions,code:e}})});i.extractGraphQLErrorOptions=function(e){return{nodes:e.nodes,source:e.source,positions:e.positions,path:e.path,originalError:e.originalError,extensions:e.extensions}};class s extends n.GraphQLError{constructor(e,t,i,n){super(t+". Caused by:\n"+i.map(e=>e.toString()).join("\n\n"),{...n,extensions:{code:e}}),this.causes=i}toString(){let e=`[${this.extensions.code}] ${super.toString()}`;for(let t of(e+="\ncaused by:",this.causes))e+="\n\n - ",e+=t.toString().split("\n").join("\n ");return e}}function o(e){return e instanceof s?e.causes:e instanceof n.GraphQLError?[e]:void 0}i.aggregateError=function(e,t,i){return new s(e,t,i)},i.errorCauses=o,i.printGraphQLErrorsOrRethrow=function(e){let t=o(e);if(!t)throw e;return t.map(e=>e.toString()).join("\n\n")},i.printErrors=function(e){return e.map(e=>e.toString()).join("\n\n")};let l={addedIn:"2.0.0"},u=(e,t,i=l)=>({createCode:n=>a(e(n),t(n),i),get:t=>{let i=e2[e(t)];return(0,r.assert)(i,`Unexpected element: ${t}`),i}}),c=(e,t,i=l)=>u(t=>`${t.toLocaleUpperCase()}_${e}`,t,i);function d(e){if(e.extensions&&"code"in e.extensions)return e.extensions.code}i.errorCode=d,i.errorCodeDef=function(e){let t="string"==typeof e?e:d(e);return t?e2[t]:void 0},i.withModifiedErrorMessage=function(e,t){return new n.GraphQLError(t,{nodes:e.nodes,source:e.source,positions:e.positions,path:e.path,originalError:e.originalError,extensions:e.extensions})},i.withModifiedErrorNodes=function(e,t){return new n.GraphQLError(e.message,{nodes:t,source:e.source,positions:e.positions,path:e.path,originalError:e.originalError,extensions:e.extensions})};let p=a("INVALID_GRAPHQL","A schema is invalid GraphQL: it violates one of the rule of the specification."),h=a("DIRECTIVE_DEFINITION_INVALID","A built-in or federation directive has an invalid definition in the schema.",{...l,replaces:["TAG_DEFINITION_INVALID"]}),f=a("TYPE_DEFINITION_INVALID","A built-in or federation type has an invalid definition in the schema."),m=a("UNSUPPORTED_LINKED_FEATURE","Indicates that a feature used in a @link is either unsupported or is used with unsupported options."),y=a("UNKNOWN_FEDERATION_LINK_VERSION","The version of federation in a @link directive on the schema is unknown."),v=a("UNKNOWN_LINK_VERSION","The version of @link set on the schema is unknown.",{addedIn:"2.1.0"}),g=c("FIELDS_HAS_ARGS",e=>`The \`fields\` argument of a \`@${e}\` directive includes a field defined with arguments (which is not currently supported).`),T=g.createCode("key"),S=g.createCode("provides"),E=c("FIELDS_MISSING_EXTERNAL",e=>`The \`fields\` argument of a \`@${e}\` directive includes a field that is not marked as \`@external\`.`,{addedIn:"0.x"}),I=E.createCode("provides"),b=E.createCode("requires"),N=c("UNSUPPORTED_ON_INTERFACE",e=>`A \`@${e}\` directive is used on an interface, which is ${"key"===e?"only supported when @linking to federation 2.3+":"not (yet) supported"}.`),_=N.createCode("key"),D=N.createCode("provides"),A=N.createCode("requires"),O=c("DIRECTIVE_IN_FIELDS_ARG",e=>`The \`fields\` argument of a \`@${e}\` directive includes some directive applications. This is not supported`,{addedIn:"2.1.0"}),R=O.createCode("key"),w=O.createCode("provides"),L=O.createCode("requires"),C=a("EXTERNAL_UNUSED","An `@external` field is not being used by any instance of `@key`, `@requires`, `@provides` or to satisfy an interface implementation.",{addedIn:"0.x"}),F=a("TYPE_WITH_ONLY_UNUSED_EXTERNAL",`A federation 1 schema has a composite type comprised only of unused external fields. Note that this error can _only_ be raised for federation 1 schema as federation 2 schema do not allow unused external fields (and errors with code ${C.code} will be raised in that case). But when federation 1 schema are automatically migrated to federation 2 ones, unused external fields are automatically removed, and in rare case this can leave a type empty. If that happens, an error with this code will be raised`),k=a("PROVIDES_ON_NON_OBJECT_FIELD","A `@provides` directive is used to mark a field whose base type is not an object type."),P=c("INVALID_FIELDS_TYPE",e=>`The value passed to the \`fields\` argument of a \`@${e}\` directive is not a string.`),x=P.createCode("key"),M=P.createCode("provides"),U=P.createCode("requires"),$=c("INVALID_FIELDS",e=>`The \`fields\` argument of a \`@${e}\` directive is invalid (it has invalid syntax, includes unknown fields, ...).`),j=$.createCode("key"),V=$.createCode("provides"),G=$.createCode("requires"),B=a("KEY_FIELDS_SELECT_INVALID_TYPE","The `fields` argument of `@key` directive includes a field whose type is a list, interface, or union type. Fields of these types cannot be part of a `@key`",{addedIn:"0.x"}),K=u(e=>`ROOT_${e.toLocaleUpperCase()}_USED`,e=>`A subgraph's schema defines a type with the name \`${e}\`, while also specifying a _different_ type name as the root query object. This is not allowed.`,{addedIn:"0.x"}),Q=K.createCode("query"),q=K.createCode("mutation"),J=K.createCode("subscription"),H=a("INVALID_SUBGRAPH_NAME",'A subgraph name is invalid (subgraph names cannot be a single underscore ("_")).'),W=a("NO_QUERIES","None of the composed subgraphs expose any query."),Y=a("INTERFACE_FIELD_NO_IMPLEM","After subgraph merging, an implementation is missing a field of one of the interface it implements (which can happen for valid subgraphs)."),z=a("TYPE_KIND_MISMATCH","A type has the same name in different subgraphs, but a different kind. For instance, one definition is an object type but another is an interface.",{...l,replaces:["VALUE_TYPE_KIND_MISMATCH","EXTENSION_OF_WRONG_KIND","ENUM_MISMATCH_TYPE"]}),X=a("CONTEXT_NOT_SET","Context is never set for context trying to be used.",{addedIn:"2.8.0"}),Z=a("CONTEXT_INVALID_SELECTION","Selection within @fromContext must resolve to a single field.",{addedIn:"2.8.0"}),ee=a("NO_CONTEXT_IN_SELECTION","Selection in @fromContext field argument does not reference a context.",{addedIn:"2.8.0"}),et=a("CONTEXT_NO_RESOLVABLE_KEY","If an ObjectType uses a @fromContext, at least one of its keys must be resolvable.",{addedIn:"2.8.0"}),ei=a("CONTEXT_NAME_INVALID","Context name is invalid.",{addedIn:"2.8.0"}),en=a("EXTERNAL_TYPE_MISMATCH","An `@external` field has a type that is incompatible with the declaration(s) of that field in other subgraphs.",{addedIn:"0.x"}),er=a("EXTERNAL_COLLISION_WITH_ANOTHER_DIRECTIVE","The @external directive collides with other directives in some situations.",{addedIn:"2.1.0"}),ea=a("EXTERNAL_ARGUMENT_MISSING","An `@external` field is missing some arguments present in the declaration(s) of that field in other subgraphs."),es=a("EXTERNAL_ARGUMENT_TYPE_MISMATCH","An `@external` field declares an argument with a type that is incompatible with the corresponding argument in the declaration(s) of that field in other subgraphs."),eo=a("EXTERNAL_ARGUMENT_DEFAULT_MISMATCH","An `@external` field declares an argument with a default that is incompatible with the corresponding argument in the declaration(s) of that field in other subgraphs."),el=a("EXTERNAL_ON_INTERFACE",'The field of an interface type is marked with `@external`: as external is about marking field not resolved by the subgraph and as interface field are not resolved (only implementations of those fields are), an "external" interface field is nonsensical'),eu=a("MERGED_DIRECTIVE_APPLICATION_ON_EXTERNAL","In a subgraph, a field is both marked @external and has a merged directive applied to it"),ec=a("FIELD_TYPE_MISMATCH","A field has a type that is incompatible with other declarations of that field in other subgraphs.",{...l,replaces:["VALUE_TYPE_FIELD_TYPE_MISMATCH"]}),ed=a("FIELD_ARGUMENT_TYPE_MISMATCH","An argument (of a field/directive) has a type that is incompatible with that of other declarations of that same argument in other subgraphs.",{...l,replaces:["VALUE_TYPE_INPUT_VALUE_MISMATCH"]}),ep=a("INPUT_FIELD_DEFAULT_MISMATCH","An input field has a default value that is incompatible with other declarations of that field in other subgraphs."),eh=a("FIELD_ARGUMENT_DEFAULT_MISMATCH","An argument (of a field/directive) has a default value that is incompatible with that of other declarations of that same argument in other subgraphs."),ef=a("EXTENSION_WITH_NO_BASE","A subgraph is attempting to `extend` a type that is not originally defined in any known subgraph.",{addedIn:"0.x"}),em=a("EXTERNAL_MISSING_ON_BASE","A field is marked as `@external` in a subgraph but with no non-external declaration in any other subgraph.",{addedIn:"0.x"}),ey=a("INVALID_FIELD_SHARING","A field that is non-shareable in at least one subgraph is resolved by multiple subgraphs."),ev=a("INVALID_SHAREABLE_USAGE","The `@shareable` federation directive is used in an invalid way.",{addedIn:"2.1.2"}),eg=a("INVALID_LINK_DIRECTIVE_USAGE","An application of the @link directive is invalid/does not respect the specification."),eT=a("INVALID_LINK_IDENTIFIER","A url/version for a @link feature is invalid/does not respect the specification.",{addedIn:"2.1.0"}),eS=a("LINK_IMPORT_NAME_MISMATCH","The import name for a merged directive (as declared by the relevant `@link(import:)` argument) is inconsistent between subgraphs."),eE=a("REFERENCED_INACCESSIBLE","An element is marked as @inaccessible but is referenced by an element visible in the API schema."),eI=a("DEFAULT_VALUE_USES_INACCESSIBLE","An element is marked as @inaccessible but is used in the default value of an element visible in the API schema."),eb=a("QUERY_ROOT_TYPE_INACCESSIBLE","An element is marked as @inaccessible but is the query root type, which must be visible in the API schema."),eN=a("REQUIRED_INACCESSIBLE","An element is marked as @inaccessible but is required by an element visible in the API schema."),e_=a("IMPLEMENTED_BY_INACCESSIBLE","An element is marked as @inaccessible but implements an element visible in the API schema."),eD=a("DISALLOWED_INACCESSIBLE","An element is marked as @inaccessible that is not allowed to be @inaccessible."),eA=a("ONLY_INACCESSIBLE_CHILDREN","A type visible in the API schema has only @inaccessible children."),eO=a("REQUIRED_INPUT_FIELD_MISSING_IN_SOME_SUBGRAPH","A field of an input object type is mandatory in some subgraphs, but the field is not defined in all the subgraphs that define the input object type."),eR=a("REQUIRED_ARGUMENT_MISSING_IN_SOME_SUBGRAPH","An argument of a field or directive definition is mandatory in some subgraphs, but the argument is not defined in all the subgraphs that define the field or directive definition."),ew=a("EMPTY_MERGED_INPUT_TYPE","An input object type has no field common to all the subgraphs that define the type. Merging that type would result in an invalid empty input object type."),eL=a("ENUM_VALUE_MISMATCH","An enum type that is used as both an input and output type has a value that is not defined in all the subgraphs that define the enum type."),eC=a("EMPTY_MERGED_ENUM_TYPE","An enum type has no value common to all the subgraphs that define the type. Merging that type would result in an invalid empty enum type."),eF=a("SHAREABLE_HAS_MISMATCHED_RUNTIME_TYPES","A shareable field return type has mismatched possible runtime types in the subgraphs in which the field is declared. As shared fields must resolve the same way in all subgraphs, this is almost surely a mistake."),ek=a("SATISFIABILITY_ERROR","Subgraphs can be merged, but the resulting supergraph API would have queries that cannot be satisfied by those subgraphs."),eP=a("OVERRIDE_FROM_SELF_ERROR",'Field with `@override` directive has "from" location that references its own subgraph.'),ex=a("OVERRIDE_SOURCE_HAS_OVERRIDE","Field which is overridden to another subgraph is also marked @override."),eM=a("OVERRIDE_COLLISION_WITH_ANOTHER_DIRECTIVE","The @override directive cannot be used on external fields, nor to override fields with either @external, @provides, or @requires."),eU=a("OVERRIDE_ON_INTERFACE","The @override directive cannot be used on the fields of an interface type.",{addedIn:"2.3.0"}),e$=a("OVERRIDE_LABEL_INVALID","The @override directive `label` argument must match the pattern /^[a-zA-Z][a-zA-Z0-9_-:./]*$/ or /^percent((d{1,2}(.d{1,8})?|100))$/",{addedIn:"2.7.0"}),ej=a("UNSUPPORTED_FEATURE","Indicates an error due to feature currently unsupported by federation.",{addedIn:"2.1.0"}),eV=a("INVALID_FEDERATION_SUPERGRAPH","Indicates that a schema provided for an Apollo Federation supergraph is not a valid supergraph schema.",{addedIn:"2.1.0"}),eG=a("DOWNSTREAM_SERVICE_ERROR","Indicates an error in a subgraph service query during query execution in a federated service.",{addedIn:"0.x"}),eB=a("DIRECTIVE_COMPOSITION_ERROR","Error when composing custom directives.",{addedIn:"2.1.0"}),eK=a("INTERFACE_OBJECT_USAGE_ERROR","Error in the usage of the @interfaceObject directive.",{addedIn:"2.3.0"}),eQ=a("INTERFACE_KEY_NOT_ON_IMPLEMENTATION","A `@key` is defined on an interface type, but is not defined (or is not resolvable) on at least one of the interface implementations",{addedIn:"2.3.0"}),eq=a("INTERFACE_KEY_MISSING_IMPLEMENTATION_TYPE","A subgraph has a `@key` on an interface type, but that subgraph does not define an implementation (in the supergraph) of that interface",{addedIn:"2.3.0"}),eJ=a("CONTEXTUAL_ARGUMENT_NOT_CONTEXTUAL_IN_ALL_SUBGRAPHS","Argument on field is marked contextual in only some subgraphs",{addedIn:"2.7.0"}),eH=a("COST_APPLIED_TO_INTERFACE_FIELD","The `@cost` directive must be applied to concrete types",{addedIn:"2.9.2"}),eW=a("LIST_SIZE_APPLIED_TO_NON_LIST","The `@listSize` directive must be applied to list types",{addedIn:"2.9.2"}),eY=a("LIST_SIZE_INVALID_ASSUMED_SIZE","The `@listSize` directive assumed size cannot be negative",{addedIn:"2.9.2"}),ez=a("LIST_SIZE_INVALID_SLICING_ARGUMENT","The `@listSize` directive must have existing integer slicing arguments",{addedIn:"2.9.2"}),eX=a("LIST_SIZE_INVALID_SIZED_FIELD","The `@listSize` directive must reference existing list fields as sized fields",{addedIn:"2.9.2"}),eZ=a("MAX_VALIDATION_SUBGRAPH_PATHS_EXCEEDED","The maximum number of validation subgraph paths has been exceeded.",{addedIn:"2.8.0"}),e0=a("AUTH_REQUIREMENTS_APPLIED_ON_INTERFACE","The @authenticated, @requiresScopes and @policy directive cannot be applied on interface, interface fields and interface object",{addedIn:"2.9.4"}),e1=a("MISSING_TRANSITIVE_AUTH_REQUIREMENTS","Field missing transitive @authenticated, @requiresScopes and/or @policy auth requirements needed to access dependent data.",{addedIn:"2.9.4"});i.ERROR_CATEGORIES={DIRECTIVE_FIELDS_MISSING_EXTERNAL:E,DIRECTIVE_UNSUPPORTED_ON_INTERFACE:N,DIRECTIVE_INVALID_FIELDS_TYPE:P,DIRECTIVE_INVALID_FIELDS:$,FIELDS_HAS_ARGS:g,ROOT_TYPE_USED:K,DIRECTIVE_IN_FIELDS_ARG:O},i.ERRORS={INVALID_GRAPHQL:p,DIRECTIVE_DEFINITION_INVALID:h,TYPE_DEFINITION_INVALID:f,UNSUPPORTED_LINKED_FEATURE:m,UNKNOWN_FEDERATION_LINK_VERSION:y,UNKNOWN_LINK_VERSION:v,KEY_FIELDS_HAS_ARGS:T,PROVIDES_FIELDS_HAS_ARGS:S,PROVIDES_MISSING_EXTERNAL:I,REQUIRES_MISSING_EXTERNAL:b,KEY_UNSUPPORTED_ON_INTERFACE:_,PROVIDES_UNSUPPORTED_ON_INTERFACE:D,REQUIRES_UNSUPPORTED_ON_INTERFACE:A,EXTERNAL_UNUSED:C,EXTERNAL_COLLISION_WITH_ANOTHER_DIRECTIVE:er,TYPE_WITH_ONLY_UNUSED_EXTERNAL:F,PROVIDES_ON_NON_OBJECT_FIELD:k,KEY_INVALID_FIELDS_TYPE:x,PROVIDES_INVALID_FIELDS_TYPE:M,REQUIRES_INVALID_FIELDS_TYPE:U,KEY_INVALID_FIELDS:j,PROVIDES_INVALID_FIELDS:V,REQUIRES_INVALID_FIELDS:G,KEY_FIELDS_SELECT_INVALID_TYPE:B,ROOT_QUERY_USED:Q,ROOT_MUTATION_USED:q,ROOT_SUBSCRIPTION_USED:J,INVALID_SUBGRAPH_NAME:H,NO_QUERIES:W,INTERFACE_FIELD_NO_IMPLEM:Y,TYPE_KIND_MISMATCH:z,CONTEXT_NOT_SET:X,CONTEXT_INVALID_SELECTION:Z,NO_CONTEXT_IN_SELECTION:ee,CONTEXT_NO_RESOLVABLE_KEY:et,CONTEXT_NAME_INVALID:ei,EXTERNAL_TYPE_MISMATCH:en,EXTERNAL_ARGUMENT_MISSING:ea,EXTERNAL_ARGUMENT_TYPE_MISMATCH:es,EXTERNAL_ARGUMENT_DEFAULT_MISMATCH:eo,EXTERNAL_ON_INTERFACE:el,MERGED_DIRECTIVE_APPLICATION_ON_EXTERNAL:eu,FIELD_TYPE_MISMATCH:ec,ARGUMENT_TYPE_MISMATCH:ed,INPUT_FIELD_DEFAULT_MISMATCH:ep,ARGUMENT_DEFAULT_MISMATCH:eh,EXTENSION_WITH_NO_BASE:ef,EXTERNAL_MISSING_ON_BASE:em,INVALID_FIELD_SHARING:ey,INVALID_SHAREABLE_USAGE:ev,INVALID_LINK_DIRECTIVE_USAGE:eg,INVALID_LINK_IDENTIFIER:eT,LINK_IMPORT_NAME_MISMATCH:eS,REFERENCED_INACCESSIBLE:eE,DEFAULT_VALUE_USES_INACCESSIBLE:eI,QUERY_ROOT_TYPE_INACCESSIBLE:eb,REQUIRED_INACCESSIBLE:eN,DISALLOWED_INACCESSIBLE:eD,IMPLEMENTED_BY_INACCESSIBLE:e_,ONLY_INACCESSIBLE_CHILDREN:eA,REQUIRED_ARGUMENT_MISSING_IN_SOME_SUBGRAPH:eR,REQUIRED_INPUT_FIELD_MISSING_IN_SOME_SUBGRAPH:eO,EMPTY_MERGED_INPUT_TYPE:ew,ENUM_VALUE_MISMATCH:eL,EMPTY_MERGED_ENUM_TYPE:eC,SHAREABLE_HAS_MISMATCHED_RUNTIME_TYPES:eF,SATISFIABILITY_ERROR:ek,OVERRIDE_COLLISION_WITH_ANOTHER_DIRECTIVE:eM,OVERRIDE_FROM_SELF_ERROR:eP,OVERRIDE_SOURCE_HAS_OVERRIDE:ex,OVERRIDE_ON_INTERFACE:eU,OVERRIDE_LABEL_INVALID:e$,UNSUPPORTED_FEATURE:ej,INVALID_FEDERATION_SUPERGRAPH:eV,DOWNSTREAM_SERVICE_ERROR:eG,KEY_HAS_DIRECTIVE_IN_FIELDS_ARGS:R,PROVIDES_HAS_DIRECTIVE_IN_FIELDS_ARGS:w,REQUIRES_HAS_DIRECTIVE_IN_FIELDS_ARGS:L,DIRECTIVE_COMPOSITION_ERROR:eB,INTERFACE_OBJECT_USAGE_ERROR:eK,INTERFACE_KEY_NOT_ON_IMPLEMENTATION:eQ,INTERFACE_KEY_MISSING_IMPLEMENTATION_TYPE:eq,CONTEXTUAL_ARGUMENT_NOT_CONTEXTUAL_IN_ALL_SUBGRAPHS:eJ,COST_APPLIED_TO_INTERFACE_FIELD:eH,LIST_SIZE_APPLIED_TO_NON_LIST:eW,LIST_SIZE_INVALID_ASSUMED_SIZE:eY,LIST_SIZE_INVALID_SIZED_FIELD:eX,LIST_SIZE_INVALID_SLICING_ARGUMENT:ez,MAX_VALIDATION_SUBGRAPH_PATHS_EXCEEDED:eZ,AUTH_REQUIREMENTS_APPLIED_ON_INTERFACE:e0,MISSING_TRANSITIVE_AUTH_REQUIREMENTS:e1};let e2=Object.values(i.ERRORS).reduce((e,t)=>(e[t.code]=t,e),{});i.REMOVED_ERRORS=[["KEY_FIELDS_MISSING_ON_BASE","Keys can now use any field from any other subgraph."],["KEY_FIELDS_MISSING_EXTERNAL","Using `@external` for key fields is now discouraged, unless the field is truly meant to be external."],["KEY_MISSING_ON_BASE","Each subgraph is now free to declare a key only if it needs it."],["MULTIPLE_KEYS_ON_EXTENSION","Every subgraph can have multiple keys, as necessary."],["KEY_NOT_SPECIFIED","Each subgraph can declare key independently of any other subgraph."],["EXTERNAL_USED_ON_BASE","As there is not type ownership anymore, there is also no particular limitation as to where a field can be external."],["PROVIDES_NOT_ON_ENTITY","@provides can now be used on any type."],["REQUIRES_FIELDS_MISSING_ON_BASE","Fields in @requires can now be from any subgraph."],["REQUIRES_USED_ON_BASE","As there is not type ownership anymore, there is also no particular limitation as to which subgraph can use a @requires."],["DUPLICATE_SCALAR_DEFINITION","As duplicate scalar definitions is invalid GraphQL, this will now be an error with code `INVALID_GRAPHQL`."],["DUPLICATE_ENUM_DEFINITION","As duplicate enum definitions is invalid GraphQL, this will now be an error with code `INVALID_GRAPHQL`."],["DUPLICATE_ENUM_VALUE","As duplicate enum values is invalid GraphQL, this will now be an error with code `INVALID_GRAPHQL`."],["ENUM_MISMATCH","Subgraph definitions for an enum are now merged by composition."],["VALUE_TYPE_NO_ENTITY","There is no strong different between entity and value types in the model (they are just usage pattern) and a type can have keys in one subgraph but not another."],["VALUE_TYPE_UNION_TYPES_MISMATCH","Subgraph definitions for an union are now merged by composition."],["PROVIDES_FIELDS_SELECT_INVALID_TYPE","@provides can now be used on field of interface, union and list types."],["RESERVED_FIELD_USED","This error was previously not correctly enforced: the _service and _entities, if present, were overridden; this is still the case."],["NON_REPEATABLE_DIRECTIVE_ARGUMENTS_MISMATCH","Since federation 2.1.0, the case this error used to cover is now a warning (with code `INCONSISTENT_NON_REPEATABLE_DIRECTIVE_ARGUMENTS`) instead of an error."],["REQUIRES_FIELDS_HAS_ARGS","Since federation 2.1.1, using fields with arguments in a @requires is fully supported."],["INTERFACE_FIELD_IMPLEM_TYPE_MISMATCH","This error was thrown by a validation introduced to avoid running into a known runtime bug. Since federation 2.3, the underlying runtime bug has been addressed and the validation/limitation was no longer necessary and has been removed."]]},990620,(e,t,i)=>{"use strict";t.exports=function(){function e(e,t,i,n,r){return e<t||i<t?e>i?i+1:e+1:n===r?t:t+1}return function(t,i){if(t===i)return 0;if(t.length>i.length){var n,r,a,s,o,l,u,c,d,p,h,f,m=t;t=i,i=m}for(var y=t.length,v=i.length;y>0&&t.charCodeAt(y-1)===i.charCodeAt(v-1);)y--,v--;for(var g=0;g<y&&t.charCodeAt(g)===i.charCodeAt(g);)g++;if(y-=g,v-=g,0===y||v<3)return v;var T=0,S=[];for(n=0;n<y;n++)S.push(n+1),S.push(t.charCodeAt(g+n));for(var E=S.length-1;T<v-3;)for(n=0,d=i.charCodeAt(g+(r=T)),p=i.charCodeAt(g+(a=T+1)),h=i.charCodeAt(g+(s=T+2)),f=i.charCodeAt(g+(o=T+3)),l=T+=4;n<E;n+=2)r=e(u=S[n],r,a,d,c=S[n+1]),a=e(r,a,s,p,c),s=e(a,s,o,h,c),l=e(s,o,l,f,c),S[n]=l,o=s,s=a,a=r,r=u;for(;T<v;)for(n=0,d=i.charCodeAt(g+(r=T)),l=++T;n<E;n+=2)u=S[n],S[n]=l=e(u,r,l,d,S[n+1]),r=u;return l}}()},308126,(e,t,i)=>{"use strict";var n=e.e&&e.e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(i,"__esModule",{value:!0}),i.didYouMean=i.suggestionList=void 0;let r=n(e.r(990620)),a=e.r(331484);i.suggestionList=function(e,t){let i=new Map,n=Math.floor(.4*e.length)+1,s=e.toLowerCase();for(let a of t){let t=s===a.toLowerCase()?1:(0,r.default)(e,a);t<=n&&i.set(a,t)}return(0,a.mapKeys)(i).sort((e,t)=>{let n=i.get(e)-i.get(t);return 0!==n?n:e.localeCompare(t)})},i.didYouMean=function(e){let t=" Did you mean ",i=e.map(e=>`"${e}"`);switch(e.length){case 0:return"";case 1:return t+i[0]+"?";case 2:return t+i[0]+" or "+i[1]+"?"}let n=i.slice(0,5),r=n.pop();return t+n.join(", ")+", or "+r+"?"}},367356,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.collectVariablesInValue=i.argumentsFromAST=i.isValidLeafValue=i.valueFromASTUntyped=i.valueFromAST=i.isValidValueApplication=i.isValidValue=i.valueToAST=i.valueNodeToConstValueNode=i.withDefaultValues=i.argumentsEquals=i.valueEquals=i.valueToString=void 0;let n=e.r(168032),r=e.r(186846),a=e.r(308126),s=e.r(224361),o=e.r(678270),l=e.r(331484),u=e.r(408470);function c(e,t){if(null==e)return"null";if(t&&(0,n.isNonNullType)(t))return c(e,t.ofType);if(t&&(0,n.isCustomScalarType)(t)&&(t=void 0),(0,n.isVariable)(e))return e.toString();if(Array.isArray(e)){let i;return t&&(0,n.isListType)(t)&&(i=t.ofType),"["+e.map(e=>c(e,i)).join(", ")+"]"}if(t&&(0,n.isListType)(t))return c(e,t.ofType);if("object"==typeof e)return t&&!(0,n.isInputObjectType)(t)&&(t=void 0),"{"+Object.keys(e).map(i=>{var n;let r=t?null==(n=t.field(i))?void 0:n.type:void 0;return`${i}: ${c(e[i],r)}`}).join(", ")+"}";if("string"==typeof e){if(t){if((0,n.isEnumType)(t))return t.value(e)?e:JSON.stringify(e);if(t===t.schema().idType()&&m.test(e))return e}return JSON.stringify(e)}return String(e)}function d(e,t){return e===t||(Array.isArray(e)?Array.isArray(t)&&function(e,t){if(e.length!==t.length)return!1;for(let i=0;i<e.length;++i)if(!d(e[i],t[i]))return!1;return!0}(e,t):null!==e&&"object"==typeof e?null!==t&&"object"==typeof t&&p(e,t):e===t)}function p(e,t){let i=Object.keys(e),n=Object.keys(t);if(i.length!=n.length)return!1;for(let r of i){let i=e[r],a=t[r];if(void 0===a&&!n.includes(r)||!d(i,a))return!1}return!0}function h(e){return Error(e)}function f(e,t){if((0,n.isVariable)(e))return e;if(null===e){if((0,n.isNonNullType)(t))throw u.ERRORS.INVALID_GRAPHQL.err(`Invalid null value for non-null type ${t} while computing default values`);return null}if((0,n.isNonNullType)(t))return f(e,t.ofType);if((0,n.isListType)(t))if(Array.isArray(e))return e.map(e=>f(e,t.ofType));else return f(e,t.ofType);if((0,n.isInputObjectType)(t)){if("object"!=typeof e)throw u.ERRORS.INVALID_GRAPHQL.err(`Expected value for type ${t} to be an object, but is ${typeof e}.`);let i=Object.create(null);for(let r of t.fields()){if(!r.type)throw h(`Cannot compute default value for field ${r.name} of ${t} as the field type is undefined`);let a=e[r.name];if(void 0===a)if(void 0!==r.defaultValue)i[r.name]=f(r.defaultValue,r.type);else if((0,n.isNonNullType)(r.type))throw u.ERRORS.INVALID_GRAPHQL.err(`Required field "${r.name}" of type ${t} was not provided.`);else i[r.name]=null;else i[r.name]=f(a,r.type)}for(let i of Object.keys(e))if(!t.field(i)){let e=(0,a.suggestionList)(i,t.fields().map(e=>e.name));throw u.ERRORS.INVALID_GRAPHQL.err(`Field "${i}" is not defined by type "${t}".`+(0,a.didYouMean)(e))}return i}return e}i.valueToString=c,i.valueEquals=d,i.argumentsEquals=function(e,t){return e===t||p(e,t)},i.withDefaultValues=function(e,t){if(!t.type)throw h(`Cannot compute default value for argument ${t} as the type is undefined`);if(void 0===e)if(void 0!==t.defaultValue)return f(t.defaultValue,t.type);else if(!(0,n.isNonNullType)(t.type))return null;else throw u.ERRORS.INVALID_GRAPHQL.err(`Required argument "${t.coordinate}" was not provided.`);return f(e,t.type)};let m=/^-?(?:0|[1-9][0-9]*)$/;function y(e,t){return(0,n.isNonNullType)(t)?!!(0,n.isNonNullType)(e)&&y(e.ofType,t.ofType):(0,n.isNonNullType)(e)?y(e.ofType,t):(0,n.isListType)(t)?!!(0,n.isListType)(e)&&y(e.ofType,t.ofType):!(0,n.isListType)(e)&&(0,o.sameType)(e,t)}function v(e,t,i,r){if((0,n.isVariable)(e)){var a,s,o;let l,u=r.definition(e);return!!u&&(a=u,s=t,o=i,l=a.type,(0,n.isNonNullType)(s)&&!(0,n.isNonNullType)(l)?(void 0!==a.defaultValue&&null!==a.defaultValue||void 0!==o)&&y(l,s.ofType):y(l,s))}if((0,n.isNonNullType)(t))return null!==e&&v(e,t.ofType,void 0,r);if(null==e)return!0;if((0,n.isListType)(t)){let n=t.ofType;return Array.isArray(e)?e.every(e=>v(e,n,void 0,r)):v(e,n,i,r)}if((0,n.isInputObjectType)(t)){if("object"!=typeof e)return!1;let i=new Set(Object.keys(e)),n=t.fields().every(t=>(i.delete(t.name),v(e[t.name],t.type,t.defaultValue,r))),a=0!==i.size;return n&&!a}return S(t.schema(),e,t)}function g(e,t){if(e.kind===r.Kind.NULL){if((0,n.isNonNullType)(t))throw u.ERRORS.INVALID_GRAPHQL.err(`Invalid null value for non-null type "${t}"`);return null}if(e.kind===r.Kind.VARIABLE)return new n.Variable(e.name.value);if((0,n.isNonNullType)(t)&&(t=t.ofType),(0,n.isListType)(t)){let i=t.ofType;return e.kind===r.Kind.LIST?e.values.map(e=>g(e,i)):[g(e,i)]}if((0,n.isIntType)(t)){if(e.kind!==r.Kind.INT)throw u.ERRORS.INVALID_GRAPHQL.err(`Int cannot represent non-integer value ${(0,r.print)(e)}.`);let t=parseInt(e.value,10);if(t>0x7fffffff||t<-0x80000000)throw u.ERRORS.INVALID_GRAPHQL.err(`Int cannot represent non 32-bit signed integer value ${t}.`);return t}if((0,n.isFloatType)(t)){let t;if(e.kind===r.Kind.INT)t=parseInt(e.value,10);else if(e.kind===r.Kind.FLOAT)t=parseFloat(e.value);else throw u.ERRORS.INVALID_GRAPHQL.err(`Float can only represent integer or float value, but got a ${e.kind}.`);if(!isFinite(t))throw u.ERRORS.INVALID_GRAPHQL.err(`Float cannot represent non numeric value ${t}.`);return t}if((0,n.isBooleanType)(t)){if(e.kind!==r.Kind.BOOLEAN)throw u.ERRORS.INVALID_GRAPHQL.err(`Boolean cannot represent a non boolean value ${(0,r.print)(e)}.`);return e.value}if((0,n.isStringType)(t)){if(e.kind!==r.Kind.STRING)throw u.ERRORS.INVALID_GRAPHQL.err(`String cannot represent non string value ${(0,r.print)(e)}.`);return e.value}if((0,n.isIDType)(t)){if(e.kind!==r.Kind.STRING&&e.kind!==r.Kind.INT)throw u.ERRORS.INVALID_GRAPHQL.err(`ID cannot represent value ${(0,r.print)(e)}.`);return e.value}if((0,n.isScalarType)(t))return T(e);if((0,n.isInputObjectType)(t)){if(e.kind!==r.Kind.OBJECT)throw u.ERRORS.INVALID_GRAPHQL.err(`Input Object Type ${t} cannot represent non-object value ${(0,r.print)(e)}.`);let i=Object.create(null);for(let n of e.fields){let e=n.name.value,r=t.field(e);if(!r)throw u.ERRORS.INVALID_GRAPHQL.err(`Unknown field "${e}" found in value for Input Object Type "${t}".`);i[e]=g(n.value,r.type)}return i}if((0,n.isEnumType)(t)){if(e.kind!==r.Kind.STRING&&e.kind!==r.Kind.ENUM)throw u.ERRORS.INVALID_GRAPHQL.err(`Enum Type ${t} cannot represent value ${(0,r.print)(e)}.`);if(!t.value(e.value))throw u.ERRORS.INVALID_GRAPHQL.err(`Enum Type ${t} has no value ${e.value}.`);return e.value}(0,l.assert)(!1,()=>`Unexpected input type ${t} of kind ${t.kind}.`)}function T(e){switch(e.kind){case r.Kind.NULL:return null;case r.Kind.INT:return parseInt(e.value,10);case r.Kind.FLOAT:return parseFloat(e.value);case r.Kind.STRING:case r.Kind.ENUM:case r.Kind.BOOLEAN:return e.value;case r.Kind.LIST:return e.values.map(T);case r.Kind.OBJECT:let t=Object.create(null);return e.fields.forEach(e=>t[e.name.value]=T(e.value)),t;case r.Kind.VARIABLE:return new n.Variable(e.name.value)}}function S(e,t,i){if((0,n.isCustomScalarType)(i))return!0;if("boolean"==typeof t)return i===e.booleanType();if("number"==typeof t&&isFinite(t)){let n=String(t);return i===e.intType()||i===e.idType()?m.test(n):i===e.floatType()}return"string"==typeof t&&((0,n.isEnumType)(i)?void 0!==i.value(t):i!==e.booleanType()&&i!==e.intType()&&i!==e.floatType())}i.valueNodeToConstValueNode=function e(t){if(t.kind===r.Kind.NULL||t.kind===r.Kind.INT||t.kind===r.Kind.FLOAT||t.kind===r.Kind.STRING||t.kind===r.Kind.BOOLEAN||t.kind===r.Kind.ENUM)return t;if(t.kind===r.Kind.LIST){let i=t.values.map(t=>e(t));return{...t,values:i}}if(t.kind===r.Kind.OBJECT){let i=t.fields.map(t=>({...t,value:e(t.value)}));return{...t,fields:i}}if(t.kind===r.Kind.VARIABLE)throw Error("Unexpected VariableNode in const AST");(0,l.assertUnreachable)(t)},i.valueToAST=function e(t,i){if(void 0!==t){if((0,n.isNonNullType)(i)){let n=e(t,i.ofType);if((null==n?void 0:n.kind)===r.Kind.NULL)throw h(`Invalid null value ${c(t)} for non-null type ${i}`);return n}if(null===t)return{kind:r.Kind.NULL};if((0,n.isVariable)(t))return{kind:r.Kind.VARIABLE,name:{kind:r.Kind.NAME,value:t.name}};if((0,n.isCustomScalarType)(i))return function e(t){if(void 0!==t){if(null===t)return{kind:r.Kind.NULL};if((0,n.isVariable)(t))return{kind:r.Kind.VARIABLE,name:{kind:r.Kind.NAME,value:t.name}};if(Array.isArray(t)){let i=[];for(let n of t){let t=e(n);void 0!==t&&i.push(t)}return{kind:r.Kind.LIST,values:i}}if("object"==typeof t){let i=[];for(let n of Object.keys(t)){let a=e(t[n]);a&&i.push({kind:r.Kind.OBJECT_FIELD,name:{kind:r.Kind.NAME,value:n},value:a})}return{kind:r.Kind.OBJECT,fields:i}}if("boolean"==typeof t)return{kind:r.Kind.BOOLEAN,value:t};if("number"==typeof t&&isFinite(t)){let e=String(t);return m.test(e)?{kind:r.Kind.INT,value:e}:{kind:r.Kind.FLOAT,value:e}}if("string"==typeof t)return{kind:r.Kind.STRING,value:t};throw h(`Invalid value, cannot be converted to AST: ${(0,s.inspect)(t,!0,10,!0)}`)}}(t);if((0,n.isListType)(i)){let n=i.ofType,a=Array.from(t);if(null!=a){let t=[];for(let i of a){let r=e(i,n);null!=r&&t.push(r)}return{kind:r.Kind.LIST,values:t}}return e(t,n)}if((0,n.isInputObjectType)(i)){if("object"!=typeof t)throw h(`Invalid non-objet value for input type ${i}, cannot be converted to AST: ${(0,s.inspect)(t,!0,10,!0)}`);let n=[];for(let a of i.fields()){if(!a.type)throw h(`Cannot convert value ${c(t)} as field ${a} has no type set`);let i=e(t[a.name],a.type);i&&n.push({kind:r.Kind.OBJECT_FIELD,name:{kind:r.Kind.NAME,value:a.name},value:i})}return{kind:r.Kind.OBJECT,fields:n}}if("boolean"==typeof t)return{kind:r.Kind.BOOLEAN,value:t};if("number"==typeof t&&isFinite(t)){let e=String(t);return m.test(e)?{kind:r.Kind.INT,value:e}:{kind:r.Kind.FLOAT,value:e}}if("string"==typeof t)return(0,n.isEnumType)(i)?{kind:r.Kind.ENUM,value:t}:i===i.schema().idType()&&m.test(t)?{kind:r.Kind.INT,value:t}:{kind:r.Kind.STRING,value:t};throw h(`Invalid value for type ${i}, cannot be converted to AST: ${(0,s.inspect)(t)}`)}},i.isValidValue=function(e,t,i){return v(e,t.type,t.defaultValue,i)},i.isValidValueApplication=v,i.valueFromAST=g,i.valueFromASTUntyped=T,i.isValidLeafValue=S,i.argumentsFromAST=function(e,t,i){var n;if(!t||0===t.length)return;let a=Object.create(null);for(let s of t){let t=s.name.value,o=null==(n=i.argument(t))?void 0:n.type;if(!o)throw u.ERRORS.INVALID_GRAPHQL.err(`Unknown argument "${t}" found in value: "${e}" has no argument named "${t}"`);try{a[t]=g(s.value,o)}catch(e){if(e instanceof r.GraphQLError)throw u.ERRORS.INVALID_GRAPHQL.err(`Invalid value for argument "${t}": ${e.message}`);throw e}}return a},i.collectVariablesInValue=function e(t,i){(0,n.isVariable)(t)?i.add(t):t&&(Array.isArray(t)&&t.forEach(t=>e(t,i)),"object"==typeof t&&Object.keys(t).forEach(n=>e(t[n],i)))}},319894,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.unregisterKnownFeatures=i.coreFeatureDefinitionIfKnown=i.registerKnownFeature=void 0;let n=new Map;i.registerKnownFeature=function(e){n.has(e.identity)||n.set(e.identity,e)},i.coreFeatureDefinitionIfKnown=function(e){var t;return null==(t=n.get(e.identity))?void 0:t.find(e.version)},i.unregisterKnownFeatures=function(e){n.delete(e.identity)}},343924,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.ensureSameTypeKind=i.createEnumTypeSpecification=i.createUnionTypeSpecification=i.createObjectTypeSpecification=i.createScalarTypeSpecification=i.createDirectiveSpecification=void 0;let n=e.r(186846),r=e.r(168032),a=e.r(408470),s=e.r(367356),o=e.r(678270),l=e.r(331484);function u(e,t){return e===t.kind?[]:[a.ERRORS.TYPE_DEFINITION_INVALID.err(`Invalid definition for type ${t.name}: ${t.name} should be a ${e} but is defined as a ${t.kind}`,{nodes:t.sourceAST})]}function c(e,t,i,n){var l;let u=null!=(l=e.args)?l:[],c=[];for(let{name:e,type:l,defaultValue:d}of u){let u=t.argument(e);if(!u){(0,r.isNonNullType)(l)&&void 0===d&&c.push(a.ERRORS.DIRECTIVE_DEFINITION_INVALID.err(`Invalid definition for ${i}: missing required argument "${e}"`,{nodes:n}));continue}let p=u.type;(0,r.isNonNullType)(p)&&!(0,r.isNonNullType)(l)&&(p=p.ofType),(0,o.sameType)(l,p)||function e(t,i){return(0,r.isListType)(t)?(0,r.isListType)(i)&&e(t.ofType,i.ofType):(0,r.isNonNullType)(t)?(0,r.isNonNullType)(i)&&e(t.ofType,i.ofType):(0,r.isCustomScalarType)(t)&&!(0,r.isCustomScalarType)(i)}(l,p)?(0,r.isNonNullType)(u.type)||(0,s.valueEquals)(d,u.defaultValue)||c.push(a.ERRORS.DIRECTIVE_DEFINITION_INVALID.err(`Invalid definition for ${i}: argument "${e}" should have default value ${(0,s.valueToString)(d)} but found default value ${(0,s.valueToString)(u.defaultValue)}`,{nodes:u.sourceAST})):c.push(a.ERRORS.DIRECTIVE_DEFINITION_INVALID.err(`Invalid definition for ${i}: argument "${e}" should have type "${l}" but found type "${u.type}"`,{nodes:u.sourceAST}))}for(let e of t.arguments())u.some(t=>t.name===e.name)||c.push(a.ERRORS.DIRECTIVE_DEFINITION_INVALID.err(`Invalid definition for ${i}: unknown/unsupported argument "${e.name}"`,{nodes:e.sourceAST}));return c}i.createDirectiveSpecification=function({name:e,locations:t,repeatable:i=!1,args:s=[],composes:o=!1,supergraphSpecification:u,useJoinDirective:d=!1,staticArgumentTransform:p}){let h;if(o){let t;(0,l.assert)(u,`Should provide a @link specification to use in supergraph for directive @${e} if it composes`);let r=new Map(s.filter(e=>e.compositionStrategy).map(e=>[e.name,e.compositionStrategy]));r.size>0&&((0,l.assert)(!i,()=>`Invalid directive specification for @${e}: @${e} is repeatable and should not define composition strategy for its arguments`),(0,l.assert)(r.size===s.length,()=>`Invalid directive specification for @${e}: not all arguments define a composition strategy`),t=(t,i)=>{for(let{name:a,type:o}of s){let s=r.get(a);(0,l.assert)(s,()=>`Should have a strategy for ${a}`);let u=o(t,i);(0,l.assert)(!Array.isArray(u),()=>`Should have gotten error getting type for @${e}(${a}:), but got ${u}`);let{valid:c,supportedMsg:d}=s.isTypeSupported(t,u);if(!c)return new n.GraphQLError(`Invalid composition strategy ${s.name} for argument @${e}(${a}:) of type ${u}; ${s.name} only supports ${d}`)}return{merge:(e,t)=>{let i=r.get(e);return(0,l.assert)(i,()=>`Should have a strategy for ${e}`),i.mergeValues(t)},toString:()=>0===r.size?"<none>":"{ "+[...r.entries()].map(([e,t])=>`"${e}": ${t.name}`).join(", ")+" }"}}),h={supergraphSpecification:u,useJoinDirective:null!=d&&d,argumentsMerger:t,staticArgumentTransform:p}}return{name:e,composition:h,checkOrAdd:(n,o,l)=>{var u,d,p;let h=null!=(u=null==o?void 0:o.directiveNameInSchema(e))?u:e,{resolvedArgs:f,errors:m}=s.reduce(({resolvedArgs:e,errors:t},i)=>{let r=i.type(n,o);return Array.isArray(r)?t.push(...r):e.push({...i,type:r}),{resolvedArgs:e,errors:t}},{resolvedArgs:[],errors:[]});if(m.length>0)return m;let y=n.directive(h);if(y){let e,n;return d={name:h,locations:t,repeatable:i,args:f},p=y,e=`"@${d.name}"`,n=c(d,p,`directive ${e}`),!d.repeatable&&p.repeatable&&(n=n.concat(a.ERRORS.DIRECTIVE_DEFINITION_INVALID.err(`Invalid definition for directive ${e}: ${e} should${d.repeatable?"":" not"} be repeatable`,{nodes:p.sourceAST}))),p.locations.every(e=>d.locations.includes(e))||(n=n.concat(a.ERRORS.DIRECTIVE_DEFINITION_INVALID.err(`Invalid definition for directive ${e}: ${e} should have locations ${d.locations.join(", ")}, but found (non-subset) ${p.locations.join(", ")}`,{nodes:p.sourceAST}))),n}{let e=n.addDirectiveDefinition(new r.DirectiveDefinition(h,l));for(let{name:n,type:r,defaultValue:a}of(e.repeatable=i,e.addLocations(...t),f))e.addArgument(n,r,a);return[]}}}},i.createScalarTypeSpecification=function({name:e}){return{name:e,checkOrAdd:(t,i,n)=>{var a;let s=null!=(a=null==i?void 0:i.typeNameInSchema(e))?a:e,o=t.type(s);return o?u("ScalarType",o):(t.addType(new r.ScalarType(s,n)),[])}}},i.createObjectTypeSpecification=function({name:e,fieldsFct:t}){return{name:e,checkOrAdd:(i,n,s)=>{var d;let p=null!=(d=null==n?void 0:n.typeNameInSchema(e))?d:e,h=t(i),f=i.type(p);if(f){let e=u("ObjectType",f);if(e.length>0)return e;for(let{name:t,type:i,args:n}of((0,l.assert)((0,r.isObjectType)(f),"Should be an object type"),h)){let s=f.field(t);if(!s){e=e.concat(a.ERRORS.TYPE_DEFINITION_INVALID.err(`Invalid definition of type ${t}: missing field ${t}`,{nodes:f.sourceAST}));continue}let l=s.type;!(0,r.isNonNullType)(i)&&(0,r.isNonNullType)(l)&&(l=l.ofType),(0,o.sameType)(i,l)||(e=e.concat(a.ERRORS.TYPE_DEFINITION_INVALID.err(`Invalid definition for field ${t} of type ${t}: should have type ${i} but found type ${s.type}`,{nodes:s.sourceAST}))),e=e.concat(c({name:t,args:n},s,`field "${s.coordinate}"`))}return e}{let e=i.addType(new r.ObjectType(p,s));for(let{name:t,type:i,args:n}of h){let r=e.addField(t,i);for(let{name:e,type:t,defaultValue:i}of null!=n?n:[])r.addArgument(e,t,i)}return[]}}}},i.createUnionTypeSpecification=function({name:e,membersFct:t}){return{name:e,checkOrAdd:(i,n,s)=>{var o;let c=null!=(o=null==n?void 0:n.typeNameInSchema(e))?o:e,d=i.type(c),p=t(i).sort((e,t)=>e.localeCompare(t));if(0===p.length)return d?[a.ERRORS.TYPE_DEFINITION_INVALID.err(`Invalid definition of type ${e}: expected the union type to not exist/have no members but it is defined.`,{nodes:d.sourceAST})]:[];if(d){let t=u("UnionType",d);if(t.length>0)return t;(0,l.assert)((0,r.isUnionType)(d),"Should be an union type");let i=d.members().map(e=>e.type.name).sort((e,t)=>e.localeCompare(t));return(0,l.arrayEquals)(p,i)||(t=t.concat(a.ERRORS.TYPE_DEFINITION_INVALID.err(`Invalid definition of type ${e}: expected members [${p}] but found [${i}].`,{nodes:d.sourceAST}))),t}{let e=i.addType(new r.UnionType(c,s));for(let t of p)e.addType(t);return[]}}}},i.createEnumTypeSpecification=function({name:e,values:t}){return{name:e,checkOrAdd:(i,n,s)=>{var o;let c=null!=(o=null==n?void 0:n.typeNameInSchema(e))?o:e,d=i.type(c),p=t.map(e=>e.name).sort((e,t)=>e.localeCompare(t));if(d){let t=u("EnumType",d);if(t.length>0)return t;(0,l.assert)((0,r.isEnumType)(d),"Should be an enum type");let i=d.values.map(e=>e.name).sort((e,t)=>e.localeCompare(t));return(0,l.arrayEquals)(p,i)||(t=t.concat(a.ERRORS.TYPE_DEFINITION_INVALID.err(`Invalid definition for type "${e}": expected values [${p.join(", ")}] but found [${i.join(", ")}].`,{nodes:d.sourceAST}))),t}{let e=i.addType(new r.EnumType(c,s));for(let{name:i,description:n}of t)e.addValue(i).description=n;return[]}}}},i.ensureSameTypeKind=u},785576,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.removeAllCoreFeatures=i.LINK_VERSIONS=i.CORE_VERSIONS=i.findCoreSpecVersion=i.FeatureUrl=i.FeatureVersion=i.FeatureDefinitions=i.CoreSpecDefinition=i.isCoreSpecDirectiveApplication=i.extractCoreFeatureImports=i.FeatureDefinition=i.corePurposes=i.ErrCoreCheckFailed=i.linkDirectiveDefaultName=i.linkIdentity=i.coreIdentity=void 0;let n=e.r(186846),r=e.r(792509),a=e.r(168032),s=e.r(678270),o=e.r(331484),l=e.r(408470),u=e.r(367356),c=e.r(319894),d=e.r(308126),p=e.r(343924);function h(e){return Error(e)}i.coreIdentity="https://specs.apollo.dev/core",i.linkIdentity="https://specs.apollo.dev/link",i.linkDirectiveDefaultName="link",i.ErrCoreCheckFailed=e=>(0,l.aggregateError)("CheckFailed","one or more checks failed",e),i.corePurposes=["SECURITY","EXECUTION"];class f{constructor(e,t){this.minimumFederationVersion=t,this._directiveSpecs=new o.MapWithCachedArrays,this._typeSpecs=new o.MapWithCachedArrays,this.url="string"==typeof e?I.parse(e):e}registerDirective(e){this._directiveSpecs.set(e.name,e)}registerType(e){this._typeSpecs.set(e.name,e)}registerSubFeature(e){for(let t of e.typeSpecs())this.registerType(t);for(let t of e.directiveSpecs())this.registerDirective(t)}directiveSpecs(){return this._directiveSpecs.values()}directiveSpec(e){return this._directiveSpecs.get(e)}typeSpecs(){return this._typeSpecs.values()}typeSpec(e){return this._typeSpecs.get(e)}get identity(){return this.url.identity}get version(){return this.url.version}isSpecType(e){let t=this.nameInSchema(e.schema());return void 0!==t&&e.name.startsWith(`${t}__`)}isSpecDirective(e){let t=this.nameInSchema(e.schema());return void 0!=t&&(e.name===t||e.name.startsWith(`${t}__`))}addElementsToSchema(e){let t=this.featureInSchema(e);(0,o.assert)(t,()=>`The ${this.url} specification should have been added to the schema before this is called`);let i=[];for(let n of this.typeSpecs())i=i.concat(n.checkOrAdd(e,t));for(let n of this.directiveSpecs())i=i.concat(n.checkOrAdd(e,t));return i}allElementNames(){return this.directiveSpecs().map(e=>`@${e.name}`).concat(this.typeSpecs().map(e=>e.name))}nameInSchema(e){let t=this.featureInSchema(e);return null==t?void 0:t.nameInSchema}directiveNameInSchema(e,t){let i=this.featureInSchema(e);return i?i.directiveNameInSchema(t):void 0}typeNameInSchema(e,t){let i=this.featureInSchema(e);return i?i.typeNameInSchema(t):void 0}rootDirective(e){let t=this.nameInSchema(e);return t?e.directive(t):void 0}directive(e,t){let i=this.directiveNameInSchema(e,t);return i?e.directive(i):void 0}type(e,t){let i=this.typeNameInSchema(e,t);return i?e.type(i):void 0}addRootDirective(e){return e.addDirectiveDefinition(this.nameInSchema(e))}addDirective(e,t){return e.addDirectiveDefinition(this.directiveNameInSchema(e,t))}addScalarType(e,t){return e.addType(new a.ScalarType(this.typeNameInSchema(e,t)))}addEnumType(e,t){return e.addType(new a.EnumType(this.typeNameInSchema(e,t)))}featureInSchema(e){let t=e.coreFeatures;if(!t)throw h("Schema is not a core schema (add @link first)");return t.getByIdentity(this.identity)}get defaultCorePurpose(){}compositionSpecification(e){let t=this._directiveSpecs.get(e);return null==t?void 0:t.composition}toString(){return`${this.identity}/${this.version}`}}i.FeatureDefinition=f;let m=/^@?[_A-Za-z][_0-9A-Za-z]*$/;function y(e,t,i,n){if(t&&!t.includes(e)){let r="";if(!e.startsWith("@")&&t.includes("@"+e))r=` Did you mean directive "@${e}"?`;else{let i=(0,d.suggestionList)(e,t);i&&(r=(0,d.didYouMean)(i))}i.push(l.ERRORS.INVALID_LINK_DIRECTIVE_USAGE.err(`Cannot import unknown element "${e}".${r}`,{nodes:n.sourceAST}))}}i.extractCoreFeatureImports=function(e,t){let i=t.arguments();if(!("import"in i)||!i.import)return[];let n=i.import,r=(0,c.coreFeatureDefinitionIfKnown)(e),s=null==r?void 0:r.allElementNames(),o=[],d=[];e:for(let e of n){let i;if("string"==typeof e){d.push({name:e}),y(e,s,o,t);continue}if("object"!=typeof e){o.push(l.ERRORS.INVALID_LINK_DIRECTIVE_USAGE.err(`Invalid sub-value ${(0,u.valueToString)(e)} for @link(import:) argument: values should be either strings or input object values of the form { name: "<importedElement>", as: "<alias>" }.`,{nodes:t.sourceAST}));continue}for(let[n,r]of Object.entries(e))switch(n){case"name":if("string"!=typeof r){o.push(l.ERRORS.INVALID_LINK_DIRECTIVE_USAGE.err(`Invalid value for the "name" field for sub-value ${(0,u.valueToString)(e)} of @link(import:) argument: must be a string.`,{nodes:t.sourceAST}));continue e}if(!m.test(r)){o.push(l.ERRORS.INVALID_LINK_DIRECTIVE_USAGE.err(`Invalid value for the "name" field for sub-value ${(0,u.valueToString)(e)} of @link(import:) argument: must use a GraphQL name.`,{nodes:t.sourceAST}));continue e}i=r;break;case"as":if("string"!=typeof r){o.push(l.ERRORS.INVALID_LINK_DIRECTIVE_USAGE.err(`Invalid value for the "as" field for sub-value ${(0,u.valueToString)(e)} of @link(import:) argument: must be a string.`,{nodes:t.sourceAST}));continue e}if(!m.test(r)){o.push(l.ERRORS.INVALID_LINK_DIRECTIVE_USAGE.err(`Invalid value for the "as" field for sub-value ${(0,u.valueToString)(e)} of @link(import:) argument: must use a GraphQL name.`,{nodes:t.sourceAST}));continue e}break;default:o.push(l.ERRORS.INVALID_LINK_DIRECTIVE_USAGE.err(`Unknown field "${n}" for sub-value ${(0,u.valueToString)(e)} of @link(import:) argument.`,{nodes:t.sourceAST}));continue e}i?(d.push(e),e.as&&("@"===e.name.charAt(0)&&"@"!==e.as.charAt(0)?o.push(l.ERRORS.INVALID_LINK_DIRECTIVE_USAGE.err(`Invalid @link import renaming: directive "${e.name}" imported name should start with a '@' character, but got "${e.as}".`,{nodes:t.sourceAST})):"@"!==e.name.charAt(0)&&"@"===e.as.charAt(0)&&o.push(l.ERRORS.INVALID_LINK_DIRECTIVE_USAGE.err(`Invalid @link import renaming: type "${e.name}" imported name should not start with a '@' character, but got "${e.as}" (or, if @${e.name} is a directive, then it should be referred to with a '@').`,{nodes:t.sourceAST}))),y(i,s,o,t)):o.push(l.ERRORS.INVALID_LINK_DIRECTIVE_USAGE.err(`Invalid sub-value ${(0,u.valueToString)(e)} for @link(import:) argument: missing mandatory "name" field.`,{nodes:t.sourceAST}))}if(o.length>0)throw(0,a.ErrGraphQLValidationFailed)(o);return d},i.isCoreSpecDirectiveApplication=function(e){var t,r,o,l,u;let c=e.definition;if(!c)return!1;let d=c.argument("as");if(d&&!(0,s.sameType)(d.type,e.schema().stringType())||!c.repeatable||1!==c.locations.length||c.locations[0]!==n.DirectiveLocation.SCHEMA)return!1;let p=null!=(t=c.argument("url"))?t:c.argument("feature");if(!p||(l=p.type,u=e.schema(),!((0,s.sameType)(l,u.stringType())||(0,s.sameType)(l,new a.NonNullType(u.stringType())))))return!1;let h=e.arguments();try{let t=I.parse(h[p.name]);if(t.identity===i.coreIdentity)return e.name===(null!=(r=h.as)?r:"core");return t.identity===i.linkIdentity&&e.name===(null!=(o=h.as)?o:i.linkDirectiveDefaultName)}catch(e){return!1}};let v=(0,p.createEnumTypeSpecification)({name:"Purpose",values:i.corePurposes.map(e=>({name:e,description:function(e){switch(e){case"SECURITY":return"`SECURITY` features provide metadata necessary to securely resolve fields.";case"EXECUTION":return"`EXECUTION` features provide metadata necessary for operation execution."}}(e)}))}),g=(0,p.createScalarTypeSpecification)({name:"Import"});class T extends f{constructor(e,t,r=i.linkIdentity,a=i.linkDirectiveDefaultName){super(new I(r,a,e),t),this.directiveDefinitionSpec=(0,p.createDirectiveSpecification)({name:a,locations:[n.DirectiveLocation.SCHEMA],repeatable:!0,args:this.createDefinitionArgumentSpecifications()}),this.registerDirective(this.directiveDefinitionSpec)}createDefinitionArgumentSpecifications(){let e=[{name:this.urlArgName(),type:e=>e.stringType()},{name:"as",type:e=>e.stringType()}];return this.supportPurposes()&&e.push({name:"for",type:(e,t)=>((0,o.assert)(t,"Shouldn't be added without being attached to a @link spec"),e.type(t.typeNameInSchema(v.name)))}),this.supportImport()&&e.push({name:"import",type:(e,t)=>((0,o.assert)(t,"Shouldn't be added without being attached to a @link spec"),new a.ListType(e.type(t.typeNameInSchema(g.name))))}),e}addElementsToSchema(e){return[]}addToSchema(e,t){let i=this.addDefinitionsToSchema(e,t);if(i.length>0)return i;let n={[this.urlArgName()]:this.toString()};t&&(n.as=t);let r=e.schemaDefinition,a=r.hasNonExtensionElements(),s=r.applyDirective(null!=t?t:this.url.name,n,!0);if(!a&&r.hasExtensionElements()){let e=(0,o.firstOf)(r.extensions());(0,o.assert)(e,"`hasExtensionElements` should not have been `true`"),s.setOfExtension(e)}return[]}addDefinitionsToSchema(e,t,i=[]){let n=e.coreFeatures;if(n)if(n.coreItself.url.identity===this.identity)return[];else return[l.ERRORS.INVALID_LINK_DIRECTIVE_USAGE.err(`Cannot add feature ${this} to the schema, it already uses ${n.coreItself.url}`)];let r=null!=t?t:this.url.name,s=new a.CoreFeature(this.url,r,new a.Directive(r),i),o=[];return(o=(o=o.concat(v.checkOrAdd(e,s))).concat(g.checkOrAdd(e,s))).concat(this.directiveDefinitionSpec.checkOrAdd(e,s))}allElementNames(){let e=[`@${this.url.name}`];return this.supportPurposes()&&e.push("Purpose"),this.supportImport()&&e.push("Import"),e}supportPurposes(){return this.version.strictlyGreaterThan(new E(0,1))}supportImport(){return this.url.name===i.linkDirectiveDefaultName}extractFeature(e){let t=e.coreFeatures;if(!t)throw h("Schema is not a core schema (add @core first)");if(!t.coreItself.url.version.equals(this.version))throw h(`Cannot use this version of @core (${this.version}), the schema uses version ${t.coreItself.url.version}`);return t.coreItself}coreDirective(e){let t=this.extractFeature(e);return e.directive(t.nameInSchema)}coreVersion(e){return this.extractFeature(e).url.version}applyFeatureToSchema(e,t,i,r,a){let s=this.coreDirective(e),o={[this.urlArgName()]:t.toString(),as:i};if(r)if(!this.supportPurposes())return[new n.GraphQLError(`Cannot apply feature ${t} with purpose since the schema's @core/@link version does not support it.`)];else o.for=r;if(a&&a.length>0)if(!this.supportImport())return[new n.GraphQLError(`Cannot apply feature ${t} with imports since the schema's @core/@link version does not support it.`)];else o.import=a.map(e=>e.as?e:e.name);return e.schemaDefinition.applyDirective(s,o),t.addElementsToSchema(e)}extractFeatureUrl(e){return I.parse(e[this.urlArgName()])}urlArgName(){return"core"===this.url.name?"feature":"url"}}i.CoreSpecDefinition=T;class S{constructor(e){this.identity=e,this._definitions=[],this._previewVersions=new Set}add(e,t){if(e.identity!==this.identity)throw h(`Cannot add definition for ${e} to the versions of definitions for ${this.identity}`);return this._definitions.find(t=>e.version.equals(t.version))||(this._definitions.push(e),this._definitions.sort((e,t)=>-e.version.compareTo(t.version)),(null==t?void 0:t.preview)&&this._previewVersions.add(e.version.toString())),this}find(e){return this._definitions.find(t=>t.version.equals(e))}versions(){return this._definitions.map(e=>e.version)}latest(){return(0,o.assert)(this._definitions.length>0,"Trying to get latest when no definitions exist"),this._definitions[0]}latestNonPreview(){var e;return(0,o.assert)(this._definitions.length>0,"Trying to get latest when no definitions exist"),null!=(e=this._definitions.find(e=>!this._previewVersions.has(e.version.toString())))?e:this._definitions[0]}getMinimumRequiredVersion(e){var t;let i=this._definitions.find(t=>!t.minimumFederationVersion||e.gte(t.minimumFederationVersion));(0,o.assert)(i,`No compatible definition exists for federation version ${e}`);let n=this.latest().version.major;return i.version.major!==n?null!=(t=(0,o.findLast)(this._definitions,e=>e.version.major===n))?t:this.latest():i}}i.FeatureDefinitions=S;class E{constructor(e,t){this.major=e,this.minor=t}static parse(e){let t=e.match(this.VERSION_RE);if(!t)throw l.ERRORS.INVALID_LINK_IDENTIFIER.err(`Expected a version string (of the form v1.2), got ${e}`);return new this(+t[1],+t[2])}static max(e){let t;for(let i of e)(!t||i.gt(t))&&(t=i);return t}satisfies(e){let{major:t,minor:i}=this,{major:n,minor:r}=e;return n==t&&(0==t?r==i:r<=i)}get series(){let{major:e}=this;return e>0?`${e}.x`:String(this)}compareTo(e){return this.major>e.major?1:this.major<e.major?-1:this.minor>e.minor?1:this.minor<e.minor?-1:0}lt(e){return 0>this.compareTo(e)}lte(e){return 0>=this.compareTo(e)}gt(e){return this.compareTo(e)>0}gte(e){return this.compareTo(e)>=0}strictlyGreaterThan(e){return this.compareTo(e)>0}toString(){return`v${this.major}.${this.minor}`}equals(e){return this.major===e.major&&this.minor===e.minor}}i.FeatureVersion=E,E.VERSION_RE=/^v(\d+)\.(\d+)$/;class I{constructor(e,t,i,n){this.identity=e,this.name=t,this.version=i,this.element=n}static maybeParse(e,t){try{return I.parse(e,t)}catch(e){return}}static parse(e,t){let i=new r.URL(e);if(!i.pathname||"/"===i.pathname)throw l.ERRORS.INVALID_LINK_IDENTIFIER.err(`Missing path in feature url '${i}'`,{nodes:t});let n=i.pathname.split("/"),a=n.pop();if(!a)throw l.ERRORS.INVALID_LINK_IDENTIFIER.err(`Missing version component in feature url '${i}'`,{nodes:t});let s=E.parse(a),o=n[n.length-1];if(!o)throw l.ERRORS.INVALID_LINK_IDENTIFIER.err(`Missing feature name component in feature url '${i}'`,{nodes:t});let u=i.hash?i.hash.slice(1):void 0;return i.hash="",i.search="",i.password="",i.username="",i.pathname=n.join("/"),new I(i.toString(),o,s,u)}static decode(e){return this.parse(e.value,e)}satisfies(e){return e.identity===this.identity&&this.version.satisfies(e.version)}equals(e){return this.identity===e.identity&&this.version.equals(e.version)}get url(){return this.element?`${this.identity}/${this.version}#${this.element}`:`${this.identity}/${this.version}`}get isDirective(){var e;return null==(e=this.element)?void 0:e.startsWith("@")}get elementName(){var e;return this.isDirective?null==(e=this.element)?void 0:e.slice(1):this.element}get base(){return this.element?new I(this.identity,this.name,this.version):this}toString(){return this.url}}i.FeatureUrl=I,i.findCoreSpecVersion=function(e){return"core"===e.name?i.CORE_VERSIONS.find(e.version):e.name===i.linkDirectiveDefaultName?i.LINK_VERSIONS.find(e.version):void 0},i.CORE_VERSIONS=new S(i.coreIdentity).add(new T(new E(0,1),void 0,i.coreIdentity,"core")).add(new T(new E(0,2),new E(2,0),i.coreIdentity,"core")),i.LINK_VERSIONS=new S(i.linkIdentity).add(new T(new E(1,0),new E(2,0))),(0,c.registerKnownFeature)(i.CORE_VERSIONS),(0,c.registerKnownFeature)(i.LINK_VERSIONS),i.removeAllCoreFeatures=function(e){var t,i;let n=[...null!=(i=null==(t=e.coreFeatures)?void 0:t.allFeatures())?i:[]],r=[];for(let t of n)e.directives().filter(e=>t.isFeatureDefinition(e)).forEach(e=>e.remove().forEach(e=>e.remove())),e.types().filter(e=>t.isFeatureDefinition(e)).forEach(e=>{let i=e.remove();i.length>0&&r.push({feature:t,type:e,references:i})});let s=[];for(let{feature:e,type:t,references:i}of r){let n=i.filter(e=>e.isAttached());n.length>0&&s.push(l.ERRORS.REFERENCED_INACCESSIBLE.err(`Cannot remove elements of feature ${e} as feature type ${t} is referenced by elements: ${n.join(", ")}`,{nodes:(0,a.sourceASTs)(...i)}))}if(s.length>0)throw(0,a.ErrGraphQLAPISchemaValidationFailed)(s)}},193151,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.TAG_VERSIONS=i.TagSpecDefinition=i.tagIdentity=void 0;let n=e.r(186846),r=e.r(785576),a=e.r(168032),s=e.r(343924),o=e.r(408470),l=e.r(319894),u=e.r(678270);i.tagIdentity="https://specs.apollo.dev/tag";class c extends r.FeatureDefinition{constructor(e,t){super(new r.FeatureUrl(i.tagIdentity,"tag",e),t),this.tagLocations=[n.DirectiveLocation.FIELD_DEFINITION,n.DirectiveLocation.OBJECT,n.DirectiveLocation.INTERFACE,n.DirectiveLocation.UNION],this.printedTagDefinition="directive @tag(name: String!) repeatable on FIELD_DEFINITION | INTERFACE | OBJECT | UNION",!this.isV01()&&(this.tagLocations.push(n.DirectiveLocation.ARGUMENT_DEFINITION,n.DirectiveLocation.SCALAR,n.DirectiveLocation.ENUM,n.DirectiveLocation.ENUM_VALUE,n.DirectiveLocation.INPUT_OBJECT,n.DirectiveLocation.INPUT_FIELD_DEFINITION),this.printedTagDefinition="directive @tag(name: String!) repeatable on FIELD_DEFINITION | INTERFACE | OBJECT | UNION | ARGUMENT_DEFINITION | SCALAR | ENUM | ENUM_VALUE | INPUT_OBJECT | INPUT_FIELD_DEFINITION",this.isV02()||(this.tagLocations.push(n.DirectiveLocation.SCHEMA),this.printedTagDefinition="directive @tag(name: String!) repeatable on FIELD_DEFINITION | INTERFACE | OBJECT | UNION | ARGUMENT_DEFINITION | SCALAR | ENUM | ENUM_VALUE | INPUT_OBJECT | INPUT_FIELD_DEFINITION | SCHEMA")),this.tagDirectiveSpec=(0,s.createDirectiveSpecification)({name:"tag",locations:this.tagLocations,repeatable:!0,args:[{name:"name",type:e=>new a.NonNullType(e.stringType())}],composes:!0,supergraphSpecification:e=>i.TAG_VERSIONS.getMinimumRequiredVersion(e)}),this.registerDirective(this.tagDirectiveSpec)}isV01(){return this.version.equals(new r.FeatureVersion(0,1))}isV02(){return this.version.equals(new r.FeatureVersion(0,2))}checkCompatibleDirective(e){let t=Object.keys(e.arguments()).length>1,i=e.argument("name"),n=i&&(0,u.sameType)(i.type,new a.NonNullType(e.schema().stringType())),r=e.locations.every(e=>this.tagLocations.includes(e));if(t||!n||!r)return o.ERRORS.DIRECTIVE_DEFINITION_INVALID.err(`Found invalid @tag directive definition. Please ensure the directive definition in your schema's definitions matches the following:
|
|
14
14
|
${this.printedTagDefinition}`)}}i.TagSpecDefinition=c,i.TAG_VERSIONS=new r.FeatureDefinitions(i.tagIdentity).add(new c(new r.FeatureVersion(0,1))).add(new c(new r.FeatureVersion(0,2))).add(new c(new r.FeatureVersion(0,3),new r.FeatureVersion(2,0))),(0,l.registerKnownFeature)(i.TAG_VERSIONS)},355415,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.removeInaccessibleElements=i.INACCESSIBLE_VERSIONS=i.InaccessibleSpecDefinition=i.inaccessibleIdentity=void 0;let n=e.r(785576),r=e.r(168032),a=e.r(186846),s=e.r(319894),o=e.r(408470),l=e.r(343924),u=e.r(331484);i.inaccessibleIdentity="https://specs.apollo.dev/inaccessible";class c extends n.FeatureDefinition{constructor(e,t){super(new n.FeatureUrl(i.inaccessibleIdentity,"inaccessible",e),t),this.inaccessibleLocations=[a.DirectiveLocation.FIELD_DEFINITION,a.DirectiveLocation.OBJECT,a.DirectiveLocation.INTERFACE,a.DirectiveLocation.UNION],this.printedInaccessibleDefinition="directive @inaccessible on FIELD_DEFINITION | INTERFACE | OBJECT | UNION",this.isV01()||(this.inaccessibleLocations.push(a.DirectiveLocation.ARGUMENT_DEFINITION,a.DirectiveLocation.SCALAR,a.DirectiveLocation.ENUM,a.DirectiveLocation.ENUM_VALUE,a.DirectiveLocation.INPUT_OBJECT,a.DirectiveLocation.INPUT_FIELD_DEFINITION),this.printedInaccessibleDefinition="directive @inaccessible on FIELD_DEFINITION | INTERFACE | OBJECT | UNION | ARGUMENT_DEFINITION | SCALAR | ENUM | ENUM_VALUE | INPUT_OBJECT | INPUT_FIELD_DEFINITION"),this.inaccessibleDirectiveSpec=(0,l.createDirectiveSpecification)({name:"inaccessible",locations:this.inaccessibleLocations,composes:!0,supergraphSpecification:e=>i.INACCESSIBLE_VERSIONS.getMinimumRequiredVersion(e)}),this.registerDirective(this.inaccessibleDirectiveSpec)}isV01(){return this.version.equals(new n.FeatureVersion(0,1))}inaccessibleDirective(e){return this.directive(e,"inaccessible")}checkCompatibleDirective(e){let t=Object.keys(e.arguments()).length>0,i=e.repeatable,n=e.locations.every(e=>this.inaccessibleLocations.includes(e));if(t||i||!n)return o.ERRORS.DIRECTIVE_DEFINITION_INVALID.err(`Found invalid @inaccessible directive definition. Please ensure the directive definition in your schema's definitions matches the following:
|
|
15
15
|
${this.printedInaccessibleDefinition}`)}get defaultCorePurpose(){return"SECURITY"}}function d(e){let t,i=[];return function e(t,i,n){if(null!=t){if((0,r.isNonNullType)(i))return e(t,i.ofType,n);if(!(0,r.isScalarType)(i)&&!(0,r.isVariable)(t)){if(Array.isArray(t)){if((0,r.isListType)(i)){let r=i.ofType;for(let i of t)e(i,r,n)}return}if((0,r.isListType)(i))return e(t,i.ofType,n);if("object"==typeof t){if((0,r.isInputObjectType)(i))for(let r of i.fields()){let i=t[r.name];void 0!==i&&(n.push(r),e(i,r.type,n))}return}if("string"==typeof t&&(0,r.isEnumType)(i)){let e=i.value(t);void 0!==e&&n.push(e)}}}}(e.defaultValue,(t=e.type,(0,u.assert)(t,"Schema should have been valid, but argument/input field did not have type."),t),i),i}function p(e){let t=e.schema();return e instanceof r.ObjectType||e instanceof r.InterfaceType||e instanceof r.UnionType||e instanceof r.ScalarType||e instanceof r.EnumType||e instanceof r.InputObjectType?t.builtInTypes(!0).some(t=>t.name===e.name):e instanceof r.DirectiveDefinition?t.builtInDirectives(!0).some(t=>t.name===e.name):void(0,u.assert)(!1,"Unreachable code, element is of unknown type.")}i.InaccessibleSpecDefinition=c,i.INACCESSIBLE_VERSIONS=new n.FeatureDefinitions(i.inaccessibleIdentity).add(new c(new n.FeatureVersion(0,1))).add(new c(new n.FeatureVersion(0,2),new n.FeatureVersion(2,0))),(0,s.registerKnownFeature)(i.INACCESSIBLE_VERSIONS),i.removeInaccessibleElements=function(e){e.validate();let t=e.coreFeatures;if(!t)return;let n=t.getByIdentity(i.inaccessibleIdentity);if(!n)return;let s=i.INACCESSIBLE_VERSIONS.find(n.url.version);if(!s)throw(0,r.ErrGraphQLAPISchemaValidationFailed)([new a.GraphQLError(`Cannot remove inaccessible elements: the schema uses unsupported inaccessible spec version ${n.url.version} (supported versions: ${i.INACCESSIBLE_VERSIONS.versions().join(", ")})`)]);let l=s.inaccessibleDirective(e);if(!l)throw(0,r.ErrGraphQLAPISchemaValidationFailed)([new a.GraphQLError(`Invalid schema: declares ${s.url} spec but does not define a @inaccessible directive.`)]);let c=s.checkCompatibleDirective(l);if(c)throw(0,r.ErrGraphQLAPISchemaValidationFailed)([c]);(function(e,t,i,n){var a,s,l;let c;function h(e){return e.hasAppliedDirective(n)}let f=[...t.allFeatures()];function m(e){return f.some(t=>t.isFeatureDefinition(e))}function y(e){return!(!(e instanceof r.DirectiveDefinition)&&h(e))&&(e instanceof r.ObjectType||e instanceof r.InterfaceType||e instanceof r.UnionType||e instanceof r.ScalarType||e instanceof r.EnumType||e instanceof r.InputObjectType||e instanceof r.DirectiveDefinition||(e instanceof r.FieldDefinition||e instanceof r.ArgumentDefinition||e instanceof r.InputFieldDefinition||e instanceof r.EnumValue?y(e.parent):void(0,u.assert)(!1,"Unreachable code, element is of unknown type.")))}function v(e){let t=[];if(h(e)&&t.push(e),e instanceof r.ObjectType||e instanceof r.InterfaceType||e instanceof r.InputObjectType){for(let i of e.fields())t.push(...v(i));return t}if(e instanceof r.EnumType){for(let i of e.values)t.push(...v(i));return t}if(e instanceof r.DirectiveDefinition||e instanceof r.FieldDefinition){for(let i of e.arguments())t.push(...v(i));return t}if(e instanceof r.UnionType||e instanceof r.ScalarType||e instanceof r.ArgumentDefinition||e instanceof r.InputFieldDefinition||e instanceof r.EnumValue)return t;(0,u.assert)(!1,"Unreachable code, element is of unknown type.")}let g=[];for(let t of(i.isV01()||(c=function(e){let t=new Map;function i(e,i){var n;let r=null!=(n=t.get(e))?n:[];0===r.length&&t.set(e,r),r.push(i)}for(let t of e.allTypes())if(!p(t)){if(t instanceof r.ObjectType||t instanceof r.InterfaceType)for(let e of t.fields())for(let t of e.arguments())for(let e of d(t))i(e,t);if(t instanceof r.InputObjectType)for(let e of t.fields())for(let t of d(e))i(t,e)}for(let t of e.allDirectives())if(!p(t))for(let e of t.arguments())for(let t of d(e))i(t,e);return t}(e)),e.allTypes()))if(p(t)){let e=v(t);e.length>0&&g.push(o.ERRORS.DISALLOWED_INACCESSIBLE.err(`Built-in type "${t.coordinate}" cannot use @inaccessible.`,{nodes:t.sourceAST,extensions:{inaccessible_elements:e.map(e=>e.coordinate),inaccessible_referencers:[t.coordinate]}}))}else if(m(t)){let e=v(t);e.length>0&&g.push(o.ERRORS.DISALLOWED_INACCESSIBLE.err(`Core feature type "${t.coordinate}" cannot use @inaccessible.`,{nodes:t.sourceAST,extensions:{inaccessible_elements:e.map(e=>e.coordinate),inaccessible_referencers:[t.coordinate]}}))}else if(h(t))for(let e of t.referencers())e instanceof r.FieldDefinition||e instanceof r.ArgumentDefinition||e instanceof r.InputFieldDefinition?y(e)&&g.push(o.ERRORS.REFERENCED_INACCESSIBLE.err(`Type "${t.coordinate}" is @inaccessible but is referenced by "${e.coordinate}", which is in the API schema.`,{nodes:t.sourceAST,extensions:{inaccessible_elements:[t.coordinate],inaccessible_referencers:[e.coordinate]}})):e instanceof r.SchemaDefinition&&t===e.rootType("query")&&g.push(o.ERRORS.QUERY_ROOT_TYPE_INACCESSIBLE.err(`Type "${t.coordinate}" is @inaccessible but is the root query type, which must be in the API schema.`,{nodes:t.sourceAST,extensions:{inaccessible_elements:[t.coordinate]}}));else{if(t instanceof r.ObjectType||t instanceof r.InterfaceType||t instanceof r.InputObjectType){let e=!0;for(let i of t.fields())h(i)||(e=!1);e&&g.push(o.ERRORS.ONLY_INACCESSIBLE_CHILDREN.err(`Type "${t.coordinate}" is in the API schema but all of its ${t instanceof r.InputObjectType?"input ":""}fields are @inaccessible.`,{nodes:t.sourceAST,extensions:{inaccessible_elements:t.fields().map(e=>e.coordinate),inaccessible_referencers:[t.coordinate]}}))}else if(t instanceof r.UnionType){let e=!0;for(let i of t.types())h(i)||(e=!1);e&&g.push(o.ERRORS.ONLY_INACCESSIBLE_CHILDREN.err(`Type "${t.coordinate}" is in the API schema but all of its members are @inaccessible.`,{nodes:t.sourceAST,extensions:{inaccessible_elements:t.types().map(e=>e.coordinate),inaccessible_referencers:[t.coordinate]}}))}else if(t instanceof r.EnumType){let e=!0;for(let i of t.values)h(i)||(e=!1);e&&g.push(o.ERRORS.ONLY_INACCESSIBLE_CHILDREN.err(`Type "${t.coordinate}" is in the API schema but all of its values are @inaccessible.`,{nodes:t.sourceAST,extensions:{inaccessible_elements:t.values.map(e=>e.coordinate),inaccessible_referencers:[t.coordinate]}}))}if(t instanceof r.ObjectType||t instanceof r.InterfaceType){let e=t.interfaces(),i=[];if(t instanceof r.InterfaceType)for(let e of t.referencers())(e instanceof r.ObjectType||e instanceof r.InterfaceType)&&i.push(e);for(let n of t.fields())if(h(n))for(let t of e){let e=t.field(n.name);e&&y(e)&&g.push(o.ERRORS.IMPLEMENTED_BY_INACCESSIBLE.err(`Field "${n.coordinate}" is @inaccessible but implements the interface field "${e.coordinate}", which is in the API schema.`,{nodes:n.sourceAST,extensions:{inaccessible_elements:[n.coordinate],inaccessible_referencers:[e.coordinate]}}))}else for(let t of n.arguments())if(h(t)){for(let e of(t.isRequired()&&g.push(o.ERRORS.REQUIRED_INACCESSIBLE.err(`Argument "${t.coordinate}" is @inaccessible but is a required argument of its field.`,{nodes:t.sourceAST,extensions:{inaccessible_elements:[t.coordinate],inaccessible_referencers:[t.coordinate]}})),i)){let i=e.field(n.name);(0,u.assert)(i,"Schema should have been valid, but an implementing type did not implement one of this type's fields.");let r=i.argument(t.name);(0,u.assert)(r,"Schema should have been valid, but an implementing type did not implement one of this type's field's arguments."),y(r)&&r.isRequired()&&g.push(o.ERRORS.REQUIRED_INACCESSIBLE.err(`Argument "${t.coordinate}" is @inaccessible but is implemented by the required argument "${r.coordinate}", which is in the API schema.`,{nodes:t.sourceAST,extensions:{inaccessible_elements:[t.coordinate],inaccessible_referencers:[r.coordinate]}}))}for(let i of e){let e=null==(a=i.field(n.name))?void 0:a.argument(t.name);e&&y(e)&&g.push(o.ERRORS.IMPLEMENTED_BY_INACCESSIBLE.err(`Argument "${t.coordinate}" is @inaccessible but implements the interface argument "${e.coordinate}", which is in the API schema.`,{nodes:t.sourceAST,extensions:{inaccessible_elements:[t.coordinate],inaccessible_referencers:[e.coordinate]}}))}}}else if(t instanceof r.InputObjectType){for(let e of t.fields())if(h(e))for(let i of(e.isRequired()&&g.push(o.ERRORS.REQUIRED_INACCESSIBLE.err(`Input field "${e.coordinate}" is @inaccessible but is a required input field of its type.`,{nodes:e.sourceAST,extensions:{inaccessible_elements:[e.coordinate],inaccessible_referencers:[e.coordinate]}})),(0,u.assert)(c,"Input fields can't be @inaccessible in v0.1, but default value referencers weren't computed (which is only skipped for v0.1)."),null!=(s=c.get(e))?s:[]))y(i)&&g.push(o.ERRORS.DEFAULT_VALUE_USES_INACCESSIBLE.err(`Input field "${e.coordinate}" is @inaccessible but is used in the default value of "${i.coordinate}", which is in the API schema.`,{nodes:t.sourceAST,extensions:{inaccessible_elements:[t.coordinate],inaccessible_referencers:[i.coordinate]}}))}else if(t instanceof r.EnumType){for(let e of t.values)if(h(e))for(let i of((0,u.assert)(c,"Enum values can't be @inaccessible in v0.1, but default value referencers weren't computed (which is only skipped for v0.1)."),null!=(l=c.get(e))?l:[]))y(i)&&g.push(o.ERRORS.DEFAULT_VALUE_USES_INACCESSIBLE.err(`Enum value "${e.coordinate}" is @inaccessible but is used in the default value of "${i.coordinate}", which is in the API schema.`,{nodes:t.sourceAST,extensions:{inaccessible_elements:[t.coordinate],inaccessible_referencers:[i.coordinate]}}))}}for(let t of e.allDirectives()){let e=t.locations.filter(e=>(0,r.isTypeSystemDirectiveLocation)(e));if(p(t)){let e=v(t);e.length>0&&g.push(o.ERRORS.DISALLOWED_INACCESSIBLE.err(`Built-in directive "${t.coordinate}" cannot use @inaccessible.`,{nodes:t.sourceAST,extensions:{inaccessible_elements:e.map(e=>e.coordinate),inaccessible_referencers:[t.coordinate]}}))}else if(m(t)){let e=v(t);e.length>0&&g.push(o.ERRORS.DISALLOWED_INACCESSIBLE.err(`Core feature directive "${t.coordinate}" cannot use @inaccessible.`,{nodes:t.sourceAST,extensions:{inaccessible_elements:e.map(e=>e.coordinate),inaccessible_referencers:[t.coordinate]}}))}else if(e.length>0){let i=v(t);i.length>0&&g.push(o.ERRORS.DISALLOWED_INACCESSIBLE.err(`Directive "${t.coordinate}" cannot use @inaccessible because it may be applied to these type-system locations: ${e.join(", ")}.`,{nodes:t.sourceAST,extensions:{inaccessible_elements:i.map(e=>e.coordinate),inaccessible_referencers:[t.coordinate]}}))}else for(let e of t.arguments())e.isRequired()&&h(e)&&g.push(o.ERRORS.REQUIRED_INACCESSIBLE.err(`Argument "${e.coordinate}" is @inaccessible but is a required argument of its directive.`,{nodes:e.sourceAST,extensions:{inaccessible_elements:[e.coordinate],inaccessible_referencers:[e.coordinate]}}))}if(g.length>0)throw(0,r.ErrGraphQLAPISchemaValidationFailed)(g)})(e,t,s,l),function(e,t){function i(e){return e.hasAppliedDirective(t)}for(let t of e.types())if(i(t))t.remove();else if(t instanceof r.ObjectType||t instanceof r.InterfaceType)for(let e of t.fields())if(i(e))e.remove();else for(let t of e.arguments())i(t)&&t.remove();else if(t instanceof r.InputObjectType)for(let e of t.fields())i(e)&&e.remove();else if(t instanceof r.EnumType)for(let e of t.values)i(e)&&e.remove();for(let t of e.directives())for(let e of t.arguments())i(e)&&e.remove()}(e,l)}},383105,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.printDirectiveDefinition=i.printTypeDefinitionAndExtensions=i.printType=i.printSchema=i.shallowOrderPrintedDefinitions=i.orderPrintedDefinitions=i.defaultPrintOptions=void 0;let n=e.r(331484),r=e.r(367356);function a(e,t,i){return(t.mergeTypesAndExtensions?[void 0]:[null,...e.extensions()]).map(n=>i(e,t,n)).filter(e=>void 0!==e)}function s(e){return e?"extend ":""}function o(e,t){return void 0===t?e:e.filter(e=>{var i;return(null!=(i=e.ofExtension())?i:null)===t})}function l(e,t,i){let n=o(e.appliedDirectives,i);return t.directiveApplicationFilter&&(n=n.filter(t.directiveApplicationFilter)),n}function u(e,t,i){var n;let r=o(e.roots(),i),a=l(e,t,i);if(!r.length&&!a.length||!i&&!a.length&&!(n=e).description&&n.roots().every(e=>e.isDefaultRootName()))return;let u=r.concat().sort((e,i)=>t.rootTypesOrder.indexOf(e.rootKind)-t.rootTypesOrder.indexOf(i.rootKind)).map(e=>`${t.indentString}${e.rootKind}: ${e.type}`);return h(e,t,i)+s(i)+"schema"+p(a,t,!0,0!==u.length)+(0===a.length?" ":"")+(0===u.length?"":"{\n"+u.join("\n")+"\n}")}function c(e,t=i.defaultPrintOptions){switch(e.kind){case"ScalarType":return a(e,t,f);case"ObjectType":return a(e,t,(e,t,i)=>m("type",e,t,i));case"InterfaceType":return a(e,t,(e,t,i)=>m("interface",e,t,i));case"UnionType":return a(e,t,y);case"EnumType":return a(e,t,v);case"InputObjectType":return a(e,t,g)}}function d(e,t=i.defaultPrintOptions){let n=e.locations.join(" | ");return`${h(e,t,null)}directive ${e}${S(e.arguments(),t)}${e.repeatable?" repeatable":""} on ${n}`}function p(e,t,i=!1,n=i){if(0==e.length)return"";let r=i?"\n"+t.indentString:" ",a=e.map(e=>e.toString()).join(r);return i?"\n"+t.indentString+a+(n?"\n":""):" "+a}function h(e,t,i,n="",r=!0){if(i||void 0===e.description||t.noDescriptions)return"";let a=e.description.length>70;return(n&&!r?"\n"+n:n)+(function(e,t="",i=!1){let n=-1===e.indexOf("\n"),r=" "===e[0]||" "===e[0],a='"'===e[e.length-1],s="\\"===e[e.length-1],o=!n||a||s||i,l="";return o&&!(n&&r)&&(l+="\n"+t),l+=t?e.replace(/\n/g,"\n"+t):e,o&&(l+="\n"),'"""'+l.replace(/"""/g,'\\"""')+'"""'})(e.description,"",a).replace(/\n/g,"\n"+n)+"\n"}function f(e,t,i){let n=l(e,t,i);if(!i||n.length)return`${h(e,t,i)}${s(i)}scalar ${e.name}${p(n,t,!0,!1)}`}function m(e,t,i,n){let r=l(t,i,n),a=o(t.interfaceImplementations(),n),u=o(t.fields(),n);if(i.fieldFilter&&(u=u.filter(i.fieldFilter)),r.length||a.length||u.length||!n&&t.preserveEmptyDefinition){var c;return i.implementedInterfaceCompareFn&&(a=a.concat().sort(i.implementedInterfaceCompareFn)),i.fieldCompareFn&&(u=u.concat().sort(i.fieldCompareFn)),h(t,i,n)+s(n)+e+" "+t+((c=a).length?" implements "+c.map(e=>e.interface.name).join(" & "):"")+p(r,i,!0,u.length>0)+(0===r.length&&u.length>0?" ":"")+T(u,i)}}function y(e,t,i){let n=l(e,t,i),r=o(e.members(),i);if(!n.length&&!r.length&&(i||!e.preserveEmptyDefinition))return;t.unionMemberCompareFn&&(r=r.concat().sort(t.unionMemberCompareFn));let a=r.length?" = "+r.map(e=>e.type).join(" | "):"";return h(e,t,i)+s(i)+"union "+e+p(n,t,!0,r.length>0)+a}function v(e,t,i){let n=l(e,t,i),r=o(e.values,i);if(!n.length&&!r.length&&(i||!e.preserveEmptyDefinition))return;t.enumValueCompareFn&&(r=r.concat().sort(t.enumValueCompareFn));let a=r.map((e,n)=>h(e,t,i,t.indentString,!n)+t.indentString+e+p(e.appliedDirectives,t));return h(e,t,i)+s(i)+"enum "+e+p(n,t,!0,a.length>0)+(0===n.length&&a.length>0?" ":"")+I(a)}function g(e,t,i){let n=l(e,t,i),r=o(e.fields(),i);if(n.length||r.length||!i&&e.preserveEmptyDefinition)return t.inputObjectFieldCompareFn&&(r=r.concat().sort(t.inputObjectFieldCompareFn)),h(e,t,i)+s(i)+"input "+e+p(n,t,!0,r.length>0)+(0===n.length&&r.length>0?" ":"")+T(r,t)}function T(e,t){return I(e.map((e,i)=>{var n,a;let s,o;return h(e,t,void 0,t.indentString,!i)+t.indentString+(n=e,a=t,s="FieldDefinition"==n.kind?S(n.arguments(),a,a.indentString):"",o="InputFieldDefinition"===n.kind&&void 0!==n.defaultValue?" = "+(0,r.valueToString)(n.defaultValue,n.type):"",`${n.name}${s}: ${n.type}${o}`)+p(l(e,t),t)}))}function S(e,t,i=""){if(0===e.length)return"";if(e.every(e=>!e.description))return"("+e.map(e=>E(e,t)).join(", ")+")";let n=e.map((e,n)=>h(e,t,null," "+i,!n)+" "+i+E(e,t)).join("\n");return`(
|
|
16
16
|
${n}
|
|
17
|
-
${i})`}function E(e,t){return`${e}${p(l(e,t),t)}`}function I(e){return 0!==e.length?"{\n"+e.join("\n")+"\n}":""}i.defaultPrintOptions={indentString:" ",definitionsOrder:["schema","directives","types"],rootTypesOrder:["query","mutation","subscription"],mergeTypesAndExtensions:!1,showAllBuiltIns:!1,noDescriptions:!1,typeFilter:()=>!0,fieldFilter:()=>!0,directiveApplicationFilter:()=>!0},i.orderPrintedDefinitions=function(e){return{...e,typeCompareFn:(e,t)=>e.name.localeCompare(t.name),implementedInterfaceCompareFn:(e,t)=>e.interface.name.localeCompare(t.interface.name),fieldCompareFn:(e,t)=>e.name.localeCompare(t.name),unionMemberCompareFn:(e,t)=>e.type.name.localeCompare(t.type.name),enumValueCompareFn:(e,t)=>e.name.localeCompare(t.name),inputObjectFieldCompareFn:(e,t)=>e.name.localeCompare(t.name),directiveCompareFn:(e,t)=>e.name.localeCompare(t.name)}},i.shallowOrderPrintedDefinitions=function(e){return{...e,typeCompareFn:(e,t)=>e.name.localeCompare(t.name),directiveCompareFn:(e,t)=>e.name.localeCompare(t.name)}},i.printSchema=function(e,t=i.defaultPrintOptions){var n;if(!(3===t.definitionsOrder.length&&t.definitionsOrder.indexOf("schema")>=0&&t.definitionsOrder.indexOf("types")>=0&&t.definitionsOrder.indexOf("directives")>=0))throw Error(`'definitionsOrder' should be a 3-element array containing 'schema', 'types' and 'directives' in the desired order (got: [${t.definitionsOrder.join(", ")}])`);let r=t.showAllBuiltIns?e.allDirectives():e.directives();t.directiveDefinitionFilter&&(r=r.filter(t.directiveDefinitionFilter)),t.directiveCompareFn&&(r=r.concat().sort(t.directiveCompareFn));let s=t.showAllBuiltIns?e.allTypes():e.types();t.typeFilter&&(s=s.filter(t.typeFilter)),t.typeCompareFn&&(s=s.concat().sort(t.typeCompareFn));let o=[,,,];return o[t.definitionsOrder.indexOf("schema")]=(n=e.schemaDefinition,a(n,t,u)),o[t.definitionsOrder.indexOf("directives")]=r.map(e=>d(e,t)),o[t.definitionsOrder.indexOf("types")]=s.flatMap(e=>c(e,t)),o.flat().join("\n\n")},i.printType=function(e,t=i.defaultPrintOptions){let r=c(e,t);return(0,n.assert)(1==r.length,`Type ${e} is built from more than 1 definition or extension`),r[0]},i.printTypeDefinitionAndExtensions=c,i.printDirectiveDefinition=d},836270,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.addIntrospectionFields=i.isIntrospectionName=i.introspectionTypeNames=i.introspectionFieldNames=void 0;let n=e.r(186846),r=e.r(168032);i.introspectionFieldNames=["__schema","__type"],i.introspectionTypeNames=["__Schema","__Directive","__DirectiveLocation","__Type","__Field","__InputValue","__EnumValue","__TypeKind"],i.isIntrospectionName=function(e){return e.startsWith("__")},i.addIntrospectionFields=function(e){if(e.type("__Schema"))return;let t=e.addType(new r.EnumType("__TypeKind",!0));t.addValue("SCALAR"),t.addValue("OBJECT"),t.addValue("INTERFACE"),t.addValue("UNION"),t.addValue("ENUM"),t.addValue("INPUT_OBJECT"),t.addValue("LIST"),t.addValue("NON_NULL");let i=e.addType(new r.ObjectType("__InputValue",!0)),a=e.addType(new r.ObjectType("__Field",!0)),s=e.addType(new r.ObjectType("__Type",!0)),o=e.addType(new r.ObjectType("__EnumValue",!0));s.addField("kind",new r.NonNullType(t)),s.addField("name",e.stringType()),s.addField("description",e.stringType()),s.addField("fields",new r.ListType(new r.NonNullType(a))).addArgument("includeDeprecated",e.booleanType(),!1),s.addField("interfaces",new r.ListType(new r.NonNullType(s))),s.addField("possibleTypes",new r.ListType(new r.NonNullType(s))),s.addField("enumValues",new r.ListType(new r.NonNullType(o))).addArgument("includeDeprecated",e.booleanType(),!1),s.addField("inputFields",new r.ListType(new r.NonNullType(i))).addArgument("includeDeprecated",e.booleanType(),!1),s.addField("ofType",s),s.addField("specifiedByURL",e.stringType()),a.addField("name",new r.NonNullType(e.stringType())),a.addField("description",e.stringType()),a.addField("args",new r.NonNullType(new r.ListType(new r.NonNullType(i)))).addArgument("includeDeprecated",e.booleanType(),!1),a.addField("type",new r.NonNullType(s)),a.addField("isDeprecated",new r.NonNullType(e.booleanType())),a.addField("deprecationReason",e.stringType()),i.addField("name",new r.NonNullType(e.stringType())),i.addField("description",e.stringType()),i.addField("type",new r.NonNullType(s)),i.addField("defaultValue",e.stringType()),i.addField("isDeprecated",new r.NonNullType(e.booleanType())),i.addField("deprecationReason",e.stringType()),o.addField("name",new r.NonNullType(e.stringType())),o.addField("description",e.stringType()),o.addField("isDeprecated",new r.NonNullType(e.booleanType())),o.addField("deprecationReason",e.stringType());let l=e.addType(new r.EnumType("__DirectiveLocation",!0));for(let e of Object.values(n.DirectiveLocation))l.addValue(e);let u=e.addType(new r.ObjectType("__Directive",!0));u.addField("name",new r.NonNullType(e.stringType())),u.addField("description",e.stringType()),u.addField("locations",new r.NonNullType(new r.ListType(new r.NonNullType(l)))),u.addField("args",new r.NonNullType(new r.ListType(new r.NonNullType(i)))).addArgument("includeDeprecated",e.booleanType(),!1),u.addField("isRepeatable",new r.NonNullType(e.booleanType()));let c=e.addType(new r.ObjectType("__Schema",!0));c.addField("description",e.stringType()),c.addField("types",new r.NonNullType(new r.ListType(new r.NonNullType(s)))),c.addField("queryType",new r.NonNullType(s)),c.addField("mutationType",new r.NonNullType(s)),c.addField("subscriptionType",new r.NonNullType(s)),c.addField("directives",new r.NonNullType(new r.ListType(new r.NonNullType(u))));let d=e.schemaDefinition.rootType("query");d||(d=e.addType(new r.ObjectType("Query")),e.schemaDefinition.setRoot("query",d)),d.addField(new r.FieldDefinition("__schema",!0),new r.NonNullType(c)),d.addField(new r.FieldDefinition("__type",!0),s).addArgument("name",new r.NonNullType(e.stringType()))}},622100,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.validateSchema=void 0;let n=e.r(168032),r=e.r(186846),a=e.r(367356),s=e.r(836270),o=e.r(678270),l=e.r(408470);i.validateSchema=function(e){return new c(e).validate()};class u{constructor(e){this.onError=e,this.visitedTypes=new Set,this.fieldPath=[],this.fieldPathIndexByTypeName=new Map}detectCycles(e){if(!this.visitedTypes.has(e.name)){for(let t of(this.visitedTypes.add(e.name),this.fieldPathIndexByTypeName.set(e.name,this.fieldPath.length),e.fields()))if((0,n.isNonNullType)(t.type)&&(0,n.isInputObjectType)(t.type.ofType)){let e=t.type.ofType,i=this.fieldPathIndexByTypeName.get(e.name);if(this.fieldPath.push(t),void 0===i)this.detectCycles(e);else{let t=this.fieldPath.slice(i),r=t.map(e=>e.name).join(".");this.onError(`Cannot reference Input Object "${e.name}" within itself through a series of non-null fields: "${r}".`,{nodes:(0,n.sourceASTs)(...t)})}this.fieldPath.pop()}this.fieldPathIndexByTypeName.delete(e.name)}}}class c{constructor(e){this.schema=e,this.emptyVariables=new n.VariableDefinitions,this.hasMissingTypes=!1,this.errors=[]}validate(){for(let e of this.schema.types())switch(!s.introspectionTypeNames.includes(e.name)&&this.validateName(e),e.kind){case"ObjectType":case"InterfaceType":this.validateObjectOrInterfaceType(e);break;case"InputObjectType":this.validateInputObjectType(e);break;case"UnionType":this.validateUnionType(e);break;case"EnumType":this.validateEnumType(e)}for(let e of this.schema.allDirectives()){for(let t of(this.validateName(e),e.arguments()))this.validateArg(t);for(let t of e.applications())this.validateDirectiveApplication(e,t)}if(!this.hasMissingTypes){let e=new u((e,t)=>this.addError(e,t));for(let t of this.schema.types())switch(t.kind){case"ObjectType":case"InterfaceType":this.validateImplementedInterfaces(t);break;case"InputObjectType":e.detectCycles(t)}}return this.errors}addError(e,t){this.errors.push(l.ERRORS.INVALID_GRAPHQL.err(e,t))}validateHasType(e){return e.type||(this.addError(`Element ${e.coordinate} does not have a type set`,{nodes:e.sourceAST}),this.hasMissingTypes=!1),!!e.type}validateName(e){if((0,s.isIntrospectionName)(e.name))return void this.addError(`Name "${e.name}" must not begin with "__", which is reserved by GraphQL introspection.`,e.sourceAST?{nodes:e.sourceAST}:{});try{(0,r.assertName)(e.name)}catch(t){this.addError(t.message,e.sourceAST?{nodes:e.sourceAST}:{})}}validateObjectOrInterfaceType(e){for(let t of(e.hasFields()||this.addError(`Type ${e.name} must define one or more fields.`,{nodes:e.sourceAST}),e.fields()))for(let e of(this.validateName(t),this.validateHasType(t),t.arguments()))this.validateArg(e)}validateImplementedInterfaces(e){for(let t of(e.implementsInterface(e.name)&&this.addError(`Type ${e} cannot implement itself because it would create a circular reference.`,{nodes:(0,n.sourceASTs)(e,e.interfaceImplementation(e.name))}),e.interfaces())){for(let i of t.fields()){let t=e.field(i.name);if(!t){this.addError(`Interface field ${i.coordinate} expected but ${e} does not provide it.`,{nodes:(0,n.sourceASTs)(i,e)});continue}for(let e of(this.validateHasType(i)&&!(0,o.isSubtype)(i.type,t.type)&&this.addError(`Interface field ${i.coordinate} expects type ${i.type} but ${t.coordinate} of type ${t.type} is not a proper subtype.`,{nodes:(0,n.sourceASTs)(i,t)}),i.arguments())){let i=t.argument(e.name);if(!i){this.addError(`Interface field argument ${e.coordinate} expected but ${t.coordinate} does not provide it.`,{nodes:(0,n.sourceASTs)(e,t)});continue}this.validateHasType(e)&&!(0,o.sameType)(e.type,i.type)&&this.addError(`Interface field argument ${e.coordinate} expects type ${e.type} but ${i.coordinate} is type ${i.type}.`,{nodes:(0,n.sourceASTs)(e,i)})}for(let e of t.arguments())!i.argument(e.name)&&e.isRequired()&&this.addError(`Field ${t.coordinate} includes required argument ${e.name} that is missing from the Interface field ${i.coordinate}.`,{nodes:(0,n.sourceASTs)(e,i)})}for(let i of t.interfaces())e.implementsInterface(i)||(i===e?this.addError(`Type ${e} cannot implement ${t} because it would create a circular reference.`,{nodes:(0,n.sourceASTs)(e,t)}):this.addError(`Type ${e} must implement ${i} because it is implemented by ${t}.`,{nodes:(0,n.sourceASTs)(e,t,i)}))}}validateInputObjectType(e){for(let t of(e.hasFields()||this.addError(`Input Object type ${e.name} must define one or more fields.`,{nodes:e.sourceAST}),e.fields()))this.validateName(t),this.validateHasType(t)&&(t.isRequired()&&t.isDeprecated()&&this.addError(`Required input field ${t.coordinate} cannot be deprecated.`,{nodes:(0,n.sourceASTs)(t.appliedDirectivesOf("deprecated")[0],t)}),void 0===t.defaultValue||(0,a.isValidValue)(t.defaultValue,t,new n.VariableDefinitions)||this.addError(`Invalid default value (got: ${(0,a.valueToString)(t.defaultValue)}) provided for input field ${t.coordinate} of type ${t.type}.`,{nodes:(0,n.sourceASTs)(t)}))}validateArg(e){if(this.validateName(e),this.validateHasType(e)&&(e.isRequired()&&e.isDeprecated()&&this.addError(`Required argument ${e.coordinate} cannot be deprecated.`,{nodes:(0,n.sourceASTs)(e.appliedDirectivesOf("deprecated")[0],e)}),void 0!==e.defaultValue&&!(0,a.isValidValue)(e.defaultValue,e,new n.VariableDefinitions))){let t=this.schema.builtInScalarTypes().find(t=>e.type&&(0,n.isScalarType)(e.type)&&t.name===e.type.name);t&&(0,a.isValidValueApplication)(e.defaultValue,t,e.defaultValue,new n.VariableDefinitions)||this.addError(`Invalid default value (got: ${(0,a.valueToString)(e.defaultValue)}) provided for argument ${e.coordinate} of type ${e.type}.`,{nodes:(0,n.sourceASTs)(e)})}}validateUnionType(e){0===e.membersCount()&&this.addError(`Union type ${e.coordinate} must define one or more member types.`,{nodes:e.sourceAST})}validateEnumType(e){for(let t of(0===e.values.length&&this.addError(`Enum type ${e.coordinate} must define one or more values.`,{nodes:e.sourceAST}),e.values))this.validateName(t),("true"===t.name||"false"===t.name||"null"===t.name)&&this.addError(`Enum type ${e.coordinate} cannot include value: ${t}.`,{nodes:t.sourceAST})}validateDirectiveApplication(e,t){for(let i of e.arguments()){let r=t.arguments()[i.name];if(r&&i.type&&!(0,a.isValidValue)(r,i,this.emptyVariables)){let r=t.parent,a=r instanceof n.NamedSchemaElement?r.coordinate:"schema";this.addError(`Invalid value for "${i.coordinate}" of type "${i.type}" in application of "${e.coordinate}" to "${a}".`,{nodes:(0,n.sourceASTs)(t,i)})}}}}},168032,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.CoreFeature=i.defaultSchemaBlueprint=i.SchemaBlueprint=i.NamedSchemaElementWithType=i.NamedSchemaElement=i.SchemaElement=i.Extension=i.sourceASTs=i.DirectiveTargetElement=i.isLeafType=i.typeFromAST=i.typeToAST=i.isTypeSystemDirectiveLocation=i.typeSystemDirectiveLocations=i.isExecutableDirectiveLocation=i.executableDirectiveLocations=i.isConditionalDirective=i.supertypes=i.runtimeTypesIntersects=i.possibleRuntimeTypes=i.isCompositeType=i.isAbstractType=i.isNullableType=i.baseType=i.filterTypesOfKind=i.isTypeOfKind=i.isInputType=i.isOutputType=i.isInputObjectType=i.isUnionType=i.isEnumType=i.isInterfaceType=i.isObjectType=i.isIDType=i.isBooleanType=i.isFloatType=i.isStringType=i.isIntType=i.isCustomScalarType=i.isScalarType=i.isNonNullType=i.isListType=i.isWrapperType=i.isNamedType=i.isSchemaRootType=i.defaultRootName=i.allSchemaRootKinds=i.typenameFieldName=i.ErrGraphQLAPISchemaValidationFailed=i.ErrGraphQLValidationFailed=void 0,i.isElementNamedType=i.isFieldDefinition=i.copyDirectiveDefinitionToSchema=i.newNamedType=i.variableDefinitionFromAST=i.variableDefinitionsFromAST=i.VariableDefinitions=i.VariableDefinition=i.isVariable=i.VariableCollector=i.Variable=i.directiveApplicationsSubstraction=i.isDirectiveApplicationsSubset=i.sameDirectiveApplications=i.sameDirectiveApplication=i.directivesToDirectiveNodes=i.directivesToString=i.Directive=i.DirectiveDefinition=i.EnumValue=i.ArgumentDefinition=i.InputFieldDefinition=i.FieldDefinition=i.NonNullType=i.ListType=i.InputObjectType=i.EnumType=i.UnionType=i.UnionMember=i.InterfaceType=i.ObjectType=i.InterfaceImplementation=i.ScalarType=i.SchemaDefinition=i.RootType=i.Schema=i.CoreFeatures=void 0;let n=e.r(186846),r=e.r(785576),a=e.r(331484),s=e.r(367356),o=e.r(193151),l=e.r(355415),u=e.r(383105),c=e.r(678270),d=e.r(836270),p=e.r(563029),h=e.r(359063),f=e.r(622100),m=e.r(343924),y=e.r(308126),v=e.r(408470),g=e.r(319894),T="The schema is not a valid GraphQL schema.",S=new Set;function E(e){return e.charAt(0).toUpperCase()+e.slice(1)}function I(e){return b(e)||N(e)}function b(e){return"ListType"==e.kind}function N(e){return"NonNullType"==e.kind}function _(e){return"ScalarType"==e.kind}function D(e){return"ObjectType"==e.kind}function A(e){return"InterfaceType"==e.kind}function O(e){return"EnumType"==e.kind}function R(e){return"UnionType"==e.kind}function w(e){switch(k(e).kind){case"ScalarType":case"ObjectType":case"UnionType":case"EnumType":case"InterfaceType":return!0;default:return!1}}function L(e){switch(k(e).kind){case"ScalarType":case"EnumType":case"InputObjectType":return!0;default:return!1}}function C(e,t){return e.kind===t}function F(e,t){return e.reduce((e,i)=>(C(i,t)&&e.push(i),e),[])}function k(e){return I(e)?e.baseType():e}function P(e){switch(e.kind){case"InterfaceType":return e.possibleRuntimeTypes();case"UnionType":return e.types();case"ObjectType":return[e]}}i.ErrGraphQLValidationFailed=(e,t=T)=>(0,v.aggregateError)("GraphQLValidationFailed",t,e),i.ErrGraphQLAPISchemaValidationFailed=e=>(0,v.aggregateError)("GraphQLAPISchemaValidationFailed","The supergraph schema failed to produce a valid API schema",e),i.typenameFieldName="__typename",i.allSchemaRootKinds=["query","mutation","subscription"],i.defaultRootName=E,i.isSchemaRootType=function(e){return D(e)&&e.isRootType()},i.isNamedType=function(e){return e instanceof H},i.isWrapperType=I,i.isListType=b,i.isNonNullType=N,i.isScalarType=_,i.isCustomScalarType=function(e){return _(e)&&!Z.includes(e.name)},i.isIntType=function(e){return e===e.schema().intType()},i.isStringType=function(e){return e===e.schema().stringType()},i.isFloatType=function(e){return e===e.schema().floatType()},i.isBooleanType=function(e){return e===e.schema().booleanType()},i.isIDType=function(e){return e===e.schema().idType()},i.isObjectType=D,i.isInterfaceType=A,i.isEnumType=O,i.isUnionType=R,i.isInputObjectType=function(e){return"InputObjectType"==e.kind},i.isOutputType=w,i.isInputType=L,i.isTypeOfKind=C,i.filterTypesOfKind=F,i.baseType=k,i.isNullableType=function(e){return!N(e)},i.isAbstractType=function(e){return A(e)||R(e)},i.isCompositeType=function(e){return D(e)||A(e)||R(e)},i.possibleRuntimeTypes=P,i.runtimeTypesIntersects=function(e,t){if(e===t)return!0;let i=P(e),n=P(t);for(let e of i)if(n.some(t=>e.name===t.name))return!0;return!1},i.supertypes=function(e){switch(e.kind){case"InterfaceType":return e.interfaces();case"UnionType":return[];case"ObjectType":return e.interfaces().concat(e.unionsWhereMember())}},i.isConditionalDirective=function(e){return["include","skip"].includes(e.name)},i.executableDirectiveLocations=[n.DirectiveLocation.QUERY,n.DirectiveLocation.MUTATION,n.DirectiveLocation.SUBSCRIPTION,n.DirectiveLocation.FIELD,n.DirectiveLocation.FRAGMENT_DEFINITION,n.DirectiveLocation.FRAGMENT_SPREAD,n.DirectiveLocation.INLINE_FRAGMENT,n.DirectiveLocation.VARIABLE_DEFINITION];let x=new Set(i.executableDirectiveLocations);function M(e){return x.has(e)}i.isExecutableDirectiveLocation=M,i.typeSystemDirectiveLocations=[n.DirectiveLocation.SCHEMA,n.DirectiveLocation.SCALAR,n.DirectiveLocation.OBJECT,n.DirectiveLocation.FIELD_DEFINITION,n.DirectiveLocation.ARGUMENT_DEFINITION,n.DirectiveLocation.INTERFACE,n.DirectiveLocation.UNION,n.DirectiveLocation.ENUM,n.DirectiveLocation.ENUM_VALUE,n.DirectiveLocation.INPUT_OBJECT,n.DirectiveLocation.INPUT_FIELD_DEFINITION];let U=new Set(i.typeSystemDirectiveLocations);function $(e){return U.has(e)}function j(e){switch(e.kind){case"ListType":return{kind:n.Kind.LIST_TYPE,type:j(e.ofType)};case"NonNullType":return{kind:n.Kind.NON_NULL_TYPE,type:j(e.ofType)};default:return{kind:n.Kind.NAMED_TYPE,name:{kind:n.Kind.NAME,value:e.name}}}}function V(e,t){switch(t.kind){case n.Kind.LIST_TYPE:return new eg(V(e,t.type));case n.Kind.NON_NULL_TYPE:return new eT(V(e,t.type));default:let i=e.type(t.name.value);if(!i)throw v.ERRORS.INVALID_GRAPHQL.err(`Unknown type "${t.name.value}"`,{nodes:t});return i}}i.isTypeSystemDirectiveLocation=$,i.typeToAST=j,i.typeFromAST=V,i.isLeafType=function(e){return _(e)||O(e)};class G{constructor(e,t=[]){this._schema=e,this.appliedDirectives=t.map(e=>this.attachDirective(e))}schema(){return this._schema}attachDirective(e){let t=e.isAttached()?new e_(e.name,e.arguments()):e;return B.prototype.setParent.call(t,this),t}appliedDirectivesOf(e){let t="string"==typeof e?e:e.name;return this.appliedDirectives.filter(e=>e.name==t)}hasAppliedDirective(e){let t="string"==typeof e?e:e.name;return this.appliedDirectives.some(e=>e.name==t)}appliedDirectivesToDirectiveNodes(){return eA(this.appliedDirectives)}appliedDirectivesToString(){return eD(this.appliedDirectives)}collectVariablesInAppliedDirectives(e){for(let t of this.appliedDirectives)e.collectInArguments(t.arguments())}}i.DirectiveTargetElement=G,i.sourceASTs=function(...e){return e.map(e=>null==e?void 0:e.sourceAST).filter(e=>void 0!==e)};class B{schema(){let e=this.schemaInternal();return(0,a.assert)(e,"requested schema does not exist. Probably because the element is unattached"),e}schemaInternal(){if(this._parent){if(this._parent instanceof ea)return this._parent;if(this._parent instanceof Q)return this._parent.schemaInternal();if(this._parent instanceof G)return this._parent.schema();(0,a.assert)(!1,"unreachable code. parent is of unknown type")}}get parent(){return(0,a.assert)(this._parent,"trying to access non-existent parent"),this._parent}isAttached(){return!!this._parent}setParent(e){(0,a.assert)(!this._parent,"Cannot set parent of an already attached element"),this._parent=e,this.onAttached()}onAttached(){}checkUpdate(){(0,a.assert)(this.isAttached(),()=>`Cannot modify detached element ${this}`)}}class K{get extendedElement(){return this._extendedElement}setExtendedElement(e){(0,a.assert)(!this._extendedElement,"Cannot attached already attached extension"),this._extendedElement=e}}i.Extension=K;class Q extends B{addUnappliedDirective({nameOrDef:e,args:t,extension:i,directive:n}){let r={nameOrDef:e,args:null!=t?t:{},extension:i,directive:n};this._unappliedDirectives?this._unappliedDirectives.push(r):this._unappliedDirectives=[r]}processUnappliedDirectives(){var e;for(let{nameOrDef:t,args:i,extension:n,directive:r}of null!=(e=this._unappliedDirectives)?e:[]){let e=this.applyDirective(t,i);e.setOfExtension(n),e.sourceAST=r}this._unappliedDirectives=void 0}get appliedDirectives(){var e;return null!=(e=this._appliedDirectives)?e:[]}appliedDirectivesOf(e){let t="string"==typeof e?e:e.name;return this.appliedDirectives.filter(e=>e.name==t)}hasAppliedDirective(e){return 0!==this.appliedDirectivesOf(e).length}applyDirective(e,t,n=!1){var r;let a;if("string"==typeof e){this.checkUpdate(),a=new e_(e,null!=t?t:Object.create(null));let n=null!=(r=this.schema().directive(e))?r:this.schema().blueprint.onMissingDirectiveDefinition(this.schema(),a);if(!n)throw this.schema().blueprint.onGraphQLJSValidationError(this.schema(),v.ERRORS.INVALID_GRAPHQL.err(`Unknown directive "@${e}".`));if(Array.isArray(n))throw(0,i.ErrGraphQLValidationFailed)(n)}else this.checkUpdate(e),a=new e_(e.name,null!=t?t:Object.create(null));return B.prototype.setParent.call(a,this),this._appliedDirectives?n?this._appliedDirectives.unshift(a):this._appliedDirectives.push(a):this._appliedDirectives=[a],eN.prototype.addReferencer.call(a.definition,a),this.onModification(),a}removeAppliedDirectives(){this._appliedDirectives&&this._appliedDirectives.concat().forEach(e=>e.remove())}onModification(){let e=this.schemaInternal();e&&ea.prototype.onModification.call(e)}isElementBuiltIn(){return!1}removeTypeReferenceInternal(e){this.removeTypeReference(e)}checkRemoval(){(0,a.assert)(!this.isElementBuiltIn()||ea.prototype.canModifyBuiltIn.call(this.schema()),()=>`Cannot modify built-in ${this}`)}checkUpdate(e){if(super.checkUpdate(),!ea.prototype.canModifyBuiltIn.call(this.schema())){let e=this;for(;e&&e instanceof Q;)(0,a.assert)(!e.isElementBuiltIn(),()=>`Cannot modify built-in (or part of built-in) ${this}`),e=e.parent}if(e&&e.isAttached()){let t=e.schema();(0,a.assert)(!t||t===this.schema(),()=>`Cannot add element ${e} to ${this} as it is attached to another schema`)}}}i.SchemaElement=Q;class q extends Q{constructor(e){super(),this._name=e}get name(){return this._name}}i.NamedSchemaElement=q;class H extends q{constructor(e,t=!1){super(e),this.isBuiltIn=t,this.preserveEmptyDefinition=!1}addReferencer(e){null!=this._referencers||(this._referencers=new Set),this._referencers.add(e)}removeReferencer(e){var t;null==(t=this._referencers)||t.delete(e)}get coordinate(){return this.name}*allChildElements(){}extensions(){var e;return null!=(e=this._extensions)?e:[]}hasExtension(e){var t,i;return null!=(i=null==(t=this._extensions)?void 0:t.includes(e))&&i}newExtension(){return this.addExtension(new K)}addExtension(e){return this.checkUpdate(),this.hasExtension(e)||((0,a.assert)(!e.extendedElement,()=>`Cannot add extension to type ${this}: it is already added to another type`),this._extensions?this._extensions.push(e):this._extensions=[e],K.prototype.setExtendedElement.call(e,this),this.onModification()),e}removeExtensions(){if(this._extensions){for(let e of(this._extensions=void 0,this.appliedDirectives))e.removeOfExtension();this.removeInnerElementsExtensions()}}isIntrospectionType(){return(0,d.isIntrospectionName)(this.name)}hasExtensionElements(){return!!this._extensions}hasNonExtensionElements(){return this.preserveEmptyDefinition||this.appliedDirectives.some(e=>void 0===e.ofExtension())||this.hasNonExtensionInnerElements()}isElementBuiltIn(){return this.isBuiltIn}rename(e){this.checkUpdate();let t=this._name;this._name=e,ea.prototype.renameTypeInternal.call(this._parent,t,e),this.onModification()}remove(){var e;if(!this._parent)return[];this.checkRemoval(),this.onModification(),this.sourceAST=void 0,this.removeAppliedDirectives(),this.removeInnerElements();let t=[];return null==(e=this._referencers)||e.forEach(e=>{Q.prototype.removeTypeReferenceInternal.call(e,this),t.push(e)}),this._referencers=void 0,ea.prototype.removeTypeInternal.call(this._parent,this),this._parent=void 0,t}removeRecursive(){this.remove().forEach(e=>this.removeReferenceRecursive(e))}referencers(){var e;return null!=(e=this._referencers)?e:S}isReferenced(){return!!this._referencers}toString(){return this.name}}class J extends q{get type(){return this._type}set type(e){e?this.checkUpdate(e):this.checkRemoval(),this._type&&ek(this,this._type),this._type=e,e&&eF(this,e)}removeTypeReference(e){(0,a.assert)(this._type&&k(this._type)===e,()=>`Cannot remove reference to type ${e} on ${this} as its type is ${this._type}`),this._type=void 0}}i.NamedSchemaElementWithType=J;class W extends B{ofExtension(){return this._extension}removeOfExtension(){this._extension=void 0}setOfExtension(e){var t;this.checkUpdate(),(0,a.assert)(!e||(null==(t=this._parent)?void 0:t.hasExtension(e)),()=>`Cannot set object as part of the provided extension: it is not an extension of parent ${this.parent}`),this._extension=e}remove(){this.removeInner(),ea.prototype.onModification.call(this.schema()),this._extension=void 0,this._parent=void 0}}class Y{onMissingDirectiveDefinition(e,t){}onDirectiveDefinitionAndSchemaParsed(e){return[]}ignoreParsedField(e,t){return!1}onConstructed(e){}onAddedCoreFeature(e,t){}onInvalidation(e){}onValidation(e){return[]}validationRules(){return h.specifiedSDLRules}onGraphQLJSValidationError(e,t){var i;let n=/^Unknown directive "@(?<directive>[_A-Za-z][_0-9A-Za-z]*)"\.$/.exec(t.message),r=null==(i=null==n?void 0:n.groups)?void 0:i.directive;if(!r)return t;let a=e.allDirectives().map(e=>e.name),s=(0,y.suggestionList)(r,a);return 0===s.length?this.onUnknownDirectiveValidationError(e,r,t):(0,v.withModifiedErrorMessage)(t,`${t.message}${(0,y.didYouMean)(s.map(e=>"@"+e))}`)}onUnknownDirectiveValidationError(e,t,i){return i}applyDirectivesAfterParsing(){return!1}}i.SchemaBlueprint=Y,i.defaultSchemaBlueprint=new Y;class z{constructor(e,t,i,n,r){this.url=e,this.nameInSchema=t,this.directive=i,this.imports=n,this.purpose=r}isFeatureDefinition(e){let t="DirectiveDefinition"===e.kind?"@"+e.name:e.name;return e.name.startsWith(this.nameInSchema+"__")||"DirectiveDefinition"===e.kind&&e.name===this.nameInSchema||!!this.imports.find(e=>{var i;return t===(null!=(i=e.as)?i:e.name)})}directiveNameInSchema(e){return z.directiveNameInSchemaForCoreArguments(this.url,this.nameInSchema,this.imports,e)}static directiveNameInSchemaForCoreArguments(e,t,i,n){var r,a;let s=i.find(e=>"@"===e.name.charAt(0)&&e.name.slice(1)===n);return s?null!=(a=null==(r=s.as)?void 0:r.slice(1))?a:n:n===e.name?t:t+"__"+n}typeNameInSchema(e){var t;let i=this.imports.find(t=>t.name===e);return i?null!=(t=i.as)?t:e:this.nameInSchema+"__"+e}minimumFederationVersion(){var e;return null==(e=(0,g.coreFeatureDefinitionIfKnown)(this.url))?void 0:e.minimumFederationVersion}}i.CoreFeature=z;class X{constructor(e){this.coreItself=e,this.byAlias=new Map,this.byIdentity=new Map,this.byImportName=new Map,this.conflictsByAlias=new a.SetMultiMap,this.add(e);const t=(0,r.findCoreSpecVersion)(e.url);if(!t)throw v.ERRORS.UNKNOWN_LINK_VERSION.err(`Schema uses unknown version ${e.url.version} of the ${e.url.name} spec`);this.coreDefinition=t}getByIdentity(e){var t;return null==(t=this.byIdentity.get(e))?void 0:t[0]}allFeatures(){return[...this.byIdentity.values()].map(([e])=>e)}removeFeature(e){let t=this.byIdentity.get(e);if(t){let[i]=t;this.byIdentity.delete(e);let n=i.nameInSchema;for(let{name:e,as:t}of(this.byAlias.delete(n),i.imports)){let i=null!=t?t:e,r="@"===e.charAt(0)?i.slice(1):i;this.byImportName.delete(i);let a=X.splitPrefixedName(r);if(!a)continue;let[s]=a;if(s===n)continue;let o=this.conflictsByAlias.get(i);o&&(o.delete(i),o.size||this.conflictsByAlias.delete(i))}}}maybeAddFeature(e){var t,i;if((null==(t=e.definition)?void 0:t.name)!==this.coreItself.nameInSchema)return;let n=e.arguments(),a=this.coreDefinition.extractFeatureUrl(n),s=(0,r.extractCoreFeatureImports)(a,e),o=new z(a,null!=(i=n.as)?i:a.name,e,s,n.for);return this.add(o),e.schema().blueprint.onAddedCoreFeature(e.schema(),o),o}add(e){var t,i;let n=e.url.identity;if(this.byIdentity.has(n))throw v.ERRORS.INVALID_LINK_DIRECTIVE_USAGE.err(`Cannot link feature "${n}" since it has already been linked in the schema.`);let r=e.nameInSchema;if((n!==o.tagIdentity||"federation__tag"!==r||0!==e.imports.length)&&(n!==l.inaccessibleIdentity||"federation__inaccessible"!==r||0!==e.imports.length)&&-1!==r.indexOf("__"))throw v.ERRORS.INVALID_LINK_DIRECTIVE_USAGE.err(`Cannot link feature "${n}" as "${r}" since it contains "__". Please rename to a compliant name via "as".`);if("_"===r.charAt(r.length-1))throw v.ERRORS.INVALID_LINK_DIRECTIVE_USAGE.err(`Cannot link feature "${n}" as "${r}" since it ends in "_". Please rename to a compliant name via "as".`);if(!ei.test(r))throw v.ERRORS.INVALID_LINK_DIRECTIVE_USAGE.err(`Cannot link feature "${n}" as "${r}" since it is not a valid GraphQL name. Please rename to a compliant name via "as".`);let s=this.conflictsByAlias.get(r);if(s){let e=null==(i=null==(t=null==s?void 0:s.values())?void 0:t.next())?void 0:i.value;(0,a.assert)(void 0!==e,"Unexpectedly empty conflicts set");let r=this.byImportName.get(e);(0,a.assert)(r,"Unexpectedly cannot find feature for import");let[o,l]=r,u=o.url.identity;this.checkTagInaccessibleConflict(u,n);let c=e!==l?`"${l}" as "${e}"`:`"${l}"`;throw v.ERRORS.INVALID_LINK_DIRECTIVE_USAGE.err(`Cannot import ${c} from feature "${u}" since it can be confused with a namespaced name from another linked feature "${n}". Please rename the import or feature to avoid conflicts via "as".`)}let u="@"+r,c=this.byImportName.get(u);if(c){let[e,t]=c,i=e.url.identity;this.checkTagInaccessibleConflict(i,n);let r=u!==t?`"${t}" as "${u}"`:`"${t}"`;throw v.ERRORS.INVALID_LINK_DIRECTIVE_USAGE.err(`Cannot import ${r} from feature "${i}" since it can be confused with a namespaced name from another linked feature "${n}". Please rename the import or feature to avoid conflicts via "as".`)}let d=this.byAlias.get(r);if(void 0!==d){let e=d.url.identity;throw this.checkTagInaccessibleConflict(e,n),v.ERRORS.INVALID_LINK_DIRECTIVE_USAGE.err(`Cannot link feature ${n} as "${r}" since another feature "${e}" already uses that alias. Please rename the feature to avoid conflicts via "as".`)}let p=new Map;for(let{name:t,as:i}of e.imports){let a=null!=i?i:t,s=a!==t?`"${t}" as "${a}"`:`"${t}"`,o="@"===t.charAt(0),l=o?t.slice(1):t,u=o?a.slice(1):a,c=X.splitPrefixedName(u);if(c){let[e,t]=c;if(e===r){if(t!==l){let e=o?"@"+t:t;throw v.ERRORS.INVALID_LINK_DIRECTIVE_USAGE.err(`Cannot import ${s} from feature "${n}" since it can be confused with the namespaced name for "${e}". Please rename the import to avoid conflicts via "as".`)}}else{let t=this.byAlias.get(e);if(t){let e=t.url.identity;throw this.checkTagInaccessibleConflict(e,n),v.ERRORS.INVALID_LINK_DIRECTIVE_USAGE.err(`Cannot import ${s} from feature "${n}" since it can be confused with a namespaced name from another linked feature "${e}". Please rename the import or feature to avoid conflicts via "as".`)}this.conflictsByAlias.add(e,a)}}if(o)if(u===r){if(l!==e.url.name)throw v.ERRORS.INVALID_LINK_DIRECTIVE_USAGE.err(`Cannot import ${s} from feature "${n}" since it can be confused with the namespaced name for "@${e.url.name}". Please rename the import to avoid conflicts via "as".`)}else{let e=this.byAlias.get(u);if(e){let t=e.url.identity;throw this.checkTagInaccessibleConflict(t,n),v.ERRORS.INVALID_LINK_DIRECTIVE_USAGE.err(`Cannot import ${s} from feature "${n}" since it can be confused with a namespaced name from another linked feature "${t}". Please rename the import or feature to avoid conflicts via "as".`)}}let d=p.get(t);if(void 0===d)p.set(t,a);else if(d!==a)throw v.ERRORS.INVALID_LINK_DIRECTIVE_USAGE.err(`Cannot import ${s} from feature "${n}" since it was previously imported as "${d}". Please remove one of these imports.`);let h=this.byImportName.get(a);if(void 0===h)this.byImportName.set(a,[e,t]);else{let[e,i]=h,r=e.url.identity;if(r!==n)throw this.checkTagInaccessibleConflict(r,n),v.ERRORS.INVALID_LINK_DIRECTIVE_USAGE.err(`Cannot import ${s} from feature "${n}" since it was previously imported from feature "${r}". Please rename the import to avoid conflicts via "as".`);if(i!==t)throw v.ERRORS.INVALID_LINK_DIRECTIVE_USAGE.err(`Cannot import ${s} from feature "${n}" since it was previously imported for "${i}". Please rename the import to avoid conflicts via "as".`)}}this.byAlias.set(r,e),this.byIdentity.set(n,[e,p])}isAliasValid(e,t,i){if(-1!==e.indexOf("__")||"_"===e.charAt(e.length-1)||!en.test(e))return!1;for(let[n,r]of i.entries())if(t===n){if(r.self.has(e))return!1}else if(r.other.has(e))return!1;return!this.byAlias.has(e)}static computeAliasConflicts(e,t){let i=new Map;for(let{url:n,alias:r,imports:a}of e){t.add(r);let e=new Set,s=new Set;for(let{name:i,as:r}of a){let a=null!=r?r:i,o="@"===i.charAt(0),l=o?i.slice(1):i,u=o?a.slice(1):a;t.add(u);let c=X.splitPrefixedName(u);if(c){let[t,i]=c;i!==l&&e.add(t),s.add(t)}o&&(l!==n.name&&e.add(u),s.add(u))}i.set(n.identity,{self:e,other:s})}let n=null,r=0;return{importConflictsByIdentity:i,computeUniqueAlias:e=>{if(null===n){let e={children:new Map,parent:null,char:""};for(let i of t){let t=e;for(let e of i){let i=t.children.get(e);i||(i={children:new Map,parent:t,char:e},t.children.set(e,i)),t=i}}let i=[e],r=0;for(;null===n;){let e=0===r?"_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ":"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",t=i[r++];for(let r of e){let e=t.children.get(r);if(e)i.push(e);else{let e=[r];for(let i=t;null==i?void 0:i.parent;i=i.parent)e.push(i.char);n=e.reverse().join("");break}}}}let i=e.replace(/[^a-zA-Z]/g,"");return`${n}${r++}${i}`}}}checkTagInaccessibleConflict(e,t){let i="https://specs.apollo.dev/federation",n=new Set([e,t]);if(!n.has(i))return;let[r,a]=n.has(o.tagIdentity)?["tag",o.tagIdentity]:n.has(l.inaccessibleIdentity)?["inaccessible",l.inaccessibleIdentity]:[void 0,void 0];if(r&&a)throw v.ERRORS.INVALID_LINK_DIRECTIVE_USAGE.err(`Please import "@${r}" from the feature "${i}" instead of using "${a}" to avoid potential unexpected behavior in the future.`)}sourceFeature(e){let t=e instanceof eN||e instanceof e_,i=t?"@"+e.name:e.name,n=this.byImportName.get(i);if(n){let[e,i]=n;return{feature:e,nameInFeature:t?i.slice(1):i,isImported:!0}}let r=this.sourceDefaultName(t,e.name);if(!r)return;let[a,s]=r;return{feature:a,nameInFeature:void 0===this.getImportName(a,t?"@"+s:s)?s:null,isImported:!1}}validateNoShadowingImports(e){let t=[];for(let i of[...e.allTypes(),...e.allDirectives()]){let e=this.getShadowingImport(i);if(!e||!(i instanceof eN?0!==i.applications().size:this.getReferencingRootElements(i).some(e=>"SchemaDefinition"===e.kind||!this.getShadowingImport(e))))continue;let{feature:n,importInSpec:r,importInSchema:a}=e,s=a!==r?`"${r}" as "${a}"`:`"${r}"`;t.push(v.ERRORS.INVALID_LINK_DIRECTIVE_USAGE.err(`Cannot import ${s} from feature "${n.url.identity}" since there's a used definition for the namespaced name "${i.coordinate}". Please switch usages of the namespaced name to the import name and remove the definition.`))}return t}getShadowingImport(e){let t=e instanceof eN||e instanceof e_,i=this.sourceDefaultName(t,e.name);if(!i)return;let n=t?"@"+e.name:e.name,[r,a]=i,s=t?"@"+a:a,o=this.getImportName(r,s);return void 0!==o&&o!==n?{feature:r,importInSpec:s,importInSchema:o}:void 0}getReferencingRootElements(e){let t=[];for(let i of e.referencers())switch(i.kind){case"ObjectType":case"InterfaceType":case"UnionType":case"SchemaDefinition":t.push(i);break;case"FieldDefinition":case"InputFieldDefinition":t.push(i.parent);break;case"ArgumentDefinition":let e=i.parent;switch(e.kind){case"DirectiveDefinition":t.push(e);break;case"FieldDefinition":t.push(e.parent);break;default:(0,a.assertUnreachable)(e)}break;default:(0,a.assertUnreachable)(i)}return t}getImportName(e,t){var i,n;return null==(n=null==(i=this.byIdentity.get(e.url.identity))?void 0:i[1])?void 0:n.get(t)}sourceDefaultName(e,t){let i=X.splitPrefixedName(t);if(i){let[e,t]=i,n=this.byAlias.get(e);if(n)return[n,t]}if(!e)return;let n=this.byAlias.get(t);return n?[n,n.url.name]:void 0}static splitPrefixedName(e){let t=e.indexOf("__");return -1!==t?[e.slice(0,t),e.slice(t+2)]:void 0}}i.CoreFeatures=X;let Z=["Int","Float","String","Boolean","ID"],ee=Z.map(e=>(0,m.createScalarTypeSpecification)({name:e})),et=[(0,m.createDirectiveSpecification)({name:"include",locations:[n.DirectiveLocation.FIELD,n.DirectiveLocation.FRAGMENT_SPREAD,n.DirectiveLocation.INLINE_FRAGMENT],args:[{name:"if",type:e=>new eT(e.booleanType())}]}),(0,m.createDirectiveSpecification)({name:"skip",locations:[n.DirectiveLocation.FIELD,n.DirectiveLocation.FRAGMENT_SPREAD,n.DirectiveLocation.INLINE_FRAGMENT],args:[{name:"if",type:e=>new eT(e.booleanType())}]}),(0,m.createDirectiveSpecification)({name:"deprecated",locations:[n.DirectiveLocation.FIELD_DEFINITION,n.DirectiveLocation.ENUM_VALUE,n.DirectiveLocation.ARGUMENT_DEFINITION,n.DirectiveLocation.INPUT_FIELD_DEFINITION],args:[{name:"reason",type:e=>e.stringType(),defaultValue:"No longer supported"}]}),(0,m.createDirectiveSpecification)({name:"specifiedBy",locations:[n.DirectiveLocation.SCALAR],args:[{name:"url",type:e=>new eT(e.stringType())}]}),(0,m.createDirectiveSpecification)({name:"defer",locations:[n.DirectiveLocation.FRAGMENT_SPREAD,n.DirectiveLocation.INLINE_FRAGMENT],args:[{name:"label",type:e=>e.stringType()},{name:"if",type:e=>new eT(e.booleanType()),defaultValue:!0}]}),(0,m.createDirectiveSpecification)({name:"stream",locations:[n.DirectiveLocation.FIELD],args:[{name:"label",type:e=>e.stringType()},{name:"initialCount",type:e=>e.intType(),defaultValue:0},{name:"if",type:e=>new eT(e.booleanType()),defaultValue:!0}]})],ei=/^[_A-Za-z][_0-9A-Za-z.-]*$/,en=/^[_A-Za-z][_0-9A-Za-z]*$/,er=/^@?[_A-Za-z][_0-9A-Za-z]*(\.[_A-Za-z][_0-9A-Za-z]*)?(\([_A-Za-z][_0-9A-Za-z]*:\))?$/;class ea{constructor(e=i.defaultSchemaBlueprint,t={}){this.blueprint=e,this.config=t,this._builtInTypes=new a.MapWithCachedArrays,this._types=new a.MapWithCachedArrays,this._builtInDirectives=new a.MapWithCachedArrays,this._directives=new a.MapWithCachedArrays,this.isConstructed=!1,this.isValidated=!1,this._schemaDefinition=new eo,B.prototype.setParent.call(this._schemaDefinition,this),ee.forEach(e=>e.checkOrAdd(this,void 0,!0)),et.forEach(e=>e.checkOrAdd(this,void 0,!0)),e.onConstructed(this),this.isConstructed=!0}canModifyBuiltIn(){return!this.isConstructed}runWithBuiltInModificationAllowed(e){let t=this.isConstructed;this.isConstructed=!1,e(),this.isConstructed=t}renameTypeInternal(e,t){this._types.set(t,this._types.get(e)),this._types.delete(e)}removeTypeInternal(e){this._types.delete(e.name)}removeDirectiveInternal(e){this._directives.delete(e.name)}markAsCoreSchema(e){this._coreFeatures=new X(e)}unmarkAsCoreSchema(){this._coreFeatures=void 0}onModification(){this.isConstructed&&(this.invalidate(),this.cachedDocument=void 0,this.apiSchema=void 0)}isCoreSchema(){return void 0!==this.coreFeatures}get coreFeatures(){return this._coreFeatures}toAST(){var e;if(!this.cachedDocument){let t=(0,n.parse)((0,u.printSchema)(this),{noLocation:!0});if(!(null!=(e=this.config.cacheAST)&&e))return t;this.cachedDocument=t}return this.cachedDocument}toAPISchema(){if(!this.apiSchema){this.validate();let e=this.clone(void 0,!1);for(let t of["defer","stream"]){let i=e.directive(t);i&&!i.isBuiltIn&&i.removeRecursive()}(0,l.removeInaccessibleElements)(e),(0,r.removeAllCoreFeatures)(e),(0,a.assert)(!e.isCoreSchema(),"The API schema shouldn't be a core schema"),e.validate(),this.apiSchema=e}return this.apiSchema}emptyASTDefinitionsForExtensionsWithoutDefinition(){let e=[];if(this.schemaDefinition.hasExtensionElements()&&!this.schemaDefinition.hasNonExtensionElements()){let t={kind:n.Kind.SCHEMA_DEFINITION,operationTypes:[]};e.push(t)}for(let t of this.types())if(t.hasExtensionElements()&&!t.hasNonExtensionElements()){let i={kind:t.astDefinitionKind,name:{kind:n.Kind.NAME,value:t.name}};e.push(i)}return e}toGraphQLJSSchema(e){var t,i;let r=null!=(t=null==e?void 0:e.includeDefer)&&t,a=null!=(i=null==e?void 0:e.includeStream)&&i,s=this.toAST(),o=this.emptyASTDefinitionsForExtensionsWithoutDefinition();r&&o.push(this.deferDirective().toAST()),a&&o.push(this.streamDirective().toAST()),o.length>0&&(s={kind:n.Kind.DOCUMENT,definitions:s.definitions.concat(o)});let l=(0,n.buildASTSchema)(s);if(o.length>0)for(let e of o)switch(e.kind){case n.Kind.SCHEMA_DEFINITION:l.astNode=void 0;break;case n.Kind.SCALAR_TYPE_DEFINITION:case n.Kind.OBJECT_TYPE_DEFINITION:case n.Kind.INTERFACE_TYPE_DEFINITION:case n.Kind.ENUM_TYPE_DEFINITION:case n.Kind.UNION_TYPE_DEFINITION:case n.Kind.INPUT_OBJECT_TYPE_DEFINITION:let t=l.getType(e.name.value);t&&(t.astNode=void 0)}return l}get schemaDefinition(){return this._schemaDefinition}types(){return this._types.values()}interfaceTypes(){return F(this.types(),"InterfaceType")}objectTypes(){return F(this.types(),"ObjectType")}unionTypes(){return F(this.types(),"UnionType")}scalarTypes(){return F(this.types(),"ScalarType")}inputTypes(){return F(this.types(),"InputObjectType")}enumTypes(){return F(this.types(),"EnumType")}builtInTypes(e=!1){let t=this._builtInTypes.values();return e?t:t.filter(e=>!this.isShadowedBuiltInType(e))}isShadowedBuiltInType(e){return e.isBuiltIn&&this._types.has(e.name)}allTypes(){return this.builtInTypes().concat(this.types())}type(e){return this._types.get(e)||this._builtInTypes.get(e)}typeOfKind(e,t){let i=this.type(e);return i&&i.kind===t?i:void 0}intType(){return this._builtInTypes.get("Int")}floatType(){return this._builtInTypes.get("Float")}stringType(){return this._builtInTypes.get("String")}booleanType(){return this._builtInTypes.get("Boolean")}idType(){return this._builtInTypes.get("ID")}builtInScalarTypes(){return[this.intType(),this.floatType(),this.stringType(),this.booleanType(),this.idType()]}addType(e){let t=this.type(e.name);if(t&&(0,a.assert)(t.isBuiltIn,()=>`Type ${e} already exists in this schema`),e.isAttached())return(0,a.assert)(e.parent==this,()=>`Cannot add type ${e} to this schema; it is already attached to another schema`),e;e.isBuiltIn?((0,a.assert)(!this.isConstructed,`Cannot add built-in ${e} to this schema (built-ins can only be added at schema construction time)`),this._builtInTypes.set(e.name,e)):this._types.set(e.name,e),B.prototype.setParent.call(e,this);let i=function(e){if("ObjectType"===e.kind)switch(e.name){case"Query":return"query";case"Mutation":return"mutation";case"Subscription":return"subscription";default:return}}(e);return i&&!this.schemaDefinition.root(i)&&this.schemaDefinition.setRoot(i,e),this.onModification(),e}directives(){return this._directives.values()}builtInDirectives(e=!1){return e?this._builtInDirectives.values():this._builtInDirectives.values().filter(e=>!this.isShadowedBuiltInDirective(e))}allDirectives(){return this.builtInDirectives().concat(this.directives())}isShadowedBuiltInDirective(e){return e.isBuiltIn&&this._directives.has(e.name)}directive(e){return this._directives.get(e)||this.builtInDirective(e)}builtInDirective(e){return this._builtInDirectives.get(e)}*allNamedSchemaElement(){for(let e of this.types())yield e,yield*e.allChildElements();for(let e of this.directives())yield e,yield*e.arguments()}*allSchemaElement(){yield this._schemaDefinition,yield*this.allNamedSchemaElement()}addDirectiveDefinition(e){let t="string"==typeof e?new eN(e):e,i=this.directive(t.name);return((0,a.assert)(!i||i.isBuiltIn,()=>`Directive ${t} already exists in this schema`),t.isAttached())?(0,a.assert)(t.parent==this,()=>`Cannot add directive ${t} to this schema; it is already attached to another schema`):(t.isBuiltIn?((0,a.assert)(!this.isConstructed,()=>`Cannot add built-in ${t} to this schema (built-ins can only be added at schema construction time)`),this._builtInDirectives.set(t.name,t)):this._directives.set(t.name,t),B.prototype.setParent.call(t,this),this.onModification()),t}invalidate(){this.isValidated&&this.blueprint.onInvalidation(this),this.isValidated=!1}assumeValid(){this.runWithBuiltInModificationAllowed(()=>{(0,d.addIntrospectionFields)(this)}),this.isValidated=!0}validate(){var e,t;if(this.isValidated)return;this.runWithBuiltInModificationAllowed(()=>{(0,d.addIntrospectionFields)(this)});let n=(0,p.validateSDL)(this.toAST(),void 0,this.blueprint.validationRules()).map(e=>this.blueprint.onGraphQLJSValidationError(this,e));if(0===(n=(n=n.concat((0,f.validateSchema)(this))).concat(null!=(t=null==(e=this.coreFeatures)?void 0:e.validateNoShadowingImports(this))?t:[])).length&&this.runWithBuiltInModificationAllowed(()=>{n=this.blueprint.onValidation(this)}),n.length>0)throw(0,i.ErrGraphQLValidationFailed)(n);this.isValidated=!0}clone(e,t=!0){let i=new ea(null!=e?e:this.blueprint);return function(e,t,i){for(let i of ex(e,t))t.addType(eP(i.kind,i.name));for(let i of eM(e,t))t.addDirectiveDefinition(i.name);for(let i of eM(e,t))eK(i,t.directive(i.name));for(let n of(function(e,t){t.preserveEmptyDefinition=e.preserveEmptyDefinition;let i=eU(e,t);for(let n of e.roots())e$(i,n,t.setRoot(n.rootKind,n.type.name));for(let n of e.appliedDirectives)e$(i,n,eV(n,t));t.description=e.description,t.sourceAST=e.sourceAST}(e.schemaDefinition,t.schemaDefinition),ex(e,t)))!function(e,t,i){t.preserveEmptyDefinition=e.preserveEmptyDefinition;let n=eU(e,t);for(let i of e.appliedDirectives)e$(n,i,eV(i,t));switch(t.description=e.description,t.sourceAST=e.sourceAST,e.kind){case"ObjectType":case"InterfaceType":for(let r of e.fields()){let e=t.addField(new eS(r.name));e$(n,r,e),function(e,t,i){let n=eG(e.type,t.schema());for(let r of(t.type=n,e.arguments())){let e=eG(r.type,t.schema());eB({source:r,dest:t.addArgument(r.name,e),cloneJoinDirectives:i})}ej(e,t,i),t.description=e.description,t.sourceAST=e.sourceAST}(r,e,i)}for(let i of e.interfaceImplementations()){let e=t.addImplementedInterface(i.interface.name);e$(n,i,e)}break;case"UnionType":for(let i of e.members()){let e=t.addType(i.type.name);e$(n,i,e)}break;case"EnumType":for(let r of e.values){let e=t.addValue(r.name);e.description=r.description,e$(n,r,e),ej(r,e,i)}break;case"InputObjectType":for(let r of e.fields()){let e=t.addField(new eE(r.name));e$(n,r,e),function(e,t,i){let n=eG(e.type,t.schema());t.type=n,t.defaultValue=e.defaultValue,ej(e,t,i),t.description=e.description,t.sourceAST=e.sourceAST}(r,e,i)}}}(n,t.type(n.name),i)}(this,i,t),this.isValidated&&i.assumeValid(),i}getBuiltInDirective(e){let t=this.directive(e);return(0,a.assert)(t,`The provided schema has not be built with the ${e} directive built-in`),t}includeDirective(){return this.getBuiltInDirective("include")}skipDirective(){return this.getBuiltInDirective("skip")}deprecatedDirective(){return this.getBuiltInDirective("deprecated")}specifiedByDirective(){return this.getBuiltInDirective("specifiedBy")}deferDirective(){return this.getBuiltInDirective("defer")}streamDirective(){return this.getBuiltInDirective("stream")}elementByCoordinate(e){if(!e.match(er))throw v.ERRORS.INVALID_GRAPHQL.err(`Invalid argument "${e}: it is not a syntactically valid graphQL coordinate."`);let t=e.indexOf("("),i=t<0?e:e.slice(0,t),n=t<0?void 0:e.slice(t+1,e.length-2),r=i.split("."),a=r[0],s=r[1];if(a.startsWith("@")){if(s)throw v.ERRORS.INVALID_GRAPHQL.err(`Invalid argument "${e}: it is not a syntactically valid graphQL coordinate."`);let t=this.directive(a.slice(1));return n?null==t?void 0:t.argument(n):t}{let t=this.type(a);if(!t||!s)return t;switch(t.kind){case"ObjectType":case"InterfaceType":let i=t.field(s);return n?null==i?void 0:i.argument(n):i;case"InputObjectType":if(n)throw v.ERRORS.INVALID_GRAPHQL.err(`Invalid argument "${e}: it is not a syntactically valid graphQL coordinate."`);return t.field(s);case"EnumType":if(n)throw v.ERRORS.INVALID_GRAPHQL.err(`Invalid argument "${e}: it is not a syntactically valid graphQL coordinate."`);return t.value(s);default:throw v.ERRORS.INVALID_GRAPHQL.err(`Invalid argument "${e}: it is not a syntactically valid graphQL coordinate."`)}}}}i.Schema=ea;class es extends W{constructor(e,t){super(),this.rootKind=e,this.type=t}isDefaultRootName(){return E(this.rootKind)==this.type.name}removeInner(){eo.prototype.removeRootType.call(this._parent,this)}}i.RootType=es;class eo extends Q{constructor(){super(...arguments),this.kind="SchemaDefinition",this._roots=new a.MapWithCachedArrays,this.preserveEmptyDefinition=!1}roots(){return this._roots.values()}applyDirective(e,t,i=!1){var n,a;let s=super.applyDirective(e,t,i),o=this.schema(),l=o.coreFeatures;if((0,r.isCoreSpecDirectiveApplication)(s)){if(l)throw v.ERRORS.INVALID_LINK_DIRECTIVE_USAGE.err("Invalid duplicate application of @core/@link");let e=s.arguments(),t=r.FeatureUrl.parse(null!=(n=e.url)?n:e.feature),i=(0,r.extractCoreFeatureImports)(t,s),u=new z(t,null!=(a=e.as)?a:t.name,s,i,e.for);ea.prototype.markAsCoreSchema.call(o,u),this.appliedDirectives.filter(e=>e!==s).forEach(e=>X.prototype.maybeAddFeature.call(o.coreFeatures,e))}else l&&X.prototype.maybeAddFeature.call(l,s);return this.onModification(),s}root(e){return this._roots.get(e)}rootType(e){var t;return null==(t=this.root(e))?void 0:t.type}setRoot(e,t){let i;if("string"==typeof t){this.checkUpdate();let n=this.schema().type(t);if(n){if("ObjectType"!=n.kind)throw v.ERRORS.INVALID_GRAPHQL.err(`${E(e)} root type must be an Object type${"query"===e?"":" if provided"}, it cannot be set to ${t} (an ${n.kind}).`)}else throw v.ERRORS.INVALID_GRAPHQL.err(`Cannot set schema ${e} root to unknown type ${t}`);i=new es(e,n)}else this.checkUpdate(t),i=new es(e,t);let n=this._roots.get(e);return n&&ek(this,n.type),this._roots.set(e,i),B.prototype.setParent.call(i,this),eF(this,i.type),this.onModification(),i}extensions(){var e;return null!=(e=this._extensions)?e:[]}hasExtension(e){var t,i;return null!=(i=null==(t=this._extensions)?void 0:t.includes(e))&&i}newExtension(){return this.addExtension(new K)}addExtension(e){return this.checkUpdate(),this.hasExtension(e)||((0,a.assert)(!e.extendedElement,"Cannot add extension to this schema: extension is already added to another schema"),this._extensions?this._extensions.push(e):this._extensions=[e],K.prototype.setExtendedElement.call(e,this),this.onModification()),e}hasExtensionElements(){return!!this._extensions}hasNonExtensionElements(){return this.preserveEmptyDefinition||this.appliedDirectives.some(e=>void 0===e.ofExtension())||this.roots().some(e=>void 0===e.ofExtension())}removeRootType(e){this._roots.delete(e.rootKind),ek(this,e.type)}removeTypeReference(e){for(let t of this.roots())t.type==e&&this._roots.delete(t.rootKind)}toString(){return`schema[${this._roots.keys().join(", ")}]`}}i.SchemaDefinition=eo;class el extends H{constructor(){super(...arguments),this.kind="ScalarType",this.astDefinitionKind=n.Kind.SCALAR_TYPE_DEFINITION}removeTypeReference(e){(0,a.assert)(!1,`Scalar type ${this} can't reference other types; shouldn't be asked to remove reference to ${e}`)}hasNonExtensionInnerElements(){return!1}removeInnerElementsExtensions(){}removeInnerElements(){}removeReferenceRecursive(e){e.remove()}}i.ScalarType=el;class eu extends W{constructor(e){super(),this.interface=e}removeInner(){ec.prototype.removeInterfaceImplementation.call(this._parent,this.interface)}toString(){return`'implements ${this.interface}'`}}i.InterfaceImplementation=eu;class ec extends H{constructor(){super(...arguments),this._fields=new a.MapWithCachedArrays}onAttached(){ea.prototype.runWithBuiltInModificationAllowed.call(this.schema(),()=>{this.addField(new eS(i.typenameFieldName,!0),new eT(this.schema().stringType()))})}removeFieldInternal(e){this._fields.delete(e.name),this._cachedNonBuiltInFields=void 0}interfaceImplementations(){var e,t;return null!=(t=null==(e=this._interfaceImplementations)?void 0:e.values())?t:[]}interfaceImplementation(e){return this._interfaceImplementations?this._interfaceImplementations.get("string"==typeof e?e:e.name):void 0}interfaces(){return this.interfaceImplementations().map(e=>e.interface)}implementsInterface(e){var t,i;return null!=(i=null==(t=this._interfaceImplementations)?void 0:t.has("string"==typeof e?e:e.name))&&i}addImplementedInterface(e){var t;let i;if(e instanceof eu)this.checkUpdate(e),i=e;else{let t;if("string"==typeof e){this.checkUpdate();let i=this.schema().type(e);if(i){if("InterfaceType"!=i.kind)throw v.ERRORS.INVALID_GRAPHQL.err(`Cannot implement non-interface type ${e} (of type ${i.kind})`)}else throw v.ERRORS.INVALID_GRAPHQL.err(`Cannot implement unknown type ${e}`);t=i}else t=e;i=new eu(t)}let n=null==(t=this._interfaceImplementations)?void 0:t.get(i.interface.name);return n||(this._interfaceImplementations||(this._interfaceImplementations=new a.MapWithCachedArrays),this._interfaceImplementations.set(i.interface.name,i),eF(this,i.interface),B.prototype.setParent.call(i,this),this.onModification(),i)}fields(){return this._cachedNonBuiltInFields||(this._cachedNonBuiltInFields=this._fields.values().filter(e=>!e.isBuiltIn)),this._cachedNonBuiltInFields}hasFields(){return this.fields().length>0}builtInFields(){return this.allFields().filter(e=>e.isBuiltIn)}allFields(){return this._fields.values()}field(e){return this._fields.get(e)}typenameField(){return this.field(i.typenameFieldName)}addField(e,t){let i;if("string"==typeof e?(this.checkUpdate(),i=new eS(e)):(this.checkUpdate(e),i=e),this.field(i.name))throw v.ERRORS.INVALID_GRAPHQL.err(`Field ${i.name} already exists on ${this}`);if(t&&!w(t))throw v.ERRORS.INVALID_GRAPHQL.err(`Invalid input type ${t} for field ${i.name}: object and interface field types should be output types.`);return this._fields.set(i.name,i),this._cachedNonBuiltInFields=void 0,B.prototype.setParent.call(i,this),t&&(i.type=t),this.onModification(),i}*allChildElements(){for(let e of this._fields.values())yield e,yield*e.arguments()}removeInterfaceImplementation(e){var t;null==(t=this._interfaceImplementations)||t.delete(e.name),ek(this,e)}removeTypeReference(e){var t;null==(t=this._interfaceImplementations)||t.delete(e.name)}removeInnerElements(){for(let e of this.interfaceImplementations())e.remove();for(let e of this.allFields())e.isBuiltIn?eS.prototype.removeParent.call(e):e.remove()}hasNonExtensionInnerElements(){return this.interfaceImplementations().some(e=>void 0===e.ofExtension())||this.fields().some(e=>void 0===e.ofExtension())}removeInnerElementsExtensions(){this.interfaceImplementations().forEach(e=>e.removeOfExtension()),this.fields().forEach(e=>e.removeOfExtension())}}class ed extends ec{constructor(){super(...arguments),this.kind="ObjectType",this.astDefinitionKind=n.Kind.OBJECT_TYPE_DEFINITION}isRootType(){return this.schema().schemaDefinition.roots().some(e=>e.type==this)}isQueryRootType(){var e;return(null==(e=this.schema().schemaDefinition.root("query"))?void 0:e.type)===this}isSubscriptionRootType(){var e;return(null==(e=this.schema().schemaDefinition.root("subscription"))?void 0:e.type)===this}removeReferenceRecursive(e){switch(e.kind){case"FieldDefinition":e.removeRecursive();break;case"UnionType":0===e.membersCount()&&e.removeRecursive()}}unionsWhereMember(){var e;let t=[];return null==(e=this._referencers)||e.forEach(e=>{e instanceof H&&R(e)&&t.push(e)}),t}}i.ObjectType=ed;class ep extends ec{constructor(){super(...arguments),this.kind="InterfaceType",this.astDefinitionKind=n.Kind.INTERFACE_TYPE_DEFINITION}allImplementations(){let e=[];return this.referencers().forEach(t=>{("ObjectType"===t.kind||"InterfaceType"===t.kind)&&e.push(t)}),e}possibleRuntimeTypes(){return this.allImplementations().filter(e=>"ObjectType"===e.kind)}isPossibleRuntimeType(e){let t="string"==typeof e?e:e.name;return this.possibleRuntimeTypes().some(e=>e.name==t)}removeReferenceRecursive(e){"FieldDefinition"===e.kind&&e.removeRecursive()}}i.InterfaceType=ep;class eh extends W{constructor(e){super(),this.type=e}removeInner(){ef.prototype.removeMember.call(this._parent,this.type)}}i.UnionMember=eh;class ef extends H{constructor(){super(...arguments),this.kind="UnionType",this.astDefinitionKind=n.Kind.UNION_TYPE_DEFINITION,this._members=new a.MapWithCachedArrays}onAttached(){ea.prototype.runWithBuiltInModificationAllowed.call(this.schema(),()=>{this._typenameField=new eS(i.typenameFieldName,!0),B.prototype.setParent.call(this._typenameField,this),this._typenameField.type=new eT(this.schema().stringType())})}types(){return this.members().map(e=>e.type)}members(){return this._members.values()}membersCount(){return this._members.size}hasTypeMember(e){return this._members.has("string"==typeof e?e:e.name)}addType(e){let t;if(e instanceof eh)this.checkUpdate(e),t=e;else{let i;if("string"==typeof e){this.checkUpdate();let t=this.schema().type(e);if(t){if("ObjectType"!=t.kind)throw v.ERRORS.INVALID_GRAPHQL.err(`Cannot add non-object type ${e} (of type ${t.kind}) as member of union type ${this.name}`)}else throw v.ERRORS.INVALID_GRAPHQL.err(`Cannot add unknown type ${e} as member of union type ${this.name}`);i=t}else this.checkUpdate(e),i=e;t=new eh(i)}let i=this._members.get(t.type.name);return i||(this._members.set(t.type.name,t),B.prototype.setParent.call(t,this),eF(this,t.type),this.onModification(),t)}clearTypes(){for(let e of this.types())this.removeMember(e);this.onModification()}field(e){if(e===i.typenameFieldName&&this._typenameField)return this._typenameField}typenameField(){return this._typenameField}removeMember(e){this._members.delete(e.name),ek(this,e)}removeTypeReference(e){this._members.delete(e.name)}removeInnerElements(){for(let e of this.members())e.remove()}hasNonExtensionInnerElements(){return this.members().some(e=>void 0===e.ofExtension())}removeReferenceRecursive(e){e.removeRecursive()}removeInnerElementsExtensions(){this.members().forEach(e=>e.removeOfExtension())}}i.UnionType=ef;class em extends H{constructor(){super(...arguments),this.kind="EnumType",this.astDefinitionKind=n.Kind.ENUM_TYPE_DEFINITION,this._values=new Map}get values(){return Array.from(this._values.values())}value(e){return this._values.get(e)}addValue(e){let t;"string"==typeof e?(this.checkUpdate(),t=new eb(e)):(this.checkUpdate(e),t=e);let i=this.value(t.name);return i||(this._values.set(t.name,t),B.prototype.setParent.call(t,this),this.onModification(),t)}removeTypeReference(e){(0,a.assert)(!1,`Eum type ${this} can't reference other types; shouldn't be asked to remove reference to ${e}`)}removeValueInternal(e){this._values.delete(e.name)}removeInnerElements(){for(let e of this.values)e.remove()}hasNonExtensionInnerElements(){return Array.from(this._values.values()).some(e=>void 0===e.ofExtension())}removeReferenceRecursive(e){e.removeRecursive()}removeInnerElementsExtensions(){for(let e of this._values.values())e.removeOfExtension()}}i.EnumType=em;class ey extends H{constructor(){super(...arguments),this.kind="InputObjectType",this.astDefinitionKind=n.Kind.INPUT_OBJECT_TYPE_DEFINITION,this._fields=new Map}fields(){return this._cachedFieldsArray||(this._cachedFieldsArray=(0,a.mapValues)(this._fields)),this._cachedFieldsArray}field(e){return this._fields.get(e)}addField(e,t){let i="string"==typeof e?new eE(e):e;if(this.checkUpdate(i),this.field(i.name))throw v.ERRORS.INVALID_GRAPHQL.err(`Field ${i.name} already exists on ${this}`);if(t&&!L(t))throw v.ERRORS.INVALID_GRAPHQL.err(`Invalid output type ${t} for field ${i.name}: input field types should be input types.`);return this._fields.set(i.name,i),this._cachedFieldsArray=void 0,B.prototype.setParent.call(i,this),"string"==typeof e&&t&&(i.type=t),this.onModification(),i}hasFields(){return this._fields.size>0}*allChildElements(){yield*this._fields.values()}removeTypeReference(e){(0,a.assert)(!1,`Input Object type ${this} can't reference other types; shouldn't be asked to remove reference to ${e}`)}removeInnerElements(){for(let e of this.fields())e.remove()}removeFieldInternal(e){this._fields.delete(e.name),this._cachedFieldsArray=void 0}hasNonExtensionInnerElements(){return this.fields().some(e=>void 0===e.ofExtension())}removeReferenceRecursive(e){"ArgumentDefinition"===e.kind?e.parent().removeRecursive():e.removeRecursive()}removeInnerElementsExtensions(){this.fields().forEach(e=>e.removeOfExtension())}}i.InputObjectType=ey;class ev{constructor(e){this._type=e,(0,a.assert)(this._type,"Cannot wrap an undefined/null type")}schema(){return this.baseType().schema()}isAttached(){return this.baseType().isAttached()}get ofType(){return this._type}baseType(){return k(this._type)}}class eg extends ev{constructor(e){super(e),this.kind="ListType"}toString(){return`[${this.ofType}]`}}i.ListType=eg;class eT extends ev{constructor(e){super(e),this.kind="NonNullType"}toString(){return`${this.ofType}!`}}i.NonNullType=eT;class eS extends J{constructor(e,t=!1){super(e),this.isBuiltIn=t,this.kind="FieldDefinition"}isElementBuiltIn(){return this.isBuiltIn}get coordinate(){let e=this._parent;return`${void 0==e?"<detached>":e.coordinate}.${this.name}`}hasArguments(){return!!this._args&&this._args.size>0}arguments(){var e,t;return null!=(t=null==(e=this._args)?void 0:e.values())?t:[]}argument(e){var t;return null==(t=this._args)?void 0:t.get(e)}addArgument(e,t,i){let n;"string"==typeof e?(this.checkUpdate(),(n=new eI(e)).defaultValue=i):(this.checkUpdate(e),n=e);let r=this.argument(n.name);if(r){if(t&&r.type&&!(0,c.sameType)(t,r.type))throw v.ERRORS.INVALID_GRAPHQL.err(`Argument ${n.name} already exists on field ${this.name} with a different type (${r.type})`);if(i&&(!r.defaultValue||!(0,s.valueEquals)(i,r.defaultValue)))throw v.ERRORS.INVALID_GRAPHQL.err(`Argument ${n.name} already exists on field ${this.name} with a different default value (${(0,s.valueToString)(r.defaultValue)})`);return r}if(t&&!L(t))throw v.ERRORS.INVALID_GRAPHQL.err(`Invalid output type ${t} for argument ${n.name} of ${this}: arguments should be input types.`);return this._args||(this._args=new a.MapWithCachedArrays),this._args.set(n.name,n),B.prototype.setParent.call(n,this),"string"==typeof e&&(n.type=t),this.onModification(),n}ofExtension(){return this._extension}removeOfExtension(){this._extension=void 0}setOfExtension(e){var t;this.checkUpdate(),(0,a.assert)(!e||(null==(t=this._parent)?void 0:t.hasExtension(e)),()=>`Cannot mark field ${this.name} as part of the provided extension: it is not an extension of field parent type ${this.parent}`),this._extension=e,this.onModification()}isIntrospectionField(){return(0,d.isIntrospectionName)(this.name)}isSchemaIntrospectionField(){return d.introspectionFieldNames.includes(this.name)}removeArgumentInternal(e){this._args&&this._args.delete(e)}removeParent(){this._parent=void 0}isDeprecated(){return this.hasAppliedDirective("deprecated")}remove(){if(!this._parent)return[];for(let e of(this.checkRemoval(),this.onModification(),this.sourceAST=void 0,this.type=void 0,this.removeAppliedDirectives(),this.arguments()))e.remove();return ec.prototype.removeFieldInternal.call(this._parent,this),this._parent=void 0,this._extension=void 0,[]}removeRecursive(){let e=this._parent;this.remove(),e&&!R(e)&&0===e.fields().length&&e.removeRecursive()}toString(){let e=this.hasArguments()?"("+this.arguments().map(e=>e.toString()).join(", ")+")":"";return`${this.name}${e}: ${this.type}`}}i.FieldDefinition=eS;class eE extends J{constructor(){super(...arguments),this.kind="InputFieldDefinition"}get coordinate(){let e=this._parent;return`${void 0==e?"<detached>":e.coordinate}.${this.name}`}isRequired(){return N(this.type)&&void 0===this.defaultValue}ofExtension(){return this._extension}removeOfExtension(){this._extension=void 0}setOfExtension(e){var t;this.checkUpdate(),(0,a.assert)(!e||(null==(t=this._parent)?void 0:t.hasExtension(e)),()=>`Cannot mark field ${this.name} as part of the provided extension: it is not an extension of field parent type ${this.parent}`),this._extension=e,this.onModification()}isDeprecated(){return this.hasAppliedDirective("deprecated")}remove(){return this._parent&&(this.checkRemoval(),this.onModification(),this.sourceAST=void 0,this.type=void 0,this.defaultValue=void 0,this.removeAppliedDirectives(),ey.prototype.removeFieldInternal.call(this._parent,this),this._parent=void 0,this._extension=void 0),[]}removeRecursive(){let e=this._parent;this.remove(),e&&0===e.fields().length&&e.removeRecursive()}toString(){let e=void 0===this.defaultValue?"":` = ${(0,s.valueToString)(this.defaultValue,this.type)}`;return`${this.name}: ${this.type}${e}`}}i.InputFieldDefinition=eE;class eI extends J{constructor(e){super(e),this.kind="ArgumentDefinition"}get coordinate(){let e=this._parent;return`${void 0==e?"<detached>":e.coordinate}(${this.name}:)`}isRequired(){return N(this.type)&&void 0===this.defaultValue}isDeprecated(){return this.hasAppliedDirective("deprecated")}remove(){return this._parent&&(this.checkRemoval(),this.onModification(),this.sourceAST=void 0,this.type=void 0,this.defaultValue=void 0,this.removeAppliedDirectives(),this._parent instanceof eS?eS.prototype.removeArgumentInternal.call(this._parent,this.name):eN.prototype.removeArgumentInternal.call(this._parent,this.name),this._parent=void 0),[]}toString(){let e=void 0===this.defaultValue?"":` = ${(0,s.valueToString)(this.defaultValue,this.type)}`;return`${this.name}: ${this.type}${e}`}}i.ArgumentDefinition=eI;class eb extends q{constructor(){super(...arguments),this.kind="EnumValue"}get coordinate(){let e=this._parent;return`${void 0==e?"<detached>":e.coordinate}.${this.name}`}ofExtension(){return this._extension}removeOfExtension(){this._extension=void 0}setOfExtension(e){var t;this.checkUpdate(),(0,a.assert)(!e||(null==(t=this._parent)?void 0:t.hasExtension(e)),()=>`Cannot mark field ${this.name} as part of the provided extension: it is not an extension of enum value parent type ${this.parent}`),this._extension=e,this.onModification()}isDeprecated(){return this.hasAppliedDirective("deprecated")}remove(){return this._parent&&(this.checkRemoval(),this.onModification(),this.sourceAST=void 0,this.removeAppliedDirectives(),em.prototype.removeValueInternal.call(this._parent,this),this._parent=void 0,this._extension=void 0),[]}removeTypeReference(e){(0,a.assert)(!1,`Enum value ${this} can't reference other types; shouldn't be asked to remove reference to ${e}`)}toString(){return`${this.name}`}}i.EnumValue=eb;class eN extends q{constructor(e,t=!1){super(e),this.isBuiltIn=t,this.kind="DirectiveDefinition",this.repeatable=!1,this._locations=[]}get coordinate(){return`@${this.name}`}arguments(){var e,t;return null!=(t=null==(e=this._args)?void 0:e.values())?t:[]}argument(e){var t;return null==(t=this._args)?void 0:t.get(e)}addArgument(e,t,i){let n;if("string"==typeof e?(this.checkUpdate(),(n=new eI(e)).defaultValue=i):(this.checkUpdate(e),n=e),this.argument(n.name))throw v.ERRORS.INVALID_GRAPHQL.err(`Argument ${n.name} already exists on field ${this.name}`);return this._args||(this._args=new a.MapWithCachedArrays),this._args.set(n.name,n),B.prototype.setParent.call(n,this),"string"==typeof e&&(n.type=t),this.onModification(),n}removeArgumentInternal(e){var t;null==(t=this._args)||t.delete(e)}get locations(){return this._locations}addLocations(...e){let t=!1;for(let i of e)this._locations.includes(i)||(this._locations.push(i),t=!0);return t&&this.onModification(),this}addAllLocations(){return this.addLocations(...Object.values(n.DirectiveLocation))}addAllTypeLocations(){return this.addLocations(n.DirectiveLocation.SCALAR,n.DirectiveLocation.OBJECT,n.DirectiveLocation.INTERFACE,n.DirectiveLocation.UNION,n.DirectiveLocation.ENUM,n.DirectiveLocation.INPUT_OBJECT)}removeLocations(...e){let t=!1;for(let i of e)t||(t=(0,a.removeArrayElement)(i,this._locations));return t&&this.onModification(),this}hasExecutableLocations(){return this.locations.some(e=>M(e))}hasTypeSystemLocations(){return this.locations.some(e=>$(e))}applications(){return null!=this._referencers||(this._referencers=new Set),this._referencers}addReferencer(e){(0,a.assert)(e,"Referencer should exists"),null!=this._referencers||(this._referencers=new Set),this._referencers.add(e)}removeReferencer(e){var t;null==(t=this._referencers)||t.delete(e)}removeTypeReference(e){(0,a.assert)(!1,`Directive definition ${this} can't reference other types (it's arguments can); shouldn't be asked to remove reference to ${e}`)}remove(){var e;if(!this._parent)return[];for(let e of(this.checkRemoval(),this.onModification(),this.sourceAST=void 0,(0,a.assert)(!this._appliedDirectives||0===this._appliedDirectives.length,"Directive definition should not have directive applied to it"),this.arguments()))e.remove();let t=Array.from(null!=(e=this._referencers)?e:[]);return this._referencers=void 0,ea.prototype.removeDirectiveInternal.call(this._parent,this),this._parent=void 0,t}removeRecursive(){this.remove().forEach(e=>e.remove())}toAST(){return(0,n.parse)((0,u.printDirectiveDefinition)(this)).definitions[0]}toString(){return`@${this.name}`}}i.DirectiveDefinition=eN;class e_ extends B{constructor(e,t=Object.create(null)){super(),this.name=e,this._args=t}schema(){return this.parent.schema()}get definition(){if(this.isAttached())return this.schema().directive(this.name)}arguments(e=!1){if(!e)return this._args;let t=this.definition;(0,a.assert)(t,()=>`Cannot include default values for arguments: cannot find directive definition for ${this.name}`);let i=Object.create(null);for(let e of t.arguments()){let t=(0,s.withDefaultValues)(this._args[e.name],e);void 0!==t&&(i[e.name]=t)}return i}onModification(){this.isAttachedToSchemaElement()&&ea.prototype.onModification.call(this.schema())}isAttachedToSchemaElement(){return this.isAttached()}setArguments(e){this._args=e,this.onModification()}argumentType(e){var t,i;return null==(i=null==(t=this.definition)?void 0:t.argument(e))?void 0:i.type}matchArguments(e){let t=Object.entries(this._args);if(t.length!==Object.keys(e).length)return!1;for(let[i,n]of t){if(!(i in e))return!1;let t=e[i];if(!(0,s.valueEquals)(t,n))return!1}return!0}ofExtension(){return this._extension}removeOfExtension(){this._extension=void 0}setOfExtension(e){if(this.checkUpdate(),e){let t=this.parent;(0,a.assert)(t instanceof eo||t instanceof H,"Can only mark directive parts of extensions when directly apply to type or schema definition."),(0,a.assert)(t.hasExtension(e),()=>`Cannot mark directive ${this.name} as part of the provided extension: it is not an extension of parent ${t}`)}this._extension=e,this.onModification()}argumentsToAST(){let e=Object.entries(this._args);if(0===e.length)return;let t=this.definition;return(0,a.assert)(t,()=>`Cannot convert arguments of detached directive ${this}`),e.map(([e,i])=>({kind:n.Kind.ARGUMENT,name:{kind:n.Kind.NAME,value:e},value:(0,s.valueToAST)(i,t.argument(e).type)}))}remove(){if(!this._parent)return!1;this.onModification();let e=this.schema().coreFeatures;if(e&&this.name===e.coreItself.nameInSchema){let t=r.FeatureUrl.parse(this._args[e.coreDefinition.urlArgName()]);if(t.identity===e.coreItself.url.identity){for(let t of(ea.prototype.unmarkAsCoreSchema.call(this.schema()),this.schema().schemaDefinition.appliedDirectivesOf(e.coreItself.nameInSchema)))t.removeInternal();return!0}X.prototype.removeFeature.call(e,t.identity)}return this.removeInternal()}removeInternal(){if(!this._parent)return!1;let e=this.definition;e&&this.isAttachedToSchemaElement()&&eN.prototype.removeReferencer.call(e,this);let t=this._parent.appliedDirectives,i=(0,a.removeArrayElement)(this,t);return(0,a.assert)(i,()=>`Directive ${this} lists ${this._parent} as parent, but that parent doesn't list it as applied directive`),this._parent=void 0,this._extension=void 0,!0}toString(){let e=Object.entries(this._args).filter(([e,t])=>void 0!==t),t=0==e.length?"":"("+e.map(([e,t])=>`${e}: ${(0,s.valueToString)(t,this.argumentType(e))}`).join(", ")+")";return`@${this.name}${t}`}}function eD(e){return e&&0!=e.length?" "+e.join(" "):""}function eA(e){return e&&0!==e.length?e.map(e=>({kind:n.Kind.DIRECTIVE,name:{kind:n.Kind.NAME,value:e.name},arguments:e.argumentsToAST()})):void 0}function eO(e,t,i=["defer"]){return e.name===t.name&&!i.includes(e.name)&&!i.includes(t.name)&&(0,s.argumentsEquals)(e.arguments(),t.arguments())}i.Directive=e_,i.directivesToString=eD,i.directivesToDirectiveNodes=eA,i.sameDirectiveApplication=eO,i.sameDirectiveApplications=function(e,t,i=["defer"]){if(e.length!==t.length)return!1;for(let n of e)if(!t.some(e=>eO(n,e,i)))return!1;return!0},i.isDirectiveApplicationsSubset=function(e,t){if(t.length>e.length)return!1;for(let i of t)if(!e.some(e=>eO(i,e)))return!1;return!0},i.directiveApplicationsSubstraction=function(e,t){return e.filter(e=>!t.some(t=>eO(e,t)))};class eR{constructor(e){this.name=e}toVariableNode(){return{kind:n.Kind.VARIABLE,name:{kind:n.Kind.NAME,value:this.name}}}toString(){return"$"+this.name}}i.Variable=eR,i.VariableCollector=class{constructor(){this._variables=new Map}add(e){this._variables.set(e.name,e)}addAll(e){for(let t of e)this.add(t)}collectInArguments(e){for(let t of Object.values(e))(0,s.collectVariablesInValue)(t,this)}variables(){return(0,a.mapValues)(this._variables)}toString(){return this.variables().toString()}},i.isVariable=function(e){return e instanceof eR};class ew extends G{constructor(e,t,i,n){super(e),this.variable=t,this.type=i,this.defaultValue=n}toVariableDefinitionNode(){let e=(0,s.valueToAST)(this.defaultValue,this.type);return{kind:n.Kind.VARIABLE_DEFINITION,variable:this.variable.toVariableNode(),type:j(this.type),defaultValue:void 0!==e?(0,s.valueNodeToConstValueNode)(e):void 0,directives:this.appliedDirectivesToDirectiveNodes()}}toString(){let e=this.variable+": "+this.type;return void 0!==this.defaultValue&&(e=e+" = "+(0,s.valueToString)(this.defaultValue,this.type)),e+this.appliedDirectivesToString()}}i.VariableDefinition=ew;class eL{constructor(){this._definitions=new a.MapWithCachedArrays}add(e){return!this._definitions.has(e.variable.name)&&(this._definitions.set(e.variable.name,e),!0)}addAll(e){for(let t of e._definitions.values())this.add(t)}definition(e){let t="string"==typeof e?e:e.name;return this._definitions.get(t)}isEmpty(){return 0===this._definitions.size}definitions(){return this._definitions.values()}filter(e){if(0===e.length)return new eL;let t=new eL;for(let i of e){let e=this.definition(i);if(!e)throw Error(`Cannot find variable ${i} in definitions ${this}`);t.add(e)}return t}toVariableDefinitionNodes(){if(0!==this._definitions.size)return this.definitions().map(e=>e.toVariableDefinitionNode())}toString(){return"("+this.definitions().join(", ")+")"}}function eC(e,t){let i=new eR(t.variable.name.value),n=V(e,t.type);if(!L(n))throw v.ERRORS.INVALID_GRAPHQL.err(`Invalid type "${n}" for variable $${i}: not an input type`,{nodes:t.type});return new ew(e,i,n,t.defaultValue?(0,s.valueFromAST)(t.defaultValue,n):void 0)}function eF(e,t){switch(t.kind){case"ListType":case"NonNullType":eF(e,t.baseType());break;default:H.prototype.addReferencer.call(t,e)}}function ek(e,t){switch(t.kind){case"ListType":case"NonNullType":ek(e,t.baseType());break;default:H.prototype.removeReferencer.call(t,e)}}function eP(e,t){switch(e){case"ScalarType":return new el(t);case"ObjectType":return new ed(t);case"InterfaceType":return new ep(t);case"UnionType":return new ef(t);case"EnumType":return new em(t);case"InputObjectType":return new ey(t);default:(0,a.assert)(!1,`Unhandled kind ${e} for type ${t}`)}}function*ex(e,t){var i;for(let n of e.builtInTypes())n.isIntrospectionType()||(null==(i=t.type(n.name))?void 0:i.isBuiltIn)||(yield n);yield*e.types()}function*eM(e,t){var i;for(let n of e.builtInDirectives())(null==(i=t.directive(n.name))?void 0:i.isBuiltIn)||(yield n);yield*e.directives()}function eU(e,t){let i=new Map;for(let n of e.extensions()){let e=new K;t.addExtension(e),i.set(n,e)}return i}function e$(e,t,i){let n=t.ofExtension();n&&i.setOfExtension(e.get(n))}function ej(e,t,i){e.appliedDirectives.filter(e=>i||!e.name.startsWith("join__")).forEach(e=>eV(e,t))}function eV(e,t){let i=t.applyDirective(e.name,{...e.arguments()});return i.sourceAST=e.sourceAST,i}function eG(e,t){if(e)switch(e.kind){case"ListType":return new eg(eG(e.ofType,t));case"NonNullType":return new eT(eG(e.ofType,t));default:return t.type(e.name)}}function eB({source:e,dest:t,copyDirectiveApplications:i=!0,cloneJoinDirectives:n}){let r=eG(e.type,t.schema());t.type=r,t.defaultValue=e.defaultValue,i&&ej(e,t,n),t.description=e.description,t.sourceAST=e.sourceAST}function eK(e,t,i=!0,n){let r=e.locations;if(n&&(r=r.filter(e=>n(e))),0!==r.length){for(let n of e.arguments()){let e=eG(n.type,t.schema());eB({source:n,dest:t.addArgument(n.name,e),copyDirectiveApplications:i,cloneJoinDirectives:!0})}t.repeatable=e.repeatable,t.addLocations(...r),t.sourceAST=e.sourceAST,t.description=e.description}}i.VariableDefinitions=eL,i.variableDefinitionsFromAST=function(e,t){let i=new eL;for(let n of t)if(!i.add(eC(e,n))){let e=n.variable.name.value;throw v.ERRORS.INVALID_GRAPHQL.err(`Duplicate definition for variable ${e}`,{nodes:t.filter(t=>t.variable.name.value===e)})}return i},i.variableDefinitionFromAST=eC,i.newNamedType=eP,i.copyDirectiveDefinitionToSchema=function({definition:e,schema:t,copyDirectiveApplicationsInArguments:i=!0,locationFilter:n}){eK(e,t.addDirectiveDefinition(e.name),i,n)},i.isFieldDefinition=function(e){return e instanceof eS},i.isElementNamedType=function(e){return e instanceof H}},506370,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.CONNECT_VERSIONS=i.ConnectSpecDefinition=i.connectIdentity=void 0;let n=e.r(186846),r=e.r(785576),a=e.r(168032),s=e.r(319894),o=e.r(343924),l=e.r(408470),u=e.r(678270),c=e.r(331484),d=e.r(367356);i.connectIdentity="https://specs.apollo.dev/connect";let p="connect",h="URLPathTemplate",f="JSONSelection",m="ConnectHTTP",y="ConnectBatch",v="ConnectorErrors",g="SourceHTTP",T="HTTPHeaderMapping";class S extends r.FeatureDefinition{constructor(e,t){function s(e,t,i,n){(0,c.assert)(n,"Shouldn't be added without being attached to a @connect spec");let r=n.typeNameInSchema(e),a=i.typeOfKind(r,t);return(0,c.assert)(a,()=>`Expected "${r}" to be defined`),a}super(new r.FeatureUrl(i.connectIdentity,p,e),t),this.minimumFederationVersion=t,this.registerType((0,o.createScalarTypeSpecification)({name:h})),this.registerType((0,o.createScalarTypeSpecification)({name:f})),this.registerType(E({name:v,inputFieldsFct:(e,t)=>{let i=s(f,"ScalarType",e,t);return[{name:"message",type:i},{name:"extensions",type:i}]}})),this.registerType(E({name:T,inputFieldsFct:e=>[{name:"name",type:new a.NonNullType(e.stringType())},{name:"from",type:e.stringType()},{name:"value",type:e.stringType()}]})),this.registerType(E({name:y,inputFieldsFct:e=>[{name:"maxSize",type:e.intType()}]})),this.registerType(E({name:g,inputFieldsFct:(e,t)=>{let i=s(f,"ScalarType",e,t),n=s(T,"InputObjectType",e,t);return[{name:"baseURL",type:new a.NonNullType(e.stringType())},{name:"headers",type:new a.ListType(new a.NonNullType(n))},{name:"path",type:i},{name:"queryParams",type:i}]}})),this.registerType(E({name:m,inputFieldsFct:(e,t)=>{let i=s(h,"ScalarType",e,t),n=s(f,"ScalarType",e,t),r=s(T,"InputObjectType",e,t);return[{name:"GET",type:i},{name:"POST",type:i},{name:"PUT",type:i},{name:"PATCH",type:i},{name:"DELETE",type:i},{name:"body",type:n},{name:"headers",type:new a.ListType(new a.NonNullType(r))},{name:"path",type:n},{name:"queryParams",type:n}]}})),this.registerDirective((0,o.createDirectiveSpecification)({name:p,locations:[n.DirectiveLocation.FIELD_DEFINITION,n.DirectiveLocation.OBJECT],repeatable:!0,args:[{name:"source",type:e=>e.stringType()},{name:"id",type:e=>e.stringType()},{name:"http",type:(e,t)=>s(m,"InputObjectType",e,t)},{name:"batch",type:(e,t)=>s(y,"InputObjectType",e,t)},{name:"errors",type:(e,t)=>s(v,"InputObjectType",e,t)},{name:"selection",type:(e,t)=>{let i=s(f,"ScalarType",e,t);return new a.NonNullType(i)}},{name:"entity",type:e=>e.booleanType(),defaultValue:!1},{name:"isSuccess",type:(e,t)=>s(f,"ScalarType",e,t)}],composes:!1})),this.registerDirective((0,o.createDirectiveSpecification)({name:"source",locations:[n.DirectiveLocation.SCHEMA],repeatable:!0,composes:!1,args:[{name:"name",type:e=>new a.NonNullType(e.stringType())},{name:"http",type:(e,t)=>{let i=s(g,"InputObjectType",e,t);return new a.NonNullType(i)}},{name:"errors",type:(e,t)=>s(v,"InputObjectType",e,t)},{name:"isSuccess",type:(e,t)=>s(f,"ScalarType",e,t)}]}))}get defaultCorePurpose(){return"EXECUTION"}}function E({name:e,inputFieldsFct:t}){return{name:e,checkOrAdd:(i,n,r)=>{var s;let p=null!=(s=null==n?void 0:n.typeNameInSchema(e))?s:e,h=t(i,n),f=i.type(p);if(f){let t=(0,o.ensureSameTypeKind)("InputObjectType",f);if(t.length>0)return t;for(let{name:i,type:n,defaultValue:r}of((0,c.assert)((0,a.isInputObjectType)(f),"Should be an input object type"),h)){let s=f.field(i);if(!s){(0,a.isNonNullType)(n)&&void 0===r&&t.push(l.ERRORS.TYPE_DEFINITION_INVALID.err(`Invalid definition for type ${e}: missing required input field "${i}"`,{nodes:f.sourceAST}));continue}let o=s.type;(0,a.isNonNullType)(o)&&!(0,a.isNonNullType)(n)&&(o=o.ofType),(0,u.sameType)(n,o)?(0,d.valueEquals)(r,s.defaultValue)||t.push(l.ERRORS.TYPE_DEFINITION_INVALID.err(`Invalid definition type ${e}: input field "${i}" should have default value ${(0,d.valueToString)(r)} but found default value ${(0,d.valueToString)(s.defaultValue)}`,{nodes:s.sourceAST})):t.push(l.ERRORS.TYPE_DEFINITION_INVALID.err(`Invalid definition for type ${e}: input field "${i}" should have type "${n}" but found type "${s.type}"`,{nodes:s.sourceAST}))}for(let i of f.fields())h.some(e=>e.name===i.name)||t.push(l.ERRORS.TYPE_DEFINITION_INVALID.err(`Invalid definition for type ${e}: unknown/unsupported input field "${i.name}"`,{nodes:i.sourceAST}));return t}{let e=i.addType(new a.InputObjectType(p,r));for(let{name:t,type:i,defaultValue:n}of h)e.addField(t,i).defaultValue=n;return[]}}}}i.ConnectSpecDefinition=S,i.CONNECT_VERSIONS=new r.FeatureDefinitions(i.connectIdentity).add(new S(new r.FeatureVersion(0,1),new r.FeatureVersion(2,10))).add(new S(new r.FeatureVersion(0,2),new r.FeatureVersion(2,11))).add(new S(new r.FeatureVersion(0,3),new r.FeatureVersion(2,12))).add(new S(new r.FeatureVersion(0,4),new r.FeatureVersion(2,13)),{preview:!0}),(0,s.registerKnownFeature)(i.CONNECT_VERSIONS)},826468,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.builtTypeReference=i.buildSchemaFromAST=i.buildSchema=void 0;let n=e.r(186846),r=e.r(367356),a=e.r(168032),s=e.r(408470),o=e.r(836270),l=e.r(319894),u=e.r(506370);function c(e){return e?(0,r.valueFromASTUntyped)(e):void 0}function d(e,t){var i,r;let c=[],d=new a.Schema(null==t?void 0:t.blueprint),{directiveDefinitions:h,typeDefinitions:y,typeExtensions:S,schemaDefinitions:E,schemaExtensions:b}=function(e,t,i){let n=[],r=[],l=[],u=[],c=[];for(let d of e.definitions)switch(d.kind){case"OperationDefinition":case"FragmentDefinition":i.push(s.ERRORS.INVALID_GRAPHQL.err("Invalid executable definition found while building schema",{nodes:d}));continue;case"SchemaDefinition":u.push(d),t.schemaDefinition.preserveEmptyDefinition=!0;break;case"SchemaExtension":c.push(d);break;case"ScalarTypeDefinition":case"ObjectTypeDefinition":case"InterfaceTypeDefinition":case"UnionTypeDefinition":case"EnumTypeDefinition":case"InputObjectTypeDefinition":if(o.introspectionTypeNames.includes(d.name.value))continue;r.push(d);let e=t.type(d.name.value);if(!e||e.isBuiltIn)e=t.addType((0,a.newNamedType)(p(d.kind),d.name.value));else if(e.preserveEmptyDefinition)throw s.ERRORS.INVALID_GRAPHQL.err(`There can be only one type named "${d.name.value}"`);e.preserveEmptyDefinition=!0;break;case"ScalarTypeExtension":case"ObjectTypeExtension":case"InterfaceTypeExtension":case"UnionTypeExtension":case"EnumTypeExtension":case"InputObjectTypeExtension":if(o.introspectionTypeNames.includes(d.name.value))continue;l.push(d);let h=t.type(d.name.value);if(h){if(h.isBuiltIn)throw s.ERRORS.INVALID_GRAPHQL.err(`Cannot extend built-in type "${d.name.value}"`)}else t.addType((0,a.newNamedType)(p(d.kind),d.name.value));break;case"DirectiveDefinition":n.push(d),t.addDirectiveDefinition(d.name.value)}return{directiveDefinitions:n,typeDefinitions:r,typeExtensions:l,schemaDefinitions:u,schemaExtensions:c}}(e,d,c);for(let e of y)e.kind===n.Kind.ENUM_TYPE_DEFINITION&&g(e,d.type(e.name.value));for(let e of S)if(e.kind===n.Kind.ENUM_TYPE_EXTENSION){let t=d.type(e.name.value).newExtension();t.sourceAST=e,g(e,d.type(e.name.value),t)}for(let e of h)!function(e,t,i){var n;for(let r of null!=(n=e.arguments)?n:[])I(r,t.addArgument(r.name.value),i,!1);t.repeatable=e.repeatable;let r=e.locations.map(({value:e})=>e);t.addLocations(...r),T(e,t)}(e,d.directive(e.name.value),c);for(let e of E)f(e,d.schemaDefinition,c);for(let e of b)f(e,d.schemaDefinition,c,d.schemaDefinition.newExtension());let N=null==(i=d.coreFeatures)?void 0:i.getByIdentity(u.connectIdentity),_=new Set;if(N){let e=(0,l.coreFeatureDefinitionIfKnown)(N.url);if(e){let t=new Set(e.typeSpecs().map(({name:e})=>N.typeNameInSchema(e)));for(let e of y)t.has(e.name.value)&&"InputObjectTypeDefinition"===e.kind&&(_.add(e.name.value),v(e,d.type(e.name.value),d.blueprint,c));for(let e of S){if(!t.has(e.name.value)||"InputObjectTypeExtension"!==e.kind)continue;_.add(e.name.value);let i=d.type(e.name.value),n=i.newExtension();n.sourceAST=e,v(e,i,d.blueprint,c,n)}}}for(let e of(c.push(...d.blueprint.onDirectiveDefinitionAndSchemaParsed(d)),h))!function(e,t,i){var n;for(let r of null!=(n=e.arguments)?n:[])m(r,t.argument(r.name.value),i)}(e,d.directive(e.name.value),c);for(let e of y)_.has(e.name.value)||v(e,d.type(e.name.value),d.blueprint,c);for(let e of S){if(_.has(e.name.value))continue;let t=d.type(e.name.value),i=t.newExtension();i.sourceAST=e,v(e,t,d.blueprint,c,i)}if(c.length>0)throw(0,a.ErrGraphQLValidationFailed)(c);return(null==(r=null==t?void 0:t.validate)||r)&&d.validate(),d}function p(e){let t=e.endsWith("Definition")?"Definition":"Extension";return e.slice(0,e.length-t.length)}function h(e,t,i){try{e()}catch(n){let e=(0,s.errorCauses)(n);if(e)for(let n of e){let e=n.nodes?[t,...n.nodes]:t;i.push((0,s.withModifiedErrorNodes)(n,e))}else throw n}}function f(e,t,i,n){var r,a;for(let a of null!=(r=e.operationTypes)?r:[])h(()=>t.setRoot(a.operation,a.type.name.value).setOfExtension(n),a,i);t.sourceAST=e,"description"in e&&(t.description=null==(a=e.description)?void 0:a.value),m(e,t,i,n)}function m(e,t,i,n){var r;for(let a of null!=(r=e.directives)?r:[])h(()=>{if(t===t.schema().schemaDefinition&&"link"!==a.name.value&&t.schema().blueprint.applyDirectivesAfterParsing())t.addUnappliedDirective({extension:n,directive:a,args:y(a),nameOrDef:a.name.value});else{let e=t.applyDirective(a.name.value,y(a));e.setOfExtension(n),e.sourceAST=a}},a,i)}function y(e){var t;let i=Object.create(null);for(let n of null!=(t=e.arguments)?t:[])i[n.name.value]=c(n.value);return i}function v(e,t,i,n,r){var o,l,u,d,p;switch(e.kind){case"EnumTypeDefinition":case"EnumTypeExtension":for(let i of null!=(o=e.values)?o:[])m(i,t.value(i.name.value),n);break;case"ObjectTypeDefinition":case"ObjectTypeExtension":case"InterfaceTypeDefinition":case"InterfaceTypeExtension":for(let o of null!=(l=e.fields)?l:[]){if(i.ignoreParsedField(t,o.name.value))continue;let e=t.addField(o.name.value);e.setOfExtension(r),function(e,t,i){var n,r,o,l,u,c;for(let r of(o=E(e.type,t.schema()),l=t.coordinate,u=e,c=i,t.type=(0,a.isOutputType)(o)?o:void c.push(s.ERRORS.INVALID_GRAPHQL.err(`The type of "${l}" must be Output Type but got "${o}", a ${o.kind}.`,{nodes:u})),null!=(n=e.arguments)?n:[]))I(r,t.addArgument(r.name.value),i,!0);m(e,t,i),t.description=null==(r=e.description)?void 0:r.value,t.sourceAST=e}(o,e,n)}for(let i of null!=(u=e.interfaces)?u:[])h(()=>{let e=i.name.value;if(t.implementsInterface(e))throw s.ERRORS.INVALID_GRAPHQL.err(`Type "${t}" can only implement "${e}" once.`);t.addImplementedInterface(e).setOfExtension(r)},i,n);break;case"UnionTypeDefinition":case"UnionTypeExtension":for(let i of null!=(d=e.types)?d:[])h(()=>{let e=i.name.value;if(t.hasTypeMember(e))throw s.ERRORS.INVALID_GRAPHQL.err(`Union type "${t}" can only include type "${e}" once.`);t.addType(e).setOfExtension(r)},i,n);break;case"InputObjectTypeDefinition":case"InputObjectTypeExtension":for(let i of null!=(p=e.fields)?p:[]){let e=t.addField(i.name.value);e.setOfExtension(r),function(e,t,i){var n;let r=E(e.type,t.schema());t.type=S(r,t.coordinate,e,i),t.defaultValue=c(e.defaultValue),m(e,t,i),t.description=null==(n=e.description)?void 0:n.value,t.sourceAST=e}(i,e,n)}}m(e,t,n,r),T(e,t)}function g(e,t,i){var n;for(let r of null!=(n=e.values)?n:[]){let e=t.addValue(r.name.value);r.description&&(e.description=r.description.value),e.setOfExtension(i)}T(e,t)}function T(e,t){e.description&&(t.description=e.description.value),t.sourceAST=e}function S(e,t,i,n){return(0,a.isInputType)(e)?e:void n.push(s.ERRORS.INVALID_GRAPHQL.err(`The type of "${t}" must be Input Type but got "${e}", a ${e.kind}.`,{nodes:i}))}function E(e,t){switch(e.kind){case n.Kind.LIST_TYPE:return new a.ListType(E(e.type,t));case n.Kind.NON_NULL_TYPE:let i=E(e.type,t);if(i.kind==n.Kind.NON_NULL_TYPE)throw s.ERRORS.INVALID_GRAPHQL.err("Cannot apply the non-null operator (!) twice to the same type",{nodes:e});return new a.NonNullType(i);default:let r=t.type(e.name.value);if(!r)throw s.ERRORS.INVALID_GRAPHQL.err(`Unknown type ${e.name.value}`,{nodes:e});return r}}function I(e,t,i,n){var r;let a=E(e.type,t.schema());t.type=S(a,t.coordinate,e,i),t.defaultValue=c(e.defaultValue),n&&m(e,t,i),t.description=null==(r=e.description)?void 0:r.value,t.sourceAST=e}i.buildSchema=function(e,t){return d((0,n.parse)(e),t)},i.buildSchemaFromAST=d,i.builtTypeReference=function(e,t){return E((0,n.parseType)(e),t)}},939603,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.KnownTypeNamesInFederationRule=void 0;let n=e.r(186846),r=e.r(308126);i.KnownTypeNamesInFederationRule=function(e){let t=e.getSchema(),i=t?t.getTypeMap():Object.create(null),s=Object.create(null);for(let t of e.getDocument().definitions)((0,n.isTypeDefinitionNode)(t)||(0,n.isTypeExtensionNode)(t))&&(s[t.name.value]=!0);let o=Object.keys(i).concat(Object.keys(s));return{NamedType(t,l,u,c,d){var p,h,f;let m=t.name.value;if(!i[m]&&!s[m]){let i=null!=(p=d[2])?p:u,s=null!=i&&!Array.isArray(h=i)&&((0,n.isTypeSystemDefinitionNode)(h)||(0,n.isTypeSystemExtensionNode)(h));if(s&&(f=m,-1!==a.indexOf(f)))return;let l=(0,r.suggestionList)(m,s?a.concat(o):o);e.reportError(new n.GraphQLError(`Unknown type "${m}".`+(0,r.didYouMean)(l),{nodes:t}))}}}};let a=[...n.specifiedScalarTypes,...n.introspectionTypes].map(e=>e.name)},279403,e=>{"use strict";let t,i;e.s([],855276),e.i(855276);var n=e.i(254799);let r=new Uint8Array(256),a=r.length;function s(){return a>r.length-16&&(n.default.randomFillSync(r),a=0),r.slice(a,a+=16)}let o=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,l=function(e){return"string"==typeof e&&o.test(e)},u=[];for(let e=0;e<256;++e)u.push((e+256).toString(16).slice(1));function c(e,t=0){return u[e[t+0]]+u[e[t+1]]+u[e[t+2]]+u[e[t+3]]+"-"+u[e[t+4]]+u[e[t+5]]+"-"+u[e[t+6]]+u[e[t+7]]+"-"+u[e[t+8]]+u[e[t+9]]+"-"+u[e[t+10]]+u[e[t+11]]+u[e[t+12]]+u[e[t+13]]+u[e[t+14]]+u[e[t+15]]}let d=0,p=0,h=function(e){let t;if(!l(e))throw TypeError("Invalid UUID");let i=new Uint8Array(16);return i[0]=(t=parseInt(e.slice(0,8),16))>>>24,i[1]=t>>>16&255,i[2]=t>>>8&255,i[3]=255&t,i[4]=(t=parseInt(e.slice(9,13),16))>>>8,i[5]=255&t,i[6]=(t=parseInt(e.slice(14,18),16))>>>8,i[7]=255&t,i[8]=(t=parseInt(e.slice(19,23),16))>>>8,i[9]=255&t,i[10]=(t=parseInt(e.slice(24,36),16))/0x10000000000&255,i[11]=t/0x100000000&255,i[12]=t>>>24&255,i[13]=t>>>16&255,i[14]=t>>>8&255,i[15]=255&t,i};function f(e,t,i){function n(e,n,r,a){var s;if("string"==typeof e&&(e=function(e){e=unescape(encodeURIComponent(e));let t=[];for(let i=0;i<e.length;++i)t.push(e.charCodeAt(i));return t}(e)),"string"==typeof n&&(n=h(n)),(null==(s=n)?void 0:s.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let o=new Uint8Array(16+e.length);if(o.set(n),o.set(e,n.length),(o=i(o))[6]=15&o[6]|t,o[8]=63&o[8]|128,r){a=a||0;for(let e=0;e<16;++e)r[a+e]=o[e];return r}return c(o)}try{n.name=e}catch(e){}return n.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",n.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",n}let m=f("v3",48,function(e){return Array.isArray(e)?e=Buffer.from(e):"string"==typeof e&&(e=Buffer.from(e,"utf8")),n.default.createHash("md5").update(e).digest()}),y={randomUUID:n.default.randomUUID},v=f("v5",80,function(e){return Array.isArray(e)?e=Buffer.from(e):"string"==typeof e&&(e=Buffer.from(e,"utf8")),n.default.createHash("sha1").update(e).digest()});e.s(["NIL",0,"00000000-0000-0000-0000-000000000000","parse",0,h,"stringify",0,function(e,t=0){let i=c(e,t);if(!l(i))throw TypeError("Stringified UUID is invalid");return i},"v1",0,function(e,n,r){let a=n&&r||0,o=n||Array(16),l=(e=e||{}).node||t,u=void 0!==e.clockseq?e.clockseq:i;if(null==l||null==u){let n=e.random||(e.rng||s)();null==l&&(l=t=[1|n[0],n[1],n[2],n[3],n[4],n[5]]),null==u&&(u=i=(n[6]<<8|n[7])&16383)}let h=void 0!==e.msecs?e.msecs:Date.now(),f=void 0!==e.nsecs?e.nsecs:p+1,m=h-d+(f-p)/1e4;if(m<0&&void 0===e.clockseq&&(u=u+1&16383),(m<0||h>d)&&void 0===e.nsecs&&(f=0),f>=1e4)throw Error("uuid.v1(): Can't create more than 10M uuids/sec");d=h,p=f,i=u;let y=((0xfffffff&(h+=122192928e5))*1e4+f)%0x100000000;o[a++]=y>>>24&255,o[a++]=y>>>16&255,o[a++]=y>>>8&255,o[a++]=255&y;let v=h/0x100000000*1e4&0xfffffff;o[a++]=v>>>8&255,o[a++]=255&v,o[a++]=v>>>24&15|16,o[a++]=v>>>16&255,o[a++]=u>>>8|128,o[a++]=255&u;for(let e=0;e<6;++e)o[a+e]=l[e];return n||c(o)},"v3",0,m,"v4",0,function(e,t,i){if(y.randomUUID&&!t&&!e)return y.randomUUID();let n=(e=e||{}).random||(e.rng||s)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){i=i||0;for(let e=0;e<16;++e)t[i+e]=n[e];return t}return c(n)},"v5",0,v,"validate",0,l,"version",0,function(e){if(!l(e))throw TypeError("Invalid UUID");return parseInt(e.slice(14,15),16)}],279403)},738207,(e,t,i)=>{"use strict";var n,r;Object.defineProperty(i,"__esModule",{value:!0}),i.hasSelectionWithPredicate=i.operationToDocument=i.parseOperationAST=i.parseSelectionSet=i.parseOperation=i.operationFromDocument=i.FragmentSpreadSelection=i.FragmentSelection=i.FieldSelection=i.selectionOfElement=i.selectionSetOfElement=i.selectionSetOf=i.allFieldDefinitionsInSelectionSet=i.MutableSelectionSet=i.SelectionSetUpdates=i.SelectionSet=i.ContainsResult=i.NamedFragments=i.NamedFragmentDefinition=i.Operation=i.concatOperationPaths=i.conditionalDirectivesInOperationPath=i.sameOperationPaths=i.operationPathToStringPath=i.FragmentElement=i.Field=i.DEFAULT_MIN_USAGES_TO_OPTIMIZE=void 0;let a=e.r(186846),s=e.r(168032),o=e.r(951071),l=e.r(408470),u=e.r(678270),c=e.r(331484),d=e.r(367356),p=e.r(279403);function h(e,t,i){if(!e)throw l.ERRORS.INVALID_GRAPHQL.err(t(),{nodes:i})}function f(e,t){return(0,s.sameDirectiveApplications)(e.appliedDirectives,t.appliedDirectives)}i.DEFAULT_MIN_USAGES_TO_OPTIMIZE=2;class m extends s.DirectiveTargetElement{constructor(e,t){super(e,t)}collectVariables(e){this.collectVariablesInElement(e),this.collectVariablesInAppliedDirectives(e)}rebaseOnOrError(e){return this.rebaseOn({parentType:e,errorIfCannotRebase:!0})}addAttachment(e,t){this.attachments||(this.attachments=new Map),this.attachments.set(e,t)}getAttachment(e){var t;return null==(t=this.attachments)?void 0:t.get(e)}copyAttachmentsTo(e){if(this.attachments)for(let[t,i]of this.attachments.entries())e.addAttachment(t,i)}keyForDirectives(){return this.appliedDirectives.map(e=>(function(e,t=["defer"]){if(t.includes(e.name))return(0,p.v1)();let i=Object.entries(e.arguments()).filter(([e,t])=>void 0!==t);i.sort(([e],[t])=>e.localeCompare(t));let n=0==i.length?"":"("+i.map(([t,i])=>`${t}: ${(0,d.valueToString)(i,e.argumentType(t))}`).join(", ")+")";return`@${e.name}${n}`})(e)).join(" ")}}class y extends m{constructor(e,t,i,n){super(e.schema(),i),this.definition=e,this.args=t,this.alias=n,this.kind="Field"}collectVariablesInElement(e){this.args&&e.collectInArguments(this.args)}get name(){return this.definition.name}argumentValue(e){return this.args?this.args[e]:void 0}responseName(){return this.alias?this.alias:this.name}key(){return this.responseName()+this.keyForDirectives()}asPathElement(){return this.responseName()}get parentType(){return this.definition.parent}isLeafField(){return(0,s.isLeafType)(this.baseType())}baseType(){return(0,s.baseType)(this.definition.type)}copy(){let e=new y(this.definition,this.args,this.appliedDirectives,this.alias);return this.copyAttachmentsTo(e),e}withUpdatedArguments(e){let t=new y(this.definition,{...this.args,...e},this.appliedDirectives,this.alias);return this.copyAttachmentsTo(t),t}withUpdatedDefinition(e){let t=new y(e,this.args,this.appliedDirectives,this.alias);return this.copyAttachmentsTo(t),t}withUpdatedAlias(e){let t=new y(this.definition,this.args,this.appliedDirectives,e);return this.copyAttachmentsTo(t),t}withUpdatedDirectives(e){let t=new y(this.definition,this.args,e,this.alias);return this.copyAttachmentsTo(t),t}argumentsToNodes(){if(!this.args)return;let e=Object.entries(this.args);if(0!==e.length)return e.map(([e,t])=>({kind:a.Kind.ARGUMENT,name:{kind:a.Kind.NAME,value:e},value:(0,d.valueToAST)(t,this.definition.argument(e).type)}))}selects(e,t=!1,i,n){if((0,c.assert)(t||i,"Must provide variable definitions if validation is needed"),e===this.definition)return!0;if(this.name!==e.name)return!1;for(let r of e.arguments()){let e=this.argumentValue(r.name);if(void 0===e){if(void 0===r.defaultValue&&!(0,s.isNullableType)(r.type)&&(!n||!(null==n?void 0:n.includes(r.name))))return!1}else if(!t&&!(0,d.isValidValue)(e,r,i))return!1}if(!t&&this.args){for(let[t,i]of Object.entries(this.args))if(null!==i&&void 0===e.argument(t))return!1}return!0}validate(e,t){var i;for(let n of(h(this.name===this.definition.name,()=>`Field name "${this.name}" cannot select field "${this.definition.coordinate}: name mismatch"`),this.definition.arguments())){let r=this.argumentValue(n.name),a=!1,l=this.definition.schema(),u=null==(i=(0,o.federationMetadata)(l))?void 0:i.fromContextDirective();u&&(0,o.isFederationDirectiveDefinedInSchema)(u)&&(a=n.appliedDirectivesOf(u).length>0),void 0===r?h(a&&!t||void 0!==n.defaultValue||(0,s.isNullableType)(n.type),()=>`Missing mandatory value for argument "${n.name}" of field "${this.definition.coordinate}" in selection "${this}"`):h(a&&!t||(0,d.isValidValue)(r,n,e),()=>`Invalid value ${(0,d.valueToString)(r)} for argument "${n.coordinate}" of type ${n.type}`)}if(this.args)for(let[e,t]of Object.entries(this.args))h(null===t||void 0!==this.definition.argument(e),()=>`Unknown argument "${e}" in field application of "${this.name}"`)}rebaseOn({parentType:e,errorIfCannotRebase:t}){if(e===this.definition.parent)return this;if(this.name===s.typenameFieldName)if((0,s.possibleRuntimeTypes)(e).some(e=>(0,o.isInterfaceObjectType)(e)))return void h(!t,()=>`Cannot add selection of field "${this.definition.coordinate}" to selection set of parent type "${e}" that is potentially an interface object type at runtime`);else return this.withUpdatedDefinition(e.typenameField());let i=e.field(this.name);return this.canRebaseOn(e)&&i?this.withUpdatedDefinition(i):void h(!t,()=>`Cannot add selection of field "${this.definition.coordinate}" to selection set of parent type "${e}"`)}canRebaseOn(e){let t=this.definition.parent;return e.name===t.name||(0,s.isInterfaceType)(t)||(0,o.isInterfaceObjectType)(t)}typeIfAddedTo(e){var t,i,n;if(e==this.definition.parent)return this.definition.type;if(this.name===s.typenameFieldName)return null==(t=e.typenameField())?void 0:t.type;let r=this.canRebaseOn(e)?null==(i=e.field(this.name))?void 0:i.type:void 0,a=null==(n=(0,o.federationMetadata)(e.schema()))?void 0:n.fromContextDirective();if(a&&(0,o.isFederationDirectiveDefinedInSchema)(a)){let t=e.field(this.name);if(t&&t.arguments().some(e=>e.appliedDirectivesOf(a).length>0&&(!this.args||void 0===this.args[e.name])))return}return r}hasDefer(){return!1}deferDirectiveArgs(){}withoutDefer(){return this}equals(e){return this===e||"Field"===e.kind&&this.name===e.name&&this.alias===e.alias&&(this.args?e.args&&(0,d.argumentsEquals)(this.args,e.args):!e.args)&&f(this,e)}toString(){let e=this.alias?this.alias+": ":"",t=this.args?Object.entries(this.args):[],i=0===t.length?"":"("+t.map(([e,t])=>{var i;return`${e}: ${(0,d.valueToString)(t,null==(i=this.definition.argument(e))?void 0:i.type)}`}).join(", ")+")";return e+this.name+i+this.appliedDirectivesToString()}}i.Field=y;class v extends m{constructor(e,t,i){super(e.schema(),i),this.sourceType=e,this.kind="FragmentElement",this.typeCondition=void 0!==t&&"string"==typeof t?this.schema().type(t):t}collectVariablesInElement(e){}get parentType(){return this.sourceType}key(){return this.computedKey||(this.computedKey="..."+(this.typeCondition?" on "+this.typeCondition.name:"")+this.keyForDirectives()),this.computedKey}castedType(){return this.typeCondition?this.typeCondition:this.sourceType}asPathElement(){let e=this.typeCondition;return e?`... on ${e}`:void 0}withUpdatedSourceType(e){return this.withUpdatedTypes(e,this.typeCondition)}withUpdatedCondition(e){return this.withUpdatedTypes(this.sourceType,e)}withUpdatedTypes(e,t){let i=new v(e,null==t?void 0:t.name,this.appliedDirectives);return this.copyAttachmentsTo(i),i}withUpdatedDirectives(e){let t=new v(this.sourceType,this.typeCondition,e);return this.copyAttachmentsTo(t),t}rebaseOn({parentType:e,errorIfCannotRebase:t}){let i=this.parentType,n=this.typeCondition;if(e===i)return this;let{canRebase:r,rebasedCondition:a}=this.canRebaseOn(e);return r?this.withUpdatedTypes(e,a):void h(!t,()=>`Cannot add fragment of condition "${n}" (runtimes: [${(0,s.possibleRuntimeTypes)(n)}]) to parent type "${e}" (runtimes: ${(0,s.possibleRuntimeTypes)(e)})`)}canRebaseOn(e){if(!this.typeCondition)return{canRebase:!0,rebasedCondition:void 0};let t=e.schema().type(this.typeCondition.name);return t&&(0,s.isCompositeType)(t)&&(0,s.runtimeTypesIntersects)(e,t)?{canRebase:!0,rebasedCondition:t}:{canRebase:!1}}castedTypeIfAddedTo(e){if(e==this.parentType)return this.castedType();let{canRebase:t,rebasedCondition:i}=this.canRebaseOn(e);return t?i||e:void 0}hasDefer(){return this.hasAppliedDirective("defer")}hasStream(){return this.hasAppliedDirective("stream")}deferDirectiveArgs(){var e;return null==(e=this.appliedDirectivesOf(this.schema().deferDirective())[0])?void 0:e.arguments()}withoutDefer(){let e=this.schema().deferDirective().name,t=this.appliedDirectives.filter(t=>t.name!==e);if(!this.typeCondition&&0===t.length)return;if(t.length===this.appliedDirectives.length)return this;let i=new v(this.sourceType,this.typeCondition,t);return this.copyAttachmentsTo(i),i}withNormalizedDefer(e){let t,i,n=this.deferDirectiveArgs();if(!n)return this;if(void 0!==n.if)if("boolean"==typeof n.if)if(!n.if)return this.withoutDefer();else t={...n,if:void 0};else i=n.if;let r=n.label;if(r||(r=e.newLabel(),t?t.label=r:t={...n,label:r}),i&&e.registerCondition(r,i),!t)return this;let a=this.schema().deferDirective(),o=this.appliedDirectives.filter(e=>e.name!==a.name).concat(new s.Directive(a.name,t)),l=new v(this.sourceType,this.typeCondition,o);return this.copyAttachmentsTo(l),l}equals(e){var t,i;return this===e||"FragmentElement"===e.kind&&(null==(t=this.typeCondition)?void 0:t.name)===(null==(i=e.typeCondition)?void 0:i.name)&&f(this,e)}toString(){return"..."+(this.typeCondition?" on "+this.typeCondition:"")+this.appliedDirectivesToString()}}function g(e){return e.map(e=>e.appliedDirectives).flat().filter(e=>(0,s.isConditionalDirective)(e))}i.FragmentElement=v,i.operationPathToStringPath=function(e){return e.filter(e=>!("FragmentElement"===e.kind&&!e.typeCondition)).map(e=>{var t;return"Field"===e.kind?e.responseName():`... on ${null==(t=e.typeCondition)?void 0:t.coordinate}`})},i.sameOperationPaths=function(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if(!e[i].equals(t[i]))return!1;return!0},i.conditionalDirectivesInOperationPath=g,i.concatOperationPaths=function(e,t){var i,n,r;let a;if(0===e.length)return t;if(0===t.length)return e;let o=e[e.length-1],l=g(e),c=t[0];for(;c&&(i=o,n=c,r=l,(a="Field"===i.kind?i.baseType():i.typeCondition)&&"FragmentElement"===n.kind&&n.typeCondition&&(0===n.appliedDirectives.length||(0,s.isDirectiveApplicationsSubset)(r,n.appliedDirectives))&&(0,u.isSubtype)(n.typeCondition,a));)c=(t=t.slice(1))[0];return e.concat(t)};class T extends s.DirectiveTargetElement{constructor(e,t,i,n,r,a,s=[]){super(e,s),this.rootKind=t,this.selectionSet=i,this.variableDefinitions=n,this.fragments=r,this.name=a}withUpdatedSelectionSet(e){return this.selectionSet===e?this:new T(this.schema(),this.rootKind,e,this.variableDefinitions,this.fragments,this.name,this.appliedDirectives)}collectUndefinedVariablesFromFragments(e){let t=new s.VariableCollector;for(let i of e.definitions())i.selectionSet.usedVariables().forEach(e=>{this.variableDefinitions.definition(e)||t.add(e)});return t.variables()}withUpdatedSelectionSetAndFragments(e,t,i){if(this.selectionSet===e&&t===this.fragments)return this;let n=this.variableDefinitions;if(i&&t){let e=this.collectUndefinedVariablesFromFragments(t);e.length>0&&((n=new s.VariableDefinitions).addAll(this.variableDefinitions),n.addAll(i.filter(e)))}return new T(this.schema(),this.rootKind,e,n,t,this.name,this.appliedDirectives)}optimize(e,t=i.DEFAULT_MIN_USAGES_TO_OPTIMIZE,n){if((0,c.assert)(t>=1,`Expected 'minUsagesToOptimize' to be at least 1, but got ${t}`),!e||e.isEmpty())return this;let r=this.selectionSet.optimize(e);if(r===this.selectionSet)return this;let a=function(e,t,i){let n=new Map;if(e.collectUsedFragmentNames(n),0===n.size)return null;for(let e of t.definitions())void 0===n.get(e.name)&&n.set(e.name,0);let r=function(e){let t=new c.SetMultiMap;for(let i of e.definitions())for(let e of i.fragmentUsages().keys())t.add(e,i.name);return t}(t),a=new Set,s=!0;for(;s;)for(let e of(s=!1,!function(e,t,i){let n=Array.from(e.entries()).filter(([e,t])=>t>=i).map(([e,t])=>e);for(;n.length>0;){let r=[];for(let a of n)for(let[n,s]of(e.delete(a),t.get(a).fragmentUsages().entries())){let t=e.get(n);if(void 0!==t){let a=t+s;e.set(n,a),t<i&&a>=i&&r.push(n)}}n=r}}(n,t,i),(0,c.mapKeys)(n))){let o=n.get(e);if(0===o)continue;if(o>=i){s=!0;break}let l=r.get(e);if(!l||[...l].every(e=>a.has(e)||!n.get(e)))for(let[i,r]of(a.add(e),n.delete(e),s=!0,t.get(e).fragmentUsages().entries())){let e=n.get(i);void 0!==e&&n.set(i,e+o*r)}}for(let e of n.keys())a.add(e);return 0===a.size?t:t.filter(e=>!a.has(e.name))}(r,e,t);if(null!==a&&(null==a?void 0:a.size)!==e.size&&(r=(r=r.expandFragments(a)).normalize({parentType:r.parentType}),a)){let e;do{e=a;let t=new Map;r.collectUsedFragmentNames(t),a.collectUsedFragmentNames(t),a=a.filter(e=>{var i;return(null!=(i=t.get(e.name))?i:0)>0})}while(a&&a.size<e.size)}return this.withUpdatedSelectionSetAndFragments(r,null!=a?a:void 0,n)}generateQueryFragments(){let[e,t]=this.selectionSet.minimizeSelectionSet();return new T(this.schema(),this.rootKind,e,this.variableDefinitions,t,this.name,this.appliedDirectives)}expandAllFragments(){let e=this.selectionSet.expandFragments();return this.withUpdatedSelectionSetAndFragments(e.normalize({parentType:e.parentType}),void 0)}normalize(){return this.withUpdatedSelectionSet(this.selectionSet.normalize({parentType:this.selectionSet.parentType}))}withoutDefer(e){return this.withUpdatedSelectionSet(this.selectionSet.withoutDefer(e))}withNormalizedDefer(){let e=new I,{hasDefers:t,hasNonLabelledOrConditionalDefers:i}=e.init(this.selectionSet),n=this;return i&&(n=this.withUpdatedSelectionSet(this.selectionSet.withNormalizedDefer(e))),{operation:n,hasDefers:t,assignedDeferLabels:e.assignedLabels,deferConditions:e.deferConditions}}collectDefaultedVariableValues(){let e=Object.create(null);for(let{variable:t,defaultValue:i}of this.variableDefinitions.definitions())void 0!==i&&(e[t.name]=i);return e}toString(e=!1,t=!0){return this.selectionSet.toOperationString(this.rootKind,this.variableDefinitions,this.fragments,this.name,this.appliedDirectives,e,t)}}i.Operation=T;class S extends s.DirectiveTargetElement{constructor(e,t,i,n){super(e,n),this.name=t,this.typeCondition=i,this.expandedSelectionSetsAtTypesCache=new Map}setSelectionSet(e){return(0,c.assert)(!this._selectionSet,"Attempting to set the selection set of a fragment definition already built"),(0,c.assert)(e.parentType===this.typeCondition,`Fragment selection set parent is ${e.parentType} differs from the fragment condition type ${this.typeCondition}`),this._selectionSet=e,this}get selectionSet(){return(0,c.assert)(this._selectionSet,()=>`Trying to access fragment definition ${this.name} before it is fully built`),this._selectionSet}withUpdatedSelectionSet(e){return new S(this.schema(),this.name,this.typeCondition).setSelectionSet(e)}fragmentUsages(){return this._fragmentUsages||(this._fragmentUsages=new Map,this.selectionSet.collectUsedFragmentNames(this._fragmentUsages)),this._fragmentUsages}collectUsedFragmentNames(e){for(let[t,i]of this.fragmentUsages().entries()){let n=e.get(t);e.set(t,n?n+i:i)}}collectVariables(e){this.selectionSet.collectVariables(e),this.collectVariablesInAppliedDirectives(e)}toFragmentDefinitionNode(){return{kind:a.Kind.FRAGMENT_DEFINITION,name:{kind:a.Kind.NAME,value:this.name},typeCondition:{kind:a.Kind.NAMED_TYPE,name:{kind:a.Kind.NAME,value:this.typeCondition.name}},selectionSet:this.selectionSet.toSelectionSetNode()}}canApplyDirectlyAtType(e){if((0,u.sameType)(e,this.typeCondition))return!0;if(!(0,s.isAbstractType)(this.typeCondition))return!1;let t=(0,s.possibleRuntimeTypes)(this.typeCondition),i=(0,s.possibleRuntimeTypes)(e);return!(t.length<i.length)&&!!i.every(e=>t.some(t=>(0,u.sameType)(e,t)))&&((0,s.isObjectType)(e)||(0,s.isUnionType)(this.typeCondition))}expandedSelectionSet(){return this._expandedSelectionSet||(this._expandedSelectionSet=this.selectionSet.expandFragments()),this._expandedSelectionSet}expandedSelectionSetAtType(e){let t=this.expandedSelectionSetsAtTypesCache.get(e.name);return t||(t=this.computeExpandedSelectionSetAtType(e),this.expandedSelectionSetsAtTypesCache.set(e.name,t)),t}computeExpandedSelectionSetAtType(e){let t=this.expandedSelectionSet(),i=t.normalize({parentType:e});if(!(0,s.isObjectType)(this.typeCondition))return{selectionSet:i,validator:k.build(t)};let n=t.minus(i);return{selectionSet:i,validator:n.isEmpty()?void 0:k.build(n)}}includes(e){return this.name!==e&&(this._includedFragmentNames||(this._includedFragmentNames=this.computeIncludedFragmentNames()),this._includedFragmentNames.has(e))}computeIncludedFragmentNames(){let e=new Set;for(let t of this.selectionSet.selections())t instanceof U&&e.add(t.namedFragment.name);return e}toString(e){return`fragment ${this.name} on ${this.typeCondition}${this.appliedDirectivesToString()} ${this.selectionSet.toString(!1,!0,e)}`}}i.NamedFragmentDefinition=S;class E{constructor(){this.fragments=new c.MapWithCachedArrays}isEmpty(){return 0===this.size}get size(){return this.fragments.size}names(){return this.fragments.keys()}add(e){if(this.fragments.has(e.name))throw l.ERRORS.INVALID_GRAPHQL.err(`Duplicate fragment name '${e}'`);this.fragments.set(e.name,e)}addIfNotExist(e){this.fragments.has(e.name)||this.fragments.set(e.name,e)}maybeApplyingDirectlyAtType(e){return this.fragments.values().filter(t=>t.canApplyDirectlyAtType(e))}get(e){return this.fragments.get(e)}has(e){return this.fragments.has(e)}definitions(){return this.fragments.values()}collectUsedFragmentNames(e){for(let t of this.definitions())t.collectUsedFragmentNames(e)}map(e){let t=new E;for(let i of this.fragments.values())t.fragments.set(i.name,e(i));return t}mapInDependencyOrder(e){let t=new Map;for(let e of this.definitions())t.set(e.name,{fragment:e,dependsOn:Array.from(e.fragmentUsages().keys())});let i=new Set,n=new E;for(;t.size>0;)for(let[r,a]of t)if(a.dependsOn.every(e=>n.has(e)||i.has(e))){let s=e(a.fragment,n);t.delete(r),s?n.add(s):i.add(r);break}return n.isEmpty()?void 0:n}mapToExpandedSelectionSets(e){return this.mapInDependencyOrder((t,i)=>{let n=e(t.selectionSet.expandFragments().normalize({parentType:t.typeCondition}));if(!n)return;let r=n.optimize(i);return t.withUpdatedSelectionSet(r)})}rebaseOn(e){return this.mapInDependencyOrder((t,i)=>{let n=e.type(t.selectionSet.parentType.name);if(!n||!(0,s.isCompositeType)(n))return;let r=t.selectionSet.rebaseOn({parentType:n,fragments:i,errorIfCannotRebase:!1});return(r=r.normalize({parentType:n})).isWorthUsing()?new S(e,t.name,n).setSelectionSet(r):void 0})}filter(e){return this.mapInDependencyOrder((t,i)=>{if(e(t)){let e=t.selectionSet.expandFragments(i);return e===t.selectionSet?t:t.withUpdatedSelectionSet(e.normalize({parentType:e.parentType}))}})}validate(e){for(let t of this.fragments.values())t.selectionSet.validate(e)}toFragmentDefinitionNodes(){return this.definitions().map(e=>e.toFragmentDefinitionNode())}toString(e){return this.definitions().map(t=>t.toString(e)).join("\n\n")}}i.NamedFragments=E;class I{constructor(){this.index=0,this.assignedLabels=new Set,this.deferConditions=new c.SetMultiMap,this.usedLabels=new Set}init(e){let t=!1,i=!1,n=e.selections().concat();for(;n.length>0;){let e=n.pop();if("FragmentSelection"===e.kind){let n=e.element.deferDirectiveArgs();n&&(i=!0,n.label&&void 0===n.if||(t=!0),n.label&&this.usedLabels.add(n.label))}e.selectionSet&&e.selectionSet.selections().forEach(e=>n.push(e))}return{hasDefers:i,hasNonLabelledOrConditionalDefers:t}}nextLabel(){return`qp__${this.index++}`}newLabel(){let e=this.nextLabel();for(;this.usedLabels.has(e);)e=this.nextLabel();return this.assignedLabels.add(e),e}registerCondition(e,t){this.deferConditions.add(t.name,e)}}(r=n||(i.ContainsResult=n={}))[r.NOT_CONTAINED=0]="NOT_CONTAINED",r[r.STRICTLY_CONTAINED=1]="STRICTLY_CONTAINED",r[r.EQUAL=2]="EQUAL";class b{constructor(e,t=new Map){this.parentType=e,this._keyedSelections=t,this._selections=(0,c.mapValues)(t)}minimizeSelectionSet(e=new E,t=new Map){return[this.lazyMap(i=>{var n;if("FragmentSelection"===i.kind&&i.element.typeCondition&&0===i.element.appliedDirectives.length&&i.selectionSet&&i.selectionSet.isWorthUsing()){let r=`on${i.element.typeCondition}`+i.selectionSet.selections().length,a=t.get(r);if(a){let t=a.find(([e])=>e.equals(i.selectionSet));if(t)return new U(this.parentType,e,t[1],[])}let[s]=i.selectionSet.minimizeSelectionSet(e,t),o=t.get(r),l=new S(this.parentType.schema(),`_generated_${r}_${null!=(n=null==o?void 0:o.length)?n:0}`,i.element.typeCondition).setSelectionSet(s);return e.add(l),o?o.push([i.selectionSet,l]):t.set(r,[[i.selectionSet,l]]),new U(this.parentType,e,l,[])}return i.selectionSet&&(i=i.withUpdatedSelectionSet(i.selectionSet.minimizeSelectionSet(e,t)[0])),i}),e]}selectionsInReverseOrder(){let e=this._selections.length,t=Array(e);for(let i=0;i<e;i++)t[i]=this._selections[e-i-1];return t}selections(){return this._selections}hasTopLevelTypenameField(){return this._keyedSelections.has(s.typenameFieldName)}withoutTopLevelTypenameField(){if(!this.hasTopLevelTypenameField)return this;let e=new Map;for(let[t,i]of this._keyedSelections)t!==s.typenameFieldName&&e.set(t,i);return new b(this.parentType,e)}fieldsInSet(){let e=[];for(let t of this.selections())if("FieldSelection"===t.kind)e.push({path:[],field:t});else{let i=t.element.typeCondition,n=i?[`... on ${i}`]:[];for(let{path:i,field:r}of t.selectionSet.fieldsInSet())e.push({path:n.concat(i),field:r})}return e}fieldsByResponseName(){let e=new c.MultiMap;return this.collectFieldsByResponseName(e),e}collectFieldsByResponseName(e){for(let t of this.selections())"FieldSelection"===t.kind?e.add(t.element.responseName(),t):t.selectionSet.collectFieldsByResponseName(e)}usedVariables(){let e=new s.VariableCollector;return this.collectVariables(e),e.variables()}collectVariables(e){for(let t of this.selections())t.collectVariables(e)}collectUsedFragmentNames(e){for(let t of this.selections())t.collectUsedFragmentNames(e)}optimize(e){if(!e||e.isEmpty())return this;let t=new M(new v(this.parentType,this.parentType),this),i=F.ofInitial(k.build(this)),n=t.optimize(e,i);return n instanceof U?R(this.parentType,n):n.selectionSet}optimizeSelections(e,t){return this.lazyMap(i=>i.optimize(e,t))}expandFragments(e){return this.lazyMap(t=>t.expandFragments(e))}normalize({parentType:e,recursive:t}){return this.lazyMap(i=>i.normalize({parentType:e,recursive:t}),{parentType:e})}lazyMap(e,t){var i;let n,r=this.selections();for(let t=0;t<r.length;t++){let i=r[t],a=e(i);if(a!==i&&!n){n=new N;for(let e=0;e<t;e++)n.add(r[e])}a&&n&&n.add(a)}return n?n.toSelectionSet(null!=(i=null==t?void 0:t.parentType)?i:this.parentType):this}withoutDefer(e){return this.lazyMap(t=>t.withoutDefer(e))}withNormalizedDefer(e){return this.lazyMap(t=>t.withNormalizedDefer(e))}hasDefer(){return this.selections().some(e=>e.hasDefer())}filter(e){return this.lazyMap(t=>e(t)?t:void 0)}filterRecursiveDepthFirst(e){return this.lazyMap(t=>t.filterRecursiveDepthFirst(e))}withoutEmptyBranches(){let e=this.filterRecursiveDepthFirst(e=>{var t;return(null==(t=e.selectionSet)?void 0:t.isEmpty())!==!0});return e.isEmpty()?void 0:e}rebaseOn({parentType:e,fragments:t,errorIfCannotRebase:i}){if(this.parentType===e)return this;let n=new Map;for(let r of this.selections()){let a=r.rebaseOn({parentType:e,fragments:t,errorIfCannotRebase:i});a&&n.set(r.key(),a)}return new b(e,n)}equals(e){if(this===e)return!0;if(this._selections.length!==e._selections.length)return!1;for(let[t,i]of this._keyedSelections){let n=e._keyedSelections.get(t);if(!n||!i.equals(n))return!1}return!0}contains(e,t){var i;let r=null!=(i=null==t?void 0:t.ignoreMissingTypename)&&i;if(e._selections.length>this._selections.length&&(!r||e._selections.length>this._selections.length+1||this.hasTopLevelTypenameField()||!e.hasTopLevelTypenameField()))return n.NOT_CONTAINED;let a=!0,o=!1;for(let[i,l]of e._keyedSelections){if(i===s.typenameFieldName&&r){this._keyedSelections.has(s.typenameFieldName)||(o=!0);continue}let e=this._keyedSelections.get(i),u=null==e?void 0:e.contains(l,t);if(void 0===u||u===n.NOT_CONTAINED)return n.NOT_CONTAINED;a&&(a=u===n.EQUAL)}return a&&e._selections.length===this._selections.length+ +!!o?n.EQUAL:n.STRICTLY_CONTAINED}containsTopLevelField(e){let t=this._keyedSelections.get(e.key());return!!t&&t.element.equals(e)}minus(e){let t=new N;for(let[i,n]of this._keyedSelections){let r=e._keyedSelections.get(i);if(r){let e=n.minus(r);e&&t.add(e)}else t.add(n)}return t.toSelectionSet(this.parentType)}intersectionWith(e){if(this.isEmpty())return this;if(e.isEmpty())return e;let t=new N;for(let[i,n]of this._keyedSelections){let r=e._keyedSelections.get(i);if(r){let e=n.intersectionWith(r);e&&t.add(e)}}return t.toSelectionSet(this.parentType)}canRebaseOn(e){return this.selections().every(t=>t.canAddTo(e))}validate(e,t=!1){for(let i of(h(!this.isEmpty(),()=>"Invalid empty selection set"),this.selections()))i.validate(e,t)}isEmpty(){return 0===this._selections.length}toSelectionSetNode(){return this.isEmpty()?{kind:a.Kind.SELECTION_SET,selections:[{kind:a.Kind.FIELD,name:{kind:a.Kind.NAME,value:"..."}}]}:{kind:a.Kind.SELECTION_SET,selections:Array.from(this.selectionsInPrintOrder(),e=>e.toSelectionNode())}}selectionsInPrintOrder(){let e=e=>"FieldSelection"===e.kind&&e.isPlainTypenameField(),t=this._selections.find(t=>e(t));return t?[t].concat(this.selections().filter(t=>!e(t))):this._selections}toOperationPaths(){return this.toOperationPathsInternal([])}toOperationPathsInternal(e){return this.selections().flatMap(t=>{let i=e.map(e=>e.concat(t.element));return t.selectionSet?t.selectionSet.toOperationPathsInternal(i):i})}forEachElement(e){var t;let i=this.selectionsInReverseOrder().concat();for(;i.length>0;){let n=i.pop();e(n.element),null==(t=n.selectionSet)||t.selectionsInReverseOrder().forEach(e=>i.push(e))}}some(e){for(let t of this.selections())if(e(t.element)||t.selectionSet&&t.selectionSet.some(e))return!0;return!1}toOperationString(e,t,i,n,r,a=!1,o=!0){let l=o?"":void 0,u=a||!i||i.isEmpty()?"":i.toString(l)+"\n\n";return"query"==e&&!n&&t.isEmpty()?u+this.toString(a,!0,l):u+e+(n?" "+(n+(t.isEmpty()?"":t.toString())):t.isEmpty()?"":" "+t.toString())+(0,s.directivesToString)(r)+" "+this.toString(a,!0,l)}toString(e=!0,t=!0,i){if(this.isEmpty())return"{}";if(void 0===i){let i=this.selections().map(t=>t.toString(e)).join(" ");return t?"{ "+i+" }":i}{let n=t?i+" ":i,r=this.selections().map(t=>t.toString(e,n)).join("\n");return t?"{\n"+r+"\n"+i+"}":r}}isWorthUsing(){let e=this.selections();if(0===e.length)return!1;if(1===e.length){let t=e[0];return!("FieldSelection"===t.kind&&t.element.isLeafField())}return!0}}i.SelectionSet=b;class N{constructor(){this.keyedUpdates=new c.MultiMap}isEmpty(){return 0===this.keyedUpdates.size}add(e){return _(this.keyedUpdates,e),this}addAtPath(e,t){if(0===e.length)t&&_(this.keyedUpdates,t);else{if(1===e.length&&!t){let t=e[0];if("Field"===t.kind&&t.isLeafField()){let e=L(t);return this.keyedUpdates.add(e.key(),e),this}}this.keyedUpdates.add(e[0].key(),{path:e,selections:t})}return this}clone(){let e=new N;for(let[t,i]of this.keyedUpdates.entries())e.keyedUpdates.set(t,Array.from(i));return e}clear(){this.keyedUpdates.clear()}toSelectionSet(e,t){return function e(t,i,n){let r=new Map;for(let[a,o]of i.entries())r.set(a,function(t,i,n){var r,a,o,l;(0,c.assert)(i.length>0,"Should not be called without any updates");let u=i[0];if(1===i.length&&u instanceof C)return u.rebaseOnOrError({parentType:t,fragments:n});let d=((r=u)instanceof C?r.element:r.path[0]).rebaseOnOrError(t),p="Field"===d.kind?d.baseType():d.castedType();if(!(0,s.isCompositeType)(p))return L(d);let h=new c.MultiMap;for(let e of i){e instanceof C?e.selectionSet&&_(h,e.selectionSet):(a=h,o=p,1===(l=e).path.length?l.selections&&_(a,function e(t,i){if(i instanceof C)return"FragmentSelection"===i.kind&&A(t,i)?e(t,i.selectionSet):i;let n=i instanceof b?i.selections():i,r=[];for(let i of n)if("FragmentSelection"===i.kind&&A(t,i)){let n=e(t,i.selectionSet);if(n instanceof C)r.push(n);else for(let e of n)r.push(e)}else r.push(i);return r}(o,l.selections)):a.add(l.path[1].key(),{path:l.path.slice(1),selections:l.selections}))}return L(d,e(p,h,n))}(t,o,n));return new b(t,r)}(e,this.keyedUpdates,t)}toString(){return"{\n"+[...this.keyedUpdates.entries()].map(([e,t])=>{let i=t.map(e=>e instanceof C?e.toString():`${e.path} -> ${e.selections}`);return` - ${e}: ${i}`}).join("\n")+"\n}"}}function _(e,t){if(t instanceof C)D(e,t);else for(let i of t instanceof b?t.selections():t)D(e,i)}function D(e,t){t instanceof U?e.set(t.key(),[t]):e.add(t.key(),t)}function A(e,t){return 0===t.element.appliedDirectives.length&&(!t.element.typeCondition||(0,u.isSubtype)(function(e,t){if(e.schema()===t)return e;let i=t.type(e.name);return(0,c.assert)(i&&(0,s.isCompositeType)(i),()=>`Expected ${e} to exists and be composite in the rebased schema, but got ${null==i?void 0:i.kind}`),i}(t.element.typeCondition,e.schema()),e))}i.SelectionSetUpdates=N;class O{constructor(e,t,i){this.parentType=e,this._updates=t,this.memoizer=i}static empty(e){return this.emptyWithMemoized(e,()=>({}))}static emptyWithMemoized(e,t){return new O(e,new N,t)}static of(e){return this.ofWithMemoized(e,()=>({}))}static ofWithMemoized(e,t){let i=new O(e.parentType,new N,t);return i._updates.add(e),i.computed=e,i}isEmpty(){return this._updates.isEmpty()}get(){return this.computed||(this.computed=this._updates.toSelectionSet(this.parentType),this._updates.clear(),this._updates.add(this.computed)),this.computed}updates(){return this.computed=void 0,this._memoized=void 0,this._updates}clone(){let e=new O(this.parentType,this._updates.clone(),this.memoizer);return e.computed=this.computed,e._memoized=this._memoized,e}rebaseOn(e){let t=new O(e,new N,this.memoizer);return t._updates.add(this.get()),t}memoized(){return this._memoized||(this._memoized=this.memoizer(this.get())),this._memoized}toString(){return this.get().toString()}}function R(e,t){let i=new Map;return i.set(t.key(),t),new b(e,i)}function w(e,t){return R(e.parentType,L(e,t))}function L(e,t){return"Field"===e.kind?new P(e,t):new M(e,t)}i.MutableSelectionSet=O,i.allFieldDefinitionsInSelectionSet=function(e){let t=Array.from(e.selections()),i=[];for(;t.length>0;){let e=t.pop();"FieldSelection"===e.kind&&i.push(e.element.definition),e.selectionSet&&t.push(...e.selectionSet.selections())}return i},i.selectionSetOf=R,i.selectionSetOfElement=w,i.selectionOfElement=L;class C{constructor(e){this.element=e}rebaseOnOrError({parentType:e,fragments:t}){return this.rebaseOn({parentType:e,fragments:t,errorIfCannotRebase:!0})}get parentType(){return this.element.parentType}isTypenameField(){return!1}collectVariables(e){var t;this.element.collectVariables(e),null==(t=this.selectionSet)||t.collectVariables(e)}collectUsedFragmentNames(e){var t;null==(t=this.selectionSet)||t.collectUsedFragmentNames(e)}withUpdatedSelectionSet(e){return this.withUpdatedComponents(this.element,e)}withUpdatedElement(e){return this.withUpdatedComponents(e,this.selectionSet)}mapToSelectionSet(e){if(!this.selectionSet)return this.us();let t=e(this.selectionSet);return t===this.selectionSet?this.us():this.withUpdatedSelectionSet(t)}isFragmentSpread(){return!1}minus(e){if(this.selectionSet&&e.selectionSet){let t=this.selectionSet.minus(e.selectionSet);if(!t.isEmpty())return this.withUpdatedSelectionSet(t)}}intersectionWith(e){if(!this.selectionSet||!e.selectionSet)return this.us();{let t=this.selectionSet.intersectionWith(e.selectionSet);if(t.isEmpty())return;return this.withUpdatedSelectionSet(t)}}tryOptimizeSubselectionWithFragments({parentType:e,subSelection:t,fragments:i,validator:r,canUseFullMatchingFragment:a}){let s=i.maybeApplyingDirectlyAtType(e);if(0===s.length)return t;let o=[];for(let i of s){let s=i.expandedSelectionSetAtType(e);if(s.selectionSet.isEmpty()||1===s.selectionSet.selections().length&&s.selectionSet.selections()[0].isTypenameField())continue;let l=t.contains(s.selectionSet,{ignoreMissingTypename:!0});if(l===n.EQUAL){if(a(i)){if(!r.checkCanReuseFragmentAndTrackIt(s))continue;return i}0===i.appliedDirectives.length&&o.push({fragment:i,atType:s})}else l===n.STRICTLY_CONTAINED&&0===i.appliedDirectives.length&&o.push({fragment:i,atType:s})}if(0===o.length)return t;let l=o.filter(({fragment:e})=>!o.some(t=>t.fragment.includes(e.name))),u=t,c=new N;for(let{fragment:n,atType:a}of l){if(!r.checkCanReuseFragmentAndTrackIt(a))continue;let s=t.minus(a.selectionSet);u=u.intersectionWith(s),c.add(new U(e,i,n,[]))}return c.add(u).toSelectionSet(e,i)}}class F{constructor(e){this.validators=e}static ofInitial(e){return new F([e])}forField(e){let t=this.validators.flatMap(t=>t.forField(e));return(0,c.assert)(t.length>0,`Shoud have found at least one validator for ${e}`),new F(t)}checkCanReuseFragmentAndTrackIt(e){let t=e.validator;if(!t)return!0;if(!this.validators.every(e=>e.doMergeWith(t)))return!1;if(this.usedSpreadTrimmedPartAtLevel){if(!this.usedSpreadTrimmedPartAtLevel.every(e=>t.doMergeWith(e)))return!1}else this.usedSpreadTrimmedPartAtLevel=[];return this.usedSpreadTrimmedPartAtLevel.push(t),!0}}class k{constructor(e){this.byResponseName=e}static build(e){return k.forLevel(e.fieldsInSet())}static forLevel(e){var t;let i=new Map;for(let{field:n}of e){let e=n.element.responseName(),r=i.get(e);if(r||(r=new Map,i.set(e,r)),n.selectionSet){let e=null!=(t=r.get(n.element))?t:[];r.set(n.element,e.concat(n.selectionSet.fieldsInSet()))}else r.set(n.element,null)}let n=new Map;for(let[e,t]of i.entries()){let i=new Map;for(let[e,n]of t){let t=n?k.forLevel(n):null;i.set(e,t)}n.set(e,i)}return new k(n)}forField(e){let t=this.byResponseName.get(e.responseName());return t?(0,c.mapValues)(t).filter(e=>!!e):[]}doMergeWith(e){var t,i;for(let[n,r]of this.byResponseName.entries()){let a=e.byResponseName.get(n);if(a)for(let[e,n]of r.entries())for(let[r,o]of a.entries()){if(!(0,u.typesCanBeMerged)(e.definition.type,r.definition.type))return!1;let a=e.parentType,l=r.parentType;if(!(0,u.sameType)(a,l)&&(0,s.isObjectType)(a)&&(0,s.isObjectType)(l)){if(n&&o&&!n.hasSameResponseShapeThan(o))return!1}else if(e.name!==r.name||!(0,d.argumentsEquals)(null!=(t=e.args)?t:{},null!=(i=r.args)?i:{})||n&&o&&!n.doMergeWith(o))return!1}}return!0}hasSameResponseShapeThan(e){for(let[t,i]of this.byResponseName.entries()){let n=e.byResponseName.get(t);if(n){for(let[e,t]of i.entries())for(let[i,r]of n.entries())if(!(0,u.typesCanBeMerged)(e.definition.type,i.definition.type)||t&&r&&!t.hasSameResponseShapeThan(r))return!1}}return!0}toString(e=""){return"{\n"+[...this.byResponseName.entries()].map(([t,i])=>{let n=e+" ";return`${n}${t}: [
|
|
17
|
+
${i})`}function E(e,t){return`${e}${p(l(e,t),t)}`}function I(e){return 0!==e.length?"{\n"+e.join("\n")+"\n}":""}i.defaultPrintOptions={indentString:" ",definitionsOrder:["schema","directives","types"],rootTypesOrder:["query","mutation","subscription"],mergeTypesAndExtensions:!1,showAllBuiltIns:!1,noDescriptions:!1,typeFilter:()=>!0,fieldFilter:()=>!0,directiveApplicationFilter:()=>!0},i.orderPrintedDefinitions=function(e){return{...e,typeCompareFn:(e,t)=>e.name.localeCompare(t.name),implementedInterfaceCompareFn:(e,t)=>e.interface.name.localeCompare(t.interface.name),fieldCompareFn:(e,t)=>e.name.localeCompare(t.name),unionMemberCompareFn:(e,t)=>e.type.name.localeCompare(t.type.name),enumValueCompareFn:(e,t)=>e.name.localeCompare(t.name),inputObjectFieldCompareFn:(e,t)=>e.name.localeCompare(t.name),directiveCompareFn:(e,t)=>e.name.localeCompare(t.name)}},i.shallowOrderPrintedDefinitions=function(e){return{...e,typeCompareFn:(e,t)=>e.name.localeCompare(t.name),directiveCompareFn:(e,t)=>e.name.localeCompare(t.name)}},i.printSchema=function(e,t=i.defaultPrintOptions){var n;if(!(3===t.definitionsOrder.length&&t.definitionsOrder.indexOf("schema")>=0&&t.definitionsOrder.indexOf("types")>=0&&t.definitionsOrder.indexOf("directives")>=0))throw Error(`'definitionsOrder' should be a 3-element array containing 'schema', 'types' and 'directives' in the desired order (got: [${t.definitionsOrder.join(", ")}])`);let r=t.showAllBuiltIns?e.allDirectives():e.directives();t.directiveDefinitionFilter&&(r=r.filter(t.directiveDefinitionFilter)),t.directiveCompareFn&&(r=r.concat().sort(t.directiveCompareFn));let s=t.showAllBuiltIns?e.allTypes():e.types();t.typeFilter&&(s=s.filter(t.typeFilter)),t.typeCompareFn&&(s=s.concat().sort(t.typeCompareFn));let o=[,,,];return o[t.definitionsOrder.indexOf("schema")]=(n=e.schemaDefinition,a(n,t,u)),o[t.definitionsOrder.indexOf("directives")]=r.map(e=>d(e,t)),o[t.definitionsOrder.indexOf("types")]=s.flatMap(e=>c(e,t)),o.flat().join("\n\n")},i.printType=function(e,t=i.defaultPrintOptions){let r=c(e,t);return(0,n.assert)(1==r.length,`Type ${e} is built from more than 1 definition or extension`),r[0]},i.printTypeDefinitionAndExtensions=c,i.printDirectiveDefinition=d},836270,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.addIntrospectionFields=i.isIntrospectionName=i.introspectionTypeNames=i.introspectionFieldNames=void 0;let n=e.r(186846),r=e.r(168032);i.introspectionFieldNames=["__schema","__type"],i.introspectionTypeNames=["__Schema","__Directive","__DirectiveLocation","__Type","__Field","__InputValue","__EnumValue","__TypeKind"],i.isIntrospectionName=function(e){return e.startsWith("__")},i.addIntrospectionFields=function(e){if(e.type("__Schema"))return;let t=e.addType(new r.EnumType("__TypeKind",!0));t.addValue("SCALAR"),t.addValue("OBJECT"),t.addValue("INTERFACE"),t.addValue("UNION"),t.addValue("ENUM"),t.addValue("INPUT_OBJECT"),t.addValue("LIST"),t.addValue("NON_NULL");let i=e.addType(new r.ObjectType("__InputValue",!0)),a=e.addType(new r.ObjectType("__Field",!0)),s=e.addType(new r.ObjectType("__Type",!0)),o=e.addType(new r.ObjectType("__EnumValue",!0));s.addField("kind",new r.NonNullType(t)),s.addField("name",e.stringType()),s.addField("description",e.stringType()),s.addField("fields",new r.ListType(new r.NonNullType(a))).addArgument("includeDeprecated",e.booleanType(),!1),s.addField("interfaces",new r.ListType(new r.NonNullType(s))),s.addField("possibleTypes",new r.ListType(new r.NonNullType(s))),s.addField("enumValues",new r.ListType(new r.NonNullType(o))).addArgument("includeDeprecated",e.booleanType(),!1),s.addField("inputFields",new r.ListType(new r.NonNullType(i))).addArgument("includeDeprecated",e.booleanType(),!1),s.addField("ofType",s),s.addField("specifiedByURL",e.stringType()),a.addField("name",new r.NonNullType(e.stringType())),a.addField("description",e.stringType()),a.addField("args",new r.NonNullType(new r.ListType(new r.NonNullType(i)))).addArgument("includeDeprecated",e.booleanType(),!1),a.addField("type",new r.NonNullType(s)),a.addField("isDeprecated",new r.NonNullType(e.booleanType())),a.addField("deprecationReason",e.stringType()),i.addField("name",new r.NonNullType(e.stringType())),i.addField("description",e.stringType()),i.addField("type",new r.NonNullType(s)),i.addField("defaultValue",e.stringType()),i.addField("isDeprecated",new r.NonNullType(e.booleanType())),i.addField("deprecationReason",e.stringType()),o.addField("name",new r.NonNullType(e.stringType())),o.addField("description",e.stringType()),o.addField("isDeprecated",new r.NonNullType(e.booleanType())),o.addField("deprecationReason",e.stringType());let l=e.addType(new r.EnumType("__DirectiveLocation",!0));for(let e of Object.values(n.DirectiveLocation))l.addValue(e);let u=e.addType(new r.ObjectType("__Directive",!0));u.addField("name",new r.NonNullType(e.stringType())),u.addField("description",e.stringType()),u.addField("locations",new r.NonNullType(new r.ListType(new r.NonNullType(l)))),u.addField("args",new r.NonNullType(new r.ListType(new r.NonNullType(i)))).addArgument("includeDeprecated",e.booleanType(),!1),u.addField("isRepeatable",new r.NonNullType(e.booleanType()));let c=e.addType(new r.ObjectType("__Schema",!0));c.addField("description",e.stringType()),c.addField("types",new r.NonNullType(new r.ListType(new r.NonNullType(s)))),c.addField("queryType",new r.NonNullType(s)),c.addField("mutationType",new r.NonNullType(s)),c.addField("subscriptionType",new r.NonNullType(s)),c.addField("directives",new r.NonNullType(new r.ListType(new r.NonNullType(u))));let d=e.schemaDefinition.rootType("query");d||(d=e.addType(new r.ObjectType("Query")),e.schemaDefinition.setRoot("query",d)),d.addField(new r.FieldDefinition("__schema",!0),new r.NonNullType(c)),d.addField(new r.FieldDefinition("__type",!0),s).addArgument("name",new r.NonNullType(e.stringType()))}},622100,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.validateSchema=void 0;let n=e.r(168032),r=e.r(186846),a=e.r(367356),s=e.r(836270),o=e.r(678270),l=e.r(408470);i.validateSchema=function(e){return new c(e).validate()};class u{constructor(e){this.onError=e,this.visitedTypes=new Set,this.fieldPath=[],this.fieldPathIndexByTypeName=new Map}detectCycles(e){if(!this.visitedTypes.has(e.name)){for(let t of(this.visitedTypes.add(e.name),this.fieldPathIndexByTypeName.set(e.name,this.fieldPath.length),e.fields()))if((0,n.isNonNullType)(t.type)&&(0,n.isInputObjectType)(t.type.ofType)){let e=t.type.ofType,i=this.fieldPathIndexByTypeName.get(e.name);if(this.fieldPath.push(t),void 0===i)this.detectCycles(e);else{let t=this.fieldPath.slice(i),r=t.map(e=>e.name).join(".");this.onError(`Cannot reference Input Object "${e.name}" within itself through a series of non-null fields: "${r}".`,{nodes:(0,n.sourceASTs)(...t)})}this.fieldPath.pop()}this.fieldPathIndexByTypeName.delete(e.name)}}}class c{constructor(e){this.schema=e,this.emptyVariables=new n.VariableDefinitions,this.hasMissingTypes=!1,this.errors=[]}validate(){for(let e of this.schema.types())switch(!s.introspectionTypeNames.includes(e.name)&&this.validateName(e),e.kind){case"ObjectType":case"InterfaceType":this.validateObjectOrInterfaceType(e);break;case"InputObjectType":this.validateInputObjectType(e);break;case"UnionType":this.validateUnionType(e);break;case"EnumType":this.validateEnumType(e)}for(let e of this.schema.allDirectives()){for(let t of(this.validateName(e),e.arguments()))this.validateArg(t);for(let t of e.applications())this.validateDirectiveApplication(e,t)}if(!this.hasMissingTypes){let e=new u((e,t)=>this.addError(e,t));for(let t of this.schema.types())switch(t.kind){case"ObjectType":case"InterfaceType":this.validateImplementedInterfaces(t);break;case"InputObjectType":e.detectCycles(t)}}return this.errors}addError(e,t){this.errors.push(l.ERRORS.INVALID_GRAPHQL.err(e,t))}validateHasType(e){return e.type||(this.addError(`Element ${e.coordinate} does not have a type set`,{nodes:e.sourceAST}),this.hasMissingTypes=!1),!!e.type}validateName(e){if((0,s.isIntrospectionName)(e.name))return void this.addError(`Name "${e.name}" must not begin with "__", which is reserved by GraphQL introspection.`,e.sourceAST?{nodes:e.sourceAST}:{});try{(0,r.assertName)(e.name)}catch(t){this.addError(t.message,e.sourceAST?{nodes:e.sourceAST}:{})}}validateObjectOrInterfaceType(e){for(let t of(e.hasFields()||this.addError(`Type ${e.name} must define one or more fields.`,{nodes:e.sourceAST}),e.fields()))for(let e of(this.validateName(t),this.validateHasType(t),t.arguments()))this.validateArg(e)}validateImplementedInterfaces(e){for(let t of(e.implementsInterface(e.name)&&this.addError(`Type ${e} cannot implement itself because it would create a circular reference.`,{nodes:(0,n.sourceASTs)(e,e.interfaceImplementation(e.name))}),e.interfaces())){for(let i of t.fields()){let t=e.field(i.name);if(!t){this.addError(`Interface field ${i.coordinate} expected but ${e} does not provide it.`,{nodes:(0,n.sourceASTs)(i,e)});continue}for(let e of(this.validateHasType(i)&&!(0,o.isSubtype)(i.type,t.type)&&this.addError(`Interface field ${i.coordinate} expects type ${i.type} but ${t.coordinate} of type ${t.type} is not a proper subtype.`,{nodes:(0,n.sourceASTs)(i,t)}),i.arguments())){let i=t.argument(e.name);if(!i){this.addError(`Interface field argument ${e.coordinate} expected but ${t.coordinate} does not provide it.`,{nodes:(0,n.sourceASTs)(e,t)});continue}this.validateHasType(e)&&!(0,o.sameType)(e.type,i.type)&&this.addError(`Interface field argument ${e.coordinate} expects type ${e.type} but ${i.coordinate} is type ${i.type}.`,{nodes:(0,n.sourceASTs)(e,i)})}for(let e of t.arguments())!i.argument(e.name)&&e.isRequired()&&this.addError(`Field ${t.coordinate} includes required argument ${e.name} that is missing from the Interface field ${i.coordinate}.`,{nodes:(0,n.sourceASTs)(e,i)})}for(let i of t.interfaces())e.implementsInterface(i)||(i===e?this.addError(`Type ${e} cannot implement ${t} because it would create a circular reference.`,{nodes:(0,n.sourceASTs)(e,t)}):this.addError(`Type ${e} must implement ${i} because it is implemented by ${t}.`,{nodes:(0,n.sourceASTs)(e,t,i)}))}}validateInputObjectType(e){for(let t of(e.hasFields()||this.addError(`Input Object type ${e.name} must define one or more fields.`,{nodes:e.sourceAST}),e.fields()))this.validateName(t),this.validateHasType(t)&&(t.isRequired()&&t.isDeprecated()&&this.addError(`Required input field ${t.coordinate} cannot be deprecated.`,{nodes:(0,n.sourceASTs)(t.appliedDirectivesOf("deprecated")[0],t)}),void 0===t.defaultValue||(0,a.isValidValue)(t.defaultValue,t,new n.VariableDefinitions)||this.addError(`Invalid default value (got: ${(0,a.valueToString)(t.defaultValue)}) provided for input field ${t.coordinate} of type ${t.type}.`,{nodes:(0,n.sourceASTs)(t)}))}validateArg(e){if(this.validateName(e),this.validateHasType(e)&&(e.isRequired()&&e.isDeprecated()&&this.addError(`Required argument ${e.coordinate} cannot be deprecated.`,{nodes:(0,n.sourceASTs)(e.appliedDirectivesOf("deprecated")[0],e)}),void 0!==e.defaultValue&&!(0,a.isValidValue)(e.defaultValue,e,new n.VariableDefinitions))){let t=this.schema.builtInScalarTypes().find(t=>e.type&&(0,n.isScalarType)(e.type)&&t.name===e.type.name);t&&(0,a.isValidValueApplication)(e.defaultValue,t,e.defaultValue,new n.VariableDefinitions)||this.addError(`Invalid default value (got: ${(0,a.valueToString)(e.defaultValue)}) provided for argument ${e.coordinate} of type ${e.type}.`,{nodes:(0,n.sourceASTs)(e)})}}validateUnionType(e){0===e.membersCount()&&this.addError(`Union type ${e.coordinate} must define one or more member types.`,{nodes:e.sourceAST})}validateEnumType(e){for(let t of(0===e.values.length&&this.addError(`Enum type ${e.coordinate} must define one or more values.`,{nodes:e.sourceAST}),e.values))this.validateName(t),("true"===t.name||"false"===t.name||"null"===t.name)&&this.addError(`Enum type ${e.coordinate} cannot include value: ${t}.`,{nodes:t.sourceAST})}validateDirectiveApplication(e,t){for(let i of e.arguments()){let r=t.arguments()[i.name];if(r&&i.type&&!(0,a.isValidValue)(r,i,this.emptyVariables)){let r=t.parent,a=r instanceof n.NamedSchemaElement?r.coordinate:"schema";this.addError(`Invalid value for "${i.coordinate}" of type "${i.type}" in application of "${e.coordinate}" to "${a}".`,{nodes:(0,n.sourceASTs)(t,i)})}}}}},168032,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.CoreFeature=i.defaultSchemaBlueprint=i.SchemaBlueprint=i.NamedSchemaElementWithType=i.NamedSchemaElement=i.SchemaElement=i.Extension=i.sourceASTs=i.DirectiveTargetElement=i.isLeafType=i.typeFromAST=i.typeToAST=i.isTypeSystemDirectiveLocation=i.typeSystemDirectiveLocations=i.isExecutableDirectiveLocation=i.executableDirectiveLocations=i.isConditionalDirective=i.supertypes=i.runtimeTypesIntersects=i.possibleRuntimeTypes=i.isCompositeType=i.isAbstractType=i.isNullableType=i.baseType=i.filterTypesOfKind=i.isTypeOfKind=i.isInputType=i.isOutputType=i.isInputObjectType=i.isUnionType=i.isEnumType=i.isInterfaceType=i.isObjectType=i.isIDType=i.isBooleanType=i.isFloatType=i.isStringType=i.isIntType=i.isCustomScalarType=i.isScalarType=i.isNonNullType=i.isListType=i.isWrapperType=i.isNamedType=i.isSchemaRootType=i.defaultRootName=i.allSchemaRootKinds=i.typenameFieldName=i.ErrGraphQLAPISchemaValidationFailed=i.ErrGraphQLValidationFailed=void 0,i.isElementNamedType=i.isFieldDefinition=i.copyDirectiveDefinitionToSchema=i.newNamedType=i.variableDefinitionFromAST=i.variableDefinitionsFromAST=i.VariableDefinitions=i.VariableDefinition=i.isVariable=i.VariableCollector=i.Variable=i.directiveApplicationsSubstraction=i.isDirectiveApplicationsSubset=i.sameDirectiveApplications=i.sameDirectiveApplication=i.directivesToDirectiveNodes=i.directivesToString=i.Directive=i.DirectiveDefinition=i.EnumValue=i.ArgumentDefinition=i.InputFieldDefinition=i.FieldDefinition=i.NonNullType=i.ListType=i.InputObjectType=i.EnumType=i.UnionType=i.UnionMember=i.InterfaceType=i.ObjectType=i.InterfaceImplementation=i.ScalarType=i.SchemaDefinition=i.RootType=i.Schema=i.CoreFeatures=void 0;let n=e.r(186846),r=e.r(785576),a=e.r(331484),s=e.r(367356),o=e.r(193151),l=e.r(355415),u=e.r(383105),c=e.r(678270),d=e.r(836270),p=e.r(563029),h=e.r(359063),f=e.r(622100),m=e.r(343924),y=e.r(308126),v=e.r(408470),g=e.r(319894),T="The schema is not a valid GraphQL schema.",S=new Set;function E(e){return e.charAt(0).toUpperCase()+e.slice(1)}function I(e){return b(e)||N(e)}function b(e){return"ListType"==e.kind}function N(e){return"NonNullType"==e.kind}function _(e){return"ScalarType"==e.kind}function D(e){return"ObjectType"==e.kind}function A(e){return"InterfaceType"==e.kind}function O(e){return"EnumType"==e.kind}function R(e){return"UnionType"==e.kind}function w(e){switch(k(e).kind){case"ScalarType":case"ObjectType":case"UnionType":case"EnumType":case"InterfaceType":return!0;default:return!1}}function L(e){switch(k(e).kind){case"ScalarType":case"EnumType":case"InputObjectType":return!0;default:return!1}}function C(e,t){return e.kind===t}function F(e,t){return e.reduce((e,i)=>(C(i,t)&&e.push(i),e),[])}function k(e){return I(e)?e.baseType():e}function P(e){switch(e.kind){case"InterfaceType":return e.possibleRuntimeTypes();case"UnionType":return e.types();case"ObjectType":return[e]}}i.ErrGraphQLValidationFailed=(e,t=T)=>(0,v.aggregateError)("GraphQLValidationFailed",t,e),i.ErrGraphQLAPISchemaValidationFailed=e=>(0,v.aggregateError)("GraphQLAPISchemaValidationFailed","The supergraph schema failed to produce a valid API schema",e),i.typenameFieldName="__typename",i.allSchemaRootKinds=["query","mutation","subscription"],i.defaultRootName=E,i.isSchemaRootType=function(e){return D(e)&&e.isRootType()},i.isNamedType=function(e){return e instanceof J},i.isWrapperType=I,i.isListType=b,i.isNonNullType=N,i.isScalarType=_,i.isCustomScalarType=function(e){return _(e)&&!Z.includes(e.name)},i.isIntType=function(e){return e===e.schema().intType()},i.isStringType=function(e){return e===e.schema().stringType()},i.isFloatType=function(e){return e===e.schema().floatType()},i.isBooleanType=function(e){return e===e.schema().booleanType()},i.isIDType=function(e){return e===e.schema().idType()},i.isObjectType=D,i.isInterfaceType=A,i.isEnumType=O,i.isUnionType=R,i.isInputObjectType=function(e){return"InputObjectType"==e.kind},i.isOutputType=w,i.isInputType=L,i.isTypeOfKind=C,i.filterTypesOfKind=F,i.baseType=k,i.isNullableType=function(e){return!N(e)},i.isAbstractType=function(e){return A(e)||R(e)},i.isCompositeType=function(e){return D(e)||A(e)||R(e)},i.possibleRuntimeTypes=P,i.runtimeTypesIntersects=function(e,t){if(e===t)return!0;let i=P(e),n=P(t);for(let e of i)if(n.some(t=>e.name===t.name))return!0;return!1},i.supertypes=function(e){switch(e.kind){case"InterfaceType":return e.interfaces();case"UnionType":return[];case"ObjectType":return e.interfaces().concat(e.unionsWhereMember())}},i.isConditionalDirective=function(e){return["include","skip"].includes(e.name)},i.executableDirectiveLocations=[n.DirectiveLocation.QUERY,n.DirectiveLocation.MUTATION,n.DirectiveLocation.SUBSCRIPTION,n.DirectiveLocation.FIELD,n.DirectiveLocation.FRAGMENT_DEFINITION,n.DirectiveLocation.FRAGMENT_SPREAD,n.DirectiveLocation.INLINE_FRAGMENT,n.DirectiveLocation.VARIABLE_DEFINITION];let x=new Set(i.executableDirectiveLocations);function M(e){return x.has(e)}i.isExecutableDirectiveLocation=M,i.typeSystemDirectiveLocations=[n.DirectiveLocation.SCHEMA,n.DirectiveLocation.SCALAR,n.DirectiveLocation.OBJECT,n.DirectiveLocation.FIELD_DEFINITION,n.DirectiveLocation.ARGUMENT_DEFINITION,n.DirectiveLocation.INTERFACE,n.DirectiveLocation.UNION,n.DirectiveLocation.ENUM,n.DirectiveLocation.ENUM_VALUE,n.DirectiveLocation.INPUT_OBJECT,n.DirectiveLocation.INPUT_FIELD_DEFINITION];let U=new Set(i.typeSystemDirectiveLocations);function $(e){return U.has(e)}function j(e){switch(e.kind){case"ListType":return{kind:n.Kind.LIST_TYPE,type:j(e.ofType)};case"NonNullType":return{kind:n.Kind.NON_NULL_TYPE,type:j(e.ofType)};default:return{kind:n.Kind.NAMED_TYPE,name:{kind:n.Kind.NAME,value:e.name}}}}function V(e,t){switch(t.kind){case n.Kind.LIST_TYPE:return new eg(V(e,t.type));case n.Kind.NON_NULL_TYPE:return new eT(V(e,t.type));default:let i=e.type(t.name.value);if(!i)throw v.ERRORS.INVALID_GRAPHQL.err(`Unknown type "${t.name.value}"`,{nodes:t});return i}}i.isTypeSystemDirectiveLocation=$,i.typeToAST=j,i.typeFromAST=V,i.isLeafType=function(e){return _(e)||O(e)};class G{constructor(e,t=[]){this._schema=e,this.appliedDirectives=t.map(e=>this.attachDirective(e))}schema(){return this._schema}attachDirective(e){let t=e.isAttached()?new e_(e.name,e.arguments()):e;return B.prototype.setParent.call(t,this),t}appliedDirectivesOf(e){let t="string"==typeof e?e:e.name;return this.appliedDirectives.filter(e=>e.name==t)}hasAppliedDirective(e){let t="string"==typeof e?e:e.name;return this.appliedDirectives.some(e=>e.name==t)}appliedDirectivesToDirectiveNodes(){return eA(this.appliedDirectives)}appliedDirectivesToString(){return eD(this.appliedDirectives)}collectVariablesInAppliedDirectives(e){for(let t of this.appliedDirectives)e.collectInArguments(t.arguments())}}i.DirectiveTargetElement=G,i.sourceASTs=function(...e){return e.map(e=>null==e?void 0:e.sourceAST).filter(e=>void 0!==e)};class B{schema(){let e=this.schemaInternal();return(0,a.assert)(e,"requested schema does not exist. Probably because the element is unattached"),e}schemaInternal(){if(this._parent){if(this._parent instanceof ea)return this._parent;if(this._parent instanceof Q)return this._parent.schemaInternal();if(this._parent instanceof G)return this._parent.schema();(0,a.assert)(!1,"unreachable code. parent is of unknown type")}}get parent(){return(0,a.assert)(this._parent,"trying to access non-existent parent"),this._parent}isAttached(){return!!this._parent}setParent(e){(0,a.assert)(!this._parent,"Cannot set parent of an already attached element"),this._parent=e,this.onAttached()}onAttached(){}checkUpdate(){(0,a.assert)(this.isAttached(),()=>`Cannot modify detached element ${this}`)}}class K{get extendedElement(){return this._extendedElement}setExtendedElement(e){(0,a.assert)(!this._extendedElement,"Cannot attached already attached extension"),this._extendedElement=e}}i.Extension=K;class Q extends B{addUnappliedDirective({nameOrDef:e,args:t,extension:i,directive:n}){let r={nameOrDef:e,args:null!=t?t:{},extension:i,directive:n};this._unappliedDirectives?this._unappliedDirectives.push(r):this._unappliedDirectives=[r]}processUnappliedDirectives(){var e;for(let{nameOrDef:t,args:i,extension:n,directive:r}of null!=(e=this._unappliedDirectives)?e:[]){let e=this.applyDirective(t,i);e.setOfExtension(n),e.sourceAST=r}this._unappliedDirectives=void 0}get appliedDirectives(){var e;return null!=(e=this._appliedDirectives)?e:[]}appliedDirectivesOf(e){let t="string"==typeof e?e:e.name;return this.appliedDirectives.filter(e=>e.name==t)}hasAppliedDirective(e){return 0!==this.appliedDirectivesOf(e).length}applyDirective(e,t,n=!1){var r;let a;if("string"==typeof e){this.checkUpdate(),a=new e_(e,null!=t?t:Object.create(null));let n=null!=(r=this.schema().directive(e))?r:this.schema().blueprint.onMissingDirectiveDefinition(this.schema(),a);if(!n)throw this.schema().blueprint.onGraphQLJSValidationError(this.schema(),v.ERRORS.INVALID_GRAPHQL.err(`Unknown directive "@${e}".`));if(Array.isArray(n))throw(0,i.ErrGraphQLValidationFailed)(n)}else this.checkUpdate(e),a=new e_(e.name,null!=t?t:Object.create(null));return B.prototype.setParent.call(a,this),this._appliedDirectives?n?this._appliedDirectives.unshift(a):this._appliedDirectives.push(a):this._appliedDirectives=[a],eN.prototype.addReferencer.call(a.definition,a),this.onModification(),a}removeAppliedDirectives(){this._appliedDirectives&&this._appliedDirectives.concat().forEach(e=>e.remove())}onModification(){let e=this.schemaInternal();e&&ea.prototype.onModification.call(e)}isElementBuiltIn(){return!1}removeTypeReferenceInternal(e){this.removeTypeReference(e)}checkRemoval(){(0,a.assert)(!this.isElementBuiltIn()||ea.prototype.canModifyBuiltIn.call(this.schema()),()=>`Cannot modify built-in ${this}`)}checkUpdate(e){if(super.checkUpdate(),!ea.prototype.canModifyBuiltIn.call(this.schema())){let e=this;for(;e&&e instanceof Q;)(0,a.assert)(!e.isElementBuiltIn(),()=>`Cannot modify built-in (or part of built-in) ${this}`),e=e.parent}if(e&&e.isAttached()){let t=e.schema();(0,a.assert)(!t||t===this.schema(),()=>`Cannot add element ${e} to ${this} as it is attached to another schema`)}}}i.SchemaElement=Q;class q extends Q{constructor(e){super(),this._name=e}get name(){return this._name}}i.NamedSchemaElement=q;class J extends q{constructor(e,t=!1){super(e),this.isBuiltIn=t,this.preserveEmptyDefinition=!1}addReferencer(e){null!=this._referencers||(this._referencers=new Set),this._referencers.add(e)}removeReferencer(e){var t;null==(t=this._referencers)||t.delete(e)}get coordinate(){return this.name}*allChildElements(){}extensions(){var e;return null!=(e=this._extensions)?e:[]}hasExtension(e){var t,i;return null!=(i=null==(t=this._extensions)?void 0:t.includes(e))&&i}newExtension(){return this.addExtension(new K)}addExtension(e){return this.checkUpdate(),this.hasExtension(e)||((0,a.assert)(!e.extendedElement,()=>`Cannot add extension to type ${this}: it is already added to another type`),this._extensions?this._extensions.push(e):this._extensions=[e],K.prototype.setExtendedElement.call(e,this),this.onModification()),e}removeExtensions(){if(this._extensions){for(let e of(this._extensions=void 0,this.appliedDirectives))e.removeOfExtension();this.removeInnerElementsExtensions()}}isIntrospectionType(){return(0,d.isIntrospectionName)(this.name)}hasExtensionElements(){return!!this._extensions}hasNonExtensionElements(){return this.preserveEmptyDefinition||this.appliedDirectives.some(e=>void 0===e.ofExtension())||this.hasNonExtensionInnerElements()}isElementBuiltIn(){return this.isBuiltIn}rename(e){this.checkUpdate();let t=this._name;this._name=e,ea.prototype.renameTypeInternal.call(this._parent,t,e),this.onModification()}remove(){var e;if(!this._parent)return[];this.checkRemoval(),this.onModification(),this.sourceAST=void 0,this.removeAppliedDirectives(),this.removeInnerElements();let t=[];return null==(e=this._referencers)||e.forEach(e=>{Q.prototype.removeTypeReferenceInternal.call(e,this),t.push(e)}),this._referencers=void 0,ea.prototype.removeTypeInternal.call(this._parent,this),this._parent=void 0,t}removeRecursive(){this.remove().forEach(e=>this.removeReferenceRecursive(e))}referencers(){var e;return null!=(e=this._referencers)?e:S}isReferenced(){return!!this._referencers}toString(){return this.name}}class H extends q{get type(){return this._type}set type(e){e?this.checkUpdate(e):this.checkRemoval(),this._type&&ek(this,this._type),this._type=e,e&&eF(this,e)}removeTypeReference(e){(0,a.assert)(this._type&&k(this._type)===e,()=>`Cannot remove reference to type ${e} on ${this} as its type is ${this._type}`),this._type=void 0}}i.NamedSchemaElementWithType=H;class W extends B{ofExtension(){return this._extension}removeOfExtension(){this._extension=void 0}setOfExtension(e){var t;this.checkUpdate(),(0,a.assert)(!e||(null==(t=this._parent)?void 0:t.hasExtension(e)),()=>`Cannot set object as part of the provided extension: it is not an extension of parent ${this.parent}`),this._extension=e}remove(){this.removeInner(),ea.prototype.onModification.call(this.schema()),this._extension=void 0,this._parent=void 0}}class Y{onMissingDirectiveDefinition(e,t){}onDirectiveDefinitionAndSchemaParsed(e){return[]}ignoreParsedField(e,t){return!1}onConstructed(e){}onAddedCoreFeature(e,t){}onInvalidation(e){}onValidation(e){return[]}validationRules(){return h.specifiedSDLRules}onGraphQLJSValidationError(e,t){var i;let n=/^Unknown directive "@(?<directive>[_A-Za-z][_0-9A-Za-z]*)"\.$/.exec(t.message),r=null==(i=null==n?void 0:n.groups)?void 0:i.directive;if(!r)return t;let a=e.allDirectives().map(e=>e.name),s=(0,y.suggestionList)(r,a);return 0===s.length?this.onUnknownDirectiveValidationError(e,r,t):(0,v.withModifiedErrorMessage)(t,`${t.message}${(0,y.didYouMean)(s.map(e=>"@"+e))}`)}onUnknownDirectiveValidationError(e,t,i){return i}applyDirectivesAfterParsing(){return!1}}i.SchemaBlueprint=Y,i.defaultSchemaBlueprint=new Y;class z{constructor(e,t,i,n,r){this.url=e,this.nameInSchema=t,this.directive=i,this.imports=n,this.purpose=r}isFeatureDefinition(e){let t="DirectiveDefinition"===e.kind?"@"+e.name:e.name;return e.name.startsWith(this.nameInSchema+"__")||"DirectiveDefinition"===e.kind&&e.name===this.nameInSchema||!!this.imports.find(e=>{var i;return t===(null!=(i=e.as)?i:e.name)})}directiveNameInSchema(e){return z.directiveNameInSchemaForCoreArguments(this.url,this.nameInSchema,this.imports,e)}static directiveNameInSchemaForCoreArguments(e,t,i,n){var r,a;let s=i.find(e=>"@"===e.name.charAt(0)&&e.name.slice(1)===n);return s?null!=(a=null==(r=s.as)?void 0:r.slice(1))?a:n:n===e.name?t:t+"__"+n}typeNameInSchema(e){var t;let i=this.imports.find(t=>t.name===e);return i?null!=(t=i.as)?t:e:this.nameInSchema+"__"+e}minimumFederationVersion(){var e;return null==(e=(0,g.coreFeatureDefinitionIfKnown)(this.url))?void 0:e.minimumFederationVersion}}i.CoreFeature=z;class X{constructor(e){this.coreItself=e,this.byAlias=new Map,this.byIdentity=new Map,this.byImportName=new Map,this.conflictsByAlias=new a.SetMultiMap,this.add(e);const t=(0,r.findCoreSpecVersion)(e.url);if(!t)throw v.ERRORS.UNKNOWN_LINK_VERSION.err(`Schema uses unknown version ${e.url.version} of the ${e.url.name} spec`);this.coreDefinition=t}getByIdentity(e){var t;return null==(t=this.byIdentity.get(e))?void 0:t[0]}allFeatures(){return[...this.byIdentity.values()].map(([e])=>e)}removeFeature(e){let t=this.byIdentity.get(e);if(t){let[i]=t;this.byIdentity.delete(e);let n=i.nameInSchema;for(let{name:e,as:t}of(this.byAlias.delete(n),i.imports)){let i=null!=t?t:e,r="@"===e.charAt(0)?i.slice(1):i;this.byImportName.delete(i);let a=X.splitPrefixedName(r);if(!a)continue;let[s]=a;if(s===n)continue;let o=this.conflictsByAlias.get(i);o&&(o.delete(i),o.size||this.conflictsByAlias.delete(i))}}}maybeAddFeature(e){var t,i;if((null==(t=e.definition)?void 0:t.name)!==this.coreItself.nameInSchema)return;let n=e.arguments(),a=this.coreDefinition.extractFeatureUrl(n),s=(0,r.extractCoreFeatureImports)(a,e),o=new z(a,null!=(i=n.as)?i:a.name,e,s,n.for);return this.add(o),e.schema().blueprint.onAddedCoreFeature(e.schema(),o),o}add(e){var t,i;let n=e.url.identity;if(this.byIdentity.has(n))throw v.ERRORS.INVALID_LINK_DIRECTIVE_USAGE.err(`Cannot link feature "${n}" since it has already been linked in the schema.`);let r=e.nameInSchema;if((n!==o.tagIdentity||"federation__tag"!==r||0!==e.imports.length)&&(n!==l.inaccessibleIdentity||"federation__inaccessible"!==r||0!==e.imports.length)&&-1!==r.indexOf("__"))throw v.ERRORS.INVALID_LINK_DIRECTIVE_USAGE.err(`Cannot link feature "${n}" as "${r}" since it contains "__". Please rename to a compliant name via "as".`);if("_"===r.charAt(r.length-1))throw v.ERRORS.INVALID_LINK_DIRECTIVE_USAGE.err(`Cannot link feature "${n}" as "${r}" since it ends in "_". Please rename to a compliant name via "as".`);if(!ei.test(r))throw v.ERRORS.INVALID_LINK_DIRECTIVE_USAGE.err(`Cannot link feature "${n}" as "${r}" since it is not a valid GraphQL name. Please rename to a compliant name via "as".`);let s=this.conflictsByAlias.get(r);if(s){let e=null==(i=null==(t=null==s?void 0:s.values())?void 0:t.next())?void 0:i.value;(0,a.assert)(void 0!==e,"Unexpectedly empty conflicts set");let r=this.byImportName.get(e);(0,a.assert)(r,"Unexpectedly cannot find feature for import");let[o,l]=r,u=o.url.identity;this.checkTagInaccessibleConflict(u,n);let c=e!==l?`"${l}" as "${e}"`:`"${l}"`;throw v.ERRORS.INVALID_LINK_DIRECTIVE_USAGE.err(`Cannot import ${c} from feature "${u}" since it can be confused with a namespaced name from another linked feature "${n}". Please rename the import or feature to avoid conflicts via "as".`)}let u="@"+r,c=this.byImportName.get(u);if(c){let[e,t]=c,i=e.url.identity;this.checkTagInaccessibleConflict(i,n);let r=u!==t?`"${t}" as "${u}"`:`"${t}"`;throw v.ERRORS.INVALID_LINK_DIRECTIVE_USAGE.err(`Cannot import ${r} from feature "${i}" since it can be confused with a namespaced name from another linked feature "${n}". Please rename the import or feature to avoid conflicts via "as".`)}let d=this.byAlias.get(r);if(void 0!==d){let e=d.url.identity;throw this.checkTagInaccessibleConflict(e,n),v.ERRORS.INVALID_LINK_DIRECTIVE_USAGE.err(`Cannot link feature ${n} as "${r}" since another feature "${e}" already uses that alias. Please rename the feature to avoid conflicts via "as".`)}let p=new Map;for(let{name:t,as:i}of e.imports){let a=null!=i?i:t,s=a!==t?`"${t}" as "${a}"`:`"${t}"`,o="@"===t.charAt(0),l=o?t.slice(1):t,u=o?a.slice(1):a,c=X.splitPrefixedName(u);if(c){let[e,t]=c;if(e===r){if(t!==l){let e=o?"@"+t:t;throw v.ERRORS.INVALID_LINK_DIRECTIVE_USAGE.err(`Cannot import ${s} from feature "${n}" since it can be confused with the namespaced name for "${e}". Please rename the import to avoid conflicts via "as".`)}}else{let t=this.byAlias.get(e);if(t){let e=t.url.identity;throw this.checkTagInaccessibleConflict(e,n),v.ERRORS.INVALID_LINK_DIRECTIVE_USAGE.err(`Cannot import ${s} from feature "${n}" since it can be confused with a namespaced name from another linked feature "${e}". Please rename the import or feature to avoid conflicts via "as".`)}this.conflictsByAlias.add(e,a)}}if(o)if(u===r){if(l!==e.url.name)throw v.ERRORS.INVALID_LINK_DIRECTIVE_USAGE.err(`Cannot import ${s} from feature "${n}" since it can be confused with the namespaced name for "@${e.url.name}". Please rename the import to avoid conflicts via "as".`)}else{let e=this.byAlias.get(u);if(e){let t=e.url.identity;throw this.checkTagInaccessibleConflict(t,n),v.ERRORS.INVALID_LINK_DIRECTIVE_USAGE.err(`Cannot import ${s} from feature "${n}" since it can be confused with a namespaced name from another linked feature "${t}". Please rename the import or feature to avoid conflicts via "as".`)}}let d=p.get(t);if(void 0===d)p.set(t,a);else if(d!==a)throw v.ERRORS.INVALID_LINK_DIRECTIVE_USAGE.err(`Cannot import ${s} from feature "${n}" since it was previously imported as "${d}". Please remove one of these imports.`);let h=this.byImportName.get(a);if(void 0===h)this.byImportName.set(a,[e,t]);else{let[e,i]=h,r=e.url.identity;if(r!==n)throw this.checkTagInaccessibleConflict(r,n),v.ERRORS.INVALID_LINK_DIRECTIVE_USAGE.err(`Cannot import ${s} from feature "${n}" since it was previously imported from feature "${r}". Please rename the import to avoid conflicts via "as".`);if(i!==t)throw v.ERRORS.INVALID_LINK_DIRECTIVE_USAGE.err(`Cannot import ${s} from feature "${n}" since it was previously imported for "${i}". Please rename the import to avoid conflicts via "as".`)}}this.byAlias.set(r,e),this.byIdentity.set(n,[e,p])}isAliasValid(e,t,i){if(-1!==e.indexOf("__")||"_"===e.charAt(e.length-1)||!en.test(e))return!1;for(let[n,r]of i.entries())if(t===n){if(r.self.has(e))return!1}else if(r.other.has(e))return!1;return!this.byAlias.has(e)}static computeAliasConflicts(e,t){let i=new Map;for(let{url:n,alias:r,imports:a}of e){t.add(r);let e=new Set,s=new Set;for(let{name:i,as:r}of a){let a=null!=r?r:i,o="@"===i.charAt(0),l=o?i.slice(1):i,u=o?a.slice(1):a;t.add(u);let c=X.splitPrefixedName(u);if(c){let[t,i]=c;i!==l&&e.add(t),s.add(t)}o&&(l!==n.name&&e.add(u),s.add(u))}i.set(n.identity,{self:e,other:s})}let n=null,r=0;return{importConflictsByIdentity:i,computeUniqueAlias:e=>{if(null===n){let e={children:new Map,parent:null,char:""};for(let i of t){let t=e;for(let e of i){let i=t.children.get(e);i||(i={children:new Map,parent:t,char:e},t.children.set(e,i)),t=i}}let i=[e],r=0;for(;null===n;){let e=0===r?"_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ":"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",t=i[r++];for(let r of e){let e=t.children.get(r);if(e)i.push(e);else{let e=[r];for(let i=t;null==i?void 0:i.parent;i=i.parent)e.push(i.char);n=e.reverse().join("");break}}}}let i=e.replace(/[^a-zA-Z]/g,"");return`${n}${r++}${i}`}}}checkTagInaccessibleConflict(e,t){let i="https://specs.apollo.dev/federation",n=new Set([e,t]);if(!n.has(i))return;let[r,a]=n.has(o.tagIdentity)?["tag",o.tagIdentity]:n.has(l.inaccessibleIdentity)?["inaccessible",l.inaccessibleIdentity]:[void 0,void 0];if(r&&a)throw v.ERRORS.INVALID_LINK_DIRECTIVE_USAGE.err(`Please import "@${r}" from the feature "${i}" instead of using "${a}" to avoid potential unexpected behavior in the future.`)}sourceFeature(e){let t=e instanceof eN||e instanceof e_,i=t?"@"+e.name:e.name,n=this.byImportName.get(i);if(n){let[e,i]=n;return{feature:e,nameInFeature:t?i.slice(1):i,isImported:!0}}let r=this.sourceDefaultName(t,e.name);if(!r)return;let[a,s]=r;return{feature:a,nameInFeature:void 0===this.getImportName(a,t?"@"+s:s)?s:null,isImported:!1}}validateNoShadowingImports(e){let t=[];for(let i of[...e.allTypes(),...e.allDirectives()]){let e=this.getShadowingImport(i);if(!e||!(i instanceof eN?0!==i.applications().size:this.getReferencingRootElements(i).some(e=>"SchemaDefinition"===e.kind||!this.getShadowingImport(e))))continue;let{feature:n,importInSpec:r,importInSchema:a}=e,s=a!==r?`"${r}" as "${a}"`:`"${r}"`;t.push(v.ERRORS.INVALID_LINK_DIRECTIVE_USAGE.err(`Cannot import ${s} from feature "${n.url.identity}" since there's a used definition for the namespaced name "${i.coordinate}". Please switch usages of the namespaced name to the import name and remove the definition.`))}return t}getShadowingImport(e){let t=e instanceof eN||e instanceof e_,i=this.sourceDefaultName(t,e.name);if(!i)return;let n=t?"@"+e.name:e.name,[r,a]=i,s=t?"@"+a:a,o=this.getImportName(r,s);return void 0!==o&&o!==n?{feature:r,importInSpec:s,importInSchema:o}:void 0}getReferencingRootElements(e){let t=[];for(let i of e.referencers())switch(i.kind){case"ObjectType":case"InterfaceType":case"UnionType":case"SchemaDefinition":t.push(i);break;case"FieldDefinition":case"InputFieldDefinition":t.push(i.parent);break;case"ArgumentDefinition":let e=i.parent;switch(e.kind){case"DirectiveDefinition":t.push(e);break;case"FieldDefinition":t.push(e.parent);break;default:(0,a.assertUnreachable)(e)}break;default:(0,a.assertUnreachable)(i)}return t}getImportName(e,t){var i,n;return null==(n=null==(i=this.byIdentity.get(e.url.identity))?void 0:i[1])?void 0:n.get(t)}sourceDefaultName(e,t){let i=X.splitPrefixedName(t);if(i){let[e,t]=i,n=this.byAlias.get(e);if(n)return[n,t]}if(!e)return;let n=this.byAlias.get(t);return n?[n,n.url.name]:void 0}static splitPrefixedName(e){let t=e.indexOf("__");return -1!==t?[e.slice(0,t),e.slice(t+2)]:void 0}}i.CoreFeatures=X;let Z=["Int","Float","String","Boolean","ID"],ee=Z.map(e=>(0,m.createScalarTypeSpecification)({name:e})),et=[(0,m.createDirectiveSpecification)({name:"include",locations:[n.DirectiveLocation.FIELD,n.DirectiveLocation.FRAGMENT_SPREAD,n.DirectiveLocation.INLINE_FRAGMENT],args:[{name:"if",type:e=>new eT(e.booleanType())}]}),(0,m.createDirectiveSpecification)({name:"skip",locations:[n.DirectiveLocation.FIELD,n.DirectiveLocation.FRAGMENT_SPREAD,n.DirectiveLocation.INLINE_FRAGMENT],args:[{name:"if",type:e=>new eT(e.booleanType())}]}),(0,m.createDirectiveSpecification)({name:"deprecated",locations:[n.DirectiveLocation.FIELD_DEFINITION,n.DirectiveLocation.ENUM_VALUE,n.DirectiveLocation.ARGUMENT_DEFINITION,n.DirectiveLocation.INPUT_FIELD_DEFINITION],args:[{name:"reason",type:e=>e.stringType(),defaultValue:"No longer supported"}]}),(0,m.createDirectiveSpecification)({name:"specifiedBy",locations:[n.DirectiveLocation.SCALAR],args:[{name:"url",type:e=>new eT(e.stringType())}]}),(0,m.createDirectiveSpecification)({name:"defer",locations:[n.DirectiveLocation.FRAGMENT_SPREAD,n.DirectiveLocation.INLINE_FRAGMENT],args:[{name:"label",type:e=>e.stringType()},{name:"if",type:e=>new eT(e.booleanType()),defaultValue:!0}]}),(0,m.createDirectiveSpecification)({name:"stream",locations:[n.DirectiveLocation.FIELD],args:[{name:"label",type:e=>e.stringType()},{name:"initialCount",type:e=>e.intType(),defaultValue:0},{name:"if",type:e=>new eT(e.booleanType()),defaultValue:!0}]})],ei=/^[_A-Za-z][_0-9A-Za-z.-]*$/,en=/^[_A-Za-z][_0-9A-Za-z]*$/,er=/^@?[_A-Za-z][_0-9A-Za-z]*(\.[_A-Za-z][_0-9A-Za-z]*)?(\([_A-Za-z][_0-9A-Za-z]*:\))?$/;class ea{constructor(e=i.defaultSchemaBlueprint,t={}){this.blueprint=e,this.config=t,this._builtInTypes=new a.MapWithCachedArrays,this._types=new a.MapWithCachedArrays,this._builtInDirectives=new a.MapWithCachedArrays,this._directives=new a.MapWithCachedArrays,this.isConstructed=!1,this.isValidated=!1,this._schemaDefinition=new eo,B.prototype.setParent.call(this._schemaDefinition,this),ee.forEach(e=>e.checkOrAdd(this,void 0,!0)),et.forEach(e=>e.checkOrAdd(this,void 0,!0)),e.onConstructed(this),this.isConstructed=!0}canModifyBuiltIn(){return!this.isConstructed}runWithBuiltInModificationAllowed(e){let t=this.isConstructed;this.isConstructed=!1,e(),this.isConstructed=t}renameTypeInternal(e,t){this._types.set(t,this._types.get(e)),this._types.delete(e)}removeTypeInternal(e){this._types.delete(e.name)}removeDirectiveInternal(e){this._directives.delete(e.name)}markAsCoreSchema(e){this._coreFeatures=new X(e)}unmarkAsCoreSchema(){this._coreFeatures=void 0}onModification(){this.isConstructed&&(this.invalidate(),this.cachedDocument=void 0,this.apiSchema=void 0)}isCoreSchema(){return void 0!==this.coreFeatures}get coreFeatures(){return this._coreFeatures}toAST(){var e;if(!this.cachedDocument){let t=(0,n.parse)((0,u.printSchema)(this),{noLocation:!0});if(!(null!=(e=this.config.cacheAST)&&e))return t;this.cachedDocument=t}return this.cachedDocument}toAPISchema(){if(!this.apiSchema){this.validate();let e=this.clone(void 0,!1);for(let t of["defer","stream"]){let i=e.directive(t);i&&!i.isBuiltIn&&i.removeRecursive()}(0,l.removeInaccessibleElements)(e),(0,r.removeAllCoreFeatures)(e),(0,a.assert)(!e.isCoreSchema(),"The API schema shouldn't be a core schema"),e.validate(),this.apiSchema=e}return this.apiSchema}emptyASTDefinitionsForExtensionsWithoutDefinition(){let e=[];if(this.schemaDefinition.hasExtensionElements()&&!this.schemaDefinition.hasNonExtensionElements()){let t={kind:n.Kind.SCHEMA_DEFINITION,operationTypes:[]};e.push(t)}for(let t of this.types())if(t.hasExtensionElements()&&!t.hasNonExtensionElements()){let i={kind:t.astDefinitionKind,name:{kind:n.Kind.NAME,value:t.name}};e.push(i)}return e}toGraphQLJSSchema(e){var t,i;let r=null!=(t=null==e?void 0:e.includeDefer)&&t,a=null!=(i=null==e?void 0:e.includeStream)&&i,s=this.toAST(),o=this.emptyASTDefinitionsForExtensionsWithoutDefinition();r&&o.push(this.deferDirective().toAST()),a&&o.push(this.streamDirective().toAST()),o.length>0&&(s={kind:n.Kind.DOCUMENT,definitions:s.definitions.concat(o)});let l=(0,n.buildASTSchema)(s);if(o.length>0)for(let e of o)switch(e.kind){case n.Kind.SCHEMA_DEFINITION:l.astNode=void 0;break;case n.Kind.SCALAR_TYPE_DEFINITION:case n.Kind.OBJECT_TYPE_DEFINITION:case n.Kind.INTERFACE_TYPE_DEFINITION:case n.Kind.ENUM_TYPE_DEFINITION:case n.Kind.UNION_TYPE_DEFINITION:case n.Kind.INPUT_OBJECT_TYPE_DEFINITION:let t=l.getType(e.name.value);t&&(t.astNode=void 0)}return l}get schemaDefinition(){return this._schemaDefinition}types(){return this._types.values()}interfaceTypes(){return F(this.types(),"InterfaceType")}objectTypes(){return F(this.types(),"ObjectType")}unionTypes(){return F(this.types(),"UnionType")}scalarTypes(){return F(this.types(),"ScalarType")}inputTypes(){return F(this.types(),"InputObjectType")}enumTypes(){return F(this.types(),"EnumType")}builtInTypes(e=!1){let t=this._builtInTypes.values();return e?t:t.filter(e=>!this.isShadowedBuiltInType(e))}isShadowedBuiltInType(e){return e.isBuiltIn&&this._types.has(e.name)}allTypes(){return this.builtInTypes().concat(this.types())}type(e){return this._types.get(e)||this._builtInTypes.get(e)}typeOfKind(e,t){let i=this.type(e);return i&&i.kind===t?i:void 0}intType(){return this._builtInTypes.get("Int")}floatType(){return this._builtInTypes.get("Float")}stringType(){return this._builtInTypes.get("String")}booleanType(){return this._builtInTypes.get("Boolean")}idType(){return this._builtInTypes.get("ID")}builtInScalarTypes(){return[this.intType(),this.floatType(),this.stringType(),this.booleanType(),this.idType()]}addType(e){let t=this.type(e.name);if(t&&(0,a.assert)(t.isBuiltIn,()=>`Type ${e} already exists in this schema`),e.isAttached())return(0,a.assert)(e.parent==this,()=>`Cannot add type ${e} to this schema; it is already attached to another schema`),e;e.isBuiltIn?((0,a.assert)(!this.isConstructed,`Cannot add built-in ${e} to this schema (built-ins can only be added at schema construction time)`),this._builtInTypes.set(e.name,e)):this._types.set(e.name,e),B.prototype.setParent.call(e,this);let i=function(e){if("ObjectType"===e.kind)switch(e.name){case"Query":return"query";case"Mutation":return"mutation";case"Subscription":return"subscription";default:return}}(e);return i&&!this.schemaDefinition.root(i)&&this.schemaDefinition.setRoot(i,e),this.onModification(),e}directives(){return this._directives.values()}builtInDirectives(e=!1){return e?this._builtInDirectives.values():this._builtInDirectives.values().filter(e=>!this.isShadowedBuiltInDirective(e))}allDirectives(){return this.builtInDirectives().concat(this.directives())}isShadowedBuiltInDirective(e){return e.isBuiltIn&&this._directives.has(e.name)}directive(e){return this._directives.get(e)||this.builtInDirective(e)}builtInDirective(e){return this._builtInDirectives.get(e)}*allNamedSchemaElement(){for(let e of this.types())yield e,yield*e.allChildElements();for(let e of this.directives())yield e,yield*e.arguments()}*allSchemaElement(){yield this._schemaDefinition,yield*this.allNamedSchemaElement()}addDirectiveDefinition(e){let t="string"==typeof e?new eN(e):e,i=this.directive(t.name);return((0,a.assert)(!i||i.isBuiltIn,()=>`Directive ${t} already exists in this schema`),t.isAttached())?(0,a.assert)(t.parent==this,()=>`Cannot add directive ${t} to this schema; it is already attached to another schema`):(t.isBuiltIn?((0,a.assert)(!this.isConstructed,()=>`Cannot add built-in ${t} to this schema (built-ins can only be added at schema construction time)`),this._builtInDirectives.set(t.name,t)):this._directives.set(t.name,t),B.prototype.setParent.call(t,this),this.onModification()),t}invalidate(){this.isValidated&&this.blueprint.onInvalidation(this),this.isValidated=!1}assumeValid(){this.runWithBuiltInModificationAllowed(()=>{(0,d.addIntrospectionFields)(this)}),this.isValidated=!0}validate(){var e,t;if(this.isValidated)return;this.runWithBuiltInModificationAllowed(()=>{(0,d.addIntrospectionFields)(this)});let n=(0,p.validateSDL)(this.toAST(),void 0,this.blueprint.validationRules()).map(e=>this.blueprint.onGraphQLJSValidationError(this,e));if(0===(n=(n=n.concat((0,f.validateSchema)(this))).concat(null!=(t=null==(e=this.coreFeatures)?void 0:e.validateNoShadowingImports(this))?t:[])).length&&this.runWithBuiltInModificationAllowed(()=>{n=this.blueprint.onValidation(this)}),n.length>0)throw(0,i.ErrGraphQLValidationFailed)(n);this.isValidated=!0}clone(e,t=!0){let i=new ea(null!=e?e:this.blueprint);return function(e,t,i){for(let i of ex(e,t))t.addType(eP(i.kind,i.name));for(let i of eM(e,t))t.addDirectiveDefinition(i.name);for(let i of eM(e,t))eK(i,t.directive(i.name));for(let n of(function(e,t){t.preserveEmptyDefinition=e.preserveEmptyDefinition;let i=eU(e,t);for(let n of e.roots())e$(i,n,t.setRoot(n.rootKind,n.type.name));for(let n of e.appliedDirectives)e$(i,n,eV(n,t));t.description=e.description,t.sourceAST=e.sourceAST}(e.schemaDefinition,t.schemaDefinition),ex(e,t)))!function(e,t,i){t.preserveEmptyDefinition=e.preserveEmptyDefinition;let n=eU(e,t);for(let i of e.appliedDirectives)e$(n,i,eV(i,t));switch(t.description=e.description,t.sourceAST=e.sourceAST,e.kind){case"ObjectType":case"InterfaceType":for(let r of e.fields()){let e=t.addField(new eS(r.name));e$(n,r,e),function(e,t,i){let n=eG(e.type,t.schema());for(let r of(t.type=n,e.arguments())){let e=eG(r.type,t.schema());eB({source:r,dest:t.addArgument(r.name,e),cloneJoinDirectives:i})}ej(e,t,i),t.description=e.description,t.sourceAST=e.sourceAST}(r,e,i)}for(let i of e.interfaceImplementations()){let e=t.addImplementedInterface(i.interface.name);e$(n,i,e)}break;case"UnionType":for(let i of e.members()){let e=t.addType(i.type.name);e$(n,i,e)}break;case"EnumType":for(let r of e.values){let e=t.addValue(r.name);e.description=r.description,e$(n,r,e),ej(r,e,i)}break;case"InputObjectType":for(let r of e.fields()){let e=t.addField(new eE(r.name));e$(n,r,e),function(e,t,i){let n=eG(e.type,t.schema());t.type=n,t.defaultValue=e.defaultValue,ej(e,t,i),t.description=e.description,t.sourceAST=e.sourceAST}(r,e,i)}}}(n,t.type(n.name),i)}(this,i,t),this.isValidated&&i.assumeValid(),i}getBuiltInDirective(e){let t=this.directive(e);return(0,a.assert)(t,`The provided schema has not be built with the ${e} directive built-in`),t}includeDirective(){return this.getBuiltInDirective("include")}skipDirective(){return this.getBuiltInDirective("skip")}deprecatedDirective(){return this.getBuiltInDirective("deprecated")}specifiedByDirective(){return this.getBuiltInDirective("specifiedBy")}deferDirective(){return this.getBuiltInDirective("defer")}streamDirective(){return this.getBuiltInDirective("stream")}elementByCoordinate(e){if(!e.match(er))throw v.ERRORS.INVALID_GRAPHQL.err(`Invalid argument "${e}: it is not a syntactically valid graphQL coordinate."`);let t=e.indexOf("("),i=t<0?e:e.slice(0,t),n=t<0?void 0:e.slice(t+1,e.length-2),r=i.split("."),a=r[0],s=r[1];if(a.startsWith("@")){if(s)throw v.ERRORS.INVALID_GRAPHQL.err(`Invalid argument "${e}: it is not a syntactically valid graphQL coordinate."`);let t=this.directive(a.slice(1));return n?null==t?void 0:t.argument(n):t}{let t=this.type(a);if(!t||!s)return t;switch(t.kind){case"ObjectType":case"InterfaceType":let i=t.field(s);return n?null==i?void 0:i.argument(n):i;case"InputObjectType":if(n)throw v.ERRORS.INVALID_GRAPHQL.err(`Invalid argument "${e}: it is not a syntactically valid graphQL coordinate."`);return t.field(s);case"EnumType":if(n)throw v.ERRORS.INVALID_GRAPHQL.err(`Invalid argument "${e}: it is not a syntactically valid graphQL coordinate."`);return t.value(s);default:throw v.ERRORS.INVALID_GRAPHQL.err(`Invalid argument "${e}: it is not a syntactically valid graphQL coordinate."`)}}}}i.Schema=ea;class es extends W{constructor(e,t){super(),this.rootKind=e,this.type=t}isDefaultRootName(){return E(this.rootKind)==this.type.name}removeInner(){eo.prototype.removeRootType.call(this._parent,this)}}i.RootType=es;class eo extends Q{constructor(){super(...arguments),this.kind="SchemaDefinition",this._roots=new a.MapWithCachedArrays,this.preserveEmptyDefinition=!1}roots(){return this._roots.values()}applyDirective(e,t,i=!1){var n,a;let s=super.applyDirective(e,t,i),o=this.schema(),l=o.coreFeatures;if((0,r.isCoreSpecDirectiveApplication)(s)){if(l)throw v.ERRORS.INVALID_LINK_DIRECTIVE_USAGE.err("Invalid duplicate application of @core/@link");let e=s.arguments(),t=r.FeatureUrl.parse(null!=(n=e.url)?n:e.feature),i=(0,r.extractCoreFeatureImports)(t,s),u=new z(t,null!=(a=e.as)?a:t.name,s,i,e.for);ea.prototype.markAsCoreSchema.call(o,u),this.appliedDirectives.filter(e=>e!==s).forEach(e=>X.prototype.maybeAddFeature.call(o.coreFeatures,e))}else l&&X.prototype.maybeAddFeature.call(l,s);return this.onModification(),s}root(e){return this._roots.get(e)}rootType(e){var t;return null==(t=this.root(e))?void 0:t.type}setRoot(e,t){let i;if("string"==typeof t){this.checkUpdate();let n=this.schema().type(t);if(n){if("ObjectType"!=n.kind)throw v.ERRORS.INVALID_GRAPHQL.err(`${E(e)} root type must be an Object type${"query"===e?"":" if provided"}, it cannot be set to ${t} (an ${n.kind}).`)}else throw v.ERRORS.INVALID_GRAPHQL.err(`Cannot set schema ${e} root to unknown type ${t}`);i=new es(e,n)}else this.checkUpdate(t),i=new es(e,t);let n=this._roots.get(e);return n&&ek(this,n.type),this._roots.set(e,i),B.prototype.setParent.call(i,this),eF(this,i.type),this.onModification(),i}extensions(){var e;return null!=(e=this._extensions)?e:[]}hasExtension(e){var t,i;return null!=(i=null==(t=this._extensions)?void 0:t.includes(e))&&i}newExtension(){return this.addExtension(new K)}addExtension(e){return this.checkUpdate(),this.hasExtension(e)||((0,a.assert)(!e.extendedElement,"Cannot add extension to this schema: extension is already added to another schema"),this._extensions?this._extensions.push(e):this._extensions=[e],K.prototype.setExtendedElement.call(e,this),this.onModification()),e}hasExtensionElements(){return!!this._extensions}hasNonExtensionElements(){return this.preserveEmptyDefinition||this.appliedDirectives.some(e=>void 0===e.ofExtension())||this.roots().some(e=>void 0===e.ofExtension())}removeRootType(e){this._roots.delete(e.rootKind),ek(this,e.type)}removeTypeReference(e){for(let t of this.roots())t.type==e&&this._roots.delete(t.rootKind)}toString(){return`schema[${this._roots.keys().join(", ")}]`}}i.SchemaDefinition=eo;class el extends J{constructor(){super(...arguments),this.kind="ScalarType",this.astDefinitionKind=n.Kind.SCALAR_TYPE_DEFINITION}removeTypeReference(e){(0,a.assert)(!1,`Scalar type ${this} can't reference other types; shouldn't be asked to remove reference to ${e}`)}hasNonExtensionInnerElements(){return!1}removeInnerElementsExtensions(){}removeInnerElements(){}removeReferenceRecursive(e){e.remove()}}i.ScalarType=el;class eu extends W{constructor(e){super(),this.interface=e}removeInner(){ec.prototype.removeInterfaceImplementation.call(this._parent,this.interface)}toString(){return`'implements ${this.interface}'`}}i.InterfaceImplementation=eu;class ec extends J{constructor(){super(...arguments),this._fields=new a.MapWithCachedArrays}onAttached(){ea.prototype.runWithBuiltInModificationAllowed.call(this.schema(),()=>{this.addField(new eS(i.typenameFieldName,!0),new eT(this.schema().stringType()))})}removeFieldInternal(e){this._fields.delete(e.name),this._cachedNonBuiltInFields=void 0}interfaceImplementations(){var e,t;return null!=(t=null==(e=this._interfaceImplementations)?void 0:e.values())?t:[]}interfaceImplementation(e){return this._interfaceImplementations?this._interfaceImplementations.get("string"==typeof e?e:e.name):void 0}interfaces(){return this.interfaceImplementations().map(e=>e.interface)}implementsInterface(e){var t,i;return null!=(i=null==(t=this._interfaceImplementations)?void 0:t.has("string"==typeof e?e:e.name))&&i}addImplementedInterface(e){var t;let i;if(e instanceof eu)this.checkUpdate(e),i=e;else{let t;if("string"==typeof e){this.checkUpdate();let i=this.schema().type(e);if(i){if("InterfaceType"!=i.kind)throw v.ERRORS.INVALID_GRAPHQL.err(`Cannot implement non-interface type ${e} (of type ${i.kind})`)}else throw v.ERRORS.INVALID_GRAPHQL.err(`Cannot implement unknown type ${e}`);t=i}else t=e;i=new eu(t)}let n=null==(t=this._interfaceImplementations)?void 0:t.get(i.interface.name);return n||(this._interfaceImplementations||(this._interfaceImplementations=new a.MapWithCachedArrays),this._interfaceImplementations.set(i.interface.name,i),eF(this,i.interface),B.prototype.setParent.call(i,this),this.onModification(),i)}fields(){return this._cachedNonBuiltInFields||(this._cachedNonBuiltInFields=this._fields.values().filter(e=>!e.isBuiltIn)),this._cachedNonBuiltInFields}hasFields(){return this.fields().length>0}builtInFields(){return this.allFields().filter(e=>e.isBuiltIn)}allFields(){return this._fields.values()}field(e){return this._fields.get(e)}typenameField(){return this.field(i.typenameFieldName)}addField(e,t){let i;if("string"==typeof e?(this.checkUpdate(),i=new eS(e)):(this.checkUpdate(e),i=e),this.field(i.name))throw v.ERRORS.INVALID_GRAPHQL.err(`Field ${i.name} already exists on ${this}`);if(t&&!w(t))throw v.ERRORS.INVALID_GRAPHQL.err(`Invalid input type ${t} for field ${i.name}: object and interface field types should be output types.`);return this._fields.set(i.name,i),this._cachedNonBuiltInFields=void 0,B.prototype.setParent.call(i,this),t&&(i.type=t),this.onModification(),i}*allChildElements(){for(let e of this._fields.values())yield e,yield*e.arguments()}removeInterfaceImplementation(e){var t;null==(t=this._interfaceImplementations)||t.delete(e.name),ek(this,e)}removeTypeReference(e){var t;null==(t=this._interfaceImplementations)||t.delete(e.name)}removeInnerElements(){for(let e of this.interfaceImplementations())e.remove();for(let e of this.allFields())e.isBuiltIn?eS.prototype.removeParent.call(e):e.remove()}hasNonExtensionInnerElements(){return this.interfaceImplementations().some(e=>void 0===e.ofExtension())||this.fields().some(e=>void 0===e.ofExtension())}removeInnerElementsExtensions(){this.interfaceImplementations().forEach(e=>e.removeOfExtension()),this.fields().forEach(e=>e.removeOfExtension())}}class ed extends ec{constructor(){super(...arguments),this.kind="ObjectType",this.astDefinitionKind=n.Kind.OBJECT_TYPE_DEFINITION}isRootType(){return this.schema().schemaDefinition.roots().some(e=>e.type==this)}isQueryRootType(){var e;return(null==(e=this.schema().schemaDefinition.root("query"))?void 0:e.type)===this}isSubscriptionRootType(){var e;return(null==(e=this.schema().schemaDefinition.root("subscription"))?void 0:e.type)===this}removeReferenceRecursive(e){switch(e.kind){case"FieldDefinition":e.removeRecursive();break;case"UnionType":0===e.membersCount()&&e.removeRecursive()}}unionsWhereMember(){var e;let t=[];return null==(e=this._referencers)||e.forEach(e=>{e instanceof J&&R(e)&&t.push(e)}),t}}i.ObjectType=ed;class ep extends ec{constructor(){super(...arguments),this.kind="InterfaceType",this.astDefinitionKind=n.Kind.INTERFACE_TYPE_DEFINITION}allImplementations(){let e=[];return this.referencers().forEach(t=>{("ObjectType"===t.kind||"InterfaceType"===t.kind)&&e.push(t)}),e}possibleRuntimeTypes(){return this.allImplementations().filter(e=>"ObjectType"===e.kind)}isPossibleRuntimeType(e){let t="string"==typeof e?e:e.name;return this.possibleRuntimeTypes().some(e=>e.name==t)}removeReferenceRecursive(e){"FieldDefinition"===e.kind&&e.removeRecursive()}}i.InterfaceType=ep;class eh extends W{constructor(e){super(),this.type=e}removeInner(){ef.prototype.removeMember.call(this._parent,this.type)}}i.UnionMember=eh;class ef extends J{constructor(){super(...arguments),this.kind="UnionType",this.astDefinitionKind=n.Kind.UNION_TYPE_DEFINITION,this._members=new a.MapWithCachedArrays}onAttached(){ea.prototype.runWithBuiltInModificationAllowed.call(this.schema(),()=>{this._typenameField=new eS(i.typenameFieldName,!0),B.prototype.setParent.call(this._typenameField,this),this._typenameField.type=new eT(this.schema().stringType())})}types(){return this.members().map(e=>e.type)}members(){return this._members.values()}membersCount(){return this._members.size}hasTypeMember(e){return this._members.has("string"==typeof e?e:e.name)}addType(e){let t;if(e instanceof eh)this.checkUpdate(e),t=e;else{let i;if("string"==typeof e){this.checkUpdate();let t=this.schema().type(e);if(t){if("ObjectType"!=t.kind)throw v.ERRORS.INVALID_GRAPHQL.err(`Cannot add non-object type ${e} (of type ${t.kind}) as member of union type ${this.name}`)}else throw v.ERRORS.INVALID_GRAPHQL.err(`Cannot add unknown type ${e} as member of union type ${this.name}`);i=t}else this.checkUpdate(e),i=e;t=new eh(i)}let i=this._members.get(t.type.name);return i||(this._members.set(t.type.name,t),B.prototype.setParent.call(t,this),eF(this,t.type),this.onModification(),t)}clearTypes(){for(let e of this.types())this.removeMember(e);this.onModification()}field(e){if(e===i.typenameFieldName&&this._typenameField)return this._typenameField}typenameField(){return this._typenameField}removeMember(e){this._members.delete(e.name),ek(this,e)}removeTypeReference(e){this._members.delete(e.name)}removeInnerElements(){for(let e of this.members())e.remove()}hasNonExtensionInnerElements(){return this.members().some(e=>void 0===e.ofExtension())}removeReferenceRecursive(e){e.removeRecursive()}removeInnerElementsExtensions(){this.members().forEach(e=>e.removeOfExtension())}}i.UnionType=ef;class em extends J{constructor(){super(...arguments),this.kind="EnumType",this.astDefinitionKind=n.Kind.ENUM_TYPE_DEFINITION,this._values=new Map}get values(){return Array.from(this._values.values())}value(e){return this._values.get(e)}addValue(e){let t;"string"==typeof e?(this.checkUpdate(),t=new eb(e)):(this.checkUpdate(e),t=e);let i=this.value(t.name);return i||(this._values.set(t.name,t),B.prototype.setParent.call(t,this),this.onModification(),t)}removeTypeReference(e){(0,a.assert)(!1,`Eum type ${this} can't reference other types; shouldn't be asked to remove reference to ${e}`)}removeValueInternal(e){this._values.delete(e.name)}removeInnerElements(){for(let e of this.values)e.remove()}hasNonExtensionInnerElements(){return Array.from(this._values.values()).some(e=>void 0===e.ofExtension())}removeReferenceRecursive(e){e.removeRecursive()}removeInnerElementsExtensions(){for(let e of this._values.values())e.removeOfExtension()}}i.EnumType=em;class ey extends J{constructor(){super(...arguments),this.kind="InputObjectType",this.astDefinitionKind=n.Kind.INPUT_OBJECT_TYPE_DEFINITION,this._fields=new Map}fields(){return this._cachedFieldsArray||(this._cachedFieldsArray=(0,a.mapValues)(this._fields)),this._cachedFieldsArray}field(e){return this._fields.get(e)}addField(e,t){let i="string"==typeof e?new eE(e):e;if(this.checkUpdate(i),this.field(i.name))throw v.ERRORS.INVALID_GRAPHQL.err(`Field ${i.name} already exists on ${this}`);if(t&&!L(t))throw v.ERRORS.INVALID_GRAPHQL.err(`Invalid output type ${t} for field ${i.name}: input field types should be input types.`);return this._fields.set(i.name,i),this._cachedFieldsArray=void 0,B.prototype.setParent.call(i,this),"string"==typeof e&&t&&(i.type=t),this.onModification(),i}hasFields(){return this._fields.size>0}*allChildElements(){yield*this._fields.values()}removeTypeReference(e){(0,a.assert)(!1,`Input Object type ${this} can't reference other types; shouldn't be asked to remove reference to ${e}`)}removeInnerElements(){for(let e of this.fields())e.remove()}removeFieldInternal(e){this._fields.delete(e.name),this._cachedFieldsArray=void 0}hasNonExtensionInnerElements(){return this.fields().some(e=>void 0===e.ofExtension())}removeReferenceRecursive(e){"ArgumentDefinition"===e.kind?e.parent().removeRecursive():e.removeRecursive()}removeInnerElementsExtensions(){this.fields().forEach(e=>e.removeOfExtension())}}i.InputObjectType=ey;class ev{constructor(e){this._type=e,(0,a.assert)(this._type,"Cannot wrap an undefined/null type")}schema(){return this.baseType().schema()}isAttached(){return this.baseType().isAttached()}get ofType(){return this._type}baseType(){return k(this._type)}}class eg extends ev{constructor(e){super(e),this.kind="ListType"}toString(){return`[${this.ofType}]`}}i.ListType=eg;class eT extends ev{constructor(e){super(e),this.kind="NonNullType"}toString(){return`${this.ofType}!`}}i.NonNullType=eT;class eS extends H{constructor(e,t=!1){super(e),this.isBuiltIn=t,this.kind="FieldDefinition"}isElementBuiltIn(){return this.isBuiltIn}get coordinate(){let e=this._parent;return`${void 0==e?"<detached>":e.coordinate}.${this.name}`}hasArguments(){return!!this._args&&this._args.size>0}arguments(){var e,t;return null!=(t=null==(e=this._args)?void 0:e.values())?t:[]}argument(e){var t;return null==(t=this._args)?void 0:t.get(e)}addArgument(e,t,i){let n;"string"==typeof e?(this.checkUpdate(),(n=new eI(e)).defaultValue=i):(this.checkUpdate(e),n=e);let r=this.argument(n.name);if(r){if(t&&r.type&&!(0,c.sameType)(t,r.type))throw v.ERRORS.INVALID_GRAPHQL.err(`Argument ${n.name} already exists on field ${this.name} with a different type (${r.type})`);if(i&&(!r.defaultValue||!(0,s.valueEquals)(i,r.defaultValue)))throw v.ERRORS.INVALID_GRAPHQL.err(`Argument ${n.name} already exists on field ${this.name} with a different default value (${(0,s.valueToString)(r.defaultValue)})`);return r}if(t&&!L(t))throw v.ERRORS.INVALID_GRAPHQL.err(`Invalid output type ${t} for argument ${n.name} of ${this}: arguments should be input types.`);return this._args||(this._args=new a.MapWithCachedArrays),this._args.set(n.name,n),B.prototype.setParent.call(n,this),"string"==typeof e&&(n.type=t),this.onModification(),n}ofExtension(){return this._extension}removeOfExtension(){this._extension=void 0}setOfExtension(e){var t;this.checkUpdate(),(0,a.assert)(!e||(null==(t=this._parent)?void 0:t.hasExtension(e)),()=>`Cannot mark field ${this.name} as part of the provided extension: it is not an extension of field parent type ${this.parent}`),this._extension=e,this.onModification()}isIntrospectionField(){return(0,d.isIntrospectionName)(this.name)}isSchemaIntrospectionField(){return d.introspectionFieldNames.includes(this.name)}removeArgumentInternal(e){this._args&&this._args.delete(e)}removeParent(){this._parent=void 0}isDeprecated(){return this.hasAppliedDirective("deprecated")}remove(){if(!this._parent)return[];for(let e of(this.checkRemoval(),this.onModification(),this.sourceAST=void 0,this.type=void 0,this.removeAppliedDirectives(),this.arguments()))e.remove();return ec.prototype.removeFieldInternal.call(this._parent,this),this._parent=void 0,this._extension=void 0,[]}removeRecursive(){let e=this._parent;this.remove(),e&&!R(e)&&0===e.fields().length&&e.removeRecursive()}toString(){let e=this.hasArguments()?"("+this.arguments().map(e=>e.toString()).join(", ")+")":"";return`${this.name}${e}: ${this.type}`}}i.FieldDefinition=eS;class eE extends H{constructor(){super(...arguments),this.kind="InputFieldDefinition"}get coordinate(){let e=this._parent;return`${void 0==e?"<detached>":e.coordinate}.${this.name}`}isRequired(){return N(this.type)&&void 0===this.defaultValue}ofExtension(){return this._extension}removeOfExtension(){this._extension=void 0}setOfExtension(e){var t;this.checkUpdate(),(0,a.assert)(!e||(null==(t=this._parent)?void 0:t.hasExtension(e)),()=>`Cannot mark field ${this.name} as part of the provided extension: it is not an extension of field parent type ${this.parent}`),this._extension=e,this.onModification()}isDeprecated(){return this.hasAppliedDirective("deprecated")}remove(){return this._parent&&(this.checkRemoval(),this.onModification(),this.sourceAST=void 0,this.type=void 0,this.defaultValue=void 0,this.removeAppliedDirectives(),ey.prototype.removeFieldInternal.call(this._parent,this),this._parent=void 0,this._extension=void 0),[]}removeRecursive(){let e=this._parent;this.remove(),e&&0===e.fields().length&&e.removeRecursive()}toString(){let e=void 0===this.defaultValue?"":` = ${(0,s.valueToString)(this.defaultValue,this.type)}`;return`${this.name}: ${this.type}${e}`}}i.InputFieldDefinition=eE;class eI extends H{constructor(e){super(e),this.kind="ArgumentDefinition"}get coordinate(){let e=this._parent;return`${void 0==e?"<detached>":e.coordinate}(${this.name}:)`}isRequired(){return N(this.type)&&void 0===this.defaultValue}isDeprecated(){return this.hasAppliedDirective("deprecated")}remove(){return this._parent&&(this.checkRemoval(),this.onModification(),this.sourceAST=void 0,this.type=void 0,this.defaultValue=void 0,this.removeAppliedDirectives(),this._parent instanceof eS?eS.prototype.removeArgumentInternal.call(this._parent,this.name):eN.prototype.removeArgumentInternal.call(this._parent,this.name),this._parent=void 0),[]}toString(){let e=void 0===this.defaultValue?"":` = ${(0,s.valueToString)(this.defaultValue,this.type)}`;return`${this.name}: ${this.type}${e}`}}i.ArgumentDefinition=eI;class eb extends q{constructor(){super(...arguments),this.kind="EnumValue"}get coordinate(){let e=this._parent;return`${void 0==e?"<detached>":e.coordinate}.${this.name}`}ofExtension(){return this._extension}removeOfExtension(){this._extension=void 0}setOfExtension(e){var t;this.checkUpdate(),(0,a.assert)(!e||(null==(t=this._parent)?void 0:t.hasExtension(e)),()=>`Cannot mark field ${this.name} as part of the provided extension: it is not an extension of enum value parent type ${this.parent}`),this._extension=e,this.onModification()}isDeprecated(){return this.hasAppliedDirective("deprecated")}remove(){return this._parent&&(this.checkRemoval(),this.onModification(),this.sourceAST=void 0,this.removeAppliedDirectives(),em.prototype.removeValueInternal.call(this._parent,this),this._parent=void 0,this._extension=void 0),[]}removeTypeReference(e){(0,a.assert)(!1,`Enum value ${this} can't reference other types; shouldn't be asked to remove reference to ${e}`)}toString(){return`${this.name}`}}i.EnumValue=eb;class eN extends q{constructor(e,t=!1){super(e),this.isBuiltIn=t,this.kind="DirectiveDefinition",this.repeatable=!1,this._locations=[]}get coordinate(){return`@${this.name}`}arguments(){var e,t;return null!=(t=null==(e=this._args)?void 0:e.values())?t:[]}argument(e){var t;return null==(t=this._args)?void 0:t.get(e)}addArgument(e,t,i){let n;if("string"==typeof e?(this.checkUpdate(),(n=new eI(e)).defaultValue=i):(this.checkUpdate(e),n=e),this.argument(n.name))throw v.ERRORS.INVALID_GRAPHQL.err(`Argument ${n.name} already exists on field ${this.name}`);return this._args||(this._args=new a.MapWithCachedArrays),this._args.set(n.name,n),B.prototype.setParent.call(n,this),"string"==typeof e&&(n.type=t),this.onModification(),n}removeArgumentInternal(e){var t;null==(t=this._args)||t.delete(e)}get locations(){return this._locations}addLocations(...e){let t=!1;for(let i of e)this._locations.includes(i)||(this._locations.push(i),t=!0);return t&&this.onModification(),this}addAllLocations(){return this.addLocations(...Object.values(n.DirectiveLocation))}addAllTypeLocations(){return this.addLocations(n.DirectiveLocation.SCALAR,n.DirectiveLocation.OBJECT,n.DirectiveLocation.INTERFACE,n.DirectiveLocation.UNION,n.DirectiveLocation.ENUM,n.DirectiveLocation.INPUT_OBJECT)}removeLocations(...e){let t=!1;for(let i of e)t||(t=(0,a.removeArrayElement)(i,this._locations));return t&&this.onModification(),this}hasExecutableLocations(){return this.locations.some(e=>M(e))}hasTypeSystemLocations(){return this.locations.some(e=>$(e))}applications(){return null!=this._referencers||(this._referencers=new Set),this._referencers}addReferencer(e){(0,a.assert)(e,"Referencer should exists"),null!=this._referencers||(this._referencers=new Set),this._referencers.add(e)}removeReferencer(e){var t;null==(t=this._referencers)||t.delete(e)}removeTypeReference(e){(0,a.assert)(!1,`Directive definition ${this} can't reference other types (it's arguments can); shouldn't be asked to remove reference to ${e}`)}remove(){var e;if(!this._parent)return[];for(let e of(this.checkRemoval(),this.onModification(),this.sourceAST=void 0,(0,a.assert)(!this._appliedDirectives||0===this._appliedDirectives.length,"Directive definition should not have directive applied to it"),this.arguments()))e.remove();let t=Array.from(null!=(e=this._referencers)?e:[]);return this._referencers=void 0,ea.prototype.removeDirectiveInternal.call(this._parent,this),this._parent=void 0,t}removeRecursive(){this.remove().forEach(e=>e.remove())}toAST(){return(0,n.parse)((0,u.printDirectiveDefinition)(this)).definitions[0]}toString(){return`@${this.name}`}}i.DirectiveDefinition=eN;class e_ extends B{constructor(e,t=Object.create(null)){super(),this.name=e,this._args=t}schema(){return this.parent.schema()}get definition(){if(this.isAttached())return this.schema().directive(this.name)}arguments(e=!1){if(!e)return this._args;let t=this.definition;(0,a.assert)(t,()=>`Cannot include default values for arguments: cannot find directive definition for ${this.name}`);let i=Object.create(null);for(let e of t.arguments()){let t=(0,s.withDefaultValues)(this._args[e.name],e);void 0!==t&&(i[e.name]=t)}return i}onModification(){this.isAttachedToSchemaElement()&&ea.prototype.onModification.call(this.schema())}isAttachedToSchemaElement(){return this.isAttached()}setArguments(e){this._args=e,this.onModification()}argumentType(e){var t,i;return null==(i=null==(t=this.definition)?void 0:t.argument(e))?void 0:i.type}matchArguments(e){let t=Object.entries(this._args);if(t.length!==Object.keys(e).length)return!1;for(let[i,n]of t){if(!(i in e))return!1;let t=e[i];if(!(0,s.valueEquals)(t,n))return!1}return!0}ofExtension(){return this._extension}removeOfExtension(){this._extension=void 0}setOfExtension(e){if(this.checkUpdate(),e){let t=this.parent;(0,a.assert)(t instanceof eo||t instanceof J,"Can only mark directive parts of extensions when directly apply to type or schema definition."),(0,a.assert)(t.hasExtension(e),()=>`Cannot mark directive ${this.name} as part of the provided extension: it is not an extension of parent ${t}`)}this._extension=e,this.onModification()}argumentsToAST(){let e=Object.entries(this._args);if(0===e.length)return;let t=this.definition;return(0,a.assert)(t,()=>`Cannot convert arguments of detached directive ${this}`),e.map(([e,i])=>({kind:n.Kind.ARGUMENT,name:{kind:n.Kind.NAME,value:e},value:(0,s.valueToAST)(i,t.argument(e).type)}))}remove(){if(!this._parent)return!1;this.onModification();let e=this.schema().coreFeatures;if(e&&this.name===e.coreItself.nameInSchema){let t=r.FeatureUrl.parse(this._args[e.coreDefinition.urlArgName()]);if(t.identity===e.coreItself.url.identity){for(let t of(ea.prototype.unmarkAsCoreSchema.call(this.schema()),this.schema().schemaDefinition.appliedDirectivesOf(e.coreItself.nameInSchema)))t.removeInternal();return!0}X.prototype.removeFeature.call(e,t.identity)}return this.removeInternal()}removeInternal(){if(!this._parent)return!1;let e=this.definition;e&&this.isAttachedToSchemaElement()&&eN.prototype.removeReferencer.call(e,this);let t=this._parent.appliedDirectives,i=(0,a.removeArrayElement)(this,t);return(0,a.assert)(i,()=>`Directive ${this} lists ${this._parent} as parent, but that parent doesn't list it as applied directive`),this._parent=void 0,this._extension=void 0,!0}toString(){let e=Object.entries(this._args).filter(([e,t])=>void 0!==t),t=0==e.length?"":"("+e.map(([e,t])=>`${e}: ${(0,s.valueToString)(t,this.argumentType(e))}`).join(", ")+")";return`@${this.name}${t}`}}function eD(e){return e&&0!=e.length?" "+e.join(" "):""}function eA(e){return e&&0!==e.length?e.map(e=>({kind:n.Kind.DIRECTIVE,name:{kind:n.Kind.NAME,value:e.name},arguments:e.argumentsToAST()})):void 0}function eO(e,t,i=["defer"]){return e.name===t.name&&!i.includes(e.name)&&!i.includes(t.name)&&(0,s.argumentsEquals)(e.arguments(),t.arguments())}i.Directive=e_,i.directivesToString=eD,i.directivesToDirectiveNodes=eA,i.sameDirectiveApplication=eO,i.sameDirectiveApplications=function(e,t,i=["defer"]){if(e.length!==t.length)return!1;for(let n of e)if(!t.some(e=>eO(n,e,i)))return!1;return!0},i.isDirectiveApplicationsSubset=function(e,t){if(t.length>e.length)return!1;for(let i of t)if(!e.some(e=>eO(i,e)))return!1;return!0},i.directiveApplicationsSubstraction=function(e,t){return e.filter(e=>!t.some(t=>eO(e,t)))};class eR{constructor(e){this.name=e}toVariableNode(){return{kind:n.Kind.VARIABLE,name:{kind:n.Kind.NAME,value:this.name}}}toString(){return"$"+this.name}}i.Variable=eR,i.VariableCollector=class{constructor(){this._variables=new Map}add(e){this._variables.set(e.name,e)}addAll(e){for(let t of e)this.add(t)}collectInArguments(e){for(let t of Object.values(e))(0,s.collectVariablesInValue)(t,this)}variables(){return(0,a.mapValues)(this._variables)}toString(){return this.variables().toString()}},i.isVariable=function(e){return e instanceof eR};class ew extends G{constructor(e,t,i,n){super(e),this.variable=t,this.type=i,this.defaultValue=n}toVariableDefinitionNode(){let e=(0,s.valueToAST)(this.defaultValue,this.type);return{kind:n.Kind.VARIABLE_DEFINITION,variable:this.variable.toVariableNode(),type:j(this.type),defaultValue:void 0!==e?(0,s.valueNodeToConstValueNode)(e):void 0,directives:this.appliedDirectivesToDirectiveNodes()}}toString(){let e=this.variable+": "+this.type;return void 0!==this.defaultValue&&(e=e+" = "+(0,s.valueToString)(this.defaultValue,this.type)),e+this.appliedDirectivesToString()}}i.VariableDefinition=ew;class eL{constructor(){this._definitions=new a.MapWithCachedArrays}add(e){return!this._definitions.has(e.variable.name)&&(this._definitions.set(e.variable.name,e),!0)}addAll(e){for(let t of e._definitions.values())this.add(t)}definition(e){let t="string"==typeof e?e:e.name;return this._definitions.get(t)}isEmpty(){return 0===this._definitions.size}definitions(){return this._definitions.values()}filter(e){if(0===e.length)return new eL;let t=new eL;for(let i of e){let e=this.definition(i);if(!e)throw Error(`Cannot find variable ${i} in definitions ${this}`);t.add(e)}return t}toVariableDefinitionNodes(){if(0!==this._definitions.size)return this.definitions().map(e=>e.toVariableDefinitionNode())}toString(){return"("+this.definitions().join(", ")+")"}}function eC(e,t){let i=new eR(t.variable.name.value),n=V(e,t.type);if(!L(n))throw v.ERRORS.INVALID_GRAPHQL.err(`Invalid type "${n}" for variable $${i}: not an input type`,{nodes:t.type});return new ew(e,i,n,t.defaultValue?(0,s.valueFromAST)(t.defaultValue,n):void 0)}function eF(e,t){switch(t.kind){case"ListType":case"NonNullType":eF(e,t.baseType());break;default:J.prototype.addReferencer.call(t,e)}}function ek(e,t){switch(t.kind){case"ListType":case"NonNullType":ek(e,t.baseType());break;default:J.prototype.removeReferencer.call(t,e)}}function eP(e,t){switch(e){case"ScalarType":return new el(t);case"ObjectType":return new ed(t);case"InterfaceType":return new ep(t);case"UnionType":return new ef(t);case"EnumType":return new em(t);case"InputObjectType":return new ey(t);default:(0,a.assert)(!1,`Unhandled kind ${e} for type ${t}`)}}function*ex(e,t){var i;for(let n of e.builtInTypes())n.isIntrospectionType()||(null==(i=t.type(n.name))?void 0:i.isBuiltIn)||(yield n);yield*e.types()}function*eM(e,t){var i;for(let n of e.builtInDirectives())(null==(i=t.directive(n.name))?void 0:i.isBuiltIn)||(yield n);yield*e.directives()}function eU(e,t){let i=new Map;for(let n of e.extensions()){let e=new K;t.addExtension(e),i.set(n,e)}return i}function e$(e,t,i){let n=t.ofExtension();n&&i.setOfExtension(e.get(n))}function ej(e,t,i){e.appliedDirectives.filter(e=>i||!e.name.startsWith("join__")).forEach(e=>eV(e,t))}function eV(e,t){let i=t.applyDirective(e.name,{...e.arguments()});return i.sourceAST=e.sourceAST,i}function eG(e,t){if(e)switch(e.kind){case"ListType":return new eg(eG(e.ofType,t));case"NonNullType":return new eT(eG(e.ofType,t));default:return t.type(e.name)}}function eB({source:e,dest:t,copyDirectiveApplications:i=!0,cloneJoinDirectives:n}){let r=eG(e.type,t.schema());t.type=r,t.defaultValue=e.defaultValue,i&&ej(e,t,n),t.description=e.description,t.sourceAST=e.sourceAST}function eK(e,t,i=!0,n){let r=e.locations;if(n&&(r=r.filter(e=>n(e))),0!==r.length){for(let n of e.arguments()){let e=eG(n.type,t.schema());eB({source:n,dest:t.addArgument(n.name,e),copyDirectiveApplications:i,cloneJoinDirectives:!0})}t.repeatable=e.repeatable,t.addLocations(...r),t.sourceAST=e.sourceAST,t.description=e.description}}i.VariableDefinitions=eL,i.variableDefinitionsFromAST=function(e,t){let i=new eL;for(let n of t)if(!i.add(eC(e,n))){let e=n.variable.name.value;throw v.ERRORS.INVALID_GRAPHQL.err(`Duplicate definition for variable ${e}`,{nodes:t.filter(t=>t.variable.name.value===e)})}return i},i.variableDefinitionFromAST=eC,i.newNamedType=eP,i.copyDirectiveDefinitionToSchema=function({definition:e,schema:t,copyDirectiveApplicationsInArguments:i=!0,locationFilter:n}){eK(e,t.addDirectiveDefinition(e.name),i,n)},i.isFieldDefinition=function(e){return e instanceof eS},i.isElementNamedType=function(e){return e instanceof J}},506370,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.CONNECT_VERSIONS=i.ConnectSpecDefinition=i.connectIdentity=void 0;let n=e.r(186846),r=e.r(785576),a=e.r(168032),s=e.r(319894),o=e.r(343924),l=e.r(408470),u=e.r(678270),c=e.r(331484),d=e.r(367356);i.connectIdentity="https://specs.apollo.dev/connect";let p="connect",h="URLPathTemplate",f="JSONSelection",m="ConnectHTTP",y="ConnectBatch",v="ConnectorErrors",g="SourceHTTP",T="HTTPHeaderMapping";class S extends r.FeatureDefinition{constructor(e,t){function s(e,t,i,n){(0,c.assert)(n,"Shouldn't be added without being attached to a @connect spec");let r=n.typeNameInSchema(e),a=i.typeOfKind(r,t);return(0,c.assert)(a,()=>`Expected "${r}" to be defined`),a}super(new r.FeatureUrl(i.connectIdentity,p,e),t),this.minimumFederationVersion=t,this.registerType((0,o.createScalarTypeSpecification)({name:h})),this.registerType((0,o.createScalarTypeSpecification)({name:f})),this.registerType(E({name:v,inputFieldsFct:(e,t)=>{let i=s(f,"ScalarType",e,t);return[{name:"message",type:i},{name:"extensions",type:i}]}})),this.registerType(E({name:T,inputFieldsFct:e=>[{name:"name",type:new a.NonNullType(e.stringType())},{name:"from",type:e.stringType()},{name:"value",type:e.stringType()}]})),this.registerType(E({name:y,inputFieldsFct:e=>[{name:"maxSize",type:e.intType()}]})),this.registerType(E({name:g,inputFieldsFct:(e,t)=>{let i=s(f,"ScalarType",e,t),n=s(T,"InputObjectType",e,t);return[{name:"baseURL",type:new a.NonNullType(e.stringType())},{name:"headers",type:new a.ListType(new a.NonNullType(n))},{name:"path",type:i},{name:"queryParams",type:i}]}})),this.registerType(E({name:m,inputFieldsFct:(e,t)=>{let i=s(h,"ScalarType",e,t),n=s(f,"ScalarType",e,t),r=s(T,"InputObjectType",e,t);return[{name:"GET",type:i},{name:"POST",type:i},{name:"PUT",type:i},{name:"PATCH",type:i},{name:"DELETE",type:i},{name:"body",type:n},{name:"headers",type:new a.ListType(new a.NonNullType(r))},{name:"path",type:n},{name:"queryParams",type:n}]}})),this.registerDirective((0,o.createDirectiveSpecification)({name:p,locations:[n.DirectiveLocation.FIELD_DEFINITION,n.DirectiveLocation.OBJECT],repeatable:!0,args:[{name:"source",type:e=>e.stringType()},{name:"id",type:e=>e.stringType()},{name:"http",type:(e,t)=>s(m,"InputObjectType",e,t)},{name:"batch",type:(e,t)=>s(y,"InputObjectType",e,t)},{name:"errors",type:(e,t)=>s(v,"InputObjectType",e,t)},{name:"selection",type:(e,t)=>{let i=s(f,"ScalarType",e,t);return new a.NonNullType(i)}},{name:"entity",type:e=>e.booleanType(),defaultValue:!1},{name:"isSuccess",type:(e,t)=>s(f,"ScalarType",e,t)}],composes:!1})),this.registerDirective((0,o.createDirectiveSpecification)({name:"source",locations:[n.DirectiveLocation.SCHEMA],repeatable:!0,composes:!1,args:[{name:"name",type:e=>new a.NonNullType(e.stringType())},{name:"http",type:(e,t)=>{let i=s(g,"InputObjectType",e,t);return new a.NonNullType(i)}},{name:"errors",type:(e,t)=>s(v,"InputObjectType",e,t)},{name:"isSuccess",type:(e,t)=>s(f,"ScalarType",e,t)}]}))}get defaultCorePurpose(){return"EXECUTION"}}function E({name:e,inputFieldsFct:t}){return{name:e,checkOrAdd:(i,n,r)=>{var s;let p=null!=(s=null==n?void 0:n.typeNameInSchema(e))?s:e,h=t(i,n),f=i.type(p);if(f){let t=(0,o.ensureSameTypeKind)("InputObjectType",f);if(t.length>0)return t;for(let{name:i,type:n,defaultValue:r}of((0,c.assert)((0,a.isInputObjectType)(f),"Should be an input object type"),h)){let s=f.field(i);if(!s){(0,a.isNonNullType)(n)&&void 0===r&&t.push(l.ERRORS.TYPE_DEFINITION_INVALID.err(`Invalid definition for type ${e}: missing required input field "${i}"`,{nodes:f.sourceAST}));continue}let o=s.type;(0,a.isNonNullType)(o)&&!(0,a.isNonNullType)(n)&&(o=o.ofType),(0,u.sameType)(n,o)?(0,d.valueEquals)(r,s.defaultValue)||t.push(l.ERRORS.TYPE_DEFINITION_INVALID.err(`Invalid definition type ${e}: input field "${i}" should have default value ${(0,d.valueToString)(r)} but found default value ${(0,d.valueToString)(s.defaultValue)}`,{nodes:s.sourceAST})):t.push(l.ERRORS.TYPE_DEFINITION_INVALID.err(`Invalid definition for type ${e}: input field "${i}" should have type "${n}" but found type "${s.type}"`,{nodes:s.sourceAST}))}for(let i of f.fields())h.some(e=>e.name===i.name)||t.push(l.ERRORS.TYPE_DEFINITION_INVALID.err(`Invalid definition for type ${e}: unknown/unsupported input field "${i.name}"`,{nodes:i.sourceAST}));return t}{let e=i.addType(new a.InputObjectType(p,r));for(let{name:t,type:i,defaultValue:n}of h)e.addField(t,i).defaultValue=n;return[]}}}}i.ConnectSpecDefinition=S,i.CONNECT_VERSIONS=new r.FeatureDefinitions(i.connectIdentity).add(new S(new r.FeatureVersion(0,1),new r.FeatureVersion(2,10))).add(new S(new r.FeatureVersion(0,2),new r.FeatureVersion(2,11))).add(new S(new r.FeatureVersion(0,3),new r.FeatureVersion(2,12))).add(new S(new r.FeatureVersion(0,4),new r.FeatureVersion(2,13)),{preview:!0}),(0,s.registerKnownFeature)(i.CONNECT_VERSIONS)},826468,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.builtTypeReference=i.buildSchemaFromAST=i.buildSchema=void 0;let n=e.r(186846),r=e.r(367356),a=e.r(168032),s=e.r(408470),o=e.r(836270),l=e.r(319894),u=e.r(506370);function c(e){return e?(0,r.valueFromASTUntyped)(e):void 0}function d(e,t){var i,r;let c=[],d=new a.Schema(null==t?void 0:t.blueprint),{directiveDefinitions:h,typeDefinitions:y,typeExtensions:S,schemaDefinitions:E,schemaExtensions:b}=function(e,t,i){let n=[],r=[],l=[],u=[],c=[];for(let d of e.definitions)switch(d.kind){case"OperationDefinition":case"FragmentDefinition":i.push(s.ERRORS.INVALID_GRAPHQL.err("Invalid executable definition found while building schema",{nodes:d}));continue;case"SchemaDefinition":u.push(d),t.schemaDefinition.preserveEmptyDefinition=!0;break;case"SchemaExtension":c.push(d);break;case"ScalarTypeDefinition":case"ObjectTypeDefinition":case"InterfaceTypeDefinition":case"UnionTypeDefinition":case"EnumTypeDefinition":case"InputObjectTypeDefinition":if(o.introspectionTypeNames.includes(d.name.value))continue;r.push(d);let e=t.type(d.name.value);if(!e||e.isBuiltIn)e=t.addType((0,a.newNamedType)(p(d.kind),d.name.value));else if(e.preserveEmptyDefinition)throw s.ERRORS.INVALID_GRAPHQL.err(`There can be only one type named "${d.name.value}"`);e.preserveEmptyDefinition=!0;break;case"ScalarTypeExtension":case"ObjectTypeExtension":case"InterfaceTypeExtension":case"UnionTypeExtension":case"EnumTypeExtension":case"InputObjectTypeExtension":if(o.introspectionTypeNames.includes(d.name.value))continue;l.push(d);let h=t.type(d.name.value);if(h){if(h.isBuiltIn)throw s.ERRORS.INVALID_GRAPHQL.err(`Cannot extend built-in type "${d.name.value}"`)}else t.addType((0,a.newNamedType)(p(d.kind),d.name.value));break;case"DirectiveDefinition":n.push(d),t.addDirectiveDefinition(d.name.value)}return{directiveDefinitions:n,typeDefinitions:r,typeExtensions:l,schemaDefinitions:u,schemaExtensions:c}}(e,d,c);for(let e of y)e.kind===n.Kind.ENUM_TYPE_DEFINITION&&g(e,d.type(e.name.value));for(let e of S)if(e.kind===n.Kind.ENUM_TYPE_EXTENSION){let t=d.type(e.name.value).newExtension();t.sourceAST=e,g(e,d.type(e.name.value),t)}for(let e of h)!function(e,t,i){var n;for(let r of null!=(n=e.arguments)?n:[])I(r,t.addArgument(r.name.value),i,!1);t.repeatable=e.repeatable;let r=e.locations.map(({value:e})=>e);t.addLocations(...r),T(e,t)}(e,d.directive(e.name.value),c);for(let e of E)f(e,d.schemaDefinition,c);for(let e of b)f(e,d.schemaDefinition,c,d.schemaDefinition.newExtension());let N=null==(i=d.coreFeatures)?void 0:i.getByIdentity(u.connectIdentity),_=new Set;if(N){let e=(0,l.coreFeatureDefinitionIfKnown)(N.url);if(e){let t=new Set(e.typeSpecs().map(({name:e})=>N.typeNameInSchema(e)));for(let e of y)t.has(e.name.value)&&"InputObjectTypeDefinition"===e.kind&&(_.add(e.name.value),v(e,d.type(e.name.value),d.blueprint,c));for(let e of S){if(!t.has(e.name.value)||"InputObjectTypeExtension"!==e.kind)continue;_.add(e.name.value);let i=d.type(e.name.value),n=i.newExtension();n.sourceAST=e,v(e,i,d.blueprint,c,n)}}}for(let e of(c.push(...d.blueprint.onDirectiveDefinitionAndSchemaParsed(d)),h))!function(e,t,i){var n;for(let r of null!=(n=e.arguments)?n:[])m(r,t.argument(r.name.value),i)}(e,d.directive(e.name.value),c);for(let e of y)_.has(e.name.value)||v(e,d.type(e.name.value),d.blueprint,c);for(let e of S){if(_.has(e.name.value))continue;let t=d.type(e.name.value),i=t.newExtension();i.sourceAST=e,v(e,t,d.blueprint,c,i)}if(c.length>0)throw(0,a.ErrGraphQLValidationFailed)(c);return(null==(r=null==t?void 0:t.validate)||r)&&d.validate(),d}function p(e){let t=e.endsWith("Definition")?"Definition":"Extension";return e.slice(0,e.length-t.length)}function h(e,t,i){try{e()}catch(n){let e=(0,s.errorCauses)(n);if(e)for(let n of e){let e=n.nodes?[t,...n.nodes]:t;i.push((0,s.withModifiedErrorNodes)(n,e))}else throw n}}function f(e,t,i,n){var r,a;for(let a of null!=(r=e.operationTypes)?r:[])h(()=>t.setRoot(a.operation,a.type.name.value).setOfExtension(n),a,i);t.sourceAST=e,"description"in e&&(t.description=null==(a=e.description)?void 0:a.value),m(e,t,i,n)}function m(e,t,i,n){var r;for(let a of null!=(r=e.directives)?r:[])h(()=>{if(t===t.schema().schemaDefinition&&"link"!==a.name.value&&t.schema().blueprint.applyDirectivesAfterParsing())t.addUnappliedDirective({extension:n,directive:a,args:y(a),nameOrDef:a.name.value});else{let e=t.applyDirective(a.name.value,y(a));e.setOfExtension(n),e.sourceAST=a}},a,i)}function y(e){var t;let i=Object.create(null);for(let n of null!=(t=e.arguments)?t:[])i[n.name.value]=c(n.value);return i}function v(e,t,i,n,r){var o,l,u,d,p;switch(e.kind){case"EnumTypeDefinition":case"EnumTypeExtension":for(let i of null!=(o=e.values)?o:[])m(i,t.value(i.name.value),n);break;case"ObjectTypeDefinition":case"ObjectTypeExtension":case"InterfaceTypeDefinition":case"InterfaceTypeExtension":for(let o of null!=(l=e.fields)?l:[]){if(i.ignoreParsedField(t,o.name.value))continue;let e=t.addField(o.name.value);e.setOfExtension(r),function(e,t,i){var n,r,o,l,u,c;for(let r of(o=E(e.type,t.schema()),l=t.coordinate,u=e,c=i,t.type=(0,a.isOutputType)(o)?o:void c.push(s.ERRORS.INVALID_GRAPHQL.err(`The type of "${l}" must be Output Type but got "${o}", a ${o.kind}.`,{nodes:u})),null!=(n=e.arguments)?n:[]))I(r,t.addArgument(r.name.value),i,!0);m(e,t,i),t.description=null==(r=e.description)?void 0:r.value,t.sourceAST=e}(o,e,n)}for(let i of null!=(u=e.interfaces)?u:[])h(()=>{let e=i.name.value;if(t.implementsInterface(e))throw s.ERRORS.INVALID_GRAPHQL.err(`Type "${t}" can only implement "${e}" once.`);t.addImplementedInterface(e).setOfExtension(r)},i,n);break;case"UnionTypeDefinition":case"UnionTypeExtension":for(let i of null!=(d=e.types)?d:[])h(()=>{let e=i.name.value;if(t.hasTypeMember(e))throw s.ERRORS.INVALID_GRAPHQL.err(`Union type "${t}" can only include type "${e}" once.`);t.addType(e).setOfExtension(r)},i,n);break;case"InputObjectTypeDefinition":case"InputObjectTypeExtension":for(let i of null!=(p=e.fields)?p:[]){let e=t.addField(i.name.value);e.setOfExtension(r),function(e,t,i){var n;let r=E(e.type,t.schema());t.type=S(r,t.coordinate,e,i),t.defaultValue=c(e.defaultValue),m(e,t,i),t.description=null==(n=e.description)?void 0:n.value,t.sourceAST=e}(i,e,n)}}m(e,t,n,r),T(e,t)}function g(e,t,i){var n;for(let r of null!=(n=e.values)?n:[]){let e=t.addValue(r.name.value);r.description&&(e.description=r.description.value),e.setOfExtension(i)}T(e,t)}function T(e,t){e.description&&(t.description=e.description.value),t.sourceAST=e}function S(e,t,i,n){return(0,a.isInputType)(e)?e:void n.push(s.ERRORS.INVALID_GRAPHQL.err(`The type of "${t}" must be Input Type but got "${e}", a ${e.kind}.`,{nodes:i}))}function E(e,t){switch(e.kind){case n.Kind.LIST_TYPE:return new a.ListType(E(e.type,t));case n.Kind.NON_NULL_TYPE:let i=E(e.type,t);if(i.kind==n.Kind.NON_NULL_TYPE)throw s.ERRORS.INVALID_GRAPHQL.err("Cannot apply the non-null operator (!) twice to the same type",{nodes:e});return new a.NonNullType(i);default:let r=t.type(e.name.value);if(!r)throw s.ERRORS.INVALID_GRAPHQL.err(`Unknown type ${e.name.value}`,{nodes:e});return r}}function I(e,t,i,n){var r;let a=E(e.type,t.schema());t.type=S(a,t.coordinate,e,i),t.defaultValue=c(e.defaultValue),n&&m(e,t,i),t.description=null==(r=e.description)?void 0:r.value,t.sourceAST=e}i.buildSchema=function(e,t){return d((0,n.parse)(e),t)},i.buildSchemaFromAST=d,i.builtTypeReference=function(e,t){return E((0,n.parseType)(e),t)}},939603,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.KnownTypeNamesInFederationRule=void 0;let n=e.r(186846),r=e.r(308126);i.KnownTypeNamesInFederationRule=function(e){let t=e.getSchema(),i=t?t.getTypeMap():Object.create(null),s=Object.create(null);for(let t of e.getDocument().definitions)((0,n.isTypeDefinitionNode)(t)||(0,n.isTypeExtensionNode)(t))&&(s[t.name.value]=!0);let o=Object.keys(i).concat(Object.keys(s));return{NamedType(t,l,u,c,d){var p,h,f;let m=t.name.value;if(!i[m]&&!s[m]){let i=null!=(p=d[2])?p:u,s=null!=i&&!Array.isArray(h=i)&&((0,n.isTypeSystemDefinitionNode)(h)||(0,n.isTypeSystemExtensionNode)(h));if(s&&(f=m,-1!==a.indexOf(f)))return;let l=(0,r.suggestionList)(m,s?a.concat(o):o);e.reportError(new n.GraphQLError(`Unknown type "${m}".`+(0,r.didYouMean)(l),{nodes:t}))}}}};let a=[...n.specifiedScalarTypes,...n.introspectionTypes].map(e=>e.name)},279403,e=>{"use strict";let t,i;e.s([],855276),e.i(855276);var n=e.i(254799);let r=new Uint8Array(256),a=r.length;function s(){return a>r.length-16&&(n.default.randomFillSync(r),a=0),r.slice(a,a+=16)}let o=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,l=function(e){return"string"==typeof e&&o.test(e)},u=[];for(let e=0;e<256;++e)u.push((e+256).toString(16).slice(1));function c(e,t=0){return u[e[t+0]]+u[e[t+1]]+u[e[t+2]]+u[e[t+3]]+"-"+u[e[t+4]]+u[e[t+5]]+"-"+u[e[t+6]]+u[e[t+7]]+"-"+u[e[t+8]]+u[e[t+9]]+"-"+u[e[t+10]]+u[e[t+11]]+u[e[t+12]]+u[e[t+13]]+u[e[t+14]]+u[e[t+15]]}let d=0,p=0,h=function(e){let t;if(!l(e))throw TypeError("Invalid UUID");let i=new Uint8Array(16);return i[0]=(t=parseInt(e.slice(0,8),16))>>>24,i[1]=t>>>16&255,i[2]=t>>>8&255,i[3]=255&t,i[4]=(t=parseInt(e.slice(9,13),16))>>>8,i[5]=255&t,i[6]=(t=parseInt(e.slice(14,18),16))>>>8,i[7]=255&t,i[8]=(t=parseInt(e.slice(19,23),16))>>>8,i[9]=255&t,i[10]=(t=parseInt(e.slice(24,36),16))/0x10000000000&255,i[11]=t/0x100000000&255,i[12]=t>>>24&255,i[13]=t>>>16&255,i[14]=t>>>8&255,i[15]=255&t,i};function f(e,t,i){function n(e,n,r,a){var s;if("string"==typeof e&&(e=function(e){e=unescape(encodeURIComponent(e));let t=[];for(let i=0;i<e.length;++i)t.push(e.charCodeAt(i));return t}(e)),"string"==typeof n&&(n=h(n)),(null==(s=n)?void 0:s.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let o=new Uint8Array(16+e.length);if(o.set(n),o.set(e,n.length),(o=i(o))[6]=15&o[6]|t,o[8]=63&o[8]|128,r){a=a||0;for(let e=0;e<16;++e)r[a+e]=o[e];return r}return c(o)}try{n.name=e}catch(e){}return n.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",n.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",n}let m=f("v3",48,function(e){return Array.isArray(e)?e=Buffer.from(e):"string"==typeof e&&(e=Buffer.from(e,"utf8")),n.default.createHash("md5").update(e).digest()}),y={randomUUID:n.default.randomUUID},v=f("v5",80,function(e){return Array.isArray(e)?e=Buffer.from(e):"string"==typeof e&&(e=Buffer.from(e,"utf8")),n.default.createHash("sha1").update(e).digest()});e.s(["NIL",0,"00000000-0000-0000-0000-000000000000","parse",0,h,"stringify",0,function(e,t=0){let i=c(e,t);if(!l(i))throw TypeError("Stringified UUID is invalid");return i},"v1",0,function(e,n,r){let a=n&&r||0,o=n||Array(16),l=(e=e||{}).node||t,u=void 0!==e.clockseq?e.clockseq:i;if(null==l||null==u){let n=e.random||(e.rng||s)();null==l&&(l=t=[1|n[0],n[1],n[2],n[3],n[4],n[5]]),null==u&&(u=i=(n[6]<<8|n[7])&16383)}let h=void 0!==e.msecs?e.msecs:Date.now(),f=void 0!==e.nsecs?e.nsecs:p+1,m=h-d+(f-p)/1e4;if(m<0&&void 0===e.clockseq&&(u=u+1&16383),(m<0||h>d)&&void 0===e.nsecs&&(f=0),f>=1e4)throw Error("uuid.v1(): Can't create more than 10M uuids/sec");d=h,p=f,i=u;let y=((0xfffffff&(h+=122192928e5))*1e4+f)%0x100000000;o[a++]=y>>>24&255,o[a++]=y>>>16&255,o[a++]=y>>>8&255,o[a++]=255&y;let v=h/0x100000000*1e4&0xfffffff;o[a++]=v>>>8&255,o[a++]=255&v,o[a++]=v>>>24&15|16,o[a++]=v>>>16&255,o[a++]=u>>>8|128,o[a++]=255&u;for(let e=0;e<6;++e)o[a+e]=l[e];return n||c(o)},"v3",0,m,"v4",0,function(e,t,i){if(y.randomUUID&&!t&&!e)return y.randomUUID();let n=(e=e||{}).random||(e.rng||s)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){i=i||0;for(let e=0;e<16;++e)t[i+e]=n[e];return t}return c(n)},"v5",0,v,"validate",0,l,"version",0,function(e){if(!l(e))throw TypeError("Invalid UUID");return parseInt(e.slice(14,15),16)}],279403)},738207,(e,t,i)=>{"use strict";var n,r;Object.defineProperty(i,"__esModule",{value:!0}),i.hasSelectionWithPredicate=i.operationToDocument=i.parseOperationAST=i.parseSelectionSet=i.parseOperation=i.operationFromDocument=i.FragmentSpreadSelection=i.FragmentSelection=i.FieldSelection=i.selectionOfElement=i.selectionSetOfElement=i.selectionSetOf=i.allFieldDefinitionsInSelectionSet=i.MutableSelectionSet=i.SelectionSetUpdates=i.SelectionSet=i.ContainsResult=i.NamedFragments=i.NamedFragmentDefinition=i.Operation=i.concatOperationPaths=i.conditionalDirectivesInOperationPath=i.sameOperationPaths=i.operationPathToStringPath=i.FragmentElement=i.Field=i.DEFAULT_MIN_USAGES_TO_OPTIMIZE=void 0;let a=e.r(186846),s=e.r(168032),o=e.r(951071),l=e.r(408470),u=e.r(678270),c=e.r(331484),d=e.r(367356),p=e.r(279403);function h(e,t,i){if(!e)throw l.ERRORS.INVALID_GRAPHQL.err(t(),{nodes:i})}function f(e,t){return(0,s.sameDirectiveApplications)(e.appliedDirectives,t.appliedDirectives)}i.DEFAULT_MIN_USAGES_TO_OPTIMIZE=2;class m extends s.DirectiveTargetElement{constructor(e,t){super(e,t)}collectVariables(e){this.collectVariablesInElement(e),this.collectVariablesInAppliedDirectives(e)}rebaseOnOrError(e){return this.rebaseOn({parentType:e,errorIfCannotRebase:!0})}addAttachment(e,t){this.attachments||(this.attachments=new Map),this.attachments.set(e,t)}getAttachment(e){var t;return null==(t=this.attachments)?void 0:t.get(e)}copyAttachmentsTo(e){if(this.attachments)for(let[t,i]of this.attachments.entries())e.addAttachment(t,i)}keyForDirectives(){return this.appliedDirectives.map(e=>(function(e,t=["defer"]){if(t.includes(e.name))return(0,p.v1)();let i=Object.entries(e.arguments()).filter(([e,t])=>void 0!==t);i.sort(([e],[t])=>e.localeCompare(t));let n=0==i.length?"":"("+i.map(([t,i])=>`${t}: ${(0,d.valueToString)(i,e.argumentType(t))}`).join(", ")+")";return`@${e.name}${n}`})(e)).join(" ")}}class y extends m{constructor(e,t,i,n){super(e.schema(),i),this.definition=e,this.args=t,this.alias=n,this.kind="Field"}collectVariablesInElement(e){this.args&&e.collectInArguments(this.args)}get name(){return this.definition.name}argumentValue(e){return this.args?this.args[e]:void 0}responseName(){return this.alias?this.alias:this.name}key(){return this.responseName()+this.keyForDirectives()}asPathElement(){return this.responseName()}get parentType(){return this.definition.parent}isLeafField(){return(0,s.isLeafType)(this.baseType())}baseType(){return(0,s.baseType)(this.definition.type)}copy(){let e=new y(this.definition,this.args,this.appliedDirectives,this.alias);return this.copyAttachmentsTo(e),e}withUpdatedArguments(e){let t=new y(this.definition,{...this.args,...e},this.appliedDirectives,this.alias);return this.copyAttachmentsTo(t),t}withUpdatedDefinition(e){let t=new y(e,this.args,this.appliedDirectives,this.alias);return this.copyAttachmentsTo(t),t}withUpdatedAlias(e){let t=new y(this.definition,this.args,this.appliedDirectives,e);return this.copyAttachmentsTo(t),t}withUpdatedDirectives(e){let t=new y(this.definition,this.args,e,this.alias);return this.copyAttachmentsTo(t),t}argumentsToNodes(){if(!this.args)return;let e=Object.entries(this.args);if(0!==e.length)return e.map(([e,t])=>({kind:a.Kind.ARGUMENT,name:{kind:a.Kind.NAME,value:e},value:(0,d.valueToAST)(t,this.definition.argument(e).type)}))}selects(e,t=!1,i,n){if((0,c.assert)(t||i,"Must provide variable definitions if validation is needed"),e===this.definition)return!0;if(this.name!==e.name)return!1;for(let r of e.arguments()){let e=this.argumentValue(r.name);if(void 0===e){if(void 0===r.defaultValue&&!(0,s.isNullableType)(r.type)&&(!n||!(null==n?void 0:n.includes(r.name))))return!1}else if(!t&&!(0,d.isValidValue)(e,r,i))return!1}if(!t&&this.args){for(let[t,i]of Object.entries(this.args))if(null!==i&&void 0===e.argument(t))return!1}return!0}validate(e,t){var i;for(let n of(h(this.name===this.definition.name,()=>`Field name "${this.name}" cannot select field "${this.definition.coordinate}: name mismatch"`),this.definition.arguments())){let r=this.argumentValue(n.name),a=!1,l=this.definition.schema(),u=null==(i=(0,o.federationMetadata)(l))?void 0:i.fromContextDirective();u&&(0,o.isFederationDirectiveDefinedInSchema)(u)&&(a=n.appliedDirectivesOf(u).length>0),void 0===r?h(a&&!t||void 0!==n.defaultValue||(0,s.isNullableType)(n.type),()=>`Missing mandatory value for argument "${n.name}" of field "${this.definition.coordinate}" in selection "${this}"`):h(a&&!t||(0,d.isValidValue)(r,n,e),()=>`Invalid value ${(0,d.valueToString)(r)} for argument "${n.coordinate}" of type ${n.type}`)}if(this.args)for(let[e,t]of Object.entries(this.args))h(null===t||void 0!==this.definition.argument(e),()=>`Unknown argument "${e}" in field application of "${this.name}"`)}rebaseOn({parentType:e,errorIfCannotRebase:t}){if(e===this.definition.parent)return this;if(this.name===s.typenameFieldName)if((0,s.possibleRuntimeTypes)(e).some(e=>(0,o.isInterfaceObjectType)(e)))return void h(!t,()=>`Cannot add selection of field "${this.definition.coordinate}" to selection set of parent type "${e}" that is potentially an interface object type at runtime`);else return this.withUpdatedDefinition(e.typenameField());let i=e.field(this.name);return this.canRebaseOn(e)&&i?this.withUpdatedDefinition(i):void h(!t,()=>`Cannot add selection of field "${this.definition.coordinate}" to selection set of parent type "${e}"`)}canRebaseOn(e){let t=this.definition.parent;return e.name===t.name||(0,s.isInterfaceType)(t)||(0,o.isInterfaceObjectType)(t)}typeIfAddedTo(e){var t,i,n;if(e==this.definition.parent)return this.definition.type;if(this.name===s.typenameFieldName)return null==(t=e.typenameField())?void 0:t.type;let r=this.canRebaseOn(e)?null==(i=e.field(this.name))?void 0:i.type:void 0,a=null==(n=(0,o.federationMetadata)(e.schema()))?void 0:n.fromContextDirective();if(a&&(0,o.isFederationDirectiveDefinedInSchema)(a)){let t=e.field(this.name);if(t&&t.arguments().some(e=>e.appliedDirectivesOf(a).length>0&&(!this.args||void 0===this.args[e.name])))return}return r}hasDefer(){return!1}deferDirectiveArgs(){}withoutDefer(){return this}equals(e){return this===e||"Field"===e.kind&&this.name===e.name&&this.alias===e.alias&&(this.args?e.args&&(0,d.argumentsEquals)(this.args,e.args):!e.args)&&f(this,e)}toString(){let e=this.alias?this.alias+": ":"",t=this.args?Object.entries(this.args):[],i=0===t.length?"":"("+t.map(([e,t])=>{var i;return`${e}: ${(0,d.valueToString)(t,null==(i=this.definition.argument(e))?void 0:i.type)}`}).join(", ")+")";return e+this.name+i+this.appliedDirectivesToString()}}i.Field=y;class v extends m{constructor(e,t,i){super(e.schema(),i),this.sourceType=e,this.kind="FragmentElement",this.typeCondition=void 0!==t&&"string"==typeof t?this.schema().type(t):t}collectVariablesInElement(e){}get parentType(){return this.sourceType}key(){return this.computedKey||(this.computedKey="..."+(this.typeCondition?" on "+this.typeCondition.name:"")+this.keyForDirectives()),this.computedKey}castedType(){return this.typeCondition?this.typeCondition:this.sourceType}asPathElement(){let e=this.typeCondition;return e?`... on ${e}`:void 0}withUpdatedSourceType(e){return this.withUpdatedTypes(e,this.typeCondition)}withUpdatedCondition(e){return this.withUpdatedTypes(this.sourceType,e)}withUpdatedTypes(e,t){let i=new v(e,null==t?void 0:t.name,this.appliedDirectives);return this.copyAttachmentsTo(i),i}withUpdatedDirectives(e){let t=new v(this.sourceType,this.typeCondition,e);return this.copyAttachmentsTo(t),t}rebaseOn({parentType:e,errorIfCannotRebase:t}){let i=this.parentType,n=this.typeCondition;if(e===i)return this;let{canRebase:r,rebasedCondition:a}=this.canRebaseOn(e);return r?this.withUpdatedTypes(e,a):void h(!t,()=>`Cannot add fragment of condition "${n}" (runtimes: [${(0,s.possibleRuntimeTypes)(n)}]) to parent type "${e}" (runtimes: ${(0,s.possibleRuntimeTypes)(e)})`)}canRebaseOn(e){if(!this.typeCondition)return{canRebase:!0,rebasedCondition:void 0};let t=e.schema().type(this.typeCondition.name);return t&&(0,s.isCompositeType)(t)&&(0,s.runtimeTypesIntersects)(e,t)?{canRebase:!0,rebasedCondition:t}:{canRebase:!1}}castedTypeIfAddedTo(e){if(e==this.parentType)return this.castedType();let{canRebase:t,rebasedCondition:i}=this.canRebaseOn(e);return t?i||e:void 0}hasDefer(){return this.hasAppliedDirective("defer")}hasStream(){return this.hasAppliedDirective("stream")}deferDirectiveArgs(){var e;return null==(e=this.appliedDirectivesOf(this.schema().deferDirective())[0])?void 0:e.arguments()}withoutDefer(){let e=this.schema().deferDirective().name,t=this.appliedDirectives.filter(t=>t.name!==e);if(!this.typeCondition&&0===t.length)return;if(t.length===this.appliedDirectives.length)return this;let i=new v(this.sourceType,this.typeCondition,t);return this.copyAttachmentsTo(i),i}withNormalizedDefer(e){let t,i,n=this.deferDirectiveArgs();if(!n)return this;if(void 0!==n.if)if("boolean"==typeof n.if)if(!n.if)return this.withoutDefer();else t={...n,if:void 0};else i=n.if;let r=n.label;if(r||(r=e.newLabel(),t?t.label=r:t={...n,label:r}),i&&e.registerCondition(r,i),!t)return this;let a=this.schema().deferDirective(),o=this.appliedDirectives.filter(e=>e.name!==a.name).concat(new s.Directive(a.name,t)),l=new v(this.sourceType,this.typeCondition,o);return this.copyAttachmentsTo(l),l}equals(e){var t,i;return this===e||"FragmentElement"===e.kind&&(null==(t=this.typeCondition)?void 0:t.name)===(null==(i=e.typeCondition)?void 0:i.name)&&f(this,e)}toString(){return"..."+(this.typeCondition?" on "+this.typeCondition:"")+this.appliedDirectivesToString()}}function g(e){return e.map(e=>e.appliedDirectives).flat().filter(e=>(0,s.isConditionalDirective)(e))}i.FragmentElement=v,i.operationPathToStringPath=function(e){return e.filter(e=>!("FragmentElement"===e.kind&&!e.typeCondition)).map(e=>{var t;return"Field"===e.kind?e.responseName():`... on ${null==(t=e.typeCondition)?void 0:t.coordinate}`})},i.sameOperationPaths=function(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if(!e[i].equals(t[i]))return!1;return!0},i.conditionalDirectivesInOperationPath=g,i.concatOperationPaths=function(e,t){var i,n,r;let a;if(0===e.length)return t;if(0===t.length)return e;let o=e[e.length-1],l=g(e),c=t[0];for(;c&&(i=o,n=c,r=l,(a="Field"===i.kind?i.baseType():i.typeCondition)&&"FragmentElement"===n.kind&&n.typeCondition&&(0===n.appliedDirectives.length||(0,s.isDirectiveApplicationsSubset)(r,n.appliedDirectives))&&(0,u.isSubtype)(n.typeCondition,a));)c=(t=t.slice(1))[0];return e.concat(t)};class T extends s.DirectiveTargetElement{constructor(e,t,i,n,r,a,s=[]){super(e,s),this.rootKind=t,this.selectionSet=i,this.variableDefinitions=n,this.fragments=r,this.name=a}withUpdatedSelectionSet(e){return this.selectionSet===e?this:new T(this.schema(),this.rootKind,e,this.variableDefinitions,this.fragments,this.name,this.appliedDirectives)}collectUndefinedVariablesFromFragments(e){let t=new s.VariableCollector;for(let i of e.definitions())i.selectionSet.usedVariables().forEach(e=>{this.variableDefinitions.definition(e)||t.add(e)});return t.variables()}withUpdatedSelectionSetAndFragments(e,t,i){if(this.selectionSet===e&&t===this.fragments)return this;let n=this.variableDefinitions;if(i&&t){let e=this.collectUndefinedVariablesFromFragments(t);e.length>0&&((n=new s.VariableDefinitions).addAll(this.variableDefinitions),n.addAll(i.filter(e)))}return new T(this.schema(),this.rootKind,e,n,t,this.name,this.appliedDirectives)}optimize(e,t=i.DEFAULT_MIN_USAGES_TO_OPTIMIZE,n){if((0,c.assert)(t>=1,`Expected 'minUsagesToOptimize' to be at least 1, but got ${t}`),!e||e.isEmpty())return this;let r=this.selectionSet.optimize(e);if(r===this.selectionSet)return this;let a=function(e,t,i){let n=new Map;if(e.collectUsedFragmentNames(n),0===n.size)return null;for(let e of t.definitions())void 0===n.get(e.name)&&n.set(e.name,0);let r=function(e){let t=new c.SetMultiMap;for(let i of e.definitions())for(let e of i.fragmentUsages().keys())t.add(e,i.name);return t}(t),a=new Set,s=!0;for(;s;)for(let e of(s=!1,!function(e,t,i){let n=Array.from(e.entries()).filter(([e,t])=>t>=i).map(([e,t])=>e);for(;n.length>0;){let r=[];for(let a of n)for(let[n,s]of(e.delete(a),t.get(a).fragmentUsages().entries())){let t=e.get(n);if(void 0!==t){let a=t+s;e.set(n,a),t<i&&a>=i&&r.push(n)}}n=r}}(n,t,i),(0,c.mapKeys)(n))){let o=n.get(e);if(0===o)continue;if(o>=i){s=!0;break}let l=r.get(e);if(!l||[...l].every(e=>a.has(e)||!n.get(e)))for(let[i,r]of(a.add(e),n.delete(e),s=!0,t.get(e).fragmentUsages().entries())){let e=n.get(i);void 0!==e&&n.set(i,e+o*r)}}for(let e of n.keys())a.add(e);return 0===a.size?t:t.filter(e=>!a.has(e.name))}(r,e,t);if(null!==a&&(null==a?void 0:a.size)!==e.size&&(r=(r=r.expandFragments(a)).normalize({parentType:r.parentType}),a)){let e;do{e=a;let t=new Map;r.collectUsedFragmentNames(t),a.collectUsedFragmentNames(t),a=a.filter(e=>{var i;return(null!=(i=t.get(e.name))?i:0)>0})}while(a&&a.size<e.size)}return this.withUpdatedSelectionSetAndFragments(r,null!=a?a:void 0,n)}generateQueryFragments(){let[e,t]=this.selectionSet.minimizeSelectionSet();return new T(this.schema(),this.rootKind,e,this.variableDefinitions,t,this.name,this.appliedDirectives)}expandAllFragments(){let e=this.selectionSet.expandFragments();return this.withUpdatedSelectionSetAndFragments(e.normalize({parentType:e.parentType}),void 0)}normalize(){return this.withUpdatedSelectionSet(this.selectionSet.normalize({parentType:this.selectionSet.parentType}))}withoutDefer(e){return this.withUpdatedSelectionSet(this.selectionSet.withoutDefer(e))}withNormalizedDefer(){let e=new I,{hasDefers:t,hasNonLabelledOrConditionalDefers:i}=e.init(this.selectionSet),n=this;return i&&(n=this.withUpdatedSelectionSet(this.selectionSet.withNormalizedDefer(e))),{operation:n,hasDefers:t,assignedDeferLabels:e.assignedLabels,deferConditions:e.deferConditions}}collectDefaultedVariableValues(){let e=Object.create(null);for(let{variable:t,defaultValue:i}of this.variableDefinitions.definitions())void 0!==i&&(e[t.name]=i);return e}toString(e=!1,t=!0){return this.selectionSet.toOperationString(this.rootKind,this.variableDefinitions,this.fragments,this.name,this.appliedDirectives,e,t)}}i.Operation=T;class S extends s.DirectiveTargetElement{constructor(e,t,i,n){super(e,n),this.name=t,this.typeCondition=i,this.expandedSelectionSetsAtTypesCache=new Map}setSelectionSet(e){return(0,c.assert)(!this._selectionSet,"Attempting to set the selection set of a fragment definition already built"),(0,c.assert)(e.parentType===this.typeCondition,`Fragment selection set parent is ${e.parentType} differs from the fragment condition type ${this.typeCondition}`),this._selectionSet=e,this}get selectionSet(){return(0,c.assert)(this._selectionSet,()=>`Trying to access fragment definition ${this.name} before it is fully built`),this._selectionSet}withUpdatedSelectionSet(e){return new S(this.schema(),this.name,this.typeCondition).setSelectionSet(e)}fragmentUsages(){return this._fragmentUsages||(this._fragmentUsages=new Map,this.selectionSet.collectUsedFragmentNames(this._fragmentUsages)),this._fragmentUsages}collectUsedFragmentNames(e){for(let[t,i]of this.fragmentUsages().entries()){let n=e.get(t);e.set(t,n?n+i:i)}}collectVariables(e){this.selectionSet.collectVariables(e),this.collectVariablesInAppliedDirectives(e)}toFragmentDefinitionNode(){return{kind:a.Kind.FRAGMENT_DEFINITION,name:{kind:a.Kind.NAME,value:this.name},typeCondition:{kind:a.Kind.NAMED_TYPE,name:{kind:a.Kind.NAME,value:this.typeCondition.name}},selectionSet:this.selectionSet.toSelectionSetNode()}}canApplyDirectlyAtType(e){if((0,u.sameType)(e,this.typeCondition))return!0;if(!(0,s.isAbstractType)(this.typeCondition))return!1;let t=(0,s.possibleRuntimeTypes)(this.typeCondition),i=(0,s.possibleRuntimeTypes)(e);return!(t.length<i.length)&&!!i.every(e=>t.some(t=>(0,u.sameType)(e,t)))&&((0,s.isObjectType)(e)||(0,s.isUnionType)(this.typeCondition))}expandedSelectionSet(){return this._expandedSelectionSet||(this._expandedSelectionSet=this.selectionSet.expandFragments()),this._expandedSelectionSet}expandedSelectionSetAtType(e){let t=this.expandedSelectionSetsAtTypesCache.get(e.name);return t||(t=this.computeExpandedSelectionSetAtType(e),this.expandedSelectionSetsAtTypesCache.set(e.name,t)),t}computeExpandedSelectionSetAtType(e){let t=this.expandedSelectionSet(),i=t.normalize({parentType:e});if(!(0,s.isObjectType)(this.typeCondition))return{selectionSet:i,validator:k.build(t)};let n=t.minus(i);return{selectionSet:i,validator:n.isEmpty()?void 0:k.build(n)}}includes(e){return this.name!==e&&(this._includedFragmentNames||(this._includedFragmentNames=this.computeIncludedFragmentNames()),this._includedFragmentNames.has(e))}computeIncludedFragmentNames(){let e=new Set;for(let t of this.selectionSet.selections())t instanceof U&&e.add(t.namedFragment.name);return e}toString(e){return`fragment ${this.name} on ${this.typeCondition}${this.appliedDirectivesToString()} ${this.selectionSet.toString(!1,!0,e)}`}}i.NamedFragmentDefinition=S;class E{constructor(){this.fragments=new c.MapWithCachedArrays}isEmpty(){return 0===this.size}get size(){return this.fragments.size}names(){return this.fragments.keys()}add(e){if(this.fragments.has(e.name))throw l.ERRORS.INVALID_GRAPHQL.err(`Duplicate fragment name '${e}'`);this.fragments.set(e.name,e)}addIfNotExist(e){this.fragments.has(e.name)||this.fragments.set(e.name,e)}maybeApplyingDirectlyAtType(e){return this.fragments.values().filter(t=>t.canApplyDirectlyAtType(e))}get(e){return this.fragments.get(e)}has(e){return this.fragments.has(e)}definitions(){return this.fragments.values()}collectUsedFragmentNames(e){for(let t of this.definitions())t.collectUsedFragmentNames(e)}map(e){let t=new E;for(let i of this.fragments.values())t.fragments.set(i.name,e(i));return t}mapInDependencyOrder(e){let t=new Map;for(let e of this.definitions())t.set(e.name,{fragment:e,dependsOn:Array.from(e.fragmentUsages().keys())});let i=new Set,n=new E;for(;t.size>0;)for(let[r,a]of t)if(a.dependsOn.every(e=>n.has(e)||i.has(e))){let s=e(a.fragment,n);t.delete(r),s?n.add(s):i.add(r);break}return n.isEmpty()?void 0:n}mapToExpandedSelectionSets(e){return this.mapInDependencyOrder((t,i)=>{let n=e(t.selectionSet.expandFragments().normalize({parentType:t.typeCondition}));if(!n)return;let r=n.optimize(i);return t.withUpdatedSelectionSet(r)})}rebaseOn(e){return this.mapInDependencyOrder((t,i)=>{let n=e.type(t.selectionSet.parentType.name);if(!n||!(0,s.isCompositeType)(n))return;let r=t.selectionSet.rebaseOn({parentType:n,fragments:i,errorIfCannotRebase:!1});return(r=r.normalize({parentType:n})).isWorthUsing()?new S(e,t.name,n).setSelectionSet(r):void 0})}filter(e){return this.mapInDependencyOrder((t,i)=>{if(e(t)){let e=t.selectionSet.expandFragments(i);return e===t.selectionSet?t:t.withUpdatedSelectionSet(e.normalize({parentType:e.parentType}))}})}validate(e){for(let t of this.fragments.values())t.selectionSet.validate(e)}toFragmentDefinitionNodes(){return this.definitions().map(e=>e.toFragmentDefinitionNode())}toString(e){return this.definitions().map(t=>t.toString(e)).join("\n\n")}}i.NamedFragments=E;class I{constructor(){this.index=0,this.assignedLabels=new Set,this.deferConditions=new c.SetMultiMap,this.usedLabels=new Set}init(e){let t=!1,i=!1,n=e.selections().concat();for(;n.length>0;){let e=n.pop();if("FragmentSelection"===e.kind){let n=e.element.deferDirectiveArgs();n&&(i=!0,n.label&&void 0===n.if||(t=!0),n.label&&this.usedLabels.add(n.label))}e.selectionSet&&e.selectionSet.selections().forEach(e=>n.push(e))}return{hasDefers:i,hasNonLabelledOrConditionalDefers:t}}nextLabel(){return`qp__${this.index++}`}newLabel(){let e=this.nextLabel();for(;this.usedLabels.has(e);)e=this.nextLabel();return this.assignedLabels.add(e),e}registerCondition(e,t){this.deferConditions.add(t.name,e)}}(r=n||(i.ContainsResult=n={}))[r.NOT_CONTAINED=0]="NOT_CONTAINED",r[r.STRICTLY_CONTAINED=1]="STRICTLY_CONTAINED",r[r.EQUAL=2]="EQUAL";class b{constructor(e,t=new Map){this.parentType=e,this._keyedSelections=t,this._selections=(0,c.mapValues)(t)}minimizeSelectionSet(e=new E,t=new Map){return[this.lazyMap(i=>{var n;if("FragmentSelection"===i.kind&&i.element.typeCondition&&0===i.element.appliedDirectives.length&&i.selectionSet&&i.selectionSet.isWorthUsing()){let r=`on${i.element.typeCondition}`+i.selectionSet.selections().length,a=t.get(r);if(a){let t=a.find(([e])=>e.equals(i.selectionSet));if(t)return new U(this.parentType,e,t[1],[])}let[s]=i.selectionSet.minimizeSelectionSet(e,t),o=t.get(r),l=new S(this.parentType.schema(),`_generated_${r}_${null!=(n=null==o?void 0:o.length)?n:0}`,i.element.typeCondition).setSelectionSet(s);return e.add(l),o?o.push([i.selectionSet,l]):t.set(r,[[i.selectionSet,l]]),new U(this.parentType,e,l,[])}return i.selectionSet&&(i=i.withUpdatedSelectionSet(i.selectionSet.minimizeSelectionSet(e,t)[0])),i}),e]}selectionsInReverseOrder(){let e=this._selections.length,t=Array(e);for(let i=0;i<e;i++)t[i]=this._selections[e-i-1];return t}selections(){return this._selections}hasTopLevelTypenameField(){return this._keyedSelections.has(s.typenameFieldName)}withoutTopLevelTypenameField(){if(!this.hasTopLevelTypenameField)return this;let e=new Map;for(let[t,i]of this._keyedSelections)t!==s.typenameFieldName&&e.set(t,i);return new b(this.parentType,e)}fieldsInSet(){let e=[];for(let t of this.selections())if("FieldSelection"===t.kind)e.push({path:[],field:t});else{let i=t.element.typeCondition,n=i?[`... on ${i}`]:[];for(let{path:i,field:r}of t.selectionSet.fieldsInSet())e.push({path:n.concat(i),field:r})}return e}fieldsByResponseName(){let e=new c.MultiMap;return this.collectFieldsByResponseName(e),e}collectFieldsByResponseName(e){for(let t of this.selections())"FieldSelection"===t.kind?e.add(t.element.responseName(),t):t.selectionSet.collectFieldsByResponseName(e)}usedVariables(){let e=new s.VariableCollector;return this.collectVariables(e),e.variables()}collectVariables(e){for(let t of this.selections())t.collectVariables(e)}collectUsedFragmentNames(e){for(let t of this.selections())t.collectUsedFragmentNames(e)}optimize(e){if(!e||e.isEmpty())return this;let t=new M(new v(this.parentType,this.parentType),this),i=F.ofInitial(k.build(this)),n=t.optimize(e,i);return n instanceof U?R(this.parentType,n):n.selectionSet}optimizeSelections(e,t){return this.lazyMap(i=>i.optimize(e,t))}expandFragments(e){return this.lazyMap(t=>t.expandFragments(e))}normalize({parentType:e,recursive:t}){return this.lazyMap(i=>i.normalize({parentType:e,recursive:t}),{parentType:e})}lazyMap(e,t){var i;let n,r=this.selections();for(let t=0;t<r.length;t++){let i=r[t],a=e(i);if(a!==i&&!n){n=new N;for(let e=0;e<t;e++)n.add(r[e])}a&&n&&n.add(a)}return n?n.toSelectionSet(null!=(i=null==t?void 0:t.parentType)?i:this.parentType):this}withoutDefer(e){return this.lazyMap(t=>t.withoutDefer(e))}withNormalizedDefer(e){return this.lazyMap(t=>t.withNormalizedDefer(e))}hasDefer(){return this.selections().some(e=>e.hasDefer())}filter(e){return this.lazyMap(t=>e(t)?t:void 0)}filterRecursiveDepthFirst(e){return this.lazyMap(t=>t.filterRecursiveDepthFirst(e))}withoutEmptyBranches(){let e=this.filterRecursiveDepthFirst(e=>{var t;return(null==(t=e.selectionSet)?void 0:t.isEmpty())!==!0});return e.isEmpty()?void 0:e}rebaseOn({parentType:e,fragments:t,errorIfCannotRebase:i}){if(this.parentType===e)return this;let n=new Map;for(let r of this.selections()){let a=r.rebaseOn({parentType:e,fragments:t,errorIfCannotRebase:i});a&&n.set(r.key(),a)}return new b(e,n)}equals(e){if(this===e)return!0;if(this._selections.length!==e._selections.length)return!1;for(let[t,i]of this._keyedSelections){let n=e._keyedSelections.get(t);if(!n||!i.equals(n))return!1}return!0}contains(e,t){var i;let r=null!=(i=null==t?void 0:t.ignoreMissingTypename)&&i;if(e._selections.length>this._selections.length&&(!r||e._selections.length>this._selections.length+1||this.hasTopLevelTypenameField()||!e.hasTopLevelTypenameField()))return n.NOT_CONTAINED;let a=!0,o=!1;for(let[i,l]of e._keyedSelections){if(i===s.typenameFieldName&&r){this._keyedSelections.has(s.typenameFieldName)||(o=!0);continue}let e=this._keyedSelections.get(i),u=null==e?void 0:e.contains(l,t);if(void 0===u||u===n.NOT_CONTAINED)return n.NOT_CONTAINED;a&&(a=u===n.EQUAL)}return a&&e._selections.length===this._selections.length+ +!!o?n.EQUAL:n.STRICTLY_CONTAINED}containsTopLevelField(e){let t=this._keyedSelections.get(e.key());return!!t&&t.element.equals(e)}minus(e){let t=new N;for(let[i,n]of this._keyedSelections){let r=e._keyedSelections.get(i);if(r){let e=n.minus(r);e&&t.add(e)}else t.add(n)}return t.toSelectionSet(this.parentType)}intersectionWith(e){if(this.isEmpty())return this;if(e.isEmpty())return e;let t=new N;for(let[i,n]of this._keyedSelections){let r=e._keyedSelections.get(i);if(r){let e=n.intersectionWith(r);e&&t.add(e)}}return t.toSelectionSet(this.parentType)}canRebaseOn(e){return this.selections().every(t=>t.canAddTo(e))}validate(e,t=!1){for(let i of(h(!this.isEmpty(),()=>"Invalid empty selection set"),this.selections()))i.validate(e,t)}isEmpty(){return 0===this._selections.length}toSelectionSetNode(){return this.isEmpty()?{kind:a.Kind.SELECTION_SET,selections:[{kind:a.Kind.FIELD,name:{kind:a.Kind.NAME,value:"..."}}]}:{kind:a.Kind.SELECTION_SET,selections:Array.from(this.selectionsInPrintOrder(),e=>e.toSelectionNode())}}selectionsInPrintOrder(){let e=e=>"FieldSelection"===e.kind&&e.isPlainTypenameField(),t=this._selections.find(t=>e(t));return t?[t].concat(this.selections().filter(t=>!e(t))):this._selections}toOperationPaths(){return this.toOperationPathsInternal([])}toOperationPathsInternal(e){return this.selections().flatMap(t=>{let i=e.map(e=>e.concat(t.element));return t.selectionSet?t.selectionSet.toOperationPathsInternal(i):i})}forEachElement(e){var t;let i=this.selectionsInReverseOrder().concat();for(;i.length>0;){let n=i.pop();e(n.element),null==(t=n.selectionSet)||t.selectionsInReverseOrder().forEach(e=>i.push(e))}}some(e){for(let t of this.selections())if(e(t.element)||t.selectionSet&&t.selectionSet.some(e))return!0;return!1}toOperationString(e,t,i,n,r,a=!1,o=!0){let l=o?"":void 0,u=a||!i||i.isEmpty()?"":i.toString(l)+"\n\n";return"query"==e&&!n&&t.isEmpty()?u+this.toString(a,!0,l):u+e+(n?" "+(n+(t.isEmpty()?"":t.toString())):t.isEmpty()?"":" "+t.toString())+(0,s.directivesToString)(r)+" "+this.toString(a,!0,l)}toString(e=!0,t=!0,i){if(this.isEmpty())return"{}";if(void 0===i){let i=this.selections().map(t=>t.toString(e)).join(" ");return t?"{ "+i+" }":i}{let n=t?i+" ":i,r=this.selections().map(t=>t.toString(e,n)).join("\n");return t?"{\n"+r+"\n"+i+"}":r}}isWorthUsing(){let e=this.selections();if(0===e.length)return!1;if(1===e.length){let t=e[0];return!("FieldSelection"===t.kind&&t.element.isLeafField())}return!0}}i.SelectionSet=b;class N{constructor(){this.keyedUpdates=new c.MultiMap}isEmpty(){return 0===this.keyedUpdates.size}add(e){return _(this.keyedUpdates,e),this}addAtPath(e,t){if(0===e.length)t&&_(this.keyedUpdates,t);else{if(1===e.length&&!t){let t=e[0];if("Field"===t.kind&&t.isLeafField()){let e=L(t);return this.keyedUpdates.add(e.key(),e),this}}this.keyedUpdates.add(e[0].key(),{path:e,selections:t})}return this}clone(){let e=new N;for(let[t,i]of this.keyedUpdates.entries())e.keyedUpdates.set(t,Array.from(i));return e}clear(){this.keyedUpdates.clear()}toSelectionSet(e,t){return function e(t,i,n){let r=new Map;for(let[a,o]of i.entries())r.set(a,function(t,i,n){var r,a,o,l;(0,c.assert)(i.length>0,"Should not be called without any updates");let u=i[0];if(1===i.length&&u instanceof C)return u.rebaseOnOrError({parentType:t,fragments:n});let d=((r=u)instanceof C?r.element:r.path[0]).rebaseOnOrError(t),p="Field"===d.kind?d.baseType():d.castedType();if(!(0,s.isCompositeType)(p))return L(d);let h=new c.MultiMap;for(let e of i){e instanceof C?e.selectionSet&&_(h,e.selectionSet):(a=h,o=p,1===(l=e).path.length?l.selections&&_(a,function e(t,i){if(i instanceof C)return"FragmentSelection"===i.kind&&A(t,i)?e(t,i.selectionSet):i;let n=i instanceof b?i.selections():i,r=[];for(let i of n)if("FragmentSelection"===i.kind&&A(t,i)){let n=e(t,i.selectionSet);if(n instanceof C)r.push(n);else for(let e of n)r.push(e)}else r.push(i);return r}(o,l.selections)):a.add(l.path[1].key(),{path:l.path.slice(1),selections:l.selections}))}return L(d,e(p,h,n))}(t,o,n));return new b(t,r)}(e,this.keyedUpdates,t)}toString(){return"{\n"+[...this.keyedUpdates.entries()].map(([e,t])=>{let i=t.map(e=>e instanceof C?e.toString():`${e.path} -> ${e.selections}`);return` - ${e}: ${i}`}).join("\n")+"\n}"}}function _(e,t){if(t instanceof C)D(e,t);else for(let i of t instanceof b?t.selections():t)D(e,i)}function D(e,t){t instanceof U?e.set(t.key(),[t]):e.add(t.key(),t)}function A(e,t){return 0===t.element.appliedDirectives.length&&(!t.element.typeCondition||(0,u.isSubtype)(function(e,t){if(e.schema()===t)return e;let i=t.type(e.name);return(0,c.assert)(i&&(0,s.isCompositeType)(i),()=>`Expected ${e} to exists and be composite in the rebased schema, but got ${null==i?void 0:i.kind}`),i}(t.element.typeCondition,e.schema()),e))}i.SelectionSetUpdates=N;class O{constructor(e,t,i){this.parentType=e,this._updates=t,this.memoizer=i}static empty(e){return this.emptyWithMemoized(e,()=>({}))}static emptyWithMemoized(e,t){return new O(e,new N,t)}static of(e){return this.ofWithMemoized(e,()=>({}))}static ofWithMemoized(e,t){let i=new O(e.parentType,new N,t);return i._updates.add(e),i.computed=e,i}isEmpty(){return this._updates.isEmpty()}get(){return this.computed||(this.computed=this._updates.toSelectionSet(this.parentType),this._updates.clear(),this._updates.add(this.computed)),this.computed}updates(){return this.computed=void 0,this._memoized=void 0,this._updates}clone(){let e=new O(this.parentType,this._updates.clone(),this.memoizer);return e.computed=this.computed,e._memoized=this._memoized,e}rebaseOn(e){let t=new O(e,new N,this.memoizer);return t._updates.add(this.get()),t}memoized(){return this._memoized||(this._memoized=this.memoizer(this.get())),this._memoized}toString(){return this.get().toString()}}function R(e,t){let i=new Map;return i.set(t.key(),t),new b(e,i)}function w(e,t){return R(e.parentType,L(e,t))}function L(e,t){return"Field"===e.kind?new P(e,t):new M(e,t)}i.MutableSelectionSet=O,i.allFieldDefinitionsInSelectionSet=function(e){let t=Array.from(e.selections()),i=[];for(;t.length>0;){let e=t.pop();"FieldSelection"===e.kind&&i.push(e.element.definition),e.selectionSet&&t.push(...e.selectionSet.selections())}return i},i.selectionSetOf=R,i.selectionSetOfElement=w,i.selectionOfElement=L;class C{constructor(e){this.element=e}rebaseOnOrError({parentType:e,fragments:t}){return this.rebaseOn({parentType:e,fragments:t,errorIfCannotRebase:!0})}get parentType(){return this.element.parentType}isTypenameField(){return!1}collectVariables(e){var t;this.element.collectVariables(e),null==(t=this.selectionSet)||t.collectVariables(e)}collectUsedFragmentNames(e){var t;null==(t=this.selectionSet)||t.collectUsedFragmentNames(e)}withUpdatedSelectionSet(e){return this.withUpdatedComponents(this.element,e)}withUpdatedElement(e){return this.withUpdatedComponents(e,this.selectionSet)}mapToSelectionSet(e){if(!this.selectionSet)return this.us();let t=e(this.selectionSet);return t===this.selectionSet?this.us():this.withUpdatedSelectionSet(t)}isFragmentSpread(){return!1}minus(e){if(this.selectionSet&&e.selectionSet){let t=this.selectionSet.minus(e.selectionSet);if(!t.isEmpty())return this.withUpdatedSelectionSet(t)}}intersectionWith(e){if(!this.selectionSet||!e.selectionSet)return this.us();{let t=this.selectionSet.intersectionWith(e.selectionSet);if(t.isEmpty())return;return this.withUpdatedSelectionSet(t)}}tryOptimizeSubselectionWithFragments({parentType:e,subSelection:t,fragments:i,validator:r,canUseFullMatchingFragment:a}){let s=i.maybeApplyingDirectlyAtType(e);if(0===s.length)return t;let o=[];for(let i of s){let s=i.expandedSelectionSetAtType(e);if(s.selectionSet.isEmpty()||1===s.selectionSet.selections().length&&s.selectionSet.selections()[0].isTypenameField())continue;let l=t.contains(s.selectionSet,{ignoreMissingTypename:!0});if(l===n.EQUAL){if(a(i)){if(!r.checkCanReuseFragmentAndTrackIt(s))continue;return i}0===i.appliedDirectives.length&&o.push({fragment:i,atType:s})}else l===n.STRICTLY_CONTAINED&&0===i.appliedDirectives.length&&o.push({fragment:i,atType:s})}if(0===o.length)return t;let l=o.filter(({fragment:e})=>!o.some(t=>t.fragment.includes(e.name))),u=t,c=new N;for(let{fragment:n,atType:a}of l){if(!r.checkCanReuseFragmentAndTrackIt(a))continue;let s=t.minus(a.selectionSet);u=u.intersectionWith(s),c.add(new U(e,i,n,[]))}return c.add(u).toSelectionSet(e,i)}}class F{constructor(e){this.validators=e}static ofInitial(e){return new F([e])}forField(e){let t=this.validators.flatMap(t=>t.forField(e));return(0,c.assert)(t.length>0,`Shoud have found at least one validator for ${e}`),new F(t)}checkCanReuseFragmentAndTrackIt(e){let t=e.validator;if(!t)return!0;if(!this.validators.every(e=>e.doMergeWith(t)))return!1;if(this.usedSpreadTrimmedPartAtLevel){if(!this.usedSpreadTrimmedPartAtLevel.every(e=>t.doMergeWith(e)))return!1}else this.usedSpreadTrimmedPartAtLevel=[];return this.usedSpreadTrimmedPartAtLevel.push(t),!0}}class k{constructor(e){this.byResponseName=e}static build(e){return k.forLevel(e.fieldsInSet())}static forLevel(e){var t;let i=new Map;for(let{field:n}of e){let e=n.element.responseName(),r=i.get(e);if(r||(r=new Map,i.set(e,r)),n.selectionSet){let e=null!=(t=r.get(n.element))?t:[];r.set(n.element,e.concat(n.selectionSet.fieldsInSet()))}else r.set(n.element,null)}let n=new Map;for(let[e,t]of i.entries()){let i=new Map;for(let[e,n]of t){let t=n?k.forLevel(n):null;i.set(e,t)}n.set(e,i)}return new k(n)}forField(e){let t=this.byResponseName.get(e.responseName());return t?(0,c.mapValues)(t).filter(e=>!!e):[]}doMergeWith(e){var t,i;for(let[n,r]of this.byResponseName.entries()){let a=e.byResponseName.get(n);if(a)for(let[e,n]of r.entries())for(let[r,o]of a.entries()){if(!(0,u.typesCanBeMerged)(e.definition.type,r.definition.type))return!1;let a=e.parentType,l=r.parentType;if(!(0,u.sameType)(a,l)&&(0,s.isObjectType)(a)&&(0,s.isObjectType)(l)){if(n&&o&&!n.hasSameResponseShapeThan(o))return!1}else if(e.name!==r.name||!(0,d.argumentsEquals)(null!=(t=e.args)?t:{},null!=(i=r.args)?i:{})||n&&o&&!n.doMergeWith(o))return!1}}return!0}hasSameResponseShapeThan(e){for(let[t,i]of this.byResponseName.entries()){let n=e.byResponseName.get(t);if(n){for(let[e,t]of i.entries())for(let[i,r]of n.entries())if(!(0,u.typesCanBeMerged)(e.definition.type,i.definition.type)||t&&r&&!t.hasSameResponseShapeThan(r))return!1}}return!0}toString(e=""){return"{\n"+[...this.byResponseName.entries()].map(([t,i])=>{let n=e+" ";return`${n}${t}: [
|
|
18
18
|
`+[...i.entries()].map(([e,t])=>`${n} ${e.parentType}.${e}${t?t.toString(n+" "):""}`).join("\n")+`
|
|
19
19
|
${n}]`}).join("\n")+`
|
|
20
|
-
${e}}`}}class P extends C{constructor(e,t){super(e),this._selectionSet=t,this.kind="FieldSelection"}get selectionSet(){return this._selectionSet}us(){return this}isTypenameField(){return this.element.definition.name===s.typenameFieldName}isPlainTypenameField(){return this.element.definition.name===s.typenameFieldName&&0==this.element.appliedDirectives.length&&!this.element.alias}withAttachment(e,t){let i=this.element.copy();return i.addAttachment(e,t),this.withUpdatedElement(i)}withUpdatedComponents(e,t){return this.element===e&&this.selectionSet===t?this:new P(e,t)}key(){return this.element.key()}optimize(e,t){let i,n=(0,s.baseType)(this.element.definition.type);if(!(0,s.isCompositeType)(n)||!this.selectionSet)return this;let r=t.forField(this.element),a=this.tryOptimizeSubselectionWithFragments({parentType:n,subSelection:this.selectionSet,fragments:e,validator:r,canUseFullMatchingFragment:e=>0===e.appliedDirectives.length});return i=(i=a instanceof S?R(n,new U(n,e,a,[])):a).optimizeSelections(e,r),this.selectionSet===i?this:this.withUpdatedSelectionSet(i)}filterRecursiveDepthFirst(e){if(!this.selectionSet)return e(this)?this:void 0;let t=this.selectionSet.filterRecursiveDepthFirst(e),i=this.selectionSet===t?this:new P(this.element,t);return e(i)?i:void 0}validate(e,t){var i;this.element.validate(e,t),h(this.element.isLeafField()||this.selectionSet&&!this.selectionSet.isEmpty(),()=>`Invalid empty selection set for field "${this.element.definition.coordinate}" of non-leaf type ${this.element.definition.type}`,this.element.definition.sourceAST),null==(i=this.selectionSet)||i.validate(e)}rebaseOn({parentType:e,fragments:t,errorIfCannotRebase:i}){if(this.element.parentType===e)return this;let n=this.element.rebaseOn({parentType:e,errorIfCannotRebase:i});if(!n)return;if(!this.selectionSet)return this.withUpdatedElement(n);let r=n.baseType();if(r===this.selectionSet.parentType)return this.withUpdatedElement(n);h((0,s.isCompositeType)(r),()=>`Cannot rebase field selection ${this} on ${e}: rebased field base return type ${r} is not composite`);let a=this.selectionSet.rebaseOn({parentType:r,fragments:t,errorIfCannotRebase:i});return a.isEmpty()?void 0:this.withUpdatedComponents(n,a)}canAddTo(e){if(this.element.parentType===e)return!0;let t=this.element.typeIfAddedTo(e);if(!t)return!1;let i=(0,s.baseType)(t);return!this.selectionSet||this.selectionSet.parentType===i||((0,c.assert)((0,s.isCompositeType)(i),()=>`${this.element} should have a selection set as it's type is not a composite`),this.selectionSet.selections().every(e=>e.canAddTo(i)))}toSelectionNode(){var e;let t=this.element.alias?{kind:a.Kind.NAME,value:this.element.alias}:void 0;return{kind:a.Kind.FIELD,name:{kind:a.Kind.NAME,value:this.element.name},alias:t,arguments:this.element.argumentsToNodes(),directives:this.element.appliedDirectivesToDirectiveNodes(),selectionSet:null==(e=this.selectionSet)?void 0:e.toSelectionSetNode()}}withoutDefer(e){return this.mapToSelectionSet(t=>t.withoutDefer(e))}withNormalizedDefer(e){return this.mapToSelectionSet(t=>t.withNormalizedDefer(e))}hasDefer(){var e;return!!(null==(e=this.selectionSet)?void 0:e.hasDefer())}normalize({parentType:e,recursive:t}){let i=e===this.parentType?this.element.definition:e.field(this.element.name);(0,c.assert)(i,`Cannot normalize ${this.element} at ${e} which does not have that field`);let n=this.element.definition===i?this.element:this.element.withUpdatedDefinition(i);if(!this.selectionSet)return this.withUpdatedElement(n);let r=n.baseType();(0,c.assert)((0,s.isCompositeType)(r),()=>`Field ${n} should not have a sub-selection`);let a=null==t||t?this.selectionSet.normalize({parentType:r}):this.selectionSet;return(null==a?void 0:a.isEmpty())?this.withUpdatedComponents(n,w(new y(r.typenameField(),void 0,[new s.Directive("include",{if:!1})]))):this.withUpdatedComponents(n,a)}expandFragments(e){return this.mapToSelectionSet(t=>t.expandFragments(e))}equals(e){return this===e||e instanceof P&&!!this.element.equals(e.element)&&(this.selectionSet?!!e.selectionSet&&this.selectionSet.equals(e.selectionSet):!e.selectionSet)}contains(e,t){return e instanceof P&&this.element.equals(e.element)?this.selectionSet?((0,c.assert)(e.selectionSet,"`this` and `that` have the same element, so if one has sub-selection, the other one should too"),this.selectionSet.contains(e.selectionSet,t)):((0,c.assert)(!e.selectionSet,"`this` and `that` have the same element, so if one does not have a sub-selection, neither should the other one"),n.EQUAL):n.NOT_CONTAINED}toString(e=!0,t){return(null!=t?t:"")+this.element+(this.selectionSet?" "+this.selectionSet.toString(e,!0,t):"")}}i.FieldSelection=P;class x extends C{constructor(){super(...arguments),this.kind="FragmentSelection"}us(){return this}validateDeferAndStream(){if(this.element.hasDefer()||this.element.hasStream()){let e=this.element.schema().schemaDefinition,t=this.parentType;h(e.rootType("mutation")!==t&&e.rootType("subscription")!==t,()=>{var i;return`The @defer and @stream directives cannot be used on ${null==(i=e.roots().filter(e=>e.type===t).pop())?void 0:i.rootKind} root type "${t}"`})}}filterRecursiveDepthFirst(e){let t=this.selectionSet.filterRecursiveDepthFirst(e),i=t===this.selectionSet?this:new M(this.element,t);return e(i)?i:void 0}hasDefer(){return this.element.hasDefer()||this.selectionSet.hasDefer()}normalize({parentType:e,recursive:t}){let i=this.element.typeCondition;if(i&&e!==this.parentType){let t=(0,s.possibleRuntimeTypes)(i),n=(0,s.possibleRuntimeTypes)(e);if(!t.some(e=>n.includes(e)))return}return this.normalizeKnowingItIntersects({parentType:e,recursive:t})}}i.FragmentSelection=x;class M extends x{constructor(e,t){super(e),this._selectionSet=t}get selectionSet(){return this._selectionSet}key(){return this.element.key()}withUpdatedComponents(e,t){return e===this.element&&t===this.selectionSet?this:new M(e,t)}validate(e){this.validateDeferAndStream(),h(!this.selectionSet.isEmpty(),()=>`Invalid empty selection set for fragment "${this.element}"`),this.selectionSet.validate(e)}rebaseOn({parentType:e,fragments:t,errorIfCannotRebase:i}){if(this.parentType===e)return this;let n=this.element.rebaseOn({parentType:e,errorIfCannotRebase:i});if(!n)return;let r=n.castedType();if(r===this.selectionSet.parentType)return this.withUpdatedElement(n);let a=this.selectionSet.rebaseOn({parentType:r,fragments:t,errorIfCannotRebase:i});return a.isEmpty()?void 0:this.withUpdatedComponents(n,a)}canAddTo(e){if(this.element.parentType===e)return!0;let t=this.element.castedTypeIfAddedTo(e);return!!t&&(this.selectionSet.parentType===t||this.selectionSet.selections().every(e=>e.canAddTo(t)))}toSelectionNode(){let e=this.element.typeCondition;return{kind:a.Kind.INLINE_FRAGMENT,typeCondition:e?{kind:a.Kind.NAMED_TYPE,name:{kind:a.Kind.NAME,value:e.name}}:void 0,directives:this.element.appliedDirectivesToDirectiveNodes(),selectionSet:this.selectionSet.toSelectionSetNode()}}optimize(e,t){let i=this.selectionSet,n=this.element.typeCondition;if(n){let r=this.tryOptimizeSubselectionWithFragments({parentType:n,subSelection:i,fragments:e,validator:t,canUseFullMatchingFragment:e=>0===e.appliedDirectives.length||(0,u.sameType)(n,e.typeCondition)&&e.appliedDirectives.every(e=>this.element.appliedDirectives.some(t=>(0,s.sameDirectiveApplication)(e,t)))});if(r instanceof S)if((0,u.sameType)(n,r.typeCondition)){let t=this.element.appliedDirectives;return r.appliedDirectives&&(t=t.filter(e=>!r.appliedDirectives.some(t=>(0,s.sameDirectiveApplication)(t,e)))),new U(this.parentType,e,r,t)}else i=R(n,new U(n,e,r,[]));else i=r}return i=i.optimizeSelections(e,t),this.selectionSet===i?this:new M(this.element,i)}withoutDefer(e){let t=this.selectionSet.withoutDefer(e),i=this.element.deferDirectiveArgs(),n=i&&(!e||i.label&&e.has(i.label));if(t===this.selectionSet&&!n)return this;let r=n?this.element.withoutDefer():this.element;return r?this.withUpdatedComponents(r,t):t}withNormalizedDefer(e){let t=this.element.withNormalizedDefer(e),i=this.selectionSet.withNormalizedDefer(e);return t?t===this.element&&i===this.selectionSet?this:this.withUpdatedComponents(t,i):i}normalizeKnowingItIntersects({parentType:e,recursive:t}){var i;let n,r=this.element.typeCondition;if(0===this.element.appliedDirectives.length&&(!r||e===this.element.typeCondition||(0,s.isObjectType)(e))){let i=this.selectionSet.normalize({parentType:e,recursive:t});return i.isEmpty()?void 0:i}if(null==t||t){if((n=this.selectionSet.normalize({parentType:null!=r?r:e})).isEmpty())if(0===this.element.appliedDirectives.length)return;else return this.withUpdatedComponents(this.element.rebaseOnOrError(e),w(new y((null!=(i=this.element.typeCondition)?i:e).typenameField(),void 0,[new s.Directive("include",{if:!1})])))}else n=this.selectionSet;if(0===this.element.appliedDirectives.length&&(0,s.isAbstractType)(r)){(0,c.assert)(!(0,s.isObjectType)(e),()=>`Should not have got here if ${e} is an object type`);let t=(0,s.possibleRuntimeTypes)(e),i=[];for(let e of n.selections())"FragmentSelection"===e.kind&&e.element.typeCondition&&(0,s.isObjectType)(e.element.typeCondition)&&t.includes(e.element.typeCondition)&&i.push(e);if(i.length===n.selections().length)return n;if(i.length>0){let t=new N;return t.add(i),t.add(this.withUpdatedSelectionSet(n.filter(e=>!i.includes(e)))),t.toSelectionSet(e)}}return this.parentType===e&&this.selectionSet===n?this:this.withUpdatedComponents(this.element.rebaseOnOrError(e),n)}expandFragments(e){return this.mapToSelectionSet(t=>t.expandFragments(e))}equals(e){return this===e||e instanceof x&&this.element.equals(e.element)&&this.selectionSet.equals(e.selectionSet)}contains(e,t){return e instanceof x&&this.element.equals(e.element)?this.selectionSet.contains(e.selectionSet,t):n.NOT_CONTAINED}toString(e=!0,t){return(null!=t?t:"")+this.element+" "+this.selectionSet.toString(e,!0,t)}}class U extends x{constructor(e,t,i,n){super(new v(e,i.typeCondition,i.appliedDirectives.concat(n))),this.fragments=t,this.namedFragment=i,this.spreadDirectives=n}isFragmentSpread(){return!0}get selectionSet(){return this.namedFragment.selectionSet}key(){return this.computedKey||(this.computedKey="..."+this.namedFragment.name+(0,s.directivesToString)(this.spreadDirectives)),this.computedKey}withUpdatedComponents(e,t){(0,c.assert)(!1,"Unsupported")}normalizeKnowingItIntersects({parentType:e}){return(0,c.assert)(e.schema()===this.parentType.schema(),"Should not try to normalize using a type from another schema"),this.rebaseOnOrError({parentType:e,fragments:this.fragments})}validate(){this.validateDeferAndStream(),h((0,s.runtimeTypesIntersects)(this.parentType,this.namedFragment.typeCondition),()=>`Fragment "${this.namedFragment.name}" cannot be spread inside type ${this.parentType} as the runtime types do not intersect ${this.namedFragment.typeCondition}`)}toSelectionNode(){let e=(0,s.directivesToDirectiveNodes)(this.spreadDirectives);return{kind:a.Kind.FRAGMENT_SPREAD,name:{kind:a.Kind.NAME,value:this.namedFragment.name},directives:e}}optimize(e,t){return this}rebaseOn({parentType:e,fragments:t,errorIfCannotRebase:i}){if(this.parentType===e)return this;let n=this.parentType.schema()===e.schema();(0,c.assert)(t||n,"Must provide fragments is rebasing on other schema");let r=null!=t?t:this.fragments,a=r.get(this.namedFragment.name);if(!a)return void h(!i,()=>`Cannot rebase ${this.toString(!1)} if it isn't part of the provided fragments`);if(!n&&!(0,s.runtimeTypesIntersects)(e,a.typeCondition)){let n=this.namedFragment.selectionSet.rebaseOn({parentType:e,fragments:t,errorIfCannotRebase:i});return n.isEmpty()?void 0:new M(new v(e),n)}return new U(e,r,a,this.spreadDirectives)}canAddTo(e){return!0}expandFragments(e){if(null==e?void 0:e.has(this.namedFragment.name))return this;let t=this.selectionSet.expandFragments(e);return(0,u.sameType)(this.parentType,this.namedFragment.typeCondition)&&0===this.element.appliedDirectives.length?t.selections():new M(this.element,t)}collectUsedFragmentNames(e){let t=e.get(this.namedFragment.name);e.set(this.namedFragment.name,void 0===t?1:t+1)}withoutDefer(e){(0,c.assert)(!1,"Unsupported, see `Operation.withAllDeferLabelled`")}withNormalizedDefer(e){(0,c.assert)(!1,"Unsupported, see `Operation.withAllDeferLabelled`")}minus(e){(0,c.assert)(this.equals(e),()=>`Invalid operation for ${this.toString(!1)} and ${e.toString(!1)}`)}equals(e){return this===e||e instanceof U&&this.namedFragment.name===e.namedFragment.name&&(0,s.sameDirectiveApplications)(this.spreadDirectives,e.spreadDirectives)}contains(e,t){return this.equals(e)?n.EQUAL:e instanceof x&&this.element.equals(e.element)?this.selectionSet.contains(e.selectionSet,t):n.NOT_CONTAINED}toString(e=!0,t){return e?(null!=t?t:"")+this.element+" "+this.selectionSet.toString(!0,!0,t):(null!=t?t:"")+"..."+this.namedFragment.name+(0,s.directivesToString)(this.spreadDirectives)}}function $(e,t,i,n,r=(e,t)=>e.field(t)){if(1===t.selections.length)return R(e,V(e,t.selections[0],i,n,r));let a=new N;for(let s of t.selections)a.add(V(e,s,i,n,r));return a.toSelectionSet(e,n)}function j(e,t){var i;return null!=(i=null==t?void 0:t.map(t=>{let i;return h(i=e.directive(t.name.value),()=>`Unknown directive "@${t.name.value}"`),new s.Directive(i.name,(0,d.argumentsFromAST)(i.coordinate,t.arguments,i))}))?i:[]}function V(e,t,i,n,r=(e,t)=>e.field(t)){var o,l;let u,c=j(e.schema(),t.directives);switch(t.kind){case a.Kind.FIELD:let p=r(e,t.name.value);h(p,()=>`Cannot query field "${t.name.value}" on type "${e}".`,e.sourceAST);let f=(0,s.baseType)(p.type),m=t.selectionSet?$(f,t.selectionSet,i,n,r):void 0;u=new P(new y(p,(0,d.argumentsFromAST)(p.coordinate,t.arguments,p),c,null==(o=t.alias)?void 0:o.value),m);break;case a.Kind.INLINE_FRAGMENT:let g=new v(e,null==(l=t.typeCondition)?void 0:l.name.value,c);u=new M(g,$(g.typeCondition?g.typeCondition:g.parentType,t.selectionSet,i,n,r));break;case a.Kind.FRAGMENT_SPREAD:let T=t.name.value;h(n,()=>`Cannot find fragment name "${T}" (no fragments were provided)`);let S=n.get(T);h(S,()=>`Cannot find fragment name "${T}" (provided fragments are: [${n.names().join(", ")}])`),u=new U(e,n,S,c)}return u}function G(e,t,i){let n,r,o=null==i?void 0:i.operationName,u=new E;t.definitions.forEach(t=>{switch(t.kind){case a.Kind.OPERATION_DEFINITION:h(!n||o,()=>"Must provide operation name if query contains multiple operations."),(!o||t.name&&t.name.value===o)&&(n=t,r=j(e,t.directives));break;case a.Kind.FRAGMENT_DEFINITION:let i=t.name.value,c=t.typeCondition.name.value,d=e.type(c);if(!d)throw l.ERRORS.INVALID_GRAPHQL.err(`Unknown type "${c}" for fragment "${i}"`,{nodes:t});if(!(0,s.isCompositeType)(d))throw l.ERRORS.INVALID_GRAPHQL.err(`Invalid fragment "${i}" on non-composite type "${c}"`,{nodes:t});u.add(new S(e,i,d,j(e,t.directives)))}}),h(n,()=>o?`Unknown operation named "${o}"`:"No operation found in provided document.");let c=n.variableDefinitions?(0,s.variableDefinitionsFromAST)(e,n.variableDefinitions):new s.VariableDefinitions;return t.definitions.forEach(e=>{if(e.kind===a.Kind.FRAGMENT_DEFINITION){let t=u.get(e.name.value);t.setSelectionSet($(t.typeCondition,e.selectionSet,c,u))}}),u.validate(c),function({schema:e,operation:t,operation_directives:i,variableDefinitions:n,fragments:r,validateInput:a}){var s;let o=e.schemaDefinition.root(t.operation);h(o,()=>`The schema has no "${t.operation}" root type defined`);let l=r.isEmpty()?void 0:r;return new T(e,t.operation,B({parentType:o.type,source:t.selectionSet,variableDefinitions:n,fragments:l,validate:a}),n,l,null==(s=t.name)?void 0:s.value,i)}({schema:e,operation:n,operation_directives:r,variableDefinitions:c,fragments:u,validateInput:null==i?void 0:i.validate})}function B({parentType:e,source:t,variableDefinitions:i=new s.VariableDefinitions,fragments:n,fieldAccessor:r,validate:a=!0}){let o=$(e,"string"==typeof t?K(t.trim().startsWith("{")?t:`{${t}}`).selectionSet:t,null!=i?i:new s.VariableDefinitions,n,r);return a&&o.validate(i),o}function K(e){let t=(0,a.parse)(e);h(1===t.definitions.length,()=>"Selections should contain a single definitions, found "+t.definitions.length);let i=t.definitions[0];return h(i.kind===a.Kind.OPERATION_DEFINITION,()=>"Expected an operation definition but got a "+i.kind),i}i.FragmentSpreadSelection=U,i.operationFromDocument=G,i.parseOperation=function(e,t,i){return G(e,(0,a.parse)(t),i)},i.parseSelectionSet=B,i.parseOperationAST=K,i.operationToDocument=function(e){var t;let i={kind:a.Kind.OPERATION_DEFINITION,operation:e.rootKind,name:e.name?{kind:a.Kind.NAME,value:e.name}:void 0,selectionSet:e.selectionSet.toSelectionSetNode(),variableDefinitions:e.variableDefinitions.toVariableDefinitionNodes(),directives:(0,s.directivesToDirectiveNodes)(e.appliedDirectives)},n=e.fragments?null==(t=e.fragments)?void 0:t.toFragmentDefinitionNodes():[];return{kind:a.Kind.DOCUMENT,definitions:[i].concat(n)}},i.hasSelectionWithPredicate=function e(t,i){for(let n of t.selections())if(i(n)||n.selectionSet&&e(n.selectionSet,i))return!0;return!1}},263554,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.computeShareables=void 0;let n=e.r(378422);i.computeShareables=function(e){let t=(0,n.federationMetadata)(e);(0,n.assert)(t,"Schema should be a federation subgraph");let i=t.keyDirective(),r=t.providesDirective(),a=t.isFed2Schema()?t.shareableDirective():void 0,s=new Set,o=e=>{for(let t of e.appliedDirectivesOf(i))(0,n.collectTargetFields)({parentType:e,directive:t,includeInterfaceFieldsImplementations:!0,validate:!1}).forEach(e=>s.add(e.coordinate))};for(let i of e.objectTypes()){o(i);let e=a?i.appliedDirectivesOf(a):[];for(let o of i.fields())for(let i of((a&&o.hasAppliedDirective(a)||e.length>0&&e.some(e=>o.ofExtension()===e.ofExtension()))&&s.add(o.coordinate),o.appliedDirectivesOf(r))){let e=(0,n.baseType)(o.type);(0,n.isCompositeType)(e)&&(0,n.collectTargetFields)({parentType:e,directive:i,includeInterfaceFieldsImplementations:!0,validate:!1}).forEach(e=>{t.isFieldExternal(e)&&s.add(e.coordinate)})}}for(let t of e.interfaceTypes())o(t);return e=>s.has(e.coordinate)}},255604,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.AUTHENTICATED_VERSIONS=i.AuthenticatedSpecDefinition=void 0;let n=e.r(186846),r=e.r(785576),a=e.r(343924),s=e.r(319894);class o extends r.FeatureDefinition{constructor(e,t){super(new r.FeatureUrl(o.identity,o.directiveName,e),t),this.registerDirective((0,a.createDirectiveSpecification)({name:o.directiveName,locations:[n.DirectiveLocation.FIELD_DEFINITION,n.DirectiveLocation.OBJECT,n.DirectiveLocation.INTERFACE,n.DirectiveLocation.SCALAR,n.DirectiveLocation.ENUM],composes:!0,supergraphSpecification:()=>i.AUTHENTICATED_VERSIONS.latest()}))}authenticatedDirective(e){return this.directive(e,o.directiveName)}get defaultCorePurpose(){return"SECURITY"}}i.AuthenticatedSpecDefinition=o,o.directiveName="authenticated",o.identity=`https://specs.apollo.dev/${o.directiveName}`,i.AUTHENTICATED_VERSIONS=new r.FeatureDefinitions(o.identity).add(new o(new r.FeatureVersion(0,1),new r.FeatureVersion(2,5))),(0,s.registerKnownFeature)(i.AUTHENTICATED_VERSIONS)},253636,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.ARGUMENT_COMPOSITION_STRATEGIES=i.convertEmptyToTrue=i.dnfConjunction=void 0;let n=e.r(168032),r=e.r(678270),a=e.r(367356);function s(e){return(t,i)=>{let n=e(t);return n.some(e=>(0,r.sameType)(e,i))?{valid:!0}:{valid:!1,supportedMsg:`type(s) ${n.join(", ")}`}}}function o(){return(e,t)=>(0,n.isNonNullType)(t)&&(0,n.isListType)(t.ofType)?{valid:!0}:{valid:!1,supportedMsg:"non nullable list types of any type"}}function l(e){return t=>{let i=t.filter(e=>null!=e);return i.length>0?e(i):void 0}}function u(e){return e.reduce((e,t)=>{let i=t.filter(t=>!e.some(e=>(0,a.valueEquals)(t,e)));return e.concat(i)},[])}function c(e){var t;let i,n;if(0==e.length)return[];for(let t=0;t<e.length;t++)e[t]=d(function(e){let t=Array(e.length);for(let i=0;i<e.length;i++)t[i]=e[i].slice();return t}(e[t]));let r=(t=e,i=[],n=new Set,t.forEach(e=>{e.forEach(e=>{e.sort()}),e.sort((e,t)=>{let i=JSON.stringify(e),n=JSON.stringify(t);return i>n?1:i<n?-1:0});let t=JSON.stringify(e);n.has(t)||(n.add(t),i.push(e))}),i),a=r[0];for(let e=1;e<r.length;e++){let t=r[e],i=[],n=new Set;for(let e of a)for(let r of t){let t=r.filter(t=>!e.includes(t)),a=[...e,...t].sort(),s=JSON.stringify(a);n.has(s)||(n.add(s),i.push(a))}a=function(e){let t=[];for(let i of(e.sort((e,t)=>e.length<t.length?-1:+(e.length>t.length)),e)){let e=new Set(i),n=!1;for(let i of t)if(i.every(t=>e.has(t))){n=!0;break}n||t.push(i)}return t}(i)}return a}function d(e){return 0===e.length?[[]]:e}i.dnfConjunction=c,i.convertEmptyToTrue=d,i.ARGUMENT_COMPOSITION_STRATEGIES={MAX:{name:"MAX",isTypeSupported:s(e=>[new n.NonNullType(e.intType())]),mergeValues:e=>Math.max(...e)},MIN:{name:"MIN",isTypeSupported:s(e=>[new n.NonNullType(e.intType())]),mergeValues:e=>Math.min(...e)},INTERSECTION:{name:"INTERSECTION",isTypeSupported:o(),mergeValues:e=>{var t;return null!=(t=e.reduce((e,t)=>void 0===e?t:e.filter(e=>t.some(t=>(0,a.valueEquals)(e,t))),void 0))?t:[]}},UNION:{name:"UNION",isTypeSupported:o(),mergeValues:u},NULLABLE_AND:{name:"NULLABLE_AND",isTypeSupported:s(e=>[e.booleanType(),new n.NonNullType(e.booleanType())]),mergeValues:l(e=>e.every(e=>e))},NULLABLE_MAX:{name:"NULLABLE_MAX",isTypeSupported:s(e=>[e.intType(),new n.NonNullType(e.intType())]),mergeValues:l(e=>Math.max(...e))},NULLABLE_UNION:{name:"NULLABLE_UNION",isTypeSupported:(e,t)=>(0,n.isListType)(t)||(0,n.isNonNullType)(t)&&(0,n.isListType)(t.ofType)?{valid:!0}:{valid:!1,supportedMsg:"list types of any type"},mergeValues:l(u)},DNF_CONJUNCTION:{name:"DNF_CONJUNCTION",isTypeSupported:(e,t)=>(0,n.isNonNullType)(t)&&(0,n.isListType)(t.ofType)&&(0,n.isNonNullType)(t.ofType.ofType)&&(0,n.isListType)(t.ofType.ofType.ofType)?{valid:!0}:{valid:!1,supportedMsg:"non nullable nested list types of any type"},mergeValues:c}}},484469,(e,t,i)=>{"use strict";var n;Object.defineProperty(i,"__esModule",{value:!0}),i.REQUIRES_SCOPES_VERSIONS=i.RequiresScopesSpecDefinition=i.RequiresScopesTypeName=void 0;let r=e.r(186846),a=e.r(785576),s=e.r(168032),o=e.r(343924),l=e.r(319894),u=e.r(253636),c=e.r(331484);(n||(i.RequiresScopesTypeName=n={})).SCOPE="Scope";class d extends a.FeatureDefinition{constructor(e){super(new a.FeatureUrl(d.identity,d.directiveName,e)),this.registerType((0,o.createScalarTypeSpecification)({name:n.SCOPE})),this.registerDirective((0,o.createDirectiveSpecification)({name:d.directiveName,args:[{name:"scopes",type:(e,t)=>{(0,c.assert)(t,"Shouldn't be added without being attached to a @link spec");let i=t.typeNameInSchema(n.SCOPE),r=e.type(i);return(0,c.assert)(r,()=>`Expected "${i}" to be defined`),new s.NonNullType(new s.ListType(new s.NonNullType(new s.ListType(new s.NonNullType(r)))))},compositionStrategy:u.ARGUMENT_COMPOSITION_STRATEGIES.DNF_CONJUNCTION}],locations:[r.DirectiveLocation.FIELD_DEFINITION,r.DirectiveLocation.OBJECT,r.DirectiveLocation.INTERFACE,r.DirectiveLocation.SCALAR,r.DirectiveLocation.ENUM],composes:!0,supergraphSpecification:()=>i.REQUIRES_SCOPES_VERSIONS.latest()}))}requiresScopesDirective(e){return this.directive(e,d.directiveName)}get defaultCorePurpose(){return"SECURITY"}}i.RequiresScopesSpecDefinition=d,d.directiveName="requiresScopes",d.identity=`https://specs.apollo.dev/${d.directiveName}`,i.REQUIRES_SCOPES_VERSIONS=new a.FeatureDefinitions(d.identity).add(new d(new a.FeatureVersion(0,1))),(0,l.registerKnownFeature)(i.REQUIRES_SCOPES_VERSIONS)},569186,(e,t,i)=>{"use strict";var n;Object.defineProperty(i,"__esModule",{value:!0}),i.POLICY_VERSIONS=i.PolicySpecDefinition=i.PolicyTypeName=void 0;let r=e.r(186846),a=e.r(785576),s=e.r(168032),o=e.r(343924),l=e.r(319894),u=e.r(253636),c=e.r(331484);(n||(i.PolicyTypeName=n={})).POLICY="Policy";class d extends a.FeatureDefinition{constructor(e){super(new a.FeatureUrl(d.identity,d.directiveName,e)),this.registerType((0,o.createScalarTypeSpecification)({name:n.POLICY})),this.registerDirective((0,o.createDirectiveSpecification)({name:d.directiveName,args:[{name:"policies",type:(e,t)=>{(0,c.assert)(t,"Shouldn't be added without being attached to a @link spec");let i=t.typeNameInSchema(n.POLICY),r=e.type(i);return(0,c.assert)(r,()=>`Expected "${i}" to be defined`),new s.NonNullType(new s.ListType(new s.NonNullType(new s.ListType(new s.NonNullType(r)))))},compositionStrategy:u.ARGUMENT_COMPOSITION_STRATEGIES.DNF_CONJUNCTION}],locations:[r.DirectiveLocation.FIELD_DEFINITION,r.DirectiveLocation.OBJECT,r.DirectiveLocation.INTERFACE,r.DirectiveLocation.SCALAR,r.DirectiveLocation.ENUM],composes:!0,supergraphSpecification:()=>i.POLICY_VERSIONS.latest()}))}policyDirective(e){return this.directive(e,d.directiveName)}get defaultCorePurpose(){return"SECURITY"}}i.PolicySpecDefinition=d,d.directiveName="policy",d.identity=`https://specs.apollo.dev/${d.directiveName}`,i.POLICY_VERSIONS=new a.FeatureDefinitions(d.identity).add(new d(new a.FeatureVersion(0,1))),(0,l.registerKnownFeature)(i.POLICY_VERSIONS)},994926,(e,t,i)=>{"use strict";var n,r;Object.defineProperty(i,"__esModule",{value:!0}),i.CONTEXT_VERSIONS=i.ContextSpecDefinition=i.ContextDirectiveName=void 0;let a=e.r(186846),s=e.r(785576),o=e.r(168032),l=e.r(343924),u=e.r(319894),c=e.r(331484);(r=n||(i.ContextDirectiveName=n={})).CONTEXT="context",r.FROM_CONTEXT="fromContext";let d="ContextFieldValue";class p extends s.FeatureDefinition{constructor(e){super(new s.FeatureUrl(p.identity,p.directiveName,e)),this.registerType((0,l.createScalarTypeSpecification)({name:d})),this.contextDirectiveSpec=(0,l.createDirectiveSpecification)({name:n.CONTEXT,locations:[a.DirectiveLocation.INTERFACE,a.DirectiveLocation.OBJECT,a.DirectiveLocation.UNION],args:[{name:"name",type:e=>new o.NonNullType(e.stringType())}],composes:!0,repeatable:!0,supergraphSpecification:e=>i.CONTEXT_VERSIONS.getMinimumRequiredVersion(e),staticArgumentTransform:(e,t)=>{let i=e.name;return{name:`${i}__${t.name}`}}}),this.fromContextDirectiveSpec=(0,l.createDirectiveSpecification)({name:n.FROM_CONTEXT,locations:[a.DirectiveLocation.ARGUMENT_DEFINITION],args:[{name:"field",type:(e,t)=>{(0,c.assert)(t,"Shouldn't be added without being attached to a @link spec");let i=t.typeNameInSchema(d),n=e.type(i);return(0,c.assert)(n,()=>`Expected "${i}" to be defined`),(0,c.assert)((0,o.isInputType)(n),`Expected "${i}" to be an input type`),n}}],composes:!1}),this.registerDirective(this.contextDirectiveSpec),this.registerDirective(this.fromContextDirectiveSpec)}get defaultCorePurpose(){return"SECURITY"}contextDirective(e){return this.directive(e,p.directiveName)}}i.ContextSpecDefinition=p,p.directiveName="context",p.identity=`https://specs.apollo.dev/${p.directiveName}`,i.CONTEXT_VERSIONS=new s.FeatureDefinitions(p.identity).add(new p(new s.FeatureVersion(0,1))),(0,u.registerKnownFeature)(i.CONTEXT_VERSIONS)},579034,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.COST_VERSIONS=i.CostSpecDefinition=i.costIdentity=void 0;let n=e.r(186846),r=e.r(343924),a=e.r(785576),s=e.r(168032),o=e.r(319894),l=e.r(253636);i.costIdentity="https://specs.apollo.dev/cost";class u extends a.FeatureDefinition{constructor(e,t){super(new a.FeatureUrl(i.costIdentity,"cost",e),t),this.minimumFederationVersion=t,this.registerDirective((0,r.createDirectiveSpecification)({name:"cost",locations:[n.DirectiveLocation.ARGUMENT_DEFINITION,n.DirectiveLocation.ENUM,n.DirectiveLocation.FIELD_DEFINITION,n.DirectiveLocation.INPUT_FIELD_DEFINITION,n.DirectiveLocation.OBJECT,n.DirectiveLocation.SCALAR],args:[{name:"weight",type:e=>new s.NonNullType(e.intType()),compositionStrategy:l.ARGUMENT_COMPOSITION_STRATEGIES.MAX}],composes:!0,repeatable:!1,supergraphSpecification:e=>i.COST_VERSIONS.getMinimumRequiredVersion(e)})),this.registerDirective((0,r.createDirectiveSpecification)({name:"listSize",locations:[n.DirectiveLocation.FIELD_DEFINITION],args:[{name:"assumedSize",type:e=>e.intType(),compositionStrategy:l.ARGUMENT_COMPOSITION_STRATEGIES.NULLABLE_MAX},{name:"slicingArguments",type:e=>new s.ListType(new s.NonNullType(e.stringType())),compositionStrategy:l.ARGUMENT_COMPOSITION_STRATEGIES.NULLABLE_UNION},{name:"sizedFields",type:e=>new s.ListType(new s.NonNullType(e.stringType())),compositionStrategy:l.ARGUMENT_COMPOSITION_STRATEGIES.NULLABLE_UNION},{name:"requireOneSlicingArgument",type:e=>e.booleanType(),defaultValue:!0,compositionStrategy:l.ARGUMENT_COMPOSITION_STRATEGIES.NULLABLE_AND}],composes:!0,repeatable:!1,supergraphSpecification:e=>i.COST_VERSIONS.getMinimumRequiredVersion(e)}))}costDirective(e){return this.directive(e,"cost")}listSizeDirective(e){return this.directive(e,"listSize")}}i.CostSpecDefinition=u,i.COST_VERSIONS=new a.FeatureDefinitions(i.costIdentity).add(new u(new a.FeatureVersion(0,1),new a.FeatureVersion(2,9))),(0,o.registerKnownFeature)(i.COST_VERSIONS)},379166,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.CACHE_TAG_VERSIONS=i.CacheTagSpecDefinition=i.CACHE_TAG=void 0;let n=e.r(785576);i.CACHE_TAG="cacheTag";class r extends n.FeatureDefinition{constructor(e,t){super(new n.FeatureUrl(r.identity,r.specName,e),t)}get defaultCorePurpose(){return"EXECUTION"}}i.CacheTagSpecDefinition=r,r.specName=i.CACHE_TAG,r.identity=`https://specs.apollo.dev/${r.specName}`,i.CACHE_TAG_VERSIONS=new n.FeatureDefinitions(r.identity).add(new r(new n.FeatureVersion(0,1)))},479209,(e,t,i)=>{"use strict";var n,r,a,s;Object.defineProperty(i,"__esModule",{value:!0}),i.FEDERATION_VERSIONS=i.FederationSpecDefinition=i.FEDERATION1_DIRECTIVES=i.FEDERATION1_TYPES=i.FederationDirectiveName=i.FederationTypeName=i.federationIdentity=void 0;let o=e.r(168032),l=e.r(785576),u=e.r(343924),c=e.r(186846),d=e.r(331484),p=e.r(193151),h=e.r(951071),f=e.r(319894),m=e.r(355415),y=e.r(255604),v=e.r(484469),g=e.r(569186),T=e.r(994926),S=e.r(579034),E=e.r(379166);i.federationIdentity="https://specs.apollo.dev/federation",(a=n||(i.FederationTypeName=n={})).FIELD_SET="FieldSet",a.CONTEXT_FIELD_VALUE="ContextFieldValue",(s=r||(i.FederationDirectiveName=r={})).KEY="key",s.EXTERNAL="external",s.REQUIRES="requires",s.PROVIDES="provides",s.EXTENDS="extends",s.SHAREABLE="shareable",s.OVERRIDE="override",s.TAG="tag",s.INACCESSIBLE="inaccessible",s.COMPOSE_DIRECTIVE="composeDirective",s.INTERFACE_OBJECT="interfaceObject",s.AUTHENTICATED="authenticated",s.REQUIRES_SCOPES="requiresScopes",s.POLICY="policy",s.CONTEXT="context",s.FROM_CONTEXT="fromContext",s.COST="cost",s.LIST_SIZE="listSize",s.CACHE_TAG="cacheTag";let I=(0,u.createScalarTypeSpecification)({name:n.FIELD_SET}),b={name:"fields",type:e=>{var t;let i;return t=e,i=(0,h.federationMetadata)(t),(0,d.assert)(i,"The schema is not a federation subgraph"),new o.NonNullType(i.fieldSetType())}},N=(0,u.createDirectiveSpecification)({name:r.KEY,locations:[c.DirectiveLocation.OBJECT,c.DirectiveLocation.INTERFACE],repeatable:!0,args:[b,{name:"resolvable",type:e=>e.booleanType(),defaultValue:!0}]}),_=(0,u.createDirectiveSpecification)({name:r.EXTENDS,locations:[c.DirectiveLocation.OBJECT,c.DirectiveLocation.INTERFACE]}),D=(0,u.createDirectiveSpecification)({name:r.EXTERNAL,locations:[c.DirectiveLocation.OBJECT,c.DirectiveLocation.FIELD_DEFINITION],args:[{name:"reason",type:e=>e.stringType()}]}),A=(0,u.createDirectiveSpecification)({name:r.REQUIRES,locations:[c.DirectiveLocation.FIELD_DEFINITION],args:[b]}),O=(0,u.createDirectiveSpecification)({name:r.PROVIDES,locations:[c.DirectiveLocation.FIELD_DEFINITION],args:[b]}),R=[I],w=[N,A,O,D,p.TAG_VERSIONS.find(new l.FeatureVersion(0,2)).tagDirectiveSpec,_];i.FEDERATION1_TYPES=R,i.FEDERATION1_DIRECTIVES=w;class L extends l.FeatureDefinition{constructor(e){for(const t of(super(new l.FeatureUrl(i.federationIdentity,"federation",e)),R))this.registerType(t);for(const e of w)this.registerDirective(e);this.registerDirective((0,u.createDirectiveSpecification)({name:r.SHAREABLE,locations:[c.DirectiveLocation.OBJECT,c.DirectiveLocation.FIELD_DEFINITION],repeatable:e.gte(new l.FeatureVersion(2,2))})),this.registerSubFeature(m.INACCESSIBLE_VERSIONS.getMinimumRequiredVersion(e)),e.gte(new l.FeatureVersion(2,7))?this.registerDirective((0,u.createDirectiveSpecification)({name:r.OVERRIDE,locations:[c.DirectiveLocation.FIELD_DEFINITION],args:[{name:"from",type:e=>new o.NonNullType(e.stringType())},{name:"label",type:e=>e.stringType()}]})):this.registerDirective((0,u.createDirectiveSpecification)({name:r.OVERRIDE,locations:[c.DirectiveLocation.FIELD_DEFINITION],args:[{name:"from",type:e=>new o.NonNullType(e.stringType())}]})),e.gte(new l.FeatureVersion(2,1))&&this.registerDirective((0,u.createDirectiveSpecification)({name:r.COMPOSE_DIRECTIVE,locations:[c.DirectiveLocation.SCHEMA],repeatable:!0,args:[{name:"name",type:e=>e.stringType()}]})),e.gte(new l.FeatureVersion(2,3))&&(this.registerDirective((0,u.createDirectiveSpecification)({name:r.INTERFACE_OBJECT,locations:[c.DirectiveLocation.OBJECT]})),this.registerSubFeature(p.TAG_VERSIONS.find(new l.FeatureVersion(0,3)))),e.gte(new l.FeatureVersion(2,5))&&(this.registerSubFeature(y.AUTHENTICATED_VERSIONS.find(new l.FeatureVersion(0,1))),this.registerSubFeature(v.REQUIRES_SCOPES_VERSIONS.find(new l.FeatureVersion(0,1)))),e.gte(new l.FeatureVersion(2,6))&&this.registerSubFeature(g.POLICY_VERSIONS.find(new l.FeatureVersion(0,1))),e.gte(new l.FeatureVersion(2,8))&&this.registerSubFeature(T.CONTEXT_VERSIONS.find(new l.FeatureVersion(0,1))),e.gte(new l.FeatureVersion(2,9))&&this.registerSubFeature(S.COST_VERSIONS.find(new l.FeatureVersion(0,1))),e.gte(new l.FeatureVersion(2,12))&&this.registerDirective((0,u.createDirectiveSpecification)({name:r.CACHE_TAG,locations:[c.DirectiveLocation.OBJECT,c.DirectiveLocation.FIELD_DEFINITION],repeatable:!0,args:[{name:"format",type:e=>new o.NonNullType(e.stringType())}],composes:!0,supergraphSpecification:e=>E.CACHE_TAG_VERSIONS.getMinimumRequiredVersion(e),useJoinDirective:!0}))}}i.FederationSpecDefinition=L,i.FEDERATION_VERSIONS=new l.FeatureDefinitions(i.federationIdentity).add(new L(new l.FeatureVersion(2,0))).add(new L(new l.FeatureVersion(2,1))).add(new L(new l.FeatureVersion(2,2))).add(new L(new l.FeatureVersion(2,3))).add(new L(new l.FeatureVersion(2,4))).add(new L(new l.FeatureVersion(2,5))).add(new L(new l.FeatureVersion(2,6))).add(new L(new l.FeatureVersion(2,7))).add(new L(new l.FeatureVersion(2,8))).add(new L(new l.FeatureVersion(2,9))).add(new L(new l.FeatureVersion(2,10))).add(new L(new l.FeatureVersion(2,11))).add(new L(new l.FeatureVersion(2,12))).add(new L(new l.FeatureVersion(2,13))).add(new L(new l.FeatureVersion(2,14))),(0,f.registerKnownFeature)(i.FEDERATION_VERSIONS)},63672,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.JOIN_VERSIONS=i.JoinSpecDefinition=i.joinIdentity=void 0;let n=e.r(186846),r=e.r(785576),a=e.r(168032),s=e.r(319894),o=e.r(331484);i.joinIdentity="https://specs.apollo.dev/join";class l extends r.FeatureDefinition{constructor(e,t){super(new r.FeatureUrl(i.joinIdentity,"join",e),t)}isV01(){return this.version.equals(new r.FeatureVersion(0,1))}addElementsToSchema(e){let t=this.addDirective(e,"graph").addLocations(n.DirectiveLocation.ENUM_VALUE);t.addArgument("name",new a.NonNullType(e.stringType())),t.addArgument("url",new a.NonNullType(e.stringType()));let i=this.addEnumType(e,"Graph"),s=this.addScalarType(e,"FieldSet"),o=this.addDirective(e,"type").addLocations(n.DirectiveLocation.OBJECT,n.DirectiveLocation.INTERFACE,n.DirectiveLocation.UNION,n.DirectiveLocation.ENUM,n.DirectiveLocation.INPUT_OBJECT,n.DirectiveLocation.SCALAR);this.isV01()||(o.repeatable=!0),o.addArgument("graph",new a.NonNullType(i)),o.addArgument("key",s),!this.isV01()&&(o.addArgument("extension",new a.NonNullType(e.booleanType()),!1),o.addArgument("resolvable",new a.NonNullType(e.booleanType()),!0),this.version.gte(new r.FeatureVersion(0,3))&&o.addArgument("isInterfaceObject",new a.NonNullType(e.booleanType()),!1));let l=this.addDirective(e,"field").addLocations(n.DirectiveLocation.FIELD_DEFINITION,n.DirectiveLocation.INPUT_FIELD_DEFINITION);l.repeatable=!0;let u=this.version.gte(new r.FeatureVersion(0,3))?i:new a.NonNullType(i);if(l.addArgument("graph",u),l.addArgument("requires",s),l.addArgument("provides",s),this.isV01()||(l.addArgument("type",e.stringType()),l.addArgument("external",e.booleanType()),l.addArgument("override",e.stringType()),l.addArgument("usedOverridden",e.booleanType())),!this.isV01()){let t=this.addDirective(e,"implements").addLocations(n.DirectiveLocation.OBJECT,n.DirectiveLocation.INTERFACE);t.repeatable=!0,t.addArgument("graph",new a.NonNullType(i)),t.addArgument("interface",new a.NonNullType(e.stringType()))}if(this.version.gte(new r.FeatureVersion(0,3))){let t=this.addDirective(e,"unionMember").addLocations(n.DirectiveLocation.UNION);t.repeatable=!0,t.addArgument("graph",new a.NonNullType(i)),t.addArgument("member",new a.NonNullType(e.stringType()));let r=this.addDirective(e,"enumValue").addLocations(n.DirectiveLocation.ENUM_VALUE);r.repeatable=!0,r.addArgument("graph",new a.NonNullType(i))}if(this.version.gte(new r.FeatureVersion(0,4))){let t=this.addDirective(e,"directive").addLocations(n.DirectiveLocation.SCHEMA,n.DirectiveLocation.OBJECT,n.DirectiveLocation.INTERFACE,n.DirectiveLocation.FIELD_DEFINITION);t.repeatable=!0,t.addArgument("graphs",new a.ListType(new a.NonNullType(i))),t.addArgument("name",new a.NonNullType(e.stringType())),t.addArgument("args",this.addScalarType(e,"DirectiveArguments")),l.addArgument("overrideLabel",e.stringType())}if(this.version.gte(new r.FeatureVersion(0,5))){let t=this.addScalarType(e,"FieldValue"),i=e.addType(new a.InputObjectType("join__ContextArgument"));i.addField("name",new a.NonNullType(e.stringType())),i.addField("type",new a.NonNullType(e.stringType())),i.addField("context",new a.NonNullType(e.stringType())),i.addField("selection",new a.NonNullType(t)),l.addArgument("contextArguments",new a.ListType(new a.NonNullType(i)))}return this.isV01()&&this.addDirective(e,"owner").addLocations(n.DirectiveLocation.OBJECT).addArgument("graph",new a.NonNullType(i)),[]}allElementNames(){let e=["graph","Graph","FieldSet","@type","@field"];return this.isV01()?e.push("@owner"):e.push("@implements"),e}populateGraphEnum(e,t){let i=new o.MultiMap;for(let e of t){let t=function(e){let t=e.replace(/[\W]/g,"_"),i=t.match(/^\d/)?"_"+t:t;return(i.match(/_\d+$/)?i+"_":i).toLocaleUpperCase()}(e.name);i.add(t,e)}let n=new Map;for(let[e,t]of i)if(1===t.length)n.set(t[0].name,e);else for(let[i,r]of t.entries())n.set(r.name,`${e}_${i+1}`);let r=this.graphEnum(e),a=this.graphDirective(e);for(let e of t)r.addValue(n.get(e.name)).applyDirective(a,{name:e.name,url:e.url});return n}fieldSetScalar(e){return this.type(e,"FieldSet")}graphEnum(e){return this.type(e,"Graph")}graphDirective(e){return this.directive(e,"graph")}directiveDirective(e){return this.directive(e,"directive")}typeDirective(e){return this.directive(e,"type")}implementsDirective(e){return this.directive(e,"implements")}fieldDirective(e){return this.directive(e,"field")}unionMemberDirective(e){return this.directive(e,"unionMember")}enumValueDirective(e){return this.directive(e,"enumValue")}ownerDirective(e){return this.directive(e,"owner")}get defaultCorePurpose(){return"EXECUTION"}}i.JoinSpecDefinition=l,i.JOIN_VERSIONS=new r.FeatureDefinitions(i.joinIdentity).add(new l(new r.FeatureVersion(0,1))).add(new l(new r.FeatureVersion(0,2))).add(new l(new r.FeatureVersion(0,3),new r.FeatureVersion(2,0))).add(new l(new r.FeatureVersion(0,4),new r.FeatureVersion(2,7))).add(new l(new r.FeatureVersion(0,5),new r.FeatureVersion(2,8))),(0,s.registerKnownFeature)(i.JOIN_VERSIONS)},951071,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.removeInactiveProvidesAndRequires=i.addSubgraphToError=i.addSubgraphToASTNode=i.Subgraph=i.FEDERATION_OPERATION_FIELDS=i.entitiesFieldName=i.serviceFieldName=i.FEDERATION_OPERATION_TYPES=i.entityTypeSpec=i.serviceTypeSpec=i.anyTypeSpec=i.Subgraphs=i.subgraphsFromServiceList=i.collectTargetFields=i.parseFieldSetArgument=i.newEmptyFederation2Schema=i.buildSubgraph=i.isInterfaceObjectType=i.isEntityType=i.isFederationField=i.isFederationSubgraphSchema=i.federationMetadata=i.printSubgraphNames=i.asFed2SubgraphDocument=i.FEDERATION2_LINK_WITH_AUTO_EXPANDED_IMPORTS_UPGRADED=i.FEDERATION2_LINK_WITH_AUTO_EXPANDED_IMPORTS=i.FEDERATION2_LINK_WITH_FULL_IMPORTS=i.setSchemaAsFed2Subgraph=i.FederationBlueprint=i.hasAppliedDirective=i.isFederationDirectiveDefinedInSchema=i.FederationMetadata=i.collectUsedFields=i.parseContext=i.FEDERATION_UNNAMED_SUBGRAPH_NAME=i.FEDERATION_RESERVED_SUBGRAPH_NAME=void 0;let n=e.r(168032),r=e.r(331484),a=e.r(359063),s=e.r(186846),o=e.r(939603),l=e.r(826468),u=e.r(738207),c=e.r(193151),d=e.r(408470),p=e.r(263554),h=e.r(785576),f=e.r(479209),m=e.r(383105),y=e.r(343924),v=e.r(308126),g=e.r(319894),T=e.r(63672),S=h.LINK_VERSIONS.latest(),E=c.TAG_VERSIONS.latest(),I=e=>{if(!e)return f.FEDERATION_VERSIONS.latest();let t=f.FEDERATION_VERSIONS.find(e);return(0,r.assert)(t,`Federation spec version ${e} is not known`),t},b=I(new h.FeatureVersion(2,4)),N=I();i.FEDERATION_RESERVED_SUBGRAPH_NAME="_",i.FEDERATION_UNNAMED_SUBGRAPH_NAME="<unnamed>";let _=[s.PossibleTypeExtensionsRule,s.KnownTypeNamesRule],D=[o.KnownTypeNamesInFederationRule],A=a.specifiedSDLRules.filter(e=>!_.includes(e)).concat(D),O=Object.values(f.FederationDirectiveName),R=new n.CoreFeature(new h.FeatureUrl("<fed1>","fed1",new h.FeatureVersion(0,1)),"fed1",new n.Directive("fed1"),f.FEDERATION1_TYPES.map(e=>({name:e.name,as:"_"+e.name})));function w(e,t,i){var r,a;let o=(0,n.sourceASTs)(e);t.nodes&&o.push(...t.nodes);let l=(0,d.errorCodeDef)(t);l&&l!==d.ERRORS.INVALID_GRAPHQL||(l=d.ERROR_CATEGORIES.DIRECTIVE_INVALID_FIELDS.get(e.name));let u=t.message.trim();return i&&(u=i(u)),l.err(`${(r=e,`On ${L(r)}, for ${(a=r).sourceAST?(0,s.print)(a.sourceAST):a.toString()}`)}: ${u}`,{nodes:o,originalError:t})}function L(e){var t;let i=e.parent instanceof n.FieldDefinition?"field":"type";return`${i} "${null==(t=e.parent)?void 0:t.coordinate}"`}function C(e){let t=e.match(/^(?:[\n\r\t ,]|#[^\n\r]*(?![^\n\r]))*\$(?:[\n\r\t ,]|#[^\n\r]*(?![^\n\r]))*([A-Za-z_]\w*(?!\w))([\s\S]*)$/);if(!t)return{context:void 0,selection:void 0};let[,i,n]=t;return{context:i,selection:n}}i.parseContext=C;let F=({originalType:e,resolvedType:t})=>{let i=[],r=e;for(;"NonNullType"===r.kind||"ListType"===r.kind;)i.push(r.kind),r=r.ofType;let a=t;for(;i.length>0;)"ListType"===i.pop()&&(a=new n.ListType(a));return a},k=({currentType:e,selectionSet:t,errorCollector:i,metadata:a,fromContextParent:s})=>{let o=t.selections(),l=a.interfaceObjectDirective();return"ObjectType"===e.kind&&G(l)&&e.appliedDirectivesOf(l).length>0&&i.push(d.ERRORS.CONTEXT_INVALID_SELECTION.err(`Context "is used in "${s.coordinate}" but the selection is invalid: One of the types in the selection is an interfaceObject: "${e.name}"`,{nodes:(0,n.sourceASTs)(s)})),o.map(e=>{if("FieldSelection"!==e.kind)return{resolvedType:void 0};let{element:t,selectionSet:o}=e;(0,r.assert)(t.definition.type,"Element type definition should exist");let l=t.definition.type;if(o){(0,r.assert)((0,n.isCompositeType)((0,n.baseType)(l)),"Child selection sets should only exist on composite types");let{resolvedType:e}=k({currentType:(0,n.baseType)(l),selectionSet:o,errorCollector:i,metadata:a,fromContextParent:s});return e?{resolvedType:F({originalType:l,resolvedType:e})}:{resolvedType:void 0}}return(0,r.assert)((0,n.isLeafType)((0,n.baseType)(l)),"Expected a leaf type"),{resolvedType:F({originalType:l,resolvedType:(0,n.baseType)(l)})}}).reduce((e,{resolvedType:t})=>{var i;return(null==(i=e.resolvedType)?void 0:i.toString())===(null==t?void 0:t.toString())?{resolvedType:t}:{resolvedType:void 0}})};function P(e,t){if((0,n.isNonNullType)(e))if((0,n.isNonNullType)(t))return P(e.ofType,t.ofType);else return P(e.ofType,t);return(0,n.isListType)(e)&&(0,n.isListType)(t)?P(e.ofType,t.ofType):!(0,n.isWrapperType)(e)&&!(0,n.isWrapperType)(t)&&e.name===t.name}function x({definition:e,targetTypeExtractor:t,errorCollector:i,metadata:r,isOnParentType:a=!1,allowOnNonExternalLeafFields:o=!1,allowFieldsWithArguments:l=!1,allowOnInterface:u=!1,onFields:c}){for(let p of e.applications()){let h=p.parent,m=t(h),y=a?m:h.parent;if((0,n.isInterfaceType)(y)&&!u){let t=d.ERROR_CATEGORIES.DIRECTIVE_UNSUPPORTED_ON_INTERFACE.get(e.name);i.push(t.err(a?`Cannot use ${e.coordinate} on interface "${y.coordinate}": ${e.coordinate} is not yet supported on interfaces`:`Cannot use ${e.coordinate} on ${L(p)} of parent type "${y}": ${e.coordinate} is not yet supported within interfaces`,{nodes:(0,n.sourceASTs)(p).concat(a?[]:(0,n.sourceASTs)(m))}))}!function({type:e,directive:t,metadata:i,errorCollector:r,allowOnNonExternalLeafFields:a,allowFieldsWithArguments:o,onFields:l}){try{let s=l?(e,t)=>{let i=e.field(t);return i&&l(i),i}:void 0,u=ei({parentType:e,directive:t,fieldAccessor:s});!function e({directiveName:t,selectionSet:i,hasExternalInParents:r,metadata:a,onError:s,allowOnNonExternalLeafFields:o,allowFieldsWithArguments:l}){for(let u of i.selections()){let i=u.element.appliedDirectives;if(i.length>0&&s(d.ERROR_CATEGORIES.DIRECTIVE_IN_FIELDS_ARG.get(t).err(`cannot have directive applications in the @${t}(fields:) argument but found ${i.join(", ")}.`)),"FieldSelection"===u.kind){let i=u.element.definition,c=a.isFieldExternal(i);!l&&i.hasArguments()&&s(d.ERROR_CATEGORIES.FIELDS_HAS_ARGS.get(t).err(`field ${i.coordinate} cannot be included because it has arguments (fields with argument are not allowed in @${t})`,{nodes:i.sourceAST}));let p=!u.selectionSet&&!o&&!r;if(!c&&p){let e=d.ERROR_CATEGORIES.DIRECTIVE_FIELDS_MISSING_EXTERNAL.get(t);s(a.isFieldFakeExternal(i)?e.err(`field "${i.coordinate}" should not be part of a @${t} since it is already "effectively" provided by this subgraph (while it is marked @${f.FederationDirectiveName.EXTERNAL}, it is a @${f.FederationDirectiveName.KEY} field of an extension type, which are not internally considered external for historical/backward compatibility reasons)`,{nodes:i.sourceAST}):e.err(`field "${i.coordinate}" should not be part of a @${t} since it is already provided by this subgraph (it is not marked @${f.FederationDirectiveName.EXTERNAL})`,{nodes:i.sourceAST}))}if(u.selectionSet){let d=r||c,p=i.parent;if(!d&&(0,n.isInterfaceType)(p))for(let e of p.possibleRuntimeTypes()){let t=e.field(i.name);if(t&&a.isFieldExternal(t)){d=!0;break}}e({directiveName:t,selectionSet:u.selectionSet,hasExternalInParents:d,metadata:a,onError:s,allowOnNonExternalLeafFields:o,allowFieldsWithArguments:l})}}else e({directiveName:t,selectionSet:u.selectionSet,hasExternalInParents:r,metadata:a,onError:s,allowOnNonExternalLeafFields:o,allowFieldsWithArguments:l})}}({directiveName:t.name,selectionSet:u,hasExternalInParents:!1,metadata:i,onError:e=>r.push(w(t,e)),allowOnNonExternalLeafFields:a,allowFieldsWithArguments:o})}catch(e){if(e instanceof s.GraphQLError)r.push(e);else throw e}}({type:m,directive:p,metadata:r,errorCollector:i,allowOnNonExternalLeafFields:o,allowFieldsWithArguments:l,onFields:c})}}function M(e){let t=new Set;for(let i of(U(e.keyDirective(),e=>e,t),U(e.requiresDirective(),e=>e.parent,t),U(e.providesDirective(),e=>{let t=(0,n.baseType)(e.type);return(0,n.isCompositeType)(t)?t:void 0},t),function(e,t){let i=e.fromContextDirective(),r=e.contextDirective();if(!G(i)||!G(r))return;let a=new Map;for(let e of r.applications()){let t=e.parent;if(!t)continue;let i=e.arguments().name;a.has(i)||a.set(i,new Set),a.get(i).add(t)}for(let e of i.applications()){if(!e.parent)continue;let{context:i,selection:r}=C(e.arguments().field);if(!i)continue;let s=a.get(i);if(s)for(let e of s)try{let i=(e,i)=>{let r=e.field(i);if(r&&(t.add(r),(0,n.isInterfaceType)(e)))for(let n of e.possibleRuntimeTypes()){let e=n.field(i);e&&t.add(e)}return r};(0,u.parseSelectionSet)({parentType:e,source:r,fieldAccessor:i})}catch(e){}}}(e,t),e.schema.interfaceTypes())){let e=i.possibleRuntimeTypes();for(let n of i.fields())for(let i of e){let e=i.field(n.name);e&&t.add(e)}}return t}function U(e,t,i){for(let n of e.applications()){let e=t(n.parent);e&&en({parentType:e,directive:n,includeInterfaceFieldsImplementations:!0,validate:!1}).forEach(e=>i.add(e))}}function $(e,t,i){let a=e.appliedDirectivesOf(t.shareableDirective());if(a.length<=1)return;let s=a.reduce((e,t)=>{let i=t.ofExtension();return i?e.with.add(i,t):e.without.push(t),e},{without:[],with:new r.MultiMap});for(let t of[s.without].concat((0,r.mapValues)(s.with)))if(t.length>1){let r="ObjectType"===e.kind?`the same type declaration of "${e.coordinate}"`:`field "${e.coordinate}"`;i.push(d.ERRORS.INVALID_SHAREABLE_USAGE.err(`Invalid duplicate application of @shareable on ${r}: @shareable is only repeatable on types so it can be used simultaneously on a type definition and its extensions, but it should not be duplicated on the same definition/extension declaration`,{nodes:(0,n.sourceASTs)(...t)}))}}function j(e){return(0,n.isNonNullType)(e)&&(0,n.isListType)(e.ofType)}i.collectUsedFields=M;class V{constructor(e){this.schema=e}onInvalidate(){this._externalTester=void 0,this._sharingPredicate=void 0,this._isFed2Schema=void 0,this._fieldUsedPredicate=void 0}isFed2Schema(){if(!this._isFed2Schema){let e=this.federationFeature();this._isFed2Schema=!!e&&e.url.version.satisfies(new h.FeatureVersion(2,0))}return this._isFed2Schema}federationFeature(){var e;return null==(e=this.schema.coreFeatures)?void 0:e.getByIdentity(N.identity)}externalTester(){return this._externalTester||(this._externalTester=new el(this.schema,this.isFed2Schema())),this._externalTester}sharingPredicate(){return this._sharingPredicate||(this._sharingPredicate=(0,p.computeShareables)(this.schema)),this._sharingPredicate}fieldUsedPredicate(){if(!this._fieldUsedPredicate){let e=M(this);this._fieldUsedPredicate=t=>!!e.has(t)}return this._fieldUsedPredicate}isFieldUsed(e){return this.fieldUsedPredicate()(e)}isFieldExternal(e){return this.externalTester().isExternal(e)}isFieldPartiallyExternal(e){return this.externalTester().isPartiallyExternal(e)}isFieldFullyExternal(e){return this.externalTester().isFullyExternal(e)}isFieldFakeExternal(e){return this.externalTester().isFakeExternal(e)}selectionSelectsAnyExternalField(e){return this.externalTester().selectsAnyExternalField(e)}isFieldShareable(e){return this.sharingPredicate()(e)}isInterfaceObjectType(e){return(0,n.isObjectType)(e)&&B(e,this.interfaceObjectDirective())}federationDirectiveNameInSchema(e){if(!this.isFed2Schema())return e;{let t=this.schema.coreFeatures;(0,r.assert)(t,"Schema should be a core schema");let i=t.getByIdentity(N.identity);return(0,r.assert)(i,"Schema should have the federation feature"),i.directiveNameInSchema(e)}}federationTypeNameInSchema(e){if("_"===e.charAt(0))return e;if(!this.isFed2Schema())return"_"+e;{let t=this.schema.coreFeatures;(0,r.assert)(t,"Schema should be a core schema");let i=t.getByIdentity(N.identity);return(0,r.assert)(i,"Schema should have the federation feature"),i.typeNameInSchema(e)}}getLegacyFederationDirective(e){let t=this.getFederationDirective(e);return(0,r.assert)(t,`The provided schema does not have federation directive @${e}`),t}getFederationDirective(e){return this.schema.directive(this.federationDirectiveNameInSchema(e))}getPost20FederationDirective(e){var t;return null!=(t=this.getFederationDirective(e))?t:{name:e,applications:()=>new Set}}keyDirective(){return this.getLegacyFederationDirective(f.FederationDirectiveName.KEY)}overrideDirective(){return this.getLegacyFederationDirective(f.FederationDirectiveName.OVERRIDE)}extendsDirective(){return this.getLegacyFederationDirective(f.FederationDirectiveName.EXTENDS)}externalDirective(){return this.getLegacyFederationDirective(f.FederationDirectiveName.EXTERNAL)}requiresDirective(){return this.getLegacyFederationDirective(f.FederationDirectiveName.REQUIRES)}providesDirective(){return this.getLegacyFederationDirective(f.FederationDirectiveName.PROVIDES)}shareableDirective(){return this.getLegacyFederationDirective(f.FederationDirectiveName.SHAREABLE)}tagDirective(){return this.getLegacyFederationDirective(f.FederationDirectiveName.TAG)}composeDirective(){return this.getPost20FederationDirective(f.FederationDirectiveName.COMPOSE_DIRECTIVE)}inaccessibleDirective(){return this.getLegacyFederationDirective(f.FederationDirectiveName.INACCESSIBLE)}interfaceObjectDirective(){return this.getPost20FederationDirective(f.FederationDirectiveName.INTERFACE_OBJECT)}authenticatedDirective(){return this.getPost20FederationDirective(f.FederationDirectiveName.AUTHENTICATED)}requiresScopesDirective(){return this.getPost20FederationDirective(f.FederationDirectiveName.REQUIRES_SCOPES)}policyDirective(){return this.getPost20FederationDirective(f.FederationDirectiveName.POLICY)}fromContextDirective(){return this.getPost20FederationDirective(f.FederationDirectiveName.FROM_CONTEXT)}contextDirective(){return this.getPost20FederationDirective(f.FederationDirectiveName.CONTEXT)}costDirective(){return this.getPost20FederationDirective(f.FederationDirectiveName.COST)}listSizeDirective(){return this.getPost20FederationDirective(f.FederationDirectiveName.LIST_SIZE)}cacheTagDirective(){return this.getPost20FederationDirective(f.FederationDirectiveName.CACHE_TAG)}allFederationDirectives(){let e=[this.keyDirective(),this.externalDirective(),this.requiresDirective(),this.providesDirective(),this.tagDirective(),this.extendsDirective()];if(!this.isFed2Schema())return e;e.push(this.shareableDirective()),e.push(this.inaccessibleDirective()),e.push(this.overrideDirective());let t=this.composeDirective();G(t)&&e.push(t);let i=this.interfaceObjectDirective();G(i)&&e.push(i);let n=this.authenticatedDirective();G(n)&&e.push(n);let r=this.requiresScopesDirective();G(r)&&e.push(r);let a=this.policyDirective();G(a)&&e.push(a);let s=this.contextDirective();G(s)&&e.push(s);let o=this.fromContextDirective();G(o)&&e.push(o);let l=this.costDirective();G(l)&&e.push(l);let u=this.listSizeDirective();G(u)&&e.push(u);let c=this.cacheTagDirective();return G(c)&&e.push(c),e}entityType(){return this.schema.type(this.federationTypeNameInSchema(i.entityTypeSpec.name))}anyType(){return this.schema.type(this.federationTypeNameInSchema(i.anyTypeSpec.name))}serviceType(){return this.schema.type(this.federationTypeNameInSchema(i.serviceTypeSpec.name))}fieldSetType(){return this.schema.type(this.federationTypeNameInSchema(f.FederationTypeName.FIELD_SET))}allFederationTypes(){let e=[this.anyType(),this.serviceType()],t=this.federationFeature();if(t){let i=f.FEDERATION_VERSIONS.find(t.url.version);for(let n of((0,r.assert)(i,()=>`Federation spec should be known, but got ${t.url}`),i.typeSpecs())){let i=this.schema.type(t.typeNameInSchema(n.name));i&&e.push(i)}}else e.push(this.fieldSetType());let i=this.entityType();return i&&e.push(i),e}}function G(e){return e instanceof n.DirectiveDefinition}function B(e,t){return G(t)&&e.hasAppliedDirective(t)}i.FederationMetadata=V,i.isFederationDirectiveDefinedInSchema=G,i.hasAppliedDirective=B;class K extends n.SchemaBlueprint{constructor(e){super(),this.withRootTypeRenaming=e}onAddedCoreFeature(e,t){if(super.onAddedCoreFeature(e,t),t.url.identity===f.federationIdentity){let i=f.FEDERATION_VERSIONS.find(t.url.version);i&&i.addElementsToSchema(e)}}onMissingDirectiveDefinition(e,t){if(t.name===h.linkDirectiveDefaultName){let i,n=t.arguments(),r=n&&n.url,a=[];r&&r.startsWith(S.identity)&&(i=n.as,a=(0,h.extractCoreFeatureImports)(S.url,t));let s=S.addDefinitionsToSchema(e,i,a);return s.length>0?s:e.directive(t.name)}return super.onMissingDirectiveDefinition(e,t)}ignoreParsedField(e,t){if(!i.FEDERATION_OPERATION_FIELDS.includes(t)||!(0,n.isObjectType)(e)||!e.isQueryRootType())return!1;let r=q(e.schema());return!!r&&!r.isFed2Schema()}onConstructed(e){q(e)||(e._federationMetadata=new V(e))}onDirectiveDefinitionAndSchemaParsed(e){let t=z(e);return e.schemaDefinition.processUnappliedDirectives(),t}onInvalidation(e){super.onInvalidation(e);let t=q(e);(0,r.assert)(t,"Federation schema should have had its metadata set on construction"),V.prototype.onInvalidate.call(t)}onValidation(e){var t,i,a,s,o;let l=super.onValidation(e);if(this.withRootTypeRenaming)for(let i of n.allSchemaRootKinds){let r=null==(t=e.schemaDefinition.root(i))?void 0:t.type,a=(0,n.defaultRootName)(i);if(r&&r.name!==a){let t=e.type(a);t&&l.push(d.ERROR_CATEGORIES.ROOT_TYPE_USED.get(i).err(`The schema has a type named "${a}" but it is not set as the ${i} root type ("${r.name}" is instead): this is not supported by federation. If a root type does not use its default name, there should be no other type with that default name.`,{nodes:(0,n.sourceASTs)(r,t)})),r.rename(a)}}let c=q(e);if((0,r.assert)(c,"Federation schema should have had its metadata set on construction"),!c.isFed2Schema())return l;x({definition:c.keyDirective(),targetTypeExtractor:e=>e,errorCollector:l,metadata:c,isOnParentType:!0,allowOnNonExternalLeafFields:!0,allowOnInterface:c.federationFeature().url.version.compareTo(new h.FeatureVersion(2,3))>=0,onFields:e=>{let t=(0,n.baseType)(e.type);if((0,n.isUnionType)(t)||(0,n.isInterfaceType)(t)){let i=t.kind;throw i=i.slice(0,i.length-4),d.ERRORS.KEY_FIELDS_SELECT_INVALID_TYPE.err(`field "${e.coordinate}" is a ${i} type which is not allowed in @key`)}}}),x({definition:c.requiresDirective(),targetTypeExtractor:e=>e.parent,errorCollector:l,metadata:c,allowFieldsWithArguments:!0}),x({definition:c.providesDirective(),targetTypeExtractor:e=>{if(c.isFieldExternal(e))throw d.ERRORS.EXTERNAL_COLLISION_WITH_ANOTHER_DIRECTIVE.err(`Cannot have both @provides and @external on field "${e.coordinate}"`,{nodes:e.sourceAST});let t=(0,n.baseType)(e.type);if(!(0,n.isCompositeType)(t))throw d.ERRORS.PROVIDES_ON_NON_OBJECT_FIELD.err(`Invalid @provides directive on field "${e.coordinate}": field has type "${e.type}" which is not a Composite Type`,{nodes:e.sourceAST});return t},errorCollector:l,metadata:c});let p=c.contextDirective(),f=new Map;for(let e of p.applications()){let t=e.parent,i=e.arguments().name,r=i.match(/^([A-Za-z]\w*)$/);i.includes("_")?l.push(d.ERRORS.CONTEXT_NAME_INVALID.err(`Context name "${i}" may not contain an underscore.`,{nodes:(0,n.sourceASTs)(e)})):r||l.push(d.ERRORS.CONTEXT_NAME_INVALID.err(`Context name "${i}" is invalid. It should have only alphanumeric characters.`,{nodes:(0,n.sourceASTs)(e)}));let a=f.get(i);a?a.push(t):f.set(i,[t])}for(let e of c.fromContextDirective().applications()){let{field:t}=e.arguments(),{context:s,selection:o}=C(t);if("DirectiveDefinition"===e.parent.parent.kind){l.push(d.ERRORS.CONTEXT_NOT_SET.err(`@fromContext argument cannot be used on a directive definition "${e.parent.coordinate}".`,{nodes:(0,n.sourceASTs)(e)}));continue}let p=e.parent;if((null==(a=null==(i=null==p?void 0:p.parent)?void 0:i.parent)?void 0:a.kind)!=="ObjectType"){l.push(d.ERRORS.CONTEXT_NOT_SET.err(`@fromContext argument cannot be used on a field that exists on an abstract type "${e.parent.coordinate}".`,{nodes:(0,n.sourceASTs)(e)}));continue}let h=p.parent.parent;for(let t of h.interfaces()){let i=t.field(p.parent.name);i&&l.push(d.ERRORS.CONTEXT_NOT_SET.err(`@fromContext argument cannot be used on a field implementing an interface field "${i.coordinate}".`,{nodes:(0,n.sourceASTs)(e)}))}if(void 0!==p.defaultValue&&l.push(d.ERRORS.CONTEXT_NOT_SET.err(`@fromContext arguments may not have a default value: "${p.coordinate}".`,{nodes:(0,n.sourceASTs)(e)})),s&&o){let t=f.get(s);t?function({context:e,selection:t,fromContextParent:i,setContextLocations:a,errorCollector:s,metadata:o}){let l=i.type;(0,r.assert)(l,"Expected a type");let c=(({context:e,selection:t,fromContextParent:i,errorCollector:a})=>{try{let s=(0,u.parseOperationAST)(t.trim().startsWith("{")?t:`{${t}}`).selectionSet.selections;if(0===s.length)return a.push(d.ERRORS.CONTEXT_INVALID_SELECTION.err(`Context "${e}" is used in "${i.coordinate}" but the selection is invalid: no selection is made`,{nodes:(0,n.sourceASTs)(i)})),{selectionType:"error"};let o=s[0].kind;if("Field"===o){if(1!==s.length)return a.push(d.ERRORS.CONTEXT_INVALID_SELECTION.err(`Context "${e}" is used in "${i.coordinate}" but the selection is invalid: multiple selections are made`,{nodes:(0,n.sourceASTs)(i)})),{selectionType:"error"};return{selectionType:"field"}}if("InlineFragment"===o){let t=new Set;if(!s.every(e=>"InlineFragment"===e.kind))return a.push(d.ERRORS.CONTEXT_INVALID_SELECTION.err(`Context "${e}" is used in "${i.coordinate}" but the selection is invalid: multiple fields could be selected`,{nodes:(0,n.sourceASTs)(i)})),{selectionType:"error"};if(s.forEach(e=>{(0,r.assert)("InlineFragment"===e.kind,"Expected an inline fragment");let{typeCondition:i}=e;i&&t.add(i.name.value)}),t.size!==s.length)return a.push(d.ERRORS.CONTEXT_INVALID_SELECTION.err(`Context "${e}" is used in "${i.coordinate}" but the selection is invalid: type conditions have same name`,{nodes:(0,n.sourceASTs)(i)})),{selectionType:"error"};return{selectionType:"inlineFragment",typeConditions:t}}if("FragmentSpread"===o)return a.push(d.ERRORS.CONTEXT_INVALID_SELECTION.err(`Context "${e}" is used in "${i.coordinate}" but the selection is invalid: fragment spread is not allowed`,{nodes:(0,n.sourceASTs)(i)})),{selectionType:"error"};(0,r.assertUnreachable)(o)}catch(t){return a.push(d.ERRORS.CONTEXT_INVALID_SELECTION.err(`Context "${e}" is used in "${i.coordinate}" but the selection is invalid: ${t.message}`,{nodes:(0,n.sourceASTs)(i)})),{selectionType:"error"}}})({context:e,selection:t,fromContextParent:i,errorCollector:s}),p=c.selectionType;if("error"===p)return;let h=new Set;for(let c of a){var f,m;let a;try{a=(0,u.parseSelectionSet)({parentType:c,source:t})}catch(t){s.push(d.ERRORS.CONTEXT_INVALID_SELECTION.err(`Context "${e}" is used in "${i.coordinate}" but the selection is invalid for type ${c.name}. Error: ${t.message}`,{nodes:(0,n.sourceASTs)(i)}));return}if(f=a,(0,u.hasSelectionWithPredicate)(f,e=>{if("FieldSelection"===e.kind||"FragmentSelection"===e.kind)return e.element.appliedDirectives.length>0;(0,r.assertUnreachable)(e)})&&s.push(d.ERRORS.CONTEXT_INVALID_SELECTION.err(`Context "${e}" is used in "${i.coordinate}" but the selection is invalid: directives are not allowed in the selection`,{nodes:(0,n.sourceASTs)(i)})),m=a,(0,u.hasSelectionWithPredicate)(m,e=>"FieldSelection"===e.kind&&void 0!==e.element.alias)&&s.push(d.ERRORS.CONTEXT_INVALID_SELECTION.err(`Context "${e}" is used in "${i.coordinate}" but the selection is invalid: aliases are not allowed in the selection`,{nodes:(0,n.sourceASTs)(i)})),"field"===p){let{resolvedType:t}=k({currentType:c,selectionSet:a,errorCollector:s,metadata:o,fromContextParent:i});if(void 0===t||!P(t,l))return void s.push(d.ERRORS.CONTEXT_INVALID_SELECTION.err(`Context "${e}" is used in "${i.coordinate}" but the selection is invalid: the type of the selection "${t}" does not match the expected type "${null==l?void 0:l.toString()}"`,{nodes:(0,n.sourceASTs)(i)}))}else if("inlineFragment"===p){let t=[];for(let r of a.selections()){if("FragmentSelection"!==r.kind){s.push(d.ERRORS.CONTEXT_INVALID_SELECTION.err(`Context "${e}" is used in "${i.coordinate}" but the selection is invalid: selection should only contain a single field or at least one inline fragment}"`,{nodes:(0,n.sourceASTs)(i)}));continue}let{typeCondition:a}=r.element;if(!a){s.push(d.ERRORS.CONTEXT_INVALID_SELECTION.err(`Context "${e}" is used in "${i.coordinate}" but the selection is invalid: inline fragments must have type conditions"`,{nodes:(0,n.sourceASTs)(i)}));continue}"ObjectType"===a.kind?(0,n.possibleRuntimeTypes)(c).includes(a)&&(t.push(r),h.add(a.name)):s.push(d.ERRORS.CONTEXT_INVALID_SELECTION.err(`Context "${e}" is used in "${i.coordinate}" but the selection is invalid: type conditions must be an object type"`,{nodes:(0,n.sourceASTs)(i)}))}if(0===t.length)return void s.push(d.ERRORS.CONTEXT_INVALID_SELECTION.err(`Context "${e}" is used in "${i.coordinate}" but the selection is invalid: no type condition matches the location "${c.coordinate}"`,{nodes:(0,n.sourceASTs)(i)}));for(let r of t){let{resolvedType:t}=k({currentType:r.element.typeCondition,selectionSet:r.selectionSet,errorCollector:s,metadata:o,fromContextParent:i});if(void 0===t)return void s.push(d.ERRORS.CONTEXT_INVALID_SELECTION.err(`Context "${e}" is used in "${i.coordinate}" but the selection is invalid: the type of the selection does not match the expected type "${null==l?void 0:l.toString()}"`,{nodes:(0,n.sourceASTs)(i)}));if((0,n.isNonNullType)(t)&&(t=t.ofType),!P(t,l))return void s.push(d.ERRORS.CONTEXT_INVALID_SELECTION.err(`Context "${e}" is used in "${i.coordinate}" but the selection is invalid: the type of the selection "${null==t?void 0:t.toString()}" does not match the expected type "${null==l?void 0:l.toString()}"`,{nodes:(0,n.sourceASTs)(i)}))}}}if("inlineFragment"===c.selectionType)for(let t of c.typeConditions)h.has(t)||s.push(d.ERRORS.CONTEXT_INVALID_SELECTION.err(`Context "${e}" is used in "${i.coordinate}" but the selection is invalid: type condition "${t}" is never used.`,{nodes:(0,n.sourceASTs)(i)}))}({context:s,selection:o,fromContextParent:p,setContextLocations:t,errorCollector:l,metadata:c}):l.push(d.ERRORS.CONTEXT_NOT_SET.err(`Context "${s}" is used at location "${p.coordinate}" but is never set.`,{nodes:(0,n.sourceASTs)(e)}));let i=c.keyDirective();h.appliedDirectivesOf(i).some(e=>e.arguments().resolvable||void 0===e.arguments().resolvable)||l.push(d.ERRORS.CONTEXT_NO_RESOLVABLE_KEY.err(`Object "${h.coordinate}" has no resolvable key but has a field with a contextual argument.`,{nodes:(0,n.sourceASTs)(h)}))}else l.push(d.ERRORS.NO_CONTEXT_IN_SELECTION.err(`@fromContext argument does not reference a context "${t}".`,{nodes:(0,n.sourceASTs)(e)}))}for(let e of c.schema.interfaceTypes())for(let t of e.fields())c.isFieldExternal(t)&&l.push(d.ERRORS.EXTERNAL_ON_INTERFACE.err(`Interface type field "${t.coordinate}" is marked @external but @external is not allowed on interface fields (it is nonsensical).`,{nodes:t.sourceAST}));for(let e of c.schema.types())if((0,n.isObjectType)(e)||(0,n.isInterfaceType)(e))for(let t of e.fields())!c.isFieldExternal(t)||c.isFieldUsed(t)||l.push(d.ERRORS.EXTERNAL_UNUSED.err(`Field "${t.coordinate}" is marked @external but is not used in any federation directive (@key, @provides, @requires) or to satisfy an interface; the field declaration has no use and should be removed (or the field should not be @external).`,{nodes:t.sourceAST}));!function(e,t){for(let i of e.schema.interfaceTypes()){let a=i.possibleRuntimeTypes();for(let s of i.appliedDirectivesOf(e.keyDirective())){let o=ei({parentType:i,directive:s,validate:!1}),l=!1!==s.arguments().resolvable,u=[],c=[];for(let t of a){let i=t.appliedDirectivesOf(e.keyDirective()).find(e=>{let i=ei({parentType:t,directive:e,validate:!1});return o.equals(i)});i?l&&!1===i.arguments().resolvable&&u.push(t):c.push(t)}if(c.length>0){let e=(0,r.printHumanReadableList)(c.map(e=>`"${e.coordinate}"`),{prefix:"type",prefixPlural:"types"});t.push(d.ERRORS.INTERFACE_KEY_NOT_ON_IMPLEMENTATION.err(`Key ${s} on interface type "${i.coordinate}" is missing on implementation ${e}.`,{nodes:(0,n.sourceASTs)(...c)}))}else if(u.length>0){let e=(0,r.printHumanReadableList)(u.map(e=>`"${e.coordinate}"`),{prefix:"type",prefixPlural:"types"});t.push(d.ERRORS.INTERFACE_KEY_NOT_ON_IMPLEMENTATION.err(`Key ${s} on interface type "${i.coordinate}" should be resolvable on all implementation types, but is declared with argument "@key(resolvable:)" set to false in ${e}.`,{nodes:(0,n.sourceASTs)(...u)}))}}}}(c,l);for(let e of c.interfaceObjectDirective().applications())J(e.parent)||l.push(d.ERRORS.INTERFACE_OBJECT_USAGE_ERROR.err(`The @interfaceObject directive can only be applied to entity types but type "${e.parent.coordinate}" has no @key in this subgraph.`,{nodes:e.parent.sourceAST}));let m=c.tagDirective();if(m){let e=E.checkCompatibleDirective(m);e&&l.push(e)}for(let t of e.objectTypes())for(let e of($(t,c,l),t.fields()))$(e,c,l);for(let e of c.shareableDirective().applications()){let t=e.parent;t instanceof n.FieldDefinition&&!(0,n.isObjectType)(t.parent)&&l.push(d.ERRORS.INVALID_SHAREABLE_USAGE.err(`Invalid use of @shareable on field "${t.coordinate}": only object type fields can be marked with @shareable`,{nodes:(0,n.sourceASTs)(e,t.parent)}))}let y=c.costDirective(),v=c.listSizeDirective();for(let e of y.applications())!function(e,t){let i=e.parent;i instanceof n.FieldDefinition&&i.parent instanceof n.InterfaceType&&t.push(d.ERRORS.COST_APPLIED_TO_INTERFACE_FIELD.err(`@cost cannot be applied to interface "${i.coordinate}"`,{nodes:(0,n.sourceASTs)(e,i)}))}(e,l);for(let e of v.applications()){let t=e.parent;(0,r.assert)(t instanceof n.FieldDefinition,"@listSize can only be applied to FIELD_DEFINITION"),function(e,t,i){let{sizedFields:r=[]}=e.arguments();r.length||!t.type||(0,n.isListType)(t.type)||j(t.type)||i.push(d.ERRORS.LIST_SIZE_APPLIED_TO_NON_LIST.err(`"${t.coordinate}" is not a list`,{nodes:(0,n.sourceASTs)(e,t)}))}(e,t,l),function(e,t,i){let{assumedSize:r}=e.arguments();null!=r&&r<0&&i.push(d.ERRORS.LIST_SIZE_INVALID_ASSUMED_SIZE.err(`Assumed size of "${t.coordinate}" cannot be negative`,{nodes:(0,n.sourceASTs)(e,t)}))}(e,t,l),function(e,t,i){let{slicingArguments:r=[]}=e.arguments();for(let s of r){let r=t.argument(s);if(null==r?void 0:r.type){var a;(0,n.isIntType)(r.type)||(a=r.type,(0,n.isNonNullType)(a)&&(0,n.isIntType)(a.ofType))||i.push(d.ERRORS.LIST_SIZE_INVALID_SLICING_ARGUMENT.err(`Slicing argument "${r.coordinate}" must be Int or Int!`,{nodes:(0,n.sourceASTs)(e,t)}))}else i.push(d.ERRORS.LIST_SIZE_INVALID_SLICING_ARGUMENT.err(`Slicing argument "${s}" is not an argument of "${t.coordinate}"`,{nodes:(0,n.sourceASTs)(e,t)}))}}(e,t,l),function(e,t,i){let{sizedFields:r=[]}=e.arguments();if(r.length&&t.type){let a=(0,n.baseType)(t.type);if((0,n.isCompositeType)(a))for(let s of r){let r=a.field(s);r?r.type&&((0,n.isListType)(r.type)||j(r.type))||i.push(d.ERRORS.LIST_SIZE_APPLIED_TO_NON_LIST.err(`Sized field "${r.coordinate}" is not a list`,{nodes:(0,n.sourceASTs)(e,t)})):i.push(d.ERRORS.LIST_SIZE_INVALID_SIZED_FIELD.err(`Sized field "${s}" is not a field on type "${a.coordinate}"`,{nodes:(0,n.sourceASTs)(e,t)}))}else i.push(d.ERRORS.LIST_SIZE_INVALID_SIZED_FIELD.err(`Sized fields cannot be used because "${t.type}" is not a composite type`,{nodes:(0,n.sourceASTs)(e,t)}))}}(e,t,l)}return s=c,o=l,[s.authenticatedDirective(),s.requiresScopesDirective(),s.policyDirective()].forEach(e=>{for(let t of e.applications()){let i=t.parent;if((0,n.isElementNamedType)(i)&&((0,n.isInterfaceType)(i)||W(i))||(0,n.isFieldDefinition)(i)&&(0,n.isInterfaceType)(i.parent)){let r="";switch(i.kind){case"FieldDefinition":r="field";break;case"InterfaceType":r="interface";break;case"ObjectType":r="interface object"}o.push(d.ERRORS.AUTH_REQUIREMENTS_APPLIED_ON_INTERFACE.err(`Invalid use of @${e.name} on ${r} "${i.coordinate}": @${e.name} cannot be applied on interfaces, interface fields and interface objects`,{nodes:(0,n.sourceASTs)(t,i.parent)}))}}}),l}validationRules(){return A}onUnknownDirectiveValidationError(e,t,i){let n=q(e);if((0,r.assert)(n,"This method should only have been called on a subgraph schema"),O.includes(t))if(!n.isFed2Schema())return(0,d.withModifiedErrorMessage)(i,`${i.message} If you meant the "@${t}" federation 2 directive, note that this schema is a federation 1 schema. To be a federation 2 schema, it needs to @link to the federation specifcation v2.`);else{let e=n.federationFeature();(0,r.assert)(e,"Fed2 subgraph _must_ link to the federation feature");let a=e.directiveNameInSchema(t);return a.startsWith(e.nameInSchema+"__")?(0,d.withModifiedErrorMessage)(i,`${i.message} If you meant the "@${t}" federation directive, you should use fully-qualified name "@${a}" or add "@${t}" to the \`import\` argument of the @link to the federation specification.`):(0,d.withModifiedErrorMessage)(i,`${i.message} If you meant the "@${t}" federation directive, you should use "@${a}" as it is imported under that name in the @link to the federation specification of this schema.`)}if(!n.isFed2Schema()){let e=(0,v.suggestionList)(t,O);if(e.length>0)return(0,d.withModifiedErrorMessage)(i,`${i.message}${(0,v.didYouMean)(e.map(e=>"@"+e))} If so, note that ${1===e.length?"it is a federation 2 directive":"they are federation 2 directives"} but this schema is a federation 1 one. To be a federation 2 schema, it needs to @link to the federation specifcation v2.`)}return i}applyDirectivesAfterParsing(){return!0}}function Q(e,t=!1){let i,a=e.coreFeatures;if(a)i=a.coreDefinition,(0,r.assert)(i.url.version.satisfies(S.version),`Fed2 schema must use @link with version >= 1.0, but schema uses ${i.url}`);else{let t=function(e){if(!e.directive(S.url.name))return;let t=S.url.name;for(;;){let i=t+1;if(!e.directive(i))return i}}(e),s=S.addToSchema(e,t);if(s.length>0)throw(0,n.ErrGraphQLValidationFailed)(s);i=S,a=e.coreFeatures,(0,r.assert)(a,"Schema should now be a core schema")}let s=t?N:b;(0,r.assert)(!a.getByIdentity(s.identity),"Schema already set as a federation subgraph"),e.schemaDefinition.applyDirective(a.coreItself.nameInSchema,{url:s.url.toString(),import:b.directiveSpecs().map(e=>`@${e.name}`)});let o=z(e);if(o.length>0)throw(0,n.ErrGraphQLValidationFailed)(o)}function q(e){return e._federationMetadata}function H(e){var t;return e.parent===(null==(t=e.schema().schemaDefinition.root("query"))?void 0:t.type)&&i.FEDERATION_OPERATION_FIELDS.includes(e.name)}function J(e){if(!(0,n.isObjectType)(e)&&!(0,n.isInterfaceType)(e))return!1;let t=q(e.schema());return!!t&&e.hasAppliedDirective(t.keyDirective())}function W(e){if(!(0,n.isObjectType)(e))return!1;let t=q(e.schema());return!!t&&t.isInterfaceObjectType(e)}function Y(e,t,n,r=!0){let a,o={blueprint:new K(r),validate:!1};try{let i="string"==typeof n?(0,l.buildSchema)(new s.Source(n,e),o):(0,l.buildSchemaFromAST)(n,o);a=new ea(e,t,i)}catch(t){if(t instanceof s.GraphQLError&&e!==i.FEDERATION_UNNAMED_SUBGRAPH_NAME)throw eo(t,e,d.ERRORS.INVALID_GRAPHQL);throw t}return a.validate()}function z(e){let t=e.coreFeatures;if(t)return t.getByIdentity(f.federationIdentity)?ee(e):Z(e);if(!e.schemaDefinition.appliedDirectivesOf(h.linkDirectiveDefaultName).find(X))return Z(e);{let t=S.addToSchema(e);return t.length>0?t:ee(e)}}function X(e){let t=e.arguments();return e.name===h.linkDirectiveDefaultName&&t.url&&t.url.startsWith(f.federationIdentity)}function Z(e){var t,i;for(let n of[f.FederationDirectiveName.KEY,f.FederationDirectiveName.PROVIDES,f.FederationDirectiveName.REQUIRES]){let a=e.directive(n);if(!a)continue;(0,r.assert)(0===a.applications().size,`${a} shouldn't have had validation at that places`);let s=null==(i=null==(t=a.argument("fields"))?void 0:t.type)?void 0:i.toString(),o=!!s&&1===a.arguments().length&&("String"===s||"_FieldSet"===s||"FieldSet"===s);(0===a.arguments().length||o)&&a.remove()}let n=f.FEDERATION1_TYPES.map(t=>t.checkOrAdd(e,R)).concat(f.FEDERATION1_DIRECTIVES.map(t=>t.checkOrAdd(e))).flat();return 0===n.length?et(e):n}function ee(e){let t=e.coreFeatures;(0,r.assert)(t,"This method should not have been called on a non-core schema");let i=t.getByIdentity(f.federationIdentity);(0,r.assert)(i,"This method should not have been called on a schema with no @link for federation");let n=f.FEDERATION_VERSIONS.find(i.url.version);if(!n)return[d.ERRORS.UNKNOWN_FEDERATION_LINK_VERSION.err(`Invalid version ${i.url.version} for the federation feature in @link directive on schema`,{nodes:i.directive.sourceAST})];let a=n.addElementsToSchema(e);return 0===a.length?et(e):a}function et(e){let t=e.coreFeatures;if(!t)return[];let i=[];for(let n of t.allFeatures()){if(n===t.coreItself||n.url.identity===f.federationIdentity||n.url.identity===T.joinIdentity)continue;let r=(0,g.coreFeatureDefinitionIfKnown)(n.url);r&&(i=i.concat(r.addElementsToSchema(e)))}return i}function ei({parentType:e,directive:t,fieldAccessor:i,validate:n,decorateValidationErrors:r=!0,normalize:a=!1}){try{let r=(0,u.parseSelectionSet)({parentType:e,source:function(e){var t;let i=e.arguments().fields,n=e.sourceAST;if("string"!=typeof i)throw d.ERROR_CATEGORIES.DIRECTIVE_INVALID_FIELDS_TYPE.get(e.name).err(`Invalid value for argument "${e.definition.argument("fields").name}": must be a string.`,{nodes:n});if(n&&"Directive"===n.kind){for(let i of null!=(t=n.arguments)?t:[])if("fields"===i.name.value){if("StringValue"!==i.value.kind)throw d.ERROR_CATEGORIES.DIRECTIVE_INVALID_FIELDS_TYPE.get(e.name).err(`Invalid value for argument "${e.definition.argument("fields").name}": must be a string.`,{nodes:n});break}}return i}(t),fieldAccessor:i,validate:n});return(null==n||n)&&r.forEachElement(e=>{if("Field"===e.kind&&e.alias)throw new s.GraphQLError(`Cannot use alias "${e.alias}" in "${e}": aliases are not currently supported in @${t.name}`)}),a?r.normalize({parentType:e,recursive:!0}):r}catch(e){if(!(e instanceof s.GraphQLError)||!r)throw e;throw w(t,e,e=>(e.startsWith("Cannot query field")&&(e.endsWith(".")&&(e=e.slice(0,e.length-1)),t.name===f.FederationDirectiveName.KEY?e+=" (the field should either be added to this subgraph or, if it should not be resolved by this subgraph, you need to add it to this subgraph with @external).":e+=" (if the field is defined in another subgraph, you need to add it to this subgraph with @external)."),e))}}function en({parentType:e,directive:t,includeInterfaceFieldsImplementations:i,validate:r=!0}){let a=[];try{ei({parentType:e,directive:t,fieldAccessor:(e,t)=>{let r=e.field(t);if(r&&(a.push(r),i&&(0,n.isInterfaceType)(e)))for(let i of e.possibleRuntimeTypes()){let e=i.field(t);e&&a.push(e)}return r},validate:r})}catch(e){if(void 0===(0,d.errorCauses)(e)||r)throw e}return a}i.FederationBlueprint=K,i.setSchemaAsFed2Subgraph=Q,i.FEDERATION2_LINK_WITH_FULL_IMPORTS='@link(url: "https://specs.apollo.dev/federation/v2.14", import: ["@key", "@requires", "@provides", "@external", "@tag", "@extends", "@shareable", "@inaccessible", "@override", "@composeDirective", "@interfaceObject", "@authenticated", "@requiresScopes", "@policy", "@context", "@fromContext", "@cost", "@listSize", "@cacheTag"])',i.FEDERATION2_LINK_WITH_AUTO_EXPANDED_IMPORTS='@link(url: "https://specs.apollo.dev/federation/v2.14", import: ["@key", "@requires", "@provides", "@external", "@tag", "@extends", "@shareable", "@inaccessible", "@override", "@composeDirective", "@interfaceObject"])',i.FEDERATION2_LINK_WITH_AUTO_EXPANDED_IMPORTS_UPGRADED='@link(url: "https://specs.apollo.dev/federation/v2.4", import: ["@key", "@requires", "@provides", "@external", "@tag", "@extends", "@shareable", "@inaccessible", "@override", "@composeDirective", "@interfaceObject"])',i.asFed2SubgraphDocument=function(e,t){var i,n;let r=(null==t?void 0:t.includeAllImports)?N.directiveSpecs():b.directiveSpecs(),a={kind:s.Kind.DIRECTIVE,name:{kind:s.Kind.NAME,value:h.linkDirectiveDefaultName},arguments:[{kind:s.Kind.ARGUMENT,name:{kind:s.Kind.NAME,value:"url"},value:{kind:s.Kind.STRING,value:N.url.toString()}},{kind:s.Kind.ARGUMENT,name:{kind:s.Kind.NAME,value:"import"},value:{kind:s.Kind.LIST,values:r.map(e=>({kind:s.Kind.STRING,value:`@${e.name}`}))}}]};if(null==(i=null==t?void 0:t.addAsSchemaExtension)||i)return{kind:s.Kind.DOCUMENT,loc:e.loc,definitions:e.definitions.concat({kind:s.Kind.SCHEMA_EXTENSION,directives:[a]})};let o=e.definitions.find(e=>e.kind==s.Kind.SCHEMA_DEFINITION);if(o)return{kind:s.Kind.DOCUMENT,loc:e.loc,definitions:e.definitions.filter(e=>e!==o).concat([{...o,directives:[a].concat(null!=(n=o.directives)?n:[])}])};{let t=e.definitions.some(e=>e.kind===s.Kind.OBJECT_TYPE_DEFINITION&&"Mutation"===e.name.value),i=(e,t)=>({kind:s.Kind.OPERATION_TYPE_DEFINITION,operation:e,type:{kind:s.Kind.NAMED_TYPE,name:{kind:s.Kind.NAME,value:t}}});return{kind:s.Kind.DOCUMENT,loc:e.loc,definitions:e.definitions.concat({kind:s.Kind.SCHEMA_DEFINITION,directives:[a],operationTypes:[i(s.OperationTypeNode.QUERY,"Query")].concat(t?i(s.OperationTypeNode.MUTATION,"Mutation"):[])})}}},i.printSubgraphNames=function(e){return(0,r.printHumanReadableList)(e.map(e=>`"${e}"`),{prefix:"subgraph",prefixPlural:"subgraphs"})},i.federationMetadata=q,i.isFederationSubgraphSchema=function(e){return!!q(e)},i.isFederationField=H,i.isEntityType=J,i.isInterfaceObjectType=W,i.buildSubgraph=Y,i.newEmptyFederation2Schema=function(e){let t=new n.Schema(new K(!0),e);return Q(t,!0),t},i.parseFieldSetArgument=ei,i.collectTargetFields=en,i.subgraphsFromServiceList=function(e){var t;let i=[],n=new er;for(let r of e)try{n.add(Y(r.name,null!=(t=r.url)?t:"",r.typeDefs))}catch(t){let e=(0,d.errorCauses)(t);if(e)i=i.concat(e);else throw t}return 0===i.length?n:i};class er{constructor(){this.subgraphs=new r.OrderedMap}add(e){if(this.subgraphs.has(e.name))throw Error(`A subgraph named ${e.name} already exists`+(e.url?` (with url '${e.url}')`:""));return this.subgraphs.add(e.name,e),e}get(e){return this.subgraphs.get(e)}size(){return this.subgraphs.size}names(){return this.subgraphs.keys()}values(){return this.subgraphs.values()}*[Symbol.iterator](){for(let e of this.subgraphs)yield e}validate(){let e=[];for(let t of this.values())try{t.validate()}catch(i){let t=(0,d.errorCauses)(i);if(!t)throw i;e=e.concat(t)}return 0===e.length?void 0:e}toString(){return"["+this.subgraphs.keys().join(", ")+"]"}}i.Subgraphs=er,i.anyTypeSpec=(0,y.createScalarTypeSpecification)({name:"_Any"}),i.serviceTypeSpec=(0,y.createObjectTypeSpecification)({name:"_Service",fieldsFct:e=>[{name:"sdl",type:e.stringType()}]}),i.entityTypeSpec=(0,y.createUnionTypeSpecification)({name:"_Entity",membersFct:e=>e.objectTypes().filter(J).map(e=>e.name)}),i.FEDERATION_OPERATION_TYPES=[i.anyTypeSpec,i.serviceTypeSpec,i.entityTypeSpec],i.serviceFieldName="_service",i.entitiesFieldName="_entities",i.FEDERATION_OPERATION_FIELDS=[i.serviceFieldName,i.entitiesFieldName];class ea{constructor(e,t,n){if(this.name=e,this.url=t,this.schema=n,e===i.FEDERATION_RESERVED_SUBGRAPH_NAME)throw d.ERRORS.INVALID_SUBGRAPH_NAME.err(`Invalid name ${i.FEDERATION_RESERVED_SUBGRAPH_NAME} for a subgraph: this name is reserved`)}metadata(){let e=q(this.schema);return(0,r.assert)(e,"The subgraph schema should have built with the federation built-ins."),e}isFed2Subgraph(){return this.metadata().isFed2Schema()}addFederationOperations(){let e=this.metadata();for(let e of i.FEDERATION_OPERATION_TYPES)e.checkOrAdd(this.schema);let t=this.schema.schemaDefinition.root("query"),r=t?t.type:this.schema.addType(new n.ObjectType("Query")),a=r.field(i.entitiesFieldName),s=e.entityType();if(s){let t=new n.NonNullType(new n.ListType(s));a?a.type||(a.type=s):r.addField(i.entitiesFieldName,t).addArgument("representations",new n.NonNullType(new n.ListType(new n.NonNullType(e.anyType()))))}else a&&a.remove();r.field(i.serviceFieldName)||r.addField(i.serviceFieldName,new n.NonNullType(e.serviceType()))}assumeValid(){return this.addFederationOperations(),this.schema.assumeValid(),this}validate(){try{return this.addFederationOperations(),this.schema.validate(),this}catch(e){if(e instanceof s.GraphQLError)throw eo(e,this.name,d.ERRORS.INVALID_GRAPHQL);throw e}}isPrintedDirective(e){var t;if(this.metadata().allFederationDirectives().includes(e))return!1;let i=this.schema.coreFeatures;return!i||(null==(t=i.sourceFeature(e))?void 0:t.feature.url.identity)!==h.linkIdentity}isPrintedType(e){var t;if(this.metadata().allFederationTypes().includes(e)||(0,n.isObjectType)(e)&&e.isQueryRootType()&&0===e.fields().filter(e=>!H(e)).length)return!1;let i=this.schema.coreFeatures;return!i||(null==(t=i.sourceFeature(e))?void 0:t.feature.url.identity)!==h.linkIdentity}isPrintedDirectiveApplication(e){let t;if(!this.schema.coreFeatures||e.name!==S.url.name)return!0;let i=e.arguments();if("url"in i)try{t=h.FeatureUrl.parse(i.url)}catch(e){}return(null==t?void 0:t.identity)!==h.linkIdentity||1!==Object.keys(i).length}toString(e=m.defaultPrintOptions){return(0,m.printSchema)(this.schema,{...e,directiveDefinitionFilter:e=>this.isPrintedDirective(e),typeFilter:e=>this.isPrintedType(e),fieldFilter:e=>!H(e),directiveApplicationFilter:e=>this.isPrintedDirectiveApplication(e)})}}function es(e,t){return"subgraph"in e?e:{...e,subgraph:t}}function eo(e,t,i){let r=(0,d.errorCauses)(e).map(e=>{var n;let r=`[${t}] ${e.message}`,a=e.nodes?e.nodes.map(e=>es(e,t)):void 0,o=null!=(n=(0,d.errorCodeDef)(e))?n:i,l={...(0,d.extractGraphQLErrorOptions)(e),nodes:a,originalError:e};return o?o.err(r,l):new s.GraphQLError(r,l)});return 1===r.length?r[0]:(0,n.ErrGraphQLValidationFailed)(r)}i.Subgraph=ea,i.addSubgraphToASTNode=es,i.addSubgraphToError=eo;class el{constructor(e,t){this.schema=e,this.isFed2Schema=t,this.fakeExternalFields=new Set,this.providedFields=new Set,this.externalFieldsOnType=new Set,this.externalDirective=this.metadata().externalDirective(),this.collectFakeExternals(),this.collectProvidedFields(),this.collectExternalsOnType()}metadata(){let e=q(this.schema);return(0,r.assert)(e,"Schema should be a subgraphs schema"),e}collectFakeExternals(){let e=this.metadata(),t=e.extendsDirective();for(let i of e.keyDirective().applications()){let e=i.parent;(i.ofExtension()||e.hasAppliedDirective(t))&&en({parentType:e,directive:i,includeInterfaceFieldsImplementations:!1,validate:!1}).filter(e=>e.hasAppliedDirective(this.externalDirective)).forEach(e=>this.fakeExternalFields.add(e.coordinate))}}collectProvidedFields(){for(let e of this.metadata().providesDirective().applications()){let t=e.parent,i=(0,n.baseType)(t.type);(0,n.isCompositeType)(i)&&en({parentType:i,directive:e,includeInterfaceFieldsImplementations:!0,validate:!1}).forEach(e=>this.providedFields.add(e.coordinate))}}collectExternalsOnType(){if(this.isFed2Schema){for(let e of this.schema.objectTypes())if(e.hasAppliedDirective(this.externalDirective))for(let t of e.fields())this.externalFieldsOnType.add(t.coordinate)}}isExternal(e){return(e.hasAppliedDirective(this.externalDirective)||this.externalFieldsOnType.has(e.coordinate))&&!this.isFakeExternal(e)}isFakeExternal(e){return this.fakeExternalFields.has(e.coordinate)}selectsAnyExternalField(e){for(let t of e.selections())if("FieldSelection"===t.kind&&this.isExternal(t.element.definition)||t.selectionSet&&this.selectsAnyExternalField(t.selectionSet))return!0;return!1}isPartiallyExternal(e){return this.isExternal(e)&&this.providedFields.has(e.coordinate)}isFullyExternal(e){return this.isExternal(e)&&!this.providedFields.has(e.coordinate)}}function eu(e,t,i,n){for(let r of t.appliedDirectivesOf(e)){let a;try{a=ei({parentType:i,directive:r})}catch(e){continue}if(function e(t){return t.selections().some(t=>"FieldSelection"!==t.kind?e(t.selectionSet):!ec(t.element.definition)&&(!t.selectionSet||e(t.selectionSet)))}(a)){r.remove();let i=function e(t){return t.lazyMap(t=>{if("FieldSelection"===t.kind&&ec(t.element.definition))return t;if(t.selectionSet){let i=e(t.selectionSet);if(!i.isEmpty())return t.withUpdatedSelectionSet(i)}})}(a);if(i.isEmpty())n(t,r);else{let a=t.applyDirective(e,{fields:i.toString(!0,!1)});n(t,r,a)}}}}function ec(e){let t=q(e.schema());if(!t)return!1;if(e.hasAppliedDirective(t.externalDirective()))return!0;let i=e.parent;if((0,n.isInterfaceType)(i))for(let n of i.possibleRuntimeTypes()){let i=n.field(e.name);if(i&&i.hasAppliedDirective(t.externalDirective()))return!0}return!1}i.removeInactiveProvidesAndRequires=function(e,t=()=>{}){let i=q(e);if(!i)return;let r=i.providesDirective(),a=i.requiresDirective();for(let i of e.types())if((0,n.isObjectType)(i)||(0,n.isInterfaceType)(i))for(let e of i.fields()){let s=(0,n.baseType)(e.type);eu(r,e,s,t),eu(a,e,i,t)}}},12842,(e,t,i)=>{"use strict";let n=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,r=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,a=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,s=/\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi,o=new Map([["n","\n"],["r","\r"],["t"," "],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e","\x1b"],["a","\x07"]]);function l(e){let t="u"===e[0],i="{"===e[1];return t&&!i&&5===e.length||"x"===e[0]&&3===e.length?String.fromCharCode(parseInt(e.slice(1),16)):t&&i?String.fromCodePoint(parseInt(e.slice(2,-1),16)):o.get(e)||e}function u(e,t){let i={};for(let e of t)for(let t of e.styles)i[t[0]]=e.inverse?null:t.slice(1);let n=e;for(let[e,t]of Object.entries(i))if(Array.isArray(t)){if(!(e in n))throw Error(`Unknown Chalk style: ${e}`);n=t.length>0?n[e](...t):n[e]}return n}t.exports=(e,t)=>{let i=[],o=[],c=[];if(t.replace(n,(t,n,d,p,h,f)=>{if(n)c.push(l(n));else if(p){let t=c.join("");c=[],o.push(0===i.length?t:u(e,i)(t)),i.push({inverse:d,styles:function(e){let t;r.lastIndex=0;let i=[];for(;null!==(t=r.exec(e));){let e=t[1];if(t[2]){let n=function(e,t){let i,n=[];for(let r of t.trim().split(/\s*,\s*/g)){let t=Number(r);if(Number.isNaN(t))if(i=r.match(a))n.push(i[2].replace(s,(e,t,i)=>t?l(t):i));else throw Error(`Invalid Chalk template style argument: ${r} (in style '${e}')`);else n.push(t)}return n}(e,t[2]);i.push([e].concat(n))}else i.push([e])}return i}(p)})}else if(h){if(0===i.length)throw Error("Found extraneous } in Chalk template literal");o.push(u(e,i)(c.join(""))),c=[],i.pop()}else c.push(f)}),o.push(c.join("")),i.length>0)throw Error(`Chalk template literal is missing ${i.length} closing bracket${1===i.length?"":"s"} (\`}\`)`);return o.join("")}},977235,(e,t,i)=>{"use strict";t.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},349779,(e,t,i)=>{let n=e.r(977235),r={};for(let e of Object.keys(n))r[n[e]]=e;let a={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(let e of(t.exports=a,Object.keys(a))){if(!("channels"in a[e]))throw Error("missing channels property: "+e);if(!("labels"in a[e]))throw Error("missing channel labels property: "+e);if(a[e].labels.length!==a[e].channels)throw Error("channel and label counts mismatch: "+e);let{channels:t,labels:i}=a[e];delete a[e].channels,delete a[e].labels,Object.defineProperty(a[e],"channels",{value:t}),Object.defineProperty(a[e],"labels",{value:i})}a.rgb.hsl=function(e){let t,i=e[0]/255,n=e[1]/255,r=e[2]/255,a=Math.min(i,n,r),s=Math.max(i,n,r),o=s-a;s===a?t=0:i===s?t=(n-r)/o:n===s?t=2+(r-i)/o:r===s&&(t=4+(i-n)/o),(t=Math.min(60*t,360))<0&&(t+=360);let l=(a+s)/2;return[t,100*(s===a?0:l<=.5?o/(s+a):o/(2-s-a)),100*l]},a.rgb.hsv=function(e){let t,i,n,r,a,s=e[0]/255,o=e[1]/255,l=e[2]/255,u=Math.max(s,o,l),c=u-Math.min(s,o,l),d=function(e){return(u-e)/6/c+.5};return 0===c?(r=0,a=0):(a=c/u,t=d(s),i=d(o),n=d(l),s===u?r=n-i:o===u?r=1/3+t-n:l===u&&(r=2/3+i-t),r<0?r+=1:r>1&&(r-=1)),[360*r,100*a,100*u]},a.rgb.hwb=function(e){let t=e[0],i=e[1],n=e[2];return[a.rgb.hsl(e)[0],1/255*Math.min(t,Math.min(i,n))*100,100*(n=1-1/255*Math.max(t,Math.max(i,n)))]},a.rgb.cmyk=function(e){let t=e[0]/255,i=e[1]/255,n=e[2]/255,r=Math.min(1-t,1-i,1-n);return[100*((1-t-r)/(1-r)||0),100*((1-i-r)/(1-r)||0),100*((1-n-r)/(1-r)||0),100*r]},a.rgb.keyword=function(e){let t,i=r[e];if(i)return i;let a=1/0;for(let i of Object.keys(n)){let r=n[i],s=(e[0]-r[0])**2+(e[1]-r[1])**2+(e[2]-r[2])**2;s<a&&(a=s,t=i)}return t},a.keyword.rgb=function(e){return n[e]},a.rgb.xyz=function(e){let t=e[0]/255,i=e[1]/255,n=e[2]/255;return[100*(.4124*(t=t>.04045?((t+.055)/1.055)**2.4:t/12.92)+.3576*(i=i>.04045?((i+.055)/1.055)**2.4:i/12.92)+.1805*(n=n>.04045?((n+.055)/1.055)**2.4:n/12.92)),100*(.2126*t+.7152*i+.0722*n),100*(.0193*t+.1192*i+.9505*n)]},a.rgb.lab=function(e){let t=a.rgb.xyz(e),i=t[0],n=t[1],r=t[2];return i/=95.047,n/=100,r/=108.883,[116*(n=n>.008856?n**(1/3):7.787*n+16/116)-16,500*((i=i>.008856?i**(1/3):7.787*i+16/116)-n),200*(n-(r=r>.008856?r**(1/3):7.787*r+16/116))]},a.hsl.rgb=function(e){let t,i,n,r=e[0]/360,a=e[1]/100,s=e[2]/100;if(0===a)return[n=255*s,n,n];t=s<.5?s*(1+a):s+a-s*a;let o=2*s-t,l=[0,0,0];for(let e=0;e<3;e++)(i=r+-(1/3*(e-1)))<0&&i++,i>1&&i--,n=6*i<1?o+(t-o)*6*i:2*i<1?t:3*i<2?o+(t-o)*(2/3-i)*6:o,l[e]=255*n;return l},a.hsl.hsv=function(e){let t=e[0],i=e[1]/100,n=e[2]/100,r=i,a=Math.max(n,.01);n*=2,i*=n<=1?n:2-n,r*=a<=1?a:2-a;let s=(n+i)/2;return[t,100*(0===n?2*r/(a+r):2*i/(n+i)),100*s]},a.hsv.rgb=function(e){let t=e[0]/60,i=e[1]/100,n=e[2]/100,r=Math.floor(t)%6,a=t-Math.floor(t),s=255*n*(1-i),o=255*n*(1-i*a),l=255*n*(1-i*(1-a));switch(n*=255,r){case 0:return[n,l,s];case 1:return[o,n,s];case 2:return[s,n,l];case 3:return[s,o,n];case 4:return[l,s,n];case 5:return[n,s,o]}},a.hsv.hsl=function(e){let t,i,n=e[0],r=e[1]/100,a=e[2]/100,s=Math.max(a,.01);i=(2-r)*a;let o=(2-r)*s;return[n,100*(t=(t=r*s/(o<=1?o:2-o))||0),100*(i/=2)]},a.hwb.rgb=function(e){let t,i,n,r,a=e[0]/360,s=e[1]/100,o=e[2]/100,l=s+o;l>1&&(s/=l,o/=l);let u=Math.floor(6*a),c=1-o;t=6*a-u,(1&u)!=0&&(t=1-t);let d=s+t*(c-s);switch(u){default:case 6:case 0:i=c,n=d,r=s;break;case 1:i=d,n=c,r=s;break;case 2:i=s,n=c,r=d;break;case 3:i=s,n=d,r=c;break;case 4:i=d,n=s,r=c;break;case 5:i=c,n=s,r=d}return[255*i,255*n,255*r]},a.cmyk.rgb=function(e){let t=e[0]/100,i=e[1]/100,n=e[2]/100,r=e[3]/100;return[255*(1-Math.min(1,t*(1-r)+r)),255*(1-Math.min(1,i*(1-r)+r)),255*(1-Math.min(1,n*(1-r)+r))]},a.xyz.rgb=function(e){let t,i,n,r=e[0]/100,a=e[1]/100,s=e[2]/100;return t=(t=3.2406*r+-1.5372*a+-.4986*s)>.0031308?1.055*t**(1/2.4)-.055:12.92*t,i=(i=-.9689*r+1.8758*a+.0415*s)>.0031308?1.055*i**(1/2.4)-.055:12.92*i,n=(n=.0557*r+-.204*a+1.057*s)>.0031308?1.055*n**(1/2.4)-.055:12.92*n,[255*(t=Math.min(Math.max(0,t),1)),255*(i=Math.min(Math.max(0,i),1)),255*(n=Math.min(Math.max(0,n),1))]},a.xyz.lab=function(e){let t=e[0],i=e[1],n=e[2];return t/=95.047,i/=100,n/=108.883,[116*(i=i>.008856?i**(1/3):7.787*i+16/116)-16,500*((t=t>.008856?t**(1/3):7.787*t+16/116)-i),200*(i-(n=n>.008856?n**(1/3):7.787*n+16/116))]},a.lab.xyz=function(e){let t,i,n,r=e[0],a=e[1],s=e[2];t=a/500+(i=(r+16)/116),n=i-s/200;let o=i**3,l=t**3,u=n**3;return i=(o>.008856?o:(i-16/116)/7.787)*100,[t=(l>.008856?l:(t-16/116)/7.787)*95.047,i,n=(u>.008856?u:(n-16/116)/7.787)*108.883]},a.lab.lch=function(e){let t,i=e[0],n=e[1],r=e[2];return(t=360*Math.atan2(r,n)/2/Math.PI)<0&&(t+=360),[i,Math.sqrt(n*n+r*r),t]},a.lch.lab=function(e){let t=e[0],i=e[1],n=e[2]/360*2*Math.PI;return[t,i*Math.cos(n),i*Math.sin(n)]},a.rgb.ansi16=function(e,t=null){let[i,n,r]=e,s=null===t?a.rgb.hsv(e)[2]:t;if(0===(s=Math.round(s/50)))return 30;let o=30+(Math.round(r/255)<<2|Math.round(n/255)<<1|Math.round(i/255));return 2===s&&(o+=60),o},a.hsv.ansi16=function(e){return a.rgb.ansi16(a.hsv.rgb(e),e[2])},a.rgb.ansi256=function(e){let t=e[0],i=e[1],n=e[2];return t===i&&i===n?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(i/255*5)+Math.round(n/255*5)},a.ansi16.rgb=function(e){let t=e%10;if(0===t||7===t)return e>50&&(t+=3.5),[t=t/10.5*255,t,t];let i=(~~(e>50)+1)*.5;return[(1&t)*i*255,(t>>1&1)*i*255,(t>>2&1)*i*255]},a.ansi256.rgb=function(e){let t;if(e>=232){let t=(e-232)*10+8;return[t,t,t]}return[Math.floor((e-=16)/36)/5*255,Math.floor((t=e%36)/6)/5*255,t%6/5*255]},a.rgb.hex=function(e){let t=(((255&Math.round(e[0]))<<16)+((255&Math.round(e[1]))<<8)+(255&Math.round(e[2]))).toString(16).toUpperCase();return"000000".substring(t.length)+t},a.hex.rgb=function(e){let t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];let i=t[0];3===t[0].length&&(i=i.split("").map(e=>e+e).join(""));let n=parseInt(i,16);return[n>>16&255,n>>8&255,255&n]},a.rgb.hcg=function(e){let t,i=e[0]/255,n=e[1]/255,r=e[2]/255,a=Math.max(Math.max(i,n),r),s=Math.min(Math.min(i,n),r),o=a-s;return t=o<1?s/(1-o):0,[360*((o<=0?0:a===i?(n-r)/o%6:a===n?2+(r-i)/o:4+(i-n)/o)/6%1),100*o,100*t]},a.hsl.hcg=function(e){let t=e[1]/100,i=e[2]/100,n=i<.5?2*t*i:2*t*(1-i),r=0;return n<1&&(r=(i-.5*n)/(1-n)),[e[0],100*n,100*r]},a.hsv.hcg=function(e){let t=e[1]/100,i=e[2]/100,n=t*i,r=0;return n<1&&(r=(i-n)/(1-n)),[e[0],100*n,100*r]},a.hcg.rgb=function(e){let t=e[0]/360,i=e[1]/100,n=e[2]/100;if(0===i)return[255*n,255*n,255*n];let r=[0,0,0],a=t%1*6,s=a%1,o=1-s,l=0;switch(Math.floor(a)){case 0:r[0]=1,r[1]=s,r[2]=0;break;case 1:r[0]=o,r[1]=1,r[2]=0;break;case 2:r[0]=0,r[1]=1,r[2]=s;break;case 3:r[0]=0,r[1]=o,r[2]=1;break;case 4:r[0]=s,r[1]=0,r[2]=1;break;default:r[0]=1,r[1]=0,r[2]=o}return l=(1-i)*n,[(i*r[0]+l)*255,(i*r[1]+l)*255,(i*r[2]+l)*255]},a.hcg.hsv=function(e){let t=e[1]/100,i=t+e[2]/100*(1-t),n=0;return i>0&&(n=t/i),[e[0],100*n,100*i]},a.hcg.hsl=function(e){let t=e[1]/100,i=e[2]/100*(1-t)+.5*t,n=0;return i>0&&i<.5?n=t/(2*i):i>=.5&&i<1&&(n=t/(2*(1-i))),[e[0],100*n,100*i]},a.hcg.hwb=function(e){let t=e[1]/100,i=t+e[2]/100*(1-t);return[e[0],(i-t)*100,(1-i)*100]},a.hwb.hcg=function(e){let t=e[1]/100,i=1-e[2]/100,n=i-t,r=0;return n<1&&(r=(i-n)/(1-n)),[e[0],100*n,100*r]},a.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},a.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},a.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},a.gray.hsl=function(e){return[0,0,e[0]]},a.gray.hsv=a.gray.hsl,a.gray.hwb=function(e){return[0,100,e[0]]},a.gray.cmyk=function(e){return[0,0,0,e[0]]},a.gray.lab=function(e){return[e[0],0,0]},a.gray.hex=function(e){let t=255&Math.round(e[0]/100*255),i=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(i.length)+i},a.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]}},661443,(e,t,i)=>{let n=e.r(349779);t.exports=function(e){let t=function(e){let t=function(){let e={},t=Object.keys(n);for(let i=t.length,n=0;n<i;n++)e[t[n]]={distance:-1,parent:null};return e}(),i=[e];for(t[e].distance=0;i.length;){let e=i.pop(),r=Object.keys(n[e]);for(let n=r.length,a=0;a<n;a++){let n=r[a],s=t[n];-1===s.distance&&(s.distance=t[e].distance+1,s.parent=e,i.unshift(n))}}return t}(e),i={},r=Object.keys(t);for(let e=r.length,a=0;a<e;a++){let e=r[a];null!==t[e].parent&&(i[e]=function(e,t){let i=[t[e].parent,e],r=n[t[e].parent][e],a=t[e].parent;for(;t[a].parent;)i.unshift(t[a].parent),r=function(e,t){return function(i){return t(e(i))}}(n[t[a].parent][a],r),a=t[a].parent;return r.conversion=i,r}(e,t))}return i}},879559,(e,t,i)=>{let n=e.r(349779),r=e.r(661443),a={};Object.keys(n).forEach(e=>{a[e]={},Object.defineProperty(a[e],"channels",{value:n[e].channels}),Object.defineProperty(a[e],"labels",{value:n[e].labels});let t=r(e);Object.keys(t).forEach(i=>{let n,r,s=t[i];a[e][i]=(n=function(...e){let t=e[0];if(null==t)return t;t.length>1&&(e=t);let i=s(e);if("object"==typeof i)for(let e=i.length,t=0;t<e;t++)i[t]=Math.round(i[t]);return i},"conversion"in s&&(n.conversion=s.conversion),n),a[e][i].raw=(r=function(...e){let t=e[0];return null==t?t:(t.length>1&&(e=t),s(e))},"conversion"in s&&(r.conversion=s.conversion),r)})}),t.exports=a},704567,(e,t,i)=>{"use strict";let n,r=(e,t)=>(...i)=>{let n=e(...i);return`\u001B[${n+t}m`},a=(e,t)=>(...i)=>{let n=e(...i);return`\u001B[${38+t};5;${n}m`},s=(e,t)=>(...i)=>{let n=e(...i);return`\u001B[${38+t};2;${n[0]};${n[1]};${n[2]}m`},o=e=>e,l=(e,t,i)=>[e,t,i],u=(e,t,i)=>{Object.defineProperty(e,t,{get:()=>{let n=i();return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0}),n},enumerable:!0,configurable:!0})},c=(t,i,r,a)=>{void 0===n&&(n=e.r(879559));let s=10*!!a,o={};for(let[e,a]of Object.entries(n)){let n="ansi16"===e?"ansi":e;e===i?o[n]=t(r,s):"object"==typeof a&&(o[n]=t(a[i],s))}return o};Object.defineProperty(t,"exports",{enumerable:!0,get:function(){let e=new Map,t={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};for(let[i,n]of(t.color.gray=t.color.blackBright,t.bgColor.bgGray=t.bgColor.bgBlackBright,t.color.grey=t.color.blackBright,t.bgColor.bgGrey=t.bgColor.bgBlackBright,Object.entries(t))){for(let[i,r]of Object.entries(n))t[i]={open:`\u001B[${r[0]}m`,close:`\u001B[${r[1]}m`},n[i]=t[i],e.set(r[0],r[1]);Object.defineProperty(t,i,{value:n,enumerable:!1})}return Object.defineProperty(t,"codes",{value:e,enumerable:!1}),t.color.close="\x1b[39m",t.bgColor.close="\x1b[49m",u(t.color,"ansi",()=>c(r,"ansi16",o,!1)),u(t.color,"ansi256",()=>c(a,"ansi256",o,!1)),u(t.color,"ansi16m",()=>c(s,"rgb",l,!1)),u(t.bgColor,"ansi",()=>c(r,"ansi16",o,!0)),u(t.bgColor,"ansi256",()=>c(a,"ansi256",o,!0)),u(t.bgColor,"ansi16m",()=>c(s,"rgb",l,!0)),t}})},981018,(e,t,i)=>{"use strict";t.exports={stringReplaceAll:(e,t,i)=>{let n=e.indexOf(t);if(-1===n)return e;let r=t.length,a=0,s="";do s+=e.substr(a,n-a)+t+i,a=n+r,n=e.indexOf(t,a);while(-1!==n)return s+e.substr(a)},stringEncaseCRLFWithFirstIndex:(e,t,i,n)=>{let r=0,a="";do{let s="\r"===e[n-1];a+=e.substr(r,(s?n-1:n)-r)+t+(s?"\r\n":"\n")+i,r=n+1,n=e.indexOf("\n",r)}while(-1!==n)return a+e.substr(r)}}},529166,(e,t,i)=>{"use strict";let n,r=e.r(704567),{stdout:a,stderr:s}=e.r(181042),{stringReplaceAll:o,stringEncaseCRLFWithFirstIndex:l}=e.r(981018),{isArray:u}=Array,c=["ansi","ansi","ansi256","ansi16m"],d=Object.create(null);class p{constructor(e){return h(e)}}let h=e=>{let t={};return((e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3))throw Error("The `level` option should be an integer from 0 to 3");let i=a?a.level:0;e.level=void 0===t.level?i:t.level})(t,e),t.template=(...e)=>S(t.template,...e),Object.setPrototypeOf(t,f.prototype),Object.setPrototypeOf(t.template,t),t.template.constructor=()=>{throw Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},t.template.Instance=p,t.template};function f(e){return h(e)}for(let[e,t]of Object.entries(r))d[e]={get(){let i=g(this,v(t.open,t.close,this._styler),this._isEmpty);return Object.defineProperty(this,e,{value:i}),i}};d.visible={get(){let e=g(this,this._styler,!0);return Object.defineProperty(this,"visible",{value:e}),e}};let m=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(let e of m)d[e]={get(){let{level:t}=this;return function(...i){return g(this,v(r.color[c[t]][e](...i),r.color.close,this._styler),this._isEmpty)}}};for(let e of m)d["bg"+e[0].toUpperCase()+e.slice(1)]={get(){let{level:t}=this;return function(...i){return g(this,v(r.bgColor[c[t]][e](...i),r.bgColor.close,this._styler),this._isEmpty)}}};let y=Object.defineProperties(()=>{},{...d,level:{enumerable:!0,get(){return this._generator.level},set(e){this._generator.level=e}}}),v=(e,t,i)=>{let n,r;return void 0===i?(n=e,r=t):(n=i.openAll+e,r=t+i.closeAll),{open:e,close:t,openAll:n,closeAll:r,parent:i}},g=(e,t,i)=>{let n=(...e)=>u(e[0])&&u(e[0].raw)?T(n,S(n,...e)):T(n,1===e.length?""+e[0]:e.join(" "));return Object.setPrototypeOf(n,y),n._generator=e,n._styler=t,n._isEmpty=i,n},T=(e,t)=>{if(e.level<=0||!t)return e._isEmpty?"":t;let i=e._styler;if(void 0===i)return t;let{openAll:n,closeAll:r}=i;if(-1!==t.indexOf("\x1b"))for(;void 0!==i;)t=o(t,i.close,i.open),i=i.parent;let a=t.indexOf("\n");return -1!==a&&(t=l(t,r,n,a)),n+t+r},S=(t,...i)=>{let[r]=i;if(!u(r)||!u(r.raw))return i.join(" ");let a=i.slice(1),s=[r.raw[0]];for(let e=1;e<r.length;e++)s.push(String(a[e-1]).replace(/[{}\\]/g,"\\$&"),String(r.raw[e]));return void 0===n&&(n=e.r(12842)),n(t,s.join(""))};Object.defineProperties(f.prototype,d);let E=h(void 0);E.supportsColor=a,E.stderr=h({level:s?s.level:0}),E.stderr.supportsColor=s,t.exports=E},603206,(e,t,i)=>{"use strict";var n=e.e&&e.e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(i,"__esModule",{value:!0}),i.DebugLogger=i.newDebugLogger=void 0;let r=n(e.r(529166)),a=e.r(331484);function s(e){let t="";for(let i=0;i<e;i++)t+=r.default.blackBright("⎸ ");return t}let o=0,l="",u=0,c=[];i.newDebugLogger=function(t){let i,n,r=(i=process.env.APOLLO_FEDERATION_DEBUG,void 0!==(n=(0,a.validateStringContainsBoolean)(i))?n:i.split(",").map(e=>e.trim()).includes(t)),s=new d(t,r);if(r)for(let i of(e.g.console=e.r(611913),c.push(s),u=Math.max(u,t.length),c))d.prototype.updateHeader.call(i,u);return s};class d{constructor(e,t){this.name=e,this.enabled=t,this.header=r.default.blackBright(`[${e}] `)}updateHeader(e){let t="";if(e>this.name.length){let i=e-this.name.length;for(let e=0;e<i;e++)t+=" "}this.header=r.default.blackBright("["+t+this.name+"] ")}doLog(e){let t=this.header+l,i=e.replace(/\n/g,"\n"+t+" ");console.log(t+i)}log(e,t=r.default.yellow("• ")){return this.enabled&&("string"!=typeof e&&(e=e()),this.doLog(t+e)),this}groupedValues(e,t,i){if(!this.enabled)return this;for(let n of(this.group(i),e))this.doLog("- "+t(n));return this.groupEnd()}groupedEntries(e,t,i){if(!this.enabled)return this;for(let[n,r]of(this.group(),e.entries()))this.doLog("- "+t(n)+": "+i(r));return this.groupEnd()}group(e){return this.enabled&&(e&&this.log(e,r.default.blue("‣ ")),l=s(++o)),this}groupEnd(e){return this.enabled&&(o>0&&(l=s(--o)),e&&this.log(e,r.default.green("⇒ "))),this}}i.DebugLogger=d},105714,(e,t,i)=>{"use strict";var n=e.e&&e.e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(i,"__esModule",{value:!0}),i.extractSubgraphsFromSupergraph=i.extractSubgraphsNamesAndUrlsFromSupergraph=void 0;let r=e.r(168032),a=e.r(951071),s=e.r(785576),o=e.r(951071),l=e.r(331484),u=e.r(629644),c=e.r(826468),d=e.r(678270),p=e.r(383105),h=e.r(738207),f=n(e.r(522734)),m=n(e.r(814747)),y=e.r(331484),v=e.r(378422);function g(e,t){let i=new o.Subgraphs,n=t.graphDirective(e),r=t.graphEnum(e),s=new Map;for(let e of r.values){let t=e.appliedDirectivesOf(n);if(!t.length)throw Error(`Value ${e} of join__Graph enum has no @join__graph directive`);let r=t[0].arguments(),l=new o.Subgraph(r.name,r.url,(0,a.newEmptyFederation2Schema)());i.add(l),s.set(e.name,r.name)}return[i,s]}i.extractSubgraphsNamesAndUrlsFromSupergraph=function(e){let[t,i]=(0,u.validateSupergraph)(e),[n]=g(e,i);return n.values().map(e=>({name:e.name,url:e.url}))};class T{constructor(e,t){this.originalError=e,this.subgraph=t}}function S(e,t){if(!e)return[];let i=[];return(0,h.parseSelectionSet)({parentType:t,source:e,fieldAccessor:(e,t)=>{let n=e.field(t);return n&&i.push((0,r.baseType)(n.type)),n},validate:!1}),i}function E(e,t,i){var n;let{supergraph:a,getSubgraph:s,getSubgraphEnumValue:o}=i;(0,l.assert)(t.length>0,`Missing @join__type on ${e}`);let u=new Map;for(let i of t){let{graph:t,key:n,extension:a,resolvable:o,isInterfaceObject:c}=i.arguments(),d=u.get(t);if(!d){let n=s(i);(0,l.assert)(n,()=>`Should have found the subgraph for ${i}`);let a=c?"ObjectType":e.kind,o=n.schema.addType((0,r.newNamedType)(a,e.name));c&&o.applyDirective("interfaceObject"),d={type:o,subgraph:n},u.set(t,d)}if(n){let e=d.type.applyDirective("key",{fields:n,resolvable:o});a&&e.setOfExtension(d.type.newExtension())}}let c=null==(n=i.contextSpec)?void 0:n.contextDirective(a);if(c)for(let t of e.appliedDirectivesOf(c)){let{name:e}=t.arguments(),i=e.match(/^(.*)__([A-Za-z]\w*)$/),n=i?i[1]:void 0,r=i?i[2]:void 0;(0,l.assert)(n,`Invalid context name ${e} found in ${t} on ${t.parent}: does not match the expected pattern`);let a=u.get(o(n)),s=null==a?void 0:a.subgraph.metadata().contextDirective();a&&s&&(0,v.isFederationDirectiveDefinedInSchema)(s)&&a.type.applyDirective(s,{name:r})}return u}i.extractSubgraphsFromSupergraph=function(e,t=!0){let[i,n,o,c]=(0,u.validateSupergraph)(e),h=n.version.equals(new s.FeatureVersion(0,1));try{var v;let[s,u]=g(e,n),p=new Map;for(let[e,t]of u.entries())p.set(t,e);let f=(v=i.coreDefinition,e.types().filter(e=>!n.isSpecType(e)&&!v.isSpecType(e))),m={supergraph:e,subgraphs:s,joinSpec:n,contextSpec:o,costSpec:c,filteredTypes:f,getSubgraph:e=>{let t=e.arguments().graph;if(!t)return;let i=u.get(t);(0,l.assert)(i,()=>`Invalid graph name ${t} found in ${e} on ${e.parent}: does not match a graph defined in the @join__Graph enum`);let n=s.get(i);return(0,l.assert)(n,"All subgraphs should have been created by `collectEmptySubgraphs`"),n},getSubgraphEnumValue:e=>{let t=p.get(e);return(0,l.assert)(t,()=>`Invalid subgraph name ${e} found: does not match a subgraph defined in the @join__Graph enum`),t}};for(let e of(h?function({supergraph:e,subgraphs:t,joinSpec:i,filteredTypes:n,getSubgraph:s}){let o=i.typeDirective(e),u=i.ownerDirective(e),c=i.fieldDirective(e),p=function(e,t,i,n){let a=new Map;for(let s of t){let t=new Set;!function(e,t,i,n,a){let s=new Set,o=e.schemaDefinition.roots().map(e=>e.type);for(let i of e.types()){let{isEntityWithKeyInSubgraph:e,typesInFederationDirectives:n}=a(i,t);e&&o.push(i),n.forEach(e=>o.push(e))}for(;o.length>0;){let e=o.pop();if(i(e),!s.has(e.name))switch(s.add(e.name),e.kind){case"InterfaceType":e.allImplementations().forEach(e=>o.push(e));case"ObjectType":for(let i of(e.interfaces().forEach(e=>o.push(e)),e.fields())){let{isInSubgraph:e,typesInFederationDirectives:a}=n(i,t);e&&(i.arguments().forEach(e=>o.push((0,r.baseType)(e.type))),o.push((0,r.baseType)(i.type)),a.forEach(e=>o.push(e)))}break;case"InputObjectType":for(let i of e.fields()){let{isInSubgraph:e,typesInFederationDirectives:a}=n(i,t);e&&(o.push((0,r.baseType)(i.type)),a.forEach(e=>o.push(e)))}break;case"UnionType":e.members().forEach(e=>o.push(e.type))}}for(let t of e.directives())t.hasExecutableLocations()&&t.arguments().forEach(e=>o.push((0,r.baseType)(e.type)))}(e,s,e=>t.add(e.name),i,n),a.set(s,t)}return a}(e,t.names(),(e,t)=>{var i;let n=e.appliedDirectivesOf(c);if(n.length){let i=n.find(e=>{var i;return(null==(i=s(e))?void 0:i.name)===t});if(!i)return{isInSubgraph:!1,typesInFederationDirectives:[]};{let t=i.arguments();return{isInSubgraph:!0,typesInFederationDirectives:S(t.provides,(0,r.baseType)(e.type)).concat(S(t.requires,e.parent))}}}{let n=u?e.parent.appliedDirectivesOf(u):[];return{isInSubgraph:!n.length||(null==(i=s(n[0]))?void 0:i.name)==t,typesInFederationDirectives:[]}}},(e,t)=>{let i=e.appliedDirectivesOf(o).find(e=>{var i;return e.arguments().key&&(null==(i=s(e))?void 0:i.name)===t});return i?{isEntityWithKeyInSubgraph:!0,typesInFederationDirectives:S(i.arguments().key,e)}:{isEntityWithKeyInSubgraph:!1,typesInFederationDirectives:[]}}),h=(e,t)=>{var i,n;return null!=(n=null==(i=p.get(t))?void 0:i.has(e.name))&&n};for(let e of n){let i=e.appliedDirectivesOf(o);if(i.length)for(let t of i){let i=t.arguments(),n=s(t);(0,l.assert)(n,()=>`Should have found the subgraph for ${t}`);let a=n.schema,o=a.type(e.name);if(!o){let t=i.isInterfaceObject?"ObjectType":e.kind;o=a.addType((0,r.newNamedType)(t,e.name)),i.isInterfaceObject&&o.applyDirective("interfaceObject")}if(i.key){let{resolvable:e}=i,t=o.applyDirective("key",{fields:i.key,resolvable:e});i.extension&&t.setOfExtension(o.newExtension())}}else for(let i of t)h(e,i.name)&&i.schema.addType((0,r.newNamedType)(e.kind,e.name))}for(let e of n)switch(e.kind){case"ObjectType":case"InterfaceType":for(let i of e.interfaceImplementations()){let n=i.interface.name;for(let i of t){let t=i.schema.type(e.name),r=i.schema.type(n);t&&r&&t.addImplementedInterface(n)}}case"InputObjectType":for(let i of e.fields()){let n=i.appliedDirectivesOf(c);if(n.length){let t=(0,r.isObjectType)(e)&&n.length>1;for(let e of n){let n=s(e);n&&A(i,n,t,e.arguments())}}else{let n=u?e.appliedDirectivesOf(u):[];if(n.length>0){(0,l.assert)(1==n.length,()=>`Found multiple join__owner directives on type ${e}`);let t=s(n[0]);(0,l.assert)(t,()=>`Should have found the subgraph for ${n[0]}`),A(i,t,!1)}else{let n=(0,r.baseType)(i.type),a=(0,r.isObjectType)(e)&&t.values().filter(t=>t.schema.type(e.name)).length>1;for(let e of t)e.schema.type(n.name)&&A(i,e,a)}}}break;case"EnumType":for(let i of t){let t=i.schema.type(e.name);if(t)for(let i of((0,l.assert)((0,r.isEnumType)(t),()=>`${t} should be an enum but found a ${t.kind}`),e.values))t.addValue(i.name)}break;case"UnionType":for(let i of t){let t=i.schema.type(e.name);if(t)for(let n of((0,l.assert)((0,r.isUnionType)(t),()=>`${t} should be an enum but found a ${t.kind}`),e.types().map(e=>e.name))){let e=i.schema.type(n);e&&t.addType(e)}}}let f=e.directives().filter(e=>e.hasExecutableLocations());for(let i of t)for(let t of(function(e,t,i){let n=e.metadata();for(let o of e.schema.types())if((0,r.isObjectType)(o)||(0,r.isInterfaceType)(o)){for(let r of o.appliedDirectivesOf(n.keyDirective())){let n=i||!!r.ofExtension();w(e,o,r,t,n)}for(let i of o.fields()){for(let r of i.appliedDirectivesOf(n.requiresDirective()))w(e,o,r,t);let a=(0,r.baseType)(i.type);for(let s of i.appliedDirectivesOf(n.providesDirective()))(0,l.assert)((0,r.isObjectType)(a)||(0,r.isInterfaceType)(a),()=>`Found @provides on field ${i.coordinate} whose type ${i.type} (${a.kind}) is not an object or interface `),w(e,a,s,t)}var a=n,s=o;for(let e of s.interfaces())for(let t of e.fields()){let e=s.field(t.name);e?e.hasAppliedDirective(a.externalDirective())&&function(e,t){(0,d.isSubtype)(t.type,e.type)||((0,l.assert)((0,d.isSubtype)(e.type,t.type),()=>`For ${e.coordinate}, expected ${t.type} and ${e.type} to be in a subtyping relationship`),e.type=t.type)}(e,t):function(e,t,i){let n=i.addField(t.name,t.type);for(let e of t.arguments())n.addArgument(e.name,e.type,e.defaultValue);n.applyDirective(e.externalDirective())}(a,t,s)}}}(i,e,!0),(0,a.removeInactiveProvidesAndRequires)(i.schema),L(i.schema),f))(0,r.copyDirectiveDefinitionToSchema)({definition:t,schema:i.schema,copyDirectiveApplicationsInArguments:!1,locationFilter:e=>(0,r.isExecutableDirectiveLocation)(e)})}(m):function(e){let{objOrItfTypes:t,inputObjTypes:i,enumTypes:n,unionTypes:s}=function(e){let{supergraph:t,joinSpec:i,filteredTypes:n,getSubgraph:a}=e,s=i.typeDirective(t),o=[],u=[],c=[],d=[];for(let t of n){let i=t.appliedDirectivesOf(s);switch(t.kind){case"InterfaceType":case"ObjectType":o.push({type:t,subgraphsInfo:E(t,t.appliedDirectivesOf(s),e)});break;case"InputObjectType":u.push({type:t,subgraphsInfo:E(t,t.appliedDirectivesOf(s),e)});break;case"EnumType":c.push({type:t,subgraphsInfo:E(t,t.appliedDirectivesOf(s),e)});break;case"UnionType":d.push({type:t,subgraphsInfo:E(t,t.appliedDirectivesOf(s),e)});break;case"ScalarType":for(let n of i){let i=a(n);(0,l.assert)(i,()=>`Should have found the subgraph for ${n}`);let s=i.schema.addType((0,r.newNamedType)(t.kind,t.name));e.costSpec&&b(t,s,i,e.costSpec)}}}return{objOrItfTypes:o,inputObjTypes:u,enumTypes:c,unionTypes:d}}(e);!function(e,t){let i=e.joinSpec.fieldDirective(e.supergraph),n=e.joinSpec.implementsDirective(e.supergraph);for(let{type:a,subgraphsInfo:s}of((0,l.assert)(n,"@join__implements should existing for a fed2 supergraph"),t)){for(let e of a.appliedDirectivesOf(n)){let t=e.arguments();s.get(t.graph).type.addImplementedInterface(t.interface)}if(e.costSpec)for(let{type:t,subgraph:i}of s.values())b(a,t,i,e.costSpec);for(let t of a.fields()){let n=t.appliedDirectivesOf(i);if(0===n.length){let i=(0,r.isObjectType)(a)&&s.size>1;for(let{type:n,subgraph:r}of s.values())_({field:t,type:n,subgraph:r,isShareable:i,costSpec:e.costSpec})}else{let i=(0,r.isObjectType)(a)&&n.filter(e=>{let t=e.arguments();return!t.external&&!t.usedOverridden}).length>1;for(let r of n){let n=r.arguments();if(!n.graph)continue;let{type:a,subgraph:o}=s.get(n.graph);_({field:t,type:a,subgraph:o,isShareable:i,joinFieldArgs:n,costSpec:e.costSpec})}}}}}(e,t);let o=e.joinSpec.fieldDirective(e.supergraph);for(let{type:t,subgraphsInfo:n}of i)for(let i of t.fields()){let t=i.appliedDirectivesOf(o);if(0===t.length)for(let{type:t,subgraph:r}of n.values())D({field:i,type:t,subgraph:r,costSpec:e.costSpec});else for(let r of t){let t=r.arguments();if(!t.graph)continue;let{type:a,subgraph:s}=n.get(t.graph);D({field:i,type:a,subgraph:s,joinFieldArgs:t,costSpec:e.costSpec})}}let u=e.joinSpec.enumValueDirective(e.supergraph);for(let{type:t,subgraphsInfo:i}of n){if(e.costSpec)for(let{type:n,subgraph:r}of i.values())b(t,n,r,e.costSpec);for(let e of t.values){let t=u?e.appliedDirectivesOf(u):[];if(0===t.length)for(let{type:t}of i.values())t.addValue(e.name);else for(let n of t){let t=n.arguments(),{type:r}=i.get(t.graph);r.addValue(e.name)}}}!function(e,t){let i=e.joinSpec.unionMemberDirective(e.supergraph);for(let{type:e,subgraphsInfo:n}of t){let t=i?e.appliedDirectivesOf(i):[];if(0===t.length)for(let{type:t,subgraph:i}of n.values())for(let n of e.types()){let e=i.schema.type(n.name);e&&t.addType(e)}else for(let e of t){let t=e.arguments(),{type:i,subgraph:r}=n.get(t.graph);i.addType(r.schema.type(t.member))}}}(e,s);let c=e.supergraph.directives().filter(e=>e.hasExecutableLocations());for(let t of e.subgraphs)for(let e of((0,a.removeInactiveProvidesAndRequires)(t.schema),L(t.schema),c))(0,r.copyDirectiveDefinitionToSchema)({definition:e,schema:t.schema,copyDirectiveApplicationsInArguments:!1,locationFilter:e=>(0,r.isExecutableDirectiveLocation)(e)})}(m),s))if(t)try{e.validate()}catch(t){throw new T(t,e)}else e.assumeValid();return[s,p]}catch(n){let e,t=n;n instanceof T&&(t=n.originalError,e=n.subgraph);let i=e?`subgraph "${e.name}"`:"subgraphs";if(h){let e=`Error extracting ${i} from the supergraph: this might be due to errors in subgraphs that were mistakenly ignored by federation 0.x versions but are rejected by federation 2.
|
|
20
|
+
${e}}`}}class P extends C{constructor(e,t){super(e),this._selectionSet=t,this.kind="FieldSelection"}get selectionSet(){return this._selectionSet}us(){return this}isTypenameField(){return this.element.definition.name===s.typenameFieldName}isPlainTypenameField(){return this.element.definition.name===s.typenameFieldName&&0==this.element.appliedDirectives.length&&!this.element.alias}withAttachment(e,t){let i=this.element.copy();return i.addAttachment(e,t),this.withUpdatedElement(i)}withUpdatedComponents(e,t){return this.element===e&&this.selectionSet===t?this:new P(e,t)}key(){return this.element.key()}optimize(e,t){let i,n=(0,s.baseType)(this.element.definition.type);if(!(0,s.isCompositeType)(n)||!this.selectionSet)return this;let r=t.forField(this.element),a=this.tryOptimizeSubselectionWithFragments({parentType:n,subSelection:this.selectionSet,fragments:e,validator:r,canUseFullMatchingFragment:e=>0===e.appliedDirectives.length});return i=(i=a instanceof S?R(n,new U(n,e,a,[])):a).optimizeSelections(e,r),this.selectionSet===i?this:this.withUpdatedSelectionSet(i)}filterRecursiveDepthFirst(e){if(!this.selectionSet)return e(this)?this:void 0;let t=this.selectionSet.filterRecursiveDepthFirst(e),i=this.selectionSet===t?this:new P(this.element,t);return e(i)?i:void 0}validate(e,t){var i;this.element.validate(e,t),h(this.element.isLeafField()||this.selectionSet&&!this.selectionSet.isEmpty(),()=>`Invalid empty selection set for field "${this.element.definition.coordinate}" of non-leaf type ${this.element.definition.type}`,this.element.definition.sourceAST),null==(i=this.selectionSet)||i.validate(e)}rebaseOn({parentType:e,fragments:t,errorIfCannotRebase:i}){if(this.element.parentType===e)return this;let n=this.element.rebaseOn({parentType:e,errorIfCannotRebase:i});if(!n)return;if(!this.selectionSet)return this.withUpdatedElement(n);let r=n.baseType();if(r===this.selectionSet.parentType)return this.withUpdatedElement(n);h((0,s.isCompositeType)(r),()=>`Cannot rebase field selection ${this} on ${e}: rebased field base return type ${r} is not composite`);let a=this.selectionSet.rebaseOn({parentType:r,fragments:t,errorIfCannotRebase:i});return a.isEmpty()?void 0:this.withUpdatedComponents(n,a)}canAddTo(e){if(this.element.parentType===e)return!0;let t=this.element.typeIfAddedTo(e);if(!t)return!1;let i=(0,s.baseType)(t);return!this.selectionSet||this.selectionSet.parentType===i||((0,c.assert)((0,s.isCompositeType)(i),()=>`${this.element} should have a selection set as it's type is not a composite`),this.selectionSet.selections().every(e=>e.canAddTo(i)))}toSelectionNode(){var e;let t=this.element.alias?{kind:a.Kind.NAME,value:this.element.alias}:void 0;return{kind:a.Kind.FIELD,name:{kind:a.Kind.NAME,value:this.element.name},alias:t,arguments:this.element.argumentsToNodes(),directives:this.element.appliedDirectivesToDirectiveNodes(),selectionSet:null==(e=this.selectionSet)?void 0:e.toSelectionSetNode()}}withoutDefer(e){return this.mapToSelectionSet(t=>t.withoutDefer(e))}withNormalizedDefer(e){return this.mapToSelectionSet(t=>t.withNormalizedDefer(e))}hasDefer(){var e;return!!(null==(e=this.selectionSet)?void 0:e.hasDefer())}normalize({parentType:e,recursive:t}){let i=e===this.parentType?this.element.definition:e.field(this.element.name);(0,c.assert)(i,`Cannot normalize ${this.element} at ${e} which does not have that field`);let n=this.element.definition===i?this.element:this.element.withUpdatedDefinition(i);if(!this.selectionSet)return this.withUpdatedElement(n);let r=n.baseType();(0,c.assert)((0,s.isCompositeType)(r),()=>`Field ${n} should not have a sub-selection`);let a=null==t||t?this.selectionSet.normalize({parentType:r}):this.selectionSet;return(null==a?void 0:a.isEmpty())?this.withUpdatedComponents(n,w(new y(r.typenameField(),void 0,[new s.Directive("include",{if:!1})]))):this.withUpdatedComponents(n,a)}expandFragments(e){return this.mapToSelectionSet(t=>t.expandFragments(e))}equals(e){return this===e||e instanceof P&&!!this.element.equals(e.element)&&(this.selectionSet?!!e.selectionSet&&this.selectionSet.equals(e.selectionSet):!e.selectionSet)}contains(e,t){return e instanceof P&&this.element.equals(e.element)?this.selectionSet?((0,c.assert)(e.selectionSet,"`this` and `that` have the same element, so if one has sub-selection, the other one should too"),this.selectionSet.contains(e.selectionSet,t)):((0,c.assert)(!e.selectionSet,"`this` and `that` have the same element, so if one does not have a sub-selection, neither should the other one"),n.EQUAL):n.NOT_CONTAINED}toString(e=!0,t){return(null!=t?t:"")+this.element+(this.selectionSet?" "+this.selectionSet.toString(e,!0,t):"")}}i.FieldSelection=P;class x extends C{constructor(){super(...arguments),this.kind="FragmentSelection"}us(){return this}validateDeferAndStream(){if(this.element.hasDefer()||this.element.hasStream()){let e=this.element.schema().schemaDefinition,t=this.parentType;h(e.rootType("mutation")!==t&&e.rootType("subscription")!==t,()=>{var i;return`The @defer and @stream directives cannot be used on ${null==(i=e.roots().filter(e=>e.type===t).pop())?void 0:i.rootKind} root type "${t}"`})}}filterRecursiveDepthFirst(e){let t=this.selectionSet.filterRecursiveDepthFirst(e),i=t===this.selectionSet?this:new M(this.element,t);return e(i)?i:void 0}hasDefer(){return this.element.hasDefer()||this.selectionSet.hasDefer()}normalize({parentType:e,recursive:t}){let i=this.element.typeCondition;if(i&&e!==this.parentType){let t=(0,s.possibleRuntimeTypes)(i),n=(0,s.possibleRuntimeTypes)(e);if(!t.some(e=>n.includes(e)))return}return this.normalizeKnowingItIntersects({parentType:e,recursive:t})}}i.FragmentSelection=x;class M extends x{constructor(e,t){super(e),this._selectionSet=t}get selectionSet(){return this._selectionSet}key(){return this.element.key()}withUpdatedComponents(e,t){return e===this.element&&t===this.selectionSet?this:new M(e,t)}validate(e){this.validateDeferAndStream(),h(!this.selectionSet.isEmpty(),()=>`Invalid empty selection set for fragment "${this.element}"`),this.selectionSet.validate(e)}rebaseOn({parentType:e,fragments:t,errorIfCannotRebase:i}){if(this.parentType===e)return this;let n=this.element.rebaseOn({parentType:e,errorIfCannotRebase:i});if(!n)return;let r=n.castedType();if(r===this.selectionSet.parentType)return this.withUpdatedElement(n);let a=this.selectionSet.rebaseOn({parentType:r,fragments:t,errorIfCannotRebase:i});return a.isEmpty()?void 0:this.withUpdatedComponents(n,a)}canAddTo(e){if(this.element.parentType===e)return!0;let t=this.element.castedTypeIfAddedTo(e);return!!t&&(this.selectionSet.parentType===t||this.selectionSet.selections().every(e=>e.canAddTo(t)))}toSelectionNode(){let e=this.element.typeCondition;return{kind:a.Kind.INLINE_FRAGMENT,typeCondition:e?{kind:a.Kind.NAMED_TYPE,name:{kind:a.Kind.NAME,value:e.name}}:void 0,directives:this.element.appliedDirectivesToDirectiveNodes(),selectionSet:this.selectionSet.toSelectionSetNode()}}optimize(e,t){let i=this.selectionSet,n=this.element.typeCondition;if(n){let r=this.tryOptimizeSubselectionWithFragments({parentType:n,subSelection:i,fragments:e,validator:t,canUseFullMatchingFragment:e=>0===e.appliedDirectives.length||(0,u.sameType)(n,e.typeCondition)&&e.appliedDirectives.every(e=>this.element.appliedDirectives.some(t=>(0,s.sameDirectiveApplication)(e,t)))});if(r instanceof S)if((0,u.sameType)(n,r.typeCondition)){let t=this.element.appliedDirectives;return r.appliedDirectives&&(t=t.filter(e=>!r.appliedDirectives.some(t=>(0,s.sameDirectiveApplication)(t,e)))),new U(this.parentType,e,r,t)}else i=R(n,new U(n,e,r,[]));else i=r}return i=i.optimizeSelections(e,t),this.selectionSet===i?this:new M(this.element,i)}withoutDefer(e){let t=this.selectionSet.withoutDefer(e),i=this.element.deferDirectiveArgs(),n=i&&(!e||i.label&&e.has(i.label));if(t===this.selectionSet&&!n)return this;let r=n?this.element.withoutDefer():this.element;return r?this.withUpdatedComponents(r,t):t}withNormalizedDefer(e){let t=this.element.withNormalizedDefer(e),i=this.selectionSet.withNormalizedDefer(e);return t?t===this.element&&i===this.selectionSet?this:this.withUpdatedComponents(t,i):i}normalizeKnowingItIntersects({parentType:e,recursive:t}){var i;let n,r=this.element.typeCondition;if(0===this.element.appliedDirectives.length&&(!r||e===this.element.typeCondition||(0,s.isObjectType)(e))){let i=this.selectionSet.normalize({parentType:e,recursive:t});return i.isEmpty()?void 0:i}if(null==t||t){if((n=this.selectionSet.normalize({parentType:null!=r?r:e})).isEmpty())if(0===this.element.appliedDirectives.length)return;else return this.withUpdatedComponents(this.element.rebaseOnOrError(e),w(new y((null!=(i=this.element.typeCondition)?i:e).typenameField(),void 0,[new s.Directive("include",{if:!1})])))}else n=this.selectionSet;if(0===this.element.appliedDirectives.length&&(0,s.isAbstractType)(r)){(0,c.assert)(!(0,s.isObjectType)(e),()=>`Should not have got here if ${e} is an object type`);let t=(0,s.possibleRuntimeTypes)(e),i=[];for(let e of n.selections())"FragmentSelection"===e.kind&&e.element.typeCondition&&(0,s.isObjectType)(e.element.typeCondition)&&t.includes(e.element.typeCondition)&&i.push(e);if(i.length===n.selections().length)return n;if(i.length>0){let t=new N;return t.add(i),t.add(this.withUpdatedSelectionSet(n.filter(e=>!i.includes(e)))),t.toSelectionSet(e)}}return this.parentType===e&&this.selectionSet===n?this:this.withUpdatedComponents(this.element.rebaseOnOrError(e),n)}expandFragments(e){return this.mapToSelectionSet(t=>t.expandFragments(e))}equals(e){return this===e||e instanceof x&&this.element.equals(e.element)&&this.selectionSet.equals(e.selectionSet)}contains(e,t){return e instanceof x&&this.element.equals(e.element)?this.selectionSet.contains(e.selectionSet,t):n.NOT_CONTAINED}toString(e=!0,t){return(null!=t?t:"")+this.element+" "+this.selectionSet.toString(e,!0,t)}}class U extends x{constructor(e,t,i,n){super(new v(e,i.typeCondition,i.appliedDirectives.concat(n))),this.fragments=t,this.namedFragment=i,this.spreadDirectives=n}isFragmentSpread(){return!0}get selectionSet(){return this.namedFragment.selectionSet}key(){return this.computedKey||(this.computedKey="..."+this.namedFragment.name+(0,s.directivesToString)(this.spreadDirectives)),this.computedKey}withUpdatedComponents(e,t){(0,c.assert)(!1,"Unsupported")}normalizeKnowingItIntersects({parentType:e}){return(0,c.assert)(e.schema()===this.parentType.schema(),"Should not try to normalize using a type from another schema"),this.rebaseOnOrError({parentType:e,fragments:this.fragments})}validate(){this.validateDeferAndStream(),h((0,s.runtimeTypesIntersects)(this.parentType,this.namedFragment.typeCondition),()=>`Fragment "${this.namedFragment.name}" cannot be spread inside type ${this.parentType} as the runtime types do not intersect ${this.namedFragment.typeCondition}`)}toSelectionNode(){let e=(0,s.directivesToDirectiveNodes)(this.spreadDirectives);return{kind:a.Kind.FRAGMENT_SPREAD,name:{kind:a.Kind.NAME,value:this.namedFragment.name},directives:e}}optimize(e,t){return this}rebaseOn({parentType:e,fragments:t,errorIfCannotRebase:i}){if(this.parentType===e)return this;let n=this.parentType.schema()===e.schema();(0,c.assert)(t||n,"Must provide fragments is rebasing on other schema");let r=null!=t?t:this.fragments,a=r.get(this.namedFragment.name);if(!a)return void h(!i,()=>`Cannot rebase ${this.toString(!1)} if it isn't part of the provided fragments`);if(!n&&!(0,s.runtimeTypesIntersects)(e,a.typeCondition)){let n=this.namedFragment.selectionSet.rebaseOn({parentType:e,fragments:t,errorIfCannotRebase:i});return n.isEmpty()?void 0:new M(new v(e),n)}return new U(e,r,a,this.spreadDirectives)}canAddTo(e){return!0}expandFragments(e){if(null==e?void 0:e.has(this.namedFragment.name))return this;let t=this.selectionSet.expandFragments(e);return(0,u.sameType)(this.parentType,this.namedFragment.typeCondition)&&0===this.element.appliedDirectives.length?t.selections():new M(this.element,t)}collectUsedFragmentNames(e){let t=e.get(this.namedFragment.name);e.set(this.namedFragment.name,void 0===t?1:t+1)}withoutDefer(e){(0,c.assert)(!1,"Unsupported, see `Operation.withAllDeferLabelled`")}withNormalizedDefer(e){(0,c.assert)(!1,"Unsupported, see `Operation.withAllDeferLabelled`")}minus(e){(0,c.assert)(this.equals(e),()=>`Invalid operation for ${this.toString(!1)} and ${e.toString(!1)}`)}equals(e){return this===e||e instanceof U&&this.namedFragment.name===e.namedFragment.name&&(0,s.sameDirectiveApplications)(this.spreadDirectives,e.spreadDirectives)}contains(e,t){return this.equals(e)?n.EQUAL:e instanceof x&&this.element.equals(e.element)?this.selectionSet.contains(e.selectionSet,t):n.NOT_CONTAINED}toString(e=!0,t){return e?(null!=t?t:"")+this.element+" "+this.selectionSet.toString(!0,!0,t):(null!=t?t:"")+"..."+this.namedFragment.name+(0,s.directivesToString)(this.spreadDirectives)}}function $(e,t,i,n,r=(e,t)=>e.field(t)){if(1===t.selections.length)return R(e,V(e,t.selections[0],i,n,r));let a=new N;for(let s of t.selections)a.add(V(e,s,i,n,r));return a.toSelectionSet(e,n)}function j(e,t){var i;return null!=(i=null==t?void 0:t.map(t=>{let i;return h(i=e.directive(t.name.value),()=>`Unknown directive "@${t.name.value}"`),new s.Directive(i.name,(0,d.argumentsFromAST)(i.coordinate,t.arguments,i))}))?i:[]}function V(e,t,i,n,r=(e,t)=>e.field(t)){var o,l;let u,c=j(e.schema(),t.directives);switch(t.kind){case a.Kind.FIELD:let p=r(e,t.name.value);h(p,()=>`Cannot query field "${t.name.value}" on type "${e}".`,e.sourceAST);let f=(0,s.baseType)(p.type),m=t.selectionSet?$(f,t.selectionSet,i,n,r):void 0;u=new P(new y(p,(0,d.argumentsFromAST)(p.coordinate,t.arguments,p),c,null==(o=t.alias)?void 0:o.value),m);break;case a.Kind.INLINE_FRAGMENT:let g=new v(e,null==(l=t.typeCondition)?void 0:l.name.value,c);u=new M(g,$(g.typeCondition?g.typeCondition:g.parentType,t.selectionSet,i,n,r));break;case a.Kind.FRAGMENT_SPREAD:let T=t.name.value;h(n,()=>`Cannot find fragment name "${T}" (no fragments were provided)`);let S=n.get(T);h(S,()=>`Cannot find fragment name "${T}" (provided fragments are: [${n.names().join(", ")}])`),u=new U(e,n,S,c)}return u}function G(e,t,i){let n,r,o=null==i?void 0:i.operationName,u=new E;t.definitions.forEach(t=>{switch(t.kind){case a.Kind.OPERATION_DEFINITION:h(!n||o,()=>"Must provide operation name if query contains multiple operations."),(!o||t.name&&t.name.value===o)&&(n=t,r=j(e,t.directives));break;case a.Kind.FRAGMENT_DEFINITION:let i=t.name.value,c=t.typeCondition.name.value,d=e.type(c);if(!d)throw l.ERRORS.INVALID_GRAPHQL.err(`Unknown type "${c}" for fragment "${i}"`,{nodes:t});if(!(0,s.isCompositeType)(d))throw l.ERRORS.INVALID_GRAPHQL.err(`Invalid fragment "${i}" on non-composite type "${c}"`,{nodes:t});u.add(new S(e,i,d,j(e,t.directives)))}}),h(n,()=>o?`Unknown operation named "${o}"`:"No operation found in provided document.");let c=n.variableDefinitions?(0,s.variableDefinitionsFromAST)(e,n.variableDefinitions):new s.VariableDefinitions;return t.definitions.forEach(e=>{if(e.kind===a.Kind.FRAGMENT_DEFINITION){let t=u.get(e.name.value);t.setSelectionSet($(t.typeCondition,e.selectionSet,c,u))}}),u.validate(c),function({schema:e,operation:t,operation_directives:i,variableDefinitions:n,fragments:r,validateInput:a}){var s;let o=e.schemaDefinition.root(t.operation);h(o,()=>`The schema has no "${t.operation}" root type defined`);let l=r.isEmpty()?void 0:r;return new T(e,t.operation,B({parentType:o.type,source:t.selectionSet,variableDefinitions:n,fragments:l,validate:a}),n,l,null==(s=t.name)?void 0:s.value,i)}({schema:e,operation:n,operation_directives:r,variableDefinitions:c,fragments:u,validateInput:null==i?void 0:i.validate})}function B({parentType:e,source:t,variableDefinitions:i=new s.VariableDefinitions,fragments:n,fieldAccessor:r,validate:a=!0}){let o=$(e,"string"==typeof t?K(t.trim().startsWith("{")?t:`{${t}}`).selectionSet:t,null!=i?i:new s.VariableDefinitions,n,r);return a&&o.validate(i),o}function K(e){let t=(0,a.parse)(e);h(1===t.definitions.length,()=>"Selections should contain a single definitions, found "+t.definitions.length);let i=t.definitions[0];return h(i.kind===a.Kind.OPERATION_DEFINITION,()=>"Expected an operation definition but got a "+i.kind),i}i.FragmentSpreadSelection=U,i.operationFromDocument=G,i.parseOperation=function(e,t,i){return G(e,(0,a.parse)(t),i)},i.parseSelectionSet=B,i.parseOperationAST=K,i.operationToDocument=function(e){var t;let i={kind:a.Kind.OPERATION_DEFINITION,operation:e.rootKind,name:e.name?{kind:a.Kind.NAME,value:e.name}:void 0,selectionSet:e.selectionSet.toSelectionSetNode(),variableDefinitions:e.variableDefinitions.toVariableDefinitionNodes(),directives:(0,s.directivesToDirectiveNodes)(e.appliedDirectives)},n=e.fragments?null==(t=e.fragments)?void 0:t.toFragmentDefinitionNodes():[];return{kind:a.Kind.DOCUMENT,definitions:[i].concat(n)}},i.hasSelectionWithPredicate=function e(t,i){for(let n of t.selections())if(i(n)||n.selectionSet&&e(n.selectionSet,i))return!0;return!1}},263554,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.computeShareables=void 0;let n=e.r(378422);i.computeShareables=function(e){let t=(0,n.federationMetadata)(e);(0,n.assert)(t,"Schema should be a federation subgraph");let i=t.keyDirective(),r=t.providesDirective(),a=t.isFed2Schema()?t.shareableDirective():void 0,s=new Set,o=e=>{for(let t of e.appliedDirectivesOf(i))(0,n.collectTargetFields)({parentType:e,directive:t,includeInterfaceFieldsImplementations:!0,validate:!1}).forEach(e=>s.add(e.coordinate))};for(let i of e.objectTypes()){o(i);let e=a?i.appliedDirectivesOf(a):[];for(let o of i.fields())for(let i of((a&&o.hasAppliedDirective(a)||e.length>0&&e.some(e=>o.ofExtension()===e.ofExtension()))&&s.add(o.coordinate),o.appliedDirectivesOf(r))){let e=(0,n.baseType)(o.type);(0,n.isCompositeType)(e)&&(0,n.collectTargetFields)({parentType:e,directive:i,includeInterfaceFieldsImplementations:!0,validate:!1}).forEach(e=>{t.isFieldExternal(e)&&s.add(e.coordinate)})}}for(let t of e.interfaceTypes())o(t);return e=>s.has(e.coordinate)}},255604,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.AUTHENTICATED_VERSIONS=i.AuthenticatedSpecDefinition=void 0;let n=e.r(186846),r=e.r(785576),a=e.r(343924),s=e.r(319894);class o extends r.FeatureDefinition{constructor(e,t){super(new r.FeatureUrl(o.identity,o.directiveName,e),t),this.registerDirective((0,a.createDirectiveSpecification)({name:o.directiveName,locations:[n.DirectiveLocation.FIELD_DEFINITION,n.DirectiveLocation.OBJECT,n.DirectiveLocation.INTERFACE,n.DirectiveLocation.SCALAR,n.DirectiveLocation.ENUM],composes:!0,supergraphSpecification:()=>i.AUTHENTICATED_VERSIONS.latest()}))}authenticatedDirective(e){return this.directive(e,o.directiveName)}get defaultCorePurpose(){return"SECURITY"}}i.AuthenticatedSpecDefinition=o,o.directiveName="authenticated",o.identity=`https://specs.apollo.dev/${o.directiveName}`,i.AUTHENTICATED_VERSIONS=new r.FeatureDefinitions(o.identity).add(new o(new r.FeatureVersion(0,1),new r.FeatureVersion(2,5))),(0,s.registerKnownFeature)(i.AUTHENTICATED_VERSIONS)},253636,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.ARGUMENT_COMPOSITION_STRATEGIES=i.convertEmptyToTrue=i.dnfConjunction=void 0;let n=e.r(168032),r=e.r(678270),a=e.r(367356);function s(e){return(t,i)=>{let n=e(t);return n.some(e=>(0,r.sameType)(e,i))?{valid:!0}:{valid:!1,supportedMsg:`type(s) ${n.join(", ")}`}}}function o(){return(e,t)=>(0,n.isNonNullType)(t)&&(0,n.isListType)(t.ofType)?{valid:!0}:{valid:!1,supportedMsg:"non nullable list types of any type"}}function l(e){return t=>{let i=t.filter(e=>null!=e);return i.length>0?e(i):void 0}}function u(e){return e.reduce((e,t)=>{let i=t.filter(t=>!e.some(e=>(0,a.valueEquals)(t,e)));return e.concat(i)},[])}function c(e){var t;let i,n;if(0==e.length)return[];for(let t=0;t<e.length;t++)e[t]=d(function(e){let t=Array(e.length);for(let i=0;i<e.length;i++)t[i]=e[i].slice();return t}(e[t]));let r=(t=e,i=[],n=new Set,t.forEach(e=>{e.forEach(e=>{e.sort()}),e.sort((e,t)=>{let i=JSON.stringify(e),n=JSON.stringify(t);return i>n?1:i<n?-1:0});let t=JSON.stringify(e);n.has(t)||(n.add(t),i.push(e))}),i),a=r[0];for(let e=1;e<r.length;e++){let t=r[e],i=[],n=new Set;for(let e of a)for(let r of t){let t=r.filter(t=>!e.includes(t)),a=[...e,...t].sort(),s=JSON.stringify(a);n.has(s)||(n.add(s),i.push(a))}a=function(e){let t=[];for(let i of(e.sort((e,t)=>e.length<t.length?-1:+(e.length>t.length)),e)){let e=new Set(i),n=!1;for(let i of t)if(i.every(t=>e.has(t))){n=!0;break}n||t.push(i)}return t}(i)}return a}function d(e){return 0===e.length?[[]]:e}i.dnfConjunction=c,i.convertEmptyToTrue=d,i.ARGUMENT_COMPOSITION_STRATEGIES={MAX:{name:"MAX",isTypeSupported:s(e=>[new n.NonNullType(e.intType())]),mergeValues:e=>Math.max(...e)},MIN:{name:"MIN",isTypeSupported:s(e=>[new n.NonNullType(e.intType())]),mergeValues:e=>Math.min(...e)},INTERSECTION:{name:"INTERSECTION",isTypeSupported:o(),mergeValues:e=>{var t;return null!=(t=e.reduce((e,t)=>void 0===e?t:e.filter(e=>t.some(t=>(0,a.valueEquals)(e,t))),void 0))?t:[]}},UNION:{name:"UNION",isTypeSupported:o(),mergeValues:u},NULLABLE_AND:{name:"NULLABLE_AND",isTypeSupported:s(e=>[e.booleanType(),new n.NonNullType(e.booleanType())]),mergeValues:l(e=>e.every(e=>e))},NULLABLE_MAX:{name:"NULLABLE_MAX",isTypeSupported:s(e=>[e.intType(),new n.NonNullType(e.intType())]),mergeValues:l(e=>Math.max(...e))},NULLABLE_UNION:{name:"NULLABLE_UNION",isTypeSupported:(e,t)=>(0,n.isListType)(t)||(0,n.isNonNullType)(t)&&(0,n.isListType)(t.ofType)?{valid:!0}:{valid:!1,supportedMsg:"list types of any type"},mergeValues:l(u)},DNF_CONJUNCTION:{name:"DNF_CONJUNCTION",isTypeSupported:(e,t)=>(0,n.isNonNullType)(t)&&(0,n.isListType)(t.ofType)&&(0,n.isNonNullType)(t.ofType.ofType)&&(0,n.isListType)(t.ofType.ofType.ofType)?{valid:!0}:{valid:!1,supportedMsg:"non nullable nested list types of any type"},mergeValues:c}}},484469,(e,t,i)=>{"use strict";var n;Object.defineProperty(i,"__esModule",{value:!0}),i.REQUIRES_SCOPES_VERSIONS=i.RequiresScopesSpecDefinition=i.RequiresScopesTypeName=void 0;let r=e.r(186846),a=e.r(785576),s=e.r(168032),o=e.r(343924),l=e.r(319894),u=e.r(253636),c=e.r(331484);(n||(i.RequiresScopesTypeName=n={})).SCOPE="Scope";class d extends a.FeatureDefinition{constructor(e){super(new a.FeatureUrl(d.identity,d.directiveName,e)),this.registerType((0,o.createScalarTypeSpecification)({name:n.SCOPE})),this.registerDirective((0,o.createDirectiveSpecification)({name:d.directiveName,args:[{name:"scopes",type:(e,t)=>{(0,c.assert)(t,"Shouldn't be added without being attached to a @link spec");let i=t.typeNameInSchema(n.SCOPE),r=e.type(i);return(0,c.assert)(r,()=>`Expected "${i}" to be defined`),new s.NonNullType(new s.ListType(new s.NonNullType(new s.ListType(new s.NonNullType(r)))))},compositionStrategy:u.ARGUMENT_COMPOSITION_STRATEGIES.DNF_CONJUNCTION}],locations:[r.DirectiveLocation.FIELD_DEFINITION,r.DirectiveLocation.OBJECT,r.DirectiveLocation.INTERFACE,r.DirectiveLocation.SCALAR,r.DirectiveLocation.ENUM],composes:!0,supergraphSpecification:()=>i.REQUIRES_SCOPES_VERSIONS.latest()}))}requiresScopesDirective(e){return this.directive(e,d.directiveName)}get defaultCorePurpose(){return"SECURITY"}}i.RequiresScopesSpecDefinition=d,d.directiveName="requiresScopes",d.identity=`https://specs.apollo.dev/${d.directiveName}`,i.REQUIRES_SCOPES_VERSIONS=new a.FeatureDefinitions(d.identity).add(new d(new a.FeatureVersion(0,1))),(0,l.registerKnownFeature)(i.REQUIRES_SCOPES_VERSIONS)},569186,(e,t,i)=>{"use strict";var n;Object.defineProperty(i,"__esModule",{value:!0}),i.POLICY_VERSIONS=i.PolicySpecDefinition=i.PolicyTypeName=void 0;let r=e.r(186846),a=e.r(785576),s=e.r(168032),o=e.r(343924),l=e.r(319894),u=e.r(253636),c=e.r(331484);(n||(i.PolicyTypeName=n={})).POLICY="Policy";class d extends a.FeatureDefinition{constructor(e){super(new a.FeatureUrl(d.identity,d.directiveName,e)),this.registerType((0,o.createScalarTypeSpecification)({name:n.POLICY})),this.registerDirective((0,o.createDirectiveSpecification)({name:d.directiveName,args:[{name:"policies",type:(e,t)=>{(0,c.assert)(t,"Shouldn't be added without being attached to a @link spec");let i=t.typeNameInSchema(n.POLICY),r=e.type(i);return(0,c.assert)(r,()=>`Expected "${i}" to be defined`),new s.NonNullType(new s.ListType(new s.NonNullType(new s.ListType(new s.NonNullType(r)))))},compositionStrategy:u.ARGUMENT_COMPOSITION_STRATEGIES.DNF_CONJUNCTION}],locations:[r.DirectiveLocation.FIELD_DEFINITION,r.DirectiveLocation.OBJECT,r.DirectiveLocation.INTERFACE,r.DirectiveLocation.SCALAR,r.DirectiveLocation.ENUM],composes:!0,supergraphSpecification:()=>i.POLICY_VERSIONS.latest()}))}policyDirective(e){return this.directive(e,d.directiveName)}get defaultCorePurpose(){return"SECURITY"}}i.PolicySpecDefinition=d,d.directiveName="policy",d.identity=`https://specs.apollo.dev/${d.directiveName}`,i.POLICY_VERSIONS=new a.FeatureDefinitions(d.identity).add(new d(new a.FeatureVersion(0,1))),(0,l.registerKnownFeature)(i.POLICY_VERSIONS)},994926,(e,t,i)=>{"use strict";var n,r;Object.defineProperty(i,"__esModule",{value:!0}),i.CONTEXT_VERSIONS=i.ContextSpecDefinition=i.ContextDirectiveName=void 0;let a=e.r(186846),s=e.r(785576),o=e.r(168032),l=e.r(343924),u=e.r(319894),c=e.r(331484);(r=n||(i.ContextDirectiveName=n={})).CONTEXT="context",r.FROM_CONTEXT="fromContext";let d="ContextFieldValue";class p extends s.FeatureDefinition{constructor(e){super(new s.FeatureUrl(p.identity,p.directiveName,e)),this.registerType((0,l.createScalarTypeSpecification)({name:d})),this.contextDirectiveSpec=(0,l.createDirectiveSpecification)({name:n.CONTEXT,locations:[a.DirectiveLocation.INTERFACE,a.DirectiveLocation.OBJECT,a.DirectiveLocation.UNION],args:[{name:"name",type:e=>new o.NonNullType(e.stringType())}],composes:!0,repeatable:!0,supergraphSpecification:e=>i.CONTEXT_VERSIONS.getMinimumRequiredVersion(e),staticArgumentTransform:(e,t)=>{let i=e.name;return{name:`${i}__${t.name}`}}}),this.fromContextDirectiveSpec=(0,l.createDirectiveSpecification)({name:n.FROM_CONTEXT,locations:[a.DirectiveLocation.ARGUMENT_DEFINITION],args:[{name:"field",type:(e,t)=>{(0,c.assert)(t,"Shouldn't be added without being attached to a @link spec");let i=t.typeNameInSchema(d),n=e.type(i);return(0,c.assert)(n,()=>`Expected "${i}" to be defined`),(0,c.assert)((0,o.isInputType)(n),`Expected "${i}" to be an input type`),n}}],composes:!1}),this.registerDirective(this.contextDirectiveSpec),this.registerDirective(this.fromContextDirectiveSpec)}get defaultCorePurpose(){return"SECURITY"}contextDirective(e){return this.directive(e,p.directiveName)}}i.ContextSpecDefinition=p,p.directiveName="context",p.identity=`https://specs.apollo.dev/${p.directiveName}`,i.CONTEXT_VERSIONS=new s.FeatureDefinitions(p.identity).add(new p(new s.FeatureVersion(0,1))),(0,u.registerKnownFeature)(i.CONTEXT_VERSIONS)},579034,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.COST_VERSIONS=i.CostSpecDefinition=i.costIdentity=void 0;let n=e.r(186846),r=e.r(343924),a=e.r(785576),s=e.r(168032),o=e.r(319894),l=e.r(253636);i.costIdentity="https://specs.apollo.dev/cost";class u extends a.FeatureDefinition{constructor(e,t){super(new a.FeatureUrl(i.costIdentity,"cost",e),t),this.minimumFederationVersion=t,this.registerDirective((0,r.createDirectiveSpecification)({name:"cost",locations:[n.DirectiveLocation.ARGUMENT_DEFINITION,n.DirectiveLocation.ENUM,n.DirectiveLocation.FIELD_DEFINITION,n.DirectiveLocation.INPUT_FIELD_DEFINITION,n.DirectiveLocation.OBJECT,n.DirectiveLocation.SCALAR],args:[{name:"weight",type:e=>new s.NonNullType(e.intType()),compositionStrategy:l.ARGUMENT_COMPOSITION_STRATEGIES.MAX}],composes:!0,repeatable:!1,supergraphSpecification:e=>i.COST_VERSIONS.getMinimumRequiredVersion(e)})),this.registerDirective((0,r.createDirectiveSpecification)({name:"listSize",locations:[n.DirectiveLocation.FIELD_DEFINITION],args:[{name:"assumedSize",type:e=>e.intType(),compositionStrategy:l.ARGUMENT_COMPOSITION_STRATEGIES.NULLABLE_MAX},{name:"slicingArguments",type:e=>new s.ListType(new s.NonNullType(e.stringType())),compositionStrategy:l.ARGUMENT_COMPOSITION_STRATEGIES.NULLABLE_UNION},{name:"sizedFields",type:e=>new s.ListType(new s.NonNullType(e.stringType())),compositionStrategy:l.ARGUMENT_COMPOSITION_STRATEGIES.NULLABLE_UNION},{name:"requireOneSlicingArgument",type:e=>e.booleanType(),defaultValue:!0,compositionStrategy:l.ARGUMENT_COMPOSITION_STRATEGIES.NULLABLE_AND}],composes:!0,repeatable:!1,supergraphSpecification:e=>i.COST_VERSIONS.getMinimumRequiredVersion(e)}))}costDirective(e){return this.directive(e,"cost")}listSizeDirective(e){return this.directive(e,"listSize")}}i.CostSpecDefinition=u,i.COST_VERSIONS=new a.FeatureDefinitions(i.costIdentity).add(new u(new a.FeatureVersion(0,1),new a.FeatureVersion(2,9))),(0,o.registerKnownFeature)(i.COST_VERSIONS)},379166,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.CACHE_TAG_VERSIONS=i.CacheTagSpecDefinition=i.CACHE_TAG=void 0;let n=e.r(785576);i.CACHE_TAG="cacheTag";class r extends n.FeatureDefinition{constructor(e,t){super(new n.FeatureUrl(r.identity,r.specName,e),t)}get defaultCorePurpose(){return"EXECUTION"}}i.CacheTagSpecDefinition=r,r.specName=i.CACHE_TAG,r.identity=`https://specs.apollo.dev/${r.specName}`,i.CACHE_TAG_VERSIONS=new n.FeatureDefinitions(r.identity).add(new r(new n.FeatureVersion(0,1)))},479209,(e,t,i)=>{"use strict";var n,r,a,s;Object.defineProperty(i,"__esModule",{value:!0}),i.FEDERATION_VERSIONS=i.FederationSpecDefinition=i.FEDERATION1_DIRECTIVES=i.FEDERATION1_TYPES=i.FederationDirectiveName=i.FederationTypeName=i.federationIdentity=void 0;let o=e.r(168032),l=e.r(785576),u=e.r(343924),c=e.r(186846),d=e.r(331484),p=e.r(193151),h=e.r(951071),f=e.r(319894),m=e.r(355415),y=e.r(255604),v=e.r(484469),g=e.r(569186),T=e.r(994926),S=e.r(579034),E=e.r(379166);i.federationIdentity="https://specs.apollo.dev/federation",(a=n||(i.FederationTypeName=n={})).FIELD_SET="FieldSet",a.CONTEXT_FIELD_VALUE="ContextFieldValue",(s=r||(i.FederationDirectiveName=r={})).KEY="key",s.EXTERNAL="external",s.REQUIRES="requires",s.PROVIDES="provides",s.EXTENDS="extends",s.SHAREABLE="shareable",s.OVERRIDE="override",s.TAG="tag",s.INACCESSIBLE="inaccessible",s.COMPOSE_DIRECTIVE="composeDirective",s.INTERFACE_OBJECT="interfaceObject",s.AUTHENTICATED="authenticated",s.REQUIRES_SCOPES="requiresScopes",s.POLICY="policy",s.CONTEXT="context",s.FROM_CONTEXT="fromContext",s.COST="cost",s.LIST_SIZE="listSize",s.CACHE_TAG="cacheTag";let I=(0,u.createScalarTypeSpecification)({name:n.FIELD_SET}),b={name:"fields",type:e=>{var t;let i;return t=e,i=(0,h.federationMetadata)(t),(0,d.assert)(i,"The schema is not a federation subgraph"),new o.NonNullType(i.fieldSetType())}},N=(0,u.createDirectiveSpecification)({name:r.KEY,locations:[c.DirectiveLocation.OBJECT,c.DirectiveLocation.INTERFACE],repeatable:!0,args:[b,{name:"resolvable",type:e=>e.booleanType(),defaultValue:!0}]}),_=(0,u.createDirectiveSpecification)({name:r.EXTENDS,locations:[c.DirectiveLocation.OBJECT,c.DirectiveLocation.INTERFACE]}),D=(0,u.createDirectiveSpecification)({name:r.EXTERNAL,locations:[c.DirectiveLocation.OBJECT,c.DirectiveLocation.FIELD_DEFINITION],args:[{name:"reason",type:e=>e.stringType()}]}),A=(0,u.createDirectiveSpecification)({name:r.REQUIRES,locations:[c.DirectiveLocation.FIELD_DEFINITION],args:[b]}),O=(0,u.createDirectiveSpecification)({name:r.PROVIDES,locations:[c.DirectiveLocation.FIELD_DEFINITION],args:[b]}),R=[I],w=[N,A,O,D,p.TAG_VERSIONS.find(new l.FeatureVersion(0,2)).tagDirectiveSpec,_];i.FEDERATION1_TYPES=R,i.FEDERATION1_DIRECTIVES=w;class L extends l.FeatureDefinition{constructor(e){for(const t of(super(new l.FeatureUrl(i.federationIdentity,"federation",e)),R))this.registerType(t);for(const e of w)this.registerDirective(e);this.registerDirective((0,u.createDirectiveSpecification)({name:r.SHAREABLE,locations:[c.DirectiveLocation.OBJECT,c.DirectiveLocation.FIELD_DEFINITION],repeatable:e.gte(new l.FeatureVersion(2,2))})),this.registerSubFeature(m.INACCESSIBLE_VERSIONS.getMinimumRequiredVersion(e)),e.gte(new l.FeatureVersion(2,7))?this.registerDirective((0,u.createDirectiveSpecification)({name:r.OVERRIDE,locations:[c.DirectiveLocation.FIELD_DEFINITION],args:[{name:"from",type:e=>new o.NonNullType(e.stringType())},{name:"label",type:e=>e.stringType()}]})):this.registerDirective((0,u.createDirectiveSpecification)({name:r.OVERRIDE,locations:[c.DirectiveLocation.FIELD_DEFINITION],args:[{name:"from",type:e=>new o.NonNullType(e.stringType())}]})),e.gte(new l.FeatureVersion(2,1))&&this.registerDirective((0,u.createDirectiveSpecification)({name:r.COMPOSE_DIRECTIVE,locations:[c.DirectiveLocation.SCHEMA],repeatable:!0,args:[{name:"name",type:e=>e.stringType()}]})),e.gte(new l.FeatureVersion(2,3))&&(this.registerDirective((0,u.createDirectiveSpecification)({name:r.INTERFACE_OBJECT,locations:[c.DirectiveLocation.OBJECT]})),this.registerSubFeature(p.TAG_VERSIONS.find(new l.FeatureVersion(0,3)))),e.gte(new l.FeatureVersion(2,5))&&(this.registerSubFeature(y.AUTHENTICATED_VERSIONS.find(new l.FeatureVersion(0,1))),this.registerSubFeature(v.REQUIRES_SCOPES_VERSIONS.find(new l.FeatureVersion(0,1)))),e.gte(new l.FeatureVersion(2,6))&&this.registerSubFeature(g.POLICY_VERSIONS.find(new l.FeatureVersion(0,1))),e.gte(new l.FeatureVersion(2,8))&&this.registerSubFeature(T.CONTEXT_VERSIONS.find(new l.FeatureVersion(0,1))),e.gte(new l.FeatureVersion(2,9))&&this.registerSubFeature(S.COST_VERSIONS.find(new l.FeatureVersion(0,1))),e.gte(new l.FeatureVersion(2,12))&&this.registerDirective((0,u.createDirectiveSpecification)({name:r.CACHE_TAG,locations:[c.DirectiveLocation.OBJECT,c.DirectiveLocation.FIELD_DEFINITION],repeatable:!0,args:[{name:"format",type:e=>new o.NonNullType(e.stringType())}],composes:!0,supergraphSpecification:e=>E.CACHE_TAG_VERSIONS.getMinimumRequiredVersion(e),useJoinDirective:!0}))}}i.FederationSpecDefinition=L,i.FEDERATION_VERSIONS=new l.FeatureDefinitions(i.federationIdentity).add(new L(new l.FeatureVersion(2,0))).add(new L(new l.FeatureVersion(2,1))).add(new L(new l.FeatureVersion(2,2))).add(new L(new l.FeatureVersion(2,3))).add(new L(new l.FeatureVersion(2,4))).add(new L(new l.FeatureVersion(2,5))).add(new L(new l.FeatureVersion(2,6))).add(new L(new l.FeatureVersion(2,7))).add(new L(new l.FeatureVersion(2,8))).add(new L(new l.FeatureVersion(2,9))).add(new L(new l.FeatureVersion(2,10))).add(new L(new l.FeatureVersion(2,11))).add(new L(new l.FeatureVersion(2,12))).add(new L(new l.FeatureVersion(2,13))).add(new L(new l.FeatureVersion(2,14))),(0,f.registerKnownFeature)(i.FEDERATION_VERSIONS)},63672,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.JOIN_VERSIONS=i.JoinSpecDefinition=i.joinIdentity=void 0;let n=e.r(186846),r=e.r(785576),a=e.r(168032),s=e.r(319894),o=e.r(331484);i.joinIdentity="https://specs.apollo.dev/join";class l extends r.FeatureDefinition{constructor(e,t){super(new r.FeatureUrl(i.joinIdentity,"join",e),t)}isV01(){return this.version.equals(new r.FeatureVersion(0,1))}addElementsToSchema(e){let t=this.addDirective(e,"graph").addLocations(n.DirectiveLocation.ENUM_VALUE);t.addArgument("name",new a.NonNullType(e.stringType())),t.addArgument("url",new a.NonNullType(e.stringType()));let i=this.addEnumType(e,"Graph"),s=this.addScalarType(e,"FieldSet"),o=this.addDirective(e,"type").addLocations(n.DirectiveLocation.OBJECT,n.DirectiveLocation.INTERFACE,n.DirectiveLocation.UNION,n.DirectiveLocation.ENUM,n.DirectiveLocation.INPUT_OBJECT,n.DirectiveLocation.SCALAR);this.isV01()||(o.repeatable=!0),o.addArgument("graph",new a.NonNullType(i)),o.addArgument("key",s),!this.isV01()&&(o.addArgument("extension",new a.NonNullType(e.booleanType()),!1),o.addArgument("resolvable",new a.NonNullType(e.booleanType()),!0),this.version.gte(new r.FeatureVersion(0,3))&&o.addArgument("isInterfaceObject",new a.NonNullType(e.booleanType()),!1));let l=this.addDirective(e,"field").addLocations(n.DirectiveLocation.FIELD_DEFINITION,n.DirectiveLocation.INPUT_FIELD_DEFINITION);l.repeatable=!0;let u=this.version.gte(new r.FeatureVersion(0,3))?i:new a.NonNullType(i);if(l.addArgument("graph",u),l.addArgument("requires",s),l.addArgument("provides",s),this.isV01()||(l.addArgument("type",e.stringType()),l.addArgument("external",e.booleanType()),l.addArgument("override",e.stringType()),l.addArgument("usedOverridden",e.booleanType())),!this.isV01()){let t=this.addDirective(e,"implements").addLocations(n.DirectiveLocation.OBJECT,n.DirectiveLocation.INTERFACE);t.repeatable=!0,t.addArgument("graph",new a.NonNullType(i)),t.addArgument("interface",new a.NonNullType(e.stringType()))}if(this.version.gte(new r.FeatureVersion(0,3))){let t=this.addDirective(e,"unionMember").addLocations(n.DirectiveLocation.UNION);t.repeatable=!0,t.addArgument("graph",new a.NonNullType(i)),t.addArgument("member",new a.NonNullType(e.stringType()));let r=this.addDirective(e,"enumValue").addLocations(n.DirectiveLocation.ENUM_VALUE);r.repeatable=!0,r.addArgument("graph",new a.NonNullType(i))}if(this.version.gte(new r.FeatureVersion(0,4))){let t=this.addDirective(e,"directive").addLocations(n.DirectiveLocation.SCHEMA,n.DirectiveLocation.OBJECT,n.DirectiveLocation.INTERFACE,n.DirectiveLocation.FIELD_DEFINITION);t.repeatable=!0,t.addArgument("graphs",new a.ListType(new a.NonNullType(i))),t.addArgument("name",new a.NonNullType(e.stringType())),t.addArgument("args",this.addScalarType(e,"DirectiveArguments")),l.addArgument("overrideLabel",e.stringType())}if(this.version.gte(new r.FeatureVersion(0,5))){let t=this.addScalarType(e,"FieldValue"),i=e.addType(new a.InputObjectType("join__ContextArgument"));i.addField("name",new a.NonNullType(e.stringType())),i.addField("type",new a.NonNullType(e.stringType())),i.addField("context",new a.NonNullType(e.stringType())),i.addField("selection",new a.NonNullType(t)),l.addArgument("contextArguments",new a.ListType(new a.NonNullType(i)))}return this.isV01()&&this.addDirective(e,"owner").addLocations(n.DirectiveLocation.OBJECT).addArgument("graph",new a.NonNullType(i)),[]}allElementNames(){let e=["graph","Graph","FieldSet","@type","@field"];return this.isV01()?e.push("@owner"):e.push("@implements"),e}populateGraphEnum(e,t){let i=new o.MultiMap;for(let e of t){let t=function(e){let t=e.replace(/[\W]/g,"_"),i=t.match(/^\d/)?"_"+t:t;return(i.match(/_\d+$/)?i+"_":i).toLocaleUpperCase()}(e.name);i.add(t,e)}let n=new Map;for(let[e,t]of i)if(1===t.length)n.set(t[0].name,e);else for(let[i,r]of t.entries())n.set(r.name,`${e}_${i+1}`);let r=this.graphEnum(e),a=this.graphDirective(e);for(let e of t)r.addValue(n.get(e.name)).applyDirective(a,{name:e.name,url:e.url});return n}fieldSetScalar(e){return this.type(e,"FieldSet")}graphEnum(e){return this.type(e,"Graph")}graphDirective(e){return this.directive(e,"graph")}directiveDirective(e){return this.directive(e,"directive")}typeDirective(e){return this.directive(e,"type")}implementsDirective(e){return this.directive(e,"implements")}fieldDirective(e){return this.directive(e,"field")}unionMemberDirective(e){return this.directive(e,"unionMember")}enumValueDirective(e){return this.directive(e,"enumValue")}ownerDirective(e){return this.directive(e,"owner")}get defaultCorePurpose(){return"EXECUTION"}}i.JoinSpecDefinition=l,i.JOIN_VERSIONS=new r.FeatureDefinitions(i.joinIdentity).add(new l(new r.FeatureVersion(0,1))).add(new l(new r.FeatureVersion(0,2))).add(new l(new r.FeatureVersion(0,3),new r.FeatureVersion(2,0))).add(new l(new r.FeatureVersion(0,4),new r.FeatureVersion(2,7))).add(new l(new r.FeatureVersion(0,5),new r.FeatureVersion(2,8))),(0,s.registerKnownFeature)(i.JOIN_VERSIONS)},951071,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.removeInactiveProvidesAndRequires=i.addSubgraphToError=i.addSubgraphToASTNode=i.Subgraph=i.FEDERATION_OPERATION_FIELDS=i.entitiesFieldName=i.serviceFieldName=i.FEDERATION_OPERATION_TYPES=i.entityTypeSpec=i.serviceTypeSpec=i.anyTypeSpec=i.Subgraphs=i.subgraphsFromServiceList=i.collectTargetFields=i.parseFieldSetArgument=i.newEmptyFederation2Schema=i.buildSubgraph=i.isInterfaceObjectType=i.isEntityType=i.isFederationField=i.isFederationSubgraphSchema=i.federationMetadata=i.printSubgraphNames=i.asFed2SubgraphDocument=i.FEDERATION2_LINK_WITH_AUTO_EXPANDED_IMPORTS_UPGRADED=i.FEDERATION2_LINK_WITH_AUTO_EXPANDED_IMPORTS=i.FEDERATION2_LINK_WITH_FULL_IMPORTS=i.setSchemaAsFed2Subgraph=i.FederationBlueprint=i.hasAppliedDirective=i.isFederationDirectiveDefinedInSchema=i.FederationMetadata=i.collectUsedFields=i.parseContext=i.FEDERATION_UNNAMED_SUBGRAPH_NAME=i.FEDERATION_RESERVED_SUBGRAPH_NAME=void 0;let n=e.r(168032),r=e.r(331484),a=e.r(359063),s=e.r(186846),o=e.r(939603),l=e.r(826468),u=e.r(738207),c=e.r(193151),d=e.r(408470),p=e.r(263554),h=e.r(785576),f=e.r(479209),m=e.r(383105),y=e.r(343924),v=e.r(308126),g=e.r(319894),T=e.r(63672),S=h.LINK_VERSIONS.latest(),E=c.TAG_VERSIONS.latest(),I=e=>{if(!e)return f.FEDERATION_VERSIONS.latest();let t=f.FEDERATION_VERSIONS.find(e);return(0,r.assert)(t,`Federation spec version ${e} is not known`),t},b=I(new h.FeatureVersion(2,4)),N=I();i.FEDERATION_RESERVED_SUBGRAPH_NAME="_",i.FEDERATION_UNNAMED_SUBGRAPH_NAME="<unnamed>";let _=[s.PossibleTypeExtensionsRule,s.KnownTypeNamesRule],D=[o.KnownTypeNamesInFederationRule],A=a.specifiedSDLRules.filter(e=>!_.includes(e)).concat(D),O=Object.values(f.FederationDirectiveName),R=new n.CoreFeature(new h.FeatureUrl("<fed1>","fed1",new h.FeatureVersion(0,1)),"fed1",new n.Directive("fed1"),f.FEDERATION1_TYPES.map(e=>({name:e.name,as:"_"+e.name})));function w(e,t,i){var r,a;let o=(0,n.sourceASTs)(e);t.nodes&&o.push(...t.nodes);let l=(0,d.errorCodeDef)(t);l&&l!==d.ERRORS.INVALID_GRAPHQL||(l=d.ERROR_CATEGORIES.DIRECTIVE_INVALID_FIELDS.get(e.name));let u=t.message.trim();return i&&(u=i(u)),l.err(`${(r=e,`On ${L(r)}, for ${(a=r).sourceAST?(0,s.print)(a.sourceAST):a.toString()}`)}: ${u}`,{nodes:o,originalError:t})}function L(e){var t;let i=e.parent instanceof n.FieldDefinition?"field":"type";return`${i} "${null==(t=e.parent)?void 0:t.coordinate}"`}function C(e){let t=e.match(/^(?:[\n\r\t ,]|#[^\n\r]*(?![^\n\r]))*\$(?:[\n\r\t ,]|#[^\n\r]*(?![^\n\r]))*([A-Za-z_]\w*(?!\w))([\s\S]*)$/);if(!t)return{context:void 0,selection:void 0};let[,i,n]=t;return{context:i,selection:n}}i.parseContext=C;let F=({originalType:e,resolvedType:t})=>{let i=[],r=e;for(;"NonNullType"===r.kind||"ListType"===r.kind;)i.push(r.kind),r=r.ofType;let a=t;for(;i.length>0;)"ListType"===i.pop()&&(a=new n.ListType(a));return a},k=({currentType:e,selectionSet:t,errorCollector:i,metadata:a,fromContextParent:s})=>{let o=t.selections(),l=a.interfaceObjectDirective();return"ObjectType"===e.kind&&G(l)&&e.appliedDirectivesOf(l).length>0&&i.push(d.ERRORS.CONTEXT_INVALID_SELECTION.err(`Context "is used in "${s.coordinate}" but the selection is invalid: One of the types in the selection is an interfaceObject: "${e.name}"`,{nodes:(0,n.sourceASTs)(s)})),o.map(e=>{if("FieldSelection"!==e.kind)return{resolvedType:void 0};let{element:t,selectionSet:o}=e;(0,r.assert)(t.definition.type,"Element type definition should exist");let l=t.definition.type;if(o){(0,r.assert)((0,n.isCompositeType)((0,n.baseType)(l)),"Child selection sets should only exist on composite types");let{resolvedType:e}=k({currentType:(0,n.baseType)(l),selectionSet:o,errorCollector:i,metadata:a,fromContextParent:s});return e?{resolvedType:F({originalType:l,resolvedType:e})}:{resolvedType:void 0}}return(0,r.assert)((0,n.isLeafType)((0,n.baseType)(l)),"Expected a leaf type"),{resolvedType:F({originalType:l,resolvedType:(0,n.baseType)(l)})}}).reduce((e,{resolvedType:t})=>{var i;return(null==(i=e.resolvedType)?void 0:i.toString())===(null==t?void 0:t.toString())?{resolvedType:t}:{resolvedType:void 0}})};function P(e,t){if((0,n.isNonNullType)(e))if((0,n.isNonNullType)(t))return P(e.ofType,t.ofType);else return P(e.ofType,t);return(0,n.isListType)(e)&&(0,n.isListType)(t)?P(e.ofType,t.ofType):!(0,n.isWrapperType)(e)&&!(0,n.isWrapperType)(t)&&e.name===t.name}function x({definition:e,targetTypeExtractor:t,errorCollector:i,metadata:r,isOnParentType:a=!1,allowOnNonExternalLeafFields:o=!1,allowFieldsWithArguments:l=!1,allowOnInterface:u=!1,onFields:c}){for(let p of e.applications()){let h=p.parent,m=t(h),y=a?m:h.parent;if((0,n.isInterfaceType)(y)&&!u){let t=d.ERROR_CATEGORIES.DIRECTIVE_UNSUPPORTED_ON_INTERFACE.get(e.name);i.push(t.err(a?`Cannot use ${e.coordinate} on interface "${y.coordinate}": ${e.coordinate} is not yet supported on interfaces`:`Cannot use ${e.coordinate} on ${L(p)} of parent type "${y}": ${e.coordinate} is not yet supported within interfaces`,{nodes:(0,n.sourceASTs)(p).concat(a?[]:(0,n.sourceASTs)(m))}))}!function({type:e,directive:t,metadata:i,errorCollector:r,allowOnNonExternalLeafFields:a,allowFieldsWithArguments:o,onFields:l}){try{let s=l?(e,t)=>{let i=e.field(t);return i&&l(i),i}:void 0,u=ei({parentType:e,directive:t,fieldAccessor:s});!function e({directiveName:t,selectionSet:i,hasExternalInParents:r,metadata:a,onError:s,allowOnNonExternalLeafFields:o,allowFieldsWithArguments:l}){for(let u of i.selections()){let i=u.element.appliedDirectives;if(i.length>0&&s(d.ERROR_CATEGORIES.DIRECTIVE_IN_FIELDS_ARG.get(t).err(`cannot have directive applications in the @${t}(fields:) argument but found ${i.join(", ")}.`)),"FieldSelection"===u.kind){let i=u.element.definition,c=a.isFieldExternal(i);!l&&i.hasArguments()&&s(d.ERROR_CATEGORIES.FIELDS_HAS_ARGS.get(t).err(`field ${i.coordinate} cannot be included because it has arguments (fields with argument are not allowed in @${t})`,{nodes:i.sourceAST}));let p=!u.selectionSet&&!o&&!r;if(!c&&p){let e=d.ERROR_CATEGORIES.DIRECTIVE_FIELDS_MISSING_EXTERNAL.get(t);s(a.isFieldFakeExternal(i)?e.err(`field "${i.coordinate}" should not be part of a @${t} since it is already "effectively" provided by this subgraph (while it is marked @${f.FederationDirectiveName.EXTERNAL}, it is a @${f.FederationDirectiveName.KEY} field of an extension type, which are not internally considered external for historical/backward compatibility reasons)`,{nodes:i.sourceAST}):e.err(`field "${i.coordinate}" should not be part of a @${t} since it is already provided by this subgraph (it is not marked @${f.FederationDirectiveName.EXTERNAL})`,{nodes:i.sourceAST}))}if(u.selectionSet){let d=r||c,p=i.parent;if(!d&&(0,n.isInterfaceType)(p))for(let e of p.possibleRuntimeTypes()){let t=e.field(i.name);if(t&&a.isFieldExternal(t)){d=!0;break}}e({directiveName:t,selectionSet:u.selectionSet,hasExternalInParents:d,metadata:a,onError:s,allowOnNonExternalLeafFields:o,allowFieldsWithArguments:l})}}else e({directiveName:t,selectionSet:u.selectionSet,hasExternalInParents:r,metadata:a,onError:s,allowOnNonExternalLeafFields:o,allowFieldsWithArguments:l})}}({directiveName:t.name,selectionSet:u,hasExternalInParents:!1,metadata:i,onError:e=>r.push(w(t,e)),allowOnNonExternalLeafFields:a,allowFieldsWithArguments:o})}catch(e){if(e instanceof s.GraphQLError)r.push(e);else throw e}}({type:m,directive:p,metadata:r,errorCollector:i,allowOnNonExternalLeafFields:o,allowFieldsWithArguments:l,onFields:c})}}function M(e){let t=new Set;for(let i of(U(e.keyDirective(),e=>e,t),U(e.requiresDirective(),e=>e.parent,t),U(e.providesDirective(),e=>{let t=(0,n.baseType)(e.type);return(0,n.isCompositeType)(t)?t:void 0},t),function(e,t){let i=e.fromContextDirective(),r=e.contextDirective();if(!G(i)||!G(r))return;let a=new Map;for(let e of r.applications()){let t=e.parent;if(!t)continue;let i=e.arguments().name;a.has(i)||a.set(i,new Set),a.get(i).add(t)}for(let e of i.applications()){if(!e.parent)continue;let{context:i,selection:r}=C(e.arguments().field);if(!i)continue;let s=a.get(i);if(s)for(let e of s)try{let i=(e,i)=>{let r=e.field(i);if(r&&(t.add(r),(0,n.isInterfaceType)(e)))for(let n of e.possibleRuntimeTypes()){let e=n.field(i);e&&t.add(e)}return r};(0,u.parseSelectionSet)({parentType:e,source:r,fieldAccessor:i})}catch(e){}}}(e,t),e.schema.interfaceTypes())){let e=i.possibleRuntimeTypes();for(let n of i.fields())for(let i of e){let e=i.field(n.name);e&&t.add(e)}}return t}function U(e,t,i){for(let n of e.applications()){let e=t(n.parent);e&&en({parentType:e,directive:n,includeInterfaceFieldsImplementations:!0,validate:!1}).forEach(e=>i.add(e))}}function $(e,t,i){let a=e.appliedDirectivesOf(t.shareableDirective());if(a.length<=1)return;let s=a.reduce((e,t)=>{let i=t.ofExtension();return i?e.with.add(i,t):e.without.push(t),e},{without:[],with:new r.MultiMap});for(let t of[s.without].concat((0,r.mapValues)(s.with)))if(t.length>1){let r="ObjectType"===e.kind?`the same type declaration of "${e.coordinate}"`:`field "${e.coordinate}"`;i.push(d.ERRORS.INVALID_SHAREABLE_USAGE.err(`Invalid duplicate application of @shareable on ${r}: @shareable is only repeatable on types so it can be used simultaneously on a type definition and its extensions, but it should not be duplicated on the same definition/extension declaration`,{nodes:(0,n.sourceASTs)(...t)}))}}function j(e){return(0,n.isNonNullType)(e)&&(0,n.isListType)(e.ofType)}i.collectUsedFields=M;class V{constructor(e){this.schema=e}onInvalidate(){this._externalTester=void 0,this._sharingPredicate=void 0,this._isFed2Schema=void 0,this._fieldUsedPredicate=void 0}isFed2Schema(){if(!this._isFed2Schema){let e=this.federationFeature();this._isFed2Schema=!!e&&e.url.version.satisfies(new h.FeatureVersion(2,0))}return this._isFed2Schema}federationFeature(){var e;return null==(e=this.schema.coreFeatures)?void 0:e.getByIdentity(N.identity)}externalTester(){return this._externalTester||(this._externalTester=new el(this.schema,this.isFed2Schema())),this._externalTester}sharingPredicate(){return this._sharingPredicate||(this._sharingPredicate=(0,p.computeShareables)(this.schema)),this._sharingPredicate}fieldUsedPredicate(){if(!this._fieldUsedPredicate){let e=M(this);this._fieldUsedPredicate=t=>!!e.has(t)}return this._fieldUsedPredicate}isFieldUsed(e){return this.fieldUsedPredicate()(e)}isFieldExternal(e){return this.externalTester().isExternal(e)}isFieldPartiallyExternal(e){return this.externalTester().isPartiallyExternal(e)}isFieldFullyExternal(e){return this.externalTester().isFullyExternal(e)}isFieldFakeExternal(e){return this.externalTester().isFakeExternal(e)}selectionSelectsAnyExternalField(e){return this.externalTester().selectsAnyExternalField(e)}isFieldShareable(e){return this.sharingPredicate()(e)}isInterfaceObjectType(e){return(0,n.isObjectType)(e)&&B(e,this.interfaceObjectDirective())}federationDirectiveNameInSchema(e){if(!this.isFed2Schema())return e;{let t=this.schema.coreFeatures;(0,r.assert)(t,"Schema should be a core schema");let i=t.getByIdentity(N.identity);return(0,r.assert)(i,"Schema should have the federation feature"),i.directiveNameInSchema(e)}}federationTypeNameInSchema(e){if("_"===e.charAt(0))return e;if(!this.isFed2Schema())return"_"+e;{let t=this.schema.coreFeatures;(0,r.assert)(t,"Schema should be a core schema");let i=t.getByIdentity(N.identity);return(0,r.assert)(i,"Schema should have the federation feature"),i.typeNameInSchema(e)}}getLegacyFederationDirective(e){let t=this.getFederationDirective(e);return(0,r.assert)(t,`The provided schema does not have federation directive @${e}`),t}getFederationDirective(e){return this.schema.directive(this.federationDirectiveNameInSchema(e))}getPost20FederationDirective(e){var t;return null!=(t=this.getFederationDirective(e))?t:{name:e,applications:()=>new Set}}keyDirective(){return this.getLegacyFederationDirective(f.FederationDirectiveName.KEY)}overrideDirective(){return this.getLegacyFederationDirective(f.FederationDirectiveName.OVERRIDE)}extendsDirective(){return this.getLegacyFederationDirective(f.FederationDirectiveName.EXTENDS)}externalDirective(){return this.getLegacyFederationDirective(f.FederationDirectiveName.EXTERNAL)}requiresDirective(){return this.getLegacyFederationDirective(f.FederationDirectiveName.REQUIRES)}providesDirective(){return this.getLegacyFederationDirective(f.FederationDirectiveName.PROVIDES)}shareableDirective(){return this.getLegacyFederationDirective(f.FederationDirectiveName.SHAREABLE)}tagDirective(){return this.getLegacyFederationDirective(f.FederationDirectiveName.TAG)}composeDirective(){return this.getPost20FederationDirective(f.FederationDirectiveName.COMPOSE_DIRECTIVE)}inaccessibleDirective(){return this.getLegacyFederationDirective(f.FederationDirectiveName.INACCESSIBLE)}interfaceObjectDirective(){return this.getPost20FederationDirective(f.FederationDirectiveName.INTERFACE_OBJECT)}authenticatedDirective(){return this.getPost20FederationDirective(f.FederationDirectiveName.AUTHENTICATED)}requiresScopesDirective(){return this.getPost20FederationDirective(f.FederationDirectiveName.REQUIRES_SCOPES)}policyDirective(){return this.getPost20FederationDirective(f.FederationDirectiveName.POLICY)}fromContextDirective(){return this.getPost20FederationDirective(f.FederationDirectiveName.FROM_CONTEXT)}contextDirective(){return this.getPost20FederationDirective(f.FederationDirectiveName.CONTEXT)}costDirective(){return this.getPost20FederationDirective(f.FederationDirectiveName.COST)}listSizeDirective(){return this.getPost20FederationDirective(f.FederationDirectiveName.LIST_SIZE)}cacheTagDirective(){return this.getPost20FederationDirective(f.FederationDirectiveName.CACHE_TAG)}allFederationDirectives(){let e=[this.keyDirective(),this.externalDirective(),this.requiresDirective(),this.providesDirective(),this.tagDirective(),this.extendsDirective()];if(!this.isFed2Schema())return e;e.push(this.shareableDirective()),e.push(this.inaccessibleDirective()),e.push(this.overrideDirective());let t=this.composeDirective();G(t)&&e.push(t);let i=this.interfaceObjectDirective();G(i)&&e.push(i);let n=this.authenticatedDirective();G(n)&&e.push(n);let r=this.requiresScopesDirective();G(r)&&e.push(r);let a=this.policyDirective();G(a)&&e.push(a);let s=this.contextDirective();G(s)&&e.push(s);let o=this.fromContextDirective();G(o)&&e.push(o);let l=this.costDirective();G(l)&&e.push(l);let u=this.listSizeDirective();G(u)&&e.push(u);let c=this.cacheTagDirective();return G(c)&&e.push(c),e}entityType(){return this.schema.type(this.federationTypeNameInSchema(i.entityTypeSpec.name))}anyType(){return this.schema.type(this.federationTypeNameInSchema(i.anyTypeSpec.name))}serviceType(){return this.schema.type(this.federationTypeNameInSchema(i.serviceTypeSpec.name))}fieldSetType(){return this.schema.type(this.federationTypeNameInSchema(f.FederationTypeName.FIELD_SET))}allFederationTypes(){let e=[this.anyType(),this.serviceType()],t=this.federationFeature();if(t){let i=f.FEDERATION_VERSIONS.find(t.url.version);for(let n of((0,r.assert)(i,()=>`Federation spec should be known, but got ${t.url}`),i.typeSpecs())){let i=this.schema.type(t.typeNameInSchema(n.name));i&&e.push(i)}}else e.push(this.fieldSetType());let i=this.entityType();return i&&e.push(i),e}}function G(e){return e instanceof n.DirectiveDefinition}function B(e,t){return G(t)&&e.hasAppliedDirective(t)}i.FederationMetadata=V,i.isFederationDirectiveDefinedInSchema=G,i.hasAppliedDirective=B;class K extends n.SchemaBlueprint{constructor(e){super(),this.withRootTypeRenaming=e}onAddedCoreFeature(e,t){if(super.onAddedCoreFeature(e,t),t.url.identity===f.federationIdentity){let i=f.FEDERATION_VERSIONS.find(t.url.version);i&&i.addElementsToSchema(e)}}onMissingDirectiveDefinition(e,t){if(t.name===h.linkDirectiveDefaultName){let i,n=t.arguments(),r=n&&n.url,a=[];r&&r.startsWith(S.identity)&&(i=n.as,a=(0,h.extractCoreFeatureImports)(S.url,t));let s=S.addDefinitionsToSchema(e,i,a);return s.length>0?s:e.directive(t.name)}return super.onMissingDirectiveDefinition(e,t)}ignoreParsedField(e,t){if(!i.FEDERATION_OPERATION_FIELDS.includes(t)||!(0,n.isObjectType)(e)||!e.isQueryRootType())return!1;let r=q(e.schema());return!!r&&!r.isFed2Schema()}onConstructed(e){q(e)||(e._federationMetadata=new V(e))}onDirectiveDefinitionAndSchemaParsed(e){let t=z(e);return e.schemaDefinition.processUnappliedDirectives(),t}onInvalidation(e){super.onInvalidation(e);let t=q(e);(0,r.assert)(t,"Federation schema should have had its metadata set on construction"),V.prototype.onInvalidate.call(t)}onValidation(e){var t,i,a,s,o;let l=super.onValidation(e);if(this.withRootTypeRenaming)for(let i of n.allSchemaRootKinds){let r=null==(t=e.schemaDefinition.root(i))?void 0:t.type,a=(0,n.defaultRootName)(i);if(r&&r.name!==a){let t=e.type(a);t&&l.push(d.ERROR_CATEGORIES.ROOT_TYPE_USED.get(i).err(`The schema has a type named "${a}" but it is not set as the ${i} root type ("${r.name}" is instead): this is not supported by federation. If a root type does not use its default name, there should be no other type with that default name.`,{nodes:(0,n.sourceASTs)(r,t)})),r.rename(a)}}let c=q(e);if((0,r.assert)(c,"Federation schema should have had its metadata set on construction"),!c.isFed2Schema())return l;x({definition:c.keyDirective(),targetTypeExtractor:e=>e,errorCollector:l,metadata:c,isOnParentType:!0,allowOnNonExternalLeafFields:!0,allowOnInterface:c.federationFeature().url.version.compareTo(new h.FeatureVersion(2,3))>=0,onFields:e=>{let t=(0,n.baseType)(e.type);if((0,n.isUnionType)(t)||(0,n.isInterfaceType)(t)){let i=t.kind;throw i=i.slice(0,i.length-4),d.ERRORS.KEY_FIELDS_SELECT_INVALID_TYPE.err(`field "${e.coordinate}" is a ${i} type which is not allowed in @key`)}}}),x({definition:c.requiresDirective(),targetTypeExtractor:e=>e.parent,errorCollector:l,metadata:c,allowFieldsWithArguments:!0}),x({definition:c.providesDirective(),targetTypeExtractor:e=>{if(c.isFieldExternal(e))throw d.ERRORS.EXTERNAL_COLLISION_WITH_ANOTHER_DIRECTIVE.err(`Cannot have both @provides and @external on field "${e.coordinate}"`,{nodes:e.sourceAST});let t=(0,n.baseType)(e.type);if(!(0,n.isCompositeType)(t))throw d.ERRORS.PROVIDES_ON_NON_OBJECT_FIELD.err(`Invalid @provides directive on field "${e.coordinate}": field has type "${e.type}" which is not a Composite Type`,{nodes:e.sourceAST});return t},errorCollector:l,metadata:c});let p=c.contextDirective(),f=new Map;for(let e of p.applications()){let t=e.parent,i=e.arguments().name,r=i.match(/^([A-Za-z]\w*)$/);i.includes("_")?l.push(d.ERRORS.CONTEXT_NAME_INVALID.err(`Context name "${i}" may not contain an underscore.`,{nodes:(0,n.sourceASTs)(e)})):r||l.push(d.ERRORS.CONTEXT_NAME_INVALID.err(`Context name "${i}" is invalid. It should have only alphanumeric characters.`,{nodes:(0,n.sourceASTs)(e)}));let a=f.get(i);a?a.push(t):f.set(i,[t])}for(let e of c.fromContextDirective().applications()){let{field:t}=e.arguments(),{context:s,selection:o}=C(t);if("DirectiveDefinition"===e.parent.parent.kind){l.push(d.ERRORS.CONTEXT_NOT_SET.err(`@fromContext argument cannot be used on a directive definition "${e.parent.coordinate}".`,{nodes:(0,n.sourceASTs)(e)}));continue}let p=e.parent;if((null==(a=null==(i=null==p?void 0:p.parent)?void 0:i.parent)?void 0:a.kind)!=="ObjectType"){l.push(d.ERRORS.CONTEXT_NOT_SET.err(`@fromContext argument cannot be used on a field that exists on an abstract type "${e.parent.coordinate}".`,{nodes:(0,n.sourceASTs)(e)}));continue}let h=p.parent.parent;for(let t of h.interfaces()){let i=t.field(p.parent.name);i&&l.push(d.ERRORS.CONTEXT_NOT_SET.err(`@fromContext argument cannot be used on a field implementing an interface field "${i.coordinate}".`,{nodes:(0,n.sourceASTs)(e)}))}if(void 0!==p.defaultValue&&l.push(d.ERRORS.CONTEXT_NOT_SET.err(`@fromContext arguments may not have a default value: "${p.coordinate}".`,{nodes:(0,n.sourceASTs)(e)})),s&&o){let t=f.get(s);t?function({context:e,selection:t,fromContextParent:i,setContextLocations:a,errorCollector:s,metadata:o}){let l=i.type;(0,r.assert)(l,"Expected a type");let c=(({context:e,selection:t,fromContextParent:i,errorCollector:a})=>{try{let s=(0,u.parseOperationAST)(t.trim().startsWith("{")?t:`{${t}}`).selectionSet.selections;if(0===s.length)return a.push(d.ERRORS.CONTEXT_INVALID_SELECTION.err(`Context "${e}" is used in "${i.coordinate}" but the selection is invalid: no selection is made`,{nodes:(0,n.sourceASTs)(i)})),{selectionType:"error"};let o=s[0].kind;if("Field"===o){if(1!==s.length)return a.push(d.ERRORS.CONTEXT_INVALID_SELECTION.err(`Context "${e}" is used in "${i.coordinate}" but the selection is invalid: multiple selections are made`,{nodes:(0,n.sourceASTs)(i)})),{selectionType:"error"};return{selectionType:"field"}}if("InlineFragment"===o){let t=new Set;if(!s.every(e=>"InlineFragment"===e.kind))return a.push(d.ERRORS.CONTEXT_INVALID_SELECTION.err(`Context "${e}" is used in "${i.coordinate}" but the selection is invalid: multiple fields could be selected`,{nodes:(0,n.sourceASTs)(i)})),{selectionType:"error"};if(s.forEach(e=>{(0,r.assert)("InlineFragment"===e.kind,"Expected an inline fragment");let{typeCondition:i}=e;i&&t.add(i.name.value)}),t.size!==s.length)return a.push(d.ERRORS.CONTEXT_INVALID_SELECTION.err(`Context "${e}" is used in "${i.coordinate}" but the selection is invalid: type conditions have same name`,{nodes:(0,n.sourceASTs)(i)})),{selectionType:"error"};return{selectionType:"inlineFragment",typeConditions:t}}if("FragmentSpread"===o)return a.push(d.ERRORS.CONTEXT_INVALID_SELECTION.err(`Context "${e}" is used in "${i.coordinate}" but the selection is invalid: fragment spread is not allowed`,{nodes:(0,n.sourceASTs)(i)})),{selectionType:"error"};(0,r.assertUnreachable)(o)}catch(t){return a.push(d.ERRORS.CONTEXT_INVALID_SELECTION.err(`Context "${e}" is used in "${i.coordinate}" but the selection is invalid: ${t.message}`,{nodes:(0,n.sourceASTs)(i)})),{selectionType:"error"}}})({context:e,selection:t,fromContextParent:i,errorCollector:s}),p=c.selectionType;if("error"===p)return;let h=new Set;for(let c of a){var f,m;let a;try{a=(0,u.parseSelectionSet)({parentType:c,source:t})}catch(t){s.push(d.ERRORS.CONTEXT_INVALID_SELECTION.err(`Context "${e}" is used in "${i.coordinate}" but the selection is invalid for type ${c.name}. Error: ${t.message}`,{nodes:(0,n.sourceASTs)(i)}));return}if(f=a,(0,u.hasSelectionWithPredicate)(f,e=>{if("FieldSelection"===e.kind||"FragmentSelection"===e.kind)return e.element.appliedDirectives.length>0;(0,r.assertUnreachable)(e)})&&s.push(d.ERRORS.CONTEXT_INVALID_SELECTION.err(`Context "${e}" is used in "${i.coordinate}" but the selection is invalid: directives are not allowed in the selection`,{nodes:(0,n.sourceASTs)(i)})),m=a,(0,u.hasSelectionWithPredicate)(m,e=>"FieldSelection"===e.kind&&void 0!==e.element.alias)&&s.push(d.ERRORS.CONTEXT_INVALID_SELECTION.err(`Context "${e}" is used in "${i.coordinate}" but the selection is invalid: aliases are not allowed in the selection`,{nodes:(0,n.sourceASTs)(i)})),"field"===p){let{resolvedType:t}=k({currentType:c,selectionSet:a,errorCollector:s,metadata:o,fromContextParent:i});if(void 0===t||!P(t,l))return void s.push(d.ERRORS.CONTEXT_INVALID_SELECTION.err(`Context "${e}" is used in "${i.coordinate}" but the selection is invalid: the type of the selection "${t}" does not match the expected type "${null==l?void 0:l.toString()}"`,{nodes:(0,n.sourceASTs)(i)}))}else if("inlineFragment"===p){let t=[];for(let r of a.selections()){if("FragmentSelection"!==r.kind){s.push(d.ERRORS.CONTEXT_INVALID_SELECTION.err(`Context "${e}" is used in "${i.coordinate}" but the selection is invalid: selection should only contain a single field or at least one inline fragment}"`,{nodes:(0,n.sourceASTs)(i)}));continue}let{typeCondition:a}=r.element;if(!a){s.push(d.ERRORS.CONTEXT_INVALID_SELECTION.err(`Context "${e}" is used in "${i.coordinate}" but the selection is invalid: inline fragments must have type conditions"`,{nodes:(0,n.sourceASTs)(i)}));continue}"ObjectType"===a.kind?(0,n.possibleRuntimeTypes)(c).includes(a)&&(t.push(r),h.add(a.name)):s.push(d.ERRORS.CONTEXT_INVALID_SELECTION.err(`Context "${e}" is used in "${i.coordinate}" but the selection is invalid: type conditions must be an object type"`,{nodes:(0,n.sourceASTs)(i)}))}if(0===t.length)return void s.push(d.ERRORS.CONTEXT_INVALID_SELECTION.err(`Context "${e}" is used in "${i.coordinate}" but the selection is invalid: no type condition matches the location "${c.coordinate}"`,{nodes:(0,n.sourceASTs)(i)}));for(let r of t){let{resolvedType:t}=k({currentType:r.element.typeCondition,selectionSet:r.selectionSet,errorCollector:s,metadata:o,fromContextParent:i});if(void 0===t)return void s.push(d.ERRORS.CONTEXT_INVALID_SELECTION.err(`Context "${e}" is used in "${i.coordinate}" but the selection is invalid: the type of the selection does not match the expected type "${null==l?void 0:l.toString()}"`,{nodes:(0,n.sourceASTs)(i)}));if((0,n.isNonNullType)(t)&&(t=t.ofType),!P(t,l))return void s.push(d.ERRORS.CONTEXT_INVALID_SELECTION.err(`Context "${e}" is used in "${i.coordinate}" but the selection is invalid: the type of the selection "${null==t?void 0:t.toString()}" does not match the expected type "${null==l?void 0:l.toString()}"`,{nodes:(0,n.sourceASTs)(i)}))}}}if("inlineFragment"===c.selectionType)for(let t of c.typeConditions)h.has(t)||s.push(d.ERRORS.CONTEXT_INVALID_SELECTION.err(`Context "${e}" is used in "${i.coordinate}" but the selection is invalid: type condition "${t}" is never used.`,{nodes:(0,n.sourceASTs)(i)}))}({context:s,selection:o,fromContextParent:p,setContextLocations:t,errorCollector:l,metadata:c}):l.push(d.ERRORS.CONTEXT_NOT_SET.err(`Context "${s}" is used at location "${p.coordinate}" but is never set.`,{nodes:(0,n.sourceASTs)(e)}));let i=c.keyDirective();h.appliedDirectivesOf(i).some(e=>e.arguments().resolvable||void 0===e.arguments().resolvable)||l.push(d.ERRORS.CONTEXT_NO_RESOLVABLE_KEY.err(`Object "${h.coordinate}" has no resolvable key but has a field with a contextual argument.`,{nodes:(0,n.sourceASTs)(h)}))}else l.push(d.ERRORS.NO_CONTEXT_IN_SELECTION.err(`@fromContext argument does not reference a context "${t}".`,{nodes:(0,n.sourceASTs)(e)}))}for(let e of c.schema.interfaceTypes())for(let t of e.fields())c.isFieldExternal(t)&&l.push(d.ERRORS.EXTERNAL_ON_INTERFACE.err(`Interface type field "${t.coordinate}" is marked @external but @external is not allowed on interface fields (it is nonsensical).`,{nodes:t.sourceAST}));for(let e of c.schema.types())if((0,n.isObjectType)(e)||(0,n.isInterfaceType)(e))for(let t of e.fields())!c.isFieldExternal(t)||c.isFieldUsed(t)||l.push(d.ERRORS.EXTERNAL_UNUSED.err(`Field "${t.coordinate}" is marked @external but is not used in any federation directive (@key, @provides, @requires) or to satisfy an interface; the field declaration has no use and should be removed (or the field should not be @external).`,{nodes:t.sourceAST}));!function(e,t){for(let i of e.schema.interfaceTypes()){let a=i.possibleRuntimeTypes();for(let s of i.appliedDirectivesOf(e.keyDirective())){let o=ei({parentType:i,directive:s,validate:!1}),l=!1!==s.arguments().resolvable,u=[],c=[];for(let t of a){let i=t.appliedDirectivesOf(e.keyDirective()).find(e=>{let i=ei({parentType:t,directive:e,validate:!1});return o.equals(i)});i?l&&!1===i.arguments().resolvable&&u.push(t):c.push(t)}if(c.length>0){let e=(0,r.printHumanReadableList)(c.map(e=>`"${e.coordinate}"`),{prefix:"type",prefixPlural:"types"});t.push(d.ERRORS.INTERFACE_KEY_NOT_ON_IMPLEMENTATION.err(`Key ${s} on interface type "${i.coordinate}" is missing on implementation ${e}.`,{nodes:(0,n.sourceASTs)(...c)}))}else if(u.length>0){let e=(0,r.printHumanReadableList)(u.map(e=>`"${e.coordinate}"`),{prefix:"type",prefixPlural:"types"});t.push(d.ERRORS.INTERFACE_KEY_NOT_ON_IMPLEMENTATION.err(`Key ${s} on interface type "${i.coordinate}" should be resolvable on all implementation types, but is declared with argument "@key(resolvable:)" set to false in ${e}.`,{nodes:(0,n.sourceASTs)(...u)}))}}}}(c,l);for(let e of c.interfaceObjectDirective().applications())H(e.parent)||l.push(d.ERRORS.INTERFACE_OBJECT_USAGE_ERROR.err(`The @interfaceObject directive can only be applied to entity types but type "${e.parent.coordinate}" has no @key in this subgraph.`,{nodes:e.parent.sourceAST}));let m=c.tagDirective();if(m){let e=E.checkCompatibleDirective(m);e&&l.push(e)}for(let t of e.objectTypes())for(let e of($(t,c,l),t.fields()))$(e,c,l);for(let e of c.shareableDirective().applications()){let t=e.parent;t instanceof n.FieldDefinition&&!(0,n.isObjectType)(t.parent)&&l.push(d.ERRORS.INVALID_SHAREABLE_USAGE.err(`Invalid use of @shareable on field "${t.coordinate}": only object type fields can be marked with @shareable`,{nodes:(0,n.sourceASTs)(e,t.parent)}))}let y=c.costDirective(),v=c.listSizeDirective();for(let e of y.applications())!function(e,t){let i=e.parent;i instanceof n.FieldDefinition&&i.parent instanceof n.InterfaceType&&t.push(d.ERRORS.COST_APPLIED_TO_INTERFACE_FIELD.err(`@cost cannot be applied to interface "${i.coordinate}"`,{nodes:(0,n.sourceASTs)(e,i)}))}(e,l);for(let e of v.applications()){let t=e.parent;(0,r.assert)(t instanceof n.FieldDefinition,"@listSize can only be applied to FIELD_DEFINITION"),function(e,t,i){let{sizedFields:r=[]}=e.arguments();r.length||!t.type||(0,n.isListType)(t.type)||j(t.type)||i.push(d.ERRORS.LIST_SIZE_APPLIED_TO_NON_LIST.err(`"${t.coordinate}" is not a list`,{nodes:(0,n.sourceASTs)(e,t)}))}(e,t,l),function(e,t,i){let{assumedSize:r}=e.arguments();null!=r&&r<0&&i.push(d.ERRORS.LIST_SIZE_INVALID_ASSUMED_SIZE.err(`Assumed size of "${t.coordinate}" cannot be negative`,{nodes:(0,n.sourceASTs)(e,t)}))}(e,t,l),function(e,t,i){let{slicingArguments:r=[]}=e.arguments();for(let s of r){let r=t.argument(s);if(null==r?void 0:r.type){var a;(0,n.isIntType)(r.type)||(a=r.type,(0,n.isNonNullType)(a)&&(0,n.isIntType)(a.ofType))||i.push(d.ERRORS.LIST_SIZE_INVALID_SLICING_ARGUMENT.err(`Slicing argument "${r.coordinate}" must be Int or Int!`,{nodes:(0,n.sourceASTs)(e,t)}))}else i.push(d.ERRORS.LIST_SIZE_INVALID_SLICING_ARGUMENT.err(`Slicing argument "${s}" is not an argument of "${t.coordinate}"`,{nodes:(0,n.sourceASTs)(e,t)}))}}(e,t,l),function(e,t,i){let{sizedFields:r=[]}=e.arguments();if(r.length&&t.type){let a=(0,n.baseType)(t.type);if((0,n.isCompositeType)(a))for(let s of r){let r=a.field(s);r?r.type&&((0,n.isListType)(r.type)||j(r.type))||i.push(d.ERRORS.LIST_SIZE_APPLIED_TO_NON_LIST.err(`Sized field "${r.coordinate}" is not a list`,{nodes:(0,n.sourceASTs)(e,t)})):i.push(d.ERRORS.LIST_SIZE_INVALID_SIZED_FIELD.err(`Sized field "${s}" is not a field on type "${a.coordinate}"`,{nodes:(0,n.sourceASTs)(e,t)}))}else i.push(d.ERRORS.LIST_SIZE_INVALID_SIZED_FIELD.err(`Sized fields cannot be used because "${t.type}" is not a composite type`,{nodes:(0,n.sourceASTs)(e,t)}))}}(e,t,l)}return s=c,o=l,[s.authenticatedDirective(),s.requiresScopesDirective(),s.policyDirective()].forEach(e=>{for(let t of e.applications()){let i=t.parent;if((0,n.isElementNamedType)(i)&&((0,n.isInterfaceType)(i)||W(i))||(0,n.isFieldDefinition)(i)&&(0,n.isInterfaceType)(i.parent)){let r="";switch(i.kind){case"FieldDefinition":r="field";break;case"InterfaceType":r="interface";break;case"ObjectType":r="interface object"}o.push(d.ERRORS.AUTH_REQUIREMENTS_APPLIED_ON_INTERFACE.err(`Invalid use of @${e.name} on ${r} "${i.coordinate}": @${e.name} cannot be applied on interfaces, interface fields and interface objects`,{nodes:(0,n.sourceASTs)(t,i.parent)}))}}}),l}validationRules(){return A}onUnknownDirectiveValidationError(e,t,i){let n=q(e);if((0,r.assert)(n,"This method should only have been called on a subgraph schema"),O.includes(t))if(!n.isFed2Schema())return(0,d.withModifiedErrorMessage)(i,`${i.message} If you meant the "@${t}" federation 2 directive, note that this schema is a federation 1 schema. To be a federation 2 schema, it needs to @link to the federation specifcation v2.`);else{let e=n.federationFeature();(0,r.assert)(e,"Fed2 subgraph _must_ link to the federation feature");let a=e.directiveNameInSchema(t);return a.startsWith(e.nameInSchema+"__")?(0,d.withModifiedErrorMessage)(i,`${i.message} If you meant the "@${t}" federation directive, you should use fully-qualified name "@${a}" or add "@${t}" to the \`import\` argument of the @link to the federation specification.`):(0,d.withModifiedErrorMessage)(i,`${i.message} If you meant the "@${t}" federation directive, you should use "@${a}" as it is imported under that name in the @link to the federation specification of this schema.`)}if(!n.isFed2Schema()){let e=(0,v.suggestionList)(t,O);if(e.length>0)return(0,d.withModifiedErrorMessage)(i,`${i.message}${(0,v.didYouMean)(e.map(e=>"@"+e))} If so, note that ${1===e.length?"it is a federation 2 directive":"they are federation 2 directives"} but this schema is a federation 1 one. To be a federation 2 schema, it needs to @link to the federation specifcation v2.`)}return i}applyDirectivesAfterParsing(){return!0}}function Q(e,t=!1){let i,a=e.coreFeatures;if(a)i=a.coreDefinition,(0,r.assert)(i.url.version.satisfies(S.version),`Fed2 schema must use @link with version >= 1.0, but schema uses ${i.url}`);else{let t=function(e){if(!e.directive(S.url.name))return;let t=S.url.name;for(;;){let i=t+1;if(!e.directive(i))return i}}(e),s=S.addToSchema(e,t);if(s.length>0)throw(0,n.ErrGraphQLValidationFailed)(s);i=S,a=e.coreFeatures,(0,r.assert)(a,"Schema should now be a core schema")}let s=t?N:b;(0,r.assert)(!a.getByIdentity(s.identity),"Schema already set as a federation subgraph"),e.schemaDefinition.applyDirective(a.coreItself.nameInSchema,{url:s.url.toString(),import:b.directiveSpecs().map(e=>`@${e.name}`)});let o=z(e);if(o.length>0)throw(0,n.ErrGraphQLValidationFailed)(o)}function q(e){return e._federationMetadata}function J(e){var t;return e.parent===(null==(t=e.schema().schemaDefinition.root("query"))?void 0:t.type)&&i.FEDERATION_OPERATION_FIELDS.includes(e.name)}function H(e){if(!(0,n.isObjectType)(e)&&!(0,n.isInterfaceType)(e))return!1;let t=q(e.schema());return!!t&&e.hasAppliedDirective(t.keyDirective())}function W(e){if(!(0,n.isObjectType)(e))return!1;let t=q(e.schema());return!!t&&t.isInterfaceObjectType(e)}function Y(e,t,n,r=!0){let a,o={blueprint:new K(r),validate:!1};try{let i="string"==typeof n?(0,l.buildSchema)(new s.Source(n,e),o):(0,l.buildSchemaFromAST)(n,o);a=new ea(e,t,i)}catch(t){if(t instanceof s.GraphQLError&&e!==i.FEDERATION_UNNAMED_SUBGRAPH_NAME)throw eo(t,e,d.ERRORS.INVALID_GRAPHQL);throw t}return a.validate()}function z(e){let t=e.coreFeatures;if(t)return t.getByIdentity(f.federationIdentity)?ee(e):Z(e);if(!e.schemaDefinition.appliedDirectivesOf(h.linkDirectiveDefaultName).find(X))return Z(e);{let t=S.addToSchema(e);return t.length>0?t:ee(e)}}function X(e){let t=e.arguments();return e.name===h.linkDirectiveDefaultName&&t.url&&t.url.startsWith(f.federationIdentity)}function Z(e){var t,i;for(let n of[f.FederationDirectiveName.KEY,f.FederationDirectiveName.PROVIDES,f.FederationDirectiveName.REQUIRES]){let a=e.directive(n);if(!a)continue;(0,r.assert)(0===a.applications().size,`${a} shouldn't have had validation at that places`);let s=null==(i=null==(t=a.argument("fields"))?void 0:t.type)?void 0:i.toString(),o=!!s&&1===a.arguments().length&&("String"===s||"_FieldSet"===s||"FieldSet"===s);(0===a.arguments().length||o)&&a.remove()}let n=f.FEDERATION1_TYPES.map(t=>t.checkOrAdd(e,R)).concat(f.FEDERATION1_DIRECTIVES.map(t=>t.checkOrAdd(e))).flat();return 0===n.length?et(e):n}function ee(e){let t=e.coreFeatures;(0,r.assert)(t,"This method should not have been called on a non-core schema");let i=t.getByIdentity(f.federationIdentity);(0,r.assert)(i,"This method should not have been called on a schema with no @link for federation");let n=f.FEDERATION_VERSIONS.find(i.url.version);if(!n)return[d.ERRORS.UNKNOWN_FEDERATION_LINK_VERSION.err(`Invalid version ${i.url.version} for the federation feature in @link directive on schema`,{nodes:i.directive.sourceAST})];let a=n.addElementsToSchema(e);return 0===a.length?et(e):a}function et(e){let t=e.coreFeatures;if(!t)return[];let i=[];for(let n of t.allFeatures()){if(n===t.coreItself||n.url.identity===f.federationIdentity||n.url.identity===T.joinIdentity)continue;let r=(0,g.coreFeatureDefinitionIfKnown)(n.url);r&&(i=i.concat(r.addElementsToSchema(e)))}return i}function ei({parentType:e,directive:t,fieldAccessor:i,validate:n,decorateValidationErrors:r=!0,normalize:a=!1}){try{let r=(0,u.parseSelectionSet)({parentType:e,source:function(e){var t;let i=e.arguments().fields,n=e.sourceAST;if("string"!=typeof i)throw d.ERROR_CATEGORIES.DIRECTIVE_INVALID_FIELDS_TYPE.get(e.name).err(`Invalid value for argument "${e.definition.argument("fields").name}": must be a string.`,{nodes:n});if(n&&"Directive"===n.kind){for(let i of null!=(t=n.arguments)?t:[])if("fields"===i.name.value){if("StringValue"!==i.value.kind)throw d.ERROR_CATEGORIES.DIRECTIVE_INVALID_FIELDS_TYPE.get(e.name).err(`Invalid value for argument "${e.definition.argument("fields").name}": must be a string.`,{nodes:n});break}}return i}(t),fieldAccessor:i,validate:n});return(null==n||n)&&r.forEachElement(e=>{if("Field"===e.kind&&e.alias)throw new s.GraphQLError(`Cannot use alias "${e.alias}" in "${e}": aliases are not currently supported in @${t.name}`)}),a?r.normalize({parentType:e,recursive:!0}):r}catch(e){if(!(e instanceof s.GraphQLError)||!r)throw e;throw w(t,e,e=>(e.startsWith("Cannot query field")&&(e.endsWith(".")&&(e=e.slice(0,e.length-1)),t.name===f.FederationDirectiveName.KEY?e+=" (the field should either be added to this subgraph or, if it should not be resolved by this subgraph, you need to add it to this subgraph with @external).":e+=" (if the field is defined in another subgraph, you need to add it to this subgraph with @external)."),e))}}function en({parentType:e,directive:t,includeInterfaceFieldsImplementations:i,validate:r=!0}){let a=[];try{ei({parentType:e,directive:t,fieldAccessor:(e,t)=>{let r=e.field(t);if(r&&(a.push(r),i&&(0,n.isInterfaceType)(e)))for(let i of e.possibleRuntimeTypes()){let e=i.field(t);e&&a.push(e)}return r},validate:r})}catch(e){if(void 0===(0,d.errorCauses)(e)||r)throw e}return a}i.FederationBlueprint=K,i.setSchemaAsFed2Subgraph=Q,i.FEDERATION2_LINK_WITH_FULL_IMPORTS='@link(url: "https://specs.apollo.dev/federation/v2.14", import: ["@key", "@requires", "@provides", "@external", "@tag", "@extends", "@shareable", "@inaccessible", "@override", "@composeDirective", "@interfaceObject", "@authenticated", "@requiresScopes", "@policy", "@context", "@fromContext", "@cost", "@listSize", "@cacheTag"])',i.FEDERATION2_LINK_WITH_AUTO_EXPANDED_IMPORTS='@link(url: "https://specs.apollo.dev/federation/v2.14", import: ["@key", "@requires", "@provides", "@external", "@tag", "@extends", "@shareable", "@inaccessible", "@override", "@composeDirective", "@interfaceObject"])',i.FEDERATION2_LINK_WITH_AUTO_EXPANDED_IMPORTS_UPGRADED='@link(url: "https://specs.apollo.dev/federation/v2.4", import: ["@key", "@requires", "@provides", "@external", "@tag", "@extends", "@shareable", "@inaccessible", "@override", "@composeDirective", "@interfaceObject"])',i.asFed2SubgraphDocument=function(e,t){var i,n;let r=(null==t?void 0:t.includeAllImports)?N.directiveSpecs():b.directiveSpecs(),a={kind:s.Kind.DIRECTIVE,name:{kind:s.Kind.NAME,value:h.linkDirectiveDefaultName},arguments:[{kind:s.Kind.ARGUMENT,name:{kind:s.Kind.NAME,value:"url"},value:{kind:s.Kind.STRING,value:N.url.toString()}},{kind:s.Kind.ARGUMENT,name:{kind:s.Kind.NAME,value:"import"},value:{kind:s.Kind.LIST,values:r.map(e=>({kind:s.Kind.STRING,value:`@${e.name}`}))}}]};if(null==(i=null==t?void 0:t.addAsSchemaExtension)||i)return{kind:s.Kind.DOCUMENT,loc:e.loc,definitions:e.definitions.concat({kind:s.Kind.SCHEMA_EXTENSION,directives:[a]})};let o=e.definitions.find(e=>e.kind==s.Kind.SCHEMA_DEFINITION);if(o)return{kind:s.Kind.DOCUMENT,loc:e.loc,definitions:e.definitions.filter(e=>e!==o).concat([{...o,directives:[a].concat(null!=(n=o.directives)?n:[])}])};{let t=e.definitions.some(e=>e.kind===s.Kind.OBJECT_TYPE_DEFINITION&&"Mutation"===e.name.value),i=(e,t)=>({kind:s.Kind.OPERATION_TYPE_DEFINITION,operation:e,type:{kind:s.Kind.NAMED_TYPE,name:{kind:s.Kind.NAME,value:t}}});return{kind:s.Kind.DOCUMENT,loc:e.loc,definitions:e.definitions.concat({kind:s.Kind.SCHEMA_DEFINITION,directives:[a],operationTypes:[i(s.OperationTypeNode.QUERY,"Query")].concat(t?i(s.OperationTypeNode.MUTATION,"Mutation"):[])})}}},i.printSubgraphNames=function(e){return(0,r.printHumanReadableList)(e.map(e=>`"${e}"`),{prefix:"subgraph",prefixPlural:"subgraphs"})},i.federationMetadata=q,i.isFederationSubgraphSchema=function(e){return!!q(e)},i.isFederationField=J,i.isEntityType=H,i.isInterfaceObjectType=W,i.buildSubgraph=Y,i.newEmptyFederation2Schema=function(e){let t=new n.Schema(new K(!0),e);return Q(t,!0),t},i.parseFieldSetArgument=ei,i.collectTargetFields=en,i.subgraphsFromServiceList=function(e){var t;let i=[],n=new er;for(let r of e)try{n.add(Y(r.name,null!=(t=r.url)?t:"",r.typeDefs))}catch(t){let e=(0,d.errorCauses)(t);if(e)i=i.concat(e);else throw t}return 0===i.length?n:i};class er{constructor(){this.subgraphs=new r.OrderedMap}add(e){if(this.subgraphs.has(e.name))throw Error(`A subgraph named ${e.name} already exists`+(e.url?` (with url '${e.url}')`:""));return this.subgraphs.add(e.name,e),e}get(e){return this.subgraphs.get(e)}size(){return this.subgraphs.size}names(){return this.subgraphs.keys()}values(){return this.subgraphs.values()}*[Symbol.iterator](){for(let e of this.subgraphs)yield e}validate(){let e=[];for(let t of this.values())try{t.validate()}catch(i){let t=(0,d.errorCauses)(i);if(!t)throw i;e=e.concat(t)}return 0===e.length?void 0:e}toString(){return"["+this.subgraphs.keys().join(", ")+"]"}}i.Subgraphs=er,i.anyTypeSpec=(0,y.createScalarTypeSpecification)({name:"_Any"}),i.serviceTypeSpec=(0,y.createObjectTypeSpecification)({name:"_Service",fieldsFct:e=>[{name:"sdl",type:e.stringType()}]}),i.entityTypeSpec=(0,y.createUnionTypeSpecification)({name:"_Entity",membersFct:e=>e.objectTypes().filter(H).map(e=>e.name)}),i.FEDERATION_OPERATION_TYPES=[i.anyTypeSpec,i.serviceTypeSpec,i.entityTypeSpec],i.serviceFieldName="_service",i.entitiesFieldName="_entities",i.FEDERATION_OPERATION_FIELDS=[i.serviceFieldName,i.entitiesFieldName];class ea{constructor(e,t,n){if(this.name=e,this.url=t,this.schema=n,e===i.FEDERATION_RESERVED_SUBGRAPH_NAME)throw d.ERRORS.INVALID_SUBGRAPH_NAME.err(`Invalid name ${i.FEDERATION_RESERVED_SUBGRAPH_NAME} for a subgraph: this name is reserved`)}metadata(){let e=q(this.schema);return(0,r.assert)(e,"The subgraph schema should have built with the federation built-ins."),e}isFed2Subgraph(){return this.metadata().isFed2Schema()}addFederationOperations(){let e=this.metadata();for(let e of i.FEDERATION_OPERATION_TYPES)e.checkOrAdd(this.schema);let t=this.schema.schemaDefinition.root("query"),r=t?t.type:this.schema.addType(new n.ObjectType("Query")),a=r.field(i.entitiesFieldName),s=e.entityType();if(s){let t=new n.NonNullType(new n.ListType(s));a?a.type||(a.type=s):r.addField(i.entitiesFieldName,t).addArgument("representations",new n.NonNullType(new n.ListType(new n.NonNullType(e.anyType()))))}else a&&a.remove();r.field(i.serviceFieldName)||r.addField(i.serviceFieldName,new n.NonNullType(e.serviceType()))}assumeValid(){return this.addFederationOperations(),this.schema.assumeValid(),this}validate(){try{return this.addFederationOperations(),this.schema.validate(),this}catch(e){if(e instanceof s.GraphQLError)throw eo(e,this.name,d.ERRORS.INVALID_GRAPHQL);throw e}}isPrintedDirective(e){var t;if(this.metadata().allFederationDirectives().includes(e))return!1;let i=this.schema.coreFeatures;return!i||(null==(t=i.sourceFeature(e))?void 0:t.feature.url.identity)!==h.linkIdentity}isPrintedType(e){var t;if(this.metadata().allFederationTypes().includes(e)||(0,n.isObjectType)(e)&&e.isQueryRootType()&&0===e.fields().filter(e=>!J(e)).length)return!1;let i=this.schema.coreFeatures;return!i||(null==(t=i.sourceFeature(e))?void 0:t.feature.url.identity)!==h.linkIdentity}isPrintedDirectiveApplication(e){let t;if(!this.schema.coreFeatures||e.name!==S.url.name)return!0;let i=e.arguments();if("url"in i)try{t=h.FeatureUrl.parse(i.url)}catch(e){}return(null==t?void 0:t.identity)!==h.linkIdentity||1!==Object.keys(i).length}toString(e=m.defaultPrintOptions){return(0,m.printSchema)(this.schema,{...e,directiveDefinitionFilter:e=>this.isPrintedDirective(e),typeFilter:e=>this.isPrintedType(e),fieldFilter:e=>!J(e),directiveApplicationFilter:e=>this.isPrintedDirectiveApplication(e)})}}function es(e,t){return"subgraph"in e?e:{...e,subgraph:t}}function eo(e,t,i){let r=(0,d.errorCauses)(e).map(e=>{var n;let r=`[${t}] ${e.message}`,a=e.nodes?e.nodes.map(e=>es(e,t)):void 0,o=null!=(n=(0,d.errorCodeDef)(e))?n:i,l={...(0,d.extractGraphQLErrorOptions)(e),nodes:a,originalError:e};return o?o.err(r,l):new s.GraphQLError(r,l)});return 1===r.length?r[0]:(0,n.ErrGraphQLValidationFailed)(r)}i.Subgraph=ea,i.addSubgraphToASTNode=es,i.addSubgraphToError=eo;class el{constructor(e,t){this.schema=e,this.isFed2Schema=t,this.fakeExternalFields=new Set,this.providedFields=new Set,this.externalFieldsOnType=new Set,this.externalDirective=this.metadata().externalDirective(),this.collectFakeExternals(),this.collectProvidedFields(),this.collectExternalsOnType()}metadata(){let e=q(this.schema);return(0,r.assert)(e,"Schema should be a subgraphs schema"),e}collectFakeExternals(){let e=this.metadata(),t=e.extendsDirective();for(let i of e.keyDirective().applications()){let e=i.parent;(i.ofExtension()||e.hasAppliedDirective(t))&&en({parentType:e,directive:i,includeInterfaceFieldsImplementations:!1,validate:!1}).filter(e=>e.hasAppliedDirective(this.externalDirective)).forEach(e=>this.fakeExternalFields.add(e.coordinate))}}collectProvidedFields(){for(let e of this.metadata().providesDirective().applications()){let t=e.parent,i=(0,n.baseType)(t.type);(0,n.isCompositeType)(i)&&en({parentType:i,directive:e,includeInterfaceFieldsImplementations:!0,validate:!1}).forEach(e=>this.providedFields.add(e.coordinate))}}collectExternalsOnType(){if(this.isFed2Schema){for(let e of this.schema.objectTypes())if(e.hasAppliedDirective(this.externalDirective))for(let t of e.fields())this.externalFieldsOnType.add(t.coordinate)}}isExternal(e){return(e.hasAppliedDirective(this.externalDirective)||this.externalFieldsOnType.has(e.coordinate))&&!this.isFakeExternal(e)}isFakeExternal(e){return this.fakeExternalFields.has(e.coordinate)}selectsAnyExternalField(e){for(let t of e.selections())if("FieldSelection"===t.kind&&this.isExternal(t.element.definition)||t.selectionSet&&this.selectsAnyExternalField(t.selectionSet))return!0;return!1}isPartiallyExternal(e){return this.isExternal(e)&&this.providedFields.has(e.coordinate)}isFullyExternal(e){return this.isExternal(e)&&!this.providedFields.has(e.coordinate)}}function eu(e,t,i,n){for(let r of t.appliedDirectivesOf(e)){let a;try{a=ei({parentType:i,directive:r})}catch(e){continue}if(function e(t){return t.selections().some(t=>"FieldSelection"!==t.kind?e(t.selectionSet):!ec(t.element.definition)&&(!t.selectionSet||e(t.selectionSet)))}(a)){r.remove();let i=function e(t){return t.lazyMap(t=>{if("FieldSelection"===t.kind&&ec(t.element.definition))return t;if(t.selectionSet){let i=e(t.selectionSet);if(!i.isEmpty())return t.withUpdatedSelectionSet(i)}})}(a);if(i.isEmpty())n(t,r);else{let a=t.applyDirective(e,{fields:i.toString(!0,!1)});n(t,r,a)}}}}function ec(e){let t=q(e.schema());if(!t)return!1;if(e.hasAppliedDirective(t.externalDirective()))return!0;let i=e.parent;if((0,n.isInterfaceType)(i))for(let n of i.possibleRuntimeTypes()){let i=n.field(e.name);if(i&&i.hasAppliedDirective(t.externalDirective()))return!0}return!1}i.removeInactiveProvidesAndRequires=function(e,t=()=>{}){let i=q(e);if(!i)return;let r=i.providesDirective(),a=i.requiresDirective();for(let i of e.types())if((0,n.isObjectType)(i)||(0,n.isInterfaceType)(i))for(let e of i.fields()){let s=(0,n.baseType)(e.type);eu(r,e,s,t),eu(a,e,i,t)}}},12842,(e,t,i)=>{"use strict";let n=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,r=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,a=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,s=/\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi,o=new Map([["n","\n"],["r","\r"],["t"," "],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e","\x1b"],["a","\x07"]]);function l(e){let t="u"===e[0],i="{"===e[1];return t&&!i&&5===e.length||"x"===e[0]&&3===e.length?String.fromCharCode(parseInt(e.slice(1),16)):t&&i?String.fromCodePoint(parseInt(e.slice(2,-1),16)):o.get(e)||e}function u(e,t){let i={};for(let e of t)for(let t of e.styles)i[t[0]]=e.inverse?null:t.slice(1);let n=e;for(let[e,t]of Object.entries(i))if(Array.isArray(t)){if(!(e in n))throw Error(`Unknown Chalk style: ${e}`);n=t.length>0?n[e](...t):n[e]}return n}t.exports=(e,t)=>{let i=[],o=[],c=[];if(t.replace(n,(t,n,d,p,h,f)=>{if(n)c.push(l(n));else if(p){let t=c.join("");c=[],o.push(0===i.length?t:u(e,i)(t)),i.push({inverse:d,styles:function(e){let t;r.lastIndex=0;let i=[];for(;null!==(t=r.exec(e));){let e=t[1];if(t[2]){let n=function(e,t){let i,n=[];for(let r of t.trim().split(/\s*,\s*/g)){let t=Number(r);if(Number.isNaN(t))if(i=r.match(a))n.push(i[2].replace(s,(e,t,i)=>t?l(t):i));else throw Error(`Invalid Chalk template style argument: ${r} (in style '${e}')`);else n.push(t)}return n}(e,t[2]);i.push([e].concat(n))}else i.push([e])}return i}(p)})}else if(h){if(0===i.length)throw Error("Found extraneous } in Chalk template literal");o.push(u(e,i)(c.join(""))),c=[],i.pop()}else c.push(f)}),o.push(c.join("")),i.length>0)throw Error(`Chalk template literal is missing ${i.length} closing bracket${1===i.length?"":"s"} (\`}\`)`);return o.join("")}},977235,(e,t,i)=>{"use strict";t.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},349779,(e,t,i)=>{let n=e.r(977235),r={};for(let e of Object.keys(n))r[n[e]]=e;let a={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(let e of(t.exports=a,Object.keys(a))){if(!("channels"in a[e]))throw Error("missing channels property: "+e);if(!("labels"in a[e]))throw Error("missing channel labels property: "+e);if(a[e].labels.length!==a[e].channels)throw Error("channel and label counts mismatch: "+e);let{channels:t,labels:i}=a[e];delete a[e].channels,delete a[e].labels,Object.defineProperty(a[e],"channels",{value:t}),Object.defineProperty(a[e],"labels",{value:i})}a.rgb.hsl=function(e){let t,i=e[0]/255,n=e[1]/255,r=e[2]/255,a=Math.min(i,n,r),s=Math.max(i,n,r),o=s-a;s===a?t=0:i===s?t=(n-r)/o:n===s?t=2+(r-i)/o:r===s&&(t=4+(i-n)/o),(t=Math.min(60*t,360))<0&&(t+=360);let l=(a+s)/2;return[t,100*(s===a?0:l<=.5?o/(s+a):o/(2-s-a)),100*l]},a.rgb.hsv=function(e){let t,i,n,r,a,s=e[0]/255,o=e[1]/255,l=e[2]/255,u=Math.max(s,o,l),c=u-Math.min(s,o,l),d=function(e){return(u-e)/6/c+.5};return 0===c?(r=0,a=0):(a=c/u,t=d(s),i=d(o),n=d(l),s===u?r=n-i:o===u?r=1/3+t-n:l===u&&(r=2/3+i-t),r<0?r+=1:r>1&&(r-=1)),[360*r,100*a,100*u]},a.rgb.hwb=function(e){let t=e[0],i=e[1],n=e[2];return[a.rgb.hsl(e)[0],1/255*Math.min(t,Math.min(i,n))*100,100*(n=1-1/255*Math.max(t,Math.max(i,n)))]},a.rgb.cmyk=function(e){let t=e[0]/255,i=e[1]/255,n=e[2]/255,r=Math.min(1-t,1-i,1-n);return[100*((1-t-r)/(1-r)||0),100*((1-i-r)/(1-r)||0),100*((1-n-r)/(1-r)||0),100*r]},a.rgb.keyword=function(e){let t,i=r[e];if(i)return i;let a=1/0;for(let i of Object.keys(n)){let r=n[i],s=(e[0]-r[0])**2+(e[1]-r[1])**2+(e[2]-r[2])**2;s<a&&(a=s,t=i)}return t},a.keyword.rgb=function(e){return n[e]},a.rgb.xyz=function(e){let t=e[0]/255,i=e[1]/255,n=e[2]/255;return[100*(.4124*(t=t>.04045?((t+.055)/1.055)**2.4:t/12.92)+.3576*(i=i>.04045?((i+.055)/1.055)**2.4:i/12.92)+.1805*(n=n>.04045?((n+.055)/1.055)**2.4:n/12.92)),100*(.2126*t+.7152*i+.0722*n),100*(.0193*t+.1192*i+.9505*n)]},a.rgb.lab=function(e){let t=a.rgb.xyz(e),i=t[0],n=t[1],r=t[2];return i/=95.047,n/=100,r/=108.883,[116*(n=n>.008856?n**(1/3):7.787*n+16/116)-16,500*((i=i>.008856?i**(1/3):7.787*i+16/116)-n),200*(n-(r=r>.008856?r**(1/3):7.787*r+16/116))]},a.hsl.rgb=function(e){let t,i,n,r=e[0]/360,a=e[1]/100,s=e[2]/100;if(0===a)return[n=255*s,n,n];t=s<.5?s*(1+a):s+a-s*a;let o=2*s-t,l=[0,0,0];for(let e=0;e<3;e++)(i=r+-(1/3*(e-1)))<0&&i++,i>1&&i--,n=6*i<1?o+(t-o)*6*i:2*i<1?t:3*i<2?o+(t-o)*(2/3-i)*6:o,l[e]=255*n;return l},a.hsl.hsv=function(e){let t=e[0],i=e[1]/100,n=e[2]/100,r=i,a=Math.max(n,.01);n*=2,i*=n<=1?n:2-n,r*=a<=1?a:2-a;let s=(n+i)/2;return[t,100*(0===n?2*r/(a+r):2*i/(n+i)),100*s]},a.hsv.rgb=function(e){let t=e[0]/60,i=e[1]/100,n=e[2]/100,r=Math.floor(t)%6,a=t-Math.floor(t),s=255*n*(1-i),o=255*n*(1-i*a),l=255*n*(1-i*(1-a));switch(n*=255,r){case 0:return[n,l,s];case 1:return[o,n,s];case 2:return[s,n,l];case 3:return[s,o,n];case 4:return[l,s,n];case 5:return[n,s,o]}},a.hsv.hsl=function(e){let t,i,n=e[0],r=e[1]/100,a=e[2]/100,s=Math.max(a,.01);i=(2-r)*a;let o=(2-r)*s;return[n,100*(t=(t=r*s/(o<=1?o:2-o))||0),100*(i/=2)]},a.hwb.rgb=function(e){let t,i,n,r,a=e[0]/360,s=e[1]/100,o=e[2]/100,l=s+o;l>1&&(s/=l,o/=l);let u=Math.floor(6*a),c=1-o;t=6*a-u,(1&u)!=0&&(t=1-t);let d=s+t*(c-s);switch(u){default:case 6:case 0:i=c,n=d,r=s;break;case 1:i=d,n=c,r=s;break;case 2:i=s,n=c,r=d;break;case 3:i=s,n=d,r=c;break;case 4:i=d,n=s,r=c;break;case 5:i=c,n=s,r=d}return[255*i,255*n,255*r]},a.cmyk.rgb=function(e){let t=e[0]/100,i=e[1]/100,n=e[2]/100,r=e[3]/100;return[255*(1-Math.min(1,t*(1-r)+r)),255*(1-Math.min(1,i*(1-r)+r)),255*(1-Math.min(1,n*(1-r)+r))]},a.xyz.rgb=function(e){let t,i,n,r=e[0]/100,a=e[1]/100,s=e[2]/100;return t=(t=3.2406*r+-1.5372*a+-.4986*s)>.0031308?1.055*t**(1/2.4)-.055:12.92*t,i=(i=-.9689*r+1.8758*a+.0415*s)>.0031308?1.055*i**(1/2.4)-.055:12.92*i,n=(n=.0557*r+-.204*a+1.057*s)>.0031308?1.055*n**(1/2.4)-.055:12.92*n,[255*(t=Math.min(Math.max(0,t),1)),255*(i=Math.min(Math.max(0,i),1)),255*(n=Math.min(Math.max(0,n),1))]},a.xyz.lab=function(e){let t=e[0],i=e[1],n=e[2];return t/=95.047,i/=100,n/=108.883,[116*(i=i>.008856?i**(1/3):7.787*i+16/116)-16,500*((t=t>.008856?t**(1/3):7.787*t+16/116)-i),200*(i-(n=n>.008856?n**(1/3):7.787*n+16/116))]},a.lab.xyz=function(e){let t,i,n,r=e[0],a=e[1],s=e[2];t=a/500+(i=(r+16)/116),n=i-s/200;let o=i**3,l=t**3,u=n**3;return i=(o>.008856?o:(i-16/116)/7.787)*100,[t=(l>.008856?l:(t-16/116)/7.787)*95.047,i,n=(u>.008856?u:(n-16/116)/7.787)*108.883]},a.lab.lch=function(e){let t,i=e[0],n=e[1],r=e[2];return(t=360*Math.atan2(r,n)/2/Math.PI)<0&&(t+=360),[i,Math.sqrt(n*n+r*r),t]},a.lch.lab=function(e){let t=e[0],i=e[1],n=e[2]/360*2*Math.PI;return[t,i*Math.cos(n),i*Math.sin(n)]},a.rgb.ansi16=function(e,t=null){let[i,n,r]=e,s=null===t?a.rgb.hsv(e)[2]:t;if(0===(s=Math.round(s/50)))return 30;let o=30+(Math.round(r/255)<<2|Math.round(n/255)<<1|Math.round(i/255));return 2===s&&(o+=60),o},a.hsv.ansi16=function(e){return a.rgb.ansi16(a.hsv.rgb(e),e[2])},a.rgb.ansi256=function(e){let t=e[0],i=e[1],n=e[2];return t===i&&i===n?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(i/255*5)+Math.round(n/255*5)},a.ansi16.rgb=function(e){let t=e%10;if(0===t||7===t)return e>50&&(t+=3.5),[t=t/10.5*255,t,t];let i=(~~(e>50)+1)*.5;return[(1&t)*i*255,(t>>1&1)*i*255,(t>>2&1)*i*255]},a.ansi256.rgb=function(e){let t;if(e>=232){let t=(e-232)*10+8;return[t,t,t]}return[Math.floor((e-=16)/36)/5*255,Math.floor((t=e%36)/6)/5*255,t%6/5*255]},a.rgb.hex=function(e){let t=(((255&Math.round(e[0]))<<16)+((255&Math.round(e[1]))<<8)+(255&Math.round(e[2]))).toString(16).toUpperCase();return"000000".substring(t.length)+t},a.hex.rgb=function(e){let t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];let i=t[0];3===t[0].length&&(i=i.split("").map(e=>e+e).join(""));let n=parseInt(i,16);return[n>>16&255,n>>8&255,255&n]},a.rgb.hcg=function(e){let t,i=e[0]/255,n=e[1]/255,r=e[2]/255,a=Math.max(Math.max(i,n),r),s=Math.min(Math.min(i,n),r),o=a-s;return t=o<1?s/(1-o):0,[360*((o<=0?0:a===i?(n-r)/o%6:a===n?2+(r-i)/o:4+(i-n)/o)/6%1),100*o,100*t]},a.hsl.hcg=function(e){let t=e[1]/100,i=e[2]/100,n=i<.5?2*t*i:2*t*(1-i),r=0;return n<1&&(r=(i-.5*n)/(1-n)),[e[0],100*n,100*r]},a.hsv.hcg=function(e){let t=e[1]/100,i=e[2]/100,n=t*i,r=0;return n<1&&(r=(i-n)/(1-n)),[e[0],100*n,100*r]},a.hcg.rgb=function(e){let t=e[0]/360,i=e[1]/100,n=e[2]/100;if(0===i)return[255*n,255*n,255*n];let r=[0,0,0],a=t%1*6,s=a%1,o=1-s,l=0;switch(Math.floor(a)){case 0:r[0]=1,r[1]=s,r[2]=0;break;case 1:r[0]=o,r[1]=1,r[2]=0;break;case 2:r[0]=0,r[1]=1,r[2]=s;break;case 3:r[0]=0,r[1]=o,r[2]=1;break;case 4:r[0]=s,r[1]=0,r[2]=1;break;default:r[0]=1,r[1]=0,r[2]=o}return l=(1-i)*n,[(i*r[0]+l)*255,(i*r[1]+l)*255,(i*r[2]+l)*255]},a.hcg.hsv=function(e){let t=e[1]/100,i=t+e[2]/100*(1-t),n=0;return i>0&&(n=t/i),[e[0],100*n,100*i]},a.hcg.hsl=function(e){let t=e[1]/100,i=e[2]/100*(1-t)+.5*t,n=0;return i>0&&i<.5?n=t/(2*i):i>=.5&&i<1&&(n=t/(2*(1-i))),[e[0],100*n,100*i]},a.hcg.hwb=function(e){let t=e[1]/100,i=t+e[2]/100*(1-t);return[e[0],(i-t)*100,(1-i)*100]},a.hwb.hcg=function(e){let t=e[1]/100,i=1-e[2]/100,n=i-t,r=0;return n<1&&(r=(i-n)/(1-n)),[e[0],100*n,100*r]},a.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},a.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},a.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},a.gray.hsl=function(e){return[0,0,e[0]]},a.gray.hsv=a.gray.hsl,a.gray.hwb=function(e){return[0,100,e[0]]},a.gray.cmyk=function(e){return[0,0,0,e[0]]},a.gray.lab=function(e){return[e[0],0,0]},a.gray.hex=function(e){let t=255&Math.round(e[0]/100*255),i=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(i.length)+i},a.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]}},661443,(e,t,i)=>{let n=e.r(349779);t.exports=function(e){let t=function(e){let t=function(){let e={},t=Object.keys(n);for(let i=t.length,n=0;n<i;n++)e[t[n]]={distance:-1,parent:null};return e}(),i=[e];for(t[e].distance=0;i.length;){let e=i.pop(),r=Object.keys(n[e]);for(let n=r.length,a=0;a<n;a++){let n=r[a],s=t[n];-1===s.distance&&(s.distance=t[e].distance+1,s.parent=e,i.unshift(n))}}return t}(e),i={},r=Object.keys(t);for(let e=r.length,a=0;a<e;a++){let e=r[a];null!==t[e].parent&&(i[e]=function(e,t){let i=[t[e].parent,e],r=n[t[e].parent][e],a=t[e].parent;for(;t[a].parent;)i.unshift(t[a].parent),r=function(e,t){return function(i){return t(e(i))}}(n[t[a].parent][a],r),a=t[a].parent;return r.conversion=i,r}(e,t))}return i}},879559,(e,t,i)=>{let n=e.r(349779),r=e.r(661443),a={};Object.keys(n).forEach(e=>{a[e]={},Object.defineProperty(a[e],"channels",{value:n[e].channels}),Object.defineProperty(a[e],"labels",{value:n[e].labels});let t=r(e);Object.keys(t).forEach(i=>{let n,r,s=t[i];a[e][i]=(n=function(...e){let t=e[0];if(null==t)return t;t.length>1&&(e=t);let i=s(e);if("object"==typeof i)for(let e=i.length,t=0;t<e;t++)i[t]=Math.round(i[t]);return i},"conversion"in s&&(n.conversion=s.conversion),n),a[e][i].raw=(r=function(...e){let t=e[0];return null==t?t:(t.length>1&&(e=t),s(e))},"conversion"in s&&(r.conversion=s.conversion),r)})}),t.exports=a},704567,(e,t,i)=>{"use strict";let n,r=(e,t)=>(...i)=>{let n=e(...i);return`\u001B[${n+t}m`},a=(e,t)=>(...i)=>{let n=e(...i);return`\u001B[${38+t};5;${n}m`},s=(e,t)=>(...i)=>{let n=e(...i);return`\u001B[${38+t};2;${n[0]};${n[1]};${n[2]}m`},o=e=>e,l=(e,t,i)=>[e,t,i],u=(e,t,i)=>{Object.defineProperty(e,t,{get:()=>{let n=i();return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0}),n},enumerable:!0,configurable:!0})},c=(t,i,r,a)=>{void 0===n&&(n=e.r(879559));let s=10*!!a,o={};for(let[e,a]of Object.entries(n)){let n="ansi16"===e?"ansi":e;e===i?o[n]=t(r,s):"object"==typeof a&&(o[n]=t(a[i],s))}return o};Object.defineProperty(t,"exports",{enumerable:!0,get:function(){let e=new Map,t={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};for(let[i,n]of(t.color.gray=t.color.blackBright,t.bgColor.bgGray=t.bgColor.bgBlackBright,t.color.grey=t.color.blackBright,t.bgColor.bgGrey=t.bgColor.bgBlackBright,Object.entries(t))){for(let[i,r]of Object.entries(n))t[i]={open:`\u001B[${r[0]}m`,close:`\u001B[${r[1]}m`},n[i]=t[i],e.set(r[0],r[1]);Object.defineProperty(t,i,{value:n,enumerable:!1})}return Object.defineProperty(t,"codes",{value:e,enumerable:!1}),t.color.close="\x1b[39m",t.bgColor.close="\x1b[49m",u(t.color,"ansi",()=>c(r,"ansi16",o,!1)),u(t.color,"ansi256",()=>c(a,"ansi256",o,!1)),u(t.color,"ansi16m",()=>c(s,"rgb",l,!1)),u(t.bgColor,"ansi",()=>c(r,"ansi16",o,!0)),u(t.bgColor,"ansi256",()=>c(a,"ansi256",o,!0)),u(t.bgColor,"ansi16m",()=>c(s,"rgb",l,!0)),t}})},981018,(e,t,i)=>{"use strict";t.exports={stringReplaceAll:(e,t,i)=>{let n=e.indexOf(t);if(-1===n)return e;let r=t.length,a=0,s="";do s+=e.substr(a,n-a)+t+i,a=n+r,n=e.indexOf(t,a);while(-1!==n)return s+e.substr(a)},stringEncaseCRLFWithFirstIndex:(e,t,i,n)=>{let r=0,a="";do{let s="\r"===e[n-1];a+=e.substr(r,(s?n-1:n)-r)+t+(s?"\r\n":"\n")+i,r=n+1,n=e.indexOf("\n",r)}while(-1!==n)return a+e.substr(r)}}},529166,(e,t,i)=>{"use strict";let n,r=e.r(704567),{stdout:a,stderr:s}=e.r(181042),{stringReplaceAll:o,stringEncaseCRLFWithFirstIndex:l}=e.r(981018),{isArray:u}=Array,c=["ansi","ansi","ansi256","ansi16m"],d=Object.create(null);class p{constructor(e){return h(e)}}let h=e=>{let t={};return((e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3))throw Error("The `level` option should be an integer from 0 to 3");let i=a?a.level:0;e.level=void 0===t.level?i:t.level})(t,e),t.template=(...e)=>S(t.template,...e),Object.setPrototypeOf(t,f.prototype),Object.setPrototypeOf(t.template,t),t.template.constructor=()=>{throw Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},t.template.Instance=p,t.template};function f(e){return h(e)}for(let[e,t]of Object.entries(r))d[e]={get(){let i=g(this,v(t.open,t.close,this._styler),this._isEmpty);return Object.defineProperty(this,e,{value:i}),i}};d.visible={get(){let e=g(this,this._styler,!0);return Object.defineProperty(this,"visible",{value:e}),e}};let m=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(let e of m)d[e]={get(){let{level:t}=this;return function(...i){return g(this,v(r.color[c[t]][e](...i),r.color.close,this._styler),this._isEmpty)}}};for(let e of m)d["bg"+e[0].toUpperCase()+e.slice(1)]={get(){let{level:t}=this;return function(...i){return g(this,v(r.bgColor[c[t]][e](...i),r.bgColor.close,this._styler),this._isEmpty)}}};let y=Object.defineProperties(()=>{},{...d,level:{enumerable:!0,get(){return this._generator.level},set(e){this._generator.level=e}}}),v=(e,t,i)=>{let n,r;return void 0===i?(n=e,r=t):(n=i.openAll+e,r=t+i.closeAll),{open:e,close:t,openAll:n,closeAll:r,parent:i}},g=(e,t,i)=>{let n=(...e)=>u(e[0])&&u(e[0].raw)?T(n,S(n,...e)):T(n,1===e.length?""+e[0]:e.join(" "));return Object.setPrototypeOf(n,y),n._generator=e,n._styler=t,n._isEmpty=i,n},T=(e,t)=>{if(e.level<=0||!t)return e._isEmpty?"":t;let i=e._styler;if(void 0===i)return t;let{openAll:n,closeAll:r}=i;if(-1!==t.indexOf("\x1b"))for(;void 0!==i;)t=o(t,i.close,i.open),i=i.parent;let a=t.indexOf("\n");return -1!==a&&(t=l(t,r,n,a)),n+t+r},S=(t,...i)=>{let[r]=i;if(!u(r)||!u(r.raw))return i.join(" ");let a=i.slice(1),s=[r.raw[0]];for(let e=1;e<r.length;e++)s.push(String(a[e-1]).replace(/[{}\\]/g,"\\$&"),String(r.raw[e]));return void 0===n&&(n=e.r(12842)),n(t,s.join(""))};Object.defineProperties(f.prototype,d);let E=h(void 0);E.supportsColor=a,E.stderr=h({level:s?s.level:0}),E.stderr.supportsColor=s,t.exports=E},603206,(e,t,i)=>{"use strict";var n=e.e&&e.e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(i,"__esModule",{value:!0}),i.DebugLogger=i.newDebugLogger=void 0;let r=n(e.r(529166)),a=e.r(331484);function s(e){let t="";for(let i=0;i<e;i++)t+=r.default.blackBright("⎸ ");return t}let o=0,l="",u=0,c=[];i.newDebugLogger=function(t){let i,n,r=(i=process.env.APOLLO_FEDERATION_DEBUG,void 0!==(n=(0,a.validateStringContainsBoolean)(i))?n:i.split(",").map(e=>e.trim()).includes(t)),s=new d(t,r);if(r)for(let i of(e.g.console=e.r(611913),c.push(s),u=Math.max(u,t.length),c))d.prototype.updateHeader.call(i,u);return s};class d{constructor(e,t){this.name=e,this.enabled=t,this.header=r.default.blackBright(`[${e}] `)}updateHeader(e){let t="";if(e>this.name.length){let i=e-this.name.length;for(let e=0;e<i;e++)t+=" "}this.header=r.default.blackBright("["+t+this.name+"] ")}doLog(e){let t=this.header+l,i=e.replace(/\n/g,"\n"+t+" ");console.log(t+i)}log(e,t=r.default.yellow("• ")){return this.enabled&&("string"!=typeof e&&(e=e()),this.doLog(t+e)),this}groupedValues(e,t,i){if(!this.enabled)return this;for(let n of(this.group(i),e))this.doLog("- "+t(n));return this.groupEnd()}groupedEntries(e,t,i){if(!this.enabled)return this;for(let[n,r]of(this.group(),e.entries()))this.doLog("- "+t(n)+": "+i(r));return this.groupEnd()}group(e){return this.enabled&&(e&&this.log(e,r.default.blue("‣ ")),l=s(++o)),this}groupEnd(e){return this.enabled&&(o>0&&(l=s(--o)),e&&this.log(e,r.default.green("⇒ "))),this}}i.DebugLogger=d},105714,(e,t,i)=>{"use strict";var n=e.e&&e.e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(i,"__esModule",{value:!0}),i.extractSubgraphsFromSupergraph=i.extractSubgraphsNamesAndUrlsFromSupergraph=void 0;let r=e.r(168032),a=e.r(951071),s=e.r(785576),o=e.r(951071),l=e.r(331484),u=e.r(629644),c=e.r(826468),d=e.r(678270),p=e.r(383105),h=e.r(738207),f=n(e.r(522734)),m=n(e.r(814747)),y=e.r(331484),v=e.r(378422);function g(e,t){let i=new o.Subgraphs,n=t.graphDirective(e),r=t.graphEnum(e),s=new Map;for(let e of r.values){let t=e.appliedDirectivesOf(n);if(!t.length)throw Error(`Value ${e} of join__Graph enum has no @join__graph directive`);let r=t[0].arguments(),l=new o.Subgraph(r.name,r.url,(0,a.newEmptyFederation2Schema)());i.add(l),s.set(e.name,r.name)}return[i,s]}i.extractSubgraphsNamesAndUrlsFromSupergraph=function(e){let[t,i]=(0,u.validateSupergraph)(e),[n]=g(e,i);return n.values().map(e=>({name:e.name,url:e.url}))};class T{constructor(e,t){this.originalError=e,this.subgraph=t}}function S(e,t){if(!e)return[];let i=[];return(0,h.parseSelectionSet)({parentType:t,source:e,fieldAccessor:(e,t)=>{let n=e.field(t);return n&&i.push((0,r.baseType)(n.type)),n},validate:!1}),i}function E(e,t,i){var n;let{supergraph:a,getSubgraph:s,getSubgraphEnumValue:o}=i;(0,l.assert)(t.length>0,`Missing @join__type on ${e}`);let u=new Map;for(let i of t){let{graph:t,key:n,extension:a,resolvable:o,isInterfaceObject:c}=i.arguments(),d=u.get(t);if(!d){let n=s(i);(0,l.assert)(n,()=>`Should have found the subgraph for ${i}`);let a=c?"ObjectType":e.kind,o=n.schema.addType((0,r.newNamedType)(a,e.name));c&&o.applyDirective("interfaceObject"),d={type:o,subgraph:n},u.set(t,d)}if(n){let e=d.type.applyDirective("key",{fields:n,resolvable:o});a&&e.setOfExtension(d.type.newExtension())}}let c=null==(n=i.contextSpec)?void 0:n.contextDirective(a);if(c)for(let t of e.appliedDirectivesOf(c)){let{name:e}=t.arguments(),i=e.match(/^(.*)__([A-Za-z]\w*)$/),n=i?i[1]:void 0,r=i?i[2]:void 0;(0,l.assert)(n,`Invalid context name ${e} found in ${t} on ${t.parent}: does not match the expected pattern`);let a=u.get(o(n)),s=null==a?void 0:a.subgraph.metadata().contextDirective();a&&s&&(0,v.isFederationDirectiveDefinedInSchema)(s)&&a.type.applyDirective(s,{name:r})}return u}i.extractSubgraphsFromSupergraph=function(e,t=!0){let[i,n,o,c]=(0,u.validateSupergraph)(e),h=n.version.equals(new s.FeatureVersion(0,1));try{var v;let[s,u]=g(e,n),p=new Map;for(let[e,t]of u.entries())p.set(t,e);let f=(v=i.coreDefinition,e.types().filter(e=>!n.isSpecType(e)&&!v.isSpecType(e))),m={supergraph:e,subgraphs:s,joinSpec:n,contextSpec:o,costSpec:c,filteredTypes:f,getSubgraph:e=>{let t=e.arguments().graph;if(!t)return;let i=u.get(t);(0,l.assert)(i,()=>`Invalid graph name ${t} found in ${e} on ${e.parent}: does not match a graph defined in the @join__Graph enum`);let n=s.get(i);return(0,l.assert)(n,"All subgraphs should have been created by `collectEmptySubgraphs`"),n},getSubgraphEnumValue:e=>{let t=p.get(e);return(0,l.assert)(t,()=>`Invalid subgraph name ${e} found: does not match a subgraph defined in the @join__Graph enum`),t}};for(let e of(h?function({supergraph:e,subgraphs:t,joinSpec:i,filteredTypes:n,getSubgraph:s}){let o=i.typeDirective(e),u=i.ownerDirective(e),c=i.fieldDirective(e),p=function(e,t,i,n){let a=new Map;for(let s of t){let t=new Set;!function(e,t,i,n,a){let s=new Set,o=e.schemaDefinition.roots().map(e=>e.type);for(let i of e.types()){let{isEntityWithKeyInSubgraph:e,typesInFederationDirectives:n}=a(i,t);e&&o.push(i),n.forEach(e=>o.push(e))}for(;o.length>0;){let e=o.pop();if(i(e),!s.has(e.name))switch(s.add(e.name),e.kind){case"InterfaceType":e.allImplementations().forEach(e=>o.push(e));case"ObjectType":for(let i of(e.interfaces().forEach(e=>o.push(e)),e.fields())){let{isInSubgraph:e,typesInFederationDirectives:a}=n(i,t);e&&(i.arguments().forEach(e=>o.push((0,r.baseType)(e.type))),o.push((0,r.baseType)(i.type)),a.forEach(e=>o.push(e)))}break;case"InputObjectType":for(let i of e.fields()){let{isInSubgraph:e,typesInFederationDirectives:a}=n(i,t);e&&(o.push((0,r.baseType)(i.type)),a.forEach(e=>o.push(e)))}break;case"UnionType":e.members().forEach(e=>o.push(e.type))}}for(let t of e.directives())t.hasExecutableLocations()&&t.arguments().forEach(e=>o.push((0,r.baseType)(e.type)))}(e,s,e=>t.add(e.name),i,n),a.set(s,t)}return a}(e,t.names(),(e,t)=>{var i;let n=e.appliedDirectivesOf(c);if(n.length){let i=n.find(e=>{var i;return(null==(i=s(e))?void 0:i.name)===t});if(!i)return{isInSubgraph:!1,typesInFederationDirectives:[]};{let t=i.arguments();return{isInSubgraph:!0,typesInFederationDirectives:S(t.provides,(0,r.baseType)(e.type)).concat(S(t.requires,e.parent))}}}{let n=u?e.parent.appliedDirectivesOf(u):[];return{isInSubgraph:!n.length||(null==(i=s(n[0]))?void 0:i.name)==t,typesInFederationDirectives:[]}}},(e,t)=>{let i=e.appliedDirectivesOf(o).find(e=>{var i;return e.arguments().key&&(null==(i=s(e))?void 0:i.name)===t});return i?{isEntityWithKeyInSubgraph:!0,typesInFederationDirectives:S(i.arguments().key,e)}:{isEntityWithKeyInSubgraph:!1,typesInFederationDirectives:[]}}),h=(e,t)=>{var i,n;return null!=(n=null==(i=p.get(t))?void 0:i.has(e.name))&&n};for(let e of n){let i=e.appliedDirectivesOf(o);if(i.length)for(let t of i){let i=t.arguments(),n=s(t);(0,l.assert)(n,()=>`Should have found the subgraph for ${t}`);let a=n.schema,o=a.type(e.name);if(!o){let t=i.isInterfaceObject?"ObjectType":e.kind;o=a.addType((0,r.newNamedType)(t,e.name)),i.isInterfaceObject&&o.applyDirective("interfaceObject")}if(i.key){let{resolvable:e}=i,t=o.applyDirective("key",{fields:i.key,resolvable:e});i.extension&&t.setOfExtension(o.newExtension())}}else for(let i of t)h(e,i.name)&&i.schema.addType((0,r.newNamedType)(e.kind,e.name))}for(let e of n)switch(e.kind){case"ObjectType":case"InterfaceType":for(let i of e.interfaceImplementations()){let n=i.interface.name;for(let i of t){let t=i.schema.type(e.name),r=i.schema.type(n);t&&r&&t.addImplementedInterface(n)}}case"InputObjectType":for(let i of e.fields()){let n=i.appliedDirectivesOf(c);if(n.length){let t=(0,r.isObjectType)(e)&&n.length>1;for(let e of n){let n=s(e);n&&A(i,n,t,e.arguments())}}else{let n=u?e.appliedDirectivesOf(u):[];if(n.length>0){(0,l.assert)(1==n.length,()=>`Found multiple join__owner directives on type ${e}`);let t=s(n[0]);(0,l.assert)(t,()=>`Should have found the subgraph for ${n[0]}`),A(i,t,!1)}else{let n=(0,r.baseType)(i.type),a=(0,r.isObjectType)(e)&&t.values().filter(t=>t.schema.type(e.name)).length>1;for(let e of t)e.schema.type(n.name)&&A(i,e,a)}}}break;case"EnumType":for(let i of t){let t=i.schema.type(e.name);if(t)for(let i of((0,l.assert)((0,r.isEnumType)(t),()=>`${t} should be an enum but found a ${t.kind}`),e.values))t.addValue(i.name)}break;case"UnionType":for(let i of t){let t=i.schema.type(e.name);if(t)for(let n of((0,l.assert)((0,r.isUnionType)(t),()=>`${t} should be an enum but found a ${t.kind}`),e.types().map(e=>e.name))){let e=i.schema.type(n);e&&t.addType(e)}}}let f=e.directives().filter(e=>e.hasExecutableLocations());for(let i of t)for(let t of(function(e,t,i){let n=e.metadata();for(let o of e.schema.types())if((0,r.isObjectType)(o)||(0,r.isInterfaceType)(o)){for(let r of o.appliedDirectivesOf(n.keyDirective())){let n=i||!!r.ofExtension();w(e,o,r,t,n)}for(let i of o.fields()){for(let r of i.appliedDirectivesOf(n.requiresDirective()))w(e,o,r,t);let a=(0,r.baseType)(i.type);for(let s of i.appliedDirectivesOf(n.providesDirective()))(0,l.assert)((0,r.isObjectType)(a)||(0,r.isInterfaceType)(a),()=>`Found @provides on field ${i.coordinate} whose type ${i.type} (${a.kind}) is not an object or interface `),w(e,a,s,t)}var a=n,s=o;for(let e of s.interfaces())for(let t of e.fields()){let e=s.field(t.name);e?e.hasAppliedDirective(a.externalDirective())&&function(e,t){(0,d.isSubtype)(t.type,e.type)||((0,l.assert)((0,d.isSubtype)(e.type,t.type),()=>`For ${e.coordinate}, expected ${t.type} and ${e.type} to be in a subtyping relationship`),e.type=t.type)}(e,t):function(e,t,i){let n=i.addField(t.name,t.type);for(let e of t.arguments())n.addArgument(e.name,e.type,e.defaultValue);n.applyDirective(e.externalDirective())}(a,t,s)}}}(i,e,!0),(0,a.removeInactiveProvidesAndRequires)(i.schema),L(i.schema),f))(0,r.copyDirectiveDefinitionToSchema)({definition:t,schema:i.schema,copyDirectiveApplicationsInArguments:!1,locationFilter:e=>(0,r.isExecutableDirectiveLocation)(e)})}(m):function(e){let{objOrItfTypes:t,inputObjTypes:i,enumTypes:n,unionTypes:s}=function(e){let{supergraph:t,joinSpec:i,filteredTypes:n,getSubgraph:a}=e,s=i.typeDirective(t),o=[],u=[],c=[],d=[];for(let t of n){let i=t.appliedDirectivesOf(s);switch(t.kind){case"InterfaceType":case"ObjectType":o.push({type:t,subgraphsInfo:E(t,t.appliedDirectivesOf(s),e)});break;case"InputObjectType":u.push({type:t,subgraphsInfo:E(t,t.appliedDirectivesOf(s),e)});break;case"EnumType":c.push({type:t,subgraphsInfo:E(t,t.appliedDirectivesOf(s),e)});break;case"UnionType":d.push({type:t,subgraphsInfo:E(t,t.appliedDirectivesOf(s),e)});break;case"ScalarType":for(let n of i){let i=a(n);(0,l.assert)(i,()=>`Should have found the subgraph for ${n}`);let s=i.schema.addType((0,r.newNamedType)(t.kind,t.name));e.costSpec&&b(t,s,i,e.costSpec)}}}return{objOrItfTypes:o,inputObjTypes:u,enumTypes:c,unionTypes:d}}(e);!function(e,t){let i=e.joinSpec.fieldDirective(e.supergraph),n=e.joinSpec.implementsDirective(e.supergraph);for(let{type:a,subgraphsInfo:s}of((0,l.assert)(n,"@join__implements should existing for a fed2 supergraph"),t)){for(let e of a.appliedDirectivesOf(n)){let t=e.arguments();s.get(t.graph).type.addImplementedInterface(t.interface)}if(e.costSpec)for(let{type:t,subgraph:i}of s.values())b(a,t,i,e.costSpec);for(let t of a.fields()){let n=t.appliedDirectivesOf(i);if(0===n.length){let i=(0,r.isObjectType)(a)&&s.size>1;for(let{type:n,subgraph:r}of s.values())_({field:t,type:n,subgraph:r,isShareable:i,costSpec:e.costSpec})}else{let i=(0,r.isObjectType)(a)&&n.filter(e=>{let t=e.arguments();return!t.external&&!t.usedOverridden}).length>1;for(let r of n){let n=r.arguments();if(!n.graph)continue;let{type:a,subgraph:o}=s.get(n.graph);_({field:t,type:a,subgraph:o,isShareable:i,joinFieldArgs:n,costSpec:e.costSpec})}}}}}(e,t);let o=e.joinSpec.fieldDirective(e.supergraph);for(let{type:t,subgraphsInfo:n}of i)for(let i of t.fields()){let t=i.appliedDirectivesOf(o);if(0===t.length)for(let{type:t,subgraph:r}of n.values())D({field:i,type:t,subgraph:r,costSpec:e.costSpec});else for(let r of t){let t=r.arguments();if(!t.graph)continue;let{type:a,subgraph:s}=n.get(t.graph);D({field:i,type:a,subgraph:s,joinFieldArgs:t,costSpec:e.costSpec})}}let u=e.joinSpec.enumValueDirective(e.supergraph);for(let{type:t,subgraphsInfo:i}of n){if(e.costSpec)for(let{type:n,subgraph:r}of i.values())b(t,n,r,e.costSpec);for(let e of t.values){let t=u?e.appliedDirectivesOf(u):[];if(0===t.length)for(let{type:t}of i.values())t.addValue(e.name);else for(let n of t){let t=n.arguments(),{type:r}=i.get(t.graph);r.addValue(e.name)}}}!function(e,t){let i=e.joinSpec.unionMemberDirective(e.supergraph);for(let{type:e,subgraphsInfo:n}of t){let t=i?e.appliedDirectivesOf(i):[];if(0===t.length)for(let{type:t,subgraph:i}of n.values())for(let n of e.types()){let e=i.schema.type(n.name);e&&t.addType(e)}else for(let e of t){let t=e.arguments(),{type:i,subgraph:r}=n.get(t.graph);i.addType(r.schema.type(t.member))}}}(e,s);let c=e.supergraph.directives().filter(e=>e.hasExecutableLocations());for(let t of e.subgraphs)for(let e of((0,a.removeInactiveProvidesAndRequires)(t.schema),L(t.schema),c))(0,r.copyDirectiveDefinitionToSchema)({definition:e,schema:t.schema,copyDirectiveApplicationsInArguments:!1,locationFilter:e=>(0,r.isExecutableDirectiveLocation)(e)})}(m),s))if(t)try{e.validate()}catch(t){throw new T(t,e)}else e.assumeValid();return[s,p]}catch(n){let e,t=n;n instanceof T&&(t=n.originalError,e=n.subgraph);let i=e?`subgraph "${e.name}"`:"subgraphs";if(h){let e=`Error extracting ${i} from the supergraph: this might be due to errors in subgraphs that were mistakenly ignored by federation 0.x versions but are rejected by federation 2.
|
|
21
21
|
Please try composing your subgraphs with federation 2: this should help precisely pinpoint the problems and, once fixed, generate a correct federation 2 supergraph`;throw Error(`${e}.
|
|
22
22
|
|
|
23
23
|
Details:
|
|
24
24
|
${N(t)}`)}{let n=`Unexpected error extracting ${i} from the supergraph: this is either a bug, or the supergraph has been corrupted`,r=e?"\n\n"+function(e){if(!(0,y.validateStringContainsBoolean)(process.env[I]))return`Re-run with environment variable '${I}' set to 'true' to extract the invalid subgraph`;try{let t=`extracted-subgraph-${e.name}-${Date.now()}.graphql`,i=m.default.resolve(t);if(f.default.existsSync(i))throw Error(`candidate file ${t} already existed`);return f.default.writeFileSync(i,(0,p.printSchema)(e.schema)),`The (invalid) extracted subgraph has been written in: ${i}.`}catch(t){return`Was not able to print generated subgraph for "${e.name}" because: ${N(t)}`}}(e):"";throw Error(`${n}.
|
|
25
25
|
|
|
26
26
|
Details:
|
|
27
|
-
${N(t)}${r}`)}}};let I="APOLLO_FEDERATION_DEBUG_SUBGRAPHS";function b(e,t,i,n){let r=n.costDirective(e.schema());if(r){let n=e.appliedDirectivesOf(r)[0];n&&t.applyDirective(i.metadata().costDirective().name,n.arguments())}let a=n.listSizeDirective(e.schema());if(a){let n=e.appliedDirectivesOf(a)[0];n&&t.applyDirective(i.metadata().listSizeDirective().name,n.arguments())}}function N(e){let t=(0,v.errorCauses)(e);return t?(0,v.printErrors)(t):String(e)}function _({field:e,type:t,subgraph:i,isShareable:n,joinFieldArgs:r,costSpec:a}){let s=(null==r?void 0:r.type)?O(r.type,i.schema,i.name):R(e.type,i.schema,i.name),o=t.addField(e.name,s);for(let t of e.arguments()){let e=o.addArgument(t.name,R(t.type,i.schema,i.name),t.defaultValue);a&&b(t,e,i,a)}if((null==r?void 0:r.requires)&&o.applyDirective(i.metadata().requiresDirective(),{fields:r.requires}),(null==r?void 0:r.provides)&&o.applyDirective(i.metadata().providesDirective(),{fields:r.provides}),null==r?void 0:r.contextArguments){let e=i.metadata().fromContextDirective();if((0,v.isFederationDirectiveDefinedInSchema)(e))for(let t of r.contextArguments){let n=t.context.match(/^.*__([A-Za-z]\w*)$/);if(!n)throw Error(`Invalid context argument: ${t.context}`);o.addArgument(t.name,O(t.type,i.schema,i.name));let r=o.argument(t.name);null==r||r.applyDirective(e,{field:`$${n[1]} ${t.selection}`})}else throw Error(`@fromContext directive is not defined in the subgraph schema: ${i.name}`)}let l=!!(null==r?void 0:r.external);l&&o.applyDirective(i.metadata().externalDirective());let u=!!(null==r?void 0:r.usedOverridden);return!u||(null==r?void 0:r.overrideLabel)||o.applyDirective(i.metadata().externalDirective(),{reason:"[overridden]"}),(null==r?void 0:r.override)&&o.applyDirective(i.metadata().overrideDirective(),{from:r.override,...r.overrideLabel?{label:r.overrideLabel}:{}}),!n||l||u||o.applyDirective(i.metadata().shareableDirective()),a&&b(e,o,i,a),o}function D({field:e,type:t,subgraph:i,joinFieldArgs:n,costSpec:r}){let a=(null==n?void 0:n.type)?O(null==n?void 0:n.type,i.schema,i.name):R(e.type,i.schema,i.name),s=t.addField(e.name,a);return s.defaultValue=e.defaultValue,r&&b(e,s,i,r),s}function A(e,t,i,n){let a=t.schema.type(e.parent.name);a&&(e instanceof r.FieldDefinition?_({field:e,subgraph:t,type:a,isShareable:i,joinFieldArgs:n}):D({field:e,subgraph:t,type:a,joinFieldArgs:n}))}function O(e,t,i){try{return(0,c.builtTypeReference)(e,t)}catch(t){(0,l.assert)(!1,()=>`Cannot parse type "${e}" in subgraph ${i}: ${t}`)}}function R(e,t,i){switch(e.kind){case"ListType":return new r.ListType(R(e.ofType,t,i));case"NonNullType":return new r.NonNullType(R(e.ofType,t,i));default:let n=t.type(e.name);return(0,l.assert)(n,()=>`Cannot find type "${e.name}" in subgraph "${i}"`),n}}function w(e,t,i,n,s=!1){let o=e.metadata().externalDirective();try{(0,a.parseFieldSetArgument)({parentType:t,directive:i,fieldAccessor:function(t,i){let a=t.field(i);if(a)return s&&a.hasAppliedDirective(o)&&a.appliedDirectivesOf(o).forEach(e=>e.remove()),a;(0,l.assert)(!(0,r.isUnionType)(t),()=>`Shouldn't select field ${i} from union type ${t}`);let u=n.type(t.name).field(i);(0,l.assert)(u,()=>`No field named ${i} found on type ${t.name} in the supergraph`);let c=_({field:u,subgraph:e,type:t,isShareable:!1});return s||c.applyDirective(o),c},validate:!1})}catch(e){}}function L(e){for(let t of e.types())switch(t.kind){case"ObjectType":case"InterfaceType":case"InputObjectType":t.hasFields()||t.removeRecursive();break;case"UnionType":0===t.membersCount()&&t.removeRecursive()}}},629644,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.Supergraph=i.isFed1Supergraph=i.validateSupergraph=i.ROUTER_SUPPORTED_SUPERGRAPH_FEATURES=i.DEFAULT_SUPPORTED_SUPERGRAPH_FEATURES=void 0;let n=e.r(168032),r=e.r(785576),a=e.r(63672),s=e.r(994926),o=e.r(579034),l=e.r(826468),u=e.r(105714),c=e.r(408470);i.DEFAULT_SUPPORTED_SUPERGRAPH_FEATURES=new Set(["https://specs.apollo.dev/core/v0.1","https://specs.apollo.dev/core/v0.2","https://specs.apollo.dev/join/v0.1","https://specs.apollo.dev/join/v0.2","https://specs.apollo.dev/join/v0.3","https://specs.apollo.dev/join/v0.4","https://specs.apollo.dev/join/v0.5","https://specs.apollo.dev/tag/v0.1","https://specs.apollo.dev/tag/v0.2","https://specs.apollo.dev/tag/v0.3","https://specs.apollo.dev/inaccessible/v0.1","https://specs.apollo.dev/inaccessible/v0.2"]),i.ROUTER_SUPPORTED_SUPERGRAPH_FEATURES=new Set(["https://specs.apollo.dev/core/v0.1","https://specs.apollo.dev/core/v0.2","https://specs.apollo.dev/join/v0.1","https://specs.apollo.dev/join/v0.2","https://specs.apollo.dev/join/v0.3","https://specs.apollo.dev/join/v0.4","https://specs.apollo.dev/join/v0.5","https://specs.apollo.dev/tag/v0.1","https://specs.apollo.dev/tag/v0.2","https://specs.apollo.dev/tag/v0.3","https://specs.apollo.dev/inaccessible/v0.1","https://specs.apollo.dev/inaccessible/v0.2","https://specs.apollo.dev/authenticated/v0.1","https://specs.apollo.dev/requiresScopes/v0.1","https://specs.apollo.dev/policy/v0.1","https://specs.apollo.dev/context/v0.1","https://specs.apollo.dev/cost/v0.1","https://specs.apollo.dev/connect/v0.1","https://specs.apollo.dev/connect/v0.2","https://specs.apollo.dev/connect/v0.3","https://specs.apollo.dev/connect/v0.4","https://specs.apollo.dev/cacheTag/v0.1"]);let d=r.FeatureUrl.parse("https://specs.apollo.dev/core/v0.1");function p(e){let t,i,n=e.coreFeatures;if(!n)throw c.ERRORS.INVALID_FEDERATION_SUPERGRAPH.err("Invalid supergraph: must be a core schema");let r=n.getByIdentity(a.joinIdentity);if(!r)throw c.ERRORS.INVALID_FEDERATION_SUPERGRAPH.err("Invalid supergraph: must use the join spec");let l=a.JOIN_VERSIONS.find(r.url.version);if(!l)throw c.ERRORS.INVALID_FEDERATION_SUPERGRAPH.err(`Invalid supergraph: uses unsupported join spec version ${r.url.version} (supported versions: ${a.JOIN_VERSIONS.versions().join(", ")})`);let u=n.getByIdentity(s.ContextSpecDefinition.identity);if(u&&!(t=s.CONTEXT_VERSIONS.find(u.url.version)))throw c.ERRORS.INVALID_FEDERATION_SUPERGRAPH.err(`Invalid supergraph: uses unsupported context spec version ${u.url.version} (supported versions: ${s.CONTEXT_VERSIONS.versions().join(", ")})`);let d=n.getByIdentity(o.costIdentity);if(d&&!(i=o.COST_VERSIONS.find(d.url.version)))throw c.ERRORS.INVALID_FEDERATION_SUPERGRAPH.err(`Invalid supergraph: uses unsupported cost spec version ${d.url.version} (supported versions: ${o.COST_VERSIONS.versions().join(", ")})`);return[n,l,t,i]}i.validateSupergraph=p,i.isFed1Supergraph=function(e){return p(e)[1].version.equals(new r.FeatureVersion(0,1))};class h{constructor(e,t=i.DEFAULT_SUPPORTED_SUPERGRAPH_FEATURES,a=!0){this.schema=e,this.shouldValidate=a;const[s]=p(e);null!==t&&function(e,t){let i=[],a=e.coreItself;if(a.url.equals(d)){let t=[...e.allFeatures()].filter(e=>e.purpose);t.length>0&&i.push(c.ERRORS.UNSUPPORTED_LINKED_FEATURE.err(`the \`for:\` argument is unsupported by version ${a.url.version} of the core spec. Please upgrade to at least @core v0.2 (https://specs.apollo.dev/core/v0.2).`,{nodes:(0,n.sourceASTs)(a.directive,...t.map(e=>e.directive))}))}for(let n of e.allFeatures())(n.url.equals(d)||"EXECUTION"===n.purpose||"SECURITY"===n.purpose)&&!t.has(n.url.base.toString())&&i.push(c.ERRORS.UNSUPPORTED_LINKED_FEATURE.err(`feature ${n.url} is for: ${n.purpose} but is unsupported`,{nodes:n.directive.sourceAST}));if(i.length>0)throw(0,r.ErrCoreCheckFailed)(i)}(s,t),a?e.validate():e.assumeValid(),this.containedSubgraphs=(0,u.extractSubgraphsNamesAndUrlsFromSupergraph)(e)}static build(e,t){return new h("string"==typeof e?(0,l.buildSchema)(e,{validate:!1}):(0,l.buildSchemaFromAST)(e,{validate:!1}),null==t?void 0:t.supportedFeatures,null==t?void 0:t.validateSupergraph)}static buildForTests(e,t){return h.build(e,{supportedFeatures:i.ROUTER_SUPPORTED_SUPERGRAPH_FEATURES,validateSupergraph:t})}subgraphsMetadata(){return this.containedSubgraphs}subgraphs(){if(!this._subgraphs){let e=(0,u.extractSubgraphsFromSupergraph)(this.schema,this.shouldValidate);this._subgraphs=e[0],this._subgraphNameToGraphEnumValue=e[1]}return this._subgraphs}subgraphNameToGraphEnumValue(){if(!this._subgraphNameToGraphEnumValue){let e=(0,u.extractSubgraphsFromSupergraph)(this.schema,this.shouldValidate);this._subgraphs=e[0],this._subgraphNameToGraphEnumValue=e[1]}return new Map([...this._subgraphNameToGraphEnumValue])}apiSchema(){return this.schema.toAPISchema()}}i.Supergraph=h},388500,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.upgradeSubgraphsIfNecessary=i.RemovedTagOnExternal=i.FieldsArgumentCoercionToString=i.ProvidesOnNonCompositeRemoval=i.ProvidesOrRequiresOnInterfaceFieldRemoval=i.KeyOnInterfaceRemoval=i.ShareableTypeAddition=i.ShareableFieldAddition=i.InactiveProvidesOrRequiresFieldsRemoval=i.InactiveProvidesOrRequiresRemoval=i.TypeWithOnlyUnusedExternalRemoval=i.UnusedExternalRemoval=i.ExternalOnObjectTypeRemoval=i.ExternalOnInterfaceRemoval=i.TypeExtensionRemoval=i.ExternalOnTypeExtensionRemoval=void 0;let n=e.r(186846),r=e.r(408470),a=e.r(168032),s=e.r(951071),o=e.r(331484),l=e.r(367356),u=e.r(479209);class c{constructor(e){this.field=e,this.id="EXTERNAL_ON_TYPE_EXTENSION_REMOVAL"}toString(){return`Removed @external from field "${this.field}" as it is a key of an extension type`}}i.ExternalOnTypeExtensionRemoval=c;class d{constructor(e){this.type=e,this.id="TYPE_EXTENSION_REMOVAL"}toString(){return`Switched type "${this.type}" from an extension to a definition`}}i.TypeExtensionRemoval=d;class p{constructor(e){this.field=e,this.id="EXTERNAL_ON_INTERFACE_REMOVAL"}toString(){return`Removed @external directive on interface type field "${this.field}": @external is nonsensical on interface fields`}}i.ExternalOnInterfaceRemoval=p;class h{constructor(e){this.type=e,this.id="EXTERNAL_ON_OBJECT_TYPE_REMOVAL"}toString(){return`Removed @external directive on object type "${this.type}": @external on types was not rejected but was inactive in fed1`}}i.ExternalOnObjectTypeRemoval=h;class f{constructor(e){this.field=e,this.id="UNUSED_EXTERNAL_REMOVAL"}toString(){return`Removed @external field "${this.field}" as it was not used in any @key, @provides or @requires`}}i.UnusedExternalRemoval=f;class m{constructor(e){this.type=e,this.id="TYPE_WITH_ONLY_UNUSED_EXTERNAL_REMOVAL"}toString(){return`Removed type ${this.type} that is not referenced in the schema and only declares unused @external fields`}}i.TypeWithOnlyUnusedExternalRemoval=m;class y{constructor(e,t){this.parent=e,this.removed=t,this.id="INACTIVE_PROVIDES_OR_REQUIRES_REMOVAL"}toString(){return`Removed directive ${this.removed} on "${this.parent}": none of the fields were truly @external`}}i.InactiveProvidesOrRequiresRemoval=y;class v{constructor(e,t,i){this.parent=e,this.original=t,this.updated=i,this.id="INACTIVE_PROVIDES_OR_REQUIRES_FIELDS_REMOVAL"}toString(){return`Updated directive ${this.original} on "${this.parent}" to ${this.updated}: removed fields that were not truly @external`}}i.InactiveProvidesOrRequiresFieldsRemoval=v;class g{constructor(e,t){this.field=e,this.declaringSubgraphs=t,this.id="SHAREABLE_FIELD_ADDITION"}toString(){return`Added @shareable to field "${this.field}": it is also resolved by ${(0,s.printSubgraphNames)(this.declaringSubgraphs)}`}}i.ShareableFieldAddition=g;class T{constructor(e,t){this.type=e,this.declaringSubgraphs=t,this.id="SHAREABLE_TYPE_ADDITION"}toString(){return`Added @shareable to type "${this.type}": it is a "value type" and is also declared in ${(0,s.printSubgraphNames)(this.declaringSubgraphs)}`}}i.ShareableTypeAddition=T;class S{constructor(e){this.type=e,this.id="KEY_ON_INTERFACE_REMOVAL"}toString(){return`Removed @key on interface "${this.type}": while allowed by federation 0.x, @key on interfaces were completely ignored/had no effect`}}i.KeyOnInterfaceRemoval=S;class E{constructor(e,t){this.field=e,this.directive=t,this.id="PROVIDES_OR_REQUIRES_ON_INTERFACE_FIELD_REMOVAL"}toString(){return`Removed @${this.directive} on interface field "${this.field}": while allowed by federation 0.x, @${this.directive} on interface fields were completely ignored/had no effect`}}i.ProvidesOrRequiresOnInterfaceFieldRemoval=E;class I{constructor(e,t){this.field=e,this.type=t,this.id="PROVIDES_ON_NON_COMPOSITE_REMOVAL"}toString(){return`Removed @provides directive on field "${this.field}" as it is of non-composite type "${this.type}": while not rejected by federation 0.x, such @provide is nonsensical and was ignored`}}i.ProvidesOnNonCompositeRemoval=I;class b{constructor(e,t,i,n){this.element=e,this.directive=t,this.before=i,this.after=n,this.id="FIELDS_ARGUMENT_COERCION_TO_STRING"}toString(){return`Coerced "fields" argument for directive @${this.directive} for "${this.element}" into a string: coerced from ${this.before} to ${this.after}`}}i.FieldsArgumentCoercionToString=b;class N{constructor(e,t){this.application=e,this.element=t,this.id="REMOVED_TAG_ON_EXTERNAL"}toString(){return`Removed ${this.application} application on @external "${this.element}" as the @tag application is on another definition`}}function _(e){let t=(0,s.federationMetadata)(e.schema());(0,o.assert)(t,"Should be a subgraph schema");let i=e.hasAppliedDirective(t.extendsDirective());return(e.hasExtensionElements()||i)&&((0,a.isObjectType)(e)||(0,a.isInterfaceType)(e))&&(i||!e.hasNonExtensionElements())}function D(e){let t=(0,s.federationMetadata)(e.schema());return(0,o.assert)(t,"Should be a subgraph schema"),(0,a.isObjectType)(e)&&e.isRootType()&&(e.hasAppliedDirective(t.extendsDirective())||e.hasExtensionElements()&&!e.hasNonExtensionElements())}i.RemovedTagOnExternal=N,i.upgradeSubgraphsIfNecessary=function(e){let t=new Map;if(e.values().every(e=>e.isFed2Subgraph()))return{subgraphs:e,changes:t};let i=new s.Subgraphs,n=[],a=new o.SetMultiMap,l=new o.SetMultiMap,u=new Map;for(let t of e.values()){for(let e of t.schema.objectTypes()){let i=u.get(e.name);i||(i=new Map,u.set(e.name,i)),i.set(t.name,[e,t.metadata()])}for(let e of t.schema.interfaceTypes()){let i=u.get(e.name);i||(i=new Map,u.set(e.name,i)),i.set(t.name,[e,t.metadata()])}}for(let r of e.values())if(r.isFed2Subgraph())for(let e of(i.add(r),r.metadata().interfaceObjectDirective().applications())){let t=e.parent.name;a.add(t,r.name)}else{let a=new A(r,e.values(),u).upgrade();if(a.errors)n=n.concat(a.errors);else for(let e of(i.add(a.upgraded),t.set(r.name,a.changes),a.interfaceKeyTypes))l.add(e,r.name)}for(let[e,t]of a){let i=l.get(e);i&&n.push(r.ERRORS.INTERFACE_OBJECT_USAGE_ERROR.err(`The @interfaceObject directive is used on type "${e}" in ${(0,s.printSubgraphNames)([...t])}, which requires other subgraphs to resolve its type name via an interface @key. However, @key on an interface in a federation 1 subgraph does not mean it can fulfill the __typename-resolution requirement that @interfaceObject depends on. For ${(0,s.printSubgraphNames)([...i])}, either upgrade them to federation 2 subgraphs or remove @key from the type.`))}return 0===n.length?{subgraphs:i,changes:t}:{errors:n}};class A{constructor(e,t,i){this.originalSubgraph=e,this.allSubgraphs=t,this.objectTypeMap=i,this.changes=new o.MultiMap,this.errors=[],this.interfaceKeyTypes=new Set,this.schema=e.schema.clone(),this.renameFederationTypes(),this.subgraph=new s.Subgraph(e.name,e.url,this.schema);try{(0,s.setSchemaAsFed2Subgraph)(this.schema)}catch(t){const e=(0,r.errorCauses)(t);if(e)e.forEach(e=>this.addError(e));else throw t}this.metadata=this.subgraph.metadata()}addError(e){this.errors.push((0,s.addSubgraphToError)(e,this.subgraph.name,r.ERRORS.INVALID_GRAPHQL))}renameFederationTypes(){for(let e of u.FEDERATION1_TYPES){let t=this.originalSubgraph.metadata().federationTypeNameInSchema(e.name),i=this.schema.type(t);i&&i.rename(`federation__${e.name}`)}}external(e){let t=e.appliedDirectivesOf(this.metadata.externalDirective());return 0===t.length?void 0:t[0]}addChange(e){this.changes.add(e.id,e)}checkForExtensionWithNoBase(e){var t;if(D(e)||!_(e))return;let i=null==(t=(0,o.firstOf)(e.extensions().values()))?void 0:t.sourceAST,n=Array.from(this.objectTypeMap.get(e.name).entries()).filter(([e,t])=>e!==this.subgraph.name);for(let e=0;e<n.length;e+=1){let t=n[e][1][0];if(t&&t.hasNonExtensionElements())return}this.addError(r.ERRORS.EXTENSION_WITH_NO_BASE.err(`Type "${e}" is an extension type, but there is no type definition for "${e}" in any subgraph.`,{nodes:i}))}preUpgradeValidations(){for(let e of this.schema.types())this.checkForExtensionWithNoBase(e)}upgrade(){if(this.errors.length>0||(this.preUpgradeValidations(),this.fixFederationDirectivesArguments(),this.removeExternalOnInterface(),this.removeExternalOnObjectTypes(),this.removeExternalOnTypeExtensions(),this.fixInactiveProvidesAndRequires(),this.removeTypeExtensions(),this.removeDirectivesOnInterface(),this.removeProvidesOnNonComposite(),this.removeUnusedExternals(),this.addShareable(),this.removeTagOnExternal(),this.errors.length>0))return{errors:this.errors};try{return this.subgraph.validate(),{upgraded:this.subgraph,changes:this.changes,interfaceKeyTypes:this.interfaceKeyTypes}}catch(t){let e=(0,r.errorCauses)(t);if(!e)throw t;return{errors:e}}}fixFederationDirectivesArguments(){var e;for(let t of[this.metadata.keyDirective(),this.metadata.requiresDirective(),this.metadata.providesDirective()])for(let i of Array.from(t.applications())){let r=i.arguments().fields;if("string"!=typeof r){Array.isArray(r)&&r.every(e=>"string"==typeof e)&&this.replaceFederationDirectiveApplication(i,i.toString(),r.join(" "),t.sourceAST);continue}let a=i.sourceAST;if(a&&"Directive"===a.kind){for(let t of null!=(e=a.arguments)?e:[])if("fields"===t.name.value&&t.value.kind===n.Kind.ENUM){this.replaceFederationDirectiveApplication(i,(0,n.print)(a),r,{...a,arguments:[{...t,value:{kind:n.Kind.STRING,value:r}}]});break}}}}removeExternalOnInterface(){for(let e of this.schema.interfaceTypes())for(let t of e.fields()){let e=this.external(t);e&&(this.addChange(new p(t.coordinate)),e.remove())}}removeExternalOnObjectTypes(){for(let e of this.schema.objectTypes()){let t=e.appliedDirectivesOf(this.metadata.externalDirective())[0];t&&(this.addChange(new h(e.coordinate)),t.remove())}}replaceFederationDirectiveApplication(e,t,i,n){let r=e.definition,a=e.parent;e.remove();let s=a.applyDirective(r,{fields:i});s.sourceAST=n,this.addChange(new b(a.coordinate,r.name,t,s.toString()))}fixInactiveProvidesAndRequires(){(0,s.removeInactiveProvidesAndRequires)(this.schema,(e,t,i)=>{i?this.addChange(new v(e.coordinate,t.toString(),i.toString())):this.addChange(new y(e.coordinate,t.toString()))})}removeExternalOnTypeExtensions(){for(let e of this.schema.types())if((0,a.isCompositeType)(e)&&(_(e)||D(e)))if(e.appliedDirectivesOf(this.metadata.keyDirective()).length>0)for(let t of e.appliedDirectivesOf(this.metadata.keyDirective()))(0,s.collectTargetFields)({parentType:e,directive:t,includeInterfaceFieldsImplementations:!1,validate:!1}).forEach(t=>{if(t.parent!==e)return;let i=this.external(t);i&&(this.addChange(new c(t.coordinate)),i.remove())});else for(let[t,i]of Array.from(this.objectTypeMap.get(e.name).entries()).filter(([e,t])=>e!==this.subgraph.name)){let[n,r]=i;(0,o.assert)((0,a.isCompositeType)(n),()=>`Type ${e} is of kind ${e.kind} in ${this.subgraph.name} but ${n.kind} in ${t}`);let l=n.appliedDirectivesOf(r.keyDirective());0!==l.length&&(0,s.collectTargetFields)({parentType:n,directive:l[0],includeInterfaceFieldsImplementations:!1,validate:!1}).forEach(t=>{if(t.parent!==n)return;let i=e.field(t.name);if(!i)return;let r=this.external(i);r&&(this.addChange(new c(i.coordinate)),r.remove())})}}removeTypeExtensions(){for(let e of this.schema.types())(_(e)||D(e))&&(this.addChange(new d(e.coordinate)),e.removeExtensions())}removeUnusedExternals(){for(let e of this.schema.types())if((0,a.isObjectType)(e)||(0,a.isInterfaceType)(e)){for(let t of e.fields())this.metadata.isFieldExternal(t)&&!this.metadata.isFieldUsed(t)&&(this.addChange(new f(t.coordinate)),t.remove());e.hasFields()||(e.isReferenced()?this.addError(r.ERRORS.TYPE_WITH_ONLY_UNUSED_EXTERNAL.err(`Type ${e} contains only external fields and all those fields are all unused (they do not appear in any @key, @provides or @requires).`,{nodes:e.sourceAST})):(this.addChange(new m(e.name)),e.remove()))}}removeDirectivesOnInterface(){for(let e of this.schema.interfaceTypes()){for(let t of e.appliedDirectivesOf(this.metadata.keyDirective()))this.addChange(new S(e.name)),this.interfaceKeyTypes.add(e.name),t.remove();for(let t of e.fields())for(let e of[this.metadata.providesDirective(),this.metadata.requiresDirective()])for(let i of t.appliedDirectivesOf(e))this.addChange(new E(t.coordinate,e.name)),i.remove()}}removeProvidesOnNonComposite(){for(let e of this.schema.objectTypes())for(let t of e.fields())if(!(0,a.isCompositeType)((0,a.baseType)(t.type)))for(let e of t.appliedDirectivesOf(this.metadata.providesDirective()))this.addChange(new I(t.coordinate,t.type.toString())),e.remove()}addShareable(){let e=this.originalSubgraph.metadata(),t=this.metadata.keyDirective(),i=this.metadata.shareableDirective();for(let n of this.schema.objectTypes())if(!n.isSubscriptionRootType())if(n.hasAppliedDirective(t)||n.isRootType())for(let t of n.fields()){if(e.isFieldShareable(t))continue;let r=Array.from(this.objectTypeMap.get(n.name).entries()).filter(([e,i])=>{if(e===this.subgraph.name)return!1;let n=i[0].field(t.name);return!!n&&(!i[1].isFieldExternal(n)||i[1].isFieldPartiallyExternal(n))});r.length>0&&!t.hasAppliedDirective(i)&&(t.applyDirective(i),this.addChange(new g(t.coordinate,r.map(([e])=>e))))}else{let e=Array.from(this.objectTypeMap.get(n.name).entries()).filter(([e,t])=>e!==this.subgraph.name);e.length>0&&!n.hasAppliedDirective(i)&&(n.applyDirective(i),this.addChange(new T(n.coordinate,e.map(([e])=>e))))}}removeTagOnExternal(){let e=this.schema.directive("tag");if(e)for(let t of Array.from(e.applications())){let e=t.parent;e instanceof a.FieldDefinition&&this.external(e)&&this.allSubgraphs.map(t=>t.name===this.originalSubgraph.name?void 0:function(e,t,i){let n=e.type(t);return n&&(0,a.isCompositeType)(n)?n.field(i):void 0}(t.schema,e.parent.name,e.name)).filter(e=>!(e&&e.hasAppliedDirective("external"))).some(e=>e&&e.appliedDirectivesOf("tag").some(e=>(0,l.valueEquals)(t.arguments(),e.arguments())))&&(this.addChange(new N(t.toString(),e.coordinate)),t.remove())}}}},327750,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.graphQLJSDirectiveToAST=i.graphQLJSNamedTypeToAST=i.graphQLJSSchemaToAST=void 0;let n=e.r(186846),r=e.r(168032),a=[n.OperationTypeNode.QUERY,n.OperationTypeNode.MUTATION,n.OperationTypeNode.SUBSCRIPTION];function s({definition:e,extensions:t}){return e?[e,...t]:t}function o(e){return e.astNode||e.extensionASTNodes.length>0?{definition:e.astNode||void 0,extensions:e.extensionASTNodes}:{definition:(0,n.parse)((0,n.printType)(e)).definitions[0],extensions:[]}}function l(e){if(e.astNode)return e.astNode;{let t=new n.GraphQLSchema({directives:[e],assumeValid:!0});return(0,n.parse)((0,n.printSchema)(t)).definitions.find(e=>e.kind===n.Kind.DIRECTIVE_DEFINITION)}}i.graphQLJSSchemaToAST=function(e){let t=Object.values(e.getTypeMap()).filter(e=>!(0,n.isIntrospectionType)(e)&&!(0,n.isSpecifiedScalarType)(e)),i=e.getDirectives().filter(e=>!(0,n.isSpecifiedDirective)(e)),u=s(function(e){if(e.astNode||e.extensionASTNodes.length>0)return{definition:e.astNode||void 0,extensions:e.extensionASTNodes};{var t;let i;if(t=e,a.some(e=>{var i,n;return i=t.getRootType(e),n=e,!!i&&i.name!==(0,r.defaultRootName)(n)})){let t=[];for(let i of a){let r=e.getRootType(i);r&&t.push({kind:n.Kind.OPERATION_TYPE_DEFINITION,operation:i,type:{kind:n.Kind.NAMED_TYPE,name:{kind:n.Kind.NAME,value:r.name}}})}i={kind:n.Kind.SCHEMA_DEFINITION,description:e.description?{kind:n.Kind.STRING,value:e.description}:void 0,operationTypes:t}}return{definition:i,extensions:[]}}}(e)),c=t.map(e=>s(o(e))).flat(),d=i.map(e=>l(e));return{kind:n.Kind.DOCUMENT,definitions:[...u,...c,...d]}},i.graphQLJSNamedTypeToAST=o,i.graphQLJSDirectiveToAST=l},378422,(e,t,i)=>{"use strict";var n=e.e&&e.e.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),r=e.e&&e.e.__exportStar||function(e,t){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(t,i)||n(t,e,i)};Object.defineProperty(i,"__esModule",{value:!0}),i.coreFeatureDefinitionIfKnown=void 0,r(e.r(168032),i),r(e.r(826468),i),r(e.r(383105),i),r(e.r(367356),i),r(e.r(951071),i),r(e.r(678270),i),r(e.r(738207),i),r(e.r(331484),i),r(e.r(603206),i),r(e.r(785576),i),r(e.r(63672),i),r(e.r(193151),i),r(e.r(355415),i),r(e.r(479209),i),r(e.r(994926),i),r(e.r(629644),i),r(e.r(408470),i),r(e.r(388500),i),r(e.r(308126),i),r(e.r(327750),i),r(e.r(343924),i);var a=e.r(319894);Object.defineProperty(i,"coreFeatureDefinitionIfKnown",{enumerable:!0,get:function(){return a.coreFeatureDefinitionIfKnown}}),r(e.r(253636),i),r(e.r(255604),i),r(e.r(484469),i),r(e.r(569186),i),r(e.r(506370),i),r(e.r(579034),i),r(e.r(379166),i)},533126,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.cacheControlFromInfo=i.maybeCacheControlFromInfo=void 0,i.maybeCacheControlFromInfo=function(e){return e.cacheControl?.cacheHint?.restrict?e.cacheControl:null},i.cacheControlFromInfo=function(e){if(!("cacheControl"in e))throw Error("The `info` argument does not appear to have a cacheControl field. Check that you are using Apollo Server 3 or newer and that you aren't using ApolloServerPluginCacheControlDisabled.");if(!e.cacheControl?.cacheHint?.restrict)throw Error("The `info` argument has a cacheControl field but it does not appear to be from ApolloServer 3 or newer. Check that you are using Apollo Server 3 or newer and that you aren't using ApolloServerPluginCacheControlDisabled.");return e.cacheControl}},273083,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.isFederationType=i.federationTypes=i.serviceField=i.entitiesField=i.entitiesResolver=i.LinkImportType=i.AnyType=i.ServiceType=i.EntityType=void 0;let n=e.r(186846),r=e.r(533126),a=e.r(224361);function s(e){return"function"==typeof(null==e?void 0:e.then)}async function o(e,t){let i=await e;if(null!==i&&"object"==typeof i){if("__typename"in i&&i.__typename!==t)return{...i,__typename:t};Object.defineProperty(i,"__typename",{value:t})}return i}function l(e,t,i,r){if(null==e)throw new n.GraphQLError(`Abstract type "${i.name}" \`__resolveReference\` method must resolve to an Object type at runtime. Either the object returned by "${i}.__resolveReference" must include a valid \`__typename\` field, or the "${i.name}" type should provide a "resolveType" function or each possible type should provide an "isTypeOf" function.`);if("string"!=typeof e)throw new n.GraphQLError(`Abstract type "${i.name}" \`__resolveReference\` method must resolve to an Object type at runtime with value ${(0,a.inspect)(r)}, received "${(0,a.inspect)(e)}".`);let s=t.getType(e);if(null==s)throw new n.GraphQLError(`Abstract type "${i.name}" \`__resolveReference\` method resolved to a type "${e}" that does not exist inside the schema.`);if(!(0,n.isObjectType)(s))throw new n.GraphQLError(`Abstract type "${i.name}" \`__resolveReference\` method resolved to a non-object type "${e}".`);if(!t.isSubType(i,s))throw new n.GraphQLError(`Runtime Object type "${s.name}" \`__resolveReference\` method is not a possible type for "${i.name}".`);return s}async function u({type:e,value:t,context:i,info:r,callback:a}){var o;let c=await t;if(null===c)return c;let d=(null!=(o=e.resolveType)?o:n.defaultTypeResolver)(c,i,r,e);return s(d)?d.then(t=>a(l(t,r.schema,e,c))):a(l(d,r.schema,e,c))}function c(e){var t,i;return null==(i=null==(t=e.extensions.apollo)?void 0:t.subgraph)?void 0:i.resolveReference}function d({representations:e,context:t,info:i}){return e.map(e=>{let{__typename:a}=e,l=i.schema.getType(a);if(!l||!((0,n.isObjectType)(l)||(0,n.isInterfaceType)(l)))throw Error(`The _entities resolver tried to load an entity for type "${a}", but no object or interface type of that name was found in the schema`);let d=(0,r.maybeCacheControlFromInfo)(i);if(d){let e=d.cacheHintFromType(l);e&&d.cacheHint.restrict(e)}let p=c(l),h=p?p(e,t,i):e;return(0,n.isInterfaceType)(l)?u({type:l,value:h,context:t,info:i,callback:e=>{let n=o(h,e.name);if(!p){let r=c(e);r&&(n=o(n=s(n)?n.then(e=>r(e,t,i)):r(n,t,i),e.name))}return n}}):o(h,a)})}i.EntityType=new n.GraphQLUnionType({name:"_Entity",types:[]}),i.ServiceType=new n.GraphQLObjectType({name:"_Service",fields:{sdl:{type:n.GraphQLString,description:"The sdl representing the federated service capabilities. Includes federation directives, removes federation types, and includes rest of full schema after schema directives have been applied"}}}),i.AnyType=new n.GraphQLScalarType({name:"_Any",serialize:e=>e}),i.LinkImportType=new n.GraphQLScalarType({name:"link__Import",specifiedByURL:null}),i.entitiesResolver=d,i.entitiesField={type:new n.GraphQLNonNull(new n.GraphQLList(i.EntityType)),args:{representations:{type:new n.GraphQLNonNull(new n.GraphQLList(new n.GraphQLNonNull(i.AnyType)))}},resolve:(e,{representations:t},i,n)=>d({representations:t,context:i,info:n})},i.serviceField={type:new n.GraphQLNonNull(i.ServiceType)},i.federationTypes=[i.ServiceType,i.AnyType,i.EntityType,i.LinkImportType],i.isFederationType=function(e){return(0,n.isNamedType)(e)&&i.federationTypes.some(({name:t})=>t===e.name)}},37188,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.buildFederatedSchema=i.buildSubgraphSchema=void 0;let n=e.r(224361),r=e.r(186846),a=e.r(242080),s=e.r(378422),o=e.r(273083);function l(e){var t;let i;if("typeDefs"in e){let{typeDefs:t,resolvers:n}=e;i=(Array.isArray(t)?t:[t]).map((e,t)=>{let i={typeDefs:e};return 0===t&&n&&(i.resolvers=n),i})}else i=e;let n=(0,a.modulesFromSDL)(i),l=(0,r.concatAST)(n.map(e=>e.typeDefs)),u=(0,s.buildSubgraph)(s.FEDERATION_UNNAMED_SUBGRAPH_NAME,"",l,!1),c=(0,s.printSchema)(u.schema),d=u.schema.toGraphQLJSSchema(),p=null==(t=u.schema.schemaDefinition.rootType("query"))?void 0:t.name;for(let e of((0,s.assert)(p,"A Query root type should have been added by `buildSubgraph`"),(0,a.addResolversToSchema)(d,{[p]:{_service:()=>({sdl:c})}}),u.metadata().entityType()&&(0,a.addResolversToSchema)(d,{[p]:{_entities:(e,{representations:t},i,n)=>(0,o.entitiesResolver)({representations:t,context:i,info:n})},_Entity:{__resolveType:e=>e.__typename}}),n))e.resolvers&&(0,a.addResolversToSchema)(d,e.resolvers);return d}i.buildSubgraphSchema=l,i.buildFederatedSchema=(0,n.deprecate)(l,"'buildFederatedSchema' is deprecated. Use 'buildSubgraphSchema' instead.")},554529,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.printBlockString=i.printType=i.printIntrospectionSchema=i.printSubgraphSchema=void 0;let n=e.r(186846),r=e.r(378422);i.printSubgraphSchema=function(e){let t=(0,r.graphQLJSSchemaToAST)(e);return(0,r.buildSubgraph)(r.FEDERATION_UNNAMED_SUBGRAPH_NAME,"",t,!1).toString()},i.printIntrospectionSchema=function(e){let t=(0,r.graphQLJSSchemaToAST)(e),i=(0,r.buildSubgraph)(r.FEDERATION_UNNAMED_SUBGRAPH_NAME,"",t,!1);return(0,r.printSchema)(i.schema)},i.printType=function(e){let{definition:t,extensions:i}=(0,r.graphQLJSNamedTypeToAST)(e);return(t?[t]:[]).concat(i).map(e=>(0,n.print)(e)).join("\n\n")},i.printBlockString=function(e,t=!1){let i=!e.includes("\n"),n=" "===e[0]||" "===e[0],r='"'===e[e.length-1],a="\\"===e[e.length-1],s=!i||r||a||t,o="";return s&&!(i&&n)&&(o+="\n"),o+=e,s&&(o+="\n"),'"""'+o.replace(/"""/g,'\\"""')+'"""'}},429630,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.printSubgraphSchema=i.buildSubgraphSchema=void 0;var n=e.r(37188);Object.defineProperty(i,"buildSubgraphSchema",{enumerable:!0,get:function(){return n.buildSubgraphSchema}});var r=e.r(554529);Object.defineProperty(i,"printSubgraphSchema",{enumerable:!0,get:function(){return r.printSubgraphSchema}})},779430,e=>{"use strict";var t=function(e,i){return(t=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])})(e,i)};function i(e,i){if("function"!=typeof i&&null!==i)throw TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}var n=function(){return(n=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};function r(e,t){var i={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(i[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,n=Object.getOwnPropertySymbols(e);r<n.length;r++)0>t.indexOf(n[r])&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(i[n[r]]=e[n[r]]);return i}function a(e,t,i,n){var r,a=arguments.length,s=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(s=(a<3?r(s):a>3?r(t,i,s):r(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s}function s(e,t){return function(i,n){t(i,n,e)}}function o(e,t,i,n,r,a){function s(e){if(void 0!==e&&"function"!=typeof e)throw TypeError("Function expected");return e}for(var o,l=n.kind,u="getter"===l?"get":"setter"===l?"set":"value",c=!t&&e?n.static?e:e.prototype:null,d=t||(c?Object.getOwnPropertyDescriptor(c,n.name):{}),p=!1,h=i.length-1;h>=0;h--){var f={};for(var m in n)f[m]="access"===m?{}:n[m];for(var m in n.access)f.access[m]=n.access[m];f.addInitializer=function(e){if(p)throw TypeError("Cannot add initializers after decoration has completed");a.push(s(e||null))};var y=(0,i[h])("accessor"===l?{get:d.get,set:d.set}:d[u],f);if("accessor"===l){if(void 0===y)continue;if(null===y||"object"!=typeof y)throw TypeError("Object expected");(o=s(y.get))&&(d.get=o),(o=s(y.set))&&(d.set=o),(o=s(y.init))&&r.unshift(o)}else(o=s(y))&&("field"===l?r.unshift(o):d[u]=o)}c&&Object.defineProperty(c,n.name,d),p=!0}function l(e,t,i){for(var n=arguments.length>2,r=0;r<t.length;r++)i=n?t[r].call(e,i):t[r].call(e);return n?i:void 0}function u(e){return"symbol"==typeof e?e:"".concat(e)}function c(e,t,i){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:i?"".concat(i," ",t):t})}function d(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function p(e,t,i,n){return new(i||(i=Promise))(function(r,a){function s(e){try{l(n.next(e))}catch(e){a(e)}}function o(e){try{l(n.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?r(e.value):((t=e.value)instanceof i?t:new i(function(e){e(t)})).then(s,o)}l((n=n.apply(e,t||[])).next())})}function h(e,t){var i,n,r,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=o(0),s.throw=o(1),s.return=o(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(l){var u=[o,l];if(i)throw TypeError("Generator is already executing.");for(;s&&(s=0,u[0]&&(a=0)),a;)try{if(i=1,n&&(r=2&u[0]?n.return:u[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,u[1])).done)return r;switch(n=0,r&&(u=[2&u[0],r.value]),u[0]){case 0:case 1:r=u;break;case 4:return a.label++,{value:u[1],done:!1};case 5:a.label++,n=u[1],u=[0];continue;case 7:u=a.ops.pop(),a.trys.pop();continue;default:if(!(r=(r=a.trys).length>0&&r[r.length-1])&&(6===u[0]||2===u[0])){a=0;continue}if(3===u[0]&&(!r||u[1]>r[0]&&u[1]<r[3])){a.label=u[1];break}if(6===u[0]&&a.label<r[1]){a.label=r[1],r=u;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(u);break}r[2]&&a.ops.pop(),a.trys.pop();continue}u=t.call(e,a)}catch(e){u=[6,e],n=0}finally{i=r=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}var f=Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]};function m(e,t){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(t,i)||f(t,e,i)}function y(e){var t="function"==typeof Symbol&&Symbol.iterator,i=t&&e[t],n=0;if(i)return i.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function v(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var n,r,a=i.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=a.next()).done;)s.push(n.value)}catch(e){r={error:e}}finally{try{n&&!n.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return s}function g(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(v(arguments[t]));return e}function T(){for(var e=0,t=0,i=arguments.length;t<i;t++)e+=arguments[t].length;for(var n=Array(e),r=0,t=0;t<i;t++)for(var a=arguments[t],s=0,o=a.length;s<o;s++,r++)n[r]=a[s];return n}function S(e,t,i){if(i||2==arguments.length)for(var n,r=0,a=t.length;r<a;r++)!n&&r in t||(n||(n=Array.prototype.slice.call(t,0,r)),n[r]=t[r]);return e.concat(n||Array.prototype.slice.call(t))}function E(e){return this instanceof E?(this.v=e,this):new E(e)}function I(e,t,i){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var n,r=i.apply(e,t||[]),a=[];return n=Object.create(("function"==typeof AsyncIterator?AsyncIterator:Object).prototype),s("next"),s("throw"),s("return",function(e){return function(t){return Promise.resolve(t).then(e,u)}}),n[Symbol.asyncIterator]=function(){return this},n;function s(e,t){r[e]&&(n[e]=function(t){return new Promise(function(i,n){a.push([e,t,i,n])>1||o(e,t)})},t&&(n[e]=t(n[e])))}function o(e,t){try{var i;(i=r[e](t)).value instanceof E?Promise.resolve(i.value.v).then(l,u):c(a[0][2],i)}catch(e){c(a[0][3],e)}}function l(e){o("next",e)}function u(e){o("throw",e)}function c(e,t){e(t),a.shift(),a.length&&o(a[0][0],a[0][1])}}function b(e){var t,i;return t={},n("next"),n("throw",function(e){throw e}),n("return"),t[Symbol.iterator]=function(){return this},t;function n(n,r){t[n]=e[n]?function(t){return(i=!i)?{value:E(e[n](t)),done:!1}:r?r(t):t}:r}}function N(e){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var t,i=e[Symbol.asyncIterator];return i?i.call(e):(e=y(e),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(i){t[i]=e[i]&&function(t){return new Promise(function(n,r){var a,s,o;a=n,s=r,o=(t=e[i](t)).done,Promise.resolve(t.value).then(function(e){a({value:e,done:o})},s)})}}}function _(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var D=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t},A=function(e){return(A=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t})(e)};function O(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i=A(e),n=0;n<i.length;n++)"default"!==i[n]&&f(t,e,i[n]);return D(t,e),t}function R(e){return e&&e.__esModule?e:{default:e}}function w(e,t,i,n){if("a"===i&&!n)throw TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?n:"a"===i?n.call(e):n?n.value:t.get(e)}function L(e,t,i,n,r){if("m"===n)throw TypeError("Private method is not writable");if("a"===n&&!r)throw TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!r:!t.has(e))throw TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?r.call(e,i):r?r.value=i:t.set(e,i),i}function C(e,t){if(null===t||"object"!=typeof t&&"function"!=typeof t)throw TypeError("Cannot use 'in' operator on non-object");return"function"==typeof e?t===e:e.has(t)}function F(e,t,i){if(null!=t){var n,r;if("object"!=typeof t&&"function"!=typeof t)throw TypeError("Object expected.");if(i){if(!Symbol.asyncDispose)throw TypeError("Symbol.asyncDispose is not defined.");n=t[Symbol.asyncDispose]}if(void 0===n){if(!Symbol.dispose)throw TypeError("Symbol.dispose is not defined.");n=t[Symbol.dispose],i&&(r=n)}if("function"!=typeof n)throw TypeError("Object not disposable.");r&&(n=function(){try{r.call(this)}catch(e){return Promise.reject(e)}}),e.stack.push({value:t,dispose:n,async:i})}else i&&e.stack.push({async:!0});return t}var k="function"==typeof SuppressedError?SuppressedError:function(e,t,i){var n=Error(i);return n.name="SuppressedError",n.error=e,n.suppressed=t,n};function P(e){function t(t){e.error=e.hasError?new k(t,e.error,"An error was suppressed during disposal."):t,e.hasError=!0}var i,n=0;return function r(){for(;i=e.stack.pop();)try{if(!i.async&&1===n)return n=0,e.stack.push(i),Promise.resolve().then(r);if(i.dispose){var a=i.dispose.call(i.value);if(i.async)return n|=2,Promise.resolve(a).then(r,function(e){return t(e),r()})}else n|=1}catch(e){t(e)}if(1===n)return e.hasError?Promise.reject(e.error):Promise.resolve();if(e.hasError)throw e.error}()}function x(e,t){return"string"==typeof e&&/^\.\.?\//.test(e)?e.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(e,i,n,r,a){return i?t?".jsx":".js":!n||r&&a?n+r+"."+a.toLowerCase()+"js":e}):e}let M={__extends:i,__assign:n,__rest:r,__decorate:a,__param:s,__esDecorate:o,__runInitializers:l,__propKey:u,__setFunctionName:c,__metadata:d,__awaiter:p,__generator:h,__createBinding:f,__exportStar:m,__values:y,__read:v,__spread:g,__spreadArrays:T,__spreadArray:S,__await:E,__asyncGenerator:I,__asyncDelegator:b,__asyncValues:N,__makeTemplateObject:_,__importStar:O,__importDefault:R,__classPrivateFieldGet:w,__classPrivateFieldSet:L,__classPrivateFieldIn:C,__addDisposableResource:F,__disposeResources:P,__rewriteRelativeImportExtension:x};e.s(["__addDisposableResource",0,F,"__assign",()=>n,"__asyncDelegator",0,b,"__asyncGenerator",0,I,"__asyncValues",0,N,"__await",0,E,"__awaiter",0,p,"__classPrivateFieldGet",0,w,"__classPrivateFieldIn",0,C,"__classPrivateFieldSet",0,L,"__createBinding",0,f,"__decorate",0,a,"__disposeResources",0,P,"__esDecorate",0,o,"__exportStar",0,m,"__extends",0,i,"__generator",0,h,"__importDefault",0,R,"__importStar",0,O,"__makeTemplateObject",0,_,"__metadata",0,d,"__param",0,s,"__propKey",0,u,"__read",0,v,"__rest",0,r,"__rewriteRelativeImportExtension",0,x,"__runInitializers",0,l,"__setFunctionName",0,c,"__spread",0,g,"__spreadArray",0,S,"__spreadArrays",0,T,"__values",0,y,"default",0,M])},379993,e=>{"use strict";let t;var i,n,r,a,s,o,l,u,c,d=e.i(922816),p=e.i(264997),h=e.i(628153),f=e.i(494744);let m=e=>Array.isArray(e)?e:e?[e]:[];function y(e){let t;return"alias"in e&&(t=e.alias?.value),null==t&&"name"in e&&(t=e.name?.value),null==t&&(t=e.kind),t}function v(e,t,i){let n=y(e),r=y(t);return"function"==typeof i?i(n,r):String(n)<String(r)?-1:+(String(n)>String(r))}function g(e){return null!=e}function T(e,t=!1,i=!1,n=!1,r=!1){let a,s,o;if(0===e.length)return;if(1===e.length)return e[0];let l=!0,u=e.every(e=>{if(Array.isArray(e)){if(void 0===a)return a=e.length,!0;else if(a===e.length)return!0}else l=!1;return!1});if(n&&u)return Array(a).fill(null).map((a,s)=>T(e.map(e=>e[s]),t,i,n,r));if(l)return e.flat(1);for(let a of(t&&(o=e.find(e=>S(e)))&&(null==s&&(s={}),Object.setPrototypeOf(s,Object.create(Object.getPrototypeOf(o)))),e))if(null!=a)if(S(a)){if(null==s&&(s={}),o){let e=Object.getPrototypeOf(s),t=Object.getPrototypeOf(a);if(t)for(let i of Object.getOwnPropertyNames(t)){let n=Object.getOwnPropertyDescriptor(t,i);g(n)&&Object.defineProperty(e,i,n)}}for(let e in a)e in s?s[e]=T([s[e],a[e]],t,i,n,r):s[e]=a[e];if(r&&null!=s)for(let e of Object.getOwnPropertySymbols(a)){let t=Object.getOwnPropertyDescriptor(a,e);t.enumerable||Object.defineProperty(s,e,t)}}else s=Array.isArray(a)&&Array.isArray(s)?T([s,a],t,i,n):a;return s}function S(e){return e&&"object"==typeof e&&!Array.isArray(e)}function E(e,t){if(e&&t&&t!==e.extensions){if(!e.extensions){e.extensions=t;return}e.extensions=T([e.extensions,t],!1,!0)}}function I(e,t){if(!e||Array.isArray(e)&&0===e.length)return{};if(!Array.isArray(e))return e;if(1===e.length)return e[0]||{};let i=[];for(let t of e)Array.isArray(t)&&(t=I(t)),"object"==typeof t&&t&&i.push(t);let n=T(i,!0);if(t?.exclusions)for(let e of t.exclusions){let[t,i]=e.split(".");!(["__proto__","constructor","prototype"].includes(t)||["__proto__","constructor","prototype"].includes(i))&&(i&&"*"!==i?n[t]&&delete n[t][i]:delete n[t])}return n}var b=e.i(612283),N=e.i(995702),_=e.i(151112),D=e.i(698453),A=e.i(54509),O=e.i(794541),R=e.i(64255);function w(e,t){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return function(e,t){var i,n;let r;if(null===e)return"null";if(e instanceof Error)return"AggregateError"===e.name?L(e)+"\n"+C(e.errors,t):L(e);if(t.includes(e))return"[Circular]";let a=[...t,e];if("function"==typeof e.toJSON){let t=e.toJSON();if(t!==e)return"string"==typeof t?t:w(t,a)}else if(Array.isArray(e))return C(e,a);return i=e,n=a,0===(r=Object.entries(i)).length?"{}":n.length>3?"["+function(e){let t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){let t=e.constructor.name;if("string"==typeof t&&""!==t)return t}return t}(i)+"]":"{ "+r.map(([e,t])=>e+": "+w(t,n)).join(", ")+" }"}(e,t);default:return String(e)}}function L(e){return e.name="GraphQLError",e.toString()}function C(e,t){if(0===e.length)return"[]";if(t.length>3)return"[Array]";let i=e.length,n=[];for(let r=0;r<i;++r)n.push(w(e[r],t));return"["+n.join(", ")+"]"}function F(e){if((0,A.isNonNullType)(e)){let t=F(e.ofType);if(t.kind===N.Kind.NON_NULL_TYPE)throw Error(`Invalid type node ${w(e,[])}. Inner type of non-null type cannot be a non-null type.`);return{kind:N.Kind.NON_NULL_TYPE,type:t}}return(0,A.isListType)(e)?{kind:N.Kind.LIST_TYPE,type:F(e.ofType)}:{kind:N.Kind.NAMED_TYPE,name:{kind:N.Kind.NAME,value:e.name}}}function k(e){if(null===e)return{kind:N.Kind.NULL};if(void 0===e)return null;if(Array.isArray(e)){let t=[];for(let i of e){let e=k(i);null!=e&&t.push(e)}return{kind:N.Kind.LIST,values:t}}if("object"==typeof e){if(e?.toJSON)return k(e.toJSON());let t=[];for(let i in e){let n=k(e[i]);n&&t.push({kind:N.Kind.OBJECT_FIELD,name:{kind:N.Kind.NAME,value:i},value:n})}return{kind:N.Kind.OBJECT,fields:t}}if("boolean"==typeof e)return{kind:N.Kind.BOOLEAN,value:e};if("bigint"==typeof e)return{kind:N.Kind.INT,value:String(e)};if("number"==typeof e&&isFinite(e)){let t=String(e);return P.test(t)?{kind:N.Kind.INT,value:t}:{kind:N.Kind.FLOAT,value:t}}if("string"==typeof e)return{kind:N.Kind.STRING,value:e};throw TypeError(`Cannot convert value to AST: ${e}.`)}let P=/^-?(?:0|[1-9][0-9]*)$/;function x(e,t){var i,n;if((0,A.isNonNullType)(t)){let i=x(e,t.ofType);return i?.kind===N.Kind.NULL?null:i}if(null===e)return{kind:N.Kind.NULL};if(void 0===e)return null;if((0,A.isListType)(t)){let n=t.ofType;if(null!=(i=e)&&"object"==typeof i&&Symbol.iterator in i){let t=[];for(let i of e){let e=x(i,n);null!=e&&t.push(e)}return{kind:N.Kind.LIST,values:t}}return x(e,n)}if((0,A.isInputObjectType)(t)){if("object"!=typeof(n=e)||null===n)return null;let i=[];for(let n of Object.values(t.getFields())){let t=x(e[n.name],n.type);t&&i.push({kind:N.Kind.OBJECT_FIELD,name:{kind:N.Kind.NAME,value:n.name},value:t})}return{kind:N.Kind.OBJECT,fields:i}}if((0,A.isLeafType)(t)){if((0,A.isEnumType)(t)){for(let i of t.getValues())if(i.value===e||i.name===e){e=i.name;break}return{kind:N.Kind.ENUM,value:e}}if(null==(e=t.serialize(e)))return null;if("ID"===t.name&&"string"==typeof e&&M.test(e))return{kind:N.Kind.INT,value:e}}return k(e)}Symbol.for("@whatwg-node/promise-helpers/FakePromise");let M=/^-?(?:0|[1-9][0-9]*)$/;var U=e.i(261412);let $=e=>"default"in e?e.default?"value"in e.default?k(e.default.value)??void 0:x((0,U.valueFromASTUntyped)(e.default.literal),e.type)??void 0:void 0:void 0!==e.defaultValue?x(e.defaultValue,e.type)??void 0:void 0;function j(e){return e.astNode?.description?{...e.astNode.description,block:!0}:e.description?{kind:N.Kind.STRING,value:e.description,block:!0}:void 0}var V=e.i(911231),G=e.i(312851),B=e.i(981088),K=e.i(964885);let Q=["message","locations","path","nodes","source","positions","originalError","name","stack","extensions","coordinate"];function q(e,t){var i;t?.originalError&&!(t.originalError instanceof Error)&&null!=(i=t.originalError)&&"object"==typeof i&&Object.keys(i).every(e=>Q.includes(e))&&(t.originalError=q(t.originalError.message,t.originalError));let n=B.GraphQLError,r=K.versionInfo.major>=16?new n(e,t):new n(e,t?.nodes,t?.source,t?.positions,t?.path,t?.originalError,t?.extensions);return t?.coordinate&&null==r.coordinate&&Object.defineProperties(r,{coordinate:{value:t.coordinate,enumerable:!0,configurable:!0}}),r}function H(e){let t=new WeakMap;return function(i){let n=t.get(i);if(void 0===n){let n=e(i);return t.set(i,n),n}return n}}function J(e,t=["directives"]){return Object.entries(function(e,t,i=["directives"]){let n={};if(e.extensions){let t=e.extensions;for(let e of i)t=t?.[e];if(null!=t)for(let e in t){let i=t[e];if(Array.isArray(i))for(let t of i){let i=n[e];i||(i=[],n[e]=i),i.push(t)}else{let t=n[e];t||(t=[],n[e]=t),t.push(i)}}}let r=H(e=>JSON.stringify(e)),a=[];for(let i of(e.astNode&&a.push(e.astNode),e.extensionASTNodes&&a.push(...e.extensionASTNodes),a))if(i.directives?.length)for(let e of i.directives){let i=e.name.value,s=n[i];s||(s=[],n[i]=s);let o=t?.getDirective(i),l={};if(o&&(l=function(e,t,i={}){let n={},r=(t.arguments??[]).reduce((e,t)=>({...e,[t.name.value]:t}),{});for(let a of e.args){let e=r[a.name];if(!e){if("default"in a&&a.default)n[a.name]="value"in a.default?a.default.value:(0,U.valueFromASTUntyped)(a.default.literal);else if(void 0!==a.defaultValue)n[a.name]=a.defaultValue;else if((0,A.isNonNullType)(a.type))throw q(`Argument "${a.name}" of required type "${w(a.type,[])}" was not provided.`,{nodes:[t]});continue}let s=e.value,o=s.kind===N.Kind.NULL;if(s.kind===N.Kind.VARIABLE){let e=s.name.value;if(null==i||!Object.prototype.hasOwnProperty.call(i,e)){if(void 0!==a.defaultValue)n[a.name]=a.defaultValue;else if((0,A.isNonNullType)(a.type))throw q(`Argument "${a.name}" of required type "${w(a.type,[])}" was provided the variable "$${e}" which was not provided a runtime value.`,{nodes:[s]});continue}o=null==i[e]}if(o&&(0,A.isNonNullType)(a.type))throw q(`Argument "${a.name}" of non-null type "${w(a.type,[])}" must not be null.`,{nodes:[s]});let l=(0,V.valueFromAST)(s,a.type,i);if(void 0===l)throw q(`Argument "${a.name}" has invalid value ${(0,G.print)(s)}.`,{nodes:[s]});n[a.name]=l}return n}(o,e)),e.arguments)for(let t of e.arguments){let e=t.name.value;if(null==l[e]){let i=o?.args.find(t=>t.name===e);i&&(l[e]=(0,V.valueFromAST)(t.value,i.type))}null==l[e]&&(l[e]=(0,U.valueFromASTUntyped)(t.value))}if(a.length>0&&s.length>0){let e=r(l);if(s.some(t=>r(t)===e))continue}s.push(l)}return n}(e,void 0,t)).map(([e,t])=>t?.map(t=>({name:e,args:t}))).flat(1/0).filter(Boolean)}H(function(e){return new Set([...W(e)].map(e=>e.name))});let W=H(function(e){return new Set(Y(e).values())}),Y=H(function(e){let t=new Map,i=e.getQueryType();i&&t.set("query",i);let n=e.getMutationType();n&&t.set("mutation",n);let r=e.getSubscriptionType();return r&&t.set("subscription",r),t});function z(e,t,i){let n,r=[],a=J(e,i);null!=a&&(n=et(t,a));let s=null,o=null,l=null;(null!=n&&(r=n.filter(e=>D.specifiedDirectives.every(t=>t.name!==e.name.value)),s=n.find(e=>"deprecated"===e.name.value),o=n.find(e=>"specifiedBy"===e.name.value),l=n.find(e=>"oneOf"===e.name.value)),null!=e.deprecationReason&&null==s&&(s=ee("deprecated",{reason:e.deprecationReason},D.GraphQLDeprecatedDirective)),null!=e.specifiedByUrl||null!=e.specifiedByURL&&null==o)&&(o=ee("specifiedBy",{url:e.specifiedByUrl||e.specifiedByURL}));return e.isOneOf&&null==l&&(l=ee("oneOf")),null!=s&&r.push(s),null!=o&&r.push(o),null!=l&&r.push(l),r}function X(e,t,i){return{kind:N.Kind.INPUT_VALUE_DEFINITION,description:j(e),name:{kind:N.Kind.NAME,value:e.name},type:F(e.type),defaultValue:$(e),directives:z(e,t,i)}}function Z(e,t,i){return{kind:N.Kind.FIELD_DEFINITION,description:j(e),name:{kind:N.Kind.NAME,value:e.name},arguments:e.args.map(e=>X(e,t,i)),type:F(e.type),directives:z(e,t,i)}}function ee(e,t,i){let n=[];for(let e in t){let r,a=t[e];if(null!=i){let t=i.args.find(t=>t.name===e);t&&(r=x(a,t.type))}null==r&&(r=k(a)),null!=r&&n.push({kind:N.Kind.ARGUMENT,name:{kind:N.Kind.NAME,value:e},value:r})}return{kind:N.Kind.DIRECTIVE,name:{kind:N.Kind.NAME,value:e},arguments:n}}function et(e,t){let i=[];for(let{name:n,args:r}of t){let t=e?.getDirective(n);i.push(ee(n,r,t))}return i}var ei=e.i(650177),en=e.i(521281);let er={};function ea(e,t,i,n){let r=function(e){let t=function(e){let t=e.loc;if(!t)return;let i=[],n=t.startToken.prev;for(;null!=n&&n.kind===ei.TokenKind.COMMENT&&null!=n.next&&null!=n.prev&&n.line+1===n.next.line&&n.line!==n.prev.line;){let e=String(n.value);i.push(e),n=n.prev}return i.length>0?i.reverse().join("\n"):void 0}(e);if(void 0!==t)return function(e){let t=e.split(/\r\n|[\n\r]/g),i=function(e){let t=null;for(let i=1;i<e.length;i++){let n=e[i],r=ef(n);if(r!==n.length&&(null===t||r<t)&&0===(t=r))break}return null===t?0:t}(t);if(0!==i)for(let e=1;e<t.length;e++)t[e]=t[e].slice(i);for(;t.length>0&&em(t[0]);)t.shift();for(;t.length>0&&em(t[t.length-1]);)t.pop();return t.join("\n")}(`
|
|
27
|
+
${N(t)}${r}`)}}};let I="APOLLO_FEDERATION_DEBUG_SUBGRAPHS";function b(e,t,i,n){let r=n.costDirective(e.schema());if(r){let n=e.appliedDirectivesOf(r)[0];n&&t.applyDirective(i.metadata().costDirective().name,n.arguments())}let a=n.listSizeDirective(e.schema());if(a){let n=e.appliedDirectivesOf(a)[0];n&&t.applyDirective(i.metadata().listSizeDirective().name,n.arguments())}}function N(e){let t=(0,v.errorCauses)(e);return t?(0,v.printErrors)(t):String(e)}function _({field:e,type:t,subgraph:i,isShareable:n,joinFieldArgs:r,costSpec:a}){let s=(null==r?void 0:r.type)?O(r.type,i.schema,i.name):R(e.type,i.schema,i.name),o=t.addField(e.name,s);for(let t of e.arguments()){let e=o.addArgument(t.name,R(t.type,i.schema,i.name),t.defaultValue);a&&b(t,e,i,a)}if((null==r?void 0:r.requires)&&o.applyDirective(i.metadata().requiresDirective(),{fields:r.requires}),(null==r?void 0:r.provides)&&o.applyDirective(i.metadata().providesDirective(),{fields:r.provides}),null==r?void 0:r.contextArguments){let e=i.metadata().fromContextDirective();if((0,v.isFederationDirectiveDefinedInSchema)(e))for(let t of r.contextArguments){let n=t.context.match(/^.*__([A-Za-z]\w*)$/);if(!n)throw Error(`Invalid context argument: ${t.context}`);o.addArgument(t.name,O(t.type,i.schema,i.name));let r=o.argument(t.name);null==r||r.applyDirective(e,{field:`$${n[1]} ${t.selection}`})}else throw Error(`@fromContext directive is not defined in the subgraph schema: ${i.name}`)}let l=!!(null==r?void 0:r.external);l&&o.applyDirective(i.metadata().externalDirective());let u=!!(null==r?void 0:r.usedOverridden);return!u||(null==r?void 0:r.overrideLabel)||o.applyDirective(i.metadata().externalDirective(),{reason:"[overridden]"}),(null==r?void 0:r.override)&&o.applyDirective(i.metadata().overrideDirective(),{from:r.override,...r.overrideLabel?{label:r.overrideLabel}:{}}),!n||l||u||o.applyDirective(i.metadata().shareableDirective()),a&&b(e,o,i,a),o}function D({field:e,type:t,subgraph:i,joinFieldArgs:n,costSpec:r}){let a=(null==n?void 0:n.type)?O(null==n?void 0:n.type,i.schema,i.name):R(e.type,i.schema,i.name),s=t.addField(e.name,a);return s.defaultValue=e.defaultValue,r&&b(e,s,i,r),s}function A(e,t,i,n){let a=t.schema.type(e.parent.name);a&&(e instanceof r.FieldDefinition?_({field:e,subgraph:t,type:a,isShareable:i,joinFieldArgs:n}):D({field:e,subgraph:t,type:a,joinFieldArgs:n}))}function O(e,t,i){try{return(0,c.builtTypeReference)(e,t)}catch(t){(0,l.assert)(!1,()=>`Cannot parse type "${e}" in subgraph ${i}: ${t}`)}}function R(e,t,i){switch(e.kind){case"ListType":return new r.ListType(R(e.ofType,t,i));case"NonNullType":return new r.NonNullType(R(e.ofType,t,i));default:let n=t.type(e.name);return(0,l.assert)(n,()=>`Cannot find type "${e.name}" in subgraph "${i}"`),n}}function w(e,t,i,n,s=!1){let o=e.metadata().externalDirective();try{(0,a.parseFieldSetArgument)({parentType:t,directive:i,fieldAccessor:function(t,i){let a=t.field(i);if(a)return s&&a.hasAppliedDirective(o)&&a.appliedDirectivesOf(o).forEach(e=>e.remove()),a;(0,l.assert)(!(0,r.isUnionType)(t),()=>`Shouldn't select field ${i} from union type ${t}`);let u=n.type(t.name).field(i);(0,l.assert)(u,()=>`No field named ${i} found on type ${t.name} in the supergraph`);let c=_({field:u,subgraph:e,type:t,isShareable:!1});return s||c.applyDirective(o),c},validate:!1})}catch(e){}}function L(e){for(let t of e.types())switch(t.kind){case"ObjectType":case"InterfaceType":case"InputObjectType":t.hasFields()||t.removeRecursive();break;case"UnionType":0===t.membersCount()&&t.removeRecursive()}}},629644,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.Supergraph=i.isFed1Supergraph=i.validateSupergraph=i.ROUTER_SUPPORTED_SUPERGRAPH_FEATURES=i.DEFAULT_SUPPORTED_SUPERGRAPH_FEATURES=void 0;let n=e.r(168032),r=e.r(785576),a=e.r(63672),s=e.r(994926),o=e.r(579034),l=e.r(826468),u=e.r(105714),c=e.r(408470);i.DEFAULT_SUPPORTED_SUPERGRAPH_FEATURES=new Set(["https://specs.apollo.dev/core/v0.1","https://specs.apollo.dev/core/v0.2","https://specs.apollo.dev/join/v0.1","https://specs.apollo.dev/join/v0.2","https://specs.apollo.dev/join/v0.3","https://specs.apollo.dev/join/v0.4","https://specs.apollo.dev/join/v0.5","https://specs.apollo.dev/tag/v0.1","https://specs.apollo.dev/tag/v0.2","https://specs.apollo.dev/tag/v0.3","https://specs.apollo.dev/inaccessible/v0.1","https://specs.apollo.dev/inaccessible/v0.2"]),i.ROUTER_SUPPORTED_SUPERGRAPH_FEATURES=new Set(["https://specs.apollo.dev/core/v0.1","https://specs.apollo.dev/core/v0.2","https://specs.apollo.dev/join/v0.1","https://specs.apollo.dev/join/v0.2","https://specs.apollo.dev/join/v0.3","https://specs.apollo.dev/join/v0.4","https://specs.apollo.dev/join/v0.5","https://specs.apollo.dev/tag/v0.1","https://specs.apollo.dev/tag/v0.2","https://specs.apollo.dev/tag/v0.3","https://specs.apollo.dev/inaccessible/v0.1","https://specs.apollo.dev/inaccessible/v0.2","https://specs.apollo.dev/authenticated/v0.1","https://specs.apollo.dev/requiresScopes/v0.1","https://specs.apollo.dev/policy/v0.1","https://specs.apollo.dev/context/v0.1","https://specs.apollo.dev/cost/v0.1","https://specs.apollo.dev/connect/v0.1","https://specs.apollo.dev/connect/v0.2","https://specs.apollo.dev/connect/v0.3","https://specs.apollo.dev/connect/v0.4","https://specs.apollo.dev/cacheTag/v0.1"]);let d=r.FeatureUrl.parse("https://specs.apollo.dev/core/v0.1");function p(e){let t,i,n=e.coreFeatures;if(!n)throw c.ERRORS.INVALID_FEDERATION_SUPERGRAPH.err("Invalid supergraph: must be a core schema");let r=n.getByIdentity(a.joinIdentity);if(!r)throw c.ERRORS.INVALID_FEDERATION_SUPERGRAPH.err("Invalid supergraph: must use the join spec");let l=a.JOIN_VERSIONS.find(r.url.version);if(!l)throw c.ERRORS.INVALID_FEDERATION_SUPERGRAPH.err(`Invalid supergraph: uses unsupported join spec version ${r.url.version} (supported versions: ${a.JOIN_VERSIONS.versions().join(", ")})`);let u=n.getByIdentity(s.ContextSpecDefinition.identity);if(u&&!(t=s.CONTEXT_VERSIONS.find(u.url.version)))throw c.ERRORS.INVALID_FEDERATION_SUPERGRAPH.err(`Invalid supergraph: uses unsupported context spec version ${u.url.version} (supported versions: ${s.CONTEXT_VERSIONS.versions().join(", ")})`);let d=n.getByIdentity(o.costIdentity);if(d&&!(i=o.COST_VERSIONS.find(d.url.version)))throw c.ERRORS.INVALID_FEDERATION_SUPERGRAPH.err(`Invalid supergraph: uses unsupported cost spec version ${d.url.version} (supported versions: ${o.COST_VERSIONS.versions().join(", ")})`);return[n,l,t,i]}i.validateSupergraph=p,i.isFed1Supergraph=function(e){return p(e)[1].version.equals(new r.FeatureVersion(0,1))};class h{constructor(e,t=i.DEFAULT_SUPPORTED_SUPERGRAPH_FEATURES,a=!0){this.schema=e,this.shouldValidate=a;const[s]=p(e);null!==t&&function(e,t){let i=[],a=e.coreItself;if(a.url.equals(d)){let t=[...e.allFeatures()].filter(e=>e.purpose);t.length>0&&i.push(c.ERRORS.UNSUPPORTED_LINKED_FEATURE.err(`the \`for:\` argument is unsupported by version ${a.url.version} of the core spec. Please upgrade to at least @core v0.2 (https://specs.apollo.dev/core/v0.2).`,{nodes:(0,n.sourceASTs)(a.directive,...t.map(e=>e.directive))}))}for(let n of e.allFeatures())(n.url.equals(d)||"EXECUTION"===n.purpose||"SECURITY"===n.purpose)&&!t.has(n.url.base.toString())&&i.push(c.ERRORS.UNSUPPORTED_LINKED_FEATURE.err(`feature ${n.url} is for: ${n.purpose} but is unsupported`,{nodes:n.directive.sourceAST}));if(i.length>0)throw(0,r.ErrCoreCheckFailed)(i)}(s,t),a?e.validate():e.assumeValid(),this.containedSubgraphs=(0,u.extractSubgraphsNamesAndUrlsFromSupergraph)(e)}static build(e,t){return new h("string"==typeof e?(0,l.buildSchema)(e,{validate:!1}):(0,l.buildSchemaFromAST)(e,{validate:!1}),null==t?void 0:t.supportedFeatures,null==t?void 0:t.validateSupergraph)}static buildForTests(e,t){return h.build(e,{supportedFeatures:i.ROUTER_SUPPORTED_SUPERGRAPH_FEATURES,validateSupergraph:t})}subgraphsMetadata(){return this.containedSubgraphs}subgraphs(){if(!this._subgraphs){let e=(0,u.extractSubgraphsFromSupergraph)(this.schema,this.shouldValidate);this._subgraphs=e[0],this._subgraphNameToGraphEnumValue=e[1]}return this._subgraphs}subgraphNameToGraphEnumValue(){if(!this._subgraphNameToGraphEnumValue){let e=(0,u.extractSubgraphsFromSupergraph)(this.schema,this.shouldValidate);this._subgraphs=e[0],this._subgraphNameToGraphEnumValue=e[1]}return new Map([...this._subgraphNameToGraphEnumValue])}apiSchema(){return this.schema.toAPISchema()}}i.Supergraph=h},388500,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.upgradeSubgraphsIfNecessary=i.RemovedTagOnExternal=i.FieldsArgumentCoercionToString=i.ProvidesOnNonCompositeRemoval=i.ProvidesOrRequiresOnInterfaceFieldRemoval=i.KeyOnInterfaceRemoval=i.ShareableTypeAddition=i.ShareableFieldAddition=i.InactiveProvidesOrRequiresFieldsRemoval=i.InactiveProvidesOrRequiresRemoval=i.TypeWithOnlyUnusedExternalRemoval=i.UnusedExternalRemoval=i.ExternalOnObjectTypeRemoval=i.ExternalOnInterfaceRemoval=i.TypeExtensionRemoval=i.ExternalOnTypeExtensionRemoval=void 0;let n=e.r(186846),r=e.r(408470),a=e.r(168032),s=e.r(951071),o=e.r(331484),l=e.r(367356),u=e.r(479209);class c{constructor(e){this.field=e,this.id="EXTERNAL_ON_TYPE_EXTENSION_REMOVAL"}toString(){return`Removed @external from field "${this.field}" as it is a key of an extension type`}}i.ExternalOnTypeExtensionRemoval=c;class d{constructor(e){this.type=e,this.id="TYPE_EXTENSION_REMOVAL"}toString(){return`Switched type "${this.type}" from an extension to a definition`}}i.TypeExtensionRemoval=d;class p{constructor(e){this.field=e,this.id="EXTERNAL_ON_INTERFACE_REMOVAL"}toString(){return`Removed @external directive on interface type field "${this.field}": @external is nonsensical on interface fields`}}i.ExternalOnInterfaceRemoval=p;class h{constructor(e){this.type=e,this.id="EXTERNAL_ON_OBJECT_TYPE_REMOVAL"}toString(){return`Removed @external directive on object type "${this.type}": @external on types was not rejected but was inactive in fed1`}}i.ExternalOnObjectTypeRemoval=h;class f{constructor(e){this.field=e,this.id="UNUSED_EXTERNAL_REMOVAL"}toString(){return`Removed @external field "${this.field}" as it was not used in any @key, @provides or @requires`}}i.UnusedExternalRemoval=f;class m{constructor(e){this.type=e,this.id="TYPE_WITH_ONLY_UNUSED_EXTERNAL_REMOVAL"}toString(){return`Removed type ${this.type} that is not referenced in the schema and only declares unused @external fields`}}i.TypeWithOnlyUnusedExternalRemoval=m;class y{constructor(e,t){this.parent=e,this.removed=t,this.id="INACTIVE_PROVIDES_OR_REQUIRES_REMOVAL"}toString(){return`Removed directive ${this.removed} on "${this.parent}": none of the fields were truly @external`}}i.InactiveProvidesOrRequiresRemoval=y;class v{constructor(e,t,i){this.parent=e,this.original=t,this.updated=i,this.id="INACTIVE_PROVIDES_OR_REQUIRES_FIELDS_REMOVAL"}toString(){return`Updated directive ${this.original} on "${this.parent}" to ${this.updated}: removed fields that were not truly @external`}}i.InactiveProvidesOrRequiresFieldsRemoval=v;class g{constructor(e,t){this.field=e,this.declaringSubgraphs=t,this.id="SHAREABLE_FIELD_ADDITION"}toString(){return`Added @shareable to field "${this.field}": it is also resolved by ${(0,s.printSubgraphNames)(this.declaringSubgraphs)}`}}i.ShareableFieldAddition=g;class T{constructor(e,t){this.type=e,this.declaringSubgraphs=t,this.id="SHAREABLE_TYPE_ADDITION"}toString(){return`Added @shareable to type "${this.type}": it is a "value type" and is also declared in ${(0,s.printSubgraphNames)(this.declaringSubgraphs)}`}}i.ShareableTypeAddition=T;class S{constructor(e){this.type=e,this.id="KEY_ON_INTERFACE_REMOVAL"}toString(){return`Removed @key on interface "${this.type}": while allowed by federation 0.x, @key on interfaces were completely ignored/had no effect`}}i.KeyOnInterfaceRemoval=S;class E{constructor(e,t){this.field=e,this.directive=t,this.id="PROVIDES_OR_REQUIRES_ON_INTERFACE_FIELD_REMOVAL"}toString(){return`Removed @${this.directive} on interface field "${this.field}": while allowed by federation 0.x, @${this.directive} on interface fields were completely ignored/had no effect`}}i.ProvidesOrRequiresOnInterfaceFieldRemoval=E;class I{constructor(e,t){this.field=e,this.type=t,this.id="PROVIDES_ON_NON_COMPOSITE_REMOVAL"}toString(){return`Removed @provides directive on field "${this.field}" as it is of non-composite type "${this.type}": while not rejected by federation 0.x, such @provide is nonsensical and was ignored`}}i.ProvidesOnNonCompositeRemoval=I;class b{constructor(e,t,i,n){this.element=e,this.directive=t,this.before=i,this.after=n,this.id="FIELDS_ARGUMENT_COERCION_TO_STRING"}toString(){return`Coerced "fields" argument for directive @${this.directive} for "${this.element}" into a string: coerced from ${this.before} to ${this.after}`}}i.FieldsArgumentCoercionToString=b;class N{constructor(e,t){this.application=e,this.element=t,this.id="REMOVED_TAG_ON_EXTERNAL"}toString(){return`Removed ${this.application} application on @external "${this.element}" as the @tag application is on another definition`}}function _(e){let t=(0,s.federationMetadata)(e.schema());(0,o.assert)(t,"Should be a subgraph schema");let i=e.hasAppliedDirective(t.extendsDirective());return(e.hasExtensionElements()||i)&&((0,a.isObjectType)(e)||(0,a.isInterfaceType)(e))&&(i||!e.hasNonExtensionElements())}function D(e){let t=(0,s.federationMetadata)(e.schema());return(0,o.assert)(t,"Should be a subgraph schema"),(0,a.isObjectType)(e)&&e.isRootType()&&(e.hasAppliedDirective(t.extendsDirective())||e.hasExtensionElements()&&!e.hasNonExtensionElements())}i.RemovedTagOnExternal=N,i.upgradeSubgraphsIfNecessary=function(e){let t=new Map;if(e.values().every(e=>e.isFed2Subgraph()))return{subgraphs:e,changes:t};let i=new s.Subgraphs,n=[],a=new o.SetMultiMap,l=new o.SetMultiMap,u=new Map;for(let t of e.values()){for(let e of t.schema.objectTypes()){let i=u.get(e.name);i||(i=new Map,u.set(e.name,i)),i.set(t.name,[e,t.metadata()])}for(let e of t.schema.interfaceTypes()){let i=u.get(e.name);i||(i=new Map,u.set(e.name,i)),i.set(t.name,[e,t.metadata()])}}for(let r of e.values())if(r.isFed2Subgraph())for(let e of(i.add(r),r.metadata().interfaceObjectDirective().applications())){let t=e.parent.name;a.add(t,r.name)}else{let a=new A(r,e.values(),u).upgrade();if(a.errors)n=n.concat(a.errors);else for(let e of(i.add(a.upgraded),t.set(r.name,a.changes),a.interfaceKeyTypes))l.add(e,r.name)}for(let[e,t]of a){let i=l.get(e);i&&n.push(r.ERRORS.INTERFACE_OBJECT_USAGE_ERROR.err(`The @interfaceObject directive is used on type "${e}" in ${(0,s.printSubgraphNames)([...t])}, which requires other subgraphs to resolve its type name via an interface @key. However, @key on an interface in a federation 1 subgraph does not mean it can fulfill the __typename-resolution requirement that @interfaceObject depends on. For ${(0,s.printSubgraphNames)([...i])}, either upgrade them to federation 2 subgraphs or remove @key from the type.`))}return 0===n.length?{subgraphs:i,changes:t}:{errors:n}};class A{constructor(e,t,i){this.originalSubgraph=e,this.allSubgraphs=t,this.objectTypeMap=i,this.changes=new o.MultiMap,this.errors=[],this.interfaceKeyTypes=new Set,this.schema=e.schema.clone(),this.renameFederationTypes(),this.subgraph=new s.Subgraph(e.name,e.url,this.schema);try{(0,s.setSchemaAsFed2Subgraph)(this.schema)}catch(t){const e=(0,r.errorCauses)(t);if(e)e.forEach(e=>this.addError(e));else throw t}this.metadata=this.subgraph.metadata()}addError(e){this.errors.push((0,s.addSubgraphToError)(e,this.subgraph.name,r.ERRORS.INVALID_GRAPHQL))}renameFederationTypes(){for(let e of u.FEDERATION1_TYPES){let t=this.originalSubgraph.metadata().federationTypeNameInSchema(e.name),i=this.schema.type(t);i&&i.rename(`federation__${e.name}`)}}external(e){let t=e.appliedDirectivesOf(this.metadata.externalDirective());return 0===t.length?void 0:t[0]}addChange(e){this.changes.add(e.id,e)}checkForExtensionWithNoBase(e){var t;if(D(e)||!_(e))return;let i=null==(t=(0,o.firstOf)(e.extensions().values()))?void 0:t.sourceAST,n=Array.from(this.objectTypeMap.get(e.name).entries()).filter(([e,t])=>e!==this.subgraph.name);for(let e=0;e<n.length;e+=1){let t=n[e][1][0];if(t&&t.hasNonExtensionElements())return}this.addError(r.ERRORS.EXTENSION_WITH_NO_BASE.err(`Type "${e}" is an extension type, but there is no type definition for "${e}" in any subgraph.`,{nodes:i}))}preUpgradeValidations(){for(let e of this.schema.types())this.checkForExtensionWithNoBase(e)}upgrade(){if(this.errors.length>0||(this.preUpgradeValidations(),this.fixFederationDirectivesArguments(),this.removeExternalOnInterface(),this.removeExternalOnObjectTypes(),this.removeExternalOnTypeExtensions(),this.fixInactiveProvidesAndRequires(),this.removeTypeExtensions(),this.removeDirectivesOnInterface(),this.removeProvidesOnNonComposite(),this.removeUnusedExternals(),this.addShareable(),this.removeTagOnExternal(),this.errors.length>0))return{errors:this.errors};try{return this.subgraph.validate(),{upgraded:this.subgraph,changes:this.changes,interfaceKeyTypes:this.interfaceKeyTypes}}catch(t){let e=(0,r.errorCauses)(t);if(!e)throw t;return{errors:e}}}fixFederationDirectivesArguments(){var e;for(let t of[this.metadata.keyDirective(),this.metadata.requiresDirective(),this.metadata.providesDirective()])for(let i of Array.from(t.applications())){let r=i.arguments().fields;if("string"!=typeof r){Array.isArray(r)&&r.every(e=>"string"==typeof e)&&this.replaceFederationDirectiveApplication(i,i.toString(),r.join(" "),t.sourceAST);continue}let a=i.sourceAST;if(a&&"Directive"===a.kind){for(let t of null!=(e=a.arguments)?e:[])if("fields"===t.name.value&&t.value.kind===n.Kind.ENUM){this.replaceFederationDirectiveApplication(i,(0,n.print)(a),r,{...a,arguments:[{...t,value:{kind:n.Kind.STRING,value:r}}]});break}}}}removeExternalOnInterface(){for(let e of this.schema.interfaceTypes())for(let t of e.fields()){let e=this.external(t);e&&(this.addChange(new p(t.coordinate)),e.remove())}}removeExternalOnObjectTypes(){for(let e of this.schema.objectTypes()){let t=e.appliedDirectivesOf(this.metadata.externalDirective())[0];t&&(this.addChange(new h(e.coordinate)),t.remove())}}replaceFederationDirectiveApplication(e,t,i,n){let r=e.definition,a=e.parent;e.remove();let s=a.applyDirective(r,{fields:i});s.sourceAST=n,this.addChange(new b(a.coordinate,r.name,t,s.toString()))}fixInactiveProvidesAndRequires(){(0,s.removeInactiveProvidesAndRequires)(this.schema,(e,t,i)=>{i?this.addChange(new v(e.coordinate,t.toString(),i.toString())):this.addChange(new y(e.coordinate,t.toString()))})}removeExternalOnTypeExtensions(){for(let e of this.schema.types())if((0,a.isCompositeType)(e)&&(_(e)||D(e)))if(e.appliedDirectivesOf(this.metadata.keyDirective()).length>0)for(let t of e.appliedDirectivesOf(this.metadata.keyDirective()))(0,s.collectTargetFields)({parentType:e,directive:t,includeInterfaceFieldsImplementations:!1,validate:!1}).forEach(t=>{if(t.parent!==e)return;let i=this.external(t);i&&(this.addChange(new c(t.coordinate)),i.remove())});else for(let[t,i]of Array.from(this.objectTypeMap.get(e.name).entries()).filter(([e,t])=>e!==this.subgraph.name)){let[n,r]=i;(0,o.assert)((0,a.isCompositeType)(n),()=>`Type ${e} is of kind ${e.kind} in ${this.subgraph.name} but ${n.kind} in ${t}`);let l=n.appliedDirectivesOf(r.keyDirective());0!==l.length&&(0,s.collectTargetFields)({parentType:n,directive:l[0],includeInterfaceFieldsImplementations:!1,validate:!1}).forEach(t=>{if(t.parent!==n)return;let i=e.field(t.name);if(!i)return;let r=this.external(i);r&&(this.addChange(new c(i.coordinate)),r.remove())})}}removeTypeExtensions(){for(let e of this.schema.types())(_(e)||D(e))&&(this.addChange(new d(e.coordinate)),e.removeExtensions())}removeUnusedExternals(){for(let e of this.schema.types())if((0,a.isObjectType)(e)||(0,a.isInterfaceType)(e)){for(let t of e.fields())this.metadata.isFieldExternal(t)&&!this.metadata.isFieldUsed(t)&&(this.addChange(new f(t.coordinate)),t.remove());e.hasFields()||(e.isReferenced()?this.addError(r.ERRORS.TYPE_WITH_ONLY_UNUSED_EXTERNAL.err(`Type ${e} contains only external fields and all those fields are all unused (they do not appear in any @key, @provides or @requires).`,{nodes:e.sourceAST})):(this.addChange(new m(e.name)),e.remove()))}}removeDirectivesOnInterface(){for(let e of this.schema.interfaceTypes()){for(let t of e.appliedDirectivesOf(this.metadata.keyDirective()))this.addChange(new S(e.name)),this.interfaceKeyTypes.add(e.name),t.remove();for(let t of e.fields())for(let e of[this.metadata.providesDirective(),this.metadata.requiresDirective()])for(let i of t.appliedDirectivesOf(e))this.addChange(new E(t.coordinate,e.name)),i.remove()}}removeProvidesOnNonComposite(){for(let e of this.schema.objectTypes())for(let t of e.fields())if(!(0,a.isCompositeType)((0,a.baseType)(t.type)))for(let e of t.appliedDirectivesOf(this.metadata.providesDirective()))this.addChange(new I(t.coordinate,t.type.toString())),e.remove()}addShareable(){let e=this.originalSubgraph.metadata(),t=this.metadata.keyDirective(),i=this.metadata.shareableDirective();for(let n of this.schema.objectTypes())if(!n.isSubscriptionRootType())if(n.hasAppliedDirective(t)||n.isRootType())for(let t of n.fields()){if(e.isFieldShareable(t))continue;let r=Array.from(this.objectTypeMap.get(n.name).entries()).filter(([e,i])=>{if(e===this.subgraph.name)return!1;let n=i[0].field(t.name);return!!n&&(!i[1].isFieldExternal(n)||i[1].isFieldPartiallyExternal(n))});r.length>0&&!t.hasAppliedDirective(i)&&(t.applyDirective(i),this.addChange(new g(t.coordinate,r.map(([e])=>e))))}else{let e=Array.from(this.objectTypeMap.get(n.name).entries()).filter(([e,t])=>e!==this.subgraph.name);e.length>0&&!n.hasAppliedDirective(i)&&(n.applyDirective(i),this.addChange(new T(n.coordinate,e.map(([e])=>e))))}}removeTagOnExternal(){let e=this.schema.directive("tag");if(e)for(let t of Array.from(e.applications())){let e=t.parent;e instanceof a.FieldDefinition&&this.external(e)&&this.allSubgraphs.map(t=>t.name===this.originalSubgraph.name?void 0:function(e,t,i){let n=e.type(t);return n&&(0,a.isCompositeType)(n)?n.field(i):void 0}(t.schema,e.parent.name,e.name)).filter(e=>!(e&&e.hasAppliedDirective("external"))).some(e=>e&&e.appliedDirectivesOf("tag").some(e=>(0,l.valueEquals)(t.arguments(),e.arguments())))&&(this.addChange(new N(t.toString(),e.coordinate)),t.remove())}}}},327750,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.graphQLJSDirectiveToAST=i.graphQLJSNamedTypeToAST=i.graphQLJSSchemaToAST=void 0;let n=e.r(186846),r=e.r(168032),a=[n.OperationTypeNode.QUERY,n.OperationTypeNode.MUTATION,n.OperationTypeNode.SUBSCRIPTION];function s({definition:e,extensions:t}){return e?[e,...t]:t}function o(e){return e.astNode||e.extensionASTNodes.length>0?{definition:e.astNode||void 0,extensions:e.extensionASTNodes}:{definition:(0,n.parse)((0,n.printType)(e)).definitions[0],extensions:[]}}function l(e){if(e.astNode)return e.astNode;{let t=new n.GraphQLSchema({directives:[e],assumeValid:!0});return(0,n.parse)((0,n.printSchema)(t)).definitions.find(e=>e.kind===n.Kind.DIRECTIVE_DEFINITION)}}i.graphQLJSSchemaToAST=function(e){let t=Object.values(e.getTypeMap()).filter(e=>!(0,n.isIntrospectionType)(e)&&!(0,n.isSpecifiedScalarType)(e)),i=e.getDirectives().filter(e=>!(0,n.isSpecifiedDirective)(e)),u=s(function(e){if(e.astNode||e.extensionASTNodes.length>0)return{definition:e.astNode||void 0,extensions:e.extensionASTNodes};{var t;let i;if(t=e,a.some(e=>{var i,n;return i=t.getRootType(e),n=e,!!i&&i.name!==(0,r.defaultRootName)(n)})){let t=[];for(let i of a){let r=e.getRootType(i);r&&t.push({kind:n.Kind.OPERATION_TYPE_DEFINITION,operation:i,type:{kind:n.Kind.NAMED_TYPE,name:{kind:n.Kind.NAME,value:r.name}}})}i={kind:n.Kind.SCHEMA_DEFINITION,description:e.description?{kind:n.Kind.STRING,value:e.description}:void 0,operationTypes:t}}return{definition:i,extensions:[]}}}(e)),c=t.map(e=>s(o(e))).flat(),d=i.map(e=>l(e));return{kind:n.Kind.DOCUMENT,definitions:[...u,...c,...d]}},i.graphQLJSNamedTypeToAST=o,i.graphQLJSDirectiveToAST=l},378422,(e,t,i)=>{"use strict";var n=e.e&&e.e.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),r=e.e&&e.e.__exportStar||function(e,t){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(t,i)||n(t,e,i)};Object.defineProperty(i,"__esModule",{value:!0}),i.coreFeatureDefinitionIfKnown=void 0,r(e.r(168032),i),r(e.r(826468),i),r(e.r(383105),i),r(e.r(367356),i),r(e.r(951071),i),r(e.r(678270),i),r(e.r(738207),i),r(e.r(331484),i),r(e.r(603206),i),r(e.r(785576),i),r(e.r(63672),i),r(e.r(193151),i),r(e.r(355415),i),r(e.r(479209),i),r(e.r(994926),i),r(e.r(629644),i),r(e.r(408470),i),r(e.r(388500),i),r(e.r(308126),i),r(e.r(327750),i),r(e.r(343924),i);var a=e.r(319894);Object.defineProperty(i,"coreFeatureDefinitionIfKnown",{enumerable:!0,get:function(){return a.coreFeatureDefinitionIfKnown}}),r(e.r(253636),i),r(e.r(255604),i),r(e.r(484469),i),r(e.r(569186),i),r(e.r(506370),i),r(e.r(579034),i),r(e.r(379166),i)},533126,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.cacheControlFromInfo=i.maybeCacheControlFromInfo=void 0,i.maybeCacheControlFromInfo=function(e){return e.cacheControl?.cacheHint?.restrict?e.cacheControl:null},i.cacheControlFromInfo=function(e){if(!("cacheControl"in e))throw Error("The `info` argument does not appear to have a cacheControl field. Check that you are using Apollo Server 3 or newer and that you aren't using ApolloServerPluginCacheControlDisabled.");if(!e.cacheControl?.cacheHint?.restrict)throw Error("The `info` argument has a cacheControl field but it does not appear to be from ApolloServer 3 or newer. Check that you are using Apollo Server 3 or newer and that you aren't using ApolloServerPluginCacheControlDisabled.");return e.cacheControl}},273083,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.isFederationType=i.federationTypes=i.serviceField=i.entitiesField=i.entitiesResolver=i.LinkImportType=i.AnyType=i.ServiceType=i.EntityType=void 0;let n=e.r(186846),r=e.r(533126),a=e.r(224361);function s(e){return"function"==typeof(null==e?void 0:e.then)}async function o(e,t){let i=await e;if(null!==i&&"object"==typeof i){if("__typename"in i&&i.__typename!==t)return{...i,__typename:t};Object.defineProperty(i,"__typename",{value:t})}return i}function l(e,t,i,r){if(null==e)throw new n.GraphQLError(`Abstract type "${i.name}" \`__resolveReference\` method must resolve to an Object type at runtime. Either the object returned by "${i}.__resolveReference" must include a valid \`__typename\` field, or the "${i.name}" type should provide a "resolveType" function or each possible type should provide an "isTypeOf" function.`);if("string"!=typeof e)throw new n.GraphQLError(`Abstract type "${i.name}" \`__resolveReference\` method must resolve to an Object type at runtime with value ${(0,a.inspect)(r)}, received "${(0,a.inspect)(e)}".`);let s=t.getType(e);if(null==s)throw new n.GraphQLError(`Abstract type "${i.name}" \`__resolveReference\` method resolved to a type "${e}" that does not exist inside the schema.`);if(!(0,n.isObjectType)(s))throw new n.GraphQLError(`Abstract type "${i.name}" \`__resolveReference\` method resolved to a non-object type "${e}".`);if(!t.isSubType(i,s))throw new n.GraphQLError(`Runtime Object type "${s.name}" \`__resolveReference\` method is not a possible type for "${i.name}".`);return s}async function u({type:e,value:t,context:i,info:r,callback:a}){var o;let c=await t;if(null===c)return c;let d=(null!=(o=e.resolveType)?o:n.defaultTypeResolver)(c,i,r,e);return s(d)?d.then(t=>a(l(t,r.schema,e,c))):a(l(d,r.schema,e,c))}function c(e){var t,i;return null==(i=null==(t=e.extensions.apollo)?void 0:t.subgraph)?void 0:i.resolveReference}function d({representations:e,context:t,info:i}){return e.map(e=>{let{__typename:a}=e,l=i.schema.getType(a);if(!l||!((0,n.isObjectType)(l)||(0,n.isInterfaceType)(l)))throw Error(`The _entities resolver tried to load an entity for type "${a}", but no object or interface type of that name was found in the schema`);let d=(0,r.maybeCacheControlFromInfo)(i);if(d){let e=d.cacheHintFromType(l);e&&d.cacheHint.restrict(e)}let p=c(l),h=p?p(e,t,i):e;return(0,n.isInterfaceType)(l)?u({type:l,value:h,context:t,info:i,callback:e=>{let n=o(h,e.name);if(!p){let r=c(e);r&&(n=o(n=s(n)?n.then(e=>r(e,t,i)):r(n,t,i),e.name))}return n}}):o(h,a)})}i.EntityType=new n.GraphQLUnionType({name:"_Entity",types:[]}),i.ServiceType=new n.GraphQLObjectType({name:"_Service",fields:{sdl:{type:n.GraphQLString,description:"The sdl representing the federated service capabilities. Includes federation directives, removes federation types, and includes rest of full schema after schema directives have been applied"}}}),i.AnyType=new n.GraphQLScalarType({name:"_Any",serialize:e=>e}),i.LinkImportType=new n.GraphQLScalarType({name:"link__Import",specifiedByURL:null}),i.entitiesResolver=d,i.entitiesField={type:new n.GraphQLNonNull(new n.GraphQLList(i.EntityType)),args:{representations:{type:new n.GraphQLNonNull(new n.GraphQLList(new n.GraphQLNonNull(i.AnyType)))}},resolve:(e,{representations:t},i,n)=>d({representations:t,context:i,info:n})},i.serviceField={type:new n.GraphQLNonNull(i.ServiceType)},i.federationTypes=[i.ServiceType,i.AnyType,i.EntityType,i.LinkImportType],i.isFederationType=function(e){return(0,n.isNamedType)(e)&&i.federationTypes.some(({name:t})=>t===e.name)}},37188,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.buildFederatedSchema=i.buildSubgraphSchema=void 0;let n=e.r(224361),r=e.r(186846),a=e.r(242080),s=e.r(378422),o=e.r(273083);function l(e){var t;let i;if("typeDefs"in e){let{typeDefs:t,resolvers:n}=e;i=(Array.isArray(t)?t:[t]).map((e,t)=>{let i={typeDefs:e};return 0===t&&n&&(i.resolvers=n),i})}else i=e;let n=(0,a.modulesFromSDL)(i),l=(0,r.concatAST)(n.map(e=>e.typeDefs)),u=(0,s.buildSubgraph)(s.FEDERATION_UNNAMED_SUBGRAPH_NAME,"",l,!1),c=(0,s.printSchema)(u.schema),d=u.schema.toGraphQLJSSchema(),p=null==(t=u.schema.schemaDefinition.rootType("query"))?void 0:t.name;for(let e of((0,s.assert)(p,"A Query root type should have been added by `buildSubgraph`"),(0,a.addResolversToSchema)(d,{[p]:{_service:()=>({sdl:c})}}),u.metadata().entityType()&&(0,a.addResolversToSchema)(d,{[p]:{_entities:(e,{representations:t},i,n)=>(0,o.entitiesResolver)({representations:t,context:i,info:n})},_Entity:{__resolveType:e=>e.__typename}}),n))e.resolvers&&(0,a.addResolversToSchema)(d,e.resolvers);return d}i.buildSubgraphSchema=l,i.buildFederatedSchema=(0,n.deprecate)(l,"'buildFederatedSchema' is deprecated. Use 'buildSubgraphSchema' instead.")},554529,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.printBlockString=i.printType=i.printIntrospectionSchema=i.printSubgraphSchema=void 0;let n=e.r(186846),r=e.r(378422);i.printSubgraphSchema=function(e){let t=(0,r.graphQLJSSchemaToAST)(e);return(0,r.buildSubgraph)(r.FEDERATION_UNNAMED_SUBGRAPH_NAME,"",t,!1).toString()},i.printIntrospectionSchema=function(e){let t=(0,r.graphQLJSSchemaToAST)(e),i=(0,r.buildSubgraph)(r.FEDERATION_UNNAMED_SUBGRAPH_NAME,"",t,!1);return(0,r.printSchema)(i.schema)},i.printType=function(e){let{definition:t,extensions:i}=(0,r.graphQLJSNamedTypeToAST)(e);return(t?[t]:[]).concat(i).map(e=>(0,n.print)(e)).join("\n\n")},i.printBlockString=function(e,t=!1){let i=!e.includes("\n"),n=" "===e[0]||" "===e[0],r='"'===e[e.length-1],a="\\"===e[e.length-1],s=!i||r||a||t,o="";return s&&!(i&&n)&&(o+="\n"),o+=e,s&&(o+="\n"),'"""'+o.replace(/"""/g,'\\"""')+'"""'}},429630,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.printSubgraphSchema=i.buildSubgraphSchema=void 0;var n=e.r(37188);Object.defineProperty(i,"buildSubgraphSchema",{enumerable:!0,get:function(){return n.buildSubgraphSchema}});var r=e.r(554529);Object.defineProperty(i,"printSubgraphSchema",{enumerable:!0,get:function(){return r.printSubgraphSchema}})},779430,e=>{"use strict";var t=function(e,i){return(t=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])})(e,i)};function i(e,i){if("function"!=typeof i&&null!==i)throw TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}var n=function(){return(n=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};function r(e,t){var i={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(i[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,n=Object.getOwnPropertySymbols(e);r<n.length;r++)0>t.indexOf(n[r])&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(i[n[r]]=e[n[r]]);return i}function a(e,t,i,n){var r,a=arguments.length,s=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(s=(a<3?r(s):a>3?r(t,i,s):r(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s}function s(e,t){return function(i,n){t(i,n,e)}}function o(e,t,i,n,r,a){function s(e){if(void 0!==e&&"function"!=typeof e)throw TypeError("Function expected");return e}for(var o,l=n.kind,u="getter"===l?"get":"setter"===l?"set":"value",c=!t&&e?n.static?e:e.prototype:null,d=t||(c?Object.getOwnPropertyDescriptor(c,n.name):{}),p=!1,h=i.length-1;h>=0;h--){var f={};for(var m in n)f[m]="access"===m?{}:n[m];for(var m in n.access)f.access[m]=n.access[m];f.addInitializer=function(e){if(p)throw TypeError("Cannot add initializers after decoration has completed");a.push(s(e||null))};var y=(0,i[h])("accessor"===l?{get:d.get,set:d.set}:d[u],f);if("accessor"===l){if(void 0===y)continue;if(null===y||"object"!=typeof y)throw TypeError("Object expected");(o=s(y.get))&&(d.get=o),(o=s(y.set))&&(d.set=o),(o=s(y.init))&&r.unshift(o)}else(o=s(y))&&("field"===l?r.unshift(o):d[u]=o)}c&&Object.defineProperty(c,n.name,d),p=!0}function l(e,t,i){for(var n=arguments.length>2,r=0;r<t.length;r++)i=n?t[r].call(e,i):t[r].call(e);return n?i:void 0}function u(e){return"symbol"==typeof e?e:"".concat(e)}function c(e,t,i){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:i?"".concat(i," ",t):t})}function d(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function p(e,t,i,n){return new(i||(i=Promise))(function(r,a){function s(e){try{l(n.next(e))}catch(e){a(e)}}function o(e){try{l(n.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?r(e.value):((t=e.value)instanceof i?t:new i(function(e){e(t)})).then(s,o)}l((n=n.apply(e,t||[])).next())})}function h(e,t){var i,n,r,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=o(0),s.throw=o(1),s.return=o(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(l){var u=[o,l];if(i)throw TypeError("Generator is already executing.");for(;s&&(s=0,u[0]&&(a=0)),a;)try{if(i=1,n&&(r=2&u[0]?n.return:u[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,u[1])).done)return r;switch(n=0,r&&(u=[2&u[0],r.value]),u[0]){case 0:case 1:r=u;break;case 4:return a.label++,{value:u[1],done:!1};case 5:a.label++,n=u[1],u=[0];continue;case 7:u=a.ops.pop(),a.trys.pop();continue;default:if(!(r=(r=a.trys).length>0&&r[r.length-1])&&(6===u[0]||2===u[0])){a=0;continue}if(3===u[0]&&(!r||u[1]>r[0]&&u[1]<r[3])){a.label=u[1];break}if(6===u[0]&&a.label<r[1]){a.label=r[1],r=u;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(u);break}r[2]&&a.ops.pop(),a.trys.pop();continue}u=t.call(e,a)}catch(e){u=[6,e],n=0}finally{i=r=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}var f=Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]};function m(e,t){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(t,i)||f(t,e,i)}function y(e){var t="function"==typeof Symbol&&Symbol.iterator,i=t&&e[t],n=0;if(i)return i.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function v(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var n,r,a=i.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=a.next()).done;)s.push(n.value)}catch(e){r={error:e}}finally{try{n&&!n.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return s}function g(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(v(arguments[t]));return e}function T(){for(var e=0,t=0,i=arguments.length;t<i;t++)e+=arguments[t].length;for(var n=Array(e),r=0,t=0;t<i;t++)for(var a=arguments[t],s=0,o=a.length;s<o;s++,r++)n[r]=a[s];return n}function S(e,t,i){if(i||2==arguments.length)for(var n,r=0,a=t.length;r<a;r++)!n&&r in t||(n||(n=Array.prototype.slice.call(t,0,r)),n[r]=t[r]);return e.concat(n||Array.prototype.slice.call(t))}function E(e){return this instanceof E?(this.v=e,this):new E(e)}function I(e,t,i){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var n,r=i.apply(e,t||[]),a=[];return n=Object.create(("function"==typeof AsyncIterator?AsyncIterator:Object).prototype),s("next"),s("throw"),s("return",function(e){return function(t){return Promise.resolve(t).then(e,u)}}),n[Symbol.asyncIterator]=function(){return this},n;function s(e,t){r[e]&&(n[e]=function(t){return new Promise(function(i,n){a.push([e,t,i,n])>1||o(e,t)})},t&&(n[e]=t(n[e])))}function o(e,t){try{var i;(i=r[e](t)).value instanceof E?Promise.resolve(i.value.v).then(l,u):c(a[0][2],i)}catch(e){c(a[0][3],e)}}function l(e){o("next",e)}function u(e){o("throw",e)}function c(e,t){e(t),a.shift(),a.length&&o(a[0][0],a[0][1])}}function b(e){var t,i;return t={},n("next"),n("throw",function(e){throw e}),n("return"),t[Symbol.iterator]=function(){return this},t;function n(n,r){t[n]=e[n]?function(t){return(i=!i)?{value:E(e[n](t)),done:!1}:r?r(t):t}:r}}function N(e){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var t,i=e[Symbol.asyncIterator];return i?i.call(e):(e=y(e),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(i){t[i]=e[i]&&function(t){return new Promise(function(n,r){var a,s,o;a=n,s=r,o=(t=e[i](t)).done,Promise.resolve(t.value).then(function(e){a({value:e,done:o})},s)})}}}function _(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var D=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t},A=function(e){return(A=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t})(e)};function O(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i=A(e),n=0;n<i.length;n++)"default"!==i[n]&&f(t,e,i[n]);return D(t,e),t}function R(e){return e&&e.__esModule?e:{default:e}}function w(e,t,i,n){if("a"===i&&!n)throw TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?n:"a"===i?n.call(e):n?n.value:t.get(e)}function L(e,t,i,n,r){if("m"===n)throw TypeError("Private method is not writable");if("a"===n&&!r)throw TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!r:!t.has(e))throw TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?r.call(e,i):r?r.value=i:t.set(e,i),i}function C(e,t){if(null===t||"object"!=typeof t&&"function"!=typeof t)throw TypeError("Cannot use 'in' operator on non-object");return"function"==typeof e?t===e:e.has(t)}function F(e,t,i){if(null!=t){var n,r;if("object"!=typeof t&&"function"!=typeof t)throw TypeError("Object expected.");if(i){if(!Symbol.asyncDispose)throw TypeError("Symbol.asyncDispose is not defined.");n=t[Symbol.asyncDispose]}if(void 0===n){if(!Symbol.dispose)throw TypeError("Symbol.dispose is not defined.");n=t[Symbol.dispose],i&&(r=n)}if("function"!=typeof n)throw TypeError("Object not disposable.");r&&(n=function(){try{r.call(this)}catch(e){return Promise.reject(e)}}),e.stack.push({value:t,dispose:n,async:i})}else i&&e.stack.push({async:!0});return t}var k="function"==typeof SuppressedError?SuppressedError:function(e,t,i){var n=Error(i);return n.name="SuppressedError",n.error=e,n.suppressed=t,n};function P(e){function t(t){e.error=e.hasError?new k(t,e.error,"An error was suppressed during disposal."):t,e.hasError=!0}var i,n=0;return function r(){for(;i=e.stack.pop();)try{if(!i.async&&1===n)return n=0,e.stack.push(i),Promise.resolve().then(r);if(i.dispose){var a=i.dispose.call(i.value);if(i.async)return n|=2,Promise.resolve(a).then(r,function(e){return t(e),r()})}else n|=1}catch(e){t(e)}if(1===n)return e.hasError?Promise.reject(e.error):Promise.resolve();if(e.hasError)throw e.error}()}function x(e,t){return"string"==typeof e&&/^\.\.?\//.test(e)?e.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(e,i,n,r,a){return i?t?".jsx":".js":!n||r&&a?n+r+"."+a.toLowerCase()+"js":e}):e}let M={__extends:i,__assign:n,__rest:r,__decorate:a,__param:s,__esDecorate:o,__runInitializers:l,__propKey:u,__setFunctionName:c,__metadata:d,__awaiter:p,__generator:h,__createBinding:f,__exportStar:m,__values:y,__read:v,__spread:g,__spreadArrays:T,__spreadArray:S,__await:E,__asyncGenerator:I,__asyncDelegator:b,__asyncValues:N,__makeTemplateObject:_,__importStar:O,__importDefault:R,__classPrivateFieldGet:w,__classPrivateFieldSet:L,__classPrivateFieldIn:C,__addDisposableResource:F,__disposeResources:P,__rewriteRelativeImportExtension:x};e.s(["__addDisposableResource",0,F,"__assign",()=>n,"__asyncDelegator",0,b,"__asyncGenerator",0,I,"__asyncValues",0,N,"__await",0,E,"__awaiter",0,p,"__classPrivateFieldGet",0,w,"__classPrivateFieldIn",0,C,"__classPrivateFieldSet",0,L,"__createBinding",0,f,"__decorate",0,a,"__disposeResources",0,P,"__esDecorate",0,o,"__exportStar",0,m,"__extends",0,i,"__generator",0,h,"__importDefault",0,R,"__importStar",0,O,"__makeTemplateObject",0,_,"__metadata",0,d,"__param",0,s,"__propKey",0,u,"__read",0,v,"__rest",0,r,"__rewriteRelativeImportExtension",0,x,"__runInitializers",0,l,"__setFunctionName",0,c,"__spread",0,g,"__spreadArray",0,S,"__spreadArrays",0,T,"__values",0,y,"default",0,M])},379993,e=>{"use strict";let t;var i,n,r,a,s,o,l,u,c,d=e.i(922816),p=e.i(264997),h=e.i(628153),f=e.i(494744);let m=e=>Array.isArray(e)?e:e?[e]:[];function y(e){let t;return"alias"in e&&(t=e.alias?.value),null==t&&"name"in e&&(t=e.name?.value),null==t&&(t=e.kind),t}function v(e,t,i){let n=y(e),r=y(t);return"function"==typeof i?i(n,r):String(n)<String(r)?-1:+(String(n)>String(r))}function g(e){return null!=e}function T(e,t=!1,i=!1,n=!1,r=!1){let a,s,o;if(0===e.length)return;if(1===e.length)return e[0];let l=!0,u=e.every(e=>{if(Array.isArray(e)){if(void 0===a)return a=e.length,!0;else if(a===e.length)return!0}else l=!1;return!1});if(n&&u)return Array(a).fill(null).map((a,s)=>T(e.map(e=>e[s]),t,i,n,r));if(l)return e.flat(1);for(let a of(t&&(o=e.find(e=>S(e)))&&(null==s&&(s={}),Object.setPrototypeOf(s,Object.create(Object.getPrototypeOf(o)))),e))if(null!=a)if(S(a)){if(null==s&&(s={}),o){let e=Object.getPrototypeOf(s),t=Object.getPrototypeOf(a);if(t)for(let i of Object.getOwnPropertyNames(t)){let n=Object.getOwnPropertyDescriptor(t,i);g(n)&&Object.defineProperty(e,i,n)}}for(let e in a)e in s?s[e]=T([s[e],a[e]],t,i,n,r):s[e]=a[e];if(r&&null!=s)for(let e of Object.getOwnPropertySymbols(a)){let t=Object.getOwnPropertyDescriptor(a,e);t.enumerable||Object.defineProperty(s,e,t)}}else s=Array.isArray(a)&&Array.isArray(s)?T([s,a],t,i,n):a;return s}function S(e){return e&&"object"==typeof e&&!Array.isArray(e)}function E(e,t){if(e&&t&&t!==e.extensions){if(!e.extensions){e.extensions=t;return}e.extensions=T([e.extensions,t],!1,!0)}}function I(e,t){if(!e||Array.isArray(e)&&0===e.length)return{};if(!Array.isArray(e))return e;if(1===e.length)return e[0]||{};let i=[];for(let t of e)Array.isArray(t)&&(t=I(t)),"object"==typeof t&&t&&i.push(t);let n=T(i,!0);if(t?.exclusions)for(let e of t.exclusions){let[t,i]=e.split(".");!(["__proto__","constructor","prototype"].includes(t)||["__proto__","constructor","prototype"].includes(i))&&(i&&"*"!==i?n[t]&&delete n[t][i]:delete n[t])}return n}var b=e.i(612283),N=e.i(995702),_=e.i(151112),D=e.i(698453),A=e.i(54509),O=e.i(794541),R=e.i(64255);function w(e,t){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return function(e,t){var i,n;let r;if(null===e)return"null";if(e instanceof Error)return"AggregateError"===e.name?L(e)+"\n"+C(e.errors,t):L(e);if(t.includes(e))return"[Circular]";let a=[...t,e];if("function"==typeof e.toJSON){let t=e.toJSON();if(t!==e)return"string"==typeof t?t:w(t,a)}else if(Array.isArray(e))return C(e,a);return i=e,n=a,0===(r=Object.entries(i)).length?"{}":n.length>3?"["+function(e){let t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){let t=e.constructor.name;if("string"==typeof t&&""!==t)return t}return t}(i)+"]":"{ "+r.map(([e,t])=>e+": "+w(t,n)).join(", ")+" }"}(e,t);default:return String(e)}}function L(e){return e.name="GraphQLError",e.toString()}function C(e,t){if(0===e.length)return"[]";if(t.length>3)return"[Array]";let i=e.length,n=[];for(let r=0;r<i;++r)n.push(w(e[r],t));return"["+n.join(", ")+"]"}function F(e){if((0,A.isNonNullType)(e)){let t=F(e.ofType);if(t.kind===N.Kind.NON_NULL_TYPE)throw Error(`Invalid type node ${w(e,[])}. Inner type of non-null type cannot be a non-null type.`);return{kind:N.Kind.NON_NULL_TYPE,type:t}}return(0,A.isListType)(e)?{kind:N.Kind.LIST_TYPE,type:F(e.ofType)}:{kind:N.Kind.NAMED_TYPE,name:{kind:N.Kind.NAME,value:e.name}}}function k(e){if(null===e)return{kind:N.Kind.NULL};if(void 0===e)return null;if(Array.isArray(e)){let t=[];for(let i of e){let e=k(i);null!=e&&t.push(e)}return{kind:N.Kind.LIST,values:t}}if("object"==typeof e){if(e?.toJSON)return k(e.toJSON());let t=[];for(let i in e){let n=k(e[i]);n&&t.push({kind:N.Kind.OBJECT_FIELD,name:{kind:N.Kind.NAME,value:i},value:n})}return{kind:N.Kind.OBJECT,fields:t}}if("boolean"==typeof e)return{kind:N.Kind.BOOLEAN,value:e};if("bigint"==typeof e)return{kind:N.Kind.INT,value:String(e)};if("number"==typeof e&&isFinite(e)){let t=String(e);return P.test(t)?{kind:N.Kind.INT,value:t}:{kind:N.Kind.FLOAT,value:t}}if("string"==typeof e)return{kind:N.Kind.STRING,value:e};throw TypeError(`Cannot convert value to AST: ${e}.`)}let P=/^-?(?:0|[1-9][0-9]*)$/;function x(e,t){var i,n;if((0,A.isNonNullType)(t)){let i=x(e,t.ofType);return i?.kind===N.Kind.NULL?null:i}if(null===e)return{kind:N.Kind.NULL};if(void 0===e)return null;if((0,A.isListType)(t)){let n=t.ofType;if(null!=(i=e)&&"object"==typeof i&&Symbol.iterator in i){let t=[];for(let i of e){let e=x(i,n);null!=e&&t.push(e)}return{kind:N.Kind.LIST,values:t}}return x(e,n)}if((0,A.isInputObjectType)(t)){if("object"!=typeof(n=e)||null===n)return null;let i=[];for(let n of Object.values(t.getFields())){let t=x(e[n.name],n.type);t&&i.push({kind:N.Kind.OBJECT_FIELD,name:{kind:N.Kind.NAME,value:n.name},value:t})}return{kind:N.Kind.OBJECT,fields:i}}if((0,A.isLeafType)(t)){if((0,A.isEnumType)(t)){for(let i of t.getValues())if(i.value===e||i.name===e){e=i.name;break}return{kind:N.Kind.ENUM,value:e}}if(null==(e=t.serialize(e)))return null;if("ID"===t.name&&"string"==typeof e&&M.test(e))return{kind:N.Kind.INT,value:e}}return k(e)}Symbol.for("@whatwg-node/promise-helpers/FakePromise");let M=/^-?(?:0|[1-9][0-9]*)$/;var U=e.i(261412);let $=e=>"default"in e?e.default?"value"in e.default?k(e.default.value)??void 0:x((0,U.valueFromASTUntyped)(e.default.literal),e.type)??void 0:void 0:void 0!==e.defaultValue?x(e.defaultValue,e.type)??void 0:void 0;function j(e){return e.astNode?.description?{...e.astNode.description,block:!0}:e.description?{kind:N.Kind.STRING,value:e.description,block:!0}:void 0}var V=e.i(911231),G=e.i(312851),B=e.i(981088),K=e.i(964885);let Q=["message","locations","path","nodes","source","positions","originalError","name","stack","extensions","coordinate"];function q(e,t){var i;t?.originalError&&!(t.originalError instanceof Error)&&null!=(i=t.originalError)&&"object"==typeof i&&Object.keys(i).every(e=>Q.includes(e))&&(t.originalError=q(t.originalError.message,t.originalError));let n=B.GraphQLError,r=K.versionInfo.major>=16?new n(e,t):new n(e,t?.nodes,t?.source,t?.positions,t?.path,t?.originalError,t?.extensions);return t?.coordinate&&null==r.coordinate&&Object.defineProperties(r,{coordinate:{value:t.coordinate,enumerable:!0,configurable:!0}}),r}function J(e){let t=new WeakMap;return function(i){let n=t.get(i);if(void 0===n){let n=e(i);return t.set(i,n),n}return n}}function H(e,t=["directives"]){return Object.entries(function(e,t,i=["directives"]){let n={};if(e.extensions){let t=e.extensions;for(let e of i)t=t?.[e];if(null!=t)for(let e in t){let i=t[e];if(Array.isArray(i))for(let t of i){let i=n[e];i||(i=[],n[e]=i),i.push(t)}else{let t=n[e];t||(t=[],n[e]=t),t.push(i)}}}let r=J(e=>JSON.stringify(e)),a=[];for(let i of(e.astNode&&a.push(e.astNode),e.extensionASTNodes&&a.push(...e.extensionASTNodes),a))if(i.directives?.length)for(let e of i.directives){let i=e.name.value,s=n[i];s||(s=[],n[i]=s);let o=t?.getDirective(i),l={};if(o&&(l=function(e,t,i={}){let n={},r=(t.arguments??[]).reduce((e,t)=>({...e,[t.name.value]:t}),{});for(let a of e.args){let e=r[a.name];if(!e){if("default"in a&&a.default)n[a.name]="value"in a.default?a.default.value:(0,U.valueFromASTUntyped)(a.default.literal);else if(void 0!==a.defaultValue)n[a.name]=a.defaultValue;else if((0,A.isNonNullType)(a.type))throw q(`Argument "${a.name}" of required type "${w(a.type,[])}" was not provided.`,{nodes:[t]});continue}let s=e.value,o=s.kind===N.Kind.NULL;if(s.kind===N.Kind.VARIABLE){let e=s.name.value;if(null==i||!Object.prototype.hasOwnProperty.call(i,e)){if(void 0!==a.defaultValue)n[a.name]=a.defaultValue;else if((0,A.isNonNullType)(a.type))throw q(`Argument "${a.name}" of required type "${w(a.type,[])}" was provided the variable "$${e}" which was not provided a runtime value.`,{nodes:[s]});continue}o=null==i[e]}if(o&&(0,A.isNonNullType)(a.type))throw q(`Argument "${a.name}" of non-null type "${w(a.type,[])}" must not be null.`,{nodes:[s]});let l=(0,V.valueFromAST)(s,a.type,i);if(void 0===l)throw q(`Argument "${a.name}" has invalid value ${(0,G.print)(s)}.`,{nodes:[s]});n[a.name]=l}return n}(o,e)),e.arguments)for(let t of e.arguments){let e=t.name.value;if(null==l[e]){let i=o?.args.find(t=>t.name===e);i&&(l[e]=(0,V.valueFromAST)(t.value,i.type))}null==l[e]&&(l[e]=(0,U.valueFromASTUntyped)(t.value))}if(a.length>0&&s.length>0){let e=r(l);if(s.some(t=>r(t)===e))continue}s.push(l)}return n}(e,void 0,t)).map(([e,t])=>t?.map(t=>({name:e,args:t}))).flat(1/0).filter(Boolean)}J(function(e){return new Set([...W(e)].map(e=>e.name))});let W=J(function(e){return new Set(Y(e).values())}),Y=J(function(e){let t=new Map,i=e.getQueryType();i&&t.set("query",i);let n=e.getMutationType();n&&t.set("mutation",n);let r=e.getSubscriptionType();return r&&t.set("subscription",r),t});function z(e,t,i){let n,r=[],a=H(e,i);null!=a&&(n=et(t,a));let s=null,o=null,l=null;(null!=n&&(r=n.filter(e=>D.specifiedDirectives.every(t=>t.name!==e.name.value)),s=n.find(e=>"deprecated"===e.name.value),o=n.find(e=>"specifiedBy"===e.name.value),l=n.find(e=>"oneOf"===e.name.value)),null!=e.deprecationReason&&null==s&&(s=ee("deprecated",{reason:e.deprecationReason},D.GraphQLDeprecatedDirective)),null!=e.specifiedByUrl||null!=e.specifiedByURL&&null==o)&&(o=ee("specifiedBy",{url:e.specifiedByUrl||e.specifiedByURL}));return e.isOneOf&&null==l&&(l=ee("oneOf")),null!=s&&r.push(s),null!=o&&r.push(o),null!=l&&r.push(l),r}function X(e,t,i){return{kind:N.Kind.INPUT_VALUE_DEFINITION,description:j(e),name:{kind:N.Kind.NAME,value:e.name},type:F(e.type),defaultValue:$(e),directives:z(e,t,i)}}function Z(e,t,i){return{kind:N.Kind.FIELD_DEFINITION,description:j(e),name:{kind:N.Kind.NAME,value:e.name},arguments:e.args.map(e=>X(e,t,i)),type:F(e.type),directives:z(e,t,i)}}function ee(e,t,i){let n=[];for(let e in t){let r,a=t[e];if(null!=i){let t=i.args.find(t=>t.name===e);t&&(r=x(a,t.type))}null==r&&(r=k(a)),null!=r&&n.push({kind:N.Kind.ARGUMENT,name:{kind:N.Kind.NAME,value:e},value:r})}return{kind:N.Kind.DIRECTIVE,name:{kind:N.Kind.NAME,value:e},arguments:n}}function et(e,t){let i=[];for(let{name:n,args:r}of t){let t=e?.getDirective(n);i.push(ee(n,r,t))}return i}var ei=e.i(650177),en=e.i(521281);let er={};function ea(e,t,i,n){let r=function(e){let t=function(e){let t=e.loc;if(!t)return;let i=[],n=t.startToken.prev;for(;null!=n&&n.kind===ei.TokenKind.COMMENT&&null!=n.next&&null!=n.prev&&n.line+1===n.next.line&&n.line!==n.prev.line;){let e=String(n.value);i.push(e),n=n.prev}return i.length>0?i.reverse().join("\n"):void 0}(e);if(void 0!==t)return function(e){let t=e.split(/\r\n|[\n\r]/g),i=function(e){let t=null;for(let i=1;i<e.length;i++){let n=e[i],r=ef(n);if(r!==n.length&&(null===t||r<t)&&0===(t=r))break}return null===t?0:t}(t);if(0!==i)for(let e=1;e<t.length;e++)t[e]=t[e].slice(i);for(;t.length>0&&em(t[0]);)t.shift();for(;t.length>0&&em(t[t.length-1]);)t.pop();return t.join("\n")}(`
|
|
28
28
|
${t}`)}(e);if("string"!=typeof r||0===r.length)return;let a=[t];i&&(a.push(i),n&&a.push(n));let s=a.join(".");er[s]||(er[s]=[]),er[s].push(r)}function es(e){return"\n# "+e.replace(/\n/g,"\n# ")}function eo(e,t){return e?e.filter(e=>e).join(t||""):""}function el(e){return e?.some(e=>e.includes("\n"))??!1}function eu(e){return e&&` ${e.replace(/\n/g,"\n ")}`}function ec(e){return e&&0!==e.length?`{
|
|
29
29
|
${eu(eo(e,"\n"))}
|
|
30
30
|
}`:""}function ed(e,t,i){return t?e+t+(i||""):""}let ep={Name:{leave:e=>e.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>eo(e.definitions,"\n\n")},OperationDefinition:{leave:e=>{let t=ed("(",eo(e.variableDefinitions,", "),")");return eo([e.operation,eo([e.name,t]),eo(e.directives," ")]," ")+" "+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:i,directives:n})=>e+": "+t+ed(" = ",i)+ed(" ",eo(n," "))},SelectionSet:{leave:({selections:e})=>ec(e)},Field:{leave({alias:e,name:t,arguments:i,directives:n,selectionSet:r}){let a=ed("",e,": ")+t,s=a+ed("(",eo(i,", "),")");return s.length>80&&(s=a+ed("(\n",eu(eo(i,"\n")),"\n)")),eo([s,eo(n," "),r]," ")}},Argument:{leave:({name:e,value:t})=>e+": "+t},FragmentSpread:{leave:({name:e,directives:t})=>"..."+e+ed(" ",eo(t," "))},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:i})=>eo(["...",ed("on ",e),eo(t," "),i]," ")},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:i,directives:n,selectionSet:r})=>`fragment ${e}${ed("(",eo(i,", "),")")} on ${t} ${ed("",eo(n," ")," ")}`+r},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>t?function(e,t=!1){let i=e.replace(/\\/g,"\\\\").replace(/"""/g,'\\"""');return(" "===e[0]||" "===e[0])&&-1===e.indexOf("\n")?`"""${i.replace(/"$/,'"\n')}"""`:`"""
|
|
31
31
|
${t?i:eu(i)}
|
|
32
|
-
"""`}(e):JSON.stringify(e)},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>"["+eo(e,", ")+"]"},ObjectValue:{leave:({fields:e})=>"{"+eo(e,", ")+"}"},ObjectField:{leave:({name:e,value:t})=>e+": "+t},Directive:{leave:({name:e,arguments:t})=>"@"+e+ed("(",eo(t,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({directives:e,operationTypes:t})=>eo(["schema",eo(e," "),ec(t)]," ")},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+": "+t},ScalarTypeDefinition:{leave:({name:e,directives:t})=>eo(["scalar",e,eo(t," ")]," ")},ObjectTypeDefinition:{leave:({name:e,interfaces:t,directives:i,fields:n})=>eo(["type",e,ed("implements ",eo(t," & ")),eo(i," "),ec(n)]," ")},FieldDefinition:{leave:({name:e,arguments:t,type:i,directives:n})=>e+(el(t)?ed("(\n",eu(eo(t,"\n")),"\n)"):ed("(",eo(t,", "),")"))+": "+i+ed(" ",eo(n," "))},InputValueDefinition:{leave:({name:e,type:t,defaultValue:i,directives:n})=>eo([e+": "+t,ed("= ",i),eo(n," ")]," ")},InterfaceTypeDefinition:{leave:({name:e,interfaces:t,directives:i,fields:n})=>eo(["interface",e,ed("implements ",eo(t," & ")),eo(i," "),ec(n)]," ")},UnionTypeDefinition:{leave:({name:e,directives:t,types:i})=>eo(["union",e,eo(t," "),ed("= ",eo(i," | "))]," ")},EnumTypeDefinition:{leave:({name:e,directives:t,values:i})=>eo(["enum",e,eo(t," "),ec(i)]," ")},EnumValueDefinition:{leave:({name:e,directives:t})=>eo([e,eo(t," ")]," ")},InputObjectTypeDefinition:{leave:({name:e,directives:t,fields:i})=>eo(["input",e,eo(t," "),ec(i)]," ")},DirectiveDefinition:{leave:({name:e,arguments:t,repeatable:i,locations:n})=>"directive @"+e+(el(t)?ed("(\n",eu(eo(t,"\n")),"\n)"):ed("(",eo(t,", "),")"))+(i?" repeatable":"")+" on "+eo(n," | ")},SchemaExtension:{leave:({directives:e,operationTypes:t})=>eo(["extend schema",eo(e," "),ec(t)]," ")},ScalarTypeExtension:{leave:({name:e,directives:t})=>eo(["extend scalar",e,eo(t," ")]," ")},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:i,fields:n})=>eo(["extend type",e,ed("implements ",eo(t," & ")),eo(i," "),ec(n)]," ")},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:i,fields:n})=>eo(["extend interface",e,ed("implements ",eo(t," & ")),eo(i," "),ec(n)]," ")},UnionTypeExtension:{leave:({name:e,directives:t,types:i})=>eo(["extend union",e,eo(t," "),ed("= ",eo(i," | "))]," ")},EnumTypeExtension:{leave:({name:e,directives:t,values:i})=>eo(["extend enum",e,eo(t," "),ec(i)]," ")},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:i})=>eo(["extend input",e,eo(t," "),ec(i)]," ")}},eh=Object.keys(ep).reduce((e,t)=>{var i;return{...e,[t]:{leave:(i=ep[t].leave,(e,t,n,r,a)=>{let s=[],o=r.reduce((e,t)=>(["fields","arguments","values"].includes(t)&&e.name&&s.push(e.name.value),e[t]),a[0]),l=[...s,o?.name?.value].filter(Boolean).join("."),u=[];return e.kind.includes("Definition")&&er[l]&&u.push(...er[l]),eo([...u.map(es),e.description,i(e,t,n,r,a)],"\n")})}}},{});function ef(e){let t=0;for(;t<e.length&&(" "===e[t]||" "===e[t]);)t++;return t}function em(e){return ef(e)===e.length}function ey(e){return e.as??e.url.name}function ev(e,t){var i,n;if(e.url.name&&t===`@${e.url.name}`){let t;return((t=ey(e))&&`@${t}`).substring(1)}let r=e.imports.find(e=>e.name===t),a=r?.as??r?.name??(i=ey(e),n=t,i?.length?n.startsWith("@")?`@${i}__${n.substring(1)}`:`${i}__${n}`:n);return a.startsWith("@")?a.substring(1):a}let eg=/v(\d{1,3})\.(\d{1,4})/i;function eT(e){let t=new URL(e),i=t.pathname.split("/").filter(Boolean),n=i[i.length-1];if(n){if(eg.test(n)){let e=i[i.length-2];return{identity:t.origin+(e?`/${i.slice(0,i.length-1).join("/")}`:""),name:e??null,version:n}}return{identity:`${t.origin}/${i.join("/")}`,name:n,version:null}}return{identity:t.origin,name:null,version:null}}function eS(e,t){return t.some(({value:t})=>t===e.value)}let eE=(e,t)=>{if(e.kind===t.kind)switch(e.kind){case N.Kind.LIST:return e.values.length===t.values.length&&e.values.every(e=>t.values.find(t=>eE(e,t)));case N.Kind.VARIABLE:case N.Kind.NULL:return!0;case N.Kind.OBJECT:return e.fields.length===t.fields.length&&e.fields.every(e=>t.fields.find(t=>e.name.value===t.name.value&&eE(e.value,t.value)));default:return e.value===t.value}return!1},eI=e=>"link"===e.name.value,eb=e=>{let t=eI(e)?e.arguments?.find(e=>"url"===e.name.value)?.value:void 0;return t?.kind==="StringValue"?t.value:void 0},eN=(e,t)=>!!(e.name.value===t.name.value&&(e.arguments===t.arguments||e.arguments?.length===t.arguments?.length&&e.arguments?.every(e=>t.arguments?.find(t=>e.name.value===t.name.value&&e.value.kind===t.value.kind&&eE(e.value,t.value)))));function e_(e=[],t=[],i,n){let r=i&&i.reverseDirectives,a=[];for(let o of[...r?e:t,...r?t:e]){var s;if(s=i?.repeatableLinkImports,n?.[o.name.value]?.repeatable??s?.has(o.name.value))a.find(e=>eN(o,e))||a.push(o);else{let e=a.findIndex(e=>e.name.value===o.name.value);if(-1===e)a.push(o);else{if(eI(o)&&eI(a[e])){let t=eb(o),i=eb(a[e]);if(t&&i&&t!==i){a.push(o);continue}}let t=function(e,t){let i=[];for(let n of[...t,...e]){let e=i.findIndex(e=>e.name.value===n.name.value);if(-1===e)i.push(n);else{let t=i[e];if("ListValue"===t.value.kind){let e=t.value.values,i=n.value.values;t.value={...t.value,values:eD(e,i,(e,t)=>{let i=e.value;return!i||!t.some(e=>e.value===i)})}}else t.value=n.value}}return i}(o.arguments??[],a[e].arguments??[]);a[e]={...a[e],arguments:0===t.length?void 0:t}}}}return a}function eD(e,t,i){return e.concat(t.filter(t=>i(t,e)))}var eA=e.i(439588);function eO(e){let t=e;for(;t.kind===N.Kind.LIST_TYPE||"NonNullType"===t.kind;)t=t.type;return t}function eR(e){return e.kind!==N.Kind.NAMED_TYPE}function ew(e){return e.kind===N.Kind.LIST_TYPE}function eL(e){return e.kind===N.Kind.NON_NULL_TYPE}function eC(e){return ew(e)?`[${eC(e.type)}]`:eL(e)?`${eC(e.type)}!`:e.name.value}function eF(e,t){return null==e&&null==t?o.A_EQUALS_B:null==e?o.A_SMALLER_THAN_B:null==t?o.A_GREATER_THAN_B:e<t?o.A_SMALLER_THAN_B:e>t?o.A_GREATER_THAN_B:o.A_EQUALS_B}function ek(e,t,i,n,r){let a=[];if(null!=i&&a.push(...i),null!=t)for(let i of t){let[t,s]=function(e,t){let i=e.findIndex(e=>e.name.value===t.name.value);return[i>-1?e[i]:null,i]}(a,i);if(t&&!n?.ignoreFieldConflicts){let o=n?.onFieldTypeConflict&&n.onFieldTypeConflict(t,i,e,n?.throwOnConflict)||function(e,t,i,n=!1){let r=eC(t.type),a=eC(i.type);if(r!==a){let s=eO(t.type),o=eO(i.type);if(s.name.value!==o.name.value)throw Error(`Field "${i.name.value}" already defined with a different type. Declared as "${s.name.value}", but you tried to override with "${o.name.value}"`);if(!function e(t,i,n=!1){return eR(t)||eR(i)?eL(i)?e(eL(t)?t.type:t,i.type):eL(t)?e(i,t,n):!!ew(t)&&(ew(i)&&e(t.type,i.type)||eL(i)&&e(t,i.type)):t.toString()===i.toString()}(t.type,i.type,!n))throw Error(`Field '${e.name.value}.${t.name.value}' changed type from '${r}' to '${a}'`)}return eL(i.type)&&!eL(t.type)&&(t.type=i.type),t}(e,t,i,n?.throwOnConflict);o.arguments=function(e,t,i){let n=function(e,t){return e.reduce((e,i)=>{let n=e.findIndex(e=>e.name.value===i.name.value);return -1===n?e.concat([i]):(t?.reverseArguments||(e[n]=i),e)},[])}([...t,...e].filter(g),i);return i&&i.sort&&n.sort(v),n}(i.arguments||[],t.arguments||[],n),o.directives=e_(i.directives,t.directives,n,r),o.description=i.description||t.description,a[s]=o}else a.push(i)}if(n&&n.sort&&a.sort(v),n&&n.exclusions){let t=n.exclusions;return a.filter(i=>!t.includes(`${e.name.value}.${i.name.value}`))}return a}function eP(e=[],t=[],i={}){let n=[...t,...e.filter(e=>!t.find(t=>t.name.value===e.name.value))];return i&&i.sort&&n.sort(v),n}(i=o||(o={}))[i.A_SMALLER_THAN_B=-1]="A_SMALLER_THAN_B",i[i.A_EQUALS_B=0]="A_EQUALS_B",i[i.A_GREATER_THAN_B=1]="A_GREATER_THAN_B";let ex={query:"Query",mutation:"Mutation",subscription:"Subscription"},eM="SCHEMA_DEF_SYMBOL";function eU(e,t,i={}){for(let l of e){var n,r,a,s,o;if("name"in l){let e=l.name?.value;if(t?.commentDescriptions&&function(e){let t=e.name?.value;if(null!=t)switch(ea(e,t),e.kind){case"EnumTypeDefinition":if(e.values)for(let i of e.values)ea(i,t,i.name.value);break;case"ObjectTypeDefinition":case"InputObjectTypeDefinition":case"InterfaceTypeDefinition":if(e.fields){for(let i of e.fields)if(ea(i,t,i.name.value),"FieldDefinition"===i.kind&&i.arguments)for(let e of i.arguments)ea(e,t,i.name.value,e.name.value)}}}(l),null==e)continue;if(t?.exclusions?.includes(e+".*")||t?.exclusions?.includes(e))delete i[e];else switch(l.kind){case N.Kind.OBJECT_TYPE_DEFINITION:case N.Kind.OBJECT_TYPE_EXTENSION:i[e]=function(e,t,i,n){if(t)try{return{name:e.name,description:e.description||t.description,kind:i?.convertExtensions||"ObjectTypeDefinition"===e.kind||"ObjectTypeDefinition"===t.kind?"ObjectTypeDefinition":"ObjectTypeExtension",loc:e.loc,fields:ek(e,e.fields,t.fields,i,n),directives:e_(e.directives,t.directives,i,n),interfaces:eP(e.interfaces,t.interfaces,i)}}catch(t){throw Error(`Unable to merge GraphQL type "${e.name.value}": ${t.message}`)}return i?.convertExtensions?{...e,kind:N.Kind.OBJECT_TYPE_DEFINITION}:e}(l,i[e],t,i);break;case N.Kind.ENUM_TYPE_DEFINITION:case N.Kind.ENUM_TYPE_EXTENSION:i[e]=(n=i[e],n?{name:l.name,description:l.description||n.description,kind:t?.convertExtensions||"EnumTypeDefinition"===l.kind||"EnumTypeDefinition"===n.kind?"EnumTypeDefinition":"EnumTypeExtension",loc:l.loc,directives:e_(l.directives,n.directives,t,i),values:function(e,t,i){if(i?.consistentEnumMerge){let i=[];e&&i.push(...e),e=t,t=i}let n=new Map;if(e)for(let t of e)n.set(t.name.value,t);if(t)for(let e of t){let t=e.name.value;if(n.has(t)){let i=n.get(t);i.description=e.description||i.description,i.directives=e_(e.directives,i.directives,void 0)}else n.set(t,e)}let r=[...n.values()];return i&&i.sort&&r.sort(v),r}(l.values,n.values,t)}:t?.convertExtensions?{...l,kind:N.Kind.ENUM_TYPE_DEFINITION}:l);break;case N.Kind.UNION_TYPE_DEFINITION:case N.Kind.UNION_TYPE_EXTENSION:i[e]=(r=i[e],r?{name:l.name,description:l.description||r.description,directives:e_(l.directives,r.directives,t,i),kind:t?.convertExtensions||"UnionTypeDefinition"===l.kind||"UnionTypeDefinition"===r.kind?N.Kind.UNION_TYPE_DEFINITION:N.Kind.UNION_TYPE_EXTENSION,loc:l.loc,types:eP(l.types,r.types,t)}:t?.convertExtensions?{...l,kind:N.Kind.UNION_TYPE_DEFINITION}:l);break;case N.Kind.SCALAR_TYPE_DEFINITION:case N.Kind.SCALAR_TYPE_EXTENSION:i[e]=(a=i[e],a?{name:l.name,description:l.description||a.description,kind:t?.convertExtensions||"ScalarTypeDefinition"===l.kind||"ScalarTypeDefinition"===a.kind?"ScalarTypeDefinition":"ScalarTypeExtension",loc:l.loc,directives:e_(l.directives,a.directives,t,i)}:t?.convertExtensions?{...l,kind:N.Kind.SCALAR_TYPE_DEFINITION}:l);break;case N.Kind.INPUT_OBJECT_TYPE_DEFINITION:case N.Kind.INPUT_OBJECT_TYPE_EXTENSION:i[e]=function(e,t,i,n){if(t)try{return{name:e.name,description:e.description||t.description,kind:i?.convertExtensions||"InputObjectTypeDefinition"===e.kind||"InputObjectTypeDefinition"===t.kind?"InputObjectTypeDefinition":"InputObjectTypeExtension",loc:e.loc,fields:ek(e,e.fields,t.fields,i),directives:e_(e.directives,t.directives,i,n)}}catch(t){throw Error(`Unable to merge GraphQL input type "${e.name.value}": ${t.message}`)}return i?.convertExtensions?{...e,kind:N.Kind.INPUT_OBJECT_TYPE_DEFINITION}:e}(l,i[e],t,i);break;case N.Kind.INTERFACE_TYPE_DEFINITION:case N.Kind.INTERFACE_TYPE_EXTENSION:i[e]=function(e,t,i,n){if(t)try{return{name:e.name,description:e.description||t.description,kind:i?.convertExtensions||"InterfaceTypeDefinition"===e.kind||"InterfaceTypeDefinition"===t.kind?"InterfaceTypeDefinition":"InterfaceTypeExtension",loc:e.loc,fields:ek(e,e.fields,t.fields,i,n),directives:e_(e.directives,t.directives,i,n),interfaces:e.interfaces?eP(e.interfaces,t.interfaces,i):void 0}}catch(t){throw Error(`Unable to merge GraphQL interface "${e.name.value}": ${t.message}`)}return i?.convertExtensions?{...e,kind:N.Kind.INTERFACE_TYPE_DEFINITION}:e}(l,i[e],t,i);break;case N.Kind.DIRECTIVE_DEFINITION:i[e]&&e in{}&&!(null!=(o=i[e])&&"object"==typeof o&&"kind"in o&&"string"==typeof o.kind)&&(i[e]=void 0),i[e]=function(e,t){return t?{...e,arguments:eD(t.arguments||[],e.arguments||[],(e,t)=>!eS(e.name,t.map(e=>e.name))),locations:[...t.locations,...e.locations.filter(e=>!eS(e,t.locations))]}:e}(l,i[e])}}else(l.kind===N.Kind.SCHEMA_DEFINITION||l.kind===N.Kind.SCHEMA_EXTENSION)&&(i[eM]=(s=i[eM],s?{kind:l.kind===N.Kind.SCHEMA_DEFINITION||s.kind===N.Kind.SCHEMA_DEFINITION?N.Kind.SCHEMA_DEFINITION:N.Kind.SCHEMA_EXTENSION,description:l.description||s.description,directives:e_(l.directives,s.directives,t,void 0),operationTypes:function(e=[],t=[]){let i=[];for(let n in ex){let r=e.find(e=>e.operation===n)||t.find(e=>e.operation===n);r&&i.push(r)}return i}(l.operationTypes,s.operationTypes)}:t?.convertExtensions?{...l,kind:N.Kind.SCHEMA_DEFINITION}:l))}return i}function e$(e,t){let i;er={};let n={kind:N.Kind.DOCUMENT,definitions:function(e,t){er={};let{allDirectives:i,allNodes:n,repeatableLinkImports:r}=function e(t,i,n=[],r=[],a=new Set,s=new Set){let o=e=>{s.add(e)};if(t&&!a.has(t))if(a.add(t),"function"==typeof t)e(t(),i,n,r,a,s);else if(Array.isArray(t))for(let o of t)e(o,i,n,r,a,s);else if((0,f.isSchema)(t))e(function(e,t={}){let i=t.pathToDirectivesInExtensions,n=e.getTypeMap(),r=function(e,t){let i=new Map([["query",void 0],["mutation",void 0],["subscription",void 0]]),n=[];if(null!=e.astNode&&n.push(e.astNode),null!=e.extensionASTNodes)for(let t of e.extensionASTNodes)n.push(t);for(let e of n)if(e.operationTypes)for(let t of e.operationTypes)i.set(t.operation,t);let r=Y(e);for(let[e,t]of i){let n=r.get(e);if(null!=n){let r=F(n);null!=t?t.type=r:i.set(e,{kind:N.Kind.OPERATION_TYPE_DEFINITION,operation:e,type:r})}}let a=[...i.values()].filter(g),s=z(e,e,t);if(!a.length&&!s.length)return null;let o={kind:a.length?N.Kind.SCHEMA_DEFINITION:N.Kind.SCHEMA_EXTENSION,operationTypes:a,directives:s},l=j(e);return l&&(o.description=l),o}(e,i),a=null!=r?[r]:[];for(let t of e.getDirectives())(0,D.isSpecifiedDirective)(t)||a.push(function(e,t,i){return{kind:N.Kind.DIRECTIVE_DEFINITION,description:j(e),name:{kind:N.Kind.NAME,value:e.name},arguments:e.args?.map(e=>X(e,t,i)),repeatable:e.isRepeatable,locations:e.locations?.map(e=>({kind:N.Kind.NAME,value:e}))||[]}}(t,e,i));for(let t in n){let r=n[t],u=(0,R.isSpecifiedScalarType)(r),c=(0,O.isIntrospectionType)(r);if(!u&&!c)if((0,A.isObjectType)(r))a.push(function(e,t,i){return{kind:N.Kind.OBJECT_TYPE_DEFINITION,description:j(e),name:{kind:N.Kind.NAME,value:e.name},fields:Object.values(e.getFields()).map(e=>Z(e,t,i)),interfaces:Object.values(e.getInterfaces()).map(e=>F(e)),directives:z(e,t,i)}}(r,e,i));else if((0,A.isInterfaceType)(r))a.push(function(e,t,i){let n={kind:N.Kind.INTERFACE_TYPE_DEFINITION,description:j(e),name:{kind:N.Kind.NAME,value:e.name},fields:Object.values(e.getFields()).map(e=>Z(e,t,i)),directives:z(e,t,i)};return"getInterfaces"in e&&(n.interfaces=Object.values(e.getInterfaces()).map(e=>F(e))),n}(r,e,i));else if((0,A.isUnionType)(r)){var s,o,l;a.push((s=r,o=e,l=i,{kind:N.Kind.UNION_TYPE_DEFINITION,description:j(s),name:{kind:N.Kind.NAME,value:s.name},directives:z(s,o,l),types:s.getTypes().map(e=>F(e))}))}else if((0,A.isInputObjectType)(r))a.push(function(e,t,i){return{kind:N.Kind.INPUT_OBJECT_TYPE_DEFINITION,description:j(e),name:{kind:N.Kind.NAME,value:e.name},fields:Object.values(e.getFields()).map(e=>{var n,r,a;return n=e,r=t,a=i,{kind:N.Kind.INPUT_VALUE_DEFINITION,description:j(n),name:{kind:N.Kind.NAME,value:n.name},type:F(n.type),directives:z(n,r,a),defaultValue:$(n)}}),directives:z(e,t,i)}}(r,e,i));else if((0,A.isEnumType)(r))a.push(function(e,t,i){return{kind:N.Kind.ENUM_TYPE_DEFINITION,description:j(e),name:{kind:N.Kind.NAME,value:e.name},values:Object.values(e.getValues()).map(e=>{var n,r,a;return n=e,r=t,a=i,{kind:N.Kind.ENUM_VALUE_DEFINITION,description:j(n),name:{kind:N.Kind.NAME,value:n.name},directives:z(n,r,a)}}),directives:z(e,t,i)}}(r,e,i));else if((0,A.isScalarType)(r))a.push(function(e,t,i){let n=et(t,J(e,i)),r=e.specifiedByUrl||e.specifiedByURL;return r&&!n.some(e=>"specifiedBy"===e.name.value)&&n.push(ee("specifiedBy",{url:r})),{kind:N.Kind.SCALAR_TYPE_DEFINITION,description:j(e),name:{kind:N.Kind.NAME,value:e.name},directives:n}}(r,e,i));else throw Error(`Unknown type ${r}.`)}return{kind:N.Kind.DOCUMENT,definitions:a}}(t,i).definitions,i,n,r,a,s);else if("string"==typeof t||t instanceof eA.Source)e((0,_.parse)(t,i).definitions,i,n,r,a,s);else if("object"==typeof t&&(0,b.isDefinitionNode)(t)){let e=function(e){let t=[];for(let i of e.definitions)if(i.kind===N.Kind.SCHEMA_EXTENSION||i.kind===N.Kind.SCHEMA_DEFINITION){let e=i.directives?.filter(e=>"link"===e.name.value),n=e?.map(e=>(function(e){let t,i,n=[];for(let a of e)switch(a.name.value){case"url":a.value.kind===N.Kind.STRING&&(t=eT(a.value.value));break;case"import":var r;n=(r=a.value).kind===N.Kind.LIST?r.values.map(e=>{let t;if(e.kind===N.Kind.STRING)t={name:e.value};else if(e.kind===N.Kind.OBJECT){let i,n="";for(let t of e.fields)"name"===t.name.value?t.value.kind===N.Kind.STRING&&(n=t.value.value):"as"===t.name.value&&t.value.kind===N.Kind.STRING&&(i=t.value.value);t={name:n,as:i}}return t}).filter(e=>void 0!==e):[];break;case"as":a.value.kind===N.Kind.STRING&&(i=a.value.value??void 0)}if(void 0!==t)return{url:t,as:i,imports:n}})(e.arguments??[])).filter(e=>void 0!==e)??[];t=t.concat(n);let r=i.directives?.filter(({name:e})=>"core"===e.value),a=r?.map(e=>(function(e){let t=e.find(({name:e,value:t})=>"feature"===e.value&&t.kind===N.Kind.STRING);if(t)return{url:eT(t.value.value),imports:[]}})(e.arguments??[])).filter(e=>void 0!==e);a&&(t=t.concat(...a))}return t}({definitions:[t],kind:N.Kind.DOCUMENT}),i=e.find(e=>"https://specs.apollo.dev/federation"===e.url.identity);i&&(o(ev(i,"@composeDirective")),o(ev(i,"@key")));let a=e.find(e=>"https://specs.apollo.dev/link"===e.url.identity);a&&o(ev(a,"@link")),t.kind===N.Kind.DIRECTIVE_DEFINITION?n.push(t):r.push(t)}else if(t&&"object"==typeof t&&"kind"in t&&t.kind===N.Kind.DOCUMENT)e(t.definitions,i,n,r,a,s);else throw Error(`typeDefs must contain only strings, documents, schemas, or functions, got ${typeof t}`);return{allDirectives:n,allNodes:r,repeatableLinkImports:s}}(e,t),a=eU(i,t);t.repeatableLinkImports=r;let s=eU(n,t,a);if(t?.useSchemaDefinition){let e=s[eM]||{kind:N.Kind.SCHEMA_DEFINITION,operationTypes:[]},t=e.operationTypes||[];for(let e in ex)if(!t.find(t=>t.operation===e)){let i=s[ex[e]];null!=i&&null!=i.name&&t.push({kind:N.Kind.OPERATION_TYPE_DEFINITION,type:{kind:N.Kind.NAMED_TYPE,name:i.name},operation:e})}e?.operationTypes?.length!=null&&e.operationTypes.length>0&&(s[eM]=e)}t?.forceSchemaDefinition&&!s[eM]?.operationTypes?.length&&(s[eM]={kind:N.Kind.SCHEMA_DEFINITION,operationTypes:[{kind:N.Kind.OPERATION_TYPE_DEFINITION,operation:"query",type:{kind:N.Kind.NAMED_TYPE,name:{kind:N.Kind.NAME,value:"Query"}}}]});let o=Object.values(s);if(t?.sort){let e="function"==typeof t.sort?t.sort:eF;o.sort((t,i)=>e(t.name?.value,i.name?.value))}return o}(e,{useSchemaDefinition:!0,forceSchemaDefinition:!1,throwOnConflict:!1,commentDescriptions:!1,...t})};if(t?.commentDescriptions)i=(0,en.visit)(n,eh);else i=n;return er={},i}function ej(e,t){let i=e.getTypeMap();for(let e in i){let n=i[e];if(!(0,A.getNamedType)(n).name.startsWith("__")){if((0,A.isObjectType)(n)){let e=n.getFields();for(let i in e)for(let n of e[i].args)n.defaultValue=t(n.type,n.defaultValue)}else if((0,A.isInputObjectType)(n)){let e=n.getFields();for(let i in e){let n=e[i];n.defaultValue=t(n.type,n.defaultValue)}}}}}function eV(e,t){let i=e.getTypeMap();for(let e in i){let n=i[e];if(!(0,A.getNamedType)(n).name.startsWith("__")&&(0,A.isObjectType)(n)){let i=n.getFields();for(let n in i)t(i[n],e,n)}}}function eG(e,t){if(t){let i=e[t.name];if((0,A.isObjectType)(i))return i}}function eB(e,t,i=null,n=null){if(null==t)return t;let r=(0,A.getNullableType)(e);if((0,A.isLeafType)(r))return null!=i?i(r,t):t;if((0,A.isListType)(r))return m(t).map(e=>eB(r.ofType,e,i,n));if((0,A.isInputObjectType)(r)){let e=r.getFields(),a={};for(let r in t){let s=e[r];null!=s&&(a[r]=eB(s.type,t[r],i,n))}return null!=n?n(r,a):a}}function eK(e,t){return eB(e,t,(e,t)=>{try{return e.serialize(t)}catch{return t}})}function eQ(e,t){return eB(e,t,(e,t)=>{try{return e.parseValue(t)}catch{return t}})}function eq(e,t={}){var i,n;let r,a,s=eX(ez(eJ(eW((i=eJ(eW(e.getTypeMap(),e,eK),e,t,e=>(0,A.isLeafType)(e)),n=e,(a=null!=(r=t[l.ENUM_VALUE])?r:null)?eJ(i,n,{[l.ENUM_TYPE]:e=>{let t=e.toConfig(),i=t.values,r={};for(let t in i){let s=i[t],o=a(s,e.name,n,t);if(void 0===o)r[t]=s;else if(Array.isArray(o)){let[e,t]=o;r[e]=void 0===t?s:t}else null!==o&&(r[t]=o)}return eZ(new A.GraphQLEnumType({...t,values:r}))}},e=>(0,A.isEnumType)(e)):i),e,eQ),e,t,e=>!(0,A.isLeafType)(e)),e,t),e,t),{typeMap:o,directives:u}=function(e,t){let i=Object.create(null);for(let t in e)i[t]=e[t];let n=Object.create(null);for(let e in i){let t=i[e];if(null==t||e.startsWith("__"))continue;let r=t.name;if(!r.startsWith("__")){if(null!=n[r]){console.warn(`Duplicate schema type name ${r} found; keeping the existing one found in the schema`);continue}n[r]=t}}for(let e in n)n[e]=a(n[e]);return{typeMap:n,directives:t.map(e=>(function(e){if((0,D.isSpecifiedDirective)(e))return e;let t=e.toConfig();return t.args=r(t.args),new D.GraphQLDirective(t)})(e))};function r(e){let t={};for(let i in e){let n=e[i],r=l(n.type);null!=r&&(n.type=r,t[i]=n)}return t}function a(e){if((0,A.isObjectType)(e)){let t=e.toConfig(),i={...t,fields:()=>s(t.fields),interfaces:()=>o(t.interfaces)};return new A.GraphQLObjectType(i)}if((0,A.isInterfaceType)(e)){let t=e.toConfig(),i={...t,fields:()=>s(t.fields)};return"interfaces"in i&&(i.interfaces=()=>o(t.interfaces)),new A.GraphQLInterfaceType(i)}if((0,A.isUnionType)(e)){let t=e.toConfig(),i={...t,types:()=>o(t.types)};return new A.GraphQLUnionType(i)}if((0,A.isInputObjectType)(e)){let t=e.toConfig(),i={...t,fields:()=>(function(e){let t={};for(let i in e){let n=e[i],r=l(n.type);null!=r&&(n.type=r,t[i]=n)}return t})(t.fields)};return new A.GraphQLInputObjectType(i)}if((0,A.isEnumType)(e)){let t=e.toConfig();return new A.GraphQLEnumType(t)}else if((0,A.isScalarType)(e)){if((0,R.isSpecifiedScalarType)(e))return e;let t=e.toConfig();return new A.GraphQLScalarType(t)}throw Error(`Unexpected schema type: ${e}`)}function s(e){let t={};for(let i in e){let n=e[i],a=l(n.type);null!=a&&n.args&&(n.type=a,n.args=r(n.args),t[i]=n)}return t}function o(e){let t=[];for(let i of e){let e=l(i);null!=e&&t.push(e)}return t}function l(e){if((0,A.isListType)(e)){let t=l(e.ofType);return null!=t?new A.GraphQLList(t):null}if((0,A.isNonNullType)(e)){let t=l(e.ofType);return null!=t?new A.GraphQLNonNull(t):null}if((0,A.isNamedType)(e)){let t=i[e.name];return void 0===t&&(n[(t=!function(e){if("getFields"in e){let t=e.getFields();for(let e in t)return"_fake"===t[e].name}return!1}(e)?a(e):function(e){switch(e.name){case R.GraphQLInt.name:return R.GraphQLInt;case R.GraphQLFloat.name:return R.GraphQLFloat;case R.GraphQLString.name:return R.GraphQLString;case R.GraphQLBoolean.name:return R.GraphQLBoolean;case R.GraphQLID.name:return R.GraphQLID;default:return e}}(e)).name]=i[e.name]=t),null!=t?n[t.name]:null}return null}}(s,function(e,t,i){let n,r=null!=(n=i[l.DIRECTIVE])?n:null;if(null==r)return e.slice();let a=[];for(let i of e){let e=r(i,t);void 0===e?a.push(i):null!==e&&a.push(e)}return a}(e.getDirectives(),e,t));return new f.GraphQLSchema({...e.toConfig(),query:eG(o,eG(s,e.getQueryType())),mutation:eG(o,eG(s,e.getMutationType())),subscription:eG(o,eG(s,e.getSubscriptionType())),types:Object.values(o),directives:u})}(n=l||(l={})).TYPE="MapperKind.TYPE",n.SCALAR_TYPE="MapperKind.SCALAR_TYPE",n.ENUM_TYPE="MapperKind.ENUM_TYPE",n.COMPOSITE_TYPE="MapperKind.COMPOSITE_TYPE",n.OBJECT_TYPE="MapperKind.OBJECT_TYPE",n.INPUT_OBJECT_TYPE="MapperKind.INPUT_OBJECT_TYPE",n.ABSTRACT_TYPE="MapperKind.ABSTRACT_TYPE",n.UNION_TYPE="MapperKind.UNION_TYPE",n.INTERFACE_TYPE="MapperKind.INTERFACE_TYPE",n.ROOT_OBJECT="MapperKind.ROOT_OBJECT",n.QUERY="MapperKind.QUERY",n.MUTATION="MapperKind.MUTATION",n.SUBSCRIPTION="MapperKind.SUBSCRIPTION",n.DIRECTIVE="MapperKind.DIRECTIVE",n.FIELD="MapperKind.FIELD",n.COMPOSITE_FIELD="MapperKind.COMPOSITE_FIELD",n.OBJECT_FIELD="MapperKind.OBJECT_FIELD",n.ROOT_FIELD="MapperKind.ROOT_FIELD",n.QUERY_ROOT_FIELD="MapperKind.QUERY_ROOT_FIELD",n.MUTATION_ROOT_FIELD="MapperKind.MUTATION_ROOT_FIELD",n.SUBSCRIPTION_ROOT_FIELD="MapperKind.SUBSCRIPTION_ROOT_FIELD",n.INTERFACE_FIELD="MapperKind.INTERFACE_FIELD",n.INPUT_OBJECT_FIELD="MapperKind.INPUT_OBJECT_FIELD",n.ARGUMENT="MapperKind.ARGUMENT",n.ENUM_VALUE="MapperKind.ENUM_VALUE";let eH=["String","ID","Int","Float","Boolean"];function eJ(e,t,i,n=()=>!0){let r={};for(let a in e)if(!a.startsWith("__")&&!eH.includes(a)){let s=e[a];if(null==s||!n(s)){r[a]=s;continue}let o=function(e,t,i){let n,r,a,s=[...(r=e.getType(i),a=[l.TYPE],(0,A.isObjectType)(r)?(a.push(l.COMPOSITE_TYPE,l.OBJECT_TYPE),i===e.getQueryType()?.name?a.push(l.ROOT_OBJECT,l.QUERY):i===e.getMutationType()?.name?a.push(l.ROOT_OBJECT,l.MUTATION):i===e.getSubscriptionType()?.name&&a.push(l.ROOT_OBJECT,l.SUBSCRIPTION)):(0,A.isInputObjectType)(r)?a.push(l.INPUT_OBJECT_TYPE):(0,A.isInterfaceType)(r)?a.push(l.COMPOSITE_TYPE,l.ABSTRACT_TYPE,l.INTERFACE_TYPE):(0,A.isUnionType)(r)?a.push(l.COMPOSITE_TYPE,l.ABSTRACT_TYPE,l.UNION_TYPE):(0,A.isEnumType)(r)?a.push(l.ENUM_TYPE):(0,A.isScalarType)(r)&&a.push(l.SCALAR_TYPE),a)];for(;!n&&s.length>0;)n=t[s.pop()];return null!=n?n:null}(t,i,a);if(null==o){r[a]=s;continue}let u=o(s,t);if(void 0===u){r[a]=s;continue}r[a]=u}return r}function eW(e,t,i){let n=eX(e,t,{[l.ARGUMENT]:t=>{if(void 0===t.defaultValue)return t;let n=eY(e,t.type);if(null!=n)return{...t,defaultValue:i(n,t.defaultValue)}}});return ez(n,t,{[l.INPUT_OBJECT_FIELD]:e=>{if(void 0===e.defaultValue)return e;let t=eY(n,e.type);if(null!=t)return{...e,defaultValue:i(t,e.defaultValue)}}})}function eY(e,t){if((0,A.isListType)(t)){let i=eY(e,t.ofType);return null!=i?new A.GraphQLList(i):null}if((0,A.isNonNullType)(t)){let i=eY(e,t.ofType);return null!=i?new A.GraphQLNonNull(i):null}if((0,A.isNamedType)(t)){let i=e[t.name];return null!=i?i:null}return null}function ez(e,t,i){let n={};for(let r in e)if(!r.startsWith("__")){let a=e[r];if(!(0,A.isObjectType)(a)&&!(0,A.isInterfaceType)(a)&&!(0,A.isInputObjectType)(a)){n[r]=a;continue}let s=function(e,t,i){let n,r,a,s=[...(r=e.getType(i),a=[l.FIELD],(0,A.isObjectType)(r)?(a.push(l.COMPOSITE_FIELD,l.OBJECT_FIELD),i===e.getQueryType()?.name?a.push(l.ROOT_FIELD,l.QUERY_ROOT_FIELD):i===e.getMutationType()?.name?a.push(l.ROOT_FIELD,l.MUTATION_ROOT_FIELD):i===e.getSubscriptionType()?.name&&a.push(l.ROOT_FIELD,l.SUBSCRIPTION_ROOT_FIELD)):(0,A.isInterfaceType)(r)?a.push(l.COMPOSITE_FIELD,l.INTERFACE_FIELD):(0,A.isInputObjectType)(r)&&a.push(l.INPUT_OBJECT_FIELD),a)];for(;!n&&s.length>0;)n=t[s.pop()];return n??null}(t,i,r);if(null==s){n[r]=a;continue}let o=a.toConfig(),u=o.fields,c={};for(let e in u){let i=u[e],n=s(i,e,r,t);if(void 0===n)c[e]=i;else if(Array.isArray(n)){let[e,t]=n;null!=t.astNode&&(t.astNode={...t.astNode,name:{...t.astNode.name,value:e}}),c[e]=void 0===t?i:t}else null!==n&&(c[e]=n)}(0,A.isObjectType)(a)?n[r]=eZ(new A.GraphQLObjectType({...o,fields:c})):(0,A.isInterfaceType)(a)?n[r]=eZ(new A.GraphQLInterfaceType({...o,fields:c})):n[r]=eZ(new A.GraphQLInputObjectType({...o,fields:c}))}return n}function eX(e,t,i){let n={};for(let r in e)if(!r.startsWith("__")){let a=e[r];if(!(0,A.isObjectType)(a)&&!(0,A.isInterfaceType)(a)){n[r]=a;continue}let s=function(e){let t=e[l.ARGUMENT];return null!=t?t:null}(i);if(null==s){n[r]=a;continue}let o=a.toConfig(),u=o.fields,c={};for(let e in u){let i=u[e],n=i.args;if(null==n){c[e]=i;continue}let a=Object.keys(n);if(!a.length){c[e]=i;continue}let o={};for(let i of a){let a=n[i],l=s(a,e,r,t);if(void 0===l)o[i]=a;else if(Array.isArray(l)){let[e,t]=l;o[e]=t}else null!==l&&(o[i]=l)}c[e]={...i,args:o}}(0,A.isObjectType)(a)?n[r]=new A.GraphQLObjectType({...o,fields:c}):(0,A.isInterfaceType)(a)?n[r]=new A.GraphQLInterfaceType({...o,fields:c}):n[r]=new A.GraphQLInputObjectType({...o,fields:c})}return n}function eZ(e){if((0,A.isObjectType)(e)){let t=e.toConfig();if(null!=t.astNode){let e=[];for(let i in t.fields){let n=t.fields[i];null!=n.astNode&&e.push(n.astNode)}t.astNode={...t.astNode,kind:N.Kind.OBJECT_TYPE_DEFINITION,fields:e}}return null!=t.extensionASTNodes&&(t.extensionASTNodes=t.extensionASTNodes.map(e=>({...e,kind:N.Kind.OBJECT_TYPE_EXTENSION,fields:void 0}))),new A.GraphQLObjectType(t)}if((0,A.isInterfaceType)(e)){let t=e.toConfig();if(null!=t.astNode){let e=[];for(let i in t.fields){let n=t.fields[i];null!=n.astNode&&e.push(n.astNode)}t.astNode={...t.astNode,kind:N.Kind.INTERFACE_TYPE_DEFINITION,fields:e}}return null!=t.extensionASTNodes&&(t.extensionASTNodes=t.extensionASTNodes.map(e=>({...e,kind:N.Kind.INTERFACE_TYPE_EXTENSION,fields:void 0}))),new A.GraphQLInterfaceType(t)}if((0,A.isInputObjectType)(e)){let t=e.toConfig();if(null!=t.astNode){let e=[];for(let i in t.fields){let n=t.fields[i];null!=n.astNode&&e.push(n.astNode)}t.astNode={...t.astNode,kind:N.Kind.INPUT_OBJECT_TYPE_DEFINITION,fields:e}}return null!=t.extensionASTNodes&&(t.extensionASTNodes=t.extensionASTNodes.map(e=>({...e,kind:N.Kind.INPUT_OBJECT_TYPE_EXTENSION,fields:void 0}))),new A.GraphQLInputObjectType(t)}{if(!(0,A.isEnumType)(e))return e;let t=e.toConfig();if(null!=t.astNode){let e=[];for(let i in t.values){let n=t.values[i];null!=n.astNode&&e.push(n.astNode)}t.astNode={...t.astNode,values:e}}return null!=t.extensionASTNodes&&(t.extensionASTNodes=t.extensionASTNodes.map(e=>({...e,values:void 0}))),new A.GraphQLEnumType(t)}}function e0(e,t){for(let i in t)e[i]=t[i]}function e1(e,t,i,n,r){if(!i.resolve){let i=`Resolver missing for "${n}.${r}".
|
|
32
|
+
"""`}(e):JSON.stringify(e)},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>"["+eo(e,", ")+"]"},ObjectValue:{leave:({fields:e})=>"{"+eo(e,", ")+"}"},ObjectField:{leave:({name:e,value:t})=>e+": "+t},Directive:{leave:({name:e,arguments:t})=>"@"+e+ed("(",eo(t,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({directives:e,operationTypes:t})=>eo(["schema",eo(e," "),ec(t)]," ")},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+": "+t},ScalarTypeDefinition:{leave:({name:e,directives:t})=>eo(["scalar",e,eo(t," ")]," ")},ObjectTypeDefinition:{leave:({name:e,interfaces:t,directives:i,fields:n})=>eo(["type",e,ed("implements ",eo(t," & ")),eo(i," "),ec(n)]," ")},FieldDefinition:{leave:({name:e,arguments:t,type:i,directives:n})=>e+(el(t)?ed("(\n",eu(eo(t,"\n")),"\n)"):ed("(",eo(t,", "),")"))+": "+i+ed(" ",eo(n," "))},InputValueDefinition:{leave:({name:e,type:t,defaultValue:i,directives:n})=>eo([e+": "+t,ed("= ",i),eo(n," ")]," ")},InterfaceTypeDefinition:{leave:({name:e,interfaces:t,directives:i,fields:n})=>eo(["interface",e,ed("implements ",eo(t," & ")),eo(i," "),ec(n)]," ")},UnionTypeDefinition:{leave:({name:e,directives:t,types:i})=>eo(["union",e,eo(t," "),ed("= ",eo(i," | "))]," ")},EnumTypeDefinition:{leave:({name:e,directives:t,values:i})=>eo(["enum",e,eo(t," "),ec(i)]," ")},EnumValueDefinition:{leave:({name:e,directives:t})=>eo([e,eo(t," ")]," ")},InputObjectTypeDefinition:{leave:({name:e,directives:t,fields:i})=>eo(["input",e,eo(t," "),ec(i)]," ")},DirectiveDefinition:{leave:({name:e,arguments:t,repeatable:i,locations:n})=>"directive @"+e+(el(t)?ed("(\n",eu(eo(t,"\n")),"\n)"):ed("(",eo(t,", "),")"))+(i?" repeatable":"")+" on "+eo(n," | ")},SchemaExtension:{leave:({directives:e,operationTypes:t})=>eo(["extend schema",eo(e," "),ec(t)]," ")},ScalarTypeExtension:{leave:({name:e,directives:t})=>eo(["extend scalar",e,eo(t," ")]," ")},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:i,fields:n})=>eo(["extend type",e,ed("implements ",eo(t," & ")),eo(i," "),ec(n)]," ")},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:i,fields:n})=>eo(["extend interface",e,ed("implements ",eo(t," & ")),eo(i," "),ec(n)]," ")},UnionTypeExtension:{leave:({name:e,directives:t,types:i})=>eo(["extend union",e,eo(t," "),ed("= ",eo(i," | "))]," ")},EnumTypeExtension:{leave:({name:e,directives:t,values:i})=>eo(["extend enum",e,eo(t," "),ec(i)]," ")},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:i})=>eo(["extend input",e,eo(t," "),ec(i)]," ")}},eh=Object.keys(ep).reduce((e,t)=>{var i;return{...e,[t]:{leave:(i=ep[t].leave,(e,t,n,r,a)=>{let s=[],o=r.reduce((e,t)=>(["fields","arguments","values"].includes(t)&&e.name&&s.push(e.name.value),e[t]),a[0]),l=[...s,o?.name?.value].filter(Boolean).join("."),u=[];return e.kind.includes("Definition")&&er[l]&&u.push(...er[l]),eo([...u.map(es),e.description,i(e,t,n,r,a)],"\n")})}}},{});function ef(e){let t=0;for(;t<e.length&&(" "===e[t]||" "===e[t]);)t++;return t}function em(e){return ef(e)===e.length}function ey(e){return e.as??e.url.name}function ev(e,t){var i,n;if(e.url.name&&t===`@${e.url.name}`){let t;return((t=ey(e))&&`@${t}`).substring(1)}let r=e.imports.find(e=>e.name===t),a=r?.as??r?.name??(i=ey(e),n=t,i?.length?n.startsWith("@")?`@${i}__${n.substring(1)}`:`${i}__${n}`:n);return a.startsWith("@")?a.substring(1):a}let eg=/v(\d{1,3})\.(\d{1,4})/i;function eT(e){let t=new URL(e),i=t.pathname.split("/").filter(Boolean),n=i[i.length-1];if(n){if(eg.test(n)){let e=i[i.length-2];return{identity:t.origin+(e?`/${i.slice(0,i.length-1).join("/")}`:""),name:e??null,version:n}}return{identity:`${t.origin}/${i.join("/")}`,name:n,version:null}}return{identity:t.origin,name:null,version:null}}function eS(e,t){return t.some(({value:t})=>t===e.value)}let eE=(e,t)=>{if(e.kind===t.kind)switch(e.kind){case N.Kind.LIST:return e.values.length===t.values.length&&e.values.every(e=>t.values.find(t=>eE(e,t)));case N.Kind.VARIABLE:case N.Kind.NULL:return!0;case N.Kind.OBJECT:return e.fields.length===t.fields.length&&e.fields.every(e=>t.fields.find(t=>e.name.value===t.name.value&&eE(e.value,t.value)));default:return e.value===t.value}return!1},eI=e=>"link"===e.name.value,eb=e=>{let t=eI(e)?e.arguments?.find(e=>"url"===e.name.value)?.value:void 0;return t?.kind==="StringValue"?t.value:void 0},eN=(e,t)=>!!(e.name.value===t.name.value&&(e.arguments===t.arguments||e.arguments?.length===t.arguments?.length&&e.arguments?.every(e=>t.arguments?.find(t=>e.name.value===t.name.value&&e.value.kind===t.value.kind&&eE(e.value,t.value)))));function e_(e=[],t=[],i,n){let r=i&&i.reverseDirectives,a=[];for(let o of[...r?e:t,...r?t:e]){var s;if(s=i?.repeatableLinkImports,n?.[o.name.value]?.repeatable??s?.has(o.name.value))a.find(e=>eN(o,e))||a.push(o);else{let e=a.findIndex(e=>e.name.value===o.name.value);if(-1===e)a.push(o);else{if(eI(o)&&eI(a[e])){let t=eb(o),i=eb(a[e]);if(t&&i&&t!==i){a.push(o);continue}}let t=function(e,t){let i=[];for(let n of[...t,...e]){let e=i.findIndex(e=>e.name.value===n.name.value);if(-1===e)i.push(n);else{let t=i[e];if("ListValue"===t.value.kind){let e=t.value.values,i=n.value.values;t.value={...t.value,values:eD(e,i,(e,t)=>{let i=e.value;return!i||!t.some(e=>e.value===i)})}}else t.value=n.value}}return i}(o.arguments??[],a[e].arguments??[]);a[e]={...a[e],arguments:0===t.length?void 0:t}}}}return a}function eD(e,t,i){return e.concat(t.filter(t=>i(t,e)))}var eA=e.i(439588);function eO(e){let t=e;for(;t.kind===N.Kind.LIST_TYPE||"NonNullType"===t.kind;)t=t.type;return t}function eR(e){return e.kind!==N.Kind.NAMED_TYPE}function ew(e){return e.kind===N.Kind.LIST_TYPE}function eL(e){return e.kind===N.Kind.NON_NULL_TYPE}function eC(e){return ew(e)?`[${eC(e.type)}]`:eL(e)?`${eC(e.type)}!`:e.name.value}function eF(e,t){return null==e&&null==t?o.A_EQUALS_B:null==e?o.A_SMALLER_THAN_B:null==t?o.A_GREATER_THAN_B:e<t?o.A_SMALLER_THAN_B:e>t?o.A_GREATER_THAN_B:o.A_EQUALS_B}function ek(e,t,i,n,r){let a=[];if(null!=i&&a.push(...i),null!=t)for(let i of t){let[t,s]=function(e,t){let i=e.findIndex(e=>e.name.value===t.name.value);return[i>-1?e[i]:null,i]}(a,i);if(t&&!n?.ignoreFieldConflicts){let o=n?.onFieldTypeConflict&&n.onFieldTypeConflict(t,i,e,n?.throwOnConflict)||function(e,t,i,n=!1){let r=eC(t.type),a=eC(i.type);if(r!==a){let s=eO(t.type),o=eO(i.type);if(s.name.value!==o.name.value)throw Error(`Field "${i.name.value}" already defined with a different type. Declared as "${s.name.value}", but you tried to override with "${o.name.value}"`);if(!function e(t,i,n=!1){return eR(t)||eR(i)?eL(i)?e(eL(t)?t.type:t,i.type):eL(t)?e(i,t,n):!!ew(t)&&(ew(i)&&e(t.type,i.type)||eL(i)&&e(t,i.type)):t.toString()===i.toString()}(t.type,i.type,!n))throw Error(`Field '${e.name.value}.${t.name.value}' changed type from '${r}' to '${a}'`)}return eL(i.type)&&!eL(t.type)&&(t.type=i.type),t}(e,t,i,n?.throwOnConflict);o.arguments=function(e,t,i){let n=function(e,t){return e.reduce((e,i)=>{let n=e.findIndex(e=>e.name.value===i.name.value);return -1===n?e.concat([i]):(t?.reverseArguments||(e[n]=i),e)},[])}([...t,...e].filter(g),i);return i&&i.sort&&n.sort(v),n}(i.arguments||[],t.arguments||[],n),o.directives=e_(i.directives,t.directives,n,r),o.description=i.description||t.description,a[s]=o}else a.push(i)}if(n&&n.sort&&a.sort(v),n&&n.exclusions){let t=n.exclusions;return a.filter(i=>!t.includes(`${e.name.value}.${i.name.value}`))}return a}function eP(e=[],t=[],i={}){let n=[...t,...e.filter(e=>!t.find(t=>t.name.value===e.name.value))];return i&&i.sort&&n.sort(v),n}(i=o||(o={}))[i.A_SMALLER_THAN_B=-1]="A_SMALLER_THAN_B",i[i.A_EQUALS_B=0]="A_EQUALS_B",i[i.A_GREATER_THAN_B=1]="A_GREATER_THAN_B";let ex={query:"Query",mutation:"Mutation",subscription:"Subscription"},eM="SCHEMA_DEF_SYMBOL";function eU(e,t,i={}){for(let l of e){var n,r,a,s,o;if("name"in l){let e=l.name?.value;if(t?.commentDescriptions&&function(e){let t=e.name?.value;if(null!=t)switch(ea(e,t),e.kind){case"EnumTypeDefinition":if(e.values)for(let i of e.values)ea(i,t,i.name.value);break;case"ObjectTypeDefinition":case"InputObjectTypeDefinition":case"InterfaceTypeDefinition":if(e.fields){for(let i of e.fields)if(ea(i,t,i.name.value),"FieldDefinition"===i.kind&&i.arguments)for(let e of i.arguments)ea(e,t,i.name.value,e.name.value)}}}(l),null==e)continue;if(t?.exclusions?.includes(e+".*")||t?.exclusions?.includes(e))delete i[e];else switch(l.kind){case N.Kind.OBJECT_TYPE_DEFINITION:case N.Kind.OBJECT_TYPE_EXTENSION:i[e]=function(e,t,i,n){if(t)try{return{name:e.name,description:e.description||t.description,kind:i?.convertExtensions||"ObjectTypeDefinition"===e.kind||"ObjectTypeDefinition"===t.kind?"ObjectTypeDefinition":"ObjectTypeExtension",loc:e.loc,fields:ek(e,e.fields,t.fields,i,n),directives:e_(e.directives,t.directives,i,n),interfaces:eP(e.interfaces,t.interfaces,i)}}catch(t){throw Error(`Unable to merge GraphQL type "${e.name.value}": ${t.message}`)}return i?.convertExtensions?{...e,kind:N.Kind.OBJECT_TYPE_DEFINITION}:e}(l,i[e],t,i);break;case N.Kind.ENUM_TYPE_DEFINITION:case N.Kind.ENUM_TYPE_EXTENSION:i[e]=(n=i[e],n?{name:l.name,description:l.description||n.description,kind:t?.convertExtensions||"EnumTypeDefinition"===l.kind||"EnumTypeDefinition"===n.kind?"EnumTypeDefinition":"EnumTypeExtension",loc:l.loc,directives:e_(l.directives,n.directives,t,i),values:function(e,t,i){if(i?.consistentEnumMerge){let i=[];e&&i.push(...e),e=t,t=i}let n=new Map;if(e)for(let t of e)n.set(t.name.value,t);if(t)for(let e of t){let t=e.name.value;if(n.has(t)){let i=n.get(t);i.description=e.description||i.description,i.directives=e_(e.directives,i.directives,void 0)}else n.set(t,e)}let r=[...n.values()];return i&&i.sort&&r.sort(v),r}(l.values,n.values,t)}:t?.convertExtensions?{...l,kind:N.Kind.ENUM_TYPE_DEFINITION}:l);break;case N.Kind.UNION_TYPE_DEFINITION:case N.Kind.UNION_TYPE_EXTENSION:i[e]=(r=i[e],r?{name:l.name,description:l.description||r.description,directives:e_(l.directives,r.directives,t,i),kind:t?.convertExtensions||"UnionTypeDefinition"===l.kind||"UnionTypeDefinition"===r.kind?N.Kind.UNION_TYPE_DEFINITION:N.Kind.UNION_TYPE_EXTENSION,loc:l.loc,types:eP(l.types,r.types,t)}:t?.convertExtensions?{...l,kind:N.Kind.UNION_TYPE_DEFINITION}:l);break;case N.Kind.SCALAR_TYPE_DEFINITION:case N.Kind.SCALAR_TYPE_EXTENSION:i[e]=(a=i[e],a?{name:l.name,description:l.description||a.description,kind:t?.convertExtensions||"ScalarTypeDefinition"===l.kind||"ScalarTypeDefinition"===a.kind?"ScalarTypeDefinition":"ScalarTypeExtension",loc:l.loc,directives:e_(l.directives,a.directives,t,i)}:t?.convertExtensions?{...l,kind:N.Kind.SCALAR_TYPE_DEFINITION}:l);break;case N.Kind.INPUT_OBJECT_TYPE_DEFINITION:case N.Kind.INPUT_OBJECT_TYPE_EXTENSION:i[e]=function(e,t,i,n){if(t)try{return{name:e.name,description:e.description||t.description,kind:i?.convertExtensions||"InputObjectTypeDefinition"===e.kind||"InputObjectTypeDefinition"===t.kind?"InputObjectTypeDefinition":"InputObjectTypeExtension",loc:e.loc,fields:ek(e,e.fields,t.fields,i),directives:e_(e.directives,t.directives,i,n)}}catch(t){throw Error(`Unable to merge GraphQL input type "${e.name.value}": ${t.message}`)}return i?.convertExtensions?{...e,kind:N.Kind.INPUT_OBJECT_TYPE_DEFINITION}:e}(l,i[e],t,i);break;case N.Kind.INTERFACE_TYPE_DEFINITION:case N.Kind.INTERFACE_TYPE_EXTENSION:i[e]=function(e,t,i,n){if(t)try{return{name:e.name,description:e.description||t.description,kind:i?.convertExtensions||"InterfaceTypeDefinition"===e.kind||"InterfaceTypeDefinition"===t.kind?"InterfaceTypeDefinition":"InterfaceTypeExtension",loc:e.loc,fields:ek(e,e.fields,t.fields,i,n),directives:e_(e.directives,t.directives,i,n),interfaces:e.interfaces?eP(e.interfaces,t.interfaces,i):void 0}}catch(t){throw Error(`Unable to merge GraphQL interface "${e.name.value}": ${t.message}`)}return i?.convertExtensions?{...e,kind:N.Kind.INTERFACE_TYPE_DEFINITION}:e}(l,i[e],t,i);break;case N.Kind.DIRECTIVE_DEFINITION:i[e]&&e in{}&&!(null!=(o=i[e])&&"object"==typeof o&&"kind"in o&&"string"==typeof o.kind)&&(i[e]=void 0),i[e]=function(e,t){return t?{...e,arguments:eD(t.arguments||[],e.arguments||[],(e,t)=>!eS(e.name,t.map(e=>e.name))),locations:[...t.locations,...e.locations.filter(e=>!eS(e,t.locations))]}:e}(l,i[e])}}else(l.kind===N.Kind.SCHEMA_DEFINITION||l.kind===N.Kind.SCHEMA_EXTENSION)&&(i[eM]=(s=i[eM],s?{kind:l.kind===N.Kind.SCHEMA_DEFINITION||s.kind===N.Kind.SCHEMA_DEFINITION?N.Kind.SCHEMA_DEFINITION:N.Kind.SCHEMA_EXTENSION,description:l.description||s.description,directives:e_(l.directives,s.directives,t,void 0),operationTypes:function(e=[],t=[]){let i=[];for(let n in ex){let r=e.find(e=>e.operation===n)||t.find(e=>e.operation===n);r&&i.push(r)}return i}(l.operationTypes,s.operationTypes)}:t?.convertExtensions?{...l,kind:N.Kind.SCHEMA_DEFINITION}:l))}return i}function e$(e,t){let i;er={};let n={kind:N.Kind.DOCUMENT,definitions:function(e,t){er={};let{allDirectives:i,allNodes:n,repeatableLinkImports:r}=function e(t,i,n=[],r=[],a=new Set,s=new Set){let o=e=>{s.add(e)};if(t&&!a.has(t))if(a.add(t),"function"==typeof t)e(t(),i,n,r,a,s);else if(Array.isArray(t))for(let o of t)e(o,i,n,r,a,s);else if((0,f.isSchema)(t))e(function(e,t={}){let i=t.pathToDirectivesInExtensions,n=e.getTypeMap(),r=function(e,t){let i=new Map([["query",void 0],["mutation",void 0],["subscription",void 0]]),n=[];if(null!=e.astNode&&n.push(e.astNode),null!=e.extensionASTNodes)for(let t of e.extensionASTNodes)n.push(t);for(let e of n)if(e.operationTypes)for(let t of e.operationTypes)i.set(t.operation,t);let r=Y(e);for(let[e,t]of i){let n=r.get(e);if(null!=n){let r=F(n);null!=t?t.type=r:i.set(e,{kind:N.Kind.OPERATION_TYPE_DEFINITION,operation:e,type:r})}}let a=[...i.values()].filter(g),s=z(e,e,t);if(!a.length&&!s.length)return null;let o={kind:a.length?N.Kind.SCHEMA_DEFINITION:N.Kind.SCHEMA_EXTENSION,operationTypes:a,directives:s},l=j(e);return l&&(o.description=l),o}(e,i),a=null!=r?[r]:[];for(let t of e.getDirectives())(0,D.isSpecifiedDirective)(t)||a.push(function(e,t,i){return{kind:N.Kind.DIRECTIVE_DEFINITION,description:j(e),name:{kind:N.Kind.NAME,value:e.name},arguments:e.args?.map(e=>X(e,t,i)),repeatable:e.isRepeatable,locations:e.locations?.map(e=>({kind:N.Kind.NAME,value:e}))||[]}}(t,e,i));for(let t in n){let r=n[t],u=(0,R.isSpecifiedScalarType)(r),c=(0,O.isIntrospectionType)(r);if(!u&&!c)if((0,A.isObjectType)(r))a.push(function(e,t,i){return{kind:N.Kind.OBJECT_TYPE_DEFINITION,description:j(e),name:{kind:N.Kind.NAME,value:e.name},fields:Object.values(e.getFields()).map(e=>Z(e,t,i)),interfaces:Object.values(e.getInterfaces()).map(e=>F(e)),directives:z(e,t,i)}}(r,e,i));else if((0,A.isInterfaceType)(r))a.push(function(e,t,i){let n={kind:N.Kind.INTERFACE_TYPE_DEFINITION,description:j(e),name:{kind:N.Kind.NAME,value:e.name},fields:Object.values(e.getFields()).map(e=>Z(e,t,i)),directives:z(e,t,i)};return"getInterfaces"in e&&(n.interfaces=Object.values(e.getInterfaces()).map(e=>F(e))),n}(r,e,i));else if((0,A.isUnionType)(r)){var s,o,l;a.push((s=r,o=e,l=i,{kind:N.Kind.UNION_TYPE_DEFINITION,description:j(s),name:{kind:N.Kind.NAME,value:s.name},directives:z(s,o,l),types:s.getTypes().map(e=>F(e))}))}else if((0,A.isInputObjectType)(r))a.push(function(e,t,i){return{kind:N.Kind.INPUT_OBJECT_TYPE_DEFINITION,description:j(e),name:{kind:N.Kind.NAME,value:e.name},fields:Object.values(e.getFields()).map(e=>{var n,r,a;return n=e,r=t,a=i,{kind:N.Kind.INPUT_VALUE_DEFINITION,description:j(n),name:{kind:N.Kind.NAME,value:n.name},type:F(n.type),directives:z(n,r,a),defaultValue:$(n)}}),directives:z(e,t,i)}}(r,e,i));else if((0,A.isEnumType)(r))a.push(function(e,t,i){return{kind:N.Kind.ENUM_TYPE_DEFINITION,description:j(e),name:{kind:N.Kind.NAME,value:e.name},values:Object.values(e.getValues()).map(e=>{var n,r,a;return n=e,r=t,a=i,{kind:N.Kind.ENUM_VALUE_DEFINITION,description:j(n),name:{kind:N.Kind.NAME,value:n.name},directives:z(n,r,a)}}),directives:z(e,t,i)}}(r,e,i));else if((0,A.isScalarType)(r))a.push(function(e,t,i){let n=et(t,H(e,i)),r=e.specifiedByUrl||e.specifiedByURL;return r&&!n.some(e=>"specifiedBy"===e.name.value)&&n.push(ee("specifiedBy",{url:r})),{kind:N.Kind.SCALAR_TYPE_DEFINITION,description:j(e),name:{kind:N.Kind.NAME,value:e.name},directives:n}}(r,e,i));else throw Error(`Unknown type ${r}.`)}return{kind:N.Kind.DOCUMENT,definitions:a}}(t,i).definitions,i,n,r,a,s);else if("string"==typeof t||t instanceof eA.Source)e((0,_.parse)(t,i).definitions,i,n,r,a,s);else if("object"==typeof t&&(0,b.isDefinitionNode)(t)){let e=function(e){let t=[];for(let i of e.definitions)if(i.kind===N.Kind.SCHEMA_EXTENSION||i.kind===N.Kind.SCHEMA_DEFINITION){let e=i.directives?.filter(e=>"link"===e.name.value),n=e?.map(e=>(function(e){let t,i,n=[];for(let a of e)switch(a.name.value){case"url":a.value.kind===N.Kind.STRING&&(t=eT(a.value.value));break;case"import":var r;n=(r=a.value).kind===N.Kind.LIST?r.values.map(e=>{let t;if(e.kind===N.Kind.STRING)t={name:e.value};else if(e.kind===N.Kind.OBJECT){let i,n="";for(let t of e.fields)"name"===t.name.value?t.value.kind===N.Kind.STRING&&(n=t.value.value):"as"===t.name.value&&t.value.kind===N.Kind.STRING&&(i=t.value.value);t={name:n,as:i}}return t}).filter(e=>void 0!==e):[];break;case"as":a.value.kind===N.Kind.STRING&&(i=a.value.value??void 0)}if(void 0!==t)return{url:t,as:i,imports:n}})(e.arguments??[])).filter(e=>void 0!==e)??[];t=t.concat(n);let r=i.directives?.filter(({name:e})=>"core"===e.value),a=r?.map(e=>(function(e){let t=e.find(({name:e,value:t})=>"feature"===e.value&&t.kind===N.Kind.STRING);if(t)return{url:eT(t.value.value),imports:[]}})(e.arguments??[])).filter(e=>void 0!==e);a&&(t=t.concat(...a))}return t}({definitions:[t],kind:N.Kind.DOCUMENT}),i=e.find(e=>"https://specs.apollo.dev/federation"===e.url.identity);i&&(o(ev(i,"@composeDirective")),o(ev(i,"@key")));let a=e.find(e=>"https://specs.apollo.dev/link"===e.url.identity);a&&o(ev(a,"@link")),t.kind===N.Kind.DIRECTIVE_DEFINITION?n.push(t):r.push(t)}else if(t&&"object"==typeof t&&"kind"in t&&t.kind===N.Kind.DOCUMENT)e(t.definitions,i,n,r,a,s);else throw Error(`typeDefs must contain only strings, documents, schemas, or functions, got ${typeof t}`);return{allDirectives:n,allNodes:r,repeatableLinkImports:s}}(e,t),a=eU(i,t);t.repeatableLinkImports=r;let s=eU(n,t,a);if(t?.useSchemaDefinition){let e=s[eM]||{kind:N.Kind.SCHEMA_DEFINITION,operationTypes:[]},t=e.operationTypes||[];for(let e in ex)if(!t.find(t=>t.operation===e)){let i=s[ex[e]];null!=i&&null!=i.name&&t.push({kind:N.Kind.OPERATION_TYPE_DEFINITION,type:{kind:N.Kind.NAMED_TYPE,name:i.name},operation:e})}e?.operationTypes?.length!=null&&e.operationTypes.length>0&&(s[eM]=e)}t?.forceSchemaDefinition&&!s[eM]?.operationTypes?.length&&(s[eM]={kind:N.Kind.SCHEMA_DEFINITION,operationTypes:[{kind:N.Kind.OPERATION_TYPE_DEFINITION,operation:"query",type:{kind:N.Kind.NAMED_TYPE,name:{kind:N.Kind.NAME,value:"Query"}}}]});let o=Object.values(s);if(t?.sort){let e="function"==typeof t.sort?t.sort:eF;o.sort((t,i)=>e(t.name?.value,i.name?.value))}return o}(e,{useSchemaDefinition:!0,forceSchemaDefinition:!1,throwOnConflict:!1,commentDescriptions:!1,...t})};if(t?.commentDescriptions)i=(0,en.visit)(n,eh);else i=n;return er={},i}function ej(e,t){let i=e.getTypeMap();for(let e in i){let n=i[e];if(!(0,A.getNamedType)(n).name.startsWith("__")){if((0,A.isObjectType)(n)){let e=n.getFields();for(let i in e)for(let n of e[i].args)n.defaultValue=t(n.type,n.defaultValue)}else if((0,A.isInputObjectType)(n)){let e=n.getFields();for(let i in e){let n=e[i];n.defaultValue=t(n.type,n.defaultValue)}}}}}function eV(e,t){let i=e.getTypeMap();for(let e in i){let n=i[e];if(!(0,A.getNamedType)(n).name.startsWith("__")&&(0,A.isObjectType)(n)){let i=n.getFields();for(let n in i)t(i[n],e,n)}}}function eG(e,t){if(t){let i=e[t.name];if((0,A.isObjectType)(i))return i}}function eB(e,t,i=null,n=null){if(null==t)return t;let r=(0,A.getNullableType)(e);if((0,A.isLeafType)(r))return null!=i?i(r,t):t;if((0,A.isListType)(r))return m(t).map(e=>eB(r.ofType,e,i,n));if((0,A.isInputObjectType)(r)){let e=r.getFields(),a={};for(let r in t){let s=e[r];null!=s&&(a[r]=eB(s.type,t[r],i,n))}return null!=n?n(r,a):a}}function eK(e,t){return eB(e,t,(e,t)=>{try{return e.serialize(t)}catch{return t}})}function eQ(e,t){return eB(e,t,(e,t)=>{try{return e.parseValue(t)}catch{return t}})}function eq(e,t={}){var i,n;let r,a,s=eX(ez(eH(eW((i=eH(eW(e.getTypeMap(),e,eK),e,t,e=>(0,A.isLeafType)(e)),n=e,(a=null!=(r=t[l.ENUM_VALUE])?r:null)?eH(i,n,{[l.ENUM_TYPE]:e=>{let t=e.toConfig(),i=t.values,r={};for(let t in i){let s=i[t],o=a(s,e.name,n,t);if(void 0===o)r[t]=s;else if(Array.isArray(o)){let[e,t]=o;r[e]=void 0===t?s:t}else null!==o&&(r[t]=o)}return eZ(new A.GraphQLEnumType({...t,values:r}))}},e=>(0,A.isEnumType)(e)):i),e,eQ),e,t,e=>!(0,A.isLeafType)(e)),e,t),e,t),{typeMap:o,directives:u}=function(e,t){let i=Object.create(null);for(let t in e)i[t]=e[t];let n=Object.create(null);for(let e in i){let t=i[e];if(null==t||e.startsWith("__"))continue;let r=t.name;if(!r.startsWith("__")){if(null!=n[r]){console.warn(`Duplicate schema type name ${r} found; keeping the existing one found in the schema`);continue}n[r]=t}}for(let e in n)n[e]=a(n[e]);return{typeMap:n,directives:t.map(e=>(function(e){if((0,D.isSpecifiedDirective)(e))return e;let t=e.toConfig();return t.args=r(t.args),new D.GraphQLDirective(t)})(e))};function r(e){let t={};for(let i in e){let n=e[i],r=l(n.type);null!=r&&(n.type=r,t[i]=n)}return t}function a(e){if((0,A.isObjectType)(e)){let t=e.toConfig(),i={...t,fields:()=>s(t.fields),interfaces:()=>o(t.interfaces)};return new A.GraphQLObjectType(i)}if((0,A.isInterfaceType)(e)){let t=e.toConfig(),i={...t,fields:()=>s(t.fields)};return"interfaces"in i&&(i.interfaces=()=>o(t.interfaces)),new A.GraphQLInterfaceType(i)}if((0,A.isUnionType)(e)){let t=e.toConfig(),i={...t,types:()=>o(t.types)};return new A.GraphQLUnionType(i)}if((0,A.isInputObjectType)(e)){let t=e.toConfig(),i={...t,fields:()=>(function(e){let t={};for(let i in e){let n=e[i],r=l(n.type);null!=r&&(n.type=r,t[i]=n)}return t})(t.fields)};return new A.GraphQLInputObjectType(i)}if((0,A.isEnumType)(e)){let t=e.toConfig();return new A.GraphQLEnumType(t)}else if((0,A.isScalarType)(e)){if((0,R.isSpecifiedScalarType)(e))return e;let t=e.toConfig();return new A.GraphQLScalarType(t)}throw Error(`Unexpected schema type: ${e}`)}function s(e){let t={};for(let i in e){let n=e[i],a=l(n.type);null!=a&&n.args&&(n.type=a,n.args=r(n.args),t[i]=n)}return t}function o(e){let t=[];for(let i of e){let e=l(i);null!=e&&t.push(e)}return t}function l(e){if((0,A.isListType)(e)){let t=l(e.ofType);return null!=t?new A.GraphQLList(t):null}if((0,A.isNonNullType)(e)){let t=l(e.ofType);return null!=t?new A.GraphQLNonNull(t):null}if((0,A.isNamedType)(e)){let t=i[e.name];return void 0===t&&(n[(t=!function(e){if("getFields"in e){let t=e.getFields();for(let e in t)return"_fake"===t[e].name}return!1}(e)?a(e):function(e){switch(e.name){case R.GraphQLInt.name:return R.GraphQLInt;case R.GraphQLFloat.name:return R.GraphQLFloat;case R.GraphQLString.name:return R.GraphQLString;case R.GraphQLBoolean.name:return R.GraphQLBoolean;case R.GraphQLID.name:return R.GraphQLID;default:return e}}(e)).name]=i[e.name]=t),null!=t?n[t.name]:null}return null}}(s,function(e,t,i){let n,r=null!=(n=i[l.DIRECTIVE])?n:null;if(null==r)return e.slice();let a=[];for(let i of e){let e=r(i,t);void 0===e?a.push(i):null!==e&&a.push(e)}return a}(e.getDirectives(),e,t));return new f.GraphQLSchema({...e.toConfig(),query:eG(o,eG(s,e.getQueryType())),mutation:eG(o,eG(s,e.getMutationType())),subscription:eG(o,eG(s,e.getSubscriptionType())),types:Object.values(o),directives:u})}(n=l||(l={})).TYPE="MapperKind.TYPE",n.SCALAR_TYPE="MapperKind.SCALAR_TYPE",n.ENUM_TYPE="MapperKind.ENUM_TYPE",n.COMPOSITE_TYPE="MapperKind.COMPOSITE_TYPE",n.OBJECT_TYPE="MapperKind.OBJECT_TYPE",n.INPUT_OBJECT_TYPE="MapperKind.INPUT_OBJECT_TYPE",n.ABSTRACT_TYPE="MapperKind.ABSTRACT_TYPE",n.UNION_TYPE="MapperKind.UNION_TYPE",n.INTERFACE_TYPE="MapperKind.INTERFACE_TYPE",n.ROOT_OBJECT="MapperKind.ROOT_OBJECT",n.QUERY="MapperKind.QUERY",n.MUTATION="MapperKind.MUTATION",n.SUBSCRIPTION="MapperKind.SUBSCRIPTION",n.DIRECTIVE="MapperKind.DIRECTIVE",n.FIELD="MapperKind.FIELD",n.COMPOSITE_FIELD="MapperKind.COMPOSITE_FIELD",n.OBJECT_FIELD="MapperKind.OBJECT_FIELD",n.ROOT_FIELD="MapperKind.ROOT_FIELD",n.QUERY_ROOT_FIELD="MapperKind.QUERY_ROOT_FIELD",n.MUTATION_ROOT_FIELD="MapperKind.MUTATION_ROOT_FIELD",n.SUBSCRIPTION_ROOT_FIELD="MapperKind.SUBSCRIPTION_ROOT_FIELD",n.INTERFACE_FIELD="MapperKind.INTERFACE_FIELD",n.INPUT_OBJECT_FIELD="MapperKind.INPUT_OBJECT_FIELD",n.ARGUMENT="MapperKind.ARGUMENT",n.ENUM_VALUE="MapperKind.ENUM_VALUE";let eJ=["String","ID","Int","Float","Boolean"];function eH(e,t,i,n=()=>!0){let r={};for(let a in e)if(!a.startsWith("__")&&!eJ.includes(a)){let s=e[a];if(null==s||!n(s)){r[a]=s;continue}let o=function(e,t,i){let n,r,a,s=[...(r=e.getType(i),a=[l.TYPE],(0,A.isObjectType)(r)?(a.push(l.COMPOSITE_TYPE,l.OBJECT_TYPE),i===e.getQueryType()?.name?a.push(l.ROOT_OBJECT,l.QUERY):i===e.getMutationType()?.name?a.push(l.ROOT_OBJECT,l.MUTATION):i===e.getSubscriptionType()?.name&&a.push(l.ROOT_OBJECT,l.SUBSCRIPTION)):(0,A.isInputObjectType)(r)?a.push(l.INPUT_OBJECT_TYPE):(0,A.isInterfaceType)(r)?a.push(l.COMPOSITE_TYPE,l.ABSTRACT_TYPE,l.INTERFACE_TYPE):(0,A.isUnionType)(r)?a.push(l.COMPOSITE_TYPE,l.ABSTRACT_TYPE,l.UNION_TYPE):(0,A.isEnumType)(r)?a.push(l.ENUM_TYPE):(0,A.isScalarType)(r)&&a.push(l.SCALAR_TYPE),a)];for(;!n&&s.length>0;)n=t[s.pop()];return null!=n?n:null}(t,i,a);if(null==o){r[a]=s;continue}let u=o(s,t);if(void 0===u){r[a]=s;continue}r[a]=u}return r}function eW(e,t,i){let n=eX(e,t,{[l.ARGUMENT]:t=>{if(void 0===t.defaultValue)return t;let n=eY(e,t.type);if(null!=n)return{...t,defaultValue:i(n,t.defaultValue)}}});return ez(n,t,{[l.INPUT_OBJECT_FIELD]:e=>{if(void 0===e.defaultValue)return e;let t=eY(n,e.type);if(null!=t)return{...e,defaultValue:i(t,e.defaultValue)}}})}function eY(e,t){if((0,A.isListType)(t)){let i=eY(e,t.ofType);return null!=i?new A.GraphQLList(i):null}if((0,A.isNonNullType)(t)){let i=eY(e,t.ofType);return null!=i?new A.GraphQLNonNull(i):null}if((0,A.isNamedType)(t)){let i=e[t.name];return null!=i?i:null}return null}function ez(e,t,i){let n={};for(let r in e)if(!r.startsWith("__")){let a=e[r];if(!(0,A.isObjectType)(a)&&!(0,A.isInterfaceType)(a)&&!(0,A.isInputObjectType)(a)){n[r]=a;continue}let s=function(e,t,i){let n,r,a,s=[...(r=e.getType(i),a=[l.FIELD],(0,A.isObjectType)(r)?(a.push(l.COMPOSITE_FIELD,l.OBJECT_FIELD),i===e.getQueryType()?.name?a.push(l.ROOT_FIELD,l.QUERY_ROOT_FIELD):i===e.getMutationType()?.name?a.push(l.ROOT_FIELD,l.MUTATION_ROOT_FIELD):i===e.getSubscriptionType()?.name&&a.push(l.ROOT_FIELD,l.SUBSCRIPTION_ROOT_FIELD)):(0,A.isInterfaceType)(r)?a.push(l.COMPOSITE_FIELD,l.INTERFACE_FIELD):(0,A.isInputObjectType)(r)&&a.push(l.INPUT_OBJECT_FIELD),a)];for(;!n&&s.length>0;)n=t[s.pop()];return n??null}(t,i,r);if(null==s){n[r]=a;continue}let o=a.toConfig(),u=o.fields,c={};for(let e in u){let i=u[e],n=s(i,e,r,t);if(void 0===n)c[e]=i;else if(Array.isArray(n)){let[e,t]=n;null!=t.astNode&&(t.astNode={...t.astNode,name:{...t.astNode.name,value:e}}),c[e]=void 0===t?i:t}else null!==n&&(c[e]=n)}(0,A.isObjectType)(a)?n[r]=eZ(new A.GraphQLObjectType({...o,fields:c})):(0,A.isInterfaceType)(a)?n[r]=eZ(new A.GraphQLInterfaceType({...o,fields:c})):n[r]=eZ(new A.GraphQLInputObjectType({...o,fields:c}))}return n}function eX(e,t,i){let n={};for(let r in e)if(!r.startsWith("__")){let a=e[r];if(!(0,A.isObjectType)(a)&&!(0,A.isInterfaceType)(a)){n[r]=a;continue}let s=function(e){let t=e[l.ARGUMENT];return null!=t?t:null}(i);if(null==s){n[r]=a;continue}let o=a.toConfig(),u=o.fields,c={};for(let e in u){let i=u[e],n=i.args;if(null==n){c[e]=i;continue}let a=Object.keys(n);if(!a.length){c[e]=i;continue}let o={};for(let i of a){let a=n[i],l=s(a,e,r,t);if(void 0===l)o[i]=a;else if(Array.isArray(l)){let[e,t]=l;o[e]=t}else null!==l&&(o[i]=l)}c[e]={...i,args:o}}(0,A.isObjectType)(a)?n[r]=new A.GraphQLObjectType({...o,fields:c}):(0,A.isInterfaceType)(a)?n[r]=new A.GraphQLInterfaceType({...o,fields:c}):n[r]=new A.GraphQLInputObjectType({...o,fields:c})}return n}function eZ(e){if((0,A.isObjectType)(e)){let t=e.toConfig();if(null!=t.astNode){let e=[];for(let i in t.fields){let n=t.fields[i];null!=n.astNode&&e.push(n.astNode)}t.astNode={...t.astNode,kind:N.Kind.OBJECT_TYPE_DEFINITION,fields:e}}return null!=t.extensionASTNodes&&(t.extensionASTNodes=t.extensionASTNodes.map(e=>({...e,kind:N.Kind.OBJECT_TYPE_EXTENSION,fields:void 0}))),new A.GraphQLObjectType(t)}if((0,A.isInterfaceType)(e)){let t=e.toConfig();if(null!=t.astNode){let e=[];for(let i in t.fields){let n=t.fields[i];null!=n.astNode&&e.push(n.astNode)}t.astNode={...t.astNode,kind:N.Kind.INTERFACE_TYPE_DEFINITION,fields:e}}return null!=t.extensionASTNodes&&(t.extensionASTNodes=t.extensionASTNodes.map(e=>({...e,kind:N.Kind.INTERFACE_TYPE_EXTENSION,fields:void 0}))),new A.GraphQLInterfaceType(t)}if((0,A.isInputObjectType)(e)){let t=e.toConfig();if(null!=t.astNode){let e=[];for(let i in t.fields){let n=t.fields[i];null!=n.astNode&&e.push(n.astNode)}t.astNode={...t.astNode,kind:N.Kind.INPUT_OBJECT_TYPE_DEFINITION,fields:e}}return null!=t.extensionASTNodes&&(t.extensionASTNodes=t.extensionASTNodes.map(e=>({...e,kind:N.Kind.INPUT_OBJECT_TYPE_EXTENSION,fields:void 0}))),new A.GraphQLInputObjectType(t)}{if(!(0,A.isEnumType)(e))return e;let t=e.toConfig();if(null!=t.astNode){let e=[];for(let i in t.values){let n=t.values[i];null!=n.astNode&&e.push(n.astNode)}t.astNode={...t.astNode,values:e}}return null!=t.extensionASTNodes&&(t.extensionASTNodes=t.extensionASTNodes.map(e=>({...e,values:void 0}))),new A.GraphQLEnumType(t)}}function e0(e,t){for(let i in t)e[i]=t[i]}function e1(e,t,i,n,r){if(!i.resolve){let i=`Resolver missing for "${n}.${r}".
|
|
33
33
|
To disable this validator, use:
|
|
34
34
|
resolverValidationOptions: {
|
|
35
35
|
${e}: 'ignore'
|
|
@@ -43,7 +43,7 @@ ${JSON.stringify(e)}\r
|
|
|
43
43
|
\r
|
|
44
44
|
${JSON.stringify(i)}\r
|
|
45
45
|
---${i.hasNext?"":"--"}\r
|
|
46
|
-
`}function tg(e){return JSON.stringify(e)+"\n"}function tT(e){return{status:e,headers:new te}}function tS(e,t){if(t.status&&(e.status=t.status),t.headers)for(let[i,n]of t.headers)e.headers.set(i,n)}function tE(e,t={}){let i=t.formatError??(e=>e),n=tT();return{httpFromErrors:n,formattedErrors:e.map(e=>{try{return i(r(e),e)}catch(e){if(t.includeStacktraceInErrorResponses)return r(e);return{message:"Internal server error",extensions:{code:u.INTERNAL_SERVER_ERROR}}}})};function r(e){var i;let r=tb(e),a={...r.extensions,code:r.extensions.code??u.INTERNAL_SERVER_ERROR};return(i=a.http)&&"object"==typeof i&&(!("status"in i)||"number"==typeof i.status)&&(!("headers"in i)||i.headers instanceof Map)&&(tS(n,{headers:new te,...a.http}),delete a.http),t.includeStacktraceInErrorResponses&&(a.stacktrace=r.stack?.split("\n")),{...r.toJSON(),extensions:a}}}function tI(e){return e instanceof Error?e:new B.GraphQLError("Unexpected error value: "+String(e))}function tb(e,t=""){let i=tI(e);return i instanceof B.GraphQLError?i:new B.GraphQLError(t+i.message,{originalError:i})}async function tN({server:e,batchRequest:t,body:i,contextValue:n,schemaDerivedData:r,internals:a}){if(0===i.length)throw new tu("No operations found in request.");let s=tT(),o=await Promise.all(i.map(async i=>{let o={...t,body:i},l=await ty({server:e,httpRequest:o,contextValue:n,schemaDerivedData:r,internals:a,sharedResponseHTTPGraphQLHead:s});if("chunked"===l.body.kind)throw Error("Incremental delivery is not implemented for batch requests");return l.body.string}));return{...s,body:{kind:"complete",string:`[${o.join(",")}]`}}}async function t_(e,t,i,n,r){if(!("POST"===t.method&&Array.isArray(t.body)))return await ty({server:e,httpRequest:t,contextValue:i,schemaDerivedData:n,internals:r,sharedResponseHTTPGraphQLHead:null});if(r.allowBatchedHttpRequests)return await tN({server:e,batchRequest:t,body:t.body,contextValue:i,schemaDerivedData:n,internals:r});throw new tu("Operation batching disabled.")}var tD=e.i(162984);let tA=["x-apollo-operation-name","apollo-require-preflight"],tO=["application/x-www-form-urlencoded","multipart/form-data","text/plain"];var tR=e.i(487584),tw=e.i(21972),tL=e.i(509083),tC=e.i(139024);let tF=Symbol("apolloServerExecutionDispatcherWillResolveField"),tk=Symbol("apolloServerUserFieldResolver"),tP=Symbol("apolloServerPluginsEnabled");function tx(e){return e&&"function"==typeof e.then}function tM(e){return null!=e}async function tU(e,t){let i=(await Promise.all(e.map(e=>t(e)))).filter(tM);return i.reverse(),async(...e)=>{for(let t of i)t(...e)}}async function t$(e,t){for(let i of e){let e=await t(i);if(null!=e)return e}return null}class tj{map;constructor(e){this.map=e}append(e,t){this.map.has(e)?this.map.set(e,this.map.get(e)+", "+t):this.map.set(e,t)}delete(e){this.map.delete(e)}get(e){return this.map.get(e)??null}has(e){return this.map.has(e)}set(e,t){this.map.set(e,t)}entries(){return this.map.entries()}keys(){return this.map.keys()}values(){return this.map.values()}[Symbol.iterator](){return this.map.entries()}}async function tV(){if(void 0!==t)return;let i=await e.A(899105);t="17.0.0-alpha.9"===i.version&&"experimentalExecuteIncrementally"in i?i.experimentalExecuteIncrementally:null}async function tG({useLegacyIncremental:e,legacyExperimentalExecuteIncrementally:i,...n}){if(await tV(),e){if(i)return i(n);if(t)throw new tu(`Apollo Server received an operation that uses incremental delivery (@defer or @stream) with the legacy incremental format, but the server does not support the legacy incremental delivery format. Add the HTTP header: 'Accept: ${t1.MULTIPART_MIXED_EXPERIMENTAL_ALPHA_9}' to use the current incremental delivery format`,{extensions:{http:{status:406}}})}return t?t(n):(0,tC.execute)(n)}function tB(e){return(0,e8.createHash)("sha256").update(e).digest("hex")}async function tK(e,t,i,n){let r,a=(await Promise.all(i.plugins.map(e=>e.requestDidStart?.(n)))).filter(tM),s=n.request,{query:o,extensions:l}=s;if(n.metrics.persistedQueryHit=!1,n.metrics.persistedQueryRegister=!1,l?.persistedQuery){if(!i.persistedQueries)return await v([new ts]);if(1!==l.persistedQuery.version)return await v([new B.GraphQLError("Unsupported persisted query version",{extensions:{http:tT(400)}})]);if(r=l.persistedQuery.sha256Hash,void 0===o){if(!(o=await i.persistedQueries.cache.get(r)))return await v([new ta]);n.metrics.persistedQueryHit=!0}else{if(r!==tB(o))return await v([new B.GraphQLError("provided sha does not match query",{extensions:{http:tT(400)}})]);n.metrics.persistedQueryRegister=!0}}else{if(!o)return await v([new tu("GraphQL operations must contain a non-empty `query` or a `persistedQuery` extension.")]);r=tB(o)}if(n.queryHash=r,n.source=o,await Promise.all(a.map(e=>e.didResolveSource?.(n))),e.documentStore)try{n.document=await e.documentStore.get(e.documentStoreKeyPrefix+r)}catch(e){t.logger.warn("An error occurred while attempting to read from the documentStore. "+tI(e).message)}if(!n.document){let s=await tU(a,async e=>e.parsingDidStart?.(n));try{n.document=(0,_.parse)(o,i.parseOptions)}catch(t){let e=tI(t);return await s(e),await v([new ti(tb(e))])}if(await s(),!0!==i.dangerouslyDisableValidation){let t=await tU(a,async e=>e.validationDidStart?.(n)),r=(0,tL.validate)(e.schema,n.document,[...tR.specifiedRules,...i.validationRules],i.validationOptions);if(0===r.length&&i.laterValidationRules&&(r=(0,tL.validate)(e.schema,n.document,i.laterValidationRules)),0!==r.length)return await t(r),await v(r.map(e=>new tn(e)));await t()}e.documentStore&&Promise.resolve(e.documentStore.set(e.documentStoreKeyPrefix+r,n.document)).catch(e=>t.logger.warn("Could not store validated document. "+e?.message))}let u=(0,tw.getOperationAST)(n.document,s.operationName);if(n.operation=u||void 0,n.operationName=u?.name?.value||null,s.http?.method==="GET"&&u?.operation&&"query"!==u.operation)return await v([new tu(`GET requests only support query operations, not ${u.operation} operations`,{extensions:{http:{status:405,headers:new te([["allow","POST"]])}}})]);try{await Promise.all(a.map(e=>e.didResolveOperation?.(n)))}catch(e){return await v([tb(e)])}if(n.metrics.persistedQueryRegister&&i.persistedQueries){let e=i.persistedQueries?.ttl;Promise.resolve(i.persistedQueries.cache.set(r,o,void 0!==e?{ttl:i.persistedQueries?.ttl}:void 0)).catch(t.logger.warn.bind(t.logger))}let c=await t$(a,async e=>await e.responseForOperation?.(n));if(null!==c)n.response.body=c.body,tS(n.response.http,c.http);else{let t=(await Promise.all(a.map(e=>e.executionDidStart?.(n)))).filter(tM);if(t.reverse(),t.some(e=>e.willResolveField)){var d;Object.defineProperty(n.contextValue,tF,{value:(...e)=>{var i;let n;return i=t=>t.willResolveField?.(...e),(n=t.map(e=>i(e)).filter(tM)).reverse(),(...e)=>{for(let t of n)t(...e)}}}),i.fieldResolver&&Object.defineProperty(n.contextValue,tk,{value:i.fieldResolver}),(d=e.schema)[tP]||(Object.defineProperty(d,tP,{value:!0}),Object.values(d.getTypeMap()).forEach(e=>{!(0,A.getNamedType)(e).name.startsWith("__")&&e instanceof A.GraphQLObjectType&&Object.values(e.getFields()).forEach(e=>{var t;let i;i=(t=e).resolve,t.resolve=(e,t,n,r)=>{let a=n?.[tF],s=n?.[tk],o="function"==typeof a&&a({source:e,args:t,contextValue:n,info:r}),l=i||s||tC.defaultFieldResolver;try{let i=l(e,t,n,r);return"function"==typeof o&&function e(t,i){tx(t)?t.then(t=>e(t,i),e=>i(e)):Array.isArray(t)&&t.some(tx)?Promise.all(t).then(e=>i(null,e),e=>i(e)):i(null,t)}(i,o),i}catch(e){throw"function"==typeof o&&o(e),e}}})}))}try{let e=await p({...n,useLegacyIncremental:new e6.default({headers:{accept:s.http?.headers.get("accept")}}).mediaType([t1.MULTIPART_MIXED_EXPERIMENTAL_ALPHA_9,t1.MULTIPART_MIXED_EXPERIMENTAL_ALPHA_2])===t1.MULTIPART_MIXED_EXPERIMENTAL_ALPHA_2}),t="singleResult"in e?e.singleResult:e.initialResult;if(!n.operation){if(!t.errors?.length)throw Error("Unexpected error: Apollo Server did not resolve an operation but execute did not return errors");throw new tl(t.errors[0])}let r=t.errors?.map(e=>e.nodes?.length===1&&e.nodes[0].kind===N.Kind.VARIABLE_DEFINITION&&(e.message.startsWith(`Variable "$${e.nodes[0].variable.name.value}" has invalid value`)||e.message.startsWith(`Variable "$${e.nodes[0].variable.name.value}" got invalid value `)||e.message.startsWith(`Variable "$${e.nodes[0].variable.name.value}" of required type `)||e.message.startsWith(`Variable "$${e.nodes[0].variable.name.value}" of non-null type `))&&e.extensions?.code==null?new to(e):e);r&&await y(r);let{formattedErrors:a,httpFromErrors:o}=r?g(r):{formattedErrors:void 0,httpFromErrors:tT()};i.status400ForVariableCoercionErrors&&r?.length&&void 0===t.data&&!o.status&&(o.status=400),tS(n.response.http,o),"singleResult"in e?n.response.body={kind:"single",singleResult:{...t,errors:a}}:n.response.body={kind:"incremental",initialResult:{...e.initialResult,errors:a},subsequentResults:e.subsequentResults}}catch(i){let e=tI(i);return await Promise.all(t.map(t=>t.executionDidEnd?.(e))),await v([tb(e)])}await Promise.all(t.map(e=>e.executionDidEnd?.()))}if(await m(),!n.response.body)throw Error("got to end of processGraphQLRequest without setting body?");return n.response;async function p({useLegacyIncremental:n,...r}){let{request:a,document:s}=r;if(i.__testing_incrementalExecutionResults)return i.__testing_incrementalExecutionResults;if(i.gatewayExecutor)return{singleResult:await i.gatewayExecutor(function(e,t,i){let n={};if("query"in e.request&&(n.query=e.request.query),"operationName"in e.request&&(n.operationName=e.request.operationName),"variables"in e.request&&(n.variables=e.request.variables),"extensions"in e.request&&(n.extensions=e.request.extensions),e.request.http){let t=e.request.http,i=""!==t.search&&!t.search.startsWith("?");n.http={method:t.method,url:`https://unknown-url.invalid/${i?"?":""}${t.search}`,headers:new tj(t.headers)}}return{request:n,response:{http:{headers:new tj(e.response.http.headers),get status(){return e.response.http.status},set status(newStatus){e.response.http.status=newStatus}}},logger:t.logger,schema:e.schema,schemaHash:"schemaHash no longer exists since Apollo Server 4",context:e.contextValue,cache:t.cache,queryHash:e.queryHash,document:e.document,source:e.source,operationName:e.operationName,operation:e.operation,errors:e.errors,metrics:e.metrics,debug:i.includeStacktraceInErrorResponses,overallCachePolicy:e.overallCachePolicy,requestIsBatched:e.requestIsBatched}}(r,t,i))};{let t=await tG({schema:e.schema,document:s,rootValue:"function"==typeof i.rootValue?i.rootValue(s):i.rootValue,contextValue:r.contextValue,variableValues:a.variables,operationName:a.operationName,fieldResolver:i.fieldResolver,useLegacyIncremental:n,options:i.executionOptions,legacyExperimentalExecuteIncrementally:i.legacyExperimentalExecuteIncrementally});return"initialResult"in t?{initialResult:t.initialResult,subsequentResults:"pending"in t.initialResult?f(t.subsequentResults):h(t.subsequentResults)}:{singleResult:t}}}async function*h(e){for await(let t of e){let e=t.incremental?{...t,incremental:await tQ(t.incremental,async e=>{let{errors:t}=e;return t?(await Promise.all(a.map(e=>e.didEncounterSubsequentErrors?.(n,t))),{...e,errors:g(t).formattedErrors}):e})}:t;await Promise.all(a.map(t=>t.willSendSubsequentPayload?.(n,e))),yield e}}async function*f(e){for await(let t of e){let e=t.incremental?{...t,incremental:await tQ(t.incremental,async e=>{let{errors:t}=e;return t?(await Promise.all(a.map(e=>e.didEncounterSubsequentErrors?.(n,t))),{...e,errors:g(t).formattedErrors}):e})}:t;t.completed&&(e.completed=await tQ(t.completed,async e=>{let{errors:t}=e;return t?(await Promise.all(a.map(e=>e.didEncounterSubsequentErrors?.(n,t))),{...e,errors:g(t).formattedErrors}):e})),await Promise.all(a.map(t=>t.willSendSubsequentPayload?.(n,e))),yield e}}async function m(){await Promise.all(a.map(e=>e.willSendResponse?.(n)))}async function y(e){return n.errors=e,await Promise.all(a.map(e=>e.didEncounterErrors?.(n)))}async function v(e){await y(e);let{formattedErrors:t,httpFromErrors:i}=g(e);return n.response.body={kind:"single",singleResult:{errors:t}},tS(n.response.http,i),n.response.http.status||(n.response.http.status=500),await m(),n.response}function g(e){return tE(e,{formatError:i.formatError,includeStacktraceInErrorResponses:i.includeStacktraceInErrorResponses})}}async function tQ(e,t){let i=[];for(let n of e){let e=await t(n);i.push(e)}return i}var tq=e.i(118),tH=e.i(566879);class tJ{logger;schemaDerivedDataProvider;onSchemaLoadOrUpdateListeners=new Set;isStopped=!1;schemaDerivedData;schemaContext;modeSpecificState;constructor(e){this.logger=e.logger,this.schemaDerivedDataProvider=e.schemaDerivedDataProvider,"gateway"in e?this.modeSpecificState={mode:"gateway",gateway:e.gateway,apolloConfig:e.apolloConfig}:this.modeSpecificState={mode:"schema",apiSchema:e.apiSchema,schemaDerivedData:e.schemaDerivedDataProvider(e.apiSchema)}}async start(){if("gateway"!==this.modeSpecificState.mode)return this.processSchemaLoadOrUpdateEvent({apiSchema:this.modeSpecificState.apiSchema},this.modeSpecificState.schemaDerivedData),null;{let e=this.modeSpecificState.gateway;if(e.onSchemaLoadOrUpdate)this.modeSpecificState.unsubscribeFromGateway=e.onSchemaLoadOrUpdate(e=>{this.processSchemaLoadOrUpdateEvent(e)});else throw Error("Unexpectedly couldn't find onSchemaLoadOrUpdate on gateway");return(await this.modeSpecificState.gateway.load({apollo:this.modeSpecificState.apolloConfig})).executor}}onSchemaLoadOrUpdate(e){if(!this.schemaContext)throw Error("You must call start() before onSchemaLoadOrUpdate()");if(!this.isStopped)try{e(this.schemaContext)}catch(e){throw Error(`An error was thrown from an 'onSchemaLoadOrUpdate' listener: ${e.message}`)}return this.onSchemaLoadOrUpdateListeners.add(e),()=>{this.onSchemaLoadOrUpdateListeners.delete(e)}}getSchemaDerivedData(){if(!this.schemaDerivedData)throw Error("You must call start() before getSchemaDerivedData()");return this.schemaDerivedData}async stop(){this.isStopped=!0,"gateway"===this.modeSpecificState.mode&&(this.modeSpecificState.unsubscribeFromGateway?.(),await this.modeSpecificState.gateway.stop?.())}processSchemaLoadOrUpdateEvent(e,t){this.isStopped||(this.schemaDerivedData=t??this.schemaDerivedDataProvider(e.apiSchema),this.schemaContext=e,this.onSchemaLoadOrUpdateListeners.forEach(t=>{try{t(e)}catch(e){this.logger.error("An error was thrown from an 'onSchemaLoadOrUpdate' listener"),this.logger.error(e)}}))}}let tW=e=>({Field(t){("__schema"===t.name.value||"__type"===t.name.value)&&e.reportError(new B.GraphQLError("GraphQL introspection is not allowed by Apollo Server, but the query contained __schema or __type. To enable introspection, pass introspection: true to ApolloServer in production",{nodes:[t],extensions:{validationErrorCode:c.INTROSPECTION_DISABLED}}))}});class tY{selectionCountLimit;context;fragmentInfo=new Map;operationInfo=new Map;currentFragment;currentOperation;fragmentRecursiveSelectionCount=new Map;constructor(e,t){this.selectionCountLimit=e,this.context=t}getExecutionDefinitionInfo(){if(void 0!==this.currentFragment){let e=this.fragmentInfo.get(this.currentFragment);return e||(e={selectionCount:0,fragmentSpreads:new Map},this.fragmentInfo.set(this.currentFragment,e)),e}if(void 0!==this.currentOperation){let e=this.operationInfo.get(this.currentOperation);return e||(e={selectionCount:0,fragmentSpreads:new Map},this.operationInfo.set(this.currentOperation,e)),e}}processSelection(e){let t=this.getExecutionDefinitionInfo();if(t&&(t.selectionCount++,void 0!==e)){let i=(t.fragmentSpreads.get(e)??0)+1;t.fragmentSpreads.set(e,i)}}enterFragment(e){this.currentFragment=e}leaveFragment(){this.currentFragment=void 0}enterOperation(e){this.currentOperation=e}leaveOperation(){this.currentOperation=void 0}computeFragmentRecursiveSelectionsCount(e){let t=this.fragmentRecursiveSelectionCount.get(e);if(null===t)return 0;if(void 0!==t)return t;this.fragmentRecursiveSelectionCount.set(e,null);let i=this.fragmentInfo.get(e),n=0;if(i)for(let[e,t]of(n=i.selectionCount,i.fragmentSpreads))n+=t*this.computeFragmentRecursiveSelectionsCount(e);return this.fragmentRecursiveSelectionCount.set(e,n),n}reportError(e){let t=e?`Operation "${e}"`:"Anonymous operation";this.context.reportError(new B.GraphQLError(`${t} recursively requests too many selections.`,{nodes:[],extensions:{validationErrorCode:c.MAX_RECURSIVE_SELECTIONS_EXCEEDED}}))}checkLimitExceeded(){for(let[e,t]of this.operationInfo){let i=t.selectionCount;for(let[e,n]of t.fragmentSpreads)i+=n*this.computeFragmentRecursiveSelectionsCount(e);i>this.selectionCountLimit&&this.reportError(e)}}}function tz(e){return t=>{let i=new tY(e,t);return{Field(){i.processSelection()},InlineFragment(){i.processSelection()},FragmentSpread(e){i.processSelection(e.name.value)},FragmentDefinition:{enter(e){i.enterFragment(e.name.value)},leave(){i.leaveFragment()}},OperationDefinition:{enter(e){i.enterOperation(e.name?.value??null)},leave(){i.leaveOperation()}},Document:{leave(){i.checkLimitExceeded()}}}}}class tX{internals;cache;logger;constructor(e){let t;const i=e.nodeEnv??"production"??"";this.logger=e.logger??function(){let e=e4.default.getLogger("apollo-server");return e.setLevel(e4.default.levels.INFO),e}();const n=function(e,t){let i={},{APOLLO_KEY:n,APOLLO_GRAPH_REF:r,APOLLO_GRAPH_ID:a,APOLLO_GRAPH_VARIANT:s}=process.env;e?.key?i.key=e.key.trim():n&&(i.key=n.trim()),(e?.key??n)!==i.key&&t.warn("The provided API key has unexpected leading or trailing whitespace. Apollo Server will trim the key value before use."),i.key&&function(e){let t=/[^\t\x20-\x7e\x80-\xff]/g;if(t.test(e)){let i=e.match(t);throw Error(`The API key provided to Apollo Server contains characters which are invalid as HTTP header values. The following characters found in the key are invalid: ${i.join(", ")}. Valid header values may only contain ASCII visible characters. If you think there is an issue with your key, please contact Apollo support.`)}}(i.key),i.key&&(i.keyHash=(0,e8.createHash)("sha512").update(i.key).digest("hex")),e?.graphRef?i.graphRef=e.graphRef:r&&(i.graphRef=r);let o=e?.graphId??a,l=e?.graphVariant??s;if(i.graphRef){if(o)throw Error("Cannot specify both graph ref and graph ID. Please use `apollo.graphRef` or `APOLLO_GRAPH_REF` without also setting the graph ID.");if(l)throw Error("Cannot specify both graph ref and graph variant. Please use `apollo.graphRef` or `APOLLO_GRAPH_REF` without also setting the graph variant.")}else o&&(i.graphRef=l?`${o}@${l}`:o);return i}(e.apollo,this.logger);if(e.cache&&"bounded"!==e.cache&&p.PrefixingKeyValueCache.prefixesAreUnnecessaryForIsolation(e.cache))throw Error("You cannot pass a cache returned from `PrefixingKeyValueCache.cacheDangerouslyDoesNotNeedPrefixesForIsolation`to `new ApolloServer({ cache })`, because Apollo Server may use it for multiple features whose cache keys must be distinct from each other.");const r=e.gateway?{phase:"initialized",schemaManager:new tJ({gateway:e.gateway,apolloConfig:n,schemaDerivedDataProvider:t=>tX.generateSchemaDerivedData(t,e.documentStore),logger:this.logger})}:{phase:"initialized",schemaManager:new tJ({apiSchema:tX.constructSchema(e),schemaDerivedDataProvider:t=>tX.generateSchemaDerivedData(t,e.documentStore),logger:this.logger})},a=e.introspection??"production"!==i,s=e.hideSchemaDetailsFromClientErrors??!1;this.cache=void 0===e.cache||"bounded"===e.cache?new p.InMemoryLRUCache:e.cache;const o=!0===e.maxRecursiveSelections?[tz(1e7)]:"number"==typeof e.maxRecursiveSelections?[tz(e.maxRecursiveSelections)]:[],l=[...a?[]:[tW],...o];o.length>0?t=e.validationRules:l.push(...e.validationRules??[]),this.internals={formatError:e.formatError,rootValue:e.rootValue,validationRules:l,laterValidationRules:t,hideSchemaDetailsFromClientErrors:s,dangerouslyDisableValidation:e.dangerouslyDisableValidation??!1,validationOptions:e.validationOptions??{},fieldResolver:e.fieldResolver,includeStacktraceInErrorResponses:e.includeStacktraceInErrorResponses??("production"!==i&&"test"!==i),persistedQueries:!1===e.persistedQueries?void 0:{...e.persistedQueries,cache:new p.PrefixingKeyValueCache(e.persistedQueries?.cache??this.cache,"apq:")},nodeEnv:i,allowBatchedHttpRequests:e.allowBatchedHttpRequests??!1,apolloConfig:n,plugins:e.plugins??[],parseOptions:e.parseOptions??{},executionOptions:e.executionOptions??{},state:r,stopOnTerminationSignals:e.stopOnTerminationSignals,gatewayExecutor:null,csrfPreventionRequestHeaders:!0===e.csrfPrevention||void 0===e.csrfPrevention?tA:!1===e.csrfPrevention?null:e.csrfPrevention.requestHeaders??tA,status400ForVariableCoercionErrors:e.status400ForVariableCoercionErrors??!0,__testing_incrementalExecutionResults:e.__testing_incrementalExecutionResults,stringifyResult:e.stringifyResult??tg,legacyExperimentalExecuteIncrementally:e.legacyExperimentalExecuteIncrementally},this.warnAgainstDeprecatedConfigOptions(e)}warnAgainstDeprecatedConfigOptions(e){"status400ForVariableCoercionErrors"in e&&(!0===e.status400ForVariableCoercionErrors?this.logger.warn("The `status400ForVariableCoercionErrors: true` configuration option is now the default behavior and has no effect in Apollo Server v5. You can safely remove this option from your configuration."):this.logger.warn("The `status400ForVariableCoercionErrors: false` configuration option is deprecated and will be removed in Apollo Server v6. Apollo recommends removing any dependency on this behavior."))}async start(){return await this._start(!1)}startInBackgroundHandlingStartupErrorsByLoggingAndFailingAllRequests(){this._start(!0).catch(e=>this.logStartupError(e))}async _start(e){if("initialized"!==this.internals.state.phase)throw Error("You should only call 'start()' or 'startInBackgroundHandlingStartupErrorsByLoggingAndFailingAllRequests()' once on your ApolloServer.");let t=this.internals.state.schemaManager,i=e2();this.internals.state={phase:"starting",barrier:i,schemaManager:t,startedInBackground:e};try{await this.addDefaultPlugins();let i=[],n=await t.start();n&&(this.internals.gatewayExecutor=n),i.push(async()=>{await t.stop()});let r=t.getSchemaDerivedData(),a={logger:this.logger,cache:this.cache,schema:r.schema,apollo:this.internals.apolloConfig,startedInBackground:e},s=(await Promise.all(this.internals.plugins.map(async e=>({serverListener:e.serverWillStart&&await e.serverWillStart(a),installedImplicitly:t0(e)&&e.__internal_installed_implicitly__})))).filter(e=>"object"==typeof e.serverListener);s.forEach(({serverListener:{schemaDidLoadOrUpdate:e}})=>{e&&t.onSchemaLoadOrUpdate(e)});let o=s.map(e=>e.serverListener.serverWillStop).filter(tM);o.length&&i.push(async()=>{await Promise.all(o.map(e=>e()))});let l=s.map(e=>e.serverListener.drainServer).filter(tM),u=l.length?async()=>{await Promise.all(l.map(e=>e()))}:null,c=s.filter(e=>e.serverListener.renderLandingPage);c.length>1&&(c=c.filter(e=>!e.installedImplicitly));let d=null;if(c.length>1)throw Error("Only one plugin can implement renderLandingPage.");c.length&&(d=await c[0].serverListener.renderLandingPage());let p=this.maybeRegisterTerminationSignalHandlers(["SIGINT","SIGTERM"],e);this.internals.state={phase:"started",schemaManager:t,drainServers:u,landingPage:d,toDispose:i,toDisposeLast:p}}catch(t){let e=tI(t);try{await Promise.all(this.internals.plugins.map(async t=>t.startupDidFail?.({error:e})))}catch(e){this.logger.error(`startupDidFail hook threw: ${e}`)}throw this.internals.state={phase:"failed to start",error:e},e}finally{i.resolve()}}maybeRegisterTerminationSignalHandlers(e,t){let i=[];if(!1===this.internals.stopOnTerminationSignals||void 0===this.internals.stopOnTerminationSignals&&!(d.isNodeLike&&"test"!==this.internals.nodeEnv&&!t))return i;let n=!1,r=async e=>{if(!n){n=!0;try{await this.stop()}catch(t){this.logger.error(`stop() threw during ${e} shutdown`),this.logger.error(t),process.exit(1)}process.kill(process.pid,e)}};return e.forEach(e=>{process.on(e,r),i.push(async()=>{process.removeListener(e,r)})}),i}async _ensureStarted(){for(;;)switch(this.internals.state.phase){case"initialized":throw Error("You need to call `server.start()` before using your Apollo Server.");case"starting":await this.internals.state.barrier;break;case"failed to start":throw this.logStartupError(this.internals.state.error),Error("This data graph is missing a valid configuration. More details may be available in the server logs.");case"started":case"draining":return this.internals.state;case"stopping":case"stopped":throw this.logger.warn("A GraphQL operation was received during server shutdown. The operation will fail. Consider draining the HTTP server on shutdown; see https://go.apollo.dev/s/drain for details."),Error(`Cannot execute GraphQL operations ${"stopping"===this.internals.state.phase?"while the server is stopping":"after the server has stopped"}.'`);default:throw new tq.UnreachableCaseError(this.internals.state)}}assertStarted(e){if("started"!==this.internals.state.phase&&"draining"!==this.internals.state.phase&&!("starting"===this.internals.state.phase&&this.internals.state.startedInBackground))throw Error("You must `await server.start()` before calling `"+e+"`")}logStartupError(e){this.logger.error("An error occurred during Apollo Server startup. All GraphQL requests will now fail. The startup error was: "+(e?.message||e))}static constructSchema(e){if(e.schema)return e.schema;let{typeDefs:t,resolvers:i}=e;return function({typeDefs:e,resolvers:t={},resolverValidationOptions:i={},inheritResolversFromInterfaces:n=!1,updateResolversInPlace:r=!1,schemaExtensions:a,defaultFieldResolver:s,...o}){let u;if("object"!=typeof i)throw Error("Expected `resolverValidationOptions` to be an object");if(!e)throw Error("Must provide typeDefs");if((0,f.isSchema)(e))u=e;else if(o?.commentDescriptions){let t=e$(e,{...o,commentDescriptions:!0});u=(0,h.buildSchema)(t,o)}else{let t=e$(e,o);u=(0,h.buildASTSchema)(t,o)}if(u=function({schema:e,resolvers:t,defaultFieldResolver:i,resolverValidationOptions:n={},inheritResolversFromInterfaces:r=!1,updateResolversInPlace:a=!1}){var s,o,u;let{requireResolversToMatchSchema:c="error",requireResolversForResolveType:d}=n,p=r?function(e,t){let i={},n=e.getTypeMap();for(let e in n){let r=n[e];if("getInterfaces"in r){for(let n of(i[e]={},r.getInterfaces()))if(t[n.name])for(let r in t[n.name])"__isTypeOf"!==r&&r.startsWith("__")||(i[e][r]=t[n.name][r]);let n=t[e];i[e]={...i[e],...n}}else{let n=t[e];null!=n&&(i[e]=n)}}return i}(e,t):t;for(let t in p){let i=p[t];if("object"!=typeof i)throw Error(`"${t}" defined in resolvers, but has invalid value "${i}". The resolver's value must be of type object.`);let n=e.getType(t);if(null==n){let e=`"${t}" defined in resolvers, but not in schema`;if(c&&"error"!==c){"warn"===c&&console.warn(e);continue}throw Error(e)}if((0,R.isSpecifiedScalarType)(n))for(let e in i)e.startsWith("__")?n[e.substring(2)]=i[e]:n[e]=i[e];else if((0,A.isEnumType)(n)){let e=n.getValues();for(let t in i)if(!t.startsWith("__")&&!e.some(e=>e.name===t)&&c&&"ignore"!==c){let e=`${n.name}.${t} was defined in resolvers, but not present within ${n.name}`;if("error"===c)throw Error(e);console.warn(e)}}else if((0,A.isUnionType)(n)){for(let e in i)if(!e.startsWith("__")&&c&&"ignore"!==c){let t=`${n.name}.${e} was defined in resolvers, but ${n.name} is not an object or interface type`;if("error"===c)throw Error(t);console.warn(t)}}else if((0,A.isObjectType)(n)||(0,A.isInterfaceType)(n)){for(let e in i)if(!e.startsWith("__"))if(null==n.getFields()[e]){if(c&&"ignore"!==c){let i=`${t}.${e} defined in resolvers, but not in schema`;if("error"===c)throw Error(i);console.error(i)}}else{let n=i[e];if("function"!=typeof n&&"object"!=typeof n)throw Error(`Resolver ${t}.${e} must be object or function`)}}}return e=a?function(e,t,i){let n=e.getTypeMap();for(let i in t){let r=e.getType(i),a=t[i];if((0,A.isScalarType)(r))for(let e in a)e.startsWith("__")?r[e.substring(2)]=a[e]:"astNode"===e&&null!=r.astNode?r.astNode={...r.astNode,description:a?.astNode?.description??r.astNode.description,directives:(r.astNode.directives??[]).concat(a?.astNode?.directives??[])}:"extensionASTNodes"===e&&null!=r.extensionASTNodes?r.extensionASTNodes=r.extensionASTNodes.concat(a?.extensionASTNodes??[]):"extensions"===e&&null!=r.extensions&&null!=a.extensions?r.extensions=Object.assign(Object.create(null),r.extensions,a.extensions):r[e]=a[e];else if((0,A.isEnumType)(r)){let e=r.toConfig(),t=e.values;for(let i in a)i.startsWith("__")?e[i.substring(2)]=a[i]:"astNode"===i&&null!=e.astNode?e.astNode={...e.astNode,description:a?.astNode?.description??e.astNode.description,directives:(e.astNode.directives??[]).concat(a?.astNode?.directives??[])}:"extensionASTNodes"===i&&null!=e.extensionASTNodes?e.extensionASTNodes=e.extensionASTNodes.concat(a?.extensionASTNodes??[]):"extensions"===i&&null!=r.extensions&&null!=a.extensions?r.extensions=Object.assign(Object.create(null),r.extensions,a.extensions):t[i]&&(t[i].value=a[i]);n[i]=new A.GraphQLEnumType(e)}else if((0,A.isUnionType)(r))for(let e in a)e.startsWith("__")&&(r[e.substring(2)]=a[e]);else if((0,A.isObjectType)(r)||(0,A.isInterfaceType)(r))for(let e in a){if(e.startsWith("__")){r[e.substring(2)]=a[e];continue}let t=r.getFields()[e];if(null!=t){let i=a[e];"function"==typeof i?t.resolve=i.bind(a):e0(t,i)}}}return ej(e,eK),function(e,t){let i=Object.create(null);for(let t in e){let n=e[t];if(null==n||t.startsWith("__"))continue;let r=n.name;if(!r.startsWith("__")){if(null!=i[r]){console.warn(`Duplicate schema type name ${r} found; keeping the existing one found in the schema`);continue}i[r]=n}}for(let t in i){let n=i[t];e[t]=n}for(let e of t)e.args=e.args.filter(e=>(e.type=a(e.type),null!==e.type));for(let t in e){let s=e[t];!t.startsWith("__")&&t in i&&null!=s&&function(e){if((0,A.isObjectType)(e)){n(e),r(e);return}if((0,A.isInterfaceType)(e)){n(e),"getInterfaces"in e&&r(e);return}if((0,A.isUnionType)(e))return function(e){let t=e.getTypes();t.push(...t.splice(0).map(e=>a(e)).filter(Boolean))}(e);if((0,A.isInputObjectType)(e))return function(e){let t=e.getFields();for(let[e,i]of Object.entries(t))i.type=a(i.type),null===i.type&&delete t[e]}(e);if(!(0,A.isLeafType)(e))throw Error(`Unexpected schema type: ${e}`)}(s)}for(let t in e)t.startsWith("__")||t in i||delete e[t];function n(e){let t=e.getFields();for(let[e,i]of Object.entries(t))i.args.map(e=>(e.type=a(e.type),null===e.type?null:e)).filter(Boolean),i.type=a(i.type),null===i.type&&delete t[e]}function r(e){if("getInterfaces"in e){let t=e.getInterfaces();t.push(...t.splice(0).map(e=>a(e)).filter(Boolean))}}function a(t){if((0,A.isListType)(t)){let e=a(t.ofType);return null!=e?new A.GraphQLList(e):null}if((0,A.isNonNullType)(t)){let e=a(t.ofType);return null!=e?new A.GraphQLNonNull(e):null}if((0,A.isNamedType)(t)){let i=e[t.name];if(i&&t!==i)return i}return t}}(e.getTypeMap(),e.getDirectives()),ej(e,eQ),null!=i&&eV(e,e=>{e.resolve||(e.resolve=i)}),e}(e,p,i):(s=e,o=p,u=i,s=eq(s,{[l.SCALAR_TYPE]:e=>{let t=e.toConfig(),i=o[e.name];if(!(0,R.isSpecifiedScalarType)(e)&&null!=i){for(let n in i)n.startsWith("__")?t[n.substring(2)]=i[n]:"astNode"===n&&null!=t.astNode?t.astNode={...t.astNode,description:i?.astNode?.description??t.astNode.description,directives:(t.astNode.directives??[]).concat(i?.astNode?.directives??[])}:"extensionASTNodes"===n&&null!=t.extensionASTNodes?t.extensionASTNodes=t.extensionASTNodes.concat(i?.extensionASTNodes??[]):"extensions"===n&&null!=t.extensions&&null!=i.extensions?t.extensions=Object.assign(Object.create(null),e.extensions,i.extensions):t[n]=i[n];return new A.GraphQLScalarType(t)}},[l.ENUM_TYPE]:e=>{let t=o[e.name],i=e.toConfig(),n=i.values;if(null!=t){for(let r in t)r.startsWith("__")?i[r.substring(2)]=t[r]:"astNode"===r&&null!=i.astNode?i.astNode={...i.astNode,description:t?.astNode?.description??i.astNode.description,directives:(i.astNode.directives??[]).concat(t?.astNode?.directives??[])}:"extensionASTNodes"===r&&null!=i.extensionASTNodes?i.extensionASTNodes=i.extensionASTNodes.concat(t?.extensionASTNodes??[]):"extensions"===r&&null!=i.extensions&&null!=t.extensions?i.extensions=Object.assign(Object.create(null),e.extensions,t.extensions):n[r]&&(n[r].value=t[r]);return new A.GraphQLEnumType(i)}},[l.UNION_TYPE]:e=>{let t=o[e.name];if(null!=t){let i=e.toConfig();return t.__resolveType&&(i.resolveType=t.__resolveType),new A.GraphQLUnionType(i)}},[l.OBJECT_TYPE]:e=>{let t=o[e.name];if(null!=t){let i=e.toConfig();return t.__isTypeOf&&(i.isTypeOf=t.__isTypeOf),new A.GraphQLObjectType(i)}},[l.INTERFACE_TYPE]:e=>{let t=o[e.name];if(null!=t){let i=e.toConfig();return t.__resolveType&&(i.resolveType=t.__resolveType),new A.GraphQLInterfaceType(i)}},[l.COMPOSITE_FIELD]:(e,t,i)=>{let n=o[i];if(null!=n){let i=n[t];if(null!=i){let t={...e};return"function"==typeof i?t.resolve=i.bind(n):e0(t,i),t}}}}),null!=u&&(s=eq(s,{[l.OBJECT_FIELD]:e=>({...e,resolve:null!=e.resolve?e.resolve:u})})),s),d&&"ignore"!==d&&eq(e,{[l.ABSTRACT_TYPE]:e=>{if(!e.resolveType){let t=`Type "${e.name}" is missing a "__resolveType" resolver. Pass 'ignore' into "resolverValidationOptions.requireResolversForResolveType" to disable this error.`;if("error"===d)throw Error(t);"warn"===d&&console.warn(t)}}}),e}({schema:u,resolvers:I(t),resolverValidationOptions:i,inheritResolversFromInterfaces:n,updateResolversInPlace:r,defaultFieldResolver:s}),Object.keys(i).length>0&&function(e,t={}){let{requireResolversForArgs:i,requireResolversForNonScalar:n,requireResolversForAllFields:r}=t;if(r&&(i||n))throw TypeError("requireResolversForAllFields takes precedence over the more specific assertions. Please configure either requireResolversForAllFields or requireResolversForArgs / requireResolversForNonScalar, but not a combination of them.");eV(e,(e,t,a)=>{r&&e1("requireResolversForAllFields",r,e,t,a),i&&e.args.length>0&&e1("requireResolversForArgs",i,e,t,a),"ignore"===n||(0,A.isScalarType)((0,A.getNamedType)(e.type))||e1("requireResolversForNonScalar",n,e,t,a)})}(u,i),a)for(let e of m(a)){var c=u,d=e;for(let[e,t]of(E(c,d.schemaExtensions),Object.entries(d.types||{}))){let i=c.getType(e);if(i){if(E(i,t.extensions),"object"===t.type||"interface"===t.type)for(let[e,n]of Object.entries(t.fields)){let t=i.getFields()[e];if(t)for(let[e,i]of(E(t,n.extensions),Object.entries(n.arguments)))E(t.args.find(t=>t.name===e),i)}else if("input"===t.type)for(let[e,n]of Object.entries(t.fields))E(i.getFields()[e],n.extensions);else if("enum"===t.type)for(let[e,n]of Object.entries(t.values))E(i.getValue(e),n)}}}return u}({typeDefs:Array.isArray(t)?t:[t],resolvers:i})}static generateSchemaDerivedData(e,t){return(0,e5.assertValidSchema)(e),{schema:e,documentStore:void 0===t?new p.InMemoryLRUCache:t,documentStoreKeyPrefix:t?`${(0,tH.computeCoreSchemaHash)((0,e3.printSchema)(e))}:`:""}}async stop(){switch(this.internals.state.phase){case"initialized":case"starting":case"failed to start":throw Error("apolloServer.stop() should only be called after `await apolloServer.start()` has succeeded");case"stopped":if(this.internals.state.stopError)throw this.internals.state.stopError;return;case"stopping":case"draining":{await this.internals.state.barrier;let e=this.internals.state;if("stopped"!==e.phase)throw Error(`Surprising post-stopping state ${e.phase}`);if(e.stopError)throw e.stopError;return}case"started":break;default:throw new tq.UnreachableCaseError(this.internals.state)}let e=e2(),{schemaManager:t,drainServers:i,landingPage:n,toDispose:r,toDisposeLast:a}=this.internals.state;this.internals.state={phase:"draining",barrier:e,schemaManager:t,landingPage:n};try{await i?.(),this.internals.state={phase:"stopping",barrier:e},await Promise.all([...r].map(e=>e())),await Promise.all([...a].map(e=>e()))}catch(t){throw this.internals.state={phase:"stopped",stopError:t},e.resolve(),t}this.internals.state={phase:"stopped",stopError:null}}async addDefaultPlugins(){let{plugins:t,apolloConfig:i,nodeEnv:n,hideSchemaDetailsFromClientErrors:r}=this.internals,a=e=>t.some(t=>(0,tD.pluginIsInternal)(t)&&t.__internal_plugin_id__===e),s=new Map;for(let e of t)if((0,tD.pluginIsInternal)(e)){let t=e.__internal_plugin_id__;s.has(t)||s.set(t,{sawDisabled:!1,sawNonDisabled:!1});let i=s.get(t);if(e.__is_disabled_plugin__?i.sawDisabled=!0:i.sawNonDisabled=!0,i.sawDisabled&&i.sawNonDisabled)throw Error(`You have tried to install both ApolloServerPlugin${t} and ApolloServerPlugin${t}Disabled in your server. Please choose whether or not you want to disable the feature and install the appropriate plugin for your use case.`)}if(!a("CacheControl")){let{ApolloServerPluginCacheControl:i}=await e.A(108981);t.push(i())}if(!a("UsageReporting")&&i.key)if(i.graphRef){let{ApolloServerPluginUsageReporting:i}=await e.A(727515);t.unshift(i({__onlyIfSchemaIsNotSubgraph:!0}))}else this.logger.warn("You have specified an Apollo key but have not specified a graph ref; usage reporting is disabled. To enable usage reporting, set the `APOLLO_GRAPH_REF` environment variable to `your-graph-id@your-graph-variant`. To disable this warning, install `ApolloServerPluginUsageReportingDisabled`.");{let n=a("SchemaReporting"),r="true"===process.env.APOLLO_SCHEMA_REPORTING;if(!n&&r)if(i.key){let{ApolloServerPluginSchemaReporting:i}=await e.A(197318);t.push(i())}else throw Error("You've enabled schema reporting by setting the APOLLO_SCHEMA_REPORTING environment variable to true, but you also need to provide your Apollo API key, via the APOLLO_KEY environment variable or via `new ApolloServer({apollo: {key})")}if(!a("InlineTrace")){let{ApolloServerPluginInlineTrace:i}=await e.A(837353);t.push(i({__onlyIfSchemaIsSubgraph:!0}))}if(!a("LandingPageDisabled")){let{ApolloServerPluginLandingPageLocalDefault:i,ApolloServerPluginLandingPageProductionDefault:r}=await e.A(218035),a="production"!==n?i():r();if(!t0(a))throw Error("default landing page plugin should be implicitly installable?");a.__internal_installed_implicitly__=!0,t.push(a)}{let i=a("DisableSuggestions");if(r&&!i){let{ApolloServerPluginDisableSuggestions:i}=await e.A(296341);t.push(i())}}}addPlugin(e){if("initialized"!==this.internals.state.phase)throw Error("Can't add plugins after the server has started");this.internals.plugins.push(e)}async executeHTTPGraphQLRequest({httpGraphQLRequest:e,context:t}){try{let i,n;try{i=await this._ensureStarted()}catch(t){return await this.errorResponse(t,e)}if(i.landingPage&&this.prefersHTML(e)){let t;if("string"==typeof i.landingPage.html)t=i.landingPage.html;else try{t=await i.landingPage.html()}catch(i){let t=tI(i);return this.logger.error(`Landing page \`html\` function threw: ${t}`),await this.errorResponse(t,e)}return{headers:new te([["content-type","text/html"]]),body:{kind:"complete",string:t}}}this.internals.csrfPreventionRequestHeaders&&function(e,t){let i=e.get("content-type");if(void 0!==i){let e=tc.default.parse(i);if(null===e||!tO.includes(e.essence))return}if(!t.some(t=>{let i=e.get(t);return void 0!==i&&i.length>0}))throw new tu(`This operation has been blocked as a potential Cross-Site Request Forgery (CSRF). Please either specify a 'content-type' header (with a type that is not one of ${tO.join(", ")}) or provide a non-empty value for one of the following headers: ${t.join(", ")}
|
|
46
|
+
`}function tg(e){return JSON.stringify(e)+"\n"}function tT(e){return{status:e,headers:new te}}function tS(e,t){if(t.status&&(e.status=t.status),t.headers)for(let[i,n]of t.headers)e.headers.set(i,n)}function tE(e,t={}){let i=t.formatError??(e=>e),n=tT();return{httpFromErrors:n,formattedErrors:e.map(e=>{try{return i(r(e),e)}catch(e){if(t.includeStacktraceInErrorResponses)return r(e);return{message:"Internal server error",extensions:{code:u.INTERNAL_SERVER_ERROR}}}})};function r(e){var i;let r=tb(e),a={...r.extensions,code:r.extensions.code??u.INTERNAL_SERVER_ERROR};return(i=a.http)&&"object"==typeof i&&(!("status"in i)||"number"==typeof i.status)&&(!("headers"in i)||i.headers instanceof Map)&&(tS(n,{headers:new te,...a.http}),delete a.http),t.includeStacktraceInErrorResponses&&(a.stacktrace=r.stack?.split("\n")),{...r.toJSON(),extensions:a}}}function tI(e){return e instanceof Error?e:new B.GraphQLError("Unexpected error value: "+String(e))}function tb(e,t=""){let i=tI(e);return i instanceof B.GraphQLError?i:new B.GraphQLError(t+i.message,{originalError:i})}async function tN({server:e,batchRequest:t,body:i,contextValue:n,schemaDerivedData:r,internals:a}){if(0===i.length)throw new tu("No operations found in request.");let s=tT(),o=await Promise.all(i.map(async i=>{let o={...t,body:i},l=await ty({server:e,httpRequest:o,contextValue:n,schemaDerivedData:r,internals:a,sharedResponseHTTPGraphQLHead:s});if("chunked"===l.body.kind)throw Error("Incremental delivery is not implemented for batch requests");return l.body.string}));return{...s,body:{kind:"complete",string:`[${o.join(",")}]`}}}async function t_(e,t,i,n,r){if(!("POST"===t.method&&Array.isArray(t.body)))return await ty({server:e,httpRequest:t,contextValue:i,schemaDerivedData:n,internals:r,sharedResponseHTTPGraphQLHead:null});if(r.allowBatchedHttpRequests)return await tN({server:e,batchRequest:t,body:t.body,contextValue:i,schemaDerivedData:n,internals:r});throw new tu("Operation batching disabled.")}var tD=e.i(162984);let tA=["x-apollo-operation-name","apollo-require-preflight"],tO=["application/x-www-form-urlencoded","multipart/form-data","text/plain"];var tR=e.i(487584),tw=e.i(21972),tL=e.i(509083),tC=e.i(139024);let tF=Symbol("apolloServerExecutionDispatcherWillResolveField"),tk=Symbol("apolloServerUserFieldResolver"),tP=Symbol("apolloServerPluginsEnabled");function tx(e){return e&&"function"==typeof e.then}function tM(e){return null!=e}async function tU(e,t){let i=(await Promise.all(e.map(e=>t(e)))).filter(tM);return i.reverse(),async(...e)=>{for(let t of i)t(...e)}}async function t$(e,t){for(let i of e){let e=await t(i);if(null!=e)return e}return null}class tj{map;constructor(e){this.map=e}append(e,t){this.map.has(e)?this.map.set(e,this.map.get(e)+", "+t):this.map.set(e,t)}delete(e){this.map.delete(e)}get(e){return this.map.get(e)??null}has(e){return this.map.has(e)}set(e,t){this.map.set(e,t)}entries(){return this.map.entries()}keys(){return this.map.keys()}values(){return this.map.values()}[Symbol.iterator](){return this.map.entries()}}async function tV(){if(void 0!==t)return;let i=await e.A(899105);t="17.0.0-alpha.9"===i.version&&"experimentalExecuteIncrementally"in i?i.experimentalExecuteIncrementally:null}async function tG({useLegacyIncremental:e,legacyExperimentalExecuteIncrementally:i,...n}){if(await tV(),e){if(i)return i(n);if(t)throw new tu(`Apollo Server received an operation that uses incremental delivery (@defer or @stream) with the legacy incremental format, but the server does not support the legacy incremental delivery format. Add the HTTP header: 'Accept: ${t1.MULTIPART_MIXED_EXPERIMENTAL_ALPHA_9}' to use the current incremental delivery format`,{extensions:{http:{status:406}}})}return t?t(n):(0,tC.execute)(n)}function tB(e){return(0,e8.createHash)("sha256").update(e).digest("hex")}async function tK(e,t,i,n){let r,a=(await Promise.all(i.plugins.map(e=>e.requestDidStart?.(n)))).filter(tM),s=n.request,{query:o,extensions:l}=s;if(n.metrics.persistedQueryHit=!1,n.metrics.persistedQueryRegister=!1,l?.persistedQuery){if(!i.persistedQueries)return await v([new ts]);if(1!==l.persistedQuery.version)return await v([new B.GraphQLError("Unsupported persisted query version",{extensions:{http:tT(400)}})]);if(r=l.persistedQuery.sha256Hash,void 0===o){if(!(o=await i.persistedQueries.cache.get(r)))return await v([new ta]);n.metrics.persistedQueryHit=!0}else{if(r!==tB(o))return await v([new B.GraphQLError("provided sha does not match query",{extensions:{http:tT(400)}})]);n.metrics.persistedQueryRegister=!0}}else{if(!o)return await v([new tu("GraphQL operations must contain a non-empty `query` or a `persistedQuery` extension.")]);r=tB(o)}if(n.queryHash=r,n.source=o,await Promise.all(a.map(e=>e.didResolveSource?.(n))),e.documentStore)try{n.document=await e.documentStore.get(e.documentStoreKeyPrefix+r)}catch(e){t.logger.warn("An error occurred while attempting to read from the documentStore. "+tI(e).message)}if(!n.document){let s=await tU(a,async e=>e.parsingDidStart?.(n));try{n.document=(0,_.parse)(o,i.parseOptions)}catch(t){let e=tI(t);return await s(e),await v([new ti(tb(e))])}if(await s(),!0!==i.dangerouslyDisableValidation){let t=await tU(a,async e=>e.validationDidStart?.(n)),r=(0,tL.validate)(e.schema,n.document,[...tR.specifiedRules,...i.validationRules],i.validationOptions);if(0===r.length&&i.laterValidationRules&&(r=(0,tL.validate)(e.schema,n.document,i.laterValidationRules)),0!==r.length)return await t(r),await v(r.map(e=>new tn(e)));await t()}e.documentStore&&Promise.resolve(e.documentStore.set(e.documentStoreKeyPrefix+r,n.document)).catch(e=>t.logger.warn("Could not store validated document. "+e?.message))}let u=(0,tw.getOperationAST)(n.document,s.operationName);if(n.operation=u||void 0,n.operationName=u?.name?.value||null,s.http?.method==="GET"&&u?.operation&&"query"!==u.operation)return await v([new tu(`GET requests only support query operations, not ${u.operation} operations`,{extensions:{http:{status:405,headers:new te([["allow","POST"]])}}})]);try{await Promise.all(a.map(e=>e.didResolveOperation?.(n)))}catch(e){return await v([tb(e)])}if(n.metrics.persistedQueryRegister&&i.persistedQueries){let e=i.persistedQueries?.ttl;Promise.resolve(i.persistedQueries.cache.set(r,o,void 0!==e?{ttl:i.persistedQueries?.ttl}:void 0)).catch(t.logger.warn.bind(t.logger))}let c=await t$(a,async e=>await e.responseForOperation?.(n));if(null!==c)n.response.body=c.body,tS(n.response.http,c.http);else{let t=(await Promise.all(a.map(e=>e.executionDidStart?.(n)))).filter(tM);if(t.reverse(),t.some(e=>e.willResolveField)){var d;Object.defineProperty(n.contextValue,tF,{value:(...e)=>{var i;let n;return i=t=>t.willResolveField?.(...e),(n=t.map(e=>i(e)).filter(tM)).reverse(),(...e)=>{for(let t of n)t(...e)}}}),i.fieldResolver&&Object.defineProperty(n.contextValue,tk,{value:i.fieldResolver}),(d=e.schema)[tP]||(Object.defineProperty(d,tP,{value:!0}),Object.values(d.getTypeMap()).forEach(e=>{!(0,A.getNamedType)(e).name.startsWith("__")&&e instanceof A.GraphQLObjectType&&Object.values(e.getFields()).forEach(e=>{var t;let i;i=(t=e).resolve,t.resolve=(e,t,n,r)=>{let a=n?.[tF],s=n?.[tk],o="function"==typeof a&&a({source:e,args:t,contextValue:n,info:r}),l=i||s||tC.defaultFieldResolver;try{let i=l(e,t,n,r);return"function"==typeof o&&function e(t,i){tx(t)?t.then(t=>e(t,i),e=>i(e)):Array.isArray(t)&&t.some(tx)?Promise.all(t).then(e=>i(null,e),e=>i(e)):i(null,t)}(i,o),i}catch(e){throw"function"==typeof o&&o(e),e}}})}))}try{let e=await p({...n,useLegacyIncremental:new e6.default({headers:{accept:s.http?.headers.get("accept")}}).mediaType([t1.MULTIPART_MIXED_EXPERIMENTAL_ALPHA_9,t1.MULTIPART_MIXED_EXPERIMENTAL_ALPHA_2])===t1.MULTIPART_MIXED_EXPERIMENTAL_ALPHA_2}),t="singleResult"in e?e.singleResult:e.initialResult;if(!n.operation){if(!t.errors?.length)throw Error("Unexpected error: Apollo Server did not resolve an operation but execute did not return errors");throw new tl(t.errors[0])}let r=t.errors?.map(e=>e.nodes?.length===1&&e.nodes[0].kind===N.Kind.VARIABLE_DEFINITION&&(e.message.startsWith(`Variable "$${e.nodes[0].variable.name.value}" has invalid value`)||e.message.startsWith(`Variable "$${e.nodes[0].variable.name.value}" got invalid value `)||e.message.startsWith(`Variable "$${e.nodes[0].variable.name.value}" of required type `)||e.message.startsWith(`Variable "$${e.nodes[0].variable.name.value}" of non-null type `))&&e.extensions?.code==null?new to(e):e);r&&await y(r);let{formattedErrors:a,httpFromErrors:o}=r?g(r):{formattedErrors:void 0,httpFromErrors:tT()};i.status400ForVariableCoercionErrors&&r?.length&&void 0===t.data&&!o.status&&(o.status=400),tS(n.response.http,o),"singleResult"in e?n.response.body={kind:"single",singleResult:{...t,errors:a}}:n.response.body={kind:"incremental",initialResult:{...e.initialResult,errors:a},subsequentResults:e.subsequentResults}}catch(i){let e=tI(i);return await Promise.all(t.map(t=>t.executionDidEnd?.(e))),await v([tb(e)])}await Promise.all(t.map(e=>e.executionDidEnd?.()))}if(await m(),!n.response.body)throw Error("got to end of processGraphQLRequest without setting body?");return n.response;async function p({useLegacyIncremental:n,...r}){let{request:a,document:s}=r;if(i.__testing_incrementalExecutionResults)return i.__testing_incrementalExecutionResults;if(i.gatewayExecutor)return{singleResult:await i.gatewayExecutor(function(e,t,i){let n={};if("query"in e.request&&(n.query=e.request.query),"operationName"in e.request&&(n.operationName=e.request.operationName),"variables"in e.request&&(n.variables=e.request.variables),"extensions"in e.request&&(n.extensions=e.request.extensions),e.request.http){let t=e.request.http,i=""!==t.search&&!t.search.startsWith("?");n.http={method:t.method,url:`https://unknown-url.invalid/${i?"?":""}${t.search}`,headers:new tj(t.headers)}}return{request:n,response:{http:{headers:new tj(e.response.http.headers),get status(){return e.response.http.status},set status(newStatus){e.response.http.status=newStatus}}},logger:t.logger,schema:e.schema,schemaHash:"schemaHash no longer exists since Apollo Server 4",context:e.contextValue,cache:t.cache,queryHash:e.queryHash,document:e.document,source:e.source,operationName:e.operationName,operation:e.operation,errors:e.errors,metrics:e.metrics,debug:i.includeStacktraceInErrorResponses,overallCachePolicy:e.overallCachePolicy,requestIsBatched:e.requestIsBatched}}(r,t,i))};{let t=await tG({schema:e.schema,document:s,rootValue:"function"==typeof i.rootValue?i.rootValue(s):i.rootValue,contextValue:r.contextValue,variableValues:a.variables,operationName:a.operationName,fieldResolver:i.fieldResolver,useLegacyIncremental:n,options:i.executionOptions,legacyExperimentalExecuteIncrementally:i.legacyExperimentalExecuteIncrementally});return"initialResult"in t?{initialResult:t.initialResult,subsequentResults:"pending"in t.initialResult?f(t.subsequentResults):h(t.subsequentResults)}:{singleResult:t}}}async function*h(e){for await(let t of e){let e=t.incremental?{...t,incremental:await tQ(t.incremental,async e=>{let{errors:t}=e;return t?(await Promise.all(a.map(e=>e.didEncounterSubsequentErrors?.(n,t))),{...e,errors:g(t).formattedErrors}):e})}:t;await Promise.all(a.map(t=>t.willSendSubsequentPayload?.(n,e))),yield e}}async function*f(e){for await(let t of e){let e=t.incremental?{...t,incremental:await tQ(t.incremental,async e=>{let{errors:t}=e;return t?(await Promise.all(a.map(e=>e.didEncounterSubsequentErrors?.(n,t))),{...e,errors:g(t).formattedErrors}):e})}:t;t.completed&&(e.completed=await tQ(t.completed,async e=>{let{errors:t}=e;return t?(await Promise.all(a.map(e=>e.didEncounterSubsequentErrors?.(n,t))),{...e,errors:g(t).formattedErrors}):e})),await Promise.all(a.map(t=>t.willSendSubsequentPayload?.(n,e))),yield e}}async function m(){await Promise.all(a.map(e=>e.willSendResponse?.(n)))}async function y(e){return n.errors=e,await Promise.all(a.map(e=>e.didEncounterErrors?.(n)))}async function v(e){await y(e);let{formattedErrors:t,httpFromErrors:i}=g(e);return n.response.body={kind:"single",singleResult:{errors:t}},tS(n.response.http,i),n.response.http.status||(n.response.http.status=500),await m(),n.response}function g(e){return tE(e,{formatError:i.formatError,includeStacktraceInErrorResponses:i.includeStacktraceInErrorResponses})}}async function tQ(e,t){let i=[];for(let n of e){let e=await t(n);i.push(e)}return i}var tq=e.i(118),tJ=e.i(566879);class tH{logger;schemaDerivedDataProvider;onSchemaLoadOrUpdateListeners=new Set;isStopped=!1;schemaDerivedData;schemaContext;modeSpecificState;constructor(e){this.logger=e.logger,this.schemaDerivedDataProvider=e.schemaDerivedDataProvider,"gateway"in e?this.modeSpecificState={mode:"gateway",gateway:e.gateway,apolloConfig:e.apolloConfig}:this.modeSpecificState={mode:"schema",apiSchema:e.apiSchema,schemaDerivedData:e.schemaDerivedDataProvider(e.apiSchema)}}async start(){if("gateway"!==this.modeSpecificState.mode)return this.processSchemaLoadOrUpdateEvent({apiSchema:this.modeSpecificState.apiSchema},this.modeSpecificState.schemaDerivedData),null;{let e=this.modeSpecificState.gateway;if(e.onSchemaLoadOrUpdate)this.modeSpecificState.unsubscribeFromGateway=e.onSchemaLoadOrUpdate(e=>{this.processSchemaLoadOrUpdateEvent(e)});else throw Error("Unexpectedly couldn't find onSchemaLoadOrUpdate on gateway");return(await this.modeSpecificState.gateway.load({apollo:this.modeSpecificState.apolloConfig})).executor}}onSchemaLoadOrUpdate(e){if(!this.schemaContext)throw Error("You must call start() before onSchemaLoadOrUpdate()");if(!this.isStopped)try{e(this.schemaContext)}catch(e){throw Error(`An error was thrown from an 'onSchemaLoadOrUpdate' listener: ${e.message}`)}return this.onSchemaLoadOrUpdateListeners.add(e),()=>{this.onSchemaLoadOrUpdateListeners.delete(e)}}getSchemaDerivedData(){if(!this.schemaDerivedData)throw Error("You must call start() before getSchemaDerivedData()");return this.schemaDerivedData}async stop(){this.isStopped=!0,"gateway"===this.modeSpecificState.mode&&(this.modeSpecificState.unsubscribeFromGateway?.(),await this.modeSpecificState.gateway.stop?.())}processSchemaLoadOrUpdateEvent(e,t){this.isStopped||(this.schemaDerivedData=t??this.schemaDerivedDataProvider(e.apiSchema),this.schemaContext=e,this.onSchemaLoadOrUpdateListeners.forEach(t=>{try{t(e)}catch(e){this.logger.error("An error was thrown from an 'onSchemaLoadOrUpdate' listener"),this.logger.error(e)}}))}}let tW=e=>({Field(t){("__schema"===t.name.value||"__type"===t.name.value)&&e.reportError(new B.GraphQLError("GraphQL introspection is not allowed by Apollo Server, but the query contained __schema or __type. To enable introspection, pass introspection: true to ApolloServer in production",{nodes:[t],extensions:{validationErrorCode:c.INTROSPECTION_DISABLED}}))}});class tY{selectionCountLimit;context;fragmentInfo=new Map;operationInfo=new Map;currentFragment;currentOperation;fragmentRecursiveSelectionCount=new Map;constructor(e,t){this.selectionCountLimit=e,this.context=t}getExecutionDefinitionInfo(){if(void 0!==this.currentFragment){let e=this.fragmentInfo.get(this.currentFragment);return e||(e={selectionCount:0,fragmentSpreads:new Map},this.fragmentInfo.set(this.currentFragment,e)),e}if(void 0!==this.currentOperation){let e=this.operationInfo.get(this.currentOperation);return e||(e={selectionCount:0,fragmentSpreads:new Map},this.operationInfo.set(this.currentOperation,e)),e}}processSelection(e){let t=this.getExecutionDefinitionInfo();if(t&&(t.selectionCount++,void 0!==e)){let i=(t.fragmentSpreads.get(e)??0)+1;t.fragmentSpreads.set(e,i)}}enterFragment(e){this.currentFragment=e}leaveFragment(){this.currentFragment=void 0}enterOperation(e){this.currentOperation=e}leaveOperation(){this.currentOperation=void 0}computeFragmentRecursiveSelectionsCount(e){let t=this.fragmentRecursiveSelectionCount.get(e);if(null===t)return 0;if(void 0!==t)return t;this.fragmentRecursiveSelectionCount.set(e,null);let i=this.fragmentInfo.get(e),n=0;if(i)for(let[e,t]of(n=i.selectionCount,i.fragmentSpreads))n+=t*this.computeFragmentRecursiveSelectionsCount(e);return this.fragmentRecursiveSelectionCount.set(e,n),n}reportError(e){let t=e?`Operation "${e}"`:"Anonymous operation";this.context.reportError(new B.GraphQLError(`${t} recursively requests too many selections.`,{nodes:[],extensions:{validationErrorCode:c.MAX_RECURSIVE_SELECTIONS_EXCEEDED}}))}checkLimitExceeded(){for(let[e,t]of this.operationInfo){let i=t.selectionCount;for(let[e,n]of t.fragmentSpreads)i+=n*this.computeFragmentRecursiveSelectionsCount(e);i>this.selectionCountLimit&&this.reportError(e)}}}function tz(e){return t=>{let i=new tY(e,t);return{Field(){i.processSelection()},InlineFragment(){i.processSelection()},FragmentSpread(e){i.processSelection(e.name.value)},FragmentDefinition:{enter(e){i.enterFragment(e.name.value)},leave(){i.leaveFragment()}},OperationDefinition:{enter(e){i.enterOperation(e.name?.value??null)},leave(){i.leaveOperation()}},Document:{leave(){i.checkLimitExceeded()}}}}}class tX{internals;cache;logger;constructor(e){let t;const i=e.nodeEnv??"production"??"";this.logger=e.logger??function(){let e=e4.default.getLogger("apollo-server");return e.setLevel(e4.default.levels.INFO),e}();const n=function(e,t){let i={},{APOLLO_KEY:n,APOLLO_GRAPH_REF:r,APOLLO_GRAPH_ID:a,APOLLO_GRAPH_VARIANT:s}=process.env;e?.key?i.key=e.key.trim():n&&(i.key=n.trim()),(e?.key??n)!==i.key&&t.warn("The provided API key has unexpected leading or trailing whitespace. Apollo Server will trim the key value before use."),i.key&&function(e){let t=/[^\t\x20-\x7e\x80-\xff]/g;if(t.test(e)){let i=e.match(t);throw Error(`The API key provided to Apollo Server contains characters which are invalid as HTTP header values. The following characters found in the key are invalid: ${i.join(", ")}. Valid header values may only contain ASCII visible characters. If you think there is an issue with your key, please contact Apollo support.`)}}(i.key),i.key&&(i.keyHash=(0,e8.createHash)("sha512").update(i.key).digest("hex")),e?.graphRef?i.graphRef=e.graphRef:r&&(i.graphRef=r);let o=e?.graphId??a,l=e?.graphVariant??s;if(i.graphRef){if(o)throw Error("Cannot specify both graph ref and graph ID. Please use `apollo.graphRef` or `APOLLO_GRAPH_REF` without also setting the graph ID.");if(l)throw Error("Cannot specify both graph ref and graph variant. Please use `apollo.graphRef` or `APOLLO_GRAPH_REF` without also setting the graph variant.")}else o&&(i.graphRef=l?`${o}@${l}`:o);return i}(e.apollo,this.logger);if(e.cache&&"bounded"!==e.cache&&p.PrefixingKeyValueCache.prefixesAreUnnecessaryForIsolation(e.cache))throw Error("You cannot pass a cache returned from `PrefixingKeyValueCache.cacheDangerouslyDoesNotNeedPrefixesForIsolation`to `new ApolloServer({ cache })`, because Apollo Server may use it for multiple features whose cache keys must be distinct from each other.");const r=e.gateway?{phase:"initialized",schemaManager:new tH({gateway:e.gateway,apolloConfig:n,schemaDerivedDataProvider:t=>tX.generateSchemaDerivedData(t,e.documentStore),logger:this.logger})}:{phase:"initialized",schemaManager:new tH({apiSchema:tX.constructSchema(e),schemaDerivedDataProvider:t=>tX.generateSchemaDerivedData(t,e.documentStore),logger:this.logger})},a=e.introspection??"production"!==i,s=e.hideSchemaDetailsFromClientErrors??!1;this.cache=void 0===e.cache||"bounded"===e.cache?new p.InMemoryLRUCache:e.cache;const o=!0===e.maxRecursiveSelections?[tz(1e7)]:"number"==typeof e.maxRecursiveSelections?[tz(e.maxRecursiveSelections)]:[],l=[...a?[]:[tW],...o];o.length>0?t=e.validationRules:l.push(...e.validationRules??[]),this.internals={formatError:e.formatError,rootValue:e.rootValue,validationRules:l,laterValidationRules:t,hideSchemaDetailsFromClientErrors:s,dangerouslyDisableValidation:e.dangerouslyDisableValidation??!1,validationOptions:e.validationOptions??{},fieldResolver:e.fieldResolver,includeStacktraceInErrorResponses:e.includeStacktraceInErrorResponses??("production"!==i&&"test"!==i),persistedQueries:!1===e.persistedQueries?void 0:{...e.persistedQueries,cache:new p.PrefixingKeyValueCache(e.persistedQueries?.cache??this.cache,"apq:")},nodeEnv:i,allowBatchedHttpRequests:e.allowBatchedHttpRequests??!1,apolloConfig:n,plugins:e.plugins??[],parseOptions:e.parseOptions??{},executionOptions:e.executionOptions??{},state:r,stopOnTerminationSignals:e.stopOnTerminationSignals,gatewayExecutor:null,csrfPreventionRequestHeaders:!0===e.csrfPrevention||void 0===e.csrfPrevention?tA:!1===e.csrfPrevention?null:e.csrfPrevention.requestHeaders??tA,status400ForVariableCoercionErrors:e.status400ForVariableCoercionErrors??!0,__testing_incrementalExecutionResults:e.__testing_incrementalExecutionResults,stringifyResult:e.stringifyResult??tg,legacyExperimentalExecuteIncrementally:e.legacyExperimentalExecuteIncrementally},this.warnAgainstDeprecatedConfigOptions(e)}warnAgainstDeprecatedConfigOptions(e){"status400ForVariableCoercionErrors"in e&&(!0===e.status400ForVariableCoercionErrors?this.logger.warn("The `status400ForVariableCoercionErrors: true` configuration option is now the default behavior and has no effect in Apollo Server v5. You can safely remove this option from your configuration."):this.logger.warn("The `status400ForVariableCoercionErrors: false` configuration option is deprecated and will be removed in Apollo Server v6. Apollo recommends removing any dependency on this behavior."))}async start(){return await this._start(!1)}startInBackgroundHandlingStartupErrorsByLoggingAndFailingAllRequests(){this._start(!0).catch(e=>this.logStartupError(e))}async _start(e){if("initialized"!==this.internals.state.phase)throw Error("You should only call 'start()' or 'startInBackgroundHandlingStartupErrorsByLoggingAndFailingAllRequests()' once on your ApolloServer.");let t=this.internals.state.schemaManager,i=e2();this.internals.state={phase:"starting",barrier:i,schemaManager:t,startedInBackground:e};try{await this.addDefaultPlugins();let i=[],n=await t.start();n&&(this.internals.gatewayExecutor=n),i.push(async()=>{await t.stop()});let r=t.getSchemaDerivedData(),a={logger:this.logger,cache:this.cache,schema:r.schema,apollo:this.internals.apolloConfig,startedInBackground:e},s=(await Promise.all(this.internals.plugins.map(async e=>({serverListener:e.serverWillStart&&await e.serverWillStart(a),installedImplicitly:t0(e)&&e.__internal_installed_implicitly__})))).filter(e=>"object"==typeof e.serverListener);s.forEach(({serverListener:{schemaDidLoadOrUpdate:e}})=>{e&&t.onSchemaLoadOrUpdate(e)});let o=s.map(e=>e.serverListener.serverWillStop).filter(tM);o.length&&i.push(async()=>{await Promise.all(o.map(e=>e()))});let l=s.map(e=>e.serverListener.drainServer).filter(tM),u=l.length?async()=>{await Promise.all(l.map(e=>e()))}:null,c=s.filter(e=>e.serverListener.renderLandingPage);c.length>1&&(c=c.filter(e=>!e.installedImplicitly));let d=null;if(c.length>1)throw Error("Only one plugin can implement renderLandingPage.");c.length&&(d=await c[0].serverListener.renderLandingPage());let p=this.maybeRegisterTerminationSignalHandlers(["SIGINT","SIGTERM"],e);this.internals.state={phase:"started",schemaManager:t,drainServers:u,landingPage:d,toDispose:i,toDisposeLast:p}}catch(t){let e=tI(t);try{await Promise.all(this.internals.plugins.map(async t=>t.startupDidFail?.({error:e})))}catch(e){this.logger.error(`startupDidFail hook threw: ${e}`)}throw this.internals.state={phase:"failed to start",error:e},e}finally{i.resolve()}}maybeRegisterTerminationSignalHandlers(e,t){let i=[];if(!1===this.internals.stopOnTerminationSignals||void 0===this.internals.stopOnTerminationSignals&&!(d.isNodeLike&&"test"!==this.internals.nodeEnv&&!t))return i;let n=!1,r=async e=>{if(!n){n=!0;try{await this.stop()}catch(t){this.logger.error(`stop() threw during ${e} shutdown`),this.logger.error(t),process.exit(1)}process.kill(process.pid,e)}};return e.forEach(e=>{process.on(e,r),i.push(async()=>{process.removeListener(e,r)})}),i}async _ensureStarted(){for(;;)switch(this.internals.state.phase){case"initialized":throw Error("You need to call `server.start()` before using your Apollo Server.");case"starting":await this.internals.state.barrier;break;case"failed to start":throw this.logStartupError(this.internals.state.error),Error("This data graph is missing a valid configuration. More details may be available in the server logs.");case"started":case"draining":return this.internals.state;case"stopping":case"stopped":throw this.logger.warn("A GraphQL operation was received during server shutdown. The operation will fail. Consider draining the HTTP server on shutdown; see https://go.apollo.dev/s/drain for details."),Error(`Cannot execute GraphQL operations ${"stopping"===this.internals.state.phase?"while the server is stopping":"after the server has stopped"}.'`);default:throw new tq.UnreachableCaseError(this.internals.state)}}assertStarted(e){if("started"!==this.internals.state.phase&&"draining"!==this.internals.state.phase&&!("starting"===this.internals.state.phase&&this.internals.state.startedInBackground))throw Error("You must `await server.start()` before calling `"+e+"`")}logStartupError(e){this.logger.error("An error occurred during Apollo Server startup. All GraphQL requests will now fail. The startup error was: "+(e?.message||e))}static constructSchema(e){if(e.schema)return e.schema;let{typeDefs:t,resolvers:i}=e;return function({typeDefs:e,resolvers:t={},resolverValidationOptions:i={},inheritResolversFromInterfaces:n=!1,updateResolversInPlace:r=!1,schemaExtensions:a,defaultFieldResolver:s,...o}){let u;if("object"!=typeof i)throw Error("Expected `resolverValidationOptions` to be an object");if(!e)throw Error("Must provide typeDefs");if((0,f.isSchema)(e))u=e;else if(o?.commentDescriptions){let t=e$(e,{...o,commentDescriptions:!0});u=(0,h.buildSchema)(t,o)}else{let t=e$(e,o);u=(0,h.buildASTSchema)(t,o)}if(u=function({schema:e,resolvers:t,defaultFieldResolver:i,resolverValidationOptions:n={},inheritResolversFromInterfaces:r=!1,updateResolversInPlace:a=!1}){var s,o,u;let{requireResolversToMatchSchema:c="error",requireResolversForResolveType:d}=n,p=r?function(e,t){let i={},n=e.getTypeMap();for(let e in n){let r=n[e];if("getInterfaces"in r){for(let n of(i[e]={},r.getInterfaces()))if(t[n.name])for(let r in t[n.name])"__isTypeOf"!==r&&r.startsWith("__")||(i[e][r]=t[n.name][r]);let n=t[e];i[e]={...i[e],...n}}else{let n=t[e];null!=n&&(i[e]=n)}}return i}(e,t):t;for(let t in p){let i=p[t];if("object"!=typeof i)throw Error(`"${t}" defined in resolvers, but has invalid value "${i}". The resolver's value must be of type object.`);let n=e.getType(t);if(null==n){let e=`"${t}" defined in resolvers, but not in schema`;if(c&&"error"!==c){"warn"===c&&console.warn(e);continue}throw Error(e)}if((0,R.isSpecifiedScalarType)(n))for(let e in i)e.startsWith("__")?n[e.substring(2)]=i[e]:n[e]=i[e];else if((0,A.isEnumType)(n)){let e=n.getValues();for(let t in i)if(!t.startsWith("__")&&!e.some(e=>e.name===t)&&c&&"ignore"!==c){let e=`${n.name}.${t} was defined in resolvers, but not present within ${n.name}`;if("error"===c)throw Error(e);console.warn(e)}}else if((0,A.isUnionType)(n)){for(let e in i)if(!e.startsWith("__")&&c&&"ignore"!==c){let t=`${n.name}.${e} was defined in resolvers, but ${n.name} is not an object or interface type`;if("error"===c)throw Error(t);console.warn(t)}}else if((0,A.isObjectType)(n)||(0,A.isInterfaceType)(n)){for(let e in i)if(!e.startsWith("__"))if(null==n.getFields()[e]){if(c&&"ignore"!==c){let i=`${t}.${e} defined in resolvers, but not in schema`;if("error"===c)throw Error(i);console.error(i)}}else{let n=i[e];if("function"!=typeof n&&"object"!=typeof n)throw Error(`Resolver ${t}.${e} must be object or function`)}}}return e=a?function(e,t,i){let n=e.getTypeMap();for(let i in t){let r=e.getType(i),a=t[i];if((0,A.isScalarType)(r))for(let e in a)e.startsWith("__")?r[e.substring(2)]=a[e]:"astNode"===e&&null!=r.astNode?r.astNode={...r.astNode,description:a?.astNode?.description??r.astNode.description,directives:(r.astNode.directives??[]).concat(a?.astNode?.directives??[])}:"extensionASTNodes"===e&&null!=r.extensionASTNodes?r.extensionASTNodes=r.extensionASTNodes.concat(a?.extensionASTNodes??[]):"extensions"===e&&null!=r.extensions&&null!=a.extensions?r.extensions=Object.assign(Object.create(null),r.extensions,a.extensions):r[e]=a[e];else if((0,A.isEnumType)(r)){let e=r.toConfig(),t=e.values;for(let i in a)i.startsWith("__")?e[i.substring(2)]=a[i]:"astNode"===i&&null!=e.astNode?e.astNode={...e.astNode,description:a?.astNode?.description??e.astNode.description,directives:(e.astNode.directives??[]).concat(a?.astNode?.directives??[])}:"extensionASTNodes"===i&&null!=e.extensionASTNodes?e.extensionASTNodes=e.extensionASTNodes.concat(a?.extensionASTNodes??[]):"extensions"===i&&null!=r.extensions&&null!=a.extensions?r.extensions=Object.assign(Object.create(null),r.extensions,a.extensions):t[i]&&(t[i].value=a[i]);n[i]=new A.GraphQLEnumType(e)}else if((0,A.isUnionType)(r))for(let e in a)e.startsWith("__")&&(r[e.substring(2)]=a[e]);else if((0,A.isObjectType)(r)||(0,A.isInterfaceType)(r))for(let e in a){if(e.startsWith("__")){r[e.substring(2)]=a[e];continue}let t=r.getFields()[e];if(null!=t){let i=a[e];"function"==typeof i?t.resolve=i.bind(a):e0(t,i)}}}return ej(e,eK),function(e,t){let i=Object.create(null);for(let t in e){let n=e[t];if(null==n||t.startsWith("__"))continue;let r=n.name;if(!r.startsWith("__")){if(null!=i[r]){console.warn(`Duplicate schema type name ${r} found; keeping the existing one found in the schema`);continue}i[r]=n}}for(let t in i){let n=i[t];e[t]=n}for(let e of t)e.args=e.args.filter(e=>(e.type=a(e.type),null!==e.type));for(let t in e){let s=e[t];!t.startsWith("__")&&t in i&&null!=s&&function(e){if((0,A.isObjectType)(e)){n(e),r(e);return}if((0,A.isInterfaceType)(e)){n(e),"getInterfaces"in e&&r(e);return}if((0,A.isUnionType)(e))return function(e){let t=e.getTypes();t.push(...t.splice(0).map(e=>a(e)).filter(Boolean))}(e);if((0,A.isInputObjectType)(e))return function(e){let t=e.getFields();for(let[e,i]of Object.entries(t))i.type=a(i.type),null===i.type&&delete t[e]}(e);if(!(0,A.isLeafType)(e))throw Error(`Unexpected schema type: ${e}`)}(s)}for(let t in e)t.startsWith("__")||t in i||delete e[t];function n(e){let t=e.getFields();for(let[e,i]of Object.entries(t))i.args.map(e=>(e.type=a(e.type),null===e.type?null:e)).filter(Boolean),i.type=a(i.type),null===i.type&&delete t[e]}function r(e){if("getInterfaces"in e){let t=e.getInterfaces();t.push(...t.splice(0).map(e=>a(e)).filter(Boolean))}}function a(t){if((0,A.isListType)(t)){let e=a(t.ofType);return null!=e?new A.GraphQLList(e):null}if((0,A.isNonNullType)(t)){let e=a(t.ofType);return null!=e?new A.GraphQLNonNull(e):null}if((0,A.isNamedType)(t)){let i=e[t.name];if(i&&t!==i)return i}return t}}(e.getTypeMap(),e.getDirectives()),ej(e,eQ),null!=i&&eV(e,e=>{e.resolve||(e.resolve=i)}),e}(e,p,i):(s=e,o=p,u=i,s=eq(s,{[l.SCALAR_TYPE]:e=>{let t=e.toConfig(),i=o[e.name];if(!(0,R.isSpecifiedScalarType)(e)&&null!=i){for(let n in i)n.startsWith("__")?t[n.substring(2)]=i[n]:"astNode"===n&&null!=t.astNode?t.astNode={...t.astNode,description:i?.astNode?.description??t.astNode.description,directives:(t.astNode.directives??[]).concat(i?.astNode?.directives??[])}:"extensionASTNodes"===n&&null!=t.extensionASTNodes?t.extensionASTNodes=t.extensionASTNodes.concat(i?.extensionASTNodes??[]):"extensions"===n&&null!=t.extensions&&null!=i.extensions?t.extensions=Object.assign(Object.create(null),e.extensions,i.extensions):t[n]=i[n];return new A.GraphQLScalarType(t)}},[l.ENUM_TYPE]:e=>{let t=o[e.name],i=e.toConfig(),n=i.values;if(null!=t){for(let r in t)r.startsWith("__")?i[r.substring(2)]=t[r]:"astNode"===r&&null!=i.astNode?i.astNode={...i.astNode,description:t?.astNode?.description??i.astNode.description,directives:(i.astNode.directives??[]).concat(t?.astNode?.directives??[])}:"extensionASTNodes"===r&&null!=i.extensionASTNodes?i.extensionASTNodes=i.extensionASTNodes.concat(t?.extensionASTNodes??[]):"extensions"===r&&null!=i.extensions&&null!=t.extensions?i.extensions=Object.assign(Object.create(null),e.extensions,t.extensions):n[r]&&(n[r].value=t[r]);return new A.GraphQLEnumType(i)}},[l.UNION_TYPE]:e=>{let t=o[e.name];if(null!=t){let i=e.toConfig();return t.__resolveType&&(i.resolveType=t.__resolveType),new A.GraphQLUnionType(i)}},[l.OBJECT_TYPE]:e=>{let t=o[e.name];if(null!=t){let i=e.toConfig();return t.__isTypeOf&&(i.isTypeOf=t.__isTypeOf),new A.GraphQLObjectType(i)}},[l.INTERFACE_TYPE]:e=>{let t=o[e.name];if(null!=t){let i=e.toConfig();return t.__resolveType&&(i.resolveType=t.__resolveType),new A.GraphQLInterfaceType(i)}},[l.COMPOSITE_FIELD]:(e,t,i)=>{let n=o[i];if(null!=n){let i=n[t];if(null!=i){let t={...e};return"function"==typeof i?t.resolve=i.bind(n):e0(t,i),t}}}}),null!=u&&(s=eq(s,{[l.OBJECT_FIELD]:e=>({...e,resolve:null!=e.resolve?e.resolve:u})})),s),d&&"ignore"!==d&&eq(e,{[l.ABSTRACT_TYPE]:e=>{if(!e.resolveType){let t=`Type "${e.name}" is missing a "__resolveType" resolver. Pass 'ignore' into "resolverValidationOptions.requireResolversForResolveType" to disable this error.`;if("error"===d)throw Error(t);"warn"===d&&console.warn(t)}}}),e}({schema:u,resolvers:I(t),resolverValidationOptions:i,inheritResolversFromInterfaces:n,updateResolversInPlace:r,defaultFieldResolver:s}),Object.keys(i).length>0&&function(e,t={}){let{requireResolversForArgs:i,requireResolversForNonScalar:n,requireResolversForAllFields:r}=t;if(r&&(i||n))throw TypeError("requireResolversForAllFields takes precedence over the more specific assertions. Please configure either requireResolversForAllFields or requireResolversForArgs / requireResolversForNonScalar, but not a combination of them.");eV(e,(e,t,a)=>{r&&e1("requireResolversForAllFields",r,e,t,a),i&&e.args.length>0&&e1("requireResolversForArgs",i,e,t,a),"ignore"===n||(0,A.isScalarType)((0,A.getNamedType)(e.type))||e1("requireResolversForNonScalar",n,e,t,a)})}(u,i),a)for(let e of m(a)){var c=u,d=e;for(let[e,t]of(E(c,d.schemaExtensions),Object.entries(d.types||{}))){let i=c.getType(e);if(i){if(E(i,t.extensions),"object"===t.type||"interface"===t.type)for(let[e,n]of Object.entries(t.fields)){let t=i.getFields()[e];if(t)for(let[e,i]of(E(t,n.extensions),Object.entries(n.arguments)))E(t.args.find(t=>t.name===e),i)}else if("input"===t.type)for(let[e,n]of Object.entries(t.fields))E(i.getFields()[e],n.extensions);else if("enum"===t.type)for(let[e,n]of Object.entries(t.values))E(i.getValue(e),n)}}}return u}({typeDefs:Array.isArray(t)?t:[t],resolvers:i})}static generateSchemaDerivedData(e,t){return(0,e5.assertValidSchema)(e),{schema:e,documentStore:void 0===t?new p.InMemoryLRUCache:t,documentStoreKeyPrefix:t?`${(0,tJ.computeCoreSchemaHash)((0,e3.printSchema)(e))}:`:""}}async stop(){switch(this.internals.state.phase){case"initialized":case"starting":case"failed to start":throw Error("apolloServer.stop() should only be called after `await apolloServer.start()` has succeeded");case"stopped":if(this.internals.state.stopError)throw this.internals.state.stopError;return;case"stopping":case"draining":{await this.internals.state.barrier;let e=this.internals.state;if("stopped"!==e.phase)throw Error(`Surprising post-stopping state ${e.phase}`);if(e.stopError)throw e.stopError;return}case"started":break;default:throw new tq.UnreachableCaseError(this.internals.state)}let e=e2(),{schemaManager:t,drainServers:i,landingPage:n,toDispose:r,toDisposeLast:a}=this.internals.state;this.internals.state={phase:"draining",barrier:e,schemaManager:t,landingPage:n};try{await i?.(),this.internals.state={phase:"stopping",barrier:e},await Promise.all([...r].map(e=>e())),await Promise.all([...a].map(e=>e()))}catch(t){throw this.internals.state={phase:"stopped",stopError:t},e.resolve(),t}this.internals.state={phase:"stopped",stopError:null}}async addDefaultPlugins(){let{plugins:t,apolloConfig:i,nodeEnv:n,hideSchemaDetailsFromClientErrors:r}=this.internals,a=e=>t.some(t=>(0,tD.pluginIsInternal)(t)&&t.__internal_plugin_id__===e),s=new Map;for(let e of t)if((0,tD.pluginIsInternal)(e)){let t=e.__internal_plugin_id__;s.has(t)||s.set(t,{sawDisabled:!1,sawNonDisabled:!1});let i=s.get(t);if(e.__is_disabled_plugin__?i.sawDisabled=!0:i.sawNonDisabled=!0,i.sawDisabled&&i.sawNonDisabled)throw Error(`You have tried to install both ApolloServerPlugin${t} and ApolloServerPlugin${t}Disabled in your server. Please choose whether or not you want to disable the feature and install the appropriate plugin for your use case.`)}if(!a("CacheControl")){let{ApolloServerPluginCacheControl:i}=await e.A(108981);t.push(i())}if(!a("UsageReporting")&&i.key)if(i.graphRef){let{ApolloServerPluginUsageReporting:i}=await e.A(727515);t.unshift(i({__onlyIfSchemaIsNotSubgraph:!0}))}else this.logger.warn("You have specified an Apollo key but have not specified a graph ref; usage reporting is disabled. To enable usage reporting, set the `APOLLO_GRAPH_REF` environment variable to `your-graph-id@your-graph-variant`. To disable this warning, install `ApolloServerPluginUsageReportingDisabled`.");{let n=a("SchemaReporting"),r="true"===process.env.APOLLO_SCHEMA_REPORTING;if(!n&&r)if(i.key){let{ApolloServerPluginSchemaReporting:i}=await e.A(197318);t.push(i())}else throw Error("You've enabled schema reporting by setting the APOLLO_SCHEMA_REPORTING environment variable to true, but you also need to provide your Apollo API key, via the APOLLO_KEY environment variable or via `new ApolloServer({apollo: {key})")}if(!a("InlineTrace")){let{ApolloServerPluginInlineTrace:i}=await e.A(837353);t.push(i({__onlyIfSchemaIsSubgraph:!0}))}if(!a("LandingPageDisabled")){let{ApolloServerPluginLandingPageLocalDefault:i,ApolloServerPluginLandingPageProductionDefault:r}=await e.A(218035),a="production"!==n?i():r();if(!t0(a))throw Error("default landing page plugin should be implicitly installable?");a.__internal_installed_implicitly__=!0,t.push(a)}{let i=a("DisableSuggestions");if(r&&!i){let{ApolloServerPluginDisableSuggestions:i}=await e.A(296341);t.push(i())}}}addPlugin(e){if("initialized"!==this.internals.state.phase)throw Error("Can't add plugins after the server has started");this.internals.plugins.push(e)}async executeHTTPGraphQLRequest({httpGraphQLRequest:e,context:t}){try{let i,n;try{i=await this._ensureStarted()}catch(t){return await this.errorResponse(t,e)}if(i.landingPage&&this.prefersHTML(e)){let t;if("string"==typeof i.landingPage.html)t=i.landingPage.html;else try{t=await i.landingPage.html()}catch(i){let t=tI(i);return this.logger.error(`Landing page \`html\` function threw: ${t}`),await this.errorResponse(t,e)}return{headers:new te([["content-type","text/html"]]),body:{kind:"complete",string:t}}}this.internals.csrfPreventionRequestHeaders&&function(e,t){let i=e.get("content-type");if(void 0!==i){let e=tc.default.parse(i);if(null===e||!tO.includes(e.essence))return}if(!t.some(t=>{let i=e.get(t);return void 0!==i&&i.length>0}))throw new tu(`This operation has been blocked as a potential Cross-Site Request Forgery (CSRF). Please either specify a 'content-type' header (with a type that is not one of ${tO.join(", ")}) or provide a non-empty value for one of the following headers: ${t.join(", ")}
|
|
47
47
|
`)}(e.headers,this.internals.csrfPreventionRequestHeaders);try{n=await t()}catch(i){let t=tI(i);try{await Promise.all(this.internals.plugins.map(async e=>e.contextCreationDidFail?.({error:t})))}catch(e){this.logger.error(`contextCreationDidFail hook threw: ${e}`)}return await this.errorResponse(tb(t,"Context creation failed: "),e)}return await t_(this,e,n,i.schemaManager.getSchemaDerivedData(),this.internals)}catch(t){if(t instanceof B.GraphQLError&&t.extensions.code===u.BAD_REQUEST)try{await Promise.all(this.internals.plugins.map(async e=>e.invalidRequestWasReceived?.({error:t})))}catch(e){this.logger.error(`invalidRequestWasReceived hook threw: ${e}`)}return await this.errorResponse(t,e)}}async errorResponse(e,t){let{formattedErrors:i,httpFromErrors:n}=tE([e],{includeStacktraceInErrorResponses:this.internals.includeStacktraceInErrorResponses,formatError:this.internals.formatError});return{status:n.status??500,headers:new te([...n.headers,["content-type",t2(t)??t1.APPLICATION_JSON]]),body:{kind:"complete",string:await this.internals.stringifyResult({errors:i})}}}prefersHTML(e){let t=e.headers.get("accept");return"GET"===e.method&&!!t&&new e6.default({headers:{accept:t}}).mediaType([t1.APPLICATION_JSON,t1.APPLICATION_GRAPHQL_RESPONSE_JSON,t1.MULTIPART_MIXED_EXPERIMENTAL_ALPHA_2,t1.MULTIPART_MIXED_EXPERIMENTAL_ALPHA_9,t1.MULTIPART_MIXED_NO_DEFER_SPEC,t1.TEXT_HTML])===t1.TEXT_HTML}async executeOperation(e,t={}){"initialized"===this.internals.state.phase&&await this.start();let i=(await this._ensureStarted()).schemaManager.getSchemaDerivedData(),n={...e,query:e.query&&"string"!=typeof e.query?(0,G.print)(e.query):e.query};return await tZ({server:this,graphQLRequest:n,internals:this.internals,schemaDerivedData:i,sharedResponseHTTPGraphQLHead:null},t)}}async function tZ({server:e,graphQLRequest:t,internals:i,schemaDerivedData:n,sharedResponseHTTPGraphQLHead:r},a){var s;let o={logger:e.logger,cache:e.cache,schema:n.schema,request:t,response:{http:r??tT()},contextValue:Object.assign(Object.create(Object.getPrototypeOf(s=a?.contextValue??{})),s),metrics:{},overallCachePolicy:(0,e9.newCachePolicy)(),requestIsBatched:null!==r};try{return await tK(n,e,i,o)}catch(n){let t=tI(n);throw await Promise.all(i.plugins.map(async e=>e.unexpectedErrorProcessingRequest?.({requestContext:o,error:t}))),e.logger.error(`Unexpected error processing request: ${t}`),Error("Internal server error")}}function t0(e){return"__internal_installed_implicitly__"in e}let t1={APPLICATION_JSON:"application/json; charset=utf-8",APPLICATION_JSON_GRAPHQL_CALLBACK:"application/json; callbackSpec=1.0; charset=utf-8",APPLICATION_GRAPHQL_RESPONSE_JSON:"application/graphql-response+json; charset=utf-8",MULTIPART_MIXED_NO_DEFER_SPEC:"multipart/mixed",MULTIPART_MIXED_EXPERIMENTAL_ALPHA_2:"multipart/mixed; deferSpec=20220824",MULTIPART_MIXED_EXPERIMENTAL_ALPHA_9:"multipart/mixed; incrementalSpec=v0.2",TEXT_HTML:"text/html"};function t2(e){if(!e.headers.get("accept"))return t1.APPLICATION_JSON;{let t=new e6.default({headers:{accept:e.headers.get("accept")}}).mediaType([t1.APPLICATION_JSON,t1.APPLICATION_GRAPHQL_RESPONSE_JSON,t1.APPLICATION_JSON_GRAPHQL_CALLBACK]);return t||null}}var t5=e.i(292646),t3=e.i(429630),t4=e.i(779430),t6=new Map,t9=new Map,t8=!0,t7=!1;function ie(e){return e.replace(/[\s,]+/g," ").trim()}function it(e){for(var t=[],i=1;i<arguments.length;i++)t[i-1]=arguments[i];"string"==typeof e&&(e=[e]);var n=e[0];return t.forEach(function(t,i){t&&"Document"===t.kind?n+=t.loc.source.body:n+=t,n+=e[i+1]}),function(e){var t=ie(e);if(!t6.has(t)){var i,n,r,a,s,o=(0,_.parse)(e,{experimentalFragmentVariables:t7,allowLegacyFragmentVariables:t7,experimentalFragmentArguments:t7});if(!o||"Document"!==o.kind)throw Error("Not a valid GraphQL document.");t6.set(t,((a=new Set((i=new Set,n=[],o.definitions.forEach(function(e){if("FragmentDefinition"===e.kind){var t,r=e.name.value,a=ie((t=e.loc).source.body.substring(t.start,t.end)),s=t9.get(r);s&&!s.has(a)?t8&&console.warn("Warning: fragment with name "+r+" already exists.\ngraphql-tag enforces all fragment names across your application to be unique; read more about\nthis in the docs: http://dev.apollodata.com/core/fragments.html#unique-names"):s||t9.set(r,s=new Set),s.add(a),i.has(a)||(i.add(a),n.push(e))}else n.push(e)}),r=(0,t4.__assign)((0,t4.__assign)({},o),{definitions:n})).definitions)).forEach(function(e){e.loc&&delete e.loc,Object.keys(e).forEach(function(t){var i=e[t];i&&"object"==typeof i&&a.add(i)})}),(s=r.loc)&&(delete s.startToken,delete s.endToken),r))}return t6.get(t)}(n)}var ii=it;(s=it||(it={})).gql=ii,s.resetCaches=function(){t6.clear(),t9.clear()},s.disableFragmentWarnings=function(){t8=!1},s.enableExperimentalFragmentVariables=function(){t7=!0},s.disableExperimentalFragmentVariables=function(){t7=!1},it.default=it;let ir=[`scalar JSON
|
|
48
48
|
|
|
49
49
|
enum AgentConnectionStatus {
|
|
@@ -530,6 +530,7 @@ type Build {
|
|
|
530
530
|
artifactDirectory: String!
|
|
531
531
|
errorCode: String
|
|
532
532
|
error: String
|
|
533
|
+
outOfDate: Boolean!
|
|
533
534
|
agent: Agent
|
|
534
535
|
codebase: Codebase
|
|
535
536
|
worktree: Worktree
|
|
@@ -695,6 +696,7 @@ extend type Mutation {
|
|
|
695
696
|
deleteBuildScript(id: ID!): Boolean!
|
|
696
697
|
setCodebaseBuildScripts(codebaseId: ID!, scriptIds: [ID!]!): CodebaseProject!
|
|
697
698
|
startBuild(input: StartBuildInput!): Build!
|
|
699
|
+
rebuildBuild(id: ID!, requestId: ID!): Build!
|
|
698
700
|
cancelBuild(id: ID!): Build!
|
|
699
701
|
deleteBuilds(ids: [ID!]!): Int!
|
|
700
702
|
runBuild(input: RunBuildInput!): [BuildDeployment!]!
|
|
@@ -2300,6 +2302,22 @@ type WorktreeSettings {
|
|
|
2300
2302
|
updatedAt: String!
|
|
2301
2303
|
}
|
|
2302
2304
|
|
|
2305
|
+
type WorktreeLatestBuildArtifact {
|
|
2306
|
+
id: ID!
|
|
2307
|
+
kind: String!
|
|
2308
|
+
}
|
|
2309
|
+
|
|
2310
|
+
type WorktreeLatestBuild {
|
|
2311
|
+
id: ID!
|
|
2312
|
+
status: BuildStatus!
|
|
2313
|
+
action: BuildAction!
|
|
2314
|
+
destinationType: BuildDestinationType!
|
|
2315
|
+
destination: JSON!
|
|
2316
|
+
outOfDate: Boolean!
|
|
2317
|
+
artifacts: [WorktreeLatestBuildArtifact!]!
|
|
2318
|
+
createdAt: String!
|
|
2319
|
+
}
|
|
2320
|
+
|
|
2303
2321
|
type Worktree {
|
|
2304
2322
|
id: ID!
|
|
2305
2323
|
codebaseId: ID!
|
|
@@ -2327,6 +2345,7 @@ type Worktree {
|
|
|
2327
2345
|
ticketTitle: String
|
|
2328
2346
|
ticketStatus: String
|
|
2329
2347
|
pullRequest: GitHubPullRequest
|
|
2348
|
+
latestBuild: WorktreeLatestBuild
|
|
2330
2349
|
tags: [WorktreeTag!]!
|
|
2331
2350
|
activeJob: AgentJob
|
|
2332
2351
|
lastCheckedAt: String
|
|
@@ -2440,6 +2459,7 @@ input WorktreeInventoryInput {
|
|
|
2440
2459
|
primary: Boolean!
|
|
2441
2460
|
branch: String
|
|
2442
2461
|
headSha: String
|
|
2462
|
+
codeStateHash: String
|
|
2443
2463
|
upstream: String
|
|
2444
2464
|
ahead: Int
|
|
2445
2465
|
behind: Int
|
|
@@ -2471,6 +2491,7 @@ input WorktreeActivityReportInput {
|
|
|
2471
2491
|
gitDirectory: String!
|
|
2472
2492
|
branch: String
|
|
2473
2493
|
headSha: String
|
|
2494
|
+
codeStateHash: String
|
|
2474
2495
|
upstream: String
|
|
2475
2496
|
ahead: Int
|
|
2476
2497
|
behind: Int
|
|
@@ -2570,6 +2591,6 @@ extend type Mutation {
|
|
|
2570
2591
|
extend type Subscription {
|
|
2571
2592
|
worktreeOverviewChanged: WorktreeOverviewChange!
|
|
2572
2593
|
worktreeInspectionChanged(worktreeId: ID!): WorktreeActivity!
|
|
2573
|
-
}`];var ia=e.i(971619);e.i(805422);var is=e.i(661983),io=e.i(694355);function il(e){if(!e.agentId)throw Error("Agent authentication is required");return e.agentId}function iu(e){if(e.agentId)throw Error("Agent credentials cannot perform control-plane operations")}function ic(e,t){if(e.agentId&&e.agentId!==t)throw Error("An agent may only read its own resources")}async function id(e,t,i){let n=await t.getJob(i);return n&&ic(e,n.agentId),n}function ip(e){return null===e?null:JSON.parse(e)}let ih=new A.GraphQLScalarType({name:"JSON",description:"A JSON-serializable value.",serialize:e=>e,parseValue:e=>e,parseLiteral:e=>(function e(t){switch(t.kind){case N.Kind.NULL:return null;case N.Kind.STRING:case N.Kind.BOOLEAN:return t.value;case N.Kind.INT:case N.Kind.FLOAT:return Number(t.value);case N.Kind.LIST:return t.values.map(t=>e(t));case N.Kind.OBJECT:return Object.fromEntries(t.fields.map(t=>[t.name.value,e(t.value)]));default:throw Error("Unsupported JSON literal")}})(e)});var im=e.i(735255);let iy={ALL:null,LAST_7_DAYS:7,LAST_30_DAYS:30};function iv(e){if(e.agentId)throw Error("Agent credentials cannot perform control-plane operations")}function ig(e){if(e.agentId)throw Error("Agent credentials cannot perform control-plane operations")}function iT(e){if(e.agentId)throw Error("Agent credentials cannot perform control-plane operations")}e.i(107058);var iS=e.i(112627);function iE(e){if(e.agentId)throw Error("Agent credentials cannot perform control-plane operations")}function iI(e){return{actor:"control-plane",ipAddress:e.ipAddress}}var ib=e.i(184015);function iN(e){if(!e.agentId)throw Error("Agent authentication is required");return e.agentId}function i_(e){if(e.agentId)throw Error("Agent credentials cannot perform control-plane operations")}let iD=e=>e?.toISOString()??null;function iA(e){if(e.agentId)throw Error("Agent credentials cannot perform control-plane operations")}function iO(e){if(!e.agentId)throw Error("Agent authentication is required");return e.agentId}function iR(e){if(e.agentId)throw Error("Agent credentials cannot perform control-plane operations")}let iw=e=>e?.toISOString()??null;var iL=e.i(320058);function iC(e){if(e.agentId)throw Error("Agent credentials cannot perform control-plane operations")}function iF(e){if(e.agentId)throw Error("Agent credentials cannot perform control-plane operations")}function ik(e){if(!e.agentId)throw Error("Agent authentication is required");return e.agentId}let iP=e=>e?.toISOString()??null,ix=(e,t)=>{try{return JSON.parse(e)}catch{return t}},iM=ir.map(e=>it(e));var iU=e.i(887394);let i$=new class{server=null;services=null;schema=null;initPromise=null;async initializeServer(){if(null===this.server)return this.initPromise||(this.initPromise=this.buildServer().finally(()=>{this.initPromise=null})),this.initPromise}async buildServer(){var e,t,i,n,r,a,s,o,l,u,c;let d;this.services=(0,iU.getServerServices)(),this.schema=(e=this.services.prismaService,t=this.services.agentControlService,i=this.services.jiraService,n=this.services.gitHubService,r=this.services.ccusageService,a=this.services.codebasesService,s=this.services.toolsService,o=this.services.worktreesService,l=this.services.buildDataService,u=this.services.skillsService,d=I([{Query:{health:async()=>await e.healthCheck()?"ok":"degraded"}},{JSON:ih,Agent:{capabilities:e=>ip(e.capabilitiesJson),connectionStatus:e=>null!==e.lastSeenAt&&Date.now()-e.lastSeenAt.getTime()<=io.AGENT_ONLINE_WINDOW_MS&&null===e.disconnectedAt?"ONLINE":"OFFLINE",effectiveBuildsDirectory:e=>(0,ia.effectiveBuildsDirectory)(e),lastSeenAt:e=>e.lastSeenAt?.toISOString()??null,disconnectedAt:e=>e.disconnectedAt?.toISOString()??null,createdAt:e=>e.createdAt.toISOString(),updatedAt:e=>e.updatedAt.toISOString()},AgentJob:{payload:e=>ip(e.payloadJson),result:e=>ip(e.resultJson),createdAt:e=>e.createdAt.toISOString(),startedAt:e=>e.startedAt?.toISOString()??null,finishedAt:e=>e.finishedAt?.toISOString()??null,updatedAt:e=>e.updatedAt.toISOString()},AgentJobLog:{createdAt:e=>e.createdAt.toISOString()},AgentEnrollmentToken:{expiresAt:e=>e.expiresAt.toISOString()},Query:{agents:(e,i,n)=>(iu(n),t.listAgents()),agent:(e,{id:i},n)=>(ic(n,i),t.getAgent(i)),agentSelf:(e,i,n)=>{let r=il(n);return t.getAgent(r)},agentJobs:(e,{agentId:i,limit:n},r)=>(ic(r,i),t.listJobs(i,n,!!r.agentId)),agentJob:async(e,{id:i},n)=>id(n,t,i),agentJobLogs:async(e,{jobId:i,afterSequence:n},r)=>(await id(r,t,i),t.listLogs(i,n))},Mutation:{createAgentEnrollmentToken:(e,{expiresInMinutes:i},n)=>(iu(n),t.createEnrollmentToken(i)),enrollAgent:(e,{input:i},n)=>t.enroll({...i,ipAddress:n.ipAddress}),heartbeatAgent:(e,{input:i},n)=>t.heartbeat(il(n),{...i,ipAddress:n.ipAddress}),createAgentJob:(e,{input:i},n)=>(iu(n),t.createJob(i)),claimAgentJob:(e,{jobId:i},n)=>t.claimJob(il(n),i),appendAgentJobLogs:(e,{jobId:i,logs:n},r)=>t.appendLogs(il(r),i,n),completeAgentJob:(e,i,n)=>t.completeJob(il(n),i.jobId,i.status,i.result,i.error??null),cancelAgentJob:(e,{jobId:i},n)=>(iu(n),t.cancelJob(i)),requestAgentCodebaseReconcile:async(e,{agentId:i},n)=>(iu(n),await t.requestCodebaseReconcile([i])===1),updateAgentBaseRepoDirectory:(e,{agentId:i,baseRepoDirectory:n},r)=>(iu(r),t.updateBaseRepoDirectory(i,n??null)),updateAgentBuildsDirectory:(e,{agentId:i,buildsDirectory:n},r)=>(iu(r),t.updateBuildsDirectory(i,n??null)),updateAgentDerivedDataSettings:(e,{agentId:i,input:n},r)=>(iu(r),t.updateDerivedDataSettings(i,n.mode,n.path??null)),deleteAgent:(e,{agentId:i},n)=>(iu(n),t.deleteAgent(i))},Subscription:{agentEvents:{subscribe:(e,{agentId:t},i)=>{if(il(i)!==t)throw Error("An agent may only subscribe to its own events");return is.agentEventBus.iterate((0,is.agentEventsTopic)(t))}},agentChanged:{subscribe:(e,{agentId:t},i)=>(t?ic(i,t):iu(i),is.agentEventBus.iterate(is.AGENT_CHANGED_TOPIC,t?e=>e.agentChanged.id===t:void 0))},agentJobChanged:{subscribe:async(e,{jobId:i},n)=>(await id(n,t,i),is.agentEventBus.iterate((0,is.agentJobChangedTopic)(i)))},agentJobLogAdded:{subscribe:async(e,{jobId:i},n)=>(await id(n,t,i),is.agentEventBus.iterate((0,is.agentJobLogTopic)(i)))}}},{Query:{jiraSettings:(e,t,n)=>(iT(n),i.getSettings()),jiraAvailableProjects:(e,t,n)=>(iT(n),i.availableProjects()),jiraProjects:(e,t,n)=>(iT(n),i.listProjects()),jiraProjectStatuses:(e,{projectId:t},n)=>(iT(n),i.projectStatuses(t)),jiraTicketBoard:(e,{sourceId:t},n)=>(iT(n),i.ticketBoard(t)),jiraTicket:(e,{issueKey:t},n)=>(iT(n),i.ticket(t)),jiraAssignableUsers:(e,{issueKey:t,query:n},r)=>(iT(r),i.assignableUsers(t,n)),jiraTicketTransitions:(e,{issueKey:t},n)=>(iT(n),i.ticketTransitions(t)),jiraTicketEditFields:(e,{issueKey:t},n)=>(iT(n),i.ticketEditFields(t)),jiraTicketChanges:(e,{issueKey:t,limit:n,offset:r},a)=>(iT(a),i.ticketChanges(t,n,r)),jiraTicketWorklogs:(e,{issueKey:t,limit:n,offset:r},a)=>(iT(a),i.ticketWorklogs(t,n,r)),jiraCacheMetrics:(e,t,n)=>(iT(n),i.cacheMetrics()),jiraApiCalls:(e,{limit:t,offset:n},r)=>(iT(r),i.listApiCalls(t,n)),jiraCachedTickets:(e,{limit:t,offset:n},r)=>(iT(r),i.listCachedTickets(t,n)),jiraCachedTicket:(e,{issueKey:t},n)=>(iT(n),i.cachedTicket(t))},Mutation:{saveJiraSettings:(e,{input:t},n)=>(iT(n),i.saveSettings(t)),testJiraConnection:(e,t,n)=>(iT(n),i.testConnection()),clearJiraCredentials:(e,t,n)=>(iT(n),i.clearCredentials()),addJiraProject:(e,{jiraId:t},n)=>(iT(n),i.addProject(t)),removeJiraProject:(e,{projectId:t},n)=>(iT(n),i.removeProject(t)),createJiraSource:(e,{input:t},n)=>(iT(n),i.createSource(t)),updateJiraSource:(e,{input:t},n)=>(iT(n),i.updateSource(t)),deleteJiraSource:(e,{id:t},n)=>(iT(n),i.deleteSource(t)),updateJiraProjectDisplaySettings:(e,{input:t},n)=>(iT(n),i.updateProjectDisplaySettings(t)),updateJiraProjectBranchNaming:(e,{projectId:t,branchNamingScript:n},r)=>(iT(r),i.updateProjectBranchNaming(t,n)),refreshJiraSource:(e,{sourceId:t},n)=>(iT(n),i.ticketBoard(t,!0)),updateJiraCacheTtl:(e,{ttlMinutes:t},n)=>(iT(n),i.updateCacheTtl(t)),clearJiraCache:(e,t,n)=>(iT(n),i.clearCache()),refreshJiraCachedTicket:(e,{issueKey:t},n)=>(iT(n),i.refreshCachedTicket(t)),deleteJiraCachedTicket:(e,{issueKey:t},n)=>(iT(n),i.deleteCachedTicket(t)),addJiraComment:(e,{issueKey:t,content:n},r)=>(iT(r),i.addComment(t,n)),assignJiraTicket:(e,{issueKey:t,accountId:n},r)=>(iT(r),i.assignTicket(t,n??null)),transitionJiraTicket:(e,{issueKey:t,transitionId:n},r)=>(iT(r),i.transitionTicket(t,n)),updateJiraTicket:(e,{input:t},n)=>(iT(n),i.updateTicket(t))}},{Query:{githubSettings:(e,t,i)=>(iE(i),n.getSettings()),githubAppSettings:(e,t,i)=>(iE(i),n.getAppSettings()),githubRepositories:(e,t,i)=>(iE(i),n.listRepositories()),githubAvailableRepositories:(e,{after:t},i)=>(iE(i),n.availableRepositories(t)),githubActionsWorkflowRuns:(e,{codebaseRepositoryId:t,first:i,after:r},a)=>(iE(a),n.actionsWorkflowRuns(t,i??25,r)),githubActionsWorkflowJobs:(e,{codebaseRepositoryId:t,workflowRunId:i},r)=>(iE(r),n.actionsWorkflowJobs(t,i)),githubPullRequests:(e,{scope:t,repositoryId:i,state:r,first:a,after:s},o,l)=>(iE(o),n.pullRequests(t,i,{includePipelineJobs:!!l?.fieldNodes.some(e=>!!e.selectionSet&&function e(t,i,n,r=new Set){for(let a of t.selections)if("Field"===a.kind){if(a.name.value===i||a.selectionSet&&e(a.selectionSet,i,n,r))return!0}else if("InlineFragment"===a.kind){if(e(a.selectionSet,i,n,r))return!0}else if(!r.has(a.name.value)){r.add(a.name.value);let t=n.fragments[a.name.value];if(t&&e(t.selectionSet,i,n,r))return!0}return!1}(e.selectionSet,"jobs",l)),state:r??"OPEN",first:a??25,after:s})),githubPullRequest:(e,{owner:t,name:i,number:r},a)=>(iE(a),n.pullRequest(t,i,r)),githubPullRequestMergeOptions:(e,{owner:t,name:i,number:r},a)=>(iE(a),n.pullRequestMergeOptions(t,i,r)),githubReviewThreads:(e,t,i)=>(iE(i),n.reviewThreads())},Mutation:{saveGitHubSettings:(e,{input:t},i)=>(iE(i),n.saveSettings(t)),saveGitHubAppSettings:(e,{input:t},i)=>(iE(i),n.saveAppSettings(t,iI(i))),testGitHubConnection:(e,t,i)=>(iE(i),n.testConnection()),testGitHubAppConnection:(e,t,i)=>(iE(i),n.testAppConnection(iI(i))),clearGitHubCredentials:(e,t,i)=>(iE(i),n.clearCredentials()),clearGitHubAppCredentials:(e,t,i)=>(iE(i),n.clearAppCredentials(iI(i))),addGitHubRepository:(e,{input:t},i)=>(iE(i),n.addRepository(t)),updateGitHubRepository:(e,{input:t},i)=>(iE(i),n.updateRepository(t)),removeGitHubRepository:(e,{id:t},i)=>(iE(i),n.removeRepository(t)),mergeGitHubPullRequest:async(e,{input:t},i)=>{iE(i);let r=await n.mergePullRequest(t),{owner:a,name:s}=(0,iS.normalizeGitHubRepositoryName)(`${t.owner}/${t.name}`);return o.invalidatePullRequestsForOrigin(`github.com/${a}/${s}`),r},retryGitHubPipeline:(e,{repositoryId:t,checkSuiteId:i},r)=>(iE(r),n.retryPipeline(t,i,iI(r))),retryGitHubWorkflowJob:(e,{repositoryId:t,checkSuiteId:i,jobId:r},a)=>(iE(a),n.retryWorkflowJob(t,i,r,iI(a))),replyToGitHubReviewThread:(e,{threadId:t,body:i},r)=>(iE(r),n.replyToReviewThread(t,i)),setGitHubReviewThreadResolved:(e,{threadId:t,resolved:i},r)=>(iE(r),n.setReviewThreadResolved(t,i))}},{CcusageCollection:{aggregate:(e,{range:t="ALL"})=>(0,im.filterUsageByDays)(e.aggregate,iy[t])},CcusageModelUsage:{unattributed:e=>e.unattributed??!1},Query:{ccusageCollection:async(e,{id:t},i)=>(iv(i),await r.initialize(),r.getCollection(t))},Mutation:{collectCcusage:async(e,{requestId:t},i)=>(iv(i),await r.initialize(),r.collect(t))},Subscription:{ccusageCollectionChanged:{subscribe:async(e,{id:t},i)=>(iv(i),await r.initialize(),r.subscribe(t)),resolve:e=>e}}},{DerivedDataDeletionHistory:{deletedAt:e=>e.deletedAt.toISOString()},Query:{derivedDataCollection:(e,{id:t},i)=>(ig(i),l.getCollection(t)),derivedDataDeletionHistory:(e,{first:t,after:i},n)=>(ig(n),l.history(t,i))},Mutation:{refreshDerivedData:(e,{requestId:t},i)=>(ig(i),l.refresh(t)),calculateDerivedDataSizes:(e,{collectionId:t,entryIds:i,requestId:n},r)=>(ig(r),l.calculateSizes(t,i,n)),deleteDerivedDataEntries:(e,{collectionId:t,entryIds:i,requestId:n},r)=>(ig(r),l.deleteEntries(t,i,n)),clearDerivedDataDeletionHistory:(e,t,i)=>(ig(i),l.clearHistory())},Subscription:{derivedDataCollectionChanged:{subscribe:(e,{id:t},i)=>(ig(i),l.subscribe(t)),resolve:e=>e}}},{CodebaseOverview:{repositories:e=>Array.isArray(e)?e:e.repositories??[]},CodebaseRepository:{createdAt:e=>e.createdAt.toISOString(),updatedAt:e=>e.updatedAt.toISOString()},CodebaseSettings:{updatedAt:e=>e.updatedAt.toISOString()},Codebase:{lastCheckedAt:e=>iD(e.lastCheckedAt),lastFetchedAt:e=>iD(e.lastFetchedAt),lastFetchAttemptAt:e=>iD(e.lastFetchAttemptAt),localBranches:e=>{try{let t=JSON.parse(e.localBranchesJson);return Array.isArray(t)?t.filter(e=>"string"==typeof e):[]}catch{return[]}},remoteBranches:e=>{try{let t=JSON.parse(e.remoteBranchesJson);return Array.isArray(t)?t.filter(e=>"string"==typeof e):[]}catch{return[]}},createdAt:e=>e.createdAt.toISOString(),updatedAt:e=>e.updatedAt.toISOString(),activeJob:e=>e.jobs?.[0]??null},AgentCodebaseRegistration:{canonicalOrigin:e=>e.repository.canonicalOrigin,keepBaseBranchUpToDate:e=>e.repository.keepBaseBranchUpToDate,worktrees:e=>e.worktrees??[],lastFetchedAt:e=>iD(e.lastFetchedAt),lastFetchAttemptAt:e=>iD(e.lastFetchAttemptAt)},Query:{codebaseOverview:async(e,t,i)=>(i_(i),a.overview()),codebaseRepository:(e,{id:t},i)=>(i_(i),a.repositoryDetail(t)),codebase:(e,{id:t},i)=>(i_(i),a.detail(t)),codebaseSettings:(e,t,i)=>(i_(i),a.settings()),agentCodebases:(e,t,i)=>a.agentCodebases(iN(i)),agentCodebaseConfiguration:(e,t,i)=>a.agentConfiguration(iN(i))},Mutation:{browseAgentDirectory:(e,{input:t},i)=>(i_(i),a.browse(t.agentId,t.path??null,t.requestId)),inspectAgentCodebase:(e,{input:t},i)=>(i_(i),a.inspect(t.agentId,t.folder,t.requestId)),confirmCodebase:(e,{input:t},i)=>(i_(i),a.confirm(t)),updateCodebaseRepository:(e,{input:t},i)=>(i_(i),a.updateRepository(t.id,t.name,t.description,t.jiraBranchRegex,t.keepBaseBranchUpToDate,t.skillGroupIds)),updateCodebaseSettings:(e,{input:t},i)=>(i_(i),a.updateSettings(t)),removeCodebase:(e,{id:t},i)=>(i_(i),a.removeCodebase(t)),refreshCodebases:(e,{input:t},i)=>(i_(i),a.runOperation(ib.CODEBASE_REFRESH_JOB_KIND,t.codebaseIds,t.requestId)),fetchCodebases:(e,{input:t},i)=>(i_(i),a.runOperation(ib.CODEBASE_FETCH_JOB_KIND,t.codebaseIds,t.requestId)),inspectCodebaseGitState:(e,{input:t},i)=>(i_(i),a.inspectGitState(t.codebaseId,t.requestId)),inspectCodebaseStash:(e,{input:t},i)=>(i_(i),a.inspectStash(t.codebaseId,t.stashOid,t.requestId)),runCodebaseGitOperation:(e,{input:t},i)=>(i_(i),a.runGitOperation(t)),reportCodebaseStatuses:(e,{reports:t},i)=>a.report(iN(i),t)},Subscription:{codebaseOverviewChanged:{subscribe:(e,t,i)=>(i_(i),a.subscribe())}}},{Query:{externalMcpServers:(e,t,i)=>(iA(i),s.externalServers())},Mutation:{createExternalMcpServer:(e,{input:t},i)=>(iA(i),s.createExternalServer(t)),updateExternalMcpServer:(e,{id:t,input:i},n)=>(iA(n),s.updateExternalServer(t,i)),deleteExternalMcpServer:(e,{id:t},i)=>(iA(i),s.deleteExternalServer(t))}},{Worktree:{lastCheckedAt:e=>iw(e.lastCheckedAt),missingAt:e=>iw(e.missingAt),createdAt:e=>e.createdAt.toISOString(),updatedAt:e=>e.updatedAt.toISOString()},WorktreeTag:{createdAt:e=>e.createdAt.toISOString(),updatedAt:e=>e.updatedAt.toISOString()},WorktreeSettings:{updatedAt:e=>e.updatedAt.toISOString()},WorktreeMove:{createdAt:e=>e.createdAt.toISOString(),updatedAt:e=>e.updatedAt.toISOString(),finishedAt:e=>iw(e.finishedAt)},Query:{worktreeOverview:(e,t,i)=>(iR(i),o.overview()),hiddenWorktrees:(e,t,i)=>(iR(i),o.hidden()),worktreeSettings:(e,t,i)=>(iR(i),o.settings()),previewWorktreeTicketBranch:(e,{input:t},i)=>(iR(i),o.previewTicketBranch(t)),worktreeMove:(e,{id:t},i)=>(iR(i),o.getMove(t))},Mutation:{refreshWorktrees:(e,t,i)=>(iR(i),o.requestRefresh()),reportWorktrees:(e,{reports:t},i)=>o.report(iO(i),t),reportWorktreeActivity:(e,{input:t},i)=>o.reportActivity(iO(i),t),inspectWorktree:(e,{id:t,requestId:i},n)=>(iR(n),o.inspect(t,i)),runWorktreeOperation:(e,{input:t},i)=>(iR(i),o.runOperation(t.worktreeId,t.operation,t.requestId)),createWorktree:(e,{input:t},i)=>(iR(i),o.createWorktree(t)),changeWorktreeBranch:(e,{input:t},i)=>(iR(i),o.changeWorktreeBranch(t)),moveWorktree:(e,{input:t},i)=>(iR(i),o.moveWorktree(t)),retryWorktreeMoveWithStash:(e,{id:t},i)=>(iR(i),o.retryWorktreeMoveWithStash(t)),cancelWorktreeMove:(e,{id:t},i)=>(iR(i),o.cancelWorktreeMove(t)),deleteWorktree:(e,{input:t},i)=>(iR(i),o.deleteWorktree(t)),updateWorktreeBaseBranch:(e,{id:t,baseBranch:i},n)=>(iR(n),o.updateBaseBranch(t,i??null)),updateWorktreeHighlight:(e,{id:t,color:i},n)=>(iR(n),o.updateHighlight(t,i??null)),setWorktreeTags:(e,{id:t,tagIds:i},n)=>(iR(n),o.setTags(t,i)),saveWorktreeTag:(e,{input:t},i)=>(iR(i),o.saveTag(t)),deleteWorktreeTag:(e,{id:t},i)=>(iR(i),o.deleteTag(t)),saveWorktreeSettings:(e,{editorVariant:t},i)=>(iR(i),o.saveSettings(t)),purgeHiddenWorktree:(e,{id:t},i)=>(iR(i),o.purge(t)),purgeAllHiddenWorktrees:(e,t,i)=>(iR(i),o.purgeAll())},Subscription:{worktreeOverviewChanged:{subscribe:(e,t,i)=>(iR(i),o.subscribe())},worktreeInspectionChanged:{subscribe:(e,{worktreeId:t},i)=>(iR(i),o.subscribeInspection(t))}}},{CodebaseRepository:{skillGroups:e=>u.groupsForRepository(e.id)},Skill:{groups:e=>e.groups?.map(e=>e.group)??[],createdAt:e=>e.createdAt.toISOString(),updatedAt:e=>e.updatedAt.toISOString()},SkillFile:{contentsBase64:e=>Buffer.from(e.contents).toString("base64"),createdAt:e=>e.createdAt.toISOString(),updatedAt:e=>e.updatedAt.toISOString()},SkillGroup:{skills:e=>e.skills?.map(e=>e.skill)??[],repositories:e=>e.repositories?.map(e=>e.repository)??[],createdAt:e=>e.createdAt.toISOString(),updatedAt:e=>e.updatedAt.toISOString()},SkillSettings:{updatedAt:e=>e.updatedAt.toISOString()},SkillToolObservation:{checkedAt:e=>e.checkedAt.toISOString()},SkillInstallation:{consumers:e=>{try{return JSON.parse(e.consumersJson)}catch{return[]}},lastSeenAt:e=>e.lastSeenAt.toISOString()},SkillSyncItem:{candidatePackage:e=>{try{return e.candidatePackageJson?JSON.parse(e.candidatePackageJson):null}catch{return null}},createdAt:e=>e.createdAt.toISOString(),updatedAt:e=>e.updatedAt.toISOString()},SkillSyncRun:{createdAt:e=>e.createdAt.toISOString(),updatedAt:e=>e.updatedAt.toISOString(),finishedAt:e=>{let t;return t=e.finishedAt,t?.toISOString()??null}},Query:{skillsOverview:(e,{search:t},i)=>(iC(i),u.overview(t??"")),skill:(e,{id:t},i)=>(iC(i),u.getSkill(t)),skillSyncRun:(e,{id:t},i)=>(iC(i),u.getRun(t))},Mutation:{saveSkill:(e,{input:t},i)=>(iC(i),u.saveSkill(t)),deleteSkill:(e,{id:t},i)=>(iC(i),u.deleteSkill(t)),saveSkillGroup:(e,{input:t},i)=>(iC(i),u.saveGroup(t)),deleteSkillGroup:(e,{id:t},i)=>(iC(i),u.deleteGroup(t)),saveSkillSettings:(e,{input:t},i)=>(iC(i),u.saveSettings(t)),prepareSkillSync:(e,{kind:t,groupId:i},n)=>(iC(n),u.prepareSync(t,i??null)),skipPendingSkillSync:(e,{runId:t},i)=>(iC(i),u.skipPending(t)),resolveSkillSyncItem:(e,{input:t},i)=>{var n;return iC(i),u.resolveItem({...t,package:t.package?(n=t.package,(0,iL.parseSkillPackage)({...n,packageHash:n.packageHash||(0,iL.hashSkillFiles)(n.files)})):null})},applySkillSync:(e,{runId:t},i)=>(iC(i),u.applyRun(t))},Subscription:{skillsChanged:{subscribe:(e,t,i)=>(iC(i),u.subscribe()),resolve:()=>u.overview()},skillSyncRunChanged:{subscribe:(e,{runId:t},i)=>(iC(i),u.subscribeRun(t)),resolve:(e,{runId:t})=>u.getRun(t)}}},(c=this.services.buildsService,{CodebaseProject:{createdAt:e=>e.createdAt.toISOString(),updatedAt:e=>e.updatedAt.toISOString()},BuildConfiguration:{advancedSettings:e=>ix(e.advancedSettingsJson,{}),observation:e=>e.source?.observations?.[0]??null,createdAt:e=>e.createdAt.toISOString(),updatedAt:e=>e.updatedAt.toISOString()},BuildSourceObservation:{schemes:e=>ix(e.schemesJson,[]),configurations:e=>ix(e.configurationsJson,[]),testPlans:e=>ix(e.testPlansJson,[]),lastParseAttemptAt:e=>e.lastParseAttemptAt.toISOString(),lastParsedAt:e=>iP(e.lastParsedAt)},BuildScript:{createdAt:e=>e.createdAt.toISOString(),updatedAt:e=>e.updatedAt.toISOString()},BuildArtifact:{metadata:e=>ix(e.metadataJson,{}),createdAt:e=>e.createdAt.toISOString()},BuildDeployment:{destination:e=>ix(e.destinationJson,{}),createdAt:e=>e.createdAt.toISOString(),startedAt:e=>iP(e.startedAt),finishedAt:e=>iP(e.finishedAt)},BuildExport:{settings:e=>ix(e.settingsSnapshotJson,{}),createdAt:e=>e.createdAt.toISOString(),startedAt:e=>iP(e.startedAt),finishedAt:e=>iP(e.finishedAt)},Build:{destination:e=>ix(e.destinationJson,{}),snapshot:e=>ix(e.snapshotJson,{}),createdAt:e=>e.createdAt.toISOString(),startedAt:e=>iP(e.startedAt),finishedAt:e=>iP(e.finishedAt),updatedAt:e=>e.updatedAt.toISOString(),durationMs:e=>e.startedAt&&e.finishedAt?Math.max(0,e.finishedAt.getTime()-e.startedAt.getTime()):null},BuildLogEvent:{createdAt:e=>e.createdAt instanceof Date?e.createdAt.toISOString():e.createdAt},Query:{iosAppProject:(e,{codebaseId:t},i)=>(iF(i),c.project(t)),buildScripts:(e,t,i)=>(iF(i),c.scripts()),builds:(e,t,i)=>(iF(i),c.builds(t)),build:(e,{id:t},i)=>(iF(i),c.getBuild(t)),buildLogs:(e,t,i)=>(iF(i),c.logs(t.buildId,t.after,t.first))},Mutation:{createIosAppProject:(e,{codebaseId:t},i)=>(iF(i),c.createProject(t)),saveBuildConfiguration:(e,{input:t},i)=>(iF(i),c.saveConfiguration(t)),deleteBuildConfiguration:(e,{id:t},i)=>(iF(i),c.deleteConfiguration(t)),discoverBuildSources:(e,t,i)=>(iF(i),c.discoverSources(t.worktreeId,t.requestId)),inspectBuildSource:(e,{input:t},i)=>(iF(i),c.inspectSource(t)),reparseBuildConfiguration:(e,t,i)=>(iF(i),c.reparse(t.configurationId,t.worktreeId,t.requestId)),inspectBuildDestinations:(e,{input:t},i)=>(iF(i),c.destinations(t)),inspectBuildRunDestinations:(e,t,i)=>(iF(i),c.destinationsForBuild(t.buildId,t.requestId)),saveBuildScript:(e,{input:t},i)=>(iF(i),c.saveScript(t)),deleteBuildScript:(e,{id:t},i)=>(iF(i),c.deleteScript(t)),setCodebaseBuildScripts:(e,t,i)=>(iF(i),c.setAllowedScripts(t.codebaseId,t.scriptIds)),startBuild:(e,{input:t},i)=>(iF(i),c.startBuild(t)),cancelBuild:(e,{id:t},i)=>(iF(i),c.cancelBuild(t)),deleteBuilds:(e,{ids:t},i)=>(iF(i),c.deleteBuilds(t)),runBuild:(e,{input:t},i)=>(iF(i),c.runBuild(t)),exportBuildArchive:(e,{input:t},i)=>(iF(i),c.exportArchive(t)),reportBuildProgress:(e,{input:t},i)=>c.reportProgress(ik(i),t),appendBuildLogEvents:(e,{buildId:t,events:i},n)=>c.appendLogs(ik(n),t,i)},Subscription:{buildsChanged:{subscribe:(e,t,i)=>(iF(i),is.agentEventBus.iterate(is.BUILDS_CHANGED_TOPIC))},buildChanged:{subscribe:(e,{id:t},i)=>(iF(i),is.agentEventBus.iterate((0,is.buildTopic)(t)))},buildLogAdded:{subscribe:(e,{buildId:t},i)=>(iF(i),is.agentEventBus.iterate((0,is.buildLogTopic)(t)))}}})]),(0,t3.buildSubgraphSchema)({typeDefs:iM,resolvers:d}));let p="true"===process.env.APOLLO_SANDBOX;this.server=new tX({schema:this.schema,introspection:p,plugins:p?[(0,t5.ApolloServerPluginLandingPageLocalDefault)({footer:!1})]:[(0,t5.ApolloServerPluginLandingPageProductionDefault)({footer:!1})]})}async createContext(e=new Headers){let t;if(await this.initializeServer(),!this.services)throw Error("GraphQL services not initialized");let i=function(e){if(e instanceof Headers)return e;let t=new Headers;for(let[i,n]of Object.entries(e))Array.isArray(n)?t.set(i,n.join(", ")):void 0!==n&&t.set(i,n);return t}(e),n=await this.services.agentControlService.authenticate((t=i.get("authorization"),!t?.startsWith("Bearer ")?null:t.slice(7).trim()||null));return{prismaService:this.services.prismaService,agentControlService:this.services.agentControlService,agentId:n,ipAddress:i.get("x-forwarded-for")?.split(",")[0]?.trim()||null}}async getSchema(){if(await this.initializeServer(),!this.schema)throw Error("GraphQL schema not properly initialized");return this.schema}async getServer(){if(await this.initializeServer(),!this.server)throw Error("GraphQL server not properly initialized");return this.server}};e.s(["SharedGraphQLServerService",0,i$],379993)}];
|
|
2594
|
+
}`];var ia=e.i(971619);e.i(805422);var is=e.i(661983),io=e.i(694355);function il(e){if(!e.agentId)throw Error("Agent authentication is required");return e.agentId}function iu(e){if(e.agentId)throw Error("Agent credentials cannot perform control-plane operations")}function ic(e,t){if(e.agentId&&e.agentId!==t)throw Error("An agent may only read its own resources")}async function id(e,t,i){let n=await t.getJob(i);return n&&ic(e,n.agentId),n}function ip(e){return null===e?null:JSON.parse(e)}let ih=new A.GraphQLScalarType({name:"JSON",description:"A JSON-serializable value.",serialize:e=>e,parseValue:e=>e,parseLiteral:e=>(function e(t){switch(t.kind){case N.Kind.NULL:return null;case N.Kind.STRING:case N.Kind.BOOLEAN:return t.value;case N.Kind.INT:case N.Kind.FLOAT:return Number(t.value);case N.Kind.LIST:return t.values.map(t=>e(t));case N.Kind.OBJECT:return Object.fromEntries(t.fields.map(t=>[t.name.value,e(t.value)]));default:throw Error("Unsupported JSON literal")}})(e)});var im=e.i(735255);let iy={ALL:null,LAST_7_DAYS:7,LAST_30_DAYS:30};function iv(e){if(e.agentId)throw Error("Agent credentials cannot perform control-plane operations")}function ig(e){if(e.agentId)throw Error("Agent credentials cannot perform control-plane operations")}function iT(e){if(e.agentId)throw Error("Agent credentials cannot perform control-plane operations")}e.i(107058);var iS=e.i(112627);function iE(e){if(e.agentId)throw Error("Agent credentials cannot perform control-plane operations")}function iI(e){return{actor:"control-plane",ipAddress:e.ipAddress}}var ib=e.i(184015);function iN(e){if(!e.agentId)throw Error("Agent authentication is required");return e.agentId}function i_(e){if(e.agentId)throw Error("Agent credentials cannot perform control-plane operations")}let iD=e=>e?.toISOString()??null;function iA(e){if(e.agentId)throw Error("Agent credentials cannot perform control-plane operations")}function iO(e){if(!e.agentId)throw Error("Agent authentication is required");return e.agentId}function iR(e){if(e.agentId)throw Error("Agent credentials cannot perform control-plane operations")}let iw=e=>e?.toISOString()??null;var iL=e.i(320058);function iC(e){if(e.agentId)throw Error("Agent credentials cannot perform control-plane operations")}var iF=e.i(984179);function ik(e){if(e.agentId)throw Error("Agent credentials cannot perform control-plane operations")}function iP(e){if(!e.agentId)throw Error("Agent authentication is required");return e.agentId}let ix=e=>e?.toISOString()??null,iM=(e,t)=>{try{return JSON.parse(e)}catch{return t}},iU=ir.map(e=>it(e));var i$=e.i(887394);let ij=new class{server=null;services=null;schema=null;initPromise=null;async initializeServer(){if(null===this.server)return this.initPromise||(this.initPromise=this.buildServer().finally(()=>{this.initPromise=null})),this.initPromise}async buildServer(){var e,t,i,n,r,a,s,o,l,u,c;let d;this.services=(0,i$.getServerServices)(),this.schema=(e=this.services.prismaService,t=this.services.agentControlService,i=this.services.jiraService,n=this.services.gitHubService,r=this.services.ccusageService,a=this.services.codebasesService,s=this.services.toolsService,o=this.services.worktreesService,l=this.services.buildDataService,u=this.services.skillsService,d=I([{Query:{health:async()=>await e.healthCheck()?"ok":"degraded"}},{JSON:ih,Agent:{capabilities:e=>ip(e.capabilitiesJson),connectionStatus:e=>null!==e.lastSeenAt&&Date.now()-e.lastSeenAt.getTime()<=io.AGENT_ONLINE_WINDOW_MS&&null===e.disconnectedAt?"ONLINE":"OFFLINE",effectiveBuildsDirectory:e=>(0,ia.effectiveBuildsDirectory)(e),lastSeenAt:e=>e.lastSeenAt?.toISOString()??null,disconnectedAt:e=>e.disconnectedAt?.toISOString()??null,createdAt:e=>e.createdAt.toISOString(),updatedAt:e=>e.updatedAt.toISOString()},AgentJob:{payload:e=>ip(e.payloadJson),result:e=>ip(e.resultJson),createdAt:e=>e.createdAt.toISOString(),startedAt:e=>e.startedAt?.toISOString()??null,finishedAt:e=>e.finishedAt?.toISOString()??null,updatedAt:e=>e.updatedAt.toISOString()},AgentJobLog:{createdAt:e=>e.createdAt.toISOString()},AgentEnrollmentToken:{expiresAt:e=>e.expiresAt.toISOString()},Query:{agents:(e,i,n)=>(iu(n),t.listAgents()),agent:(e,{id:i},n)=>(ic(n,i),t.getAgent(i)),agentSelf:(e,i,n)=>{let r=il(n);return t.getAgent(r)},agentJobs:(e,{agentId:i,limit:n},r)=>(ic(r,i),t.listJobs(i,n,!!r.agentId)),agentJob:async(e,{id:i},n)=>id(n,t,i),agentJobLogs:async(e,{jobId:i,afterSequence:n},r)=>(await id(r,t,i),t.listLogs(i,n))},Mutation:{createAgentEnrollmentToken:(e,{expiresInMinutes:i},n)=>(iu(n),t.createEnrollmentToken(i)),enrollAgent:(e,{input:i},n)=>t.enroll({...i,ipAddress:n.ipAddress}),heartbeatAgent:(e,{input:i},n)=>t.heartbeat(il(n),{...i,ipAddress:n.ipAddress}),createAgentJob:(e,{input:i},n)=>(iu(n),t.createJob(i)),claimAgentJob:(e,{jobId:i},n)=>t.claimJob(il(n),i),appendAgentJobLogs:(e,{jobId:i,logs:n},r)=>t.appendLogs(il(r),i,n),completeAgentJob:(e,i,n)=>t.completeJob(il(n),i.jobId,i.status,i.result,i.error??null),cancelAgentJob:(e,{jobId:i},n)=>(iu(n),t.cancelJob(i)),requestAgentCodebaseReconcile:async(e,{agentId:i},n)=>(iu(n),await t.requestCodebaseReconcile([i])===1),updateAgentBaseRepoDirectory:(e,{agentId:i,baseRepoDirectory:n},r)=>(iu(r),t.updateBaseRepoDirectory(i,n??null)),updateAgentBuildsDirectory:(e,{agentId:i,buildsDirectory:n},r)=>(iu(r),t.updateBuildsDirectory(i,n??null)),updateAgentDerivedDataSettings:(e,{agentId:i,input:n},r)=>(iu(r),t.updateDerivedDataSettings(i,n.mode,n.path??null)),deleteAgent:(e,{agentId:i},n)=>(iu(n),t.deleteAgent(i))},Subscription:{agentEvents:{subscribe:(e,{agentId:t},i)=>{if(il(i)!==t)throw Error("An agent may only subscribe to its own events");return is.agentEventBus.iterate((0,is.agentEventsTopic)(t))}},agentChanged:{subscribe:(e,{agentId:t},i)=>(t?ic(i,t):iu(i),is.agentEventBus.iterate(is.AGENT_CHANGED_TOPIC,t?e=>e.agentChanged.id===t:void 0))},agentJobChanged:{subscribe:async(e,{jobId:i},n)=>(await id(n,t,i),is.agentEventBus.iterate((0,is.agentJobChangedTopic)(i)))},agentJobLogAdded:{subscribe:async(e,{jobId:i},n)=>(await id(n,t,i),is.agentEventBus.iterate((0,is.agentJobLogTopic)(i)))}}},{Query:{jiraSettings:(e,t,n)=>(iT(n),i.getSettings()),jiraAvailableProjects:(e,t,n)=>(iT(n),i.availableProjects()),jiraProjects:(e,t,n)=>(iT(n),i.listProjects()),jiraProjectStatuses:(e,{projectId:t},n)=>(iT(n),i.projectStatuses(t)),jiraTicketBoard:(e,{sourceId:t},n)=>(iT(n),i.ticketBoard(t)),jiraTicket:(e,{issueKey:t},n)=>(iT(n),i.ticket(t)),jiraAssignableUsers:(e,{issueKey:t,query:n},r)=>(iT(r),i.assignableUsers(t,n)),jiraTicketTransitions:(e,{issueKey:t},n)=>(iT(n),i.ticketTransitions(t)),jiraTicketEditFields:(e,{issueKey:t},n)=>(iT(n),i.ticketEditFields(t)),jiraTicketChanges:(e,{issueKey:t,limit:n,offset:r},a)=>(iT(a),i.ticketChanges(t,n,r)),jiraTicketWorklogs:(e,{issueKey:t,limit:n,offset:r},a)=>(iT(a),i.ticketWorklogs(t,n,r)),jiraCacheMetrics:(e,t,n)=>(iT(n),i.cacheMetrics()),jiraApiCalls:(e,{limit:t,offset:n},r)=>(iT(r),i.listApiCalls(t,n)),jiraCachedTickets:(e,{limit:t,offset:n},r)=>(iT(r),i.listCachedTickets(t,n)),jiraCachedTicket:(e,{issueKey:t},n)=>(iT(n),i.cachedTicket(t))},Mutation:{saveJiraSettings:(e,{input:t},n)=>(iT(n),i.saveSettings(t)),testJiraConnection:(e,t,n)=>(iT(n),i.testConnection()),clearJiraCredentials:(e,t,n)=>(iT(n),i.clearCredentials()),addJiraProject:(e,{jiraId:t},n)=>(iT(n),i.addProject(t)),removeJiraProject:(e,{projectId:t},n)=>(iT(n),i.removeProject(t)),createJiraSource:(e,{input:t},n)=>(iT(n),i.createSource(t)),updateJiraSource:(e,{input:t},n)=>(iT(n),i.updateSource(t)),deleteJiraSource:(e,{id:t},n)=>(iT(n),i.deleteSource(t)),updateJiraProjectDisplaySettings:(e,{input:t},n)=>(iT(n),i.updateProjectDisplaySettings(t)),updateJiraProjectBranchNaming:(e,{projectId:t,branchNamingScript:n},r)=>(iT(r),i.updateProjectBranchNaming(t,n)),refreshJiraSource:(e,{sourceId:t},n)=>(iT(n),i.ticketBoard(t,!0)),updateJiraCacheTtl:(e,{ttlMinutes:t},n)=>(iT(n),i.updateCacheTtl(t)),clearJiraCache:(e,t,n)=>(iT(n),i.clearCache()),refreshJiraCachedTicket:(e,{issueKey:t},n)=>(iT(n),i.refreshCachedTicket(t)),deleteJiraCachedTicket:(e,{issueKey:t},n)=>(iT(n),i.deleteCachedTicket(t)),addJiraComment:(e,{issueKey:t,content:n},r)=>(iT(r),i.addComment(t,n)),assignJiraTicket:(e,{issueKey:t,accountId:n},r)=>(iT(r),i.assignTicket(t,n??null)),transitionJiraTicket:(e,{issueKey:t,transitionId:n},r)=>(iT(r),i.transitionTicket(t,n)),updateJiraTicket:(e,{input:t},n)=>(iT(n),i.updateTicket(t))}},{Query:{githubSettings:(e,t,i)=>(iE(i),n.getSettings()),githubAppSettings:(e,t,i)=>(iE(i),n.getAppSettings()),githubRepositories:(e,t,i)=>(iE(i),n.listRepositories()),githubAvailableRepositories:(e,{after:t},i)=>(iE(i),n.availableRepositories(t)),githubActionsWorkflowRuns:(e,{codebaseRepositoryId:t,first:i,after:r},a)=>(iE(a),n.actionsWorkflowRuns(t,i??25,r)),githubActionsWorkflowJobs:(e,{codebaseRepositoryId:t,workflowRunId:i},r)=>(iE(r),n.actionsWorkflowJobs(t,i)),githubPullRequests:(e,{scope:t,repositoryId:i,state:r,first:a,after:s},o,l)=>(iE(o),n.pullRequests(t,i,{includePipelineJobs:!!l?.fieldNodes.some(e=>!!e.selectionSet&&function e(t,i,n,r=new Set){for(let a of t.selections)if("Field"===a.kind){if(a.name.value===i||a.selectionSet&&e(a.selectionSet,i,n,r))return!0}else if("InlineFragment"===a.kind){if(e(a.selectionSet,i,n,r))return!0}else if(!r.has(a.name.value)){r.add(a.name.value);let t=n.fragments[a.name.value];if(t&&e(t.selectionSet,i,n,r))return!0}return!1}(e.selectionSet,"jobs",l)),state:r??"OPEN",first:a??25,after:s})),githubPullRequest:(e,{owner:t,name:i,number:r},a)=>(iE(a),n.pullRequest(t,i,r)),githubPullRequestMergeOptions:(e,{owner:t,name:i,number:r},a)=>(iE(a),n.pullRequestMergeOptions(t,i,r)),githubReviewThreads:(e,t,i)=>(iE(i),n.reviewThreads())},Mutation:{saveGitHubSettings:(e,{input:t},i)=>(iE(i),n.saveSettings(t)),saveGitHubAppSettings:(e,{input:t},i)=>(iE(i),n.saveAppSettings(t,iI(i))),testGitHubConnection:(e,t,i)=>(iE(i),n.testConnection()),testGitHubAppConnection:(e,t,i)=>(iE(i),n.testAppConnection(iI(i))),clearGitHubCredentials:(e,t,i)=>(iE(i),n.clearCredentials()),clearGitHubAppCredentials:(e,t,i)=>(iE(i),n.clearAppCredentials(iI(i))),addGitHubRepository:(e,{input:t},i)=>(iE(i),n.addRepository(t)),updateGitHubRepository:(e,{input:t},i)=>(iE(i),n.updateRepository(t)),removeGitHubRepository:(e,{id:t},i)=>(iE(i),n.removeRepository(t)),mergeGitHubPullRequest:async(e,{input:t},i)=>{iE(i);let r=await n.mergePullRequest(t),{owner:a,name:s}=(0,iS.normalizeGitHubRepositoryName)(`${t.owner}/${t.name}`);return o.invalidatePullRequestsForOrigin(`github.com/${a}/${s}`),r},retryGitHubPipeline:(e,{repositoryId:t,checkSuiteId:i},r)=>(iE(r),n.retryPipeline(t,i,iI(r))),retryGitHubWorkflowJob:(e,{repositoryId:t,checkSuiteId:i,jobId:r},a)=>(iE(a),n.retryWorkflowJob(t,i,r,iI(a))),replyToGitHubReviewThread:(e,{threadId:t,body:i},r)=>(iE(r),n.replyToReviewThread(t,i)),setGitHubReviewThreadResolved:(e,{threadId:t,resolved:i},r)=>(iE(r),n.setReviewThreadResolved(t,i))}},{CcusageCollection:{aggregate:(e,{range:t="ALL"})=>(0,im.filterUsageByDays)(e.aggregate,iy[t])},CcusageModelUsage:{unattributed:e=>e.unattributed??!1},Query:{ccusageCollection:async(e,{id:t},i)=>(iv(i),await r.initialize(),r.getCollection(t))},Mutation:{collectCcusage:async(e,{requestId:t},i)=>(iv(i),await r.initialize(),r.collect(t))},Subscription:{ccusageCollectionChanged:{subscribe:async(e,{id:t},i)=>(iv(i),await r.initialize(),r.subscribe(t)),resolve:e=>e}}},{DerivedDataDeletionHistory:{deletedAt:e=>e.deletedAt.toISOString()},Query:{derivedDataCollection:(e,{id:t},i)=>(ig(i),l.getCollection(t)),derivedDataDeletionHistory:(e,{first:t,after:i},n)=>(ig(n),l.history(t,i))},Mutation:{refreshDerivedData:(e,{requestId:t},i)=>(ig(i),l.refresh(t)),calculateDerivedDataSizes:(e,{collectionId:t,entryIds:i,requestId:n},r)=>(ig(r),l.calculateSizes(t,i,n)),deleteDerivedDataEntries:(e,{collectionId:t,entryIds:i,requestId:n},r)=>(ig(r),l.deleteEntries(t,i,n)),clearDerivedDataDeletionHistory:(e,t,i)=>(ig(i),l.clearHistory())},Subscription:{derivedDataCollectionChanged:{subscribe:(e,{id:t},i)=>(ig(i),l.subscribe(t)),resolve:e=>e}}},{CodebaseOverview:{repositories:e=>Array.isArray(e)?e:e.repositories??[]},CodebaseRepository:{createdAt:e=>e.createdAt.toISOString(),updatedAt:e=>e.updatedAt.toISOString()},CodebaseSettings:{updatedAt:e=>e.updatedAt.toISOString()},Codebase:{lastCheckedAt:e=>iD(e.lastCheckedAt),lastFetchedAt:e=>iD(e.lastFetchedAt),lastFetchAttemptAt:e=>iD(e.lastFetchAttemptAt),localBranches:e=>{try{let t=JSON.parse(e.localBranchesJson);return Array.isArray(t)?t.filter(e=>"string"==typeof e):[]}catch{return[]}},remoteBranches:e=>{try{let t=JSON.parse(e.remoteBranchesJson);return Array.isArray(t)?t.filter(e=>"string"==typeof e):[]}catch{return[]}},createdAt:e=>e.createdAt.toISOString(),updatedAt:e=>e.updatedAt.toISOString(),activeJob:e=>e.jobs?.[0]??null},AgentCodebaseRegistration:{canonicalOrigin:e=>e.repository.canonicalOrigin,keepBaseBranchUpToDate:e=>e.repository.keepBaseBranchUpToDate,worktrees:e=>e.worktrees??[],lastFetchedAt:e=>iD(e.lastFetchedAt),lastFetchAttemptAt:e=>iD(e.lastFetchAttemptAt)},Query:{codebaseOverview:async(e,t,i)=>(i_(i),a.overview()),codebaseRepository:(e,{id:t},i)=>(i_(i),a.repositoryDetail(t)),codebase:(e,{id:t},i)=>(i_(i),a.detail(t)),codebaseSettings:(e,t,i)=>(i_(i),a.settings()),agentCodebases:(e,t,i)=>a.agentCodebases(iN(i)),agentCodebaseConfiguration:(e,t,i)=>a.agentConfiguration(iN(i))},Mutation:{browseAgentDirectory:(e,{input:t},i)=>(i_(i),a.browse(t.agentId,t.path??null,t.requestId)),inspectAgentCodebase:(e,{input:t},i)=>(i_(i),a.inspect(t.agentId,t.folder,t.requestId)),confirmCodebase:(e,{input:t},i)=>(i_(i),a.confirm(t)),updateCodebaseRepository:(e,{input:t},i)=>(i_(i),a.updateRepository(t.id,t.name,t.description,t.jiraBranchRegex,t.keepBaseBranchUpToDate,t.skillGroupIds)),updateCodebaseSettings:(e,{input:t},i)=>(i_(i),a.updateSettings(t)),removeCodebase:(e,{id:t},i)=>(i_(i),a.removeCodebase(t)),refreshCodebases:(e,{input:t},i)=>(i_(i),a.runOperation(ib.CODEBASE_REFRESH_JOB_KIND,t.codebaseIds,t.requestId)),fetchCodebases:(e,{input:t},i)=>(i_(i),a.runOperation(ib.CODEBASE_FETCH_JOB_KIND,t.codebaseIds,t.requestId)),inspectCodebaseGitState:(e,{input:t},i)=>(i_(i),a.inspectGitState(t.codebaseId,t.requestId)),inspectCodebaseStash:(e,{input:t},i)=>(i_(i),a.inspectStash(t.codebaseId,t.stashOid,t.requestId)),runCodebaseGitOperation:(e,{input:t},i)=>(i_(i),a.runGitOperation(t)),reportCodebaseStatuses:(e,{reports:t},i)=>a.report(iN(i),t)},Subscription:{codebaseOverviewChanged:{subscribe:(e,t,i)=>(i_(i),a.subscribe())}}},{Query:{externalMcpServers:(e,t,i)=>(iA(i),s.externalServers())},Mutation:{createExternalMcpServer:(e,{input:t},i)=>(iA(i),s.createExternalServer(t)),updateExternalMcpServer:(e,{id:t,input:i},n)=>(iA(n),s.updateExternalServer(t,i)),deleteExternalMcpServer:(e,{id:t},i)=>(iA(i),s.deleteExternalServer(t))}},{WorktreeLatestBuild:{destination:e=>JSON.parse(e.destinationJson),createdAt:e=>e.createdAt.toISOString()},Worktree:{lastCheckedAt:e=>iw(e.lastCheckedAt),missingAt:e=>iw(e.missingAt),createdAt:e=>e.createdAt.toISOString(),updatedAt:e=>e.updatedAt.toISOString()},WorktreeTag:{createdAt:e=>e.createdAt.toISOString(),updatedAt:e=>e.updatedAt.toISOString()},WorktreeSettings:{updatedAt:e=>e.updatedAt.toISOString()},WorktreeMove:{createdAt:e=>e.createdAt.toISOString(),updatedAt:e=>e.updatedAt.toISOString(),finishedAt:e=>iw(e.finishedAt)},Query:{worktreeOverview:(e,t,i)=>(iR(i),o.overview()),hiddenWorktrees:(e,t,i)=>(iR(i),o.hidden()),worktreeSettings:(e,t,i)=>(iR(i),o.settings()),previewWorktreeTicketBranch:(e,{input:t},i)=>(iR(i),o.previewTicketBranch(t)),worktreeMove:(e,{id:t},i)=>(iR(i),o.getMove(t))},Mutation:{refreshWorktrees:(e,t,i)=>(iR(i),o.requestRefresh()),reportWorktrees:(e,{reports:t},i)=>o.report(iO(i),t),reportWorktreeActivity:(e,{input:t},i)=>o.reportActivity(iO(i),t),inspectWorktree:(e,{id:t,requestId:i},n)=>(iR(n),o.inspect(t,i)),runWorktreeOperation:(e,{input:t},i)=>(iR(i),o.runOperation(t.worktreeId,t.operation,t.requestId)),createWorktree:(e,{input:t},i)=>(iR(i),o.createWorktree(t)),changeWorktreeBranch:(e,{input:t},i)=>(iR(i),o.changeWorktreeBranch(t)),moveWorktree:(e,{input:t},i)=>(iR(i),o.moveWorktree(t)),retryWorktreeMoveWithStash:(e,{id:t},i)=>(iR(i),o.retryWorktreeMoveWithStash(t)),cancelWorktreeMove:(e,{id:t},i)=>(iR(i),o.cancelWorktreeMove(t)),deleteWorktree:(e,{input:t},i)=>(iR(i),o.deleteWorktree(t)),updateWorktreeBaseBranch:(e,{id:t,baseBranch:i},n)=>(iR(n),o.updateBaseBranch(t,i??null)),updateWorktreeHighlight:(e,{id:t,color:i},n)=>(iR(n),o.updateHighlight(t,i??null)),setWorktreeTags:(e,{id:t,tagIds:i},n)=>(iR(n),o.setTags(t,i)),saveWorktreeTag:(e,{input:t},i)=>(iR(i),o.saveTag(t)),deleteWorktreeTag:(e,{id:t},i)=>(iR(i),o.deleteTag(t)),saveWorktreeSettings:(e,{editorVariant:t},i)=>(iR(i),o.saveSettings(t)),purgeHiddenWorktree:(e,{id:t},i)=>(iR(i),o.purge(t)),purgeAllHiddenWorktrees:(e,t,i)=>(iR(i),o.purgeAll())},Subscription:{worktreeOverviewChanged:{subscribe:(e,t,i)=>(iR(i),o.subscribe())},worktreeInspectionChanged:{subscribe:(e,{worktreeId:t},i)=>(iR(i),o.subscribeInspection(t))}}},{CodebaseRepository:{skillGroups:e=>u.groupsForRepository(e.id)},Skill:{groups:e=>e.groups?.map(e=>e.group)??[],createdAt:e=>e.createdAt.toISOString(),updatedAt:e=>e.updatedAt.toISOString()},SkillFile:{contentsBase64:e=>Buffer.from(e.contents).toString("base64"),createdAt:e=>e.createdAt.toISOString(),updatedAt:e=>e.updatedAt.toISOString()},SkillGroup:{skills:e=>e.skills?.map(e=>e.skill)??[],repositories:e=>e.repositories?.map(e=>e.repository)??[],createdAt:e=>e.createdAt.toISOString(),updatedAt:e=>e.updatedAt.toISOString()},SkillSettings:{updatedAt:e=>e.updatedAt.toISOString()},SkillToolObservation:{checkedAt:e=>e.checkedAt.toISOString()},SkillInstallation:{consumers:e=>{try{return JSON.parse(e.consumersJson)}catch{return[]}},lastSeenAt:e=>e.lastSeenAt.toISOString()},SkillSyncItem:{candidatePackage:e=>{try{return e.candidatePackageJson?JSON.parse(e.candidatePackageJson):null}catch{return null}},createdAt:e=>e.createdAt.toISOString(),updatedAt:e=>e.updatedAt.toISOString()},SkillSyncRun:{createdAt:e=>e.createdAt.toISOString(),updatedAt:e=>e.updatedAt.toISOString(),finishedAt:e=>{let t;return t=e.finishedAt,t?.toISOString()??null}},Query:{skillsOverview:(e,{search:t},i)=>(iC(i),u.overview(t??"")),skill:(e,{id:t},i)=>(iC(i),u.getSkill(t)),skillSyncRun:(e,{id:t},i)=>(iC(i),u.getRun(t))},Mutation:{saveSkill:(e,{input:t},i)=>(iC(i),u.saveSkill(t)),deleteSkill:(e,{id:t},i)=>(iC(i),u.deleteSkill(t)),saveSkillGroup:(e,{input:t},i)=>(iC(i),u.saveGroup(t)),deleteSkillGroup:(e,{id:t},i)=>(iC(i),u.deleteGroup(t)),saveSkillSettings:(e,{input:t},i)=>(iC(i),u.saveSettings(t)),prepareSkillSync:(e,{kind:t,groupId:i},n)=>(iC(n),u.prepareSync(t,i??null)),skipPendingSkillSync:(e,{runId:t},i)=>(iC(i),u.skipPending(t)),resolveSkillSyncItem:(e,{input:t},i)=>{var n;return iC(i),u.resolveItem({...t,package:t.package?(n=t.package,(0,iL.parseSkillPackage)({...n,packageHash:n.packageHash||(0,iL.hashSkillFiles)(n.files)})):null})},applySkillSync:(e,{runId:t},i)=>(iC(i),u.applyRun(t))},Subscription:{skillsChanged:{subscribe:(e,t,i)=>(iC(i),u.subscribe()),resolve:()=>u.overview()},skillSyncRunChanged:{subscribe:(e,{runId:t},i)=>(iC(i),u.subscribeRun(t)),resolve:(e,{runId:t})=>u.getRun(t)}}},(c=this.services.buildsService,{CodebaseProject:{createdAt:e=>e.createdAt.toISOString(),updatedAt:e=>e.updatedAt.toISOString()},BuildConfiguration:{advancedSettings:e=>iM(e.advancedSettingsJson,{}),observation:e=>e.source?.observations?.[0]??null,createdAt:e=>e.createdAt.toISOString(),updatedAt:e=>e.updatedAt.toISOString()},BuildSourceObservation:{schemes:e=>iM(e.schemesJson,[]),configurations:e=>iM(e.configurationsJson,[]),testPlans:e=>iM(e.testPlansJson,[]),lastParseAttemptAt:e=>e.lastParseAttemptAt.toISOString(),lastParsedAt:e=>ix(e.lastParsedAt)},BuildScript:{createdAt:e=>e.createdAt.toISOString(),updatedAt:e=>e.updatedAt.toISOString()},BuildArtifact:{metadata:e=>iM(e.metadataJson,{}),createdAt:e=>e.createdAt.toISOString()},BuildDeployment:{destination:e=>iM(e.destinationJson,{}),createdAt:e=>e.createdAt.toISOString(),startedAt:e=>ix(e.startedAt),finishedAt:e=>ix(e.finishedAt)},BuildExport:{settings:e=>iM(e.settingsSnapshotJson,{}),createdAt:e=>e.createdAt.toISOString(),startedAt:e=>ix(e.startedAt),finishedAt:e=>ix(e.finishedAt)},Build:{destination:e=>iM(e.destinationJson,{}),snapshot:e=>iM(e.snapshotJson,{}),createdAt:e=>e.createdAt.toISOString(),startedAt:e=>ix(e.startedAt),finishedAt:e=>ix(e.finishedAt),updatedAt:e=>e.updatedAt.toISOString(),durationMs:e=>e.startedAt&&e.finishedAt?Math.max(0,e.finishedAt.getTime()-e.startedAt.getTime()):null,outOfDate:iF.buildOutOfDate},BuildLogEvent:{createdAt:e=>e.createdAt instanceof Date?e.createdAt.toISOString():e.createdAt},Query:{iosAppProject:(e,{codebaseId:t},i)=>(ik(i),c.project(t)),buildScripts:(e,t,i)=>(ik(i),c.scripts()),builds:(e,t,i)=>(ik(i),c.builds(t)),build:(e,{id:t},i)=>(ik(i),c.getBuild(t)),buildLogs:(e,t,i)=>(ik(i),c.logs(t.buildId,t.after,t.first))},Mutation:{createIosAppProject:(e,{codebaseId:t},i)=>(ik(i),c.createProject(t)),saveBuildConfiguration:(e,{input:t},i)=>(ik(i),c.saveConfiguration(t)),deleteBuildConfiguration:(e,{id:t},i)=>(ik(i),c.deleteConfiguration(t)),discoverBuildSources:(e,t,i)=>(ik(i),c.discoverSources(t.worktreeId,t.requestId)),inspectBuildSource:(e,{input:t},i)=>(ik(i),c.inspectSource(t)),reparseBuildConfiguration:(e,t,i)=>(ik(i),c.reparse(t.configurationId,t.worktreeId,t.requestId)),inspectBuildDestinations:(e,{input:t},i)=>(ik(i),c.destinations(t)),inspectBuildRunDestinations:(e,t,i)=>(ik(i),c.destinationsForBuild(t.buildId,t.requestId)),saveBuildScript:(e,{input:t},i)=>(ik(i),c.saveScript(t)),deleteBuildScript:(e,{id:t},i)=>(ik(i),c.deleteScript(t)),setCodebaseBuildScripts:(e,t,i)=>(ik(i),c.setAllowedScripts(t.codebaseId,t.scriptIds)),startBuild:(e,{input:t},i)=>(ik(i),c.startBuild(t)),rebuildBuild:(e,{id:t,requestId:i},n)=>(ik(n),c.rebuildBuild(t,i)),cancelBuild:(e,{id:t},i)=>(ik(i),c.cancelBuild(t)),deleteBuilds:(e,{ids:t},i)=>(ik(i),c.deleteBuilds(t)),runBuild:(e,{input:t},i)=>(ik(i),c.runBuild(t)),exportBuildArchive:(e,{input:t},i)=>(ik(i),c.exportArchive(t)),reportBuildProgress:(e,{input:t},i)=>c.reportProgress(iP(i),t),appendBuildLogEvents:(e,{buildId:t,events:i},n)=>c.appendLogs(iP(n),t,i)},Subscription:{buildsChanged:{subscribe:(e,t,i)=>(ik(i),is.agentEventBus.iterate(is.BUILDS_CHANGED_TOPIC))},buildChanged:{subscribe:(e,{id:t},i)=>(ik(i),is.agentEventBus.iterate((0,is.buildTopic)(t)))},buildLogAdded:{subscribe:(e,{buildId:t},i)=>(ik(i),is.agentEventBus.iterate((0,is.buildLogTopic)(t)))}}})]),(0,t3.buildSubgraphSchema)({typeDefs:iU,resolvers:d}));let p="true"===process.env.APOLLO_SANDBOX;this.server=new tX({schema:this.schema,introspection:p,plugins:p?[(0,t5.ApolloServerPluginLandingPageLocalDefault)({footer:!1})]:[(0,t5.ApolloServerPluginLandingPageProductionDefault)({footer:!1})]})}async createContext(e=new Headers){let t;if(await this.initializeServer(),!this.services)throw Error("GraphQL services not initialized");let i=function(e){if(e instanceof Headers)return e;let t=new Headers;for(let[i,n]of Object.entries(e))Array.isArray(n)?t.set(i,n.join(", ")):void 0!==n&&t.set(i,n);return t}(e),n=await this.services.agentControlService.authenticate((t=i.get("authorization"),!t?.startsWith("Bearer ")?null:t.slice(7).trim()||null));return{prismaService:this.services.prismaService,agentControlService:this.services.agentControlService,agentId:n,ipAddress:i.get("x-forwarded-for")?.split(",")[0]?.trim()||null}}async getSchema(){if(await this.initializeServer(),!this.schema)throw Error("GraphQL schema not properly initialized");return this.schema}async getServer(){if(await this.initializeServer(),!this.server)throw Error("GraphQL server not properly initialized");return this.server}};e.s(["SharedGraphQLServerService",0,ij],379993)}];
|
|
2574
2595
|
|
|
2575
2596
|
//# sourceMappingURL=_0w2eghf._.js.map
|