@platform-mesh/portal-ui-lib 0.44.30 → 0.44.33
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.
|
@@ -64,7 +64,7 @@ class ci{headers;normalizedNames=new Map;lazyInit;lazyUpdate=null;constructor(t)
|
|
|
64
64
|
* @license Angular v21.2.8
|
|
65
65
|
* (c) 2010-2026 Google LLC. https://angular.dev/
|
|
66
66
|
* License: MIT
|
|
67
|
-
*/globalThis.$localize=u2;const ar=globalThis.Luigi;let po=(()=>{class e{setConfig(n){return ar.setConfig(n)}get config(){return ar.getConfig()}getConfigValue(n){return ar.getConfigValue(n)}unloadConfig(){return ar.unload()}sendCustomMessage(n){return ar.sendCustomMessage(n)}configChanged(n){ar.configChanged(n)}customMessages(){return ar.customMessages()}navigation(){return ar.navigation()}resetLuigi(){ar.reset()}clearNavigationCache(){ar.clearNavigationCache&&ar.clearNavigationCache()}showAlert(n){return ar.showAlert(n)}ux(){return ar.ux()}theming(){return ar.theming()}i18n(){return ar.i18n()}globalSearch(){return ar.globalSearch()}getGlobalContext(){return ar.getGlobalContext()}getWcExtendedContext(){return document.querySelector(".wcContainer")?.querySelector("[lui_web_component]")?.extendedContext?.context}getWcModalExtendedContext(){return document.querySelector(".iframeModalCtn")?.querySelector("[lui_web_component]")?.extendedContext?.context}setGlobalContext(n,r=!1){ar.setGlobalContext(n,r)}setInGlobalContext(n,r=!1){ar.setGlobalContext({...this.getGlobalContext(),...n},r)}routing(){return ar.routing()}setFeatureToggle(n){ar.featureToggles().setFeatureToggle(n)}unsetFeatureToggle(n){ar.featureToggles().unsetFeatureToggle(n)}unsetAllFeatureToggles(){ar.featureToggles().getActiveFeatureToggleList().forEach(n=>{this.unsetFeatureToggle(n)})}setFeatureToggles(n){if(n)for(const r of Object.keys(n))n[r]&&this.setFeatureToggle(r)}isFeatureToggleActive(n){return ar.featureToggles().getActiveFeatureToggleList().includes(n)}getActiveFeatureToggleList(){return ar.featureToggles().getActiveFeatureToggleList()}setAuthData(n){ar.auth().store.setAuthData(n),ar.auth().store.setNewlyAuthorized()}removeAuthData(){ar.auth().store.removeAuthData()}getAuthData(){return ar.auth().store.getAuthData()}setCurrentLocale(n){ar.i18n().setCurrentLocale(n)}static{this.\u0275fac=function(r){return new(r||e)}}static{this.\u0275prov=Te({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})(),nu=(()=>{class e{constructor(){this.http=fe(Hl)}getEnvConfig(){var n=this;return(0,K.A)(function*(){return n.envConfigCache||(yield Zh(n.http.get("/rest/envconfig").pipe(Kc(r=>n.envConfigCache=r)))),n.envConfigCache})()}static{this.\u0275fac=function(r){return new(r||e)}}static{this.\u0275prov=Te({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})(),Ba=(()=>{class e{constructor(){this.envConfigService=fe(nu),this.luigiCoreService=fe(po),this.fallbackLanguage="en",this.translationTable={},this.currentLanguage=""}afterInit(){this.currentLanguage=this.luigiCoreService.i18n().getCurrentLocale(),this.luigiCoreService.i18n().addCurrentLocaleChangeListener(n=>{this.currentLanguage=n})}getTranslation(n,r,o){let i=this.getInternalTranslation(n,r,o);return i||(i=this.findTranslation(n,this.translationTable,this.fallbackLanguage,r)),i||n}getTranslationAsync(n,r,o){var i=this;return(0,K.A)(function*(){return new Promise(s=>{let a=i.getInternalTranslation(n,r,o);a?s(a||n):i.translationTable&&!i.translationTable[i.fallbackLanguage]?i.fetchTranslationFile(i.fallbackLanguage).then(()=>{a=i.findTranslation(n,i.translationTable,i.fallbackLanguage,r),s(a||n)}):(a=i.findTranslation(n,i.translationTable,i.fallbackLanguage,r),s(a||n))})})()}findTranslation(n,r,o,i){if(r[o]){const s="object"==typeof r[o][n]?r[o][n].join("<br>"):r[o][n];return i?this.findInterpolations(s,i):s}}findInterpolations(n,r){if(n)return Object.keys(r).forEach(o=>{n=n.replace(new RegExp("{"+o+"}","gi"),r[o])}),n}addTranslationFile(n,r){r&&n&&(this.translationTable[n]=r)}fetchTranslationFile(n){var r=this;return(0,K.A)(function*(){return new Promise(o=>{fetch(`/assets/translation-files/${n}.json`).then(i=>i.json()).then(i=>{r.addTranslationFile(n,i),o(!0)}).catch(i=>{console.error("Error:",i),r.addTranslationFile(n,{}),o(!1)})})})()}getInternalTranslation(n,r,o){return n?(this.currentLanguage=o||this.currentLanguage||this.luigiCoreService.i18n().getCurrentLocale(),this.findTranslation(n,this.translationTable,this.currentLanguage,r)):""}getValidLanguages(){var n=this;return(0,K.A)(function*(){const r=[{value:"en",label:"USERSETTINGSDIALOG_LANGUAGE_EN"}];try{const{developmentInstance:o}=yield n.envConfigService.getEnvConfig();o&&r.push({value:"de",label:"USERSETTINGSDIALOG_LANGUAGE_DE"})}finally{return r}})()}static{this.\u0275fac=function(r){return new(r||e)}}static{this.\u0275prov=Te({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();var ru=function(e){return e.LAST_NAVIGATION_URL="openmfp.navigation.lastUrl",e.USER_SETTINGS="openmfp.settings.userSettings",e.LOCAL_DEVELOPMENT_SETTINGS="openmfp.settings.localDevelopmentSettings",e.FEATURE_TOGGLE_SETTINGS="openmfp.settings.featureToggleSettings",e.DEVELOPMENT_MODE_CONFIG="dev-mode-settings",e}(ru||{});(0,K.A)(function*(t){return t.frame_userAccount&&t.frame_userAccount.language?(delete t.frame_userAccount.name,delete t.frame_userAccount.email):delete t.frame_userAccount,new Promise((n,r)=>{try{localStorage.setItem(ru.USER_SETTINGS,JSON.stringify(t)),n(t)}catch(o){console.error("Error storing user settings",o),r({closeDialog:!0,message:"Could not write userSettings to storage..."})}})}),document.body.classList.add("ui5-content-density-compact");let dx=(()=>{class e{constructor(){this.luigiCoreService=fe(po)}getGatewayUrl(n,r=!1){const o=n.portalContext.crdGatewayApiUrl,i=this.extractKcpPath(o);return o?.replace(i,this.resolveKcpPath(n,r))}updateCrdGatewayUrlWithEntityPath(n){const r=this.luigiCoreService.getGlobalContext().portalContext.crdGatewayApiUrl,o=this.extractKcpPath(r);this.luigiCoreService.getGlobalContext().portalContext.crdGatewayApiUrl=r.replace(o,n)}resolveKcpPath(n,r=!1){let i=this.extractKcpPath(n.portalContext.crdGatewayApiUrl);if(n.kcpPath&&(i=n.kcpPath),r){const s=i.lastIndexOf(":");-1!==s&&(i=i.slice(0,s))}return i}extractKcpPath(n){return n.match(new RegExp("(root:orgs[^/]*)"))?.[1]||""}static{this.\u0275fac=function(r){return new(r||e)}}static{this.\u0275prov=Te({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();const Wl=new Lt(e=>e.complete());function ps(e,t){return e.definitions.find(n=>"OperationDefinition"===n.kind&&!!n.name)?.name.value??t}function f2(e,t){if(!e)throw new Error(t)}function Z8(e){return p2(e,[])}function p2(e,t){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return function kie(e,t){if(null===e)return"null";if(t.includes(e))return"[Circular]";const n=[...t,e];if(function Rie(e){return"function"==typeof e.toJSON}(e)){const r=e.toJSON();if(r!==e)return"string"==typeof r?r:p2(r,n)}else if(Array.isArray(e))return function Pie(e,t){if(0===e.length)return"[]";if(t.length>2)return"[Array]";const n=Math.min(10,e.length),r=e.length-n,o=[];for(let i=0;i<n;++i)o.push(p2(e[i],t));return 1===r?o.push("... 1 more item"):r>1&&o.push(`... ${r} more items`),"["+o.join(", ")+"]"}(e,n);return function Oie(e,t){const n=Object.entries(e);return 0===n.length?"{}":t.length>2?"["+function Bie(e){const t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){const n=e.constructor.name;if("string"==typeof n&&""!==n)return n}return t}(e)+"]":"{ "+n.map(([o,i])=>o+": "+p2(i,t)).join(", ")+" }"}(e,n)}(e,t);default:return String(e)}}class Fie{constructor(t,n,r){this.start=t.start,this.end=n.end,this.startToken=t,this.endToken=n,this.source=r}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}}class hx{constructor(t,n,r,o,i,s){this.kind=t,this.start=n,this.end=r,this.line=o,this.column=i,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 fx={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","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"],TypeCoordinate:["name"],MemberCoordinate:["name","memberName"],ArgumentCoordinate:["name","fieldName","argumentName"],DirectiveCoordinate:["name"],DirectiveArgumentCoordinate:["name","argumentName"]},Hie=new Set(Object.keys(fx));function px(e){const t=e?.kind;return"string"==typeof t&&Hie.has(t)}var oa=function(e){return e.QUERY="query",e.MUTATION="mutation",e.SUBSCRIPTION="subscription",e}(oa||{}),Dt=function(e){return e.NAME="Name",e.DOCUMENT="Document",e.OPERATION_DEFINITION="OperationDefinition",e.VARIABLE_DEFINITION="VariableDefinition",e.SELECTION_SET="SelectionSet",e.FIELD="Field",e.ARGUMENT="Argument",e.FRAGMENT_SPREAD="FragmentSpread",e.INLINE_FRAGMENT="InlineFragment",e.FRAGMENT_DEFINITION="FragmentDefinition",e.VARIABLE="Variable",e.INT="IntValue",e.FLOAT="FloatValue",e.STRING="StringValue",e.BOOLEAN="BooleanValue",e.NULL="NullValue",e.ENUM="EnumValue",e.LIST="ListValue",e.OBJECT="ObjectValue",e.OBJECT_FIELD="ObjectField",e.DIRECTIVE="Directive",e.NAMED_TYPE="NamedType",e.LIST_TYPE="ListType",e.NON_NULL_TYPE="NonNullType",e.SCHEMA_DEFINITION="SchemaDefinition",e.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",e.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",e.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",e.FIELD_DEFINITION="FieldDefinition",e.INPUT_VALUE_DEFINITION="InputValueDefinition",e.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",e.UNION_TYPE_DEFINITION="UnionTypeDefinition",e.ENUM_TYPE_DEFINITION="EnumTypeDefinition",e.ENUM_VALUE_DEFINITION="EnumValueDefinition",e.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",e.DIRECTIVE_DEFINITION="DirectiveDefinition",e.SCHEMA_EXTENSION="SchemaExtension",e.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",e.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",e.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",e.UNION_TYPE_EXTENSION="UnionTypeExtension",e.ENUM_TYPE_EXTENSION="EnumTypeExtension",e.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension",e.TYPE_COORDINATE="TypeCoordinate",e.MEMBER_COORDINATE="MemberCoordinate",e.ARGUMENT_COORDINATE="ArgumentCoordinate",e.DIRECTIVE_COORDINATE="DirectiveCoordinate",e.DIRECTIVE_ARGUMENT_COORDINATE="DirectiveArgumentCoordinate",e}(Dt||{});const Zl=Object.freeze({});function ia(e,t,n=fx){const r=new Map;for(const ae of Object.values(Dt))r.set(ae,q8(t,ae));let o,u,d,i=Array.isArray(e),s=[e],a=-1,l=[],c=e;const f=[],y=[];do{a++;const ae=a===s.length,_e=ae&&0!==l.length;if(ae){if(u=0===y.length?void 0:f[f.length-1],c=d,d=y.pop(),_e)if(i){c=c.slice();let ot=0;for(const[mt,Xt]of l){const Tn=mt-ot;null===Xt?(c.splice(Tn,1),ot++):c[Tn]=Xt}}else{c={...c};for(const[ot,mt]of l)c[ot]=mt}a=o.index,s=o.keys,l=o.edits,i=o.inArray,o=o.prev}else if(d){if(u=i?a:s[a],c=d[u],null==c)continue;f.push(u)}let Ye;if(!Array.isArray(c)){var R,Z;px(c)||f2(!1,`Invalid AST Node: ${Z8(c)}.`);const ot=ae?null===(R=r.get(c.kind))||void 0===R?void 0:R.leave:null===(Z=r.get(c.kind))||void 0===Z?void 0:Z.enter;if(Ye=ot?.call(t,c,u,d,f,y),Ye===Zl)break;if(!1===Ye){if(!ae){f.pop();continue}}else if(void 0!==Ye&&(l.push([u,Ye]),!ae)){if(!px(Ye)){f.pop();continue}c=Ye}}var X;void 0===Ye&&_e&&l.push([u,c]),ae?f.pop():(o={inArray:i,index:a,keys:s,edits:l,prev:o},i=Array.isArray(c),s=i?c:null!==(X=n[c.kind])&&void 0!==X?X:[],a=-1,l=[],d&&y.push(d),d=c)}while(void 0!==o);return 0!==l.length?l[l.length-1][1]:e}function q8(e,t){const n=e[t];return"object"==typeof n?n:"function"==typeof n?{enter:n,leave:void 0}:{enter:e.enter,leave:e.leave}}function xd(e){try{return e()}catch{}}const Y8=xd(()=>globalThis)||xd(()=>window)||xd(()=>self)||xd(()=>global)||xd(function(){return xd.constructor("return this")()}),K8="4.1.7",gx=new Map;function mx(e){const t=gx.get(e)||1;return gx.set(e,t+1),`${e}:${t}:${Math.random().toString(36).slice(2)}`}const Cx="Invariant Violation";class X8 extends Error{constructor(t=Cx){super(t),this.name=Cx,Object.setPrototypeOf(this,X8.prototype)}}const g2=["debug","log","warn","error","silent"];let Q8=g2.indexOf("silent");function Ot(e,...t){if(!e)throw es(...t)}function m2(e){return function(t,...n){if(g2.indexOf(e)>=Q8){const r=console[e]||console.log;if("number"==typeof t){const o=t;(t=bx(o))||(t=Tx(o,n),n=[])}r(t,...n)}}}function es(e,...t){return new X8(bx(e,t)||Tx(e,t))}Ot.debug=m2("debug"),Ot.log=m2("log"),Ot.warn=m2("warn"),Ot.error=m2("error");const yx=Symbol.for("ApolloErrorMessageHandler_"+K8);function J8(e){if("string"==typeof e)return e;try{return function vx(e,t=0){const n=mx("stringifyForDisplay");return JSON.stringify(e,(r,o)=>void 0===o?n:o,t).split(JSON.stringify(n)).join("<undefined>")}(e,2).slice(0,1e3)}catch{return"<non-serializable>"}}function bx(e,t=[]){if(e)return Y8[yx]&&Y8[yx](e,t.map(J8))}function Tx(e,t=[]){if(e)return"string"==typeof e?t.reduce((n,r)=>n.replace(/%[sdfo]/,J8(r)),e):`An error occurred! For more details, see the full error text at https://go.apollo.dev/c/err#${encodeURIComponent(JSON.stringify({version:K8,message:e,args:t.map(J8)}))}`}const Fa={...Y8[Symbol.for("apollo.cacheSize")]},Vie=()=>Object.create(null),{forEach:zie,slice:Ex}=Array.prototype,{hasOwnProperty:jie}=Object.prototype;class sa{constructor(t=!0,n=Vie){this.weakness=t,this.makeData=n}lookup(){return this.lookupArray(arguments)}lookupArray(t){let n=this;return zie.call(t,r=>n=n.getChildTrie(r)),jie.call(n,"data")?n.data:n.data=this.makeData(Ex.call(t))}peek(){return this.peekArray(arguments)}peekArray(t){let n=this;for(let r=0,o=t.length;n&&r<o;++r){const i=n.mapFor(t[r],!1);n=i&&i.get(t[r])}return n&&n.data}remove(){return this.removeArray(arguments)}removeArray(t){let n;if(t.length){const r=t[0],o=this.mapFor(r,!1),i=o&&o.get(r);i&&(n=i.removeArray(Ex.call(t,1)),!i.data&&!i.weak&&(!i.strong||!i.strong.size)&&o.delete(r))}else n=this.data,delete this.data;return n}getChildTrie(t){const n=this.mapFor(t,!0);let r=n.get(t);return r||n.set(t,r=new sa(this.weakness,this.makeData)),r}mapFor(t,n){return this.weakness&&function Gie(e){switch(typeof e){case"object":if(null===e)break;case"function":return!0}return!1}(t)?this.weak||(n?this.weak=new WeakMap:void 0):this.strong||(n?this.strong=new Map:void 0)}}function e3(){}const $ie=e3,Wie=typeof WeakRef<"u"?WeakRef:function(e){return{deref:()=>e}},Zie=typeof WeakMap<"u"?WeakMap:Map,qie=typeof FinalizationRegistry<"u"?FinalizationRegistry:function(){return{register:e3,unregister:e3}};class v2{constructor(t=1/0,n=$ie){this.max=t,this.dispose=n,this.map=new Zie,this.newest=null,this.oldest=null,this.unfinalizedNodes=new Set,this.finalizationScheduled=!1,this.size=0,this.finalize=()=>{const r=this.unfinalizedNodes.values();for(let o=0;o<10024;o++){const i=r.next().value;if(!i)break;this.unfinalizedNodes.delete(i);const s=i.key;delete i.key,i.keyRef=new Wie(s),this.registry.register(s,i,i)}this.unfinalizedNodes.size>0?queueMicrotask(this.finalize):this.finalizationScheduled=!1},this.registry=new qie(this.deleteNode.bind(this))}has(t){return this.map.has(t)}get(t){const n=this.getNode(t);return n&&n.value}getNode(t){const n=this.map.get(t);if(n&&n!==this.newest){const{older:r,newer:o}=n;o&&(o.older=r),r&&(r.newer=o),n.older=this.newest,n.older.newer=n,n.newer=null,this.newest=n,n===this.oldest&&(this.oldest=o)}return n}set(t,n){let r=this.getNode(t);return r?r.value=n:(r={key:t,value:n,newer:null,older:this.newest},this.newest&&(this.newest.newer=r),this.newest=r,this.oldest=this.oldest||r,this.scheduleFinalization(r),this.map.set(t,r),this.size++,r.value)}clean(){for(;this.oldest&&this.size>this.max;)this.deleteNode(this.oldest)}deleteNode(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.size--;const n=t.key||t.keyRef&&t.keyRef.deref();this.dispose(t.value,n),t.keyRef?this.registry.unregister(t):this.unfinalizedNodes.delete(t),n&&this.map.delete(n)}delete(t){const n=this.map.get(t);return!!n&&(this.deleteNode(n),!0)}scheduleFinalization(t){this.unfinalizedNodes.add(t),this.finalizationScheduled||(this.finalizationScheduled=!0,queueMicrotask(this.finalize))}}function Kie(){}class t3{constructor(t=1/0,n=Kie){this.max=t,this.dispose=n,this.map=new Map,this.newest=null,this.oldest=null}has(t){return this.map.has(t)}get(t){const n=this.getNode(t);return n&&n.value}get size(){return this.map.size}getNode(t){const n=this.map.get(t);if(n&&n!==this.newest){const{older:r,newer:o}=n;o&&(o.older=r),r&&(r.newer=o),n.older=this.newest,n.older.newer=n,n.newer=null,this.newest=n,n===this.oldest&&(this.oldest=o)}return n}set(t,n){let r=this.getNode(t);return r?r.value=n:(r={key:t,value:n,newer:null,older:this.newest},this.newest&&(this.newest.newer=r),this.newest=r,this.oldest=this.oldest||r,this.map.set(t,r),r.value)}clean(){for(;this.oldest&&this.map.size>this.max;)this.delete(this.oldest.key)}delete(t){const n=this.map.get(t);return!!n&&(n===this.newest&&(this.newest=n.older),n===this.oldest&&(this.oldest=n.newer),n.newer&&(n.newer.older=n.older),n.older&&(n.older.newer=n.newer),this.map.delete(t),this.dispose(n.value,t),!0)}}const n3=new WeakSet;function Ix(e){e.size<=(e.max||-1)||n3.has(e)||(n3.add(e),setTimeout(()=>{e.clean(),n3.delete(e)},100))}const r3=function(e,t){const n=new v2(e,t);return n.set=function(r,o){const i=v2.prototype.set.call(this,r,o);return Ix(this),i},n},Xie=function(e,t){const n=new t3(e,t);return n.set=function(r,o){const i=t3.prototype.set.call(this,r,o);return Ix(this),i},n};function Ax(e,{max:t,makeCacheKey:n=r=>r}){const r=new sa(!0),o=new r3(t);return(...i)=>{const s=r.lookupArray(n(i)),a=o.get(s);if(a){if(a.error)throw a.error;return a.result}const l=o.set(s,{});try{return l.result=e(...i)}catch(c){throw l.error=c,c}}}const ql=Ax((e,t)=>{Ot(e&&"Document"===e.kind,1);const n=e.definitions.filter(r=>"OperationDefinition"===r.kind);t&&Ot(1==n.length&&n[0].operation===t,4,t,t,n[0].operation),ia(e,{Field(r,o,i,s){if(r.alias&&("__typename"===r.alias.value||r.alias.value.startsWith("__ac_"))&&r.alias.value!==r.name.value){let a=e,l=[];for(const c of s)a=a[c],a.kind===Dt.FIELD&&l.push(a.alias?.value||a.name.value);throw l.splice(-1,1,r.name.value),es(5,r.alias.value,l.join("."),n[0].operation,ps(e,"(anonymous)"))}}})},{max:Fa.checkDocument||2e3});function Ha(e){return ql(e),e.definitions.filter(t=>"OperationDefinition"===t.kind)[0]}class ui{static empty(){return new ui(()=>Wl)}static from(t){if(0===t.length)return ui.empty();const[n,...r]=t;return n.concat(...r)}static split(t,n,r=new ui((o,i)=>i(o))){const o=new ui((i,s)=>t(i)?n.request(i,s):r.request(i,s));return Object.assign(o,{left:n,right:r})}static execute(t,n,r){return t.request(function Qie(e,{client:t}){const n={query:e.query,variables:e.variables||{},extensions:e.extensions||{},operationName:ps(e.query),operationType:Ha(e.query).operation};let r={...e.context};const i=()=>Object.freeze({...r});return Object.defineProperty(n,"setContext",{enumerable:!1,value:s=>{r="function"==typeof s?{...r,...s(i())}:{...r,...s}}}),Object.defineProperty(n,"getContext",{enumerable:!1,value:i}),Object.defineProperty(n,"client",{enumerable:!1,value:t}),n}(n,r),()=>Wl)}static concat(...t){return ui.from(t)}constructor(t){t&&(this.request=t)}split(t,n,r){return this.concat(ui.split(t,n,r))}concat(...t){return 0===t.length?this:t.reduce(this.combine.bind(this),this)}combine(t,n){const r=new ui((o,i)=>t.request(o,s=>n.request(s,i)));return Object.assign(r,{left:t,right:n})}request(t,n){throw es(65)}left;right}const Jie=ui.split,{toString:Sx,hasOwnProperty:ese}=Object.prototype,wx=Function.prototype.toString,o3=new Map;function $r(e,t){try{return i3(e,t)}finally{o3.clear()}}function i3(e,t){if(e===t)return!0;const n=Sx.call(e);if(n!==Sx.call(t))return!1;switch(n){case"[object Array]":if(e.length!==t.length)return!1;case"[object Object]":{if(Lx(e,t))return!0;const o=Dx(e),i=Dx(t),s=o.length;if(s!==i.length)return!1;for(let a=0;a<s;++a)if(!ese.call(t,o[a]))return!1;for(let a=0;a<s;++a){const l=o[a];if(!i3(e[l],t[l]))return!1}return!0}case"[object Error]":return e.name===t.name&&e.message===t.message;case"[object Number]":if(e!=e)return t!=t;case"[object Boolean]":case"[object Date]":return+e==+t;case"[object RegExp]":case"[object String]":return e==`${t}`;case"[object Map]":case"[object Set]":{if(e.size!==t.size)return!1;if(Lx(e,t))return!0;const o=e.entries(),i="[object Map]"===n;for(;;){const s=o.next();if(s.done)break;const[a,l]=s.value;if(!t.has(a)||i&&!i3(l,t.get(a)))return!1}return!0}case"[object Uint16Array]":case"[object Uint8Array]":case"[object Uint32Array]":case"[object Int32Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object ArrayBuffer]":e=new Uint8Array(e),t=new Uint8Array(t);case"[object DataView]":{let o=e.byteLength;if(o===t.byteLength)for(;o--&&e[o]===t[o];);return-1===o}case"[object AsyncFunction]":case"[object GeneratorFunction]":case"[object AsyncGeneratorFunction]":case"[object Function]":{const o=wx.call(e);return o===wx.call(t)&&!function rse(e,t){const n=e.length-t.length;return n>=0&&e.indexOf(t,n)===n}(o,nse)}}return!1}function Dx(e){return Object.keys(e).filter(tse,e)}function tse(e){return void 0!==this[e]}const nse="{ [native code] }";function Lx(e,t){let n=o3.get(e);if(n){if(n.has(t))return!0}else o3.set(e,n=new Set);return n.add(t),!1}let Ko=null;const xx={};let ose=1;function Mx(e){try{return e()}catch{}}const s3="@wry/context:Slot",Nx=Mx(()=>globalThis)||Mx(()=>global)||Object.create(null),C2=Nx[s3]||Array[s3]||function(e){try{Object.defineProperty(Nx,s3,{value:e,enumerable:!1,writable:!1,configurable:!0})}finally{return e}}(class{constructor(){this.id=["slot",ose++,Date.now(),Math.random().toString(36).slice(2)].join(":")}hasValue(){for(let t=Ko;t;t=t.parent)if(this.id in t.slots){const n=t.slots[this.id];if(n===xx)break;return t!==Ko&&(Ko.slots[this.id]=n),!0}return Ko&&(Ko.slots[this.id]=xx),!1}getValue(){if(this.hasValue())return Ko.slots[this.id]}withValue(t,n,r,o){const s=Ko;Ko={parent:s,slots:{__proto__:null,[this.id]:t}};try{return n.apply(o,r)}finally{Ko=s}}static bind(t){const n=Ko;return function(){const r=Ko;try{return Ko=n,t.apply(this,arguments)}finally{Ko=r}}}static noContext(t,n,r){if(!Ko)return t.apply(r,n);{const o=Ko;try{return Ko=null,t.apply(r,n)}finally{Ko=o}}}}),lf=new C2,{hasOwnProperty:lse}=Object.prototype,l3=Array.from||function(e){const t=[];return e.forEach(n=>t.push(n)),t};function y2(e){const{unsubscribe:t}=e;"function"==typeof t&&(e.unsubscribe=void 0,t())}const cf=[];function Md(e,t){if(!e)throw new Error(t||"assertion failure")}function Rx(e,t){const n=e.length;return n>0&&n===t.length&&e[n-1]===t[n-1]}function Ox(e){switch(e.length){case 0:throw new Error("unknown value");case 1:return e[0];case 2:throw e[1]}}function Px(e){return e.slice(0)}let use=(()=>{class e{constructor(n){this.fn=n,this.parents=new Set,this.childValues=new Map,this.dirtyChildren=null,this.dirty=!0,this.recomputing=!1,this.value=[],this.deps=null,++e.count}peek(){if(1===this.value.length&&!Yl(this))return Bx(this),this.value[0]}recompute(n){return Md(!this.recomputing,"already recomputing"),Bx(this),Yl(this)?function dse(e,t){return jx(e),lf.withValue(e,_se,[e,t]),function fse(e,t){if("function"==typeof e.subscribe)try{y2(e),e.unsubscribe=e.subscribe.apply(null,t)}catch{return e.setDirty(),!1}return!0}(e,t)&&function hse(e){e.dirty=!1,!Yl(e)&&Hx(e)}(e),Ox(e.value)}(this,n):Ox(this.value)}setDirty(){this.dirty||(this.dirty=!0,Fx(this),y2(this))}dispose(){this.setDirty(),jx(this),c3(this,(n,r)=>{n.setDirty(),Gx(n,this)})}forget(){this.dispose()}dependOn(n){n.add(this),this.deps||(this.deps=cf.pop()||new Set),this.deps.add(n)}forgetDeps(){this.deps&&(l3(this.deps).forEach(n=>n.delete(this)),this.deps.clear(),cf.push(this.deps),this.deps=null)}}return e.count=0,e})();function Bx(e){const t=lf.getValue();if(t)return e.parents.add(t),t.childValues.has(e)||t.childValues.set(e,[]),Yl(e)?Ux(t,e):Vx(t,e),t}function _se(e,t){e.recomputing=!0;const{normalizeResult:n}=e;let r;n&&1===e.value.length&&(r=Px(e.value)),e.value.length=0;try{if(e.value[0]=e.fn.apply(null,t),n&&r&&!Rx(r,e.value))try{e.value[0]=n(e.value[0],r[0])}catch{}}catch(o){e.value[1]=o}e.recomputing=!1}function Yl(e){return e.dirty||!(!e.dirtyChildren||!e.dirtyChildren.size)}function Fx(e){c3(e,Ux)}function Hx(e){c3(e,Vx)}function c3(e,t){const n=e.parents.size;if(n){const r=l3(e.parents);for(let o=0;o<n;++o)t(r[o],e)}}function Ux(e,t){Md(e.childValues.has(t)),Md(Yl(t));const n=!Yl(e);if(e.dirtyChildren){if(e.dirtyChildren.has(t))return}else e.dirtyChildren=cf.pop()||new Set;e.dirtyChildren.add(t),n&&Fx(e)}function Vx(e,t){Md(e.childValues.has(t)),Md(!Yl(t));const n=e.childValues.get(t);0===n.length?e.childValues.set(t,Px(t.value)):Rx(n,t.value)||e.setDirty(),zx(e,t),!Yl(e)&&Hx(e)}function zx(e,t){const n=e.dirtyChildren;n&&(n.delete(t),0===n.size&&(cf.length<100&&cf.push(n),e.dirtyChildren=null))}function jx(e){e.childValues.size>0&&e.childValues.forEach((t,n)=>{Gx(e,n)}),e.forgetDeps(),Md(null===e.dirtyChildren)}function Gx(e,t){t.parents.delete(e),e.childValues.delete(t),zx(e,t)}const pse={setDirty:!0,dispose:!0,forget:!0};function $x(e){const t=new Map,n=e&&e.subscribe;function r(o){const i=lf.getValue();if(i){let s=t.get(o);s||t.set(o,s=new Set),i.dependOn(s),"function"==typeof n&&(y2(s),s.unsubscribe=n(o))}}return r.dirty=function(i,s){const a=t.get(i);if(a){const l=s&&lse.call(pse,s)?s:"setDirty";l3(a).forEach(c=>c[l]()),t.delete(i),y2(a)}},r}let Wx;function Zx(...e){return(Wx||(Wx=new sa("function"==typeof WeakMap))).lookupArray(e)}const u3=new Set;function uf(e,{max:t=Math.pow(2,16),keyArgs:n,makeCacheKey:r=Zx,normalizeResult:o,subscribe:i,cache:s=t3}=Object.create(null)){const a="function"==typeof s?new s(t,f=>f.dispose()):s,l=function(){const f=r.apply(null,n?n.apply(null,arguments):arguments);if(void 0===f)return e.apply(null,arguments);let y=a.get(f);y||(a.set(f,y=new use(e)),y.normalizeResult=o,y.subscribe=i,y.forget=()=>a.delete(f));const R=y.recompute(Array.prototype.slice.call(arguments));return a.set(f,y),u3.add(a),lf.hasValue()||(u3.forEach(Z=>Z.clean()),u3.clear()),R};function c(f){const y=f&&a.get(f);y&&y.setDirty()}function u(f){const y=f&&a.get(f);if(y)return y.peek()}function d(f){return!!f&&a.delete(f)}return Object.defineProperty(l,"size",{get:()=>a.size,configurable:!1,enumerable:!1}),Object.freeze(l.options={max:t,keyArgs:n,makeCacheKey:r,normalizeResult:o,subscribe:i,cache:a}),l.dirtyKey=c,l.dirty=function(){c(r.apply(null,arguments))},l.peekKey=u,l.peek=function(){return u(r.apply(null,arguments))},l.forgetKey=d,l.forget=function(){return d(r.apply(null,arguments))},l.makeCacheKey=r,l.getKey=n?function(){return r.apply(null,n.apply(null,arguments))}:r,Object.freeze(l)}function gse(e){return e}class Ua{transform;cached;resultCache=new WeakSet;getCacheKey(t){return[t]}static identity(){return new Ua(gse,{cache:!1})}static split(t,n,r=Ua.identity()){return Object.assign(new Ua(o=>(t(o)?n:r).transformDocument(o),{cache:!1}),{left:n,right:r})}constructor(t,n={}){this.transform=t,n.getCacheKey&&(this.getCacheKey=n.getCacheKey),this.cached=!1!==n.cache,this.resetCache()}resetCache(){if(this.cached){const t=new sa;this.performWork=uf(Ua.prototype.performWork.bind(this),{makeCacheKey:n=>{const r=this.getCacheKey(n);if(r)return Ot(Array.isArray(r),20),t.lookupArray(r)},max:Fa["documentTransform.cache"],cache:v2})}}performWork(t){return ql(t),this.transform(t)}transformDocument(t){if(this.resultCache.has(t))return t;const n=this.performWork(t);return this.resultCache.add(n),n}concat(t){return Object.assign(new Ua(n=>t.transformDocument(this.transformDocument(n)),{cache:!1}),{left:this,right:t})}left;right}const qx={kind:Dt.FIELD,name:{kind:Dt.NAME,value:"__typename"}},d3=Object.assign(function(e){return ia(e,{SelectionSet:{enter(t,n,r){if(r&&r.kind===Dt.OPERATION_DEFINITION)return;const{selections:o}=t;return o&&!o.some(a=>a.kind===Dt.FIELD&&("__typename"===a.name.value||0===a.name.value.lastIndexOf("__",0)))?r.kind===Dt.FIELD&&r.directives&&r.directives.some(a=>"export"===a.name.value)?void 0:{...t,selections:[...o,qx]}:void 0}}})},{added:e=>e===qx}),Va=Object.assign(function(t){return JSON.stringify(t,Tse)},{reset(){Nd=new Xie(Fa.canonicalStringify||1e3)}});let Nd;function Tse(e,t){if(t&&"object"==typeof t){const n=Object.getPrototypeOf(t);if(n===Object.prototype||null===n){const r=Object.keys(t);if(r.every(Ese))return t;const o=JSON.stringify(r);let i=Nd.get(o);if(!i){r.sort();const a=JSON.stringify(r);i=Nd.get(a)||r,Nd.set(o,i),Nd.set(a,i)}const s=Object.create(n);return i.forEach(a=>{s[a]=t[a]}),s}}return t}function Ese(e,t,n){return 0===t||n[t-1]<=e}function p3(e){return 9===e||32===e}function df(e){return e>=48&&e<=57}function Qx(e){return e>=97&&e<=122||e>=65&&e<=90}function Jx(e){return Qx(e)||95===e}function Ise(e){return Qx(e)||df(e)||95===e}function Ase(e){var t;let n=Number.MAX_SAFE_INTEGER,r=null,o=-1;for(let s=0;s<e.length;++s){var i;const a=e[s],l=Sse(a);l!==a.length&&(r=null!==(i=r)&&void 0!==i?i:s,o=s,0!==s&&l<n&&(n=l))}return e.map((s,a)=>0===a?s:s.slice(n)).slice(null!==(t=r)&&void 0!==t?t:0,o+1)}function Sse(e){let t=0;for(;t<e.length&&p3(e.charCodeAt(t));)++t;return t}Va.reset();const Lse=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function xse(e){return Mse[e.charCodeAt(0)]}const Mse=["\\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 b2(e){return ia(e,kse)}const kse={Name:{leave:e=>e.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>Vt(e.definitions,"\n\n")},OperationDefinition:{leave(e){const t=g3(e.variableDefinitions)?bn("(\n",Vt(e.variableDefinitions,"\n"),"\n)"):bn("(",Vt(e.variableDefinitions,", "),")"),n=bn("",e.description,"\n")+Vt([e.operation,Vt([e.name,t]),Vt(e.directives," ")]," ");return("query"===n?"":n+" ")+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:n,directives:r,description:o})=>bn("",o,"\n")+e+": "+t+bn(" = ",n)+bn(" ",Vt(r," "))},SelectionSet:{leave:({selections:e})=>Os(e)},Field:{leave({alias:e,name:t,arguments:n,directives:r,selectionSet:o}){const i=bn("",e,": ")+t;let s=i+bn("(",Vt(n,", "),")");return s.length>80&&(s=i+bn("(\n",T2(Vt(n,"\n")),"\n)")),Vt([s,Vt(r," "),o]," ")}},Argument:{leave:({name:e,value:t})=>e+": "+t},FragmentSpread:{leave:({name:e,directives:t})=>"..."+e+bn(" ",Vt(t," "))},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:n})=>Vt(["...",bn("on ",e),Vt(t," "),n]," ")},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:n,directives:r,selectionSet:o,description:i})=>bn("",i,"\n")+`fragment ${e}${bn("(",Vt(n,", "),")")} on ${t} ${bn("",Vt(r," ")," ")}`+o},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>t?function wse(e,t){const n=e.replace(/"""/g,'\\"""'),r=n.split(/\r\n|[\n\r]/g),o=1===r.length,i=r.length>1&&r.slice(1).every(y=>0===y.length||p3(y.charCodeAt(0))),s=n.endsWith('\\"""'),a=e.endsWith('"')&&!s,l=e.endsWith("\\"),c=a||l,u=!(null!=t&&t.minimize)&&(!o||e.length>70||c||i||s);let d="";const f=o&&p3(e.charCodeAt(0));return(u&&!f||i)&&(d+="\n"),d+=n,(u||c)&&(d+="\n"),'"""'+d+'"""'}(e):function Dse(e){return`"${e.replace(Lse,xse)}"`}(e)},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>"["+Vt(e,", ")+"]"},ObjectValue:{leave:({fields:e})=>"{"+Vt(e,", ")+"}"},ObjectField:{leave:({name:e,value:t})=>e+": "+t},Directive:{leave:({name:e,arguments:t})=>"@"+e+bn("(",Vt(t,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({description:e,directives:t,operationTypes:n})=>bn("",e,"\n")+Vt(["schema",Vt(t," "),Os(n)]," ")},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+": "+t},ScalarTypeDefinition:{leave:({description:e,name:t,directives:n})=>bn("",e,"\n")+Vt(["scalar",t,Vt(n," ")]," ")},ObjectTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:o})=>bn("",e,"\n")+Vt(["type",t,bn("implements ",Vt(n," & ")),Vt(r," "),Os(o)]," ")},FieldDefinition:{leave:({description:e,name:t,arguments:n,type:r,directives:o})=>bn("",e,"\n")+t+(g3(n)?bn("(\n",T2(Vt(n,"\n")),"\n)"):bn("(",Vt(n,", "),")"))+": "+r+bn(" ",Vt(o," "))},InputValueDefinition:{leave:({description:e,name:t,type:n,defaultValue:r,directives:o})=>bn("",e,"\n")+Vt([t+": "+n,bn("= ",r),Vt(o," ")]," ")},InterfaceTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:o})=>bn("",e,"\n")+Vt(["interface",t,bn("implements ",Vt(n," & ")),Vt(r," "),Os(o)]," ")},UnionTypeDefinition:{leave:({description:e,name:t,directives:n,types:r})=>bn("",e,"\n")+Vt(["union",t,Vt(n," "),bn("= ",Vt(r," | "))]," ")},EnumTypeDefinition:{leave:({description:e,name:t,directives:n,values:r})=>bn("",e,"\n")+Vt(["enum",t,Vt(n," "),Os(r)]," ")},EnumValueDefinition:{leave:({description:e,name:t,directives:n})=>bn("",e,"\n")+Vt([t,Vt(n," ")]," ")},InputObjectTypeDefinition:{leave:({description:e,name:t,directives:n,fields:r})=>bn("",e,"\n")+Vt(["input",t,Vt(n," "),Os(r)]," ")},DirectiveDefinition:{leave:({description:e,name:t,arguments:n,repeatable:r,locations:o})=>bn("",e,"\n")+"directive @"+t+(g3(n)?bn("(\n",T2(Vt(n,"\n")),"\n)"):bn("(",Vt(n,", "),")"))+(r?" repeatable":"")+" on "+Vt(o," | ")},SchemaExtension:{leave:({directives:e,operationTypes:t})=>Vt(["extend schema",Vt(e," "),Os(t)]," ")},ScalarTypeExtension:{leave:({name:e,directives:t})=>Vt(["extend scalar",e,Vt(t," ")]," ")},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>Vt(["extend type",e,bn("implements ",Vt(t," & ")),Vt(n," "),Os(r)]," ")},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>Vt(["extend interface",e,bn("implements ",Vt(t," & ")),Vt(n," "),Os(r)]," ")},UnionTypeExtension:{leave:({name:e,directives:t,types:n})=>Vt(["extend union",e,Vt(t," "),bn("= ",Vt(n," | "))]," ")},EnumTypeExtension:{leave:({name:e,directives:t,values:n})=>Vt(["extend enum",e,Vt(t," "),Os(n)]," ")},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:n})=>Vt(["extend input",e,Vt(t," "),Os(n)]," ")},TypeCoordinate:{leave:({name:e})=>e},MemberCoordinate:{leave:({name:e,memberName:t})=>Vt([e,bn(".",t)])},ArgumentCoordinate:{leave:({name:e,fieldName:t,argumentName:n})=>Vt([e,bn(".",t),bn("(",n,":)")])},DirectiveCoordinate:{leave:({name:e})=>Vt(["@",e])},DirectiveArgumentCoordinate:{leave:({name:e,argumentName:t})=>Vt(["@",e,bn("(",t,":)")])}};function Vt(e,t=""){var n;return null!==(n=e?.filter(r=>r).join(t))&&void 0!==n?n:""}function Os(e){return bn("{\n",T2(Vt(e,"\n")),"\n}")}function bn(e,t,n=""){return null!=t&&""!==t?e+t+n:""}function T2(e){return bn(" ",e.replace(/\n/g,"\n "))}function g3(e){var t;return null!==(t=e?.some(n=>n.includes("\n")))&&void 0!==t&&t}let _f;const hf=Object.assign(e=>{let t=_f.get(e);return t||(t=b2(e),_f.set(e,t)),t},{reset(){_f=new r3(Fa.print||2e3)}});function lr(e){return!(!e||"object"!=typeof e||"string"!=typeof e.__ref)}hf.reset();const v3={now:()=>(v3.delegate||Date).now(),delegate:void 0};class C3 extends Kn{constructor(t=1/0,n=1/0,r=v3){super(),this._bufferSize=t,this._windowTime=n,this._timestampProvider=r,this._buffer=[],this._infiniteTimeWindow=!0,this._infiniteTimeWindow=n===1/0,this._bufferSize=Math.max(1,t),this._windowTime=Math.max(1,n)}next(t){const{isStopped:n,_buffer:r,_infiniteTimeWindow:o,_timestampProvider:i,_windowTime:s}=this;n||(r.push(t),!o&&r.push(i.now()+s)),this._trimBuffer(),super.next(t)}_subscribe(t){this._throwIfClosed(),this._trimBuffer();const n=this._innerSubscribe(t),{_infiniteTimeWindow:r,_buffer:o}=this,i=o.slice();for(let s=0;s<i.length&&!t.closed;s+=r?1:2)t.next(i[s]);return this._checkFinalizedStatuses(t),n}_trimBuffer(){const{_bufferSize:t,_timestampProvider:n,_buffer:r,_infiniteTimeWindow:o}=this,i=(o?1:2)*t;if(t<1/0&&i<r.length&&r.splice(0,r.length-i),!o){const s=n.now();let a=0;for(let l=1;l<r.length&&r[l]<=s;l+=2)a=l;a&&r.splice(0,a+1)}}}function ff(e={}){const{connector:t=()=>new Kn,resetOnError:n=!0,resetOnComplete:r=!0,resetOnRefCountZero:o=!0}=e;return i=>{let s,a,l,c=0,u=!1,d=!1;const f=()=>{a?.unsubscribe(),a=void 0},y=()=>{f(),s=l=void 0,u=d=!1},R=()=>{const Z=s;y(),Z?.unsubscribe()};return Ni((Z,X)=>{c++,!d&&!u&&f();const ae=l=l??t();X.add(()=>{c--,0===c&&!d&&!u&&(a=y3(R,o))}),ae.subscribe(X),!s&&c>0&&(s=new xn({next:_e=>ae.next(_e),error:_e=>{d=!0,f(),a=y3(y,n,_e),ae.error(_e)},complete:()=>{u=!0,f(),a=y3(y,r),ae.complete()}}),fs(Z).subscribe(s))})(i)}}function y3(e,t,...n){if(!0===t)return void e();if(!1===t)return;const r=new xn({next:()=>{r.unsubscribe(),e()}});return fs(t(...n)).subscribe(r)}function E2(e,t,n){let r,o=!1;return e&&"object"==typeof e?({bufferSize:r=1/0,windowTime:t=1/0,refCount:o=!1,scheduler:n}=e):r=e??1/0,ff({connector:()=>new C3(r,t,n),resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:o})}function Fse(e,t){return e===t}class Hse extends Y{constructor(t,n){super()}schedule(t,n=0){return this}}const I2={setInterval(e,t,...n){const{delegate:r}=I2;return r?.setInterval?r.setInterval(e,t,...n):setInterval(e,t,...n)},clearInterval(e){const{delegate:t}=I2;return(t?.clearInterval||clearInterval)(e)},delegate:void 0};class eM extends Hse{constructor(t,n){super(t,n),this.scheduler=t,this.work=n,this.pending=!1}schedule(t,n=0){var r;if(this.closed)return this;this.state=t;const o=this.id,i=this.scheduler;return null!=o&&(this.id=this.recycleAsyncId(i,o,n)),this.pending=!0,this.delay=n,this.id=null!==(r=this.id)&&void 0!==r?r:this.requestAsyncId(i,this.id,n),this}requestAsyncId(t,n,r=0){return I2.setInterval(t.flush.bind(t,this),r)}recycleAsyncId(t,n,r=0){if(null!=r&&this.delay===r&&!1===this.pending)return n;null!=n&&I2.clearInterval(n)}execute(t,n){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;const r=this._execute(t,n);if(r)return r;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))}_execute(t,n){let o,r=!1;try{this.work(t)}catch(i){r=!0,o=i||new Error("Scheduled action threw falsy error")}if(r)return this.unsubscribe(),o}unsubscribe(){if(!this.closed){const{id:t,scheduler:n}=this,{actions:r}=n;this.work=this.state=this.scheduler=null,this.pending=!1,an(r,this),null!=t&&(this.id=this.recycleAsyncId(n,t,null)),this.delay=null,super.unsubscribe()}}}class pf{constructor(t,n=pf.now){this.schedulerActionCtor=t,this.now=n}schedule(t,n=0,r){return new this.schedulerActionCtor(this,t).schedule(r,n)}}pf.now=v3.now;class tM extends pf{constructor(t,n=pf.now){super(t,n),this.actions=[],this._active=!1}flush(t){const{actions:n}=this;if(this._active)return void n.push(t);let r;this._active=!0;do{if(r=t.execute(t.state,t.delay))break}while(t=n.shift());if(this._active=!1,r){for(;t=n.shift();)t.unsubscribe();throw r}}}const Use=new tM(eM);const rM=Ax(function(t,n,r){return function jse(e,t){let n,r;function o(i){return i!==n&&(n=i,r=t(n)),r}return Object.assign(e.pipe(dr(o),E2({bufferSize:1,refCount:!0})),{getCurrentResult:()=>o(e.getCurrentResult())})}(t,r)},{max:1,makeCacheKey:e=>e.slice(0,2)});function gf(e=[]){const t={};return e.forEach(n=>{t[n.name.value]=n}),t}function mf(e){return e.definitions.filter(t=>"FragmentDefinition"===t.kind)}function A2(e,t){switch(e.kind){case"InlineFragment":return e;case"FragmentSpread":{const n=e.name.value;if("function"==typeof t)return t(n);const r=t&&t[n];return Ot(r,9,n),r||null}default:return null}}function b3(e){let t;ql(e);for(let n of e.definitions){if("OperationDefinition"===n.kind)return n;"FragmentDefinition"===n.kind&&!t&&(t=n)}if(t)return t;throw es(12)}function vf(e){return"Field"===e.kind}function ou(e){return e.alias?e.alias.value:e.name.value}function S2({directives:e},t){return!e||!e.length||function Wse(e){const t=[];return e&&e.length&&e.forEach(n=>{if(!function $se({name:{value:e}}){return"skip"===e||"include"===e}(n))return;const r=n.arguments,o=n.name.value;Ot(r&&1===r.length,16,o);const i=r[0];Ot(i.name&&"if"===i.name.value,17,o);const s=i.value;Ot(s&&("Variable"===s.kind||"BooleanValue"===s.kind),18,o),t.push({directive:n,ifArgument:i})}),t}(e).every(({directive:n,ifArgument:r})=>{let o=!1;return"Variable"===r.value.kind?(o=t&&t[r.value.name.value],Ot(void 0!==o,15,n.name.value)):o=r.value.value,"skip"===n.name.value?!o:o})}function oM(e,{data:t,...n},{data:r,...o},i){return $r(n,o)&&w2(b3(e).selectionSet,t,r,{fragmentMap:gf(mf(e)),variables:i})}function w2(e,t,n,r){if(t===n)return!0;const o=new Set;return e.selections.every(i=>{if(o.has(i)||(o.add(i),!S2(i,r.variables))||iM(i))return!0;if(vf(i)){const s=ou(i),a=t&&t[s],l=n&&n[s],c=i.selectionSet;if(!c)return $r(a,l);const u=Array.isArray(a),d=Array.isArray(l);if(u!==d)return!1;if(u&&d){const f=a.length;if(l.length!==f)return!1;for(let y=0;y<f;++y)if(!w2(c,a[y],l[y],r))return!1;return!0}return w2(c,a,l,r)}{const s=A2(i,r.fragmentMap);if(s)return!!iM(s)||w2(s.selectionSet,t,n,r)}})}function iM(e){return!!e.directives&&e.directives.some(Zse)}function Zse(e){return"nonreactive"===e.name.value}function qse(e,t){let n=t;const r=[];return e.definitions.forEach(i=>{if("OperationDefinition"===i.kind)throw es(10,i.operation,i.name?` named '${i.name.value}'`:"");"FragmentDefinition"===i.kind&&r.push(i)}),typeof n>"u"&&(Ot(1===r.length,11,r.length),n=r[0].name.value),{...e,definitions:[{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:n}}]}},...e.definitions]}}function Yse(...e){return Zx.bind(null,...e)}class sM{assumeImmutableResults=!1;lookupFragment(t){return null}batch(t){let r;return this.performTransaction(()=>r=t.update(this),"string"==typeof t.optimistic?t.optimistic:!1===t.optimistic?null:void 0),r}recordOptimisticTransaction(t,n){this.performTransaction(t,n)}transformDocument(t){return t}transformForLink(t){return t}identify(t){}gc(){return[]}modify(t){return!1}readQuery(t,n=!!t.optimistic){return this.read({...t,rootId:t.id||"ROOT_QUERY",optimistic:n})}fragmentWatches=new sa(!0);watchFragment(t){const{fragment:n,fragmentName:r,from:o}=t,i=this.getFragmentDoc(n,r),a=(Array.isArray(o)?o:[o]).map(y=>null==y?y:this.toCacheId(y));if(!Array.isArray(o)){const y=this.watchSingleFragment(a[0],i,t);return null===o?y:rM(y,Symbol.for("apollo.transform.individualResult"),R=>({...R,data:R.data??{}}))}let l;function c(y){const R=y.reduce((Z,X,ae)=>(Z.data.push(X.data),Z.complete&&=X.complete,Z.dataState=Z.complete?"complete":"partial",X.missing&&(Z.missing||={},Z.missing[ae]=X.missing),Z),{data:[],dataState:"complete",complete:!0});return $r(l,R)||(l=R),l}if(0===a.length)return Xse;let u=!1;const d=a.map(y=>this.watchSingleFragment(y,i,t)),f=function Gse(e){return 0===e.length?Wl:new Lt(t=>{const{length:n}=e,r=new Array(n),o=new Map;e.forEach((l,c)=>{o.has(l)||o.set(l,new Set),o.get(l).add(c)});let a,i=o.size,s=o.size;o.forEach((l,c)=>{let u=!1;const d=c.subscribe({next:f=>{l.forEach(y=>r[y]=f),u||(u=!0,s--),s||(a||=new Set(e.filter(y=>y.dirty)),a.delete(c),a.size||(t.next(r.slice()),a=void 0))},complete:()=>{i--,i||t.complete()},error:t.error.bind(t)});t.add(d)})})}(d).pipe(dr(c),Kc({subscribe:()=>u=!0,unsubscribe:()=>u=!1}),E2({bufferSize:1,refCount:!0}));return Object.assign(f,{getCurrentResult:()=>u&&l?l:c(d.map(R=>R.getCurrentResult()))})}onAfterBroadcast=t=>t();watchSingleFragment(t,n,r){if(null===t)return Kse;const{optimistic:o=!0,variables:i}=r,s=[n,Va({id:t,optimistic:o,variables:i})],a=this.fragmentWatches.lookupArray(s);if(!a.observable){let c,u=function(f){const y=f.result;return(!c||!oM(n,{data:c.data},{data:y},r.variables))&&(c={data:y,dataState:f.complete?"complete":"partial",complete:f.complete},f.missing&&(c.missing=f.missing.missing)),c},l=!1;const d=new Lt(f=>{l=!0;const y=this.watch({variables:i,returnPartialData:!0,id:t,query:n,optimistic:o,immediate:!0,callback:R=>{d.dirty=!0,this.onAfterBroadcast(()=>{f.next(u(R)),d.dirty=!1})}});return()=>{l=!1,y(),this.fragmentWatches.removeArray(s)}}).pipe(function Bse(e,t=ht){return e=e??Fse,Ni((n,r)=>{let o,i=!0;n.subscribe($i(r,s=>{const a=t(s);(i||!e(o,a))&&(i=!1,o=a,r.next(s))}))})}(),ff({connector:()=>new C3(1),resetOnRefCountZero:()=>function zse(e=0,t,n=Use){let r=-1;return null!=t&&(iw(t)?n=t:r=t),new Lt(o=>{let i=function Vse(e){return e instanceof Date&&!isNaN(e)}(e)?+e-n.now():e;i<0&&(i=0);let s=0;return n.schedule(function(){o.closed||(o.next(s++),0<=r?this.schedule(void 0,r):o.complete())},i)})}(0)}));a.observable=Object.assign(d,{dirty:!1,getCurrentResult:()=>l&&c?c:u(this.diff({id:t,query:n,returnPartialData:!0,optimistic:o,variables:i}))})}return a.observable}getFragmentDoc=uf(qse,{max:Fa["cache.fragmentQueryDocuments"]||1e3,cache:v2,makeCacheKey:Yse(this)});readFragment(t,n=!!t.optimistic){const r=void 0!==t.from?this.toCacheId(t.from):t.id;return this.read({...t,query:this.getFragmentDoc(t.fragment,t.fragmentName),rootId:r,optimistic:n})}writeQuery({id:t,data:n,...r}){return this.write(Object.assign(r,{dataId:t||"ROOT_QUERY",result:n}))}writeFragment({data:t,fragment:n,fragmentName:r,...o}){const i=void 0!==o.from?this.toCacheId(o.from):o.id;return this.write(Object.assign(o,{query:this.getFragmentDoc(n,r),dataId:i,result:t}))}updateQuery(t,n){return this.batch({update(r){const o=r.readQuery(t),i=n(o);return null==i?o:(r.writeQuery({...t,data:i}),i)}})}updateFragment(t,n){return this.batch({update(r){const o=r.readFragment(t),i=n(o);return null==i?o:(r.writeFragment({...t,data:i}),i)}})}toCacheId(t){return"string"==typeof t?t:this.identify(t)}}const aM=Object.freeze({data:null,dataState:"complete",complete:!0}),Kse=Object.assign(new Lt(e=>{e.next(aM)}),{dirty:!1,getCurrentResult:()=>aM}),lM=Object.freeze({data:[],dataState:"complete",complete:!0}),Xse=Object.assign(new Lt(e=>{e.next(lM)}),{getCurrentResult:()=>lM});function di(e){return null!==e&&"object"==typeof e}const{hasOwnProperty:Qse}=Object.prototype,Jse=function(e,t,n){return this.merge(e[n],t[n])},cM=e=>isNaN(+e)?{}:[];class kd{options;reconciler;constructor(t={}){this.options=t,this.reconciler=t.reconciler||Jse}merge(t,n,r={}){const o=r.atPath;if(o?.length){const[i,...s]=o;void 0===t&&(t=cM(i));let a=t[i];void 0===a&&s.length&&(a=cM(s[0]));const l=this.merge(a,n,{...r,atPath:s});return a!==l&&((t=this.shallowCopyForMerge(t))[i]=l),t}return Array.isArray(t)&&Array.isArray(n)&&"truncate"===this.options.arrayMerge&&t.length>n.length&&(t=t.slice(0,n.length),this.pastCopies.add(t)),di(n)&&di(t)?(Object.keys(n).forEach(i=>{if(Qse.call(t,i)){const s=t[i];if(n[i]!==s){const a=this.reconciler(t,n,i);a!==s&&((t=this.shallowCopyForMerge(t))[i]=a)}}else(t=this.shallowCopyForMerge(t))[i]=n[i]}),t):n}isObject=di;pastCopies=new Set;shallowCopyForMerge(t){return di(t)&&(this.pastCopies.has(t)||(t=Array.isArray(t)?t.slice(0):{__proto__:Object.getPrototypeOf(t),...t},this.pastCopies.add(t))),t}}function Rd(e){return{__ref:String(e)}}function iu(...e){const t={};return e.forEach(n=>{n&&Reflect.ownKeys(n).forEach(r=>{const o=n[r];void 0!==o&&(t[r]=o)})}),t}const go=Array.isArray,{hasOwnProperty:zo}=Object.prototype;function uM({__typename:e,id:t,_id:n},r){if("string"==typeof e&&(r&&(r.keyObject=null!=t?{id:t}:null!=n?{_id:n}:void 0),null==t&&null!=n&&(t=n),null!=t))return`${e}:${"number"==typeof t||"string"==typeof t?t:JSON.stringify(t)}`}const nae={dataIdFromObject:uM,resultCaching:!0},dM=/^[_a-z][_0-9a-z]*/i;function Xl(e){const t=e.match(dM);return t?t[0]:e}function T3(e,t,n){return!!di(t)&&(go(t)?t.every(r=>T3(e,r,n)):e.selections.every(r=>{if(vf(r)&&S2(r,n)){const o=ou(r);return zo.call(t,o)&&(!r.selectionSet||T3(r.selectionSet,t[o],n))}return!0}))}function Od(e){return di(e)&&!lr(e)&&!go(e)}function _M(e,t){const n=gf(mf(e));return{fragmentMap:n,lookupFragment(r){let o=n[r];return!o&&t&&(o=t.lookup(r)),o||null}}}const L2={},E3=()=>L2,hM={};class x2{policies;group;data={};constructor(t,n){this.policies=t,this.group=n}toObject(){return{...this.data}}has(t){return void 0!==this.lookup(t,!0)}get(t,n){if(this.group.depend(t,n),zo.call(this.data,t)){const r=this.data[t];if(r&&zo.call(r,n))return r[n]}return"__typename"===n&&zo.call(this.policies.rootTypenamesById,t)?this.policies.rootTypenamesById[t]:this instanceof aa?this.parent.get(t,n):void 0}lookup(t,n){return n&&this.group.depend(t,"__exists"),zo.call(this.data,t)?this.data[t]:this instanceof aa?this.parent.lookup(t,n):this.policies.rootTypenamesById[t]?{}:void 0}merge(t,n){let r;lr(t)&&(t=t.__ref),lr(n)&&(n=n.__ref);const o="string"==typeof t?this.lookup(r=t):t,i="string"==typeof n?this.lookup(r=n):n;if(!i)return;Ot("string"==typeof r,99);const s=new kd({reconciler:lae}).merge(o,i);if(this.data[r]=s,s!==o&&(delete this.refs[r],this.group.caching)){const a={};o||(a.__exists=1),Object.keys(i).forEach(l=>{if(!o||o[l]!==s[l]){a[l]=1;const c=Xl(l);c!==l&&!this.policies.hasKeyArgs(s.__typename,c)&&(a[c]=1),void 0===s[l]&&!(this instanceof aa)&&delete s[l]}}),a.__typename&&!(o&&o.__typename)&&this.policies.rootTypenamesById[r]===s.__typename&&delete a.__typename,Object.keys(a).forEach(l=>this.group.dirty(r,l))}}modify(t,n,r){const o=this.lookup(t);if(o){const i={};let s=!1,a=!0;const l={DELETE:L2,INVALIDATE:hM,isReference:lr,toReference:this.toReference,canRead:this.canRead,readField:(c,u)=>this.policies.readField("string"==typeof c?{fieldName:c,from:u||Rd(t)}:c,{store:this})};if(Object.keys(o).forEach(c=>{const u=Xl(c);let d=o[c];if(void 0===d)return;const f="function"==typeof n?n:n[c]||(r?void 0:n[u]);if(f){let y=f===E3?L2:f(d,{...l,fieldName:u,storeFieldName:c,storage:this.getStorage(t,c)});if(y===hM)this.group.dirty(t,c);else if(y===L2&&(y=void 0),y!==d&&(i[c]=y,s=!0,d=y,false)){const R=Z=>{if(void 0===this.lookup(Z.__ref))return!0};if(lr(y))R(y);else if(Array.isArray(y)){let X,Z=!1;for(const ae of y){if(lr(ae)){if(Z=!0,R(ae))break}else if("object"==typeof ae&&ae){const[_e]=this.policies.identify(ae);_e&&(X=ae)}if(Z&&void 0!==X)break}}}}void 0!==d&&(a=!1)}),s)return this.merge(t,i),a&&(this instanceof aa?this.data[t]=void 0:delete this.data[t],this.group.dirty(t,"__exists")),!0}return!1}delete(t,n,r){const o=this.lookup(t);if(o){const i=this.getFieldValue(o,"__typename"),s=n&&r?this.policies.getStoreFieldName({typename:i,fieldName:n,args:r}):n;return this.modify(t,s?{[s]:E3}:E3,!!r)}return!1}evict(t,n){let r=!1;return t.id&&(zo.call(this.data,t.id)&&(r=this.delete(t.id,t.fieldName,t.args)),this instanceof aa&&this!==n&&(r=this.parent.evict(t,n)||r),(t.fieldName||r)&&this.group.dirty(t.id,t.fieldName||"__exists")),r}clear(){this.replace(null)}extract(){const t=this.toObject(),n=[];return this.getRootIdSet().forEach(r=>{zo.call(this.policies.rootTypenamesById,r)||n.push(r)}),n.length&&(t.__META={extraRootIds:n.sort()}),t}replace(t){if(Object.keys(this.data).forEach(n=>{t&&zo.call(t,n)||this.delete(n)}),t){const{__META:n,...r}=t;Object.keys(r).forEach(o=>{this.merge(o,r[o])}),n&&n.extraRootIds.forEach(this.retain,this)}}rootIds={};retain(t){return this.rootIds[t]=(this.rootIds[t]||0)+1}release(t){if(this.rootIds[t]>0){const n=--this.rootIds[t];return n||delete this.rootIds[t],n}return 0}getRootIdSet(t=new Set){return Object.keys(this.rootIds).forEach(t.add,t),this instanceof aa?this.parent.getRootIdSet(t):Object.keys(this.policies.rootTypenamesById).forEach(t.add,t),t}gc(){const t=this.getRootIdSet(),n=this.toObject();t.forEach(o=>{zo.call(n,o)&&(Object.keys(this.findChildRefIds(o)).forEach(t.add,t),delete n[o])});const r=Object.keys(n);if(r.length){let o=this;for(;o instanceof aa;)o=o.parent;r.forEach(i=>o.delete(i))}return r}refs={};findChildRefIds(t){if(!zo.call(this.refs,t)){const n=this.refs[t]={},r=this.data[t];if(!r)return n;const o=new Set([r]);o.forEach(i=>{lr(i)&&(n[i.__ref]=!0),di(i)&&Object.keys(i).forEach(s=>{const a=i[s];di(a)&&o.add(a)})})}return this.refs[t]}makeCacheKey(){return this.group.keyMaker.lookupArray(arguments)}getFieldValue=(t,n)=>lr(t)?this.get(t.__ref,n):t&&t[n];canRead=t=>lr(t)?this.has(t.__ref):"object"==typeof t;toReference=(t,n)=>{if("string"==typeof t)return Rd(t);if(lr(t))return t;const[r]=this.policies.identify(t);if(r){const o=Rd(r);return n&&this.merge(r,t),o}};get supportsResultCaching(){return this.group.caching}}class fM{caching;parent;d=null;keyMaker;constructor(t,n=null){this.caching=t,this.parent=n,this.resetCaching()}resetCaching(){this.d=this.caching?$x():null,this.keyMaker=new sa}depend(t,n){if(this.d){this.d(I3(t,n));const r=Xl(n);r!==n&&this.d(I3(t,r)),this.parent&&this.parent.depend(t,n)}}dirty(t,n){this.d&&this.d.dirty(I3(t,n),"__exists"===n?"forget":"setDirty")}}function I3(e,t){return t+"#"+e}function pM(e,t){Cf(e)&&e.group.depend(t,"__exists")}x2.Root=class sae extends x2{constructor({policies:t,resultCaching:n=!0,seed:r}){super(t,new fM(n)),r&&this.replace(r)}stump=new aae(this);addLayer(t,n){return this.stump.addLayer(t,n)}removeLayer(){return this}storageTrie=new sa;getStorage(){return this.storageTrie.lookupArray(arguments)}};class aa extends x2{id;parent;replay;group;constructor(t,n,r,o){super(n.policies,o),this.id=t,this.parent=n,this.replay=r,this.group=o,r(this)}addLayer(t,n){return new aa(t,this,n,this.group)}removeLayer(t){const n=this.parent.removeLayer(t);return t===this.id?(this.group.caching&&Object.keys(this.data).forEach(r=>{const o=this.data[r],i=n.lookup(r);i?o?o!==i&&Object.keys(o).forEach(s=>{$r(o[s],i[s])||this.group.dirty(r,s)}):(this.group.dirty(r,"__exists"),Object.keys(i).forEach(s=>{this.group.dirty(r,s)})):this.delete(r)}),n):n===this.parent?this:n.addLayer(this.id,this.replay)}toObject(){return{...this.parent.toObject(),...this.data}}findChildRefIds(t){const n=this.parent.findChildRefIds(t);return zo.call(this.data,t)?{...n,...super.findChildRefIds(t)}:n}getStorage(...t){let n=this.parent;for(;n.parent;)n=n.parent;return n.getStorage(...t)}}class aae extends aa{constructor(t){super("EntityStore.Stump",t,()=>{},new fM(t.group.caching,t.group))}removeLayer(){return this}merge(t,n){return this.parent.merge(t,n)}}function lae(e,t,n){const r=e[n],o=t[n];return $r(r,o)?r:o}function Cf(e){return!(!e||!e.supportsResultCaching)}const A3=new C2;function cae(e){const t=e.directives?.find(({name:r})=>"unmask"===r.value);if(!t)return"mask";const n=t.arguments?.find(({name:r})=>"mode"===r.value);return n&&"value"in n.value&&"migrate"===n.value.value?"migrate":"unmask"}const gM=Symbol.for("apollo.result.extensions"),Ql=Symbol.for("apollo.result.streamInfo"),uae=Symbol.for("apollo.observableQuery.variablesUnknown");function Pd(e,t,n,r){if(n.kind===Dt.INT||n.kind===Dt.FLOAT)e[t.value]=Number(n.value);else if(n.kind===Dt.BOOLEAN||n.kind===Dt.STRING)e[t.value]=n.value;else if(n.kind===Dt.OBJECT){const o={};n.fields.map(i=>Pd(o,i.name,i.value,r)),e[t.value]=o}else if(n.kind===Dt.VARIABLE)e[t.value]=(r||{})[n.name.value];else if(n.kind===Dt.LIST)e[t.value]=n.values.map(o=>{const i={};return Pd(i,t,o,r),i[t.value]});else if(n.kind===Dt.ENUM)e[t.value]=n.value;else{if(n.kind!==Dt.NULL)throw es(19,t.value,n.kind);e[t.value]=null}}function S3(e,t){if(e.arguments&&e.arguments.length){const n={};return e.arguments.forEach(({name:r,value:o})=>Pd(n,r,o,t)),n}return null}const dae=["connection","include","skip","client","rest","export","nonreactive","stream"];let yf=Va;const mM=Object.assign(function(e,t,n){if(t&&n&&n.connection&&n.connection.key){if(n.connection.filter&&n.connection.filter.length>0){const o=n.connection.filter?n.connection.filter:[];o.sort();const i={};o.forEach(a=>{i[a]=t[a]});const s=yf(i);if("{}"!==s)return`${n.connection.key}(${s})`}return n.connection.key}let r=e;if(t){const o=yf(t);"{}"!==o&&(r+=`(${o})`)}return n&&Object.keys(n).forEach(o=>{-1===dae.indexOf(o)&&(n[o]&&Object.keys(n[o]).length?r+=`@${o}(${yf(n[o])})`:r+=`@${o}`)}),r},{setStringify(e){const t=yf;return yf=e,t}});function w3(e){return Array.isArray(e)&&e.length>0}const vM={};function D3(e){const t=JSON.stringify(e);return vM[t]||(vM[t]={})}function CM(e){const t=D3(e);return t.keyFieldsFn||(t.keyFieldsFn=(n,r)=>{const o=(s,a)=>r.readField(a,s),i=r.keyObject=L3(e,s=>{let a=Bd(r.storeObject,s,o);return void 0===a&&n!==r.storeObject&&zo.call(n,s[0])&&(a=Bd(n,s,TM)),Ot(void 0!==a,102,s.join("."),n),a});return`${r.typename}:${JSON.stringify(i)}`})}function yM(e){const t=D3(e);return t.keyArgsFn||(t.keyArgsFn=(n,{field:r,variables:o,fieldName:i})=>{const s=L3(e,l=>{const c=l[0],u=c.charAt(0);if("@"!==u){if("$"===u){const d=c.slice(1);if(o&&zo.call(o,d)){const f=l.slice(0);return f[0]=d,Bd(o,f)}return}if(n)return Bd(n,l)}else if(r&&w3(r.directives)){const d=c.slice(1),f=r.directives.find(R=>R.name.value===d),y=f&&S3(f,o);return y&&Bd(y,l.slice(1))}}),a=JSON.stringify(s);return(n||"{}"!==a)&&(i+=":"+a),i})}function L3(e,t){const n=new kd;return bM(e).reduce((r,o)=>{let i=t(o);if(void 0!==i){for(let s=o.length-1;s>=0;--s)i={[o[s]]:i};r=n.merge(r,i)}return r},{})}function bM(e){const t=D3(e);if(!t.paths){const n=t.paths=[],r=[];e.forEach((o,i)=>{go(o)?(bM(o).forEach(s=>n.push(r.concat(s))),r.length=0):(r.push(o),go(e[i+1])||(n.push(r.slice(0)),r.length=0))})}return t.paths}function TM(e,t){return e[t]}function Bd(e,t,n){return n=n||TM,EM(t.reduce(function r(o,i){return go(o)?o.map(s=>r(s,i)):o&&n(o,i)},e))}function EM(e){return di(e)?go(e)?e.map(EM):L3(Object.keys(e).sort(),t=>Bd(e,t)):e}const IM=new C2,AM=new WeakMap;function bf(e){let t=AM.get(e);return t||AM.set(e,t={vars:new Set,dep:$x()}),t}function SM(e){bf(e).vars.forEach(t=>t.forgetCache(e))}function fae(e){const t=new Set,n=new Set,r=function(i){if(arguments.length>0){if(e!==i){e=i,t.forEach(a=>{bf(a).dep.dirty(r),function pae(e){e.broadcastWatches&&e.broadcastWatches()}(a)});const s=Array.from(n);n.clear(),s.forEach(a=>a(e))}}else{const s=IM.getValue();s&&(o(s),bf(s).dep(r))}return e};r.onNextChange=i=>(n.add(i),()=>{n.delete(i)});const o=r.attachCache=i=>(t.add(i),bf(i).vars.add(r),r);return r.forgetCache=i=>t.delete(i),r}function x3(e){return void 0!==e.args?e.args:e.field?S3(e.field,e.variables):null}const gae=()=>{},wM=(e,t)=>t.fieldName,DM=(e,t,{mergeObjects:n})=>n(e,t),LM=(e,t)=>t,mae=(e,t,{streamFieldInfo:n,existingData:r})=>{if(!e&&!r)return t;const o=[],i=e??r,s=n?.isLastChunk?t.length:Math.max(i.length,t.length);for(let a=0;a<s;a++)o[a]=void 0===t[a]?i[a]:t[a];return o};class vae{config;typePolicies={};toBeAdded={};supertypeMap=new Map;fuzzySubtypes=new Map;cache;rootIdsByTypename={};rootTypenamesById={};usingPossibleTypes=!1;constructor(t){this.config=t,this.config={dataIdFromObject:uM,...t},this.cache=this.config.cache,this.setRootTypename("Query"),this.setRootTypename("Mutation"),this.setRootTypename("Subscription"),t.possibleTypes&&this.addPossibleTypes(t.possibleTypes),t.typePolicies&&this.addTypePolicies(t.typePolicies)}identify(t,n){const r=this,o=n&&(n.typename||n.storeObject?.__typename)||t.__typename;if(o===this.rootTypenamesById.ROOT_QUERY)return["ROOT_QUERY"];const i=n&&n.storeObject||t,s={...n,typename:o,storeObject:i,readField:n&&n.readField||((...u)=>{const d=M3(u,i);return r.readField(d,{store:r.cache.data,variables:d.variables})})};let a;const l=o&&this.getTypePolicy(o);let c=l&&l.keyFn||this.config.dataIdFromObject;return A3.withValue(!0,()=>{for(;c;){const u=c({...t,...i},s);if(!go(u)){a=u;break}c=CM(u)}}),a=a?String(a):void 0,s.keyObject?[a,s.keyObject]:[a]}addTypePolicies(t){Object.keys(t).forEach(n=>{const{queryType:r,mutationType:o,subscriptionType:i,...s}=t[n];r&&this.setRootTypename("Query",n),o&&this.setRootTypename("Mutation",n),i&&this.setRootTypename("Subscription",n),zo.call(this.toBeAdded,n)?this.toBeAdded[n].push(s):this.toBeAdded[n]=[s]})}updateTypePolicy(t,n,r){const o=this.getTypePolicy(t),{keyFields:i,fields:s}=n;function a(l,c){l.merge="function"==typeof c?c:!0===c?DM:!1===c?LM:l.merge}a(o,n.merge),o.keyFn=!1===i?gae:go(i)?CM(i):"function"==typeof i?i:o.keyFn,s&&Object.keys(s).forEach(l=>{let c=r[l];(!c||c?.typename!==t)&&(c=r[l]={typename:t});const u=s[l];if("function"==typeof u)c.read=u;else{const{keyArgs:d,read:f,merge:y}=u;c.keyFn=!1===d?wM:go(d)?yM(d):"function"==typeof d?d:c.keyFn,"function"==typeof f&&(c.read=f),a(c,y)}c.read&&c.merge&&(c.keyFn=c.keyFn||wM)})}setRootTypename(t,n=t){const r="ROOT_"+t.toUpperCase(),o=this.rootTypenamesById[r];n!==o&&(Ot(!o||o===t,103,t),o&&delete this.rootIdsByTypename[o],this.rootIdsByTypename[n]=r,this.rootTypenamesById[r]=n)}addPossibleTypes(t){this.usingPossibleTypes=!0,Object.keys(t).forEach(n=>{this.getSupertypeSet(n,!0),t[n].forEach(r=>{this.getSupertypeSet(r,!0).add(n);const o=r.match(dM);(!o||o[0]!==r)&&this.fuzzySubtypes.set(r,new RegExp(r))})})}getTypePolicy(t){if(!zo.call(this.typePolicies,t)){const r=this.typePolicies[t]={};r.fields={};let o=this.supertypeMap.get(t);!o&&this.fuzzySubtypes.size&&(o=this.getSupertypeSet(t,!0),this.fuzzySubtypes.forEach((i,s)=>{if(i.test(t)){const a=this.supertypeMap.get(s);a&&a.forEach(l=>o.add(l))}})),o&&o.size&&o.forEach(i=>{const{fields:s,...a}=this.getTypePolicy(i);Object.assign(r,a),Object.assign(r.fields,s)})}const n=this.toBeAdded[t];return n&&n.length&&n.splice(0).forEach(r=>{this.updateTypePolicy(t,r,this.typePolicies[t].fields)}),this.typePolicies[t]}getFieldPolicy(t,n){if(t)return this.getTypePolicy(t).fields[n]}getSupertypeSet(t,n){let r=this.supertypeMap.get(t);return!r&&n&&this.supertypeMap.set(t,r=new Set),r}fragmentMatches(t,n,r,o){if(!t.typeCondition)return!0;if(!n)return!1;const i=t.typeCondition.name.value;if(n===i)return!0;if(this.usingPossibleTypes&&this.supertypeMap.has(i)){const s=this.getSupertypeSet(n,!0),a=[s],l=d=>{const f=this.getSupertypeSet(d,!1);f&&f.size&&a.indexOf(f)<0&&a.push(f)};let c=!(!r||!this.fuzzySubtypes.size),u=!1;for(let d=0;d<a.length;++d){const f=a[d];if(f.has(i))return s.has(i)||s.add(i),!0;f.forEach(l),c&&d===a.length-1&&T3(t.selectionSet,r,o)&&(c=!1,u=!0,this.fuzzySubtypes.forEach((y,R)=>{const Z=n.match(y);Z&&Z[0]===n&&l(R)}))}}return!1}hasKeyArgs(t,n){const r=this.getFieldPolicy(t,n);return!(!r||!r.keyFn)}getStoreFieldName(t){const{typename:n,fieldName:r}=t,o=this.getFieldPolicy(n,r);let i,s=o&&o.keyFn;if(s&&n){const a={typename:n,fieldName:r,field:t.field||null,variables:t.variables},l=x3(t);for(;s;){const c=s(l,a);if(!go(c)){i=c||r;break}s=yM(c)}}return void 0===i&&(i=t.field?function _ae(e,t){let n=null;e.directives&&(n={},e.directives.forEach(o=>{n[o.name.value]={},o.arguments&&o.arguments.forEach(({name:i,value:s})=>Pd(n[o.name.value],i,s,t))}));let r=null;return e.arguments&&e.arguments.length&&(r={},e.arguments.forEach(({name:o,value:i})=>Pd(r,o,i,t))),mM(e.name.value,r,n)}(t.field,t.variables):mM(r,x3(t))),!1===i?r:r===Xl(i)?i:r+":"+i}readField(t,n){const r=t.from;if(!r||!t.field&&!t.fieldName)return;if(void 0===t.typename){const u=n.store.getFieldValue(r,"__typename");u&&(t.typename=u)}const i=this.getStoreFieldName(t),s=Xl(i),a=n.store.getFieldValue(r,i),l=this.getFieldPolicy(t.typename,s),c=l&&l.read;if(c){const u=xM(this,r,t,n,n.store.getStorage(lr(r)?r.__ref:r,i));return IM.withValue(this.cache,c,[a,u])}return a}getReadFunction(t,n){const r=this.getFieldPolicy(t,n);return r&&r.read}getMergeFunction(t,n,r){let o=this.getFieldPolicy(t,n),i=o&&o.merge;return!i&&r&&(o=this.getTypePolicy(r),i=o&&o.merge),i}runMergeFunction(t,n,{field:r,typename:o,merge:i,path:s},a,l){const c=t;if(i===DM)return MM(a.store)(t,n);if(i===LM)return n;a.overwrite&&(t=void 0);const u=a.extensions?.[Ql]?.deref()?.peekArray(s);if(u){const{current:f,previous:y}=u;if(y&&$r(y.incoming,n)&&$r(y.streamFieldInfo,f))return y.result}const d=i(t,n,function Cae(e,t,n,r,o,i){const s={...xM(e,t,n,r,o),extensions:r.extensions,existingData:i},a=r.extensions;if(a&&Ql in a){const{[Ql]:l,...c}=a,u=l?.deref()?.peekArray(n.path);u&&(s.streamFieldInfo=u.current),s.extensions=0===Object.keys(c).length?void 0:c}return s}(this,void 0,{typename:o,fieldName:r.name.value,field:r,variables:a.variables,path:s},a,l||{},c));return u&&(u.previous={incoming:n,streamFieldInfo:u.current,result:d}),d}}function xM(e,t,n,r,o){const i=e.getStoreFieldName(n),s=Xl(i),a=n.variables||r.variables,{toReference:l,canRead:c}=r.store;return{args:x3(n),field:n.field||null,fieldName:s,storeFieldName:i,variables:a,isReference:lr,toReference:l,storage:o,cache:e.cache,canRead:c,readField:(...u)=>e.readField(M3(u,t,a),r),mergeObjects:MM(r.store)}}function M3(e,t,n){const{0:r,1:o,length:i}=e;let s;return"string"==typeof r?s={fieldName:r,from:i>1?o:t}:(s={...r},zo.call(s,"from")||(s.from=t)),void 0===s.variables&&(s.variables=n),s}function MM(e){return function(n,r){if(go(n)||go(r))throw es(106);if(di(n)&&di(r)){const o=e.getFieldValue(n,"__typename"),i=e.getFieldValue(r,"__typename");if(o&&i&&o!==i)return r;if(lr(n)&&Od(r))return e.merge(n.__ref,r),n;if(Od(n)&&lr(r))return e.merge(n,r.__ref),r;if(Od(n)&&Od(r))return{...n,...r}}return r}}function N3(e){const t={},n=e&&e.variableDefinitions;return n&&n.length&&n.forEach(r=>{r.defaultValue&&Pd(t,r.variable.name,r.defaultValue)}),t}function NM(e){const t=Ha(e);return Ot(t&&"query"===t.operation,13),t}function yae(e){let t=e[0]||{};const n=e.length;if(n>1){const r=new kd;for(let o=1;o<n;++o)t=r.merge(t,e[o])}return t}class k3 extends Error{message;path;query;variables;constructor(t,n,r,o){if(super(t),this.message=t,this.path=n,this.query=r,this.variables=o,this.name="MissingFieldError",Array.isArray(this.path)){this.missing=this.message;for(let i=this.path.length-1;i>=0;--i)this.missing={[this.path[i]]:this.missing}}else this.missing=this.path;this.__proto__=k3.prototype}missing}function kM(e){return[e.selectionSet,e.objectOrReference,e.context]}class bae{executeSelectionSet;executeSubSelectedArray;config;knownResults=new WeakMap;constructor(t){this.config=t,this.executeSelectionSet=uf(n=>{const r=kM(n);return this.executeSelectionSet.peek(...r)||(pM(n.context.store,n.enclosingRef.__ref),this.execSelectionSetImpl(n))},{max:Fa["inMemoryCache.executeSelectionSet"]||5e4,keyArgs:kM,makeCacheKey(n,r,o){if(Cf(o.store))return o.store.makeCacheKey(n,lr(r)?r.__ref:r,o.varString)}}),this.executeSubSelectedArray=uf(n=>(pM(n.context.store,n.enclosingRef.__ref),this.execSubSelectedArrayImpl(n)),{max:Fa["inMemoryCache.executeSubSelectedArray"]||1e4,makeCacheKey({field:n,array:r,context:o}){if(Cf(o.store))return o.store.makeCacheKey(n,r,o.varString)}})}diffQueryAgainstStore({store:t,query:n,rootId:r="ROOT_QUERY",variables:o,returnPartialData:i=!0}){const s=this.config.cache.policies;o={...N3(NM(n)),...o};const a=Rd(r),l=this.executeSelectionSet({selectionSet:b3(n).selectionSet,objectOrReference:a,enclosingRef:a,context:{store:t,query:n,policies:s,variables:o,varString:Va(o),..._M(n,this.config.fragments)}});let c;l.missing&&(c=new k3(function Tae(e){try{JSON.stringify(e,(t,n)=>{if("string"==typeof n)throw n;return n})}catch(t){return t}}(l.missing),l.missing,n,o));const u=!c,{result:d}=l;return{result:u?d:i?0===Object.keys(d).length?null:d:null,complete:u,missing:c}}isFresh(t,n,r,o){if(Cf(o.store)&&this.knownResults.get(t)===r){const i=this.executeSelectionSet.peek(r,n,o);if(i&&t===i.result)return!0}return!1}execSelectionSetImpl({selectionSet:t,objectOrReference:n,enclosingRef:r,context:o}){if(lr(n)&&!o.policies.rootTypenamesById[n.__ref]&&!o.store.has(n.__ref))return{result:{},missing:`Dangling reference to missing ${n.__ref} object`};const{variables:i,policies:s,store:a}=o,l=a.getFieldValue(n,"__typename"),c=[];let u;const d=new kd;function f(ae,_e){return ae.missing&&(u=d.merge(u,{[_e]:ae.missing})),ae.result}"string"==typeof l&&!s.rootIdsByTypename[l]&&c.push({__typename:l});const y=new Set(t.selections);y.forEach(ae=>{if(S2(ae,i))if(vf(ae)){let _e=s.readField({fieldName:ae.name.value,field:ae,variables:o.variables,from:n},o);const Ye=ou(ae);void 0===_e?d3.added(ae)||(u=d.merge(u,{[Ye]:`Can't find field '${ae.name.value}' on ${lr(n)?n.__ref+" object":"object "+JSON.stringify(n,null,2)}`})):go(_e)?_e.length>0&&(_e=f(this.executeSubSelectedArray({field:ae,array:_e,enclosingRef:r,context:o}),Ye)):ae.selectionSet&&null!=_e&&(_e=f(this.executeSelectionSet({selectionSet:ae.selectionSet,objectOrReference:_e,enclosingRef:lr(_e)?_e:r,context:o}),Ye)),void 0!==_e&&c.push({[Ye]:_e})}else{const _e=A2(ae,o.lookupFragment);if(!_e&&ae.kind===Dt.FRAGMENT_SPREAD)throw es(107,ae.name.value);_e&&s.fragmentMatches(_e,l)&&_e.selectionSet.selections.forEach(y.add,y)}});const X={result:yae(c),missing:u};return X.result&&this.knownResults.set(X.result,t),X}execSubSelectedArrayImpl({field:t,array:n,enclosingRef:r,context:o}){let i,s=new kd;function a(l,c){return l.missing&&(i=s.merge(i,{[c]:l.missing})),l.result}return t.selectionSet&&(n=n.filter(l=>void 0===l||o.store.canRead(l))),{result:n=n.map((l,c)=>null===l?null:go(l)?a(this.executeSubSelectedArray({field:t,array:l,enclosingRef:r,context:o}),c):t.selectionSet?a(this.executeSelectionSet({selectionSet:t.selectionSet,objectOrReference:l,enclosingRef:lr(l)?l:r,context:o}),c):l),missing:i}}}function Fd(e,t,n){const r=new Set(e),o=r.size;return ia(t,{Directive(i){if(r.delete(i.name.value)&&(!n||!r.size))return Zl}}),n?!r.size:r.size<o}function O3(e,t,n){const r=`${t}${n}`;let o=e.flavors.get(r);return o||e.flavors.set(r,o=e.clientOnly===t&&e.deferred===n?e:{...e,clientOnly:t,deferred:n}),o}class Sae{cache;reader;fragments;constructor(t,n,r){this.cache=t,this.reader=n,this.fragments=r}writeToStore(t,{query:n,result:r,dataId:o,variables:i,overwrite:s,extensions:a}){const l=Ha(n),c=function iae(){return new kd}();i={...N3(l),...i};const u={store:t,written:{},merge:(f,y)=>c.merge(f,y),variables:i,varString:Va(i),..._M(n,this.fragments),overwrite:!!s,incomingById:new Map,clientOnly:!1,deferred:!1,flavors:new Map,extensions:a},d=this.processSelectionSet({result:r||{},dataId:o,selectionSet:l.selectionSet,mergeTree:{map:new Map},context:u,path:[]});if(!lr(d))throw es(109,r);return u.incomingById.forEach(({storeObject:f,mergeTree:y},Z)=>{const X=Rd(Z);if(y&&y.map.size){const ae=this.applyMerges(y,X,f,u);if(lr(ae))return;f=ae}t.merge(Z,f)}),t.retain(d.__ref),d}processSelectionSet({dataId:t,result:n,selectionSet:r,context:o,mergeTree:i,path:s}){const{policies:a}=this.cache;let l={};const c=t&&a.rootTypenamesById[t]||B3(n,r,o.fragmentMap)||t&&o.store.get(t,"__typename");"string"==typeof c&&(l.__typename=c);const u=(...f)=>{const y=M3(f,l,o.variables);if(lr(y.from)){const R=o.incomingById.get(y.from.__ref);if(R){const Z=a.readField({...y,from:R.storeObject},o);if(void 0!==Z)return Z}}return a.readField(y,o)},d=new Set;this.flattenFields(r,n,o,c).forEach((f,y)=>{const R=ou(y),Z=n[R],X=[...s,y.name.value];if(d.add(y),void 0!==Z){const ae=a.getStoreFieldName({typename:c,fieldName:y.name.value,field:y,variables:f.variables}),_e=OM(i,ae);let ot,Ye=this.processFieldValue(Z,y,y.selectionSet?O3(f,!1,!1):f,_e,X);y.selectionSet&&(lr(Ye)||Od(Ye))&&(ot=u("__typename",Ye));const mt=a.getMergeFunction(c,y.name.value,ot);mt?_e.info={field:y,typename:c,merge:mt,path:X}:Fd(["stream"],y)&&Array.isArray(Ye)&&f.extensions?.[Ql]?_e.info={field:y,typename:c,merge:mae,path:X}:PM(i,ae),l=f.merge(l,{[ae]:Ye})}});try{const[f,y]=a.identify(n,{typename:c,selectionSet:r,fragmentMap:o.fragmentMap,storeObject:l,readField:u});t=t||f,y&&(l=o.merge(l,y))}catch(f){if(!t)throw f}if("string"==typeof t){const f=Rd(t),y=o.written[t]||(o.written[t]=[]);if(y.indexOf(r)>=0||(y.push(r),this.reader&&this.reader.isFresh(n,f,r,o)))return f;const R=o.incomingById.get(t);return R?(R.storeObject=o.merge(R.storeObject,l),R.mergeTree=P3(R.mergeTree,i),d.forEach(Z=>R.fieldNodeSet.add(Z))):o.incomingById.set(t,{storeObject:l,mergeTree:M2(i)?void 0:i,fieldNodeSet:d}),f}return l}processFieldValue(t,n,r,o,i){return n.selectionSet&&null!==t?go(t)?t.map((s,a)=>{const l=this.processFieldValue(s,n,r,OM(o,a),[...i,a]);return PM(o,a),l}):this.processSelectionSet({result:t,selectionSet:n.selectionSet,context:r,mergeTree:o,path:i}):t}flattenFields(t,n,r,o=B3(n,t,r.fragmentMap)){const i=new Map,{policies:s}=this.cache,a=new sa(!1);return function l(c,u){const d=a.lookup(c,u.clientOnly,u.deferred);d.visited||(d.visited=!0,c.selections.forEach(f=>{if(!S2(f,r.variables))return;let{clientOnly:y,deferred:R}=u;if(!(y&&R)&&w3(f.directives)&&f.directives.forEach(Z=>{const X=Z.name.value;if("client"===X&&(y=!0),"defer"===X){const ae=S3(Z,r.variables);(!ae||!1!==ae.if)&&(R=!0)}}),vf(f)){const Z=i.get(f);Z&&(y=y&&Z.clientOnly,R=R&&Z.deferred),i.set(f,O3(r,y,R))}else{const Z=A2(f,r.lookupFragment);if(!Z&&f.kind===Dt.FRAGMENT_SPREAD)throw es(111,f.name.value);Z&&s.fragmentMatches(Z,o,n,r.variables)&&l(Z.selectionSet,O3(r,y,R))}}))}(t,r),i}applyMerges(t,n,r,o,i){if(t.map.size&&!lr(r)){const s=go(r)||!lr(n)&&!Od(n)?void 0:n,a=r;let l;s&&!i&&(i=[lr(s)?s.__ref:s]);const c=(u,d)=>go(u)?"number"==typeof d?u[d]:void 0:o.store.getFieldValue(u,String(d));t.map.forEach((u,d)=>{const f=c(s,d),y=c(a,d);if(void 0===y)return;i&&i.push(d);const R=this.applyMerges(u,f,y,o,i);R!==y&&(l=l||new Map,l.set(d,R)),i&&Ot(i.pop()===d)}),l&&(r=go(a)?a.slice(0):{...a},l.forEach((u,d)=>{r[d]=u}))}return t.info?this.cache.policies.runMergeFunction(n,r,t.info,o,i&&o.store.getStorage(...i)):r}}const RM=[];function OM({map:e},t){return e.has(t)||e.set(t,RM.pop()||{map:new Map}),e.get(t)}function P3(e,t){if(e===t||!t||M2(t))return e;if(!e||M2(e))return t;const n=e.info&&t.info?{...e.info,...t.info}:e.info||t.info,r=e.map.size&&t.map.size,i={info:n,map:r?new Map:e.map.size?e.map:t.map};if(r){const s=new Set(t.map.keys());e.map.forEach((a,l)=>{i.map.set(l,P3(a,t.map.get(l))),s.delete(l)}),s.forEach(a=>{i.map.set(a,P3(t.map.get(a),e.map.get(a)))})}return i}function M2(e){return!e||!(e.info||e.map.size)}function PM({map:e},t){const n=e.get(t);n&&M2(n)&&(RM.push(n),e.delete(t))}function B3(e,t,n){let r;for(const o of t.selections)if(vf(o)){if("__typename"===o.name.value)return e[ou(o)]}else r?r.push(o):r=[o];if("string"==typeof e.__typename)return e.__typename;if(r)for(const o of r){const i=B3(e,A2(o,n).selectionSet,n);if("string"==typeof i)return i}}class FM extends sM{data;optimisticData;config;watches=new Set;storeReader;storeWriter;addTypenameTransform=new Ua(d3);maybeBroadcastWatch;assumeImmutableResults=!0;policies;makeVar=fae;constructor(t={}){super(),this.config=function rae(e){return iu(nae,e)}(t),this.policies=new vae({cache:this,dataIdFromObject:this.config.dataIdFromObject,possibleTypes:this.config.possibleTypes,typePolicies:this.config.typePolicies}),this.init()}init(){const t=this.data=new x2.Root({policies:this.policies,resultCaching:this.config.resultCaching});this.optimisticData=t.stump,this.resetResultCache()}resetResultCache(){const{fragments:t}=this.config;this.addTypenameTransform.resetCache(),t?.resetCaches(),this.storeWriter=new Sae(this,this.storeReader=new bae({cache:this,fragments:t}),t),this.maybeBroadcastWatch=uf((n,r)=>this.broadcastWatch(n,r),{max:Fa["inMemoryCache.maybeBroadcastWatch"]||5e3,makeCacheKey:n=>{const r=n.optimistic?this.optimisticData:this.data;if(Cf(r)){const{optimistic:o,id:i,variables:s}=n;return r.makeCacheKey(n.query,n.callback,Va({optimistic:o,id:i,variables:s}))}}}),new Set([this.data.group,this.optimisticData.group]).forEach(n=>n.resetCaching())}restore(t){return this.init(),t&&this.data.replace(t),this}extract(t=!1){return(t?this.optimisticData:this.data).extract()}read(t){const{returnPartialData:n=!1}=t;return this.storeReader.diffQueryAgainstStore({...t,store:t.optimistic?this.optimisticData:this.data,config:this.config,returnPartialData:n}).result}write(t){try{return++this.txCount,this.storeWriter.writeToStore(this.data,t)}finally{! --this.txCount&&!1!==t.broadcast&&this.broadcastWatches()}}modify(t){if(zo.call(t,"id")&&!t.id)return!1;const n=t.optimistic?this.optimisticData:this.data;try{return++this.txCount,n.modify(t.id||"ROOT_QUERY",t.fields,!1)}finally{! --this.txCount&&!1!==t.broadcast&&this.broadcastWatches()}}diff(t){return this.storeReader.diffQueryAgainstStore({...t,store:t.optimistic?this.optimisticData:this.data,rootId:t.id||"ROOT_QUERY",config:this.config})}watch(t){return this.watches.size||function hae(e){bf(e).vars.forEach(t=>t.attachCache(e))}(this),this.watches.add(t),t.immediate&&this.maybeBroadcastWatch(t),()=>{this.watches.delete(t)&&!this.watches.size&&SM(this),this.maybeBroadcastWatch.forget(t)}}gc(t){Va.reset(),hf.reset();const n=this.optimisticData.gc();return t&&!this.txCount&&t.resetResultCache&&this.resetResultCache(),n}retain(t,n){return(n?this.optimisticData:this.data).retain(t)}release(t,n){return(n?this.optimisticData:this.data).release(t)}identify(t){if(lr(t))return t.__ref;try{return this.policies.identify(t)[0]}catch(n){}}evict(t){if(!t.id){if(zo.call(t,"id"))return!1;t={...t,id:"ROOT_QUERY"}}try{return++this.txCount,this.optimisticData.evict(t,this.data)}finally{! --this.txCount&&!1!==t.broadcast&&this.broadcastWatches()}}reset(t){return this.init(),Va.reset(),t&&t.discardWatches?(this.watches.forEach(n=>this.maybeBroadcastWatch.forget(n)),this.watches.clear(),SM(this)):this.broadcastWatches(),Promise.resolve()}removeOptimistic(t){const n=this.optimisticData.removeLayer(t);n!==this.optimisticData&&(this.optimisticData=n,this.broadcastWatches())}txCount=0;batch(t){const{update:n,optimistic:r=!0,removeOptimistic:o,onWatchUpdated:i}=t;let s;const a=c=>{const{data:u,optimisticData:d}=this;++this.txCount,c&&(this.data=this.optimisticData=c);try{return s=n(this)}finally{--this.txCount,this.data=u,this.optimisticData=d}},l=new Set;return i&&!this.txCount&&this.broadcastWatches({...t,onWatchUpdated:c=>(l.add(c),!1)}),"string"==typeof r?this.optimisticData=this.optimisticData.addLayer(r,a):!1===r?a(this.data):a(),"string"==typeof o&&(this.optimisticData=this.optimisticData.removeLayer(o)),i&&l.size?(this.broadcastWatches({...t,onWatchUpdated(c,u){const d=i.call(this,c,u);return!1!==d&&l.delete(c),d}}),l.size&&l.forEach(c=>this.maybeBroadcastWatch.dirty(c))):this.broadcastWatches(t),s}performTransaction(t,n){return this.batch({update:t,optimistic:n||null!==n})}transformDocument(t){return this.addTypenameTransform.transformDocument(this.addFragmentsToDocument(t))}fragmentMatches(t,n){return this.policies.fragmentMatches(t,n)}lookupFragment(t){return this.config.fragments?.lookup(t)||null}resolvesClientField(t,n){return!!this.policies.getReadFunction(t,n)}broadcastWatches(t){if(!this.txCount){const n=this.onAfterBroadcast,r=new Set;this.onAfterBroadcast=o=>{r.add(o)};try{this.watches.forEach(o=>this.maybeBroadcastWatch(o,t)),r.forEach(o=>o())}finally{this.onAfterBroadcast=n}}}addFragmentsToDocument(t){const{fragments:n}=this.config;return n?n.transform(t):t}broadcastWatch(t,n){const{lastDiff:r}=t,o=this.diff(t);n&&(t.optimistic&&"string"==typeof n.optimistic&&(o.fromOptimisticTransaction=!0),n.onWatchUpdated&&!1===n.onWatchUpdated.call(this,t,o,r))||(!r||!$r(r.result,o.result))&&t.callback(t.lastDiff=o,r)}}class HM extends ui{constructor(t){super((n,r)=>{const{...o}=n;return Object.defineProperty(o,"client",{enumerable:!1,value:n.client}),new Lt(i=>{let s=!1;return Promise.resolve(o).then(a=>t(n.getContext(),a)).then(n.setContext).then(()=>{s||r(n).subscribe(i)}).catch(i.error.bind(i)),()=>{s=!0}})})}}class Dae{isIncrementalResult(t){return!1}prepareRequest(t){return Ot(!Fd(["defer","stream"],t.query),67),t}extractErrors(){}startRequest=void 0}const F3=ui.execute;function N2(e,t){return iu(e,t,t.variables&&{variables:iu({...e&&e.variables,...t.variables})})}function Lae(e){return ia(e,{FragmentSpread(t){if(!t.directives?.some(({name:n})=>"unmask"===n.value))return null}})}function Jl(e,t){const n=D(e)?e:()=>e,r=o=>o.error(n());return new Lt(t?o=>t.schedule(r,0,o):r)}function za(e){return Ni((t,n)=>{let i,r=null,o=!1;r=t.subscribe($i(n,void 0,void 0,s=>{i=fs(e(s,za(e)(t))),r?(r.unsubscribe(),r=null,i.subscribe(n)):o=!0})),o&&(r.unsubscribe(),r=null,i.subscribe(n))})}class ja{constructor(t,n,r){this.kind=t,this.value=n,this.error=r,this.hasValue="N"===t}observe(t){return function Mae(e,t){var n,r,o;const{kind:i,value:s,error:a}=e;if("string"!=typeof i)throw new TypeError('Invalid notification, missing "kind"');"N"===i?null===(n=t.next)||void 0===n||n.call(t,s):"E"===i?null===(r=t.error)||void 0===r||r.call(t,a):null===(o=t.complete)||void 0===o||o.call(t)}(this,t)}do(t,n,r){const{kind:o,value:i,error:s}=this;return"N"===o?t?.(i):"E"===o?n?.(s):r?.()}accept(t,n,r){var o;return D(null===(o=t)||void 0===o?void 0:o.next)?this.observe(t):this.do(t,n,r)}toObservable(){const{kind:t,value:n,error:r}=this,o="N"===t?Qs(n):"E"===t?Jl(()=>r):"C"===t?Wl:0;if(!o)throw new TypeError(`Unexpected notification kind ${t}`);return o}static createNext(t){return new ja("N",t)}static createError(t){return new ja("E",void 0,t)}static createComplete(){return ja.completeNotification}}function UM(e=1/0){return Ol(ht,e)}function Tf(...e){return function kae(){return UM(1)}()(Ks(e,I0(e)))}function H3(e,t){return"object"==typeof e&&null!==e&&e[Symbol.for("apollo.error")]===t}function U3(e){Object.defineProperty(e,Symbol.for("apollo.error"),{value:e.name,enumerable:!1,writable:!1,configurable:!1})}function VM(e){return e.filter(t=>t).map(t=>t.message||"Error message not found.").join("\n")}ja.completeNotification=new ja("C");let Ef=(()=>{class e extends Error{static is(n){return H3(n,"CombinedGraphQLErrors")}static formatMessage=VM;errors;data;extensions;constructor(n,r=n.errors||[]){super(e.formatMessage(r,{result:n,defaultFormatMessage:VM})),this.errors=r,this.data=n.data,this.extensions=n.extensions,this.name="CombinedGraphQLErrors",U3(this),Object.setPrototypeOf(this,e.prototype)}}return e})();function zM(e){return e.map(t=>t.message||"Error message not found.").join("\n")}let Rae=(()=>{class e extends Error{static is(n){return H3(n,"CombinedProtocolErrors")}static formatMessage=zM;errors;constructor(n){super(e.formatMessage(n,{defaultFormatMessage:zM})),this.name="CombinedProtocolErrors",this.errors=n,U3(this),Object.setPrototypeOf(this,e.prototype)}}return e})();class V3 extends Error{static is(t){return H3(t,"UnconventionalError")}constructor(t){super("An error of unexpected shape occurred.",{cause:t}),this.name="UnconventionalError",U3(this),Object.setPrototypeOf(this,V3.prototype)}}const z3=Symbol(),jM=new WeakSet;function GM(e,t,n){return A3.withValue(!0,()=>{const r=If(e,t,n,!1);return Object.isFrozen(e),r})}function If(e,t,n,r,o){const{knownChanged:i}=n,s=function Hae(e,t){if(t.has(e))return t.get(e);const n=Array.isArray(e)?[]:{};return t.set(e,n),n}(e,n.mutableTargets);if(Array.isArray(e)){for(const[a,l]of Array.from(e.entries())){if(null===l){s[a]=null;continue}const c=If(l,t,n,r,void 0);i.has(c)&&i.add(s),s[a]=c}return i.has(s)?s:e}for(const a of t.selections){let l;if(r&&i.add(s),a.kind===Dt.FIELD){const c=ou(a),u=a.selectionSet;if(l=s[c]||e[c],void 0===l)continue;if(u&&null!==l){const d=If(e[c],u,n,r,void 0);i.has(d)&&(l=d)}s[c]=l}if(a.kind===Dt.INLINE_FRAGMENT&&(!a.typeCondition||n.cache.fragmentMatches(a,e.__typename))&&(l=If(e,a.selectionSet,n,r,o)),a.kind===Dt.FRAGMENT_SPREAD){const c=a.name.value,u=n.fragmentMap[c]||(n.fragmentMap[c]=n.cache.lookupFragment(c));Ot(u,39,c);const d=cae(a);"mask"!==d&&(l=If(e,u.selectionSet,n,"migrate"===d,o))}i.has(l)&&i.add(s)}return"__typename"in e&&!("__typename"in s)&&(s.__typename=e.__typename),Object.keys(s).length!==Object.keys(e).length&&i.add(s),i.has(s)?s:e}function $M(e){return 7===e||8===e}function k2(e){return!$M(e)}function Hd(e){return!!e.errors?.length}function j3(e,t=()=>{}){return n=>new Lt(r=>{let o=t();return n.subscribe({next(i){let s;try{s=e(i,o)}catch(a){r.error(a)}void 0!==s&&r.next(s)},error(i){r.error(i)},complete(){r.complete()}})})}function Af(e){const t={data:e.data};return e.error&&(t.error=e.error),t}function jae(e){let t=!1;return ia(e,{Directive:{enter(n){if("client"===n.name.value&&n.arguments&&(t=n.arguments.some(r=>"always"===r.name.value&&"BooleanValue"===r.value.kind&&!0===r.value.value),t))return Zl}}}),t}function Gae(e,t){ql(t);const n=WM(""),r=WM(""),o=X=>{for(let _e,ae=0;ae<X.length&&(_e=X[ae]);++ae)if(!go(_e)){if(_e.kind===Dt.OPERATION_DEFINITION)return n(_e.name&&_e.name.value);if(_e.kind===Dt.FRAGMENT_DEFINITION)return r(_e.name.value)}return Ot.error(14),null};let i=0;for(let X=t.definitions.length-1;X>=0;--X)t.definitions[X].kind===Dt.OPERATION_DEFINITION&&++i;const s=function $ae(e){const t=new Map,n=new Map;return e.forEach(r=>{r&&(r.name?t.set(r.name,r):r.test&&n.set(r.test,r))}),r=>{let o=t.get(r.name.value);return!o&&n.size&&n.forEach((i,s)=>{s(r)&&(o=i)}),o}}(e),a=X=>w3(X)&&X.map(s).some(ae=>ae&&ae.remove),l=new Map;let c=!1;const u={enter(X){if(a(X.directives))return c=!0,null}},d=ia(t,{Field:u,InlineFragment:u,VariableDefinition:{enter:()=>!1},Variable:{enter(X,ae,_e,Ye,ot){const mt=o(ot);mt&&mt.variables.add(X.name.value)}},FragmentSpread:{enter(X,ae,_e,Ye,ot){if(a(X.directives))return c=!0,null;const mt=o(ot);mt&&mt.fragmentSpreads.add(X.name.value)}},FragmentDefinition:{enter(X,ae,_e,Ye){l.set(JSON.stringify(Ye),X)},leave:(X,ae,_e,Ye)=>X===l.get(JSON.stringify(Ye))?X:i>0&&X.selectionSet.selections.every(mt=>mt.kind===Dt.FIELD&&"__typename"===mt.name.value)?(r(X.name.value).removed=!0,c=!0,null):void 0},Directive:{leave(X){if(s(X))return c=!0,null}}});if(!c)return t;const f=X=>(X.transitiveVars||(X.transitiveVars=new Set(X.variables),X.removed||X.fragmentSpreads.forEach(ae=>{f(r(ae)).transitiveVars.forEach(_e=>{X.transitiveVars.add(_e)})})),X),y=new Set;d.definitions.forEach(X=>{X.kind===Dt.OPERATION_DEFINITION?f(n(X.name&&X.name.value)).fragmentSpreads.forEach(ae=>{y.add(ae)}):X.kind===Dt.FRAGMENT_DEFINITION&&0===i&&!r(X.name.value).removed&&y.add(X.name.value)}),y.forEach(X=>{f(r(X)).fragmentSpreads.forEach(ae=>{y.add(ae)})});const Z={enter(X){if((X=>!(y.has(X)&&!r(X).removed))(X.name.value))return null}};return function Wae(e){return ZM(Ha(e)||function nM(e){Ot("Document"===e.kind,6),Ot(e.definitions.length<=1,7);const t=e.definitions[0];return Ot("FragmentDefinition"===t.kind,8),t}(e),gf(mf(e)))?null:e}(ia(d,{FragmentSpread:Z,FragmentDefinition:Z,OperationDefinition:{leave(X){if(X.variableDefinitions){const ae=f(n(X.name&&X.name.value)).transitiveVars;if(ae.size<X.variableDefinitions.length)return{...X,variableDefinitions:X.variableDefinitions.filter(_e=>ae.has(_e.variable.name.value))}}}}}))}function WM(e){const t=new Map;return function(r=e){let o=t.get(r);return o||t.set(r,o={variables:new Set,fragmentSpreads:new Set}),o}}function ZM(e,t){return!e||e.selectionSet.selections.every(n=>n.kind===Dt.FRAGMENT_SPREAD&&ZM(t[n.name.value],t))}var yn=function(e){return e[e.loading=1]="loading",e[e.setVariables=2]="setVariables",e[e.fetchMore=3]="fetchMore",e[e.refetch=4]="refetch",e[e.poll=6]="poll",e[e.ready=7]="ready",e[e.error=8]="error",e[e.streaming=9]="streaming",e}(yn||{});function qM(e){return e.catch(()=>{}),e}const{assign:YM}=Object,Ud={loading:!0,networkStatus:yn.loading,data:void 0,dataState:"empty",partial:!0},G3={loading:!1,networkStatus:yn.ready,data:void 0,dataState:"empty",partial:!0};class $3{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:t,options:n,transformedQuery:r=t.transform(n.query)}){this.queryManager=t,this.waitForNetworkResult="network-only"===n.fetchPolicy,this.isTornDown=!1,this.subscribeToMore=this.subscribeToMore.bind(this),this.maskResult=this.maskResult.bind(this);const{watchQuery:{fetchPolicy:o="cache-first"}={}}=t.defaultOptions,{fetchPolicy:i=o,initialFetchPolicy:s=("standby"===i?o:i)}=n;n[uae]&&(Ot("standby"===i,80),this.variablesUnknown=!0),this.lastQuery=r,this.options={...n,initialFetchPolicy:s,fetchPolicy:i,variables:this.getVariablesWithDefaults(n.variables)},this.initializeObservablesQueue(),this["@@observable"]=()=>this,Symbol.observable&&(this[Symbol.observable]=()=>this);const a=Ha(this.query);this.queryName=a&&a.name&&a.name.value}initializeObservablesQueue(){this.subject=new Pn({query:this.query,variables:this.variables,result:Ud,meta:{}});const t=this.subject.pipe(Kc({subscribe:()=>{this.subject.observed||(this.reobserve(),setTimeout(()=>this.updatePolling()))},unsubscribe:()=>{this.subject.observed||this.tearDownQuery()}}),j3(({query:n,variables:r,result:o,meta:i},s)=>{const{shouldEmit:a}=i;if(o===Ud&&(s.previous=void 0,s.previousVariables=void 0),"standby"===this.options.fetchPolicy||2===a)return;if(1===a)return u();const{previous:l,previousVariables:c}=s;if(l){const d=this.queryManager.getDocumentInfo(n),f=this.queryManager.dataMasking;if((f||d.hasNonreactiveDirective?oM(f?d.nonReactiveQuery:n,l,o,r):$r(l,o))&&$r(c,r))return}if(3!==a||this.options.notifyOnNetworkStatusChange&&!$r(l,o))return u();function u(){return s.previous=o,s.previousVariables=r,o}},()=>({})));this.pipe=t.pipe.bind(t),this.subscribe=t.subscribe.bind(t),this.input=new Kn,this.input.complete=()=>{},this.input.pipe(this.operator).subscribe(this.subject)}subscribe;pipe;[Symbol.observable];"@@observable";getCacheDiff({optimistic:t=!0}={}){return this.cache.diff({query:this.query,variables:this.variables,returnPartialData:!0,optimistic:t})}getInitialResult(t){let n=t||this.options.fetchPolicy;this.queryManager.prioritizeCacheValues&&("network-only"===n||"cache-and-network"===n)&&(n="cache-first");const r=()=>{const o=this.getCacheDiff(),i=this.options.returnPartialData||o.complete?o.result??void 0:void 0;return this.maskResult({data:i,dataState:o.complete?"complete":void 0===i?"empty":"partial",loading:!o.complete,networkStatus:o.complete?yn.ready:yn.loading,partial:!o.complete})};switch(n){case"cache-only":return{...r(),loading:!1,networkStatus:yn.ready};case"cache-first":return r();case"cache-and-network":return{...r(),loading:!0,networkStatus:yn.loading};case"standby":return G3;default:return Ud}}resubscribeCache(){const{variables:t,fetchPolicy:n}=this.options,r=this.query,o="standby"===n||"no-cache"===n||this.waitForNetworkResult,i=!Sf({query:r,variables:t},this.unsubscribeFromCache)&&!this.waitForNetworkResult;if((o||i)&&this.unsubscribeFromCache?.(),o||!i)return;const s={query:r,variables:t,optimistic:!0,watcher:this,callback:l=>{const c=this.queryManager.getDocumentInfo(r);if((c.hasClientExports||c.hasForcedResolvers)&&(s.lastDiff=void 0),s.lastOwnDiff===l)return;const{result:u}=this.subject.getValue();!l.complete&&(u.error||u===Ud||u===G3)||$r(u.data,l.result)||this.scheduleNotify()}},a=this.cache.watch(s);this.unsubscribeFromCache=Object.assign(()=>{this.unsubscribeFromCache=void 0,a()},{query:r,variables:t})}stableLastResult;getCurrentResult(){const{result:t}=this.subject.getValue();let n=t.networkStatus===yn.error||this.hasObservers()||"no-cache"===this.options.fetchPolicy?t:this.getInitialResult();return n===Ud&&(n=this.getInitialResult()),$r(this.stableLastResult,n)||(this.stableLastResult=n),this.stableLastResult}refetch(t){const{fetchPolicy:n}=this.options,r={pollInterval:0};return r.fetchPolicy="no-cache"===n?"no-cache":"network-only",t&&!$r(this.variables,t)&&(r.variables=this.options.variables=this.getVariablesWithDefaults({...this.variables,...t})),this._lastWrite=void 0,this._reobserve(r,{newNetworkStatus:yn.refetch})}fetchMore({query:t,variables:n,context:r,errorPolicy:o,updateQuery:i}){Ot("cache-only"!==this.options.fetchPolicy,82,ps(this.query,"(anonymous)"));const s={...iu(this.options,{errorPolicy:"none"},{query:t,context:r,errorPolicy:o}),variables:t?n:{...this.variables,...n},fetchPolicy:"no-cache",notifyOnNetworkStatusChange:this.options.notifyOnNetworkStatusChange};s.query=this.transformDocument(s.query),this.lastQuery=t?this.transformDocument(this.options.query):s.query;let a=!1;const l="no-cache"!==this.options.fetchPolicy;l||Ot(i,83);const{finalize:c,pushNotification:u}=this.pushOperation(yn.fetchMore);u({source:"newNetworkStatus",kind:"N",value:{}},{shouldEmit:3});const{promise:d,operator:f}=KM(),{observable:y}=this.queryManager.fetchObservableWithInfo(s,{networkStatus:yn.fetchMore,exposeExtensions:!0}),R=y.pipe(f,l8(Z=>"N"===Z.kind&&"network"===Z.source)).subscribe({next:Z=>{a=!1;const X=Z.value,ae=X[gM];if($M(Z.value.networkStatus)&&c(),l){const _e=this.getCacheDiff();this.cache.batch({update:Ye=>{i?Ye.updateQuery({query:this.query,variables:this.variables,returnPartialData:!0,optimistic:!1,extensions:ae},ot=>i(ot,{fetchMoreResult:X.data,variables:s.variables})):Ye.writeQuery({query:s.query,variables:s.variables,data:X.data,extensions:ae})},onWatchUpdated:(Ye,ot)=>{if(Ye.watcher===this&&!$r(ot.result,_e.result)){a=!0;const mt=this.getCurrentResult();k2(X.networkStatus)&&u({kind:"N",source:"network",value:{...mt,networkStatus:X.networkStatus===yn.error?yn.ready:X.networkStatus,loading:!1,data:ot.result,dataState:"streaming"===X.dataState?"streaming":"complete"}})}}})}else{const _e=this.getCurrentResult(),Ye=i(_e.data,{fetchMoreResult:X.data,variables:s.variables});u({kind:"N",value:{..._e,networkStatus:yn.ready,loading:!1,data:Ye,dataState:"streaming"===_e.dataState?"streaming":"complete"},source:"network"})}}});return qM(d.then(Z=>Af(this.maskResult(Z))).finally(()=>{if(R.unsubscribe(),c(),l&&!a){const Z=this.getCurrentResult();"streaming"===Z.dataState?u({kind:"N",source:"network",value:{...Z,dataState:"complete",networkStatus:yn.ready}}):u({kind:"N",source:"newNetworkStatus",value:{}},{shouldEmit:1})}}))}subscribeToMore(t){const n=this.queryManager.startGraphQLSubscription({query:t.document,variables:t.variables,context:t.context}).subscribe({next:r=>{const{updateQuery:o,onError:i}=t,{error:s}=r;s?i?i(s):Ot.error(84,s):o&&this.updateQuery((a,l)=>o(a,{subscriptionData:r,...l}))}});return this.subscriptions.add(n),()=>{this.subscriptions.delete(n)&&n.unsubscribe()}}applyOptions(t){const n=iu(this.options,t||{});YM(this.options,n),this.updatePolling()}setVariables(t){var n=this;return(0,K.A)(function*(){return t=n.getVariablesWithDefaults(t),$r(n.variables,t)||(n.options.variables=t,!n.hasObservers())?Af(n.getCurrentResult()):n._reobserve({fetchPolicy:n.options.initialFetchPolicy,variables:t},{newNetworkStatus:yn.setVariables})})()}updateQuery(t){const{queryManager:n}=this,{result:r,complete:o}=this.getCacheDiff({optimistic:!1}),i=t(r,{variables:this.variables,complete:!!o,previousData:r});i&&(this.cache.writeQuery({query:this.options.query,data:i,variables:this.variables}),n.broadcastQueries())}startPolling(t){this.options.pollInterval=t,this.updatePolling()}stopPolling(){this.options.pollInterval=0,this.updatePolling()}applyNextFetchPolicy(t,n){if(n.nextFetchPolicy){const{fetchPolicy:r="cache-first",initialFetchPolicy:o=r}=n;"standby"===r||(n.fetchPolicy="function"==typeof n.nextFetchPolicy?n.nextFetchPolicy.call(n,r,{reason:t,options:n,observable:this,initialFetchPolicy:o}):"variables-changed"===t?o:n.nextFetchPolicy)}return n.fetchPolicy}fetch(t,n,r,o){const i=this.options.fetchPolicy;t.context??={};let s=!1,{observable:c,fromLink:u}=this.queryManager.fetchObservableWithInfo(t,{networkStatus:n,query:r,onCacheHit:()=>{s=!0},fetchQueryOperator:X=>new Lt(ae=>{try{return X.subscribe({next(_e){s=!0,ae.next(_e)},error:_e=>ae.error(_e),complete:()=>ae.complete()})}finally{s||(y.override=n,this.input.next({kind:"N",source:"newNetworkStatus",value:{resetError:!0},query:d,variables:f,meta:{shouldEmit:3,fetchPolicy:i}}))}}),observableQuery:this});const{query:d,variables:f}=this,y={abort:()=>{Z.unsubscribe()},query:d,variables:f};this.activeOperations.add(y);let R=n==yn.refetch||n==yn.setVariables;c=c.pipe(o,ff());const Z=c.pipe(Kc({next:X=>{"newNetworkStatus"===X.source||"N"===X.kind&&X.value.loading?y.override=n:delete y.override},finalize:()=>this.activeOperations.delete(y)})).subscribe({next:X=>{const ae={};R&&"N"===X.kind&&"loading"in X.value&&!X.value.loading&&(R=!1,ae.shouldEmit=1),this.input.next({...X,query:d,variables:f,meta:ae})}});return{fromLink:u,subscription:Z,observable:c}}didWarnCacheOnlyPolling=!1;updatePolling(){if(this.queryManager.ssrMode)return;const{pollingInfo:t,options:{pollInterval:r}}=this,o=()=>{const{options:l}=this;return!l.pollInterval||!this.hasObservers()||"cache-only"===l.fetchPolicy||"standby"===l.fetchPolicy};if(o())return void this.cancelPolling();if(t?.interval===r)return;(t||(this.pollingInfo={})).interval=r;const s=()=>{if(o())return this.cancelPolling();this.pollingInfo&&(k2(this.networkStatus)||this.options.skipPollAttempt?.()?a():this._reobserve({fetchPolicy:"no-cache"===this.options.initialFetchPolicy?"no-cache":"network-only"},{newNetworkStatus:yn.poll}).then(a,a))},a=()=>{const l=this.pollingInfo;l&&(clearTimeout(l.timeout),l.timeout=setTimeout(s,l.interval))};a()}cancelPolling(){this.pollingInfo&&(clearTimeout(this.pollingInfo.timeout),delete this.pollingInfo)}reobserve(t){return this._reobserve(t)}_reobserve(t,n){this.isTornDown=!1;let{newNetworkStatus:r}=n||{};this.queryManager.obsQueries.add(this);const o=r===yn.refetch||r===yn.poll,i=this.variables,s=this.options.fetchPolicy,a=iu(this.options,t||{});this.variablesUnknown&&="standby"===a.fetchPolicy;const l=o?a:YM(this.options,a),c=this.transformDocument(l.query);this.lastQuery=c,t&&"variables"in t&&(l.variables=this.getVariablesWithDefaults(t.variables)),o||(this.updatePolling(),t&&t.variables&&!$r(t.variables,i)&&"standby"!==l.fetchPolicy&&(l.fetchPolicy===s||"function"==typeof l.nextFetchPolicy)&&(this.applyNextFetchPolicy("variables-changed",l),void 0===r&&(r=yn.setVariables))),r||(r=yn.loading,this.networkStatus!==yn.loading&&t?.variables&&!$r(t.variables,i)&&(r=yn.setVariables),"standby"===l.fetchPolicy&&(r=yn.ready)),"standby"===l.fetchPolicy&&this.cancelPolling(),this.resubscribeCache();const{promise:d,operator:f}=KM("standby"===l.fetchPolicy?{data:void 0}:void 0),{subscription:y,observable:R,fromLink:Z}=this.fetch(l,r,c,f);!o&&(Z||!this.linkSubscription)&&(this.linkSubscription&&this.linkSubscription.unsubscribe(),this.linkSubscription=y);const X=Object.assign(qM(d.then(ae=>Af(this.maskResult(ae))).finally(()=>{!this.hasObservers()&&0===this.activeOperations.size&&this.tearDownQuery()})),{retain:()=>{const ae=R.subscribe({}),_e=()=>ae.unsubscribe();return d.then(_e,_e),X}});return X}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(t=>t.unsubscribe()),this.subscriptions.clear(),this.queryManager.obsQueries.delete(this),this.isTornDown=!0,this.abortActiveOperations(),this._lastWrite=void 0)}transformDocument(t){return this.queryManager.transform(t)}maskResult(t){const n=this.queryManager.maskOperation({document:this.query,data:t.data,fetchPolicy:this.options.fetchPolicy,cause:this});return n===t.data?t:{...t,data:n}}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(t=!1){if(!t){const r=this.queryManager.getDocumentInfo(this.query);if(r.hasClientExports||r.hasForcedResolvers)return}const{dirty:n}=this;if(this.resetNotifications(),n&&("cache-only"===this.options.fetchPolicy||"cache-and-network"===this.options.fetchPolicy||!this.activeOperations.size)){const r=this.getCacheDiff();$r(r.result,this.getCacheDiff({optimistic:!1}).result)?this.reobserveCacheFirst():this.input.next({kind:"N",value:{data:r.result,dataState:r.complete?"complete":r.result?"partial":"empty",networkStatus:yn.ready,loading:!1,error:void 0,partial:!r.complete},source:"cache",query:this.query,variables:this.variables,meta:{}})}}activeOperations=new Set;pushOperation(t){let n=!1;const{query:r,variables:o}=this,i=()=>{this.activeOperations.delete(s)},s={override:t,abort:()=>{n=!0,i()},query:r,variables:o};return this.activeOperations.add(s),{finalize:i,pushNotification:(a,l)=>{n||this.input.next({...a,query:r,variables:o,meta:{...l}})}}}calculateNetworkStatus(t){return t===yn.streaming?t:Array.from(this.activeOperations.values()).reverse().find(r=>Sf(r,this)&&void 0!==r.override)?.override??t}abortActiveOperations(){this.activeOperations.forEach(t=>t.abort())}reset(){const t="cache-only"===this.options.fetchPolicy;this.setResult(t?G3:Ud,{shouldEmit:t?1:2}),this.abortActiveOperations()}setResult(t,n){this.input.next({source:"setResult",kind:"N",value:t,query:this.query,variables:this.variables,meta:{...n}})}operator=j3(t=>{const{query:n,variables:r,meta:o}=t;if("setResult"===t.source)return{query:n,variables:r,result:t.value,meta:o};if("C"===t.kind||!Sf(t,this))return;let i;const s=this.subject.getValue();if("cache"===t.source){if(i=t.value,i.networkStatus===yn.ready&&i.partial&&(!this.options.returnPartialData||s.result.networkStatus===yn.error)&&"cache-only"!==this.options.fetchPolicy)return}else if("network"===t.source)this.waitForNetworkResult&&(this.waitForNetworkResult=!1,this.resubscribeCache()),i="E"===t.kind?{...Sf(s,t)?s.result:{data:void 0,dataState:"empty",partial:!0},error:t.error,networkStatus:yn.error,loading:!1}:t.value,"E"===t.kind&&"streaming"===i.dataState&&(i.dataState="complete"),i.error&&(o.shouldEmit=1);else if("newNetworkStatus"===t.source){const a=Sf(s,t)?s.result:this.getInitialResult(o.fetchPolicy),{resetError:l}=t.value,c=l?void 0:a.error,u=c?yn.error:yn.ready;i={...a,error:c,networkStatus:u}}return Ot(i),i.error||delete i.error,i.networkStatus=this.calculateNetworkStatus(i.networkStatus),i.loading=k2(i.networkStatus),i=this.maskResult(i),{query:n,variables:r,result:i,meta:o}});reobserveCacheFirst(){const{fetchPolicy:t,nextFetchPolicy:n}=this.options;"cache-and-network"===t||"network-only"===t?this.reobserve({fetchPolicy:"cache-first",nextFetchPolicy(r,o){return this.nextFetchPolicy=n,"function"==typeof this.nextFetchPolicy?this.nextFetchPolicy(r,o):t}}):this.reobserve()}getVariablesWithDefaults(t){return this.queryManager.getVariables(this.query,t)}}function Sf(e,t){return!!(e&&t&&e.query===t.query&&$r(e.variables,t.variables))}function KM(e){let n,r,t=e;return{promise:new Promise((s,a)=>{n=s,r=a}),operator:Kc({next(s){if("E"===s.kind)return r(s.error);"N"===s.kind&&"newNetworkStatus"!==s.source&&!s.value.loading&&(t=s.value)},finalize:()=>{if(t)n(t);else{const s="The operation was aborted.",a="AbortError";r(typeof DOMException<"u"?new DOMException(s,a):Object.assign(new Error(s),{name:a}))}}})}}const XM={},Vd=new WeakMap;function W3(e,t){const n=e[t];"function"==typeof n&&(e[t]=function(){return Vd.set(e,(Vd.get(e)+1)%1e15),n.apply(this,arguments)})}const QM=new WeakMap;class Z3{lastRequestId=1;cache;queryManager;id;observableQuery;incremental;constructor(t,n){const r=this.cache=t.cache,o=(QM.get(t)||0)+1;QM.set(t,o),this.id=o+"",this.observableQuery=n,this.queryManager=t,Vd.has(r)||(Vd.set(r,0),W3(r,"evict"),W3(r,"modify"),W3(r,"reset"))}_lastWrite;get lastWrite(){return(this.observableQuery||this)._lastWrite}set lastWrite(t){(this.observableQuery||this)._lastWrite=t}resetLastWrite(){this.lastWrite=void 0}shouldWrite(t,n){const{lastWrite:r}=this;return!(r&&r.dmCount===Vd.get(this.cache)&&$r(n,r.variables)&&$r(t.data,r.result.data)&&t.extensions?.[Ql]===r.result.extensions?.[Ql])}get hasNext(){return!!this.incremental&&this.incremental.hasNext}maybeHandleIncrementalResult(t,n,r){const{incrementalHandler:o}=this.queryManager;return o.isIncrementalResult(n)?(this.incremental||=o.startRequest({query:r}),this.incremental.handle(t,n)):n}markQueryResult(t,{document:n,variables:r,errorPolicy:o,cacheWriteBehavior:i}){const s={query:n,variables:r,returnPartialData:!0,optimistic:!0};this.observableQuery?.resetNotifications();const a=0===i,l=a?void 0:this.cache.diff(s);let c=this.maybeHandleIncrementalResult(l?.result,t,n);return a||(q3(c,o)?this.cache.batch({onWatchUpdated:(u,d)=>{u.watcher===this.observableQuery&&(u.lastOwnDiff=d)},update:u=>{if(this.shouldWrite(c,r))u.writeQuery({query:n,data:c.data,variables:r,overwrite:1===i,extensions:c.extensions}),this.lastWrite={result:c,variables:r,dmCount:Vd.get(this.cache)};else if(l&&l.complete)return void(c={...c,data:l.result});const d=u.diff(s);d.complete&&(c={...c,data:d.result})}}):this.lastWrite=void 0),c}markMutationResult(t,n,r=this.cache){const o=[],i=0===n.cacheWriteBehavior;let s=this.maybeHandleIncrementalResult(i?void 0:r.diff({id:"ROOT_MUTATION",query:this.queryManager.getDocumentInfo(n.document).asQuery,variables:n.variables,optimistic:!1,returnPartialData:!0}).result,t,n.document);if("ignore"===n.errorPolicy&&(s={...s,errors:[]}),Hd(s)&&"none"===n.errorPolicy)return Promise.resolve(s);const a=()=>({...s,dataState:this.hasNext?"streaming":"complete"});if(!i&&q3(s,n.errorPolicy)){o.push({result:s.data,dataId:"ROOT_MUTATION",query:n.document,variables:n.variables,extensions:s.extensions});const{updateQueries:c}=n;c&&this.queryManager.getObservableQueries("all").forEach(u=>{const d=u&&u.queryName;if(!d||!Object.hasOwnProperty.call(c,d))return;const f=c[d],{query:y,variables:R}=u,{result:Z,complete:X}=u.getCacheDiff({optimistic:!1});if(X&&Z){const ae=f(Z,{mutationResult:a(),queryName:y&&ps(y)||void 0,queryVariables:R});ae&&o.push({result:ae,dataId:"ROOT_QUERY",query:y,variables:R})}})}let l=n.refetchQueries;if("function"==typeof l&&(l=l(a())),o.length>0||(l||"").length>0||n.update||n.onQueryUpdated||n.removeOptimistic){const c=[];if(this.queryManager.refetchQueries({updateCache:u=>{i||o.forEach(f=>u.write(f));const{update:d}=n;if(d){if(!i){const f=u.diff({id:"ROOT_MUTATION",query:this.queryManager.getDocumentInfo(n.document).asQuery,variables:n.variables,optimistic:!1,returnPartialData:!0});f.complete&&(s={...s,data:f.result})}this.hasNext||d(u,s,{context:n.context,variables:n.variables})}!i&&!n.keepRootFields&&!this.hasNext&&u.modify({id:"ROOT_MUTATION",fields:(f,{fieldName:y,DELETE:R})=>"__typename"===y?f:R})},include:l,optimistic:!1,removeOptimistic:n.removeOptimistic,onQueryUpdated:n.onQueryUpdated||null}).forEach(u=>c.push(u)),n.awaitRefetchQueries||n.onQueryUpdated)return Promise.all(c).then(()=>s)}return Promise.resolve(s)}markMutationOptimistic(t,n){const r="function"==typeof t?t(n.variables,{IGNORE:XM}):t;return r!==XM&&(this.cache.recordOptimisticTransaction(o=>{try{this.markMutationResult({data:r},n,o)}catch(i){Ot.error(i)}},this.id),!0)}markSubscriptionResult(t,{document:n,variables:r,errorPolicy:o,cacheWriteBehavior:i}){0!==i&&(q3(t,o)&&this.cache.write({query:n,result:t.data,dataId:"ROOT_SUBSCRIPTION",variables:r,extensions:t.extensions}),this.queryManager.broadcastQueries())}}function q3(e,t="none"){const n="ignore"===t||"all"===t;let r=!Hd(e);return!r&&n&&e.data&&(r=!0),r}class Kae{defaultOptions;client;clientOptions;assumeImmutableResults;documentTransform;ssrMode;defaultContext;dataMasking;incrementalHandler;localState;queryDeduplication;prioritizeCacheValues=!1;onBroadcast;mutationStore;obsQueries=new Set;fetchCancelFns=new Map;constructor(t){const n=new Ua(o=>this.cache.transformDocument(o),{cache:!1});this.client=t.client,this.defaultOptions=t.defaultOptions,this.queryDeduplication=t.queryDeduplication,this.clientOptions=t.clientOptions,this.ssrMode=t.ssrMode,this.assumeImmutableResults=t.assumeImmutableResults,this.dataMasking=t.dataMasking,this.localState=t.localState,this.incrementalHandler=t.incrementalHandler;const r=t.documentTransform;this.documentTransform=r?n.concat(r).concat(n):n,this.defaultContext=t.defaultContext||{},(this.onBroadcast=t.onBroadcast)&&(this.mutationStore={})}get link(){return this.client.link}get cache(){return this.client.cache}stop(){this.obsQueries.forEach(t=>t.stop()),this.cancelPendingFetches(es(87))}cancelPendingFetches(t){this.fetchCancelFns.forEach(n=>n(t)),this.fetchCancelFns.clear()}mutate(t){var n=this;return(0,K.A)(function*({mutation:r,variables:o,optimisticResponse:i,updateQueries:s,refetchQueries:a=[],awaitRefetchQueries:l=!1,update:c,onQueryUpdated:u,fetchPolicy:d,errorPolicy:f,keepRootFields:y,context:R}){const Z=new Z3(n);r=n.cache.transformForLink(n.transform(r));const{hasClientExports:X}=n.getDocumentInfo(r);o=n.getVariables(r,o),X&&(o=yield n.localState.getExportedVariables({client:n.client,document:r,variables:o,context:R}));const ae=n.mutationStore&&(n.mutationStore[Z.id]={mutation:r,variables:o,loading:!0,error:null}),_e=i&&Z.markMutationOptimistic(i,{document:r,variables:o,cacheWriteBehavior:"no-cache"===d?0:2,errorPolicy:f,context:R,updateQueries:s,update:c,keepRootFields:y});return n.broadcastQueries(),new Promise((Ye,ot)=>{const mt={};return n.getObservableFromLink(r,{...R,optimisticResponse:_e?i:void 0},o,d,{},!1).observable.pipe(JM(),Ol(Xt=>{const Tn={...Xt};return Ks(Z.markMutationResult(Tn,{document:r,variables:o,cacheWriteBehavior:"no-cache"===d?0:2,errorPolicy:f,context:R,update:c,updateQueries:s,awaitRefetchQueries:l,refetchQueries:a,removeOptimistic:_e?Z.id:void 0,onQueryUpdated:u,keepRootFields:y}))})).pipe(dr(Xt=>{if(Hd(Xt)&&"none"===f)throw new Ef(Y3(Xt));return ae&&(ae.loading=!1,ae.error=null),Xt})).subscribe({next:Xt=>{if(n.broadcastQueries(),!Z.hasNext){const Tn={data:n.maskOperation({document:r,data:Xt.data,fetchPolicy:d,cause:mt})};Hd(Xt)&&(Tn.error=new Ef(Xt)),Object.keys(Xt.extensions||{}).length&&(Tn.extensions=Xt.extensions),Ye(Tn)}},error:Xt=>(ae&&(ae.loading=!1,ae.error=Xt),_e&&n.cache.removeOptimistic(Z.id),n.broadcastQueries(),"ignore"===f?Ye({data:void 0}):"all"===f?Ye({data:void 0,error:Xt}):void ot(Xt))})})}).apply(this,arguments)}fetchQuery(t,n){var r=this;return ql(t.query,oa.QUERY),(0,K.A)(function*(){return Zh(r.fetchObservableWithInfo(t,{networkStatus:n}).observable.pipe(j3(o=>{switch(o.kind){case"E":throw o.error;case"N":if("newNetworkStatus"!==o.source)return Af(o.value)}})),{defaultValue:{data:void 0}})})()}transform(t){return this.documentTransform.transformDocument(t)}transformCache=new r3(Fa["queryManager.getDocumentInfo"]||2e3);getDocumentInfo(t){const{transformCache:n}=this;if(!n.has(t)){const o=Ha(t),i={hasClientExports:Fd(["client","export"],t,!0),hasForcedResolvers:jae(t),hasNonreactiveDirective:Fd(["nonreactive"],t),hasIncrementalDirective:Fd(["defer"],t),nonReactiveQuery:Qae(t),clientQuery:Fd(["client"],t)?t:null,serverQuery:Gae([{name:"client",remove:!0},{name:"connection"},{name:"nonreactive"},{name:"unmask"}],t),operationType:o?.operation,defaultVars:N3(o),asQuery:{...t,definitions:t.definitions.map(s=>"OperationDefinition"===s.kind&&"query"!==s.operation?{...s,operation:"query"}:s)}};n.set(t,i)}const r=n.get(t);if(r.violation)throw r.violation;return r}getVariables(t,n){const r=this.getDocumentInfo(t).defaultVars,o=Object.entries(n??{}).map(([i,s])=>[i,void 0===s?r[i]:s]);return{...r,...Object.fromEntries(o)}}watchQuery(t){ql(t.query,oa.QUERY);const n=this.transform(t.query);return typeof(t={...t,variables:this.getVariables(n,t.variables)}).notifyOnNetworkStatusChange>"u"&&(t.notifyOnNetworkStatusChange=!0),new $3({queryManager:this,options:t,transformedQuery:n})}query(t){const n=this.transform(t.query);return this.fetchQuery({...t,query:n}).then(r=>({...r,data:this.maskOperation({document:n,data:r?.data,fetchPolicy:t.fetchPolicy})}))}requestIdCounter=1;generateRequestId(){return this.requestIdCounter++}clearStore(t={discardWatches:!0}){return this.cancelPendingFetches(es(89)),this.obsQueries.forEach(n=>{n.reset()}),this.mutationStore&&(this.mutationStore={}),this.cache.reset(t)}getObservableQueries(t="active"){const n=new Set,r=new Map,o=new Map,i=new Set;return Array.isArray(t)&&t.forEach(s=>{if("string"==typeof s)r.set(s,s),o.set(s,!1);else if(function Zae(e){return di(e)&&"Document"===e.kind&&Array.isArray(e.definitions)}(s)){const a=hf(this.transform(s));r.set(a,ps(s)),o.set(a,!1)}else di(s)&&s.query&&i.add(s)}),this.obsQueries.forEach(s=>{const a=hf(this.transform(s.options.query));if("all"===t)return void n.add(s);const{queryName:l,options:{fetchPolicy:c}}=s;"active"===t&&"standby"===c||("active"===t||l&&o.has(l)||a&&o.has(a))&&(n.add(s),l&&o.set(l,!0),a&&o.set(a,!0))}),i.size&&i.forEach(s=>{const a=new $3({queryManager:this,options:{...N2(this.defaultOptions.watchQuery,s),fetchPolicy:"network-only"}});n.add(a)}),n}refetchObservableQueries(t=!1){const n=[];return this.getObservableQueries(t?"all":"active").forEach(r=>{const{fetchPolicy:o}=r.options;(t||"standby"!==o)&&"cache-only"!==o&&n.push(r.refetch())}),this.broadcastQueries(),Promise.all(n)}startGraphQLSubscription(t){let{query:n,variables:r}=t;const{fetchPolicy:o="cache-first",errorPolicy:i="none",context:s={},extensions:a={}}=t;let l;ql(n,oa.SUBSCRIPTION),n=this.transform(n),r=this.getVariables(n,r);const c=(this.getDocumentInfo(n).hasClientExports?Ks(this.localState.getExportedVariables({client:this.client,document:n,variables:r,context:s})):Qs(r)).pipe(Ol(u=>{const{observable:d,restart:f}=this.getObservableFromLink(n,s,u,o,a),y=new Z3(this);return l=f,d.pipe(dr(R=>{y.markSubscriptionResult(R,{document:n,variables:u,errorPolicy:i,cacheWriteBehavior:"no-cache"===o?0:2});const Z={data:R.data??void 0};return Hd(R)?Z.error=new Ef(R):function Pae(e){return"extensions"in e&&Rae.is(e.extensions[z3])}(R)&&(Z.error=R.extensions[z3],delete R.extensions[z3]),R.extensions&&Object.keys(R.extensions).length&&(Z.extensions=R.extensions),Z.error&&"none"===i&&(Z.data=void 0),"ignore"===i&&delete Z.error,Z}),za(R=>Qs("ignore"===i?{data:void 0}:{data:void 0,error:R})),l8(R=>!(!R.data&&!R.error)))}));return Object.assign(c,{restart:()=>l?.()})}broadcastQueries(){this.onBroadcast&&this.onBroadcast(),this.obsQueries.forEach(t=>t.notify())}inFlightLinkObservables=new sa(!1);getObservableFromLink(t,n,r,o,i,s=n?.queryDeduplication??this.queryDeduplication){let a={};const{serverQuery:l,clientQuery:c,operationType:u,hasIncrementalDirective:d}=this.getDocumentInfo(t),f=ps(t),y={client:this.client};if(l){const{inFlightLinkObservables:R,link:Z}=this;try{let ae=function(_e){return new Lt(Ye=>{function ot(){return _e.subscribe({next:Ye.next.bind(Ye),complete:Ye.complete.bind(Ye),error:Ye.error.bind(Ye)})}let mt=ot();return a.restart||=()=>{mt.unsubscribe(),mt=ot()},()=>{mt.unsubscribe(),a.restart=void 0}})};const X=this.incrementalHandler.prepareRequest({query:l,variables:r,context:{...this.defaultContext,...n,queryDeduplication:s},extensions:i});if(n=X.context,s){const _e=hf(l),Ye=Va(r);a=R.lookup(_e,Ye),a.observable||(a.observable=F3(Z,X,y).pipe(ae,a8(()=>{R.peek(_e,Ye)===a&&R.remove(_e,Ye)}),u===oa.SUBSCRIPTION?ff():E2({refCount:!0})))}else a.observable=F3(Z,X,y).pipe(ae)}catch(X){a.observable=Jl(()=>X)}}else a.observable=Qs({data:{}});if(c){const{operation:R}=Ha(t);Ot(!d,94,R[0].toUpperCase()+R.slice(1),f??"(anonymous)"),a.observable=a.observable.pipe(Ol(Z=>Ks(this.localState.execute({client:this.client,document:c,remoteResult:Z,context:n,variables:r,fetchPolicy:o}))))}return{restart:()=>a.restart?.(),observable:a.observable.pipe(za(R=>{throw R=function Bae(e){return function Oae(e){return null!==e&&"object"==typeof e&&"string"==typeof e.message&&"string"==typeof e.name&&("string"==typeof e.stack||typeof e.stack>"u")}(e)?e:"string"==typeof e?new Error(e,{cause:e}):new V3(e)}(R),function Fae(e){jM.add(e)}(R),R}))}}getResultsFromLink(t,{queryInfo:n,cacheWriteBehavior:r,observableQuery:o,exposeExtensions:i}){const s=n.lastRequestId=this.generateRequestId(),{errorPolicy:a}=t,l=this.cache.transformForLink(t.query);return this.getObservableFromLink(l,t.context,t.variables,t.fetchPolicy).observable.pipe(dr(c=>{const u=n.markQueryResult(c,{...t,document:l,cacheWriteBehavior:r}),d=Hd(u);if(d&&"none"===a)throw n.resetLastWrite(),o?.resetNotifications(),new Ef(Y3(u));const f={data:u.data,...n.hasNext?{loading:!0,networkStatus:yn.streaming,dataState:"streaming",partial:!0}:{dataState:u.data?"complete":"empty",loading:!1,networkStatus:yn.ready,partial:!u.data}};return i&&"extensions"in u&&(f[gM]=u.extensions),d&&("none"===a&&(f.data=void 0,f.dataState="empty"),"ignore"!==a&&(f.error=new Ef(Y3(u)),"streaming"!==f.dataState&&(f.networkStatus=yn.error))),f}),za(c=>{if(s>=n.lastRequestId&&"none"===a)throw n.resetLastWrite(),o?.resetNotifications(),c;const u={data:void 0,dataState:"empty",loading:!1,networkStatus:yn.ready,partial:!0};return"ignore"!==a&&(u.error=c,u.networkStatus=yn.error),Qs(u)}))}fetchObservableWithInfo(t,{networkStatus:n=yn.loading,query:r=t.query,fetchQueryOperator:o=l=>l,onCacheHit:i=()=>{},observableQuery:s,exposeExtensions:a}){const l=this.getVariables(r,t.variables);let{fetchPolicy:c="cache-first",errorPolicy:u="none",returnPartialData:d=!1,notifyOnNetworkStatusChange:f=!0,context:y={}}=t;this.prioritizeCacheValues&&("network-only"===c||"cache-and-network"===c)&&(c="cache-first");const R=Object.assign({},t,{query:r,variables:l,fetchPolicy:c,errorPolicy:u,returnPartialData:d,notifyOnNetworkStatusChange:f,context:y}),Z=new Z3(this,s),X=mt=>{R.variables=mt;const Tn=this.fetchQueryByPolicy(R,{queryInfo:Z,cacheWriteBehavior:"no-cache"===c?0:n===yn.refetch&&"merge"!==R.refetchWritePolicy?1:2,onCacheHit:i,observableQuery:s,exposeExtensions:a});return Tn.observable=Tn.observable.pipe(o),"standby"!==R.fetchPolicy&&s?.applyNextFetchPolicy("after-fetch",t),Tn},ae=()=>{this.fetchCancelFns.delete(Z.id)};this.fetchCancelFns.set(Z.id,mt=>{_e.next({kind:"E",error:mt,source:"network"})});const _e=new Kn;let Ye,ot;if(this.getDocumentInfo(R.query).hasClientExports)Ye=Ks(this.localState.getExportedVariables({client:this.client,document:R.query,variables:R.variables,context:R.context})).pipe(Ol(mt=>X(mt).observable)),ot=!0;else{const mt=X(R.variables);ot=mt.fromLink,Ye=mt.observable}return{observable:new Lt(mt=>{mt.add(ae),Ye.subscribe(mt),_e.subscribe(mt)}).pipe(ff()),fromLink:ot}}refetchQueries({updateCache:t,include:n,optimistic:r=!1,removeOptimistic:o=(r?mx("refetchQueries"):void 0),onQueryUpdated:i}){const s=new Map;n&&this.getObservableQueries(n).forEach(l=>{if("cache-only"===l.options.fetchPolicy||l.variablesUnknown)return;const c=l.getCurrentResult();s.set(l,{oq:l,lastDiff:{result:c?.data,complete:!c?.partial}})});const a=new Map;if(t){const l=new Set;this.cache.batch({update:t,optimistic:r&&o||!1,removeOptimistic:o,onWatchUpdated(c,u,d){const f=c.watcher;if(f instanceof $3&&!l.has(f)){if(l.add(f),i){s.delete(f);let y=i(f,u,d);return!0===y&&(y=f.refetch().retain()),!1!==y&&a.set(f,y),y}null!==i&&"cache-only"!==f.options.fetchPolicy&&s.set(f,{oq:f,lastDiff:d,diff:u})}}})}return s.size&&s.forEach(({oq:l,lastDiff:c,diff:u})=>{let d;i&&(u||(u=l.getCacheDiff()),d=i(l,u,c)),(!i||!0===d)&&(d=l.refetch().retain()),!1!==d&&a.set(l,d)}),o&&this.cache.removeOptimistic(o),a}noCacheWarningsByCause=new WeakSet;maskOperation(t){const{document:n,data:r}=t;return this.dataMasking?function Vae(e,t,n){const r=Ha(t);return Ot(r,43),null==e?e:GM(e,r.selectionSet,{operationType:r.operation,operationName:r.name?.value,fragmentMap:gf(mf(t)),cache:n,mutableTargets:new WeakMap,knownChanged:new WeakSet})}(r,n,this.cache):r}maskFragment(t){const{data:n,fragment:r,fragmentName:o}=t;return this.dataMasking?function zae(e,t,n,r){const o=t.definitions.filter(s=>s.kind===Dt.FRAGMENT_DEFINITION);typeof r>"u"&&(Ot(1===o.length,41,o.length),r=o[0].name.value);const i=o.find(s=>s.name.value===r);return Ot(!!i,42,r),null==e||$r(e,{})?e:GM(e,i.selectionSet,{operationType:"fragment",operationName:i.name.value,fragmentMap:gf(mf(t)),cache:n,mutableTargets:new WeakMap,knownChanged:new WeakSet})}(n,r,this.cache,o):n}fetchQueryByPolicy({query:t,variables:n,fetchPolicy:r,errorPolicy:o,returnPartialData:i,context:s},{cacheWriteBehavior:a,onCacheHit:l,queryInfo:c,observableQuery:u,exposeExtensions:d}){const f=()=>this.cache.diff({query:t,variables:n,returnPartialData:!0,optimistic:!0}),y=(Z,X)=>{const ae=Z.result,_e=ot=>(!Z.complete&&!i&&(ot=void 0),{data:ot,dataState:Z.complete?"complete":ot?"partial":"empty",loading:k2(X),networkStatus:X,partial:!Z.complete});return(Z.complete||i)&&this.getDocumentInfo(t).hasForcedResolvers?(l(),Ks(this.localState.execute({client:this.client,document:t,remoteResult:ae?{data:ae}:void 0,context:s,variables:n,onlyRunForcedResolvers:!0,returnPartialData:!0,fetchPolicy:r}).then(ot=>({kind:"N",value:_e(ot.data||void 0),source:"cache"})))):Qs({kind:"N",value:_e("none"===o&&X===yn.refetch&&Z.missing?void 0:ae||void 0),source:"cache"})},R=()=>this.getResultsFromLink({query:t,variables:n,context:s,fetchPolicy:r,errorPolicy:o},{cacheWriteBehavior:a,queryInfo:c,observableQuery:u,exposeExtensions:d}).pipe(JM(),function Nae(){return Ni((e,t)=>{e.subscribe($i(t,n=>{t.next(ja.createNext(n))},()=>{t.next(ja.createComplete()),t.complete()},n=>{t.next(ja.createError(n)),t.complete()}))})}(),dr(Z=>({...Z,source:"network"})));switch(r){default:case"cache-first":{const Z=f();return Z.complete?{fromLink:!1,observable:y(Z,yn.ready)}:i?{fromLink:!0,observable:Tf(y(Z,yn.loading),R())}:{fromLink:!0,observable:R()}}case"cache-and-network":{const Z=f();return Z.complete||i?{fromLink:!0,observable:Tf(y(Z,yn.loading),R())}:{fromLink:!0,observable:R()}}case"cache-only":return{fromLink:!1,observable:Tf(y(f(),yn.ready))};case"network-only":case"no-cache":return{fromLink:!0,observable:R()};case"standby":return{fromLink:!1,observable:Wl}}}}function JM(){let e=!1;return Kc({next(){e=!0},complete(){Ot(e,98)}})}function Qae(e){return ia(e,{FragmentSpread:t=>{if(!t.directives?.some(n=>"unmask"===n.name.value))return{...t,directives:[...t.directives||[],{kind:Dt.DIRECTIVE,name:{kind:Dt.NAME,value:"nonreactive"}}]}}})}function Y3(e){if(null==e.extensions?.[Ql])return e;const{extensions:{[Ql]:t,...n},...r}=e;return Object.keys(n).length>0&&(r.extensions=n),r}class K3{link;cache;disableNetworkFetches;set prioritizeCacheValues(t){this.queryManager.prioritizeCacheValues=t}get prioritizeCacheValues(){return this.queryManager.prioritizeCacheValues}version;queryDeduplication;defaultOptions;devtoolsConfig;queryManager;devToolsHookCb;resetStoreCallbacks=[];clearStoreCallbacks=[];constructor(t){const{cache:n,documentTransform:r,ssrMode:o=!1,ssrForceFetchDelay:i=0,queryDeduplication:s=!0,defaultOptions:a,defaultContext:l,assumeImmutableResults:c=n.assumeImmutableResults,localState:u,devtools:d,dataMasking:f,link:y,incrementalHandler:R=new Dae,experiments:Z=[]}=t;this.link=y,this.cache=n,this.queryDeduplication=s,this.defaultOptions=a||{},this.devtoolsConfig={...d,enabled:d?.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=K8,this.queryManager=new Kae({client:this,defaultOptions:this.defaultOptions,defaultContext:l,documentTransform:r,queryDeduplication:s,ssrMode:o,dataMasking:!!f,clientOptions:t,incrementalHandler:R,assumeImmutableResults:c,onBroadcast:this.devtoolsConfig.enabled?()=>{this.devToolsHookCb&&this.devToolsHookCb()}:void 0,localState:u}),this.prioritizeCacheValues=o||i>0,i&&setTimeout(()=>{this.prioritizeCacheValues=!1},i),this.devtoolsConfig.enabled&&this.connectToDevTools(),Z.forEach(X=>X.call(this,t))}connectToDevTools(){if(typeof window>"u")return;const t=window,n=Symbol.for("apollo.devtools");(t[n]=t[n]||[]).push(this),t.__APOLLO_CLIENT__=this}get documentTransform(){return this.queryManager.documentTransform}get localState(){return this.queryManager.localState}set localState(t){this.queryManager.localState=t}stop(){this.queryManager.stop()}watchQuery(t){return this.defaultOptions.watchQuery&&(t=N2(this.defaultOptions.watchQuery,t)),this.queryManager.watchQuery(t)}query(t){return this.defaultOptions.query&&(t=N2(this.defaultOptions.query,t)),this.queryManager.query(t)}mutate(t){const n=N2(iu({fetchPolicy:"network-only",errorPolicy:"none"},this.defaultOptions.mutate),t);return ql(n.mutation,oa.MUTATION),this.queryManager.mutate(n)}subscribe(t){const n={},r=this.queryManager.startGraphQLSubscription(t),o=r.pipe(dr(i=>({...i,data:this.queryManager.maskOperation({document:t.query,data:i.data,fetchPolicy:t.fetchPolicy,cause:n})})));return Object.assign(o,{restart:r.restart})}readQuery(t,n=!1){return this.cache.readQuery({...t,query:this.transform(t.query)},n)}watchFragment(t){const n=this.queryManager.dataMasking;return this.cache.watchFragment({...t,fragment:this.transform(t.fragment,n)})}readFragment(t,n=!1){return this.cache.readFragment({...t,fragment:this.transform(t.fragment)},n)}writeQuery(t){const n=this.cache.writeQuery(t);return!1!==t.broadcast&&this.queryManager.broadcastQueries(),n}writeFragment(t){const n=this.cache.writeFragment(t);return!1!==t.broadcast&&this.queryManager.broadcastQueries(),n}__actionHookForDevTools(t){this.devToolsHookCb=t}__requestRaw(t){return F3(this.link,t,{client:this})}resetStore(){return Promise.resolve().then(()=>this.queryManager.clearStore({discardWatches:!1})).then(()=>Promise.all(this.resetStoreCallbacks.map(t=>t()))).then(()=>this.refetchObservableQueries())}clearStore(){return Promise.resolve().then(()=>this.queryManager.clearStore({discardWatches:!0})).then(()=>Promise.all(this.clearStoreCallbacks.map(t=>t())))}onResetStore(t){return this.resetStoreCallbacks.push(t),()=>{this.resetStoreCallbacks=this.resetStoreCallbacks.filter(n=>n!==t)}}onClearStore(t){return this.clearStoreCallbacks.push(t),()=>{this.clearStoreCallbacks=this.clearStoreCallbacks.filter(n=>n!==t)}}reFetchObservableQueries;refetchObservableQueries(t){return this.queryManager.refetchObservableQueries(t)}refetchQueries(t){const n=this.queryManager.refetchQueries(t),r=[],o=[];n.forEach((s,a)=>{r.push(a),o.push(s)});const i=Promise.all(o);return i.queries=r,i.results=o,i.catch(s=>{}),i}getObservableQueries(t="active"){return this.queryManager.getObservableQueries(t)}extract(t){return this.cache.extract(t)}restore(t){return this.cache.restore(t)}setLink(t){this.link=t}get defaultContext(){return this.queryManager.defaultContext}maskedFragmentTransform=new Ua(Lae);transform(t,n=!1){const r=this.queryManager.transform(t);return n?this.maskedFragmentTransform.transformDocument(r):r}}function ele(e,t){if(!e)throw new Error(t??"Unexpected invariant triggered.")}const tle=/\r\n|[\n\r]/g;function X3(e,t){let n=0,r=1;for(const o of e.body.matchAll(tle)){if("number"==typeof o.index||ele(!1),o.index>=t)break;n=o.index+o[0].length,r+=1}return{line:r,column:t+1-n}}function nle(e){return tN(e.source,X3(e.source,e.start))}function tN(e,t){const n=e.locationOffset.column-1,r="".padStart(n)+e.body,o=t.line-1,s=t.line+(e.locationOffset.line-1),l=t.column+(1===t.line?n:0),c=`${e.name}:${s}:${l}\n`,u=r.split(/\r\n|[\n\r]/g),d=u[o];if(d.length>120){const f=Math.floor(l/80),y=l%80,R=[];for(let Z=0;Z<d.length;Z+=80)R.push(d.slice(Z,Z+80));return c+nN([[`${s} |`,R[0]],...R.slice(1,f+1).map(Z=>["|",Z]),["|","^".padStart(y)],["|",R[f+1]]])}return c+nN([[s-1+" |",u[o-1]],[`${s} |`,d],["|","^".padStart(l)],[`${s+1} |`,u[o+1]]])}function nN(e){const t=e.filter(([r,o])=>void 0!==o),n=Math.max(...t.map(([r])=>r.length));return t.map(([r,o])=>r.padStart(n)+(o?" "+o:"")).join("\n")}class Q3 extends Error{constructor(t,...n){var r,o,i;const{nodes:s,source:a,positions:l,path:c,originalError:u,extensions:d}=function rle(e){const t=e[0];return null==t||"kind"in t||"length"in t?{nodes:t,source:e[1],positions:e[2],path:e[3],originalError:e[4],extensions:e[5]}:t}(n);super(t),this.name="GraphQLError",this.path=c??void 0,this.originalError=u??void 0,this.nodes=rN(Array.isArray(s)?s:s?[s]:void 0);const f=rN(null===(r=this.nodes)||void 0===r?void 0:r.map(R=>R.loc).filter(R=>null!=R));this.source=a??(null==f||null===(o=f[0])||void 0===o?void 0:o.source),this.positions=l??f?.map(R=>R.start),this.locations=l&&a?l.map(R=>X3(a,R)):f?.map(R=>X3(R.source,R.start));const y=function Jae(e){return"object"==typeof e&&null!==e}(u?.extensions)?u?.extensions:void 0;this.extensions=null!==(i=d??y)&&void 0!==i?i:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),null!=u&&u.stack?Object.defineProperty(this,"stack",{value:u.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,Q3):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let t=this.message;if(this.nodes)for(const n of this.nodes)n.loc&&(t+="\n\n"+nle(n.loc));else if(this.source&&this.locations)for(const n of this.locations)t+="\n\n"+tN(this.source,n);return t}toJSON(){const t={message:this.message};return null!=this.locations&&(t.locations=this.locations),null!=this.path&&(t.path=this.path),null!=this.extensions&&Object.keys(this.extensions).length>0&&(t.extensions=this.extensions),t}}function rN(e){return void 0===e||0===e.length?void 0:e}function ko(e,t,n){return new Q3(`Syntax Error: ${n}`,{source:e,positions:[t]})}var oN=function(e){return e.QUERY="QUERY",e.MUTATION="MUTATION",e.SUBSCRIPTION="SUBSCRIPTION",e.FIELD="FIELD",e.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",e.FRAGMENT_SPREAD="FRAGMENT_SPREAD",e.INLINE_FRAGMENT="INLINE_FRAGMENT",e.VARIABLE_DEFINITION="VARIABLE_DEFINITION",e.SCHEMA="SCHEMA",e.SCALAR="SCALAR",e.OBJECT="OBJECT",e.FIELD_DEFINITION="FIELD_DEFINITION",e.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",e.INTERFACE="INTERFACE",e.UNION="UNION",e.ENUM="ENUM",e.ENUM_VALUE="ENUM_VALUE",e.INPUT_OBJECT="INPUT_OBJECT",e.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION",e}(oN||{}),rt=function(e){return e.SOF="<SOF>",e.EOF="<EOF>",e.BANG="!",e.DOLLAR="$",e.AMP="&",e.PAREN_L="(",e.PAREN_R=")",e.DOT=".",e.SPREAD="...",e.COLON=":",e.EQUALS="=",e.AT="@",e.BRACKET_L="[",e.BRACKET_R="]",e.BRACE_L="{",e.PIPE="|",e.BRACE_R="}",e.NAME="Name",e.INT="Int",e.FLOAT="Float",e.STRING="String",e.BLOCK_STRING="BlockString",e.COMMENT="Comment",e}(rt||{});class ole{constructor(t){const n=new hx(rt.SOF,0,0,0,0);this.source=t,this.lastToken=n,this.token=n,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let t=this.token;if(t.kind!==rt.EOF)do{if(t.next)t=t.next;else{const n=sle(this,t.end);t.next=n,n.prev=t,t=n}}while(t.kind===rt.COMMENT);return t}}function zd(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function R2(e,t){return iN(e.charCodeAt(t))&&sN(e.charCodeAt(t+1))}function iN(e){return e>=55296&&e<=56319}function sN(e){return e>=56320&&e<=57343}function su(e,t){const n=e.source.body.codePointAt(t);if(void 0===n)return rt.EOF;if(n>=32&&n<=126){const r=String.fromCodePoint(n);return'"'===r?"'\"'":`"${r}"`}return"U+"+n.toString(16).toUpperCase().padStart(4,"0")}function Io(e,t,n,r,o){return new hx(t,n,r,e.line,1+n-e.lineStart,o)}function sle(e,t){const n=e.source.body,r=n.length;let o=t;for(;o<r;){const i=n.charCodeAt(o);switch(i){case 65279:case 9:case 32:case 44:++o;continue;case 10:++o,++e.line,e.lineStart=o;continue;case 13:10===n.charCodeAt(o+1)?o+=2:++o,++e.line,e.lineStart=o;continue;case 35:return ale(e,o);case 33:return Io(e,rt.BANG,o,o+1);case 36:return Io(e,rt.DOLLAR,o,o+1);case 38:return Io(e,rt.AMP,o,o+1);case 40:return Io(e,rt.PAREN_L,o,o+1);case 41:return Io(e,rt.PAREN_R,o,o+1);case 46:if(46===n.charCodeAt(o+1)&&46===n.charCodeAt(o+2))return Io(e,rt.SPREAD,o,o+3);break;case 58:return Io(e,rt.COLON,o,o+1);case 61:return Io(e,rt.EQUALS,o,o+1);case 64:return Io(e,rt.AT,o,o+1);case 91:return Io(e,rt.BRACKET_L,o,o+1);case 93:return Io(e,rt.BRACKET_R,o,o+1);case 123:return Io(e,rt.BRACE_L,o,o+1);case 124:return Io(e,rt.PIPE,o,o+1);case 125:return Io(e,rt.BRACE_R,o,o+1);case 34:return 34===n.charCodeAt(o+1)&&34===n.charCodeAt(o+2)?hle(e,o):cle(e,o)}if(df(i)||45===i)return lle(e,o,i);if(Jx(i))return fle(e,o);throw ko(e.source,o,39===i?"Unexpected single quote character ('), did you mean to use a double quote (\")?":zd(i)||R2(n,o)?`Unexpected character: ${su(e,o)}.`:`Invalid character: ${su(e,o)}.`)}return Io(e,rt.EOF,r,r)}function ale(e,t){const n=e.source.body,r=n.length;let o=t+1;for(;o<r;){const i=n.charCodeAt(o);if(10===i||13===i)break;if(zd(i))++o;else{if(!R2(n,o))break;o+=2}}return Io(e,rt.COMMENT,t,o,n.slice(t+1,o))}function lle(e,t,n){const r=e.source.body;let o=t,i=n,s=!1;if(45===i&&(i=r.charCodeAt(++o)),48===i){if(i=r.charCodeAt(++o),df(i))throw ko(e.source,o,`Invalid number, unexpected digit after 0: ${su(e,o)}.`)}else o=J3(e,o,i),i=r.charCodeAt(o);if(46===i&&(s=!0,i=r.charCodeAt(++o),o=J3(e,o,i),i=r.charCodeAt(o)),(69===i||101===i)&&(s=!0,i=r.charCodeAt(++o),(43===i||45===i)&&(i=r.charCodeAt(++o)),o=J3(e,o,i),i=r.charCodeAt(o)),46===i||Jx(i))throw ko(e.source,o,`Invalid number, expected digit but got: ${su(e,o)}.`);return Io(e,s?rt.FLOAT:rt.INT,t,o,r.slice(t,o))}function J3(e,t,n){if(!df(n))throw ko(e.source,t,`Invalid number, expected digit but got: ${su(e,t)}.`);const r=e.source.body;let o=t+1;for(;df(r.charCodeAt(o));)++o;return o}function cle(e,t){const n=e.source.body,r=n.length;let o=t+1,i=o,s="";for(;o<r;){const a=n.charCodeAt(o);if(34===a)return s+=n.slice(i,o),Io(e,rt.STRING,t,o+1,s);if(92===a){s+=n.slice(i,o);const l=117===n.charCodeAt(o+1)?123===n.charCodeAt(o+2)?ule(e,o):dle(e,o):_le(e,o);s+=l.value,o+=l.size,i=o;continue}if(10===a||13===a)break;if(zd(a))++o;else{if(!R2(n,o))throw ko(e.source,o,`Invalid character within String: ${su(e,o)}.`);o+=2}}throw ko(e.source,o,"Unterminated string.")}function ule(e,t){const n=e.source.body;let r=0,o=3;for(;o<12;){const i=n.charCodeAt(t+o++);if(125===i){if(o<5||!zd(r))break;return{value:String.fromCodePoint(r),size:o}}if(r=r<<4|wf(i),r<0)break}throw ko(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+o)}".`)}function dle(e,t){const n=e.source.body,r=aN(n,t+2);if(zd(r))return{value:String.fromCodePoint(r),size:6};if(iN(r)&&92===n.charCodeAt(t+6)&&117===n.charCodeAt(t+7)){const o=aN(n,t+8);if(sN(o))return{value:String.fromCodePoint(r,o),size:12}}throw ko(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+6)}".`)}function aN(e,t){return wf(e.charCodeAt(t))<<12|wf(e.charCodeAt(t+1))<<8|wf(e.charCodeAt(t+2))<<4|wf(e.charCodeAt(t+3))}function wf(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function _le(e,t){const n=e.source.body;switch(n.charCodeAt(t+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:"\n",size:2};case 114:return{value:"\r",size:2};case 116:return{value:"\t",size:2}}throw ko(e.source,t,`Invalid character escape sequence: "${n.slice(t,t+2)}".`)}function hle(e,t){const n=e.source.body,r=n.length;let o=e.lineStart,i=t+3,s=i,a="";const l=[];for(;i<r;){const c=n.charCodeAt(i);if(34===c&&34===n.charCodeAt(i+1)&&34===n.charCodeAt(i+2)){a+=n.slice(s,i),l.push(a);const u=Io(e,rt.BLOCK_STRING,t,i+3,Ase(l).join("\n"));return e.line+=l.length-1,e.lineStart=o,u}if(92!==c||34!==n.charCodeAt(i+1)||34!==n.charCodeAt(i+2)||34!==n.charCodeAt(i+3))if(10!==c&&13!==c)if(zd(c))++i;else{if(!R2(n,i))throw ko(e.source,i,`Invalid character within String: ${su(e,i)}.`);i+=2}else a+=n.slice(s,i),l.push(a),13===c&&10===n.charCodeAt(i+1)?i+=2:++i,a="",s=i,o=i;else a+=n.slice(s,i),s=i+1,i+=4}throw ko(e.source,i,"Unterminated string.")}function fle(e,t){const n=e.source.body,r=n.length;let o=t+1;for(;o<r&&Ise(n.charCodeAt(o));)++o;return Io(e,rt.NAME,t,o,n.slice(t,o))}const ple=globalThis.process?function(t,n){return t instanceof n}:function(t,n){if(t instanceof n)return!0;if("object"==typeof t&&null!==t){var r;const o=n.prototype[Symbol.toStringTag];if(o===(Symbol.toStringTag in t?t[Symbol.toStringTag]:null===(r=t.constructor)||void 0===r?void 0:r.name)){const s=Z8(t);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 lN{constructor(t,n="GraphQL request",r={line:1,column:1}){"string"==typeof t||f2(!1,`Body must be a string. Received: ${Z8(t)}.`),this.body=t,this.name=n,this.locationOffset=r,this.locationOffset.line>0||f2(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||f2(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}class Df{constructor(t,n={}){const{lexer:r,...o}=n;if(r)this._lexer=r;else{const i=function gle(e){return ple(e,lN)}(t)?t:new lN(t);this._lexer=new ole(i)}this._options=o,this._tokenCounter=0}get tokenCount(){return this._tokenCounter}parseName(){const t=this.expectToken(rt.NAME);return this.node(t,{kind:Dt.NAME,value:t.value})}parseDocument(){return this.node(this._lexer.token,{kind:Dt.DOCUMENT,definitions:this.many(rt.SOF,this.parseDefinition,rt.EOF)})}parseDefinition(){if(this.peek(rt.BRACE_L))return this.parseOperationDefinition();const t=this.peekDescription(),n=t?this._lexer.lookahead():this._lexer.token;if(t&&n.kind===rt.BRACE_L)throw ko(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are not supported on shorthand queries.");if(n.kind===rt.NAME){switch(n.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(n.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition()}if(t)throw ko(this._lexer.source,this._lexer.token.start,"Unexpected description, only GraphQL definitions support descriptions.");if("extend"===n.value)return this.parseTypeSystemExtension()}throw this.unexpected(n)}parseOperationDefinition(){const t=this._lexer.token;if(this.peek(rt.BRACE_L))return this.node(t,{kind:Dt.OPERATION_DEFINITION,operation:oa.QUERY,description:void 0,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});const n=this.parseDescription(),r=this.parseOperationType();let o;return this.peek(rt.NAME)&&(o=this.parseName()),this.node(t,{kind:Dt.OPERATION_DEFINITION,operation:r,description:n,name:o,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const t=this.expectToken(rt.NAME);switch(t.value){case"query":return oa.QUERY;case"mutation":return oa.MUTATION;case"subscription":return oa.SUBSCRIPTION}throw this.unexpected(t)}parseVariableDefinitions(){return this.optionalMany(rt.PAREN_L,this.parseVariableDefinition,rt.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:Dt.VARIABLE_DEFINITION,description:this.parseDescription(),variable:this.parseVariable(),type:(this.expectToken(rt.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(rt.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const t=this._lexer.token;return this.expectToken(rt.DOLLAR),this.node(t,{kind:Dt.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:Dt.SELECTION_SET,selections:this.many(rt.BRACE_L,this.parseSelection,rt.BRACE_R)})}parseSelection(){return this.peek(rt.SPREAD)?this.parseFragment():this.parseField()}parseField(){const t=this._lexer.token,n=this.parseName();let r,o;return this.expectOptionalToken(rt.COLON)?(r=n,o=this.parseName()):o=n,this.node(t,{kind:Dt.FIELD,alias:r,name:o,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(rt.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(t){return this.optionalMany(rt.PAREN_L,t?this.parseConstArgument:this.parseArgument,rt.PAREN_R)}parseArgument(t=!1){const n=this._lexer.token,r=this.parseName();return this.expectToken(rt.COLON),this.node(n,{kind:Dt.ARGUMENT,name:r,value:this.parseValueLiteral(t)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){const t=this._lexer.token;this.expectToken(rt.SPREAD);const n=this.expectOptionalKeyword("on");return!n&&this.peek(rt.NAME)?this.node(t,{kind:Dt.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(t,{kind:Dt.INLINE_FRAGMENT,typeCondition:n?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){const t=this._lexer.token,n=this.parseDescription();return this.expectKeyword("fragment"),this.node(t,!0===this._options.allowLegacyFragmentVariables?{kind:Dt.FRAGMENT_DEFINITION,description:n,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}:{kind:Dt.FRAGMENT_DEFINITION,description:n,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(t){const n=this._lexer.token;switch(n.kind){case rt.BRACKET_L:return this.parseList(t);case rt.BRACE_L:return this.parseObject(t);case rt.INT:return this.advanceLexer(),this.node(n,{kind:Dt.INT,value:n.value});case rt.FLOAT:return this.advanceLexer(),this.node(n,{kind:Dt.FLOAT,value:n.value});case rt.STRING:case rt.BLOCK_STRING:return this.parseStringLiteral();case rt.NAME:switch(this.advanceLexer(),n.value){case"true":return this.node(n,{kind:Dt.BOOLEAN,value:!0});case"false":return this.node(n,{kind:Dt.BOOLEAN,value:!1});case"null":return this.node(n,{kind:Dt.NULL});default:return this.node(n,{kind:Dt.ENUM,value:n.value})}case rt.DOLLAR:if(t){if(this.expectToken(rt.DOLLAR),this._lexer.token.kind===rt.NAME)throw ko(this._lexer.source,n.start,`Unexpected variable "$${this._lexer.token.value}" in constant value.`);throw this.unexpected(n)}return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){const t=this._lexer.token;return this.advanceLexer(),this.node(t,{kind:Dt.STRING,value:t.value,block:t.kind===rt.BLOCK_STRING})}parseList(t){return this.node(this._lexer.token,{kind:Dt.LIST,values:this.any(rt.BRACKET_L,()=>this.parseValueLiteral(t),rt.BRACKET_R)})}parseObject(t){return this.node(this._lexer.token,{kind:Dt.OBJECT,fields:this.any(rt.BRACE_L,()=>this.parseObjectField(t),rt.BRACE_R)})}parseObjectField(t){const n=this._lexer.token,r=this.parseName();return this.expectToken(rt.COLON),this.node(n,{kind:Dt.OBJECT_FIELD,name:r,value:this.parseValueLiteral(t)})}parseDirectives(t){const n=[];for(;this.peek(rt.AT);)n.push(this.parseDirective(t));return n}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(t){const n=this._lexer.token;return this.expectToken(rt.AT),this.node(n,{kind:Dt.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(t)})}parseTypeReference(){const t=this._lexer.token;let n;if(this.expectOptionalToken(rt.BRACKET_L)){const r=this.parseTypeReference();this.expectToken(rt.BRACKET_R),n=this.node(t,{kind:Dt.LIST_TYPE,type:r})}else n=this.parseNamedType();return this.expectOptionalToken(rt.BANG)?this.node(t,{kind:Dt.NON_NULL_TYPE,type:n}):n}parseNamedType(){return this.node(this._lexer.token,{kind:Dt.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(rt.STRING)||this.peek(rt.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("schema");const r=this.parseConstDirectives(),o=this.many(rt.BRACE_L,this.parseOperationTypeDefinition,rt.BRACE_R);return this.node(t,{kind:Dt.SCHEMA_DEFINITION,description:n,directives:r,operationTypes:o})}parseOperationTypeDefinition(){const t=this._lexer.token,n=this.parseOperationType();this.expectToken(rt.COLON);const r=this.parseNamedType();return this.node(t,{kind:Dt.OPERATION_TYPE_DEFINITION,operation:n,type:r})}parseScalarTypeDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("scalar");const r=this.parseName(),o=this.parseConstDirectives();return this.node(t,{kind:Dt.SCALAR_TYPE_DEFINITION,description:n,name:r,directives:o})}parseObjectTypeDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("type");const r=this.parseName(),o=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),s=this.parseFieldsDefinition();return this.node(t,{kind:Dt.OBJECT_TYPE_DEFINITION,description:n,name:r,interfaces:o,directives:i,fields:s})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(rt.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(rt.BRACE_L,this.parseFieldDefinition,rt.BRACE_R)}parseFieldDefinition(){const t=this._lexer.token,n=this.parseDescription(),r=this.parseName(),o=this.parseArgumentDefs();this.expectToken(rt.COLON);const i=this.parseTypeReference(),s=this.parseConstDirectives();return this.node(t,{kind:Dt.FIELD_DEFINITION,description:n,name:r,arguments:o,type:i,directives:s})}parseArgumentDefs(){return this.optionalMany(rt.PAREN_L,this.parseInputValueDef,rt.PAREN_R)}parseInputValueDef(){const t=this._lexer.token,n=this.parseDescription(),r=this.parseName();this.expectToken(rt.COLON);const o=this.parseTypeReference();let i;this.expectOptionalToken(rt.EQUALS)&&(i=this.parseConstValueLiteral());const s=this.parseConstDirectives();return this.node(t,{kind:Dt.INPUT_VALUE_DEFINITION,description:n,name:r,type:o,defaultValue:i,directives:s})}parseInterfaceTypeDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("interface");const r=this.parseName(),o=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),s=this.parseFieldsDefinition();return this.node(t,{kind:Dt.INTERFACE_TYPE_DEFINITION,description:n,name:r,interfaces:o,directives:i,fields:s})}parseUnionTypeDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("union");const r=this.parseName(),o=this.parseConstDirectives(),i=this.parseUnionMemberTypes();return this.node(t,{kind:Dt.UNION_TYPE_DEFINITION,description:n,name:r,directives:o,types:i})}parseUnionMemberTypes(){return this.expectOptionalToken(rt.EQUALS)?this.delimitedMany(rt.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("enum");const r=this.parseName(),o=this.parseConstDirectives(),i=this.parseEnumValuesDefinition();return this.node(t,{kind:Dt.ENUM_TYPE_DEFINITION,description:n,name:r,directives:o,values:i})}parseEnumValuesDefinition(){return this.optionalMany(rt.BRACE_L,this.parseEnumValueDefinition,rt.BRACE_R)}parseEnumValueDefinition(){const t=this._lexer.token,n=this.parseDescription(),r=this.parseEnumValueName(),o=this.parseConstDirectives();return this.node(t,{kind:Dt.ENUM_VALUE_DEFINITION,description:n,name:r,directives:o})}parseEnumValueName(){if("true"===this._lexer.token.value||"false"===this._lexer.token.value||"null"===this._lexer.token.value)throw ko(this._lexer.source,this._lexer.token.start,`${O2(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("input");const r=this.parseName(),o=this.parseConstDirectives(),i=this.parseInputFieldsDefinition();return this.node(t,{kind:Dt.INPUT_OBJECT_TYPE_DEFINITION,description:n,name:r,directives:o,fields:i})}parseInputFieldsDefinition(){return this.optionalMany(rt.BRACE_L,this.parseInputValueDef,rt.BRACE_R)}parseTypeSystemExtension(){const t=this._lexer.lookahead();if(t.kind===rt.NAME)switch(t.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(t)}parseSchemaExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");const n=this.parseConstDirectives(),r=this.optionalMany(rt.BRACE_L,this.parseOperationTypeDefinition,rt.BRACE_R);if(0===n.length&&0===r.length)throw this.unexpected();return this.node(t,{kind:Dt.SCHEMA_EXTENSION,directives:n,operationTypes:r})}parseScalarTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");const n=this.parseName(),r=this.parseConstDirectives();if(0===r.length)throw this.unexpected();return this.node(t,{kind:Dt.SCALAR_TYPE_EXTENSION,name:n,directives:r})}parseObjectTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");const n=this.parseName(),r=this.parseImplementsInterfaces(),o=this.parseConstDirectives(),i=this.parseFieldsDefinition();if(0===r.length&&0===o.length&&0===i.length)throw this.unexpected();return this.node(t,{kind:Dt.OBJECT_TYPE_EXTENSION,name:n,interfaces:r,directives:o,fields:i})}parseInterfaceTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const n=this.parseName(),r=this.parseImplementsInterfaces(),o=this.parseConstDirectives(),i=this.parseFieldsDefinition();if(0===r.length&&0===o.length&&0===i.length)throw this.unexpected();return this.node(t,{kind:Dt.INTERFACE_TYPE_EXTENSION,name:n,interfaces:r,directives:o,fields:i})}parseUnionTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const n=this.parseName(),r=this.parseConstDirectives(),o=this.parseUnionMemberTypes();if(0===r.length&&0===o.length)throw this.unexpected();return this.node(t,{kind:Dt.UNION_TYPE_EXTENSION,name:n,directives:r,types:o})}parseEnumTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const n=this.parseName(),r=this.parseConstDirectives(),o=this.parseEnumValuesDefinition();if(0===r.length&&0===o.length)throw this.unexpected();return this.node(t,{kind:Dt.ENUM_TYPE_EXTENSION,name:n,directives:r,values:o})}parseInputObjectTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const n=this.parseName(),r=this.parseConstDirectives(),o=this.parseInputFieldsDefinition();if(0===r.length&&0===o.length)throw this.unexpected();return this.node(t,{kind:Dt.INPUT_OBJECT_TYPE_EXTENSION,name:n,directives:r,fields:o})}parseDirectiveDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("directive"),this.expectToken(rt.AT);const r=this.parseName(),o=this.parseArgumentDefs(),i=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const s=this.parseDirectiveLocations();return this.node(t,{kind:Dt.DIRECTIVE_DEFINITION,description:n,name:r,arguments:o,repeatable:i,locations:s})}parseDirectiveLocations(){return this.delimitedMany(rt.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){const t=this._lexer.token,n=this.parseName();if(Object.prototype.hasOwnProperty.call(oN,n.value))return n;throw this.unexpected(t)}parseSchemaCoordinate(){const t=this._lexer.token,n=this.expectOptionalToken(rt.AT),r=this.parseName();let o,i;return!n&&this.expectOptionalToken(rt.DOT)&&(o=this.parseName()),(n||o)&&this.expectOptionalToken(rt.PAREN_L)&&(i=this.parseName(),this.expectToken(rt.COLON),this.expectToken(rt.PAREN_R)),this.node(t,n?i?{kind:Dt.DIRECTIVE_ARGUMENT_COORDINATE,name:r,argumentName:i}:{kind:Dt.DIRECTIVE_COORDINATE,name:r}:o?i?{kind:Dt.ARGUMENT_COORDINATE,name:r,fieldName:o,argumentName:i}:{kind:Dt.MEMBER_COORDINATE,name:r,memberName:o}:{kind:Dt.TYPE_COORDINATE,name:r})}node(t,n){return!0!==this._options.noLocation&&(n.loc=new Fie(t,this._lexer.lastToken,this._lexer.source)),n}peek(t){return this._lexer.token.kind===t}expectToken(t){const n=this._lexer.token;if(n.kind===t)return this.advanceLexer(),n;throw ko(this._lexer.source,n.start,`Expected ${cN(t)}, found ${O2(n)}.`)}expectOptionalToken(t){return this._lexer.token.kind===t&&(this.advanceLexer(),!0)}expectKeyword(t){const n=this._lexer.token;if(n.kind!==rt.NAME||n.value!==t)throw ko(this._lexer.source,n.start,`Expected "${t}", found ${O2(n)}.`);this.advanceLexer()}expectOptionalKeyword(t){const n=this._lexer.token;return n.kind===rt.NAME&&n.value===t&&(this.advanceLexer(),!0)}unexpected(t){const n=t??this._lexer.token;return ko(this._lexer.source,n.start,`Unexpected ${O2(n)}.`)}any(t,n,r){this.expectToken(t);const o=[];for(;!this.expectOptionalToken(r);)o.push(n.call(this));return o}optionalMany(t,n,r){if(this.expectOptionalToken(t)){const o=[];do{o.push(n.call(this))}while(!this.expectOptionalToken(r));return o}return[]}many(t,n,r){this.expectToken(t);const o=[];do{o.push(n.call(this))}while(!this.expectOptionalToken(r));return o}delimitedMany(t,n){this.expectOptionalToken(t);const r=[];do{r.push(n.call(this))}while(this.expectOptionalToken(t));return r}advanceLexer(){const{maxTokens:t}=this._options,n=this._lexer.advance();if(n.kind!==rt.EOF&&(++this._tokenCounter,void 0!==t&&this._tokenCounter>t))throw ko(this._lexer.source,n.start,`Document contains more that ${t} tokens. Parsing aborted.`)}}function O2(e){const t=e.value;return cN(e.kind)+(null!=t?` "${t}"`:"")}function cN(e){return function ile(e){return e===rt.BANG||e===rt.DOLLAR||e===rt.AMP||e===rt.PAREN_L||e===rt.PAREN_R||e===rt.DOT||e===rt.SPREAD||e===rt.COLON||e===rt.EQUALS||e===rt.AT||e===rt.BRACKET_L||e===rt.BRACKET_R||e===rt.BRACE_L||e===rt.PIPE||e===rt.BRACE_R}(e)?`"${e}"`:e}var P2=new Map,e4=new Map,uN=!0,B2=!1;function dN(e){return e.replace(/[\s,]+/g," ").trim()}function Ile(e){var t=dN(e);if(!P2.has(t)){var n=function yle(e,t){const n=new Df(e,t),r=n.parseDocument();return Object.defineProperty(r,"tokenCount",{enumerable:!1,value:n.tokenCount}),r}(e,{experimentalFragmentVariables:B2,allowLegacyFragmentVariables:B2});if(!n||"Document"!==n.kind)throw new Error("Not a valid GraphQL document.");P2.set(t,function Ele(e){var t=new Set(e.definitions);t.forEach(function(r){r.loc&&delete r.loc,Object.keys(r).forEach(function(o){var i=r[o];i&&"object"==typeof i&&t.add(i)})});var n=e.loc;return n&&(delete n.startToken,delete n.endToken),e}(function Tle(e){var t=new Set,n=[];return e.definitions.forEach(function(r){if("FragmentDefinition"===r.kind){var o=r.name.value,i=function ble(e){return dN(e.source.body.substring(e.start,e.end))}(r.loc),s=e4.get(o);s&&!s.has(i)?uN&&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||e4.set(o,s=new Set),s.add(i),t.has(i)||(t.add(i),n.push(r))}else n.push(r)}),Nh(Nh({},e),{definitions:n})}(n)))}return P2.get(t)}function jd(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];"string"==typeof e&&(e=[e]);var r=e[0];return t.forEach(function(o,i){r+=o&&"Document"===o.kind?o.loc.source.body:o,r+=e[i+1]}),Ile(r)}var Lf_gql=jd,Lf_resetCaches=function Ale(){P2.clear(),e4.clear()},Lf_disableFragmentWarnings=function Sle(){uN=!1},Lf_enableExperimentalFragmentVariables=function wle(){B2=!0},Lf_disableExperimentalFragmentVariables=function Dle(){B2=!1};(function(e){e.gql=Lf_gql,e.resetCaches=Lf_resetCaches,e.disableFragmentWarnings=Lf_disableFragmentWarnings,e.enableExperimentalFragmentVariables=Lf_enableExperimentalFragmentVariables,e.disableExperimentalFragmentVariables=Lf_disableExperimentalFragmentVariables})(jd||(jd={})),jd.default=jd;const Mle=new class xle extends tM{}(class Lle extends eM{constructor(t,n){super(t,n),this.scheduler=t,this.work=n}schedule(t,n=0){return n>0?super.schedule(t,n):(this.delay=n,this.state=t,this.scheduler.flush(this),this)}execute(t,n){return n>0||this.closed?super.execute(t,n):this._execute(t,n)}requestAsyncId(t,n,r=0){return null!=r&&r>0||null==r&&this.delay>0?super.requestAsyncId(t,n,r):(t.flush(this),0)}});function hN(e){return new Lt(t=>(e().then(n=>{t.closed||(t.next(n),t.complete())},n=>{t.closed||t.error(n)}),()=>t.unsubscribe()))}class Rle{zone;constructor(t){this.zone=t}now=Date.now;schedule(t,n=0,r){return this.zone.run(()=>Mle.schedule(t,n,r))}}function t4(e,t){return e.pipe(x7(new Rle(t)))}class Ole{obsQuery;valueChanges;constructor(t,n){this.obsQuery=t,this.valueChanges=t4(Ks(this.obsQuery),n)}get options(){return this.obsQuery.options}get variables(){return this.obsQuery.variables}getCurrentResult(){return this.obsQuery.getCurrentResult()}refetch(t){return this.obsQuery.refetch(t)}fetchMore(t){return this.obsQuery.fetchMore(t)}subscribeToMore(t){return this.obsQuery.subscribeToMore(t)}updateQuery(t){return this.obsQuery.updateQuery(t)}stopPolling(){return this.obsQuery.stopPolling()}startPolling(t){return this.obsQuery.startPolling(t)}setVariables(t){return this.obsQuery.setVariables(t)}reobserve(t){return this.obsQuery.reobserve(t)}}const n4=new _t("APOLLO_FLAGS"),fN=new _t("APOLLO_OPTIONS"),pN=new _t("APOLLO_NAMED_OPTIONS");class gN{ngZone;flags;_client;useMutationLoading;constructor(t,n,r){this.ngZone=t,this.flags=n,this._client=r,this.useMutationLoading=n?.useMutationLoading??!1}watchQuery(t){return new Ole(this.ensureClient().watchQuery({...t}),this.ngZone)}query(t){return hN(()=>this.ensureClient().query({...t}))}mutate(t){return function kle(e,t){return t?e.pipe(dr(n=>({...n,loading:!1})),function Nle(...e){const t=I0(e);return Ni((n,r)=>{(t?Tf(e,n,t):Tf(e,n)).subscribe(r)})}({data:void 0,loading:!0})):e.pipe(dr(n=>({...n,loading:!1})))}(hN(()=>this.ensureClient().mutate({...t})),t.useMutationLoading??this.useMutationLoading)}watchFragment(t){const{useZone:n,...r}=t,o=this.ensureClient().watchFragment({...r});return!0!==n?o:t4(o,this.ngZone)}subscribe(t){const{useZone:n,...r}=t,o=this.ensureClient().subscribe({...r});return!0!==n?o:t4(o,this.ngZone)}get client(){return this.ensureClient()}set client(t){if(this._client)throw new Error("Client has been already defined");this._client=t}ensureClient(){return this.checkInstance(),this._client}checkInstance(){if(this._client)return!0;throw new Error("Client has not been defined yet")}}let r4=(()=>{class e extends gN{map=new Map;constructor(n,r,o,i){if(super(n,i),r&&this.createDefault(r),o&&"object"==typeof o)for(let s in o)o.hasOwnProperty(s)&&this.create(o[s],s)}create(n,r){o4(r)?this.createNamed(r,n):this.createDefault(n)}default(){return this}use(n){return o4(n)?this.map.get(n):this.default()}createDefault(n){if(this._client)throw new Error("Apollo has been already created.");this.client=this.ngZone.runOutsideAngular(()=>new K3(n))}createNamed(n,r){if(this.map.has(n))throw new Error(`Client ${n} has been already created`);this.map.set(n,new gN(this.ngZone,this.flags,this.ngZone.runOutsideAngular(()=>new K3(r))))}removeClient(n){o4(n)?this.map.delete(n):this._client=void 0}static \u0275fac=function(r){return new(r||e)(jt(pr),jt(fN,8),jt(pN,8),jt(n4,8))};static \u0275prov=Te({token:e,factory:e.\u0275fac})}return e})();function o4(e){return!!e&&"default"!==e}const i4=jd,F2=(e,t)=>e&&t?[...e.keys()].reduce((n,r)=>n.set(r,e.get(r)),t):t||e;const s4={batchInterval:10,batchMax:10,uri:"graphql",method:"POST",withCredentials:!1,includeQuery:!0,includeExtensions:!1,useMultipart:!1};function Ga(e,t,n){return function H2(...e){return e.find(t=>typeof t<"u")}(e[n],t[n],s4[n])}class Fle extends ui{httpClient;options;requester;print=b2;constructor(t,n){super(),this.httpClient=t,this.options=n,this.options.operationPrinter&&(this.print=this.options.operationPrinter),this.requester=r=>new Lt(o=>{const i=r.getContext();let s=Ga(i,this.options,"method");const a=Ga(i,this.options,"includeQuery"),l=Ga(i,this.options,"includeExtensions"),c=Ga(i,this.options,"uri"),u=Ga(i,this.options,"withCredentials"),d=Ga(i,this.options,"useMultipart"),f=!0===this.options.useGETForQueries,y=F2(i.httpContext,F2(this.options.httpContext,new c8)),R=r.query.definitions.some(_e=>"OperationDefinition"===_e.kind&&"query"===_e.operation);f&&R&&(s="GET");const Z={method:s,url:"function"==typeof c?c(r):c,body:{operationName:r.operationName,variables:r.variables},options:{withCredentials:u,useMultipart:d,headers:this.options.headers,context:y}};l&&(Z.body.extensions=r.extensions),a&&(Z.body.query=this.print(r.query));const X=function CN(e){let t=e.headers&&e.headers instanceof ci?e.headers:new ci(e.headers);if(e.clientAwareness){const{name:n,version:r}=e.clientAwareness;n&&!t.has("apollographql-client-name")&&(t=t.set("apollographql-client-name",n)),r&&!t.has("apollographql-client-version")&&(t=t.set("apollographql-client-version",r))}return t}(i);Z.options.headers=((e,t)=>e&&t?t.keys().reduce((r,o)=>r.set(o,t.getAll(o)),e):t||e)(Z.options.headers,X);const ae=((e,t,n)=>{const r=-1!==["POST","PUT","PATCH"].indexOf(e.method.toUpperCase()),i=e.body.length;let a,s=e.options&&e.options.useMultipart;if(s){if(i)return new Lt(c=>c.error(new Error("File upload is not available when combined with Batching")));if(!r)return new Lt(c=>c.error(new Error("File upload is not available when GET is used")));if(!n)return new Lt(c=>c.error(new Error('To use File upload you need to pass "extractFiles" function from "extract-files" library to HttpLink\'s options')));a=n(e.body),s=!!a.files.size}let l={};if(i){if(!r)return new Lt(c=>c.error(new Error("Batching is not available for GET requests")));l={body:e.body}}else l=r?{body:s?a.clone:e.body}:{params:Object.keys(e.body).reduce((d,f)=>{const y=e.body[f];return d[f]=-1!==["variables","extensions"].indexOf(f.toLowerCase())?JSON.stringify(y):y,d},{})};if(s&&r){const c=new FormData;c.append("operations",JSON.stringify(l.body));const u={},d=a.files;let f=0;d.forEach(y=>{u[++f]=y}),c.append("map",JSON.stringify(u)),f=0,d.forEach((y,R)=>{c.append(++f+"",R,R.name)}),l.body=c}return t.request(e.method,e.url,{observe:"response",responseType:"json",reportProgress:!1,...l,...e.options})})(Z,this.httpClient,this.options.extractFiles).subscribe({next:_e=>{r.setContext({response:_e}),o.next(_e.body)},error:_e=>o.error(_e),complete:()=>o.complete()});return()=>{ae.closed||ae.unsubscribe()}})}request(t){return this.requester(t)}}let Hle=(()=>{class e{httpClient;constructor(n){this.httpClient=n}create(n){return new Fle(this.httpClient,n)}static \u0275fac=function(r){return new(r||e)(jt(Hl))};static \u0275prov=Te({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();function yN(e,t){this.v=e,this.k=t}function a4(e){return new yN(e,0)}function l4(e){return function(){return new xf(e.apply(this,arguments))}}function xf(e){var t,n;function r(i,s){try{var a=e[i](s),l=a.value,c=l instanceof yN;Promise.resolve(c?l.v:l).then(function(u){if(c){var d="return"===i?"return":"next";if(!l.k||u.done)return r(d,u);u=e[d](u).value}o(a.done?"return":"normal",u)},function(u){r("throw",u)})}catch(u){o("throw",u)}}function o(i,s){switch(i){case"return":t.resolve({value:s,done:!0});break;case"throw":t.reject(s);break;default:t.resolve({value:s,done:!1})}(t=t.next)?r(t.key,t.arg):n=null}this._invoke=function(i,s){return new Promise(function(a,l){var c={key:i,arg:s,resolve:a,reject:l,next:null};n?n=n.next=c:(t=n=c,r(i,s))})},"function"!=typeof e.return&&(this.return=void 0)}function c4(e){var t,n,r,o=2;for(typeof Symbol<"u"&&(n=Symbol.asyncIterator,r=Symbol.iterator);o--;){if(n&&null!=(t=e[n]))return t.call(e);if(r&&null!=(t=e[r]))return new U2(t.call(e));n="@@asyncIterator",r="@@iterator"}throw new TypeError("Object is not async iterable")}function U2(e){function t(n){if(Object(n)!==n)return Promise.reject(new TypeError(n+" is not an object."));var r=n.done;return Promise.resolve(n.value).then(function(o){return{value:o,done:r}})}return(U2=function(r){this.s=r,this.n=r.next}).prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(r){var o=this.s.return;return void 0===o?Promise.resolve({value:r,done:!0}):t(o.apply(this.s,arguments))},throw:function(r){var o=this.s.return;return void 0===o?Promise.reject(r):t(o.apply(this.s,arguments))}},new U2(e)}function zle(e){if("next"!==e&&"complete"!==e)throw new Error(`Invalid stream event "${e}"`);return e}function jle(e,t){if(t)try{t=JSON.parse(t)}catch{throw new Error("Invalid stream data")}if("next"===e&&!t)throw new Error('Stream data must be an object for "next" events');return t||null}xf.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},xf.prototype.next=function(e){return this._invoke("next",e)},xf.prototype.throw=function(e){return this._invoke("throw",e)},xf.prototype.return=function(e){return this._invoke("return",e)};var Gd=function(e){return e[e.NewLine=10]="NewLine",e[e.CarriageReturn=13]="CarriageReturn",e[e.Space=32]="Space",e[e.Colon=58]="Colon",e}(Gd||{});class gs extends Error{constructor(t){let n,r;!function Zle(e){return function $le(e){return"object"==typeof e&&null!==e}(e)&&"boolean"==typeof e.ok&&"number"==typeof e.status&&"string"==typeof e.statusText}(t)?n=t instanceof Error?t.message:String(t):(r=t,n="Server responded with "+t.status+": "+t.statusText),super(n),this.name=this.constructor.name,this.response=r}}function bN(e){return u4.apply(this,arguments)}function u4(){return u4=(0,K.A)(function*(e){const{signal:t,url:n,credentials:r,headers:o,body:i,referrer:s,referrerPolicy:a,fetchFn:l,onMessage:c}=e,u={},d={};let f;try{f=yield l(n,{signal:t,method:i?"POST":"GET",credentials:r,referrer:s,referrerPolicy:a,headers:{...o,accept:"text/event-stream"},body:i})}catch(Z){throw new gs(Z)}if(!f.ok)throw new gs(f);if(!f.body)throw new Error("Missing response body");let R,y=null;return(0,K.A)(function*(){var Z;try{const mt=function Gle(){let e,t,n,r=!1,o={event:"",data:""},i=[];const s=new TextDecoder;return function(l){if(void 0===e)e=l,t=0,n=-1;else{const d=new Uint8Array(e.length+l.length);d.set(e),d.set(l,e.length),e=d}const c=e.length;let u=0;for(;t<c;){r&&(e[t]===Gd.NewLine&&(u=++t),r=!1);let d=-1;for(;t<c&&-1===d;++t)switch(e[t]){case Gd.Colon:-1===n&&(n=t-u);break;case Gd.CarriageReturn:r=!0;case Gd.NewLine:d=t}if(-1===d)break;if(u===d){if(o.event||o.data){if(!o.event)throw new Error("Missing message event");const f=zle(o.event),y=jle(f,o.data);i.push({event:f,data:y}),o={event:"",data:""}}}else if(n>0){const f=e.subarray(u,d),y=s.decode(f.subarray(0,n)),Z=s.decode(f.subarray(n+(f[n+1]===Gd.Space?2:1)));switch(y){case"event":o.event=Z;break;case"data":o.data=o.data?o.data+"\n"+Z:Z}}u=t,n=-1}if(u===c){e=void 0;const d=[...i];return i=[],d}0!==u&&(e=e.subarray(u),t-=u)}}();var _e,X=!1,ae=!1;try{for(var ot,Ye=c4(function qle(e){return"function"==typeof Object(e)[Symbol.asyncIterator]?e:l4(function*(){const t=e.getReader();let n;do{n=yield a4(t.read()),void 0!==n.value&&(yield n.value)}while(!n.done)})()}(f.body));X=!(ot=yield Ye.next()).done;X=!1){const Xt=ot.value;{if("string"==typeof Xt)throw y=new Error(`Unexpected string chunk "${Xt}"`);let Tn;try{Tn=mt(Xt)}catch(nn){throw y=nn}if(!Tn)continue;for(const nn of Tn){try{c?.(nn)}catch(Dn){throw y=Dn}const Vn=nn.data&&"id"in nn.data?nn.data.id:"";switch(Vn in d||(d[Vn]=[]),nn.event){case"next":d[Vn].push(Vn?nn.data.payload:nn.data);break;case"complete":d[Vn].push("complete");break;default:throw y=new Error(`Unexpected message event "${nn.event}"`)}null===(Z=u[Vn])||void 0===Z||Z.proceed()}}}}catch(Xt){ae=!0,_e=Xt}finally{try{X&&null!=Ye.return&&(yield Ye.return())}finally{if(ae)throw _e}}if(Object.keys(u).length)throw new Error("Connection closed while having active streams")}catch(mt){y=!y&&Object.keys(u).length?new gs(mt):mt,R?.(y)}finally{Object.values(u).forEach(({proceed:mt})=>mt())}})(),{url:n,headers:o,waitForThrow:()=>new Promise((Z,X)=>{if(y)return X(y);R=X}),getResults:Z=>l4(function*(){var X;const{signal:ae,operationId:_e=""}=Z??{};try{for(;;){for(;null!==(X=d[_e])&&void 0!==X&&X.length;){const Ye=d[_e].shift();if("complete"===Ye)return;yield Ye}if(y)throw y;if(ae?.aborted)throw new Error("Getting results aborted by the client");yield a4(new Promise(Ye=>{const ot=()=>{ae?.removeEventListener("abort",ot),delete u[_e],Ye()};ae?.addEventListener("abort",ot),u[_e]={proceed:ot}}))}}finally{delete d[_e]}})()}}),u4.apply(this,arguments)}class Yle extends ui{constructor(t){super(),this.client=function Wle(e){const{singleConnection:t=!1,lazy:n=!0,lazyCloseTimeout:r=0,onNonLazyError:o=console.error,generateID:i=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,Vn=>{const Dn=16*Math.random()|0;return("x"==Vn?Dn:3&Dn|8).toString(16)})},retryAttempts:s=5,retry:a=function(){var nn=(0,K.A)(function*(Dn){let Xn=1e3;for(let Ei=0;Ei<Dn;Ei++)Xn*=2;yield new Promise(Ei=>setTimeout(Ei,Xn+Math.floor(2700*Math.random()+300)))});return function Vn(Dn){return nn.apply(this,arguments)}}(),credentials:l="same-origin",referrer:c,referrerPolicy:u,onMessage:d,on:f}=e,y=e.fetchFn||fetch,R=e.abortControllerImpl||AbortController,Z=(()=>{let nn=!1;const Vn=[];return{get disposed(){return nn},onDispose:Dn=>nn?(setTimeout(()=>Dn(),0),()=>{}):(Vn.push(Dn),()=>{Vn.splice(Vn.indexOf(Dn),1)}),dispose(){if(!nn){nn=!0;for(const Dn of[...Vn])Dn()}}}})();let X,ae,_e=0,Ye=null,ot=0;function mt(){return Xt.apply(this,arguments)}function Xt(){return(Xt=(0,K.A)(function*(){try{if(Z.disposed)throw new Error("Client has been disposed");return yield ae??(ae=(0,K.A)(function*(){var nn,Vn,Dn;if(Ye){if(yield a(ot),X.signal.aborted)throw new Error("Connection aborted by the client");ot++}null===(nn=f?.connecting)||void 0===nn||nn.call(f,!!Ye),X=new R;const Xn=Z.onDispose(()=>X.abort());X.signal.addEventListener("abort",()=>{Xn(),ae=void 0});const Ei=e,mo="function"==typeof Ei.url?yield Ei.url(void 0):Ei.url;if(X.signal.aborted)throw new Error("Connection aborted by the client");const Do="function"==typeof Ei.headers?yield Ei.headers(void 0):null!==(Vn=Ei.headers)&&void 0!==Vn?Vn:{};if(X.signal.aborted)throw new Error("Connection aborted by the client");let Ro;try{Ro=yield y(mo,{signal:X.signal,method:"PUT",credentials:l,referrer:c,referrerPolicy:u,headers:Do})}catch(vs){throw new gs(vs)}if(201!==Ro.status)throw new gs(Ro);const da=yield Ro.text();Do["x-graphql-event-stream-token"]=da;const Ya=yield bN({signal:X.signal,headers:Do,credentials:l,referrer:c,referrerPolicy:u,url:mo,fetchFn:y,onMessage:vs=>{var _a;null===(_a=f?.message)||void 0===_a||_a.call(f,vs),d?.(vs)}});return null===(Dn=f?.connected)||void 0===Dn||Dn.call(f,!!Ye),Ya.waitForThrow().catch(()=>ae=void 0),Ya})())}catch(nn){throw ae=void 0,nn}})).apply(this,arguments)}function Tn(nn,Vn,Dn){if(!t){const mo=new R,Do=Z.onDispose(()=>{Do(),mo.abort()});return(0,K.A)(function*(){var Ro,da,Ya,vs,_a;let Ii=null,du=0;for(;;)try{if(Ii){if(yield a(du),mo.signal.aborted)throw new Error("Connection aborted by the client");du++}null===(Ro=f?.connecting)||void 0===Ro||Ro.call(f,!!Ii),null===(da=Dn?.connecting)||void 0===da||da.call(Dn,!!Ii);const os=e,u1e="function"==typeof os.url?yield os.url(nn):os.url;if(mo.signal.aborted)throw new Error("Connection aborted by the client");const d1e="function"==typeof os.headers?yield os.headers(nn):null!==(Ya=os.headers)&&void 0!==Ya?Ya:{};if(mo.signal.aborted)throw new Error("Connection aborted by the client");const{getResults:_1e}=yield bN({signal:mo.signal,headers:{...d1e,"content-type":"application/json; charset=utf-8"},credentials:l,referrer:c,referrerPolicy:u,url:u1e,body:JSON.stringify(nn),fetchFn:y,onMessage:hu=>{var B4,F4;null===(B4=f?.message)||void 0===B4||B4.call(f,hu),null===(F4=Dn?.message)||void 0===F4||F4.call(Dn,hu),d?.(hu)}});null===(vs=f?.connected)||void 0===vs||vs.call(f,!!Ii),null===(_a=Dn?.connected)||void 0===_a||_a.call(Dn,!!Ii);var ha,Uf=!1,Yd=!1;try{for(var _u,oc=c4(_1e());Uf=!(_u=yield oc.next()).done;Uf=!1)Ii=null,du=0,Vn.next(_u.value)}catch(hu){Yd=!0,ha=hu}finally{try{Uf&&null!=oc.return&&(yield oc.return())}finally{if(Yd)throw ha}}return mo.abort()}catch(os){if(mo.signal.aborted)return;if(!(os instanceof gs)||!s||du>=s)throw os;Ii=os}})().then(()=>Vn.complete()).catch(Ro=>Vn.error(Ro)),()=>mo.abort()}_e++;const Xn=new R,Ei=Z.onDispose(()=>{Ei(),Xn.abort()});return(0,K.A)(function*(){const mo=i();nn={...nn,extensions:{...nn.extensions,operationId:mo}};let Do=null;for(;;){Do=null;try{const{url:Ii,headers:du,getResults:Uf}=yield mt();let Yd;try{Yd=yield y(Ii,{signal:Xn.signal,method:"POST",credentials:l,referrer:c,referrerPolicy:u,headers:{...du,"content-type":"application/json; charset=utf-8"},body:JSON.stringify(nn)})}catch(ha){throw new gs(ha)}if(202!==Yd.status)throw new gs(Yd);Do=function(){var ha=(0,K.A)(function*(){let oc;try{const _u=new R,os=Z.onDispose(()=>{os(),_u.abort()});oc=yield y(Ii+"?operationId="+mo,{signal:_u.signal,method:"DELETE",credentials:l,referrer:c,referrerPolicy:u,headers:du})}catch(_u){throw new gs(_u)}if(200!==oc.status)throw new gs(oc)});return function(){return ha.apply(this,arguments)}}();var Ya,Ro=!1,da=!1;try{for(var _a,vs=c4(Uf({signal:Xn.signal,operationId:mo}));Ro=!(_a=yield vs.next()).done;Ro=!1)Ye=null,ot=0,Vn.next(_a.value)}catch(ha){da=!0,Ya=ha}finally{try{Ro&&null!=vs.return&&(yield vs.return())}finally{if(da)throw Ya}}return Do=null,Xn.abort()}catch(Ii){if(Xn.signal.aborted)return yield Do?.();if(!(Ii instanceof gs)||(n&&(ae=void 0),!s||ot>=s))throw Xn.abort(),Ii;Ye=Ii}finally{Xn.signal.aborted&&0===--_e&&(isFinite(r)&&r>0?setTimeout(()=>{_e||X.abort()},r):X.abort())}}})().then(()=>Vn.complete()).catch(mo=>Vn.error(mo)),()=>Xn.abort()}return t&&!n&&(0,K.A)(function*(){for(_e++;;)try{const{waitForThrow:nn}=yield mt();yield nn()}catch(nn){if(Z.disposed)return;if(!(nn instanceof gs)||(ae=void 0,!s||ot>=s))return o?.(nn);Ye=nn}})(),{subscribe:Tn,iterate(nn,Vn){const Dn=[],Xn={done:!1,error:null,resolve:()=>{}},Ei=Tn(nn,{next(Do){Dn.push(Do),Xn.resolve()},error(Do){Xn.done=!0,Xn.error=Do,Xn.resolve()},complete(){Xn.done=!0,Xn.resolve()}},Vn),mo=(Do=l4(function*(){for(;;){for(Dn.length||(yield a4(new Promise(da=>Xn.resolve=da)));Dn.length;)yield Dn.shift();if(Xn.error)throw Xn.error;if(Xn.done)return}}),function Ro(){return Do.apply(this,arguments)})();var Do;return mo.throw=function(){var Do=(0,K.A)(function*(Ro){return Xn.done||(Xn.done=!0,Xn.error=Ro,Xn.resolve()),{done:!0,value:void 0}});return function(Ro){return Do.apply(this,arguments)}}(),mo.return=(0,K.A)(function*(){return Ei(),{done:!0,value:void 0}}),mo},dispose(){Z.dispose()}}}(t)}request(t){return new Lt(n=>this.client.subscribe({...t,query:b2(t.query)},{next:n.next.bind(n),complete:n.complete.bind(n),error:n.error.bind(n)}))}}const Kle={run:e=>e(),runOutsideAngular:e=>e()};let TN=(()=>{class e{constructor(){this.httpLink=fe(Hle),this.gatewayService=fe(dx),this.apollo=(n,r=!1)=>new r4(Kle,this.createApolloOptions(n,r))}createApolloOptions(n,r=!1){const o=new HM(l=>{const c=l.headers instanceof ci?l.headers:new ci(l.headers??{});return{...l,uri:()=>this.gatewayService.getGatewayUrl(n,r),headers:c.set("Authorization",`Bearer ${n.token}`).set("Accept","charset=utf-8")}}),i=Jie(({query:l})=>{const c=b3(l);return"OperationDefinition"===c.kind&&"subscription"===c.operation},new Yle({url:()=>this.gatewayService.getGatewayUrl(n,r),headers:()=>({Authorization:`Bearer ${n.token}`})}),this.httpLink.create({}));return{link:ui.from([o,i]),cache:new FM}}static{this.\u0275fac=function(r){return new(r||e)}}static{this.\u0275prov=Te({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();var $d=it(7184);let V2=(()=>{class e{constructor(){this.apolloFactory=fe(TN),this.luigiCoreService=fe(po)}read(n,r,o,i,s=!0){const a=B(i),l=this.getNamespace(i);let c=this.resolveReadQuery(r,o,n,a?l:void 0);return c=this.parseGQLQuery(c),this.apolloFactory.apollo(i,s).query({query:c,variables:{name:n,...a&&{namespace:l}}}).pipe(dr(u=>E(u.data,M(r,"."))))}resolveReadQuery(n,r,o,i){if(r instanceof Array){const{entity:s,version:a,apiGroup:l}=n,c=[{operation:s,variables:{name:{value:o,type:"String!"},...i&&{namespace:{value:i,type:"String"}}},fields:r}],u=this.calcQueryOptions(c,[{operation:l},{operation:a}]);return $d.P(u).query}return r}list(n,r,o,i=!1,s){const l={...B(o)&&{namespace:{type:"String",value:this.getNamespace(o)}},...s?.limit&&{limit:{type:"Int",value:s?.limit}},...s?.continue&&{continue:{type:"String",value:s?.continue}}},c=o.resourceDefinition;return c?r instanceof Array?this.listWithFields(c,r,o,i,l):this.listWithRawQuery(n,r,o,i,l):Jl(()=>new Error("Resource definition is required"))}getResourceReadyStatus(n,r){const o=r.resourceDefinition?.readyCondition;return!o||L(n,o)}listWithFields(n,r,o,i,s){const{apiGroup:a,entityCollection:l,version:c}=n,d=this.calcQueryOptions([{operation:l,variables:s,fields:["resourceVersion","remainingItemCount","continue",{items:r}]}],[{operation:a},{operation:c}]),f=$d.P(d),y=this.parseGQLQuery(f.query);return this.apolloFactory.apollo(o,i).query({query:y,variables:f.variables}).pipe(dr(R=>{const Z=E(R.data,M({apiGroup:a,version:c,entity:l},"."));if(!Z)throw new Error("Resource list result not found");return Z}),dr(R=>{const Z=R.items.map(X=>({...X,ready:this.getResourceReadyStatus(X,o)})).map(X=>({...X,isAvailable:this.isAvailable(X),accessibleName:this.getAccessibleName(X)}));return{...R,items:Z}}))}isAvailable(n){return!!n.ready&&!n.metadata?.deletionTimestamp}getAccessibleName(n){return n.metadata?.deletionTimestamp?"Resource is pending deletion":n.ready?void 0:"Resource is not ready"}listWithRawQuery(n,r,o,i,s){const a=this.parseGQLQuery(r);return this.apolloFactory.apollo(o,i).query({query:a,variables:this.normalizeGqlBuilderVariables(s)}).pipe(dr(l=>E(l.data,n)??[]),za(l=>(this.alertErrors(l),console.error("Error executing GraphQL query.",l),Jl(()=>l))))}resourceChangeSubscription(n,r,o,i,s){const l={...B(o)&&{namespace:{type:"String",value:this.getNamespace(o)}}},c=n.toLowerCase(),u=$d.gP({operation:c,fields:["type",{object:r}],variables:{...l,resourceVersion:{type:"String",value:i}}}),d=this.parseGQLQuery(u.query);return this.apolloFactory.apollo(o,s).subscribe({query:d,variables:u.variables}).pipe(dr(f=>{const y=E(f.data,c);return y&&(y.object.ready=this.getResourceReadyStatus(y.object,o),y.object.isAvailable=this.isAvailable(y.object),y.object.accessibleName=this.getAccessibleName(y.object)),y}))}alertErrors(n){this.luigiCoreService.showAlert({text:n.message,type:"error"})}delete(n,r,o,i=!1){const s=B(o),{apiGroup:a,entity:l,version:c}=r,u=[{operation:`delete${l}`,variables:{name:{type:"String!",value:n.metadata.name},...s&&{namespace:{type:"String",value:this.getNamespace(o)}}},fields:[]}],d=this.calcQueryOptions(u,[{operation:a},{operation:c}]),f=$d.gO(d),y=this.parseGQLQuery(f.query);return this.apolloFactory.apollo(o,i).mutate({mutation:y,variables:f.variables}).pipe(za(R=>(this.alertErrors(R),console.error("Error executing GraphQL query.",R),Jl(()=>R))))}create(n,r,o){const i=B(o),{apiGroup:s,entity:a,version:l}=r,c=this.getNamespace(o,n),u=[{operation:`create${a}`,variables:{...i&&{namespace:{type:"String",value:c}},object:{type:`${a}Input!`,value:n}},fields:["__typename"]}],d=this.calcQueryOptions(u,[{operation:s},{operation:l}]),f=$d.gO(d),y=this.parseGQLQuery(f.query);return this.apolloFactory.apollo(o).mutate({mutation:y,fetchPolicy:"no-cache",variables:f.variables}).pipe(za(R=>(this.alertErrors(R),console.error("Error executing GraphQL query.",R),Jl(()=>R))))}update(n,r,o,i=!1,s=["__typename"]){const a=B(o),{apiGroup:l,entity:c,version:u}=r,d=this.getNamespace(o),f=j(n),y=[{operation:`update${c}`,variables:{...a&&{namespace:{type:"String",value:d}},name:{type:"String!",value:n.metadata.name},object:{type:`${c}Input!`,value:f}},fields:s}],R=this.calcQueryOptions(y,[{operation:l},{operation:u}]),Z=$d.gO(R),X=this.parseGQLQuery(Z.query);return this.apolloFactory.apollo(o,i).mutate({mutation:X,fetchPolicy:"no-cache",variables:Z.variables}).pipe(dr(ae=>E(ae.data,M({apiGroup:l,entity:`update${c}`,version:u},"."))),za(ae=>(this.alertErrors(ae),console.error("Error executing GraphQL query.",ae),Jl(()=>ae))))}getNamespace(n,r){if(n.namespaceId)return n.namespaceId;if(r?.metadata?.namespace)return r.metadata.namespace;const o=this.luigiCoreService.routing().getSearchParams().namespace;return o?"-all-"===o?void 0:o:void 0}normalizeGqlBuilderVariables(n){return Object.fromEntries(Object.entries(n).map(([r,o])=>[r,o.value]))}calcQueryOptions(n,r){const o=r.filter(a=>!!a?.operation);if(0===o.length){const a=n.pop();if(a&&a.operation&&a.fields)return a;throw new Error("At least one wrapper or inner fields is required")}let i=n,s=o.pop();return o.forEach(a=>{i=[{operation:s.operation,fields:n,variables:s.variables}],s=a}),{operation:s.operation,fields:i,variables:s.variables}}parseGQLQuery(n){try{return i4`
|
|
67
|
+
*/globalThis.$localize=u2;const ar=globalThis.Luigi;let po=(()=>{class e{setConfig(n){return ar.setConfig(n)}get config(){return ar.getConfig()}getConfigValue(n){return ar.getConfigValue(n)}unloadConfig(){return ar.unload()}sendCustomMessage(n){return ar.sendCustomMessage(n)}configChanged(n){ar.configChanged(n)}customMessages(){return ar.customMessages()}navigation(){return ar.navigation()}resetLuigi(){ar.reset()}clearNavigationCache(){ar.clearNavigationCache&&ar.clearNavigationCache()}showAlert(n){return ar.showAlert(n)}ux(){return ar.ux()}theming(){return ar.theming()}i18n(){return ar.i18n()}globalSearch(){return ar.globalSearch()}getGlobalContext(){return ar.getGlobalContext()}getWcExtendedContext(){return document.querySelector(".wcContainer")?.querySelector("[lui_web_component]")?.extendedContext?.context}getWcModalExtendedContext(){return document.querySelector(".iframeModalCtn")?.querySelector("[lui_web_component]")?.extendedContext?.context}setGlobalContext(n,r=!1){ar.setGlobalContext(n,r)}setInGlobalContext(n,r=!1){ar.setGlobalContext({...this.getGlobalContext(),...n},r)}routing(){return ar.routing()}setFeatureToggle(n){ar.featureToggles().setFeatureToggle(n)}unsetFeatureToggle(n){ar.featureToggles().unsetFeatureToggle(n)}unsetAllFeatureToggles(){ar.featureToggles().getActiveFeatureToggleList().forEach(n=>{this.unsetFeatureToggle(n)})}setFeatureToggles(n){if(n)for(const r of Object.keys(n))n[r]&&this.setFeatureToggle(r)}isFeatureToggleActive(n){return ar.featureToggles().getActiveFeatureToggleList().includes(n)}getActiveFeatureToggleList(){return ar.featureToggles().getActiveFeatureToggleList()}setAuthData(n){ar.auth().store.setAuthData(n),ar.auth().store.setNewlyAuthorized()}removeAuthData(){ar.auth().store.removeAuthData()}getAuthData(){return ar.auth().store.getAuthData()}setCurrentLocale(n){ar.i18n().setCurrentLocale(n)}static{this.\u0275fac=function(r){return new(r||e)}}static{this.\u0275prov=Te({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})(),nu=(()=>{class e{constructor(){this.http=fe(Hl)}getEnvConfig(){var n=this;return(0,K.A)(function*(){return n.envConfigCache||(yield Zh(n.http.get("/rest/envconfig").pipe(Kc(r=>n.envConfigCache=r)))),n.envConfigCache})()}static{this.\u0275fac=function(r){return new(r||e)}}static{this.\u0275prov=Te({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})(),Ba=(()=>{class e{constructor(){this.envConfigService=fe(nu),this.luigiCoreService=fe(po),this.fallbackLanguage="en",this.translationTable={},this.currentLanguage=""}afterInit(){this.currentLanguage=this.luigiCoreService.i18n().getCurrentLocale(),this.luigiCoreService.i18n().addCurrentLocaleChangeListener(n=>{this.currentLanguage=n})}getTranslation(n,r,o){let i=this.getInternalTranslation(n,r,o);return i||(i=this.findTranslation(n,this.translationTable,this.fallbackLanguage,r)),i||n}getTranslationAsync(n,r,o){var i=this;return(0,K.A)(function*(){return new Promise(s=>{let a=i.getInternalTranslation(n,r,o);a?s(a||n):i.translationTable&&!i.translationTable[i.fallbackLanguage]?i.fetchTranslationFile(i.fallbackLanguage).then(()=>{a=i.findTranslation(n,i.translationTable,i.fallbackLanguage,r),s(a||n)}):(a=i.findTranslation(n,i.translationTable,i.fallbackLanguage,r),s(a||n))})})()}findTranslation(n,r,o,i){if(r[o]){const s="object"==typeof r[o][n]?r[o][n].join("<br>"):r[o][n];return i?this.findInterpolations(s,i):s}}findInterpolations(n,r){if(n)return Object.keys(r).forEach(o=>{n=n.replace(new RegExp("{"+o+"}","gi"),r[o])}),n}addTranslationFile(n,r){r&&n&&(this.translationTable[n]=r)}fetchTranslationFile(n){var r=this;return(0,K.A)(function*(){return new Promise(o=>{fetch(`/assets/translation-files/${n}.json`).then(i=>i.json()).then(i=>{r.addTranslationFile(n,i),o(!0)}).catch(i=>{console.error("Error:",i),r.addTranslationFile(n,{}),o(!1)})})})()}getInternalTranslation(n,r,o){return n?(this.currentLanguage=o||this.currentLanguage||this.luigiCoreService.i18n().getCurrentLocale(),this.findTranslation(n,this.translationTable,this.currentLanguage,r)):""}getValidLanguages(){var n=this;return(0,K.A)(function*(){const r=[{value:"en",label:"USERSETTINGSDIALOG_LANGUAGE_EN"}];try{const{developmentInstance:o}=yield n.envConfigService.getEnvConfig();o&&r.push({value:"de",label:"USERSETTINGSDIALOG_LANGUAGE_DE"})}finally{return r}})()}static{this.\u0275fac=function(r){return new(r||e)}}static{this.\u0275prov=Te({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();var ru=function(e){return e.LAST_NAVIGATION_URL="openmfp.navigation.lastUrl",e.USER_SETTINGS="openmfp.settings.userSettings",e.LOCAL_DEVELOPMENT_SETTINGS="openmfp.settings.localDevelopmentSettings",e.FEATURE_TOGGLE_SETTINGS="openmfp.settings.featureToggleSettings",e.DEVELOPMENT_MODE_CONFIG="dev-mode-settings",e}(ru||{});(0,K.A)(function*(t){return t.frame_userAccount&&t.frame_userAccount.language?(delete t.frame_userAccount.name,delete t.frame_userAccount.email):delete t.frame_userAccount,new Promise((n,r)=>{try{localStorage.setItem(ru.USER_SETTINGS,JSON.stringify(t)),n(t)}catch(o){console.error("Error storing user settings",o),r({closeDialog:!0,message:"Could not write userSettings to storage..."})}})}),document.body.classList.add("ui5-content-density-compact");let dx=(()=>{class e{constructor(){this.luigiCoreService=fe(po)}getGatewayUrl(n,r=!1){const o=n.portalContext.crdGatewayApiUrl,i=this.extractKcpPath(o);return o?.replace(i,this.resolveKcpPath(n,r))}updateCrdGatewayUrlWithEntityPath(n){const r=this.luigiCoreService.getGlobalContext().portalContext.crdGatewayApiUrl,o=this.extractKcpPath(r);this.luigiCoreService.getGlobalContext().portalContext.crdGatewayApiUrl=r.replace(o,n)}resolveKcpPath(n,r=!1){let i=this.extractKcpPath(n.portalContext.crdGatewayApiUrl);if(n.kcpPath&&(i=n.kcpPath),r){const s=i.lastIndexOf(":");-1!==s&&(i=i.slice(0,s))}return i}extractKcpPath(n){return n.match(new RegExp("(root:orgs[^/]*)"))?.[1]||""}static{this.\u0275fac=function(r){return new(r||e)}}static{this.\u0275prov=Te({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();const Wl=new Lt(e=>e.complete());function ps(e,t){return e.definitions.find(n=>"OperationDefinition"===n.kind&&!!n.name)?.name.value??t}function f2(e,t){if(!e)throw new Error(t)}function Z8(e){return p2(e,[])}function p2(e,t){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return function kie(e,t){if(null===e)return"null";if(t.includes(e))return"[Circular]";const n=[...t,e];if(function Rie(e){return"function"==typeof e.toJSON}(e)){const r=e.toJSON();if(r!==e)return"string"==typeof r?r:p2(r,n)}else if(Array.isArray(e))return function Pie(e,t){if(0===e.length)return"[]";if(t.length>2)return"[Array]";const n=Math.min(10,e.length),r=e.length-n,o=[];for(let i=0;i<n;++i)o.push(p2(e[i],t));return 1===r?o.push("... 1 more item"):r>1&&o.push(`... ${r} more items`),"["+o.join(", ")+"]"}(e,n);return function Oie(e,t){const n=Object.entries(e);return 0===n.length?"{}":t.length>2?"["+function Bie(e){const t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){const n=e.constructor.name;if("string"==typeof n&&""!==n)return n}return t}(e)+"]":"{ "+n.map(([o,i])=>o+": "+p2(i,t)).join(", ")+" }"}(e,n)}(e,t);default:return String(e)}}class Fie{constructor(t,n,r){this.start=t.start,this.end=n.end,this.startToken=t,this.endToken=n,this.source=r}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}}class hx{constructor(t,n,r,o,i,s){this.kind=t,this.start=n,this.end=r,this.line=o,this.column=i,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 fx={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","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"],TypeCoordinate:["name"],MemberCoordinate:["name","memberName"],ArgumentCoordinate:["name","fieldName","argumentName"],DirectiveCoordinate:["name"],DirectiveArgumentCoordinate:["name","argumentName"]},Hie=new Set(Object.keys(fx));function px(e){const t=e?.kind;return"string"==typeof t&&Hie.has(t)}var oa=function(e){return e.QUERY="query",e.MUTATION="mutation",e.SUBSCRIPTION="subscription",e}(oa||{}),Dt=function(e){return e.NAME="Name",e.DOCUMENT="Document",e.OPERATION_DEFINITION="OperationDefinition",e.VARIABLE_DEFINITION="VariableDefinition",e.SELECTION_SET="SelectionSet",e.FIELD="Field",e.ARGUMENT="Argument",e.FRAGMENT_SPREAD="FragmentSpread",e.INLINE_FRAGMENT="InlineFragment",e.FRAGMENT_DEFINITION="FragmentDefinition",e.VARIABLE="Variable",e.INT="IntValue",e.FLOAT="FloatValue",e.STRING="StringValue",e.BOOLEAN="BooleanValue",e.NULL="NullValue",e.ENUM="EnumValue",e.LIST="ListValue",e.OBJECT="ObjectValue",e.OBJECT_FIELD="ObjectField",e.DIRECTIVE="Directive",e.NAMED_TYPE="NamedType",e.LIST_TYPE="ListType",e.NON_NULL_TYPE="NonNullType",e.SCHEMA_DEFINITION="SchemaDefinition",e.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",e.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",e.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",e.FIELD_DEFINITION="FieldDefinition",e.INPUT_VALUE_DEFINITION="InputValueDefinition",e.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",e.UNION_TYPE_DEFINITION="UnionTypeDefinition",e.ENUM_TYPE_DEFINITION="EnumTypeDefinition",e.ENUM_VALUE_DEFINITION="EnumValueDefinition",e.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",e.DIRECTIVE_DEFINITION="DirectiveDefinition",e.SCHEMA_EXTENSION="SchemaExtension",e.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",e.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",e.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",e.UNION_TYPE_EXTENSION="UnionTypeExtension",e.ENUM_TYPE_EXTENSION="EnumTypeExtension",e.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension",e.TYPE_COORDINATE="TypeCoordinate",e.MEMBER_COORDINATE="MemberCoordinate",e.ARGUMENT_COORDINATE="ArgumentCoordinate",e.DIRECTIVE_COORDINATE="DirectiveCoordinate",e.DIRECTIVE_ARGUMENT_COORDINATE="DirectiveArgumentCoordinate",e}(Dt||{});const Zl=Object.freeze({});function ia(e,t,n=fx){const r=new Map;for(const ae of Object.values(Dt))r.set(ae,q8(t,ae));let o,u,d,i=Array.isArray(e),s=[e],a=-1,l=[],c=e;const f=[],y=[];do{a++;const ae=a===s.length,_e=ae&&0!==l.length;if(ae){if(u=0===y.length?void 0:f[f.length-1],c=d,d=y.pop(),_e)if(i){c=c.slice();let ot=0;for(const[mt,Xt]of l){const Tn=mt-ot;null===Xt?(c.splice(Tn,1),ot++):c[Tn]=Xt}}else{c={...c};for(const[ot,mt]of l)c[ot]=mt}a=o.index,s=o.keys,l=o.edits,i=o.inArray,o=o.prev}else if(d){if(u=i?a:s[a],c=d[u],null==c)continue;f.push(u)}let Ye;if(!Array.isArray(c)){var R,Z;px(c)||f2(!1,`Invalid AST Node: ${Z8(c)}.`);const ot=ae?null===(R=r.get(c.kind))||void 0===R?void 0:R.leave:null===(Z=r.get(c.kind))||void 0===Z?void 0:Z.enter;if(Ye=ot?.call(t,c,u,d,f,y),Ye===Zl)break;if(!1===Ye){if(!ae){f.pop();continue}}else if(void 0!==Ye&&(l.push([u,Ye]),!ae)){if(!px(Ye)){f.pop();continue}c=Ye}}var X;void 0===Ye&&_e&&l.push([u,c]),ae?f.pop():(o={inArray:i,index:a,keys:s,edits:l,prev:o},i=Array.isArray(c),s=i?c:null!==(X=n[c.kind])&&void 0!==X?X:[],a=-1,l=[],d&&y.push(d),d=c)}while(void 0!==o);return 0!==l.length?l[l.length-1][1]:e}function q8(e,t){const n=e[t];return"object"==typeof n?n:"function"==typeof n?{enter:n,leave:void 0}:{enter:e.enter,leave:e.leave}}function xd(e){try{return e()}catch{}}const Y8=xd(()=>globalThis)||xd(()=>window)||xd(()=>self)||xd(()=>global)||xd(function(){return xd.constructor("return this")()}),K8="4.1.9",gx=new Map;function mx(e){const t=gx.get(e)||1;return gx.set(e,t+1),`${e}:${t}:${Math.random().toString(36).slice(2)}`}const Cx="Invariant Violation";class X8 extends Error{constructor(t=Cx){super(t),this.name=Cx,Object.setPrototypeOf(this,X8.prototype)}}const g2=["debug","log","warn","error","silent"];let Q8=g2.indexOf("silent");function Ot(e,...t){if(!e)throw es(...t)}function m2(e){return function(t,...n){if(g2.indexOf(e)>=Q8){const r=console[e]||console.log;if("number"==typeof t){const o=t;(t=bx(o))||(t=Tx(o,n),n=[])}r(t,...n)}}}function es(e,...t){return new X8(bx(e,t)||Tx(e,t))}Ot.debug=m2("debug"),Ot.log=m2("log"),Ot.warn=m2("warn"),Ot.error=m2("error");const yx=Symbol.for("ApolloErrorMessageHandler_"+K8);function J8(e){if("string"==typeof e)return e;try{return function vx(e,t=0){const n=mx("stringifyForDisplay");return JSON.stringify(e,(r,o)=>void 0===o?n:o,t).split(JSON.stringify(n)).join("<undefined>")}(e,2).slice(0,1e3)}catch{return"<non-serializable>"}}function bx(e,t=[]){if(e)return Y8[yx]&&Y8[yx](e,t.map(J8))}function Tx(e,t=[]){if(e)return"string"==typeof e?t.reduce((n,r)=>n.replace(/%[sdfo]/,J8(r)),e):`An error occurred! For more details, see the full error text at https://go.apollo.dev/c/err#${encodeURIComponent(JSON.stringify({version:K8,message:e,args:t.map(J8)}))}`}const Fa={...Y8[Symbol.for("apollo.cacheSize")]},Vie=()=>Object.create(null),{forEach:zie,slice:Ex}=Array.prototype,{hasOwnProperty:jie}=Object.prototype;class sa{constructor(t=!0,n=Vie){this.weakness=t,this.makeData=n}lookup(){return this.lookupArray(arguments)}lookupArray(t){let n=this;return zie.call(t,r=>n=n.getChildTrie(r)),jie.call(n,"data")?n.data:n.data=this.makeData(Ex.call(t))}peek(){return this.peekArray(arguments)}peekArray(t){let n=this;for(let r=0,o=t.length;n&&r<o;++r){const i=n.mapFor(t[r],!1);n=i&&i.get(t[r])}return n&&n.data}remove(){return this.removeArray(arguments)}removeArray(t){let n;if(t.length){const r=t[0],o=this.mapFor(r,!1),i=o&&o.get(r);i&&(n=i.removeArray(Ex.call(t,1)),!i.data&&!i.weak&&(!i.strong||!i.strong.size)&&o.delete(r))}else n=this.data,delete this.data;return n}getChildTrie(t){const n=this.mapFor(t,!0);let r=n.get(t);return r||n.set(t,r=new sa(this.weakness,this.makeData)),r}mapFor(t,n){return this.weakness&&function Gie(e){switch(typeof e){case"object":if(null===e)break;case"function":return!0}return!1}(t)?this.weak||(n?this.weak=new WeakMap:void 0):this.strong||(n?this.strong=new Map:void 0)}}function e3(){}const $ie=e3,Wie=typeof WeakRef<"u"?WeakRef:function(e){return{deref:()=>e}},Zie=typeof WeakMap<"u"?WeakMap:Map,qie=typeof FinalizationRegistry<"u"?FinalizationRegistry:function(){return{register:e3,unregister:e3}};class v2{constructor(t=1/0,n=$ie){this.max=t,this.dispose=n,this.map=new Zie,this.newest=null,this.oldest=null,this.unfinalizedNodes=new Set,this.finalizationScheduled=!1,this.size=0,this.finalize=()=>{const r=this.unfinalizedNodes.values();for(let o=0;o<10024;o++){const i=r.next().value;if(!i)break;this.unfinalizedNodes.delete(i);const s=i.key;delete i.key,i.keyRef=new Wie(s),this.registry.register(s,i,i)}this.unfinalizedNodes.size>0?queueMicrotask(this.finalize):this.finalizationScheduled=!1},this.registry=new qie(this.deleteNode.bind(this))}has(t){return this.map.has(t)}get(t){const n=this.getNode(t);return n&&n.value}getNode(t){const n=this.map.get(t);if(n&&n!==this.newest){const{older:r,newer:o}=n;o&&(o.older=r),r&&(r.newer=o),n.older=this.newest,n.older.newer=n,n.newer=null,this.newest=n,n===this.oldest&&(this.oldest=o)}return n}set(t,n){let r=this.getNode(t);return r?r.value=n:(r={key:t,value:n,newer:null,older:this.newest},this.newest&&(this.newest.newer=r),this.newest=r,this.oldest=this.oldest||r,this.scheduleFinalization(r),this.map.set(t,r),this.size++,r.value)}clean(){for(;this.oldest&&this.size>this.max;)this.deleteNode(this.oldest)}deleteNode(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.size--;const n=t.key||t.keyRef&&t.keyRef.deref();this.dispose(t.value,n),t.keyRef?this.registry.unregister(t):this.unfinalizedNodes.delete(t),n&&this.map.delete(n)}delete(t){const n=this.map.get(t);return!!n&&(this.deleteNode(n),!0)}scheduleFinalization(t){this.unfinalizedNodes.add(t),this.finalizationScheduled||(this.finalizationScheduled=!0,queueMicrotask(this.finalize))}}function Kie(){}class t3{constructor(t=1/0,n=Kie){this.max=t,this.dispose=n,this.map=new Map,this.newest=null,this.oldest=null}has(t){return this.map.has(t)}get(t){const n=this.getNode(t);return n&&n.value}get size(){return this.map.size}getNode(t){const n=this.map.get(t);if(n&&n!==this.newest){const{older:r,newer:o}=n;o&&(o.older=r),r&&(r.newer=o),n.older=this.newest,n.older.newer=n,n.newer=null,this.newest=n,n===this.oldest&&(this.oldest=o)}return n}set(t,n){let r=this.getNode(t);return r?r.value=n:(r={key:t,value:n,newer:null,older:this.newest},this.newest&&(this.newest.newer=r),this.newest=r,this.oldest=this.oldest||r,this.map.set(t,r),r.value)}clean(){for(;this.oldest&&this.map.size>this.max;)this.delete(this.oldest.key)}delete(t){const n=this.map.get(t);return!!n&&(n===this.newest&&(this.newest=n.older),n===this.oldest&&(this.oldest=n.newer),n.newer&&(n.newer.older=n.older),n.older&&(n.older.newer=n.newer),this.map.delete(t),this.dispose(n.value,t),!0)}}const n3=new WeakSet;function Ix(e){e.size<=(e.max||-1)||n3.has(e)||(n3.add(e),setTimeout(()=>{e.clean(),n3.delete(e)},100))}const r3=function(e,t){const n=new v2(e,t);return n.set=function(r,o){const i=v2.prototype.set.call(this,r,o);return Ix(this),i},n},Xie=function(e,t){const n=new t3(e,t);return n.set=function(r,o){const i=t3.prototype.set.call(this,r,o);return Ix(this),i},n};function Ax(e,{max:t,makeCacheKey:n=r=>r}){const r=new sa(!0),o=new r3(t);return(...i)=>{const s=r.lookupArray(n(i)),a=o.get(s);if(a){if(a.error)throw a.error;return a.result}const l=o.set(s,{});try{return l.result=e(...i)}catch(c){throw l.error=c,c}}}const ql=Ax((e,t)=>{Ot(e&&"Document"===e.kind,1);const n=e.definitions.filter(r=>"OperationDefinition"===r.kind);t&&Ot(1==n.length&&n[0].operation===t,4,t,t,n[0].operation),ia(e,{Field(r,o,i,s){if(r.alias&&("__typename"===r.alias.value||r.alias.value.startsWith("__ac_"))&&r.alias.value!==r.name.value){let a=e,l=[];for(const c of s)a=a[c],a.kind===Dt.FIELD&&l.push(a.alias?.value||a.name.value);throw l.splice(-1,1,r.name.value),es(5,r.alias.value,l.join("."),n[0].operation,ps(e,"(anonymous)"))}}})},{max:Fa.checkDocument||2e3});function Ha(e){return ql(e),e.definitions.filter(t=>"OperationDefinition"===t.kind)[0]}class ui{static empty(){return new ui(()=>Wl)}static from(t){if(0===t.length)return ui.empty();const[n,...r]=t;return n.concat(...r)}static split(t,n,r=new ui((o,i)=>i(o))){const o=new ui((i,s)=>t(i)?n.request(i,s):r.request(i,s));return Object.assign(o,{left:n,right:r})}static execute(t,n,r){return t.request(function Qie(e,{client:t}){const n={query:e.query,variables:e.variables||{},extensions:e.extensions||{},operationName:ps(e.query),operationType:Ha(e.query).operation};let r={...e.context};const i=()=>Object.freeze({...r});return Object.defineProperty(n,"setContext",{enumerable:!1,value:s=>{r="function"==typeof s?{...r,...s(i())}:{...r,...s}}}),Object.defineProperty(n,"getContext",{enumerable:!1,value:i}),Object.defineProperty(n,"client",{enumerable:!1,value:t}),n}(n,r),()=>Wl)}static concat(...t){return ui.from(t)}constructor(t){t&&(this.request=t)}split(t,n,r){return this.concat(ui.split(t,n,r))}concat(...t){return 0===t.length?this:t.reduce(this.combine.bind(this),this)}combine(t,n){const r=new ui((o,i)=>t.request(o,s=>n.request(s,i)));return Object.assign(r,{left:t,right:n})}request(t,n){throw es(65)}left;right}const Jie=ui.split,{toString:Sx,hasOwnProperty:ese}=Object.prototype,wx=Function.prototype.toString,o3=new Map;function $r(e,t){try{return i3(e,t)}finally{o3.clear()}}function i3(e,t){if(e===t)return!0;const n=Sx.call(e);if(n!==Sx.call(t))return!1;switch(n){case"[object Array]":if(e.length!==t.length)return!1;case"[object Object]":{if(Lx(e,t))return!0;const o=Dx(e),i=Dx(t),s=o.length;if(s!==i.length)return!1;for(let a=0;a<s;++a)if(!ese.call(t,o[a]))return!1;for(let a=0;a<s;++a){const l=o[a];if(!i3(e[l],t[l]))return!1}return!0}case"[object Error]":return e.name===t.name&&e.message===t.message;case"[object Number]":if(e!=e)return t!=t;case"[object Boolean]":case"[object Date]":return+e==+t;case"[object RegExp]":case"[object String]":return e==`${t}`;case"[object Map]":case"[object Set]":{if(e.size!==t.size)return!1;if(Lx(e,t))return!0;const o=e.entries(),i="[object Map]"===n;for(;;){const s=o.next();if(s.done)break;const[a,l]=s.value;if(!t.has(a)||i&&!i3(l,t.get(a)))return!1}return!0}case"[object Uint16Array]":case"[object Uint8Array]":case"[object Uint32Array]":case"[object Int32Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object ArrayBuffer]":e=new Uint8Array(e),t=new Uint8Array(t);case"[object DataView]":{let o=e.byteLength;if(o===t.byteLength)for(;o--&&e[o]===t[o];);return-1===o}case"[object AsyncFunction]":case"[object GeneratorFunction]":case"[object AsyncGeneratorFunction]":case"[object Function]":{const o=wx.call(e);return o===wx.call(t)&&!function rse(e,t){const n=e.length-t.length;return n>=0&&e.indexOf(t,n)===n}(o,nse)}}return!1}function Dx(e){return Object.keys(e).filter(tse,e)}function tse(e){return void 0!==this[e]}const nse="{ [native code] }";function Lx(e,t){let n=o3.get(e);if(n){if(n.has(t))return!0}else o3.set(e,n=new Set);return n.add(t),!1}let Ko=null;const xx={};let ose=1;function Mx(e){try{return e()}catch{}}const s3="@wry/context:Slot",Nx=Mx(()=>globalThis)||Mx(()=>global)||Object.create(null),C2=Nx[s3]||Array[s3]||function(e){try{Object.defineProperty(Nx,s3,{value:e,enumerable:!1,writable:!1,configurable:!0})}finally{return e}}(class{constructor(){this.id=["slot",ose++,Date.now(),Math.random().toString(36).slice(2)].join(":")}hasValue(){for(let t=Ko;t;t=t.parent)if(this.id in t.slots){const n=t.slots[this.id];if(n===xx)break;return t!==Ko&&(Ko.slots[this.id]=n),!0}return Ko&&(Ko.slots[this.id]=xx),!1}getValue(){if(this.hasValue())return Ko.slots[this.id]}withValue(t,n,r,o){const s=Ko;Ko={parent:s,slots:{__proto__:null,[this.id]:t}};try{return n.apply(o,r)}finally{Ko=s}}static bind(t){const n=Ko;return function(){const r=Ko;try{return Ko=n,t.apply(this,arguments)}finally{Ko=r}}}static noContext(t,n,r){if(!Ko)return t.apply(r,n);{const o=Ko;try{return Ko=null,t.apply(r,n)}finally{Ko=o}}}}),lf=new C2,{hasOwnProperty:lse}=Object.prototype,l3=Array.from||function(e){const t=[];return e.forEach(n=>t.push(n)),t};function y2(e){const{unsubscribe:t}=e;"function"==typeof t&&(e.unsubscribe=void 0,t())}const cf=[];function Md(e,t){if(!e)throw new Error(t||"assertion failure")}function Rx(e,t){const n=e.length;return n>0&&n===t.length&&e[n-1]===t[n-1]}function Ox(e){switch(e.length){case 0:throw new Error("unknown value");case 1:return e[0];case 2:throw e[1]}}function Px(e){return e.slice(0)}let use=(()=>{class e{constructor(n){this.fn=n,this.parents=new Set,this.childValues=new Map,this.dirtyChildren=null,this.dirty=!0,this.recomputing=!1,this.value=[],this.deps=null,++e.count}peek(){if(1===this.value.length&&!Yl(this))return Bx(this),this.value[0]}recompute(n){return Md(!this.recomputing,"already recomputing"),Bx(this),Yl(this)?function dse(e,t){return jx(e),lf.withValue(e,_se,[e,t]),function fse(e,t){if("function"==typeof e.subscribe)try{y2(e),e.unsubscribe=e.subscribe.apply(null,t)}catch{return e.setDirty(),!1}return!0}(e,t)&&function hse(e){e.dirty=!1,!Yl(e)&&Hx(e)}(e),Ox(e.value)}(this,n):Ox(this.value)}setDirty(){this.dirty||(this.dirty=!0,Fx(this),y2(this))}dispose(){this.setDirty(),jx(this),c3(this,(n,r)=>{n.setDirty(),Gx(n,this)})}forget(){this.dispose()}dependOn(n){n.add(this),this.deps||(this.deps=cf.pop()||new Set),this.deps.add(n)}forgetDeps(){this.deps&&(l3(this.deps).forEach(n=>n.delete(this)),this.deps.clear(),cf.push(this.deps),this.deps=null)}}return e.count=0,e})();function Bx(e){const t=lf.getValue();if(t)return e.parents.add(t),t.childValues.has(e)||t.childValues.set(e,[]),Yl(e)?Ux(t,e):Vx(t,e),t}function _se(e,t){e.recomputing=!0;const{normalizeResult:n}=e;let r;n&&1===e.value.length&&(r=Px(e.value)),e.value.length=0;try{if(e.value[0]=e.fn.apply(null,t),n&&r&&!Rx(r,e.value))try{e.value[0]=n(e.value[0],r[0])}catch{}}catch(o){e.value[1]=o}e.recomputing=!1}function Yl(e){return e.dirty||!(!e.dirtyChildren||!e.dirtyChildren.size)}function Fx(e){c3(e,Ux)}function Hx(e){c3(e,Vx)}function c3(e,t){const n=e.parents.size;if(n){const r=l3(e.parents);for(let o=0;o<n;++o)t(r[o],e)}}function Ux(e,t){Md(e.childValues.has(t)),Md(Yl(t));const n=!Yl(e);if(e.dirtyChildren){if(e.dirtyChildren.has(t))return}else e.dirtyChildren=cf.pop()||new Set;e.dirtyChildren.add(t),n&&Fx(e)}function Vx(e,t){Md(e.childValues.has(t)),Md(!Yl(t));const n=e.childValues.get(t);0===n.length?e.childValues.set(t,Px(t.value)):Rx(n,t.value)||e.setDirty(),zx(e,t),!Yl(e)&&Hx(e)}function zx(e,t){const n=e.dirtyChildren;n&&(n.delete(t),0===n.size&&(cf.length<100&&cf.push(n),e.dirtyChildren=null))}function jx(e){e.childValues.size>0&&e.childValues.forEach((t,n)=>{Gx(e,n)}),e.forgetDeps(),Md(null===e.dirtyChildren)}function Gx(e,t){t.parents.delete(e),e.childValues.delete(t),zx(e,t)}const pse={setDirty:!0,dispose:!0,forget:!0};function $x(e){const t=new Map,n=e&&e.subscribe;function r(o){const i=lf.getValue();if(i){let s=t.get(o);s||t.set(o,s=new Set),i.dependOn(s),"function"==typeof n&&(y2(s),s.unsubscribe=n(o))}}return r.dirty=function(i,s){const a=t.get(i);if(a){const l=s&&lse.call(pse,s)?s:"setDirty";l3(a).forEach(c=>c[l]()),t.delete(i),y2(a)}},r}let Wx;function Zx(...e){return(Wx||(Wx=new sa("function"==typeof WeakMap))).lookupArray(e)}const u3=new Set;function uf(e,{max:t=Math.pow(2,16),keyArgs:n,makeCacheKey:r=Zx,normalizeResult:o,subscribe:i,cache:s=t3}=Object.create(null)){const a="function"==typeof s?new s(t,f=>f.dispose()):s,l=function(){const f=r.apply(null,n?n.apply(null,arguments):arguments);if(void 0===f)return e.apply(null,arguments);let y=a.get(f);y||(a.set(f,y=new use(e)),y.normalizeResult=o,y.subscribe=i,y.forget=()=>a.delete(f));const R=y.recompute(Array.prototype.slice.call(arguments));return a.set(f,y),u3.add(a),lf.hasValue()||(u3.forEach(Z=>Z.clean()),u3.clear()),R};function c(f){const y=f&&a.get(f);y&&y.setDirty()}function u(f){const y=f&&a.get(f);if(y)return y.peek()}function d(f){return!!f&&a.delete(f)}return Object.defineProperty(l,"size",{get:()=>a.size,configurable:!1,enumerable:!1}),Object.freeze(l.options={max:t,keyArgs:n,makeCacheKey:r,normalizeResult:o,subscribe:i,cache:a}),l.dirtyKey=c,l.dirty=function(){c(r.apply(null,arguments))},l.peekKey=u,l.peek=function(){return u(r.apply(null,arguments))},l.forgetKey=d,l.forget=function(){return d(r.apply(null,arguments))},l.makeCacheKey=r,l.getKey=n?function(){return r.apply(null,n.apply(null,arguments))}:r,Object.freeze(l)}function gse(e){return e}class Ua{transform;cached;resultCache=new WeakSet;getCacheKey(t){return[t]}static identity(){return new Ua(gse,{cache:!1})}static split(t,n,r=Ua.identity()){return Object.assign(new Ua(o=>(t(o)?n:r).transformDocument(o),{cache:!1}),{left:n,right:r})}constructor(t,n={}){this.transform=t,n.getCacheKey&&(this.getCacheKey=n.getCacheKey),this.cached=!1!==n.cache,this.resetCache()}resetCache(){if(this.cached){const t=new sa;this.performWork=uf(Ua.prototype.performWork.bind(this),{makeCacheKey:n=>{const r=this.getCacheKey(n);if(r)return Ot(Array.isArray(r),20),t.lookupArray(r)},max:Fa["documentTransform.cache"],cache:v2})}}performWork(t){return ql(t),this.transform(t)}transformDocument(t){if(this.resultCache.has(t))return t;const n=this.performWork(t);return this.resultCache.add(n),n}concat(t){return Object.assign(new Ua(n=>t.transformDocument(this.transformDocument(n)),{cache:!1}),{left:this,right:t})}left;right}const qx={kind:Dt.FIELD,name:{kind:Dt.NAME,value:"__typename"}},d3=Object.assign(function(e){return ia(e,{SelectionSet:{enter(t,n,r){if(r&&r.kind===Dt.OPERATION_DEFINITION)return;const{selections:o}=t;return o&&!o.some(a=>a.kind===Dt.FIELD&&("__typename"===a.name.value||0===a.name.value.lastIndexOf("__",0)))?r.kind===Dt.FIELD&&r.directives&&r.directives.some(a=>"export"===a.name.value)?void 0:{...t,selections:[...o,qx]}:void 0}}})},{added:e=>e===qx}),Va=Object.assign(function(t){return JSON.stringify(t,Tse)},{reset(){Nd=new Xie(Fa.canonicalStringify||1e3)}});let Nd;function Tse(e,t){if(t&&"object"==typeof t){const n=Object.getPrototypeOf(t);if(n===Object.prototype||null===n){const r=Object.keys(t);if(r.every(Ese))return t;const o=JSON.stringify(r);let i=Nd.get(o);if(!i){r.sort();const a=JSON.stringify(r);i=Nd.get(a)||r,Nd.set(o,i),Nd.set(a,i)}const s=Object.create(n);return i.forEach(a=>{s[a]=t[a]}),s}}return t}function Ese(e,t,n){return 0===t||n[t-1]<=e}function p3(e){return 9===e||32===e}function df(e){return e>=48&&e<=57}function Qx(e){return e>=97&&e<=122||e>=65&&e<=90}function Jx(e){return Qx(e)||95===e}function Ise(e){return Qx(e)||df(e)||95===e}function Ase(e){var t;let n=Number.MAX_SAFE_INTEGER,r=null,o=-1;for(let s=0;s<e.length;++s){var i;const a=e[s],l=Sse(a);l!==a.length&&(r=null!==(i=r)&&void 0!==i?i:s,o=s,0!==s&&l<n&&(n=l))}return e.map((s,a)=>0===a?s:s.slice(n)).slice(null!==(t=r)&&void 0!==t?t:0,o+1)}function Sse(e){let t=0;for(;t<e.length&&p3(e.charCodeAt(t));)++t;return t}Va.reset();const Lse=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function xse(e){return Mse[e.charCodeAt(0)]}const Mse=["\\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 b2(e){return ia(e,kse)}const kse={Name:{leave:e=>e.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>Vt(e.definitions,"\n\n")},OperationDefinition:{leave(e){const t=g3(e.variableDefinitions)?bn("(\n",Vt(e.variableDefinitions,"\n"),"\n)"):bn("(",Vt(e.variableDefinitions,", "),")"),n=bn("",e.description,"\n")+Vt([e.operation,Vt([e.name,t]),Vt(e.directives," ")]," ");return("query"===n?"":n+" ")+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:n,directives:r,description:o})=>bn("",o,"\n")+e+": "+t+bn(" = ",n)+bn(" ",Vt(r," "))},SelectionSet:{leave:({selections:e})=>Os(e)},Field:{leave({alias:e,name:t,arguments:n,directives:r,selectionSet:o}){const i=bn("",e,": ")+t;let s=i+bn("(",Vt(n,", "),")");return s.length>80&&(s=i+bn("(\n",T2(Vt(n,"\n")),"\n)")),Vt([s,Vt(r," "),o]," ")}},Argument:{leave:({name:e,value:t})=>e+": "+t},FragmentSpread:{leave:({name:e,directives:t})=>"..."+e+bn(" ",Vt(t," "))},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:n})=>Vt(["...",bn("on ",e),Vt(t," "),n]," ")},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:n,directives:r,selectionSet:o,description:i})=>bn("",i,"\n")+`fragment ${e}${bn("(",Vt(n,", "),")")} on ${t} ${bn("",Vt(r," ")," ")}`+o},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>t?function wse(e,t){const n=e.replace(/"""/g,'\\"""'),r=n.split(/\r\n|[\n\r]/g),o=1===r.length,i=r.length>1&&r.slice(1).every(y=>0===y.length||p3(y.charCodeAt(0))),s=n.endsWith('\\"""'),a=e.endsWith('"')&&!s,l=e.endsWith("\\"),c=a||l,u=!(null!=t&&t.minimize)&&(!o||e.length>70||c||i||s);let d="";const f=o&&p3(e.charCodeAt(0));return(u&&!f||i)&&(d+="\n"),d+=n,(u||c)&&(d+="\n"),'"""'+d+'"""'}(e):function Dse(e){return`"${e.replace(Lse,xse)}"`}(e)},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>"["+Vt(e,", ")+"]"},ObjectValue:{leave:({fields:e})=>"{"+Vt(e,", ")+"}"},ObjectField:{leave:({name:e,value:t})=>e+": "+t},Directive:{leave:({name:e,arguments:t})=>"@"+e+bn("(",Vt(t,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({description:e,directives:t,operationTypes:n})=>bn("",e,"\n")+Vt(["schema",Vt(t," "),Os(n)]," ")},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+": "+t},ScalarTypeDefinition:{leave:({description:e,name:t,directives:n})=>bn("",e,"\n")+Vt(["scalar",t,Vt(n," ")]," ")},ObjectTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:o})=>bn("",e,"\n")+Vt(["type",t,bn("implements ",Vt(n," & ")),Vt(r," "),Os(o)]," ")},FieldDefinition:{leave:({description:e,name:t,arguments:n,type:r,directives:o})=>bn("",e,"\n")+t+(g3(n)?bn("(\n",T2(Vt(n,"\n")),"\n)"):bn("(",Vt(n,", "),")"))+": "+r+bn(" ",Vt(o," "))},InputValueDefinition:{leave:({description:e,name:t,type:n,defaultValue:r,directives:o})=>bn("",e,"\n")+Vt([t+": "+n,bn("= ",r),Vt(o," ")]," ")},InterfaceTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:o})=>bn("",e,"\n")+Vt(["interface",t,bn("implements ",Vt(n," & ")),Vt(r," "),Os(o)]," ")},UnionTypeDefinition:{leave:({description:e,name:t,directives:n,types:r})=>bn("",e,"\n")+Vt(["union",t,Vt(n," "),bn("= ",Vt(r," | "))]," ")},EnumTypeDefinition:{leave:({description:e,name:t,directives:n,values:r})=>bn("",e,"\n")+Vt(["enum",t,Vt(n," "),Os(r)]," ")},EnumValueDefinition:{leave:({description:e,name:t,directives:n})=>bn("",e,"\n")+Vt([t,Vt(n," ")]," ")},InputObjectTypeDefinition:{leave:({description:e,name:t,directives:n,fields:r})=>bn("",e,"\n")+Vt(["input",t,Vt(n," "),Os(r)]," ")},DirectiveDefinition:{leave:({description:e,name:t,arguments:n,repeatable:r,locations:o})=>bn("",e,"\n")+"directive @"+t+(g3(n)?bn("(\n",T2(Vt(n,"\n")),"\n)"):bn("(",Vt(n,", "),")"))+(r?" repeatable":"")+" on "+Vt(o," | ")},SchemaExtension:{leave:({directives:e,operationTypes:t})=>Vt(["extend schema",Vt(e," "),Os(t)]," ")},ScalarTypeExtension:{leave:({name:e,directives:t})=>Vt(["extend scalar",e,Vt(t," ")]," ")},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>Vt(["extend type",e,bn("implements ",Vt(t," & ")),Vt(n," "),Os(r)]," ")},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>Vt(["extend interface",e,bn("implements ",Vt(t," & ")),Vt(n," "),Os(r)]," ")},UnionTypeExtension:{leave:({name:e,directives:t,types:n})=>Vt(["extend union",e,Vt(t," "),bn("= ",Vt(n," | "))]," ")},EnumTypeExtension:{leave:({name:e,directives:t,values:n})=>Vt(["extend enum",e,Vt(t," "),Os(n)]," ")},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:n})=>Vt(["extend input",e,Vt(t," "),Os(n)]," ")},TypeCoordinate:{leave:({name:e})=>e},MemberCoordinate:{leave:({name:e,memberName:t})=>Vt([e,bn(".",t)])},ArgumentCoordinate:{leave:({name:e,fieldName:t,argumentName:n})=>Vt([e,bn(".",t),bn("(",n,":)")])},DirectiveCoordinate:{leave:({name:e})=>Vt(["@",e])},DirectiveArgumentCoordinate:{leave:({name:e,argumentName:t})=>Vt(["@",e,bn("(",t,":)")])}};function Vt(e,t=""){var n;return null!==(n=e?.filter(r=>r).join(t))&&void 0!==n?n:""}function Os(e){return bn("{\n",T2(Vt(e,"\n")),"\n}")}function bn(e,t,n=""){return null!=t&&""!==t?e+t+n:""}function T2(e){return bn(" ",e.replace(/\n/g,"\n "))}function g3(e){var t;return null!==(t=e?.some(n=>n.includes("\n")))&&void 0!==t&&t}let _f;const hf=Object.assign(e=>{let t=_f.get(e);return t||(t=b2(e),_f.set(e,t)),t},{reset(){_f=new r3(Fa.print||2e3)}});function lr(e){return!(!e||"object"!=typeof e||"string"!=typeof e.__ref)}hf.reset();const v3={now:()=>(v3.delegate||Date).now(),delegate:void 0};class C3 extends Kn{constructor(t=1/0,n=1/0,r=v3){super(),this._bufferSize=t,this._windowTime=n,this._timestampProvider=r,this._buffer=[],this._infiniteTimeWindow=!0,this._infiniteTimeWindow=n===1/0,this._bufferSize=Math.max(1,t),this._windowTime=Math.max(1,n)}next(t){const{isStopped:n,_buffer:r,_infiniteTimeWindow:o,_timestampProvider:i,_windowTime:s}=this;n||(r.push(t),!o&&r.push(i.now()+s)),this._trimBuffer(),super.next(t)}_subscribe(t){this._throwIfClosed(),this._trimBuffer();const n=this._innerSubscribe(t),{_infiniteTimeWindow:r,_buffer:o}=this,i=o.slice();for(let s=0;s<i.length&&!t.closed;s+=r?1:2)t.next(i[s]);return this._checkFinalizedStatuses(t),n}_trimBuffer(){const{_bufferSize:t,_timestampProvider:n,_buffer:r,_infiniteTimeWindow:o}=this,i=(o?1:2)*t;if(t<1/0&&i<r.length&&r.splice(0,r.length-i),!o){const s=n.now();let a=0;for(let l=1;l<r.length&&r[l]<=s;l+=2)a=l;a&&r.splice(0,a+1)}}}function ff(e={}){const{connector:t=()=>new Kn,resetOnError:n=!0,resetOnComplete:r=!0,resetOnRefCountZero:o=!0}=e;return i=>{let s,a,l,c=0,u=!1,d=!1;const f=()=>{a?.unsubscribe(),a=void 0},y=()=>{f(),s=l=void 0,u=d=!1},R=()=>{const Z=s;y(),Z?.unsubscribe()};return Ni((Z,X)=>{c++,!d&&!u&&f();const ae=l=l??t();X.add(()=>{c--,0===c&&!d&&!u&&(a=y3(R,o))}),ae.subscribe(X),!s&&c>0&&(s=new xn({next:_e=>ae.next(_e),error:_e=>{d=!0,f(),a=y3(y,n,_e),ae.error(_e)},complete:()=>{u=!0,f(),a=y3(y,r),ae.complete()}}),fs(Z).subscribe(s))})(i)}}function y3(e,t,...n){if(!0===t)return void e();if(!1===t)return;const r=new xn({next:()=>{r.unsubscribe(),e()}});return fs(t(...n)).subscribe(r)}function E2(e,t,n){let r,o=!1;return e&&"object"==typeof e?({bufferSize:r=1/0,windowTime:t=1/0,refCount:o=!1,scheduler:n}=e):r=e??1/0,ff({connector:()=>new C3(r,t,n),resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:o})}function Fse(e,t){return e===t}class Hse extends Y{constructor(t,n){super()}schedule(t,n=0){return this}}const I2={setInterval(e,t,...n){const{delegate:r}=I2;return r?.setInterval?r.setInterval(e,t,...n):setInterval(e,t,...n)},clearInterval(e){const{delegate:t}=I2;return(t?.clearInterval||clearInterval)(e)},delegate:void 0};class eM extends Hse{constructor(t,n){super(t,n),this.scheduler=t,this.work=n,this.pending=!1}schedule(t,n=0){var r;if(this.closed)return this;this.state=t;const o=this.id,i=this.scheduler;return null!=o&&(this.id=this.recycleAsyncId(i,o,n)),this.pending=!0,this.delay=n,this.id=null!==(r=this.id)&&void 0!==r?r:this.requestAsyncId(i,this.id,n),this}requestAsyncId(t,n,r=0){return I2.setInterval(t.flush.bind(t,this),r)}recycleAsyncId(t,n,r=0){if(null!=r&&this.delay===r&&!1===this.pending)return n;null!=n&&I2.clearInterval(n)}execute(t,n){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;const r=this._execute(t,n);if(r)return r;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))}_execute(t,n){let o,r=!1;try{this.work(t)}catch(i){r=!0,o=i||new Error("Scheduled action threw falsy error")}if(r)return this.unsubscribe(),o}unsubscribe(){if(!this.closed){const{id:t,scheduler:n}=this,{actions:r}=n;this.work=this.state=this.scheduler=null,this.pending=!1,an(r,this),null!=t&&(this.id=this.recycleAsyncId(n,t,null)),this.delay=null,super.unsubscribe()}}}class pf{constructor(t,n=pf.now){this.schedulerActionCtor=t,this.now=n}schedule(t,n=0,r){return new this.schedulerActionCtor(this,t).schedule(r,n)}}pf.now=v3.now;class tM extends pf{constructor(t,n=pf.now){super(t,n),this.actions=[],this._active=!1}flush(t){const{actions:n}=this;if(this._active)return void n.push(t);let r;this._active=!0;do{if(r=t.execute(t.state,t.delay))break}while(t=n.shift());if(this._active=!1,r){for(;t=n.shift();)t.unsubscribe();throw r}}}const Use=new tM(eM);const rM=Ax(function(t,n,r){return function jse(e,t){let n,r;function o(i){return i!==n&&(n=i,r=t(n)),r}return Object.assign(e.pipe(dr(o),E2({bufferSize:1,refCount:!0})),{getCurrentResult:()=>o(e.getCurrentResult())})}(t,r)},{max:1,makeCacheKey:e=>e.slice(0,2)});function gf(e=[]){const t={};return e.forEach(n=>{t[n.name.value]=n}),t}function mf(e){return e.definitions.filter(t=>"FragmentDefinition"===t.kind)}function A2(e,t){switch(e.kind){case"InlineFragment":return e;case"FragmentSpread":{const n=e.name.value;if("function"==typeof t)return t(n);const r=t&&t[n];return Ot(r,9,n),r||null}default:return null}}function b3(e){let t;ql(e);for(let n of e.definitions){if("OperationDefinition"===n.kind)return n;"FragmentDefinition"===n.kind&&!t&&(t=n)}if(t)return t;throw es(12)}function vf(e){return"Field"===e.kind}function ou(e){return e.alias?e.alias.value:e.name.value}function S2({directives:e},t){return!e||!e.length||function Wse(e){const t=[];return e&&e.length&&e.forEach(n=>{if(!function $se({name:{value:e}}){return"skip"===e||"include"===e}(n))return;const r=n.arguments,o=n.name.value;Ot(r&&1===r.length,16,o);const i=r[0];Ot(i.name&&"if"===i.name.value,17,o);const s=i.value;Ot(s&&("Variable"===s.kind||"BooleanValue"===s.kind),18,o),t.push({directive:n,ifArgument:i})}),t}(e).every(({directive:n,ifArgument:r})=>{let o=!1;return"Variable"===r.value.kind?(o=t&&t[r.value.name.value],Ot(void 0!==o,15,n.name.value)):o=r.value.value,"skip"===n.name.value?!o:o})}function oM(e,{data:t,...n},{data:r,...o},i){return $r(n,o)&&w2(b3(e).selectionSet,t,r,{fragmentMap:gf(mf(e)),variables:i})}function w2(e,t,n,r){if(t===n)return!0;const o=new Set;return e.selections.every(i=>{if(o.has(i)||(o.add(i),!S2(i,r.variables))||iM(i))return!0;if(vf(i)){const s=ou(i),a=t&&t[s],l=n&&n[s],c=i.selectionSet;if(!c)return $r(a,l);const u=Array.isArray(a),d=Array.isArray(l);if(u!==d)return!1;if(u&&d){const f=a.length;if(l.length!==f)return!1;for(let y=0;y<f;++y)if(!w2(c,a[y],l[y],r))return!1;return!0}return w2(c,a,l,r)}{const s=A2(i,r.fragmentMap);if(s)return!!iM(s)||w2(s.selectionSet,t,n,r)}})}function iM(e){return!!e.directives&&e.directives.some(Zse)}function Zse(e){return"nonreactive"===e.name.value}function qse(e,t){let n=t;const r=[];return e.definitions.forEach(i=>{if("OperationDefinition"===i.kind)throw es(10,i.operation,i.name?` named '${i.name.value}'`:"");"FragmentDefinition"===i.kind&&r.push(i)}),typeof n>"u"&&(Ot(1===r.length,11,r.length),n=r[0].name.value),{...e,definitions:[{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:n}}]}},...e.definitions]}}function Yse(...e){return Zx.bind(null,...e)}class sM{assumeImmutableResults=!1;lookupFragment(t){return null}batch(t){let r;return this.performTransaction(()=>r=t.update(this),"string"==typeof t.optimistic?t.optimistic:!1===t.optimistic?null:void 0),r}recordOptimisticTransaction(t,n){this.performTransaction(t,n)}transformDocument(t){return t}transformForLink(t){return t}identify(t){}gc(){return[]}modify(t){return!1}readQuery(t,n=!!t.optimistic){return this.read({...t,rootId:t.id||"ROOT_QUERY",optimistic:n})}fragmentWatches=new sa(!0);watchFragment(t){const{fragment:n,fragmentName:r,from:o}=t,i=this.getFragmentDoc(n,r),a=(Array.isArray(o)?o:[o]).map(y=>null==y?y:this.toCacheId(y));if(!Array.isArray(o)){const y=this.watchSingleFragment(a[0],i,t);return null===o?y:rM(y,Symbol.for("apollo.transform.individualResult"),R=>({...R,data:R.data??{}}))}let l;function c(y){const R=y.reduce((Z,X,ae)=>(Z.data.push(X.data),Z.complete&&=X.complete,Z.dataState=Z.complete?"complete":"partial",X.missing&&(Z.missing||={},Z.missing[ae]=X.missing),Z),{data:[],dataState:"complete",complete:!0});return $r(l,R)||(l=R),l}if(0===a.length)return Xse;let u=!1;const d=a.map(y=>this.watchSingleFragment(y,i,t)),f=function Gse(e){return 0===e.length?Wl:new Lt(t=>{const{length:n}=e,r=new Array(n),o=new Map;e.forEach((l,c)=>{o.has(l)||o.set(l,new Set),o.get(l).add(c)});let a,i=o.size,s=o.size;o.forEach((l,c)=>{let u=!1;const d=c.subscribe({next:f=>{l.forEach(y=>r[y]=f),u||(u=!0,s--),s||(a||=new Set(e.filter(y=>y.dirty)),a.delete(c),a.size||(t.next(r.slice()),a=void 0))},complete:()=>{i--,i||t.complete()},error:t.error.bind(t)});t.add(d)})})}(d).pipe(dr(c),Kc({subscribe:()=>u=!0,unsubscribe:()=>u=!1}),E2({bufferSize:1,refCount:!0}));return Object.assign(f,{getCurrentResult:()=>u&&l?l:c(d.map(R=>R.getCurrentResult()))})}onAfterBroadcast=t=>t();watchSingleFragment(t,n,r){if(null===t)return Kse;const{optimistic:o=!0,variables:i}=r,s=[n,Va({id:t,optimistic:o,variables:i})],a=this.fragmentWatches.lookupArray(s);if(!a.observable){let c,u=function(f){const y=f.result;return(!c||!oM(n,{data:c.data},{data:y},r.variables))&&(c={data:y,dataState:f.complete?"complete":"partial",complete:f.complete},f.missing&&(c.missing=f.missing.missing)),c},l=!1;const d=new Lt(f=>{l=!0;const y=this.watch({variables:i,returnPartialData:!0,id:t,query:n,optimistic:o,immediate:!0,callback:R=>{d.dirty=!0,this.onAfterBroadcast(()=>{f.next(u(R)),d.dirty=!1})}});return()=>{l=!1,y(),this.fragmentWatches.removeArray(s)}}).pipe(function Bse(e,t=ht){return e=e??Fse,Ni((n,r)=>{let o,i=!0;n.subscribe($i(r,s=>{const a=t(s);(i||!e(o,a))&&(i=!1,o=a,r.next(s))}))})}(),ff({connector:()=>new C3(1),resetOnRefCountZero:()=>function zse(e=0,t,n=Use){let r=-1;return null!=t&&(iw(t)?n=t:r=t),new Lt(o=>{let i=function Vse(e){return e instanceof Date&&!isNaN(e)}(e)?+e-n.now():e;i<0&&(i=0);let s=0;return n.schedule(function(){o.closed||(o.next(s++),0<=r?this.schedule(void 0,r):o.complete())},i)})}(0)}));a.observable=Object.assign(d,{dirty:!1,getCurrentResult:()=>l&&c?c:u(this.diff({id:t,query:n,returnPartialData:!0,optimistic:o,variables:i}))})}return a.observable}getFragmentDoc=uf(qse,{max:Fa["cache.fragmentQueryDocuments"]||1e3,cache:v2,makeCacheKey:Yse(this)});readFragment(t,n=!!t.optimistic){const r=void 0!==t.from?this.toCacheId(t.from):t.id;return this.read({...t,query:this.getFragmentDoc(t.fragment,t.fragmentName),rootId:r,optimistic:n})}writeQuery({id:t,data:n,...r}){return this.write(Object.assign(r,{dataId:t||"ROOT_QUERY",result:n}))}writeFragment({data:t,fragment:n,fragmentName:r,...o}){const i=void 0!==o.from?this.toCacheId(o.from):o.id;return this.write(Object.assign(o,{query:this.getFragmentDoc(n,r),dataId:i,result:t}))}updateQuery(t,n){return this.batch({update(r){const o=r.readQuery(t),i=n(o);return null==i?o:(r.writeQuery({...t,data:i}),i)}})}updateFragment(t,n){return this.batch({update(r){const o=r.readFragment(t),i=n(o);return null==i?o:(r.writeFragment({...t,data:i}),i)}})}toCacheId(t){return"string"==typeof t?t:this.identify(t)}}const aM=Object.freeze({data:null,dataState:"complete",complete:!0}),Kse=Object.assign(new Lt(e=>{e.next(aM)}),{dirty:!1,getCurrentResult:()=>aM}),lM=Object.freeze({data:[],dataState:"complete",complete:!0}),Xse=Object.assign(new Lt(e=>{e.next(lM)}),{getCurrentResult:()=>lM});function di(e){return null!==e&&"object"==typeof e}const{hasOwnProperty:Qse}=Object.prototype,Jse=function(e,t,n){return this.merge(e[n],t[n])},cM=e=>isNaN(+e)?{}:[];class kd{options;reconciler;constructor(t={}){this.options=t,this.reconciler=t.reconciler||Jse}merge(t,n,r={}){const o=r.atPath;if(o?.length){const[i,...s]=o;void 0===t&&(t=cM(i));let a=t[i];void 0===a&&s.length&&(a=cM(s[0]));const l=this.merge(a,n,{...r,atPath:s});return a!==l&&((t=this.shallowCopyForMerge(t))[i]=l),t}return Array.isArray(t)&&Array.isArray(n)&&"truncate"===this.options.arrayMerge&&t.length>n.length&&(t=t.slice(0,n.length),this.pastCopies.add(t)),di(n)&&di(t)?(Object.keys(n).forEach(i=>{if(Qse.call(t,i)){const s=t[i];if(n[i]!==s){const a=this.reconciler(t,n,i);a!==s&&((t=this.shallowCopyForMerge(t))[i]=a)}}else(t=this.shallowCopyForMerge(t))[i]=n[i]}),t):n}isObject=di;pastCopies=new Set;shallowCopyForMerge(t){return di(t)&&(this.pastCopies.has(t)||(t=Array.isArray(t)?t.slice(0):{__proto__:Object.getPrototypeOf(t),...t},this.pastCopies.add(t))),t}}function Rd(e){return{__ref:String(e)}}function iu(...e){const t={};return e.forEach(n=>{n&&Reflect.ownKeys(n).forEach(r=>{const o=n[r];void 0!==o&&(t[r]=o)})}),t}const go=Array.isArray,{hasOwnProperty:zo}=Object.prototype;function uM({__typename:e,id:t,_id:n},r){if("string"==typeof e&&(r&&(r.keyObject=null!=t?{id:t}:null!=n?{_id:n}:void 0),null==t&&null!=n&&(t=n),null!=t))return`${e}:${"number"==typeof t||"string"==typeof t?t:JSON.stringify(t)}`}const nae={dataIdFromObject:uM,resultCaching:!0},dM=/^[_a-z][_0-9a-z]*/i;function Xl(e){const t=e.match(dM);return t?t[0]:e}function T3(e,t,n){return!!di(t)&&(go(t)?t.every(r=>T3(e,r,n)):e.selections.every(r=>{if(vf(r)&&S2(r,n)){const o=ou(r);return zo.call(t,o)&&(!r.selectionSet||T3(r.selectionSet,t[o],n))}return!0}))}function Od(e){return di(e)&&!lr(e)&&!go(e)}function _M(e,t){const n=gf(mf(e));return{fragmentMap:n,lookupFragment(r){let o=n[r];return!o&&t&&(o=t.lookup(r)),o||null}}}const L2={},E3=()=>L2,hM={};class x2{policies;group;data={};constructor(t,n){this.policies=t,this.group=n}toObject(){return{...this.data}}has(t){return void 0!==this.lookup(t,!0)}get(t,n){if(this.group.depend(t,n),zo.call(this.data,t)){const r=this.data[t];if(r&&zo.call(r,n))return r[n]}return"__typename"===n&&zo.call(this.policies.rootTypenamesById,t)?this.policies.rootTypenamesById[t]:this instanceof aa?this.parent.get(t,n):void 0}lookup(t,n){return n&&this.group.depend(t,"__exists"),zo.call(this.data,t)?this.data[t]:this instanceof aa?this.parent.lookup(t,n):this.policies.rootTypenamesById[t]?{}:void 0}merge(t,n){let r;lr(t)&&(t=t.__ref),lr(n)&&(n=n.__ref);const o="string"==typeof t?this.lookup(r=t):t,i="string"==typeof n?this.lookup(r=n):n;if(!i)return;Ot("string"==typeof r,99);const s=new kd({reconciler:lae}).merge(o,i);if(this.data[r]=s,s!==o&&(delete this.refs[r],this.group.caching)){const a={};o||(a.__exists=1),Object.keys(i).forEach(l=>{if(!o||o[l]!==s[l]){a[l]=1;const c=Xl(l);c!==l&&!this.policies.hasKeyArgs(s.__typename,c)&&(a[c]=1),void 0===s[l]&&!(this instanceof aa)&&delete s[l]}}),a.__typename&&!(o&&o.__typename)&&this.policies.rootTypenamesById[r]===s.__typename&&delete a.__typename,Object.keys(a).forEach(l=>this.group.dirty(r,l))}}modify(t,n,r){const o=this.lookup(t);if(o){const i={};let s=!1,a=!0;const l={DELETE:L2,INVALIDATE:hM,isReference:lr,toReference:this.toReference,canRead:this.canRead,readField:(c,u)=>this.policies.readField("string"==typeof c?{fieldName:c,from:u||Rd(t)}:c,{store:this})};if(Object.keys(o).forEach(c=>{const u=Xl(c);let d=o[c];if(void 0===d)return;const f="function"==typeof n?n:n[c]||(r?void 0:n[u]);if(f){let y=f===E3?L2:f(d,{...l,fieldName:u,storeFieldName:c,storage:this.getStorage(t,c)});if(y===hM)this.group.dirty(t,c);else if(y===L2&&(y=void 0),y!==d&&(i[c]=y,s=!0,d=y,false)){const R=Z=>{if(void 0===this.lookup(Z.__ref))return!0};if(lr(y))R(y);else if(Array.isArray(y)){let X,Z=!1;for(const ae of y){if(lr(ae)){if(Z=!0,R(ae))break}else if("object"==typeof ae&&ae){const[_e]=this.policies.identify(ae);_e&&(X=ae)}if(Z&&void 0!==X)break}}}}void 0!==d&&(a=!1)}),s)return this.merge(t,i),a&&(this instanceof aa?this.data[t]=void 0:delete this.data[t],this.group.dirty(t,"__exists")),!0}return!1}delete(t,n,r){const o=this.lookup(t);if(o){const i=this.getFieldValue(o,"__typename"),s=n&&r?this.policies.getStoreFieldName({typename:i,fieldName:n,args:r}):n;return this.modify(t,s?{[s]:E3}:E3,!!r)}return!1}evict(t,n){let r=!1;return t.id&&(zo.call(this.data,t.id)&&(r=this.delete(t.id,t.fieldName,t.args)),this instanceof aa&&this!==n&&(r=this.parent.evict(t,n)||r),(t.fieldName||r)&&this.group.dirty(t.id,t.fieldName||"__exists")),r}clear(){this.replace(null)}extract(){const t=this.toObject(),n=[];return this.getRootIdSet().forEach(r=>{zo.call(this.policies.rootTypenamesById,r)||n.push(r)}),n.length&&(t.__META={extraRootIds:n.sort()}),t}replace(t){if(Object.keys(this.data).forEach(n=>{t&&zo.call(t,n)||this.delete(n)}),t){const{__META:n,...r}=t;Object.keys(r).forEach(o=>{this.merge(o,r[o])}),n&&n.extraRootIds.forEach(this.retain,this)}}rootIds={};retain(t){return this.rootIds[t]=(this.rootIds[t]||0)+1}release(t){if(this.rootIds[t]>0){const n=--this.rootIds[t];return n||delete this.rootIds[t],n}return 0}getRootIdSet(t=new Set){return Object.keys(this.rootIds).forEach(t.add,t),this instanceof aa?this.parent.getRootIdSet(t):Object.keys(this.policies.rootTypenamesById).forEach(t.add,t),t}gc(){const t=this.getRootIdSet(),n=this.toObject();t.forEach(o=>{zo.call(n,o)&&(Object.keys(this.findChildRefIds(o)).forEach(t.add,t),delete n[o])});const r=Object.keys(n);if(r.length){let o=this;for(;o instanceof aa;)o=o.parent;r.forEach(i=>o.delete(i))}return r}refs={};findChildRefIds(t){if(!zo.call(this.refs,t)){const n=this.refs[t]={},r=this.data[t];if(!r)return n;const o=new Set([r]);o.forEach(i=>{lr(i)&&(n[i.__ref]=!0),di(i)&&Object.keys(i).forEach(s=>{const a=i[s];di(a)&&o.add(a)})})}return this.refs[t]}makeCacheKey(){return this.group.keyMaker.lookupArray(arguments)}getFieldValue=(t,n)=>lr(t)?this.get(t.__ref,n):t&&t[n];canRead=t=>lr(t)?this.has(t.__ref):"object"==typeof t;toReference=(t,n)=>{if("string"==typeof t)return Rd(t);if(lr(t))return t;const[r]=this.policies.identify(t);if(r){const o=Rd(r);return n&&this.merge(r,t),o}};get supportsResultCaching(){return this.group.caching}}class fM{caching;parent;d=null;keyMaker;constructor(t,n=null){this.caching=t,this.parent=n,this.resetCaching()}resetCaching(){this.d=this.caching?$x():null,this.keyMaker=new sa}depend(t,n){if(this.d){this.d(I3(t,n));const r=Xl(n);r!==n&&this.d(I3(t,r)),this.parent&&this.parent.depend(t,n)}}dirty(t,n){this.d&&this.d.dirty(I3(t,n),"__exists"===n?"forget":"setDirty")}}function I3(e,t){return t+"#"+e}function pM(e,t){Cf(e)&&e.group.depend(t,"__exists")}x2.Root=class sae extends x2{constructor({policies:t,resultCaching:n=!0,seed:r}){super(t,new fM(n)),r&&this.replace(r)}stump=new aae(this);addLayer(t,n){return this.stump.addLayer(t,n)}removeLayer(){return this}storageTrie=new sa;getStorage(){return this.storageTrie.lookupArray(arguments)}};class aa extends x2{id;parent;replay;group;constructor(t,n,r,o){super(n.policies,o),this.id=t,this.parent=n,this.replay=r,this.group=o,r(this)}addLayer(t,n){return new aa(t,this,n,this.group)}removeLayer(t){const n=this.parent.removeLayer(t);return t===this.id?(this.group.caching&&Object.keys(this.data).forEach(r=>{const o=this.data[r],i=n.lookup(r);i?o?o!==i&&Object.keys(o).forEach(s=>{$r(o[s],i[s])||this.group.dirty(r,s)}):(this.group.dirty(r,"__exists"),Object.keys(i).forEach(s=>{this.group.dirty(r,s)})):this.delete(r)}),n):n===this.parent?this:n.addLayer(this.id,this.replay)}toObject(){return{...this.parent.toObject(),...this.data}}findChildRefIds(t){const n=this.parent.findChildRefIds(t);return zo.call(this.data,t)?{...n,...super.findChildRefIds(t)}:n}getStorage(...t){let n=this.parent;for(;n.parent;)n=n.parent;return n.getStorage(...t)}}class aae extends aa{constructor(t){super("EntityStore.Stump",t,()=>{},new fM(t.group.caching,t.group))}removeLayer(){return this}merge(t,n){return this.parent.merge(t,n)}}function lae(e,t,n){const r=e[n],o=t[n];return $r(r,o)?r:o}function Cf(e){return!(!e||!e.supportsResultCaching)}const A3=new C2;function cae(e){const t=e.directives?.find(({name:r})=>"unmask"===r.value);if(!t)return"mask";const n=t.arguments?.find(({name:r})=>"mode"===r.value);return n&&"value"in n.value&&"migrate"===n.value.value?"migrate":"unmask"}const gM=Symbol.for("apollo.result.extensions"),Ql=Symbol.for("apollo.result.streamInfo"),uae=Symbol.for("apollo.observableQuery.variablesUnknown");function Pd(e,t,n,r){if(n.kind===Dt.INT||n.kind===Dt.FLOAT)e[t.value]=Number(n.value);else if(n.kind===Dt.BOOLEAN||n.kind===Dt.STRING)e[t.value]=n.value;else if(n.kind===Dt.OBJECT){const o={};n.fields.map(i=>Pd(o,i.name,i.value,r)),e[t.value]=o}else if(n.kind===Dt.VARIABLE)e[t.value]=(r||{})[n.name.value];else if(n.kind===Dt.LIST)e[t.value]=n.values.map(o=>{const i={};return Pd(i,t,o,r),i[t.value]});else if(n.kind===Dt.ENUM)e[t.value]=n.value;else{if(n.kind!==Dt.NULL)throw es(19,t.value,n.kind);e[t.value]=null}}function S3(e,t){if(e.arguments&&e.arguments.length){const n={};return e.arguments.forEach(({name:r,value:o})=>Pd(n,r,o,t)),n}return null}const dae=["connection","include","skip","client","rest","export","nonreactive","stream"];let yf=Va;const mM=Object.assign(function(e,t,n){if(t&&n&&n.connection&&n.connection.key){if(n.connection.filter&&n.connection.filter.length>0){const o=n.connection.filter?n.connection.filter:[];o.sort();const i={};o.forEach(a=>{i[a]=t[a]});const s=yf(i);if("{}"!==s)return`${n.connection.key}(${s})`}return n.connection.key}let r=e;if(t){const o=yf(t);"{}"!==o&&(r+=`(${o})`)}return n&&Object.keys(n).forEach(o=>{-1===dae.indexOf(o)&&(n[o]&&Object.keys(n[o]).length?r+=`@${o}(${yf(n[o])})`:r+=`@${o}`)}),r},{setStringify(e){const t=yf;return yf=e,t}});function w3(e){return Array.isArray(e)&&e.length>0}const vM={};function D3(e){const t=JSON.stringify(e);return vM[t]||(vM[t]={})}function CM(e){const t=D3(e);return t.keyFieldsFn||(t.keyFieldsFn=(n,r)=>{const o=(s,a)=>r.readField(a,s),i=r.keyObject=L3(e,s=>{let a=Bd(r.storeObject,s,o);return void 0===a&&n!==r.storeObject&&zo.call(n,s[0])&&(a=Bd(n,s,TM)),Ot(void 0!==a,102,s.join("."),n),a});return`${r.typename}:${JSON.stringify(i)}`})}function yM(e){const t=D3(e);return t.keyArgsFn||(t.keyArgsFn=(n,{field:r,variables:o,fieldName:i})=>{const s=L3(e,l=>{const c=l[0],u=c.charAt(0);if("@"!==u){if("$"===u){const d=c.slice(1);if(o&&zo.call(o,d)){const f=l.slice(0);return f[0]=d,Bd(o,f)}return}if(n)return Bd(n,l)}else if(r&&w3(r.directives)){const d=c.slice(1),f=r.directives.find(R=>R.name.value===d),y=f&&S3(f,o);return y&&Bd(y,l.slice(1))}}),a=JSON.stringify(s);return(n||"{}"!==a)&&(i+=":"+a),i})}function L3(e,t){const n=new kd;return bM(e).reduce((r,o)=>{let i=t(o);if(void 0!==i){for(let s=o.length-1;s>=0;--s)i={[o[s]]:i};r=n.merge(r,i)}return r},{})}function bM(e){const t=D3(e);if(!t.paths){const n=t.paths=[],r=[];e.forEach((o,i)=>{go(o)?(bM(o).forEach(s=>n.push(r.concat(s))),r.length=0):(r.push(o),go(e[i+1])||(n.push(r.slice(0)),r.length=0))})}return t.paths}function TM(e,t){return e[t]}function Bd(e,t,n){return n=n||TM,EM(t.reduce(function r(o,i){return go(o)?o.map(s=>r(s,i)):o&&n(o,i)},e))}function EM(e){return di(e)?go(e)?e.map(EM):L3(Object.keys(e).sort(),t=>Bd(e,t)):e}const IM=new C2,AM=new WeakMap;function bf(e){let t=AM.get(e);return t||AM.set(e,t={vars:new Set,dep:$x()}),t}function SM(e){bf(e).vars.forEach(t=>t.forgetCache(e))}function fae(e){const t=new Set,n=new Set,r=function(i){if(arguments.length>0){if(e!==i){e=i,t.forEach(a=>{bf(a).dep.dirty(r),function pae(e){e.broadcastWatches&&e.broadcastWatches()}(a)});const s=Array.from(n);n.clear(),s.forEach(a=>a(e))}}else{const s=IM.getValue();s&&(o(s),bf(s).dep(r))}return e};r.onNextChange=i=>(n.add(i),()=>{n.delete(i)});const o=r.attachCache=i=>(t.add(i),bf(i).vars.add(r),r);return r.forgetCache=i=>t.delete(i),r}function x3(e){return void 0!==e.args?e.args:e.field?S3(e.field,e.variables):null}const gae=()=>{},wM=(e,t)=>t.fieldName,DM=(e,t,{mergeObjects:n})=>n(e,t),LM=(e,t)=>t,mae=(e,t,{streamFieldInfo:n,existingData:r})=>{if(!e&&!r)return t;const o=[],i=e??r,s=n?.isLastChunk?t.length:Math.max(i.length,t.length);for(let a=0;a<s;a++)o[a]=void 0===t[a]?i[a]:t[a];return o};class vae{config;typePolicies={};toBeAdded={};supertypeMap=new Map;fuzzySubtypes=new Map;cache;rootIdsByTypename={};rootTypenamesById={};usingPossibleTypes=!1;constructor(t){this.config=t,this.config={dataIdFromObject:uM,...t},this.cache=this.config.cache,this.setRootTypename("Query"),this.setRootTypename("Mutation"),this.setRootTypename("Subscription"),t.possibleTypes&&this.addPossibleTypes(t.possibleTypes),t.typePolicies&&this.addTypePolicies(t.typePolicies)}identify(t,n){const r=this,o=n&&(n.typename||n.storeObject?.__typename)||t.__typename;if(o===this.rootTypenamesById.ROOT_QUERY)return["ROOT_QUERY"];const i=n&&n.storeObject||t,s={...n,typename:o,storeObject:i,readField:n&&n.readField||((...u)=>{const d=M3(u,i);return r.readField(d,{store:r.cache.data,variables:d.variables})})};let a;const l=o&&this.getTypePolicy(o);let c=l&&l.keyFn||this.config.dataIdFromObject;return A3.withValue(!0,()=>{for(;c;){const u=c({...t,...i},s);if(!go(u)){a=u;break}c=CM(u)}}),a=a?String(a):void 0,s.keyObject?[a,s.keyObject]:[a]}addTypePolicies(t){Object.keys(t).forEach(n=>{const{queryType:r,mutationType:o,subscriptionType:i,...s}=t[n];r&&this.setRootTypename("Query",n),o&&this.setRootTypename("Mutation",n),i&&this.setRootTypename("Subscription",n),zo.call(this.toBeAdded,n)?this.toBeAdded[n].push(s):this.toBeAdded[n]=[s]})}updateTypePolicy(t,n,r){const o=this.getTypePolicy(t),{keyFields:i,fields:s}=n;function a(l,c){l.merge="function"==typeof c?c:!0===c?DM:!1===c?LM:l.merge}a(o,n.merge),o.keyFn=!1===i?gae:go(i)?CM(i):"function"==typeof i?i:o.keyFn,s&&Object.keys(s).forEach(l=>{let c=r[l];(!c||c?.typename!==t)&&(c=r[l]={typename:t});const u=s[l];if("function"==typeof u)c.read=u;else{const{keyArgs:d,read:f,merge:y}=u;c.keyFn=!1===d?wM:go(d)?yM(d):"function"==typeof d?d:c.keyFn,"function"==typeof f&&(c.read=f),a(c,y)}c.read&&c.merge&&(c.keyFn=c.keyFn||wM)})}setRootTypename(t,n=t){const r="ROOT_"+t.toUpperCase(),o=this.rootTypenamesById[r];n!==o&&(Ot(!o||o===t,103,t),o&&delete this.rootIdsByTypename[o],this.rootIdsByTypename[n]=r,this.rootTypenamesById[r]=n)}addPossibleTypes(t){this.usingPossibleTypes=!0,Object.keys(t).forEach(n=>{this.getSupertypeSet(n,!0),t[n].forEach(r=>{this.getSupertypeSet(r,!0).add(n);const o=r.match(dM);(!o||o[0]!==r)&&this.fuzzySubtypes.set(r,new RegExp(r))})})}getTypePolicy(t){if(!zo.call(this.typePolicies,t)){const r=this.typePolicies[t]={};r.fields={};let o=this.supertypeMap.get(t);!o&&this.fuzzySubtypes.size&&(o=this.getSupertypeSet(t,!0),this.fuzzySubtypes.forEach((i,s)=>{if(i.test(t)){const a=this.supertypeMap.get(s);a&&a.forEach(l=>o.add(l))}})),o&&o.size&&o.forEach(i=>{const{fields:s,...a}=this.getTypePolicy(i);Object.assign(r,a),Object.assign(r.fields,s)})}const n=this.toBeAdded[t];return n&&n.length&&n.splice(0).forEach(r=>{this.updateTypePolicy(t,r,this.typePolicies[t].fields)}),this.typePolicies[t]}getFieldPolicy(t,n){if(t)return this.getTypePolicy(t).fields[n]}getSupertypeSet(t,n){let r=this.supertypeMap.get(t);return!r&&n&&this.supertypeMap.set(t,r=new Set),r}fragmentMatches(t,n,r,o){if(!t.typeCondition)return!0;if(!n)return!1;const i=t.typeCondition.name.value;if(n===i)return!0;if(this.usingPossibleTypes&&this.supertypeMap.has(i)){const s=this.getSupertypeSet(n,!0),a=[s],l=d=>{const f=this.getSupertypeSet(d,!1);f&&f.size&&a.indexOf(f)<0&&a.push(f)};let c=!(!r||!this.fuzzySubtypes.size),u=!1;for(let d=0;d<a.length;++d){const f=a[d];if(f.has(i))return s.has(i)||s.add(i),!0;f.forEach(l),c&&d===a.length-1&&T3(t.selectionSet,r,o)&&(c=!1,u=!0,this.fuzzySubtypes.forEach((y,R)=>{const Z=n.match(y);Z&&Z[0]===n&&l(R)}))}}return!1}hasKeyArgs(t,n){const r=this.getFieldPolicy(t,n);return!(!r||!r.keyFn)}getStoreFieldName(t){const{typename:n,fieldName:r}=t,o=this.getFieldPolicy(n,r);let i,s=o&&o.keyFn;if(s&&n){const a={typename:n,fieldName:r,field:t.field||null,variables:t.variables},l=x3(t);for(;s;){const c=s(l,a);if(!go(c)){i=c||r;break}s=yM(c)}}return void 0===i&&(i=t.field?function _ae(e,t){let n=null;e.directives&&(n={},e.directives.forEach(o=>{n[o.name.value]={},o.arguments&&o.arguments.forEach(({name:i,value:s})=>Pd(n[o.name.value],i,s,t))}));let r=null;return e.arguments&&e.arguments.length&&(r={},e.arguments.forEach(({name:o,value:i})=>Pd(r,o,i,t))),mM(e.name.value,r,n)}(t.field,t.variables):mM(r,x3(t))),!1===i?r:r===Xl(i)?i:r+":"+i}readField(t,n){const r=t.from;if(!r||!t.field&&!t.fieldName)return;if(void 0===t.typename){const u=n.store.getFieldValue(r,"__typename");u&&(t.typename=u)}const i=this.getStoreFieldName(t),s=Xl(i),a=n.store.getFieldValue(r,i),l=this.getFieldPolicy(t.typename,s),c=l&&l.read;if(c){const u=xM(this,r,t,n,n.store.getStorage(lr(r)?r.__ref:r,i));return IM.withValue(this.cache,c,[a,u])}return a}getReadFunction(t,n){const r=this.getFieldPolicy(t,n);return r&&r.read}getMergeFunction(t,n,r){let o=this.getFieldPolicy(t,n),i=o&&o.merge;return!i&&r&&(o=this.getTypePolicy(r),i=o&&o.merge),i}runMergeFunction(t,n,{field:r,typename:o,merge:i,path:s},a,l){const c=t;if(i===DM)return MM(a.store)(t,n);if(i===LM)return n;a.overwrite&&(t=void 0);const u=a.extensions?.[Ql]?.deref()?.peekArray(s);if(u){const{current:f,previous:y}=u;if(y&&$r(y.incoming,n)&&$r(y.streamFieldInfo,f))return y.result}const d=i(t,n,function Cae(e,t,n,r,o,i){const s={...xM(e,t,n,r,o),extensions:r.extensions,existingData:i},a=r.extensions;if(a&&Ql in a){const{[Ql]:l,...c}=a,u=l?.deref()?.peekArray(n.path);u&&(s.streamFieldInfo=u.current),s.extensions=0===Object.keys(c).length?void 0:c}return s}(this,void 0,{typename:o,fieldName:r.name.value,field:r,variables:a.variables,path:s},a,l||{},c));return u&&(u.previous={incoming:n,streamFieldInfo:u.current,result:d}),d}}function xM(e,t,n,r,o){const i=e.getStoreFieldName(n),s=Xl(i),a=n.variables||r.variables,{toReference:l,canRead:c}=r.store;return{args:x3(n),field:n.field||null,fieldName:s,storeFieldName:i,variables:a,isReference:lr,toReference:l,storage:o,cache:e.cache,canRead:c,readField:(...u)=>e.readField(M3(u,t,a),r),mergeObjects:MM(r.store)}}function M3(e,t,n){const{0:r,1:o,length:i}=e;let s;return"string"==typeof r?s={fieldName:r,from:i>1?o:t}:(s={...r},zo.call(s,"from")||(s.from=t)),void 0===s.variables&&(s.variables=n),s}function MM(e){return function(n,r){if(go(n)||go(r))throw es(106);if(di(n)&&di(r)){const o=e.getFieldValue(n,"__typename"),i=e.getFieldValue(r,"__typename");if(o&&i&&o!==i)return r;if(lr(n)&&Od(r))return e.merge(n.__ref,r),n;if(Od(n)&&lr(r))return e.merge(n,r.__ref),r;if(Od(n)&&Od(r))return{...n,...r}}return r}}function N3(e){const t={},n=e&&e.variableDefinitions;return n&&n.length&&n.forEach(r=>{r.defaultValue&&Pd(t,r.variable.name,r.defaultValue)}),t}function NM(e){const t=Ha(e);return Ot(t&&"query"===t.operation,13),t}function yae(e){let t=e[0]||{};const n=e.length;if(n>1){const r=new kd;for(let o=1;o<n;++o)t=r.merge(t,e[o])}return t}class k3 extends Error{message;path;query;variables;constructor(t,n,r,o){if(super(t),this.message=t,this.path=n,this.query=r,this.variables=o,this.name="MissingFieldError",Array.isArray(this.path)){this.missing=this.message;for(let i=this.path.length-1;i>=0;--i)this.missing={[this.path[i]]:this.missing}}else this.missing=this.path;this.__proto__=k3.prototype}missing}function kM(e){return[e.selectionSet,e.objectOrReference,e.context]}class bae{executeSelectionSet;executeSubSelectedArray;config;knownResults=new WeakMap;constructor(t){this.config=t,this.executeSelectionSet=uf(n=>{const r=kM(n);return this.executeSelectionSet.peek(...r)||(pM(n.context.store,n.enclosingRef.__ref),this.execSelectionSetImpl(n))},{max:Fa["inMemoryCache.executeSelectionSet"]||5e4,keyArgs:kM,makeCacheKey(n,r,o){if(Cf(o.store))return o.store.makeCacheKey(n,lr(r)?r.__ref:r,o.varString)}}),this.executeSubSelectedArray=uf(n=>(pM(n.context.store,n.enclosingRef.__ref),this.execSubSelectedArrayImpl(n)),{max:Fa["inMemoryCache.executeSubSelectedArray"]||1e4,makeCacheKey({field:n,array:r,context:o}){if(Cf(o.store))return o.store.makeCacheKey(n,r,o.varString)}})}diffQueryAgainstStore({store:t,query:n,rootId:r="ROOT_QUERY",variables:o,returnPartialData:i=!0}){const s=this.config.cache.policies;o={...N3(NM(n)),...o};const a=Rd(r),l=this.executeSelectionSet({selectionSet:b3(n).selectionSet,objectOrReference:a,enclosingRef:a,context:{store:t,query:n,policies:s,variables:o,varString:Va(o),..._M(n,this.config.fragments)}});let c;l.missing&&(c=new k3(function Tae(e){try{JSON.stringify(e,(t,n)=>{if("string"==typeof n)throw n;return n})}catch(t){return t}}(l.missing),l.missing,n,o));const u=!c,{result:d}=l;return{result:u?d:i?0===Object.keys(d).length?null:d:null,complete:u,missing:c}}isFresh(t,n,r,o){if(Cf(o.store)&&this.knownResults.get(t)===r){const i=this.executeSelectionSet.peek(r,n,o);if(i&&t===i.result)return!0}return!1}execSelectionSetImpl({selectionSet:t,objectOrReference:n,enclosingRef:r,context:o}){if(lr(n)&&!o.policies.rootTypenamesById[n.__ref]&&!o.store.has(n.__ref))return{result:{},missing:`Dangling reference to missing ${n.__ref} object`};const{variables:i,policies:s,store:a}=o,l=a.getFieldValue(n,"__typename"),c=[];let u;const d=new kd;function f(ae,_e){return ae.missing&&(u=d.merge(u,{[_e]:ae.missing})),ae.result}"string"==typeof l&&!s.rootIdsByTypename[l]&&c.push({__typename:l});const y=new Set(t.selections);y.forEach(ae=>{if(S2(ae,i))if(vf(ae)){let _e=s.readField({fieldName:ae.name.value,field:ae,variables:o.variables,from:n},o);const Ye=ou(ae);void 0===_e?d3.added(ae)||(u=d.merge(u,{[Ye]:`Can't find field '${ae.name.value}' on ${lr(n)?n.__ref+" object":"object "+JSON.stringify(n,null,2)}`})):go(_e)?_e.length>0&&(_e=f(this.executeSubSelectedArray({field:ae,array:_e,enclosingRef:r,context:o}),Ye)):ae.selectionSet&&null!=_e&&(_e=f(this.executeSelectionSet({selectionSet:ae.selectionSet,objectOrReference:_e,enclosingRef:lr(_e)?_e:r,context:o}),Ye)),void 0!==_e&&c.push({[Ye]:_e})}else{const _e=A2(ae,o.lookupFragment);if(!_e&&ae.kind===Dt.FRAGMENT_SPREAD)throw es(107,ae.name.value);_e&&s.fragmentMatches(_e,l)&&_e.selectionSet.selections.forEach(y.add,y)}});const X={result:yae(c),missing:u};return X.result&&this.knownResults.set(X.result,t),X}execSubSelectedArrayImpl({field:t,array:n,enclosingRef:r,context:o}){let i,s=new kd;function a(l,c){return l.missing&&(i=s.merge(i,{[c]:l.missing})),l.result}return t.selectionSet&&(n=n.filter(l=>void 0===l||o.store.canRead(l))),{result:n=n.map((l,c)=>null===l?null:go(l)?a(this.executeSubSelectedArray({field:t,array:l,enclosingRef:r,context:o}),c):t.selectionSet?a(this.executeSelectionSet({selectionSet:t.selectionSet,objectOrReference:l,enclosingRef:lr(l)?l:r,context:o}),c):l),missing:i}}}function Fd(e,t,n){const r=new Set(e),o=r.size;return ia(t,{Directive(i){if(r.delete(i.name.value)&&(!n||!r.size))return Zl}}),n?!r.size:r.size<o}function O3(e,t,n){const r=`${t}${n}`;let o=e.flavors.get(r);return o||e.flavors.set(r,o=e.clientOnly===t&&e.deferred===n?e:{...e,clientOnly:t,deferred:n}),o}class Sae{cache;reader;fragments;constructor(t,n,r){this.cache=t,this.reader=n,this.fragments=r}writeToStore(t,{query:n,result:r,dataId:o,variables:i,overwrite:s,extensions:a}){const l=Ha(n),c=function iae(){return new kd}();i={...N3(l),...i};const u={store:t,written:{},merge:(f,y)=>c.merge(f,y),variables:i,varString:Va(i),..._M(n,this.fragments),overwrite:!!s,incomingById:new Map,clientOnly:!1,deferred:!1,flavors:new Map,extensions:a},d=this.processSelectionSet({result:r||{},dataId:o,selectionSet:l.selectionSet,mergeTree:{map:new Map},context:u,path:[]});if(!lr(d))throw es(109,r);return u.incomingById.forEach(({storeObject:f,mergeTree:y},Z)=>{const X=Rd(Z);if(y&&y.map.size){const ae=this.applyMerges(y,X,f,u);if(lr(ae))return;f=ae}t.merge(Z,f)}),t.retain(d.__ref),d}processSelectionSet({dataId:t,result:n,selectionSet:r,context:o,mergeTree:i,path:s}){const{policies:a}=this.cache;let l={};const c=t&&a.rootTypenamesById[t]||B3(n,r,o.fragmentMap)||t&&o.store.get(t,"__typename");"string"==typeof c&&(l.__typename=c);const u=(...f)=>{const y=M3(f,l,o.variables);if(lr(y.from)){const R=o.incomingById.get(y.from.__ref);if(R){const Z=a.readField({...y,from:R.storeObject},o);if(void 0!==Z)return Z}}return a.readField(y,o)},d=new Set;this.flattenFields(r,n,o,c).forEach((f,y)=>{const R=ou(y),Z=n[R],X=[...s,y.name.value];if(d.add(y),void 0!==Z){const ae=a.getStoreFieldName({typename:c,fieldName:y.name.value,field:y,variables:f.variables}),_e=OM(i,ae);let ot,Ye=this.processFieldValue(Z,y,y.selectionSet?O3(f,!1,!1):f,_e,X);y.selectionSet&&(lr(Ye)||Od(Ye))&&(ot=u("__typename",Ye));const mt=a.getMergeFunction(c,y.name.value,ot);mt?_e.info={field:y,typename:c,merge:mt,path:X}:Fd(["stream"],y)&&Array.isArray(Ye)&&f.extensions?.[Ql]?_e.info={field:y,typename:c,merge:mae,path:X}:PM(i,ae),l=f.merge(l,{[ae]:Ye})}});try{const[f,y]=a.identify(n,{typename:c,selectionSet:r,fragmentMap:o.fragmentMap,storeObject:l,readField:u});t=t||f,y&&(l=o.merge(l,y))}catch(f){if(!t)throw f}if("string"==typeof t){const f=Rd(t),y=o.written[t]||(o.written[t]=[]);if(y.indexOf(r)>=0||(y.push(r),this.reader&&this.reader.isFresh(n,f,r,o)))return f;const R=o.incomingById.get(t);return R?(R.storeObject=o.merge(R.storeObject,l),R.mergeTree=P3(R.mergeTree,i),d.forEach(Z=>R.fieldNodeSet.add(Z))):o.incomingById.set(t,{storeObject:l,mergeTree:M2(i)?void 0:i,fieldNodeSet:d}),f}return l}processFieldValue(t,n,r,o,i){return n.selectionSet&&null!==t?go(t)?t.map((s,a)=>{const l=this.processFieldValue(s,n,r,OM(o,a),[...i,a]);return PM(o,a),l}):this.processSelectionSet({result:t,selectionSet:n.selectionSet,context:r,mergeTree:o,path:i}):t}flattenFields(t,n,r,o=B3(n,t,r.fragmentMap)){const i=new Map,{policies:s}=this.cache,a=new sa(!1);return function l(c,u){const d=a.lookup(c,u.clientOnly,u.deferred);d.visited||(d.visited=!0,c.selections.forEach(f=>{if(!S2(f,r.variables))return;let{clientOnly:y,deferred:R}=u;if(!(y&&R)&&w3(f.directives)&&f.directives.forEach(Z=>{const X=Z.name.value;if("client"===X&&(y=!0),"defer"===X){const ae=S3(Z,r.variables);(!ae||!1!==ae.if)&&(R=!0)}}),vf(f)){const Z=i.get(f);Z&&(y=y&&Z.clientOnly,R=R&&Z.deferred),i.set(f,O3(r,y,R))}else{const Z=A2(f,r.lookupFragment);if(!Z&&f.kind===Dt.FRAGMENT_SPREAD)throw es(111,f.name.value);Z&&s.fragmentMatches(Z,o,n,r.variables)&&l(Z.selectionSet,O3(r,y,R))}}))}(t,r),i}applyMerges(t,n,r,o,i){if(t.map.size&&!lr(r)){const s=go(r)||!lr(n)&&!Od(n)?void 0:n,a=r;let l;s&&!i&&(i=[lr(s)?s.__ref:s]);const c=(u,d)=>go(u)?"number"==typeof d?u[d]:void 0:o.store.getFieldValue(u,String(d));t.map.forEach((u,d)=>{const f=c(s,d),y=c(a,d);if(void 0===y)return;i&&i.push(d);const R=this.applyMerges(u,f,y,o,i);R!==y&&(l=l||new Map,l.set(d,R)),i&&Ot(i.pop()===d)}),l&&(r=go(a)?a.slice(0):{...a},l.forEach((u,d)=>{r[d]=u}))}return t.info?this.cache.policies.runMergeFunction(n,r,t.info,o,i&&o.store.getStorage(...i)):r}}const RM=[];function OM({map:e},t){return e.has(t)||e.set(t,RM.pop()||{map:new Map}),e.get(t)}function P3(e,t){if(e===t||!t||M2(t))return e;if(!e||M2(e))return t;const n=e.info&&t.info?{...e.info,...t.info}:e.info||t.info,r=e.map.size&&t.map.size,i={info:n,map:r?new Map:e.map.size?e.map:t.map};if(r){const s=new Set(t.map.keys());e.map.forEach((a,l)=>{i.map.set(l,P3(a,t.map.get(l))),s.delete(l)}),s.forEach(a=>{i.map.set(a,P3(t.map.get(a),e.map.get(a)))})}return i}function M2(e){return!e||!(e.info||e.map.size)}function PM({map:e},t){const n=e.get(t);n&&M2(n)&&(RM.push(n),e.delete(t))}function B3(e,t,n){let r;for(const o of t.selections)if(vf(o)){if("__typename"===o.name.value)return e[ou(o)]}else r?r.push(o):r=[o];if("string"==typeof e.__typename)return e.__typename;if(r)for(const o of r){const i=B3(e,A2(o,n).selectionSet,n);if("string"==typeof i)return i}}class FM extends sM{data;optimisticData;config;watches=new Set;storeReader;storeWriter;addTypenameTransform=new Ua(d3);maybeBroadcastWatch;assumeImmutableResults=!0;policies;makeVar=fae;constructor(t={}){super(),this.config=function rae(e){return iu(nae,e)}(t),this.policies=new vae({cache:this,dataIdFromObject:this.config.dataIdFromObject,possibleTypes:this.config.possibleTypes,typePolicies:this.config.typePolicies}),this.init()}init(){const t=this.data=new x2.Root({policies:this.policies,resultCaching:this.config.resultCaching});this.optimisticData=t.stump,this.resetResultCache()}resetResultCache(){const{fragments:t}=this.config;this.addTypenameTransform.resetCache(),t?.resetCaches(),this.storeWriter=new Sae(this,this.storeReader=new bae({cache:this,fragments:t}),t),this.maybeBroadcastWatch=uf((n,r)=>this.broadcastWatch(n,r),{max:Fa["inMemoryCache.maybeBroadcastWatch"]||5e3,makeCacheKey:n=>{const r=n.optimistic?this.optimisticData:this.data;if(Cf(r)){const{optimistic:o,id:i,variables:s}=n;return r.makeCacheKey(n.query,n.callback,Va({optimistic:o,id:i,variables:s}))}}}),new Set([this.data.group,this.optimisticData.group]).forEach(n=>n.resetCaching())}restore(t){return this.init(),t&&this.data.replace(t),this}extract(t=!1){return(t?this.optimisticData:this.data).extract()}read(t){const{returnPartialData:n=!1}=t;return this.storeReader.diffQueryAgainstStore({...t,store:t.optimistic?this.optimisticData:this.data,config:this.config,returnPartialData:n}).result}write(t){try{return++this.txCount,this.storeWriter.writeToStore(this.data,t)}finally{! --this.txCount&&!1!==t.broadcast&&this.broadcastWatches()}}modify(t){if(zo.call(t,"id")&&!t.id)return!1;const n=t.optimistic?this.optimisticData:this.data;try{return++this.txCount,n.modify(t.id||"ROOT_QUERY",t.fields,!1)}finally{! --this.txCount&&!1!==t.broadcast&&this.broadcastWatches()}}diff(t){return this.storeReader.diffQueryAgainstStore({...t,store:t.optimistic?this.optimisticData:this.data,rootId:t.id||"ROOT_QUERY",config:this.config})}watch(t){return this.watches.size||function hae(e){bf(e).vars.forEach(t=>t.attachCache(e))}(this),this.watches.add(t),t.immediate&&this.maybeBroadcastWatch(t),()=>{this.watches.delete(t)&&!this.watches.size&&SM(this),this.maybeBroadcastWatch.forget(t)}}gc(t){Va.reset(),hf.reset();const n=this.optimisticData.gc();return t&&!this.txCount&&t.resetResultCache&&this.resetResultCache(),n}retain(t,n){return(n?this.optimisticData:this.data).retain(t)}release(t,n){return(n?this.optimisticData:this.data).release(t)}identify(t){if(lr(t))return t.__ref;try{return this.policies.identify(t)[0]}catch(n){}}evict(t){if(!t.id){if(zo.call(t,"id"))return!1;t={...t,id:"ROOT_QUERY"}}try{return++this.txCount,this.optimisticData.evict(t,this.data)}finally{! --this.txCount&&!1!==t.broadcast&&this.broadcastWatches()}}reset(t){return this.init(),Va.reset(),t&&t.discardWatches?(this.watches.forEach(n=>this.maybeBroadcastWatch.forget(n)),this.watches.clear(),SM(this)):this.broadcastWatches(),Promise.resolve()}removeOptimistic(t){const n=this.optimisticData.removeLayer(t);n!==this.optimisticData&&(this.optimisticData=n,this.broadcastWatches())}txCount=0;batch(t){const{update:n,optimistic:r=!0,removeOptimistic:o,onWatchUpdated:i}=t;let s;const a=c=>{const{data:u,optimisticData:d}=this;++this.txCount,c&&(this.data=this.optimisticData=c);try{return s=n(this)}finally{--this.txCount,this.data=u,this.optimisticData=d}},l=new Set;return i&&!this.txCount&&this.broadcastWatches({...t,onWatchUpdated:c=>(l.add(c),!1)}),"string"==typeof r?this.optimisticData=this.optimisticData.addLayer(r,a):!1===r?a(this.data):a(),"string"==typeof o&&(this.optimisticData=this.optimisticData.removeLayer(o)),i&&l.size?(this.broadcastWatches({...t,onWatchUpdated(c,u){const d=i.call(this,c,u);return!1!==d&&l.delete(c),d}}),l.size&&l.forEach(c=>this.maybeBroadcastWatch.dirty(c))):this.broadcastWatches(t),s}performTransaction(t,n){return this.batch({update:t,optimistic:n||null!==n})}transformDocument(t){return this.addTypenameTransform.transformDocument(this.addFragmentsToDocument(t))}fragmentMatches(t,n){return this.policies.fragmentMatches(t,n)}lookupFragment(t){return this.config.fragments?.lookup(t)||null}resolvesClientField(t,n){return!!this.policies.getReadFunction(t,n)}broadcastWatches(t){if(!this.txCount){const n=this.onAfterBroadcast,r=new Set;this.onAfterBroadcast=o=>{r.add(o)};try{this.watches.forEach(o=>this.maybeBroadcastWatch(o,t)),r.forEach(o=>o())}finally{this.onAfterBroadcast=n}}}addFragmentsToDocument(t){const{fragments:n}=this.config;return n?n.transform(t):t}broadcastWatch(t,n){const{lastDiff:r}=t,o=this.diff(t);n&&(t.optimistic&&"string"==typeof n.optimistic&&(o.fromOptimisticTransaction=!0),n.onWatchUpdated&&!1===n.onWatchUpdated.call(this,t,o,r))||(!r||!$r(r.result,o.result))&&t.callback(t.lastDiff=o,r)}}class HM extends ui{constructor(t){super((n,r)=>{const{...o}=n;return Object.defineProperty(o,"client",{enumerable:!1,value:n.client}),new Lt(i=>{let s=!1;return Promise.resolve(o).then(a=>t(n.getContext(),a)).then(n.setContext).then(()=>{s||r(n).subscribe(i)}).catch(i.error.bind(i)),()=>{s=!0}})})}}class Dae{isIncrementalResult(t){return!1}prepareRequest(t){return Ot(!Fd(["defer","stream"],t.query),67),t}extractErrors(){}startRequest=void 0}const F3=ui.execute;function N2(e,t){return iu(e,t,t.variables&&{variables:iu({...e&&e.variables,...t.variables})})}function Lae(e){return ia(e,{FragmentSpread(t){if(!t.directives?.some(({name:n})=>"unmask"===n.value))return null}})}function Jl(e,t){const n=D(e)?e:()=>e,r=o=>o.error(n());return new Lt(t?o=>t.schedule(r,0,o):r)}function za(e){return Ni((t,n)=>{let i,r=null,o=!1;r=t.subscribe($i(n,void 0,void 0,s=>{i=fs(e(s,za(e)(t))),r?(r.unsubscribe(),r=null,i.subscribe(n)):o=!0})),o&&(r.unsubscribe(),r=null,i.subscribe(n))})}class ja{constructor(t,n,r){this.kind=t,this.value=n,this.error=r,this.hasValue="N"===t}observe(t){return function Mae(e,t){var n,r,o;const{kind:i,value:s,error:a}=e;if("string"!=typeof i)throw new TypeError('Invalid notification, missing "kind"');"N"===i?null===(n=t.next)||void 0===n||n.call(t,s):"E"===i?null===(r=t.error)||void 0===r||r.call(t,a):null===(o=t.complete)||void 0===o||o.call(t)}(this,t)}do(t,n,r){const{kind:o,value:i,error:s}=this;return"N"===o?t?.(i):"E"===o?n?.(s):r?.()}accept(t,n,r){var o;return D(null===(o=t)||void 0===o?void 0:o.next)?this.observe(t):this.do(t,n,r)}toObservable(){const{kind:t,value:n,error:r}=this,o="N"===t?Qs(n):"E"===t?Jl(()=>r):"C"===t?Wl:0;if(!o)throw new TypeError(`Unexpected notification kind ${t}`);return o}static createNext(t){return new ja("N",t)}static createError(t){return new ja("E",void 0,t)}static createComplete(){return ja.completeNotification}}function UM(e=1/0){return Ol(ht,e)}function Tf(...e){return function kae(){return UM(1)}()(Ks(e,I0(e)))}function H3(e,t){return"object"==typeof e&&null!==e&&e[Symbol.for("apollo.error")]===t}function U3(e){Object.defineProperty(e,Symbol.for("apollo.error"),{value:e.name,enumerable:!1,writable:!1,configurable:!1})}function VM(e){return e.filter(t=>t).map(t=>t.message||"Error message not found.").join("\n")}ja.completeNotification=new ja("C");let Ef=(()=>{class e extends Error{static is(n){return H3(n,"CombinedGraphQLErrors")}static formatMessage=VM;errors;data;extensions;constructor(n,r=n.errors||[]){super(e.formatMessage(r,{result:n,defaultFormatMessage:VM})),this.errors=r,this.data=n.data,this.extensions=n.extensions,this.name="CombinedGraphQLErrors",U3(this),Object.setPrototypeOf(this,e.prototype)}}return e})();function zM(e){return e.map(t=>t.message||"Error message not found.").join("\n")}let Rae=(()=>{class e extends Error{static is(n){return H3(n,"CombinedProtocolErrors")}static formatMessage=zM;errors;constructor(n){super(e.formatMessage(n,{defaultFormatMessage:zM})),this.name="CombinedProtocolErrors",this.errors=n,U3(this),Object.setPrototypeOf(this,e.prototype)}}return e})();class V3 extends Error{static is(t){return H3(t,"UnconventionalError")}constructor(t){super("An error of unexpected shape occurred.",{cause:t}),this.name="UnconventionalError",U3(this),Object.setPrototypeOf(this,V3.prototype)}}const z3=Symbol(),jM=new WeakSet;function GM(e,t,n){return A3.withValue(!0,()=>{const r=If(e,t,n,!1);return Object.isFrozen(e),r})}function If(e,t,n,r,o){const{knownChanged:i}=n,s=function Hae(e,t){if(t.has(e))return t.get(e);const n=Array.isArray(e)?[]:{};return t.set(e,n),n}(e,n.mutableTargets);if(Array.isArray(e)){for(const[a,l]of Array.from(e.entries())){if(null===l){s[a]=null;continue}const c=If(l,t,n,r,void 0);i.has(c)&&i.add(s),s[a]=c}return i.has(s)?s:e}for(const a of t.selections){let l;if(r&&i.add(s),a.kind===Dt.FIELD){const c=ou(a),u=a.selectionSet;if(l=s[c]||e[c],void 0===l)continue;if(u&&null!==l){const d=If(e[c],u,n,r,void 0);i.has(d)&&(l=d)}s[c]=l}if(a.kind===Dt.INLINE_FRAGMENT&&(!a.typeCondition||n.cache.fragmentMatches(a,e.__typename))&&(l=If(e,a.selectionSet,n,r,o)),a.kind===Dt.FRAGMENT_SPREAD){const c=a.name.value,u=n.fragmentMap[c]||(n.fragmentMap[c]=n.cache.lookupFragment(c));Ot(u,39,c);const d=cae(a);"mask"!==d&&(l=If(e,u.selectionSet,n,"migrate"===d,o))}i.has(l)&&i.add(s)}return"__typename"in e&&!("__typename"in s)&&(s.__typename=e.__typename),Object.keys(s).length!==Object.keys(e).length&&i.add(s),i.has(s)?s:e}function $M(e){return 7===e||8===e}function k2(e){return!$M(e)}function Hd(e){return!!e.errors?.length}function j3(e,t=()=>{}){return n=>new Lt(r=>{let o=t();return n.subscribe({next(i){let s;try{s=e(i,o)}catch(a){r.error(a)}void 0!==s&&r.next(s)},error(i){r.error(i)},complete(){r.complete()}})})}function Af(e){const t={data:e.data};return e.error&&(t.error=e.error),t}function jae(e){let t=!1;return ia(e,{Directive:{enter(n){if("client"===n.name.value&&n.arguments&&(t=n.arguments.some(r=>"always"===r.name.value&&"BooleanValue"===r.value.kind&&!0===r.value.value),t))return Zl}}}),t}function Gae(e,t){ql(t);const n=WM(""),r=WM(""),o=X=>{for(let _e,ae=0;ae<X.length&&(_e=X[ae]);++ae)if(!go(_e)){if(_e.kind===Dt.OPERATION_DEFINITION)return n(_e.name&&_e.name.value);if(_e.kind===Dt.FRAGMENT_DEFINITION)return r(_e.name.value)}return Ot.error(14),null};let i=0;for(let X=t.definitions.length-1;X>=0;--X)t.definitions[X].kind===Dt.OPERATION_DEFINITION&&++i;const s=function $ae(e){const t=new Map,n=new Map;return e.forEach(r=>{r&&(r.name?t.set(r.name,r):r.test&&n.set(r.test,r))}),r=>{let o=t.get(r.name.value);return!o&&n.size&&n.forEach((i,s)=>{s(r)&&(o=i)}),o}}(e),a=X=>w3(X)&&X.map(s).some(ae=>ae&&ae.remove),l=new Map;let c=!1;const u={enter(X){if(a(X.directives))return c=!0,null}},d=ia(t,{Field:u,InlineFragment:u,VariableDefinition:{enter:()=>!1},Variable:{enter(X,ae,_e,Ye,ot){const mt=o(ot);mt&&mt.variables.add(X.name.value)}},FragmentSpread:{enter(X,ae,_e,Ye,ot){if(a(X.directives))return c=!0,null;const mt=o(ot);mt&&mt.fragmentSpreads.add(X.name.value)}},FragmentDefinition:{enter(X,ae,_e,Ye){l.set(JSON.stringify(Ye),X)},leave:(X,ae,_e,Ye)=>X===l.get(JSON.stringify(Ye))?X:i>0&&X.selectionSet.selections.every(mt=>mt.kind===Dt.FIELD&&"__typename"===mt.name.value)?(r(X.name.value).removed=!0,c=!0,null):void 0},Directive:{leave(X){if(s(X))return c=!0,null}}});if(!c)return t;const f=X=>(X.transitiveVars||(X.transitiveVars=new Set(X.variables),X.removed||X.fragmentSpreads.forEach(ae=>{f(r(ae)).transitiveVars.forEach(_e=>{X.transitiveVars.add(_e)})})),X),y=new Set;d.definitions.forEach(X=>{X.kind===Dt.OPERATION_DEFINITION?f(n(X.name&&X.name.value)).fragmentSpreads.forEach(ae=>{y.add(ae)}):X.kind===Dt.FRAGMENT_DEFINITION&&0===i&&!r(X.name.value).removed&&y.add(X.name.value)}),y.forEach(X=>{f(r(X)).fragmentSpreads.forEach(ae=>{y.add(ae)})});const Z={enter(X){if((X=>!(y.has(X)&&!r(X).removed))(X.name.value))return null}};return function Wae(e){return ZM(Ha(e)||function nM(e){Ot("Document"===e.kind,6),Ot(e.definitions.length<=1,7);const t=e.definitions[0];return Ot("FragmentDefinition"===t.kind,8),t}(e),gf(mf(e)))?null:e}(ia(d,{FragmentSpread:Z,FragmentDefinition:Z,OperationDefinition:{leave(X){if(X.variableDefinitions){const ae=f(n(X.name&&X.name.value)).transitiveVars;if(ae.size<X.variableDefinitions.length)return{...X,variableDefinitions:X.variableDefinitions.filter(_e=>ae.has(_e.variable.name.value))}}}}}))}function WM(e){const t=new Map;return function(r=e){let o=t.get(r);return o||t.set(r,o={variables:new Set,fragmentSpreads:new Set}),o}}function ZM(e,t){return!e||e.selectionSet.selections.every(n=>n.kind===Dt.FRAGMENT_SPREAD&&ZM(t[n.name.value],t))}var yn=function(e){return e[e.loading=1]="loading",e[e.setVariables=2]="setVariables",e[e.fetchMore=3]="fetchMore",e[e.refetch=4]="refetch",e[e.poll=6]="poll",e[e.ready=7]="ready",e[e.error=8]="error",e[e.streaming=9]="streaming",e}(yn||{});function qM(e){return e.catch(()=>{}),e}const{assign:YM}=Object,Ud={loading:!0,networkStatus:yn.loading,data:void 0,dataState:"empty",partial:!0},G3={loading:!1,networkStatus:yn.ready,data:void 0,dataState:"empty",partial:!0};class $3{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:t,options:n,transformedQuery:r=t.transform(n.query)}){this.queryManager=t,this.waitForNetworkResult="network-only"===n.fetchPolicy,this.isTornDown=!1,this.subscribeToMore=this.subscribeToMore.bind(this),this.maskResult=this.maskResult.bind(this);const{watchQuery:{fetchPolicy:o="cache-first"}={}}=t.defaultOptions,{fetchPolicy:i=o,initialFetchPolicy:s=("standby"===i?o:i)}=n;n[uae]&&(Ot("standby"===i,80),this.variablesUnknown=!0),this.lastQuery=r,this.options={...n,initialFetchPolicy:s,fetchPolicy:i,variables:this.getVariablesWithDefaults(n.variables)},this.initializeObservablesQueue(),this["@@observable"]=()=>this,Symbol.observable&&(this[Symbol.observable]=()=>this);const a=Ha(this.query);this.queryName=a&&a.name&&a.name.value}initializeObservablesQueue(){this.subject=new Pn({query:this.query,variables:this.variables,result:Ud,meta:{}});const t=this.subject.pipe(Kc({subscribe:()=>{this.subject.observed||(this.reobserve(),setTimeout(()=>this.updatePolling()))},unsubscribe:()=>{this.subject.observed||this.tearDownQuery()}}),j3(({query:n,variables:r,result:o,meta:i},s)=>{const{shouldEmit:a}=i;if(o===Ud&&(s.previous=void 0,s.previousVariables=void 0),"standby"===this.options.fetchPolicy||2===a)return;if(1===a)return u();const{previous:l,previousVariables:c}=s;if(l){const d=this.queryManager.getDocumentInfo(n),f=this.queryManager.dataMasking;if((f||d.hasNonreactiveDirective?oM(f?d.nonReactiveQuery:n,l,o,r):$r(l,o))&&$r(c,r))return}if(3!==a||this.options.notifyOnNetworkStatusChange&&!$r(l,o))return u();function u(){return s.previous=o,s.previousVariables=r,o}},()=>({})));this.pipe=t.pipe.bind(t),this.subscribe=t.subscribe.bind(t),this.input=new Kn,this.input.complete=()=>{},this.input.pipe(this.operator).subscribe(this.subject)}subscribe;pipe;[Symbol.observable];"@@observable";getCacheDiff({optimistic:t=!0}={}){return this.cache.diff({query:this.query,variables:this.variables,returnPartialData:!0,optimistic:t})}getInitialResult(t){let n=t||this.options.fetchPolicy;this.queryManager.prioritizeCacheValues&&("network-only"===n||"cache-and-network"===n)&&(n="cache-first");const r=()=>{const o=this.getCacheDiff(),i=this.options.returnPartialData||o.complete?o.result??void 0:void 0;return this.maskResult({data:i,dataState:o.complete?"complete":void 0===i?"empty":"partial",loading:!o.complete,networkStatus:o.complete?yn.ready:yn.loading,partial:!o.complete})};switch(n){case"cache-only":return{...r(),loading:!1,networkStatus:yn.ready};case"cache-first":return r();case"cache-and-network":return{...r(),loading:!0,networkStatus:yn.loading};case"standby":return G3;default:return Ud}}resubscribeCache(){const{variables:t,fetchPolicy:n}=this.options,r=this.query,o="standby"===n||"no-cache"===n||this.waitForNetworkResult,i=!Sf({query:r,variables:t},this.unsubscribeFromCache)&&!this.waitForNetworkResult;if((o||i)&&this.unsubscribeFromCache?.(),o||!i)return;const s={query:r,variables:t,optimistic:!0,watcher:this,callback:l=>{const c=this.queryManager.getDocumentInfo(r);if((c.hasClientExports||c.hasForcedResolvers)&&(s.lastDiff=void 0),s.lastOwnDiff===l)return;const{result:u}=this.subject.getValue();!l.complete&&(u.error||u===Ud||u===G3)||$r(u.data,l.result)||this.scheduleNotify()}},a=this.cache.watch(s);this.unsubscribeFromCache=Object.assign(()=>{this.unsubscribeFromCache=void 0,a()},{query:r,variables:t})}stableLastResult;getCurrentResult(){const{result:t}=this.subject.getValue();let n=t.networkStatus===yn.error||this.hasObservers()||"no-cache"===this.options.fetchPolicy?t:this.getInitialResult();return n===Ud&&(n=this.getInitialResult()),$r(this.stableLastResult,n)||(this.stableLastResult=n),this.stableLastResult}refetch(t){const{fetchPolicy:n}=this.options,r={pollInterval:0};return r.fetchPolicy="no-cache"===n?"no-cache":"network-only",t&&!$r(this.variables,t)&&(r.variables=this.options.variables=this.getVariablesWithDefaults({...this.variables,...t})),this._lastWrite=void 0,this._reobserve(r,{newNetworkStatus:yn.refetch})}fetchMore({query:t,variables:n,context:r,errorPolicy:o,updateQuery:i}){Ot("cache-only"!==this.options.fetchPolicy,82,ps(this.query,"(anonymous)"));const s={...iu(this.options,{errorPolicy:"none"},{query:t,context:r,errorPolicy:o}),variables:t?n:{...this.variables,...n},fetchPolicy:"no-cache",notifyOnNetworkStatusChange:this.options.notifyOnNetworkStatusChange};s.query=this.transformDocument(s.query),this.lastQuery=t?this.transformDocument(this.options.query):s.query;let a=!1;const l="no-cache"!==this.options.fetchPolicy;l||Ot(i,83);const{finalize:c,pushNotification:u}=this.pushOperation(yn.fetchMore);u({source:"newNetworkStatus",kind:"N",value:{}},{shouldEmit:3});const{promise:d,operator:f}=KM(),{observable:y}=this.queryManager.fetchObservableWithInfo(s,{networkStatus:yn.fetchMore,exposeExtensions:!0}),R=y.pipe(f,l8(Z=>"N"===Z.kind&&"network"===Z.source)).subscribe({next:Z=>{a=!1;const X=Z.value,ae=X[gM];if($M(Z.value.networkStatus)&&c(),l){const _e=this.getCacheDiff();this.cache.batch({update:Ye=>{i?Ye.updateQuery({query:this.query,variables:this.variables,returnPartialData:!0,optimistic:!1,extensions:ae},ot=>i(ot,{fetchMoreResult:X.data,variables:s.variables})):Ye.writeQuery({query:s.query,variables:s.variables,data:X.data,extensions:ae})},onWatchUpdated:(Ye,ot)=>{if(Ye.watcher===this&&!$r(ot.result,_e.result)){a=!0;const mt=this.getCurrentResult();k2(X.networkStatus)&&u({kind:"N",source:"network",value:{...mt,networkStatus:X.networkStatus===yn.error?yn.ready:X.networkStatus,loading:!1,data:ot.result,dataState:"streaming"===X.dataState?"streaming":"complete"}})}}})}else{const _e=this.getCurrentResult(),Ye=i(_e.data,{fetchMoreResult:X.data,variables:s.variables});u({kind:"N",value:{..._e,networkStatus:yn.ready,loading:!1,data:Ye,dataState:"streaming"===_e.dataState?"streaming":"complete"},source:"network"})}}});return qM(d.then(Z=>Af(this.maskResult(Z))).finally(()=>{if(R.unsubscribe(),c(),l&&!a){const Z=this.getCurrentResult();"streaming"===Z.dataState?u({kind:"N",source:"network",value:{...Z,dataState:"complete",networkStatus:yn.ready}}):u({kind:"N",source:"newNetworkStatus",value:{}},{shouldEmit:1})}}))}subscribeToMore(t){const n=this.queryManager.startGraphQLSubscription({query:t.document,variables:t.variables,context:t.context}).subscribe({next:r=>{const{updateQuery:o,onError:i}=t,{error:s}=r;s?i?i(s):Ot.error(84,s):o&&this.updateQuery((a,l)=>o(a,{subscriptionData:r,...l}))}});return this.subscriptions.add(n),()=>{this.subscriptions.delete(n)&&n.unsubscribe()}}applyOptions(t){const n=iu(this.options,t||{});YM(this.options,n),this.updatePolling()}setVariables(t){var n=this;return(0,K.A)(function*(){return t=n.getVariablesWithDefaults(t),$r(n.variables,t)||(n.options.variables=t,!n.hasObservers())?Af(n.getCurrentResult()):n._reobserve({fetchPolicy:n.options.initialFetchPolicy,variables:t},{newNetworkStatus:yn.setVariables})})()}updateQuery(t){const{queryManager:n}=this,{result:r,complete:o}=this.getCacheDiff({optimistic:!1}),i=t(r,{variables:this.variables,complete:!!o,previousData:r});i&&(this.cache.writeQuery({query:this.options.query,data:i,variables:this.variables}),n.broadcastQueries())}startPolling(t){this.options.pollInterval=t,this.updatePolling()}stopPolling(){this.options.pollInterval=0,this.updatePolling()}applyNextFetchPolicy(t,n){if(n.nextFetchPolicy){const{fetchPolicy:r="cache-first",initialFetchPolicy:o=r}=n;"standby"===r||(n.fetchPolicy="function"==typeof n.nextFetchPolicy?n.nextFetchPolicy.call(n,r,{reason:t,options:n,observable:this,initialFetchPolicy:o}):"variables-changed"===t?o:n.nextFetchPolicy)}return n.fetchPolicy}fetch(t,n,r,o){const i=this.options.fetchPolicy;t.context??={};let s=!1,{observable:c,fromLink:u}=this.queryManager.fetchObservableWithInfo(t,{networkStatus:n,query:r,onCacheHit:()=>{s=!0},fetchQueryOperator:X=>new Lt(ae=>{try{return X.subscribe({next(_e){s=!0,ae.next(_e)},error:_e=>ae.error(_e),complete:()=>ae.complete()})}finally{s||(y.override=n,this.input.next({kind:"N",source:"newNetworkStatus",value:{resetError:!0},query:d,variables:f,meta:{shouldEmit:3,fetchPolicy:i}}))}}),observableQuery:this});const{query:d,variables:f}=this,y={abort:()=>{Z.unsubscribe()},query:d,variables:f};this.activeOperations.add(y);let R=n==yn.refetch||n==yn.setVariables;c=c.pipe(o,ff());const Z=c.pipe(Kc({next:X=>{"newNetworkStatus"===X.source||"N"===X.kind&&X.value.loading?y.override=n:delete y.override},finalize:()=>this.activeOperations.delete(y)})).subscribe({next:X=>{const ae={};R&&"N"===X.kind&&"loading"in X.value&&!X.value.loading&&(R=!1,ae.shouldEmit=1),this.input.next({...X,query:d,variables:f,meta:ae})}});return{fromLink:u,subscription:Z,observable:c}}didWarnCacheOnlyPolling=!1;updatePolling(){if(this.queryManager.ssrMode)return;const{pollingInfo:t,options:{pollInterval:r}}=this,o=()=>{const{options:l}=this;return!l.pollInterval||!this.hasObservers()||"cache-only"===l.fetchPolicy||"standby"===l.fetchPolicy};if(o())return void this.cancelPolling();if(t?.interval===r)return;(t||(this.pollingInfo={})).interval=r;const s=()=>{if(o())return this.cancelPolling();this.pollingInfo&&(k2(this.networkStatus)||this.options.skipPollAttempt?.()?a():this._reobserve({fetchPolicy:"no-cache"===this.options.initialFetchPolicy?"no-cache":"network-only"},{newNetworkStatus:yn.poll}).then(a,a))},a=()=>{const l=this.pollingInfo;l&&(clearTimeout(l.timeout),l.timeout=setTimeout(s,l.interval))};a()}cancelPolling(){this.pollingInfo&&(clearTimeout(this.pollingInfo.timeout),delete this.pollingInfo)}reobserve(t){return this._reobserve(t)}_reobserve(t,n){this.isTornDown=!1;let{newNetworkStatus:r}=n||{};this.queryManager.obsQueries.add(this);const o=r===yn.refetch||r===yn.poll,i=this.variables,s=this.options.fetchPolicy,a=iu(this.options,t||{});this.variablesUnknown&&="standby"===a.fetchPolicy;const l=o?a:YM(this.options,a),c=this.transformDocument(l.query);this.lastQuery=c,t&&"variables"in t&&(l.variables=this.getVariablesWithDefaults(t.variables)),o||(this.updatePolling(),t&&t.variables&&!$r(t.variables,i)&&"standby"!==l.fetchPolicy&&(l.fetchPolicy===s||"function"==typeof l.nextFetchPolicy)&&(this.applyNextFetchPolicy("variables-changed",l),void 0===r&&(r=yn.setVariables))),r||(r=yn.loading,this.networkStatus!==yn.loading&&t?.variables&&!$r(t.variables,i)&&(r=yn.setVariables),"standby"===l.fetchPolicy&&(r=yn.ready)),"standby"===l.fetchPolicy&&this.cancelPolling(),this.resubscribeCache();const{promise:d,operator:f}=KM("standby"===l.fetchPolicy?{data:void 0}:void 0),{subscription:y,observable:R,fromLink:Z}=this.fetch(l,r,c,f);!o&&(Z||!this.linkSubscription)&&(this.linkSubscription&&this.linkSubscription.unsubscribe(),this.linkSubscription=y);const X=Object.assign(qM(d.then(ae=>Af(this.maskResult(ae))).finally(()=>{!this.hasObservers()&&0===this.activeOperations.size&&this.tearDownQuery()})),{retain:()=>{const ae=R.subscribe({}),_e=()=>ae.unsubscribe();return d.then(_e,_e),X}});return X}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(t=>t.unsubscribe()),this.subscriptions.clear(),this.queryManager.obsQueries.delete(this),this.isTornDown=!0,this.abortActiveOperations(),this._lastWrite=void 0)}transformDocument(t){return this.queryManager.transform(t)}maskResult(t){const n=this.queryManager.maskOperation({document:this.query,data:t.data,fetchPolicy:this.options.fetchPolicy,cause:this});return n===t.data?t:{...t,data:n}}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(t=!1){if(!t){const r=this.queryManager.getDocumentInfo(this.query);if(r.hasClientExports||r.hasForcedResolvers)return}const{dirty:n}=this;if(this.resetNotifications(),n&&("cache-only"===this.options.fetchPolicy||"cache-and-network"===this.options.fetchPolicy||!this.activeOperations.size)){const r=this.getCacheDiff();$r(r.result,this.getCacheDiff({optimistic:!1}).result)?this.reobserveCacheFirst():this.input.next({kind:"N",value:{data:r.result,dataState:r.complete?"complete":r.result?"partial":"empty",networkStatus:yn.ready,loading:!1,error:void 0,partial:!r.complete},source:"cache",query:this.query,variables:this.variables,meta:{}})}}activeOperations=new Set;pushOperation(t){let n=!1;const{query:r,variables:o}=this,i=()=>{this.activeOperations.delete(s)},s={override:t,abort:()=>{n=!0,i()},query:r,variables:o};return this.activeOperations.add(s),{finalize:i,pushNotification:(a,l)=>{n||this.input.next({...a,query:r,variables:o,meta:{...l}})}}}calculateNetworkStatus(t){return t===yn.streaming?t:Array.from(this.activeOperations.values()).reverse().find(r=>Sf(r,this)&&void 0!==r.override)?.override??t}abortActiveOperations(){this.activeOperations.forEach(t=>t.abort())}reset(){const t="cache-only"===this.options.fetchPolicy;this.setResult(t?G3:Ud,{shouldEmit:t?1:2}),this.abortActiveOperations()}setResult(t,n){this.input.next({source:"setResult",kind:"N",value:t,query:this.query,variables:this.variables,meta:{...n}})}operator=j3(t=>{const{query:n,variables:r,meta:o}=t;if("setResult"===t.source)return{query:n,variables:r,result:t.value,meta:o};if("C"===t.kind||!Sf(t,this))return;let i;const s=this.subject.getValue();if("cache"===t.source){if(i=t.value,i.networkStatus===yn.ready&&i.partial&&(!this.options.returnPartialData||s.result.networkStatus===yn.error)&&"cache-only"!==this.options.fetchPolicy)return}else if("network"===t.source)this.waitForNetworkResult&&(this.waitForNetworkResult=!1,this.resubscribeCache()),i="E"===t.kind?{...Sf(s,t)?s.result:{data:void 0,dataState:"empty",partial:!0},error:t.error,networkStatus:yn.error,loading:!1}:t.value,"E"===t.kind&&"streaming"===i.dataState&&(i.dataState="complete"),i.error&&(o.shouldEmit=1);else if("newNetworkStatus"===t.source){const a=Sf(s,t)?s.result:this.getInitialResult(o.fetchPolicy),{resetError:l}=t.value,c=l?void 0:a.error,u=c?yn.error:yn.ready;i={...a,error:c,networkStatus:u}}return Ot(i),i.error||delete i.error,i.networkStatus=this.calculateNetworkStatus(i.networkStatus),i.loading=k2(i.networkStatus),i=this.maskResult(i),{query:n,variables:r,result:i,meta:o}});reobserveCacheFirst(){const{fetchPolicy:t,nextFetchPolicy:n}=this.options;"cache-and-network"===t||"network-only"===t?this.reobserve({fetchPolicy:"cache-first",nextFetchPolicy(r,o){return this.nextFetchPolicy=n,"function"==typeof this.nextFetchPolicy?this.nextFetchPolicy(r,o):t}}):this.reobserve()}getVariablesWithDefaults(t){return this.queryManager.getVariables(this.query,t)}}function Sf(e,t){return!!(e&&t&&e.query===t.query&&$r(e.variables,t.variables))}function KM(e){let n,r,t=e;return{promise:new Promise((s,a)=>{n=s,r=a}),operator:Kc({next(s){if("E"===s.kind)return r(s.error);"N"===s.kind&&"newNetworkStatus"!==s.source&&!s.value.loading&&(t=s.value)},finalize:()=>{if(t)n(t);else{const s="The operation was aborted.",a="AbortError";r(typeof DOMException<"u"?new DOMException(s,a):Object.assign(new Error(s),{name:a}))}}})}}const XM={},Vd=new WeakMap;function W3(e,t){const n=e[t];"function"==typeof n&&(e[t]=function(){return Vd.set(e,(Vd.get(e)+1)%1e15),n.apply(this,arguments)})}const QM=new WeakMap;class Z3{lastRequestId=1;cache;queryManager;id;observableQuery;incremental;constructor(t,n){const r=this.cache=t.cache,o=(QM.get(t)||0)+1;QM.set(t,o),this.id=o+"",this.observableQuery=n,this.queryManager=t,Vd.has(r)||(Vd.set(r,0),W3(r,"evict"),W3(r,"modify"),W3(r,"reset"))}_lastWrite;get lastWrite(){return(this.observableQuery||this)._lastWrite}set lastWrite(t){(this.observableQuery||this)._lastWrite=t}resetLastWrite(){this.lastWrite=void 0}shouldWrite(t,n){const{lastWrite:r}=this;return!(r&&r.dmCount===Vd.get(this.cache)&&$r(n,r.variables)&&$r(t.data,r.result.data)&&t.extensions?.[Ql]===r.result.extensions?.[Ql])}get hasNext(){return!!this.incremental&&this.incremental.hasNext}maybeHandleIncrementalResult(t,n,r){const{incrementalHandler:o}=this.queryManager;return o.isIncrementalResult(n)?(this.incremental||=o.startRequest({query:r}),this.incremental.handle(t,n)):n}markQueryResult(t,{document:n,variables:r,errorPolicy:o,cacheWriteBehavior:i}){const s={query:n,variables:r,returnPartialData:!0,optimistic:!0};this.observableQuery?.resetNotifications();const a=0===i,l=a?void 0:this.cache.diff(s);let c=this.maybeHandleIncrementalResult(l?.result,t,n);return a||(q3(c,o)?this.cache.batch({onWatchUpdated:(u,d)=>{u.watcher===this.observableQuery&&(u.lastOwnDiff=d)},update:u=>{if(this.shouldWrite(c,r))u.writeQuery({query:n,data:c.data,variables:r,overwrite:1===i,extensions:c.extensions}),this.lastWrite={result:c,variables:r,dmCount:Vd.get(this.cache)};else if(l&&l.complete)return void(c={...c,data:l.result});const d=u.diff(s);d.complete&&(c={...c,data:d.result})}}):this.lastWrite=void 0),c}markMutationResult(t,n,r=this.cache){const o=[],i=0===n.cacheWriteBehavior;let s=this.maybeHandleIncrementalResult(i?void 0:r.diff({id:"ROOT_MUTATION",query:this.queryManager.getDocumentInfo(n.document).asQuery,variables:n.variables,optimistic:!1,returnPartialData:!0}).result,t,n.document);if("ignore"===n.errorPolicy&&(s={...s,errors:[]}),Hd(s)&&"none"===n.errorPolicy)return Promise.resolve(s);const a=()=>({...s,dataState:this.hasNext?"streaming":"complete"});if(!i&&q3(s,n.errorPolicy)){o.push({result:s.data,dataId:"ROOT_MUTATION",query:n.document,variables:n.variables,extensions:s.extensions});const{updateQueries:c}=n;c&&this.queryManager.getObservableQueries("all").forEach(u=>{const d=u&&u.queryName;if(!d||!Object.hasOwnProperty.call(c,d))return;const f=c[d],{query:y,variables:R}=u,{result:Z,complete:X}=u.getCacheDiff({optimistic:!1});if(X&&Z){const ae=f(Z,{mutationResult:a(),queryName:y&&ps(y)||void 0,queryVariables:R});ae&&o.push({result:ae,dataId:"ROOT_QUERY",query:y,variables:R})}})}let l=n.refetchQueries;if("function"==typeof l&&(l=l(a())),o.length>0||(l||"").length>0||n.update||n.onQueryUpdated||n.removeOptimistic){const c=[];if(this.queryManager.refetchQueries({updateCache:u=>{i||o.forEach(f=>u.write(f));const{update:d}=n;if(d){if(!i){const f=u.diff({id:"ROOT_MUTATION",query:this.queryManager.getDocumentInfo(n.document).asQuery,variables:n.variables,optimistic:!1,returnPartialData:!0});f.complete&&(s={...s,data:f.result})}this.hasNext||d(u,s,{context:n.context,variables:n.variables})}!i&&!n.keepRootFields&&!this.hasNext&&u.modify({id:"ROOT_MUTATION",fields:(f,{fieldName:y,DELETE:R})=>"__typename"===y?f:R})},include:l,optimistic:!1,removeOptimistic:n.removeOptimistic,onQueryUpdated:n.onQueryUpdated||null}).forEach(u=>c.push(u)),n.awaitRefetchQueries||n.onQueryUpdated)return Promise.all(c).then(()=>s)}return Promise.resolve(s)}markMutationOptimistic(t,n){const r="function"==typeof t?t(n.variables,{IGNORE:XM}):t;return r!==XM&&(this.cache.recordOptimisticTransaction(o=>{try{this.markMutationResult({data:r},n,o)}catch(i){Ot.error(i)}},this.id),!0)}markSubscriptionResult(t,{document:n,variables:r,errorPolicy:o,cacheWriteBehavior:i}){0!==i&&(q3(t,o)&&this.cache.write({query:n,result:t.data,dataId:"ROOT_SUBSCRIPTION",variables:r,extensions:t.extensions}),this.queryManager.broadcastQueries())}}function q3(e,t="none"){const n="ignore"===t||"all"===t;let r=!Hd(e);return!r&&n&&e.data&&(r=!0),r}class Kae{defaultOptions;client;clientOptions;assumeImmutableResults;documentTransform;ssrMode;defaultContext;dataMasking;incrementalHandler;localState;queryDeduplication;prioritizeCacheValues=!1;onBroadcast;mutationStore;obsQueries=new Set;fetchCancelFns=new Map;constructor(t){const n=new Ua(o=>this.cache.transformDocument(o),{cache:!1});this.client=t.client,this.defaultOptions=t.defaultOptions,this.queryDeduplication=t.queryDeduplication,this.clientOptions=t.clientOptions,this.ssrMode=t.ssrMode,this.assumeImmutableResults=t.assumeImmutableResults,this.dataMasking=t.dataMasking,this.localState=t.localState,this.incrementalHandler=t.incrementalHandler;const r=t.documentTransform;this.documentTransform=r?n.concat(r).concat(n):n,this.defaultContext=t.defaultContext||{},(this.onBroadcast=t.onBroadcast)&&(this.mutationStore={})}get link(){return this.client.link}get cache(){return this.client.cache}stop(){this.obsQueries.forEach(t=>t.stop()),this.cancelPendingFetches(es(87))}cancelPendingFetches(t){this.fetchCancelFns.forEach(n=>n(t)),this.fetchCancelFns.clear()}mutate(t){var n=this;return(0,K.A)(function*({mutation:r,variables:o,optimisticResponse:i,updateQueries:s,refetchQueries:a=[],awaitRefetchQueries:l=!1,update:c,onQueryUpdated:u,fetchPolicy:d,errorPolicy:f,keepRootFields:y,context:R}){const Z=new Z3(n);r=n.cache.transformForLink(n.transform(r));const{hasClientExports:X}=n.getDocumentInfo(r);o=n.getVariables(r,o),X&&(o=yield n.localState.getExportedVariables({client:n.client,document:r,variables:o,context:R}));const ae=n.mutationStore&&(n.mutationStore[Z.id]={mutation:r,variables:o,loading:!0,error:null}),_e=i&&Z.markMutationOptimistic(i,{document:r,variables:o,cacheWriteBehavior:"no-cache"===d?0:2,errorPolicy:f,context:R,updateQueries:s,update:c,keepRootFields:y});return n.broadcastQueries(),new Promise((Ye,ot)=>{const mt={};return n.getObservableFromLink(r,{...R,optimisticResponse:_e?i:void 0},o,d,{},!1).observable.pipe(JM(),Ol(Xt=>{const Tn={...Xt};return Ks(Z.markMutationResult(Tn,{document:r,variables:o,cacheWriteBehavior:"no-cache"===d?0:2,errorPolicy:f,context:R,update:c,updateQueries:s,awaitRefetchQueries:l,refetchQueries:a,removeOptimistic:_e?Z.id:void 0,onQueryUpdated:u,keepRootFields:y}))})).pipe(dr(Xt=>{if(Hd(Xt)&&"none"===f)throw new Ef(Y3(Xt));return ae&&(ae.loading=!1,ae.error=null),Xt})).subscribe({next:Xt=>{if(n.broadcastQueries(),!Z.hasNext){const Tn={data:n.maskOperation({document:r,data:Xt.data,fetchPolicy:d,cause:mt})};Hd(Xt)&&(Tn.error=new Ef(Xt)),Object.keys(Xt.extensions||{}).length&&(Tn.extensions=Xt.extensions),Ye(Tn)}},error:Xt=>(ae&&(ae.loading=!1,ae.error=Xt),_e&&n.cache.removeOptimistic(Z.id),n.broadcastQueries(),"ignore"===f?Ye({data:void 0}):"all"===f?Ye({data:void 0,error:Xt}):void ot(Xt))})})}).apply(this,arguments)}fetchQuery(t,n){var r=this;return ql(t.query,oa.QUERY),(0,K.A)(function*(){return Zh(r.fetchObservableWithInfo(t,{networkStatus:n}).observable.pipe(j3(o=>{switch(o.kind){case"E":throw o.error;case"N":if("newNetworkStatus"!==o.source)return Af(o.value)}})),{defaultValue:{data:void 0}})})()}transform(t){return this.documentTransform.transformDocument(t)}transformCache=new r3(Fa["queryManager.getDocumentInfo"]||2e3);getDocumentInfo(t){const{transformCache:n}=this;if(!n.has(t)){const o=Ha(t),i={hasClientExports:Fd(["client","export"],t,!0),hasForcedResolvers:jae(t),hasNonreactiveDirective:Fd(["nonreactive"],t),hasIncrementalDirective:Fd(["defer"],t),nonReactiveQuery:Qae(t),clientQuery:Fd(["client"],t)?t:null,serverQuery:Gae([{name:"client",remove:!0},{name:"connection"},{name:"nonreactive"},{name:"unmask"}],t),operationType:o?.operation,defaultVars:N3(o),asQuery:{...t,definitions:t.definitions.map(s=>"OperationDefinition"===s.kind&&"query"!==s.operation?{...s,operation:"query"}:s)}};n.set(t,i)}const r=n.get(t);if(r.violation)throw r.violation;return r}getVariables(t,n){const r=this.getDocumentInfo(t).defaultVars,o=Object.entries(n??{}).map(([i,s])=>[i,void 0===s?r[i]:s]);return{...r,...Object.fromEntries(o)}}watchQuery(t){ql(t.query,oa.QUERY);const n=this.transform(t.query);return typeof(t={...t,variables:this.getVariables(n,t.variables)}).notifyOnNetworkStatusChange>"u"&&(t.notifyOnNetworkStatusChange=!0),new $3({queryManager:this,options:t,transformedQuery:n})}query(t){const n=this.transform(t.query);return this.fetchQuery({...t,query:n}).then(r=>({...r,data:this.maskOperation({document:n,data:r?.data,fetchPolicy:t.fetchPolicy})}))}requestIdCounter=1;generateRequestId(){return this.requestIdCounter++}clearStore(t={discardWatches:!0}){return this.cancelPendingFetches(es(89)),this.obsQueries.forEach(n=>{n.reset()}),this.mutationStore&&(this.mutationStore={}),this.cache.reset(t)}getObservableQueries(t="active"){const n=new Set,r=new Map,o=new Map,i=new Set;return Array.isArray(t)&&t.forEach(s=>{if("string"==typeof s)r.set(s,s),o.set(s,!1);else if(function Zae(e){return di(e)&&"Document"===e.kind&&Array.isArray(e.definitions)}(s)){const a=hf(this.transform(s));r.set(a,ps(s)),o.set(a,!1)}else di(s)&&s.query&&i.add(s)}),this.obsQueries.forEach(s=>{const a=hf(this.transform(s.options.query));if("all"===t)return void n.add(s);const{queryName:l,options:{fetchPolicy:c}}=s;"active"===t&&"standby"===c||("active"===t||l&&o.has(l)||a&&o.has(a))&&(n.add(s),l&&o.set(l,!0),a&&o.set(a,!0))}),i.size&&i.forEach(s=>{const a=new $3({queryManager:this,options:{...N2(this.defaultOptions.watchQuery,s),fetchPolicy:"network-only"}});n.add(a)}),n}refetchObservableQueries(t=!1){const n=[];return this.getObservableQueries(t?"all":"active").forEach(r=>{const{fetchPolicy:o}=r.options;(t||"standby"!==o)&&"cache-only"!==o&&n.push(r.refetch())}),this.broadcastQueries(),Promise.all(n)}startGraphQLSubscription(t){let{query:n,variables:r}=t;const{fetchPolicy:o="cache-first",errorPolicy:i="none",context:s={},extensions:a={}}=t;let l;ql(n,oa.SUBSCRIPTION),n=this.transform(n),r=this.getVariables(n,r);const c=(this.getDocumentInfo(n).hasClientExports?Ks(this.localState.getExportedVariables({client:this.client,document:n,variables:r,context:s})):Qs(r)).pipe(Ol(u=>{const{observable:d,restart:f}=this.getObservableFromLink(n,s,u,o,a),y=new Z3(this);return l=f,d.pipe(dr(R=>{y.markSubscriptionResult(R,{document:n,variables:u,errorPolicy:i,cacheWriteBehavior:"no-cache"===o?0:2});const Z={data:R.data??void 0};return Hd(R)?Z.error=new Ef(R):function Pae(e){return"extensions"in e&&Rae.is(e.extensions[z3])}(R)&&(Z.error=R.extensions[z3],delete R.extensions[z3]),R.extensions&&Object.keys(R.extensions).length&&(Z.extensions=R.extensions),Z.error&&"none"===i&&(Z.data=void 0),"ignore"===i&&delete Z.error,Z}),za(R=>Qs("ignore"===i?{data:void 0}:{data:void 0,error:R})),l8(R=>!(!R.data&&!R.error)))}));return Object.assign(c,{restart:()=>l?.()})}broadcastQueries(){this.onBroadcast&&this.onBroadcast(),this.obsQueries.forEach(t=>t.notify())}inFlightLinkObservables=new sa(!1);getObservableFromLink(t,n,r,o,i,s=n?.queryDeduplication??this.queryDeduplication){let a={};const{serverQuery:l,clientQuery:c,operationType:u,hasIncrementalDirective:d}=this.getDocumentInfo(t),f=ps(t),y={client:this.client};if(l){const{inFlightLinkObservables:R,link:Z}=this;try{let ae=function(_e){return new Lt(Ye=>{function ot(){return _e.subscribe({next:Ye.next.bind(Ye),complete:Ye.complete.bind(Ye),error:Ye.error.bind(Ye)})}let mt=ot();return a.restart||=()=>{mt.unsubscribe(),mt=ot()},()=>{mt.unsubscribe(),a.restart=void 0}})};const X=this.incrementalHandler.prepareRequest({query:l,variables:r,context:{...this.defaultContext,...n,queryDeduplication:s},extensions:i});if(n=X.context,s){const _e=hf(l),Ye=Va(r);a=R.lookup(_e,Ye),a.observable||(a.observable=F3(Z,X,y).pipe(ae,a8(()=>{R.peek(_e,Ye)===a&&R.remove(_e,Ye)}),u===oa.SUBSCRIPTION?ff():E2({refCount:!0})))}else a.observable=F3(Z,X,y).pipe(ae)}catch(X){a.observable=Jl(()=>X)}}else a.observable=Qs({data:{}});if(c){const{operation:R}=Ha(t);Ot(!d,94,R[0].toUpperCase()+R.slice(1),f??"(anonymous)"),a.observable=a.observable.pipe(Ol(Z=>Ks(this.localState.execute({client:this.client,document:c,remoteResult:Z,context:n,variables:r,fetchPolicy:o}))))}return{restart:()=>a.restart?.(),observable:a.observable.pipe(za(R=>{throw R=function Bae(e){return function Oae(e){return null!==e&&"object"==typeof e&&"string"==typeof e.message&&"string"==typeof e.name&&("string"==typeof e.stack||typeof e.stack>"u")}(e)?e:"string"==typeof e?new Error(e,{cause:e}):new V3(e)}(R),function Fae(e){jM.add(e)}(R),R}))}}getResultsFromLink(t,{queryInfo:n,cacheWriteBehavior:r,observableQuery:o,exposeExtensions:i}){const s=n.lastRequestId=this.generateRequestId(),{errorPolicy:a}=t,l=this.cache.transformForLink(t.query);return this.getObservableFromLink(l,t.context,t.variables,t.fetchPolicy).observable.pipe(dr(c=>{const u=n.markQueryResult(c,{...t,document:l,cacheWriteBehavior:r}),d=Hd(u);if(d&&"none"===a)throw n.resetLastWrite(),o?.resetNotifications(),new Ef(Y3(u));const f={data:u.data,...n.hasNext?{loading:!0,networkStatus:yn.streaming,dataState:"streaming",partial:!0}:{dataState:u.data?"complete":"empty",loading:!1,networkStatus:yn.ready,partial:!u.data}};return i&&"extensions"in u&&(f[gM]=u.extensions),d&&("none"===a&&(f.data=void 0,f.dataState="empty"),"ignore"!==a&&(f.error=new Ef(Y3(u)),"streaming"!==f.dataState&&(f.networkStatus=yn.error))),f}),za(c=>{if(s>=n.lastRequestId&&"none"===a)throw n.resetLastWrite(),o?.resetNotifications(),c;const u={data:void 0,dataState:"empty",loading:!1,networkStatus:yn.ready,partial:!0};return"ignore"!==a&&(u.error=c,u.networkStatus=yn.error),Qs(u)}))}fetchObservableWithInfo(t,{networkStatus:n=yn.loading,query:r=t.query,fetchQueryOperator:o=l=>l,onCacheHit:i=()=>{},observableQuery:s,exposeExtensions:a}){const l=this.getVariables(r,t.variables);let{fetchPolicy:c="cache-first",errorPolicy:u="none",returnPartialData:d=!1,notifyOnNetworkStatusChange:f=!0,context:y={}}=t;this.prioritizeCacheValues&&("network-only"===c||"cache-and-network"===c)&&(c="cache-first");const R=Object.assign({},t,{query:r,variables:l,fetchPolicy:c,errorPolicy:u,returnPartialData:d,notifyOnNetworkStatusChange:f,context:y}),Z=new Z3(this,s),X=mt=>{R.variables=mt;const Tn=this.fetchQueryByPolicy(R,{queryInfo:Z,cacheWriteBehavior:"no-cache"===c?0:n===yn.refetch&&"merge"!==R.refetchWritePolicy?1:2,onCacheHit:i,observableQuery:s,exposeExtensions:a});return Tn.observable=Tn.observable.pipe(o),"standby"!==R.fetchPolicy&&s?.applyNextFetchPolicy("after-fetch",t),Tn},ae=()=>{this.fetchCancelFns.delete(Z.id)};this.fetchCancelFns.set(Z.id,mt=>{_e.next({kind:"E",error:mt,source:"network"})});const _e=new Kn;let Ye,ot;if(this.getDocumentInfo(R.query).hasClientExports)Ye=Ks(this.localState.getExportedVariables({client:this.client,document:R.query,variables:R.variables,context:R.context})).pipe(Ol(mt=>X(mt).observable)),ot=!0;else{const mt=X(R.variables);ot=mt.fromLink,Ye=mt.observable}return{observable:new Lt(mt=>{mt.add(ae),Ye.subscribe(mt),_e.subscribe(mt)}).pipe(ff()),fromLink:ot}}refetchQueries({updateCache:t,include:n,optimistic:r=!1,removeOptimistic:o=(r?mx("refetchQueries"):void 0),onQueryUpdated:i}){const s=new Map;n&&this.getObservableQueries(n).forEach(l=>{if("cache-only"===l.options.fetchPolicy||l.variablesUnknown)return;const c=l.getCurrentResult();s.set(l,{oq:l,lastDiff:{result:c?.data,complete:!c?.partial}})});const a=new Map;if(t){const l=new Set;this.cache.batch({update:t,optimistic:r&&o||!1,removeOptimistic:o,onWatchUpdated(c,u,d){const f=c.watcher;if(f instanceof $3&&!l.has(f)){if(l.add(f),i){s.delete(f);let y=i(f,u,d);return!0===y&&(y=f.refetch().retain()),!1!==y&&a.set(f,y),y}null!==i&&"cache-only"!==f.options.fetchPolicy&&s.set(f,{oq:f,lastDiff:d,diff:u})}}})}return s.size&&s.forEach(({oq:l,lastDiff:c,diff:u})=>{let d;i&&(u||(u=l.getCacheDiff()),d=i(l,u,c)),(!i||!0===d)&&(d=l.refetch().retain()),!1!==d&&a.set(l,d)}),o&&this.cache.removeOptimistic(o),a}noCacheWarningsByCause=new WeakSet;maskOperation(t){const{document:n,data:r}=t;return this.dataMasking?function Vae(e,t,n){const r=Ha(t);return Ot(r,43),null==e?e:GM(e,r.selectionSet,{operationType:r.operation,operationName:r.name?.value,fragmentMap:gf(mf(t)),cache:n,mutableTargets:new WeakMap,knownChanged:new WeakSet})}(r,n,this.cache):r}maskFragment(t){const{data:n,fragment:r,fragmentName:o}=t;return this.dataMasking?function zae(e,t,n,r){const o=t.definitions.filter(s=>s.kind===Dt.FRAGMENT_DEFINITION);typeof r>"u"&&(Ot(1===o.length,41,o.length),r=o[0].name.value);const i=o.find(s=>s.name.value===r);return Ot(!!i,42,r),null==e||$r(e,{})?e:GM(e,i.selectionSet,{operationType:"fragment",operationName:i.name.value,fragmentMap:gf(mf(t)),cache:n,mutableTargets:new WeakMap,knownChanged:new WeakSet})}(n,r,this.cache,o):n}fetchQueryByPolicy({query:t,variables:n,fetchPolicy:r,errorPolicy:o,returnPartialData:i,context:s},{cacheWriteBehavior:a,onCacheHit:l,queryInfo:c,observableQuery:u,exposeExtensions:d}){const f=()=>this.cache.diff({query:t,variables:n,returnPartialData:!0,optimistic:!0}),y=(Z,X)=>{const ae=Z.result,_e=ot=>(!Z.complete&&!i&&(ot=void 0),{data:ot,dataState:Z.complete?"complete":ot?"partial":"empty",loading:k2(X),networkStatus:X,partial:!Z.complete});return(Z.complete||i)&&this.getDocumentInfo(t).hasForcedResolvers?(l(),Ks(this.localState.execute({client:this.client,document:t,remoteResult:ae?{data:ae}:void 0,context:s,variables:n,onlyRunForcedResolvers:!0,returnPartialData:!0,fetchPolicy:r}).then(ot=>({kind:"N",value:_e(ot.data||void 0),source:"cache"})))):Qs({kind:"N",value:_e("none"===o&&X===yn.refetch&&Z.missing?void 0:ae||void 0),source:"cache"})},R=()=>this.getResultsFromLink({query:t,variables:n,context:s,fetchPolicy:r,errorPolicy:o},{cacheWriteBehavior:a,queryInfo:c,observableQuery:u,exposeExtensions:d}).pipe(JM(),function Nae(){return Ni((e,t)=>{e.subscribe($i(t,n=>{t.next(ja.createNext(n))},()=>{t.next(ja.createComplete()),t.complete()},n=>{t.next(ja.createError(n)),t.complete()}))})}(),dr(Z=>({...Z,source:"network"})));switch(r){default:case"cache-first":{const Z=f();return Z.complete?{fromLink:!1,observable:y(Z,yn.ready)}:i?{fromLink:!0,observable:Tf(y(Z,yn.loading),R())}:{fromLink:!0,observable:R()}}case"cache-and-network":{const Z=f();return Z.complete||i?{fromLink:!0,observable:Tf(y(Z,yn.loading),R())}:{fromLink:!0,observable:R()}}case"cache-only":return{fromLink:!1,observable:Tf(y(f(),yn.ready))};case"network-only":case"no-cache":return{fromLink:!0,observable:R()};case"standby":return{fromLink:!1,observable:Wl}}}}function JM(){let e=!1;return Kc({next(){e=!0},complete(){Ot(e,98)}})}function Qae(e){return ia(e,{FragmentSpread:t=>{if(!t.directives?.some(n=>"unmask"===n.name.value))return{...t,directives:[...t.directives||[],{kind:Dt.DIRECTIVE,name:{kind:Dt.NAME,value:"nonreactive"}}]}}})}function Y3(e){if(null==e.extensions?.[Ql])return e;const{extensions:{[Ql]:t,...n},...r}=e;return Object.keys(n).length>0&&(r.extensions=n),r}class K3{link;cache;disableNetworkFetches;set prioritizeCacheValues(t){this.queryManager.prioritizeCacheValues=t}get prioritizeCacheValues(){return this.queryManager.prioritizeCacheValues}version;queryDeduplication;defaultOptions;devtoolsConfig;queryManager;devToolsHookCb;resetStoreCallbacks=[];clearStoreCallbacks=[];constructor(t){const{cache:n,documentTransform:r,ssrMode:o=!1,ssrForceFetchDelay:i=0,queryDeduplication:s=!0,defaultOptions:a,defaultContext:l,assumeImmutableResults:c=n.assumeImmutableResults,localState:u,devtools:d,dataMasking:f,link:y,incrementalHandler:R=new Dae,experiments:Z=[]}=t;this.link=y,this.cache=n,this.queryDeduplication=s,this.defaultOptions=a||{},this.devtoolsConfig={...d,enabled:d?.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=K8,this.queryManager=new Kae({client:this,defaultOptions:this.defaultOptions,defaultContext:l,documentTransform:r,queryDeduplication:s,ssrMode:o,dataMasking:!!f,clientOptions:t,incrementalHandler:R,assumeImmutableResults:c,onBroadcast:this.devtoolsConfig.enabled?()=>{this.devToolsHookCb&&this.devToolsHookCb()}:void 0,localState:u}),this.prioritizeCacheValues=o||i>0,i&&setTimeout(()=>{this.prioritizeCacheValues=!1},i),this.devtoolsConfig.enabled&&this.connectToDevTools(),Z.forEach(X=>X.call(this,t))}connectToDevTools(){if(typeof window>"u")return;const t=window,n=Symbol.for("apollo.devtools");(t[n]=t[n]||[]).push(this),t.__APOLLO_CLIENT__=this}get documentTransform(){return this.queryManager.documentTransform}get localState(){return this.queryManager.localState}set localState(t){this.queryManager.localState=t}stop(){this.queryManager.stop()}watchQuery(t){return this.defaultOptions.watchQuery&&(t=N2(this.defaultOptions.watchQuery,t)),this.queryManager.watchQuery(t)}query(t){return this.defaultOptions.query&&(t=N2(this.defaultOptions.query,t)),this.queryManager.query(t)}mutate(t){const n=N2(iu({fetchPolicy:"network-only",errorPolicy:"none"},this.defaultOptions.mutate),t);return ql(n.mutation,oa.MUTATION),this.queryManager.mutate(n)}subscribe(t){const n={},r=this.queryManager.startGraphQLSubscription(t),o=r.pipe(dr(i=>({...i,data:this.queryManager.maskOperation({document:t.query,data:i.data,fetchPolicy:t.fetchPolicy,cause:n})})));return Object.assign(o,{restart:r.restart})}readQuery(t,n=!1){return this.cache.readQuery({...t,query:this.transform(t.query)},n)}watchFragment(t){const n=this.queryManager.dataMasking;return this.cache.watchFragment({...t,fragment:this.transform(t.fragment,n)})}readFragment(t,n=!1){return this.cache.readFragment({...t,fragment:this.transform(t.fragment)},n)}writeQuery(t){const n=this.cache.writeQuery(t);return!1!==t.broadcast&&this.queryManager.broadcastQueries(),n}writeFragment(t){const n=this.cache.writeFragment(t);return!1!==t.broadcast&&this.queryManager.broadcastQueries(),n}__actionHookForDevTools(t){this.devToolsHookCb=t}__requestRaw(t){return F3(this.link,t,{client:this})}resetStore(){return Promise.resolve().then(()=>this.queryManager.clearStore({discardWatches:!1})).then(()=>Promise.all(this.resetStoreCallbacks.map(t=>t()))).then(()=>this.refetchObservableQueries())}clearStore(){return Promise.resolve().then(()=>this.queryManager.clearStore({discardWatches:!0})).then(()=>Promise.all(this.clearStoreCallbacks.map(t=>t())))}onResetStore(t){return this.resetStoreCallbacks.push(t),()=>{this.resetStoreCallbacks=this.resetStoreCallbacks.filter(n=>n!==t)}}onClearStore(t){return this.clearStoreCallbacks.push(t),()=>{this.clearStoreCallbacks=this.clearStoreCallbacks.filter(n=>n!==t)}}reFetchObservableQueries;refetchObservableQueries(t){return this.queryManager.refetchObservableQueries(t)}refetchQueries(t){const n=this.queryManager.refetchQueries(t),r=[],o=[];n.forEach((s,a)=>{r.push(a),o.push(s)});const i=Promise.all(o);return i.queries=r,i.results=o,i.catch(s=>{}),i}getObservableQueries(t="active"){return this.queryManager.getObservableQueries(t)}extract(t){return this.cache.extract(t)}restore(t){return this.cache.restore(t)}setLink(t){this.link=t}get defaultContext(){return this.queryManager.defaultContext}maskedFragmentTransform=new Ua(Lae);transform(t,n=!1){const r=this.queryManager.transform(t);return n?this.maskedFragmentTransform.transformDocument(r):r}}function ele(e,t){if(!e)throw new Error(t??"Unexpected invariant triggered.")}const tle=/\r\n|[\n\r]/g;function X3(e,t){let n=0,r=1;for(const o of e.body.matchAll(tle)){if("number"==typeof o.index||ele(!1),o.index>=t)break;n=o.index+o[0].length,r+=1}return{line:r,column:t+1-n}}function nle(e){return tN(e.source,X3(e.source,e.start))}function tN(e,t){const n=e.locationOffset.column-1,r="".padStart(n)+e.body,o=t.line-1,s=t.line+(e.locationOffset.line-1),l=t.column+(1===t.line?n:0),c=`${e.name}:${s}:${l}\n`,u=r.split(/\r\n|[\n\r]/g),d=u[o];if(d.length>120){const f=Math.floor(l/80),y=l%80,R=[];for(let Z=0;Z<d.length;Z+=80)R.push(d.slice(Z,Z+80));return c+nN([[`${s} |`,R[0]],...R.slice(1,f+1).map(Z=>["|",Z]),["|","^".padStart(y)],["|",R[f+1]]])}return c+nN([[s-1+" |",u[o-1]],[`${s} |`,d],["|","^".padStart(l)],[`${s+1} |`,u[o+1]]])}function nN(e){const t=e.filter(([r,o])=>void 0!==o),n=Math.max(...t.map(([r])=>r.length));return t.map(([r,o])=>r.padStart(n)+(o?" "+o:"")).join("\n")}class Q3 extends Error{constructor(t,...n){var r,o,i;const{nodes:s,source:a,positions:l,path:c,originalError:u,extensions:d}=function rle(e){const t=e[0];return null==t||"kind"in t||"length"in t?{nodes:t,source:e[1],positions:e[2],path:e[3],originalError:e[4],extensions:e[5]}:t}(n);super(t),this.name="GraphQLError",this.path=c??void 0,this.originalError=u??void 0,this.nodes=rN(Array.isArray(s)?s:s?[s]:void 0);const f=rN(null===(r=this.nodes)||void 0===r?void 0:r.map(R=>R.loc).filter(R=>null!=R));this.source=a??(null==f||null===(o=f[0])||void 0===o?void 0:o.source),this.positions=l??f?.map(R=>R.start),this.locations=l&&a?l.map(R=>X3(a,R)):f?.map(R=>X3(R.source,R.start));const y=function Jae(e){return"object"==typeof e&&null!==e}(u?.extensions)?u?.extensions:void 0;this.extensions=null!==(i=d??y)&&void 0!==i?i:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),null!=u&&u.stack?Object.defineProperty(this,"stack",{value:u.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,Q3):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let t=this.message;if(this.nodes)for(const n of this.nodes)n.loc&&(t+="\n\n"+nle(n.loc));else if(this.source&&this.locations)for(const n of this.locations)t+="\n\n"+tN(this.source,n);return t}toJSON(){const t={message:this.message};return null!=this.locations&&(t.locations=this.locations),null!=this.path&&(t.path=this.path),null!=this.extensions&&Object.keys(this.extensions).length>0&&(t.extensions=this.extensions),t}}function rN(e){return void 0===e||0===e.length?void 0:e}function ko(e,t,n){return new Q3(`Syntax Error: ${n}`,{source:e,positions:[t]})}var oN=function(e){return e.QUERY="QUERY",e.MUTATION="MUTATION",e.SUBSCRIPTION="SUBSCRIPTION",e.FIELD="FIELD",e.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",e.FRAGMENT_SPREAD="FRAGMENT_SPREAD",e.INLINE_FRAGMENT="INLINE_FRAGMENT",e.VARIABLE_DEFINITION="VARIABLE_DEFINITION",e.SCHEMA="SCHEMA",e.SCALAR="SCALAR",e.OBJECT="OBJECT",e.FIELD_DEFINITION="FIELD_DEFINITION",e.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",e.INTERFACE="INTERFACE",e.UNION="UNION",e.ENUM="ENUM",e.ENUM_VALUE="ENUM_VALUE",e.INPUT_OBJECT="INPUT_OBJECT",e.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION",e}(oN||{}),rt=function(e){return e.SOF="<SOF>",e.EOF="<EOF>",e.BANG="!",e.DOLLAR="$",e.AMP="&",e.PAREN_L="(",e.PAREN_R=")",e.DOT=".",e.SPREAD="...",e.COLON=":",e.EQUALS="=",e.AT="@",e.BRACKET_L="[",e.BRACKET_R="]",e.BRACE_L="{",e.PIPE="|",e.BRACE_R="}",e.NAME="Name",e.INT="Int",e.FLOAT="Float",e.STRING="String",e.BLOCK_STRING="BlockString",e.COMMENT="Comment",e}(rt||{});class ole{constructor(t){const n=new hx(rt.SOF,0,0,0,0);this.source=t,this.lastToken=n,this.token=n,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let t=this.token;if(t.kind!==rt.EOF)do{if(t.next)t=t.next;else{const n=sle(this,t.end);t.next=n,n.prev=t,t=n}}while(t.kind===rt.COMMENT);return t}}function zd(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function R2(e,t){return iN(e.charCodeAt(t))&&sN(e.charCodeAt(t+1))}function iN(e){return e>=55296&&e<=56319}function sN(e){return e>=56320&&e<=57343}function su(e,t){const n=e.source.body.codePointAt(t);if(void 0===n)return rt.EOF;if(n>=32&&n<=126){const r=String.fromCodePoint(n);return'"'===r?"'\"'":`"${r}"`}return"U+"+n.toString(16).toUpperCase().padStart(4,"0")}function Io(e,t,n,r,o){return new hx(t,n,r,e.line,1+n-e.lineStart,o)}function sle(e,t){const n=e.source.body,r=n.length;let o=t;for(;o<r;){const i=n.charCodeAt(o);switch(i){case 65279:case 9:case 32:case 44:++o;continue;case 10:++o,++e.line,e.lineStart=o;continue;case 13:10===n.charCodeAt(o+1)?o+=2:++o,++e.line,e.lineStart=o;continue;case 35:return ale(e,o);case 33:return Io(e,rt.BANG,o,o+1);case 36:return Io(e,rt.DOLLAR,o,o+1);case 38:return Io(e,rt.AMP,o,o+1);case 40:return Io(e,rt.PAREN_L,o,o+1);case 41:return Io(e,rt.PAREN_R,o,o+1);case 46:if(46===n.charCodeAt(o+1)&&46===n.charCodeAt(o+2))return Io(e,rt.SPREAD,o,o+3);break;case 58:return Io(e,rt.COLON,o,o+1);case 61:return Io(e,rt.EQUALS,o,o+1);case 64:return Io(e,rt.AT,o,o+1);case 91:return Io(e,rt.BRACKET_L,o,o+1);case 93:return Io(e,rt.BRACKET_R,o,o+1);case 123:return Io(e,rt.BRACE_L,o,o+1);case 124:return Io(e,rt.PIPE,o,o+1);case 125:return Io(e,rt.BRACE_R,o,o+1);case 34:return 34===n.charCodeAt(o+1)&&34===n.charCodeAt(o+2)?hle(e,o):cle(e,o)}if(df(i)||45===i)return lle(e,o,i);if(Jx(i))return fle(e,o);throw ko(e.source,o,39===i?"Unexpected single quote character ('), did you mean to use a double quote (\")?":zd(i)||R2(n,o)?`Unexpected character: ${su(e,o)}.`:`Invalid character: ${su(e,o)}.`)}return Io(e,rt.EOF,r,r)}function ale(e,t){const n=e.source.body,r=n.length;let o=t+1;for(;o<r;){const i=n.charCodeAt(o);if(10===i||13===i)break;if(zd(i))++o;else{if(!R2(n,o))break;o+=2}}return Io(e,rt.COMMENT,t,o,n.slice(t+1,o))}function lle(e,t,n){const r=e.source.body;let o=t,i=n,s=!1;if(45===i&&(i=r.charCodeAt(++o)),48===i){if(i=r.charCodeAt(++o),df(i))throw ko(e.source,o,`Invalid number, unexpected digit after 0: ${su(e,o)}.`)}else o=J3(e,o,i),i=r.charCodeAt(o);if(46===i&&(s=!0,i=r.charCodeAt(++o),o=J3(e,o,i),i=r.charCodeAt(o)),(69===i||101===i)&&(s=!0,i=r.charCodeAt(++o),(43===i||45===i)&&(i=r.charCodeAt(++o)),o=J3(e,o,i),i=r.charCodeAt(o)),46===i||Jx(i))throw ko(e.source,o,`Invalid number, expected digit but got: ${su(e,o)}.`);return Io(e,s?rt.FLOAT:rt.INT,t,o,r.slice(t,o))}function J3(e,t,n){if(!df(n))throw ko(e.source,t,`Invalid number, expected digit but got: ${su(e,t)}.`);const r=e.source.body;let o=t+1;for(;df(r.charCodeAt(o));)++o;return o}function cle(e,t){const n=e.source.body,r=n.length;let o=t+1,i=o,s="";for(;o<r;){const a=n.charCodeAt(o);if(34===a)return s+=n.slice(i,o),Io(e,rt.STRING,t,o+1,s);if(92===a){s+=n.slice(i,o);const l=117===n.charCodeAt(o+1)?123===n.charCodeAt(o+2)?ule(e,o):dle(e,o):_le(e,o);s+=l.value,o+=l.size,i=o;continue}if(10===a||13===a)break;if(zd(a))++o;else{if(!R2(n,o))throw ko(e.source,o,`Invalid character within String: ${su(e,o)}.`);o+=2}}throw ko(e.source,o,"Unterminated string.")}function ule(e,t){const n=e.source.body;let r=0,o=3;for(;o<12;){const i=n.charCodeAt(t+o++);if(125===i){if(o<5||!zd(r))break;return{value:String.fromCodePoint(r),size:o}}if(r=r<<4|wf(i),r<0)break}throw ko(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+o)}".`)}function dle(e,t){const n=e.source.body,r=aN(n,t+2);if(zd(r))return{value:String.fromCodePoint(r),size:6};if(iN(r)&&92===n.charCodeAt(t+6)&&117===n.charCodeAt(t+7)){const o=aN(n,t+8);if(sN(o))return{value:String.fromCodePoint(r,o),size:12}}throw ko(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+6)}".`)}function aN(e,t){return wf(e.charCodeAt(t))<<12|wf(e.charCodeAt(t+1))<<8|wf(e.charCodeAt(t+2))<<4|wf(e.charCodeAt(t+3))}function wf(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function _le(e,t){const n=e.source.body;switch(n.charCodeAt(t+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:"\n",size:2};case 114:return{value:"\r",size:2};case 116:return{value:"\t",size:2}}throw ko(e.source,t,`Invalid character escape sequence: "${n.slice(t,t+2)}".`)}function hle(e,t){const n=e.source.body,r=n.length;let o=e.lineStart,i=t+3,s=i,a="";const l=[];for(;i<r;){const c=n.charCodeAt(i);if(34===c&&34===n.charCodeAt(i+1)&&34===n.charCodeAt(i+2)){a+=n.slice(s,i),l.push(a);const u=Io(e,rt.BLOCK_STRING,t,i+3,Ase(l).join("\n"));return e.line+=l.length-1,e.lineStart=o,u}if(92!==c||34!==n.charCodeAt(i+1)||34!==n.charCodeAt(i+2)||34!==n.charCodeAt(i+3))if(10!==c&&13!==c)if(zd(c))++i;else{if(!R2(n,i))throw ko(e.source,i,`Invalid character within String: ${su(e,i)}.`);i+=2}else a+=n.slice(s,i),l.push(a),13===c&&10===n.charCodeAt(i+1)?i+=2:++i,a="",s=i,o=i;else a+=n.slice(s,i),s=i+1,i+=4}throw ko(e.source,i,"Unterminated string.")}function fle(e,t){const n=e.source.body,r=n.length;let o=t+1;for(;o<r&&Ise(n.charCodeAt(o));)++o;return Io(e,rt.NAME,t,o,n.slice(t,o))}const ple=globalThis.process?function(t,n){return t instanceof n}:function(t,n){if(t instanceof n)return!0;if("object"==typeof t&&null!==t){var r;const o=n.prototype[Symbol.toStringTag];if(o===(Symbol.toStringTag in t?t[Symbol.toStringTag]:null===(r=t.constructor)||void 0===r?void 0:r.name)){const s=Z8(t);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 lN{constructor(t,n="GraphQL request",r={line:1,column:1}){"string"==typeof t||f2(!1,`Body must be a string. Received: ${Z8(t)}.`),this.body=t,this.name=n,this.locationOffset=r,this.locationOffset.line>0||f2(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||f2(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}class Df{constructor(t,n={}){const{lexer:r,...o}=n;if(r)this._lexer=r;else{const i=function gle(e){return ple(e,lN)}(t)?t:new lN(t);this._lexer=new ole(i)}this._options=o,this._tokenCounter=0}get tokenCount(){return this._tokenCounter}parseName(){const t=this.expectToken(rt.NAME);return this.node(t,{kind:Dt.NAME,value:t.value})}parseDocument(){return this.node(this._lexer.token,{kind:Dt.DOCUMENT,definitions:this.many(rt.SOF,this.parseDefinition,rt.EOF)})}parseDefinition(){if(this.peek(rt.BRACE_L))return this.parseOperationDefinition();const t=this.peekDescription(),n=t?this._lexer.lookahead():this._lexer.token;if(t&&n.kind===rt.BRACE_L)throw ko(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are not supported on shorthand queries.");if(n.kind===rt.NAME){switch(n.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(n.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition()}if(t)throw ko(this._lexer.source,this._lexer.token.start,"Unexpected description, only GraphQL definitions support descriptions.");if("extend"===n.value)return this.parseTypeSystemExtension()}throw this.unexpected(n)}parseOperationDefinition(){const t=this._lexer.token;if(this.peek(rt.BRACE_L))return this.node(t,{kind:Dt.OPERATION_DEFINITION,operation:oa.QUERY,description:void 0,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});const n=this.parseDescription(),r=this.parseOperationType();let o;return this.peek(rt.NAME)&&(o=this.parseName()),this.node(t,{kind:Dt.OPERATION_DEFINITION,operation:r,description:n,name:o,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const t=this.expectToken(rt.NAME);switch(t.value){case"query":return oa.QUERY;case"mutation":return oa.MUTATION;case"subscription":return oa.SUBSCRIPTION}throw this.unexpected(t)}parseVariableDefinitions(){return this.optionalMany(rt.PAREN_L,this.parseVariableDefinition,rt.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:Dt.VARIABLE_DEFINITION,description:this.parseDescription(),variable:this.parseVariable(),type:(this.expectToken(rt.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(rt.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const t=this._lexer.token;return this.expectToken(rt.DOLLAR),this.node(t,{kind:Dt.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:Dt.SELECTION_SET,selections:this.many(rt.BRACE_L,this.parseSelection,rt.BRACE_R)})}parseSelection(){return this.peek(rt.SPREAD)?this.parseFragment():this.parseField()}parseField(){const t=this._lexer.token,n=this.parseName();let r,o;return this.expectOptionalToken(rt.COLON)?(r=n,o=this.parseName()):o=n,this.node(t,{kind:Dt.FIELD,alias:r,name:o,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(rt.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(t){return this.optionalMany(rt.PAREN_L,t?this.parseConstArgument:this.parseArgument,rt.PAREN_R)}parseArgument(t=!1){const n=this._lexer.token,r=this.parseName();return this.expectToken(rt.COLON),this.node(n,{kind:Dt.ARGUMENT,name:r,value:this.parseValueLiteral(t)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){const t=this._lexer.token;this.expectToken(rt.SPREAD);const n=this.expectOptionalKeyword("on");return!n&&this.peek(rt.NAME)?this.node(t,{kind:Dt.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(t,{kind:Dt.INLINE_FRAGMENT,typeCondition:n?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){const t=this._lexer.token,n=this.parseDescription();return this.expectKeyword("fragment"),this.node(t,!0===this._options.allowLegacyFragmentVariables?{kind:Dt.FRAGMENT_DEFINITION,description:n,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}:{kind:Dt.FRAGMENT_DEFINITION,description:n,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(t){const n=this._lexer.token;switch(n.kind){case rt.BRACKET_L:return this.parseList(t);case rt.BRACE_L:return this.parseObject(t);case rt.INT:return this.advanceLexer(),this.node(n,{kind:Dt.INT,value:n.value});case rt.FLOAT:return this.advanceLexer(),this.node(n,{kind:Dt.FLOAT,value:n.value});case rt.STRING:case rt.BLOCK_STRING:return this.parseStringLiteral();case rt.NAME:switch(this.advanceLexer(),n.value){case"true":return this.node(n,{kind:Dt.BOOLEAN,value:!0});case"false":return this.node(n,{kind:Dt.BOOLEAN,value:!1});case"null":return this.node(n,{kind:Dt.NULL});default:return this.node(n,{kind:Dt.ENUM,value:n.value})}case rt.DOLLAR:if(t){if(this.expectToken(rt.DOLLAR),this._lexer.token.kind===rt.NAME)throw ko(this._lexer.source,n.start,`Unexpected variable "$${this._lexer.token.value}" in constant value.`);throw this.unexpected(n)}return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){const t=this._lexer.token;return this.advanceLexer(),this.node(t,{kind:Dt.STRING,value:t.value,block:t.kind===rt.BLOCK_STRING})}parseList(t){return this.node(this._lexer.token,{kind:Dt.LIST,values:this.any(rt.BRACKET_L,()=>this.parseValueLiteral(t),rt.BRACKET_R)})}parseObject(t){return this.node(this._lexer.token,{kind:Dt.OBJECT,fields:this.any(rt.BRACE_L,()=>this.parseObjectField(t),rt.BRACE_R)})}parseObjectField(t){const n=this._lexer.token,r=this.parseName();return this.expectToken(rt.COLON),this.node(n,{kind:Dt.OBJECT_FIELD,name:r,value:this.parseValueLiteral(t)})}parseDirectives(t){const n=[];for(;this.peek(rt.AT);)n.push(this.parseDirective(t));return n}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(t){const n=this._lexer.token;return this.expectToken(rt.AT),this.node(n,{kind:Dt.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(t)})}parseTypeReference(){const t=this._lexer.token;let n;if(this.expectOptionalToken(rt.BRACKET_L)){const r=this.parseTypeReference();this.expectToken(rt.BRACKET_R),n=this.node(t,{kind:Dt.LIST_TYPE,type:r})}else n=this.parseNamedType();return this.expectOptionalToken(rt.BANG)?this.node(t,{kind:Dt.NON_NULL_TYPE,type:n}):n}parseNamedType(){return this.node(this._lexer.token,{kind:Dt.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(rt.STRING)||this.peek(rt.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("schema");const r=this.parseConstDirectives(),o=this.many(rt.BRACE_L,this.parseOperationTypeDefinition,rt.BRACE_R);return this.node(t,{kind:Dt.SCHEMA_DEFINITION,description:n,directives:r,operationTypes:o})}parseOperationTypeDefinition(){const t=this._lexer.token,n=this.parseOperationType();this.expectToken(rt.COLON);const r=this.parseNamedType();return this.node(t,{kind:Dt.OPERATION_TYPE_DEFINITION,operation:n,type:r})}parseScalarTypeDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("scalar");const r=this.parseName(),o=this.parseConstDirectives();return this.node(t,{kind:Dt.SCALAR_TYPE_DEFINITION,description:n,name:r,directives:o})}parseObjectTypeDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("type");const r=this.parseName(),o=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),s=this.parseFieldsDefinition();return this.node(t,{kind:Dt.OBJECT_TYPE_DEFINITION,description:n,name:r,interfaces:o,directives:i,fields:s})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(rt.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(rt.BRACE_L,this.parseFieldDefinition,rt.BRACE_R)}parseFieldDefinition(){const t=this._lexer.token,n=this.parseDescription(),r=this.parseName(),o=this.parseArgumentDefs();this.expectToken(rt.COLON);const i=this.parseTypeReference(),s=this.parseConstDirectives();return this.node(t,{kind:Dt.FIELD_DEFINITION,description:n,name:r,arguments:o,type:i,directives:s})}parseArgumentDefs(){return this.optionalMany(rt.PAREN_L,this.parseInputValueDef,rt.PAREN_R)}parseInputValueDef(){const t=this._lexer.token,n=this.parseDescription(),r=this.parseName();this.expectToken(rt.COLON);const o=this.parseTypeReference();let i;this.expectOptionalToken(rt.EQUALS)&&(i=this.parseConstValueLiteral());const s=this.parseConstDirectives();return this.node(t,{kind:Dt.INPUT_VALUE_DEFINITION,description:n,name:r,type:o,defaultValue:i,directives:s})}parseInterfaceTypeDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("interface");const r=this.parseName(),o=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),s=this.parseFieldsDefinition();return this.node(t,{kind:Dt.INTERFACE_TYPE_DEFINITION,description:n,name:r,interfaces:o,directives:i,fields:s})}parseUnionTypeDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("union");const r=this.parseName(),o=this.parseConstDirectives(),i=this.parseUnionMemberTypes();return this.node(t,{kind:Dt.UNION_TYPE_DEFINITION,description:n,name:r,directives:o,types:i})}parseUnionMemberTypes(){return this.expectOptionalToken(rt.EQUALS)?this.delimitedMany(rt.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("enum");const r=this.parseName(),o=this.parseConstDirectives(),i=this.parseEnumValuesDefinition();return this.node(t,{kind:Dt.ENUM_TYPE_DEFINITION,description:n,name:r,directives:o,values:i})}parseEnumValuesDefinition(){return this.optionalMany(rt.BRACE_L,this.parseEnumValueDefinition,rt.BRACE_R)}parseEnumValueDefinition(){const t=this._lexer.token,n=this.parseDescription(),r=this.parseEnumValueName(),o=this.parseConstDirectives();return this.node(t,{kind:Dt.ENUM_VALUE_DEFINITION,description:n,name:r,directives:o})}parseEnumValueName(){if("true"===this._lexer.token.value||"false"===this._lexer.token.value||"null"===this._lexer.token.value)throw ko(this._lexer.source,this._lexer.token.start,`${O2(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("input");const r=this.parseName(),o=this.parseConstDirectives(),i=this.parseInputFieldsDefinition();return this.node(t,{kind:Dt.INPUT_OBJECT_TYPE_DEFINITION,description:n,name:r,directives:o,fields:i})}parseInputFieldsDefinition(){return this.optionalMany(rt.BRACE_L,this.parseInputValueDef,rt.BRACE_R)}parseTypeSystemExtension(){const t=this._lexer.lookahead();if(t.kind===rt.NAME)switch(t.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(t)}parseSchemaExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");const n=this.parseConstDirectives(),r=this.optionalMany(rt.BRACE_L,this.parseOperationTypeDefinition,rt.BRACE_R);if(0===n.length&&0===r.length)throw this.unexpected();return this.node(t,{kind:Dt.SCHEMA_EXTENSION,directives:n,operationTypes:r})}parseScalarTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");const n=this.parseName(),r=this.parseConstDirectives();if(0===r.length)throw this.unexpected();return this.node(t,{kind:Dt.SCALAR_TYPE_EXTENSION,name:n,directives:r})}parseObjectTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");const n=this.parseName(),r=this.parseImplementsInterfaces(),o=this.parseConstDirectives(),i=this.parseFieldsDefinition();if(0===r.length&&0===o.length&&0===i.length)throw this.unexpected();return this.node(t,{kind:Dt.OBJECT_TYPE_EXTENSION,name:n,interfaces:r,directives:o,fields:i})}parseInterfaceTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const n=this.parseName(),r=this.parseImplementsInterfaces(),o=this.parseConstDirectives(),i=this.parseFieldsDefinition();if(0===r.length&&0===o.length&&0===i.length)throw this.unexpected();return this.node(t,{kind:Dt.INTERFACE_TYPE_EXTENSION,name:n,interfaces:r,directives:o,fields:i})}parseUnionTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const n=this.parseName(),r=this.parseConstDirectives(),o=this.parseUnionMemberTypes();if(0===r.length&&0===o.length)throw this.unexpected();return this.node(t,{kind:Dt.UNION_TYPE_EXTENSION,name:n,directives:r,types:o})}parseEnumTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const n=this.parseName(),r=this.parseConstDirectives(),o=this.parseEnumValuesDefinition();if(0===r.length&&0===o.length)throw this.unexpected();return this.node(t,{kind:Dt.ENUM_TYPE_EXTENSION,name:n,directives:r,values:o})}parseInputObjectTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const n=this.parseName(),r=this.parseConstDirectives(),o=this.parseInputFieldsDefinition();if(0===r.length&&0===o.length)throw this.unexpected();return this.node(t,{kind:Dt.INPUT_OBJECT_TYPE_EXTENSION,name:n,directives:r,fields:o})}parseDirectiveDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("directive"),this.expectToken(rt.AT);const r=this.parseName(),o=this.parseArgumentDefs(),i=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const s=this.parseDirectiveLocations();return this.node(t,{kind:Dt.DIRECTIVE_DEFINITION,description:n,name:r,arguments:o,repeatable:i,locations:s})}parseDirectiveLocations(){return this.delimitedMany(rt.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){const t=this._lexer.token,n=this.parseName();if(Object.prototype.hasOwnProperty.call(oN,n.value))return n;throw this.unexpected(t)}parseSchemaCoordinate(){const t=this._lexer.token,n=this.expectOptionalToken(rt.AT),r=this.parseName();let o,i;return!n&&this.expectOptionalToken(rt.DOT)&&(o=this.parseName()),(n||o)&&this.expectOptionalToken(rt.PAREN_L)&&(i=this.parseName(),this.expectToken(rt.COLON),this.expectToken(rt.PAREN_R)),this.node(t,n?i?{kind:Dt.DIRECTIVE_ARGUMENT_COORDINATE,name:r,argumentName:i}:{kind:Dt.DIRECTIVE_COORDINATE,name:r}:o?i?{kind:Dt.ARGUMENT_COORDINATE,name:r,fieldName:o,argumentName:i}:{kind:Dt.MEMBER_COORDINATE,name:r,memberName:o}:{kind:Dt.TYPE_COORDINATE,name:r})}node(t,n){return!0!==this._options.noLocation&&(n.loc=new Fie(t,this._lexer.lastToken,this._lexer.source)),n}peek(t){return this._lexer.token.kind===t}expectToken(t){const n=this._lexer.token;if(n.kind===t)return this.advanceLexer(),n;throw ko(this._lexer.source,n.start,`Expected ${cN(t)}, found ${O2(n)}.`)}expectOptionalToken(t){return this._lexer.token.kind===t&&(this.advanceLexer(),!0)}expectKeyword(t){const n=this._lexer.token;if(n.kind!==rt.NAME||n.value!==t)throw ko(this._lexer.source,n.start,`Expected "${t}", found ${O2(n)}.`);this.advanceLexer()}expectOptionalKeyword(t){const n=this._lexer.token;return n.kind===rt.NAME&&n.value===t&&(this.advanceLexer(),!0)}unexpected(t){const n=t??this._lexer.token;return ko(this._lexer.source,n.start,`Unexpected ${O2(n)}.`)}any(t,n,r){this.expectToken(t);const o=[];for(;!this.expectOptionalToken(r);)o.push(n.call(this));return o}optionalMany(t,n,r){if(this.expectOptionalToken(t)){const o=[];do{o.push(n.call(this))}while(!this.expectOptionalToken(r));return o}return[]}many(t,n,r){this.expectToken(t);const o=[];do{o.push(n.call(this))}while(!this.expectOptionalToken(r));return o}delimitedMany(t,n){this.expectOptionalToken(t);const r=[];do{r.push(n.call(this))}while(this.expectOptionalToken(t));return r}advanceLexer(){const{maxTokens:t}=this._options,n=this._lexer.advance();if(n.kind!==rt.EOF&&(++this._tokenCounter,void 0!==t&&this._tokenCounter>t))throw ko(this._lexer.source,n.start,`Document contains more that ${t} tokens. Parsing aborted.`)}}function O2(e){const t=e.value;return cN(e.kind)+(null!=t?` "${t}"`:"")}function cN(e){return function ile(e){return e===rt.BANG||e===rt.DOLLAR||e===rt.AMP||e===rt.PAREN_L||e===rt.PAREN_R||e===rt.DOT||e===rt.SPREAD||e===rt.COLON||e===rt.EQUALS||e===rt.AT||e===rt.BRACKET_L||e===rt.BRACKET_R||e===rt.BRACE_L||e===rt.PIPE||e===rt.BRACE_R}(e)?`"${e}"`:e}var P2=new Map,e4=new Map,uN=!0,B2=!1;function dN(e){return e.replace(/[\s,]+/g," ").trim()}function Ile(e){var t=dN(e);if(!P2.has(t)){var n=function yle(e,t){const n=new Df(e,t),r=n.parseDocument();return Object.defineProperty(r,"tokenCount",{enumerable:!1,value:n.tokenCount}),r}(e,{experimentalFragmentVariables:B2,allowLegacyFragmentVariables:B2});if(!n||"Document"!==n.kind)throw new Error("Not a valid GraphQL document.");P2.set(t,function Ele(e){var t=new Set(e.definitions);t.forEach(function(r){r.loc&&delete r.loc,Object.keys(r).forEach(function(o){var i=r[o];i&&"object"==typeof i&&t.add(i)})});var n=e.loc;return n&&(delete n.startToken,delete n.endToken),e}(function Tle(e){var t=new Set,n=[];return e.definitions.forEach(function(r){if("FragmentDefinition"===r.kind){var o=r.name.value,i=function ble(e){return dN(e.source.body.substring(e.start,e.end))}(r.loc),s=e4.get(o);s&&!s.has(i)?uN&&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||e4.set(o,s=new Set),s.add(i),t.has(i)||(t.add(i),n.push(r))}else n.push(r)}),Nh(Nh({},e),{definitions:n})}(n)))}return P2.get(t)}function jd(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];"string"==typeof e&&(e=[e]);var r=e[0];return t.forEach(function(o,i){r+=o&&"Document"===o.kind?o.loc.source.body:o,r+=e[i+1]}),Ile(r)}var Lf_gql=jd,Lf_resetCaches=function Ale(){P2.clear(),e4.clear()},Lf_disableFragmentWarnings=function Sle(){uN=!1},Lf_enableExperimentalFragmentVariables=function wle(){B2=!0},Lf_disableExperimentalFragmentVariables=function Dle(){B2=!1};(function(e){e.gql=Lf_gql,e.resetCaches=Lf_resetCaches,e.disableFragmentWarnings=Lf_disableFragmentWarnings,e.enableExperimentalFragmentVariables=Lf_enableExperimentalFragmentVariables,e.disableExperimentalFragmentVariables=Lf_disableExperimentalFragmentVariables})(jd||(jd={})),jd.default=jd;const Mle=new class xle extends tM{}(class Lle extends eM{constructor(t,n){super(t,n),this.scheduler=t,this.work=n}schedule(t,n=0){return n>0?super.schedule(t,n):(this.delay=n,this.state=t,this.scheduler.flush(this),this)}execute(t,n){return n>0||this.closed?super.execute(t,n):this._execute(t,n)}requestAsyncId(t,n,r=0){return null!=r&&r>0||null==r&&this.delay>0?super.requestAsyncId(t,n,r):(t.flush(this),0)}});function hN(e){return new Lt(t=>(e().then(n=>{t.closed||(t.next(n),t.complete())},n=>{t.closed||t.error(n)}),()=>t.unsubscribe()))}class Rle{zone;constructor(t){this.zone=t}now=Date.now;schedule(t,n=0,r){return this.zone.run(()=>Mle.schedule(t,n,r))}}function t4(e,t){return e.pipe(x7(new Rle(t)))}class Ole{obsQuery;valueChanges;constructor(t,n){this.obsQuery=t,this.valueChanges=t4(Ks(this.obsQuery),n)}get options(){return this.obsQuery.options}get variables(){return this.obsQuery.variables}getCurrentResult(){return this.obsQuery.getCurrentResult()}refetch(t){return this.obsQuery.refetch(t)}fetchMore(t){return this.obsQuery.fetchMore(t)}subscribeToMore(t){return this.obsQuery.subscribeToMore(t)}updateQuery(t){return this.obsQuery.updateQuery(t)}stopPolling(){return this.obsQuery.stopPolling()}startPolling(t){return this.obsQuery.startPolling(t)}setVariables(t){return this.obsQuery.setVariables(t)}reobserve(t){return this.obsQuery.reobserve(t)}}const n4=new _t("APOLLO_FLAGS"),fN=new _t("APOLLO_OPTIONS"),pN=new _t("APOLLO_NAMED_OPTIONS");class gN{ngZone;flags;_client;useMutationLoading;constructor(t,n,r){this.ngZone=t,this.flags=n,this._client=r,this.useMutationLoading=n?.useMutationLoading??!1}watchQuery(t){return new Ole(this.ensureClient().watchQuery({...t}),this.ngZone)}query(t){return hN(()=>this.ensureClient().query({...t}))}mutate(t){return function kle(e,t){return t?e.pipe(dr(n=>({...n,loading:!1})),function Nle(...e){const t=I0(e);return Ni((n,r)=>{(t?Tf(e,n,t):Tf(e,n)).subscribe(r)})}({data:void 0,loading:!0})):e.pipe(dr(n=>({...n,loading:!1})))}(hN(()=>this.ensureClient().mutate({...t})),t.useMutationLoading??this.useMutationLoading)}watchFragment(t){const{useZone:n,...r}=t,o=this.ensureClient().watchFragment({...r});return!0!==n?o:t4(o,this.ngZone)}subscribe(t){const{useZone:n,...r}=t,o=this.ensureClient().subscribe({...r});return!0!==n?o:t4(o,this.ngZone)}get client(){return this.ensureClient()}set client(t){if(this._client)throw new Error("Client has been already defined");this._client=t}ensureClient(){return this.checkInstance(),this._client}checkInstance(){if(this._client)return!0;throw new Error("Client has not been defined yet")}}let r4=(()=>{class e extends gN{map=new Map;constructor(n,r,o,i){if(super(n,i),r&&this.createDefault(r),o&&"object"==typeof o)for(let s in o)o.hasOwnProperty(s)&&this.create(o[s],s)}create(n,r){o4(r)?this.createNamed(r,n):this.createDefault(n)}default(){return this}use(n){return o4(n)?this.map.get(n):this.default()}createDefault(n){if(this._client)throw new Error("Apollo has been already created.");this.client=this.ngZone.runOutsideAngular(()=>new K3(n))}createNamed(n,r){if(this.map.has(n))throw new Error(`Client ${n} has been already created`);this.map.set(n,new gN(this.ngZone,this.flags,this.ngZone.runOutsideAngular(()=>new K3(r))))}removeClient(n){o4(n)?this.map.delete(n):this._client=void 0}static \u0275fac=function(r){return new(r||e)(jt(pr),jt(fN,8),jt(pN,8),jt(n4,8))};static \u0275prov=Te({token:e,factory:e.\u0275fac})}return e})();function o4(e){return!!e&&"default"!==e}const i4=jd,F2=(e,t)=>e&&t?[...e.keys()].reduce((n,r)=>n.set(r,e.get(r)),t):t||e;const s4={batchInterval:10,batchMax:10,uri:"graphql",method:"POST",withCredentials:!1,includeQuery:!0,includeExtensions:!1,useMultipart:!1};function Ga(e,t,n){return function H2(...e){return e.find(t=>typeof t<"u")}(e[n],t[n],s4[n])}class Fle extends ui{httpClient;options;requester;print=b2;constructor(t,n){super(),this.httpClient=t,this.options=n,this.options.operationPrinter&&(this.print=this.options.operationPrinter),this.requester=r=>new Lt(o=>{const i=r.getContext();let s=Ga(i,this.options,"method");const a=Ga(i,this.options,"includeQuery"),l=Ga(i,this.options,"includeExtensions"),c=Ga(i,this.options,"uri"),u=Ga(i,this.options,"withCredentials"),d=Ga(i,this.options,"useMultipart"),f=!0===this.options.useGETForQueries,y=F2(i.httpContext,F2(this.options.httpContext,new c8)),R=r.query.definitions.some(_e=>"OperationDefinition"===_e.kind&&"query"===_e.operation);f&&R&&(s="GET");const Z={method:s,url:"function"==typeof c?c(r):c,body:{operationName:r.operationName,variables:r.variables},options:{withCredentials:u,useMultipart:d,headers:this.options.headers,context:y}};l&&(Z.body.extensions=r.extensions),a&&(Z.body.query=this.print(r.query));const X=function CN(e){let t=e.headers&&e.headers instanceof ci?e.headers:new ci(e.headers);if(e.clientAwareness){const{name:n,version:r}=e.clientAwareness;n&&!t.has("apollographql-client-name")&&(t=t.set("apollographql-client-name",n)),r&&!t.has("apollographql-client-version")&&(t=t.set("apollographql-client-version",r))}return t}(i);Z.options.headers=((e,t)=>e&&t?t.keys().reduce((r,o)=>r.set(o,t.getAll(o)),e):t||e)(Z.options.headers,X);const ae=((e,t,n)=>{const r=-1!==["POST","PUT","PATCH"].indexOf(e.method.toUpperCase()),i=e.body.length;let a,s=e.options&&e.options.useMultipart;if(s){if(i)return new Lt(c=>c.error(new Error("File upload is not available when combined with Batching")));if(!r)return new Lt(c=>c.error(new Error("File upload is not available when GET is used")));if(!n)return new Lt(c=>c.error(new Error('To use File upload you need to pass "extractFiles" function from "extract-files" library to HttpLink\'s options')));a=n(e.body),s=!!a.files.size}let l={};if(i){if(!r)return new Lt(c=>c.error(new Error("Batching is not available for GET requests")));l={body:e.body}}else l=r?{body:s?a.clone:e.body}:{params:Object.keys(e.body).reduce((d,f)=>{const y=e.body[f];return d[f]=-1!==["variables","extensions"].indexOf(f.toLowerCase())?JSON.stringify(y):y,d},{})};if(s&&r){const c=new FormData;c.append("operations",JSON.stringify(l.body));const u={},d=a.files;let f=0;d.forEach(y=>{u[++f]=y}),c.append("map",JSON.stringify(u)),f=0,d.forEach((y,R)=>{c.append(++f+"",R,R.name)}),l.body=c}return t.request(e.method,e.url,{observe:"response",responseType:"json",reportProgress:!1,...l,...e.options})})(Z,this.httpClient,this.options.extractFiles).subscribe({next:_e=>{r.setContext({response:_e}),o.next(_e.body)},error:_e=>o.error(_e),complete:()=>o.complete()});return()=>{ae.closed||ae.unsubscribe()}})}request(t){return this.requester(t)}}let Hle=(()=>{class e{httpClient;constructor(n){this.httpClient=n}create(n){return new Fle(this.httpClient,n)}static \u0275fac=function(r){return new(r||e)(jt(Hl))};static \u0275prov=Te({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();function yN(e,t){this.v=e,this.k=t}function a4(e){return new yN(e,0)}function l4(e){return function(){return new xf(e.apply(this,arguments))}}function xf(e){var t,n;function r(i,s){try{var a=e[i](s),l=a.value,c=l instanceof yN;Promise.resolve(c?l.v:l).then(function(u){if(c){var d="return"===i?"return":"next";if(!l.k||u.done)return r(d,u);u=e[d](u).value}o(a.done?"return":"normal",u)},function(u){r("throw",u)})}catch(u){o("throw",u)}}function o(i,s){switch(i){case"return":t.resolve({value:s,done:!0});break;case"throw":t.reject(s);break;default:t.resolve({value:s,done:!1})}(t=t.next)?r(t.key,t.arg):n=null}this._invoke=function(i,s){return new Promise(function(a,l){var c={key:i,arg:s,resolve:a,reject:l,next:null};n?n=n.next=c:(t=n=c,r(i,s))})},"function"!=typeof e.return&&(this.return=void 0)}function c4(e){var t,n,r,o=2;for(typeof Symbol<"u"&&(n=Symbol.asyncIterator,r=Symbol.iterator);o--;){if(n&&null!=(t=e[n]))return t.call(e);if(r&&null!=(t=e[r]))return new U2(t.call(e));n="@@asyncIterator",r="@@iterator"}throw new TypeError("Object is not async iterable")}function U2(e){function t(n){if(Object(n)!==n)return Promise.reject(new TypeError(n+" is not an object."));var r=n.done;return Promise.resolve(n.value).then(function(o){return{value:o,done:r}})}return(U2=function(r){this.s=r,this.n=r.next}).prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(r){var o=this.s.return;return void 0===o?Promise.resolve({value:r,done:!0}):t(o.apply(this.s,arguments))},throw:function(r){var o=this.s.return;return void 0===o?Promise.reject(r):t(o.apply(this.s,arguments))}},new U2(e)}function zle(e){if("next"!==e&&"complete"!==e)throw new Error(`Invalid stream event "${e}"`);return e}function jle(e,t){if(t)try{t=JSON.parse(t)}catch{throw new Error("Invalid stream data")}if("next"===e&&!t)throw new Error('Stream data must be an object for "next" events');return t||null}xf.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},xf.prototype.next=function(e){return this._invoke("next",e)},xf.prototype.throw=function(e){return this._invoke("throw",e)},xf.prototype.return=function(e){return this._invoke("return",e)};var Gd=function(e){return e[e.NewLine=10]="NewLine",e[e.CarriageReturn=13]="CarriageReturn",e[e.Space=32]="Space",e[e.Colon=58]="Colon",e}(Gd||{});class gs extends Error{constructor(t){let n,r;!function Zle(e){return function $le(e){return"object"==typeof e&&null!==e}(e)&&"boolean"==typeof e.ok&&"number"==typeof e.status&&"string"==typeof e.statusText}(t)?n=t instanceof Error?t.message:String(t):(r=t,n="Server responded with "+t.status+": "+t.statusText),super(n),this.name=this.constructor.name,this.response=r}}function bN(e){return u4.apply(this,arguments)}function u4(){return u4=(0,K.A)(function*(e){const{signal:t,url:n,credentials:r,headers:o,body:i,referrer:s,referrerPolicy:a,fetchFn:l,onMessage:c}=e,u={},d={};let f;try{f=yield l(n,{signal:t,method:i?"POST":"GET",credentials:r,referrer:s,referrerPolicy:a,headers:{...o,accept:"text/event-stream"},body:i})}catch(Z){throw new gs(Z)}if(!f.ok)throw new gs(f);if(!f.body)throw new Error("Missing response body");let R,y=null;return(0,K.A)(function*(){var Z;try{const mt=function Gle(){let e,t,n,r=!1,o={event:"",data:""},i=[];const s=new TextDecoder;return function(l){if(void 0===e)e=l,t=0,n=-1;else{const d=new Uint8Array(e.length+l.length);d.set(e),d.set(l,e.length),e=d}const c=e.length;let u=0;for(;t<c;){r&&(e[t]===Gd.NewLine&&(u=++t),r=!1);let d=-1;for(;t<c&&-1===d;++t)switch(e[t]){case Gd.Colon:-1===n&&(n=t-u);break;case Gd.CarriageReturn:r=!0;case Gd.NewLine:d=t}if(-1===d)break;if(u===d){if(o.event||o.data){if(!o.event)throw new Error("Missing message event");const f=zle(o.event),y=jle(f,o.data);i.push({event:f,data:y}),o={event:"",data:""}}}else if(n>0){const f=e.subarray(u,d),y=s.decode(f.subarray(0,n)),Z=s.decode(f.subarray(n+(f[n+1]===Gd.Space?2:1)));switch(y){case"event":o.event=Z;break;case"data":o.data=o.data?o.data+"\n"+Z:Z}}u=t,n=-1}if(u===c){e=void 0;const d=[...i];return i=[],d}0!==u&&(e=e.subarray(u),t-=u)}}();var _e,X=!1,ae=!1;try{for(var ot,Ye=c4(function qle(e){return"function"==typeof Object(e)[Symbol.asyncIterator]?e:l4(function*(){const t=e.getReader();let n;do{n=yield a4(t.read()),void 0!==n.value&&(yield n.value)}while(!n.done)})()}(f.body));X=!(ot=yield Ye.next()).done;X=!1){const Xt=ot.value;{if("string"==typeof Xt)throw y=new Error(`Unexpected string chunk "${Xt}"`);let Tn;try{Tn=mt(Xt)}catch(nn){throw y=nn}if(!Tn)continue;for(const nn of Tn){try{c?.(nn)}catch(Dn){throw y=Dn}const Vn=nn.data&&"id"in nn.data?nn.data.id:"";switch(Vn in d||(d[Vn]=[]),nn.event){case"next":d[Vn].push(Vn?nn.data.payload:nn.data);break;case"complete":d[Vn].push("complete");break;default:throw y=new Error(`Unexpected message event "${nn.event}"`)}null===(Z=u[Vn])||void 0===Z||Z.proceed()}}}}catch(Xt){ae=!0,_e=Xt}finally{try{X&&null!=Ye.return&&(yield Ye.return())}finally{if(ae)throw _e}}if(Object.keys(u).length)throw new Error("Connection closed while having active streams")}catch(mt){y=!y&&Object.keys(u).length?new gs(mt):mt,R?.(y)}finally{Object.values(u).forEach(({proceed:mt})=>mt())}})(),{url:n,headers:o,waitForThrow:()=>new Promise((Z,X)=>{if(y)return X(y);R=X}),getResults:Z=>l4(function*(){var X;const{signal:ae,operationId:_e=""}=Z??{};try{for(;;){for(;null!==(X=d[_e])&&void 0!==X&&X.length;){const Ye=d[_e].shift();if("complete"===Ye)return;yield Ye}if(y)throw y;if(ae?.aborted)throw new Error("Getting results aborted by the client");yield a4(new Promise(Ye=>{const ot=()=>{ae?.removeEventListener("abort",ot),delete u[_e],Ye()};ae?.addEventListener("abort",ot),u[_e]={proceed:ot}}))}}finally{delete d[_e]}})()}}),u4.apply(this,arguments)}class Yle extends ui{constructor(t){super(),this.client=function Wle(e){const{singleConnection:t=!1,lazy:n=!0,lazyCloseTimeout:r=0,onNonLazyError:o=console.error,generateID:i=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,Vn=>{const Dn=16*Math.random()|0;return("x"==Vn?Dn:3&Dn|8).toString(16)})},retryAttempts:s=5,retry:a=function(){var nn=(0,K.A)(function*(Dn){let Xn=1e3;for(let Ei=0;Ei<Dn;Ei++)Xn*=2;yield new Promise(Ei=>setTimeout(Ei,Xn+Math.floor(2700*Math.random()+300)))});return function Vn(Dn){return nn.apply(this,arguments)}}(),credentials:l="same-origin",referrer:c,referrerPolicy:u,onMessage:d,on:f}=e,y=e.fetchFn||fetch,R=e.abortControllerImpl||AbortController,Z=(()=>{let nn=!1;const Vn=[];return{get disposed(){return nn},onDispose:Dn=>nn?(setTimeout(()=>Dn(),0),()=>{}):(Vn.push(Dn),()=>{Vn.splice(Vn.indexOf(Dn),1)}),dispose(){if(!nn){nn=!0;for(const Dn of[...Vn])Dn()}}}})();let X,ae,_e=0,Ye=null,ot=0;function mt(){return Xt.apply(this,arguments)}function Xt(){return(Xt=(0,K.A)(function*(){try{if(Z.disposed)throw new Error("Client has been disposed");return yield ae??(ae=(0,K.A)(function*(){var nn,Vn,Dn;if(Ye){if(yield a(ot),X.signal.aborted)throw new Error("Connection aborted by the client");ot++}null===(nn=f?.connecting)||void 0===nn||nn.call(f,!!Ye),X=new R;const Xn=Z.onDispose(()=>X.abort());X.signal.addEventListener("abort",()=>{Xn(),ae=void 0});const Ei=e,mo="function"==typeof Ei.url?yield Ei.url(void 0):Ei.url;if(X.signal.aborted)throw new Error("Connection aborted by the client");const Do="function"==typeof Ei.headers?yield Ei.headers(void 0):null!==(Vn=Ei.headers)&&void 0!==Vn?Vn:{};if(X.signal.aborted)throw new Error("Connection aborted by the client");let Ro;try{Ro=yield y(mo,{signal:X.signal,method:"PUT",credentials:l,referrer:c,referrerPolicy:u,headers:Do})}catch(vs){throw new gs(vs)}if(201!==Ro.status)throw new gs(Ro);const da=yield Ro.text();Do["x-graphql-event-stream-token"]=da;const Ya=yield bN({signal:X.signal,headers:Do,credentials:l,referrer:c,referrerPolicy:u,url:mo,fetchFn:y,onMessage:vs=>{var _a;null===(_a=f?.message)||void 0===_a||_a.call(f,vs),d?.(vs)}});return null===(Dn=f?.connected)||void 0===Dn||Dn.call(f,!!Ye),Ya.waitForThrow().catch(()=>ae=void 0),Ya})())}catch(nn){throw ae=void 0,nn}})).apply(this,arguments)}function Tn(nn,Vn,Dn){if(!t){const mo=new R,Do=Z.onDispose(()=>{Do(),mo.abort()});return(0,K.A)(function*(){var Ro,da,Ya,vs,_a;let Ii=null,du=0;for(;;)try{if(Ii){if(yield a(du),mo.signal.aborted)throw new Error("Connection aborted by the client");du++}null===(Ro=f?.connecting)||void 0===Ro||Ro.call(f,!!Ii),null===(da=Dn?.connecting)||void 0===da||da.call(Dn,!!Ii);const os=e,u1e="function"==typeof os.url?yield os.url(nn):os.url;if(mo.signal.aborted)throw new Error("Connection aborted by the client");const d1e="function"==typeof os.headers?yield os.headers(nn):null!==(Ya=os.headers)&&void 0!==Ya?Ya:{};if(mo.signal.aborted)throw new Error("Connection aborted by the client");const{getResults:_1e}=yield bN({signal:mo.signal,headers:{...d1e,"content-type":"application/json; charset=utf-8"},credentials:l,referrer:c,referrerPolicy:u,url:u1e,body:JSON.stringify(nn),fetchFn:y,onMessage:hu=>{var B4,F4;null===(B4=f?.message)||void 0===B4||B4.call(f,hu),null===(F4=Dn?.message)||void 0===F4||F4.call(Dn,hu),d?.(hu)}});null===(vs=f?.connected)||void 0===vs||vs.call(f,!!Ii),null===(_a=Dn?.connected)||void 0===_a||_a.call(Dn,!!Ii);var ha,Uf=!1,Yd=!1;try{for(var _u,oc=c4(_1e());Uf=!(_u=yield oc.next()).done;Uf=!1)Ii=null,du=0,Vn.next(_u.value)}catch(hu){Yd=!0,ha=hu}finally{try{Uf&&null!=oc.return&&(yield oc.return())}finally{if(Yd)throw ha}}return mo.abort()}catch(os){if(mo.signal.aborted)return;if(!(os instanceof gs)||!s||du>=s)throw os;Ii=os}})().then(()=>Vn.complete()).catch(Ro=>Vn.error(Ro)),()=>mo.abort()}_e++;const Xn=new R,Ei=Z.onDispose(()=>{Ei(),Xn.abort()});return(0,K.A)(function*(){const mo=i();nn={...nn,extensions:{...nn.extensions,operationId:mo}};let Do=null;for(;;){Do=null;try{const{url:Ii,headers:du,getResults:Uf}=yield mt();let Yd;try{Yd=yield y(Ii,{signal:Xn.signal,method:"POST",credentials:l,referrer:c,referrerPolicy:u,headers:{...du,"content-type":"application/json; charset=utf-8"},body:JSON.stringify(nn)})}catch(ha){throw new gs(ha)}if(202!==Yd.status)throw new gs(Yd);Do=function(){var ha=(0,K.A)(function*(){let oc;try{const _u=new R,os=Z.onDispose(()=>{os(),_u.abort()});oc=yield y(Ii+"?operationId="+mo,{signal:_u.signal,method:"DELETE",credentials:l,referrer:c,referrerPolicy:u,headers:du})}catch(_u){throw new gs(_u)}if(200!==oc.status)throw new gs(oc)});return function(){return ha.apply(this,arguments)}}();var Ya,Ro=!1,da=!1;try{for(var _a,vs=c4(Uf({signal:Xn.signal,operationId:mo}));Ro=!(_a=yield vs.next()).done;Ro=!1)Ye=null,ot=0,Vn.next(_a.value)}catch(ha){da=!0,Ya=ha}finally{try{Ro&&null!=vs.return&&(yield vs.return())}finally{if(da)throw Ya}}return Do=null,Xn.abort()}catch(Ii){if(Xn.signal.aborted)return yield Do?.();if(!(Ii instanceof gs)||(n&&(ae=void 0),!s||ot>=s))throw Xn.abort(),Ii;Ye=Ii}finally{Xn.signal.aborted&&0===--_e&&(isFinite(r)&&r>0?setTimeout(()=>{_e||X.abort()},r):X.abort())}}})().then(()=>Vn.complete()).catch(mo=>Vn.error(mo)),()=>Xn.abort()}return t&&!n&&(0,K.A)(function*(){for(_e++;;)try{const{waitForThrow:nn}=yield mt();yield nn()}catch(nn){if(Z.disposed)return;if(!(nn instanceof gs)||(ae=void 0,!s||ot>=s))return o?.(nn);Ye=nn}})(),{subscribe:Tn,iterate(nn,Vn){const Dn=[],Xn={done:!1,error:null,resolve:()=>{}},Ei=Tn(nn,{next(Do){Dn.push(Do),Xn.resolve()},error(Do){Xn.done=!0,Xn.error=Do,Xn.resolve()},complete(){Xn.done=!0,Xn.resolve()}},Vn),mo=(Do=l4(function*(){for(;;){for(Dn.length||(yield a4(new Promise(da=>Xn.resolve=da)));Dn.length;)yield Dn.shift();if(Xn.error)throw Xn.error;if(Xn.done)return}}),function Ro(){return Do.apply(this,arguments)})();var Do;return mo.throw=function(){var Do=(0,K.A)(function*(Ro){return Xn.done||(Xn.done=!0,Xn.error=Ro,Xn.resolve()),{done:!0,value:void 0}});return function(Ro){return Do.apply(this,arguments)}}(),mo.return=(0,K.A)(function*(){return Ei(),{done:!0,value:void 0}}),mo},dispose(){Z.dispose()}}}(t)}request(t){return new Lt(n=>this.client.subscribe({...t,query:b2(t.query)},{next:n.next.bind(n),complete:n.complete.bind(n),error:n.error.bind(n)}))}}const Kle={run:e=>e(),runOutsideAngular:e=>e()};let TN=(()=>{class e{constructor(){this.httpLink=fe(Hle),this.gatewayService=fe(dx),this.apollo=(n,r=!1)=>new r4(Kle,this.createApolloOptions(n,r))}createApolloOptions(n,r=!1){const o=new HM(l=>{const c=l.headers instanceof ci?l.headers:new ci(l.headers??{});return{...l,uri:()=>this.gatewayService.getGatewayUrl(n,r),headers:c.set("Authorization",`Bearer ${n.token}`).set("Accept","charset=utf-8")}}),i=Jie(({query:l})=>{const c=b3(l);return"OperationDefinition"===c.kind&&"subscription"===c.operation},new Yle({url:()=>this.gatewayService.getGatewayUrl(n,r),headers:()=>({Authorization:`Bearer ${n.token}`})}),this.httpLink.create({}));return{link:ui.from([o,i]),cache:new FM}}static{this.\u0275fac=function(r){return new(r||e)}}static{this.\u0275prov=Te({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();var $d=it(7184);let V2=(()=>{class e{constructor(){this.apolloFactory=fe(TN),this.luigiCoreService=fe(po)}read(n,r,o,i,s=!0){const a=B(i),l=this.getNamespace(i);let c=this.resolveReadQuery(r,o,n,a?l:void 0);return c=this.parseGQLQuery(c),this.apolloFactory.apollo(i,s).query({query:c,variables:{name:n,...a&&{namespace:l}}}).pipe(dr(u=>E(u.data,M(r,"."))))}resolveReadQuery(n,r,o,i){if(r instanceof Array){const{entity:s,version:a,apiGroup:l}=n,c=[{operation:s,variables:{name:{value:o,type:"String!"},...i&&{namespace:{value:i,type:"String"}}},fields:r}],u=this.calcQueryOptions(c,[{operation:l},{operation:a}]);return $d.P(u).query}return r}list(n,r,o,i=!1,s){const l={...B(o)&&{namespace:{type:"String",value:this.getNamespace(o)}},...s?.limit&&{limit:{type:"Int",value:s?.limit}},...s?.continue&&{continue:{type:"String",value:s?.continue}}},c=o.resourceDefinition;return c?r instanceof Array?this.listWithFields(c,r,o,i,l):this.listWithRawQuery(n,r,o,i,l):Jl(()=>new Error("Resource definition is required"))}getResourceReadyStatus(n,r){const o=r.resourceDefinition?.readyCondition;return!o||L(n,o)}listWithFields(n,r,o,i,s){const{apiGroup:a,entityCollection:l,version:c}=n,d=this.calcQueryOptions([{operation:l,variables:s,fields:["resourceVersion","remainingItemCount","continue",{items:r}]}],[{operation:a},{operation:c}]),f=$d.P(d),y=this.parseGQLQuery(f.query);return this.apolloFactory.apollo(o,i).query({query:y,variables:f.variables}).pipe(dr(R=>{const Z=E(R.data,M({apiGroup:a,version:c,entity:l},"."));if(!Z)throw new Error("Resource list result not found");return Z}),dr(R=>{const Z=R.items.map(X=>({...X,ready:this.getResourceReadyStatus(X,o)})).map(X=>({...X,isAvailable:this.isAvailable(X),accessibleName:this.getAccessibleName(X)}));return{...R,items:Z}}))}isAvailable(n){return!!n.ready&&!n.metadata?.deletionTimestamp}getAccessibleName(n){return n.metadata?.deletionTimestamp?"Resource is pending deletion":n.ready?void 0:"Resource is not ready"}listWithRawQuery(n,r,o,i,s){const a=this.parseGQLQuery(r);return this.apolloFactory.apollo(o,i).query({query:a,variables:this.normalizeGqlBuilderVariables(s)}).pipe(dr(l=>E(l.data,n)??[]),za(l=>(this.alertErrors(l),console.error("Error executing GraphQL query.",l),Jl(()=>l))))}resourceChangeSubscription(n,r,o,i,s){const l={...B(o)&&{namespace:{type:"String",value:this.getNamespace(o)}}},c=n.toLowerCase(),u=$d.gP({operation:c,fields:["type",{object:r}],variables:{...l,resourceVersion:{type:"String",value:i}}}),d=this.parseGQLQuery(u.query);return this.apolloFactory.apollo(o,s).subscribe({query:d,variables:u.variables}).pipe(dr(f=>{const y=E(f.data,c);return y&&(y.object.ready=this.getResourceReadyStatus(y.object,o),y.object.isAvailable=this.isAvailable(y.object),y.object.accessibleName=this.getAccessibleName(y.object)),y}))}alertErrors(n){this.luigiCoreService.showAlert({text:n.message,type:"error"})}delete(n,r,o,i=!1){const s=B(o),{apiGroup:a,entity:l,version:c}=r,u=[{operation:`delete${l}`,variables:{name:{type:"String!",value:n.metadata.name},...s&&{namespace:{type:"String",value:this.getNamespace(o)}}},fields:[]}],d=this.calcQueryOptions(u,[{operation:a},{operation:c}]),f=$d.gO(d),y=this.parseGQLQuery(f.query);return this.apolloFactory.apollo(o,i).mutate({mutation:y,variables:f.variables}).pipe(za(R=>(this.alertErrors(R),console.error("Error executing GraphQL query.",R),Jl(()=>R))))}create(n,r,o){const i=B(o),{apiGroup:s,entity:a,version:l}=r,c=this.getNamespace(o,n),u=[{operation:`create${a}`,variables:{...i&&{namespace:{type:"String",value:c}},object:{type:`${a}Input!`,value:n}},fields:["__typename"]}],d=this.calcQueryOptions(u,[{operation:s},{operation:l}]),f=$d.gO(d),y=this.parseGQLQuery(f.query);return this.apolloFactory.apollo(o).mutate({mutation:y,fetchPolicy:"no-cache",variables:f.variables}).pipe(za(R=>(this.alertErrors(R),console.error("Error executing GraphQL query.",R),Jl(()=>R))))}update(n,r,o,i=!1,s=["__typename"]){const a=B(o),{apiGroup:l,entity:c,version:u}=r,d=this.getNamespace(o),f=j(n),y=[{operation:`update${c}`,variables:{...a&&{namespace:{type:"String",value:d}},name:{type:"String!",value:n.metadata.name},object:{type:`${c}Input!`,value:f}},fields:s}],R=this.calcQueryOptions(y,[{operation:l},{operation:u}]),Z=$d.gO(R),X=this.parseGQLQuery(Z.query);return this.apolloFactory.apollo(o,i).mutate({mutation:X,fetchPolicy:"no-cache",variables:Z.variables}).pipe(dr(ae=>E(ae.data,M({apiGroup:l,entity:`update${c}`,version:u},"."))),za(ae=>(this.alertErrors(ae),console.error("Error executing GraphQL query.",ae),Jl(()=>ae))))}getNamespace(n,r){if(n.namespaceId)return n.namespaceId;if(r?.metadata?.namespace)return r.metadata.namespace;const o=this.luigiCoreService.routing().getSearchParams().namespace;return o?"-all-"===o?void 0:o:void 0}normalizeGqlBuilderVariables(n){return Object.fromEntries(Object.entries(n).map(([r,o])=>[r,o.value]))}calcQueryOptions(n,r){const o=r.filter(a=>!!a?.operation);if(0===o.length){const a=n.pop();if(a&&a.operation&&a.fields)return a;throw new Error("At least one wrapper or inner fields is required")}let i=n,s=o.pop();return o.forEach(a=>{i=[{operation:s.operation,fields:n,variables:s.variables}],s=a}),{operation:s.operation,fields:i,variables:s.variables}}parseGQLQuery(n){try{return i4`
|
|
68
68
|
${n}
|
|
69
69
|
`}catch(r){throw this.luigiCoreService.showAlert({text:`Could not parse gql query: <br/><br/> ${n} <br/><br/> ${r.message}`,type:"error"}),r}}static{this.\u0275fac=function(r){return new(r||e)}}static{this.\u0275prov=Te({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();const Xle=i4`
|
|
70
70
|
{
|