@squidcloud/client 1.0.75 → 1.0.76

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. package/dist/common/src/ai-assistant.context.d.ts +12 -12
  2. package/dist/common/src/ai-assistant.schemas.d.ts +1 -1
  3. package/dist/common/src/ai-assistant.types.d.ts +2 -2
  4. package/dist/common/src/api-call.context.d.ts +13 -13
  5. package/dist/common/src/api.types.d.ts +4 -4
  6. package/dist/common/src/application.schemas.d.ts +1 -1
  7. package/dist/common/src/application.types.d.ts +184 -184
  8. package/dist/common/src/backend-function.schemas.d.ts +1 -1
  9. package/dist/common/src/backend-function.types.d.ts +1 -1
  10. package/dist/common/src/backend-run.types.d.ts +2 -2
  11. package/dist/common/src/bundle-api.types.d.ts +36 -36
  12. package/dist/common/src/bundle-data.types.d.ts +4 -4
  13. package/dist/common/src/communication.types.d.ts +12 -12
  14. package/dist/common/src/context.types.d.ts +40 -40
  15. package/dist/common/src/distributed-lock.context.d.ts +5 -5
  16. package/dist/common/src/document.types.d.ts +22 -22
  17. package/dist/common/src/graphql.context.d.ts +7 -7
  18. package/dist/common/src/graphql.types.d.ts +9 -9
  19. package/dist/common/src/heartbeat.types.d.ts +1 -1
  20. package/dist/common/src/http-status.enum.d.ts +50 -50
  21. package/dist/common/src/index.d.ts +54 -54
  22. package/dist/common/src/integrations/ai_assistant.types.d.ts +30 -30
  23. package/dist/common/src/integrations/api.types.d.ts +80 -80
  24. package/dist/common/src/integrations/auth.types.d.ts +39 -39
  25. package/dist/common/src/integrations/database.types.d.ts +236 -236
  26. package/dist/common/src/integrations/index.d.ts +101 -101
  27. package/dist/common/src/integrations/observability.types.d.ts +22 -22
  28. package/dist/common/src/logger.types.d.ts +21 -21
  29. package/dist/common/src/metrics.types.d.ts +1 -1
  30. package/dist/common/src/mutation.context.d.ts +14 -14
  31. package/dist/common/src/mutation.schemas.d.ts +1 -1
  32. package/dist/common/src/mutation.types.d.ts +53 -53
  33. package/dist/common/src/named-query.context.d.ts +4 -4
  34. package/dist/common/src/named-query.schemas.d.ts +1 -1
  35. package/dist/common/src/named-query.types.d.ts +1 -1
  36. package/dist/common/src/query/index.d.ts +2 -2
  37. package/dist/common/src/query/query-context.d.ts +42 -42
  38. package/dist/common/src/query/simple-query-builder.d.ts +117 -117
  39. package/dist/common/src/query.schemas.d.ts +3 -3
  40. package/dist/common/src/query.types.d.ts +57 -57
  41. package/dist/common/src/regions.d.ts +1 -1
  42. package/dist/common/src/schema/schema.types.d.ts +54 -54
  43. package/dist/common/src/secret.schemas.d.ts +1 -1
  44. package/dist/common/src/secret.types.d.ts +8 -8
  45. package/dist/common/src/security.types.d.ts +1 -1
  46. package/dist/common/src/socket.schemas.d.ts +1 -1
  47. package/dist/common/src/socket.types.d.ts +1 -1
  48. package/dist/common/src/time-units.d.ts +1 -1
  49. package/dist/common/src/trigger.types.d.ts +1 -1
  50. package/dist/common/src/types.d.ts +8 -8
  51. package/dist/common/src/utils/array.d.ts +1 -1
  52. package/dist/common/src/utils/assert.d.ts +1 -1
  53. package/dist/common/src/utils/error.d.ts +4 -4
  54. package/dist/common/src/utils/http.d.ts +2 -2
  55. package/dist/common/src/utils/id.d.ts +2 -2
  56. package/dist/common/src/utils/lock.manager.d.ts +14 -14
  57. package/dist/common/src/utils/nullish.d.ts +1 -1
  58. package/dist/common/src/utils/object.d.ts +6 -6
  59. package/dist/common/src/utils/serialization.d.ts +6 -6
  60. package/dist/common/src/utils/transforms.d.ts +18 -18
  61. package/dist/common/src/utils/url.d.ts +1 -1
  62. package/dist/common/src/utils/validation.d.ts +30 -30
  63. package/dist/common/src/webhook-response.d.ts +1 -1
  64. package/dist/index.js +1 -1
  65. package/dist/node_modules/json-schema-typed/draft-2020-12.d.ts +1239 -1239
  66. package/dist/typescript-client/src/ai-assistant-client.d.ts +167 -167
  67. package/dist/typescript-client/src/ai-client.factory.d.ts +11 -11
  68. package/dist/typescript-client/src/api.manager.d.ts +15 -15
  69. package/dist/typescript-client/src/auth.manager.d.ts +23 -23
  70. package/dist/typescript-client/src/backend-function.manager.d.ts +13 -13
  71. package/dist/typescript-client/src/client-id.service.d.ts +25 -25
  72. package/dist/typescript-client/src/collection-reference.d.ts +81 -81
  73. package/dist/typescript-client/src/collection-reference.factory.d.ts +16 -16
  74. package/dist/typescript-client/src/connection-details.d.ts +23 -23
  75. package/dist/typescript-client/src/data.manager.d.ts +172 -172
  76. package/dist/typescript-client/src/destruct.manager.d.ts +12 -12
  77. package/dist/typescript-client/src/distributed-lock.manager.d.ts +19 -19
  78. package/dist/typescript-client/src/document-identity.service.d.ts +12 -12
  79. package/dist/typescript-client/src/document-reference.d.ts +134 -134
  80. package/dist/typescript-client/src/document-reference.factory.d.ts +9 -9
  81. package/dist/typescript-client/src/document-store.d.ts +11 -11
  82. package/dist/typescript-client/src/graphql-client.d.ts +12 -12
  83. package/dist/typescript-client/src/graphql-client.factory.d.ts +9 -9
  84. package/dist/typescript-client/src/index.d.ts +8 -8
  85. package/dist/typescript-client/src/mutation/mutation-sender.d.ts +10 -10
  86. package/dist/typescript-client/src/named-query.manager.d.ts +12 -12
  87. package/dist/typescript-client/src/query/join-query-builder.factory.d.ts +72 -72
  88. package/dist/typescript-client/src/query/query-builder.factory.d.ts +89 -89
  89. package/dist/typescript-client/src/query/query-subscription.manager.d.ts +135 -135
  90. package/dist/typescript-client/src/query/query.types.d.ts +14 -14
  91. package/dist/typescript-client/src/rpc.manager.d.ts +28 -28
  92. package/dist/typescript-client/src/socket.manager.d.ts +32 -32
  93. package/dist/typescript-client/src/squid.d.ts +218 -218
  94. package/dist/typescript-client/src/state/action.applier.d.ts +7 -7
  95. package/dist/typescript-client/src/state/actions.d.ts +29 -29
  96. package/dist/typescript-client/src/state/path_trie.d.ts +27 -27
  97. package/dist/typescript-client/src/state/state.service.d.ts +22 -22
  98. package/dist/typescript-client/src/state/state.service.spec.d.ts +1 -1
  99. package/dist/typescript-client/src/testing/setup-tests.d.ts +1 -1
  100. package/dist/typescript-client/src/types.d.ts +2 -2
  101. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -9,4 +9,4 @@
9
9
  ${e.query}
10
10
  `,variables:e.variables})).data}async mutate(e){return(await this.client.mutate({mutation:i.gql`
11
11
  ${e.query}
12
- `})).data}}},7718:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MutationSender=void 0;const n=r(575);t.MutationSender=class{constructor(e,t,r){this.rpcManager=e,this.lockManager=t,this.querySubscriptionManager=r}async sendMutations(e,t){const r=(0,n.reduceMutations)(e),i=r.map((e=>`sendMutation_${(0,n.getSquidDocId)(e.squidDocIdObj)}`));await this.lockManager.lock(...i),await this.querySubscriptionManager.waitForAllQueriesToFinish();try{const e={mutations:r,integrationId:t};return await this.rpcManager.post("mutation/mutate",e)}finally{this.lockManager.release(...i)}}}},9194:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NamedQueryManager=void 0;const n=r(575),i=r(2937),o=r(9978);t.NamedQueryManager=class{constructor(e,t){this.rpcManager=e,this.socketManager=t,this.ongoingNamedQueryExecutions={},t.observeNotifications().pipe((0,i.filter)((e=>"namedQuery"===e.type)),(0,o.map)((e=>e))).subscribe((e=>{this.handleNamedQueryResponse(e.clientRequestId,e.payload)}))}executeNamedQueryAndSubscribe(e,t,r){const o=(0,n.generateId)(),a=new i.Subject;this.ongoingNamedQueryExecutions[o]=a;const s={integrationId:e,queryName:t,paramsRecordStr:(0,n.serializeObj)(r),clientRequestId:o};return this.rpcManager.post("named-query/execute",s).catch((r=>{console.error("Got error while executing named query",t,"for integration",e,r),a.error(r),a.complete()})),a.pipe((0,i.finalize)((()=>{delete this.ongoingNamedQueryExecutions[o]})),(0,i.share)())}handleNamedQueryResponse(e,t){const r=this.ongoingNamedQueryExecutions[e];if(!r)return;const i=(0,n.deserializeObj)(t);i.success?r.next(i.result):(r.error(new Error(i.result)),r.complete())}}},9732:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.JoinQueryBuilder=t.JoinQueryBuilderFactory=void 0;const n=r(9312),i=r(575),o=n.__importStar(r(8784)),a=r(2937),s=r(9978);t.JoinQueryBuilderFactory=class{constructor(e,t,r){this.querySubscriptionManager=e,this.documentReferenceFactory=t,this.queryBuilderFactory=r}getForJoin(e,t,r){return new u(e,t,this.querySubscriptionManager,this.documentReferenceFactory,r,this,this.queryBuilderFactory)}};class u extends i.BaseQueryBuilderInterface{constructor(e,t,r,n,o,a,s){super(),this.collectionName=e,this.integrationId=t,this.querySubscriptionManager=r,this.documentReferenceFactory=n,this.alias=o,this.joinQueryBuilderFactory=a,this.queryBuilderFactory=s,this.joins={},this.joinConditions={},this.simpleQueryBuilder=new i.SimpleQueryBuilder(e,t)}where(e,t,r){return this.simpleQueryBuilder.where(e,t,r),this}limit(e){return this.simpleQueryBuilder.limit(e),this}sortBy(e,t=!0){return this.simpleQueryBuilder.sortBy(e,t),this}join(e,t,r){const n={leftFieldName:t,rightFieldName:r,leftAlias:this.alias};this.joins[e.alias]=e.build(),Object.entries(e.joins).forEach((([e,t])=>{this.joins[e]=t}));for(const[t,r]of Object.entries(e.joinConditions))this.joinConditions[t]=r;return this.joinConditions[e.alias]=n,this}snapshot(){return(0,a.firstValueFrom)(this.snapshots(!1))}snapshots(e=!0){return this.querySubscriptionManager.processQuery(this.build(),this.alias,o.cloneDeep(this.joins),o.cloneDeep(this.joinConditions),e,!1).pipe((0,s.map)((e=>e.map((e=>{const t={};for(const[r,n]of Object.entries(e)){const e=r===this.alias?this.collectionName:this.joins[r].collectionName,o=r===this.alias?this.integrationId:this.joins[r].integrationId,a=n?(0,i.getSquidDocId)(n.__docId__,e,o):void 0;t[r]=a?this.documentReferenceFactory.create(a,this.queryBuilderFactory):void 0}return t})))))}build(){return this.simpleQueryBuilder.build()}}t.JoinQueryBuilder=u},6891:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Changes=t.QueryBuilder=t.QueryBuilderFactory=void 0;const n=r(575),i=r(2937),o=r(9978);t.QueryBuilderFactory=class{constructor(e,t,r){this.querySubscriptionManager=e,this.documentReferenceFactory=t,this.documentIdentityService=r}getForDocument(e){const{collectionName:t,integrationId:r,docId:i}=(0,n.parseSquidDocId)(e),o=(0,n.deserializeObj)(i),a=this.get(t,r);return Object.entries(o).forEach((([e,t])=>{a.where(e,"==",t)})),a}get(e,t){return new a(e,t,this.querySubscriptionManager,this.documentReferenceFactory,this,this.documentIdentityService)}};class a extends n.SimpleQueryBuilder{constructor(e,t,r,n,i,o){super(e,t),this.querySubscriptionManager=r,this.documentReferenceFactory=n,this.queryBuilderFactory=i,this.documentIdentityService=o,this.forceFetchFromServer=!1}getSortOrder(){return this.query.sortOrder}snapshot(){return(0,i.firstValueFrom)(this.snapshots(!1))}setForceFetchFromServer(){return this.forceFetchFromServer=!0,this}snapshots(e=!0){return this.querySubscriptionManager.processQuery(this.build(),this.collectionName,{},{},e,this.forceFetchFromServer).pipe((0,o.map)((e=>e.map((e=>{(0,n.assertTruthy)(1===Object.keys(e).length);const t=e[this.collectionName],r=(0,n.getSquidDocId)((0,n.truthy)(t).__docId__,this.collectionName,this.integrationId);return this.documentReferenceFactory.create(r,this.queryBuilderFactory)})))))}changes(){let e,t=new Set;return this.snapshots().pipe((0,i.combineLatestWith)(this.documentIdentityService.observeChanges().pipe((0,i.switchMap)((t=>(Object.entries(t).forEach((([t,r])=>{(0,n.replaceKeyInRecord)(e||{},t,r)})),i.NEVER))),(0,i.startWith)({}))),(0,o.map)((([r])=>{let n=[];const i=[],o=[];if(e){for(const o of r){const r=o.squidDocId,a=o.data;if(t.has(a))delete e[r],t.delete(a);else if(e[r]){i.push(o);const n=e[r];delete e[r],t.delete(n)}else n.push(o)}for(const e of t)o.push(e)}else n=r;e={},t=new Set;for(const n of r){const r=n.data;e[n.squidDocId]=r,t.add(r)}return new s(n,i,o)})))}get hash(){return(0,n.encodeValueForMapping)(this.build())}}t.QueryBuilder=a;class s{constructor(e,t,r){this.inserts=e,this.updates=t,this.deletes=r}}t.Changes=s},4661:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.QuerySubscriptionManager=void 0;const n=r(9312),i=r(575),o=n.__importStar(r(8784)),a=r(2937),s=r(9978),u=r(1122),c="client";t.QuerySubscriptionManager=class{constructor(e,t,r,n,i){this.rpcManager=e,this.clientIdService=t,this.documentStore=r,this.destructManager=n,this.documentIdentityService=i,this.safeToSendQueriesToServer=new a.BehaviorSubject(!0),this.onOrphanDocuments=new a.Subject,this.ongoingQueries=new Map,this.inflightQueriesCount=new a.BehaviorSubject(0),this.clientRequestIdToLocalDocuments=new Map,this.localDocumentToClientRequestIds=new Map,this.queryMappingManager=new l,this.documentIdentityService.observeChanges().subscribe(this.migrateDocIds.bind(this)),this.clientIdService.observeClientReadyToBeRegenerated().subscribe((()=>{this.refreshOngoingQueries()})),this.destructManager.onPreDestruct((()=>{this.predestruct()}))}hasOngoingQuery(e){return this.ongoingQueries.has(e)}getQuery(e){return(0,i.truthy)(this.ongoingQueries.get(e),"UNKNOWN_QUERY").query}setGotInitialResult(e){const t=(0,i.truthy)(this.ongoingQueries.get(e));t.gotInitialResponse?this.removeClientRequestIdMapping(e):t.gotInitialResponse=!0}findQueriesForDocument(e,t){const{collectionName:r,integrationId:n}=(0,i.parseSquidDocId)(t),o=this.queryMappingManager.getMapping(c,r,n);return o?(0,i.findQueriesForDocumentSync)(o,e):[]}setClientRequestIdsForLocalDoc(e,t){const r=this.localDocumentToClientRequestIds.get(e)||new Set,n=new Set(t?this.findQueriesForDocument(t,e).map((e=>(0,i.parseQuerySubscriptionId)(e).clientRequestId)):[]),o=new Set([...r,...n]);for(const t of[...r]){if(n.has(t))continue;r.delete(t);const i=this.clientRequestIdToLocalDocuments.get(t);i&&(i.delete(e),i.size||this.clientRequestIdToLocalDocuments.delete(t)),r.size||this.localDocumentToClientRequestIds.delete(e)}for(const t of n){let r=this.localDocumentToClientRequestIds.get(e);r||(r=new Set,this.localDocumentToClientRequestIds.set(e,r)),r.add(t);let n=this.clientRequestIdToLocalDocuments.get(t);n||(n=new Set,this.clientRequestIdToLocalDocuments.set(t,n)),n.add(e)}return[...o]}errorOutAllQueries(e,t){const r=this.localDocumentToClientRequestIds.get(e)||new Set;for(const e of r){const r=this.ongoingQueries.get(e);r&&(r.dataSubject.error(t),r.done=!0)}}notifyAllSubscriptions(e){const t=new Set;for(const r of e){const e=this.ongoingQueries.get(r);if(!e)continue;if(!e.gotInitialResponse||!e.activated)continue;const n=this.clientRequestIdToLocalDocuments.get(r),o=this.documentStore.sortAndLimitDocs(n,e.query);let a=!1;for(const t of e.supportedQueries)a=a||this.updateOngoingQueryWithNewDataFromSupportingQuery(o,t);let s=e;for(;!s.allObservables;)s=(0,i.truthy)(null==s?void 0:s.supportingOngoingQuery);a&&t.add(s),e.dataSubject.next(o)}for(const e of t){const t=this.collectAllObservables(e);(0,i.truthy)(e.allObservables).next(t)}}findValidParentQuery(e){if(e.forceFetchFromServer)return;const t=new i.QueryContext(e.query);for(const r of this.ongoingQueries.values())if(e!==r&&r.activated&&!r.isInFlight&&!r.isEmptyForJoin&&!r.done&&r.subscribe&&t.isSubsetOfQuery(r.query))return r}processQuery(e,t,r,n,i,u){return(0,a.defer)((()=>{const c=this.createOngoingQueryGraph(e,t,r,n,i,!0);u&&(c.forceFetchFromServer=!0),this.sendQueryToServerOrUseParentQuery(c),c.allObservables=new a.ReplaySubject(1);const l=c.allObservables.pipe((0,a.switchMap)((e=>(0,a.combineLatest)(e).pipe((0,s.map)((e=>this.joinResults(e,n,c)))))),(0,s.filter)((()=>this.allOngoingQueriesGotInitialResult(c))),(0,a.startWith)(void 0),(0,a.pairwise)(),(0,s.filter)((([e,t])=>!o.isEqual(e,t))),(0,s.map)((([e,t])=>t)),i?(0,a.tap)():(0,a.take)(1),(0,a.finalize)((()=>{var e;c.dataSubject.complete(),c.done=!0,this.completeAllSupportedQueries(c).then(),null===(e=c.allObservables)||void 0===e||e.complete()}))),f=this.collectAllObservables(c);return c.allObservables.next(f),l})).pipe((0,a.share)())}hasOngoingQueryForDocId(e){const t=this.localDocumentToClientRequestIds.get(e);return!!t&&!!t.size}removeClientRequestIdMapping(e){const t=this.clientRequestIdToLocalDocuments.get(e);if(!t)return;this.clientRequestIdToLocalDocuments.delete(e);const r=[];for(const n of t){const t=(0,i.truthy)(this.localDocumentToClientRequestIds.get(n));t.delete(e),t.size||(this.localDocumentToClientRequestIds.delete(n),r.push(n))}r.length&&this.onOrphanDocuments.next(r)}async waitForAllQueriesToFinish(){return(0,a.firstValueFrom)(this.inflightQueriesCount.pipe((0,s.filter)((e=>0===e)))).then((()=>{}))}registerQueryFinalizer(e){const t=e.clientRequestId,r=(0,i.getQuerySubscriptionId)(this.clientIdService.getClientId(),t);e.dataSubject.pipe((0,a.finalize)((async()=>{if(e.unsubscribeBlockerCount.value>0&&await(0,a.firstValueFrom)((0,a.race)(this.destructManager.observeIsDestructing(),e.unsubscribeBlockerCount.pipe((0,s.filter)((e=>0===e))))),this.queryMappingManager.removeQuery(t,r).then(),this.ongoingQueries.delete(t),e.subscribe&&!e.isEmptyForJoin&&e.activated){const r={clientRequestId:t};this.rpcManager.post("query/unsubscribe",r).catch((t=>{console.error("Got error while unsubscribing from query",e.query,t)}))}this.removeClientRequestIdMapping(t),this.ongoingQueries.delete(t)}))).subscribe({error:()=>{}})}createOngoingQueryGraph(e,t,r,n,o,s,u={}){if(u[t])return u[t];const c=(0,i.generateId)(),l=[],f={clientRequestId:c,activated:s,alias:t,query:e,subscribe:o,dataSubject:new a.ReplaySubject(1),supportedQueries:l,supportingOngoingQuery:void 0,joinCondition:void 0,gotInitialResponse:!1,isEmptyForJoin:!1,unsubscribeBlockerCount:new a.BehaviorSubject(0),queryRegistered:new a.BehaviorSubject(!1),done:!1,isInFlight:!1,forceFetchFromServer:!1};this.registerQueryFinalizer(f),this.ongoingQueries.set(c,f),u[t]=f;for(const[e,i]of Object.entries(n)){const a=i.leftAlias;if(a!==t&&e!==t)continue;const s=a===t?e:a;if(a===t){const e=this.createOngoingQueryGraph(r[s],s,r,n,o,!1,u);e.joinCondition=i,l.push(e)}else f.supportingOngoingQuery=this.createOngoingQueryGraph(r[s],s,r,n,o,!1,u)}return f}collectAllObservables(e,t=[]){if(e.isEmptyForJoin)return t;const r=e.alias;t.push(e.dataSubject.pipe((0,s.map)((e=>({docs:e,alias:r})))));for(const r of e.supportedQueries)this.collectAllObservables(r,t);return t}joinResults(e,t,r){const n=[],i=e.reduce(((e,t)=>(e[t.alias]?e[t.alias].push(...t.docs):e[t.alias]=[...t.docs],e)),{});i[r.alias].forEach((e=>{n.push({[r.alias]:e})}));const o=this.getOngoingQueriesBfs(r),a=new Set;for(let e=1;e<o.length;e++){const r=o[e].alias;a.has(r)||(a.add(r),this.join(n,r,i[r],t))}return n}join(e,t,r,n){var o;if(!e.length)return;const a=Object.keys(e[0]),s=n[t];if(!s||!a.includes(s.leftAlias))return;const u=new Map;(r||[]).forEach((e=>{const t=e[s.rightFieldName];u.has(t)||u.set(t,[]),(0,i.truthy)(u.get(t)).push(e)}));for(const r of[...e]){const n=u.get(null===(o=r[s.leftAlias])||void 0===o?void 0:o[s.leftFieldName])||[];if(n.length)for(const i of n)r[t]?e.push(Object.assign(Object.assign({},r),{[t]:i})):r[t]=i;else r[t]||(r[t]=void 0)}}getOngoingQueriesBfs(e){const t=[],r=[e];for(;r.length;){const e=(0,i.truthy)(r.shift());e.isEmptyForJoin||(t.push(e),r.push(...e.supportedQueries))}return t}updateOngoingQueryWithNewDataFromSupportingQuery(e,t){var r;const n=(0,i.truthy)(t.joinCondition),s=t.query;if(t.activated){const u=(0,i.truthy)(null===(r=t.supportingOngoingQuery)||void 0===r?void 0:r.supportedQueries).filter((e=>e.alias===t.alias)),c=new Set(e.map((e=>{var t;return null!==(t=e[n.leftFieldName])&&void 0!==t?t:null})));for(const e of u)e.query.conditions.filter((e=>e.fieldName===n.rightFieldName)).forEach((e=>{c.delete(e.value)}));if(0===c.size)return!1;const l=o.cloneDeep(s);l.conditions=l.conditions.filter((e=>e.fieldName!==n.rightFieldName)),[...c].forEach((e=>{l.conditions.push({fieldName:n.rightFieldName,operator:"==",value:e})}));const f=Object.assign(Object.assign({},t),{query:l,activated:!0,gotInitialResponse:!1,dataSubject:new a.ReplaySubject(1),clientRequestId:(0,i.generateId)(),isEmptyForJoin:!1});return this.registerQueryFinalizer(f),this.ongoingQueries.set(f.clientRequestId,f),(0,i.truthy)(t.supportingOngoingQuery).supportedQueries.push(f),this.sendQueryToServerOrUseParentQuery(f),!0}{const r=e.map((e=>{var t;return{fieldName:n.rightFieldName,operator:"==",value:null!==(t=e[n.leftFieldName])&&void 0!==t?t:null}}));return t.activated=!0,r.length?(s.conditions.push(...r),this.sendQueryToServerOrUseParentQuery(t)):t.isEmptyForJoin=!0,!0}}allOngoingQueriesGotInitialResult(e){return!!e.isEmptyForJoin||!!e.gotInitialResponse&&(!e.supportedQueries.length||e.supportedQueries.every((e=>this.allOngoingQueriesGotInitialResult(e))))}async completeAllSupportedQueries(e){const t=[...e.supportedQueries||[]];for(;t.length;){const e=(0,i.truthy)(t.shift());t.push(...e.supportedQueries||[]),await(0,a.firstValueFrom)(e.unsubscribeBlockerCount.pipe((0,s.filter)((e=>0===e)))),e.dataSubject.complete()}}predestruct(){this.safeToSendQueriesToServer.next(!1),this.safeToSendQueriesToServer.complete(),this.unsubscribe()}unsubscribe(){var e;const t=[...this.ongoingQueries.values()];for(const r of t)r.dataSubject.complete(),null===(e=r.allObservables)||void 0===e||e.complete()}hasSubscription(e){var t;return!!(null===(t=this.ongoingQueries.get(e))||void 0===t?void 0:t.subscribe)}sendQueryToServerOrUseParentQuery(e){if(this.destructManager.isDestructing)return;const t=e.query,r=e.clientRequestId,n=(0,i.getQuerySubscriptionId)(this.clientIdService.getClientId(),r);this.queryMappingManager.addQuery(c,t,n).then(),this.ongoingQueries.set(r,e);const o=this.findValidParentQuery(e);o?this.useParentOngoingQuery(e,o).then():this.sendQueryToServer(e)}async useParentOngoingQuery(e,t){const r={clientRequestId:e.clientRequestId,query:e.query,parentClientRequestId:t.clientRequestId},n=new i.QueryContext(e.query);t.unsubscribeBlockerCount.next(t.unsubscribeBlockerCount.value+1);try{await(0,a.firstValueFrom)(t.queryRegistered.pipe((0,s.filter)(Boolean)))}catch(t){return e.dataSubject.error(t),e.queryRegistered.error(t),void(e.done=!0)}if(this.destructManager.isDestructing)return;if(e.done)return;this.rpcManager.post("query/register",r).catch((r=>{console.error("Query error",e.query,t.query,r),e.dataSubject.error(r),e.done=!0})).finally((()=>{t.unsubscribeBlockerCount.next(t.unsubscribeBlockerCount.value-1),e.isInFlight=!1}));const o=(0,a.race)(e.queryRegistered.pipe((0,s.filter)(Boolean),(0,a.delay)(2e3),(0,a.take)(1)),this.destructManager.observeIsDestructing().pipe((0,a.take)(1)));t.dataSubject.pipe((0,a.takeWhile)((()=>!e.done)),(0,a.takeUntil)(o),(0,a.tap)((()=>{e.gotInitialResponse||this.setGotInitialResult(e.clientRequestId)})),(0,s.map)((e=>e.filter((e=>n.documentMatchesQuery(e)))))).subscribe({next:t=>{for(const r of t)this.setClientRequestIdsForLocalDoc((0,i.getSquidDocId)(r.__docId__,e.query.collectionName,e.query.integrationId),r);this.notifyAllSubscriptions([e.clientRequestId])},error:t=>e.dataSubject.error(t)})}sendQueryToServer(e){const t={query:e.query,clientRequestId:e.clientRequestId,subscribe:e.subscribe};this.safeToSendQueriesToServer.pipe((0,s.filter)(Boolean),(0,a.take)(1)).subscribe((()=>{e.done||(this.inflightQueriesCount.next(this.inflightQueriesCount.value+1),e.isInFlight=!0,this.rpcManager.post("query/query",t).catch((t=>{e.dataSubject.error(t),e.done=!0,e.queryRegistered.error("query failed")})).then((()=>{e.queryRegistered.next(!0)})).finally((()=>{this.inflightQueriesCount.next(this.inflightQueriesCount.value-1),e.isInFlight=!1})))}))}refreshOngoingQueries(){for(const e of this.ongoingQueries.values())this.sendQueryToServerOrUseParentQuery(e)}migrateDocIds(e){const t=Object.keys(e);for(const r of this.clientRequestIdToLocalDocuments.values())t.forEach((t=>{r.has(t)&&(r.delete(t),r.add(e[t]))}));t.forEach((t=>{(0,i.replaceKeyInMap)(this.localDocumentToClientRequestIds,t,e[t])}))}};class l extends i.SimpleQueryMappingManager{constructor(){super(...arguments),this.stateService=new u.StateService,this.querySubscriptionIdToQuery={}}async addQuery(e,t,r){this.stateService.runInBatch((()=>{let e=0;const n=new Set;for(const o of t.conditions){const a=this.getConditionStatePath(t,o),s=[...this.stateService.getStateInPath(a)||[]];if((0,i.insertSorted)(s,r),["==","!="].includes(o.operator)){const t=(0,i.encodeValueForMapping)(o.fieldName);n.has(t)||(e++,n.add(t))}else e++;this.stateService.setInPath(a,s)}if(!t.conditions.length){const e=["queryMapping",t.collectionName,t.integrationId,"mapping","unconditional"],n=[...this.stateService.getStateInPath(e)||[]];(0,i.insertSorted)(n,r),this.stateService.setInPath(e,n)}this.stateService.setInPath([...this.getQueryMetadataStatePath(t,r),"condCount"],e)})),this.querySubscriptionIdToQuery[r]=t}async removeQuery(e,t){const r=this.querySubscriptionIdToQuery[t];if(r)return this.stateService.runInBatch((()=>{for(const e of r.conditions){const n=this.getConditionStatePath(r,e),o=[...this.stateService.getStateInPath(n)||[]];(0,i.removeSorted)(o,t),o.length?this.stateService.setInPath(n,o):this.stateService.deletePath(n)}if(!r.conditions.length){const e=["queryMapping",r.collectionName,r.integrationId,"mapping","unconditional"],n=[...this.stateService.getStateInPath(e)||[]];(0,i.removeSorted)(n,t),this.stateService.setInPath(e,n)}this.stateService.deletePath(this.getQueryMetadataStatePath(r,t))})),r}getMapping(e,t,r){return this.stateService.getStateInPath(["queryMapping",t,r,"mapping"])}removeLocalDevAppData(e){return Promise.resolve(void 0)}getQueryMetadataStatePath(e,t){return["queryMapping",e.collectionName,e.integrationId,"mapping","queriesMetadata",`${t}`]}getConditionStatePath(e,t){const r=(0,i.encodeValueForMapping)(t.fieldName),n=(0,i.encodeValueForMapping)(t.value);return["queryMapping",e.collectionName,e.integrationId,"mapping","conditional",`${r}`,`${t.operator}`,`${n}`]}}},602:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RpcError=t.RpcManager=void 0;const n=r(9312),i=r(575),o=n.__importDefault(r(9031)),a=r(2937);t.RpcManager=class{constructor(e,t,r,n={},o,s){this.rpcEndpoint=e,this.socketManager=t,this.destructManager=r,this.headers=n,this.authManager=o,this.clientIdService=s,this.staticHeaders={},this.onGoingRpcCounter=new a.BehaviorSubject(0),(0,i.assertTruthy)(e,"Http endpoint must be provided.");for(const[e,t]of Object.entries(n))this.setStaticHeader(e,t);const u=this.authManager.getApiKey();u&&this.setStaticHeader("Authorization",`ApiKey ${u}`),this.clientIdService.observeClientId().subscribe((e=>{e?this.setStaticHeader("x-squid-clientId",e):this.deleteStaticHeader("x-squid-clientId")})),this.rpcEndpoint.endsWith("/")||(this.rpcEndpoint+="/"),this.authManager.observeAuthIdToken().subscribe((e=>{if(e.token){let t=`Bearer ${e.token}`;e.integrationId&&(t+=`; IntegrationId ${e.integrationId}`),this.setStaticHeader("Authorization",t)}else this.deleteStaticHeader("Authorization")})),r.onDestruct((async()=>{await this.awaitAllSettled()}))}async awaitAllSettled(){await(0,a.firstValueFrom)(this.onGoingRpcCounter.pipe((0,a.filter)((e=>0===e))))}setStaticHeader(e,t){this.staticHeaders[e]=t}deleteStaticHeader(e){delete this.staticHeaders[e]}getEndpoint(){return this.rpcEndpoint}getStaticHeaders(){return this.staticHeaders}async post(e,t){this.onGoingRpcCounter.next(this.onGoingRpcCounter.value+1);try{await(0,a.firstValueFrom)((0,a.race)(this.socketManager.observeConnectionReady().pipe((0,a.filter)(Boolean)),this.destructManager.observeIsDestructing())),await this.authManager.waitForReadyState();let r={"Content-Type":"application/json"};Object.keys(this.staticHeaders)&&(r=Object.assign(Object.assign({},r),this.staticHeaders));const n=await(0,o.default)(`${this.rpcEndpoint}${e}`,{method:"POST",body:(0,i.serializeObj)(t),headers:r});let u,c;try{u=await n.text();try{c=JSON.parse(u)}catch(e){}}catch(e){u="Cannot read body"}if(!n.ok)throw new s(n.status,n.statusText,n.headers,n.url,null==c?void 0:c.message);return c||u}finally{this.onGoingRpcCounter.next(this.onGoingRpcCounter.value-1)}}};class s extends Error{constructor(e,t,r,n,i){super(i||`RPC error ${e} ${t} calling ${n}`),this.statusCode=e,this.statusText=t,this.headers=r,this.url=n}}t.RpcError=s},3474:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SocketManager=void 0;const n=r(575),i=r(2937),o=r(8087),a=r(266);t.SocketManager=class{constructor(e,t,r=a.NOOP_FN,n,o={},s){this.clientIdService=e,this.socketIoEndpoint=t,this.messageNotificationWrapper=r,this.destructManager=n,this.authManager=s,this.webSocketObserver=new i.Subject,this.allMessagesObserver=new i.Subject,this.connectionReady=new i.BehaviorSubject(!1),this.seenMessageIds=new Set,this.firstConnection=!0,this.clientTooOldThreshold=3e5,this.destructManager.onDestruct((async()=>{await this.destruct()})),this.setupMessageAcknowledgments(),this.connect(Object.assign({},o)),this.connectionReady.pipe((0,i.skip)(1),(0,i.filter)((e=>!e)),(0,i.switchMap)((()=>(0,i.race)((0,i.timer)(this.clientTooOldThreshold),this.connectionReady.pipe((0,i.filter)(Boolean)),this.destructManager.observeIsDestructing())))).subscribe((()=>{this.connectionReady.value||this.destructManager.isDestructing||(this.clientIdService.notifyClientTooOld(),this.connect(Object.assign({},o)))})),this.connectionReady.pipe((0,i.filter)(Boolean)).subscribe((()=>{this.clientIdService.isClientTooOld()&&this.clientIdService.notifyClientReadyToBeRegenerated()}))}observeNotifications(){return this.webSocketObserver.asObservable()}observeConnectionReady(){return this.connectionReady.asObservable().pipe((0,i.distinctUntilChanged)())}sendMessage(e){this.authManager.waitForReadyState().then((()=>{(0,i.firstValueFrom)(this.connectionReady.pipe((0,i.filter)(Boolean))).then((()=>{const t=this.authManager.getAuthToken();(0,n.truthy)(this.socket).emit("message",Object.assign(Object.assign({},e),{authToken:t}))}))}))}connect(e){const t={clientId:this.clientIdService.getClientId()};this.socket=(0,o.io)(this.socketIoEndpoint,{query:t,reconnectionDelay:5e3,transports:["websocket"],extraHeaders:e}),this.socket.on("disconnect",((e,t)=>{this.connectionReady.next(!1)})),this.socket.on("connectionReady",(()=>{this.connectionReady.next(!0),this.firstConnection||this.sendMessage({type:"catchup"}),this.firstConnection=!1})),this.socket.on("message",(e=>{const t=(0,n.deserializeObj)(e);for(const e of t)this.allMessagesObserver.next(e),this.seenMessageIds.has(e.messageId)||(this.seenMessageIds.add(e.messageId),this.messageNotificationWrapper((()=>{this.webSocketObserver.next(e)})))}))}setupMessageAcknowledgments(){const e=new i.Subject;this.allMessagesObserver.subscribe((t=>{(null==t?void 0:t.messageId)&&e.next(t.messageId)}));const t=[];e.pipe((0,i.tap)((e=>t.push(e))),(0,i.debounceTime)(100)).subscribe((async()=>{const e=[...t.splice(0)];this.sendMessage({type:"acknowledge",payload:e})}))}async destruct(){var e;this.sendMessage({type:"kill"}),this.connectionReady.next(!1),await(0,i.firstValueFrom)((0,i.timer)(0)),null===(e=this.socket)||void 0===e||e.disconnect(),this.webSocketObserver.complete(),this.allMessagesObserver.complete()}}},5395:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Squid=void 0;const n=r(9312),i=r(575),o=r(2937),a=r(5969),s=r(4268),u=r(9526),c=r(8862),l=r(7378),f=r(1600),d=r(4967),p=r(7787),h=r(4605),y=n.__importDefault(r(2256)),v=r(2417),m=r(5182),b=r(5621),g=r(7718),_=r(9194),O=r(9732),w=r(6891),S=r(4661),E=r(602),I=r(3474),P=r(136);class T{constructor(e){this.destructManager=new p.DestructManager,this.setAuthIdToken=(e,t)=>{this.authManager.setAuthIdToken(e,t)},this.collection=(e,t=i.IntegrationType.built_in_db)=>(this.validateNotDestructed(),this.collectionReferenceFactory.get(e,t)),this.runInTransaction=e=>(this.validateNotDestructed(),this.dataManager.runInTransaction(e)),this.executeFunction=(e,...t)=>(this.validateNotDestructed(),(0,o.firstValueFrom)(this.backendFunctionManager.executeFunctionAndSubscribe(e,...t))),this.executeNamedQuery=(e,t,r)=>(this.validateNotDestructed(),(0,o.firstValueFrom)(this.namedQueryManager.executeNamedQueryAndSubscribe(e,t,r))),this.callApi=(e,t,r={})=>(this.validateNotDestructed(),(0,o.firstValueFrom)(this.apiManager.callApiAndSubscribe(e,t,r))),this.graphql=e=>(this.validateNotDestructed(),this.graphqlClientFactory.get(e)),this.ai=()=>(this.validateNotDestructed(),{assistant:e=>this.aiClientFactory.getAssistant(e)}),this.acquireLock=(e,t=!0)=>(this.validateNotDestructed(),this.distributedLockManager.lock(e,t)),this.destruct=async()=>{if(!this.destructManager.isDestructing)return this.destructManager.destruct().finally((()=>{const e=Object.entries(T.squidInstancesMap).find((([,e])=>e===this));e&&delete T.squidInstancesMap[e[0]]}))},this.connectionDetails=()=>(this.validateNotDestructed(),this._connectionDetails),this.unsubscribe=async()=>{this.querySubscriptionManager.unsubscribe(),await this.rpcManager.awaitAllSettled()},(0,i.assertTruthy)(e.appId,"APP_ID_MUST_BE_PROVIDED");const t="prod"!==e.environmentId&&e.squidDeveloperId,r=(0,i.appIdWithEnvironmentIdAndDevId)(e.appId,e.environmentId,t?e.squidDeveloperId:void 0),n=(0,i.getApplicationUrl)(e.region,r),j=(0,i.getApplicationHttpHeaders)(e.region,r);this.clientIdService=new l.ClientIdService(this.destructManager),this.authManager=new u.AuthManager(this.destructManager,e.apiKey),this.socketManager=new I.SocketManager(this.clientIdService,n,e.messageNotificationWrapper,this.destructManager,j,this.authManager),this.rpcManager=new E.RpcManager(n,this.socketManager,this.destructManager,j,this.authManager,this.clientIdService),this.documentStore=new m.DocumentStore,this.lockManager=new i.LockManager,this.distributedLockManager=new h.DistributedLockManager(this.socketManager,this.destructManager),this.documentIdentityService=new y.default(this.documentStore,this.destructManager),this.documentReferenceFactory=new v.DocumentReferenceFactory,this.querySubscriptionManager=new S.QuerySubscriptionManager(this.rpcManager,this.clientIdService,this.documentStore,this.destructManager,this.documentIdentityService);const A=new g.MutationSender(this.rpcManager,this.lockManager,this.querySubscriptionManager);this.queryBuilderFactory=new w.QueryBuilderFactory(this.querySubscriptionManager,this.documentReferenceFactory,this.documentIdentityService),this.joinQueryBuilderFactory=new O.JoinQueryBuilderFactory(this.querySubscriptionManager,this.documentReferenceFactory,this.queryBuilderFactory),this.collectionReferenceFactory=new f.CollectionReferenceFactory(this.documentReferenceFactory,this.queryBuilderFactory,this.joinQueryBuilderFactory,this.documentIdentityService),this.dataManager=new d.DataManager(this.documentStore,A,this.socketManager,this.querySubscriptionManager,this.queryBuilderFactory,this.lockManager,this.destructManager,this.documentIdentityService),this.documentReferenceFactory.setDataManager(this.dataManager),this.backendFunctionManager=new c.BackendFunctionManager(this.clientIdService,this.rpcManager,this.socketManager),this.namedQueryManager=new _.NamedQueryManager(this.rpcManager,this.socketManager),this.apiManager=new s.ApiManager(this.clientIdService,this.rpcManager,this.socketManager,e.apiServerUrlOverrideMapping),this.graphqlClientFactory=new b.GraphQLClientFactory(this.rpcManager),this.aiClientFactory=new a.AiClientFactory(this.rpcManager,this.socketManager),this._connectionDetails=new P.ConnectionDetails(this.clientIdService,this.socketManager)}static getInstance(e){const t=(0,i.normalizeJsonAsString)(e);let r=T.squidInstancesMap[t];return r||(r=new T(e),T.squidInstancesMap[t]=r,r)}static getInstances(){return Object.values(T.squidInstancesMap)}validateNotDestructed(){(0,i.assertTruthy)(!this.destructManager.isDestructing,"The client was already destructed.")}}t.Squid=T,T.squidInstancesMap={}},1064:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isStateObject=t.apply=void 0;const n=r(1496);function i(e){return"object"==typeof e}function o(e,t){let r=e;if((0,n.isPathAction)(t))r=function(e,t,r=[]){switch(t.type){case n.ActionType.DELETE_PATH:return a(e,t.path);case n.ActionType.SET_PATH:const i=t;return function(e,t,r,n){return s(e,t,r,n)}(e,t.path,r,i.payload);case n.ActionType.BATCH_ACTION:throw new Error("Unsupported")}}(e,t,[]);else{if(!(0,n.isBatchAction)(t))throw new Error(`Invalid action type: ${t.type}`);r=t.payload.reduce(((e,t)=>o(e,t)),e)}return r}function a(e,t){if(!t.length)throw new Error("can not delete an empty path");const r=t[0];if(1===t.length)return function(e,t){if(e instanceof Array)throw new Error("Cannot remove an item from an array");const r=Object.assign({},e);return delete r[t],r}(e,r);const n=t.slice(1),o=c(e,r);if(!o)return e;if(!i(o))throw new Error("Cannot delete from a non object state.");const s=a(o,n);return s===o?e:u(e,r,s)}function s(e,t,r,n){if(!t.length){if(i(n))return n;throw new Error("Relative path cannot be of length 0 when the new value is not an object.")}const o=t[0],a=[...r,o];if(1===t.length)return u(e,o,n);const l=t.slice(1),f=c(e,o);return void 0!==f&&i(f)?u(e,o,s(f,l,a,n)):s(e=u(e,o,{}),t,r,n)}function u(e,t,r){return(e=Object.assign({},e))[t]=r,e}function c(e,t){return e instanceof Array?e[function(e){const t=Number(e);if(isNaN(t))throw new Error(`The value is not a number: Actual: ${e}`);return Math.floor(t)}(t)]:e[t]}t.apply=function(e,t){return o(e,t)},t.isStateObject=i},1496:(e,t)=>{"use strict";var r;function n(e){return[r.SET_PATH,r.DELETE_PATH].includes(e.type)}function i(e){return e.type===r.BATCH_ACTION}Object.defineProperty(t,"__esModule",{value:!0}),t.getSingleAction=t.extractAllPathActions=t.isBatchAction=t.isDeletePathAction=t.isSetPathAction=t.isPathAction=t.ActionType=void 0,function(e){e.DELETE_PATH="DELETE_PATH",e.SET_PATH="SET_PATH",e.BATCH_ACTION="BATCH_ACTION"}(r=t.ActionType||(t.ActionType={})),t.isPathAction=n,t.isSetPathAction=function(e){return e.type===r.SET_PATH},t.isDeletePathAction=function(e){return e.type===r.DELETE_PATH},t.isBatchAction=i,t.extractAllPathActions=function e(t){const r=[];if(n(t))r.push(t);else if(i(t))for(const n of t.payload)r.push(...e(n));return r},t.getSingleAction=function(e){return 1===e.length?e[0]:{type:r.BATCH_ACTION,payload:e}}},8336:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getPathTrieFromAction=t.PathTrieNode=t.PathTrie=void 0;const n=r(1496);class i{constructor(){this.root=new o}getOrCreatePathTrieNode(e,t){let r=this.root;for(const t of e)r.children.get(t)||r.children.set(t,new o),r=r.children.get(t);return void 0!==t&&(r.nodeData=t),r}getPathTrieNode(e){let t=this.root;for(const r of e){if(!t)return;t=t.children.get(r)}return t}getPathTrie(e){let t=this.root;for(const r of e){if(!t)return;t=t.children.get(r)}if(t){const e=new i;return e.root=t,e}}iterateBfs(e){this.iterateInternal(this.root,e,[])}removeNode(e){e.length||(this.root=new o);const t=[this.root];for(const r of e){const e=t[t.length-1].children.get(r);if(!e)throw new Error("Node does not exist");t.push(e)}for(let r=t.length-1;r>0;r--){const n=t[r],i=e[r-1];if((n.nodeData||n.children.size)&&r!==t.length-1)break;t[r-1].children.delete(i)}}clearNodeData(e){const t=this.getPathTrieNode(e);t&&(t.nodeData=void 0,t.children.size||this.removeNode(e))}getNodeList(e){const t=[];let r=this.root;for(const n of e){if(!r)return t;t.push(r),r=r.children.get(n)}return t}iterateInternal(e,t,r){if(!1!==t(e.nodeData,r))for(const[n,i]of e.children)this.iterateInternal(i,t,r.concat(n))}}t.PathTrie=i;class o{constructor(){this.children=new Map([])}}t.PathTrieNode=o,t.getPathTrieFromAction=function(e,t){const r=new i;for(const i of(0,n.extractAllPathActions)(e)){let e=r.getOrCreatePathTrieNode(i.path);if(!t||e.nodeData)continue;let n=t.getPathTrieNode(i.path);if(n){const t=[[e,n]];for(;t.length;){const r=t.shift();if(e=r[0],n=r[1],!e.nodeData){for(const[r,i]of n.children)e.children.get(r)||e.children.set(r,new o),t.push([e.children.get(r),i]);e.nodeData=!0}}}}return r}},1122:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StateService=void 0;const n=r(2937),i=r(9978),o=r(1064),a=r(1496),s=r(8336);function u(e,t){let r=e;for(const e of t){if(null==r)return;if(!(0,o.isStateObject)(r))throw new Error("result must be a state object");r=r[e]}return r}t.StateService=class{constructor(){this.subscriptionsTree=new s.PathTrie,this.state={},this.batchCount=0,this.batchedActions=[]}dispatch(e){this.batchCount>0&&this.batchedActions.push(e),this.state=(0,o.apply)(this.state,e),0===this.batchCount&&this.dispatchSubscriptions(e)}runInBatch(e){this.batchCount++;try{e()}finally{if(this.batchCount--,0===this.batchCount&&this.batchedActions.length){const e={type:a.ActionType.BATCH_ACTION,payload:[...this.batchedActions]};this.batchedActions.splice(0),this.dispatch(e)}}}observePath(e,t){return new n.Observable((r=>{const n=this.getOrCreateSubjectForPath(e);r.next(this.getStateInPath(e));const o=n.pipe((0,i.filter)((e=>{if(!t)return!0;const r=new s.PathTrie,n=t();for(const e of n)r.getOrCreatePathTrieNode(e,!0);const i=(0,a.extractAllPathActions)(e.action).map((e=>e.path));let o=!1;for(const e of i)if(0===r.getNodeList(e).length){o=!0;break}return o})),(0,i.map)((e=>e.data))).subscribe(r);return()=>{o.unsubscribe(),n.observed||(n.complete(),this.subscriptionsTree.clearNodeData(e))}}))}setKeyInPath(e,t,r,n=!1){this.setInPath([...e,t],r,n)}setPartial(e,t,r=!1){let n=this.getStateInPath(e);n||(n={}),this.setInPath(e,Object.assign(Object.assign({},n),t),r)}setInPath(e,t,r=!1){if(r&&this.getStateInPath(e)===t)return;const n={type:a.ActionType.SET_PATH,path:e,payload:t};this.dispatch(n)}pushToArray(e,t){let r=this.getStateInPath(e);r=r?[...r]:[],r.push(t),this.setInPath(e,r)}deletePath(e){const t={type:a.ActionType.DELETE_PATH,path:e};this.dispatch(t)}getState(){return this.state}getStateInPath(e){return u(this.state,e)}destroy(){this.subscriptionsTree.iterateBfs((e=>{e&&e.subject&&e.subject.complete()}))}getOrCreateSubjectForPath(e){const t=this.subscriptionsTree.getOrCreatePathTrieNode(e);t.nodeData||(t.nodeData=new c);const r=t.nodeData;return r.subject||(r.subject=new n.Subject),r.subject}dispatchSubscriptions(e){(0,s.getPathTrieFromAction)(e,this.subscriptionsTree).iterateBfs(((t,r)=>{const n=this.subscriptionsTree.getPathTrieNode(r);n&&n.nodeData&&n.nodeData.subject.next({action:e,data:u(this.getState(),r)})}))}};class c{}},266:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NOOP_FN=void 0,t.NOOP_FN=e=>e()},9312:(e,t,r)=>{"use strict";r.r(t),r.d(t,{__assign:()=>o,__asyncDelegator:()=>I,__asyncGenerator:()=>E,__asyncValues:()=>P,__await:()=>S,__awaiter:()=>h,__classPrivateFieldGet:()=>k,__classPrivateFieldIn:()=>N,__classPrivateFieldSet:()=>M,__createBinding:()=>v,__decorate:()=>s,__esDecorate:()=>c,__exportStar:()=>m,__extends:()=>i,__generator:()=>y,__importDefault:()=>x,__importStar:()=>A,__makeTemplateObject:()=>T,__metadata:()=>p,__param:()=>u,__propKey:()=>f,__read:()=>g,__rest:()=>a,__runInitializers:()=>l,__setFunctionName:()=>d,__spread:()=>_,__spreadArray:()=>w,__spreadArrays:()=>O,__values:()=>b});var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)};function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var o=function(){return o=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},o.apply(this,arguments)};function a(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r}function s(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a}function u(e,t){return function(r,n){t(r,n,e)}}function c(e,t,r,n,i,o){function a(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var s,u=n.kind,c="getter"===u?"get":"setter"===u?"set":"value",l=!t&&e?n.static?e:e.prototype:null,f=t||(l?Object.getOwnPropertyDescriptor(l,n.name):{}),d=!1,p=r.length-1;p>=0;p--){var h={};for(var y in n)h[y]="access"===y?{}:n[y];for(var y in n.access)h.access[y]=n.access[y];h.addInitializer=function(e){if(d)throw new TypeError("Cannot add initializers after decoration has completed");o.push(a(e||null))};var v=(0,r[p])("accessor"===u?{get:f.get,set:f.set}:f[c],h);if("accessor"===u){if(void 0===v)continue;if(null===v||"object"!=typeof v)throw new TypeError("Object expected");(s=a(v.get))&&(f.get=s),(s=a(v.set))&&(f.set=s),(s=a(v.init))&&i.push(s)}else(s=a(v))&&("field"===u?i.push(s):f[c]=s)}l&&Object.defineProperty(l,n.name,f),d=!0}function l(e,t,r){for(var n=arguments.length>2,i=0;i<t.length;i++)r=n?t[i].call(e,r):t[i].call(e);return n?r:void 0}function f(e){return"symbol"==typeof e?e:"".concat(e)}function d(e,t,r){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:r?"".concat(r," ",t):t})}function p(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function h(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))}function y(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(u){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{r=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}}var v=Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]};function m(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||v(t,e,r)}function b(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.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 new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function g(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return a}function _(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(g(arguments[t]));return e}function O(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var n=Array(e),i=0;for(t=0;t<r;t++)for(var o=arguments[t],a=0,s=o.length;a<s;a++,i++)n[i]=o[a];return n}function w(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}function S(e){return this instanceof S?(this.v=e,this):new S(e)}function E(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,i=r.apply(e,t||[]),o=[];return n={},a("next"),a("throw"),a("return"),n[Symbol.asyncIterator]=function(){return this},n;function a(e){i[e]&&(n[e]=function(t){return new Promise((function(r,n){o.push([e,t,r,n])>1||s(e,t)}))})}function s(e,t){try{(r=i[e](t)).value instanceof S?Promise.resolve(r.value.v).then(u,c):l(o[0][2],r)}catch(e){l(o[0][3],e)}var r}function u(e){s("next",e)}function c(e){s("throw",e)}function l(e,t){e(t),o.shift(),o.length&&s(o[0][0],o[0][1])}}function I(e){var t,r;return t={},n("next"),n("throw",(function(e){throw e})),n("return"),t[Symbol.iterator]=function(){return this},t;function n(n,i){t[n]=e[n]?function(t){return(r=!r)?{value:S(e[n](t)),done:!1}:i?i(t):t}:i}}function P(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=b(e),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise((function(n,i){!function(e,t,r,n){Promise.resolve(n).then((function(t){e({value:t,done:r})}),t)}(n,i,(t=e[r](t)).done,t.value)}))}}}function T(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var j=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};function A(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&v(t,e,r);return j(t,e),t}function x(e){return e&&e.__esModule?e:{default:e}}function k(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)}function M(e,t,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(e,r):i?i.value=r:t.set(e,r),r}function N(e,t){if(null===t||"object"!=typeof t&&"function"!=typeof t)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof e?t===e:e.has(t)}},2371:function(e,t){!function(e){"use strict";function t(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];if(t.length>1){t[0]=t[0].slice(0,-1);for(var n=t.length-1,i=1;i<n;++i)t[i]=t[i].slice(1,-1);return t[n]=t[n].slice(1),t.join("")}return t[0]}function r(e){return"(?:"+e+")"}function n(e){return void 0===e?"undefined":null===e?"null":Object.prototype.toString.call(e).split(" ").pop().split("]").shift().toLowerCase()}function i(e){return e.toUpperCase()}function o(e){var n="[A-Za-z]",i="[0-9]",o=t(i,"[A-Fa-f]"),a=r(r("%[EFef]"+o+"%"+o+o+"%"+o+o)+"|"+r("%[89A-Fa-f]"+o+"%"+o+o)+"|"+r("%"+o+o)),s="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",u=t("[\\:\\/\\?\\#\\[\\]\\@]",s),c=e?"[\\uE000-\\uF8FF]":"[]",l=t(n,i,"[\\-\\.\\_\\~]",e?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]"),f=r(n+t(n,i,"[\\+\\-\\.]")+"*"),d=r(r(a+"|"+t(l,s,"[\\:]"))+"*"),p=(r(r("25[0-5]")+"|"+r("2[0-4]"+i)+"|"+r("1"+i+i)+"|"+r("[1-9]"+i)+"|"+i),r(r("25[0-5]")+"|"+r("2[0-4]"+i)+"|"+r("1"+i+i)+"|"+r("0?[1-9]"+i)+"|0?0?"+i)),h=r(p+"\\."+p+"\\."+p+"\\."+p),y=r(o+"{1,4}"),v=r(r(y+"\\:"+y)+"|"+h),m=r(r(y+"\\:")+"{6}"+v),b=r("\\:\\:"+r(y+"\\:")+"{5}"+v),g=r(r(y)+"?\\:\\:"+r(y+"\\:")+"{4}"+v),_=r(r(r(y+"\\:")+"{0,1}"+y)+"?\\:\\:"+r(y+"\\:")+"{3}"+v),O=r(r(r(y+"\\:")+"{0,2}"+y)+"?\\:\\:"+r(y+"\\:")+"{2}"+v),w=r(r(r(y+"\\:")+"{0,3}"+y)+"?\\:\\:"+y+"\\:"+v),S=r(r(r(y+"\\:")+"{0,4}"+y)+"?\\:\\:"+v),E=r(r(r(y+"\\:")+"{0,5}"+y)+"?\\:\\:"+y),I=r(r(r(y+"\\:")+"{0,6}"+y)+"?\\:\\:"),P=r([m,b,g,_,O,w,S,E,I].join("|")),T=r(r(l+"|"+a)+"+"),j=(r(P+"\\%25"+T),r(P+r("\\%25|\\%(?!"+o+"{2})")+T)),A=r("[vV]"+o+"+\\."+t(l,s,"[\\:]")+"+"),x=r("\\["+r(j+"|"+P+"|"+A)+"\\]"),k=r(r(a+"|"+t(l,s))+"*"),M=r(x+"|"+h+"(?!"+k+")|"+k),N=r(i+"*"),D=r(r(d+"@")+"?"+M+r("\\:"+N)+"?"),R=r(a+"|"+t(l,s,"[\\:\\@]")),C=r(R+"*"),F=r(R+"+"),$=r(r(a+"|"+t(l,s,"[\\@]"))+"+"),q=r(r("\\/"+C)+"*"),L=r("\\/"+r(F+q)+"?"),V=r($+q),U=r(F+q),Q="(?!"+R+")",z=(r(q+"|"+L+"|"+V+"|"+U+"|"+Q),r(r(R+"|"+t("[\\/\\?]",c))+"*")),B=r(r(R+"|[\\/\\?]")+"*"),W=r(r("\\/\\/"+D+q)+"|"+L+"|"+U+"|"+Q),Y=r(f+"\\:"+W+r("\\?"+z)+"?"+r("\\#"+B)+"?"),K=r(r("\\/\\/"+D+q)+"|"+L+"|"+V+"|"+Q),H=r(K+r("\\?"+z)+"?"+r("\\#"+B)+"?");return r(Y+"|"+H),r(f+"\\:"+W+r("\\?"+z)+"?"),r(r("\\/\\/("+r("("+d+")@")+"?("+M+")"+r("\\:("+N+")")+"?)")+"?("+q+"|"+L+"|"+U+"|"+Q+")"),r("\\?("+z+")"),r("\\#("+B+")"),r(r("\\/\\/("+r("("+d+")@")+"?("+M+")"+r("\\:("+N+")")+"?)")+"?("+q+"|"+L+"|"+V+"|"+Q+")"),r("\\?("+z+")"),r("\\#("+B+")"),r(r("\\/\\/("+r("("+d+")@")+"?("+M+")"+r("\\:("+N+")")+"?)")+"?("+q+"|"+L+"|"+U+"|"+Q+")"),r("\\?("+z+")"),r("\\#("+B+")"),r("("+d+")@"),r("\\:("+N+")"),{NOT_SCHEME:new RegExp(t("[^]",n,i,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(t("[^\\%\\:]",l,s),"g"),NOT_HOST:new RegExp(t("[^\\%\\[\\]\\:]",l,s),"g"),NOT_PATH:new RegExp(t("[^\\%\\/\\:\\@]",l,s),"g"),NOT_PATH_NOSCHEME:new RegExp(t("[^\\%\\/\\@]",l,s),"g"),NOT_QUERY:new RegExp(t("[^\\%]",l,s,"[\\:\\@\\/\\?]",c),"g"),NOT_FRAGMENT:new RegExp(t("[^\\%]",l,s,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(t("[^]",l,s),"g"),UNRESERVED:new RegExp(l,"g"),OTHER_CHARS:new RegExp(t("[^\\%]",l,u),"g"),PCT_ENCODED:new RegExp(a,"g"),IPV4ADDRESS:new RegExp("^("+h+")$"),IPV6ADDRESS:new RegExp("^\\[?("+P+")"+r(r("\\%25|\\%(?!"+o+"{2})")+"("+T+")")+"?\\]?$")}}var a=o(!1),s=o(!0),u=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var r=[],n=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){i=!0,o=e}finally{try{!n&&s.return&&s.return()}finally{if(i)throw o}}return r}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},c=2147483647,l=36,f=/^xn--/,d=/[^\0-\x7E]/,p=/[\x2E\u3002\uFF0E\uFF61]/g,h={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},y=Math.floor,v=String.fromCharCode;function m(e){throw new RangeError(h[e])}function b(e,t){var r=e.split("@"),n="";return r.length>1&&(n=r[0]+"@",e=r[1]),n+function(e,t){for(var r=[],n=e.length;n--;)r[n]=t(e[n]);return r}((e=e.replace(p,".")).split("."),t).join(".")}function g(e){for(var t=[],r=0,n=e.length;r<n;){var i=e.charCodeAt(r++);if(i>=55296&&i<=56319&&r<n){var o=e.charCodeAt(r++);56320==(64512&o)?t.push(((1023&i)<<10)+(1023&o)+65536):(t.push(i),r--)}else t.push(i)}return t}var _=function(e,t){return e+22+75*(e<26)-((0!=t)<<5)},O=function(e,t,r){var n=0;for(e=r?y(e/700):e>>1,e+=y(e/t);e>455;n+=l)e=y(e/35);return y(n+36*e/(e+38))},w=function(e){var t,r=[],n=e.length,i=0,o=128,a=72,s=e.lastIndexOf("-");s<0&&(s=0);for(var u=0;u<s;++u)e.charCodeAt(u)>=128&&m("not-basic"),r.push(e.charCodeAt(u));for(var f=s>0?s+1:0;f<n;){for(var d=i,p=1,h=l;;h+=l){f>=n&&m("invalid-input");var v=(t=e.charCodeAt(f++))-48<10?t-22:t-65<26?t-65:t-97<26?t-97:l;(v>=l||v>y((c-i)/p))&&m("overflow"),i+=v*p;var b=h<=a?1:h>=a+26?26:h-a;if(v<b)break;var g=l-b;p>y(c/g)&&m("overflow"),p*=g}var _=r.length+1;a=O(i-d,_,0==d),y(i/_)>c-o&&m("overflow"),o+=y(i/_),i%=_,r.splice(i++,0,o)}return String.fromCodePoint.apply(String,r)},S=function(e){var t=[],r=(e=g(e)).length,n=128,i=0,o=72,a=!0,s=!1,u=void 0;try{for(var f,d=e[Symbol.iterator]();!(a=(f=d.next()).done);a=!0){var p=f.value;p<128&&t.push(v(p))}}catch(e){s=!0,u=e}finally{try{!a&&d.return&&d.return()}finally{if(s)throw u}}var h=t.length,b=h;for(h&&t.push("-");b<r;){var w=c,S=!0,E=!1,I=void 0;try{for(var P,T=e[Symbol.iterator]();!(S=(P=T.next()).done);S=!0){var j=P.value;j>=n&&j<w&&(w=j)}}catch(e){E=!0,I=e}finally{try{!S&&T.return&&T.return()}finally{if(E)throw I}}var A=b+1;w-n>y((c-i)/A)&&m("overflow"),i+=(w-n)*A,n=w;var x=!0,k=!1,M=void 0;try{for(var N,D=e[Symbol.iterator]();!(x=(N=D.next()).done);x=!0){var R=N.value;if(R<n&&++i>c&&m("overflow"),R==n){for(var C=i,F=l;;F+=l){var $=F<=o?1:F>=o+26?26:F-o;if(C<$)break;var q=C-$,L=l-$;t.push(v(_($+q%L,0))),C=y(q/L)}t.push(v(_(C,0))),o=O(i,A,b==h),i=0,++b}}}catch(e){k=!0,M=e}finally{try{!x&&D.return&&D.return()}finally{if(k)throw M}}++i,++n}return t.join("")},E={version:"2.1.0",ucs2:{decode:g,encode:function(e){return String.fromCodePoint.apply(String,function(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}(e))}},decode:w,encode:S,toASCII:function(e){return b(e,(function(e){return d.test(e)?"xn--"+S(e):e}))},toUnicode:function(e){return b(e,(function(e){return f.test(e)?w(e.slice(4).toLowerCase()):e}))}},I={};function P(e){var t=e.charCodeAt(0);return t<16?"%0"+t.toString(16).toUpperCase():t<128?"%"+t.toString(16).toUpperCase():t<2048?"%"+(t>>6|192).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase():"%"+(t>>12|224).toString(16).toUpperCase()+"%"+(t>>6&63|128).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase()}function T(e){for(var t="",r=0,n=e.length;r<n;){var i=parseInt(e.substr(r+1,2),16);if(i<128)t+=String.fromCharCode(i),r+=3;else if(i>=194&&i<224){if(n-r>=6){var o=parseInt(e.substr(r+4,2),16);t+=String.fromCharCode((31&i)<<6|63&o)}else t+=e.substr(r,6);r+=6}else if(i>=224){if(n-r>=9){var a=parseInt(e.substr(r+4,2),16),s=parseInt(e.substr(r+7,2),16);t+=String.fromCharCode((15&i)<<12|(63&a)<<6|63&s)}else t+=e.substr(r,9);r+=9}else t+=e.substr(r,3),r+=3}return t}function j(e,t){function r(e){var r=T(e);return r.match(t.UNRESERVED)?r:e}return e.scheme&&(e.scheme=String(e.scheme).replace(t.PCT_ENCODED,r).toLowerCase().replace(t.NOT_SCHEME,"")),void 0!==e.userinfo&&(e.userinfo=String(e.userinfo).replace(t.PCT_ENCODED,r).replace(t.NOT_USERINFO,P).replace(t.PCT_ENCODED,i)),void 0!==e.host&&(e.host=String(e.host).replace(t.PCT_ENCODED,r).toLowerCase().replace(t.NOT_HOST,P).replace(t.PCT_ENCODED,i)),void 0!==e.path&&(e.path=String(e.path).replace(t.PCT_ENCODED,r).replace(e.scheme?t.NOT_PATH:t.NOT_PATH_NOSCHEME,P).replace(t.PCT_ENCODED,i)),void 0!==e.query&&(e.query=String(e.query).replace(t.PCT_ENCODED,r).replace(t.NOT_QUERY,P).replace(t.PCT_ENCODED,i)),void 0!==e.fragment&&(e.fragment=String(e.fragment).replace(t.PCT_ENCODED,r).replace(t.NOT_FRAGMENT,P).replace(t.PCT_ENCODED,i)),e}function A(e){return e.replace(/^0*(.*)/,"$1")||"0"}function x(e,t){var r=e.match(t.IPV4ADDRESS)||[],n=u(r,2)[1];return n?n.split(".").map(A).join("."):e}function k(e,t){var r=e.match(t.IPV6ADDRESS)||[],n=u(r,3),i=n[1],o=n[2];if(i){for(var a=i.toLowerCase().split("::").reverse(),s=u(a,2),c=s[0],l=s[1],f=l?l.split(":").map(A):[],d=c.split(":").map(A),p=t.IPV4ADDRESS.test(d[d.length-1]),h=p?7:8,y=d.length-h,v=Array(h),m=0;m<h;++m)v[m]=f[m]||d[y+m]||"";p&&(v[h-1]=x(v[h-1],t));var b=v.reduce((function(e,t,r){if(!t||"0"===t){var n=e[e.length-1];n&&n.index+n.length===r?n.length++:e.push({index:r,length:1})}return e}),[]).sort((function(e,t){return t.length-e.length}))[0],g=void 0;if(b&&b.length>1){var _=v.slice(0,b.index),O=v.slice(b.index+b.length);g=_.join(":")+"::"+O.join(":")}else g=v.join(":");return o&&(g+="%"+o),g}return e}var M=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,N=void 0==="".match(/(){0}/)[1];function D(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={},n=!1!==t.iri?s:a;"suffix"===t.reference&&(e=(t.scheme?t.scheme+":":"")+"//"+e);var i=e.match(M);if(i){N?(r.scheme=i[1],r.userinfo=i[3],r.host=i[4],r.port=parseInt(i[5],10),r.path=i[6]||"",r.query=i[7],r.fragment=i[8],isNaN(r.port)&&(r.port=i[5])):(r.scheme=i[1]||void 0,r.userinfo=-1!==e.indexOf("@")?i[3]:void 0,r.host=-1!==e.indexOf("//")?i[4]:void 0,r.port=parseInt(i[5],10),r.path=i[6]||"",r.query=-1!==e.indexOf("?")?i[7]:void 0,r.fragment=-1!==e.indexOf("#")?i[8]:void 0,isNaN(r.port)&&(r.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?i[4]:void 0)),r.host&&(r.host=k(x(r.host,n),n)),void 0!==r.scheme||void 0!==r.userinfo||void 0!==r.host||void 0!==r.port||r.path||void 0!==r.query?void 0===r.scheme?r.reference="relative":void 0===r.fragment?r.reference="absolute":r.reference="uri":r.reference="same-document",t.reference&&"suffix"!==t.reference&&t.reference!==r.reference&&(r.error=r.error||"URI is not a "+t.reference+" reference.");var o=I[(t.scheme||r.scheme||"").toLowerCase()];if(t.unicodeSupport||o&&o.unicodeSupport)j(r,n);else{if(r.host&&(t.domainHost||o&&o.domainHost))try{r.host=E.toASCII(r.host.replace(n.PCT_ENCODED,T).toLowerCase())}catch(e){r.error=r.error||"Host's domain name can not be converted to ASCII via punycode: "+e}j(r,a)}o&&o.parse&&o.parse(r,t)}else r.error=r.error||"URI can not be parsed.";return r}var R=/^\.\.?\//,C=/^\/\.(\/|$)/,F=/^\/\.\.(\/|$)/,$=/^\/?(?:.|\n)*?(?=\/|$)/;function q(e){for(var t=[];e.length;)if(e.match(R))e=e.replace(R,"");else if(e.match(C))e=e.replace(C,"/");else if(e.match(F))e=e.replace(F,"/"),t.pop();else if("."===e||".."===e)e="";else{var r=e.match($);if(!r)throw new Error("Unexpected dot segment condition");var n=r[0];e=e.slice(n.length),t.push(n)}return t.join("")}function L(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.iri?s:a,n=[],i=I[(t.scheme||e.scheme||"").toLowerCase()];if(i&&i.serialize&&i.serialize(e,t),e.host)if(r.IPV6ADDRESS.test(e.host));else if(t.domainHost||i&&i.domainHost)try{e.host=t.iri?E.toUnicode(e.host):E.toASCII(e.host.replace(r.PCT_ENCODED,T).toLowerCase())}catch(r){e.error=e.error||"Host's domain name can not be converted to "+(t.iri?"Unicode":"ASCII")+" via punycode: "+r}j(e,r),"suffix"!==t.reference&&e.scheme&&(n.push(e.scheme),n.push(":"));var o=function(e,t){var r=!1!==t.iri?s:a,n=[];return void 0!==e.userinfo&&(n.push(e.userinfo),n.push("@")),void 0!==e.host&&n.push(k(x(String(e.host),r),r).replace(r.IPV6ADDRESS,(function(e,t,r){return"["+t+(r?"%25"+r:"")+"]"}))),"number"!=typeof e.port&&"string"!=typeof e.port||(n.push(":"),n.push(String(e.port))),n.length?n.join(""):void 0}(e,t);if(void 0!==o&&("suffix"!==t.reference&&n.push("//"),n.push(o),e.path&&"/"!==e.path.charAt(0)&&n.push("/")),void 0!==e.path){var u=e.path;t.absolutePath||i&&i.absolutePath||(u=q(u)),void 0===o&&(u=u.replace(/^\/\//,"/%2F")),n.push(u)}return void 0!==e.query&&(n.push("?"),n.push(e.query)),void 0!==e.fragment&&(n.push("#"),n.push(e.fragment)),n.join("")}function V(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n={};return arguments[3]||(e=D(L(e,r),r),t=D(L(t,r),r)),!(r=r||{}).tolerant&&t.scheme?(n.scheme=t.scheme,n.userinfo=t.userinfo,n.host=t.host,n.port=t.port,n.path=q(t.path||""),n.query=t.query):(void 0!==t.userinfo||void 0!==t.host||void 0!==t.port?(n.userinfo=t.userinfo,n.host=t.host,n.port=t.port,n.path=q(t.path||""),n.query=t.query):(t.path?("/"===t.path.charAt(0)?n.path=q(t.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?n.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:n.path=t.path:n.path="/"+t.path,n.path=q(n.path)),n.query=t.query):(n.path=e.path,void 0!==t.query?n.query=t.query:n.query=e.query),n.userinfo=e.userinfo,n.host=e.host,n.port=e.port),n.scheme=e.scheme),n.fragment=t.fragment,n}function U(e,t){return e&&e.toString().replace(t&&t.iri?s.PCT_ENCODED:a.PCT_ENCODED,T)}var Q={scheme:"http",domainHost:!0,parse:function(e,t){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e},serialize:function(e,t){var r="https"===String(e.scheme).toLowerCase();return e.port!==(r?443:80)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}},z={scheme:"https",domainHost:Q.domainHost,parse:Q.parse,serialize:Q.serialize};function B(e){return"boolean"==typeof e.secure?e.secure:"wss"===String(e.scheme).toLowerCase()}var W={scheme:"ws",domainHost:!0,parse:function(e,t){var r=e;return r.secure=B(r),r.resourceName=(r.path||"/")+(r.query?"?"+r.query:""),r.path=void 0,r.query=void 0,r},serialize:function(e,t){if(e.port!==(B(e)?443:80)&&""!==e.port||(e.port=void 0),"boolean"==typeof e.secure&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){var r=e.resourceName.split("?"),n=u(r,2),i=n[0],o=n[1];e.path=i&&"/"!==i?i:void 0,e.query=o,e.resourceName=void 0}return e.fragment=void 0,e}},Y={scheme:"wss",domainHost:W.domainHost,parse:W.parse,serialize:W.serialize},K={},H="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",G="[0-9A-Fa-f]",J=r(r("%[EFef]"+G+"%"+G+G+"%"+G+G)+"|"+r("%[89A-Fa-f]"+G+"%"+G+G)+"|"+r("%"+G+G)),Z=t("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),X=new RegExp(H,"g"),ee=new RegExp(J,"g"),te=new RegExp(t("[^]","[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]","[\\.]",'[\\"]',Z),"g"),re=new RegExp(t("[^]",H,"[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"),"g"),ne=re;function ie(e){var t=T(e);return t.match(X)?t:e}var oe={scheme:"mailto",parse:function(e,t){var r=e,n=r.to=r.path?r.path.split(","):[];if(r.path=void 0,r.query){for(var i=!1,o={},a=r.query.split("&"),s=0,u=a.length;s<u;++s){var c=a[s].split("=");switch(c[0]){case"to":for(var l=c[1].split(","),f=0,d=l.length;f<d;++f)n.push(l[f]);break;case"subject":r.subject=U(c[1],t);break;case"body":r.body=U(c[1],t);break;default:i=!0,o[U(c[0],t)]=U(c[1],t)}}i&&(r.headers=o)}r.query=void 0;for(var p=0,h=n.length;p<h;++p){var y=n[p].split("@");if(y[0]=U(y[0]),t.unicodeSupport)y[1]=U(y[1],t).toLowerCase();else try{y[1]=E.toASCII(U(y[1],t).toLowerCase())}catch(e){r.error=r.error||"Email address's domain name can not be converted to ASCII via punycode: "+e}n[p]=y.join("@")}return r},serialize:function(e,t){var r,n=e,o=null!=(r=e.to)?r instanceof Array?r:"number"!=typeof r.length||r.split||r.setInterval||r.call?[r]:Array.prototype.slice.call(r):[];if(o){for(var a=0,s=o.length;a<s;++a){var u=String(o[a]),c=u.lastIndexOf("@"),l=u.slice(0,c).replace(ee,ie).replace(ee,i).replace(te,P),f=u.slice(c+1);try{f=t.iri?E.toUnicode(f):E.toASCII(U(f,t).toLowerCase())}catch(e){n.error=n.error||"Email address's domain name can not be converted to "+(t.iri?"Unicode":"ASCII")+" via punycode: "+e}o[a]=l+"@"+f}n.path=o.join(",")}var d=e.headers=e.headers||{};e.subject&&(d.subject=e.subject),e.body&&(d.body=e.body);var p=[];for(var h in d)d[h]!==K[h]&&p.push(h.replace(ee,ie).replace(ee,i).replace(re,P)+"="+d[h].replace(ee,ie).replace(ee,i).replace(ne,P));return p.length&&(n.query=p.join("&")),n}},ae=/^([^\:]+)\:(.*)/,se={scheme:"urn",parse:function(e,t){var r=e.path&&e.path.match(ae),n=e;if(r){var i=t.scheme||n.scheme||"urn",o=r[1].toLowerCase(),a=r[2],s=i+":"+(t.nid||o),u=I[s];n.nid=o,n.nss=a,n.path=void 0,u&&(n=u.parse(n,t))}else n.error=n.error||"URN can not be parsed.";return n},serialize:function(e,t){var r=t.scheme||e.scheme||"urn",n=e.nid,i=r+":"+(t.nid||n),o=I[i];o&&(e=o.serialize(e,t));var a=e,s=e.nss;return a.path=(n||t.nid)+":"+s,a}},ue=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,ce={scheme:"urn:uuid",parse:function(e,t){var r=e;return r.uuid=r.nss,r.nss=void 0,t.tolerant||r.uuid&&r.uuid.match(ue)||(r.error=r.error||"UUID is not valid."),r},serialize:function(e,t){var r=e;return r.nss=(e.uuid||"").toLowerCase(),r}};I[Q.scheme]=Q,I[z.scheme]=z,I[W.scheme]=W,I[Y.scheme]=Y,I[oe.scheme]=oe,I[se.scheme]=se,I[ce.scheme]=ce,e.SCHEMES=I,e.pctEncChar=P,e.pctDecChars=T,e.parse=D,e.removeDotSegments=q,e.serialize=L,e.resolveComponents=V,e.resolve=function(e,t,r){var n=function(e,t){var r=e;if(t)for(var n in t)r[n]=t[n];return r}({scheme:"null"},r);return L(V(D(e,n),D(t,n),n,!0),n)},e.normalize=function(e,t){return"string"==typeof e?e=L(D(e,t),t):"object"===n(e)&&(e=D(L(e,t),t)),e},e.equal=function(e,t,r){return"string"==typeof e?e=L(D(e,r),r):"object"===n(e)&&(e=L(e,r)),"string"==typeof t?t=L(D(t,r),r):"object"===n(t)&&(t=L(t,r)),e===t},e.escapeComponent=function(e,t){return e&&e.toString().replace(t&&t.iri?s.ESCAPE:a.ESCAPE,P)},e.unescapeComponent=U,Object.defineProperty(e,"__esModule",{value:!0})}(t)},9031:e=>{"use strict";e.exports=require("cross-fetch")},8087:e=>{"use strict";e.exports=require("socket.io-client")},2948:(e,t,r)=>{"use strict";r.r(t),r.d(t,{ApolloCache:()=>xn,ApolloClient:()=>An,ApolloError:()=>br,ApolloLink:()=>_e,Cache:()=>Tn,HttpLink:()=>wt,InMemoryCache:()=>Ai,MissingFieldError:()=>kn,NetworkStatus:()=>mr,Observable:()=>Y,ObservableQuery:()=>Pr,checkFetcher:()=>Ge,concat:()=>Ni,createHttpLink:()=>Ot,createSignalIfSupported:()=>mt,defaultDataIdFromObject:()=>Rn,defaultPrinter:()=>ht,disableExperimentalFragmentVariables:()=>Po,disableFragmentWarnings:()=>Eo,empty:()=>xi,enableExperimentalFragmentVariables:()=>Io,execute:()=>Oe,fallbackHttpConfig:()=>pt,from:()=>ki,fromError:()=>gt,fromPromise:()=>Ri,gql:()=>wo,isApolloError:()=>vr,isReference:()=>X,makeReference:()=>Z,makeVar:()=>mn,mergeOptions:()=>Pn,parseAndCheckHttpResponse:()=>He,resetCaches:()=>So,rewriteURIForGET:()=>bt,selectHttpOptionsAndBody:()=>yt,selectHttpOptionsAndBodyInternal:()=>vt,selectURI:()=>Fe,serializeFetchParameter:()=>Ce,setLogVerbosity:()=>d,split:()=>Mi,throwServerError:()=>ze,toPromise:()=>Di});var n=r(9312),i="Invariant Violation",o=Object.setPrototypeOf,a=void 0===o?function(e,t){return e.__proto__=t,e}:o,s=function(e){function t(r){void 0===r&&(r=i);var n=e.call(this,"number"==typeof r?i+": "+r+" (see https://github.com/apollographql/invariant-packages)":r)||this;return n.framesToPop=1,n.name=i,a(n,t.prototype),n}return(0,n.__extends)(t,e),t}(Error);function u(e,t){if(!e)throw new s(t)}var c=["debug","log","warn","error","silent"],l=c.indexOf("log");function f(e){return function(){if(c.indexOf(e)>=l)return(console[e]||console.log).apply(console,arguments)}}function d(e){var t=c[l];return l=Math.max(0,c.indexOf(e)),t}function p(e){try{return e()}catch(e){}}!function(e){e.debug=f("debug"),e.log=f("log"),e.warn=f("warn"),e.error=f("error")}(u||(u={}));const h=p((function(){return globalThis}))||p((function(){return window}))||p((function(){return self}))||p((function(){return global}))||p((function(){return p.constructor("return this")()}));var y="__",v=[y,y].join("DEV");const m=function(){try{return Boolean(__DEV__)}catch(e){return Object.defineProperty(h,v,{value:"production"!==p((function(){return"production"})),enumerable:!1,configurable:!0,writable:!0}),h[v]}}();function b(e){try{return e()}catch(e){}}var g=b((function(){return globalThis}))||b((function(){return window}))||b((function(){return self}))||b((function(){return global}))||b((function(){return b.constructor("return this")()})),_=!1;function O(e,t){if(!Boolean(e))throw new Error(t)}!g||b((function(){return"production"}))||b((function(){return process}))||(Object.defineProperty(g,"process",{value:{env:{NODE_ENV:"production"}},configurable:!0,enumerable:!1,writable:!0}),_=!0);const w=10,S=2;function E(e){return I(e,[])}function I(e,t){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return function(e,t){if(null===e)return"null";if(t.includes(e))return"[Circular]";const r=[...t,e];if(function(e){return"function"==typeof e.toJSON}(e)){const t=e.toJSON();if(t!==e)return"string"==typeof t?t:I(t,r)}else if(Array.isArray(e))return function(e,t){if(0===e.length)return"[]";if(t.length>S)return"[Array]";const r=Math.min(w,e.length),n=e.length-r,i=[];for(let n=0;n<r;++n)i.push(I(e[n],t));return 1===n?i.push("... 1 more item"):n>1&&i.push(`... ${n} more items`),"["+i.join(", ")+"]"}(e,r);return function(e,t){const r=Object.entries(e);if(0===r.length)return"{}";if(t.length>S)return"["+function(e){const t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){const t=e.constructor.name;if("string"==typeof t&&""!==t)return t}return t}(e)+"]";const n=r.map((([e,r])=>e+": "+I(r,t)));return"{ "+n.join(", ")+" }"}(e,r)}(e,t);default:return String(e)}}class P{constructor(e,t="GraphQL request",r={line:1,column:1}){"string"==typeof e||O(!1,`Body must be a string. Received: ${E(e)}.`),this.body=e,this.name=t,this.locationOffset=r,this.locationOffset.line>0||O(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||O(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}function T(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function j(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function A(e,t,r){return t&&j(e.prototype,t),r&&j(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}_&&(delete g.process,_=!1),__DEV__?u("boolean"==typeof m,m):u("boolean"==typeof m,39);var x=function(){return"function"==typeof Symbol},k=function(e){return x()&&Boolean(Symbol[e])},M=function(e){return k(e)?Symbol[e]:"@@"+e};x()&&!k("observable")&&(Symbol.observable=Symbol("observable"));var N=M("iterator"),D=M("observable"),R=M("species");function C(e,t){var r=e[t];if(null!=r){if("function"!=typeof r)throw new TypeError(r+" is not a function");return r}}function F(e){var t=e.constructor;return void 0!==t&&null===(t=t[R])&&(t=void 0),void 0!==t?t:Y}function $(e){return e instanceof Y}function q(e){q.log?q.log(e):setTimeout((function(){throw e}))}function L(e){Promise.resolve().then((function(){try{e()}catch(e){q(e)}}))}function V(e){var t=e._cleanup;if(void 0!==t&&(e._cleanup=void 0,t))try{if("function"==typeof t)t();else{var r=C(t,"unsubscribe");r&&r.call(t)}}catch(e){q(e)}}function U(e){e._observer=void 0,e._queue=void 0,e._state="closed"}function Q(e,t,r){e._state="running";var n=e._observer;try{var i=C(n,t);switch(t){case"next":i&&i.call(n,r);break;case"error":if(U(e),!i)throw r;i.call(n,r);break;case"complete":U(e),i&&i.call(n)}}catch(e){q(e)}"closed"===e._state?V(e):"running"===e._state&&(e._state="ready")}function z(e,t,r){if("closed"!==e._state){if("buffering"!==e._state)return"ready"!==e._state?(e._state="buffering",e._queue=[{type:t,value:r}],void L((function(){return function(e){var t=e._queue;if(t){e._queue=void 0,e._state="ready";for(var r=0;r<t.length&&(Q(e,t[r].type,t[r].value),"closed"!==e._state);++r);}}(e)}))):void Q(e,t,r);e._queue.push({type:t,value:r})}}var B=function(){function e(e,t){this._cleanup=void 0,this._observer=e,this._queue=void 0,this._state="initializing";var r=new W(this);try{this._cleanup=t.call(void 0,r)}catch(e){r.error(e)}"initializing"===this._state&&(this._state="ready")}return e.prototype.unsubscribe=function(){"closed"!==this._state&&(U(this),V(this))},A(e,[{key:"closed",get:function(){return"closed"===this._state}}]),e}(),W=function(){function e(e){this._subscription=e}var t=e.prototype;return t.next=function(e){z(this._subscription,"next",e)},t.error=function(e){z(this._subscription,"error",e)},t.complete=function(){z(this._subscription,"complete")},A(e,[{key:"closed",get:function(){return"closed"===this._subscription._state}}]),e}(),Y=function(){function e(t){if(!(this instanceof e))throw new TypeError("Observable cannot be called as a function");if("function"!=typeof t)throw new TypeError("Observable initializer must be a function");this._subscriber=t}var t=e.prototype;return t.subscribe=function(e){return"object"==typeof e&&null!==e||(e={next:e,error:arguments[1],complete:arguments[2]}),new B(e,this._subscriber)},t.forEach=function(e){var t=this;return new Promise((function(r,n){if("function"==typeof e)var i=t.subscribe({next:function(t){try{e(t,o)}catch(e){n(e),i.unsubscribe()}},error:n,complete:r});else n(new TypeError(e+" is not a function"));function o(){i.unsubscribe(),r()}}))},t.map=function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(F(this))((function(r){return t.subscribe({next:function(t){try{t=e(t)}catch(e){return r.error(e)}r.next(t)},error:function(e){r.error(e)},complete:function(){r.complete()}})}))},t.filter=function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(F(this))((function(r){return t.subscribe({next:function(t){try{if(!e(t))return}catch(e){return r.error(e)}r.next(t)},error:function(e){r.error(e)},complete:function(){r.complete()}})}))},t.reduce=function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");var r=F(this),n=arguments.length>1,i=!1,o=arguments[1];return new r((function(r){return t.subscribe({next:function(t){var a=!i;if(i=!0,!a||n)try{o=e(o,t)}catch(e){return r.error(e)}else o=t},error:function(e){r.error(e)},complete:function(){if(!i&&!n)return r.error(new TypeError("Cannot reduce an empty sequence"));r.next(o),r.complete()}})}))},t.concat=function(){for(var e=this,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var i=F(this);return new i((function(t){var n,o=0;return function e(a){n=a.subscribe({next:function(e){t.next(e)},error:function(e){t.error(e)},complete:function(){o===r.length?(n=void 0,t.complete()):e(i.from(r[o++]))}})}(e),function(){n&&(n.unsubscribe(),n=void 0)}}))},t.flatMap=function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");var r=F(this);return new r((function(n){var i=[],o=t.subscribe({next:function(t){if(e)try{t=e(t)}catch(e){return n.error(e)}var o=r.from(t).subscribe({next:function(e){n.next(e)},error:function(e){n.error(e)},complete:function(){var e=i.indexOf(o);e>=0&&i.splice(e,1),a()}});i.push(o)},error:function(e){n.error(e)},complete:function(){a()}});function a(){o.closed&&0===i.length&&n.complete()}return function(){i.forEach((function(e){return e.unsubscribe()})),o.unsubscribe()}}))},t[D]=function(){return this},e.from=function(t){var r="function"==typeof this?this:e;if(null==t)throw new TypeError(t+" is not an object");var n=C(t,D);if(n){var i=n.call(t);if(Object(i)!==i)throw new TypeError(i+" is not an object");return $(i)&&i.constructor===r?i:new r((function(e){return i.subscribe(e)}))}if(k("iterator")&&(n=C(t,N)))return new r((function(e){L((function(){if(!e.closed){for(var r,i=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return T(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?T(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(n.call(t));!(r=i()).done;){var o=r.value;if(e.next(o),e.closed)return}e.complete()}}))}));if(Array.isArray(t))return new r((function(e){L((function(){if(!e.closed){for(var r=0;r<t.length;++r)if(e.next(t[r]),e.closed)return;e.complete()}}))}));throw new TypeError(t+" is not observable")},e.of=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return new("function"==typeof this?this:e)((function(e){L((function(){if(!e.closed){for(var t=0;t<r.length;++t)if(e.next(r[t]),e.closed)return;e.complete()}}))}))},A(e,null,[{key:R,get:function(){return this}}]),e}();function K(e){return null!==e&&"object"==typeof e}function H(e,t){var r=t,i=[];return e.definitions.forEach((function(e){if("OperationDefinition"===e.kind)throw __DEV__?new s("Found a ".concat(e.operation," operation").concat(e.name?" named '".concat(e.name.value,"'"):"",". ")+"No operations are allowed when using a fragment as a query. Only fragments are allowed."):new s(44);"FragmentDefinition"===e.kind&&i.push(e)})),void 0===r&&(__DEV__?u(1===i.length,"Found ".concat(i.length," fragments. `fragmentName` must be provided when there is not exactly 1 fragment.")):u(1===i.length,45),r=i[0].name.value),(0,n.__assign)((0,n.__assign)({},e),{definitions:(0,n.__spreadArray)([{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:r}}]}}],e.definitions,!0)})}function G(e){void 0===e&&(e=[]);var t={};return e.forEach((function(e){t[e.name.value]=e})),t}function J(e,t){switch(e.kind){case"InlineFragment":return e;case"FragmentSpread":var r=e.name.value;if("function"==typeof t)return t(r);var n=t&&t[r];return __DEV__?u(n,"No fragment named ".concat(r)):u(n,46),n||null;default:return null}}function Z(e){return{__ref:String(e)}}function X(e){return Boolean(e&&"object"==typeof e&&"string"==typeof e.__ref)}function ee(e,t,r,n){if(function(e){return"IntValue"===e.kind}(r)||function(e){return"FloatValue"===e.kind}(r))e[t.value]=Number(r.value);else if(function(e){return"BooleanValue"===e.kind}(r)||function(e){return"StringValue"===e.kind}(r))e[t.value]=r.value;else if(function(e){return"ObjectValue"===e.kind}(r)){var i={};r.fields.map((function(e){return ee(i,e.name,e.value,n)})),e[t.value]=i}else if(function(e){return"Variable"===e.kind}(r)){var o=(n||{})[r.name.value];e[t.value]=o}else if(function(e){return"ListValue"===e.kind}(r))e[t.value]=r.values.map((function(e){var r={};return ee(r,t,e,n),r[t.value]}));else if(function(e){return"EnumValue"===e.kind}(r))e[t.value]=r.value;else{if(!function(e){return"NullValue"===e.kind}(r))throw __DEV__?new s('The inline argument "'.concat(t.value,'" of kind "').concat(r.kind,'"')+"is not supported. Use variables instead of inline arguments to overcome this limitation."):new s(55);e[t.value]=null}}x()&&Object.defineProperty(Y,Symbol("extensions"),{value:{symbol:D,hostReportError:q},configurable:!0});var te=["connection","include","skip","client","rest","export"],re=Object.assign((function(e,t,r){if(t&&r&&r.connection&&r.connection.key){if(r.connection.filter&&r.connection.filter.length>0){var n=r.connection.filter?r.connection.filter:[];n.sort();var i={};return n.forEach((function(e){i[e]=t[e]})),"".concat(r.connection.key,"(").concat(ne(i),")")}return r.connection.key}var o=e;if(t){var a=ne(t);o+="(".concat(a,")")}return r&&Object.keys(r).forEach((function(e){-1===te.indexOf(e)&&(r[e]&&Object.keys(r[e]).length?o+="@".concat(e,"(").concat(ne(r[e]),")"):o+="@".concat(e))})),o}),{setStringify:function(e){var t=ne;return ne=e,t}}),ne=function(e){return JSON.stringify(e,ie)};function ie(e,t){return K(t)&&!Array.isArray(t)&&(t=Object.keys(t).sort().reduce((function(e,r){return e[r]=t[r],e}),{})),t}function oe(e,t){if(e.arguments&&e.arguments.length){var r={};return e.arguments.forEach((function(e){var n=e.name,i=e.value;return ee(r,n,i,t)})),r}return null}function ae(e){return e.alias?e.alias.value:e.name.value}function se(e,t,r){if("string"==typeof e.__typename)return e.__typename;for(var n=0,i=t.selections;n<i.length;n++){var o=i[n];if(ue(o)){if("__typename"===o.name.value)return e[ae(o)]}else{var a=se(e,J(o,r).selectionSet,r);if("string"==typeof a)return a}}}function ue(e){return"Field"===e.kind}function ce(e){__DEV__?u(e&&"Document"===e.kind,'Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a "gql" tag? http://docs.apollostack.com/apollo-client/core.html#gql'):u(e&&"Document"===e.kind,47);var t=e.definitions.filter((function(e){return"FragmentDefinition"!==e.kind})).map((function(e){if("OperationDefinition"!==e.kind)throw __DEV__?new s('Schema type definitions not allowed in queries. Found: "'.concat(e.kind,'"')):new s(48);return e}));return __DEV__?u(t.length<=1,"Ambiguous GraphQL document: contains ".concat(t.length," operations")):u(t.length<=1,49),e}function le(e){return ce(e),e.definitions.filter((function(e){return"OperationDefinition"===e.kind}))[0]}function fe(e){return e.definitions.filter((function(e){return"OperationDefinition"===e.kind&&e.name})).map((function(e){return e.name.value}))[0]||null}function de(e){return e.definitions.filter((function(e){return"FragmentDefinition"===e.kind}))}function pe(e){var t=le(e);return __DEV__?u(t&&"query"===t.operation,"Must contain a query definition."):u(t&&"query"===t.operation,50),t}function he(e){var t;ce(e);for(var r=0,n=e.definitions;r<n.length;r++){var i=n[r];if("OperationDefinition"===i.kind){var o=i.operation;if("query"===o||"mutation"===o||"subscription"===o)return i}"FragmentDefinition"!==i.kind||t||(t=i)}if(t)return t;throw __DEV__?new s("Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment."):new s(54)}function ye(e){var t=Object.create(null),r=e&&e.variableDefinitions;return r&&r.length&&r.forEach((function(e){e.defaultValue&&ee(t,e.variable.name,e.defaultValue)})),t}function ve(e,t){return t?t(e):Y.of()}function me(e){return"function"==typeof e?new _e(e):e}function be(e){return e.request.length<=1}var ge=function(e){function t(t,r){var n=e.call(this,t)||this;return n.link=r,n}return(0,n.__extends)(t,e),t}(Error),_e=function(){function e(e){e&&(this.request=e)}return e.empty=function(){return new e((function(){return Y.of()}))},e.from=function(t){return 0===t.length?e.empty():t.map(me).reduce((function(e,t){return e.concat(t)}))},e.split=function(t,r,n){var i=me(r),o=me(n||new e(ve));return be(i)&&be(o)?new e((function(e){return t(e)?i.request(e)||Y.of():o.request(e)||Y.of()})):new e((function(e,r){return t(e)?i.request(e,r)||Y.of():o.request(e,r)||Y.of()}))},e.execute=function(e,t){return e.request(function(e,t){var r=(0,n.__assign)({},e);return Object.defineProperty(t,"setContext",{enumerable:!1,value:function(e){r="function"==typeof e?(0,n.__assign)((0,n.__assign)({},r),e(r)):(0,n.__assign)((0,n.__assign)({},r),e)}}),Object.defineProperty(t,"getContext",{enumerable:!1,value:function(){return(0,n.__assign)({},r)}}),t}(t.context,function(e){var t={variables:e.variables||{},extensions:e.extensions||{},operationName:e.operationName,query:e.query};return t.operationName||(t.operationName="string"!=typeof t.query?fe(t.query)||void 0:""),t}(function(e){for(var t=["query","operationName","variables","extensions","context"],r=0,n=Object.keys(e);r<n.length;r++){var i=n[r];if(t.indexOf(i)<0)throw __DEV__?new s("illegal argument: ".concat(i)):new s(27)}return e}(t))))||Y.of()},e.concat=function(t,r){var n=me(t);if(be(n))return __DEV__&&u.warn(new ge("You are calling concat on a terminating link, which will have no effect",n)),n;var i=me(r);return be(i)?new e((function(e){return n.request(e,(function(e){return i.request(e)||Y.of()}))||Y.of()})):new e((function(e,t){return n.request(e,(function(e){return i.request(e,t)||Y.of()}))||Y.of()}))},e.prototype.split=function(t,r,n){return this.concat(e.split(t,r,n||new e(ve)))},e.prototype.concat=function(t){return e.concat(this,t)},e.prototype.request=function(e,t){throw __DEV__?new s("request is not implemented"):new s(22)},e.prototype.onError=function(e,t){if(t&&t.error)return t.error(e),!1;throw e},e.prototype.setOnError=function(e){return this.onError=e,this},e}(),Oe=_e.execute;class we{constructor(e,t,r){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=r}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}}class Se{constructor(e,t,r,n,i,o){this.kind=e,this.start=t,this.end=r,this.line=n,this.column=i,this.value=o,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}}}const Ee={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]},Ie=new Set(Object.keys(Ee));function Pe(e){const t=null==e?void 0:e.kind;return"string"==typeof t&&Ie.has(t)}var Te,je,Ae;!function(e){e.QUERY="query",e.MUTATION="mutation",e.SUBSCRIPTION="subscription"}(Te||(Te={})),(Ae=je||(je={})).NAME="Name",Ae.DOCUMENT="Document",Ae.OPERATION_DEFINITION="OperationDefinition",Ae.VARIABLE_DEFINITION="VariableDefinition",Ae.SELECTION_SET="SelectionSet",Ae.FIELD="Field",Ae.ARGUMENT="Argument",Ae.FRAGMENT_SPREAD="FragmentSpread",Ae.INLINE_FRAGMENT="InlineFragment",Ae.FRAGMENT_DEFINITION="FragmentDefinition",Ae.VARIABLE="Variable",Ae.INT="IntValue",Ae.FLOAT="FloatValue",Ae.STRING="StringValue",Ae.BOOLEAN="BooleanValue",Ae.NULL="NullValue",Ae.ENUM="EnumValue",Ae.LIST="ListValue",Ae.OBJECT="ObjectValue",Ae.OBJECT_FIELD="ObjectField",Ae.DIRECTIVE="Directive",Ae.NAMED_TYPE="NamedType",Ae.LIST_TYPE="ListType",Ae.NON_NULL_TYPE="NonNullType",Ae.SCHEMA_DEFINITION="SchemaDefinition",Ae.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",Ae.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",Ae.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",Ae.FIELD_DEFINITION="FieldDefinition",Ae.INPUT_VALUE_DEFINITION="InputValueDefinition",Ae.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",Ae.UNION_TYPE_DEFINITION="UnionTypeDefinition",Ae.ENUM_TYPE_DEFINITION="EnumTypeDefinition",Ae.ENUM_VALUE_DEFINITION="EnumValueDefinition",Ae.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",Ae.DIRECTIVE_DEFINITION="DirectiveDefinition",Ae.SCHEMA_EXTENSION="SchemaExtension",Ae.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",Ae.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",Ae.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",Ae.UNION_TYPE_EXTENSION="UnionTypeExtension",Ae.ENUM_TYPE_EXTENSION="EnumTypeExtension",Ae.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension";const xe=Object.freeze({});function ke(e,t,r=Ee){const n=new Map;for(const e of Object.values(je))n.set(e,Me(t,e));let i,o,a,s=Array.isArray(e),u=[e],c=-1,l=[],f=e;const d=[],p=[];do{c++;const e=c===u.length,m=e&&0!==l.length;if(e){if(o=0===p.length?void 0:d[d.length-1],f=a,a=p.pop(),m)if(s){f=f.slice();let e=0;for(const[t,r]of l){const n=t-e;null===r?(f.splice(n,1),e++):f[n]=r}}else{f=Object.defineProperties({},Object.getOwnPropertyDescriptors(f));for(const[e,t]of l)f[e]=t}c=i.index,u=i.keys,l=i.edits,s=i.inArray,i=i.prev}else if(a){if(o=s?c:u[c],f=a[o],null==f)continue;d.push(o)}let b;if(!Array.isArray(f)){var h,y;Pe(f)||O(!1,`Invalid AST Node: ${E(f)}.`);const r=e?null===(h=n.get(f.kind))||void 0===h?void 0:h.leave:null===(y=n.get(f.kind))||void 0===y?void 0:y.enter;if(b=null==r?void 0:r.call(t,f,o,a,d,p),b===xe)break;if(!1===b){if(!e){d.pop();continue}}else if(void 0!==b&&(l.push([o,b]),!e)){if(!Pe(b)){d.pop();continue}f=b}}var v;void 0===b&&m&&l.push([o,f]),e?d.pop():(i={inArray:s,index:c,keys:u,edits:l,prev:i},s=Array.isArray(f),u=s?f:null!==(v=r[f.kind])&&void 0!==v?v:[],c=-1,l=[],a&&p.push(a),a=f)}while(void 0!==i);return 0!==l.length?l[l.length-1][1]:e}function Me(e,t){const r=e[t];return"object"==typeof r?r:"function"==typeof r?{enter:r,leave:void 0}:{enter:e.enter,leave:e.leave}}function Ne(e,t){var r=e.directives;return!r||!r.length||function(e){var t=[];return e&&e.length&&e.forEach((function(e){if(function(e){var t=e.name.value;return"skip"===t||"include"===t}(e)){var r=e.arguments,n=e.name.value;__DEV__?u(r&&1===r.length,"Incorrect number of arguments for the @".concat(n," directive.")):u(r&&1===r.length,41);var i=r[0];__DEV__?u(i.name&&"if"===i.name.value,"Invalid argument for the @".concat(n," directive.")):u(i.name&&"if"===i.name.value,42);var o=i.value;__DEV__?u(o&&("Variable"===o.kind||"BooleanValue"===o.kind),"Argument for the @".concat(n," directive must be a variable or a boolean value.")):u(o&&("Variable"===o.kind||"BooleanValue"===o.kind),43),t.push({directive:e,ifArgument:i})}})),t}(r).every((function(e){var r=e.directive,n=e.ifArgument,i=!1;return"Variable"===n.value.kind?(i=t&&t[n.value.name.value],__DEV__?u(void 0!==i,"Invalid variable referenced in @".concat(r.name.value," directive.")):u(void 0!==i,40)):i=n.value.value,"skip"===r.name.value?!i:i}))}function De(e,t,r){var n=new Set(e),i=n.size;return ke(t,{Directive:function(e){if(n.delete(e.name.value)&&(!r||!n.size))return xe}}),r?!n.size:n.size<i}function Re(e){return e&&De(["client","export"],e,!0)}var Ce=function(e,t){var r;try{r=JSON.stringify(e)}catch(e){var n=__DEV__?new s("Network request failed. ".concat(t," is not serializable: ").concat(e.message)):new s(24);throw n.parseError=e,n}return r},Fe=function(e,t){return e.getContext().uri||("function"==typeof t?t(e):t||"/graphql")},$e="function"==typeof WeakMap&&"ReactNative"!==p((function(){return navigator.product})),qe="function"==typeof WeakSet,Le="function"==typeof Symbol&&"function"==typeof Symbol.for,Ve=Le&&Symbol.asyncIterator;function Ue(e){var t={next:function(){return e.read()}};return Ve&&(t[Symbol.asyncIterator]=function(){return this}),t}function Qe(e){var t,r,n,i,o=e;if(e.body&&(o=e.body),i=o,Ve&&i[Symbol.asyncIterator])return function(e){var t,r=e[Symbol.asyncIterator]();return(t={next:function(){return r.next()}})[Symbol.asyncIterator]=function(){return this},t}(o);if(function(e){return!!e.getReader}(o))return Ue(o.getReader());if(function(e){return!!e.stream}(o))return Ue(o.stream().getReader());if(function(e){return!!e.arrayBuffer}(o))return t=o.arrayBuffer(),r=!1,n={next:function(){return r?Promise.resolve({value:void 0,done:!0}):(r=!0,new Promise((function(e,r){t.then((function(t){e({value:t,done:!1})})).catch(r)})))}},Ve&&(n[Symbol.asyncIterator]=function(){return this}),n;if(function(e){return!!e.pipe}(o))return function(e){var t=null,r=null,n=!1,i=[],o=[];function a(e){if(!r){if(o.length){var t=o.shift();if(Array.isArray(t)&&t[0])return t[0]({value:e,done:!1})}i.push(e)}}function s(e){r=e,o.slice().forEach((function(t){t[1](e)})),!t||t()}function u(){n=!0,o.slice().forEach((function(e){e[0]({value:void 0,done:!0})})),!t||t()}t=function(){t=null,e.removeListener("data",a),e.removeListener("error",s),e.removeListener("end",u),e.removeListener("finish",u),e.removeListener("close",u)},e.on("data",a),e.on("error",s),e.on("end",u),e.on("finish",u),e.on("close",u);var c={next:function(){return new Promise((function(e,t){return r?t(r):i.length?e({value:i.shift(),done:!1}):n?e({value:void 0,done:!0}):void o.push([e,t])}))}};return Ve&&(c[Symbol.asyncIterator]=function(){return this}),c}(o);throw new Error("Unknown body type for responseIterator. Please pass a streamable response.")}p((function(){return window.document.createElement})),p((function(){return navigator.userAgent.indexOf("jsdom")>=0}));var ze=function(e,t,r){var n=new Error(r);throw n.name="ServerError",n.response=e,n.statusCode=e.status,n.result=t,n},Be=Object.prototype.hasOwnProperty;function We(e){var t={};return e.split("\n").forEach((function(e){var r=e.indexOf(":");if(r>-1){var n=e.slice(0,r).trim().toLowerCase(),i=e.slice(r+1).trim();t[n]=i}})),t}function Ye(e,t){e.status>=300&&ze(e,function(){try{return JSON.parse(t)}catch(e){return t}}(),"Response not successful: Received status code ".concat(e.status));try{return JSON.parse(t)}catch(n){var r=n;throw r.name="ServerParseError",r.response=e,r.statusCode=e.status,r.bodyText=t,r}}function Ke(e,t){var r,n;"AbortError"!==e.name&&(e.result&&e.result.errors&&e.result.data&&(null===(r=t.next)||void 0===r||r.call(t,e.result)),null===(n=t.error)||void 0===n||n.call(t,e))}function He(e){return function(t){return t.text().then((function(e){return Ye(t,e)})).then((function(r){return t.status>=300&&ze(t,r,"Response not successful: Received status code ".concat(t.status)),Array.isArray(r)||Be.call(r,"data")||Be.call(r,"errors")||ze(t,r,"Server response was missing for query '".concat(Array.isArray(e)?e.map((function(e){return e.operationName})):e.operationName,"'.")),r}))}}var Ge=function(e){if(!e&&"undefined"==typeof fetch)throw __DEV__?new s("\n\"fetch\" has not been found globally and no fetcher has been configured. To fix this, install a fetch package (like https://www.npmjs.com/package/cross-fetch), instantiate the fetcher, and pass it into your HttpLink constructor. For example:\n\nimport fetch from 'cross-fetch';\nimport { ApolloClient, HttpLink } from '@apollo/client';\nconst client = new ApolloClient({\n link: new HttpLink({ uri: '/graphql', fetch })\n});\n "):new s(23)};function Je(e){return 9===e||32===e}function Ze(e){return e>=48&&e<=57}function Xe(e){return e>=97&&e<=122||e>=65&&e<=90}function et(e){return Xe(e)||95===e}function tt(e){var t;let r=Number.MAX_SAFE_INTEGER,n=null,i=-1;for(let t=0;t<e.length;++t){var o;const a=e[t],s=rt(a);s!==a.length&&(n=null!==(o=n)&&void 0!==o?o:t,i=t,0!==t&&s<r&&(r=s))}return e.map(((e,t)=>0===t?e:e.slice(r))).slice(null!==(t=n)&&void 0!==t?t:0,i+1)}function rt(e){let t=0;for(;t<e.length&&Je(e.charCodeAt(t));)++t;return t}const nt=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function it(e){return ot[e.charCodeAt(0)]}const ot=["\\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"];function at(e){return ke(e,st)}const st={Name:{leave:e=>e.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>ut(e.definitions,"\n\n")},OperationDefinition:{leave(e){const t=lt("(",ut(e.variableDefinitions,", "),")"),r=ut([e.operation,ut([e.name,t]),ut(e.directives," ")]," ");return("query"===r?"":r+" ")+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:r,directives:n})=>e+": "+t+lt(" = ",r)+lt(" ",ut(n," "))},SelectionSet:{leave:({selections:e})=>ct(e)},Field:{leave({alias:e,name:t,arguments:r,directives:n,selectionSet:i}){const o=lt("",e,": ")+t;let a=o+lt("(",ut(r,", "),")");return a.length>80&&(a=o+lt("(\n",ft(ut(r,"\n")),"\n)")),ut([a,ut(n," "),i]," ")}},Argument:{leave:({name:e,value:t})=>e+": "+t},FragmentSpread:{leave:({name:e,directives:t})=>"..."+e+lt(" ",ut(t," "))},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:r})=>ut(["...",lt("on ",e),ut(t," "),r]," ")},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:r,directives:n,selectionSet:i})=>`fragment ${e}${lt("(",ut(r,", "),")")} on ${t} ${lt("",ut(n," ")," ")}`+i},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>t?function(e,t){const r=e.replace(/"""/g,'\\"""'),n=r.split(/\r\n|[\n\r]/g),i=1===n.length,o=n.length>1&&n.slice(1).every((e=>0===e.length||Je(e.charCodeAt(0)))),a=r.endsWith('\\"""'),s=e.endsWith('"')&&!a,u=e.endsWith("\\"),c=s||u,l=!i||e.length>70||c||o||a;let f="";const d=i&&Je(e.charCodeAt(0));return(l&&!d||o)&&(f+="\n"),f+=r,(l||c)&&(f+="\n"),'"""'+f+'"""'}(e):`"${e.replace(nt,it)}"`},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>"["+ut(e,", ")+"]"},ObjectValue:{leave:({fields:e})=>"{"+ut(e,", ")+"}"},ObjectField:{leave:({name:e,value:t})=>e+": "+t},Directive:{leave:({name:e,arguments:t})=>"@"+e+lt("(",ut(t,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({description:e,directives:t,operationTypes:r})=>lt("",e,"\n")+ut(["schema",ut(t," "),ct(r)]," ")},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+": "+t},ScalarTypeDefinition:{leave:({description:e,name:t,directives:r})=>lt("",e,"\n")+ut(["scalar",t,ut(r," ")]," ")},ObjectTypeDefinition:{leave:({description:e,name:t,interfaces:r,directives:n,fields:i})=>lt("",e,"\n")+ut(["type",t,lt("implements ",ut(r," & ")),ut(n," "),ct(i)]," ")},FieldDefinition:{leave:({description:e,name:t,arguments:r,type:n,directives:i})=>lt("",e,"\n")+t+(dt(r)?lt("(\n",ft(ut(r,"\n")),"\n)"):lt("(",ut(r,", "),")"))+": "+n+lt(" ",ut(i," "))},InputValueDefinition:{leave:({description:e,name:t,type:r,defaultValue:n,directives:i})=>lt("",e,"\n")+ut([t+": "+r,lt("= ",n),ut(i," ")]," ")},InterfaceTypeDefinition:{leave:({description:e,name:t,interfaces:r,directives:n,fields:i})=>lt("",e,"\n")+ut(["interface",t,lt("implements ",ut(r," & ")),ut(n," "),ct(i)]," ")},UnionTypeDefinition:{leave:({description:e,name:t,directives:r,types:n})=>lt("",e,"\n")+ut(["union",t,ut(r," "),lt("= ",ut(n," | "))]," ")},EnumTypeDefinition:{leave:({description:e,name:t,directives:r,values:n})=>lt("",e,"\n")+ut(["enum",t,ut(r," "),ct(n)]," ")},EnumValueDefinition:{leave:({description:e,name:t,directives:r})=>lt("",e,"\n")+ut([t,ut(r," ")]," ")},InputObjectTypeDefinition:{leave:({description:e,name:t,directives:r,fields:n})=>lt("",e,"\n")+ut(["input",t,ut(r," "),ct(n)]," ")},DirectiveDefinition:{leave:({description:e,name:t,arguments:r,repeatable:n,locations:i})=>lt("",e,"\n")+"directive @"+t+(dt(r)?lt("(\n",ft(ut(r,"\n")),"\n)"):lt("(",ut(r,", "),")"))+(n?" repeatable":"")+" on "+ut(i," | ")},SchemaExtension:{leave:({directives:e,operationTypes:t})=>ut(["extend schema",ut(e," "),ct(t)]," ")},ScalarTypeExtension:{leave:({name:e,directives:t})=>ut(["extend scalar",e,ut(t," ")]," ")},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:r,fields:n})=>ut(["extend type",e,lt("implements ",ut(t," & ")),ut(r," "),ct(n)]," ")},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:r,fields:n})=>ut(["extend interface",e,lt("implements ",ut(t," & ")),ut(r," "),ct(n)]," ")},UnionTypeExtension:{leave:({name:e,directives:t,types:r})=>ut(["extend union",e,ut(t," "),lt("= ",ut(r," | "))]," ")},EnumTypeExtension:{leave:({name:e,directives:t,values:r})=>ut(["extend enum",e,ut(t," "),ct(r)]," ")},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:r})=>ut(["extend input",e,ut(t," "),ct(r)]," ")}};function ut(e,t=""){var r;return null!==(r=null==e?void 0:e.filter((e=>e)).join(t))&&void 0!==r?r:""}function ct(e){return lt("{\n",ft(ut(e,"\n")),"\n}")}function lt(e,t,r=""){return null!=t&&""!==t?e+t+r:""}function ft(e){return lt(" ",e.replace(/\n/g,"\n "))}function dt(e){var t;return null!==(t=null==e?void 0:e.some((e=>e.includes("\n"))))&&void 0!==t&&t}var pt={http:{includeQuery:!0,includeExtensions:!1,preserveHeaderCase:!1},headers:{accept:"*/*","content-type":"application/json"},options:{method:"POST"}},ht=function(e,t){return t(e)};function yt(e,t){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];return r.unshift(t),vt.apply(void 0,(0,n.__spreadArray)([e,ht],r,!1))}function vt(e,t){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];var o={},a={};r.forEach((function(e){o=(0,n.__assign)((0,n.__assign)((0,n.__assign)({},o),e.options),{headers:(0,n.__assign)((0,n.__assign)({},o.headers),e.headers)}),e.credentials&&(o.credentials=e.credentials),a=(0,n.__assign)((0,n.__assign)({},a),e.http)})),o.headers&&(o.headers=function(e,t){if(!t){var r=Object.create(null);return Object.keys(Object(e)).forEach((function(t){r[t.toLowerCase()]=e[t]})),r}var n=Object.create(null);Object.keys(Object(e)).forEach((function(t){n[t.toLowerCase()]={originalName:t,value:e[t]}}));var i=Object.create(null);return Object.keys(n).forEach((function(e){i[n[e].originalName]=n[e].value})),i}(o.headers,a.preserveHeaderCase));var s=e.operationName,u=e.extensions,c=e.variables,l=e.query,f={operationName:s,variables:c};return a.includeExtensions&&(f.extensions=u),a.includeQuery&&(f.query=t(l,at)),{options:o,body:f}}var mt=function(){if("undefined"==typeof AbortController)return{controller:!1,signal:!1};var e=new AbortController;return{controller:e,signal:e.signal}};function bt(e,t){var r=[],n=function(e,t){r.push("".concat(e,"=").concat(encodeURIComponent(t)))};if("query"in t&&n("query",t.query),t.operationName&&n("operationName",t.operationName),t.variables){var i=void 0;try{i=Ce(t.variables,"Variables map")}catch(e){return{parseError:e}}n("variables",i)}if(t.extensions){var o=void 0;try{o=Ce(t.extensions,"Extensions map")}catch(e){return{parseError:e}}n("extensions",o)}var a="",s=e,u=e.indexOf("#");-1!==u&&(a=e.substr(u),s=e.substr(0,u));var c=-1===s.indexOf("?")?"?":"&";return{newURI:s+c+r.join("&")+a}}function gt(e){return new Y((function(t){t.error(e)}))}var _t=p((function(){return fetch})),Ot=function(e){void 0===e&&(e={});var t=e.uri,r=void 0===t?"/graphql":t,i=e.fetch,o=e.print,a=void 0===o?ht:o,s=e.includeExtensions,u=e.preserveHeaderCase,c=e.useGETForQueries,l=e.includeUnusedVariables,f=void 0!==l&&l,d=(0,n.__rest)(e,["uri","fetch","print","includeExtensions","preserveHeaderCase","useGETForQueries","includeUnusedVariables"]);__DEV__&&Ge(i||_t);var h={http:{includeExtensions:s,preserveHeaderCase:u},options:d.fetchOptions,credentials:d.credentials,headers:d.headers};return new _e((function(e){var t=Fe(e,r),o=e.getContext(),s={};if(o.clientAwareness){var u=o.clientAwareness,l=u.name,d=u.version;l&&(s["apollographql-client-name"]=l),d&&(s["apollographql-client-version"]=d)}var y,v=(0,n.__assign)((0,n.__assign)({},s),o.headers),m={http:o.http,options:o.fetchOptions,credentials:o.credentials,headers:v},b=vt(e,a,pt,h,m),g=b.options,_=b.body;if(_.variables&&!f){var O=new Set(Object.keys(_.variables));ke(e.query,{Variable:function(e,t,r){r&&"VariableDefinition"!==r.kind&&O.delete(e.name.value)}}),O.size&&(_.variables=(0,n.__assign)({},_.variables),O.forEach((function(e){delete _.variables[e]})))}if(!g.signal){var w=mt(),S=w.controller,E=w.signal;(y=S)&&(g.signal=E)}if(c&&!e.query.definitions.some((function(e){return"OperationDefinition"===e.kind&&"mutation"===e.operation}))&&(g.method="GET"),De(["defer"],e.query)&&(g.headers=g.headers||{},g.headers.accept="multipart/mixed; deferSpec=20220824, application/json"),"GET"===g.method){var I=bt(t,_),P=I.newURI,T=I.parseError;if(T)return gt(T);t=P}else try{g.body=Ce(_,"Payload")}catch(T){return gt(T)}return new Y((function(r){return(i||p((function(){return fetch}))||_t)(t,g).then((function(t){var i;e.setContext({response:t});var o=null===(i=t.headers)||void 0===i?void 0:i.get("content-type");return null!==o&&/^multipart\/mixed/i.test(o)?function(e,t){var r,i,o;return(0,n.__awaiter)(this,void 0,void 0,(function(){var a,s,u,c,l,f,d,p,h,y,v,m,b,g,_,O,w,S,E,I;return(0,n.__generator)(this,(function(n){switch(n.label){case 0:if(void 0===TextDecoder)throw new Error("TextDecoder must be defined in the environment: please import a polyfill.");a=new TextDecoder("utf-8"),s=null===(r=e.headers)||void 0===r?void 0:r.get("content-type"),u="boundary=",c=(null==s?void 0:s.includes(u))?null==s?void 0:s.substring((null==s?void 0:s.indexOf(u))+9).replace(/['"]/g,"").replace(/\;(.*)/gm,"").trim():"-",l="--".concat(c),f="",d=Qe(e),p=!0,n.label=1;case 1:return p?[4,d.next()]:[3,3];case 2:for(h=n.sent(),y=h.value,v=h.done,m="string"==typeof y?y:a.decode(y),p=!v,b=(f+=m).indexOf(l);b>-1;){if(g=void 0,I=[f.slice(0,b),f.slice(b+l.length)],f=I[1],(g=I[0]).trim()){if(_=g.indexOf("\r\n\r\n"),O=We(g.slice(0,_)),(w=O["content-type"])&&-1===w.toLowerCase().indexOf("application/json"))throw new Error("Unsupported patch content type: application/json is required.");S=g.slice(_);try{E=Ye(e,S.replace("\r\n","")),(Object.keys(E).length>1||"data"in E||"incremental"in E||"errors"in E)&&(null===(i=t.next)||void 0===i||i.call(t,E))}catch(e){Ke(e,t)}}b=f.indexOf(l)}return[3,1];case 3:return null===(o=t.complete)||void 0===o||o.call(t),[2]}}))}))}(t,r):function(e,t,r){He(t)(e).then((function(e){var t,n;null===(t=r.next)||void 0===t||t.call(r,e),null===(n=r.complete)||void 0===n||n.call(r)})).catch((function(e){return Ke(e,r)}))}(t,e,r)})).catch((function(e){return Ke(e,r)})),function(){y&&y.abort()}}))}))},wt=function(e){function t(t){void 0===t&&(t={});var r=e.call(this,Ot(t).request)||this;return r.options=t,r}return(0,n.__extends)(t,e),t}(_e),St=Object.prototype,Et=St.toString,It=St.hasOwnProperty,Pt=Function.prototype.toString,Tt=new Map;function jt(e,t){try{return At(e,t)}finally{Tt.clear()}}function At(e,t){if(e===t)return!0;var r,n,i,o=Et.call(e);if(o!==Et.call(t))return!1;switch(o){case"[object Array]":if(e.length!==t.length)return!1;case"[object Object]":if(Nt(e,t))return!0;var a=xt(e),s=xt(t),u=a.length;if(u!==s.length)return!1;for(var c=0;c<u;++c)if(!It.call(t,a[c]))return!1;for(c=0;c<u;++c){var l=a[c];if(!At(e[l],t[l]))return!1}return!0;case"[object Error]":return e.name===t.name&&e.message===t.message;case"[object Number]":if(e!=e)return t!=t;case"[object Boolean]":case"[object Date]":return+e==+t;case"[object RegExp]":case"[object String]":return e=="".concat(t);case"[object Map]":case"[object Set]":if(e.size!==t.size)return!1;if(Nt(e,t))return!0;for(var f=e.entries(),d="[object Map]"===o;;){var p=f.next();if(p.done)break;var h=p.value,y=h[0],v=h[1];if(!t.has(y))return!1;if(d&&!At(v,t.get(y)))return!1}return!0;case"[object Uint16Array]":case"[object Uint8Array]":case"[object Uint32Array]":case"[object Int32Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object ArrayBuffer]":e=new Uint8Array(e),t=new Uint8Array(t);case"[object DataView]":var m=e.byteLength;if(m===t.byteLength)for(;m--&&e[m]===t[m];);return-1===m;case"[object AsyncFunction]":case"[object GeneratorFunction]":case"[object AsyncGeneratorFunction]":case"[object Function]":var b=Pt.call(e);return b===Pt.call(t)&&(n=Mt,!((i=(r=b).length-n.length)>=0&&r.indexOf(n,i)===i))}return!1}function xt(e){return Object.keys(e).filter(kt,e)}function kt(e){return void 0!==this[e]}var Mt="{ [native code] }";function Nt(e,t){var r=Tt.get(e);if(r){if(r.has(t))return!0}else Tt.set(e,r=new Set);return r.add(t),!1}var Dt=Array.isArray;function Rt(e){return Array.isArray(e)&&e.length>0}var Ct=Object.prototype.hasOwnProperty;function Ft(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return $t(e)}function $t(e){var t=e[0]||{},r=e.length;if(r>1)for(var n=new Lt,i=1;i<r;++i)t=n.merge(t,e[i]);return t}var qt=function(e,t,r){return this.merge(e[r],t[r])},Lt=function(){function e(e){void 0===e&&(e=qt),this.reconciler=e,this.isObject=K,this.pastCopies=new Set}return e.prototype.merge=function(e,t){for(var r=this,i=[],o=2;o<arguments.length;o++)i[o-2]=arguments[o];return K(t)&&K(e)?(Object.keys(t).forEach((function(o){if(Ct.call(e,o)){var a=e[o];if(t[o]!==a){var s=r.reconciler.apply(r,(0,n.__spreadArray)([e,t,o],i,!1));s!==a&&((e=r.shallowCopyForMerge(e))[o]=s)}}else(e=r.shallowCopyForMerge(e))[o]=t[o]})),e):t},e.prototype.shallowCopyForMerge=function(e){return K(e)&&(this.pastCopies.has(e)||(e=Array.isArray(e)?e.slice(0):(0,n.__assign)({__proto__:Object.getPrototypeOf(e)},e),this.pastCopies.add(e))),e},e}();function Vt(e){return"incremental"in e}function Ut(e,t){var r=e,n=new Lt;return Vt(t)&&Rt(t.incremental)&&t.incremental.forEach((function(e){for(var t=e.data,i=e.path,o=i.length-1;o>=0;--o){var a=i[o],s=isNaN(+a)?{}:[];s[a]=t,t=s}r=n.merge(r,t)})),r}var Qt,zt,Bt=function(){return Object.create(null)},Wt=Array.prototype,Yt=Wt.forEach,Kt=Wt.slice,Ht=function(){function e(e,t){void 0===e&&(e=!0),void 0===t&&(t=Bt),this.weakness=e,this.makeData=t}return e.prototype.lookup=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return this.lookupArray(e)},e.prototype.lookupArray=function(e){var t=this;return Yt.call(e,(function(e){return t=t.getChildTrie(e)})),t.data||(t.data=this.makeData(Kt.call(e)))},e.prototype.getChildTrie=function(t){var r=this.weakness&&function(e){switch(typeof e){case"object":if(null===e)break;case"function":return!0}return!1}(t)?this.weak||(this.weak=new WeakMap):this.strong||(this.strong=new Map),n=r.get(t);return n||r.set(t,n=new e(this.weakness,this.makeData)),n},e}(),Gt=function(){function e(){this.known=new(qe?WeakSet:Set),this.pool=new Ht($e),this.passes=new WeakMap,this.keysByJSON=new Map,this.empty=this.admit({})}return e.prototype.isKnown=function(e){return K(e)&&this.known.has(e)},e.prototype.pass=function(e){if(K(e)){var t=function(e){return K(e)?Dt(e)?e.slice(0):(0,n.__assign)({__proto__:Object.getPrototypeOf(e)},e):e}(e);return this.passes.set(t,e),t}return e},e.prototype.admit=function(e){var t=this;if(K(e)){var r=this.passes.get(e);if(r)return r;switch(Object.getPrototypeOf(e)){case Array.prototype:if(this.known.has(e))return e;var n=e.map(this.admit,this);return(s=this.pool.lookupArray(n)).array||(this.known.add(s.array=n),__DEV__&&Object.freeze(n)),s.array;case null:case Object.prototype:if(this.known.has(e))return e;var i=Object.getPrototypeOf(e),o=[i],a=this.sortedKeys(e);o.push(a.json);var s,u=o.length;if(a.sorted.forEach((function(r){o.push(t.admit(e[r]))})),!(s=this.pool.lookupArray(o)).object){var c=s.object=Object.create(i);this.known.add(c),a.sorted.forEach((function(e,t){c[e]=o[u+t]})),__DEV__&&Object.freeze(c)}return s.object}}return e},e.prototype.sortedKeys=function(e){var t=Object.keys(e),r=this.pool.lookupArray(t);if(!r.keys){t.sort();var n=JSON.stringify(t);(r.keys=this.keysByJSON.get(n))||this.keysByJSON.set(n,r.keys={sorted:t,json:n})}return r.keys},e}(),Jt=Object.assign((function(e){if(K(e)){void 0===Qt&&Zt();var t=Qt.admit(e),r=zt.get(t);return void 0===r&&zt.set(t,r=JSON.stringify(t)),r}return JSON.stringify(e)}),{reset:Zt});function Zt(){Qt=new Gt,zt=new($e?WeakMap:Map)}function Xt(e,t,r){return new Y((function(n){var i=n.next,o=n.error,a=n.complete,s=0,u=!1,c={then:function(e){return new Promise((function(t){return t(e())}))}};function l(e,t){return e?function(t){++s;var r=function(){return e(t)};c=c.then(r,r).then((function(e){--s,i&&i.call(n,e),u&&f.complete()}),(function(e){throw--s,e})).catch((function(e){o&&o.call(n,e)}))}:function(e){return t&&t.call(n,e)}}var f={next:l(t,i),error:l(r,o),complete:function(){u=!0,s||a&&a.call(n)}},d=e.subscribe(f);return function(){return d.unsubscribe()}}))}function er(e){return Rt(tr(e))}function tr(e){var t=Rt(e.errors)?e.errors.slice(0):[];return Vt(e)&&Rt(e.incremental)&&e.incremental.forEach((function(e){e.errors&&t.push.apply(t,e.errors)})),t}var rr={kind:je.FIELD,name:{kind:je.NAME,value:"__typename"}};function nr(e,t){return!e||e.selectionSet.selections.every((function(e){return e.kind===je.FRAGMENT_SPREAD&&nr(t[e.name.value],t)}))}function ir(e){return nr(le(e)||function(e){__DEV__?u("Document"===e.kind,'Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a "gql" tag? http://docs.apollostack.com/apollo-client/core.html#gql'):u("Document"===e.kind,51),__DEV__?u(e.definitions.length<=1,"Fragment must have exactly one definition."):u(e.definitions.length<=1,52);var t=e.definitions[0];return __DEV__?u("FragmentDefinition"===t.kind,"Must be a fragment definition."):u("FragmentDefinition"===t.kind,53),t}(e),G(de(e)))?null:e}function or(e){var t=new Map;return function(r){void 0===r&&(r=e);var n=t.get(r);return n||t.set(r,n={variables:new Set,fragmentSpreads:new Set}),n}}function ar(e,t){for(var r=or(""),i=or(""),o=function(e){for(var t=0,n=void 0;t<e.length&&(n=e[t]);++t)if(!Dt(n)){if(n.kind===je.OPERATION_DEFINITION)return r(n.name&&n.name.value);if(n.kind===je.FRAGMENT_DEFINITION)return i(n.name.value)}return __DEV__&&u.error("Could not find operation or fragment"),null},a=0,s=t.definitions.length-1;s>=0;--s)t.definitions[s].kind===je.OPERATION_DEFINITION&&++a;var c=function(e){var t=new Set,r=[];return e.forEach((function(e){e.name?t.add(e.name):e.test&&r.push(e.test)})),function(e){return t.has(e.name.value)||r.some((function(t){return t(e)}))}}(e),l=e.some((function(e){return e.remove})),f=function(e){return l&&e&&e.some(c)},d=new Map,p=!1,h={enter:function(e){if(f(e.directives))return p=!0,null}},y=ke(t,{Field:h,InlineFragment:h,VariableDefinition:{enter:function(){return!1}},Variable:{enter:function(e,t,r,n,i){var a=o(i);a&&a.variables.add(e.name.value)}},FragmentSpread:{enter:function(e,t,r,n,i){if(f(e.directives))return p=!0,null;var a=o(i);a&&a.fragmentSpreads.add(e.name.value)}},FragmentDefinition:{enter:function(e,t,r,n){d.set(JSON.stringify(n),e)},leave:function(e,t,r,n){return e===d.get(JSON.stringify(n))?e:a>0&&e.selectionSet.selections.every((function(e){return e.kind===je.FIELD&&"__typename"===e.name.value}))?(i(e.name.value).removed=!0,p=!0,null):void 0}},Directive:{leave:function(e){if(c(e))return p=!0,null}}});if(!p)return t;var v=function(e){return e.transitiveVars||(e.transitiveVars=new Set(e.variables),e.removed||e.fragmentSpreads.forEach((function(t){v(i(t)).transitiveVars.forEach((function(t){e.transitiveVars.add(t)}))}))),e},m=new Set;y.definitions.forEach((function(e){e.kind===je.OPERATION_DEFINITION?v(r(e.name&&e.name.value)).fragmentSpreads.forEach((function(e){m.add(e)})):e.kind!==je.FRAGMENT_DEFINITION||0!==a||i(e.name.value).removed||m.add(e.name.value)})),m.forEach((function(e){v(i(e)).fragmentSpreads.forEach((function(e){m.add(e)}))}));var b={enter:function(e){if(t=e.name.value,!m.has(t)||i(t).removed)return null;var t}};return ir(ke(y,{FragmentSpread:b,FragmentDefinition:b,OperationDefinition:{leave:function(e){if(e.variableDefinitions){var t=v(r(e.name&&e.name.value)).transitiveVars;if(t.size<e.variableDefinitions.length)return(0,n.__assign)((0,n.__assign)({},e),{variableDefinitions:e.variableDefinitions.filter((function(e){return t.has(e.variable.name.value)}))})}}}}))}var sr=Object.assign((function(e){return ke(e,{SelectionSet:{enter:function(e,t,r){if(!r||r.kind!==je.OPERATION_DEFINITION){var i=e.selections;if(i&&!i.some((function(e){return ue(e)&&("__typename"===e.name.value||0===e.name.value.lastIndexOf("__",0))}))){var o=r;if(!(ue(o)&&o.directives&&o.directives.some((function(e){return"export"===e.name.value}))))return(0,n.__assign)((0,n.__assign)({},e),{selections:(0,n.__spreadArray)((0,n.__spreadArray)([],i,!0),[rr],!1)})}}}}})}),{added:function(e){return e===rr}}),ur={test:function(e){var t="connection"===e.name.value;return t&&(e.arguments&&e.arguments.some((function(e){return"key"===e.name.value}))||__DEV__&&u.warn("Removing an @connection directive even though it does not have a key. You may want to use the key parameter to specify a store key.")),t}};function cr(e){return"query"===he(e).operation?e:ke(e,{OperationDefinition:{enter:function(e){return(0,n.__assign)((0,n.__assign)({},e),{operation:"query"})}}})}var lr=new Map;function fr(e){var t=lr.get(e)||1;return lr.set(e,t+1),"".concat(e,":").concat(t,":").concat(Math.random().toString(36).slice(2))}function dr(e,t,r){var n=[];e.forEach((function(e){return e[t]&&n.push(e)})),n.forEach((function(e){return e[t](r)}))}function pr(e){function t(t){Object.defineProperty(e,t,{value:Y})}return Le&&Symbol.species&&t(Symbol.species),t("@@species"),e}function hr(e){return e&&"function"==typeof e.then}var yr=function(e){function t(t){var r=e.call(this,(function(e){return r.addObserver(e),function(){return r.removeObserver(e)}}))||this;return r.observers=new Set,r.promise=new Promise((function(e,t){r.resolve=e,r.reject=t})),r.handlers={next:function(e){null!==r.sub&&(r.latest=["next",e],r.notify("next",e),dr(r.observers,"next",e))},error:function(e){var t=r.sub;null!==t&&(t&&setTimeout((function(){return t.unsubscribe()})),r.sub=null,r.latest=["error",e],r.reject(e),r.notify("error",e),dr(r.observers,"error",e))},complete:function(){var e=r,t=e.sub,n=e.sources;if(null!==t){var i=(void 0===n?[]:n).shift();i?hr(i)?i.then((function(e){return r.sub=e.subscribe(r.handlers)})):r.sub=i.subscribe(r.handlers):(t&&setTimeout((function(){return t.unsubscribe()})),r.sub=null,r.latest&&"next"===r.latest[0]?r.resolve(r.latest[1]):r.resolve(),r.notify("complete"),dr(r.observers,"complete"))}}},r.nextResultListeners=new Set,r.cancel=function(e){r.reject(e),r.sources=[],r.handlers.complete()},r.promise.catch((function(e){})),"function"==typeof t&&(t=[new Y(t)]),hr(t)?t.then((function(e){return r.start(e)}),r.handlers.error):r.start(t),r}return(0,n.__extends)(t,e),t.prototype.start=function(e){void 0===this.sub&&(this.sources=Array.from(e),this.handlers.complete())},t.prototype.deliverLastMessage=function(e){if(this.latest){var t=this.latest[0],r=e[t];r&&r.call(e,this.latest[1]),null===this.sub&&"next"===t&&e.complete&&e.complete()}},t.prototype.addObserver=function(e){this.observers.has(e)||(this.deliverLastMessage(e),this.observers.add(e))},t.prototype.removeObserver=function(e){this.observers.delete(e)&&this.observers.size<1&&this.handlers.complete()},t.prototype.notify=function(e,t){var r=this.nextResultListeners;r.size&&(this.nextResultListeners=new Set,r.forEach((function(r){return r(e,t)})))},t.prototype.beforeNext=function(e){var t=!1;this.nextResultListeners.add((function(r,n){t||(t=!0,e(r,n))}))},t}(Y);function vr(e){return e.hasOwnProperty("graphQLErrors")}pr(yr);var mr,br=function(e){function t(r){var n,i,o=r.graphQLErrors,a=r.clientErrors,s=r.networkError,u=r.errorMessage,c=r.extraInfo,l=e.call(this,u)||this;return l.name="ApolloError",l.graphQLErrors=o||[],l.clientErrors=a||[],l.networkError=s||null,l.message=u||(i="",(Rt((n=l).graphQLErrors)||Rt(n.clientErrors))&&(n.graphQLErrors||[]).concat(n.clientErrors||[]).forEach((function(e){var t=e?e.message:"Error message not found.";i+="".concat(t,"\n")})),n.networkError&&(i+="".concat(n.networkError.message,"\n")),i=i.replace(/\n$/,"")),l.extraInfo=c,l.__proto__=t.prototype,l}return(0,n.__extends)(t,e),t}(Error);function gr(e){return!!e&&e<7}!function(e){e[e.loading=1]="loading",e[e.setVariables=2]="setVariables",e[e.fetchMore=3]="fetchMore",e[e.refetch=4]="refetch",e[e.poll=6]="poll",e[e.ready=7]="ready",e[e.error=8]="error"}(mr||(mr={}));var _r=Object.prototype.toString;function Or(e){return wr(e)}function wr(e,t){switch(_r.call(e)){case"[object Array]":if((t=t||new Map).has(e))return t.get(e);var r=e.slice(0);return t.set(e,r),r.forEach((function(e,n){r[n]=wr(e,t)})),r;case"[object Object]":if((t=t||new Map).has(e))return t.get(e);var n=Object.create(Object.getPrototypeOf(e));return t.set(e,n),Object.keys(e).forEach((function(r){n[r]=wr(e[r],t)})),n;default:return e}}function Sr(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=Object.create(null);return e.forEach((function(e){e&&Object.keys(e).forEach((function(t){var n=e[t];void 0!==n&&(r[t]=n)}))})),r}var Er=Object.assign,Ir=Object.hasOwnProperty,Pr=function(e){function t(t){var r=t.queryManager,i=t.queryInfo,o=t.options,a=e.call(this,(function(e){try{var t=e._subscription._observer;t&&!t.error&&(t.error=jr)}catch(e){}var r=!a.observers.size;a.observers.add(e);var n=a.last;return n&&n.error?e.error&&e.error(n.error):n&&n.result&&e.next&&e.next(n.result),r&&a.reobserve().catch((function(){})),function(){a.observers.delete(e)&&!a.observers.size&&a.tearDownQuery()}}))||this;a.observers=new Set,a.subscriptions=new Set,a.queryInfo=i,a.queryManager=r,a.isTornDown=!1;var s=r.defaultOptions.watchQuery,u=(void 0===s?{}:s).fetchPolicy,c=void 0===u?"cache-first":u,l=o.fetchPolicy,f=void 0===l?c:l,d=o.initialFetchPolicy,p=void 0===d?"standby"===f?c:f:d;a.options=(0,n.__assign)((0,n.__assign)({},o),{initialFetchPolicy:p,fetchPolicy:f}),a.queryId=i.queryId||r.generateQueryId();var h=le(a.query);return a.queryName=h&&h.name&&h.name.value,a}return(0,n.__extends)(t,e),Object.defineProperty(t.prototype,"query",{get:function(){return this.queryManager.transform(this.options.query).document},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"variables",{get:function(){return this.options.variables},enumerable:!1,configurable:!0}),t.prototype.result=function(){var e=this;return new Promise((function(t,r){var n={next:function(r){t(r),e.observers.delete(n),e.observers.size||e.queryManager.removeQuery(e.queryId),setTimeout((function(){i.unsubscribe()}),0)},error:r},i=e.subscribe(n)}))},t.prototype.getCurrentResult=function(e){void 0===e&&(e=!0);var t=this.getLastResult(!0),r=this.queryInfo.networkStatus||t&&t.networkStatus||mr.ready,i=(0,n.__assign)((0,n.__assign)({},t),{loading:gr(r),networkStatus:r}),o=this.options.fetchPolicy,a=void 0===o?"cache-first":o;if("network-only"===a||"no-cache"===a||"standby"===a||this.queryManager.transform(this.options.query).hasForcedResolvers);else{var s=this.queryInfo.getDiff();(s.complete||this.options.returnPartialData)&&(i.data=s.result),jt(i.data,{})&&(i.data=void 0),s.complete?(delete i.partial,!s.complete||i.networkStatus!==mr.loading||"cache-first"!==a&&"cache-only"!==a||(i.networkStatus=mr.ready,i.loading=!1)):i.partial=!0,!__DEV__||s.complete||this.options.partialRefetch||i.loading||i.data||i.error||Ar(s.missing)}return e&&this.updateLastResult(i),i},t.prototype.isDifferentFromLastResult=function(e,t){return!this.last||!jt(this.last.result,e)||t&&!jt(this.last.variables,t)},t.prototype.getLast=function(e,t){var r=this.last;if(r&&r[e]&&(!t||jt(r.variables,this.variables)))return r[e]},t.prototype.getLastResult=function(e){return this.getLast("result",e)},t.prototype.getLastError=function(e){return this.getLast("error",e)},t.prototype.resetLastResults=function(){delete this.last,this.isTornDown=!1},t.prototype.resetQueryStoreErrors=function(){this.queryManager.resetErrors(this.queryId)},t.prototype.refetch=function(e){var t,r={pollInterval:0},i=this.options.fetchPolicy;if(r.fetchPolicy="cache-and-network"===i?i:"no-cache"===i?"no-cache":"network-only",__DEV__&&e&&Ir.call(e,"variables")){var o=pe(this.query),a=o.variableDefinitions;a&&a.some((function(e){return"variables"===e.variable.name.value}))||__DEV__&&u.warn("Called refetch(".concat(JSON.stringify(e),") for query ").concat((null===(t=o.name)||void 0===t?void 0:t.value)||JSON.stringify(o),", which does not declare a $variables variable.\nDid you mean to call refetch(variables) instead of refetch({ variables })?"))}return e&&!jt(this.options.variables,e)&&(r.variables=this.options.variables=(0,n.__assign)((0,n.__assign)({},this.options.variables),e)),this.queryInfo.resetLastWrite(),this.reobserve(r,mr.refetch)},t.prototype.fetchMore=function(e){var t=this,r=(0,n.__assign)((0,n.__assign)({},e.query?e:(0,n.__assign)((0,n.__assign)((0,n.__assign)((0,n.__assign)({},this.options),{query:this.query}),e),{variables:(0,n.__assign)((0,n.__assign)({},this.options.variables),e.variables)})),{fetchPolicy:"no-cache"}),i=this.queryManager.generateQueryId(),o=this.queryInfo,a=o.networkStatus;o.networkStatus=mr.fetchMore,r.notifyOnNetworkStatusChange&&this.observe();var s=new Set;return this.queryManager.fetchQuery(i,r,mr.fetchMore).then((function(n){return t.queryManager.removeQuery(i),o.networkStatus===mr.fetchMore&&(o.networkStatus=a),t.queryManager.cache.batch({update:function(i){var o=e.updateQuery;o?i.updateQuery({query:t.query,variables:t.variables,returnPartialData:!0,optimistic:!1},(function(e){return o(e,{fetchMoreResult:n.data,variables:r.variables})})):i.writeQuery({query:r.query,variables:r.variables,data:n.data})},onWatchUpdated:function(e){s.add(e.query)}}),n})).finally((function(){s.has(t.query)||Tr(t)}))},t.prototype.subscribeToMore=function(e){var t=this,r=this.queryManager.startGraphQLSubscription({query:e.document,variables:e.variables,context:e.context}).subscribe({next:function(r){var n=e.updateQuery;n&&t.updateQuery((function(e,t){var i=t.variables;return n(e,{subscriptionData:r,variables:i})}))},error:function(t){e.onError?e.onError(t):__DEV__&&u.error("Unhandled GraphQL subscription error",t)}});return this.subscriptions.add(r),function(){t.subscriptions.delete(r)&&r.unsubscribe()}},t.prototype.setOptions=function(e){return this.reobserve(e)},t.prototype.setVariables=function(e){return jt(this.variables,e)?this.observers.size?this.result():Promise.resolve():(this.options.variables=e,this.observers.size?this.reobserve({fetchPolicy:this.options.initialFetchPolicy,variables:e},mr.setVariables):Promise.resolve())},t.prototype.updateQuery=function(e){var t=this.queryManager,r=e(t.cache.diff({query:this.options.query,variables:this.variables,returnPartialData:!0,optimistic:!1}).result,{variables:this.variables});r&&(t.cache.writeQuery({query:this.options.query,data:r,variables:this.variables}),t.broadcastQueries())},t.prototype.startPolling=function(e){this.options.pollInterval=e,this.updatePolling()},t.prototype.stopPolling=function(){this.options.pollInterval=0,this.updatePolling()},t.prototype.applyNextFetchPolicy=function(e,t){if(t.nextFetchPolicy){var r=t.fetchPolicy,n=void 0===r?"cache-first":r,i=t.initialFetchPolicy,o=void 0===i?n:i;"standby"===n||("function"==typeof t.nextFetchPolicy?t.fetchPolicy=t.nextFetchPolicy(n,{reason:e,options:t,observable:this,initialFetchPolicy:o}):t.fetchPolicy="variables-changed"===e?o:t.nextFetchPolicy)}return t.fetchPolicy},t.prototype.fetch=function(e,t){return this.queryManager.setObservableQuery(this),this.queryManager.fetchQueryObservable(this.queryId,e,t)},t.prototype.updatePolling=function(){var e=this;if(!this.queryManager.ssrMode){var t=this.pollingInfo,r=this.options.pollInterval;if(r){if(!t||t.interval!==r){__DEV__?u(r,"Attempted to start a polling query without a polling interval."):u(r,13),(t||(this.pollingInfo={})).interval=r;var n=function(){e.pollingInfo&&(gr(e.queryInfo.networkStatus)?i():e.reobserve({fetchPolicy:"no-cache"===e.options.initialFetchPolicy?"no-cache":"network-only"},mr.poll).then(i,i))},i=function(){var t=e.pollingInfo;t&&(clearTimeout(t.timeout),t.timeout=setTimeout(n,t.interval))};i()}}else t&&(clearTimeout(t.timeout),delete this.pollingInfo)}},t.prototype.updateLastResult=function(e,t){return void 0===t&&(t=this.variables),this.last=(0,n.__assign)((0,n.__assign)({},this.last),{result:this.queryManager.assumeImmutableResults?e:Or(e),variables:t}),Rt(e.errors)||delete this.last.error,this.last},t.prototype.reobserve=function(e,t){var r=this;this.isTornDown=!1;var i=t===mr.refetch||t===mr.fetchMore||t===mr.poll,o=this.options.variables,a=this.options.fetchPolicy,s=Sr(this.options,e||{}),u=i?s:Er(this.options,s);i||(this.updatePolling(),e&&e.variables&&!jt(e.variables,o)&&"standby"!==u.fetchPolicy&&u.fetchPolicy===a&&(this.applyNextFetchPolicy("variables-changed",u),void 0===t&&(t=mr.setVariables)));var c=u.variables&&(0,n.__assign)({},u.variables),l=this.fetch(u,t),f={next:function(e){r.reportResult(e,c)},error:function(e){r.reportError(e,c)}};return i||(this.concast&&this.observer&&this.concast.removeObserver(this.observer),this.concast=l,this.observer=f),l.addObserver(f),l.promise},t.prototype.observe=function(){this.reportResult(this.getCurrentResult(!1),this.variables)},t.prototype.reportResult=function(e,t){var r=this.getLastError();(r||this.isDifferentFromLastResult(e,t))&&((r||!e.partial||this.options.returnPartialData)&&this.updateLastResult(e,t),dr(this.observers,"next",e))},t.prototype.reportError=function(e,t){var r=(0,n.__assign)((0,n.__assign)({},this.getLastResult()),{error:e,errors:e.graphQLErrors,networkStatus:mr.error,loading:!1});this.updateLastResult(r,t),dr(this.observers,"error",this.last.error=e)},t.prototype.hasObservers=function(){return this.observers.size>0},t.prototype.tearDownQuery=function(){this.isTornDown||(this.concast&&this.observer&&(this.concast.removeObserver(this.observer),delete this.concast,delete this.observer),this.stopPolling(),this.subscriptions.forEach((function(e){return e.unsubscribe()})),this.subscriptions.clear(),this.queryManager.stopQuery(this.queryId),this.observers.clear(),this.isTornDown=!0)},t}(Y);function Tr(e){var t=e.options,r=t.fetchPolicy,n=t.nextFetchPolicy;return"cache-and-network"===r||"network-only"===r?e.reobserve({fetchPolicy:"cache-first",nextFetchPolicy:function(){return this.nextFetchPolicy=n,"function"==typeof n?n.apply(this,arguments):r}}):e.reobserve()}function jr(e){__DEV__&&u.error("Unhandled error",e.message,e.stack)}function Ar(e){__DEV__&&e&&__DEV__&&u.debug("Missing cache result fields: ".concat(JSON.stringify(e)),e)}function xr(e){return e.kind===je.FIELD||e.kind===je.FRAGMENT_SPREAD||e.kind===je.INLINE_FRAGMENT}pr(Pr);var kr=null,Mr={},Nr=1;function Dr(e){try{return e()}catch(e){}}var Rr="@wry/context:Slot",Cr=Dr((function(){return globalThis}))||Dr((function(){return r.g}))||Object.create(null),Fr=Cr[Rr]||Array[Rr]||function(e){try{Object.defineProperty(Cr,Rr,{value:e,enumerable:!1,writable:!1,configurable:!0})}finally{return e}}(function(){function e(){this.id=["slot",Nr++,Date.now(),Math.random().toString(36).slice(2)].join(":")}return e.prototype.hasValue=function(){for(var e=kr;e;e=e.parent)if(this.id in e.slots){var t=e.slots[this.id];if(t===Mr)break;return e!==kr&&(kr.slots[this.id]=t),!0}return kr&&(kr.slots[this.id]=Mr),!1},e.prototype.getValue=function(){if(this.hasValue())return kr.slots[this.id]},e.prototype.withValue=function(e,t,r,n){var i,o=((i={__proto__:null})[this.id]=e,i),a=kr;kr={parent:a,slots:o};try{return t.apply(n,r)}finally{kr=a}},e.bind=function(e){var t=kr;return function(){var r=kr;try{return kr=t,e.apply(this,arguments)}finally{kr=r}}},e.noContext=function(e,t,r){if(!kr)return e.apply(r,t);var n=kr;try{return kr=null,e.apply(r,t)}finally{kr=n}},e}());function $r(){}Fr.bind,Fr.noContext;var qr,Lr=function(){function e(e,t){void 0===e&&(e=1/0),void 0===t&&(t=$r),this.max=e,this.dispose=t,this.map=new Map,this.newest=null,this.oldest=null}return e.prototype.has=function(e){return this.map.has(e)},e.prototype.get=function(e){var t=this.getNode(e);return t&&t.value},e.prototype.getNode=function(e){var t=this.map.get(e);if(t&&t!==this.newest){var r=t.older,n=t.newer;n&&(n.older=r),r&&(r.newer=n),t.older=this.newest,t.older.newer=t,t.newer=null,this.newest=t,t===this.oldest&&(this.oldest=n)}return t},e.prototype.set=function(e,t){var r=this.getNode(e);return r?r.value=t:(r={key:e,value:t,newer:null,older:this.newest},this.newest&&(this.newest.newer=r),this.newest=r,this.oldest=this.oldest||r,this.map.set(e,r),r.value)},e.prototype.clean=function(){for(;this.oldest&&this.map.size>this.max;)this.delete(this.oldest.key)},e.prototype.delete=function(e){var t=this.map.get(e);return!!t&&(t===this.newest&&(this.newest=t.older),t===this.oldest&&(this.oldest=t.newer),t.newer&&(t.newer.older=t.older),t.older&&(t.older.newer=t.newer),this.map.delete(e),this.dispose(t.value,e),!0)},e}(),Vr=new Fr,Ur=Object.prototype.hasOwnProperty,Qr=void 0===(qr=Array.from)?function(e){var t=[];return e.forEach((function(e){return t.push(e)})),t}:qr;function zr(e){var t=e.unsubscribe;"function"==typeof t&&(e.unsubscribe=void 0,t())}var Br=[],Wr=100;function Yr(e,t){if(!e)throw new Error(t||"assertion failure")}function Kr(e){switch(e.length){case 0:throw new Error("unknown value");case 1:return e[0];case 2:throw e[1]}}var Hr=function(){function e(t){this.fn=t,this.parents=new Set,this.childValues=new Map,this.dirtyChildren=null,this.dirty=!0,this.recomputing=!1,this.value=[],this.deps=null,++e.count}return e.prototype.peek=function(){if(1===this.value.length&&!Zr(this))return Gr(this),this.value[0]},e.prototype.recompute=function(e){return Yr(!this.recomputing,"already recomputing"),Gr(this),Zr(this)?function(e,t){return an(e),Vr.withValue(e,Jr,[e,t]),function(e,t){if("function"==typeof e.subscribe)try{zr(e),e.unsubscribe=e.subscribe.apply(null,t)}catch(t){return e.setDirty(),!1}return!0}(e,t)&&function(e){e.dirty=!1,Zr(e)||en(e)}(e),Kr(e.value)}(this,e):Kr(this.value)},e.prototype.setDirty=function(){this.dirty||(this.dirty=!0,this.value.length=0,Xr(this),zr(this))},e.prototype.dispose=function(){var e=this;this.setDirty(),an(this),tn(this,(function(t,r){t.setDirty(),sn(t,e)}))},e.prototype.forget=function(){this.dispose()},e.prototype.dependOn=function(e){e.add(this),this.deps||(this.deps=Br.pop()||new Set),this.deps.add(e)},e.prototype.forgetDeps=function(){var e=this;this.deps&&(Qr(this.deps).forEach((function(t){return t.delete(e)})),this.deps.clear(),Br.push(this.deps),this.deps=null)},e.count=0,e}();function Gr(e){var t=Vr.getValue();if(t)return e.parents.add(t),t.childValues.has(e)||t.childValues.set(e,[]),Zr(e)?rn(t,e):nn(t,e),t}function Jr(e,t){e.recomputing=!0,e.value.length=0;try{e.value[0]=e.fn.apply(null,t)}catch(t){e.value[1]=t}e.recomputing=!1}function Zr(e){return e.dirty||!(!e.dirtyChildren||!e.dirtyChildren.size)}function Xr(e){tn(e,rn)}function en(e){tn(e,nn)}function tn(e,t){var r=e.parents.size;if(r)for(var n=Qr(e.parents),i=0;i<r;++i)t(n[i],e)}function rn(e,t){Yr(e.childValues.has(t)),Yr(Zr(t));var r=!Zr(e);if(e.dirtyChildren){if(e.dirtyChildren.has(t))return}else e.dirtyChildren=Br.pop()||new Set;e.dirtyChildren.add(t),r&&Xr(e)}function nn(e,t){Yr(e.childValues.has(t)),Yr(!Zr(t));var r,n,i,o=e.childValues.get(t);0===o.length?e.childValues.set(t,t.value.slice(0)):(r=o,n=t.value,(i=r.length)>0&&i===n.length&&r[i-1]===n[i-1]||e.setDirty()),on(e,t),Zr(e)||en(e)}function on(e,t){var r=e.dirtyChildren;r&&(r.delete(t),0===r.size&&(Br.length<Wr&&Br.push(r),e.dirtyChildren=null))}function an(e){e.childValues.size>0&&e.childValues.forEach((function(t,r){sn(e,r)})),e.forgetDeps(),Yr(null===e.dirtyChildren)}function sn(e,t){t.parents.delete(e),e.childValues.delete(t),on(e,t)}var un={setDirty:!0,dispose:!0,forget:!0};function cn(e){var t=new Map,r=e&&e.subscribe;function n(e){var n=Vr.getValue();if(n){var i=t.get(e);i||t.set(e,i=new Set),n.dependOn(i),"function"==typeof r&&(zr(i),i.unsubscribe=r(e))}}return n.dirty=function(e,r){var n=t.get(e);if(n){var i=r&&Ur.call(un,r)?r:"setDirty";Qr(n).forEach((function(e){return e[i]()})),t.delete(e),zr(n)}},n}function ln(){var e=new Ht("function"==typeof WeakMap);return function(){return e.lookupArray(arguments)}}ln();var fn=new Set;function dn(e,t){void 0===t&&(t=Object.create(null));var r=new Lr(t.max||Math.pow(2,16),(function(e){return e.dispose()})),n=t.keyArgs,i=t.makeCacheKey||ln(),o=function(){var o=i.apply(null,n?n.apply(null,arguments):arguments);if(void 0===o)return e.apply(null,arguments);var a=r.get(o);a||(r.set(o,a=new Hr(e)),a.subscribe=t.subscribe,a.forget=function(){return r.delete(o)});var s=a.recompute(Array.prototype.slice.call(arguments));return r.set(o,a),fn.add(r),Vr.hasValue()||(fn.forEach((function(e){return e.clean()})),fn.clear()),s};function a(e){var t=r.get(e);t&&t.setDirty()}function s(e){var t=r.get(e);if(t)return t.peek()}function u(e){return r.delete(e)}return Object.defineProperty(o,"size",{get:function(){return r.map.size},configurable:!1,enumerable:!1}),o.dirtyKey=a,o.dirty=function(){a(i.apply(null,arguments))},o.peekKey=s,o.peek=function(){return s(i.apply(null,arguments))},o.forgetKey=u,o.forget=function(){return u(i.apply(null,arguments))},o.makeCacheKey=i,o.getKey=n?function(){return i.apply(null,n.apply(null,arguments))}:i,Object.freeze(o)}var pn=new Fr,hn=new WeakMap;function yn(e){var t=hn.get(e);return t||hn.set(e,t={vars:new Set,dep:cn()}),t}function vn(e){yn(e).vars.forEach((function(t){return t.forgetCache(e)}))}function mn(e){var t=new Set,r=new Set,n=function(o){if(arguments.length>0){if(e!==o){e=o,t.forEach((function(e){yn(e).dep.dirty(n),function(e){e.broadcastWatches&&e.broadcastWatches()}(e)}));var a=Array.from(r);r.clear(),a.forEach((function(t){return t(e)}))}}else{var s=pn.getValue();s&&(i(s),yn(s).dep(n))}return e};n.onNextChange=function(e){return r.add(e),function(){r.delete(e)}};var i=n.attachCache=function(e){return t.add(e),yn(e).vars.add(n),n};return n.forgetCache=function(e){return t.delete(e)},n}var bn=function(){function e(e){var t=e.cache,r=e.client,n=e.resolvers,i=e.fragmentMatcher;this.selectionsToResolveCache=new WeakMap,this.cache=t,r&&(this.client=r),n&&this.addResolvers(n),i&&this.setFragmentMatcher(i)}return e.prototype.addResolvers=function(e){var t=this;this.resolvers=this.resolvers||{},Array.isArray(e)?e.forEach((function(e){t.resolvers=Ft(t.resolvers,e)})):this.resolvers=Ft(this.resolvers,e)},e.prototype.setResolvers=function(e){this.resolvers={},this.addResolvers(e)},e.prototype.getResolvers=function(){return this.resolvers||{}},e.prototype.runResolvers=function(e){var t=e.document,r=e.remoteResult,i=e.context,o=e.variables,a=e.onlyRunForcedResolvers,s=void 0!==a&&a;return(0,n.__awaiter)(this,void 0,void 0,(function(){return(0,n.__generator)(this,(function(e){return t?[2,this.resolveDocument(t,r.data,i,o,this.fragmentMatcher,s).then((function(e){return(0,n.__assign)((0,n.__assign)({},r),{data:e.result})}))]:[2,r]}))}))},e.prototype.setFragmentMatcher=function(e){this.fragmentMatcher=e},e.prototype.getFragmentMatcher=function(){return this.fragmentMatcher},e.prototype.clientQuery=function(e){return De(["client"],e)&&this.resolvers?e:null},e.prototype.serverQuery=function(e){return function(e){return ce(e),ar([{test:function(e){return"client"===e.name.value},remove:!0}],e)}(e)},e.prototype.prepareContext=function(e){var t=this.cache;return(0,n.__assign)((0,n.__assign)({},e),{cache:t,getCacheKey:function(e){return t.identify(e)}})},e.prototype.addExportedVariables=function(e,t,r){return void 0===t&&(t={}),void 0===r&&(r={}),(0,n.__awaiter)(this,void 0,void 0,(function(){return(0,n.__generator)(this,(function(i){return e?[2,this.resolveDocument(e,this.buildRootValueFromCache(e,t)||{},this.prepareContext(r),t).then((function(e){return(0,n.__assign)((0,n.__assign)({},t),e.exportedVariables)}))]:[2,(0,n.__assign)({},t)]}))}))},e.prototype.shouldForceResolvers=function(e){var t=!1;return ke(e,{Directive:{enter:function(e){if("client"===e.name.value&&e.arguments&&(t=e.arguments.some((function(e){return"always"===e.name.value&&"BooleanValue"===e.value.kind&&!0===e.value.value}))))return xe}}}),t},e.prototype.buildRootValueFromCache=function(e,t){return this.cache.diff({query:cr(e),variables:t,returnPartialData:!0,optimistic:!1}).result},e.prototype.resolveDocument=function(e,t,r,i,o,a){return void 0===r&&(r={}),void 0===i&&(i={}),void 0===o&&(o=function(){return!0}),void 0===a&&(a=!1),(0,n.__awaiter)(this,void 0,void 0,(function(){var s,u,c,l,f,d,p,h,y,v;return(0,n.__generator)(this,(function(m){return s=he(e),u=de(e),c=G(u),l=this.collectSelectionsToResolve(s,c),f=s.operation,d=f?f.charAt(0).toUpperCase()+f.slice(1):"Query",h=(p=this).cache,y=p.client,v={fragmentMap:c,context:(0,n.__assign)((0,n.__assign)({},r),{cache:h,client:y}),variables:i,fragmentMatcher:o,defaultOperationType:d,exportedVariables:{},selectionsToResolve:l,onlyRunForcedResolvers:a},[2,this.resolveSelectionSet(s.selectionSet,!1,t,v).then((function(e){return{result:e,exportedVariables:v.exportedVariables}}))]}))}))},e.prototype.resolveSelectionSet=function(e,t,r,i){return(0,n.__awaiter)(this,void 0,void 0,(function(){var o,a,s,c,l,f=this;return(0,n.__generator)(this,(function(d){return o=i.fragmentMap,a=i.context,s=i.variables,c=[r],l=function(e){return(0,n.__awaiter)(f,void 0,void 0,(function(){var l,f;return(0,n.__generator)(this,(function(n){return(t||i.selectionsToResolve.has(e))&&Ne(e,s)?ue(e)?[2,this.resolveField(e,t,r,i).then((function(t){var r;void 0!==t&&c.push(((r={})[ae(e)]=t,r))}))]:(function(e){return"InlineFragment"===e.kind}(e)?l=e:(l=o[e.name.value],__DEV__?u(l,"No fragment named ".concat(e.name.value)):u(l,11)),l&&l.typeCondition&&(f=l.typeCondition.name.value,i.fragmentMatcher(r,f,a))?[2,this.resolveSelectionSet(l.selectionSet,t,r,i).then((function(e){c.push(e)}))]:[2]):[2]}))}))},[2,Promise.all(e.selections.map(l)).then((function(){return $t(c)}))]}))}))},e.prototype.resolveField=function(e,t,r,i){return(0,n.__awaiter)(this,void 0,void 0,(function(){var o,a,s,u,c,l,f,d,p,h=this;return(0,n.__generator)(this,(function(n){return r?(o=i.variables,a=e.name.value,s=ae(e),u=a!==s,c=r[s]||r[a],l=Promise.resolve(c),i.onlyRunForcedResolvers&&!this.shouldForceResolvers(e)||(f=r.__typename||i.defaultOperationType,(d=this.resolvers&&this.resolvers[f])&&(p=d[u?a:s])&&(l=Promise.resolve(pn.withValue(this.cache,p,[r,oe(e,o),i.context,{field:e,fragmentMap:i.fragmentMap}])))),[2,l.then((function(r){var n,o;if(void 0===r&&(r=c),e.directives&&e.directives.forEach((function(e){"export"===e.name.value&&e.arguments&&e.arguments.forEach((function(e){"as"===e.name.value&&"StringValue"===e.value.kind&&(i.exportedVariables[e.value.value]=r)}))})),!e.selectionSet)return r;if(null==r)return r;var a=null!==(o=null===(n=e.directives)||void 0===n?void 0:n.some((function(e){return"client"===e.name.value})))&&void 0!==o&&o;return Array.isArray(r)?h.resolveSubSelectedArray(e,t||a,r,i):e.selectionSet?h.resolveSelectionSet(e.selectionSet,t||a,r,i):void 0}))]):[2,null]}))}))},e.prototype.resolveSubSelectedArray=function(e,t,r,n){var i=this;return Promise.all(r.map((function(r){return null===r?null:Array.isArray(r)?i.resolveSubSelectedArray(e,t,r,n):e.selectionSet?i.resolveSelectionSet(e.selectionSet,t,r,n):void 0})))},e.prototype.collectSelectionsToResolve=function(e,t){var r=function(e){return!Array.isArray(e)},n=this.selectionsToResolveCache;return function e(i){if(!n.has(i)){var o=new Set;n.set(i,o),ke(i,{Directive:function(e,t,n,i,a){"client"===e.name.value&&a.forEach((function(e){r(e)&&xr(e)&&o.add(e)}))},FragmentSpread:function(n,i,a,s,c){var l=t[n.name.value];__DEV__?u(l,"No fragment named ".concat(n.name.value)):u(l,12);var f=e(l);f.size>0&&(c.forEach((function(e){r(e)&&xr(e)&&o.add(e)})),o.add(n),f.forEach((function(e){o.add(e)})))}})}return n.get(i)}(e)},e}(),gn=new($e?WeakMap:Map);function _n(e,t){var r=e[t];"function"==typeof r&&(e[t]=function(){return gn.set(e,(gn.get(e)+1)%1e15),r.apply(this,arguments)})}function On(e){e.notifyTimeout&&(clearTimeout(e.notifyTimeout),e.notifyTimeout=void 0)}var wn=function(){function e(e,t){void 0===t&&(t=e.generateQueryId()),this.queryId=t,this.listeners=new Set,this.document=null,this.lastRequestId=1,this.subscriptions=new Set,this.stopped=!1,this.dirty=!1,this.observableQuery=null;var r=this.cache=e.cache;gn.has(r)||(gn.set(r,0),_n(r,"evict"),_n(r,"modify"),_n(r,"reset"))}return e.prototype.init=function(e){var t=e.networkStatus||mr.loading;return this.variables&&this.networkStatus!==mr.loading&&!jt(this.variables,e.variables)&&(t=mr.setVariables),jt(e.variables,this.variables)||(this.lastDiff=void 0),Object.assign(this,{document:e.document,variables:e.variables,networkError:null,graphQLErrors:this.graphQLErrors||[],networkStatus:t}),e.observableQuery&&this.setObservableQuery(e.observableQuery),e.lastRequestId&&(this.lastRequestId=e.lastRequestId),this},e.prototype.reset=function(){On(this),this.dirty=!1},e.prototype.getDiff=function(e){void 0===e&&(e=this.variables);var t=this.getDiffOptions(e);if(this.lastDiff&&jt(t,this.lastDiff.options))return this.lastDiff.diff;this.updateWatch(this.variables=e);var r=this.observableQuery;if(r&&"no-cache"===r.options.fetchPolicy)return{complete:!1};var n=this.cache.diff(t);return this.updateLastDiff(n,t),n},e.prototype.updateLastDiff=function(e,t){this.lastDiff=e?{diff:e,options:t||this.getDiffOptions()}:void 0},e.prototype.getDiffOptions=function(e){var t;return void 0===e&&(e=this.variables),{query:this.document,variables:e,returnPartialData:!0,optimistic:!0,canonizeResults:null===(t=this.observableQuery)||void 0===t?void 0:t.options.canonizeResults}},e.prototype.setDiff=function(e){var t=this,r=this.lastDiff&&this.lastDiff.diff;this.updateLastDiff(e),this.dirty||jt(r&&r.result,e&&e.result)||(this.dirty=!0,this.notifyTimeout||(this.notifyTimeout=setTimeout((function(){return t.notify()}),0)))},e.prototype.setObservableQuery=function(e){var t=this;e!==this.observableQuery&&(this.oqListener&&this.listeners.delete(this.oqListener),this.observableQuery=e,e?(e.queryInfo=this,this.listeners.add(this.oqListener=function(){t.getDiff().fromOptimisticTransaction?e.observe():Tr(e)})):delete this.oqListener)},e.prototype.notify=function(){var e=this;On(this),this.shouldNotify()&&this.listeners.forEach((function(t){return t(e)})),this.dirty=!1},e.prototype.shouldNotify=function(){if(!this.dirty||!this.listeners.size)return!1;if(gr(this.networkStatus)&&this.observableQuery){var e=this.observableQuery.options.fetchPolicy;if("cache-only"!==e&&"cache-and-network"!==e)return!1}return!0},e.prototype.stop=function(){if(!this.stopped){this.stopped=!0,this.reset(),this.cancel(),this.cancel=e.prototype.cancel,this.subscriptions.forEach((function(e){return e.unsubscribe()}));var t=this.observableQuery;t&&t.stopPolling()}},e.prototype.cancel=function(){},e.prototype.updateWatch=function(e){var t=this;void 0===e&&(e=this.variables);var r=this.observableQuery;if(!r||"no-cache"!==r.options.fetchPolicy){var i=(0,n.__assign)((0,n.__assign)({},this.getDiffOptions(e)),{watcher:this,callback:function(e){return t.setDiff(e)}});this.lastWatch&&jt(i,this.lastWatch)||(this.cancel(),this.cancel=this.cache.watch(this.lastWatch=i))}},e.prototype.resetLastWrite=function(){this.lastWrite=void 0},e.prototype.shouldWrite=function(e,t){var r=this.lastWrite;return!(r&&r.dmCount===gn.get(this.cache)&&jt(t,r.variables)&&jt(e.data,r.result.data))},e.prototype.markResult=function(e,t,r,n){var i=this,o=new Lt,a=Rt(e.errors)?e.errors.slice(0):[];if(this.reset(),"incremental"in e&&Rt(e.incremental)){var s=Ut(this.getDiff().result,e);e.data=s}else if("hasNext"in e&&e.hasNext){var u=this.getDiff();e.data=o.merge(u.result,e.data)}this.graphQLErrors=a,"no-cache"===r.fetchPolicy?this.updateLastDiff({result:e.data,complete:!0},this.getDiffOptions(r.variables)):0!==n&&(Sn(e,r.errorPolicy)?this.cache.performTransaction((function(o){if(i.shouldWrite(e,r.variables))o.writeQuery({query:t,data:e.data,variables:r.variables,overwrite:1===n}),i.lastWrite={result:e,variables:r.variables,dmCount:gn.get(i.cache)};else if(i.lastDiff&&i.lastDiff.diff.complete)return void(e.data=i.lastDiff.diff.result);var a=i.getDiffOptions(r.variables),s=o.diff(a);i.stopped||i.updateWatch(r.variables),i.updateLastDiff(s,a),s.complete&&(e.data=s.result)})):this.lastWrite=void 0)},e.prototype.markReady=function(){return this.networkError=null,this.networkStatus=mr.ready},e.prototype.markError=function(e){return this.networkStatus=mr.error,this.lastWrite=void 0,this.reset(),e.graphQLErrors&&(this.graphQLErrors=e.graphQLErrors),e.networkError&&(this.networkError=e.networkError),e},e}();function Sn(e,t){void 0===t&&(t="none");var r="ignore"===t||"all"===t,n=!er(e);return!n&&r&&e.data&&(n=!0),n}var En=Object.prototype.hasOwnProperty,In=function(){function e(e){var t=e.cache,r=e.link,n=e.defaultOptions,i=e.queryDeduplication,o=void 0!==i&&i,a=e.onBroadcast,s=e.ssrMode,u=void 0!==s&&s,c=e.clientAwareness,l=void 0===c?{}:c,f=e.localState,d=e.assumeImmutableResults;this.clientAwareness={},this.queries=new Map,this.fetchCancelFns=new Map,this.transformCache=new($e?WeakMap:Map),this.queryIdCounter=1,this.requestIdCounter=1,this.mutationIdCounter=1,this.inFlightLinkObservables=new Map,this.cache=t,this.link=r,this.defaultOptions=n||Object.create(null),this.queryDeduplication=o,this.clientAwareness=l,this.localState=f||new bn({cache:t}),this.ssrMode=u,this.assumeImmutableResults=!!d,(this.onBroadcast=a)&&(this.mutationStore=Object.create(null))}return e.prototype.stop=function(){var e=this;this.queries.forEach((function(t,r){e.stopQueryNoBroadcast(r)})),this.cancelPendingFetches(__DEV__?new s("QueryManager stopped while query was in flight"):new s(14))},e.prototype.cancelPendingFetches=function(e){this.fetchCancelFns.forEach((function(t){return t(e)})),this.fetchCancelFns.clear()},e.prototype.mutate=function(e){var t,r,i=e.mutation,o=e.variables,a=e.optimisticResponse,s=e.updateQueries,c=e.refetchQueries,l=void 0===c?[]:c,f=e.awaitRefetchQueries,d=void 0!==f&&f,p=e.update,h=e.onQueryUpdated,y=e.fetchPolicy,v=void 0===y?(null===(t=this.defaultOptions.mutate)||void 0===t?void 0:t.fetchPolicy)||"network-only":y,m=e.errorPolicy,b=void 0===m?(null===(r=this.defaultOptions.mutate)||void 0===r?void 0:r.errorPolicy)||"none":m,g=e.keepRootFields,_=e.context;return(0,n.__awaiter)(this,void 0,void 0,(function(){var e,t,r,c,f,y;return(0,n.__generator)(this,(function(m){switch(m.label){case 0:return __DEV__?u(i,"mutation option is required. You must specify your GraphQL document in the mutation option."):u(i,15),__DEV__?u("network-only"===v||"no-cache"===v,"Mutations support only 'network-only' or 'no-cache' fetchPolicy strings. The default `network-only` behavior automatically writes mutation results to the cache. Passing `no-cache` skips the cache write."):u("network-only"===v||"no-cache"===v,16),e=this.generateMutationId(),t=this.transform(i),r=t.document,c=t.hasClientExports,i=this.cache.transformForLink(r),o=this.getVariables(i,o),c?[4,this.localState.addExportedVariables(i,o,_)]:[3,2];case 1:o=m.sent(),m.label=2;case 2:return f=this.mutationStore&&(this.mutationStore[e]={mutation:i,variables:o,loading:!0,error:null}),a&&this.markMutationOptimistic(a,{mutationId:e,document:i,variables:o,fetchPolicy:v,errorPolicy:b,context:_,updateQueries:s,update:p,keepRootFields:g}),this.broadcastQueries(),y=this,[2,new Promise((function(t,r){return Xt(y.getObservableFromLink(i,(0,n.__assign)((0,n.__assign)({},_),{optimisticResponse:a}),o,!1),(function(t){if(er(t)&&"none"===b)throw new br({graphQLErrors:tr(t)});f&&(f.loading=!1,f.error=null);var r=(0,n.__assign)({},t);return"function"==typeof l&&(l=l(r)),"ignore"===b&&er(r)&&delete r.errors,y.markMutationResult({mutationId:e,result:r,document:i,variables:o,fetchPolicy:v,errorPolicy:b,context:_,update:p,updateQueries:s,awaitRefetchQueries:d,refetchQueries:l,removeOptimistic:a?e:void 0,onQueryUpdated:h,keepRootFields:g})})).subscribe({next:function(e){y.broadcastQueries(),"hasNext"in e&&!1!==e.hasNext||t(e)},error:function(t){f&&(f.loading=!1,f.error=t),a&&y.cache.removeOptimistic(e),y.broadcastQueries(),r(t instanceof br?t:new br({networkError:t}))}})}))]}}))}))},e.prototype.markMutationResult=function(e,t){var r=this;void 0===t&&(t=this.cache);var i=e.result,o=[],a="no-cache"===e.fetchPolicy;if(!a&&Sn(i,e.errorPolicy)){if(Vt(i)||o.push({result:i.data,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}),Vt(i)&&Rt(i.incremental)){var s=t.diff({id:"ROOT_MUTATION",query:this.transform(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0}),u=void 0;s.result&&(u=Ut(s.result,i)),void 0!==u&&(i.data=u,o.push({result:u,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}))}var c=e.updateQueries;c&&this.queries.forEach((function(e,n){var a=e.observableQuery,s=a&&a.queryName;if(s&&En.call(c,s)){var u=c[s],l=r.queries.get(n),f=l.document,d=l.variables,p=t.diff({query:f,variables:d,returnPartialData:!0,optimistic:!1}),h=p.result;if(p.complete&&h){var y=u(h,{mutationResult:i,queryName:f&&fe(f)||void 0,queryVariables:d});y&&o.push({result:y,dataId:"ROOT_QUERY",query:f,variables:d})}}}))}if(o.length>0||e.refetchQueries||e.update||e.onQueryUpdated||e.removeOptimistic){var l=[];if(this.refetchQueries({updateCache:function(t){a||o.forEach((function(e){return t.write(e)}));var s,u=e.update,c=!(Vt(s=i)||function(e){return"hasNext"in e&&"data"in e}(s))||Vt(i)&&!i.hasNext;if(u){if(!a){var l=t.diff({id:"ROOT_MUTATION",query:r.transform(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0});l.complete&&("incremental"in(i=(0,n.__assign)((0,n.__assign)({},i),{data:l.result}))&&delete i.incremental,"hasNext"in i&&delete i.hasNext)}c&&u(t,i,{context:e.context,variables:e.variables})}a||e.keepRootFields||!c||t.modify({id:"ROOT_MUTATION",fields:function(e,t){var r=t.fieldName,n=t.DELETE;return"__typename"===r?e:n}})},include:e.refetchQueries,optimistic:!1,removeOptimistic:e.removeOptimistic,onQueryUpdated:e.onQueryUpdated||null}).forEach((function(e){return l.push(e)})),e.awaitRefetchQueries||e.onQueryUpdated)return Promise.all(l).then((function(){return i}))}return Promise.resolve(i)},e.prototype.markMutationOptimistic=function(e,t){var r=this,i="function"==typeof e?e(t.variables):e;return this.cache.recordOptimisticTransaction((function(e){try{r.markMutationResult((0,n.__assign)((0,n.__assign)({},t),{result:{data:i}}),e)}catch(e){__DEV__&&u.error(e)}}),t.mutationId)},e.prototype.fetchQuery=function(e,t,r){return this.fetchQueryObservable(e,t,r).promise},e.prototype.getQueryStore=function(){var e=Object.create(null);return this.queries.forEach((function(t,r){e[r]={variables:t.variables,networkStatus:t.networkStatus,networkError:t.networkError,graphQLErrors:t.graphQLErrors}})),e},e.prototype.resetErrors=function(e){var t=this.queries.get(e);t&&(t.networkError=void 0,t.graphQLErrors=[])},e.prototype.transform=function(e){var t=this.transformCache;if(!t.has(e)){var r=this.cache.transformDocument(e),i=ar([ur],ce(r)),o=this.localState.clientQuery(r),a=i&&this.localState.serverQuery(i),s={document:r,hasClientExports:Re(r),hasForcedResolvers:this.localState.shouldForceResolvers(r),clientQuery:o,serverQuery:a,defaultVars:ye(le(r)),asQuery:(0,n.__assign)((0,n.__assign)({},r),{definitions:r.definitions.map((function(e){return"OperationDefinition"===e.kind&&"query"!==e.operation?(0,n.__assign)((0,n.__assign)({},e),{operation:"query"}):e}))})},u=function(e){e&&!t.has(e)&&t.set(e,s)};u(e),u(r),u(o),u(a)}return t.get(e)},e.prototype.getVariables=function(e,t){return(0,n.__assign)((0,n.__assign)({},this.transform(e).defaultVars),t)},e.prototype.watchQuery=function(e){void 0===(e=(0,n.__assign)((0,n.__assign)({},e),{variables:this.getVariables(e.query,e.variables)})).notifyOnNetworkStatusChange&&(e.notifyOnNetworkStatusChange=!1);var t=new wn(this),r=new Pr({queryManager:this,queryInfo:t,options:e});return this.queries.set(r.queryId,t),t.init({document:r.query,observableQuery:r,variables:r.variables}),r},e.prototype.query=function(e,t){var r=this;return void 0===t&&(t=this.generateQueryId()),__DEV__?u(e.query,"query option is required. You must specify your GraphQL document in the query option."):u(e.query,17),__DEV__?u("Document"===e.query.kind,'You must wrap the query string in a "gql" tag.'):u("Document"===e.query.kind,18),__DEV__?u(!e.returnPartialData,"returnPartialData option only supported on watchQuery."):u(!e.returnPartialData,19),__DEV__?u(!e.pollInterval,"pollInterval option only supported on watchQuery."):u(!e.pollInterval,20),this.fetchQuery(t,e).finally((function(){return r.stopQuery(t)}))},e.prototype.generateQueryId=function(){return String(this.queryIdCounter++)},e.prototype.generateRequestId=function(){return this.requestIdCounter++},e.prototype.generateMutationId=function(){return String(this.mutationIdCounter++)},e.prototype.stopQueryInStore=function(e){this.stopQueryInStoreNoBroadcast(e),this.broadcastQueries()},e.prototype.stopQueryInStoreNoBroadcast=function(e){var t=this.queries.get(e);t&&t.stop()},e.prototype.clearStore=function(e){return void 0===e&&(e={discardWatches:!0}),this.cancelPendingFetches(__DEV__?new s("Store reset while query was in flight (not completed in link chain)"):new s(21)),this.queries.forEach((function(e){e.observableQuery?e.networkStatus=mr.loading:e.stop()})),this.mutationStore&&(this.mutationStore=Object.create(null)),this.cache.reset(e)},e.prototype.getObservableQueries=function(e){var t=this;void 0===e&&(e="active");var r=new Map,i=new Map,o=new Set;return Array.isArray(e)&&e.forEach((function(e){var r;"string"==typeof e?i.set(e,!1):K(r=e)&&"Document"===r.kind&&Array.isArray(r.definitions)?i.set(t.transform(e).document,!1):K(e)&&e.query&&o.add(e)})),this.queries.forEach((function(t,n){var o=t.observableQuery,a=t.document;if(o){if("all"===e)return void r.set(n,o);var s=o.queryName;if("standby"===o.options.fetchPolicy||"active"===e&&!o.hasObservers())return;("active"===e||s&&i.has(s)||a&&i.has(a))&&(r.set(n,o),s&&i.set(s,!0),a&&i.set(a,!0))}})),o.size&&o.forEach((function(e){var i=fr("legacyOneTimeQuery"),o=t.getQuery(i).init({document:e.query,variables:e.variables}),a=new Pr({queryManager:t,queryInfo:o,options:(0,n.__assign)((0,n.__assign)({},e),{fetchPolicy:"network-only"})});u(a.queryId===i),o.setObservableQuery(a),r.set(i,a)})),__DEV__&&i.size&&i.forEach((function(e,t){e||__DEV__&&u.warn("Unknown query ".concat("string"==typeof t?"named ":"").concat(JSON.stringify(t,null,2)," requested in refetchQueries options.include array"))})),r},e.prototype.reFetchObservableQueries=function(e){var t=this;void 0===e&&(e=!1);var r=[];return this.getObservableQueries(e?"all":"active").forEach((function(n,i){var o=n.options.fetchPolicy;n.resetLastResults(),(e||"standby"!==o&&"cache-only"!==o)&&r.push(n.refetch()),t.getQuery(i).setDiff(null)})),this.broadcastQueries(),Promise.all(r)},e.prototype.setObservableQuery=function(e){this.getQuery(e.queryId).setObservableQuery(e)},e.prototype.startGraphQLSubscription=function(e){var t=this,r=e.query,n=e.fetchPolicy,i=e.errorPolicy,o=e.variables,a=e.context,s=void 0===a?{}:a;r=this.transform(r).document,o=this.getVariables(r,o);var u=function(e){return t.getObservableFromLink(r,s,e).map((function(o){if("no-cache"!==n&&(Sn(o,i)&&t.cache.write({query:r,result:o.data,dataId:"ROOT_SUBSCRIPTION",variables:e}),t.broadcastQueries()),er(o))throw new br({graphQLErrors:o.errors});return o}))};if(this.transform(r).hasClientExports){var c=this.localState.addExportedVariables(r,o,s).then(u);return new Y((function(e){var t=null;return c.then((function(r){return t=r.subscribe(e)}),e.error),function(){return t&&t.unsubscribe()}}))}return u(o)},e.prototype.stopQuery=function(e){this.stopQueryNoBroadcast(e),this.broadcastQueries()},e.prototype.stopQueryNoBroadcast=function(e){this.stopQueryInStoreNoBroadcast(e),this.removeQuery(e)},e.prototype.removeQuery=function(e){this.fetchCancelFns.delete(e),this.queries.has(e)&&(this.getQuery(e).stop(),this.queries.delete(e))},e.prototype.broadcastQueries=function(){this.onBroadcast&&this.onBroadcast(),this.queries.forEach((function(e){return e.notify()}))},e.prototype.getLocalState=function(){return this.localState},e.prototype.getObservableFromLink=function(e,t,r,i){var o,a,s=this;void 0===i&&(i=null!==(o=null==t?void 0:t.queryDeduplication)&&void 0!==o?o:this.queryDeduplication);var u=this.transform(e).serverQuery;if(u){var c=this.inFlightLinkObservables,l=this.link,f={query:u,variables:r,operationName:fe(u)||void 0,context:this.prepareContext((0,n.__assign)((0,n.__assign)({},t),{forceFetch:!i}))};if(t=f.context,i){var d=c.get(u)||new Map;c.set(u,d);var p=Jt(r);if(!(a=d.get(p))){var h=new yr([Oe(l,f)]);d.set(p,a=h),h.beforeNext((function(){d.delete(p)&&d.size<1&&c.delete(u)}))}}else a=new yr([Oe(l,f)])}else a=new yr([Y.of({data:{}})]),t=this.prepareContext(t);var y=this.transform(e).clientQuery;return y&&(a=Xt(a,(function(e){return s.localState.runResolvers({document:y,remoteResult:e,context:t,variables:r})}))),a},e.prototype.getResultsFromLink=function(e,t,r){var n=e.lastRequestId=this.generateRequestId(),i=this.cache.transformForLink(this.transform(e.document).document);return Xt(this.getObservableFromLink(i,r.context,r.variables),(function(o){var a=tr(o),s=a.length>0;if(n>=e.lastRequestId){if(s&&"none"===r.errorPolicy)throw e.markError(new br({graphQLErrors:a}));e.markResult(o,i,r,t),e.markReady()}var u={data:o.data,loading:!1,networkStatus:mr.ready};return s&&"ignore"!==r.errorPolicy&&(u.errors=a,u.networkStatus=mr.error),u}),(function(t){var r=vr(t)?t:new br({networkError:t});throw n>=e.lastRequestId&&e.markError(r),r}))},e.prototype.fetchQueryObservable=function(e,t,r){var n=this;void 0===r&&(r=mr.loading);var i=this.transform(t.query).document,o=this.getVariables(i,t.variables),a=this.getQuery(e),s=this.defaultOptions.watchQuery,u=t.fetchPolicy,c=void 0===u?s&&s.fetchPolicy||"cache-first":u,l=t.errorPolicy,f=void 0===l?s&&s.errorPolicy||"none":l,d=t.returnPartialData,p=void 0!==d&&d,h=t.notifyOnNetworkStatusChange,y=void 0!==h&&h,v=t.context,m=void 0===v?{}:v,b=Object.assign({},t,{query:i,variables:o,fetchPolicy:c,errorPolicy:f,returnPartialData:p,notifyOnNetworkStatusChange:y,context:m}),g=function(e){b.variables=e;var i=n.fetchQueryByPolicy(a,b,r);return"standby"!==b.fetchPolicy&&i.length>0&&a.observableQuery&&a.observableQuery.applyNextFetchPolicy("after-fetch",t),i},_=function(){return n.fetchCancelFns.delete(e)};this.fetchCancelFns.set(e,(function(e){_(),setTimeout((function(){return O.cancel(e)}))}));var O=new yr(this.transform(b.query).hasClientExports?this.localState.addExportedVariables(b.query,b.variables,b.context).then(g):g(b.variables));return O.promise.then(_,_),O},e.prototype.refetchQueries=function(e){var t=this,r=e.updateCache,n=e.include,i=e.optimistic,o=void 0!==i&&i,a=e.removeOptimistic,s=void 0===a?o?fr("refetchQueries"):void 0:a,u=e.onQueryUpdated,c=new Map;n&&this.getObservableQueries(n).forEach((function(e,r){c.set(r,{oq:e,lastDiff:t.getQuery(r).getDiff()})}));var l=new Map;return r&&this.cache.batch({update:r,optimistic:o&&s||!1,removeOptimistic:s,onWatchUpdated:function(e,t,r){var n=e.watcher instanceof wn&&e.watcher.observableQuery;if(n){if(u){c.delete(n.queryId);var i=u(n,t,r);return!0===i&&(i=n.refetch()),!1!==i&&l.set(n,i),i}null!==u&&c.set(n.queryId,{oq:n,lastDiff:r,diff:t})}}}),c.size&&c.forEach((function(e,r){var n,i=e.oq,o=e.lastDiff,a=e.diff;if(u){if(!a){var s=i.queryInfo;s.reset(),a=s.getDiff()}n=u(i,a,o)}u&&!0!==n||(n=i.refetch()),!1!==n&&l.set(i,n),r.indexOf("legacyOneTimeQuery")>=0&&t.stopQueryNoBroadcast(r)})),s&&this.cache.removeOptimistic(s),l},e.prototype.fetchQueryByPolicy=function(e,t,r){var i=this,o=t.query,a=t.variables,s=t.fetchPolicy,u=t.refetchWritePolicy,c=t.errorPolicy,l=t.returnPartialData,f=t.context,d=t.notifyOnNetworkStatusChange,p=e.networkStatus;e.init({document:this.transform(o).document,variables:a,networkStatus:r});var h=function(){return e.getDiff(a)},y=function(t,r){void 0===r&&(r=e.networkStatus||mr.loading);var s=t.result;!__DEV__||l||jt(s,{})||Ar(t.missing);var u=function(e){return Y.of((0,n.__assign)({data:e,loading:gr(r),networkStatus:r},t.complete?null:{partial:!0}))};return s&&i.transform(o).hasForcedResolvers?i.localState.runResolvers({document:o,remoteResult:{data:s},context:f,variables:a,onlyRunForcedResolvers:!0}).then((function(e){return u(e.data||void 0)})):"none"===c&&r===mr.refetch&&Array.isArray(t.missing)?u(void 0):u(s)},v="no-cache"===s?0:r===mr.refetch&&"merge"!==u?1:2,m=function(){return i.getResultsFromLink(e,v,{variables:a,context:f,fetchPolicy:s,errorPolicy:c})},b=d&&"number"==typeof p&&p!==r&&gr(r);switch(s){default:case"cache-first":return(g=h()).complete?[y(g,e.markReady())]:l||b?[y(g),m()]:[m()];case"cache-and-network":var g;return(g=h()).complete||l||b?[y(g),m()]:[m()];case"cache-only":return[y(h(),e.markReady())];case"network-only":return b?[y(h()),m()]:[m()];case"no-cache":return b?[y(e.getDiff()),m()]:[m()];case"standby":return[]}},e.prototype.getQuery=function(e){return e&&!this.queries.has(e)&&this.queries.set(e,new wn(this,e)),this.queries.get(e)},e.prototype.prepareContext=function(e){void 0===e&&(e={});var t=this.localState.prepareContext(e);return(0,n.__assign)((0,n.__assign)({},t),{clientAwareness:this.clientAwareness})},e}();function Pn(e,t){return Sr(e,t,t.variables&&{variables:(0,n.__assign)((0,n.__assign)({},e&&e.variables),t.variables)})}var Tn,jn=!1,An=function(){function e(e){var t=this;this.resetStoreCallbacks=[],this.clearStoreCallbacks=[];var r=e.uri,n=e.credentials,i=e.headers,o=e.cache,a=e.ssrMode,c=void 0!==a&&a,l=e.ssrForceFetchDelay,f=void 0===l?0:l,d=e.connectToDevTools,p=void 0===d?"object"==typeof window&&!window.__APOLLO_CLIENT__&&__DEV__:d,h=e.queryDeduplication,y=void 0===h||h,v=e.defaultOptions,m=e.assumeImmutableResults,b=void 0!==m&&m,g=e.resolvers,_=e.typeDefs,O=e.fragmentMatcher,w=e.name,S=e.version,E=e.link;if(E||(E=r?new wt({uri:r,credentials:n,headers:i}):_e.empty()),!o)throw __DEV__?new s("To initialize Apollo Client, you must specify a 'cache' property in the options object. \nFor more information, please visit: https://go.apollo.dev/c/docs"):new s(9);if(this.link=E,this.cache=o,this.disableNetworkFetches=c||f>0,this.queryDeduplication=y,this.defaultOptions=v||Object.create(null),this.typeDefs=_,f&&setTimeout((function(){return t.disableNetworkFetches=!1}),f),this.watchQuery=this.watchQuery.bind(this),this.query=this.query.bind(this),this.mutate=this.mutate.bind(this),this.resetStore=this.resetStore.bind(this),this.reFetchObservableQueries=this.reFetchObservableQueries.bind(this),p&&"object"==typeof window&&(window.__APOLLO_CLIENT__=this),!jn&&p&&__DEV__&&(jn=!0,"undefined"!=typeof window&&window.document&&window.top===window.self&&!window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__)){var I=window.navigator,P=I&&I.userAgent,T=void 0;"string"==typeof P&&(P.indexOf("Chrome/")>-1?T="https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm":P.indexOf("Firefox/")>-1&&(T="https://addons.mozilla.org/en-US/firefox/addon/apollo-developer-tools/")),T&&__DEV__&&u.log("Download the Apollo DevTools for a better development experience: "+T)}this.version="3.7.9",this.localState=new bn({cache:o,client:this,resolvers:g,fragmentMatcher:O}),this.queryManager=new In({cache:this.cache,link:this.link,defaultOptions:this.defaultOptions,queryDeduplication:y,ssrMode:c,clientAwareness:{name:w,version:S},localState:this.localState,assumeImmutableResults:b,onBroadcast:p?function(){t.devToolsHookCb&&t.devToolsHookCb({action:{},state:{queries:t.queryManager.getQueryStore(),mutations:t.queryManager.mutationStore||{}},dataWithOptimisticResults:t.cache.extract(!0)})}:void 0})}return e.prototype.stop=function(){this.queryManager.stop()},e.prototype.watchQuery=function(e){return this.defaultOptions.watchQuery&&(e=Pn(this.defaultOptions.watchQuery,e)),!this.disableNetworkFetches||"network-only"!==e.fetchPolicy&&"cache-and-network"!==e.fetchPolicy||(e=(0,n.__assign)((0,n.__assign)({},e),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(e)},e.prototype.query=function(e){return this.defaultOptions.query&&(e=Pn(this.defaultOptions.query,e)),__DEV__?u("cache-and-network"!==e.fetchPolicy,"The cache-and-network fetchPolicy does not work with client.query, because client.query can only return a single result. Please use client.watchQuery to receive multiple results from the cache and the network, or consider using a different fetchPolicy, such as cache-first or network-only."):u("cache-and-network"!==e.fetchPolicy,10),this.disableNetworkFetches&&"network-only"===e.fetchPolicy&&(e=(0,n.__assign)((0,n.__assign)({},e),{fetchPolicy:"cache-first"})),this.queryManager.query(e)},e.prototype.mutate=function(e){return this.defaultOptions.mutate&&(e=Pn(this.defaultOptions.mutate,e)),this.queryManager.mutate(e)},e.prototype.subscribe=function(e){return this.queryManager.startGraphQLSubscription(e)},e.prototype.readQuery=function(e,t){return void 0===t&&(t=!1),this.cache.readQuery(e,t)},e.prototype.readFragment=function(e,t){return void 0===t&&(t=!1),this.cache.readFragment(e,t)},e.prototype.writeQuery=function(e){this.cache.writeQuery(e),this.queryManager.broadcastQueries()},e.prototype.writeFragment=function(e){this.cache.writeFragment(e),this.queryManager.broadcastQueries()},e.prototype.__actionHookForDevTools=function(e){this.devToolsHookCb=e},e.prototype.__requestRaw=function(e){return Oe(this.link,e)},e.prototype.resetStore=function(){var e=this;return Promise.resolve().then((function(){return e.queryManager.clearStore({discardWatches:!1})})).then((function(){return Promise.all(e.resetStoreCallbacks.map((function(e){return e()})))})).then((function(){return e.reFetchObservableQueries()}))},e.prototype.clearStore=function(){var e=this;return Promise.resolve().then((function(){return e.queryManager.clearStore({discardWatches:!0})})).then((function(){return Promise.all(e.clearStoreCallbacks.map((function(e){return e()})))}))},e.prototype.onResetStore=function(e){var t=this;return this.resetStoreCallbacks.push(e),function(){t.resetStoreCallbacks=t.resetStoreCallbacks.filter((function(t){return t!==e}))}},e.prototype.onClearStore=function(e){var t=this;return this.clearStoreCallbacks.push(e),function(){t.clearStoreCallbacks=t.clearStoreCallbacks.filter((function(t){return t!==e}))}},e.prototype.reFetchObservableQueries=function(e){return this.queryManager.reFetchObservableQueries(e)},e.prototype.refetchQueries=function(e){var t=this.queryManager.refetchQueries(e),r=[],n=[];t.forEach((function(e,t){r.push(t),n.push(e)}));var i=Promise.all(n);return i.queries=r,i.results=n,i.catch((function(e){__DEV__&&u.debug("In client.refetchQueries, Promise.all promise rejected with error ".concat(e))})),i},e.prototype.getObservableQueries=function(e){return void 0===e&&(e="active"),this.queryManager.getObservableQueries(e)},e.prototype.extract=function(e){return this.cache.extract(e)},e.prototype.restore=function(e){return this.cache.restore(e)},e.prototype.addResolvers=function(e){this.localState.addResolvers(e)},e.prototype.setResolvers=function(e){this.localState.setResolvers(e)},e.prototype.getResolvers=function(){return this.localState.getResolvers()},e.prototype.setLocalStateFragmentMatcher=function(e){this.localState.setFragmentMatcher(e)},e.prototype.setLink=function(e){this.link=this.queryManager.link=e},e}();Tn||(Tn={});var xn=function(){function e(){this.getFragmentDoc=dn(H)}return e.prototype.batch=function(e){var t,r=this,n="string"==typeof e.optimistic?e.optimistic:!1===e.optimistic?null:void 0;return this.performTransaction((function(){return t=e.update(r)}),n),t},e.prototype.recordOptimisticTransaction=function(e,t){this.performTransaction(e,t)},e.prototype.transformDocument=function(e){return e},e.prototype.transformForLink=function(e){return e},e.prototype.identify=function(e){},e.prototype.gc=function(){return[]},e.prototype.modify=function(e){return!1},e.prototype.readQuery=function(e,t){return void 0===t&&(t=!!e.optimistic),this.read((0,n.__assign)((0,n.__assign)({},e),{rootId:e.id||"ROOT_QUERY",optimistic:t}))},e.prototype.readFragment=function(e,t){return void 0===t&&(t=!!e.optimistic),this.read((0,n.__assign)((0,n.__assign)({},e),{query:this.getFragmentDoc(e.fragment,e.fragmentName),rootId:e.id,optimistic:t}))},e.prototype.writeQuery=function(e){var t=e.id,r=e.data,i=(0,n.__rest)(e,["id","data"]);return this.write(Object.assign(i,{dataId:t||"ROOT_QUERY",result:r}))},e.prototype.writeFragment=function(e){var t=e.id,r=e.data,i=e.fragment,o=e.fragmentName,a=(0,n.__rest)(e,["id","data","fragment","fragmentName"]);return this.write(Object.assign(a,{query:this.getFragmentDoc(i,o),dataId:t,result:r}))},e.prototype.updateQuery=function(e,t){return this.batch({update:function(r){var i=r.readQuery(e),o=t(i);return null==o?i:(r.writeQuery((0,n.__assign)((0,n.__assign)({},e),{data:o})),o)}})},e.prototype.updateFragment=function(e,t){return this.batch({update:function(r){var i=r.readFragment(e),o=t(i);return null==o?i:(r.writeFragment((0,n.__assign)((0,n.__assign)({},e),{data:o})),o)}})},e}(),kn=function(e){function t(r,n,i,o){var a,s=e.call(this,r)||this;if(s.message=r,s.path=n,s.query=i,s.variables=o,Array.isArray(s.path)){s.missing=s.message;for(var u=s.path.length-1;u>=0;--u)s.missing=((a={})[s.path[u]]=s.missing,a)}else s.missing=s.path;return s.__proto__=t.prototype,s}return(0,n.__extends)(t,e),t}(Error);function Mn(e){return __DEV__&&(t=e,(r=new Set([t])).forEach((function(e){K(e)&&function(e){if(__DEV__&&!Object.isFrozen(e))try{Object.freeze(e)}catch(e){if(e instanceof TypeError)return null;throw e}return e}(e)===e&&Object.getOwnPropertyNames(e).forEach((function(t){K(e[t])&&r.add(e[t])}))}))),e;var t,r}var Nn=Object.prototype.hasOwnProperty;function Dn(e){return null==e}function Rn(e,t){var r=e.__typename,n=e.id,i=e._id;if("string"==typeof r&&(t&&(t.keyObject=Dn(n)?Dn(i)?void 0:{_id:i}:{id:n}),Dn(n)&&!Dn(i)&&(n=i),!Dn(n)))return"".concat(r,":").concat("number"==typeof n||"string"==typeof n?n:JSON.stringify(n))}var Cn={dataIdFromObject:Rn,addTypename:!0,resultCaching:!0,canonizeResults:!1};function Fn(e){var t=e.canonizeResults;return void 0===t?Cn.canonizeResults:t}var $n=/^[_a-z][_0-9a-z]*/i;function qn(e){var t=e.match($n);return t?t[0]:e}function Ln(e,t,r){return!!K(t)&&(Dt(t)?t.every((function(t){return Ln(e,t,r)})):e.selections.every((function(e){if(ue(e)&&Ne(e,r)){var n=ae(e);return Nn.call(t,n)&&(!e.selectionSet||Ln(e.selectionSet,t[n],r))}return!0})))}function Vn(e){return K(e)&&!X(e)&&!Dt(e)}function Un(e,t){var r=G(de(e));return{fragmentMap:r,lookupFragment:function(e){var n=r[e];return!n&&t&&(n=t.lookup(e)),n||null}}}var Qn=Object.create(null),zn=function(){return Qn},Bn=Object.create(null),Wn=function(){function e(e,t){var r=this;this.policies=e,this.group=t,this.data=Object.create(null),this.rootIds=Object.create(null),this.refs=Object.create(null),this.getFieldValue=function(e,t){return Mn(X(e)?r.get(e.__ref,t):e&&e[t])},this.canRead=function(e){return X(e)?r.has(e.__ref):"object"==typeof e},this.toReference=function(e,t){if("string"==typeof e)return Z(e);if(X(e))return e;var n=r.policies.identify(e)[0];if(n){var i=Z(n);return t&&r.merge(n,e),i}}}return e.prototype.toObject=function(){return(0,n.__assign)({},this.data)},e.prototype.has=function(e){return void 0!==this.lookup(e,!0)},e.prototype.get=function(e,t){if(this.group.depend(e,t),Nn.call(this.data,e)){var r=this.data[e];if(r&&Nn.call(r,t))return r[t]}return"__typename"===t&&Nn.call(this.policies.rootTypenamesById,e)?this.policies.rootTypenamesById[e]:this instanceof Gn?this.parent.get(e,t):void 0},e.prototype.lookup=function(e,t){return t&&this.group.depend(e,"__exists"),Nn.call(this.data,e)?this.data[e]:this instanceof Gn?this.parent.lookup(e,t):this.policies.rootTypenamesById[e]?Object.create(null):void 0},e.prototype.merge=function(e,t){var r,n=this;X(e)&&(e=e.__ref),X(t)&&(t=t.__ref);var i="string"==typeof e?this.lookup(r=e):e,o="string"==typeof t?this.lookup(r=t):t;if(o){__DEV__?u("string"==typeof r,"store.merge expects a string ID"):u("string"==typeof r,1);var a=new Lt(Zn).merge(i,o);if(this.data[r]=a,a!==i&&(delete this.refs[r],this.group.caching)){var s=Object.create(null);i||(s.__exists=1),Object.keys(o).forEach((function(e){if(!i||i[e]!==a[e]){s[e]=1;var t=qn(e);t===e||n.policies.hasKeyArgs(a.__typename,t)||(s[t]=1),void 0!==a[e]||n instanceof Gn||delete a[e]}})),!s.__typename||i&&i.__typename||this.policies.rootTypenamesById[r]!==a.__typename||delete s.__typename,Object.keys(s).forEach((function(e){return n.group.dirty(r,e)}))}}},e.prototype.modify=function(e,t){var r=this,i=this.lookup(e);if(i){var o=Object.create(null),a=!1,s=!0,u={DELETE:Qn,INVALIDATE:Bn,isReference:X,toReference:this.toReference,canRead:this.canRead,readField:function(t,n){return r.policies.readField("string"==typeof t?{fieldName:t,from:n||Z(e)}:t,{store:r})}};if(Object.keys(i).forEach((function(c){var l=qn(c),f=i[c];if(void 0!==f){var d="function"==typeof t?t:t[c]||t[l];if(d){var p=d===zn?Qn:d(Mn(f),(0,n.__assign)((0,n.__assign)({},u),{fieldName:l,storeFieldName:c,storage:r.getStorage(e,c)}));p===Bn?r.group.dirty(e,c):(p===Qn&&(p=void 0),p!==f&&(o[c]=p,a=!0,f=p))}void 0!==f&&(s=!1)}})),a)return this.merge(e,o),s&&(this instanceof Gn?this.data[e]=void 0:delete this.data[e],this.group.dirty(e,"__exists")),!0}return!1},e.prototype.delete=function(e,t,r){var n,i=this.lookup(e);if(i){var o=this.getFieldValue(i,"__typename"),a=t&&r?this.policies.getStoreFieldName({typename:o,fieldName:t,args:r}):t;return this.modify(e,a?((n={})[a]=zn,n):zn)}return!1},e.prototype.evict=function(e,t){var r=!1;return e.id&&(Nn.call(this.data,e.id)&&(r=this.delete(e.id,e.fieldName,e.args)),this instanceof Gn&&this!==t&&(r=this.parent.evict(e,t)||r),(e.fieldName||r)&&this.group.dirty(e.id,e.fieldName||"__exists")),r},e.prototype.clear=function(){this.replace(null)},e.prototype.extract=function(){var e=this,t=this.toObject(),r=[];return this.getRootIdSet().forEach((function(t){Nn.call(e.policies.rootTypenamesById,t)||r.push(t)})),r.length&&(t.__META={extraRootIds:r.sort()}),t},e.prototype.replace=function(e){var t=this;if(Object.keys(this.data).forEach((function(r){e&&Nn.call(e,r)||t.delete(r)})),e){var r=e.__META,i=(0,n.__rest)(e,["__META"]);Object.keys(i).forEach((function(e){t.merge(e,i[e])})),r&&r.extraRootIds.forEach(this.retain,this)}},e.prototype.retain=function(e){return this.rootIds[e]=(this.rootIds[e]||0)+1},e.prototype.release=function(e){if(this.rootIds[e]>0){var t=--this.rootIds[e];return t||delete this.rootIds[e],t}return 0},e.prototype.getRootIdSet=function(e){return void 0===e&&(e=new Set),Object.keys(this.rootIds).forEach(e.add,e),this instanceof Gn?this.parent.getRootIdSet(e):Object.keys(this.policies.rootTypenamesById).forEach(e.add,e),e},e.prototype.gc=function(){var e=this,t=this.getRootIdSet(),r=this.toObject();t.forEach((function(n){Nn.call(r,n)&&(Object.keys(e.findChildRefIds(n)).forEach(t.add,t),delete r[n])}));var n=Object.keys(r);if(n.length){for(var i=this;i instanceof Gn;)i=i.parent;n.forEach((function(e){return i.delete(e)}))}return n},e.prototype.findChildRefIds=function(e){if(!Nn.call(this.refs,e)){var t=this.refs[e]=Object.create(null),r=this.data[e];if(!r)return t;var n=new Set([r]);n.forEach((function(e){X(e)&&(t[e.__ref]=!0),K(e)&&Object.keys(e).forEach((function(t){var r=e[t];K(r)&&n.add(r)}))}))}return this.refs[e]},e.prototype.makeCacheKey=function(){return this.group.keyMaker.lookupArray(arguments)},e}(),Yn=function(){function e(e,t){void 0===t&&(t=null),this.caching=e,this.parent=t,this.d=null,this.resetCaching()}return e.prototype.resetCaching=function(){this.d=this.caching?cn():null,this.keyMaker=new Ht($e)},e.prototype.depend=function(e,t){if(this.d){this.d(Kn(e,t));var r=qn(t);r!==t&&this.d(Kn(e,r)),this.parent&&this.parent.depend(e,t)}},e.prototype.dirty=function(e,t){this.d&&this.d.dirty(Kn(e,t),"__exists"===t?"forget":"setDirty")},e}();function Kn(e,t){return t+"#"+e}function Hn(e,t){Xn(e)&&e.group.depend(t,"__exists")}!function(e){var t=function(e){function t(t){var r=t.policies,n=t.resultCaching,i=void 0===n||n,o=t.seed,a=e.call(this,r,new Yn(i))||this;return a.stump=new Jn(a),a.storageTrie=new Ht($e),o&&a.replace(o),a}return(0,n.__extends)(t,e),t.prototype.addLayer=function(e,t){return this.stump.addLayer(e,t)},t.prototype.removeLayer=function(){return this},t.prototype.getStorage=function(){return this.storageTrie.lookupArray(arguments)},t}(e);e.Root=t}(Wn||(Wn={}));var Gn=function(e){function t(t,r,n,i){var o=e.call(this,r.policies,i)||this;return o.id=t,o.parent=r,o.replay=n,o.group=i,n(o),o}return(0,n.__extends)(t,e),t.prototype.addLayer=function(e,r){return new t(e,this,r,this.group)},t.prototype.removeLayer=function(e){var t=this,r=this.parent.removeLayer(e);return e===this.id?(this.group.caching&&Object.keys(this.data).forEach((function(e){var n=t.data[e],i=r.lookup(e);i?n?n!==i&&Object.keys(n).forEach((function(r){jt(n[r],i[r])||t.group.dirty(e,r)})):(t.group.dirty(e,"__exists"),Object.keys(i).forEach((function(r){t.group.dirty(e,r)}))):t.delete(e)})),r):r===this.parent?this:r.addLayer(this.id,this.replay)},t.prototype.toObject=function(){return(0,n.__assign)((0,n.__assign)({},this.parent.toObject()),this.data)},t.prototype.findChildRefIds=function(t){var r=this.parent.findChildRefIds(t);return Nn.call(this.data,t)?(0,n.__assign)((0,n.__assign)({},r),e.prototype.findChildRefIds.call(this,t)):r},t.prototype.getStorage=function(){for(var e=this.parent;e.parent;)e=e.parent;return e.getStorage.apply(e,arguments)},t}(Wn),Jn=function(e){function t(t){return e.call(this,"EntityStore.Stump",t,(function(){}),new Yn(t.group.caching,t.group))||this}return(0,n.__extends)(t,e),t.prototype.removeLayer=function(){return this},t.prototype.merge=function(){return this.parent.merge.apply(this.parent,arguments)},t}(Gn);function Zn(e,t,r){var n=e[r],i=t[r];return jt(n,i)?n:i}function Xn(e){return!!(e instanceof Wn&&e.group.caching)}function ei(e){return[e.selectionSet,e.objectOrReference,e.context,e.context.canonizeResults]}var ti=function(){function e(e){var t=this;this.knownResults=new($e?WeakMap:Map),this.config=Sr(e,{addTypename:!1!==e.addTypename,canonizeResults:Fn(e)}),this.canon=e.canon||new Gt,this.executeSelectionSet=dn((function(e){var r,i=e.context.canonizeResults,o=ei(e);o[3]=!i;var a=(r=t.executeSelectionSet).peek.apply(r,o);return a?i?(0,n.__assign)((0,n.__assign)({},a),{result:t.canon.admit(a.result)}):a:(Hn(e.context.store,e.enclosingRef.__ref),t.execSelectionSetImpl(e))}),{max:this.config.resultCacheMaxSize,keyArgs:ei,makeCacheKey:function(e,t,r,n){if(Xn(r.store))return r.store.makeCacheKey(e,X(t)?t.__ref:t,r.varString,n)}}),this.executeSubSelectedArray=dn((function(e){return Hn(e.context.store,e.enclosingRef.__ref),t.execSubSelectedArrayImpl(e)}),{max:this.config.resultCacheMaxSize,makeCacheKey:function(e){var t=e.field,r=e.array,n=e.context;if(Xn(n.store))return n.store.makeCacheKey(t,r,n.varString)}})}return e.prototype.resetCanon=function(){this.canon=new Gt},e.prototype.diffQueryAgainstStore=function(e){var t=e.store,r=e.query,i=e.rootId,o=void 0===i?"ROOT_QUERY":i,a=e.variables,s=e.returnPartialData,u=void 0===s||s,c=e.canonizeResults,l=void 0===c?this.config.canonizeResults:c,f=this.config.cache.policies;a=(0,n.__assign)((0,n.__assign)({},ye(pe(r))),a);var d,p=Z(o),h=this.executeSelectionSet({selectionSet:he(r).selectionSet,objectOrReference:p,enclosingRef:p,context:(0,n.__assign)({store:t,query:r,policies:f,variables:a,varString:Jt(a),canonizeResults:l},Un(r,this.config.fragments))});if(h.missing&&(d=[new kn(ri(h.missing),h.missing,r,a)],!u))throw d[0];return{result:h.result,complete:!d,missing:d}},e.prototype.isFresh=function(e,t,r,n){if(Xn(n.store)&&this.knownResults.get(e)===r){var i=this.executeSelectionSet.peek(r,t,n,this.canon.isKnown(e));if(i&&e===i.result)return!0}return!1},e.prototype.execSelectionSetImpl=function(e){var t=this,r=e.selectionSet,n=e.objectOrReference,i=e.enclosingRef,o=e.context;if(X(n)&&!o.policies.rootTypenamesById[n.__ref]&&!o.store.has(n.__ref))return{result:this.canon.empty,missing:"Dangling reference to missing ".concat(n.__ref," object")};var a,u=o.variables,c=o.policies,l=o.store.getFieldValue(n,"__typename"),f=[],d=new Lt;function p(e,t){var r;return e.missing&&(a=d.merge(a,((r={})[t]=e.missing,r))),e.result}this.config.addTypename&&"string"==typeof l&&!c.rootIdsByTypename[l]&&f.push({__typename:l});var h=new Set(r.selections);h.forEach((function(e){var r,y;if(Ne(e,u))if(ue(e)){var v=c.readField({fieldName:e.name.value,field:e,variables:o.variables,from:n},o),m=ae(e);void 0===v?sr.added(e)||(a=d.merge(a,((r={})[m]="Can't find field '".concat(e.name.value,"' on ").concat(X(n)?n.__ref+" object":"object "+JSON.stringify(n,null,2)),r))):Dt(v)?v=p(t.executeSubSelectedArray({field:e,array:v,enclosingRef:i,context:o}),m):e.selectionSet?null!=v&&(v=p(t.executeSelectionSet({selectionSet:e.selectionSet,objectOrReference:v,enclosingRef:X(v)?v:i,context:o}),m)):o.canonizeResults&&(v=t.canon.pass(v)),void 0!==v&&f.push(((y={})[m]=v,y))}else{var b=J(e,o.lookupFragment);if(!b&&e.kind===je.FRAGMENT_SPREAD)throw __DEV__?new s("No fragment named ".concat(e.name.value)):new s(5);b&&c.fragmentMatches(b,l)&&b.selectionSet.selections.forEach(h.add,h)}}));var y={result:$t(f),missing:a},v=o.canonizeResults?this.canon.admit(y):Mn(y);return v.result&&this.knownResults.set(v.result,r),v},e.prototype.execSubSelectedArrayImpl=function(e){var t,r=this,n=e.field,i=e.array,o=e.enclosingRef,a=e.context,s=new Lt;function c(e,r){var n;return e.missing&&(t=s.merge(t,((n={})[r]=e.missing,n))),e.result}return n.selectionSet&&(i=i.filter(a.store.canRead)),i=i.map((function(e,t){return null===e?null:Dt(e)?c(r.executeSubSelectedArray({field:n,array:e,enclosingRef:o,context:a}),t):n.selectionSet?c(r.executeSelectionSet({selectionSet:n.selectionSet,objectOrReference:e,enclosingRef:X(e)?e:o,context:a}),t):(__DEV__&&function(e,t,r){if(!t.selectionSet){var n=new Set([r]);n.forEach((function(r){K(r)&&(__DEV__?u(!X(r),"Missing selection set for object of type ".concat(function(e,t){return X(t)?e.get(t.__ref,"__typename"):t&&t.__typename}(e,r)," returned for query field ").concat(t.name.value)):u(!X(r),6),Object.values(r).forEach(n.add,n))}))}}(a.store,n,e),e)})),{result:a.canonizeResults?this.canon.admit(i):i,missing:t}},e}();function ri(e){try{JSON.stringify(e,(function(e,t){if("string"==typeof t)throw t;return t}))}catch(e){return e}}var ni=Object.create(null);function ii(e){var t=JSON.stringify(e);return ni[t]||(ni[t]=Object.create(null))}function oi(e){var t=ii(e);return t.keyFieldsFn||(t.keyFieldsFn=function(t,r){var n=function(e,t){return r.readField(t,e)},i=r.keyObject=si(e,(function(e){var i=li(r.storeObject,e,n);return void 0===i&&t!==r.storeObject&&Nn.call(t,e[0])&&(i=li(t,e,ci)),__DEV__?u(void 0!==i,"Missing field '".concat(e.join("."),"' while extracting keyFields from ").concat(JSON.stringify(t))):u(void 0!==i,2),i}));return"".concat(r.typename,":").concat(JSON.stringify(i))})}function ai(e){var t=ii(e);return t.keyArgsFn||(t.keyArgsFn=function(t,r){var n=r.field,i=r.variables,o=r.fieldName,a=si(e,(function(e){var r=e[0],o=r.charAt(0);if("@"!==o)if("$"!==o){if(t)return li(t,e)}else{var a=r.slice(1);if(i&&Nn.call(i,a)){var s=e.slice(0);return s[0]=a,li(i,s)}}else if(n&&Rt(n.directives)){var u=r.slice(1),c=n.directives.find((function(e){return e.name.value===u})),l=c&&oe(c,i);return l&&li(l,e.slice(1))}})),s=JSON.stringify(a);return(t||"{}"!==s)&&(o+=":"+s),o})}function si(e,t){var r=new Lt;return ui(e).reduce((function(e,n){var i,o=t(n);if(void 0!==o){for(var a=n.length-1;a>=0;--a)(i={})[n[a]]=o,o=i;e=r.merge(e,o)}return e}),Object.create(null))}function ui(e){var t=ii(e);if(!t.paths){var r=t.paths=[],n=[];e.forEach((function(t,i){Dt(t)?(ui(t).forEach((function(e){return r.push(n.concat(e))})),n.length=0):(n.push(t),Dt(e[i+1])||(r.push(n.slice(0)),n.length=0))}))}return t.paths}function ci(e,t){return e[t]}function li(e,t,r){return r=r||ci,fi(t.reduce((function e(t,n){return Dt(t)?t.map((function(t){return e(t,n)})):t&&r(t,n)}),e))}function fi(e){return K(e)?Dt(e)?e.map(fi):si(Object.keys(e).sort(),(function(t){return li(e,t)})):e}function di(e){return void 0!==e.args?e.args:e.field?oe(e.field,e.variables):null}re.setStringify(Jt);var pi=function(){},hi=function(e,t){return t.fieldName},yi=function(e,t,r){return(0,r.mergeObjects)(e,t)},vi=function(e,t){return t},mi=function(){function e(e){this.config=e,this.typePolicies=Object.create(null),this.toBeAdded=Object.create(null),this.supertypeMap=new Map,this.fuzzySubtypes=new Map,this.rootIdsByTypename=Object.create(null),this.rootTypenamesById=Object.create(null),this.usingPossibleTypes=!1,this.config=(0,n.__assign)({dataIdFromObject:Rn},e),this.cache=this.config.cache,this.setRootTypename("Query"),this.setRootTypename("Mutation"),this.setRootTypename("Subscription"),e.possibleTypes&&this.addPossibleTypes(e.possibleTypes),e.typePolicies&&this.addTypePolicies(e.typePolicies)}return e.prototype.identify=function(e,t){var r,i=this,o=t&&(t.typename||(null===(r=t.storeObject)||void 0===r?void 0:r.__typename))||e.__typename;if(o===this.rootTypenamesById.ROOT_QUERY)return["ROOT_QUERY"];for(var a,s=t&&t.storeObject||e,u=(0,n.__assign)((0,n.__assign)({},t),{typename:o,storeObject:s,readField:t&&t.readField||function(){var e=gi(arguments,s);return i.readField(e,{store:i.cache.data,variables:e.variables})}}),c=o&&this.getTypePolicy(o),l=c&&c.keyFn||this.config.dataIdFromObject;l;){var f=l(e,u);if(!Dt(f)){a=f;break}l=oi(f)}return a=a?String(a):void 0,u.keyObject?[a,u.keyObject]:[a]},e.prototype.addTypePolicies=function(e){var t=this;Object.keys(e).forEach((function(r){var i=e[r],o=i.queryType,a=i.mutationType,s=i.subscriptionType,u=(0,n.__rest)(i,["queryType","mutationType","subscriptionType"]);o&&t.setRootTypename("Query",r),a&&t.setRootTypename("Mutation",r),s&&t.setRootTypename("Subscription",r),Nn.call(t.toBeAdded,r)?t.toBeAdded[r].push(u):t.toBeAdded[r]=[u]}))},e.prototype.updateTypePolicy=function(e,t){var r=this,n=this.getTypePolicy(e),i=t.keyFields,o=t.fields;function a(e,t){e.merge="function"==typeof t?t:!0===t?yi:!1===t?vi:e.merge}a(n,t.merge),n.keyFn=!1===i?pi:Dt(i)?oi(i):"function"==typeof i?i:n.keyFn,o&&Object.keys(o).forEach((function(t){var n=r.getFieldPolicy(e,t,!0),i=o[t];if("function"==typeof i)n.read=i;else{var s=i.keyArgs,u=i.read,c=i.merge;n.keyFn=!1===s?hi:Dt(s)?ai(s):"function"==typeof s?s:n.keyFn,"function"==typeof u&&(n.read=u),a(n,c)}n.read&&n.merge&&(n.keyFn=n.keyFn||hi)}))},e.prototype.setRootTypename=function(e,t){void 0===t&&(t=e);var r="ROOT_"+e.toUpperCase(),n=this.rootTypenamesById[r];t!==n&&(__DEV__?u(!n||n===e,"Cannot change root ".concat(e," __typename more than once")):u(!n||n===e,3),n&&delete this.rootIdsByTypename[n],this.rootIdsByTypename[t]=r,this.rootTypenamesById[r]=t)},e.prototype.addPossibleTypes=function(e){var t=this;this.usingPossibleTypes=!0,Object.keys(e).forEach((function(r){t.getSupertypeSet(r,!0),e[r].forEach((function(e){t.getSupertypeSet(e,!0).add(r);var n=e.match($n);n&&n[0]===e||t.fuzzySubtypes.set(e,new RegExp(e))}))}))},e.prototype.getTypePolicy=function(e){var t=this;if(!Nn.call(this.typePolicies,e)){var r=this.typePolicies[e]=Object.create(null);r.fields=Object.create(null);var i=this.supertypeMap.get(e);i&&i.size&&i.forEach((function(e){var i=t.getTypePolicy(e),o=i.fields,a=(0,n.__rest)(i,["fields"]);Object.assign(r,a),Object.assign(r.fields,o)}))}var o=this.toBeAdded[e];return o&&o.length&&o.splice(0).forEach((function(r){t.updateTypePolicy(e,r)})),this.typePolicies[e]},e.prototype.getFieldPolicy=function(e,t,r){if(e){var n=this.getTypePolicy(e).fields;return n[t]||r&&(n[t]=Object.create(null))}},e.prototype.getSupertypeSet=function(e,t){var r=this.supertypeMap.get(e);return!r&&t&&this.supertypeMap.set(e,r=new Set),r},e.prototype.fragmentMatches=function(e,t,r,n){var i=this;if(!e.typeCondition)return!0;if(!t)return!1;var o=e.typeCondition.name.value;if(t===o)return!0;if(this.usingPossibleTypes&&this.supertypeMap.has(o))for(var a=this.getSupertypeSet(t,!0),s=[a],c=function(e){var t=i.getSupertypeSet(e,!1);t&&t.size&&s.indexOf(t)<0&&s.push(t)},l=!(!r||!this.fuzzySubtypes.size),f=!1,d=0;d<s.length;++d){var p=s[d];if(p.has(o))return a.has(o)||(f&&__DEV__&&u.warn("Inferring subtype ".concat(t," of supertype ").concat(o)),a.add(o)),!0;p.forEach(c),l&&d===s.length-1&&Ln(e.selectionSet,r,n)&&(l=!1,f=!0,this.fuzzySubtypes.forEach((function(e,r){var n=t.match(e);n&&n[0]===t&&c(r)})))}return!1},e.prototype.hasKeyArgs=function(e,t){var r=this.getFieldPolicy(e,t,!1);return!(!r||!r.keyFn)},e.prototype.getStoreFieldName=function(e){var t,r=e.typename,n=e.fieldName,i=this.getFieldPolicy(r,n,!1),o=i&&i.keyFn;if(o&&r)for(var a={typename:r,fieldName:n,field:e.field||null,variables:e.variables},s=di(e);o;){var u=o(s,a);if(!Dt(u)){t=u||n;break}o=ai(u)}return void 0===t&&(t=e.field?function(e,t){var r=null;e.directives&&(r={},e.directives.forEach((function(e){r[e.name.value]={},e.arguments&&e.arguments.forEach((function(n){var i=n.name,o=n.value;return ee(r[e.name.value],i,o,t)}))})));var n=null;return e.arguments&&e.arguments.length&&(n={},e.arguments.forEach((function(e){var r=e.name,i=e.value;return ee(n,r,i,t)}))),re(e.name.value,n,r)}(e.field,e.variables):re(n,di(e))),!1===t?n:n===qn(t)?t:n+":"+t},e.prototype.readField=function(e,t){var r=e.from;if(r&&(e.field||e.fieldName)){if(void 0===e.typename){var n=t.store.getFieldValue(r,"__typename");n&&(e.typename=n)}var i=this.getStoreFieldName(e),o=qn(i),a=t.store.getFieldValue(r,i),s=this.getFieldPolicy(e.typename,o,!1),u=s&&s.read;if(u){var c=bi(this,r,e,t,t.store.getStorage(X(r)?r.__ref:r,i));return pn.withValue(this.cache,u,[a,c])}return a}},e.prototype.getReadFunction=function(e,t){var r=this.getFieldPolicy(e,t,!1);return r&&r.read},e.prototype.getMergeFunction=function(e,t,r){var n=this.getFieldPolicy(e,t,!1),i=n&&n.merge;return!i&&r&&(i=(n=this.getTypePolicy(r))&&n.merge),i},e.prototype.runMergeFunction=function(e,t,r,n,i){var o=r.field,a=r.typename,s=r.merge;return s===yi?_i(n.store)(e,t):s===vi?t:(n.overwrite&&(e=void 0),s(e,t,bi(this,void 0,{typename:a,fieldName:o.name.value,field:o,variables:n.variables},n,i||Object.create(null))))},e}();function bi(e,t,r,n,i){var o=e.getStoreFieldName(r),a=qn(o),s=r.variables||n.variables,u=n.store,c=u.toReference,l=u.canRead;return{args:di(r),field:r.field||null,fieldName:a,storeFieldName:o,variables:s,isReference:X,toReference:c,storage:i,cache:e.cache,canRead:l,readField:function(){return e.readField(gi(arguments,t,s),n)},mergeObjects:_i(n.store)}}function gi(e,t,r){var i,o,a,s=e[0],c=e[1],l=e.length;return"string"==typeof s?i={fieldName:s,from:l>1?c:t}:(i=(0,n.__assign)({},s),Nn.call(i,"from")||(i.from=t)),__DEV__&&void 0===i.from&&__DEV__&&u.warn("Undefined 'from' passed to readField with arguments ".concat((o=Array.from(e),a=fr("stringifyForDisplay"),JSON.stringify(o,(function(e,t){return void 0===t?a:t})).split(JSON.stringify(a)).join("<undefined>")))),void 0===i.variables&&(i.variables=r),i}function _i(e){return function(t,r){if(Dt(t)||Dt(r))throw __DEV__?new s("Cannot automatically merge arrays"):new s(4);if(K(t)&&K(r)){var i=e.getFieldValue(t,"__typename"),o=e.getFieldValue(r,"__typename");if(i&&o&&i!==o)return r;if(X(t)&&Vn(r))return e.merge(t.__ref,r),t;if(Vn(t)&&X(r))return e.merge(t,r.__ref),r;if(Vn(t)&&Vn(r))return(0,n.__assign)((0,n.__assign)({},t),r)}return r}}function Oi(e,t,r){var i="".concat(t).concat(r),o=e.flavors.get(i);return o||e.flavors.set(i,o=e.clientOnly===t&&e.deferred===r?e:(0,n.__assign)((0,n.__assign)({},e),{clientOnly:t,deferred:r})),o}var wi=function(){function e(e,t,r){this.cache=e,this.reader=t,this.fragments=r}return e.prototype.writeToStore=function(e,t){var r=this,i=t.query,o=t.result,a=t.dataId,c=t.variables,l=t.overwrite,f=le(i),d=new Lt;c=(0,n.__assign)((0,n.__assign)({},ye(f)),c);var p=(0,n.__assign)((0,n.__assign)({store:e,written:Object.create(null),merge:function(e,t){return d.merge(e,t)},variables:c,varString:Jt(c)},Un(i,this.fragments)),{overwrite:!!l,incomingById:new Map,clientOnly:!1,deferred:!1,flavors:new Map}),h=this.processSelectionSet({result:o||Object.create(null),dataId:a,selectionSet:f.selectionSet,mergeTree:{map:new Map},context:p});if(!X(h))throw __DEV__?new s("Could not identify object ".concat(JSON.stringify(o))):new s(7);return p.incomingById.forEach((function(t,n){var i=t.storeObject,o=t.mergeTree,a=t.fieldNodeSet,s=Z(n);if(o&&o.map.size){var c=r.applyMerges(o,s,i,p);if(X(c))return;i=c}if(__DEV__&&!p.overwrite){var l=Object.create(null);a.forEach((function(e){e.selectionSet&&(l[e.name.value]=!0)})),Object.keys(i).forEach((function(e){(function(e){return!0===l[qn(e)]})(e)&&!function(e){var t=o&&o.map.get(e);return Boolean(t&&t.info&&t.info.merge)}(e)&&function(e,t,r,n){var i=function(e){var t=n.getFieldValue(e,r);return"object"==typeof t&&t},o=i(e);if(o){var a=i(t);if(a&&!X(o)&&!jt(o,a)&&!Object.keys(o).every((function(e){return void 0!==n.getFieldValue(a,e)}))){var s=n.getFieldValue(e,"__typename")||n.getFieldValue(t,"__typename"),c=qn(r),l="".concat(s,".").concat(c);if(!ji.has(l)){ji.add(l);var f=[];Dt(o)||Dt(a)||[o,a].forEach((function(e){var t=n.getFieldValue(e,"__typename");"string"!=typeof t||f.includes(t)||f.push(t)})),__DEV__&&u.warn("Cache data may be lost when replacing the ".concat(c," field of a ").concat(s," object.\n\nTo address this problem (which is not a bug in Apollo Client), ").concat(f.length?"either ensure all objects of type "+f.join(" and ")+" have an ID or a custom merge function, or ":"","define a custom merge function for the ").concat(l," field, so InMemoryCache can safely merge these objects:\n\n existing: ").concat(JSON.stringify(o).slice(0,1e3),"\n incoming: ").concat(JSON.stringify(a).slice(0,1e3),"\n\nFor more information about these options, please refer to the documentation:\n\n * Ensuring entity objects have IDs: https://go.apollo.dev/c/generating-unique-identifiers\n * Defining custom merge functions: https://go.apollo.dev/c/merging-non-normalized-objects\n"))}}}}(s,i,e,p.store)}))}e.merge(n,i)})),e.retain(h.__ref),h},e.prototype.processSelectionSet=function(e){var t=this,r=e.dataId,i=e.result,o=e.selectionSet,a=e.context,s=e.mergeTree,c=this.cache.policies,l=Object.create(null),f=r&&c.rootTypenamesById[r]||se(i,o,a.fragmentMap)||r&&a.store.get(r,"__typename");"string"==typeof f&&(l.__typename=f);var d=function(){var e=gi(arguments,l,a.variables);if(X(e.from)){var t=a.incomingById.get(e.from.__ref);if(t){var r=c.readField((0,n.__assign)((0,n.__assign)({},e),{from:t.storeObject}),a);if(void 0!==r)return r}}return c.readField(e,a)},p=new Set;this.flattenFields(o,i,a,f).forEach((function(e,r){var n,o=ae(r),a=i[o];if(p.add(r),void 0!==a){var h=c.getStoreFieldName({typename:f,fieldName:r.name.value,field:r,variables:e.variables}),y=Ei(s,h),v=t.processFieldValue(a,r,r.selectionSet?Oi(e,!1,!1):e,y),m=void 0;r.selectionSet&&(X(v)||Vn(v))&&(m=d("__typename",v));var b=c.getMergeFunction(f,r.name.value,m);b?y.info={field:r,typename:f,merge:b}:Ti(s,h),l=e.merge(l,((n={})[h]=v,n))}else!__DEV__||e.clientOnly||e.deferred||sr.added(r)||c.getReadFunction(f,r.name.value)||__DEV__&&u.error("Missing field '".concat(ae(r),"' while writing result ").concat(JSON.stringify(i,null,2)).substring(0,1e3))}));try{var h=c.identify(i,{typename:f,selectionSet:o,fragmentMap:a.fragmentMap,storeObject:l,readField:d}),y=h[0],v=h[1];r=r||y,v&&(l=a.merge(l,v))}catch(e){if(!r)throw e}if("string"==typeof r){var m=Z(r),b=a.written[r]||(a.written[r]=[]);if(b.indexOf(o)>=0)return m;if(b.push(o),this.reader&&this.reader.isFresh(i,m,o,a))return m;var g=a.incomingById.get(r);return g?(g.storeObject=a.merge(g.storeObject,l),g.mergeTree=Ii(g.mergeTree,s),p.forEach((function(e){return g.fieldNodeSet.add(e)}))):a.incomingById.set(r,{storeObject:l,mergeTree:Pi(s)?void 0:s,fieldNodeSet:p}),m}return l},e.prototype.processFieldValue=function(e,t,r,n){var i=this;return t.selectionSet&&null!==e?Dt(e)?e.map((function(e,o){var a=i.processFieldValue(e,t,r,Ei(n,o));return Ti(n,o),a})):this.processSelectionSet({result:e,selectionSet:t.selectionSet,context:r,mergeTree:n}):__DEV__?Or(e):e},e.prototype.flattenFields=function(e,t,r,n){void 0===n&&(n=se(t,e,r.fragmentMap));var i=new Map,o=this.cache.policies,a=new Ht(!1);return function e(u,c){var l=a.lookup(u,c.clientOnly,c.deferred);l.visited||(l.visited=!0,u.selections.forEach((function(a){if(Ne(a,r.variables)){var u=c.clientOnly,l=c.deferred;if(u&&l||!Rt(a.directives)||a.directives.forEach((function(e){var t=e.name.value;if("client"===t&&(u=!0),"defer"===t){var n=oe(e,r.variables);n&&!1===n.if||(l=!0)}})),ue(a)){var f=i.get(a);f&&(u=u&&f.clientOnly,l=l&&f.deferred),i.set(a,Oi(r,u,l))}else{var d=J(a,r.lookupFragment);if(!d&&a.kind===je.FRAGMENT_SPREAD)throw __DEV__?new s("No fragment named ".concat(a.name.value)):new s(8);d&&o.fragmentMatches(d,n,t,r.variables)&&e(d.selectionSet,Oi(r,u,l))}}})))}(e,r),i},e.prototype.applyMerges=function(e,t,r,i,o){var a,s=this;if(e.map.size&&!X(r)){var c,l=Dt(r)||!X(t)&&!Vn(t)?void 0:t,f=r;l&&!o&&(o=[X(l)?l.__ref:l]);var d=function(e,t){return Dt(e)?"number"==typeof t?e[t]:void 0:i.store.getFieldValue(e,String(t))};e.map.forEach((function(e,t){var r=d(l,t),n=d(f,t);if(void 0!==n){o&&o.push(t);var a=s.applyMerges(e,r,n,i,o);a!==n&&(c=c||new Map).set(t,a),o&&u(o.pop()===t)}})),c&&(r=Dt(f)?f.slice(0):(0,n.__assign)({},f),c.forEach((function(e,t){r[t]=e})))}return e.info?this.cache.policies.runMergeFunction(t,r,e.info,i,o&&(a=i.store).getStorage.apply(a,o)):r},e}(),Si=[];function Ei(e,t){var r=e.map;return r.has(t)||r.set(t,Si.pop()||{map:new Map}),r.get(t)}function Ii(e,t){if(e===t||!t||Pi(t))return e;if(!e||Pi(e))return t;var r=e.info&&t.info?(0,n.__assign)((0,n.__assign)({},e.info),t.info):e.info||t.info,i=e.map.size&&t.map.size,o={info:r,map:i?new Map:e.map.size?e.map:t.map};if(i){var a=new Set(t.map.keys());e.map.forEach((function(e,r){o.map.set(r,Ii(e,t.map.get(r))),a.delete(r)})),a.forEach((function(r){o.map.set(r,Ii(t.map.get(r),e.map.get(r)))}))}return o}function Pi(e){return!e||!(e.info||e.map.size)}function Ti(e,t){var r=e.map,n=r.get(t);n&&Pi(n)&&(Si.push(n),r.delete(t))}var ji=new Set,Ai=function(e){function t(t){void 0===t&&(t={});var r=e.call(this)||this;return r.watches=new Set,r.typenameDocumentCache=new Map,r.makeVar=mn,r.txCount=0,r.config=function(e){return Sr(Cn,e)}(t),r.addTypename=!!r.config.addTypename,r.policies=new mi({cache:r,dataIdFromObject:r.config.dataIdFromObject,possibleTypes:r.config.possibleTypes,typePolicies:r.config.typePolicies}),r.init(),r}return(0,n.__extends)(t,e),t.prototype.init=function(){var e=this.data=new Wn.Root({policies:this.policies,resultCaching:this.config.resultCaching});this.optimisticData=e.stump,this.resetResultCache()},t.prototype.resetResultCache=function(e){var t=this,r=this.storeReader,n=this.config.fragments;this.storeWriter=new wi(this,this.storeReader=new ti({cache:this,addTypename:this.addTypename,resultCacheMaxSize:this.config.resultCacheMaxSize,canonizeResults:Fn(this.config),canon:e?void 0:r&&r.canon,fragments:n}),n),this.maybeBroadcastWatch=dn((function(e,r){return t.broadcastWatch(e,r)}),{max:this.config.resultCacheMaxSize,makeCacheKey:function(e){var r=e.optimistic?t.optimisticData:t.data;if(Xn(r)){var n=e.optimistic,i=e.id,o=e.variables;return r.makeCacheKey(e.query,e.callback,Jt({optimistic:n,id:i,variables:o}))}}}),new Set([this.data.group,this.optimisticData.group]).forEach((function(e){return e.resetCaching()}))},t.prototype.restore=function(e){return this.init(),e&&this.data.replace(e),this},t.prototype.extract=function(e){return void 0===e&&(e=!1),(e?this.optimisticData:this.data).extract()},t.prototype.read=function(e){var t=e.returnPartialData,r=void 0!==t&&t;try{return this.storeReader.diffQueryAgainstStore((0,n.__assign)((0,n.__assign)({},e),{store:e.optimistic?this.optimisticData:this.data,config:this.config,returnPartialData:r})).result||null}catch(e){if(e instanceof kn)return null;throw e}},t.prototype.write=function(e){try{return++this.txCount,this.storeWriter.writeToStore(this.data,e)}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}},t.prototype.modify=function(e){if(Nn.call(e,"id")&&!e.id)return!1;var t=e.optimistic?this.optimisticData:this.data;try{return++this.txCount,t.modify(e.id||"ROOT_QUERY",e.fields)}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}},t.prototype.diff=function(e){return this.storeReader.diffQueryAgainstStore((0,n.__assign)((0,n.__assign)({},e),{store:e.optimistic?this.optimisticData:this.data,rootId:e.id||"ROOT_QUERY",config:this.config}))},t.prototype.watch=function(e){var t,r=this;return this.watches.size||yn(t=this).vars.forEach((function(e){return e.attachCache(t)})),this.watches.add(e),e.immediate&&this.maybeBroadcastWatch(e),function(){r.watches.delete(e)&&!r.watches.size&&vn(r),r.maybeBroadcastWatch.forget(e)}},t.prototype.gc=function(e){Jt.reset();var t=this.optimisticData.gc();return e&&!this.txCount&&(e.resetResultCache?this.resetResultCache(e.resetResultIdentities):e.resetResultIdentities&&this.storeReader.resetCanon()),t},t.prototype.retain=function(e,t){return(t?this.optimisticData:this.data).retain(e)},t.prototype.release=function(e,t){return(t?this.optimisticData:this.data).release(e)},t.prototype.identify=function(e){if(X(e))return e.__ref;try{return this.policies.identify(e)[0]}catch(e){__DEV__&&u.warn(e)}},t.prototype.evict=function(e){if(!e.id){if(Nn.call(e,"id"))return!1;e=(0,n.__assign)((0,n.__assign)({},e),{id:"ROOT_QUERY"})}try{return++this.txCount,this.optimisticData.evict(e,this.data)}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}},t.prototype.reset=function(e){var t=this;return this.init(),Jt.reset(),e&&e.discardWatches?(this.watches.forEach((function(e){return t.maybeBroadcastWatch.forget(e)})),this.watches.clear(),vn(this)):this.broadcastWatches(),Promise.resolve()},t.prototype.removeOptimistic=function(e){var t=this.optimisticData.removeLayer(e);t!==this.optimisticData&&(this.optimisticData=t,this.broadcastWatches())},t.prototype.batch=function(e){var t,r=this,i=e.update,o=e.optimistic,a=void 0===o||o,s=e.removeOptimistic,u=e.onWatchUpdated,c=function(e){var n=r,o=n.data,a=n.optimisticData;++r.txCount,e&&(r.data=r.optimisticData=e);try{return t=i(r)}finally{--r.txCount,r.data=o,r.optimisticData=a}},l=new Set;return u&&!this.txCount&&this.broadcastWatches((0,n.__assign)((0,n.__assign)({},e),{onWatchUpdated:function(e){return l.add(e),!1}})),"string"==typeof a?this.optimisticData=this.optimisticData.addLayer(a,c):!1===a?c(this.data):c(),"string"==typeof s&&(this.optimisticData=this.optimisticData.removeLayer(s)),u&&l.size?(this.broadcastWatches((0,n.__assign)((0,n.__assign)({},e),{onWatchUpdated:function(e,t){var r=u.call(this,e,t);return!1!==r&&l.delete(e),r}})),l.size&&l.forEach((function(e){return r.maybeBroadcastWatch.dirty(e)}))):this.broadcastWatches(e),t},t.prototype.performTransaction=function(e,t){return this.batch({update:e,optimistic:t||null!==t})},t.prototype.transformDocument=function(e){if(this.addTypename){var t=this.typenameDocumentCache.get(e);return t||(t=sr(e),this.typenameDocumentCache.set(e,t),this.typenameDocumentCache.set(t,t)),t}return e},t.prototype.transformForLink=function(e){var t=this.config.fragments;return t?t.transform(e):e},t.prototype.broadcastWatches=function(e){var t=this;this.txCount||this.watches.forEach((function(r){return t.maybeBroadcastWatch(r,e)}))},t.prototype.broadcastWatch=function(e,t){var r=e.lastDiff,n=this.diff(e);t&&(e.optimistic&&"string"==typeof t.optimistic&&(n.fromOptimisticTransaction=!0),t.onWatchUpdated&&!1===t.onWatchUpdated.call(this,e,n,r))||r&&jt(r.result,n.result)||e.callback(e.lastDiff=n,r)},t}(xn),xi=_e.empty,ki=_e.from,Mi=_e.split,Ni=_e.concat;function Di(e){var t=!1;return new Promise((function(r,n){e.subscribe({next:function(e){t?__DEV__&&u.warn("Promise Wrapper does not support multiple results from Observable"):(t=!0,r(e))},error:n})}))}function Ri(e){return new Y((function(t){e.then((function(e){t.next(e),t.complete()})).catch(t.error.bind(t))}))}function Ci(e,t){if(!Boolean(e))throw new Error(null!=t?t:"Unexpected invariant triggered.")}const Fi=/\r\n|[\n\r]/g;function $i(e,t){let r=0,n=1;for(const i of e.body.matchAll(Fi)){if("number"==typeof i.index||Ci(!1),i.index>=t)break;r=i.index+i[0].length,n+=1}return{line:n,column:t+1-r}}function qi(e,t){const r=e.locationOffset.column-1,n="".padStart(r)+e.body,i=t.line-1,o=e.locationOffset.line-1,a=t.line+o,s=1===t.line?r:0,u=t.column+s,c=`${e.name}:${a}:${u}\n`,l=n.split(/\r\n|[\n\r]/g),f=l[i];if(f.length>120){const e=Math.floor(u/80),t=u%80,r=[];for(let e=0;e<f.length;e+=80)r.push(f.slice(e,e+80));return c+Li([[`${a} |`,r[0]],...r.slice(1,e+1).map((e=>["|",e])),["|","^".padStart(t)],["|",r[e+1]]])}return c+Li([[a-1+" |",l[i-1]],[`${a} |`,f],["|","^".padStart(u)],[`${a+1} |`,l[i+1]]])}function Li(e){const t=e.filter((([e,t])=>void 0!==t)),r=Math.max(...t.map((([e])=>e.length)));return t.map((([e,t])=>e.padStart(r)+(t?" "+t:""))).join("\n")}class Vi extends Error{constructor(e,...t){var r,n,i;const{nodes:o,source:a,positions:s,path:u,originalError:c,extensions:l}=function(e){const 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!=u?u:void 0,this.originalError=null!=c?c:void 0,this.nodes=Ui(Array.isArray(o)?o:o?[o]:void 0);const f=Ui(null===(r=this.nodes)||void 0===r?void 0:r.map((e=>e.loc)).filter((e=>null!=e)));this.source=null!=a?a:null==f||null===(n=f[0])||void 0===n?void 0:n.source,this.positions=null!=s?s:null==f?void 0:f.map((e=>e.start)),this.locations=s&&a?s.map((e=>$i(a,e))):null==f?void 0:f.map((e=>$i(e.source,e.start)));const d="object"==typeof(p=null==c?void 0:c.extensions)&&null!==p?null==c?void 0:c.extensions:void 0;var p;this.extensions=null!==(i=null!=l?l:d)&&void 0!==i?i: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!=c&&c.stack?Object.defineProperty(this,"stack",{value:c.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,Vi):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(const r of this.nodes)r.loc&&(e+="\n\n"+qi((t=r.loc).source,$i(t.source,t.start)));else if(this.source&&this.locations)for(const t of this.locations)e+="\n\n"+qi(this.source,t);var t;return e}toJSON(){const 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 Ui(e){return void 0===e||0===e.length?void 0:e}function Qi(e,t,r){return new Vi(`Syntax Error: ${r}`,{source:e,positions:[t]})}var zi,Bi,Wi;!function(e){e.QUERY="QUERY",e.MUTATION="MUTATION",e.SUBSCRIPTION="SUBSCRIPTION",e.FIELD="FIELD",e.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",e.FRAGMENT_SPREAD="FRAGMENT_SPREAD",e.INLINE_FRAGMENT="INLINE_FRAGMENT",e.VARIABLE_DEFINITION="VARIABLE_DEFINITION",e.SCHEMA="SCHEMA",e.SCALAR="SCALAR",e.OBJECT="OBJECT",e.FIELD_DEFINITION="FIELD_DEFINITION",e.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",e.INTERFACE="INTERFACE",e.UNION="UNION",e.ENUM="ENUM",e.ENUM_VALUE="ENUM_VALUE",e.INPUT_OBJECT="INPUT_OBJECT",e.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION"}(zi||(zi={})),(Wi=Bi||(Bi={})).SOF="<SOF>",Wi.EOF="<EOF>",Wi.BANG="!",Wi.DOLLAR="$",Wi.AMP="&",Wi.PAREN_L="(",Wi.PAREN_R=")",Wi.SPREAD="...",Wi.COLON=":",Wi.EQUALS="=",Wi.AT="@",Wi.BRACKET_L="[",Wi.BRACKET_R="]",Wi.BRACE_L="{",Wi.PIPE="|",Wi.BRACE_R="}",Wi.NAME="Name",Wi.INT="Int",Wi.FLOAT="Float",Wi.STRING="String",Wi.BLOCK_STRING="BlockString",Wi.COMMENT="Comment";class Yi{constructor(e){const t=new Se(Bi.SOF,0,0,0,0);this.source=e,this.lastToken=t,this.token=t,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let e=this.token;if(e.kind!==Bi.EOF)do{if(e.next)e=e.next;else{const t=eo(this,e.end);e.next=t,t.prev=e,e=t}}while(e.kind===Bi.COMMENT);return e}}function Ki(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function Hi(e,t){return Gi(e.charCodeAt(t))&&Ji(e.charCodeAt(t+1))}function Gi(e){return e>=55296&&e<=56319}function Ji(e){return e>=56320&&e<=57343}function Zi(e,t){const r=e.source.body.codePointAt(t);if(void 0===r)return Bi.EOF;if(r>=32&&r<=126){const e=String.fromCodePoint(r);return'"'===e?"'\"'":`"${e}"`}return"U+"+r.toString(16).toUpperCase().padStart(4,"0")}function Xi(e,t,r,n,i){const o=e.line,a=1+r-e.lineStart;return new Se(t,r,n,o,a,i)}function eo(e,t){const r=e.source.body,n=r.length;let i=t;for(;i<n;){const t=r.charCodeAt(i);switch(t){case 65279:case 9:case 32:case 44:++i;continue;case 10:++i,++e.line,e.lineStart=i;continue;case 13:10===r.charCodeAt(i+1)?i+=2:++i,++e.line,e.lineStart=i;continue;case 35:return to(e,i);case 33:return Xi(e,Bi.BANG,i,i+1);case 36:return Xi(e,Bi.DOLLAR,i,i+1);case 38:return Xi(e,Bi.AMP,i,i+1);case 40:return Xi(e,Bi.PAREN_L,i,i+1);case 41:return Xi(e,Bi.PAREN_R,i,i+1);case 46:if(46===r.charCodeAt(i+1)&&46===r.charCodeAt(i+2))return Xi(e,Bi.SPREAD,i,i+3);break;case 58:return Xi(e,Bi.COLON,i,i+1);case 61:return Xi(e,Bi.EQUALS,i,i+1);case 64:return Xi(e,Bi.AT,i,i+1);case 91:return Xi(e,Bi.BRACKET_L,i,i+1);case 93:return Xi(e,Bi.BRACKET_R,i,i+1);case 123:return Xi(e,Bi.BRACE_L,i,i+1);case 124:return Xi(e,Bi.PIPE,i,i+1);case 125:return Xi(e,Bi.BRACE_R,i,i+1);case 34:return 34===r.charCodeAt(i+1)&&34===r.charCodeAt(i+2)?lo(e,i):io(e,i)}if(Ze(t)||45===t)return ro(e,i,t);if(et(t))return fo(e,i);throw Qi(e.source,i,39===t?"Unexpected single quote character ('), did you mean to use a double quote (\")?":Ki(t)||Hi(r,i)?`Unexpected character: ${Zi(e,i)}.`:`Invalid character: ${Zi(e,i)}.`)}return Xi(e,Bi.EOF,n,n)}function to(e,t){const r=e.source.body,n=r.length;let i=t+1;for(;i<n;){const e=r.charCodeAt(i);if(10===e||13===e)break;if(Ki(e))++i;else{if(!Hi(r,i))break;i+=2}}return Xi(e,Bi.COMMENT,t,i,r.slice(t+1,i))}function ro(e,t,r){const n=e.source.body;let i=t,o=r,a=!1;if(45===o&&(o=n.charCodeAt(++i)),48===o){if(o=n.charCodeAt(++i),Ze(o))throw Qi(e.source,i,`Invalid number, unexpected digit after 0: ${Zi(e,i)}.`)}else i=no(e,i,o),o=n.charCodeAt(i);if(46===o&&(a=!0,o=n.charCodeAt(++i),i=no(e,i,o),o=n.charCodeAt(i)),69!==o&&101!==o||(a=!0,o=n.charCodeAt(++i),43!==o&&45!==o||(o=n.charCodeAt(++i)),i=no(e,i,o),o=n.charCodeAt(i)),46===o||et(o))throw Qi(e.source,i,`Invalid number, expected digit but got: ${Zi(e,i)}.`);return Xi(e,a?Bi.FLOAT:Bi.INT,t,i,n.slice(t,i))}function no(e,t,r){if(!Ze(r))throw Qi(e.source,t,`Invalid number, expected digit but got: ${Zi(e,t)}.`);const n=e.source.body;let i=t+1;for(;Ze(n.charCodeAt(i));)++i;return i}function io(e,t){const r=e.source.body,n=r.length;let i=t+1,o=i,a="";for(;i<n;){const n=r.charCodeAt(i);if(34===n)return a+=r.slice(o,i),Xi(e,Bi.STRING,t,i+1,a);if(92!==n){if(10===n||13===n)break;if(Ki(n))++i;else{if(!Hi(r,i))throw Qi(e.source,i,`Invalid character within String: ${Zi(e,i)}.`);i+=2}}else{a+=r.slice(o,i);const t=117===r.charCodeAt(i+1)?123===r.charCodeAt(i+2)?oo(e,i):ao(e,i):co(e,i);a+=t.value,i+=t.size,o=i}}throw Qi(e.source,i,"Unterminated string.")}function oo(e,t){const r=e.source.body;let n=0,i=3;for(;i<12;){const e=r.charCodeAt(t+i++);if(125===e){if(i<5||!Ki(n))break;return{value:String.fromCodePoint(n),size:i}}if(n=n<<4|uo(e),n<0)break}throw Qi(e.source,t,`Invalid Unicode escape sequence: "${r.slice(t,t+i)}".`)}function ao(e,t){const r=e.source.body,n=so(r,t+2);if(Ki(n))return{value:String.fromCodePoint(n),size:6};if(Gi(n)&&92===r.charCodeAt(t+6)&&117===r.charCodeAt(t+7)){const e=so(r,t+8);if(Ji(e))return{value:String.fromCodePoint(n,e),size:12}}throw Qi(e.source,t,`Invalid Unicode escape sequence: "${r.slice(t,t+6)}".`)}function so(e,t){return uo(e.charCodeAt(t))<<12|uo(e.charCodeAt(t+1))<<8|uo(e.charCodeAt(t+2))<<4|uo(e.charCodeAt(t+3))}function uo(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function co(e,t){const r=e.source.body;switch(r.charCodeAt(t+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:"\n",size:2};case 114:return{value:"\r",size:2};case 116:return{value:"\t",size:2}}throw Qi(e.source,t,`Invalid character escape sequence: "${r.slice(t,t+2)}".`)}function lo(e,t){const r=e.source.body,n=r.length;let i=e.lineStart,o=t+3,a=o,s="";const u=[];for(;o<n;){const n=r.charCodeAt(o);if(34===n&&34===r.charCodeAt(o+1)&&34===r.charCodeAt(o+2)){s+=r.slice(a,o),u.push(s);const n=Xi(e,Bi.BLOCK_STRING,t,o+3,tt(u).join("\n"));return e.line+=u.length-1,e.lineStart=i,n}if(92!==n||34!==r.charCodeAt(o+1)||34!==r.charCodeAt(o+2)||34!==r.charCodeAt(o+3))if(10!==n&&13!==n)if(Ki(n))++o;else{if(!Hi(r,o))throw Qi(e.source,o,`Invalid character within String: ${Zi(e,o)}.`);o+=2}else s+=r.slice(a,o),u.push(s),13===n&&10===r.charCodeAt(o+1)?o+=2:++o,s="",a=o,i=o;else s+=r.slice(a,o),a=o+1,o+=4}throw Qi(e.source,o,"Unterminated string.")}function fo(e,t){const r=e.source.body,n=r.length;let i=t+1;for(;i<n&&(Xe(o=r.charCodeAt(i))||Ze(o)||95===o);)++i;var o;return Xi(e,Bi.NAME,t,i,r.slice(t,i))}class po{constructor(e,t={}){const r=function(e){return e instanceof P}(e)?e:new P(e);this._lexer=new Yi(r),this._options=t,this._tokenCounter=0}parseName(){const e=this.expectToken(Bi.NAME);return this.node(e,{kind:je.NAME,value:e.value})}parseDocument(){return this.node(this._lexer.token,{kind:je.DOCUMENT,definitions:this.many(Bi.SOF,this.parseDefinition,Bi.EOF)})}parseDefinition(){if(this.peek(Bi.BRACE_L))return this.parseOperationDefinition();const e=this.peekDescription(),t=e?this._lexer.lookahead():this._lexer.token;if(t.kind===Bi.NAME){switch(t.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}if(e)throw Qi(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(t.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(t)}parseOperationDefinition(){const e=this._lexer.token;if(this.peek(Bi.BRACE_L))return this.node(e,{kind:je.OPERATION_DEFINITION,operation:Te.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});const t=this.parseOperationType();let r;return this.peek(Bi.NAME)&&(r=this.parseName()),this.node(e,{kind:je.OPERATION_DEFINITION,operation:t,name:r,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const e=this.expectToken(Bi.NAME);switch(e.value){case"query":return Te.QUERY;case"mutation":return Te.MUTATION;case"subscription":return Te.SUBSCRIPTION}throw this.unexpected(e)}parseVariableDefinitions(){return this.optionalMany(Bi.PAREN_L,this.parseVariableDefinition,Bi.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:je.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(Bi.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(Bi.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const e=this._lexer.token;return this.expectToken(Bi.DOLLAR),this.node(e,{kind:je.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:je.SELECTION_SET,selections:this.many(Bi.BRACE_L,this.parseSelection,Bi.BRACE_R)})}parseSelection(){return this.peek(Bi.SPREAD)?this.parseFragment():this.parseField()}parseField(){const e=this._lexer.token,t=this.parseName();let r,n;return this.expectOptionalToken(Bi.COLON)?(r=t,n=this.parseName()):n=t,this.node(e,{kind:je.FIELD,alias:r,name:n,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(Bi.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(e){const t=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(Bi.PAREN_L,t,Bi.PAREN_R)}parseArgument(e=!1){const t=this._lexer.token,r=this.parseName();return this.expectToken(Bi.COLON),this.node(t,{kind:je.ARGUMENT,name:r,value:this.parseValueLiteral(e)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){const e=this._lexer.token;this.expectToken(Bi.SPREAD);const t=this.expectOptionalKeyword("on");return!t&&this.peek(Bi.NAME)?this.node(e,{kind:je.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(e,{kind:je.INLINE_FRAGMENT,typeCondition:t?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){const e=this._lexer.token;return this.expectKeyword("fragment"),!0===this._options.allowLegacyFragmentVariables?this.node(e,{kind:je.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(e,{kind:je.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if("on"===this._lexer.token.value)throw this.unexpected();return this.parseName()}parseValueLiteral(e){const t=this._lexer.token;switch(t.kind){case Bi.BRACKET_L:return this.parseList(e);case Bi.BRACE_L:return this.parseObject(e);case Bi.INT:return this.advanceLexer(),this.node(t,{kind:je.INT,value:t.value});case Bi.FLOAT:return this.advanceLexer(),this.node(t,{kind:je.FLOAT,value:t.value});case Bi.STRING:case Bi.BLOCK_STRING:return this.parseStringLiteral();case Bi.NAME:switch(this.advanceLexer(),t.value){case"true":return this.node(t,{kind:je.BOOLEAN,value:!0});case"false":return this.node(t,{kind:je.BOOLEAN,value:!1});case"null":return this.node(t,{kind:je.NULL});default:return this.node(t,{kind:je.ENUM,value:t.value})}case Bi.DOLLAR:if(e){if(this.expectToken(Bi.DOLLAR),this._lexer.token.kind===Bi.NAME){const e=this._lexer.token.value;throw Qi(this._lexer.source,t.start,`Unexpected variable "$${e}" in constant value.`)}throw this.unexpected(t)}return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){const e=this._lexer.token;return this.advanceLexer(),this.node(e,{kind:je.STRING,value:e.value,block:e.kind===Bi.BLOCK_STRING})}parseList(e){return this.node(this._lexer.token,{kind:je.LIST,values:this.any(Bi.BRACKET_L,(()=>this.parseValueLiteral(e)),Bi.BRACKET_R)})}parseObject(e){return this.node(this._lexer.token,{kind:je.OBJECT,fields:this.any(Bi.BRACE_L,(()=>this.parseObjectField(e)),Bi.BRACE_R)})}parseObjectField(e){const t=this._lexer.token,r=this.parseName();return this.expectToken(Bi.COLON),this.node(t,{kind:je.OBJECT_FIELD,name:r,value:this.parseValueLiteral(e)})}parseDirectives(e){const t=[];for(;this.peek(Bi.AT);)t.push(this.parseDirective(e));return t}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(e){const t=this._lexer.token;return this.expectToken(Bi.AT),this.node(t,{kind:je.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e)})}parseTypeReference(){const e=this._lexer.token;let t;if(this.expectOptionalToken(Bi.BRACKET_L)){const r=this.parseTypeReference();this.expectToken(Bi.BRACKET_R),t=this.node(e,{kind:je.LIST_TYPE,type:r})}else t=this.parseNamedType();return this.expectOptionalToken(Bi.BANG)?this.node(e,{kind:je.NON_NULL_TYPE,type:t}):t}parseNamedType(){return this.node(this._lexer.token,{kind:je.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(Bi.STRING)||this.peek(Bi.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("schema");const r=this.parseConstDirectives(),n=this.many(Bi.BRACE_L,this.parseOperationTypeDefinition,Bi.BRACE_R);return this.node(e,{kind:je.SCHEMA_DEFINITION,description:t,directives:r,operationTypes:n})}parseOperationTypeDefinition(){const e=this._lexer.token,t=this.parseOperationType();this.expectToken(Bi.COLON);const r=this.parseNamedType();return this.node(e,{kind:je.OPERATION_TYPE_DEFINITION,operation:t,type:r})}parseScalarTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("scalar");const r=this.parseName(),n=this.parseConstDirectives();return this.node(e,{kind:je.SCALAR_TYPE_DEFINITION,description:t,name:r,directives:n})}parseObjectTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("type");const r=this.parseName(),n=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(e,{kind:je.OBJECT_TYPE_DEFINITION,description:t,name:r,interfaces:n,directives:i,fields:o})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(Bi.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(Bi.BRACE_L,this.parseFieldDefinition,Bi.BRACE_R)}parseFieldDefinition(){const e=this._lexer.token,t=this.parseDescription(),r=this.parseName(),n=this.parseArgumentDefs();this.expectToken(Bi.COLON);const i=this.parseTypeReference(),o=this.parseConstDirectives();return this.node(e,{kind:je.FIELD_DEFINITION,description:t,name:r,arguments:n,type:i,directives:o})}parseArgumentDefs(){return this.optionalMany(Bi.PAREN_L,this.parseInputValueDef,Bi.PAREN_R)}parseInputValueDef(){const e=this._lexer.token,t=this.parseDescription(),r=this.parseName();this.expectToken(Bi.COLON);const n=this.parseTypeReference();let i;this.expectOptionalToken(Bi.EQUALS)&&(i=this.parseConstValueLiteral());const o=this.parseConstDirectives();return this.node(e,{kind:je.INPUT_VALUE_DEFINITION,description:t,name:r,type:n,defaultValue:i,directives:o})}parseInterfaceTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("interface");const r=this.parseName(),n=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(e,{kind:je.INTERFACE_TYPE_DEFINITION,description:t,name:r,interfaces:n,directives:i,fields:o})}parseUnionTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("union");const r=this.parseName(),n=this.parseConstDirectives(),i=this.parseUnionMemberTypes();return this.node(e,{kind:je.UNION_TYPE_DEFINITION,description:t,name:r,directives:n,types:i})}parseUnionMemberTypes(){return this.expectOptionalToken(Bi.EQUALS)?this.delimitedMany(Bi.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("enum");const r=this.parseName(),n=this.parseConstDirectives(),i=this.parseEnumValuesDefinition();return this.node(e,{kind:je.ENUM_TYPE_DEFINITION,description:t,name:r,directives:n,values:i})}parseEnumValuesDefinition(){return this.optionalMany(Bi.BRACE_L,this.parseEnumValueDefinition,Bi.BRACE_R)}parseEnumValueDefinition(){const e=this._lexer.token,t=this.parseDescription(),r=this.parseEnumValueName(),n=this.parseConstDirectives();return this.node(e,{kind:je.ENUM_VALUE_DEFINITION,description:t,name:r,directives:n})}parseEnumValueName(){if("true"===this._lexer.token.value||"false"===this._lexer.token.value||"null"===this._lexer.token.value)throw Qi(this._lexer.source,this._lexer.token.start,`${ho(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("input");const r=this.parseName(),n=this.parseConstDirectives(),i=this.parseInputFieldsDefinition();return this.node(e,{kind:je.INPUT_OBJECT_TYPE_DEFINITION,description:t,name:r,directives:n,fields:i})}parseInputFieldsDefinition(){return this.optionalMany(Bi.BRACE_L,this.parseInputValueDef,Bi.BRACE_R)}parseTypeSystemExtension(){const e=this._lexer.lookahead();if(e.kind===Bi.NAME)switch(e.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(e)}parseSchemaExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");const t=this.parseConstDirectives(),r=this.optionalMany(Bi.BRACE_L,this.parseOperationTypeDefinition,Bi.BRACE_R);if(0===t.length&&0===r.length)throw this.unexpected();return this.node(e,{kind:je.SCHEMA_EXTENSION,directives:t,operationTypes:r})}parseScalarTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");const t=this.parseName(),r=this.parseConstDirectives();if(0===r.length)throw this.unexpected();return this.node(e,{kind:je.SCALAR_TYPE_EXTENSION,name:t,directives:r})}parseObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");const t=this.parseName(),r=this.parseImplementsInterfaces(),n=this.parseConstDirectives(),i=this.parseFieldsDefinition();if(0===r.length&&0===n.length&&0===i.length)throw this.unexpected();return this.node(e,{kind:je.OBJECT_TYPE_EXTENSION,name:t,interfaces:r,directives:n,fields:i})}parseInterfaceTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const t=this.parseName(),r=this.parseImplementsInterfaces(),n=this.parseConstDirectives(),i=this.parseFieldsDefinition();if(0===r.length&&0===n.length&&0===i.length)throw this.unexpected();return this.node(e,{kind:je.INTERFACE_TYPE_EXTENSION,name:t,interfaces:r,directives:n,fields:i})}parseUnionTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const t=this.parseName(),r=this.parseConstDirectives(),n=this.parseUnionMemberTypes();if(0===r.length&&0===n.length)throw this.unexpected();return this.node(e,{kind:je.UNION_TYPE_EXTENSION,name:t,directives:r,types:n})}parseEnumTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const t=this.parseName(),r=this.parseConstDirectives(),n=this.parseEnumValuesDefinition();if(0===r.length&&0===n.length)throw this.unexpected();return this.node(e,{kind:je.ENUM_TYPE_EXTENSION,name:t,directives:r,values:n})}parseInputObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const t=this.parseName(),r=this.parseConstDirectives(),n=this.parseInputFieldsDefinition();if(0===r.length&&0===n.length)throw this.unexpected();return this.node(e,{kind:je.INPUT_OBJECT_TYPE_EXTENSION,name:t,directives:r,fields:n})}parseDirectiveDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("directive"),this.expectToken(Bi.AT);const r=this.parseName(),n=this.parseArgumentDefs(),i=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const o=this.parseDirectiveLocations();return this.node(e,{kind:je.DIRECTIVE_DEFINITION,description:t,name:r,arguments:n,repeatable:i,locations:o})}parseDirectiveLocations(){return this.delimitedMany(Bi.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){const e=this._lexer.token,t=this.parseName();if(Object.prototype.hasOwnProperty.call(zi,t.value))return t;throw this.unexpected(e)}node(e,t){return!0!==this._options.noLocation&&(t.loc=new we(e,this._lexer.lastToken,this._lexer.source)),t}peek(e){return this._lexer.token.kind===e}expectToken(e){const t=this._lexer.token;if(t.kind===e)return this.advanceLexer(),t;throw Qi(this._lexer.source,t.start,`Expected ${yo(e)}, found ${ho(t)}.`)}expectOptionalToken(e){return this._lexer.token.kind===e&&(this.advanceLexer(),!0)}expectKeyword(e){const t=this._lexer.token;if(t.kind!==Bi.NAME||t.value!==e)throw Qi(this._lexer.source,t.start,`Expected "${e}", found ${ho(t)}.`);this.advanceLexer()}expectOptionalKeyword(e){const t=this._lexer.token;return t.kind===Bi.NAME&&t.value===e&&(this.advanceLexer(),!0)}unexpected(e){const t=null!=e?e:this._lexer.token;return Qi(this._lexer.source,t.start,`Unexpected ${ho(t)}.`)}any(e,t,r){this.expectToken(e);const n=[];for(;!this.expectOptionalToken(r);)n.push(t.call(this));return n}optionalMany(e,t,r){if(this.expectOptionalToken(e)){const e=[];do{e.push(t.call(this))}while(!this.expectOptionalToken(r));return e}return[]}many(e,t,r){this.expectToken(e);const n=[];do{n.push(t.call(this))}while(!this.expectOptionalToken(r));return n}delimitedMany(e,t){this.expectOptionalToken(e);const r=[];do{r.push(t.call(this))}while(this.expectOptionalToken(e));return r}advanceLexer(){const{maxTokens:e}=this._options,t=this._lexer.advance();if(void 0!==e&&t.kind!==Bi.EOF&&(++this._tokenCounter,this._tokenCounter>e))throw Qi(this._lexer.source,t.start,`Document contains more that ${e} tokens. Parsing aborted.`)}}function ho(e){const t=e.value;return yo(e.kind)+(null!=t?` "${t}"`:"")}function yo(e){return function(e){return e===Bi.BANG||e===Bi.DOLLAR||e===Bi.AMP||e===Bi.PAREN_L||e===Bi.PAREN_R||e===Bi.SPREAD||e===Bi.COLON||e===Bi.EQUALS||e===Bi.AT||e===Bi.BRACKET_L||e===Bi.BRACKET_R||e===Bi.BRACE_L||e===Bi.PIPE||e===Bi.BRACE_R}(e)?`"${e}"`:e}var vo=new Map,mo=new Map,bo=!0,go=!1;function _o(e){return e.replace(/[\s,]+/g," ").trim()}function Oo(e){var t,r,i,o=_o(e);if(!vo.has(o)){var a=function(e,t){return new po(e,t).parseDocument()}(e,{experimentalFragmentVariables:go,allowLegacyFragmentVariables:go});if(!a||"Document"!==a.kind)throw new Error("Not a valid GraphQL document.");vo.set(o,function(e){var t=new Set(e.definitions);t.forEach((function(e){e.loc&&delete e.loc,Object.keys(e).forEach((function(r){var n=e[r];n&&"object"==typeof n&&t.add(n)}))}));var r=e.loc;return r&&(delete r.startToken,delete r.endToken),e}((t=a,r=new Set,i=[],t.definitions.forEach((function(e){if("FragmentDefinition"===e.kind){var t=e.name.value,n=_o((a=e.loc).source.body.substring(a.start,a.end)),o=mo.get(t);o&&!o.has(n)?bo&&console.warn("Warning: fragment with name "+t+" 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"):o||mo.set(t,o=new Set),o.add(n),r.has(n)||(r.add(n),i.push(e))}else i.push(e);var a})),(0,n.__assign)((0,n.__assign)({},t),{definitions:i}))))}return vo.get(o)}function wo(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];"string"==typeof e&&(e=[e]);var n=e[0];return t.forEach((function(t,r){t&&"Document"===t.kind?n+=t.loc.source.body:n+=t,n+=e[r+1]})),Oo(n)}function So(){vo.clear(),mo.clear()}function Eo(){bo=!1}function Io(){go=!0}function Po(){go=!1}var To,jo=wo,Ao=So,xo=Eo,ko=Io,Mo=Po;(To=wo||(wo={})).gql=jo,To.resetCaches=Ao,To.disableFragmentWarnings=xo,To.enableExperimentalFragmentVariables=ko,To.disableExperimentalFragmentVariables=Mo,wo.default=wo,d(m?"log":"silent")},1143:e=>{"use strict";e.exports=JSON.parse('{"$id":"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#","description":"Meta-schema for $data reference (JSON AnySchema extension proposal)","type":"object","required":["$data"],"properties":{"$data":{"type":"string","anyOf":[{"format":"relative-json-pointer"},{"format":"json-pointer"}]}},"additionalProperties":false}')},1512:e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"http://json-schema.org/draft-07/schema#","title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"$comment":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"default":true,"readOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#"},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":true},"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#"},"maxProperties":{"$ref":"#/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"$ref":"#"},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"propertyNames":{"format":"regex"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"propertyNames":{"$ref":"#"},"const":true,"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"contentMediaType":{"type":"string"},"contentEncoding":{"type":"string"},"if":{"$ref":"#"},"then":{"$ref":"#"},"else":{"$ref":"#"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"default":true}')}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var o=t[n]={id:n,loaded:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.loaded=!0,o.exports}r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var n={};(()=>{"use strict";var e=n;Object.defineProperty(e,"__esModule",{value:!0}),e.GraphQLClient=e.Squid=e.QueryBuilder=e.Changes=e.JoinQueryBuilder=e.DocumentReference=e.CollectionReference=void 0;var t=r(5660);Object.defineProperty(e,"CollectionReference",{enumerable:!0,get:function(){return t.CollectionReference}});var i=r(4516);Object.defineProperty(e,"DocumentReference",{enumerable:!0,get:function(){return i.DocumentReference}});var o=r(9732);Object.defineProperty(e,"JoinQueryBuilder",{enumerable:!0,get:function(){return o.JoinQueryBuilder}});var a=r(6891);Object.defineProperty(e,"Changes",{enumerable:!0,get:function(){return a.Changes}}),Object.defineProperty(e,"QueryBuilder",{enumerable:!0,get:function(){return a.QueryBuilder}});var s=r(5395);Object.defineProperty(e,"Squid",{enumerable:!0,get:function(){return s.Squid}});var u=r(5857);Object.defineProperty(e,"GraphQLClient",{enumerable:!0,get:function(){return u.GraphQLClient}})})();var i=exports;for(var o in n)i[o]=n[o];n.__esModule&&Object.defineProperty(i,"__esModule",{value:!0})})();
12
+ `})).data}}},7718:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MutationSender=void 0;const n=r(575);t.MutationSender=class{constructor(e,t,r){this.rpcManager=e,this.lockManager=t,this.querySubscriptionManager=r}async sendMutations(e,t){const r=(0,n.reduceMutations)(e),i=r.map((e=>`sendMutation_${(0,n.getSquidDocId)(e.squidDocIdObj)}`));await this.lockManager.lock(...i),await this.querySubscriptionManager.waitForAllQueriesToFinish();try{const e={mutations:r,integrationId:t};return await this.rpcManager.post("mutation/mutate",e)}finally{this.lockManager.release(...i)}}}},9194:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NamedQueryManager=void 0;const n=r(575),i=r(2937),o=r(9978);t.NamedQueryManager=class{constructor(e,t){this.rpcManager=e,this.socketManager=t,this.ongoingNamedQueryExecutions={},t.observeNotifications().pipe((0,i.filter)((e=>"namedQuery"===e.type)),(0,o.map)((e=>e))).subscribe((e=>{this.handleNamedQueryResponse(e.clientRequestId,e.payload)}))}executeNamedQueryAndSubscribe(e,t,r){const o=(0,n.generateId)(),a=new i.Subject;this.ongoingNamedQueryExecutions[o]=a;const s={integrationId:e,queryName:t,paramsRecordStr:(0,n.serializeObj)(r),clientRequestId:o};return this.rpcManager.post("named-query/execute",s).catch((r=>{console.error("Got error while executing named query",t,"for integration",e,r),a.error(r),a.complete()})),a.pipe((0,i.finalize)((()=>{delete this.ongoingNamedQueryExecutions[o]})),(0,i.share)())}handleNamedQueryResponse(e,t){const r=this.ongoingNamedQueryExecutions[e];if(!r)return;const i=(0,n.deserializeObj)(t);i.success?r.next(i.result):(r.error(new Error(i.result)),r.complete())}}},9732:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.JoinQueryBuilder=t.JoinQueryBuilderFactory=void 0;const n=r(9312),i=r(575),o=n.__importStar(r(8784)),a=r(2937),s=r(9978);t.JoinQueryBuilderFactory=class{constructor(e,t,r){this.querySubscriptionManager=e,this.documentReferenceFactory=t,this.queryBuilderFactory=r}getForJoin(e,t,r){return new u(e,t,this.querySubscriptionManager,this.documentReferenceFactory,r,this,this.queryBuilderFactory)}};class u extends i.BaseQueryBuilderInterface{constructor(e,t,r,n,o,a,s){super(),this.collectionName=e,this.integrationId=t,this.querySubscriptionManager=r,this.documentReferenceFactory=n,this.alias=o,this.joinQueryBuilderFactory=a,this.queryBuilderFactory=s,this.joins={},this.joinConditions={},this.simpleQueryBuilder=new i.SimpleQueryBuilder(e,t)}where(e,t,r){return this.simpleQueryBuilder.where(e,t,r),this}limit(e){return this.simpleQueryBuilder.limit(e),this}sortBy(e,t=!0){return this.simpleQueryBuilder.sortBy(e,t),this}join(e,t,r){const n={leftFieldName:t,rightFieldName:r,leftAlias:this.alias};this.joins[e.alias]=e.build(),Object.entries(e.joins).forEach((([e,t])=>{this.joins[e]=t}));for(const[t,r]of Object.entries(e.joinConditions))this.joinConditions[t]=r;return this.joinConditions[e.alias]=n,this}snapshot(){return(0,a.firstValueFrom)(this.snapshots(!1))}snapshots(e=!0){return this.querySubscriptionManager.processQuery(this.build(),this.alias,o.cloneDeep(this.joins),o.cloneDeep(this.joinConditions),e,!1).pipe((0,s.map)((e=>e.map((e=>{const t={};for(const[r,n]of Object.entries(e)){const e=r===this.alias?this.collectionName:this.joins[r].collectionName,o=r===this.alias?this.integrationId:this.joins[r].integrationId,a=n?(0,i.getSquidDocId)(n.__docId__,e,o):void 0;t[r]=a?this.documentReferenceFactory.create(a,this.queryBuilderFactory):void 0}return t})))))}build(){return this.simpleQueryBuilder.build()}}t.JoinQueryBuilder=u},6891:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Changes=t.QueryBuilder=t.QueryBuilderFactory=void 0;const n=r(575),i=r(2937),o=r(9978);t.QueryBuilderFactory=class{constructor(e,t,r){this.querySubscriptionManager=e,this.documentReferenceFactory=t,this.documentIdentityService=r}getForDocument(e){const{collectionName:t,integrationId:r,docId:i}=(0,n.parseSquidDocId)(e),o=(0,n.deserializeObj)(i),a=this.get(t,r);return Object.entries(o).forEach((([e,t])=>{a.where(e,"==",t)})),a}get(e,t){return new a(e,t,this.querySubscriptionManager,this.documentReferenceFactory,this,this.documentIdentityService)}};class a extends n.SimpleQueryBuilder{constructor(e,t,r,n,i,o){super(e,t),this.querySubscriptionManager=r,this.documentReferenceFactory=n,this.queryBuilderFactory=i,this.documentIdentityService=o,this.forceFetchFromServer=!1}getSortOrder(){return this.query.sortOrder}snapshot(){return(0,i.firstValueFrom)(this.snapshots(!1))}setForceFetchFromServer(){return this.forceFetchFromServer=!0,this}snapshots(e=!0){return this.querySubscriptionManager.processQuery(this.build(),this.collectionName,{},{},e,this.forceFetchFromServer).pipe((0,o.map)((e=>e.map((e=>{(0,n.assertTruthy)(1===Object.keys(e).length);const t=e[this.collectionName],r=(0,n.getSquidDocId)((0,n.truthy)(t).__docId__,this.collectionName,this.integrationId);return this.documentReferenceFactory.create(r,this.queryBuilderFactory)})))))}changes(){let e,t=new Set;return this.snapshots().pipe((0,i.combineLatestWith)(this.documentIdentityService.observeChanges().pipe((0,i.switchMap)((t=>(Object.entries(t).forEach((([t,r])=>{(0,n.replaceKeyInRecord)(e||{},t,r)})),i.NEVER))),(0,i.startWith)({}))),(0,o.map)((([r])=>{let n=[];const i=[],o=[];if(e){for(const o of r){const r=o.squidDocId,a=o.data;if(t.has(a))delete e[r],t.delete(a);else if(e[r]){i.push(o);const n=e[r];delete e[r],t.delete(n)}else n.push(o)}for(const e of t)o.push(e)}else n=r;e={},t=new Set;for(const n of r){const r=n.data;e[n.squidDocId]=r,t.add(r)}return new s(n,i,o)})))}get hash(){return(0,n.encodeValueForMapping)(this.build())}}t.QueryBuilder=a;class s{constructor(e,t,r){this.inserts=e,this.updates=t,this.deletes=r}}t.Changes=s},4661:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.QuerySubscriptionManager=void 0;const n=r(9312),i=r(575),o=n.__importStar(r(8784)),a=r(2937),s=r(9978),u=r(1122),c="client";t.QuerySubscriptionManager=class{constructor(e,t,r,n,i){this.rpcManager=e,this.clientIdService=t,this.documentStore=r,this.destructManager=n,this.documentIdentityService=i,this.safeToSendQueriesToServer=new a.BehaviorSubject(!0),this.onOrphanDocuments=new a.Subject,this.ongoingQueries=new Map,this.inflightQueriesCount=new a.BehaviorSubject(0),this.clientRequestIdToLocalDocuments=new Map,this.localDocumentToClientRequestIds=new Map,this.queryMappingManager=new l,this.documentIdentityService.observeChanges().subscribe(this.migrateDocIds.bind(this)),this.clientIdService.observeClientReadyToBeRegenerated().subscribe((()=>{this.refreshOngoingQueries()})),this.destructManager.onPreDestruct((()=>{this.predestruct()}))}hasOngoingQuery(e){return this.ongoingQueries.has(e)}getQuery(e){return(0,i.truthy)(this.ongoingQueries.get(e),"UNKNOWN_QUERY").query}setGotInitialResult(e){const t=(0,i.truthy)(this.ongoingQueries.get(e));t.gotInitialResponse?this.removeClientRequestIdMapping(e):t.gotInitialResponse=!0}findQueriesForDocument(e,t){const{collectionName:r,integrationId:n}=(0,i.parseSquidDocId)(t),o=this.queryMappingManager.getMapping(c,r,n);return o?(0,i.findQueriesForDocumentSync)(o,e):[]}setClientRequestIdsForLocalDoc(e,t){const r=this.localDocumentToClientRequestIds.get(e)||new Set,n=new Set(t?this.findQueriesForDocument(t,e).map((e=>(0,i.parseQuerySubscriptionId)(e).clientRequestId)):[]),o=new Set([...r,...n]);for(const t of[...r]){if(n.has(t))continue;r.delete(t);const i=this.clientRequestIdToLocalDocuments.get(t);i&&(i.delete(e),i.size||this.clientRequestIdToLocalDocuments.delete(t)),r.size||this.localDocumentToClientRequestIds.delete(e)}for(const t of n){let r=this.localDocumentToClientRequestIds.get(e);r||(r=new Set,this.localDocumentToClientRequestIds.set(e,r)),r.add(t);let n=this.clientRequestIdToLocalDocuments.get(t);n||(n=new Set,this.clientRequestIdToLocalDocuments.set(t,n)),n.add(e)}return[...o]}errorOutAllQueries(e,t){const r=this.localDocumentToClientRequestIds.get(e)||new Set;for(const e of r){const r=this.ongoingQueries.get(e);r&&(r.dataSubject.error(t),r.done=!0)}}notifyAllSubscriptions(e){const t=new Set;for(const r of e){const e=this.ongoingQueries.get(r);if(!e)continue;if(!e.gotInitialResponse||!e.activated)continue;const n=this.clientRequestIdToLocalDocuments.get(r),o=this.documentStore.sortAndLimitDocs(n,e.query);let a=!1;for(const t of e.supportedQueries)a=a||this.updateOngoingQueryWithNewDataFromSupportingQuery(o,t);let s=e;for(;!s.allObservables;)s=(0,i.truthy)(null==s?void 0:s.supportingOngoingQuery);a&&t.add(s),e.dataSubject.next(o)}for(const e of t){const t=this.collectAllObservables(e);(0,i.truthy)(e.allObservables).next(t)}}findValidParentQuery(e){if(e.forceFetchFromServer)return;const t=new i.QueryContext(e.query);for(const r of this.ongoingQueries.values())if(e!==r&&r.activated&&!r.isInFlight&&!r.isEmptyForJoin&&!r.done&&r.subscribe&&t.isSubsetOfQuery(r.query))return r}processQuery(e,t,r,n,i,u){return(0,a.defer)((()=>{const c=this.createOngoingQueryGraph(e,t,r,n,i,!0);u&&(c.forceFetchFromServer=!0),this.sendQueryToServerOrUseParentQuery(c),c.allObservables=new a.ReplaySubject(1);const l=c.allObservables.pipe((0,a.switchMap)((e=>(0,a.combineLatest)(e).pipe((0,s.map)((e=>this.joinResults(e,n,c)))))),(0,s.filter)((()=>this.allOngoingQueriesGotInitialResult(c))),(0,a.startWith)(void 0),(0,a.pairwise)(),(0,s.filter)((([e,t])=>!o.isEqual(e,t))),(0,s.map)((([e,t])=>t)),i?(0,a.tap)():(0,a.take)(1),(0,a.finalize)((()=>{var e;c.dataSubject.complete(),c.done=!0,this.completeAllSupportedQueries(c).then(),null===(e=c.allObservables)||void 0===e||e.complete()}))),f=this.collectAllObservables(c);return c.allObservables.next(f),l})).pipe((0,a.share)())}hasOngoingQueryForDocId(e){const t=this.localDocumentToClientRequestIds.get(e);return!!t&&!!t.size}removeClientRequestIdMapping(e){const t=this.clientRequestIdToLocalDocuments.get(e);if(!t)return;this.clientRequestIdToLocalDocuments.delete(e);const r=[];for(const n of t){const t=(0,i.truthy)(this.localDocumentToClientRequestIds.get(n));t.delete(e),t.size||(this.localDocumentToClientRequestIds.delete(n),r.push(n))}r.length&&this.onOrphanDocuments.next(r)}async waitForAllQueriesToFinish(){return(0,a.firstValueFrom)(this.inflightQueriesCount.pipe((0,s.filter)((e=>0===e)))).then((()=>{}))}registerQueryFinalizer(e){const t=e.clientRequestId,r=(0,i.getQuerySubscriptionId)(this.clientIdService.getClientId(),t);e.dataSubject.pipe((0,a.finalize)((async()=>{if(e.unsubscribeBlockerCount.value>0&&await(0,a.firstValueFrom)((0,a.race)(this.destructManager.observeIsDestructing(),e.unsubscribeBlockerCount.pipe((0,s.filter)((e=>0===e))))),this.queryMappingManager.removeQuery(t,r).then(),this.ongoingQueries.delete(t),e.subscribe&&!e.isEmptyForJoin&&e.activated){const r={clientRequestId:t};this.rpcManager.post("query/unsubscribe",r).catch((t=>{console.error("Got error while unsubscribing from query",e.query,t)}))}this.removeClientRequestIdMapping(t),this.ongoingQueries.delete(t)}))).subscribe({error:()=>{}})}createOngoingQueryGraph(e,t,r,n,o,s,u={}){if(u[t])return u[t];const c=(0,i.generateId)(),l=[],f={clientRequestId:c,activated:s,alias:t,query:e,subscribe:o,dataSubject:new a.ReplaySubject(1),supportedQueries:l,supportingOngoingQuery:void 0,joinCondition:void 0,gotInitialResponse:!1,isEmptyForJoin:!1,unsubscribeBlockerCount:new a.BehaviorSubject(0),queryRegistered:new a.BehaviorSubject(!1),done:!1,isInFlight:!1,forceFetchFromServer:!1};this.registerQueryFinalizer(f),this.ongoingQueries.set(c,f),u[t]=f;for(const[e,i]of Object.entries(n)){const a=i.leftAlias;if(a!==t&&e!==t)continue;const s=a===t?e:a;if(a===t){const e=this.createOngoingQueryGraph(r[s],s,r,n,o,!1,u);e.joinCondition=i,l.push(e)}else f.supportingOngoingQuery=this.createOngoingQueryGraph(r[s],s,r,n,o,!1,u)}return f}collectAllObservables(e,t=[]){if(e.isEmptyForJoin)return t;const r=e.alias;t.push(e.dataSubject.pipe((0,s.map)((e=>({docs:e,alias:r})))));for(const r of e.supportedQueries)this.collectAllObservables(r,t);return t}joinResults(e,t,r){const n=[],i=e.reduce(((e,t)=>(e[t.alias]?e[t.alias].push(...t.docs):e[t.alias]=[...t.docs],e)),{});i[r.alias].forEach((e=>{n.push({[r.alias]:e})}));const o=this.getOngoingQueriesBfs(r),a=new Set;for(let e=1;e<o.length;e++){const r=o[e].alias;a.has(r)||(a.add(r),this.join(n,r,i[r],t))}return n}join(e,t,r,n){var o;if(!e.length)return;const a=Object.keys(e[0]),s=n[t];if(!s||!a.includes(s.leftAlias))return;const u=new Map;(r||[]).forEach((e=>{const t=e[s.rightFieldName];u.has(t)||u.set(t,[]),(0,i.truthy)(u.get(t)).push(e)}));for(const r of[...e]){const n=u.get(null===(o=r[s.leftAlias])||void 0===o?void 0:o[s.leftFieldName])||[];if(n.length)for(const i of n)r[t]?e.push(Object.assign(Object.assign({},r),{[t]:i})):r[t]=i;else r[t]||(r[t]=void 0)}}getOngoingQueriesBfs(e){const t=[],r=[e];for(;r.length;){const e=(0,i.truthy)(r.shift());e.isEmptyForJoin||(t.push(e),r.push(...e.supportedQueries))}return t}updateOngoingQueryWithNewDataFromSupportingQuery(e,t){var r;const n=(0,i.truthy)(t.joinCondition),s=t.query;if(t.activated){const u=(0,i.truthy)(null===(r=t.supportingOngoingQuery)||void 0===r?void 0:r.supportedQueries).filter((e=>e.alias===t.alias)),c=new Set(e.map((e=>{var t;return null!==(t=e[n.leftFieldName])&&void 0!==t?t:null})));for(const e of u)e.query.conditions.filter((e=>e.fieldName===n.rightFieldName)).forEach((e=>{c.delete(e.value)}));if(0===c.size)return!1;const l=o.cloneDeep(s);l.conditions=l.conditions.filter((e=>e.fieldName!==n.rightFieldName)),[...c].forEach((e=>{l.conditions.push({fieldName:n.rightFieldName,operator:"==",value:e})}));const f=Object.assign(Object.assign({},t),{query:l,activated:!0,gotInitialResponse:!1,dataSubject:new a.ReplaySubject(1),clientRequestId:(0,i.generateId)(),isEmptyForJoin:!1});return this.registerQueryFinalizer(f),this.ongoingQueries.set(f.clientRequestId,f),(0,i.truthy)(t.supportingOngoingQuery).supportedQueries.push(f),this.sendQueryToServerOrUseParentQuery(f),!0}{const r=e.map((e=>{var t;return{fieldName:n.rightFieldName,operator:"==",value:null!==(t=e[n.leftFieldName])&&void 0!==t?t:null}}));return t.activated=!0,r.length?(s.conditions.push(...r),this.sendQueryToServerOrUseParentQuery(t)):t.isEmptyForJoin=!0,!0}}allOngoingQueriesGotInitialResult(e){return!!e.isEmptyForJoin||!!e.gotInitialResponse&&(!e.supportedQueries.length||e.supportedQueries.every((e=>this.allOngoingQueriesGotInitialResult(e))))}async completeAllSupportedQueries(e){const t=[...e.supportedQueries||[]];for(;t.length;){const e=(0,i.truthy)(t.shift());t.push(...e.supportedQueries||[]),await(0,a.firstValueFrom)(e.unsubscribeBlockerCount.pipe((0,s.filter)((e=>0===e)))),e.dataSubject.complete()}}predestruct(){this.safeToSendQueriesToServer.next(!1),this.safeToSendQueriesToServer.complete(),this.unsubscribe()}unsubscribe(){var e;const t=[...this.ongoingQueries.values()];for(const r of t)r.dataSubject.complete(),null===(e=r.allObservables)||void 0===e||e.complete()}hasSubscription(e){var t;return!!(null===(t=this.ongoingQueries.get(e))||void 0===t?void 0:t.subscribe)}sendQueryToServerOrUseParentQuery(e){if(this.destructManager.isDestructing)return;const t=e.query,r=e.clientRequestId,n=(0,i.getQuerySubscriptionId)(this.clientIdService.getClientId(),r);this.queryMappingManager.addQuery(c,t,n).then(),this.ongoingQueries.set(r,e);const o=this.findValidParentQuery(e);o?this.useParentOngoingQuery(e,o).then():this.sendQueryToServer(e)}async useParentOngoingQuery(e,t){const r={clientRequestId:e.clientRequestId,query:e.query,parentClientRequestId:t.clientRequestId},n=new i.QueryContext(e.query);t.unsubscribeBlockerCount.next(t.unsubscribeBlockerCount.value+1);try{await(0,a.firstValueFrom)(t.queryRegistered.pipe((0,s.filter)(Boolean)))}catch(t){return e.dataSubject.error(t),e.queryRegistered.error(t),void(e.done=!0)}if(this.destructManager.isDestructing)return;if(e.done)return;this.rpcManager.post("query/register",r).then((()=>{e.queryRegistered.next(!0)})).catch((r=>{console.error("Query error",e.query,t.query,r),e.dataSubject.error(r),e.done=!0})).finally((()=>{t.unsubscribeBlockerCount.next(t.unsubscribeBlockerCount.value-1),e.isInFlight=!1}));const o=(0,a.race)(e.queryRegistered.pipe((0,s.filter)(Boolean),(0,a.delay)(2e3),(0,a.take)(1)),this.destructManager.observeIsDestructing().pipe((0,a.take)(1)));t.dataSubject.pipe((0,a.takeWhile)((()=>!e.done)),(0,a.takeUntil)(o),(0,a.tap)((()=>{e.gotInitialResponse||this.setGotInitialResult(e.clientRequestId)})),(0,s.map)((e=>e.filter((e=>n.documentMatchesQuery(e)))))).subscribe({next:t=>{for(const r of t)this.setClientRequestIdsForLocalDoc((0,i.getSquidDocId)(r.__docId__,e.query.collectionName,e.query.integrationId),r);this.notifyAllSubscriptions([e.clientRequestId])},error:t=>e.dataSubject.error(t)})}sendQueryToServer(e){const t={query:e.query,clientRequestId:e.clientRequestId,subscribe:e.subscribe};this.safeToSendQueriesToServer.pipe((0,s.filter)(Boolean),(0,a.take)(1)).subscribe((()=>{e.done||(this.inflightQueriesCount.next(this.inflightQueriesCount.value+1),e.isInFlight=!0,this.rpcManager.post("query/query",t).catch((t=>{e.dataSubject.error(t),e.done=!0,e.queryRegistered.error("query failed")})).then((()=>{e.queryRegistered.next(!0)})).finally((()=>{this.inflightQueriesCount.next(this.inflightQueriesCount.value-1),e.isInFlight=!1})))}))}refreshOngoingQueries(){for(const e of this.ongoingQueries.values())this.sendQueryToServerOrUseParentQuery(e)}migrateDocIds(e){const t=Object.keys(e);for(const r of this.clientRequestIdToLocalDocuments.values())t.forEach((t=>{r.has(t)&&(r.delete(t),r.add(e[t]))}));t.forEach((t=>{(0,i.replaceKeyInMap)(this.localDocumentToClientRequestIds,t,e[t])}))}};class l extends i.SimpleQueryMappingManager{constructor(){super(...arguments),this.stateService=new u.StateService,this.querySubscriptionIdToQuery={}}async addQuery(e,t,r){this.stateService.runInBatch((()=>{let e=0;const n=new Set;for(const o of t.conditions){const a=this.getConditionStatePath(t,o),s=[...this.stateService.getStateInPath(a)||[]];if((0,i.insertSorted)(s,r),["==","!="].includes(o.operator)){const t=(0,i.encodeValueForMapping)(o.fieldName);n.has(t)||(e++,n.add(t))}else e++;this.stateService.setInPath(a,s)}if(!t.conditions.length){const e=["queryMapping",t.collectionName,t.integrationId,"mapping","unconditional"],n=[...this.stateService.getStateInPath(e)||[]];(0,i.insertSorted)(n,r),this.stateService.setInPath(e,n)}this.stateService.setInPath([...this.getQueryMetadataStatePath(t,r),"condCount"],e)})),this.querySubscriptionIdToQuery[r]=t}async removeQuery(e,t){const r=this.querySubscriptionIdToQuery[t];if(r)return this.stateService.runInBatch((()=>{for(const e of r.conditions){const n=this.getConditionStatePath(r,e),o=[...this.stateService.getStateInPath(n)||[]];(0,i.removeSorted)(o,t),o.length?this.stateService.setInPath(n,o):this.stateService.deletePath(n)}if(!r.conditions.length){const e=["queryMapping",r.collectionName,r.integrationId,"mapping","unconditional"],n=[...this.stateService.getStateInPath(e)||[]];(0,i.removeSorted)(n,t),this.stateService.setInPath(e,n)}this.stateService.deletePath(this.getQueryMetadataStatePath(r,t))})),r}getMapping(e,t,r){return this.stateService.getStateInPath(["queryMapping",t,r,"mapping"])}removeLocalDevAppData(e){return Promise.resolve(void 0)}getQueryMetadataStatePath(e,t){return["queryMapping",e.collectionName,e.integrationId,"mapping","queriesMetadata",`${t}`]}getConditionStatePath(e,t){const r=(0,i.encodeValueForMapping)(t.fieldName),n=(0,i.encodeValueForMapping)(t.value);return["queryMapping",e.collectionName,e.integrationId,"mapping","conditional",`${r}`,`${t.operator}`,`${n}`]}}},602:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RpcError=t.RpcManager=void 0;const n=r(9312),i=r(575),o=n.__importDefault(r(9031)),a=r(2937);t.RpcManager=class{constructor(e,t,r,n={},o,s){this.rpcEndpoint=e,this.socketManager=t,this.destructManager=r,this.headers=n,this.authManager=o,this.clientIdService=s,this.staticHeaders={},this.onGoingRpcCounter=new a.BehaviorSubject(0),(0,i.assertTruthy)(e,"Http endpoint must be provided.");for(const[e,t]of Object.entries(n))this.setStaticHeader(e,t);const u=this.authManager.getApiKey();u&&this.setStaticHeader("Authorization",`ApiKey ${u}`),this.clientIdService.observeClientId().subscribe((e=>{e?this.setStaticHeader("x-squid-clientId",e):this.deleteStaticHeader("x-squid-clientId")})),this.rpcEndpoint.endsWith("/")||(this.rpcEndpoint+="/"),this.authManager.observeAuthIdToken().subscribe((e=>{if(e.token){let t=`Bearer ${e.token}`;e.integrationId&&(t+=`; IntegrationId ${e.integrationId}`),this.setStaticHeader("Authorization",t)}else this.deleteStaticHeader("Authorization")})),r.onDestruct((async()=>{await this.awaitAllSettled()}))}async awaitAllSettled(){await(0,a.firstValueFrom)(this.onGoingRpcCounter.pipe((0,a.filter)((e=>0===e))))}setStaticHeader(e,t){this.staticHeaders[e]=t}deleteStaticHeader(e){delete this.staticHeaders[e]}getEndpoint(){return this.rpcEndpoint}getStaticHeaders(){return this.staticHeaders}async post(e,t){this.onGoingRpcCounter.next(this.onGoingRpcCounter.value+1);try{await(0,a.firstValueFrom)((0,a.race)(this.socketManager.observeConnectionReady().pipe((0,a.filter)(Boolean)),this.destructManager.observeIsDestructing())),await this.authManager.waitForReadyState();let r={"Content-Type":"application/json"};Object.keys(this.staticHeaders)&&(r=Object.assign(Object.assign({},r),this.staticHeaders));const n=await(0,o.default)(`${this.rpcEndpoint}${e}`,{method:"POST",body:(0,i.serializeObj)(t),headers:r});let u,c;try{u=await n.text();try{c=JSON.parse(u)}catch(e){}}catch(e){u="Cannot read body"}if(!n.ok)throw new s(n.status,n.statusText,n.headers,n.url,null==c?void 0:c.message);return c||u}finally{this.onGoingRpcCounter.next(this.onGoingRpcCounter.value-1)}}};class s extends Error{constructor(e,t,r,n,i){super(i||`RPC error ${e} ${t} calling ${n}`),this.statusCode=e,this.statusText=t,this.headers=r,this.url=n}}t.RpcError=s},3474:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SocketManager=void 0;const n=r(575),i=r(2937),o=r(8087),a=r(266);t.SocketManager=class{constructor(e,t,r=a.NOOP_FN,n,o={},s){this.clientIdService=e,this.socketIoEndpoint=t,this.messageNotificationWrapper=r,this.destructManager=n,this.authManager=s,this.webSocketObserver=new i.Subject,this.allMessagesObserver=new i.Subject,this.connectionReady=new i.BehaviorSubject(!1),this.seenMessageIds=new Set,this.firstConnection=!0,this.clientTooOldThreshold=3e5,this.destructManager.onDestruct((async()=>{await this.destruct()})),this.setupMessageAcknowledgments(),this.connect(Object.assign({},o)),this.connectionReady.pipe((0,i.skip)(1),(0,i.filter)((e=>!e)),(0,i.switchMap)((()=>(0,i.race)((0,i.timer)(this.clientTooOldThreshold),this.connectionReady.pipe((0,i.filter)(Boolean)),this.destructManager.observeIsDestructing())))).subscribe((()=>{this.connectionReady.value||this.destructManager.isDestructing||(this.clientIdService.notifyClientTooOld(),this.connect(Object.assign({},o)))})),this.connectionReady.pipe((0,i.filter)(Boolean)).subscribe((()=>{this.clientIdService.isClientTooOld()&&this.clientIdService.notifyClientReadyToBeRegenerated()}))}observeNotifications(){return this.webSocketObserver.asObservable()}observeConnectionReady(){return this.connectionReady.asObservable().pipe((0,i.distinctUntilChanged)())}sendMessage(e){this.authManager.waitForReadyState().then((()=>{(0,i.firstValueFrom)(this.connectionReady.pipe((0,i.filter)(Boolean))).then((()=>{const t=this.authManager.getAuthToken();(0,n.truthy)(this.socket).emit("message",Object.assign(Object.assign({},e),{authToken:t}))}))}))}connect(e){const t={clientId:this.clientIdService.getClientId()};this.socket=(0,o.io)(this.socketIoEndpoint,{query:t,reconnectionDelay:5e3,transports:["websocket"],extraHeaders:e}),this.socket.on("disconnect",((e,t)=>{this.connectionReady.next(!1)})),this.socket.on("connectionReady",(()=>{this.connectionReady.next(!0),this.firstConnection||this.sendMessage({type:"catchup"}),this.firstConnection=!1})),this.socket.on("message",(e=>{const t=(0,n.deserializeObj)(e);for(const e of t)this.allMessagesObserver.next(e),this.seenMessageIds.has(e.messageId)||(this.seenMessageIds.add(e.messageId),this.messageNotificationWrapper((()=>{this.webSocketObserver.next(e)})))}))}setupMessageAcknowledgments(){const e=new i.Subject;this.allMessagesObserver.subscribe((t=>{(null==t?void 0:t.messageId)&&e.next(t.messageId)}));const t=[];e.pipe((0,i.tap)((e=>t.push(e))),(0,i.debounceTime)(100)).subscribe((async()=>{const e=[...t.splice(0)];this.sendMessage({type:"acknowledge",payload:e})}))}async destruct(){var e;this.sendMessage({type:"kill"}),this.connectionReady.next(!1),await(0,i.firstValueFrom)((0,i.timer)(0)),null===(e=this.socket)||void 0===e||e.disconnect(),this.webSocketObserver.complete(),this.allMessagesObserver.complete()}}},5395:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Squid=void 0;const n=r(9312),i=r(575),o=r(2937),a=r(5969),s=r(4268),u=r(9526),c=r(8862),l=r(7378),f=r(1600),d=r(4967),p=r(7787),h=r(4605),y=n.__importDefault(r(2256)),v=r(2417),m=r(5182),b=r(5621),g=r(7718),_=r(9194),O=r(9732),w=r(6891),S=r(4661),E=r(602),I=r(3474),P=r(136);class T{constructor(e){this.destructManager=new p.DestructManager,this.setAuthIdToken=(e,t)=>{this.authManager.setAuthIdToken(e,t)},this.collection=(e,t=i.IntegrationType.built_in_db)=>(this.validateNotDestructed(),this.collectionReferenceFactory.get(e,t)),this.runInTransaction=e=>(this.validateNotDestructed(),this.dataManager.runInTransaction(e)),this.executeFunction=(e,...t)=>(this.validateNotDestructed(),(0,o.firstValueFrom)(this.backendFunctionManager.executeFunctionAndSubscribe(e,...t))),this.executeNamedQuery=(e,t,r)=>(this.validateNotDestructed(),(0,o.firstValueFrom)(this.namedQueryManager.executeNamedQueryAndSubscribe(e,t,r))),this.callApi=(e,t,r={})=>(this.validateNotDestructed(),(0,o.firstValueFrom)(this.apiManager.callApiAndSubscribe(e,t,r))),this.graphql=e=>(this.validateNotDestructed(),this.graphqlClientFactory.get(e)),this.ai=()=>(this.validateNotDestructed(),{assistant:e=>this.aiClientFactory.getAssistant(e)}),this.acquireLock=(e,t=!0)=>(this.validateNotDestructed(),this.distributedLockManager.lock(e,t)),this.destruct=async()=>{if(!this.destructManager.isDestructing)return this.destructManager.destruct().finally((()=>{const e=Object.entries(T.squidInstancesMap).find((([,e])=>e===this));e&&delete T.squidInstancesMap[e[0]]}))},this.connectionDetails=()=>(this.validateNotDestructed(),this._connectionDetails),this.unsubscribe=async()=>{this.querySubscriptionManager.unsubscribe(),await this.rpcManager.awaitAllSettled()},(0,i.assertTruthy)(e.appId,"APP_ID_MUST_BE_PROVIDED");const t="prod"!==e.environmentId&&e.squidDeveloperId,r=(0,i.appIdWithEnvironmentIdAndDevId)(e.appId,e.environmentId,t?e.squidDeveloperId:void 0),n=(0,i.getApplicationUrl)(e.region,r),j=(0,i.getApplicationHttpHeaders)(e.region,r);this.clientIdService=new l.ClientIdService(this.destructManager),this.authManager=new u.AuthManager(this.destructManager,e.apiKey),this.socketManager=new I.SocketManager(this.clientIdService,n,e.messageNotificationWrapper,this.destructManager,j,this.authManager),this.rpcManager=new E.RpcManager(n,this.socketManager,this.destructManager,j,this.authManager,this.clientIdService),this.documentStore=new m.DocumentStore,this.lockManager=new i.LockManager,this.distributedLockManager=new h.DistributedLockManager(this.socketManager,this.destructManager),this.documentIdentityService=new y.default(this.documentStore,this.destructManager),this.documentReferenceFactory=new v.DocumentReferenceFactory,this.querySubscriptionManager=new S.QuerySubscriptionManager(this.rpcManager,this.clientIdService,this.documentStore,this.destructManager,this.documentIdentityService);const A=new g.MutationSender(this.rpcManager,this.lockManager,this.querySubscriptionManager);this.queryBuilderFactory=new w.QueryBuilderFactory(this.querySubscriptionManager,this.documentReferenceFactory,this.documentIdentityService),this.joinQueryBuilderFactory=new O.JoinQueryBuilderFactory(this.querySubscriptionManager,this.documentReferenceFactory,this.queryBuilderFactory),this.collectionReferenceFactory=new f.CollectionReferenceFactory(this.documentReferenceFactory,this.queryBuilderFactory,this.joinQueryBuilderFactory,this.documentIdentityService),this.dataManager=new d.DataManager(this.documentStore,A,this.socketManager,this.querySubscriptionManager,this.queryBuilderFactory,this.lockManager,this.destructManager,this.documentIdentityService),this.documentReferenceFactory.setDataManager(this.dataManager),this.backendFunctionManager=new c.BackendFunctionManager(this.clientIdService,this.rpcManager,this.socketManager),this.namedQueryManager=new _.NamedQueryManager(this.rpcManager,this.socketManager),this.apiManager=new s.ApiManager(this.clientIdService,this.rpcManager,this.socketManager,e.apiServerUrlOverrideMapping),this.graphqlClientFactory=new b.GraphQLClientFactory(this.rpcManager),this.aiClientFactory=new a.AiClientFactory(this.rpcManager,this.socketManager),this._connectionDetails=new P.ConnectionDetails(this.clientIdService,this.socketManager)}static getInstance(e){const t=(0,i.normalizeJsonAsString)(e);let r=T.squidInstancesMap[t];return r||(r=new T(e),T.squidInstancesMap[t]=r,r)}static getInstances(){return Object.values(T.squidInstancesMap)}validateNotDestructed(){(0,i.assertTruthy)(!this.destructManager.isDestructing,"The client was already destructed.")}}t.Squid=T,T.squidInstancesMap={}},1064:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isStateObject=t.apply=void 0;const n=r(1496);function i(e){return"object"==typeof e}function o(e,t){let r=e;if((0,n.isPathAction)(t))r=function(e,t,r=[]){switch(t.type){case n.ActionType.DELETE_PATH:return a(e,t.path);case n.ActionType.SET_PATH:const i=t;return function(e,t,r,n){return s(e,t,r,n)}(e,t.path,r,i.payload);case n.ActionType.BATCH_ACTION:throw new Error("Unsupported")}}(e,t,[]);else{if(!(0,n.isBatchAction)(t))throw new Error(`Invalid action type: ${t.type}`);r=t.payload.reduce(((e,t)=>o(e,t)),e)}return r}function a(e,t){if(!t.length)throw new Error("can not delete an empty path");const r=t[0];if(1===t.length)return function(e,t){if(e instanceof Array)throw new Error("Cannot remove an item from an array");const r=Object.assign({},e);return delete r[t],r}(e,r);const n=t.slice(1),o=c(e,r);if(!o)return e;if(!i(o))throw new Error("Cannot delete from a non object state.");const s=a(o,n);return s===o?e:u(e,r,s)}function s(e,t,r,n){if(!t.length){if(i(n))return n;throw new Error("Relative path cannot be of length 0 when the new value is not an object.")}const o=t[0],a=[...r,o];if(1===t.length)return u(e,o,n);const l=t.slice(1),f=c(e,o);return void 0!==f&&i(f)?u(e,o,s(f,l,a,n)):s(e=u(e,o,{}),t,r,n)}function u(e,t,r){return(e=Object.assign({},e))[t]=r,e}function c(e,t){return e instanceof Array?e[function(e){const t=Number(e);if(isNaN(t))throw new Error(`The value is not a number: Actual: ${e}`);return Math.floor(t)}(t)]:e[t]}t.apply=function(e,t){return o(e,t)},t.isStateObject=i},1496:(e,t)=>{"use strict";var r;function n(e){return[r.SET_PATH,r.DELETE_PATH].includes(e.type)}function i(e){return e.type===r.BATCH_ACTION}Object.defineProperty(t,"__esModule",{value:!0}),t.getSingleAction=t.extractAllPathActions=t.isBatchAction=t.isDeletePathAction=t.isSetPathAction=t.isPathAction=t.ActionType=void 0,function(e){e.DELETE_PATH="DELETE_PATH",e.SET_PATH="SET_PATH",e.BATCH_ACTION="BATCH_ACTION"}(r=t.ActionType||(t.ActionType={})),t.isPathAction=n,t.isSetPathAction=function(e){return e.type===r.SET_PATH},t.isDeletePathAction=function(e){return e.type===r.DELETE_PATH},t.isBatchAction=i,t.extractAllPathActions=function e(t){const r=[];if(n(t))r.push(t);else if(i(t))for(const n of t.payload)r.push(...e(n));return r},t.getSingleAction=function(e){return 1===e.length?e[0]:{type:r.BATCH_ACTION,payload:e}}},8336:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getPathTrieFromAction=t.PathTrieNode=t.PathTrie=void 0;const n=r(1496);class i{constructor(){this.root=new o}getOrCreatePathTrieNode(e,t){let r=this.root;for(const t of e)r.children.get(t)||r.children.set(t,new o),r=r.children.get(t);return void 0!==t&&(r.nodeData=t),r}getPathTrieNode(e){let t=this.root;for(const r of e){if(!t)return;t=t.children.get(r)}return t}getPathTrie(e){let t=this.root;for(const r of e){if(!t)return;t=t.children.get(r)}if(t){const e=new i;return e.root=t,e}}iterateBfs(e){this.iterateInternal(this.root,e,[])}removeNode(e){e.length||(this.root=new o);const t=[this.root];for(const r of e){const e=t[t.length-1].children.get(r);if(!e)throw new Error("Node does not exist");t.push(e)}for(let r=t.length-1;r>0;r--){const n=t[r],i=e[r-1];if((n.nodeData||n.children.size)&&r!==t.length-1)break;t[r-1].children.delete(i)}}clearNodeData(e){const t=this.getPathTrieNode(e);t&&(t.nodeData=void 0,t.children.size||this.removeNode(e))}getNodeList(e){const t=[];let r=this.root;for(const n of e){if(!r)return t;t.push(r),r=r.children.get(n)}return t}iterateInternal(e,t,r){if(!1!==t(e.nodeData,r))for(const[n,i]of e.children)this.iterateInternal(i,t,r.concat(n))}}t.PathTrie=i;class o{constructor(){this.children=new Map([])}}t.PathTrieNode=o,t.getPathTrieFromAction=function(e,t){const r=new i;for(const i of(0,n.extractAllPathActions)(e)){let e=r.getOrCreatePathTrieNode(i.path);if(!t||e.nodeData)continue;let n=t.getPathTrieNode(i.path);if(n){const t=[[e,n]];for(;t.length;){const r=t.shift();if(e=r[0],n=r[1],!e.nodeData){for(const[r,i]of n.children)e.children.get(r)||e.children.set(r,new o),t.push([e.children.get(r),i]);e.nodeData=!0}}}}return r}},1122:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StateService=void 0;const n=r(2937),i=r(9978),o=r(1064),a=r(1496),s=r(8336);function u(e,t){let r=e;for(const e of t){if(null==r)return;if(!(0,o.isStateObject)(r))throw new Error("result must be a state object");r=r[e]}return r}t.StateService=class{constructor(){this.subscriptionsTree=new s.PathTrie,this.state={},this.batchCount=0,this.batchedActions=[]}dispatch(e){this.batchCount>0&&this.batchedActions.push(e),this.state=(0,o.apply)(this.state,e),0===this.batchCount&&this.dispatchSubscriptions(e)}runInBatch(e){this.batchCount++;try{e()}finally{if(this.batchCount--,0===this.batchCount&&this.batchedActions.length){const e={type:a.ActionType.BATCH_ACTION,payload:[...this.batchedActions]};this.batchedActions.splice(0),this.dispatch(e)}}}observePath(e,t){return new n.Observable((r=>{const n=this.getOrCreateSubjectForPath(e);r.next(this.getStateInPath(e));const o=n.pipe((0,i.filter)((e=>{if(!t)return!0;const r=new s.PathTrie,n=t();for(const e of n)r.getOrCreatePathTrieNode(e,!0);const i=(0,a.extractAllPathActions)(e.action).map((e=>e.path));let o=!1;for(const e of i)if(0===r.getNodeList(e).length){o=!0;break}return o})),(0,i.map)((e=>e.data))).subscribe(r);return()=>{o.unsubscribe(),n.observed||(n.complete(),this.subscriptionsTree.clearNodeData(e))}}))}setKeyInPath(e,t,r,n=!1){this.setInPath([...e,t],r,n)}setPartial(e,t,r=!1){let n=this.getStateInPath(e);n||(n={}),this.setInPath(e,Object.assign(Object.assign({},n),t),r)}setInPath(e,t,r=!1){if(r&&this.getStateInPath(e)===t)return;const n={type:a.ActionType.SET_PATH,path:e,payload:t};this.dispatch(n)}pushToArray(e,t){let r=this.getStateInPath(e);r=r?[...r]:[],r.push(t),this.setInPath(e,r)}deletePath(e){const t={type:a.ActionType.DELETE_PATH,path:e};this.dispatch(t)}getState(){return this.state}getStateInPath(e){return u(this.state,e)}destroy(){this.subscriptionsTree.iterateBfs((e=>{e&&e.subject&&e.subject.complete()}))}getOrCreateSubjectForPath(e){const t=this.subscriptionsTree.getOrCreatePathTrieNode(e);t.nodeData||(t.nodeData=new c);const r=t.nodeData;return r.subject||(r.subject=new n.Subject),r.subject}dispatchSubscriptions(e){(0,s.getPathTrieFromAction)(e,this.subscriptionsTree).iterateBfs(((t,r)=>{const n=this.subscriptionsTree.getPathTrieNode(r);n&&n.nodeData&&n.nodeData.subject.next({action:e,data:u(this.getState(),r)})}))}};class c{}},266:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NOOP_FN=void 0,t.NOOP_FN=e=>e()},9312:(e,t,r)=>{"use strict";r.r(t),r.d(t,{__assign:()=>o,__asyncDelegator:()=>I,__asyncGenerator:()=>E,__asyncValues:()=>P,__await:()=>S,__awaiter:()=>h,__classPrivateFieldGet:()=>k,__classPrivateFieldIn:()=>N,__classPrivateFieldSet:()=>M,__createBinding:()=>v,__decorate:()=>s,__esDecorate:()=>c,__exportStar:()=>m,__extends:()=>i,__generator:()=>y,__importDefault:()=>x,__importStar:()=>A,__makeTemplateObject:()=>T,__metadata:()=>p,__param:()=>u,__propKey:()=>f,__read:()=>g,__rest:()=>a,__runInitializers:()=>l,__setFunctionName:()=>d,__spread:()=>_,__spreadArray:()=>w,__spreadArrays:()=>O,__values:()=>b});var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)};function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var o=function(){return o=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},o.apply(this,arguments)};function a(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r}function s(e,t,r,n){var i,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,r,a):i(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a}function u(e,t){return function(r,n){t(r,n,e)}}function c(e,t,r,n,i,o){function a(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var s,u=n.kind,c="getter"===u?"get":"setter"===u?"set":"value",l=!t&&e?n.static?e:e.prototype:null,f=t||(l?Object.getOwnPropertyDescriptor(l,n.name):{}),d=!1,p=r.length-1;p>=0;p--){var h={};for(var y in n)h[y]="access"===y?{}:n[y];for(var y in n.access)h.access[y]=n.access[y];h.addInitializer=function(e){if(d)throw new TypeError("Cannot add initializers after decoration has completed");o.push(a(e||null))};var v=(0,r[p])("accessor"===u?{get:f.get,set:f.set}:f[c],h);if("accessor"===u){if(void 0===v)continue;if(null===v||"object"!=typeof v)throw new TypeError("Object expected");(s=a(v.get))&&(f.get=s),(s=a(v.set))&&(f.set=s),(s=a(v.init))&&i.push(s)}else(s=a(v))&&("field"===u?i.push(s):f[c]=s)}l&&Object.defineProperty(l,n.name,f),d=!0}function l(e,t,r){for(var n=arguments.length>2,i=0;i<t.length;i++)r=n?t[i].call(e,r):t[i].call(e);return n?r:void 0}function f(e){return"symbol"==typeof e?e:"".concat(e)}function d(e,t,r){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:r?"".concat(r," ",t):t})}function p(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function h(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))}function y(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(u){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{r=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}}var v=Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]};function m(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||v(t,e,r)}function b(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.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 new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function g(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return a}function _(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(g(arguments[t]));return e}function O(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var n=Array(e),i=0;for(t=0;t<r;t++)for(var o=arguments[t],a=0,s=o.length;a<s;a++,i++)n[i]=o[a];return n}function w(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}function S(e){return this instanceof S?(this.v=e,this):new S(e)}function E(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,i=r.apply(e,t||[]),o=[];return n={},a("next"),a("throw"),a("return"),n[Symbol.asyncIterator]=function(){return this},n;function a(e){i[e]&&(n[e]=function(t){return new Promise((function(r,n){o.push([e,t,r,n])>1||s(e,t)}))})}function s(e,t){try{(r=i[e](t)).value instanceof S?Promise.resolve(r.value.v).then(u,c):l(o[0][2],r)}catch(e){l(o[0][3],e)}var r}function u(e){s("next",e)}function c(e){s("throw",e)}function l(e,t){e(t),o.shift(),o.length&&s(o[0][0],o[0][1])}}function I(e){var t,r;return t={},n("next"),n("throw",(function(e){throw e})),n("return"),t[Symbol.iterator]=function(){return this},t;function n(n,i){t[n]=e[n]?function(t){return(r=!r)?{value:S(e[n](t)),done:!1}:i?i(t):t}:i}}function P(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=b(e),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise((function(n,i){!function(e,t,r,n){Promise.resolve(n).then((function(t){e({value:t,done:r})}),t)}(n,i,(t=e[r](t)).done,t.value)}))}}}function T(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var j=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};function A(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&v(t,e,r);return j(t,e),t}function x(e){return e&&e.__esModule?e:{default:e}}function k(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)}function M(e,t,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(e,r):i?i.value=r:t.set(e,r),r}function N(e,t){if(null===t||"object"!=typeof t&&"function"!=typeof t)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof e?t===e:e.has(t)}},2371:function(e,t){!function(e){"use strict";function t(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];if(t.length>1){t[0]=t[0].slice(0,-1);for(var n=t.length-1,i=1;i<n;++i)t[i]=t[i].slice(1,-1);return t[n]=t[n].slice(1),t.join("")}return t[0]}function r(e){return"(?:"+e+")"}function n(e){return void 0===e?"undefined":null===e?"null":Object.prototype.toString.call(e).split(" ").pop().split("]").shift().toLowerCase()}function i(e){return e.toUpperCase()}function o(e){var n="[A-Za-z]",i="[0-9]",o=t(i,"[A-Fa-f]"),a=r(r("%[EFef]"+o+"%"+o+o+"%"+o+o)+"|"+r("%[89A-Fa-f]"+o+"%"+o+o)+"|"+r("%"+o+o)),s="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",u=t("[\\:\\/\\?\\#\\[\\]\\@]",s),c=e?"[\\uE000-\\uF8FF]":"[]",l=t(n,i,"[\\-\\.\\_\\~]",e?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]"),f=r(n+t(n,i,"[\\+\\-\\.]")+"*"),d=r(r(a+"|"+t(l,s,"[\\:]"))+"*"),p=(r(r("25[0-5]")+"|"+r("2[0-4]"+i)+"|"+r("1"+i+i)+"|"+r("[1-9]"+i)+"|"+i),r(r("25[0-5]")+"|"+r("2[0-4]"+i)+"|"+r("1"+i+i)+"|"+r("0?[1-9]"+i)+"|0?0?"+i)),h=r(p+"\\."+p+"\\."+p+"\\."+p),y=r(o+"{1,4}"),v=r(r(y+"\\:"+y)+"|"+h),m=r(r(y+"\\:")+"{6}"+v),b=r("\\:\\:"+r(y+"\\:")+"{5}"+v),g=r(r(y)+"?\\:\\:"+r(y+"\\:")+"{4}"+v),_=r(r(r(y+"\\:")+"{0,1}"+y)+"?\\:\\:"+r(y+"\\:")+"{3}"+v),O=r(r(r(y+"\\:")+"{0,2}"+y)+"?\\:\\:"+r(y+"\\:")+"{2}"+v),w=r(r(r(y+"\\:")+"{0,3}"+y)+"?\\:\\:"+y+"\\:"+v),S=r(r(r(y+"\\:")+"{0,4}"+y)+"?\\:\\:"+v),E=r(r(r(y+"\\:")+"{0,5}"+y)+"?\\:\\:"+y),I=r(r(r(y+"\\:")+"{0,6}"+y)+"?\\:\\:"),P=r([m,b,g,_,O,w,S,E,I].join("|")),T=r(r(l+"|"+a)+"+"),j=(r(P+"\\%25"+T),r(P+r("\\%25|\\%(?!"+o+"{2})")+T)),A=r("[vV]"+o+"+\\."+t(l,s,"[\\:]")+"+"),x=r("\\["+r(j+"|"+P+"|"+A)+"\\]"),k=r(r(a+"|"+t(l,s))+"*"),M=r(x+"|"+h+"(?!"+k+")|"+k),N=r(i+"*"),D=r(r(d+"@")+"?"+M+r("\\:"+N)+"?"),R=r(a+"|"+t(l,s,"[\\:\\@]")),C=r(R+"*"),F=r(R+"+"),$=r(r(a+"|"+t(l,s,"[\\@]"))+"+"),q=r(r("\\/"+C)+"*"),L=r("\\/"+r(F+q)+"?"),V=r($+q),U=r(F+q),Q="(?!"+R+")",z=(r(q+"|"+L+"|"+V+"|"+U+"|"+Q),r(r(R+"|"+t("[\\/\\?]",c))+"*")),B=r(r(R+"|[\\/\\?]")+"*"),W=r(r("\\/\\/"+D+q)+"|"+L+"|"+U+"|"+Q),Y=r(f+"\\:"+W+r("\\?"+z)+"?"+r("\\#"+B)+"?"),K=r(r("\\/\\/"+D+q)+"|"+L+"|"+V+"|"+Q),H=r(K+r("\\?"+z)+"?"+r("\\#"+B)+"?");return r(Y+"|"+H),r(f+"\\:"+W+r("\\?"+z)+"?"),r(r("\\/\\/("+r("("+d+")@")+"?("+M+")"+r("\\:("+N+")")+"?)")+"?("+q+"|"+L+"|"+U+"|"+Q+")"),r("\\?("+z+")"),r("\\#("+B+")"),r(r("\\/\\/("+r("("+d+")@")+"?("+M+")"+r("\\:("+N+")")+"?)")+"?("+q+"|"+L+"|"+V+"|"+Q+")"),r("\\?("+z+")"),r("\\#("+B+")"),r(r("\\/\\/("+r("("+d+")@")+"?("+M+")"+r("\\:("+N+")")+"?)")+"?("+q+"|"+L+"|"+U+"|"+Q+")"),r("\\?("+z+")"),r("\\#("+B+")"),r("("+d+")@"),r("\\:("+N+")"),{NOT_SCHEME:new RegExp(t("[^]",n,i,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(t("[^\\%\\:]",l,s),"g"),NOT_HOST:new RegExp(t("[^\\%\\[\\]\\:]",l,s),"g"),NOT_PATH:new RegExp(t("[^\\%\\/\\:\\@]",l,s),"g"),NOT_PATH_NOSCHEME:new RegExp(t("[^\\%\\/\\@]",l,s),"g"),NOT_QUERY:new RegExp(t("[^\\%]",l,s,"[\\:\\@\\/\\?]",c),"g"),NOT_FRAGMENT:new RegExp(t("[^\\%]",l,s,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(t("[^]",l,s),"g"),UNRESERVED:new RegExp(l,"g"),OTHER_CHARS:new RegExp(t("[^\\%]",l,u),"g"),PCT_ENCODED:new RegExp(a,"g"),IPV4ADDRESS:new RegExp("^("+h+")$"),IPV6ADDRESS:new RegExp("^\\[?("+P+")"+r(r("\\%25|\\%(?!"+o+"{2})")+"("+T+")")+"?\\]?$")}}var a=o(!1),s=o(!0),u=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var r=[],n=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){i=!0,o=e}finally{try{!n&&s.return&&s.return()}finally{if(i)throw o}}return r}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},c=2147483647,l=36,f=/^xn--/,d=/[^\0-\x7E]/,p=/[\x2E\u3002\uFF0E\uFF61]/g,h={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},y=Math.floor,v=String.fromCharCode;function m(e){throw new RangeError(h[e])}function b(e,t){var r=e.split("@"),n="";return r.length>1&&(n=r[0]+"@",e=r[1]),n+function(e,t){for(var r=[],n=e.length;n--;)r[n]=t(e[n]);return r}((e=e.replace(p,".")).split("."),t).join(".")}function g(e){for(var t=[],r=0,n=e.length;r<n;){var i=e.charCodeAt(r++);if(i>=55296&&i<=56319&&r<n){var o=e.charCodeAt(r++);56320==(64512&o)?t.push(((1023&i)<<10)+(1023&o)+65536):(t.push(i),r--)}else t.push(i)}return t}var _=function(e,t){return e+22+75*(e<26)-((0!=t)<<5)},O=function(e,t,r){var n=0;for(e=r?y(e/700):e>>1,e+=y(e/t);e>455;n+=l)e=y(e/35);return y(n+36*e/(e+38))},w=function(e){var t,r=[],n=e.length,i=0,o=128,a=72,s=e.lastIndexOf("-");s<0&&(s=0);for(var u=0;u<s;++u)e.charCodeAt(u)>=128&&m("not-basic"),r.push(e.charCodeAt(u));for(var f=s>0?s+1:0;f<n;){for(var d=i,p=1,h=l;;h+=l){f>=n&&m("invalid-input");var v=(t=e.charCodeAt(f++))-48<10?t-22:t-65<26?t-65:t-97<26?t-97:l;(v>=l||v>y((c-i)/p))&&m("overflow"),i+=v*p;var b=h<=a?1:h>=a+26?26:h-a;if(v<b)break;var g=l-b;p>y(c/g)&&m("overflow"),p*=g}var _=r.length+1;a=O(i-d,_,0==d),y(i/_)>c-o&&m("overflow"),o+=y(i/_),i%=_,r.splice(i++,0,o)}return String.fromCodePoint.apply(String,r)},S=function(e){var t=[],r=(e=g(e)).length,n=128,i=0,o=72,a=!0,s=!1,u=void 0;try{for(var f,d=e[Symbol.iterator]();!(a=(f=d.next()).done);a=!0){var p=f.value;p<128&&t.push(v(p))}}catch(e){s=!0,u=e}finally{try{!a&&d.return&&d.return()}finally{if(s)throw u}}var h=t.length,b=h;for(h&&t.push("-");b<r;){var w=c,S=!0,E=!1,I=void 0;try{for(var P,T=e[Symbol.iterator]();!(S=(P=T.next()).done);S=!0){var j=P.value;j>=n&&j<w&&(w=j)}}catch(e){E=!0,I=e}finally{try{!S&&T.return&&T.return()}finally{if(E)throw I}}var A=b+1;w-n>y((c-i)/A)&&m("overflow"),i+=(w-n)*A,n=w;var x=!0,k=!1,M=void 0;try{for(var N,D=e[Symbol.iterator]();!(x=(N=D.next()).done);x=!0){var R=N.value;if(R<n&&++i>c&&m("overflow"),R==n){for(var C=i,F=l;;F+=l){var $=F<=o?1:F>=o+26?26:F-o;if(C<$)break;var q=C-$,L=l-$;t.push(v(_($+q%L,0))),C=y(q/L)}t.push(v(_(C,0))),o=O(i,A,b==h),i=0,++b}}}catch(e){k=!0,M=e}finally{try{!x&&D.return&&D.return()}finally{if(k)throw M}}++i,++n}return t.join("")},E={version:"2.1.0",ucs2:{decode:g,encode:function(e){return String.fromCodePoint.apply(String,function(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}(e))}},decode:w,encode:S,toASCII:function(e){return b(e,(function(e){return d.test(e)?"xn--"+S(e):e}))},toUnicode:function(e){return b(e,(function(e){return f.test(e)?w(e.slice(4).toLowerCase()):e}))}},I={};function P(e){var t=e.charCodeAt(0);return t<16?"%0"+t.toString(16).toUpperCase():t<128?"%"+t.toString(16).toUpperCase():t<2048?"%"+(t>>6|192).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase():"%"+(t>>12|224).toString(16).toUpperCase()+"%"+(t>>6&63|128).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase()}function T(e){for(var t="",r=0,n=e.length;r<n;){var i=parseInt(e.substr(r+1,2),16);if(i<128)t+=String.fromCharCode(i),r+=3;else if(i>=194&&i<224){if(n-r>=6){var o=parseInt(e.substr(r+4,2),16);t+=String.fromCharCode((31&i)<<6|63&o)}else t+=e.substr(r,6);r+=6}else if(i>=224){if(n-r>=9){var a=parseInt(e.substr(r+4,2),16),s=parseInt(e.substr(r+7,2),16);t+=String.fromCharCode((15&i)<<12|(63&a)<<6|63&s)}else t+=e.substr(r,9);r+=9}else t+=e.substr(r,3),r+=3}return t}function j(e,t){function r(e){var r=T(e);return r.match(t.UNRESERVED)?r:e}return e.scheme&&(e.scheme=String(e.scheme).replace(t.PCT_ENCODED,r).toLowerCase().replace(t.NOT_SCHEME,"")),void 0!==e.userinfo&&(e.userinfo=String(e.userinfo).replace(t.PCT_ENCODED,r).replace(t.NOT_USERINFO,P).replace(t.PCT_ENCODED,i)),void 0!==e.host&&(e.host=String(e.host).replace(t.PCT_ENCODED,r).toLowerCase().replace(t.NOT_HOST,P).replace(t.PCT_ENCODED,i)),void 0!==e.path&&(e.path=String(e.path).replace(t.PCT_ENCODED,r).replace(e.scheme?t.NOT_PATH:t.NOT_PATH_NOSCHEME,P).replace(t.PCT_ENCODED,i)),void 0!==e.query&&(e.query=String(e.query).replace(t.PCT_ENCODED,r).replace(t.NOT_QUERY,P).replace(t.PCT_ENCODED,i)),void 0!==e.fragment&&(e.fragment=String(e.fragment).replace(t.PCT_ENCODED,r).replace(t.NOT_FRAGMENT,P).replace(t.PCT_ENCODED,i)),e}function A(e){return e.replace(/^0*(.*)/,"$1")||"0"}function x(e,t){var r=e.match(t.IPV4ADDRESS)||[],n=u(r,2)[1];return n?n.split(".").map(A).join("."):e}function k(e,t){var r=e.match(t.IPV6ADDRESS)||[],n=u(r,3),i=n[1],o=n[2];if(i){for(var a=i.toLowerCase().split("::").reverse(),s=u(a,2),c=s[0],l=s[1],f=l?l.split(":").map(A):[],d=c.split(":").map(A),p=t.IPV4ADDRESS.test(d[d.length-1]),h=p?7:8,y=d.length-h,v=Array(h),m=0;m<h;++m)v[m]=f[m]||d[y+m]||"";p&&(v[h-1]=x(v[h-1],t));var b=v.reduce((function(e,t,r){if(!t||"0"===t){var n=e[e.length-1];n&&n.index+n.length===r?n.length++:e.push({index:r,length:1})}return e}),[]).sort((function(e,t){return t.length-e.length}))[0],g=void 0;if(b&&b.length>1){var _=v.slice(0,b.index),O=v.slice(b.index+b.length);g=_.join(":")+"::"+O.join(":")}else g=v.join(":");return o&&(g+="%"+o),g}return e}var M=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,N=void 0==="".match(/(){0}/)[1];function D(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={},n=!1!==t.iri?s:a;"suffix"===t.reference&&(e=(t.scheme?t.scheme+":":"")+"//"+e);var i=e.match(M);if(i){N?(r.scheme=i[1],r.userinfo=i[3],r.host=i[4],r.port=parseInt(i[5],10),r.path=i[6]||"",r.query=i[7],r.fragment=i[8],isNaN(r.port)&&(r.port=i[5])):(r.scheme=i[1]||void 0,r.userinfo=-1!==e.indexOf("@")?i[3]:void 0,r.host=-1!==e.indexOf("//")?i[4]:void 0,r.port=parseInt(i[5],10),r.path=i[6]||"",r.query=-1!==e.indexOf("?")?i[7]:void 0,r.fragment=-1!==e.indexOf("#")?i[8]:void 0,isNaN(r.port)&&(r.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?i[4]:void 0)),r.host&&(r.host=k(x(r.host,n),n)),void 0!==r.scheme||void 0!==r.userinfo||void 0!==r.host||void 0!==r.port||r.path||void 0!==r.query?void 0===r.scheme?r.reference="relative":void 0===r.fragment?r.reference="absolute":r.reference="uri":r.reference="same-document",t.reference&&"suffix"!==t.reference&&t.reference!==r.reference&&(r.error=r.error||"URI is not a "+t.reference+" reference.");var o=I[(t.scheme||r.scheme||"").toLowerCase()];if(t.unicodeSupport||o&&o.unicodeSupport)j(r,n);else{if(r.host&&(t.domainHost||o&&o.domainHost))try{r.host=E.toASCII(r.host.replace(n.PCT_ENCODED,T).toLowerCase())}catch(e){r.error=r.error||"Host's domain name can not be converted to ASCII via punycode: "+e}j(r,a)}o&&o.parse&&o.parse(r,t)}else r.error=r.error||"URI can not be parsed.";return r}var R=/^\.\.?\//,C=/^\/\.(\/|$)/,F=/^\/\.\.(\/|$)/,$=/^\/?(?:.|\n)*?(?=\/|$)/;function q(e){for(var t=[];e.length;)if(e.match(R))e=e.replace(R,"");else if(e.match(C))e=e.replace(C,"/");else if(e.match(F))e=e.replace(F,"/"),t.pop();else if("."===e||".."===e)e="";else{var r=e.match($);if(!r)throw new Error("Unexpected dot segment condition");var n=r[0];e=e.slice(n.length),t.push(n)}return t.join("")}function L(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.iri?s:a,n=[],i=I[(t.scheme||e.scheme||"").toLowerCase()];if(i&&i.serialize&&i.serialize(e,t),e.host)if(r.IPV6ADDRESS.test(e.host));else if(t.domainHost||i&&i.domainHost)try{e.host=t.iri?E.toUnicode(e.host):E.toASCII(e.host.replace(r.PCT_ENCODED,T).toLowerCase())}catch(r){e.error=e.error||"Host's domain name can not be converted to "+(t.iri?"Unicode":"ASCII")+" via punycode: "+r}j(e,r),"suffix"!==t.reference&&e.scheme&&(n.push(e.scheme),n.push(":"));var o=function(e,t){var r=!1!==t.iri?s:a,n=[];return void 0!==e.userinfo&&(n.push(e.userinfo),n.push("@")),void 0!==e.host&&n.push(k(x(String(e.host),r),r).replace(r.IPV6ADDRESS,(function(e,t,r){return"["+t+(r?"%25"+r:"")+"]"}))),"number"!=typeof e.port&&"string"!=typeof e.port||(n.push(":"),n.push(String(e.port))),n.length?n.join(""):void 0}(e,t);if(void 0!==o&&("suffix"!==t.reference&&n.push("//"),n.push(o),e.path&&"/"!==e.path.charAt(0)&&n.push("/")),void 0!==e.path){var u=e.path;t.absolutePath||i&&i.absolutePath||(u=q(u)),void 0===o&&(u=u.replace(/^\/\//,"/%2F")),n.push(u)}return void 0!==e.query&&(n.push("?"),n.push(e.query)),void 0!==e.fragment&&(n.push("#"),n.push(e.fragment)),n.join("")}function V(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n={};return arguments[3]||(e=D(L(e,r),r),t=D(L(t,r),r)),!(r=r||{}).tolerant&&t.scheme?(n.scheme=t.scheme,n.userinfo=t.userinfo,n.host=t.host,n.port=t.port,n.path=q(t.path||""),n.query=t.query):(void 0!==t.userinfo||void 0!==t.host||void 0!==t.port?(n.userinfo=t.userinfo,n.host=t.host,n.port=t.port,n.path=q(t.path||""),n.query=t.query):(t.path?("/"===t.path.charAt(0)?n.path=q(t.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?n.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:n.path=t.path:n.path="/"+t.path,n.path=q(n.path)),n.query=t.query):(n.path=e.path,void 0!==t.query?n.query=t.query:n.query=e.query),n.userinfo=e.userinfo,n.host=e.host,n.port=e.port),n.scheme=e.scheme),n.fragment=t.fragment,n}function U(e,t){return e&&e.toString().replace(t&&t.iri?s.PCT_ENCODED:a.PCT_ENCODED,T)}var Q={scheme:"http",domainHost:!0,parse:function(e,t){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e},serialize:function(e,t){var r="https"===String(e.scheme).toLowerCase();return e.port!==(r?443:80)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}},z={scheme:"https",domainHost:Q.domainHost,parse:Q.parse,serialize:Q.serialize};function B(e){return"boolean"==typeof e.secure?e.secure:"wss"===String(e.scheme).toLowerCase()}var W={scheme:"ws",domainHost:!0,parse:function(e,t){var r=e;return r.secure=B(r),r.resourceName=(r.path||"/")+(r.query?"?"+r.query:""),r.path=void 0,r.query=void 0,r},serialize:function(e,t){if(e.port!==(B(e)?443:80)&&""!==e.port||(e.port=void 0),"boolean"==typeof e.secure&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){var r=e.resourceName.split("?"),n=u(r,2),i=n[0],o=n[1];e.path=i&&"/"!==i?i:void 0,e.query=o,e.resourceName=void 0}return e.fragment=void 0,e}},Y={scheme:"wss",domainHost:W.domainHost,parse:W.parse,serialize:W.serialize},K={},H="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",G="[0-9A-Fa-f]",J=r(r("%[EFef]"+G+"%"+G+G+"%"+G+G)+"|"+r("%[89A-Fa-f]"+G+"%"+G+G)+"|"+r("%"+G+G)),Z=t("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),X=new RegExp(H,"g"),ee=new RegExp(J,"g"),te=new RegExp(t("[^]","[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]","[\\.]",'[\\"]',Z),"g"),re=new RegExp(t("[^]",H,"[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"),"g"),ne=re;function ie(e){var t=T(e);return t.match(X)?t:e}var oe={scheme:"mailto",parse:function(e,t){var r=e,n=r.to=r.path?r.path.split(","):[];if(r.path=void 0,r.query){for(var i=!1,o={},a=r.query.split("&"),s=0,u=a.length;s<u;++s){var c=a[s].split("=");switch(c[0]){case"to":for(var l=c[1].split(","),f=0,d=l.length;f<d;++f)n.push(l[f]);break;case"subject":r.subject=U(c[1],t);break;case"body":r.body=U(c[1],t);break;default:i=!0,o[U(c[0],t)]=U(c[1],t)}}i&&(r.headers=o)}r.query=void 0;for(var p=0,h=n.length;p<h;++p){var y=n[p].split("@");if(y[0]=U(y[0]),t.unicodeSupport)y[1]=U(y[1],t).toLowerCase();else try{y[1]=E.toASCII(U(y[1],t).toLowerCase())}catch(e){r.error=r.error||"Email address's domain name can not be converted to ASCII via punycode: "+e}n[p]=y.join("@")}return r},serialize:function(e,t){var r,n=e,o=null!=(r=e.to)?r instanceof Array?r:"number"!=typeof r.length||r.split||r.setInterval||r.call?[r]:Array.prototype.slice.call(r):[];if(o){for(var a=0,s=o.length;a<s;++a){var u=String(o[a]),c=u.lastIndexOf("@"),l=u.slice(0,c).replace(ee,ie).replace(ee,i).replace(te,P),f=u.slice(c+1);try{f=t.iri?E.toUnicode(f):E.toASCII(U(f,t).toLowerCase())}catch(e){n.error=n.error||"Email address's domain name can not be converted to "+(t.iri?"Unicode":"ASCII")+" via punycode: "+e}o[a]=l+"@"+f}n.path=o.join(",")}var d=e.headers=e.headers||{};e.subject&&(d.subject=e.subject),e.body&&(d.body=e.body);var p=[];for(var h in d)d[h]!==K[h]&&p.push(h.replace(ee,ie).replace(ee,i).replace(re,P)+"="+d[h].replace(ee,ie).replace(ee,i).replace(ne,P));return p.length&&(n.query=p.join("&")),n}},ae=/^([^\:]+)\:(.*)/,se={scheme:"urn",parse:function(e,t){var r=e.path&&e.path.match(ae),n=e;if(r){var i=t.scheme||n.scheme||"urn",o=r[1].toLowerCase(),a=r[2],s=i+":"+(t.nid||o),u=I[s];n.nid=o,n.nss=a,n.path=void 0,u&&(n=u.parse(n,t))}else n.error=n.error||"URN can not be parsed.";return n},serialize:function(e,t){var r=t.scheme||e.scheme||"urn",n=e.nid,i=r+":"+(t.nid||n),o=I[i];o&&(e=o.serialize(e,t));var a=e,s=e.nss;return a.path=(n||t.nid)+":"+s,a}},ue=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,ce={scheme:"urn:uuid",parse:function(e,t){var r=e;return r.uuid=r.nss,r.nss=void 0,t.tolerant||r.uuid&&r.uuid.match(ue)||(r.error=r.error||"UUID is not valid."),r},serialize:function(e,t){var r=e;return r.nss=(e.uuid||"").toLowerCase(),r}};I[Q.scheme]=Q,I[z.scheme]=z,I[W.scheme]=W,I[Y.scheme]=Y,I[oe.scheme]=oe,I[se.scheme]=se,I[ce.scheme]=ce,e.SCHEMES=I,e.pctEncChar=P,e.pctDecChars=T,e.parse=D,e.removeDotSegments=q,e.serialize=L,e.resolveComponents=V,e.resolve=function(e,t,r){var n=function(e,t){var r=e;if(t)for(var n in t)r[n]=t[n];return r}({scheme:"null"},r);return L(V(D(e,n),D(t,n),n,!0),n)},e.normalize=function(e,t){return"string"==typeof e?e=L(D(e,t),t):"object"===n(e)&&(e=D(L(e,t),t)),e},e.equal=function(e,t,r){return"string"==typeof e?e=L(D(e,r),r):"object"===n(e)&&(e=L(e,r)),"string"==typeof t?t=L(D(t,r),r):"object"===n(t)&&(t=L(t,r)),e===t},e.escapeComponent=function(e,t){return e&&e.toString().replace(t&&t.iri?s.ESCAPE:a.ESCAPE,P)},e.unescapeComponent=U,Object.defineProperty(e,"__esModule",{value:!0})}(t)},9031:e=>{"use strict";e.exports=require("cross-fetch")},8087:e=>{"use strict";e.exports=require("socket.io-client")},2948:(e,t,r)=>{"use strict";r.r(t),r.d(t,{ApolloCache:()=>xn,ApolloClient:()=>An,ApolloError:()=>br,ApolloLink:()=>_e,Cache:()=>Tn,HttpLink:()=>wt,InMemoryCache:()=>Ai,MissingFieldError:()=>kn,NetworkStatus:()=>mr,Observable:()=>Y,ObservableQuery:()=>Pr,checkFetcher:()=>Ge,concat:()=>Ni,createHttpLink:()=>Ot,createSignalIfSupported:()=>mt,defaultDataIdFromObject:()=>Rn,defaultPrinter:()=>ht,disableExperimentalFragmentVariables:()=>Po,disableFragmentWarnings:()=>Eo,empty:()=>xi,enableExperimentalFragmentVariables:()=>Io,execute:()=>Oe,fallbackHttpConfig:()=>pt,from:()=>ki,fromError:()=>gt,fromPromise:()=>Ri,gql:()=>wo,isApolloError:()=>vr,isReference:()=>X,makeReference:()=>Z,makeVar:()=>mn,mergeOptions:()=>Pn,parseAndCheckHttpResponse:()=>He,resetCaches:()=>So,rewriteURIForGET:()=>bt,selectHttpOptionsAndBody:()=>yt,selectHttpOptionsAndBodyInternal:()=>vt,selectURI:()=>Fe,serializeFetchParameter:()=>Ce,setLogVerbosity:()=>d,split:()=>Mi,throwServerError:()=>ze,toPromise:()=>Di});var n=r(9312),i="Invariant Violation",o=Object.setPrototypeOf,a=void 0===o?function(e,t){return e.__proto__=t,e}:o,s=function(e){function t(r){void 0===r&&(r=i);var n=e.call(this,"number"==typeof r?i+": "+r+" (see https://github.com/apollographql/invariant-packages)":r)||this;return n.framesToPop=1,n.name=i,a(n,t.prototype),n}return(0,n.__extends)(t,e),t}(Error);function u(e,t){if(!e)throw new s(t)}var c=["debug","log","warn","error","silent"],l=c.indexOf("log");function f(e){return function(){if(c.indexOf(e)>=l)return(console[e]||console.log).apply(console,arguments)}}function d(e){var t=c[l];return l=Math.max(0,c.indexOf(e)),t}function p(e){try{return e()}catch(e){}}!function(e){e.debug=f("debug"),e.log=f("log"),e.warn=f("warn"),e.error=f("error")}(u||(u={}));const h=p((function(){return globalThis}))||p((function(){return window}))||p((function(){return self}))||p((function(){return global}))||p((function(){return p.constructor("return this")()}));var y="__",v=[y,y].join("DEV");const m=function(){try{return Boolean(__DEV__)}catch(e){return Object.defineProperty(h,v,{value:"production"!==p((function(){return"production"})),enumerable:!1,configurable:!0,writable:!0}),h[v]}}();function b(e){try{return e()}catch(e){}}var g=b((function(){return globalThis}))||b((function(){return window}))||b((function(){return self}))||b((function(){return global}))||b((function(){return b.constructor("return this")()})),_=!1;function O(e,t){if(!Boolean(e))throw new Error(t)}!g||b((function(){return"production"}))||b((function(){return process}))||(Object.defineProperty(g,"process",{value:{env:{NODE_ENV:"production"}},configurable:!0,enumerable:!1,writable:!0}),_=!0);const w=10,S=2;function E(e){return I(e,[])}function I(e,t){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return function(e,t){if(null===e)return"null";if(t.includes(e))return"[Circular]";const r=[...t,e];if(function(e){return"function"==typeof e.toJSON}(e)){const t=e.toJSON();if(t!==e)return"string"==typeof t?t:I(t,r)}else if(Array.isArray(e))return function(e,t){if(0===e.length)return"[]";if(t.length>S)return"[Array]";const r=Math.min(w,e.length),n=e.length-r,i=[];for(let n=0;n<r;++n)i.push(I(e[n],t));return 1===n?i.push("... 1 more item"):n>1&&i.push(`... ${n} more items`),"["+i.join(", ")+"]"}(e,r);return function(e,t){const r=Object.entries(e);if(0===r.length)return"{}";if(t.length>S)return"["+function(e){const t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){const t=e.constructor.name;if("string"==typeof t&&""!==t)return t}return t}(e)+"]";const n=r.map((([e,r])=>e+": "+I(r,t)));return"{ "+n.join(", ")+" }"}(e,r)}(e,t);default:return String(e)}}class P{constructor(e,t="GraphQL request",r={line:1,column:1}){"string"==typeof e||O(!1,`Body must be a string. Received: ${E(e)}.`),this.body=e,this.name=t,this.locationOffset=r,this.locationOffset.line>0||O(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||O(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}function T(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function j(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function A(e,t,r){return t&&j(e.prototype,t),r&&j(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}_&&(delete g.process,_=!1),__DEV__?u("boolean"==typeof m,m):u("boolean"==typeof m,39);var x=function(){return"function"==typeof Symbol},k=function(e){return x()&&Boolean(Symbol[e])},M=function(e){return k(e)?Symbol[e]:"@@"+e};x()&&!k("observable")&&(Symbol.observable=Symbol("observable"));var N=M("iterator"),D=M("observable"),R=M("species");function C(e,t){var r=e[t];if(null!=r){if("function"!=typeof r)throw new TypeError(r+" is not a function");return r}}function F(e){var t=e.constructor;return void 0!==t&&null===(t=t[R])&&(t=void 0),void 0!==t?t:Y}function $(e){return e instanceof Y}function q(e){q.log?q.log(e):setTimeout((function(){throw e}))}function L(e){Promise.resolve().then((function(){try{e()}catch(e){q(e)}}))}function V(e){var t=e._cleanup;if(void 0!==t&&(e._cleanup=void 0,t))try{if("function"==typeof t)t();else{var r=C(t,"unsubscribe");r&&r.call(t)}}catch(e){q(e)}}function U(e){e._observer=void 0,e._queue=void 0,e._state="closed"}function Q(e,t,r){e._state="running";var n=e._observer;try{var i=C(n,t);switch(t){case"next":i&&i.call(n,r);break;case"error":if(U(e),!i)throw r;i.call(n,r);break;case"complete":U(e),i&&i.call(n)}}catch(e){q(e)}"closed"===e._state?V(e):"running"===e._state&&(e._state="ready")}function z(e,t,r){if("closed"!==e._state){if("buffering"!==e._state)return"ready"!==e._state?(e._state="buffering",e._queue=[{type:t,value:r}],void L((function(){return function(e){var t=e._queue;if(t){e._queue=void 0,e._state="ready";for(var r=0;r<t.length&&(Q(e,t[r].type,t[r].value),"closed"!==e._state);++r);}}(e)}))):void Q(e,t,r);e._queue.push({type:t,value:r})}}var B=function(){function e(e,t){this._cleanup=void 0,this._observer=e,this._queue=void 0,this._state="initializing";var r=new W(this);try{this._cleanup=t.call(void 0,r)}catch(e){r.error(e)}"initializing"===this._state&&(this._state="ready")}return e.prototype.unsubscribe=function(){"closed"!==this._state&&(U(this),V(this))},A(e,[{key:"closed",get:function(){return"closed"===this._state}}]),e}(),W=function(){function e(e){this._subscription=e}var t=e.prototype;return t.next=function(e){z(this._subscription,"next",e)},t.error=function(e){z(this._subscription,"error",e)},t.complete=function(){z(this._subscription,"complete")},A(e,[{key:"closed",get:function(){return"closed"===this._subscription._state}}]),e}(),Y=function(){function e(t){if(!(this instanceof e))throw new TypeError("Observable cannot be called as a function");if("function"!=typeof t)throw new TypeError("Observable initializer must be a function");this._subscriber=t}var t=e.prototype;return t.subscribe=function(e){return"object"==typeof e&&null!==e||(e={next:e,error:arguments[1],complete:arguments[2]}),new B(e,this._subscriber)},t.forEach=function(e){var t=this;return new Promise((function(r,n){if("function"==typeof e)var i=t.subscribe({next:function(t){try{e(t,o)}catch(e){n(e),i.unsubscribe()}},error:n,complete:r});else n(new TypeError(e+" is not a function"));function o(){i.unsubscribe(),r()}}))},t.map=function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(F(this))((function(r){return t.subscribe({next:function(t){try{t=e(t)}catch(e){return r.error(e)}r.next(t)},error:function(e){r.error(e)},complete:function(){r.complete()}})}))},t.filter=function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(F(this))((function(r){return t.subscribe({next:function(t){try{if(!e(t))return}catch(e){return r.error(e)}r.next(t)},error:function(e){r.error(e)},complete:function(){r.complete()}})}))},t.reduce=function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");var r=F(this),n=arguments.length>1,i=!1,o=arguments[1];return new r((function(r){return t.subscribe({next:function(t){var a=!i;if(i=!0,!a||n)try{o=e(o,t)}catch(e){return r.error(e)}else o=t},error:function(e){r.error(e)},complete:function(){if(!i&&!n)return r.error(new TypeError("Cannot reduce an empty sequence"));r.next(o),r.complete()}})}))},t.concat=function(){for(var e=this,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var i=F(this);return new i((function(t){var n,o=0;return function e(a){n=a.subscribe({next:function(e){t.next(e)},error:function(e){t.error(e)},complete:function(){o===r.length?(n=void 0,t.complete()):e(i.from(r[o++]))}})}(e),function(){n&&(n.unsubscribe(),n=void 0)}}))},t.flatMap=function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");var r=F(this);return new r((function(n){var i=[],o=t.subscribe({next:function(t){if(e)try{t=e(t)}catch(e){return n.error(e)}var o=r.from(t).subscribe({next:function(e){n.next(e)},error:function(e){n.error(e)},complete:function(){var e=i.indexOf(o);e>=0&&i.splice(e,1),a()}});i.push(o)},error:function(e){n.error(e)},complete:function(){a()}});function a(){o.closed&&0===i.length&&n.complete()}return function(){i.forEach((function(e){return e.unsubscribe()})),o.unsubscribe()}}))},t[D]=function(){return this},e.from=function(t){var r="function"==typeof this?this:e;if(null==t)throw new TypeError(t+" is not an object");var n=C(t,D);if(n){var i=n.call(t);if(Object(i)!==i)throw new TypeError(i+" is not an object");return $(i)&&i.constructor===r?i:new r((function(e){return i.subscribe(e)}))}if(k("iterator")&&(n=C(t,N)))return new r((function(e){L((function(){if(!e.closed){for(var r,i=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return T(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?T(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(n.call(t));!(r=i()).done;){var o=r.value;if(e.next(o),e.closed)return}e.complete()}}))}));if(Array.isArray(t))return new r((function(e){L((function(){if(!e.closed){for(var r=0;r<t.length;++r)if(e.next(t[r]),e.closed)return;e.complete()}}))}));throw new TypeError(t+" is not observable")},e.of=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return new("function"==typeof this?this:e)((function(e){L((function(){if(!e.closed){for(var t=0;t<r.length;++t)if(e.next(r[t]),e.closed)return;e.complete()}}))}))},A(e,null,[{key:R,get:function(){return this}}]),e}();function K(e){return null!==e&&"object"==typeof e}function H(e,t){var r=t,i=[];return e.definitions.forEach((function(e){if("OperationDefinition"===e.kind)throw __DEV__?new s("Found a ".concat(e.operation," operation").concat(e.name?" named '".concat(e.name.value,"'"):"",". ")+"No operations are allowed when using a fragment as a query. Only fragments are allowed."):new s(44);"FragmentDefinition"===e.kind&&i.push(e)})),void 0===r&&(__DEV__?u(1===i.length,"Found ".concat(i.length," fragments. `fragmentName` must be provided when there is not exactly 1 fragment.")):u(1===i.length,45),r=i[0].name.value),(0,n.__assign)((0,n.__assign)({},e),{definitions:(0,n.__spreadArray)([{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:r}}]}}],e.definitions,!0)})}function G(e){void 0===e&&(e=[]);var t={};return e.forEach((function(e){t[e.name.value]=e})),t}function J(e,t){switch(e.kind){case"InlineFragment":return e;case"FragmentSpread":var r=e.name.value;if("function"==typeof t)return t(r);var n=t&&t[r];return __DEV__?u(n,"No fragment named ".concat(r)):u(n,46),n||null;default:return null}}function Z(e){return{__ref:String(e)}}function X(e){return Boolean(e&&"object"==typeof e&&"string"==typeof e.__ref)}function ee(e,t,r,n){if(function(e){return"IntValue"===e.kind}(r)||function(e){return"FloatValue"===e.kind}(r))e[t.value]=Number(r.value);else if(function(e){return"BooleanValue"===e.kind}(r)||function(e){return"StringValue"===e.kind}(r))e[t.value]=r.value;else if(function(e){return"ObjectValue"===e.kind}(r)){var i={};r.fields.map((function(e){return ee(i,e.name,e.value,n)})),e[t.value]=i}else if(function(e){return"Variable"===e.kind}(r)){var o=(n||{})[r.name.value];e[t.value]=o}else if(function(e){return"ListValue"===e.kind}(r))e[t.value]=r.values.map((function(e){var r={};return ee(r,t,e,n),r[t.value]}));else if(function(e){return"EnumValue"===e.kind}(r))e[t.value]=r.value;else{if(!function(e){return"NullValue"===e.kind}(r))throw __DEV__?new s('The inline argument "'.concat(t.value,'" of kind "').concat(r.kind,'"')+"is not supported. Use variables instead of inline arguments to overcome this limitation."):new s(55);e[t.value]=null}}x()&&Object.defineProperty(Y,Symbol("extensions"),{value:{symbol:D,hostReportError:q},configurable:!0});var te=["connection","include","skip","client","rest","export"],re=Object.assign((function(e,t,r){if(t&&r&&r.connection&&r.connection.key){if(r.connection.filter&&r.connection.filter.length>0){var n=r.connection.filter?r.connection.filter:[];n.sort();var i={};return n.forEach((function(e){i[e]=t[e]})),"".concat(r.connection.key,"(").concat(ne(i),")")}return r.connection.key}var o=e;if(t){var a=ne(t);o+="(".concat(a,")")}return r&&Object.keys(r).forEach((function(e){-1===te.indexOf(e)&&(r[e]&&Object.keys(r[e]).length?o+="@".concat(e,"(").concat(ne(r[e]),")"):o+="@".concat(e))})),o}),{setStringify:function(e){var t=ne;return ne=e,t}}),ne=function(e){return JSON.stringify(e,ie)};function ie(e,t){return K(t)&&!Array.isArray(t)&&(t=Object.keys(t).sort().reduce((function(e,r){return e[r]=t[r],e}),{})),t}function oe(e,t){if(e.arguments&&e.arguments.length){var r={};return e.arguments.forEach((function(e){var n=e.name,i=e.value;return ee(r,n,i,t)})),r}return null}function ae(e){return e.alias?e.alias.value:e.name.value}function se(e,t,r){if("string"==typeof e.__typename)return e.__typename;for(var n=0,i=t.selections;n<i.length;n++){var o=i[n];if(ue(o)){if("__typename"===o.name.value)return e[ae(o)]}else{var a=se(e,J(o,r).selectionSet,r);if("string"==typeof a)return a}}}function ue(e){return"Field"===e.kind}function ce(e){__DEV__?u(e&&"Document"===e.kind,'Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a "gql" tag? http://docs.apollostack.com/apollo-client/core.html#gql'):u(e&&"Document"===e.kind,47);var t=e.definitions.filter((function(e){return"FragmentDefinition"!==e.kind})).map((function(e){if("OperationDefinition"!==e.kind)throw __DEV__?new s('Schema type definitions not allowed in queries. Found: "'.concat(e.kind,'"')):new s(48);return e}));return __DEV__?u(t.length<=1,"Ambiguous GraphQL document: contains ".concat(t.length," operations")):u(t.length<=1,49),e}function le(e){return ce(e),e.definitions.filter((function(e){return"OperationDefinition"===e.kind}))[0]}function fe(e){return e.definitions.filter((function(e){return"OperationDefinition"===e.kind&&e.name})).map((function(e){return e.name.value}))[0]||null}function de(e){return e.definitions.filter((function(e){return"FragmentDefinition"===e.kind}))}function pe(e){var t=le(e);return __DEV__?u(t&&"query"===t.operation,"Must contain a query definition."):u(t&&"query"===t.operation,50),t}function he(e){var t;ce(e);for(var r=0,n=e.definitions;r<n.length;r++){var i=n[r];if("OperationDefinition"===i.kind){var o=i.operation;if("query"===o||"mutation"===o||"subscription"===o)return i}"FragmentDefinition"!==i.kind||t||(t=i)}if(t)return t;throw __DEV__?new s("Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment."):new s(54)}function ye(e){var t=Object.create(null),r=e&&e.variableDefinitions;return r&&r.length&&r.forEach((function(e){e.defaultValue&&ee(t,e.variable.name,e.defaultValue)})),t}function ve(e,t){return t?t(e):Y.of()}function me(e){return"function"==typeof e?new _e(e):e}function be(e){return e.request.length<=1}var ge=function(e){function t(t,r){var n=e.call(this,t)||this;return n.link=r,n}return(0,n.__extends)(t,e),t}(Error),_e=function(){function e(e){e&&(this.request=e)}return e.empty=function(){return new e((function(){return Y.of()}))},e.from=function(t){return 0===t.length?e.empty():t.map(me).reduce((function(e,t){return e.concat(t)}))},e.split=function(t,r,n){var i=me(r),o=me(n||new e(ve));return be(i)&&be(o)?new e((function(e){return t(e)?i.request(e)||Y.of():o.request(e)||Y.of()})):new e((function(e,r){return t(e)?i.request(e,r)||Y.of():o.request(e,r)||Y.of()}))},e.execute=function(e,t){return e.request(function(e,t){var r=(0,n.__assign)({},e);return Object.defineProperty(t,"setContext",{enumerable:!1,value:function(e){r="function"==typeof e?(0,n.__assign)((0,n.__assign)({},r),e(r)):(0,n.__assign)((0,n.__assign)({},r),e)}}),Object.defineProperty(t,"getContext",{enumerable:!1,value:function(){return(0,n.__assign)({},r)}}),t}(t.context,function(e){var t={variables:e.variables||{},extensions:e.extensions||{},operationName:e.operationName,query:e.query};return t.operationName||(t.operationName="string"!=typeof t.query?fe(t.query)||void 0:""),t}(function(e){for(var t=["query","operationName","variables","extensions","context"],r=0,n=Object.keys(e);r<n.length;r++){var i=n[r];if(t.indexOf(i)<0)throw __DEV__?new s("illegal argument: ".concat(i)):new s(27)}return e}(t))))||Y.of()},e.concat=function(t,r){var n=me(t);if(be(n))return __DEV__&&u.warn(new ge("You are calling concat on a terminating link, which will have no effect",n)),n;var i=me(r);return be(i)?new e((function(e){return n.request(e,(function(e){return i.request(e)||Y.of()}))||Y.of()})):new e((function(e,t){return n.request(e,(function(e){return i.request(e,t)||Y.of()}))||Y.of()}))},e.prototype.split=function(t,r,n){return this.concat(e.split(t,r,n||new e(ve)))},e.prototype.concat=function(t){return e.concat(this,t)},e.prototype.request=function(e,t){throw __DEV__?new s("request is not implemented"):new s(22)},e.prototype.onError=function(e,t){if(t&&t.error)return t.error(e),!1;throw e},e.prototype.setOnError=function(e){return this.onError=e,this},e}(),Oe=_e.execute;class we{constructor(e,t,r){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=r}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}}class Se{constructor(e,t,r,n,i,o){this.kind=e,this.start=t,this.end=r,this.line=n,this.column=i,this.value=o,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}}}const Ee={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]},Ie=new Set(Object.keys(Ee));function Pe(e){const t=null==e?void 0:e.kind;return"string"==typeof t&&Ie.has(t)}var Te,je,Ae;!function(e){e.QUERY="query",e.MUTATION="mutation",e.SUBSCRIPTION="subscription"}(Te||(Te={})),(Ae=je||(je={})).NAME="Name",Ae.DOCUMENT="Document",Ae.OPERATION_DEFINITION="OperationDefinition",Ae.VARIABLE_DEFINITION="VariableDefinition",Ae.SELECTION_SET="SelectionSet",Ae.FIELD="Field",Ae.ARGUMENT="Argument",Ae.FRAGMENT_SPREAD="FragmentSpread",Ae.INLINE_FRAGMENT="InlineFragment",Ae.FRAGMENT_DEFINITION="FragmentDefinition",Ae.VARIABLE="Variable",Ae.INT="IntValue",Ae.FLOAT="FloatValue",Ae.STRING="StringValue",Ae.BOOLEAN="BooleanValue",Ae.NULL="NullValue",Ae.ENUM="EnumValue",Ae.LIST="ListValue",Ae.OBJECT="ObjectValue",Ae.OBJECT_FIELD="ObjectField",Ae.DIRECTIVE="Directive",Ae.NAMED_TYPE="NamedType",Ae.LIST_TYPE="ListType",Ae.NON_NULL_TYPE="NonNullType",Ae.SCHEMA_DEFINITION="SchemaDefinition",Ae.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",Ae.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",Ae.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",Ae.FIELD_DEFINITION="FieldDefinition",Ae.INPUT_VALUE_DEFINITION="InputValueDefinition",Ae.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",Ae.UNION_TYPE_DEFINITION="UnionTypeDefinition",Ae.ENUM_TYPE_DEFINITION="EnumTypeDefinition",Ae.ENUM_VALUE_DEFINITION="EnumValueDefinition",Ae.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",Ae.DIRECTIVE_DEFINITION="DirectiveDefinition",Ae.SCHEMA_EXTENSION="SchemaExtension",Ae.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",Ae.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",Ae.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",Ae.UNION_TYPE_EXTENSION="UnionTypeExtension",Ae.ENUM_TYPE_EXTENSION="EnumTypeExtension",Ae.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension";const xe=Object.freeze({});function ke(e,t,r=Ee){const n=new Map;for(const e of Object.values(je))n.set(e,Me(t,e));let i,o,a,s=Array.isArray(e),u=[e],c=-1,l=[],f=e;const d=[],p=[];do{c++;const e=c===u.length,m=e&&0!==l.length;if(e){if(o=0===p.length?void 0:d[d.length-1],f=a,a=p.pop(),m)if(s){f=f.slice();let e=0;for(const[t,r]of l){const n=t-e;null===r?(f.splice(n,1),e++):f[n]=r}}else{f=Object.defineProperties({},Object.getOwnPropertyDescriptors(f));for(const[e,t]of l)f[e]=t}c=i.index,u=i.keys,l=i.edits,s=i.inArray,i=i.prev}else if(a){if(o=s?c:u[c],f=a[o],null==f)continue;d.push(o)}let b;if(!Array.isArray(f)){var h,y;Pe(f)||O(!1,`Invalid AST Node: ${E(f)}.`);const r=e?null===(h=n.get(f.kind))||void 0===h?void 0:h.leave:null===(y=n.get(f.kind))||void 0===y?void 0:y.enter;if(b=null==r?void 0:r.call(t,f,o,a,d,p),b===xe)break;if(!1===b){if(!e){d.pop();continue}}else if(void 0!==b&&(l.push([o,b]),!e)){if(!Pe(b)){d.pop();continue}f=b}}var v;void 0===b&&m&&l.push([o,f]),e?d.pop():(i={inArray:s,index:c,keys:u,edits:l,prev:i},s=Array.isArray(f),u=s?f:null!==(v=r[f.kind])&&void 0!==v?v:[],c=-1,l=[],a&&p.push(a),a=f)}while(void 0!==i);return 0!==l.length?l[l.length-1][1]:e}function Me(e,t){const r=e[t];return"object"==typeof r?r:"function"==typeof r?{enter:r,leave:void 0}:{enter:e.enter,leave:e.leave}}function Ne(e,t){var r=e.directives;return!r||!r.length||function(e){var t=[];return e&&e.length&&e.forEach((function(e){if(function(e){var t=e.name.value;return"skip"===t||"include"===t}(e)){var r=e.arguments,n=e.name.value;__DEV__?u(r&&1===r.length,"Incorrect number of arguments for the @".concat(n," directive.")):u(r&&1===r.length,41);var i=r[0];__DEV__?u(i.name&&"if"===i.name.value,"Invalid argument for the @".concat(n," directive.")):u(i.name&&"if"===i.name.value,42);var o=i.value;__DEV__?u(o&&("Variable"===o.kind||"BooleanValue"===o.kind),"Argument for the @".concat(n," directive must be a variable or a boolean value.")):u(o&&("Variable"===o.kind||"BooleanValue"===o.kind),43),t.push({directive:e,ifArgument:i})}})),t}(r).every((function(e){var r=e.directive,n=e.ifArgument,i=!1;return"Variable"===n.value.kind?(i=t&&t[n.value.name.value],__DEV__?u(void 0!==i,"Invalid variable referenced in @".concat(r.name.value," directive.")):u(void 0!==i,40)):i=n.value.value,"skip"===r.name.value?!i:i}))}function De(e,t,r){var n=new Set(e),i=n.size;return ke(t,{Directive:function(e){if(n.delete(e.name.value)&&(!r||!n.size))return xe}}),r?!n.size:n.size<i}function Re(e){return e&&De(["client","export"],e,!0)}var Ce=function(e,t){var r;try{r=JSON.stringify(e)}catch(e){var n=__DEV__?new s("Network request failed. ".concat(t," is not serializable: ").concat(e.message)):new s(24);throw n.parseError=e,n}return r},Fe=function(e,t){return e.getContext().uri||("function"==typeof t?t(e):t||"/graphql")},$e="function"==typeof WeakMap&&"ReactNative"!==p((function(){return navigator.product})),qe="function"==typeof WeakSet,Le="function"==typeof Symbol&&"function"==typeof Symbol.for,Ve=Le&&Symbol.asyncIterator;function Ue(e){var t={next:function(){return e.read()}};return Ve&&(t[Symbol.asyncIterator]=function(){return this}),t}function Qe(e){var t,r,n,i,o=e;if(e.body&&(o=e.body),i=o,Ve&&i[Symbol.asyncIterator])return function(e){var t,r=e[Symbol.asyncIterator]();return(t={next:function(){return r.next()}})[Symbol.asyncIterator]=function(){return this},t}(o);if(function(e){return!!e.getReader}(o))return Ue(o.getReader());if(function(e){return!!e.stream}(o))return Ue(o.stream().getReader());if(function(e){return!!e.arrayBuffer}(o))return t=o.arrayBuffer(),r=!1,n={next:function(){return r?Promise.resolve({value:void 0,done:!0}):(r=!0,new Promise((function(e,r){t.then((function(t){e({value:t,done:!1})})).catch(r)})))}},Ve&&(n[Symbol.asyncIterator]=function(){return this}),n;if(function(e){return!!e.pipe}(o))return function(e){var t=null,r=null,n=!1,i=[],o=[];function a(e){if(!r){if(o.length){var t=o.shift();if(Array.isArray(t)&&t[0])return t[0]({value:e,done:!1})}i.push(e)}}function s(e){r=e,o.slice().forEach((function(t){t[1](e)})),!t||t()}function u(){n=!0,o.slice().forEach((function(e){e[0]({value:void 0,done:!0})})),!t||t()}t=function(){t=null,e.removeListener("data",a),e.removeListener("error",s),e.removeListener("end",u),e.removeListener("finish",u),e.removeListener("close",u)},e.on("data",a),e.on("error",s),e.on("end",u),e.on("finish",u),e.on("close",u);var c={next:function(){return new Promise((function(e,t){return r?t(r):i.length?e({value:i.shift(),done:!1}):n?e({value:void 0,done:!0}):void o.push([e,t])}))}};return Ve&&(c[Symbol.asyncIterator]=function(){return this}),c}(o);throw new Error("Unknown body type for responseIterator. Please pass a streamable response.")}p((function(){return window.document.createElement})),p((function(){return navigator.userAgent.indexOf("jsdom")>=0}));var ze=function(e,t,r){var n=new Error(r);throw n.name="ServerError",n.response=e,n.statusCode=e.status,n.result=t,n},Be=Object.prototype.hasOwnProperty;function We(e){var t={};return e.split("\n").forEach((function(e){var r=e.indexOf(":");if(r>-1){var n=e.slice(0,r).trim().toLowerCase(),i=e.slice(r+1).trim();t[n]=i}})),t}function Ye(e,t){e.status>=300&&ze(e,function(){try{return JSON.parse(t)}catch(e){return t}}(),"Response not successful: Received status code ".concat(e.status));try{return JSON.parse(t)}catch(n){var r=n;throw r.name="ServerParseError",r.response=e,r.statusCode=e.status,r.bodyText=t,r}}function Ke(e,t){var r,n;"AbortError"!==e.name&&(e.result&&e.result.errors&&e.result.data&&(null===(r=t.next)||void 0===r||r.call(t,e.result)),null===(n=t.error)||void 0===n||n.call(t,e))}function He(e){return function(t){return t.text().then((function(e){return Ye(t,e)})).then((function(r){return t.status>=300&&ze(t,r,"Response not successful: Received status code ".concat(t.status)),Array.isArray(r)||Be.call(r,"data")||Be.call(r,"errors")||ze(t,r,"Server response was missing for query '".concat(Array.isArray(e)?e.map((function(e){return e.operationName})):e.operationName,"'.")),r}))}}var Ge=function(e){if(!e&&"undefined"==typeof fetch)throw __DEV__?new s("\n\"fetch\" has not been found globally and no fetcher has been configured. To fix this, install a fetch package (like https://www.npmjs.com/package/cross-fetch), instantiate the fetcher, and pass it into your HttpLink constructor. For example:\n\nimport fetch from 'cross-fetch';\nimport { ApolloClient, HttpLink } from '@apollo/client';\nconst client = new ApolloClient({\n link: new HttpLink({ uri: '/graphql', fetch })\n});\n "):new s(23)};function Je(e){return 9===e||32===e}function Ze(e){return e>=48&&e<=57}function Xe(e){return e>=97&&e<=122||e>=65&&e<=90}function et(e){return Xe(e)||95===e}function tt(e){var t;let r=Number.MAX_SAFE_INTEGER,n=null,i=-1;for(let t=0;t<e.length;++t){var o;const a=e[t],s=rt(a);s!==a.length&&(n=null!==(o=n)&&void 0!==o?o:t,i=t,0!==t&&s<r&&(r=s))}return e.map(((e,t)=>0===t?e:e.slice(r))).slice(null!==(t=n)&&void 0!==t?t:0,i+1)}function rt(e){let t=0;for(;t<e.length&&Je(e.charCodeAt(t));)++t;return t}const nt=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function it(e){return ot[e.charCodeAt(0)]}const ot=["\\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"];function at(e){return ke(e,st)}const st={Name:{leave:e=>e.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>ut(e.definitions,"\n\n")},OperationDefinition:{leave(e){const t=lt("(",ut(e.variableDefinitions,", "),")"),r=ut([e.operation,ut([e.name,t]),ut(e.directives," ")]," ");return("query"===r?"":r+" ")+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:r,directives:n})=>e+": "+t+lt(" = ",r)+lt(" ",ut(n," "))},SelectionSet:{leave:({selections:e})=>ct(e)},Field:{leave({alias:e,name:t,arguments:r,directives:n,selectionSet:i}){const o=lt("",e,": ")+t;let a=o+lt("(",ut(r,", "),")");return a.length>80&&(a=o+lt("(\n",ft(ut(r,"\n")),"\n)")),ut([a,ut(n," "),i]," ")}},Argument:{leave:({name:e,value:t})=>e+": "+t},FragmentSpread:{leave:({name:e,directives:t})=>"..."+e+lt(" ",ut(t," "))},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:r})=>ut(["...",lt("on ",e),ut(t," "),r]," ")},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:r,directives:n,selectionSet:i})=>`fragment ${e}${lt("(",ut(r,", "),")")} on ${t} ${lt("",ut(n," ")," ")}`+i},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>t?function(e,t){const r=e.replace(/"""/g,'\\"""'),n=r.split(/\r\n|[\n\r]/g),i=1===n.length,o=n.length>1&&n.slice(1).every((e=>0===e.length||Je(e.charCodeAt(0)))),a=r.endsWith('\\"""'),s=e.endsWith('"')&&!a,u=e.endsWith("\\"),c=s||u,l=!i||e.length>70||c||o||a;let f="";const d=i&&Je(e.charCodeAt(0));return(l&&!d||o)&&(f+="\n"),f+=r,(l||c)&&(f+="\n"),'"""'+f+'"""'}(e):`"${e.replace(nt,it)}"`},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>"["+ut(e,", ")+"]"},ObjectValue:{leave:({fields:e})=>"{"+ut(e,", ")+"}"},ObjectField:{leave:({name:e,value:t})=>e+": "+t},Directive:{leave:({name:e,arguments:t})=>"@"+e+lt("(",ut(t,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({description:e,directives:t,operationTypes:r})=>lt("",e,"\n")+ut(["schema",ut(t," "),ct(r)]," ")},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+": "+t},ScalarTypeDefinition:{leave:({description:e,name:t,directives:r})=>lt("",e,"\n")+ut(["scalar",t,ut(r," ")]," ")},ObjectTypeDefinition:{leave:({description:e,name:t,interfaces:r,directives:n,fields:i})=>lt("",e,"\n")+ut(["type",t,lt("implements ",ut(r," & ")),ut(n," "),ct(i)]," ")},FieldDefinition:{leave:({description:e,name:t,arguments:r,type:n,directives:i})=>lt("",e,"\n")+t+(dt(r)?lt("(\n",ft(ut(r,"\n")),"\n)"):lt("(",ut(r,", "),")"))+": "+n+lt(" ",ut(i," "))},InputValueDefinition:{leave:({description:e,name:t,type:r,defaultValue:n,directives:i})=>lt("",e,"\n")+ut([t+": "+r,lt("= ",n),ut(i," ")]," ")},InterfaceTypeDefinition:{leave:({description:e,name:t,interfaces:r,directives:n,fields:i})=>lt("",e,"\n")+ut(["interface",t,lt("implements ",ut(r," & ")),ut(n," "),ct(i)]," ")},UnionTypeDefinition:{leave:({description:e,name:t,directives:r,types:n})=>lt("",e,"\n")+ut(["union",t,ut(r," "),lt("= ",ut(n," | "))]," ")},EnumTypeDefinition:{leave:({description:e,name:t,directives:r,values:n})=>lt("",e,"\n")+ut(["enum",t,ut(r," "),ct(n)]," ")},EnumValueDefinition:{leave:({description:e,name:t,directives:r})=>lt("",e,"\n")+ut([t,ut(r," ")]," ")},InputObjectTypeDefinition:{leave:({description:e,name:t,directives:r,fields:n})=>lt("",e,"\n")+ut(["input",t,ut(r," "),ct(n)]," ")},DirectiveDefinition:{leave:({description:e,name:t,arguments:r,repeatable:n,locations:i})=>lt("",e,"\n")+"directive @"+t+(dt(r)?lt("(\n",ft(ut(r,"\n")),"\n)"):lt("(",ut(r,", "),")"))+(n?" repeatable":"")+" on "+ut(i," | ")},SchemaExtension:{leave:({directives:e,operationTypes:t})=>ut(["extend schema",ut(e," "),ct(t)]," ")},ScalarTypeExtension:{leave:({name:e,directives:t})=>ut(["extend scalar",e,ut(t," ")]," ")},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:r,fields:n})=>ut(["extend type",e,lt("implements ",ut(t," & ")),ut(r," "),ct(n)]," ")},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:r,fields:n})=>ut(["extend interface",e,lt("implements ",ut(t," & ")),ut(r," "),ct(n)]," ")},UnionTypeExtension:{leave:({name:e,directives:t,types:r})=>ut(["extend union",e,ut(t," "),lt("= ",ut(r," | "))]," ")},EnumTypeExtension:{leave:({name:e,directives:t,values:r})=>ut(["extend enum",e,ut(t," "),ct(r)]," ")},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:r})=>ut(["extend input",e,ut(t," "),ct(r)]," ")}};function ut(e,t=""){var r;return null!==(r=null==e?void 0:e.filter((e=>e)).join(t))&&void 0!==r?r:""}function ct(e){return lt("{\n",ft(ut(e,"\n")),"\n}")}function lt(e,t,r=""){return null!=t&&""!==t?e+t+r:""}function ft(e){return lt(" ",e.replace(/\n/g,"\n "))}function dt(e){var t;return null!==(t=null==e?void 0:e.some((e=>e.includes("\n"))))&&void 0!==t&&t}var pt={http:{includeQuery:!0,includeExtensions:!1,preserveHeaderCase:!1},headers:{accept:"*/*","content-type":"application/json"},options:{method:"POST"}},ht=function(e,t){return t(e)};function yt(e,t){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];return r.unshift(t),vt.apply(void 0,(0,n.__spreadArray)([e,ht],r,!1))}function vt(e,t){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];var o={},a={};r.forEach((function(e){o=(0,n.__assign)((0,n.__assign)((0,n.__assign)({},o),e.options),{headers:(0,n.__assign)((0,n.__assign)({},o.headers),e.headers)}),e.credentials&&(o.credentials=e.credentials),a=(0,n.__assign)((0,n.__assign)({},a),e.http)})),o.headers&&(o.headers=function(e,t){if(!t){var r=Object.create(null);return Object.keys(Object(e)).forEach((function(t){r[t.toLowerCase()]=e[t]})),r}var n=Object.create(null);Object.keys(Object(e)).forEach((function(t){n[t.toLowerCase()]={originalName:t,value:e[t]}}));var i=Object.create(null);return Object.keys(n).forEach((function(e){i[n[e].originalName]=n[e].value})),i}(o.headers,a.preserveHeaderCase));var s=e.operationName,u=e.extensions,c=e.variables,l=e.query,f={operationName:s,variables:c};return a.includeExtensions&&(f.extensions=u),a.includeQuery&&(f.query=t(l,at)),{options:o,body:f}}var mt=function(){if("undefined"==typeof AbortController)return{controller:!1,signal:!1};var e=new AbortController;return{controller:e,signal:e.signal}};function bt(e,t){var r=[],n=function(e,t){r.push("".concat(e,"=").concat(encodeURIComponent(t)))};if("query"in t&&n("query",t.query),t.operationName&&n("operationName",t.operationName),t.variables){var i=void 0;try{i=Ce(t.variables,"Variables map")}catch(e){return{parseError:e}}n("variables",i)}if(t.extensions){var o=void 0;try{o=Ce(t.extensions,"Extensions map")}catch(e){return{parseError:e}}n("extensions",o)}var a="",s=e,u=e.indexOf("#");-1!==u&&(a=e.substr(u),s=e.substr(0,u));var c=-1===s.indexOf("?")?"?":"&";return{newURI:s+c+r.join("&")+a}}function gt(e){return new Y((function(t){t.error(e)}))}var _t=p((function(){return fetch})),Ot=function(e){void 0===e&&(e={});var t=e.uri,r=void 0===t?"/graphql":t,i=e.fetch,o=e.print,a=void 0===o?ht:o,s=e.includeExtensions,u=e.preserveHeaderCase,c=e.useGETForQueries,l=e.includeUnusedVariables,f=void 0!==l&&l,d=(0,n.__rest)(e,["uri","fetch","print","includeExtensions","preserveHeaderCase","useGETForQueries","includeUnusedVariables"]);__DEV__&&Ge(i||_t);var h={http:{includeExtensions:s,preserveHeaderCase:u},options:d.fetchOptions,credentials:d.credentials,headers:d.headers};return new _e((function(e){var t=Fe(e,r),o=e.getContext(),s={};if(o.clientAwareness){var u=o.clientAwareness,l=u.name,d=u.version;l&&(s["apollographql-client-name"]=l),d&&(s["apollographql-client-version"]=d)}var y,v=(0,n.__assign)((0,n.__assign)({},s),o.headers),m={http:o.http,options:o.fetchOptions,credentials:o.credentials,headers:v},b=vt(e,a,pt,h,m),g=b.options,_=b.body;if(_.variables&&!f){var O=new Set(Object.keys(_.variables));ke(e.query,{Variable:function(e,t,r){r&&"VariableDefinition"!==r.kind&&O.delete(e.name.value)}}),O.size&&(_.variables=(0,n.__assign)({},_.variables),O.forEach((function(e){delete _.variables[e]})))}if(!g.signal){var w=mt(),S=w.controller,E=w.signal;(y=S)&&(g.signal=E)}if(c&&!e.query.definitions.some((function(e){return"OperationDefinition"===e.kind&&"mutation"===e.operation}))&&(g.method="GET"),De(["defer"],e.query)&&(g.headers=g.headers||{},g.headers.accept="multipart/mixed; deferSpec=20220824, application/json"),"GET"===g.method){var I=bt(t,_),P=I.newURI,T=I.parseError;if(T)return gt(T);t=P}else try{g.body=Ce(_,"Payload")}catch(T){return gt(T)}return new Y((function(r){return(i||p((function(){return fetch}))||_t)(t,g).then((function(t){var i;e.setContext({response:t});var o=null===(i=t.headers)||void 0===i?void 0:i.get("content-type");return null!==o&&/^multipart\/mixed/i.test(o)?function(e,t){var r,i,o;return(0,n.__awaiter)(this,void 0,void 0,(function(){var a,s,u,c,l,f,d,p,h,y,v,m,b,g,_,O,w,S,E,I;return(0,n.__generator)(this,(function(n){switch(n.label){case 0:if(void 0===TextDecoder)throw new Error("TextDecoder must be defined in the environment: please import a polyfill.");a=new TextDecoder("utf-8"),s=null===(r=e.headers)||void 0===r?void 0:r.get("content-type"),u="boundary=",c=(null==s?void 0:s.includes(u))?null==s?void 0:s.substring((null==s?void 0:s.indexOf(u))+9).replace(/['"]/g,"").replace(/\;(.*)/gm,"").trim():"-",l="--".concat(c),f="",d=Qe(e),p=!0,n.label=1;case 1:return p?[4,d.next()]:[3,3];case 2:for(h=n.sent(),y=h.value,v=h.done,m="string"==typeof y?y:a.decode(y),p=!v,b=(f+=m).indexOf(l);b>-1;){if(g=void 0,I=[f.slice(0,b),f.slice(b+l.length)],f=I[1],(g=I[0]).trim()){if(_=g.indexOf("\r\n\r\n"),O=We(g.slice(0,_)),(w=O["content-type"])&&-1===w.toLowerCase().indexOf("application/json"))throw new Error("Unsupported patch content type: application/json is required.");S=g.slice(_);try{E=Ye(e,S.replace("\r\n","")),(Object.keys(E).length>1||"data"in E||"incremental"in E||"errors"in E)&&(null===(i=t.next)||void 0===i||i.call(t,E))}catch(e){Ke(e,t)}}b=f.indexOf(l)}return[3,1];case 3:return null===(o=t.complete)||void 0===o||o.call(t),[2]}}))}))}(t,r):function(e,t,r){He(t)(e).then((function(e){var t,n;null===(t=r.next)||void 0===t||t.call(r,e),null===(n=r.complete)||void 0===n||n.call(r)})).catch((function(e){return Ke(e,r)}))}(t,e,r)})).catch((function(e){return Ke(e,r)})),function(){y&&y.abort()}}))}))},wt=function(e){function t(t){void 0===t&&(t={});var r=e.call(this,Ot(t).request)||this;return r.options=t,r}return(0,n.__extends)(t,e),t}(_e),St=Object.prototype,Et=St.toString,It=St.hasOwnProperty,Pt=Function.prototype.toString,Tt=new Map;function jt(e,t){try{return At(e,t)}finally{Tt.clear()}}function At(e,t){if(e===t)return!0;var r,n,i,o=Et.call(e);if(o!==Et.call(t))return!1;switch(o){case"[object Array]":if(e.length!==t.length)return!1;case"[object Object]":if(Nt(e,t))return!0;var a=xt(e),s=xt(t),u=a.length;if(u!==s.length)return!1;for(var c=0;c<u;++c)if(!It.call(t,a[c]))return!1;for(c=0;c<u;++c){var l=a[c];if(!At(e[l],t[l]))return!1}return!0;case"[object Error]":return e.name===t.name&&e.message===t.message;case"[object Number]":if(e!=e)return t!=t;case"[object Boolean]":case"[object Date]":return+e==+t;case"[object RegExp]":case"[object String]":return e=="".concat(t);case"[object Map]":case"[object Set]":if(e.size!==t.size)return!1;if(Nt(e,t))return!0;for(var f=e.entries(),d="[object Map]"===o;;){var p=f.next();if(p.done)break;var h=p.value,y=h[0],v=h[1];if(!t.has(y))return!1;if(d&&!At(v,t.get(y)))return!1}return!0;case"[object Uint16Array]":case"[object Uint8Array]":case"[object Uint32Array]":case"[object Int32Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object ArrayBuffer]":e=new Uint8Array(e),t=new Uint8Array(t);case"[object DataView]":var m=e.byteLength;if(m===t.byteLength)for(;m--&&e[m]===t[m];);return-1===m;case"[object AsyncFunction]":case"[object GeneratorFunction]":case"[object AsyncGeneratorFunction]":case"[object Function]":var b=Pt.call(e);return b===Pt.call(t)&&(n=Mt,!((i=(r=b).length-n.length)>=0&&r.indexOf(n,i)===i))}return!1}function xt(e){return Object.keys(e).filter(kt,e)}function kt(e){return void 0!==this[e]}var Mt="{ [native code] }";function Nt(e,t){var r=Tt.get(e);if(r){if(r.has(t))return!0}else Tt.set(e,r=new Set);return r.add(t),!1}var Dt=Array.isArray;function Rt(e){return Array.isArray(e)&&e.length>0}var Ct=Object.prototype.hasOwnProperty;function Ft(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return $t(e)}function $t(e){var t=e[0]||{},r=e.length;if(r>1)for(var n=new Lt,i=1;i<r;++i)t=n.merge(t,e[i]);return t}var qt=function(e,t,r){return this.merge(e[r],t[r])},Lt=function(){function e(e){void 0===e&&(e=qt),this.reconciler=e,this.isObject=K,this.pastCopies=new Set}return e.prototype.merge=function(e,t){for(var r=this,i=[],o=2;o<arguments.length;o++)i[o-2]=arguments[o];return K(t)&&K(e)?(Object.keys(t).forEach((function(o){if(Ct.call(e,o)){var a=e[o];if(t[o]!==a){var s=r.reconciler.apply(r,(0,n.__spreadArray)([e,t,o],i,!1));s!==a&&((e=r.shallowCopyForMerge(e))[o]=s)}}else(e=r.shallowCopyForMerge(e))[o]=t[o]})),e):t},e.prototype.shallowCopyForMerge=function(e){return K(e)&&(this.pastCopies.has(e)||(e=Array.isArray(e)?e.slice(0):(0,n.__assign)({__proto__:Object.getPrototypeOf(e)},e),this.pastCopies.add(e))),e},e}();function Vt(e){return"incremental"in e}function Ut(e,t){var r=e,n=new Lt;return Vt(t)&&Rt(t.incremental)&&t.incremental.forEach((function(e){for(var t=e.data,i=e.path,o=i.length-1;o>=0;--o){var a=i[o],s=isNaN(+a)?{}:[];s[a]=t,t=s}r=n.merge(r,t)})),r}var Qt,zt,Bt=function(){return Object.create(null)},Wt=Array.prototype,Yt=Wt.forEach,Kt=Wt.slice,Ht=function(){function e(e,t){void 0===e&&(e=!0),void 0===t&&(t=Bt),this.weakness=e,this.makeData=t}return e.prototype.lookup=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return this.lookupArray(e)},e.prototype.lookupArray=function(e){var t=this;return Yt.call(e,(function(e){return t=t.getChildTrie(e)})),t.data||(t.data=this.makeData(Kt.call(e)))},e.prototype.getChildTrie=function(t){var r=this.weakness&&function(e){switch(typeof e){case"object":if(null===e)break;case"function":return!0}return!1}(t)?this.weak||(this.weak=new WeakMap):this.strong||(this.strong=new Map),n=r.get(t);return n||r.set(t,n=new e(this.weakness,this.makeData)),n},e}(),Gt=function(){function e(){this.known=new(qe?WeakSet:Set),this.pool=new Ht($e),this.passes=new WeakMap,this.keysByJSON=new Map,this.empty=this.admit({})}return e.prototype.isKnown=function(e){return K(e)&&this.known.has(e)},e.prototype.pass=function(e){if(K(e)){var t=function(e){return K(e)?Dt(e)?e.slice(0):(0,n.__assign)({__proto__:Object.getPrototypeOf(e)},e):e}(e);return this.passes.set(t,e),t}return e},e.prototype.admit=function(e){var t=this;if(K(e)){var r=this.passes.get(e);if(r)return r;switch(Object.getPrototypeOf(e)){case Array.prototype:if(this.known.has(e))return e;var n=e.map(this.admit,this);return(s=this.pool.lookupArray(n)).array||(this.known.add(s.array=n),__DEV__&&Object.freeze(n)),s.array;case null:case Object.prototype:if(this.known.has(e))return e;var i=Object.getPrototypeOf(e),o=[i],a=this.sortedKeys(e);o.push(a.json);var s,u=o.length;if(a.sorted.forEach((function(r){o.push(t.admit(e[r]))})),!(s=this.pool.lookupArray(o)).object){var c=s.object=Object.create(i);this.known.add(c),a.sorted.forEach((function(e,t){c[e]=o[u+t]})),__DEV__&&Object.freeze(c)}return s.object}}return e},e.prototype.sortedKeys=function(e){var t=Object.keys(e),r=this.pool.lookupArray(t);if(!r.keys){t.sort();var n=JSON.stringify(t);(r.keys=this.keysByJSON.get(n))||this.keysByJSON.set(n,r.keys={sorted:t,json:n})}return r.keys},e}(),Jt=Object.assign((function(e){if(K(e)){void 0===Qt&&Zt();var t=Qt.admit(e),r=zt.get(t);return void 0===r&&zt.set(t,r=JSON.stringify(t)),r}return JSON.stringify(e)}),{reset:Zt});function Zt(){Qt=new Gt,zt=new($e?WeakMap:Map)}function Xt(e,t,r){return new Y((function(n){var i=n.next,o=n.error,a=n.complete,s=0,u=!1,c={then:function(e){return new Promise((function(t){return t(e())}))}};function l(e,t){return e?function(t){++s;var r=function(){return e(t)};c=c.then(r,r).then((function(e){--s,i&&i.call(n,e),u&&f.complete()}),(function(e){throw--s,e})).catch((function(e){o&&o.call(n,e)}))}:function(e){return t&&t.call(n,e)}}var f={next:l(t,i),error:l(r,o),complete:function(){u=!0,s||a&&a.call(n)}},d=e.subscribe(f);return function(){return d.unsubscribe()}}))}function er(e){return Rt(tr(e))}function tr(e){var t=Rt(e.errors)?e.errors.slice(0):[];return Vt(e)&&Rt(e.incremental)&&e.incremental.forEach((function(e){e.errors&&t.push.apply(t,e.errors)})),t}var rr={kind:je.FIELD,name:{kind:je.NAME,value:"__typename"}};function nr(e,t){return!e||e.selectionSet.selections.every((function(e){return e.kind===je.FRAGMENT_SPREAD&&nr(t[e.name.value],t)}))}function ir(e){return nr(le(e)||function(e){__DEV__?u("Document"===e.kind,'Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a "gql" tag? http://docs.apollostack.com/apollo-client/core.html#gql'):u("Document"===e.kind,51),__DEV__?u(e.definitions.length<=1,"Fragment must have exactly one definition."):u(e.definitions.length<=1,52);var t=e.definitions[0];return __DEV__?u("FragmentDefinition"===t.kind,"Must be a fragment definition."):u("FragmentDefinition"===t.kind,53),t}(e),G(de(e)))?null:e}function or(e){var t=new Map;return function(r){void 0===r&&(r=e);var n=t.get(r);return n||t.set(r,n={variables:new Set,fragmentSpreads:new Set}),n}}function ar(e,t){for(var r=or(""),i=or(""),o=function(e){for(var t=0,n=void 0;t<e.length&&(n=e[t]);++t)if(!Dt(n)){if(n.kind===je.OPERATION_DEFINITION)return r(n.name&&n.name.value);if(n.kind===je.FRAGMENT_DEFINITION)return i(n.name.value)}return __DEV__&&u.error("Could not find operation or fragment"),null},a=0,s=t.definitions.length-1;s>=0;--s)t.definitions[s].kind===je.OPERATION_DEFINITION&&++a;var c=function(e){var t=new Set,r=[];return e.forEach((function(e){e.name?t.add(e.name):e.test&&r.push(e.test)})),function(e){return t.has(e.name.value)||r.some((function(t){return t(e)}))}}(e),l=e.some((function(e){return e.remove})),f=function(e){return l&&e&&e.some(c)},d=new Map,p=!1,h={enter:function(e){if(f(e.directives))return p=!0,null}},y=ke(t,{Field:h,InlineFragment:h,VariableDefinition:{enter:function(){return!1}},Variable:{enter:function(e,t,r,n,i){var a=o(i);a&&a.variables.add(e.name.value)}},FragmentSpread:{enter:function(e,t,r,n,i){if(f(e.directives))return p=!0,null;var a=o(i);a&&a.fragmentSpreads.add(e.name.value)}},FragmentDefinition:{enter:function(e,t,r,n){d.set(JSON.stringify(n),e)},leave:function(e,t,r,n){return e===d.get(JSON.stringify(n))?e:a>0&&e.selectionSet.selections.every((function(e){return e.kind===je.FIELD&&"__typename"===e.name.value}))?(i(e.name.value).removed=!0,p=!0,null):void 0}},Directive:{leave:function(e){if(c(e))return p=!0,null}}});if(!p)return t;var v=function(e){return e.transitiveVars||(e.transitiveVars=new Set(e.variables),e.removed||e.fragmentSpreads.forEach((function(t){v(i(t)).transitiveVars.forEach((function(t){e.transitiveVars.add(t)}))}))),e},m=new Set;y.definitions.forEach((function(e){e.kind===je.OPERATION_DEFINITION?v(r(e.name&&e.name.value)).fragmentSpreads.forEach((function(e){m.add(e)})):e.kind!==je.FRAGMENT_DEFINITION||0!==a||i(e.name.value).removed||m.add(e.name.value)})),m.forEach((function(e){v(i(e)).fragmentSpreads.forEach((function(e){m.add(e)}))}));var b={enter:function(e){if(t=e.name.value,!m.has(t)||i(t).removed)return null;var t}};return ir(ke(y,{FragmentSpread:b,FragmentDefinition:b,OperationDefinition:{leave:function(e){if(e.variableDefinitions){var t=v(r(e.name&&e.name.value)).transitiveVars;if(t.size<e.variableDefinitions.length)return(0,n.__assign)((0,n.__assign)({},e),{variableDefinitions:e.variableDefinitions.filter((function(e){return t.has(e.variable.name.value)}))})}}}}))}var sr=Object.assign((function(e){return ke(e,{SelectionSet:{enter:function(e,t,r){if(!r||r.kind!==je.OPERATION_DEFINITION){var i=e.selections;if(i&&!i.some((function(e){return ue(e)&&("__typename"===e.name.value||0===e.name.value.lastIndexOf("__",0))}))){var o=r;if(!(ue(o)&&o.directives&&o.directives.some((function(e){return"export"===e.name.value}))))return(0,n.__assign)((0,n.__assign)({},e),{selections:(0,n.__spreadArray)((0,n.__spreadArray)([],i,!0),[rr],!1)})}}}}})}),{added:function(e){return e===rr}}),ur={test:function(e){var t="connection"===e.name.value;return t&&(e.arguments&&e.arguments.some((function(e){return"key"===e.name.value}))||__DEV__&&u.warn("Removing an @connection directive even though it does not have a key. You may want to use the key parameter to specify a store key.")),t}};function cr(e){return"query"===he(e).operation?e:ke(e,{OperationDefinition:{enter:function(e){return(0,n.__assign)((0,n.__assign)({},e),{operation:"query"})}}})}var lr=new Map;function fr(e){var t=lr.get(e)||1;return lr.set(e,t+1),"".concat(e,":").concat(t,":").concat(Math.random().toString(36).slice(2))}function dr(e,t,r){var n=[];e.forEach((function(e){return e[t]&&n.push(e)})),n.forEach((function(e){return e[t](r)}))}function pr(e){function t(t){Object.defineProperty(e,t,{value:Y})}return Le&&Symbol.species&&t(Symbol.species),t("@@species"),e}function hr(e){return e&&"function"==typeof e.then}var yr=function(e){function t(t){var r=e.call(this,(function(e){return r.addObserver(e),function(){return r.removeObserver(e)}}))||this;return r.observers=new Set,r.promise=new Promise((function(e,t){r.resolve=e,r.reject=t})),r.handlers={next:function(e){null!==r.sub&&(r.latest=["next",e],r.notify("next",e),dr(r.observers,"next",e))},error:function(e){var t=r.sub;null!==t&&(t&&setTimeout((function(){return t.unsubscribe()})),r.sub=null,r.latest=["error",e],r.reject(e),r.notify("error",e),dr(r.observers,"error",e))},complete:function(){var e=r,t=e.sub,n=e.sources;if(null!==t){var i=(void 0===n?[]:n).shift();i?hr(i)?i.then((function(e){return r.sub=e.subscribe(r.handlers)})):r.sub=i.subscribe(r.handlers):(t&&setTimeout((function(){return t.unsubscribe()})),r.sub=null,r.latest&&"next"===r.latest[0]?r.resolve(r.latest[1]):r.resolve(),r.notify("complete"),dr(r.observers,"complete"))}}},r.nextResultListeners=new Set,r.cancel=function(e){r.reject(e),r.sources=[],r.handlers.complete()},r.promise.catch((function(e){})),"function"==typeof t&&(t=[new Y(t)]),hr(t)?t.then((function(e){return r.start(e)}),r.handlers.error):r.start(t),r}return(0,n.__extends)(t,e),t.prototype.start=function(e){void 0===this.sub&&(this.sources=Array.from(e),this.handlers.complete())},t.prototype.deliverLastMessage=function(e){if(this.latest){var t=this.latest[0],r=e[t];r&&r.call(e,this.latest[1]),null===this.sub&&"next"===t&&e.complete&&e.complete()}},t.prototype.addObserver=function(e){this.observers.has(e)||(this.deliverLastMessage(e),this.observers.add(e))},t.prototype.removeObserver=function(e){this.observers.delete(e)&&this.observers.size<1&&this.handlers.complete()},t.prototype.notify=function(e,t){var r=this.nextResultListeners;r.size&&(this.nextResultListeners=new Set,r.forEach((function(r){return r(e,t)})))},t.prototype.beforeNext=function(e){var t=!1;this.nextResultListeners.add((function(r,n){t||(t=!0,e(r,n))}))},t}(Y);function vr(e){return e.hasOwnProperty("graphQLErrors")}pr(yr);var mr,br=function(e){function t(r){var n,i,o=r.graphQLErrors,a=r.clientErrors,s=r.networkError,u=r.errorMessage,c=r.extraInfo,l=e.call(this,u)||this;return l.name="ApolloError",l.graphQLErrors=o||[],l.clientErrors=a||[],l.networkError=s||null,l.message=u||(i="",(Rt((n=l).graphQLErrors)||Rt(n.clientErrors))&&(n.graphQLErrors||[]).concat(n.clientErrors||[]).forEach((function(e){var t=e?e.message:"Error message not found.";i+="".concat(t,"\n")})),n.networkError&&(i+="".concat(n.networkError.message,"\n")),i=i.replace(/\n$/,"")),l.extraInfo=c,l.__proto__=t.prototype,l}return(0,n.__extends)(t,e),t}(Error);function gr(e){return!!e&&e<7}!function(e){e[e.loading=1]="loading",e[e.setVariables=2]="setVariables",e[e.fetchMore=3]="fetchMore",e[e.refetch=4]="refetch",e[e.poll=6]="poll",e[e.ready=7]="ready",e[e.error=8]="error"}(mr||(mr={}));var _r=Object.prototype.toString;function Or(e){return wr(e)}function wr(e,t){switch(_r.call(e)){case"[object Array]":if((t=t||new Map).has(e))return t.get(e);var r=e.slice(0);return t.set(e,r),r.forEach((function(e,n){r[n]=wr(e,t)})),r;case"[object Object]":if((t=t||new Map).has(e))return t.get(e);var n=Object.create(Object.getPrototypeOf(e));return t.set(e,n),Object.keys(e).forEach((function(r){n[r]=wr(e[r],t)})),n;default:return e}}function Sr(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=Object.create(null);return e.forEach((function(e){e&&Object.keys(e).forEach((function(t){var n=e[t];void 0!==n&&(r[t]=n)}))})),r}var Er=Object.assign,Ir=Object.hasOwnProperty,Pr=function(e){function t(t){var r=t.queryManager,i=t.queryInfo,o=t.options,a=e.call(this,(function(e){try{var t=e._subscription._observer;t&&!t.error&&(t.error=jr)}catch(e){}var r=!a.observers.size;a.observers.add(e);var n=a.last;return n&&n.error?e.error&&e.error(n.error):n&&n.result&&e.next&&e.next(n.result),r&&a.reobserve().catch((function(){})),function(){a.observers.delete(e)&&!a.observers.size&&a.tearDownQuery()}}))||this;a.observers=new Set,a.subscriptions=new Set,a.queryInfo=i,a.queryManager=r,a.isTornDown=!1;var s=r.defaultOptions.watchQuery,u=(void 0===s?{}:s).fetchPolicy,c=void 0===u?"cache-first":u,l=o.fetchPolicy,f=void 0===l?c:l,d=o.initialFetchPolicy,p=void 0===d?"standby"===f?c:f:d;a.options=(0,n.__assign)((0,n.__assign)({},o),{initialFetchPolicy:p,fetchPolicy:f}),a.queryId=i.queryId||r.generateQueryId();var h=le(a.query);return a.queryName=h&&h.name&&h.name.value,a}return(0,n.__extends)(t,e),Object.defineProperty(t.prototype,"query",{get:function(){return this.queryManager.transform(this.options.query).document},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"variables",{get:function(){return this.options.variables},enumerable:!1,configurable:!0}),t.prototype.result=function(){var e=this;return new Promise((function(t,r){var n={next:function(r){t(r),e.observers.delete(n),e.observers.size||e.queryManager.removeQuery(e.queryId),setTimeout((function(){i.unsubscribe()}),0)},error:r},i=e.subscribe(n)}))},t.prototype.getCurrentResult=function(e){void 0===e&&(e=!0);var t=this.getLastResult(!0),r=this.queryInfo.networkStatus||t&&t.networkStatus||mr.ready,i=(0,n.__assign)((0,n.__assign)({},t),{loading:gr(r),networkStatus:r}),o=this.options.fetchPolicy,a=void 0===o?"cache-first":o;if("network-only"===a||"no-cache"===a||"standby"===a||this.queryManager.transform(this.options.query).hasForcedResolvers);else{var s=this.queryInfo.getDiff();(s.complete||this.options.returnPartialData)&&(i.data=s.result),jt(i.data,{})&&(i.data=void 0),s.complete?(delete i.partial,!s.complete||i.networkStatus!==mr.loading||"cache-first"!==a&&"cache-only"!==a||(i.networkStatus=mr.ready,i.loading=!1)):i.partial=!0,!__DEV__||s.complete||this.options.partialRefetch||i.loading||i.data||i.error||Ar(s.missing)}return e&&this.updateLastResult(i),i},t.prototype.isDifferentFromLastResult=function(e,t){return!this.last||!jt(this.last.result,e)||t&&!jt(this.last.variables,t)},t.prototype.getLast=function(e,t){var r=this.last;if(r&&r[e]&&(!t||jt(r.variables,this.variables)))return r[e]},t.prototype.getLastResult=function(e){return this.getLast("result",e)},t.prototype.getLastError=function(e){return this.getLast("error",e)},t.prototype.resetLastResults=function(){delete this.last,this.isTornDown=!1},t.prototype.resetQueryStoreErrors=function(){this.queryManager.resetErrors(this.queryId)},t.prototype.refetch=function(e){var t,r={pollInterval:0},i=this.options.fetchPolicy;if(r.fetchPolicy="cache-and-network"===i?i:"no-cache"===i?"no-cache":"network-only",__DEV__&&e&&Ir.call(e,"variables")){var o=pe(this.query),a=o.variableDefinitions;a&&a.some((function(e){return"variables"===e.variable.name.value}))||__DEV__&&u.warn("Called refetch(".concat(JSON.stringify(e),") for query ").concat((null===(t=o.name)||void 0===t?void 0:t.value)||JSON.stringify(o),", which does not declare a $variables variable.\nDid you mean to call refetch(variables) instead of refetch({ variables })?"))}return e&&!jt(this.options.variables,e)&&(r.variables=this.options.variables=(0,n.__assign)((0,n.__assign)({},this.options.variables),e)),this.queryInfo.resetLastWrite(),this.reobserve(r,mr.refetch)},t.prototype.fetchMore=function(e){var t=this,r=(0,n.__assign)((0,n.__assign)({},e.query?e:(0,n.__assign)((0,n.__assign)((0,n.__assign)((0,n.__assign)({},this.options),{query:this.query}),e),{variables:(0,n.__assign)((0,n.__assign)({},this.options.variables),e.variables)})),{fetchPolicy:"no-cache"}),i=this.queryManager.generateQueryId(),o=this.queryInfo,a=o.networkStatus;o.networkStatus=mr.fetchMore,r.notifyOnNetworkStatusChange&&this.observe();var s=new Set;return this.queryManager.fetchQuery(i,r,mr.fetchMore).then((function(n){return t.queryManager.removeQuery(i),o.networkStatus===mr.fetchMore&&(o.networkStatus=a),t.queryManager.cache.batch({update:function(i){var o=e.updateQuery;o?i.updateQuery({query:t.query,variables:t.variables,returnPartialData:!0,optimistic:!1},(function(e){return o(e,{fetchMoreResult:n.data,variables:r.variables})})):i.writeQuery({query:r.query,variables:r.variables,data:n.data})},onWatchUpdated:function(e){s.add(e.query)}}),n})).finally((function(){s.has(t.query)||Tr(t)}))},t.prototype.subscribeToMore=function(e){var t=this,r=this.queryManager.startGraphQLSubscription({query:e.document,variables:e.variables,context:e.context}).subscribe({next:function(r){var n=e.updateQuery;n&&t.updateQuery((function(e,t){var i=t.variables;return n(e,{subscriptionData:r,variables:i})}))},error:function(t){e.onError?e.onError(t):__DEV__&&u.error("Unhandled GraphQL subscription error",t)}});return this.subscriptions.add(r),function(){t.subscriptions.delete(r)&&r.unsubscribe()}},t.prototype.setOptions=function(e){return this.reobserve(e)},t.prototype.setVariables=function(e){return jt(this.variables,e)?this.observers.size?this.result():Promise.resolve():(this.options.variables=e,this.observers.size?this.reobserve({fetchPolicy:this.options.initialFetchPolicy,variables:e},mr.setVariables):Promise.resolve())},t.prototype.updateQuery=function(e){var t=this.queryManager,r=e(t.cache.diff({query:this.options.query,variables:this.variables,returnPartialData:!0,optimistic:!1}).result,{variables:this.variables});r&&(t.cache.writeQuery({query:this.options.query,data:r,variables:this.variables}),t.broadcastQueries())},t.prototype.startPolling=function(e){this.options.pollInterval=e,this.updatePolling()},t.prototype.stopPolling=function(){this.options.pollInterval=0,this.updatePolling()},t.prototype.applyNextFetchPolicy=function(e,t){if(t.nextFetchPolicy){var r=t.fetchPolicy,n=void 0===r?"cache-first":r,i=t.initialFetchPolicy,o=void 0===i?n:i;"standby"===n||("function"==typeof t.nextFetchPolicy?t.fetchPolicy=t.nextFetchPolicy(n,{reason:e,options:t,observable:this,initialFetchPolicy:o}):t.fetchPolicy="variables-changed"===e?o:t.nextFetchPolicy)}return t.fetchPolicy},t.prototype.fetch=function(e,t){return this.queryManager.setObservableQuery(this),this.queryManager.fetchQueryObservable(this.queryId,e,t)},t.prototype.updatePolling=function(){var e=this;if(!this.queryManager.ssrMode){var t=this.pollingInfo,r=this.options.pollInterval;if(r){if(!t||t.interval!==r){__DEV__?u(r,"Attempted to start a polling query without a polling interval."):u(r,13),(t||(this.pollingInfo={})).interval=r;var n=function(){e.pollingInfo&&(gr(e.queryInfo.networkStatus)?i():e.reobserve({fetchPolicy:"no-cache"===e.options.initialFetchPolicy?"no-cache":"network-only"},mr.poll).then(i,i))},i=function(){var t=e.pollingInfo;t&&(clearTimeout(t.timeout),t.timeout=setTimeout(n,t.interval))};i()}}else t&&(clearTimeout(t.timeout),delete this.pollingInfo)}},t.prototype.updateLastResult=function(e,t){return void 0===t&&(t=this.variables),this.last=(0,n.__assign)((0,n.__assign)({},this.last),{result:this.queryManager.assumeImmutableResults?e:Or(e),variables:t}),Rt(e.errors)||delete this.last.error,this.last},t.prototype.reobserve=function(e,t){var r=this;this.isTornDown=!1;var i=t===mr.refetch||t===mr.fetchMore||t===mr.poll,o=this.options.variables,a=this.options.fetchPolicy,s=Sr(this.options,e||{}),u=i?s:Er(this.options,s);i||(this.updatePolling(),e&&e.variables&&!jt(e.variables,o)&&"standby"!==u.fetchPolicy&&u.fetchPolicy===a&&(this.applyNextFetchPolicy("variables-changed",u),void 0===t&&(t=mr.setVariables)));var c=u.variables&&(0,n.__assign)({},u.variables),l=this.fetch(u,t),f={next:function(e){r.reportResult(e,c)},error:function(e){r.reportError(e,c)}};return i||(this.concast&&this.observer&&this.concast.removeObserver(this.observer),this.concast=l,this.observer=f),l.addObserver(f),l.promise},t.prototype.observe=function(){this.reportResult(this.getCurrentResult(!1),this.variables)},t.prototype.reportResult=function(e,t){var r=this.getLastError();(r||this.isDifferentFromLastResult(e,t))&&((r||!e.partial||this.options.returnPartialData)&&this.updateLastResult(e,t),dr(this.observers,"next",e))},t.prototype.reportError=function(e,t){var r=(0,n.__assign)((0,n.__assign)({},this.getLastResult()),{error:e,errors:e.graphQLErrors,networkStatus:mr.error,loading:!1});this.updateLastResult(r,t),dr(this.observers,"error",this.last.error=e)},t.prototype.hasObservers=function(){return this.observers.size>0},t.prototype.tearDownQuery=function(){this.isTornDown||(this.concast&&this.observer&&(this.concast.removeObserver(this.observer),delete this.concast,delete this.observer),this.stopPolling(),this.subscriptions.forEach((function(e){return e.unsubscribe()})),this.subscriptions.clear(),this.queryManager.stopQuery(this.queryId),this.observers.clear(),this.isTornDown=!0)},t}(Y);function Tr(e){var t=e.options,r=t.fetchPolicy,n=t.nextFetchPolicy;return"cache-and-network"===r||"network-only"===r?e.reobserve({fetchPolicy:"cache-first",nextFetchPolicy:function(){return this.nextFetchPolicy=n,"function"==typeof n?n.apply(this,arguments):r}}):e.reobserve()}function jr(e){__DEV__&&u.error("Unhandled error",e.message,e.stack)}function Ar(e){__DEV__&&e&&__DEV__&&u.debug("Missing cache result fields: ".concat(JSON.stringify(e)),e)}function xr(e){return e.kind===je.FIELD||e.kind===je.FRAGMENT_SPREAD||e.kind===je.INLINE_FRAGMENT}pr(Pr);var kr=null,Mr={},Nr=1;function Dr(e){try{return e()}catch(e){}}var Rr="@wry/context:Slot",Cr=Dr((function(){return globalThis}))||Dr((function(){return r.g}))||Object.create(null),Fr=Cr[Rr]||Array[Rr]||function(e){try{Object.defineProperty(Cr,Rr,{value:e,enumerable:!1,writable:!1,configurable:!0})}finally{return e}}(function(){function e(){this.id=["slot",Nr++,Date.now(),Math.random().toString(36).slice(2)].join(":")}return e.prototype.hasValue=function(){for(var e=kr;e;e=e.parent)if(this.id in e.slots){var t=e.slots[this.id];if(t===Mr)break;return e!==kr&&(kr.slots[this.id]=t),!0}return kr&&(kr.slots[this.id]=Mr),!1},e.prototype.getValue=function(){if(this.hasValue())return kr.slots[this.id]},e.prototype.withValue=function(e,t,r,n){var i,o=((i={__proto__:null})[this.id]=e,i),a=kr;kr={parent:a,slots:o};try{return t.apply(n,r)}finally{kr=a}},e.bind=function(e){var t=kr;return function(){var r=kr;try{return kr=t,e.apply(this,arguments)}finally{kr=r}}},e.noContext=function(e,t,r){if(!kr)return e.apply(r,t);var n=kr;try{return kr=null,e.apply(r,t)}finally{kr=n}},e}());function $r(){}Fr.bind,Fr.noContext;var qr,Lr=function(){function e(e,t){void 0===e&&(e=1/0),void 0===t&&(t=$r),this.max=e,this.dispose=t,this.map=new Map,this.newest=null,this.oldest=null}return e.prototype.has=function(e){return this.map.has(e)},e.prototype.get=function(e){var t=this.getNode(e);return t&&t.value},e.prototype.getNode=function(e){var t=this.map.get(e);if(t&&t!==this.newest){var r=t.older,n=t.newer;n&&(n.older=r),r&&(r.newer=n),t.older=this.newest,t.older.newer=t,t.newer=null,this.newest=t,t===this.oldest&&(this.oldest=n)}return t},e.prototype.set=function(e,t){var r=this.getNode(e);return r?r.value=t:(r={key:e,value:t,newer:null,older:this.newest},this.newest&&(this.newest.newer=r),this.newest=r,this.oldest=this.oldest||r,this.map.set(e,r),r.value)},e.prototype.clean=function(){for(;this.oldest&&this.map.size>this.max;)this.delete(this.oldest.key)},e.prototype.delete=function(e){var t=this.map.get(e);return!!t&&(t===this.newest&&(this.newest=t.older),t===this.oldest&&(this.oldest=t.newer),t.newer&&(t.newer.older=t.older),t.older&&(t.older.newer=t.newer),this.map.delete(e),this.dispose(t.value,e),!0)},e}(),Vr=new Fr,Ur=Object.prototype.hasOwnProperty,Qr=void 0===(qr=Array.from)?function(e){var t=[];return e.forEach((function(e){return t.push(e)})),t}:qr;function zr(e){var t=e.unsubscribe;"function"==typeof t&&(e.unsubscribe=void 0,t())}var Br=[],Wr=100;function Yr(e,t){if(!e)throw new Error(t||"assertion failure")}function Kr(e){switch(e.length){case 0:throw new Error("unknown value");case 1:return e[0];case 2:throw e[1]}}var Hr=function(){function e(t){this.fn=t,this.parents=new Set,this.childValues=new Map,this.dirtyChildren=null,this.dirty=!0,this.recomputing=!1,this.value=[],this.deps=null,++e.count}return e.prototype.peek=function(){if(1===this.value.length&&!Zr(this))return Gr(this),this.value[0]},e.prototype.recompute=function(e){return Yr(!this.recomputing,"already recomputing"),Gr(this),Zr(this)?function(e,t){return an(e),Vr.withValue(e,Jr,[e,t]),function(e,t){if("function"==typeof e.subscribe)try{zr(e),e.unsubscribe=e.subscribe.apply(null,t)}catch(t){return e.setDirty(),!1}return!0}(e,t)&&function(e){e.dirty=!1,Zr(e)||en(e)}(e),Kr(e.value)}(this,e):Kr(this.value)},e.prototype.setDirty=function(){this.dirty||(this.dirty=!0,this.value.length=0,Xr(this),zr(this))},e.prototype.dispose=function(){var e=this;this.setDirty(),an(this),tn(this,(function(t,r){t.setDirty(),sn(t,e)}))},e.prototype.forget=function(){this.dispose()},e.prototype.dependOn=function(e){e.add(this),this.deps||(this.deps=Br.pop()||new Set),this.deps.add(e)},e.prototype.forgetDeps=function(){var e=this;this.deps&&(Qr(this.deps).forEach((function(t){return t.delete(e)})),this.deps.clear(),Br.push(this.deps),this.deps=null)},e.count=0,e}();function Gr(e){var t=Vr.getValue();if(t)return e.parents.add(t),t.childValues.has(e)||t.childValues.set(e,[]),Zr(e)?rn(t,e):nn(t,e),t}function Jr(e,t){e.recomputing=!0,e.value.length=0;try{e.value[0]=e.fn.apply(null,t)}catch(t){e.value[1]=t}e.recomputing=!1}function Zr(e){return e.dirty||!(!e.dirtyChildren||!e.dirtyChildren.size)}function Xr(e){tn(e,rn)}function en(e){tn(e,nn)}function tn(e,t){var r=e.parents.size;if(r)for(var n=Qr(e.parents),i=0;i<r;++i)t(n[i],e)}function rn(e,t){Yr(e.childValues.has(t)),Yr(Zr(t));var r=!Zr(e);if(e.dirtyChildren){if(e.dirtyChildren.has(t))return}else e.dirtyChildren=Br.pop()||new Set;e.dirtyChildren.add(t),r&&Xr(e)}function nn(e,t){Yr(e.childValues.has(t)),Yr(!Zr(t));var r,n,i,o=e.childValues.get(t);0===o.length?e.childValues.set(t,t.value.slice(0)):(r=o,n=t.value,(i=r.length)>0&&i===n.length&&r[i-1]===n[i-1]||e.setDirty()),on(e,t),Zr(e)||en(e)}function on(e,t){var r=e.dirtyChildren;r&&(r.delete(t),0===r.size&&(Br.length<Wr&&Br.push(r),e.dirtyChildren=null))}function an(e){e.childValues.size>0&&e.childValues.forEach((function(t,r){sn(e,r)})),e.forgetDeps(),Yr(null===e.dirtyChildren)}function sn(e,t){t.parents.delete(e),e.childValues.delete(t),on(e,t)}var un={setDirty:!0,dispose:!0,forget:!0};function cn(e){var t=new Map,r=e&&e.subscribe;function n(e){var n=Vr.getValue();if(n){var i=t.get(e);i||t.set(e,i=new Set),n.dependOn(i),"function"==typeof r&&(zr(i),i.unsubscribe=r(e))}}return n.dirty=function(e,r){var n=t.get(e);if(n){var i=r&&Ur.call(un,r)?r:"setDirty";Qr(n).forEach((function(e){return e[i]()})),t.delete(e),zr(n)}},n}function ln(){var e=new Ht("function"==typeof WeakMap);return function(){return e.lookupArray(arguments)}}ln();var fn=new Set;function dn(e,t){void 0===t&&(t=Object.create(null));var r=new Lr(t.max||Math.pow(2,16),(function(e){return e.dispose()})),n=t.keyArgs,i=t.makeCacheKey||ln(),o=function(){var o=i.apply(null,n?n.apply(null,arguments):arguments);if(void 0===o)return e.apply(null,arguments);var a=r.get(o);a||(r.set(o,a=new Hr(e)),a.subscribe=t.subscribe,a.forget=function(){return r.delete(o)});var s=a.recompute(Array.prototype.slice.call(arguments));return r.set(o,a),fn.add(r),Vr.hasValue()||(fn.forEach((function(e){return e.clean()})),fn.clear()),s};function a(e){var t=r.get(e);t&&t.setDirty()}function s(e){var t=r.get(e);if(t)return t.peek()}function u(e){return r.delete(e)}return Object.defineProperty(o,"size",{get:function(){return r.map.size},configurable:!1,enumerable:!1}),o.dirtyKey=a,o.dirty=function(){a(i.apply(null,arguments))},o.peekKey=s,o.peek=function(){return s(i.apply(null,arguments))},o.forgetKey=u,o.forget=function(){return u(i.apply(null,arguments))},o.makeCacheKey=i,o.getKey=n?function(){return i.apply(null,n.apply(null,arguments))}:i,Object.freeze(o)}var pn=new Fr,hn=new WeakMap;function yn(e){var t=hn.get(e);return t||hn.set(e,t={vars:new Set,dep:cn()}),t}function vn(e){yn(e).vars.forEach((function(t){return t.forgetCache(e)}))}function mn(e){var t=new Set,r=new Set,n=function(o){if(arguments.length>0){if(e!==o){e=o,t.forEach((function(e){yn(e).dep.dirty(n),function(e){e.broadcastWatches&&e.broadcastWatches()}(e)}));var a=Array.from(r);r.clear(),a.forEach((function(t){return t(e)}))}}else{var s=pn.getValue();s&&(i(s),yn(s).dep(n))}return e};n.onNextChange=function(e){return r.add(e),function(){r.delete(e)}};var i=n.attachCache=function(e){return t.add(e),yn(e).vars.add(n),n};return n.forgetCache=function(e){return t.delete(e)},n}var bn=function(){function e(e){var t=e.cache,r=e.client,n=e.resolvers,i=e.fragmentMatcher;this.selectionsToResolveCache=new WeakMap,this.cache=t,r&&(this.client=r),n&&this.addResolvers(n),i&&this.setFragmentMatcher(i)}return e.prototype.addResolvers=function(e){var t=this;this.resolvers=this.resolvers||{},Array.isArray(e)?e.forEach((function(e){t.resolvers=Ft(t.resolvers,e)})):this.resolvers=Ft(this.resolvers,e)},e.prototype.setResolvers=function(e){this.resolvers={},this.addResolvers(e)},e.prototype.getResolvers=function(){return this.resolvers||{}},e.prototype.runResolvers=function(e){var t=e.document,r=e.remoteResult,i=e.context,o=e.variables,a=e.onlyRunForcedResolvers,s=void 0!==a&&a;return(0,n.__awaiter)(this,void 0,void 0,(function(){return(0,n.__generator)(this,(function(e){return t?[2,this.resolveDocument(t,r.data,i,o,this.fragmentMatcher,s).then((function(e){return(0,n.__assign)((0,n.__assign)({},r),{data:e.result})}))]:[2,r]}))}))},e.prototype.setFragmentMatcher=function(e){this.fragmentMatcher=e},e.prototype.getFragmentMatcher=function(){return this.fragmentMatcher},e.prototype.clientQuery=function(e){return De(["client"],e)&&this.resolvers?e:null},e.prototype.serverQuery=function(e){return function(e){return ce(e),ar([{test:function(e){return"client"===e.name.value},remove:!0}],e)}(e)},e.prototype.prepareContext=function(e){var t=this.cache;return(0,n.__assign)((0,n.__assign)({},e),{cache:t,getCacheKey:function(e){return t.identify(e)}})},e.prototype.addExportedVariables=function(e,t,r){return void 0===t&&(t={}),void 0===r&&(r={}),(0,n.__awaiter)(this,void 0,void 0,(function(){return(0,n.__generator)(this,(function(i){return e?[2,this.resolveDocument(e,this.buildRootValueFromCache(e,t)||{},this.prepareContext(r),t).then((function(e){return(0,n.__assign)((0,n.__assign)({},t),e.exportedVariables)}))]:[2,(0,n.__assign)({},t)]}))}))},e.prototype.shouldForceResolvers=function(e){var t=!1;return ke(e,{Directive:{enter:function(e){if("client"===e.name.value&&e.arguments&&(t=e.arguments.some((function(e){return"always"===e.name.value&&"BooleanValue"===e.value.kind&&!0===e.value.value}))))return xe}}}),t},e.prototype.buildRootValueFromCache=function(e,t){return this.cache.diff({query:cr(e),variables:t,returnPartialData:!0,optimistic:!1}).result},e.prototype.resolveDocument=function(e,t,r,i,o,a){return void 0===r&&(r={}),void 0===i&&(i={}),void 0===o&&(o=function(){return!0}),void 0===a&&(a=!1),(0,n.__awaiter)(this,void 0,void 0,(function(){var s,u,c,l,f,d,p,h,y,v;return(0,n.__generator)(this,(function(m){return s=he(e),u=de(e),c=G(u),l=this.collectSelectionsToResolve(s,c),f=s.operation,d=f?f.charAt(0).toUpperCase()+f.slice(1):"Query",h=(p=this).cache,y=p.client,v={fragmentMap:c,context:(0,n.__assign)((0,n.__assign)({},r),{cache:h,client:y}),variables:i,fragmentMatcher:o,defaultOperationType:d,exportedVariables:{},selectionsToResolve:l,onlyRunForcedResolvers:a},[2,this.resolveSelectionSet(s.selectionSet,!1,t,v).then((function(e){return{result:e,exportedVariables:v.exportedVariables}}))]}))}))},e.prototype.resolveSelectionSet=function(e,t,r,i){return(0,n.__awaiter)(this,void 0,void 0,(function(){var o,a,s,c,l,f=this;return(0,n.__generator)(this,(function(d){return o=i.fragmentMap,a=i.context,s=i.variables,c=[r],l=function(e){return(0,n.__awaiter)(f,void 0,void 0,(function(){var l,f;return(0,n.__generator)(this,(function(n){return(t||i.selectionsToResolve.has(e))&&Ne(e,s)?ue(e)?[2,this.resolveField(e,t,r,i).then((function(t){var r;void 0!==t&&c.push(((r={})[ae(e)]=t,r))}))]:(function(e){return"InlineFragment"===e.kind}(e)?l=e:(l=o[e.name.value],__DEV__?u(l,"No fragment named ".concat(e.name.value)):u(l,11)),l&&l.typeCondition&&(f=l.typeCondition.name.value,i.fragmentMatcher(r,f,a))?[2,this.resolveSelectionSet(l.selectionSet,t,r,i).then((function(e){c.push(e)}))]:[2]):[2]}))}))},[2,Promise.all(e.selections.map(l)).then((function(){return $t(c)}))]}))}))},e.prototype.resolveField=function(e,t,r,i){return(0,n.__awaiter)(this,void 0,void 0,(function(){var o,a,s,u,c,l,f,d,p,h=this;return(0,n.__generator)(this,(function(n){return r?(o=i.variables,a=e.name.value,s=ae(e),u=a!==s,c=r[s]||r[a],l=Promise.resolve(c),i.onlyRunForcedResolvers&&!this.shouldForceResolvers(e)||(f=r.__typename||i.defaultOperationType,(d=this.resolvers&&this.resolvers[f])&&(p=d[u?a:s])&&(l=Promise.resolve(pn.withValue(this.cache,p,[r,oe(e,o),i.context,{field:e,fragmentMap:i.fragmentMap}])))),[2,l.then((function(r){var n,o;if(void 0===r&&(r=c),e.directives&&e.directives.forEach((function(e){"export"===e.name.value&&e.arguments&&e.arguments.forEach((function(e){"as"===e.name.value&&"StringValue"===e.value.kind&&(i.exportedVariables[e.value.value]=r)}))})),!e.selectionSet)return r;if(null==r)return r;var a=null!==(o=null===(n=e.directives)||void 0===n?void 0:n.some((function(e){return"client"===e.name.value})))&&void 0!==o&&o;return Array.isArray(r)?h.resolveSubSelectedArray(e,t||a,r,i):e.selectionSet?h.resolveSelectionSet(e.selectionSet,t||a,r,i):void 0}))]):[2,null]}))}))},e.prototype.resolveSubSelectedArray=function(e,t,r,n){var i=this;return Promise.all(r.map((function(r){return null===r?null:Array.isArray(r)?i.resolveSubSelectedArray(e,t,r,n):e.selectionSet?i.resolveSelectionSet(e.selectionSet,t,r,n):void 0})))},e.prototype.collectSelectionsToResolve=function(e,t){var r=function(e){return!Array.isArray(e)},n=this.selectionsToResolveCache;return function e(i){if(!n.has(i)){var o=new Set;n.set(i,o),ke(i,{Directive:function(e,t,n,i,a){"client"===e.name.value&&a.forEach((function(e){r(e)&&xr(e)&&o.add(e)}))},FragmentSpread:function(n,i,a,s,c){var l=t[n.name.value];__DEV__?u(l,"No fragment named ".concat(n.name.value)):u(l,12);var f=e(l);f.size>0&&(c.forEach((function(e){r(e)&&xr(e)&&o.add(e)})),o.add(n),f.forEach((function(e){o.add(e)})))}})}return n.get(i)}(e)},e}(),gn=new($e?WeakMap:Map);function _n(e,t){var r=e[t];"function"==typeof r&&(e[t]=function(){return gn.set(e,(gn.get(e)+1)%1e15),r.apply(this,arguments)})}function On(e){e.notifyTimeout&&(clearTimeout(e.notifyTimeout),e.notifyTimeout=void 0)}var wn=function(){function e(e,t){void 0===t&&(t=e.generateQueryId()),this.queryId=t,this.listeners=new Set,this.document=null,this.lastRequestId=1,this.subscriptions=new Set,this.stopped=!1,this.dirty=!1,this.observableQuery=null;var r=this.cache=e.cache;gn.has(r)||(gn.set(r,0),_n(r,"evict"),_n(r,"modify"),_n(r,"reset"))}return e.prototype.init=function(e){var t=e.networkStatus||mr.loading;return this.variables&&this.networkStatus!==mr.loading&&!jt(this.variables,e.variables)&&(t=mr.setVariables),jt(e.variables,this.variables)||(this.lastDiff=void 0),Object.assign(this,{document:e.document,variables:e.variables,networkError:null,graphQLErrors:this.graphQLErrors||[],networkStatus:t}),e.observableQuery&&this.setObservableQuery(e.observableQuery),e.lastRequestId&&(this.lastRequestId=e.lastRequestId),this},e.prototype.reset=function(){On(this),this.dirty=!1},e.prototype.getDiff=function(e){void 0===e&&(e=this.variables);var t=this.getDiffOptions(e);if(this.lastDiff&&jt(t,this.lastDiff.options))return this.lastDiff.diff;this.updateWatch(this.variables=e);var r=this.observableQuery;if(r&&"no-cache"===r.options.fetchPolicy)return{complete:!1};var n=this.cache.diff(t);return this.updateLastDiff(n,t),n},e.prototype.updateLastDiff=function(e,t){this.lastDiff=e?{diff:e,options:t||this.getDiffOptions()}:void 0},e.prototype.getDiffOptions=function(e){var t;return void 0===e&&(e=this.variables),{query:this.document,variables:e,returnPartialData:!0,optimistic:!0,canonizeResults:null===(t=this.observableQuery)||void 0===t?void 0:t.options.canonizeResults}},e.prototype.setDiff=function(e){var t=this,r=this.lastDiff&&this.lastDiff.diff;this.updateLastDiff(e),this.dirty||jt(r&&r.result,e&&e.result)||(this.dirty=!0,this.notifyTimeout||(this.notifyTimeout=setTimeout((function(){return t.notify()}),0)))},e.prototype.setObservableQuery=function(e){var t=this;e!==this.observableQuery&&(this.oqListener&&this.listeners.delete(this.oqListener),this.observableQuery=e,e?(e.queryInfo=this,this.listeners.add(this.oqListener=function(){t.getDiff().fromOptimisticTransaction?e.observe():Tr(e)})):delete this.oqListener)},e.prototype.notify=function(){var e=this;On(this),this.shouldNotify()&&this.listeners.forEach((function(t){return t(e)})),this.dirty=!1},e.prototype.shouldNotify=function(){if(!this.dirty||!this.listeners.size)return!1;if(gr(this.networkStatus)&&this.observableQuery){var e=this.observableQuery.options.fetchPolicy;if("cache-only"!==e&&"cache-and-network"!==e)return!1}return!0},e.prototype.stop=function(){if(!this.stopped){this.stopped=!0,this.reset(),this.cancel(),this.cancel=e.prototype.cancel,this.subscriptions.forEach((function(e){return e.unsubscribe()}));var t=this.observableQuery;t&&t.stopPolling()}},e.prototype.cancel=function(){},e.prototype.updateWatch=function(e){var t=this;void 0===e&&(e=this.variables);var r=this.observableQuery;if(!r||"no-cache"!==r.options.fetchPolicy){var i=(0,n.__assign)((0,n.__assign)({},this.getDiffOptions(e)),{watcher:this,callback:function(e){return t.setDiff(e)}});this.lastWatch&&jt(i,this.lastWatch)||(this.cancel(),this.cancel=this.cache.watch(this.lastWatch=i))}},e.prototype.resetLastWrite=function(){this.lastWrite=void 0},e.prototype.shouldWrite=function(e,t){var r=this.lastWrite;return!(r&&r.dmCount===gn.get(this.cache)&&jt(t,r.variables)&&jt(e.data,r.result.data))},e.prototype.markResult=function(e,t,r,n){var i=this,o=new Lt,a=Rt(e.errors)?e.errors.slice(0):[];if(this.reset(),"incremental"in e&&Rt(e.incremental)){var s=Ut(this.getDiff().result,e);e.data=s}else if("hasNext"in e&&e.hasNext){var u=this.getDiff();e.data=o.merge(u.result,e.data)}this.graphQLErrors=a,"no-cache"===r.fetchPolicy?this.updateLastDiff({result:e.data,complete:!0},this.getDiffOptions(r.variables)):0!==n&&(Sn(e,r.errorPolicy)?this.cache.performTransaction((function(o){if(i.shouldWrite(e,r.variables))o.writeQuery({query:t,data:e.data,variables:r.variables,overwrite:1===n}),i.lastWrite={result:e,variables:r.variables,dmCount:gn.get(i.cache)};else if(i.lastDiff&&i.lastDiff.diff.complete)return void(e.data=i.lastDiff.diff.result);var a=i.getDiffOptions(r.variables),s=o.diff(a);i.stopped||i.updateWatch(r.variables),i.updateLastDiff(s,a),s.complete&&(e.data=s.result)})):this.lastWrite=void 0)},e.prototype.markReady=function(){return this.networkError=null,this.networkStatus=mr.ready},e.prototype.markError=function(e){return this.networkStatus=mr.error,this.lastWrite=void 0,this.reset(),e.graphQLErrors&&(this.graphQLErrors=e.graphQLErrors),e.networkError&&(this.networkError=e.networkError),e},e}();function Sn(e,t){void 0===t&&(t="none");var r="ignore"===t||"all"===t,n=!er(e);return!n&&r&&e.data&&(n=!0),n}var En=Object.prototype.hasOwnProperty,In=function(){function e(e){var t=e.cache,r=e.link,n=e.defaultOptions,i=e.queryDeduplication,o=void 0!==i&&i,a=e.onBroadcast,s=e.ssrMode,u=void 0!==s&&s,c=e.clientAwareness,l=void 0===c?{}:c,f=e.localState,d=e.assumeImmutableResults;this.clientAwareness={},this.queries=new Map,this.fetchCancelFns=new Map,this.transformCache=new($e?WeakMap:Map),this.queryIdCounter=1,this.requestIdCounter=1,this.mutationIdCounter=1,this.inFlightLinkObservables=new Map,this.cache=t,this.link=r,this.defaultOptions=n||Object.create(null),this.queryDeduplication=o,this.clientAwareness=l,this.localState=f||new bn({cache:t}),this.ssrMode=u,this.assumeImmutableResults=!!d,(this.onBroadcast=a)&&(this.mutationStore=Object.create(null))}return e.prototype.stop=function(){var e=this;this.queries.forEach((function(t,r){e.stopQueryNoBroadcast(r)})),this.cancelPendingFetches(__DEV__?new s("QueryManager stopped while query was in flight"):new s(14))},e.prototype.cancelPendingFetches=function(e){this.fetchCancelFns.forEach((function(t){return t(e)})),this.fetchCancelFns.clear()},e.prototype.mutate=function(e){var t,r,i=e.mutation,o=e.variables,a=e.optimisticResponse,s=e.updateQueries,c=e.refetchQueries,l=void 0===c?[]:c,f=e.awaitRefetchQueries,d=void 0!==f&&f,p=e.update,h=e.onQueryUpdated,y=e.fetchPolicy,v=void 0===y?(null===(t=this.defaultOptions.mutate)||void 0===t?void 0:t.fetchPolicy)||"network-only":y,m=e.errorPolicy,b=void 0===m?(null===(r=this.defaultOptions.mutate)||void 0===r?void 0:r.errorPolicy)||"none":m,g=e.keepRootFields,_=e.context;return(0,n.__awaiter)(this,void 0,void 0,(function(){var e,t,r,c,f,y;return(0,n.__generator)(this,(function(m){switch(m.label){case 0:return __DEV__?u(i,"mutation option is required. You must specify your GraphQL document in the mutation option."):u(i,15),__DEV__?u("network-only"===v||"no-cache"===v,"Mutations support only 'network-only' or 'no-cache' fetchPolicy strings. The default `network-only` behavior automatically writes mutation results to the cache. Passing `no-cache` skips the cache write."):u("network-only"===v||"no-cache"===v,16),e=this.generateMutationId(),t=this.transform(i),r=t.document,c=t.hasClientExports,i=this.cache.transformForLink(r),o=this.getVariables(i,o),c?[4,this.localState.addExportedVariables(i,o,_)]:[3,2];case 1:o=m.sent(),m.label=2;case 2:return f=this.mutationStore&&(this.mutationStore[e]={mutation:i,variables:o,loading:!0,error:null}),a&&this.markMutationOptimistic(a,{mutationId:e,document:i,variables:o,fetchPolicy:v,errorPolicy:b,context:_,updateQueries:s,update:p,keepRootFields:g}),this.broadcastQueries(),y=this,[2,new Promise((function(t,r){return Xt(y.getObservableFromLink(i,(0,n.__assign)((0,n.__assign)({},_),{optimisticResponse:a}),o,!1),(function(t){if(er(t)&&"none"===b)throw new br({graphQLErrors:tr(t)});f&&(f.loading=!1,f.error=null);var r=(0,n.__assign)({},t);return"function"==typeof l&&(l=l(r)),"ignore"===b&&er(r)&&delete r.errors,y.markMutationResult({mutationId:e,result:r,document:i,variables:o,fetchPolicy:v,errorPolicy:b,context:_,update:p,updateQueries:s,awaitRefetchQueries:d,refetchQueries:l,removeOptimistic:a?e:void 0,onQueryUpdated:h,keepRootFields:g})})).subscribe({next:function(e){y.broadcastQueries(),"hasNext"in e&&!1!==e.hasNext||t(e)},error:function(t){f&&(f.loading=!1,f.error=t),a&&y.cache.removeOptimistic(e),y.broadcastQueries(),r(t instanceof br?t:new br({networkError:t}))}})}))]}}))}))},e.prototype.markMutationResult=function(e,t){var r=this;void 0===t&&(t=this.cache);var i=e.result,o=[],a="no-cache"===e.fetchPolicy;if(!a&&Sn(i,e.errorPolicy)){if(Vt(i)||o.push({result:i.data,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}),Vt(i)&&Rt(i.incremental)){var s=t.diff({id:"ROOT_MUTATION",query:this.transform(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0}),u=void 0;s.result&&(u=Ut(s.result,i)),void 0!==u&&(i.data=u,o.push({result:u,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}))}var c=e.updateQueries;c&&this.queries.forEach((function(e,n){var a=e.observableQuery,s=a&&a.queryName;if(s&&En.call(c,s)){var u=c[s],l=r.queries.get(n),f=l.document,d=l.variables,p=t.diff({query:f,variables:d,returnPartialData:!0,optimistic:!1}),h=p.result;if(p.complete&&h){var y=u(h,{mutationResult:i,queryName:f&&fe(f)||void 0,queryVariables:d});y&&o.push({result:y,dataId:"ROOT_QUERY",query:f,variables:d})}}}))}if(o.length>0||e.refetchQueries||e.update||e.onQueryUpdated||e.removeOptimistic){var l=[];if(this.refetchQueries({updateCache:function(t){a||o.forEach((function(e){return t.write(e)}));var s,u=e.update,c=!(Vt(s=i)||function(e){return"hasNext"in e&&"data"in e}(s))||Vt(i)&&!i.hasNext;if(u){if(!a){var l=t.diff({id:"ROOT_MUTATION",query:r.transform(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0});l.complete&&("incremental"in(i=(0,n.__assign)((0,n.__assign)({},i),{data:l.result}))&&delete i.incremental,"hasNext"in i&&delete i.hasNext)}c&&u(t,i,{context:e.context,variables:e.variables})}a||e.keepRootFields||!c||t.modify({id:"ROOT_MUTATION",fields:function(e,t){var r=t.fieldName,n=t.DELETE;return"__typename"===r?e:n}})},include:e.refetchQueries,optimistic:!1,removeOptimistic:e.removeOptimistic,onQueryUpdated:e.onQueryUpdated||null}).forEach((function(e){return l.push(e)})),e.awaitRefetchQueries||e.onQueryUpdated)return Promise.all(l).then((function(){return i}))}return Promise.resolve(i)},e.prototype.markMutationOptimistic=function(e,t){var r=this,i="function"==typeof e?e(t.variables):e;return this.cache.recordOptimisticTransaction((function(e){try{r.markMutationResult((0,n.__assign)((0,n.__assign)({},t),{result:{data:i}}),e)}catch(e){__DEV__&&u.error(e)}}),t.mutationId)},e.prototype.fetchQuery=function(e,t,r){return this.fetchQueryObservable(e,t,r).promise},e.prototype.getQueryStore=function(){var e=Object.create(null);return this.queries.forEach((function(t,r){e[r]={variables:t.variables,networkStatus:t.networkStatus,networkError:t.networkError,graphQLErrors:t.graphQLErrors}})),e},e.prototype.resetErrors=function(e){var t=this.queries.get(e);t&&(t.networkError=void 0,t.graphQLErrors=[])},e.prototype.transform=function(e){var t=this.transformCache;if(!t.has(e)){var r=this.cache.transformDocument(e),i=ar([ur],ce(r)),o=this.localState.clientQuery(r),a=i&&this.localState.serverQuery(i),s={document:r,hasClientExports:Re(r),hasForcedResolvers:this.localState.shouldForceResolvers(r),clientQuery:o,serverQuery:a,defaultVars:ye(le(r)),asQuery:(0,n.__assign)((0,n.__assign)({},r),{definitions:r.definitions.map((function(e){return"OperationDefinition"===e.kind&&"query"!==e.operation?(0,n.__assign)((0,n.__assign)({},e),{operation:"query"}):e}))})},u=function(e){e&&!t.has(e)&&t.set(e,s)};u(e),u(r),u(o),u(a)}return t.get(e)},e.prototype.getVariables=function(e,t){return(0,n.__assign)((0,n.__assign)({},this.transform(e).defaultVars),t)},e.prototype.watchQuery=function(e){void 0===(e=(0,n.__assign)((0,n.__assign)({},e),{variables:this.getVariables(e.query,e.variables)})).notifyOnNetworkStatusChange&&(e.notifyOnNetworkStatusChange=!1);var t=new wn(this),r=new Pr({queryManager:this,queryInfo:t,options:e});return this.queries.set(r.queryId,t),t.init({document:r.query,observableQuery:r,variables:r.variables}),r},e.prototype.query=function(e,t){var r=this;return void 0===t&&(t=this.generateQueryId()),__DEV__?u(e.query,"query option is required. You must specify your GraphQL document in the query option."):u(e.query,17),__DEV__?u("Document"===e.query.kind,'You must wrap the query string in a "gql" tag.'):u("Document"===e.query.kind,18),__DEV__?u(!e.returnPartialData,"returnPartialData option only supported on watchQuery."):u(!e.returnPartialData,19),__DEV__?u(!e.pollInterval,"pollInterval option only supported on watchQuery."):u(!e.pollInterval,20),this.fetchQuery(t,e).finally((function(){return r.stopQuery(t)}))},e.prototype.generateQueryId=function(){return String(this.queryIdCounter++)},e.prototype.generateRequestId=function(){return this.requestIdCounter++},e.prototype.generateMutationId=function(){return String(this.mutationIdCounter++)},e.prototype.stopQueryInStore=function(e){this.stopQueryInStoreNoBroadcast(e),this.broadcastQueries()},e.prototype.stopQueryInStoreNoBroadcast=function(e){var t=this.queries.get(e);t&&t.stop()},e.prototype.clearStore=function(e){return void 0===e&&(e={discardWatches:!0}),this.cancelPendingFetches(__DEV__?new s("Store reset while query was in flight (not completed in link chain)"):new s(21)),this.queries.forEach((function(e){e.observableQuery?e.networkStatus=mr.loading:e.stop()})),this.mutationStore&&(this.mutationStore=Object.create(null)),this.cache.reset(e)},e.prototype.getObservableQueries=function(e){var t=this;void 0===e&&(e="active");var r=new Map,i=new Map,o=new Set;return Array.isArray(e)&&e.forEach((function(e){var r;"string"==typeof e?i.set(e,!1):K(r=e)&&"Document"===r.kind&&Array.isArray(r.definitions)?i.set(t.transform(e).document,!1):K(e)&&e.query&&o.add(e)})),this.queries.forEach((function(t,n){var o=t.observableQuery,a=t.document;if(o){if("all"===e)return void r.set(n,o);var s=o.queryName;if("standby"===o.options.fetchPolicy||"active"===e&&!o.hasObservers())return;("active"===e||s&&i.has(s)||a&&i.has(a))&&(r.set(n,o),s&&i.set(s,!0),a&&i.set(a,!0))}})),o.size&&o.forEach((function(e){var i=fr("legacyOneTimeQuery"),o=t.getQuery(i).init({document:e.query,variables:e.variables}),a=new Pr({queryManager:t,queryInfo:o,options:(0,n.__assign)((0,n.__assign)({},e),{fetchPolicy:"network-only"})});u(a.queryId===i),o.setObservableQuery(a),r.set(i,a)})),__DEV__&&i.size&&i.forEach((function(e,t){e||__DEV__&&u.warn("Unknown query ".concat("string"==typeof t?"named ":"").concat(JSON.stringify(t,null,2)," requested in refetchQueries options.include array"))})),r},e.prototype.reFetchObservableQueries=function(e){var t=this;void 0===e&&(e=!1);var r=[];return this.getObservableQueries(e?"all":"active").forEach((function(n,i){var o=n.options.fetchPolicy;n.resetLastResults(),(e||"standby"!==o&&"cache-only"!==o)&&r.push(n.refetch()),t.getQuery(i).setDiff(null)})),this.broadcastQueries(),Promise.all(r)},e.prototype.setObservableQuery=function(e){this.getQuery(e.queryId).setObservableQuery(e)},e.prototype.startGraphQLSubscription=function(e){var t=this,r=e.query,n=e.fetchPolicy,i=e.errorPolicy,o=e.variables,a=e.context,s=void 0===a?{}:a;r=this.transform(r).document,o=this.getVariables(r,o);var u=function(e){return t.getObservableFromLink(r,s,e).map((function(o){if("no-cache"!==n&&(Sn(o,i)&&t.cache.write({query:r,result:o.data,dataId:"ROOT_SUBSCRIPTION",variables:e}),t.broadcastQueries()),er(o))throw new br({graphQLErrors:o.errors});return o}))};if(this.transform(r).hasClientExports){var c=this.localState.addExportedVariables(r,o,s).then(u);return new Y((function(e){var t=null;return c.then((function(r){return t=r.subscribe(e)}),e.error),function(){return t&&t.unsubscribe()}}))}return u(o)},e.prototype.stopQuery=function(e){this.stopQueryNoBroadcast(e),this.broadcastQueries()},e.prototype.stopQueryNoBroadcast=function(e){this.stopQueryInStoreNoBroadcast(e),this.removeQuery(e)},e.prototype.removeQuery=function(e){this.fetchCancelFns.delete(e),this.queries.has(e)&&(this.getQuery(e).stop(),this.queries.delete(e))},e.prototype.broadcastQueries=function(){this.onBroadcast&&this.onBroadcast(),this.queries.forEach((function(e){return e.notify()}))},e.prototype.getLocalState=function(){return this.localState},e.prototype.getObservableFromLink=function(e,t,r,i){var o,a,s=this;void 0===i&&(i=null!==(o=null==t?void 0:t.queryDeduplication)&&void 0!==o?o:this.queryDeduplication);var u=this.transform(e).serverQuery;if(u){var c=this.inFlightLinkObservables,l=this.link,f={query:u,variables:r,operationName:fe(u)||void 0,context:this.prepareContext((0,n.__assign)((0,n.__assign)({},t),{forceFetch:!i}))};if(t=f.context,i){var d=c.get(u)||new Map;c.set(u,d);var p=Jt(r);if(!(a=d.get(p))){var h=new yr([Oe(l,f)]);d.set(p,a=h),h.beforeNext((function(){d.delete(p)&&d.size<1&&c.delete(u)}))}}else a=new yr([Oe(l,f)])}else a=new yr([Y.of({data:{}})]),t=this.prepareContext(t);var y=this.transform(e).clientQuery;return y&&(a=Xt(a,(function(e){return s.localState.runResolvers({document:y,remoteResult:e,context:t,variables:r})}))),a},e.prototype.getResultsFromLink=function(e,t,r){var n=e.lastRequestId=this.generateRequestId(),i=this.cache.transformForLink(this.transform(e.document).document);return Xt(this.getObservableFromLink(i,r.context,r.variables),(function(o){var a=tr(o),s=a.length>0;if(n>=e.lastRequestId){if(s&&"none"===r.errorPolicy)throw e.markError(new br({graphQLErrors:a}));e.markResult(o,i,r,t),e.markReady()}var u={data:o.data,loading:!1,networkStatus:mr.ready};return s&&"ignore"!==r.errorPolicy&&(u.errors=a,u.networkStatus=mr.error),u}),(function(t){var r=vr(t)?t:new br({networkError:t});throw n>=e.lastRequestId&&e.markError(r),r}))},e.prototype.fetchQueryObservable=function(e,t,r){var n=this;void 0===r&&(r=mr.loading);var i=this.transform(t.query).document,o=this.getVariables(i,t.variables),a=this.getQuery(e),s=this.defaultOptions.watchQuery,u=t.fetchPolicy,c=void 0===u?s&&s.fetchPolicy||"cache-first":u,l=t.errorPolicy,f=void 0===l?s&&s.errorPolicy||"none":l,d=t.returnPartialData,p=void 0!==d&&d,h=t.notifyOnNetworkStatusChange,y=void 0!==h&&h,v=t.context,m=void 0===v?{}:v,b=Object.assign({},t,{query:i,variables:o,fetchPolicy:c,errorPolicy:f,returnPartialData:p,notifyOnNetworkStatusChange:y,context:m}),g=function(e){b.variables=e;var i=n.fetchQueryByPolicy(a,b,r);return"standby"!==b.fetchPolicy&&i.length>0&&a.observableQuery&&a.observableQuery.applyNextFetchPolicy("after-fetch",t),i},_=function(){return n.fetchCancelFns.delete(e)};this.fetchCancelFns.set(e,(function(e){_(),setTimeout((function(){return O.cancel(e)}))}));var O=new yr(this.transform(b.query).hasClientExports?this.localState.addExportedVariables(b.query,b.variables,b.context).then(g):g(b.variables));return O.promise.then(_,_),O},e.prototype.refetchQueries=function(e){var t=this,r=e.updateCache,n=e.include,i=e.optimistic,o=void 0!==i&&i,a=e.removeOptimistic,s=void 0===a?o?fr("refetchQueries"):void 0:a,u=e.onQueryUpdated,c=new Map;n&&this.getObservableQueries(n).forEach((function(e,r){c.set(r,{oq:e,lastDiff:t.getQuery(r).getDiff()})}));var l=new Map;return r&&this.cache.batch({update:r,optimistic:o&&s||!1,removeOptimistic:s,onWatchUpdated:function(e,t,r){var n=e.watcher instanceof wn&&e.watcher.observableQuery;if(n){if(u){c.delete(n.queryId);var i=u(n,t,r);return!0===i&&(i=n.refetch()),!1!==i&&l.set(n,i),i}null!==u&&c.set(n.queryId,{oq:n,lastDiff:r,diff:t})}}}),c.size&&c.forEach((function(e,r){var n,i=e.oq,o=e.lastDiff,a=e.diff;if(u){if(!a){var s=i.queryInfo;s.reset(),a=s.getDiff()}n=u(i,a,o)}u&&!0!==n||(n=i.refetch()),!1!==n&&l.set(i,n),r.indexOf("legacyOneTimeQuery")>=0&&t.stopQueryNoBroadcast(r)})),s&&this.cache.removeOptimistic(s),l},e.prototype.fetchQueryByPolicy=function(e,t,r){var i=this,o=t.query,a=t.variables,s=t.fetchPolicy,u=t.refetchWritePolicy,c=t.errorPolicy,l=t.returnPartialData,f=t.context,d=t.notifyOnNetworkStatusChange,p=e.networkStatus;e.init({document:this.transform(o).document,variables:a,networkStatus:r});var h=function(){return e.getDiff(a)},y=function(t,r){void 0===r&&(r=e.networkStatus||mr.loading);var s=t.result;!__DEV__||l||jt(s,{})||Ar(t.missing);var u=function(e){return Y.of((0,n.__assign)({data:e,loading:gr(r),networkStatus:r},t.complete?null:{partial:!0}))};return s&&i.transform(o).hasForcedResolvers?i.localState.runResolvers({document:o,remoteResult:{data:s},context:f,variables:a,onlyRunForcedResolvers:!0}).then((function(e){return u(e.data||void 0)})):"none"===c&&r===mr.refetch&&Array.isArray(t.missing)?u(void 0):u(s)},v="no-cache"===s?0:r===mr.refetch&&"merge"!==u?1:2,m=function(){return i.getResultsFromLink(e,v,{variables:a,context:f,fetchPolicy:s,errorPolicy:c})},b=d&&"number"==typeof p&&p!==r&&gr(r);switch(s){default:case"cache-first":return(g=h()).complete?[y(g,e.markReady())]:l||b?[y(g),m()]:[m()];case"cache-and-network":var g;return(g=h()).complete||l||b?[y(g),m()]:[m()];case"cache-only":return[y(h(),e.markReady())];case"network-only":return b?[y(h()),m()]:[m()];case"no-cache":return b?[y(e.getDiff()),m()]:[m()];case"standby":return[]}},e.prototype.getQuery=function(e){return e&&!this.queries.has(e)&&this.queries.set(e,new wn(this,e)),this.queries.get(e)},e.prototype.prepareContext=function(e){void 0===e&&(e={});var t=this.localState.prepareContext(e);return(0,n.__assign)((0,n.__assign)({},t),{clientAwareness:this.clientAwareness})},e}();function Pn(e,t){return Sr(e,t,t.variables&&{variables:(0,n.__assign)((0,n.__assign)({},e&&e.variables),t.variables)})}var Tn,jn=!1,An=function(){function e(e){var t=this;this.resetStoreCallbacks=[],this.clearStoreCallbacks=[];var r=e.uri,n=e.credentials,i=e.headers,o=e.cache,a=e.ssrMode,c=void 0!==a&&a,l=e.ssrForceFetchDelay,f=void 0===l?0:l,d=e.connectToDevTools,p=void 0===d?"object"==typeof window&&!window.__APOLLO_CLIENT__&&__DEV__:d,h=e.queryDeduplication,y=void 0===h||h,v=e.defaultOptions,m=e.assumeImmutableResults,b=void 0!==m&&m,g=e.resolvers,_=e.typeDefs,O=e.fragmentMatcher,w=e.name,S=e.version,E=e.link;if(E||(E=r?new wt({uri:r,credentials:n,headers:i}):_e.empty()),!o)throw __DEV__?new s("To initialize Apollo Client, you must specify a 'cache' property in the options object. \nFor more information, please visit: https://go.apollo.dev/c/docs"):new s(9);if(this.link=E,this.cache=o,this.disableNetworkFetches=c||f>0,this.queryDeduplication=y,this.defaultOptions=v||Object.create(null),this.typeDefs=_,f&&setTimeout((function(){return t.disableNetworkFetches=!1}),f),this.watchQuery=this.watchQuery.bind(this),this.query=this.query.bind(this),this.mutate=this.mutate.bind(this),this.resetStore=this.resetStore.bind(this),this.reFetchObservableQueries=this.reFetchObservableQueries.bind(this),p&&"object"==typeof window&&(window.__APOLLO_CLIENT__=this),!jn&&p&&__DEV__&&(jn=!0,"undefined"!=typeof window&&window.document&&window.top===window.self&&!window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__)){var I=window.navigator,P=I&&I.userAgent,T=void 0;"string"==typeof P&&(P.indexOf("Chrome/")>-1?T="https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm":P.indexOf("Firefox/")>-1&&(T="https://addons.mozilla.org/en-US/firefox/addon/apollo-developer-tools/")),T&&__DEV__&&u.log("Download the Apollo DevTools for a better development experience: "+T)}this.version="3.7.9",this.localState=new bn({cache:o,client:this,resolvers:g,fragmentMatcher:O}),this.queryManager=new In({cache:this.cache,link:this.link,defaultOptions:this.defaultOptions,queryDeduplication:y,ssrMode:c,clientAwareness:{name:w,version:S},localState:this.localState,assumeImmutableResults:b,onBroadcast:p?function(){t.devToolsHookCb&&t.devToolsHookCb({action:{},state:{queries:t.queryManager.getQueryStore(),mutations:t.queryManager.mutationStore||{}},dataWithOptimisticResults:t.cache.extract(!0)})}:void 0})}return e.prototype.stop=function(){this.queryManager.stop()},e.prototype.watchQuery=function(e){return this.defaultOptions.watchQuery&&(e=Pn(this.defaultOptions.watchQuery,e)),!this.disableNetworkFetches||"network-only"!==e.fetchPolicy&&"cache-and-network"!==e.fetchPolicy||(e=(0,n.__assign)((0,n.__assign)({},e),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(e)},e.prototype.query=function(e){return this.defaultOptions.query&&(e=Pn(this.defaultOptions.query,e)),__DEV__?u("cache-and-network"!==e.fetchPolicy,"The cache-and-network fetchPolicy does not work with client.query, because client.query can only return a single result. Please use client.watchQuery to receive multiple results from the cache and the network, or consider using a different fetchPolicy, such as cache-first or network-only."):u("cache-and-network"!==e.fetchPolicy,10),this.disableNetworkFetches&&"network-only"===e.fetchPolicy&&(e=(0,n.__assign)((0,n.__assign)({},e),{fetchPolicy:"cache-first"})),this.queryManager.query(e)},e.prototype.mutate=function(e){return this.defaultOptions.mutate&&(e=Pn(this.defaultOptions.mutate,e)),this.queryManager.mutate(e)},e.prototype.subscribe=function(e){return this.queryManager.startGraphQLSubscription(e)},e.prototype.readQuery=function(e,t){return void 0===t&&(t=!1),this.cache.readQuery(e,t)},e.prototype.readFragment=function(e,t){return void 0===t&&(t=!1),this.cache.readFragment(e,t)},e.prototype.writeQuery=function(e){this.cache.writeQuery(e),this.queryManager.broadcastQueries()},e.prototype.writeFragment=function(e){this.cache.writeFragment(e),this.queryManager.broadcastQueries()},e.prototype.__actionHookForDevTools=function(e){this.devToolsHookCb=e},e.prototype.__requestRaw=function(e){return Oe(this.link,e)},e.prototype.resetStore=function(){var e=this;return Promise.resolve().then((function(){return e.queryManager.clearStore({discardWatches:!1})})).then((function(){return Promise.all(e.resetStoreCallbacks.map((function(e){return e()})))})).then((function(){return e.reFetchObservableQueries()}))},e.prototype.clearStore=function(){var e=this;return Promise.resolve().then((function(){return e.queryManager.clearStore({discardWatches:!0})})).then((function(){return Promise.all(e.clearStoreCallbacks.map((function(e){return e()})))}))},e.prototype.onResetStore=function(e){var t=this;return this.resetStoreCallbacks.push(e),function(){t.resetStoreCallbacks=t.resetStoreCallbacks.filter((function(t){return t!==e}))}},e.prototype.onClearStore=function(e){var t=this;return this.clearStoreCallbacks.push(e),function(){t.clearStoreCallbacks=t.clearStoreCallbacks.filter((function(t){return t!==e}))}},e.prototype.reFetchObservableQueries=function(e){return this.queryManager.reFetchObservableQueries(e)},e.prototype.refetchQueries=function(e){var t=this.queryManager.refetchQueries(e),r=[],n=[];t.forEach((function(e,t){r.push(t),n.push(e)}));var i=Promise.all(n);return i.queries=r,i.results=n,i.catch((function(e){__DEV__&&u.debug("In client.refetchQueries, Promise.all promise rejected with error ".concat(e))})),i},e.prototype.getObservableQueries=function(e){return void 0===e&&(e="active"),this.queryManager.getObservableQueries(e)},e.prototype.extract=function(e){return this.cache.extract(e)},e.prototype.restore=function(e){return this.cache.restore(e)},e.prototype.addResolvers=function(e){this.localState.addResolvers(e)},e.prototype.setResolvers=function(e){this.localState.setResolvers(e)},e.prototype.getResolvers=function(){return this.localState.getResolvers()},e.prototype.setLocalStateFragmentMatcher=function(e){this.localState.setFragmentMatcher(e)},e.prototype.setLink=function(e){this.link=this.queryManager.link=e},e}();Tn||(Tn={});var xn=function(){function e(){this.getFragmentDoc=dn(H)}return e.prototype.batch=function(e){var t,r=this,n="string"==typeof e.optimistic?e.optimistic:!1===e.optimistic?null:void 0;return this.performTransaction((function(){return t=e.update(r)}),n),t},e.prototype.recordOptimisticTransaction=function(e,t){this.performTransaction(e,t)},e.prototype.transformDocument=function(e){return e},e.prototype.transformForLink=function(e){return e},e.prototype.identify=function(e){},e.prototype.gc=function(){return[]},e.prototype.modify=function(e){return!1},e.prototype.readQuery=function(e,t){return void 0===t&&(t=!!e.optimistic),this.read((0,n.__assign)((0,n.__assign)({},e),{rootId:e.id||"ROOT_QUERY",optimistic:t}))},e.prototype.readFragment=function(e,t){return void 0===t&&(t=!!e.optimistic),this.read((0,n.__assign)((0,n.__assign)({},e),{query:this.getFragmentDoc(e.fragment,e.fragmentName),rootId:e.id,optimistic:t}))},e.prototype.writeQuery=function(e){var t=e.id,r=e.data,i=(0,n.__rest)(e,["id","data"]);return this.write(Object.assign(i,{dataId:t||"ROOT_QUERY",result:r}))},e.prototype.writeFragment=function(e){var t=e.id,r=e.data,i=e.fragment,o=e.fragmentName,a=(0,n.__rest)(e,["id","data","fragment","fragmentName"]);return this.write(Object.assign(a,{query:this.getFragmentDoc(i,o),dataId:t,result:r}))},e.prototype.updateQuery=function(e,t){return this.batch({update:function(r){var i=r.readQuery(e),o=t(i);return null==o?i:(r.writeQuery((0,n.__assign)((0,n.__assign)({},e),{data:o})),o)}})},e.prototype.updateFragment=function(e,t){return this.batch({update:function(r){var i=r.readFragment(e),o=t(i);return null==o?i:(r.writeFragment((0,n.__assign)((0,n.__assign)({},e),{data:o})),o)}})},e}(),kn=function(e){function t(r,n,i,o){var a,s=e.call(this,r)||this;if(s.message=r,s.path=n,s.query=i,s.variables=o,Array.isArray(s.path)){s.missing=s.message;for(var u=s.path.length-1;u>=0;--u)s.missing=((a={})[s.path[u]]=s.missing,a)}else s.missing=s.path;return s.__proto__=t.prototype,s}return(0,n.__extends)(t,e),t}(Error);function Mn(e){return __DEV__&&(t=e,(r=new Set([t])).forEach((function(e){K(e)&&function(e){if(__DEV__&&!Object.isFrozen(e))try{Object.freeze(e)}catch(e){if(e instanceof TypeError)return null;throw e}return e}(e)===e&&Object.getOwnPropertyNames(e).forEach((function(t){K(e[t])&&r.add(e[t])}))}))),e;var t,r}var Nn=Object.prototype.hasOwnProperty;function Dn(e){return null==e}function Rn(e,t){var r=e.__typename,n=e.id,i=e._id;if("string"==typeof r&&(t&&(t.keyObject=Dn(n)?Dn(i)?void 0:{_id:i}:{id:n}),Dn(n)&&!Dn(i)&&(n=i),!Dn(n)))return"".concat(r,":").concat("number"==typeof n||"string"==typeof n?n:JSON.stringify(n))}var Cn={dataIdFromObject:Rn,addTypename:!0,resultCaching:!0,canonizeResults:!1};function Fn(e){var t=e.canonizeResults;return void 0===t?Cn.canonizeResults:t}var $n=/^[_a-z][_0-9a-z]*/i;function qn(e){var t=e.match($n);return t?t[0]:e}function Ln(e,t,r){return!!K(t)&&(Dt(t)?t.every((function(t){return Ln(e,t,r)})):e.selections.every((function(e){if(ue(e)&&Ne(e,r)){var n=ae(e);return Nn.call(t,n)&&(!e.selectionSet||Ln(e.selectionSet,t[n],r))}return!0})))}function Vn(e){return K(e)&&!X(e)&&!Dt(e)}function Un(e,t){var r=G(de(e));return{fragmentMap:r,lookupFragment:function(e){var n=r[e];return!n&&t&&(n=t.lookup(e)),n||null}}}var Qn=Object.create(null),zn=function(){return Qn},Bn=Object.create(null),Wn=function(){function e(e,t){var r=this;this.policies=e,this.group=t,this.data=Object.create(null),this.rootIds=Object.create(null),this.refs=Object.create(null),this.getFieldValue=function(e,t){return Mn(X(e)?r.get(e.__ref,t):e&&e[t])},this.canRead=function(e){return X(e)?r.has(e.__ref):"object"==typeof e},this.toReference=function(e,t){if("string"==typeof e)return Z(e);if(X(e))return e;var n=r.policies.identify(e)[0];if(n){var i=Z(n);return t&&r.merge(n,e),i}}}return e.prototype.toObject=function(){return(0,n.__assign)({},this.data)},e.prototype.has=function(e){return void 0!==this.lookup(e,!0)},e.prototype.get=function(e,t){if(this.group.depend(e,t),Nn.call(this.data,e)){var r=this.data[e];if(r&&Nn.call(r,t))return r[t]}return"__typename"===t&&Nn.call(this.policies.rootTypenamesById,e)?this.policies.rootTypenamesById[e]:this instanceof Gn?this.parent.get(e,t):void 0},e.prototype.lookup=function(e,t){return t&&this.group.depend(e,"__exists"),Nn.call(this.data,e)?this.data[e]:this instanceof Gn?this.parent.lookup(e,t):this.policies.rootTypenamesById[e]?Object.create(null):void 0},e.prototype.merge=function(e,t){var r,n=this;X(e)&&(e=e.__ref),X(t)&&(t=t.__ref);var i="string"==typeof e?this.lookup(r=e):e,o="string"==typeof t?this.lookup(r=t):t;if(o){__DEV__?u("string"==typeof r,"store.merge expects a string ID"):u("string"==typeof r,1);var a=new Lt(Zn).merge(i,o);if(this.data[r]=a,a!==i&&(delete this.refs[r],this.group.caching)){var s=Object.create(null);i||(s.__exists=1),Object.keys(o).forEach((function(e){if(!i||i[e]!==a[e]){s[e]=1;var t=qn(e);t===e||n.policies.hasKeyArgs(a.__typename,t)||(s[t]=1),void 0!==a[e]||n instanceof Gn||delete a[e]}})),!s.__typename||i&&i.__typename||this.policies.rootTypenamesById[r]!==a.__typename||delete s.__typename,Object.keys(s).forEach((function(e){return n.group.dirty(r,e)}))}}},e.prototype.modify=function(e,t){var r=this,i=this.lookup(e);if(i){var o=Object.create(null),a=!1,s=!0,u={DELETE:Qn,INVALIDATE:Bn,isReference:X,toReference:this.toReference,canRead:this.canRead,readField:function(t,n){return r.policies.readField("string"==typeof t?{fieldName:t,from:n||Z(e)}:t,{store:r})}};if(Object.keys(i).forEach((function(c){var l=qn(c),f=i[c];if(void 0!==f){var d="function"==typeof t?t:t[c]||t[l];if(d){var p=d===zn?Qn:d(Mn(f),(0,n.__assign)((0,n.__assign)({},u),{fieldName:l,storeFieldName:c,storage:r.getStorage(e,c)}));p===Bn?r.group.dirty(e,c):(p===Qn&&(p=void 0),p!==f&&(o[c]=p,a=!0,f=p))}void 0!==f&&(s=!1)}})),a)return this.merge(e,o),s&&(this instanceof Gn?this.data[e]=void 0:delete this.data[e],this.group.dirty(e,"__exists")),!0}return!1},e.prototype.delete=function(e,t,r){var n,i=this.lookup(e);if(i){var o=this.getFieldValue(i,"__typename"),a=t&&r?this.policies.getStoreFieldName({typename:o,fieldName:t,args:r}):t;return this.modify(e,a?((n={})[a]=zn,n):zn)}return!1},e.prototype.evict=function(e,t){var r=!1;return e.id&&(Nn.call(this.data,e.id)&&(r=this.delete(e.id,e.fieldName,e.args)),this instanceof Gn&&this!==t&&(r=this.parent.evict(e,t)||r),(e.fieldName||r)&&this.group.dirty(e.id,e.fieldName||"__exists")),r},e.prototype.clear=function(){this.replace(null)},e.prototype.extract=function(){var e=this,t=this.toObject(),r=[];return this.getRootIdSet().forEach((function(t){Nn.call(e.policies.rootTypenamesById,t)||r.push(t)})),r.length&&(t.__META={extraRootIds:r.sort()}),t},e.prototype.replace=function(e){var t=this;if(Object.keys(this.data).forEach((function(r){e&&Nn.call(e,r)||t.delete(r)})),e){var r=e.__META,i=(0,n.__rest)(e,["__META"]);Object.keys(i).forEach((function(e){t.merge(e,i[e])})),r&&r.extraRootIds.forEach(this.retain,this)}},e.prototype.retain=function(e){return this.rootIds[e]=(this.rootIds[e]||0)+1},e.prototype.release=function(e){if(this.rootIds[e]>0){var t=--this.rootIds[e];return t||delete this.rootIds[e],t}return 0},e.prototype.getRootIdSet=function(e){return void 0===e&&(e=new Set),Object.keys(this.rootIds).forEach(e.add,e),this instanceof Gn?this.parent.getRootIdSet(e):Object.keys(this.policies.rootTypenamesById).forEach(e.add,e),e},e.prototype.gc=function(){var e=this,t=this.getRootIdSet(),r=this.toObject();t.forEach((function(n){Nn.call(r,n)&&(Object.keys(e.findChildRefIds(n)).forEach(t.add,t),delete r[n])}));var n=Object.keys(r);if(n.length){for(var i=this;i instanceof Gn;)i=i.parent;n.forEach((function(e){return i.delete(e)}))}return n},e.prototype.findChildRefIds=function(e){if(!Nn.call(this.refs,e)){var t=this.refs[e]=Object.create(null),r=this.data[e];if(!r)return t;var n=new Set([r]);n.forEach((function(e){X(e)&&(t[e.__ref]=!0),K(e)&&Object.keys(e).forEach((function(t){var r=e[t];K(r)&&n.add(r)}))}))}return this.refs[e]},e.prototype.makeCacheKey=function(){return this.group.keyMaker.lookupArray(arguments)},e}(),Yn=function(){function e(e,t){void 0===t&&(t=null),this.caching=e,this.parent=t,this.d=null,this.resetCaching()}return e.prototype.resetCaching=function(){this.d=this.caching?cn():null,this.keyMaker=new Ht($e)},e.prototype.depend=function(e,t){if(this.d){this.d(Kn(e,t));var r=qn(t);r!==t&&this.d(Kn(e,r)),this.parent&&this.parent.depend(e,t)}},e.prototype.dirty=function(e,t){this.d&&this.d.dirty(Kn(e,t),"__exists"===t?"forget":"setDirty")},e}();function Kn(e,t){return t+"#"+e}function Hn(e,t){Xn(e)&&e.group.depend(t,"__exists")}!function(e){var t=function(e){function t(t){var r=t.policies,n=t.resultCaching,i=void 0===n||n,o=t.seed,a=e.call(this,r,new Yn(i))||this;return a.stump=new Jn(a),a.storageTrie=new Ht($e),o&&a.replace(o),a}return(0,n.__extends)(t,e),t.prototype.addLayer=function(e,t){return this.stump.addLayer(e,t)},t.prototype.removeLayer=function(){return this},t.prototype.getStorage=function(){return this.storageTrie.lookupArray(arguments)},t}(e);e.Root=t}(Wn||(Wn={}));var Gn=function(e){function t(t,r,n,i){var o=e.call(this,r.policies,i)||this;return o.id=t,o.parent=r,o.replay=n,o.group=i,n(o),o}return(0,n.__extends)(t,e),t.prototype.addLayer=function(e,r){return new t(e,this,r,this.group)},t.prototype.removeLayer=function(e){var t=this,r=this.parent.removeLayer(e);return e===this.id?(this.group.caching&&Object.keys(this.data).forEach((function(e){var n=t.data[e],i=r.lookup(e);i?n?n!==i&&Object.keys(n).forEach((function(r){jt(n[r],i[r])||t.group.dirty(e,r)})):(t.group.dirty(e,"__exists"),Object.keys(i).forEach((function(r){t.group.dirty(e,r)}))):t.delete(e)})),r):r===this.parent?this:r.addLayer(this.id,this.replay)},t.prototype.toObject=function(){return(0,n.__assign)((0,n.__assign)({},this.parent.toObject()),this.data)},t.prototype.findChildRefIds=function(t){var r=this.parent.findChildRefIds(t);return Nn.call(this.data,t)?(0,n.__assign)((0,n.__assign)({},r),e.prototype.findChildRefIds.call(this,t)):r},t.prototype.getStorage=function(){for(var e=this.parent;e.parent;)e=e.parent;return e.getStorage.apply(e,arguments)},t}(Wn),Jn=function(e){function t(t){return e.call(this,"EntityStore.Stump",t,(function(){}),new Yn(t.group.caching,t.group))||this}return(0,n.__extends)(t,e),t.prototype.removeLayer=function(){return this},t.prototype.merge=function(){return this.parent.merge.apply(this.parent,arguments)},t}(Gn);function Zn(e,t,r){var n=e[r],i=t[r];return jt(n,i)?n:i}function Xn(e){return!!(e instanceof Wn&&e.group.caching)}function ei(e){return[e.selectionSet,e.objectOrReference,e.context,e.context.canonizeResults]}var ti=function(){function e(e){var t=this;this.knownResults=new($e?WeakMap:Map),this.config=Sr(e,{addTypename:!1!==e.addTypename,canonizeResults:Fn(e)}),this.canon=e.canon||new Gt,this.executeSelectionSet=dn((function(e){var r,i=e.context.canonizeResults,o=ei(e);o[3]=!i;var a=(r=t.executeSelectionSet).peek.apply(r,o);return a?i?(0,n.__assign)((0,n.__assign)({},a),{result:t.canon.admit(a.result)}):a:(Hn(e.context.store,e.enclosingRef.__ref),t.execSelectionSetImpl(e))}),{max:this.config.resultCacheMaxSize,keyArgs:ei,makeCacheKey:function(e,t,r,n){if(Xn(r.store))return r.store.makeCacheKey(e,X(t)?t.__ref:t,r.varString,n)}}),this.executeSubSelectedArray=dn((function(e){return Hn(e.context.store,e.enclosingRef.__ref),t.execSubSelectedArrayImpl(e)}),{max:this.config.resultCacheMaxSize,makeCacheKey:function(e){var t=e.field,r=e.array,n=e.context;if(Xn(n.store))return n.store.makeCacheKey(t,r,n.varString)}})}return e.prototype.resetCanon=function(){this.canon=new Gt},e.prototype.diffQueryAgainstStore=function(e){var t=e.store,r=e.query,i=e.rootId,o=void 0===i?"ROOT_QUERY":i,a=e.variables,s=e.returnPartialData,u=void 0===s||s,c=e.canonizeResults,l=void 0===c?this.config.canonizeResults:c,f=this.config.cache.policies;a=(0,n.__assign)((0,n.__assign)({},ye(pe(r))),a);var d,p=Z(o),h=this.executeSelectionSet({selectionSet:he(r).selectionSet,objectOrReference:p,enclosingRef:p,context:(0,n.__assign)({store:t,query:r,policies:f,variables:a,varString:Jt(a),canonizeResults:l},Un(r,this.config.fragments))});if(h.missing&&(d=[new kn(ri(h.missing),h.missing,r,a)],!u))throw d[0];return{result:h.result,complete:!d,missing:d}},e.prototype.isFresh=function(e,t,r,n){if(Xn(n.store)&&this.knownResults.get(e)===r){var i=this.executeSelectionSet.peek(r,t,n,this.canon.isKnown(e));if(i&&e===i.result)return!0}return!1},e.prototype.execSelectionSetImpl=function(e){var t=this,r=e.selectionSet,n=e.objectOrReference,i=e.enclosingRef,o=e.context;if(X(n)&&!o.policies.rootTypenamesById[n.__ref]&&!o.store.has(n.__ref))return{result:this.canon.empty,missing:"Dangling reference to missing ".concat(n.__ref," object")};var a,u=o.variables,c=o.policies,l=o.store.getFieldValue(n,"__typename"),f=[],d=new Lt;function p(e,t){var r;return e.missing&&(a=d.merge(a,((r={})[t]=e.missing,r))),e.result}this.config.addTypename&&"string"==typeof l&&!c.rootIdsByTypename[l]&&f.push({__typename:l});var h=new Set(r.selections);h.forEach((function(e){var r,y;if(Ne(e,u))if(ue(e)){var v=c.readField({fieldName:e.name.value,field:e,variables:o.variables,from:n},o),m=ae(e);void 0===v?sr.added(e)||(a=d.merge(a,((r={})[m]="Can't find field '".concat(e.name.value,"' on ").concat(X(n)?n.__ref+" object":"object "+JSON.stringify(n,null,2)),r))):Dt(v)?v=p(t.executeSubSelectedArray({field:e,array:v,enclosingRef:i,context:o}),m):e.selectionSet?null!=v&&(v=p(t.executeSelectionSet({selectionSet:e.selectionSet,objectOrReference:v,enclosingRef:X(v)?v:i,context:o}),m)):o.canonizeResults&&(v=t.canon.pass(v)),void 0!==v&&f.push(((y={})[m]=v,y))}else{var b=J(e,o.lookupFragment);if(!b&&e.kind===je.FRAGMENT_SPREAD)throw __DEV__?new s("No fragment named ".concat(e.name.value)):new s(5);b&&c.fragmentMatches(b,l)&&b.selectionSet.selections.forEach(h.add,h)}}));var y={result:$t(f),missing:a},v=o.canonizeResults?this.canon.admit(y):Mn(y);return v.result&&this.knownResults.set(v.result,r),v},e.prototype.execSubSelectedArrayImpl=function(e){var t,r=this,n=e.field,i=e.array,o=e.enclosingRef,a=e.context,s=new Lt;function c(e,r){var n;return e.missing&&(t=s.merge(t,((n={})[r]=e.missing,n))),e.result}return n.selectionSet&&(i=i.filter(a.store.canRead)),i=i.map((function(e,t){return null===e?null:Dt(e)?c(r.executeSubSelectedArray({field:n,array:e,enclosingRef:o,context:a}),t):n.selectionSet?c(r.executeSelectionSet({selectionSet:n.selectionSet,objectOrReference:e,enclosingRef:X(e)?e:o,context:a}),t):(__DEV__&&function(e,t,r){if(!t.selectionSet){var n=new Set([r]);n.forEach((function(r){K(r)&&(__DEV__?u(!X(r),"Missing selection set for object of type ".concat(function(e,t){return X(t)?e.get(t.__ref,"__typename"):t&&t.__typename}(e,r)," returned for query field ").concat(t.name.value)):u(!X(r),6),Object.values(r).forEach(n.add,n))}))}}(a.store,n,e),e)})),{result:a.canonizeResults?this.canon.admit(i):i,missing:t}},e}();function ri(e){try{JSON.stringify(e,(function(e,t){if("string"==typeof t)throw t;return t}))}catch(e){return e}}var ni=Object.create(null);function ii(e){var t=JSON.stringify(e);return ni[t]||(ni[t]=Object.create(null))}function oi(e){var t=ii(e);return t.keyFieldsFn||(t.keyFieldsFn=function(t,r){var n=function(e,t){return r.readField(t,e)},i=r.keyObject=si(e,(function(e){var i=li(r.storeObject,e,n);return void 0===i&&t!==r.storeObject&&Nn.call(t,e[0])&&(i=li(t,e,ci)),__DEV__?u(void 0!==i,"Missing field '".concat(e.join("."),"' while extracting keyFields from ").concat(JSON.stringify(t))):u(void 0!==i,2),i}));return"".concat(r.typename,":").concat(JSON.stringify(i))})}function ai(e){var t=ii(e);return t.keyArgsFn||(t.keyArgsFn=function(t,r){var n=r.field,i=r.variables,o=r.fieldName,a=si(e,(function(e){var r=e[0],o=r.charAt(0);if("@"!==o)if("$"!==o){if(t)return li(t,e)}else{var a=r.slice(1);if(i&&Nn.call(i,a)){var s=e.slice(0);return s[0]=a,li(i,s)}}else if(n&&Rt(n.directives)){var u=r.slice(1),c=n.directives.find((function(e){return e.name.value===u})),l=c&&oe(c,i);return l&&li(l,e.slice(1))}})),s=JSON.stringify(a);return(t||"{}"!==s)&&(o+=":"+s),o})}function si(e,t){var r=new Lt;return ui(e).reduce((function(e,n){var i,o=t(n);if(void 0!==o){for(var a=n.length-1;a>=0;--a)(i={})[n[a]]=o,o=i;e=r.merge(e,o)}return e}),Object.create(null))}function ui(e){var t=ii(e);if(!t.paths){var r=t.paths=[],n=[];e.forEach((function(t,i){Dt(t)?(ui(t).forEach((function(e){return r.push(n.concat(e))})),n.length=0):(n.push(t),Dt(e[i+1])||(r.push(n.slice(0)),n.length=0))}))}return t.paths}function ci(e,t){return e[t]}function li(e,t,r){return r=r||ci,fi(t.reduce((function e(t,n){return Dt(t)?t.map((function(t){return e(t,n)})):t&&r(t,n)}),e))}function fi(e){return K(e)?Dt(e)?e.map(fi):si(Object.keys(e).sort(),(function(t){return li(e,t)})):e}function di(e){return void 0!==e.args?e.args:e.field?oe(e.field,e.variables):null}re.setStringify(Jt);var pi=function(){},hi=function(e,t){return t.fieldName},yi=function(e,t,r){return(0,r.mergeObjects)(e,t)},vi=function(e,t){return t},mi=function(){function e(e){this.config=e,this.typePolicies=Object.create(null),this.toBeAdded=Object.create(null),this.supertypeMap=new Map,this.fuzzySubtypes=new Map,this.rootIdsByTypename=Object.create(null),this.rootTypenamesById=Object.create(null),this.usingPossibleTypes=!1,this.config=(0,n.__assign)({dataIdFromObject:Rn},e),this.cache=this.config.cache,this.setRootTypename("Query"),this.setRootTypename("Mutation"),this.setRootTypename("Subscription"),e.possibleTypes&&this.addPossibleTypes(e.possibleTypes),e.typePolicies&&this.addTypePolicies(e.typePolicies)}return e.prototype.identify=function(e,t){var r,i=this,o=t&&(t.typename||(null===(r=t.storeObject)||void 0===r?void 0:r.__typename))||e.__typename;if(o===this.rootTypenamesById.ROOT_QUERY)return["ROOT_QUERY"];for(var a,s=t&&t.storeObject||e,u=(0,n.__assign)((0,n.__assign)({},t),{typename:o,storeObject:s,readField:t&&t.readField||function(){var e=gi(arguments,s);return i.readField(e,{store:i.cache.data,variables:e.variables})}}),c=o&&this.getTypePolicy(o),l=c&&c.keyFn||this.config.dataIdFromObject;l;){var f=l(e,u);if(!Dt(f)){a=f;break}l=oi(f)}return a=a?String(a):void 0,u.keyObject?[a,u.keyObject]:[a]},e.prototype.addTypePolicies=function(e){var t=this;Object.keys(e).forEach((function(r){var i=e[r],o=i.queryType,a=i.mutationType,s=i.subscriptionType,u=(0,n.__rest)(i,["queryType","mutationType","subscriptionType"]);o&&t.setRootTypename("Query",r),a&&t.setRootTypename("Mutation",r),s&&t.setRootTypename("Subscription",r),Nn.call(t.toBeAdded,r)?t.toBeAdded[r].push(u):t.toBeAdded[r]=[u]}))},e.prototype.updateTypePolicy=function(e,t){var r=this,n=this.getTypePolicy(e),i=t.keyFields,o=t.fields;function a(e,t){e.merge="function"==typeof t?t:!0===t?yi:!1===t?vi:e.merge}a(n,t.merge),n.keyFn=!1===i?pi:Dt(i)?oi(i):"function"==typeof i?i:n.keyFn,o&&Object.keys(o).forEach((function(t){var n=r.getFieldPolicy(e,t,!0),i=o[t];if("function"==typeof i)n.read=i;else{var s=i.keyArgs,u=i.read,c=i.merge;n.keyFn=!1===s?hi:Dt(s)?ai(s):"function"==typeof s?s:n.keyFn,"function"==typeof u&&(n.read=u),a(n,c)}n.read&&n.merge&&(n.keyFn=n.keyFn||hi)}))},e.prototype.setRootTypename=function(e,t){void 0===t&&(t=e);var r="ROOT_"+e.toUpperCase(),n=this.rootTypenamesById[r];t!==n&&(__DEV__?u(!n||n===e,"Cannot change root ".concat(e," __typename more than once")):u(!n||n===e,3),n&&delete this.rootIdsByTypename[n],this.rootIdsByTypename[t]=r,this.rootTypenamesById[r]=t)},e.prototype.addPossibleTypes=function(e){var t=this;this.usingPossibleTypes=!0,Object.keys(e).forEach((function(r){t.getSupertypeSet(r,!0),e[r].forEach((function(e){t.getSupertypeSet(e,!0).add(r);var n=e.match($n);n&&n[0]===e||t.fuzzySubtypes.set(e,new RegExp(e))}))}))},e.prototype.getTypePolicy=function(e){var t=this;if(!Nn.call(this.typePolicies,e)){var r=this.typePolicies[e]=Object.create(null);r.fields=Object.create(null);var i=this.supertypeMap.get(e);i&&i.size&&i.forEach((function(e){var i=t.getTypePolicy(e),o=i.fields,a=(0,n.__rest)(i,["fields"]);Object.assign(r,a),Object.assign(r.fields,o)}))}var o=this.toBeAdded[e];return o&&o.length&&o.splice(0).forEach((function(r){t.updateTypePolicy(e,r)})),this.typePolicies[e]},e.prototype.getFieldPolicy=function(e,t,r){if(e){var n=this.getTypePolicy(e).fields;return n[t]||r&&(n[t]=Object.create(null))}},e.prototype.getSupertypeSet=function(e,t){var r=this.supertypeMap.get(e);return!r&&t&&this.supertypeMap.set(e,r=new Set),r},e.prototype.fragmentMatches=function(e,t,r,n){var i=this;if(!e.typeCondition)return!0;if(!t)return!1;var o=e.typeCondition.name.value;if(t===o)return!0;if(this.usingPossibleTypes&&this.supertypeMap.has(o))for(var a=this.getSupertypeSet(t,!0),s=[a],c=function(e){var t=i.getSupertypeSet(e,!1);t&&t.size&&s.indexOf(t)<0&&s.push(t)},l=!(!r||!this.fuzzySubtypes.size),f=!1,d=0;d<s.length;++d){var p=s[d];if(p.has(o))return a.has(o)||(f&&__DEV__&&u.warn("Inferring subtype ".concat(t," of supertype ").concat(o)),a.add(o)),!0;p.forEach(c),l&&d===s.length-1&&Ln(e.selectionSet,r,n)&&(l=!1,f=!0,this.fuzzySubtypes.forEach((function(e,r){var n=t.match(e);n&&n[0]===t&&c(r)})))}return!1},e.prototype.hasKeyArgs=function(e,t){var r=this.getFieldPolicy(e,t,!1);return!(!r||!r.keyFn)},e.prototype.getStoreFieldName=function(e){var t,r=e.typename,n=e.fieldName,i=this.getFieldPolicy(r,n,!1),o=i&&i.keyFn;if(o&&r)for(var a={typename:r,fieldName:n,field:e.field||null,variables:e.variables},s=di(e);o;){var u=o(s,a);if(!Dt(u)){t=u||n;break}o=ai(u)}return void 0===t&&(t=e.field?function(e,t){var r=null;e.directives&&(r={},e.directives.forEach((function(e){r[e.name.value]={},e.arguments&&e.arguments.forEach((function(n){var i=n.name,o=n.value;return ee(r[e.name.value],i,o,t)}))})));var n=null;return e.arguments&&e.arguments.length&&(n={},e.arguments.forEach((function(e){var r=e.name,i=e.value;return ee(n,r,i,t)}))),re(e.name.value,n,r)}(e.field,e.variables):re(n,di(e))),!1===t?n:n===qn(t)?t:n+":"+t},e.prototype.readField=function(e,t){var r=e.from;if(r&&(e.field||e.fieldName)){if(void 0===e.typename){var n=t.store.getFieldValue(r,"__typename");n&&(e.typename=n)}var i=this.getStoreFieldName(e),o=qn(i),a=t.store.getFieldValue(r,i),s=this.getFieldPolicy(e.typename,o,!1),u=s&&s.read;if(u){var c=bi(this,r,e,t,t.store.getStorage(X(r)?r.__ref:r,i));return pn.withValue(this.cache,u,[a,c])}return a}},e.prototype.getReadFunction=function(e,t){var r=this.getFieldPolicy(e,t,!1);return r&&r.read},e.prototype.getMergeFunction=function(e,t,r){var n=this.getFieldPolicy(e,t,!1),i=n&&n.merge;return!i&&r&&(i=(n=this.getTypePolicy(r))&&n.merge),i},e.prototype.runMergeFunction=function(e,t,r,n,i){var o=r.field,a=r.typename,s=r.merge;return s===yi?_i(n.store)(e,t):s===vi?t:(n.overwrite&&(e=void 0),s(e,t,bi(this,void 0,{typename:a,fieldName:o.name.value,field:o,variables:n.variables},n,i||Object.create(null))))},e}();function bi(e,t,r,n,i){var o=e.getStoreFieldName(r),a=qn(o),s=r.variables||n.variables,u=n.store,c=u.toReference,l=u.canRead;return{args:di(r),field:r.field||null,fieldName:a,storeFieldName:o,variables:s,isReference:X,toReference:c,storage:i,cache:e.cache,canRead:l,readField:function(){return e.readField(gi(arguments,t,s),n)},mergeObjects:_i(n.store)}}function gi(e,t,r){var i,o,a,s=e[0],c=e[1],l=e.length;return"string"==typeof s?i={fieldName:s,from:l>1?c:t}:(i=(0,n.__assign)({},s),Nn.call(i,"from")||(i.from=t)),__DEV__&&void 0===i.from&&__DEV__&&u.warn("Undefined 'from' passed to readField with arguments ".concat((o=Array.from(e),a=fr("stringifyForDisplay"),JSON.stringify(o,(function(e,t){return void 0===t?a:t})).split(JSON.stringify(a)).join("<undefined>")))),void 0===i.variables&&(i.variables=r),i}function _i(e){return function(t,r){if(Dt(t)||Dt(r))throw __DEV__?new s("Cannot automatically merge arrays"):new s(4);if(K(t)&&K(r)){var i=e.getFieldValue(t,"__typename"),o=e.getFieldValue(r,"__typename");if(i&&o&&i!==o)return r;if(X(t)&&Vn(r))return e.merge(t.__ref,r),t;if(Vn(t)&&X(r))return e.merge(t,r.__ref),r;if(Vn(t)&&Vn(r))return(0,n.__assign)((0,n.__assign)({},t),r)}return r}}function Oi(e,t,r){var i="".concat(t).concat(r),o=e.flavors.get(i);return o||e.flavors.set(i,o=e.clientOnly===t&&e.deferred===r?e:(0,n.__assign)((0,n.__assign)({},e),{clientOnly:t,deferred:r})),o}var wi=function(){function e(e,t,r){this.cache=e,this.reader=t,this.fragments=r}return e.prototype.writeToStore=function(e,t){var r=this,i=t.query,o=t.result,a=t.dataId,c=t.variables,l=t.overwrite,f=le(i),d=new Lt;c=(0,n.__assign)((0,n.__assign)({},ye(f)),c);var p=(0,n.__assign)((0,n.__assign)({store:e,written:Object.create(null),merge:function(e,t){return d.merge(e,t)},variables:c,varString:Jt(c)},Un(i,this.fragments)),{overwrite:!!l,incomingById:new Map,clientOnly:!1,deferred:!1,flavors:new Map}),h=this.processSelectionSet({result:o||Object.create(null),dataId:a,selectionSet:f.selectionSet,mergeTree:{map:new Map},context:p});if(!X(h))throw __DEV__?new s("Could not identify object ".concat(JSON.stringify(o))):new s(7);return p.incomingById.forEach((function(t,n){var i=t.storeObject,o=t.mergeTree,a=t.fieldNodeSet,s=Z(n);if(o&&o.map.size){var c=r.applyMerges(o,s,i,p);if(X(c))return;i=c}if(__DEV__&&!p.overwrite){var l=Object.create(null);a.forEach((function(e){e.selectionSet&&(l[e.name.value]=!0)})),Object.keys(i).forEach((function(e){(function(e){return!0===l[qn(e)]})(e)&&!function(e){var t=o&&o.map.get(e);return Boolean(t&&t.info&&t.info.merge)}(e)&&function(e,t,r,n){var i=function(e){var t=n.getFieldValue(e,r);return"object"==typeof t&&t},o=i(e);if(o){var a=i(t);if(a&&!X(o)&&!jt(o,a)&&!Object.keys(o).every((function(e){return void 0!==n.getFieldValue(a,e)}))){var s=n.getFieldValue(e,"__typename")||n.getFieldValue(t,"__typename"),c=qn(r),l="".concat(s,".").concat(c);if(!ji.has(l)){ji.add(l);var f=[];Dt(o)||Dt(a)||[o,a].forEach((function(e){var t=n.getFieldValue(e,"__typename");"string"!=typeof t||f.includes(t)||f.push(t)})),__DEV__&&u.warn("Cache data may be lost when replacing the ".concat(c," field of a ").concat(s," object.\n\nTo address this problem (which is not a bug in Apollo Client), ").concat(f.length?"either ensure all objects of type "+f.join(" and ")+" have an ID or a custom merge function, or ":"","define a custom merge function for the ").concat(l," field, so InMemoryCache can safely merge these objects:\n\n existing: ").concat(JSON.stringify(o).slice(0,1e3),"\n incoming: ").concat(JSON.stringify(a).slice(0,1e3),"\n\nFor more information about these options, please refer to the documentation:\n\n * Ensuring entity objects have IDs: https://go.apollo.dev/c/generating-unique-identifiers\n * Defining custom merge functions: https://go.apollo.dev/c/merging-non-normalized-objects\n"))}}}}(s,i,e,p.store)}))}e.merge(n,i)})),e.retain(h.__ref),h},e.prototype.processSelectionSet=function(e){var t=this,r=e.dataId,i=e.result,o=e.selectionSet,a=e.context,s=e.mergeTree,c=this.cache.policies,l=Object.create(null),f=r&&c.rootTypenamesById[r]||se(i,o,a.fragmentMap)||r&&a.store.get(r,"__typename");"string"==typeof f&&(l.__typename=f);var d=function(){var e=gi(arguments,l,a.variables);if(X(e.from)){var t=a.incomingById.get(e.from.__ref);if(t){var r=c.readField((0,n.__assign)((0,n.__assign)({},e),{from:t.storeObject}),a);if(void 0!==r)return r}}return c.readField(e,a)},p=new Set;this.flattenFields(o,i,a,f).forEach((function(e,r){var n,o=ae(r),a=i[o];if(p.add(r),void 0!==a){var h=c.getStoreFieldName({typename:f,fieldName:r.name.value,field:r,variables:e.variables}),y=Ei(s,h),v=t.processFieldValue(a,r,r.selectionSet?Oi(e,!1,!1):e,y),m=void 0;r.selectionSet&&(X(v)||Vn(v))&&(m=d("__typename",v));var b=c.getMergeFunction(f,r.name.value,m);b?y.info={field:r,typename:f,merge:b}:Ti(s,h),l=e.merge(l,((n={})[h]=v,n))}else!__DEV__||e.clientOnly||e.deferred||sr.added(r)||c.getReadFunction(f,r.name.value)||__DEV__&&u.error("Missing field '".concat(ae(r),"' while writing result ").concat(JSON.stringify(i,null,2)).substring(0,1e3))}));try{var h=c.identify(i,{typename:f,selectionSet:o,fragmentMap:a.fragmentMap,storeObject:l,readField:d}),y=h[0],v=h[1];r=r||y,v&&(l=a.merge(l,v))}catch(e){if(!r)throw e}if("string"==typeof r){var m=Z(r),b=a.written[r]||(a.written[r]=[]);if(b.indexOf(o)>=0)return m;if(b.push(o),this.reader&&this.reader.isFresh(i,m,o,a))return m;var g=a.incomingById.get(r);return g?(g.storeObject=a.merge(g.storeObject,l),g.mergeTree=Ii(g.mergeTree,s),p.forEach((function(e){return g.fieldNodeSet.add(e)}))):a.incomingById.set(r,{storeObject:l,mergeTree:Pi(s)?void 0:s,fieldNodeSet:p}),m}return l},e.prototype.processFieldValue=function(e,t,r,n){var i=this;return t.selectionSet&&null!==e?Dt(e)?e.map((function(e,o){var a=i.processFieldValue(e,t,r,Ei(n,o));return Ti(n,o),a})):this.processSelectionSet({result:e,selectionSet:t.selectionSet,context:r,mergeTree:n}):__DEV__?Or(e):e},e.prototype.flattenFields=function(e,t,r,n){void 0===n&&(n=se(t,e,r.fragmentMap));var i=new Map,o=this.cache.policies,a=new Ht(!1);return function e(u,c){var l=a.lookup(u,c.clientOnly,c.deferred);l.visited||(l.visited=!0,u.selections.forEach((function(a){if(Ne(a,r.variables)){var u=c.clientOnly,l=c.deferred;if(u&&l||!Rt(a.directives)||a.directives.forEach((function(e){var t=e.name.value;if("client"===t&&(u=!0),"defer"===t){var n=oe(e,r.variables);n&&!1===n.if||(l=!0)}})),ue(a)){var f=i.get(a);f&&(u=u&&f.clientOnly,l=l&&f.deferred),i.set(a,Oi(r,u,l))}else{var d=J(a,r.lookupFragment);if(!d&&a.kind===je.FRAGMENT_SPREAD)throw __DEV__?new s("No fragment named ".concat(a.name.value)):new s(8);d&&o.fragmentMatches(d,n,t,r.variables)&&e(d.selectionSet,Oi(r,u,l))}}})))}(e,r),i},e.prototype.applyMerges=function(e,t,r,i,o){var a,s=this;if(e.map.size&&!X(r)){var c,l=Dt(r)||!X(t)&&!Vn(t)?void 0:t,f=r;l&&!o&&(o=[X(l)?l.__ref:l]);var d=function(e,t){return Dt(e)?"number"==typeof t?e[t]:void 0:i.store.getFieldValue(e,String(t))};e.map.forEach((function(e,t){var r=d(l,t),n=d(f,t);if(void 0!==n){o&&o.push(t);var a=s.applyMerges(e,r,n,i,o);a!==n&&(c=c||new Map).set(t,a),o&&u(o.pop()===t)}})),c&&(r=Dt(f)?f.slice(0):(0,n.__assign)({},f),c.forEach((function(e,t){r[t]=e})))}return e.info?this.cache.policies.runMergeFunction(t,r,e.info,i,o&&(a=i.store).getStorage.apply(a,o)):r},e}(),Si=[];function Ei(e,t){var r=e.map;return r.has(t)||r.set(t,Si.pop()||{map:new Map}),r.get(t)}function Ii(e,t){if(e===t||!t||Pi(t))return e;if(!e||Pi(e))return t;var r=e.info&&t.info?(0,n.__assign)((0,n.__assign)({},e.info),t.info):e.info||t.info,i=e.map.size&&t.map.size,o={info:r,map:i?new Map:e.map.size?e.map:t.map};if(i){var a=new Set(t.map.keys());e.map.forEach((function(e,r){o.map.set(r,Ii(e,t.map.get(r))),a.delete(r)})),a.forEach((function(r){o.map.set(r,Ii(t.map.get(r),e.map.get(r)))}))}return o}function Pi(e){return!e||!(e.info||e.map.size)}function Ti(e,t){var r=e.map,n=r.get(t);n&&Pi(n)&&(Si.push(n),r.delete(t))}var ji=new Set,Ai=function(e){function t(t){void 0===t&&(t={});var r=e.call(this)||this;return r.watches=new Set,r.typenameDocumentCache=new Map,r.makeVar=mn,r.txCount=0,r.config=function(e){return Sr(Cn,e)}(t),r.addTypename=!!r.config.addTypename,r.policies=new mi({cache:r,dataIdFromObject:r.config.dataIdFromObject,possibleTypes:r.config.possibleTypes,typePolicies:r.config.typePolicies}),r.init(),r}return(0,n.__extends)(t,e),t.prototype.init=function(){var e=this.data=new Wn.Root({policies:this.policies,resultCaching:this.config.resultCaching});this.optimisticData=e.stump,this.resetResultCache()},t.prototype.resetResultCache=function(e){var t=this,r=this.storeReader,n=this.config.fragments;this.storeWriter=new wi(this,this.storeReader=new ti({cache:this,addTypename:this.addTypename,resultCacheMaxSize:this.config.resultCacheMaxSize,canonizeResults:Fn(this.config),canon:e?void 0:r&&r.canon,fragments:n}),n),this.maybeBroadcastWatch=dn((function(e,r){return t.broadcastWatch(e,r)}),{max:this.config.resultCacheMaxSize,makeCacheKey:function(e){var r=e.optimistic?t.optimisticData:t.data;if(Xn(r)){var n=e.optimistic,i=e.id,o=e.variables;return r.makeCacheKey(e.query,e.callback,Jt({optimistic:n,id:i,variables:o}))}}}),new Set([this.data.group,this.optimisticData.group]).forEach((function(e){return e.resetCaching()}))},t.prototype.restore=function(e){return this.init(),e&&this.data.replace(e),this},t.prototype.extract=function(e){return void 0===e&&(e=!1),(e?this.optimisticData:this.data).extract()},t.prototype.read=function(e){var t=e.returnPartialData,r=void 0!==t&&t;try{return this.storeReader.diffQueryAgainstStore((0,n.__assign)((0,n.__assign)({},e),{store:e.optimistic?this.optimisticData:this.data,config:this.config,returnPartialData:r})).result||null}catch(e){if(e instanceof kn)return null;throw e}},t.prototype.write=function(e){try{return++this.txCount,this.storeWriter.writeToStore(this.data,e)}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}},t.prototype.modify=function(e){if(Nn.call(e,"id")&&!e.id)return!1;var t=e.optimistic?this.optimisticData:this.data;try{return++this.txCount,t.modify(e.id||"ROOT_QUERY",e.fields)}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}},t.prototype.diff=function(e){return this.storeReader.diffQueryAgainstStore((0,n.__assign)((0,n.__assign)({},e),{store:e.optimistic?this.optimisticData:this.data,rootId:e.id||"ROOT_QUERY",config:this.config}))},t.prototype.watch=function(e){var t,r=this;return this.watches.size||yn(t=this).vars.forEach((function(e){return e.attachCache(t)})),this.watches.add(e),e.immediate&&this.maybeBroadcastWatch(e),function(){r.watches.delete(e)&&!r.watches.size&&vn(r),r.maybeBroadcastWatch.forget(e)}},t.prototype.gc=function(e){Jt.reset();var t=this.optimisticData.gc();return e&&!this.txCount&&(e.resetResultCache?this.resetResultCache(e.resetResultIdentities):e.resetResultIdentities&&this.storeReader.resetCanon()),t},t.prototype.retain=function(e,t){return(t?this.optimisticData:this.data).retain(e)},t.prototype.release=function(e,t){return(t?this.optimisticData:this.data).release(e)},t.prototype.identify=function(e){if(X(e))return e.__ref;try{return this.policies.identify(e)[0]}catch(e){__DEV__&&u.warn(e)}},t.prototype.evict=function(e){if(!e.id){if(Nn.call(e,"id"))return!1;e=(0,n.__assign)((0,n.__assign)({},e),{id:"ROOT_QUERY"})}try{return++this.txCount,this.optimisticData.evict(e,this.data)}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}},t.prototype.reset=function(e){var t=this;return this.init(),Jt.reset(),e&&e.discardWatches?(this.watches.forEach((function(e){return t.maybeBroadcastWatch.forget(e)})),this.watches.clear(),vn(this)):this.broadcastWatches(),Promise.resolve()},t.prototype.removeOptimistic=function(e){var t=this.optimisticData.removeLayer(e);t!==this.optimisticData&&(this.optimisticData=t,this.broadcastWatches())},t.prototype.batch=function(e){var t,r=this,i=e.update,o=e.optimistic,a=void 0===o||o,s=e.removeOptimistic,u=e.onWatchUpdated,c=function(e){var n=r,o=n.data,a=n.optimisticData;++r.txCount,e&&(r.data=r.optimisticData=e);try{return t=i(r)}finally{--r.txCount,r.data=o,r.optimisticData=a}},l=new Set;return u&&!this.txCount&&this.broadcastWatches((0,n.__assign)((0,n.__assign)({},e),{onWatchUpdated:function(e){return l.add(e),!1}})),"string"==typeof a?this.optimisticData=this.optimisticData.addLayer(a,c):!1===a?c(this.data):c(),"string"==typeof s&&(this.optimisticData=this.optimisticData.removeLayer(s)),u&&l.size?(this.broadcastWatches((0,n.__assign)((0,n.__assign)({},e),{onWatchUpdated:function(e,t){var r=u.call(this,e,t);return!1!==r&&l.delete(e),r}})),l.size&&l.forEach((function(e){return r.maybeBroadcastWatch.dirty(e)}))):this.broadcastWatches(e),t},t.prototype.performTransaction=function(e,t){return this.batch({update:e,optimistic:t||null!==t})},t.prototype.transformDocument=function(e){if(this.addTypename){var t=this.typenameDocumentCache.get(e);return t||(t=sr(e),this.typenameDocumentCache.set(e,t),this.typenameDocumentCache.set(t,t)),t}return e},t.prototype.transformForLink=function(e){var t=this.config.fragments;return t?t.transform(e):e},t.prototype.broadcastWatches=function(e){var t=this;this.txCount||this.watches.forEach((function(r){return t.maybeBroadcastWatch(r,e)}))},t.prototype.broadcastWatch=function(e,t){var r=e.lastDiff,n=this.diff(e);t&&(e.optimistic&&"string"==typeof t.optimistic&&(n.fromOptimisticTransaction=!0),t.onWatchUpdated&&!1===t.onWatchUpdated.call(this,e,n,r))||r&&jt(r.result,n.result)||e.callback(e.lastDiff=n,r)},t}(xn),xi=_e.empty,ki=_e.from,Mi=_e.split,Ni=_e.concat;function Di(e){var t=!1;return new Promise((function(r,n){e.subscribe({next:function(e){t?__DEV__&&u.warn("Promise Wrapper does not support multiple results from Observable"):(t=!0,r(e))},error:n})}))}function Ri(e){return new Y((function(t){e.then((function(e){t.next(e),t.complete()})).catch(t.error.bind(t))}))}function Ci(e,t){if(!Boolean(e))throw new Error(null!=t?t:"Unexpected invariant triggered.")}const Fi=/\r\n|[\n\r]/g;function $i(e,t){let r=0,n=1;for(const i of e.body.matchAll(Fi)){if("number"==typeof i.index||Ci(!1),i.index>=t)break;r=i.index+i[0].length,n+=1}return{line:n,column:t+1-r}}function qi(e,t){const r=e.locationOffset.column-1,n="".padStart(r)+e.body,i=t.line-1,o=e.locationOffset.line-1,a=t.line+o,s=1===t.line?r:0,u=t.column+s,c=`${e.name}:${a}:${u}\n`,l=n.split(/\r\n|[\n\r]/g),f=l[i];if(f.length>120){const e=Math.floor(u/80),t=u%80,r=[];for(let e=0;e<f.length;e+=80)r.push(f.slice(e,e+80));return c+Li([[`${a} |`,r[0]],...r.slice(1,e+1).map((e=>["|",e])),["|","^".padStart(t)],["|",r[e+1]]])}return c+Li([[a-1+" |",l[i-1]],[`${a} |`,f],["|","^".padStart(u)],[`${a+1} |`,l[i+1]]])}function Li(e){const t=e.filter((([e,t])=>void 0!==t)),r=Math.max(...t.map((([e])=>e.length)));return t.map((([e,t])=>e.padStart(r)+(t?" "+t:""))).join("\n")}class Vi extends Error{constructor(e,...t){var r,n,i;const{nodes:o,source:a,positions:s,path:u,originalError:c,extensions:l}=function(e){const 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!=u?u:void 0,this.originalError=null!=c?c:void 0,this.nodes=Ui(Array.isArray(o)?o:o?[o]:void 0);const f=Ui(null===(r=this.nodes)||void 0===r?void 0:r.map((e=>e.loc)).filter((e=>null!=e)));this.source=null!=a?a:null==f||null===(n=f[0])||void 0===n?void 0:n.source,this.positions=null!=s?s:null==f?void 0:f.map((e=>e.start)),this.locations=s&&a?s.map((e=>$i(a,e))):null==f?void 0:f.map((e=>$i(e.source,e.start)));const d="object"==typeof(p=null==c?void 0:c.extensions)&&null!==p?null==c?void 0:c.extensions:void 0;var p;this.extensions=null!==(i=null!=l?l:d)&&void 0!==i?i: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!=c&&c.stack?Object.defineProperty(this,"stack",{value:c.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,Vi):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(const r of this.nodes)r.loc&&(e+="\n\n"+qi((t=r.loc).source,$i(t.source,t.start)));else if(this.source&&this.locations)for(const t of this.locations)e+="\n\n"+qi(this.source,t);var t;return e}toJSON(){const 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 Ui(e){return void 0===e||0===e.length?void 0:e}function Qi(e,t,r){return new Vi(`Syntax Error: ${r}`,{source:e,positions:[t]})}var zi,Bi,Wi;!function(e){e.QUERY="QUERY",e.MUTATION="MUTATION",e.SUBSCRIPTION="SUBSCRIPTION",e.FIELD="FIELD",e.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",e.FRAGMENT_SPREAD="FRAGMENT_SPREAD",e.INLINE_FRAGMENT="INLINE_FRAGMENT",e.VARIABLE_DEFINITION="VARIABLE_DEFINITION",e.SCHEMA="SCHEMA",e.SCALAR="SCALAR",e.OBJECT="OBJECT",e.FIELD_DEFINITION="FIELD_DEFINITION",e.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",e.INTERFACE="INTERFACE",e.UNION="UNION",e.ENUM="ENUM",e.ENUM_VALUE="ENUM_VALUE",e.INPUT_OBJECT="INPUT_OBJECT",e.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION"}(zi||(zi={})),(Wi=Bi||(Bi={})).SOF="<SOF>",Wi.EOF="<EOF>",Wi.BANG="!",Wi.DOLLAR="$",Wi.AMP="&",Wi.PAREN_L="(",Wi.PAREN_R=")",Wi.SPREAD="...",Wi.COLON=":",Wi.EQUALS="=",Wi.AT="@",Wi.BRACKET_L="[",Wi.BRACKET_R="]",Wi.BRACE_L="{",Wi.PIPE="|",Wi.BRACE_R="}",Wi.NAME="Name",Wi.INT="Int",Wi.FLOAT="Float",Wi.STRING="String",Wi.BLOCK_STRING="BlockString",Wi.COMMENT="Comment";class Yi{constructor(e){const t=new Se(Bi.SOF,0,0,0,0);this.source=e,this.lastToken=t,this.token=t,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let e=this.token;if(e.kind!==Bi.EOF)do{if(e.next)e=e.next;else{const t=eo(this,e.end);e.next=t,t.prev=e,e=t}}while(e.kind===Bi.COMMENT);return e}}function Ki(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function Hi(e,t){return Gi(e.charCodeAt(t))&&Ji(e.charCodeAt(t+1))}function Gi(e){return e>=55296&&e<=56319}function Ji(e){return e>=56320&&e<=57343}function Zi(e,t){const r=e.source.body.codePointAt(t);if(void 0===r)return Bi.EOF;if(r>=32&&r<=126){const e=String.fromCodePoint(r);return'"'===e?"'\"'":`"${e}"`}return"U+"+r.toString(16).toUpperCase().padStart(4,"0")}function Xi(e,t,r,n,i){const o=e.line,a=1+r-e.lineStart;return new Se(t,r,n,o,a,i)}function eo(e,t){const r=e.source.body,n=r.length;let i=t;for(;i<n;){const t=r.charCodeAt(i);switch(t){case 65279:case 9:case 32:case 44:++i;continue;case 10:++i,++e.line,e.lineStart=i;continue;case 13:10===r.charCodeAt(i+1)?i+=2:++i,++e.line,e.lineStart=i;continue;case 35:return to(e,i);case 33:return Xi(e,Bi.BANG,i,i+1);case 36:return Xi(e,Bi.DOLLAR,i,i+1);case 38:return Xi(e,Bi.AMP,i,i+1);case 40:return Xi(e,Bi.PAREN_L,i,i+1);case 41:return Xi(e,Bi.PAREN_R,i,i+1);case 46:if(46===r.charCodeAt(i+1)&&46===r.charCodeAt(i+2))return Xi(e,Bi.SPREAD,i,i+3);break;case 58:return Xi(e,Bi.COLON,i,i+1);case 61:return Xi(e,Bi.EQUALS,i,i+1);case 64:return Xi(e,Bi.AT,i,i+1);case 91:return Xi(e,Bi.BRACKET_L,i,i+1);case 93:return Xi(e,Bi.BRACKET_R,i,i+1);case 123:return Xi(e,Bi.BRACE_L,i,i+1);case 124:return Xi(e,Bi.PIPE,i,i+1);case 125:return Xi(e,Bi.BRACE_R,i,i+1);case 34:return 34===r.charCodeAt(i+1)&&34===r.charCodeAt(i+2)?lo(e,i):io(e,i)}if(Ze(t)||45===t)return ro(e,i,t);if(et(t))return fo(e,i);throw Qi(e.source,i,39===t?"Unexpected single quote character ('), did you mean to use a double quote (\")?":Ki(t)||Hi(r,i)?`Unexpected character: ${Zi(e,i)}.`:`Invalid character: ${Zi(e,i)}.`)}return Xi(e,Bi.EOF,n,n)}function to(e,t){const r=e.source.body,n=r.length;let i=t+1;for(;i<n;){const e=r.charCodeAt(i);if(10===e||13===e)break;if(Ki(e))++i;else{if(!Hi(r,i))break;i+=2}}return Xi(e,Bi.COMMENT,t,i,r.slice(t+1,i))}function ro(e,t,r){const n=e.source.body;let i=t,o=r,a=!1;if(45===o&&(o=n.charCodeAt(++i)),48===o){if(o=n.charCodeAt(++i),Ze(o))throw Qi(e.source,i,`Invalid number, unexpected digit after 0: ${Zi(e,i)}.`)}else i=no(e,i,o),o=n.charCodeAt(i);if(46===o&&(a=!0,o=n.charCodeAt(++i),i=no(e,i,o),o=n.charCodeAt(i)),69!==o&&101!==o||(a=!0,o=n.charCodeAt(++i),43!==o&&45!==o||(o=n.charCodeAt(++i)),i=no(e,i,o),o=n.charCodeAt(i)),46===o||et(o))throw Qi(e.source,i,`Invalid number, expected digit but got: ${Zi(e,i)}.`);return Xi(e,a?Bi.FLOAT:Bi.INT,t,i,n.slice(t,i))}function no(e,t,r){if(!Ze(r))throw Qi(e.source,t,`Invalid number, expected digit but got: ${Zi(e,t)}.`);const n=e.source.body;let i=t+1;for(;Ze(n.charCodeAt(i));)++i;return i}function io(e,t){const r=e.source.body,n=r.length;let i=t+1,o=i,a="";for(;i<n;){const n=r.charCodeAt(i);if(34===n)return a+=r.slice(o,i),Xi(e,Bi.STRING,t,i+1,a);if(92!==n){if(10===n||13===n)break;if(Ki(n))++i;else{if(!Hi(r,i))throw Qi(e.source,i,`Invalid character within String: ${Zi(e,i)}.`);i+=2}}else{a+=r.slice(o,i);const t=117===r.charCodeAt(i+1)?123===r.charCodeAt(i+2)?oo(e,i):ao(e,i):co(e,i);a+=t.value,i+=t.size,o=i}}throw Qi(e.source,i,"Unterminated string.")}function oo(e,t){const r=e.source.body;let n=0,i=3;for(;i<12;){const e=r.charCodeAt(t+i++);if(125===e){if(i<5||!Ki(n))break;return{value:String.fromCodePoint(n),size:i}}if(n=n<<4|uo(e),n<0)break}throw Qi(e.source,t,`Invalid Unicode escape sequence: "${r.slice(t,t+i)}".`)}function ao(e,t){const r=e.source.body,n=so(r,t+2);if(Ki(n))return{value:String.fromCodePoint(n),size:6};if(Gi(n)&&92===r.charCodeAt(t+6)&&117===r.charCodeAt(t+7)){const e=so(r,t+8);if(Ji(e))return{value:String.fromCodePoint(n,e),size:12}}throw Qi(e.source,t,`Invalid Unicode escape sequence: "${r.slice(t,t+6)}".`)}function so(e,t){return uo(e.charCodeAt(t))<<12|uo(e.charCodeAt(t+1))<<8|uo(e.charCodeAt(t+2))<<4|uo(e.charCodeAt(t+3))}function uo(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function co(e,t){const r=e.source.body;switch(r.charCodeAt(t+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:"\n",size:2};case 114:return{value:"\r",size:2};case 116:return{value:"\t",size:2}}throw Qi(e.source,t,`Invalid character escape sequence: "${r.slice(t,t+2)}".`)}function lo(e,t){const r=e.source.body,n=r.length;let i=e.lineStart,o=t+3,a=o,s="";const u=[];for(;o<n;){const n=r.charCodeAt(o);if(34===n&&34===r.charCodeAt(o+1)&&34===r.charCodeAt(o+2)){s+=r.slice(a,o),u.push(s);const n=Xi(e,Bi.BLOCK_STRING,t,o+3,tt(u).join("\n"));return e.line+=u.length-1,e.lineStart=i,n}if(92!==n||34!==r.charCodeAt(o+1)||34!==r.charCodeAt(o+2)||34!==r.charCodeAt(o+3))if(10!==n&&13!==n)if(Ki(n))++o;else{if(!Hi(r,o))throw Qi(e.source,o,`Invalid character within String: ${Zi(e,o)}.`);o+=2}else s+=r.slice(a,o),u.push(s),13===n&&10===r.charCodeAt(o+1)?o+=2:++o,s="",a=o,i=o;else s+=r.slice(a,o),a=o+1,o+=4}throw Qi(e.source,o,"Unterminated string.")}function fo(e,t){const r=e.source.body,n=r.length;let i=t+1;for(;i<n&&(Xe(o=r.charCodeAt(i))||Ze(o)||95===o);)++i;var o;return Xi(e,Bi.NAME,t,i,r.slice(t,i))}class po{constructor(e,t={}){const r=function(e){return e instanceof P}(e)?e:new P(e);this._lexer=new Yi(r),this._options=t,this._tokenCounter=0}parseName(){const e=this.expectToken(Bi.NAME);return this.node(e,{kind:je.NAME,value:e.value})}parseDocument(){return this.node(this._lexer.token,{kind:je.DOCUMENT,definitions:this.many(Bi.SOF,this.parseDefinition,Bi.EOF)})}parseDefinition(){if(this.peek(Bi.BRACE_L))return this.parseOperationDefinition();const e=this.peekDescription(),t=e?this._lexer.lookahead():this._lexer.token;if(t.kind===Bi.NAME){switch(t.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}if(e)throw Qi(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(t.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(t)}parseOperationDefinition(){const e=this._lexer.token;if(this.peek(Bi.BRACE_L))return this.node(e,{kind:je.OPERATION_DEFINITION,operation:Te.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});const t=this.parseOperationType();let r;return this.peek(Bi.NAME)&&(r=this.parseName()),this.node(e,{kind:je.OPERATION_DEFINITION,operation:t,name:r,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const e=this.expectToken(Bi.NAME);switch(e.value){case"query":return Te.QUERY;case"mutation":return Te.MUTATION;case"subscription":return Te.SUBSCRIPTION}throw this.unexpected(e)}parseVariableDefinitions(){return this.optionalMany(Bi.PAREN_L,this.parseVariableDefinition,Bi.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:je.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(Bi.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(Bi.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const e=this._lexer.token;return this.expectToken(Bi.DOLLAR),this.node(e,{kind:je.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:je.SELECTION_SET,selections:this.many(Bi.BRACE_L,this.parseSelection,Bi.BRACE_R)})}parseSelection(){return this.peek(Bi.SPREAD)?this.parseFragment():this.parseField()}parseField(){const e=this._lexer.token,t=this.parseName();let r,n;return this.expectOptionalToken(Bi.COLON)?(r=t,n=this.parseName()):n=t,this.node(e,{kind:je.FIELD,alias:r,name:n,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(Bi.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(e){const t=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(Bi.PAREN_L,t,Bi.PAREN_R)}parseArgument(e=!1){const t=this._lexer.token,r=this.parseName();return this.expectToken(Bi.COLON),this.node(t,{kind:je.ARGUMENT,name:r,value:this.parseValueLiteral(e)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){const e=this._lexer.token;this.expectToken(Bi.SPREAD);const t=this.expectOptionalKeyword("on");return!t&&this.peek(Bi.NAME)?this.node(e,{kind:je.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(e,{kind:je.INLINE_FRAGMENT,typeCondition:t?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){const e=this._lexer.token;return this.expectKeyword("fragment"),!0===this._options.allowLegacyFragmentVariables?this.node(e,{kind:je.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(e,{kind:je.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if("on"===this._lexer.token.value)throw this.unexpected();return this.parseName()}parseValueLiteral(e){const t=this._lexer.token;switch(t.kind){case Bi.BRACKET_L:return this.parseList(e);case Bi.BRACE_L:return this.parseObject(e);case Bi.INT:return this.advanceLexer(),this.node(t,{kind:je.INT,value:t.value});case Bi.FLOAT:return this.advanceLexer(),this.node(t,{kind:je.FLOAT,value:t.value});case Bi.STRING:case Bi.BLOCK_STRING:return this.parseStringLiteral();case Bi.NAME:switch(this.advanceLexer(),t.value){case"true":return this.node(t,{kind:je.BOOLEAN,value:!0});case"false":return this.node(t,{kind:je.BOOLEAN,value:!1});case"null":return this.node(t,{kind:je.NULL});default:return this.node(t,{kind:je.ENUM,value:t.value})}case Bi.DOLLAR:if(e){if(this.expectToken(Bi.DOLLAR),this._lexer.token.kind===Bi.NAME){const e=this._lexer.token.value;throw Qi(this._lexer.source,t.start,`Unexpected variable "$${e}" in constant value.`)}throw this.unexpected(t)}return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){const e=this._lexer.token;return this.advanceLexer(),this.node(e,{kind:je.STRING,value:e.value,block:e.kind===Bi.BLOCK_STRING})}parseList(e){return this.node(this._lexer.token,{kind:je.LIST,values:this.any(Bi.BRACKET_L,(()=>this.parseValueLiteral(e)),Bi.BRACKET_R)})}parseObject(e){return this.node(this._lexer.token,{kind:je.OBJECT,fields:this.any(Bi.BRACE_L,(()=>this.parseObjectField(e)),Bi.BRACE_R)})}parseObjectField(e){const t=this._lexer.token,r=this.parseName();return this.expectToken(Bi.COLON),this.node(t,{kind:je.OBJECT_FIELD,name:r,value:this.parseValueLiteral(e)})}parseDirectives(e){const t=[];for(;this.peek(Bi.AT);)t.push(this.parseDirective(e));return t}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(e){const t=this._lexer.token;return this.expectToken(Bi.AT),this.node(t,{kind:je.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e)})}parseTypeReference(){const e=this._lexer.token;let t;if(this.expectOptionalToken(Bi.BRACKET_L)){const r=this.parseTypeReference();this.expectToken(Bi.BRACKET_R),t=this.node(e,{kind:je.LIST_TYPE,type:r})}else t=this.parseNamedType();return this.expectOptionalToken(Bi.BANG)?this.node(e,{kind:je.NON_NULL_TYPE,type:t}):t}parseNamedType(){return this.node(this._lexer.token,{kind:je.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(Bi.STRING)||this.peek(Bi.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("schema");const r=this.parseConstDirectives(),n=this.many(Bi.BRACE_L,this.parseOperationTypeDefinition,Bi.BRACE_R);return this.node(e,{kind:je.SCHEMA_DEFINITION,description:t,directives:r,operationTypes:n})}parseOperationTypeDefinition(){const e=this._lexer.token,t=this.parseOperationType();this.expectToken(Bi.COLON);const r=this.parseNamedType();return this.node(e,{kind:je.OPERATION_TYPE_DEFINITION,operation:t,type:r})}parseScalarTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("scalar");const r=this.parseName(),n=this.parseConstDirectives();return this.node(e,{kind:je.SCALAR_TYPE_DEFINITION,description:t,name:r,directives:n})}parseObjectTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("type");const r=this.parseName(),n=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(e,{kind:je.OBJECT_TYPE_DEFINITION,description:t,name:r,interfaces:n,directives:i,fields:o})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(Bi.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(Bi.BRACE_L,this.parseFieldDefinition,Bi.BRACE_R)}parseFieldDefinition(){const e=this._lexer.token,t=this.parseDescription(),r=this.parseName(),n=this.parseArgumentDefs();this.expectToken(Bi.COLON);const i=this.parseTypeReference(),o=this.parseConstDirectives();return this.node(e,{kind:je.FIELD_DEFINITION,description:t,name:r,arguments:n,type:i,directives:o})}parseArgumentDefs(){return this.optionalMany(Bi.PAREN_L,this.parseInputValueDef,Bi.PAREN_R)}parseInputValueDef(){const e=this._lexer.token,t=this.parseDescription(),r=this.parseName();this.expectToken(Bi.COLON);const n=this.parseTypeReference();let i;this.expectOptionalToken(Bi.EQUALS)&&(i=this.parseConstValueLiteral());const o=this.parseConstDirectives();return this.node(e,{kind:je.INPUT_VALUE_DEFINITION,description:t,name:r,type:n,defaultValue:i,directives:o})}parseInterfaceTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("interface");const r=this.parseName(),n=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(e,{kind:je.INTERFACE_TYPE_DEFINITION,description:t,name:r,interfaces:n,directives:i,fields:o})}parseUnionTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("union");const r=this.parseName(),n=this.parseConstDirectives(),i=this.parseUnionMemberTypes();return this.node(e,{kind:je.UNION_TYPE_DEFINITION,description:t,name:r,directives:n,types:i})}parseUnionMemberTypes(){return this.expectOptionalToken(Bi.EQUALS)?this.delimitedMany(Bi.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("enum");const r=this.parseName(),n=this.parseConstDirectives(),i=this.parseEnumValuesDefinition();return this.node(e,{kind:je.ENUM_TYPE_DEFINITION,description:t,name:r,directives:n,values:i})}parseEnumValuesDefinition(){return this.optionalMany(Bi.BRACE_L,this.parseEnumValueDefinition,Bi.BRACE_R)}parseEnumValueDefinition(){const e=this._lexer.token,t=this.parseDescription(),r=this.parseEnumValueName(),n=this.parseConstDirectives();return this.node(e,{kind:je.ENUM_VALUE_DEFINITION,description:t,name:r,directives:n})}parseEnumValueName(){if("true"===this._lexer.token.value||"false"===this._lexer.token.value||"null"===this._lexer.token.value)throw Qi(this._lexer.source,this._lexer.token.start,`${ho(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("input");const r=this.parseName(),n=this.parseConstDirectives(),i=this.parseInputFieldsDefinition();return this.node(e,{kind:je.INPUT_OBJECT_TYPE_DEFINITION,description:t,name:r,directives:n,fields:i})}parseInputFieldsDefinition(){return this.optionalMany(Bi.BRACE_L,this.parseInputValueDef,Bi.BRACE_R)}parseTypeSystemExtension(){const e=this._lexer.lookahead();if(e.kind===Bi.NAME)switch(e.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(e)}parseSchemaExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");const t=this.parseConstDirectives(),r=this.optionalMany(Bi.BRACE_L,this.parseOperationTypeDefinition,Bi.BRACE_R);if(0===t.length&&0===r.length)throw this.unexpected();return this.node(e,{kind:je.SCHEMA_EXTENSION,directives:t,operationTypes:r})}parseScalarTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");const t=this.parseName(),r=this.parseConstDirectives();if(0===r.length)throw this.unexpected();return this.node(e,{kind:je.SCALAR_TYPE_EXTENSION,name:t,directives:r})}parseObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");const t=this.parseName(),r=this.parseImplementsInterfaces(),n=this.parseConstDirectives(),i=this.parseFieldsDefinition();if(0===r.length&&0===n.length&&0===i.length)throw this.unexpected();return this.node(e,{kind:je.OBJECT_TYPE_EXTENSION,name:t,interfaces:r,directives:n,fields:i})}parseInterfaceTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const t=this.parseName(),r=this.parseImplementsInterfaces(),n=this.parseConstDirectives(),i=this.parseFieldsDefinition();if(0===r.length&&0===n.length&&0===i.length)throw this.unexpected();return this.node(e,{kind:je.INTERFACE_TYPE_EXTENSION,name:t,interfaces:r,directives:n,fields:i})}parseUnionTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const t=this.parseName(),r=this.parseConstDirectives(),n=this.parseUnionMemberTypes();if(0===r.length&&0===n.length)throw this.unexpected();return this.node(e,{kind:je.UNION_TYPE_EXTENSION,name:t,directives:r,types:n})}parseEnumTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const t=this.parseName(),r=this.parseConstDirectives(),n=this.parseEnumValuesDefinition();if(0===r.length&&0===n.length)throw this.unexpected();return this.node(e,{kind:je.ENUM_TYPE_EXTENSION,name:t,directives:r,values:n})}parseInputObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const t=this.parseName(),r=this.parseConstDirectives(),n=this.parseInputFieldsDefinition();if(0===r.length&&0===n.length)throw this.unexpected();return this.node(e,{kind:je.INPUT_OBJECT_TYPE_EXTENSION,name:t,directives:r,fields:n})}parseDirectiveDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("directive"),this.expectToken(Bi.AT);const r=this.parseName(),n=this.parseArgumentDefs(),i=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const o=this.parseDirectiveLocations();return this.node(e,{kind:je.DIRECTIVE_DEFINITION,description:t,name:r,arguments:n,repeatable:i,locations:o})}parseDirectiveLocations(){return this.delimitedMany(Bi.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){const e=this._lexer.token,t=this.parseName();if(Object.prototype.hasOwnProperty.call(zi,t.value))return t;throw this.unexpected(e)}node(e,t){return!0!==this._options.noLocation&&(t.loc=new we(e,this._lexer.lastToken,this._lexer.source)),t}peek(e){return this._lexer.token.kind===e}expectToken(e){const t=this._lexer.token;if(t.kind===e)return this.advanceLexer(),t;throw Qi(this._lexer.source,t.start,`Expected ${yo(e)}, found ${ho(t)}.`)}expectOptionalToken(e){return this._lexer.token.kind===e&&(this.advanceLexer(),!0)}expectKeyword(e){const t=this._lexer.token;if(t.kind!==Bi.NAME||t.value!==e)throw Qi(this._lexer.source,t.start,`Expected "${e}", found ${ho(t)}.`);this.advanceLexer()}expectOptionalKeyword(e){const t=this._lexer.token;return t.kind===Bi.NAME&&t.value===e&&(this.advanceLexer(),!0)}unexpected(e){const t=null!=e?e:this._lexer.token;return Qi(this._lexer.source,t.start,`Unexpected ${ho(t)}.`)}any(e,t,r){this.expectToken(e);const n=[];for(;!this.expectOptionalToken(r);)n.push(t.call(this));return n}optionalMany(e,t,r){if(this.expectOptionalToken(e)){const e=[];do{e.push(t.call(this))}while(!this.expectOptionalToken(r));return e}return[]}many(e,t,r){this.expectToken(e);const n=[];do{n.push(t.call(this))}while(!this.expectOptionalToken(r));return n}delimitedMany(e,t){this.expectOptionalToken(e);const r=[];do{r.push(t.call(this))}while(this.expectOptionalToken(e));return r}advanceLexer(){const{maxTokens:e}=this._options,t=this._lexer.advance();if(void 0!==e&&t.kind!==Bi.EOF&&(++this._tokenCounter,this._tokenCounter>e))throw Qi(this._lexer.source,t.start,`Document contains more that ${e} tokens. Parsing aborted.`)}}function ho(e){const t=e.value;return yo(e.kind)+(null!=t?` "${t}"`:"")}function yo(e){return function(e){return e===Bi.BANG||e===Bi.DOLLAR||e===Bi.AMP||e===Bi.PAREN_L||e===Bi.PAREN_R||e===Bi.SPREAD||e===Bi.COLON||e===Bi.EQUALS||e===Bi.AT||e===Bi.BRACKET_L||e===Bi.BRACKET_R||e===Bi.BRACE_L||e===Bi.PIPE||e===Bi.BRACE_R}(e)?`"${e}"`:e}var vo=new Map,mo=new Map,bo=!0,go=!1;function _o(e){return e.replace(/[\s,]+/g," ").trim()}function Oo(e){var t,r,i,o=_o(e);if(!vo.has(o)){var a=function(e,t){return new po(e,t).parseDocument()}(e,{experimentalFragmentVariables:go,allowLegacyFragmentVariables:go});if(!a||"Document"!==a.kind)throw new Error("Not a valid GraphQL document.");vo.set(o,function(e){var t=new Set(e.definitions);t.forEach((function(e){e.loc&&delete e.loc,Object.keys(e).forEach((function(r){var n=e[r];n&&"object"==typeof n&&t.add(n)}))}));var r=e.loc;return r&&(delete r.startToken,delete r.endToken),e}((t=a,r=new Set,i=[],t.definitions.forEach((function(e){if("FragmentDefinition"===e.kind){var t=e.name.value,n=_o((a=e.loc).source.body.substring(a.start,a.end)),o=mo.get(t);o&&!o.has(n)?bo&&console.warn("Warning: fragment with name "+t+" 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"):o||mo.set(t,o=new Set),o.add(n),r.has(n)||(r.add(n),i.push(e))}else i.push(e);var a})),(0,n.__assign)((0,n.__assign)({},t),{definitions:i}))))}return vo.get(o)}function wo(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];"string"==typeof e&&(e=[e]);var n=e[0];return t.forEach((function(t,r){t&&"Document"===t.kind?n+=t.loc.source.body:n+=t,n+=e[r+1]})),Oo(n)}function So(){vo.clear(),mo.clear()}function Eo(){bo=!1}function Io(){go=!0}function Po(){go=!1}var To,jo=wo,Ao=So,xo=Eo,ko=Io,Mo=Po;(To=wo||(wo={})).gql=jo,To.resetCaches=Ao,To.disableFragmentWarnings=xo,To.enableExperimentalFragmentVariables=ko,To.disableExperimentalFragmentVariables=Mo,wo.default=wo,d(m?"log":"silent")},1143:e=>{"use strict";e.exports=JSON.parse('{"$id":"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#","description":"Meta-schema for $data reference (JSON AnySchema extension proposal)","type":"object","required":["$data"],"properties":{"$data":{"type":"string","anyOf":[{"format":"relative-json-pointer"},{"format":"json-pointer"}]}},"additionalProperties":false}')},1512:e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"http://json-schema.org/draft-07/schema#","title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"$comment":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"default":true,"readOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#"},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":true},"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#"},"maxProperties":{"$ref":"#/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"$ref":"#"},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"propertyNames":{"format":"regex"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"propertyNames":{"$ref":"#"},"const":true,"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"contentMediaType":{"type":"string"},"contentEncoding":{"type":"string"},"if":{"$ref":"#"},"then":{"$ref":"#"},"else":{"$ref":"#"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"default":true}')}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var o=t[n]={id:n,loaded:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.loaded=!0,o.exports}r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var n={};(()=>{"use strict";var e=n;Object.defineProperty(e,"__esModule",{value:!0}),e.GraphQLClient=e.Squid=e.QueryBuilder=e.Changes=e.JoinQueryBuilder=e.DocumentReference=e.CollectionReference=void 0;var t=r(5660);Object.defineProperty(e,"CollectionReference",{enumerable:!0,get:function(){return t.CollectionReference}});var i=r(4516);Object.defineProperty(e,"DocumentReference",{enumerable:!0,get:function(){return i.DocumentReference}});var o=r(9732);Object.defineProperty(e,"JoinQueryBuilder",{enumerable:!0,get:function(){return o.JoinQueryBuilder}});var a=r(6891);Object.defineProperty(e,"Changes",{enumerable:!0,get:function(){return a.Changes}}),Object.defineProperty(e,"QueryBuilder",{enumerable:!0,get:function(){return a.QueryBuilder}});var s=r(5395);Object.defineProperty(e,"Squid",{enumerable:!0,get:function(){return s.Squid}});var u=r(5857);Object.defineProperty(e,"GraphQLClient",{enumerable:!0,get:function(){return u.GraphQLClient}})})();var i=exports;for(var o in n)i[o]=n[o];n.__esModule&&Object.defineProperty(i,"__esModule",{value:!0})})();