decap-cms-backend-github 3.6.0 → 3.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,7 +3,7 @@
3
3
  Decap CMS is adding labels to ${t.length} of your Editorial Workflow
4
4
  entries. The "Workflow" tab will be unavailable during this migration. You may use other
5
5
  areas of the CMS during this time. Note that closing the CMS will pause the migration.
6
- `)),r+=1,await this.migratePullRequest(e,`${r} of ${t.length}`);e=(await this.getPullRequests(void 0,et.Open,e=>tt(e,this.cmsLabelPrefix))).map(e=>e.head.ref)}return e}async getStatuses(e,t){const r=this.generateContentKey(e,t),n=(0,O.branchFromContentKey)(r),i=(await this.getBranchPullRequest(n)).head.sha;return(await this.request(`${this.originRepoURL}/commits/${i}/status`)).statuses.map(e=>({context:e.context,target_url:e.target_url||"",state:e.state===Ze.Success?O.PreviewState.Success:O.PreviewState.Other}))}async persistFiles(e,t,r){const n=t.concat(e),i=n.map(e=>this.uploadBlob(e));if(await Promise.all(i),r.useWorkflow){const i=t.map(({sha:e,path:t})=>({path:s()(t,"/"),sha:e})),o=e[0].slug;return this.editorialWorkflowGit(n,o,i,r)}return this.getDefaultBranch().then(e=>this.updateTree(e.commit.sha,n)).then(e=>this.commit(r.commitMessage,e)).then(e=>this.patchBranch(this.branch,e.sha))}async getFileSha(e,{repoURL:t=this.repoURL,branch:r=this.branch}={}){const n=e.split("/"),i=Qe()(n),o=je()(n).join("/"),a=`${t}/git/trees/${r}:${encodeURIComponent(o)}`,s=(await this.request(a)).tree.find(e=>e.path===i);if(s)return s.sha;throw new O.APIError("Not Found",404,Ye)}async deleteFiles(e,t){if(this.useOpenAuthoring)return Promise.reject("Cannot delete published entries as an Open Authoring user!");const r=await this.getDefaultBranch(),n=e.map(e=>({path:e,sha:null})),i=await this.updateTree(r.commit.sha,n),o=await this.commit(t,i);await this.patchBranch(this.branch,o.sha)}async createBranchAndPullRequest(e,t,r){return await this.createBranch(e,t),this.createPR(r,e)}async updatePullRequestLabels(e,t){await this.request(`${this.repoURL}/issues/${e}/labels`,{method:"PUT",body:JSON.stringify({labels:t})})}async diffFromFile(e){return{path:e.filename,newFile:"added"===e.status,sha:e.sha||"",binary:"renamed"!==e.status&&!e.patch||e.filename.endsWith(".svg")}}async editorialWorkflowGit(e,t,r,n){const i=this.generateContentKey(n.collectionName,t),o=(0,O.branchFromContentKey)(i);if(n.unpublished){const{files:t}=await this.getDifferences(this.branch,await this.getHeadReference(o)),i=await Promise.all((t||[]).map(e=>this.diffFromFile(e))),a=[];for(const e of i.filter(e=>e.binary))r.some(t=>t.path===e.path)||a.push({path:e.path,sha:null});const s=await this.rebaseBranch(o),u=a.concat(e),c=await this.updateTree(s.sha,u,o),l=await this.commit(n.commitMessage,c);return this.patchBranch(o,l.sha,{force:!0})}{const t=await this.getDefaultBranch(),r=await this.updateTree(t.commit.sha,e),i=await this.commit(n.commitMessage,r);if(this.useOpenAuthoring)await this.createBranch(o,i.sha);else{const e=await this.createBranchAndPullRequest(o,i.sha,n.commitMessage);await this.setPullRequestStatus(e,n.status||this.initialWorkflowStatus)}}}async getDifferences(e,t){const r=this.useOpenAuthoring?10:1;for(let n=1;n<=r;n++)try{return await this.request(`${this.originRepoURL}/compare/${e}...${t}`)}catch(e){if(n===r)throw console.warn(`Reached maximum number of attempts '${r}' for getDifferences`),e;await new Promise(e=>setTimeout(e,500*n))}throw new O.APIError("Not Found",404,Ye)}async rebaseSingleCommit(e,t){const r=rt((await this.getDifferences(t.parents[0].sha,t.sha)).files);if(r.length>0){const n=await this.updateTree(e.sha,r),{message:i,author:o,committer:a}=t.commit;return await this.createCommit(i,n.sha,[e.sha],o?{name:o.name||"",email:o.email||"",date:o.date}:void 0,a?{name:a.name||"",email:a.email||"",date:a.date}:void 0)}return t}async rebaseCommits(e,t){return 0===t.length||t[0].parents[0].sha===e.sha?Qe()(t):t.reduce((e,t)=>e.then(e=>{const r=e,n=t;return this.rebaseSingleCommit(r,n)}),Promise.resolve(e))}async rebaseBranch(e){try{const{base_commit:t,commits:r}=await this.getDifferences(this.branch,await this.getHeadReference(e));return await this.rebaseCommits(t,r)}catch(e){throw console.error(e),e}}async setPullRequestStatus(e,t){const r=[...e.labels.filter(e=>!(0,O.isCMSLabel)(e.name,this.cmsLabelPrefix)).map(e=>e.name),(0,O.statusToLabel)(t,this.cmsLabelPrefix)];await this.updatePullRequestLabels(e.number,r)}async updateUnpublishedEntryStatus(e,t,r){const n=this.generateContentKey(e,t),i=(0,O.branchFromContentKey)(n),o=await this.getBranchPullRequest(i);if(this.useOpenAuthoring){if("pending_publish"===status)throw new Error('Open Authoring entries may not be set to the status "pending_publish".');if(o.number!==Xe){const{state:e}=o;e===et.Open&&"draft"===r&&await this.closePR(o.number),e===et.Closed&&"pending_review"===r&&await this.openPR(o.number)}else if("pending_review"===r){const e=(0,O.branchFromContentKey)(n),t=await this.getDifferences(this.branch,await this.getHeadReference(e)),r=t.commits[0]?.commit?.message||it.DEFAULT_COMMIT_MESSAGE;await this.createPR(r,e)}}else await this.setPullRequestStatus(o,r)}async deleteUnpublishedEntry(e,t){const r=this.generateContentKey(e,t),n=(0,O.branchFromContentKey)(r),i=await this.getBranchPullRequest(n);i.number!==Xe&&await this.closePR(i.number),await this.deleteBranch(n)}async publishUnpublishedEntry(e,t){const r=this.generateContentKey(e,t),n=(0,O.branchFromContentKey)(r),i=await this.getBranchPullRequest(n);await this.mergePR(i),await this.deleteBranch(n)}async createRef(e,t,r){return await this.request(`${this.repoURL}/git/refs`,{method:"POST",body:JSON.stringify({ref:`refs/${e}/${t}`,sha:r})})}async patchRef(e,t,r,n={}){const i=n.force||!1;return await this.request(`${this.repoURL}/git/refs/${e}/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify({sha:r,force:i})})}deleteRef(e,t){return this.request(`${this.repoURL}/git/refs/${e}/${encodeURIComponent(t)}`,{method:"DELETE"})}async getBranch(e){return await this.request(`${this.repoURL}/branches/${encodeURIComponent(e)}`)}async getDefaultBranch(){return await this.request(`${this.originRepoURL}/branches/${encodeURIComponent(this.branch)}`)}async backupBranch(e){try{const t=await this.getBranch(e);await this.createBranch(t.name.replace(new RegExp(`${O.CMS_BRANCH_PREFIX}/`),`${O.CMS_BRANCH_PREFIX}_${Date.now()}/`),t.commit.sha)}catch(e){console.warn(e)}}async createBranch(e,t){try{return await this.createRef("heads",e,t)}catch(r){const n=String(r.message||"");if("Reference update failed"===n)await(0,O.throwOnConflictingBranches)(e,e=>this.getBranch(e),Ye);else if("Reference already exists"===n&&e.startsWith(`${O.CMS_BRANCH_PREFIX}/`))try{return await this.backupBranch(e),await this.patchBranch(e,t,{force:!0})}catch(e){console.log(e)}throw r}}assertCmsBranch(e){return e.startsWith(`${O.CMS_BRANCH_PREFIX}/`)}patchBranch(e,t,r={}){const n=r.force||!1;if(n&&!this.assertCmsBranch(e))throw Error(`Only CMS branches can be force updated, cannot force update ${e}`);return this.patchRef("heads",e,t,{force:n})}deleteBranch(e){return this.deleteRef("heads",e).catch(e=>"Reference does not exist"===e.message?Promise.resolve():(console.error(e),Promise.reject(e)))}async getHeadReference(e){return`${this.repoOwner}:${e}`}async createPR(e,t){return await this.request(`${this.originRepoURL}/pulls`,{method:"POST",body:JSON.stringify({title:e,body:O.DEFAULT_PR_BODY,head:await this.getHeadReference(t),base:this.branch})})}async openPR(e){return console.log("%c Re-opening PR","line-height: 30px;text-align: center;font-weight: bold"),await this.request(`${this.originRepoURL}/pulls/${e}`,{method:"PATCH",body:JSON.stringify({state:et.Open})})}async closePR(e){return console.log("%c Deleting PR","line-height: 30px;text-align: center;font-weight: bold"),await this.request(`${this.originRepoURL}/pulls/${e}`,{method:"PATCH",body:JSON.stringify({state:et.Closed})})}async mergePR(e){console.log("%c Merging PR","line-height: 30px;text-align: center;font-weight: bold");try{return await this.request(`${this.originRepoURL}/pulls/${e.number}/merge`,{method:"PUT",body:JSON.stringify({commit_message:O.MERGE_COMMIT_MESSAGE,sha:e.head.sha,merge_method:this.mergeMethod})})}catch(t){if(t instanceof O.APIError&&405===t.status)return this.forceMergePR(e);throw t}}async forceMergePR(e){const t=rt((await this.getDifferences(e.base.sha,e.head.sha)).files);let r="Automatically generated. Merged on Decap CMS\n\nForce merge of:";return t.forEach(e=>{r+=`\n* "${e.path}"`}),console.log("%c Automatic merge not possible - Forcing merge.","line-height: 30px;text-align: center;font-weight: bold"),this.getDefaultBranch().then(e=>this.updateTree(e.commit.sha,t)).then(e=>this.commit(r,e)).then(e=>this.patchBranch(this.branch,e.sha))}toBase64(e){return Promise.resolve(Me.encode(e))}async uploadBlob(e){const t=await Ge()(e,"toBase64",ze()(this.toBase64,e.raw)),r=await this.request(`${this.repoURL}/git/blobs`,{method:"POST",body:JSON.stringify({content:t,encoding:"base64"})});return e.sha=r.sha,e}async updateTree(e,t,r=this.branch){const n=[],i=t.reduce((e,t)=>{const r={path:s()(t.path,"/"),mode:"100644",type:"blob",sha:t.sha};return t.newPath?n.push({from:t.path,to:t.newPath,sha:t.sha}):e.push(r),e},[]);for(const{from:e,to:t,sha:o}of n){const n=(0,Je.dirname)(e),a=(0,Je.dirname)(t),s=await this.listFiles(n,{branch:r,depth:100});for(const t of s)i.push({path:t.path,mode:"100644",type:"blob",sha:null}),i.push({path:t.path.replace(n,a),mode:"100644",type:"blob",sha:t.path===e?o:t.id})}return{...await this.createTree(e,i),parentSha:e}}async createTree(e,t){return await this.request(`${this.repoURL}/git/trees`,{method:"POST",body:JSON.stringify({base_tree:e,tree:t})})}commit(e,t){const r=t.parentSha?[t.parentSha]:[];return this.createCommit(e,t.sha,r)}async createCommit(e,t,r,n,i){return await this.request(`${this.repoURL}/git/commits`,{method:"POST",body:JSON.stringify({message:e,tree:t,parents:r,author:n,committer:i})})}async getUnpublishedEntrySha(e,t){const r=this.generateContentKey(e,t),n=(0,O.branchFromContentKey)(r);return(await this.getBranchPullRequest(n)).head.sha}}var ot=function(e,t){return ot=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},ot(e,t)};function at(e,t){function r(){this.constructor=e}ot(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var st=function(){return st=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},st.apply(this,arguments)};function ut(e,t,r,n){return new(r||(r=Promise))(function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(a,s)}u((n=n.apply(e,t||[])).next())})}function ct(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}var lt=u(8048),ht=function(e,t){return ht=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},ht(e,t)},ft="Invariant Violation",pt=Object.setPrototypeOf,dt=void 0===pt?function(e,t){return e.__proto__=t,e}:pt,mt=function(e){function t(r){void 0===r&&(r=ft);var n=e.call(this,"number"==typeof r?ft+": "+r+" (see https://github.com/apollographql/invariant-packages)":r)||this;return n.framesToPop=1,n.name=ft,dt(n,t.prototype),n}return function(e,t){function r(){this.constructor=e}ht(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}(t,e),t}(Error);function yt(e,t){if(!e)throw new mt(t)}function vt(e){return function(){return console[e].apply(console,arguments)}}!function(e){e.warn=vt("warn"),e.error=vt("error")}(yt||(yt={}));var gt={env:{}};if("object"==typeof process)gt=process;else try{Function("stub","process = stub")(gt)}catch(e){}var bt=function(){return bt=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},bt.apply(this,arguments)};function wt(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var n=Array(e),i=0;for(t=0;t<r;t++)for(var o=arguments[t],a=0,s=o.length;a<s;a++,i++)n[i]=o[a];return n}var Rt=u(6075),Et=u.n(Rt),kt=Object.prototype,Ot=kt.toString,xt=kt.hasOwnProperty,St=new Map;function _t(e,t){try{return It(e,t)}finally{St.clear()}}function It(e,t){if(e===t)return!0;var r=Ot.call(e);if(r!==Ot.call(t))return!1;switch(r){case"[object Array]":if(e.length!==t.length)return!1;case"[object Object]":if(Tt(e,t))return!0;var n=Object.keys(e),i=Object.keys(t),o=n.length;if(o!==i.length)return!1;for(var a=0;a<o;++a)if(!xt.call(t,n[a]))return!1;for(a=0;a<o;++a){var s=n[a];if(!It(e[s],t[s]))return!1}return!0;case"[object Error]":return e.name===t.name&&e.message===t.message;case"[object Number]":if(e!=e)return t!=t;case"[object Boolean]":case"[object Date]":return+e===+t;case"[object RegExp]":case"[object String]":return e==""+t;case"[object Map]":case"[object Set]":if(e.size!==t.size)return!1;if(Tt(e,t))return!0;for(var u=e.entries(),c="[object Map]"===r;;){var l=u.next();if(l.done)break;var h=l.value,f=h[0],p=h[1];if(!t.has(f))return!1;if(c&&!It(p,t.get(f)))return!1}return!0}return!1}function Tt(e,t){var r=St.get(e);if(r){if(r.has(t))return!0}else St.set(e,r=new Set);return r.add(t),!1}function At(e,t,r,n){if(function(e){return"IntValue"===e.kind}(r)||function(e){return"FloatValue"===e.kind}(r))e[t.value]=Number(r.value);else if(function(e){return"BooleanValue"===e.kind}(r)||function(e){return"StringValue"===e.kind}(r))e[t.value]=r.value;else if(function(e){return"ObjectValue"===e.kind}(r)){var i={};r.fields.map(function(e){return At(i,e.name,e.value,n)}),e[t.value]=i}else if(function(e){return"Variable"===e.kind}(r)){var o=(n||{})[r.name.value];e[t.value]=o}else if(function(e){return"ListValue"===e.kind}(r))e[t.value]=r.values.map(function(e){var r={};return At(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 mt(17);e[t.value]=null}}var Pt=["connection","include","skip","client","rest","export"];function Ct(e,t,r){if(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=t,o={};return n.forEach(function(e){o[e]=i[e]}),r.connection.key+"("+JSON.stringify(o)+")"}return r.connection.key}var a=e;if(t){var s=Et()(t);a+="("+s+")"}return r&&Object.keys(r).forEach(function(e){-1===Pt.indexOf(e)&&(r[e]&&Object.keys(r[e]).length?a+="@"+e+"("+JSON.stringify(r[e])+")":a+="@"+e)}),a}function Nt(e,t){if(e.arguments&&e.arguments.length){var r={};return e.arguments.forEach(function(e){var n=e.name,i=e.value;return At(r,n,i,t)}),r}return null}function qt(e){return e.alias?e.alias.value:e.name.value}function Ft(e){return"Field"===e.kind}function Dt(e){return"InlineFragment"===e.kind}function Bt(e){return e&&"id"===e.type&&"boolean"==typeof e.generated}function Lt(e,t){return void 0===t&&(t=!1),bt({type:"id",generated:t},"string"==typeof e?{id:e,typename:void 0}:e)}function Mt(e,t){if(e.directives&&e.directives.length){var r={};return e.directives.forEach(function(e){r[e.name.value]=Nt(e,t)}),r}return null}function Ut(e,t){return void 0===t&&(t={}),(r=e.directives,r?r.filter(Qt).map(function(e){var t=e.arguments;e.name.value,yt(t&&1===t.length,14);var r=t[0];yt(r.name&&"if"===r.name.value,15);var n=r.value;return yt(n&&("Variable"===n.kind||"BooleanValue"===n.kind),16),{directive:e,ifArgument:r}}):[]).every(function(e){var r=e.directive,n=e.ifArgument,i=!1;return"Variable"===n.value.kind?yt(void 0!==(i=t[n.value.name.value]),13):i=n.value.value,"skip"===r.name.value?!i:i});var r}function jt(e,t){return function(e){var t=[];return(0,lt.visit)(e,{Directive:function(e){t.push(e.name.value)}}),t}(t).some(function(t){return e.indexOf(t)>-1})}function $t(e){return e&&jt(["client"],e)&&jt(["export"],e)}function Qt(e){var t=e.name.value;return"skip"===t||"include"===t}function Vt(e,t){var r=t,n=[];return e.definitions.forEach(function(e){if("OperationDefinition"===e.kind)throw new mt(11);"FragmentDefinition"===e.kind&&n.push(e)}),void 0===r&&(yt(1===n.length,12),r=n[0].name.value),bt(bt({},e),{definitions:wt([{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:r}}]}}],e.definitions)})}function zt(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return t.forEach(function(t){null!=t&&Object.keys(t).forEach(function(r){e[r]=t[r]})}),e}function Kt(e){return yt(e&&"Document"===e.kind,2),yt(e.definitions.filter(function(e){return"FragmentDefinition"!==e.kind}).map(function(e){if("OperationDefinition"!==e.kind)throw new mt(3);return e}).length<=1,4),e}function Gt(e){return Kt(e),e.definitions.filter(function(e){return"OperationDefinition"===e.kind})[0]}function Wt(e){return e.definitions.filter(function(e){return"OperationDefinition"===e.kind&&e.name}).map(function(e){return e.name.value})[0]||null}function Ht(e){return e.definitions.filter(function(e){return"FragmentDefinition"===e.kind})}function Jt(e){var t;Kt(e);for(var r=0,n=e.definitions;r<n.length;r++){var i=n[r];if("OperationDefinition"===i.kind){var o=i.operation;if("query"===o||"mutation"===o||"subscription"===o)return i}"FragmentDefinition"!==i.kind||t||(t=i)}if(t)return t;throw new mt(10)}function Yt(e){void 0===e&&(e=[]);var t={};return e.forEach(function(e){t[e.name.value]=e}),t}function Xt(e){if(e&&e.variableDefinitions&&e.variableDefinitions.length){var t=e.variableDefinitions.filter(function(e){return e.defaultValue}).map(function(e){var t=e.variable,r=e.defaultValue,n={};return At(n,t.name,r),n});return zt.apply(void 0,wt([{}],t))}return{}}function Zt(e,t,r){var n=0;return e.forEach(function(r,i){t.call(this,r,i,e)&&(e[n++]=r)},r),e.length=n,e}var er={kind:"Field",name:{kind:"Name",value:"__typename"}};function tr(e,t){return e.selectionSet.selections.every(function(e){return"FragmentSpread"===e.kind&&tr(t[e.name.value],t)})}function rr(e){return tr(Gt(e)||function(e){yt("Document"===e.kind,7),yt(e.definitions.length<=1,8);var t=e.definitions[0];return yt("FragmentDefinition"===t.kind,9),t}(e),Yt(Ht(e)))?null:e}function nr(e){return function(t){return e.some(function(e){return e.name&&e.name===t.name.value||e.test&&e.test(t)})}}function ir(e,t){var r=Object.create(null),n=[],i=Object.create(null),o=[],a=rr((0,lt.visit)(t,{Variable:{enter:function(e,t,n){"VariableDefinition"!==n.kind&&(r[e.name.value]=!0)}},Field:{enter:function(t){if(e&&t.directives&&e.some(function(e){return e.remove})&&t.directives&&t.directives.some(nr(e)))return t.arguments&&t.arguments.forEach(function(e){"Variable"===e.value.kind&&n.push({name:e.value.name.value})}),t.selectionSet&&ar(t.selectionSet).forEach(function(e){o.push({name:e.name.value})}),null}},FragmentSpread:{enter:function(e){i[e.name.value]=!0}},Directive:{enter:function(t){if(nr(e)(t))return null}}}));return a&&Zt(n,function(e){return!r[e.name]}).length&&(a=function(e,t){var r=function(e){return function(t){return e.some(function(e){return t.value&&"Variable"===t.value.kind&&t.value.name&&(e.name===t.value.name.value||e.test&&e.test(t))})}}(e);return rr((0,lt.visit)(t,{OperationDefinition:{enter:function(t){return bt(bt({},t),{variableDefinitions:t.variableDefinitions.filter(function(t){return!e.some(function(e){return e.name===t.variable.name.value})})})}},Field:{enter:function(t){if(e.some(function(e){return e.remove})){var n=0;if(t.arguments.forEach(function(e){r(e)&&(n+=1)}),1===n)return null}}},Argument:{enter:function(e){if(r(e))return null}}}))}(n,a)),a&&Zt(o,function(e){return!i[e.name]}).length&&(a=function(e,t){function r(t){if(e.some(function(e){return e.name===t.name.value}))return null}return rr((0,lt.visit)(t,{FragmentSpread:{enter:r},FragmentDefinition:{enter:r}}))}(o,a)),a}var or={test:function(e){var t="connection"===e.name.value;return t&&(!e.arguments||e.arguments.some(function(e){return"key"===e.name.value})),t}};function ar(e){var t=[];return e.selections.forEach(function(e){(Ft(e)||Dt(e))&&e.selectionSet?ar(e.selectionSet).forEach(function(e){return t.push(e)}):"FragmentSpread"===e.kind&&t.push(e)}),t}function sr(e){return"query"===Jt(e).operation?e:(0,lt.visit)(e,{OperationDefinition:{enter:function(e){return bt(bt({},e),{operation:"query"})}}})}var ur="function"==typeof WeakMap&&!("object"==typeof navigator&&"ReactNative"===navigator.product),cr=Object.prototype.toString;function lr(e){return hr(e,new Map)}function hr(e,t){switch(cr.call(e)){case"[object Array]":if(t.has(e))return t.get(e);var r=e.slice(0);return t.set(e,r),r.forEach(function(e,n){r[n]=hr(e,t)}),r;case"[object Object]":if(t.has(e))return t.get(e);var n=Object.create(Object.getPrototypeOf(e));return t.set(e,n),Object.keys(e).forEach(function(r){n[r]=hr(e[r],t)}),n;default:return e}}function fr(e){return("undefined"!=typeof process?"production":"development")===e}function pr(e){try{return e()}catch(e){console.error&&console.error(e)}}function dr(e){return e.errors&&e.errors.length}var mr=Object.prototype.hasOwnProperty;function yr(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return vr(e)}function vr(e){var t=e[0]||{},r=e.length;if(r>1){var n=[];t=wr(t,n);for(var i=1;i<r;++i)t=br(t,e[i],n)}return t}function gr(e){return null!==e&&"object"==typeof e}function br(e,t,r){return gr(t)&&gr(e)?(Object.isExtensible&&!Object.isExtensible(e)&&(e=wr(e,r)),Object.keys(t).forEach(function(n){var i=t[n];if(mr.call(e,n)){var o=e[n];i!==o&&(e[n]=br(wr(o,r),i,r))}else e[n]=i}),e):t}function wr(e,t){return null!==e&&"object"==typeof e&&t.indexOf(e)<0&&(e=Array.isArray(e)?e.slice(0):bt({__proto__:Object.getPrototypeOf(e)},e),t.push(e)),e}Object.create({});var Rr=u(8784);const Er=u.n(Rr)();var kr,Or=function(e,t){return Or=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},Or(e,t)},xr=function(){return xr=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},xr.apply(this,arguments)};function Sr(e){return e.request.length<=1}function _r(e){return new Er(function(t){t.error(e)})}function Ir(e,t){return t?t(e):Er.of()}function Tr(e){return"function"==typeof e?new qr(e):e}function Ar(){return new qr(function(){return Er.of()})}function Pr(e){return 0===e.length?Ar():e.map(Tr).reduce(function(e,t){return e.concat(t)})}function Cr(e,t,r){var n=Tr(t),i=Tr(r||new qr(Ir));return Sr(n)&&Sr(i)?new qr(function(t){return e(t)?n.request(t)||Er.of():i.request(t)||Er.of()}):new qr(function(t,r){return e(t)?n.request(t,r)||Er.of():i.request(t,r)||Er.of()})}(function(e,t){function r(){this.constructor=e}Or(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})(function(e,t){var r=kr.call(this,e)||this;return r.link=t,r},kr=Error);var Nr=function(e,t){var r=Tr(e);if(Sr(r))return r;var n=Tr(t);return Sr(n)?new qr(function(e){return r.request(e,function(e){return n.request(e)||Er.of()})||Er.of()}):new qr(function(e,t){return r.request(e,function(e){return n.request(e,t)||Er.of()})||Er.of()})},qr=function(){function e(e){e&&(this.request=e)}return e.prototype.split=function(t,r,n){return this.concat(Cr(t,r,n||new e(Ir)))},e.prototype.concat=function(e){return Nr(this,e)},e.prototype.request=function(e,t){throw new mt(1)},e.empty=Ar,e.from=Pr,e.split=Cr,e.execute=Fr,e}();function Fr(e,t){return e.request(function(e,t){var r=xr({},e);return Object.defineProperty(t,"setContext",{enumerable:!1,value:function(e){r=xr({},r,"function"==typeof e?e(r):e)}}),Object.defineProperty(t,"getContext",{enumerable:!1,value:function(){return xr({},r)}}),Object.defineProperty(t,"toKey",{enumerable:!1,value:function(){return function(e){var t=e.query,r=e.variables,n=e.operationName;return JSON.stringify([n,t,r])}(t)}}),t}(t.context,function(e){var t={variables:e.variables||{},extensions:e.extensions||{},operationName:e.operationName,query:e.query};return t.operationName||(t.operationName="string"!=typeof t.query?Wt(t.query):""),t}(function(e){for(var t=["query","operationName","variables","extensions","context"],r=0,n=Object.keys(e);r<n.length;r++){var i=n[r];if(t.indexOf(i)<0)throw new mt(2)}return e}(t))))||Er.of()}var Dr,Br=u(1158);function Lr(e){return e<7}!function(e){e[e.loading=1]="loading",e[e.setVariables=2]="setVariables",e[e.fetchMore=3]="fetchMore",e[e.refetch=4]="refetch",e[e.poll=6]="poll",e[e.ready=7]="ready",e[e.error=8]="error"}(Dr||(Dr={}));var Mr=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return at(t,e),t.prototype[Br.A]=function(){return this},t.prototype["@@observable"]=function(){return this},t}(Er);function Ur(e){return Array.isArray(e)&&e.length>0}var jr,$r=function(e){function t(r){var n,i,o=r.graphQLErrors,a=r.networkError,s=r.errorMessage,u=r.extraInfo,c=e.call(this,s)||this;return c.graphQLErrors=o||[],c.networkError=a||null,c.message=s||(i="",Ur((n=c).graphQLErrors)&&n.graphQLErrors.forEach(function(e){var t=e?e.message:"Error message not found.";i+="GraphQL error: "+t+"\n"}),n.networkError&&(i+="Network error: "+n.networkError.message+"\n"),i=i.replace(/\n$/,"")),c.extraInfo=u,c.__proto__=t.prototype,c}return at(t,e),t}(Error);!function(e){e[e.normal=1]="normal",e[e.refetch=2]="refetch",e[e.poll=3]="poll"}(jr||(jr={}));var Qr=function(e){function t(t){var r=t.queryManager,n=t.options,i=t.shouldSubscribe,o=void 0===i||i,a=e.call(this,function(e){return a.onSubscribe(e)})||this;a.observers=new Set,a.subscriptions=new Set,a.isTornDown=!1,a.options=n,a.variables=n.variables||{},a.queryId=r.generateQueryId(),a.shouldSubscribe=o;var s=Gt(n.query);return a.queryName=s&&s.name&&s.name.value,a.queryManager=r,a}return at(t,e),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.currentResult=function(){var e=this.getCurrentResult();return void 0===e.data&&(e.data={}),e},t.prototype.getCurrentResult=function(){if(this.isTornDown){var e=this.lastResult;return{data:!this.lastError&&e&&e.data||void 0,error:this.lastError,loading:!1,networkStatus:Dr.error}}var t,r,n,i=this.queryManager.getCurrentQueryResult(this),o=i.data,a=i.partial,s=this.queryManager.queryStore.get(this.queryId),u=this.options.fetchPolicy,c="network-only"===u||"no-cache"===u;if(s){var l=s.networkStatus;if(r=s,void 0===(n=this.options.errorPolicy)&&(n="none"),r&&(r.networkError||"none"===n&&Ur(r.graphQLErrors)))return{data:void 0,loading:!1,networkStatus:l,error:new $r({graphQLErrors:s.graphQLErrors,networkError:s.networkError})};s.variables&&(this.options.variables=st(st({},this.options.variables),s.variables),this.variables=this.options.variables),t={data:o,loading:Lr(l),networkStatus:l},s.graphQLErrors&&"all"===this.options.errorPolicy&&(t.errors=s.graphQLErrors)}else{var h=c||a&&"cache-only"!==u;t={data:o,loading:h,networkStatus:h?Dr.loading:Dr.ready}}return a||this.updateLastResult(st(st({},t),{stale:!1})),st(st({},t),{partial:a})},t.prototype.isDifferentFromLastResult=function(e){var t=this.lastResultSnapshot;return!(t&&e&&t.networkStatus===e.networkStatus&&t.stale===e.stale&&_t(t.data,e.data))},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(){var e=this.queryManager.queryStore.get(this.queryId);e&&(e.networkError=null,e.graphQLErrors=[])},t.prototype.refetch=function(e){var t=this.options.fetchPolicy;return"cache-only"===t?Promise.reject(new mt(1)):("no-cache"!==t&&"cache-and-network"!==t&&(t="network-only"),_t(this.variables,e)||(this.variables=st(st({},this.variables),e)),_t(this.options.variables,this.variables)||(this.options.variables=st(st({},this.options.variables),this.variables)),this.queryManager.fetchQuery(this.queryId,st(st({},this.options),{fetchPolicy:t}),jr.refetch))},t.prototype.fetchMore=function(e){var t=this;yt(e.updateQuery,2);var r=st(st({},e.query?e:st(st(st({},this.options),e),{variables:st(st({},this.variables),e.variables)})),{fetchPolicy:"network-only"}),n=this.queryManager.generateQueryId();return this.queryManager.fetchQuery(n,r,jr.normal,this.queryId).then(function(i){return t.updateQuery(function(t){return e.updateQuery(t,{fetchMoreResult:i.data,variables:r.variables})}),t.queryManager.stopQuery(n),i},function(e){throw t.queryManager.stopQuery(n),e})},t.prototype.subscribeToMore=function(e){var t=this,r=this.queryManager.startGraphQLSubscription({query:e.document,variables:e.variables}).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){var t=this.options.fetchPolicy;this.options=st(st({},this.options),e),e.pollInterval?this.startPolling(e.pollInterval):0===e.pollInterval&&this.stopPolling();var r=e.fetchPolicy;return this.setVariables(this.options.variables,t!==r&&("cache-only"===t||"standby"===t||"network-only"===r),e.fetchResults)},t.prototype.setVariables=function(e,t,r){return void 0===t&&(t=!1),void 0===r&&(r=!0),this.isTornDown=!1,e=e||this.variables,!t&&_t(e,this.variables)?this.observers.size&&r?this.result():Promise.resolve():(this.variables=this.options.variables=e,this.observers.size?this.queryManager.fetchQuery(this.queryId,this.options):Promise.resolve())},t.prototype.updateQuery=function(e){var t=this.queryManager,r=t.getQueryWithPreviousResult(this.queryId),n=r.previousResult,i=r.variables,o=r.document,a=pr(function(){return e(n,{variables:i})});a&&(t.dataStore.markUpdateQueryResult(o,i,a),t.broadcastQueries())},t.prototype.stopPolling=function(){this.queryManager.stopPollingQuery(this.queryId),this.options.pollInterval=void 0},t.prototype.startPolling=function(e){Kr(this),this.options.pollInterval=e,this.queryManager.startPollingQuery(this.options,this.queryId)},t.prototype.updateLastResult=function(e){var t=this.lastResult;return this.lastResult=e,this.lastResultSnapshot=this.queryManager.assumeImmutableResults?e:lr(e),t},t.prototype.onSubscribe=function(e){var t=this;try{var r=e._subscription._observer;r&&!r.error&&(r.error=Vr)}catch(e){}var n=!this.observers.size;return this.observers.add(e),e.next&&this.lastResult&&e.next(this.lastResult),e.error&&this.lastError&&e.error(this.lastError),n&&this.setUpQuery(),function(){t.observers.delete(e)&&!t.observers.size&&t.tearDownQuery()}},t.prototype.setUpQuery=function(){var e=this,t=this.queryManager,r=this.queryId;this.shouldSubscribe&&t.addObservableQuery(r,this),this.options.pollInterval&&(Kr(this),t.startPollingQuery(this.options,r));var n=function(t){e.updateLastResult(st(st({},e.lastResult),{errors:t.graphQLErrors,networkStatus:Dr.error,loading:!1})),zr(e.observers,"error",e.lastError=t)};t.observeQuery(r,this.options,{next:function(r){if(e.lastError||e.isDifferentFromLastResult(r)){var n=e.updateLastResult(r),i=e.options,o=i.query,a=i.variables,s=i.fetchPolicy;t.transform(o).hasClientExports?t.getLocalState().addExportedVariables(o,a).then(function(i){var a=e.variables;e.variables=e.options.variables=i,!r.loading&&n&&"cache-only"!==s&&t.transform(o).serverQuery&&!_t(a,i)?e.refetch():zr(e.observers,"next",r)}):zr(e.observers,"next",r)}},error:n}).catch(n)},t.prototype.tearDownQuery=function(){var e=this.queryManager;this.isTornDown=!0,e.stopPollingQuery(this.queryId),this.subscriptions.forEach(function(e){return e.unsubscribe()}),this.subscriptions.clear(),e.removeObservableQuery(this.queryId),e.stopQuery(this.queryId),this.observers.clear()},t}(Mr);function Vr(e){}function zr(e,t,r){var n=[];e.forEach(function(e){return e[t]&&n.push(e)}),n.forEach(function(e){return e[t](r)})}function Kr(e){var t=e.options.fetchPolicy;yt("cache-first"!==t&&"cache-only"!==t,3)}var Gr=function(){function e(){this.store={}}return e.prototype.getStore=function(){return this.store},e.prototype.get=function(e){return this.store[e]},e.prototype.initMutation=function(e,t,r){this.store[e]={mutation:t,variables:r||{},loading:!0,error:null}},e.prototype.markMutationError=function(e,t){var r=this.store[e];r&&(r.loading=!1,r.error=t)},e.prototype.markMutationResult=function(e){var t=this.store[e];t&&(t.loading=!1,t.error=null)},e.prototype.reset=function(){this.store={}},e}(),Wr=function(){function e(){this.store={}}return e.prototype.getStore=function(){return this.store},e.prototype.get=function(e){return this.store[e]},e.prototype.initQuery=function(e){var t=this.store[e.queryId];yt(!t||t.document===e.document||_t(t.document,e.document),19);var r,n=!1,i=null;e.storePreviousVariables&&t&&t.networkStatus!==Dr.loading&&(_t(t.variables,e.variables)||(n=!0,i=t.variables)),r=n?Dr.setVariables:e.isPoll?Dr.poll:e.isRefetch?Dr.refetch:Dr.loading;var o=[];t&&t.graphQLErrors&&(o=t.graphQLErrors),this.store[e.queryId]={document:e.document,variables:e.variables,previousVariables:i,networkError:null,graphQLErrors:o,networkStatus:r,metadata:e.metadata},"string"==typeof e.fetchMoreForQueryId&&this.store[e.fetchMoreForQueryId]&&(this.store[e.fetchMoreForQueryId].networkStatus=Dr.fetchMore)},e.prototype.markQueryResult=function(e,t,r){this.store&&this.store[e]&&(this.store[e].networkError=null,this.store[e].graphQLErrors=Ur(t.errors)?t.errors:[],this.store[e].previousVariables=null,this.store[e].networkStatus=Dr.ready,"string"==typeof r&&this.store[r]&&(this.store[r].networkStatus=Dr.ready))},e.prototype.markQueryError=function(e,t,r){this.store&&this.store[e]&&(this.store[e].networkError=t,this.store[e].networkStatus=Dr.error,"string"==typeof r&&this.markQueryResultClient(r,!0))},e.prototype.markQueryResultClient=function(e,t){var r=this.store&&this.store[e];r&&(r.networkError=null,r.previousVariables=null,t&&(r.networkStatus=Dr.ready))},e.prototype.stopQuery=function(e){delete this.store[e]},e.prototype.reset=function(e){var t=this;Object.keys(this.store).forEach(function(r){e.indexOf(r)<0?t.stopQuery(r):t.store[r].networkStatus=Dr.loading})},e}(),Hr=function(){function e(e){var t=e.cache,r=e.client,n=e.resolvers,i=e.fragmentMatcher;this.cache=t,r&&(this.client=r),n&&this.addResolvers(n),i&&this.setFragmentMatcher(i)}return e.prototype.addResolvers=function(e){var t=this;this.resolvers=this.resolvers||{},Array.isArray(e)?e.forEach(function(e){t.resolvers=yr(t.resolvers,e)}):this.resolvers=yr(this.resolvers,e)},e.prototype.setResolvers=function(e){this.resolvers={},this.addResolvers(e)},e.prototype.getResolvers=function(){return this.resolvers||{}},e.prototype.runResolvers=function(e){var t=e.document,r=e.remoteResult,n=e.context,i=e.variables,o=e.onlyRunForcedResolvers,a=void 0!==o&&o;return ut(this,void 0,void 0,function(){return ct(this,function(e){return t?[2,this.resolveDocument(t,r.data,n,i,this.fragmentMatcher,a).then(function(e){return st(st({},r),{data:e.result})})]:[2,r]})})},e.prototype.setFragmentMatcher=function(e){this.fragmentMatcher=e},e.prototype.getFragmentMatcher=function(){return this.fragmentMatcher},e.prototype.clientQuery=function(e){return jt(["client"],e)&&this.resolvers?e:null},e.prototype.serverQuery=function(e){return this.resolvers?function(e){Kt(e);var t=ir([{test:function(e){return"client"===e.name.value},remove:!0}],e);return t&&(t=(0,lt.visit)(t,{FragmentDefinition:{enter:function(e){if(e.selectionSet&&e.selectionSet.selections.every(function(e){return Ft(e)&&"__typename"===e.name.value}))return null}}})),t}(e):e},e.prototype.prepareContext=function(e){void 0===e&&(e={});var t=this.cache;return st(st({},e),{cache:t,getCacheKey:function(e){if(t.config)return t.config.dataIdFromObject(e);yt(!1,6)}})},e.prototype.addExportedVariables=function(e,t,r){return void 0===t&&(t={}),void 0===r&&(r={}),ut(this,void 0,void 0,function(){return ct(this,function(n){return e?[2,this.resolveDocument(e,this.buildRootValueFromCache(e,t)||{},this.prepareContext(r),t).then(function(e){return st(st({},t),e.exportedVariables)})]:[2,st({},t)]})})},e.prototype.shouldForceResolvers=function(e){var t=!1;return(0,lt.visit)(e,{Directive:{enter:function(e){if("client"===e.name.value&&e.arguments&&(t=e.arguments.some(function(e){return"always"===e.name.value&&"BooleanValue"===e.value.kind&&!0===e.value.value})))return lt.BREAK}}}),t},e.prototype.buildRootValueFromCache=function(e,t){return this.cache.diff({query:sr(e),variables:t,returnPartialData:!0,optimistic:!1}).result},e.prototype.resolveDocument=function(e,t,r,n,i,o){return void 0===r&&(r={}),void 0===n&&(n={}),void 0===i&&(i=function(){return!0}),void 0===o&&(o=!1),ut(this,void 0,void 0,function(){var a,s,u,c,l,h,f,p,d;return ct(this,function(m){var y;return a=Jt(e),s=Ht(e),u=Yt(s),c=a.operation,l=c?(y=c).charAt(0).toUpperCase()+y.slice(1):"Query",f=(h=this).cache,p=h.client,d={fragmentMap:u,context:st(st({},r),{cache:f,client:p}),variables:n,fragmentMatcher:i,defaultOperationType:l,exportedVariables:{},onlyRunForcedResolvers:o},[2,this.resolveSelectionSet(a.selectionSet,t,d).then(function(e){return{result:e,exportedVariables:d.exportedVariables}})]})})},e.prototype.resolveSelectionSet=function(e,t,r){return ut(this,void 0,void 0,function(){var n,i,o,a,s,u=this;return ct(this,function(c){return n=r.fragmentMap,i=r.context,o=r.variables,a=[t],s=function(e){return ut(u,void 0,void 0,function(){var s,u;return ct(this,function(c){return Ut(e,o)?Ft(e)?[2,this.resolveField(e,t,r).then(function(t){var r;void 0!==t&&a.push(((r={})[qt(e)]=t,r))})]:(Dt(e)?s=e:yt(s=n[e.name.value],7),s&&s.typeCondition&&(u=s.typeCondition.name.value,r.fragmentMatcher(t,u,i))?[2,this.resolveSelectionSet(s.selectionSet,t,r).then(function(e){a.push(e)})]:[2]):[2]})})},[2,Promise.all(e.selections.map(s)).then(function(){return vr(a)})]})})},e.prototype.resolveField=function(e,t,r){return ut(this,void 0,void 0,function(){var n,i,o,a,s,u,c,l,h,f=this;return ct(this,function(p){return n=r.variables,i=e.name.value,o=qt(e),a=i!==o,s=t[o]||t[i],u=Promise.resolve(s),r.onlyRunForcedResolvers&&!this.shouldForceResolvers(e)||(c=t.__typename||r.defaultOperationType,(l=this.resolvers&&this.resolvers[c])&&(h=l[a?i:o])&&(u=Promise.resolve(h(t,Nt(e,n),r.context,{field:e,fragmentMap:r.fragmentMap})))),[2,u.then(function(t){return void 0===t&&(t=s),e.directives&&e.directives.forEach(function(e){"export"===e.name.value&&e.arguments&&e.arguments.forEach(function(e){"as"===e.name.value&&"StringValue"===e.value.kind&&(r.exportedVariables[e.value.value]=t)})}),e.selectionSet?null==t?t:Array.isArray(t)?f.resolveSubSelectedArray(e,t,r):e.selectionSet?f.resolveSelectionSet(e.selectionSet,t,r):void 0:t})]})})},e.prototype.resolveSubSelectedArray=function(e,t,r){var n=this;return Promise.all(t.map(function(t){return null===t?null:Array.isArray(t)?n.resolveSubSelectedArray(e,t,r):e.selectionSet?n.resolveSelectionSet(e.selectionSet,t,r):void 0}))},e}();function Jr(e){var t=new Set,r=null;return new Mr(function(n){return t.add(n),r=r||e.subscribe({next:function(e){t.forEach(function(t){return t.next&&t.next(e)})},error:function(e){t.forEach(function(t){return t.error&&t.error(e)})},complete:function(){t.forEach(function(e){return e.complete&&e.complete()})}}),function(){t.delete(n)&&!t.size&&r&&(r.unsubscribe(),r=null)}})}var Yr=Object.prototype.hasOwnProperty,Xr=function(){function e(e){var t=e.link,r=e.queryDeduplication,n=void 0!==r&&r,i=e.store,o=e.onBroadcast,a=void 0===o?function(){}:o,s=e.ssrMode,u=void 0!==s&&s,c=e.clientAwareness,l=void 0===c?{}:c,h=e.localState,f=e.assumeImmutableResults;this.mutationStore=new Gr,this.queryStore=new Wr,this.clientAwareness={},this.idCounter=1,this.queries=new Map,this.fetchQueryRejectFns=new Map,this.transformCache=new(ur?WeakMap:Map),this.inFlightLinkObservables=new Map,this.pollingInfoByQueryId=new Map,this.link=t,this.queryDeduplication=n,this.dataStore=i,this.onBroadcast=a,this.clientAwareness=l,this.localState=h||new Hr({cache:i.getCache()}),this.ssrMode=u,this.assumeImmutableResults=!!f}return e.prototype.stop=function(){var e=this;this.queries.forEach(function(t,r){e.stopQueryNoBroadcast(r)}),this.fetchQueryRejectFns.forEach(function(e){e(new mt(8))})},e.prototype.mutate=function(e){var t=e.mutation,r=e.variables,n=e.optimisticResponse,i=e.updateQueries,o=e.refetchQueries,a=void 0===o?[]:o,s=e.awaitRefetchQueries,u=void 0!==s&&s,c=e.update,l=e.errorPolicy,h=void 0===l?"none":l,f=e.fetchPolicy,p=e.context,d=void 0===p?{}:p;return ut(this,void 0,void 0,function(){var e,o,s,l=this;return ct(this,function(p){switch(p.label){case 0:return yt(t,9),yt(!f||"no-cache"===f,10),e=this.generateQueryId(),t=this.transform(t).document,this.setQuery(e,function(){return{document:t}}),r=this.getVariables(t,r),this.transform(t).hasClientExports?[4,this.localState.addExportedVariables(t,r,d)]:[3,2];case 1:r=p.sent(),p.label=2;case 2:return o=function(){var e={};return i&&l.queries.forEach(function(t,r){var n=t.observableQuery;if(n){var o=n.queryName;o&&Yr.call(i,o)&&(e[r]={updater:i[o],query:l.queryStore.get(r)})}}),e},this.mutationStore.initMutation(e,t,r),this.dataStore.markMutationInit({mutationId:e,document:t,variables:r,updateQueries:o(),update:c,optimisticResponse:n}),this.broadcastQueries(),s=this,[2,new Promise(function(i,l){var p,m;s.getObservableFromLink(t,st(st({},d),{optimisticResponse:n}),r,!1).subscribe({next:function(n){dr(n)&&"none"===h?m=new $r({graphQLErrors:n.errors}):(s.mutationStore.markMutationResult(e),"no-cache"!==f&&s.dataStore.markMutationResult({mutationId:e,result:n,document:t,variables:r,updateQueries:o(),update:c}),p=n)},error:function(t){s.mutationStore.markMutationError(e,t),s.dataStore.markMutationComplete({mutationId:e,optimisticResponse:n}),s.broadcastQueries(),s.setQuery(e,function(){return{document:null}}),l(new $r({networkError:t}))},complete:function(){if(m&&s.mutationStore.markMutationError(e,m),s.dataStore.markMutationComplete({mutationId:e,optimisticResponse:n}),s.broadcastQueries(),m)l(m);else{"function"==typeof a&&(a=a(p));var t=[];Ur(a)&&a.forEach(function(e){if("string"==typeof e)s.queries.forEach(function(r){var n=r.observableQuery;n&&n.queryName===e&&t.push(n.refetch())});else{var r={query:e.query,variables:e.variables,fetchPolicy:"network-only"};e.context&&(r.context=e.context),t.push(s.query(r))}}),Promise.all(u?t:[]).then(function(){s.setQuery(e,function(){return{document:null}}),"ignore"===h&&p&&dr(p)&&delete p.errors,i(p)})}}})})]}})})},e.prototype.fetchQuery=function(e,t,r,n){return ut(this,void 0,void 0,function(){var i,o,a,s,u,c,l,h,f,p,d,m,y,v,g,b,w,R,E=this;return ct(this,function(k){switch(k.label){case 0:return i=t.metadata,o=void 0===i?null:i,a=t.fetchPolicy,s=void 0===a?"cache-first":a,u=t.context,c=void 0===u?{}:u,l=this.transform(t.query).document,h=this.getVariables(l,t.variables),this.transform(l).hasClientExports?[4,this.localState.addExportedVariables(l,h,c)]:[3,2];case 1:h=k.sent(),k.label=2;case 2:if(t=st(st({},t),{variables:h}),d=p="network-only"===s||"no-cache"===s,p||(m=this.dataStore.getCache().diff({query:l,variables:h,returnPartialData:!0,optimistic:!1}),y=m.complete,v=m.result,d=!y||"cache-and-network"===s,f=v),g=d&&"cache-only"!==s&&"standby"!==s,jt(["live"],l)&&(g=!0),b=this.idCounter++,w="no-cache"!==s?this.updateQueryWatch(e,l,t):void 0,this.setQuery(e,function(){return{document:l,lastRequestId:b,invalidated:!0,cancel:w}}),this.invalidate(n),this.queryStore.initQuery({queryId:e,document:l,storePreviousVariables:g,variables:h,isPoll:r===jr.poll,isRefetch:r===jr.refetch,metadata:o,fetchMoreForQueryId:n}),this.broadcastQueries(),g){if(R=this.fetchRequest({requestId:b,queryId:e,document:l,options:t,fetchMoreForQueryId:n}).catch(function(t){throw t.hasOwnProperty("graphQLErrors")?t:(b>=E.getQuery(e).lastRequestId&&(E.queryStore.markQueryError(e,t,n),E.invalidate(e),E.invalidate(n),E.broadcastQueries()),new $r({networkError:t}))}),"cache-and-network"!==s)return[2,R];R.catch(function(){})}return this.queryStore.markQueryResultClient(e,!g),this.invalidate(e),this.invalidate(n),this.transform(l).hasForcedResolvers?[2,this.localState.runResolvers({document:l,remoteResult:{data:f},context:c,variables:h,onlyRunForcedResolvers:!0}).then(function(r){return E.markQueryResult(e,r,t,n),E.broadcastQueries(),r})]:(this.broadcastQueries(),[2,{data:f}])}})})},e.prototype.markQueryResult=function(e,t,r,n){var i=r.fetchPolicy,o=r.variables,a=r.errorPolicy;"no-cache"===i?this.setQuery(e,function(){return{newData:{result:t.data,complete:!0}}}):this.dataStore.markQueryResult(t,this.getQuery(e).document,o,n,"ignore"===a||"all"===a)},e.prototype.queryListenerForObserver=function(e,t,r){var n=this;function i(e,t){if(r[e])try{r[e](t)}catch(e){}}return function(r,o){if(n.invalidate(e,!1),r){var a=n.getQuery(e),s=a.observableQuery,u=a.document,c=s?s.options.fetchPolicy:t.fetchPolicy;if("standby"!==c){var l=Lr(r.networkStatus),h=s&&s.getLastResult(),f=!(!h||h.networkStatus===r.networkStatus),p=t.returnPartialData||!o&&r.previousVariables||f&&t.notifyOnNetworkStatusChange||"cache-only"===c||"cache-and-network"===c;if(!l||p){var d=Ur(r.graphQLErrors),m=s&&s.options.errorPolicy||t.errorPolicy||"none";if("none"===m&&d||r.networkError)return i("error",new $r({graphQLErrors:r.graphQLErrors,networkError:r.networkError}));try{var y=void 0,v=void 0;if(o)"no-cache"!==c&&"network-only"!==c&&n.setQuery(e,function(){return{newData:null}}),y=o.result,v=!o.complete;else{var g=s&&s.getLastError(),b="none"!==m&&(g&&g.graphQLErrors)!==r.graphQLErrors;if(h&&h.data&&!b)y=h.data,v=!1;else{var w=n.dataStore.getCache().diff({query:u,variables:r.previousVariables||r.variables,returnPartialData:!0,optimistic:!0});y=w.result,v=!w.complete}}var R=v&&!(t.returnPartialData||"cache-only"===c),E={data:R?h&&h.data:y,loading:l,networkStatus:r.networkStatus,stale:R};"all"===m&&d&&(E.errors=r.graphQLErrors),i("next",E)}catch(e){i("error",new $r({networkError:e}))}}}}}},e.prototype.transform=function(e){var t,r=this.transformCache;if(!r.has(e)){var n=this.dataStore.getCache(),i=n.transformDocument(e),o=(t=n.transformForLink(i),ir([or],Kt(t))),a=this.localState.clientQuery(i),s=this.localState.serverQuery(o),u={document:i,hasClientExports:$t(i),hasForcedResolvers:this.localState.shouldForceResolvers(i),clientQuery:a,serverQuery:s,defaultVars:Xt(Gt(i))},c=function(e){e&&!r.has(e)&&r.set(e,u)};c(e),c(i),c(a),c(s)}return r.get(e)},e.prototype.getVariables=function(e,t){return st(st({},this.transform(e).defaultVars),t)},e.prototype.watchQuery=function(e,t){void 0===t&&(t=!0),yt("standby"!==e.fetchPolicy,11),e.variables=this.getVariables(e.query,e.variables),void 0===e.notifyOnNetworkStatusChange&&(e.notifyOnNetworkStatusChange=!1);var r=st({},e);return new Qr({queryManager:this,options:r,shouldSubscribe:t})},e.prototype.query=function(e){var t=this;return yt(e.query,12),yt("Document"===e.query.kind,13),yt(!e.returnPartialData,14),yt(!e.pollInterval,15),new Promise(function(r,n){var i=t.watchQuery(e,!1);t.fetchQueryRejectFns.set("query:"+i.queryId,n),i.result().then(r,n).then(function(){return t.fetchQueryRejectFns.delete("query:"+i.queryId)})})},e.prototype.generateQueryId=function(){return String(this.idCounter++)},e.prototype.stopQueryInStore=function(e){this.stopQueryInStoreNoBroadcast(e),this.broadcastQueries()},e.prototype.stopQueryInStoreNoBroadcast=function(e){this.stopPollingQuery(e),this.queryStore.stopQuery(e),this.invalidate(e)},e.prototype.addQueryListener=function(e,t){this.setQuery(e,function(e){return e.listeners.add(t),{invalidated:!1}})},e.prototype.updateQueryWatch=function(e,t,r){var n=this,i=this.getQuery(e).cancel;return i&&i(),this.dataStore.getCache().watch({query:t,variables:r.variables,optimistic:!0,previousResult:function(){var t=null,r=n.getQuery(e).observableQuery;if(r){var i=r.getLastResult();i&&(t=i.data)}return t},callback:function(t){n.setQuery(e,function(){return{invalidated:!0,newData:t}})}})},e.prototype.addObservableQuery=function(e,t){this.setQuery(e,function(){return{observableQuery:t}})},e.prototype.removeObservableQuery=function(e){var t=this.getQuery(e).cancel;this.setQuery(e,function(){return{observableQuery:null}}),t&&t()},e.prototype.clearStore=function(){this.fetchQueryRejectFns.forEach(function(e){e(new mt(16))});var e=[];return this.queries.forEach(function(t,r){t.observableQuery&&e.push(r)}),this.queryStore.reset(e),this.mutationStore.reset(),this.dataStore.reset()},e.prototype.resetStore=function(){var e=this;return this.clearStore().then(function(){return e.reFetchObservableQueries()})},e.prototype.reFetchObservableQueries=function(e){var t=this;void 0===e&&(e=!1);var r=[];return this.queries.forEach(function(n,i){var o=n.observableQuery;if(o){var a=o.options.fetchPolicy;o.resetLastResults(),"cache-only"===a||!e&&"standby"===a||r.push(o.refetch()),t.setQuery(i,function(){return{newData:null}}),t.invalidate(i)}}),this.broadcastQueries(),Promise.all(r)},e.prototype.observeQuery=function(e,t,r){return this.addQueryListener(e,this.queryListenerForObserver(e,t,r)),this.fetchQuery(e,t)},e.prototype.startQuery=function(e,t,r){return this.addQueryListener(e,r),this.fetchQuery(e,t).catch(function(){}),e},e.prototype.startGraphQLSubscription=function(e){var t=this,r=e.query,n=e.fetchPolicy,i=e.variables;r=this.transform(r).document,i=this.getVariables(r,i);var o=function(e){return t.getObservableFromLink(r,{},e,!1).map(function(i){if(n&&"no-cache"===n||(t.dataStore.markSubscriptionResult(i,r,e),t.broadcastQueries()),dr(i))throw new $r({graphQLErrors:i.errors});return i})};if(this.transform(r).hasClientExports){var a=this.localState.addExportedVariables(r,i).then(o);return new Mr(function(e){var t=null;return a.then(function(r){return t=r.subscribe(e)},e.error),function(){return t&&t.unsubscribe()}})}return o(i)},e.prototype.stopQuery=function(e){this.stopQueryNoBroadcast(e),this.broadcastQueries()},e.prototype.stopQueryNoBroadcast=function(e){this.stopQueryInStoreNoBroadcast(e),this.removeQuery(e)},e.prototype.removeQuery=function(e){this.fetchQueryRejectFns.delete("query:"+e),this.fetchQueryRejectFns.delete("fetchRequest:"+e),this.getQuery(e).subscriptions.forEach(function(e){return e.unsubscribe()}),this.queries.delete(e)},e.prototype.getCurrentQueryResult=function(e,t){void 0===t&&(t=!0);var r=e.options,n=r.variables,i=r.query,o=r.fetchPolicy,a=r.returnPartialData,s=e.getLastResult(),u=this.getQuery(e.queryId).newData;if(u&&u.complete)return{data:u.result,partial:!1};if("no-cache"===o||"network-only"===o)return{data:void 0,partial:!1};var c=this.dataStore.getCache().diff({query:i,variables:n,previousResult:s?s.data:void 0,returnPartialData:!0,optimistic:t}),l=c.result,h=c.complete;return{data:h||a?l:void 0,partial:!h}},e.prototype.getQueryWithPreviousResult=function(e){var t;if("string"==typeof e){var r=this.getQuery(e).observableQuery;yt(r,17),t=r}else t=e;var n=t.options,i=n.variables,o=n.query;return{previousResult:this.getCurrentQueryResult(t,!1).data,variables:i,document:o}},e.prototype.broadcastQueries=function(){var e=this;this.onBroadcast(),this.queries.forEach(function(t,r){t.invalidated&&t.listeners.forEach(function(n){n&&n(e.queryStore.get(r),t.newData)})})},e.prototype.getLocalState=function(){return this.localState},e.prototype.getObservableFromLink=function(e,t,r,n){var i,o=this;void 0===n&&(n=this.queryDeduplication);var a=this.transform(e).serverQuery;if(a){var s=this.inFlightLinkObservables,u=this.link,c={query:a,variables:r,operationName:Wt(a)||void 0,context:this.prepareContext(st(st({},t),{forceFetch:!n}))};if(t=c.context,n){var l=s.get(a)||new Map;s.set(a,l);var h=JSON.stringify(r);if(!(i=l.get(h))){l.set(h,i=Jr(Fr(u,c)));var f=function(){l.delete(h),l.size||s.delete(a),p.unsubscribe()},p=i.subscribe({next:f,error:f,complete:f})}}else i=Jr(Fr(u,c))}else i=Mr.of({data:{}}),t=this.prepareContext(t);var d=this.transform(e).clientQuery;return d&&(i=function(e){return new Mr(function(n){var i=n.next,a=n.error,s=n.complete,u=0,c=!1,l={next:function(e){++u,new Promise(function(n){n(function(e){return o.localState.runResolvers({document:d,remoteResult:e,context:t,variables:r})}(e))}).then(function(e){--u,i&&i.call(n,e),c&&l.complete()},function(e){--u,a&&a.call(n,e)})},error:function(e){a&&a.call(n,e)},complete:function(){c=!0,u||s&&s.call(n)}},h=e.subscribe(l);return function(){return h.unsubscribe()}})}(i)),i},e.prototype.fetchRequest=function(e){var t,r,n=this,i=e.requestId,o=e.queryId,a=e.document,s=e.options,u=e.fetchMoreForQueryId,c=s.variables,l=s.errorPolicy,h=void 0===l?"none":l,f=s.fetchPolicy;return new Promise(function(e,l){var p=n.getObservableFromLink(a,s.context,c),d="fetchRequest:"+o;n.fetchQueryRejectFns.set(d,l);var m=function(){n.fetchQueryRejectFns.delete(d),n.setQuery(o,function(e){e.subscriptions.delete(y)})},y=p.map(function(e){if(i>=n.getQuery(o).lastRequestId&&(n.markQueryResult(o,e,s,u),n.queryStore.markQueryResult(o,e,u),n.invalidate(o),n.invalidate(u),n.broadcastQueries()),"none"===h&&Ur(e.errors))return l(new $r({graphQLErrors:e.errors}));if("all"===h&&(r=e.errors),u||"no-cache"===f)t=e.data;else{var p=n.dataStore.getCache().diff({variables:c,query:a,optimistic:!1,returnPartialData:!0}),d=p.result;(p.complete||s.returnPartialData)&&(t=d)}}).subscribe({error:function(e){m(),l(e)},complete:function(){m(),e({data:t,errors:r,loading:!1,networkStatus:Dr.ready,stale:!1})}});n.setQuery(o,function(e){e.subscriptions.add(y)})})},e.prototype.getQuery=function(e){return this.queries.get(e)||{listeners:new Set,invalidated:!1,document:null,newData:null,lastRequestId:1,observableQuery:null,subscriptions:new Set}},e.prototype.setQuery=function(e,t){var r=this.getQuery(e),n=st(st({},r),t(r));this.queries.set(e,n)},e.prototype.invalidate=function(e,t){void 0===t&&(t=!0),e&&this.setQuery(e,function(){return{invalidated:t}})},e.prototype.prepareContext=function(e){void 0===e&&(e={});var t=this.localState.prepareContext(e);return st(st({},t),{clientAwareness:this.clientAwareness})},e.prototype.checkInFlight=function(e){var t=this.queryStore.get(e);return t&&t.networkStatus!==Dr.ready&&t.networkStatus!==Dr.error},e.prototype.startPollingQuery=function(e,t,r){var n=this,i=e.pollInterval;if(yt(i,18),!this.ssrMode){var o=this.pollingInfoByQueryId.get(t);o||this.pollingInfoByQueryId.set(t,o={}),o.interval=i,o.options=st(st({},e),{fetchPolicy:"network-only"});var a=function(){var e=n.pollingInfoByQueryId.get(t);e&&(n.checkInFlight(t)?s():n.fetchQuery(t,e.options,jr.poll).then(s,s))},s=function(){var e=n.pollingInfoByQueryId.get(t);e&&(clearTimeout(e.timeout),e.timeout=setTimeout(a,e.interval))};r&&this.addQueryListener(t,r),s()}return t},e.prototype.stopPollingQuery=function(e){this.pollingInfoByQueryId.delete(e)},e}(),Zr=function(){function e(e){this.cache=e}return e.prototype.getCache=function(){return this.cache},e.prototype.markQueryResult=function(e,t,r,n,i){void 0===i&&(i=!1);var o=!dr(e);i&&dr(e)&&e.data&&(o=!0),!n&&o&&this.cache.write({result:e.data,dataId:"ROOT_QUERY",query:t,variables:r})},e.prototype.markSubscriptionResult=function(e,t,r){dr(e)||this.cache.write({result:e.data,dataId:"ROOT_SUBSCRIPTION",query:t,variables:r})},e.prototype.markMutationInit=function(e){var t,r=this;e.optimisticResponse&&(t="function"==typeof e.optimisticResponse?e.optimisticResponse(e.variables):e.optimisticResponse,this.cache.recordOptimisticTransaction(function(n){var i=r.cache;r.cache=n;try{r.markMutationResult({mutationId:e.mutationId,result:{data:t},document:e.document,variables:e.variables,updateQueries:e.updateQueries,update:e.update})}finally{r.cache=i}},e.mutationId))},e.prototype.markMutationResult=function(e){var t=this;if(!dr(e.result)){var r=[{result:e.result.data,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}],n=e.updateQueries;n&&Object.keys(n).forEach(function(i){var o=n[i],a=o.query,s=o.updater,u=t.cache.diff({query:a.document,variables:a.variables,returnPartialData:!0,optimistic:!1}),c=u.result;if(u.complete){var l=pr(function(){return s(c,{mutationResult:e.result,queryName:Wt(a.document)||void 0,queryVariables:a.variables})});l&&r.push({result:l,dataId:"ROOT_QUERY",query:a.document,variables:a.variables})}}),this.cache.performTransaction(function(t){r.forEach(function(e){return t.write(e)});var n=e.update;n&&pr(function(){return n(t,e.result)})})}},e.prototype.markMutationComplete=function(e){var t=e.mutationId;e.optimisticResponse&&this.cache.removeOptimistic(t)},e.prototype.markUpdateQueryResult=function(e,t,r){this.cache.write({result:r,dataId:"ROOT_QUERY",variables:t,query:e})},e.prototype.reset=function(){return this.cache.reset()},e}(),en=function(){function e(e){var t=this;this.defaultOptions={},this.resetStoreCallbacks=[],this.clearStoreCallbacks=[];var r=e.cache,n=e.ssrMode,i=void 0!==n&&n,o=e.ssrForceFetchDelay,a=void 0===o?0:o,s=e.connectToDevTools,u=e.queryDeduplication,c=void 0===u||u,l=e.defaultOptions,h=e.assumeImmutableResults,f=void 0!==h&&h,p=e.resolvers,d=e.typeDefs,m=e.fragmentMatcher,y=e.name,v=e.version,g=e.link;if(!g&&p&&(g=qr.empty()),!g||!r)throw new mt(4);this.link=g,this.cache=r,this.store=new Zr(r),this.disableNetworkFetches=i||a>0,this.queryDeduplication=c,this.defaultOptions=l||{},this.typeDefs=d,a&&setTimeout(function(){return t.disableNetworkFetches=!1},a),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),void 0!==s&&s&&"undefined"!=typeof window&&(window.__APOLLO_CLIENT__=this),this.version="2.6.10",this.localState=new Hr({cache:r,client:this,resolvers:p,fragmentMatcher:m}),this.queryManager=new Xr({link:this.link,store:this.store,queryDeduplication:c,ssrMode:i,clientAwareness:{name:y,version:v},localState:this.localState,assumeImmutableResults:f,onBroadcast:function(){t.devToolsHookCb&&t.devToolsHookCb({action:{},state:{queries:t.queryManager.queryStore.getStore(),mutations:t.queryManager.mutationStore.getStore()},dataWithOptimisticResults:t.cache.extract(!0)})}})}return e.prototype.stop=function(){this.queryManager.stop()},e.prototype.watchQuery=function(e){return this.defaultOptions.watchQuery&&(e=st(st({},this.defaultOptions.watchQuery),e)),!this.disableNetworkFetches||"network-only"!==e.fetchPolicy&&"cache-and-network"!==e.fetchPolicy||(e=st(st({},e),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(e)},e.prototype.query=function(e){return this.defaultOptions.query&&(e=st(st({},this.defaultOptions.query),e)),yt("cache-and-network"!==e.fetchPolicy,5),this.disableNetworkFetches&&"network-only"===e.fetchPolicy&&(e=st(st({},e),{fetchPolicy:"cache-first"})),this.queryManager.query(e)},e.prototype.mutate=function(e){return this.defaultOptions.mutate&&(e=st(st({},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){var t=this.cache.writeQuery(e);return this.queryManager.broadcastQueries(),t},e.prototype.writeFragment=function(e){var t=this.cache.writeFragment(e);return this.queryManager.broadcastQueries(),t},e.prototype.writeData=function(e){var t=this.cache.writeData(e);return this.queryManager.broadcastQueries(),t},e.prototype.__actionHookForDevTools=function(e){this.devToolsHookCb=e},e.prototype.__requestRaw=function(e){return Fr(this.link,e)},e.prototype.initQueryManager=function(){return this.queryManager},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}(),tn=function(e,t){return tn=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},tn(e,t)};function rn(e,t){function r(){this.constructor=e}tn(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var nn=function(){return nn=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},nn.apply(this,arguments)};function on(e){return{kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GeneratedClientQuery"},selectionSet:an(e)}]}}function an(e){if("number"==typeof e||"boolean"==typeof e||"string"==typeof e||null==e)return null;if(Array.isArray(e))return an(e[0]);var t=[];return Object.keys(e).forEach(function(r){var n={kind:"Field",name:{kind:"Name",value:r},selectionSet:an(e[r])||void 0};t.push(n)}),{kind:"SelectionSet",selections:t}}var sn,un={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:null,variableDefinitions:null,directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",alias:null,name:{kind:"Name",value:"__typename"},arguments:[],directives:[],selectionSet:null}]}}]},cn=function(){function e(){}return e.prototype.transformDocument=function(e){return e},e.prototype.transformForLink=function(e){return e},e.prototype.readQuery=function(e,t){return void 0===t&&(t=!1),this.read({query:e.query,variables:e.variables,optimistic:t})},e.prototype.readFragment=function(e,t){return void 0===t&&(t=!1),this.read({query:Vt(e.fragment,e.fragmentName),variables:e.variables,rootId:e.id,optimistic:t})},e.prototype.writeQuery=function(e){this.write({dataId:"ROOT_QUERY",result:e.data,query:e.query,variables:e.variables})},e.prototype.writeFragment=function(e){this.write({dataId:e.id,result:e.data,variables:e.variables,query:Vt(e.fragment,e.fragmentName)})},e.prototype.writeData=function(e){var t,r,n=e.id,i=e.data;if(void 0!==n){var o=null;try{o=this.read({rootId:n,optimistic:!1,query:un})}catch(e){}var a=o&&o.__typename||"__ClientData",s=Object.assign({__typename:a},i);this.writeFragment({id:n,fragment:(t=s,r=a,{kind:"Document",definitions:[{kind:"FragmentDefinition",typeCondition:{kind:"NamedType",name:{kind:"Name",value:r||"__FakeType"}},name:{kind:"Name",value:"GeneratedClientQuery"},selectionSet:an(t)}]}),data:s})}else this.writeQuery({query:on(i),data:i})},e}();sn||(sn={});var ln=null,hn={},fn=1,pn="@wry/context:Slot",dn=Array,mn=dn[pn]||function(){var e=function(){function e(){this.id=["slot",fn++,Date.now(),Math.random().toString(36).slice(2)].join(":")}return e.prototype.hasValue=function(){for(var e=ln;e;e=e.parent)if(this.id in e.slots){var t=e.slots[this.id];if(t===hn)break;return e!==ln&&(ln.slots[this.id]=t),!0}return ln&&(ln.slots[this.id]=hn),!1},e.prototype.getValue=function(){if(this.hasValue())return ln.slots[this.id]},e.prototype.withValue=function(e,t,r,n){var i,o=((i={__proto__:null})[this.id]=e,i),a=ln;ln={parent:a,slots:o};try{return t.apply(n,r)}finally{ln=a}},e.bind=function(e){var t=ln;return function(){var r=ln;try{return ln=t,e.apply(this,arguments)}finally{ln=r}}},e.noContext=function(e,t,r){if(!ln)return e.apply(r,t);var n=ln;try{return ln=null,e.apply(r,t)}finally{ln=n}},e}();try{Object.defineProperty(dn,pn,{value:dn[pn]=e,enumerable:!1,writable:!1,configurable:!1})}finally{return e}}();function yn(){}mn.bind,mn.noContext;var vn=function(){function e(e,t){void 0===e&&(e=1/0),void 0===t&&(t=yn),this.max=e,this.dispose=t,this.map=new Map,this.newest=null,this.oldest=null}return e.prototype.has=function(e){return this.map.has(e)},e.prototype.get=function(e){var t=this.getEntry(e);return t&&t.value},e.prototype.getEntry=function(e){var t=this.map.get(e);if(t&&t!==this.newest){var r=t.older,n=t.newer;n&&(n.older=r),r&&(r.newer=n),t.older=this.newest,t.older.newer=t,t.newer=null,this.newest=t,t===this.oldest&&(this.oldest=n)}return t},e.prototype.set=function(e,t){var r=this.getEntry(e);return r?r.value=t:(r={key:e,value:t,newer:null,older:this.newest},this.newest&&(this.newest.newer=r),this.newest=r,this.oldest=this.oldest||r,this.map.set(e,r),r.value)},e.prototype.clean=function(){for(;this.oldest&&this.map.size>this.max;)this.delete(this.oldest.key)},e.prototype.delete=function(e){var t=this.map.get(e);return!!t&&(t===this.newest&&(this.newest=t.older),t===this.oldest&&(this.oldest=t.newer),t.newer&&(t.newer.older=t.older),t.older&&(t.older.newer=t.newer),this.map.delete(e),this.dispose(t.value,e),!0)},e}(),gn=new mn,bn=[],wn=[];function Rn(e,t){if(!e)throw new Error(t||"assertion failure")}function En(e){switch(e.length){case 0:throw new Error("unknown value");case 1:return e[0];case 2:throw e[1]}}var kn=function(){function e(t,r){this.fn=t,this.args=r,this.parents=new Set,this.childValues=new Map,this.dirtyChildren=null,this.dirty=!0,this.recomputing=!1,this.value=[],++e.count}return e.prototype.recompute=function(){if(Rn(!this.recomputing,"already recomputing"),function(e){var t=gn.getValue();if(t)return e.parents.add(t),t.childValues.has(e)||t.childValues.set(e,[]),xn(e)?In(t,e):Tn(t,e),t}(this)||!Pn(this))return xn(this)?(t=Cn(e=this),gn.withValue(e,On,[e]),function(e){if("function"==typeof e.subscribe)try{qn(e),e.unsubscribe=e.subscribe.apply(null,e.args)}catch(t){return e.setDirty(),!1}return!0}(e)&&function(e){e.dirty=!1,xn(e)||_n(e)}(e),t.forEach(Pn),En(e.value)):En(this.value);var e,t},e.prototype.setDirty=function(){this.dirty||(this.dirty=!0,this.value.length=0,Sn(this),qn(this))},e.prototype.dispose=function(){var e=this;Cn(this).forEach(Pn),qn(this),this.parents.forEach(function(t){t.setDirty(),Nn(t,e)})},e.count=0,e}();function On(e){e.recomputing=!0,e.value.length=0;try{e.value[0]=e.fn.apply(null,e.args)}catch(t){e.value[1]=t}e.recomputing=!1}function xn(e){return e.dirty||!(!e.dirtyChildren||!e.dirtyChildren.size)}function Sn(e){e.parents.forEach(function(t){return In(t,e)})}function _n(e){e.parents.forEach(function(t){return Tn(t,e)})}function In(e,t){if(Rn(e.childValues.has(t)),Rn(xn(t)),e.dirtyChildren){if(e.dirtyChildren.has(t))return}else e.dirtyChildren=wn.pop()||new Set;e.dirtyChildren.add(t),Sn(e)}function Tn(e,t){Rn(e.childValues.has(t)),Rn(!xn(t));var r,n,i,o=e.childValues.get(t);0===o.length?e.childValues.set(t,t.value.slice(0)):(r=o,n=t.value,(i=r.length)>0&&i===n.length&&r[i-1]===n[i-1]||e.setDirty()),An(e,t),xn(e)||_n(e)}function An(e,t){var r=e.dirtyChildren;r&&(r.delete(t),0===r.size&&(wn.length<100&&wn.push(r),e.dirtyChildren=null))}function Pn(e){return 0===e.parents.size&&"function"==typeof e.reportOrphan&&!0===e.reportOrphan()}function Cn(e){var t=bn;return e.childValues.size>0&&(t=[],e.childValues.forEach(function(r,n){Nn(e,n),t.push(n)})),Rn(null===e.dirtyChildren),t}function Nn(e,t){t.parents.delete(e),e.childValues.delete(t),An(e,t)}function qn(e){var t=e.unsubscribe;"function"==typeof t&&(e.unsubscribe=void 0,t())}var Fn=function(){function e(e){this.weakness=e}return e.prototype.lookup=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return this.lookupArray(e)},e.prototype.lookupArray=function(e){var t=this;return e.forEach(function(e){return t=t.getChildTrie(e)}),t.data||(t.data=Object.create(null))},e.prototype.getChildTrie=function(t){var r=this.weakness&&function(e){switch(typeof e){case"object":if(null===e)break;case"function":return!0}return!1}(t)?this.weak||(this.weak=new WeakMap):this.strong||(this.strong=new Map),n=r.get(t);return n||r.set(t,n=new e(this.weakness)),n},e}(),Dn=new Fn("function"==typeof WeakMap);function Bn(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Dn.lookupArray(e)}var Ln=new Set;function Mn(e,t){void 0===t&&(t=Object.create(null));var r=new vn(t.max||Math.pow(2,16),function(e){return e.dispose()}),n=!!t.disposable,i=t.makeCacheKey||Bn;function o(){if(!n||gn.hasValue()){var o=i.apply(null,arguments);if(void 0===o)return e.apply(null,arguments);var a=Array.prototype.slice.call(arguments),s=r.get(o);s?s.args=a:(s=new kn(e,a),r.set(o,s),s.subscribe=t.subscribe,n&&(s.reportOrphan=function(){return r.delete(o)}));var u=s.recompute();return r.set(o,s),Ln.add(r),gn.hasValue()||(Ln.forEach(function(e){return e.clean()}),Ln.clear()),n?void 0:u}}return o.dirty=function(){var e=i.apply(null,arguments),t=void 0!==e&&r.get(e);t&&t.setDirty()},o}var Un=!1;function jn(){var e=!Un;return!0===fr("test")||(Un=!0),e}var $n=function(){function e(){}return e.prototype.ensureReady=function(){return Promise.resolve()},e.prototype.canBypassInit=function(){return!0},e.prototype.match=function(e,t,r){var n=r.store.get(e.id),i="ROOT_QUERY"===e.id;if(!n)return i;var o=n.__typename,a=void 0===o?i&&"Query":o;return a&&a===t||(jn(),"heuristic")},e}(),Qn=function(){function e(e){e&&e.introspectionQueryResultData?(this.possibleTypesMap=this.parseIntrospectionResult(e.introspectionQueryResultData),this.isReady=!0):this.isReady=!1,this.match=this.match.bind(this)}return e.prototype.match=function(e,t,r){yt(this.isReady,1);var n=r.store.get(e.id),i="ROOT_QUERY"===e.id;if(!n)return i;var o=n.__typename,a=void 0===o?i&&"Query":o;if(yt(a,2),a===t)return!0;var s=this.possibleTypesMap[t];return!!(a&&s&&s.indexOf(a)>-1)},e.prototype.parseIntrospectionResult=function(e){var t={};return e.__schema.types.forEach(function(e){"UNION"!==e.kind&&"INTERFACE"!==e.kind||(t[e.name]=e.possibleTypes.map(function(e){return e.name}))}),t},e}(),Vn=Object.prototype.hasOwnProperty,zn=function(){function e(e){var t=this;void 0===e&&(e=Object.create(null)),this.data=e,this.depend=Mn(function(e){return t.data[e]},{disposable:!0,makeCacheKey:function(e){return e}})}return e.prototype.toObject=function(){return this.data},e.prototype.get=function(e){return this.depend(e),this.data[e]},e.prototype.set=function(e,t){t!==this.data[e]&&(this.data[e]=t,this.depend.dirty(e))},e.prototype.delete=function(e){Vn.call(this.data,e)&&(delete this.data[e],this.depend.dirty(e))},e.prototype.clear=function(){this.replace(null)},e.prototype.replace=function(e){var t=this;e?(Object.keys(e).forEach(function(r){t.set(r,e[r])}),Object.keys(this.data).forEach(function(r){Vn.call(e,r)||t.delete(r)})):Object.keys(this.data).forEach(function(e){t.delete(e)})},e}();function Kn(e){return new zn(e)}var Gn=function(){function e(e){var t=this,r=void 0===e?{}:e,n=r.cacheKeyRoot,i=void 0===n?new Fn(ur):n,o=r.freezeResults,a=void 0!==o&&o,s=this,u=s.executeStoreQuery,c=s.executeSelectionSet,l=s.executeSubSelectedArray;this.freezeResults=a,this.executeStoreQuery=Mn(function(e){return u.call(t,e)},{makeCacheKey:function(e){var t=e.query,r=e.rootValue,n=e.contextValue,o=e.variableValues,a=e.fragmentMatcher;if(n.store instanceof zn)return i.lookup(n.store,t,a,JSON.stringify(o),r.id)}}),this.executeSelectionSet=Mn(function(e){return c.call(t,e)},{makeCacheKey:function(e){var t=e.selectionSet,r=e.rootValue,n=e.execContext;if(n.contextValue.store instanceof zn)return i.lookup(n.contextValue.store,t,n.fragmentMatcher,JSON.stringify(n.variableValues),r.id)}}),this.executeSubSelectedArray=Mn(function(e){return l.call(t,e)},{makeCacheKey:function(e){var t=e.field,r=e.array,n=e.execContext;if(n.contextValue.store instanceof zn)return i.lookup(n.contextValue.store,t,r,JSON.stringify(n.variableValues))}})}return e.prototype.readQueryFromStore=function(e){return this.diffQueryAgainstStore(nn(nn({},e),{returnPartialData:!1})).result},e.prototype.diffQueryAgainstStore=function(e){var t,r=e.store,n=e.query,i=e.variables,o=e.previousResult,a=e.returnPartialData,s=void 0===a||a,u=e.rootId,c=void 0===u?"ROOT_QUERY":u,l=e.fragmentMatcherFunction,h=e.config;i=zt({},Xt((yt((t=Gt(n))&&"query"===t.operation,6),t)),i);var f={store:r,dataIdFromObject:h&&h.dataIdFromObject,cacheRedirects:h&&h.cacheRedirects||{}},p=this.executeStoreQuery({query:n,rootValue:{type:"id",id:c,generated:!0,typename:"Query"},contextValue:f,variableValues:i,fragmentMatcher:l}),d=p.missing&&p.missing.length>0;return d&&!s&&p.missing.forEach(function(e){if(!e.tolerable)throw new mt(8)}),o&&_t(o,p.result)&&(p.result=o),{result:p.result,complete:!d}},e.prototype.executeStoreQuery=function(e){var t=e.query,r=e.rootValue,n=e.contextValue,i=e.variableValues,o=e.fragmentMatcher,a=void 0===o?Hn:o,s=Jt(t),u={query:t,fragmentMap:Yt(Ht(t)),contextValue:n,variableValues:i,fragmentMatcher:a};return this.executeSelectionSet({selectionSet:s.selectionSet,rootValue:r,execContext:u})},e.prototype.executeSelectionSet=function(e){var t=this,r=e.selectionSet,n=e.rootValue,i=e.execContext,o=i.fragmentMap,a=i.contextValue,s=i.variableValues,u={result:null},c=[],l=a.store.get(n.id),h=l&&l.__typename||"ROOT_QUERY"===n.id&&"Query"||void 0;function f(e){var t;return e.missing&&(u.missing=u.missing||[],(t=u.missing).push.apply(t,e.missing)),e.result}return r.selections.forEach(function(e){var r;if(Ut(e,s))if(Ft(e)){var u=f(t.executeField(l,h,e,i));void 0!==u&&c.push(((r={})[qt(e)]=u,r))}else{var p=void 0;if(Dt(e))p=e;else if(!(p=o[e.name.value]))throw new mt(9);var d=p.typeCondition&&p.typeCondition.name.value,m=!d||i.fragmentMatcher(n,d,a);if(m){var y=t.executeSelectionSet({selectionSet:p.selectionSet,rootValue:n,execContext:i});"heuristic"===m&&y.missing&&(y=nn(nn({},y),{missing:y.missing.map(function(e){return nn(nn({},e),{tolerable:!0})})})),c.push(f(y))}}}),u.result=vr(c),this.freezeResults,u},e.prototype.executeField=function(e,t,r,n){var i=n.variableValues,o=n.contextValue,a=function(e,t,r,n,i,o){var a=o.directives,s=r;(n||a)&&(s=Ct(s,n,a));var u,c=void 0;if(e&&void 0===(c=e[s])&&i.cacheRedirects&&"string"==typeof t){var l=i.cacheRedirects[t];if(l){var h=l[r];h&&(c=h(e,n,{getCacheKey:function(e){var t=i.dataIdFromObject(e);return t&&Lt({id:t,typename:e.__typename})}}))}}return void 0===c?{result:c,missing:[{object:e,fieldName:s,tolerable:!1}]}:(null!=(u=c)&&"object"==typeof u&&"json"===u.type&&(c=c.json),{result:c})}(e,t,r.name.value,Nt(r,i),o,{resultKey:qt(r),directives:Mt(r,i)});return Array.isArray(a.result)?this.combineExecResults(a,this.executeSubSelectedArray({field:r,array:a.result,execContext:n})):r.selectionSet?null==a.result?a:this.combineExecResults(a,this.executeSelectionSet({selectionSet:r.selectionSet,rootValue:a.result,execContext:n})):(Wn(r,a.result),this.freezeResults,a)},e.prototype.combineExecResults=function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return t.forEach(function(t){t.missing&&(e=e||[]).push.apply(e,t.missing)}),{result:t.pop().result,missing:e}},e.prototype.executeSubSelectedArray=function(e){var t,r=this,n=e.field,i=e.array,o=e.execContext;function a(e){return e.missing&&(t=t||[]).push.apply(t,e.missing),e.result}return i=i.map(function(e){return null===e?null:Array.isArray(e)?a(r.executeSubSelectedArray({field:n,array:e,execContext:o})):n.selectionSet?a(r.executeSelectionSet({selectionSet:n.selectionSet,rootValue:e,execContext:o})):(Wn(n,e),e)}),this.freezeResults,{result:i,missing:t}},e}();function Wn(e,t){if(!e.selectionSet&&Bt(t))throw new mt(10)}function Hn(){return!0}var Jn=function(){function e(e){void 0===e&&(e=Object.create(null)),this.data=e}return e.prototype.toObject=function(){return this.data},e.prototype.get=function(e){return this.data[e]},e.prototype.set=function(e,t){this.data[e]=t},e.prototype.delete=function(e){this.data[e]=void 0},e.prototype.clear=function(){this.data=Object.create(null)},e.prototype.replace=function(e){this.data=e||Object.create(null)},e}(),Yn=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="WriteError",t}return rn(t,e),t}(Error),Xn=function(){function e(){}return e.prototype.writeQueryToStore=function(e){var t=e.query,r=e.result,n=e.store,i=void 0===n?Kn():n,o=e.variables,a=e.dataIdFromObject,s=e.fragmentMatcherFunction;return this.writeResultToStore({dataId:"ROOT_QUERY",result:r,document:t,store:i,variables:o,dataIdFromObject:a,fragmentMatcherFunction:s})},e.prototype.writeResultToStore=function(e){var t=e.dataId,r=e.result,n=e.document,i=e.store,o=void 0===i?Kn():i,a=e.variables,s=e.dataIdFromObject,u=e.fragmentMatcherFunction,c=Gt(n);try{return this.writeSelectionSetToStore({result:r,dataId:t,selectionSet:c.selectionSet,context:{store:o,processedData:{},variables:zt({},Xt(c),a),dataIdFromObject:s,fragmentMap:Yt(Ht(n)),fragmentMatcherFunction:u}})}catch(e){throw function(e,t){var r=new Yn("Error writing result to store for query:\n "+JSON.stringify(t));return r.message+="\n"+e.message,r.stack=e.stack,r}(e,n)}},e.prototype.writeSelectionSetToStore=function(e){var t=this,r=e.result,n=e.dataId,i=e.selectionSet,o=e.context,a=o.variables,s=o.store,u=o.fragmentMap;return i.selections.forEach(function(e){var i;if(Ut(e,a))if(Ft(e)){var s=qt(e),c=r[s];if(void 0!==c)t.writeFieldToStore({dataId:n,value:c,field:e,context:o});else{var l=!1,h=!1;e.directives&&e.directives.length&&(l=e.directives.some(function(e){return e.name&&"defer"===e.name.value}),h=e.directives.some(function(e){return e.name&&"client"===e.name.value})),!l&&!h&&o.fragmentMatcherFunction}}else{var f=void 0;Dt(e)?f=e:yt(f=(u||{})[e.name.value],3);var p=!0;if(o.fragmentMatcherFunction&&f.typeCondition){var d=n||"self",m=Lt({id:d,typename:void 0}),y={store:new Jn((i={},i[d]=r,i)),cacheRedirects:{}},v=o.fragmentMatcherFunction(m,f.typeCondition.name.value,y);fr("production"),p=!!v}p&&t.writeSelectionSetToStore({result:r,selectionSet:f.selectionSet,dataId:n,context:o})}}),s},e.prototype.writeFieldToStore=function(e){var t,r,n,i=e.field,o=e.value,a=e.dataId,s=e.context,u=s.variables,c=s.dataIdFromObject,l=s.store,h=function(e,t){var r=null;e.directives&&(r={},e.directives.forEach(function(e){r[e.name.value]={},e.arguments&&e.arguments.forEach(function(n){var i=n.name,o=n.value;return At(r[e.name.value],i,o,t)})}));var n=null;return e.arguments&&e.arguments.length&&(n={},e.arguments.forEach(function(e){var r=e.name,i=e.value;return At(n,r,i,t)})),Ct(e.name.value,n,r)}(i,u);if(i.selectionSet&&null!==o)if(Array.isArray(o)){var f=a+"."+h;r=this.processArrayValue(o,f,i.selectionSet,s)}else{var p=a+"."+h,d=!0;if(Zn(p)||(p="$"+p),c){var m=c(o);yt(!m||!Zn(m),4),(m||"number"==typeof m&&0===m)&&(p=m,d=!1)}ti(p,i,s.processedData)||this.writeSelectionSetToStore({dataId:p,result:o,selectionSet:i.selectionSet,context:s});var y=o.__typename;r=Lt({id:p,typename:y},d);var v=(n=l.get(a))&&n[h];if(v!==r&&Bt(v)){var g=void 0!==v.typename,b=void 0!==y,w=g&&b&&v.typename!==y;yt(!d||v.generated||w,5),yt(!g||b,6),v.generated&&(w?d||l.delete(v.id):ei(v.id,r.id,l))}}else r=null!=o&&"object"==typeof o?{type:"json",json:o}:o;(n=l.get(a))&&_t(r,n[h])||l.set(a,nn(nn({},n),((t={})[h]=r,t)))},e.prototype.processArrayValue=function(e,t,r,n){var i=this;return e.map(function(e,o){if(null===e)return null;var a=t+"."+o;if(Array.isArray(e))return i.processArrayValue(e,a,r,n);var s=!0;if(n.dataIdFromObject){var u=n.dataIdFromObject(e);u&&(a=u,s=!1)}return ti(a,r,n.processedData)||i.writeSelectionSetToStore({dataId:a,result:e,selectionSet:r,context:n}),Lt({id:a,typename:e.__typename},s)})},e}();function Zn(e){return"$"===e[0]}function ei(e,t,r){if(e===t)return!1;var n=r.get(e),i=r.get(t),o=!1;Object.keys(n).forEach(function(e){var t=n[e],a=i[e];Bt(t)&&Zn(t.id)&&Bt(a)&&!_t(t,a)&&ei(t.id,a.id,r)&&(o=!0)}),r.delete(e);var a=nn(nn({},n),i);return _t(a,i)?o:(r.set(t,a),!0)}function ti(e,t,r){if(!r)return!1;if(r[e]){if(r[e].indexOf(t)>=0)return!0;r[e].push(t)}else r[e]=[t];return!1}var ri={fragmentMatcher:new $n,dataIdFromObject:ni,addTypename:!0,resultCaching:!0,freezeResults:!1};function ni(e){if(e.__typename){if(void 0!==e.id)return e.__typename+":"+e.id;if(void 0!==e._id)return e.__typename+":"+e._id}return null}var ii=Object.prototype.hasOwnProperty,oi=function(e){function t(t,r,n){var i=e.call(this,Object.create(null))||this;return i.optimisticId=t,i.parent=r,i.transaction=n,i}return rn(t,e),t.prototype.toObject=function(){return nn(nn({},this.parent.toObject()),this.data)},t.prototype.get=function(e){return ii.call(this.data,e)?this.data[e]:this.parent.get(e)},t}(Jn),ai=function(e){function t(t){void 0===t&&(t={});var r=e.call(this)||this;r.watches=new Set,r.typenameDocumentCache=new Map,r.cacheKeyRoot=new Fn(ur),r.silenceBroadcast=!1,r.config=nn(nn({},ri),t),r.config.customResolvers&&(r.config.cacheRedirects=r.config.customResolvers),r.config.cacheResolvers&&(r.config.cacheRedirects=r.config.cacheResolvers),r.addTypename=!!r.config.addTypename,r.data=r.config.resultCaching?new zn:new Jn,r.optimisticData=r.data,r.storeWriter=new Xn,r.storeReader=new Gn({cacheKeyRoot:r.cacheKeyRoot,freezeResults:t.freezeResults});var n=r,i=n.maybeBroadcastWatch;return r.maybeBroadcastWatch=Mn(function(e){return i.call(r,e)},{makeCacheKey:function(e){if(!e.optimistic&&!e.previousResult)return n.data instanceof zn?n.cacheKeyRoot.lookup(e.query,JSON.stringify(e.variables)):void 0}}),r}return rn(t,e),t.prototype.restore=function(e){return e&&this.data.replace(e),this},t.prototype.extract=function(e){return void 0===e&&(e=!1),(e?this.optimisticData:this.data).toObject()},t.prototype.read=function(e){if("string"==typeof e.rootId&&void 0===this.data.get(e.rootId))return null;var t=this.config.fragmentMatcher,r=t&&t.match;return this.storeReader.readQueryFromStore({store:e.optimistic?this.optimisticData:this.data,query:this.transformDocument(e.query),variables:e.variables,rootId:e.rootId,fragmentMatcherFunction:r,previousResult:e.previousResult,config:this.config})||null},t.prototype.write=function(e){var t=this.config.fragmentMatcher,r=t&&t.match;this.storeWriter.writeResultToStore({dataId:e.dataId,result:e.result,variables:e.variables,document:this.transformDocument(e.query),store:this.data,dataIdFromObject:this.config.dataIdFromObject,fragmentMatcherFunction:r}),this.broadcastWatches()},t.prototype.diff=function(e){var t=this.config.fragmentMatcher,r=t&&t.match;return this.storeReader.diffQueryAgainstStore({store:e.optimistic?this.optimisticData:this.data,query:this.transformDocument(e.query),variables:e.variables,returnPartialData:e.returnPartialData,previousResult:e.previousResult,fragmentMatcherFunction:r,config:this.config})},t.prototype.watch=function(e){var t=this;return this.watches.add(e),function(){t.watches.delete(e)}},t.prototype.evict=function(e){throw new mt(7)},t.prototype.reset=function(){return this.data.clear(),this.broadcastWatches(),Promise.resolve()},t.prototype.removeOptimistic=function(e){for(var t=[],r=0,n=this.optimisticData;n instanceof oi;)n.optimisticId===e?++r:t.push(n),n=n.parent;if(r>0){for(this.optimisticData=n;t.length>0;){var i=t.pop();this.performTransaction(i.transaction,i.optimisticId)}this.broadcastWatches()}},t.prototype.performTransaction=function(e,t){var r=this.data,n=this.silenceBroadcast;this.silenceBroadcast=!0,"string"==typeof t&&(this.data=this.optimisticData=new oi(t,this.optimisticData,e));try{e(this)}finally{this.silenceBroadcast=n,this.data=r}this.broadcastWatches()},t.prototype.recordOptimisticTransaction=function(e,t){return this.performTransaction(e,t)},t.prototype.transformDocument=function(e){if(this.addTypename){var t=this.typenameDocumentCache.get(e);return t||(r=e,t=(0,lt.visit)(Kt(r),{SelectionSet:{enter:function(e,t,r){if(!r||"OperationDefinition"!==r.kind){var n=e.selections;if(n&&!n.some(function(e){return Ft(e)&&("__typename"===e.name.value||0===e.name.value.lastIndexOf("__",0))})){var i=r;if(!(Ft(i)&&i.directives&&i.directives.some(function(e){return"export"===e.name.value})))return bt(bt({},e),{selections:wt(n,[er])})}}}}}),this.typenameDocumentCache.set(e,t),this.typenameDocumentCache.set(t,t)),t}var r;return e},t.prototype.broadcastWatches=function(){var e=this;this.silenceBroadcast||this.watches.forEach(function(t){return e.maybeBroadcastWatch(t)})},t.prototype.maybeBroadcastWatch=function(e){e.callback(this.diff({query:e.query,variables:e.variables,previousResult:e.previousResult&&e.previousResult(),optimistic:e.optimistic}))},t}(cn),si=function(e,t){return si=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},si(e,t)},ui=function(){return ui=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},ui.apply(this,arguments)},ci=function(){return ci=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},ci.apply(this,arguments)},li=u(3230),hi={http:{includeQuery:!0,includeExtensions:!1},headers:{accept:"*/*","content-type":"application/json"},options:{method:"POST"}},fi=function(e,t,r){var n=new Error(r);throw n.name="ServerError",n.response=e,n.statusCode=e.status,n.result=t,n},pi=function(e,t){var r;try{r=JSON.stringify(e)}catch(e){var n=new mt(2);throw n.parseError=e,n}return r},di=function(e){void 0===e&&(e={});var t=e.uri,r=void 0===t?"/graphql":t,n=e.fetch,i=e.includeExtensions,o=e.useGETForQueries,a=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r}(e,["uri","fetch","includeExtensions","useGETForQueries"]);!function(e){if(!e&&"undefined"==typeof fetch)throw new mt(1)}(n),n||(n=fetch);var s={http:{includeExtensions:i},options:a.fetchOptions,credentials:a.credentials,headers:a.headers};return new qr(function(e){var t=function(e,t){return e.getContext().uri||("function"==typeof t?t(e):t||"/graphql")}(e,r),i=e.getContext(),a={};if(i.clientAwareness){var u=i.clientAwareness,c=u.name,l=u.version;c&&(a["apollographql-client-name"]=c),l&&(a["apollographql-client-version"]=l)}var h,f=ui({},a,i.headers),p={http:i.http,options:i.fetchOptions,credentials:i.credentials,headers:f},d=function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var i=ci({},t.options,{headers:t.headers,credentials:t.credentials}),o=t.http;r.forEach(function(e){i=ci({},i,e.options,{headers:ci({},i.headers,e.headers)}),e.credentials&&(i.credentials=e.credentials),o=ci({},o,e.http)});var a=e.operationName,s=e.extensions,u=e.variables,c=e.query,l={operationName:a,variables:u};return o.includeExtensions&&(l.extensions=s),o.includeQuery&&(l.query=(0,li.y)(c)),{options:i,body:l}}(e,hi,s,p),m=d.options,y=d.body;if(!m.signal){var v=function(){if("undefined"==typeof AbortController)return{controller:!1,signal:!1};var e=new AbortController;return{controller:e,signal:e.signal}}(),g=v.controller,b=v.signal;(h=g)&&(m.signal=b)}if(o&&!e.query.definitions.some(function(e){return"OperationDefinition"===e.kind&&"mutation"===e.operation})&&(m.method="GET"),"GET"===m.method){var w=function(e,t){var r=[],n=function(e,t){r.push(e+"="+encodeURIComponent(t))};if("query"in t&&n("query",t.query),t.operationName&&n("operationName",t.operationName),t.variables){var i=void 0;try{i=pi(t.variables)}catch(e){return{parseError:e}}n("variables",i)}if(t.extensions){var o=void 0;try{o=pi(t.extensions)}catch(e){return{parseError:e}}n("extensions",o)}var a="",s=e,u=e.indexOf("#");-1!==u&&(a=e.substr(u),s=e.substr(0,u));var c=-1===s.indexOf("?")?"?":"&";return{newURI:s+c+r.join("&")+a}}(t,y),R=w.newURI,E=w.parseError;if(E)return _r(E);t=R}else try{m.body=pi(y)}catch(E){return _r(E)}return new Er(function(r){var i;return n(t,m).then(function(t){return e.setContext({response:t}),t}).then((i=e,function(e){return e.text().then(function(t){try{return JSON.parse(t)}catch(n){var r=n;return r.name="ServerParseError",r.response=e,r.statusCode=e.status,r.bodyText=t,Promise.reject(r)}}).then(function(t){return e.status>=300&&fi(e,t,"Response not successful: Received status code "+e.status),Array.isArray(t)||t.hasOwnProperty("data")||t.hasOwnProperty("errors")||fi(e,t,"Server response was missing for query '"+(Array.isArray(i)?i.map(function(e){return e.operationName}):i.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(){h&&h.abort()}})})};!function(e){!function(e,t){function r(){this.constructor=e}si(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}(function(t){return e.call(this,di(t).request)||this},e)}(qr);var mi=u(8244),yi=u.n(mi),vi=function(){return vi=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},vi.apply(this,arguments)};function gi(e,t){if(!Boolean(e))throw new Error(t)}function bi(e){return bi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},bi(e)}Object.create,Object.create,"function"==typeof SuppressedError&&SuppressedError,"function"==typeof Symbol&&null!=Symbol.iterator&&Symbol.iterator,"function"==typeof Symbol&&null!=Symbol.asyncIterator&&Symbol.asyncIterator;var wi="function"==typeof Symbol&&null!=Symbol.toStringTag?Symbol.toStringTag:"@@toStringTag";function Ri(e,t){for(var r,n=/\r\n|[\n\r]/g,i=1,o=t+1;(r=n.exec(e.body))&&r.index<t;)i+=1,o=t+1-(r.index+r[0].length);return{line:i,column:o}}function Ei(e){return ki(e.source,Ri(e.source,e.start))}function ki(e,t){var r=e.locationOffset.column-1,n=xi(r)+e.body,i=t.line-1,o=e.locationOffset.line-1,a=t.line+o,s=1===t.line?r:0,u=t.column+s,c="".concat(e.name,":").concat(a,":").concat(u,"\n"),l=n.split(/\r\n|[\n\r]/g),h=l[i];if(h.length>120){for(var f=Math.floor(u/80),p=u%80,d=[],m=0;m<h.length;m+=80)d.push(h.slice(m,m+80));return c+Oi([["".concat(a),d[0]]].concat(d.slice(1,f+1).map(function(e){return["",e]}),[[" ",xi(p-1)+"^"],["",d[f+1]]]))}return c+Oi([["".concat(a-1),l[i-1]],["".concat(a),h],["",xi(u-1)+"^"],["".concat(a+1),l[i+1]]])}function Oi(e){var t=e.filter(function(e){return e[0],void 0!==e[1]}),r=Math.max.apply(Math,t.map(function(e){return e[0].length}));return t.map(function(e){var t,n=e[0],i=e[1];return xi(r-(t=n).length)+t+(i?" | "+i:" |")}).join("\n")}function xi(e){return Array(e+1).join(" ")}function Si(e){return Si="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Si(e)}function _i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function Ii(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ti(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Ai(e,t){return!t||"object"!==Si(t)&&"function"!=typeof t?Pi(e):t}function Pi(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ci(e){var t="function"==typeof Map?new Map:void 0;return Ci=function(e){if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return Ni(e,arguments,Di(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),Fi(n,e)},Ci(e)}function Ni(e,t,r){return Ni=qi()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var i=new(Function.bind.apply(e,n));return r&&Fi(i,r.prototype),i},Ni.apply(null,arguments)}function qi(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}function Fi(e,t){return Fi=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Fi(e,t)}function Di(e){return Di=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Di(e)}var Bi=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Fi(e,t)}(a,e);var t,r,n,i,o=(t=a,r=qi(),function(){var e,n=Di(t);if(r){var i=Di(this).constructor;e=Reflect.construct(n,arguments,i)}else e=n.apply(this,arguments);return Ai(this,e)});function a(e,t,r,n,i,s,u){var c,l,h,f;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(f=o.call(this,e)).name="GraphQLError",f.originalError=null!=s?s:void 0,f.nodes=Li(Array.isArray(t)?t:t?[t]:void 0);for(var p=[],d=0,m=null!==(y=f.nodes)&&void 0!==y?y:[];d<m.length;d++){var y,v=m[d].loc;null!=v&&p.push(v)}p=Li(p),f.source=null!=r?r:null===(c=p)||void 0===c?void 0:c[0].source,f.positions=null!=n?n:null===(l=p)||void 0===l?void 0:l.map(function(e){return e.start}),f.locations=n&&r?n.map(function(e){return Ri(r,e)}):null===(h=p)||void 0===h?void 0:h.map(function(e){return Ri(e.source,e.start)}),f.path=null!=i?i:void 0;var g,b=null==s?void 0:s.extensions;return null==u&&"object"==bi(g=b)&&null!==g?f.extensions=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?_i(Object(r),!0).forEach(function(t){Ii(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_i(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}({},b):f.extensions=null!=u?u:{},Object.defineProperties(Pi(f),{message:{enumerable:!0},locations:{enumerable:null!=f.locations},path:{enumerable:null!=f.path},extensions:{enumerable:null!=f.extensions&&Object.keys(f.extensions).length>0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),null!=s&&s.stack?(Object.defineProperty(Pi(f),"stack",{value:s.stack,writable:!0,configurable:!0}),Ai(f)):(Error.captureStackTrace?Error.captureStackTrace(Pi(f),a):Object.defineProperty(Pi(f),"stack",{value:Error().stack,writable:!0,configurable:!0}),f)}return n=a,(i=[{key:"toString",value:function(){return function(e){var t=e.message;if(e.nodes)for(var r=0,n=e.nodes;r<n.length;r++){var i=n[r];i.loc&&(t+="\n\n"+Ei(i.loc))}else if(e.source&&e.locations)for(var o=0,a=e.locations;o<a.length;o++){var s=a[o];t+="\n\n"+ki(e.source,s)}return t}(this)}},{key:"toJSON",value:function(){return function(e){var t;e||gi(0,"Received null or undefined error.");var r=null!==(t=e.message)&&void 0!==t?t:"An unknown error occurred.",n=e.locations,i=e.path,o=e.extensions;return o&&Object.keys(o).length>0?{message:r,locations:n,path:i,extensions:o}:{message:r,locations:n,path:i}}(this)}},{key:wi,get:function(){return"Object"}}])&&Ti(n.prototype,i),a}(Ci(Error));function Li(e){return void 0===e||0===e.length?void 0:e}function Mi(e,t,r){return new Bi("Syntax Error: ".concat(r),void 0,e,[t])}var Ui=Object.freeze({NAME:"Name",DOCUMENT:"Document",OPERATION_DEFINITION:"OperationDefinition",VARIABLE_DEFINITION:"VariableDefinition",SELECTION_SET:"SelectionSet",FIELD:"Field",ARGUMENT:"Argument",FRAGMENT_SPREAD:"FragmentSpread",INLINE_FRAGMENT:"InlineFragment",FRAGMENT_DEFINITION:"FragmentDefinition",VARIABLE:"Variable",INT:"IntValue",FLOAT:"FloatValue",STRING:"StringValue",BOOLEAN:"BooleanValue",NULL:"NullValue",ENUM:"EnumValue",LIST:"ListValue",OBJECT:"ObjectValue",OBJECT_FIELD:"ObjectField",DIRECTIVE:"Directive",NAMED_TYPE:"NamedType",LIST_TYPE:"ListType",NON_NULL_TYPE:"NonNullType",SCHEMA_DEFINITION:"SchemaDefinition",OPERATION_TYPE_DEFINITION:"OperationTypeDefinition",SCALAR_TYPE_DEFINITION:"ScalarTypeDefinition",OBJECT_TYPE_DEFINITION:"ObjectTypeDefinition",FIELD_DEFINITION:"FieldDefinition",INPUT_VALUE_DEFINITION:"InputValueDefinition",INTERFACE_TYPE_DEFINITION:"InterfaceTypeDefinition",UNION_TYPE_DEFINITION:"UnionTypeDefinition",ENUM_TYPE_DEFINITION:"EnumTypeDefinition",ENUM_VALUE_DEFINITION:"EnumValueDefinition",INPUT_OBJECT_TYPE_DEFINITION:"InputObjectTypeDefinition",DIRECTIVE_DEFINITION:"DirectiveDefinition",SCHEMA_EXTENSION:"SchemaExtension",SCALAR_TYPE_EXTENSION:"ScalarTypeExtension",OBJECT_TYPE_EXTENSION:"ObjectTypeExtension",INTERFACE_TYPE_EXTENSION:"InterfaceTypeExtension",UNION_TYPE_EXTENSION:"UnionTypeExtension",ENUM_TYPE_EXTENSION:"EnumTypeExtension",INPUT_OBJECT_TYPE_EXTENSION:"InputObjectTypeExtension"});const ji="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):void 0;function $i(e){var t=e.prototype.toJSON;"function"==typeof t||function(){if(!Boolean(0))throw new Error("Unexpected invariant triggered.")}(),e.prototype.inspect=t,ji&&(e.prototype[ji]=t)}var Qi=function(){function e(e,t,r){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=r}return e.prototype.toJSON=function(){return{start:this.start,end:this.end}},e}();$i(Qi);var Vi=function(){function e(e,t,r,n,i,o,a){this.kind=e,this.start=t,this.end=r,this.line=n,this.column=i,this.value=a,this.prev=o,this.next=null}return e.prototype.toJSON=function(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}},e}();$i(Vi);var zi=Object.freeze({SOF:"<SOF>",EOF:"<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"});function Ki(e){return Ki="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ki(e)}function Gi(e,t){switch(Ki(e)){case"string":return JSON.stringify(e);case"function":return e.name?"[function ".concat(e.name,"]"):"[function]";case"object":return null===e?"null":function(e,t){if(-1!==t.indexOf(e))return"[Circular]";var r=[].concat(t,[e]),n=function(e){var t=e[String(ji)];return"function"==typeof t?t:"function"==typeof e.inspect?e.inspect:void 0}(e);if(void 0!==n){var i=n.call(e);if(i!==e)return"string"==typeof i?i:Gi(i,r)}else if(Array.isArray(e))return function(e,t){if(0===e.length)return"[]";if(t.length>2)return"[Array]";for(var r=Math.min(10,e.length),n=e.length-r,i=[],o=0;o<r;++o)i.push(Gi(e[o],t));return 1===n?i.push("... 1 more item"):n>1&&i.push("... ".concat(n," more items")),"["+i.join(", ")+"]"}(e,r);return function(e,t){var r=Object.keys(e);return 0===r.length?"{}":t.length>2?"["+function(e){var t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){var r=e.constructor.name;if("string"==typeof r&&""!==r)return r}return t}(e)+"]":"{ "+r.map(function(r){return r+": "+Gi(e[r],t)}).join(", ")+" }"}(e,r)}(e,t);default:return String(e)}}function Wi(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var Hi=function(){function e(e){var t=arguments.length>1&&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||gi(0,"Body must be a string. Received: ".concat(Gi(e,[]),".")),this.body=e,this.name=t,this.locationOffset=r,this.locationOffset.line>0||gi(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||gi(0,"column in locationOffset is 1-indexed and must be positive.")}var t,r;return t=e,(r=[{key:wi,get:function(){return"Source"}}])&&Wi(t.prototype,r),e}(),Ji=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"});function Yi(e){var t=e.split(/\r\n|[\n\r]/g),r=function(e){for(var t,r=!0,n=!0,i=0,o=null,a=0;a<e.length;++a)switch(e.charCodeAt(a)){case 13:10===e.charCodeAt(a+1)&&++a;case 10:r=!1,n=!0,i=0;break;case 9:case 32:++i;break;default:n&&!r&&(null===o||i<o)&&(o=i),n=!1}return null!==(t=o)&&void 0!==t?t:0}(e);if(0!==r)for(var n=1;n<t.length;n++)t[n]=t[n].slice(r);for(var i=0;i<t.length&&Xi(t[i]);)++i;for(var o=t.length;o>i&&Xi(t[o-1]);)--o;return t.slice(i,o).join("\n")}function Xi(e){for(var t=0;t<e.length;++t)if(" "!==e[t]&&"\t"!==e[t])return!1;return!0}var Zi=function(){function e(e){var t=new Vi(zi.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!==zi.EOF)do{var t;e=null!==(t=e.next)&&void 0!==t?t:e.next=to(this,e)}while(e.kind===zi.COMMENT);return e},e}();function eo(e){return isNaN(e)?zi.EOF:e<127?JSON.stringify(String.fromCharCode(e)):'"\\u'.concat(("00"+e.toString(16).toUpperCase()).slice(-4),'"')}function to(e,t){for(var r=e.source,n=r.body,i=n.length,o=t.end;o<i;){var a=n.charCodeAt(o),s=e.line,u=1+o-e.lineStart;switch(a){case 65279:case 9:case 32:case 44:++o;continue;case 10:++o,++e.line,e.lineStart=o;continue;case 13:10===n.charCodeAt(o+1)?o+=2:++o,++e.line,e.lineStart=o;continue;case 33:return new Vi(zi.BANG,o,o+1,s,u,t);case 35:return no(r,o,s,u,t);case 36:return new Vi(zi.DOLLAR,o,o+1,s,u,t);case 38:return new Vi(zi.AMP,o,o+1,s,u,t);case 40:return new Vi(zi.PAREN_L,o,o+1,s,u,t);case 41:return new Vi(zi.PAREN_R,o,o+1,s,u,t);case 46:if(46===n.charCodeAt(o+1)&&46===n.charCodeAt(o+2))return new Vi(zi.SPREAD,o,o+3,s,u,t);break;case 58:return new Vi(zi.COLON,o,o+1,s,u,t);case 61:return new Vi(zi.EQUALS,o,o+1,s,u,t);case 64:return new Vi(zi.AT,o,o+1,s,u,t);case 91:return new Vi(zi.BRACKET_L,o,o+1,s,u,t);case 93:return new Vi(zi.BRACKET_R,o,o+1,s,u,t);case 123:return new Vi(zi.BRACE_L,o,o+1,s,u,t);case 124:return new Vi(zi.PIPE,o,o+1,s,u,t);case 125:return new Vi(zi.BRACE_R,o,o+1,s,u,t);case 34:return 34===n.charCodeAt(o+1)&&34===n.charCodeAt(o+2)?so(r,o,s,u,t,e):ao(r,o,s,u,t);case 45:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return io(r,o,a,s,u,t);case 65:case 66:case 67:case 68:case 69:case 70:case 71:case 72:case 73:case 74:case 75:case 76:case 77:case 78:case 79:case 80:case 81:case 82:case 83:case 84:case 85:case 86:case 87:case 88:case 89:case 90:case 95:case 97:case 98:case 99:case 100:case 101:case 102:case 103:case 104:case 105:case 106:case 107:case 108:case 109:case 110:case 111:case 112:case 113:case 114:case 115:case 116:case 117:case 118:case 119:case 120:case 121:case 122:return lo(r,o,s,u,t)}throw Mi(r,o,ro(a))}var c=e.line,l=1+o-e.lineStart;return new Vi(zi.EOF,i,i,c,l,t)}function ro(e){return e<32&&9!==e&&10!==e&&13!==e?"Cannot contain the invalid character ".concat(eo(e),"."):39===e?"Unexpected single quote character ('), did you mean to use a double quote (\")?":"Cannot parse the unexpected character ".concat(eo(e),".")}function no(e,t,r,n,i){var o,a=e.body,s=t;do{o=a.charCodeAt(++s)}while(!isNaN(o)&&(o>31||9===o));return new Vi(zi.COMMENT,t,s,r,n,i,a.slice(t+1,s))}function io(e,t,r,n,i,o){var a=e.body,s=r,u=t,c=!1;if(45===s&&(s=a.charCodeAt(++u)),48===s){if((s=a.charCodeAt(++u))>=48&&s<=57)throw Mi(e,u,"Invalid number, unexpected digit after 0: ".concat(eo(s),"."))}else u=oo(e,u,s),s=a.charCodeAt(u);if(46===s&&(c=!0,s=a.charCodeAt(++u),u=oo(e,u,s),s=a.charCodeAt(u)),69!==s&&101!==s||(c=!0,43!==(s=a.charCodeAt(++u))&&45!==s||(s=a.charCodeAt(++u)),u=oo(e,u,s),s=a.charCodeAt(u)),46===s||function(e){return 95===e||e>=65&&e<=90||e>=97&&e<=122}(s))throw Mi(e,u,"Invalid number, expected digit but got: ".concat(eo(s),"."));return new Vi(c?zi.FLOAT:zi.INT,t,u,n,i,o,a.slice(t,u))}function oo(e,t,r){var n=e.body,i=t,o=r;if(o>=48&&o<=57){do{o=n.charCodeAt(++i)}while(o>=48&&o<=57);return i}throw Mi(e,i,"Invalid number, expected digit but got: ".concat(eo(o),"."))}function ao(e,t,r,n,i){for(var o=e.body,a=t+1,s=a,u=0,c="";a<o.length&&!isNaN(u=o.charCodeAt(a))&&10!==u&&13!==u;){if(34===u)return c+=o.slice(s,a),new Vi(zi.STRING,t,a+1,r,n,i,c);if(u<32&&9!==u)throw Mi(e,a,"Invalid character within String: ".concat(eo(u),"."));if(++a,92===u){switch(c+=o.slice(s,a-1),u=o.charCodeAt(a)){case 34:c+='"';break;case 47:c+="/";break;case 92:c+="\\";break;case 98:c+="\b";break;case 102:c+="\f";break;case 110:c+="\n";break;case 114:c+="\r";break;case 116:c+="\t";break;case 117:var l=uo(o.charCodeAt(a+1),o.charCodeAt(a+2),o.charCodeAt(a+3),o.charCodeAt(a+4));if(l<0){var h=o.slice(a+1,a+5);throw Mi(e,a,"Invalid character escape sequence: \\u".concat(h,"."))}c+=String.fromCharCode(l),a+=4;break;default:throw Mi(e,a,"Invalid character escape sequence: \\".concat(String.fromCharCode(u),"."))}s=++a}}throw Mi(e,a,"Unterminated string.")}function so(e,t,r,n,i,o){for(var a=e.body,s=t+3,u=s,c=0,l="";s<a.length&&!isNaN(c=a.charCodeAt(s));){if(34===c&&34===a.charCodeAt(s+1)&&34===a.charCodeAt(s+2))return l+=a.slice(u,s),new Vi(zi.BLOCK_STRING,t,s+3,r,n,i,Yi(l));if(c<32&&9!==c&&10!==c&&13!==c)throw Mi(e,s,"Invalid character within String: ".concat(eo(c),"."));10===c?(++s,++o.line,o.lineStart=s):13===c?(10===a.charCodeAt(s+1)?s+=2:++s,++o.line,o.lineStart=s):92===c&&34===a.charCodeAt(s+1)&&34===a.charCodeAt(s+2)&&34===a.charCodeAt(s+3)?(l+=a.slice(u,s)+'"""',u=s+=4):++s}throw Mi(e,s,"Unterminated string.")}function uo(e,t,r,n){return co(e)<<12|co(t)<<8|co(r)<<4|co(n)}function co(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function lo(e,t,r,n,i){for(var o=e.body,a=o.length,s=t+1,u=0;s!==a&&!isNaN(u=o.charCodeAt(s))&&(95===u||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122);)++s;return new Vi(zi.NAME,t,s,r,n,i,o.slice(t,s))}var ho=function(){function e(e,t){var r=function(e){return e instanceof Hi}(e)?e:new Hi(e);this._lexer=new Zi(r),this._options=t}var t=e.prototype;return t.parseName=function(){var e=this.expectToken(zi.NAME);return{kind:Ui.NAME,value:e.value,loc:this.loc(e)}},t.parseDocument=function(){var e=this._lexer.token;return{kind:Ui.DOCUMENT,definitions:this.many(zi.SOF,this.parseDefinition,zi.EOF),loc:this.loc(e)}},t.parseDefinition=function(){if(this.peek(zi.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(zi.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(zi.BRACE_L))return{kind:Ui.OPERATION_DEFINITION,operation:"query",name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet(),loc:this.loc(e)};var t,r=this.parseOperationType();return this.peek(zi.NAME)&&(t=this.parseName()),{kind:Ui.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(zi.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(zi.PAREN_L,this.parseVariableDefinition,zi.PAREN_R)},t.parseVariableDefinition=function(){var e=this._lexer.token;return{kind:Ui.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(zi.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(zi.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(zi.DOLLAR),{kind:Ui.VARIABLE,name:this.parseName(),loc:this.loc(e)}},t.parseSelectionSet=function(){var e=this._lexer.token;return{kind:Ui.SELECTION_SET,selections:this.many(zi.BRACE_L,this.parseSelection,zi.BRACE_R),loc:this.loc(e)}},t.parseSelection=function(){return this.peek(zi.SPREAD)?this.parseFragment():this.parseField()},t.parseField=function(){var e,t,r=this._lexer.token,n=this.parseName();return this.expectOptionalToken(zi.COLON)?(e=n,t=this.parseName()):t=n,{kind:Ui.FIELD,alias:e,name:t,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(zi.BRACE_L)?this.parseSelectionSet():void 0,loc:this.loc(r)}},t.parseArguments=function(e){var t=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(zi.PAREN_L,t,zi.PAREN_R)},t.parseArgument=function(){var e=this._lexer.token,t=this.parseName();return this.expectToken(zi.COLON),{kind:Ui.ARGUMENT,name:t,value:this.parseValueLiteral(!1),loc:this.loc(e)}},t.parseConstArgument=function(){var e=this._lexer.token;return{kind:Ui.ARGUMENT,name:this.parseName(),value:(this.expectToken(zi.COLON),this.parseValueLiteral(!0)),loc:this.loc(e)}},t.parseFragment=function(){var e=this._lexer.token;this.expectToken(zi.SPREAD);var t=this.expectOptionalKeyword("on");return!t&&this.peek(zi.NAME)?{kind:Ui.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1),loc:this.loc(e)}:{kind:Ui.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:Ui.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:Ui.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 zi.BRACKET_L:return this.parseList(e);case zi.BRACE_L:return this.parseObject(e);case zi.INT:return this._lexer.advance(),{kind:Ui.INT,value:t.value,loc:this.loc(t)};case zi.FLOAT:return this._lexer.advance(),{kind:Ui.FLOAT,value:t.value,loc:this.loc(t)};case zi.STRING:case zi.BLOCK_STRING:return this.parseStringLiteral();case zi.NAME:switch(this._lexer.advance(),t.value){case"true":return{kind:Ui.BOOLEAN,value:!0,loc:this.loc(t)};case"false":return{kind:Ui.BOOLEAN,value:!1,loc:this.loc(t)};case"null":return{kind:Ui.NULL,loc:this.loc(t)};default:return{kind:Ui.ENUM,value:t.value,loc:this.loc(t)}}case zi.DOLLAR:if(!e)return this.parseVariable()}throw this.unexpected()},t.parseStringLiteral=function(){var e=this._lexer.token;return this._lexer.advance(),{kind:Ui.STRING,value:e.value,block:e.kind===zi.BLOCK_STRING,loc:this.loc(e)}},t.parseList=function(e){var t=this,r=this._lexer.token;return{kind:Ui.LIST,values:this.any(zi.BRACKET_L,function(){return t.parseValueLiteral(e)},zi.BRACKET_R),loc:this.loc(r)}},t.parseObject=function(e){var t=this,r=this._lexer.token;return{kind:Ui.OBJECT,fields:this.any(zi.BRACE_L,function(){return t.parseObjectField(e)},zi.BRACE_R),loc:this.loc(r)}},t.parseObjectField=function(e){var t=this._lexer.token,r=this.parseName();return this.expectToken(zi.COLON),{kind:Ui.OBJECT_FIELD,name:r,value:this.parseValueLiteral(e),loc:this.loc(t)}},t.parseDirectives=function(e){for(var t=[];this.peek(zi.AT);)t.push(this.parseDirective(e));return t},t.parseDirective=function(e){var t=this._lexer.token;return this.expectToken(zi.AT),{kind:Ui.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e),loc:this.loc(t)}},t.parseTypeReference=function(){var e,t=this._lexer.token;return this.expectOptionalToken(zi.BRACKET_L)?(e=this.parseTypeReference(),this.expectToken(zi.BRACKET_R),e={kind:Ui.LIST_TYPE,type:e,loc:this.loc(t)}):e=this.parseNamedType(),this.expectOptionalToken(zi.BANG)?{kind:Ui.NON_NULL_TYPE,type:e,loc:this.loc(t)}:e},t.parseNamedType=function(){var e=this._lexer.token;return{kind:Ui.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===zi.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(zi.STRING)||this.peek(zi.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(zi.BRACE_L,this.parseOperationTypeDefinition,zi.BRACE_R);return{kind:Ui.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(zi.COLON);var r=this.parseNamedType();return{kind:Ui.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:Ui.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),o=this.parseFieldsDefinition();return{kind:Ui.OBJECT_TYPE_DEFINITION,description:t,name:r,interfaces:n,directives:i,fields:o,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(zi.AMP);do{t.push(this.parseNamedType())}while(this.expectOptionalToken(zi.AMP)||this.peek(zi.NAME));return t}return this.delimitedMany(zi.AMP,this.parseNamedType)},t.parseFieldsDefinition=function(){var e;return!0===(null===(e=this._options)||void 0===e?void 0:e.allowLegacySDLEmptyFields)&&this.peek(zi.BRACE_L)&&this._lexer.lookahead().kind===zi.BRACE_R?(this._lexer.advance(),this._lexer.advance(),[]):this.optionalMany(zi.BRACE_L,this.parseFieldDefinition,zi.BRACE_R)},t.parseFieldDefinition=function(){var e=this._lexer.token,t=this.parseDescription(),r=this.parseName(),n=this.parseArgumentDefs();this.expectToken(zi.COLON);var i=this.parseTypeReference(),o=this.parseDirectives(!0);return{kind:Ui.FIELD_DEFINITION,description:t,name:r,arguments:n,type:i,directives:o,loc:this.loc(e)}},t.parseArgumentDefs=function(){return this.optionalMany(zi.PAREN_L,this.parseInputValueDef,zi.PAREN_R)},t.parseInputValueDef=function(){var e=this._lexer.token,t=this.parseDescription(),r=this.parseName();this.expectToken(zi.COLON);var n,i=this.parseTypeReference();this.expectOptionalToken(zi.EQUALS)&&(n=this.parseValueLiteral(!0));var o=this.parseDirectives(!0);return{kind:Ui.INPUT_VALUE_DEFINITION,description:t,name:r,type:i,defaultValue:n,directives:o,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),o=this.parseFieldsDefinition();return{kind:Ui.INTERFACE_TYPE_DEFINITION,description:t,name:r,interfaces:n,directives:i,fields:o,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:Ui.UNION_TYPE_DEFINITION,description:t,name:r,directives:n,types:i,loc:this.loc(e)}},t.parseUnionMemberTypes=function(){return this.expectOptionalToken(zi.EQUALS)?this.delimitedMany(zi.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:Ui.ENUM_TYPE_DEFINITION,description:t,name:r,directives:n,values:i,loc:this.loc(e)}},t.parseEnumValuesDefinition=function(){return this.optionalMany(zi.BRACE_L,this.parseEnumValueDefinition,zi.BRACE_R)},t.parseEnumValueDefinition=function(){var e=this._lexer.token,t=this.parseDescription(),r=this.parseName(),n=this.parseDirectives(!0);return{kind:Ui.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:Ui.INPUT_OBJECT_TYPE_DEFINITION,description:t,name:r,directives:n,fields:i,loc:this.loc(e)}},t.parseInputFieldsDefinition=function(){return this.optionalMany(zi.BRACE_L,this.parseInputValueDef,zi.BRACE_R)},t.parseTypeSystemExtension=function(){var e=this._lexer.lookahead();if(e.kind===zi.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(zi.BRACE_L,this.parseOperationTypeDefinition,zi.BRACE_R);if(0===t.length&&0===r.length)throw this.unexpected();return{kind:Ui.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:Ui.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:Ui.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:Ui.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:Ui.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:Ui.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:Ui.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(zi.AT);var r=this.parseName(),n=this.parseArgumentDefs(),i=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");var o=this.parseDirectiveLocations();return{kind:Ui.DIRECTIVE_DEFINITION,description:t,name:r,arguments:n,repeatable:i,locations:o,loc:this.loc(e)}},t.parseDirectiveLocations=function(){return this.delimitedMany(zi.PIPE,this.parseDirectiveLocation)},t.parseDirectiveLocation=function(){var e=this._lexer.token,t=this.parseName();if(void 0!==Ji[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 Qi(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 Mi(this._lexer.source,t.start,"Expected ".concat(po(e),", found ").concat(fo(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!==zi.NAME||t.value!==e)throw Mi(this._lexer.source,t.start,'Expected "'.concat(e,'", found ').concat(fo(t),"."));this._lexer.advance()},t.expectOptionalKeyword=function(e){var t=this._lexer.token;return t.kind===zi.NAME&&t.value===e&&(this._lexer.advance(),!0)},t.unexpected=function(e){var t=null!=e?e:this._lexer.token;return Mi(this._lexer.source,t.start,"Unexpected ".concat(fo(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 fo(e){var t=e.value;return po(e.kind)+(null!=t?' "'.concat(t,'"'):"")}function po(e){return function(e){return e===zi.BANG||e===zi.DOLLAR||e===zi.AMP||e===zi.PAREN_L||e===zi.PAREN_R||e===zi.SPREAD||e===zi.COLON||e===zi.EQUALS||e===zi.AT||e===zi.BRACKET_L||e===zi.BRACKET_R||e===zi.BRACE_L||e===zi.PIPE||e===zi.BRACE_R}(e)?'"'.concat(e,'"'):e}var mo=new Map,yo=new Map,vo=!0,go=!1;function bo(e){return e.replace(/[\s,]+/g," ").trim()}function wo(e){var t,r,n,i=bo(e);if(!mo.has(i)){var o=function(e,t){return new ho(e,t).parseDocument()}(e,{experimentalFragmentVariables:go,allowLegacyFragmentVariables:go});if(!o||"Document"!==o.kind)throw new Error("Not a valid GraphQL document.");mo.set(i,function(e){var t=new Set(e.definitions);t.forEach(function(e){e.loc&&delete e.loc,Object.keys(e).forEach(function(r){var n=e[r];n&&"object"==typeof n&&t.add(n)})});var r=e.loc;return r&&(delete r.startToken,delete r.endToken),e}((t=o,r=new Set,n=[],t.definitions.forEach(function(e){if("FragmentDefinition"===e.kind){var t=e.name.value,i=bo((a=e.loc).source.body.substring(a.start,a.end)),o=yo.get(t);o&&!o.has(i)?vo&&console.warn("Warning: fragment with name "+t+" already exists.\ngraphql-tag enforces all fragment names across your application to be unique; read more about\nthis in the docs: http://dev.apollodata.com/core/fragments.html#unique-names"):o||yo.set(t,o=new Set),o.add(i),r.has(i)||(r.add(i),n.push(e))}else n.push(e);var a}),vi(vi({},t),{definitions:n}))))}return mo.get(i)}function Ro(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];"string"==typeof e&&(e=[e]);var n=e[0];return t.forEach(function(t,r){t&&"Document"===t.kind?n+=t.loc.source.body:n+=t,n+=e[r+1]}),wo(n)}var Eo,ko=Ro;(Eo=Ro||(Ro={})).gql=ko,Eo.resetCaches=function(){mo.clear(),yo.clear()},Eo.disableFragmentWarnings=function(){vo=!1},Eo.enableExperimentalFragmentVariables=function(){go=!0},Eo.disableExperimentalFragmentVariables=function(){go=!1},Ro.default=Ro;const Oo=Ro`
6
+ `)),r+=1,await this.migratePullRequest(e,`${r} of ${t.length}`);e=(await this.getPullRequests(void 0,et.Open,e=>tt(e,this.cmsLabelPrefix))).map(e=>e.head.ref)}return e}async getStatuses(e,t){const r=this.generateContentKey(e,t),n=(0,O.branchFromContentKey)(r),i=(await this.getBranchPullRequest(n)).head.sha;return(await this.request(`${this.originRepoURL}/commits/${i}/status`)).statuses.map(e=>({context:e.context,target_url:e.target_url||"",state:e.state===Ze.Success?O.PreviewState.Success:O.PreviewState.Other}))}async persistFiles(e,t,r){const n=t.concat(e),i=n.map(e=>this.uploadBlob(e));if(await Promise.all(i),r.useWorkflow){const i=t.map(({sha:e,path:t})=>({path:s()(t,"/"),sha:e})),o=e[0].slug;return this.editorialWorkflowGit(n,o,i,r)}return this.getDefaultBranch().then(e=>this.updateTree(e.commit.sha,n)).then(e=>this.commit(r.commitMessage,e)).then(e=>this.patchBranch(this.branch,e.sha))}async getFileSha(e,{repoURL:t=this.repoURL,branch:r=this.branch}={}){const n=e.split("/"),i=Qe()(n),o=je()(n).join("/"),a=`${t}/git/trees/${r}:${encodeURIComponent(o)}`,s=(await this.request(a)).tree.find(e=>e.path===i);if(s)return s.sha;throw new O.APIError("Not Found",404,Ye)}async deleteFiles(e,t){if(this.useOpenAuthoring)return Promise.reject("Cannot delete published entries as an Open Authoring user!");const r=await this.getDefaultBranch(),n=e.map(e=>({path:e,sha:null})),i=await this.updateTree(r.commit.sha,n),o=await this.commit(t,i);await this.patchBranch(this.branch,o.sha)}async createBranchAndPullRequest(e,t,r){return await this.createBranch(e,t),this.createPR(r,e)}async updatePullRequestLabels(e,t){await this.request(`${this.repoURL}/issues/${e}/labels`,{method:"PUT",body:JSON.stringify({labels:t})})}async diffFromFile(e){return{path:e.filename,newFile:"added"===e.status,sha:e.sha||"",binary:"renamed"!==e.status&&!e.patch||e.filename.endsWith(".svg")}}async editorialWorkflowGit(e,t,r,n){const i=this.generateContentKey(n.collectionName,t),o=(0,O.branchFromContentKey)(i),a=n.unpublished||!1,s=!1!==n.hasSubfolders;if(a){const{files:t}=await this.getDifferences(this.branch,await this.getHeadReference(o)),i=await Promise.all((t||[]).map(e=>this.diffFromFile(e))),a=[];for(const e of i.filter(e=>e.binary))r.some(t=>t.path===e.path)||a.push({path:e.path,sha:null});const u=await this.rebaseBranch(o),c=a.concat(e),l=await this.updateTree(u.sha,c,o,s),h=await this.commit(n.commitMessage,l);return this.patchBranch(o,h.sha,{force:!0})}{const t=await this.getDefaultBranch(),r=await this.updateTree(t.commit.sha,e,this.branch,s),i=await this.commit(n.commitMessage,r);if(this.useOpenAuthoring)await this.createBranch(o,i.sha);else{const e=await this.createBranchAndPullRequest(o,i.sha,n.commitMessage);await this.setPullRequestStatus(e,n.status||this.initialWorkflowStatus)}}}async getDifferences(e,t){const r=this.useOpenAuthoring?10:1;for(let n=1;n<=r;n++)try{return await this.request(`${this.originRepoURL}/compare/${e}...${t}`)}catch(e){if(n===r)throw console.warn(`Reached maximum number of attempts '${r}' for getDifferences`),e;await new Promise(e=>setTimeout(e,500*n))}throw new O.APIError("Not Found",404,Ye)}async rebaseSingleCommit(e,t){const r=rt((await this.getDifferences(t.parents[0].sha,t.sha)).files);if(r.length>0){const n=await this.updateTree(e.sha,r),{message:i,author:o,committer:a}=t.commit;return await this.createCommit(i,n.sha,[e.sha],o?{name:o.name||"",email:o.email||"",date:o.date}:void 0,a?{name:a.name||"",email:a.email||"",date:a.date}:void 0)}return t}async rebaseCommits(e,t){return 0===t.length||t[0].parents[0].sha===e.sha?Qe()(t):t.reduce((e,t)=>e.then(e=>{const r=e,n=t;return this.rebaseSingleCommit(r,n)}),Promise.resolve(e))}async rebaseBranch(e){try{const{base_commit:t,commits:r}=await this.getDifferences(this.branch,await this.getHeadReference(e));return await this.rebaseCommits(t,r)}catch(e){throw console.error(e),e}}async setPullRequestStatus(e,t){const r=[...e.labels.filter(e=>!(0,O.isCMSLabel)(e.name,this.cmsLabelPrefix)).map(e=>e.name),(0,O.statusToLabel)(t,this.cmsLabelPrefix)];await this.updatePullRequestLabels(e.number,r)}async updateUnpublishedEntryStatus(e,t,r){const n=this.generateContentKey(e,t),i=(0,O.branchFromContentKey)(n),o=await this.getBranchPullRequest(i);if(this.useOpenAuthoring){if("pending_publish"===status)throw new Error('Open Authoring entries may not be set to the status "pending_publish".');if(o.number!==Xe){const{state:e}=o;e===et.Open&&"draft"===r&&await this.closePR(o.number),e===et.Closed&&"pending_review"===r&&await this.openPR(o.number)}else if("pending_review"===r){const e=(0,O.branchFromContentKey)(n),t=await this.getDifferences(this.branch,await this.getHeadReference(e)),r=t.commits[0]?.commit?.message||it.DEFAULT_COMMIT_MESSAGE;await this.createPR(r,e)}}else await this.setPullRequestStatus(o,r)}async deleteUnpublishedEntry(e,t){const r=this.generateContentKey(e,t),n=(0,O.branchFromContentKey)(r),i=await this.getBranchPullRequest(n);i.number!==Xe&&await this.closePR(i.number),await this.deleteBranch(n)}async publishUnpublishedEntry(e,t){const r=this.generateContentKey(e,t),n=(0,O.branchFromContentKey)(r),i=await this.getBranchPullRequest(n);await this.mergePR(i),await this.deleteBranch(n)}async createRef(e,t,r){return await this.request(`${this.repoURL}/git/refs`,{method:"POST",body:JSON.stringify({ref:`refs/${e}/${t}`,sha:r})})}async patchRef(e,t,r,n={}){const i=n.force||!1;return await this.request(`${this.repoURL}/git/refs/${e}/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify({sha:r,force:i})})}deleteRef(e,t){return this.request(`${this.repoURL}/git/refs/${e}/${encodeURIComponent(t)}`,{method:"DELETE"})}async getBranch(e){return await this.request(`${this.repoURL}/branches/${encodeURIComponent(e)}`)}async getDefaultBranch(){return await this.request(`${this.originRepoURL}/branches/${encodeURIComponent(this.branch)}`)}async backupBranch(e){try{const t=await this.getBranch(e);await this.createBranch(t.name.replace(new RegExp(`${O.CMS_BRANCH_PREFIX}/`),`${O.CMS_BRANCH_PREFIX}_${Date.now()}/`),t.commit.sha)}catch(e){console.warn(e)}}async createBranch(e,t){try{return await this.createRef("heads",e,t)}catch(r){const n=String(r.message||"");if("Reference update failed"===n)await(0,O.throwOnConflictingBranches)(e,e=>this.getBranch(e),Ye);else if("Reference already exists"===n&&e.startsWith(`${O.CMS_BRANCH_PREFIX}/`))try{return await this.backupBranch(e),await this.patchBranch(e,t,{force:!0})}catch(e){console.log(e)}throw r}}assertCmsBranch(e){return e.startsWith(`${O.CMS_BRANCH_PREFIX}/`)}patchBranch(e,t,r={}){const n=r.force||!1;if(n&&!this.assertCmsBranch(e))throw Error(`Only CMS branches can be force updated, cannot force update ${e}`);return this.patchRef("heads",e,t,{force:n})}deleteBranch(e){return this.deleteRef("heads",e).catch(e=>"Reference does not exist"===e.message?Promise.resolve():(console.error(e),Promise.reject(e)))}async getHeadReference(e){return`${this.repoOwner}:${e}`}async createPR(e,t){return await this.request(`${this.originRepoURL}/pulls`,{method:"POST",body:JSON.stringify({title:e,body:O.DEFAULT_PR_BODY,head:await this.getHeadReference(t),base:this.branch})})}async openPR(e){return console.log("%c Re-opening PR","line-height: 30px;text-align: center;font-weight: bold"),await this.request(`${this.originRepoURL}/pulls/${e}`,{method:"PATCH",body:JSON.stringify({state:et.Open})})}async closePR(e){return console.log("%c Deleting PR","line-height: 30px;text-align: center;font-weight: bold"),await this.request(`${this.originRepoURL}/pulls/${e}`,{method:"PATCH",body:JSON.stringify({state:et.Closed})})}async mergePR(e){console.log("%c Merging PR","line-height: 30px;text-align: center;font-weight: bold");try{return await this.request(`${this.originRepoURL}/pulls/${e.number}/merge`,{method:"PUT",body:JSON.stringify({commit_message:O.MERGE_COMMIT_MESSAGE,sha:e.head.sha,merge_method:this.mergeMethod})})}catch(t){if(t instanceof O.APIError&&405===t.status)return this.forceMergePR(e);throw t}}async forceMergePR(e){const t=rt((await this.getDifferences(e.base.sha,e.head.sha)).files);let r="Automatically generated. Merged on Decap CMS\n\nForce merge of:";return t.forEach(e=>{r+=`\n* "${e.path}"`}),console.log("%c Automatic merge not possible - Forcing merge.","line-height: 30px;text-align: center;font-weight: bold"),this.getDefaultBranch().then(e=>this.updateTree(e.commit.sha,t)).then(e=>this.commit(r,e)).then(e=>this.patchBranch(this.branch,e.sha))}toBase64(e){return Promise.resolve(Me.encode(e))}async uploadBlob(e){const t=await Ge()(e,"toBase64",ze()(this.toBase64,e.raw)),r=await this.request(`${this.repoURL}/git/blobs`,{method:"POST",body:JSON.stringify({content:t,encoding:"base64"})});return e.sha=r.sha,e}async updateTree(e,t,r=this.branch,n=!0){const i=[],o=t.reduce((e,t)=>{const r={path:s()(t.path,"/"),mode:"100644",type:"blob",sha:t.sha};return t.newPath?i.push({from:t.path,to:t.newPath,sha:t.sha}):e.push(r),e},[]);for(const{from:e,to:t,sha:a}of i)if(n){const n=(0,Je.dirname)(e),i=(0,Je.dirname)(t),s=await this.listFiles(n,{branch:r,depth:100});for(const t of s)o.push({path:t.path,mode:"100644",type:"blob",sha:null}),o.push({path:t.path.replace(n,i),mode:"100644",type:"blob",sha:t.path===e?a:t.id})}else o.push({path:s()(e,"/"),mode:"100644",type:"blob",sha:null}),o.push({path:s()(t,"/"),mode:"100644",type:"blob",sha:a});return{...await this.createTree(e,o),parentSha:e}}async createTree(e,t){return await this.request(`${this.repoURL}/git/trees`,{method:"POST",body:JSON.stringify({base_tree:e,tree:t})})}commit(e,t){const r=t.parentSha?[t.parentSha]:[];return this.createCommit(e,t.sha,r)}async createCommit(e,t,r,n,i){return await this.request(`${this.repoURL}/git/commits`,{method:"POST",body:JSON.stringify({message:e,tree:t,parents:r,author:n,committer:i})})}async getUnpublishedEntrySha(e,t){const r=this.generateContentKey(e,t),n=(0,O.branchFromContentKey)(r);return(await this.getBranchPullRequest(n)).head.sha}}var ot=function(e,t){return ot=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},ot(e,t)};function at(e,t){function r(){this.constructor=e}ot(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var st=function(){return st=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},st.apply(this,arguments)};function ut(e,t,r,n){return new(r||(r=Promise))(function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(a,s)}u((n=n.apply(e,t||[])).next())})}function ct(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}var lt=u(8048),ht=function(e,t){return ht=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},ht(e,t)},ft="Invariant Violation",pt=Object.setPrototypeOf,dt=void 0===pt?function(e,t){return e.__proto__=t,e}:pt,mt=function(e){function t(r){void 0===r&&(r=ft);var n=e.call(this,"number"==typeof r?ft+": "+r+" (see https://github.com/apollographql/invariant-packages)":r)||this;return n.framesToPop=1,n.name=ft,dt(n,t.prototype),n}return function(e,t){function r(){this.constructor=e}ht(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}(t,e),t}(Error);function yt(e,t){if(!e)throw new mt(t)}function vt(e){return function(){return console[e].apply(console,arguments)}}!function(e){e.warn=vt("warn"),e.error=vt("error")}(yt||(yt={}));var gt={env:{}};if("object"==typeof process)gt=process;else try{Function("stub","process = stub")(gt)}catch(e){}var bt=function(){return bt=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},bt.apply(this,arguments)};function wt(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var n=Array(e),i=0;for(t=0;t<r;t++)for(var o=arguments[t],a=0,s=o.length;a<s;a++,i++)n[i]=o[a];return n}var Rt=u(6075),Et=u.n(Rt),kt=Object.prototype,Ot=kt.toString,xt=kt.hasOwnProperty,St=new Map;function _t(e,t){try{return It(e,t)}finally{St.clear()}}function It(e,t){if(e===t)return!0;var r=Ot.call(e);if(r!==Ot.call(t))return!1;switch(r){case"[object Array]":if(e.length!==t.length)return!1;case"[object Object]":if(Tt(e,t))return!0;var n=Object.keys(e),i=Object.keys(t),o=n.length;if(o!==i.length)return!1;for(var a=0;a<o;++a)if(!xt.call(t,n[a]))return!1;for(a=0;a<o;++a){var s=n[a];if(!It(e[s],t[s]))return!1}return!0;case"[object Error]":return e.name===t.name&&e.message===t.message;case"[object Number]":if(e!=e)return t!=t;case"[object Boolean]":case"[object Date]":return+e===+t;case"[object RegExp]":case"[object String]":return e==""+t;case"[object Map]":case"[object Set]":if(e.size!==t.size)return!1;if(Tt(e,t))return!0;for(var u=e.entries(),c="[object Map]"===r;;){var l=u.next();if(l.done)break;var h=l.value,f=h[0],p=h[1];if(!t.has(f))return!1;if(c&&!It(p,t.get(f)))return!1}return!0}return!1}function Tt(e,t){var r=St.get(e);if(r){if(r.has(t))return!0}else St.set(e,r=new Set);return r.add(t),!1}function At(e,t,r,n){if(function(e){return"IntValue"===e.kind}(r)||function(e){return"FloatValue"===e.kind}(r))e[t.value]=Number(r.value);else if(function(e){return"BooleanValue"===e.kind}(r)||function(e){return"StringValue"===e.kind}(r))e[t.value]=r.value;else if(function(e){return"ObjectValue"===e.kind}(r)){var i={};r.fields.map(function(e){return At(i,e.name,e.value,n)}),e[t.value]=i}else if(function(e){return"Variable"===e.kind}(r)){var o=(n||{})[r.name.value];e[t.value]=o}else if(function(e){return"ListValue"===e.kind}(r))e[t.value]=r.values.map(function(e){var r={};return At(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 mt(17);e[t.value]=null}}var Pt=["connection","include","skip","client","rest","export"];function Ct(e,t,r){if(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=t,o={};return n.forEach(function(e){o[e]=i[e]}),r.connection.key+"("+JSON.stringify(o)+")"}return r.connection.key}var a=e;if(t){var s=Et()(t);a+="("+s+")"}return r&&Object.keys(r).forEach(function(e){-1===Pt.indexOf(e)&&(r[e]&&Object.keys(r[e]).length?a+="@"+e+"("+JSON.stringify(r[e])+")":a+="@"+e)}),a}function Nt(e,t){if(e.arguments&&e.arguments.length){var r={};return e.arguments.forEach(function(e){var n=e.name,i=e.value;return At(r,n,i,t)}),r}return null}function qt(e){return e.alias?e.alias.value:e.name.value}function Ft(e){return"Field"===e.kind}function Dt(e){return"InlineFragment"===e.kind}function Bt(e){return e&&"id"===e.type&&"boolean"==typeof e.generated}function Lt(e,t){return void 0===t&&(t=!1),bt({type:"id",generated:t},"string"==typeof e?{id:e,typename:void 0}:e)}function Mt(e,t){if(e.directives&&e.directives.length){var r={};return e.directives.forEach(function(e){r[e.name.value]=Nt(e,t)}),r}return null}function Ut(e,t){return void 0===t&&(t={}),(r=e.directives,r?r.filter(Qt).map(function(e){var t=e.arguments;e.name.value,yt(t&&1===t.length,14);var r=t[0];yt(r.name&&"if"===r.name.value,15);var n=r.value;return yt(n&&("Variable"===n.kind||"BooleanValue"===n.kind),16),{directive:e,ifArgument:r}}):[]).every(function(e){var r=e.directive,n=e.ifArgument,i=!1;return"Variable"===n.value.kind?yt(void 0!==(i=t[n.value.name.value]),13):i=n.value.value,"skip"===r.name.value?!i:i});var r}function jt(e,t){return function(e){var t=[];return(0,lt.visit)(e,{Directive:function(e){t.push(e.name.value)}}),t}(t).some(function(t){return e.indexOf(t)>-1})}function $t(e){return e&&jt(["client"],e)&&jt(["export"],e)}function Qt(e){var t=e.name.value;return"skip"===t||"include"===t}function Vt(e,t){var r=t,n=[];return e.definitions.forEach(function(e){if("OperationDefinition"===e.kind)throw new mt(11);"FragmentDefinition"===e.kind&&n.push(e)}),void 0===r&&(yt(1===n.length,12),r=n[0].name.value),bt(bt({},e),{definitions:wt([{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:r}}]}}],e.definitions)})}function zt(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return t.forEach(function(t){null!=t&&Object.keys(t).forEach(function(r){e[r]=t[r]})}),e}function Kt(e){return yt(e&&"Document"===e.kind,2),yt(e.definitions.filter(function(e){return"FragmentDefinition"!==e.kind}).map(function(e){if("OperationDefinition"!==e.kind)throw new mt(3);return e}).length<=1,4),e}function Gt(e){return Kt(e),e.definitions.filter(function(e){return"OperationDefinition"===e.kind})[0]}function Wt(e){return e.definitions.filter(function(e){return"OperationDefinition"===e.kind&&e.name}).map(function(e){return e.name.value})[0]||null}function Ht(e){return e.definitions.filter(function(e){return"FragmentDefinition"===e.kind})}function Jt(e){var t;Kt(e);for(var r=0,n=e.definitions;r<n.length;r++){var i=n[r];if("OperationDefinition"===i.kind){var o=i.operation;if("query"===o||"mutation"===o||"subscription"===o)return i}"FragmentDefinition"!==i.kind||t||(t=i)}if(t)return t;throw new mt(10)}function Yt(e){void 0===e&&(e=[]);var t={};return e.forEach(function(e){t[e.name.value]=e}),t}function Xt(e){if(e&&e.variableDefinitions&&e.variableDefinitions.length){var t=e.variableDefinitions.filter(function(e){return e.defaultValue}).map(function(e){var t=e.variable,r=e.defaultValue,n={};return At(n,t.name,r),n});return zt.apply(void 0,wt([{}],t))}return{}}function Zt(e,t,r){var n=0;return e.forEach(function(r,i){t.call(this,r,i,e)&&(e[n++]=r)},r),e.length=n,e}var er={kind:"Field",name:{kind:"Name",value:"__typename"}};function tr(e,t){return e.selectionSet.selections.every(function(e){return"FragmentSpread"===e.kind&&tr(t[e.name.value],t)})}function rr(e){return tr(Gt(e)||function(e){yt("Document"===e.kind,7),yt(e.definitions.length<=1,8);var t=e.definitions[0];return yt("FragmentDefinition"===t.kind,9),t}(e),Yt(Ht(e)))?null:e}function nr(e){return function(t){return e.some(function(e){return e.name&&e.name===t.name.value||e.test&&e.test(t)})}}function ir(e,t){var r=Object.create(null),n=[],i=Object.create(null),o=[],a=rr((0,lt.visit)(t,{Variable:{enter:function(e,t,n){"VariableDefinition"!==n.kind&&(r[e.name.value]=!0)}},Field:{enter:function(t){if(e&&t.directives&&e.some(function(e){return e.remove})&&t.directives&&t.directives.some(nr(e)))return t.arguments&&t.arguments.forEach(function(e){"Variable"===e.value.kind&&n.push({name:e.value.name.value})}),t.selectionSet&&ar(t.selectionSet).forEach(function(e){o.push({name:e.name.value})}),null}},FragmentSpread:{enter:function(e){i[e.name.value]=!0}},Directive:{enter:function(t){if(nr(e)(t))return null}}}));return a&&Zt(n,function(e){return!r[e.name]}).length&&(a=function(e,t){var r=function(e){return function(t){return e.some(function(e){return t.value&&"Variable"===t.value.kind&&t.value.name&&(e.name===t.value.name.value||e.test&&e.test(t))})}}(e);return rr((0,lt.visit)(t,{OperationDefinition:{enter:function(t){return bt(bt({},t),{variableDefinitions:t.variableDefinitions.filter(function(t){return!e.some(function(e){return e.name===t.variable.name.value})})})}},Field:{enter:function(t){if(e.some(function(e){return e.remove})){var n=0;if(t.arguments.forEach(function(e){r(e)&&(n+=1)}),1===n)return null}}},Argument:{enter:function(e){if(r(e))return null}}}))}(n,a)),a&&Zt(o,function(e){return!i[e.name]}).length&&(a=function(e,t){function r(t){if(e.some(function(e){return e.name===t.name.value}))return null}return rr((0,lt.visit)(t,{FragmentSpread:{enter:r},FragmentDefinition:{enter:r}}))}(o,a)),a}var or={test:function(e){var t="connection"===e.name.value;return t&&(!e.arguments||e.arguments.some(function(e){return"key"===e.name.value})),t}};function ar(e){var t=[];return e.selections.forEach(function(e){(Ft(e)||Dt(e))&&e.selectionSet?ar(e.selectionSet).forEach(function(e){return t.push(e)}):"FragmentSpread"===e.kind&&t.push(e)}),t}function sr(e){return"query"===Jt(e).operation?e:(0,lt.visit)(e,{OperationDefinition:{enter:function(e){return bt(bt({},e),{operation:"query"})}}})}var ur="function"==typeof WeakMap&&!("object"==typeof navigator&&"ReactNative"===navigator.product),cr=Object.prototype.toString;function lr(e){return hr(e,new Map)}function hr(e,t){switch(cr.call(e)){case"[object Array]":if(t.has(e))return t.get(e);var r=e.slice(0);return t.set(e,r),r.forEach(function(e,n){r[n]=hr(e,t)}),r;case"[object Object]":if(t.has(e))return t.get(e);var n=Object.create(Object.getPrototypeOf(e));return t.set(e,n),Object.keys(e).forEach(function(r){n[r]=hr(e[r],t)}),n;default:return e}}function fr(e){return("undefined"!=typeof process?"production":"development")===e}function pr(e){try{return e()}catch(e){console.error&&console.error(e)}}function dr(e){return e.errors&&e.errors.length}var mr=Object.prototype.hasOwnProperty;function yr(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return vr(e)}function vr(e){var t=e[0]||{},r=e.length;if(r>1){var n=[];t=wr(t,n);for(var i=1;i<r;++i)t=br(t,e[i],n)}return t}function gr(e){return null!==e&&"object"==typeof e}function br(e,t,r){return gr(t)&&gr(e)?(Object.isExtensible&&!Object.isExtensible(e)&&(e=wr(e,r)),Object.keys(t).forEach(function(n){var i=t[n];if(mr.call(e,n)){var o=e[n];i!==o&&(e[n]=br(wr(o,r),i,r))}else e[n]=i}),e):t}function wr(e,t){return null!==e&&"object"==typeof e&&t.indexOf(e)<0&&(e=Array.isArray(e)?e.slice(0):bt({__proto__:Object.getPrototypeOf(e)},e),t.push(e)),e}Object.create({});var Rr=u(8784);const Er=u.n(Rr)();var kr,Or=function(e,t){return Or=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},Or(e,t)},xr=function(){return xr=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},xr.apply(this,arguments)};function Sr(e){return e.request.length<=1}function _r(e){return new Er(function(t){t.error(e)})}function Ir(e,t){return t?t(e):Er.of()}function Tr(e){return"function"==typeof e?new qr(e):e}function Ar(){return new qr(function(){return Er.of()})}function Pr(e){return 0===e.length?Ar():e.map(Tr).reduce(function(e,t){return e.concat(t)})}function Cr(e,t,r){var n=Tr(t),i=Tr(r||new qr(Ir));return Sr(n)&&Sr(i)?new qr(function(t){return e(t)?n.request(t)||Er.of():i.request(t)||Er.of()}):new qr(function(t,r){return e(t)?n.request(t,r)||Er.of():i.request(t,r)||Er.of()})}(function(e,t){function r(){this.constructor=e}Or(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)})(function(e,t){var r=kr.call(this,e)||this;return r.link=t,r},kr=Error);var Nr=function(e,t){var r=Tr(e);if(Sr(r))return r;var n=Tr(t);return Sr(n)?new qr(function(e){return r.request(e,function(e){return n.request(e)||Er.of()})||Er.of()}):new qr(function(e,t){return r.request(e,function(e){return n.request(e,t)||Er.of()})||Er.of()})},qr=function(){function e(e){e&&(this.request=e)}return e.prototype.split=function(t,r,n){return this.concat(Cr(t,r,n||new e(Ir)))},e.prototype.concat=function(e){return Nr(this,e)},e.prototype.request=function(e,t){throw new mt(1)},e.empty=Ar,e.from=Pr,e.split=Cr,e.execute=Fr,e}();function Fr(e,t){return e.request(function(e,t){var r=xr({},e);return Object.defineProperty(t,"setContext",{enumerable:!1,value:function(e){r=xr({},r,"function"==typeof e?e(r):e)}}),Object.defineProperty(t,"getContext",{enumerable:!1,value:function(){return xr({},r)}}),Object.defineProperty(t,"toKey",{enumerable:!1,value:function(){return function(e){var t=e.query,r=e.variables,n=e.operationName;return JSON.stringify([n,t,r])}(t)}}),t}(t.context,function(e){var t={variables:e.variables||{},extensions:e.extensions||{},operationName:e.operationName,query:e.query};return t.operationName||(t.operationName="string"!=typeof t.query?Wt(t.query):""),t}(function(e){for(var t=["query","operationName","variables","extensions","context"],r=0,n=Object.keys(e);r<n.length;r++){var i=n[r];if(t.indexOf(i)<0)throw new mt(2)}return e}(t))))||Er.of()}var Dr,Br=u(1158);function Lr(e){return e<7}!function(e){e[e.loading=1]="loading",e[e.setVariables=2]="setVariables",e[e.fetchMore=3]="fetchMore",e[e.refetch=4]="refetch",e[e.poll=6]="poll",e[e.ready=7]="ready",e[e.error=8]="error"}(Dr||(Dr={}));var Mr=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return at(t,e),t.prototype[Br.A]=function(){return this},t.prototype["@@observable"]=function(){return this},t}(Er);function Ur(e){return Array.isArray(e)&&e.length>0}var jr,$r=function(e){function t(r){var n,i,o=r.graphQLErrors,a=r.networkError,s=r.errorMessage,u=r.extraInfo,c=e.call(this,s)||this;return c.graphQLErrors=o||[],c.networkError=a||null,c.message=s||(i="",Ur((n=c).graphQLErrors)&&n.graphQLErrors.forEach(function(e){var t=e?e.message:"Error message not found.";i+="GraphQL error: "+t+"\n"}),n.networkError&&(i+="Network error: "+n.networkError.message+"\n"),i=i.replace(/\n$/,"")),c.extraInfo=u,c.__proto__=t.prototype,c}return at(t,e),t}(Error);!function(e){e[e.normal=1]="normal",e[e.refetch=2]="refetch",e[e.poll=3]="poll"}(jr||(jr={}));var Qr=function(e){function t(t){var r=t.queryManager,n=t.options,i=t.shouldSubscribe,o=void 0===i||i,a=e.call(this,function(e){return a.onSubscribe(e)})||this;a.observers=new Set,a.subscriptions=new Set,a.isTornDown=!1,a.options=n,a.variables=n.variables||{},a.queryId=r.generateQueryId(),a.shouldSubscribe=o;var s=Gt(n.query);return a.queryName=s&&s.name&&s.name.value,a.queryManager=r,a}return at(t,e),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.currentResult=function(){var e=this.getCurrentResult();return void 0===e.data&&(e.data={}),e},t.prototype.getCurrentResult=function(){if(this.isTornDown){var e=this.lastResult;return{data:!this.lastError&&e&&e.data||void 0,error:this.lastError,loading:!1,networkStatus:Dr.error}}var t,r,n,i=this.queryManager.getCurrentQueryResult(this),o=i.data,a=i.partial,s=this.queryManager.queryStore.get(this.queryId),u=this.options.fetchPolicy,c="network-only"===u||"no-cache"===u;if(s){var l=s.networkStatus;if(r=s,void 0===(n=this.options.errorPolicy)&&(n="none"),r&&(r.networkError||"none"===n&&Ur(r.graphQLErrors)))return{data:void 0,loading:!1,networkStatus:l,error:new $r({graphQLErrors:s.graphQLErrors,networkError:s.networkError})};s.variables&&(this.options.variables=st(st({},this.options.variables),s.variables),this.variables=this.options.variables),t={data:o,loading:Lr(l),networkStatus:l},s.graphQLErrors&&"all"===this.options.errorPolicy&&(t.errors=s.graphQLErrors)}else{var h=c||a&&"cache-only"!==u;t={data:o,loading:h,networkStatus:h?Dr.loading:Dr.ready}}return a||this.updateLastResult(st(st({},t),{stale:!1})),st(st({},t),{partial:a})},t.prototype.isDifferentFromLastResult=function(e){var t=this.lastResultSnapshot;return!(t&&e&&t.networkStatus===e.networkStatus&&t.stale===e.stale&&_t(t.data,e.data))},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(){var e=this.queryManager.queryStore.get(this.queryId);e&&(e.networkError=null,e.graphQLErrors=[])},t.prototype.refetch=function(e){var t=this.options.fetchPolicy;return"cache-only"===t?Promise.reject(new mt(1)):("no-cache"!==t&&"cache-and-network"!==t&&(t="network-only"),_t(this.variables,e)||(this.variables=st(st({},this.variables),e)),_t(this.options.variables,this.variables)||(this.options.variables=st(st({},this.options.variables),this.variables)),this.queryManager.fetchQuery(this.queryId,st(st({},this.options),{fetchPolicy:t}),jr.refetch))},t.prototype.fetchMore=function(e){var t=this;yt(e.updateQuery,2);var r=st(st({},e.query?e:st(st(st({},this.options),e),{variables:st(st({},this.variables),e.variables)})),{fetchPolicy:"network-only"}),n=this.queryManager.generateQueryId();return this.queryManager.fetchQuery(n,r,jr.normal,this.queryId).then(function(i){return t.updateQuery(function(t){return e.updateQuery(t,{fetchMoreResult:i.data,variables:r.variables})}),t.queryManager.stopQuery(n),i},function(e){throw t.queryManager.stopQuery(n),e})},t.prototype.subscribeToMore=function(e){var t=this,r=this.queryManager.startGraphQLSubscription({query:e.document,variables:e.variables}).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){var t=this.options.fetchPolicy;this.options=st(st({},this.options),e),e.pollInterval?this.startPolling(e.pollInterval):0===e.pollInterval&&this.stopPolling();var r=e.fetchPolicy;return this.setVariables(this.options.variables,t!==r&&("cache-only"===t||"standby"===t||"network-only"===r),e.fetchResults)},t.prototype.setVariables=function(e,t,r){return void 0===t&&(t=!1),void 0===r&&(r=!0),this.isTornDown=!1,e=e||this.variables,!t&&_t(e,this.variables)?this.observers.size&&r?this.result():Promise.resolve():(this.variables=this.options.variables=e,this.observers.size?this.queryManager.fetchQuery(this.queryId,this.options):Promise.resolve())},t.prototype.updateQuery=function(e){var t=this.queryManager,r=t.getQueryWithPreviousResult(this.queryId),n=r.previousResult,i=r.variables,o=r.document,a=pr(function(){return e(n,{variables:i})});a&&(t.dataStore.markUpdateQueryResult(o,i,a),t.broadcastQueries())},t.prototype.stopPolling=function(){this.queryManager.stopPollingQuery(this.queryId),this.options.pollInterval=void 0},t.prototype.startPolling=function(e){Kr(this),this.options.pollInterval=e,this.queryManager.startPollingQuery(this.options,this.queryId)},t.prototype.updateLastResult=function(e){var t=this.lastResult;return this.lastResult=e,this.lastResultSnapshot=this.queryManager.assumeImmutableResults?e:lr(e),t},t.prototype.onSubscribe=function(e){var t=this;try{var r=e._subscription._observer;r&&!r.error&&(r.error=Vr)}catch(e){}var n=!this.observers.size;return this.observers.add(e),e.next&&this.lastResult&&e.next(this.lastResult),e.error&&this.lastError&&e.error(this.lastError),n&&this.setUpQuery(),function(){t.observers.delete(e)&&!t.observers.size&&t.tearDownQuery()}},t.prototype.setUpQuery=function(){var e=this,t=this.queryManager,r=this.queryId;this.shouldSubscribe&&t.addObservableQuery(r,this),this.options.pollInterval&&(Kr(this),t.startPollingQuery(this.options,r));var n=function(t){e.updateLastResult(st(st({},e.lastResult),{errors:t.graphQLErrors,networkStatus:Dr.error,loading:!1})),zr(e.observers,"error",e.lastError=t)};t.observeQuery(r,this.options,{next:function(r){if(e.lastError||e.isDifferentFromLastResult(r)){var n=e.updateLastResult(r),i=e.options,o=i.query,a=i.variables,s=i.fetchPolicy;t.transform(o).hasClientExports?t.getLocalState().addExportedVariables(o,a).then(function(i){var a=e.variables;e.variables=e.options.variables=i,!r.loading&&n&&"cache-only"!==s&&t.transform(o).serverQuery&&!_t(a,i)?e.refetch():zr(e.observers,"next",r)}):zr(e.observers,"next",r)}},error:n}).catch(n)},t.prototype.tearDownQuery=function(){var e=this.queryManager;this.isTornDown=!0,e.stopPollingQuery(this.queryId),this.subscriptions.forEach(function(e){return e.unsubscribe()}),this.subscriptions.clear(),e.removeObservableQuery(this.queryId),e.stopQuery(this.queryId),this.observers.clear()},t}(Mr);function Vr(e){}function zr(e,t,r){var n=[];e.forEach(function(e){return e[t]&&n.push(e)}),n.forEach(function(e){return e[t](r)})}function Kr(e){var t=e.options.fetchPolicy;yt("cache-first"!==t&&"cache-only"!==t,3)}var Gr=function(){function e(){this.store={}}return e.prototype.getStore=function(){return this.store},e.prototype.get=function(e){return this.store[e]},e.prototype.initMutation=function(e,t,r){this.store[e]={mutation:t,variables:r||{},loading:!0,error:null}},e.prototype.markMutationError=function(e,t){var r=this.store[e];r&&(r.loading=!1,r.error=t)},e.prototype.markMutationResult=function(e){var t=this.store[e];t&&(t.loading=!1,t.error=null)},e.prototype.reset=function(){this.store={}},e}(),Wr=function(){function e(){this.store={}}return e.prototype.getStore=function(){return this.store},e.prototype.get=function(e){return this.store[e]},e.prototype.initQuery=function(e){var t=this.store[e.queryId];yt(!t||t.document===e.document||_t(t.document,e.document),19);var r,n=!1,i=null;e.storePreviousVariables&&t&&t.networkStatus!==Dr.loading&&(_t(t.variables,e.variables)||(n=!0,i=t.variables)),r=n?Dr.setVariables:e.isPoll?Dr.poll:e.isRefetch?Dr.refetch:Dr.loading;var o=[];t&&t.graphQLErrors&&(o=t.graphQLErrors),this.store[e.queryId]={document:e.document,variables:e.variables,previousVariables:i,networkError:null,graphQLErrors:o,networkStatus:r,metadata:e.metadata},"string"==typeof e.fetchMoreForQueryId&&this.store[e.fetchMoreForQueryId]&&(this.store[e.fetchMoreForQueryId].networkStatus=Dr.fetchMore)},e.prototype.markQueryResult=function(e,t,r){this.store&&this.store[e]&&(this.store[e].networkError=null,this.store[e].graphQLErrors=Ur(t.errors)?t.errors:[],this.store[e].previousVariables=null,this.store[e].networkStatus=Dr.ready,"string"==typeof r&&this.store[r]&&(this.store[r].networkStatus=Dr.ready))},e.prototype.markQueryError=function(e,t,r){this.store&&this.store[e]&&(this.store[e].networkError=t,this.store[e].networkStatus=Dr.error,"string"==typeof r&&this.markQueryResultClient(r,!0))},e.prototype.markQueryResultClient=function(e,t){var r=this.store&&this.store[e];r&&(r.networkError=null,r.previousVariables=null,t&&(r.networkStatus=Dr.ready))},e.prototype.stopQuery=function(e){delete this.store[e]},e.prototype.reset=function(e){var t=this;Object.keys(this.store).forEach(function(r){e.indexOf(r)<0?t.stopQuery(r):t.store[r].networkStatus=Dr.loading})},e}(),Hr=function(){function e(e){var t=e.cache,r=e.client,n=e.resolvers,i=e.fragmentMatcher;this.cache=t,r&&(this.client=r),n&&this.addResolvers(n),i&&this.setFragmentMatcher(i)}return e.prototype.addResolvers=function(e){var t=this;this.resolvers=this.resolvers||{},Array.isArray(e)?e.forEach(function(e){t.resolvers=yr(t.resolvers,e)}):this.resolvers=yr(this.resolvers,e)},e.prototype.setResolvers=function(e){this.resolvers={},this.addResolvers(e)},e.prototype.getResolvers=function(){return this.resolvers||{}},e.prototype.runResolvers=function(e){var t=e.document,r=e.remoteResult,n=e.context,i=e.variables,o=e.onlyRunForcedResolvers,a=void 0!==o&&o;return ut(this,void 0,void 0,function(){return ct(this,function(e){return t?[2,this.resolveDocument(t,r.data,n,i,this.fragmentMatcher,a).then(function(e){return st(st({},r),{data:e.result})})]:[2,r]})})},e.prototype.setFragmentMatcher=function(e){this.fragmentMatcher=e},e.prototype.getFragmentMatcher=function(){return this.fragmentMatcher},e.prototype.clientQuery=function(e){return jt(["client"],e)&&this.resolvers?e:null},e.prototype.serverQuery=function(e){return this.resolvers?function(e){Kt(e);var t=ir([{test:function(e){return"client"===e.name.value},remove:!0}],e);return t&&(t=(0,lt.visit)(t,{FragmentDefinition:{enter:function(e){if(e.selectionSet&&e.selectionSet.selections.every(function(e){return Ft(e)&&"__typename"===e.name.value}))return null}}})),t}(e):e},e.prototype.prepareContext=function(e){void 0===e&&(e={});var t=this.cache;return st(st({},e),{cache:t,getCacheKey:function(e){if(t.config)return t.config.dataIdFromObject(e);yt(!1,6)}})},e.prototype.addExportedVariables=function(e,t,r){return void 0===t&&(t={}),void 0===r&&(r={}),ut(this,void 0,void 0,function(){return ct(this,function(n){return e?[2,this.resolveDocument(e,this.buildRootValueFromCache(e,t)||{},this.prepareContext(r),t).then(function(e){return st(st({},t),e.exportedVariables)})]:[2,st({},t)]})})},e.prototype.shouldForceResolvers=function(e){var t=!1;return(0,lt.visit)(e,{Directive:{enter:function(e){if("client"===e.name.value&&e.arguments&&(t=e.arguments.some(function(e){return"always"===e.name.value&&"BooleanValue"===e.value.kind&&!0===e.value.value})))return lt.BREAK}}}),t},e.prototype.buildRootValueFromCache=function(e,t){return this.cache.diff({query:sr(e),variables:t,returnPartialData:!0,optimistic:!1}).result},e.prototype.resolveDocument=function(e,t,r,n,i,o){return void 0===r&&(r={}),void 0===n&&(n={}),void 0===i&&(i=function(){return!0}),void 0===o&&(o=!1),ut(this,void 0,void 0,function(){var a,s,u,c,l,h,f,p,d;return ct(this,function(m){var y;return a=Jt(e),s=Ht(e),u=Yt(s),c=a.operation,l=c?(y=c).charAt(0).toUpperCase()+y.slice(1):"Query",f=(h=this).cache,p=h.client,d={fragmentMap:u,context:st(st({},r),{cache:f,client:p}),variables:n,fragmentMatcher:i,defaultOperationType:l,exportedVariables:{},onlyRunForcedResolvers:o},[2,this.resolveSelectionSet(a.selectionSet,t,d).then(function(e){return{result:e,exportedVariables:d.exportedVariables}})]})})},e.prototype.resolveSelectionSet=function(e,t,r){return ut(this,void 0,void 0,function(){var n,i,o,a,s,u=this;return ct(this,function(c){return n=r.fragmentMap,i=r.context,o=r.variables,a=[t],s=function(e){return ut(u,void 0,void 0,function(){var s,u;return ct(this,function(c){return Ut(e,o)?Ft(e)?[2,this.resolveField(e,t,r).then(function(t){var r;void 0!==t&&a.push(((r={})[qt(e)]=t,r))})]:(Dt(e)?s=e:yt(s=n[e.name.value],7),s&&s.typeCondition&&(u=s.typeCondition.name.value,r.fragmentMatcher(t,u,i))?[2,this.resolveSelectionSet(s.selectionSet,t,r).then(function(e){a.push(e)})]:[2]):[2]})})},[2,Promise.all(e.selections.map(s)).then(function(){return vr(a)})]})})},e.prototype.resolveField=function(e,t,r){return ut(this,void 0,void 0,function(){var n,i,o,a,s,u,c,l,h,f=this;return ct(this,function(p){return n=r.variables,i=e.name.value,o=qt(e),a=i!==o,s=t[o]||t[i],u=Promise.resolve(s),r.onlyRunForcedResolvers&&!this.shouldForceResolvers(e)||(c=t.__typename||r.defaultOperationType,(l=this.resolvers&&this.resolvers[c])&&(h=l[a?i:o])&&(u=Promise.resolve(h(t,Nt(e,n),r.context,{field:e,fragmentMap:r.fragmentMap})))),[2,u.then(function(t){return void 0===t&&(t=s),e.directives&&e.directives.forEach(function(e){"export"===e.name.value&&e.arguments&&e.arguments.forEach(function(e){"as"===e.name.value&&"StringValue"===e.value.kind&&(r.exportedVariables[e.value.value]=t)})}),e.selectionSet?null==t?t:Array.isArray(t)?f.resolveSubSelectedArray(e,t,r):e.selectionSet?f.resolveSelectionSet(e.selectionSet,t,r):void 0:t})]})})},e.prototype.resolveSubSelectedArray=function(e,t,r){var n=this;return Promise.all(t.map(function(t){return null===t?null:Array.isArray(t)?n.resolveSubSelectedArray(e,t,r):e.selectionSet?n.resolveSelectionSet(e.selectionSet,t,r):void 0}))},e}();function Jr(e){var t=new Set,r=null;return new Mr(function(n){return t.add(n),r=r||e.subscribe({next:function(e){t.forEach(function(t){return t.next&&t.next(e)})},error:function(e){t.forEach(function(t){return t.error&&t.error(e)})},complete:function(){t.forEach(function(e){return e.complete&&e.complete()})}}),function(){t.delete(n)&&!t.size&&r&&(r.unsubscribe(),r=null)}})}var Yr=Object.prototype.hasOwnProperty,Xr=function(){function e(e){var t=e.link,r=e.queryDeduplication,n=void 0!==r&&r,i=e.store,o=e.onBroadcast,a=void 0===o?function(){}:o,s=e.ssrMode,u=void 0!==s&&s,c=e.clientAwareness,l=void 0===c?{}:c,h=e.localState,f=e.assumeImmutableResults;this.mutationStore=new Gr,this.queryStore=new Wr,this.clientAwareness={},this.idCounter=1,this.queries=new Map,this.fetchQueryRejectFns=new Map,this.transformCache=new(ur?WeakMap:Map),this.inFlightLinkObservables=new Map,this.pollingInfoByQueryId=new Map,this.link=t,this.queryDeduplication=n,this.dataStore=i,this.onBroadcast=a,this.clientAwareness=l,this.localState=h||new Hr({cache:i.getCache()}),this.ssrMode=u,this.assumeImmutableResults=!!f}return e.prototype.stop=function(){var e=this;this.queries.forEach(function(t,r){e.stopQueryNoBroadcast(r)}),this.fetchQueryRejectFns.forEach(function(e){e(new mt(8))})},e.prototype.mutate=function(e){var t=e.mutation,r=e.variables,n=e.optimisticResponse,i=e.updateQueries,o=e.refetchQueries,a=void 0===o?[]:o,s=e.awaitRefetchQueries,u=void 0!==s&&s,c=e.update,l=e.errorPolicy,h=void 0===l?"none":l,f=e.fetchPolicy,p=e.context,d=void 0===p?{}:p;return ut(this,void 0,void 0,function(){var e,o,s,l=this;return ct(this,function(p){switch(p.label){case 0:return yt(t,9),yt(!f||"no-cache"===f,10),e=this.generateQueryId(),t=this.transform(t).document,this.setQuery(e,function(){return{document:t}}),r=this.getVariables(t,r),this.transform(t).hasClientExports?[4,this.localState.addExportedVariables(t,r,d)]:[3,2];case 1:r=p.sent(),p.label=2;case 2:return o=function(){var e={};return i&&l.queries.forEach(function(t,r){var n=t.observableQuery;if(n){var o=n.queryName;o&&Yr.call(i,o)&&(e[r]={updater:i[o],query:l.queryStore.get(r)})}}),e},this.mutationStore.initMutation(e,t,r),this.dataStore.markMutationInit({mutationId:e,document:t,variables:r,updateQueries:o(),update:c,optimisticResponse:n}),this.broadcastQueries(),s=this,[2,new Promise(function(i,l){var p,m;s.getObservableFromLink(t,st(st({},d),{optimisticResponse:n}),r,!1).subscribe({next:function(n){dr(n)&&"none"===h?m=new $r({graphQLErrors:n.errors}):(s.mutationStore.markMutationResult(e),"no-cache"!==f&&s.dataStore.markMutationResult({mutationId:e,result:n,document:t,variables:r,updateQueries:o(),update:c}),p=n)},error:function(t){s.mutationStore.markMutationError(e,t),s.dataStore.markMutationComplete({mutationId:e,optimisticResponse:n}),s.broadcastQueries(),s.setQuery(e,function(){return{document:null}}),l(new $r({networkError:t}))},complete:function(){if(m&&s.mutationStore.markMutationError(e,m),s.dataStore.markMutationComplete({mutationId:e,optimisticResponse:n}),s.broadcastQueries(),m)l(m);else{"function"==typeof a&&(a=a(p));var t=[];Ur(a)&&a.forEach(function(e){if("string"==typeof e)s.queries.forEach(function(r){var n=r.observableQuery;n&&n.queryName===e&&t.push(n.refetch())});else{var r={query:e.query,variables:e.variables,fetchPolicy:"network-only"};e.context&&(r.context=e.context),t.push(s.query(r))}}),Promise.all(u?t:[]).then(function(){s.setQuery(e,function(){return{document:null}}),"ignore"===h&&p&&dr(p)&&delete p.errors,i(p)})}}})})]}})})},e.prototype.fetchQuery=function(e,t,r,n){return ut(this,void 0,void 0,function(){var i,o,a,s,u,c,l,h,f,p,d,m,y,v,g,b,w,R,E=this;return ct(this,function(k){switch(k.label){case 0:return i=t.metadata,o=void 0===i?null:i,a=t.fetchPolicy,s=void 0===a?"cache-first":a,u=t.context,c=void 0===u?{}:u,l=this.transform(t.query).document,h=this.getVariables(l,t.variables),this.transform(l).hasClientExports?[4,this.localState.addExportedVariables(l,h,c)]:[3,2];case 1:h=k.sent(),k.label=2;case 2:if(t=st(st({},t),{variables:h}),d=p="network-only"===s||"no-cache"===s,p||(m=this.dataStore.getCache().diff({query:l,variables:h,returnPartialData:!0,optimistic:!1}),y=m.complete,v=m.result,d=!y||"cache-and-network"===s,f=v),g=d&&"cache-only"!==s&&"standby"!==s,jt(["live"],l)&&(g=!0),b=this.idCounter++,w="no-cache"!==s?this.updateQueryWatch(e,l,t):void 0,this.setQuery(e,function(){return{document:l,lastRequestId:b,invalidated:!0,cancel:w}}),this.invalidate(n),this.queryStore.initQuery({queryId:e,document:l,storePreviousVariables:g,variables:h,isPoll:r===jr.poll,isRefetch:r===jr.refetch,metadata:o,fetchMoreForQueryId:n}),this.broadcastQueries(),g){if(R=this.fetchRequest({requestId:b,queryId:e,document:l,options:t,fetchMoreForQueryId:n}).catch(function(t){throw t.hasOwnProperty("graphQLErrors")?t:(b>=E.getQuery(e).lastRequestId&&(E.queryStore.markQueryError(e,t,n),E.invalidate(e),E.invalidate(n),E.broadcastQueries()),new $r({networkError:t}))}),"cache-and-network"!==s)return[2,R];R.catch(function(){})}return this.queryStore.markQueryResultClient(e,!g),this.invalidate(e),this.invalidate(n),this.transform(l).hasForcedResolvers?[2,this.localState.runResolvers({document:l,remoteResult:{data:f},context:c,variables:h,onlyRunForcedResolvers:!0}).then(function(r){return E.markQueryResult(e,r,t,n),E.broadcastQueries(),r})]:(this.broadcastQueries(),[2,{data:f}])}})})},e.prototype.markQueryResult=function(e,t,r,n){var i=r.fetchPolicy,o=r.variables,a=r.errorPolicy;"no-cache"===i?this.setQuery(e,function(){return{newData:{result:t.data,complete:!0}}}):this.dataStore.markQueryResult(t,this.getQuery(e).document,o,n,"ignore"===a||"all"===a)},e.prototype.queryListenerForObserver=function(e,t,r){var n=this;function i(e,t){if(r[e])try{r[e](t)}catch(e){}}return function(r,o){if(n.invalidate(e,!1),r){var a=n.getQuery(e),s=a.observableQuery,u=a.document,c=s?s.options.fetchPolicy:t.fetchPolicy;if("standby"!==c){var l=Lr(r.networkStatus),h=s&&s.getLastResult(),f=!(!h||h.networkStatus===r.networkStatus),p=t.returnPartialData||!o&&r.previousVariables||f&&t.notifyOnNetworkStatusChange||"cache-only"===c||"cache-and-network"===c;if(!l||p){var d=Ur(r.graphQLErrors),m=s&&s.options.errorPolicy||t.errorPolicy||"none";if("none"===m&&d||r.networkError)return i("error",new $r({graphQLErrors:r.graphQLErrors,networkError:r.networkError}));try{var y=void 0,v=void 0;if(o)"no-cache"!==c&&"network-only"!==c&&n.setQuery(e,function(){return{newData:null}}),y=o.result,v=!o.complete;else{var g=s&&s.getLastError(),b="none"!==m&&(g&&g.graphQLErrors)!==r.graphQLErrors;if(h&&h.data&&!b)y=h.data,v=!1;else{var w=n.dataStore.getCache().diff({query:u,variables:r.previousVariables||r.variables,returnPartialData:!0,optimistic:!0});y=w.result,v=!w.complete}}var R=v&&!(t.returnPartialData||"cache-only"===c),E={data:R?h&&h.data:y,loading:l,networkStatus:r.networkStatus,stale:R};"all"===m&&d&&(E.errors=r.graphQLErrors),i("next",E)}catch(e){i("error",new $r({networkError:e}))}}}}}},e.prototype.transform=function(e){var t,r=this.transformCache;if(!r.has(e)){var n=this.dataStore.getCache(),i=n.transformDocument(e),o=(t=n.transformForLink(i),ir([or],Kt(t))),a=this.localState.clientQuery(i),s=this.localState.serverQuery(o),u={document:i,hasClientExports:$t(i),hasForcedResolvers:this.localState.shouldForceResolvers(i),clientQuery:a,serverQuery:s,defaultVars:Xt(Gt(i))},c=function(e){e&&!r.has(e)&&r.set(e,u)};c(e),c(i),c(a),c(s)}return r.get(e)},e.prototype.getVariables=function(e,t){return st(st({},this.transform(e).defaultVars),t)},e.prototype.watchQuery=function(e,t){void 0===t&&(t=!0),yt("standby"!==e.fetchPolicy,11),e.variables=this.getVariables(e.query,e.variables),void 0===e.notifyOnNetworkStatusChange&&(e.notifyOnNetworkStatusChange=!1);var r=st({},e);return new Qr({queryManager:this,options:r,shouldSubscribe:t})},e.prototype.query=function(e){var t=this;return yt(e.query,12),yt("Document"===e.query.kind,13),yt(!e.returnPartialData,14),yt(!e.pollInterval,15),new Promise(function(r,n){var i=t.watchQuery(e,!1);t.fetchQueryRejectFns.set("query:"+i.queryId,n),i.result().then(r,n).then(function(){return t.fetchQueryRejectFns.delete("query:"+i.queryId)})})},e.prototype.generateQueryId=function(){return String(this.idCounter++)},e.prototype.stopQueryInStore=function(e){this.stopQueryInStoreNoBroadcast(e),this.broadcastQueries()},e.prototype.stopQueryInStoreNoBroadcast=function(e){this.stopPollingQuery(e),this.queryStore.stopQuery(e),this.invalidate(e)},e.prototype.addQueryListener=function(e,t){this.setQuery(e,function(e){return e.listeners.add(t),{invalidated:!1}})},e.prototype.updateQueryWatch=function(e,t,r){var n=this,i=this.getQuery(e).cancel;return i&&i(),this.dataStore.getCache().watch({query:t,variables:r.variables,optimistic:!0,previousResult:function(){var t=null,r=n.getQuery(e).observableQuery;if(r){var i=r.getLastResult();i&&(t=i.data)}return t},callback:function(t){n.setQuery(e,function(){return{invalidated:!0,newData:t}})}})},e.prototype.addObservableQuery=function(e,t){this.setQuery(e,function(){return{observableQuery:t}})},e.prototype.removeObservableQuery=function(e){var t=this.getQuery(e).cancel;this.setQuery(e,function(){return{observableQuery:null}}),t&&t()},e.prototype.clearStore=function(){this.fetchQueryRejectFns.forEach(function(e){e(new mt(16))});var e=[];return this.queries.forEach(function(t,r){t.observableQuery&&e.push(r)}),this.queryStore.reset(e),this.mutationStore.reset(),this.dataStore.reset()},e.prototype.resetStore=function(){var e=this;return this.clearStore().then(function(){return e.reFetchObservableQueries()})},e.prototype.reFetchObservableQueries=function(e){var t=this;void 0===e&&(e=!1);var r=[];return this.queries.forEach(function(n,i){var o=n.observableQuery;if(o){var a=o.options.fetchPolicy;o.resetLastResults(),"cache-only"===a||!e&&"standby"===a||r.push(o.refetch()),t.setQuery(i,function(){return{newData:null}}),t.invalidate(i)}}),this.broadcastQueries(),Promise.all(r)},e.prototype.observeQuery=function(e,t,r){return this.addQueryListener(e,this.queryListenerForObserver(e,t,r)),this.fetchQuery(e,t)},e.prototype.startQuery=function(e,t,r){return this.addQueryListener(e,r),this.fetchQuery(e,t).catch(function(){}),e},e.prototype.startGraphQLSubscription=function(e){var t=this,r=e.query,n=e.fetchPolicy,i=e.variables;r=this.transform(r).document,i=this.getVariables(r,i);var o=function(e){return t.getObservableFromLink(r,{},e,!1).map(function(i){if(n&&"no-cache"===n||(t.dataStore.markSubscriptionResult(i,r,e),t.broadcastQueries()),dr(i))throw new $r({graphQLErrors:i.errors});return i})};if(this.transform(r).hasClientExports){var a=this.localState.addExportedVariables(r,i).then(o);return new Mr(function(e){var t=null;return a.then(function(r){return t=r.subscribe(e)},e.error),function(){return t&&t.unsubscribe()}})}return o(i)},e.prototype.stopQuery=function(e){this.stopQueryNoBroadcast(e),this.broadcastQueries()},e.prototype.stopQueryNoBroadcast=function(e){this.stopQueryInStoreNoBroadcast(e),this.removeQuery(e)},e.prototype.removeQuery=function(e){this.fetchQueryRejectFns.delete("query:"+e),this.fetchQueryRejectFns.delete("fetchRequest:"+e),this.getQuery(e).subscriptions.forEach(function(e){return e.unsubscribe()}),this.queries.delete(e)},e.prototype.getCurrentQueryResult=function(e,t){void 0===t&&(t=!0);var r=e.options,n=r.variables,i=r.query,o=r.fetchPolicy,a=r.returnPartialData,s=e.getLastResult(),u=this.getQuery(e.queryId).newData;if(u&&u.complete)return{data:u.result,partial:!1};if("no-cache"===o||"network-only"===o)return{data:void 0,partial:!1};var c=this.dataStore.getCache().diff({query:i,variables:n,previousResult:s?s.data:void 0,returnPartialData:!0,optimistic:t}),l=c.result,h=c.complete;return{data:h||a?l:void 0,partial:!h}},e.prototype.getQueryWithPreviousResult=function(e){var t;if("string"==typeof e){var r=this.getQuery(e).observableQuery;yt(r,17),t=r}else t=e;var n=t.options,i=n.variables,o=n.query;return{previousResult:this.getCurrentQueryResult(t,!1).data,variables:i,document:o}},e.prototype.broadcastQueries=function(){var e=this;this.onBroadcast(),this.queries.forEach(function(t,r){t.invalidated&&t.listeners.forEach(function(n){n&&n(e.queryStore.get(r),t.newData)})})},e.prototype.getLocalState=function(){return this.localState},e.prototype.getObservableFromLink=function(e,t,r,n){var i,o=this;void 0===n&&(n=this.queryDeduplication);var a=this.transform(e).serverQuery;if(a){var s=this.inFlightLinkObservables,u=this.link,c={query:a,variables:r,operationName:Wt(a)||void 0,context:this.prepareContext(st(st({},t),{forceFetch:!n}))};if(t=c.context,n){var l=s.get(a)||new Map;s.set(a,l);var h=JSON.stringify(r);if(!(i=l.get(h))){l.set(h,i=Jr(Fr(u,c)));var f=function(){l.delete(h),l.size||s.delete(a),p.unsubscribe()},p=i.subscribe({next:f,error:f,complete:f})}}else i=Jr(Fr(u,c))}else i=Mr.of({data:{}}),t=this.prepareContext(t);var d=this.transform(e).clientQuery;return d&&(i=function(e){return new Mr(function(n){var i=n.next,a=n.error,s=n.complete,u=0,c=!1,l={next:function(e){++u,new Promise(function(n){n(function(e){return o.localState.runResolvers({document:d,remoteResult:e,context:t,variables:r})}(e))}).then(function(e){--u,i&&i.call(n,e),c&&l.complete()},function(e){--u,a&&a.call(n,e)})},error:function(e){a&&a.call(n,e)},complete:function(){c=!0,u||s&&s.call(n)}},h=e.subscribe(l);return function(){return h.unsubscribe()}})}(i)),i},e.prototype.fetchRequest=function(e){var t,r,n=this,i=e.requestId,o=e.queryId,a=e.document,s=e.options,u=e.fetchMoreForQueryId,c=s.variables,l=s.errorPolicy,h=void 0===l?"none":l,f=s.fetchPolicy;return new Promise(function(e,l){var p=n.getObservableFromLink(a,s.context,c),d="fetchRequest:"+o;n.fetchQueryRejectFns.set(d,l);var m=function(){n.fetchQueryRejectFns.delete(d),n.setQuery(o,function(e){e.subscriptions.delete(y)})},y=p.map(function(e){if(i>=n.getQuery(o).lastRequestId&&(n.markQueryResult(o,e,s,u),n.queryStore.markQueryResult(o,e,u),n.invalidate(o),n.invalidate(u),n.broadcastQueries()),"none"===h&&Ur(e.errors))return l(new $r({graphQLErrors:e.errors}));if("all"===h&&(r=e.errors),u||"no-cache"===f)t=e.data;else{var p=n.dataStore.getCache().diff({variables:c,query:a,optimistic:!1,returnPartialData:!0}),d=p.result;(p.complete||s.returnPartialData)&&(t=d)}}).subscribe({error:function(e){m(),l(e)},complete:function(){m(),e({data:t,errors:r,loading:!1,networkStatus:Dr.ready,stale:!1})}});n.setQuery(o,function(e){e.subscriptions.add(y)})})},e.prototype.getQuery=function(e){return this.queries.get(e)||{listeners:new Set,invalidated:!1,document:null,newData:null,lastRequestId:1,observableQuery:null,subscriptions:new Set}},e.prototype.setQuery=function(e,t){var r=this.getQuery(e),n=st(st({},r),t(r));this.queries.set(e,n)},e.prototype.invalidate=function(e,t){void 0===t&&(t=!0),e&&this.setQuery(e,function(){return{invalidated:t}})},e.prototype.prepareContext=function(e){void 0===e&&(e={});var t=this.localState.prepareContext(e);return st(st({},t),{clientAwareness:this.clientAwareness})},e.prototype.checkInFlight=function(e){var t=this.queryStore.get(e);return t&&t.networkStatus!==Dr.ready&&t.networkStatus!==Dr.error},e.prototype.startPollingQuery=function(e,t,r){var n=this,i=e.pollInterval;if(yt(i,18),!this.ssrMode){var o=this.pollingInfoByQueryId.get(t);o||this.pollingInfoByQueryId.set(t,o={}),o.interval=i,o.options=st(st({},e),{fetchPolicy:"network-only"});var a=function(){var e=n.pollingInfoByQueryId.get(t);e&&(n.checkInFlight(t)?s():n.fetchQuery(t,e.options,jr.poll).then(s,s))},s=function(){var e=n.pollingInfoByQueryId.get(t);e&&(clearTimeout(e.timeout),e.timeout=setTimeout(a,e.interval))};r&&this.addQueryListener(t,r),s()}return t},e.prototype.stopPollingQuery=function(e){this.pollingInfoByQueryId.delete(e)},e}(),Zr=function(){function e(e){this.cache=e}return e.prototype.getCache=function(){return this.cache},e.prototype.markQueryResult=function(e,t,r,n,i){void 0===i&&(i=!1);var o=!dr(e);i&&dr(e)&&e.data&&(o=!0),!n&&o&&this.cache.write({result:e.data,dataId:"ROOT_QUERY",query:t,variables:r})},e.prototype.markSubscriptionResult=function(e,t,r){dr(e)||this.cache.write({result:e.data,dataId:"ROOT_SUBSCRIPTION",query:t,variables:r})},e.prototype.markMutationInit=function(e){var t,r=this;e.optimisticResponse&&(t="function"==typeof e.optimisticResponse?e.optimisticResponse(e.variables):e.optimisticResponse,this.cache.recordOptimisticTransaction(function(n){var i=r.cache;r.cache=n;try{r.markMutationResult({mutationId:e.mutationId,result:{data:t},document:e.document,variables:e.variables,updateQueries:e.updateQueries,update:e.update})}finally{r.cache=i}},e.mutationId))},e.prototype.markMutationResult=function(e){var t=this;if(!dr(e.result)){var r=[{result:e.result.data,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}],n=e.updateQueries;n&&Object.keys(n).forEach(function(i){var o=n[i],a=o.query,s=o.updater,u=t.cache.diff({query:a.document,variables:a.variables,returnPartialData:!0,optimistic:!1}),c=u.result;if(u.complete){var l=pr(function(){return s(c,{mutationResult:e.result,queryName:Wt(a.document)||void 0,queryVariables:a.variables})});l&&r.push({result:l,dataId:"ROOT_QUERY",query:a.document,variables:a.variables})}}),this.cache.performTransaction(function(t){r.forEach(function(e){return t.write(e)});var n=e.update;n&&pr(function(){return n(t,e.result)})})}},e.prototype.markMutationComplete=function(e){var t=e.mutationId;e.optimisticResponse&&this.cache.removeOptimistic(t)},e.prototype.markUpdateQueryResult=function(e,t,r){this.cache.write({result:r,dataId:"ROOT_QUERY",variables:t,query:e})},e.prototype.reset=function(){return this.cache.reset()},e}(),en=function(){function e(e){var t=this;this.defaultOptions={},this.resetStoreCallbacks=[],this.clearStoreCallbacks=[];var r=e.cache,n=e.ssrMode,i=void 0!==n&&n,o=e.ssrForceFetchDelay,a=void 0===o?0:o,s=e.connectToDevTools,u=e.queryDeduplication,c=void 0===u||u,l=e.defaultOptions,h=e.assumeImmutableResults,f=void 0!==h&&h,p=e.resolvers,d=e.typeDefs,m=e.fragmentMatcher,y=e.name,v=e.version,g=e.link;if(!g&&p&&(g=qr.empty()),!g||!r)throw new mt(4);this.link=g,this.cache=r,this.store=new Zr(r),this.disableNetworkFetches=i||a>0,this.queryDeduplication=c,this.defaultOptions=l||{},this.typeDefs=d,a&&setTimeout(function(){return t.disableNetworkFetches=!1},a),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),void 0!==s&&s&&"undefined"!=typeof window&&(window.__APOLLO_CLIENT__=this),this.version="2.6.10",this.localState=new Hr({cache:r,client:this,resolvers:p,fragmentMatcher:m}),this.queryManager=new Xr({link:this.link,store:this.store,queryDeduplication:c,ssrMode:i,clientAwareness:{name:y,version:v},localState:this.localState,assumeImmutableResults:f,onBroadcast:function(){t.devToolsHookCb&&t.devToolsHookCb({action:{},state:{queries:t.queryManager.queryStore.getStore(),mutations:t.queryManager.mutationStore.getStore()},dataWithOptimisticResults:t.cache.extract(!0)})}})}return e.prototype.stop=function(){this.queryManager.stop()},e.prototype.watchQuery=function(e){return this.defaultOptions.watchQuery&&(e=st(st({},this.defaultOptions.watchQuery),e)),!this.disableNetworkFetches||"network-only"!==e.fetchPolicy&&"cache-and-network"!==e.fetchPolicy||(e=st(st({},e),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(e)},e.prototype.query=function(e){return this.defaultOptions.query&&(e=st(st({},this.defaultOptions.query),e)),yt("cache-and-network"!==e.fetchPolicy,5),this.disableNetworkFetches&&"network-only"===e.fetchPolicy&&(e=st(st({},e),{fetchPolicy:"cache-first"})),this.queryManager.query(e)},e.prototype.mutate=function(e){return this.defaultOptions.mutate&&(e=st(st({},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){var t=this.cache.writeQuery(e);return this.queryManager.broadcastQueries(),t},e.prototype.writeFragment=function(e){var t=this.cache.writeFragment(e);return this.queryManager.broadcastQueries(),t},e.prototype.writeData=function(e){var t=this.cache.writeData(e);return this.queryManager.broadcastQueries(),t},e.prototype.__actionHookForDevTools=function(e){this.devToolsHookCb=e},e.prototype.__requestRaw=function(e){return Fr(this.link,e)},e.prototype.initQueryManager=function(){return this.queryManager},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}(),tn=function(e,t){return tn=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},tn(e,t)};function rn(e,t){function r(){this.constructor=e}tn(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var nn=function(){return nn=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},nn.apply(this,arguments)};function on(e){return{kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GeneratedClientQuery"},selectionSet:an(e)}]}}function an(e){if("number"==typeof e||"boolean"==typeof e||"string"==typeof e||null==e)return null;if(Array.isArray(e))return an(e[0]);var t=[];return Object.keys(e).forEach(function(r){var n={kind:"Field",name:{kind:"Name",value:r},selectionSet:an(e[r])||void 0};t.push(n)}),{kind:"SelectionSet",selections:t}}var sn,un={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:null,variableDefinitions:null,directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",alias:null,name:{kind:"Name",value:"__typename"},arguments:[],directives:[],selectionSet:null}]}}]},cn=function(){function e(){}return e.prototype.transformDocument=function(e){return e},e.prototype.transformForLink=function(e){return e},e.prototype.readQuery=function(e,t){return void 0===t&&(t=!1),this.read({query:e.query,variables:e.variables,optimistic:t})},e.prototype.readFragment=function(e,t){return void 0===t&&(t=!1),this.read({query:Vt(e.fragment,e.fragmentName),variables:e.variables,rootId:e.id,optimistic:t})},e.prototype.writeQuery=function(e){this.write({dataId:"ROOT_QUERY",result:e.data,query:e.query,variables:e.variables})},e.prototype.writeFragment=function(e){this.write({dataId:e.id,result:e.data,variables:e.variables,query:Vt(e.fragment,e.fragmentName)})},e.prototype.writeData=function(e){var t,r,n=e.id,i=e.data;if(void 0!==n){var o=null;try{o=this.read({rootId:n,optimistic:!1,query:un})}catch(e){}var a=o&&o.__typename||"__ClientData",s=Object.assign({__typename:a},i);this.writeFragment({id:n,fragment:(t=s,r=a,{kind:"Document",definitions:[{kind:"FragmentDefinition",typeCondition:{kind:"NamedType",name:{kind:"Name",value:r||"__FakeType"}},name:{kind:"Name",value:"GeneratedClientQuery"},selectionSet:an(t)}]}),data:s})}else this.writeQuery({query:on(i),data:i})},e}();sn||(sn={});var ln=null,hn={},fn=1,pn="@wry/context:Slot",dn=Array,mn=dn[pn]||function(){var e=function(){function e(){this.id=["slot",fn++,Date.now(),Math.random().toString(36).slice(2)].join(":")}return e.prototype.hasValue=function(){for(var e=ln;e;e=e.parent)if(this.id in e.slots){var t=e.slots[this.id];if(t===hn)break;return e!==ln&&(ln.slots[this.id]=t),!0}return ln&&(ln.slots[this.id]=hn),!1},e.prototype.getValue=function(){if(this.hasValue())return ln.slots[this.id]},e.prototype.withValue=function(e,t,r,n){var i,o=((i={__proto__:null})[this.id]=e,i),a=ln;ln={parent:a,slots:o};try{return t.apply(n,r)}finally{ln=a}},e.bind=function(e){var t=ln;return function(){var r=ln;try{return ln=t,e.apply(this,arguments)}finally{ln=r}}},e.noContext=function(e,t,r){if(!ln)return e.apply(r,t);var n=ln;try{return ln=null,e.apply(r,t)}finally{ln=n}},e}();try{Object.defineProperty(dn,pn,{value:dn[pn]=e,enumerable:!1,writable:!1,configurable:!1})}finally{return e}}();function yn(){}mn.bind,mn.noContext;var vn=function(){function e(e,t){void 0===e&&(e=1/0),void 0===t&&(t=yn),this.max=e,this.dispose=t,this.map=new Map,this.newest=null,this.oldest=null}return e.prototype.has=function(e){return this.map.has(e)},e.prototype.get=function(e){var t=this.getEntry(e);return t&&t.value},e.prototype.getEntry=function(e){var t=this.map.get(e);if(t&&t!==this.newest){var r=t.older,n=t.newer;n&&(n.older=r),r&&(r.newer=n),t.older=this.newest,t.older.newer=t,t.newer=null,this.newest=t,t===this.oldest&&(this.oldest=n)}return t},e.prototype.set=function(e,t){var r=this.getEntry(e);return r?r.value=t:(r={key:e,value:t,newer:null,older:this.newest},this.newest&&(this.newest.newer=r),this.newest=r,this.oldest=this.oldest||r,this.map.set(e,r),r.value)},e.prototype.clean=function(){for(;this.oldest&&this.map.size>this.max;)this.delete(this.oldest.key)},e.prototype.delete=function(e){var t=this.map.get(e);return!!t&&(t===this.newest&&(this.newest=t.older),t===this.oldest&&(this.oldest=t.newer),t.newer&&(t.newer.older=t.older),t.older&&(t.older.newer=t.newer),this.map.delete(e),this.dispose(t.value,e),!0)},e}(),gn=new mn,bn=[],wn=[];function Rn(e,t){if(!e)throw new Error(t||"assertion failure")}function En(e){switch(e.length){case 0:throw new Error("unknown value");case 1:return e[0];case 2:throw e[1]}}var kn=function(){function e(t,r){this.fn=t,this.args=r,this.parents=new Set,this.childValues=new Map,this.dirtyChildren=null,this.dirty=!0,this.recomputing=!1,this.value=[],++e.count}return e.prototype.recompute=function(){if(Rn(!this.recomputing,"already recomputing"),function(e){var t=gn.getValue();if(t)return e.parents.add(t),t.childValues.has(e)||t.childValues.set(e,[]),xn(e)?In(t,e):Tn(t,e),t}(this)||!Pn(this))return xn(this)?(t=Cn(e=this),gn.withValue(e,On,[e]),function(e){if("function"==typeof e.subscribe)try{qn(e),e.unsubscribe=e.subscribe.apply(null,e.args)}catch(t){return e.setDirty(),!1}return!0}(e)&&function(e){e.dirty=!1,xn(e)||_n(e)}(e),t.forEach(Pn),En(e.value)):En(this.value);var e,t},e.prototype.setDirty=function(){this.dirty||(this.dirty=!0,this.value.length=0,Sn(this),qn(this))},e.prototype.dispose=function(){var e=this;Cn(this).forEach(Pn),qn(this),this.parents.forEach(function(t){t.setDirty(),Nn(t,e)})},e.count=0,e}();function On(e){e.recomputing=!0,e.value.length=0;try{e.value[0]=e.fn.apply(null,e.args)}catch(t){e.value[1]=t}e.recomputing=!1}function xn(e){return e.dirty||!(!e.dirtyChildren||!e.dirtyChildren.size)}function Sn(e){e.parents.forEach(function(t){return In(t,e)})}function _n(e){e.parents.forEach(function(t){return Tn(t,e)})}function In(e,t){if(Rn(e.childValues.has(t)),Rn(xn(t)),e.dirtyChildren){if(e.dirtyChildren.has(t))return}else e.dirtyChildren=wn.pop()||new Set;e.dirtyChildren.add(t),Sn(e)}function Tn(e,t){Rn(e.childValues.has(t)),Rn(!xn(t));var r,n,i,o=e.childValues.get(t);0===o.length?e.childValues.set(t,t.value.slice(0)):(r=o,n=t.value,(i=r.length)>0&&i===n.length&&r[i-1]===n[i-1]||e.setDirty()),An(e,t),xn(e)||_n(e)}function An(e,t){var r=e.dirtyChildren;r&&(r.delete(t),0===r.size&&(wn.length<100&&wn.push(r),e.dirtyChildren=null))}function Pn(e){return 0===e.parents.size&&"function"==typeof e.reportOrphan&&!0===e.reportOrphan()}function Cn(e){var t=bn;return e.childValues.size>0&&(t=[],e.childValues.forEach(function(r,n){Nn(e,n),t.push(n)})),Rn(null===e.dirtyChildren),t}function Nn(e,t){t.parents.delete(e),e.childValues.delete(t),An(e,t)}function qn(e){var t=e.unsubscribe;"function"==typeof t&&(e.unsubscribe=void 0,t())}var Fn=function(){function e(e){this.weakness=e}return e.prototype.lookup=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return this.lookupArray(e)},e.prototype.lookupArray=function(e){var t=this;return e.forEach(function(e){return t=t.getChildTrie(e)}),t.data||(t.data=Object.create(null))},e.prototype.getChildTrie=function(t){var r=this.weakness&&function(e){switch(typeof e){case"object":if(null===e)break;case"function":return!0}return!1}(t)?this.weak||(this.weak=new WeakMap):this.strong||(this.strong=new Map),n=r.get(t);return n||r.set(t,n=new e(this.weakness)),n},e}(),Dn=new Fn("function"==typeof WeakMap);function Bn(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Dn.lookupArray(e)}var Ln=new Set;function Mn(e,t){void 0===t&&(t=Object.create(null));var r=new vn(t.max||Math.pow(2,16),function(e){return e.dispose()}),n=!!t.disposable,i=t.makeCacheKey||Bn;function o(){if(!n||gn.hasValue()){var o=i.apply(null,arguments);if(void 0===o)return e.apply(null,arguments);var a=Array.prototype.slice.call(arguments),s=r.get(o);s?s.args=a:(s=new kn(e,a),r.set(o,s),s.subscribe=t.subscribe,n&&(s.reportOrphan=function(){return r.delete(o)}));var u=s.recompute();return r.set(o,s),Ln.add(r),gn.hasValue()||(Ln.forEach(function(e){return e.clean()}),Ln.clear()),n?void 0:u}}return o.dirty=function(){var e=i.apply(null,arguments),t=void 0!==e&&r.get(e);t&&t.setDirty()},o}var Un=!1;function jn(){var e=!Un;return!0===fr("test")||(Un=!0),e}var $n=function(){function e(){}return e.prototype.ensureReady=function(){return Promise.resolve()},e.prototype.canBypassInit=function(){return!0},e.prototype.match=function(e,t,r){var n=r.store.get(e.id),i="ROOT_QUERY"===e.id;if(!n)return i;var o=n.__typename,a=void 0===o?i&&"Query":o;return a&&a===t||(jn(),"heuristic")},e}(),Qn=function(){function e(e){e&&e.introspectionQueryResultData?(this.possibleTypesMap=this.parseIntrospectionResult(e.introspectionQueryResultData),this.isReady=!0):this.isReady=!1,this.match=this.match.bind(this)}return e.prototype.match=function(e,t,r){yt(this.isReady,1);var n=r.store.get(e.id),i="ROOT_QUERY"===e.id;if(!n)return i;var o=n.__typename,a=void 0===o?i&&"Query":o;if(yt(a,2),a===t)return!0;var s=this.possibleTypesMap[t];return!!(a&&s&&s.indexOf(a)>-1)},e.prototype.parseIntrospectionResult=function(e){var t={};return e.__schema.types.forEach(function(e){"UNION"!==e.kind&&"INTERFACE"!==e.kind||(t[e.name]=e.possibleTypes.map(function(e){return e.name}))}),t},e}(),Vn=Object.prototype.hasOwnProperty,zn=function(){function e(e){var t=this;void 0===e&&(e=Object.create(null)),this.data=e,this.depend=Mn(function(e){return t.data[e]},{disposable:!0,makeCacheKey:function(e){return e}})}return e.prototype.toObject=function(){return this.data},e.prototype.get=function(e){return this.depend(e),this.data[e]},e.prototype.set=function(e,t){t!==this.data[e]&&(this.data[e]=t,this.depend.dirty(e))},e.prototype.delete=function(e){Vn.call(this.data,e)&&(delete this.data[e],this.depend.dirty(e))},e.prototype.clear=function(){this.replace(null)},e.prototype.replace=function(e){var t=this;e?(Object.keys(e).forEach(function(r){t.set(r,e[r])}),Object.keys(this.data).forEach(function(r){Vn.call(e,r)||t.delete(r)})):Object.keys(this.data).forEach(function(e){t.delete(e)})},e}();function Kn(e){return new zn(e)}var Gn=function(){function e(e){var t=this,r=void 0===e?{}:e,n=r.cacheKeyRoot,i=void 0===n?new Fn(ur):n,o=r.freezeResults,a=void 0!==o&&o,s=this,u=s.executeStoreQuery,c=s.executeSelectionSet,l=s.executeSubSelectedArray;this.freezeResults=a,this.executeStoreQuery=Mn(function(e){return u.call(t,e)},{makeCacheKey:function(e){var t=e.query,r=e.rootValue,n=e.contextValue,o=e.variableValues,a=e.fragmentMatcher;if(n.store instanceof zn)return i.lookup(n.store,t,a,JSON.stringify(o),r.id)}}),this.executeSelectionSet=Mn(function(e){return c.call(t,e)},{makeCacheKey:function(e){var t=e.selectionSet,r=e.rootValue,n=e.execContext;if(n.contextValue.store instanceof zn)return i.lookup(n.contextValue.store,t,n.fragmentMatcher,JSON.stringify(n.variableValues),r.id)}}),this.executeSubSelectedArray=Mn(function(e){return l.call(t,e)},{makeCacheKey:function(e){var t=e.field,r=e.array,n=e.execContext;if(n.contextValue.store instanceof zn)return i.lookup(n.contextValue.store,t,r,JSON.stringify(n.variableValues))}})}return e.prototype.readQueryFromStore=function(e){return this.diffQueryAgainstStore(nn(nn({},e),{returnPartialData:!1})).result},e.prototype.diffQueryAgainstStore=function(e){var t,r=e.store,n=e.query,i=e.variables,o=e.previousResult,a=e.returnPartialData,s=void 0===a||a,u=e.rootId,c=void 0===u?"ROOT_QUERY":u,l=e.fragmentMatcherFunction,h=e.config;i=zt({},Xt((yt((t=Gt(n))&&"query"===t.operation,6),t)),i);var f={store:r,dataIdFromObject:h&&h.dataIdFromObject,cacheRedirects:h&&h.cacheRedirects||{}},p=this.executeStoreQuery({query:n,rootValue:{type:"id",id:c,generated:!0,typename:"Query"},contextValue:f,variableValues:i,fragmentMatcher:l}),d=p.missing&&p.missing.length>0;return d&&!s&&p.missing.forEach(function(e){if(!e.tolerable)throw new mt(8)}),o&&_t(o,p.result)&&(p.result=o),{result:p.result,complete:!d}},e.prototype.executeStoreQuery=function(e){var t=e.query,r=e.rootValue,n=e.contextValue,i=e.variableValues,o=e.fragmentMatcher,a=void 0===o?Hn:o,s=Jt(t),u={query:t,fragmentMap:Yt(Ht(t)),contextValue:n,variableValues:i,fragmentMatcher:a};return this.executeSelectionSet({selectionSet:s.selectionSet,rootValue:r,execContext:u})},e.prototype.executeSelectionSet=function(e){var t=this,r=e.selectionSet,n=e.rootValue,i=e.execContext,o=i.fragmentMap,a=i.contextValue,s=i.variableValues,u={result:null},c=[],l=a.store.get(n.id),h=l&&l.__typename||"ROOT_QUERY"===n.id&&"Query"||void 0;function f(e){var t;return e.missing&&(u.missing=u.missing||[],(t=u.missing).push.apply(t,e.missing)),e.result}return r.selections.forEach(function(e){var r;if(Ut(e,s))if(Ft(e)){var u=f(t.executeField(l,h,e,i));void 0!==u&&c.push(((r={})[qt(e)]=u,r))}else{var p=void 0;if(Dt(e))p=e;else if(!(p=o[e.name.value]))throw new mt(9);var d=p.typeCondition&&p.typeCondition.name.value,m=!d||i.fragmentMatcher(n,d,a);if(m){var y=t.executeSelectionSet({selectionSet:p.selectionSet,rootValue:n,execContext:i});"heuristic"===m&&y.missing&&(y=nn(nn({},y),{missing:y.missing.map(function(e){return nn(nn({},e),{tolerable:!0})})})),c.push(f(y))}}}),u.result=vr(c),this.freezeResults,u},e.prototype.executeField=function(e,t,r,n){var i=n.variableValues,o=n.contextValue,a=function(e,t,r,n,i,o){var a=o.directives,s=r;(n||a)&&(s=Ct(s,n,a));var u,c=void 0;if(e&&void 0===(c=e[s])&&i.cacheRedirects&&"string"==typeof t){var l=i.cacheRedirects[t];if(l){var h=l[r];h&&(c=h(e,n,{getCacheKey:function(e){var t=i.dataIdFromObject(e);return t&&Lt({id:t,typename:e.__typename})}}))}}return void 0===c?{result:c,missing:[{object:e,fieldName:s,tolerable:!1}]}:(null!=(u=c)&&"object"==typeof u&&"json"===u.type&&(c=c.json),{result:c})}(e,t,r.name.value,Nt(r,i),o,{resultKey:qt(r),directives:Mt(r,i)});return Array.isArray(a.result)?this.combineExecResults(a,this.executeSubSelectedArray({field:r,array:a.result,execContext:n})):r.selectionSet?null==a.result?a:this.combineExecResults(a,this.executeSelectionSet({selectionSet:r.selectionSet,rootValue:a.result,execContext:n})):(Wn(r,a.result),this.freezeResults,a)},e.prototype.combineExecResults=function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return t.forEach(function(t){t.missing&&(e=e||[]).push.apply(e,t.missing)}),{result:t.pop().result,missing:e}},e.prototype.executeSubSelectedArray=function(e){var t,r=this,n=e.field,i=e.array,o=e.execContext;function a(e){return e.missing&&(t=t||[]).push.apply(t,e.missing),e.result}return i=i.map(function(e){return null===e?null:Array.isArray(e)?a(r.executeSubSelectedArray({field:n,array:e,execContext:o})):n.selectionSet?a(r.executeSelectionSet({selectionSet:n.selectionSet,rootValue:e,execContext:o})):(Wn(n,e),e)}),this.freezeResults,{result:i,missing:t}},e}();function Wn(e,t){if(!e.selectionSet&&Bt(t))throw new mt(10)}function Hn(){return!0}var Jn=function(){function e(e){void 0===e&&(e=Object.create(null)),this.data=e}return e.prototype.toObject=function(){return this.data},e.prototype.get=function(e){return this.data[e]},e.prototype.set=function(e,t){this.data[e]=t},e.prototype.delete=function(e){this.data[e]=void 0},e.prototype.clear=function(){this.data=Object.create(null)},e.prototype.replace=function(e){this.data=e||Object.create(null)},e}(),Yn=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="WriteError",t}return rn(t,e),t}(Error),Xn=function(){function e(){}return e.prototype.writeQueryToStore=function(e){var t=e.query,r=e.result,n=e.store,i=void 0===n?Kn():n,o=e.variables,a=e.dataIdFromObject,s=e.fragmentMatcherFunction;return this.writeResultToStore({dataId:"ROOT_QUERY",result:r,document:t,store:i,variables:o,dataIdFromObject:a,fragmentMatcherFunction:s})},e.prototype.writeResultToStore=function(e){var t=e.dataId,r=e.result,n=e.document,i=e.store,o=void 0===i?Kn():i,a=e.variables,s=e.dataIdFromObject,u=e.fragmentMatcherFunction,c=Gt(n);try{return this.writeSelectionSetToStore({result:r,dataId:t,selectionSet:c.selectionSet,context:{store:o,processedData:{},variables:zt({},Xt(c),a),dataIdFromObject:s,fragmentMap:Yt(Ht(n)),fragmentMatcherFunction:u}})}catch(e){throw function(e,t){var r=new Yn("Error writing result to store for query:\n "+JSON.stringify(t));return r.message+="\n"+e.message,r.stack=e.stack,r}(e,n)}},e.prototype.writeSelectionSetToStore=function(e){var t=this,r=e.result,n=e.dataId,i=e.selectionSet,o=e.context,a=o.variables,s=o.store,u=o.fragmentMap;return i.selections.forEach(function(e){var i;if(Ut(e,a))if(Ft(e)){var s=qt(e),c=r[s];if(void 0!==c)t.writeFieldToStore({dataId:n,value:c,field:e,context:o});else{var l=!1,h=!1;e.directives&&e.directives.length&&(l=e.directives.some(function(e){return e.name&&"defer"===e.name.value}),h=e.directives.some(function(e){return e.name&&"client"===e.name.value})),!l&&!h&&o.fragmentMatcherFunction}}else{var f=void 0;Dt(e)?f=e:yt(f=(u||{})[e.name.value],3);var p=!0;if(o.fragmentMatcherFunction&&f.typeCondition){var d=n||"self",m=Lt({id:d,typename:void 0}),y={store:new Jn((i={},i[d]=r,i)),cacheRedirects:{}},v=o.fragmentMatcherFunction(m,f.typeCondition.name.value,y);fr("production"),p=!!v}p&&t.writeSelectionSetToStore({result:r,selectionSet:f.selectionSet,dataId:n,context:o})}}),s},e.prototype.writeFieldToStore=function(e){var t,r,n,i=e.field,o=e.value,a=e.dataId,s=e.context,u=s.variables,c=s.dataIdFromObject,l=s.store,h=function(e,t){var r=null;e.directives&&(r={},e.directives.forEach(function(e){r[e.name.value]={},e.arguments&&e.arguments.forEach(function(n){var i=n.name,o=n.value;return At(r[e.name.value],i,o,t)})}));var n=null;return e.arguments&&e.arguments.length&&(n={},e.arguments.forEach(function(e){var r=e.name,i=e.value;return At(n,r,i,t)})),Ct(e.name.value,n,r)}(i,u);if(i.selectionSet&&null!==o)if(Array.isArray(o)){var f=a+"."+h;r=this.processArrayValue(o,f,i.selectionSet,s)}else{var p=a+"."+h,d=!0;if(Zn(p)||(p="$"+p),c){var m=c(o);yt(!m||!Zn(m),4),(m||"number"==typeof m&&0===m)&&(p=m,d=!1)}ti(p,i,s.processedData)||this.writeSelectionSetToStore({dataId:p,result:o,selectionSet:i.selectionSet,context:s});var y=o.__typename;r=Lt({id:p,typename:y},d);var v=(n=l.get(a))&&n[h];if(v!==r&&Bt(v)){var g=void 0!==v.typename,b=void 0!==y,w=g&&b&&v.typename!==y;yt(!d||v.generated||w,5),yt(!g||b,6),v.generated&&(w?d||l.delete(v.id):ei(v.id,r.id,l))}}else r=null!=o&&"object"==typeof o?{type:"json",json:o}:o;(n=l.get(a))&&_t(r,n[h])||l.set(a,nn(nn({},n),((t={})[h]=r,t)))},e.prototype.processArrayValue=function(e,t,r,n){var i=this;return e.map(function(e,o){if(null===e)return null;var a=t+"."+o;if(Array.isArray(e))return i.processArrayValue(e,a,r,n);var s=!0;if(n.dataIdFromObject){var u=n.dataIdFromObject(e);u&&(a=u,s=!1)}return ti(a,r,n.processedData)||i.writeSelectionSetToStore({dataId:a,result:e,selectionSet:r,context:n}),Lt({id:a,typename:e.__typename},s)})},e}();function Zn(e){return"$"===e[0]}function ei(e,t,r){if(e===t)return!1;var n=r.get(e),i=r.get(t),o=!1;Object.keys(n).forEach(function(e){var t=n[e],a=i[e];Bt(t)&&Zn(t.id)&&Bt(a)&&!_t(t,a)&&ei(t.id,a.id,r)&&(o=!0)}),r.delete(e);var a=nn(nn({},n),i);return _t(a,i)?o:(r.set(t,a),!0)}function ti(e,t,r){if(!r)return!1;if(r[e]){if(r[e].indexOf(t)>=0)return!0;r[e].push(t)}else r[e]=[t];return!1}var ri={fragmentMatcher:new $n,dataIdFromObject:ni,addTypename:!0,resultCaching:!0,freezeResults:!1};function ni(e){if(e.__typename){if(void 0!==e.id)return e.__typename+":"+e.id;if(void 0!==e._id)return e.__typename+":"+e._id}return null}var ii=Object.prototype.hasOwnProperty,oi=function(e){function t(t,r,n){var i=e.call(this,Object.create(null))||this;return i.optimisticId=t,i.parent=r,i.transaction=n,i}return rn(t,e),t.prototype.toObject=function(){return nn(nn({},this.parent.toObject()),this.data)},t.prototype.get=function(e){return ii.call(this.data,e)?this.data[e]:this.parent.get(e)},t}(Jn),ai=function(e){function t(t){void 0===t&&(t={});var r=e.call(this)||this;r.watches=new Set,r.typenameDocumentCache=new Map,r.cacheKeyRoot=new Fn(ur),r.silenceBroadcast=!1,r.config=nn(nn({},ri),t),r.config.customResolvers&&(r.config.cacheRedirects=r.config.customResolvers),r.config.cacheResolvers&&(r.config.cacheRedirects=r.config.cacheResolvers),r.addTypename=!!r.config.addTypename,r.data=r.config.resultCaching?new zn:new Jn,r.optimisticData=r.data,r.storeWriter=new Xn,r.storeReader=new Gn({cacheKeyRoot:r.cacheKeyRoot,freezeResults:t.freezeResults});var n=r,i=n.maybeBroadcastWatch;return r.maybeBroadcastWatch=Mn(function(e){return i.call(r,e)},{makeCacheKey:function(e){if(!e.optimistic&&!e.previousResult)return n.data instanceof zn?n.cacheKeyRoot.lookup(e.query,JSON.stringify(e.variables)):void 0}}),r}return rn(t,e),t.prototype.restore=function(e){return e&&this.data.replace(e),this},t.prototype.extract=function(e){return void 0===e&&(e=!1),(e?this.optimisticData:this.data).toObject()},t.prototype.read=function(e){if("string"==typeof e.rootId&&void 0===this.data.get(e.rootId))return null;var t=this.config.fragmentMatcher,r=t&&t.match;return this.storeReader.readQueryFromStore({store:e.optimistic?this.optimisticData:this.data,query:this.transformDocument(e.query),variables:e.variables,rootId:e.rootId,fragmentMatcherFunction:r,previousResult:e.previousResult,config:this.config})||null},t.prototype.write=function(e){var t=this.config.fragmentMatcher,r=t&&t.match;this.storeWriter.writeResultToStore({dataId:e.dataId,result:e.result,variables:e.variables,document:this.transformDocument(e.query),store:this.data,dataIdFromObject:this.config.dataIdFromObject,fragmentMatcherFunction:r}),this.broadcastWatches()},t.prototype.diff=function(e){var t=this.config.fragmentMatcher,r=t&&t.match;return this.storeReader.diffQueryAgainstStore({store:e.optimistic?this.optimisticData:this.data,query:this.transformDocument(e.query),variables:e.variables,returnPartialData:e.returnPartialData,previousResult:e.previousResult,fragmentMatcherFunction:r,config:this.config})},t.prototype.watch=function(e){var t=this;return this.watches.add(e),function(){t.watches.delete(e)}},t.prototype.evict=function(e){throw new mt(7)},t.prototype.reset=function(){return this.data.clear(),this.broadcastWatches(),Promise.resolve()},t.prototype.removeOptimistic=function(e){for(var t=[],r=0,n=this.optimisticData;n instanceof oi;)n.optimisticId===e?++r:t.push(n),n=n.parent;if(r>0){for(this.optimisticData=n;t.length>0;){var i=t.pop();this.performTransaction(i.transaction,i.optimisticId)}this.broadcastWatches()}},t.prototype.performTransaction=function(e,t){var r=this.data,n=this.silenceBroadcast;this.silenceBroadcast=!0,"string"==typeof t&&(this.data=this.optimisticData=new oi(t,this.optimisticData,e));try{e(this)}finally{this.silenceBroadcast=n,this.data=r}this.broadcastWatches()},t.prototype.recordOptimisticTransaction=function(e,t){return this.performTransaction(e,t)},t.prototype.transformDocument=function(e){if(this.addTypename){var t=this.typenameDocumentCache.get(e);return t||(r=e,t=(0,lt.visit)(Kt(r),{SelectionSet:{enter:function(e,t,r){if(!r||"OperationDefinition"!==r.kind){var n=e.selections;if(n&&!n.some(function(e){return Ft(e)&&("__typename"===e.name.value||0===e.name.value.lastIndexOf("__",0))})){var i=r;if(!(Ft(i)&&i.directives&&i.directives.some(function(e){return"export"===e.name.value})))return bt(bt({},e),{selections:wt(n,[er])})}}}}}),this.typenameDocumentCache.set(e,t),this.typenameDocumentCache.set(t,t)),t}var r;return e},t.prototype.broadcastWatches=function(){var e=this;this.silenceBroadcast||this.watches.forEach(function(t){return e.maybeBroadcastWatch(t)})},t.prototype.maybeBroadcastWatch=function(e){e.callback(this.diff({query:e.query,variables:e.variables,previousResult:e.previousResult&&e.previousResult(),optimistic:e.optimistic}))},t}(cn),si=function(e,t){return si=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},si(e,t)},ui=function(){return ui=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},ui.apply(this,arguments)},ci=function(){return ci=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},ci.apply(this,arguments)},li=u(3230),hi={http:{includeQuery:!0,includeExtensions:!1},headers:{accept:"*/*","content-type":"application/json"},options:{method:"POST"}},fi=function(e,t,r){var n=new Error(r);throw n.name="ServerError",n.response=e,n.statusCode=e.status,n.result=t,n},pi=function(e,t){var r;try{r=JSON.stringify(e)}catch(e){var n=new mt(2);throw n.parseError=e,n}return r},di=function(e){void 0===e&&(e={});var t=e.uri,r=void 0===t?"/graphql":t,n=e.fetch,i=e.includeExtensions,o=e.useGETForQueries,a=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r}(e,["uri","fetch","includeExtensions","useGETForQueries"]);!function(e){if(!e&&"undefined"==typeof fetch)throw new mt(1)}(n),n||(n=fetch);var s={http:{includeExtensions:i},options:a.fetchOptions,credentials:a.credentials,headers:a.headers};return new qr(function(e){var t=function(e,t){return e.getContext().uri||("function"==typeof t?t(e):t||"/graphql")}(e,r),i=e.getContext(),a={};if(i.clientAwareness){var u=i.clientAwareness,c=u.name,l=u.version;c&&(a["apollographql-client-name"]=c),l&&(a["apollographql-client-version"]=l)}var h,f=ui({},a,i.headers),p={http:i.http,options:i.fetchOptions,credentials:i.credentials,headers:f},d=function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var i=ci({},t.options,{headers:t.headers,credentials:t.credentials}),o=t.http;r.forEach(function(e){i=ci({},i,e.options,{headers:ci({},i.headers,e.headers)}),e.credentials&&(i.credentials=e.credentials),o=ci({},o,e.http)});var a=e.operationName,s=e.extensions,u=e.variables,c=e.query,l={operationName:a,variables:u};return o.includeExtensions&&(l.extensions=s),o.includeQuery&&(l.query=(0,li.y)(c)),{options:i,body:l}}(e,hi,s,p),m=d.options,y=d.body;if(!m.signal){var v=function(){if("undefined"==typeof AbortController)return{controller:!1,signal:!1};var e=new AbortController;return{controller:e,signal:e.signal}}(),g=v.controller,b=v.signal;(h=g)&&(m.signal=b)}if(o&&!e.query.definitions.some(function(e){return"OperationDefinition"===e.kind&&"mutation"===e.operation})&&(m.method="GET"),"GET"===m.method){var w=function(e,t){var r=[],n=function(e,t){r.push(e+"="+encodeURIComponent(t))};if("query"in t&&n("query",t.query),t.operationName&&n("operationName",t.operationName),t.variables){var i=void 0;try{i=pi(t.variables)}catch(e){return{parseError:e}}n("variables",i)}if(t.extensions){var o=void 0;try{o=pi(t.extensions)}catch(e){return{parseError:e}}n("extensions",o)}var a="",s=e,u=e.indexOf("#");-1!==u&&(a=e.substr(u),s=e.substr(0,u));var c=-1===s.indexOf("?")?"?":"&";return{newURI:s+c+r.join("&")+a}}(t,y),R=w.newURI,E=w.parseError;if(E)return _r(E);t=R}else try{m.body=pi(y)}catch(E){return _r(E)}return new Er(function(r){var i;return n(t,m).then(function(t){return e.setContext({response:t}),t}).then((i=e,function(e){return e.text().then(function(t){try{return JSON.parse(t)}catch(n){var r=n;return r.name="ServerParseError",r.response=e,r.statusCode=e.status,r.bodyText=t,Promise.reject(r)}}).then(function(t){return e.status>=300&&fi(e,t,"Response not successful: Received status code "+e.status),Array.isArray(t)||t.hasOwnProperty("data")||t.hasOwnProperty("errors")||fi(e,t,"Server response was missing for query '"+(Array.isArray(i)?i.map(function(e){return e.operationName}):i.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(){h&&h.abort()}})})};!function(e){!function(e,t){function r(){this.constructor=e}si(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}(function(t){return e.call(this,di(t).request)||this},e)}(qr);var mi=u(8244),yi=u.n(mi),vi=function(){return vi=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},vi.apply(this,arguments)};function gi(e,t){if(!Boolean(e))throw new Error(t)}function bi(e){return bi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},bi(e)}Object.create,Object.create,"function"==typeof SuppressedError&&SuppressedError,"function"==typeof Symbol&&null!=Symbol.iterator&&Symbol.iterator,"function"==typeof Symbol&&null!=Symbol.asyncIterator&&Symbol.asyncIterator;var wi="function"==typeof Symbol&&null!=Symbol.toStringTag?Symbol.toStringTag:"@@toStringTag";function Ri(e,t){for(var r,n=/\r\n|[\n\r]/g,i=1,o=t+1;(r=n.exec(e.body))&&r.index<t;)i+=1,o=t+1-(r.index+r[0].length);return{line:i,column:o}}function Ei(e){return ki(e.source,Ri(e.source,e.start))}function ki(e,t){var r=e.locationOffset.column-1,n=xi(r)+e.body,i=t.line-1,o=e.locationOffset.line-1,a=t.line+o,s=1===t.line?r:0,u=t.column+s,c="".concat(e.name,":").concat(a,":").concat(u,"\n"),l=n.split(/\r\n|[\n\r]/g),h=l[i];if(h.length>120){for(var f=Math.floor(u/80),p=u%80,d=[],m=0;m<h.length;m+=80)d.push(h.slice(m,m+80));return c+Oi([["".concat(a),d[0]]].concat(d.slice(1,f+1).map(function(e){return["",e]}),[[" ",xi(p-1)+"^"],["",d[f+1]]]))}return c+Oi([["".concat(a-1),l[i-1]],["".concat(a),h],["",xi(u-1)+"^"],["".concat(a+1),l[i+1]]])}function Oi(e){var t=e.filter(function(e){return e[0],void 0!==e[1]}),r=Math.max.apply(Math,t.map(function(e){return e[0].length}));return t.map(function(e){var t,n=e[0],i=e[1];return xi(r-(t=n).length)+t+(i?" | "+i:" |")}).join("\n")}function xi(e){return Array(e+1).join(" ")}function Si(e){return Si="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Si(e)}function _i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function Ii(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ti(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Ai(e,t){return!t||"object"!==Si(t)&&"function"!=typeof t?Pi(e):t}function Pi(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ci(e){var t="function"==typeof Map?new Map:void 0;return Ci=function(e){if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return Ni(e,arguments,Di(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),Fi(n,e)},Ci(e)}function Ni(e,t,r){return Ni=qi()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var i=new(Function.bind.apply(e,n));return r&&Fi(i,r.prototype),i},Ni.apply(null,arguments)}function qi(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}function Fi(e,t){return Fi=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Fi(e,t)}function Di(e){return Di=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Di(e)}var Bi=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Fi(e,t)}(a,e);var t,r,n,i,o=(t=a,r=qi(),function(){var e,n=Di(t);if(r){var i=Di(this).constructor;e=Reflect.construct(n,arguments,i)}else e=n.apply(this,arguments);return Ai(this,e)});function a(e,t,r,n,i,s,u){var c,l,h,f;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(f=o.call(this,e)).name="GraphQLError",f.originalError=null!=s?s:void 0,f.nodes=Li(Array.isArray(t)?t:t?[t]:void 0);for(var p=[],d=0,m=null!==(y=f.nodes)&&void 0!==y?y:[];d<m.length;d++){var y,v=m[d].loc;null!=v&&p.push(v)}p=Li(p),f.source=null!=r?r:null===(c=p)||void 0===c?void 0:c[0].source,f.positions=null!=n?n:null===(l=p)||void 0===l?void 0:l.map(function(e){return e.start}),f.locations=n&&r?n.map(function(e){return Ri(r,e)}):null===(h=p)||void 0===h?void 0:h.map(function(e){return Ri(e.source,e.start)}),f.path=null!=i?i:void 0;var g,b=null==s?void 0:s.extensions;return null==u&&"object"==bi(g=b)&&null!==g?f.extensions=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?_i(Object(r),!0).forEach(function(t){Ii(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_i(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}({},b):f.extensions=null!=u?u:{},Object.defineProperties(Pi(f),{message:{enumerable:!0},locations:{enumerable:null!=f.locations},path:{enumerable:null!=f.path},extensions:{enumerable:null!=f.extensions&&Object.keys(f.extensions).length>0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),null!=s&&s.stack?(Object.defineProperty(Pi(f),"stack",{value:s.stack,writable:!0,configurable:!0}),Ai(f)):(Error.captureStackTrace?Error.captureStackTrace(Pi(f),a):Object.defineProperty(Pi(f),"stack",{value:Error().stack,writable:!0,configurable:!0}),f)}return n=a,(i=[{key:"toString",value:function(){return function(e){var t=e.message;if(e.nodes)for(var r=0,n=e.nodes;r<n.length;r++){var i=n[r];i.loc&&(t+="\n\n"+Ei(i.loc))}else if(e.source&&e.locations)for(var o=0,a=e.locations;o<a.length;o++){var s=a[o];t+="\n\n"+ki(e.source,s)}return t}(this)}},{key:"toJSON",value:function(){return function(e){var t;e||gi(0,"Received null or undefined error.");var r=null!==(t=e.message)&&void 0!==t?t:"An unknown error occurred.",n=e.locations,i=e.path,o=e.extensions;return o&&Object.keys(o).length>0?{message:r,locations:n,path:i,extensions:o}:{message:r,locations:n,path:i}}(this)}},{key:wi,get:function(){return"Object"}}])&&Ti(n.prototype,i),a}(Ci(Error));function Li(e){return void 0===e||0===e.length?void 0:e}function Mi(e,t,r){return new Bi("Syntax Error: ".concat(r),void 0,e,[t])}var Ui=Object.freeze({NAME:"Name",DOCUMENT:"Document",OPERATION_DEFINITION:"OperationDefinition",VARIABLE_DEFINITION:"VariableDefinition",SELECTION_SET:"SelectionSet",FIELD:"Field",ARGUMENT:"Argument",FRAGMENT_SPREAD:"FragmentSpread",INLINE_FRAGMENT:"InlineFragment",FRAGMENT_DEFINITION:"FragmentDefinition",VARIABLE:"Variable",INT:"IntValue",FLOAT:"FloatValue",STRING:"StringValue",BOOLEAN:"BooleanValue",NULL:"NullValue",ENUM:"EnumValue",LIST:"ListValue",OBJECT:"ObjectValue",OBJECT_FIELD:"ObjectField",DIRECTIVE:"Directive",NAMED_TYPE:"NamedType",LIST_TYPE:"ListType",NON_NULL_TYPE:"NonNullType",SCHEMA_DEFINITION:"SchemaDefinition",OPERATION_TYPE_DEFINITION:"OperationTypeDefinition",SCALAR_TYPE_DEFINITION:"ScalarTypeDefinition",OBJECT_TYPE_DEFINITION:"ObjectTypeDefinition",FIELD_DEFINITION:"FieldDefinition",INPUT_VALUE_DEFINITION:"InputValueDefinition",INTERFACE_TYPE_DEFINITION:"InterfaceTypeDefinition",UNION_TYPE_DEFINITION:"UnionTypeDefinition",ENUM_TYPE_DEFINITION:"EnumTypeDefinition",ENUM_VALUE_DEFINITION:"EnumValueDefinition",INPUT_OBJECT_TYPE_DEFINITION:"InputObjectTypeDefinition",DIRECTIVE_DEFINITION:"DirectiveDefinition",SCHEMA_EXTENSION:"SchemaExtension",SCALAR_TYPE_EXTENSION:"ScalarTypeExtension",OBJECT_TYPE_EXTENSION:"ObjectTypeExtension",INTERFACE_TYPE_EXTENSION:"InterfaceTypeExtension",UNION_TYPE_EXTENSION:"UnionTypeExtension",ENUM_TYPE_EXTENSION:"EnumTypeExtension",INPUT_OBJECT_TYPE_EXTENSION:"InputObjectTypeExtension"});const ji="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):void 0;function $i(e){var t=e.prototype.toJSON;"function"==typeof t||function(){if(!Boolean(0))throw new Error("Unexpected invariant triggered.")}(),e.prototype.inspect=t,ji&&(e.prototype[ji]=t)}var Qi=function(){function e(e,t,r){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=r}return e.prototype.toJSON=function(){return{start:this.start,end:this.end}},e}();$i(Qi);var Vi=function(){function e(e,t,r,n,i,o,a){this.kind=e,this.start=t,this.end=r,this.line=n,this.column=i,this.value=a,this.prev=o,this.next=null}return e.prototype.toJSON=function(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}},e}();$i(Vi);var zi=Object.freeze({SOF:"<SOF>",EOF:"<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"});function Ki(e){return Ki="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ki(e)}function Gi(e,t){switch(Ki(e)){case"string":return JSON.stringify(e);case"function":return e.name?"[function ".concat(e.name,"]"):"[function]";case"object":return null===e?"null":function(e,t){if(-1!==t.indexOf(e))return"[Circular]";var r=[].concat(t,[e]),n=function(e){var t=e[String(ji)];return"function"==typeof t?t:"function"==typeof e.inspect?e.inspect:void 0}(e);if(void 0!==n){var i=n.call(e);if(i!==e)return"string"==typeof i?i:Gi(i,r)}else if(Array.isArray(e))return function(e,t){if(0===e.length)return"[]";if(t.length>2)return"[Array]";for(var r=Math.min(10,e.length),n=e.length-r,i=[],o=0;o<r;++o)i.push(Gi(e[o],t));return 1===n?i.push("... 1 more item"):n>1&&i.push("... ".concat(n," more items")),"["+i.join(", ")+"]"}(e,r);return function(e,t){var r=Object.keys(e);return 0===r.length?"{}":t.length>2?"["+function(e){var t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){var r=e.constructor.name;if("string"==typeof r&&""!==r)return r}return t}(e)+"]":"{ "+r.map(function(r){return r+": "+Gi(e[r],t)}).join(", ")+" }"}(e,r)}(e,t);default:return String(e)}}function Wi(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var Hi=function(){function e(e){var t=arguments.length>1&&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||gi(0,"Body must be a string. Received: ".concat(Gi(e,[]),".")),this.body=e,this.name=t,this.locationOffset=r,this.locationOffset.line>0||gi(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||gi(0,"column in locationOffset is 1-indexed and must be positive.")}var t,r;return t=e,(r=[{key:wi,get:function(){return"Source"}}])&&Wi(t.prototype,r),e}(),Ji=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"});function Yi(e){var t=e.split(/\r\n|[\n\r]/g),r=function(e){for(var t,r=!0,n=!0,i=0,o=null,a=0;a<e.length;++a)switch(e.charCodeAt(a)){case 13:10===e.charCodeAt(a+1)&&++a;case 10:r=!1,n=!0,i=0;break;case 9:case 32:++i;break;default:n&&!r&&(null===o||i<o)&&(o=i),n=!1}return null!==(t=o)&&void 0!==t?t:0}(e);if(0!==r)for(var n=1;n<t.length;n++)t[n]=t[n].slice(r);for(var i=0;i<t.length&&Xi(t[i]);)++i;for(var o=t.length;o>i&&Xi(t[o-1]);)--o;return t.slice(i,o).join("\n")}function Xi(e){for(var t=0;t<e.length;++t)if(" "!==e[t]&&"\t"!==e[t])return!1;return!0}var Zi=function(){function e(e){var t=new Vi(zi.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!==zi.EOF)do{var t;e=null!==(t=e.next)&&void 0!==t?t:e.next=to(this,e)}while(e.kind===zi.COMMENT);return e},e}();function eo(e){return isNaN(e)?zi.EOF:e<127?JSON.stringify(String.fromCharCode(e)):'"\\u'.concat(("00"+e.toString(16).toUpperCase()).slice(-4),'"')}function to(e,t){for(var r=e.source,n=r.body,i=n.length,o=t.end;o<i;){var a=n.charCodeAt(o),s=e.line,u=1+o-e.lineStart;switch(a){case 65279:case 9:case 32:case 44:++o;continue;case 10:++o,++e.line,e.lineStart=o;continue;case 13:10===n.charCodeAt(o+1)?o+=2:++o,++e.line,e.lineStart=o;continue;case 33:return new Vi(zi.BANG,o,o+1,s,u,t);case 35:return no(r,o,s,u,t);case 36:return new Vi(zi.DOLLAR,o,o+1,s,u,t);case 38:return new Vi(zi.AMP,o,o+1,s,u,t);case 40:return new Vi(zi.PAREN_L,o,o+1,s,u,t);case 41:return new Vi(zi.PAREN_R,o,o+1,s,u,t);case 46:if(46===n.charCodeAt(o+1)&&46===n.charCodeAt(o+2))return new Vi(zi.SPREAD,o,o+3,s,u,t);break;case 58:return new Vi(zi.COLON,o,o+1,s,u,t);case 61:return new Vi(zi.EQUALS,o,o+1,s,u,t);case 64:return new Vi(zi.AT,o,o+1,s,u,t);case 91:return new Vi(zi.BRACKET_L,o,o+1,s,u,t);case 93:return new Vi(zi.BRACKET_R,o,o+1,s,u,t);case 123:return new Vi(zi.BRACE_L,o,o+1,s,u,t);case 124:return new Vi(zi.PIPE,o,o+1,s,u,t);case 125:return new Vi(zi.BRACE_R,o,o+1,s,u,t);case 34:return 34===n.charCodeAt(o+1)&&34===n.charCodeAt(o+2)?so(r,o,s,u,t,e):ao(r,o,s,u,t);case 45:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return io(r,o,a,s,u,t);case 65:case 66:case 67:case 68:case 69:case 70:case 71:case 72:case 73:case 74:case 75:case 76:case 77:case 78:case 79:case 80:case 81:case 82:case 83:case 84:case 85:case 86:case 87:case 88:case 89:case 90:case 95:case 97:case 98:case 99:case 100:case 101:case 102:case 103:case 104:case 105:case 106:case 107:case 108:case 109:case 110:case 111:case 112:case 113:case 114:case 115:case 116:case 117:case 118:case 119:case 120:case 121:case 122:return lo(r,o,s,u,t)}throw Mi(r,o,ro(a))}var c=e.line,l=1+o-e.lineStart;return new Vi(zi.EOF,i,i,c,l,t)}function ro(e){return e<32&&9!==e&&10!==e&&13!==e?"Cannot contain the invalid character ".concat(eo(e),"."):39===e?"Unexpected single quote character ('), did you mean to use a double quote (\")?":"Cannot parse the unexpected character ".concat(eo(e),".")}function no(e,t,r,n,i){var o,a=e.body,s=t;do{o=a.charCodeAt(++s)}while(!isNaN(o)&&(o>31||9===o));return new Vi(zi.COMMENT,t,s,r,n,i,a.slice(t+1,s))}function io(e,t,r,n,i,o){var a=e.body,s=r,u=t,c=!1;if(45===s&&(s=a.charCodeAt(++u)),48===s){if((s=a.charCodeAt(++u))>=48&&s<=57)throw Mi(e,u,"Invalid number, unexpected digit after 0: ".concat(eo(s),"."))}else u=oo(e,u,s),s=a.charCodeAt(u);if(46===s&&(c=!0,s=a.charCodeAt(++u),u=oo(e,u,s),s=a.charCodeAt(u)),69!==s&&101!==s||(c=!0,43!==(s=a.charCodeAt(++u))&&45!==s||(s=a.charCodeAt(++u)),u=oo(e,u,s),s=a.charCodeAt(u)),46===s||function(e){return 95===e||e>=65&&e<=90||e>=97&&e<=122}(s))throw Mi(e,u,"Invalid number, expected digit but got: ".concat(eo(s),"."));return new Vi(c?zi.FLOAT:zi.INT,t,u,n,i,o,a.slice(t,u))}function oo(e,t,r){var n=e.body,i=t,o=r;if(o>=48&&o<=57){do{o=n.charCodeAt(++i)}while(o>=48&&o<=57);return i}throw Mi(e,i,"Invalid number, expected digit but got: ".concat(eo(o),"."))}function ao(e,t,r,n,i){for(var o=e.body,a=t+1,s=a,u=0,c="";a<o.length&&!isNaN(u=o.charCodeAt(a))&&10!==u&&13!==u;){if(34===u)return c+=o.slice(s,a),new Vi(zi.STRING,t,a+1,r,n,i,c);if(u<32&&9!==u)throw Mi(e,a,"Invalid character within String: ".concat(eo(u),"."));if(++a,92===u){switch(c+=o.slice(s,a-1),u=o.charCodeAt(a)){case 34:c+='"';break;case 47:c+="/";break;case 92:c+="\\";break;case 98:c+="\b";break;case 102:c+="\f";break;case 110:c+="\n";break;case 114:c+="\r";break;case 116:c+="\t";break;case 117:var l=uo(o.charCodeAt(a+1),o.charCodeAt(a+2),o.charCodeAt(a+3),o.charCodeAt(a+4));if(l<0){var h=o.slice(a+1,a+5);throw Mi(e,a,"Invalid character escape sequence: \\u".concat(h,"."))}c+=String.fromCharCode(l),a+=4;break;default:throw Mi(e,a,"Invalid character escape sequence: \\".concat(String.fromCharCode(u),"."))}s=++a}}throw Mi(e,a,"Unterminated string.")}function so(e,t,r,n,i,o){for(var a=e.body,s=t+3,u=s,c=0,l="";s<a.length&&!isNaN(c=a.charCodeAt(s));){if(34===c&&34===a.charCodeAt(s+1)&&34===a.charCodeAt(s+2))return l+=a.slice(u,s),new Vi(zi.BLOCK_STRING,t,s+3,r,n,i,Yi(l));if(c<32&&9!==c&&10!==c&&13!==c)throw Mi(e,s,"Invalid character within String: ".concat(eo(c),"."));10===c?(++s,++o.line,o.lineStart=s):13===c?(10===a.charCodeAt(s+1)?s+=2:++s,++o.line,o.lineStart=s):92===c&&34===a.charCodeAt(s+1)&&34===a.charCodeAt(s+2)&&34===a.charCodeAt(s+3)?(l+=a.slice(u,s)+'"""',u=s+=4):++s}throw Mi(e,s,"Unterminated string.")}function uo(e,t,r,n){return co(e)<<12|co(t)<<8|co(r)<<4|co(n)}function co(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function lo(e,t,r,n,i){for(var o=e.body,a=o.length,s=t+1,u=0;s!==a&&!isNaN(u=o.charCodeAt(s))&&(95===u||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122);)++s;return new Vi(zi.NAME,t,s,r,n,i,o.slice(t,s))}var ho=function(){function e(e,t){var r=function(e){return e instanceof Hi}(e)?e:new Hi(e);this._lexer=new Zi(r),this._options=t}var t=e.prototype;return t.parseName=function(){var e=this.expectToken(zi.NAME);return{kind:Ui.NAME,value:e.value,loc:this.loc(e)}},t.parseDocument=function(){var e=this._lexer.token;return{kind:Ui.DOCUMENT,definitions:this.many(zi.SOF,this.parseDefinition,zi.EOF),loc:this.loc(e)}},t.parseDefinition=function(){if(this.peek(zi.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(zi.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(zi.BRACE_L))return{kind:Ui.OPERATION_DEFINITION,operation:"query",name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet(),loc:this.loc(e)};var t,r=this.parseOperationType();return this.peek(zi.NAME)&&(t=this.parseName()),{kind:Ui.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(zi.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(zi.PAREN_L,this.parseVariableDefinition,zi.PAREN_R)},t.parseVariableDefinition=function(){var e=this._lexer.token;return{kind:Ui.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(zi.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(zi.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(zi.DOLLAR),{kind:Ui.VARIABLE,name:this.parseName(),loc:this.loc(e)}},t.parseSelectionSet=function(){var e=this._lexer.token;return{kind:Ui.SELECTION_SET,selections:this.many(zi.BRACE_L,this.parseSelection,zi.BRACE_R),loc:this.loc(e)}},t.parseSelection=function(){return this.peek(zi.SPREAD)?this.parseFragment():this.parseField()},t.parseField=function(){var e,t,r=this._lexer.token,n=this.parseName();return this.expectOptionalToken(zi.COLON)?(e=n,t=this.parseName()):t=n,{kind:Ui.FIELD,alias:e,name:t,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(zi.BRACE_L)?this.parseSelectionSet():void 0,loc:this.loc(r)}},t.parseArguments=function(e){var t=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(zi.PAREN_L,t,zi.PAREN_R)},t.parseArgument=function(){var e=this._lexer.token,t=this.parseName();return this.expectToken(zi.COLON),{kind:Ui.ARGUMENT,name:t,value:this.parseValueLiteral(!1),loc:this.loc(e)}},t.parseConstArgument=function(){var e=this._lexer.token;return{kind:Ui.ARGUMENT,name:this.parseName(),value:(this.expectToken(zi.COLON),this.parseValueLiteral(!0)),loc:this.loc(e)}},t.parseFragment=function(){var e=this._lexer.token;this.expectToken(zi.SPREAD);var t=this.expectOptionalKeyword("on");return!t&&this.peek(zi.NAME)?{kind:Ui.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1),loc:this.loc(e)}:{kind:Ui.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:Ui.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:Ui.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 zi.BRACKET_L:return this.parseList(e);case zi.BRACE_L:return this.parseObject(e);case zi.INT:return this._lexer.advance(),{kind:Ui.INT,value:t.value,loc:this.loc(t)};case zi.FLOAT:return this._lexer.advance(),{kind:Ui.FLOAT,value:t.value,loc:this.loc(t)};case zi.STRING:case zi.BLOCK_STRING:return this.parseStringLiteral();case zi.NAME:switch(this._lexer.advance(),t.value){case"true":return{kind:Ui.BOOLEAN,value:!0,loc:this.loc(t)};case"false":return{kind:Ui.BOOLEAN,value:!1,loc:this.loc(t)};case"null":return{kind:Ui.NULL,loc:this.loc(t)};default:return{kind:Ui.ENUM,value:t.value,loc:this.loc(t)}}case zi.DOLLAR:if(!e)return this.parseVariable()}throw this.unexpected()},t.parseStringLiteral=function(){var e=this._lexer.token;return this._lexer.advance(),{kind:Ui.STRING,value:e.value,block:e.kind===zi.BLOCK_STRING,loc:this.loc(e)}},t.parseList=function(e){var t=this,r=this._lexer.token;return{kind:Ui.LIST,values:this.any(zi.BRACKET_L,function(){return t.parseValueLiteral(e)},zi.BRACKET_R),loc:this.loc(r)}},t.parseObject=function(e){var t=this,r=this._lexer.token;return{kind:Ui.OBJECT,fields:this.any(zi.BRACE_L,function(){return t.parseObjectField(e)},zi.BRACE_R),loc:this.loc(r)}},t.parseObjectField=function(e){var t=this._lexer.token,r=this.parseName();return this.expectToken(zi.COLON),{kind:Ui.OBJECT_FIELD,name:r,value:this.parseValueLiteral(e),loc:this.loc(t)}},t.parseDirectives=function(e){for(var t=[];this.peek(zi.AT);)t.push(this.parseDirective(e));return t},t.parseDirective=function(e){var t=this._lexer.token;return this.expectToken(zi.AT),{kind:Ui.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e),loc:this.loc(t)}},t.parseTypeReference=function(){var e,t=this._lexer.token;return this.expectOptionalToken(zi.BRACKET_L)?(e=this.parseTypeReference(),this.expectToken(zi.BRACKET_R),e={kind:Ui.LIST_TYPE,type:e,loc:this.loc(t)}):e=this.parseNamedType(),this.expectOptionalToken(zi.BANG)?{kind:Ui.NON_NULL_TYPE,type:e,loc:this.loc(t)}:e},t.parseNamedType=function(){var e=this._lexer.token;return{kind:Ui.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===zi.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(zi.STRING)||this.peek(zi.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(zi.BRACE_L,this.parseOperationTypeDefinition,zi.BRACE_R);return{kind:Ui.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(zi.COLON);var r=this.parseNamedType();return{kind:Ui.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:Ui.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),o=this.parseFieldsDefinition();return{kind:Ui.OBJECT_TYPE_DEFINITION,description:t,name:r,interfaces:n,directives:i,fields:o,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(zi.AMP);do{t.push(this.parseNamedType())}while(this.expectOptionalToken(zi.AMP)||this.peek(zi.NAME));return t}return this.delimitedMany(zi.AMP,this.parseNamedType)},t.parseFieldsDefinition=function(){var e;return!0===(null===(e=this._options)||void 0===e?void 0:e.allowLegacySDLEmptyFields)&&this.peek(zi.BRACE_L)&&this._lexer.lookahead().kind===zi.BRACE_R?(this._lexer.advance(),this._lexer.advance(),[]):this.optionalMany(zi.BRACE_L,this.parseFieldDefinition,zi.BRACE_R)},t.parseFieldDefinition=function(){var e=this._lexer.token,t=this.parseDescription(),r=this.parseName(),n=this.parseArgumentDefs();this.expectToken(zi.COLON);var i=this.parseTypeReference(),o=this.parseDirectives(!0);return{kind:Ui.FIELD_DEFINITION,description:t,name:r,arguments:n,type:i,directives:o,loc:this.loc(e)}},t.parseArgumentDefs=function(){return this.optionalMany(zi.PAREN_L,this.parseInputValueDef,zi.PAREN_R)},t.parseInputValueDef=function(){var e=this._lexer.token,t=this.parseDescription(),r=this.parseName();this.expectToken(zi.COLON);var n,i=this.parseTypeReference();this.expectOptionalToken(zi.EQUALS)&&(n=this.parseValueLiteral(!0));var o=this.parseDirectives(!0);return{kind:Ui.INPUT_VALUE_DEFINITION,description:t,name:r,type:i,defaultValue:n,directives:o,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),o=this.parseFieldsDefinition();return{kind:Ui.INTERFACE_TYPE_DEFINITION,description:t,name:r,interfaces:n,directives:i,fields:o,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:Ui.UNION_TYPE_DEFINITION,description:t,name:r,directives:n,types:i,loc:this.loc(e)}},t.parseUnionMemberTypes=function(){return this.expectOptionalToken(zi.EQUALS)?this.delimitedMany(zi.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:Ui.ENUM_TYPE_DEFINITION,description:t,name:r,directives:n,values:i,loc:this.loc(e)}},t.parseEnumValuesDefinition=function(){return this.optionalMany(zi.BRACE_L,this.parseEnumValueDefinition,zi.BRACE_R)},t.parseEnumValueDefinition=function(){var e=this._lexer.token,t=this.parseDescription(),r=this.parseName(),n=this.parseDirectives(!0);return{kind:Ui.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:Ui.INPUT_OBJECT_TYPE_DEFINITION,description:t,name:r,directives:n,fields:i,loc:this.loc(e)}},t.parseInputFieldsDefinition=function(){return this.optionalMany(zi.BRACE_L,this.parseInputValueDef,zi.BRACE_R)},t.parseTypeSystemExtension=function(){var e=this._lexer.lookahead();if(e.kind===zi.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(zi.BRACE_L,this.parseOperationTypeDefinition,zi.BRACE_R);if(0===t.length&&0===r.length)throw this.unexpected();return{kind:Ui.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:Ui.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:Ui.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:Ui.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:Ui.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:Ui.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:Ui.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(zi.AT);var r=this.parseName(),n=this.parseArgumentDefs(),i=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");var o=this.parseDirectiveLocations();return{kind:Ui.DIRECTIVE_DEFINITION,description:t,name:r,arguments:n,repeatable:i,locations:o,loc:this.loc(e)}},t.parseDirectiveLocations=function(){return this.delimitedMany(zi.PIPE,this.parseDirectiveLocation)},t.parseDirectiveLocation=function(){var e=this._lexer.token,t=this.parseName();if(void 0!==Ji[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 Qi(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 Mi(this._lexer.source,t.start,"Expected ".concat(po(e),", found ").concat(fo(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!==zi.NAME||t.value!==e)throw Mi(this._lexer.source,t.start,'Expected "'.concat(e,'", found ').concat(fo(t),"."));this._lexer.advance()},t.expectOptionalKeyword=function(e){var t=this._lexer.token;return t.kind===zi.NAME&&t.value===e&&(this._lexer.advance(),!0)},t.unexpected=function(e){var t=null!=e?e:this._lexer.token;return Mi(this._lexer.source,t.start,"Unexpected ".concat(fo(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 fo(e){var t=e.value;return po(e.kind)+(null!=t?' "'.concat(t,'"'):"")}function po(e){return function(e){return e===zi.BANG||e===zi.DOLLAR||e===zi.AMP||e===zi.PAREN_L||e===zi.PAREN_R||e===zi.SPREAD||e===zi.COLON||e===zi.EQUALS||e===zi.AT||e===zi.BRACKET_L||e===zi.BRACKET_R||e===zi.BRACE_L||e===zi.PIPE||e===zi.BRACE_R}(e)?'"'.concat(e,'"'):e}var mo=new Map,yo=new Map,vo=!0,go=!1;function bo(e){return e.replace(/[\s,]+/g," ").trim()}function wo(e){var t,r,n,i=bo(e);if(!mo.has(i)){var o=function(e,t){return new ho(e,t).parseDocument()}(e,{experimentalFragmentVariables:go,allowLegacyFragmentVariables:go});if(!o||"Document"!==o.kind)throw new Error("Not a valid GraphQL document.");mo.set(i,function(e){var t=new Set(e.definitions);t.forEach(function(e){e.loc&&delete e.loc,Object.keys(e).forEach(function(r){var n=e[r];n&&"object"==typeof n&&t.add(n)})});var r=e.loc;return r&&(delete r.startToken,delete r.endToken),e}((t=o,r=new Set,n=[],t.definitions.forEach(function(e){if("FragmentDefinition"===e.kind){var t=e.name.value,i=bo((a=e.loc).source.body.substring(a.start,a.end)),o=yo.get(t);o&&!o.has(i)?vo&&console.warn("Warning: fragment with name "+t+" already exists.\ngraphql-tag enforces all fragment names across your application to be unique; read more about\nthis in the docs: http://dev.apollodata.com/core/fragments.html#unique-names"):o||yo.set(t,o=new Set),o.add(i),r.has(i)||(r.add(i),n.push(e))}else n.push(e);var a}),vi(vi({},t),{definitions:n}))))}return mo.get(i)}function Ro(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];"string"==typeof e&&(e=[e]);var n=e[0];return t.forEach(function(t,r){t&&"Document"===t.kind?n+=t.loc.source.body:n+=t,n+=e[r+1]}),wo(n)}var Eo,ko=Ro;(Eo=Ro||(Ro={})).gql=ko,Eo.resetCaches=function(){mo.clear(),yo.clear()},Eo.disableFragmentWarnings=function(){vo=!1},Eo.enableExperimentalFragmentVariables=function(){go=!0},Eo.disableExperimentalFragmentVariables=function(){go=!1},Ro.default=Ro;const Oo=Ro`
7
7
  fragment RepositoryParts on Repository {
8
8
  id
9
9
  isFork