From 3f913d4e147025d624ae468eaf448a2a945bbc76 Mon Sep 17 00:00:00 2001 From: David Morcillo Date: Mon, 22 Feb 2021 15:11:30 +0100 Subject: [PATCH] chore: bump version to 0.12.1 --- decidim-bulletin_board-app/Gemfile.lock | 2 +- decidim-bulletin_board-ruby/CHANGELOG.md | 6 ++++++ decidim-bulletin_board-ruby/Gemfile.lock | 6 +----- .../decidim/bulletin_board/decidim-bulletin_board.js | 2 +- .../lib/decidim/bulletin_board/version.rb | 2 +- 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/decidim-bulletin_board-app/Gemfile.lock b/decidim-bulletin_board-app/Gemfile.lock index 304b99d2..ed4a16f1 100644 --- a/decidim-bulletin_board-app/Gemfile.lock +++ b/decidim-bulletin_board-app/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: ../decidim-bulletin_board-ruby specs: - decidim-bulletin_board (0.12.0) + decidim-bulletin_board (0.12.1) byebug (~> 11.0) graphlient (~> 0.4.0) jwt (~> 2.2.2) diff --git a/decidim-bulletin_board-ruby/CHANGELOG.md b/decidim-bulletin_board-ruby/CHANGELOG.md index 93d675ff..e60cc004 100644 --- a/decidim-bulletin_board-ruby/CHANGELOG.md +++ b/decidim-bulletin_board-ruby/CHANGELOG.md @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +## [0.12.1] - 2021-02-22 + +### Changed + +- The `VoteComponent` event names have been changed to more suitable ones. + ## [0.12.0] - 2021-02-19 ### Added diff --git a/decidim-bulletin_board-ruby/Gemfile.lock b/decidim-bulletin_board-ruby/Gemfile.lock index dfdaccfe..df9d5136 100644 --- a/decidim-bulletin_board-ruby/Gemfile.lock +++ b/decidim-bulletin_board-ruby/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - decidim-bulletin_board (0.12.0) + decidim-bulletin_board (0.12.1) byebug (~> 11.0) graphlient (~> 0.4.0) jwt (~> 2.2.2) @@ -121,10 +121,6 @@ GEM nokogiri (1.11.1) mini_portile2 (~> 2.5.0) racc (~> 1.4) - nokogiri (1.11.1-x86_64-darwin) - racc (~> 1.4) - nokogiri (1.11.1-x86_64-linux) - racc (~> 1.4) parallel (1.20.1) parser (2.7.2.0) ast (~> 2.4.1) diff --git a/decidim-bulletin_board-ruby/app/assets/javascripts/decidim/bulletin_board/decidim-bulletin_board.js b/decidim-bulletin_board-ruby/app/assets/javascripts/decidim/bulletin_board/decidim-bulletin_board.js index 73476b11..f76b9a41 100644 --- a/decidim-bulletin_board-ruby/app/assets/javascripts/decidim/bulletin_board/decidim-bulletin_board.js +++ b/decidim-bulletin_board-ruby/app/assets/javascripts/decidim/bulletin_board/decidim-bulletin_board.js @@ -1,4 +1,4 @@ -window.decidimBulletinBoard=function(){var e={735:function(e,t,r){"use strict";r.r(t),r.d(t,{Client:function(){return y},Election:function(){return b},IdentificationKeys:function(){return ee},KeyCeremonyComponent:function(){return te},MESSAGE_PROCESSED:function(){return Q},MESSAGE_RECEIVED:function(){return G},MessageIdentifier:function(){return m},TallyComponent:function(){return re},Trustee:function(){return X},VoteComponent:function(){return ne},Voter:function(){return $}});var n=r(1439),i=r(9312),a=r.n(i),o=r(9953),s=r.n(o),u=r(3718),c=r.n(u),l=r(6890),f=r.n(l),h=r(5313),p=r.n(h);class d{constructor({apiEndpointUrl:e,headers:t}){const r=new n.HttpLink({uri:e,headers:t});this.apolloClient=new n.fe({link:r,cache:new n.h4})}async getLogEntry({electionUniqueId:e,contentHash:t}){return(await this.apolloClient.query({query:f(),variables:{electionUniqueId:e,contentHash:t}})).data.logEntry}async getElectionLogEntries({electionUniqueId:e,after:t,types:r}){return(await this.apolloClient.query({query:a(),variables:{electionUniqueId:e,after:t,types:r},fetchPolicy:"no-cache"})).data.election.logEntries}async processKeyCeremonyStep({messageId:e,signedData:t}){const r=await this.apolloClient.mutate({mutation:s(),variables:{messageId:e,signedData:t}});if(r.data.processKeyCeremonyStep.error)throw new Error(r.data.processKeyCeremonyStep.error);return r.data.processKeyCeremonyStep.pendingMessage}async getPendingMessageByMessageId({messageId:e}){return(await this.apolloClient.query({query:p(),variables:{messageId:e}})).data.pendingMessage}async processTallyStep({messageId:e,signedData:t}){const r=await this.apolloClient.mutate({mutation:c(),variables:{messageId:e,signedData:t}});if(r.data.processTallyStep.error)throw new Error(r.data.processTallyStep.error);return r.data.processTallyStep.pendingMessage}}class y{constructor(e){this.apiClient=new d(e)}getLogEntry({electionUniqueId:e,contentHash:t}){return this.apiClient.getLogEntry({electionUniqueId:e,contentHash:t})}getElectionLogEntries(e){return this.apiClient.getElectionLogEntries(e)}processKeyCeremonyStep(e){return this.apiClient.processKeyCeremonyStep(e)}processTallyStep(e){return this.apiClient.processTallyStep(e)}waitForPendingMessageToBeProcessed(e,t=1e3){return new Promise((r=>{const n=setInterval((()=>{this.apiClient.getPendingMessageByMessageId({messageId:e}).then((e=>{"enqueued"!==e.status&&(clearInterval(n),r(e))}))}),t)}))}}const v="t",g=["a","b","v",v];class m{static parse(e){const[t,r]=e.split("+"),[n,i,a,o]=t.split(".",4),[s,u]=r.split(".",2),c=o?`.${o}`:"";if(!g.includes(s))throw new Error("Invalid message identifier format");return{electionId:`${n}.${i}`,type:a,subtype:o,typeSubtype:`${a}${c}`,author:{type:s,id:u}}}static format(e,t,r,n){return`${e}.${t}+${r}.${n}`}}class b{constructor({uniqueId:e,bulletinBoardClient:t,typesFilter:r,options:n}){this.uniqueId=e,this.bulletinBoardClient=t,this.logEntries=[],this.typesFilter=r,this.subscriptionId=null,this.options=n||{waitUntilNextCheck:2e3}}async subscribeToLogEntriesChanges(){this.unsubscribeToLogEntriesChanges(),await this.getLogEntries(),this.subscriptionId=setInterval((()=>{this.getLogEntries()}),this.options.waitUntilNextCheck)}unsubscribeToLogEntriesChanges(){null!==this.subscriptionId&&(clearInterval(this.subscriptionId),this.subscriptionId=null)}getLastMessageFromTrustee(e){for(let t=this.logEntries.length-1;t>=0;t--){const r=this.logEntries[t],n=m.parse(r.messageId);if(n.author.type===v&&n.author.id===e)return r}return null}getLogEntries(){const e=this.logEntries[this.logEntries.length-1],t=e&&e.id||null;return new Promise((e=>{this.bulletinBoardClient.getElectionLogEntries({electionUniqueId:this.uniqueId,after:t,types:this.typesFilter}).then((t=>{t.length&&(this.logEntries=[...this.logEntries,...t]),e()}))}))}}var E=r(655);function S(e){return"function"==typeof e}var C=!1,w={Promise:void 0,set useDeprecatedSynchronousErrorHandling(e){e&&(new Error).stack;C=e},get useDeprecatedSynchronousErrorHandling(){return C}};function T(e){setTimeout((function(){throw e}),0)}var A={closed:!0,next:function(e){},error:function(e){if(w.useDeprecatedSynchronousErrorHandling)throw e;T(e)},complete:function(){}},I=function(){return Array.isArray||function(e){return e&&"number"==typeof e.length}}();var k=function(){function e(e){return Error.call(this),this.message=e?e.length+" errors occurred during unsubscription:\n"+e.map((function(e,t){return t+1+") "+e.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=e,this}return e.prototype=Object.create(Error.prototype),e}(),_=function(){function e(e){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,e&&(this._ctorUnsubscribe=!0,this._unsubscribe=e)}return e.prototype.unsubscribe=function(){var t;if(!this.closed){var r,n=this,i=n._parentOrParents,a=n._ctorUnsubscribe,o=n._unsubscribe,s=n._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,i instanceof e)i.remove(this);else if(null!==i)for(var u=0;u{n.b[t.name]=e})));for(const e of r)i.push(this.loadKey(e).then((t=>{n.t[e.name]=t})));return await Promise.all(i),n}loadKey(e){return Y.JWK.asKey(e.public_key,"json")}}class X{constructor({uniqueId:e,bulletinBoardClient:t,authorityPublicKeyJSON:r,identificationKeys:n,election:i,wrapperAdapter:a,options:o}){this.uniqueId=e,this.bulletinBoardClient=t,this.identificationKeys=n,this.election=i,this.options=o||{waitUntilNextCheck:100},this.wrapperAdapter=a,this.parser=new J({authorityPublicKeyJSON:r}),this.events=new W,this.nextLogEntryIndexToProcess=0,this.lastMessageProcessedWithResult=null,this.hasSetupKeyCeremony=!1}setup(){return this.election.subscribeToLogEntriesChanges()}tearDown(){this.election.unsubscribeToLogEntriesChanges()}async*setupKeyCeremony(){let e;for(;!e;)e=await this.waitForNextLogEntryResult();return yield await this.wrapperAdapter.backup(),await this.processKeyCeremonyStep(e),this.hasSetupKeyCeremony=!0,this.hasSetupKeyCeremony}async runKeyCeremony(){if(!this.hasSetupKeyCeremony)throw new Error("The key ceremony has not been setup yet");if(await this.needsToBeRestored())throw new Error("You need to restore the wrapper state to continue");return this.waitForNextLogEntryResult().then((async e=>(await this.processKeyCeremonyStep(e),await this.wrapperAdapter.isKeyCeremonyDone()?this.tearDown():this.runKeyCeremony())))}async runTally(){if(await this.needsToBeRestored())throw new Error("You need to restore the wrapper state to continue");return this.waitForNextLogEntryResult().then((async e=>(await this.processTallyStep(e),await this.wrapperAdapter.isTallyDone()?this.tearDown():this.runTally())))}async needsToBeRestored(){return this.election.getLastMessageFromTrustee(this.uniqueId)&&await this.wrapperAdapter.isFresh()}async restore(e){const t=this.election.getLastMessageFromTrustee(this.uniqueId);return this.hasSetupKeyCeremony=t&&await this.wrapperAdapter.restore(e,t.messageId),this.hasSetupKeyCeremony}async waitForNextLogEntryResult(){return await new Promise((e=>{const t=setInterval((async()=>{const{logEntries:r}=this.election;r.length>this.nextLogEntryIndexToProcess&&(clearInterval(t),e())}),this.options.waitUntilNextCheck)})),this.processNextLogEntry()}async processNextLogEntry(){const{logEntries:e}=this.election,t=e[this.nextLogEntryIndexToProcess];this.events.broadcastMessageReceived(t);const{messageIdentifier:r,decodedData:n}=await this.parser.parse(t),i=await this.wrapperAdapter.processMessage(r.typeSubtype,n);if(this.events.broadcastMessageProcessed(t,i),this.nextLogEntryIndexToProcess+=1,i){const{messageType:e,content:t}=i;return{message_id:m.format(this.election.uniqueId,e,v,this.uniqueId),content:t}}return i}async processKeyCeremonyStep(e){if(e&&!this.isMessageAlreadyLogged(e)){const t=await this.signMessage(e);return this.bulletinBoardClient.processKeyCeremonyStep({messageId:e.message_id,signedData:t})}}async processTallyStep(e){if(e&&!this.isMessageAlreadyLogged(e)){const t=await this.signMessage(e);return this.bulletinBoardClient.processTallyStep({messageId:e.message_id,signedData:t})}}isMessageAlreadyLogged({message_id:e}){const{logEntries:t}=this.election;return t.find((t=>t.messageId===e))}signMessage(e){return this.identificationKeys.sign({iat:Math.floor(new Date/1e3),...e})}}class ${constructor({bulletinBoardClient:e,authorityPublicKeyJSON:t,election:r,uniqueId:n,wrapperAdapter:i}){this.uniqueId=n,this.election=r,this.bulletinBoardClient=e,this.wrapperAdapter=i,this.parser=new J({authorityPublicKeyJSON:t})}setup(){return this.bulletinBoardClient.getElectionLogEntries({electionUniqueId:this.election.uniqueId,types:["create_election","end_key_ceremony"]}).then((async e=>{for(const t of e){const{messageIdentifier:e,decodedData:r}=await this.parser.parse(t);await this.wrapperAdapter.processMessage(e.typeSubtype,r)}}))}async encrypt(e){const t=await this.wrapperAdapter.encrypt(e);return{ballot:t,ballotHash:await this.generateBallotHash(t)}}async generateBallotHash(e){const t=e.encryptedBallot;return window.crypto.subtle.digest("SHA-256",(new TextEncoder).encode(t)).then((e=>Array.from(new Uint8Array(e)).map((e=>e.toString(16).padStart(2,"0"))).join("")))}verifyVote(e){const{uniqueId:t}=this.election;return this.bulletinBoardClient.getLogEntry({electionUniqueId:t,contentHash:e})}}class ee{constructor(e,t){this.format="jwk",this.algorithm={name:"RSASSA-PKCS1-v1_5",modulusLength:4096,publicExponent:new Uint8Array([1,0,1]),hash:{name:"SHA-256"}},this.usages=["sign"],this.publicKeyAttrs=["alg","e","kty","n"],this.jwtHeader=this._encode64(JSON.stringify({alg:"RS256",typ:"JWT"})),this.trusteeUniqueId=e,this.privateKey=null,this.publicKey=null,this.storedPublicKey=JSON.parse(t||null),this.keyIdentifier=`${e}-private-key`,this.browserSupport=this._checkBrowserSupport(),this.textEncoder=new TextEncoder("utf-8"),this.dbName="identification_keys",this.dbVersion=1,this.presentPromise=this._read()}present(e){this.presentPromise.then((()=>{this._matchesStoredPublicKey(this.publicKey)?e(this.browserSupport&&null!==this.privateKey):this.reset().then(e(!1))}))}async generate(){return!(!this.browserSupport||this.storedPublicKey)&&new Promise(((e,t)=>{try{return this.crypto.subtle.generateKey(this.algorithm,!0,this.usages).then((t=>this.crypto.subtle.exportKey(this.format,t.privateKey).then((t=>{this.publicKey=this._publicKeyFromPrivateKey(t);const r=document.createElement("a");return r.setAttribute("href",`data:text/plain;charset=utf-8,${encodeURIComponent(JSON.stringify(t))}`),r.setAttribute("download",`${this.keyIdentifier}.jwk`),r.style.display="none",document.body.appendChild(r),r.click(),document.body.removeChild(r),e()})).catch(this._handleErrors)))}catch(e){return t(e)}}))}async upload(e){return!(!this.browserSupport||null!==this.privateKey)&&new Promise(((t,r)=>{if(e)this.onUploadInputChange(e,t,r);else{const e=document.createElement("input");e.setAttribute("type","file"),e.setAttribute("accept",".jwk"),e.style.display="none",document.body.appendChild(e),e.addEventListener("change",(n=>{document.body.removeChild(e),this.onUploadInputChange(n,t,r)})),e.click()}}))}onUploadInputChange(e,t,r){const n=new FileReader;n.readAsText(e.target.files[0]),n.onload=e=>{let n="";try{n=JSON.parse(e.target.result)}catch(e){return r("invalid_format")}return this.crypto.subtle.importKey(this.format,n,this.algorithm,!1,this.usages).then((e=>{const i=this._publicKeyFromPrivateKey(n);this._matchesStoredPublicKey(i)?(this.publicKey=i,this.privateKey=e,this._save().then((()=>t(!0))).catch((()=>{r("could not be saved")}))):r("invalid_public_key")})).catch((()=>{r("invalid_key")}))}}reset(){return this.privateKey=this.publicKey=null,this._clear()}async sign(e){if(!this.browserSupport||null===this.privateKey)return!1;const t=`${this.jwtHeader}.${this._encode64(JSON.stringify(e))}`,r=await this.crypto.subtle.sign(this.algorithm,this.privateKey,this.textEncoder.encode(t));return`${t}.${btoa(Reflect.apply(String.fromCharCode,null,new Uint8Array(r))).replace(/[=]/g,"").replace(/\+/g,"-").replace(/\//g,"_")}`}_checkBrowserSupport(){return this.indexedDB=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,this.crypto=window.crypto||window.msCrypto,window.indexedDB&&window.crypto}_handleErrors(e){throw e}_publicKeyFromPrivateKey(e){return Object.keys(e).filter((e=>this.publicKeyAttrs.includes(e))).reduce(((t,r)=>(t[r]=e[r],t)),{})}_matchesStoredPublicKey(e){return Z(e,this.storedPublicKey)}_encode64(e){return btoa(unescape(encodeURIComponent(e))).replace(/[=]/g,"").replace(/\+/g,"-").replace(/\//g,"_")}async _read(){return this._useDb("readonly",(e=>{e.get(this.keyIdentifier).onsuccess=e=>{e.target.result&&(this.privateKey=e.target.result.privateKey,this.publicKey=e.target.result.publicKey)}}))}async _save(){return this._useDb("readwrite",(e=>{e.add({privateKey:this.privateKey,publicKey:this.publicKey},this.keyIdentifier)}))}async _clear(){return this._useDb("readwrite",(e=>{e.delete(this.keyIdentifier)}))}async _useDb(e,t){return new Promise(((r,n)=>{let i=null;const a=this.indexedDB.open(this.dbName,this.dbVersion);a.onerror=e=>{i=null,n(e)},a.onupgradeneeded=()=>{i=a.result,i.createObjectStore("IdentificationKeys")},a.onsuccess=()=>{i=a.result;const n=i.transaction(["IdentificationKeys"],e);t(n.objectStore("IdentificationKeys")),n.oncomplete=()=>{i.close(),r()}}}))}}class te{constructor({bulletinBoardClientParams:e,authorityPublicKeyJSON:t,electionUniqueId:r,trusteeUniqueId:n,trusteeIdentificationKeys:i,trusteeWrapperAdapter:a}){const o=new y(e);this.election=new b({uniqueId:r,bulletinBoardClient:o,typesFilter:["create_election","start_key_ceremony","key_ceremony","end_key_ceremony"]}),this.trustee=new X({uniqueId:n,bulletinBoardClient:o,authorityPublicKeyJSON:t,identificationKeys:i,election:this.election,wrapperAdapter:a})}async bindEvents({onSetup:e,onEvent:t,onBindRestoreButton:r,onBindStartButton:n,onRestore:i,onComplete:a,onStart:o,onTrusteeNeedsToBeRestored:s,onBackupNeeded:u,onBindBackupButton:c,onBackupStarted:l}){this.trustee.events.subscribe(t),r((e=>{const t=e.target.files[0],r=new FileReader;r.onload=async({target:e})=>{const t=e.result;await this.trustee.restore(t)&&(i(),await this.trustee.runKeyCeremony(),a())},r.readAsText(t)})),n((async e=>{if(e.preventDefault(),o(),await this.trustee.needsToBeRestored())s();else{const e=this.trustee.setupKeyCeremony(),{value:t}=await e.next();u(),c(t,`${this.trustee.uniqueId}-election-${this.election.uniqueId}.bak`,(async()=>{l(),await e.next(),await this.trustee.runKeyCeremony(),a()}))}})),await this.trustee.setup(),e()}}class re{constructor({bulletinBoardClientParams:e,authorityPublicKeyJSON:t,electionUniqueId:r,trusteeUniqueId:n,trusteeIdentificationKeys:i,trusteeWrapperAdapter:a}){const o=new y(e);this.election=new b({uniqueId:r,bulletinBoardClient:o,typesFilter:["create_election","start_key_ceremony","key_ceremony","end_key_ceremony","start_tally","tally","end_tally"]}),this.trustee=new X({uniqueId:n,bulletinBoardClient:o,authorityPublicKeyJSON:t,identificationKeys:i,election:this.election,wrapperAdapter:a})}async bindEvents({onSetup:e,onEvent:t,onBindRestoreButton:r,onBindStartButton:n,onRestore:i,onComplete:a,onStart:o,onTrusteeNeedsToBeRestored:s}){this.trustee.events.subscribe(t),n((async e=>{e.preventDefault(),o(),await this.trustee.needsToBeRestored()?s():(await this.trustee.runTally(),a())})),r((e=>{const t=e.target.files[0],r=new FileReader;r.onload=async({target:e})=>{const t=e.result;await this.trustee.restore(t)&&(i(),await this.trustee.runTally(),a())},r.readAsText(t)})),await this.trustee.setup(),e()}}class ne{constructor({bulletinBoardClientParams:e,authorityPublicKeyJSON:t,electionUniqueId:r,voterUniqueId:n,voterWrapperAdapter:i}){this.bulletinBoardClient=new y(e);const a=new b({uniqueId:r,bulletinBoardClient:this.bulletinBoardClient});this.voter=new $({bulletinBoardClient:this.bulletinBoardClient,authorityPublicKeyJSON:t,election:a,uniqueId:n,wrapperAdapter:i})}async bindEvents({onSetup:e,onBindEncryptButton:t,onStart:r,onVoteEncryption:n,castOrAuditBallot:i,onBindAuditBallotButton:a,onBindCastBallotButton:o,onAuditBallot:s,onCastBallot:u,onAuditComplete:c,onCastComplete:l,onInvalid:f}){t((()=>{r(),n((e=>{this.voter.encrypt(e).then((e=>(i(e),e))).then((e=>{a((()=>{const t={plainVote:e.ballot.auditableBallot,ballotHash:e.ballotHash,encryptedBallot:e};s(t,`${this.voter.uniqueId}-election-${this.voter.election.uniqueId}.txt`),c()})),o((()=>{u(e.ballot.encryptedBallot),l()}))}))}),(()=>{f()}))})),await this.voter.setup(),e()}}},2634:function(e,t,r){"use strict";r.d(t,{h4:function(){return Be},ab:function(){return ce}});var n=function(){return Object.create(null)},i=Array.prototype,a=i.forEach,o=i.slice,s=function(){function e(e,t){void 0===e&&(e=!0),void 0===t&&(t=n),this.weakness=e,this.makeData=t}return e.prototype.lookup=function(){for(var e=[],t=0;tthis.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}(),v=new p;function g(e){var t=e.unsubscribe;"function"==typeof t&&(e.unsubscribe=void 0,t())}var m=[];function b(e,t){if(!e)throw new Error(t||"assertion failure")}function E(e){switch(e.length){case 0:throw new Error("unknown value");case 1:return e[0];case 2:throw e[1]}}var S=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&&!w(this))return this.value[0]},e.prototype.recompute=function(e){return b(!this.recomputing,"already recomputing"),function(e){var t=v.getValue();if(t)e.parents.add(t),t.childValues.has(e)||t.childValues.set(e,[]),w(e)?I(t,e):k(t,e)}(this),w(this)?function(e,t){B(e),v.withValue(e,C,[e,t]),function(e,t){if("function"==typeof e.subscribe)try{g(e),e.unsubscribe=e.subscribe.apply(null,t)}catch(t){return e.setDirty(),!1}return!0}(e,t)&&function(e){if(e.dirty=!1,w(e))return;A(e)}(e);return E(e.value)}(this,e):E(this.value)},e.prototype.setDirty=function(){this.dirty||(this.dirty=!0,this.value.length=0,T(this),B(this),g(this))},e.prototype.dispose=function(){var e=this;B(this),g(this),this.parents.forEach((function(t){t.setDirty(),N(t,e)}))},e.prototype.dependOn=function(e){e.add(this),this.deps||(this.deps=m.pop()||new Set),this.deps.add(e)},e.prototype.forgetDeps=function(){var e=this;this.deps&&(this.deps.forEach((function(t){return t.delete(e)})),this.deps.clear(),m.push(this.deps),this.deps=null)},e.count=0,e}();function C(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 w(e){return e.dirty||!(!e.dirtyChildren||!e.dirtyChildren.size)}function T(e){e.parents.forEach((function(t){return I(t,e)}))}function A(e){e.parents.forEach((function(t){return k(t,e)}))}function I(e,t){if(b(e.childValues.has(t)),b(w(t)),e.dirtyChildren){if(e.dirtyChildren.has(t))return}else e.dirtyChildren=m.pop()||new Set;e.dirtyChildren.add(t),T(e)}function k(e,t){b(e.childValues.has(t)),b(!w(t));var r,n,i,a=e.childValues.get(t);0===a.length?e.childValues.set(t,t.value.slice(0)):(r=a,n=t.value,(i=r.length)>0&&i===n.length&&r[i-1]===n[i-1]||e.setDirty()),_(e,t),w(e)||A(e)}function _(e,t){var r=e.dirtyChildren;r&&(r.delete(t),0===r.size&&(m.length<100&&m.push(r),e.dirtyChildren=null))}function B(e){e.childValues.size>0&&e.childValues.forEach((function(t,r){N(e,r)})),e.forgetDeps(),b(null===e.dirtyChildren)}function N(e,t){t.parents.delete(e),e.childValues.delete(t),_(e,t)}function O(e){var t=new Map,r=e&&e.subscribe;function n(e){var n=v.getValue();if(n){var i=t.get(e);i||t.set(e,i=new Set),n.dependOn(i),"function"==typeof r&&(g(i),i.unsubscribe=r(e))}}return n.dirty=function(e){var r=t.get(e);r&&(r.forEach((function(e){return e.setDirty()})),t.delete(e),g(r))},n}var R=new s("function"==typeof WeakMap);function x(){for(var e=[],t=0;t0){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 ee?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){q.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 ee;)i=i.parent;n.forEach((function(e){return i.delete(e)}))}return n},e.prototype.findChildRefIds=function(e){if(!q.call(this.refs,e)){var t=this.refs[e]=Object.create(null),r=new Set([this.data[e]]),n=function(e){return null!==e&&"object"==typeof e};r.forEach((function(e){(0,L.hh)(e)?t[e.__ref]=!0:n(e)&&Object.values(e).filter(n).forEach(r.add,r)}))}return this.refs[e]},e.prototype.makeCacheKey=function(){for(var e=[],t=0;t0;if(l&&!s)throw c.missing[0];return{result:c.result,missing:c.missing,complete:!l}},e.prototype.isFresh=function(e,t,r,n){if(re(n.store)&&this.knownResults.get(e)===r){var i=this.executeSelectionSet.peek(r,t,n);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.context;if((0,L.hh)(n)&&!i.policies.rootTypenamesById[n.__ref]&&!i.store.has(n.__ref))return{result:{},missing:[ne(new K.ej(4),i)]};var a=i.variables,o=i.policies,s=i.store,u=[],c={result:null},l=s.getFieldValue(n,"__typename");function f(){return c.missing||(c.missing=[])}function h(e){var t;return e.missing&&(t=f()).push.apply(t,e.missing),e.result}this.config.addTypename&&"string"==typeof l&&!o.rootIdsByTypename[l]&&u.push({__typename:l});var p=new Set(r.selections);return p.forEach((function(e){var r;if((0,L.LZ)(e,a))if((0,L.My)(e)){var s=o.readField({fieldName:e.name.value,field:e,variables:i.variables,from:n},i),c=(0,L.u2)(e);i.path.push(c);var d=i.clientOnly;i.clientOnly=d||!(!e.directives||!e.directives.some((function(e){return"client"===e.name.value}))),void 0===s?L.Gw.added(e)||f().push(ne(new K.ej(5),i)):Array.isArray(s)?s=h(t.executeSubSelectedArray({field:e,array:s,context:i})):e.selectionSet&&null!=s&&(s=h(t.executeSelectionSet({selectionSet:e.selectionSet,objectOrReference:s,context:i}))),void 0!==s&&u.push(((r={})[c]=s,r)),i.clientOnly=d,(0,K.kG)(i.path.pop()===c)}else{var y=(0,L.hi)(e,i.fragmentMap);y&&o.fragmentMatches(y,l)&&y.selectionSet.selections.forEach(p.add,p)}})),c.result=(0,L.bw)(u),this.knownResults.set(c.result,r),c},e.prototype.execSubSelectedArrayImpl=function(e){var t,r=this,n=e.field,i=e.array,a=e.context;function o(e,r){return e.missing&&(t=t||[]).push.apply(t,e.missing),(0,K.kG)(a.path.pop()===r),e.result}return n.selectionSet&&(i=i.filter(a.store.canRead)),{result:i=i.map((function(e,t){return null===e?null:(a.path.push(t),Array.isArray(e)?o(r.executeSubSelectedArray({field:n,array:e,context:a}),t):n.selectionSet?o(r.executeSelectionSet({selectionSet:n.selectionSet,objectOrReference:e,context:a}),t):((0,K.kG)(a.path.pop()===t),e))})),missing:t}},e}();var ae=function(){function e(e,t){this.cache=e,this.reader=t}return e.prototype.writeToStore=function(e){var t=e.query,r=e.result,n=e.dataId,i=e.store,a=e.variables,o=(0,L.$H)(t),s=new L.w0;a=(0,V.pi)((0,V.pi)({},(0,L.O4)(o)),a);var u=this.processSelectionSet({result:r||Object.create(null),dataId:n,selectionSet:o.selectionSet,mergeTree:{map:new Map},context:{store:i,written:Object.create(null),merge:function(e,t){return s.merge(e,t)},variables:a,varString:JSON.stringify(a),fragmentMap:(0,L.F)((0,L.kU)(t))}});if(!(0,L.hh)(u))throw new K.ej(7);return i.retain(u.__ref),u},e.prototype.processSelectionSet=function(e){var t=this,r=e.dataId,n=e.result,i=e.selectionSet,a=e.context,o=e.mergeTree,s=this.cache.policies,u=s.identify(n,i,a.fragmentMap),c=u[0],l=u[1];if("string"==typeof(r=r||c)){var f=a.written[r]||(a.written[r]=[]),h=(0,L.kQ)(r);if(f.indexOf(i)>=0)return h;if(f.push(i),this.reader&&this.reader.isFresh(n,h,i,a))return h}var p=Object.create(null);l&&(p=a.merge(p,l));var d=r&&s.rootTypenamesById[r]||(0,L.qw)(n,i,a.fragmentMap)||r&&a.store.get(r,"__typename");"string"==typeof d&&(p.__typename=d);var y=new Set(i.selections);if(y.forEach((function(e){var r;if((0,L.LZ)(e,a.variables))if((0,L.My)(e)){var i=(0,L.u2)(e),u=n[i];if(void 0!==u){var c=s.getStoreFieldName({typename:d,fieldName:e.name.value,field:e,variables:a.variables}),l=se(o,c),f=t.processFieldValue(u,e,a,l),h=e.selectionSet&&a.store.getFieldValue(f,"__typename")||void 0,v=s.getMergeFunction(d,e.name.value,h);v?l.info={field:e,typename:d,merge:v}:ue(o,c),p=a.merge(p,((r={})[c]=f,r))}else if(s.usingPossibleTypes&&!(0,L.FS)(["defer","client"],e))throw new K.ej(8)}else{var g=(0,L.hi)(e,a.fragmentMap);g&&s.fragmentMatches(g,d,n,a.variables)&&g.selectionSet.selections.forEach(y.add,y)}})),"string"==typeof r){var v=(0,L.kQ)(r);return o.map.size&&(p=this.applyMerges(o,v,p,a)),a.store.merge(r,p),v}return p},e.prototype.processFieldValue=function(e,t,r,n){var i=this;return t.selectionSet&&null!==e?Array.isArray(e)?e.map((function(e,a){var o=i.processFieldValue(e,t,r,se(n,a));return ue(n,a),o})):this.processSelectionSet({result:e,selectionSet:t.selectionSet,context:r,mergeTree:n}):e},e.prototype.applyMerges=function(e,t,r,n,i){var a,o=this;if(e.map.size&&!(0,L.hh)(r)){var s,u=Array.isArray(r)||!(0,L.hh)(t)&&!Q(t)?void 0:t,c=r;u&&!i&&(i=[(0,L.hh)(u)?u.__ref:u]);var l=function(e,t){return Array.isArray(e)?"number"==typeof t?e[t]:void 0:n.store.getFieldValue(e,String(t))};e.map.forEach((function(e,t){i&&i.push(t);var r=l(u,t),a=l(c,t),f=o.applyMerges(e,r,a,n,i);f!==a&&(s=s||new Map).set(t,f),i&&(0,K.kG)(i.pop()===t)})),s&&(r=Array.isArray(c)?c.slice(0):(0,V.pi)({},c),s.forEach((function(e,t){r[t]=e})))}return e.info?this.cache.policies.runMergeFunction(t,r,e.info,n,i&&(a=n.store).getStorage.apply(a,i)):r},e}(),oe=[];function se(e,t){var r=e.map;return r.has(t)||r.set(t,oe.pop()||{map:new Map}),r.get(t)}function ue(e,t){var r=e.map,n=r.get(t);!n||n.info||n.map.size||(oe.push(n),r.delete(t))}new Set;var ce=new p;function le(e,t){if(e.size){var r=[];e.forEach((function(e){return r.push(e)})),e.clear(),r.forEach(t)}}var fe=new WeakMap;function he(e){var t=fe.get(e);return t||fe.set(e,t={vars:new Set,dep:O()}),t}function pe(e){var t=new Set,r=new Set,n=function(a){if(arguments.length>0)e!==a&&(e=a,t.forEach((function(e){he(e).dep.dirty(n),de(e)})),le(r,(function(t){return t(e)})));else{var o=ce.getValue();o&&(i(o),he(o).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),he(e).vars.add(n),n};return n.forgetCache=function(e){return t.delete(e)},n}function de(e){e.broadcastWatches&&e.broadcastWatches()}function ye(e){return void 0!==e.args?e.args:e.field?(0,L.NC)(e.field,e.variables):null}var ve=function(e,t){var r=e.__typename,n=e.id,i=e._id;if("string"==typeof r&&(t&&(t.keyObject=void 0!==n?{id:n}:void 0!==i?{_id:i}:void 0),void 0===n&&(n=i),void 0!==n))return r+":"+("number"==typeof n||"string"==typeof n?n:JSON.stringify(n))},ge=function(){},me=function(e,t){return t.fieldName},be=function(e,t,r){return(0,r.mergeObjects)(e,t)},Ee=function(e,t){return t},Se=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,V.pi)({dataIdFromObject:ve},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,r){var n=t&&r?(0,L.qw)(e,t,r):e.__typename;if(n===this.rootTypenamesById.ROOT_QUERY)return["ROOT_QUERY"];for(var i,a={typename:n,selectionSet:t,fragmentMap:r},o=n&&this.getTypePolicy(n),s=o&&o.keyFn||this.config.dataIdFromObject;s;){var u=s(e,a);if(!Array.isArray(u)){i=u;break}s=Ae(u)}return i=i&&String(i),a.keyObject?[i,a.keyObject]:[i]},e.prototype.addTypePolicies=function(e){var t=this;Object.keys(e).forEach((function(r){var n=e[r],i=n.queryType,a=n.mutationType,o=n.subscriptionType,s=(0,V._T)(n,["queryType","mutationType","subscriptionType"]);i&&t.setRootTypename("Query",r),a&&t.setRootTypename("Mutation",r),o&&t.setRootTypename("Subscription",r),q.call(t.toBeAdded,r)?t.toBeAdded[r].push(s):t.toBeAdded[r]=[s]}))},e.prototype.updateTypePolicy=function(e,t){var r=this,n=this.getTypePolicy(e),i=t.keyFields,a=t.fields;function o(e,t){e.merge="function"==typeof t?t:!0===t?be:!1===t?Ee:e.merge}o(n,t.merge),n.keyFn=!1===i?ge:Array.isArray(i)?Ae(i):"function"==typeof i?i:n.keyFn,a&&Object.keys(a).forEach((function(t){var n=r.getFieldPolicy(e,t,!0),i=a[t];if("function"==typeof i)n.read=i;else{var s=i.keyArgs,u=i.read,c=i.merge;n.keyFn=!1===s?me:Array.isArray(s)?Te(s):"function"==typeof s?s:n.keyFn,"function"==typeof u&&(n.read=u),o(n,c)}n.read&&n.merge&&(n.keyFn=n.keyFn||me)}))},e.prototype.setRootTypename=function(e,t){void 0===t&&(t=e);var r="ROOT_"+e.toUpperCase(),n=this.rootTypenamesById[r];t!==n&&((0,K.kG)(!n||n===e,1),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(z);n&&n[0]===e||t.fuzzySubtypes.set(e,new RegExp(e))}))}))},e.prototype.getTypePolicy=function(e){var t=this;if(!q.call(this.typePolicies,e)){var r=this.typePolicies[e]=Object.create(null);r.fields=Object.create(null);var n=this.supertypeMap.get(e);n&&n.size&&n.forEach((function(e){var n=t.getTypePolicy(e),i=n.fields,a=(0,V._T)(n,["fields"]);Object.assign(r,a),Object.assign(r.fields,i)}))}var i=this.toBeAdded[e];return i&&i.length&&this.updateTypePolicy(e,L.oA.apply(void 0,i.splice(0))),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 a=e.typeCondition.name.value;if(t===a)return!0;if(this.usingPossibleTypes&&this.supertypeMap.has(a))for(var o=this.getSupertypeSet(t,!0),s=[o],u=function(e){var t=i.getSupertypeSet(e,!1);t&&t.size&&s.indexOf(t)<0&&s.push(t)},c=!(!r||!this.fuzzySubtypes.size),l=0;l=e.lastRequestId){if(a&&"none"===r.errorPolicy)throw e.markError(new c.c({graphQLErrors:i.errors}));e.markResult(i,r,t),e.markReady()}var s={data:i.data,loading:!1,networkStatus:e.networkStatus||f.I.ready};return a&&"ignore"!==r.errorPolicy&&(s.errors=i.errors),s}),(function(t){var r=(0,c.M)(t)?t:new c.c({networkError:t});throw n>=e.lastRequestId&&e.markError(r),r}))},e.prototype.fetchQueryObservable=function(e,t,r){var n=this;void 0===r&&(r=f.I.loading);var i=this.transform(t.query).document,a=this.getVariables(i,t.variables),s=this.getQuery(e),u=s.networkStatus,c=t.fetchPolicy,l=void 0===c?"cache-first":c,h=t.errorPolicy,p=void 0===h?"none":h,d=t.returnPartialData,y=void 0!==d&&d,v=t.notifyOnNetworkStatusChange,g=void 0!==v&&v,m=t.context,b=void 0===m?{}:m;("cache-first"===l||"cache-and-network"===l||"network-only"===l||"no-cache"===l)&&g&&"number"==typeof u&&u!==r&&(0,f.O)(r)&&("cache-first"!==l&&(l="cache-and-network"),y=!0);var E=Object.assign({},t,{query:i,variables:a,fetchPolicy:l,errorPolicy:p,returnPartialData:y,notifyOnNetworkStatusChange:g,context:b}),S=function(e){return E.variables=e,n.fetchQueryByPolicy(s,E,r)};this.fetchCancelFns.set(e,(function(e){Promise.resolve().then((function(){return C.cancel(e)}))}));var C=new o.X_(this.transform(E.query).hasClientExports?this.localState.addExportedVariables(E.query,E.variables,E.context).then(S):S(E.variables));return C.cleanup((function(){n.fetchCancelFns.delete(e);var r=t.nextFetchPolicy;r&&(t.nextFetchPolicy=void 0,t.fetchPolicy="function"==typeof r?r.call(t,t.fetchPolicy||"cache-first"):r)})),C},e.prototype.fetchQueryByPolicy=function(e,t,r){var i=this,a=t.query,s=t.variables,u=t.fetchPolicy,c=t.errorPolicy,l=t.returnPartialData,h=t.context;e.init({document:a,variables:s,lastRequestId:this.generateRequestId(),networkStatus:r});var p=function(){return e.getDiff(s)},d=function(t,r){void 0===r&&(r=e.networkStatus||f.I.loading);var u=t.result;var c=function(e){return o.y$.of((0,n.pi)({data:e,loading:(0,f.O)(r),networkStatus:r},t.complete?null:{partial:!0}))};return i.transform(a).hasForcedResolvers?i.localState.runResolvers({document:a,remoteResult:{data:u},context:h,variables:s,onlyRunForcedResolvers:!0}).then((function(e){return c(e.data)})):c(u)},y=function(t){return i.getResultsFromLink(e,t,{variables:s,context:h,fetchPolicy:u,errorPolicy:c})};switch(u){default:case"cache-first":return(v=p()).complete?[d(v,e.markReady())]:l?[d(v),y(!0)]:[y(!0)];case"cache-and-network":var v;return(v=p()).complete||l?[d(v),y(!0)]:[y(!0)];case"cache-only":return[d(p(),e.markReady())];case"network-only":return[y(!0)];case"no-cache":return[y(!1)];case"standby":return[]}},e.prototype.getQuery=function(e){return e&&!this.queries.has(e)&&this.queries.set(e,new m(this.cache)),this.queries.get(e)},e.prototype.prepareContext=function(e){void 0===e&&(e={});var t=this.localState.prepareContext(e);return(0,n.pi)((0,n.pi)({},t),{clientAwareness:this.clientAwareness})},e}();function C(e,t){return(0,o.oA)(e,t,t.variables&&{variables:(0,n.pi)((0,n.pi)({},e.variables),t.variables)})}var w=function(){function e(e){var t=this;this.defaultOptions={},this.resetStoreCallbacks=[],this.clearStoreCallbacks=[];var r=e.uri,n=e.credentials,o=e.headers,u=e.cache,c=e.ssrMode,l=void 0!==c&&c,f=e.ssrForceFetchDelay,h=void 0===f?0:f,p=e.connectToDevTools,y=void 0===p?"object"==typeof window&&!window.__APOLLO_CLIENT__&&!1:p,v=e.queryDeduplication,g=void 0===v||v,m=e.defaultOptions,b=e.assumeImmutableResults,E=void 0!==b&&b,C=e.resolvers,w=e.typeDefs,T=e.fragmentMatcher,A=e.name,I=e.version,k=e.link;if(k||(k=r?new s.uG({uri:r,credentials:n,headers:o}):a.i0.empty()),!u)throw new i.ej(9);this.link=k,this.cache=u,this.disableNetworkFetches=l||h>0,this.queryDeduplication=g,this.defaultOptions=m||{},this.typeDefs=w,h&&setTimeout((function(){return t.disableNetworkFetches=!1}),h),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),y&&"object"==typeof window&&(window.__APOLLO_CLIENT__=this),this.version="3.3.9",this.localState=new d({cache:u,client:this,resolvers:C,fragmentMatcher:T}),this.queryManager=new S({cache:this.cache,link:this.link,queryDeduplication:g,ssrMode:l,clientAwareness:{name:A,version:I},localState:this.localState,assumeImmutableResults:E,onBroadcast:y?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=C(this.defaultOptions.watchQuery,e)),!this.disableNetworkFetches||"network-only"!==e.fetchPolicy&&"cache-and-network"!==e.fetchPolicy||(e=(0,n.pi)((0,n.pi)({},e),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(e)},e.prototype.query=function(e){return this.defaultOptions.query&&(e=C(this.defaultOptions.query,e)),(0,i.kG)("cache-and-network"!==e.fetchPolicy,10),this.disableNetworkFetches&&"network-only"===e.fetchPolicy&&(e=(0,n.pi)((0,n.pi)({},e),{fetchPolicy:"cache-first"})),this.queryManager.query(e)},e.prototype.mutate=function(e){return this.defaultOptions.mutate&&(e=C(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(0,a.ht)(this.link,e)},e.prototype.resetStore=function(){var e=this;return Promise.resolve().then((function(){return e.queryManager.clearStore()})).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()})).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.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}()},6282:function(e,t,r){"use strict";r.d(t,{u:function(){return c}});var n=r(655),i=r(2924),a=r(2152),o=r(5942),s=r(496),u=function(){function e(e,t,r,n){this.observer=e,this.options=t,this.fetch=r,this.shouldFetch=n}return e.prototype.reobserve=function(e,t){e?this.updateOptions(e):this.updatePolling();var r=this.fetch(this.options,t);return this.concast&&this.concast.removeObserver(this.observer,!0),r.addObserver(this.observer),(this.concast=r).promise},e.prototype.updateOptions=function(e){return Object.assign(this.options,(0,s.oA)(e)),this.updatePolling(),this},e.prototype.stop=function(){this.concast&&(this.concast.removeObserver(this.observer),delete this.concast),this.pollingInfo&&(clearTimeout(this.pollingInfo.timeout),this.options.pollInterval=0,this.updatePolling())},e.prototype.updatePolling=function(){var e=this,t=this.pollingInfo,r=this.options.pollInterval;if(r){if((!t||t.interval!==r)&&((0,i.kG)(r,20),!1!==this.shouldFetch)){(t||(this.pollingInfo={})).interval=r;var n=function(){e.pollingInfo&&(e.shouldFetch&&e.shouldFetch()?e.reobserve({fetchPolicy:"network-only",nextFetchPolicy:e.options.fetchPolicy||"cache-first"},o.I.poll).then(a,a):a())},a=function(){var t=e.pollingInfo;t&&(clearTimeout(t.timeout),t.timeout=setTimeout(n,t.interval))};a()}}else t&&(clearTimeout(t.timeout),delete this.pollingInfo)},e}(),c=function(e){function t(t){var r=t.queryManager,i=t.queryInfo,a=t.options,u=e.call(this,(function(e){return u.onSubscribe(e)}))||this;u.observers=new Set,u.subscriptions=new Set,u.observer={next:function(e){(u.lastError||u.isDifferentFromLastResult(e))&&(u.updateLastResult(e),(0,s.pM)(u.observers,"next",e))},error:function(e){u.updateLastResult((0,n.pi)((0,n.pi)({},u.lastResult),{error:e,errors:e.graphQLErrors,networkStatus:o.I.error,loading:!1})),(0,s.pM)(u.observers,"error",u.lastError=e)}},u.isTornDown=!1,u.options=a,u.queryId=r.generateQueryId();var c=(0,s.$H)(a.query);return u.queryName=c&&c.name&&c.name.value,u.queryManager=r,u.queryInfo=i,u}return(0,n.ZT)(t,e),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.lastResult,r=this.queryInfo.networkStatus||t&&t.networkStatus||o.I.ready,i=(0,n.pi)((0,n.pi)({},t),{loading:(0,o.O)(r),networkStatus:r});if(this.isTornDown)return i;var a=this.options.fetchPolicy,s=void 0===a?"cache-first":a;if("no-cache"===s||"network-only"===s)delete i.partial;else if(!i.data||!this.queryManager.transform(this.options.query).hasForcedResolvers){var u=this.queryInfo.getDiff();i.data=u.complete||this.options.returnPartialData?u.result:void 0,u.complete?(i.networkStatus!==o.I.loading||"cache-first"!==s&&"cache-only"!==s||(i.networkStatus=o.I.ready,i.loading=!1),delete i.partial):i.partial=!0}return e&&this.updateLastResult(i),i},t.prototype.isDifferentFromLastResult=function(e){return!(0,a.D)(this.lastResultSnapshot,e)},t.prototype.getLastResult=function(){return this.lastResult},t.prototype.getLastError=function(){return this.lastError},t.prototype.resetLastResults=function(){delete this.lastResult,delete this.lastResultSnapshot,delete this.lastError,this.isTornDown=!1},t.prototype.resetQueryStoreErrors=function(){this.queryManager.resetErrors(this.queryId)},t.prototype.refetch=function(e){var t={pollInterval:0},r=this.options.fetchPolicy;return"no-cache"!==r&&"cache-and-network"!==r&&(t.fetchPolicy="network-only",t.nextFetchPolicy=r||"cache-first"),e&&!(0,a.D)(this.options.variables,e)&&(t.variables=this.options.variables=(0,n.pi)((0,n.pi)({},this.options.variables),e)),this.newReobserver(!1).reobserve(t,o.I.refetch)},t.prototype.fetchMore=function(e){var t=this,r=(0,n.pi)((0,n.pi)({},e.query?e:(0,n.pi)((0,n.pi)((0,n.pi)({},this.options),e),{variables:(0,n.pi)((0,n.pi)({},this.options.variables),e.variables)})),{fetchPolicy:"no-cache"}),i=this.queryManager.generateQueryId();return r.notifyOnNetworkStatusChange&&(this.queryInfo.networkStatus=o.I.fetchMore,this.observe()),this.queryManager.fetchQuery(i,r,o.I.fetchMore).then((function(n){var i=n.data,a=e.updateQuery;return a?t.updateQuery((function(e){return a(e,{fetchMoreResult:i,variables:r.variables})})):t.queryManager.cache.writeQuery({query:r.query,variables:r.variables,data:i}),n})).finally((function(){t.queryManager.stopQuery(i),t.reobserve()}))},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)}});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){if((0,a.D)(this.variables,e))return this.observers.size?this.result():Promise.resolve();if(this.options.variables=e,!this.observers.size)return Promise.resolve();var t=this.options.fetchPolicy,r=void 0===t?"cache-first":t,n={fetchPolicy:r,variables:e};return"cache-first"!==r&&"no-cache"!==r&&"network-only"!==r&&(n.fetchPolicy="cache-and-network",n.nextFetchPolicy=r),this.reobserve(n,o.I.setVariables)},t.prototype.updateQuery=function(e){var t,r=this.queryManager,n=e(r.cache.diff({query:this.options.query,variables:this.variables,previousResult:null===(t=this.lastResult)||void 0===t?void 0:t.data,returnPartialData:!0,optimistic:!1}).result,{variables:this.variables});n&&(r.cache.writeQuery({query:this.options.query,data:n,variables:this.variables}),r.broadcastQueries())},t.prototype.startPolling=function(e){this.getReobserver().updateOptions({pollInterval:e})},t.prototype.stopPolling=function(){this.reobserver&&this.reobserver.updateOptions({pollInterval:0})},t.prototype.updateLastResult=function(e){var t=this.lastResult;return this.lastResult=e,this.lastResultSnapshot=this.queryManager.assumeImmutableResults?e:(0,s.Xh)(e),(0,s.Of)(e.errors)||delete this.lastError,t},t.prototype.onSubscribe=function(e){var t=this;if(e===this.observer)return function(){};try{var r=e._subscription._observer;r&&!r.error&&(r.error=l)}catch(e){}var n=!this.observers.size;return this.observers.add(e),this.lastError?e.error&&e.error(this.lastError):this.lastResult&&e.next&&e.next(this.lastResult),n&&this.reobserve().catch((function(e){})),function(){t.observers.delete(e)&&!t.observers.size&&t.tearDownQuery()}},t.prototype.getReobserver=function(){return this.reobserver||(this.reobserver=this.newReobserver(!0))},t.prototype.newReobserver=function(e){var t=this,r=this.queryManager,i=this.queryId;return r.setObservableQuery(this),new u(this.observer,e?this.options:(0,n.pi)({},this.options),(function(e,n){return r.setObservableQuery(t),r.fetchQueryObservable(i,e,n)}),!r.ssrMode&&function(){return!(0,o.O)(t.queryInfo.networkStatus)})},t.prototype.reobserve=function(e,t){return this.isTornDown=!1,this.getReobserver().reobserve(e,t)},t.prototype.observe=function(){this.observer.next(this.getCurrentResult(!1))},t.prototype.hasObservers=function(){return this.observers.size>0},t.prototype.tearDownQuery=function(){this.isTornDown||(this.reobserver&&(this.reobserver.stop(),delete this.reobserver),delete this.options.context,this.subscriptions.forEach((function(e){return e.unsubscribe()})),this.subscriptions.clear(),this.queryManager.stopQuery(this.queryId),this.observers.clear(),this.isTornDown=!0)},t}(s.y$);function l(e){}(0,s.Dy)(c)},1439:function(e,t,r){"use strict";r.d(t,{fe:function(){return n.f},h4:function(){return a.h4},HttpLink:function(){return u.uG}});var n=r(5765),i=(r(6282),r(5942),r(2191));r.o(i,"HttpLink")&&r.d(t,{HttpLink:function(){return i.HttpLink}});r(1498);var a=r(2634),o=r(5367);r.o(o,"HttpLink")&&r.d(t,{HttpLink:function(){return o.HttpLink}});var s=r(1707);r.o(s,"HttpLink")&&r.d(t,{HttpLink:function(){return s.HttpLink}});var u=r(9950),c=(r(4913),r(496),r(2924)),l=r(1466);(0,c.U6)("log");l.ZP.resetCaches,l.ZP.disableFragmentWarnings,l.ZP.enableExperimentalFragmentVariables,l.ZP.disableExperimentalFragmentVariables},5942:function(e,t,r){"use strict";var n;function i(e){return!!e&&e<7}r.d(t,{I:function(){return n},O:function(){return i}}),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"}(n||(n={}))},2191:function(){},1498:function(e,t,r){"use strict";r.d(t,{M:function(){return a},c:function(){return o}});var n=r(655),i=r(496);function a(e){return e.hasOwnProperty("graphQLErrors")}var o=function(e){function t(r){var n,a,o=r.graphQLErrors,s=r.networkError,u=r.errorMessage,c=r.extraInfo,l=e.call(this,u)||this;return l.graphQLErrors=o||[],l.networkError=s||null,l.message=u||(n=l,a="",(0,i.Of)(n.graphQLErrors)&&n.graphQLErrors.forEach((function(e){var t=e?e.message:"Error message not found.";a+=t+"\n"})),n.networkError&&(a+=n.networkError.message+"\n"),a=a.replace(/\n$/,"")),l.extraInfo=c,l.__proto__=t.prototype,l}return(0,n.ZT)(t,e),t}(Error)},7222:function(e,t,r){"use strict";r.d(t,{i:function(){return l}});var n=r(655),i=r(2924),a=r(496),o=r(4913);function s(e,t){return t?t(e):a.y$.of()}function u(e){return"function"==typeof e?new l(e):e}function c(e){return e.request.length<=1}!function(e){function t(t,r){var n=e.call(this,t)||this;return n.link=r,n}(0,n.ZT)(t,e)}(Error);var l=function(){function e(e){e&&(this.request=e)}return e.empty=function(){return new e((function(){return a.y$.of()}))},e.from=function(t){return 0===t.length?e.empty():t.map(u).reduce((function(e,t){return e.concat(t)}))},e.split=function(t,r,n){var i=u(r),o=u(n||new e(s));return c(i)&&c(o)?new e((function(e){return t(e)?i.request(e)||a.y$.of():o.request(e)||a.y$.of()})):new e((function(e,r){return t(e)?i.request(e,r)||a.y$.of():o.request(e,r)||a.y$.of()}))},e.execute=function(e,t){return e.request((0,o.zi)(t.context,(0,o.DQ)((0,o.Ak)(t))))||a.y$.of()},e.concat=function(t,r){var n=u(t);if(c(n))return n;var i=u(r);return c(i)?new e((function(e){return n.request(e,(function(e){return i.request(e)||a.y$.of()}))||a.y$.of()})):new e((function(e,t){return n.request(e,(function(e){return i.request(e,t)||a.y$.of()}))||a.y$.of()}))},e.prototype.split=function(t,r,n){return this.concat(e.split(t,r,n||new e(s)))},e.prototype.concat=function(t){return e.concat(this,t)},e.prototype.request=function(e,t){throw new i.ej(21)},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}()},4957:function(e,t,r){"use strict";r(7222).i.concat},7325:function(e,t,r){"use strict";r(7222).i.empty},2550:function(e,t,r){"use strict";r.d(t,{h:function(){return n}});var n=r(7222).i.execute},4674:function(e,t,r){"use strict";r(7222).i.from},1707:function(e,t,r){"use strict";r.d(t,{ht:function(){return n.h},i0:function(){return i.i}});r(7325),r(4674),r(4738),r(4957);var n=r(2550),i=r(7222),a=r(9875);r.o(a,"HttpLink")&&r.d(t,{HttpLink:function(){return a.HttpLink}})},4738:function(e,t,r){"use strict";r(7222).i.split},9875:function(){},9950:function(e,t,r){"use strict";r.d(t,{uG:function(){return T}});var n=r(4913),i=Object.prototype.hasOwnProperty;var a=r(2924),o=function(e,t){var r;try{r=JSON.stringify(e)}catch(e){var n=new a.ej(23);throw n.parseError=e,n}return r},s=r(655),u=r(7636),c=r(7420);function l(e){return(0,u.Vn)(e,{leave:f})}var f={Name:function(e){return e.value},Variable:function(e){return"$"+e.name},Document:function(e){return p(e.definitions,"\n\n")+"\n"},OperationDefinition:function(e){var t=e.operation,r=e.name,n=y("(",p(e.variableDefinitions,", "),")"),i=p(e.directives," "),a=e.selectionSet;return r||i||n||"query"!==t?p([t,p([r,n]),i,a]," "):a},VariableDefinition:function(e){var t=e.variable,r=e.type,n=e.defaultValue,i=e.directives;return t+": "+r+y(" = ",n)+y(" ",p(i," "))},SelectionSet:function(e){return d(e.selections)},Field:function(e){var t=e.alias,r=e.name,n=e.arguments,i=e.directives,a=e.selectionSet,o=y("",t,": ")+r,s=o+y("(",p(n,", "),")");return s.length>80&&(s=o+y("(\n",v(p(n,"\n")),"\n)")),p([s,p(i," "),a]," ")},Argument:function(e){return e.name+": "+e.value},FragmentSpread:function(e){return"..."+e.name+y(" ",p(e.directives," "))},InlineFragment:function(e){var t=e.typeCondition,r=e.directives,n=e.selectionSet;return p(["...",y("on ",t),p(r," "),n]," ")},FragmentDefinition:function(e){var t=e.name,r=e.typeCondition,n=e.variableDefinitions,i=e.directives,a=e.selectionSet;return"fragment ".concat(t).concat(y("(",p(n,", "),")")," ")+"on ".concat(r," ").concat(y("",p(i," ")," "))+a},IntValue:function(e){return e.value},FloatValue:function(e){return e.value},StringValue:function(e,t){var r=e.value;return e.block?(0,c.LZ)(r,"description"===t?"":" "):JSON.stringify(r)},BooleanValue:function(e){return e.value?"true":"false"},NullValue:function(){return"null"},EnumValue:function(e){return e.value},ListValue:function(e){return"["+p(e.values,", ")+"]"},ObjectValue:function(e){return"{"+p(e.fields,", ")+"}"},ObjectField:function(e){return e.name+": "+e.value},Directive:function(e){return"@"+e.name+y("(",p(e.arguments,", "),")")},NamedType:function(e){return e.name},ListType:function(e){return"["+e.type+"]"},NonNullType:function(e){return e.type+"!"},SchemaDefinition:h((function(e){var t=e.directives,r=e.operationTypes;return p(["schema",p(t," "),d(r)]," ")})),OperationTypeDefinition:function(e){return e.operation+": "+e.type},ScalarTypeDefinition:h((function(e){return p(["scalar",e.name,p(e.directives," ")]," ")})),ObjectTypeDefinition:h((function(e){var t=e.name,r=e.interfaces,n=e.directives,i=e.fields;return p(["type",t,y("implements ",p(r," & ")),p(n," "),d(i)]," ")})),FieldDefinition:h((function(e){var t=e.name,r=e.arguments,n=e.type,i=e.directives;return t+(m(r)?y("(\n",v(p(r,"\n")),"\n)"):y("(",p(r,", "),")"))+": "+n+y(" ",p(i," "))})),InputValueDefinition:h((function(e){var t=e.name,r=e.type,n=e.defaultValue,i=e.directives;return p([t+": "+r,y("= ",n),p(i," ")]," ")})),InterfaceTypeDefinition:h((function(e){var t=e.name,r=e.interfaces,n=e.directives,i=e.fields;return p(["interface",t,y("implements ",p(r," & ")),p(n," "),d(i)]," ")})),UnionTypeDefinition:h((function(e){var t=e.name,r=e.directives,n=e.types;return p(["union",t,p(r," "),n&&0!==n.length?"= "+p(n," | "):""]," ")})),EnumTypeDefinition:h((function(e){var t=e.name,r=e.directives,n=e.values;return p(["enum",t,p(r," "),d(n)]," ")})),EnumValueDefinition:h((function(e){return p([e.name,p(e.directives," ")]," ")})),InputObjectTypeDefinition:h((function(e){var t=e.name,r=e.directives,n=e.fields;return p(["input",t,p(r," "),d(n)]," ")})),DirectiveDefinition:h((function(e){var t=e.name,r=e.arguments,n=e.repeatable,i=e.locations;return"directive @"+t+(m(r)?y("(\n",v(p(r,"\n")),"\n)"):y("(",p(r,", "),")"))+(n?" repeatable":"")+" on "+p(i," | ")})),SchemaExtension:function(e){var t=e.directives,r=e.operationTypes;return p(["extend schema",p(t," "),d(r)]," ")},ScalarTypeExtension:function(e){return p(["extend scalar",e.name,p(e.directives," ")]," ")},ObjectTypeExtension:function(e){var t=e.name,r=e.interfaces,n=e.directives,i=e.fields;return p(["extend type",t,y("implements ",p(r," & ")),p(n," "),d(i)]," ")},InterfaceTypeExtension:function(e){var t=e.name,r=e.interfaces,n=e.directives,i=e.fields;return p(["extend interface",t,y("implements ",p(r," & ")),p(n," "),d(i)]," ")},UnionTypeExtension:function(e){var t=e.name,r=e.directives,n=e.types;return p(["extend union",t,p(r," "),n&&0!==n.length?"= "+p(n," | "):""]," ")},EnumTypeExtension:function(e){var t=e.name,r=e.directives,n=e.values;return p(["extend enum",t,p(r," "),d(n)]," ")},InputObjectTypeExtension:function(e){var t=e.name,r=e.directives,n=e.fields;return p(["extend input",t,p(r," "),d(n)]," ")}};function h(e){return function(t){return p([t.description,e(t)],"\n")}}function p(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return null!==(t=null==e?void 0:e.filter((function(e){return e})).join(r))&&void 0!==t?t:""}function d(e){return y("{\n",v(p(e,"\n")),"\n}")}function y(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return null!=t&&""!==t?e+t+r:""}function v(e){return y(" ",e.replace(/\n/g,"\n "))}function g(e){return-1!==e.indexOf("\n")}function m(e){return null!=e&&e.some(g)}var b={http:{includeQuery:!0,includeExtensions:!1},headers:{accept:"*/*","content-type":"application/json"},options:{method:"POST"}},E=r(285),S=r(1707),C=r(496);var w=function(e){void 0===e&&(e={});var t=e.uri,r=void 0===t?"/graphql":t,u=e.fetch,c=e.includeExtensions,f=e.useGETForQueries,h=e.includeUnusedVariables,p=void 0!==h&&h,d=(0,s._T)(e,["uri","fetch","includeExtensions","useGETForQueries","includeUnusedVariables"]);!function(e){if(!e&&"undefined"==typeof fetch)throw new a.ej(22)}(u),u||(u=fetch);var y={http:{includeExtensions:c},options:d.fetchOptions,credentials:d.credentials,headers:d.headers};return new S.i0((function(e){var t=function(e,t){return e.getContext().uri||("function"==typeof t?t(e):t||"/graphql")}(e,r),a=e.getContext(),c={};if(a.clientAwareness){var h=a.clientAwareness,d=h.name,v=h.version;d&&(c["apollographql-client-name"]=d),v&&(c["apollographql-client-version"]=v)}var g,m=(0,s.pi)((0,s.pi)({},c),a.headers),S={http:a.http,options:a.fetchOptions,credentials:a.credentials,headers:m},w=function(e,t){for(var r=[],n=2;n=300&&(0,n.PW)(e,t,"Response not successful: Received status code "+e.status),Array.isArray(t)||i.call(t,"data")||i.call(t,"errors")||(0,n.PW)(e,t,"Server response was missing for query '"+(Array.isArray(a)?a.map((function(e){return e.operationName})):a.operationName)+"'."),t}))})).then((function(e){return r.next(e),r.complete(),e})).catch((function(e){"AbortError"!==e.name&&(e.result&&e.result.errors&&e.result.data&&r.next(e.result),r.error(e))})),function(){g&&g.abort()}}))}))},T=function(e){function t(t){void 0===t&&(t={});var r=e.call(this,w(t).request)||this;return r.options=t,r}return(0,s.ZT)(t,e),t}(S.i0)},4913:function(e,t,r){"use strict";r.d(t,{zi:function(){return c},Qc:function(){return i},PW:function(){return o},DQ:function(){return l},Ak:function(){return s}});var n=r(496);function i(e){return new n.y$((function(t){t.error(e)}))}var a=r(2924);var o=function(e,t,r){var n=new Error(r);throw n.name="ServerError",n.response=e,n.statusCode=e.status,n.result=t,n};function s(e){for(var t=["query","operationName","variables","extensions","context"],r=0,n=Object.keys(e);r120){for(var d=Math.floor(u/80),y=u%80,v=[],g=0;g",EOF:"",BANG:"!",DOLLAR:"$",AMP:"&",PAREN_L:"(",PAREN_R:")",SPREAD:"...",COLON:":",EQUALS:"=",AT:"@",BRACKET_L:"[",BRACKET_R:"]",BRACE_L:"{",PIPE:"|",BRACE_R:"}",NAME:"Name",INT:"Int",FLOAT:"Float",STRING:"String",BLOCK_STRING:"BlockString",COMMENT:"Comment"}),A=r(6589);function I(e,t){if(!Boolean(e))throw new Error(t)}var k=function(e,t){return e instanceof t};function _(e,t){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:"GraphQL request",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{line:1,column:1};"string"==typeof e||I(0,"Body must be a string. Received: ".concat((0,A.Z)(e),".")),this.body=e,this.name=t,this.locationOffset=r,this.locationOffset.line>0||I(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||I(0,"column in locationOffset is 1-indexed and must be positive.")}var t,r,n;return t=e,(r=[{key:a,get:function(){return"Source"}}])&&_(t.prototype,r),n&&_(t,n),e}();var N=Object.freeze({QUERY:"QUERY",MUTATION:"MUTATION",SUBSCRIPTION:"SUBSCRIPTION",FIELD:"FIELD",FRAGMENT_DEFINITION:"FRAGMENT_DEFINITION",FRAGMENT_SPREAD:"FRAGMENT_SPREAD",INLINE_FRAGMENT:"INLINE_FRAGMENT",VARIABLE_DEFINITION:"VARIABLE_DEFINITION",SCHEMA:"SCHEMA",SCALAR:"SCALAR",OBJECT:"OBJECT",FIELD_DEFINITION:"FIELD_DEFINITION",ARGUMENT_DEFINITION:"ARGUMENT_DEFINITION",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",ENUM_VALUE:"ENUM_VALUE",INPUT_OBJECT:"INPUT_OBJECT",INPUT_FIELD_DEFINITION:"INPUT_FIELD_DEFINITION"}),O=r(7420),R=function(){function e(e){var t=new w.WU(T.SOF,0,0,0,0,null);this.source=e,this.lastToken=t,this.token=t,this.line=1,this.lineStart=0}var t=e.prototype;return t.advance=function(){return this.lastToken=this.token,this.token=this.lookahead()},t.lookahead=function(){var e=this.token;if(e.kind!==T.EOF)do{var t;e=null!==(t=e.next)&&void 0!==t?t:e.next=P(this,e)}while(e.kind===T.COMMENT);return e},e}();function x(e){return isNaN(e)?T.EOF:e<127?JSON.stringify(String.fromCharCode(e)):'"\\u'.concat(("00"+e.toString(16).toUpperCase()).slice(-4),'"')}function P(e,t){for(var r=e.source,n=r.body,i=n.length,a=t.end;a31||9===a));return new w.WU(T.COMMENT,t,s,r,n,i,o.slice(t+1,s))}function L(e,t,r,n,i,a){var o=e.body,s=r,u=t,c=!1;if(45===s&&(s=o.charCodeAt(++u)),48===s){if((s=o.charCodeAt(++u))>=48&&s<=57)throw S(e,u,"Invalid number, unexpected digit after 0: ".concat(x(s),"."))}else u=U(e,u,s),s=o.charCodeAt(u);if(46===s&&(c=!0,s=o.charCodeAt(++u),u=U(e,u,s),s=o.charCodeAt(u)),69!==s&&101!==s||(c=!0,43!==(s=o.charCodeAt(++u))&&45!==s||(s=o.charCodeAt(++u)),u=U(e,u,s),s=o.charCodeAt(u)),46===s||function(e){return 95===e||e>=65&&e<=90||e>=97&&e<=122}(s))throw S(e,u,"Invalid number, expected digit but got: ".concat(x(s),"."));return new w.WU(c?T.FLOAT:T.INT,t,u,n,i,a,o.slice(t,u))}function U(e,t,r){var n=e.body,i=t,a=r;if(a>=48&&a<=57){do{a=n.charCodeAt(++i)}while(a>=48&&a<=57);return i}throw S(e,i,"Invalid number, expected digit but got: ".concat(x(a),"."))}function j(e,t,r,n,i){for(var a,o,s,u,c=e.body,l=t+1,f=l,h=0,p="";l=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function M(e,t,r,n,i){for(var a=e.body,o=a.length,s=t+1,u=0;s!==o&&!isNaN(u=a.charCodeAt(s))&&(95===u||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122);)++s;return new w.WU(T.NAME,t,s,r,n,i,a.slice(t,s))}var q=function(){function e(e,t){var r=function(e){return k(e,B)}(e)?e:new B(e);this._lexer=new R(r),this._options=t}var t=e.prototype;return t.parseName=function(){var e=this.expectToken(T.NAME);return{kind:C.NAME,value:e.value,loc:this.loc(e)}},t.parseDocument=function(){var e=this._lexer.token;return{kind:C.DOCUMENT,definitions:this.many(T.SOF,this.parseDefinition,T.EOF),loc:this.loc(e)}},t.parseDefinition=function(){if(this.peek(T.NAME))switch(this._lexer.token.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"schema":case"scalar":case"type":case"interface":case"union":case"enum":case"input":case"directive":return this.parseTypeSystemDefinition();case"extend":return this.parseTypeSystemExtension()}else{if(this.peek(T.BRACE_L))return this.parseOperationDefinition();if(this.peekDescription())return this.parseTypeSystemDefinition()}throw this.unexpected()},t.parseOperationDefinition=function(){var e=this._lexer.token;if(this.peek(T.BRACE_L))return{kind:C.OPERATION_DEFINITION,operation:"query",name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet(),loc:this.loc(e)};var t,r=this.parseOperationType();return this.peek(T.NAME)&&(t=this.parseName()),{kind:C.OPERATION_DEFINITION,operation:r,name:t,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(e)}},t.parseOperationType=function(){var e=this.expectToken(T.NAME);switch(e.value){case"query":return"query";case"mutation":return"mutation";case"subscription":return"subscription"}throw this.unexpected(e)},t.parseVariableDefinitions=function(){return this.optionalMany(T.PAREN_L,this.parseVariableDefinition,T.PAREN_R)},t.parseVariableDefinition=function(){var e=this._lexer.token;return{kind:C.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(T.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(T.EQUALS)?this.parseValueLiteral(!0):void 0,directives:this.parseDirectives(!0),loc:this.loc(e)}},t.parseVariable=function(){var e=this._lexer.token;return this.expectToken(T.DOLLAR),{kind:C.VARIABLE,name:this.parseName(),loc:this.loc(e)}},t.parseSelectionSet=function(){var e=this._lexer.token;return{kind:C.SELECTION_SET,selections:this.many(T.BRACE_L,this.parseSelection,T.BRACE_R),loc:this.loc(e)}},t.parseSelection=function(){return this.peek(T.SPREAD)?this.parseFragment():this.parseField()},t.parseField=function(){var e,t,r=this._lexer.token,n=this.parseName();return this.expectOptionalToken(T.COLON)?(e=n,t=this.parseName()):t=n,{kind:C.FIELD,alias:e,name:t,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(T.BRACE_L)?this.parseSelectionSet():void 0,loc:this.loc(r)}},t.parseArguments=function(e){var t=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(T.PAREN_L,t,T.PAREN_R)},t.parseArgument=function(){var e=this._lexer.token,t=this.parseName();return this.expectToken(T.COLON),{kind:C.ARGUMENT,name:t,value:this.parseValueLiteral(!1),loc:this.loc(e)}},t.parseConstArgument=function(){var e=this._lexer.token;return{kind:C.ARGUMENT,name:this.parseName(),value:(this.expectToken(T.COLON),this.parseValueLiteral(!0)),loc:this.loc(e)}},t.parseFragment=function(){var e=this._lexer.token;this.expectToken(T.SPREAD);var t=this.expectOptionalKeyword("on");return!t&&this.peek(T.NAME)?{kind:C.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1),loc:this.loc(e)}:{kind:C.INLINE_FRAGMENT,typeCondition:t?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(e)}},t.parseFragmentDefinition=function(){var e,t=this._lexer.token;return this.expectKeyword("fragment"),!0===(null===(e=this._options)||void 0===e?void 0:e.experimentalFragmentVariables)?{kind:C.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(t)}:{kind:C.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(t)}},t.parseFragmentName=function(){if("on"===this._lexer.token.value)throw this.unexpected();return this.parseName()},t.parseValueLiteral=function(e){var t=this._lexer.token;switch(t.kind){case T.BRACKET_L:return this.parseList(e);case T.BRACE_L:return this.parseObject(e);case T.INT:return this._lexer.advance(),{kind:C.INT,value:t.value,loc:this.loc(t)};case T.FLOAT:return this._lexer.advance(),{kind:C.FLOAT,value:t.value,loc:this.loc(t)};case T.STRING:case T.BLOCK_STRING:return this.parseStringLiteral();case T.NAME:switch(this._lexer.advance(),t.value){case"true":return{kind:C.BOOLEAN,value:!0,loc:this.loc(t)};case"false":return{kind:C.BOOLEAN,value:!1,loc:this.loc(t)};case"null":return{kind:C.NULL,loc:this.loc(t)};default:return{kind:C.ENUM,value:t.value,loc:this.loc(t)}}case T.DOLLAR:if(!e)return this.parseVariable()}throw this.unexpected()},t.parseStringLiteral=function(){var e=this._lexer.token;return this._lexer.advance(),{kind:C.STRING,value:e.value,block:e.kind===T.BLOCK_STRING,loc:this.loc(e)}},t.parseList=function(e){var t=this,r=this._lexer.token;return{kind:C.LIST,values:this.any(T.BRACKET_L,(function(){return t.parseValueLiteral(e)}),T.BRACKET_R),loc:this.loc(r)}},t.parseObject=function(e){var t=this,r=this._lexer.token;return{kind:C.OBJECT,fields:this.any(T.BRACE_L,(function(){return t.parseObjectField(e)}),T.BRACE_R),loc:this.loc(r)}},t.parseObjectField=function(e){var t=this._lexer.token,r=this.parseName();return this.expectToken(T.COLON),{kind:C.OBJECT_FIELD,name:r,value:this.parseValueLiteral(e),loc:this.loc(t)}},t.parseDirectives=function(e){for(var t=[];this.peek(T.AT);)t.push(this.parseDirective(e));return t},t.parseDirective=function(e){var t=this._lexer.token;return this.expectToken(T.AT),{kind:C.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e),loc:this.loc(t)}},t.parseTypeReference=function(){var e,t=this._lexer.token;return this.expectOptionalToken(T.BRACKET_L)?(e=this.parseTypeReference(),this.expectToken(T.BRACKET_R),e={kind:C.LIST_TYPE,type:e,loc:this.loc(t)}):e=this.parseNamedType(),this.expectOptionalToken(T.BANG)?{kind:C.NON_NULL_TYPE,type:e,loc:this.loc(t)}:e},t.parseNamedType=function(){var e=this._lexer.token;return{kind:C.NAMED_TYPE,name:this.parseName(),loc:this.loc(e)}},t.parseTypeSystemDefinition=function(){var e=this.peekDescription()?this._lexer.lookahead():this._lexer.token;if(e.kind===T.NAME)switch(e.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()}throw this.unexpected(e)},t.peekDescription=function(){return this.peek(T.STRING)||this.peek(T.BLOCK_STRING)},t.parseDescription=function(){if(this.peekDescription())return this.parseStringLiteral()},t.parseSchemaDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("schema");var r=this.parseDirectives(!0),n=this.many(T.BRACE_L,this.parseOperationTypeDefinition,T.BRACE_R);return{kind:C.SCHEMA_DEFINITION,description:t,directives:r,operationTypes:n,loc:this.loc(e)}},t.parseOperationTypeDefinition=function(){var e=this._lexer.token,t=this.parseOperationType();this.expectToken(T.COLON);var r=this.parseNamedType();return{kind:C.OPERATION_TYPE_DEFINITION,operation:t,type:r,loc:this.loc(e)}},t.parseScalarTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("scalar");var r=this.parseName(),n=this.parseDirectives(!0);return{kind:C.SCALAR_TYPE_DEFINITION,description:t,name:r,directives:n,loc:this.loc(e)}},t.parseObjectTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("type");var r=this.parseName(),n=this.parseImplementsInterfaces(),i=this.parseDirectives(!0),a=this.parseFieldsDefinition();return{kind:C.OBJECT_TYPE_DEFINITION,description:t,name:r,interfaces:n,directives:i,fields:a,loc:this.loc(e)}},t.parseImplementsInterfaces=function(){var e;if(!this.expectOptionalKeyword("implements"))return[];if(!0===(null===(e=this._options)||void 0===e?void 0:e.allowLegacySDLImplementsInterfaces)){var t=[];this.expectOptionalToken(T.AMP);do{t.push(this.parseNamedType())}while(this.expectOptionalToken(T.AMP)||this.peek(T.NAME));return t}return this.delimitedMany(T.AMP,this.parseNamedType)},t.parseFieldsDefinition=function(){var e;return!0===(null===(e=this._options)||void 0===e?void 0:e.allowLegacySDLEmptyFields)&&this.peek(T.BRACE_L)&&this._lexer.lookahead().kind===T.BRACE_R?(this._lexer.advance(),this._lexer.advance(),[]):this.optionalMany(T.BRACE_L,this.parseFieldDefinition,T.BRACE_R)},t.parseFieldDefinition=function(){var e=this._lexer.token,t=this.parseDescription(),r=this.parseName(),n=this.parseArgumentDefs();this.expectToken(T.COLON);var i=this.parseTypeReference(),a=this.parseDirectives(!0);return{kind:C.FIELD_DEFINITION,description:t,name:r,arguments:n,type:i,directives:a,loc:this.loc(e)}},t.parseArgumentDefs=function(){return this.optionalMany(T.PAREN_L,this.parseInputValueDef,T.PAREN_R)},t.parseInputValueDef=function(){var e=this._lexer.token,t=this.parseDescription(),r=this.parseName();this.expectToken(T.COLON);var n,i=this.parseTypeReference();this.expectOptionalToken(T.EQUALS)&&(n=this.parseValueLiteral(!0));var a=this.parseDirectives(!0);return{kind:C.INPUT_VALUE_DEFINITION,description:t,name:r,type:i,defaultValue:n,directives:a,loc:this.loc(e)}},t.parseInterfaceTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("interface");var r=this.parseName(),n=this.parseImplementsInterfaces(),i=this.parseDirectives(!0),a=this.parseFieldsDefinition();return{kind:C.INTERFACE_TYPE_DEFINITION,description:t,name:r,interfaces:n,directives:i,fields:a,loc:this.loc(e)}},t.parseUnionTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("union");var r=this.parseName(),n=this.parseDirectives(!0),i=this.parseUnionMemberTypes();return{kind:C.UNION_TYPE_DEFINITION,description:t,name:r,directives:n,types:i,loc:this.loc(e)}},t.parseUnionMemberTypes=function(){return this.expectOptionalToken(T.EQUALS)?this.delimitedMany(T.PIPE,this.parseNamedType):[]},t.parseEnumTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("enum");var r=this.parseName(),n=this.parseDirectives(!0),i=this.parseEnumValuesDefinition();return{kind:C.ENUM_TYPE_DEFINITION,description:t,name:r,directives:n,values:i,loc:this.loc(e)}},t.parseEnumValuesDefinition=function(){return this.optionalMany(T.BRACE_L,this.parseEnumValueDefinition,T.BRACE_R)},t.parseEnumValueDefinition=function(){var e=this._lexer.token,t=this.parseDescription(),r=this.parseName(),n=this.parseDirectives(!0);return{kind:C.ENUM_VALUE_DEFINITION,description:t,name:r,directives:n,loc:this.loc(e)}},t.parseInputObjectTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("input");var r=this.parseName(),n=this.parseDirectives(!0),i=this.parseInputFieldsDefinition();return{kind:C.INPUT_OBJECT_TYPE_DEFINITION,description:t,name:r,directives:n,fields:i,loc:this.loc(e)}},t.parseInputFieldsDefinition=function(){return this.optionalMany(T.BRACE_L,this.parseInputValueDef,T.BRACE_R)},t.parseTypeSystemExtension=function(){var e=this._lexer.lookahead();if(e.kind===T.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)},t.parseSchemaExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");var t=this.parseDirectives(!0),r=this.optionalMany(T.BRACE_L,this.parseOperationTypeDefinition,T.BRACE_R);if(0===t.length&&0===r.length)throw this.unexpected();return{kind:C.SCHEMA_EXTENSION,directives:t,operationTypes:r,loc:this.loc(e)}},t.parseScalarTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");var t=this.parseName(),r=this.parseDirectives(!0);if(0===r.length)throw this.unexpected();return{kind:C.SCALAR_TYPE_EXTENSION,name:t,directives:r,loc:this.loc(e)}},t.parseObjectTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");var t=this.parseName(),r=this.parseImplementsInterfaces(),n=this.parseDirectives(!0),i=this.parseFieldsDefinition();if(0===r.length&&0===n.length&&0===i.length)throw this.unexpected();return{kind:C.OBJECT_TYPE_EXTENSION,name:t,interfaces:r,directives:n,fields:i,loc:this.loc(e)}},t.parseInterfaceTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");var t=this.parseName(),r=this.parseImplementsInterfaces(),n=this.parseDirectives(!0),i=this.parseFieldsDefinition();if(0===r.length&&0===n.length&&0===i.length)throw this.unexpected();return{kind:C.INTERFACE_TYPE_EXTENSION,name:t,interfaces:r,directives:n,fields:i,loc:this.loc(e)}},t.parseUnionTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");var t=this.parseName(),r=this.parseDirectives(!0),n=this.parseUnionMemberTypes();if(0===r.length&&0===n.length)throw this.unexpected();return{kind:C.UNION_TYPE_EXTENSION,name:t,directives:r,types:n,loc:this.loc(e)}},t.parseEnumTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");var t=this.parseName(),r=this.parseDirectives(!0),n=this.parseEnumValuesDefinition();if(0===r.length&&0===n.length)throw this.unexpected();return{kind:C.ENUM_TYPE_EXTENSION,name:t,directives:r,values:n,loc:this.loc(e)}},t.parseInputObjectTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");var t=this.parseName(),r=this.parseDirectives(!0),n=this.parseInputFieldsDefinition();if(0===r.length&&0===n.length)throw this.unexpected();return{kind:C.INPUT_OBJECT_TYPE_EXTENSION,name:t,directives:r,fields:n,loc:this.loc(e)}},t.parseDirectiveDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("directive"),this.expectToken(T.AT);var r=this.parseName(),n=this.parseArgumentDefs(),i=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");var a=this.parseDirectiveLocations();return{kind:C.DIRECTIVE_DEFINITION,description:t,name:r,arguments:n,repeatable:i,locations:a,loc:this.loc(e)}},t.parseDirectiveLocations=function(){return this.delimitedMany(T.PIPE,this.parseDirectiveLocation)},t.parseDirectiveLocation=function(){var e=this._lexer.token,t=this.parseName();if(void 0!==N[t.value])return t;throw this.unexpected(e)},t.loc=function(e){var t;if(!0!==(null===(t=this._options)||void 0===t?void 0:t.noLocation))return new w.Ye(e,this._lexer.lastToken,this._lexer.source)},t.peek=function(e){return this._lexer.token.kind===e},t.expectToken=function(e){var t=this._lexer.token;if(t.kind===e)return this._lexer.advance(),t;throw S(this._lexer.source,t.start,"Expected ".concat(H(e),", found ").concat(z(t),"."))},t.expectOptionalToken=function(e){var t=this._lexer.token;if(t.kind===e)return this._lexer.advance(),t},t.expectKeyword=function(e){var t=this._lexer.token;if(t.kind!==T.NAME||t.value!==e)throw S(this._lexer.source,t.start,'Expected "'.concat(e,'", found ').concat(z(t),"."));this._lexer.advance()},t.expectOptionalKeyword=function(e){var t=this._lexer.token;return t.kind===T.NAME&&t.value===e&&(this._lexer.advance(),!0)},t.unexpected=function(e){var t=null!=e?e:this._lexer.token;return S(this._lexer.source,t.start,"Unexpected ".concat(z(t),"."))},t.any=function(e,t,r){this.expectToken(e);for(var n=[];!this.expectOptionalToken(r);)n.push(t.call(this));return n},t.optionalMany=function(e,t,r){if(this.expectOptionalToken(e)){var n=[];do{n.push(t.call(this))}while(!this.expectOptionalToken(r));return n}return[]},t.many=function(e,t,r){this.expectToken(e);var n=[];do{n.push(t.call(this))}while(!this.expectOptionalToken(r));return n},t.delimitedMany=function(e,t){this.expectOptionalToken(e);var r=[];do{r.push(t.call(this))}while(this.expectOptionalToken(e));return r},e}();function z(e){var t=e.value;return H(e.kind)+(null!=t?' "'.concat(t,'"'):"")}function H(e){return function(e){return e===T.BANG||e===T.DOLLAR||e===T.AMP||e===T.PAREN_L||e===T.PAREN_R||e===T.SPREAD||e===T.COLON||e===T.EQUALS||e===T.AT||e===T.BRACKET_L||e===T.BRACKET_R||e===T.BRACE_L||e===T.PIPE||e===T.BRACE_R}(e)?'"'.concat(e,'"'):e}var G=new Map,Q=new Map,W=!0,Y=!1;function Z(e){return e.replace(/[\s,]+/g," ").trim()}function J(e){var t=new Set,r=[];return e.definitions.forEach((function(e){if("FragmentDefinition"===e.kind){var n=e.name.value,i=Z((o=e.loc).source.body.substring(o.start,o.end)),a=Q.get(n);a&&!a.has(i)?W&&console.warn("Warning: fragment with name "+n+" 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"):a||Q.set(n,a=new Set),a.add(i),t.has(i)||(t.add(i),r.push(e))}else r.push(e);var o})),(0,n.pi)((0,n.pi)({},e),{definitions:r})}function X(e){var t=Z(e);if(!G.has(t)){var r=function(e,t){return new q(e,t).parseDocument()}(e,{experimentalFragmentVariables:Y});if(!r||"Document"!==r.kind)throw new Error("Not a valid GraphQL document.");G.set(t,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}(J(r)))}return G.get(t)}function $(e){for(var t=[],r=1;r-1}))}function s(e){return e&&o(["client"],e)&&o(["export"],e)}var u=r(655);function c(e,t){var r=t,n=[];return e.definitions.forEach((function(e){if("OperationDefinition"===e.kind)throw new i.ej(42);"FragmentDefinition"===e.kind&&n.push(e)})),void 0===r&&((0,i.kG)(1===n.length,43),r=n[0].name.value),(0,u.pi)((0,u.pi)({},e),{definitions:(0,u.pr)([{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:r}}]}}],e.definitions)})}function l(e){void 0===e&&(e=[]);var t={};return e.forEach((function(e){t[e.name.value]=e})),t}function f(e,t){switch(e.kind){case"InlineFragment":return e;case"FragmentSpread":var r=t&&t[e.name.value];return(0,i.kG)(r,44),r;default:return null}}var h=r(5035),p=r.n(h);function d(e){return{__ref:String(e)}}function y(e){return Boolean(e&&"object"==typeof e&&"string"==typeof e.__ref)}function v(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 a={};r.fields.map((function(e){return v(a,e.name,e.value,n)})),e[t.value]=a}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 v(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 new i.ej(53);e[t.value]=null}}function g(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,a=n.value;return v(r[e.name.value],i,a,t)}))})));var n=null;return e.arguments&&e.arguments.length&&(n={},e.arguments.forEach((function(e){var r=e.name,i=e.value;return v(n,r,i,t)}))),b(e.name.value,n,r)}var m=["connection","include","skip","client","rest","export"];function b(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]})),r.connection.key+"("+JSON.stringify(i)+")"}return r.connection.key}var a=e;if(t){var o=p()(t);a+="("+o+")"}return r&&Object.keys(r).forEach((function(e){-1===m.indexOf(e)&&(r[e]&&Object.keys(r[e]).length?a+="@"+e+"("+JSON.stringify(r[e])+")":a+="@"+e)})),a}function E(e,t){if(e.arguments&&e.arguments.length){var r={};return e.arguments.forEach((function(e){var n=e.name,i=e.value;return v(r,n,i,t)})),r}return null}function S(e){return e.alias?e.alias.value:e.name.value}function C(e,t,r){if("string"==typeof e.__typename)return e.__typename;for(var n=0,i=t.selections;n1)for(var n=new Y,i=1;i0}function ue(e){return e.errors&&e.errors.length>0||!1}ie(oe);var ce="function"==typeof WeakMap&&!("object"==typeof navigator&&"ReactNative"===navigator.product);function le(){for(var e=[],t=0;t=0&&r.indexOf(n,s)===s))}return!1}function l(e){return Object.keys(e).filter(f,e)}function f(e){return void 0!==this[e]}var h="{ [native code] }";function p(e,t){var r=s.get(e);if(r){if(r.has(t))return!0}else s.set(e,r=new Set);return r.add(t),!1}},9742:function(e,t){"use strict";t.byteLength=function(e){var t=u(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,a=u(e),o=a[0],s=a[1],c=new i(function(e,t,r){return 3*(t+r)/4-r}(0,o,s)),l=0,f=s>0?o-4:o;for(r=0;r>16&255,c[l++]=t>>8&255,c[l++]=255&t;2===s&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,c[l++]=255&t);1===s&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,c[l++]=t>>8&255,c[l++]=255&t);return c},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,a=[],o=16383,s=0,u=n-i;su?u:s+o));1===i?(t=e[n-1],a.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],a.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return a.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,s=a.length;o0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function c(e,t,n){for(var i,a,o=[],s=t;s>18&63]+r[a>>12&63]+r[a>>6&63]+r[63&a]);return o.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},2240:function(e,t,r){"use strict";var n=r(1518);function i(e,t){return void 0===t&&(t="utf8"),Buffer.isBuffer(e)?o(e.toString("base64")):o(Buffer.from(e,t).toString("base64"))}function a(e){return e=e.toString(),n.default(e).replace(/\-/g,"+").replace(/_/g,"/")}function o(e){return e.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}var s=i;s.encode=i,s.decode=function(e,t){return void 0===t&&(t="utf8"),Buffer.from(a(e),"base64").toString(t)},s.toBase64=a,s.fromBase64=o,s.toBuffer=function(e){return Buffer.from(a(e),"base64")},t.default=s},1518:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.length,r=t%4;if(!r)return e;var n=t,i=4-r,a=t+i,o=Buffer.alloc(a);for(o.write(e);i--;)o.write("=",n++);return o.toString()}},5772:function(e,t,r){e.exports=r(2240).default,e.exports.default=e.exports},8764:function(e,t,r){"use strict";var n=r(9742),i=r(645),a="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null; +window.decidimBulletinBoard=function(){var e={735:function(e,t,r){"use strict";r.r(t),r.d(t,{Client:function(){return y},Election:function(){return b},IdentificationKeys:function(){return ee},KeyCeremonyComponent:function(){return te},MESSAGE_PROCESSED:function(){return Q},MESSAGE_RECEIVED:function(){return G},MessageIdentifier:function(){return m},TallyComponent:function(){return re},Trustee:function(){return X},VoteComponent:function(){return ne},Voter:function(){return $}});var n=r(1439),i=r(9312),a=r.n(i),o=r(9953),s=r.n(o),u=r(3718),c=r.n(u),l=r(6890),f=r.n(l),h=r(5313),p=r.n(h);class d{constructor({apiEndpointUrl:e,headers:t}){const r=new n.HttpLink({uri:e,headers:t});this.apolloClient=new n.fe({link:r,cache:new n.h4})}async getLogEntry({electionUniqueId:e,contentHash:t}){return(await this.apolloClient.query({query:f(),variables:{electionUniqueId:e,contentHash:t}})).data.logEntry}async getElectionLogEntries({electionUniqueId:e,after:t,types:r}){return(await this.apolloClient.query({query:a(),variables:{electionUniqueId:e,after:t,types:r},fetchPolicy:"no-cache"})).data.election.logEntries}async processKeyCeremonyStep({messageId:e,signedData:t}){const r=await this.apolloClient.mutate({mutation:s(),variables:{messageId:e,signedData:t}});if(r.data.processKeyCeremonyStep.error)throw new Error(r.data.processKeyCeremonyStep.error);return r.data.processKeyCeremonyStep.pendingMessage}async getPendingMessageByMessageId({messageId:e}){return(await this.apolloClient.query({query:p(),variables:{messageId:e}})).data.pendingMessage}async processTallyStep({messageId:e,signedData:t}){const r=await this.apolloClient.mutate({mutation:c(),variables:{messageId:e,signedData:t}});if(r.data.processTallyStep.error)throw new Error(r.data.processTallyStep.error);return r.data.processTallyStep.pendingMessage}}class y{constructor(e){this.apiClient=new d(e)}getLogEntry({electionUniqueId:e,contentHash:t}){return this.apiClient.getLogEntry({electionUniqueId:e,contentHash:t})}getElectionLogEntries(e){return this.apiClient.getElectionLogEntries(e)}processKeyCeremonyStep(e){return this.apiClient.processKeyCeremonyStep(e)}processTallyStep(e){return this.apiClient.processTallyStep(e)}waitForPendingMessageToBeProcessed(e,t=1e3){return new Promise((r=>{const n=setInterval((()=>{this.apiClient.getPendingMessageByMessageId({messageId:e}).then((e=>{"enqueued"!==e.status&&(clearInterval(n),r(e))}))}),t)}))}}const v="t",g=["a","b","v",v];class m{static parse(e){const[t,r]=e.split("+"),[n,i,a,o]=t.split(".",4),[s,u]=r.split(".",2),c=o?`.${o}`:"";if(!g.includes(s))throw new Error("Invalid message identifier format");return{electionId:`${n}.${i}`,type:a,subtype:o,typeSubtype:`${a}${c}`,author:{type:s,id:u}}}static format(e,t,r,n){return`${e}.${t}+${r}.${n}`}}class b{constructor({uniqueId:e,bulletinBoardClient:t,typesFilter:r,options:n}){this.uniqueId=e,this.bulletinBoardClient=t,this.logEntries=[],this.typesFilter=r,this.subscriptionId=null,this.options=n||{waitUntilNextCheck:2e3}}async subscribeToLogEntriesChanges(){this.unsubscribeToLogEntriesChanges(),await this.getLogEntries(),this.subscriptionId=setInterval((()=>{this.getLogEntries()}),this.options.waitUntilNextCheck)}unsubscribeToLogEntriesChanges(){null!==this.subscriptionId&&(clearInterval(this.subscriptionId),this.subscriptionId=null)}getLastMessageFromTrustee(e){for(let t=this.logEntries.length-1;t>=0;t--){const r=this.logEntries[t],n=m.parse(r.messageId);if(n.author.type===v&&n.author.id===e)return r}return null}getLogEntries(){const e=this.logEntries[this.logEntries.length-1],t=e&&e.id||null;return new Promise((e=>{this.bulletinBoardClient.getElectionLogEntries({electionUniqueId:this.uniqueId,after:t,types:this.typesFilter}).then((t=>{t.length&&(this.logEntries=[...this.logEntries,...t]),e()}))}))}}var E=r(655);function S(e){return"function"==typeof e}var C=!1,w={Promise:void 0,set useDeprecatedSynchronousErrorHandling(e){e&&(new Error).stack;C=e},get useDeprecatedSynchronousErrorHandling(){return C}};function T(e){setTimeout((function(){throw e}),0)}var A={closed:!0,next:function(e){},error:function(e){if(w.useDeprecatedSynchronousErrorHandling)throw e;T(e)},complete:function(){}},I=function(){return Array.isArray||function(e){return e&&"number"==typeof e.length}}();var k=function(){function e(e){return Error.call(this),this.message=e?e.length+" errors occurred during unsubscription:\n"+e.map((function(e,t){return t+1+") "+e.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=e,this}return e.prototype=Object.create(Error.prototype),e}(),_=function(){function e(e){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,e&&(this._ctorUnsubscribe=!0,this._unsubscribe=e)}return e.prototype.unsubscribe=function(){var t;if(!this.closed){var r,n=this,i=n._parentOrParents,a=n._ctorUnsubscribe,o=n._unsubscribe,s=n._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,i instanceof e)i.remove(this);else if(null!==i)for(var u=0;u{n.b[t.name]=e})));for(const e of r)i.push(this.loadKey(e).then((t=>{n.t[e.name]=t})));return await Promise.all(i),n}loadKey(e){return Y.JWK.asKey(e.public_key,"json")}}class X{constructor({uniqueId:e,bulletinBoardClient:t,authorityPublicKeyJSON:r,identificationKeys:n,election:i,wrapperAdapter:a,options:o}){this.uniqueId=e,this.bulletinBoardClient=t,this.identificationKeys=n,this.election=i,this.options=o||{waitUntilNextCheck:100},this.wrapperAdapter=a,this.parser=new J({authorityPublicKeyJSON:r}),this.events=new W,this.nextLogEntryIndexToProcess=0,this.lastMessageProcessedWithResult=null,this.hasSetupKeyCeremony=!1}setup(){return this.election.subscribeToLogEntriesChanges()}tearDown(){this.election.unsubscribeToLogEntriesChanges()}async*setupKeyCeremony(){let e;for(;!e;)e=await this.waitForNextLogEntryResult();return yield await this.wrapperAdapter.backup(),await this.processKeyCeremonyStep(e),this.hasSetupKeyCeremony=!0,this.hasSetupKeyCeremony}async runKeyCeremony(){if(!this.hasSetupKeyCeremony)throw new Error("The key ceremony has not been setup yet");if(await this.needsToBeRestored())throw new Error("You need to restore the wrapper state to continue");return this.waitForNextLogEntryResult().then((async e=>(await this.processKeyCeremonyStep(e),await this.wrapperAdapter.isKeyCeremonyDone()?this.tearDown():this.runKeyCeremony())))}async runTally(){if(await this.needsToBeRestored())throw new Error("You need to restore the wrapper state to continue");return this.waitForNextLogEntryResult().then((async e=>(await this.processTallyStep(e),await this.wrapperAdapter.isTallyDone()?this.tearDown():this.runTally())))}async needsToBeRestored(){return this.election.getLastMessageFromTrustee(this.uniqueId)&&await this.wrapperAdapter.isFresh()}async restore(e){const t=this.election.getLastMessageFromTrustee(this.uniqueId);return this.hasSetupKeyCeremony=t&&await this.wrapperAdapter.restore(e,t.messageId),this.hasSetupKeyCeremony}async waitForNextLogEntryResult(){return await new Promise((e=>{const t=setInterval((async()=>{const{logEntries:r}=this.election;r.length>this.nextLogEntryIndexToProcess&&(clearInterval(t),e())}),this.options.waitUntilNextCheck)})),this.processNextLogEntry()}async processNextLogEntry(){const{logEntries:e}=this.election,t=e[this.nextLogEntryIndexToProcess];this.events.broadcastMessageReceived(t);const{messageIdentifier:r,decodedData:n}=await this.parser.parse(t),i=await this.wrapperAdapter.processMessage(r.typeSubtype,n);if(this.events.broadcastMessageProcessed(t,i),this.nextLogEntryIndexToProcess+=1,i){const{messageType:e,content:t}=i;return{message_id:m.format(this.election.uniqueId,e,v,this.uniqueId),content:t}}return i}async processKeyCeremonyStep(e){if(e&&!this.isMessageAlreadyLogged(e)){const t=await this.signMessage(e);return this.bulletinBoardClient.processKeyCeremonyStep({messageId:e.message_id,signedData:t})}}async processTallyStep(e){if(e&&!this.isMessageAlreadyLogged(e)){const t=await this.signMessage(e);return this.bulletinBoardClient.processTallyStep({messageId:e.message_id,signedData:t})}}isMessageAlreadyLogged({message_id:e}){const{logEntries:t}=this.election;return t.find((t=>t.messageId===e))}signMessage(e){return this.identificationKeys.sign({iat:Math.floor(new Date/1e3),...e})}}class ${constructor({bulletinBoardClient:e,authorityPublicKeyJSON:t,election:r,uniqueId:n,wrapperAdapter:i}){this.uniqueId=n,this.election=r,this.bulletinBoardClient=e,this.wrapperAdapter=i,this.parser=new J({authorityPublicKeyJSON:t})}setup(){return this.bulletinBoardClient.getElectionLogEntries({electionUniqueId:this.election.uniqueId,types:["create_election","end_key_ceremony"]}).then((async e=>{for(const t of e){const{messageIdentifier:e,decodedData:r}=await this.parser.parse(t);await this.wrapperAdapter.processMessage(e.typeSubtype,r)}}))}async encrypt(e){const{encryptedData:t,auditableData:r}=await this.wrapperAdapter.encrypt(e);return{encryptedData:t,encryptedDataHash:await this.hash(t),auditableData:r}}async hash(e){return window.crypto.subtle.digest("SHA-256",(new TextEncoder).encode(e)).then((e=>Array.from(new Uint8Array(e)).map((e=>e.toString(16).padStart(2,"0"))).join("")))}verifyVote(e){const{uniqueId:t}=this.election;return this.bulletinBoardClient.getLogEntry({electionUniqueId:t,contentHash:e})}}class ee{constructor(e,t){this.format="jwk",this.algorithm={name:"RSASSA-PKCS1-v1_5",modulusLength:4096,publicExponent:new Uint8Array([1,0,1]),hash:{name:"SHA-256"}},this.usages=["sign"],this.publicKeyAttrs=["alg","e","kty","n"],this.jwtHeader=this._encode64(JSON.stringify({alg:"RS256",typ:"JWT"})),this.trusteeUniqueId=e,this.privateKey=null,this.publicKey=null,this.storedPublicKey=JSON.parse(t||null),this.keyIdentifier=`${e}-private-key`,this.browserSupport=this._checkBrowserSupport(),this.textEncoder=new TextEncoder("utf-8"),this.dbName="identification_keys",this.dbVersion=1,this.presentPromise=this._read()}present(e){this.presentPromise.then((()=>{this._matchesStoredPublicKey(this.publicKey)?e(this.browserSupport&&null!==this.privateKey):this.reset().then(e(!1))}))}async generate(){return!(!this.browserSupport||this.storedPublicKey)&&new Promise(((e,t)=>{try{return this.crypto.subtle.generateKey(this.algorithm,!0,this.usages).then((t=>this.crypto.subtle.exportKey(this.format,t.privateKey).then((t=>{this.publicKey=this._publicKeyFromPrivateKey(t);const r=document.createElement("a");return r.setAttribute("href",`data:text/plain;charset=utf-8,${encodeURIComponent(JSON.stringify(t))}`),r.setAttribute("download",`${this.keyIdentifier}.jwk`),r.style.display="none",document.body.appendChild(r),r.click(),document.body.removeChild(r),e()})).catch(this._handleErrors)))}catch(e){return t(e)}}))}async upload(e){return!(!this.browserSupport||null!==this.privateKey)&&new Promise(((t,r)=>{if(e)this.onUploadInputChange(e,t,r);else{const e=document.createElement("input");e.setAttribute("type","file"),e.setAttribute("accept",".jwk"),e.style.display="none",document.body.appendChild(e),e.addEventListener("change",(n=>{document.body.removeChild(e),this.onUploadInputChange(n,t,r)})),e.click()}}))}onUploadInputChange(e,t,r){const n=new FileReader;n.readAsText(e.target.files[0]),n.onload=e=>{let n="";try{n=JSON.parse(e.target.result)}catch(e){return r("invalid_format")}return this.crypto.subtle.importKey(this.format,n,this.algorithm,!1,this.usages).then((e=>{const i=this._publicKeyFromPrivateKey(n);this._matchesStoredPublicKey(i)?(this.publicKey=i,this.privateKey=e,this._save().then((()=>t(!0))).catch((()=>{r("could not be saved")}))):r("invalid_public_key")})).catch((()=>{r("invalid_key")}))}}reset(){return this.privateKey=this.publicKey=null,this._clear()}async sign(e){if(!this.browserSupport||null===this.privateKey)return!1;const t=`${this.jwtHeader}.${this._encode64(JSON.stringify(e))}`,r=await this.crypto.subtle.sign(this.algorithm,this.privateKey,this.textEncoder.encode(t));return`${t}.${btoa(Reflect.apply(String.fromCharCode,null,new Uint8Array(r))).replace(/[=]/g,"").replace(/\+/g,"-").replace(/\//g,"_")}`}_checkBrowserSupport(){return this.indexedDB=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,this.crypto=window.crypto||window.msCrypto,window.indexedDB&&window.crypto}_handleErrors(e){throw e}_publicKeyFromPrivateKey(e){return Object.keys(e).filter((e=>this.publicKeyAttrs.includes(e))).reduce(((t,r)=>(t[r]=e[r],t)),{})}_matchesStoredPublicKey(e){return Z(e,this.storedPublicKey)}_encode64(e){return btoa(unescape(encodeURIComponent(e))).replace(/[=]/g,"").replace(/\+/g,"-").replace(/\//g,"_")}async _read(){return this._useDb("readonly",(e=>{e.get(this.keyIdentifier).onsuccess=e=>{e.target.result&&(this.privateKey=e.target.result.privateKey,this.publicKey=e.target.result.publicKey)}}))}async _save(){return this._useDb("readwrite",(e=>{e.add({privateKey:this.privateKey,publicKey:this.publicKey},this.keyIdentifier)}))}async _clear(){return this._useDb("readwrite",(e=>{e.delete(this.keyIdentifier)}))}async _useDb(e,t){return new Promise(((r,n)=>{let i=null;const a=this.indexedDB.open(this.dbName,this.dbVersion);a.onerror=e=>{i=null,n(e)},a.onupgradeneeded=()=>{i=a.result,i.createObjectStore("IdentificationKeys")},a.onsuccess=()=>{i=a.result;const n=i.transaction(["IdentificationKeys"],e);t(n.objectStore("IdentificationKeys")),n.oncomplete=()=>{i.close(),r()}}}))}}class te{constructor({bulletinBoardClientParams:e,authorityPublicKeyJSON:t,electionUniqueId:r,trusteeUniqueId:n,trusteeIdentificationKeys:i,trusteeWrapperAdapter:a}){const o=new y(e);this.election=new b({uniqueId:r,bulletinBoardClient:o,typesFilter:["create_election","start_key_ceremony","key_ceremony","end_key_ceremony"]}),this.trustee=new X({uniqueId:n,bulletinBoardClient:o,authorityPublicKeyJSON:t,identificationKeys:i,election:this.election,wrapperAdapter:a})}async bindEvents({onSetup:e,onEvent:t,onBindRestoreButton:r,onBindStartButton:n,onRestore:i,onComplete:a,onStart:o,onTrusteeNeedsToBeRestored:s,onBackupNeeded:u,onBindBackupButton:c,onBackupStarted:l}){this.trustee.events.subscribe(t),r((e=>{const t=e.target.files[0],r=new FileReader;r.onload=async({target:e})=>{const t=e.result;await this.trustee.restore(t)&&(i(),await this.trustee.runKeyCeremony(),a())},r.readAsText(t)})),n((async e=>{if(e.preventDefault(),o(),await this.trustee.needsToBeRestored())s();else{const e=this.trustee.setupKeyCeremony(),{value:t}=await e.next();u(),c(t,`${this.trustee.uniqueId}-election-${this.election.uniqueId}.bak`,(async()=>{l(),await e.next(),await this.trustee.runKeyCeremony(),a()}))}})),await this.trustee.setup(),e()}}class re{constructor({bulletinBoardClientParams:e,authorityPublicKeyJSON:t,electionUniqueId:r,trusteeUniqueId:n,trusteeIdentificationKeys:i,trusteeWrapperAdapter:a}){const o=new y(e);this.election=new b({uniqueId:r,bulletinBoardClient:o,typesFilter:["create_election","start_key_ceremony","key_ceremony","end_key_ceremony","start_tally","tally","end_tally"]}),this.trustee=new X({uniqueId:n,bulletinBoardClient:o,authorityPublicKeyJSON:t,identificationKeys:i,election:this.election,wrapperAdapter:a})}async bindEvents({onSetup:e,onEvent:t,onBindRestoreButton:r,onBindStartButton:n,onRestore:i,onComplete:a,onStart:o,onTrusteeNeedsToBeRestored:s}){this.trustee.events.subscribe(t),n((async e=>{e.preventDefault(),o(),await this.trustee.needsToBeRestored()?s():(await this.trustee.runTally(),a())})),r((e=>{const t=e.target.files[0],r=new FileReader;r.onload=async({target:e})=>{const t=e.result;await this.trustee.restore(t)&&(i(),await this.trustee.runTally(),a())},r.readAsText(t)})),await this.trustee.setup(),e()}}class ne{constructor({bulletinBoardClientParams:e,authorityPublicKeyJSON:t,electionUniqueId:r,voterUniqueId:n,voterWrapperAdapter:i}){this.bulletinBoardClient=new y(e);const a=new b({uniqueId:r,bulletinBoardClient:this.bulletinBoardClient});this.voter=new $({bulletinBoardClient:this.bulletinBoardClient,authorityPublicKeyJSON:t,election:a,uniqueId:n,wrapperAdapter:i})}async bindEvents({onSetup:e,onBindEncryptButton:t,onStart:r,onVoteEncryption:n,castOrAuditBallot:i,onBindAuditBallotButton:a,onBindCastBallotButton:o,onAuditBallot:s,onCastBallot:u,onAuditComplete:c,onCastComplete:l,onInvalid:f}){t((()=>{r(),n((e=>{this.voter.encrypt(e).then((e=>{i(e),a((()=>{s(e,`${this.voter.uniqueId}-election-${this.voter.election.uniqueId}.txt`),c()})),o((()=>{u(e),l()}))}))}),(()=>{f()}))})),await this.voter.setup(),e()}}},2634:function(e,t,r){"use strict";r.d(t,{h4:function(){return Be},ab:function(){return ce}});var n=function(){return Object.create(null)},i=Array.prototype,a=i.forEach,o=i.slice,s=function(){function e(e,t){void 0===e&&(e=!0),void 0===t&&(t=n),this.weakness=e,this.makeData=t}return e.prototype.lookup=function(){for(var e=[],t=0;tthis.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}(),v=new p;function g(e){var t=e.unsubscribe;"function"==typeof t&&(e.unsubscribe=void 0,t())}var m=[];function b(e,t){if(!e)throw new Error(t||"assertion failure")}function E(e){switch(e.length){case 0:throw new Error("unknown value");case 1:return e[0];case 2:throw e[1]}}var S=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&&!w(this))return this.value[0]},e.prototype.recompute=function(e){return b(!this.recomputing,"already recomputing"),function(e){var t=v.getValue();if(t)e.parents.add(t),t.childValues.has(e)||t.childValues.set(e,[]),w(e)?I(t,e):k(t,e)}(this),w(this)?function(e,t){B(e),v.withValue(e,C,[e,t]),function(e,t){if("function"==typeof e.subscribe)try{g(e),e.unsubscribe=e.subscribe.apply(null,t)}catch(t){return e.setDirty(),!1}return!0}(e,t)&&function(e){if(e.dirty=!1,w(e))return;A(e)}(e);return E(e.value)}(this,e):E(this.value)},e.prototype.setDirty=function(){this.dirty||(this.dirty=!0,this.value.length=0,T(this),B(this),g(this))},e.prototype.dispose=function(){var e=this;B(this),g(this),this.parents.forEach((function(t){t.setDirty(),N(t,e)}))},e.prototype.dependOn=function(e){e.add(this),this.deps||(this.deps=m.pop()||new Set),this.deps.add(e)},e.prototype.forgetDeps=function(){var e=this;this.deps&&(this.deps.forEach((function(t){return t.delete(e)})),this.deps.clear(),m.push(this.deps),this.deps=null)},e.count=0,e}();function C(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 w(e){return e.dirty||!(!e.dirtyChildren||!e.dirtyChildren.size)}function T(e){e.parents.forEach((function(t){return I(t,e)}))}function A(e){e.parents.forEach((function(t){return k(t,e)}))}function I(e,t){if(b(e.childValues.has(t)),b(w(t)),e.dirtyChildren){if(e.dirtyChildren.has(t))return}else e.dirtyChildren=m.pop()||new Set;e.dirtyChildren.add(t),T(e)}function k(e,t){b(e.childValues.has(t)),b(!w(t));var r,n,i,a=e.childValues.get(t);0===a.length?e.childValues.set(t,t.value.slice(0)):(r=a,n=t.value,(i=r.length)>0&&i===n.length&&r[i-1]===n[i-1]||e.setDirty()),_(e,t),w(e)||A(e)}function _(e,t){var r=e.dirtyChildren;r&&(r.delete(t),0===r.size&&(m.length<100&&m.push(r),e.dirtyChildren=null))}function B(e){e.childValues.size>0&&e.childValues.forEach((function(t,r){N(e,r)})),e.forgetDeps(),b(null===e.dirtyChildren)}function N(e,t){t.parents.delete(e),e.childValues.delete(t),_(e,t)}function O(e){var t=new Map,r=e&&e.subscribe;function n(e){var n=v.getValue();if(n){var i=t.get(e);i||t.set(e,i=new Set),n.dependOn(i),"function"==typeof r&&(g(i),i.unsubscribe=r(e))}}return n.dirty=function(e){var r=t.get(e);r&&(r.forEach((function(e){return e.setDirty()})),t.delete(e),g(r))},n}var R=new s("function"==typeof WeakMap);function x(){for(var e=[],t=0;t0){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 ee?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){q.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 ee;)i=i.parent;n.forEach((function(e){return i.delete(e)}))}return n},e.prototype.findChildRefIds=function(e){if(!q.call(this.refs,e)){var t=this.refs[e]=Object.create(null),r=new Set([this.data[e]]),n=function(e){return null!==e&&"object"==typeof e};r.forEach((function(e){(0,L.hh)(e)?t[e.__ref]=!0:n(e)&&Object.values(e).filter(n).forEach(r.add,r)}))}return this.refs[e]},e.prototype.makeCacheKey=function(){for(var e=[],t=0;t0;if(l&&!s)throw c.missing[0];return{result:c.result,missing:c.missing,complete:!l}},e.prototype.isFresh=function(e,t,r,n){if(re(n.store)&&this.knownResults.get(e)===r){var i=this.executeSelectionSet.peek(r,t,n);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.context;if((0,L.hh)(n)&&!i.policies.rootTypenamesById[n.__ref]&&!i.store.has(n.__ref))return{result:{},missing:[ne(new K.ej(4),i)]};var a=i.variables,o=i.policies,s=i.store,u=[],c={result:null},l=s.getFieldValue(n,"__typename");function f(){return c.missing||(c.missing=[])}function h(e){var t;return e.missing&&(t=f()).push.apply(t,e.missing),e.result}this.config.addTypename&&"string"==typeof l&&!o.rootIdsByTypename[l]&&u.push({__typename:l});var p=new Set(r.selections);return p.forEach((function(e){var r;if((0,L.LZ)(e,a))if((0,L.My)(e)){var s=o.readField({fieldName:e.name.value,field:e,variables:i.variables,from:n},i),c=(0,L.u2)(e);i.path.push(c);var d=i.clientOnly;i.clientOnly=d||!(!e.directives||!e.directives.some((function(e){return"client"===e.name.value}))),void 0===s?L.Gw.added(e)||f().push(ne(new K.ej(5),i)):Array.isArray(s)?s=h(t.executeSubSelectedArray({field:e,array:s,context:i})):e.selectionSet&&null!=s&&(s=h(t.executeSelectionSet({selectionSet:e.selectionSet,objectOrReference:s,context:i}))),void 0!==s&&u.push(((r={})[c]=s,r)),i.clientOnly=d,(0,K.kG)(i.path.pop()===c)}else{var y=(0,L.hi)(e,i.fragmentMap);y&&o.fragmentMatches(y,l)&&y.selectionSet.selections.forEach(p.add,p)}})),c.result=(0,L.bw)(u),this.knownResults.set(c.result,r),c},e.prototype.execSubSelectedArrayImpl=function(e){var t,r=this,n=e.field,i=e.array,a=e.context;function o(e,r){return e.missing&&(t=t||[]).push.apply(t,e.missing),(0,K.kG)(a.path.pop()===r),e.result}return n.selectionSet&&(i=i.filter(a.store.canRead)),{result:i=i.map((function(e,t){return null===e?null:(a.path.push(t),Array.isArray(e)?o(r.executeSubSelectedArray({field:n,array:e,context:a}),t):n.selectionSet?o(r.executeSelectionSet({selectionSet:n.selectionSet,objectOrReference:e,context:a}),t):((0,K.kG)(a.path.pop()===t),e))})),missing:t}},e}();var ae=function(){function e(e,t){this.cache=e,this.reader=t}return e.prototype.writeToStore=function(e){var t=e.query,r=e.result,n=e.dataId,i=e.store,a=e.variables,o=(0,L.$H)(t),s=new L.w0;a=(0,V.pi)((0,V.pi)({},(0,L.O4)(o)),a);var u=this.processSelectionSet({result:r||Object.create(null),dataId:n,selectionSet:o.selectionSet,mergeTree:{map:new Map},context:{store:i,written:Object.create(null),merge:function(e,t){return s.merge(e,t)},variables:a,varString:JSON.stringify(a),fragmentMap:(0,L.F)((0,L.kU)(t))}});if(!(0,L.hh)(u))throw new K.ej(7);return i.retain(u.__ref),u},e.prototype.processSelectionSet=function(e){var t=this,r=e.dataId,n=e.result,i=e.selectionSet,a=e.context,o=e.mergeTree,s=this.cache.policies,u=s.identify(n,i,a.fragmentMap),c=u[0],l=u[1];if("string"==typeof(r=r||c)){var f=a.written[r]||(a.written[r]=[]),h=(0,L.kQ)(r);if(f.indexOf(i)>=0)return h;if(f.push(i),this.reader&&this.reader.isFresh(n,h,i,a))return h}var p=Object.create(null);l&&(p=a.merge(p,l));var d=r&&s.rootTypenamesById[r]||(0,L.qw)(n,i,a.fragmentMap)||r&&a.store.get(r,"__typename");"string"==typeof d&&(p.__typename=d);var y=new Set(i.selections);if(y.forEach((function(e){var r;if((0,L.LZ)(e,a.variables))if((0,L.My)(e)){var i=(0,L.u2)(e),u=n[i];if(void 0!==u){var c=s.getStoreFieldName({typename:d,fieldName:e.name.value,field:e,variables:a.variables}),l=se(o,c),f=t.processFieldValue(u,e,a,l),h=e.selectionSet&&a.store.getFieldValue(f,"__typename")||void 0,v=s.getMergeFunction(d,e.name.value,h);v?l.info={field:e,typename:d,merge:v}:ue(o,c),p=a.merge(p,((r={})[c]=f,r))}else if(s.usingPossibleTypes&&!(0,L.FS)(["defer","client"],e))throw new K.ej(8)}else{var g=(0,L.hi)(e,a.fragmentMap);g&&s.fragmentMatches(g,d,n,a.variables)&&g.selectionSet.selections.forEach(y.add,y)}})),"string"==typeof r){var v=(0,L.kQ)(r);return o.map.size&&(p=this.applyMerges(o,v,p,a)),a.store.merge(r,p),v}return p},e.prototype.processFieldValue=function(e,t,r,n){var i=this;return t.selectionSet&&null!==e?Array.isArray(e)?e.map((function(e,a){var o=i.processFieldValue(e,t,r,se(n,a));return ue(n,a),o})):this.processSelectionSet({result:e,selectionSet:t.selectionSet,context:r,mergeTree:n}):e},e.prototype.applyMerges=function(e,t,r,n,i){var a,o=this;if(e.map.size&&!(0,L.hh)(r)){var s,u=Array.isArray(r)||!(0,L.hh)(t)&&!Q(t)?void 0:t,c=r;u&&!i&&(i=[(0,L.hh)(u)?u.__ref:u]);var l=function(e,t){return Array.isArray(e)?"number"==typeof t?e[t]:void 0:n.store.getFieldValue(e,String(t))};e.map.forEach((function(e,t){i&&i.push(t);var r=l(u,t),a=l(c,t),f=o.applyMerges(e,r,a,n,i);f!==a&&(s=s||new Map).set(t,f),i&&(0,K.kG)(i.pop()===t)})),s&&(r=Array.isArray(c)?c.slice(0):(0,V.pi)({},c),s.forEach((function(e,t){r[t]=e})))}return e.info?this.cache.policies.runMergeFunction(t,r,e.info,n,i&&(a=n.store).getStorage.apply(a,i)):r},e}(),oe=[];function se(e,t){var r=e.map;return r.has(t)||r.set(t,oe.pop()||{map:new Map}),r.get(t)}function ue(e,t){var r=e.map,n=r.get(t);!n||n.info||n.map.size||(oe.push(n),r.delete(t))}new Set;var ce=new p;function le(e,t){if(e.size){var r=[];e.forEach((function(e){return r.push(e)})),e.clear(),r.forEach(t)}}var fe=new WeakMap;function he(e){var t=fe.get(e);return t||fe.set(e,t={vars:new Set,dep:O()}),t}function pe(e){var t=new Set,r=new Set,n=function(a){if(arguments.length>0)e!==a&&(e=a,t.forEach((function(e){he(e).dep.dirty(n),de(e)})),le(r,(function(t){return t(e)})));else{var o=ce.getValue();o&&(i(o),he(o).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),he(e).vars.add(n),n};return n.forgetCache=function(e){return t.delete(e)},n}function de(e){e.broadcastWatches&&e.broadcastWatches()}function ye(e){return void 0!==e.args?e.args:e.field?(0,L.NC)(e.field,e.variables):null}var ve=function(e,t){var r=e.__typename,n=e.id,i=e._id;if("string"==typeof r&&(t&&(t.keyObject=void 0!==n?{id:n}:void 0!==i?{_id:i}:void 0),void 0===n&&(n=i),void 0!==n))return r+":"+("number"==typeof n||"string"==typeof n?n:JSON.stringify(n))},ge=function(){},me=function(e,t){return t.fieldName},be=function(e,t,r){return(0,r.mergeObjects)(e,t)},Ee=function(e,t){return t},Se=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,V.pi)({dataIdFromObject:ve},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,r){var n=t&&r?(0,L.qw)(e,t,r):e.__typename;if(n===this.rootTypenamesById.ROOT_QUERY)return["ROOT_QUERY"];for(var i,a={typename:n,selectionSet:t,fragmentMap:r},o=n&&this.getTypePolicy(n),s=o&&o.keyFn||this.config.dataIdFromObject;s;){var u=s(e,a);if(!Array.isArray(u)){i=u;break}s=Ae(u)}return i=i&&String(i),a.keyObject?[i,a.keyObject]:[i]},e.prototype.addTypePolicies=function(e){var t=this;Object.keys(e).forEach((function(r){var n=e[r],i=n.queryType,a=n.mutationType,o=n.subscriptionType,s=(0,V._T)(n,["queryType","mutationType","subscriptionType"]);i&&t.setRootTypename("Query",r),a&&t.setRootTypename("Mutation",r),o&&t.setRootTypename("Subscription",r),q.call(t.toBeAdded,r)?t.toBeAdded[r].push(s):t.toBeAdded[r]=[s]}))},e.prototype.updateTypePolicy=function(e,t){var r=this,n=this.getTypePolicy(e),i=t.keyFields,a=t.fields;function o(e,t){e.merge="function"==typeof t?t:!0===t?be:!1===t?Ee:e.merge}o(n,t.merge),n.keyFn=!1===i?ge:Array.isArray(i)?Ae(i):"function"==typeof i?i:n.keyFn,a&&Object.keys(a).forEach((function(t){var n=r.getFieldPolicy(e,t,!0),i=a[t];if("function"==typeof i)n.read=i;else{var s=i.keyArgs,u=i.read,c=i.merge;n.keyFn=!1===s?me:Array.isArray(s)?Te(s):"function"==typeof s?s:n.keyFn,"function"==typeof u&&(n.read=u),o(n,c)}n.read&&n.merge&&(n.keyFn=n.keyFn||me)}))},e.prototype.setRootTypename=function(e,t){void 0===t&&(t=e);var r="ROOT_"+e.toUpperCase(),n=this.rootTypenamesById[r];t!==n&&((0,K.kG)(!n||n===e,1),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(z);n&&n[0]===e||t.fuzzySubtypes.set(e,new RegExp(e))}))}))},e.prototype.getTypePolicy=function(e){var t=this;if(!q.call(this.typePolicies,e)){var r=this.typePolicies[e]=Object.create(null);r.fields=Object.create(null);var n=this.supertypeMap.get(e);n&&n.size&&n.forEach((function(e){var n=t.getTypePolicy(e),i=n.fields,a=(0,V._T)(n,["fields"]);Object.assign(r,a),Object.assign(r.fields,i)}))}var i=this.toBeAdded[e];return i&&i.length&&this.updateTypePolicy(e,L.oA.apply(void 0,i.splice(0))),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 a=e.typeCondition.name.value;if(t===a)return!0;if(this.usingPossibleTypes&&this.supertypeMap.has(a))for(var o=this.getSupertypeSet(t,!0),s=[o],u=function(e){var t=i.getSupertypeSet(e,!1);t&&t.size&&s.indexOf(t)<0&&s.push(t)},c=!(!r||!this.fuzzySubtypes.size),l=0;l=e.lastRequestId){if(a&&"none"===r.errorPolicy)throw e.markError(new c.c({graphQLErrors:i.errors}));e.markResult(i,r,t),e.markReady()}var s={data:i.data,loading:!1,networkStatus:e.networkStatus||f.I.ready};return a&&"ignore"!==r.errorPolicy&&(s.errors=i.errors),s}),(function(t){var r=(0,c.M)(t)?t:new c.c({networkError:t});throw n>=e.lastRequestId&&e.markError(r),r}))},e.prototype.fetchQueryObservable=function(e,t,r){var n=this;void 0===r&&(r=f.I.loading);var i=this.transform(t.query).document,a=this.getVariables(i,t.variables),s=this.getQuery(e),u=s.networkStatus,c=t.fetchPolicy,l=void 0===c?"cache-first":c,h=t.errorPolicy,p=void 0===h?"none":h,d=t.returnPartialData,y=void 0!==d&&d,v=t.notifyOnNetworkStatusChange,g=void 0!==v&&v,m=t.context,b=void 0===m?{}:m;("cache-first"===l||"cache-and-network"===l||"network-only"===l||"no-cache"===l)&&g&&"number"==typeof u&&u!==r&&(0,f.O)(r)&&("cache-first"!==l&&(l="cache-and-network"),y=!0);var E=Object.assign({},t,{query:i,variables:a,fetchPolicy:l,errorPolicy:p,returnPartialData:y,notifyOnNetworkStatusChange:g,context:b}),S=function(e){return E.variables=e,n.fetchQueryByPolicy(s,E,r)};this.fetchCancelFns.set(e,(function(e){Promise.resolve().then((function(){return C.cancel(e)}))}));var C=new o.X_(this.transform(E.query).hasClientExports?this.localState.addExportedVariables(E.query,E.variables,E.context).then(S):S(E.variables));return C.cleanup((function(){n.fetchCancelFns.delete(e);var r=t.nextFetchPolicy;r&&(t.nextFetchPolicy=void 0,t.fetchPolicy="function"==typeof r?r.call(t,t.fetchPolicy||"cache-first"):r)})),C},e.prototype.fetchQueryByPolicy=function(e,t,r){var i=this,a=t.query,s=t.variables,u=t.fetchPolicy,c=t.errorPolicy,l=t.returnPartialData,h=t.context;e.init({document:a,variables:s,lastRequestId:this.generateRequestId(),networkStatus:r});var p=function(){return e.getDiff(s)},d=function(t,r){void 0===r&&(r=e.networkStatus||f.I.loading);var u=t.result;var c=function(e){return o.y$.of((0,n.pi)({data:e,loading:(0,f.O)(r),networkStatus:r},t.complete?null:{partial:!0}))};return i.transform(a).hasForcedResolvers?i.localState.runResolvers({document:a,remoteResult:{data:u},context:h,variables:s,onlyRunForcedResolvers:!0}).then((function(e){return c(e.data)})):c(u)},y=function(t){return i.getResultsFromLink(e,t,{variables:s,context:h,fetchPolicy:u,errorPolicy:c})};switch(u){default:case"cache-first":return(v=p()).complete?[d(v,e.markReady())]:l?[d(v),y(!0)]:[y(!0)];case"cache-and-network":var v;return(v=p()).complete||l?[d(v),y(!0)]:[y(!0)];case"cache-only":return[d(p(),e.markReady())];case"network-only":return[y(!0)];case"no-cache":return[y(!1)];case"standby":return[]}},e.prototype.getQuery=function(e){return e&&!this.queries.has(e)&&this.queries.set(e,new m(this.cache)),this.queries.get(e)},e.prototype.prepareContext=function(e){void 0===e&&(e={});var t=this.localState.prepareContext(e);return(0,n.pi)((0,n.pi)({},t),{clientAwareness:this.clientAwareness})},e}();function C(e,t){return(0,o.oA)(e,t,t.variables&&{variables:(0,n.pi)((0,n.pi)({},e.variables),t.variables)})}var w=function(){function e(e){var t=this;this.defaultOptions={},this.resetStoreCallbacks=[],this.clearStoreCallbacks=[];var r=e.uri,n=e.credentials,o=e.headers,u=e.cache,c=e.ssrMode,l=void 0!==c&&c,f=e.ssrForceFetchDelay,h=void 0===f?0:f,p=e.connectToDevTools,y=void 0===p?"object"==typeof window&&!window.__APOLLO_CLIENT__&&!1:p,v=e.queryDeduplication,g=void 0===v||v,m=e.defaultOptions,b=e.assumeImmutableResults,E=void 0!==b&&b,C=e.resolvers,w=e.typeDefs,T=e.fragmentMatcher,A=e.name,I=e.version,k=e.link;if(k||(k=r?new s.uG({uri:r,credentials:n,headers:o}):a.i0.empty()),!u)throw new i.ej(9);this.link=k,this.cache=u,this.disableNetworkFetches=l||h>0,this.queryDeduplication=g,this.defaultOptions=m||{},this.typeDefs=w,h&&setTimeout((function(){return t.disableNetworkFetches=!1}),h),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),y&&"object"==typeof window&&(window.__APOLLO_CLIENT__=this),this.version="3.3.9",this.localState=new d({cache:u,client:this,resolvers:C,fragmentMatcher:T}),this.queryManager=new S({cache:this.cache,link:this.link,queryDeduplication:g,ssrMode:l,clientAwareness:{name:A,version:I},localState:this.localState,assumeImmutableResults:E,onBroadcast:y?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=C(this.defaultOptions.watchQuery,e)),!this.disableNetworkFetches||"network-only"!==e.fetchPolicy&&"cache-and-network"!==e.fetchPolicy||(e=(0,n.pi)((0,n.pi)({},e),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(e)},e.prototype.query=function(e){return this.defaultOptions.query&&(e=C(this.defaultOptions.query,e)),(0,i.kG)("cache-and-network"!==e.fetchPolicy,10),this.disableNetworkFetches&&"network-only"===e.fetchPolicy&&(e=(0,n.pi)((0,n.pi)({},e),{fetchPolicy:"cache-first"})),this.queryManager.query(e)},e.prototype.mutate=function(e){return this.defaultOptions.mutate&&(e=C(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(0,a.ht)(this.link,e)},e.prototype.resetStore=function(){var e=this;return Promise.resolve().then((function(){return e.queryManager.clearStore()})).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()})).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.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}()},6282:function(e,t,r){"use strict";r.d(t,{u:function(){return c}});var n=r(655),i=r(2924),a=r(2152),o=r(5942),s=r(496),u=function(){function e(e,t,r,n){this.observer=e,this.options=t,this.fetch=r,this.shouldFetch=n}return e.prototype.reobserve=function(e,t){e?this.updateOptions(e):this.updatePolling();var r=this.fetch(this.options,t);return this.concast&&this.concast.removeObserver(this.observer,!0),r.addObserver(this.observer),(this.concast=r).promise},e.prototype.updateOptions=function(e){return Object.assign(this.options,(0,s.oA)(e)),this.updatePolling(),this},e.prototype.stop=function(){this.concast&&(this.concast.removeObserver(this.observer),delete this.concast),this.pollingInfo&&(clearTimeout(this.pollingInfo.timeout),this.options.pollInterval=0,this.updatePolling())},e.prototype.updatePolling=function(){var e=this,t=this.pollingInfo,r=this.options.pollInterval;if(r){if((!t||t.interval!==r)&&((0,i.kG)(r,20),!1!==this.shouldFetch)){(t||(this.pollingInfo={})).interval=r;var n=function(){e.pollingInfo&&(e.shouldFetch&&e.shouldFetch()?e.reobserve({fetchPolicy:"network-only",nextFetchPolicy:e.options.fetchPolicy||"cache-first"},o.I.poll).then(a,a):a())},a=function(){var t=e.pollingInfo;t&&(clearTimeout(t.timeout),t.timeout=setTimeout(n,t.interval))};a()}}else t&&(clearTimeout(t.timeout),delete this.pollingInfo)},e}(),c=function(e){function t(t){var r=t.queryManager,i=t.queryInfo,a=t.options,u=e.call(this,(function(e){return u.onSubscribe(e)}))||this;u.observers=new Set,u.subscriptions=new Set,u.observer={next:function(e){(u.lastError||u.isDifferentFromLastResult(e))&&(u.updateLastResult(e),(0,s.pM)(u.observers,"next",e))},error:function(e){u.updateLastResult((0,n.pi)((0,n.pi)({},u.lastResult),{error:e,errors:e.graphQLErrors,networkStatus:o.I.error,loading:!1})),(0,s.pM)(u.observers,"error",u.lastError=e)}},u.isTornDown=!1,u.options=a,u.queryId=r.generateQueryId();var c=(0,s.$H)(a.query);return u.queryName=c&&c.name&&c.name.value,u.queryManager=r,u.queryInfo=i,u}return(0,n.ZT)(t,e),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.lastResult,r=this.queryInfo.networkStatus||t&&t.networkStatus||o.I.ready,i=(0,n.pi)((0,n.pi)({},t),{loading:(0,o.O)(r),networkStatus:r});if(this.isTornDown)return i;var a=this.options.fetchPolicy,s=void 0===a?"cache-first":a;if("no-cache"===s||"network-only"===s)delete i.partial;else if(!i.data||!this.queryManager.transform(this.options.query).hasForcedResolvers){var u=this.queryInfo.getDiff();i.data=u.complete||this.options.returnPartialData?u.result:void 0,u.complete?(i.networkStatus!==o.I.loading||"cache-first"!==s&&"cache-only"!==s||(i.networkStatus=o.I.ready,i.loading=!1),delete i.partial):i.partial=!0}return e&&this.updateLastResult(i),i},t.prototype.isDifferentFromLastResult=function(e){return!(0,a.D)(this.lastResultSnapshot,e)},t.prototype.getLastResult=function(){return this.lastResult},t.prototype.getLastError=function(){return this.lastError},t.prototype.resetLastResults=function(){delete this.lastResult,delete this.lastResultSnapshot,delete this.lastError,this.isTornDown=!1},t.prototype.resetQueryStoreErrors=function(){this.queryManager.resetErrors(this.queryId)},t.prototype.refetch=function(e){var t={pollInterval:0},r=this.options.fetchPolicy;return"no-cache"!==r&&"cache-and-network"!==r&&(t.fetchPolicy="network-only",t.nextFetchPolicy=r||"cache-first"),e&&!(0,a.D)(this.options.variables,e)&&(t.variables=this.options.variables=(0,n.pi)((0,n.pi)({},this.options.variables),e)),this.newReobserver(!1).reobserve(t,o.I.refetch)},t.prototype.fetchMore=function(e){var t=this,r=(0,n.pi)((0,n.pi)({},e.query?e:(0,n.pi)((0,n.pi)((0,n.pi)({},this.options),e),{variables:(0,n.pi)((0,n.pi)({},this.options.variables),e.variables)})),{fetchPolicy:"no-cache"}),i=this.queryManager.generateQueryId();return r.notifyOnNetworkStatusChange&&(this.queryInfo.networkStatus=o.I.fetchMore,this.observe()),this.queryManager.fetchQuery(i,r,o.I.fetchMore).then((function(n){var i=n.data,a=e.updateQuery;return a?t.updateQuery((function(e){return a(e,{fetchMoreResult:i,variables:r.variables})})):t.queryManager.cache.writeQuery({query:r.query,variables:r.variables,data:i}),n})).finally((function(){t.queryManager.stopQuery(i),t.reobserve()}))},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)}});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){if((0,a.D)(this.variables,e))return this.observers.size?this.result():Promise.resolve();if(this.options.variables=e,!this.observers.size)return Promise.resolve();var t=this.options.fetchPolicy,r=void 0===t?"cache-first":t,n={fetchPolicy:r,variables:e};return"cache-first"!==r&&"no-cache"!==r&&"network-only"!==r&&(n.fetchPolicy="cache-and-network",n.nextFetchPolicy=r),this.reobserve(n,o.I.setVariables)},t.prototype.updateQuery=function(e){var t,r=this.queryManager,n=e(r.cache.diff({query:this.options.query,variables:this.variables,previousResult:null===(t=this.lastResult)||void 0===t?void 0:t.data,returnPartialData:!0,optimistic:!1}).result,{variables:this.variables});n&&(r.cache.writeQuery({query:this.options.query,data:n,variables:this.variables}),r.broadcastQueries())},t.prototype.startPolling=function(e){this.getReobserver().updateOptions({pollInterval:e})},t.prototype.stopPolling=function(){this.reobserver&&this.reobserver.updateOptions({pollInterval:0})},t.prototype.updateLastResult=function(e){var t=this.lastResult;return this.lastResult=e,this.lastResultSnapshot=this.queryManager.assumeImmutableResults?e:(0,s.Xh)(e),(0,s.Of)(e.errors)||delete this.lastError,t},t.prototype.onSubscribe=function(e){var t=this;if(e===this.observer)return function(){};try{var r=e._subscription._observer;r&&!r.error&&(r.error=l)}catch(e){}var n=!this.observers.size;return this.observers.add(e),this.lastError?e.error&&e.error(this.lastError):this.lastResult&&e.next&&e.next(this.lastResult),n&&this.reobserve().catch((function(e){})),function(){t.observers.delete(e)&&!t.observers.size&&t.tearDownQuery()}},t.prototype.getReobserver=function(){return this.reobserver||(this.reobserver=this.newReobserver(!0))},t.prototype.newReobserver=function(e){var t=this,r=this.queryManager,i=this.queryId;return r.setObservableQuery(this),new u(this.observer,e?this.options:(0,n.pi)({},this.options),(function(e,n){return r.setObservableQuery(t),r.fetchQueryObservable(i,e,n)}),!r.ssrMode&&function(){return!(0,o.O)(t.queryInfo.networkStatus)})},t.prototype.reobserve=function(e,t){return this.isTornDown=!1,this.getReobserver().reobserve(e,t)},t.prototype.observe=function(){this.observer.next(this.getCurrentResult(!1))},t.prototype.hasObservers=function(){return this.observers.size>0},t.prototype.tearDownQuery=function(){this.isTornDown||(this.reobserver&&(this.reobserver.stop(),delete this.reobserver),delete this.options.context,this.subscriptions.forEach((function(e){return e.unsubscribe()})),this.subscriptions.clear(),this.queryManager.stopQuery(this.queryId),this.observers.clear(),this.isTornDown=!0)},t}(s.y$);function l(e){}(0,s.Dy)(c)},1439:function(e,t,r){"use strict";r.d(t,{fe:function(){return n.f},h4:function(){return a.h4},HttpLink:function(){return u.uG}});var n=r(5765),i=(r(6282),r(5942),r(2191));r.o(i,"HttpLink")&&r.d(t,{HttpLink:function(){return i.HttpLink}});r(1498);var a=r(2634),o=r(5367);r.o(o,"HttpLink")&&r.d(t,{HttpLink:function(){return o.HttpLink}});var s=r(1707);r.o(s,"HttpLink")&&r.d(t,{HttpLink:function(){return s.HttpLink}});var u=r(9950),c=(r(4913),r(496),r(2924)),l=r(1466);(0,c.U6)("log");l.ZP.resetCaches,l.ZP.disableFragmentWarnings,l.ZP.enableExperimentalFragmentVariables,l.ZP.disableExperimentalFragmentVariables},5942:function(e,t,r){"use strict";var n;function i(e){return!!e&&e<7}r.d(t,{I:function(){return n},O:function(){return i}}),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"}(n||(n={}))},2191:function(){},1498:function(e,t,r){"use strict";r.d(t,{M:function(){return a},c:function(){return o}});var n=r(655),i=r(496);function a(e){return e.hasOwnProperty("graphQLErrors")}var o=function(e){function t(r){var n,a,o=r.graphQLErrors,s=r.networkError,u=r.errorMessage,c=r.extraInfo,l=e.call(this,u)||this;return l.graphQLErrors=o||[],l.networkError=s||null,l.message=u||(n=l,a="",(0,i.Of)(n.graphQLErrors)&&n.graphQLErrors.forEach((function(e){var t=e?e.message:"Error message not found.";a+=t+"\n"})),n.networkError&&(a+=n.networkError.message+"\n"),a=a.replace(/\n$/,"")),l.extraInfo=c,l.__proto__=t.prototype,l}return(0,n.ZT)(t,e),t}(Error)},7222:function(e,t,r){"use strict";r.d(t,{i:function(){return l}});var n=r(655),i=r(2924),a=r(496),o=r(4913);function s(e,t){return t?t(e):a.y$.of()}function u(e){return"function"==typeof e?new l(e):e}function c(e){return e.request.length<=1}!function(e){function t(t,r){var n=e.call(this,t)||this;return n.link=r,n}(0,n.ZT)(t,e)}(Error);var l=function(){function e(e){e&&(this.request=e)}return e.empty=function(){return new e((function(){return a.y$.of()}))},e.from=function(t){return 0===t.length?e.empty():t.map(u).reduce((function(e,t){return e.concat(t)}))},e.split=function(t,r,n){var i=u(r),o=u(n||new e(s));return c(i)&&c(o)?new e((function(e){return t(e)?i.request(e)||a.y$.of():o.request(e)||a.y$.of()})):new e((function(e,r){return t(e)?i.request(e,r)||a.y$.of():o.request(e,r)||a.y$.of()}))},e.execute=function(e,t){return e.request((0,o.zi)(t.context,(0,o.DQ)((0,o.Ak)(t))))||a.y$.of()},e.concat=function(t,r){var n=u(t);if(c(n))return n;var i=u(r);return c(i)?new e((function(e){return n.request(e,(function(e){return i.request(e)||a.y$.of()}))||a.y$.of()})):new e((function(e,t){return n.request(e,(function(e){return i.request(e,t)||a.y$.of()}))||a.y$.of()}))},e.prototype.split=function(t,r,n){return this.concat(e.split(t,r,n||new e(s)))},e.prototype.concat=function(t){return e.concat(this,t)},e.prototype.request=function(e,t){throw new i.ej(21)},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}()},4957:function(e,t,r){"use strict";r(7222).i.concat},7325:function(e,t,r){"use strict";r(7222).i.empty},2550:function(e,t,r){"use strict";r.d(t,{h:function(){return n}});var n=r(7222).i.execute},4674:function(e,t,r){"use strict";r(7222).i.from},1707:function(e,t,r){"use strict";r.d(t,{ht:function(){return n.h},i0:function(){return i.i}});r(7325),r(4674),r(4738),r(4957);var n=r(2550),i=r(7222),a=r(9875);r.o(a,"HttpLink")&&r.d(t,{HttpLink:function(){return a.HttpLink}})},4738:function(e,t,r){"use strict";r(7222).i.split},9875:function(){},9950:function(e,t,r){"use strict";r.d(t,{uG:function(){return T}});var n=r(4913),i=Object.prototype.hasOwnProperty;var a=r(2924),o=function(e,t){var r;try{r=JSON.stringify(e)}catch(e){var n=new a.ej(23);throw n.parseError=e,n}return r},s=r(655),u=r(7636),c=r(7420);function l(e){return(0,u.Vn)(e,{leave:f})}var f={Name:function(e){return e.value},Variable:function(e){return"$"+e.name},Document:function(e){return p(e.definitions,"\n\n")+"\n"},OperationDefinition:function(e){var t=e.operation,r=e.name,n=y("(",p(e.variableDefinitions,", "),")"),i=p(e.directives," "),a=e.selectionSet;return r||i||n||"query"!==t?p([t,p([r,n]),i,a]," "):a},VariableDefinition:function(e){var t=e.variable,r=e.type,n=e.defaultValue,i=e.directives;return t+": "+r+y(" = ",n)+y(" ",p(i," "))},SelectionSet:function(e){return d(e.selections)},Field:function(e){var t=e.alias,r=e.name,n=e.arguments,i=e.directives,a=e.selectionSet,o=y("",t,": ")+r,s=o+y("(",p(n,", "),")");return s.length>80&&(s=o+y("(\n",v(p(n,"\n")),"\n)")),p([s,p(i," "),a]," ")},Argument:function(e){return e.name+": "+e.value},FragmentSpread:function(e){return"..."+e.name+y(" ",p(e.directives," "))},InlineFragment:function(e){var t=e.typeCondition,r=e.directives,n=e.selectionSet;return p(["...",y("on ",t),p(r," "),n]," ")},FragmentDefinition:function(e){var t=e.name,r=e.typeCondition,n=e.variableDefinitions,i=e.directives,a=e.selectionSet;return"fragment ".concat(t).concat(y("(",p(n,", "),")")," ")+"on ".concat(r," ").concat(y("",p(i," ")," "))+a},IntValue:function(e){return e.value},FloatValue:function(e){return e.value},StringValue:function(e,t){var r=e.value;return e.block?(0,c.LZ)(r,"description"===t?"":" "):JSON.stringify(r)},BooleanValue:function(e){return e.value?"true":"false"},NullValue:function(){return"null"},EnumValue:function(e){return e.value},ListValue:function(e){return"["+p(e.values,", ")+"]"},ObjectValue:function(e){return"{"+p(e.fields,", ")+"}"},ObjectField:function(e){return e.name+": "+e.value},Directive:function(e){return"@"+e.name+y("(",p(e.arguments,", "),")")},NamedType:function(e){return e.name},ListType:function(e){return"["+e.type+"]"},NonNullType:function(e){return e.type+"!"},SchemaDefinition:h((function(e){var t=e.directives,r=e.operationTypes;return p(["schema",p(t," "),d(r)]," ")})),OperationTypeDefinition:function(e){return e.operation+": "+e.type},ScalarTypeDefinition:h((function(e){return p(["scalar",e.name,p(e.directives," ")]," ")})),ObjectTypeDefinition:h((function(e){var t=e.name,r=e.interfaces,n=e.directives,i=e.fields;return p(["type",t,y("implements ",p(r," & ")),p(n," "),d(i)]," ")})),FieldDefinition:h((function(e){var t=e.name,r=e.arguments,n=e.type,i=e.directives;return t+(m(r)?y("(\n",v(p(r,"\n")),"\n)"):y("(",p(r,", "),")"))+": "+n+y(" ",p(i," "))})),InputValueDefinition:h((function(e){var t=e.name,r=e.type,n=e.defaultValue,i=e.directives;return p([t+": "+r,y("= ",n),p(i," ")]," ")})),InterfaceTypeDefinition:h((function(e){var t=e.name,r=e.interfaces,n=e.directives,i=e.fields;return p(["interface",t,y("implements ",p(r," & ")),p(n," "),d(i)]," ")})),UnionTypeDefinition:h((function(e){var t=e.name,r=e.directives,n=e.types;return p(["union",t,p(r," "),n&&0!==n.length?"= "+p(n," | "):""]," ")})),EnumTypeDefinition:h((function(e){var t=e.name,r=e.directives,n=e.values;return p(["enum",t,p(r," "),d(n)]," ")})),EnumValueDefinition:h((function(e){return p([e.name,p(e.directives," ")]," ")})),InputObjectTypeDefinition:h((function(e){var t=e.name,r=e.directives,n=e.fields;return p(["input",t,p(r," "),d(n)]," ")})),DirectiveDefinition:h((function(e){var t=e.name,r=e.arguments,n=e.repeatable,i=e.locations;return"directive @"+t+(m(r)?y("(\n",v(p(r,"\n")),"\n)"):y("(",p(r,", "),")"))+(n?" repeatable":"")+" on "+p(i," | ")})),SchemaExtension:function(e){var t=e.directives,r=e.operationTypes;return p(["extend schema",p(t," "),d(r)]," ")},ScalarTypeExtension:function(e){return p(["extend scalar",e.name,p(e.directives," ")]," ")},ObjectTypeExtension:function(e){var t=e.name,r=e.interfaces,n=e.directives,i=e.fields;return p(["extend type",t,y("implements ",p(r," & ")),p(n," "),d(i)]," ")},InterfaceTypeExtension:function(e){var t=e.name,r=e.interfaces,n=e.directives,i=e.fields;return p(["extend interface",t,y("implements ",p(r," & ")),p(n," "),d(i)]," ")},UnionTypeExtension:function(e){var t=e.name,r=e.directives,n=e.types;return p(["extend union",t,p(r," "),n&&0!==n.length?"= "+p(n," | "):""]," ")},EnumTypeExtension:function(e){var t=e.name,r=e.directives,n=e.values;return p(["extend enum",t,p(r," "),d(n)]," ")},InputObjectTypeExtension:function(e){var t=e.name,r=e.directives,n=e.fields;return p(["extend input",t,p(r," "),d(n)]," ")}};function h(e){return function(t){return p([t.description,e(t)],"\n")}}function p(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return null!==(t=null==e?void 0:e.filter((function(e){return e})).join(r))&&void 0!==t?t:""}function d(e){return y("{\n",v(p(e,"\n")),"\n}")}function y(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return null!=t&&""!==t?e+t+r:""}function v(e){return y(" ",e.replace(/\n/g,"\n "))}function g(e){return-1!==e.indexOf("\n")}function m(e){return null!=e&&e.some(g)}var b={http:{includeQuery:!0,includeExtensions:!1},headers:{accept:"*/*","content-type":"application/json"},options:{method:"POST"}},E=r(285),S=r(1707),C=r(496);var w=function(e){void 0===e&&(e={});var t=e.uri,r=void 0===t?"/graphql":t,u=e.fetch,c=e.includeExtensions,f=e.useGETForQueries,h=e.includeUnusedVariables,p=void 0!==h&&h,d=(0,s._T)(e,["uri","fetch","includeExtensions","useGETForQueries","includeUnusedVariables"]);!function(e){if(!e&&"undefined"==typeof fetch)throw new a.ej(22)}(u),u||(u=fetch);var y={http:{includeExtensions:c},options:d.fetchOptions,credentials:d.credentials,headers:d.headers};return new S.i0((function(e){var t=function(e,t){return e.getContext().uri||("function"==typeof t?t(e):t||"/graphql")}(e,r),a=e.getContext(),c={};if(a.clientAwareness){var h=a.clientAwareness,d=h.name,v=h.version;d&&(c["apollographql-client-name"]=d),v&&(c["apollographql-client-version"]=v)}var g,m=(0,s.pi)((0,s.pi)({},c),a.headers),S={http:a.http,options:a.fetchOptions,credentials:a.credentials,headers:m},w=function(e,t){for(var r=[],n=2;n=300&&(0,n.PW)(e,t,"Response not successful: Received status code "+e.status),Array.isArray(t)||i.call(t,"data")||i.call(t,"errors")||(0,n.PW)(e,t,"Server response was missing for query '"+(Array.isArray(a)?a.map((function(e){return e.operationName})):a.operationName)+"'."),t}))})).then((function(e){return r.next(e),r.complete(),e})).catch((function(e){"AbortError"!==e.name&&(e.result&&e.result.errors&&e.result.data&&r.next(e.result),r.error(e))})),function(){g&&g.abort()}}))}))},T=function(e){function t(t){void 0===t&&(t={});var r=e.call(this,w(t).request)||this;return r.options=t,r}return(0,s.ZT)(t,e),t}(S.i0)},4913:function(e,t,r){"use strict";r.d(t,{zi:function(){return c},Qc:function(){return i},PW:function(){return o},DQ:function(){return l},Ak:function(){return s}});var n=r(496);function i(e){return new n.y$((function(t){t.error(e)}))}var a=r(2924);var o=function(e,t,r){var n=new Error(r);throw n.name="ServerError",n.response=e,n.statusCode=e.status,n.result=t,n};function s(e){for(var t=["query","operationName","variables","extensions","context"],r=0,n=Object.keys(e);r120){for(var d=Math.floor(u/80),y=u%80,v=[],g=0;g",EOF:"",BANG:"!",DOLLAR:"$",AMP:"&",PAREN_L:"(",PAREN_R:")",SPREAD:"...",COLON:":",EQUALS:"=",AT:"@",BRACKET_L:"[",BRACKET_R:"]",BRACE_L:"{",PIPE:"|",BRACE_R:"}",NAME:"Name",INT:"Int",FLOAT:"Float",STRING:"String",BLOCK_STRING:"BlockString",COMMENT:"Comment"}),A=r(6589);function I(e,t){if(!Boolean(e))throw new Error(t)}var k=function(e,t){return e instanceof t};function _(e,t){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:"GraphQL request",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{line:1,column:1};"string"==typeof e||I(0,"Body must be a string. Received: ".concat((0,A.Z)(e),".")),this.body=e,this.name=t,this.locationOffset=r,this.locationOffset.line>0||I(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||I(0,"column in locationOffset is 1-indexed and must be positive.")}var t,r,n;return t=e,(r=[{key:a,get:function(){return"Source"}}])&&_(t.prototype,r),n&&_(t,n),e}();var N=Object.freeze({QUERY:"QUERY",MUTATION:"MUTATION",SUBSCRIPTION:"SUBSCRIPTION",FIELD:"FIELD",FRAGMENT_DEFINITION:"FRAGMENT_DEFINITION",FRAGMENT_SPREAD:"FRAGMENT_SPREAD",INLINE_FRAGMENT:"INLINE_FRAGMENT",VARIABLE_DEFINITION:"VARIABLE_DEFINITION",SCHEMA:"SCHEMA",SCALAR:"SCALAR",OBJECT:"OBJECT",FIELD_DEFINITION:"FIELD_DEFINITION",ARGUMENT_DEFINITION:"ARGUMENT_DEFINITION",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",ENUM_VALUE:"ENUM_VALUE",INPUT_OBJECT:"INPUT_OBJECT",INPUT_FIELD_DEFINITION:"INPUT_FIELD_DEFINITION"}),O=r(7420),R=function(){function e(e){var t=new w.WU(T.SOF,0,0,0,0,null);this.source=e,this.lastToken=t,this.token=t,this.line=1,this.lineStart=0}var t=e.prototype;return t.advance=function(){return this.lastToken=this.token,this.token=this.lookahead()},t.lookahead=function(){var e=this.token;if(e.kind!==T.EOF)do{var t;e=null!==(t=e.next)&&void 0!==t?t:e.next=P(this,e)}while(e.kind===T.COMMENT);return e},e}();function x(e){return isNaN(e)?T.EOF:e<127?JSON.stringify(String.fromCharCode(e)):'"\\u'.concat(("00"+e.toString(16).toUpperCase()).slice(-4),'"')}function P(e,t){for(var r=e.source,n=r.body,i=n.length,a=t.end;a31||9===a));return new w.WU(T.COMMENT,t,s,r,n,i,o.slice(t+1,s))}function L(e,t,r,n,i,a){var o=e.body,s=r,u=t,c=!1;if(45===s&&(s=o.charCodeAt(++u)),48===s){if((s=o.charCodeAt(++u))>=48&&s<=57)throw S(e,u,"Invalid number, unexpected digit after 0: ".concat(x(s),"."))}else u=U(e,u,s),s=o.charCodeAt(u);if(46===s&&(c=!0,s=o.charCodeAt(++u),u=U(e,u,s),s=o.charCodeAt(u)),69!==s&&101!==s||(c=!0,43!==(s=o.charCodeAt(++u))&&45!==s||(s=o.charCodeAt(++u)),u=U(e,u,s),s=o.charCodeAt(u)),46===s||function(e){return 95===e||e>=65&&e<=90||e>=97&&e<=122}(s))throw S(e,u,"Invalid number, expected digit but got: ".concat(x(s),"."));return new w.WU(c?T.FLOAT:T.INT,t,u,n,i,a,o.slice(t,u))}function U(e,t,r){var n=e.body,i=t,a=r;if(a>=48&&a<=57){do{a=n.charCodeAt(++i)}while(a>=48&&a<=57);return i}throw S(e,i,"Invalid number, expected digit but got: ".concat(x(a),"."))}function j(e,t,r,n,i){for(var a,o,s,u,c=e.body,l=t+1,f=l,h=0,p="";l=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function M(e,t,r,n,i){for(var a=e.body,o=a.length,s=t+1,u=0;s!==o&&!isNaN(u=a.charCodeAt(s))&&(95===u||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122);)++s;return new w.WU(T.NAME,t,s,r,n,i,a.slice(t,s))}var q=function(){function e(e,t){var r=function(e){return k(e,B)}(e)?e:new B(e);this._lexer=new R(r),this._options=t}var t=e.prototype;return t.parseName=function(){var e=this.expectToken(T.NAME);return{kind:C.NAME,value:e.value,loc:this.loc(e)}},t.parseDocument=function(){var e=this._lexer.token;return{kind:C.DOCUMENT,definitions:this.many(T.SOF,this.parseDefinition,T.EOF),loc:this.loc(e)}},t.parseDefinition=function(){if(this.peek(T.NAME))switch(this._lexer.token.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"schema":case"scalar":case"type":case"interface":case"union":case"enum":case"input":case"directive":return this.parseTypeSystemDefinition();case"extend":return this.parseTypeSystemExtension()}else{if(this.peek(T.BRACE_L))return this.parseOperationDefinition();if(this.peekDescription())return this.parseTypeSystemDefinition()}throw this.unexpected()},t.parseOperationDefinition=function(){var e=this._lexer.token;if(this.peek(T.BRACE_L))return{kind:C.OPERATION_DEFINITION,operation:"query",name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet(),loc:this.loc(e)};var t,r=this.parseOperationType();return this.peek(T.NAME)&&(t=this.parseName()),{kind:C.OPERATION_DEFINITION,operation:r,name:t,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(e)}},t.parseOperationType=function(){var e=this.expectToken(T.NAME);switch(e.value){case"query":return"query";case"mutation":return"mutation";case"subscription":return"subscription"}throw this.unexpected(e)},t.parseVariableDefinitions=function(){return this.optionalMany(T.PAREN_L,this.parseVariableDefinition,T.PAREN_R)},t.parseVariableDefinition=function(){var e=this._lexer.token;return{kind:C.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(T.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(T.EQUALS)?this.parseValueLiteral(!0):void 0,directives:this.parseDirectives(!0),loc:this.loc(e)}},t.parseVariable=function(){var e=this._lexer.token;return this.expectToken(T.DOLLAR),{kind:C.VARIABLE,name:this.parseName(),loc:this.loc(e)}},t.parseSelectionSet=function(){var e=this._lexer.token;return{kind:C.SELECTION_SET,selections:this.many(T.BRACE_L,this.parseSelection,T.BRACE_R),loc:this.loc(e)}},t.parseSelection=function(){return this.peek(T.SPREAD)?this.parseFragment():this.parseField()},t.parseField=function(){var e,t,r=this._lexer.token,n=this.parseName();return this.expectOptionalToken(T.COLON)?(e=n,t=this.parseName()):t=n,{kind:C.FIELD,alias:e,name:t,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(T.BRACE_L)?this.parseSelectionSet():void 0,loc:this.loc(r)}},t.parseArguments=function(e){var t=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(T.PAREN_L,t,T.PAREN_R)},t.parseArgument=function(){var e=this._lexer.token,t=this.parseName();return this.expectToken(T.COLON),{kind:C.ARGUMENT,name:t,value:this.parseValueLiteral(!1),loc:this.loc(e)}},t.parseConstArgument=function(){var e=this._lexer.token;return{kind:C.ARGUMENT,name:this.parseName(),value:(this.expectToken(T.COLON),this.parseValueLiteral(!0)),loc:this.loc(e)}},t.parseFragment=function(){var e=this._lexer.token;this.expectToken(T.SPREAD);var t=this.expectOptionalKeyword("on");return!t&&this.peek(T.NAME)?{kind:C.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1),loc:this.loc(e)}:{kind:C.INLINE_FRAGMENT,typeCondition:t?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(e)}},t.parseFragmentDefinition=function(){var e,t=this._lexer.token;return this.expectKeyword("fragment"),!0===(null===(e=this._options)||void 0===e?void 0:e.experimentalFragmentVariables)?{kind:C.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(t)}:{kind:C.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(t)}},t.parseFragmentName=function(){if("on"===this._lexer.token.value)throw this.unexpected();return this.parseName()},t.parseValueLiteral=function(e){var t=this._lexer.token;switch(t.kind){case T.BRACKET_L:return this.parseList(e);case T.BRACE_L:return this.parseObject(e);case T.INT:return this._lexer.advance(),{kind:C.INT,value:t.value,loc:this.loc(t)};case T.FLOAT:return this._lexer.advance(),{kind:C.FLOAT,value:t.value,loc:this.loc(t)};case T.STRING:case T.BLOCK_STRING:return this.parseStringLiteral();case T.NAME:switch(this._lexer.advance(),t.value){case"true":return{kind:C.BOOLEAN,value:!0,loc:this.loc(t)};case"false":return{kind:C.BOOLEAN,value:!1,loc:this.loc(t)};case"null":return{kind:C.NULL,loc:this.loc(t)};default:return{kind:C.ENUM,value:t.value,loc:this.loc(t)}}case T.DOLLAR:if(!e)return this.parseVariable()}throw this.unexpected()},t.parseStringLiteral=function(){var e=this._lexer.token;return this._lexer.advance(),{kind:C.STRING,value:e.value,block:e.kind===T.BLOCK_STRING,loc:this.loc(e)}},t.parseList=function(e){var t=this,r=this._lexer.token;return{kind:C.LIST,values:this.any(T.BRACKET_L,(function(){return t.parseValueLiteral(e)}),T.BRACKET_R),loc:this.loc(r)}},t.parseObject=function(e){var t=this,r=this._lexer.token;return{kind:C.OBJECT,fields:this.any(T.BRACE_L,(function(){return t.parseObjectField(e)}),T.BRACE_R),loc:this.loc(r)}},t.parseObjectField=function(e){var t=this._lexer.token,r=this.parseName();return this.expectToken(T.COLON),{kind:C.OBJECT_FIELD,name:r,value:this.parseValueLiteral(e),loc:this.loc(t)}},t.parseDirectives=function(e){for(var t=[];this.peek(T.AT);)t.push(this.parseDirective(e));return t},t.parseDirective=function(e){var t=this._lexer.token;return this.expectToken(T.AT),{kind:C.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e),loc:this.loc(t)}},t.parseTypeReference=function(){var e,t=this._lexer.token;return this.expectOptionalToken(T.BRACKET_L)?(e=this.parseTypeReference(),this.expectToken(T.BRACKET_R),e={kind:C.LIST_TYPE,type:e,loc:this.loc(t)}):e=this.parseNamedType(),this.expectOptionalToken(T.BANG)?{kind:C.NON_NULL_TYPE,type:e,loc:this.loc(t)}:e},t.parseNamedType=function(){var e=this._lexer.token;return{kind:C.NAMED_TYPE,name:this.parseName(),loc:this.loc(e)}},t.parseTypeSystemDefinition=function(){var e=this.peekDescription()?this._lexer.lookahead():this._lexer.token;if(e.kind===T.NAME)switch(e.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()}throw this.unexpected(e)},t.peekDescription=function(){return this.peek(T.STRING)||this.peek(T.BLOCK_STRING)},t.parseDescription=function(){if(this.peekDescription())return this.parseStringLiteral()},t.parseSchemaDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("schema");var r=this.parseDirectives(!0),n=this.many(T.BRACE_L,this.parseOperationTypeDefinition,T.BRACE_R);return{kind:C.SCHEMA_DEFINITION,description:t,directives:r,operationTypes:n,loc:this.loc(e)}},t.parseOperationTypeDefinition=function(){var e=this._lexer.token,t=this.parseOperationType();this.expectToken(T.COLON);var r=this.parseNamedType();return{kind:C.OPERATION_TYPE_DEFINITION,operation:t,type:r,loc:this.loc(e)}},t.parseScalarTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("scalar");var r=this.parseName(),n=this.parseDirectives(!0);return{kind:C.SCALAR_TYPE_DEFINITION,description:t,name:r,directives:n,loc:this.loc(e)}},t.parseObjectTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("type");var r=this.parseName(),n=this.parseImplementsInterfaces(),i=this.parseDirectives(!0),a=this.parseFieldsDefinition();return{kind:C.OBJECT_TYPE_DEFINITION,description:t,name:r,interfaces:n,directives:i,fields:a,loc:this.loc(e)}},t.parseImplementsInterfaces=function(){var e;if(!this.expectOptionalKeyword("implements"))return[];if(!0===(null===(e=this._options)||void 0===e?void 0:e.allowLegacySDLImplementsInterfaces)){var t=[];this.expectOptionalToken(T.AMP);do{t.push(this.parseNamedType())}while(this.expectOptionalToken(T.AMP)||this.peek(T.NAME));return t}return this.delimitedMany(T.AMP,this.parseNamedType)},t.parseFieldsDefinition=function(){var e;return!0===(null===(e=this._options)||void 0===e?void 0:e.allowLegacySDLEmptyFields)&&this.peek(T.BRACE_L)&&this._lexer.lookahead().kind===T.BRACE_R?(this._lexer.advance(),this._lexer.advance(),[]):this.optionalMany(T.BRACE_L,this.parseFieldDefinition,T.BRACE_R)},t.parseFieldDefinition=function(){var e=this._lexer.token,t=this.parseDescription(),r=this.parseName(),n=this.parseArgumentDefs();this.expectToken(T.COLON);var i=this.parseTypeReference(),a=this.parseDirectives(!0);return{kind:C.FIELD_DEFINITION,description:t,name:r,arguments:n,type:i,directives:a,loc:this.loc(e)}},t.parseArgumentDefs=function(){return this.optionalMany(T.PAREN_L,this.parseInputValueDef,T.PAREN_R)},t.parseInputValueDef=function(){var e=this._lexer.token,t=this.parseDescription(),r=this.parseName();this.expectToken(T.COLON);var n,i=this.parseTypeReference();this.expectOptionalToken(T.EQUALS)&&(n=this.parseValueLiteral(!0));var a=this.parseDirectives(!0);return{kind:C.INPUT_VALUE_DEFINITION,description:t,name:r,type:i,defaultValue:n,directives:a,loc:this.loc(e)}},t.parseInterfaceTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("interface");var r=this.parseName(),n=this.parseImplementsInterfaces(),i=this.parseDirectives(!0),a=this.parseFieldsDefinition();return{kind:C.INTERFACE_TYPE_DEFINITION,description:t,name:r,interfaces:n,directives:i,fields:a,loc:this.loc(e)}},t.parseUnionTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("union");var r=this.parseName(),n=this.parseDirectives(!0),i=this.parseUnionMemberTypes();return{kind:C.UNION_TYPE_DEFINITION,description:t,name:r,directives:n,types:i,loc:this.loc(e)}},t.parseUnionMemberTypes=function(){return this.expectOptionalToken(T.EQUALS)?this.delimitedMany(T.PIPE,this.parseNamedType):[]},t.parseEnumTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("enum");var r=this.parseName(),n=this.parseDirectives(!0),i=this.parseEnumValuesDefinition();return{kind:C.ENUM_TYPE_DEFINITION,description:t,name:r,directives:n,values:i,loc:this.loc(e)}},t.parseEnumValuesDefinition=function(){return this.optionalMany(T.BRACE_L,this.parseEnumValueDefinition,T.BRACE_R)},t.parseEnumValueDefinition=function(){var e=this._lexer.token,t=this.parseDescription(),r=this.parseName(),n=this.parseDirectives(!0);return{kind:C.ENUM_VALUE_DEFINITION,description:t,name:r,directives:n,loc:this.loc(e)}},t.parseInputObjectTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("input");var r=this.parseName(),n=this.parseDirectives(!0),i=this.parseInputFieldsDefinition();return{kind:C.INPUT_OBJECT_TYPE_DEFINITION,description:t,name:r,directives:n,fields:i,loc:this.loc(e)}},t.parseInputFieldsDefinition=function(){return this.optionalMany(T.BRACE_L,this.parseInputValueDef,T.BRACE_R)},t.parseTypeSystemExtension=function(){var e=this._lexer.lookahead();if(e.kind===T.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)},t.parseSchemaExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");var t=this.parseDirectives(!0),r=this.optionalMany(T.BRACE_L,this.parseOperationTypeDefinition,T.BRACE_R);if(0===t.length&&0===r.length)throw this.unexpected();return{kind:C.SCHEMA_EXTENSION,directives:t,operationTypes:r,loc:this.loc(e)}},t.parseScalarTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");var t=this.parseName(),r=this.parseDirectives(!0);if(0===r.length)throw this.unexpected();return{kind:C.SCALAR_TYPE_EXTENSION,name:t,directives:r,loc:this.loc(e)}},t.parseObjectTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");var t=this.parseName(),r=this.parseImplementsInterfaces(),n=this.parseDirectives(!0),i=this.parseFieldsDefinition();if(0===r.length&&0===n.length&&0===i.length)throw this.unexpected();return{kind:C.OBJECT_TYPE_EXTENSION,name:t,interfaces:r,directives:n,fields:i,loc:this.loc(e)}},t.parseInterfaceTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");var t=this.parseName(),r=this.parseImplementsInterfaces(),n=this.parseDirectives(!0),i=this.parseFieldsDefinition();if(0===r.length&&0===n.length&&0===i.length)throw this.unexpected();return{kind:C.INTERFACE_TYPE_EXTENSION,name:t,interfaces:r,directives:n,fields:i,loc:this.loc(e)}},t.parseUnionTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");var t=this.parseName(),r=this.parseDirectives(!0),n=this.parseUnionMemberTypes();if(0===r.length&&0===n.length)throw this.unexpected();return{kind:C.UNION_TYPE_EXTENSION,name:t,directives:r,types:n,loc:this.loc(e)}},t.parseEnumTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");var t=this.parseName(),r=this.parseDirectives(!0),n=this.parseEnumValuesDefinition();if(0===r.length&&0===n.length)throw this.unexpected();return{kind:C.ENUM_TYPE_EXTENSION,name:t,directives:r,values:n,loc:this.loc(e)}},t.parseInputObjectTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");var t=this.parseName(),r=this.parseDirectives(!0),n=this.parseInputFieldsDefinition();if(0===r.length&&0===n.length)throw this.unexpected();return{kind:C.INPUT_OBJECT_TYPE_EXTENSION,name:t,directives:r,fields:n,loc:this.loc(e)}},t.parseDirectiveDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("directive"),this.expectToken(T.AT);var r=this.parseName(),n=this.parseArgumentDefs(),i=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");var a=this.parseDirectiveLocations();return{kind:C.DIRECTIVE_DEFINITION,description:t,name:r,arguments:n,repeatable:i,locations:a,loc:this.loc(e)}},t.parseDirectiveLocations=function(){return this.delimitedMany(T.PIPE,this.parseDirectiveLocation)},t.parseDirectiveLocation=function(){var e=this._lexer.token,t=this.parseName();if(void 0!==N[t.value])return t;throw this.unexpected(e)},t.loc=function(e){var t;if(!0!==(null===(t=this._options)||void 0===t?void 0:t.noLocation))return new w.Ye(e,this._lexer.lastToken,this._lexer.source)},t.peek=function(e){return this._lexer.token.kind===e},t.expectToken=function(e){var t=this._lexer.token;if(t.kind===e)return this._lexer.advance(),t;throw S(this._lexer.source,t.start,"Expected ".concat(H(e),", found ").concat(z(t),"."))},t.expectOptionalToken=function(e){var t=this._lexer.token;if(t.kind===e)return this._lexer.advance(),t},t.expectKeyword=function(e){var t=this._lexer.token;if(t.kind!==T.NAME||t.value!==e)throw S(this._lexer.source,t.start,'Expected "'.concat(e,'", found ').concat(z(t),"."));this._lexer.advance()},t.expectOptionalKeyword=function(e){var t=this._lexer.token;return t.kind===T.NAME&&t.value===e&&(this._lexer.advance(),!0)},t.unexpected=function(e){var t=null!=e?e:this._lexer.token;return S(this._lexer.source,t.start,"Unexpected ".concat(z(t),"."))},t.any=function(e,t,r){this.expectToken(e);for(var n=[];!this.expectOptionalToken(r);)n.push(t.call(this));return n},t.optionalMany=function(e,t,r){if(this.expectOptionalToken(e)){var n=[];do{n.push(t.call(this))}while(!this.expectOptionalToken(r));return n}return[]},t.many=function(e,t,r){this.expectToken(e);var n=[];do{n.push(t.call(this))}while(!this.expectOptionalToken(r));return n},t.delimitedMany=function(e,t){this.expectOptionalToken(e);var r=[];do{r.push(t.call(this))}while(this.expectOptionalToken(e));return r},e}();function z(e){var t=e.value;return H(e.kind)+(null!=t?' "'.concat(t,'"'):"")}function H(e){return function(e){return e===T.BANG||e===T.DOLLAR||e===T.AMP||e===T.PAREN_L||e===T.PAREN_R||e===T.SPREAD||e===T.COLON||e===T.EQUALS||e===T.AT||e===T.BRACKET_L||e===T.BRACKET_R||e===T.BRACE_L||e===T.PIPE||e===T.BRACE_R}(e)?'"'.concat(e,'"'):e}var G=new Map,Q=new Map,W=!0,Y=!1;function Z(e){return e.replace(/[\s,]+/g," ").trim()}function J(e){var t=new Set,r=[];return e.definitions.forEach((function(e){if("FragmentDefinition"===e.kind){var n=e.name.value,i=Z((o=e.loc).source.body.substring(o.start,o.end)),a=Q.get(n);a&&!a.has(i)?W&&console.warn("Warning: fragment with name "+n+" 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"):a||Q.set(n,a=new Set),a.add(i),t.has(i)||(t.add(i),r.push(e))}else r.push(e);var o})),(0,n.pi)((0,n.pi)({},e),{definitions:r})}function X(e){var t=Z(e);if(!G.has(t)){var r=function(e,t){return new q(e,t).parseDocument()}(e,{experimentalFragmentVariables:Y});if(!r||"Document"!==r.kind)throw new Error("Not a valid GraphQL document.");G.set(t,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}(J(r)))}return G.get(t)}function $(e){for(var t=[],r=1;r-1}))}function s(e){return e&&o(["client"],e)&&o(["export"],e)}var u=r(655);function c(e,t){var r=t,n=[];return e.definitions.forEach((function(e){if("OperationDefinition"===e.kind)throw new i.ej(42);"FragmentDefinition"===e.kind&&n.push(e)})),void 0===r&&((0,i.kG)(1===n.length,43),r=n[0].name.value),(0,u.pi)((0,u.pi)({},e),{definitions:(0,u.pr)([{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:r}}]}}],e.definitions)})}function l(e){void 0===e&&(e=[]);var t={};return e.forEach((function(e){t[e.name.value]=e})),t}function f(e,t){switch(e.kind){case"InlineFragment":return e;case"FragmentSpread":var r=t&&t[e.name.value];return(0,i.kG)(r,44),r;default:return null}}var h=r(5035),p=r.n(h);function d(e){return{__ref:String(e)}}function y(e){return Boolean(e&&"object"==typeof e&&"string"==typeof e.__ref)}function v(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 a={};r.fields.map((function(e){return v(a,e.name,e.value,n)})),e[t.value]=a}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 v(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 new i.ej(53);e[t.value]=null}}function g(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,a=n.value;return v(r[e.name.value],i,a,t)}))})));var n=null;return e.arguments&&e.arguments.length&&(n={},e.arguments.forEach((function(e){var r=e.name,i=e.value;return v(n,r,i,t)}))),b(e.name.value,n,r)}var m=["connection","include","skip","client","rest","export"];function b(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]})),r.connection.key+"("+JSON.stringify(i)+")"}return r.connection.key}var a=e;if(t){var o=p()(t);a+="("+o+")"}return r&&Object.keys(r).forEach((function(e){-1===m.indexOf(e)&&(r[e]&&Object.keys(r[e]).length?a+="@"+e+"("+JSON.stringify(r[e])+")":a+="@"+e)})),a}function E(e,t){if(e.arguments&&e.arguments.length){var r={};return e.arguments.forEach((function(e){var n=e.name,i=e.value;return v(r,n,i,t)})),r}return null}function S(e){return e.alias?e.alias.value:e.name.value}function C(e,t,r){if("string"==typeof e.__typename)return e.__typename;for(var n=0,i=t.selections;n1)for(var n=new Y,i=1;i0}function ue(e){return e.errors&&e.errors.length>0||!1}ie(oe);var ce="function"==typeof WeakMap&&!("object"==typeof navigator&&"ReactNative"===navigator.product);function le(){for(var e=[],t=0;t=0&&r.indexOf(n,s)===s))}return!1}function l(e){return Object.keys(e).filter(f,e)}function f(e){return void 0!==this[e]}var h="{ [native code] }";function p(e,t){var r=s.get(e);if(r){if(r.has(t))return!0}else s.set(e,r=new Set);return r.add(t),!1}},9742:function(e,t){"use strict";t.byteLength=function(e){var t=u(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,a=u(e),o=a[0],s=a[1],c=new i(function(e,t,r){return 3*(t+r)/4-r}(0,o,s)),l=0,f=s>0?o-4:o;for(r=0;r>16&255,c[l++]=t>>8&255,c[l++]=255&t;2===s&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,c[l++]=255&t);1===s&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,c[l++]=t>>8&255,c[l++]=255&t);return c},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,a=[],o=16383,s=0,u=n-i;su?u:s+o));1===i?(t=e[n-1],a.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],a.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return a.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,s=a.length;o0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function c(e,t,n){for(var i,a,o=[],s=t;s>18&63]+r[a>>12&63]+r[a>>6&63]+r[63&a]);return o.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},2240:function(e,t,r){"use strict";var n=r(1518);function i(e,t){return void 0===t&&(t="utf8"),Buffer.isBuffer(e)?o(e.toString("base64")):o(Buffer.from(e,t).toString("base64"))}function a(e){return e=e.toString(),n.default(e).replace(/\-/g,"+").replace(/_/g,"/")}function o(e){return e.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}var s=i;s.encode=i,s.decode=function(e,t){return void 0===t&&(t="utf8"),Buffer.from(a(e),"base64").toString(t)},s.toBase64=a,s.fromBase64=o,s.toBuffer=function(e){return Buffer.from(a(e),"base64")},t.default=s},1518:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.length,r=t%4;if(!r)return e;var n=t,i=4-r,a=t+i,o=Buffer.alloc(a);for(o.write(e);i--;)o.write("=",n++);return o.toString()}},5772:function(e,t,r){e.exports=r(2240).default,e.exports.default=e.exports},8764:function(e,t,r){"use strict";var n=r(9742),i=r(645),a="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null; /*! * The buffer module from node.js, for the browser. * diff --git a/decidim-bulletin_board-ruby/lib/decidim/bulletin_board/version.rb b/decidim-bulletin_board-ruby/lib/decidim/bulletin_board/version.rb index d70086ba..b1c71aac 100644 --- a/decidim-bulletin_board-ruby/lib/decidim/bulletin_board/version.rb +++ b/decidim-bulletin_board-ruby/lib/decidim/bulletin_board/version.rb @@ -2,6 +2,6 @@ module Decidim module BulletinBoard - VERSION = "0.12.0" + VERSION = "0.12.1" end end