@platform-mesh/portal-ui-lib 0.49.7 → 0.49.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -78,7 +78,7 @@ class Ys{headers;normalizedNames=new Map;lazyInit;lazyUpdate=null;constructor(e)
78
78
  * @license Angular v21.2.17
79
79
  * (c) 2010-2026 Google LLC. https://angular.dev/
80
80
  * License: MIT
81
- */globalThis.$localize=S7;const Mo=globalThis.Luigi;let Cr=(()=>{class n{setConfig(t){return Mo.setConfig(t)}get config(){return Mo.getConfig()}getConfigValue(t){return Mo.getConfigValue(t)}unloadConfig(){return Mo.unload()}sendCustomMessage(t){return Mo.sendCustomMessage(t)}configChanged(t){Mo.configChanged(t)}customMessages(){return Mo.customMessages()}navigation(){return Mo.navigation()}resetLuigi(){Mo.reset()}clearNavigationCache(){Mo.clearNavigationCache&&Mo.clearNavigationCache()}showAlert(t){return Mo.showAlert(t)}ux(){return Mo.ux()}theming(){return Mo.theming()}i18n(){return Mo.i18n()}globalSearch(){return Mo.globalSearch()}getGlobalContext(){return Mo.getGlobalContext()}getWcExtendedContext(){return document.querySelector(".wcContainer")?.querySelector("[lui_web_component]")?.extendedContext?.context}getWcModalExtendedContext(){return document.querySelector(".iframeModalCtn")?.querySelector("[lui_web_component]")?.extendedContext?.context}setGlobalContext(t,i=!1){Mo.setGlobalContext(t,i)}setInGlobalContext(t,i=!1){Mo.setGlobalContext({...this.getGlobalContext(),...t},i)}routing(){return Mo.routing()}setFeatureToggle(t){Mo.featureToggles().setFeatureToggle(t)}unsetFeatureToggle(t){Mo.featureToggles().unsetFeatureToggle(t)}unsetAllFeatureToggles(){Mo.featureToggles().getActiveFeatureToggleList().forEach(t=>{this.unsetFeatureToggle(t)})}setFeatureToggles(t){if(t)for(const i of Object.keys(t))t[i]&&this.setFeatureToggle(i)}isFeatureToggleActive(t){return Mo.featureToggles().getActiveFeatureToggleList().includes(t)}getActiveFeatureToggleList(){return Mo.featureToggles().getActiveFeatureToggleList()}setAuthData(t){Mo.auth().store.setAuthData(t),Mo.auth().store.setNewlyAuthorized()}removeAuthData(){Mo.auth().store.removeAuthData()}getAuthData(){return Mo.auth().store.getAuthData()}setCurrentLocale(t){Mo.i18n().setCurrentLocale(t)}static{this.\u0275fac=function(i){return new(i||n)}}static{this.\u0275prov=Bt({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})(),p1=(()=>{class n{constructor(){this.http=we(ud)}getEnvConfig(){var t=this;return(0,M.A)(function*(){return t.envConfigCache||(yield f5(t.http.get("/rest/envconfig").pipe(l1(i=>t.envConfigCache=i)))),t.envConfigCache})()}static{this.\u0275fac=function(i){return new(i||n)}}static{this.\u0275prov=Bt({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})(),_d=(()=>{class n{constructor(){this.envConfigService=we(p1),this.luigiCoreService=we(Cr),this.fallbackLanguage="en",this.translationTable={},this.currentLanguage=""}afterInit(){this.currentLanguage=this.luigiCoreService.i18n().getCurrentLocale(),this.luigiCoreService.i18n().addCurrentLocaleChangeListener(t=>{this.currentLanguage=t})}getTranslation(t,i,o){let r=this.getInternalTranslation(t,i,o);return r||(r=this.findTranslation(t,this.translationTable,this.fallbackLanguage,i)),r||t}getTranslationAsync(t,i,o){var r=this;return(0,M.A)(function*(){return new Promise(s=>{let l=r.getInternalTranslation(t,i,o);l?s(l||t):r.translationTable&&!r.translationTable[r.fallbackLanguage]?r.fetchTranslationFile(r.fallbackLanguage).then(()=>{l=r.findTranslation(t,r.translationTable,r.fallbackLanguage,i),s(l||t)}):(l=r.findTranslation(t,r.translationTable,r.fallbackLanguage,i),s(l||t))})})()}findTranslation(t,i,o,r){if(i[o]){const s="object"==typeof i[o][t]?i[o][t].join("<br>"):i[o][t];return r?this.findInterpolations(s,r):s}}findInterpolations(t,i){if(t)return Object.keys(i).forEach(o=>{t=t.replace(new RegExp("{"+o+"}","gi"),i[o])}),t}addTranslationFile(t,i){i&&t&&(this.translationTable[t]=i)}fetchTranslationFile(t){var i=this;return(0,M.A)(function*(){return new Promise(o=>{fetch(`/assets/translation-files/${t}.json`).then(r=>r.json()).then(r=>{i.addTranslationFile(t,r),o(!0)}).catch(r=>{console.error("Error:",r),i.addTranslationFile(t,{}),o(!1)})})})()}getInternalTranslation(t,i,o){return t?(this.currentLanguage=o||this.currentLanguage||this.luigiCoreService.i18n().getCurrentLocale(),this.findTranslation(t,this.translationTable,this.currentLanguage,i)):""}getValidLanguages(){var t=this;return(0,M.A)(function*(){const i=[{value:"en",label:"USERSETTINGSDIALOG_LANGUAGE_EN"}];try{const{developmentInstance:o}=yield t.envConfigService.getEnvConfig();o&&i.push({value:"de",label:"USERSETTINGSDIALOG_LANGUAGE_DE"})}finally{return i}})()}static{this.\u0275fac=function(i){return new(i||n)}}static{this.\u0275prov=Bt({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();var f1=function(n){return n.LAST_NAVIGATION_URL="openmfp.navigation.lastUrl",n.USER_SETTINGS="openmfp.settings.userSettings",n.LOCAL_DEVELOPMENT_SETTINGS="openmfp.settings.localDevelopmentSettings",n.FEATURE_TOGGLE_SETTINGS="openmfp.settings.featureToggleSettings",n.DEVELOPMENT_MODE_CONFIG="dev-mode-settings",n}(f1||{});(0,M.A)(function*(e){return e.frame_userAccount&&e.frame_userAccount.language?(delete e.frame_userAccount.name,delete e.frame_userAccount.email):delete e.frame_userAccount,new Promise((t,i)=>{try{localStorage.setItem(f1.USER_SETTINGS,JSON.stringify(e)),t(e)}catch(o){console.error("Error storing user settings",o),i({closeDialog:!0,message:"Could not write userSettings to storage..."})}})}),document.body.classList.add("ui5-content-density-compact");let oH=(()=>{class n{constructor(){this.luigiCoreService=we(Cr)}getGatewayUrl(t,i=!1){const o=t.portalContext.crdGatewayApiUrl,r=this.extractKcpPath(o);return o?.replace(r,this.resolveKcpPath(t,i))}updateCrdGatewayUrlWithEntityPath(t){const i=this.luigiCoreService.getGlobalContext().portalContext.crdGatewayApiUrl,o=this.extractKcpPath(i);this.luigiCoreService.getGlobalContext().portalContext.crdGatewayApiUrl=i.replace(o,t)}resolveKcpPath(t,i=!1){let r=this.extractKcpPath(t.portalContext.crdGatewayApiUrl);if(t.kcpPath&&(r=t.kcpPath),i){const s=r.lastIndexOf(":");-1!==s&&(r=r.slice(0,s))}return r}extractKcpPath(t){return t.match(new RegExp("(root:orgs[^/]*)"))?.[1]||""}static{this.\u0275fac=function(i){return new(i||n)}}static{this.\u0275prov=Bt({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();const pd=new wn(n=>n.complete());function ml(n,e){return n.definitions.find(t=>"OperationDefinition"===t.kind&&!!t.name)?.name.value??e}function N7(n,e){if(!n)throw new Error(e)}function Wy(n){return L7(n,[])}function L7(n,e){switch(typeof n){case"string":return JSON.stringify(n);case"function":return n.name?`[function ${n.name}]`:"[function]";case"object":return function Dye(n,e){if(null===n)return"null";if(e.includes(n))return"[Circular]";const t=[...e,n];if(function Nye(n){return"function"==typeof n.toJSON}(n)){const i=n.toJSON();if(i!==n)return"string"==typeof i?i:L7(i,t)}else if(Array.isArray(n))return function Mye(n,e){if(0===n.length)return"[]";if(e.length>2)return"[Array]";const t=Math.min(10,n.length),i=n.length-t,o=[];for(let r=0;r<t;++r)o.push(L7(n[r],e));return 1===i?o.push("... 1 more item"):i>1&&o.push(`... ${i} more items`),"["+o.join(", ")+"]"}(n,t);return function Lye(n,e){const t=Object.entries(n);return 0===t.length?"{}":e.length>2?"["+function Rye(n){const e=Object.prototype.toString.call(n).replace(/^\[object /,"").replace(/]$/,"");if("Object"===e&&"function"==typeof n.constructor){const t=n.constructor.name;if("string"==typeof t&&""!==t)return t}return e}(n)+"]":"{ "+t.map(([o,r])=>o+": "+L7(r,e)).join(", ")+" }"}(n,t)}(n,e);default:return String(n)}}class kye{constructor(e,t,i){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=i}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}}class sH{constructor(e,t,i,o,r,s){this.kind=e,this.start=t,this.end=i,this.line=o,this.column=r,this.value=s,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 aH={Name:[],Document:["definitions"],OperationDefinition:["description","name","variableDefinitions","directives","selectionSet"],VariableDefinition:["description","variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["description","name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","directives","locations"],SchemaExtension:["directives","operationTypes"],DirectiveExtension:["name","directives"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"],TypeCoordinate:["name"],MemberCoordinate:["name","memberName"],ArgumentCoordinate:["name","fieldName","argumentName"],DirectiveCoordinate:["name"],DirectiveArgumentCoordinate:["name","argumentName"]},Oye=new Set(Object.keys(aH));function lH(n){const e=n?.kind;return"string"==typeof e&&Oye.has(e)}var _u=function(n){return n.QUERY="query",n.MUTATION="mutation",n.SUBSCRIPTION="subscription",n}(_u||{}),_n=function(n){return n.NAME="Name",n.DOCUMENT="Document",n.OPERATION_DEFINITION="OperationDefinition",n.VARIABLE_DEFINITION="VariableDefinition",n.SELECTION_SET="SelectionSet",n.FIELD="Field",n.ARGUMENT="Argument",n.FRAGMENT_SPREAD="FragmentSpread",n.INLINE_FRAGMENT="InlineFragment",n.FRAGMENT_DEFINITION="FragmentDefinition",n.VARIABLE="Variable",n.INT="IntValue",n.FLOAT="FloatValue",n.STRING="StringValue",n.BOOLEAN="BooleanValue",n.NULL="NullValue",n.ENUM="EnumValue",n.LIST="ListValue",n.OBJECT="ObjectValue",n.OBJECT_FIELD="ObjectField",n.DIRECTIVE="Directive",n.NAMED_TYPE="NamedType",n.LIST_TYPE="ListType",n.NON_NULL_TYPE="NonNullType",n.SCHEMA_DEFINITION="SchemaDefinition",n.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",n.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",n.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",n.FIELD_DEFINITION="FieldDefinition",n.INPUT_VALUE_DEFINITION="InputValueDefinition",n.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",n.UNION_TYPE_DEFINITION="UnionTypeDefinition",n.ENUM_TYPE_DEFINITION="EnumTypeDefinition",n.ENUM_VALUE_DEFINITION="EnumValueDefinition",n.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",n.DIRECTIVE_DEFINITION="DirectiveDefinition",n.SCHEMA_EXTENSION="SchemaExtension",n.DIRECTIVE_EXTENSION="DirectiveExtension",n.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",n.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",n.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",n.UNION_TYPE_EXTENSION="UnionTypeExtension",n.ENUM_TYPE_EXTENSION="EnumTypeExtension",n.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension",n.TYPE_COORDINATE="TypeCoordinate",n.MEMBER_COORDINATE="MemberCoordinate",n.ARGUMENT_COORDINATE="ArgumentCoordinate",n.DIRECTIVE_COORDINATE="DirectiveCoordinate",n.DIRECTIVE_ARGUMENT_COORDINATE="DirectiveArgumentCoordinate",n}(_n||{});const zh=Object.freeze({});function pu(n,e,t=aH){const i=new Map;for(const ge of Object.values(_n))i.set(ge,$y(e,ge));let o,m,b,r=Array.isArray(n),s=[n],l=-1,h=[],f=n;const A=[],T=[];do{l++;const ge=l===s.length,Me=ge&&0!==h.length;if(ge){if(m=0===T.length?void 0:A[A.length-1],f=b,b=T.pop(),Me)if(r){f=f.slice();let Nt=0;for(const[Zt,Wn]of h){const Ri=Zt-Nt;null===Wn?(f.splice(Ri,1),Nt++):f[Ri]=Wn}}else{f={...f};for(const[Nt,Zt]of h)f[Nt]=Zt}l=o.index,s=o.keys,h=o.edits,r=o.inArray,o=o.prev}else if(b){if(m=r?l:s[l],f=b[m],null==f)continue;A.push(m)}let Ct;if(!Array.isArray(f)){var U,K;lH(f)||N7(!1,`Invalid AST Node: ${Wy(f)}.`);const Nt=ge?null===(U=i.get(f.kind))||void 0===U?void 0:U.leave:null===(K=i.get(f.kind))||void 0===K?void 0:K.enter;if(Ct=Nt?.call(e,f,m,b,A,T),Ct===zh)break;if(!1===Ct){if(!ge){A.pop();continue}}else if(void 0!==Ct&&(h.push([m,Ct]),!ge)){if(!lH(Ct)){A.pop();continue}f=Ct}}var ne;void 0===Ct&&Me&&h.push([m,f]),ge?A.pop():(o={inArray:r,index:l,keys:s,edits:h,prev:o},r=Array.isArray(f),s=r?f:null!==(ne=t[f.kind])&&void 0!==ne?ne:[],l=-1,h=[],b&&T.push(b),b=f)}while(void 0!==o);return 0!==h.length?h[h.length-1][1]:n}function $y(n,e){const t=n[e];return"object"==typeof t?t:"function"==typeof t?{enter:t,leave:void 0}:{enter:n.enter,leave:n.leave}}function Ef(n){try{return n()}catch{}}const Zy=Ef(()=>globalThis)||Ef(()=>window)||Ef(()=>self)||Ef(()=>global)||Ef(function(){return Ef.constructor("return this")()}),Yy="4.2.6",cH=new Map;function uH(n){const e=cH.get(n)||1;return cH.set(n,e+1),`${n}:${e}:${Math.random().toString(36).slice(2)}`}const hH="Invariant Violation";class Ky extends Error{constructor(e=hH){super(e),this.name=hH,Object.setPrototypeOf(this,Ky.prototype)}}const M7=["debug","log","warn","error","silent"];let qy=M7.indexOf("silent");function bn(n,...e){if(!n)throw vl(...e)}function R7(n){return function(e,...t){if(M7.indexOf(n)>=qy){const i=console[n]||console.log;if("number"==typeof e){const o=e;(e=pH(o))||(e=fH(o,t),t=[])}i(e,...t)}}}function vl(n,...e){return new Ky(pH(n,e)||fH(n,e))}bn.debug=R7("debug"),bn.log=R7("log"),bn.warn=R7("warn"),bn.error=R7("error");const _H=Symbol.for("ApolloErrorMessageHandler_"+Yy);function Xy(n){if("string"==typeof n)return n;try{return function dH(n,e=0){const t=uH("stringifyForDisplay");return JSON.stringify(n,(i,o)=>void 0===o?t:o,e).split(JSON.stringify(t)).join("<undefined>")}(n,2).slice(0,1e3)}catch{return"<non-serializable>"}}function pH(n,e=[]){if(n)return Zy[_H]&&Zy[_H](n,e.map(Xy))}function fH(n,e=[]){if(n)return"string"==typeof n?e.reduce((t,i)=>t.replace(/%[sdfo]/,Xy(i)),n):`An error occurred! For more details, see the full error text at https://go.apollo.dev/c/err#${encodeURIComponent(JSON.stringify({version:Yy,message:n,args:e.map(Xy)}))}`}const fd={...Zy[Symbol.for("apollo.cacheSize")]},Pye=()=>Object.create(null),{forEach:Fye,slice:gH}=Array.prototype,{hasOwnProperty:Hye}=Object.prototype;class fu{constructor(e=!0,t=Pye){this.weakness=e,this.makeData=t}lookup(){return this.lookupArray(arguments)}lookupArray(e){let t=this;return Fye.call(e,i=>t=t.getChildTrie(i)),Hye.call(t,"data")?t.data:t.data=this.makeData(gH.call(e))}peek(){return this.peekArray(arguments)}peekArray(e){let t=this;for(let i=0,o=e.length;t&&i<o;++i){const r=t.mapFor(e[i],!1);t=r&&r.get(e[i])}return t&&t.data}remove(){return this.removeArray(arguments)}removeArray(e){let t;if(e.length){const i=e[0],o=this.mapFor(i,!1),r=o&&o.get(i);r&&(t=r.removeArray(gH.call(e,1)),!r.data&&!r.weak&&(!r.strong||!r.strong.size)&&o.delete(i))}else t=this.data,delete this.data;return t}getChildTrie(e){const t=this.mapFor(e,!0);let i=t.get(e);return i||t.set(e,i=new fu(this.weakness,this.makeData)),i}mapFor(e,t){return this.weakness&&function Uye(n){switch(typeof n){case"object":if(null===n)break;case"function":return!0}return!1}(e)?this.weak||(t?this.weak=new WeakMap:void 0):this.strong||(t?this.strong=new Map:void 0)}}function Qy(){}const zye=Qy,Vye=typeof WeakRef<"u"?WeakRef:function(n){return{deref:()=>n}},jye=typeof WeakMap<"u"?WeakMap:Map,Gye=typeof FinalizationRegistry<"u"?FinalizationRegistry:function(){return{register:Qy,unregister:Qy}};class k7{constructor(e=1/0,t=zye){this.max=e,this.dispose=t,this.map=new jye,this.newest=null,this.oldest=null,this.unfinalizedNodes=new Set,this.finalizationScheduled=!1,this.size=0,this.finalize=()=>{const i=this.unfinalizedNodes.values();for(let o=0;o<10024;o++){const r=i.next().value;if(!r)break;this.unfinalizedNodes.delete(r);const s=r.key;delete r.key,r.keyRef=new Vye(s),this.registry.register(s,r,r)}this.unfinalizedNodes.size>0?queueMicrotask(this.finalize):this.finalizationScheduled=!1},this.registry=new Gye(this.deleteNode.bind(this))}has(e){return this.map.has(e)}get(e){const t=this.getNode(e);return t&&t.value}getNode(e){const t=this.map.get(e);if(t&&t!==this.newest){const{older:i,newer:o}=t;o&&(o.older=i),i&&(i.newer=o),t.older=this.newest,t.older.newer=t,t.newer=null,this.newest=t,t===this.oldest&&(this.oldest=o)}return t}set(e,t){let i=this.getNode(e);return i?i.value=t:(i={key:e,value:t,newer:null,older:this.newest},this.newest&&(this.newest.newer=i),this.newest=i,this.oldest=this.oldest||i,this.scheduleFinalization(i),this.map.set(e,i),this.size++,i.value)}clean(){for(;this.oldest&&this.size>this.max;)this.deleteNode(this.oldest)}deleteNode(e){e===this.newest&&(this.newest=e.older),e===this.oldest&&(this.oldest=e.newer),e.newer&&(e.newer.older=e.older),e.older&&(e.older.newer=e.newer),this.size--;const t=e.key||e.keyRef&&e.keyRef.deref();this.dispose(e.value,t),e.keyRef?this.registry.unregister(e):this.unfinalizedNodes.delete(e),t&&this.map.delete(t)}delete(e){const t=this.map.get(e);return!!t&&(this.deleteNode(t),!0)}scheduleFinalization(e){this.unfinalizedNodes.add(e),this.finalizationScheduled||(this.finalizationScheduled=!0,queueMicrotask(this.finalize))}}function $ye(){}class Jy{constructor(e=1/0,t=$ye){this.max=e,this.dispose=t,this.map=new Map,this.newest=null,this.oldest=null}has(e){return this.map.has(e)}get(e){const t=this.getNode(e);return t&&t.value}get size(){return this.map.size}getNode(e){const t=this.map.get(e);if(t&&t!==this.newest){const{older:i,newer:o}=t;o&&(o.older=i),i&&(i.newer=o),t.older=this.newest,t.older.newer=t,t.newer=null,this.newest=t,t===this.oldest&&(this.oldest=o)}return t}set(e,t){let i=this.getNode(e);return i?i.value=t:(i={key:e,value:t,newer:null,older:this.newest},this.newest&&(this.newest.newer=i),this.newest=i,this.oldest=this.oldest||i,this.map.set(e,i),i.value)}clean(){for(;this.oldest&&this.map.size>this.max;)this.delete(this.oldest.key)}delete(e){const t=this.map.get(e);return!!t&&(t===this.newest&&(this.newest=t.older),t===this.oldest&&(this.oldest=t.newer),t.newer&&(t.newer.older=t.older),t.older&&(t.older.newer=t.newer),this.map.delete(e),this.dispose(t.value,e),!0)}}const ew=new WeakSet;function mH(n){n.size<=(n.max||-1)||ew.has(n)||(ew.add(n),setTimeout(()=>{n.clean(),ew.delete(n)},100))}const tw=function(n,e){const t=new k7(n,e);return t.set=function(i,o){const r=k7.prototype.set.call(this,i,o);return mH(this),r},t},Zye=function(n,e){const t=new Jy(n,e);return t.set=function(i,o){const r=Jy.prototype.set.call(this,i,o);return mH(this),r},t};function vH(n,{max:e,makeCacheKey:t=i=>i}){const i=new fu(!0),o=new tw(e);return(...r)=>{const s=i.lookupArray(t(r)),l=o.get(s);if(l){if(l.error)throw l.error;return l.result}const h=o.set(s,{});try{return h.result=n(...r)}catch(f){throw h.error=f,f}}}const Vh=vH((n,e)=>{bn(n&&"Document"===n.kind,1);const t=n.definitions.filter(i=>"OperationDefinition"===i.kind);e&&bn(1==t.length&&t[0].operation===e,4,e,e,t[0].operation),pu(n,{Field(i,o,r,s){if(i.alias&&("__typename"===i.alias.value||i.alias.value.startsWith("__ac_"))&&i.alias.value!==i.name.value){let l=n,h=[];for(const f of s)l=l[f],l.kind===_n.FIELD&&h.push(l.alias?.value||l.name.value);throw h.splice(-1,1,i.name.value),vl(5,i.alias.value,h.join("."),t[0].operation,ml(n,"(anonymous)"))}}})},{max:fd.checkDocument||2e3});function gd(n){return Vh(n),n.definitions.filter(e=>"OperationDefinition"===e.kind)[0]}class Ks{static empty(){return new Ks(()=>pd)}static from(e){if(0===e.length)return Ks.empty();const[t,...i]=e;return t.concat(...i)}static split(e,t,i=new Ks((o,r)=>r(o))){const o=new Ks((r,s)=>e(r)?t.request(r,s):i.request(r,s));return Object.assign(o,{left:t,right:i})}static execute(e,t,i){return e.request(function Yye(n,{client:e}){const t={query:n.query,variables:n.variables||{},extensions:n.extensions||{},operationName:ml(n.query),operationType:gd(n.query).operation};let i={...n.context};const r=()=>Object.freeze({...i});return Object.defineProperty(t,"setContext",{enumerable:!1,value:s=>{i="function"==typeof s?{...i,...s(r())}:{...i,...s}}}),Object.defineProperty(t,"getContext",{enumerable:!1,value:r}),Object.defineProperty(t,"client",{enumerable:!1,value:e}),t}(t,i),()=>pd)}static concat(...e){return Ks.from(e)}constructor(e){e&&(this.request=e)}split(e,t,i){return this.concat(Ks.split(e,t,i))}concat(...e){return 0===e.length?this:e.reduce(this.combine.bind(this),this)}combine(e,t){const i=new Ks((o,r)=>e.request(o,s=>t.request(s,r)));return Object.assign(i,{left:e,right:t})}request(e,t){throw vl(65)}left;right}const Kye=Ks.split,{toString:bH,hasOwnProperty:qye}=Object.prototype,CH=Function.prototype.toString,nw=new Map;function sr(n,e){try{return iw(n,e)}finally{nw.clear()}}function iw(n,e){if(n===e)return!0;const t=bH.call(n);if(t!==bH.call(e))return!1;switch(t){case"[object Array]":if(n.length!==e.length)return!1;case"[object Object]":{if(wH(n,e))return!0;const o=yH(n),r=yH(e),s=o.length;if(s!==r.length)return!1;for(let l=0;l<s;++l)if(!qye.call(e,o[l]))return!1;for(let l=0;l<s;++l){const h=o[l];if(!iw(n[h],e[h]))return!1}return!0}case"[object Error]":return n.name===e.name&&n.message===e.message;case"[object Number]":if(n!=n)return e!=e;case"[object Boolean]":case"[object Date]":return+n==+e;case"[object RegExp]":case"[object String]":return n==`${e}`;case"[object Map]":case"[object Set]":{if(n.size!==e.size)return!1;if(wH(n,e))return!0;const o=n.entries(),r="[object Map]"===t;for(;;){const s=o.next();if(s.done)break;const[l,h]=s.value;if(!e.has(l)||r&&!iw(h,e.get(l)))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]":n=new Uint8Array(n),e=new Uint8Array(e);case"[object DataView]":{let o=n.byteLength;if(o===e.byteLength)for(;o--&&n[o]===e[o];);return-1===o}case"[object AsyncFunction]":case"[object GeneratorFunction]":case"[object AsyncGeneratorFunction]":case"[object Function]":{const o=CH.call(n);return o===CH.call(e)&&!function Jye(n,e){const t=n.length-e.length;return t>=0&&n.indexOf(e,t)===t}(o,Qye)}}return!1}function yH(n){return Object.keys(n).filter(Xye,n)}function Xye(n){return void 0!==this[n]}const Qye="{ [native code] }";function wH(n,e){let t=nw.get(n);if(t){if(t.has(e))return!0}else nw.set(n,t=new Set);return t.add(e),!1}let Rs=null;const AH={};let ewe=1;function TH(n){try{return n()}catch{}}const ow="@wry/context:Slot",IH=TH(()=>globalThis)||TH(()=>global)||Object.create(null),O7=IH[ow]||Array[ow]||function(n){try{Object.defineProperty(IH,ow,{value:n,enumerable:!1,writable:!1,configurable:!0})}finally{return n}}(class{constructor(){this.id=["slot",ewe++,Date.now(),Math.random().toString(36).slice(2)].join(":")}hasValue(){for(let e=Rs;e;e=e.parent)if(this.id in e.slots){const t=e.slots[this.id];if(t===AH)break;return e!==Rs&&(Rs.slots[this.id]=t),!0}return Rs&&(Rs.slots[this.id]=AH),!1}getValue(){if(this.hasValue())return Rs.slots[this.id]}withValue(e,t,i,o){const s=Rs;Rs={parent:s,slots:{__proto__:null,[this.id]:e}};try{return t.apply(o,i)}finally{Rs=s}}static bind(e){const t=Rs;return function(){const i=Rs;try{return Rs=t,e.apply(this,arguments)}finally{Rs=i}}}static noContext(e,t,i){if(!Rs)return e.apply(i,t);{const o=Rs;try{return Rs=null,e.apply(i,t)}finally{Rs=o}}}}),D5=new O7,{hasOwnProperty:owe}=Object.prototype,sw=Array.from||function(n){const e=[];return n.forEach(t=>e.push(t)),e};function B7(n){const{unsubscribe:e}=n;"function"==typeof e&&(n.unsubscribe=void 0,e())}const N5=[];function xf(n,e){if(!n)throw new Error(e||"assertion failure")}function EH(n,e){const t=n.length;return t>0&&t===e.length&&n[t-1]===e[t-1]}function xH(n){switch(n.length){case 0:throw new Error("unknown value");case 1:return n[0];case 2:throw n[1]}}function DH(n){return n.slice(0)}let swe=(()=>{class n{constructor(t){this.fn=t,this.parents=new Set,this.childValues=new Map,this.dirtyChildren=null,this.dirty=!0,this.recomputing=!1,this.value=[],this.deps=null,++n.count}peek(){if(1===this.value.length&&!jh(this))return NH(this),this.value[0]}recompute(t){return xf(!this.recomputing,"already recomputing"),NH(this),jh(this)?function awe(n,e){return BH(n),D5.withValue(n,lwe,[n,e]),function uwe(n,e){if("function"==typeof n.subscribe)try{B7(n),n.unsubscribe=n.subscribe.apply(null,e)}catch{return n.setDirty(),!1}return!0}(n,e)&&function cwe(n){n.dirty=!1,!jh(n)&&MH(n)}(n),xH(n.value)}(this,t):xH(this.value)}setDirty(){this.dirty||(this.dirty=!0,LH(this),B7(this))}dispose(){this.setDirty(),BH(this),aw(this,(t,i)=>{t.setDirty(),PH(t,this)})}forget(){this.dispose()}dependOn(t){t.add(this),this.deps||(this.deps=N5.pop()||new Set),this.deps.add(t)}forgetDeps(){this.deps&&(sw(this.deps).forEach(t=>t.delete(this)),this.deps.clear(),N5.push(this.deps),this.deps=null)}}return n.count=0,n})();function NH(n){const e=D5.getValue();if(e)return n.parents.add(e),e.childValues.has(n)||e.childValues.set(n,[]),jh(n)?RH(e,n):kH(e,n),e}function lwe(n,e){n.recomputing=!0;const{normalizeResult:t}=n;let i;t&&1===n.value.length&&(i=DH(n.value)),n.value.length=0;try{if(n.value[0]=n.fn.apply(null,e),t&&i&&!EH(i,n.value))try{n.value[0]=t(n.value[0],i[0])}catch{}}catch(o){n.value[1]=o}n.recomputing=!1}function jh(n){return n.dirty||!(!n.dirtyChildren||!n.dirtyChildren.size)}function LH(n){aw(n,RH)}function MH(n){aw(n,kH)}function aw(n,e){const t=n.parents.size;if(t){const i=sw(n.parents);for(let o=0;o<t;++o)e(i[o],n)}}function RH(n,e){xf(n.childValues.has(e)),xf(jh(e));const t=!jh(n);if(n.dirtyChildren){if(n.dirtyChildren.has(e))return}else n.dirtyChildren=N5.pop()||new Set;n.dirtyChildren.add(e),t&&LH(n)}function kH(n,e){xf(n.childValues.has(e)),xf(!jh(e));const t=n.childValues.get(e);0===t.length?n.childValues.set(e,DH(e.value)):EH(t,e.value)||n.setDirty(),OH(n,e),!jh(n)&&MH(n)}function OH(n,e){const t=n.dirtyChildren;t&&(t.delete(e),0===t.size&&(N5.length<100&&N5.push(t),n.dirtyChildren=null))}function BH(n){n.childValues.size>0&&n.childValues.forEach((e,t)=>{PH(n,t)}),n.forgetDeps(),xf(null===n.dirtyChildren)}function PH(n,e){e.parents.delete(n),n.childValues.delete(e),OH(n,e)}const dwe={setDirty:!0,dispose:!0,forget:!0};function FH(n){const e=new Map,t=n&&n.subscribe;function i(o){const r=D5.getValue();if(r){let s=e.get(o);s||e.set(o,s=new Set),r.dependOn(s),"function"==typeof t&&(B7(s),s.unsubscribe=t(o))}}return i.dirty=function(r,s){const l=e.get(r);if(l){const h=s&&owe.call(dwe,s)?s:"setDirty";sw(l).forEach(f=>f[h]()),e.delete(r),B7(l)}},i}let HH;function UH(...n){return(HH||(HH=new fu("function"==typeof WeakMap))).lookupArray(n)}const lw=new Set;function L5(n,{max:e=Math.pow(2,16),keyArgs:t,makeCacheKey:i=UH,normalizeResult:o,subscribe:r,cache:s=Jy}=Object.create(null)){const l="function"==typeof s?new s(e,A=>A.dispose()):s,h=function(){const A=i.apply(null,t?t.apply(null,arguments):arguments);if(void 0===A)return n.apply(null,arguments);let T=l.get(A);T||(l.set(A,T=new swe(n)),T.normalizeResult=o,T.subscribe=r,T.forget=()=>l.delete(A));const U=T.recompute(Array.prototype.slice.call(arguments));return l.set(A,T),lw.add(l),D5.hasValue()||(lw.forEach(K=>K.clean()),lw.clear()),U};function f(A){const T=A&&l.get(A);T&&T.setDirty()}function m(A){const T=A&&l.get(A);if(T)return T.peek()}function b(A){return!!A&&l.delete(A)}return Object.defineProperty(h,"size",{get:()=>l.size,configurable:!1,enumerable:!1}),Object.freeze(h.options={max:e,keyArgs:t,makeCacheKey:i,normalizeResult:o,subscribe:r,cache:l}),h.dirtyKey=f,h.dirty=function(){f(i.apply(null,arguments))},h.peekKey=m,h.peek=function(){return m(i.apply(null,arguments))},h.forgetKey=b,h.forget=function(){return b(i.apply(null,arguments))},h.makeCacheKey=i,h.getKey=t?function(){return i.apply(null,t.apply(null,arguments))}:i,Object.freeze(h)}function hwe(n){return n}class md{transform;cached;resultCache=new WeakSet;getCacheKey(e){return[e]}static identity(){return new md(hwe,{cache:!1})}static split(e,t,i=md.identity()){return Object.assign(new md(o=>(e(o)?t:i).transformDocument(o),{cache:!1}),{left:t,right:i})}constructor(e,t={}){this.transform=e,t.getCacheKey&&(this.getCacheKey=t.getCacheKey),this.cached=!1!==t.cache,this.resetCache()}resetCache(){if(this.cached){const e=new fu;this.performWork=L5(md.prototype.performWork.bind(this),{makeCacheKey:t=>{const i=this.getCacheKey(t);if(i)return bn(Array.isArray(i),20),e.lookupArray(i)},max:fd["documentTransform.cache"],cache:k7})}}performWork(e){return Vh(e),this.transform(e)}transformDocument(e){if(this.resultCache.has(e))return e;const t=this.performWork(e);return this.resultCache.add(t),t}concat(e){return Object.assign(new md(t=>e.transformDocument(this.transformDocument(t)),{cache:!1}),{left:this,right:e})}left;right}const zH={kind:_n.FIELD,name:{kind:_n.NAME,value:"__typename"}},cw=Object.assign(function(n){return pu(n,{SelectionSet:{enter(e,t,i){if(i&&i.kind===_n.OPERATION_DEFINITION)return;const{selections:o}=e;return o&&!o.some(l=>l.kind===_n.FIELD&&("__typename"===l.name.value||0===l.name.value.lastIndexOf("__",0)))?i.kind===_n.FIELD&&i.directives&&i.directives.some(l=>"export"===l.name.value)?void 0:{...e,selections:[...o,zH]}:void 0}}})},{added:n=>n===zH}),vd=Object.assign(function(e){return JSON.stringify(e,vwe)},{reset(){Df=new Zye(fd.canonicalStringify||1e3)}});let Df;function vwe(n,e){if(e&&"object"==typeof e){const t=Object.getPrototypeOf(e);if(t===Object.prototype||null===t){const i=Object.keys(e);if(i.every(bwe))return e;const o=JSON.stringify(i);let r=Df.get(o);if(!r){i.sort();const l=JSON.stringify(i);r=Df.get(l)||i,Df.set(o,r),Df.set(l,r)}const s=Object.create(t);return r.forEach(l=>{s[l]=e[l]}),s}}return e}function bwe(n,e,t){return 0===e||t[e-1]<=n}function _w(n){return 9===n||32===n}function M5(n){return n>=48&&n<=57}function WH(n){return n>=97&&n<=122||n>=65&&n<=90}function $H(n){return WH(n)||95===n}function Cwe(n){return WH(n)||M5(n)||95===n}function ywe(n){var e;let t=Number.MAX_SAFE_INTEGER,i=null,o=-1;for(let s=0;s<n.length;++s){var r;const l=n[s],h=wwe(l);h!==l.length&&(i=null!==(r=i)&&void 0!==r?r:s,o=s,0!==s&&h<t&&(t=h))}return n.map((s,l)=>0===l?s:s.slice(t)).slice(null!==(e=i)&&void 0!==e?e:0,o+1)}function wwe(n){let e=0;for(;e<n.length&&_w(n.charCodeAt(e));)++e;return e}vd.reset();const Iwe=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function Swe(n){return Ewe[n.charCodeAt(0)]}const Ewe=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000B","\\f","\\r","\\u000E","\\u000F","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001A","\\u001B","\\u001C","\\u001D","\\u001E","\\u001F","","",'\\"',"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\u007F","\\u0080","\\u0081","\\u0082","\\u0083","\\u0084","\\u0085","\\u0086","\\u0087","\\u0088","\\u0089","\\u008A","\\u008B","\\u008C","\\u008D","\\u008E","\\u008F","\\u0090","\\u0091","\\u0092","\\u0093","\\u0094","\\u0095","\\u0096","\\u0097","\\u0098","\\u0099","\\u009A","\\u009B","\\u009C","\\u009D","\\u009E","\\u009F"];function P7(n){return pu(n,Dwe)}const Dwe={Name:{leave:n=>n.value},Variable:{leave:n=>"$"+n.name},Document:{leave:n=>En(n.definitions,"\n\n")},OperationDefinition:{leave(n){const e=pw(n.variableDefinitions)?Si("(\n",En(n.variableDefinitions,"\n"),"\n)"):Si("(",En(n.variableDefinitions,", "),")"),t=Si("",n.description,"\n")+En([n.operation,En([n.name,e]),En(n.directives," ")]," ");return("query"===t?"":t+" ")+n.selectionSet}},VariableDefinition:{leave:({variable:n,type:e,defaultValue:t,directives:i,description:o})=>Si("",o,"\n")+n+": "+e+Si(" = ",t)+Si(" ",En(i," "))},SelectionSet:{leave:({selections:n})=>Tc(n)},Field:{leave({alias:n,name:e,arguments:t,directives:i,selectionSet:o}){const r=Si("",n,": ")+e;let s=r+Si("(",En(t,", "),")");return s.length>80&&(s=r+Si("(\n",F7(En(t,"\n")),"\n)")),En([s,En(i," "),o]," ")}},Argument:{leave:({name:n,value:e})=>n+": "+e},FragmentSpread:{leave:({name:n,directives:e})=>"..."+n+Si(" ",En(e," "))},InlineFragment:{leave:({typeCondition:n,directives:e,selectionSet:t})=>En(["...",Si("on ",n),En(e," "),t]," ")},FragmentDefinition:{leave:({name:n,typeCondition:e,variableDefinitions:t,directives:i,selectionSet:o,description:r})=>Si("",r,"\n")+`fragment ${n}${Si("(",En(t,", "),")")} on ${e} ${Si("",En(i," ")," ")}`+o},IntValue:{leave:({value:n})=>n},FloatValue:{leave:({value:n})=>n},StringValue:{leave:({value:n,block:e})=>e?function Awe(n,e){const t=n.replace(/"""/g,'\\"""'),i=t.split(/\r\n|[\n\r]/g),o=1===i.length,r=i.length>1&&i.slice(1).every(T=>0===T.length||_w(T.charCodeAt(0))),s=t.endsWith('\\"""'),l=n.endsWith('"')&&!s,h=n.endsWith("\\"),f=l||h,m=!(null!=e&&e.minimize)&&(!o||n.length>70||f||r||s);let b="";const A=o&&_w(n.charCodeAt(0));return(m&&!A||r)&&(b+="\n"),b+=t,(m||f)&&(b+="\n"),'"""'+b+'"""'}(n):function Twe(n){return`"${n.replace(Iwe,Swe)}"`}(n)},BooleanValue:{leave:({value:n})=>n?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:n})=>n},ListValue:{leave:({values:n})=>"["+En(n,", ")+"]"},ObjectValue:{leave:({fields:n})=>"{"+En(n,", ")+"}"},ObjectField:{leave:({name:n,value:e})=>n+": "+e},Directive:{leave:({name:n,arguments:e})=>"@"+n+Si("(",En(e,", "),")")},NamedType:{leave:({name:n})=>n},ListType:{leave:({type:n})=>"["+n+"]"},NonNullType:{leave:({type:n})=>n+"!"},SchemaDefinition:{leave:({description:n,directives:e,operationTypes:t})=>Si("",n,"\n")+En(["schema",En(e," "),Tc(t)]," ")},OperationTypeDefinition:{leave:({operation:n,type:e})=>n+": "+e},ScalarTypeDefinition:{leave:({description:n,name:e,directives:t})=>Si("",n,"\n")+En(["scalar",e,En(t," ")]," ")},ObjectTypeDefinition:{leave:({description:n,name:e,interfaces:t,directives:i,fields:o})=>Si("",n,"\n")+En(["type",e,Si("implements ",En(t," & ")),En(i," "),Tc(o)]," ")},FieldDefinition:{leave:({description:n,name:e,arguments:t,type:i,directives:o})=>Si("",n,"\n")+e+(pw(t)?Si("(\n",F7(En(t,"\n")),"\n)"):Si("(",En(t,", "),")"))+": "+i+Si(" ",En(o," "))},InputValueDefinition:{leave:({description:n,name:e,type:t,defaultValue:i,directives:o})=>Si("",n,"\n")+En([e+": "+t,Si("= ",i),En(o," ")]," ")},InterfaceTypeDefinition:{leave:({description:n,name:e,interfaces:t,directives:i,fields:o})=>Si("",n,"\n")+En(["interface",e,Si("implements ",En(t," & ")),En(i," "),Tc(o)]," ")},UnionTypeDefinition:{leave:({description:n,name:e,directives:t,types:i})=>Si("",n,"\n")+En(["union",e,En(t," "),Si("= ",En(i," | "))]," ")},EnumTypeDefinition:{leave:({description:n,name:e,directives:t,values:i})=>Si("",n,"\n")+En(["enum",e,En(t," "),Tc(i)]," ")},EnumValueDefinition:{leave:({description:n,name:e,directives:t})=>Si("",n,"\n")+En([e,En(t," ")]," ")},InputObjectTypeDefinition:{leave:({description:n,name:e,directives:t,fields:i})=>Si("",n,"\n")+En(["input",e,En(t," "),Tc(i)]," ")},DirectiveDefinition:{leave:({description:n,name:e,arguments:t,directives:i,repeatable:o,locations:r})=>Si("",n,"\n")+"directive @"+e+(pw(t)?Si("(\n",F7(En(t,"\n")),"\n)"):Si("(",En(t,", "),")"))+Si(" ",En(i," "))+(o?" repeatable":"")+" on "+En(r," | ")},SchemaExtension:{leave:({directives:n,operationTypes:e})=>En(["extend schema",En(n," "),Tc(e)]," ")},ScalarTypeExtension:{leave:({name:n,directives:e})=>En(["extend scalar",n,En(e," ")]," ")},ObjectTypeExtension:{leave:({name:n,interfaces:e,directives:t,fields:i})=>En(["extend type",n,Si("implements ",En(e," & ")),En(t," "),Tc(i)]," ")},InterfaceTypeExtension:{leave:({name:n,interfaces:e,directives:t,fields:i})=>En(["extend interface",n,Si("implements ",En(e," & ")),En(t," "),Tc(i)]," ")},UnionTypeExtension:{leave:({name:n,directives:e,types:t})=>En(["extend union",n,En(e," "),Si("= ",En(t," | "))]," ")},EnumTypeExtension:{leave:({name:n,directives:e,values:t})=>En(["extend enum",n,En(e," "),Tc(t)]," ")},InputObjectTypeExtension:{leave:({name:n,directives:e,fields:t})=>En(["extend input",n,En(e," "),Tc(t)]," ")},DirectiveExtension:{leave:({name:n,directives:e})=>En(["extend directive @"+n,En(e," ")]," ")},TypeCoordinate:{leave:({name:n})=>n},MemberCoordinate:{leave:({name:n,memberName:e})=>En([n,Si(".",e)])},ArgumentCoordinate:{leave:({name:n,fieldName:e,argumentName:t})=>En([n,Si(".",e),Si("(",t,":)")])},DirectiveCoordinate:{leave:({name:n})=>En(["@",n])},DirectiveArgumentCoordinate:{leave:({name:n,argumentName:e})=>En(["@",n,Si("(",e,":)")])}};function En(n,e=""){var t;return null!==(t=n?.filter(i=>i).join(e))&&void 0!==t?t:""}function Tc(n){return Si("{\n",F7(En(n,"\n")),"\n}")}function Si(n,e,t=""){return null!=e&&""!==e?n+e+t:""}function F7(n){return Si(" ",n.replace(/\n/g,"\n "))}function pw(n){var e;return null!==(e=n?.some(t=>t.includes("\n")))&&void 0!==e&&e}let R5;const k5=Object.assign(n=>{let e=R5.get(n);return e||(e=P7(n),R5.set(n,e)),e},{reset(){R5=new tw(fd.print||2e3)}});function Ro(n){return!(!n||"object"!=typeof n||"string"!=typeof n.__ref)}function O5(n={}){const{connector:e=()=>new Vn,resetOnError:t=!0,resetOnComplete:i=!0,resetOnRefCountZero:o=!0}=n;return r=>{let s,l,h,f=0,m=!1,b=!1;const A=()=>{l?.unsubscribe(),l=void 0},T=()=>{A(),s=h=void 0,m=b=!1},U=()=>{const K=s;T(),K?.unsubscribe()};return ia((K,ne)=>{f++,!b&&!m&&A();const ge=h=h??e();ne.add(()=>{f--,0===f&&!b&&!m&&(l=gw(U,o))}),ge.subscribe(ne),!s&&f>0&&(s=new vt({next:Me=>ge.next(Me),error:Me=>{b=!0,A(),l=gw(T,t,Me),ge.error(Me)},complete:()=>{m=!0,A(),l=gw(T,i),ge.complete()}}),dl(K).subscribe(s))})(r)}}function gw(n,e,...t){if(!0===e)return void n();if(!1===e)return;const i=new vt({next:()=>{i.unsubscribe(),n()}});return dl(e(...t)).subscribe(i)}function H7(n,e,t){let i,o=!1;return n&&"object"==typeof n?({bufferSize:i=1/0,windowTime:e=1/0,refCount:o=!1,scheduler:t}=n):i=n??1/0,O5({connector:()=>new V3(i,e,t),resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:o})}function kwe(n,e){return n===e}k5.reset();const YH=vH(function(e,t,i){return function Pwe(n,e){let t,i;function o(r){return r!==t&&(t=r,i=e(t)),i}return Object.assign(n.pipe(mo(o),H7({bufferSize:1,refCount:!0})),{getCurrentResult:()=>o(n.getCurrentResult())})}(e,i)},{max:1,makeCacheKey:n=>n.slice(0,2)});function B5(n=[]){const e={};return n.forEach(t=>{e[t.name.value]=t}),e}function P5(n){return n.definitions.filter(e=>"FragmentDefinition"===e.kind)}function U7(n,e){switch(n.kind){case"InlineFragment":return n;case"FragmentSpread":{const t=n.name.value;if("function"==typeof e)return e(t);const i=e&&e[t];return bn(i,9,t),i||null}default:return null}}function mw(n){let e;Vh(n);for(let t of n.definitions){if("OperationDefinition"===t.kind)return t;"FragmentDefinition"===t.kind&&!e&&(e=t)}if(e)return e;throw vl(12)}function F5(n){return"Field"===n.kind}function g1(n){return n.alias?n.alias.value:n.name.value}function z7({directives:n},e){return!n||!n.length||function Uwe(n){const e=[];return n&&n.length&&n.forEach(t=>{if(!function Hwe({name:{value:n}}){return"skip"===n||"include"===n}(t))return;const i=t.arguments,o=t.name.value;bn(i&&1===i.length,16,o);const r=i[0];bn(r.name&&"if"===r.name.value,17,o);const s=r.value;bn(s&&("Variable"===s.kind||"BooleanValue"===s.kind),18,o),e.push({directive:t,ifArgument:r})}),e}(n).every(({directive:t,ifArgument:i})=>{let o=!1;return"Variable"===i.value.kind?(o=e&&e[i.value.name.value],bn(void 0!==o,15,t.name.value)):o=i.value.value,"skip"===t.name.value?!o:o})}function KH(n,{data:e,...t},{data:i,...o},r){return sr(t,o)&&V7(mw(n).selectionSet,e,i,{fragmentMap:B5(P5(n)),variables:r})}function V7(n,e,t,i){if(e===t)return!0;const o=new Set;return n.selections.every(r=>{if(o.has(r)||(o.add(r),!z7(r,i.variables))||qH(r))return!0;if(F5(r)){const s=g1(r),l=e&&e[s],h=t&&t[s],f=r.selectionSet;if(!f)return sr(l,h);const m=Array.isArray(l),b=Array.isArray(h);if(m!==b)return!1;if(m&&b){const A=l.length;if(h.length!==A)return!1;for(let T=0;T<A;++T)if(!V7(f,l[T],h[T],i))return!1;return!0}return V7(f,l,h,i)}{const s=U7(r,i.fragmentMap);if(s)return!!qH(s)||V7(s.selectionSet,e,t,i)}})}function qH(n){return!!n.directives&&n.directives.some(zwe)}function zwe(n){return"nonreactive"===n.name.value}function Vwe(n,e){let t=e;const i=[];return n.definitions.forEach(r=>{if("OperationDefinition"===r.kind)throw vl(10,r.operation,r.name?` named '${r.name.value}'`:"");"FragmentDefinition"===r.kind&&i.push(r)}),typeof t>"u"&&(bn(1===i.length,11,i.length),t=i[0].name.value),{...n,definitions:[{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:t}}]}},...n.definitions]}}function jwe(...n){return UH.bind(null,...n)}class XH{assumeImmutableResults=!1;lookupFragment(e){return null}batch(e){let i;return this.performTransaction(()=>i=e.update(this),"string"==typeof e.optimistic?e.optimistic:!1===e.optimistic?null:void 0),i}recordOptimisticTransaction(e,t){this.performTransaction(e,t)}transformDocument(e){return e}transformForLink(e){return e}identify(e){}gc(){return[]}modify(e){return!1}readQuery(e,t=!!e.optimistic){return this.read({...e,rootId:e.id||"ROOT_QUERY",optimistic:t})}fragmentWatches=new fu(!0);watchFragment(e){const{fragment:t,fragmentName:i,from:o}=e,r=this.getFragmentDoc(t,i),l=(Array.isArray(o)?o:[o]).map(T=>null==T?T:this.toCacheId(T));if(!Array.isArray(o)){const T=this.watchSingleFragment(l[0],r,e);return null===o?T:YH(T,Symbol.for("apollo.transform.individualResult"),U=>({...U,data:U.data??{}}))}let h;function f(T){const U=T.reduce((K,ne,ge)=>(K.data.push(ne.data),K.complete&&=ne.complete,K.dataState=K.complete?"complete":"partial",ne.missing&&(K.missing||={},K.missing[ge]=ne.missing),K),{data:[],dataState:"complete",complete:!0});return sr(h,U)||(h=U),h}if(0===l.length)return Wwe;let m=!1;const b=l.map(T=>this.watchSingleFragment(T,r,e)),A=function Fwe(n){return 0===n.length?pd:new wn(e=>{const{length:t}=n,i=new Array(t),o=new Map;n.forEach((h,f)=>{o.has(h)||o.set(h,new Set),o.get(h).add(f)});let l,r=o.size,s=o.size;o.forEach((h,f)=>{let m=!1;const b=f.subscribe({next:A=>{h.forEach(T=>i[T]=A),m||(m=!0,s--),s||(l||=new Set(n.filter(T=>T.dirty)),l.delete(f),l.size||(e.next(i.slice()),l=void 0))},complete:()=>{r--,r||e.complete()},error:e.error.bind(e)});e.add(b)})})}(b).pipe(mo(f),l1({subscribe:()=>m=!0,unsubscribe:()=>m=!1}),H7({bufferSize:1,refCount:!0}));return Object.assign(A,{getCurrentResult:()=>m&&h?h:f(b.map(U=>U.getCurrentResult()))})}onAfterBroadcast=e=>e();watchSingleFragment(e,t,i){if(null===e)return Gwe;const{optimistic:o=!0,variables:r}=i,s=[t,vd({id:e,optimistic:o,variables:r})],l=this.fragmentWatches.lookupArray(s);if(!l.observable){let f,m=function(A){const T=A.result;return(!f||!KH(t,{data:f.data},{data:T},i.variables))&&(f={data:T,dataState:A.complete?"complete":"partial",complete:A.complete},A.missing&&(f.missing=A.missing.missing)),f},h=!1;const b=new wn(A=>{h=!0;const T=this.watch({variables:r,returnPartialData:!0,id:e,query:t,optimistic:o,immediate:!0,callback:U=>{b.dirty=!0,this.onAfterBroadcast(()=>{A.next(m(U)),b.dirty=!1})}});return()=>{h=!1,T(),this.fragmentWatches.removeArray(s)}}).pipe(function Rwe(n,e=Sn){return n=n??kwe,ia((t,i)=>{let o,r=!0;t.subscribe(Sa(i,s=>{const l=e(s);(r||!n(o,l))&&(r=!1,o=l,i.next(s))}))})}(),O5({connector:()=>new V3(1),resetOnRefCountZero:()=>function Bwe(n=0,e,t=U2e){let i=-1;return null!=e&&(_O(e)?t=e:i=e),new wn(o=>{let r=function Owe(n){return n instanceof Date&&!isNaN(n)}(n)?+n-t.now():n;r<0&&(r=0);let s=0;return t.schedule(function(){o.closed||(o.next(s++),0<=i?this.schedule(void 0,i):o.complete())},r)})}(0)}));l.observable=Object.assign(b,{dirty:!1,getCurrentResult:()=>h&&f?f:m(this.diff({id:e,query:t,returnPartialData:!0,optimistic:o,variables:r}))})}return l.observable}getFragmentDoc=L5(Vwe,{max:fd["cache.fragmentQueryDocuments"]||1e3,cache:k7,makeCacheKey:jwe(this)});readFragment(e,t=!!e.optimistic){const i=void 0!==e.from?this.toCacheId(e.from):e.id;return this.read({...e,query:this.getFragmentDoc(e.fragment,e.fragmentName),rootId:i,optimistic:t})}writeQuery({id:e,data:t,...i}){return this.write(Object.assign(i,{dataId:e||"ROOT_QUERY",result:t}))}writeFragment({data:e,fragment:t,fragmentName:i,...o}){const r=void 0!==o.from?this.toCacheId(o.from):o.id;return this.write(Object.assign(o,{query:this.getFragmentDoc(t,i),dataId:r,result:e}))}updateQuery(e,t){return this.batch({update(i){const o=i.readQuery(e),r=t(o);return null==r?o:(i.writeQuery({...e,data:r}),r)}})}updateFragment(e,t){return this.batch({update(i){const o=i.readFragment(e),r=t(o);return null==r?o:(i.writeFragment({...e,data:r}),r)}})}toCacheId(e){return"string"==typeof e?e:this.identify(e)}}const QH=Object.freeze({data:null,dataState:"complete",complete:!0}),Gwe=Object.assign(new wn(n=>{n.next(QH)}),{dirty:!1,getCurrentResult:()=>QH}),JH=Object.freeze({data:[],dataState:"complete",complete:!0}),Wwe=Object.assign(new wn(n=>{n.next(JH)}),{getCurrentResult:()=>JH});function qs(n){return null!==n&&"object"==typeof n}const{hasOwnProperty:$we}=Object.prototype,Zwe=function(n,e,t){return this.merge(n[t],e[t])},eU=n=>isNaN(+n)?{}:[];class Nf{options;reconciler;constructor(e={}){this.options=e,this.reconciler=e.reconciler||Zwe}merge(e,t,i={}){const o=i.atPath;if(o?.length){const[r,...s]=o;void 0===e&&(e=eU(r));let l=e[r];void 0===l&&s.length&&(l=eU(s[0]));const h=this.merge(l,t,{...i,atPath:s});return l!==h&&((e=this.shallowCopyForMerge(e))[r]=h),e}return Array.isArray(e)&&Array.isArray(t)&&"truncate"===this.options.arrayMerge&&e.length>t.length&&(e=e.slice(0,t.length),this.pastCopies.add(e)),qs(t)&&qs(e)?(Object.keys(t).forEach(r=>{if($we.call(e,r)){const s=e[r];if(t[r]!==s){const l=this.reconciler(e,t,r);l!==s&&((e=this.shallowCopyForMerge(e))[r]=l)}}else(e=this.shallowCopyForMerge(e))[r]=t[r]}),e):t}isObject=qs;pastCopies=new Set;shallowCopyForMerge(e){return qs(e)&&(this.pastCopies.has(e)||(e=Array.isArray(e)?e.slice(0):{__proto__:Object.getPrototypeOf(e),...e},this.pastCopies.add(e))),e}}function Lf(n){return{__ref:String(n)}}function m1(...n){const e={};return n.forEach(t=>{t&&Reflect.ownKeys(t).forEach(i=>{const o=t[i];void 0!==o&&(e[i]=o)})}),e}const Pr=Array.isArray,{hasOwnProperty:ms}=Object.prototype;function tU({__typename:n,id:e,_id:t},i){if("string"==typeof n&&(i&&(i.keyObject=null!=e?{id:e}:null!=t?{_id:t}:void 0),null==e&&null!=t&&(e=t),null!=e))return`${n}:${"number"==typeof e||"string"==typeof e?e:JSON.stringify(e)}`}const qwe={dataIdFromObject:tU,resultCaching:!0},nU=/^[_a-z][_0-9a-z]*/i;function Wh(n){const e=n.match(nU);return e?e[0]:n}function vw(n,e,t){return!!qs(e)&&(Pr(e)?e.every(i=>vw(n,i,t)):n.selections.every(i=>{if(F5(i)&&z7(i,t)){const o=g1(i);return ms.call(e,o)&&(!i.selectionSet||vw(i.selectionSet,e[o],t))}return!0}))}function Mf(n){return qs(n)&&!Ro(n)&&!Pr(n)}function iU(n,e){const t=B5(P5(n));return{fragmentMap:t,lookupFragment(i){let o=t[i];return!o&&e&&(o=e.lookup(i)),o||null}}}const G7={},bw=()=>G7,oU={};class W7{policies;group;data={};constructor(e,t){this.policies=e,this.group=t}toObject(){return{...this.data}}has(e){return void 0!==this.lookup(e,!0)}get(e,t){if(this.group.depend(e,t),ms.call(this.data,e)){const i=this.data[e];if(i&&ms.call(i,t))return i[t]}return"__typename"===t&&ms.call(this.policies.rootTypenamesById,e)?this.policies.rootTypenamesById[e]:this instanceof gu?this.parent.get(e,t):void 0}lookup(e,t){return t&&this.group.depend(e,"__exists"),ms.call(this.data,e)?this.data[e]:this instanceof gu?this.parent.lookup(e,t):this.policies.rootTypenamesById[e]?{}:void 0}merge(e,t){let i;Ro(e)&&(e=e.__ref),Ro(t)&&(t=t.__ref);const o="string"==typeof e?this.lookup(i=e):e,r="string"==typeof t?this.lookup(i=t):t;if(!r)return;bn("string"==typeof i,104);const s=new Nf({reconciler:nAe}).merge(o,r);if(this.data[i]=s,s!==o&&(delete this.refs[i],this.group.caching)){const l={};o||(l.__exists=1),Object.keys(r).forEach(h=>{if(!o||o[h]!==s[h]){l[h]=1;const f=Wh(h);f!==h&&!this.policies.hasKeyArgs(s.__typename,f)&&(l[f]=1),void 0===s[h]&&!(this instanceof gu)&&delete s[h]}}),l.__typename&&!(o&&o.__typename)&&this.policies.rootTypenamesById[i]===s.__typename&&delete l.__typename,Object.keys(l).forEach(h=>this.group.dirty(i,h))}}modify(e,t,i){const o=this.lookup(e);if(o){const r={};let s=!1,l=!0;const h={DELETE:G7,INVALIDATE:oU,isReference:Ro,toReference:this.toReference,canRead:this.canRead,readField:(f,m)=>this.policies.readField("string"==typeof f?{fieldName:f,from:m||Lf(e)}:f,{store:this})};if(Object.keys(o).forEach(f=>{const m=Wh(f);let b=o[f];if(void 0===b)return;const A="function"==typeof t?t:t[f]||(i?void 0:t[m]);if(A){let T=A===bw?G7:A(b,{...h,fieldName:m,storeFieldName:f,storage:this.getStorage(e,f)});if(T===oU)this.group.dirty(e,f);else if(T===G7&&(T=void 0),T!==b&&(r[f]=T,s=!0,b=T,false)){const U=K=>{if(void 0===this.lookup(K.__ref))return!0};if(Ro(T))U(T);else if(Array.isArray(T)){let ne,K=!1;for(const ge of T){if(Ro(ge)){if(K=!0,U(ge))break}else if("object"==typeof ge&&ge){const[Me]=this.policies.identify(ge);Me&&(ne=ge)}if(K&&void 0!==ne)break}}}}void 0!==b&&(l=!1)}),s)return this.merge(e,r),l&&(this instanceof gu?this.data[e]=void 0:delete this.data[e],this.group.dirty(e,"__exists")),!0}return!1}delete(e,t,i){const o=this.lookup(e);if(o){const r=this.getFieldValue(o,"__typename"),s=t&&i?this.policies.getStoreFieldName({typename:r,fieldName:t,args:i}):t;return this.modify(e,s?{[s]:bw}:bw,!!i)}return!1}evict(e,t){let i=!1;return e.id&&(ms.call(this.data,e.id)&&(i=this.delete(e.id,e.fieldName,e.args)),this instanceof gu&&this!==t&&(i=this.parent.evict(e,t)||i),(e.fieldName||i)&&this.group.dirty(e.id,e.fieldName||"__exists")),i}clear(){this.replace(null)}extract(){const e=this.toObject(),t=[];return this.getRootIdSet().forEach(i=>{ms.call(this.policies.rootTypenamesById,i)||t.push(i)}),t.length&&(e.__META={extraRootIds:t.sort()}),e}replace(e){if(Object.keys(this.data).forEach(t=>{e&&ms.call(e,t)||this.delete(t)}),e){const{__META:t,...i}=e;Object.keys(i).forEach(o=>{this.merge(o,i[o])}),t&&t.extraRootIds.forEach(this.retain,this)}}rootIds={};retain(e){return this.rootIds[e]=(this.rootIds[e]||0)+1}release(e){if(this.rootIds[e]>0){const t=--this.rootIds[e];return t||delete this.rootIds[e],t}return 0}getRootIdSet(e=new Set){return Object.keys(this.rootIds).forEach(e.add,e),this instanceof gu?this.parent.getRootIdSet(e):Object.keys(this.policies.rootTypenamesById).forEach(e.add,e),e}gc(){const e=this.getRootIdSet(),t=this.toObject();e.forEach(o=>{ms.call(t,o)&&(Object.keys(this.findChildRefIds(o)).forEach(e.add,e),delete t[o])});const i=Object.keys(t);if(i.length){let o=this;for(;o instanceof gu;)o=o.parent;i.forEach(r=>o.delete(r))}return i}refs={};findChildRefIds(e){if(!ms.call(this.refs,e)){const t=this.refs[e]={},i=this.data[e];if(!i)return t;const o=new Set([i]);o.forEach(r=>{Ro(r)&&(t[r.__ref]=!0),qs(r)&&Object.keys(r).forEach(s=>{const l=r[s];qs(l)&&o.add(l)})})}return this.refs[e]}makeCacheKey(){return this.group.keyMaker.lookupArray(arguments)}getFieldValue=(e,t)=>Ro(e)?this.get(e.__ref,t):e&&e[t];canRead=e=>Ro(e)?this.has(e.__ref):"object"==typeof e;toReference=(e,t)=>{if("string"==typeof e)return Lf(e);if(Ro(e))return e;const[i]=this.policies.identify(e);if(i){const o=Lf(i);return t&&this.merge(i,e),o}};get supportsResultCaching(){return this.group.caching}}class rU{caching;parent;d=null;keyMaker;constructor(e,t=null){this.caching=e,this.parent=t,this.resetCaching()}resetCaching(){this.d=this.caching?FH():null,this.keyMaker=new fu}depend(e,t){if(this.d){this.d(Cw(e,t));const i=Wh(t);i!==t&&this.d(Cw(e,i)),this.parent&&this.parent.depend(e,t)}}dirty(e,t){this.d&&this.d.dirty(Cw(e,t),"__exists"===t?"forget":"setDirty")}}function Cw(n,e){return e+"#"+n}function sU(n,e){H5(n)&&n.group.depend(e,"__exists")}W7.Root=class eAe extends W7{constructor({policies:e,resultCaching:t=!0,seed:i}){super(e,new rU(t)),i&&this.replace(i)}stump=new tAe(this);addLayer(e,t){return this.stump.addLayer(e,t)}removeLayer(){return this}storageTrie=new fu;getStorage(){return this.storageTrie.lookupArray(arguments)}};class gu extends W7{id;parent;replay;group;constructor(e,t,i,o){super(t.policies,o),this.id=e,this.parent=t,this.replay=i,this.group=o,i(this)}addLayer(e,t){return new gu(e,this,t,this.group)}removeLayer(e){const t=this.parent.removeLayer(e);return e===this.id?(this.group.caching&&Object.keys(this.data).forEach(i=>{const o=this.data[i],r=t.lookup(i);r?o?o!==r&&Object.keys(o).forEach(s=>{sr(o[s],r[s])||this.group.dirty(i,s)}):(this.group.dirty(i,"__exists"),Object.keys(r).forEach(s=>{this.group.dirty(i,s)})):this.delete(i)}),t):t===this.parent?this:t.addLayer(this.id,this.replay)}toObject(){return{...this.parent.toObject(),...this.data}}findChildRefIds(e){const t=this.parent.findChildRefIds(e);return ms.call(this.data,e)?{...t,...super.findChildRefIds(e)}:t}getStorage(...e){let t=this.parent;for(;t.parent;)t=t.parent;return t.getStorage(...e)}}class tAe extends gu{constructor(e){super("EntityStore.Stump",e,()=>{},new rU(e.group.caching,e.group))}removeLayer(){return this}merge(e,t){return this.parent.merge(e,t)}}function nAe(n,e,t){const i=n[t],o=e[t];return sr(i,o)?i:o}function H5(n){return!(!n||!n.supportsResultCaching)}const yw=new O7;function iAe(n){const e=n.directives?.find(({name:i})=>"unmask"===i.value);if(!e)return"mask";const t=e.arguments?.find(({name:i})=>"mode"===i.value);return t&&"value"in t.value&&"migrate"===t.value.value?"migrate":"unmask"}const aU=Symbol.for("apollo.result.extensions"),$h=Symbol.for("apollo.result.streamInfo"),oAe=Symbol.for("apollo.observableQuery.variablesUnknown");function Rf(n,e,t,i){if(t.kind===_n.INT||t.kind===_n.FLOAT)n[e.value]=Number(t.value);else if(t.kind===_n.BOOLEAN||t.kind===_n.STRING)n[e.value]=t.value;else if(t.kind===_n.OBJECT){const o={};t.fields.map(r=>Rf(o,r.name,r.value,i)),n[e.value]=o}else if(t.kind===_n.VARIABLE)n[e.value]=(i||{})[t.name.value];else if(t.kind===_n.LIST)n[e.value]=t.values.map(o=>{const r={};return Rf(r,e,o,i),r[e.value]});else if(t.kind===_n.ENUM)n[e.value]=t.value;else{if(t.kind!==_n.NULL)throw vl(19,e.value,t.kind);n[e.value]=null}}function ww(n,e){if(n.arguments&&n.arguments.length){const t={};return n.arguments.forEach(({name:i,value:o})=>Rf(t,i,o,e)),t}return null}const rAe=["connection","include","skip","client","rest","export","nonreactive","stream"];let U5=vd;const lU=Object.assign(function(n,e,t){if(e&&t&&t.connection&&t.connection.key){if(t.connection.filter&&t.connection.filter.length>0){const o=t.connection.filter?t.connection.filter:[];o.sort();const r={};o.forEach(l=>{r[l]=e[l]});const s=U5(r);if("{}"!==s)return`${t.connection.key}(${s})`}return t.connection.key}let i=n;if(e){const o=U5(e);"{}"!==o&&(i+=`(${o})`)}return t&&Object.keys(t).forEach(o=>{-1===rAe.indexOf(o)&&(t[o]&&Object.keys(t[o]).length?i+=`@${o}(${U5(t[o])})`:i+=`@${o}`)}),i},{setStringify(n){const e=U5;return U5=n,e}});function Aw(n){return Array.isArray(n)&&n.length>0}const cU={};function Tw(n){const e=JSON.stringify(n);return cU[e]||(cU[e]={})}function uU(n){const e=Tw(n);return e.keyFieldsFn||(e.keyFieldsFn=(t,i)=>{const o=(s,l)=>i.readField(l,s),r=i.keyObject=Iw(n,s=>{let l=kf(i.storeObject,s,o);return void 0===l&&t!==i.storeObject&&ms.call(t,s[0])&&(l=kf(t,s,_U)),bn(void 0!==l,107,s.join("."),t),l});return`${i.typename}:${JSON.stringify(r)}`})}function dU(n){const e=Tw(n);return e.keyArgsFn||(e.keyArgsFn=(t,{field:i,variables:o,fieldName:r})=>{const s=Iw(n,h=>{const f=h[0],m=f.charAt(0);if("@"!==m){if("$"===m){const b=f.slice(1);if(o&&ms.call(o,b)){const A=h.slice(0);return A[0]=b,kf(o,A)}return}if(t)return kf(t,h)}else if(i&&Aw(i.directives)){const b=f.slice(1),A=i.directives.find(U=>U.name.value===b),T=A&&ww(A,o);return T&&kf(T,h.slice(1))}}),l=JSON.stringify(s);return(t||"{}"!==l)&&(r+=":"+l),r})}function Iw(n,e){const t=new Nf;return hU(n).reduce((i,o)=>{let r=e(o);if(void 0!==r){for(let s=o.length-1;s>=0;--s)r={[o[s]]:r};i=t.merge(i,r)}return i},{})}function hU(n){const e=Tw(n);if(!e.paths){const t=e.paths=[],i=[];n.forEach((o,r)=>{Pr(o)?(hU(o).forEach(s=>t.push(i.concat(s))),i.length=0):(i.push(o),Pr(n[r+1])||(t.push(i.slice(0)),i.length=0))})}return e.paths}function _U(n,e){return n[e]}function kf(n,e,t){return t=t||_U,pU(e.reduce(function i(o,r){return Pr(o)?o.map(s=>i(s,r)):o&&t(o,r)},n))}function pU(n){return qs(n)?Pr(n)?n.map(pU):Iw(Object.keys(n).sort(),e=>kf(n,e)):n}const fU=new O7,gU=new WeakMap;function z5(n){let e=gU.get(n);return e||gU.set(n,e={vars:new Set,dep:FH()}),e}function mU(n){z5(n).vars.forEach(e=>e.forgetCache(n))}function lAe(n){const e=new Set,t=new Set,i=function(r){if(arguments.length>0){if(n!==r){n=r,e.forEach(l=>{z5(l).dep.dirty(i),function cAe(n){n.broadcastWatches&&n.broadcastWatches()}(l)});const s=Array.from(t);t.clear(),s.forEach(l=>l(n))}}else{const s=fU.getValue();s&&(o(s),z5(s).dep(i))}return n};i.onNextChange=r=>(t.add(r),()=>{t.delete(r)});const o=i.attachCache=r=>(e.add(r),z5(r).vars.add(i),i);return i.forgetCache=r=>e.delete(r),i}function Sw(n){return void 0!==n.args?n.args:n.field?ww(n.field,n.variables):null}const uAe=()=>{},vU=(n,e)=>e.fieldName,bU=(n,e,{mergeObjects:t})=>t(n,e),CU=(n,e)=>e,dAe=(n,e,{streamFieldInfo:t,existingData:i})=>{if(!n&&!i)return e;const o=[],r=n??i,s=t?.isLastChunk?e.length:Math.max(r.length,e.length);for(let l=0;l<s;l++)o[l]=void 0===e[l]?r[l]:e[l];return o};class hAe{config;typePolicies={};toBeAdded={};supertypeMap=new Map;fuzzySubtypes=new Map;cache;rootIdsByTypename={};rootTypenamesById={};usingPossibleTypes=!1;constructor(e){this.config=e,this.config={dataIdFromObject:tU,...e},this.cache=this.config.cache,this.setRootTypename("Query"),this.setRootTypename("Mutation"),this.setRootTypename("Subscription"),e.possibleTypes&&this.addPossibleTypes(e.possibleTypes),e.typePolicies&&this.addTypePolicies(e.typePolicies)}identify(e,t){const i=this,o=t&&(t.typename||t.storeObject?.__typename)||e.__typename;if(o===this.rootTypenamesById.ROOT_QUERY)return["ROOT_QUERY"];const r=t&&t.storeObject||e,s={...t,typename:o,storeObject:r,readField:t&&t.readField||((...m)=>{const b=Ew(m,r);return i.readField(b,{store:i.cache.data,variables:b.variables})})};let l;const h=o&&this.getTypePolicy(o);let f=h&&h.keyFn||this.config.dataIdFromObject;return yw.withValue(!0,()=>{for(;f;){const m=f({...e,...r},s);if(!Pr(m)){l=m;break}f=uU(m)}}),l=l?String(l):void 0,s.keyObject?[l,s.keyObject]:[l]}addTypePolicies(e){Object.keys(e).forEach(t=>{const{queryType:i,mutationType:o,subscriptionType:r,...s}=e[t];i&&this.setRootTypename("Query",t),o&&this.setRootTypename("Mutation",t),r&&this.setRootTypename("Subscription",t),ms.call(this.toBeAdded,t)?this.toBeAdded[t].push(s):this.toBeAdded[t]=[s]})}updateTypePolicy(e,t,i){const o=this.getTypePolicy(e),{keyFields:r,fields:s}=t;function l(h,f){h.merge="function"==typeof f?f:!0===f?bU:!1===f?CU:h.merge}l(o,t.merge),o.keyFn=!1===r?uAe:Pr(r)?uU(r):"function"==typeof r?r:o.keyFn,s&&Object.keys(s).forEach(h=>{let f=i[h];(!f||f?.typename!==e)&&(f=i[h]={typename:e});const m=s[h];if("function"==typeof m)f.read=m;else{const{keyArgs:b,read:A,merge:T}=m;f.keyFn=!1===b?vU:Pr(b)?dU(b):"function"==typeof b?b:f.keyFn,"function"==typeof A&&(f.read=A),l(f,T)}f.read&&f.merge&&(f.keyFn=f.keyFn||vU)})}setRootTypename(e,t=e){const i="ROOT_"+e.toUpperCase(),o=this.rootTypenamesById[i];t!==o&&(bn(!o||o===e,108,e),o&&delete this.rootIdsByTypename[o],this.rootIdsByTypename[t]=i,this.rootTypenamesById[i]=t)}addPossibleTypes(e){this.usingPossibleTypes=!0,Object.keys(e).forEach(t=>{this.getSupertypeSet(t,!0),e[t].forEach(i=>{this.getSupertypeSet(i,!0).add(t);const o=i.match(nU);(!o||o[0]!==i)&&this.fuzzySubtypes.set(i,new RegExp(i))})})}getTypePolicy(e){if(!ms.call(this.typePolicies,e)){const i=this.typePolicies[e]={};i.fields={};let o=this.supertypeMap.get(e);!o&&this.fuzzySubtypes.size&&(o=this.getSupertypeSet(e,!0),this.fuzzySubtypes.forEach((r,s)=>{if(r.test(e)){const l=this.supertypeMap.get(s);l&&l.forEach(h=>o.add(h))}})),o&&o.size&&o.forEach(r=>{const{fields:s,...l}=this.getTypePolicy(r);Object.assign(i,l),Object.assign(i.fields,s)})}const t=this.toBeAdded[e];return t&&t.length&&t.splice(0).forEach(i=>{this.updateTypePolicy(e,i,this.typePolicies[e].fields)}),this.typePolicies[e]}getFieldPolicy(e,t){if(e)return this.getTypePolicy(e).fields[t]}getSupertypeSet(e,t){let i=this.supertypeMap.get(e);return!i&&t&&this.supertypeMap.set(e,i=new Set),i}fragmentMatches(e,t,i,o){if(!e.typeCondition)return!0;if(!t)return!1;const r=e.typeCondition.name.value;if(t===r)return!0;if(this.usingPossibleTypes&&this.supertypeMap.has(r)){const s=this.getSupertypeSet(t,!0),l=[s],h=b=>{const A=this.getSupertypeSet(b,!1);A&&A.size&&l.indexOf(A)<0&&l.push(A)};let f=!(!i||!this.fuzzySubtypes.size),m=!1;for(let b=0;b<l.length;++b){const A=l[b];if(A.has(r))return s.has(r)||s.add(r),!0;A.forEach(h),f&&b===l.length-1&&vw(e.selectionSet,i,o)&&(f=!1,m=!0,this.fuzzySubtypes.forEach((T,U)=>{const K=t.match(T);K&&K[0]===t&&h(U)}))}}return!1}hasKeyArgs(e,t){const i=this.getFieldPolicy(e,t);return!(!i||!i.keyFn)}getStoreFieldName(e){const{typename:t,fieldName:i}=e,o=this.getFieldPolicy(t,i);let r,s=o&&o.keyFn;if(s&&t){const l={typename:t,fieldName:i,field:e.field||null,variables:e.variables},h=Sw(e);for(;s;){const f=s(h,l);if(!Pr(f)){r=f||i;break}s=dU(f)}}return void 0===r&&(r=e.field?function sAe(n,e){let t=null;n.directives&&(t={},n.directives.forEach(o=>{t[o.name.value]={},o.arguments&&o.arguments.forEach(({name:r,value:s})=>Rf(t[o.name.value],r,s,e))}));let i=null;return n.arguments&&n.arguments.length&&(i={},n.arguments.forEach(({name:o,value:r})=>Rf(i,o,r,e))),lU(n.name.value,i,t)}(e.field,e.variables):lU(i,Sw(e))),!1===r?i:i===Wh(r)?r:i+":"+r}readField(e,t){const i=e.from;if(!i||!e.field&&!e.fieldName)return;if(void 0===e.typename){const m=t.store.getFieldValue(i,"__typename");m&&(e.typename=m)}const r=this.getStoreFieldName(e),s=Wh(r),l=t.store.getFieldValue(i,r),h=this.getFieldPolicy(e.typename,s),f=h&&h.read;if(f){const m=yU(this,i,e,t,t.store.getStorage(Ro(i)?i.__ref:i,r));return fU.withValue(this.cache,f,[l,m])}return l}getReadFunction(e,t){const i=this.getFieldPolicy(e,t);return i&&i.read}getMergeFunction(e,t,i){let o=this.getFieldPolicy(e,t),r=o&&o.merge;return!r&&i&&(o=this.getTypePolicy(i),r=o&&o.merge),r}runMergeFunction(e,t,{field:i,typename:o,merge:r,path:s},l,h){const f=e;if(r===bU)return wU(l.store)(e,t);if(r===CU)return t;l.overwrite&&(e=void 0);const m=l.extensions?.[$h]?.deref()?.peekArray(s);if(m){const{current:A,previous:T}=m;if(T&&sr(T.incoming,t)&&sr(T.streamFieldInfo,A))return T.result}const b=r(e,t,function _Ae(n,e,t,i,o,r){const s={...yU(n,e,t,i,o),extensions:i.extensions,existingData:r},l=i.extensions;if(l&&$h in l){const{[$h]:h,...f}=l,m=h?.deref()?.peekArray(t.path);m&&(s.streamFieldInfo=m.current),s.extensions=0===Object.keys(f).length?void 0:f}return s}(this,void 0,{typename:o,fieldName:i.name.value,field:i,variables:l.variables,path:s},l,h||{},f));return m&&(m.previous={incoming:t,streamFieldInfo:m.current,result:b}),b}}function yU(n,e,t,i,o){const r=n.getStoreFieldName(t),s=Wh(r),l=t.variables||i.variables,{toReference:h,canRead:f}=i.store;return{args:Sw(t),field:t.field||null,fieldName:s,storeFieldName:r,variables:l,isReference:Ro,toReference:h,storage:o,cache:n.cache,canRead:f,readField:(...m)=>n.readField(Ew(m,e,l),i),mergeObjects:wU(i.store)}}function Ew(n,e,t){const{0:i,1:o,length:r}=n;let s;return"string"==typeof i?s={fieldName:i,from:r>1?o:e}:(s={...i},ms.call(s,"from")||(s.from=e)),void 0===s.variables&&(s.variables=t),s}function wU(n){return function(t,i){if(Pr(t)||Pr(i))throw vl(111);if(qs(t)&&qs(i)){const o=n.getFieldValue(t,"__typename"),r=n.getFieldValue(i,"__typename");if(o&&r&&o!==r)return i;if(Ro(t)&&Mf(i))return n.merge(t.__ref,i),t;if(Mf(t)&&Ro(i))return n.merge(t,i.__ref),i;if(Mf(t)&&Mf(i))return{...t,...i}}return i}}function xw(n){const e={},t=n&&n.variableDefinitions;return t&&t.length&&t.forEach(i=>{i.defaultValue&&Rf(e,i.variable.name,i.defaultValue)}),e}function AU(n){const e=gd(n);return bn(e&&"query"===e.operation,13),e}function pAe(n){let e=n[0]||{};const t=n.length;if(t>1){const i=new Nf;for(let o=1;o<t;++o)e=i.merge(e,n[o])}return e}class Dw extends Error{message;path;query;variables;constructor(e,t,i,o){if(super(e),this.message=e,this.path=t,this.query=i,this.variables=o,this.name="MissingFieldError",Array.isArray(this.path)){this.missing=this.message;for(let r=this.path.length-1;r>=0;--r)this.missing={[this.path[r]]:this.missing}}else this.missing=this.path;this.__proto__=Dw.prototype}missing}function TU(n){return[n.selectionSet,n.objectOrReference,n.context]}class fAe{executeSelectionSet;executeSubSelectedArray;config;knownResults=new WeakMap;constructor(e){this.config=e,this.executeSelectionSet=L5(t=>{const i=TU(t);return this.executeSelectionSet.peek(...i)||(sU(t.context.store,t.enclosingRef.__ref),this.execSelectionSetImpl(t))},{max:fd["inMemoryCache.executeSelectionSet"]||5e4,keyArgs:TU,makeCacheKey(t,i,o){if(H5(o.store))return o.store.makeCacheKey(t,Ro(i)?i.__ref:i,o.varString)}}),this.executeSubSelectedArray=L5(t=>(sU(t.context.store,t.enclosingRef.__ref),this.execSubSelectedArrayImpl(t)),{max:fd["inMemoryCache.executeSubSelectedArray"]||1e4,makeCacheKey({field:t,array:i,context:o}){if(H5(o.store))return o.store.makeCacheKey(t,i,o.varString)}})}diffQueryAgainstStore({store:e,query:t,rootId:i="ROOT_QUERY",variables:o,returnPartialData:r=!0}){const s=this.config.cache.policies;o={...xw(AU(t)),...o};const l=Lf(i),h=this.executeSelectionSet({selectionSet:mw(t).selectionSet,objectOrReference:l,enclosingRef:l,context:{store:e,query:t,policies:s,variables:o,varString:vd(o),...iU(t,this.config.fragments)}});let f;h.missing&&(f=new Dw(function gAe(n){try{JSON.stringify(n,(e,t)=>{if("string"==typeof t)throw t;return t})}catch(e){return e}}(h.missing),h.missing,t,o));const m=!f,{result:b}=h;return{result:m?b:r?0===Object.keys(b).length?null:b:null,complete:m,missing:f}}isFresh(e,t,i,o){if(H5(o.store)&&this.knownResults.get(e)===i){const r=this.executeSelectionSet.peek(i,t,o);if(r&&e===r.result)return!0}return!1}execSelectionSetImpl({selectionSet:e,objectOrReference:t,enclosingRef:i,context:o}){if(Ro(t)&&!o.policies.rootTypenamesById[t.__ref]&&!o.store.has(t.__ref))return{result:{},missing:`Dangling reference to missing ${t.__ref} object`};const{variables:r,policies:s,store:l}=o,h=l.getFieldValue(t,"__typename"),f=[];let m;const b=new Nf;function A(ge,Me){return ge.missing&&(m=b.merge(m,{[Me]:ge.missing})),ge.result}"string"==typeof h&&!s.rootIdsByTypename[h]&&f.push({__typename:h});const T=new Set(e.selections);T.forEach(ge=>{if(z7(ge,r))if(F5(ge)){let Me=s.readField({fieldName:ge.name.value,field:ge,variables:o.variables,from:t},o);const Ct=g1(ge);void 0===Me?cw.added(ge)||(m=b.merge(m,{[Ct]:`Can't find field '${ge.name.value}' on ${Ro(t)?t.__ref+" object":"object "+JSON.stringify(t,null,2)}`})):Pr(Me)?Me.length>0&&(Me=A(this.executeSubSelectedArray({field:ge,array:Me,enclosingRef:i,context:o}),Ct)):ge.selectionSet&&null!=Me&&(Me=A(this.executeSelectionSet({selectionSet:ge.selectionSet,objectOrReference:Me,enclosingRef:Ro(Me)?Me:i,context:o}),Ct)),void 0!==Me&&f.push({[Ct]:Me})}else{const Me=U7(ge,o.lookupFragment);if(!Me&&ge.kind===_n.FRAGMENT_SPREAD)throw vl(112,ge.name.value);Me&&s.fragmentMatches(Me,h)&&Me.selectionSet.selections.forEach(T.add,T)}});const ne={result:pAe(f),missing:m};return ne.result&&this.knownResults.set(ne.result,e),ne}execSubSelectedArrayImpl({field:e,array:t,enclosingRef:i,context:o}){let r,s=new Nf;function l(h,f){return h.missing&&(r=s.merge(r,{[f]:h.missing})),h.result}return e.selectionSet&&(t=t.filter(h=>void 0===h||o.store.canRead(h))),{result:t=t.map((h,f)=>null===h?null:Pr(h)?l(this.executeSubSelectedArray({field:e,array:h,enclosingRef:i,context:o}),f):e.selectionSet?l(this.executeSelectionSet({selectionSet:e.selectionSet,objectOrReference:h,enclosingRef:Ro(h)?h:i,context:o}),f):h),missing:r}}}function Lw(n,e,t){const i=`${e}${t}`;let o=n.flavors.get(i);return o||n.flavors.set(i,o=n.clientOnly===e&&n.deferred===t?n:{...n,clientOnly:e,deferred:t}),o}class CAe{cache;reader;fragments;constructor(e,t,i){this.cache=e,this.reader=t,this.fragments=i}writeToStore(e,{query:t,result:i,dataId:o,variables:r,overwrite:s,extensions:l}){const h=gd(t),f=function Jwe(){return new Nf}();r={...xw(h),...r};const m={store:e,written:{},merge:(A,T)=>f.merge(A,T),variables:r,varString:vd(r),...iU(t,this.fragments),overwrite:!!s,incomingById:new Map,clientOnly:!1,deferred:!1,flavors:new Map,extensions:l},b=this.processSelectionSet({result:i||{},dataId:o,selectionSet:h.selectionSet,mergeTree:{map:new Map},context:m,path:[]});if(!Ro(b))throw vl(114,i);return m.incomingById.forEach(({storeObject:A,mergeTree:T},K)=>{const ne=Lf(K);if(T&&T.map.size){const ge=this.applyMerges(T,ne,A,m);if(Ro(ge))return;A=ge}e.merge(K,A)}),e.retain(b.__ref),b}processSelectionSet({dataId:e,result:t,selectionSet:i,context:o,mergeTree:r,path:s}){const{policies:l}=this.cache;let h={};const f=e&&l.rootTypenamesById[e]||Rw(t,i,o.fragmentMap)||e&&o.store.get(e,"__typename");"string"==typeof f&&(h.__typename=f);const m=(...A)=>{const T=Ew(A,h,o.variables);if(Ro(T.from)){const U=o.incomingById.get(T.from.__ref);if(U){const K=l.readField({...T,from:U.storeObject},o);if(void 0!==K)return K}}return l.readField(T,o)},b=new Set;this.flattenFields(i,t,o,f).forEach((A,T)=>{const U=g1(T),K=t[U],ne=[...s,T.name.value];if(b.add(T),void 0!==K){const ge=l.getStoreFieldName({typename:f,fieldName:T.name.value,field:T,variables:A.variables}),Me=SU(r,ge);let Nt,Ct=this.processFieldValue(K,T,T.selectionSet?Lw(A,!1,!1):A,Me,ne);T.selectionSet&&(Ro(Ct)||Mf(Ct))&&(Nt=m("__typename",Ct));const Zt=l.getMergeFunction(f,T.name.value,Nt);Zt?Me.info={field:T,typename:f,merge:Zt,path:ne}:A.extensions?.[$h]&&Array.isArray(Ct)&&function yAe(n){return!!n.directives&&n.directives.some(e=>"stream"===e.name.value)}(T)?Me.info={field:T,typename:f,merge:dAe,path:ne}:EU(r,ge),h=A.merge(h,{[ge]:Ct})}});try{const[A,T]=l.identify(t,{typename:f,selectionSet:i,fragmentMap:o.fragmentMap,storeObject:h,readField:m});e=e||A,T&&(h=o.merge(h,T))}catch(A){if(!e)throw A}if("string"==typeof e){const A=Lf(e),T=o.written[e]||(o.written[e]=[]);if(T.indexOf(i)>=0||(T.push(i),this.reader&&this.reader.isFresh(t,A,i,o)))return A;const U=o.incomingById.get(e);return U?(U.storeObject=o.merge(U.storeObject,h),U.mergeTree=Mw(U.mergeTree,r),b.forEach(K=>U.fieldNodeSet.add(K))):o.incomingById.set(e,{storeObject:h,mergeTree:$7(r)?void 0:r,fieldNodeSet:b}),A}return h}processFieldValue(e,t,i,o,r){return t.selectionSet&&null!==e?Pr(e)?e.map((s,l)=>{const h=this.processFieldValue(s,t,i,SU(o,l),[...r,l]);return EU(o,l),h}):this.processSelectionSet({result:e,selectionSet:t.selectionSet,context:i,mergeTree:o,path:r}):e}flattenFields(e,t,i,o=Rw(t,e,i.fragmentMap)){const r=new Map,{policies:s}=this.cache,l=new fu(!1);return function h(f,m){const b=l.lookup(f,m.clientOnly,m.deferred);b.visited||(b.visited=!0,f.selections.forEach(A=>{if(!z7(A,i.variables))return;let{clientOnly:T,deferred:U}=m;if(!(T&&U)&&Aw(A.directives)&&A.directives.forEach(K=>{const ne=K.name.value;if("client"===ne&&(T=!0),"defer"===ne){const ge=ww(K,i.variables);(!ge||!1!==ge.if)&&(U=!0)}}),F5(A)){const K=r.get(A);K&&(T=T&&K.clientOnly,U=U&&K.deferred),r.set(A,Lw(i,T,U))}else{const K=U7(A,i.lookupFragment);if(!K&&A.kind===_n.FRAGMENT_SPREAD)throw vl(116,A.name.value);K&&s.fragmentMatches(K,o,t,i.variables)&&h(K.selectionSet,Lw(i,T,U))}}))}(e,i),r}applyMerges(e,t,i,o,r){if(e.map.size&&!Ro(i)){const s=Pr(i)||!Ro(t)&&!Mf(t)?void 0:t,l=i;let h;s&&!r&&(r=[Ro(s)?s.__ref:s]);const f=(m,b)=>Pr(m)?"number"==typeof b?m[b]:void 0:o.store.getFieldValue(m,String(b));e.map.forEach((m,b)=>{const A=f(s,b),T=f(l,b);if(void 0===T)return;r&&r.push(b);const U=this.applyMerges(m,A,T,o,r);U!==T&&(h=h||new Map,h.set(b,U)),r&&bn(r.pop()===b)}),h&&(i=Pr(l)?l.slice(0):{...l},h.forEach((m,b)=>{i[b]=m}))}return e.info?this.cache.policies.runMergeFunction(t,i,e.info,o,r&&o.store.getStorage(...r)):i}}const IU=[];function SU({map:n},e){return n.has(e)||n.set(e,IU.pop()||{map:new Map}),n.get(e)}function Mw(n,e){if(n===e||!e||$7(e))return n;if(!n||$7(n))return e;const t=n.info&&e.info?{...n.info,...e.info}:n.info||e.info,i=n.map.size&&e.map.size,r={info:t,map:i?new Map:n.map.size?n.map:e.map};if(i){const s=new Set(e.map.keys());n.map.forEach((l,h)=>{r.map.set(h,Mw(l,e.map.get(h))),s.delete(h)}),s.forEach(l=>{r.map.set(l,Mw(e.map.get(l),n.map.get(l)))})}return r}function $7(n){return!n||!(n.info||n.map.size)}function EU({map:n},e){const t=n.get(e);t&&$7(t)&&(IU.push(t),n.delete(e))}function Rw(n,e,t){let i;for(const o of e.selections)if(F5(o)){if("__typename"===o.name.value)return n[g1(o)]}else i?i.push(o):i=[o];if("string"==typeof n.__typename)return n.__typename;if(i)for(const o of i){const r=Rw(n,U7(o,t).selectionSet,t);if("string"==typeof r)return r}}class DU extends XH{data;optimisticData;config;watches=new Set;storeReader;storeWriter;addTypenameTransform=new md(cw);maybeBroadcastWatch;assumeImmutableResults=!0;policies;makeVar=lAe;constructor(e={}){super(),this.config=function Xwe(n){return m1(qwe,n)}(e),this.policies=new hAe({cache:this,dataIdFromObject:this.config.dataIdFromObject,possibleTypes:this.config.possibleTypes,typePolicies:this.config.typePolicies}),this.init()}init(){const e=this.data=new W7.Root({policies:this.policies,resultCaching:this.config.resultCaching});this.optimisticData=e.stump,this.resetResultCache()}resetResultCache(){const{fragments:e}=this.config;this.addTypenameTransform.resetCache(),e?.resetCaches(),this.storeWriter=new CAe(this,this.storeReader=new fAe({cache:this,fragments:e}),e),this.maybeBroadcastWatch=L5((t,i)=>this.broadcastWatch(t,i),{max:fd["inMemoryCache.maybeBroadcastWatch"]||5e3,makeCacheKey:t=>{const i=t.optimistic?this.optimisticData:this.data;if(H5(i)){const{optimistic:o,id:r,variables:s}=t;return i.makeCacheKey(t.query,t.callback,vd({optimistic:o,id:r,variables:s}))}}}),new Set([this.data.group,this.optimisticData.group]).forEach(t=>t.resetCaching())}restore(e){return this.init(),e&&this.data.replace(e),this}extract(e=!1){return(e?this.optimisticData:this.data).extract()}read(e){const{returnPartialData:t=!1}=e;return this.storeReader.diffQueryAgainstStore({...e,store:e.optimistic?this.optimisticData:this.data,config:this.config,returnPartialData:t}).result}write(e){try{return++this.txCount,this.storeWriter.writeToStore(this.data,e)}finally{! --this.txCount&&!1!==e.broadcast&&this.broadcastWatches()}}modify(e){if(ms.call(e,"id")&&!e.id)return!1;const t=e.optimistic?this.optimisticData:this.data;try{return++this.txCount,t.modify(e.id||"ROOT_QUERY",e.fields,!1)}finally{! --this.txCount&&!1!==e.broadcast&&this.broadcastWatches()}}diff(e){return this.storeReader.diffQueryAgainstStore({...e,store:e.optimistic?this.optimisticData:this.data,rootId:e.id||"ROOT_QUERY",config:this.config})}watch(e){return this.watches.size||function aAe(n){z5(n).vars.forEach(e=>e.attachCache(n))}(this),this.watches.add(e),e.immediate&&this.maybeBroadcastWatch(e),()=>{this.watches.delete(e)&&!this.watches.size&&mU(this),this.maybeBroadcastWatch.forget(e)}}gc(e){vd.reset(),k5.reset();const t=this.optimisticData.gc();return e&&!this.txCount&&e.resetResultCache&&this.resetResultCache(),t}retain(e,t){return(t?this.optimisticData:this.data).retain(e)}release(e,t){return(t?this.optimisticData:this.data).release(e)}identify(e){if(Ro(e))return e.__ref;try{return this.policies.identify(e)[0]}catch(t){}}evict(e){if(!e.id){if(ms.call(e,"id"))return!1;e={...e,id:"ROOT_QUERY"}}try{return++this.txCount,this.optimisticData.evict(e,this.data)}finally{! --this.txCount&&!1!==e.broadcast&&this.broadcastWatches()}}reset(e){return this.init(),vd.reset(),e&&e.discardWatches?(this.watches.forEach(t=>this.maybeBroadcastWatch.forget(t)),this.watches.clear(),mU(this)):this.broadcastWatches(),Promise.resolve()}removeOptimistic(e){const t=this.optimisticData.removeLayer(e);t!==this.optimisticData&&(this.optimisticData=t,this.broadcastWatches())}txCount=0;batch(e){const{update:t,optimistic:i=!0,removeOptimistic:o,onWatchUpdated:r}=e;let s;const l=f=>{const{data:m,optimisticData:b}=this;++this.txCount,f&&(this.data=this.optimisticData=f);try{return s=t(this)}finally{--this.txCount,this.data=m,this.optimisticData=b}},h=new Set;return r&&!this.txCount&&this.broadcastWatches({...e,onWatchUpdated:f=>(h.add(f),!1)}),"string"==typeof i?this.optimisticData=this.optimisticData.addLayer(i,l):!1===i?l(this.data):l(),"string"==typeof o&&(this.optimisticData=this.optimisticData.removeLayer(o)),r&&h.size?(this.broadcastWatches({...e,onWatchUpdated(f,m){const b=r.call(this,f,m);return!1!==b&&h.delete(f),b}}),h.size&&h.forEach(f=>this.maybeBroadcastWatch.dirty(f))):this.broadcastWatches(e),s}performTransaction(e,t){return this.batch({update:e,optimistic:t||null!==t})}transformDocument(e){return this.addTypenameTransform.transformDocument(this.addFragmentsToDocument(e))}fragmentMatches(e,t){return this.policies.fragmentMatches(e,t)}lookupFragment(e){return this.config.fragments?.lookup(e)||null}resolvesClientField(e,t){return!!this.policies.getReadFunction(e,t)}broadcastWatches(e){if(!this.txCount){const t=this.onAfterBroadcast,i=new Set;this.onAfterBroadcast=o=>{i.add(o)};try{this.watches.forEach(o=>this.maybeBroadcastWatch(o,e)),i.forEach(o=>o())}finally{this.onAfterBroadcast=t}}}addFragmentsToDocument(e){const{fragments:t}=this.config;return t?t.transform(e):e}broadcastWatch(e,t){const{lastDiff:i}=e,o=this.diff(e);t&&(e.optimistic&&"string"==typeof t.optimistic&&(o.fromOptimisticTransaction=!0),t.onWatchUpdated&&!1===t.onWatchUpdated.call(this,e,o,i))||(!i||!sr(i.result,o.result))&&e.callback(e.lastDiff=o,i)}}class NU extends Ks{constructor(e){super((t,i)=>{const{...o}=t;return Object.defineProperty(o,"client",{enumerable:!1,value:t.client}),new wn(r=>{let s=!1;return Promise.resolve(o).then(l=>e(t.getContext(),l)).then(t.setContext).then(()=>{s||i(t).subscribe(r)}).catch(r.error.bind(r)),()=>{s=!0}})})}}function V5(n,e,t){const i=new Set(n),o=i.size;return pu(e,{Directive(r){if(i.delete(r.name.value)&&(!t||!i.size))return zh}}),t?!i.size:i.size<o}class AAe{isIncrementalResult(e){return!1}prepareRequest(e){return bn(!V5(["defer","stream"],e.query),67),e}extractErrors(){}startRequest=void 0}const kw=Ks.execute;function Z7(n,e){return m1(n,e,e.variables&&{variables:m1({...n&&n.variables,...e.variables})})}function TAe(n){return pu(n,{FragmentSpread(e){if(!e.directives?.some(({name:t})=>"unmask"===t.value))return null}})}function Zh(n,e){const t=be(n)?n:()=>n,i=o=>o.error(t());return new wn(e?o=>e.schedule(i,0,o):i)}function bd(n){return ia((e,t)=>{let r,i=null,o=!1;i=e.subscribe(Sa(t,void 0,void 0,s=>{r=dl(n(s,bd(n)(e))),i?(i.unsubscribe(),i=null,r.subscribe(t)):o=!0})),o&&(i.unsubscribe(),i=null,r.subscribe(t))})}class Cd{constructor(e,t,i){this.kind=e,this.value=t,this.error=i,this.hasValue="N"===e}observe(e){return function SAe(n,e){var t,i,o;const{kind:r,value:s,error:l}=n;if("string"!=typeof r)throw new TypeError('Invalid notification, missing "kind"');"N"===r?null===(t=e.next)||void 0===t||t.call(e,s):"E"===r?null===(i=e.error)||void 0===i||i.call(e,l):null===(o=e.complete)||void 0===o||o.call(e)}(this,e)}do(e,t,i){const{kind:o,value:r,error:s}=this;return"N"===o?e?.(r):"E"===o?t?.(s):i?.()}accept(e,t,i){var o;return be(null===(o=e)||void 0===o?void 0:o.next)?this.observe(e):this.do(e,t,i)}toObservable(){const{kind:e,value:t,error:i}=this,o="N"===e?au(t):"E"===e?Zh(()=>i):"C"===e?pd:0;if(!o)throw new TypeError(`Unexpected notification kind ${e}`);return o}static createNext(e){return new Cd("N",e)}static createError(e){return new Cd("E",void 0,e)}static createComplete(){return Cd.completeNotification}}function LU(n=1/0){return Rh(Sn,n)}function j5(...n){return function xAe(){return LU(1)}()(tu(n,m3(n)))}function Ow(n,e){return"object"==typeof n&&null!==n&&n[Symbol.for("apollo.error")]===e}function Bw(n){Object.defineProperty(n,Symbol.for("apollo.error"),{value:n.name,enumerable:!1,writable:!1,configurable:!1})}function MU(n){return n.filter(e=>e).map(e=>e.message||"Error message not found.").join("\n")}Cd.completeNotification=new Cd("C");let G5=(()=>{class n extends Error{static is(t){return Ow(t,"CombinedGraphQLErrors")}static formatMessage=MU;errors;data;extensions;constructor(t,i=t.errors||[]){super(n.formatMessage(i,{result:t,defaultFormatMessage:MU})),this.errors=i,this.data=t.data,this.extensions=t.extensions,this.name="CombinedGraphQLErrors",Bw(this),Object.setPrototypeOf(this,n.prototype)}}return n})();function RU(n){return n.map(e=>e.message||"Error message not found.").join("\n")}let DAe=(()=>{class n extends Error{static is(t){return Ow(t,"CombinedProtocolErrors")}static formatMessage=RU;errors;constructor(t){super(n.formatMessage(t,{defaultFormatMessage:RU})),this.name="CombinedProtocolErrors",this.errors=t,Bw(this),Object.setPrototypeOf(this,n.prototype)}}return n})();class Pw extends Error{static is(e){return Ow(e,"UnconventionalError")}constructor(e){super("An error of unexpected shape occurred.",{cause:e}),this.name="UnconventionalError",Bw(this),Object.setPrototypeOf(this,Pw.prototype)}}const Fw=Symbol(),kU=new WeakSet;function OU(n,e,t){return yw.withValue(!0,()=>{const i=W5(n,e,t,!1);return Object.isFrozen(n),i})}function W5(n,e,t,i,o){const{knownChanged:r}=t,s=function kAe(n,e){if(e.has(n))return e.get(n);const t=Array.isArray(n)?[]:{};return e.set(n,t),t}(n,t.mutableTargets);if(Array.isArray(n)){for(const[l,h]of Array.from(n.entries())){if(null===h){s[l]=null;continue}const f=W5(h,e,t,i,void 0);r.has(f)&&r.add(s),s[l]=f}return r.has(s)?s:n}for(const l of e.selections){let h;if(i&&r.add(s),l.kind===_n.FIELD){const f=g1(l),m=l.selectionSet;if(h=s[f]||n[f],void 0===h)continue;if(m&&null!==h){const b=W5(n[f],m,t,i,void 0);r.has(b)&&(h=b)}s[f]=h}if(l.kind===_n.INLINE_FRAGMENT&&(!l.typeCondition||t.cache.fragmentMatches(l,n.__typename))&&(h=W5(n,l.selectionSet,t,i,o)),l.kind===_n.FRAGMENT_SPREAD){const f=l.name.value,m=t.fragmentMap[f]||(t.fragmentMap[f]=t.cache.lookupFragment(f));bn(m,39,f);const b=iAe(l);"mask"!==b&&(h=W5(n,m.selectionSet,t,"migrate"===b,o))}r.has(h)&&r.add(s)}return"__typename"in n&&!("__typename"in s)&&(s.__typename=n.__typename),Object.keys(s).length!==Object.keys(n).length&&r.add(s),r.has(s)?s:n}function BU(n){return 7===n||8===n}function Y7(n){return!BU(n)}function Of(n){return!!n.errors?.length}function Hw(n,e=()=>{}){return t=>new wn(i=>{let o=e();return t.subscribe({next(r){let s;try{s=n(r,o)}catch(l){i.error(l)}void 0!==s&&i.next(s)},error(r){i.error(r)},complete(){i.complete()}})})}function $5(n){const e={data:n.data};return n.error&&(e.error=n.error),e}function FAe(n){let e=!1;return pu(n,{Directive:{enter(t){if("client"===t.name.value&&t.arguments&&(e=t.arguments.some(i=>"always"===i.name.value&&"BooleanValue"===i.value.kind&&!0===i.value.value),e))return zh}}}),e}function HAe(n,e){Vh(e);const t=PU(""),i=PU(""),o=ne=>{for(let Me,ge=0;ge<ne.length&&(Me=ne[ge]);++ge)if(!Pr(Me)){if(Me.kind===_n.OPERATION_DEFINITION)return t(Me.name&&Me.name.value);if(Me.kind===_n.FRAGMENT_DEFINITION)return i(Me.name.value)}return bn.error(14),null};let r=0;for(let ne=e.definitions.length-1;ne>=0;--ne)e.definitions[ne].kind===_n.OPERATION_DEFINITION&&++r;const s=function UAe(n){const e=new Map,t=new Map;return n.forEach(i=>{i&&(i.name?e.set(i.name,i):i.test&&t.set(i.test,i))}),i=>{let o=e.get(i.name.value);return!o&&t.size&&t.forEach((r,s)=>{s(i)&&(o=r)}),o}}(n),l=ne=>Aw(ne)&&ne.map(s).some(ge=>ge&&ge.remove),h=new Map;let f=!1;const m={enter(ne){if(l(ne.directives))return f=!0,null}},b=pu(e,{Field:m,InlineFragment:m,VariableDefinition:{enter:()=>!1},Variable:{enter(ne,ge,Me,Ct,Nt){const Zt=o(Nt);Zt&&Zt.variables.add(ne.name.value)}},FragmentSpread:{enter(ne,ge,Me,Ct,Nt){if(l(ne.directives))return f=!0,null;const Zt=o(Nt);Zt&&Zt.fragmentSpreads.add(ne.name.value)}},FragmentDefinition:{enter(ne,ge,Me,Ct){h.set(JSON.stringify(Ct),ne)},leave:(ne,ge,Me,Ct)=>ne===h.get(JSON.stringify(Ct))?ne:r>0&&ne.selectionSet.selections.every(Zt=>Zt.kind===_n.FIELD&&"__typename"===Zt.name.value)?(i(ne.name.value).removed=!0,f=!0,null):void 0},Directive:{leave(ne){if(s(ne))return f=!0,null}}});if(!f)return e;const A=ne=>(ne.transitiveVars||(ne.transitiveVars=new Set(ne.variables),ne.removed||ne.fragmentSpreads.forEach(ge=>{A(i(ge)).transitiveVars.forEach(Me=>{ne.transitiveVars.add(Me)})})),ne),T=new Set;b.definitions.forEach(ne=>{ne.kind===_n.OPERATION_DEFINITION?A(t(ne.name&&ne.name.value)).fragmentSpreads.forEach(ge=>{T.add(ge)}):ne.kind===_n.FRAGMENT_DEFINITION&&0===r&&!i(ne.name.value).removed&&T.add(ne.name.value)}),T.forEach(ne=>{A(i(ne)).fragmentSpreads.forEach(ge=>{T.add(ge)})});const K={enter(ne){if((ne=>!(T.has(ne)&&!i(ne).removed))(ne.name.value))return null}};return function zAe(n){return FU(gd(n)||function ZH(n){bn("Document"===n.kind,6),bn(n.definitions.length<=1,7);const e=n.definitions[0];return bn("FragmentDefinition"===e.kind,8),e}(n),B5(P5(n)))?null:n}(pu(b,{FragmentSpread:K,FragmentDefinition:K,OperationDefinition:{leave(ne){if(ne.variableDefinitions){const ge=A(t(ne.name&&ne.name.value)).transitiveVars;if(ge.size<ne.variableDefinitions.length)return{...ne,variableDefinitions:ne.variableDefinitions.filter(Me=>ge.has(Me.variable.name.value))}}}}}))}function PU(n){const e=new Map;return function(i=n){let o=e.get(i);return o||e.set(i,o={variables:new Set,fragmentSpreads:new Set}),o}}function FU(n,e){return!n||n.selectionSet.selections.every(t=>t.kind===_n.FRAGMENT_SPREAD&&FU(e[t.name.value],e))}var Ei=function(n){return n[n.loading=1]="loading",n[n.setVariables=2]="setVariables",n[n.fetchMore=3]="fetchMore",n[n.refetch=4]="refetch",n[n.poll=6]="poll",n[n.ready=7]="ready",n[n.error=8]="error",n[n.streaming=9]="streaming",n}(Ei||{});function HU(n){return n.catch(()=>{}),n}const{assign:UU}=Object,Bf={loading:!0,networkStatus:Ei.loading,data:void 0,dataState:"empty",partial:!0},Uw={loading:!1,networkStatus:Ei.ready,data:void 0,dataState:"empty",partial:!0};class zw{options;queryName;variablesUnknown=!1;_lastWrite;get query(){return this.lastQuery}get variables(){return this.options.variables}unsubscribeFromCache;input;subject;isTornDown;queryManager;subscriptions=new Set;waitForNetworkResult;lastQuery;linkSubscription;pollingInfo;get networkStatus(){return this.subject.getValue().result.networkStatus}get cache(){return this.queryManager.cache}constructor({queryManager:e,options:t,transformedQuery:i=e.transform(t.query)}){this.queryManager=e,this.waitForNetworkResult="network-only"===t.fetchPolicy,this.isTornDown=!1,this.subscribeToMore=this.subscribeToMore.bind(this),this.maskResult=this.maskResult.bind(this);const{watchQuery:{fetchPolicy:o="cache-first"}={}}=e.defaultOptions,{fetchPolicy:r=o,initialFetchPolicy:s=("standby"===r?o:r)}=t;t[oAe]&&(bn("standby"===r,82),this.variablesUnknown=!0),this.lastQuery=i,this.options={...t,initialFetchPolicy:s,fetchPolicy:r,variables:this.getVariablesWithDefaults(t.variables)},this.initializeObservablesQueue(),this["@@observable"]=()=>this,Symbol.observable&&(this[Symbol.observable]=()=>this);const l=gd(this.query);this.queryName=l&&l.name&&l.name.value}initializeObservablesQueue(){this.subject=new Mr({query:this.query,variables:this.variables,result:Bf,meta:{}});const e=this.subject.pipe(l1({subscribe:()=>{this.subject.observed||(this.reobserve(),setTimeout(()=>this.updatePolling()))},unsubscribe:()=>{this.subject.observed||this.tearDownQuery()}}),Hw(({query:t,variables:i,result:o,meta:r},s)=>{const{shouldEmit:l}=r;if(o===Bf&&(s.previous=void 0,s.previousVariables=void 0),"standby"===this.options.fetchPolicy||2===l)return;if(1===l)return m();const{previous:h,previousVariables:f}=s;if(h){const b=this.queryManager.getDocumentInfo(t),A=this.queryManager.dataMasking;if((A||b.hasNonreactiveDirective?KH(A?b.nonReactiveQuery:t,h,o,i):sr(h,o))&&sr(f,i))return}if(3!==l||this.options.notifyOnNetworkStatusChange&&!sr(h,o))return m();function m(){return s.previous=o,s.previousVariables=i,o}},()=>({})));this.pipe=e.pipe.bind(e),this.subscribe=e.subscribe.bind(e),this.input=new Vn,this.input.complete=()=>{},this.input.pipe(this.operator).subscribe(this.subject)}subscribe;pipe;[Symbol.observable];"@@observable";getCacheDiff({optimistic:e=!0}={}){return this.cache.diff({query:this.query,variables:this.variables,returnPartialData:!0,optimistic:e})}getInitialResult(e){let t=e||this.options.fetchPolicy;this.queryManager.prioritizeCacheValues&&("network-only"===t||"cache-and-network"===t)&&(t="cache-first");const i=()=>{const o=this.getCacheDiff(),r=this.options.returnPartialData||o.complete?o.result??void 0:void 0;return this.maskResult({data:r,dataState:o.complete?"complete":void 0===r?"empty":"partial",loading:!o.complete,networkStatus:o.complete?Ei.ready:Ei.loading,partial:!o.complete})};switch(t){case"cache-only":return{...i(),loading:!1,networkStatus:Ei.ready};case"cache-first":return i();case"cache-and-network":return{...i(),loading:!0,networkStatus:Ei.loading};case"standby":return Uw;default:return Bf}}resubscribeCache(){const{variables:e,fetchPolicy:t}=this.options,i=this.query,o="standby"===t||"no-cache"===t||this.waitForNetworkResult,r=!Z5({query:i,variables:e},this.unsubscribeFromCache)&&!this.waitForNetworkResult;if((o||r)&&this.unsubscribeFromCache?.(),o||!r)return;const s={query:i,variables:e,optimistic:!0,watcher:this,callback:h=>{const f=this.queryManager.getDocumentInfo(i);if((f.hasClientExports||f.hasForcedResolvers)&&(s.lastDiff=void 0),s.lastOwnDiff===h)return;const{result:m}=this.subject.getValue();!h.complete&&(m.error||m===Bf||m===Uw)||sr(m.data,h.result)||this.scheduleNotify()}},l=this.cache.watch(s);this.unsubscribeFromCache=Object.assign(()=>{this.unsubscribeFromCache=void 0,l()},{query:i,variables:e})}stableLastResult;getCurrentResult(){const{result:e}=this.subject.getValue();let t=e.networkStatus===Ei.error||this.hasObservers()||"no-cache"===this.options.fetchPolicy?e:this.getInitialResult();return t===Bf&&(t=this.getInitialResult()),sr(this.stableLastResult,t)||(this.stableLastResult=t),this.stableLastResult}refetch(e){const{fetchPolicy:t}=this.options,i={pollInterval:0};return i.fetchPolicy="no-cache"===t?"no-cache":"network-only",e&&!sr(this.variables,e)&&(i.variables=this.options.variables=this.getVariablesWithDefaults({...this.variables,...e})),this._lastWrite=void 0,this._reobserve(i,{newNetworkStatus:Ei.refetch})}fetchMore({query:e,variables:t,context:i,errorPolicy:o,updateQuery:r}){bn("cache-only"!==this.options.fetchPolicy,84,ml(this.query,"(anonymous)"));const s={...m1(this.options,{errorPolicy:"none"},{query:e,context:i,errorPolicy:o}),variables:e?t:{...this.variables,...t},fetchPolicy:"no-cache",notifyOnNetworkStatusChange:this.options.notifyOnNetworkStatusChange};s.query=this.transformDocument(s.query),this.lastQuery=e?this.transformDocument(this.options.query):s.query;let l=!1;const h="no-cache"!==this.options.fetchPolicy;h||bn(r,85);const{finalize:f,pushNotification:m}=this.pushOperation(Ei.fetchMore);m({source:"newNetworkStatus",kind:"N",value:{}},{shouldEmit:3});const{promise:b,operator:A}=zU(),{observable:T}=this.queryManager.fetchObservableWithInfo(s,{networkStatus:Ei.fetchMore,exposeExtensions:!0}),U=T.pipe(A,G3(K=>"N"===K.kind&&"network"===K.source)).subscribe({next:K=>{l=!1;const ne=K.value,ge=ne[aU];if(BU(K.value.networkStatus)&&f(),h){const Me=this.getCacheDiff();this.cache.batch({update:Ct=>{r?Ct.updateQuery({query:this.query,variables:this.variables,returnPartialData:!0,optimistic:!1,extensions:ge},Nt=>r(Nt,{fetchMoreResult:ne.data,variables:s.variables})):Ct.writeQuery({query:s.query,variables:s.variables,data:ne.data,extensions:ge})},onWatchUpdated:(Ct,Nt)=>{if(Ct.watcher===this&&!sr(Nt.result,Me.result)){l=!0;const Zt=this.getCurrentResult();Y7(ne.networkStatus)&&m({kind:"N",source:"network",value:{...Zt,networkStatus:ne.networkStatus===Ei.error?Ei.ready:ne.networkStatus,loading:!1,data:Nt.result,dataState:"streaming"===ne.dataState?"streaming":"complete"}})}}})}else{const Me=this.getCurrentResult(),Ct=r(Me.data,{fetchMoreResult:ne.data,variables:s.variables});m({kind:"N",value:{...Me,networkStatus:Ei.ready,loading:!1,data:Ct,dataState:"streaming"===Me.dataState?"streaming":"complete"},source:"network"})}}});return HU(b.then(K=>$5(this.maskResult(K))).finally(()=>{if(U.unsubscribe(),f(),h&&!l){const K=this.getCurrentResult();"streaming"===K.dataState?m({kind:"N",source:"network",value:{...K,dataState:"complete",networkStatus:Ei.ready}}):m({kind:"N",source:"newNetworkStatus",value:{}},{shouldEmit:1})}}))}subscribeToMore(e){const t=this.queryManager.startGraphQLSubscription({query:e.document,variables:e.variables,context:e.context}).subscribe({next:i=>{const{updateQuery:o,onError:r}=e,{error:s}=i;s?r?r(s):bn.error(86,s):o&&this.updateQuery((l,h)=>o(l,{subscriptionData:i,...h}))}});return this.subscriptions.add(t),()=>{this.subscriptions.delete(t)&&t.unsubscribe()}}applyOptions(e){const t=m1(this.options,e||{});UU(this.options,t),this.updatePolling()}setVariables(e){var t=this;return(0,M.A)(function*(){return e=t.getVariablesWithDefaults(e),sr(t.variables,e)||(t.options.variables=e,!t.hasObservers())?$5(t.getCurrentResult()):t._reobserve({fetchPolicy:t.options.initialFetchPolicy,variables:e},{newNetworkStatus:Ei.setVariables})})()}updateQuery(e){const{queryManager:t}=this,{result:i,complete:o}=this.getCacheDiff({optimistic:!1}),r=e(i,{variables:this.variables,complete:!!o,previousData:i});r&&(this.cache.writeQuery({query:this.options.query,data:r,variables:this.variables}),t.broadcastQueries())}startPolling(e){this.options.pollInterval=e,this.updatePolling()}stopPolling(){this.options.pollInterval=0,this.updatePolling()}applyNextFetchPolicy(e,t){if(t.nextFetchPolicy){const{fetchPolicy:i="cache-first",initialFetchPolicy:o=i}=t;"standby"===i||(t.fetchPolicy="function"==typeof t.nextFetchPolicy?t.nextFetchPolicy.call(t,i,{reason:e,options:t,observable:this,initialFetchPolicy:o}):"variables-changed"===e?o:t.nextFetchPolicy)}return t.fetchPolicy}fetch(e,t,i,o){const r=this.options.fetchPolicy;e.context??={};let s=!1,{observable:f,fromLink:m}=this.queryManager.fetchObservableWithInfo(e,{networkStatus:t,query:i,onCacheHit:()=>{s=!0},fetchQueryOperator:ne=>new wn(ge=>{try{return ne.subscribe({next(Me){s=!0,ge.next(Me)},error:Me=>ge.error(Me),complete:()=>ge.complete()})}finally{s||(T.override=t,this.input.next({kind:"N",source:"newNetworkStatus",value:{resetError:!0},query:b,variables:A,meta:{shouldEmit:3,fetchPolicy:r}}))}}),observableQuery:this});const{query:b,variables:A}=this,T={abort:()=>{K.unsubscribe()},query:b,variables:A};this.activeOperations.add(T);let U=t==Ei.refetch||t==Ei.setVariables;f=f.pipe(o,O5());const K=f.pipe(l1({next:ne=>{"newNetworkStatus"===ne.source||"N"===ne.kind&&ne.value.loading?T.override=t:delete T.override},finalize:()=>this.activeOperations.delete(T)})).subscribe({next:ne=>{const ge={};U&&"N"===ne.kind&&"loading"in ne.value&&!ne.value.loading&&(U=!1,ge.shouldEmit=1),this.input.next({...ne,query:b,variables:A,meta:ge})}});return{fromLink:m,subscription:K,observable:f}}didWarnCacheOnlyPolling=!1;updatePolling(){if(this.queryManager.ssrMode)return;const{pollingInfo:e,options:{pollInterval:i}}=this,o=()=>{const{options:h}=this;return!h.pollInterval||!this.hasObservers()||"cache-only"===h.fetchPolicy||"standby"===h.fetchPolicy};if(o())return void this.cancelPolling();if(e?.interval===i)return;(e||(this.pollingInfo={})).interval=i;const s=()=>{if(o())return this.cancelPolling();this.pollingInfo&&(Y7(this.networkStatus)||this.options.skipPollAttempt?.()?l():this._reobserve({fetchPolicy:"no-cache"===this.options.initialFetchPolicy?"no-cache":"network-only"},{newNetworkStatus:Ei.poll}).then(l,l))},l=()=>{const h=this.pollingInfo;h&&(clearTimeout(h.timeout),h.timeout=setTimeout(s,h.interval))};l()}cancelPolling(){this.pollingInfo&&(clearTimeout(this.pollingInfo.timeout),delete this.pollingInfo)}reobserve(e){return this._reobserve(e)}_reobserve(e,t){this.isTornDown=!1;let{newNetworkStatus:i}=t||{};this.queryManager.obsQueries.add(this);const o=i===Ei.refetch||i===Ei.poll,r=this.variables,s=this.options.fetchPolicy,l=m1(this.options,e||{});this.variablesUnknown&&="standby"===l.fetchPolicy;const h=o?l:UU(this.options,l),f=this.transformDocument(h.query);this.lastQuery=f,e&&"variables"in e&&(h.variables=this.getVariablesWithDefaults(e.variables)),o||(this.updatePolling(),e&&e.variables&&!sr(e.variables,r)&&"standby"!==h.fetchPolicy&&(h.fetchPolicy===s||"function"==typeof h.nextFetchPolicy)&&(this.applyNextFetchPolicy("variables-changed",h),void 0===i&&(i=Ei.setVariables))),i||(i=Ei.loading,this.networkStatus!==Ei.loading&&e?.variables&&!sr(e.variables,r)&&(i=Ei.setVariables),"standby"===h.fetchPolicy&&(i=Ei.ready)),"standby"===h.fetchPolicy&&this.cancelPolling(),this.resubscribeCache();const{promise:b,operator:A}=zU("standby"===h.fetchPolicy?{data:void 0}:void 0),{subscription:T,observable:U,fromLink:K}=this.fetch(h,i,f,A);!o&&(K||!this.linkSubscription)&&(this.linkSubscription&&this.linkSubscription.unsubscribe(),this.linkSubscription=T);const ne=Object.assign(HU(b.then(ge=>$5(this.maskResult(ge))).finally(()=>{!this.hasObservers()&&0===this.activeOperations.size&&this.tearDownQuery()})),{retain:()=>{const ge=U.subscribe({}),Me=()=>ge.unsubscribe();return b.then(Me,Me),ne}});return ne}hasObservers(){return this.subject.observed}stop(){this.subject.complete(),this.initializeObservablesQueue(),this.tearDownQuery()}tearDownQuery(){this.isTornDown||(this.resetNotifications(),this.unsubscribeFromCache?.(),this.linkSubscription&&(this.linkSubscription.unsubscribe(),delete this.linkSubscription),this.stopPolling(),this.subscriptions.forEach(e=>e.unsubscribe()),this.subscriptions.clear(),this.queryManager.obsQueries.delete(this),this.isTornDown=!0,this.abortActiveOperations(),this._lastWrite=void 0)}transformDocument(e){return this.queryManager.transform(e)}maskResult(e){const t=this.queryManager.maskOperation({document:this.query,data:e.data,fetchPolicy:this.options.fetchPolicy,cause:this});return t===e.data?e:{...e,data:t}}dirty=!1;notifyTimeout;resetNotifications(){this.notifyTimeout&&(clearTimeout(this.notifyTimeout),this.notifyTimeout=void 0),this.dirty=!1}scheduleNotify(){this.dirty||(this.dirty=!0,this.notifyTimeout||(this.notifyTimeout=setTimeout(()=>this.notify(!0),0)))}notify(e=!1){if(!e){const i=this.queryManager.getDocumentInfo(this.query);if(i.hasClientExports||i.hasForcedResolvers)return}const{dirty:t}=this;if(this.resetNotifications(),t&&("cache-only"===this.options.fetchPolicy||"cache-and-network"===this.options.fetchPolicy||!this.activeOperations.size)){const i=this.getCacheDiff();sr(i.result,this.getCacheDiff({optimistic:!1}).result)?this.reobserveCacheFirst():this.input.next({kind:"N",value:{data:i.result,dataState:i.complete?"complete":i.result?"partial":"empty",networkStatus:Ei.ready,loading:!1,error:void 0,partial:!i.complete},source:"cache",query:this.query,variables:this.variables,meta:{}})}}activeOperations=new Set;pushOperation(e){let t=!1;const{query:i,variables:o}=this,r=()=>{this.activeOperations.delete(s)},s={override:e,abort:()=>{t=!0,r()},query:i,variables:o};return this.activeOperations.add(s),{finalize:r,pushNotification:(l,h)=>{t||this.input.next({...l,query:i,variables:o,meta:{...h}})}}}calculateNetworkStatus(e){return e===Ei.streaming?e:Array.from(this.activeOperations.values()).reverse().find(i=>Z5(i,this)&&void 0!==i.override)?.override??e}abortActiveOperations(){this.activeOperations.forEach(e=>e.abort())}reset(){const e="cache-only"===this.options.fetchPolicy;this.setResult(e?Uw:Bf,{shouldEmit:e?1:2}),this.abortActiveOperations()}setResult(e,t){this.input.next({source:"setResult",kind:"N",value:e,query:this.query,variables:this.variables,meta:{...t}})}operator=Hw(e=>{const{query:t,variables:i,meta:o}=e;if("setResult"===e.source)return{query:t,variables:i,result:e.value,meta:o};if("C"===e.kind||!Z5(e,this))return;let r;const s=this.subject.getValue();if("cache"===e.source){if(r=e.value,r.networkStatus===Ei.ready&&r.partial&&(!this.options.returnPartialData||s.result.networkStatus===Ei.error)&&"cache-only"!==this.options.fetchPolicy)return}else if("network"===e.source)this.waitForNetworkResult&&(this.waitForNetworkResult=!1,this.resubscribeCache()),r="E"===e.kind?{...Z5(s,e)?s.result:{data:void 0,dataState:"empty",partial:!0},error:e.error,networkStatus:Ei.error,loading:!1}:e.value,"E"===e.kind&&"streaming"===r.dataState&&(r.dataState="complete"),r.error&&(o.shouldEmit=1);else if("newNetworkStatus"===e.source){const l=Z5(s,e)?s.result:this.getInitialResult(o.fetchPolicy),{resetError:h}=e.value,f=h?void 0:l.error,m=f?Ei.error:Ei.ready;r={...l,error:f,networkStatus:m}}return bn(r),r.error||delete r.error,r.networkStatus=this.calculateNetworkStatus(r.networkStatus),r.loading=Y7(r.networkStatus),r=this.maskResult(r),void 0!==s.result.data&&r.data!==s.result.data&&sr(r.data,s.result.data)&&(r.data=s.result.data),{query:t,variables:i,result:r,meta:o}});reobserveCacheFirst(){const{fetchPolicy:e,nextFetchPolicy:t}=this.options;"cache-and-network"===e||"network-only"===e?this.reobserve({fetchPolicy:"cache-first",nextFetchPolicy(i,o){return this.nextFetchPolicy=t,"function"==typeof this.nextFetchPolicy?this.nextFetchPolicy(i,o):e}}):this.reobserve()}getVariablesWithDefaults(e){return this.queryManager.getVariables(this.query,e)}}function Z5(n,e){return!!(n&&e&&n.query===e.query&&sr(n.variables,e.variables))}function zU(n){let t,i,e=n;return{promise:new Promise((s,l)=>{t=s,i=l}),operator:l1({next(s){if("E"===s.kind)return i(s.error);"N"===s.kind&&"newNetworkStatus"!==s.source&&!s.value.loading&&(e=s.value)},finalize:()=>{if(e)t(e);else{const s="The operation was aborted.",l="AbortError";i(typeof DOMException<"u"?new DOMException(s,l):Object.assign(new Error(s),{name:l}))}}})}}const VU={},Pf=new WeakMap;function Vw(n,e){const t=n[e];"function"==typeof t&&(n[e]=function(){return Pf.set(n,(Pf.get(n)+1)%1e15),t.apply(this,arguments)})}const jU=new WeakMap;class jw{lastRequestId=1;cache;queryManager;id;observableQuery;incremental;constructor(e,t){const i=this.cache=e.cache,o=(jU.get(e)||0)+1;jU.set(e,o),this.id=o+"",this.observableQuery=t,this.queryManager=e,Pf.has(i)||(Pf.set(i,0),Vw(i,"evict"),Vw(i,"modify"),Vw(i,"reset"))}_lastWrite;get lastWrite(){return(this.observableQuery||this)._lastWrite}set lastWrite(e){(this.observableQuery||this)._lastWrite=e}resetLastWrite(){this.lastWrite=void 0}shouldWrite(e,t){const{lastWrite:i}=this;return!(i&&i.dmCount===Pf.get(this.cache)&&sr(t,i.variables)&&sr(e.data,i.result.data)&&e.extensions?.[$h]===i.result.extensions?.[$h])}get hasNext(){return!!this.incremental&&this.incremental.hasNext}maybeHandleIncrementalResult(e,t,i){const{incrementalHandler:o}=this.queryManager;return o.isIncrementalResult(t)?(this.incremental||=o.startRequest({query:i}),this.incremental.handle(e,t)):t}markQueryResult(e,{document:t,variables:i,errorPolicy:o,cacheWriteBehavior:r}){const s={query:t,variables:i,returnPartialData:!0,optimistic:!0};this.observableQuery?.resetNotifications();const l=0===r,h=l?void 0:this.cache.diff(s);let f=this.maybeHandleIncrementalResult(h?.result,e,t);return l||(Gw(f,o)?this.cache.batch({onWatchUpdated:(m,b)=>{m.watcher===this.observableQuery&&(m.lastOwnDiff=b)},update:m=>{if(this.shouldWrite(f,i))m.writeQuery({query:t,data:f.data,variables:i,overwrite:1===r,extensions:f.extensions}),this.lastWrite={result:f,variables:i,dmCount:Pf.get(this.cache)};else if(h&&h.complete)return void(f={...f,data:h.result});const b=m.diff(s);b.complete&&(f={...f,data:b.result})}}):this.lastWrite=void 0),f}markMutationResult(e,t,i=this.cache){const o=[],r=0===t.cacheWriteBehavior;let s=this.maybeHandleIncrementalResult(r?void 0:i.diff({id:"ROOT_MUTATION",query:this.queryManager.getDocumentInfo(t.document).asQuery,variables:t.variables,optimistic:!1,returnPartialData:!0}).result,e,t.document);if("ignore"===t.errorPolicy&&(s={...s,errors:[]}),Of(s)&&"none"===t.errorPolicy)return Promise.resolve(s);const l=()=>({...s,dataState:this.hasNext?"streaming":"complete"});if(!r&&Gw(s,t.errorPolicy)){o.push({result:s.data,dataId:"ROOT_MUTATION",query:t.document,variables:t.variables,extensions:s.extensions});const{updateQueries:f}=t;f&&this.queryManager.getObservableQueries("all").forEach(m=>{const b=m&&m.queryName;if(!b||!Object.hasOwnProperty.call(f,b))return;const A=f[b],{query:T,variables:U}=m,{result:K,complete:ne}=m.getCacheDiff({optimistic:!1});if(ne&&K){const ge=A(K,{mutationResult:l(),queryName:T&&ml(T)||void 0,queryVariables:U});ge&&o.push({result:ge,dataId:"ROOT_QUERY",query:T,variables:U})}})}let h=t.refetchQueries;if("function"==typeof h&&(h=h(l())),o.length>0||(h||"").length>0||t.update||t.onQueryUpdated||t.removeOptimistic){const f=[];if(this.queryManager.refetchQueries({updateCache:m=>{r||o.forEach(A=>m.write(A));const{update:b}=t;if(b){if(!r){const A=m.diff({id:"ROOT_MUTATION",query:this.queryManager.getDocumentInfo(t.document).asQuery,variables:t.variables,optimistic:!1,returnPartialData:!0});A.complete&&(s={...s,data:A.result})}this.hasNext||b(m,s,{context:t.context,variables:t.variables})}!r&&!t.keepRootFields&&!this.hasNext&&m.modify({id:"ROOT_MUTATION",fields:(A,{fieldName:T,DELETE:U})=>"__typename"===T?A:U})},include:h,optimistic:!1,removeOptimistic:t.removeOptimistic,onQueryUpdated:t.onQueryUpdated||null}).forEach(m=>f.push(m)),t.awaitRefetchQueries||t.onQueryUpdated)return Promise.all(f).then(()=>s)}return Promise.resolve(s)}markMutationOptimistic(e,t){const i="function"==typeof e?e(t.variables,{IGNORE:VU}):e;return i!==VU&&(this.cache.recordOptimisticTransaction(o=>{try{this.markMutationResult({data:i},t,o)}catch(r){bn.error(r)}},this.id),!0)}markSubscriptionResult(e,{document:t,variables:i,errorPolicy:o,cacheWriteBehavior:r}){0!==r&&(Gw(e,o)&&this.cache.write({query:t,result:e.data,dataId:"ROOT_SUBSCRIPTION",variables:i,extensions:e.extensions}),this.queryManager.broadcastQueries())}}function Gw(n,e="none"){const t="ignore"===e||"all"===e;let i=!Of(n);return!i&&t&&n.data&&(i=!0),i}class WAe{defaultOptions;client;clientOptions;assumeImmutableResults;documentTransform;ssrMode;defaultContext;dataMasking;incrementalHandler;localState;queryDeduplication;prioritizeCacheValues=!1;onBroadcast;mutationStore;obsQueries=new Set;fetchCancelFns=new Map;constructor(e){const t=new md(o=>this.cache.transformDocument(o),{cache:!1});this.client=e.client,this.defaultOptions=e.defaultOptions,this.queryDeduplication=e.queryDeduplication,this.clientOptions=e.clientOptions,this.ssrMode=e.ssrMode,this.assumeImmutableResults=e.assumeImmutableResults,this.dataMasking=e.dataMasking,this.localState=e.localState,this.incrementalHandler=e.incrementalHandler;const i=e.documentTransform;this.documentTransform=i?t.concat(i).concat(t):t,this.defaultContext=e.defaultContext||{},(this.onBroadcast=e.onBroadcast)&&(this.mutationStore={})}get link(){return this.client.link}get cache(){return this.client.cache}stop(){this.obsQueries.forEach(e=>e.stop()),this.cancelPendingFetches(vl(89))}cancelPendingFetches(e){this.fetchCancelFns.forEach(t=>t(e)),this.fetchCancelFns.clear()}mutate(e){var t=this;return(0,M.A)(function*({mutation:i,variables:o,optimisticResponse:r,updateQueries:s,refetchQueries:l=[],awaitRefetchQueries:h=!1,update:f,onQueryUpdated:m,fetchPolicy:b,errorPolicy:A,keepRootFields:T,context:U}){const K=new jw(t);i=t.cache.transformForLink(t.transform(i));const{hasClientExports:ne}=t.getDocumentInfo(i);o=t.getVariables(i,o),ne&&(o=yield t.localState.getExportedVariables({client:t.client,document:i,variables:o,context:U}));const ge=t.mutationStore&&(t.mutationStore[K.id]={mutation:i,variables:o,loading:!0,error:null}),Me=r&&K.markMutationOptimistic(r,{document:i,variables:o,cacheWriteBehavior:"no-cache"===b?0:2,errorPolicy:A,context:U,updateQueries:s,update:f,keepRootFields:T});return t.broadcastQueries(),new Promise((Ct,Nt)=>{const Zt={};return t.getObservableFromLink(i,{...U,optimisticResponse:Me?r:void 0},o,b,{},!1).observable.pipe(GU(),Rh(Wn=>{const Ri={...Wn};return tu(K.markMutationResult(Ri,{document:i,variables:o,cacheWriteBehavior:"no-cache"===b?0:2,errorPolicy:A,context:U,update:f,updateQueries:s,awaitRefetchQueries:h,refetchQueries:l,removeOptimistic:Me?K.id:void 0,onQueryUpdated:m,keepRootFields:T}))})).pipe(mo(Wn=>{if(Of(Wn)&&"none"===A)throw new G5(Ww(Wn));return ge&&(ge.loading=!1,ge.error=null),Wn})).subscribe({next:Wn=>{if(t.broadcastQueries(),!K.hasNext){const Ri={data:t.maskOperation({document:i,data:Wn.data,fetchPolicy:b,cause:Zt})};Of(Wn)&&(Ri.error=new G5(Wn)),Object.keys(Wn.extensions||{}).length&&(Ri.extensions=Wn.extensions),Ct(Ri)}},error:Wn=>(ge&&(ge.loading=!1,ge.error=Wn),Me&&t.cache.removeOptimistic(K.id),t.broadcastQueries(),"ignore"===A?Ct({data:void 0}):"all"===A?Ct({data:void 0,error:Wn}):void Nt(Wn))})})}).apply(this,arguments)}fetchQuery(e,t){var i=this;return Vh(e.query,_u.QUERY),(0,M.A)(function*(){return f5(i.fetchObservableWithInfo(e,{networkStatus:t}).observable.pipe(Hw(o=>{switch(o.kind){case"E":throw o.error;case"N":if("newNetworkStatus"!==o.source)return $5(o.value)}})),{defaultValue:{data:void 0}})})()}transform(e){return this.documentTransform.transformDocument(e)}transformCache=new tw(fd["queryManager.getDocumentInfo"]||2e3);getDocumentInfo(e){const{transformCache:t}=this;if(!t.has(e)){const o=gd(e),r={hasClientExports:V5(["client","export"],e,!0),hasForcedResolvers:FAe(e),hasNonreactiveDirective:V5(["nonreactive"],e),hasIncrementalDirective:V5(["defer"],e),nonReactiveQuery:ZAe(e),clientQuery:V5(["client"],e)?e:null,serverQuery:HAe([{name:"client",remove:!0},{name:"connection"},{name:"nonreactive"},{name:"unmask"}],e),operationType:o?.operation,defaultVars:xw(o),asQuery:{...e,definitions:e.definitions.map(s=>"OperationDefinition"===s.kind&&"query"!==s.operation?{...s,operation:"query"}:s)}};t.set(e,r)}const i=t.get(e);if(i.violation)throw i.violation;return i}getVariables(e,t){const i=this.getDocumentInfo(e).defaultVars,o=Object.entries(t??{}).map(([r,s])=>[r,void 0===s?i[r]:s]);return{...i,...Object.fromEntries(o)}}watchQuery(e){Vh(e.query,_u.QUERY);const t=this.transform(e.query);return typeof(e={...e,variables:this.getVariables(t,e.variables)}).notifyOnNetworkStatusChange>"u"&&(e.notifyOnNetworkStatusChange=!0),new zw({queryManager:this,options:e,transformedQuery:t})}query(e){const t=this.transform(e.query);return this.fetchQuery({...e,query:t}).then(i=>({...i,data:this.maskOperation({document:t,data:i?.data,fetchPolicy:e.fetchPolicy})}))}requestIdCounter=1;generateRequestId(){return this.requestIdCounter++}clearStore(e={discardWatches:!0}){return this.cancelPendingFetches(vl(91)),this.obsQueries.forEach(t=>{t.reset()}),this.mutationStore&&(this.mutationStore={}),this.cache.reset(e)}getObservableQueries(e="active"){const t=new Set,i=new Map,o=new Map,r=new Set;return Array.isArray(e)&&e.forEach(s=>{if("string"==typeof s)i.set(s,s),o.set(s,!1);else if(function VAe(n){return qs(n)&&"Document"===n.kind&&Array.isArray(n.definitions)}(s)){const l=k5(this.transform(s));i.set(l,ml(s)),o.set(l,!1)}else qs(s)&&s.query&&r.add(s)}),this.obsQueries.forEach(s=>{const l=k5(this.transform(s.options.query));if("all"===e)return void t.add(s);const{queryName:h,options:{fetchPolicy:f}}=s;"active"===e&&"standby"===f||("active"===e||h&&o.has(h)||l&&o.has(l))&&(t.add(s),h&&o.set(h,!0),l&&o.set(l,!0))}),r.size&&r.forEach(s=>{const l=new zw({queryManager:this,options:{...Z7(this.defaultOptions.watchQuery,s),fetchPolicy:"network-only"}});t.add(l)}),t}refetchObservableQueries(e=!1){const t=[];return this.getObservableQueries(e?"all":"active").forEach(i=>{const{fetchPolicy:o}=i.options;(e||"standby"!==o)&&"cache-only"!==o&&t.push(i.refetch())}),this.broadcastQueries(),Promise.all(t)}startGraphQLSubscription(e){let{query:t,variables:i}=e;const{fetchPolicy:o="cache-first",errorPolicy:r="none",context:s={},extensions:l={}}=e;let h;Vh(t,_u.SUBSCRIPTION),t=this.transform(t),i=this.getVariables(t,i);const f=(this.getDocumentInfo(t).hasClientExports?tu(this.localState.getExportedVariables({client:this.client,document:t,variables:i,context:s})):au(i)).pipe(Rh(m=>{const{observable:b,restart:A}=this.getObservableFromLink(t,s,m,o,l),T=new jw(this);return h=A,b.pipe(mo(U=>{T.markSubscriptionResult(U,{document:t,variables:m,errorPolicy:r,cacheWriteBehavior:"no-cache"===o?0:2});const K={data:U.data??void 0};return Of(U)?K.error=new G5(U):function LAe(n){return"extensions"in n&&DAe.is(n.extensions[Fw])}(U)&&(K.error=U.extensions[Fw],delete U.extensions[Fw]),U.extensions&&Object.keys(U.extensions).length&&(K.extensions=U.extensions),K.error&&"none"===r&&(K.data=void 0),"ignore"===r&&delete K.error,K}),bd(U=>au("ignore"===r?{data:void 0}:{data:void 0,error:U})),G3(U=>!(!U.data&&!U.error)))}));return Object.assign(f,{restart:()=>h?.()})}broadcastQueries(){this.onBroadcast&&this.onBroadcast(),this.obsQueries.forEach(e=>e.notify())}inFlightLinkObservables=new fu(!1);getObservableFromLink(e,t,i,o,r,s=t?.queryDeduplication??this.queryDeduplication){let l={};const{serverQuery:h,clientQuery:f,operationType:m,hasIncrementalDirective:b}=this.getDocumentInfo(e),A=ml(e),T={client:this.client};if(h){const{inFlightLinkObservables:U,link:K}=this;try{let ge=function(Me){return new wn(Ct=>{function Nt(){return Me.subscribe({next:Ct.next.bind(Ct),complete:Ct.complete.bind(Ct),error:Ct.error.bind(Ct)})}let Zt=Nt();return l.restart||=()=>{Zt.unsubscribe(),Zt=Nt()},()=>{Zt.unsubscribe(),l.restart=void 0}})};const ne=this.incrementalHandler.prepareRequest({query:h,variables:i,context:{...this.defaultContext,...t,queryDeduplication:s},extensions:r});if(t=ne.context,s){const Me=k5(h),Ct=vd(i);l=U.lookup(Me,Ct),l.observable||(l.observable=kw(K,ne,T).pipe(ge,ry(()=>{U.peek(Me,Ct)===l&&U.remove(Me,Ct)}),m===_u.SUBSCRIPTION?O5():H7({refCount:!0})))}else l.observable=kw(K,ne,T).pipe(ge)}catch(ne){l.observable=Zh(()=>ne)}}else l.observable=au({data:{}});if(f){const{operation:U}=gd(e);bn(!b,96,U[0].toUpperCase()+U.slice(1),A??"(anonymous)"),l.observable=l.observable.pipe(Rh(K=>tu(this.localState.execute({client:this.client,document:f,remoteResult:K,context:t,variables:i,fetchPolicy:o}))))}return{restart:()=>l.restart?.(),observable:l.observable.pipe(bd(U=>{throw U=function MAe(n){return function NAe(n){return null!==n&&"object"==typeof n&&"string"==typeof n.message&&"string"==typeof n.name&&("string"==typeof n.stack||typeof n.stack>"u")}(n)?n:"string"==typeof n?new Error(n,{cause:n}):new Pw(n)}(U),function RAe(n){kU.add(n)}(U),U}))}}getResultsFromLink(e,{queryInfo:t,cacheWriteBehavior:i,observableQuery:o,exposeExtensions:r}){const s=t.lastRequestId=this.generateRequestId(),{errorPolicy:l}=e,h=this.cache.transformForLink(e.query);return this.getObservableFromLink(h,e.context,e.variables,e.fetchPolicy).observable.pipe(mo(f=>{const m=t.markQueryResult(f,{...e,document:h,cacheWriteBehavior:i}),b=Of(m);if(b&&"none"===l)throw t.resetLastWrite(),o?.resetNotifications(),new G5(Ww(m));const A={data:m.data,...t.hasNext?{loading:!0,networkStatus:Ei.streaming,dataState:"streaming",partial:!0}:{dataState:m.data?"complete":"empty",loading:!1,networkStatus:Ei.ready,partial:!m.data}};return r&&"extensions"in m&&(A[aU]=m.extensions),b&&("none"===l&&(A.data=void 0,A.dataState="empty"),"ignore"!==l&&(A.error=new G5(Ww(m)),"streaming"!==A.dataState&&(A.networkStatus=Ei.error))),A}),bd(f=>{if(s>=t.lastRequestId&&"none"===l)throw t.resetLastWrite(),o?.resetNotifications(),f;const m={data:void 0,dataState:"empty",loading:!1,networkStatus:Ei.ready,partial:!0};return"ignore"!==l&&(m.error=f,m.networkStatus=Ei.error),au(m)}))}fetchObservableWithInfo(e,{networkStatus:t=Ei.loading,query:i=e.query,fetchQueryOperator:o=h=>h,onCacheHit:r=()=>{},observableQuery:s,exposeExtensions:l}){const h=this.getVariables(i,e.variables);let{fetchPolicy:f="cache-first",errorPolicy:m="none",returnPartialData:b=!1,notifyOnNetworkStatusChange:A=!0,context:T={}}=e;this.prioritizeCacheValues&&("network-only"===f||"cache-and-network"===f)&&(f="cache-first");const U=Object.assign({},e,{query:i,variables:h,fetchPolicy:f,errorPolicy:m,returnPartialData:b,notifyOnNetworkStatusChange:A,context:T}),K=new jw(this,s),ne=Zt=>{U.variables=Zt;const Ri=this.fetchQueryByPolicy(U,{queryInfo:K,cacheWriteBehavior:"no-cache"===f?0:t===Ei.refetch&&"merge"!==U.refetchWritePolicy?1:2,onCacheHit:r,observableQuery:s,exposeExtensions:l});return Ri.observable=Ri.observable.pipe(o),"standby"!==U.fetchPolicy&&s?.applyNextFetchPolicy("after-fetch",e),Ri},ge=()=>{this.fetchCancelFns.delete(K.id)};this.fetchCancelFns.set(K.id,Zt=>{Me.next({kind:"E",error:Zt,source:"network"})});const Me=new Vn;let Ct,Nt;if(this.getDocumentInfo(U.query).hasClientExports)Ct=tu(this.localState.getExportedVariables({client:this.client,document:U.query,variables:U.variables,context:U.context})).pipe(Rh(Zt=>ne(Zt).observable)),Nt=!0;else{const Zt=ne(U.variables);Nt=Zt.fromLink,Ct=Zt.observable}return{observable:new wn(Zt=>{Zt.add(ge),Ct.subscribe(Zt),Me.subscribe(Zt)}).pipe(O5()),fromLink:Nt}}refetchQueries({updateCache:e,include:t,optimistic:i=!1,removeOptimistic:o=(i?uH("refetchQueries"):void 0),onQueryUpdated:r}){const s=new Map;t&&this.getObservableQueries(t).forEach(h=>{if("cache-only"===h.options.fetchPolicy||h.variablesUnknown)return;const f=h.getCurrentResult();s.set(h,{oq:h,lastDiff:{result:f?.data,complete:!f?.partial}})});const l=new Map;if(e){const h=new Set;this.cache.batch({update:e,optimistic:i&&o||!1,removeOptimistic:o,onWatchUpdated(f,m,b){const A=f.watcher;if(A instanceof zw&&!h.has(A)){if(h.add(A),r){s.delete(A);let T=r(A,m,b);return!0===T&&(T=A.refetch().retain()),!1!==T&&l.set(A,T),T}null!==r&&"cache-only"!==A.options.fetchPolicy&&s.set(A,{oq:A,lastDiff:b,diff:m})}}})}return s.size&&s.forEach(({oq:h,lastDiff:f,diff:m})=>{let b;r&&(m||(m=h.getCacheDiff()),b=r(h,m,f)),(!r||!0===b)&&(b=h.refetch().retain()),!1!==b&&l.set(h,b)}),o&&this.cache.removeOptimistic(o),l}noCacheWarningsByCause=new WeakSet;maskOperation(e){const{document:t,data:i}=e;return this.dataMasking?function BAe(n,e,t){const i=gd(e);return bn(i,43),null==n?n:OU(n,i.selectionSet,{operationType:i.operation,operationName:i.name?.value,fragmentMap:B5(P5(e)),cache:t,mutableTargets:new WeakMap,knownChanged:new WeakSet})}(i,t,this.cache):i}maskFragment(e){const{data:t,fragment:i,fragmentName:o}=e;return this.dataMasking?function PAe(n,e,t,i){const o=e.definitions.filter(s=>s.kind===_n.FRAGMENT_DEFINITION);typeof i>"u"&&(bn(1===o.length,41,o.length),i=o[0].name.value);const r=o.find(s=>s.name.value===i);return bn(!!r,42,i),null==n||sr(n,{})?n:OU(n,r.selectionSet,{operationType:"fragment",operationName:r.name.value,fragmentMap:B5(P5(e)),cache:t,mutableTargets:new WeakMap,knownChanged:new WeakSet})}(t,i,this.cache,o):t}fetchQueryByPolicy({query:e,variables:t,fetchPolicy:i,errorPolicy:o,returnPartialData:r,context:s},{cacheWriteBehavior:l,onCacheHit:h,queryInfo:f,observableQuery:m,exposeExtensions:b}){const A=()=>this.cache.diff({query:e,variables:t,returnPartialData:!0,optimistic:!0}),T=(K,ne)=>{const ge=K.result,Me=Nt=>(!K.complete&&!r&&(Nt=void 0),{data:Nt,dataState:K.complete?"complete":Nt?"partial":"empty",loading:Y7(ne),networkStatus:ne,partial:!K.complete});return(K.complete||r)&&this.getDocumentInfo(e).hasForcedResolvers?(h(),tu(this.localState.execute({client:this.client,document:e,remoteResult:ge?{data:ge}:void 0,context:s,variables:t,onlyRunForcedResolvers:!0,returnPartialData:!0,fetchPolicy:i}).then(Nt=>({kind:"N",value:Me(Nt.data||void 0),source:"cache"})))):au({kind:"N",value:Me("none"===o&&ne===Ei.refetch&&K.missing?void 0:ge||void 0),source:"cache"})},U=()=>this.getResultsFromLink({query:e,variables:t,context:s,fetchPolicy:i,errorPolicy:o},{cacheWriteBehavior:l,queryInfo:f,observableQuery:m,exposeExtensions:b}).pipe(GU(),function EAe(){return ia((n,e)=>{n.subscribe(Sa(e,t=>{e.next(Cd.createNext(t))},()=>{e.next(Cd.createComplete()),e.complete()},t=>{e.next(Cd.createError(t)),e.complete()}))})}(),mo(K=>({...K,source:"network"})));switch(i){default:case"cache-first":{const K=A();return K.complete?{fromLink:!1,observable:T(K,Ei.ready)}:r?{fromLink:!0,observable:j5(T(K,Ei.loading),U())}:{fromLink:!0,observable:U()}}case"cache-and-network":{const K=A();return K.complete||r?{fromLink:!0,observable:j5(T(K,Ei.loading),U())}:{fromLink:!0,observable:U()}}case"cache-only":return{fromLink:!1,observable:j5(T(A(),Ei.ready))};case"network-only":case"no-cache":return{fromLink:!0,observable:U()};case"standby":return{fromLink:!1,observable:pd}}}}function GU(){let n=!1;return l1({next(){n=!0},complete(){bn(n,100)}})}function ZAe(n){return pu(n,{FragmentSpread:e=>{if(!e.directives?.some(t=>"unmask"===t.name.value))return{...e,directives:[...e.directives||[],{kind:_n.DIRECTIVE,name:{kind:_n.NAME,value:"nonreactive"}}]}}})}function Ww(n){if(null==n.extensions?.[$h])return n;const{extensions:{[$h]:e,...t},...i}=n;return Object.keys(t).length>0&&(i.extensions=t),i}class $w{link;cache;disableNetworkFetches;set prioritizeCacheValues(e){this.queryManager.prioritizeCacheValues=e}get prioritizeCacheValues(){return this.queryManager.prioritizeCacheValues}version;queryDeduplication;defaultOptions;devtoolsConfig;refetchEventManager;queryManager;devToolsHookCb;resetStoreCallbacks=[];clearStoreCallbacks=[];constructor(e){const{cache:t,documentTransform:i,ssrMode:o=!1,ssrForceFetchDelay:r=0,queryDeduplication:s=!0,defaultOptions:l,defaultContext:h,assumeImmutableResults:f=t.assumeImmutableResults,localState:m,devtools:b,dataMasking:A,link:T,incrementalHandler:U=new AAe,experiments:K=[],refetchEventManager:ne}=e;this.link=T,this.cache=t,this.queryDeduplication=s,this.defaultOptions=l||{},this.devtoolsConfig={...b,enabled:b?.enabled??false},this.watchQuery=this.watchQuery.bind(this),this.query=this.query.bind(this),this.mutate=this.mutate.bind(this),this.watchFragment=this.watchFragment.bind(this),this.resetStore=this.resetStore.bind(this),this.reFetchObservableQueries=this.refetchObservableQueries=this.refetchObservableQueries.bind(this),this.version=Yy,this.queryManager=new WAe({client:this,defaultOptions:this.defaultOptions,defaultContext:h,documentTransform:i,queryDeduplication:s,ssrMode:o,dataMasking:!!A,clientOptions:e,incrementalHandler:U,assumeImmutableResults:f,onBroadcast:this.devtoolsConfig.enabled?()=>{this.devToolsHookCb&&this.devToolsHookCb()}:void 0,localState:m}),this.prioritizeCacheValues=o||r>0,r&&setTimeout(()=>{this.prioritizeCacheValues=!1},r),this.devtoolsConfig.enabled&&this.connectToDevTools(),K.forEach(ge=>ge.call(this,e)),this.refetchEventManager=ne,this.refetchEventManager?.connect(this)}connectToDevTools(){if(typeof window>"u")return;const e=window,t=Symbol.for("apollo.devtools");(e[t]=e[t]||[]).push(this),e.__APOLLO_CLIENT__=this}get documentTransform(){return this.queryManager.documentTransform}get localState(){return this.queryManager.localState}set localState(e){this.queryManager.localState=e}stop(){this.queryManager.stop(),this.refetchEventManager?.disconnect(this)}watchQuery(e){const{refetchOn:t}=e;if(this.defaultOptions.watchQuery){const i=this.defaultOptions.watchQuery.refetchOn;let o;t&&"object"==typeof t&&("object"==typeof i?o={...i,...t}:null!=i&&(o=r=>{const s=t[r.source]??i;return"function"==typeof s?s(r):s})),e=Z7(this.defaultOptions.watchQuery,e),o&&(e.refetchOn=o)}return this.queryManager.watchQuery(e)}query=e=>(this.defaultOptions.query&&(e=Z7(this.defaultOptions.query,e)),this.queryManager.query(e));mutate=e=>{const t=Z7(m1({fetchPolicy:"network-only",errorPolicy:"none"},this.defaultOptions.mutate),e);return Vh(t.mutation,_u.MUTATION),this.queryManager.mutate(t)};subscribe(e){const t={},i=this.queryManager.startGraphQLSubscription(e),o=i.pipe(mo(r=>({...r,data:this.queryManager.maskOperation({document:e.query,data:r.data,fetchPolicy:e.fetchPolicy,cause:t})})));return Object.assign(o,{restart:i.restart})}readQuery(e,t=!!e.optimistic){return this.cache.readQuery({...e,query:this.transform(e.query)},t)}watchFragment(e){const t=this.queryManager.dataMasking;return this.cache.watchFragment({...e,fragment:this.transform(e.fragment,t)})}readFragment(e,t=!!e.optimistic){return this.cache.readFragment({...e,fragment:this.transform(e.fragment)},t)}writeQuery(e){const t=this.cache.writeQuery(e);return!1!==e.broadcast&&this.queryManager.broadcastQueries(),t}writeFragment(e){const t=this.cache.writeFragment(e);return!1!==e.broadcast&&this.queryManager.broadcastQueries(),t}__actionHookForDevTools(e){this.devToolsHookCb=e}__requestRaw(e){return kw(this.link,e,{client:this})}resetStore(){return Promise.resolve().then(()=>this.queryManager.clearStore({discardWatches:!1})).then(()=>Promise.all(this.resetStoreCallbacks.map(e=>e()))).then(()=>this.refetchObservableQueries())}clearStore(){return Promise.resolve().then(()=>this.queryManager.clearStore({discardWatches:!0})).then(()=>Promise.all(this.clearStoreCallbacks.map(e=>e())))}onResetStore(e){return this.resetStoreCallbacks.push(e),()=>{this.resetStoreCallbacks=this.resetStoreCallbacks.filter(t=>t!==e)}}onClearStore(e){return this.clearStoreCallbacks.push(e),()=>{this.clearStoreCallbacks=this.clearStoreCallbacks.filter(t=>t!==e)}}reFetchObservableQueries;refetchObservableQueries(e){return this.queryManager.refetchObservableQueries(e)}refetchQueries(e){const t=this.queryManager.refetchQueries(e),i=[],o=[];t.forEach((s,l)=>{i.push(l),o.push(s)});const r=Promise.all(o);return r.queries=i,r.results=o,r.catch(s=>{}),r}getObservableQueries(e="active"){return this.queryManager.getObservableQueries(e)}extract(e){return this.cache.extract(e)}restore(e){return this.cache.restore(e)}setLink(e){this.link=e}get defaultContext(){return this.queryManager.defaultContext}maskedFragmentTransform=new md(TAe);transform(e,t=!1){const i=this.queryManager.transform(e);return t?this.maskedFragmentTransform.transformDocument(i):i}}function KAe(n,e){if(!n)throw new Error(e??"Unexpected invariant triggered.")}const qAe=/\r\n|[\n\r]/g;function Zw(n,e){let t=0,i=1;for(const o of n.body.matchAll(qAe)){if("number"==typeof o.index||KAe(!1),o.index>=e)break;t=o.index+o[0].length,i+=1}return{line:i,column:e+1-t}}function XAe(n){return $U(n.source,Zw(n.source,n.start))}function $U(n,e){const t=n.locationOffset.column-1,i="".padStart(t)+n.body,o=e.line-1,s=e.line+(n.locationOffset.line-1),h=e.column+(1===e.line?t:0),f=`${n.name}:${s}:${h}\n`,m=i.split(/\r\n|[\n\r]/g),b=m[o];if(b.length>120){const A=Math.floor(h/80),T=h%80,U=[];for(let K=0;K<b.length;K+=80)U.push(b.slice(K,K+80));return f+ZU([[`${s} |`,U[0]],...U.slice(1,A+1).map(K=>["|",K]),["|","^".padStart(T)],["|",U[A+1]]])}return f+ZU([[s-1+" |",m[o-1]],[`${s} |`,b],["|","^".padStart(h)],[`${s+1} |`,m[o+1]]])}function ZU(n){const e=n.filter(([i,o])=>void 0!==o),t=Math.max(...e.map(([i])=>i.length));return e.map(([i,o])=>i.padStart(t)+(o?" "+o:"")).join("\n")}class Yw extends Error{constructor(e,...t){var i,o,r;const{nodes:s,source:l,positions:h,path:f,originalError:m,extensions:b}=function QAe(n){const e=n[0];return null==e||"kind"in e||"length"in e?{nodes:e,source:n[1],positions:n[2],path:n[3],originalError:n[4],extensions:n[5]}:e}(t);super(e),this.name="GraphQLError",this.path=f??void 0,this.originalError=m??void 0,this.nodes=YU(Array.isArray(s)?s:s?[s]:void 0);const A=YU(null===(i=this.nodes)||void 0===i?void 0:i.map(U=>U.loc).filter(U=>null!=U));this.source=l??(null==A||null===(o=A[0])||void 0===o?void 0:o.source),this.positions=h??A?.map(U=>U.start),this.locations=h&&l?h.map(U=>Zw(l,U)):A?.map(U=>Zw(U.source,U.start));const T=function YAe(n){return"object"==typeof n&&null!==n}(m?.extensions)?m?.extensions:void 0;this.extensions=null!==(r=b??T)&&void 0!==r?r: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!=m&&m.stack?Object.defineProperty(this,"stack",{value:m.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,Yw):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"+XAe(t.loc));else if(this.source&&this.locations)for(const t of this.locations)e+="\n\n"+$U(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 YU(n){return void 0===n||0===n.length?void 0:n}function cs(n,e,t){return new Yw(`Syntax Error: ${t}`,{source:n,positions:[e]})}var KU=function(n){return n.QUERY="QUERY",n.MUTATION="MUTATION",n.SUBSCRIPTION="SUBSCRIPTION",n.FIELD="FIELD",n.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",n.FRAGMENT_SPREAD="FRAGMENT_SPREAD",n.INLINE_FRAGMENT="INLINE_FRAGMENT",n.VARIABLE_DEFINITION="VARIABLE_DEFINITION",n.SCHEMA="SCHEMA",n.SCALAR="SCALAR",n.OBJECT="OBJECT",n.FIELD_DEFINITION="FIELD_DEFINITION",n.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",n.INTERFACE="INTERFACE",n.UNION="UNION",n.ENUM="ENUM",n.ENUM_VALUE="ENUM_VALUE",n.INPUT_OBJECT="INPUT_OBJECT",n.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION",n.DIRECTIVE_DEFINITION="DIRECTIVE_DEFINITION",n}(KU||{}),kt=function(n){return n.SOF="<SOF>",n.EOF="<EOF>",n.BANG="!",n.DOLLAR="$",n.AMP="&",n.PAREN_L="(",n.PAREN_R=")",n.DOT=".",n.SPREAD="...",n.COLON=":",n.EQUALS="=",n.AT="@",n.BRACKET_L="[",n.BRACKET_R="]",n.BRACE_L="{",n.PIPE="|",n.BRACE_R="}",n.NAME="Name",n.INT="Int",n.FLOAT="Float",n.STRING="String",n.BLOCK_STRING="BlockString",n.COMMENT="Comment",n}(kt||{});class JAe{constructor(e){const t=new sH(kt.SOF,0,0,0,0);this.source=e,this.lastToken=t,this.token=t,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let e=this.token;if(e.kind!==kt.EOF)do{if(e.next)e=e.next;else{const t=tTe(this,e.end);e.next=t,t.prev=e,e=t}}while(e.kind===kt.COMMENT);return e}}function Ff(n){return n>=0&&n<=55295||n>=57344&&n<=1114111}function K7(n,e){return qU(n.charCodeAt(e))&&XU(n.charCodeAt(e+1))}function qU(n){return n>=55296&&n<=56319}function XU(n){return n>=56320&&n<=57343}function v1(n,e){const t=n.source.body.codePointAt(e);if(void 0===t)return kt.EOF;if(t>=32&&t<=126){const i=String.fromCodePoint(t);return'"'===i?"'\"'":`"${i}"`}return"U+"+t.toString(16).toUpperCase().padStart(4,"0")}function Jr(n,e,t,i,o){return new sH(e,t,i,n.line,1+t-n.lineStart,o)}function tTe(n,e){const t=n.source.body,i=t.length;let o=e;for(;o<i;){const r=t.charCodeAt(o);switch(r){case 65279:case 9:case 32:case 44:++o;continue;case 10:++o,++n.line,n.lineStart=o;continue;case 13:10===t.charCodeAt(o+1)?o+=2:++o,++n.line,n.lineStart=o;continue;case 35:return nTe(n,o);case 33:return Jr(n,kt.BANG,o,o+1);case 36:return Jr(n,kt.DOLLAR,o,o+1);case 38:return Jr(n,kt.AMP,o,o+1);case 40:return Jr(n,kt.PAREN_L,o,o+1);case 41:return Jr(n,kt.PAREN_R,o,o+1);case 46:if(46===t.charCodeAt(o+1)&&46===t.charCodeAt(o+2))return Jr(n,kt.SPREAD,o,o+3);break;case 58:return Jr(n,kt.COLON,o,o+1);case 61:return Jr(n,kt.EQUALS,o,o+1);case 64:return Jr(n,kt.AT,o,o+1);case 91:return Jr(n,kt.BRACKET_L,o,o+1);case 93:return Jr(n,kt.BRACKET_R,o,o+1);case 123:return Jr(n,kt.BRACE_L,o,o+1);case 124:return Jr(n,kt.PIPE,o,o+1);case 125:return Jr(n,kt.BRACE_R,o,o+1);case 34:return 34===t.charCodeAt(o+1)&&34===t.charCodeAt(o+2)?lTe(n,o):oTe(n,o)}if(M5(r)||45===r)return iTe(n,o,r);if($H(r))return cTe(n,o);throw cs(n.source,o,39===r?"Unexpected single quote character ('), did you mean to use a double quote (\")?":Ff(r)||K7(t,o)?`Unexpected character: ${v1(n,o)}.`:`Invalid character: ${v1(n,o)}.`)}return Jr(n,kt.EOF,i,i)}function nTe(n,e){const t=n.source.body,i=t.length;let o=e+1;for(;o<i;){const r=t.charCodeAt(o);if(10===r||13===r)break;if(Ff(r))++o;else{if(!K7(t,o))break;o+=2}}return Jr(n,kt.COMMENT,e,o,t.slice(e+1,o))}function iTe(n,e,t){const i=n.source.body;let o=e,r=t,s=!1;if(45===r&&(r=i.charCodeAt(++o)),48===r){if(r=i.charCodeAt(++o),M5(r))throw cs(n.source,o,`Invalid number, unexpected digit after 0: ${v1(n,o)}.`)}else o=Kw(n,o,r),r=i.charCodeAt(o);if(46===r&&(s=!0,r=i.charCodeAt(++o),o=Kw(n,o,r),r=i.charCodeAt(o)),(69===r||101===r)&&(s=!0,r=i.charCodeAt(++o),(43===r||45===r)&&(r=i.charCodeAt(++o)),o=Kw(n,o,r),r=i.charCodeAt(o)),46===r||$H(r))throw cs(n.source,o,`Invalid number, expected digit but got: ${v1(n,o)}.`);return Jr(n,s?kt.FLOAT:kt.INT,e,o,i.slice(e,o))}function Kw(n,e,t){if(!M5(t))throw cs(n.source,e,`Invalid number, expected digit but got: ${v1(n,e)}.`);const i=n.source.body;let o=e+1;for(;M5(i.charCodeAt(o));)++o;return o}function oTe(n,e){const t=n.source.body,i=t.length;let o=e+1,r=o,s="";for(;o<i;){const l=t.charCodeAt(o);if(34===l)return s+=t.slice(r,o),Jr(n,kt.STRING,e,o+1,s);if(92===l){s+=t.slice(r,o);const h=117===t.charCodeAt(o+1)?123===t.charCodeAt(o+2)?rTe(n,o):sTe(n,o):aTe(n,o);s+=h.value,o+=h.size,r=o;continue}if(10===l||13===l)break;if(Ff(l))++o;else{if(!K7(t,o))throw cs(n.source,o,`Invalid character within String: ${v1(n,o)}.`);o+=2}}throw cs(n.source,o,"Unterminated string.")}function rTe(n,e){const t=n.source.body;let i=0,o=3;for(;o<12;){const r=t.charCodeAt(e+o++);if(125===r){if(o<5||!Ff(i))break;return{value:String.fromCodePoint(i),size:o}}if(i=i<<4|Y5(r),i<0)break}throw cs(n.source,e,`Invalid Unicode escape sequence: "${t.slice(e,e+o)}".`)}function sTe(n,e){const t=n.source.body,i=QU(t,e+2);if(Ff(i))return{value:String.fromCodePoint(i),size:6};if(qU(i)&&92===t.charCodeAt(e+6)&&117===t.charCodeAt(e+7)){const o=QU(t,e+8);if(XU(o))return{value:String.fromCodePoint(i,o),size:12}}throw cs(n.source,e,`Invalid Unicode escape sequence: "${t.slice(e,e+6)}".`)}function QU(n,e){return Y5(n.charCodeAt(e))<<12|Y5(n.charCodeAt(e+1))<<8|Y5(n.charCodeAt(e+2))<<4|Y5(n.charCodeAt(e+3))}function Y5(n){return n>=48&&n<=57?n-48:n>=65&&n<=70?n-55:n>=97&&n<=102?n-87:-1}function aTe(n,e){const t=n.source.body;switch(t.charCodeAt(e+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 cs(n.source,e,`Invalid character escape sequence: "${t.slice(e,e+2)}".`)}function lTe(n,e){const t=n.source.body,i=t.length;let o=n.lineStart,r=e+3,s=r,l="";const h=[];for(;r<i;){const f=t.charCodeAt(r);if(34===f&&34===t.charCodeAt(r+1)&&34===t.charCodeAt(r+2)){l+=t.slice(s,r),h.push(l);const m=Jr(n,kt.BLOCK_STRING,e,r+3,ywe(h).join("\n"));return n.line+=h.length-1,n.lineStart=o,m}if(92!==f||34!==t.charCodeAt(r+1)||34!==t.charCodeAt(r+2)||34!==t.charCodeAt(r+3))if(10!==f&&13!==f)if(Ff(f))++r;else{if(!K7(t,r))throw cs(n.source,r,`Invalid character within String: ${v1(n,r)}.`);r+=2}else l+=t.slice(s,r),h.push(l),13===f&&10===t.charCodeAt(r+1)?r+=2:++r,l="",s=r,o=r;else l+=t.slice(s,r),s=r+1,r+=4}throw cs(n.source,r,"Unterminated string.")}function cTe(n,e){const t=n.source.body,i=t.length;let o=e+1;for(;o<i&&Cwe(t.charCodeAt(o));)++o;return Jr(n,kt.NAME,e,o,t.slice(e,o))}const uTe=globalThis.process?function(e,t){return e instanceof t}:function(e,t){if(e instanceof t)return!0;if("object"==typeof e&&null!==e){var i;const o=t.prototype[Symbol.toStringTag];if(o===(Symbol.toStringTag in e?e[Symbol.toStringTag]:null===(i=e.constructor)||void 0===i?void 0:i.name)){const s=Wy(e);throw new Error(`Cannot use ${o} "${s}" 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 JU{constructor(e,t="GraphQL request",i={line:1,column:1}){"string"==typeof e||N7(!1,`Body must be a string. Received: ${Wy(e)}.`),this.body=e,this.name=t,this.locationOffset=i,this.locationOffset.line>0||N7(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||N7(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}class K5{constructor(e,t={}){const{lexer:i,...o}=t;if(i)this._lexer=i;else{const r=function dTe(n){return uTe(n,JU)}(e)?e:new JU(e);this._lexer=new JAe(r)}this._options=o,this._tokenCounter=0}get tokenCount(){return this._tokenCounter}parseName(){const e=this.expectToken(kt.NAME);return this.node(e,{kind:_n.NAME,value:e.value})}parseDocument(){return this.node(this._lexer.token,{kind:_n.DOCUMENT,definitions:this.many(kt.SOF,this.parseDefinition,kt.EOF)})}parseDefinition(){if(this.peek(kt.BRACE_L))return this.parseOperationDefinition();const e=this.peekDescription(),t=e?this._lexer.lookahead():this._lexer.token;if(e&&t.kind===kt.BRACE_L)throw cs(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are not supported on shorthand queries.");if(t.kind===kt.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()}switch(t.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition()}if(e)throw cs(this._lexer.source,this._lexer.token.start,"Unexpected description, only GraphQL definitions support descriptions.");if("extend"===t.value)return this.parseTypeSystemExtension()}throw this.unexpected(t)}parseOperationDefinition(){const e=this._lexer.token;if(this.peek(kt.BRACE_L))return this.node(e,{kind:_n.OPERATION_DEFINITION,operation:_u.QUERY,description:void 0,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});const t=this.parseDescription(),i=this.parseOperationType();let o;return this.peek(kt.NAME)&&(o=this.parseName()),this.node(e,{kind:_n.OPERATION_DEFINITION,operation:i,description:t,name:o,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const e=this.expectToken(kt.NAME);switch(e.value){case"query":return _u.QUERY;case"mutation":return _u.MUTATION;case"subscription":return _u.SUBSCRIPTION}throw this.unexpected(e)}parseVariableDefinitions(){return this.optionalMany(kt.PAREN_L,this.parseVariableDefinition,kt.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:_n.VARIABLE_DEFINITION,description:this.parseDescription(),variable:this.parseVariable(),type:(this.expectToken(kt.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(kt.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const e=this._lexer.token;return this.expectToken(kt.DOLLAR),this.node(e,{kind:_n.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:_n.SELECTION_SET,selections:this.many(kt.BRACE_L,this.parseSelection,kt.BRACE_R)})}parseSelection(){return this.peek(kt.SPREAD)?this.parseFragment():this.parseField()}parseField(){const e=this._lexer.token,t=this.parseName();let i,o;return this.expectOptionalToken(kt.COLON)?(i=t,o=this.parseName()):o=t,this.node(e,{kind:_n.FIELD,alias:i,name:o,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(kt.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(e){return this.optionalMany(kt.PAREN_L,e?this.parseConstArgument:this.parseArgument,kt.PAREN_R)}parseArgument(e=!1){const t=this._lexer.token,i=this.parseName();return this.expectToken(kt.COLON),this.node(t,{kind:_n.ARGUMENT,name:i,value:this.parseValueLiteral(e)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){const e=this._lexer.token;this.expectToken(kt.SPREAD);const t=this.expectOptionalKeyword("on");return!t&&this.peek(kt.NAME)?this.node(e,{kind:_n.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(e,{kind:_n.INLINE_FRAGMENT,typeCondition:t?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){const e=this._lexer.token,t=this.parseDescription();return this.expectKeyword("fragment"),this.node(e,!0===this._options.allowLegacyFragmentVariables?{kind:_n.FRAGMENT_DEFINITION,description:t,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}:{kind:_n.FRAGMENT_DEFINITION,description:t,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 kt.BRACKET_L:return this.parseList(e);case kt.BRACE_L:return this.parseObject(e);case kt.INT:return this.advanceLexer(),this.node(t,{kind:_n.INT,value:t.value});case kt.FLOAT:return this.advanceLexer(),this.node(t,{kind:_n.FLOAT,value:t.value});case kt.STRING:case kt.BLOCK_STRING:return this.parseStringLiteral();case kt.NAME:switch(this.advanceLexer(),t.value){case"true":return this.node(t,{kind:_n.BOOLEAN,value:!0});case"false":return this.node(t,{kind:_n.BOOLEAN,value:!1});case"null":return this.node(t,{kind:_n.NULL});default:return this.node(t,{kind:_n.ENUM,value:t.value})}case kt.DOLLAR:if(e){if(this.expectToken(kt.DOLLAR),this._lexer.token.kind===kt.NAME)throw cs(this._lexer.source,t.start,`Unexpected variable "$${this._lexer.token.value}" 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:_n.STRING,value:e.value,block:e.kind===kt.BLOCK_STRING})}parseList(e){return this.node(this._lexer.token,{kind:_n.LIST,values:this.any(kt.BRACKET_L,()=>this.parseValueLiteral(e),kt.BRACKET_R)})}parseObject(e){return this.node(this._lexer.token,{kind:_n.OBJECT,fields:this.any(kt.BRACE_L,()=>this.parseObjectField(e),kt.BRACE_R)})}parseObjectField(e){const t=this._lexer.token,i=this.parseName();return this.expectToken(kt.COLON),this.node(t,{kind:_n.OBJECT_FIELD,name:i,value:this.parseValueLiteral(e)})}parseDirectives(e){const t=[];for(;this.peek(kt.AT);)t.push(this.parseDirective(e));return t}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(e){const t=this._lexer.token;return this.expectToken(kt.AT),this.node(t,{kind:_n.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e)})}parseTypeReference(){const e=this._lexer.token;let t;if(this.expectOptionalToken(kt.BRACKET_L)){const i=this.parseTypeReference();this.expectToken(kt.BRACKET_R),t=this.node(e,{kind:_n.LIST_TYPE,type:i})}else t=this.parseNamedType();return this.expectOptionalToken(kt.BANG)?this.node(e,{kind:_n.NON_NULL_TYPE,type:t}):t}parseNamedType(){return this.node(this._lexer.token,{kind:_n.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(kt.STRING)||this.peek(kt.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("schema");const i=this.parseConstDirectives(),o=this.many(kt.BRACE_L,this.parseOperationTypeDefinition,kt.BRACE_R);return this.node(e,{kind:_n.SCHEMA_DEFINITION,description:t,directives:i,operationTypes:o})}parseOperationTypeDefinition(){const e=this._lexer.token,t=this.parseOperationType();this.expectToken(kt.COLON);const i=this.parseNamedType();return this.node(e,{kind:_n.OPERATION_TYPE_DEFINITION,operation:t,type:i})}parseScalarTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("scalar");const i=this.parseName(),o=this.parseConstDirectives();return this.node(e,{kind:_n.SCALAR_TYPE_DEFINITION,description:t,name:i,directives:o})}parseObjectTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("type");const i=this.parseName(),o=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),s=this.parseFieldsDefinition();return this.node(e,{kind:_n.OBJECT_TYPE_DEFINITION,description:t,name:i,interfaces:o,directives:r,fields:s})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(kt.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(kt.BRACE_L,this.parseFieldDefinition,kt.BRACE_R)}parseFieldDefinition(){const e=this._lexer.token,t=this.parseDescription(),i=this.parseName(),o=this.parseArgumentDefs();this.expectToken(kt.COLON);const r=this.parseTypeReference(),s=this.parseConstDirectives();return this.node(e,{kind:_n.FIELD_DEFINITION,description:t,name:i,arguments:o,type:r,directives:s})}parseArgumentDefs(){return this.optionalMany(kt.PAREN_L,this.parseInputValueDef,kt.PAREN_R)}parseInputValueDef(){const e=this._lexer.token,t=this.parseDescription(),i=this.parseName();this.expectToken(kt.COLON);const o=this.parseTypeReference();let r;this.expectOptionalToken(kt.EQUALS)&&(r=this.parseConstValueLiteral());const s=this.parseConstDirectives();return this.node(e,{kind:_n.INPUT_VALUE_DEFINITION,description:t,name:i,type:o,defaultValue:r,directives:s})}parseInterfaceTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("interface");const i=this.parseName(),o=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),s=this.parseFieldsDefinition();return this.node(e,{kind:_n.INTERFACE_TYPE_DEFINITION,description:t,name:i,interfaces:o,directives:r,fields:s})}parseUnionTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("union");const i=this.parseName(),o=this.parseConstDirectives(),r=this.parseUnionMemberTypes();return this.node(e,{kind:_n.UNION_TYPE_DEFINITION,description:t,name:i,directives:o,types:r})}parseUnionMemberTypes(){return this.expectOptionalToken(kt.EQUALS)?this.delimitedMany(kt.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("enum");const i=this.parseName(),o=this.parseConstDirectives(),r=this.parseEnumValuesDefinition();return this.node(e,{kind:_n.ENUM_TYPE_DEFINITION,description:t,name:i,directives:o,values:r})}parseEnumValuesDefinition(){return this.optionalMany(kt.BRACE_L,this.parseEnumValueDefinition,kt.BRACE_R)}parseEnumValueDefinition(){const e=this._lexer.token,t=this.parseDescription(),i=this.parseEnumValueName(),o=this.parseConstDirectives();return this.node(e,{kind:_n.ENUM_VALUE_DEFINITION,description:t,name:i,directives:o})}parseEnumValueName(){if("true"===this._lexer.token.value||"false"===this._lexer.token.value||"null"===this._lexer.token.value)throw cs(this._lexer.source,this._lexer.token.start,`${q7(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 i=this.parseName(),o=this.parseConstDirectives(),r=this.parseInputFieldsDefinition();return this.node(e,{kind:_n.INPUT_OBJECT_TYPE_DEFINITION,description:t,name:i,directives:o,fields:r})}parseInputFieldsDefinition(){return this.optionalMany(kt.BRACE_L,this.parseInputValueDef,kt.BRACE_R)}parseTypeSystemExtension(){const e=this._lexer.lookahead();if(e.kind===kt.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();case"directive":if(this._options.experimentalDirectivesOnDirectiveDefinitions)return this.parseDirectiveDefinitionExtension()}throw this.unexpected(e)}parseSchemaExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");const t=this.parseConstDirectives(),i=this.optionalMany(kt.BRACE_L,this.parseOperationTypeDefinition,kt.BRACE_R);if(0===t.length&&0===i.length)throw this.unexpected();return this.node(e,{kind:_n.SCHEMA_EXTENSION,directives:t,operationTypes:i})}parseScalarTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");const t=this.parseName(),i=this.parseConstDirectives();if(0===i.length)throw this.unexpected();return this.node(e,{kind:_n.SCALAR_TYPE_EXTENSION,name:t,directives:i})}parseObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");const t=this.parseName(),i=this.parseImplementsInterfaces(),o=this.parseConstDirectives(),r=this.parseFieldsDefinition();if(0===i.length&&0===o.length&&0===r.length)throw this.unexpected();return this.node(e,{kind:_n.OBJECT_TYPE_EXTENSION,name:t,interfaces:i,directives:o,fields:r})}parseInterfaceTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const t=this.parseName(),i=this.parseImplementsInterfaces(),o=this.parseConstDirectives(),r=this.parseFieldsDefinition();if(0===i.length&&0===o.length&&0===r.length)throw this.unexpected();return this.node(e,{kind:_n.INTERFACE_TYPE_EXTENSION,name:t,interfaces:i,directives:o,fields:r})}parseUnionTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const t=this.parseName(),i=this.parseConstDirectives(),o=this.parseUnionMemberTypes();if(0===i.length&&0===o.length)throw this.unexpected();return this.node(e,{kind:_n.UNION_TYPE_EXTENSION,name:t,directives:i,types:o})}parseEnumTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const t=this.parseName(),i=this.parseConstDirectives(),o=this.parseEnumValuesDefinition();if(0===i.length&&0===o.length)throw this.unexpected();return this.node(e,{kind:_n.ENUM_TYPE_EXTENSION,name:t,directives:i,values:o})}parseInputObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const t=this.parseName(),i=this.parseConstDirectives(),o=this.parseInputFieldsDefinition();if(0===i.length&&0===o.length)throw this.unexpected();return this.node(e,{kind:_n.INPUT_OBJECT_TYPE_EXTENSION,name:t,directives:i,fields:o})}parseDirectiveDefinitionExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("directive"),this.expectToken(kt.AT);const t=this.parseName(),i=this.parseConstDirectives();if(0===i.length)throw this.unexpected();return this.node(e,{kind:_n.DIRECTIVE_EXTENSION,name:t,directives:i})}parseDirectiveDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("directive"),this.expectToken(kt.AT);const i=this.parseName(),o=this.parseArgumentDefs(),r=this._options.experimentalDirectivesOnDirectiveDefinitions?this.parseConstDirectives():[],s=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const l=this.parseDirectiveLocations();return this.node(e,{kind:_n.DIRECTIVE_DEFINITION,description:t,name:i,arguments:o,directives:r,repeatable:s,locations:l})}parseDirectiveLocations(){return this.delimitedMany(kt.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){const e=this._lexer.token,t=this.parseName();if(Object.prototype.hasOwnProperty.call(KU,t.value))return t;throw this.unexpected(e)}parseSchemaCoordinate(){const e=this._lexer.token,t=this.expectOptionalToken(kt.AT),i=this.parseName();let o,r;return!t&&this.expectOptionalToken(kt.DOT)&&(o=this.parseName()),(t||o)&&this.expectOptionalToken(kt.PAREN_L)&&(r=this.parseName(),this.expectToken(kt.COLON),this.expectToken(kt.PAREN_R)),this.node(e,t?r?{kind:_n.DIRECTIVE_ARGUMENT_COORDINATE,name:i,argumentName:r}:{kind:_n.DIRECTIVE_COORDINATE,name:i}:o?r?{kind:_n.ARGUMENT_COORDINATE,name:i,fieldName:o,argumentName:r}:{kind:_n.MEMBER_COORDINATE,name:i,memberName:o}:{kind:_n.TYPE_COORDINATE,name:i})}node(e,t){return!0!==this._options.noLocation&&(t.loc=new kye(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 cs(this._lexer.source,t.start,`Expected ${ez(e)}, found ${q7(t)}.`)}expectOptionalToken(e){return this._lexer.token.kind===e&&(this.advanceLexer(),!0)}expectKeyword(e){const t=this._lexer.token;if(t.kind!==kt.NAME||t.value!==e)throw cs(this._lexer.source,t.start,`Expected "${e}", found ${q7(t)}.`);this.advanceLexer()}expectOptionalKeyword(e){const t=this._lexer.token;return t.kind===kt.NAME&&t.value===e&&(this.advanceLexer(),!0)}unexpected(e){const t=e??this._lexer.token;return cs(this._lexer.source,t.start,`Unexpected ${q7(t)}.`)}any(e,t,i){this.expectToken(e);const o=[];for(;!this.expectOptionalToken(i);)o.push(t.call(this));return o}optionalMany(e,t,i){if(this.expectOptionalToken(e)){const o=[];do{o.push(t.call(this))}while(!this.expectOptionalToken(i));return o}return[]}many(e,t,i){this.expectToken(e);const o=[];do{o.push(t.call(this))}while(!this.expectOptionalToken(i));return o}delimitedMany(e,t){this.expectOptionalToken(e);const i=[];do{i.push(t.call(this))}while(this.expectOptionalToken(e));return i}advanceLexer(){const{maxTokens:e}=this._options,t=this._lexer.advance();if(t.kind!==kt.EOF&&(++this._tokenCounter,void 0!==e&&this._tokenCounter>e))throw cs(this._lexer.source,t.start,`Document contains more that ${e} tokens. Parsing aborted.`)}}function q7(n){const e=n.value;return ez(n.kind)+(null!=e?` "${e}"`:"")}function ez(n){return function eTe(n){return n===kt.BANG||n===kt.DOLLAR||n===kt.AMP||n===kt.PAREN_L||n===kt.PAREN_R||n===kt.DOT||n===kt.SPREAD||n===kt.COLON||n===kt.EQUALS||n===kt.AT||n===kt.BRACKET_L||n===kt.BRACKET_R||n===kt.BRACE_L||n===kt.PIPE||n===kt.BRACE_R}(n)?`"${n}"`:n}var X7=new Map,qw=new Map,tz=!0,q5=!1;function nz(n){return n.replace(/[\s,]+/g," ").trim()}function bTe(n){var e=nz(n);if(!X7.has(e)){var t=function fTe(n,e){const t=new K5(n,e),i=t.parseDocument();return Object.defineProperty(i,"tokenCount",{enumerable:!1,value:t.tokenCount}),i}(n,{experimentalFragmentVariables:q5,allowLegacyFragmentVariables:q5,experimentalFragmentArguments:q5});if(!t||"Document"!==t.kind)throw new Error("Not a valid GraphQL document.");X7.set(e,function vTe(n){var e=new Set(n.definitions);e.forEach(function(i){i.loc&&delete i.loc,Object.keys(i).forEach(function(o){var r=i[o];r&&"object"==typeof r&&e.add(r)})});var t=n.loc;return t&&(delete t.startToken,delete t.endToken),n}(function mTe(n){var e=new Set,t=[];return n.definitions.forEach(function(i){if("FragmentDefinition"===i.kind){var o=i.name.value,r=function gTe(n){return nz(n.source.body.substring(n.start,n.end))}(i.loc),s=qw.get(o);s&&!s.has(r)?tz&&console.warn("Warning: fragment with name "+o+" already exists.\ngraphql-tag enforces all fragment names across your application to be unique; read more about\nthis in the docs: http://dev.apollodata.com/core/fragments.html#unique-names"):s||qw.set(o,s=new Set),s.add(r),e.has(r)||(e.add(r),t.push(i))}else t.push(i)}),V0(V0({},n),{definitions:t})}(t)))}return X7.get(e)}function Hf(n){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];"string"==typeof n&&(n=[n]);var i=n[0];return e.forEach(function(o,r){i+=o&&"Document"===o.kind?o.loc.source.body:o,i+=n[r+1]}),bTe(i)}var X5_gql=Hf,X5_resetCaches=function CTe(){X7.clear(),qw.clear()},X5_disableFragmentWarnings=function yTe(){tz=!1},X5_enableExperimentalFragmentVariables=function wTe(){q5=!0},X5_disableExperimentalFragmentVariables=function ATe(){q5=!1};(function(n){n.gql=X5_gql,n.resetCaches=X5_resetCaches,n.disableFragmentWarnings=X5_disableFragmentWarnings,n.enableExperimentalFragmentVariables=X5_enableExperimentalFragmentVariables,n.disableExperimentalFragmentVariables=X5_disableExperimentalFragmentVariables})(Hf||(Hf={})),Hf.default=Hf;const STe=new class ITe extends NB{}(class TTe extends DB{constructor(e,t){super(e,t),this.scheduler=e,this.work=t}schedule(e,t=0){return t>0?super.schedule(e,t):(this.delay=t,this.state=e,this.scheduler.flush(this),this)}execute(e,t){return t>0||this.closed?super.execute(e,t):this._execute(e,t)}requestAsyncId(e,t,i=0){return null!=i&&i>0||null==i&&this.delay>0?super.requestAsyncId(e,t,i):(e.flush(this),0)}});function oz(n){return new wn(e=>(n().then(t=>{e.closed||(e.next(t),e.complete())},t=>{e.closed||e.error(t)}),()=>e.unsubscribe()))}class DTe{zone;constructor(e){this.zone=e}now=Date.now;schedule(e,t=0,i){return this.zone.run(()=>STe.schedule(e,t,i))}}function Xw(n,e){return n.pipe(Q9(new DTe(e)))}class NTe{obsQuery;valueChanges;constructor(e,t){this.obsQuery=e,this.valueChanges=Xw(tu(this.obsQuery),t)}get options(){return this.obsQuery.options}get variables(){return this.obsQuery.variables}getCurrentResult(){return this.obsQuery.getCurrentResult()}refetch(e){return this.obsQuery.refetch(e)}fetchMore(e){return this.obsQuery.fetchMore(e)}subscribeToMore(e){return this.obsQuery.subscribeToMore(e)}updateQuery(e){return this.obsQuery.updateQuery(e)}stopPolling(){return this.obsQuery.stopPolling()}startPolling(e){return this.obsQuery.startPolling(e)}setVariables(e){return this.obsQuery.setVariables(e)}reobserve(e){return this.obsQuery.reobserve(e)}}const Qw=new Pt("APOLLO_FLAGS"),rz=new Pt("APOLLO_OPTIONS"),sz=new Pt("APOLLO_NAMED_OPTIONS");class az{ngZone;flags;_client;useMutationLoading;constructor(e,t,i){this.ngZone=e,this.flags=t,this._client=i,this.useMutationLoading=t?.useMutationLoading??!1}watchQuery(e){return new NTe(this.ensureClient().watchQuery({...e}),this.ngZone)}query(e){return oz(()=>this.ensureClient().query({...e}))}mutate(e){return function xTe(n,e){return e?n.pipe(mo(t=>({...t,loading:!1})),function ETe(...n){const e=m3(n);return ia((t,i)=>{(e?j5(n,t,e):j5(n,t)).subscribe(i)})}({data:void 0,loading:!0})):n.pipe(mo(t=>({...t,loading:!1})))}(oz(()=>this.ensureClient().mutate({...e})),e.useMutationLoading??this.useMutationLoading)}watchFragment(e){const{useZone:t,...i}=e,o=this.ensureClient().watchFragment({...i});return!0!==t?o:Xw(o,this.ngZone)}subscribe(e){const{useZone:t,...i}=e,o=this.ensureClient().subscribe({...i});return!0!==t?o:Xw(o,this.ngZone)}get client(){return this.ensureClient()}set client(e){if(this._client)throw new Error("Client has been already defined");this._client=e}ensureClient(){return this.checkInstance(),this._client}checkInstance(){if(this._client)return!0;throw new Error("Client has not been defined yet")}}let Jw=(()=>{class n extends az{map=new Map;constructor(t,i,o,r){if(super(t,r),i&&this.createDefault(i),o&&"object"==typeof o)for(let s in o)o.hasOwnProperty(s)&&this.create(o[s],s)}create(t,i){eA(i)?this.createNamed(i,t):this.createDefault(t)}default(){return this}use(t){return eA(t)?this.map.get(t):this.default()}createDefault(t){if(this._client)throw new Error("Apollo has been already created.");this.client=this.ngZone.runOutsideAngular(()=>new $w(t))}createNamed(t,i){if(this.map.has(t))throw new Error(`Client ${t} has been already created`);this.map.set(t,new az(this.ngZone,this.flags,this.ngZone.runOutsideAngular(()=>new $w(i))))}removeClient(t){eA(t)?this.map.delete(t):this._client=void 0}static \u0275fac=function(i){return new(i||n)(xn(zo),xn(rz,8),xn(sz,8),xn(Qw,8))};static \u0275prov=Bt({token:n,factory:n.\u0275fac})}return n})();function eA(n){return!!n&&"default"!==n}const tA=Hf,Q7=(n,e)=>n&&e?[...n.keys()].reduce((t,i)=>t.set(i,n.get(i)),e):e||n;const nA={batchInterval:10,batchMax:10,uri:"graphql",method:"POST",withCredentials:!1,includeQuery:!0,includeExtensions:!1,useMultipart:!1};function yd(n,e,t){return function J7(...n){return n.find(e=>typeof e<"u")}(n[t],e[t],nA[t])}class RTe extends Ks{httpClient;options;requester;print=P7;constructor(e,t){super(),this.httpClient=e,this.options=t,this.options.operationPrinter&&(this.print=this.options.operationPrinter),this.requester=i=>new wn(o=>{const r=i.getContext();let s=yd(r,this.options,"method");const l=yd(r,this.options,"includeQuery"),h=yd(r,this.options,"includeExtensions"),f=yd(r,this.options,"uri"),m=yd(r,this.options,"withCredentials"),b=yd(r,this.options,"useMultipart"),A=!0===this.options.useGETForQueries,T=Q7(r.httpContext,Q7(this.options.httpContext,new sy)),U=i.query.definitions.some(Me=>"OperationDefinition"===Me.kind&&"query"===Me.operation);A&&U&&(s="GET");const K={method:s,url:"function"==typeof f?f(i):f,body:{operationName:i.operationName,variables:i.variables},options:{withCredentials:m,useMultipart:b,headers:this.options.headers,context:T}};h&&(K.body.extensions=i.extensions),l&&(K.body.query=this.print(i.query));const ne=function uz(n){let e=n.headers&&n.headers instanceof Ys?n.headers:new Ys(n.headers);if(n.clientAwareness){const{name:t,version:i}=n.clientAwareness;t&&!e.has("apollographql-client-name")&&(e=e.set("apollographql-client-name",t)),i&&!e.has("apollographql-client-version")&&(e=e.set("apollographql-client-version",i))}return e}(r);K.options.headers=((n,e)=>n&&e?e.keys().reduce((i,o)=>i.set(o,e.getAll(o)),n):e||n)(K.options.headers,ne);const ge=((n,e,t)=>{const i=-1!==["POST","PUT","PATCH"].indexOf(n.method.toUpperCase()),r=n.body.length;let l,s=n.options&&n.options.useMultipart;if(s){if(r)return new wn(f=>f.error(new Error("File upload is not available when combined with Batching")));if(!i)return new wn(f=>f.error(new Error("File upload is not available when GET is used")));if(!t)return new wn(f=>f.error(new Error('To use File upload you need to pass "extractFiles" function from "extract-files" library to HttpLink\'s options')));l=t(n.body),s=!!l.files.size}let h={};if(r){if(!i)return new wn(f=>f.error(new Error("Batching is not available for GET requests")));h={body:n.body}}else h=i?{body:s?l.clone:n.body}:{params:Object.keys(n.body).reduce((b,A)=>{const T=n.body[A];return b[A]=-1!==["variables","extensions"].indexOf(A.toLowerCase())?JSON.stringify(T):T,b},{})};if(s&&i){const f=new FormData;f.append("operations",JSON.stringify(h.body));const m={},b=l.files;let A=0;b.forEach(T=>{m[++A]=T}),f.append("map",JSON.stringify(m)),A=0,b.forEach((T,U)=>{f.append(++A+"",U,U.name)}),h.body=f}return e.request(n.method,n.url,{observe:"response",responseType:"json",reportProgress:!1,...h,...n.options})})(K,this.httpClient,this.options.extractFiles).subscribe({next:Me=>{i.setContext({response:Me}),o.next(Me.body)},error:Me=>o.error(Me),complete:()=>o.complete()});return()=>{ge.closed||ge.unsubscribe()}})}request(e){return this.requester(e)}}let kTe=(()=>{class n{httpClient;constructor(t){this.httpClient=t}create(t){return new RTe(this.httpClient,t)}static \u0275fac=function(i){return new(i||n)(xn(ud))};static \u0275prov=Bt({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();function dz(n,e){this.v=n,this.k=e}function iA(n){return new dz(n,0)}function oA(n){return function(){return new Q5(n.apply(this,arguments))}}function Q5(n){var e,t;function i(r,s){try{var l=n[r](s),h=l.value,f=h instanceof dz;Promise.resolve(f?h.v:h).then(function(m){if(f){var b="return"===r&&h.k?r:"next";if(!h.k||m.done)return i(b,m);m=n[b](m).value}o(!!l.done,m)},function(m){i("throw",m)})}catch(m){o(2,m)}}function o(r,s){2===r?e.reject(s):e.resolve({value:s,done:r}),(e=e.next)?i(e.key,e.arg):t=null}this._invoke=function(r,s){return new Promise(function(l,h){var f={key:r,arg:s,resolve:l,reject:h,next:null};t?t=t.next=f:(e=t=f,i(r,s))})},"function"!=typeof n.return&&(this.return=void 0)}function rA(n){var e,t,i,o=2;for(typeof Symbol<"u"&&(t=Symbol.asyncIterator,i=Symbol.iterator);o--;){if(t&&null!=(e=n[t]))return e.call(n);if(i&&null!=(e=n[i]))return new e8(e.call(n));t="@@asyncIterator",i="@@iterator"}throw new TypeError("Object is not async iterable")}function e8(n){function e(t){if(Object(t)!==t)return Promise.reject(new TypeError(t+" is not an object."));var i=t.done;return Promise.resolve(t.value).then(function(o){return{value:o,done:i}})}return(e8=function(i){this.s=i,this.n=i.next}).prototype={s:null,n:null,next:function(){return e(this.n.apply(this.s,arguments))},return:function(i){var o=this.s.return;return void 0===o?Promise.resolve({value:i,done:!0}):e(o.apply(this.s,arguments))},throw:function(i){var o=this.s.return;return void 0===o?Promise.reject(i):e(o.apply(this.s,arguments))}},new e8(n)}function PTe(n){if("next"!==n&&"complete"!==n)throw new Error(`Invalid stream event "${n}"`);return n}function FTe(n,e){if(e)try{e=JSON.parse(e)}catch{throw new Error("Invalid stream data")}if("next"===n&&!e)throw new Error('Stream data must be an object for "next" events');return e||null}Q5.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},Q5.prototype.next=function(n){return this._invoke("next",n)},Q5.prototype.throw=function(n){return this._invoke("throw",n)},Q5.prototype.return=function(n){return this._invoke("return",n)};var Uf=function(n){return n[n.NewLine=10]="NewLine",n[n.CarriageReturn=13]="CarriageReturn",n[n.Space=32]="Space",n[n.Colon=58]="Colon",n}(Uf||{});class ql extends Error{constructor(e){let t,i;!function VTe(n){return function UTe(n){return"object"==typeof n&&null!==n}(n)&&"boolean"==typeof n.ok&&"number"==typeof n.status&&"string"==typeof n.statusText}(e)?t=e instanceof Error?e.message:String(e):(i=e,t="Server responded with "+e.status+": "+e.statusText),super(t),this.name=this.constructor.name,this.response=i}}function hz(n){return sA.apply(this,arguments)}function sA(){return sA=(0,M.A)(function*(n){const{signal:e,url:t,credentials:i,headers:o,body:r,referrer:s,referrerPolicy:l,fetchFn:h,onMessage:f}=n,m={},b={};let A;try{A=yield h(t,{signal:e,method:r?"POST":"GET",credentials:i,referrer:s,referrerPolicy:l,headers:{...o,accept:"text/event-stream"},body:r})}catch(K){throw new ql(K)}if(!A.ok)throw new ql(A);if(!A.body)throw new Error("Missing response body");let U,T=null;return(0,M.A)(function*(){var K;try{const Zt=function HTe(){let n,e,t,i=!1,o={event:"",data:""},r=[];const s=new TextDecoder;return function(h){if(void 0===n)n=h,e=0,t=-1;else{const b=new Uint8Array(n.length+h.length);b.set(n),b.set(h,n.length),n=b}const f=n.length;let m=0;for(;e<f;){i&&(n[e]===Uf.NewLine&&(m=++e),i=!1);let b=-1;for(;e<f&&-1===b;++e)switch(n[e]){case Uf.Colon:-1===t&&(t=e-m);break;case Uf.CarriageReturn:i=!0;case Uf.NewLine:b=e}if(-1===b)break;if(m===b){if(o.event||o.data){if(!o.event)throw new Error("Missing message event");const A=PTe(o.event),T=FTe(A,o.data);r.push({event:A,data:T}),o={event:"",data:""}}}else if(t>0){const A=n.subarray(m,b),T=s.decode(A.subarray(0,t)),K=s.decode(A.subarray(t+(A[t+1]===Uf.Space?2:1)));switch(T){case"event":o.event=K;break;case"data":o.data=o.data?o.data+"\n"+K:K}}m=e,t=-1}if(m===f){n=void 0;const b=[...r];return r=[],b}0!==m&&(n=n.subarray(m),e-=m)}}();var Me,ne=!1,ge=!1;try{for(var Nt,Ct=rA(function jTe(n){return"function"==typeof Object(n)[Symbol.asyncIterator]?n:oA(function*(){const e=n.getReader();let t;do{t=yield iA(e.read()),void 0!==t.value&&(yield t.value)}while(!t.done)})()}(A.body));ne=!(Nt=yield Ct.next()).done;ne=!1){const Wn=Nt.value;{if("string"==typeof Wn)throw T=new Error(`Unexpected string chunk "${Wn}"`);let Ri;try{Ri=Zt(Wn)}catch(ci){throw T=ci}if(!Ri)continue;for(const ci of Ri){try{f?.(ci)}catch(ki){throw T=ki}const Yi=ci.data&&"id"in ci.data?ci.data.id:"";switch(Yi in b||(b[Yi]=[]),ci.event){case"next":b[Yi].push(Yi?ci.data.payload:ci.data);break;case"complete":b[Yi].push("complete");break;default:throw T=new Error(`Unexpected message event "${ci.event}"`)}null===(K=m[Yi])||void 0===K||K.proceed()}}}}catch(Wn){ge=!0,Me=Wn}finally{try{ne&&null!=Ct.return&&(yield Ct.return())}finally{if(ge)throw Me}}if(Object.keys(m).length)throw new Error("Connection closed while having active streams")}catch(Zt){T=!T&&Object.keys(m).length?new ql(Zt):Zt,U?.(T)}finally{Object.values(m).forEach(({proceed:Zt})=>Zt())}})(),{url:t,headers:o,waitForThrow:()=>new Promise((K,ne)=>{if(T)return ne(T);U=ne}),getResults:K=>oA(function*(){var ne;const{signal:ge,operationId:Me=""}=K??{};try{for(;;){for(;null!==(ne=b[Me])&&void 0!==ne&&ne.length;){const Ct=b[Me].shift();if("complete"===Ct)return;yield Ct}if(T)throw T;if(ge?.aborted)throw new Error("Getting results aborted by the client");yield iA(new Promise(Ct=>{const Nt=()=>{ge?.removeEventListener("abort",Nt),delete m[Me],Ct()};ge?.addEventListener("abort",Nt),m[Me]={proceed:Nt}}))}}finally{delete b[Me]}})()}}),sA.apply(this,arguments)}class GTe extends Ks{constructor(e){super(),this.client=function zTe(n){const{singleConnection:e=!1,lazy:t=!0,lazyCloseTimeout:i=0,onNonLazyError:o=console.error,generateID:r=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,Yi=>{const ki=16*Math.random()|0;return("x"==Yi?ki:3&ki|8).toString(16)})},retryAttempts:s=5,retry:l=function(){var ci=(0,M.A)(function*(ki){let Ji=1e3;for(let ks=0;ks<ki;ks++)Ji*=2;yield new Promise(ks=>setTimeout(ks,Ji+Math.floor(2700*Math.random()+300)))});return function Yi(ki){return ci.apply(this,arguments)}}(),credentials:h="same-origin",referrer:f,referrerPolicy:m,onMessage:b,on:A}=n,T=n.fetchFn||fetch,U=n.abortControllerImpl||AbortController,K=(()=>{let ci=!1;const Yi=[];return{get disposed(){return ci},onDispose:ki=>ci?(setTimeout(()=>ki(),0),()=>{}):(Yi.push(ki),()=>{Yi.splice(Yi.indexOf(ki),1)}),dispose(){if(!ci){ci=!0;for(const ki of[...Yi])ki()}}}})();let ne,ge,Me=0,Ct=null,Nt=0;function Zt(){return Wn.apply(this,arguments)}function Wn(){return(Wn=(0,M.A)(function*(){try{if(K.disposed)throw new Error("Client has been disposed");return yield ge??(ge=(0,M.A)(function*(){var ci,Yi,ki;if(Ct){if(yield l(Nt),ne.signal.aborted)throw new Error("Connection aborted by the client");Nt++}null===(ci=A?.connecting)||void 0===ci||ci.call(A,!!Ct),ne=new U;const Ji=K.onDispose(()=>ne.abort());ne.signal.addEventListener("abort",()=>{Ji(),ge=void 0});const ks=n,Lr="function"==typeof ks.url?yield ks.url(void 0):ks.url;if(ne.signal.aborted)throw new Error("Connection aborted by the client");const es="function"==typeof ks.headers?yield ks.headers(void 0):null!==(Yi=ks.headers)&&void 0!==Yi?Yi:{};if(ne.signal.aborted)throw new Error("Connection aborted by the client");let us;try{us=yield T(Lr,{signal:ne.signal,method:"PUT",credentials:h,referrer:f,referrerPolicy:m,headers:es})}catch(Xl){throw new ql(Xl)}if(201!==us.status)throw new ql(us);const mu=yield us.text();es["x-graphql-event-stream-token"]=mu;const Ad=yield hz({signal:ne.signal,headers:es,credentials:h,referrer:f,referrerPolicy:m,url:Lr,fetchFn:T,onMessage:Xl=>{var vu;null===(vu=A?.message)||void 0===vu||vu.call(A,Xl),b?.(Xl)}});return null===(ki=A?.connected)||void 0===ki||ki.call(A,!!Ct),Ad.waitForThrow().catch(()=>ge=void 0),Ad})())}catch(ci){throw ge=void 0,ci}})).apply(this,arguments)}function Ri(ci,Yi,ki){if(!e){const Lr=new U,es=K.onDispose(()=>{es(),Lr.abort()});return(0,M.A)(function*(){var us,mu,Ad,Xl,vu;let ya=null,b1=0;for(;;)try{if(ya){if(yield l(b1),Lr.signal.aborted)throw new Error("Connection aborted by the client");b1++}null===(us=A?.connecting)||void 0===us||us.call(A,!!ya),null===(mu=ki?.connecting)||void 0===mu||mu.call(ki,!!ya);const Cl=n,nDe="function"==typeof Cl.url?yield Cl.url(ci):Cl.url;if(Lr.signal.aborted)throw new Error("Connection aborted by the client");const iDe="function"==typeof Cl.headers?yield Cl.headers(ci):null!==(Ad=Cl.headers)&&void 0!==Ad?Ad:{};if(Lr.signal.aborted)throw new Error("Connection aborted by the client");const{getResults:oDe}=yield hz({signal:Lr.signal,headers:{...iDe,"content-type":"application/json; charset=utf-8"},credentials:h,referrer:f,referrerPolicy:m,url:nDe,body:JSON.stringify(ci),fetchFn:T,onMessage:y1=>{var xA,DA;null===(xA=A?.message)||void 0===xA||xA.call(A,y1),null===(DA=ki?.message)||void 0===DA||DA.call(ki,y1),b?.(y1)}});null===(Xl=A?.connected)||void 0===Xl||Xl.call(A,!!ya),null===(vu=ki?.connected)||void 0===vu||vu.call(ki,!!ya);var bu,sm=!1,jf=!1;try{for(var C1,Kh=rA(oDe());sm=!(C1=yield Kh.next()).done;sm=!1)ya=null,b1=0,Yi.next(C1.value)}catch(y1){jf=!0,bu=y1}finally{try{sm&&null!=Kh.return&&(yield Kh.return())}finally{if(jf)throw bu}}return Lr.abort()}catch(Cl){if(Lr.signal.aborted)return;if(!(Cl instanceof ql)||!s||b1>=s)throw Cl;ya=Cl}})().then(()=>Yi.complete()).catch(us=>Yi.error(us)),()=>Lr.abort()}Me++;const Ji=new U,ks=K.onDispose(()=>{ks(),Ji.abort()});return(0,M.A)(function*(){const Lr=r();ci={...ci,extensions:{...ci.extensions,operationId:Lr}};let es=null;for(;;){es=null;try{const{url:ya,headers:b1,getResults:sm}=yield Zt();let jf;try{jf=yield T(ya,{signal:Ji.signal,method:"POST",credentials:h,referrer:f,referrerPolicy:m,headers:{...b1,"content-type":"application/json; charset=utf-8"},body:JSON.stringify(ci)})}catch(bu){throw new ql(bu)}if(202!==jf.status)throw new ql(jf);es=function(){var bu=(0,M.A)(function*(){let Kh;try{const C1=new U,Cl=K.onDispose(()=>{Cl(),C1.abort()});Kh=yield T(ya+"?operationId="+Lr,{signal:C1.signal,method:"DELETE",credentials:h,referrer:f,referrerPolicy:m,headers:b1})}catch(C1){throw new ql(C1)}if(200!==Kh.status)throw new ql(Kh)});return function(){return bu.apply(this,arguments)}}();var Ad,us=!1,mu=!1;try{for(var vu,Xl=rA(sm({signal:Ji.signal,operationId:Lr}));us=!(vu=yield Xl.next()).done;us=!1)Ct=null,Nt=0,Yi.next(vu.value)}catch(bu){mu=!0,Ad=bu}finally{try{us&&null!=Xl.return&&(yield Xl.return())}finally{if(mu)throw Ad}}return es=null,Ji.abort()}catch(ya){if(Ji.signal.aborted)return yield es?.();if(!(ya instanceof ql)||(t&&(ge=void 0),!s||Nt>=s))throw Ji.abort(),ya;Ct=ya}finally{Ji.signal.aborted&&0===--Me&&(isFinite(i)&&i>0?setTimeout(()=>{Me||ne.abort()},i):ne.abort())}}})().then(()=>Yi.complete()).catch(Lr=>Yi.error(Lr)),()=>Ji.abort()}return e&&!t&&(0,M.A)(function*(){for(Me++;;)try{const{waitForThrow:ci}=yield Zt();yield ci()}catch(ci){if(K.disposed)return;if(!(ci instanceof ql)||(ge=void 0,!s||Nt>=s))return o?.(ci);Ct=ci}})(),{subscribe:Ri,iterate(ci,Yi){const ki=[],Ji={done:!1,error:null,resolve:()=>{}},ks=Ri(ci,{next(es){ki.push(es),Ji.resolve()},error(es){Ji.done=!0,Ji.error=es,Ji.resolve()},complete(){Ji.done=!0,Ji.resolve()}},Yi),Lr=(es=oA(function*(){for(;;){for(ki.length||(yield iA(new Promise(mu=>Ji.resolve=mu)));ki.length;)yield ki.shift();if(Ji.error)throw Ji.error;if(Ji.done)return}}),function us(){return es.apply(this,arguments)})();var es;return Lr.throw=function(){var es=(0,M.A)(function*(us){return Ji.done||(Ji.done=!0,Ji.error=us,Ji.resolve()),{done:!0,value:void 0}});return function(us){return es.apply(this,arguments)}}(),Lr.return=(0,M.A)(function*(){return ks(),{done:!0,value:void 0}}),Lr},dispose(){K.dispose()}}}(e)}request(e){return new wn(t=>this.client.subscribe({...e,query:P7(e.query)},{next:t.next.bind(t),complete:t.complete.bind(t),error:t.error.bind(t)}))}}const WTe={run:n=>n(),runOutsideAngular:n=>n()};let _z=(()=>{class n{constructor(){this.httpLink=we(kTe),this.gatewayService=we(oH),this.apollo=(t,i=!1)=>new Jw(WTe,this.createApolloOptions(t,i))}createApolloOptions(t,i=!1){const o=new NU(h=>{const f=h.headers instanceof Ys?h.headers:new Ys(h.headers??{});return{...h,uri:()=>this.gatewayService.getGatewayUrl(t,i),headers:f.set("Authorization",`Bearer ${t.token}`).set("Accept","charset=utf-8")}}),r=Kye(({query:h})=>{const f=mw(h);return"OperationDefinition"===f.kind&&"subscription"===f.operation},new GTe({url:()=>this.gatewayService.getGatewayUrl(t,i),headers:()=>({Authorization:`Bearer ${t.token}`})}),this.httpLink.create({}));return{link:Ks.from([o,r]),cache:new DU}}static{this.\u0275fac=function(i){return new(i||n)}}static{this.\u0275prov=Bt({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();function pz(n){let e=n.replace(/[^a-zA-Z0-9]/g,"_");return/^[0-9]/.test(e)&&(e="_"+e),e}function aA(n){return n.split("_").filter(e=>e.length>0).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join("")}function fz(n,e,t){let i;if(n&&e)i=aA(pz(n)+"_"+e);else if(n)i=aA(pz(n));else{if(!e)return`${t}_Input`;i=aA("_"+e)}return`${i}${t}_Input`}function J5(n,e="_"){return[n.apiGroup,n.version,n.entity].filter(t=>!!t).join(e)}const t8=n=>{const e=[];return n.map(t=>{t.property instanceof Array?t.property.map(i=>lA(i,e)):lA(t.property,e)}),e},lA=(n,e=[])=>{if(!n)return[];const t=n.split(".");for(const i of t)return 1===t.length?(e.push(i),e):(e.push({[i]:[...lA(t.splice(1).join("."))]}),e)},em=(n,e)=>{const t=e.jsonPathExpression||e.property;if(!t)return;if(t instanceof Array)return void console.error(`Property defined as an array: ${JSON.stringify(t)}, provide "jsonPathExpression" field to properly ready resource value`);const o=po({path:`${t.startsWith("$.")?"":"$."}${t}`,json:n}),r=o.length?o[0]:void 0;return r&&e.propertyField?$Te(r[e.propertyField.key],e.propertyField.transform):r},$Te=(n,e)=>null!=n&&null!=e&&e.length?e.reduce((t,i)=>{if(null==t)return t;switch(i){case"uppercase":return t.toUpperCase();case"lowercase":return t.toLowerCase();case"capitalize":{const o=String(t);return o.length?o.charAt(0).toUpperCase()+o.slice(1):o}case"decode":try{return YTe(t)}catch{return t}case"encode":try{return ZTe(t)}catch{return t}default:return t}},n):n,ZTe=n=>{try{const e=(new TextEncoder).encode(n),t=Array.from(e,i=>String.fromCharCode(i)).join("");return btoa(t)}catch(e){throw console.error("Base64 encoding failed:",e),new Error("Failed to encode string to Base64")}},YTe=n=>{try{const e=atob(n),t=Uint8Array.from(e,i=>i.charCodeAt(0));return(new TextDecoder).decode(t)}catch(e){throw console.error("Base64 decoding failed:",e),new Error("Failed to decode Base64 string")}},zf=(n,e)=>em(n,{jsonPathExpression:e});function wd(n){return"Namespaced"===n?.resourceDefinition?.scope}function gz(n,e,t){if(!e)return n;const{getItemKey:i,mapSubscriptionObjectToItem:o}=t,r=new Map;n.forEach(m=>{const b=i(m);b&&r.set(b,m)});const{type:s,object:l}=e,h=l.metadata?.name;if(!h)return n;const f=o(l);return"ADDED"===s?r.set(h,f):"MODIFIED"===s?r.has(h)&&r.set(h,f):"DELETED"===s&&r.delete(h),[...r.values()]}function cA(n){if(Array.isArray(n))return n.map(e=>cA(e));if(n&&"object"==typeof n){const{__typename:e,...t}=n;for(const i of Object.keys(t))t[i]=cA(t[i]);return t}return n}var Vf=rt(7184);let tm=(()=>{class n{constructor(){this.apolloFactory=we(_z),this.luigiCoreService=we(Cr)}read(t,i,o,r,s=!0){const l=wd(r),h=this.getNamespace(r);let f=this.resolveReadQuery(i,o,t,l?h:void 0);return f=this.parseGQLQuery(f),this.apolloFactory.apollo(r,s).query({query:f,variables:{name:t,...l&&{namespace:h}}}).pipe(mo(m=>zf(m.data,J5(i,"."))))}resolveReadQuery(t,i,o,r){if(i instanceof Array){const{entity:s,version:l,apiGroup:h}=t,f=[{operation:s,variables:{name:{value:o,type:"String!"},...r&&{namespace:{value:r,type:"String"}}},fields:i}],m=this.calcQueryOptions(f,[{operation:h},{operation:l}]);return Vf.P(m).query}return i}list(t,i,o,r=!1,s){const h={...wd(o)&&{namespace:{type:"String",value:this.getNamespace(o)}},...s?.limit&&{limit:{type:"Int",value:s?.limit}},...s?.continue&&{continue:{type:"String",value:s?.continue}}},f=o.resourceDefinition;return f?i instanceof Array?this.listWithFields(f,i,o,r,h):this.listWithRawQuery(t,i,o,r,h):Zh(()=>new Error("Resource definition is required"))}getResourceReadyStatus(t,i){const o=i.resourceDefinition?.readyCondition;return!o||em(t,o)}listWithFields(t,i,o,r,s){const{apiGroup:l,entityCollection:h,version:f}=t,b=this.calcQueryOptions([{operation:h,variables:s,fields:["resourceVersion","remainingItemCount","continue",{items:i}]}],[{operation:l},{operation:f}]),A=Vf.P(b),T=this.parseGQLQuery(A.query);return this.apolloFactory.apollo(o,r).query({query:T,variables:A.variables}).pipe(mo(U=>{const K=zf(U.data,J5({apiGroup:l,version:f,entity:h},"."));if(!K)throw new Error("Resource list result not found");return K}),mo(U=>{const K=U.items.map(ne=>({...ne,ready:this.getResourceReadyStatus(ne,o)})).map(ne=>({...ne,id:ne.metadata.name,isAvailable:this.isAvailable(ne),accessibleName:this.getAccessibleName(ne)}));return{...U,items:K}}))}isAvailable(t){return!!t.ready&&!t.metadata?.deletionTimestamp}getAccessibleName(t){return t.metadata?.deletionTimestamp?"Resource is pending deletion":t.ready?void 0:"Resource is not ready"}listWithRawQuery(t,i,o,r,s){const l=this.parseGQLQuery(i);return this.apolloFactory.apollo(o,r).query({query:l,variables:this.normalizeGqlBuilderVariables(s)}).pipe(mo(h=>zf(h.data,t)??[]),bd(h=>(this.alertErrors(h),console.error("Error executing GraphQL query.",h),Zh(()=>h))))}resourceChangeSubscription(t,i,o,r,s){const h={...wd(o)&&{namespace:{type:"String",value:this.getNamespace(o)}}},f=t.toLowerCase(),m=Vf.gP({operation:f,fields:["type",{object:i}],variables:{...h,resourceVersion:{type:"String",value:r}}}),b=this.parseGQLQuery(m.query);return this.apolloFactory.apollo(o,s).subscribe({query:b,variables:m.variables}).pipe(mo(A=>{const T=zf(A.data,f);return T&&(T.object.ready=this.getResourceReadyStatus(T.object,o),T.object.id=T.object.metadata.name,T.object.isAvailable=this.isAvailable(T.object),T.object.accessibleName=this.getAccessibleName(T.object)),T}))}alertErrors(t){this.luigiCoreService.showAlert({text:t.message,type:"error"})}delete(t,i,o,r=!1){const s=wd(o),{apiGroup:l,entity:h,version:f}=i,m=[{operation:`delete${h}`,variables:{name:{type:"String!",value:t.metadata.name},...s&&{namespace:{type:"String",value:this.getNamespace(o)}}},fields:[]}],b=this.calcQueryOptions(m,[{operation:l},{operation:f}]),A=Vf.gO(b),T=this.parseGQLQuery(A.query);return this.apolloFactory.apollo(o,r).mutate({mutation:T,variables:A.variables}).pipe(bd(U=>(this.alertErrors(U),console.error("Error executing GraphQL query.",U),Zh(()=>U))))}create(t,i,o){const r=wd(o),{apiGroup:s,entity:l,version:h}=i,f=this.getNamespace(o,t),m=[{operation:`create${l}`,variables:{...r&&{namespace:{type:"String",value:f}},object:{type:`${fz(s,h,l)}!`,value:t}},fields:["__typename"]}],b=this.calcQueryOptions(m,[{operation:s},{operation:h}]),A=Vf.gO(b),T=this.parseGQLQuery(A.query);return this.apolloFactory.apollo(o).mutate({mutation:T,fetchPolicy:"no-cache",variables:A.variables}).pipe(bd(U=>(this.alertErrors(U),console.error("Error executing GraphQL query.",U),Zh(()=>U))))}update(t,i,o,r=!1,s=["__typename"]){const l=wd(o),{apiGroup:h,entity:f,version:m}=i,b=this.getNamespace(o),A=cA(t),T=[{operation:`update${f}`,variables:{...l&&{namespace:{type:"String",value:b}},name:{type:"String!",value:t.metadata.name},object:{type:`${fz(h,m,f)}!`,value:A}},fields:s}],U=this.calcQueryOptions(T,[{operation:h},{operation:m}]),K=Vf.gO(U),ne=this.parseGQLQuery(K.query);return this.apolloFactory.apollo(o,r).mutate({mutation:ne,fetchPolicy:"no-cache",variables:K.variables}).pipe(mo(ge=>zf(ge.data,J5({apiGroup:h,entity:`update${f}`,version:m},"."))),bd(ge=>(this.alertErrors(ge),console.error("Error executing GraphQL query.",ge),Zh(()=>ge))))}getNamespace(t,i){if(t.namespaceId)return t.namespaceId;if(i?.metadata?.namespace)return i.metadata.namespace;const o=this.luigiCoreService.routing().getSearchParams().namespace;return o?"-all-"===o?void 0:o:void 0}normalizeGqlBuilderVariables(t){return Object.fromEntries(Object.entries(t).map(([i,o])=>[i,o.value]))}calcQueryOptions(t,i){const o=i.filter(l=>!!l?.operation);if(0===o.length){const l=t.pop();if(l&&l.operation&&l.fields)return l;throw new Error("At least one wrapper or inner fields is required")}let r=t,s=o.pop();return o.forEach(l=>{r=[{operation:s.operation,fields:t,variables:s.variables}],s=l}),{operation:s.operation,fields:r,variables:s.variables}}parseGQLQuery(t){try{return tA`
81
+ */globalThis.$localize=S7;const Mo=globalThis.Luigi;let Cr=(()=>{class n{setConfig(t){return Mo.setConfig(t)}get config(){return Mo.getConfig()}getConfigValue(t){return Mo.getConfigValue(t)}unloadConfig(){return Mo.unload()}sendCustomMessage(t){return Mo.sendCustomMessage(t)}configChanged(t){Mo.configChanged(t)}customMessages(){return Mo.customMessages()}navigation(){return Mo.navigation()}resetLuigi(){Mo.reset()}clearNavigationCache(){Mo.clearNavigationCache&&Mo.clearNavigationCache()}showAlert(t){return Mo.showAlert(t)}ux(){return Mo.ux()}theming(){return Mo.theming()}i18n(){return Mo.i18n()}globalSearch(){return Mo.globalSearch()}getGlobalContext(){return Mo.getGlobalContext()}getWcExtendedContext(){return document.querySelector(".wcContainer")?.querySelector("[lui_web_component]")?.extendedContext?.context}getWcModalExtendedContext(){return document.querySelector(".iframeModalCtn")?.querySelector("[lui_web_component]")?.extendedContext?.context}setGlobalContext(t,i=!1){Mo.setGlobalContext(t,i)}setInGlobalContext(t,i=!1){Mo.setGlobalContext({...this.getGlobalContext(),...t},i)}routing(){return Mo.routing()}setFeatureToggle(t){Mo.featureToggles().setFeatureToggle(t)}unsetFeatureToggle(t){Mo.featureToggles().unsetFeatureToggle(t)}unsetAllFeatureToggles(){Mo.featureToggles().getActiveFeatureToggleList().forEach(t=>{this.unsetFeatureToggle(t)})}setFeatureToggles(t){if(t)for(const i of Object.keys(t))t[i]&&this.setFeatureToggle(i)}isFeatureToggleActive(t){return Mo.featureToggles().getActiveFeatureToggleList().includes(t)}getActiveFeatureToggleList(){return Mo.featureToggles().getActiveFeatureToggleList()}setAuthData(t){Mo.auth().store.setAuthData(t),Mo.auth().store.setNewlyAuthorized()}removeAuthData(){Mo.auth().store.removeAuthData()}getAuthData(){return Mo.auth().store.getAuthData()}setCurrentLocale(t){Mo.i18n().setCurrentLocale(t)}static{this.\u0275fac=function(i){return new(i||n)}}static{this.\u0275prov=Bt({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})(),p1=(()=>{class n{constructor(){this.http=we(ud)}getEnvConfig(){var t=this;return(0,M.A)(function*(){return t.envConfigCache||(yield f5(t.http.get("/rest/envconfig").pipe(l1(i=>t.envConfigCache=i)))),t.envConfigCache})()}static{this.\u0275fac=function(i){return new(i||n)}}static{this.\u0275prov=Bt({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})(),_d=(()=>{class n{constructor(){this.envConfigService=we(p1),this.luigiCoreService=we(Cr),this.fallbackLanguage="en",this.translationTable={},this.currentLanguage=""}afterInit(){this.currentLanguage=this.luigiCoreService.i18n().getCurrentLocale(),this.luigiCoreService.i18n().addCurrentLocaleChangeListener(t=>{this.currentLanguage=t})}getTranslation(t,i,o){let r=this.getInternalTranslation(t,i,o);return r||(r=this.findTranslation(t,this.translationTable,this.fallbackLanguage,i)),r||t}getTranslationAsync(t,i,o){var r=this;return(0,M.A)(function*(){return new Promise(s=>{let l=r.getInternalTranslation(t,i,o);l?s(l||t):r.translationTable&&!r.translationTable[r.fallbackLanguage]?r.fetchTranslationFile(r.fallbackLanguage).then(()=>{l=r.findTranslation(t,r.translationTable,r.fallbackLanguage,i),s(l||t)}):(l=r.findTranslation(t,r.translationTable,r.fallbackLanguage,i),s(l||t))})})()}findTranslation(t,i,o,r){if(i[o]){const s="object"==typeof i[o][t]?i[o][t].join("<br>"):i[o][t];return r?this.findInterpolations(s,r):s}}findInterpolations(t,i){if(t)return Object.keys(i).forEach(o=>{t=t.replace(new RegExp("{"+o+"}","gi"),i[o])}),t}addTranslationFile(t,i){i&&t&&(this.translationTable[t]=i)}fetchTranslationFile(t){var i=this;return(0,M.A)(function*(){return new Promise(o=>{fetch(`/assets/translation-files/${t}.json`).then(r=>r.json()).then(r=>{i.addTranslationFile(t,r),o(!0)}).catch(r=>{console.error("Error:",r),i.addTranslationFile(t,{}),o(!1)})})})()}getInternalTranslation(t,i,o){return t?(this.currentLanguage=o||this.currentLanguage||this.luigiCoreService.i18n().getCurrentLocale(),this.findTranslation(t,this.translationTable,this.currentLanguage,i)):""}getValidLanguages(){var t=this;return(0,M.A)(function*(){const i=[{value:"en",label:"USERSETTINGSDIALOG_LANGUAGE_EN"}];try{const{developmentInstance:o}=yield t.envConfigService.getEnvConfig();o&&i.push({value:"de",label:"USERSETTINGSDIALOG_LANGUAGE_DE"})}finally{return i}})()}static{this.\u0275fac=function(i){return new(i||n)}}static{this.\u0275prov=Bt({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();var f1=function(n){return n.LAST_NAVIGATION_URL="openmfp.navigation.lastUrl",n.USER_SETTINGS="openmfp.settings.userSettings",n.LOCAL_DEVELOPMENT_SETTINGS="openmfp.settings.localDevelopmentSettings",n.FEATURE_TOGGLE_SETTINGS="openmfp.settings.featureToggleSettings",n.DEVELOPMENT_MODE_CONFIG="dev-mode-settings",n}(f1||{});(0,M.A)(function*(e){return e.frame_userAccount&&e.frame_userAccount.language?(delete e.frame_userAccount.name,delete e.frame_userAccount.email):delete e.frame_userAccount,new Promise((t,i)=>{try{localStorage.setItem(f1.USER_SETTINGS,JSON.stringify(e)),t(e)}catch(o){console.error("Error storing user settings",o),i({closeDialog:!0,message:"Could not write userSettings to storage..."})}})}),document.body.classList.add("ui5-content-density-compact");let oH=(()=>{class n{constructor(){this.luigiCoreService=we(Cr)}getGatewayUrl(t,i=!1){const o=t.portalContext.crdGatewayApiUrl,r=this.extractKcpPath(o);return o?.replace(r,this.resolveKcpPath(t,i))}updateCrdGatewayUrlWithEntityPath(t){const i=this.luigiCoreService.getGlobalContext().portalContext.crdGatewayApiUrl,o=this.extractKcpPath(i);this.luigiCoreService.getGlobalContext().portalContext.crdGatewayApiUrl=i.replace(o,t)}resolveKcpPath(t,i=!1){let r=this.extractKcpPath(t.portalContext.crdGatewayApiUrl);if(t.kcpPath&&(r=t.kcpPath),i){const s=r.lastIndexOf(":");-1!==s&&(r=r.slice(0,s))}return r}extractKcpPath(t){return t.match(new RegExp("(root:orgs[^/]*)"))?.[1]||""}static{this.\u0275fac=function(i){return new(i||n)}}static{this.\u0275prov=Bt({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();const pd=new wn(n=>n.complete());function ml(n,e){return n.definitions.find(t=>"OperationDefinition"===t.kind&&!!t.name)?.name.value??e}function N7(n,e){if(!n)throw new Error(e)}function Wy(n){return L7(n,[])}function L7(n,e){switch(typeof n){case"string":return JSON.stringify(n);case"function":return n.name?`[function ${n.name}]`:"[function]";case"object":return function Dye(n,e){if(null===n)return"null";if(e.includes(n))return"[Circular]";const t=[...e,n];if(function Nye(n){return"function"==typeof n.toJSON}(n)){const i=n.toJSON();if(i!==n)return"string"==typeof i?i:L7(i,t)}else if(Array.isArray(n))return function Mye(n,e){if(0===n.length)return"[]";if(e.length>2)return"[Array]";const t=Math.min(10,n.length),i=n.length-t,o=[];for(let r=0;r<t;++r)o.push(L7(n[r],e));return 1===i?o.push("... 1 more item"):i>1&&o.push(`... ${i} more items`),"["+o.join(", ")+"]"}(n,t);return function Lye(n,e){const t=Object.entries(n);return 0===t.length?"{}":e.length>2?"["+function Rye(n){const e=Object.prototype.toString.call(n).replace(/^\[object /,"").replace(/]$/,"");if("Object"===e&&"function"==typeof n.constructor){const t=n.constructor.name;if("string"==typeof t&&""!==t)return t}return e}(n)+"]":"{ "+t.map(([o,r])=>o+": "+L7(r,e)).join(", ")+" }"}(n,t)}(n,e);default:return String(n)}}class kye{constructor(e,t,i){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=i}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}}class sH{constructor(e,t,i,o,r,s){this.kind=e,this.start=t,this.end=i,this.line=o,this.column=r,this.value=s,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 aH={Name:[],Document:["definitions"],OperationDefinition:["description","name","variableDefinitions","directives","selectionSet"],VariableDefinition:["description","variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["description","name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","directives","locations"],SchemaExtension:["directives","operationTypes"],DirectiveExtension:["name","directives"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"],TypeCoordinate:["name"],MemberCoordinate:["name","memberName"],ArgumentCoordinate:["name","fieldName","argumentName"],DirectiveCoordinate:["name"],DirectiveArgumentCoordinate:["name","argumentName"]},Oye=new Set(Object.keys(aH));function lH(n){const e=n?.kind;return"string"==typeof e&&Oye.has(e)}var _u=function(n){return n.QUERY="query",n.MUTATION="mutation",n.SUBSCRIPTION="subscription",n}(_u||{}),_n=function(n){return n.NAME="Name",n.DOCUMENT="Document",n.OPERATION_DEFINITION="OperationDefinition",n.VARIABLE_DEFINITION="VariableDefinition",n.SELECTION_SET="SelectionSet",n.FIELD="Field",n.ARGUMENT="Argument",n.FRAGMENT_SPREAD="FragmentSpread",n.INLINE_FRAGMENT="InlineFragment",n.FRAGMENT_DEFINITION="FragmentDefinition",n.VARIABLE="Variable",n.INT="IntValue",n.FLOAT="FloatValue",n.STRING="StringValue",n.BOOLEAN="BooleanValue",n.NULL="NullValue",n.ENUM="EnumValue",n.LIST="ListValue",n.OBJECT="ObjectValue",n.OBJECT_FIELD="ObjectField",n.DIRECTIVE="Directive",n.NAMED_TYPE="NamedType",n.LIST_TYPE="ListType",n.NON_NULL_TYPE="NonNullType",n.SCHEMA_DEFINITION="SchemaDefinition",n.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",n.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",n.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",n.FIELD_DEFINITION="FieldDefinition",n.INPUT_VALUE_DEFINITION="InputValueDefinition",n.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",n.UNION_TYPE_DEFINITION="UnionTypeDefinition",n.ENUM_TYPE_DEFINITION="EnumTypeDefinition",n.ENUM_VALUE_DEFINITION="EnumValueDefinition",n.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",n.DIRECTIVE_DEFINITION="DirectiveDefinition",n.SCHEMA_EXTENSION="SchemaExtension",n.DIRECTIVE_EXTENSION="DirectiveExtension",n.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",n.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",n.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",n.UNION_TYPE_EXTENSION="UnionTypeExtension",n.ENUM_TYPE_EXTENSION="EnumTypeExtension",n.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension",n.TYPE_COORDINATE="TypeCoordinate",n.MEMBER_COORDINATE="MemberCoordinate",n.ARGUMENT_COORDINATE="ArgumentCoordinate",n.DIRECTIVE_COORDINATE="DirectiveCoordinate",n.DIRECTIVE_ARGUMENT_COORDINATE="DirectiveArgumentCoordinate",n}(_n||{});const zh=Object.freeze({});function pu(n,e,t=aH){const i=new Map;for(const ge of Object.values(_n))i.set(ge,$y(e,ge));let o,m,b,r=Array.isArray(n),s=[n],l=-1,h=[],f=n;const A=[],T=[];do{l++;const ge=l===s.length,Me=ge&&0!==h.length;if(ge){if(m=0===T.length?void 0:A[A.length-1],f=b,b=T.pop(),Me)if(r){f=f.slice();let Nt=0;for(const[Zt,Wn]of h){const Ri=Zt-Nt;null===Wn?(f.splice(Ri,1),Nt++):f[Ri]=Wn}}else{f={...f};for(const[Nt,Zt]of h)f[Nt]=Zt}l=o.index,s=o.keys,h=o.edits,r=o.inArray,o=o.prev}else if(b){if(m=r?l:s[l],f=b[m],null==f)continue;A.push(m)}let Ct;if(!Array.isArray(f)){var U,K;lH(f)||N7(!1,`Invalid AST Node: ${Wy(f)}.`);const Nt=ge?null===(U=i.get(f.kind))||void 0===U?void 0:U.leave:null===(K=i.get(f.kind))||void 0===K?void 0:K.enter;if(Ct=Nt?.call(e,f,m,b,A,T),Ct===zh)break;if(!1===Ct){if(!ge){A.pop();continue}}else if(void 0!==Ct&&(h.push([m,Ct]),!ge)){if(!lH(Ct)){A.pop();continue}f=Ct}}var ne;void 0===Ct&&Me&&h.push([m,f]),ge?A.pop():(o={inArray:r,index:l,keys:s,edits:h,prev:o},r=Array.isArray(f),s=r?f:null!==(ne=t[f.kind])&&void 0!==ne?ne:[],l=-1,h=[],b&&T.push(b),b=f)}while(void 0!==o);return 0!==h.length?h[h.length-1][1]:n}function $y(n,e){const t=n[e];return"object"==typeof t?t:"function"==typeof t?{enter:t,leave:void 0}:{enter:n.enter,leave:n.leave}}function Ef(n){try{return n()}catch{}}const Zy=Ef(()=>globalThis)||Ef(()=>window)||Ef(()=>self)||Ef(()=>global)||Ef(function(){return Ef.constructor("return this")()}),Yy="4.2.7",cH=new Map;function uH(n){const e=cH.get(n)||1;return cH.set(n,e+1),`${n}:${e}:${Math.random().toString(36).slice(2)}`}const hH="Invariant Violation";class Ky extends Error{constructor(e=hH){super(e),this.name=hH,Object.setPrototypeOf(this,Ky.prototype)}}const M7=["debug","log","warn","error","silent"];let qy=M7.indexOf("silent");function bn(n,...e){if(!n)throw vl(...e)}function R7(n){return function(e,...t){if(M7.indexOf(n)>=qy){const i=console[n]||console.log;if("number"==typeof e){const o=e;(e=pH(o))||(e=fH(o,t),t=[])}i(e,...t)}}}function vl(n,...e){return new Ky(pH(n,e)||fH(n,e))}bn.debug=R7("debug"),bn.log=R7("log"),bn.warn=R7("warn"),bn.error=R7("error");const _H=Symbol.for("ApolloErrorMessageHandler_"+Yy);function Xy(n){if("string"==typeof n)return n;try{return function dH(n,e=0){const t=uH("stringifyForDisplay");return JSON.stringify(n,(i,o)=>void 0===o?t:o,e).split(JSON.stringify(t)).join("<undefined>")}(n,2).slice(0,1e3)}catch{return"<non-serializable>"}}function pH(n,e=[]){if(n)return Zy[_H]&&Zy[_H](n,e.map(Xy))}function fH(n,e=[]){if(n)return"string"==typeof n?e.reduce((t,i)=>t.replace(/%[sdfo]/,Xy(i)),n):`An error occurred! For more details, see the full error text at https://go.apollo.dev/c/err#${encodeURIComponent(JSON.stringify({version:Yy,message:n,args:e.map(Xy)}))}`}const fd={...Zy[Symbol.for("apollo.cacheSize")]},Pye=()=>Object.create(null),{forEach:Fye,slice:gH}=Array.prototype,{hasOwnProperty:Hye}=Object.prototype;class fu{constructor(e=!0,t=Pye){this.weakness=e,this.makeData=t}lookup(){return this.lookupArray(arguments)}lookupArray(e){let t=this;return Fye.call(e,i=>t=t.getChildTrie(i)),Hye.call(t,"data")?t.data:t.data=this.makeData(gH.call(e))}peek(){return this.peekArray(arguments)}peekArray(e){let t=this;for(let i=0,o=e.length;t&&i<o;++i){const r=t.mapFor(e[i],!1);t=r&&r.get(e[i])}return t&&t.data}remove(){return this.removeArray(arguments)}removeArray(e){let t;if(e.length){const i=e[0],o=this.mapFor(i,!1),r=o&&o.get(i);r&&(t=r.removeArray(gH.call(e,1)),!r.data&&!r.weak&&(!r.strong||!r.strong.size)&&o.delete(i))}else t=this.data,delete this.data;return t}getChildTrie(e){const t=this.mapFor(e,!0);let i=t.get(e);return i||t.set(e,i=new fu(this.weakness,this.makeData)),i}mapFor(e,t){return this.weakness&&function Uye(n){switch(typeof n){case"object":if(null===n)break;case"function":return!0}return!1}(e)?this.weak||(t?this.weak=new WeakMap:void 0):this.strong||(t?this.strong=new Map:void 0)}}function Qy(){}const zye=Qy,Vye=typeof WeakRef<"u"?WeakRef:function(n){return{deref:()=>n}},jye=typeof WeakMap<"u"?WeakMap:Map,Gye=typeof FinalizationRegistry<"u"?FinalizationRegistry:function(){return{register:Qy,unregister:Qy}};class k7{constructor(e=1/0,t=zye){this.max=e,this.dispose=t,this.map=new jye,this.newest=null,this.oldest=null,this.unfinalizedNodes=new Set,this.finalizationScheduled=!1,this.size=0,this.finalize=()=>{const i=this.unfinalizedNodes.values();for(let o=0;o<10024;o++){const r=i.next().value;if(!r)break;this.unfinalizedNodes.delete(r);const s=r.key;delete r.key,r.keyRef=new Vye(s),this.registry.register(s,r,r)}this.unfinalizedNodes.size>0?queueMicrotask(this.finalize):this.finalizationScheduled=!1},this.registry=new Gye(this.deleteNode.bind(this))}has(e){return this.map.has(e)}get(e){const t=this.getNode(e);return t&&t.value}getNode(e){const t=this.map.get(e);if(t&&t!==this.newest){const{older:i,newer:o}=t;o&&(o.older=i),i&&(i.newer=o),t.older=this.newest,t.older.newer=t,t.newer=null,this.newest=t,t===this.oldest&&(this.oldest=o)}return t}set(e,t){let i=this.getNode(e);return i?i.value=t:(i={key:e,value:t,newer:null,older:this.newest},this.newest&&(this.newest.newer=i),this.newest=i,this.oldest=this.oldest||i,this.scheduleFinalization(i),this.map.set(e,i),this.size++,i.value)}clean(){for(;this.oldest&&this.size>this.max;)this.deleteNode(this.oldest)}deleteNode(e){e===this.newest&&(this.newest=e.older),e===this.oldest&&(this.oldest=e.newer),e.newer&&(e.newer.older=e.older),e.older&&(e.older.newer=e.newer),this.size--;const t=e.key||e.keyRef&&e.keyRef.deref();this.dispose(e.value,t),e.keyRef?this.registry.unregister(e):this.unfinalizedNodes.delete(e),t&&this.map.delete(t)}delete(e){const t=this.map.get(e);return!!t&&(this.deleteNode(t),!0)}scheduleFinalization(e){this.unfinalizedNodes.add(e),this.finalizationScheduled||(this.finalizationScheduled=!0,queueMicrotask(this.finalize))}}function $ye(){}class Jy{constructor(e=1/0,t=$ye){this.max=e,this.dispose=t,this.map=new Map,this.newest=null,this.oldest=null}has(e){return this.map.has(e)}get(e){const t=this.getNode(e);return t&&t.value}get size(){return this.map.size}getNode(e){const t=this.map.get(e);if(t&&t!==this.newest){const{older:i,newer:o}=t;o&&(o.older=i),i&&(i.newer=o),t.older=this.newest,t.older.newer=t,t.newer=null,this.newest=t,t===this.oldest&&(this.oldest=o)}return t}set(e,t){let i=this.getNode(e);return i?i.value=t:(i={key:e,value:t,newer:null,older:this.newest},this.newest&&(this.newest.newer=i),this.newest=i,this.oldest=this.oldest||i,this.map.set(e,i),i.value)}clean(){for(;this.oldest&&this.map.size>this.max;)this.delete(this.oldest.key)}delete(e){const t=this.map.get(e);return!!t&&(t===this.newest&&(this.newest=t.older),t===this.oldest&&(this.oldest=t.newer),t.newer&&(t.newer.older=t.older),t.older&&(t.older.newer=t.newer),this.map.delete(e),this.dispose(t.value,e),!0)}}const ew=new WeakSet;function mH(n){n.size<=(n.max||-1)||ew.has(n)||(ew.add(n),setTimeout(()=>{n.clean(),ew.delete(n)},100))}const tw=function(n,e){const t=new k7(n,e);return t.set=function(i,o){const r=k7.prototype.set.call(this,i,o);return mH(this),r},t},Zye=function(n,e){const t=new Jy(n,e);return t.set=function(i,o){const r=Jy.prototype.set.call(this,i,o);return mH(this),r},t};function vH(n,{max:e,makeCacheKey:t=i=>i}){const i=new fu(!0),o=new tw(e);return(...r)=>{const s=i.lookupArray(t(r)),l=o.get(s);if(l){if(l.error)throw l.error;return l.result}const h=o.set(s,{});try{return h.result=n(...r)}catch(f){throw h.error=f,f}}}const Vh=vH((n,e)=>{bn(n&&"Document"===n.kind,1);const t=n.definitions.filter(i=>"OperationDefinition"===i.kind);e&&bn(1==t.length&&t[0].operation===e,4,e,e,t[0].operation),pu(n,{Field(i,o,r,s){if(i.alias&&("__typename"===i.alias.value||i.alias.value.startsWith("__ac_"))&&i.alias.value!==i.name.value){let l=n,h=[];for(const f of s)l=l[f],l.kind===_n.FIELD&&h.push(l.alias?.value||l.name.value);throw h.splice(-1,1,i.name.value),vl(5,i.alias.value,h.join("."),t[0].operation,ml(n,"(anonymous)"))}}})},{max:fd.checkDocument||2e3});function gd(n){return Vh(n),n.definitions.filter(e=>"OperationDefinition"===e.kind)[0]}class Ks{static empty(){return new Ks(()=>pd)}static from(e){if(0===e.length)return Ks.empty();const[t,...i]=e;return t.concat(...i)}static split(e,t,i=new Ks((o,r)=>r(o))){const o=new Ks((r,s)=>e(r)?t.request(r,s):i.request(r,s));return Object.assign(o,{left:t,right:i})}static execute(e,t,i){return e.request(function Yye(n,{client:e}){const t={query:n.query,variables:n.variables||{},extensions:n.extensions||{},operationName:ml(n.query),operationType:gd(n.query).operation};let i={...n.context};const r=()=>Object.freeze({...i});return Object.defineProperty(t,"setContext",{enumerable:!1,value:s=>{i="function"==typeof s?{...i,...s(r())}:{...i,...s}}}),Object.defineProperty(t,"getContext",{enumerable:!1,value:r}),Object.defineProperty(t,"client",{enumerable:!1,value:e}),t}(t,i),()=>pd)}static concat(...e){return Ks.from(e)}constructor(e){e&&(this.request=e)}split(e,t,i){return this.concat(Ks.split(e,t,i))}concat(...e){return 0===e.length?this:e.reduce(this.combine.bind(this),this)}combine(e,t){const i=new Ks((o,r)=>e.request(o,s=>t.request(s,r)));return Object.assign(i,{left:e,right:t})}request(e,t){throw vl(65)}left;right}const Kye=Ks.split,{toString:bH,hasOwnProperty:qye}=Object.prototype,CH=Function.prototype.toString,nw=new Map;function sr(n,e){try{return iw(n,e)}finally{nw.clear()}}function iw(n,e){if(n===e)return!0;const t=bH.call(n);if(t!==bH.call(e))return!1;switch(t){case"[object Array]":if(n.length!==e.length)return!1;case"[object Object]":{if(wH(n,e))return!0;const o=yH(n),r=yH(e),s=o.length;if(s!==r.length)return!1;for(let l=0;l<s;++l)if(!qye.call(e,o[l]))return!1;for(let l=0;l<s;++l){const h=o[l];if(!iw(n[h],e[h]))return!1}return!0}case"[object Error]":return n.name===e.name&&n.message===e.message;case"[object Number]":if(n!=n)return e!=e;case"[object Boolean]":case"[object Date]":return+n==+e;case"[object RegExp]":case"[object String]":return n==`${e}`;case"[object Map]":case"[object Set]":{if(n.size!==e.size)return!1;if(wH(n,e))return!0;const o=n.entries(),r="[object Map]"===t;for(;;){const s=o.next();if(s.done)break;const[l,h]=s.value;if(!e.has(l)||r&&!iw(h,e.get(l)))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]":n=new Uint8Array(n),e=new Uint8Array(e);case"[object DataView]":{let o=n.byteLength;if(o===e.byteLength)for(;o--&&n[o]===e[o];);return-1===o}case"[object AsyncFunction]":case"[object GeneratorFunction]":case"[object AsyncGeneratorFunction]":case"[object Function]":{const o=CH.call(n);return o===CH.call(e)&&!function Jye(n,e){const t=n.length-e.length;return t>=0&&n.indexOf(e,t)===t}(o,Qye)}}return!1}function yH(n){return Object.keys(n).filter(Xye,n)}function Xye(n){return void 0!==this[n]}const Qye="{ [native code] }";function wH(n,e){let t=nw.get(n);if(t){if(t.has(e))return!0}else nw.set(n,t=new Set);return t.add(e),!1}let Rs=null;const AH={};let ewe=1;function TH(n){try{return n()}catch{}}const ow="@wry/context:Slot",IH=TH(()=>globalThis)||TH(()=>global)||Object.create(null),O7=IH[ow]||Array[ow]||function(n){try{Object.defineProperty(IH,ow,{value:n,enumerable:!1,writable:!1,configurable:!0})}finally{return n}}(class{constructor(){this.id=["slot",ewe++,Date.now(),Math.random().toString(36).slice(2)].join(":")}hasValue(){for(let e=Rs;e;e=e.parent)if(this.id in e.slots){const t=e.slots[this.id];if(t===AH)break;return e!==Rs&&(Rs.slots[this.id]=t),!0}return Rs&&(Rs.slots[this.id]=AH),!1}getValue(){if(this.hasValue())return Rs.slots[this.id]}withValue(e,t,i,o){const s=Rs;Rs={parent:s,slots:{__proto__:null,[this.id]:e}};try{return t.apply(o,i)}finally{Rs=s}}static bind(e){const t=Rs;return function(){const i=Rs;try{return Rs=t,e.apply(this,arguments)}finally{Rs=i}}}static noContext(e,t,i){if(!Rs)return e.apply(i,t);{const o=Rs;try{return Rs=null,e.apply(i,t)}finally{Rs=o}}}}),D5=new O7,{hasOwnProperty:owe}=Object.prototype,sw=Array.from||function(n){const e=[];return n.forEach(t=>e.push(t)),e};function B7(n){const{unsubscribe:e}=n;"function"==typeof e&&(n.unsubscribe=void 0,e())}const N5=[];function xf(n,e){if(!n)throw new Error(e||"assertion failure")}function EH(n,e){const t=n.length;return t>0&&t===e.length&&n[t-1]===e[t-1]}function xH(n){switch(n.length){case 0:throw new Error("unknown value");case 1:return n[0];case 2:throw n[1]}}function DH(n){return n.slice(0)}let swe=(()=>{class n{constructor(t){this.fn=t,this.parents=new Set,this.childValues=new Map,this.dirtyChildren=null,this.dirty=!0,this.recomputing=!1,this.value=[],this.deps=null,++n.count}peek(){if(1===this.value.length&&!jh(this))return NH(this),this.value[0]}recompute(t){return xf(!this.recomputing,"already recomputing"),NH(this),jh(this)?function awe(n,e){return BH(n),D5.withValue(n,lwe,[n,e]),function uwe(n,e){if("function"==typeof n.subscribe)try{B7(n),n.unsubscribe=n.subscribe.apply(null,e)}catch{return n.setDirty(),!1}return!0}(n,e)&&function cwe(n){n.dirty=!1,!jh(n)&&MH(n)}(n),xH(n.value)}(this,t):xH(this.value)}setDirty(){this.dirty||(this.dirty=!0,LH(this),B7(this))}dispose(){this.setDirty(),BH(this),aw(this,(t,i)=>{t.setDirty(),PH(t,this)})}forget(){this.dispose()}dependOn(t){t.add(this),this.deps||(this.deps=N5.pop()||new Set),this.deps.add(t)}forgetDeps(){this.deps&&(sw(this.deps).forEach(t=>t.delete(this)),this.deps.clear(),N5.push(this.deps),this.deps=null)}}return n.count=0,n})();function NH(n){const e=D5.getValue();if(e)return n.parents.add(e),e.childValues.has(n)||e.childValues.set(n,[]),jh(n)?RH(e,n):kH(e,n),e}function lwe(n,e){n.recomputing=!0;const{normalizeResult:t}=n;let i;t&&1===n.value.length&&(i=DH(n.value)),n.value.length=0;try{if(n.value[0]=n.fn.apply(null,e),t&&i&&!EH(i,n.value))try{n.value[0]=t(n.value[0],i[0])}catch{}}catch(o){n.value[1]=o}n.recomputing=!1}function jh(n){return n.dirty||!(!n.dirtyChildren||!n.dirtyChildren.size)}function LH(n){aw(n,RH)}function MH(n){aw(n,kH)}function aw(n,e){const t=n.parents.size;if(t){const i=sw(n.parents);for(let o=0;o<t;++o)e(i[o],n)}}function RH(n,e){xf(n.childValues.has(e)),xf(jh(e));const t=!jh(n);if(n.dirtyChildren){if(n.dirtyChildren.has(e))return}else n.dirtyChildren=N5.pop()||new Set;n.dirtyChildren.add(e),t&&LH(n)}function kH(n,e){xf(n.childValues.has(e)),xf(!jh(e));const t=n.childValues.get(e);0===t.length?n.childValues.set(e,DH(e.value)):EH(t,e.value)||n.setDirty(),OH(n,e),!jh(n)&&MH(n)}function OH(n,e){const t=n.dirtyChildren;t&&(t.delete(e),0===t.size&&(N5.length<100&&N5.push(t),n.dirtyChildren=null))}function BH(n){n.childValues.size>0&&n.childValues.forEach((e,t)=>{PH(n,t)}),n.forgetDeps(),xf(null===n.dirtyChildren)}function PH(n,e){e.parents.delete(n),n.childValues.delete(e),OH(n,e)}const dwe={setDirty:!0,dispose:!0,forget:!0};function FH(n){const e=new Map,t=n&&n.subscribe;function i(o){const r=D5.getValue();if(r){let s=e.get(o);s||e.set(o,s=new Set),r.dependOn(s),"function"==typeof t&&(B7(s),s.unsubscribe=t(o))}}return i.dirty=function(r,s){const l=e.get(r);if(l){const h=s&&owe.call(dwe,s)?s:"setDirty";sw(l).forEach(f=>f[h]()),e.delete(r),B7(l)}},i}let HH;function UH(...n){return(HH||(HH=new fu("function"==typeof WeakMap))).lookupArray(n)}const lw=new Set;function L5(n,{max:e=Math.pow(2,16),keyArgs:t,makeCacheKey:i=UH,normalizeResult:o,subscribe:r,cache:s=Jy}=Object.create(null)){const l="function"==typeof s?new s(e,A=>A.dispose()):s,h=function(){const A=i.apply(null,t?t.apply(null,arguments):arguments);if(void 0===A)return n.apply(null,arguments);let T=l.get(A);T||(l.set(A,T=new swe(n)),T.normalizeResult=o,T.subscribe=r,T.forget=()=>l.delete(A));const U=T.recompute(Array.prototype.slice.call(arguments));return l.set(A,T),lw.add(l),D5.hasValue()||(lw.forEach(K=>K.clean()),lw.clear()),U};function f(A){const T=A&&l.get(A);T&&T.setDirty()}function m(A){const T=A&&l.get(A);if(T)return T.peek()}function b(A){return!!A&&l.delete(A)}return Object.defineProperty(h,"size",{get:()=>l.size,configurable:!1,enumerable:!1}),Object.freeze(h.options={max:e,keyArgs:t,makeCacheKey:i,normalizeResult:o,subscribe:r,cache:l}),h.dirtyKey=f,h.dirty=function(){f(i.apply(null,arguments))},h.peekKey=m,h.peek=function(){return m(i.apply(null,arguments))},h.forgetKey=b,h.forget=function(){return b(i.apply(null,arguments))},h.makeCacheKey=i,h.getKey=t?function(){return i.apply(null,t.apply(null,arguments))}:i,Object.freeze(h)}function hwe(n){return n}class md{transform;cached;resultCache=new WeakSet;getCacheKey(e){return[e]}static identity(){return new md(hwe,{cache:!1})}static split(e,t,i=md.identity()){return Object.assign(new md(o=>(e(o)?t:i).transformDocument(o),{cache:!1}),{left:t,right:i})}constructor(e,t={}){this.transform=e,t.getCacheKey&&(this.getCacheKey=t.getCacheKey),this.cached=!1!==t.cache,this.resetCache()}resetCache(){if(this.cached){const e=new fu;this.performWork=L5(md.prototype.performWork.bind(this),{makeCacheKey:t=>{const i=this.getCacheKey(t);if(i)return bn(Array.isArray(i),20),e.lookupArray(i)},max:fd["documentTransform.cache"],cache:k7})}}performWork(e){return Vh(e),this.transform(e)}transformDocument(e){if(this.resultCache.has(e))return e;const t=this.performWork(e);return this.resultCache.add(t),t}concat(e){return Object.assign(new md(t=>e.transformDocument(this.transformDocument(t)),{cache:!1}),{left:this,right:e})}left;right}const zH={kind:_n.FIELD,name:{kind:_n.NAME,value:"__typename"}},cw=Object.assign(function(n){return pu(n,{SelectionSet:{enter(e,t,i){if(i&&i.kind===_n.OPERATION_DEFINITION)return;const{selections:o}=e;return o&&!o.some(l=>l.kind===_n.FIELD&&("__typename"===l.name.value||0===l.name.value.lastIndexOf("__",0)))?i.kind===_n.FIELD&&i.directives&&i.directives.some(l=>"export"===l.name.value)?void 0:{...e,selections:[...o,zH]}:void 0}}})},{added:n=>n===zH}),vd=Object.assign(function(e){return JSON.stringify(e,vwe)},{reset(){Df=new Zye(fd.canonicalStringify||1e3)}});let Df;function vwe(n,e){if(e&&"object"==typeof e){const t=Object.getPrototypeOf(e);if(t===Object.prototype||null===t){const i=Object.keys(e);if(i.every(bwe))return e;const o=JSON.stringify(i);let r=Df.get(o);if(!r){i.sort();const l=JSON.stringify(i);r=Df.get(l)||i,Df.set(o,r),Df.set(l,r)}const s=Object.create(t);return r.forEach(l=>{s[l]=e[l]}),s}}return e}function bwe(n,e,t){return 0===e||t[e-1]<=n}function _w(n){return 9===n||32===n}function M5(n){return n>=48&&n<=57}function WH(n){return n>=97&&n<=122||n>=65&&n<=90}function $H(n){return WH(n)||95===n}function Cwe(n){return WH(n)||M5(n)||95===n}function ywe(n){var e;let t=Number.MAX_SAFE_INTEGER,i=null,o=-1;for(let s=0;s<n.length;++s){var r;const l=n[s],h=wwe(l);h!==l.length&&(i=null!==(r=i)&&void 0!==r?r:s,o=s,0!==s&&h<t&&(t=h))}return n.map((s,l)=>0===l?s:s.slice(t)).slice(null!==(e=i)&&void 0!==e?e:0,o+1)}function wwe(n){let e=0;for(;e<n.length&&_w(n.charCodeAt(e));)++e;return e}vd.reset();const Iwe=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function Swe(n){return Ewe[n.charCodeAt(0)]}const Ewe=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000B","\\f","\\r","\\u000E","\\u000F","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001A","\\u001B","\\u001C","\\u001D","\\u001E","\\u001F","","",'\\"',"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\u007F","\\u0080","\\u0081","\\u0082","\\u0083","\\u0084","\\u0085","\\u0086","\\u0087","\\u0088","\\u0089","\\u008A","\\u008B","\\u008C","\\u008D","\\u008E","\\u008F","\\u0090","\\u0091","\\u0092","\\u0093","\\u0094","\\u0095","\\u0096","\\u0097","\\u0098","\\u0099","\\u009A","\\u009B","\\u009C","\\u009D","\\u009E","\\u009F"];function P7(n){return pu(n,Dwe)}const Dwe={Name:{leave:n=>n.value},Variable:{leave:n=>"$"+n.name},Document:{leave:n=>En(n.definitions,"\n\n")},OperationDefinition:{leave(n){const e=pw(n.variableDefinitions)?Si("(\n",En(n.variableDefinitions,"\n"),"\n)"):Si("(",En(n.variableDefinitions,", "),")"),t=Si("",n.description,"\n")+En([n.operation,En([n.name,e]),En(n.directives," ")]," ");return("query"===t?"":t+" ")+n.selectionSet}},VariableDefinition:{leave:({variable:n,type:e,defaultValue:t,directives:i,description:o})=>Si("",o,"\n")+n+": "+e+Si(" = ",t)+Si(" ",En(i," "))},SelectionSet:{leave:({selections:n})=>Tc(n)},Field:{leave({alias:n,name:e,arguments:t,directives:i,selectionSet:o}){const r=Si("",n,": ")+e;let s=r+Si("(",En(t,", "),")");return s.length>80&&(s=r+Si("(\n",F7(En(t,"\n")),"\n)")),En([s,En(i," "),o]," ")}},Argument:{leave:({name:n,value:e})=>n+": "+e},FragmentSpread:{leave:({name:n,directives:e})=>"..."+n+Si(" ",En(e," "))},InlineFragment:{leave:({typeCondition:n,directives:e,selectionSet:t})=>En(["...",Si("on ",n),En(e," "),t]," ")},FragmentDefinition:{leave:({name:n,typeCondition:e,variableDefinitions:t,directives:i,selectionSet:o,description:r})=>Si("",r,"\n")+`fragment ${n}${Si("(",En(t,", "),")")} on ${e} ${Si("",En(i," ")," ")}`+o},IntValue:{leave:({value:n})=>n},FloatValue:{leave:({value:n})=>n},StringValue:{leave:({value:n,block:e})=>e?function Awe(n,e){const t=n.replace(/"""/g,'\\"""'),i=t.split(/\r\n|[\n\r]/g),o=1===i.length,r=i.length>1&&i.slice(1).every(T=>0===T.length||_w(T.charCodeAt(0))),s=t.endsWith('\\"""'),l=n.endsWith('"')&&!s,h=n.endsWith("\\"),f=l||h,m=!(null!=e&&e.minimize)&&(!o||n.length>70||f||r||s);let b="";const A=o&&_w(n.charCodeAt(0));return(m&&!A||r)&&(b+="\n"),b+=t,(m||f)&&(b+="\n"),'"""'+b+'"""'}(n):function Twe(n){return`"${n.replace(Iwe,Swe)}"`}(n)},BooleanValue:{leave:({value:n})=>n?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:n})=>n},ListValue:{leave:({values:n})=>"["+En(n,", ")+"]"},ObjectValue:{leave:({fields:n})=>"{"+En(n,", ")+"}"},ObjectField:{leave:({name:n,value:e})=>n+": "+e},Directive:{leave:({name:n,arguments:e})=>"@"+n+Si("(",En(e,", "),")")},NamedType:{leave:({name:n})=>n},ListType:{leave:({type:n})=>"["+n+"]"},NonNullType:{leave:({type:n})=>n+"!"},SchemaDefinition:{leave:({description:n,directives:e,operationTypes:t})=>Si("",n,"\n")+En(["schema",En(e," "),Tc(t)]," ")},OperationTypeDefinition:{leave:({operation:n,type:e})=>n+": "+e},ScalarTypeDefinition:{leave:({description:n,name:e,directives:t})=>Si("",n,"\n")+En(["scalar",e,En(t," ")]," ")},ObjectTypeDefinition:{leave:({description:n,name:e,interfaces:t,directives:i,fields:o})=>Si("",n,"\n")+En(["type",e,Si("implements ",En(t," & ")),En(i," "),Tc(o)]," ")},FieldDefinition:{leave:({description:n,name:e,arguments:t,type:i,directives:o})=>Si("",n,"\n")+e+(pw(t)?Si("(\n",F7(En(t,"\n")),"\n)"):Si("(",En(t,", "),")"))+": "+i+Si(" ",En(o," "))},InputValueDefinition:{leave:({description:n,name:e,type:t,defaultValue:i,directives:o})=>Si("",n,"\n")+En([e+": "+t,Si("= ",i),En(o," ")]," ")},InterfaceTypeDefinition:{leave:({description:n,name:e,interfaces:t,directives:i,fields:o})=>Si("",n,"\n")+En(["interface",e,Si("implements ",En(t," & ")),En(i," "),Tc(o)]," ")},UnionTypeDefinition:{leave:({description:n,name:e,directives:t,types:i})=>Si("",n,"\n")+En(["union",e,En(t," "),Si("= ",En(i," | "))]," ")},EnumTypeDefinition:{leave:({description:n,name:e,directives:t,values:i})=>Si("",n,"\n")+En(["enum",e,En(t," "),Tc(i)]," ")},EnumValueDefinition:{leave:({description:n,name:e,directives:t})=>Si("",n,"\n")+En([e,En(t," ")]," ")},InputObjectTypeDefinition:{leave:({description:n,name:e,directives:t,fields:i})=>Si("",n,"\n")+En(["input",e,En(t," "),Tc(i)]," ")},DirectiveDefinition:{leave:({description:n,name:e,arguments:t,directives:i,repeatable:o,locations:r})=>Si("",n,"\n")+"directive @"+e+(pw(t)?Si("(\n",F7(En(t,"\n")),"\n)"):Si("(",En(t,", "),")"))+Si(" ",En(i," "))+(o?" repeatable":"")+" on "+En(r," | ")},SchemaExtension:{leave:({directives:n,operationTypes:e})=>En(["extend schema",En(n," "),Tc(e)]," ")},ScalarTypeExtension:{leave:({name:n,directives:e})=>En(["extend scalar",n,En(e," ")]," ")},ObjectTypeExtension:{leave:({name:n,interfaces:e,directives:t,fields:i})=>En(["extend type",n,Si("implements ",En(e," & ")),En(t," "),Tc(i)]," ")},InterfaceTypeExtension:{leave:({name:n,interfaces:e,directives:t,fields:i})=>En(["extend interface",n,Si("implements ",En(e," & ")),En(t," "),Tc(i)]," ")},UnionTypeExtension:{leave:({name:n,directives:e,types:t})=>En(["extend union",n,En(e," "),Si("= ",En(t," | "))]," ")},EnumTypeExtension:{leave:({name:n,directives:e,values:t})=>En(["extend enum",n,En(e," "),Tc(t)]," ")},InputObjectTypeExtension:{leave:({name:n,directives:e,fields:t})=>En(["extend input",n,En(e," "),Tc(t)]," ")},DirectiveExtension:{leave:({name:n,directives:e})=>En(["extend directive @"+n,En(e," ")]," ")},TypeCoordinate:{leave:({name:n})=>n},MemberCoordinate:{leave:({name:n,memberName:e})=>En([n,Si(".",e)])},ArgumentCoordinate:{leave:({name:n,fieldName:e,argumentName:t})=>En([n,Si(".",e),Si("(",t,":)")])},DirectiveCoordinate:{leave:({name:n})=>En(["@",n])},DirectiveArgumentCoordinate:{leave:({name:n,argumentName:e})=>En(["@",n,Si("(",e,":)")])}};function En(n,e=""){var t;return null!==(t=n?.filter(i=>i).join(e))&&void 0!==t?t:""}function Tc(n){return Si("{\n",F7(En(n,"\n")),"\n}")}function Si(n,e,t=""){return null!=e&&""!==e?n+e+t:""}function F7(n){return Si(" ",n.replace(/\n/g,"\n "))}function pw(n){var e;return null!==(e=n?.some(t=>t.includes("\n")))&&void 0!==e&&e}let R5;const k5=Object.assign(n=>{let e=R5.get(n);return e||(e=P7(n),R5.set(n,e)),e},{reset(){R5=new tw(fd.print||2e3)}});function Ro(n){return!(!n||"object"!=typeof n||"string"!=typeof n.__ref)}function O5(n={}){const{connector:e=()=>new Vn,resetOnError:t=!0,resetOnComplete:i=!0,resetOnRefCountZero:o=!0}=n;return r=>{let s,l,h,f=0,m=!1,b=!1;const A=()=>{l?.unsubscribe(),l=void 0},T=()=>{A(),s=h=void 0,m=b=!1},U=()=>{const K=s;T(),K?.unsubscribe()};return ia((K,ne)=>{f++,!b&&!m&&A();const ge=h=h??e();ne.add(()=>{f--,0===f&&!b&&!m&&(l=gw(U,o))}),ge.subscribe(ne),!s&&f>0&&(s=new vt({next:Me=>ge.next(Me),error:Me=>{b=!0,A(),l=gw(T,t,Me),ge.error(Me)},complete:()=>{m=!0,A(),l=gw(T,i),ge.complete()}}),dl(K).subscribe(s))})(r)}}function gw(n,e,...t){if(!0===e)return void n();if(!1===e)return;const i=new vt({next:()=>{i.unsubscribe(),n()}});return dl(e(...t)).subscribe(i)}function H7(n,e,t){let i,o=!1;return n&&"object"==typeof n?({bufferSize:i=1/0,windowTime:e=1/0,refCount:o=!1,scheduler:t}=n):i=n??1/0,O5({connector:()=>new V3(i,e,t),resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:o})}function kwe(n,e){return n===e}k5.reset();const YH=vH(function(e,t,i){return function Pwe(n,e){let t,i;function o(r){return r!==t&&(t=r,i=e(t)),i}return Object.assign(n.pipe(mo(o),H7({bufferSize:1,refCount:!0})),{getCurrentResult:()=>o(n.getCurrentResult())})}(e,i)},{max:1,makeCacheKey:n=>n.slice(0,2)});function B5(n=[]){const e={};return n.forEach(t=>{e[t.name.value]=t}),e}function P5(n){return n.definitions.filter(e=>"FragmentDefinition"===e.kind)}function U7(n,e){switch(n.kind){case"InlineFragment":return n;case"FragmentSpread":{const t=n.name.value;if("function"==typeof e)return e(t);const i=e&&e[t];return bn(i,9,t),i||null}default:return null}}function mw(n){let e;Vh(n);for(let t of n.definitions){if("OperationDefinition"===t.kind)return t;"FragmentDefinition"===t.kind&&!e&&(e=t)}if(e)return e;throw vl(12)}function F5(n){return"Field"===n.kind}function g1(n){return n.alias?n.alias.value:n.name.value}function z7({directives:n},e){return!n||!n.length||function Uwe(n){const e=[];return n&&n.length&&n.forEach(t=>{if(!function Hwe({name:{value:n}}){return"skip"===n||"include"===n}(t))return;const i=t.arguments,o=t.name.value;bn(i&&1===i.length,16,o);const r=i[0];bn(r.name&&"if"===r.name.value,17,o);const s=r.value;bn(s&&("Variable"===s.kind||"BooleanValue"===s.kind),18,o),e.push({directive:t,ifArgument:r})}),e}(n).every(({directive:t,ifArgument:i})=>{let o=!1;return"Variable"===i.value.kind?(o=e&&e[i.value.name.value],bn(void 0!==o,15,t.name.value)):o=i.value.value,"skip"===t.name.value?!o:o})}function KH(n,{data:e,...t},{data:i,...o},r){return sr(t,o)&&V7(mw(n).selectionSet,e,i,{fragmentMap:B5(P5(n)),variables:r})}function V7(n,e,t,i){if(e===t)return!0;const o=new Set;return n.selections.every(r=>{if(o.has(r)||(o.add(r),!z7(r,i.variables))||qH(r))return!0;if(F5(r)){const s=g1(r),l=e&&e[s],h=t&&t[s],f=r.selectionSet;if(!f)return sr(l,h);const m=Array.isArray(l),b=Array.isArray(h);if(m!==b)return!1;if(m&&b){const A=l.length;if(h.length!==A)return!1;for(let T=0;T<A;++T)if(!V7(f,l[T],h[T],i))return!1;return!0}return V7(f,l,h,i)}{const s=U7(r,i.fragmentMap);if(s)return!!qH(s)||V7(s.selectionSet,e,t,i)}})}function qH(n){return!!n.directives&&n.directives.some(zwe)}function zwe(n){return"nonreactive"===n.name.value}function Vwe(n,e){let t=e;const i=[];return n.definitions.forEach(r=>{if("OperationDefinition"===r.kind)throw vl(10,r.operation,r.name?` named '${r.name.value}'`:"");"FragmentDefinition"===r.kind&&i.push(r)}),typeof t>"u"&&(bn(1===i.length,11,i.length),t=i[0].name.value),{...n,definitions:[{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:t}}]}},...n.definitions]}}function jwe(...n){return UH.bind(null,...n)}class XH{assumeImmutableResults=!1;lookupFragment(e){return null}batch(e){let i;return this.performTransaction(()=>i=e.update(this),"string"==typeof e.optimistic?e.optimistic:!1===e.optimistic?null:void 0),i}recordOptimisticTransaction(e,t){this.performTransaction(e,t)}transformDocument(e){return e}transformForLink(e){return e}identify(e){}gc(){return[]}modify(e){return!1}readQuery(e,t=!!e.optimistic){return this.read({...e,rootId:e.id||"ROOT_QUERY",optimistic:t})}fragmentWatches=new fu(!0);watchFragment(e){const{fragment:t,fragmentName:i,from:o}=e,r=this.getFragmentDoc(t,i),l=(Array.isArray(o)?o:[o]).map(T=>null==T?T:this.toCacheId(T));if(!Array.isArray(o)){const T=this.watchSingleFragment(l[0],r,e);return null===o?T:YH(T,Symbol.for("apollo.transform.individualResult"),U=>({...U,data:U.data??{}}))}let h;function f(T){const U=T.reduce((K,ne,ge)=>(K.data.push(ne.data),K.complete&&=ne.complete,K.dataState=K.complete?"complete":"partial",ne.missing&&(K.missing||={},K.missing[ge]=ne.missing),K),{data:[],dataState:"complete",complete:!0});return sr(h,U)||(h=U),h}if(0===l.length)return Wwe;let m=!1;const b=l.map(T=>this.watchSingleFragment(T,r,e)),A=function Fwe(n){return 0===n.length?pd:new wn(e=>{const{length:t}=n,i=new Array(t),o=new Map;n.forEach((h,f)=>{o.has(h)||o.set(h,new Set),o.get(h).add(f)});let l,r=o.size,s=o.size;o.forEach((h,f)=>{let m=!1;const b=f.subscribe({next:A=>{h.forEach(T=>i[T]=A),m||(m=!0,s--),s||(l||=new Set(n.filter(T=>T.dirty)),l.delete(f),l.size||(e.next(i.slice()),l=void 0))},complete:()=>{r--,r||e.complete()},error:e.error.bind(e)});e.add(b)})})}(b).pipe(mo(f),l1({subscribe:()=>m=!0,unsubscribe:()=>m=!1}),H7({bufferSize:1,refCount:!0}));return Object.assign(A,{getCurrentResult:()=>m&&h?h:f(b.map(U=>U.getCurrentResult()))})}onAfterBroadcast=e=>e();watchSingleFragment(e,t,i){if(null===e)return Gwe;const{optimistic:o=!0,variables:r}=i,s=[t,vd({id:e,optimistic:o,variables:r})],l=this.fragmentWatches.lookupArray(s);if(!l.observable){let f,m=function(A){const T=A.result;return(!f||!KH(t,{data:f.data},{data:T},i.variables))&&(f={data:T,dataState:A.complete?"complete":"partial",complete:A.complete},A.missing&&(f.missing=A.missing.missing)),f},h=!1;const b=new wn(A=>{h=!0;const T=this.watch({variables:r,returnPartialData:!0,id:e,query:t,optimistic:o,immediate:!0,callback:U=>{b.dirty=!0,this.onAfterBroadcast(()=>{A.next(m(U)),b.dirty=!1})}});return()=>{h=!1,T(),this.fragmentWatches.removeArray(s)}}).pipe(function Rwe(n,e=Sn){return n=n??kwe,ia((t,i)=>{let o,r=!0;t.subscribe(Sa(i,s=>{const l=e(s);(r||!n(o,l))&&(r=!1,o=l,i.next(s))}))})}(),O5({connector:()=>new V3(1),resetOnRefCountZero:()=>function Bwe(n=0,e,t=U2e){let i=-1;return null!=e&&(_O(e)?t=e:i=e),new wn(o=>{let r=function Owe(n){return n instanceof Date&&!isNaN(n)}(n)?+n-t.now():n;r<0&&(r=0);let s=0;return t.schedule(function(){o.closed||(o.next(s++),0<=i?this.schedule(void 0,i):o.complete())},r)})}(0)}));l.observable=Object.assign(b,{dirty:!1,getCurrentResult:()=>h&&f?f:m(this.diff({id:e,query:t,returnPartialData:!0,optimistic:o,variables:r}))})}return l.observable}getFragmentDoc=L5(Vwe,{max:fd["cache.fragmentQueryDocuments"]||1e3,cache:k7,makeCacheKey:jwe(this)});readFragment(e,t=!!e.optimistic){const i=void 0!==e.from?this.toCacheId(e.from):e.id;return this.read({...e,query:this.getFragmentDoc(e.fragment,e.fragmentName),rootId:i,optimistic:t})}writeQuery({id:e,data:t,...i}){return this.write(Object.assign(i,{dataId:e||"ROOT_QUERY",result:t}))}writeFragment({data:e,fragment:t,fragmentName:i,...o}){const r=void 0!==o.from?this.toCacheId(o.from):o.id;return this.write(Object.assign(o,{query:this.getFragmentDoc(t,i),dataId:r,result:e}))}updateQuery(e,t){return this.batch({update(i){const o=i.readQuery(e),r=t(o);return null==r?o:(i.writeQuery({...e,data:r}),r)}})}updateFragment(e,t){return this.batch({update(i){const o=i.readFragment(e),r=t(o);return null==r?o:(i.writeFragment({...e,data:r}),r)}})}toCacheId(e){return"string"==typeof e?e:this.identify(e)}}const QH=Object.freeze({data:null,dataState:"complete",complete:!0}),Gwe=Object.assign(new wn(n=>{n.next(QH)}),{dirty:!1,getCurrentResult:()=>QH}),JH=Object.freeze({data:[],dataState:"complete",complete:!0}),Wwe=Object.assign(new wn(n=>{n.next(JH)}),{getCurrentResult:()=>JH});function qs(n){return null!==n&&"object"==typeof n}const{hasOwnProperty:$we}=Object.prototype,Zwe=function(n,e,t){return this.merge(n[t],e[t])},eU=n=>isNaN(+n)?{}:[];class Nf{options;reconciler;constructor(e={}){this.options=e,this.reconciler=e.reconciler||Zwe}merge(e,t,i={}){const o=i.atPath;if(o?.length){const[r,...s]=o;void 0===e&&(e=eU(r));let l=e[r];void 0===l&&s.length&&(l=eU(s[0]));const h=this.merge(l,t,{...i,atPath:s});return l!==h&&((e=this.shallowCopyForMerge(e))[r]=h),e}return Array.isArray(e)&&Array.isArray(t)&&"truncate"===this.options.arrayMerge&&e.length>t.length&&(e=e.slice(0,t.length),this.pastCopies.add(e)),qs(t)&&qs(e)?(Object.keys(t).forEach(r=>{if($we.call(e,r)){const s=e[r];if(t[r]!==s){const l=this.reconciler(e,t,r);l!==s&&((e=this.shallowCopyForMerge(e))[r]=l)}}else(e=this.shallowCopyForMerge(e))[r]=t[r]}),e):t}isObject=qs;pastCopies=new Set;shallowCopyForMerge(e){return qs(e)&&(this.pastCopies.has(e)||(e=Array.isArray(e)?e.slice(0):{__proto__:Object.getPrototypeOf(e),...e},this.pastCopies.add(e))),e}}function Lf(n){return{__ref:String(n)}}function m1(...n){const e={};return n.forEach(t=>{t&&Reflect.ownKeys(t).forEach(i=>{const o=t[i];void 0!==o&&(e[i]=o)})}),e}const Pr=Array.isArray,{hasOwnProperty:ms}=Object.prototype;function tU({__typename:n,id:e,_id:t},i){if("string"==typeof n&&(i&&(i.keyObject=null!=e?{id:e}:null!=t?{_id:t}:void 0),null==e&&null!=t&&(e=t),null!=e))return`${n}:${"number"==typeof e||"string"==typeof e?e:JSON.stringify(e)}`}const qwe={dataIdFromObject:tU,resultCaching:!0},nU=/^[_a-z][_0-9a-z]*/i;function Wh(n){const e=n.match(nU);return e?e[0]:n}function vw(n,e,t){return!!qs(e)&&(Pr(e)?e.every(i=>vw(n,i,t)):n.selections.every(i=>{if(F5(i)&&z7(i,t)){const o=g1(i);return ms.call(e,o)&&(!i.selectionSet||vw(i.selectionSet,e[o],t))}return!0}))}function Mf(n){return qs(n)&&!Ro(n)&&!Pr(n)}function iU(n,e){const t=B5(P5(n));return{fragmentMap:t,lookupFragment(i){let o=t[i];return!o&&e&&(o=e.lookup(i)),o||null}}}const G7={},bw=()=>G7,oU={};class W7{policies;group;data={};constructor(e,t){this.policies=e,this.group=t}toObject(){return{...this.data}}has(e){return void 0!==this.lookup(e,!0)}get(e,t){if(this.group.depend(e,t),ms.call(this.data,e)){const i=this.data[e];if(i&&ms.call(i,t))return i[t]}return"__typename"===t&&ms.call(this.policies.rootTypenamesById,e)?this.policies.rootTypenamesById[e]:this instanceof gu?this.parent.get(e,t):void 0}lookup(e,t){return t&&this.group.depend(e,"__exists"),ms.call(this.data,e)?this.data[e]:this instanceof gu?this.parent.lookup(e,t):this.policies.rootTypenamesById[e]?{}:void 0}merge(e,t){let i;Ro(e)&&(e=e.__ref),Ro(t)&&(t=t.__ref);const o="string"==typeof e?this.lookup(i=e):e,r="string"==typeof t?this.lookup(i=t):t;if(!r)return;bn("string"==typeof i,104);const s=new Nf({reconciler:nAe}).merge(o,r);if(this.data[i]=s,s!==o&&(delete this.refs[i],this.group.caching)){const l={};o||(l.__exists=1),Object.keys(r).forEach(h=>{if(!o||o[h]!==s[h]){l[h]=1;const f=Wh(h);f!==h&&!this.policies.hasKeyArgs(s.__typename,f)&&(l[f]=1),void 0===s[h]&&!(this instanceof gu)&&delete s[h]}}),l.__typename&&!(o&&o.__typename)&&this.policies.rootTypenamesById[i]===s.__typename&&delete l.__typename,Object.keys(l).forEach(h=>this.group.dirty(i,h))}}modify(e,t,i){const o=this.lookup(e);if(o){const r={};let s=!1,l=!0;const h={DELETE:G7,INVALIDATE:oU,isReference:Ro,toReference:this.toReference,canRead:this.canRead,readField:(f,m)=>this.policies.readField("string"==typeof f?{fieldName:f,from:m||Lf(e)}:f,{store:this})};if(Object.keys(o).forEach(f=>{const m=Wh(f);let b=o[f];if(void 0===b)return;const A="function"==typeof t?t:t[f]||(i?void 0:t[m]);if(A){let T=A===bw?G7:A(b,{...h,fieldName:m,storeFieldName:f,storage:this.getStorage(e,f)});if(T===oU)this.group.dirty(e,f);else if(T===G7&&(T=void 0),T!==b&&(r[f]=T,s=!0,b=T,false)){const U=K=>{if(void 0===this.lookup(K.__ref))return!0};if(Ro(T))U(T);else if(Array.isArray(T)){let ne,K=!1;for(const ge of T){if(Ro(ge)){if(K=!0,U(ge))break}else if("object"==typeof ge&&ge){const[Me]=this.policies.identify(ge);Me&&(ne=ge)}if(K&&void 0!==ne)break}}}}void 0!==b&&(l=!1)}),s)return this.merge(e,r),l&&(this instanceof gu?this.data[e]=void 0:delete this.data[e],this.group.dirty(e,"__exists")),!0}return!1}delete(e,t,i){const o=this.lookup(e);if(o){const r=this.getFieldValue(o,"__typename"),s=t&&i?this.policies.getStoreFieldName({typename:r,fieldName:t,args:i}):t;return this.modify(e,s?{[s]:bw}:bw,!!i)}return!1}evict(e,t){let i=!1;return e.id&&(ms.call(this.data,e.id)&&(i=this.delete(e.id,e.fieldName,e.args)),this instanceof gu&&this!==t&&(i=this.parent.evict(e,t)||i),(e.fieldName||i)&&this.group.dirty(e.id,e.fieldName||"__exists")),i}clear(){this.replace(null)}extract(){const e=this.toObject(),t=[];return this.getRootIdSet().forEach(i=>{ms.call(this.policies.rootTypenamesById,i)||t.push(i)}),t.length&&(e.__META={extraRootIds:t.sort()}),e}replace(e){if(Object.keys(this.data).forEach(t=>{e&&ms.call(e,t)||this.delete(t)}),e){const{__META:t,...i}=e;Object.keys(i).forEach(o=>{this.merge(o,i[o])}),t&&t.extraRootIds.forEach(this.retain,this)}}rootIds={};retain(e){return this.rootIds[e]=(this.rootIds[e]||0)+1}release(e){if(this.rootIds[e]>0){const t=--this.rootIds[e];return t||delete this.rootIds[e],t}return 0}getRootIdSet(e=new Set){return Object.keys(this.rootIds).forEach(e.add,e),this instanceof gu?this.parent.getRootIdSet(e):Object.keys(this.policies.rootTypenamesById).forEach(e.add,e),e}gc(){const e=this.getRootIdSet(),t=this.toObject();e.forEach(o=>{ms.call(t,o)&&(Object.keys(this.findChildRefIds(o)).forEach(e.add,e),delete t[o])});const i=Object.keys(t);if(i.length){let o=this;for(;o instanceof gu;)o=o.parent;i.forEach(r=>o.delete(r))}return i}refs={};findChildRefIds(e){if(!ms.call(this.refs,e)){const t=this.refs[e]={},i=this.data[e];if(!i)return t;const o=new Set([i]);o.forEach(r=>{Ro(r)&&(t[r.__ref]=!0),qs(r)&&Object.keys(r).forEach(s=>{const l=r[s];qs(l)&&o.add(l)})})}return this.refs[e]}makeCacheKey(){return this.group.keyMaker.lookupArray(arguments)}getFieldValue=(e,t)=>Ro(e)?this.get(e.__ref,t):e&&e[t];canRead=e=>Ro(e)?this.has(e.__ref):"object"==typeof e;toReference=(e,t)=>{if("string"==typeof e)return Lf(e);if(Ro(e))return e;const[i]=this.policies.identify(e);if(i){const o=Lf(i);return t&&this.merge(i,e),o}};get supportsResultCaching(){return this.group.caching}}class rU{caching;parent;d=null;keyMaker;constructor(e,t=null){this.caching=e,this.parent=t,this.resetCaching()}resetCaching(){this.d=this.caching?FH():null,this.keyMaker=new fu}depend(e,t){if(this.d){this.d(Cw(e,t));const i=Wh(t);i!==t&&this.d(Cw(e,i)),this.parent&&this.parent.depend(e,t)}}dirty(e,t){this.d&&this.d.dirty(Cw(e,t),"__exists"===t?"forget":"setDirty")}}function Cw(n,e){return e+"#"+n}function sU(n,e){H5(n)&&n.group.depend(e,"__exists")}W7.Root=class eAe extends W7{constructor({policies:e,resultCaching:t=!0,seed:i}){super(e,new rU(t)),i&&this.replace(i)}stump=new tAe(this);addLayer(e,t){return this.stump.addLayer(e,t)}removeLayer(){return this}storageTrie=new fu;getStorage(){return this.storageTrie.lookupArray(arguments)}};class gu extends W7{id;parent;replay;group;constructor(e,t,i,o){super(t.policies,o),this.id=e,this.parent=t,this.replay=i,this.group=o,i(this)}addLayer(e,t){return new gu(e,this,t,this.group)}removeLayer(e){const t=this.parent.removeLayer(e);return e===this.id?(this.group.caching&&Object.keys(this.data).forEach(i=>{const o=this.data[i],r=t.lookup(i);r?o?o!==r&&Object.keys(o).forEach(s=>{sr(o[s],r[s])||this.group.dirty(i,s)}):(this.group.dirty(i,"__exists"),Object.keys(r).forEach(s=>{this.group.dirty(i,s)})):this.delete(i)}),t):t===this.parent?this:t.addLayer(this.id,this.replay)}toObject(){return{...this.parent.toObject(),...this.data}}findChildRefIds(e){const t=this.parent.findChildRefIds(e);return ms.call(this.data,e)?{...t,...super.findChildRefIds(e)}:t}getStorage(...e){let t=this.parent;for(;t.parent;)t=t.parent;return t.getStorage(...e)}}class tAe extends gu{constructor(e){super("EntityStore.Stump",e,()=>{},new rU(e.group.caching,e.group))}removeLayer(){return this}merge(e,t){return this.parent.merge(e,t)}}function nAe(n,e,t){const i=n[t],o=e[t];return sr(i,o)?i:o}function H5(n){return!(!n||!n.supportsResultCaching)}const yw=new O7;function iAe(n){const e=n.directives?.find(({name:i})=>"unmask"===i.value);if(!e)return"mask";const t=e.arguments?.find(({name:i})=>"mode"===i.value);return t&&"value"in t.value&&"migrate"===t.value.value?"migrate":"unmask"}const aU=Symbol.for("apollo.result.extensions"),$h=Symbol.for("apollo.result.streamInfo"),oAe=Symbol.for("apollo.observableQuery.variablesUnknown");function Rf(n,e,t,i){if(t.kind===_n.INT||t.kind===_n.FLOAT)n[e.value]=Number(t.value);else if(t.kind===_n.BOOLEAN||t.kind===_n.STRING)n[e.value]=t.value;else if(t.kind===_n.OBJECT){const o={};t.fields.map(r=>Rf(o,r.name,r.value,i)),n[e.value]=o}else if(t.kind===_n.VARIABLE)n[e.value]=(i||{})[t.name.value];else if(t.kind===_n.LIST)n[e.value]=t.values.map(o=>{const r={};return Rf(r,e,o,i),r[e.value]});else if(t.kind===_n.ENUM)n[e.value]=t.value;else{if(t.kind!==_n.NULL)throw vl(19,e.value,t.kind);n[e.value]=null}}function ww(n,e){if(n.arguments&&n.arguments.length){const t={};return n.arguments.forEach(({name:i,value:o})=>Rf(t,i,o,e)),t}return null}const rAe=["connection","include","skip","client","rest","export","nonreactive","stream"];let U5=vd;const lU=Object.assign(function(n,e,t){if(e&&t&&t.connection&&t.connection.key){if(t.connection.filter&&t.connection.filter.length>0){const o=t.connection.filter?t.connection.filter:[];o.sort();const r={};o.forEach(l=>{r[l]=e[l]});const s=U5(r);if("{}"!==s)return`${t.connection.key}(${s})`}return t.connection.key}let i=n;if(e){const o=U5(e);"{}"!==o&&(i+=`(${o})`)}return t&&Object.keys(t).forEach(o=>{-1===rAe.indexOf(o)&&(t[o]&&Object.keys(t[o]).length?i+=`@${o}(${U5(t[o])})`:i+=`@${o}`)}),i},{setStringify(n){const e=U5;return U5=n,e}});function Aw(n){return Array.isArray(n)&&n.length>0}const cU={};function Tw(n){const e=JSON.stringify(n);return cU[e]||(cU[e]={})}function uU(n){const e=Tw(n);return e.keyFieldsFn||(e.keyFieldsFn=(t,i)=>{const o=(s,l)=>i.readField(l,s),r=i.keyObject=Iw(n,s=>{let l=kf(i.storeObject,s,o);return void 0===l&&t!==i.storeObject&&ms.call(t,s[0])&&(l=kf(t,s,_U)),bn(void 0!==l,107,s.join("."),t),l});return`${i.typename}:${JSON.stringify(r)}`})}function dU(n){const e=Tw(n);return e.keyArgsFn||(e.keyArgsFn=(t,{field:i,variables:o,fieldName:r})=>{const s=Iw(n,h=>{const f=h[0],m=f.charAt(0);if("@"!==m){if("$"===m){const b=f.slice(1);if(o&&ms.call(o,b)){const A=h.slice(0);return A[0]=b,kf(o,A)}return}if(t)return kf(t,h)}else if(i&&Aw(i.directives)){const b=f.slice(1),A=i.directives.find(U=>U.name.value===b),T=A&&ww(A,o);return T&&kf(T,h.slice(1))}}),l=JSON.stringify(s);return(t||"{}"!==l)&&(r+=":"+l),r})}function Iw(n,e){const t=new Nf;return hU(n).reduce((i,o)=>{let r=e(o);if(void 0!==r){for(let s=o.length-1;s>=0;--s)r={[o[s]]:r};i=t.merge(i,r)}return i},{})}function hU(n){const e=Tw(n);if(!e.paths){const t=e.paths=[],i=[];n.forEach((o,r)=>{Pr(o)?(hU(o).forEach(s=>t.push(i.concat(s))),i.length=0):(i.push(o),Pr(n[r+1])||(t.push(i.slice(0)),i.length=0))})}return e.paths}function _U(n,e){return n[e]}function kf(n,e,t){return t=t||_U,pU(e.reduce(function i(o,r){return Pr(o)?o.map(s=>i(s,r)):o&&t(o,r)},n))}function pU(n){return qs(n)?Pr(n)?n.map(pU):Iw(Object.keys(n).sort(),e=>kf(n,e)):n}const fU=new O7,gU=new WeakMap;function z5(n){let e=gU.get(n);return e||gU.set(n,e={vars:new Set,dep:FH()}),e}function mU(n){z5(n).vars.forEach(e=>e.forgetCache(n))}function lAe(n){const e=new Set,t=new Set,i=function(r){if(arguments.length>0){if(n!==r){n=r,e.forEach(l=>{z5(l).dep.dirty(i),function cAe(n){n.broadcastWatches&&n.broadcastWatches()}(l)});const s=Array.from(t);t.clear(),s.forEach(l=>l(n))}}else{const s=fU.getValue();s&&(o(s),z5(s).dep(i))}return n};i.onNextChange=r=>(t.add(r),()=>{t.delete(r)});const o=i.attachCache=r=>(e.add(r),z5(r).vars.add(i),i);return i.forgetCache=r=>e.delete(r),i}function Sw(n){return void 0!==n.args?n.args:n.field?ww(n.field,n.variables):null}const uAe=()=>{},vU=(n,e)=>e.fieldName,bU=(n,e,{mergeObjects:t})=>t(n,e),CU=(n,e)=>e,dAe=(n,e,{streamFieldInfo:t,existingData:i})=>{if(!n&&!i)return e;const o=[],r=n??i,s=t?.isLastChunk?e.length:Math.max(r.length,e.length);for(let l=0;l<s;l++)o[l]=void 0===e[l]?r[l]:e[l];return o};class hAe{config;typePolicies={};toBeAdded={};supertypeMap=new Map;fuzzySubtypes=new Map;cache;rootIdsByTypename={};rootTypenamesById={};usingPossibleTypes=!1;constructor(e){this.config=e,this.config={dataIdFromObject:tU,...e},this.cache=this.config.cache,this.setRootTypename("Query"),this.setRootTypename("Mutation"),this.setRootTypename("Subscription"),e.possibleTypes&&this.addPossibleTypes(e.possibleTypes),e.typePolicies&&this.addTypePolicies(e.typePolicies)}identify(e,t){const i=this,o=t&&(t.typename||t.storeObject?.__typename)||e.__typename;if(o===this.rootTypenamesById.ROOT_QUERY)return["ROOT_QUERY"];const r=t&&t.storeObject||e,s={...t,typename:o,storeObject:r,readField:t&&t.readField||((...m)=>{const b=Ew(m,r);return i.readField(b,{store:i.cache.data,variables:b.variables})})};let l;const h=o&&this.getTypePolicy(o);let f=h&&h.keyFn||this.config.dataIdFromObject;return yw.withValue(!0,()=>{for(;f;){const m=f({...e,...r},s);if(!Pr(m)){l=m;break}f=uU(m)}}),l=l?String(l):void 0,s.keyObject?[l,s.keyObject]:[l]}addTypePolicies(e){Object.keys(e).forEach(t=>{const{queryType:i,mutationType:o,subscriptionType:r,...s}=e[t];i&&this.setRootTypename("Query",t),o&&this.setRootTypename("Mutation",t),r&&this.setRootTypename("Subscription",t),ms.call(this.toBeAdded,t)?this.toBeAdded[t].push(s):this.toBeAdded[t]=[s]})}updateTypePolicy(e,t,i){const o=this.getTypePolicy(e),{keyFields:r,fields:s}=t;function l(h,f){h.merge="function"==typeof f?f:!0===f?bU:!1===f?CU:h.merge}l(o,t.merge),o.keyFn=!1===r?uAe:Pr(r)?uU(r):"function"==typeof r?r:o.keyFn,s&&Object.keys(s).forEach(h=>{let f=i[h];(!f||f?.typename!==e)&&(f=i[h]={typename:e});const m=s[h];if("function"==typeof m)f.read=m;else{const{keyArgs:b,read:A,merge:T}=m;f.keyFn=!1===b?vU:Pr(b)?dU(b):"function"==typeof b?b:f.keyFn,"function"==typeof A&&(f.read=A),l(f,T)}f.read&&f.merge&&(f.keyFn=f.keyFn||vU)})}setRootTypename(e,t=e){const i="ROOT_"+e.toUpperCase(),o=this.rootTypenamesById[i];t!==o&&(bn(!o||o===e,108,e),o&&delete this.rootIdsByTypename[o],this.rootIdsByTypename[t]=i,this.rootTypenamesById[i]=t)}addPossibleTypes(e){this.usingPossibleTypes=!0,Object.keys(e).forEach(t=>{this.getSupertypeSet(t,!0),e[t].forEach(i=>{this.getSupertypeSet(i,!0).add(t);const o=i.match(nU);(!o||o[0]!==i)&&this.fuzzySubtypes.set(i,new RegExp(i))})})}getTypePolicy(e){if(!ms.call(this.typePolicies,e)){const i=this.typePolicies[e]={};i.fields={};let o=this.supertypeMap.get(e);!o&&this.fuzzySubtypes.size&&(o=this.getSupertypeSet(e,!0),this.fuzzySubtypes.forEach((r,s)=>{if(r.test(e)){const l=this.supertypeMap.get(s);l&&l.forEach(h=>o.add(h))}})),o&&o.size&&o.forEach(r=>{const{fields:s,...l}=this.getTypePolicy(r);Object.assign(i,l),Object.assign(i.fields,s)})}const t=this.toBeAdded[e];return t&&t.length&&t.splice(0).forEach(i=>{this.updateTypePolicy(e,i,this.typePolicies[e].fields)}),this.typePolicies[e]}getFieldPolicy(e,t){if(e)return this.getTypePolicy(e).fields[t]}getSupertypeSet(e,t){let i=this.supertypeMap.get(e);return!i&&t&&this.supertypeMap.set(e,i=new Set),i}fragmentMatches(e,t,i,o){if(!e.typeCondition)return!0;if(!t)return!1;const r=e.typeCondition.name.value;if(t===r)return!0;if(this.usingPossibleTypes&&this.supertypeMap.has(r)){const s=this.getSupertypeSet(t,!0),l=[s],h=b=>{const A=this.getSupertypeSet(b,!1);A&&A.size&&l.indexOf(A)<0&&l.push(A)};let f=!(!i||!this.fuzzySubtypes.size),m=!1;for(let b=0;b<l.length;++b){const A=l[b];if(A.has(r))return s.has(r)||s.add(r),!0;A.forEach(h),f&&b===l.length-1&&vw(e.selectionSet,i,o)&&(f=!1,m=!0,this.fuzzySubtypes.forEach((T,U)=>{const K=t.match(T);K&&K[0]===t&&h(U)}))}}return!1}hasKeyArgs(e,t){const i=this.getFieldPolicy(e,t);return!(!i||!i.keyFn)}getStoreFieldName(e){const{typename:t,fieldName:i}=e,o=this.getFieldPolicy(t,i);let r,s=o&&o.keyFn;if(s&&t){const l={typename:t,fieldName:i,field:e.field||null,variables:e.variables},h=Sw(e);for(;s;){const f=s(h,l);if(!Pr(f)){r=f||i;break}s=dU(f)}}return void 0===r&&(r=e.field?function sAe(n,e){let t=null;n.directives&&(t={},n.directives.forEach(o=>{t[o.name.value]={},o.arguments&&o.arguments.forEach(({name:r,value:s})=>Rf(t[o.name.value],r,s,e))}));let i=null;return n.arguments&&n.arguments.length&&(i={},n.arguments.forEach(({name:o,value:r})=>Rf(i,o,r,e))),lU(n.name.value,i,t)}(e.field,e.variables):lU(i,Sw(e))),!1===r?i:i===Wh(r)?r:i+":"+r}readField(e,t){const i=e.from;if(!i||!e.field&&!e.fieldName)return;if(void 0===e.typename){const m=t.store.getFieldValue(i,"__typename");m&&(e.typename=m)}const r=this.getStoreFieldName(e),s=Wh(r),l=t.store.getFieldValue(i,r),h=this.getFieldPolicy(e.typename,s),f=h&&h.read;if(f){const m=yU(this,i,e,t,t.store.getStorage(Ro(i)?i.__ref:i,r));return fU.withValue(this.cache,f,[l,m])}return l}getReadFunction(e,t){const i=this.getFieldPolicy(e,t);return i&&i.read}getMergeFunction(e,t,i){let o=this.getFieldPolicy(e,t),r=o&&o.merge;return!r&&i&&(o=this.getTypePolicy(i),r=o&&o.merge),r}runMergeFunction(e,t,{field:i,typename:o,merge:r,path:s},l,h){const f=e;if(r===bU)return wU(l.store)(e,t);if(r===CU)return t;l.overwrite&&(e=void 0);const m=l.extensions?.[$h]?.deref()?.peekArray(s);if(m){const{current:A,previous:T}=m;if(T&&sr(T.incoming,t)&&sr(T.streamFieldInfo,A))return T.result}const b=r(e,t,function _Ae(n,e,t,i,o,r){const s={...yU(n,e,t,i,o),extensions:i.extensions,existingData:r},l=i.extensions;if(l&&$h in l){const{[$h]:h,...f}=l,m=h?.deref()?.peekArray(t.path);m&&(s.streamFieldInfo=m.current),s.extensions=0===Object.keys(f).length?void 0:f}return s}(this,void 0,{typename:o,fieldName:i.name.value,field:i,variables:l.variables,path:s},l,h||{},f));return m&&(m.previous={incoming:t,streamFieldInfo:m.current,result:b}),b}}function yU(n,e,t,i,o){const r=n.getStoreFieldName(t),s=Wh(r),l=t.variables||i.variables,{toReference:h,canRead:f}=i.store;return{args:Sw(t),field:t.field||null,fieldName:s,storeFieldName:r,variables:l,isReference:Ro,toReference:h,storage:o,cache:n.cache,canRead:f,readField:(...m)=>n.readField(Ew(m,e,l),i),mergeObjects:wU(i.store)}}function Ew(n,e,t){const{0:i,1:o,length:r}=n;let s;return"string"==typeof i?s={fieldName:i,from:r>1?o:e}:(s={...i},ms.call(s,"from")||(s.from=e)),void 0===s.variables&&(s.variables=t),s}function wU(n){return function(t,i){if(Pr(t)||Pr(i))throw vl(111);if(qs(t)&&qs(i)){const o=n.getFieldValue(t,"__typename"),r=n.getFieldValue(i,"__typename");if(o&&r&&o!==r)return i;if(Ro(t)&&Mf(i))return n.merge(t.__ref,i),t;if(Mf(t)&&Ro(i))return n.merge(t,i.__ref),i;if(Mf(t)&&Mf(i))return{...t,...i}}return i}}function xw(n){const e={},t=n&&n.variableDefinitions;return t&&t.length&&t.forEach(i=>{i.defaultValue&&Rf(e,i.variable.name,i.defaultValue)}),e}function AU(n){const e=gd(n);return bn(e&&"query"===e.operation,13),e}function pAe(n){let e=n[0]||{};const t=n.length;if(t>1){const i=new Nf;for(let o=1;o<t;++o)e=i.merge(e,n[o])}return e}class Dw extends Error{message;path;query;variables;constructor(e,t,i,o){if(super(e),this.message=e,this.path=t,this.query=i,this.variables=o,this.name="MissingFieldError",Array.isArray(this.path)){this.missing=this.message;for(let r=this.path.length-1;r>=0;--r)this.missing={[this.path[r]]:this.missing}}else this.missing=this.path;this.__proto__=Dw.prototype}missing}function TU(n){return[n.selectionSet,n.objectOrReference,n.context]}class fAe{executeSelectionSet;executeSubSelectedArray;config;knownResults=new WeakMap;constructor(e){this.config=e,this.executeSelectionSet=L5(t=>{const i=TU(t);return this.executeSelectionSet.peek(...i)||(sU(t.context.store,t.enclosingRef.__ref),this.execSelectionSetImpl(t))},{max:fd["inMemoryCache.executeSelectionSet"]||5e4,keyArgs:TU,makeCacheKey(t,i,o){if(H5(o.store))return o.store.makeCacheKey(t,Ro(i)?i.__ref:i,o.varString)}}),this.executeSubSelectedArray=L5(t=>(sU(t.context.store,t.enclosingRef.__ref),this.execSubSelectedArrayImpl(t)),{max:fd["inMemoryCache.executeSubSelectedArray"]||1e4,makeCacheKey({field:t,array:i,context:o}){if(H5(o.store))return o.store.makeCacheKey(t,i,o.varString)}})}diffQueryAgainstStore({store:e,query:t,rootId:i="ROOT_QUERY",variables:o,returnPartialData:r=!0}){const s=this.config.cache.policies;o={...xw(AU(t)),...o};const l=Lf(i),h=this.executeSelectionSet({selectionSet:mw(t).selectionSet,objectOrReference:l,enclosingRef:l,context:{store:e,query:t,policies:s,variables:o,varString:vd(o),...iU(t,this.config.fragments)}});let f;h.missing&&(f=new Dw(function gAe(n){try{JSON.stringify(n,(e,t)=>{if("string"==typeof t)throw t;return t})}catch(e){return e}}(h.missing),h.missing,t,o));const m=!f,{result:b}=h;return{result:m?b:r?0===Object.keys(b).length?null:b:null,complete:m,missing:f}}isFresh(e,t,i,o){if(H5(o.store)&&this.knownResults.get(e)===i){const r=this.executeSelectionSet.peek(i,t,o);if(r&&e===r.result)return!0}return!1}execSelectionSetImpl({selectionSet:e,objectOrReference:t,enclosingRef:i,context:o}){if(Ro(t)&&!o.policies.rootTypenamesById[t.__ref]&&!o.store.has(t.__ref))return{result:{},missing:`Dangling reference to missing ${t.__ref} object`};const{variables:r,policies:s,store:l}=o,h=l.getFieldValue(t,"__typename"),f=[];let m;const b=new Nf;function A(ge,Me){return ge.missing&&(m=b.merge(m,{[Me]:ge.missing})),ge.result}"string"==typeof h&&!s.rootIdsByTypename[h]&&f.push({__typename:h});const T=new Set(e.selections);T.forEach(ge=>{if(z7(ge,r))if(F5(ge)){let Me=s.readField({fieldName:ge.name.value,field:ge,variables:o.variables,from:t},o);const Ct=g1(ge);void 0===Me?cw.added(ge)||(m=b.merge(m,{[Ct]:`Can't find field '${ge.name.value}' on ${Ro(t)?t.__ref+" object":"object "+JSON.stringify(t,null,2)}`})):Pr(Me)?Me.length>0&&(Me=A(this.executeSubSelectedArray({field:ge,array:Me,enclosingRef:i,context:o}),Ct)):ge.selectionSet&&null!=Me&&(Me=A(this.executeSelectionSet({selectionSet:ge.selectionSet,objectOrReference:Me,enclosingRef:Ro(Me)?Me:i,context:o}),Ct)),void 0!==Me&&f.push({[Ct]:Me})}else{const Me=U7(ge,o.lookupFragment);if(!Me&&ge.kind===_n.FRAGMENT_SPREAD)throw vl(112,ge.name.value);Me&&s.fragmentMatches(Me,h)&&Me.selectionSet.selections.forEach(T.add,T)}});const ne={result:pAe(f),missing:m};return ne.result&&this.knownResults.set(ne.result,e),ne}execSubSelectedArrayImpl({field:e,array:t,enclosingRef:i,context:o}){let r,s=new Nf;function l(h,f){return h.missing&&(r=s.merge(r,{[f]:h.missing})),h.result}return e.selectionSet&&(t=t.filter(h=>void 0===h||o.store.canRead(h))),{result:t=t.map((h,f)=>null===h?null:Pr(h)?l(this.executeSubSelectedArray({field:e,array:h,enclosingRef:i,context:o}),f):e.selectionSet?l(this.executeSelectionSet({selectionSet:e.selectionSet,objectOrReference:h,enclosingRef:Ro(h)?h:i,context:o}),f):h),missing:r}}}function Lw(n,e,t){const i=`${e}${t}`;let o=n.flavors.get(i);return o||n.flavors.set(i,o=n.clientOnly===e&&n.deferred===t?n:{...n,clientOnly:e,deferred:t}),o}class CAe{cache;reader;fragments;constructor(e,t,i){this.cache=e,this.reader=t,this.fragments=i}writeToStore(e,{query:t,result:i,dataId:o,variables:r,overwrite:s,extensions:l}){const h=gd(t),f=function Jwe(){return new Nf}();r={...xw(h),...r};const m={store:e,written:{},merge:(A,T)=>f.merge(A,T),variables:r,varString:vd(r),...iU(t,this.fragments),overwrite:!!s,incomingById:new Map,clientOnly:!1,deferred:!1,flavors:new Map,extensions:l},b=this.processSelectionSet({result:i||{},dataId:o,selectionSet:h.selectionSet,mergeTree:{map:new Map},context:m,path:[]});if(!Ro(b))throw vl(114,i);return m.incomingById.forEach(({storeObject:A,mergeTree:T},K)=>{const ne=Lf(K);if(T&&T.map.size){const ge=this.applyMerges(T,ne,A,m);if(Ro(ge))return;A=ge}e.merge(K,A)}),e.retain(b.__ref),b}processSelectionSet({dataId:e,result:t,selectionSet:i,context:o,mergeTree:r,path:s}){const{policies:l}=this.cache;let h={};const f=e&&l.rootTypenamesById[e]||Rw(t,i,o.fragmentMap)||e&&o.store.get(e,"__typename");"string"==typeof f&&(h.__typename=f);const m=(...A)=>{const T=Ew(A,h,o.variables);if(Ro(T.from)){const U=o.incomingById.get(T.from.__ref);if(U){const K=l.readField({...T,from:U.storeObject},o);if(void 0!==K)return K}}return l.readField(T,o)},b=new Set;this.flattenFields(i,t,o,f).forEach((A,T)=>{const U=g1(T),K=t[U],ne=[...s,T.name.value];if(b.add(T),void 0!==K){const ge=l.getStoreFieldName({typename:f,fieldName:T.name.value,field:T,variables:A.variables}),Me=SU(r,ge);let Nt,Ct=this.processFieldValue(K,T,T.selectionSet?Lw(A,!1,!1):A,Me,ne);T.selectionSet&&(Ro(Ct)||Mf(Ct))&&(Nt=m("__typename",Ct));const Zt=l.getMergeFunction(f,T.name.value,Nt);Zt?Me.info={field:T,typename:f,merge:Zt,path:ne}:A.extensions?.[$h]&&Array.isArray(Ct)&&function yAe(n){return!!n.directives&&n.directives.some(e=>"stream"===e.name.value)}(T)?Me.info={field:T,typename:f,merge:dAe,path:ne}:EU(r,ge),h=A.merge(h,{[ge]:Ct})}});try{const[A,T]=l.identify(t,{typename:f,selectionSet:i,fragmentMap:o.fragmentMap,storeObject:h,readField:m});e=e||A,T&&(h=o.merge(h,T))}catch(A){if(!e)throw A}if("string"==typeof e){const A=Lf(e),T=o.written[e]||(o.written[e]=[]);if(T.indexOf(i)>=0||(T.push(i),this.reader&&this.reader.isFresh(t,A,i,o)))return A;const U=o.incomingById.get(e);return U?(U.storeObject=o.merge(U.storeObject,h),U.mergeTree=Mw(U.mergeTree,r),b.forEach(K=>U.fieldNodeSet.add(K))):o.incomingById.set(e,{storeObject:h,mergeTree:$7(r)?void 0:r,fieldNodeSet:b}),A}return h}processFieldValue(e,t,i,o,r){return t.selectionSet&&null!==e?Pr(e)?e.map((s,l)=>{const h=this.processFieldValue(s,t,i,SU(o,l),[...r,l]);return EU(o,l),h}):this.processSelectionSet({result:e,selectionSet:t.selectionSet,context:i,mergeTree:o,path:r}):e}flattenFields(e,t,i,o=Rw(t,e,i.fragmentMap)){const r=new Map,{policies:s}=this.cache,l=new fu(!1);return function h(f,m){const b=l.lookup(f,m.clientOnly,m.deferred);b.visited||(b.visited=!0,f.selections.forEach(A=>{if(!z7(A,i.variables))return;let{clientOnly:T,deferred:U}=m;if(!(T&&U)&&Aw(A.directives)&&A.directives.forEach(K=>{const ne=K.name.value;if("client"===ne&&(T=!0),"defer"===ne){const ge=ww(K,i.variables);(!ge||!1!==ge.if)&&(U=!0)}}),F5(A)){const K=r.get(A);K&&(T=T&&K.clientOnly,U=U&&K.deferred),r.set(A,Lw(i,T,U))}else{const K=U7(A,i.lookupFragment);if(!K&&A.kind===_n.FRAGMENT_SPREAD)throw vl(116,A.name.value);K&&s.fragmentMatches(K,o,t,i.variables)&&h(K.selectionSet,Lw(i,T,U))}}))}(e,i),r}applyMerges(e,t,i,o,r){if(e.map.size&&!Ro(i)){const s=Pr(i)||!Ro(t)&&!Mf(t)?void 0:t,l=i;let h;s&&!r&&(r=[Ro(s)?s.__ref:s]);const f=(m,b)=>Pr(m)?"number"==typeof b?m[b]:void 0:o.store.getFieldValue(m,String(b));e.map.forEach((m,b)=>{const A=f(s,b),T=f(l,b);if(void 0===T)return;r&&r.push(b);const U=this.applyMerges(m,A,T,o,r);U!==T&&(h=h||new Map,h.set(b,U)),r&&bn(r.pop()===b)}),h&&(i=Pr(l)?l.slice(0):{...l},h.forEach((m,b)=>{i[b]=m}))}return e.info?this.cache.policies.runMergeFunction(t,i,e.info,o,r&&o.store.getStorage(...r)):i}}const IU=[];function SU({map:n},e){return n.has(e)||n.set(e,IU.pop()||{map:new Map}),n.get(e)}function Mw(n,e){if(n===e||!e||$7(e))return n;if(!n||$7(n))return e;const t=n.info&&e.info?{...n.info,...e.info}:n.info||e.info,i=n.map.size&&e.map.size,r={info:t,map:i?new Map:n.map.size?n.map:e.map};if(i){const s=new Set(e.map.keys());n.map.forEach((l,h)=>{r.map.set(h,Mw(l,e.map.get(h))),s.delete(h)}),s.forEach(l=>{r.map.set(l,Mw(e.map.get(l),n.map.get(l)))})}return r}function $7(n){return!n||!(n.info||n.map.size)}function EU({map:n},e){const t=n.get(e);t&&$7(t)&&(IU.push(t),n.delete(e))}function Rw(n,e,t){let i;for(const o of e.selections)if(F5(o)){if("__typename"===o.name.value)return n[g1(o)]}else i?i.push(o):i=[o];if("string"==typeof n.__typename)return n.__typename;if(i)for(const o of i){const r=Rw(n,U7(o,t).selectionSet,t);if("string"==typeof r)return r}}class DU extends XH{data;optimisticData;config;watches=new Set;storeReader;storeWriter;addTypenameTransform=new md(cw);maybeBroadcastWatch;assumeImmutableResults=!0;policies;makeVar=lAe;constructor(e={}){super(),this.config=function Xwe(n){return m1(qwe,n)}(e),this.policies=new hAe({cache:this,dataIdFromObject:this.config.dataIdFromObject,possibleTypes:this.config.possibleTypes,typePolicies:this.config.typePolicies}),this.init()}init(){const e=this.data=new W7.Root({policies:this.policies,resultCaching:this.config.resultCaching});this.optimisticData=e.stump,this.resetResultCache()}resetResultCache(){const{fragments:e}=this.config;this.addTypenameTransform.resetCache(),e?.resetCaches(),this.storeWriter=new CAe(this,this.storeReader=new fAe({cache:this,fragments:e}),e),this.maybeBroadcastWatch=L5((t,i)=>this.broadcastWatch(t,i),{max:fd["inMemoryCache.maybeBroadcastWatch"]||5e3,makeCacheKey:t=>{const i=t.optimistic?this.optimisticData:this.data;if(H5(i)){const{optimistic:o,id:r,variables:s}=t;return i.makeCacheKey(t.query,t.callback,vd({optimistic:o,id:r,variables:s}))}}}),new Set([this.data.group,this.optimisticData.group]).forEach(t=>t.resetCaching())}restore(e){return this.init(),e&&this.data.replace(e),this}extract(e=!1){return(e?this.optimisticData:this.data).extract()}read(e){const{returnPartialData:t=!1}=e;return this.storeReader.diffQueryAgainstStore({...e,store:e.optimistic?this.optimisticData:this.data,config:this.config,returnPartialData:t}).result}write(e){try{return++this.txCount,this.storeWriter.writeToStore(this.data,e)}finally{! --this.txCount&&!1!==e.broadcast&&this.broadcastWatches()}}modify(e){if(ms.call(e,"id")&&!e.id)return!1;const t=e.optimistic?this.optimisticData:this.data;try{return++this.txCount,t.modify(e.id||"ROOT_QUERY",e.fields,!1)}finally{! --this.txCount&&!1!==e.broadcast&&this.broadcastWatches()}}diff(e){return this.storeReader.diffQueryAgainstStore({...e,store:e.optimistic?this.optimisticData:this.data,rootId:e.id||"ROOT_QUERY",config:this.config})}watch(e){return this.watches.size||function aAe(n){z5(n).vars.forEach(e=>e.attachCache(n))}(this),this.watches.add(e),e.immediate&&this.maybeBroadcastWatch(e),()=>{this.watches.delete(e)&&!this.watches.size&&mU(this),this.maybeBroadcastWatch.forget(e)}}gc(e){vd.reset(),k5.reset();const t=this.optimisticData.gc();return e&&!this.txCount&&e.resetResultCache&&this.resetResultCache(),t}retain(e,t){return(t?this.optimisticData:this.data).retain(e)}release(e,t){return(t?this.optimisticData:this.data).release(e)}identify(e){if(Ro(e))return e.__ref;try{return this.policies.identify(e)[0]}catch(t){}}evict(e){if(!e.id){if(ms.call(e,"id"))return!1;e={...e,id:"ROOT_QUERY"}}try{return++this.txCount,this.optimisticData.evict(e,this.data)}finally{! --this.txCount&&!1!==e.broadcast&&this.broadcastWatches()}}reset(e){return this.init(),vd.reset(),e&&e.discardWatches?(this.watches.forEach(t=>this.maybeBroadcastWatch.forget(t)),this.watches.clear(),mU(this)):this.broadcastWatches(),Promise.resolve()}removeOptimistic(e){const t=this.optimisticData.removeLayer(e);t!==this.optimisticData&&(this.optimisticData=t,this.broadcastWatches())}txCount=0;batch(e){const{update:t,optimistic:i=!0,removeOptimistic:o,onWatchUpdated:r}=e;let s;const l=f=>{const{data:m,optimisticData:b}=this;++this.txCount,f&&(this.data=this.optimisticData=f);try{return s=t(this)}finally{--this.txCount,this.data=m,this.optimisticData=b}},h=new Set;return r&&!this.txCount&&this.broadcastWatches({...e,onWatchUpdated:f=>(h.add(f),!1)}),"string"==typeof i?this.optimisticData=this.optimisticData.addLayer(i,l):!1===i?l(this.data):l(),"string"==typeof o&&(this.optimisticData=this.optimisticData.removeLayer(o)),r&&h.size?(this.broadcastWatches({...e,onWatchUpdated(f,m){const b=r.call(this,f,m);return!1!==b&&h.delete(f),b}}),h.size&&h.forEach(f=>this.maybeBroadcastWatch.dirty(f))):this.broadcastWatches(e),s}performTransaction(e,t){return this.batch({update:e,optimistic:t||null!==t})}transformDocument(e){return this.addTypenameTransform.transformDocument(this.addFragmentsToDocument(e))}fragmentMatches(e,t){return this.policies.fragmentMatches(e,t)}lookupFragment(e){return this.config.fragments?.lookup(e)||null}resolvesClientField(e,t){return!!this.policies.getReadFunction(e,t)}broadcastWatches(e){if(!this.txCount){const t=this.onAfterBroadcast,i=new Set;this.onAfterBroadcast=o=>{i.add(o)};try{this.watches.forEach(o=>this.maybeBroadcastWatch(o,e)),i.forEach(o=>o())}finally{this.onAfterBroadcast=t}}}addFragmentsToDocument(e){const{fragments:t}=this.config;return t?t.transform(e):e}broadcastWatch(e,t){const{lastDiff:i}=e,o=this.diff(e);t&&(e.optimistic&&"string"==typeof t.optimistic&&(o.fromOptimisticTransaction=!0),t.onWatchUpdated&&!1===t.onWatchUpdated.call(this,e,o,i))||(!i||!sr(i.result,o.result))&&e.callback(e.lastDiff=o,i)}}class NU extends Ks{constructor(e){super((t,i)=>{const{...o}=t;return Object.defineProperty(o,"client",{enumerable:!1,value:t.client}),new wn(r=>{let s=!1;return Promise.resolve(o).then(l=>e(t.getContext(),l)).then(t.setContext).then(()=>{s||i(t).subscribe(r)}).catch(r.error.bind(r)),()=>{s=!0}})})}}function V5(n,e,t){const i=new Set(n),o=i.size;return pu(e,{Directive(r){if(i.delete(r.name.value)&&(!t||!i.size))return zh}}),t?!i.size:i.size<o}class AAe{isIncrementalResult(e){return!1}prepareRequest(e){return bn(!V5(["defer","stream"],e.query),67),e}extractErrors(){}startRequest=void 0}const kw=Ks.execute;function Z7(n,e){return m1(n,e,e.variables&&{variables:m1({...n&&n.variables,...e.variables})})}function TAe(n){return pu(n,{FragmentSpread(e){if(!e.directives?.some(({name:t})=>"unmask"===t.value))return null}})}function Zh(n,e){const t=be(n)?n:()=>n,i=o=>o.error(t());return new wn(e?o=>e.schedule(i,0,o):i)}function bd(n){return ia((e,t)=>{let r,i=null,o=!1;i=e.subscribe(Sa(t,void 0,void 0,s=>{r=dl(n(s,bd(n)(e))),i?(i.unsubscribe(),i=null,r.subscribe(t)):o=!0})),o&&(i.unsubscribe(),i=null,r.subscribe(t))})}class Cd{constructor(e,t,i){this.kind=e,this.value=t,this.error=i,this.hasValue="N"===e}observe(e){return function SAe(n,e){var t,i,o;const{kind:r,value:s,error:l}=n;if("string"!=typeof r)throw new TypeError('Invalid notification, missing "kind"');"N"===r?null===(t=e.next)||void 0===t||t.call(e,s):"E"===r?null===(i=e.error)||void 0===i||i.call(e,l):null===(o=e.complete)||void 0===o||o.call(e)}(this,e)}do(e,t,i){const{kind:o,value:r,error:s}=this;return"N"===o?e?.(r):"E"===o?t?.(s):i?.()}accept(e,t,i){var o;return be(null===(o=e)||void 0===o?void 0:o.next)?this.observe(e):this.do(e,t,i)}toObservable(){const{kind:e,value:t,error:i}=this,o="N"===e?au(t):"E"===e?Zh(()=>i):"C"===e?pd:0;if(!o)throw new TypeError(`Unexpected notification kind ${e}`);return o}static createNext(e){return new Cd("N",e)}static createError(e){return new Cd("E",void 0,e)}static createComplete(){return Cd.completeNotification}}function LU(n=1/0){return Rh(Sn,n)}function j5(...n){return function xAe(){return LU(1)}()(tu(n,m3(n)))}function Ow(n,e){return"object"==typeof n&&null!==n&&n[Symbol.for("apollo.error")]===e}function Bw(n){Object.defineProperty(n,Symbol.for("apollo.error"),{value:n.name,enumerable:!1,writable:!1,configurable:!1})}function MU(n){return n.filter(e=>e).map(e=>e.message||"Error message not found.").join("\n")}Cd.completeNotification=new Cd("C");let G5=(()=>{class n extends Error{static is(t){return Ow(t,"CombinedGraphQLErrors")}static formatMessage=MU;errors;data;extensions;constructor(t,i=t.errors||[]){super(n.formatMessage(i,{result:t,defaultFormatMessage:MU})),this.errors=i,this.data=t.data,this.extensions=t.extensions,this.name="CombinedGraphQLErrors",Bw(this),Object.setPrototypeOf(this,n.prototype)}}return n})();function RU(n){return n.map(e=>e.message||"Error message not found.").join("\n")}let DAe=(()=>{class n extends Error{static is(t){return Ow(t,"CombinedProtocolErrors")}static formatMessage=RU;errors;constructor(t){super(n.formatMessage(t,{defaultFormatMessage:RU})),this.name="CombinedProtocolErrors",this.errors=t,Bw(this),Object.setPrototypeOf(this,n.prototype)}}return n})();class Pw extends Error{static is(e){return Ow(e,"UnconventionalError")}constructor(e){super("An error of unexpected shape occurred.",{cause:e}),this.name="UnconventionalError",Bw(this),Object.setPrototypeOf(this,Pw.prototype)}}const Fw=Symbol(),kU=new WeakSet;function OU(n,e,t){return yw.withValue(!0,()=>{const i=W5(n,e,t,!1);return Object.isFrozen(n),i})}function W5(n,e,t,i,o){const{knownChanged:r}=t,s=function kAe(n,e){if(e.has(n))return e.get(n);const t=Array.isArray(n)?[]:{};return e.set(n,t),t}(n,t.mutableTargets);if(Array.isArray(n)){for(const[l,h]of Array.from(n.entries())){if(null===h){s[l]=null;continue}const f=W5(h,e,t,i,void 0);r.has(f)&&r.add(s),s[l]=f}return r.has(s)?s:n}for(const l of e.selections){let h;if(i&&r.add(s),l.kind===_n.FIELD){const f=g1(l),m=l.selectionSet;if(h=s[f]||n[f],void 0===h)continue;if(m&&null!==h){const b=W5(n[f],m,t,i,void 0);r.has(b)&&(h=b)}s[f]=h}if(l.kind===_n.INLINE_FRAGMENT&&(!l.typeCondition||t.cache.fragmentMatches(l,n.__typename))&&(h=W5(n,l.selectionSet,t,i,o)),l.kind===_n.FRAGMENT_SPREAD){const f=l.name.value,m=t.fragmentMap[f]||(t.fragmentMap[f]=t.cache.lookupFragment(f));bn(m,39,f);const b=iAe(l);"mask"!==b&&(h=W5(n,m.selectionSet,t,"migrate"===b,o))}r.has(h)&&r.add(s)}return"__typename"in n&&!("__typename"in s)&&(s.__typename=n.__typename),Object.keys(s).length!==Object.keys(n).length&&r.add(s),r.has(s)?s:n}function BU(n){return 7===n||8===n}function Y7(n){return!BU(n)}function Of(n){return!!n.errors?.length}function Hw(n,e=()=>{}){return t=>new wn(i=>{let o=e();return t.subscribe({next(r){let s;try{s=n(r,o)}catch(l){i.error(l)}void 0!==s&&i.next(s)},error(r){i.error(r)},complete(){i.complete()}})})}function $5(n){const e={data:n.data};return n.error&&(e.error=n.error),e}function FAe(n){let e=!1;return pu(n,{Directive:{enter(t){if("client"===t.name.value&&t.arguments&&(e=t.arguments.some(i=>"always"===i.name.value&&"BooleanValue"===i.value.kind&&!0===i.value.value),e))return zh}}}),e}function HAe(n,e){Vh(e);const t=PU(""),i=PU(""),o=ne=>{for(let Me,ge=0;ge<ne.length&&(Me=ne[ge]);++ge)if(!Pr(Me)){if(Me.kind===_n.OPERATION_DEFINITION)return t(Me.name&&Me.name.value);if(Me.kind===_n.FRAGMENT_DEFINITION)return i(Me.name.value)}return bn.error(14),null};let r=0;for(let ne=e.definitions.length-1;ne>=0;--ne)e.definitions[ne].kind===_n.OPERATION_DEFINITION&&++r;const s=function UAe(n){const e=new Map,t=new Map;return n.forEach(i=>{i&&(i.name?e.set(i.name,i):i.test&&t.set(i.test,i))}),i=>{let o=e.get(i.name.value);return!o&&t.size&&t.forEach((r,s)=>{s(i)&&(o=r)}),o}}(n),l=ne=>Aw(ne)&&ne.map(s).some(ge=>ge&&ge.remove),h=new Map;let f=!1;const m={enter(ne){if(l(ne.directives))return f=!0,null}},b=pu(e,{Field:m,InlineFragment:m,VariableDefinition:{enter:()=>!1},Variable:{enter(ne,ge,Me,Ct,Nt){const Zt=o(Nt);Zt&&Zt.variables.add(ne.name.value)}},FragmentSpread:{enter(ne,ge,Me,Ct,Nt){if(l(ne.directives))return f=!0,null;const Zt=o(Nt);Zt&&Zt.fragmentSpreads.add(ne.name.value)}},FragmentDefinition:{enter(ne,ge,Me,Ct){h.set(JSON.stringify(Ct),ne)},leave:(ne,ge,Me,Ct)=>ne===h.get(JSON.stringify(Ct))?ne:r>0&&ne.selectionSet.selections.every(Zt=>Zt.kind===_n.FIELD&&"__typename"===Zt.name.value)?(i(ne.name.value).removed=!0,f=!0,null):void 0},Directive:{leave(ne){if(s(ne))return f=!0,null}}});if(!f)return e;const A=ne=>(ne.transitiveVars||(ne.transitiveVars=new Set(ne.variables),ne.removed||ne.fragmentSpreads.forEach(ge=>{A(i(ge)).transitiveVars.forEach(Me=>{ne.transitiveVars.add(Me)})})),ne),T=new Set;b.definitions.forEach(ne=>{ne.kind===_n.OPERATION_DEFINITION?A(t(ne.name&&ne.name.value)).fragmentSpreads.forEach(ge=>{T.add(ge)}):ne.kind===_n.FRAGMENT_DEFINITION&&0===r&&!i(ne.name.value).removed&&T.add(ne.name.value)}),T.forEach(ne=>{A(i(ne)).fragmentSpreads.forEach(ge=>{T.add(ge)})});const K={enter(ne){if((ne=>!(T.has(ne)&&!i(ne).removed))(ne.name.value))return null}};return function zAe(n){return FU(gd(n)||function ZH(n){bn("Document"===n.kind,6),bn(n.definitions.length<=1,7);const e=n.definitions[0];return bn("FragmentDefinition"===e.kind,8),e}(n),B5(P5(n)))?null:n}(pu(b,{FragmentSpread:K,FragmentDefinition:K,OperationDefinition:{leave(ne){if(ne.variableDefinitions){const ge=A(t(ne.name&&ne.name.value)).transitiveVars;if(ge.size<ne.variableDefinitions.length)return{...ne,variableDefinitions:ne.variableDefinitions.filter(Me=>ge.has(Me.variable.name.value))}}}}}))}function PU(n){const e=new Map;return function(i=n){let o=e.get(i);return o||e.set(i,o={variables:new Set,fragmentSpreads:new Set}),o}}function FU(n,e){return!n||n.selectionSet.selections.every(t=>t.kind===_n.FRAGMENT_SPREAD&&FU(e[t.name.value],e))}var Ei=function(n){return n[n.loading=1]="loading",n[n.setVariables=2]="setVariables",n[n.fetchMore=3]="fetchMore",n[n.refetch=4]="refetch",n[n.poll=6]="poll",n[n.ready=7]="ready",n[n.error=8]="error",n[n.streaming=9]="streaming",n}(Ei||{});function HU(n){return n.catch(()=>{}),n}const{assign:UU}=Object,Bf={loading:!0,networkStatus:Ei.loading,data:void 0,dataState:"empty",partial:!0},Uw={loading:!1,networkStatus:Ei.ready,data:void 0,dataState:"empty",partial:!0};class zw{options;queryName;variablesUnknown=!1;_lastWrite;get query(){return this.lastQuery}get variables(){return this.options.variables}unsubscribeFromCache;input;subject;isTornDown;queryManager;subscriptions=new Set;waitForNetworkResult;lastQuery;linkSubscription;pollingInfo;get networkStatus(){return this.subject.getValue().result.networkStatus}get cache(){return this.queryManager.cache}constructor({queryManager:e,options:t,transformedQuery:i=e.transform(t.query)}){this.queryManager=e,this.waitForNetworkResult="network-only"===t.fetchPolicy,this.isTornDown=!1,this.subscribeToMore=this.subscribeToMore.bind(this),this.maskResult=this.maskResult.bind(this);const{watchQuery:{fetchPolicy:o="cache-first"}={}}=e.defaultOptions,{fetchPolicy:r=o,initialFetchPolicy:s=("standby"===r?o:r)}=t;t[oAe]&&(bn("standby"===r,82),this.variablesUnknown=!0),this.lastQuery=i,this.options={...t,initialFetchPolicy:s,fetchPolicy:r,variables:this.getVariablesWithDefaults(t.variables)},this.initializeObservablesQueue(),this["@@observable"]=()=>this,Symbol.observable&&(this[Symbol.observable]=()=>this);const l=gd(this.query);this.queryName=l&&l.name&&l.name.value}initializeObservablesQueue(){this.subject=new Mr({query:this.query,variables:this.variables,result:Bf,meta:{}});const e=this.subject.pipe(l1({subscribe:()=>{this.subject.observed||(this.reobserve(),setTimeout(()=>this.updatePolling()))},unsubscribe:()=>{this.subject.observed||this.tearDownQuery()}}),Hw(({query:t,variables:i,result:o,meta:r},s)=>{const{shouldEmit:l}=r;if(o===Bf&&(s.previous=void 0,s.previousVariables=void 0),"standby"===this.options.fetchPolicy||2===l)return;if(1===l)return m();const{previous:h,previousVariables:f}=s;if(h){const b=this.queryManager.getDocumentInfo(t),A=this.queryManager.dataMasking;if((A||b.hasNonreactiveDirective?KH(A?b.nonReactiveQuery:t,h,o,i):sr(h,o))&&sr(f,i))return}if(3!==l||this.options.notifyOnNetworkStatusChange&&!sr(h,o))return m();function m(){return s.previous=o,s.previousVariables=i,o}},()=>({})));this.pipe=e.pipe.bind(e),this.subscribe=e.subscribe.bind(e),this.input=new Vn,this.input.complete=()=>{},this.input.pipe(this.operator).subscribe(this.subject)}subscribe;pipe;[Symbol.observable];"@@observable";getCacheDiff({optimistic:e=!0}={}){return this.cache.diff({query:this.query,variables:this.variables,returnPartialData:!0,optimistic:e})}getInitialResult(e){let t=e||this.options.fetchPolicy;this.queryManager.prioritizeCacheValues&&("network-only"===t||"cache-and-network"===t)&&(t="cache-first");const i=()=>{const o=this.getCacheDiff(),r=this.options.returnPartialData||o.complete?o.result??void 0:void 0;return this.maskResult({data:r,dataState:o.complete?"complete":void 0===r?"empty":"partial",loading:!o.complete,networkStatus:o.complete?Ei.ready:Ei.loading,partial:!o.complete})};switch(t){case"cache-only":return{...i(),loading:!1,networkStatus:Ei.ready};case"cache-first":return i();case"cache-and-network":return{...i(),loading:!0,networkStatus:Ei.loading};case"standby":return Uw;default:return Bf}}resubscribeCache(){const{variables:e,fetchPolicy:t}=this.options,i=this.query,o="standby"===t||"no-cache"===t||this.waitForNetworkResult,r=!Z5({query:i,variables:e},this.unsubscribeFromCache)&&!this.waitForNetworkResult;if((o||r)&&this.unsubscribeFromCache?.(),o||!r)return;const s={query:i,variables:e,optimistic:!0,watcher:this,callback:h=>{const f=this.queryManager.getDocumentInfo(i);if((f.hasClientExports||f.hasForcedResolvers)&&(s.lastDiff=void 0),s.lastOwnDiff===h)return;const{result:m}=this.subject.getValue();!h.complete&&(m.error||m===Bf||m===Uw)||sr(m.data,h.result)||this.scheduleNotify()}},l=this.cache.watch(s);this.unsubscribeFromCache=Object.assign(()=>{this.unsubscribeFromCache=void 0,l()},{query:i,variables:e})}stableLastResult;getCurrentResult(){const{result:e}=this.subject.getValue();let t=e.networkStatus===Ei.error||this.hasObservers()||"no-cache"===this.options.fetchPolicy?e:this.getInitialResult();return t===Bf&&(t=this.getInitialResult()),sr(this.stableLastResult,t)||(this.stableLastResult=t),this.stableLastResult}refetch(e){const{fetchPolicy:t}=this.options,i={pollInterval:0};return i.fetchPolicy="no-cache"===t?"no-cache":"network-only",e&&!sr(this.variables,e)&&(i.variables=this.options.variables=this.getVariablesWithDefaults({...this.variables,...e})),this._lastWrite=void 0,this._reobserve(i,{newNetworkStatus:Ei.refetch})}fetchMore({query:e,variables:t,context:i,errorPolicy:o,updateQuery:r}){bn("cache-only"!==this.options.fetchPolicy,84,ml(this.query,"(anonymous)"));const s={...m1(this.options,{errorPolicy:"none"},{query:e,context:i,errorPolicy:o}),variables:e?t:{...this.variables,...t},fetchPolicy:"no-cache",notifyOnNetworkStatusChange:this.options.notifyOnNetworkStatusChange};s.query=this.transformDocument(s.query),this.lastQuery=e?this.transformDocument(this.options.query):s.query;let l=!1;const h="no-cache"!==this.options.fetchPolicy;h||bn(r,85);const{finalize:f,pushNotification:m}=this.pushOperation(Ei.fetchMore);m({source:"newNetworkStatus",kind:"N",value:{}},{shouldEmit:3});const{promise:b,operator:A}=zU(),{observable:T}=this.queryManager.fetchObservableWithInfo(s,{networkStatus:Ei.fetchMore,exposeExtensions:!0}),U=T.pipe(A,G3(K=>"N"===K.kind&&"network"===K.source)).subscribe({next:K=>{l=!1;const ne=K.value,ge=ne[aU];if(BU(K.value.networkStatus)&&f(),h){const Me=this.getCacheDiff();this.cache.batch({update:Ct=>{r?Ct.updateQuery({query:this.query,variables:this.variables,returnPartialData:!0,optimistic:!1,extensions:ge},Nt=>r(Nt,{fetchMoreResult:ne.data,variables:s.variables})):Ct.writeQuery({query:s.query,variables:s.variables,data:ne.data,extensions:ge})},onWatchUpdated:(Ct,Nt)=>{if(Ct.watcher===this&&!sr(Nt.result,Me.result)){l=!0;const Zt=this.getCurrentResult();Y7(ne.networkStatus)&&m({kind:"N",source:"network",value:{...Zt,networkStatus:ne.networkStatus===Ei.error?Ei.ready:ne.networkStatus,loading:!1,data:Nt.result,dataState:"streaming"===ne.dataState?"streaming":"complete"}})}}})}else{const Me=this.getCurrentResult(),Ct=r(Me.data,{fetchMoreResult:ne.data,variables:s.variables});m({kind:"N",value:{...Me,networkStatus:Ei.ready,loading:!1,data:Ct,dataState:"streaming"===Me.dataState?"streaming":"complete"},source:"network"})}}});return HU(b.then(K=>$5(this.maskResult(K))).finally(()=>{if(U.unsubscribe(),f(),h&&!l){const K=this.getCurrentResult();"streaming"===K.dataState?m({kind:"N",source:"network",value:{...K,dataState:"complete",networkStatus:Ei.ready}}):m({kind:"N",source:"newNetworkStatus",value:{}},{shouldEmit:1})}}))}subscribeToMore(e){const t=this.queryManager.startGraphQLSubscription({query:e.document,variables:e.variables,context:e.context}).subscribe({next:i=>{const{updateQuery:o,onError:r}=e,{error:s}=i;s?r?r(s):bn.error(86,s):o&&this.updateQuery((l,h)=>o(l,{subscriptionData:i,...h}))}});return this.subscriptions.add(t),()=>{this.subscriptions.delete(t)&&t.unsubscribe()}}applyOptions(e){const t=m1(this.options,e||{});UU(this.options,t),this.updatePolling()}setVariables(e){var t=this;return(0,M.A)(function*(){return e=t.getVariablesWithDefaults(e),sr(t.variables,e)||(t.options.variables=e,!t.hasObservers())?$5(t.getCurrentResult()):t._reobserve({fetchPolicy:t.options.initialFetchPolicy,variables:e},{newNetworkStatus:Ei.setVariables})})()}updateQuery(e){const{queryManager:t}=this,{result:i,complete:o}=this.getCacheDiff({optimistic:!1}),r=e(i,{variables:this.variables,complete:!!o,previousData:i});r&&(this.cache.writeQuery({query:this.options.query,data:r,variables:this.variables}),t.broadcastQueries())}startPolling(e){this.options.pollInterval=e,this.updatePolling()}stopPolling(){this.options.pollInterval=0,this.updatePolling()}applyNextFetchPolicy(e,t){if(t.nextFetchPolicy){const{fetchPolicy:i="cache-first",initialFetchPolicy:o=i}=t;"standby"===i||(t.fetchPolicy="function"==typeof t.nextFetchPolicy?t.nextFetchPolicy.call(t,i,{reason:e,options:t,observable:this,initialFetchPolicy:o}):"variables-changed"===e?o:t.nextFetchPolicy)}return t.fetchPolicy}fetch(e,t,i,o){const r=this.options.fetchPolicy;e.context??={};let s=!1,{observable:f,fromLink:m}=this.queryManager.fetchObservableWithInfo(e,{networkStatus:t,query:i,onCacheHit:()=>{s=!0},fetchQueryOperator:ne=>new wn(ge=>{try{return ne.subscribe({next(Me){s=!0,ge.next(Me)},error:Me=>ge.error(Me),complete:()=>ge.complete()})}finally{s||(T.override=t,this.input.next({kind:"N",source:"newNetworkStatus",value:{resetError:!0},query:b,variables:A,meta:{shouldEmit:3,fetchPolicy:r}}))}}),observableQuery:this});const{query:b,variables:A}=this,T={abort:()=>{K.unsubscribe()},query:b,variables:A};this.activeOperations.add(T);let U=t==Ei.refetch||t==Ei.setVariables;f=f.pipe(o,O5());const K=f.pipe(l1({next:ne=>{"newNetworkStatus"===ne.source||"N"===ne.kind&&ne.value.loading?T.override=t:delete T.override},finalize:()=>this.activeOperations.delete(T)})).subscribe({next:ne=>{const ge={};U&&"N"===ne.kind&&"loading"in ne.value&&!ne.value.loading&&(U=!1,ge.shouldEmit=1),this.input.next({...ne,query:b,variables:A,meta:ge})}});return{fromLink:m,subscription:K,observable:f}}didWarnCacheOnlyPolling=!1;updatePolling(){if(this.queryManager.ssrMode)return;const{pollingInfo:e,options:{pollInterval:i}}=this,o=()=>{const{options:h}=this;return!h.pollInterval||!this.hasObservers()||"cache-only"===h.fetchPolicy||"standby"===h.fetchPolicy};if(o())return void this.cancelPolling();if(e?.interval===i)return;(e||(this.pollingInfo={})).interval=i;const s=()=>{if(o())return this.cancelPolling();this.pollingInfo&&(Y7(this.networkStatus)||this.options.skipPollAttempt?.()?l():this._reobserve({fetchPolicy:"no-cache"===this.options.initialFetchPolicy?"no-cache":"network-only"},{newNetworkStatus:Ei.poll}).then(l,l))},l=()=>{const h=this.pollingInfo;h&&(clearTimeout(h.timeout),h.timeout=setTimeout(s,h.interval))};l()}cancelPolling(){this.pollingInfo&&(clearTimeout(this.pollingInfo.timeout),delete this.pollingInfo)}reobserve(e){return this._reobserve(e)}_reobserve(e,t){this.isTornDown=!1;let{newNetworkStatus:i}=t||{};this.queryManager.obsQueries.add(this);const o=i===Ei.refetch||i===Ei.poll,r=this.variables,s=this.options.fetchPolicy,l=m1(this.options,e||{});this.variablesUnknown&&="standby"===l.fetchPolicy;const h=o?l:UU(this.options,l),f=this.transformDocument(h.query);this.lastQuery=f,e&&"variables"in e&&(h.variables=this.getVariablesWithDefaults(e.variables)),o||(this.updatePolling(),e&&e.variables&&!sr(e.variables,r)&&"standby"!==h.fetchPolicy&&(h.fetchPolicy===s||"function"==typeof h.nextFetchPolicy)&&(this.applyNextFetchPolicy("variables-changed",h),void 0===i&&(i=Ei.setVariables))),i||(i=Ei.loading,this.networkStatus!==Ei.loading&&e?.variables&&!sr(e.variables,r)&&(i=Ei.setVariables),"standby"===h.fetchPolicy&&(i=Ei.ready)),"standby"===h.fetchPolicy&&this.cancelPolling(),this.resubscribeCache();const{promise:b,operator:A}=zU("standby"===h.fetchPolicy?{data:void 0}:void 0),{subscription:T,observable:U,fromLink:K}=this.fetch(h,i,f,A);!o&&(K||!this.linkSubscription)&&(this.linkSubscription&&this.linkSubscription.unsubscribe(),this.linkSubscription=T);const ne=Object.assign(HU(b.then(ge=>$5(this.maskResult(ge))).finally(()=>{!this.hasObservers()&&0===this.activeOperations.size&&this.tearDownQuery()})),{retain:()=>{const ge=U.subscribe({}),Me=()=>ge.unsubscribe();return b.then(Me,Me),ne}});return ne}hasObservers(){return this.subject.observed}stop(){this.subject.complete(),this.initializeObservablesQueue(),this.tearDownQuery()}tearDownQuery(){this.isTornDown||(this.resetNotifications(),this.unsubscribeFromCache?.(),this.linkSubscription&&(this.linkSubscription.unsubscribe(),delete this.linkSubscription),this.stopPolling(),this.subscriptions.forEach(e=>e.unsubscribe()),this.subscriptions.clear(),this.queryManager.obsQueries.delete(this),this.isTornDown=!0,this.abortActiveOperations(),this._lastWrite=void 0)}transformDocument(e){return this.queryManager.transform(e)}maskResult(e){const t=this.queryManager.maskOperation({document:this.query,data:e.data,fetchPolicy:this.options.fetchPolicy,cause:this});return t===e.data?e:{...e,data:t}}dirty=!1;notifyTimeout;resetNotifications(){this.notifyTimeout&&(clearTimeout(this.notifyTimeout),this.notifyTimeout=void 0),this.dirty=!1}scheduleNotify(){this.dirty||(this.dirty=!0,this.notifyTimeout||(this.notifyTimeout=setTimeout(()=>this.notify(!0),0)))}notify(e=!1){if(!e){const i=this.queryManager.getDocumentInfo(this.query);if(i.hasClientExports||i.hasForcedResolvers)return}const{dirty:t}=this;if(this.resetNotifications(),t&&("cache-only"===this.options.fetchPolicy||"cache-and-network"===this.options.fetchPolicy||!this.activeOperations.size)){const i=this.getCacheDiff();sr(i.result,this.getCacheDiff({optimistic:!1}).result)?this.reobserveCacheFirst():this.input.next({kind:"N",value:{data:i.result,dataState:i.complete?"complete":i.result?"partial":"empty",networkStatus:Ei.ready,loading:!1,error:void 0,partial:!i.complete},source:"cache",query:this.query,variables:this.variables,meta:{}})}}activeOperations=new Set;pushOperation(e){let t=!1;const{query:i,variables:o}=this,r=()=>{this.activeOperations.delete(s)},s={override:e,abort:()=>{t=!0,r()},query:i,variables:o};return this.activeOperations.add(s),{finalize:r,pushNotification:(l,h)=>{t||this.input.next({...l,query:i,variables:o,meta:{...h}})}}}calculateNetworkStatus(e){return e===Ei.streaming?e:Array.from(this.activeOperations.values()).reverse().find(i=>Z5(i,this)&&void 0!==i.override)?.override??e}abortActiveOperations(){this.activeOperations.forEach(e=>e.abort())}reset(){const e="cache-only"===this.options.fetchPolicy;this.setResult(e?Uw:Bf,{shouldEmit:e?1:2}),this.abortActiveOperations()}setResult(e,t){this.input.next({source:"setResult",kind:"N",value:e,query:this.query,variables:this.variables,meta:{...t}})}operator=Hw(e=>{const{query:t,variables:i,meta:o}=e;if("setResult"===e.source)return{query:t,variables:i,result:e.value,meta:o};if("C"===e.kind||!Z5(e,this))return;let r;const s=this.subject.getValue();if("cache"===e.source){if(r=e.value,r.networkStatus===Ei.ready&&r.partial&&(!this.options.returnPartialData||s.result.networkStatus===Ei.error)&&"cache-only"!==this.options.fetchPolicy)return}else if("network"===e.source)this.waitForNetworkResult&&(this.waitForNetworkResult=!1,this.resubscribeCache()),r="E"===e.kind?{...Z5(s,e)?s.result:{data:void 0,dataState:"empty",partial:!0},error:e.error,networkStatus:Ei.error,loading:!1}:e.value,"E"===e.kind&&"streaming"===r.dataState&&(r.dataState="complete"),r.error&&(o.shouldEmit=1);else if("newNetworkStatus"===e.source){const l=Z5(s,e)?s.result:this.getInitialResult(o.fetchPolicy),{resetError:h}=e.value,f=h?void 0:l.error,m=f?Ei.error:Ei.ready;r={...l,error:f,networkStatus:m}}return bn(r),r.error||delete r.error,r.networkStatus=this.calculateNetworkStatus(r.networkStatus),r.loading=Y7(r.networkStatus),r=this.maskResult(r),void 0!==s.result.data&&r.data!==s.result.data&&sr(r.data,s.result.data)&&(r.data=s.result.data),{query:t,variables:i,result:r,meta:o}});reobserveCacheFirst(){const{fetchPolicy:e,nextFetchPolicy:t}=this.options;"cache-and-network"===e||"network-only"===e?this.reobserve({fetchPolicy:"cache-first",nextFetchPolicy(i,o){return this.nextFetchPolicy=t,"function"==typeof this.nextFetchPolicy?this.nextFetchPolicy(i,o):e}}):this.reobserve()}getVariablesWithDefaults(e){return this.queryManager.getVariables(this.query,e)}}function Z5(n,e){return!!(n&&e&&n.query===e.query&&sr(n.variables,e.variables))}function zU(n){let t,i,e=n;return{promise:new Promise((s,l)=>{t=s,i=l}),operator:l1({next(s){if("E"===s.kind)return i(s.error);"N"===s.kind&&"newNetworkStatus"!==s.source&&!s.value.loading&&(e=s.value)},finalize:()=>{if(e)t(e);else{const s="The operation was aborted.",l="AbortError";i(typeof DOMException<"u"?new DOMException(s,l):Object.assign(new Error(s),{name:l}))}}})}}const VU={},Pf=new WeakMap;function Vw(n,e){const t=n[e];"function"==typeof t&&(n[e]=function(){return Pf.set(n,(Pf.get(n)+1)%1e15),t.apply(this,arguments)})}const jU=new WeakMap;class jw{cache;queryManager;id;observableQuery;incremental;constructor(e,t){const i=this.cache=e.cache,o=(jU.get(e)||0)+1;jU.set(e,o),this.id=o+"",this.observableQuery=t,this.queryManager=e,Pf.has(i)||(Pf.set(i,0),Vw(i,"evict"),Vw(i,"modify"),Vw(i,"reset"))}_lastWrite;get lastWrite(){return(this.observableQuery||this)._lastWrite}set lastWrite(e){(this.observableQuery||this)._lastWrite=e}resetLastWrite(){this.lastWrite=void 0}shouldWrite(e,t){const{lastWrite:i}=this;return!(i&&i.dmCount===Pf.get(this.cache)&&sr(t,i.variables)&&sr(e.data,i.result.data)&&e.extensions?.[$h]===i.result.extensions?.[$h])}get hasNext(){return!!this.incremental&&this.incremental.hasNext}maybeHandleIncrementalResult(e,t,i){const{incrementalHandler:o}=this.queryManager;return o.isIncrementalResult(t)?(this.incremental||=o.startRequest({query:i}),this.incremental.handle(e,t)):t}markQueryResult(e,{document:t,variables:i,errorPolicy:o,cacheWriteBehavior:r}){const s={query:t,variables:i,returnPartialData:!0,optimistic:!0};this.observableQuery?.resetNotifications();const l=0===r,h=l?void 0:this.cache.diff(s);let f=this.maybeHandleIncrementalResult(h?.result,e,t);return l||(Gw(f,o)?this.cache.batch({onWatchUpdated:(m,b)=>{m.watcher===this.observableQuery&&(m.lastOwnDiff=b)},update:m=>{if(this.shouldWrite(f,i))m.writeQuery({query:t,data:f.data,variables:i,overwrite:1===r,extensions:f.extensions}),this.lastWrite={result:f,variables:i,dmCount:Pf.get(this.cache)};else if(h&&h.complete)return void(f={...f,data:h.result});const b=m.diff(s);b.complete&&(f={...f,data:b.result})}}):this.lastWrite=void 0),f}markMutationResult(e,t,i=this.cache){const o=[],r=0===t.cacheWriteBehavior;let s=this.maybeHandleIncrementalResult(r?void 0:i.diff({id:"ROOT_MUTATION",query:this.queryManager.getDocumentInfo(t.document).asQuery,variables:t.variables,optimistic:!1,returnPartialData:!0}).result,e,t.document);if("ignore"===t.errorPolicy&&(s={...s,errors:[]}),Of(s)&&"none"===t.errorPolicy)return Promise.resolve(s);const l=()=>({...s,dataState:this.hasNext?"streaming":"complete"});if(!r&&Gw(s,t.errorPolicy)){o.push({result:s.data,dataId:"ROOT_MUTATION",query:t.document,variables:t.variables,extensions:s.extensions});const{updateQueries:f}=t;f&&this.queryManager.getObservableQueries("all").forEach(m=>{const b=m&&m.queryName;if(!b||!Object.hasOwnProperty.call(f,b))return;const A=f[b],{query:T,variables:U}=m,{result:K,complete:ne}=m.getCacheDiff({optimistic:!1});if(ne&&K){const ge=A(K,{mutationResult:l(),queryName:T&&ml(T)||void 0,queryVariables:U});ge&&o.push({result:ge,dataId:"ROOT_QUERY",query:T,variables:U})}})}let h=t.refetchQueries;if("function"==typeof h&&(h=h(l())),o.length>0||(h||"").length>0||t.update||t.onQueryUpdated||t.removeOptimistic){const f=[];if(this.queryManager.refetchQueries({updateCache:m=>{r||o.forEach(A=>m.write(A));const{update:b}=t;if(b){if(!r){const A=m.diff({id:"ROOT_MUTATION",query:this.queryManager.getDocumentInfo(t.document).asQuery,variables:t.variables,optimistic:!1,returnPartialData:!0});A.complete&&(s={...s,data:A.result})}this.hasNext||b(m,s,{context:t.context,variables:t.variables})}!r&&!t.keepRootFields&&!this.hasNext&&m.modify({id:"ROOT_MUTATION",fields:(A,{fieldName:T,DELETE:U})=>"__typename"===T?A:U})},include:h,optimistic:!1,removeOptimistic:t.removeOptimistic,onQueryUpdated:t.onQueryUpdated||null}).forEach(m=>f.push(m)),t.awaitRefetchQueries||t.onQueryUpdated)return Promise.all(f).then(()=>s)}return Promise.resolve(s)}markMutationOptimistic(e,t){const i="function"==typeof e?e(t.variables,{IGNORE:VU}):e;return i!==VU&&(this.cache.recordOptimisticTransaction(o=>{try{this.markMutationResult({data:i},t,o)}catch(r){bn.error(r)}},this.id),!0)}markSubscriptionResult(e,{document:t,variables:i,errorPolicy:o,cacheWriteBehavior:r}){0!==r&&(Gw(e,o)&&this.cache.write({query:t,result:e.data,dataId:"ROOT_SUBSCRIPTION",variables:i,extensions:e.extensions}),this.queryManager.broadcastQueries())}}function Gw(n,e="none"){const t="ignore"===e||"all"===e;let i=!Of(n);return!i&&t&&n.data&&(i=!0),i}class WAe{defaultOptions;client;clientOptions;assumeImmutableResults;documentTransform;ssrMode;defaultContext;dataMasking;incrementalHandler;localState;queryDeduplication;prioritizeCacheValues=!1;onBroadcast;mutationStore;obsQueries=new Set;fetchCancelFns=new Map;constructor(e){const t=new md(o=>this.cache.transformDocument(o),{cache:!1});this.client=e.client,this.defaultOptions=e.defaultOptions,this.queryDeduplication=e.queryDeduplication,this.clientOptions=e.clientOptions,this.ssrMode=e.ssrMode,this.assumeImmutableResults=e.assumeImmutableResults,this.dataMasking=e.dataMasking,this.localState=e.localState,this.incrementalHandler=e.incrementalHandler;const i=e.documentTransform;this.documentTransform=i?t.concat(i).concat(t):t,this.defaultContext=e.defaultContext||{},(this.onBroadcast=e.onBroadcast)&&(this.mutationStore={})}get link(){return this.client.link}get cache(){return this.client.cache}stop(){this.obsQueries.forEach(e=>e.stop()),this.cancelPendingFetches(vl(89))}cancelPendingFetches(e){this.fetchCancelFns.forEach(t=>t(e)),this.fetchCancelFns.clear()}mutate(e){var t=this;return(0,M.A)(function*({mutation:i,variables:o,optimisticResponse:r,updateQueries:s,refetchQueries:l=[],awaitRefetchQueries:h=!1,update:f,onQueryUpdated:m,fetchPolicy:b,errorPolicy:A,keepRootFields:T,context:U}){const K=new jw(t);i=t.cache.transformForLink(t.transform(i));const{hasClientExports:ne}=t.getDocumentInfo(i);o=t.getVariables(i,o),ne&&(o=yield t.localState.getExportedVariables({client:t.client,document:i,variables:o,context:U}));const ge=t.mutationStore&&(t.mutationStore[K.id]={mutation:i,variables:o,loading:!0,error:null}),Me=r&&K.markMutationOptimistic(r,{document:i,variables:o,cacheWriteBehavior:"no-cache"===b?0:2,errorPolicy:A,context:U,updateQueries:s,update:f,keepRootFields:T});return t.broadcastQueries(),new Promise((Ct,Nt)=>{const Zt={};return t.getObservableFromLink(i,{...U,optimisticResponse:Me?r:void 0},o,b,{},!1).observable.pipe(GU(),Rh(Wn=>{const Ri={...Wn};return tu(K.markMutationResult(Ri,{document:i,variables:o,cacheWriteBehavior:"no-cache"===b?0:2,errorPolicy:A,context:U,update:f,updateQueries:s,awaitRefetchQueries:h,refetchQueries:l,removeOptimistic:Me?K.id:void 0,onQueryUpdated:m,keepRootFields:T}))})).pipe(mo(Wn=>{if(Of(Wn)&&"none"===A)throw new G5(Ww(Wn));return ge&&(ge.loading=!1,ge.error=null),Wn})).subscribe({next:Wn=>{if(t.broadcastQueries(),!K.hasNext){const Ri={data:t.maskOperation({document:i,data:Wn.data,fetchPolicy:b,cause:Zt})};Of(Wn)&&(Ri.error=new G5(Wn)),Object.keys(Wn.extensions||{}).length&&(Ri.extensions=Wn.extensions),Ct(Ri)}},error:Wn=>(ge&&(ge.loading=!1,ge.error=Wn),Me&&t.cache.removeOptimistic(K.id),t.broadcastQueries(),"ignore"===A?Ct({data:void 0}):"all"===A?Ct({data:void 0,error:Wn}):void Nt(Wn))})})}).apply(this,arguments)}fetchQuery(e,t){var i=this;return Vh(e.query,_u.QUERY),(0,M.A)(function*(){return f5(i.fetchObservableWithInfo(e,{networkStatus:t}).observable.pipe(Hw(o=>{switch(o.kind){case"E":throw o.error;case"N":if("newNetworkStatus"!==o.source)return $5(o.value)}})),{defaultValue:{data:void 0}})})()}transform(e){return this.documentTransform.transformDocument(e)}transformCache=new tw(fd["queryManager.getDocumentInfo"]||2e3);getDocumentInfo(e){const{transformCache:t}=this;if(!t.has(e)){const o=gd(e),r={hasClientExports:V5(["client","export"],e,!0),hasForcedResolvers:FAe(e),hasNonreactiveDirective:V5(["nonreactive"],e),hasIncrementalDirective:V5(["defer"],e),nonReactiveQuery:ZAe(e),clientQuery:V5(["client"],e)?e:null,serverQuery:HAe([{name:"client",remove:!0},{name:"connection"},{name:"nonreactive"},{name:"unmask"}],e),operationType:o?.operation,defaultVars:xw(o),asQuery:{...e,definitions:e.definitions.map(s=>"OperationDefinition"===s.kind&&"query"!==s.operation?{...s,operation:"query"}:s)}};t.set(e,r)}const i=t.get(e);if(i.violation)throw i.violation;return i}getVariables(e,t){const i=this.getDocumentInfo(e).defaultVars,o=Object.entries(t??{}).map(([r,s])=>[r,void 0===s?i[r]:s]);return{...i,...Object.fromEntries(o)}}watchQuery(e){Vh(e.query,_u.QUERY);const t=this.transform(e.query);return typeof(e={...e,variables:this.getVariables(t,e.variables)}).notifyOnNetworkStatusChange>"u"&&(e.notifyOnNetworkStatusChange=!0),new zw({queryManager:this,options:e,transformedQuery:t})}query(e){const t=this.transform(e.query);return this.fetchQuery({...e,query:t}).then(i=>({...i,data:this.maskOperation({document:t,data:i?.data,fetchPolicy:e.fetchPolicy})}))}clearStore(e={discardWatches:!0}){return this.cancelPendingFetches(vl(91)),this.obsQueries.forEach(t=>{t.reset()}),this.mutationStore&&(this.mutationStore={}),this.cache.reset(e)}getObservableQueries(e="active"){const t=new Set,i=new Map,o=new Map,r=new Set;return Array.isArray(e)&&e.forEach(s=>{if("string"==typeof s)i.set(s,s),o.set(s,!1);else if(function VAe(n){return qs(n)&&"Document"===n.kind&&Array.isArray(n.definitions)}(s)){const l=k5(this.transform(s));i.set(l,ml(s)),o.set(l,!1)}else qs(s)&&s.query&&r.add(s)}),this.obsQueries.forEach(s=>{const l=k5(this.transform(s.options.query));if("all"===e)return void t.add(s);const{queryName:h,options:{fetchPolicy:f}}=s;"active"===e&&"standby"===f||("active"===e||h&&o.has(h)||l&&o.has(l))&&(t.add(s),h&&o.set(h,!0),l&&o.set(l,!0))}),r.size&&r.forEach(s=>{const l=new zw({queryManager:this,options:{...Z7(this.defaultOptions.watchQuery,s),fetchPolicy:"network-only"}});t.add(l)}),t}refetchObservableQueries(e=!1){const t=[];return this.getObservableQueries(e?"all":"active").forEach(i=>{const{fetchPolicy:o}=i.options;(e||"standby"!==o)&&"cache-only"!==o&&t.push(i.refetch())}),this.broadcastQueries(),Promise.all(t)}startGraphQLSubscription(e){let{query:t,variables:i}=e;const{fetchPolicy:o="cache-first",errorPolicy:r="none",context:s={},extensions:l={}}=e;let h;Vh(t,_u.SUBSCRIPTION),t=this.transform(t),i=this.getVariables(t,i);const f=(this.getDocumentInfo(t).hasClientExports?tu(this.localState.getExportedVariables({client:this.client,document:t,variables:i,context:s})):au(i)).pipe(Rh(m=>{const{observable:b,restart:A}=this.getObservableFromLink(t,s,m,o,l),T=new jw(this);return h=A,b.pipe(mo(U=>{T.markSubscriptionResult(U,{document:t,variables:m,errorPolicy:r,cacheWriteBehavior:"no-cache"===o?0:2});const K={data:U.data??void 0};return Of(U)?K.error=new G5(U):function LAe(n){return"extensions"in n&&DAe.is(n.extensions[Fw])}(U)&&(K.error=U.extensions[Fw],delete U.extensions[Fw]),U.extensions&&Object.keys(U.extensions).length&&(K.extensions=U.extensions),K.error&&"none"===r&&(K.data=void 0),"ignore"===r&&delete K.error,K}),bd(U=>au("ignore"===r?{data:void 0}:{data:void 0,error:U})),G3(U=>!(!U.data&&!U.error)))}));return Object.assign(f,{restart:()=>h?.()})}broadcastQueries(){this.onBroadcast&&this.onBroadcast(),this.obsQueries.forEach(e=>e.notify())}inFlightLinkObservables=new fu(!1);getObservableFromLink(e,t,i,o,r,s=t?.queryDeduplication??this.queryDeduplication){let l={};const{serverQuery:h,clientQuery:f,operationType:m,hasIncrementalDirective:b}=this.getDocumentInfo(e),A=ml(e),T={client:this.client};if(h){const{inFlightLinkObservables:U,link:K}=this;try{let ge=function(Me){return new wn(Ct=>{function Nt(){return Me.subscribe({next:Ct.next.bind(Ct),complete:Ct.complete.bind(Ct),error:Ct.error.bind(Ct)})}let Zt=Nt();return l.restart||=()=>{Zt.unsubscribe(),Zt=Nt()},()=>{Zt.unsubscribe(),l.restart=void 0}})};const ne=this.incrementalHandler.prepareRequest({query:h,variables:i,context:{...this.defaultContext,...t,queryDeduplication:s},extensions:r});if(t=ne.context,s){const Me=k5(h),Ct=vd(i);l=U.lookup(Me,Ct),l.observable||(l.observable=kw(K,ne,T).pipe(ge,ry(()=>{U.peek(Me,Ct)===l&&U.remove(Me,Ct)}),m===_u.SUBSCRIPTION?O5():H7({refCount:!0})))}else l.observable=kw(K,ne,T).pipe(ge)}catch(ne){l.observable=Zh(()=>ne)}}else l.observable=au({data:{}});if(f){const{operation:U}=gd(e);bn(!b,96,U[0].toUpperCase()+U.slice(1),A??"(anonymous)"),l.observable=l.observable.pipe(Rh(K=>tu(this.localState.execute({client:this.client,document:f,remoteResult:K,context:t,variables:i,fetchPolicy:o}))))}return{restart:()=>l.restart?.(),observable:l.observable.pipe(bd(U=>{throw U=function MAe(n){return function NAe(n){return null!==n&&"object"==typeof n&&"string"==typeof n.message&&"string"==typeof n.name&&("string"==typeof n.stack||typeof n.stack>"u")}(n)?n:"string"==typeof n?new Error(n,{cause:n}):new Pw(n)}(U),function RAe(n){kU.add(n)}(U),U}))}}getResultsFromLink(e,{queryInfo:t,cacheWriteBehavior:i,observableQuery:o,exposeExtensions:r}){const{errorPolicy:s}=e,l=this.cache.transformForLink(e.query);return this.getObservableFromLink(l,e.context,e.variables,e.fetchPolicy).observable.pipe(mo(h=>{const f=t.markQueryResult(h,{...e,document:l,cacheWriteBehavior:i}),m=Of(f);if(m&&"none"===s)throw t.resetLastWrite(),o?.resetNotifications(),new G5(Ww(f));const b={data:f.data,...t.hasNext?{loading:!0,networkStatus:Ei.streaming,dataState:"streaming",partial:!0}:{dataState:f.data?"complete":"empty",loading:!1,networkStatus:Ei.ready,partial:!f.data}};return r&&"extensions"in f&&(b[aU]=f.extensions),m&&("none"===s&&(b.data=void 0,b.dataState="empty"),"ignore"!==s&&(b.error=new G5(Ww(f)),"streaming"!==b.dataState&&(b.networkStatus=Ei.error))),b}),bd(h=>{if("none"===s)throw t.resetLastWrite(),o?.resetNotifications(),h;const f={data:void 0,dataState:"empty",loading:!1,networkStatus:Ei.ready,partial:!0};return"ignore"!==s&&(f.error=h,f.networkStatus=Ei.error),au(f)}))}fetchObservableWithInfo(e,{networkStatus:t=Ei.loading,query:i=e.query,fetchQueryOperator:o=h=>h,onCacheHit:r=()=>{},observableQuery:s,exposeExtensions:l}){const h=this.getVariables(i,e.variables);let{fetchPolicy:f="cache-first",errorPolicy:m="none",returnPartialData:b=!1,notifyOnNetworkStatusChange:A=!0,context:T={}}=e;this.prioritizeCacheValues&&("network-only"===f||"cache-and-network"===f)&&(f="cache-first");const U=Object.assign({},e,{query:i,variables:h,fetchPolicy:f,errorPolicy:m,returnPartialData:b,notifyOnNetworkStatusChange:A,context:T}),K=new jw(this,s),ne=Zt=>{U.variables=Zt;const Ri=this.fetchQueryByPolicy(U,{queryInfo:K,cacheWriteBehavior:"no-cache"===f?0:t===Ei.refetch&&"merge"!==U.refetchWritePolicy?1:2,onCacheHit:r,observableQuery:s,exposeExtensions:l});return Ri.observable=Ri.observable.pipe(o),"standby"!==U.fetchPolicy&&s?.applyNextFetchPolicy("after-fetch",e),Ri},ge=()=>{this.fetchCancelFns.delete(K.id)};this.fetchCancelFns.set(K.id,Zt=>{Me.next({kind:"E",error:Zt,source:"network"})});const Me=new Vn;let Ct,Nt;if(this.getDocumentInfo(U.query).hasClientExports)Ct=tu(this.localState.getExportedVariables({client:this.client,document:U.query,variables:U.variables,context:U.context})).pipe(Rh(Zt=>ne(Zt).observable)),Nt=!0;else{const Zt=ne(U.variables);Nt=Zt.fromLink,Ct=Zt.observable}return{observable:new wn(Zt=>{Zt.add(ge),Ct.subscribe(Zt),Me.subscribe(Zt)}).pipe(O5()),fromLink:Nt}}refetchQueries({updateCache:e,include:t,optimistic:i=!1,removeOptimistic:o=(i?uH("refetchQueries"):void 0),onQueryUpdated:r}){const s=new Map;t&&this.getObservableQueries(t).forEach(h=>{if("cache-only"===h.options.fetchPolicy||h.variablesUnknown)return;const f=h.getCurrentResult();s.set(h,{oq:h,lastDiff:{result:f?.data,complete:!f?.partial}})});const l=new Map;if(e){const h=new Set;this.cache.batch({update:e,optimistic:i&&o||!1,removeOptimistic:o,onWatchUpdated(f,m,b){const A=f.watcher;if(A instanceof zw&&!h.has(A)){if(h.add(A),r){s.delete(A);let T=r(A,m,b);return!0===T&&(T=A.refetch().retain()),!1!==T&&l.set(A,T),T}null!==r&&"cache-only"!==A.options.fetchPolicy&&s.set(A,{oq:A,lastDiff:b,diff:m})}}})}return s.size&&s.forEach(({oq:h,lastDiff:f,diff:m})=>{let b;r&&(m||(m=h.getCacheDiff()),b=r(h,m,f)),(!r||!0===b)&&(b=h.refetch().retain()),!1!==b&&l.set(h,b)}),o&&this.cache.removeOptimistic(o),l}noCacheWarningsByCause=new WeakSet;maskOperation(e){const{document:t,data:i}=e;return this.dataMasking?function BAe(n,e,t){const i=gd(e);return bn(i,43),null==n?n:OU(n,i.selectionSet,{operationType:i.operation,operationName:i.name?.value,fragmentMap:B5(P5(e)),cache:t,mutableTargets:new WeakMap,knownChanged:new WeakSet})}(i,t,this.cache):i}maskFragment(e){const{data:t,fragment:i,fragmentName:o}=e;return this.dataMasking?function PAe(n,e,t,i){const o=e.definitions.filter(s=>s.kind===_n.FRAGMENT_DEFINITION);typeof i>"u"&&(bn(1===o.length,41,o.length),i=o[0].name.value);const r=o.find(s=>s.name.value===i);return bn(!!r,42,i),null==n||sr(n,{})?n:OU(n,r.selectionSet,{operationType:"fragment",operationName:r.name.value,fragmentMap:B5(P5(e)),cache:t,mutableTargets:new WeakMap,knownChanged:new WeakSet})}(t,i,this.cache,o):t}fetchQueryByPolicy({query:e,variables:t,fetchPolicy:i,errorPolicy:o,returnPartialData:r,context:s},{cacheWriteBehavior:l,onCacheHit:h,queryInfo:f,observableQuery:m,exposeExtensions:b}){const A=()=>this.cache.diff({query:e,variables:t,returnPartialData:!0,optimistic:!0}),T=(K,ne)=>{const ge=K.result,Me=Nt=>(!K.complete&&!r&&(Nt=void 0),{data:Nt,dataState:K.complete?"complete":Nt?"partial":"empty",loading:Y7(ne),networkStatus:ne,partial:!K.complete});return(K.complete||r)&&this.getDocumentInfo(e).hasForcedResolvers?(h(),tu(this.localState.execute({client:this.client,document:e,remoteResult:ge?{data:ge}:void 0,context:s,variables:t,onlyRunForcedResolvers:!0,returnPartialData:!0,fetchPolicy:i}).then(Nt=>({kind:"N",value:Me(Nt.data||void 0),source:"cache"})))):au({kind:"N",value:Me("none"===o&&ne===Ei.refetch&&K.missing?void 0:ge||void 0),source:"cache"})},U=()=>this.getResultsFromLink({query:e,variables:t,context:s,fetchPolicy:i,errorPolicy:o},{cacheWriteBehavior:l,queryInfo:f,observableQuery:m,exposeExtensions:b}).pipe(GU(),function EAe(){return ia((n,e)=>{n.subscribe(Sa(e,t=>{e.next(Cd.createNext(t))},()=>{e.next(Cd.createComplete()),e.complete()},t=>{e.next(Cd.createError(t)),e.complete()}))})}(),mo(K=>({...K,source:"network"})));switch(i){default:case"cache-first":{const K=A();return K.complete?{fromLink:!1,observable:T(K,Ei.ready)}:r?{fromLink:!0,observable:j5(T(K,Ei.loading),U())}:{fromLink:!0,observable:U()}}case"cache-and-network":{const K=A();return K.complete||r?{fromLink:!0,observable:j5(T(K,Ei.loading),U())}:{fromLink:!0,observable:U()}}case"cache-only":return{fromLink:!1,observable:j5(T(A(),Ei.ready))};case"network-only":case"no-cache":return{fromLink:!0,observable:U()};case"standby":return{fromLink:!1,observable:pd}}}}function GU(){let n=!1;return l1({next(){n=!0},complete(){bn(n,100)}})}function ZAe(n){return pu(n,{FragmentSpread:e=>{if(!e.directives?.some(t=>"unmask"===t.name.value))return{...e,directives:[...e.directives||[],{kind:_n.DIRECTIVE,name:{kind:_n.NAME,value:"nonreactive"}}]}}})}function Ww(n){if(null==n.extensions?.[$h])return n;const{extensions:{[$h]:e,...t},...i}=n;return Object.keys(t).length>0&&(i.extensions=t),i}class $w{link;cache;disableNetworkFetches;set prioritizeCacheValues(e){this.queryManager.prioritizeCacheValues=e}get prioritizeCacheValues(){return this.queryManager.prioritizeCacheValues}version;queryDeduplication;defaultOptions;devtoolsConfig;refetchEventManager;queryManager;devToolsHookCb;resetStoreCallbacks=[];clearStoreCallbacks=[];constructor(e){const{cache:t,documentTransform:i,ssrMode:o=!1,ssrForceFetchDelay:r=0,queryDeduplication:s=!0,defaultOptions:l,defaultContext:h,assumeImmutableResults:f=t.assumeImmutableResults,localState:m,devtools:b,dataMasking:A,link:T,incrementalHandler:U=new AAe,experiments:K=[],refetchEventManager:ne}=e;this.link=T,this.cache=t,this.queryDeduplication=s,this.defaultOptions=l||{},this.devtoolsConfig={...b,enabled:b?.enabled??false},this.watchQuery=this.watchQuery.bind(this),this.query=this.query.bind(this),this.mutate=this.mutate.bind(this),this.watchFragment=this.watchFragment.bind(this),this.resetStore=this.resetStore.bind(this),this.reFetchObservableQueries=this.refetchObservableQueries=this.refetchObservableQueries.bind(this),this.version=Yy,this.queryManager=new WAe({client:this,defaultOptions:this.defaultOptions,defaultContext:h,documentTransform:i,queryDeduplication:s,ssrMode:o,dataMasking:!!A,clientOptions:e,incrementalHandler:U,assumeImmutableResults:f,onBroadcast:this.devtoolsConfig.enabled?()=>{this.devToolsHookCb&&this.devToolsHookCb()}:void 0,localState:m}),this.prioritizeCacheValues=o||r>0,r&&setTimeout(()=>{this.prioritizeCacheValues=!1},r),this.devtoolsConfig.enabled&&this.connectToDevTools(),K.forEach(ge=>ge.call(this,e)),this.refetchEventManager=ne,this.refetchEventManager?.connect(this)}connectToDevTools(){if(typeof window>"u")return;const e=window,t=Symbol.for("apollo.devtools");(e[t]=e[t]||[]).push(this),e.__APOLLO_CLIENT__=this}get documentTransform(){return this.queryManager.documentTransform}get localState(){return this.queryManager.localState}set localState(e){this.queryManager.localState=e}stop(){this.queryManager.stop(),this.refetchEventManager?.disconnect(this)}watchQuery(e){const{refetchOn:t}=e;if(this.defaultOptions.watchQuery){const i=this.defaultOptions.watchQuery.refetchOn;let o;t&&"object"==typeof t&&("object"==typeof i?o={...i,...t}:null!=i&&(o=r=>{const s=t[r.source]??i;return"function"==typeof s?s(r):s})),e=Z7(this.defaultOptions.watchQuery,e),o&&(e.refetchOn=o)}return this.queryManager.watchQuery(e)}query=e=>(this.defaultOptions.query&&(e=Z7(this.defaultOptions.query,e)),this.queryManager.query(e));mutate=e=>{const t=Z7(m1({fetchPolicy:"network-only",errorPolicy:"none"},this.defaultOptions.mutate),e);return Vh(t.mutation,_u.MUTATION),this.queryManager.mutate(t)};subscribe(e){const t={},i=this.queryManager.startGraphQLSubscription(e),o=i.pipe(mo(r=>({...r,data:this.queryManager.maskOperation({document:e.query,data:r.data,fetchPolicy:e.fetchPolicy,cause:t})})));return Object.assign(o,{restart:i.restart})}readQuery(e,t=!!e.optimistic){return this.cache.readQuery({...e,query:this.transform(e.query)},t)}watchFragment(e){const t=this.queryManager.dataMasking;return this.cache.watchFragment({...e,fragment:this.transform(e.fragment,t)})}readFragment(e,t=!!e.optimistic){return this.cache.readFragment({...e,fragment:this.transform(e.fragment)},t)}writeQuery(e){const t=this.cache.writeQuery(e);return!1!==e.broadcast&&this.queryManager.broadcastQueries(),t}writeFragment(e){const t=this.cache.writeFragment(e);return!1!==e.broadcast&&this.queryManager.broadcastQueries(),t}__actionHookForDevTools(e){this.devToolsHookCb=e}__requestRaw(e){return kw(this.link,e,{client:this})}resetStore(){return Promise.resolve().then(()=>this.queryManager.clearStore({discardWatches:!1})).then(()=>Promise.all(this.resetStoreCallbacks.map(e=>e()))).then(()=>this.refetchObservableQueries())}clearStore(){return Promise.resolve().then(()=>this.queryManager.clearStore({discardWatches:!0})).then(()=>Promise.all(this.clearStoreCallbacks.map(e=>e())))}onResetStore(e){return this.resetStoreCallbacks.push(e),()=>{this.resetStoreCallbacks=this.resetStoreCallbacks.filter(t=>t!==e)}}onClearStore(e){return this.clearStoreCallbacks.push(e),()=>{this.clearStoreCallbacks=this.clearStoreCallbacks.filter(t=>t!==e)}}reFetchObservableQueries;refetchObservableQueries(e){return this.queryManager.refetchObservableQueries(e)}refetchQueries(e){const t=this.queryManager.refetchQueries(e),i=[],o=[];t.forEach((s,l)=>{i.push(l),o.push(s)});const r=Promise.all(o);return r.queries=i,r.results=o,r.catch(s=>{}),r}getObservableQueries(e="active"){return this.queryManager.getObservableQueries(e)}extract(e){return this.cache.extract(e)}restore(e){return this.cache.restore(e)}setLink(e){this.link=e}get defaultContext(){return this.queryManager.defaultContext}maskedFragmentTransform=new md(TAe);transform(e,t=!1){const i=this.queryManager.transform(e);return t?this.maskedFragmentTransform.transformDocument(i):i}}function KAe(n,e){if(!n)throw new Error(e??"Unexpected invariant triggered.")}const qAe=/\r\n|[\n\r]/g;function Zw(n,e){let t=0,i=1;for(const o of n.body.matchAll(qAe)){if("number"==typeof o.index||KAe(!1),o.index>=e)break;t=o.index+o[0].length,i+=1}return{line:i,column:e+1-t}}function XAe(n){return $U(n.source,Zw(n.source,n.start))}function $U(n,e){const t=n.locationOffset.column-1,i="".padStart(t)+n.body,o=e.line-1,s=e.line+(n.locationOffset.line-1),h=e.column+(1===e.line?t:0),f=`${n.name}:${s}:${h}\n`,m=i.split(/\r\n|[\n\r]/g),b=m[o];if(b.length>120){const A=Math.floor(h/80),T=h%80,U=[];for(let K=0;K<b.length;K+=80)U.push(b.slice(K,K+80));return f+ZU([[`${s} |`,U[0]],...U.slice(1,A+1).map(K=>["|",K]),["|","^".padStart(T)],["|",U[A+1]]])}return f+ZU([[s-1+" |",m[o-1]],[`${s} |`,b],["|","^".padStart(h)],[`${s+1} |`,m[o+1]]])}function ZU(n){const e=n.filter(([i,o])=>void 0!==o),t=Math.max(...e.map(([i])=>i.length));return e.map(([i,o])=>i.padStart(t)+(o?" "+o:"")).join("\n")}class Yw extends Error{constructor(e,...t){var i,o,r;const{nodes:s,source:l,positions:h,path:f,originalError:m,extensions:b}=function QAe(n){const e=n[0];return null==e||"kind"in e||"length"in e?{nodes:e,source:n[1],positions:n[2],path:n[3],originalError:n[4],extensions:n[5]}:e}(t);super(e),this.name="GraphQLError",this.path=f??void 0,this.originalError=m??void 0,this.nodes=YU(Array.isArray(s)?s:s?[s]:void 0);const A=YU(null===(i=this.nodes)||void 0===i?void 0:i.map(U=>U.loc).filter(U=>null!=U));this.source=l??(null==A||null===(o=A[0])||void 0===o?void 0:o.source),this.positions=h??A?.map(U=>U.start),this.locations=h&&l?h.map(U=>Zw(l,U)):A?.map(U=>Zw(U.source,U.start));const T=function YAe(n){return"object"==typeof n&&null!==n}(m?.extensions)?m?.extensions:void 0;this.extensions=null!==(r=b??T)&&void 0!==r?r: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!=m&&m.stack?Object.defineProperty(this,"stack",{value:m.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,Yw):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"+XAe(t.loc));else if(this.source&&this.locations)for(const t of this.locations)e+="\n\n"+$U(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 YU(n){return void 0===n||0===n.length?void 0:n}function cs(n,e,t){return new Yw(`Syntax Error: ${t}`,{source:n,positions:[e]})}var KU=function(n){return n.QUERY="QUERY",n.MUTATION="MUTATION",n.SUBSCRIPTION="SUBSCRIPTION",n.FIELD="FIELD",n.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",n.FRAGMENT_SPREAD="FRAGMENT_SPREAD",n.INLINE_FRAGMENT="INLINE_FRAGMENT",n.VARIABLE_DEFINITION="VARIABLE_DEFINITION",n.SCHEMA="SCHEMA",n.SCALAR="SCALAR",n.OBJECT="OBJECT",n.FIELD_DEFINITION="FIELD_DEFINITION",n.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",n.INTERFACE="INTERFACE",n.UNION="UNION",n.ENUM="ENUM",n.ENUM_VALUE="ENUM_VALUE",n.INPUT_OBJECT="INPUT_OBJECT",n.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION",n.DIRECTIVE_DEFINITION="DIRECTIVE_DEFINITION",n}(KU||{}),kt=function(n){return n.SOF="<SOF>",n.EOF="<EOF>",n.BANG="!",n.DOLLAR="$",n.AMP="&",n.PAREN_L="(",n.PAREN_R=")",n.DOT=".",n.SPREAD="...",n.COLON=":",n.EQUALS="=",n.AT="@",n.BRACKET_L="[",n.BRACKET_R="]",n.BRACE_L="{",n.PIPE="|",n.BRACE_R="}",n.NAME="Name",n.INT="Int",n.FLOAT="Float",n.STRING="String",n.BLOCK_STRING="BlockString",n.COMMENT="Comment",n}(kt||{});class JAe{constructor(e){const t=new sH(kt.SOF,0,0,0,0);this.source=e,this.lastToken=t,this.token=t,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let e=this.token;if(e.kind!==kt.EOF)do{if(e.next)e=e.next;else{const t=tTe(this,e.end);e.next=t,t.prev=e,e=t}}while(e.kind===kt.COMMENT);return e}}function Ff(n){return n>=0&&n<=55295||n>=57344&&n<=1114111}function K7(n,e){return qU(n.charCodeAt(e))&&XU(n.charCodeAt(e+1))}function qU(n){return n>=55296&&n<=56319}function XU(n){return n>=56320&&n<=57343}function v1(n,e){const t=n.source.body.codePointAt(e);if(void 0===t)return kt.EOF;if(t>=32&&t<=126){const i=String.fromCodePoint(t);return'"'===i?"'\"'":`"${i}"`}return"U+"+t.toString(16).toUpperCase().padStart(4,"0")}function Jr(n,e,t,i,o){return new sH(e,t,i,n.line,1+t-n.lineStart,o)}function tTe(n,e){const t=n.source.body,i=t.length;let o=e;for(;o<i;){const r=t.charCodeAt(o);switch(r){case 65279:case 9:case 32:case 44:++o;continue;case 10:++o,++n.line,n.lineStart=o;continue;case 13:10===t.charCodeAt(o+1)?o+=2:++o,++n.line,n.lineStart=o;continue;case 35:return nTe(n,o);case 33:return Jr(n,kt.BANG,o,o+1);case 36:return Jr(n,kt.DOLLAR,o,o+1);case 38:return Jr(n,kt.AMP,o,o+1);case 40:return Jr(n,kt.PAREN_L,o,o+1);case 41:return Jr(n,kt.PAREN_R,o,o+1);case 46:if(46===t.charCodeAt(o+1)&&46===t.charCodeAt(o+2))return Jr(n,kt.SPREAD,o,o+3);break;case 58:return Jr(n,kt.COLON,o,o+1);case 61:return Jr(n,kt.EQUALS,o,o+1);case 64:return Jr(n,kt.AT,o,o+1);case 91:return Jr(n,kt.BRACKET_L,o,o+1);case 93:return Jr(n,kt.BRACKET_R,o,o+1);case 123:return Jr(n,kt.BRACE_L,o,o+1);case 124:return Jr(n,kt.PIPE,o,o+1);case 125:return Jr(n,kt.BRACE_R,o,o+1);case 34:return 34===t.charCodeAt(o+1)&&34===t.charCodeAt(o+2)?lTe(n,o):oTe(n,o)}if(M5(r)||45===r)return iTe(n,o,r);if($H(r))return cTe(n,o);throw cs(n.source,o,39===r?"Unexpected single quote character ('), did you mean to use a double quote (\")?":Ff(r)||K7(t,o)?`Unexpected character: ${v1(n,o)}.`:`Invalid character: ${v1(n,o)}.`)}return Jr(n,kt.EOF,i,i)}function nTe(n,e){const t=n.source.body,i=t.length;let o=e+1;for(;o<i;){const r=t.charCodeAt(o);if(10===r||13===r)break;if(Ff(r))++o;else{if(!K7(t,o))break;o+=2}}return Jr(n,kt.COMMENT,e,o,t.slice(e+1,o))}function iTe(n,e,t){const i=n.source.body;let o=e,r=t,s=!1;if(45===r&&(r=i.charCodeAt(++o)),48===r){if(r=i.charCodeAt(++o),M5(r))throw cs(n.source,o,`Invalid number, unexpected digit after 0: ${v1(n,o)}.`)}else o=Kw(n,o,r),r=i.charCodeAt(o);if(46===r&&(s=!0,r=i.charCodeAt(++o),o=Kw(n,o,r),r=i.charCodeAt(o)),(69===r||101===r)&&(s=!0,r=i.charCodeAt(++o),(43===r||45===r)&&(r=i.charCodeAt(++o)),o=Kw(n,o,r),r=i.charCodeAt(o)),46===r||$H(r))throw cs(n.source,o,`Invalid number, expected digit but got: ${v1(n,o)}.`);return Jr(n,s?kt.FLOAT:kt.INT,e,o,i.slice(e,o))}function Kw(n,e,t){if(!M5(t))throw cs(n.source,e,`Invalid number, expected digit but got: ${v1(n,e)}.`);const i=n.source.body;let o=e+1;for(;M5(i.charCodeAt(o));)++o;return o}function oTe(n,e){const t=n.source.body,i=t.length;let o=e+1,r=o,s="";for(;o<i;){const l=t.charCodeAt(o);if(34===l)return s+=t.slice(r,o),Jr(n,kt.STRING,e,o+1,s);if(92===l){s+=t.slice(r,o);const h=117===t.charCodeAt(o+1)?123===t.charCodeAt(o+2)?rTe(n,o):sTe(n,o):aTe(n,o);s+=h.value,o+=h.size,r=o;continue}if(10===l||13===l)break;if(Ff(l))++o;else{if(!K7(t,o))throw cs(n.source,o,`Invalid character within String: ${v1(n,o)}.`);o+=2}}throw cs(n.source,o,"Unterminated string.")}function rTe(n,e){const t=n.source.body;let i=0,o=3;for(;o<12;){const r=t.charCodeAt(e+o++);if(125===r){if(o<5||!Ff(i))break;return{value:String.fromCodePoint(i),size:o}}if(i=i<<4|Y5(r),i<0)break}throw cs(n.source,e,`Invalid Unicode escape sequence: "${t.slice(e,e+o)}".`)}function sTe(n,e){const t=n.source.body,i=QU(t,e+2);if(Ff(i))return{value:String.fromCodePoint(i),size:6};if(qU(i)&&92===t.charCodeAt(e+6)&&117===t.charCodeAt(e+7)){const o=QU(t,e+8);if(XU(o))return{value:String.fromCodePoint(i,o),size:12}}throw cs(n.source,e,`Invalid Unicode escape sequence: "${t.slice(e,e+6)}".`)}function QU(n,e){return Y5(n.charCodeAt(e))<<12|Y5(n.charCodeAt(e+1))<<8|Y5(n.charCodeAt(e+2))<<4|Y5(n.charCodeAt(e+3))}function Y5(n){return n>=48&&n<=57?n-48:n>=65&&n<=70?n-55:n>=97&&n<=102?n-87:-1}function aTe(n,e){const t=n.source.body;switch(t.charCodeAt(e+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 cs(n.source,e,`Invalid character escape sequence: "${t.slice(e,e+2)}".`)}function lTe(n,e){const t=n.source.body,i=t.length;let o=n.lineStart,r=e+3,s=r,l="";const h=[];for(;r<i;){const f=t.charCodeAt(r);if(34===f&&34===t.charCodeAt(r+1)&&34===t.charCodeAt(r+2)){l+=t.slice(s,r),h.push(l);const m=Jr(n,kt.BLOCK_STRING,e,r+3,ywe(h).join("\n"));return n.line+=h.length-1,n.lineStart=o,m}if(92!==f||34!==t.charCodeAt(r+1)||34!==t.charCodeAt(r+2)||34!==t.charCodeAt(r+3))if(10!==f&&13!==f)if(Ff(f))++r;else{if(!K7(t,r))throw cs(n.source,r,`Invalid character within String: ${v1(n,r)}.`);r+=2}else l+=t.slice(s,r),h.push(l),13===f&&10===t.charCodeAt(r+1)?r+=2:++r,l="",s=r,o=r;else l+=t.slice(s,r),s=r+1,r+=4}throw cs(n.source,r,"Unterminated string.")}function cTe(n,e){const t=n.source.body,i=t.length;let o=e+1;for(;o<i&&Cwe(t.charCodeAt(o));)++o;return Jr(n,kt.NAME,e,o,t.slice(e,o))}const uTe=globalThis.process?function(e,t){return e instanceof t}:function(e,t){if(e instanceof t)return!0;if("object"==typeof e&&null!==e){var i;const o=t.prototype[Symbol.toStringTag];if(o===(Symbol.toStringTag in e?e[Symbol.toStringTag]:null===(i=e.constructor)||void 0===i?void 0:i.name)){const s=Wy(e);throw new Error(`Cannot use ${o} "${s}" 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 JU{constructor(e,t="GraphQL request",i={line:1,column:1}){"string"==typeof e||N7(!1,`Body must be a string. Received: ${Wy(e)}.`),this.body=e,this.name=t,this.locationOffset=i,this.locationOffset.line>0||N7(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||N7(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}class K5{constructor(e,t={}){const{lexer:i,...o}=t;if(i)this._lexer=i;else{const r=function dTe(n){return uTe(n,JU)}(e)?e:new JU(e);this._lexer=new JAe(r)}this._options=o,this._tokenCounter=0}get tokenCount(){return this._tokenCounter}parseName(){const e=this.expectToken(kt.NAME);return this.node(e,{kind:_n.NAME,value:e.value})}parseDocument(){return this.node(this._lexer.token,{kind:_n.DOCUMENT,definitions:this.many(kt.SOF,this.parseDefinition,kt.EOF)})}parseDefinition(){if(this.peek(kt.BRACE_L))return this.parseOperationDefinition();const e=this.peekDescription(),t=e?this._lexer.lookahead():this._lexer.token;if(e&&t.kind===kt.BRACE_L)throw cs(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are not supported on shorthand queries.");if(t.kind===kt.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()}switch(t.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition()}if(e)throw cs(this._lexer.source,this._lexer.token.start,"Unexpected description, only GraphQL definitions support descriptions.");if("extend"===t.value)return this.parseTypeSystemExtension()}throw this.unexpected(t)}parseOperationDefinition(){const e=this._lexer.token;if(this.peek(kt.BRACE_L))return this.node(e,{kind:_n.OPERATION_DEFINITION,operation:_u.QUERY,description:void 0,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});const t=this.parseDescription(),i=this.parseOperationType();let o;return this.peek(kt.NAME)&&(o=this.parseName()),this.node(e,{kind:_n.OPERATION_DEFINITION,operation:i,description:t,name:o,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const e=this.expectToken(kt.NAME);switch(e.value){case"query":return _u.QUERY;case"mutation":return _u.MUTATION;case"subscription":return _u.SUBSCRIPTION}throw this.unexpected(e)}parseVariableDefinitions(){return this.optionalMany(kt.PAREN_L,this.parseVariableDefinition,kt.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:_n.VARIABLE_DEFINITION,description:this.parseDescription(),variable:this.parseVariable(),type:(this.expectToken(kt.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(kt.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const e=this._lexer.token;return this.expectToken(kt.DOLLAR),this.node(e,{kind:_n.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:_n.SELECTION_SET,selections:this.many(kt.BRACE_L,this.parseSelection,kt.BRACE_R)})}parseSelection(){return this.peek(kt.SPREAD)?this.parseFragment():this.parseField()}parseField(){const e=this._lexer.token,t=this.parseName();let i,o;return this.expectOptionalToken(kt.COLON)?(i=t,o=this.parseName()):o=t,this.node(e,{kind:_n.FIELD,alias:i,name:o,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(kt.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(e){return this.optionalMany(kt.PAREN_L,e?this.parseConstArgument:this.parseArgument,kt.PAREN_R)}parseArgument(e=!1){const t=this._lexer.token,i=this.parseName();return this.expectToken(kt.COLON),this.node(t,{kind:_n.ARGUMENT,name:i,value:this.parseValueLiteral(e)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){const e=this._lexer.token;this.expectToken(kt.SPREAD);const t=this.expectOptionalKeyword("on");return!t&&this.peek(kt.NAME)?this.node(e,{kind:_n.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(e,{kind:_n.INLINE_FRAGMENT,typeCondition:t?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){const e=this._lexer.token,t=this.parseDescription();return this.expectKeyword("fragment"),this.node(e,!0===this._options.allowLegacyFragmentVariables?{kind:_n.FRAGMENT_DEFINITION,description:t,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}:{kind:_n.FRAGMENT_DEFINITION,description:t,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 kt.BRACKET_L:return this.parseList(e);case kt.BRACE_L:return this.parseObject(e);case kt.INT:return this.advanceLexer(),this.node(t,{kind:_n.INT,value:t.value});case kt.FLOAT:return this.advanceLexer(),this.node(t,{kind:_n.FLOAT,value:t.value});case kt.STRING:case kt.BLOCK_STRING:return this.parseStringLiteral();case kt.NAME:switch(this.advanceLexer(),t.value){case"true":return this.node(t,{kind:_n.BOOLEAN,value:!0});case"false":return this.node(t,{kind:_n.BOOLEAN,value:!1});case"null":return this.node(t,{kind:_n.NULL});default:return this.node(t,{kind:_n.ENUM,value:t.value})}case kt.DOLLAR:if(e){if(this.expectToken(kt.DOLLAR),this._lexer.token.kind===kt.NAME)throw cs(this._lexer.source,t.start,`Unexpected variable "$${this._lexer.token.value}" 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:_n.STRING,value:e.value,block:e.kind===kt.BLOCK_STRING})}parseList(e){return this.node(this._lexer.token,{kind:_n.LIST,values:this.any(kt.BRACKET_L,()=>this.parseValueLiteral(e),kt.BRACKET_R)})}parseObject(e){return this.node(this._lexer.token,{kind:_n.OBJECT,fields:this.any(kt.BRACE_L,()=>this.parseObjectField(e),kt.BRACE_R)})}parseObjectField(e){const t=this._lexer.token,i=this.parseName();return this.expectToken(kt.COLON),this.node(t,{kind:_n.OBJECT_FIELD,name:i,value:this.parseValueLiteral(e)})}parseDirectives(e){const t=[];for(;this.peek(kt.AT);)t.push(this.parseDirective(e));return t}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(e){const t=this._lexer.token;return this.expectToken(kt.AT),this.node(t,{kind:_n.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e)})}parseTypeReference(){const e=this._lexer.token;let t;if(this.expectOptionalToken(kt.BRACKET_L)){const i=this.parseTypeReference();this.expectToken(kt.BRACKET_R),t=this.node(e,{kind:_n.LIST_TYPE,type:i})}else t=this.parseNamedType();return this.expectOptionalToken(kt.BANG)?this.node(e,{kind:_n.NON_NULL_TYPE,type:t}):t}parseNamedType(){return this.node(this._lexer.token,{kind:_n.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(kt.STRING)||this.peek(kt.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("schema");const i=this.parseConstDirectives(),o=this.many(kt.BRACE_L,this.parseOperationTypeDefinition,kt.BRACE_R);return this.node(e,{kind:_n.SCHEMA_DEFINITION,description:t,directives:i,operationTypes:o})}parseOperationTypeDefinition(){const e=this._lexer.token,t=this.parseOperationType();this.expectToken(kt.COLON);const i=this.parseNamedType();return this.node(e,{kind:_n.OPERATION_TYPE_DEFINITION,operation:t,type:i})}parseScalarTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("scalar");const i=this.parseName(),o=this.parseConstDirectives();return this.node(e,{kind:_n.SCALAR_TYPE_DEFINITION,description:t,name:i,directives:o})}parseObjectTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("type");const i=this.parseName(),o=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),s=this.parseFieldsDefinition();return this.node(e,{kind:_n.OBJECT_TYPE_DEFINITION,description:t,name:i,interfaces:o,directives:r,fields:s})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(kt.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(kt.BRACE_L,this.parseFieldDefinition,kt.BRACE_R)}parseFieldDefinition(){const e=this._lexer.token,t=this.parseDescription(),i=this.parseName(),o=this.parseArgumentDefs();this.expectToken(kt.COLON);const r=this.parseTypeReference(),s=this.parseConstDirectives();return this.node(e,{kind:_n.FIELD_DEFINITION,description:t,name:i,arguments:o,type:r,directives:s})}parseArgumentDefs(){return this.optionalMany(kt.PAREN_L,this.parseInputValueDef,kt.PAREN_R)}parseInputValueDef(){const e=this._lexer.token,t=this.parseDescription(),i=this.parseName();this.expectToken(kt.COLON);const o=this.parseTypeReference();let r;this.expectOptionalToken(kt.EQUALS)&&(r=this.parseConstValueLiteral());const s=this.parseConstDirectives();return this.node(e,{kind:_n.INPUT_VALUE_DEFINITION,description:t,name:i,type:o,defaultValue:r,directives:s})}parseInterfaceTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("interface");const i=this.parseName(),o=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),s=this.parseFieldsDefinition();return this.node(e,{kind:_n.INTERFACE_TYPE_DEFINITION,description:t,name:i,interfaces:o,directives:r,fields:s})}parseUnionTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("union");const i=this.parseName(),o=this.parseConstDirectives(),r=this.parseUnionMemberTypes();return this.node(e,{kind:_n.UNION_TYPE_DEFINITION,description:t,name:i,directives:o,types:r})}parseUnionMemberTypes(){return this.expectOptionalToken(kt.EQUALS)?this.delimitedMany(kt.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("enum");const i=this.parseName(),o=this.parseConstDirectives(),r=this.parseEnumValuesDefinition();return this.node(e,{kind:_n.ENUM_TYPE_DEFINITION,description:t,name:i,directives:o,values:r})}parseEnumValuesDefinition(){return this.optionalMany(kt.BRACE_L,this.parseEnumValueDefinition,kt.BRACE_R)}parseEnumValueDefinition(){const e=this._lexer.token,t=this.parseDescription(),i=this.parseEnumValueName(),o=this.parseConstDirectives();return this.node(e,{kind:_n.ENUM_VALUE_DEFINITION,description:t,name:i,directives:o})}parseEnumValueName(){if("true"===this._lexer.token.value||"false"===this._lexer.token.value||"null"===this._lexer.token.value)throw cs(this._lexer.source,this._lexer.token.start,`${q7(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 i=this.parseName(),o=this.parseConstDirectives(),r=this.parseInputFieldsDefinition();return this.node(e,{kind:_n.INPUT_OBJECT_TYPE_DEFINITION,description:t,name:i,directives:o,fields:r})}parseInputFieldsDefinition(){return this.optionalMany(kt.BRACE_L,this.parseInputValueDef,kt.BRACE_R)}parseTypeSystemExtension(){const e=this._lexer.lookahead();if(e.kind===kt.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();case"directive":if(this._options.experimentalDirectivesOnDirectiveDefinitions)return this.parseDirectiveDefinitionExtension()}throw this.unexpected(e)}parseSchemaExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");const t=this.parseConstDirectives(),i=this.optionalMany(kt.BRACE_L,this.parseOperationTypeDefinition,kt.BRACE_R);if(0===t.length&&0===i.length)throw this.unexpected();return this.node(e,{kind:_n.SCHEMA_EXTENSION,directives:t,operationTypes:i})}parseScalarTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");const t=this.parseName(),i=this.parseConstDirectives();if(0===i.length)throw this.unexpected();return this.node(e,{kind:_n.SCALAR_TYPE_EXTENSION,name:t,directives:i})}parseObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");const t=this.parseName(),i=this.parseImplementsInterfaces(),o=this.parseConstDirectives(),r=this.parseFieldsDefinition();if(0===i.length&&0===o.length&&0===r.length)throw this.unexpected();return this.node(e,{kind:_n.OBJECT_TYPE_EXTENSION,name:t,interfaces:i,directives:o,fields:r})}parseInterfaceTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const t=this.parseName(),i=this.parseImplementsInterfaces(),o=this.parseConstDirectives(),r=this.parseFieldsDefinition();if(0===i.length&&0===o.length&&0===r.length)throw this.unexpected();return this.node(e,{kind:_n.INTERFACE_TYPE_EXTENSION,name:t,interfaces:i,directives:o,fields:r})}parseUnionTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const t=this.parseName(),i=this.parseConstDirectives(),o=this.parseUnionMemberTypes();if(0===i.length&&0===o.length)throw this.unexpected();return this.node(e,{kind:_n.UNION_TYPE_EXTENSION,name:t,directives:i,types:o})}parseEnumTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const t=this.parseName(),i=this.parseConstDirectives(),o=this.parseEnumValuesDefinition();if(0===i.length&&0===o.length)throw this.unexpected();return this.node(e,{kind:_n.ENUM_TYPE_EXTENSION,name:t,directives:i,values:o})}parseInputObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const t=this.parseName(),i=this.parseConstDirectives(),o=this.parseInputFieldsDefinition();if(0===i.length&&0===o.length)throw this.unexpected();return this.node(e,{kind:_n.INPUT_OBJECT_TYPE_EXTENSION,name:t,directives:i,fields:o})}parseDirectiveDefinitionExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("directive"),this.expectToken(kt.AT);const t=this.parseName(),i=this.parseConstDirectives();if(0===i.length)throw this.unexpected();return this.node(e,{kind:_n.DIRECTIVE_EXTENSION,name:t,directives:i})}parseDirectiveDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("directive"),this.expectToken(kt.AT);const i=this.parseName(),o=this.parseArgumentDefs(),r=this._options.experimentalDirectivesOnDirectiveDefinitions?this.parseConstDirectives():[],s=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const l=this.parseDirectiveLocations();return this.node(e,{kind:_n.DIRECTIVE_DEFINITION,description:t,name:i,arguments:o,directives:r,repeatable:s,locations:l})}parseDirectiveLocations(){return this.delimitedMany(kt.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){const e=this._lexer.token,t=this.parseName();if(Object.prototype.hasOwnProperty.call(KU,t.value))return t;throw this.unexpected(e)}parseSchemaCoordinate(){const e=this._lexer.token,t=this.expectOptionalToken(kt.AT),i=this.parseName();let o,r;return!t&&this.expectOptionalToken(kt.DOT)&&(o=this.parseName()),(t||o)&&this.expectOptionalToken(kt.PAREN_L)&&(r=this.parseName(),this.expectToken(kt.COLON),this.expectToken(kt.PAREN_R)),this.node(e,t?r?{kind:_n.DIRECTIVE_ARGUMENT_COORDINATE,name:i,argumentName:r}:{kind:_n.DIRECTIVE_COORDINATE,name:i}:o?r?{kind:_n.ARGUMENT_COORDINATE,name:i,fieldName:o,argumentName:r}:{kind:_n.MEMBER_COORDINATE,name:i,memberName:o}:{kind:_n.TYPE_COORDINATE,name:i})}node(e,t){return!0!==this._options.noLocation&&(t.loc=new kye(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 cs(this._lexer.source,t.start,`Expected ${ez(e)}, found ${q7(t)}.`)}expectOptionalToken(e){return this._lexer.token.kind===e&&(this.advanceLexer(),!0)}expectKeyword(e){const t=this._lexer.token;if(t.kind!==kt.NAME||t.value!==e)throw cs(this._lexer.source,t.start,`Expected "${e}", found ${q7(t)}.`);this.advanceLexer()}expectOptionalKeyword(e){const t=this._lexer.token;return t.kind===kt.NAME&&t.value===e&&(this.advanceLexer(),!0)}unexpected(e){const t=e??this._lexer.token;return cs(this._lexer.source,t.start,`Unexpected ${q7(t)}.`)}any(e,t,i){this.expectToken(e);const o=[];for(;!this.expectOptionalToken(i);)o.push(t.call(this));return o}optionalMany(e,t,i){if(this.expectOptionalToken(e)){const o=[];do{o.push(t.call(this))}while(!this.expectOptionalToken(i));return o}return[]}many(e,t,i){this.expectToken(e);const o=[];do{o.push(t.call(this))}while(!this.expectOptionalToken(i));return o}delimitedMany(e,t){this.expectOptionalToken(e);const i=[];do{i.push(t.call(this))}while(this.expectOptionalToken(e));return i}advanceLexer(){const{maxTokens:e}=this._options,t=this._lexer.advance();if(t.kind!==kt.EOF&&(++this._tokenCounter,void 0!==e&&this._tokenCounter>e))throw cs(this._lexer.source,t.start,`Document contains more that ${e} tokens. Parsing aborted.`)}}function q7(n){const e=n.value;return ez(n.kind)+(null!=e?` "${e}"`:"")}function ez(n){return function eTe(n){return n===kt.BANG||n===kt.DOLLAR||n===kt.AMP||n===kt.PAREN_L||n===kt.PAREN_R||n===kt.DOT||n===kt.SPREAD||n===kt.COLON||n===kt.EQUALS||n===kt.AT||n===kt.BRACKET_L||n===kt.BRACKET_R||n===kt.BRACE_L||n===kt.PIPE||n===kt.BRACE_R}(n)?`"${n}"`:n}var X7=new Map,qw=new Map,tz=!0,q5=!1;function nz(n){return n.replace(/[\s,]+/g," ").trim()}function bTe(n){var e=nz(n);if(!X7.has(e)){var t=function fTe(n,e){const t=new K5(n,e),i=t.parseDocument();return Object.defineProperty(i,"tokenCount",{enumerable:!1,value:t.tokenCount}),i}(n,{experimentalFragmentVariables:q5,allowLegacyFragmentVariables:q5,experimentalFragmentArguments:q5});if(!t||"Document"!==t.kind)throw new Error("Not a valid GraphQL document.");X7.set(e,function vTe(n){var e=new Set(n.definitions);e.forEach(function(i){i.loc&&delete i.loc,Object.keys(i).forEach(function(o){var r=i[o];r&&"object"==typeof r&&e.add(r)})});var t=n.loc;return t&&(delete t.startToken,delete t.endToken),n}(function mTe(n){var e=new Set,t=[];return n.definitions.forEach(function(i){if("FragmentDefinition"===i.kind){var o=i.name.value,r=function gTe(n){return nz(n.source.body.substring(n.start,n.end))}(i.loc),s=qw.get(o);s&&!s.has(r)?tz&&console.warn("Warning: fragment with name "+o+" already exists.\ngraphql-tag enforces all fragment names across your application to be unique; read more about\nthis in the docs: http://dev.apollodata.com/core/fragments.html#unique-names"):s||qw.set(o,s=new Set),s.add(r),e.has(r)||(e.add(r),t.push(i))}else t.push(i)}),V0(V0({},n),{definitions:t})}(t)))}return X7.get(e)}function Hf(n){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];"string"==typeof n&&(n=[n]);var i=n[0];return e.forEach(function(o,r){i+=o&&"Document"===o.kind?o.loc.source.body:o,i+=n[r+1]}),bTe(i)}var X5_gql=Hf,X5_resetCaches=function CTe(){X7.clear(),qw.clear()},X5_disableFragmentWarnings=function yTe(){tz=!1},X5_enableExperimentalFragmentVariables=function wTe(){q5=!0},X5_disableExperimentalFragmentVariables=function ATe(){q5=!1};(function(n){n.gql=X5_gql,n.resetCaches=X5_resetCaches,n.disableFragmentWarnings=X5_disableFragmentWarnings,n.enableExperimentalFragmentVariables=X5_enableExperimentalFragmentVariables,n.disableExperimentalFragmentVariables=X5_disableExperimentalFragmentVariables})(Hf||(Hf={})),Hf.default=Hf;const STe=new class ITe extends NB{}(class TTe extends DB{constructor(e,t){super(e,t),this.scheduler=e,this.work=t}schedule(e,t=0){return t>0?super.schedule(e,t):(this.delay=t,this.state=e,this.scheduler.flush(this),this)}execute(e,t){return t>0||this.closed?super.execute(e,t):this._execute(e,t)}requestAsyncId(e,t,i=0){return null!=i&&i>0||null==i&&this.delay>0?super.requestAsyncId(e,t,i):(e.flush(this),0)}});function oz(n){return new wn(e=>(n().then(t=>{e.closed||(e.next(t),e.complete())},t=>{e.closed||e.error(t)}),()=>e.unsubscribe()))}class DTe{zone;constructor(e){this.zone=e}now=Date.now;schedule(e,t=0,i){return this.zone.run(()=>STe.schedule(e,t,i))}}function Xw(n,e){return n.pipe(Q9(new DTe(e)))}class NTe{obsQuery;valueChanges;constructor(e,t){this.obsQuery=e,this.valueChanges=Xw(tu(this.obsQuery),t)}get options(){return this.obsQuery.options}get variables(){return this.obsQuery.variables}getCurrentResult(){return this.obsQuery.getCurrentResult()}refetch(e){return this.obsQuery.refetch(e)}fetchMore(e){return this.obsQuery.fetchMore(e)}subscribeToMore(e){return this.obsQuery.subscribeToMore(e)}updateQuery(e){return this.obsQuery.updateQuery(e)}stopPolling(){return this.obsQuery.stopPolling()}startPolling(e){return this.obsQuery.startPolling(e)}setVariables(e){return this.obsQuery.setVariables(e)}reobserve(e){return this.obsQuery.reobserve(e)}}const Qw=new Pt("APOLLO_FLAGS"),rz=new Pt("APOLLO_OPTIONS"),sz=new Pt("APOLLO_NAMED_OPTIONS");class az{ngZone;flags;_client;useMutationLoading;constructor(e,t,i){this.ngZone=e,this.flags=t,this._client=i,this.useMutationLoading=t?.useMutationLoading??!1}watchQuery(e){return new NTe(this.ensureClient().watchQuery({...e}),this.ngZone)}query(e){return oz(()=>this.ensureClient().query({...e}))}mutate(e){return function xTe(n,e){return e?n.pipe(mo(t=>({...t,loading:!1})),function ETe(...n){const e=m3(n);return ia((t,i)=>{(e?j5(n,t,e):j5(n,t)).subscribe(i)})}({data:void 0,loading:!0})):n.pipe(mo(t=>({...t,loading:!1})))}(oz(()=>this.ensureClient().mutate({...e})),e.useMutationLoading??this.useMutationLoading)}watchFragment(e){const{useZone:t,...i}=e,o=this.ensureClient().watchFragment({...i});return!0!==t?o:Xw(o,this.ngZone)}subscribe(e){const{useZone:t,...i}=e,o=this.ensureClient().subscribe({...i});return!0!==t?o:Xw(o,this.ngZone)}get client(){return this.ensureClient()}set client(e){if(this._client)throw new Error("Client has been already defined");this._client=e}ensureClient(){return this.checkInstance(),this._client}checkInstance(){if(this._client)return!0;throw new Error("Client has not been defined yet")}}let Jw=(()=>{class n extends az{map=new Map;constructor(t,i,o,r){if(super(t,r),i&&this.createDefault(i),o&&"object"==typeof o)for(let s in o)o.hasOwnProperty(s)&&this.create(o[s],s)}create(t,i){eA(i)?this.createNamed(i,t):this.createDefault(t)}default(){return this}use(t){return eA(t)?this.map.get(t):this.default()}createDefault(t){if(this._client)throw new Error("Apollo has been already created.");this.client=this.ngZone.runOutsideAngular(()=>new $w(t))}createNamed(t,i){if(this.map.has(t))throw new Error(`Client ${t} has been already created`);this.map.set(t,new az(this.ngZone,this.flags,this.ngZone.runOutsideAngular(()=>new $w(i))))}removeClient(t){eA(t)?this.map.delete(t):this._client=void 0}static \u0275fac=function(i){return new(i||n)(xn(zo),xn(rz,8),xn(sz,8),xn(Qw,8))};static \u0275prov=Bt({token:n,factory:n.\u0275fac})}return n})();function eA(n){return!!n&&"default"!==n}const tA=Hf,Q7=(n,e)=>n&&e?[...n.keys()].reduce((t,i)=>t.set(i,n.get(i)),e):e||n;const nA={batchInterval:10,batchMax:10,uri:"graphql",method:"POST",withCredentials:!1,includeQuery:!0,includeExtensions:!1,useMultipart:!1};function yd(n,e,t){return function J7(...n){return n.find(e=>typeof e<"u")}(n[t],e[t],nA[t])}class RTe extends Ks{httpClient;options;requester;print=P7;constructor(e,t){super(),this.httpClient=e,this.options=t,this.options.operationPrinter&&(this.print=this.options.operationPrinter),this.requester=i=>new wn(o=>{const r=i.getContext();let s=yd(r,this.options,"method");const l=yd(r,this.options,"includeQuery"),h=yd(r,this.options,"includeExtensions"),f=yd(r,this.options,"uri"),m=yd(r,this.options,"withCredentials"),b=yd(r,this.options,"useMultipart"),A=!0===this.options.useGETForQueries,T=Q7(r.httpContext,Q7(this.options.httpContext,new sy)),U=i.query.definitions.some(Me=>"OperationDefinition"===Me.kind&&"query"===Me.operation);A&&U&&(s="GET");const K={method:s,url:"function"==typeof f?f(i):f,body:{operationName:i.operationName,variables:i.variables},options:{withCredentials:m,useMultipart:b,headers:this.options.headers,context:T}};h&&(K.body.extensions=i.extensions),l&&(K.body.query=this.print(i.query));const ne=function uz(n){let e=n.headers&&n.headers instanceof Ys?n.headers:new Ys(n.headers);if(n.clientAwareness){const{name:t,version:i}=n.clientAwareness;t&&!e.has("apollographql-client-name")&&(e=e.set("apollographql-client-name",t)),i&&!e.has("apollographql-client-version")&&(e=e.set("apollographql-client-version",i))}return e}(r);K.options.headers=((n,e)=>n&&e?e.keys().reduce((i,o)=>i.set(o,e.getAll(o)),n):e||n)(K.options.headers,ne);const ge=((n,e,t)=>{const i=-1!==["POST","PUT","PATCH"].indexOf(n.method.toUpperCase()),r=n.body.length;let l,s=n.options&&n.options.useMultipart;if(s){if(r)return new wn(f=>f.error(new Error("File upload is not available when combined with Batching")));if(!i)return new wn(f=>f.error(new Error("File upload is not available when GET is used")));if(!t)return new wn(f=>f.error(new Error('To use File upload you need to pass "extractFiles" function from "extract-files" library to HttpLink\'s options')));l=t(n.body),s=!!l.files.size}let h={};if(r){if(!i)return new wn(f=>f.error(new Error("Batching is not available for GET requests")));h={body:n.body}}else h=i?{body:s?l.clone:n.body}:{params:Object.keys(n.body).reduce((b,A)=>{const T=n.body[A];return b[A]=-1!==["variables","extensions"].indexOf(A.toLowerCase())?JSON.stringify(T):T,b},{})};if(s&&i){const f=new FormData;f.append("operations",JSON.stringify(h.body));const m={},b=l.files;let A=0;b.forEach(T=>{m[++A]=T}),f.append("map",JSON.stringify(m)),A=0,b.forEach((T,U)=>{f.append(++A+"",U,U.name)}),h.body=f}return e.request(n.method,n.url,{observe:"response",responseType:"json",reportProgress:!1,...h,...n.options})})(K,this.httpClient,this.options.extractFiles).subscribe({next:Me=>{i.setContext({response:Me}),o.next(Me.body)},error:Me=>o.error(Me),complete:()=>o.complete()});return()=>{ge.closed||ge.unsubscribe()}})}request(e){return this.requester(e)}}let kTe=(()=>{class n{httpClient;constructor(t){this.httpClient=t}create(t){return new RTe(this.httpClient,t)}static \u0275fac=function(i){return new(i||n)(xn(ud))};static \u0275prov=Bt({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();function dz(n,e){this.v=n,this.k=e}function iA(n){return new dz(n,0)}function oA(n){return function(){return new Q5(n.apply(this,arguments))}}function Q5(n){var e,t;function i(r,s){try{var l=n[r](s),h=l.value,f=h instanceof dz;Promise.resolve(f?h.v:h).then(function(m){if(f){var b="return"===r&&h.k?r:"next";if(!h.k||m.done)return i(b,m);m=n[b](m).value}o(!!l.done,m)},function(m){i("throw",m)})}catch(m){o(2,m)}}function o(r,s){2===r?e.reject(s):e.resolve({value:s,done:r}),(e=e.next)?i(e.key,e.arg):t=null}this._invoke=function(r,s){return new Promise(function(l,h){var f={key:r,arg:s,resolve:l,reject:h,next:null};t?t=t.next=f:(e=t=f,i(r,s))})},"function"!=typeof n.return&&(this.return=void 0)}function rA(n){var e,t,i,o=2;for(typeof Symbol<"u"&&(t=Symbol.asyncIterator,i=Symbol.iterator);o--;){if(t&&null!=(e=n[t]))return e.call(n);if(i&&null!=(e=n[i]))return new e8(e.call(n));t="@@asyncIterator",i="@@iterator"}throw new TypeError("Object is not async iterable")}function e8(n){function e(t){if(Object(t)!==t)return Promise.reject(new TypeError(t+" is not an object."));var i=t.done;return Promise.resolve(t.value).then(function(o){return{value:o,done:i}})}return(e8=function(i){this.s=i,this.n=i.next}).prototype={s:null,n:null,next:function(){return e(this.n.apply(this.s,arguments))},return:function(i){var o=this.s.return;return void 0===o?Promise.resolve({value:i,done:!0}):e(o.apply(this.s,arguments))},throw:function(i){var o=this.s.return;return void 0===o?Promise.reject(i):e(o.apply(this.s,arguments))}},new e8(n)}function PTe(n){if("next"!==n&&"complete"!==n)throw new Error(`Invalid stream event "${n}"`);return n}function FTe(n,e){if(e)try{e=JSON.parse(e)}catch{throw new Error("Invalid stream data")}if("next"===n&&!e)throw new Error('Stream data must be an object for "next" events');return e||null}Q5.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},Q5.prototype.next=function(n){return this._invoke("next",n)},Q5.prototype.throw=function(n){return this._invoke("throw",n)},Q5.prototype.return=function(n){return this._invoke("return",n)};var Uf=function(n){return n[n.NewLine=10]="NewLine",n[n.CarriageReturn=13]="CarriageReturn",n[n.Space=32]="Space",n[n.Colon=58]="Colon",n}(Uf||{});class ql extends Error{constructor(e){let t,i;!function VTe(n){return function UTe(n){return"object"==typeof n&&null!==n}(n)&&"boolean"==typeof n.ok&&"number"==typeof n.status&&"string"==typeof n.statusText}(e)?t=e instanceof Error?e.message:String(e):(i=e,t="Server responded with "+e.status+": "+e.statusText),super(t),this.name=this.constructor.name,this.response=i}}function hz(n){return sA.apply(this,arguments)}function sA(){return sA=(0,M.A)(function*(n){const{signal:e,url:t,credentials:i,headers:o,body:r,referrer:s,referrerPolicy:l,fetchFn:h,onMessage:f}=n,m={},b={};let A;try{A=yield h(t,{signal:e,method:r?"POST":"GET",credentials:i,referrer:s,referrerPolicy:l,headers:{...o,accept:"text/event-stream"},body:r})}catch(K){throw new ql(K)}if(!A.ok)throw new ql(A);if(!A.body)throw new Error("Missing response body");let U,T=null;return(0,M.A)(function*(){var K;try{const Zt=function HTe(){let n,e,t,i=!1,o={event:"",data:""},r=[];const s=new TextDecoder;return function(h){if(void 0===n)n=h,e=0,t=-1;else{const b=new Uint8Array(n.length+h.length);b.set(n),b.set(h,n.length),n=b}const f=n.length;let m=0;for(;e<f;){i&&(n[e]===Uf.NewLine&&(m=++e),i=!1);let b=-1;for(;e<f&&-1===b;++e)switch(n[e]){case Uf.Colon:-1===t&&(t=e-m);break;case Uf.CarriageReturn:i=!0;case Uf.NewLine:b=e}if(-1===b)break;if(m===b){if(o.event||o.data){if(!o.event)throw new Error("Missing message event");const A=PTe(o.event),T=FTe(A,o.data);r.push({event:A,data:T}),o={event:"",data:""}}}else if(t>0){const A=n.subarray(m,b),T=s.decode(A.subarray(0,t)),K=s.decode(A.subarray(t+(A[t+1]===Uf.Space?2:1)));switch(T){case"event":o.event=K;break;case"data":o.data=o.data?o.data+"\n"+K:K}}m=e,t=-1}if(m===f){n=void 0;const b=[...r];return r=[],b}0!==m&&(n=n.subarray(m),e-=m)}}();var Me,ne=!1,ge=!1;try{for(var Nt,Ct=rA(function jTe(n){return"function"==typeof Object(n)[Symbol.asyncIterator]?n:oA(function*(){const e=n.getReader();let t;do{t=yield iA(e.read()),void 0!==t.value&&(yield t.value)}while(!t.done)})()}(A.body));ne=!(Nt=yield Ct.next()).done;ne=!1){const Wn=Nt.value;{if("string"==typeof Wn)throw T=new Error(`Unexpected string chunk "${Wn}"`);let Ri;try{Ri=Zt(Wn)}catch(ci){throw T=ci}if(!Ri)continue;for(const ci of Ri){try{f?.(ci)}catch(ki){throw T=ki}const Yi=ci.data&&"id"in ci.data?ci.data.id:"";switch(Yi in b||(b[Yi]=[]),ci.event){case"next":b[Yi].push(Yi?ci.data.payload:ci.data);break;case"complete":b[Yi].push("complete");break;default:throw T=new Error(`Unexpected message event "${ci.event}"`)}null===(K=m[Yi])||void 0===K||K.proceed()}}}}catch(Wn){ge=!0,Me=Wn}finally{try{ne&&null!=Ct.return&&(yield Ct.return())}finally{if(ge)throw Me}}if(Object.keys(m).length)throw new Error("Connection closed while having active streams")}catch(Zt){T=!T&&Object.keys(m).length?new ql(Zt):Zt,U?.(T)}finally{Object.values(m).forEach(({proceed:Zt})=>Zt())}})(),{url:t,headers:o,waitForThrow:()=>new Promise((K,ne)=>{if(T)return ne(T);U=ne}),getResults:K=>oA(function*(){var ne;const{signal:ge,operationId:Me=""}=K??{};try{for(;;){for(;null!==(ne=b[Me])&&void 0!==ne&&ne.length;){const Ct=b[Me].shift();if("complete"===Ct)return;yield Ct}if(T)throw T;if(ge?.aborted)throw new Error("Getting results aborted by the client");yield iA(new Promise(Ct=>{const Nt=()=>{ge?.removeEventListener("abort",Nt),delete m[Me],Ct()};ge?.addEventListener("abort",Nt),m[Me]={proceed:Nt}}))}}finally{delete b[Me]}})()}}),sA.apply(this,arguments)}class GTe extends Ks{constructor(e){super(),this.client=function zTe(n){const{singleConnection:e=!1,lazy:t=!0,lazyCloseTimeout:i=0,onNonLazyError:o=console.error,generateID:r=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,Yi=>{const ki=16*Math.random()|0;return("x"==Yi?ki:3&ki|8).toString(16)})},retryAttempts:s=5,retry:l=function(){var ci=(0,M.A)(function*(ki){let Ji=1e3;for(let ks=0;ks<ki;ks++)Ji*=2;yield new Promise(ks=>setTimeout(ks,Ji+Math.floor(2700*Math.random()+300)))});return function Yi(ki){return ci.apply(this,arguments)}}(),credentials:h="same-origin",referrer:f,referrerPolicy:m,onMessage:b,on:A}=n,T=n.fetchFn||fetch,U=n.abortControllerImpl||AbortController,K=(()=>{let ci=!1;const Yi=[];return{get disposed(){return ci},onDispose:ki=>ci?(setTimeout(()=>ki(),0),()=>{}):(Yi.push(ki),()=>{Yi.splice(Yi.indexOf(ki),1)}),dispose(){if(!ci){ci=!0;for(const ki of[...Yi])ki()}}}})();let ne,ge,Me=0,Ct=null,Nt=0;function Zt(){return Wn.apply(this,arguments)}function Wn(){return(Wn=(0,M.A)(function*(){try{if(K.disposed)throw new Error("Client has been disposed");return yield ge??(ge=(0,M.A)(function*(){var ci,Yi,ki;if(Ct){if(yield l(Nt),ne.signal.aborted)throw new Error("Connection aborted by the client");Nt++}null===(ci=A?.connecting)||void 0===ci||ci.call(A,!!Ct),ne=new U;const Ji=K.onDispose(()=>ne.abort());ne.signal.addEventListener("abort",()=>{Ji(),ge=void 0});const ks=n,Lr="function"==typeof ks.url?yield ks.url(void 0):ks.url;if(ne.signal.aborted)throw new Error("Connection aborted by the client");const es="function"==typeof ks.headers?yield ks.headers(void 0):null!==(Yi=ks.headers)&&void 0!==Yi?Yi:{};if(ne.signal.aborted)throw new Error("Connection aborted by the client");let us;try{us=yield T(Lr,{signal:ne.signal,method:"PUT",credentials:h,referrer:f,referrerPolicy:m,headers:es})}catch(Xl){throw new ql(Xl)}if(201!==us.status)throw new ql(us);const mu=yield us.text();es["x-graphql-event-stream-token"]=mu;const Ad=yield hz({signal:ne.signal,headers:es,credentials:h,referrer:f,referrerPolicy:m,url:Lr,fetchFn:T,onMessage:Xl=>{var vu;null===(vu=A?.message)||void 0===vu||vu.call(A,Xl),b?.(Xl)}});return null===(ki=A?.connected)||void 0===ki||ki.call(A,!!Ct),Ad.waitForThrow().catch(()=>ge=void 0),Ad})())}catch(ci){throw ge=void 0,ci}})).apply(this,arguments)}function Ri(ci,Yi,ki){if(!e){const Lr=new U,es=K.onDispose(()=>{es(),Lr.abort()});return(0,M.A)(function*(){var us,mu,Ad,Xl,vu;let ya=null,b1=0;for(;;)try{if(ya){if(yield l(b1),Lr.signal.aborted)throw new Error("Connection aborted by the client");b1++}null===(us=A?.connecting)||void 0===us||us.call(A,!!ya),null===(mu=ki?.connecting)||void 0===mu||mu.call(ki,!!ya);const Cl=n,nDe="function"==typeof Cl.url?yield Cl.url(ci):Cl.url;if(Lr.signal.aborted)throw new Error("Connection aborted by the client");const iDe="function"==typeof Cl.headers?yield Cl.headers(ci):null!==(Ad=Cl.headers)&&void 0!==Ad?Ad:{};if(Lr.signal.aborted)throw new Error("Connection aborted by the client");const{getResults:oDe}=yield hz({signal:Lr.signal,headers:{...iDe,"content-type":"application/json; charset=utf-8"},credentials:h,referrer:f,referrerPolicy:m,url:nDe,body:JSON.stringify(ci),fetchFn:T,onMessage:y1=>{var xA,DA;null===(xA=A?.message)||void 0===xA||xA.call(A,y1),null===(DA=ki?.message)||void 0===DA||DA.call(ki,y1),b?.(y1)}});null===(Xl=A?.connected)||void 0===Xl||Xl.call(A,!!ya),null===(vu=ki?.connected)||void 0===vu||vu.call(ki,!!ya);var bu,sm=!1,jf=!1;try{for(var C1,Kh=rA(oDe());sm=!(C1=yield Kh.next()).done;sm=!1)ya=null,b1=0,Yi.next(C1.value)}catch(y1){jf=!0,bu=y1}finally{try{sm&&null!=Kh.return&&(yield Kh.return())}finally{if(jf)throw bu}}return Lr.abort()}catch(Cl){if(Lr.signal.aborted)return;if(!(Cl instanceof ql)||!s||b1>=s)throw Cl;ya=Cl}})().then(()=>Yi.complete()).catch(us=>Yi.error(us)),()=>Lr.abort()}Me++;const Ji=new U,ks=K.onDispose(()=>{ks(),Ji.abort()});return(0,M.A)(function*(){const Lr=r();ci={...ci,extensions:{...ci.extensions,operationId:Lr}};let es=null;for(;;){es=null;try{const{url:ya,headers:b1,getResults:sm}=yield Zt();let jf;try{jf=yield T(ya,{signal:Ji.signal,method:"POST",credentials:h,referrer:f,referrerPolicy:m,headers:{...b1,"content-type":"application/json; charset=utf-8"},body:JSON.stringify(ci)})}catch(bu){throw new ql(bu)}if(202!==jf.status)throw new ql(jf);es=function(){var bu=(0,M.A)(function*(){let Kh;try{const C1=new U,Cl=K.onDispose(()=>{Cl(),C1.abort()});Kh=yield T(ya+"?operationId="+Lr,{signal:C1.signal,method:"DELETE",credentials:h,referrer:f,referrerPolicy:m,headers:b1})}catch(C1){throw new ql(C1)}if(200!==Kh.status)throw new ql(Kh)});return function(){return bu.apply(this,arguments)}}();var Ad,us=!1,mu=!1;try{for(var vu,Xl=rA(sm({signal:Ji.signal,operationId:Lr}));us=!(vu=yield Xl.next()).done;us=!1)Ct=null,Nt=0,Yi.next(vu.value)}catch(bu){mu=!0,Ad=bu}finally{try{us&&null!=Xl.return&&(yield Xl.return())}finally{if(mu)throw Ad}}return es=null,Ji.abort()}catch(ya){if(Ji.signal.aborted)return yield es?.();if(!(ya instanceof ql)||(t&&(ge=void 0),!s||Nt>=s))throw Ji.abort(),ya;Ct=ya}finally{Ji.signal.aborted&&0===--Me&&(isFinite(i)&&i>0?setTimeout(()=>{Me||ne.abort()},i):ne.abort())}}})().then(()=>Yi.complete()).catch(Lr=>Yi.error(Lr)),()=>Ji.abort()}return e&&!t&&(0,M.A)(function*(){for(Me++;;)try{const{waitForThrow:ci}=yield Zt();yield ci()}catch(ci){if(K.disposed)return;if(!(ci instanceof ql)||(ge=void 0,!s||Nt>=s))return o?.(ci);Ct=ci}})(),{subscribe:Ri,iterate(ci,Yi){const ki=[],Ji={done:!1,error:null,resolve:()=>{}},ks=Ri(ci,{next(es){ki.push(es),Ji.resolve()},error(es){Ji.done=!0,Ji.error=es,Ji.resolve()},complete(){Ji.done=!0,Ji.resolve()}},Yi),Lr=(es=oA(function*(){for(;;){for(ki.length||(yield iA(new Promise(mu=>Ji.resolve=mu)));ki.length;)yield ki.shift();if(Ji.error)throw Ji.error;if(Ji.done)return}}),function us(){return es.apply(this,arguments)})();var es;return Lr.throw=function(){var es=(0,M.A)(function*(us){return Ji.done||(Ji.done=!0,Ji.error=us,Ji.resolve()),{done:!0,value:void 0}});return function(us){return es.apply(this,arguments)}}(),Lr.return=(0,M.A)(function*(){return ks(),{done:!0,value:void 0}}),Lr},dispose(){K.dispose()}}}(e)}request(e){return new wn(t=>this.client.subscribe({...e,query:P7(e.query)},{next:t.next.bind(t),complete:t.complete.bind(t),error:t.error.bind(t)}))}}const WTe={run:n=>n(),runOutsideAngular:n=>n()};let _z=(()=>{class n{constructor(){this.httpLink=we(kTe),this.gatewayService=we(oH),this.apollo=(t,i=!1)=>new Jw(WTe,this.createApolloOptions(t,i))}createApolloOptions(t,i=!1){const o=new NU(h=>{const f=h.headers instanceof Ys?h.headers:new Ys(h.headers??{});return{...h,uri:()=>this.gatewayService.getGatewayUrl(t,i),headers:f.set("Authorization",`Bearer ${t.token}`).set("Accept","charset=utf-8")}}),r=Kye(({query:h})=>{const f=mw(h);return"OperationDefinition"===f.kind&&"subscription"===f.operation},new GTe({url:()=>this.gatewayService.getGatewayUrl(t,i),headers:()=>({Authorization:`Bearer ${t.token}`})}),this.httpLink.create({}));return{link:Ks.from([o,r]),cache:new DU}}static{this.\u0275fac=function(i){return new(i||n)}}static{this.\u0275prov=Bt({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();function pz(n){let e=n.replace(/[^a-zA-Z0-9]/g,"_");return/^[0-9]/.test(e)&&(e="_"+e),e}function aA(n){return n.split("_").filter(e=>e.length>0).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join("")}function fz(n,e,t){let i;if(n&&e)i=aA(pz(n)+"_"+e);else if(n)i=aA(pz(n));else{if(!e)return`${t}_Input`;i=aA("_"+e)}return`${i}${t}_Input`}function J5(n,e="_"){return[n.apiGroup,n.version,n.entity].filter(t=>!!t).join(e)}const t8=n=>{const e=[];return n.map(t=>{t.property instanceof Array?t.property.map(i=>lA(i,e)):lA(t.property,e)}),e},lA=(n,e=[])=>{if(!n)return[];const t=n.split(".");for(const i of t)return 1===t.length?(e.push(i),e):(e.push({[i]:[...lA(t.splice(1).join("."))]}),e)},em=(n,e)=>{const t=e.jsonPathExpression||e.property;if(!t)return;if(t instanceof Array)return void console.error(`Property defined as an array: ${JSON.stringify(t)}, provide "jsonPathExpression" field to properly ready resource value`);const o=po({path:`${t.startsWith("$.")?"":"$."}${t}`,json:n}),r=o.length?o[0]:void 0;return r&&e.propertyField?$Te(r[e.propertyField.key],e.propertyField.transform):r},$Te=(n,e)=>null!=n&&null!=e&&e.length?e.reduce((t,i)=>{if(null==t)return t;switch(i){case"uppercase":return t.toUpperCase();case"lowercase":return t.toLowerCase();case"capitalize":{const o=String(t);return o.length?o.charAt(0).toUpperCase()+o.slice(1):o}case"decode":try{return YTe(t)}catch{return t}case"encode":try{return ZTe(t)}catch{return t}default:return t}},n):n,ZTe=n=>{try{const e=(new TextEncoder).encode(n),t=Array.from(e,i=>String.fromCharCode(i)).join("");return btoa(t)}catch(e){throw console.error("Base64 encoding failed:",e),new Error("Failed to encode string to Base64")}},YTe=n=>{try{const e=atob(n),t=Uint8Array.from(e,i=>i.charCodeAt(0));return(new TextDecoder).decode(t)}catch(e){throw console.error("Base64 decoding failed:",e),new Error("Failed to decode Base64 string")}},zf=(n,e)=>em(n,{jsonPathExpression:e});function wd(n){return"Namespaced"===n?.resourceDefinition?.scope}function gz(n,e,t){if(!e)return n;const{getItemKey:i,mapSubscriptionObjectToItem:o}=t,r=new Map;n.forEach(m=>{const b=i(m);b&&r.set(b,m)});const{type:s,object:l}=e,h=l.metadata?.name;if(!h)return n;const f=o(l);return"ADDED"===s?r.set(h,f):"MODIFIED"===s?r.has(h)&&r.set(h,f):"DELETED"===s&&r.delete(h),[...r.values()]}function cA(n){if(Array.isArray(n))return n.map(e=>cA(e));if(n&&"object"==typeof n){const{__typename:e,...t}=n;for(const i of Object.keys(t))t[i]=cA(t[i]);return t}return n}var Vf=rt(7184);let tm=(()=>{class n{constructor(){this.apolloFactory=we(_z),this.luigiCoreService=we(Cr)}read(t,i,o,r,s=!0){const l=wd(r),h=this.getNamespace(r);let f=this.resolveReadQuery(i,o,t,l?h:void 0);return f=this.parseGQLQuery(f),this.apolloFactory.apollo(r,s).query({query:f,variables:{name:t,...l&&{namespace:h}}}).pipe(mo(m=>zf(m.data,J5(i,"."))))}resolveReadQuery(t,i,o,r){if(i instanceof Array){const{entity:s,version:l,apiGroup:h}=t,f=[{operation:s,variables:{name:{value:o,type:"String!"},...r&&{namespace:{value:r,type:"String"}}},fields:i}],m=this.calcQueryOptions(f,[{operation:h},{operation:l}]);return Vf.P(m).query}return i}list(t,i,o,r=!1,s){const h={...wd(o)&&{namespace:{type:"String",value:this.getNamespace(o)}},...s?.limit&&{limit:{type:"Int",value:s?.limit}},...s?.continue&&{continue:{type:"String",value:s?.continue}}},f=o.resourceDefinition;return f?i instanceof Array?this.listWithFields(f,i,o,r,h):this.listWithRawQuery(t,i,o,r,h):Zh(()=>new Error("Resource definition is required"))}getResourceReadyStatus(t,i){const o=i.resourceDefinition?.readyCondition;return!o||em(t,o)}listWithFields(t,i,o,r,s){const{apiGroup:l,entityCollection:h,version:f}=t,b=this.calcQueryOptions([{operation:h,variables:s,fields:["resourceVersion","remainingItemCount","continue",{items:i}]}],[{operation:l},{operation:f}]),A=Vf.P(b),T=this.parseGQLQuery(A.query);return this.apolloFactory.apollo(o,r).query({query:T,variables:A.variables}).pipe(mo(U=>{const K=zf(U.data,J5({apiGroup:l,version:f,entity:h},"."));if(!K)throw new Error("Resource list result not found");return K}),mo(U=>{const K=U.items.map(ne=>({...ne,ready:this.getResourceReadyStatus(ne,o)})).map(ne=>({...ne,id:ne.metadata.name,isAvailable:this.isAvailable(ne),accessibleName:this.getAccessibleName(ne)}));return{...U,items:K}}))}isAvailable(t){return!!t.ready&&!t.metadata?.deletionTimestamp}getAccessibleName(t){return t.metadata?.deletionTimestamp?"Resource is pending deletion":t.ready?void 0:"Resource is not ready"}listWithRawQuery(t,i,o,r,s){const l=this.parseGQLQuery(i);return this.apolloFactory.apollo(o,r).query({query:l,variables:this.normalizeGqlBuilderVariables(s)}).pipe(mo(h=>zf(h.data,t)??[]),bd(h=>(this.alertErrors(h),console.error("Error executing GraphQL query.",h),Zh(()=>h))))}resourceChangeSubscription(t,i,o,r,s){const h={...wd(o)&&{namespace:{type:"String",value:this.getNamespace(o)}}},f=t.toLowerCase(),m=Vf.gP({operation:f,fields:["type",{object:i}],variables:{...h,resourceVersion:{type:"String",value:r}}}),b=this.parseGQLQuery(m.query);return this.apolloFactory.apollo(o,s).subscribe({query:b,variables:m.variables}).pipe(mo(A=>{const T=zf(A.data,f);return T&&(T.object.ready=this.getResourceReadyStatus(T.object,o),T.object.id=T.object.metadata.name,T.object.isAvailable=this.isAvailable(T.object),T.object.accessibleName=this.getAccessibleName(T.object)),T}))}alertErrors(t){this.luigiCoreService.showAlert({text:t.message,type:"error"})}delete(t,i,o,r=!1){const s=wd(o),{apiGroup:l,entity:h,version:f}=i,m=[{operation:`delete${h}`,variables:{name:{type:"String!",value:t.metadata.name},...s&&{namespace:{type:"String",value:this.getNamespace(o)}}},fields:[]}],b=this.calcQueryOptions(m,[{operation:l},{operation:f}]),A=Vf.gO(b),T=this.parseGQLQuery(A.query);return this.apolloFactory.apollo(o,r).mutate({mutation:T,variables:A.variables}).pipe(bd(U=>(this.alertErrors(U),console.error("Error executing GraphQL query.",U),Zh(()=>U))))}create(t,i,o){const r=wd(o),{apiGroup:s,entity:l,version:h}=i,f=this.getNamespace(o,t),m=[{operation:`create${l}`,variables:{...r&&{namespace:{type:"String",value:f}},object:{type:`${fz(s,h,l)}!`,value:t}},fields:["__typename"]}],b=this.calcQueryOptions(m,[{operation:s},{operation:h}]),A=Vf.gO(b),T=this.parseGQLQuery(A.query);return this.apolloFactory.apollo(o).mutate({mutation:T,fetchPolicy:"no-cache",variables:A.variables}).pipe(bd(U=>(this.alertErrors(U),console.error("Error executing GraphQL query.",U),Zh(()=>U))))}update(t,i,o,r=!1,s=["__typename"]){const l=wd(o),{apiGroup:h,entity:f,version:m}=i,b=this.getNamespace(o),A=cA(t),T=[{operation:`update${f}`,variables:{...l&&{namespace:{type:"String",value:b}},name:{type:"String!",value:t.metadata.name},object:{type:`${fz(h,m,f)}!`,value:A}},fields:s}],U=this.calcQueryOptions(T,[{operation:h},{operation:m}]),K=Vf.gO(U),ne=this.parseGQLQuery(K.query);return this.apolloFactory.apollo(o,r).mutate({mutation:ne,fetchPolicy:"no-cache",variables:K.variables}).pipe(mo(ge=>zf(ge.data,J5({apiGroup:h,entity:`update${f}`,version:m},"."))),bd(ge=>(this.alertErrors(ge),console.error("Error executing GraphQL query.",ge),Zh(()=>ge))))}getNamespace(t,i){if(t.namespaceId)return t.namespaceId;if(i?.metadata?.namespace)return i.metadata.namespace;const o=this.luigiCoreService.routing().getSearchParams().namespace;return o?"-all-"===o?void 0:o:void 0}normalizeGqlBuilderVariables(t){return Object.fromEntries(Object.entries(t).map(([i,o])=>[i,o.value]))}calcQueryOptions(t,i){const o=i.filter(l=>!!l?.operation);if(0===o.length){const l=t.pop();if(l&&l.operation&&l.fields)return l;throw new Error("At least one wrapper or inner fields is required")}let r=t,s=o.pop();return o.forEach(l=>{r=[{operation:s.operation,fields:t,variables:s.variables}],s=l}),{operation:s.operation,fields:r,variables:s.variables}}parseGQLQuery(t){try{return tA`
82
82
  ${t}
83
83
  `}catch(i){throw this.luigiCoreService.showAlert({text:`Could not parse gql query: <br/><br/> ${t} <br/><br/> ${i.message}`,type:"error"}),i}}asReadResources(){return{list:(t,i,o)=>this.list(o.operation??t.resourceDefinition?.entityCollection??"",o.fields??t.resourceDefinition?.ui?.listView?.fields??[],t,o.readFromParentKcpPath??!1,{limit:i.limit,continue:i.cursor}).pipe(mo(h=>({items:h?.items??[],nextCursor:h?.continue,remainingItemCount:h?.remainingItemCount,resourceVersion:h?.resourceVersion}))),subscribe:(t,i)=>{const o=t.resourceDefinition?.entityCollection??"",r=Array.isArray(i.fields)?i.fields:t.resourceDefinition?.ui?.listView?.fields??[];return this.resourceChangeSubscription(o,r,t,i.resourceVersion??"",i.readFromParentKcpPath??!1)}}}static{this.\u0275fac=function(i){return new(i||n)}}static{this.\u0275prov=Bt({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();const qTe=tA`
84
84
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platform-mesh/portal-ui-lib",
3
- "version": "0.49.7",
3
+ "version": "0.49.9",
4
4
  "repository": {
5
5
  "url": "git+https://github.com/platform-mesh/portal-ui-lib.git"
6
6
  },