UNPKG

@open-condo/apollo

Version:

A wrapper over @apollo/client that allows you to use persistent cache from local storage, configure TTL, invalidate cache, and use a single configuration for getServerSideProps, SSR, and CSR

13 lines 261 kB
import*as e from"react";import{createContext as t,useContext as n,useEffect as r,useRef as i,useState as o,useMemo as a}from"react";import*as s from"@apollo/client/core";import{from as c,ApolloClient as u}from"@apollo/client/core";import*as l from"@apollo/client";import p from"crypto";import*as d from"@apollo/client/utilities";import*as f from"@apollo/client/link/http";var h,y=function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))},v=function(){function e(e){var t=e.debug,n=void 0!==t&&t;this.debug=n,this.lines=[]}return e.prototype.emit=function(t,n){if(t in console){var r=e.prefix;console[t].apply(console,y([r],n,!1))}},e.prototype.tailLogs=function(){var e=this;this.lines.forEach(function(t){var n=t[0],r=t[1];return e.emit(n,r)})},e.prototype.getLogs=function(){return this.lines},e.prototype.write=function(t,n){var r=e.buffer;this.lines=y(y([],this.lines.slice(1-r),!0),[[t,n]],!1),(this.debug||"log"!==t)&&this.emit(t,n)},e.prototype.info=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.write("log",e)},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.write("warn",e)},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.write("error",e)},e.buffer=30,e.prefix="[apollo-cache-persist]",e}(),m=function(){function e(e){var t=e.cache,n=e.serialize,r=void 0===n||n;this.cache=t,this.serialize=r}return e.prototype.extract=function(){var e=this.cache.extract();return this.serialize&&(e=JSON.stringify(e)),e},e.prototype.restore=function(e){this.serialize&&"string"==typeof e&&(e=JSON.parse(e)),null!=e&&this.cache.restore(e)},e}(),g=function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function a(e){try{c(r.next(e))}catch(e){o(e)}}function s(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,s)}c((r=r.apply(e,t||[])).next())})},E=function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},T=function(){function e(e){var t=e.storage,n=e.key,r=void 0===n?"apollo-cache-persist":n;this.storage=t,this.key=r}return e.prototype.read=function(){return g(this,void 0,void 0,function(){return E(this,function(e){return[2,this.storage.getItem(this.key)]})})},e.prototype.write=function(e){return g(this,void 0,void 0,function(){return E(this,function(t){switch(t.label){case 0:return[4,this.storage.setItem(this.key,e)];case 1:return t.sent(),[2]}})})},e.prototype.purge=function(){return g(this,void 0,void 0,function(){return E(this,function(e){switch(e.label){case 0:return[4,this.storage.removeItem(this.key)];case 1:return e.sent(),[2]}})})},e.prototype.getSize=function(){return g(this,void 0,void 0,function(){var e;return E(this,function(t){switch(t.label){case 0:return[4,this.storage.getItem(this.key)];case 1:return null==(e=t.sent())?[2,0]:[2,"string"==typeof e?e.length:null]}})})},e}(),b=function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function a(e){try{c(r.next(e))}catch(e){o(e)}}function s(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,s)}c((r=r.apply(e,t||[])).next())})},_=function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},N=function(){function e(e,t){var n=e.log,r=e.cache,i=e.storage,o=t.maxSize,a=void 0===o?1048576:o,s=t.persistenceMapper;this.log=n,this.cache=r,this.storage=i,this.paused=!1,s&&(this.persistenceMapper=s),a&&(this.maxSize=a)}return e.prototype.persist=function(){return b(this,void 0,void 0,function(){var e,t;return _(this,function(n){switch(n.label){case 0:return n.trys.push([0,6,,7]),e=this.cache.extract(),this.paused||!this.persistenceMapper?[3,2]:[4,this.persistenceMapper(e)];case 1:e=n.sent(),n.label=2;case 2:return null!=this.maxSize&&"string"==typeof e&&e.length>this.maxSize&&!this.paused?[4,this.purge()]:[3,4];case 3:return n.sent(),this.paused=!0,[2];case 4:return this.paused?[2]:[4,this.storage.write(e)];case 5:return n.sent(),this.log.info("string"==typeof e?"Persisted cache of size ".concat(e.length," characters"):"Persisted cache"),[3,7];case 6:throw t=n.sent(),this.log.error("Error persisting cache",t),t;case 7:return[2]}})})},e.prototype.restore=function(){return b(this,void 0,void 0,function(){var e,t;return _(this,function(n){switch(n.label){case 0:return n.trys.push([0,5,,6]),[4,this.storage.read()];case 1:return null==(e=n.sent())?[3,3]:[4,this.cache.restore(e)];case 2:return n.sent(),this.log.info("string"==typeof e?"Restored cache of size ".concat(e.length," characters"):"Restored cache"),[3,4];case 3:this.log.info("No stored cache to restore"),n.label=4;case 4:return[3,6];case 5:throw t=n.sent(),this.log.error("Error restoring cache",t),t;case 6:return[2]}})})},e.prototype.purge=function(){return b(this,void 0,void 0,function(){var e;return _(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.storage.purge()];case 1:return t.sent(),this.log.info("Purged cache storage"),[3,3];case 2:throw e=t.sent(),this.log.error("Error purging cache storage",e),e;case 3:return[2]}})})},e}(),I=function(e){var t=e.cache;return function(e){var n=t.write,r=t.evict,i=t.modify,o=t.gc;return t.write=function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var o=n.apply(t,r);return e(),o},t.evict=function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var o=r.apply(t,n);return e(),o},t.modify=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=i.apply(t,n);return e(),o},t.gc=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i=o.apply(t,n);return e(),i},function(){t.write=n,t.evict=r,t.modify=i,t.gc=o}}},O=function(){function e(t,n){var r=t.log,i=t.persistor,o=this;this.fire=function(){o.debounce?(null!=o.timeout&&clearTimeout(o.timeout),o.timeout=setTimeout(o.persist,o.debounce)):o.persist()},this.persist=function(){o.paused||o.persistor.persist()};var a=e.defaultDebounce,s=n.cache,c=n.debounce,u=n.trigger,l=void 0===u?"write":u;if(l)switch(this.debounce=null!=c?c:a,this.persistor=i,this.paused=!1,l){case"write":this.uninstall=I({cache:s})(this.fire);break;case"background":c&&r.warn("Debounce is not recommended with `background` trigger"),this.debounce=c,this.uninstall=function(e){var t=e.log,n=e.cache;return function(e){return t.warn("Trigger option `background` not available on web; using `write` trigger"),I({cache:n})(e)}}({cache:s,log:r})(this.fire);break;default:if("function"!=typeof l)throw Error("Unrecognized trigger option: ".concat(l));this.uninstall=l(this.fire)}}return e.prototype.pause=function(){this.paused=!0},e.prototype.resume=function(){this.paused=!1},e.prototype.remove=function(){this.uninstall&&(this.uninstall(),this.uninstall=null,this.paused=!0)},e.defaultDebounce=1e3,e}(),w=function(){function e(e){if(!e.cache)throw new Error("In order to persist your Apollo Cache, you need to pass in a cache. Please see https://www.apollographql.com/docs/react/basics/caching.html for our default InMemoryCache.");if(!e.storage)throw new Error("In order to persist your Apollo Cache, you need to pass in an underlying storage provider. Please see https://github.com/apollographql/apollo-cache-persist#storage-providers");var t=new v(e),n=new m(e),r=new T(e),i=new N({log:t,cache:n,storage:r},e),o=new O({log:t,persistor:i},e);this.log=t,this.cache=n,this.storage=r,this.persistor=i,this.trigger=o}return e.prototype.persist=function(){return this.persistor.persist()},e.prototype.restore=function(){return this.persistor.restore()},e.prototype.purge=function(){return this.persistor.purge()},e.prototype.pause=function(){this.trigger.pause()},e.prototype.resume=function(){this.trigger.resume()},e.prototype.remove=function(){this.trigger.remove()},e.prototype.getLogs=function(e){if(void 0===e&&(e=!1),!e)return this.log.getLogs();this.log.tailLogs()},e.prototype.getSize=function(){return this.storage.getSize()},e}(),A=(h=function(e,t){return h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},h(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}h(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});!function(e){function t(t){var n=e.call(this,t)||this;return n.storage=new D(t),n.persistor=new S({log:n.log,cache:n.cache,storage:n.storage},t),n}A(t,e),t.prototype.restoreSync=function(){this.persistor.restoreSync()}}(w);var S=function(e){function t(t,n){var r=t.log,i=t.cache,o=t.storage;return e.call(this,{log:r,cache:i,storage:o},n)||this}return A(t,e),t.prototype.restoreSync=function(){this.cache.restore(this.storage.readSync())},t}(N),D=function(e){function t(t){return e.call(this,t)||this}return A(t,e),t.prototype.readSync=function(){return this.storage.getItem(this.key)},t}(T),R=function(){function e(e){this.storage=e}return e.prototype.getItem=function(e){return this.storage.getItem(e)},e.prototype.removeItem=function(e){return this.storage.removeItem(e)},e.prototype.setItem=function(e,t){return null!==t?this.storage.setItem(e,t):this.removeItem(e)},e}();function F(){return"undefined"==typeof window}const k="__APOLLO_STATE__";function x(e){return new w({cache:e,storage:new R(window.localStorage),debug:"development"===process.env.NODE_ENV,key:"__APOLLO_PERSISTED_CACHE__"})}const j=t({});function C(){return n(j)}function P(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}function L(e,t,n,r){return new(n||(n=Promise))(function(t,i){function o(e){try{s(r.next(e))}catch(e){i(e)}}function a(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var r;e.done?t(e.value):(r=e.value,r instanceof n?r:new n(function(e){e(r)})).then(o,a)}s((r=r.apply(e,[])).next())})}var $="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function M(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function V(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var n=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})}),n}var U=V(s),B=V(f);const G=class{constructor({uri:e,name:t,type:n}){this.uri=e,this.name=t,this.type=n}};var Q=function(e){return"undefined"!=typeof File&&e instanceof File||"undefined"!=typeof Blob&&e instanceof Blob||e instanceof G};const Y=Q;var q=Q;const{ApolloLink:z,Observable:W}=U,{createSignalIfSupported:J,fallbackHttpConfig:K,parseAndCheckHttpResponse:X,rewriteURIForGET:H,selectHttpOptionsAndBody:Z,selectURI:ee,serializeFetchParameter:te}=B,ne=function(e,t="",n=Y){const r=new Map,i=new Map;return{clone:function e(t,o,a){let s=t;if(n(t)){s=null;const e=r.get(t);e?e.push(o):r.set(t,[o])}else{const n=Array.isArray(t)||"undefined"!=typeof FileList&&t instanceof FileList,r=t&&t.constructor===Object;if(n||r){const r=i.has(t);if(r?s=i.get(t):(s=n?[]:{},i.set(t,s)),!a.has(t)){const i=o?`${o}.`:"",c=new Set(a).add(t);if(n){let n=0;for(const o of t){const t=e(o,i+n++,c);r||s.push(t)}}else for(const n in t){const o=e(t[n],i+n,c);r||(s[n]=o)}}}}return s}(e,t,new Set),files:r}},re=function(e,t,n){e.append(t,n,n.name)},ie=q;var oe=function({uri:e="/graphql",useGETForQueries:t,isExtractableFile:n=ie,FormData:r,formDataAppendFile:i=re,fetch:o,fetchOptions:a,credentials:s,headers:c,includeExtensions:u}={}){const l={http:{includeExtensions:u},options:a,credentials:s,headers:c};return new z(a=>{const s=a.getContext(),{clientAwareness:{name:c,version:u}={},headers:p}=s,d={http:s.http,options:s.fetchOptions,credentials:s.credentials,headers:{...c&&{"apollographql-client-name":c},...u&&{"apollographql-client-version":u},...p}},{options:f,body:h}=Z(a,K,l,d),{clone:y,files:v}=ne(h,"",n);let m=ee(a,e);if(v.size){delete f.headers["content-type"];const e=new(r||FormData);e.append("operations",te(y,"Payload"));const t={};let n=0;v.forEach(e=>{t[++n]=e}),e.append("map",JSON.stringify(t)),n=0,v.forEach((t,r)=>{i(e,++n,r)}),f.body=e}else if(t&&!a.query.definitions.some(e=>"OperationDefinition"===e.kind&&"mutation"===e.operation)&&(f.method="GET"),"GET"===f.method){const{newURI:e,parseError:t}=H(m,h);if(t)return new W(e=>{e.error(t)});m=e}else f.body=te(y,"Payload");const{controller:g}=J();g&&(f.signal&&(f.signal.aborted?g.abort():f.signal.addEventListener("abort",()=>{g.abort()},{once:!0})),f.signal=g.signal);const E=o||fetch;return new W(e=>{let t;return E(m,f).then(e=>(a.setContext({response:e}),e)).then(X(a)).then(t=>{e.next(t),e.complete()}).catch(n=>{t||(n.result&&n.result.errors&&n.result.data&&e.next(n.result),e.error(n))}),()=>{t=!0,g&&g.abort()}})})},ae=M(oe);var se=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e},ce="object"==typeof $&&$&&$.Object===Object&&$,ue=ce,le="object"==typeof self&&self&&self.Object===Object&&self,pe=ue||le||Function("return this")(),de=pe.Symbol,fe=de,he=Object.prototype,ye=he.hasOwnProperty,ve=he.toString,me=fe?fe.toStringTag:void 0;var ge=function(e){var t=ye.call(e,me),n=e[me];try{e[me]=void 0;var r=!0}catch(e){}var i=ve.call(e);return r&&(t?e[me]=n:delete e[me]),i},Ee=Object.prototype.toString;var Te=ge,be=function(e){return Ee.call(e)},_e=de?de.toStringTag:void 0;var Ne=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":_e&&_e in Object(e)?Te(e):be(e)};var Ie=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},Oe=Ne,we=Ie;var Ae,Se=function(e){if(!we(e))return!1;var t=Oe(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},De=pe["__core-js_shared__"],Re=(Ae=/[^.]+$/.exec(De&&De.keys&&De.keys.IE_PROTO||""))?"Symbol(src)_1."+Ae:"";var Fe=function(e){return!!Re&&Re in e},ke=Function.prototype.toString;var xe=function(e){if(null!=e){try{return ke.call(e)}catch(e){}try{return e+""}catch(e){}}return""},je=Se,Ce=Fe,Pe=Ie,Le=xe,$e=/^\[object .+?Constructor\]$/,Me=Function.prototype,Ve=Object.prototype,Ue=Me.toString,Be=Ve.hasOwnProperty,Ge=RegExp("^"+Ue.call(Be).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var Qe=function(e){return!(!Pe(e)||Ce(e))&&(je(e)?Ge:$e).test(Le(e))},Ye=function(e,t){return null==e?void 0:e[t]};var qe=function(e,t){var n=Ye(e,t);return Qe(n)?n:void 0},ze=qe,We=function(){try{var e=ze(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),Je=We;var Ke=function(e,t,n){"__proto__"==t&&Je?Je(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n};var Xe=function(e){return e};var He=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)},Ze=He,et=Math.max;var tt=function(e,t,n){return t=et(void 0===t?e.length-1:t,0),function(){for(var r=arguments,i=-1,o=et(r.length-t,0),a=Array(o);++i<o;)a[i]=r[t+i];i=-1;for(var s=Array(t+1);++i<t;)s[i]=r[i];return s[t]=n(a),Ze(e,this,s)}};var nt=function(e){return function(){return e}},rt=We,it=rt?function(e,t){return rt(e,"toString",{configurable:!0,enumerable:!1,value:nt(t),writable:!0})}:Xe,ot=Date.now;var at=function(e){var t=0,n=0;return function(){var r=ot(),i=16-(r-n);if(n=r,i>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}},st=at(it),ct=Xe,ut=tt,lt=st;var pt=function(e,t){return lt(ut(e,t,ct),e+"")},dt=qe(pe,"WeakMap"),ft=dt&&new dt,ht=ft,yt=ht?function(e,t){return ht.set(e,t),e}:Xe,vt=Ie,mt=Object.create,gt=function(){function e(){}return function(t){if(!vt(t))return{};if(mt)return mt(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}(),Et=gt,Tt=Ie;var bt=function(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=Et(e.prototype),r=e.apply(n,t);return Tt(r)?r:n}},_t=bt,Nt=pe;var It=function(e,t,n){var r=1&t,i=_t(e);return function t(){return(this&&this!==Nt&&this instanceof t?i:e).apply(r?n:this,arguments)}},Ot=Math.max;var wt=function(e,t,n,r){for(var i=-1,o=e.length,a=n.length,s=-1,c=t.length,u=Ot(o-a,0),l=Array(c+u),p=!r;++s<c;)l[s]=t[s];for(;++i<a;)(p||i<o)&&(l[n[i]]=e[i]);for(;u--;)l[s++]=e[i++];return l},At=Math.max;var St=function(e,t,n,r){for(var i=-1,o=e.length,a=-1,s=n.length,c=-1,u=t.length,l=At(o-s,0),p=Array(l+u),d=!r;++i<l;)p[i]=e[i];for(var f=i;++c<u;)p[f+c]=t[c];for(;++a<s;)(d||i<o)&&(p[f+n[a]]=e[i++]);return p};var Dt=function(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r};var Rt=function(){},Ft=gt,kt=Rt;function xt(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}xt.prototype=Ft(kt.prototype),xt.prototype.constructor=xt;var jt=xt;var Ct=ft,Pt=Ct?function(e){return Ct.get(e)}:function(){},Lt={},$t=Object.prototype.hasOwnProperty;var Mt=function(e){for(var t=e.name+"",n=Lt[t],r=$t.call(Lt,t)?n.length:0;r--;){var i=n[r],o=i.func;if(null==o||o==e)return i.name}return t},Vt=gt,Ut=Rt;function Bt(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}Bt.prototype=Vt(Ut.prototype),Bt.prototype.constructor=Bt;var Gt=Bt,Qt=Array.isArray;var Yt=function(e){return null!=e&&"object"==typeof e};var qt=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t},zt=jt,Wt=Gt,Jt=qt;var Kt=jt,Xt=Gt,Ht=Rt,Zt=Qt,en=Yt,tn=function(e){if(e instanceof zt)return e.clone();var t=new Wt(e.__wrapped__,e.__chain__);return t.__actions__=Jt(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t},nn=Object.prototype.hasOwnProperty;function rn(e){if(en(e)&&!Zt(e)&&!(e instanceof Kt)){if(e instanceof Xt)return e;if(nn.call(e,"__wrapped__"))return tn(e)}return new Xt(e)}rn.prototype=Ht.prototype,rn.prototype.constructor=rn;var on=jt,an=Pt,sn=Mt,cn=rn;var un=function(e){var t=sn(e),n=cn[t];if("function"!=typeof n||!(t in on.prototype))return!1;if(e===n)return!0;var r=an(n);return!!r&&e===r[0]},ln=at(yt),pn=/\{\n\/\* \[wrapped with (.+)\] \*/,dn=/,? & /;var fn=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;var hn=function(e,t,n,r){for(var i=e.length,o=n+(r?1:-1);r?o--:++o<i;)if(t(e[o],o,e))return o;return-1},yn=function(e){return e!=e},vn=function(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1};var mn=function(e,t,n){return t==t?vn(e,t,n):hn(e,yn,n)};var gn=se,En=function(e,t){return!!(null==e?0:e.length)&&mn(e,t,0)>-1},Tn=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]];var bn=function(e){var t=e.match(pn);return t?t[1].split(dn):[]},_n=function(e,t){var n=t.length;if(!n)return e;var r=n-1;return t[r]=(n>1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(fn,"{\n/* [wrapped with "+t+"] */\n")},Nn=st,In=function(e,t){return gn(Tn,function(n){var r="_."+n[0];t&n[1]&&!En(e,r)&&e.push(r)}),e.sort()};var On=function(e,t,n){var r=t+"";return Nn(e,_n(r,In(bn(r),n)))},wn=un,An=ln,Sn=On;var Dn=function(e,t,n,r,i,o,a,s,c,u){var l=8&t;t|=l?32:64,4&(t&=~(l?64:32))||(t&=-4);var p=[e,t,i,l?o:void 0,l?a:void 0,l?void 0:o,l?void 0:a,s,c,u],d=n.apply(void 0,p);return wn(e)&&An(d,p),d.placeholder=r,Sn(d,e,t)};var Rn=function(e){return e.placeholder},Fn=/^(?:0|[1-9]\d*)$/;var kn=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&Fn.test(e))&&e>-1&&e%1==0&&e<t},xn=qt,jn=kn,Cn=Math.min;var Pn="__lodash_placeholder__";var Ln=function(e,t){for(var n=-1,r=e.length,i=0,o=[];++n<r;){var a=e[n];a!==t&&a!==Pn||(e[n]=Pn,o[i++]=n)}return o},$n=wt,Mn=St,Vn=Dt,Un=bt,Bn=Dn,Gn=Rn,Qn=function(e,t){for(var n=e.length,r=Cn(t.length,n),i=xn(e);r--;){var o=t[r];e[r]=jn(o,n)?i[o]:void 0}return e},Yn=Ln,qn=pe;var zn=function e(t,n,r,i,o,a,s,c,u,l){var p=128&n,d=1&n,f=2&n,h=24&n,y=512&n,v=f?void 0:Un(t);return function m(){for(var g=arguments.length,E=Array(g),T=g;T--;)E[T]=arguments[T];if(h)var b=Gn(m),_=Vn(E,b);if(i&&(E=$n(E,i,o,h)),a&&(E=Mn(E,a,s,h)),g-=_,h&&g<l){var N=Yn(E,b);return Bn(t,n,e,m.placeholder,r,E,N,c,u,l-g)}var I=d?r:this,O=f?I[t]:t;return g=E.length,c?E=Qn(E,c):y&&g>1&&E.reverse(),p&&u<g&&(E.length=u),this&&this!==qn&&this instanceof m&&(O=v||Un(O)),O.apply(I,E)}},Wn=He,Jn=bt,Kn=zn,Xn=Dn,Hn=Rn,Zn=Ln,er=pe;var tr=function(e,t,n){var r=Jn(e);return function i(){for(var o=arguments.length,a=Array(o),s=o,c=Hn(i);s--;)a[s]=arguments[s];var u=o<3&&a[0]!==c&&a[o-1]!==c?[]:Zn(a,c);return(o-=u.length)<n?Xn(e,t,Kn,i.placeholder,void 0,a,u,void 0,void 0,n-o):Wn(this&&this!==er&&this instanceof i?r:e,this,a)}},nr=He,rr=bt,ir=pe;var or=function(e,t,n,r){var i=1&t,o=rr(e);return function t(){for(var a=-1,s=arguments.length,c=-1,u=r.length,l=Array(u+s),p=this&&this!==ir&&this instanceof t?o:e;++c<u;)l[c]=r[c];for(;s--;)l[c++]=arguments[++a];return nr(p,i?n:this,l)}},ar=wt,sr=St,cr=Ln,ur="__lodash_placeholder__",lr=128,pr=Math.min;var dr=/\s/;var fr=function(e){for(var t=e.length;t--&&dr.test(e.charAt(t)););return t},hr=/^\s+/;var yr=Ne,vr=Yt;var mr=function(e){return"symbol"==typeof e||vr(e)&&"[object Symbol]"==yr(e)},gr=function(e){return e?e.slice(0,fr(e)+1).replace(hr,""):e},Er=Ie,Tr=mr,br=/^[-+]0x[0-9a-f]+$/i,_r=/^0b[01]+$/i,Nr=/^0o[0-7]+$/i,Ir=parseInt;var Or=function(e){if("number"==typeof e)return e;if(Tr(e))return NaN;if(Er(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Er(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=gr(e);var n=_r.test(e);return n||Nr.test(e)?Ir(e.slice(2),n?2:8):br.test(e)?NaN:+e},wr=1/0;var Ar=function(e){return e?(e=Or(e))===wr||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0};var Sr=function(e){var t=Ar(e),n=t%1;return t==t?n?t-n:t:0},Dr=yt,Rr=It,Fr=tr,kr=zn,xr=or,jr=Pt,Cr=function(e,t){var n=e[1],r=t[1],i=n|r,o=i<131,a=r==lr&&8==n||r==lr&&256==n&&e[7].length<=t[8]||384==r&&t[7].length<=t[8]&&8==n;if(!o&&!a)return e;1&r&&(e[2]=t[2],i|=1&n?0:4);var s=t[3];if(s){var c=e[3];e[3]=c?ar(c,s,t[4]):s,e[4]=c?cr(e[3],ur):t[4]}return(s=t[5])&&(c=e[5],e[5]=c?sr(c,s,t[6]):s,e[6]=c?cr(e[5],ur):t[6]),(s=t[7])&&(e[7]=s),r&lr&&(e[8]=null==e[8]?t[8]:pr(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=i,e},Pr=ln,Lr=On,$r=Sr,Mr=Math.max;var Vr=function(e,t,n,r,i,o,a,s){var c=2&t;if(!c&&"function"!=typeof e)throw new TypeError("Expected a function");var u=r?r.length:0;if(u||(t&=-97,r=i=void 0),a=void 0===a?a:Mr($r(a),0),s=void 0===s?s:$r(s),u-=i?i.length:0,64&t){var l=r,p=i;r=i=void 0}var d=c?void 0:jr(e),f=[e,t,n,r,i,l,p,o,a,s];if(d&&Cr(f,d),e=f[0],t=f[1],n=f[2],r=f[3],i=f[4],!(s=f[9]=void 0===f[9]?c?0:e.length:Mr(f[9]-u,0))&&24&t&&(t&=-25),t&&1!=t)h=8==t||16==t?Fr(e,t,s):32!=t&&33!=t||i.length?kr.apply(void 0,f):xr(e,t,n,r);else var h=Rr(e,t,n);return Lr((d?Dr:Pr)(h,f),e,t)},Ur=Rn,Br=Ln,Gr=pt(function(e,t,n){var r=1;if(n.length){var i=Br(n,Ur(Gr));r|=32}return Vr(e,r,t,n,i)});Gr.placeholder={};var Qr=Gr;var Yr=function(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e},qr=Ne,zr=Yt;var Wr=function(e){return zr(e)&&"[object Arguments]"==qr(e)},Jr=Yt,Kr=Object.prototype,Xr=Kr.hasOwnProperty,Hr=Kr.propertyIsEnumerable,Zr=Wr(function(){return arguments}())?Wr:function(e){return Jr(e)&&Xr.call(e,"callee")&&!Hr.call(e,"callee")},ei=Zr,ti=Qt,ni=de?de.isConcatSpreadable:void 0;var ri=Yr,ii=function(e){return ti(e)||ei(e)||!!(ni&&e&&e[ni])};var oi=function e(t,n,r,i,o){var a=-1,s=t.length;for(r||(r=ii),o||(o=[]);++a<s;){var c=t[a];n>0&&r(c)?n>1?e(c,n-1,r,i,o):ri(o,c):i||(o[o.length]=c)}return o},ai=oi;var si=function(e){return(null==e?0:e.length)?ai(e,1):[]},ci=tt,ui=st;var li=function(e){return ui(ci(e,void 0,si),e+"")},pi=mr;var di=function(e){if("string"==typeof e||pi(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t},fi=se,hi=Ke,yi=Qr,vi=di,mi=M(li(function(e,t){return fi(t,function(t){t=vi(t),hi(e,t,yi(e[t],e))}),e})),gi=Qt,Ei=mr,Ti=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,bi=/^\w*$/;var _i=function(e,t){if(gi(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!Ei(e))||(bi.test(e)||!Ti.test(e)||null!=t&&e in Object(t))},Ni=qe(Object,"create"),Ii=Ni;var Oi=function(){this.__data__=Ii?Ii(null):{},this.size=0};var wi=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Ai=Ni,Si=Object.prototype.hasOwnProperty;var Di=function(e){var t=this.__data__;if(Ai){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return Si.call(t,e)?t[e]:void 0},Ri=Ni,Fi=Object.prototype.hasOwnProperty;var ki=Ni;var xi=Oi,ji=wi,Ci=Di,Pi=function(e){var t=this.__data__;return Ri?void 0!==t[e]:Fi.call(t,e)},Li=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=ki&&void 0===t?"__lodash_hash_undefined__":t,this};function $i(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}$i.prototype.clear=xi,$i.prototype.delete=ji,$i.prototype.get=Ci,$i.prototype.has=Pi,$i.prototype.set=Li;var Mi=$i;var Vi=function(){this.__data__=[],this.size=0};var Ui=function(e,t){return e===t||e!=e&&t!=t},Bi=Ui;var Gi=function(e,t){for(var n=e.length;n--;)if(Bi(e[n][0],t))return n;return-1},Qi=Gi,Yi=Array.prototype.splice;var qi=Gi;var zi=Gi;var Wi=Gi;var Ji=Vi,Ki=function(e){var t=this.__data__,n=Qi(t,e);return!(n<0)&&(n==t.length-1?t.pop():Yi.call(t,n,1),--this.size,!0)},Xi=function(e){var t=this.__data__,n=qi(t,e);return n<0?void 0:t[n][1]},Hi=function(e){return zi(this.__data__,e)>-1},Zi=function(e,t){var n=this.__data__,r=Wi(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};function eo(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}eo.prototype.clear=Ji,eo.prototype.delete=Ki,eo.prototype.get=Xi,eo.prototype.has=Hi,eo.prototype.set=Zi;var to=eo,no=qe(pe,"Map"),ro=Mi,io=to,oo=no;var ao=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};var so=function(e,t){var n=e.__data__;return ao(t)?n["string"==typeof t?"string":"hash"]:n.map},co=so;var uo=so;var lo=so;var po=so;var fo=function(){this.size=0,this.__data__={hash:new ro,map:new(oo||io),string:new ro}},ho=function(e){var t=co(this,e).delete(e);return this.size-=t?1:0,t},yo=function(e){return uo(this,e).get(e)},vo=function(e){return lo(this,e).has(e)},mo=function(e,t){var n=po(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};function go(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}go.prototype.clear=fo,go.prototype.delete=ho,go.prototype.get=yo,go.prototype.has=vo,go.prototype.set=mo;var Eo=go,To=Eo;function bo(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(bo.Cache||To),n}bo.Cache=To;var _o=bo;var No=function(e){var t=_o(e,function(e){return 500===n.size&&n.clear(),e}),n=t.cache;return t},Io=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Oo=/\\(\\)?/g,wo=No(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(Io,function(e,n,r,i){t.push(r?i.replace(Oo,"$1"):n||e)}),t});var Ao=function(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i},So=Ao,Do=Qt,Ro=mr,Fo=de?de.prototype:void 0,ko=Fo?Fo.toString:void 0;var xo=function e(t){if("string"==typeof t)return t;if(Do(t))return So(t,e)+"";if(Ro(t))return ko?ko.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n},jo=xo;var Co=Qt,Po=_i,Lo=wo,$o=function(e){return null==e?"":jo(e)};var Mo=function(e,t){return Co(e)?e:Po(e,t)?[e]:Lo($o(e))},Vo=Mo,Uo=di;var Bo=function(e,t){for(var n=0,r=(t=Vo(t,e)).length;null!=e&&n<r;)e=e[Uo(t[n++])];return n&&n==r?e:void 0},Go=Bo;var Qo=function(e,t,n){var r=null==e?void 0:Go(e,t);return void 0===r?n:r},Yo=M(Qo),qo=to;var zo=to,Wo=no,Jo=Eo;var Ko=to,Xo=function(){this.__data__=new qo,this.size=0},Ho=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Zo=function(e){return this.__data__.get(e)},ea=function(e){return this.__data__.has(e)},ta=function(e,t){var n=this.__data__;if(n instanceof zo){var r=n.__data__;if(!Wo||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Jo(r)}return n.set(e,t),this.size=n.size,this};function na(e){var t=this.__data__=new Ko(e);this.size=t.size}na.prototype.clear=Xo,na.prototype.delete=Ho,na.prototype.get=Zo,na.prototype.has=ea,na.prototype.set=ta;var ra=na;var ia=Eo,oa=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},aa=function(e){return this.__data__.has(e)};function sa(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new ia;++t<n;)this.add(e[t])}sa.prototype.add=sa.prototype.push=oa,sa.prototype.has=aa;var ca=function(e,t){return e.has(t)},ua=sa,la=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1},pa=ca;var da=function(e,t,n,r,i,o){var a=1&n,s=e.length,c=t.length;if(s!=c&&!(a&&c>s))return!1;var u=o.get(e),l=o.get(t);if(u&&l)return u==t&&l==e;var p=-1,d=!0,f=2&n?new ua:void 0;for(o.set(e,t),o.set(t,e);++p<s;){var h=e[p],y=t[p];if(r)var v=a?r(y,h,p,t,e,o):r(h,y,p,e,t,o);if(void 0!==v){if(v)continue;d=!1;break}if(f){if(!la(t,function(e,t){if(!pa(f,t)&&(h===e||i(h,e,n,r,o)))return f.push(t)})){d=!1;break}}else if(h!==y&&!i(h,y,n,r,o)){d=!1;break}}return o.delete(e),o.delete(t),d},fa=pe.Uint8Array;var ha=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n},ya=fa,va=Ui,ma=da,ga=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n},Ea=ha,Ta=de?de.prototype:void 0,ba=Ta?Ta.valueOf:void 0;var _a=function(e,t,n,r,i,o,a){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!o(new ya(e),new ya(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return va(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var s=ga;case"[object Set]":var c=1&r;if(s||(s=Ea),e.size!=t.size&&!c)return!1;var u=a.get(e);if(u)return u==t;r|=2,a.set(e,t);var l=ma(s(e),s(t),r,i,o,a);return a.delete(e),l;case"[object Symbol]":if(ba)return ba.call(e)==ba.call(t)}return!1},Na=Yr,Ia=Qt;var Oa=function(e,t,n){var r=t(e);return Ia(e)?r:Na(r,n(e))};var wa=function(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n<r;){var a=e[n];t(a,n,e)&&(o[i++]=a)}return o};var Aa=function(){return[]},Sa=wa,Da=Aa,Ra=Object.prototype.propertyIsEnumerable,Fa=Object.getOwnPropertySymbols,ka=Fa?function(e){return null==e?[]:(e=Object(e),Sa(Fa(e),function(t){return Ra.call(e,t)}))}:Da;var xa=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r},ja={exports:{}};var Ca=function(){return!1};!function(e,t){var n=pe,r=Ca,i=t&&!t.nodeType&&t,o=i&&e&&!e.nodeType&&e,a=o&&o.exports===i?n.Buffer:void 0,s=(a?a.isBuffer:void 0)||r;e.exports=s}(ja,ja.exports);var Pa=ja.exports;var La=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},$a=Ne,Ma=La,Va=Yt,Ua={};Ua["[object Float32Array]"]=Ua["[object Float64Array]"]=Ua["[object Int8Array]"]=Ua["[object Int16Array]"]=Ua["[object Int32Array]"]=Ua["[object Uint8Array]"]=Ua["[object Uint8ClampedArray]"]=Ua["[object Uint16Array]"]=Ua["[object Uint32Array]"]=!0,Ua["[object Arguments]"]=Ua["[object Array]"]=Ua["[object ArrayBuffer]"]=Ua["[object Boolean]"]=Ua["[object DataView]"]=Ua["[object Date]"]=Ua["[object Error]"]=Ua["[object Function]"]=Ua["[object Map]"]=Ua["[object Number]"]=Ua["[object Object]"]=Ua["[object RegExp]"]=Ua["[object Set]"]=Ua["[object String]"]=Ua["[object WeakMap]"]=!1;var Ba=function(e){return Va(e)&&Ma(e.length)&&!!Ua[$a(e)]};var Ga=function(e){return function(t){return e(t)}},Qa={exports:{}};!function(e,t){var n=ce,r=t&&!t.nodeType&&t,i=r&&e&&!e.nodeType&&e,o=i&&i.exports===r&&n.process,a=function(){try{var e=i&&i.require&&i.require("util").types;return e||o&&o.binding&&o.binding("util")}catch(e){}}();e.exports=a}(Qa,Qa.exports);var Ya=Qa.exports,qa=Ba,za=Ga,Wa=Ya&&Ya.isTypedArray,Ja=Wa?za(Wa):qa,Ka=xa,Xa=Zr,Ha=Qt,Za=Pa,es=kn,ts=Ja,ns=Object.prototype.hasOwnProperty;var rs=function(e,t){var n=Ha(e),r=!n&&Xa(e),i=!n&&!r&&Za(e),o=!n&&!r&&!i&&ts(e),a=n||r||i||o,s=a?Ka(e.length,String):[],c=s.length;for(var u in e)!t&&!ns.call(e,u)||a&&("length"==u||i&&("offset"==u||"parent"==u)||o&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||es(u,c))||s.push(u);return s},is=Object.prototype;var os=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||is)};var as=function(e,t){return function(n){return e(t(n))}},ss=as(Object.keys,Object),cs=os,us=ss,ls=Object.prototype.hasOwnProperty;var ps=Se,ds=La;var fs=function(e){return null!=e&&ds(e.length)&&!ps(e)},hs=rs,ys=function(e){if(!cs(e))return us(e);var t=[];for(var n in Object(e))ls.call(e,n)&&"constructor"!=n&&t.push(n);return t},vs=fs;var ms=function(e){return vs(e)?hs(e):ys(e)},gs=Oa,Es=ka,Ts=ms;var bs=function(e){return gs(e,Ts,Es)},_s=bs,Ns=Object.prototype.hasOwnProperty;var Is=function(e,t,n,r,i,o){var a=1&n,s=_s(e),c=s.length;if(c!=_s(t).length&&!a)return!1;for(var u=c;u--;){var l=s[u];if(!(a?l in t:Ns.call(t,l)))return!1}var p=o.get(e),d=o.get(t);if(p&&d)return p==t&&d==e;var f=!0;o.set(e,t),o.set(t,e);for(var h=a;++u<c;){var y=e[l=s[u]],v=t[l];if(r)var m=a?r(v,y,l,t,e,o):r(y,v,l,e,t,o);if(!(void 0===m?y===v||i(y,v,n,r,o):m)){f=!1;break}h||(h="constructor"==l)}if(f&&!h){var g=e.constructor,E=t.constructor;g==E||!("constructor"in e)||!("constructor"in t)||"function"==typeof g&&g instanceof g&&"function"==typeof E&&E instanceof E||(f=!1)}return o.delete(e),o.delete(t),f},Os=qe(pe,"DataView"),ws=no,As=qe(pe,"Promise"),Ss=qe(pe,"Set"),Ds=dt,Rs=Ne,Fs=xe,ks="[object Map]",xs="[object Promise]",js="[object Set]",Cs="[object WeakMap]",Ps="[object DataView]",Ls=Fs(Os),$s=Fs(ws),Ms=Fs(As),Vs=Fs(Ss),Us=Fs(Ds),Bs=Rs;(Os&&Bs(new Os(new ArrayBuffer(1)))!=Ps||ws&&Bs(new ws)!=ks||As&&Bs(As.resolve())!=xs||Ss&&Bs(new Ss)!=js||Ds&&Bs(new Ds)!=Cs)&&(Bs=function(e){var t=Rs(e),n="[object Object]"==t?e.constructor:void 0,r=n?Fs(n):"";if(r)switch(r){case Ls:return Ps;case $s:return ks;case Ms:return xs;case Vs:return js;case Us:return Cs}return t});var Gs=Bs,Qs=ra,Ys=da,qs=_a,zs=Is,Ws=Gs,Js=Qt,Ks=Pa,Xs=Ja,Hs="[object Arguments]",Zs="[object Array]",ec="[object Object]",tc=Object.prototype.hasOwnProperty;var nc=function(e,t,n,r,i,o){var a=Js(e),s=Js(t),c=a?Zs:Ws(e),u=s?Zs:Ws(t),l=(c=c==Hs?ec:c)==ec,p=(u=u==Hs?ec:u)==ec,d=c==u;if(d&&Ks(e)){if(!Ks(t))return!1;a=!0,l=!1}if(d&&!l)return o||(o=new Qs),a||Xs(e)?Ys(e,t,n,r,i,o):qs(e,t,c,n,r,i,o);if(!(1&n)){var f=l&&tc.call(e,"__wrapped__"),h=p&&tc.call(t,"__wrapped__");if(f||h){var y=f?e.value():e,v=h?t.value():t;return o||(o=new Qs),i(y,v,n,r,o)}}return!!d&&(o||(o=new Qs),zs(e,t,n,r,i,o))},rc=Yt;var ic=function e(t,n,r,i,o){return t===n||(null==t||null==n||!rc(t)&&!rc(n)?t!=t&&n!=n:nc(t,n,r,i,e,o))},oc=ic;var ac=M(function(e,t){return oc(e,t)});var sc={},cc={},uc={},lc=V(l);!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ReactiveVarsCache=e.makeCachedVar=e.initReactiveVarsCache=e.cachedReactiveVarTypename=void 0;const t=lc;var n;e.cachedReactiveVarTypename="CachedReactiveVar",e.initReactiveVarsCache=function(e){return n=new i({cache:e})};const r=t.gql`
  fragment ReadCachedReactiveVarFragment on CachedReactiveVar {
    id
    value
  }
`;e.makeCachedVar=function(e,t){return n.registerCachedVar(e,t)};class i{constructor({cache:e}){this.registeredVars={},this.cache=e}watchReactiveVar(e,t){t.onNextChange(n=>{this.writeCachedVar(e,n),this.watchReactiveVar(e,t)})}registerCachedVar(e,n){const r=this.readCachedVar(e),i=(0,t.makeVar)(null!=r?r:n);return this.registeredVars[e]&&console.warn(`Duplicate cached reactive variable with ID ${e} detected. Multiple cached reactive variables should not share the same ID.`),this.registeredVars[e]={rv:i,defaultValue:n},r||this.writeCachedVar(e,n),this.watchReactiveVar(e,i),i}readCachedVar(t){var n;const i=this.cache.identify({__typename:e.cachedReactiveVarTypename,id:t}),o=this.cache.readFragment({fragment:r,id:i});return null!==(n=null==o?void 0:o.value)&&void 0!==n?n:null}writeCachedVar(t,i){void 0!==i&&this.cache.writeFragment({id:n.cache.identify({__typename:e.cachedReactiveVarTypename,id:t}),fragment:r,data:{__typename:e.cachedReactiveVarTypename,id:t,value:i}})}reset(){Object.keys(this.registeredVars).forEach(e=>{var t;const{rv:n,defaultValue:r}=this.registeredVars[e];n(null!==(t=this.readCachedVar(e))&&void 0!==t?t:r)})}}e.ReactiveVarsCache=i}(uc);var pc={};var dc=function(e){for(var t=-1,n=null==e?0:e.length,r=0,i=[];++t<n;){var o=e[t];o&&(i[r++]=o)}return i};var fc=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0};var hc=function(e){return function(t,n,r){for(var i=-1,o=Object(t),a=r(t),s=a.length;s--;){var c=a[e?s:++i];if(!1===n(o[c],c,o))break}return t}}(),yc=ms;var vc=fs;var mc=function(e,t){return function(n,r){if(null==n)return n;if(!vc(n))return e(n,r);for(var i=n.length,o=t?i:-1,a=Object(n);(t?o--:++o<i)&&!1!==r(a[o],o,a););return n}}(function(e,t){return e&&hc(e,t,yc)}),gc=mc;var Ec=ra,Tc=ic;var bc=Ie;var _c=function(e){return e==e&&!bc(e)},Nc=_c,Ic=ms;var Oc=function(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}},wc=function(e,t,n,r){var i=n.length,o=i,a=!r;if(null==e)return!o;for(e=Object(e);i--;){var s=n[i];if(a&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++i<o;){var c=(s=n[i])[0],u=e[c],l=s[1];if(a&&s[2]){if(void 0===u&&!(c in e))return!1}else{var p=new Ec;if(r)var d=r(u,l,c,e,t,p);if(!(void 0===d?Tc(l,u,3,r,p):d))return!1}}return!0},Ac=function(e){for(var t=Ic(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,Nc(i)]}return t},Sc=Oc;var Dc=Mo,Rc=Zr,Fc=Qt,kc=kn,xc=La,jc=di;var Cc=function(e,t){return null!=e&&t in Object(e)},Pc=function(e,t,n){for(var r=-1,i=(t=Dc(t,e)).length,o=!1;++r<i;){var a=jc(t[r]);if(!(o=null!=e&&n(e,a)))break;e=e[a]}return o||++r!=i?o:!!(i=null==e?0:e.length)&&xc(i)&&kc(a,i)&&(Fc(e)||Rc(e))};var Lc=function(e,t){return null!=e&&Pc(e,t,Cc)},$c=ic,Mc=Qo,Vc=Lc,Uc=_i,Bc=_c,Gc=Oc,Qc=di;var Yc=Bo;var qc=function(e){return function(t){return null==t?void 0:t[e]}},zc=function(e){return function(t){return Yc(t,e)}},Wc=_i,Jc=di;var Kc=function(e){var t=Ac(e);return 1==t.length&&t[0][2]?Sc(t[0][0],t[0][1]):function(n){return n===e||wc(n,e,t)}},Xc=function(e,t){return Uc(e)&&Bc(t)?Gc(Qc(e),t):function(n){var r=Mc(n,e);return void 0===r&&r===t?Vc(n,e):$c(t,r,3)}},Hc=Xe,Zc=Qt,eu=function(e){return Wc(e)?qc(Jc(e)):zc(e)};var tu=function(e){return"function"==typeof e?e:null==e?Hc:"object"==typeof e?Zc(e)?Xc(e[0],e[1]):Kc(e):eu(e)},nu=Ui,ru=fs,iu=kn,ou=Ie;var au=fc,su=function(e,t){var n=!0;return gc(e,function(e,r,i){return n=!!t(e,r,i)}),n},cu=tu,uu=Qt,lu=function(e,t,n){if(!ou(n))return!1;var r=typeof t;return!!("number"==r?ru(n)&&iu(t,n.length):"string"==r&&t in n)&&nu(n[t],e)};var pu=function(e,t,n){var r=uu(e)?au:su;return n&&lu(e,t,n)&&(t=void 0),r(e,cu(t))},du=Ke,fu=Ui,hu=Object.prototype.hasOwnProperty;var yu=function(e,t,n){var r=e[t];hu.call(e,t)&&fu(r,n)&&(void 0!==n||t in e)||du(e,t,n)},vu=yu,mu=Mo,gu=kn,Eu=Ie,Tu=di;var bu=function(e,t,n,r){if(!Eu(e))return e;for(var i=-1,o=(t=mu(t,e)).length,a=o-1,s=e;null!=s&&++i<o;){var c=Tu(t[i]),u=n;if("__proto__"===c||"constructor"===c||"prototype"===c)return e;if(i!=a){var l=s[c];void 0===(u=r?r(l,c,s):void 0)&&(u=Eu(l)?l:gu(t[i+1])?[]:{})}vu(s,c,u),s=s[c]}return e},_u=Bo,Nu=bu,Iu=Mo;var Ou=function(e,t,n){for(var r=-1,i=t.length,o={};++r<i;){var a=t[r],s=_u(e,a);n(s,a)&&Nu(o,Iu(a,e),s)}return o},wu=Lc;var Au=function(e,t){return Ou(e,t,function(t,n){return wu(e,n)})},Su=li(function(e,t){return null==e?{}:Au(e,t)});var Du=function(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var o=Array(i);++r<i;)o[r]=e[r+t];return o},Ru=Sr;var Fu=function(e,t,n){return e&&e.length?(t=n||void 0===t?1:Ru(t),Du(e,0,t<0?0:t)):[]};var ku=function(e){return null==e},xu=mc,ju=fs;var Cu=mr;var Pu=function(e,t){if(e!==t){var n=void 0!==e,r=null===e,i=e==e,o=Cu(e),a=void 0!==t,s=null===t,c=t==t,u=Cu(t);if(!s&&!u&&!o&&e>t||o&&a&&c&&!s&&!u||r&&a&&c||!n&&c||!i)return 1;if(!r&&!o&&!u&&e<t||u&&n&&i&&!r&&!o||s&&n&&i||!a&&i||!c)return-1}return 0};var Lu=Ao,$u=Bo,Mu=tu,Vu=function(e,t){var n=-1,r=ju(e)?Array(e.length):[];return xu(e,function(e,i,o){r[++n]=t(e,i,o)}),r},Uu=function(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e},Bu=Ga,Gu=function(e,t,n){for(var r=-1,i=e.criteria,o=t.criteria,a=i.length,s=n.length;++r<a;){var c=Pu(i[r],o[r]);if(c)return r>=s?c:c*("desc"==n[r]?-1:1)}return e.index-t.index},Qu=Xe,Yu=Qt;var qu=function(e,t,n){t=t.length?Lu(t,function(e){return Yu(e)?function(t){return $u(t,1===e.length?e[0]:e)}:e}):[Qu];var r=-1;t=Lu(t,Bu(Mu));var i=Vu(e,function(e,n,i){return{criteria:Lu(t,function(t){return t(e)}),index:++r,value:e}});return Uu(i,function(e,t){return Gu(e,t,n)})},zu=Qt;var Wu=function(e,t,n,r){return null==e?[]:(zu(t)||(t=null==t?[]:[t]),zu(n=r?void 0:n)||(n=null==n?[]:[n]),qu(e,t,n))},Ju={},Ku=Ne,Xu=Yt;var Hu,Zu,el,tl=function(e){return"number"==typeof e||Xu(e)&&"[object Number]"==Ku(e)},nl={};Object.defineProperty(nl,"__esModule",{value:!0}),nl.RenewalPolicy=nl.InvalidationPolicyLifecycleEvent=nl.InvalidationPolicyEvent=void 0,function(e){e.Write="Write",e.Evict="Evict",e.Read="Read"}(Hu||(nl.InvalidationPolicyEvent=Hu={})),function(e){e.Write="onWrite",e.Evict="onEvict"}(Zu||(nl.InvalidationPolicyLifecycleEvent=Zu={})),function(e){e.AccessOnly="access-only",e.AccessAndWrite="access-and-write",e.WriteOnly="write-only",e.None="none"}(el||(nl.RenewalPolicy=el={}));var rl={},il=yu,ol=Ke;var al=function(e,t,n,r){var i=!n;n||(n={});for(var o=-1,a=t.length;++o<a;){var s=t[o],c=r?r(n[s],e[s],s,n,e):void 0;void 0===c&&(c=e[s]),i?ol(n,s,c):il(n,s,c)}return n},sl=al,cl=ms;var ul=function(e,t){return e&&sl(t,cl(t),e)};var ll=Ie,pl=os,dl=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t},fl=Object.prototype.hasOwnProperty;var hl=rs,yl=function(e){if(!ll(e))return dl(e);var t=pl(e),n=[];for(var r in e)("constructor"!=r||!t&&fl.call(e,r))&&n.push(r);return n},vl=fs;var ml=function(e){return vl(e)?hl(e,!0):yl(e)},gl=al,El=ml;var Tl=function(e,t){return e&&gl(t,El(t),e)},bl={exports:{}};!function(e,t){var n=pe,r=t&&!t.nodeType&&t,i=r&&e&&!e.nodeType&&e,o=i&&i.exports===r?n.Buffer:void 0,a=o?o.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,r=a?a(n):new e.constructor(n);return e.copy(r),r}}(bl,bl.exports);var _l=bl.exports,Nl=al,Il=ka;var Ol=function(e,t){return Nl(e,Il(e),t)},wl=as(Object.getPrototypeOf,Object),Al=Yr,Sl=wl,Dl=ka,Rl=Aa,Fl=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)Al(t,Dl(e)),e=Sl(e);return t}:Rl,kl=al,xl=Fl;var jl=function(e,t){return kl(e,xl(e),t)},Cl=Oa,Pl=Fl,Ll=ml;var $l=function(e){return Cl(e,Ll,Pl)},Ml=Object.prototype.hasOwnProperty;var Vl=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&Ml.call(e,"index")&&(n.index=e.index,n.input=e.input),n},Ul=fa;var Bl=function(e){var t=new e.constructor(e.byteLength);return new Ul(t).set(new Ul(e)),t},Gl=Bl;var Ql=function(e,t){var n=t?Gl(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)},Yl=/\w*$/;var ql=function(e){var t=new e.constructor(e.source,Yl.exec(e));return t.lastIndex=e.lastIndex,t},zl=de?de.prototype:void 0,Wl=zl?zl.valueOf:void 0;var Jl=Bl;var Kl=Bl,Xl=Ql,Hl=ql,Zl=function(e){return Wl?Object(Wl.call(e)):{}},ep=function(e,t){var n=t?Jl(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)};var tp=function(e,t,n){var r=e.constructor;switch(t){case"[object ArrayBuffer]":return Kl(e);case"[object Boolean]":case"[object Date]":return new r(+e);case"[object DataView]":return Xl(e,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return ep(e,n);case"[object Map]":case"[object Set]":return new r;case"[object Number]":case"[object String]":return new r(e);case"[object RegExp]":return Hl(e);case"[object Symbol]":return Zl(e)}},np=gt,rp=wl,ip=os;var op=function(e){return"function"!=typeof e.constructor||ip(e)?{}:np(rp(e))},ap=Gs,sp=Yt;var cp=function(e){return sp(e)&&"[object Map]"==ap(e)},up=Ga,lp=Ya&&Ya.isMap,pp=lp?up(lp):cp,dp=Gs,fp=Yt;var hp=function(e){return fp(e)&&"[object Set]"==dp(e)},yp=Ga,vp=Ya&&Ya.isSet,mp=vp?yp(vp):hp,gp=ra,Ep=se,Tp=yu,bp=ul,_p=Tl,Np=_l,Ip=qt,Op=Ol,wp=jl,Ap=bs,Sp=$l,Dp=Gs,Rp=Vl,Fp=tp,kp=op,xp=Qt,jp=Pa,Cp=pp,Pp=Ie,Lp=mp,$p=ms,Mp=ml,Vp="[object Arguments]",Up="[object Function]",Bp="[object Object]",Gp={};Gp[Vp]=Gp["[object Array]"]=Gp["[object ArrayBuffer]"]=Gp["[object DataView]"]=Gp["[object Boolean]"]=Gp["[object Date]"]=Gp["[object Float32Array]"]=Gp["[object Float64Array]"]=Gp["[object Int8Array]"]=Gp["[object Int16Array]"]=Gp["[object Int32Array]"]=Gp["[object Map]"]=Gp["[object Number]"]=Gp[Bp]=Gp["[object RegExp]"]=Gp["[object Set]"]=Gp["[object String]"]=Gp["[object Symbol]"]=Gp["[object Uint8Array]"]=Gp["[object Uint8ClampedArray]"]=Gp["[object Uint16Array]"]=Gp["[object Uint32Array]"]=!0,Gp["[object Error]"]=Gp[Up]=Gp["[object WeakMap]"]=!1;var Qp=function e(t,n,r,i,o,a){var s,c=1&n,u=2&n,l=4&n;if(r&&(s=o?r(t,i,o,a):r(t)),void 0!==s)return s;if(!Pp(t))return t;var p=xp(t);if(p){if(s=Rp(t),!c)return Ip(t,s)}else{var d=Dp(t),f=d==Up||"[object GeneratorFunction]"==d;if(jp(t))return Np(t,c);if(d==Bp||d==Vp||f&&!o){if(s=u||f?{}:kp(t),!c)return u?wp(t,_p(s,t)):Op(t,bp(s,t))}else{if(!Gp[d])return o?t:{};s=Fp(t,d,c)}}a||(a=new gp);var h=a.get(t);if(h)return h;a.set(t,s),Lp(t)?t.forEach(function(i){s.add(e(i,n,r,i,t,a))}):Cp(t)&&t.forEach(function(i,o){s.set(o,e(i,n,r,o,t,a))});var y=p?void 0:(l?u?Sp:Ap:u?Mp:$p)(t);return Ep(y||t,function(i,o){y&&(i=t[o=i]),Tp(s,o,e(i,n,r,o,t,a))}),s},Yp=Qp;var qp=function(e){return Yp(e,5)},zp=Ne,Wp=wl,Jp=Yt,Kp=Function.prototype,Xp=Object.prototype,Hp=Kp.toString,Zp=Xp.hasOwnProperty,ed=Hp.call(Object);var td=function(e){if(!Jp(e)||"[object Object]"!=zp(e))return!1;var t=Wp(e);if(null===t)return!0;var n=Zp.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Hp.call(n)==ed};function nd(){return p.randomBytes(16)}for(var rd,id,od=[],ad=0;ad<256;++ad)od[ad]=(ad+256).toString(16).substr(1);function sd(e,t){var n=0,r=od;return[r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]]].join("")}var cd=0,ud=0;function ld(e,t,n){var r=function(e,r,i,o){var a=i&&o||0;if("string"==typeof e&&(e=function(e){e=unescape(encodeURIComponent(e));for(var t=new Array(e.length),n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t}(e)),"string"==typeof r&&(r=function(e){var t=[];return e.replace(/[a-fA-F0-9]{2}/g,function(e){t.push(parseInt(e,16))}),t}(r)),!Array.isArray(e))throw TypeError("value must be an array of bytes");if(!Array.isArray(r)||16!==r.length)throw TypeError("namespace must be uuid string or an Array of 16 byte values");var s=n(r.concat(e));if(s[6]=15&s[6]|t,s[8]=63&s[8]|128,i)for(var c=0;c<16;++c)i[a+c]=s[c];return i||sd(s)};try{r.name=e}catch(e){}return r.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",r.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",r}const pd=ld("v3",48,function(e){return Array.isArray(e)?e=Buffer.from(e):"string"==typeof e&&(e=Buffer.from(e,"utf8")),p.createHash("md5").update(e).digest()});const dd=ld("v5",80,function(e){return Array.isArray(e)?e=Buffer.from(e):"string"==typeof e&&(e=Buffer.from(e,"utf8")),p.createHash("sha1").update(e).digest()});var fd=Object.freeze({__proto__:null,v1:function(e,t,n){var r=t&&n||0,i=t||[],o=(e=e||{}).node||rd,a=void 0!==e.clockseq?e.clockseq:id;if(null==o||null==a){var s=e.random||(e.rng||nd)();null==o&&(o=rd=[1|s[0],s[1],s[2],s[3],s[4],s[5]]),null==a&&(a=id=16383&(s[6]<<8|s[7]))}var c=void 0!==e.msecs?e.msecs:(new Date).getTime(),u=void 0!==e.nsecs?e.nsecs:ud+1,l=c-cd+(u-ud)/1e4;if(l<0&&void 0===e.clockseq&&(a=a+1&16383),(l<0||c>cd)&&void 0===e.nsecs&&(u=0),u>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");cd=c,ud=u,id=a;var p=(1e4*(268435455&(c+=122192928e5))+u)%4294967296;i[r++]=p>>>24&255,i[r++]=p>>>16&255,i[r++]=p>>>8&255,i[r++]=255&p;var d=c/4294967296*1e4&268435455;i[r++]=d>>>8&255,i[r++]=255&d,i[r++]=d>>>24&15|16,i[r++]=d>>>16&255,i[r++]=a>>>8|128,i[r++]=255&a;for(var f=0;f<6;++f)i[r+f]=o[f];return t||sd(i)},v3:pd,v4:function(e,t,n){var r=t&&n||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var i=(e=e||{}).random||(e.rng||nd)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,t)for(var o=0;o<16;++o)t[r+o]=i[o];return t||sd(i)},v5:dd}),hd=V(fd);!function(e){var t=$&&$.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.generateFragmentFieldName=e.fieldNameFromStoreName=e.TypeOrFieldNameRegExp=e.maybeDeepClone=e.makeEntityId=e.isQuery=void 0;const n=t(qp),r=t(dc),i=t(td),o=hd;function a(e){return"ROOT_QUERY"===e||"ROOT_MUTATION"===e}e.isQuery=a,e.makeEntityId=function(e,t){return a(e)?(0,r.default)([e,t]).join("."):e};e.maybeDeepClone=e=>(0,i.default)(e)&&Object.isFrozen(e)?(0,n.default)(e):e,e.TypeOrFieldNameRegExp=/^[_a-z][_0-9a-z]*/i,e.fieldNameFromStoreName=function(t){var n=t.match(e.TypeOrFieldNameRegExp);return n?n[0]:t},e.generateFragmentFieldName=function({fragmentName:e}={}){return`-fragment-${null!=e?e:(0,o.v4)()}`}}(rl);var yd=$&&$.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n},vd=$&&$.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ju,"__esModule",{value:!0});const md=vd(tl),gd=nl,Ed=rl,Td=U,bd=nl;Ju.default=class{constructor(e){this.config=e,this.policyActionStorage={};const{cacheOperations:{readField:t,evict:n,modify:r}}=this.config;this.mutedCacheOperations={readField:t,evict:e=>n(Object.assign(Object.assign({},e),{broadcast:!1})),modify:e=>r(Object.assign(Object.assign({},e),{broadcast:!1}))},this.activePolicyEvents=this.activateInitialPolicyEvents()}activateInitialPolicyEvents(){const{policies:e}=this.config,{types:t={},timeToLive:n}=e;return Object.keys(t).reduce((e,n)=>{const r=t[n];return e[gd.InvalidationPolicyEvent.Read]=e[gd.InvalidationPolicyEvent.Read]||!!r.timeToLive,e[gd.InvalidationPolicyEvent.Write]=e[gd.InvalidationPolicyEvent.Write]||!!r[gd.InvalidationPolicyLifecycleEvent.Write],e[gd.InvalidationPolicyEvent.Evict]=e[gd.InvalidationPolicyEvent.Evict]||!!r[gd.InvalidationPolicyLifecycleEvent.Evict],e},{[gd.InvalidationPolicyEvent.Read]:!!n,[gd.InvalidationPolicyEvent.Write]:!1,[gd.InvalidationPolicyEvent.Evict]:!1})}getPolicy(e){var t,n;return(null===(n=null===(t=this.config.policies)||void 0===t?void 0:t.types)||void 0===n?void 0:n[e])||null}getPolicyActionStorage(e){return this.policyActionStorage[e]||(this.policyActionStorage[e]={}),this.policyActionStorage[e]}getTypePolicyForEvent(e,t){const n=this.getPolicy(e);return n?n[gd.InvalidationPolicyLifecycleEvent[t]]:null}runPolicyEvent(e,t,n){const{entityTypeMap:r}=this.config,{mutedCacheOperations:i}=this,o=this.getTypePolicyForEvent(e,t);if(!o)return;let a,s={};if("object"==typeof o){let{__default:e}=o;a=e,s=yd(o,["__default"])}else a=o;a&&a(i,Object.assign({storage:this.getPolicyActionStorage(`${e}__default`)},n)),Object.keys(s).forEach(e=>{var t;const a=null!==(t=r.readEntitiesByType(e))&&void 0!==t?t:{},s=o[e];Object.values(a).forEach(e=>{const{dataId:t,fieldName:r,storeFieldNames:o}=e;o?Object.keys(o.entries).forEach(e=>{s(i,Object.assign({id:t,fieldName:r,storeFieldName:e,variables:o.entries[e].variables,args:o.entries[e].args,ref:(0,Td.makeReference)(t),storage:this.getPolicyActionStorage(e)},n))}):s(i,Object.assign({id:t,storage:this.getPolicyActionStorage(t),ref:(0,Td.makeReference)(t)},n))})})}getRenewalPolicyForType(e){var t,n,r,i;const{policies:o}=this.config;return null!==(i=null!==(r=null===(n=null===(t=o.types)||void 0===t?void 0:t[e])||void 0===n?void 0:n.renewalPolicy)&&void 0!==r?r:o.renewalPolicy)&&void 0!==i?i:bd.RenewalPolicy.WriteOnly}runWritePolicy(e,t){return this.runPolicyEvent(e,gd.InvalidationPolicyEvent.Write,t)}runEvictPolicy(e,t){return this.runPolicyEvent(e,gd.InvalidationPolicyEvent.Evict,t)}runReadPolicy({typename:e,dataId:t,fieldName:n,storeFieldName:r,reportOnly:i=!1}){var o;const{cacheOperations:a,entityTypeMap:s,policies:c}=this.config,u=(0,Ed.makeEntityId)(t,n),l=s.readEntityById(u);if(!l)return!1;let p;if(r&&l.storeFieldNames){const e=l.storeFieldNames.entries[r];if(!e)return!1;p=e.cacheTime}else p=l.cacheTime;const d=(null===(o=this.getPolicy(e))||void 0===o?void 0:o.timeToLive)||c.timeToLive;return!!((0,md.default)(p)&&d&&Date.now()>p+d)&&(i||a.evict({id:t,fieldName:r,broadcast:!1}),!0)}activatePolicies(...e){e.forEach(e=>this.activePolicyEvents[e]=!0)}deactivatePolicies(...e){e.forEach(e=>this.activePolicyEvents[e]=!1)}isPolicyEventActive(e){return this.activePolicyEvents[e]}};var _d,Nd={},Id={},Od={};_d=Od,Object.defineProperty(_d,"__esModule",{value:!0}),_d.collectionEntityIdForType=_d.cacheExtensionsCollectionTypename=void 0,_d.cacheExtensionsCollectionTypename="CacheExtensionsCollectionEntity",_d.collectionEntityIdForType=function(e){return`${_d.cacheExtensionsCollectionTypename}:${e}`},Object.defineProperty(Id,"__esModule",{value:!0});const wd=rl,Ad=Od;Id.default=class{constructor(e){this.config=e,this.delete=(e,t,n)=>{const{entityStore:r,entityTypeMap:i,policies:o}=this.config,a=this.storeFunctions.delete.call(r,e,t,n),s=i.readEntityById((0,wd.makeEntityId)(e,t)),c=t&&n?o.getStoreFieldName({typename:s?s.typename:void 0,fieldName:t,args:n}):void 0;return i.evict(e,c||t),a},this.merge=(e,t)=>{const{entityStore:n,entityTypeMap:r}=this.config;if((0,wd.isQuery)(e))Object.keys(t).filter(e=>"__typename"!==e).forEach(n=>{const i=t[n],o=null==i?void 0:i.__typename;if(o)r.write(o,e,n);else{const t=this.config.policies.rootTypenamesById[e];r.write(t,e,n)}});else{const n=t.__typename;e&&n&&n!==Ad.cacheExtensionsCollectionTypename&&(this.config.updateCollectionField(n,e),r.write(n,e))}return this.storeFunctions.merge.call(n,e,t)},this.clear=()=>{const{config:{entityStore:e,entityTypeMap:t},storeFunctions:n}=this;t.clear(),n.clear.call(e)},this.replace=e=>{const{config:{entityStore:t,entityTypeMap:n,reactiveVarsCache:r},storeFunctions:{replace:i}}=this,o=null==e?void 0:e.invalidation;if(!e||!o)return i.call(t,e),void r.reset();delete e.invalidation,n.restore(o.entitiesById),this.pause(),i.call(t,e),r.reset(),this.watch()};const{entityStore:{clear:t,delete:n,merge:r,replace:i}}=this.config;this.storeFunctions={clear:t,delete:n,merge:r,replace:i},this.watch()}watch(){const{entityStore:e}=this.config;e.clear=this.clear,e.delete=this.delete,e.merge=this.merge,e.replace=this.replace}pause(){const{entityStore:e}=this.config,{clear:t,delete:n,merge:r,replace:i}=this.storeFunctions;e.clear=t,e.delete=n,e.merge=r,e.replace=i}};var Sd={},Dd=bu;var Rd=function(e,t,n){return null==e?e:Dd(e,t,n)},Fd=$&&$.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Sd,"__esModule",{value:!0});const kd=Fd(Rd),xd=rl;Sd.default=class{constructor(){this.entitiesByType={},this.entitiesById={}}write(e,t,n,r,i){const o=n?(0,xd.fieldNameFromStoreName)(n):void 0,a=(0,xd.makeEntityId)(t,o),s=this.readEntityById(a);if(s){if((0,xd.isQuery)(t)&&n){const e=s.storeFieldNames.entries[n];e?(e.variables=r,e.args=i):(s.storeFieldNames.entries[n]={variables:r,args:i},s.storeFieldNames.__size++)}}else{let s;const c=Date.now();s=(0,xd.isQuery)(t)&&n?{dataId:t,typename:e,fieldName:o,storeFieldNames:{__size:1,entries:{[n]:{variables:r,args:i,cacheTime:c}}}}:{dataId:t,typename:e,cacheTime:c},(0,kd.default)(this.entitiesByType,[e,a],s),this.entitiesById[a]=s}}evict(e,t){var n;const r=t?(0,xd.fieldNameFromStoreName)(t):null,i=(0,xd.makeEntityId)(e,r),o=this.readEntityById(i);if(o)if(t&&r!==t){const e=null===(n=this.entitiesByType[o.typename][i])||void 0===n?void 0:n.storeFieldNames;e&&(1===e.__size?(delete this.entitiesByType[o.typename][i],delete this.entitiesById[i]):(e.__size--,delete e.entries[t]))}else delete this.entitiesByType[o.typename][i],delete this.entitiesById[i]}readEntitiesByType(e){return this.entitiesByType[e]||null}readEntityById(e){return this.entitiesById[e]||null}renewEntity(e,t){const n=t?(0,xd.fieldNameFromStoreName)(t):void 0,r=this.entitiesById[(0,xd.makeEntityId)(e,n)];if(r){const n=Date.now();if((0,xd.isQuery)(e)&&t){const e=r.storeFieldNames.entries[t];e&&(e.cacheTime=n)}else r.cacheTime=n}}restore(e){this.entitiesById=e,Object.keys(e).forEach(t=>{const n=e[t];this.entitiesByType[n.typename]||(this.entitiesByType[n.typename]={}),this.entitiesByType[n.typename][t]=n})}extract(){const{entitiesById:e,entitiesByType:t}=this;return{entitiesById:e,entitiesByType:t}}clear(){this.entitiesById={},this.entitiesByType={}}},function(e){var t=$&&$.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.EntityTypeMap=e.EntityStoreWatcher=void 0;var n=Id;Object.defineProperty(e,"EntityStoreWatcher",{enumerable:!0,get:function(){return t(n).default}});var r=Sd;Object.defineProperty(e,"EntityTypeMap",{enumerable:!0,get:function(){return t(r).default}})}(Nd);var jd={},Cd=V(d),Pd=$&&$.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(jd,"__esModule",{value:!0}),jd.CacheResultProcessor=jd.ReadResultStatus=void 0;const Ld=U,$d=Pd(td),Md=Pd(Qt),Vd=Cd,Ud=rl,Bd=nl;var Gd;!function(e){e[e.Evicted=0]="Evicted",e[e.Incomplete=1]="Incomplete",e[e.Complete=2]="Complete"}(Gd||(jd.ReadResultStatus=Gd={}));jd.CacheResultProcessor=class{constructor(e){this.config=e}getFieldsForQuery(e){const t=(0,Vd.getOperationDefinition)(e.query),n=(0,Vd.createFragmentMap)((0,Vd.getFragmentDefinitions)(e.query));return t.selectionSet.selections.reduce((e,t)=>{var r,i;if((0,Vd.isField)(t))return e.push(t),e;const o=null===(i=null===(r=(0,Vd.getFragmentFromSelection)(t,n))||void 0===r?void 0:r.selectionSet)||void 0===i?void 0:i.selections;return o&&e.push(...o),e},[])}processReadSubResult(e,t){const{cache:n,invalidationPolicyManager:r,entityTypeMap:i}=this.config,o=null==t?e:e[t];if((0,$d.default)(o)){const{__typename:a}=o,s=Object.keys(o).reduce((e,t)=>this.processReadSubResult(o,t)===Gd.Complete,!0);if(a){const s=n.identify(o);if(s){const n=r.getRenewalPolicyForType(a);n!==Bd.RenewalPolicy.AccessAndWrite&&n!==Bd.RenewalPolicy.AccessOnly||i.renewEntity(s);if(r.runReadPolicy({typename:a,dataId:s}))return(0,$d.default)(e)&&t&&delete e[t],Gd.Evicted}}return s?Gd.Complete:Gd.Incomplete}if((0,Md.default)(o)){let n=Gd.Complete;const r=o.map((e,t)=>{const r=this.processReadSubResult(o,t);return r<n&&(n=r),r});return n===Gd.Evicted&&t&&(e[t]=o.filter((e,t)=>r[t]!==Gd.Evicted)),n===Gd.Complete?Gd.Complete:Gd.Incomplete}return Gd.Complete}processReadResult(e,t){const{cache:n,entityTypeMap:r,invalidationPolicyManager:i}=this.config,{rootId:o="ROOT_QUERY"}=t;if((0,$d.default)(e)){if((0,Ud.isQuery)(o)){const{variables:a}=t,s=this.getFieldsForQuery(t).reduce((t,s)=>{var c;const u=s.name.value,l=(0,Vd.resultKeyNameFromField)(s),p=this.processReadSubResult(e,l),d=null===(c=r.readEntityById((0,Ud.makeEntityId)(o,u)))||void 0===c?void 0:c.typename;if(d){const t=n.policies.getStoreFieldName({typename:d,fieldName:u,field:s,variables:a}),c=n.policies.rootTypenamesById[o],p=n.policies.getStoreFieldName({typename:c,fieldName:u,field:s,variables:a}),f=i.getRenewalPolicyForType(d);f!==Bd.RenewalPolicy.AccessAndWrite&&f!==Bd.RenewalPolicy.AccessOnly||(r.renewEntity(o,t),r.renewEntity(o,p));const h=i.runReadPolicy({typename:d,dataId:o,fieldName:u,storeFieldName:t}),y=i.runReadPolicy({typename:d,dataId:o,fieldName:u,storeFieldName:p});if(h||y)return delete e[l],!1}return t&&p===Gd.Complete},!0);return(0,Vd.maybeDeepFreeze)(e),s?Gd.Complete:Gd.Incomplete}return(0,Vd.maybeDeepFreeze)(e),this.processReadSubResult(e)}return Gd.Complete}processWriteSubResult(e){const{cache:t,invalidationPolicyManager:n,entityTypeMap:r}=this.config;if((0,$d.default)(e)){const{__typename:i}=e;if(Object.keys(e).forEach(t=>this.processWriteSubResult(e[t])),i){const o=t.identify(e);if(o){const e=n.getRenewalPolicyForType(i);e!==Bd.RenewalPolicy.WriteOnly&&e!==Bd.RenewalPolicy.AccessAndWrite||r.renewEntity(o),n.runWritePolicy(i,{parent:{id:o,ref:(0,Ld.makeReference)(o)}})}}}else(0,Md.default)(e)&&e.forEach(e=>this.processWriteSubResult(e))}processWriteResult(e){var t;const{dataId:n,variables:r,result:i}=e,{entityTypeMap:o,cache:a,invalidationPolicyManager:s}=this.config;if((0,$d.default)(i)&&this.processWriteSubResult(i),n&&(0,Ud.isQuery)(n)&&(0,$d.default)(i))this.getFieldsForQuery(e).forEach(e=>{var t;const i=e.name.value,c=null===(t=o.readEntityById((0,Ud.makeEntityId)(n,i)))||void 0===t?void 0:t.typename;if(c){const t=a.policies.getStoreFieldName({typename:c,field:e,fieldName:i,variables:r}),u=(0,Vd.argumentsObjectFromField)(e,r),l=null!=r?r:null!==u?{}:void 0,p=a.policies.rootTypenamesById[n],d=a.policies.getStoreFieldName({typename:p,fieldName:i,field:e,variables:r});o.write(c,n,t,l,u),o.write(c,n,d,l,u);const f=s.getRenewalPolicyForType(c);f!==Bd.RenewalPolicy.WriteOnly&&f!==Bd.RenewalPolicy.AccessAndWrite||(o.renewEntity(n,t),o.renewEntity(n,d)),s.runWritePolicy(c,{parent:{id:n,fieldName:i,storeFieldName:t,ref:(0,Ld.makeReference)(n),variables:l,args:u}})}});else if(n){const e=null===(t=o.readEntityById((0,Ud.makeEntityId)(n)))||void 0===t?void 0:t.typename;if(e){const t=s.getRenewalPolicyForType(e);t!==Bd.RenewalPolicy.WriteOnly&&t!==Bd.RenewalPolicy.AccessAndWrite||o.renewEntity(n),s.runWritePolicy(e,{parent:{id:n,ref:(0,Ld.makeReference)(n),variables:r}})}}}};var Qd=$&&$.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n},Yd=$&&$.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(pc,"__esModule",{value:!0});const qd=U,zd=Yd(dc),Wd=Yd(pu),Jd=Yd(Su),Kd=Yd(Fu),Xd=Yd(ku),Hd=Yd(Se),Zd=Yd(Wu),ef=Yd(Ju),tf=Nd,nf=rl,rf=jd,of=nl,af=Od,sf=uc;class cf extends qd.InMemoryCache{constructor(e={}){const{invalidationPolicies:t={},enableCollections:n=!1}=e;super(Qd(e,["invalidationPolicies","enableCollections"])),this.pendingCollectionUpdates={},this.enableCollections=n,this.invalidationPolicies=t,this.isBroadcasting=!1,this.isInitialized=!0,this.reactiveVarsCache=(0,sf.initReactiveVarsCache)(this),this.reinitialize()}reinitialize(){this.entityStoreRoot=this.data,this.entityTypeMap=new tf.EntityTypeMap,this.entityStoreWatcher=new tf.EntityStoreWatcher({entityStore:this.entityStoreRoot,entityTypeMap:this.entityTypeMap,policies:this.policies,reactiveVarsCache:this.reactiveVarsCache,updateCollectionField:this.updateCollectionField.bind(this)}),this.invalidationPolicyManager=new ef.default({policies:this.invalidationPolicies,entityTypeMap:this.entityTypeMap,cacheOperations:{evict:(...e)=>this.evict(...e),modify:(...e)=>this.modify(...e),readField:(...e)=>this.readField(...e)}}),this.cacheResultProcessor=new rf.CacheResultProcessor({invalidationPolicyManager:this.invalidationPolicyManager,entityTypeMap:this.entityTypeMap,cache:this}),this.reactiveVarsCache.reset()}init(){super.init(),this.isInitialized&&this.reinitialize()}readField(e,t){if(!e)return;const n="string"==typeof e?{fieldName:e,from:t}:e;return void 0===n.from&&(n.from={__ref:"ROOT_QUERY"}),this.policies.readField(n,{store:this.entityStoreRoot})}broadcastWatches(e){this.isBroadcasting=!0,super.broadcastWatches(e),this.isBroadcasting=!1}get _hasPendingCollectionUpdates(){return Object.keys(this.pendingCollectionUpdates).length>0}isOperatingOnRootData(){return this.data===this.entityStoreRoot}modify(e){var t;const n=super.modify(e);if(!this.invalidationPolicyManager.isPolicyEventActive(of.InvalidationPolicyEvent.Write)||!n)return n;const{id:r="ROOT_QUERY",fields:i}=e;if((0,nf.isQuery)(r))Object.keys(i).forEach(e=>{var t;const n=(0,nf.fieldNameFromStoreName)(e),i=null===(t=this.entityTypeMap.readEntityById((0,nf.makeEntityId)(r,n)))||void 0===t?void 0:t.typename;i&&this.invalidationPolicyManager.runWritePolicy(i,{parent:{id:r,fieldName:n,storeFieldName:e,ref:(0,qd.makeReference)(r)}})});else{const e=null===(t=this.entityTypeMap.readEntityById(r))||void 0===t?void 0:t.typename;if(!e)return n;this.invalidationPolicyManager.runWritePolicy(e,{parent:{id:r,ref:(0,qd.makeReference)(r)}})}return e.broadcast&&this.broadcastWatches(),n}write(e){const t=super.write(e);return(this.invalidationPolicyManager.isPolicyEventActive(of.InvalidationPolicyEvent.Write)||this.invalidationPolicyManager.isPolicyEventActive(of.InvalidationPolicyEvent.Read))&&this.isOperatingOnRootData()?(this.cacheResultProcessor.processWriteResult(e),e.broadcast&&this.broadcastWatches(),t):t}evictWhere(e){const{__typename:t,filter:n}=e,r=this.readReferenceWhere({__typename:t,filter:n});return r.forEach(e=>this.evict({id:e.__ref,broadcast:!1})),this.broadcastWatches(),r}evict(e){var t;const{fieldName:n,args:r}=e;let{id:i}=e;if(!i){if(Object.prototype.hasOwnProperty.call(e,"id"))return!1;i="ROOT_QUERY"}if(this.invalidationPolicyManager.isPolicyEventActive(of.InvalidationPolicyEvent.Evict)){const{typename:e}=null!==(t=this.entityTypeMap.readEntityById((0,nf.makeEntityId)(i,n)))&&void 0!==t?t:{};if(e){const t=(0,nf.isQuery)(i)&&n?this.policies.getStoreFieldName({typename:e,fieldName:n,args:r}):void 0;this.invalidationPolicyManager.runEvictPolicy(e,{parent:{id:i,fieldName:n,storeFieldName:t,variables:r,ref:(0,qd.makeReference)(i)}})}}return super.evict(e)}_updatePendingCollection(e){const t=this.pendingCollectionUpdates[e];t&&(this.modify({broadcast:!1,id:e,fields:{data:(e,{canRead:n})=>{let r=!1;const i=e.reduce((e,t)=>{const{__ref:n}=t;return!r&&e[n]&&(r=!0),e[n]=t,e},{}),o=Object.values(t).filter(e=>!i[e.__ref]&&n(e));return r||0!==o.length?[...Object.values(i),...o]:e}}}),delete this.pendingCollectionUpdates[e])}_updatePendingCollections(){this._hasPendingCollectionUpdates&&(Object.keys(this.pendingCollectionUpdates).forEach(e=>{this._updatePendingCollection(e)}),this.broadcastWatches())}updateCollectionField(e,t){if(!this.enableCollections)return;const n=(0,af.collectionEntityIdForType)(e);!!this.readField("id",(0,qd.makeReference)(n))||this.writeFragment({id:n,fragment:qd.gql`
          fragment InitializeCollectionEntity on CacheExtensionsCollectionEntity {
            data
            id
          }
        `,data:{__typename:af.cacheExtensionsCollectionTypename,id:e,data:[]}}),this.entityTypeMap.readEntityById(t)||(this._hasPendingCollectionUpdates||setTimeout(()=>this._updatePendingCollections(),0),this.pendingCollectionUpdates[n]||(this.pendingCollectionUpdates[n]={}),this.pendingCollectionUpdates[n][t]||(this.pendingCollectionUpdates[n][t]=(0,qd.makeReference)(t)))}_expire(e=!1){const{entitiesById:t}=this.entityTypeMap.extract(),n=[];return Object.keys(t).forEach(r=>{const i=t[r],{storeFieldNames:o,dataId:a,fieldName:s,typename:c}=i;if((0,nf.isQuery)(a)&&o)Object.keys(o.entries).forEach(t=>{this.invalidationPolicyManager.runReadPolicy({typename:c,dataId:a,fieldName:s,storeFieldName:t,reportOnly:e})&&n.push((0,nf.makeEntityId)(a,t))});else{this.invalidationPolicyManager.runReadPolicy({typename:c,dataId:a,fieldName:s,reportOnly:e})&&n.push((0,nf.makeEntityId)(a))}}),n.length>0&&this.broadcastWatches(),n}expire(){return this._expire(!1)}expiredEntities(){return this._expire(!0)}activatePolicyEvents(...e){e.length>0?this.invalidationPolicyManager.activatePolicies(...e):this.invalidationPolicyManager.activatePolicies(of.InvalidationPolicyEvent.Read,of.InvalidationPolicyEvent.Write,of.InvalidationPolicyEvent.Evict)}deactivatePolicyEvents(...e){e.length>0?this.invalidationPolicyManager.deactivatePolicies(...e):this.invalidationPolicyManager.deactivatePolicies(of.InvalidationPolicyEvent.Read,of.InvalidationPolicyEvent.Write,of.InvalidationPolicyEvent.Evict)}activePolicyEvents(){return[of.InvalidationPolicyEvent.Read,of.InvalidationPolicyEvent.Write,of.InvalidationPolicyEvent.Evict].filter(e=>this.invalidationPolicyManager.isPolicyEventActive(e))}read(e){const t=super.read(e);if(!this.invalidationPolicyManager.isPolicyEventActive(of.InvalidationPolicyEvent.Read))return t;const n=(0,nf.maybeDeepClone)(t),r=this.cacheResultProcessor.processReadResult(n,e);return r===rf.ReadResultStatus.Complete?t:(this.broadcastWatches(),r===rf.ReadResultStatus.Evicted?null:n)}diff(e){const t=super.diff(e);if(!this.invalidationPolicyManager.isPolicyEventActive(of.InvalidationPolicyEvent.Read)||this.isBroadcasting)return t;const{result:n}=t,r=(0,nf.maybeDeepClone)(n),i=this.cacheResultProcessor.processReadResult(r,e);return i===rf.ReadResultStatus.Complete||(this.broadcastWatches(),t.complete=!1,t.result=i===rf.ReadResultStatus.Evicted?void 0:r),t}extract(e=!1,t=!0){this._hasPendingCollectionUpdates&&this._updatePendingCollections();const n=super.extract(e);return t&&(n.invalidation=(0,Jd.default)(this.entityTypeMap.extract(),"entitiesById")),n}readFragmentWhere(e){const{fragment:t,filter:n,limit:r,orderBy:i}=e,o=Qd(e,["fragment","filter","limit","orderBy"]),a=t.definitions[0].typeCondition.name.value,s=this.readReferenceWhere({__typename:a,filter:n,limit:r,orderBy:i}).map(e=>this.readFragment(Object.assign(Object.assign({},o),{fragment:t,id:e.__ref})));return(0,zd.default)(s)}readReferenceWhere(e){const{__typename:t,filter:n,limit:r,orderBy:i}=e,o=(0,af.collectionEntityIdForType)(t);this.pendingCollectionUpdates[o]&&this._updatePendingCollection(o);let a=this.readField("data",(0,qd.makeReference)(o));if(!a)return[];const s=this.readField.bind(this);if(n&&(a=a.filter(e=>{if((0,Hd.default)(n))return n(e,s);const t=Object.keys(n).map(t=>n[t]===this.readField(t,e));return(0,Wd.default)(t,Boolean)})),i){const{field:e,descending:t}=i;a=(0,Zd.default)(a,t=>s(e,t),[t?"desc":"asc"])}return(0,Xd.default)(r)?a:(0,Kd.default)(a,r)}writeFragmentWhere(e){const{update:t}=e,n=Qd(e,["update"]);this.readFragmentWhere(n).forEach(n=>{this.writeFragment({id:this.identify(n),fragment:e.fragment,data:t(n),broadcast:!1})}),this.broadcastWatches()}}pc.default=cf,function(e){var t=$&&$.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.InvalidationPolicyCache=e.makeCachedVar=void 0;var n=uc;Object.defineProperty(e,"makeCachedVar",{enumerable:!0,get:function(){return n.makeCachedVar}});var r=pc;Object.defineProperty(e,"InvalidationPolicyCache",{enumerable:!0,get:function(){return t(r).default}})}(cc);var uf={},lf={},pf={};const df=Object.freeze({major:16,minor:11,patch:0,preReleaseTag:null});function ff(e,t){if(!Boolean(e))throw new Error(t)}function hf(e){return"function"==typeof(null==e?void 0:e.then)}function yf(e){return"object"==typeof e&&null!==e}function vf(e,t){if(!Boolean(e))throw new Error(null!=t?t:"Unexpected invariant triggered.")}const mf=/\r\n|[\n\r]/g;function gf(e,t){let n=0,r=1;for(const i of e.body.matchAll(mf)){if("number"==typeof i.index||vf(!1),i.index>=t)break;n=i.index+i[0].length,r+=1}return{line:r,column:t+1-n}}function Ef(e){return Tf(e.source,gf(e.source,e.start))}function Tf(e,t){const n=e.locationOffset.column-1,r="".padStart(n)+e.body,i=t.line-1,o=e.locationOffset.line-1,a=t.line+o,s=1===t.line?n:0,c=t.column+s,u=`${e.name}:${a}:${c}\n`,l=r.split(/\r\n|[\n\r]/g),p=l[i];if(p.length>120){const e=Math.floor(c/80),t=c%80,n=[];for(let e=0;e<p.length;e+=80)n.push(p.slice(e,e+80));return u+bf([[`${a} |`,n[0]],...n.slice(1,e+1).map(e=>["|",e]),["|","^".padStart(t)],["|",n[e+1]]])}return u+bf([[a-1+" |",l[i-1]],[`${a} |`,p],["|","^".padStart(c)],[`${a+1} |`,l[i+1]]])}function bf(e){const t=e.filter(([e,t])=>void 0!==t),n=Math.max(...t.map(([e])=>e.length));return t.map(([e,t])=>e.padStart(n)+(t?" "+t:"")).join("\n")}class _f extends Error{constructor(e,...t){var n,r,i;const{nodes:o,source:a,positions:s,path:c,originalError:u,extensions:l}=function(e){const t=e[0];return null==t||"kind"in t||"length"in t?{nodes:t,source:e[1],positions:e[2],path:e[3],originalError:e[4],extensions:e[5]}:t}(t);super(e),this.name="GraphQLError",this.path=null!=c?c:void 0,this.originalError=null!=u?u:void 0,this.nodes=Nf(Array.isArray(o)?o:o?[o]:void 0);const p=Nf(null===(n=this.nodes)||void 0===n?void 0:n.map(e=>e.loc).filter(e=>null!=e));this.source=null!=a?a:null==p||null===(r=p[0])||void 0===r?void 0:r.source,this.positions=null!=s?s:null==p?void 0:p.map(e=>e.start),this.locations=s&&a?s.map(e=>gf(a,e)):null==p?void 0:p.map(e=>gf(e.source,e.start));const d=yf(null==u?void 0:u.extensions)?null==u?void 0:u.extensions:void 0;this.extensions=null!==(i=null!=l?l:d)&&void 0!==i?i:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),null!=u&&u.stack?Object.defineProperty(this,"stack",{value:u.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,_f):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let e=this.message;if(this.nodes)for(const t of this.nodes)t.loc&&(e+="\n\n"+Ef(t.loc));else if(this.source&&this.locations)for(const t of this.locations)e+="\n\n"+Tf(this.source,t);return e}toJSON(){const e={message:this.message};return null!=this.locations&&(e.locations=this.locations),null!=this.path&&(e.path=this.path),null!=this.extensions&&Object.keys(this.extensions).length>0&&(e.extensions=this.extensions),e}}function Nf(e){return void 0===e||0===e.length?void 0:e}function If(e,t,n){return new _f(`Syntax Error: ${n}`,{source:e,positions:[t]})}class Of{constructor(e,t,n){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=n}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}}class wf{constructor(e,t,n,r,i,o){this.kind=e,this.start=t,this.end=n,this.line=r,this.column=i,this.value=o,this.prev=null,this.next=null}get[Symbol.toStringTag](){return"Token"}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}}const Af={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]},Sf=new Set(Object.keys(Af));function Df(e){const t=null==e?void 0:e.kind;return"string"==typeof t&&Sf.has(t)}var Rf,Ff,kf,xf;function jf(e){return 9===e||32===e}function Cf(e){return e>=48&&e<=57}function Pf(e){return e>=97&&e<=122||e>=65&&e<=90}function Lf(e){return Pf(e)||95===e}function $f(e){return Pf(e)||Cf(e)||95===e}function Mf(e){var t;let n=Number.MAX_SAFE_INTEGER,r=null,i=-1;for(let t=0;t<e.length;++t){var o;const a=e[t],s=Vf(a);s!==a.length&&(r=null!==(o=r)&&void 0!==o?o:t,i=t,0!==t&&s<n&&(n=s))}return e.map((e,t)=>0===t?e:e.slice(n)).slice(null!==(t=r)&&void 0!==t?t:0,i+1)}function Vf(e){let t=0;for(;t<e.length&&jf(e.charCodeAt(t));)++t;return t}function Uf(e){if(""===e)return!0;let t=!0,n=!1,r=!0,i=!1;for(let o=0;o<e.length;++o)switch(e.codePointAt(o)){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 11:case 12:case 14:case 15:case 13:return!1;case 10:if(t&&!i)return!1;i=!0,t=!0,n=!1;break;case 9:case 32:n||(n=t);break;default:r&&(r=n),t=!1}return!t&&(!r||!i)}function Bf(e,t){const n=e.replace(/"""/g,'\\"""'),r=n.split(/\r\n|[\n\r]/g),i=1===r.length,o=r.length>1&&r.slice(1).every(e=>0===e.length||jf(e.charCodeAt(0))),a=n.endsWith('\\"""'),s=e.endsWith('"')&&!a,c=e.endsWith("\\"),u=s||c,l=!(null!=t&&t.minimize)&&(!i||e.length>70||u||o||a);let p="";const d=i&&jf(e.charCodeAt(0));return(l&&!d||o)&&(p+="\n"),p+=n,(l||u)&&(p+="\n"),'"""'+p+'"""'}!function(e){e.QUERY="query",e.MUTATION="mutation",e.SUBSCRIPTION="subscription"}(Rf||(Rf={})),function(e){e.QUERY="QUERY",e.MUTATION="MUTATION",e.SUBSCRIPTION="SUBSCRIPTION",e.FIELD="FIELD",e.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",e.FRAGMENT_SPREAD="FRAGMENT_SPREAD",e.INLINE_FRAGMENT="INLINE_FRAGMENT",e.VARIABLE_DEFINITION="VARIABLE_DEFINITION",e.SCHEMA="SCHEMA",e.SCALAR="SCALAR",e.OBJECT="OBJECT",e.FIELD_DEFINITION="FIELD_DEFINITION",e.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",e.INTERFACE="INTERFACE",e.UNION="UNION",e.ENUM="ENUM",e.ENUM_VALUE="ENUM_VALUE",e.INPUT_OBJECT="INPUT_OBJECT",e.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION"}(Ff||(Ff={})),function(e){e.NAME="Name",e.DOCUMENT="Document",e.OPERATION_DEFINITION="OperationDefinition",e.VARIABLE_DEFINITION="VariableDefinition",e.SELECTION_SET="SelectionSet",e.FIELD="Field",e.ARGUMENT="Argument",e.FRAGMENT_SPREAD="FragmentSpread",e.INLINE_FRAGMENT="InlineFragment",e.FRAGMENT_DEFINITION="FragmentDefinition",e.VARIABLE="Variable",e.INT="IntValue",e.FLOAT="FloatValue",e.STRING="StringValue",e.BOOLEAN="BooleanValue",e.NULL="NullValue",e.ENUM="EnumValue",e.LIST="ListValue",e.OBJECT="ObjectValue",e.OBJECT_FIELD="ObjectField",e.DIRECTIVE="Directive",e.NAMED_TYPE="NamedType",e.LIST_TYPE="ListType",e.NON_NULL_TYPE="NonNullType",e.SCHEMA_DEFINITION="SchemaDefinition",e.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",e.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",e.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",e.FIELD_DEFINITION="FieldDefinition",e.INPUT_VALUE_DEFINITION="InputValueDefinition",e.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",e.UNION_TYPE_DEFINITION="UnionTypeDefinition",e.ENUM_TYPE_DEFINITION="EnumTypeDefinition",e.ENUM_VALUE_DEFINITION="EnumValueDefinition",e.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",e.DIRECTIVE_DEFINITION="DirectiveDefinition",e.SCHEMA_EXTENSION="SchemaExtension",e.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",e.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",e.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",e.UNION_TYPE_EXTENSION="UnionTypeExtension",e.ENUM_TYPE_EXTENSION="EnumTypeExtension",e.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension"}(kf||(kf={})),function(e){e.SOF="<SOF>",e.EOF="<EOF>",e.BANG="!",e.DOLLAR="$",e.AMP="&",e.PAREN_L="(",e.PAREN_R=")",e.SPREAD="...",e.COLON=":",e.EQUALS="=",e.AT="@",e.BRACKET_L="[",e.BRACKET_R="]",e.BRACE_L="{",e.PIPE="|",e.BRACE_R="}",e.NAME="Name",e.INT="Int",e.FLOAT="Float",e.STRING="String",e.BLOCK_STRING="BlockString",e.COMMENT="Comment"}(xf||(xf={}));class Gf{constructor(e){const t=new wf(xf.SOF,0,0,0,0);this.source=e,this.lastToken=t,this.token=t,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){this.lastToken=this.token;return this.token=this.lookahead()}lookahead(){let e=this.token;if(e.kind!==xf.EOF)do{if(e.next)e=e.next;else{const t=Xf(this,e.end);e.next=t,t.prev=e,e=t}}while(e.kind===xf.COMMENT);return e}}function Qf(e){return e===xf.BANG||e===xf.DOLLAR||e===xf.AMP||e===xf.PAREN_L||e===xf.PAREN_R||e===xf.SPREAD||e===xf.COLON||e===xf.EQUALS||e===xf.AT||e===xf.BRACKET_L||e===xf.BRACKET_R||e===xf.BRACE_L||e===xf.PIPE||e===xf.BRACE_R}function Yf(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function qf(e,t){return zf(e.charCodeAt(t))&&Wf(e.charCodeAt(t+1))}function zf(e){return e>=55296&&e<=56319}function Wf(e){return e>=56320&&e<=57343}function Jf(e,t){const n=e.source.body.codePointAt(t);if(void 0===n)return xf.EOF;if(n>=32&&n<=126){const e=String.fromCodePoint(n);return'"'===e?"'\"'":`"${e}"`}return"U+"+n.toString(16).toUpperCase().padStart(4,"0")}function Kf(e,t,n,r,i){const o=e.line,a=1+n-e.lineStart;return new wf(t,n,r,o,a,i)}function Xf(e,t){const n=e.source.body,r=n.length;let i=t;for(;i<r;){const t=n.charCodeAt(i);switch(t){case 65279:case 9:case 32:case 44:++i;continue;case 10:++i,++e.line,e.lineStart=i;continue;case 13:10===n.charCodeAt(i+1)?i+=2:++i,++e.line,e.lineStart=i;continue;case 35:return Hf(e,i);case 33:return Kf(e,xf.BANG,i,i+1);case 36:return Kf(e,xf.DOLLAR,i,i+1);case 38:return Kf(e,xf.AMP,i,i+1);case 40:return Kf(e,xf.PAREN_L,i,i+1);case 41:return Kf(e,xf.PAREN_R,i,i+1);case 46:if(46===n.charCodeAt(i+1)&&46===n.charCodeAt(i+2))return Kf(e,xf.SPREAD,i,i+3);break;case 58:return Kf(e,xf.COLON,i,i+1);case 61:return Kf(e,xf.EQUALS,i,i+1);case 64:return Kf(e,xf.AT,i,i+1);case 91:return Kf(e,xf.BRACKET_L,i,i+1);case 93:return Kf(e,xf.BRACKET_R,i,i+1);case 123:return Kf(e,xf.BRACE_L,i,i+1);case 124:return Kf(e,xf.PIPE,i,i+1);case 125:return Kf(e,xf.BRACE_R,i,i+1);case 34:return 34===n.charCodeAt(i+1)&&34===n.charCodeAt(i+2)?sh(e,i):th(e,i)}if(Cf(t)||45===t)return Zf(e,i,t);if(Lf(t))return ch(e,i);throw If(e.source,i,39===t?"Unexpected single quote character ('), did you mean to use a double quote (\")?":Yf(t)||qf(n,i)?`Unexpected character: ${Jf(e,i)}.`:`Invalid character: ${Jf(e,i)}.`)}return Kf(e,xf.EOF,r,r)}function Hf(e,t){const n=e.source.body,r=n.length;let i=t+1;for(;i<r;){const e=n.charCodeAt(i);if(10===e||13===e)break;if(Yf(e))++i;else{if(!qf(n,i))break;i+=2}}return Kf(e,xf.COMMENT,t,i,n.slice(t+1,i))}function Zf(e,t,n){const r=e.source.body;let i=t,o=n,a=!1;if(45===o&&(o=r.charCodeAt(++i)),48===o){if(o=r.charCodeAt(++i),Cf(o))throw If(e.source,i,`Invalid number, unexpected digit after 0: ${Jf(e,i)}.`)}else i=eh(e,i,o),o=r.charCodeAt(i);if(46===o&&(a=!0,o=r.charCodeAt(++i),i=eh(e,i,o),o=r.charCodeAt(i)),69!==o&&101!==o||(a=!0,o=r.charCodeAt(++i),43!==o&&45!==o||(o=r.charCodeAt(++i)),i=eh(e,i,o),o=r.charCodeAt(i)),46===o||Lf(o))throw If(e.source,i,`Invalid number, expected digit but got: ${Jf(e,i)}.`);return Kf(e,a?xf.FLOAT:xf.INT,t,i,r.slice(t,i))}function eh(e,t,n){if(!Cf(n))throw If(e.source,t,`Invalid number, expected digit but got: ${Jf(e,t)}.`);const r=e.source.body;let i=t+1;for(;Cf(r.charCodeAt(i));)++i;return i}function th(e,t){const n=e.source.body,r=n.length;let i=t+1,o=i,a="";for(;i<r;){const r=n.charCodeAt(i);if(34===r)return a+=n.slice(o,i),Kf(e,xf.STRING,t,i+1,a);if(92===r){a+=n.slice(o,i);const t=117===n.charCodeAt(i+1)?123===n.charCodeAt(i+2)?nh(e,i):rh(e,i):ah(e,i);a+=t.value,i+=t.size,o=i;continue}if(10===r||13===r)break;if(Yf(r))++i;else{if(!qf(n,i))throw If(e.source,i,`Invalid character within String: ${Jf(e,i)}.`);i+=2}}throw If(e.source,i,"Unterminated string.")}function nh(e,t){const n=e.source.body;let r=0,i=3;for(;i<12;){const e=n.charCodeAt(t+i++);if(125===e){if(i<5||!Yf(r))break;return{value:String.fromCodePoint(r),size:i}}if(r=r<<4|oh(e),r<0)break}throw If(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+i)}".`)}function rh(e,t){const n=e.source.body,r=ih(n,t+2);if(Yf(r))return{value:String.fromCodePoint(r),size:6};if(zf(r)&&92===n.charCodeAt(t+6)&&117===n.charCodeAt(t+7)){const e=ih(n,t+8);if(Wf(e))return{value:String.fromCodePoint(r,e),size:12}}throw If(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+6)}".`)}function ih(e,t){return oh(e.charCodeAt(t))<<12|oh(e.charCodeAt(t+1))<<8|oh(e.charCodeAt(t+2))<<4|oh(e.charCodeAt(t+3))}function oh(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function ah(e,t){const n=e.source.body;switch(n.charCodeAt(t+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:"\n",size:2};case 114:return{value:"\r",size:2};case 116:return{value:"\t",size:2}}throw If(e.source,t,`Invalid character escape sequence: "${n.slice(t,t+2)}".`)}function sh(e,t){const n=e.source.body,r=n.length;let i=e.lineStart,o=t+3,a=o,s="";const c=[];for(;o<r;){const r=n.charCodeAt(o);if(34===r&&34===n.charCodeAt(o+1)&&34===n.charCodeAt(o+2)){s+=n.slice(a,o),c.push(s);const r=Kf(e,xf.BLOCK_STRING,t,o+3,Mf(c).join("\n"));return e.line+=c.length-1,e.lineStart=i,r}if(92!==r||34!==n.charCodeAt(o+1)||34!==n.charCodeAt(o+2)||34!==n.charCodeAt(o+3))if(10!==r&&13!==r)if(Yf(r))++o;else{if(!qf(n,o))throw If(e.source,o,`Invalid character within String: ${Jf(e,o)}.`);o+=2}else s+=n.slice(a,o),c.push(s),13===r&&10===n.charCodeAt(o+1)?o+=2:++o,s="",a=o,i=o;else s+=n.slice(a,o),a=o+1,o+=4}throw If(e.source,o,"Unterminated string.")}function ch(e,t){const n=e.source.body,r=n.length;let i=t+1;for(;i<r;){if(!$f(n.charCodeAt(i)))break;++i}return Kf(e,xf.NAME,t,i,n.slice(t,i))}function uh(e){return lh(e,[])}function lh(e,t){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return function(e,t){if(null===e)return"null";if(t.includes(e))return"[Circular]";const n=[...t,e];if(function(e){return"function"==typeof e.toJSON}(e)){const t=e.toJSON();if(t!==e)return"string"==typeof t?t:lh(t,n)}else if(Array.isArray(e))return function(e,t){if(0===e.length)return"[]";if(t.length>2)return"[Array]";const n=Math.min(10,e.length),r=e.length-n,i=[];for(let r=0;r<n;++r)i.push(lh(e[r],t));1===r?i.push("... 1 more item"):r>1&&i.push(`... ${r} more items`);return"["+i.join(", ")+"]"}(e,n);return function(e,t){const n=Object.entries(e);if(0===n.length)return"{}";if(t.length>2)return"["+function(e){const t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){const t=e.constructor.name;if("string"==typeof t&&""!==t)return t}return t}(e)+"]";const r=n.map(([e,n])=>e+": "+lh(n,t));return"{ "+r.join(", ")+" }"}(e,n)}(e,t);default:return String(e)}}const ph=globalThis.process&&"production"===process.env.NODE_ENV?function(e,t){return e instanceof t}:function(e,t){if(e instanceof t)return!0;if("object"==typeof e&&null!==e){var n;const r=t.prototype[Symbol.toStringTag];if(r===(Symbol.toStringTag in e?e[Symbol.toStringTag]:null===(n=e.constructor)||void 0===n?void 0:n.name)){const t=uh(e);throw new Error(`Cannot use ${r} "${t}" from another module or realm.\n\nEnsure that there is only one instance of "graphql" in the node_modules\ndirectory. If different versions of "graphql" are the dependencies of other\nrelied on modules, use "resolutions" to ensure only one version is installed.\n\nhttps://yarnpkg.com/en/docs/selective-version-resolutions\n\nDuplicate "graphql" modules cannot be used at the same time since different\nversions may have different capabilities and behavior. The data from one\nversion used in the function from another could produce confusing and\nspurious results.`)}}return!1};class dh{constructor(e,t="GraphQL request",n={line:1,column:1}){"string"==typeof e||ff(!1,`Body must be a string. Received: ${uh(e)}.`),this.body=e,this.name=t,this.locationOffset=n,this.locationOffset.line>0||ff(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||ff(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}function fh(e){return ph(e,dh)}function hh(e,t){const n=new vh(e,t),r=n.parseDocument();return Object.defineProperty(r,"tokenCount",{enumerable:!1,value:n.tokenCount}),r}function yh(e,t){const n=new vh(e,t);n.expectToken(xf.SOF);const r=n.parseValueLiteral(!1);return n.expectToken(xf.EOF),r}class vh{constructor(e,t={}){const n=fh(e)?e:new dh(e);this._lexer=new Gf(n),this._options=t,this._tokenCounter=0}get tokenCount(){return this._tokenCounter}parseName(){const e=this.expectToken(xf.NAME);return this.node(e,{kind:kf.NAME,value:e.value})}parseDocument(){return this.node(this._lexer.token,{kind:kf.DOCUMENT,definitions:this.many(xf.SOF,this.parseDefinition,xf.EOF)})}parseDefinition(){if(this.peek(xf.BRACE_L))return this.parseOperationDefinition();const e=this.peekDescription(),t=e?this._lexer.lookahead():this._lexer.token;if(t.kind===xf.NAME){switch(t.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}if(e)throw If(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(t.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(t)}parseOperationDefinition(){const e=this._lexer.token;if(this.peek(xf.BRACE_L))return this.node(e,{kind:kf.OPERATION_DEFINITION,operation:Rf.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});const t=this.parseOperationType();let n;return this.peek(xf.NAME)&&(n=this.parseName()),this.node(e,{kind:kf.OPERATION_DEFINITION,operation:t,name:n,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const e=this.expectToken(xf.NAME);switch(e.value){case"query":return Rf.QUERY;case"mutation":return Rf.MUTATION;case"subscription":return Rf.SUBSCRIPTION}throw this.unexpected(e)}parseVariableDefinitions(){return this.optionalMany(xf.PAREN_L,this.parseVariableDefinition,xf.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:kf.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(xf.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(xf.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const e=this._lexer.token;return this.expectToken(xf.DOLLAR),this.node(e,{kind:kf.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:kf.SELECTION_SET,selections:this.many(xf.BRACE_L,this.parseSelection,xf.BRACE_R)})}parseSelection(){return this.peek(xf.SPREAD)?this.parseFragment():this.parseField()}parseField(){const e=this._lexer.token,t=this.parseName();let n,r;return this.expectOptionalToken(xf.COLON)?(n=t,r=this.parseName()):r=t,this.node(e,{kind:kf.FIELD,alias:n,name:r,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(xf.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(e){const t=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(xf.PAREN_L,t,xf.PAREN_R)}parseArgument(e=!1){const t=this._lexer.token,n=this.parseName();return this.expectToken(xf.COLON),this.node(t,{kind:kf.ARGUMENT,name:n,value:this.parseValueLiteral(e)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){const e=this._lexer.token;this.expectToken(xf.SPREAD);const t=this.expectOptionalKeyword("on");return!t&&this.peek(xf.NAME)?this.node(e,{kind:kf.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(e,{kind:kf.INLINE_FRAGMENT,typeCondition:t?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){const e=this._lexer.token;return this.expectKeyword("fragment"),!0===this._options.allowLegacyFragmentVariables?this.node(e,{kind:kf.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(e,{kind:kf.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if("on"===this._lexer.token.value)throw this.unexpected();return this.parseName()}parseValueLiteral(e){const t=this._lexer.token;switch(t.kind){case xf.BRACKET_L:return this.parseList(e);case xf.BRACE_L:return this.parseObject(e);case xf.INT:return this.advanceLexer(),this.node(t,{kind:kf.INT,value:t.value});case xf.FLOAT:return this.advanceLexer(),this.node(t,{kind:kf.FLOAT,value:t.value});case xf.STRING:case xf.BLOCK_STRING:return this.parseStringLiteral();case xf.NAME:switch(this.advanceLexer(),t.value){case"true":return this.node(t,{kind:kf.BOOLEAN,value:!0});case"false":return this.node(t,{kind:kf.BOOLEAN,value:!1});case"null":return this.node(t,{kind:kf.NULL});default:return this.node(t,{kind:kf.ENUM,value:t.value})}case xf.DOLLAR:if(e){if(this.expectToken(xf.DOLLAR),this._lexer.token.kind===xf.NAME){const e=this._lexer.token.value;throw If(this._lexer.source,t.start,`Unexpected variable "$${e}" in constant value.`)}throw this.unexpected(t)}return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){const e=this._lexer.token;return this.advanceLexer(),this.node(e,{kind:kf.STRING,value:e.value,block:e.kind===xf.BLOCK_STRING})}parseList(e){return this.node(this._lexer.token,{kind:kf.LIST,values:this.any(xf.BRACKET_L,()=>this.parseValueLiteral(e),xf.BRACKET_R)})}parseObject(e){return this.node(this._lexer.token,{kind:kf.OBJECT,fields:this.any(xf.BRACE_L,()=>this.parseObjectField(e),xf.BRACE_R)})}parseObjectField(e){const t=this._lexer.token,n=this.parseName();return this.expectToken(xf.COLON),this.node(t,{kind:kf.OBJECT_FIELD,name:n,value:this.parseValueLiteral(e)})}parseDirectives(e){const t=[];for(;this.peek(xf.AT);)t.push(this.parseDirective(e));return t}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(e){const t=this._lexer.token;return this.expectToken(xf.AT),this.node(t,{kind:kf.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e)})}parseTypeReference(){const e=this._lexer.token;let t;if(this.expectOptionalToken(xf.BRACKET_L)){const n=this.parseTypeReference();this.expectToken(xf.BRACKET_R),t=this.node(e,{kind:kf.LIST_TYPE,type:n})}else t=this.parseNamedType();return this.expectOptionalToken(xf.BANG)?this.node(e,{kind:kf.NON_NULL_TYPE,type:t}):t}parseNamedType(){return this.node(this._lexer.token,{kind:kf.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(xf.STRING)||this.peek(xf.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("schema");const n=this.parseConstDirectives(),r=this.many(xf.BRACE_L,this.parseOperationTypeDefinition,xf.BRACE_R);return this.node(e,{kind:kf.SCHEMA_DEFINITION,description:t,directives:n,operationTypes:r})}parseOperationTypeDefinition(){const e=this._lexer.token,t=this.parseOperationType();this.expectToken(xf.COLON);const n=this.parseNamedType();return this.node(e,{kind:kf.OPERATION_TYPE_DEFINITION,operation:t,type:n})}parseScalarTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("scalar");const n=this.parseName(),r=this.parseConstDirectives();return this.node(e,{kind:kf.SCALAR_TYPE_DEFINITION,description:t,name:n,directives:r})}parseObjectTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("type");const n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(e,{kind:kf.OBJECT_TYPE_DEFINITION,description:t,name:n,interfaces:r,directives:i,fields:o})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(xf.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(xf.BRACE_L,this.parseFieldDefinition,xf.BRACE_R)}parseFieldDefinition(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseName(),r=this.parseArgumentDefs();this.expectToken(xf.COLON);const i=this.parseTypeReference(),o=this.parseConstDirectives();return this.node(e,{kind:kf.FIELD_DEFINITION,description:t,name:n,arguments:r,type:i,directives:o})}parseArgumentDefs(){return this.optionalMany(xf.PAREN_L,this.parseInputValueDef,xf.PAREN_R)}parseInputValueDef(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseName();this.expectToken(xf.COLON);const r=this.parseTypeReference();let i;this.expectOptionalToken(xf.EQUALS)&&(i=this.parseConstValueLiteral());const o=this.parseConstDirectives();return this.node(e,{kind:kf.INPUT_VALUE_DEFINITION,description:t,name:n,type:r,defaultValue:i,directives:o})}parseInterfaceTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("interface");const n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(e,{kind:kf.INTERFACE_TYPE_DEFINITION,description:t,name:n,interfaces:r,directives:i,fields:o})}parseUnionTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("union");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseUnionMemberTypes();return this.node(e,{kind:kf.UNION_TYPE_DEFINITION,description:t,name:n,directives:r,types:i})}parseUnionMemberTypes(){return this.expectOptionalToken(xf.EQUALS)?this.delimitedMany(xf.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("enum");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseEnumValuesDefinition();return this.node(e,{kind:kf.ENUM_TYPE_DEFINITION,description:t,name:n,directives:r,values:i})}parseEnumValuesDefinition(){return this.optionalMany(xf.BRACE_L,this.parseEnumValueDefinition,xf.BRACE_R)}parseEnumValueDefinition(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseEnumValueName(),r=this.parseConstDirectives();return this.node(e,{kind:kf.ENUM_VALUE_DEFINITION,description:t,name:n,directives:r})}parseEnumValueName(){if("true"===this._lexer.token.value||"false"===this._lexer.token.value||"null"===this._lexer.token.value)throw If(this._lexer.source,this._lexer.token.start,`${mh(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("input");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseInputFieldsDefinition();return this.node(e,{kind:kf.INPUT_OBJECT_TYPE_DEFINITION,description:t,name:n,directives:r,fields:i})}parseInputFieldsDefinition(){return this.optionalMany(xf.BRACE_L,this.parseInputValueDef,xf.BRACE_R)}parseTypeSystemExtension(){const e=this._lexer.lookahead();if(e.kind===xf.NAME)switch(e.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(e)}parseSchemaExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");const t=this.parseConstDirectives(),n=this.optionalMany(xf.BRACE_L,this.parseOperationTypeDefinition,xf.BRACE_R);if(0===t.length&&0===n.length)throw this.unexpected();return this.node(e,{kind:kf.SCHEMA_EXTENSION,directives:t,operationTypes:n})}parseScalarTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");const t=this.parseName(),n=this.parseConstDirectives();if(0===n.length)throw this.unexpected();return this.node(e,{kind:kf.SCALAR_TYPE_EXTENSION,name:t,directives:n})}parseObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");const t=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),i=this.parseFieldsDefinition();if(0===n.length&&0===r.length&&0===i.length)throw this.unexpected();return this.node(e,{kind:kf.OBJECT_TYPE_EXTENSION,name:t,interfaces:n,directives:r,fields:i})}parseInterfaceTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const t=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),i=this.parseFieldsDefinition();if(0===n.length&&0===r.length&&0===i.length)throw this.unexpected();return this.node(e,{kind:kf.INTERFACE_TYPE_EXTENSION,name:t,interfaces:n,directives:r,fields:i})}parseUnionTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const t=this.parseName(),n=this.parseConstDirectives(),r=this.parseUnionMemberTypes();if(0===n.length&&0===r.length)throw this.unexpected();return this.node(e,{kind:kf.UNION_TYPE_EXTENSION,name:t,directives:n,types:r})}parseEnumTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const t=this.parseName(),n=this.parseConstDirectives(),r=this.parseEnumValuesDefinition();if(0===n.length&&0===r.length)throw this.unexpected();return this.node(e,{kind:kf.ENUM_TYPE_EXTENSION,name:t,directives:n,values:r})}parseInputObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const t=this.parseName(),n=this.parseConstDirectives(),r=this.parseInputFieldsDefinition();if(0===n.length&&0===r.length)throw this.unexpected();return this.node(e,{kind:kf.INPUT_OBJECT_TYPE_EXTENSION,name:t,directives:n,fields:r})}parseDirectiveDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("directive"),this.expectToken(xf.AT);const n=this.parseName(),r=this.parseArgumentDefs(),i=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const o=this.parseDirectiveLocations();return this.node(e,{kind:kf.DIRECTIVE_DEFINITION,description:t,name:n,arguments:r,repeatable:i,locations:o})}parseDirectiveLocations(){return this.delimitedMany(xf.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){const e=this._lexer.token,t=this.parseName();if(Object.prototype.hasOwnProperty.call(Ff,t.value))return t;throw this.unexpected(e)}node(e,t){return!0!==this._options.noLocation&&(t.loc=new Of(e,this._lexer.lastToken,this._lexer.source)),t}peek(e){return this._lexer.token.kind===e}expectToken(e){const t=this._lexer.token;if(t.kind===e)return this.advanceLexer(),t;throw If(this._lexer.source,t.start,`Expected ${gh(e)}, found ${mh(t)}.`)}expectOptionalToken(e){return this._lexer.token.kind===e&&(this.advanceLexer(),!0)}expectKeyword(e){const t=this._lexer.token;if(t.kind!==xf.NAME||t.value!==e)throw If(this._lexer.source,t.start,`Expected "${e}", found ${mh(t)}.`);this.advanceLexer()}expectOptionalKeyword(e){const t=this._lexer.token;return t.kind===xf.NAME&&t.value===e&&(this.advanceLexer(),!0)}unexpected(e){const t=null!=e?e:this._lexer.token;return If(this._lexer.source,t.start,`Unexpected ${mh(t)}.`)}any(e,t,n){this.expectToken(e);const r=[];for(;!this.expectOptionalToken(n);)r.push(t.call(this));return r}optionalMany(e,t,n){if(this.expectOptionalToken(e)){const e=[];do{e.push(t.call(this))}while(!this.expectOptionalToken(n));return e}return[]}many(e,t,n){this.expectToken(e);const r=[];do{r.push(t.call(this))}while(!this.expectOptionalToken(n));return r}delimitedMany(e,t){this.expectOptionalToken(e);const n=[];do{n.push(t.call(this))}while(this.expectOptionalToken(e));return n}advanceLexer(){const{maxTokens:e}=this._options,t=this._lexer.advance();if(t.kind!==xf.EOF&&(++this._tokenCounter,void 0!==e&&this._tokenCounter>e))throw If(this._lexer.source,t.start,`Document contains more that ${e} tokens. Parsing aborted.`)}}function mh(e){const t=e.value;return gh(e.kind)+(null!=t?` "${t}"`:"")}function gh(e){return Qf(e)?`"${e}"`:e}function Eh(e,t){const[n,r]=t?[e,t]:[void 0,e];let i=" Did you mean ";n&&(i+=n+" ");const o=r.map(e=>`"${e}"`);switch(o.length){case 0:return"";case 1:return i+o[0]+"?";case 2:return i+o[0]+" or "+o[1]+"?"}const a=o.slice(0,5),s=a.pop();return i+a.join(", ")+", or "+s+"?"}function Th(e){return e}function bh(e,t){const n=Object.create(null);for(const r of e)n[t(r)]=r;return n}function _h(e,t,n){const r=Object.create(null);for(const i of e)r[t(i)]=n(i);return r}function Nh(e,t){const n=Object.create(null);for(const r of Object.keys(e))n[r]=t(e[r],r);return n}function Ih(e,t){let n=0,r=0;for(;n<e.length&&r<t.length;){let i=e.charCodeAt(n),o=t.charCodeAt(r);if(Ah(i)&&Ah(o)){let a=0;do{++n,a=10*a+i-Oh,i=e.charCodeAt(n)}while(Ah(i)&&a>0);let s=0;do{++r,s=10*s+o-Oh,o=t.charCodeAt(r)}while(Ah(o)&&s>0);if(a<s)return-1;if(a>s)return 1}else{if(i<o)return-1;if(i>o)return 1;++n,++r}}return e.length-t.length}const Oh=48,wh=57;function Ah(e){return!isNaN(e)&&Oh<=e&&e<=wh}function Sh(e,t){const n=Object.create(null),r=new Dh(e),i=Math.floor(.4*e.length)+1;for(const e of t){const t=r.measure(e,i);void 0!==t&&(n[e]=t)}return Object.keys(n).sort((e,t)=>{const r=n[e]-n[t];return 0!==r?r:Ih(e,t)})}class Dh{constructor(e){this._input=e,this._inputLowerCase=e.toLowerCase(),this._inputArray=Rh(this._inputLowerCase),this._rows=[new Array(e.length+1).fill(0),new Array(e.length+1).fill(0),new Array(e.length+1).fill(0)]}measure(e,t){if(this._input===e)return 0;const n=e.toLowerCase();if(this._inputLowerCase===n)return 1;let r=Rh(n),i=this._inputArray;if(r.length<i.length){const e=r;r=i,i=e}const o=r.length,a=i.length;if(o-a>t)return;const s=this._rows;for(let e=0;e<=a;e++)s[0][e]=e;for(let e=1;e<=o;e++){const n=s[(e-1)%3],o=s[e%3];let c=o[0]=e;for(let t=1;t<=a;t++){const a=r[e-1]===i[t-1]?0:1;let u=Math.min(n[t]+1,o[t-1]+1,n[t-1]+a);if(e>1&&t>1&&r[e-1]===i[t-2]&&r[e-2]===i[t-1]){const n=s[(e-2)%3][t-2];u=Math.min(u,n+1)}u<c&&(c=u),o[t]=u}if(c>t)return}const c=s[o%3][a];return c<=t?c:void 0}}function Rh(e){const t=e.length,n=new Array(t);for(let r=0;r<t;++r)n[r]=e.charCodeAt(r);return n}function Fh(e){if(null==e)return Object.create(null);if(null===Object.getPrototypeOf(e))return e;const t=Object.create(null);for(const[n,r]of Object.entries(e))t[n]=r;return t}const kh=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function xh(e){return jh[e.charCodeAt(0)]}const jh=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000B","\\f","\\r","\\u000E","\\u000F","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001A","\\u001B","\\u001C","\\u001D","\\u001E","\\u001F","","",'\\"',"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\u007F","\\u0080","\\u0081","\\u0082","\\u0083","\\u0084","\\u0085","\\u0086","\\u0087","\\u0088","\\u0089","\\u008A","\\u008B","\\u008C","\\u008D","\\u008E","\\u008F","\\u0090","\\u0091","\\u0092","\\u0093","\\u0094","\\u0095","\\u0096","\\u0097","\\u0098","\\u0099","\\u009A","\\u009B","\\u009C","\\u009D","\\u009E","\\u009F"],Ch=Object.freeze({});function Ph(e,t,n=Af){const r=new Map;for(const e of Object.values(kf))r.set(e,$h(t,e));let i,o,a,s=Array.isArray(e),c=[e],u=-1,l=[],p=e;const d=[],f=[];do{u++;const e=u===c.length,m=e&&0!==l.length;if(e){if(o=0===f.length?void 0:d[d.length-1],p=a,a=f.pop(),m)if(s){p=p.slice();let e=0;for(const[t,n]of l){const r=t-e;null===n?(p.splice(r,1),e++):p[r]=n}}else{p={...p};for(const[e,t]of l)p[e]=t}u=i.index,c=i.keys,l=i.edits,s=i.inArray,i=i.prev}else if(a){if(o=s?u:c[u],p=a[o],null==p)continue;d.push(o)}let g;if(!Array.isArray(p)){var h,y;Df(p)||ff(!1,`Invalid AST Node: ${uh(p)}.`);const n=e?null===(h=r.get(p.kind))||void 0===h?void 0:h.leave:null===(y=r.get(p.kind))||void 0===y?void 0:y.enter;if(g=null==n?void 0:n.call(t,p,o,a,d,f),g===Ch)break;if(!1===g){if(!e){d.pop();continue}}else if(void 0!==g&&(l.push([o,g]),!e)){if(!Df(g)){d.pop();continue}p=g}}var v;if(void 0===g&&m&&l.push([o,p]),e)d.pop();else i={inArray:s,index:u,keys:c,edits:l,prev:i},s=Array.isArray(p),c=s?p:null!==(v=n[p.kind])&&void 0!==v?v:[],u=-1,l=[],a&&f.push(a),a=p}while(void 0!==i);return 0!==l.length?l[l.length-1][1]:e}function Lh(e){const t=new Array(e.length).fill(null),n=Object.create(null);for(const r of Object.values(kf)){let i=!1;const o=new Array(e.length).fill(void 0),a=new Array(e.length).fill(void 0);for(let t=0;t<e.length;++t){const{enter:n,leave:s}=$h(e[t],r);i||(i=null!=n||null!=s),o[t]=n,a[t]=s}if(!i)continue;const s={enter(...n){const r=n[0];for(let a=0;a<e.length;a++)if(null===t[a]){var i;const s=null===(i=o[a])||void 0===i?void 0:i.apply(e[a],n);if(!1===s)t[a]=r;else if(s===Ch)t[a]=Ch;else if(void 0!==s)return s}},leave(...n){const r=n[0];for(let o=0;o<e.length;o++)if(null===t[o]){var i;const r=null===(i=a[o])||void 0===i?void 0:i.apply(e[o],n);if(r===Ch)t[o]=Ch;else if(void 0!==r&&!1!==r)return r}else t[o]===r&&(t[o]=null)}};n[r]=s}return n}function $h(e,t){const n=e[t];return"object"==typeof n?n:"function"==typeof n?{enter:n,leave:void 0}:{enter:e.enter,leave:e.leave}}function Mh(e){return Ph(e,Vh)}const Vh={Name:{leave:e=>e.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>Uh(e.definitions,"\n\n")},OperationDefinition:{leave(e){const t=Gh("(",Uh(e.variableDefinitions,", "),")"),n=Uh([e.operation,Uh([e.name,t]),Uh(e.directives," ")]," ");return("query"===n?"":n+" ")+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:n,directives:r})=>e+": "+t+Gh(" = ",n)+Gh(" ",Uh(r," "))},SelectionSet:{leave:({selections:e})=>Bh(e)},Field:{leave({alias:e,name:t,arguments:n,directives:r,selectionSet:i}){const o=Gh("",e,": ")+t;let a=o+Gh("(",Uh(n,", "),")");return a.length>80&&(a=o+Gh("(\n",Qh(Uh(n,"\n")),"\n)")),Uh([a,Uh(r," "),i]," ")}},Argument:{leave:({name:e,value:t})=>e+": "+t},FragmentSpread:{leave:({name:e,directives:t})=>"..."+e+Gh(" ",Uh(t," "))},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:n})=>Uh(["...",Gh("on ",e),Uh(t," "),n]," ")},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:n,directives:r,selectionSet:i})=>`fragment ${e}${Gh("(",Uh(n,", "),")")} on ${t} ${Gh("",Uh(r," ")," ")}`+i},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>t?Bf(e):`"${e.replace(kh,xh)}"`},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>"["+Uh(e,", ")+"]"},ObjectValue:{leave:({fields:e})=>"{"+Uh(e,", ")+"}"},ObjectField:{leave:({name:e,value:t})=>e+": "+t},Directive:{leave:({name:e,arguments:t})=>"@"+e+Gh("(",Uh(t,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({description:e,directives:t,operationTypes:n})=>Gh("",e,"\n")+Uh(["schema",Uh(t," "),Bh(n)]," ")},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+": "+t},ScalarTypeDefinition:{leave:({description:e,name:t,directives:n})=>Gh("",e,"\n")+Uh(["scalar",t,Uh(n," ")]," ")},ObjectTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>Gh("",e,"\n")+Uh(["type",t,Gh("implements ",Uh(n," & ")),Uh(r," "),Bh(i)]," ")},FieldDefinition:{leave:({description:e,name:t,arguments:n,type:r,directives:i})=>Gh("",e,"\n")+t+(Yh(n)?Gh("(\n",Qh(Uh(n,"\n")),"\n)"):Gh("(",Uh(n,", "),")"))+": "+r+Gh(" ",Uh(i," "))},InputValueDefinition:{leave:({description:e,name:t,type:n,defaultValue:r,directives:i})=>Gh("",e,"\n")+Uh([t+": "+n,Gh("= ",r),Uh(i," ")]," ")},InterfaceTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>Gh("",e,"\n")+Uh(["interface",t,Gh("implements ",Uh(n," & ")),Uh(r," "),Bh(i)]," ")},UnionTypeDefinition:{leave:({description:e,name:t,directives:n,types:r})=>Gh("",e,"\n")+Uh(["union",t,Uh(n," "),Gh("= ",Uh(r," | "))]," ")},EnumTypeDefinition:{leave:({description:e,name:t,directives:n,values:r})=>Gh("",e,"\n")+Uh(["enum",t,Uh(n," "),Bh(r)]," ")},EnumValueDefinition:{leave:({description:e,name:t,directives:n})=>Gh("",e,"\n")+Uh([t,Uh(n," ")]," ")},InputObjectTypeDefinition:{leave:({description:e,name:t,directives:n,fields:r})=>Gh("",e,"\n")+Uh(["input",t,Uh(n," "),Bh(r)]," ")},DirectiveDefinition:{leave:({description:e,name:t,arguments:n,repeatable:r,locations:i})=>Gh("",e,"\n")+"directive @"+t+(Yh(n)?Gh("(\n",Qh(Uh(n,"\n")),"\n)"):Gh("(",Uh(n,", "),")"))+(r?" repeatable":"")+" on "+Uh(i," | ")},SchemaExtension:{leave:({directives:e,operationTypes:t})=>Uh(["extend schema",Uh(e," "),Bh(t)]," ")},ScalarTypeExtension:{leave:({name:e,directives:t})=>Uh(["extend scalar",e,Uh(t," ")]," ")},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>Uh(["extend type",e,Gh("implements ",Uh(t," & ")),Uh(n," "),Bh(r)]," ")},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>Uh(["extend interface",e,Gh("implements ",Uh(t," & ")),Uh(n," "),Bh(r)]," ")},UnionTypeExtension:{leave:({name:e,directives:t,types:n})=>Uh(["extend union",e,Uh(t," "),Gh("= ",Uh(n," | "))]," ")},EnumTypeExtension:{leave:({name:e,directives:t,values:n})=>Uh(["extend enum",e,Uh(t," "),Bh(n)]," ")},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:n})=>Uh(["extend input",e,Uh(t," "),Bh(n)]," ")}};function Uh(e,t=""){var n;return null!==(n=null==e?void 0:e.filter(e=>e).join(t))&&void 0!==n?n:""}function Bh(e){return Gh("{\n",Qh(Uh(e,"\n")),"\n}")}function Gh(e,t,n=""){return null!=t&&""!==t?e+t+n:""}function Qh(e){return Gh("  ",e.replace(/\n/g,"\n  "))}function Yh(e){var t;return null!==(t=null==e?void 0:e.some(e=>e.includes("\n")))&&void 0!==t&&t}function qh(e,t){switch(e.kind){case kf.NULL:return null;case kf.INT:return parseInt(e.value,10);case kf.FLOAT:return parseFloat(e.value);case kf.STRING:case kf.ENUM:case kf.BOOLEAN:return e.value;case kf.LIST:return e.values.map(e=>qh(e,t));case kf.OBJECT:return _h(e.fields,e=>e.name.value,e=>qh(e.value,t));case kf.VARIABLE:return null==t?void 0:t[e.name.value]}}function zh(e){if(null!=e||ff(!1,"Must provide name."),"string"==typeof e||ff(!1,"Expected name to be a string."),0===e.length)throw new _f("Expected name to be a non-empty string.");for(let t=1;t<e.length;++t)if(!$f(e.charCodeAt(t)))throw new _f(`Names must only contain [_a-zA-Z0-9] but "${e}" does not.`);if(!Lf(e.charCodeAt(0)))throw new _f(`Names must start with [_a-zA-Z] but "${e}" does not.`);return e}function Wh(e){if("true"===e||"false"===e||"null"===e)throw new _f(`Enum values cannot be named: ${e}`);return zh(e)}function Jh(e){return Kh(e)||Xh(e)||Zh(e)||ty(e)||ny(e)||ry(e)||iy(e)||oy(e)}function Kh(e){return ph(e,by)}function Xh(e){return ph(e,_y)}function Hh(e){if(!Xh(e))throw new Error(`Expected ${uh(e)} to be a GraphQL Object type.`);return e}function Zh(e){return ph(e,Ry)}function ey(e){if(!Zh(e))throw new Error(`Expected ${uh(e)} to be a GraphQL Interface type.`);return e}function ty(e){return ph(e,Fy)}function ny(e){return ph(e,xy)}function ry(e){return ph(e,Py)}function iy(e){return ph(e,py)}function oy(e){return ph(e,dy)}function ay(e){return Kh(e)||ny(e)||ry(e)||fy(e)&&ay(e.ofType)}function sy(e){return Kh(e)||Xh(e)||Zh(e)||ty(e)||ny(e)||fy(e)&&sy(e.ofType)}function cy(e){return Kh(e)||ny(e)}function uy(e){return Xh(e)||Zh(e)||ty(e)}function ly(e){return Zh(e)||ty(e)}class py{constructor(e){Jh(e)||ff(!1,`Expected ${uh(e)} to be a GraphQL type.`),this.ofType=e}get[Symbol.toStringTag](){return"GraphQLList"}toString(){return"["+String(this.ofType)+"]"}toJSON(){return this.toString()}}class dy{constructor(e){hy(e)||ff(!1,`Expected ${uh(e)} to be a GraphQL nullable type.`),this.ofType=e}get[Symbol.toStringTag](){return"GraphQLNonNull"}toString(){return String(this.ofType)+"!"}toJSON(){return this.toString()}}function fy(e){return iy(e)||oy(e)}function hy(e){return Jh(e)&&!oy(e)}function yy(e){if(!hy(e))throw new Error(`Expected ${uh(e)} to be a GraphQL nullable type.`);return e}function vy(e){if(e)return oy(e)?e.ofType:e}function my(e){return Kh(e)||Xh(e)||Zh(e)||ty(e)||ny(e)||ry(e)}function gy(e){if(e){let t=e;for(;fy(t);)t=t.ofType;return t}}function Ey(e){return"function"==typeof e?e():e}function Ty(e){return"function"==typeof e?e():e}class by{constructor(e){var t,n,r,i;const o=null!==(t=e.parseValue)&&void 0!==t?t:Th;this.name=zh(e.name),this.description=e.description,this.specifiedByURL=e.specifiedByURL,this.serialize=null!==(n=e.serialize)&&void 0!==n?n:Th,this.parseValue=o,this.parseLiteral=null!==(r=e.parseLiteral)&&void 0!==r?r:(e,t)=>o(qh(e,t)),this.extensions=Fh(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!==(i=e.extensionASTNodes)&&void 0!==i?i:[],null==e.specifiedByURL||"string"==typeof e.specifiedByURL||ff(!1,`${this.name} must provide "specifiedByURL" as a string, but got: ${uh(e.specifiedByURL)}.`),null==e.serialize||"function"==typeof e.serialize||ff(!1,`${this.name} must provide "serialize" function. If this custom Scalar is also used as an input type, ensure "parseValue" and "parseLiteral" functions are also provided.`),e.parseLiteral&&("function"==typeof e.parseValue&&"function"==typeof e.parseLiteral||ff(!1,`${this.name} must provide both "parseValue" and "parseLiteral" functions.`))}get[Symbol.toStringTag](){return"GraphQLScalarType"}toConfig(){return{name:this.name,description:this.description,specifiedByURL:this.specifiedByURL,serialize:this.serialize,parseValue:this.parseValue,parseLiteral:this.parseLiteral,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}class _y{constructor(e){var t;this.name=zh(e.name),this.description=e.description,this.isTypeOf=e.isTypeOf,this.extensions=Fh(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!==(t=e.extensionASTNodes)&&void 0!==t?t:[],this._fields=()=>Iy(e),this._interfaces=()=>Ny(e),null==e.isTypeOf||"function"==typeof e.isTypeOf||ff(!1,`${this.name} must provide "isTypeOf" as a function, but got: ${uh(e.isTypeOf)}.`)}get[Symbol.toStringTag](){return"GraphQLObjectType"}getFields(){return"function"==typeof this._fields&&(this._fields=this._fields()),this._fields}getInterfaces(){return"function"==typeof this._interfaces&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:Ay(this.getFields()),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function Ny(e){var t;const n=Ey(null!==(t=e.interfaces)&&void 0!==t?t:[]);return Array.isArray(n)||ff(!1,`${e.name} interfaces must be an Array or a function which returns an Array.`),n}function Iy(e){const t=Ty(e.fields);return wy(t)||ff(!1,`${e.name} fields must be an object with field names as keys or a function which returns such an object.`),Nh(t,(t,n)=>{var r;wy(t)||ff(!1,`${e.name}.${n} field config must be an object.`),null==t.resolve||"function"==typeof t.resolve||ff(!1,`${e.name}.${n} field resolver must be a function if provided, but got: ${uh(t.resolve)}.`);const i=null!==(r=t.args)&&void 0!==r?r:{};return wy(i)||ff(!1,`${e.name}.${n} args must be an object with argument names as keys.`),{name:zh(n),description:t.description,type:t.type,args:Oy(i),resolve:t.resolve,subscribe:t.subscribe,deprecationReason:t.deprecationReason,extensions:Fh(t.extensions),astNode:t.astNode}})}function Oy(e){return Object.entries(e).map(([e,t])=>({name:zh(e),description:t.description,type:t.type,defaultValue:t.defaultValue,deprecationReason:t.deprecationReason,extensions:Fh(t.extensions),astNode:t.astNode}))}function wy(e){return yf(e)&&!Array.isArray(e)}function Ay(e){return Nh(e,e=>({description:e.description,type:e.type,args:Sy(e.args),resolve:e.resolve,subscribe:e.subscribe,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode}))}function Sy(e){return _h(e,e=>e.name,e=>({description:e.description,type:e.type,defaultValue:e.defaultValue,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode}))}function Dy(e){return oy(e.type)&&void 0===e.defaultValue}class Ry{constructor(e){var t;this.name=zh(e.name),this.description=e.description,this.resolveType=e.resolveType,this.extensions=Fh(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!==(t=e.extensionASTNodes)&&void 0!==t?t:[],this._fields=Iy.bind(void 0,e),this._interfaces=Ny.bind(void 0,e),null==e.resolveType||"function"==typeof e.resolveType||ff(!1,`${this.name} must provide "resolveType" as a function, but got: ${uh(e.resolveType)}.`)}get[Symbol.toStringTag](){return"GraphQLInterfaceType"}getFields(){return"function"==typeof this._fields&&(this._fields=this._fields()),this._fields}getInterfaces(){return"function"==typeof this._interfaces&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:Ay(this.getFields()),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}class Fy{constructor(e){var t;this.name=zh(e.name),this.description=e.description,this.resolveType=e.resolveType,this.extensions=Fh(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!==(t=e.extensionASTNodes)&&void 0!==t?t:[],this._types=ky.bind(void 0,e),null==e.resolveType||"function"==typeof e.resolveType||ff(!1,`${this.name} must provide "resolveType" as a function, but got: ${uh(e.resolveType)}.`)}get[Symbol.toStringTag](){return"GraphQLUnionType"}getTypes(){return"function"==typeof this._types&&(this._types=this._types()),this._types}toConfig(){return{name:this.name,description:this.description,types:this.getTypes(),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function ky(e){const t=Ey(e.types);return Array.isArray(t)||ff(!1,`Must provide Array of types or a function which returns such an array for Union ${e.name}.`),t}class xy{constructor(e){var t;this.name=zh(e.name),this.description=e.description,this.extensions=Fh(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!==(t=e.extensionASTNodes)&&void 0!==t?t:[],this._values="function"==typeof e.values?e.values:Cy(this.name,e.values),this._valueLookup=null,this._nameLookup=null}get[Symbol.toStringTag](){return"GraphQLEnumType"}getValues(){return"function"==typeof this._values&&(this._values=Cy(this.name,this._values())),this._values}getValue(e){return null===this._nameLookup&&(this._nameLookup=bh(this.getValues(),e=>e.name)),this._nameLookup[e]}serialize(e){null===this._valueLookup&&(this._valueLookup=new Map(this.getValues().map(e=>[e.value,e])));const t=this._valueLookup.get(e);if(void 0===t)throw new _f(`Enum "${this.name}" cannot represent value: ${uh(e)}`);return t.name}parseValue(e){if("string"!=typeof e){const t=uh(e);throw new _f(`Enum "${this.name}" cannot represent non-string value: ${t}.`+jy(this,t))}const t=this.getValue(e);if(null==t)throw new _f(`Value "${e}" does not exist in "${this.name}" enum.`+jy(this,e));return t.value}parseLiteral(e,t){if(e.kind!==kf.ENUM){const t=Mh(e);throw new _f(`Enum "${this.name}" cannot represent non-enum value: ${t}.`+jy(this,t),{nodes:e})}const n=this.getValue(e.value);if(null==n){const t=Mh(e);throw new _f(`Value "${t}" does not exist in "${this.name}" enum.`+jy(this,t),{nodes:e})}return n.value}toConfig(){const e=_h(this.getValues(),e=>e.name,e=>({description:e.description,value:e.value,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode}));return{name:this.name,description:this.description,values:e,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function jy(e,t){return Eh("the enum value",Sh(t,e.getValues().map(e=>e.name)))}function Cy(e,t){return wy(t)||ff(!1,`${e} values must be an object with value names as keys.`),Object.entries(t).map(([t,n])=>(wy(n)||ff(!1,`${e}.${t} must refer to an object with a "value" key representing an internal value but got: ${uh(n)}.`),{name:Wh(t),description:n.description,value:void 0!==n.value?n.value:t,deprecationReason:n.deprecationReason,extensions:Fh(n.extensions),astNode:n.astNode}))}class Py{constructor(e){var t,n;this.name=zh(e.name),this.description=e.description,this.extensions=Fh(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!==(t=e.extensionASTNodes)&&void 0!==t?t:[],this.isOneOf=null!==(n=e.isOneOf)&&void 0!==n&&n,this._fields=Ly.bind(void 0,e)}get[Symbol.toStringTag](){return"GraphQLInputObjectType"}getFields(){return"function"==typeof this._fields&&(this._fields=this._fields()),this._fields}toConfig(){const e=Nh(this.getFields(),e=>({description:e.description,type:e.type,defaultValue:e.defaultValue,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode}));return{name:this.name,description:this.description,fields:e,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,isOneOf:this.isOneOf}}toString(){return this.name}toJSON(){return this.toString()}}function Ly(e){const t=Ty(e.fields);return wy(t)||ff(!1,`${e.name} fields must be an object with field names as keys or a function which returns such an object.`),Nh(t,(t,n)=>(!("resolve"in t)||ff(!1,`${e.name}.${n} field has a resolve property, but Input Types cannot define resolvers.`),{name:zh(n),description:t.description,type:t.type,defaultValue:t.defaultValue,deprecationReason:t.deprecationReason,extensions:Fh(t.extensions),astNode:t.astNode}))}function $y(e){return oy(e.type)&&void 0===e.defaultValue}function My(e,t){return e===t||(oy(e)&&oy(t)||!(!iy(e)||!iy(t)))&&My(e.ofType,t.ofType)}function Vy(e,t,n){return t===n||(oy(n)?!!oy(t)&&Vy(e,t.ofType,n.ofType):oy(t)?Vy(e,t.ofType,n):iy(n)?!!iy(t)&&Vy(e,t.ofType,n.ofType):!iy(t)&&(ly(n)&&(Zh(t)||Xh(t))&&e.isSubType(n,t)))}function Uy(e,t,n){return t===n||(ly(t)?ly(n)?e.getPossibleTypes(t).some(t=>e.isSubType(n,t)):e.isSubType(t,n):!!ly(n)&&e.isSubType(n,t))}const By=2147483647,Gy=-2147483648,Qy=new by({name:"Int",description:"The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.",serialize(e){const t=Xy(e);if("boolean"==typeof t)return t?1:0;let n=t;if("string"==typeof t&&""!==t&&(n=Number(t)),"number"!=typeof n||!Number.isInteger(n))throw new _f(`Int cannot represent non-integer value: ${uh(t)}`);if(n>By||n<Gy)throw new _f("Int cannot represent non 32-bit signed integer value: "+uh(t));return n},parseValue(e){if("number"!=typeof e||!Number.isInteger(e))throw new _f(`Int cannot represent non-integer value: ${uh(e)}`);if(e>By||e<Gy)throw new _f(`Int cannot represent non 32-bit signed integer value: ${e}`);return e},parseLiteral(e){if(e.kind!==kf.INT)throw new _f(`Int cannot represent non-integer value: ${Mh(e)}`,{nodes:e});const t=parseInt(e.value,10);if(t>By||t<Gy)throw new _f(`Int cannot represent non 32-bit signed integer value: ${e.value}`,{nodes:e});return t}}),Yy=new by({name:"Float",description:"The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).",serialize(e){const t=Xy(e);if("boolean"==typeof t)return t?1:0;let n=t;if("string"==typeof t&&""!==t&&(n=Number(t)),"number"!=typeof n||!Number.isFinite(n))throw new _f(`Float cannot represent non numeric value: ${uh(t)}`);return n},parseValue(e){if("number"!=typeof e||!Number.isFinite(e))throw new _f(`Float cannot represent non numeric value: ${uh(e)}`);return e},parseLiteral(e){if(e.kind!==kf.FLOAT&&e.kind!==kf.INT)throw new _f(`Float cannot represent non numeric value: ${Mh(e)}`,e);return parseFloat(e.value)}}),qy=new by({name:"String",description:"The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.",serialize(e){const t=Xy(e);if("string"==typeof t)return t;if("boolean"==typeof t)return t?"true":"false";if("number"==typeof t&&Number.isFinite(t))return t.toString();throw new _f(`String cannot represent value: ${uh(e)}`)},parseValue(e){if("string"!=typeof e)throw new _f(`String cannot represent a non string value: ${uh(e)}`);return e},parseLiteral(e){if(e.kind!==kf.STRING)throw new _f(`String cannot represent a non string value: ${Mh(e)}`,{nodes:e});return e.value}}),zy=new by({name:"Boolean",description:"The `Boolean` scalar type represents `true` or `false`.",serialize(e){const t=Xy(e);if("boolean"==typeof t)return t;if(Number.isFinite(t))return 0!==t;throw new _f(`Boolean cannot represent a non boolean value: ${uh(t)}`)},parseValue(e){if("boolean"!=typeof e)throw new _f(`Boolean cannot represent a non boolean value: ${uh(e)}`);return e},parseLiteral(e){if(e.kind!==kf.BOOLEAN)throw new _f(`Boolean cannot represent a non boolean value: ${Mh(e)}`,{nodes:e});return e.value}}),Wy=new by({name:"ID",description:'The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID.',serialize(e){const t=Xy(e);if("string"==typeof t)return t;if(Number.isInteger(t))return String(t);throw new _f(`ID cannot represent value: ${uh(e)}`)},parseValue(e){if("string"==typeof e)return e;if("number"==typeof e&&Number.isInteger(e))return e.toString();throw new _f(`ID cannot represent value: ${uh(e)}`)},parseLiteral(e){if(e.kind!==kf.STRING&&e.kind!==kf.INT)throw new _f("ID cannot represent a non-string and non-integer value: "+Mh(e),{nodes:e});return e.value}}),Jy=Object.freeze([qy,Qy,Yy,zy,Wy]);function Ky(e){return Jy.some(({name:t})=>e.name===t)}function Xy(e){if(yf(e)){if("function"==typeof e.valueOf){const t=e.valueOf();if(!yf(t))return t}if("function"==typeof e.toJSON)return e.toJSON()}return e}function Hy(e){return ph(e,Zy)}class Zy{constructor(e){var t,n;this.name=zh(e.name),this.description=e.description,this.locations=e.locations,this.isRepeatable=null!==(t=e.isRepeatable)&&void 0!==t&&t,this.extensions=Fh(e.extensions),this.astNode=e.astNode,Array.isArray(e.locations)||ff(!1,`@${e.name} locations must be an Array.`);const r=null!==(n=e.args)&&void 0!==n?n:{};yf(r)&&!Array.isArray(r)||ff(!1,`@${e.name} args must be an object with argument names as keys.`),this.args=Oy(r)}get[Symbol.toStringTag](){return"GraphQLDirective"}toConfig(){return{name:this.name,description:this.description,locations:this.locations,args:Sy(this.args),isRepeatable:this.isRepeatable,extensions:this.extensions,astNode:this.astNode}}toString(){return"@"+this.name}toJSON(){return this.toString()}}const ev=new Zy({name:"include",description:"Directs the executor to include this field or fragment only when the `if` argument is true.",locations:[Ff.FIELD,Ff.FRAGMENT_SPREAD,Ff.INLINE_FRAGMENT],args:{if:{type:new dy(zy),description:"Included when true."}}}),tv=new Zy({name:"skip",description:"Directs the executor to skip this field or fragment when the `if` argument is true.",locations:[Ff.FIELD,Ff.FRAGMENT_SPREAD,Ff.INLINE_FRAGMENT],args:{if:{type:new dy(zy),description:"Skipped when true."}}}),nv="No longer supported",rv=new Zy({name:"deprecated",description:"Marks an element of a GraphQL schema as no longer supported.",locations:[Ff.FIELD_DEFINITION,Ff.ARGUMENT_DEFINITION,Ff.INPUT_FIELD_DEFINITION,Ff.ENUM_VALUE],args:{reason:{type:qy,description:"Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/).",defaultValue:nv}}}),iv=new Zy({name:"specifiedBy",description:"Exposes a URL that specifies the behavior of this scalar.",locations:[Ff.SCALAR],args:{url:{type:new dy(qy),description:"The URL that specifies the behavior of this scalar."}}}),ov=new Zy({name:"oneOf",description:"Indicates exactly one field must be supplied and this field must not be `null`.",locations:[Ff.INPUT_OBJECT],args:{}}),av=Object.freeze([ev,tv,rv,iv,ov]);function sv(e){return av.some(({name:t})=>t===e.name)}function cv(e){return"object"==typeof e&&"function"==typeof(null==e?void 0:e[Symbol.iterator])}function uv(e,t){if(oy(t)){const n=uv(e,t.ofType);return(null==n?void 0:n.kind)===kf.NULL?null:n}if(null===e)return{kind:kf.NULL};if(void 0===e)return null;if(iy(t)){const n=t.ofType;if(cv(e)){const t=[];for(const r of e){const e=uv(r,n);null!=e&&t.push(e)}return{kind:kf.LIST,values:t}}return uv(e,n)}if(ry(t)){if(!yf(e))return null;const n=[];for(const r of Object.values(t.getFields())){const t=uv(e[r.name],r.type);t&&n.push({kind:kf.OBJECT_FIELD,name:{kind:kf.NAME,value:r.name},value:t})}return{kind:kf.OBJECT,fields:n}}if(cy(t)){const n=t.serialize(e);if(null==n)return null;if("boolean"==typeof n)return{kind:kf.BOOLEAN,value:n};if("number"==typeof n&&Number.isFinite(n)){const e=String(n);return lv.test(e)?{kind:kf.INT,value:e}:{kind:kf.FLOAT,value:e}}if("string"==typeof n)return ny(t)?{kind:kf.ENUM,value:n}:t===Wy&&lv.test(n)?{kind:kf.INT,value:n}:{kind:kf.STRING,value:n};throw new TypeError(`Cannot convert value to AST: ${uh(n)}.`)}vf(!1,"Unexpected input type: "+uh(t))}const lv=/^-?(?:0|[1-9][0-9]*)$/,pv=new _y({name:"__Schema",description:"A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.",fields:()=>({description:{type:qy,resolve:e=>e.description},types:{description:"A list of all types supported by this server.",type:new dy(new py(new dy(hv))),resolve:e=>Object.values(e.getTypeMap())},queryType:{description:"The type that query operations will be rooted at.",type:new dy(hv),resolve:e=>e.getQueryType()},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:hv,resolve:e=>e.getMutationType()},subscriptionType:{description:"If this server support subscription, the type that subscription operations will be rooted at.",type:hv,resolve:e=>e.getSubscriptionType()},directives:{description:"A list of all directives supported by this server.",type:new dy(new py(new dy(dv))),resolve:e=>e.getDirectives()}})}),dv=new _y({name:"__Directive",description:"A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.\n\nIn some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.",fields:()=>({name:{type:new dy(qy),resolve:e=>e.name},description:{type:qy,resolve:e=>e.description},isRepeatable:{type:new dy(zy),resolve:e=>e.isRepeatable},locations:{type:new dy(new py(new dy(fv))),resolve:e=>e.locations},args:{type:new dy(new py(new dy(vv))),args:{includeDeprecated:{type:zy,defaultValue:!1}},resolve:(e,{includeDeprecated:t})=>t?e.args:e.args.filter(e=>null==e.deprecationReason)}})}),fv=new xy({name:"__DirectiveLocation",description:"A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.",values:{QUERY:{value:Ff.QUERY,description:"Location adjacent to a query operation."},MUTATION:{value:Ff.MUTATION,description:"Location adjacent to a mutation operation."},SUBSCRIPTION:{value:Ff.SUBSCRIPTION,description:"Location adjacent to a subscription operation."},FIELD:{value:Ff.FIELD,description:"Location adjacent to a field."},FRAGMENT_DEFINITION:{value:Ff.FRAGMENT_DEFINITION,description:"Location adjacent to a fragment definition."},FRAGMENT_SPREAD:{value:Ff.FRAGMENT_SPREAD,description:"Location adjacent to a fragment spread."},INLINE_FRAGMENT:{value:Ff.INLINE_FRAGMENT,description:"Location adjacent to an inline fragment."},VARIABLE_DEFINITION:{value:Ff.VARIABLE_DEFINITION,description:"Location adjacent to a variable definition."},SCHEMA:{value:Ff.SCHEMA,description:"Location adjacent to a schema definition."},SCALAR:{value:Ff.SCALAR,description:"Location adjacent to a scalar definition."},OBJECT:{value:Ff.OBJECT,description:"Location adjacent to an object type definition."},FIELD_DEFINITION:{value:Ff.FIELD_DEFINITION,description:"Location adjacent to a field definition."},ARGUMENT_DEFINITION:{value:Ff.ARGUMENT_DEFINITION,description:"Location adjacent to an argument definition."},INTERFACE:{value:Ff.INTERFACE,description:"Location adjacent to an interface definition."},UNION:{value:Ff.UNION,description:"Location adjacent to a union definition."},ENUM:{value:Ff.ENUM,description:"Location adjacent to an enum definition."},ENUM_VALUE:{value:Ff.ENUM_VALUE,description:"Location adjacent to an enum value definition."},INPUT_OBJECT:{value:Ff.INPUT_OBJECT,description:"Location adjacent to an input object type definition."},INPUT_FIELD_DEFINITION:{value:Ff.INPUT_FIELD_DEFINITION,description:"Location adjacent to an input object field definition."}}}),hv=new _y({name:"__Type",description:"The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByURL`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.",fields:()=>({kind:{type:new dy(Ev),resolve:e=>Kh(e)?gv.SCALAR:Xh(e)?gv.OBJECT:Zh(e)?gv.INTERFACE:ty(e)?gv.UNION:ny(e)?gv.ENUM:ry(e)?gv.INPUT_OBJECT:iy(e)?gv.LIST:oy(e)?gv.NON_NULL:void vf(!1,`Unexpected type: "${uh(e)}".`)},name:{type:qy,resolve:e=>"name"in e?e.name:void 0},description:{type:qy,resolve:e=>"description"in e?e.description:void 0},specifiedByURL:{type:qy,resolve:e=>"specifiedByURL"in e?e.specifiedByURL:void 0},fields:{type:new py(new dy(yv)),args:{includeDeprecated:{type:zy,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if(Xh(e)||Zh(e)){const n=Object.values(e.getFields());return t?n:n.filter(e=>null==e.deprecationReason)}}},interfaces:{type:new py(new dy(hv)),resolve(e){if(Xh(e)||Zh(e))return e.getInterfaces()}},possibleTypes:{type:new py(new dy(hv)),resolve(e,t,n,{schema:r}){if(ly(e))return r.getPossibleTypes(e)}},enumValues:{type:new py(new dy(mv)),args:{includeDeprecated:{type:zy,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if(ny(e)){const n=e.getValues();return t?n:n.filter(e=>null==e.deprecationReason)}}},inputFields:{type:new py(new dy(vv)),args:{includeDeprecated:{type:zy,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if(ry(e)){const n=Object.values(e.getFields());return t?n:n.filter(e=>null==e.deprecationReason)}}},ofType:{type:hv,resolve:e=>"ofType"in e?e.ofType:void 0},isOneOf:{type:zy,resolve:e=>{if(ry(e))return e.isOneOf}}})}),yv=new _y({name:"__Field",description:"Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.",fields:()=>({name:{type:new dy(qy),resolve:e=>e.name},description:{type:qy,resolve:e=>e.description},args:{type:new dy(new py(new dy(vv))),args:{includeDeprecated:{type:zy,defaultValue:!1}},resolve:(e,{includeDeprecated:t})=>t?e.args:e.args.filter(e=>null==e.deprecationReason)},type:{type:new dy(hv),resolve:e=>e.type},isDeprecated:{type:new dy(zy),resolve:e=>null!=e.deprecationReason},deprecationReason:{type:qy,resolve:e=>e.deprecationReason}})}),vv=new _y({name:"__InputValue",description:"Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.",fields:()=>({name:{type:new dy(qy),resolve:e=>e.name},description:{type:qy,resolve:e=>e.description},type:{type:new dy(hv),resolve:e=>e.type},defaultValue:{type:qy,description:"A GraphQL-formatted string representing the default value for this input value.",resolve(e){const{type:t,defaultValue:n}=e,r=uv(n,t);return r?Mh(r):null}},isDeprecated:{type:new dy(zy),resolve:e=>null!=e.deprecationReason},deprecationReason:{type:qy,resolve:e=>e.deprecationReason}})}),mv=new _y({name:"__EnumValue",description:"One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.",fields:()=>({name:{type:new dy(qy),resolve:e=>e.name},description:{type:qy,resolve:e=>e.description},isDeprecated:{type:new dy(zy),resolve:e=>null!=e.deprecationReason},deprecationReason:{type:qy,resolve:e=>e.deprecationReason}})});var gv;!function(e){e.SCALAR="SCALAR",e.OBJECT="OBJECT",e.INTERFACE="INTERFACE",e.UNION="UNION",e.ENUM="ENUM",e.INPUT_OBJECT="INPUT_OBJECT",e.LIST="LIST",e.NON_NULL="NON_NULL"}(gv||(gv={}));const Ev=new xy({name:"__TypeKind",description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:gv.SCALAR,description:"Indicates this type is a scalar."},OBJECT:{value:gv.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:gv.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:gv.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:gv.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:gv.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:gv.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:gv.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}}),Tv={name:"__schema",type:new dy(pv),description:"Access the current type schema of this server.",args:[],resolve:(e,t,n,{schema:r})=>r,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},bv={name:"__type",type:hv,description:"Request the type information of a single type.",args:[{name:"name",description:void 0,type:new dy(qy),defaultValue:void 0,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0}],resolve:(e,{name:t},n,{schema:r})=>r.getType(t),deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},_v={name:"__typename",type:new dy(qy),description:"The name of the current Object type at runtime.",args:[],resolve:(e,t,n,{parentType:r})=>r.name,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},Nv=Object.freeze([pv,dv,fv,hv,yv,vv,mv,Ev]);function Iv(e){return Nv.some(({name:t})=>e.name===t)}function Ov(e){return ph(e,Av)}function wv(e){if(!Ov(e))throw new Error(`Expected ${uh(e)} to be a GraphQL schema.`);return e}class Av{constructor(e){var t,n;this.__validationErrors=!0===e.assumeValid?[]:void 0,yf(e)||ff(!1,"Must provide configuration object."),!e.types||Array.isArray(e.types)||ff(!1,`"types" must be Array if provided but got: ${uh(e.types)}.`),!e.directives||Array.isArray(e.directives)||ff(!1,`"directives" must be Array if provided but got: ${uh(e.directives)}.`),this.description=e.description,this.extensions=Fh(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!==(t=e.extensionASTNodes)&&void 0!==t?t:[],this._queryType=e.query,this._mutationType=e.mutation,this._subscriptionType=e.subscription,this._directives=null!==(n=e.directives)&&void 0!==n?n:av;const r=new Set(e.types);if(null!=e.types)for(const t of e.types)r.delete(t),Sv(t,r);null!=this._queryType&&Sv(this._queryType,r),null!=this._mutationType&&Sv(this._mutationType,r),null!=this._subscriptionType&&Sv(this._subscriptionType,r);for(const e of this._directives)if(Hy(e))for(const t of e.args)Sv(t.type,r);Sv(pv,r),this._typeMap=Object.create(null),this._subTypeMap=Object.create(null),this._implementationsMap=Object.create(null);for(const e of r){if(null==e)continue;const t=e.name;if(t||ff(!1,"One of the provided types for building the Schema is missing a name."),void 0!==this._typeMap[t])throw new Error(`Schema must contain uniquely named types but contains multiple types named "${t}".`);if(this._typeMap[t]=e,Zh(e)){for(const t of e.getInterfaces())if(Zh(t)){let n=this._implementationsMap[t.name];void 0===n&&(n=this._implementationsMap[t.name]={objects:[],interfaces:[]}),n.interfaces.push(e)}}else if(Xh(e))for(const t of e.getInterfaces())if(Zh(t)){let n=this._implementationsMap[t.name];void 0===n&&(n=this._implementationsMap[t.name]={objects:[],interfaces:[]}),n.objects.push(e)}}}get[Symbol.toStringTag](){return"GraphQLSchema"}getQueryType(){return this._queryType}getMutationType(){return this._mutationType}getSubscriptionType(){return this._subscriptionType}getRootType(e){switch(e){case Rf.QUERY:return this.getQueryType();case Rf.MUTATION:return this.getMutationType();case Rf.SUBSCRIPTION:return this.getSubscriptionType()}}getTypeMap(){return this._typeMap}getType(e){return this.getTypeMap()[e]}getPossibleTypes(e){return ty(e)?e.getTypes():this.getImplementations(e).objects}getImplementations(e){const t=this._implementationsMap[e.name];return null!=t?t:{objects:[],interfaces:[]}}isSubType(e,t){let n=this._subTypeMap[e.name];if(void 0===n){if(n=Object.create(null),ty(e))for(const t of e.getTypes())n[t.name]=!0;else{const t=this.getImplementations(e);for(const e of t.objects)n[e.name]=!0;for(const e of t.interfaces)n[e.name]=!0}this._subTypeMap[e.name]=n}return void 0!==n[t.name]}getDirectives(){return this._directives}getDirective(e){return this.getDirectives().find(t=>t.name===e)}toConfig(){return{description:this.description,query:this.getQueryType(),mutation:this.getMutationType(),subscription:this.getSubscriptionType(),types:Object.values(this.getTypeMap()),directives:this.getDirectives(),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,assumeValid:void 0!==this.__validationErrors}}}function Sv(e,t){const n=gy(e);if(!t.has(n))if(t.add(n),ty(n))for(const e of n.getTypes())Sv(e,t);else if(Xh(n)||Zh(n)){for(const e of n.getInterfaces())Sv(e,t);for(const e of Object.values(n.getFields())){Sv(e.type,t);for(const n of e.args)Sv(n.type,t)}}else if(ry(n))for(const e of Object.values(n.getFields()))Sv(e.type,t);return t}function Dv(e){if(wv(e),e.__validationErrors)return e.__validationErrors;const t=new Fv(e);!function(e){const t=e.schema,n=t.getQueryType();if(n){if(!Xh(n)){var r;e.reportError(`Query root type must be Object type, it cannot be ${uh(n)}.`,null!==(r=kv(t,Rf.QUERY))&&void 0!==r?r:n.astNode)}}else e.reportError("Query root type must be provided.",t.astNode);const i=t.getMutationType();var o;i&&!Xh(i)&&e.reportError(`Mutation root type must be Object type if provided, it cannot be ${uh(i)}.`,null!==(o=kv(t,Rf.MUTATION))&&void 0!==o?o:i.astNode);const a=t.getSubscriptionType();var s;a&&!Xh(a)&&e.reportError(`Subscription root type must be Object type if provided, it cannot be ${uh(a)}.`,null!==(s=kv(t,Rf.SUBSCRIPTION))&&void 0!==s?s:a.astNode)}(t),function(e){for(const n of e.schema.getDirectives())if(Hy(n)){xv(e,n),0===n.locations.length&&e.reportError(`Directive @${n.name} must include 1 or more locations.`,n.astNode);for(const r of n.args){var t;if(xv(e,r),ay(r.type)||e.reportError(`The type of @${n.name}(${r.name}:) must be Input Type but got: ${uh(r.type)}.`,r.astNode),Dy(r)&&null!=r.deprecationReason)e.reportError(`Required argument @${n.name}(${r.name}:) cannot be deprecated.`,[Qv(r.astNode),null===(t=r.astNode)||void 0===t?void 0:t.type])}}else e.reportError(`Expected directive but got: ${uh(n)}.`,null==n?void 0:n.astNode)}(t),function(e){const t=function(e){const t=Object.create(null),n=[],r=Object.create(null);return i;function i(o){if(t[o.name])return;t[o.name]=!0,r[o.name]=n.length;const a=Object.values(o.getFields());for(const t of a)if(oy(t.type)&&ry(t.type.ofType)){const o=t.type.ofType,a=r[o.name];if(n.push(t),void 0===a)i(o);else{const t=n.slice(a),r=t.map(e=>e.name).join(".");e.reportError(`Cannot reference Input Object "${o.name}" within itself through a series of non-null fields: "${r}".`,t.map(e=>e.astNode))}n.pop()}r[o.name]=void 0}}(e),n=e.schema.getTypeMap();for(const r of Object.values(n))my(r)?(Iv(r)||xv(e,r),Xh(r)||Zh(r)?(jv(e,r),Cv(e,r)):ty(r)?$v(e,r):ny(r)?Mv(e,r):ry(r)&&(Vv(e,r),t(r))):e.reportError(`Expected GraphQL named type but got: ${uh(r)}.`,r.astNode)}(t);const n=t.getErrors();return e.__validationErrors=n,n}function Rv(e){const t=Dv(e);if(0!==t.length)throw new Error(t.map(e=>e.message).join("\n\n"))}class Fv{constructor(e){this._errors=[],this.schema=e}reportError(e,t){const n=Array.isArray(t)?t.filter(Boolean):t;this._errors.push(new _f(e,{nodes:n}))}getErrors(){return this._errors}}function kv(e,t){var n;return null===(n=[e.astNode,...e.extensionASTNodes].flatMap(e=>{var t;return null!==(t=null==e?void 0:e.operationTypes)&&void 0!==t?t:[]}).find(e=>e.operation===t))||void 0===n?void 0:n.type}function xv(e,t){t.name.startsWith("__")&&e.reportError(`Name "${t.name}" must not begin with "__", which is reserved by GraphQL introspection.`,t.astNode)}function jv(e,t){const n=Object.values(t.getFields());0===n.length&&e.reportError(`Type ${t.name} must define one or more fields.`,[t.astNode,...t.extensionASTNodes]);for(const a of n){var r;if(xv(e,a),!sy(a.type))e.reportError(`The type of ${t.name}.${a.name} must be Output Type but got: ${uh(a.type)}.`,null===(r=a.astNode)||void 0===r?void 0:r.type);for(const n of a.args){const r=n.name;var i,o;if(xv(e,n),!ay(n.type))e.reportError(`The type of ${t.name}.${a.name}(${r}:) must be Input Type but got: ${uh(n.type)}.`,null===(i=n.astNode)||void 0===i?void 0:i.type);if(Dy(n)&&null!=n.deprecationReason)e.reportError(`Required argument ${t.name}.${a.name}(${r}:) cannot be deprecated.`,[Qv(n.astNode),null===(o=n.astNode)||void 0===o?void 0:o.type])}}}function Cv(e,t){const n=Object.create(null);for(const r of t.getInterfaces())Zh(r)?t!==r?n[r.name]?e.reportError(`Type ${t.name} can only implement ${r.name} once.`,Bv(t,r)):(n[r.name]=!0,Lv(e,t,r),Pv(e,t,r)):e.reportError(`Type ${t.name} cannot implement itself because it would create a circular reference.`,Bv(t,r)):e.reportError(`Type ${uh(t)} must only implement Interface types, it cannot implement ${uh(r)}.`,Bv(t,r))}function Pv(e,t,n){const r=t.getFields();for(const c of Object.values(n.getFields())){const u=c.name,l=r[u];if(l){var i,o;if(!Vy(e.schema,l.type,c.type))e.reportError(`Interface field ${n.name}.${u} expects type ${uh(c.type)} but ${t.name}.${u} is type ${uh(l.type)}.`,[null===(i=c.astNode)||void 0===i?void 0:i.type,null===(o=l.astNode)||void 0===o?void 0:o.type]);for(const r of c.args){const i=r.name,o=l.args.find(e=>e.name===i);var a,s;if(o){if(!My(r.type,o.type))e.reportError(`Interface field argument ${n.name}.${u}(${i}:) expects type ${uh(r.type)} but ${t.name}.${u}(${i}:) is type ${uh(o.type)}.`,[null===(a=r.astNode)||void 0===a?void 0:a.type,null===(s=o.astNode)||void 0===s?void 0:s.type])}else e.reportError(`Interface field argument ${n.name}.${u}(${i}:) expected but ${t.name}.${u} does not provide it.`,[r.astNode,l.astNode])}for(const r of l.args){const i=r.name;!c.args.find(e=>e.name===i)&&Dy(r)&&e.reportError(`Object field ${t.name}.${u} includes required argument ${i} that is missing from the Interface field ${n.name}.${u}.`,[r.astNode,c.astNode])}}else e.reportError(`Interface field ${n.name}.${u} expected but ${t.name} does not provide it.`,[c.astNode,t.astNode,...t.extensionASTNodes])}}function Lv(e,t,n){const r=t.getInterfaces();for(const i of n.getInterfaces())r.includes(i)||e.reportError(i===t?`Type ${t.name} cannot implement ${n.name} because it would create a circular reference.`:`Type ${t.name} must implement ${i.name} because it is implemented by ${n.name}.`,[...Bv(n,i),...Bv(t,n)])}function $v(e,t){const n=t.getTypes();0===n.length&&e.reportError(`Union type ${t.name} must define one or more member types.`,[t.astNode,...t.extensionASTNodes]);const r=Object.create(null);for(const i of n)r[i.name]?e.reportError(`Union type ${t.name} can only include type ${i.name} once.`,Gv(t,i.name)):(r[i.name]=!0,Xh(i)||e.reportError(`Union type ${t.name} can only include Object types, it cannot include ${uh(i)}.`,Gv(t,String(i))))}function Mv(e,t){const n=t.getValues();0===n.length&&e.reportError(`Enum type ${t.name} must define one or more values.`,[t.astNode,...t.extensionASTNodes]);for(const t of n)xv(e,t)}function Vv(e,t){const n=Object.values(t.getFields());0===n.length&&e.reportError(`Input Object type ${t.name} must define one or more fields.`,[t.astNode,...t.extensionASTNodes]);for(const o of n){var r,i;if(xv(e,o),!ay(o.type))e.reportError(`The type of ${t.name}.${o.name} must be Input Type but got: ${uh(o.type)}.`,null===(r=o.astNode)||void 0===r?void 0:r.type);if($y(o)&&null!=o.deprecationReason)e.reportError(`Required input field ${t.name}.${o.name} cannot be deprecated.`,[Qv(o.astNode),null===(i=o.astNode)||void 0===i?void 0:i.type]);t.isOneOf&&Uv(t,o,e)}}function Uv(e,t,n){var r;oy(t.type)&&n.reportError(`OneOf input field ${e.name}.${t.name} must be nullable.`,null===(r=t.astNode)||void 0===r?void 0:r.type);void 0!==t.defaultValue&&n.reportError(`OneOf input field ${e.name}.${t.name} cannot have a default value.`,t.astNode)}function Bv(e,t){const{astNode:n,extensionASTNodes:r}=e;return(null!=n?[n,...r]:r).flatMap(e=>{var t;return null!==(t=e.interfaces)&&void 0!==t?t:[]}).filter(e=>e.name.value===t.name)}function Gv(e,t){const{astNode:n,extensionASTNodes:r}=e;return(null!=n?[n,...r]:r).flatMap(e=>{var t;return null!==(t=e.types)&&void 0!==t?t:[]}).filter(e=>e.name.value===t)}function Qv(e){var t;return null==e||null===(t=e.directives)||void 0===t?void 0:t.find(e=>e.name.value===rv.name)}function Yv(e,t){switch(t.kind){case kf.LIST_TYPE:{const n=Yv(e,t.type);return n&&new py(n)}case kf.NON_NULL_TYPE:{const n=Yv(e,t.type);return n&&new dy(n)}case kf.NAMED_TYPE:return e.getType(t.name.value)}}class qv{constructor(e,t,n){this._schema=e,this._typeStack=[],this._parentTypeStack=[],this._inputTypeStack=[],this._fieldDefStack=[],this._defaultValueStack=[],this._directive=null,this._argument=null,this._enumValue=null,this._getFieldDef=null!=n?n:zv,t&&(ay(t)&&this._inputTypeStack.push(t),uy(t)&&this._parentTypeStack.push(t),sy(t)&&this._typeStack.push(t))}get[Symbol.toStringTag](){return"TypeInfo"}getType(){if(this._typeStack.length>0)return this._typeStack[this._typeStack.length-1]}getParentType(){if(this._parentTypeStack.length>0)return this._parentTypeStack[this._parentTypeStack.length-1]}getInputType(){if(this._inputTypeStack.length>0)return this._inputTypeStack[this._inputTypeStack.length-1]}getParentInputType(){if(this._inputTypeStack.length>1)return this._inputTypeStack[this._inputTypeStack.length-2]}getFieldDef(){if(this._fieldDefStack.length>0)return this._fieldDefStack[this._fieldDefStack.length-1]}getDefaultValue(){if(this._defaultValueStack.length>0)return this._defaultValueStack[this._defaultValueStack.length-1]}getDirective(){return this._directive}getArgument(){return this._argument}getEnumValue(){return this._enumValue}enter(e){const t=this._schema;switch(e.kind){case kf.SELECTION_SET:{const e=gy(this.getType());this._parentTypeStack.push(uy(e)?e:void 0);break}case kf.FIELD:{const n=this.getParentType();let r,i;n&&(r=this._getFieldDef(t,n,e),r&&(i=r.type)),this._fieldDefStack.push(r),this._typeStack.push(sy(i)?i:void 0);break}case kf.DIRECTIVE:this._directive=t.getDirective(e.name.value);break;case kf.OPERATION_DEFINITION:{const n=t.getRootType(e.operation);this._typeStack.push(Xh(n)?n:void 0);break}case kf.INLINE_FRAGMENT:case kf.FRAGMENT_DEFINITION:{const n=e.typeCondition,r=n?Yv(t,n):gy(this.getType());this._typeStack.push(sy(r)?r:void 0);break}case kf.VARIABLE_DEFINITION:{const n=Yv(t,e.type);this._inputTypeStack.push(ay(n)?n:void 0);break}case kf.ARGUMENT:{var n;let t,r;const i=null!==(n=this.getDirective())&&void 0!==n?n:this.getFieldDef();i&&(t=i.args.find(t=>t.name===e.name.value),t&&(r=t.type)),this._argument=t,this._defaultValueStack.push(t?t.defaultValue:void 0),this._inputTypeStack.push(ay(r)?r:void 0);break}case kf.LIST:{const e=vy(this.getInputType()),t=iy(e)?e.ofType:e;this._defaultValueStack.push(void 0),this._inputTypeStack.push(ay(t)?t:void 0);break}case kf.OBJECT_FIELD:{const t=gy(this.getInputType());let n,r;ry(t)&&(r=t.getFields()[e.name.value],r&&(n=r.type)),this._defaultValueStack.push(r?r.defaultValue:void 0),this._inputTypeStack.push(ay(n)?n:void 0);break}case kf.ENUM:{const t=gy(this.getInputType());let n;ny(t)&&(n=t.getValue(e.value)),this._enumValue=n;break}}}leave(e){switch(e.kind){case kf.SELECTION_SET:this._parentTypeStack.pop();break;case kf.FIELD:this._fieldDefStack.pop(),this._typeStack.pop();break;case kf.DIRECTIVE:this._directive=null;break;case kf.OPERATION_DEFINITION:case kf.INLINE_FRAGMENT:case kf.FRAGMENT_DEFINITION:this._typeStack.pop();break;case kf.VARIABLE_DEFINITION:this._inputTypeStack.pop();break;case kf.ARGUMENT:this._argument=null,this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case kf.LIST:case kf.OBJECT_FIELD:this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case kf.ENUM:this._enumValue=null}}}function zv(e,t,n){const r=n.name.value;return r===Tv.name&&e.getQueryType()===t?Tv:r===bv.name&&e.getQueryType()===t?bv:r===_v.name&&uy(t)?_v:Xh(t)||Zh(t)?t.getFields()[r]:void 0}function Wv(e,t){return{enter(...n){const r=n[0];e.enter(r);const i=$h(t,r.kind).enter;if(i){const o=i.apply(t,n);return void 0!==o&&(e.leave(r),Df(o)&&e.enter(o)),o}},leave(...n){const r=n[0],i=$h(t,r.kind).leave;let o;return i&&(o=i.apply(t,n)),e.leave(r),o}}}function Jv(e){return e.kind===kf.OPERATION_DEFINITION||e.kind===kf.FRAGMENT_DEFINITION}function Kv(e){return e.kind===kf.VARIABLE||e.kind===kf.INT||e.kind===kf.FLOAT||e.kind===kf.STRING||e.kind===kf.BOOLEAN||e.kind===kf.NULL||e.kind===kf.ENUM||e.kind===kf.LIST||e.kind===kf.OBJECT}function Xv(e){return e.kind===kf.SCHEMA_DEFINITION||Hv(e)||e.kind===kf.DIRECTIVE_DEFINITION}function Hv(e){return e.kind===kf.SCALAR_TYPE_DEFINITION||e.kind===kf.OBJECT_TYPE_DEFINITION||e.kind===kf.INTERFACE_TYPE_DEFINITION||e.kind===kf.UNION_TYPE_DEFINITION||e.kind===kf.ENUM_TYPE_DEFINITION||e.kind===kf.INPUT_OBJECT_TYPE_DEFINITION}function Zv(e){return e.kind===kf.SCHEMA_EXTENSION||em(e)}function em(e){return e.kind===kf.SCALAR_TYPE_EXTENSION||e.kind===kf.OBJECT_TYPE_EXTENSION||e.kind===kf.INTERFACE_TYPE_EXTENSION||e.kind===kf.UNION_TYPE_EXTENSION||e.kind===kf.ENUM_TYPE_EXTENSION||e.kind===kf.INPUT_OBJECT_TYPE_EXTENSION}function tm(e){return{Document(t){for(const n of t.definitions)if(!Jv(n)){const t=n.kind===kf.SCHEMA_DEFINITION||n.kind===kf.SCHEMA_EXTENSION?"schema":'"'+n.name.value+'"';e.reportError(new _f(`The ${t} definition is not executable.`,{nodes:n}))}return!1}}}function nm(e){return{Field(t){const n=e.getParentType();if(n){if(!e.getFieldDef()){const r=e.getSchema(),i=t.name.value;let o=Eh("to use an inline fragment on",function(e,t,n){if(!ly(t))return[];const r=new Set,i=Object.create(null);for(const a of e.getPossibleTypes(t))if(a.getFields()[n]){r.add(a),i[a.name]=1;for(const e of a.getInterfaces()){var o;e.getFields()[n]&&(r.add(e),i[e.name]=(null!==(o=i[e.name])&&void 0!==o?o:0)+1)}}return[...r].sort((t,n)=>{const r=i[n.name]-i[t.name];return 0!==r?r:Zh(t)&&e.isSubType(t,n)?-1:Zh(n)&&e.isSubType(n,t)?1:Ih(t.name,n.name)}).map(e=>e.name)}(r,n,i));""===o&&(o=Eh(function(e,t){if(Xh(e)||Zh(e)){return Sh(t,Object.keys(e.getFields()))}return[]}(n,i))),e.reportError(new _f(`Cannot query field "${i}" on type "${n.name}".`+o,{nodes:t}))}}}}}function rm(e){return{InlineFragment(t){const n=t.typeCondition;if(n){const t=Yv(e.getSchema(),n);if(t&&!uy(t)){const t=Mh(n);e.reportError(new _f(`Fragment cannot condition on non composite type "${t}".`,{nodes:n}))}}},FragmentDefinition(t){const n=Yv(e.getSchema(),t.typeCondition);if(n&&!uy(n)){const n=Mh(t.typeCondition);e.reportError(new _f(`Fragment "${t.name.value}" cannot condition on non composite type "${n}".`,{nodes:t.typeCondition}))}}}}function im(e){return{...om(e),Argument(t){const n=e.getArgument(),r=e.getFieldDef(),i=e.getParentType();if(!n&&r&&i){const n=t.name.value,o=Sh(n,r.args.map(e=>e.name));e.reportError(new _f(`Unknown argument "${n}" on field "${i.name}.${r.name}".`+Eh(o),{nodes:t}))}}}}function om(e){const t=Object.create(null),n=e.getSchema(),r=n?n.getDirectives():av;for(const e of r)t[e.name]=e.args.map(e=>e.name);const i=e.getDocument().definitions;for(const e of i)if(e.kind===kf.DIRECTIVE_DEFINITION){var o;const n=null!==(o=e.arguments)&&void 0!==o?o:[];t[e.name.value]=n.map(e=>e.name.value)}return{Directive(n){const r=n.name.value,i=t[r];if(n.arguments&&i)for(const t of n.arguments){const n=t.name.value;if(!i.includes(n)){const o=Sh(n,i);e.reportError(new _f(`Unknown argument "${n}" on directive "@${r}".`+Eh(o),{nodes:t}))}}return!1}}}function am(e){const t=Object.create(null),n=e.getSchema(),r=n?n.getDirectives():av;for(const e of r)t[e.name]=e.locations;const i=e.getDocument().definitions;for(const e of i)e.kind===kf.DIRECTIVE_DEFINITION&&(t[e.name.value]=e.locations.map(e=>e.value));return{Directive(n,r,i,o,a){const s=n.name.value,c=t[s];if(!c)return void e.reportError(new _f(`Unknown directive "@${s}".`,{nodes:n}));const u=function(e){const t=e[e.length-1];switch("kind"in t||vf(!1),t.kind){case kf.OPERATION_DEFINITION:return function(e){switch(e){case Rf.QUERY:return Ff.QUERY;case Rf.MUTATION:return Ff.MUTATION;case Rf.SUBSCRIPTION:return Ff.SUBSCRIPTION}}(t.operation);case kf.FIELD:return Ff.FIELD;case kf.FRAGMENT_SPREAD:return Ff.FRAGMENT_SPREAD;case kf.INLINE_FRAGMENT:return Ff.INLINE_FRAGMENT;case kf.FRAGMENT_DEFINITION:return Ff.FRAGMENT_DEFINITION;case kf.VARIABLE_DEFINITION:return Ff.VARIABLE_DEFINITION;case kf.SCHEMA_DEFINITION:case kf.SCHEMA_EXTENSION:return Ff.SCHEMA;case kf.SCALAR_TYPE_DEFINITION:case kf.SCALAR_TYPE_EXTENSION:return Ff.SCALAR;case kf.OBJECT_TYPE_DEFINITION:case kf.OBJECT_TYPE_EXTENSION:return Ff.OBJECT;case kf.FIELD_DEFINITION:return Ff.FIELD_DEFINITION;case kf.INTERFACE_TYPE_DEFINITION:case kf.INTERFACE_TYPE_EXTENSION:return Ff.INTERFACE;case kf.UNION_TYPE_DEFINITION:case kf.UNION_TYPE_EXTENSION:return Ff.UNION;case kf.ENUM_TYPE_DEFINITION:case kf.ENUM_TYPE_EXTENSION:return Ff.ENUM;case kf.ENUM_VALUE_DEFINITION:return Ff.ENUM_VALUE;case kf.INPUT_OBJECT_TYPE_DEFINITION:case kf.INPUT_OBJECT_TYPE_EXTENSION:return Ff.INPUT_OBJECT;case kf.INPUT_VALUE_DEFINITION:{const t=e[e.length-3];return"kind"in t||vf(!1),t.kind===kf.INPUT_OBJECT_TYPE_DEFINITION?Ff.INPUT_FIELD_DEFINITION:Ff.ARGUMENT_DEFINITION}default:vf(!1,"Unexpected kind: "+uh(t.kind))}}(a);u&&!c.includes(u)&&e.reportError(new _f(`Directive "@${s}" may not be used on ${u}.`,{nodes:n}))}}}function sm(e){return{FragmentSpread(t){const n=t.name.value;e.getFragment(n)||e.reportError(new _f(`Unknown fragment "${n}".`,{nodes:t.name}))}}}function cm(e){const t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),r=Object.create(null);for(const t of e.getDocument().definitions)Hv(t)&&(r[t.name.value]=!0);const i=[...Object.keys(n),...Object.keys(r)];return{NamedType(t,o,a,s,c){const u=t.name.value;if(!n[u]&&!r[u]){var l;const n=null!==(l=c[2])&&void 0!==l?l:a,r=null!=n&&("kind"in(p=n)&&(Xv(p)||Zv(p)));if(r&&um.includes(u))return;const o=Sh(u,r?um.concat(i):i);e.reportError(new _f(`Unknown type "${u}".`+Eh(o),{nodes:t}))}var p}}}const um=[...Jy,...Nv].map(e=>e.name);function lm(e){let t=0;return{Document(e){t=e.definitions.filter(e=>e.kind===kf.OPERATION_DEFINITION).length},OperationDefinition(n){!n.name&&t>1&&e.reportError(new _f("This anonymous operation must be the only defined operation.",{nodes:n}))}}}function pm(e){var t,n,r;const i=e.getSchema(),o=null!==(t=null!==(n=null!==(r=null==i?void 0:i.astNode)&&void 0!==r?r:null==i?void 0:i.getQueryType())&&void 0!==n?n:null==i?void 0:i.getMutationType())&&void 0!==t?t:null==i?void 0:i.getSubscriptionType();let a=0;return{SchemaDefinition(t){o?e.reportError(new _f("Cannot define a new schema within a schema extension.",{nodes:t})):(a>0&&e.reportError(new _f("Must provide only one schema definition.",{nodes:t})),++a)}}}function dm(e){function t(n,r=Object.create(null),i=0){if(n.kind===kf.FRAGMENT_SPREAD){const o=n.name.value;if(!0===r[o])return!1;const a=e.getFragment(o);if(!a)return!1;try{return r[o]=!0,t(a,r,i)}finally{r[o]=void 0}}if(n.kind===kf.FIELD&&("fields"===n.name.value||"interfaces"===n.name.value||"possibleTypes"===n.name.value||"inputFields"===n.name.value)&&++i>=3)return!0;if("selectionSet"in n&&n.selectionSet)for(const e of n.selectionSet.selections)if(t(e,r,i))return!0;return!1}return{Field(n){if(("__schema"===n.name.value||"__type"===n.name.value)&&t(n))return e.reportError(new _f("Maximum introspection depth exceeded",{nodes:[n]})),!1}}}function fm(e){const t=Object.create(null),n=[],r=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition:e=>(i(e),!1)};function i(o){if(t[o.name.value])return;const a=o.name.value;t[a]=!0;const s=e.getFragmentSpreads(o.selectionSet);if(0!==s.length){r[a]=n.length;for(const t of s){const o=t.name.value,a=r[o];if(n.push(t),void 0===a){const t=e.getFragment(o);t&&i(t)}else{const t=n.slice(a),r=t.slice(0,-1).map(e=>'"'+e.name.value+'"').join(", ");e.reportError(new _f(`Cannot spread fragment "${o}" within itself`+(""!==r?` via ${r}.`:"."),{nodes:t}))}n.pop()}r[a]=void 0}}}function hm(e){let t=Object.create(null);return{OperationDefinition:{enter(){t=Object.create(null)},leave(n){const r=e.getRecursiveVariableUsages(n);for(const{node:i}of r){const r=i.name.value;!0!==t[r]&&e.reportError(new _f(n.name?`Variable "$${r}" is not defined by operation "${n.name.value}".`:`Variable "$${r}" is not defined.`,{nodes:[i,n]}))}}},VariableDefinition(e){t[e.variable.name.value]=!0}}}function ym(e){const t=[],n=[];return{OperationDefinition:e=>(t.push(e),!1),FragmentDefinition:e=>(n.push(e),!1),Document:{leave(){const r=Object.create(null);for(const n of t)for(const t of e.getRecursivelyReferencedFragments(n))r[t.name.value]=!0;for(const t of n){const n=t.name.value;!0!==r[n]&&e.reportError(new _f(`Fragment "${n}" is never used.`,{nodes:t}))}}}}}function vm(e){let t=[];return{OperationDefinition:{enter(){t=[]},leave(n){const r=Object.create(null),i=e.getRecursiveVariableUsages(n);for(const{node:e}of i)r[e.name.value]=!0;for(const i of t){const t=i.variable.name.value;!0!==r[t]&&e.reportError(new _f(n.name?`Variable "$${t}" is never used in operation "${n.name.value}".`:`Variable "$${t}" is never used.`,{nodes:i}))}}},VariableDefinition(e){t.push(e)}}}function mm(e){switch(e.kind){case kf.OBJECT:return{...e,fields:(t=e.fields,t.map(e=>({...e,value:mm(e.value)})).sort((e,t)=>Ih(e.name.value,t.name.value)))};case kf.LIST:return{...e,values:e.values.map(mm)};case kf.INT:case kf.FLOAT:case kf.STRING:case kf.BOOLEAN:case kf.NULL:case kf.ENUM:case kf.VARIABLE:return e}var t}function gm(e){return Array.isArray(e)?e.map(([e,t])=>`subfields "${e}" conflict because `+gm(t)).join(" and "):e}function Em(e){const t=new Dm,n=new Rm,r=new Map;return{SelectionSet(i){const o=function(e,t,n,r,i,o){const a=[],[s,c]=wm(e,t,i,o);if(function(e,t,n,r,i,o){for(const[a,s]of Object.entries(o))if(s.length>1)for(let o=0;o<s.length;o++)for(let c=o+1;c<s.length;c++){const u=Nm(e,n,r,i,!1,a,s[o],s[c]);u&&t.push(u)}}(e,a,t,n,r,s),0!==c.length)for(let i=0;i<c.length;i++){Tm(e,a,t,n,r,!1,s,c[i]);for(let o=i+1;o<c.length;o++)bm(e,a,t,n,r,!1,c[i],c[o])}return a}(e,r,t,n,e.getParentType(),i);for(const[[t,n],r,i]of o){const o=gm(n);e.reportError(new _f(`Fields "${t}" conflict because ${o}. Use different aliases on the fields to fetch both if this was intentional.`,{nodes:r.concat(i)}))}}}}function Tm(e,t,n,r,i,o,a,s){if(r.has(a,s,o))return;r.add(a,s,o);const c=e.getFragment(s);if(!c)return;const[u,l]=Am(e,n,c);if(a!==u){_m(e,t,n,r,i,o,a,u);for(const s of l)Tm(e,t,n,r,i,o,a,s)}}function bm(e,t,n,r,i,o,a,s){if(a===s)return;if(i.has(a,s,o))return;i.add(a,s,o);const c=e.getFragment(a),u=e.getFragment(s);if(!c||!u)return;const[l,p]=Am(e,n,c),[d,f]=Am(e,n,u);_m(e,t,n,r,i,o,l,d);for(const s of f)bm(e,t,n,r,i,o,a,s);for(const a of p)bm(e,t,n,r,i,o,a,s)}function _m(e,t,n,r,i,o,a,s){for(const[c,u]of Object.entries(a)){const a=s[c];if(a)for(const s of u)for(const u of a){const a=Nm(e,n,r,i,o,c,s,u);a&&t.push(a)}}}function Nm(e,t,n,r,i,o,a,s){const[c,u,l]=a,[p,d,f]=s,h=i||c!==p&&Xh(c)&&Xh(p);if(!h){const e=u.name.value,t=d.name.value;if(e!==t)return[[o,`"${e}" and "${t}" are different fields`],[u],[d]];if(!function(e,t){const n=e.arguments,r=t.arguments;if(void 0===n||0===n.length)return void 0===r||0===r.length;if(void 0===r||0===r.length)return!1;if(n.length!==r.length)return!1;const i=new Map(r.map(({name:e,value:t})=>[e.value,t]));return n.every(e=>{const t=e.value,n=i.get(e.name.value);return void 0!==n&&Im(t)===Im(n)})}(u,d))return[[o,"they have differing arguments"],[u],[d]]}const y=null==l?void 0:l.type,v=null==f?void 0:f.type;if(y&&v&&Om(y,v))return[[o,`they return conflicting types "${uh(y)}" and "${uh(v)}"`],[u],[d]];const m=u.selectionSet,g=d.selectionSet;if(m&&g){const i=function(e,t,n,r,i,o,a,s,c){const u=[],[l,p]=wm(e,t,o,a),[d,f]=wm(e,t,s,c);_m(e,u,t,n,r,i,l,d);for(const o of f)Tm(e,u,t,n,r,i,l,o);for(const o of p)Tm(e,u,t,n,r,i,d,o);for(const o of p)for(const a of f)bm(e,u,t,n,r,i,o,a);return u}(e,t,n,r,h,gy(y),m,gy(v),g);return function(e,t,n,r){if(e.length>0)return[[t,e.map(([e])=>e)],[n,...e.map(([,e])=>e).flat()],[r,...e.map(([,,e])=>e).flat()]]}(i,o,u,d)}}function Im(e){return Mh(mm(e))}function Om(e,t){return iy(e)?!iy(t)||Om(e.ofType,t.ofType):!!iy(t)||(oy(e)?!oy(t)||Om(e.ofType,t.ofType):!!oy(t)||!(!cy(e)&&!cy(t))&&e!==t)}function wm(e,t,n,r){const i=t.get(r);if(i)return i;const o=Object.create(null),a=Object.create(null);Sm(e,n,r,o,a);const s=[o,Object.keys(a)];return t.set(r,s),s}function Am(e,t,n){const r=t.get(n.selectionSet);if(r)return r;const i=Yv(e.getSchema(),n.typeCondition);return wm(e,t,i,n.selectionSet)}function Sm(e,t,n,r,i){for(const o of n.selections)switch(o.kind){case kf.FIELD:{const e=o.name.value;let n;(Xh(t)||Zh(t))&&(n=t.getFields()[e]);const i=o.alias?o.alias.value:e;r[i]||(r[i]=[]),r[i].push([t,o,n]);break}case kf.FRAGMENT_SPREAD:i[o.name.value]=!0;break;case kf.INLINE_FRAGMENT:{const n=o.typeCondition,a=n?Yv(e.getSchema(),n):t;Sm(e,a,o.selectionSet,r,i);break}}}class Dm{constructor(){this._data=new Map}has(e,t,n){var r;const i=null===(r=this._data.get(e))||void 0===r?void 0:r.get(t);return void 0!==i&&(!!n||n===i)}add(e,t,n){const r=this._data.get(e);void 0===r?this._data.set(e,new Map([[t,n]])):r.set(t,n)}}class Rm{constructor(){this._orderedPairSet=new Dm}has(e,t,n){return e<t?this._orderedPairSet.has(e,t,n):this._orderedPairSet.has(t,e,n)}add(e,t,n){e<t?this._orderedPairSet.add(e,t,n):this._orderedPairSet.add(t,e,n)}}function Fm(e){return{InlineFragment(t){const n=e.getType(),r=e.getParentType();if(uy(n)&&uy(r)&&!Uy(e.getSchema(),n,r)){const i=uh(r),o=uh(n);e.reportError(new _f(`Fragment cannot be spread here as objects of type "${i}" can never be of type "${o}".`,{nodes:t}))}},FragmentSpread(t){const n=t.name.value,r=function(e,t){const n=e.getFragment(t);if(n){const t=Yv(e.getSchema(),n.typeCondition);if(uy(t))return t}}(e,n),i=e.getParentType();if(r&&i&&!Uy(e.getSchema(),r,i)){const o=uh(i),a=uh(r);e.reportError(new _f(`Fragment "${n}" cannot be spread here as objects of type "${o}" can never be of type "${a}".`,{nodes:t}))}}}}function km(e){const t=e.getSchema(),n=Object.create(null);for(const t of e.getDocument().definitions)Hv(t)&&(n[t.name.value]=t);return{ScalarTypeExtension:r,ObjectTypeExtension:r,InterfaceTypeExtension:r,UnionTypeExtension:r,EnumTypeExtension:r,InputObjectTypeExtension:r};function r(r){const i=r.name.value,o=n[i],a=null==t?void 0:t.getType(i);let s;if(o?s=xm[o.kind]:a&&(s=function(e){if(Kh(e))return kf.SCALAR_TYPE_EXTENSION;if(Xh(e))return kf.OBJECT_TYPE_EXTENSION;if(Zh(e))return kf.INTERFACE_TYPE_EXTENSION;if(ty(e))return kf.UNION_TYPE_EXTENSION;if(ny(e))return kf.ENUM_TYPE_EXTENSION;if(ry(e))return kf.INPUT_OBJECT_TYPE_EXTENSION;vf(!1,"Unexpected type: "+uh(e))}(a)),s){if(s!==r.kind){const t=function(e){switch(e){case kf.SCALAR_TYPE_EXTENSION:return"scalar";case kf.OBJECT_TYPE_EXTENSION:return"object";case kf.INTERFACE_TYPE_EXTENSION:return"interface";case kf.UNION_TYPE_EXTENSION:return"union";case kf.ENUM_TYPE_EXTENSION:return"enum";case kf.INPUT_OBJECT_TYPE_EXTENSION:return"input object";default:vf(!1,"Unexpected kind: "+uh(e))}}(r.kind);e.reportError(new _f(`Cannot extend non-${t} type "${i}".`,{nodes:o?[o,r]:r}))}}else{const o=Sh(i,Object.keys({...n,...null==t?void 0:t.getTypeMap()}));e.reportError(new _f(`Cannot extend type "${i}" because it is not defined.`+Eh(o),{nodes:r.name}))}}}const xm={[kf.SCALAR_TYPE_DEFINITION]:kf.SCALAR_TYPE_EXTENSION,[kf.OBJECT_TYPE_DEFINITION]:kf.OBJECT_TYPE_EXTENSION,[kf.INTERFACE_TYPE_DEFINITION]:kf.INTERFACE_TYPE_EXTENSION,[kf.UNION_TYPE_DEFINITION]:kf.UNION_TYPE_EXTENSION,[kf.ENUM_TYPE_DEFINITION]:kf.ENUM_TYPE_EXTENSION,[kf.INPUT_OBJECT_TYPE_DEFINITION]:kf.INPUT_OBJECT_TYPE_EXTENSION};function jm(e){return{...Cm(e),Field:{leave(t){var n;const r=e.getFieldDef();if(!r)return!1;const i=new Set(null===(n=t.arguments)||void 0===n?void 0:n.map(e=>e.name.value));for(const n of r.args)if(!i.has(n.name)&&Dy(n)){const i=uh(n.type);e.reportError(new _f(`Field "${r.name}" argument "${n.name}" of type "${i}" is required, but it was not provided.`,{nodes:t}))}}}}}function Cm(e){var t;const n=Object.create(null),r=e.getSchema(),i=null!==(t=null==r?void 0:r.getDirectives())&&void 0!==t?t:av;for(const e of i)n[e.name]=bh(e.args.filter(Dy),e=>e.name);const o=e.getDocument().definitions;for(const e of o)if(e.kind===kf.DIRECTIVE_DEFINITION){var a;const t=null!==(a=e.arguments)&&void 0!==a?a:[];n[e.name.value]=bh(t.filter(Pm),e=>e.name.value)}return{Directive:{leave(t){const r=t.name.value,i=n[r];if(i){var o;const n=null!==(o=t.arguments)&&void 0!==o?o:[],a=new Set(n.map(e=>e.name.value));for(const[n,o]of Object.entries(i))if(!a.has(n)){const i=Jh(o.type)?uh(o.type):Mh(o.type);e.reportError(new _f(`Directive "@${r}" argument "${n}" of type "${i}" is required, but it was not provided.`,{nodes:t}))}}}}}}function Pm(e){return e.type.kind===kf.NON_NULL_TYPE&&null==e.defaultValue}function Lm(e){return{Field(t){const n=e.getType(),r=t.selectionSet;if(n)if(cy(gy(n))){if(r){const i=t.name.value,o=uh(n);e.reportError(new _f(`Field "${i}" must not have a selection since type "${o}" has no subfields.`,{nodes:r}))}}else if(r){if(0===r.selections.length){const r=t.name.value,i=uh(n);e.reportError(new _f(`Field "${r}" of type "${i}" must have at least one field selected.`,{nodes:t}))}}else{const r=t.name.value,i=uh(n);e.reportError(new _f(`Field "${r}" of type "${i}" must have a selection of subfields. Did you mean "${r} { ... }"?`,{nodes:t}))}}}}function $m(e){return e.map(e=>"number"==typeof e?"["+e.toString()+"]":"."+e).join("")}function Mm(e,t,n){return{prev:e,key:t,typename:n}}function Vm(e){const t=[];let n=e;for(;n;)t.push(n.key),n=n.prev;return t.reverse()}function Um(e,t,n=Bm){return Gm(e,t,n,void 0)}function Bm(e,t,n){let r="Invalid value "+uh(t);throw e.length>0&&(r+=` at "value${$m(e)}"`),n.message=r+": "+n.message,n}function Gm(e,t,n,r){if(oy(t))return null!=e?Gm(e,t.ofType,n,r):void n(Vm(r),e,new _f(`Expected non-nullable type "${uh(t)}" not to be null.`));if(null==e)return null;if(iy(t)){const i=t.ofType;return cv(e)?Array.from(e,(e,t)=>{const o=Mm(r,t,void 0);return Gm(e,i,n,o)}):[Gm(e,i,n,r)]}if(ry(t)){if(!yf(e)||Array.isArray(e))return void n(Vm(r),e,new _f(`Expected type "${t.name}" to be an object.`));const i={},o=t.getFields();for(const a of Object.values(o)){const o=e[a.name];if(void 0!==o)i[a.name]=Gm(o,a.type,n,Mm(r,a.name,t.name));else if(void 0!==a.defaultValue)i[a.name]=a.defaultValue;else if(oy(a.type)){const t=uh(a.type);n(Vm(r),e,new _f(`Field "${a.name}" of required type "${t}" was not provided.`))}}for(const i of Object.keys(e))if(!o[i]){const o=Sh(i,Object.keys(t.getFields()));n(Vm(r),e,new _f(`Field "${i}" is not defined by type "${t.name}".`+Eh(o)))}if(t.isOneOf){const o=Object.keys(i);1!==o.length&&n(Vm(r),e,new _f(`Exactly one key must be specified for OneOf type "${t.name}".`));const a=o[0],s=i[a];null===s&&n(Vm(r).concat(a),s,new _f(`Field "${a}" must be non-null.`))}return i}if(cy(t)){let i;try{i=t.parseValue(e)}catch(i){return void n(Vm(r),e,i instanceof _f?i:new _f(`Expected type "${t.name}". `+i.message,{originalError:i}))}return void 0===i&&n(Vm(r),e,new _f(`Expected type "${t.name}".`)),i}vf(!1,"Unexpected input type: "+uh(t))}function Qm(e,t,n){if(e){if(e.kind===kf.VARIABLE){const r=e.name.value;if(null==n||void 0===n[r])return;const i=n[r];if(null===i&&oy(t))return;return i}if(oy(t)){if(e.kind===kf.NULL)return;return Qm(e,t.ofType,n)}if(e.kind===kf.NULL)return null;if(iy(t)){const r=t.ofType;if(e.kind===kf.LIST){const t=[];for(const i of e.values)if(Ym(i,n)){if(oy(r))return;t.push(null)}else{const e=Qm(i,r,n);if(void 0===e)return;t.push(e)}return t}const i=Qm(e,r,n);if(void 0===i)return;return[i]}if(ry(t)){if(e.kind!==kf.OBJECT)return;const r=Object.create(null),i=bh(e.fields,e=>e.name.value);for(const e of Object.values(t.getFields())){const t=i[e.name];if(!t||Ym(t.value,n)){if(void 0!==e.defaultValue)r[e.name]=e.defaultValue;else if(oy(e.type))return;continue}const o=Qm(t.value,e.type,n);if(void 0===o)return;r[e.name]=o}if(t.isOneOf){const e=Object.keys(r);if(1!==e.length)return;if(null===r[e[0]])return}return r}if(cy(t)){let r;try{r=t.parseLiteral(e,n)}catch(e){return}if(void 0===r)return;return r}vf(!1,"Unexpected input type: "+uh(t))}}function Ym(e,t){return e.kind===kf.VARIABLE&&(null==t||void 0===t[e.name.value])}function qm(e,t,n,r){const i=[],o=null==r?void 0:r.maxErrors;try{const r=function(e,t,n,r){const i={};for(const o of t){const t=o.variable.name.value,a=Yv(e,o.type);if(!ay(a)){const e=Mh(o.type);r(new _f(`Variable "$${t}" expected value of type "${e}" which cannot be used as an input type.`,{nodes:o.type}));continue}if(!Jm(n,t)){if(o.defaultValue)i[t]=Qm(o.defaultValue,a);else if(oy(a)){const e=uh(a);r(new _f(`Variable "$${t}" of required type "${e}" was not provided.`,{nodes:o}))}continue}const s=n[t];if(null===s&&oy(a)){const e=uh(a);r(new _f(`Variable "$${t}" of non-null type "${e}" must not be null.`,{nodes:o}));continue}i[t]=Um(s,a,(e,n,i)=>{let a=`Variable "$${t}" got invalid value `+uh(n);e.length>0&&(a+=` at "${t}${$m(e)}"`),r(new _f(a+"; "+i.message,{nodes:o,originalError:i}))})}return i}(e,t,n,e=>{if(null!=o&&i.length>=o)throw new _f("Too many errors processing variables, error limit reached. Execution aborted.");i.push(e)});if(0===i.length)return{coerced:r}}catch(e){i.push(e)}return{errors:i}}function zm(e,t,n){var r;const i={},o=bh(null!==(r=t.arguments)&&void 0!==r?r:[],e=>e.name.value);for(const r of e.args){const e=r.name,a=r.type,s=o[e];if(!s){if(void 0!==r.defaultValue)i[e]=r.defaultValue;else if(oy(a))throw new _f(`Argument "${e}" of required type "${uh(a)}" was not provided.`,{nodes:t});continue}const c=s.value;let u=c.kind===kf.NULL;if(c.kind===kf.VARIABLE){const t=c.name.value;if(null==n||!Jm(n,t)){if(void 0!==r.defaultValue)i[e]=r.defaultValue;else if(oy(a))throw new _f(`Argument "${e}" of required type "${uh(a)}" was provided the variable "$${t}" which was not provided a runtime value.`,{nodes:c});continue}u=null==n[t]}if(u&&oy(a))throw new _f(`Argument "${e}" of non-null type "${uh(a)}" must not be null.`,{nodes:c});const l=Qm(c,a,n);if(void 0===l)throw new _f(`Argument "${e}" has invalid value ${Mh(c)}.`,{nodes:c});i[e]=l}return i}function Wm(e,t,n){var r;const i=null===(r=t.directives)||void 0===r?void 0:r.find(t=>t.name.value===e.name);if(i)return zm(e,i,n)}function Jm(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Km(e,t,n,r,i){const o=new Map;return Xm(e,t,n,r,i,o,new Set),o}function Xm(e,t,n,r,i,o,a){for(const s of i.selections)switch(s.kind){case kf.FIELD:{if(!Hm(n,s))continue;const e=eg(s),t=o.get(e);void 0!==t?t.push(s):o.set(e,[s]);break}case kf.INLINE_FRAGMENT:if(!Hm(n,s)||!Zm(e,s,r))continue;Xm(e,t,n,r,s.selectionSet,o,a);break;case kf.FRAGMENT_SPREAD:{const i=s.name.value;if(a.has(i)||!Hm(n,s))continue;a.add(i);const c=t[i];if(!c||!Zm(e,c,r))continue;Xm(e,t,n,r,c.selectionSet,o,a);break}}}function Hm(e,t){const n=Wm(tv,t,e);if(!0===(null==n?void 0:n.if))return!1;const r=Wm(ev,t,e);return!1!==(null==r?void 0:r.if)}function Zm(e,t,n){const r=t.typeCondition;if(!r)return!0;const i=Yv(e,r);return i===n||!!ly(i)&&e.isSubType(i,n)}function eg(e){return e.alias?e.alias.value:e.name.value}function tg(e){return{OperationDefinition(t){if("subscription"===t.operation){const n=e.getSchema(),r=n.getSubscriptionType();if(r){const i=t.name?t.name.value:null,o=Object.create(null),a=e.getDocument(),s=Object.create(null);for(const e of a.definitions)e.kind===kf.FRAGMENT_DEFINITION&&(s[e.name.value]=e);const c=Km(n,s,o,r,t.selectionSet);if(c.size>1){const t=[...c.values()].slice(1).flat();e.reportError(new _f(null!=i?`Subscription "${i}" must select only one top level field.`:"Anonymous Subscription must select only one top level field.",{nodes:t}))}for(const t of c.values()){t[0].name.value.startsWith("__")&&e.reportError(new _f(null!=i?`Subscription "${i}" must not select an introspection top level field.`:"Anonymous Subscription must not select an introspection top level field.",{nodes:t}))}}}}}}function ng(e,t){const n=new Map;for(const r of e){const e=t(r),i=n.get(e);void 0===i?n.set(e,[r]):i.push(r)}return n}function rg(e){return{DirectiveDefinition(e){var t;const r=null!==(t=e.arguments)&&void 0!==t?t:[];return n(`@${e.name.value}`,r)},InterfaceTypeDefinition:t,InterfaceTypeExtension:t,ObjectTypeDefinition:t,ObjectTypeExtension:t};function t(e){var t;const r=e.name.value,i=null!==(t=e.fields)&&void 0!==t?t:[];for(const e of i){var o;n(`${r}.${e.name.value}`,null!==(o=e.arguments)&&void 0!==o?o:[])}return!1}function n(t,n){const r=ng(n,e=>e.name.value);for(const[n,i]of r)i.length>1&&e.reportError(new _f(`Argument "${t}(${n}:)" can only be defined once.`,{nodes:i.map(e=>e.name)}));return!1}}function ig(e){return{Field:t,Directive:t};function t(t){var n;const r=ng(null!==(n=t.arguments)&&void 0!==n?n:[],e=>e.name.value);for(const[t,n]of r)n.length>1&&e.reportError(new _f(`There can be only one argument named "${t}".`,{nodes:n.map(e=>e.name)}))}}function og(e){const t=Object.create(null),n=e.getSchema();return{DirectiveDefinition(r){const i=r.name.value;if(null==n||!n.getDirective(i))return t[i]?e.reportError(new _f(`There can be only one directive named "@${i}".`,{nodes:[t[i],r.name]})):t[i]=r.name,!1;e.reportError(new _f(`Directive "@${i}" already exists in the schema. It cannot be redefined.`,{nodes:r.name}))}}}function ag(e){const t=Object.create(null),n=e.getSchema(),r=n?n.getDirectives():av;for(const e of r)t[e.name]=!e.isRepeatable;const i=e.getDocument().definitions;for(const e of i)e.kind===kf.DIRECTIVE_DEFINITION&&(t[e.name.value]=!e.repeatable);const o=Object.create(null),a=Object.create(null);return{enter(n){if(!("directives"in n)||!n.directives)return;let r;if(n.kind===kf.SCHEMA_DEFINITION||n.kind===kf.SCHEMA_EXTENSION)r=o;else if(Hv(n)||em(n)){const e=n.name.value;r=a[e],void 0===r&&(a[e]=r=Object.create(null))}else r=Object.create(null);for(const i of n.directives){const n=i.name.value;t[n]&&(r[n]?e.reportError(new _f(`The directive "@${n}" can only be used once at this location.`,{nodes:[r[n],i]})):r[n]=i)}}}}function sg(e){const t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),r=Object.create(null);return{EnumTypeDefinition:i,EnumTypeExtension:i};function i(t){var i;const o=t.name.value;r[o]||(r[o]=Object.create(null));const a=null!==(i=t.values)&&void 0!==i?i:[],s=r[o];for(const t of a){const r=t.name.value,i=n[o];ny(i)&&i.getValue(r)?e.reportError(new _f(`Enum value "${o}.${r}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:t.name})):s[r]?e.reportError(new _f(`Enum value "${o}.${r}" can only be defined once.`,{nodes:[s[r],t.name]})):s[r]=t.name}return!1}}function cg(e){const t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),r=Object.create(null);return{InputObjectTypeDefinition:i,InputObjectTypeExtension:i,InterfaceTypeDefinition:i,InterfaceTypeExtension:i,ObjectTypeDefinition:i,ObjectTypeExtension:i};function i(t){var i;const o=t.name.value;r[o]||(r[o]=Object.create(null));const a=null!==(i=t.fields)&&void 0!==i?i:[],s=r[o];for(const t of a){const r=t.name.value;ug(n[o],r)?e.reportError(new _f(`Field "${o}.${r}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:t.name})):s[r]?e.reportError(new _f(`Field "${o}.${r}" can only be defined once.`,{nodes:[s[r],t.name]})):s[r]=t.name}return!1}}function ug(e,t){return!!(Xh(e)||Zh(e)||ry(e))&&null!=e.getFields()[t]}function lg(e){const t=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition(n){const r=n.name.value;return t[r]?e.reportError(new _f(`There can be only one fragment named "${r}".`,{nodes:[t[r],n.name]})):t[r]=n.name,!1}}}function pg(e){const t=[];let n=Object.create(null);return{ObjectValue:{enter(){t.push(n),n=Object.create(null)},leave(){const e=t.pop();e||vf(!1),n=e}},ObjectField(t){const r=t.name.value;n[r]?e.reportError(new _f(`There can be only one input field named "${r}".`,{nodes:[n[r],t.name]})):n[r]=t.name}}}function dg(e){const t=Object.create(null);return{OperationDefinition(n){const r=n.name;return r&&(t[r.value]?e.reportError(new _f(`There can be only one operation named "${r.value}".`,{nodes:[t[r.value],r]})):t[r.value]=r),!1},FragmentDefinition:()=>!1}}function fg(e){const t=e.getSchema(),n=Object.create(null),r=t?{query:t.getQueryType(),mutation:t.getMutationType(),subscription:t.getSubscriptionType()}:{};return{SchemaDefinition:i,SchemaExtension:i};function i(t){var i;const o=null!==(i=t.operationTypes)&&void 0!==i?i:[];for(const t of o){const i=t.operation,o=n[i];r[i]?e.reportError(new _f(`Type for ${i} already defined in the schema. It cannot be redefined.`,{nodes:t})):o?e.reportError(new _f(`There can be only one ${i} type in schema.`,{nodes:[o,t]})):n[i]=t}return!1}}function hg(e){const t=Object.create(null),n=e.getSchema();return{ScalarTypeDefinition:r,ObjectTypeDefinition:r,InterfaceTypeDefinition:r,UnionTypeDefinition:r,EnumTypeDefinition:r,InputObjectTypeDefinition:r};function r(r){const i=r.name.value;if(null==n||!n.getType(i))return t[i]?e.reportError(new _f(`There can be only one type named "${i}".`,{nodes:[t[i],r.name]})):t[i]=r.name,!1;e.reportError(new _f(`Type "${i}" already exists in the schema. It cannot also be defined in this type definition.`,{nodes:r.name}))}}function yg(e){return{OperationDefinition(t){var n;const r=ng(null!==(n=t.variableDefinitions)&&void 0!==n?n:[],e=>e.variable.name.value);for(const[t,n]of r)n.length>1&&e.reportError(new _f(`There can be only one variable named "$${t}".`,{nodes:n.map(e=>e.variable.name)}))}}}function vg(e){let t={};return{OperationDefinition:{enter(){t={}}},VariableDefinition(e){t[e.variable.name.value]=e},ListValue(t){if(!iy(vy(e.getParentInputType())))return mg(e,t),!1},ObjectValue(n){const r=gy(e.getInputType());if(!ry(r))return mg(e,n),!1;const i=bh(n.fields,e=>e.name.value);for(const t of Object.values(r.getFields())){if(!i[t.name]&&$y(t)){const i=uh(t.type);e.reportError(new _f(`Field "${r.name}.${t.name}" of required type "${i}" was not provided.`,{nodes:n}))}}r.isOneOf&&function(e,t,n,r,i){var o;const a=Object.keys(r),s=1!==a.length;if(s)return void e.reportError(new _f(`OneOf Input Object "${n.name}" must specify exactly one key.`,{nodes:[t]}));const c=null===(o=r[a[0]])||void 0===o?void 0:o.value,u=!c||c.kind===kf.NULL,l=(null==c?void 0:c.kind)===kf.VARIABLE;if(u)return void e.reportError(new _f(`Field "${n.name}.${a[0]}" must be non-null.`,{nodes:[t]}));if(l){const r=c.name.value;i[r].type.kind!==kf.NON_NULL_TYPE&&e.reportError(new _f(`Variable "${r}" must be non-nullable to be used for OneOf Input Object "${n.name}".`,{nodes:[t]}))}}(e,n,r,i,t)},ObjectField(t){const n=gy(e.getParentInputType());if(!e.getInputType()&&ry(n)){const r=Sh(t.name.value,Object.keys(n.getFields()));e.reportError(new _f(`Field "${t.name.value}" is not defined by type "${n.name}".`+Eh(r),{nodes:t}))}},NullValue(t){const n=e.getInputType();oy(n)&&e.reportError(new _f(`Expected value of type "${uh(n)}", found ${Mh(t)}.`,{nodes:t}))},EnumValue:t=>mg(e,t),IntValue:t=>mg(e,t),FloatValue:t=>mg(e,t),StringValue:t=>mg(e,t),BooleanValue:t=>mg(e,t)}}function mg(e,t){const n=e.getInputType();if(!n)return;const r=gy(n);if(!cy(r)){const r=uh(n);return void e.reportError(new _f(`Expected value of type "${r}", found ${Mh(t)}.`,{nodes:t}))}try{if(void 0===r.parseLiteral(t,void 0)){const r=uh(n);e.reportError(new _f(`Expected value of type "${r}", found ${Mh(t)}.`,{nodes:t}))}}catch(r){const i=uh(n);r instanceof _f?e.reportError(r):e.reportError(new _f(`Expected value of type "${i}", found ${Mh(t)}; `+r.message,{nodes:t,originalError:r}))}}function gg(e){return{VariableDefinition(t){const n=Yv(e.getSchema(),t.type);if(void 0!==n&&!ay(n)){const n=t.variable.name.value,r=Mh(t.type);e.reportError(new _f(`Variable "$${n}" cannot be non-input type "${r}".`,{nodes:t.type}))}}}}function Eg(e){let t=Object.create(null);return{OperationDefinition:{enter(){t=Object.create(null)},leave(n){const r=e.getRecursiveVariableUsages(n);for(const{node:n,type:i,defaultValue:o,parentType:a}of r){const r=n.name.value,s=t[r];if(s&&i){const t=e.getSchema(),c=Yv(t,s.type);if(c&&!Tg(t,c,s.defaultValue,i,o)){const t=uh(c),o=uh(i);e.reportError(new _f(`Variable "$${r}" of type "${t}" used in position expecting type "${o}".`,{nodes:[s,n]}))}ry(a)&&a.isOneOf&&hy(c)&&e.reportError(new _f(`Variable "$${r}" is of type "${c}" but must be non-nullable to be used for OneOf Input Object "${a}".`,{nodes:[s,n]}))}}}},VariableDefinition(e){t[e.variable.name.value]=e}}}function Tg(e,t,n,r,i){if(oy(r)&&!oy(t)){if(!(null!=n&&n.kind!==kf.NULL)&&!(void 0!==i))return!1;return Vy(e,t,r.ofType)}return Vy(e,t,r)}const bg=Object.freeze([dm]),_g=Object.freeze([tm,dg,lm,tg,cm,rm,gg,Lm,nm,lg,sm,ym,Fm,fm,yg,hm,vm,am,ag,im,ig,vg,jm,Eg,Em,pg,...bg]),Ng=Object.freeze([pm,fg,hg,sg,cg,rg,og,cm,am,ag,km,om,ig,pg,Cm]);class Ig{constructor(e,t){this._ast=e,this._fragments=void 0,this._fragmentSpreads=new Map,this._recursivelyReferencedFragments=new Map,this._onError=t}get[Symbol.toStringTag](){return"ASTValidationContext"}reportError(e){this._onError(e)}getDocument(){return this._ast}getFragment(e){let t;if(this._fragments)t=this._fragments;else{t=Object.create(null);for(const e of this.getDocument().definitions)e.kind===kf.FRAGMENT_DEFINITION&&(t[e.name.value]=e);this._fragments=t}return t[e]}getFragmentSpreads(e){let t=this._fragmentSpreads.get(e);if(!t){t=[];const n=[e];let r;for(;r=n.pop();)for(const e of r.selections)e.kind===kf.FRAGMENT_SPREAD?t.push(e):e.selectionSet&&n.push(e.selectionSet);this._fragmentSpreads.set(e,t)}return t}getRecursivelyReferencedFragments(e){let t=this._recursivelyReferencedFragments.get(e);if(!t){t=[];const n=Object.create(null),r=[e.selectionSet];let i;for(;i=r.pop();)for(const e of this.getFragmentSpreads(i)){const i=e.name.value;if(!0!==n[i]){n[i]=!0;const e=this.getFragment(i);e&&(t.push(e),r.push(e.selectionSet))}}this._recursivelyReferencedFragments.set(e,t)}return t}}class Og extends Ig{constructor(e,t,n){super(e,n),this._schema=t}get[Symbol.toStringTag](){return"SDLValidationContext"}getSchema(){return this._schema}}class wg extends Ig{constructor(e,t,n,r){super(t,r),this._schema=e,this._typeInfo=n,this._variableUsages=new Map,this._recursiveVariableUsages=new Map}get[Symbol.toStringTag](){return"ValidationContext"}getSchema(){return this._schema}getVariableUsages(e){let t=this._variableUsages.get(e);if(!t){const n=[],r=new qv(this._schema);Ph(e,Wv(r,{VariableDefinition:()=>!1,Variable(e){n.push({node:e,type:r.getInputType(),defaultValue:r.getDefaultValue(),parentType:r.getParentInputType()})}})),t=n,this._variableUsages.set(e,t)}return t}getRecursiveVariableUsages(e){let t=this._recursiveVariableUsages.get(e);if(!t){t=this.getVariableUsages(e);for(const n of this.getRecursivelyReferencedFragments(e))t=t.concat(this.getVariableUsages(n));this._recursiveVariableUsages.set(e,t)}return t}getType(){return this._typeInfo.getType()}getParentType(){return this._typeInfo.getParentType()}getInputType(){return this._typeInfo.getInputType()}getParentInputType(){return this._typeInfo.getParentInputType()}getFieldDef(){return this._typeInfo.getFieldDef()}getDirective(){return this._typeInfo.getDirective()}getArgument(){return this._typeInfo.getArgument()}getEnumValue(){return this._typeInfo.getEnumValue()}}function Ag(e,t,n=_g,r,i=new qv(e)){var o;const a=null!==(o=null==r?void 0:r.maxErrors)&&void 0!==o?o:100;t||ff(!1,"Must provide document."),Rv(e);const s=Object.freeze({}),c=[],u=new wg(e,t,i,e=>{if(c.length>=a)throw c.push(new _f("Too many validation errors, error limit reached. Validation aborted.")),s;c.push(e)}),l=Lh(n.map(e=>e(u)));try{Ph(t,Wv(i,l))}catch(e){if(e!==s)throw e}return c}function Sg(e,t,n=Ng){const r=[],i=new Og(e,t,e=>{r.push(e)});return Ph(e,Lh(n.map(e=>e(i)))),r}function Dg(e){return Promise.all(Object.values(e)).then(t=>{const n=Object.create(null);for(const[r,i]of Object.keys(e).entries())n[i]=t[r];return n})}class Rg extends Error{constructor(e){super("Unexpected error value: "+uh(e)),this.name="NonErrorThrown",this.thrownValue=e}}function Fg(e,t,n){var r;const i=(o=e)instanceof Error?o:new Rg(o);var o,a;return a=i,Array.isArray(a.path)?i:new _f(i.message,{nodes:null!==(r=i.nodes)&&void 0!==r?r:t,source:i.source,positions:i.positions,path:n,originalError:i})}const kg=function(e){let t;return function(n,r,i){void 0===t&&(t=new WeakMap);let o=t.get(n);void 0===o&&(o=new WeakMap,t.set(n,o));let a=o.get(r);void 0===a&&(a=new WeakMap,o.set(r,a));let s=a.get(i);return void 0===s&&(s=e(n,r,i),a.set(i,s)),s}}((e,t,n)=>function(e,t,n,r,i){const o=new Map,a=new Set;for(const s of i)s.selectionSet&&Xm(e,t,n,r,s.selectionSet,o,a);return o}(e.schema,e.fragments,e.variableValues,t,n));function xg(e){arguments.length<2||ff(!1,"graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.");const{schema:t,document:n,variableValues:r,rootValue:i}=e;Pg(t,n,r);const o=Lg(e);if(!("schema"in o))return{errors:o};try{const{operation:e}=o,t=function(e,t,n){const r=e.schema.getRootType(t.operation);if(null==r)throw new _f(`Schema is not configured to execute ${t.operation} operation.`,{nodes:t});const i=Km(e.schema,e.fragments,e.variableValues,r,t.selectionSet),o=void 0;switch(t.operation){case Rf.QUERY:return $g(e,r,n,o,i);case Rf.MUTATION:return function(e,t,n,r,i){return function(e,t,n){let r=n;for(const n of e)r=hf(r)?r.then(e=>t(e,n)):t(r,n);return r}(i.entries(),(i,[o,a])=>{const s=Mm(r,o,t.name),c=Mg(e,t,n,a,s);return void 0===c?i:hf(c)?c.then(e=>(i[o]=e,i)):(i[o]=c,i)},Object.create(null))}(e,r,n,o,i);case Rf.SUBSCRIPTION:return $g(e,r,n,o,i)}}(o,e,i);return hf(t)?t.then(e=>Cg(e,o.errors),e=>(o.errors.push(e),Cg(null,o.errors))):Cg(t,o.errors)}catch(e){return o.errors.push(e),Cg(null,o.errors)}}function jg(e){const t=xg(e);if(hf(t))throw new Error("GraphQL execution failed to complete synchronously.");return t}function Cg(e,t){return 0===t.length?{data:e}:{errors:t,data:e}}function Pg(e,t,n){t||ff(!1,"Must provide document."),Rv(e),null==n||yf(n)||ff(!1,"Variables must be provided as an Object where each property is a variable value. Perhaps look to see if an unparsed JSON string was provided.")}function Lg(e){var t,n,r;const{schema:i,document:o,rootValue:a,contextValue:s,variableValues:c,operationName:u,fieldResolver:l,typeResolver:p,subscribeFieldResolver:d,options:f}=e;let h;const y=Object.create(null);for(const e of o.definitions)switch(e.kind){case kf.OPERATION_DEFINITION:if(null==u){if(void 0!==h)return[new _f("Must provide operation name if query contains multiple operations.")];h=e}else(null===(t=e.name)||void 0===t?void 0:t.value)===u&&(h=e);break;case kf.FRAGMENT_DEFINITION:y[e.name.value]=e}if(!h)return null!=u?[new _f(`Unknown operation named "${u}".`)]:[new _f("Must provide an operation.")];const v=qm(i,null!==(n=h.variableDefinitions)&&void 0!==n?n:[],null!=c?c:{},{maxErrors:null!==(r=null==f?void 0:f.maxCoercionErrors)&&void 0!==r?r:50});return v.errors?v.errors:{schema:i,fragments:y,rootValue:a,contextValue:s,operation:h,variableValues:v.coerced,fieldResolver:null!=l?l:zg,typeResolver:null!=p?p:qg,subscribeFieldResolver:null!=d?d:zg,errors:[]}}function $g(e,t,n,r,i){const o=Object.create(null);let a=!1;try{for(const[s,c]of i.entries()){const i=Mg(e,t,n,c,Mm(r,s,t.name));void 0!==i&&(o[s]=i,hf(i)&&(a=!0))}}catch(e){if(a)return Dg(o).finally(()=>{throw e});throw e}return a?Dg(o):o}function Mg(e,t,n,r,i){var o;const a=Wg(e.schema,t,r[0]);if(!a)return;const s=a.type,c=null!==(o=a.resolve)&&void 0!==o?o:e.fieldResolver,u=Vg(e,a,r,t,i);try{const t=zm(a,r[0],e.variableValues),o=c(n,t,e.contextValue,u);let l;return l=hf(o)?o.then(t=>Bg(e,s,r,u,i,t)):Bg(e,s,r,u,i,o),hf(l)?l.then(void 0,t=>Ug(Fg(t,r,Vm(i)),s,e)):l}catch(t){return Ug(Fg(t,r,Vm(i)),s,e)}}function Vg(e,t,n,r,i){return{fieldName:t.name,fieldNodes:n,returnType:t.type,parentType:r,path:i,schema:e.schema,fragments:e.fragments,rootValue:e.rootValue,operation:e.operation,variableValues:e.variableValues}}function Ug(e,t,n){if(oy(t))throw e;return n.errors.push(e),null}function Bg(e,t,n,r,i,o){if(o instanceof Error)throw o;if(oy(t)){const a=Bg(e,t.ofType,n,r,i,o);if(null===a)throw new Error(`Cannot return null for non-nullable field ${r.parentType.name}.${r.fieldName}.`);return a}return null==o?null:iy(t)?function(e,t,n,r,i,o){if(!cv(o))throw new _f(`Expected Iterable, but did not find one for field "${r.parentType.name}.${r.fieldName}".`);const a=t.ofType;let s=!1;const c=Array.from(o,(t,o)=>{const c=Mm(i,o,void 0);try{let i;return i=hf(t)?t.then(t=>Bg(e,a,n,r,c,t)):Bg(e,a,n,r,c,t),hf(i)?(s=!0,i.then(void 0,t=>Ug(Fg(t,n,Vm(c)),a,e))):i}catch(t){return Ug(Fg(t,n,Vm(c)),a,e)}});return s?Promise.all(c):c}(e,t,n,r,i,o):cy(t)?function(e,t){const n=e.serialize(t);if(null==n)throw new Error(`Expected \`${uh(e)}.serialize(${uh(t)})\` to return non-nullable value, returned: ${uh(n)}`);return n}(t,o):ly(t)?function(e,t,n,r,i,o){var a;const s=null!==(a=t.resolveType)&&void 0!==a?a:e.typeResolver,c=e.contextValue,u=s(o,c,r,t);if(hf(u))return u.then(a=>Qg(e,Gg(a,e,t,n,r,o),n,r,i,o));return Qg(e,Gg(u,e,t,n,r,o),n,r,i,o)}(e,t,n,r,i,o):Xh(t)?Qg(e,t,n,r,i,o):void vf(!1,"Cannot complete value of unexpected output type: "+uh(t))}function Gg(e,t,n,r,i,o){if(null==e)throw new _f(`Abstract type "${n.name}" must resolve to an Object type at runtime for field "${i.parentType.name}.${i.fieldName}". Either the "${n.name}" type should provide a "resolveType" function or each possible type should provide an "isTypeOf" function.`,r);if(Xh(e))throw new _f("Support for returning GraphQLObjectType from resolveType was removed in graphql-js@16.0.0 please return type name instead.");if("string"!=typeof e)throw new _f(`Abstract type "${n.name}" must resolve to an Object type at runtime for field "${i.parentType.name}.${i.fieldName}" with value ${uh(o)}, received "${uh(e)}".`);const a=t.schema.getType(e);if(null==a)throw new _f(`Abstract type "${n.name}" was resolved to a type "${e}" that does not exist inside the schema.`,{nodes:r});if(!Xh(a))throw new _f(`Abstract type "${n.name}" was resolved to a non-object type "${e}".`,{nodes:r});if(!t.schema.isSubType(n,a))throw new _f(`Runtime Object type "${a.name}" is not a possible type for "${n.name}".`,{nodes:r});return a}function Qg(e,t,n,r,i,o){const a=kg(e,t,n);if(t.isTypeOf){const s=t.isTypeOf(o,e.contextValue,r);if(hf(s))return s.then(r=>{if(!r)throw Yg(t,o,n);return $g(e,t,o,i,a)});if(!s)throw Yg(t,o,n)}return $g(e,t,o,i,a)}function Yg(e,t,n){return new _f(`Expected value of type "${e.name}" but got: ${uh(t)}.`,{nodes:n})}const qg=function(e,t,n,r){if(yf(e)&&"string"==typeof e.__typename)return e.__typename;const i=n.schema.getPossibleTypes(r),o=[];for(let r=0;r<i.length;r++){const a=i[r];if(a.isTypeOf){const i=a.isTypeOf(e,t,n);if(hf(i))o[r]=i;else if(i)return a.name}}return o.length?Promise.all(o).then(e=>{for(let t=0;t<e.length;t++)if(e[t])return i[t].name}):void 0},zg=function(e,t,n,r){if(yf(e)||"function"==typeof e){const i=e[r.fieldName];return"function"==typeof i?e[r.fieldName](t,n,r):i}};function Wg(e,t,n){const r=n.name.value;return r===Tv.name&&e.getQueryType()===t?Tv:r===bv.name&&e.getQueryType()===t?bv:r===_v.name?_v:t.getFields()[r]}function Jg(e){arguments.length<2||ff(!1,"graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.");const{schema:t,source:n,rootValue:r,contextValue:i,variableValues:o,operationName:a,fieldResolver:s,typeResolver:c}=e,u=Dv(t);if(u.length>0)return{errors:u};let l;try{l=hh(n)}catch(e){return{errors:[e]}}const p=Ag(t,l);return p.length>0?{errors:p}:xg({schema:t,document:l,rootValue:r,contextValue:i,variableValues:o,operationName:a,fieldResolver:s,typeResolver:c})}function Kg(e){return"function"==typeof(null==e?void 0:e[Symbol.asyncIterator])}async function Xg(...e){const t=function(e){const t=e[0];return t&&"document"in t?t:{schema:t,document:e[1],rootValue:e[2],contextValue:e[3],variableValues:e[4],operationName:e[5],subscribeFieldResolver:e[6]}}(e),{schema:n,document:r,variableValues:i}=t;Pg(n,r,i);const o=Lg(t);if(!("schema"in o))return{errors:o};try{const e=await async function(e){const{schema:t,fragments:n,operation:r,variableValues:i,rootValue:o}=e,a=t.getSubscriptionType();if(null==a)throw new _f("Schema is not configured to execute subscription operation.",{nodes:r});const s=Km(t,n,i,a,r.selectionSet),[c,u]=[...s.entries()][0],l=Wg(t,a,u[0]);if(!l){const e=u[0].name.value;throw new _f(`The subscription field "${e}" is not defined.`,{nodes:u})}const p=Mm(void 0,c,a.name),d=Vg(e,l,u,a,p);try{var f;const t=zm(l,u[0],i),n=e.contextValue,r=null!==(f=l.subscribe)&&void 0!==f?f:e.subscribeFieldResolver,a=await r(o,t,n,d);if(a instanceof Error)throw a;return a}catch(e){throw Fg(e,u,Vm(p))}}(o);if(!Kg(e))throw new Error(`Subscription field must return Async Iterable. Received: ${uh(e)}.`);return e}catch(e){if(e instanceof _f)return{errors:[e]};throw e}}function Hg(e){const t={descriptions:!0,specifiedByUrl:!1,directiveIsRepeatable:!1,schemaDescription:!1,inputValueDeprecation:!1,oneOf:!1,...e},n=t.descriptions?"description":"",r=t.specifiedByUrl?"specifiedByURL":"",i=t.directiveIsRepeatable?"isRepeatable":"",o=t.schemaDescription?n:"";function a(e){return t.inputValueDeprecation?e:""}const s=t.oneOf?"isOneOf":"";return`\n    query IntrospectionQuery {\n      __schema {\n        ${o}\n        queryType { name kind }\n        mutationType { name kind }\n        subscriptionType { name kind }\n        types {\n          ...FullType\n        }\n        directives {\n          name\n          ${n}\n          ${i}\n          locations\n          args${a("(includeDeprecated: true)")} {\n            ...InputValue\n          }\n        }\n      }\n    }\n\n    fragment FullType on __Type {\n      kind\n      name\n      ${n}\n      ${r}\n      ${s}\n      fields(includeDeprecated: true) {\n        name\n        ${n}\n        args${a("(includeDeprecated: true)")} {\n          ...InputValue\n        }\n        type {\n          ...TypeRef\n        }\n        isDeprecated\n        deprecationReason\n      }\n      inputFields${a("(includeDeprecated: true)")} {\n        ...InputValue\n      }\n      interfaces {\n        ...TypeRef\n      }\n      enumValues(includeDeprecated: true) {\n        name\n        ${n}\n        isDeprecated\n        deprecationReason\n      }\n      possibleTypes {\n        ...TypeRef\n      }\n    }\n\n    fragment InputValue on __InputValue {\n      name\n      ${n}\n      type { ...TypeRef }\n      defaultValue\n      ${a("isDeprecated")}\n      ${a("deprecationReason")}\n    }\n\n    fragment TypeRef on __Type {\n      kind\n      name\n      ofType {\n        kind\n        name\n        ofType {\n          kind\n          name\n          ofType {\n            kind\n            name\n            ofType {\n              kind\n              name\n              ofType {\n                kind\n                name\n                ofType {\n                  kind\n                  name\n                  ofType {\n                    kind\n                    name\n                    ofType {\n                      kind\n                      name\n                      ofType {\n                        kind\n                        name\n                      }\n                    }\n                  }\n                }\n              }\n            }\n          }\n        }\n      }\n    }\n  `}function Zg(e,t,n){var r,i,o,a;const s=[],c=Object.create(null),u=[];let l;const p=[];for(const e of t.definitions)if(e.kind===kf.SCHEMA_DEFINITION)l=e;else if(e.kind===kf.SCHEMA_EXTENSION)p.push(e);else if(Hv(e))s.push(e);else if(em(e)){const t=e.name.value,n=c[t];c[t]=n?n.concat([e]):[e]}else e.kind===kf.DIRECTIVE_DEFINITION&&u.push(e);if(0===Object.keys(c).length&&0===s.length&&0===u.length&&0===p.length&&null==l)return e;const d=Object.create(null);for(const t of e.types)d[t.name]=m(t);for(const e of s){var f;const t=e.name.value;d[t]=null!==(f=eE[t])&&void 0!==f?f:D(e)}const h={query:e.query&&v(e.query),mutation:e.mutation&&v(e.mutation),subscription:e.subscription&&v(e.subscription),...l&&T([l]),...T(p)};return{description:null===(r=l)||void 0===r||null===(i=r.description)||void 0===i?void 0:i.value,...h,types:Object.values(d),directives:[...e.directives.map(function(e){const t=e.toConfig();return new Zy({...t,args:Nh(t.args,E)})}),...u.map(function(e){var t;return new Zy({name:e.name.value,description:null===(t=e.description)||void 0===t?void 0:t.value,locations:e.locations.map(({value:e})=>e),isRepeatable:e.repeatable,args:I(e.arguments),astNode:e})})],extensions:Object.create(null),astNode:null!==(o=l)&&void 0!==o?o:e.astNode,extensionASTNodes:e.extensionASTNodes.concat(p),assumeValid:null!==(a=null==n?void 0:n.assumeValid)&&void 0!==a&&a};function y(e){return iy(e)?new py(y(e.ofType)):oy(e)?new dy(y(e.ofType)):v(e)}function v(e){return d[e.name]}function m(e){return Iv(e)||Ky(e)?e:Kh(e)?function(e){var t;const n=e.toConfig(),r=null!==(t=c[n.name])&&void 0!==t?t:[];let i=n.specifiedByURL;for(const e of r){var o;i=null!==(o=nE(e))&&void 0!==o?o:i}return new by({...n,specifiedByURL:i,extensionASTNodes:n.extensionASTNodes.concat(r)})}(e):Xh(e)?function(e){var t;const n=e.toConfig(),r=null!==(t=c[n.name])&&void 0!==t?t:[];return new _y({...n,interfaces:()=>[...e.getInterfaces().map(v),...A(r)],fields:()=>({...Nh(n.fields,g),...N(r)}),extensionASTNodes:n.extensionASTNodes.concat(r)})}(e):Zh(e)?function(e){var t;const n=e.toConfig(),r=null!==(t=c[n.name])&&void 0!==t?t:[];return new Ry({...n,interfaces:()=>[...e.getInterfaces().map(v),...A(r)],fields:()=>({...Nh(n.fields,g),...N(r)}),extensionASTNodes:n.extensionASTNodes.concat(r)})}(e):ty(e)?function(e){var t;const n=e.toConfig(),r=null!==(t=c[n.name])&&void 0!==t?t:[];return new Fy({...n,types:()=>[...e.getTypes().map(v),...S(r)],extensionASTNodes:n.extensionASTNodes.concat(r)})}(e):ny(e)?function(e){var t;const n=e.toConfig(),r=null!==(t=c[e.name])&&void 0!==t?t:[];return new xy({...n,values:{...n.values,...w(r)},extensionASTNodes:n.extensionASTNodes.concat(r)})}(e):ry(e)?function(e){var t;const n=e.toConfig(),r=null!==(t=c[n.name])&&void 0!==t?t:[];return new Py({...n,fields:()=>({...Nh(n.fields,e=>({...e,type:y(e.type)})),...O(r)}),extensionASTNodes:n.extensionASTNodes.concat(r)})}(e):void vf(!1,"Unexpected type: "+uh(e))}function g(e){return{...e,type:y(e.type),args:e.args&&Nh(e.args,E)}}function E(e){return{...e,type:y(e.type)}}function T(e){const t={};for(const r of e){var n;const e=null!==(n=r.operationTypes)&&void 0!==n?n:[];for(const n of e)t[n.operation]=b(n.type)}return t}function b(e){var t;const n=e.name.value,r=null!==(t=eE[n])&&void 0!==t?t:d[n];if(void 0===r)throw new Error(`Unknown type: "${n}".`);return r}function _(e){return e.kind===kf.LIST_TYPE?new py(_(e.type)):e.kind===kf.NON_NULL_TYPE?new dy(_(e.type)):b(e)}function N(e){const t=Object.create(null);for(const i of e){var n;const e=null!==(n=i.fields)&&void 0!==n?n:[];for(const n of e){var r;t[n.name.value]={type:_(n.type),description:null===(r=n.description)||void 0===r?void 0:r.value,args:I(n.arguments),deprecationReason:tE(n),astNode:n}}}return t}function I(e){const t=null!=e?e:[],n=Object.create(null);for(const e of t){var r;const t=_(e.type);n[e.name.value]={type:t,description:null===(r=e.description)||void 0===r?void 0:r.value,defaultValue:Qm(e.defaultValue,t),deprecationReason:tE(e),astNode:e}}return n}function O(e){const t=Object.create(null);for(const i of e){var n;const e=null!==(n=i.fields)&&void 0!==n?n:[];for(const n of e){var r;const e=_(n.type);t[n.name.value]={type:e,description:null===(r=n.description)||void 0===r?void 0:r.value,defaultValue:Qm(n.defaultValue,e),deprecationReason:tE(n),astNode:n}}}return t}function w(e){const t=Object.create(null);for(const i of e){var n;const e=null!==(n=i.values)&&void 0!==n?n:[];for(const n of e){var r;t[n.name.value]={description:null===(r=n.description)||void 0===r?void 0:r.value,deprecationReason:tE(n),astNode:n}}}return t}function A(e){return e.flatMap(e=>{var t,n;return null!==(t=null===(n=e.interfaces)||void 0===n?void 0:n.map(b))&&void 0!==t?t:[]})}function S(e){return e.flatMap(e=>{var t,n;return null!==(t=null===(n=e.types)||void 0===n?void 0:n.map(b))&&void 0!==t?t:[]})}function D(e){var t;const n=e.name.value,r=null!==(t=c[n])&&void 0!==t?t:[];switch(e.kind){case kf.OBJECT_TYPE_DEFINITION:{var i;const t=[e,...r];return new _y({name:n,description:null===(i=e.description)||void 0===i?void 0:i.value,interfaces:()=>A(t),fields:()=>N(t),astNode:e,extensionASTNodes:r})}case kf.INTERFACE_TYPE_DEFINITION:{var o;const t=[e,...r];return new Ry({name:n,description:null===(o=e.description)||void 0===o?void 0:o.value,interfaces:()=>A(t),fields:()=>N(t),astNode:e,extensionASTNodes:r})}case kf.ENUM_TYPE_DEFINITION:{var a;const t=[e,...r];return new xy({name:n,description:null===(a=e.description)||void 0===a?void 0:a.value,values:w(t),astNode:e,extensionASTNodes:r})}case kf.UNION_TYPE_DEFINITION:{var s;const t=[e,...r];return new Fy({name:n,description:null===(s=e.description)||void 0===s?void 0:s.value,types:()=>S(t),astNode:e,extensionASTNodes:r})}case kf.SCALAR_TYPE_DEFINITION:var u;return new by({name:n,description:null===(u=e.description)||void 0===u?void 0:u.value,specifiedByURL:nE(e),astNode:e,extensionASTNodes:r});case kf.INPUT_OBJECT_TYPE_DEFINITION:{var l;const t=[e,...r];return new Py({name:n,description:null===(l=e.description)||void 0===l?void 0:l.value,fields:()=>O(t),astNode:e,extensionASTNodes:r,isOneOf:(p=e,Boolean(Wm(ov,p)))})}}var p}}const eE=bh([...Jy,...Nv],e=>e.name);function tE(e){const t=Wm(rv,e);return null==t?void 0:t.reason}function nE(e){const t=Wm(iv,e);return null==t?void 0:t.url}function rE(e,t){null!=e&&e.kind===kf.DOCUMENT||ff(!1,"Must provide valid Document AST."),!0!==(null==t?void 0:t.assumeValid)&&!0!==(null==t?void 0:t.assumeValidSDL)&&function(e){const t=Sg(e);if(0!==t.length)throw new Error(t.map(e=>e.message).join("\n\n"))}(e);const n=Zg({description:void 0,types:[],directives:[],extensions:Object.create(null),extensionASTNodes:[],assumeValid:!1},e,t);if(null==n.astNode)for(const e of n.types)switch(e.name){case"Query":n.query=e;break;case"Mutation":n.mutation=e;break;case"Subscription":n.subscription=e}const r=[...n.directives,...av.filter(e=>n.directives.every(t=>t.name!==e.name))];return new Av({...n,directives:r})}function iE(e,t){const n=Object.create(null);for(const r of Object.keys(e).sort(Ih))n[r]=t(e[r]);return n}function oE(e){return aE(e,e=>e.name)}function aE(e,t){return e.slice().sort((e,n)=>Ih(t(e),t(n)))}function sE(e){return!Ky(e)&&!Iv(e)}function cE(e,t,n){const r=e.getDirectives().filter(t),i=Object.values(e.getTypeMap()).filter(n);return[uE(e),...r.map(e=>function(e){return mE(e)+"directive @"+e.name+hE(e.args)+(e.isRepeatable?" repeatable":"")+" on "+e.locations.join(" | ")}(e)),...i.map(e=>lE(e))].filter(Boolean).join("\n\n")}function uE(e){if(null==e.description&&function(e){const t=e.getQueryType();if(t&&"Query"!==t.name)return!1;const n=e.getMutationType();if(n&&"Mutation"!==n.name)return!1;const r=e.getSubscriptionType();if(r&&"Subscription"!==r.name)return!1;return!0}(e))return;const t=[],n=e.getQueryType();n&&t.push(`  query: ${n.name}`);const r=e.getMutationType();r&&t.push(`  mutation: ${r.name}`);const i=e.getSubscriptionType();return i&&t.push(`  subscription: ${i.name}`),mE(e)+`schema {\n${t.join("\n")}\n}`}function lE(e){return Kh(e)?function(e){return mE(e)+`scalar ${e.name}`+function(e){if(null==e.specifiedByURL)return"";return` @specifiedBy(url: ${Mh({kind:kf.STRING,value:e.specifiedByURL})})`}(e)}(e):Xh(e)?function(e){return mE(e)+`type ${e.name}`+pE(e)+dE(e)}(e):Zh(e)?function(e){return mE(e)+`interface ${e.name}`+pE(e)+dE(e)}(e):ty(e)?function(e){const t=e.getTypes(),n=t.length?" = "+t.join(" | "):"";return mE(e)+"union "+e.name+n}(e):ny(e)?function(e){const t=e.getValues().map((e,t)=>mE(e,"  ",!t)+"  "+e.name+vE(e.deprecationReason));return mE(e)+`enum ${e.name}`+fE(t)}(e):ry(e)?function(e){const t=Object.values(e.getFields()).map((e,t)=>mE(e,"  ",!t)+"  "+yE(e));return mE(e)+`input ${e.name}`+(e.isOneOf?" @oneOf":"")+fE(t)}(e):void vf(!1,"Unexpected type: "+uh(e))}function pE(e){const t=e.getInterfaces();return t.length?" implements "+t.map(e=>e.name).join(" & "):""}function dE(e){const t=Object.values(e.getFields()).map((e,t)=>mE(e,"  ",!t)+"  "+e.name+hE(e.args,"  ")+": "+String(e.type)+vE(e.deprecationReason));return fE(t)}function fE(e){return 0!==e.length?" {\n"+e.join("\n")+"\n}":""}function hE(e,t=""){return 0===e.length?"":e.every(e=>!e.description)?"("+e.map(yE).join(", ")+")":"(\n"+e.map((e,n)=>mE(e,"  "+t,!n)+"  "+t+yE(e)).join("\n")+"\n"+t+")"}function yE(e){const t=uv(e.defaultValue,e.type);let n=e.name+": "+String(e.type);return t&&(n+=` = ${Mh(t)}`),n+vE(e.deprecationReason)}function vE(e){if(null==e)return"";if(e!==nv){return` @deprecated(reason: ${Mh({kind:kf.STRING,value:e})})`}return" @deprecated"}function mE(e,t="",n=!0){const{description:r}=e;if(null==r)return"";return(t&&!n?"\n"+t:t)+Mh({kind:kf.STRING,value:r,block:Uf(r)}).replace(/\n/g,"\n"+t)+"\n"}function gE(e,t,n){if(!e.has(n)){e.add(n);const r=t[n];if(void 0!==r)for(const n of r)gE(e,t,n)}}function EE(e){const t=[];return Ph(e,{FragmentSpread(e){t.push(e.name.value)}}),t}function TE(e){if("string"==typeof e||ff(!1,"Expected name to be a string."),e.startsWith("__"))return new _f(`Name "${e}" must not begin with "__", which is reserved by GraphQL introspection.`);try{zh(e)}catch(e){return e}}var bE,_E;function NE(e,t){return[...OE(e,t),...IE(e,t)]}function IE(e,t){const n=[],r=PE(e.getDirectives(),t.getDirectives());for(const e of r.removed)n.push({type:bE.DIRECTIVE_REMOVED,description:`${e.name} was removed.`});for(const[e,t]of r.persisted){const r=PE(e.args,t.args);for(const t of r.added)Dy(t)&&n.push({type:bE.REQUIRED_DIRECTIVE_ARG_ADDED,description:`A required arg ${t.name} on directive ${e.name} was added.`});for(const t of r.removed)n.push({type:bE.DIRECTIVE_ARG_REMOVED,description:`${t.name} was removed from ${e.name}.`});e.isRepeatable&&!t.isRepeatable&&n.push({type:bE.DIRECTIVE_REPEATABLE_REMOVED,description:`Repeatable flag was removed from ${e.name}.`});for(const r of e.locations)t.locations.includes(r)||n.push({type:bE.DIRECTIVE_LOCATION_REMOVED,description:`${r} was removed from ${e.name}.`})}return n}function OE(e,t){const n=[],r=PE(Object.values(e.getTypeMap()),Object.values(t.getTypeMap()));for(const e of r.removed)n.push({type:bE.TYPE_REMOVED,description:Ky(e)?`Standard scalar ${e.name} was removed because it is not referenced anymore.`:`${e.name} was removed.`});for(const[e,t]of r.persisted)ny(e)&&ny(t)?n.push(...SE(e,t)):ty(e)&&ty(t)?n.push(...AE(e,t)):ry(e)&&ry(t)?n.push(...wE(e,t)):Xh(e)&&Xh(t)||Zh(e)&&Zh(t)?n.push(...RE(e,t),...DE(e,t)):e.constructor!==t.constructor&&n.push({type:bE.TYPE_CHANGED_KIND,description:`${e.name} changed from ${jE(e)} to ${jE(t)}.`});return n}function wE(e,t){const n=[],r=PE(Object.values(e.getFields()),Object.values(t.getFields()));for(const t of r.added)$y(t)?n.push({type:bE.REQUIRED_INPUT_FIELD_ADDED,description:`A required field ${t.name} on input type ${e.name} was added.`}):n.push({type:_E.OPTIONAL_INPUT_FIELD_ADDED,description:`An optional field ${t.name} on input type ${e.name} was added.`});for(const t of r.removed)n.push({type:bE.FIELD_REMOVED,description:`${e.name}.${t.name} was removed.`});for(const[t,i]of r.persisted){xE(t.type,i.type)||n.push({type:bE.FIELD_CHANGED_KIND,description:`${e.name}.${t.name} changed type from ${String(t.type)} to ${String(i.type)}.`})}return n}function AE(e,t){const n=[],r=PE(e.getTypes(),t.getTypes());for(const t of r.added)n.push({type:_E.TYPE_ADDED_TO_UNION,description:`${t.name} was added to union type ${e.name}.`});for(const t of r.removed)n.push({type:bE.TYPE_REMOVED_FROM_UNION,description:`${t.name} was removed from union type ${e.name}.`});return n}function SE(e,t){const n=[],r=PE(e.getValues(),t.getValues());for(const t of r.added)n.push({type:_E.VALUE_ADDED_TO_ENUM,description:`${t.name} was added to enum type ${e.name}.`});for(const t of r.removed)n.push({type:bE.VALUE_REMOVED_FROM_ENUM,description:`${t.name} was removed from enum type ${e.name}.`});return n}function DE(e,t){const n=[],r=PE(e.getInterfaces(),t.getInterfaces());for(const t of r.added)n.push({type:_E.IMPLEMENTED_INTERFACE_ADDED,description:`${t.name} added to interfaces implemented by ${e.name}.`});for(const t of r.removed)n.push({type:bE.IMPLEMENTED_INTERFACE_REMOVED,description:`${e.name} no longer implements interface ${t.name}.`});return n}function RE(e,t){const n=[],r=PE(Object.values(e.getFields()),Object.values(t.getFields()));for(const t of r.removed)n.push({type:bE.FIELD_REMOVED,description:`${e.name}.${t.name} was removed.`});for(const[t,i]of r.persisted){n.push(...FE(e,t,i));kE(t.type,i.type)||n.push({type:bE.FIELD_CHANGED_KIND,description:`${e.name}.${t.name} changed type from ${String(t.type)} to ${String(i.type)}.`})}return n}function FE(e,t,n){const r=[],i=PE(t.args,n.args);for(const n of i.removed)r.push({type:bE.ARG_REMOVED,description:`${e.name}.${t.name} arg ${n.name} was removed.`});for(const[n,o]of i.persisted){if(xE(n.type,o.type)){if(void 0!==n.defaultValue)if(void 0===o.defaultValue)r.push({type:_E.ARG_DEFAULT_VALUE_CHANGE,description:`${e.name}.${t.name} arg ${n.name} defaultValue was removed.`});else{const i=CE(n.defaultValue,n.type),a=CE(o.defaultValue,o.type);i!==a&&r.push({type:_E.ARG_DEFAULT_VALUE_CHANGE,description:`${e.name}.${t.name} arg ${n.name} has changed defaultValue from ${i} to ${a}.`})}}else r.push({type:bE.ARG_CHANGED_KIND,description:`${e.name}.${t.name} arg ${n.name} has changed type from ${String(n.type)} to ${String(o.type)}.`})}for(const n of i.added)Dy(n)?r.push({type:bE.REQUIRED_ARG_ADDED,description:`A required arg ${n.name} on ${e.name}.${t.name} was added.`}):r.push({type:_E.OPTIONAL_ARG_ADDED,description:`An optional arg ${n.name} on ${e.name}.${t.name} was added.`});return r}function kE(e,t){return iy(e)?iy(t)&&kE(e.ofType,t.ofType)||oy(t)&&kE(e,t.ofType):oy(e)?oy(t)&&kE(e.ofType,t.ofType):my(t)&&e.name===t.name||oy(t)&&kE(e,t.ofType)}function xE(e,t){return iy(e)?iy(t)&&xE(e.ofType,t.ofType):oy(e)?oy(t)&&xE(e.ofType,t.ofType)||!oy(t)&&xE(e.ofType,t):my(t)&&e.name===t.name}function jE(e){return Kh(e)?"a Scalar type":Xh(e)?"an Object type":Zh(e)?"an Interface type":ty(e)?"a Union type":ny(e)?"an Enum type":ry(e)?"an Input type":void vf(!1,"Unexpected type: "+uh(e))}function CE(e,t){const n=uv(e,t);return null!=n||vf(!1),Mh(mm(n))}function PE(e,t){const n=[],r=[],i=[],o=bh(e,({name:e})=>e),a=bh(t,({name:e})=>e);for(const t of e){const e=a[t.name];void 0===e?r.push(t):i.push([t,e])}for(const e of t)void 0===o[e.name]&&n.push(e);return{added:n,persisted:i,removed:r}}!function(e){e.TYPE_REMOVED="TYPE_REMOVED",e.TYPE_CHANGED_KIND="TYPE_CHANGED_KIND",e.TYPE_REMOVED_FROM_UNION="TYPE_REMOVED_FROM_UNION",e.VALUE_REMOVED_FROM_ENUM="VALUE_REMOVED_FROM_ENUM",e.REQUIRED_INPUT_FIELD_ADDED="REQUIRED_INPUT_FIELD_ADDED",e.IMPLEMENTED_INTERFACE_REMOVED="IMPLEMENTED_INTERFACE_REMOVED",e.FIELD_REMOVED="FIELD_REMOVED",e.FIELD_CHANGED_KIND="FIELD_CHANGED_KIND",e.REQUIRED_ARG_ADDED="REQUIRED_ARG_ADDED",e.ARG_REMOVED="ARG_REMOVED",e.ARG_CHANGED_KIND="ARG_CHANGED_KIND",e.DIRECTIVE_REMOVED="DIRECTIVE_REMOVED",e.DIRECTIVE_ARG_REMOVED="DIRECTIVE_ARG_REMOVED",e.REQUIRED_DIRECTIVE_ARG_ADDED="REQUIRED_DIRECTIVE_ARG_ADDED",e.DIRECTIVE_REPEATABLE_REMOVED="DIRECTIVE_REPEATABLE_REMOVED",e.DIRECTIVE_LOCATION_REMOVED="DIRECTIVE_LOCATION_REMOVED"}(bE||(bE={})),function(e){e.VALUE_ADDED_TO_ENUM="VALUE_ADDED_TO_ENUM",e.TYPE_ADDED_TO_UNION="TYPE_ADDED_TO_UNION",e.OPTIONAL_INPUT_FIELD_ADDED="OPTIONAL_INPUT_FIELD_ADDED",e.OPTIONAL_ARG_ADDED="OPTIONAL_ARG_ADDED",e.IMPLEMENTED_INTERFACE_ADDED="IMPLEMENTED_INTERFACE_ADDED",e.ARG_DEFAULT_VALUE_CHANGE="ARG_DEFAULT_VALUE_CHANGE"}(_E||(_E={}));var LE=Object.freeze({__proto__:null,BREAK:Ch,get BreakingChangeType(){return bE},DEFAULT_DEPRECATION_REASON:nv,get DangerousChangeType(){return _E},get DirectiveLocation(){return Ff},ExecutableDefinitionsRule:tm,FieldsOnCorrectTypeRule:nm,FragmentsOnCompositeTypesRule:rm,GRAPHQL_MAX_INT:By,GRAPHQL_MIN_INT:Gy,GraphQLBoolean:zy,GraphQLDeprecatedDirective:rv,GraphQLDirective:Zy,GraphQLEnumType:xy,GraphQLError:_f,GraphQLFloat:Yy,GraphQLID:Wy,GraphQLIncludeDirective:ev,GraphQLInputObjectType:Py,GraphQLInt:Qy,GraphQLInterfaceType:Ry,GraphQLList:py,GraphQLNonNull:dy,GraphQLObjectType:_y,GraphQLOneOfDirective:ov,GraphQLScalarType:by,GraphQLSchema:Av,GraphQLSkipDirective:tv,GraphQLSpecifiedByDirective:iv,GraphQLString:qy,GraphQLUnionType:Fy,get Kind(){return kf},KnownArgumentNamesRule:im,KnownDirectivesRule:am,KnownFragmentNamesRule:sm,KnownTypeNamesRule:cm,Lexer:Gf,Location:Of,LoneAnonymousOperationRule:lm,LoneSchemaDefinitionRule:pm,MaxIntrospectionDepthRule:dm,NoDeprecatedCustomRule:function(e){return{Field(t){const n=e.getFieldDef(),r=null==n?void 0:n.deprecationReason;if(n&&null!=r){const i=e.getParentType();null!=i||vf(!1),e.reportError(new _f(`The field ${i.name}.${n.name} is deprecated. ${r}`,{nodes:t}))}},Argument(t){const n=e.getArgument(),r=null==n?void 0:n.deprecationReason;if(n&&null!=r){const i=e.getDirective();if(null!=i)e.reportError(new _f(`Directive "@${i.name}" argument "${n.name}" is deprecated. ${r}`,{nodes:t}));else{const i=e.getParentType(),o=e.getFieldDef();null!=i&&null!=o||vf(!1),e.reportError(new _f(`Field "${i.name}.${o.name}" argument "${n.name}" is deprecated. ${r}`,{nodes:t}))}}},ObjectField(t){const n=gy(e.getParentInputType());if(ry(n)){const r=n.getFields()[t.name.value],i=null==r?void 0:r.deprecationReason;null!=i&&e.reportError(new _f(`The input field ${n.name}.${r.name} is deprecated. ${i}`,{nodes:t}))}},EnumValue(t){const n=e.getEnumValue(),r=null==n?void 0:n.deprecationReason;if(n&&null!=r){const i=gy(e.getInputType());null!=i||vf(!1),e.reportError(new _f(`The enum value "${i.name}.${n.name}" is deprecated. ${r}`,{nodes:t}))}}}},NoFragmentCyclesRule:fm,NoSchemaIntrospectionCustomRule:function(e){return{Field(t){const n=gy(e.getType());n&&Iv(n)&&e.reportError(new _f(`GraphQL introspection has been disabled, but the requested query contained the field "${t.name.value}".`,{nodes:t}))}}},NoUndefinedVariablesRule:hm,NoUnusedFragmentsRule:ym,NoUnusedVariablesRule:vm,get OperationTypeNode(){return Rf},OverlappingFieldsCanBeMergedRule:Em,PossibleFragmentSpreadsRule:Fm,PossibleTypeExtensionsRule:km,ProvidedRequiredArgumentsRule:jm,ScalarLeafsRule:Lm,SchemaMetaFieldDef:Tv,SingleFieldSubscriptionsRule:tg,Source:dh,Token:wf,get TokenKind(){return xf},TypeInfo:qv,get TypeKind(){return gv},TypeMetaFieldDef:bv,TypeNameMetaFieldDef:_v,UniqueArgumentDefinitionNamesRule:rg,UniqueArgumentNamesRule:ig,UniqueDirectiveNamesRule:og,UniqueDirectivesPerLocationRule:ag,UniqueEnumValueNamesRule:sg,UniqueFieldDefinitionNamesRule:cg,UniqueFragmentNamesRule:lg,UniqueInputFieldNamesRule:pg,UniqueOperationNamesRule:dg,UniqueOperationTypesRule:fg,UniqueTypeNamesRule:hg,UniqueVariableNamesRule:yg,ValidationContext:wg,ValuesOfCorrectTypeRule:vg,VariablesAreInputTypesRule:gg,VariablesInAllowedPositionRule:Eg,__Directive:dv,__DirectiveLocation:fv,__EnumValue:mv,__Field:yv,__InputValue:vv,__Schema:pv,__Type:hv,__TypeKind:Ev,assertAbstractType:function(e){if(!ly(e))throw new Error(`Expected ${uh(e)} to be a GraphQL abstract type.`);return e},assertCompositeType:function(e){if(!uy(e))throw new Error(`Expected ${uh(e)} to be a GraphQL composite type.`);return e},assertDirective:function(e){if(!Hy(e))throw new Error(`Expected ${uh(e)} to be a GraphQL directive.`);return e},assertEnumType:function(e){if(!ny(e))throw new Error(`Expected ${uh(e)} to be a GraphQL Enum type.`);return e},assertEnumValueName:Wh,assertInputObjectType:function(e){if(!ry(e))throw new Error(`Expected ${uh(e)} to be a GraphQL Input Object type.`);return e},assertInputType:function(e){if(!ay(e))throw new Error(`Expected ${uh(e)} to be a GraphQL input type.`);return e},assertInterfaceType:ey,assertLeafType:function(e){if(!cy(e))throw new Error(`Expected ${uh(e)} to be a GraphQL leaf type.`);return e},assertListType:function(e){if(!iy(e))throw new Error(`Expected ${uh(e)} to be a GraphQL List type.`);return e},assertName:zh,assertNamedType:function(e){if(!my(e))throw new Error(`Expected ${uh(e)} to be a GraphQL named type.`);return e},assertNonNullType:function(e){if(!oy(e))throw new Error(`Expected ${uh(e)} to be a GraphQL Non-Null type.`);return e},assertNullableType:yy,assertObjectType:Hh,assertOutputType:function(e){if(!sy(e))throw new Error(`Expected ${uh(e)} to be a GraphQL output type.`);return e},assertScalarType:function(e){if(!Kh(e))throw new Error(`Expected ${uh(e)} to be a GraphQL Scalar type.`);return e},assertSchema:wv,assertType:function(e){if(!Jh(e))throw new Error(`Expected ${uh(e)} to be a GraphQL type.`);return e},assertUnionType:function(e){if(!ty(e))throw new Error(`Expected ${uh(e)} to be a GraphQL Union type.`);return e},assertValidName:function(e){const t=TE(e);if(t)throw t;return e},assertValidSchema:Rv,assertWrappingType:function(e){if(!fy(e))throw new Error(`Expected ${uh(e)} to be a GraphQL wrapping type.`);return e},astFromValue:uv,buildASTSchema:rE,buildClientSchema:function(e,t){yf(e)&&yf(e.__schema)||ff(!1,`Invalid or incomplete introspection result. Ensure that you are passing "data" property of introspection response and no "errors" was returned alongside: ${uh(e)}.`);const n=e.__schema,r=_h(n.types,e=>e.name,e=>function(e){if(null!=e&&null!=e.name&&null!=e.kind)switch(e.kind){case gv.SCALAR:return new by({name:(r=e).name,description:r.description,specifiedByURL:r.specifiedByURL});case gv.OBJECT:return new _y({name:(n=e).name,description:n.description,interfaces:()=>d(n),fields:()=>f(n)});case gv.INTERFACE:return new Ry({name:(t=e).name,description:t.description,interfaces:()=>d(t),fields:()=>f(t)});case gv.UNION:return function(e){if(!e.possibleTypes){const t=uh(e);throw new Error(`Introspection result missing possibleTypes: ${t}.`)}return new Fy({name:e.name,description:e.description,types:()=>e.possibleTypes.map(l)})}(e);case gv.ENUM:return function(e){if(!e.enumValues){const t=uh(e);throw new Error(`Introspection result missing enumValues: ${t}.`)}return new xy({name:e.name,description:e.description,values:_h(e.enumValues,e=>e.name,e=>({description:e.description,deprecationReason:e.deprecationReason}))})}(e);case gv.INPUT_OBJECT:return function(e){if(!e.inputFields){const t=uh(e);throw new Error(`Introspection result missing inputFields: ${t}.`)}return new Py({name:e.name,description:e.description,fields:()=>y(e.inputFields),isOneOf:e.isOneOf})}(e)}var t;var n;var r;const i=uh(e);throw new Error(`Invalid or incomplete introspection result. Ensure that a full introspection query is used in order to build a client schema: ${i}.`)}(e));for(const e of[...Jy,...Nv])r[e.name]&&(r[e.name]=e);const i=n.queryType?l(n.queryType):null,o=n.mutationType?l(n.mutationType):null,a=n.subscriptionType?l(n.subscriptionType):null,s=n.directives?n.directives.map(function(e){if(!e.args){const t=uh(e);throw new Error(`Introspection result missing directive args: ${t}.`)}if(!e.locations){const t=uh(e);throw new Error(`Introspection result missing directive locations: ${t}.`)}return new Zy({name:e.name,description:e.description,isRepeatable:e.isRepeatable,locations:e.locations.slice(),args:y(e.args)})}):[];return new Av({description:n.description,query:i,mutation:o,subscription:a,types:Object.values(r),directives:s,assumeValid:null==t?void 0:t.assumeValid});function c(e){if(e.kind===gv.LIST){const t=e.ofType;if(!t)throw new Error("Decorated type deeper than introspection query.");return new py(c(t))}if(e.kind===gv.NON_NULL){const t=e.ofType;if(!t)throw new Error("Decorated type deeper than introspection query.");const n=c(t);return new dy(yy(n))}return u(e)}function u(e){const t=e.name;if(!t)throw new Error(`Unknown type reference: ${uh(e)}.`);const n=r[t];if(!n)throw new Error(`Invalid or incomplete schema, unknown type: ${t}. Ensure that a full introspection query is used in order to build a client schema.`);return n}function l(e){return Hh(u(e))}function p(e){return ey(u(e))}function d(e){if(null===e.interfaces&&e.kind===gv.INTERFACE)return[];if(!e.interfaces){const t=uh(e);throw new Error(`Introspection result missing interfaces: ${t}.`)}return e.interfaces.map(p)}function f(e){if(!e.fields)throw new Error(`Introspection result missing fields: ${uh(e)}.`);return _h(e.fields,e=>e.name,h)}function h(e){const t=c(e.type);if(!sy(t)){const e=uh(t);throw new Error(`Introspection must provide output type for fields, but received: ${e}.`)}if(!e.args){const t=uh(e);throw new Error(`Introspection result missing field args: ${t}.`)}return{description:e.description,deprecationReason:e.deprecationReason,type:t,args:y(e.args)}}function y(e){return _h(e,e=>e.name,v)}function v(e){const t=c(e.type);if(!ay(t)){const e=uh(t);throw new Error(`Introspection must provide input type for arguments, but received: ${e}.`)}const n=null!=e.defaultValue?Qm(yh(e.defaultValue),t):void 0;return{description:e.description,type:t,defaultValue:n,deprecationReason:e.deprecationReason}}},buildSchema:function(e,t){return rE(hh(e,{noLocation:null==t?void 0:t.noLocation,allowLegacyFragmentVariables:null==t?void 0:t.allowLegacyFragmentVariables}),{assumeValidSDL:null==t?void 0:t.assumeValidSDL,assumeValid:null==t?void 0:t.assumeValid})},coerceInputValue:Um,concatAST:function(e){const t=[];for(const n of e)t.push(...n.definitions);return{kind:kf.DOCUMENT,definitions:t}},createSourceEventStream:Xg,defaultFieldResolver:zg,defaultTypeResolver:qg,doTypesOverlap:Uy,execute:xg,executeSync:jg,extendSchema:function(e,t,n){wv(e),null!=t&&t.kind===kf.DOCUMENT||ff(!1,"Must provide valid Document AST."),!0!==(null==n?void 0:n.assumeValid)&&!0!==(null==n?void 0:n.assumeValidSDL)&&function(e,t){const n=Sg(e,t);if(0!==n.length)throw new Error(n.map(e=>e.message).join("\n\n"))}(t,e);const r=e.toConfig(),i=Zg(r,t,n);return r===i?e:new Av(i)},findBreakingChanges:function(e,t){return NE(e,t).filter(e=>e.type in bE)},findDangerousChanges:function(e,t){return NE(e,t).filter(e=>e.type in _E)},formatError:function(e){return e.toJSON()},getArgumentValues:zm,getDirectiveValues:Wm,getEnterLeaveForKind:$h,getIntrospectionQuery:Hg,getLocation:gf,getNamedType:gy,getNullableType:vy,getOperationAST:function(e,t){let n=null;for(const i of e.definitions){var r;if(i.kind===kf.OPERATION_DEFINITION)if(null==t){if(n)return null;n=i}else if((null===(r=i.name)||void 0===r?void 0:r.value)===t)return i}return n},getOperationRootType:function(e,t){if("query"===t.operation){const n=e.getQueryType();if(!n)throw new _f("Schema does not define the required query root type.",{nodes:t});return n}if("mutation"===t.operation){const n=e.getMutationType();if(!n)throw new _f("Schema is not configured for mutations.",{nodes:t});return n}if("subscription"===t.operation){const n=e.getSubscriptionType();if(!n)throw new _f("Schema is not configured for subscriptions.",{nodes:t});return n}throw new _f("Can only have query, mutation and subscription operations.",{nodes:t})},getVariableValues:qm,getVisitFn:function(e,t,n){const{enter:r,leave:i}=$h(e,t);return n?i:r},graphql:function(e){return new Promise(t=>t(Jg(e)))},graphqlSync:function(e){const t=Jg(e);if(hf(t))throw new Error("GraphQL execution failed to complete synchronously.");return t},introspectionFromSchema:function(e,t){const n=jg({schema:e,document:hh(Hg({specifiedByUrl:!0,directiveIsRepeatable:!0,schemaDescription:!0,inputValueDeprecation:!0,oneOf:!0,...t}))});return!n.errors&&n.data||vf(!1),n.data},introspectionTypes:Nv,isAbstractType:ly,isCompositeType:uy,isConstValueNode:function e(t){return Kv(t)&&(t.kind===kf.LIST?t.values.some(e):t.kind===kf.OBJECT?t.fields.some(t=>e(t.value)):t.kind!==kf.VARIABLE)},isDefinitionNode:function(e){return Jv(e)||Xv(e)||Zv(e)},isDirective:Hy,isEnumType:ny,isEqualType:My,isExecutableDefinitionNode:Jv,isInputObjectType:ry,isInputType:ay,isInterfaceType:Zh,isIntrospectionType:Iv,isLeafType:cy,isListType:iy,isNamedType:my,isNonNullType:oy,isNullableType:hy,isObjectType:Xh,isOutputType:sy,isRequiredArgument:Dy,isRequiredInputField:$y,isScalarType:Kh,isSchema:Ov,isSelectionNode:function(e){return e.kind===kf.FIELD||e.kind===kf.FRAGMENT_SPREAD||e.kind===kf.INLINE_FRAGMENT},isSpecifiedDirective:sv,isSpecifiedScalarType:Ky,isType:Jh,isTypeDefinitionNode:Hv,isTypeExtensionNode:em,isTypeNode:function(e){return e.kind===kf.NAMED_TYPE||e.kind===kf.LIST_TYPE||e.kind===kf.NON_NULL_TYPE},isTypeSubTypeOf:Vy,isTypeSystemDefinitionNode:Xv,isTypeSystemExtensionNode:Zv,isUnionType:ty,isValidNameError:TE,isValueNode:Kv,isWrappingType:fy,lexicographicSortSchema:function(e){const t=e.toConfig(),n=_h(oE(t.types),e=>e.name,function(e){if(Kh(e)||Iv(e))return e;if(Xh(e)){const t=e.toConfig();return new _y({...t,interfaces:()=>c(t.interfaces),fields:()=>s(t.fields)})}if(Zh(e)){const t=e.toConfig();return new Ry({...t,interfaces:()=>c(t.interfaces),fields:()=>s(t.fields)})}if(ty(e)){const t=e.toConfig();return new Fy({...t,types:()=>c(t.types)})}if(ny(e)){const t=e.toConfig();return new xy({...t,values:iE(t.values,e=>e)})}if(ry(e)){const t=e.toConfig();return new Py({...t,fields:()=>iE(t.fields,e=>({...e,type:r(e.type)}))})}vf(!1,"Unexpected type: "+uh(e))});return new Av({...t,types:Object.values(n),directives:oE(t.directives).map(function(e){const t=e.toConfig();return new Zy({...t,locations:aE(t.locations,e=>e),args:a(t.args)})}),query:o(t.query),mutation:o(t.mutation),subscription:o(t.subscription)});function r(e){return iy(e)?new py(r(e.ofType)):oy(e)?new dy(r(e.ofType)):i(e)}function i(e){return n[e.name]}function o(e){return e&&i(e)}function a(e){return iE(e,e=>({...e,type:r(e.type)}))}function s(e){return iE(e,e=>({...e,type:r(e.type),args:e.args&&a(e.args)}))}function c(e){return oE(e).map(i)}},locatedError:Fg,parse:hh,parseConstValue:function(e,t){const n=new vh(e,t);n.expectToken(xf.SOF);const r=n.parseConstValueLiteral();return n.expectToken(xf.EOF),r},parseType:function(e,t){const n=new vh(e,t);n.expectToken(xf.SOF);const r=n.parseTypeReference();return n.expectToken(xf.EOF),r},parseValue:yh,print:Mh,printError:function(e){return e.toString()},printIntrospectionSchema:function(e){return cE(e,sv,Iv)},printLocation:Ef,printSchema:function(e){return cE(e,e=>!sv(e),sE)},printSourceLocation:Tf,printType:lE,recommendedRules:bg,resolveObjMapThunk:Ty,resolveReadonlyArrayThunk:Ey,responsePathAsArray:Vm,separateOperations:function(e){const t=[],n=Object.create(null);for(const r of e.definitions)switch(r.kind){case kf.OPERATION_DEFINITION:t.push(r);break;case kf.FRAGMENT_DEFINITION:n[r.name.value]=EE(r.selectionSet)}const r=Object.create(null);for(const i of t){const t=new Set;for(const e of EE(i.selectionSet))gE(t,n,e);r[i.name?i.name.value:""]={kind:kf.DOCUMENT,definitions:e.definitions.filter(e=>e===i||e.kind===kf.FRAGMENT_DEFINITION&&t.has(e.name.value))}}return r},specifiedDirectives:av,specifiedRules:_g,specifiedScalarTypes:Jy,stripIgnoredCharacters:function(e){const t=fh(e)?e:new dh(e),n=t.body,r=new Gf(t);let i="",o=!1;for(;r.advance().kind!==xf.EOF;){const e=r.token,t=e.kind,a=!Qf(e.kind);o&&(a||e.kind===xf.SPREAD)&&(i+=" ");const s=n.slice(e.start,e.end);t===xf.BLOCK_STRING?i+=Bf(e.value,{minimize:!0}):i+=s,o=a}return i},subscribe:async function(e){arguments.length<2||ff(!1,"graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.");const t=await Xg(e);return Kg(t)?function(e,t){const n=e[Symbol.asyncIterator]();async function r(e){if(e.done)return e;try{return{value:await t(e.value),done:!1}}catch(e){if("function"==typeof n.return)try{await n.return()}catch(e){}throw e}}return{next:async()=>r(await n.next()),return:async()=>"function"==typeof n.return?r(await n.return()):{value:void 0,done:!0},async throw(e){if("function"==typeof n.throw)return r(await n.throw(e));throw e},[Symbol.asyncIterator](){return this}}}(t,t=>xg({...e,rootValue:t})):t},syntaxError:If,typeFromAST:Yv,validate:Ag,validateSchema:Dv,valueFromAST:Qm,valueFromASTUntyped:qh,version:"16.11.0",versionInfo:df,visit:Ph,visitInParallel:Lh,visitWithTypeInfo:Wv}),$E=V(LE);Object.defineProperty(pf,"__esModule",{value:!0}),pf.buildWatchFragmentWhereQuery=pf.buildWatchFragmentQuery=void 0;const ME=$E,VE=U;function UE({fieldName:e,fragmentDefinition:t}){return{kind:ME.Kind.DOCUMENT,definitions:[{directives:[],variableDefinitions:[],kind:ME.Kind.OPERATION_DEFINITION,operation:ME.OperationTypeNode.QUERY,selectionSet:{kind:ME.Kind.SELECTION_SET,selections:[{arguments:[],kind:ME.Kind.FIELD,name:{kind:ME.Kind.NAME,value:e},directives:[{arguments:[],kind:ME.Kind.DIRECTIVE,name:{kind:ME.Kind.NAME,value:"client"}}],selectionSet:t.selectionSet}]}}]}}pf.buildWatchFragmentQuery=function(e){const{fragment:t,id:n,policies:r,fieldName:i}=e,o=UE({fragmentDefinition:t.definitions[0],fieldName:i});return r.getFieldPolicy("Query",i)||r.addTypePolicies({Query:{fields:{[i]:{read:e=>(0,VE.makeReference)(n)}}}}),o},pf.buildWatchFragmentWhereQuery=function(e){const{fragment:t,filterVar:n,limitVar:r,orderByVar:i,policies:o,cache:a,fieldName:s}=e,c=t.definitions[0],u=c.typeCondition.name.value,l=UE({fragmentDefinition:c,fieldName:s});return o.getFieldPolicy("Query",s)||o.addTypePolicies({Query:{fields:{[s]:{read:e=>a.readReferenceWhere({__typename:u,filter:n(),limit:r(),orderBy:i()})}}}}),l},Object.defineProperty(lf,"__esModule",{value:!0});const BE=U,GE=pf,QE=rl;class YE extends BE.ApolloClient{constructor(e){super(e),this.policies=this.cache.policies}watchQueryForField(e,t){const n=this.watchQuery({fetchPolicy:"cache-only",query:e}),r=n.subscribe.bind(n);return n.subscribe=(e,...n)=>{"object"!=typeof e&&(e={next:e,error:n[0],complete:n[1]});const i=e.next;e.next=e=>{var n;i&&i(null===(n=null==e?void 0:e.data)||void 0===n?void 0:n[t])};const o=r(e),a=o.unsubscribe.bind(o);return o.unsubscribe=()=>{delete this.cache.policies.typePolicies.Query.fields[t],a()},o},n}watchFragment(e){const t=(0,QE.generateFragmentFieldName)(),n=(0,GE.buildWatchFragmentQuery)(Object.assign(Object.assign({},e),{fieldName:t,policies:this.policies}));return this.watchQueryForField(n,t)}watchFragmentWhere(e){const t=(0,QE.generateFragmentFieldName)(),n=(0,BE.makeVar)(e.filter),r=(0,BE.makeVar)(e.limit),i=(0,BE.makeVar)(e.orderBy),o=(0,GE.buildWatchFragmentWhereQuery)(Object.assign(Object.assign({},e),{fieldName:t,filterVar:n,limitVar:r,orderByVar:i,cache:this.cache,policies:this.policies}));return this.watchQueryForField(o,t)}}lf.default=YE,function(e){var t=$&&$.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.ApolloExtensionsClient=void 0;var n=lf;Object.defineProperty(e,"ApolloExtensionsClient",{enumerable:!0,get:function(){return t(n).default}})}(uf);var qE={},zE={},WE=V(e),JE={},KE=$&&$.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(JE,"__esModule",{value:!0}),JE.usePrevious=JE.useOnce=void 0;const XE=WE,HE=KE(Se);JE.useOnce=function(e){const t=(0,XE.useRef)(),n=(0,XE.useRef)(!1);return n.current||((0,HE.default)(e)?t.current=e():t.current=e,n.current=!0),t.current};JE.usePrevious=e=>{const t=(0,XE.useRef)(null);return(0,XE.useEffect)(()=>{t.current=e}),t.current};var ZE={};Object.defineProperty(ZE,"__esModule",{value:!0}),ZE.useFragmentTypePolicyFieldName=void 0;const eT=lc,tT=WE,nT=rl,rT=JE;ZE.useFragmentTypePolicyFieldName=({fragmentName:e}={})=>{const t=(0,tT.useMemo)(()=>(0,nT.generateFragmentFieldName)({fragmentName:e}),[e]),n=(0,rT.usePrevious)(t),r=(0,eT.useApolloClient)();return(0,tT.useEffect)(()=>()=>{delete r.cache.policies.typePolicies.Query.fields[n]},[t,n]),t};var iT={};Object.defineProperty(iT,"__esModule",{value:!0}),iT.useGetQueryDataByFieldName=void 0;const oT=lc;iT.useGetQueryDataByFieldName=(e,t,n)=>{var r,i;const o=(0,oT.useQuery)(e,{fetchPolicy:"cache-only",returnPartialData:null==n?void 0:n.returnPartialData});return{data:null!==(i=null===(r=null==o?void 0:o.data)||void 0===r?void 0:r[t])&&void 0!==i?i:null}},Object.defineProperty(zE,"__esModule",{value:!0});const aT=lc,sT=WE,cT=JE,uT=pf,lT=ZE,pT=iT;zE.default=function(e,t){const n=(0,sT.useContext)((0,aT.getApolloContext)()).client,r=null==n?void 0:n.cache,i=(0,lT.useFragmentTypePolicyFieldName)(),o=(0,cT.useOnce)(()=>(0,uT.buildWatchFragmentQuery)({fragment:e,fieldName:i,id:t.id,policies:r.policies}));return(0,pT.useGetQueryDataByFieldName)(o,i,t)};var dT={};const{toString:fT,hasOwnProperty:hT}=Object.prototype,yT=Function.prototype.toString,vT=new Map;function mT(e,t){try{return gT(e,t)}finally{vT.clear()}}function gT(e,t){if(e===t)return!0;const n=fT.call(e);if(n!==fT.call(t))return!1;switch(n){case"[object Array]":if(e.length!==t.length)return!1;case"[object Object]":{if(_T(e,t))return!0;const n=ET(e),r=ET(t),i=n.length;if(i!==r.length)return!1;for(let e=0;e<i;++e)if(!hT.call(t,n[e]))return!1;for(let r=0;r<i;++r){const i=n[r];if(!gT(e[i],t[i]))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(_T(e,t))return!0;const r=e.entries(),i="[object Map]"===n;for(;;){const e=r.next();if(e.done)break;const[n,o]=e.value;if(!t.has(n))return!1;if(i&&!gT(o,t.get(n)))return!1}return!0}case"[object Uint16Array]":case"[object Uint8Array]":case"[object Uint32Array]":case"[object Int32Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object ArrayBuffer]":e=new Uint8Array(e),t=new Uint8Array(t);case"[object DataView]":{let n=e.byteLength;if(n===t.byteLength)for(;n--&&e[n]===t[n];);return-1===n}case"[object AsyncFunction]":case"[object GeneratorFunction]":case"[object AsyncGeneratorFunction]":case"[object Function]":{const n=yT.call(e);return n===yT.call(t)&&!function(e,t){const n=e.length-t.length;return n>=0&&e.indexOf(t,n)===n}(n,bT)}}return!1}function ET(e){return Object.keys(e).filter(TT,e)}function TT(e){return void 0!==this[e]}const bT="{ [native code] }";function _T(e,t){let n=vT.get(e);if(n){if(n.has(t))return!0}else vT.set(e,n=new Set);return n.add(t),!1}var NT=V(Object.freeze({__proto__:null,default:mT,equal:mT}));Object.defineProperty(dT,"__esModule",{value:!0});const IT=lc,OT=WE,wT=pf,AT=ZE,ST=iT,DT=lc,RT=NT;dT.default=function(e,t){var n;const r=null==t?void 0:t.filter,i=(0,OT.useRef)((0,DT.makeVar)(r)).current,o=null==t?void 0:t.limit,a=(0,OT.useRef)((0,DT.makeVar)(o)).current,s=null==t?void 0:t.orderBy,c=(0,OT.useRef)((0,DT.makeVar)(s)).current,u=(0,OT.useContext)((0,IT.getApolloContext)()).client,l=null==u?void 0:u.cache,p=(0,AT.useFragmentTypePolicyFieldName)({fragmentName:null==t?void 0:t.fragmentName}),d=(0,OT.useRef)([]);(0,OT.useEffect)(()=>{("function"==typeof r&&r!==i()||!(0,RT.equal)(r,i()))&&i(r)},[r]),(0,OT.useEffect)(()=>{o!==a()&&a(o)},[o]),(0,OT.useEffect)(()=>{("function"==typeof s&&s!==c()||!(0,RT.equal)(s,c()))&&c(s)},[s]);const f=(0,OT.useMemo)(()=>(0,wT.buildWatchFragmentWhereQuery)({filter:r,filterVar:i,limitVar:a,orderByVar:c,fragment:e,fieldName:p,cache:l,policies:l.policies}),[p]),h=(0,ST.useGetQueryDataByFieldName)(f,p,t);return Object.assign(Object.assign({},h),{data:null!==(n=h.data)&&void 0!==n?n:d.current})},function(e){var t=$&&$.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.useFragmentWhere=e.useFragment=void 0;var n=zE;Object.defineProperty(e,"useFragment",{enumerable:!0,get:function(){return t(n).default}});var r=dT;Object.defineProperty(e,"useFragmentWhere",{enumerable:!0,get:function(){return t(r).default}})}(qE);var FT={},kT={},xT={},jT=$&&$.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(xT,"__esModule",{value:!0}),xT.AuditType=void 0;const CT=jT(Ju);var PT;!function(e){e.Read="Read",e.Write="Write",e.Evict="Evict"}(PT||(xT.AuditType=PT={}));class LT extends CT.default{constructor(e){super(e),this.auditLog=e.auditLog}runReadPolicy({typename:e,dataId:t,fieldName:n,storeFieldName:r,reportOnly:i=!1}){return this.auditLog.log("Running read policy",PT.Read,"InvalidationPolicyManager",{storeFieldName:r,typename:e,dataId:t,fieldName:n}),super.runReadPolicy({typename:e,dataId:t,fieldName:n,storeFieldName:r,reportOnly:i})}runWritePolicy(e,t){return this.auditLog.log("Running write policy",PT.Write,"InvalidationPolicyManager",Object.assign({typeName:e},t)),super.runWritePolicy(e,t)}runEvictPolicy(e,t){return this.auditLog.log("Running evict policy",PT.Write,"InvalidationPolicyManager",Object.assign({typeName:e},t)),super.runEvictPolicy(e,t)}}xT.default=LT;var $T={},MT=$&&$.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty($T,"__esModule",{value:!0});const VT=MT(Sd);var UT;!function(e){e.Write="Write",e.Evict="Evict"}(UT||(UT={}));class BT extends VT.default{constructor(e){super(),this.auditLog=e.auditLog}write(e,t,n,r){return this.auditLog.log("Writing to type map",UT.Write,"EntityTypeMap",{typename:e,dataId:t,storeFieldName:n,variables:r}),super.write(e,t,n,r)}evict(e,t){return this.auditLog.log("Evicting from type map",UT.Evict,"EntityTypeMap",{dataId:e,storeFieldName:t}),super.evict(e,t)}}$T.default=BT;var GT={},QT=mc;var YT=wa,qT=function(e,t){var n=[];return QT(e,function(e,r,i){t(e,r,i)&&n.push(e)}),n},zT=tu,WT=Qt;var JT=function(e,t){return(WT(e)?YT:qT)(e,zT(t))},KT=$&&$.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(GT,"__esModule",{value:!0});const XT=KT(JT);GT.default=class{constructor(){this._log=[]}log(e,t,n,r){const i={time:Date.now(),type:t,event:e,meta:r,group:n};this._log.push(i)}getLog(e){return(0,XT.default)(this._log,e)}printLog(e){this.getLog(e).forEach(this.printLogEntry)}printLogEntry(e){var t;console.log(`%c event: ${e.event}`,"color: green"),console.group(),console.log(`type: ${e.type}`),console.log(`time: ${e.time}`),console.log(`meta: ${JSON.stringify(null!==(t=e.meta)&&void 0!==t?t:{})}`),console.groupEnd()}};var HT=$&&$.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(kT,"__esModule",{value:!0});const ZT=HT(pc),eb=jd,tb=HT(xT),nb=HT($T),rb=HT(GT),ib=Nd;class ob extends ZT.default{constructor(e){super(e),this.auditLog=new rb.default;const{invalidationPolicies:t={}}=e;this.entityTypeMap=new nb.default({auditLog:this.auditLog}),new ib.EntityStoreWatcher({entityStore:this.entityStoreRoot,entityTypeMap:this.entityTypeMap,policies:this.policies,reactiveVarsCache:this.reactiveVarsCache,updateCollectionField:this.updateCollectionField.bind(this)}),this.invalidationPolicyManager=new tb.default({auditLog:this.auditLog,policies:t,entityTypeMap:this.entityTypeMap,cacheOperations:{evict:this.evict.bind(this),modify:this.modify.bind(this),readField:this.readField.bind(this)}}),this.cacheResultProcessor=new eb.CacheResultProcessor({invalidationPolicyManager:this.invalidationPolicyManager,entityTypeMap:this.entityTypeMap,cache:this})}}kT.default=ob,function(e){var t=$&&$.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.InvalidationPolicyCacheAuditor=void 0;var n=kT;Object.defineProperty(e,"InvalidationPolicyCacheAuditor",{enumerable:!0,get:function(){return t(n).default}})}(FT),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.RenewalPolicy=e.InvalidationPolicyEvent=e.InvalidationPolicyCacheAuditor=e.useFragmentWhere=e.useFragment=e.ApolloExtensionsClient=e.makeCachedVar=e.InvalidationPolicyCache=void 0;var t=cc;Object.defineProperty(e,"InvalidationPolicyCache",{enumerable:!0,get:function(){return t.InvalidationPolicyCache}}),Object.defineProperty(e,"makeCachedVar",{enumerable:!0,get:function(){return t.makeCachedVar}});var n=uf;Object.defineProperty(e,"ApolloExtensionsClient",{enumerable:!0,get:function(){return n.ApolloExtensionsClient}});var r=qE;Object.defineProperty(e,"useFragment",{enumerable:!0,get:function(){return r.useFragment}}),Object.defineProperty(e,"useFragmentWhere",{enumerable:!0,get:function(){return r.useFragmentWhere}});var i=FT;Object.defineProperty(e,"InvalidationPolicyCacheAuditor",{enumerable:!0,get:function(){return i.InvalidationPolicyCacheAuditor}});var o=nl;Object.defineProperty(e,"InvalidationPolicyEvent",{enumerable:!0,get:function(){return o.InvalidationPolicyEvent}}),Object.defineProperty(e,"RenewalPolicy",{enumerable:!0,get:function(){return o.RenewalPolicy}})}(sc);var ab=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===sb}(e)}(e)};var sb="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function cb(e,t){return!1!==t.clone&&t.isMergeableObject(e)?fb((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function ub(e,t,n){return e.concat(t).map(function(e){return cb(e,n)})}function lb(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[]}(e))}function pb(e,t){try{return t in e}catch(e){return!1}}function db(e,t,n){var r={};return n.isMergeableObject(e)&&lb(e).forEach(function(t){r[t]=cb(e[t],n)}),lb(t).forEach(function(i){(function(e,t){return pb(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,i)||(pb(e,i)&&n.isMergeableObject(t[i])?r[i]=function(e,t){if(!t.customMerge)return fb;var n=t.customMerge(e);return"function"==typeof n?n:fb}(i,n)(e[i],t[i],n):r[i]=cb(t[i],n))}),r}function fb(e,t,n){(n=n||{}).arrayMerge=n.arrayMerge||ub,n.isMergeableObject=n.isMergeableObject||ab,n.cloneUnlessOtherwiseSpecified=cb;var r=Array.isArray(t);return r===Array.isArray(e)?r?n.arrayMerge(e,t,n):db(e,t,n):cb(t,n)}fb.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(e,n){return fb(e,n,t)},{})};var hb=M(fb);const yb=["ROOT_QUERY","authenticatedUser","__ref"];class vb extends sc.InvalidationPolicyCache{constructor(e){super(e),this.cacheIdentityKey=yb,(null==e?void 0:e.cacheIdentityKey)&&(this.cacheIdentityKey=e.cacheIdentityKey)}}function mb(e){return new vb(e)}function gb(e,t,n){if(!t)return;const r=e.cache.extract(),i=function(e,t){return hb(e,t,{arrayMerge:(e,t)=>[...t,...e.filter(e=>t.every(t=>!ac(e,t)))]})}(n.overrideClient?r:t,n.overrideClient?t:r);e.cache.restore(i),n.broadcast&&e.cache.modify({fields:{}})}function Eb(e){const t=e.middlewares||[],n=ae({uri:"string"==typeof e.uri?e.uri:e.uri(),headers:e.headers,credentials:"include",fetchOptions:{mode:"cors"}}),r=c([...t,n]);return new u({ssrMode:F(),link:r,cache:mb(e.cacheConfig),defaultContext:e.defaultContext})}function Tb(e,t){return(null==t?void 0:t.props)&&(t.props[k]=e.cache.extract()),t}class bb{constructor(e){const{cacheConfig:t}=e,n=P(e,["cacheConfig"]);this._initialApolloOptions=n,this._cacheConfig=t,mi(this,"_getCacheConfig","initializeApollo","generateUseApolloHook")}_getCacheConfig(e){const t={skipOnRead:void 0===e||e};return this._cacheConfig?this._cacheConfig(t):void 0}initializeApollo(e){const t=e||{},{networkOnly:n}=t,r=P(t,["networkOnly"]),i=this._getCacheConfig(n),o=Object.assign(Object.assign(Object.assign({},this._initialApolloOptions),r),{cacheConfig:i});return F()?Eb(o):(this._apolloClient||(this._apolloClient=Eb(o)),this._apolloClient)}generateUseApolloHook(){const e=this.initializeApollo,t=this._getCacheConfig;return function(n){const[s,c]=o(),u=n[k],l=function(e){const t=i();return r(()=>{t.current=e}),t.current}(u),p=a(()=>{const t=e({networkOnly:!1});return u&&!ac(u,l)&&(gb(t,u,{overrideClient:!0,broadcast:!0}),s&&s.persist()),t},[s,l,u]);var d;return d=()=>{!function(){L(this,0,void 0,function*(){const e=mb(t(!1)),n=x(e);yield n.restore();const r=e.cacheIdentityKey,i=Yo(e.extract(),r,null),o=Yo(p.cache.extract(),r,null);o&&ac(o,i)||(yield n.purge(),yield e.reset()),gb(p,e.extract(),{broadcast:!0,overrideClient:!1});const a=x(p.cache);c(a)})}()},r(d,[]),{client:p,cachePersistor:s}}}}function _b(e){return null!=e}function Nb(e,t){return e.some(e=>{if(function(e){return"object"==typeof e&&null!==e&&"__ref"in e&&"string"==typeof e.__ref}(e)){const n=e.__ref;return n&&!(n in t)}return!1})}class Ib{constructor(e){this.skipArgName="skip",this.firstArgName="first",this.skipCacheOnRead=!1,(null==e?void 0:e.skipArgName)&&(this.skipArgName=e.skipArgName),(null==e?void 0:e.firstArgName)&&(this.firstArgName=e.firstArgName),(null==e?void 0:e.cacheOptions.skipOnRead)&&(this.skipCacheOnRead=e.cacheOptions.skipOnRead),mi(this,"_readPage","_readAll","_networkOnlyRead","getReadFunction","mergeLists")}_readPage(e,t){var n,r;const i=(null===(n=null==t?void 0:t.args)||void 0===n?void 0:n[this.skipArgName])||0,o=(null===(r=null==t?void 0:t.args)||void 0===r?void 0:r[this.firstArgName])||0;if(!e||e.length<i+o)return;const a=e.slice(i,i+o).filter(_b);return Nb(a,t.cache.extract())?void 0:a}_readAll(e,t){if(!e)return;const n=t.cache.extract(),r=e.filter(_b);return Nb(r,n)?void 0:r}_networkOnlyRead(){}getReadFunction(e){return this.skipCacheOnRead?this._networkOnlyRead:"paginate"===e?this._readPage:this._readAll}mergeLists(e,t,n){var r,i;const o=e?e.slice(0):[],a=(null===(r=null==n?void 0:n.args)||void 0===r?void 0:r[this.skipArgName])||0,s=(null===(i=null==n?void 0:n.args)||void 0===i?void 0:i[this.firstArgName])||0;o.length<a+s&&(o.length=a+s);for(let e=0;e<Math.max(t.length,s);e++)o[a+e]=e<t.length?t[e]:null;return o}}export{bb as ApolloHelper,j as CachePersistorContext,Ib as ListHelper,Tb as extractApolloState,C as useCachePersistor};
//# sourceMappingURL=index.js.map