@platform-mesh/portal-ui-lib 0.49.38 → 0.49.40

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -78,7 +78,7 @@ class Ys{headers;normalizedNames=new Map;lazyInit;lazyUpdate=null;constructor(e)
78
78
  * @license Angular v21.2.17
79
79
  * (c) 2010-2026 Google LLC. https://angular.dev/
80
80
  * License: MIT
81
- */globalThis.$localize=N7;const Mo=globalThis.Luigi;let Cr=(()=>{class n{setConfig(t){return Mo.setConfig(t)}get config(){return Mo.getConfig()}getConfigValue(t){return Mo.getConfigValue(t)}unloadConfig(){return Mo.unload()}sendCustomMessage(t){return Mo.sendCustomMessage(t)}configChanged(t){Mo.configChanged(t)}customMessages(){return Mo.customMessages()}navigation(){return Mo.navigation()}resetLuigi(){Mo.reset()}clearNavigationCache(){Mo.clearNavigationCache&&Mo.clearNavigationCache()}showAlert(t){return Mo.showAlert(t)}ux(){return Mo.ux()}theming(){return Mo.theming()}i18n(){return Mo.i18n()}globalSearch(){return Mo.globalSearch()}getGlobalContext(){return Mo.getGlobalContext()}getWcExtendedContext(){return document.querySelector(".wcContainer")?.querySelector("[lui_web_component]")?.extendedContext?.context}getWcModalExtendedContext(){return document.querySelector(".iframeModalCtn")?.querySelector("[lui_web_component]")?.extendedContext?.context}setGlobalContext(t,i=!1){Mo.setGlobalContext(t,i)}setInGlobalContext(t,i=!1){Mo.setGlobalContext({...this.getGlobalContext(),...t},i)}routing(){return Mo.routing()}setFeatureToggle(t){Mo.featureToggles().setFeatureToggle(t)}unsetFeatureToggle(t){Mo.featureToggles().unsetFeatureToggle(t)}unsetAllFeatureToggles(){Mo.featureToggles().getActiveFeatureToggleList().forEach(t=>{this.unsetFeatureToggle(t)})}setFeatureToggles(t){if(t)for(const i of Object.keys(t))t[i]&&this.setFeatureToggle(i)}isFeatureToggleActive(t){return Mo.featureToggles().getActiveFeatureToggleList().includes(t)}getActiveFeatureToggleList(){return Mo.featureToggles().getActiveFeatureToggleList()}setAuthData(t){Mo.auth().store.setAuthData(t),Mo.auth().store.setNewlyAuthorized()}removeAuthData(){Mo.auth().store.removeAuthData()}getAuthData(){return Mo.auth().store.getAuthData()}setCurrentLocale(t){Mo.i18n().setCurrentLocale(t)}static{this.\u0275fac=function(i){return new(i||n)}}static{this.\u0275prov=Ft({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})(),_u=(()=>{class n{constructor(t){this.http=t,this.authEventSubject=new Wn,this.parseJwt=i=>{try{return function JCe(n,e){if("string"!=typeof n)throw new x5("Invalid token specified: must be a string");e||(e={});const t=!0===e.header?0:1,i=n.split(".")[t];if("string"!=typeof i)throw new x5(`Invalid token specified: missing part #${t+1}`);let o;try{o=function QCe(n){let e=n.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return function qCe(n){return decodeURIComponent(atob(n).replace(/(.)/g,(e,t)=>{let i=t.charCodeAt(0).toString(16).toUpperCase();return i.length<2&&(i="0"+i),"%"+i}))}(e)}catch{return atob(e)}}(i)}catch(r){throw new x5(`Invalid token specified: invalid base64 for part #${t+1} (${r.message})`)}try{return JSON.parse(o)}catch(r){throw new x5(`Invalid token specified: invalid json for part #${t+1} (${r.message})`)}}(i)}catch{return null}},this.getToken=()=>{const i=this.getAuthData();return i?i.idToken:{}}}get authEvents(){return this.authEventSubject.asObservable()}authEvent(t){this.authEventSubject.next(t)}refresh(){var t=this;return(0,N.A)(function*(){const i=yield m5(t.http.post("/rest/auth/refresh",{}));return t.setAuthData(i),i})()}setAuthData(t){t&&(this.authData={accessTokenExpirationDate:this.processExpDate(t.expires_in),idToken:t.id_token})}getAuthData(){return this.authData}getUser(){const t=this.getAuthData();return t?this.parseJwt(t.idToken):{}}getUserInfo(){const t=this.getUser()||{},i=t.first_name||t.given_name||"",o=t.last_name||t.family_name||"";return{name:`${i} ${o}`,email:t.mail||t.email||"",description:t.mail||t.email||"",icon:t.icon,initials:(i[0]||"")+(o[0]||""),userId:t.userId||t.sub||""}}processExpDate(t){const i=Number(t);return(new Date).getTime()+1e3*i}static{this.\u0275fac=function(i){return new(i||n)(xn(cd))}}static{this.\u0275prov=Ft({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})(),g1=(()=>{class n{constructor(){this.http=we(cd)}getEnvConfig(){var t=this;return(0,N.A)(function*(){return t.envConfigCache||(yield m5(t.http.get("/rest/envconfig").pipe(u1(i=>t.envConfigCache=i)))),t.envConfigCache})()}static{this.\u0275fac=function(i){return new(i||n)}}static{this.\u0275prov=Ft({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})(),dd=(()=>{class n{constructor(){this.envConfigService=we(g1),this.luigiCoreService=we(Cr),this.fallbackLanguage="en",this.translationTable={},this.currentLanguage=""}afterInit(){this.currentLanguage=this.luigiCoreService.i18n().getCurrentLocale(),this.luigiCoreService.i18n().addCurrentLocaleChangeListener(t=>{this.currentLanguage=t})}getTranslation(t,i,o){let r=this.getInternalTranslation(t,i,o);return r||(r=this.findTranslation(t,this.translationTable,this.fallbackLanguage,i)),r||t}getTranslationAsync(t,i,o){var r=this;return(0,N.A)(function*(){return new Promise(s=>{let l=r.getInternalTranslation(t,i,o);l?s(l||t):r.translationTable&&!r.translationTable[r.fallbackLanguage]?r.fetchTranslationFile(r.fallbackLanguage).then(()=>{l=r.findTranslation(t,r.translationTable,r.fallbackLanguage,i),s(l||t)}):(l=r.findTranslation(t,r.translationTable,r.fallbackLanguage,i),s(l||t))})})()}findTranslation(t,i,o,r){if(i[o]){const s="object"==typeof i[o][t]?i[o][t].join("<br>"):i[o][t];return r?this.findInterpolations(s,r):s}}findInterpolations(t,i){if(t)return Object.keys(i).forEach(o=>{t=t.replace(new RegExp("{"+o+"}","gi"),i[o])}),t}addTranslationFile(t,i){i&&t&&(this.translationTable[t]=i)}fetchTranslationFile(t){var i=this;return(0,N.A)(function*(){return new Promise(o=>{fetch(`/assets/translation-files/${t}.json`).then(r=>r.json()).then(r=>{i.addTranslationFile(t,r),o(!0)}).catch(r=>{console.error("Error:",r),i.addTranslationFile(t,{}),o(!1)})})})()}getInternalTranslation(t,i,o){return t?(this.currentLanguage=o||this.currentLanguage||this.luigiCoreService.i18n().getCurrentLocale(),this.findTranslation(t,this.translationTable,this.currentLanguage,i)):""}getValidLanguages(){var t=this;return(0,N.A)(function*(){const i=[{value:"en",label:"USERSETTINGSDIALOG_LANGUAGE_EN"}];try{const{developmentInstance:o}=yield t.envConfigService.getEnvConfig();o&&i.push({value:"de",label:"USERSETTINGSDIALOG_LANGUAGE_DE"})}finally{return i}})()}static{this.\u0275fac=function(i){return new(i||n)}}static{this.\u0275prov=Ft({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();var m1=function(n){return n.LAST_NAVIGATION_URL="openmfp.navigation.lastUrl",n.USER_SETTINGS="openmfp.settings.userSettings",n.LOCAL_DEVELOPMENT_SETTINGS="openmfp.settings.localDevelopmentSettings",n.FEATURE_TOGGLE_SETTINGS="openmfp.settings.featureToggleSettings",n.DEVELOPMENT_MODE_CONFIG="dev-mode-settings",n}(m1||{});(0,N.A)(function*(e){return e.frame_userAccount&&e.frame_userAccount.language?(delete e.frame_userAccount.name,delete e.frame_userAccount.email):delete e.frame_userAccount,new Promise((t,i)=>{try{localStorage.setItem(m1.USER_SETTINGS,JSON.stringify(e)),t(e)}catch(o){console.error("Error storing user settings",o),i({closeDialog:!0,message:"Could not write userSettings to storage..."})}})}),document.body.classList.add("ui5-content-density-compact");let gH=(()=>{class n{constructor(){this.luigiCoreService=we(Cr)}getGatewayUrl(t,i=!1){const o=t.portalContext.crdGatewayApiUrl,r=this.extractKcpPath(o);return o?.replace(r,this.resolveKcpPath(t,i))}updateCrdGatewayUrlWithEntityPath(t){const i=this.luigiCoreService.getGlobalContext().portalContext.crdGatewayApiUrl,o=this.extractKcpPath(i);this.luigiCoreService.getGlobalContext().portalContext.crdGatewayApiUrl=i.replace(o,t)}resolveKcpPath(t,i=!1){let r=this.extractKcpPath(t.portalContext.crdGatewayApiUrl);if(t.kcpPath&&(r=t.kcpPath),i){const s=r.lastIndexOf(":");-1!==s&&(r=r.slice(0,s))}return r}extractKcpPath(t){return t.match(new RegExp("(root:orgs[^/]*)"))?.[1]||""}static{this.\u0275fac=function(i){return new(i||n)}}static{this.\u0275prov=Ft({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();const hd=new wn(n=>n.complete());function vl(n,e){return n.definitions.find(t=>"OperationDefinition"===t.kind&&!!t.name)?.name.value??e}function k7(n,e){if(!n)throw new Error(e)}function Ky(n){return O7(n,[])}function O7(n,e){switch(typeof n){case"string":return JSON.stringify(n);case"function":return n.name?`[function ${n.name}]`:"[function]";case"object":return function swe(n,e){if(null===n)return"null";if(e.includes(n))return"[Circular]";const t=[...e,n];if(function awe(n){return"function"==typeof n.toJSON}(n)){const i=n.toJSON();if(i!==n)return"string"==typeof i?i:O7(i,t)}else if(Array.isArray(n))return function cwe(n,e){if(0===n.length)return"[]";if(e.length>2)return"[Array]";const t=Math.min(10,n.length),i=n.length-t,o=[];for(let r=0;r<t;++r)o.push(O7(n[r],e));return 1===i?o.push("... 1 more item"):i>1&&o.push(`... ${i} more items`),"["+o.join(", ")+"]"}(n,t);return function lwe(n,e){const t=Object.entries(n);return 0===t.length?"{}":e.length>2?"["+function uwe(n){const e=Object.prototype.toString.call(n).replace(/^\[object /,"").replace(/]$/,"");if("Object"===e&&"function"==typeof n.constructor){const t=n.constructor.name;if("string"==typeof t&&""!==t)return t}return e}(n)+"]":"{ "+t.map(([o,r])=>o+": "+O7(r,e)).join(", ")+" }"}(n,t)}(n,e);default:return String(n)}}class dwe{constructor(e,t,i){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=i}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}}class vH{constructor(e,t,i,o,r,s){this.kind=e,this.start=t,this.end=i,this.line=o,this.column=r,this.value=s,this.prev=null,this.next=null}get[Symbol.toStringTag](){return"Token"}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}}const bH={Name:[],Document:["definitions"],OperationDefinition:["description","name","variableDefinitions","directives","selectionSet"],VariableDefinition:["description","variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["description","name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","directives","locations"],SchemaExtension:["directives","operationTypes"],DirectiveExtension:["name","directives"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"],TypeCoordinate:["name"],MemberCoordinate:["name","memberName"],ArgumentCoordinate:["name","fieldName","argumentName"],DirectiveCoordinate:["name"],DirectiveArgumentCoordinate:["name","argumentName"]},hwe=new Set(Object.keys(bH));function CH(n){const e=n?.kind;return"string"==typeof e&&hwe.has(e)}var pu=function(n){return n.QUERY="query",n.MUTATION="mutation",n.SUBSCRIPTION="subscription",n}(pu||{}),pn=function(n){return n.NAME="Name",n.DOCUMENT="Document",n.OPERATION_DEFINITION="OperationDefinition",n.VARIABLE_DEFINITION="VariableDefinition",n.SELECTION_SET="SelectionSet",n.FIELD="Field",n.ARGUMENT="Argument",n.FRAGMENT_SPREAD="FragmentSpread",n.INLINE_FRAGMENT="InlineFragment",n.FRAGMENT_DEFINITION="FragmentDefinition",n.VARIABLE="Variable",n.INT="IntValue",n.FLOAT="FloatValue",n.STRING="StringValue",n.BOOLEAN="BooleanValue",n.NULL="NullValue",n.ENUM="EnumValue",n.LIST="ListValue",n.OBJECT="ObjectValue",n.OBJECT_FIELD="ObjectField",n.DIRECTIVE="Directive",n.NAMED_TYPE="NamedType",n.LIST_TYPE="ListType",n.NON_NULL_TYPE="NonNullType",n.SCHEMA_DEFINITION="SchemaDefinition",n.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",n.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",n.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",n.FIELD_DEFINITION="FieldDefinition",n.INPUT_VALUE_DEFINITION="InputValueDefinition",n.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",n.UNION_TYPE_DEFINITION="UnionTypeDefinition",n.ENUM_TYPE_DEFINITION="EnumTypeDefinition",n.ENUM_VALUE_DEFINITION="EnumValueDefinition",n.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",n.DIRECTIVE_DEFINITION="DirectiveDefinition",n.SCHEMA_EXTENSION="SchemaExtension",n.DIRECTIVE_EXTENSION="DirectiveExtension",n.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",n.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",n.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",n.UNION_TYPE_EXTENSION="UnionTypeExtension",n.ENUM_TYPE_EXTENSION="EnumTypeExtension",n.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension",n.TYPE_COORDINATE="TypeCoordinate",n.MEMBER_COORDINATE="MemberCoordinate",n.ARGUMENT_COORDINATE="ArgumentCoordinate",n.DIRECTIVE_COORDINATE="DirectiveCoordinate",n.DIRECTIVE_ARGUMENT_COORDINATE="DirectiveArgumentCoordinate",n}(pn||{});const Uh=Object.freeze({});function fu(n,e,t=bH){const i=new Map;for(const fe of Object.values(pn))i.set(fe,Xy(e,fe));let o,m,v,r=Array.isArray(n),s=[n],l=-1,d=[],f=n;const A=[],T=[];do{l++;const fe=l===s.length,Le=fe&&0!==d.length;if(fe){if(m=0===T.length?void 0:A[A.length-1],f=v,v=T.pop(),Le)if(r){f=f.slice();let Nt=0;for(const[Zt,Zn]of d){const Ri=Zt-Nt;null===Zn?(f.splice(Ri,1),Nt++):f[Ri]=Zn}}else{f={...f};for(const[Nt,Zt]of d)f[Nt]=Zt}l=o.index,s=o.keys,d=o.edits,r=o.inArray,o=o.prev}else if(v){if(m=r?l:s[l],f=v[m],null==f)continue;A.push(m)}let Ct;if(!Array.isArray(f)){var k,Z;CH(f)||k7(!1,`Invalid AST Node: ${Ky(f)}.`);const Nt=fe?null===(k=i.get(f.kind))||void 0===k?void 0:k.leave:null===(Z=i.get(f.kind))||void 0===Z?void 0:Z.enter;if(Ct=Nt?.call(e,f,m,v,A,T),Ct===Uh)break;if(!1===Ct){if(!fe){A.pop();continue}}else if(void 0!==Ct&&(d.push([m,Ct]),!fe)){if(!CH(Ct)){A.pop();continue}f=Ct}}var ee;void 0===Ct&&Le&&d.push([m,f]),fe?A.pop():(o={inArray:r,index:l,keys:s,edits:d,prev:o},r=Array.isArray(f),s=r?f:null!==(ee=t[f.kind])&&void 0!==ee?ee:[],l=-1,d=[],v&&T.push(v),v=f)}while(void 0!==o);return 0!==d.length?d[d.length-1][1]:n}function Xy(n,e){const t=n[e];return"object"==typeof t?t:"function"==typeof t?{enter:t,leave:void 0}:{enter:n.enter,leave:n.leave}}function Lf(n){try{return n()}catch{}}const qy=Lf(()=>globalThis)||Lf(()=>window)||Lf(()=>self)||Lf(()=>global)||Lf(function(){return Lf.constructor("return this")()}),Qy="4.2.8",yH=new Map;function wH(n){const e=yH.get(n)||1;return yH.set(n,e+1),`${n}:${e}:${Math.random().toString(36).slice(2)}`}const TH="Invariant Violation";class Jy extends Error{constructor(e=TH){super(e),this.name=TH,Object.setPrototypeOf(this,Jy.prototype)}}const B7=["debug","log","warn","error","silent"];let ew=B7.indexOf("silent");function bn(n,...e){if(!n)throw bl(...e)}function P7(n){return function(e,...t){if(B7.indexOf(n)>=ew){const i=console[n]||console.log;if("number"==typeof e){const o=e;(e=SH(o))||(e=EH(o,t),t=[])}i(e,...t)}}}function bl(n,...e){return new Jy(SH(n,e)||EH(n,e))}bn.debug=P7("debug"),bn.log=P7("log"),bn.warn=P7("warn"),bn.error=P7("error");const IH=Symbol.for("ApolloErrorMessageHandler_"+Qy);function tw(n){if("string"==typeof n)return n;try{return function AH(n,e=0){const t=wH("stringifyForDisplay");return JSON.stringify(n,(i,o)=>void 0===o?t:o,e).split(JSON.stringify(t)).join("<undefined>")}(n,2).slice(0,1e3)}catch{return"<non-serializable>"}}function SH(n,e=[]){if(n)return qy[IH]&&qy[IH](n,e.map(tw))}function EH(n,e=[]){if(n)return"string"==typeof n?e.reduce((t,i)=>t.replace(/%[sdfo]/,tw(i)),n):`An error occurred! For more details, see the full error text at https://go.apollo.dev/c/err#${encodeURIComponent(JSON.stringify({version:Qy,message:n,args:e.map(tw)}))}`}const _d={...qy[Symbol.for("apollo.cacheSize")]},pwe=()=>Object.create(null),{forEach:fwe,slice:xH}=Array.prototype,{hasOwnProperty:gwe}=Object.prototype;class gu{constructor(e=!0,t=pwe){this.weakness=e,this.makeData=t}lookup(){return this.lookupArray(arguments)}lookupArray(e){let t=this;return fwe.call(e,i=>t=t.getChildTrie(i)),gwe.call(t,"data")?t.data:t.data=this.makeData(xH.call(e))}peek(){return this.peekArray(arguments)}peekArray(e){let t=this;for(let i=0,o=e.length;t&&i<o;++i){const r=t.mapFor(e[i],!1);t=r&&r.get(e[i])}return t&&t.data}remove(){return this.removeArray(arguments)}removeArray(e){let t;if(e.length){const i=e[0],o=this.mapFor(i,!1),r=o&&o.get(i);r&&(t=r.removeArray(xH.call(e,1)),!r.data&&!r.weak&&(!r.strong||!r.strong.size)&&o.delete(i))}else t=this.data,delete this.data;return t}getChildTrie(e){const t=this.mapFor(e,!0);let i=t.get(e);return i||t.set(e,i=new gu(this.weakness,this.makeData)),i}mapFor(e,t){return this.weakness&&function mwe(n){switch(typeof n){case"object":if(null===n)break;case"function":return!0}return!1}(e)?this.weak||(t?this.weak=new WeakMap:void 0):this.strong||(t?this.strong=new Map:void 0)}}function nw(){}const vwe=nw,bwe=typeof WeakRef<"u"?WeakRef:function(n){return{deref:()=>n}},Cwe=typeof WeakMap<"u"?WeakMap:Map,ywe=typeof FinalizationRegistry<"u"?FinalizationRegistry:function(){return{register:nw,unregister:nw}};class F7{constructor(e=1/0,t=vwe){this.max=e,this.dispose=t,this.map=new Cwe,this.newest=null,this.oldest=null,this.unfinalizedNodes=new Set,this.finalizationScheduled=!1,this.size=0,this.finalize=()=>{const i=this.unfinalizedNodes.values();for(let o=0;o<10024;o++){const r=i.next().value;if(!r)break;this.unfinalizedNodes.delete(r);const s=r.key;delete r.key,r.keyRef=new bwe(s),this.registry.register(s,r,r)}this.unfinalizedNodes.size>0?queueMicrotask(this.finalize):this.finalizationScheduled=!1},this.registry=new ywe(this.deleteNode.bind(this))}has(e){return this.map.has(e)}get(e){const t=this.getNode(e);return t&&t.value}getNode(e){const t=this.map.get(e);if(t&&t!==this.newest){const{older:i,newer:o}=t;o&&(o.older=i),i&&(i.newer=o),t.older=this.newest,t.older.newer=t,t.newer=null,this.newest=t,t===this.oldest&&(this.oldest=o)}return t}set(e,t){let i=this.getNode(e);return i?i.value=t:(i={key:e,value:t,newer:null,older:this.newest},this.newest&&(this.newest.newer=i),this.newest=i,this.oldest=this.oldest||i,this.scheduleFinalization(i),this.map.set(e,i),this.size++,i.value)}clean(){for(;this.oldest&&this.size>this.max;)this.deleteNode(this.oldest)}deleteNode(e){e===this.newest&&(this.newest=e.older),e===this.oldest&&(this.oldest=e.newer),e.newer&&(e.newer.older=e.older),e.older&&(e.older.newer=e.newer),this.size--;const t=e.key||e.keyRef&&e.keyRef.deref();this.dispose(e.value,t),e.keyRef?this.registry.unregister(e):this.unfinalizedNodes.delete(e),t&&this.map.delete(t)}delete(e){const t=this.map.get(e);return!!t&&(this.deleteNode(t),!0)}scheduleFinalization(e){this.unfinalizedNodes.add(e),this.finalizationScheduled||(this.finalizationScheduled=!0,queueMicrotask(this.finalize))}}function Awe(){}class iw{constructor(e=1/0,t=Awe){this.max=e,this.dispose=t,this.map=new Map,this.newest=null,this.oldest=null}has(e){return this.map.has(e)}get(e){const t=this.getNode(e);return t&&t.value}get size(){return this.map.size}getNode(e){const t=this.map.get(e);if(t&&t!==this.newest){const{older:i,newer:o}=t;o&&(o.older=i),i&&(i.newer=o),t.older=this.newest,t.older.newer=t,t.newer=null,this.newest=t,t===this.oldest&&(this.oldest=o)}return t}set(e,t){let i=this.getNode(e);return i?i.value=t:(i={key:e,value:t,newer:null,older:this.newest},this.newest&&(this.newest.newer=i),this.newest=i,this.oldest=this.oldest||i,this.map.set(e,i),i.value)}clean(){for(;this.oldest&&this.map.size>this.max;)this.delete(this.oldest.key)}delete(e){const t=this.map.get(e);return!!t&&(t===this.newest&&(this.newest=t.older),t===this.oldest&&(this.oldest=t.newer),t.newer&&(t.newer.older=t.older),t.older&&(t.older.newer=t.newer),this.map.delete(e),this.dispose(t.value,e),!0)}}const ow=new WeakSet;function DH(n){n.size<=(n.max||-1)||ow.has(n)||(ow.add(n),setTimeout(()=>{n.clean(),ow.delete(n)},100))}const rw=function(n,e){const t=new F7(n,e);return t.set=function(i,o){const r=F7.prototype.set.call(this,i,o);return DH(this),r},t},Twe=function(n,e){const t=new iw(n,e);return t.set=function(i,o){const r=iw.prototype.set.call(this,i,o);return DH(this),r},t};function NH(n,{max:e,makeCacheKey:t=i=>i}){const i=new gu(!0),o=new rw(e);return(...r)=>{const s=i.lookupArray(t(r)),l=o.get(s);if(l){if(l.error)throw l.error;return l.result}const d=o.set(s,{});try{return d.result=n(...r)}catch(f){throw d.error=f,f}}}const zh=NH((n,e)=>{bn(n&&"Document"===n.kind,1);const t=n.definitions.filter(i=>"OperationDefinition"===i.kind);e&&bn(1==t.length&&t[0].operation===e,4,e,e,t[0].operation),fu(n,{Field(i,o,r,s){if(i.alias&&("__typename"===i.alias.value||i.alias.value.startsWith("__ac_"))&&i.alias.value!==i.name.value){let l=n,d=[];for(const f of s)l=l[f],l.kind===pn.FIELD&&d.push(l.alias?.value||l.name.value);throw d.splice(-1,1,i.name.value),bl(5,i.alias.value,d.join("."),t[0].operation,vl(n,"(anonymous)"))}}})},{max:_d.checkDocument||2e3});function pd(n){return zh(n),n.definitions.filter(e=>"OperationDefinition"===e.kind)[0]}class Ks{static empty(){return new Ks(()=>hd)}static from(e){if(0===e.length)return Ks.empty();const[t,...i]=e;return t.concat(...i)}static split(e,t,i=new Ks((o,r)=>r(o))){const o=new Ks((r,s)=>e(r)?t.request(r,s):i.request(r,s));return Object.assign(o,{left:t,right:i})}static execute(e,t,i){return e.request(function Iwe(n,{client:e}){const t={query:n.query,variables:n.variables||{},extensions:n.extensions||{},operationName:vl(n.query),operationType:pd(n.query).operation};let i={...n.context};const r=()=>Object.freeze({...i});return Object.defineProperty(t,"setContext",{enumerable:!1,value:s=>{i="function"==typeof s?{...i,...s(r())}:{...i,...s}}}),Object.defineProperty(t,"getContext",{enumerable:!1,value:r}),Object.defineProperty(t,"client",{enumerable:!1,value:e}),t}(t,i),()=>hd)}static concat(...e){return Ks.from(e)}constructor(e){e&&(this.request=e)}split(e,t,i){return this.concat(Ks.split(e,t,i))}concat(...e){return 0===e.length?this:e.reduce(this.combine.bind(this),this)}combine(e,t){const i=new Ks((o,r)=>e.request(o,s=>t.request(s,r)));return Object.assign(i,{left:e,right:t})}request(e,t){throw bl(65)}left;right}const Swe=Ks.split,{toString:LH,hasOwnProperty:Ewe}=Object.prototype,MH=Function.prototype.toString,sw=new Map;function sr(n,e){try{return aw(n,e)}finally{sw.clear()}}function aw(n,e){if(n===e)return!0;const t=LH.call(n);if(t!==LH.call(e))return!1;switch(t){case"[object Array]":if(n.length!==e.length)return!1;case"[object Object]":{if(kH(n,e))return!0;const o=RH(n),r=RH(e),s=o.length;if(s!==r.length)return!1;for(let l=0;l<s;++l)if(!Ewe.call(e,o[l]))return!1;for(let l=0;l<s;++l){const d=o[l];if(!aw(n[d],e[d]))return!1}return!0}case"[object Error]":return n.name===e.name&&n.message===e.message;case"[object Number]":if(n!=n)return e!=e;case"[object Boolean]":case"[object Date]":return+n==+e;case"[object RegExp]":case"[object String]":return n==`${e}`;case"[object Map]":case"[object Set]":{if(n.size!==e.size)return!1;if(kH(n,e))return!0;const o=n.entries(),r="[object Map]"===t;for(;;){const s=o.next();if(s.done)break;const[l,d]=s.value;if(!e.has(l)||r&&!aw(d,e.get(l)))return!1}return!0}case"[object Uint16Array]":case"[object Uint8Array]":case"[object Uint32Array]":case"[object Int32Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object ArrayBuffer]":n=new Uint8Array(n),e=new Uint8Array(e);case"[object DataView]":{let o=n.byteLength;if(o===e.byteLength)for(;o--&&n[o]===e[o];);return-1===o}case"[object AsyncFunction]":case"[object GeneratorFunction]":case"[object AsyncGeneratorFunction]":case"[object Function]":{const o=MH.call(n);return o===MH.call(e)&&!function Nwe(n,e){const t=n.length-e.length;return t>=0&&n.indexOf(e,t)===t}(o,Dwe)}}return!1}function RH(n){return Object.keys(n).filter(xwe,n)}function xwe(n){return void 0!==this[n]}const Dwe="{ [native code] }";function kH(n,e){let t=sw.get(n);if(t){if(t.has(e))return!0}else sw.set(n,t=new Set);return t.add(e),!1}let Rs=null;const OH={};let Lwe=1;function BH(n){try{return n()}catch{}}const lw="@wry/context:Slot",PH=BH(()=>globalThis)||BH(()=>global)||Object.create(null),H7=PH[lw]||Array[lw]||function(n){try{Object.defineProperty(PH,lw,{value:n,enumerable:!1,writable:!1,configurable:!0})}finally{return n}}(class{constructor(){this.id=["slot",Lwe++,Date.now(),Math.random().toString(36).slice(2)].join(":")}hasValue(){for(let e=Rs;e;e=e.parent)if(this.id in e.slots){const t=e.slots[this.id];if(t===OH)break;return e!==Rs&&(Rs.slots[this.id]=t),!0}return Rs&&(Rs.slots[this.id]=OH),!1}getValue(){if(this.hasValue())return Rs.slots[this.id]}withValue(e,t,i,o){const s=Rs;Rs={parent:s,slots:{__proto__:null,[this.id]:e}};try{return t.apply(o,i)}finally{Rs=s}}static bind(e){const t=Rs;return function(){const i=Rs;try{return Rs=t,e.apply(this,arguments)}finally{Rs=i}}}static noContext(e,t,i){if(!Rs)return e.apply(i,t);{const o=Rs;try{return Rs=null,e.apply(i,t)}finally{Rs=o}}}}),L5=new H7,{hasOwnProperty:Owe}=Object.prototype,uw=Array.from||function(n){const e=[];return n.forEach(t=>e.push(t)),e};function U7(n){const{unsubscribe:e}=n;"function"==typeof e&&(n.unsubscribe=void 0,e())}const M5=[];function Mf(n,e){if(!n)throw new Error(e||"assertion failure")}function HH(n,e){const t=n.length;return t>0&&t===e.length&&n[t-1]===e[t-1]}function UH(n){switch(n.length){case 0:throw new Error("unknown value");case 1:return n[0];case 2:throw n[1]}}function zH(n){return n.slice(0)}let Pwe=(()=>{class n{constructor(t){this.fn=t,this.parents=new Set,this.childValues=new Map,this.dirtyChildren=null,this.dirty=!0,this.recomputing=!1,this.value=[],this.deps=null,++n.count}peek(){if(1===this.value.length&&!Vh(this))return VH(this),this.value[0]}recompute(t){return Mf(!this.recomputing,"already recomputing"),VH(this),Vh(this)?function Fwe(n,e){return YH(n),L5.withValue(n,Hwe,[n,e]),function zwe(n,e){if("function"==typeof n.subscribe)try{U7(n),n.unsubscribe=n.subscribe.apply(null,e)}catch{return n.setDirty(),!1}return!0}(n,e)&&function Uwe(n){n.dirty=!1,!Vh(n)&&GH(n)}(n),UH(n.value)}(this,t):UH(this.value)}setDirty(){this.dirty||(this.dirty=!0,jH(this),U7(this))}dispose(){this.setDirty(),YH(this),dw(this,(t,i)=>{t.setDirty(),KH(t,this)})}forget(){this.dispose()}dependOn(t){t.add(this),this.deps||(this.deps=M5.pop()||new Set),this.deps.add(t)}forgetDeps(){this.deps&&(uw(this.deps).forEach(t=>t.delete(this)),this.deps.clear(),M5.push(this.deps),this.deps=null)}}return n.count=0,n})();function VH(n){const e=L5.getValue();if(e)return n.parents.add(e),e.childValues.has(n)||e.childValues.set(n,[]),Vh(n)?WH(e,n):$H(e,n),e}function Hwe(n,e){n.recomputing=!0;const{normalizeResult:t}=n;let i;t&&1===n.value.length&&(i=zH(n.value)),n.value.length=0;try{if(n.value[0]=n.fn.apply(null,e),t&&i&&!HH(i,n.value))try{n.value[0]=t(n.value[0],i[0])}catch{}}catch(o){n.value[1]=o}n.recomputing=!1}function Vh(n){return n.dirty||!(!n.dirtyChildren||!n.dirtyChildren.size)}function jH(n){dw(n,WH)}function GH(n){dw(n,$H)}function dw(n,e){const t=n.parents.size;if(t){const i=uw(n.parents);for(let o=0;o<t;++o)e(i[o],n)}}function WH(n,e){Mf(n.childValues.has(e)),Mf(Vh(e));const t=!Vh(n);if(n.dirtyChildren){if(n.dirtyChildren.has(e))return}else n.dirtyChildren=M5.pop()||new Set;n.dirtyChildren.add(e),t&&jH(n)}function $H(n,e){Mf(n.childValues.has(e)),Mf(!Vh(e));const t=n.childValues.get(e);0===t.length?n.childValues.set(e,zH(e.value)):HH(t,e.value)||n.setDirty(),ZH(n,e),!Vh(n)&&GH(n)}function ZH(n,e){const t=n.dirtyChildren;t&&(t.delete(e),0===t.size&&(M5.length<100&&M5.push(t),n.dirtyChildren=null))}function YH(n){n.childValues.size>0&&n.childValues.forEach((e,t)=>{KH(n,t)}),n.forgetDeps(),Mf(null===n.dirtyChildren)}function KH(n,e){e.parents.delete(n),n.childValues.delete(e),ZH(n,e)}const Vwe={setDirty:!0,dispose:!0,forget:!0};function XH(n){const e=new Map,t=n&&n.subscribe;function i(o){const r=L5.getValue();if(r){let s=e.get(o);s||e.set(o,s=new Set),r.dependOn(s),"function"==typeof t&&(U7(s),s.unsubscribe=t(o))}}return i.dirty=function(r,s){const l=e.get(r);if(l){const d=s&&Owe.call(Vwe,s)?s:"setDirty";uw(l).forEach(f=>f[d]()),e.delete(r),U7(l)}},i}let qH;function QH(...n){return(qH||(qH=new gu("function"==typeof WeakMap))).lookupArray(n)}const hw=new Set;function R5(n,{max:e=Math.pow(2,16),keyArgs:t,makeCacheKey:i=QH,normalizeResult:o,subscribe:r,cache:s=iw}=Object.create(null)){const l="function"==typeof s?new s(e,A=>A.dispose()):s,d=function(){const A=i.apply(null,t?t.apply(null,arguments):arguments);if(void 0===A)return n.apply(null,arguments);let T=l.get(A);T||(l.set(A,T=new Pwe(n)),T.normalizeResult=o,T.subscribe=r,T.forget=()=>l.delete(A));const k=T.recompute(Array.prototype.slice.call(arguments));return l.set(A,T),hw.add(l),L5.hasValue()||(hw.forEach(Z=>Z.clean()),hw.clear()),k};function f(A){const T=A&&l.get(A);T&&T.setDirty()}function m(A){const T=A&&l.get(A);if(T)return T.peek()}function v(A){return!!A&&l.delete(A)}return Object.defineProperty(d,"size",{get:()=>l.size,configurable:!1,enumerable:!1}),Object.freeze(d.options={max:e,keyArgs:t,makeCacheKey:i,normalizeResult:o,subscribe:r,cache:l}),d.dirtyKey=f,d.dirty=function(){f(i.apply(null,arguments))},d.peekKey=m,d.peek=function(){return m(i.apply(null,arguments))},d.forgetKey=v,d.forget=function(){return v(i.apply(null,arguments))},d.makeCacheKey=i,d.getKey=t?function(){return i.apply(null,t.apply(null,arguments))}:i,Object.freeze(d)}function jwe(n){return n}class fd{transform;cached;resultCache=new WeakSet;getCacheKey(e){return[e]}static identity(){return new fd(jwe,{cache:!1})}static split(e,t,i=fd.identity()){return Object.assign(new fd(o=>(e(o)?t:i).transformDocument(o),{cache:!1}),{left:t,right:i})}constructor(e,t={}){this.transform=e,t.getCacheKey&&(this.getCacheKey=t.getCacheKey),this.cached=!1!==t.cache,this.resetCache()}resetCache(){if(this.cached){const e=new gu;this.performWork=R5(fd.prototype.performWork.bind(this),{makeCacheKey:t=>{const i=this.getCacheKey(t);if(i)return bn(Array.isArray(i),20),e.lookupArray(i)},max:_d["documentTransform.cache"],cache:F7})}}performWork(e){return zh(e),this.transform(e)}transformDocument(e){if(this.resultCache.has(e))return e;const t=this.performWork(e);return this.resultCache.add(t),t}concat(e){return Object.assign(new fd(t=>e.transformDocument(this.transformDocument(t)),{cache:!1}),{left:this,right:e})}left;right}const JH={kind:pn.FIELD,name:{kind:pn.NAME,value:"__typename"}},_w=Object.assign(function(n){return fu(n,{SelectionSet:{enter(e,t,i){if(i&&i.kind===pn.OPERATION_DEFINITION)return;const{selections:o}=e;return o&&!o.some(l=>l.kind===pn.FIELD&&("__typename"===l.name.value||0===l.name.value.lastIndexOf("__",0)))?i.kind===pn.FIELD&&i.directives&&i.directives.some(l=>"export"===l.name.value)?void 0:{...e,selections:[...o,JH]}:void 0}}})},{added:n=>n===JH}),gd=Object.assign(function(e){return JSON.stringify(e,Kwe)},{reset(){Rf=new Twe(_d.canonicalStringify||1e3)}});let Rf;function Kwe(n,e){if(e&&"object"==typeof e){const t=Object.getPrototypeOf(e);if(t===Object.prototype||null===t){const i=Object.keys(e);if(i.every(Xwe))return e;const o=JSON.stringify(i);let r=Rf.get(o);if(!r){i.sort();const l=JSON.stringify(i);r=Rf.get(l)||i,Rf.set(o,r),Rf.set(l,r)}const s=Object.create(t);return r.forEach(l=>{s[l]=e[l]}),s}}return e}function Xwe(n,e,t){return 0===e||t[e-1]<=n}function mw(n){return 9===n||32===n}function k5(n){return n>=48&&n<=57}function iU(n){return n>=97&&n<=122||n>=65&&n<=90}function oU(n){return iU(n)||95===n}function qwe(n){return iU(n)||k5(n)||95===n}function Qwe(n){var e;let t=Number.MAX_SAFE_INTEGER,i=null,o=-1;for(let s=0;s<n.length;++s){var r;const l=n[s],d=Jwe(l);d!==l.length&&(i=null!==(r=i)&&void 0!==r?r:s,o=s,0!==s&&d<t&&(t=d))}return n.map((s,l)=>0===l?s:s.slice(t)).slice(null!==(e=i)&&void 0!==e?e:0,o+1)}function Jwe(n){let e=0;for(;e<n.length&&mw(n.charCodeAt(e));)++e;return e}gd.reset();const nAe=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function iAe(n){return oAe[n.charCodeAt(0)]}const oAe=["\\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 z7(n){return fu(n,sAe)}const sAe={Name:{leave:n=>n.value},Variable:{leave:n=>"$"+n.name},Document:{leave:n=>En(n.definitions,"\n\n")},OperationDefinition:{leave(n){const e=vw(n.variableDefinitions)?Si("(\n",En(n.variableDefinitions,"\n"),"\n)"):Si("(",En(n.variableDefinitions,", "),")"),t=Si("",n.description,"\n")+En([n.operation,En([n.name,e]),En(n.directives," ")]," ");return("query"===t?"":t+" ")+n.selectionSet}},VariableDefinition:{leave:({variable:n,type:e,defaultValue:t,directives:i,description:o})=>Si("",o,"\n")+n+": "+e+Si(" = ",t)+Si(" ",En(i," "))},SelectionSet:{leave:({selections:n})=>Tc(n)},Field:{leave({alias:n,name:e,arguments:t,directives:i,selectionSet:o}){const r=Si("",n,": ")+e;let s=r+Si("(",En(t,", "),")");return s.length>80&&(s=r+Si("(\n",V7(En(t,"\n")),"\n)")),En([s,En(i," "),o]," ")}},Argument:{leave:({name:n,value:e})=>n+": "+e},FragmentSpread:{leave:({name:n,directives:e})=>"..."+n+Si(" ",En(e," "))},InlineFragment:{leave:({typeCondition:n,directives:e,selectionSet:t})=>En(["...",Si("on ",n),En(e," "),t]," ")},FragmentDefinition:{leave:({name:n,typeCondition:e,variableDefinitions:t,directives:i,selectionSet:o,description:r})=>Si("",r,"\n")+`fragment ${n}${Si("(",En(t,", "),")")} on ${e} ${Si("",En(i," ")," ")}`+o},IntValue:{leave:({value:n})=>n},FloatValue:{leave:({value:n})=>n},StringValue:{leave:({value:n,block:e})=>e?function eAe(n,e){const t=n.replace(/"""/g,'\\"""'),i=t.split(/\r\n|[\n\r]/g),o=1===i.length,r=i.length>1&&i.slice(1).every(T=>0===T.length||mw(T.charCodeAt(0))),s=t.endsWith('\\"""'),l=n.endsWith('"')&&!s,d=n.endsWith("\\"),f=l||d,m=!(null!=e&&e.minimize)&&(!o||n.length>70||f||r||s);let v="";const A=o&&mw(n.charCodeAt(0));return(m&&!A||r)&&(v+="\n"),v+=t,(m||f)&&(v+="\n"),'"""'+v+'"""'}(n):function tAe(n){return`"${n.replace(nAe,iAe)}"`}(n)},BooleanValue:{leave:({value:n})=>n?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:n})=>n},ListValue:{leave:({values:n})=>"["+En(n,", ")+"]"},ObjectValue:{leave:({fields:n})=>"{"+En(n,", ")+"}"},ObjectField:{leave:({name:n,value:e})=>n+": "+e},Directive:{leave:({name:n,arguments:e})=>"@"+n+Si("(",En(e,", "),")")},NamedType:{leave:({name:n})=>n},ListType:{leave:({type:n})=>"["+n+"]"},NonNullType:{leave:({type:n})=>n+"!"},SchemaDefinition:{leave:({description:n,directives:e,operationTypes:t})=>Si("",n,"\n")+En(["schema",En(e," "),Tc(t)]," ")},OperationTypeDefinition:{leave:({operation:n,type:e})=>n+": "+e},ScalarTypeDefinition:{leave:({description:n,name:e,directives:t})=>Si("",n,"\n")+En(["scalar",e,En(t," ")]," ")},ObjectTypeDefinition:{leave:({description:n,name:e,interfaces:t,directives:i,fields:o})=>Si("",n,"\n")+En(["type",e,Si("implements ",En(t," & ")),En(i," "),Tc(o)]," ")},FieldDefinition:{leave:({description:n,name:e,arguments:t,type:i,directives:o})=>Si("",n,"\n")+e+(vw(t)?Si("(\n",V7(En(t,"\n")),"\n)"):Si("(",En(t,", "),")"))+": "+i+Si(" ",En(o," "))},InputValueDefinition:{leave:({description:n,name:e,type:t,defaultValue:i,directives:o})=>Si("",n,"\n")+En([e+": "+t,Si("= ",i),En(o," ")]," ")},InterfaceTypeDefinition:{leave:({description:n,name:e,interfaces:t,directives:i,fields:o})=>Si("",n,"\n")+En(["interface",e,Si("implements ",En(t," & ")),En(i," "),Tc(o)]," ")},UnionTypeDefinition:{leave:({description:n,name:e,directives:t,types:i})=>Si("",n,"\n")+En(["union",e,En(t," "),Si("= ",En(i," | "))]," ")},EnumTypeDefinition:{leave:({description:n,name:e,directives:t,values:i})=>Si("",n,"\n")+En(["enum",e,En(t," "),Tc(i)]," ")},EnumValueDefinition:{leave:({description:n,name:e,directives:t})=>Si("",n,"\n")+En([e,En(t," ")]," ")},InputObjectTypeDefinition:{leave:({description:n,name:e,directives:t,fields:i})=>Si("",n,"\n")+En(["input",e,En(t," "),Tc(i)]," ")},DirectiveDefinition:{leave:({description:n,name:e,arguments:t,directives:i,repeatable:o,locations:r})=>Si("",n,"\n")+"directive @"+e+(vw(t)?Si("(\n",V7(En(t,"\n")),"\n)"):Si("(",En(t,", "),")"))+Si(" ",En(i," "))+(o?" repeatable":"")+" on "+En(r," | ")},SchemaExtension:{leave:({directives:n,operationTypes:e})=>En(["extend schema",En(n," "),Tc(e)]," ")},ScalarTypeExtension:{leave:({name:n,directives:e})=>En(["extend scalar",n,En(e," ")]," ")},ObjectTypeExtension:{leave:({name:n,interfaces:e,directives:t,fields:i})=>En(["extend type",n,Si("implements ",En(e," & ")),En(t," "),Tc(i)]," ")},InterfaceTypeExtension:{leave:({name:n,interfaces:e,directives:t,fields:i})=>En(["extend interface",n,Si("implements ",En(e," & ")),En(t," "),Tc(i)]," ")},UnionTypeExtension:{leave:({name:n,directives:e,types:t})=>En(["extend union",n,En(e," "),Si("= ",En(t," | "))]," ")},EnumTypeExtension:{leave:({name:n,directives:e,values:t})=>En(["extend enum",n,En(e," "),Tc(t)]," ")},InputObjectTypeExtension:{leave:({name:n,directives:e,fields:t})=>En(["extend input",n,En(e," "),Tc(t)]," ")},DirectiveExtension:{leave:({name:n,directives:e})=>En(["extend directive @"+n,En(e," ")]," ")},TypeCoordinate:{leave:({name:n})=>n},MemberCoordinate:{leave:({name:n,memberName:e})=>En([n,Si(".",e)])},ArgumentCoordinate:{leave:({name:n,fieldName:e,argumentName:t})=>En([n,Si(".",e),Si("(",t,":)")])},DirectiveCoordinate:{leave:({name:n})=>En(["@",n])},DirectiveArgumentCoordinate:{leave:({name:n,argumentName:e})=>En(["@",n,Si("(",e,":)")])}};function En(n,e=""){var t;return null!==(t=n?.filter(i=>i).join(e))&&void 0!==t?t:""}function Tc(n){return Si("{\n",V7(En(n,"\n")),"\n}")}function Si(n,e,t=""){return null!=e&&""!==e?n+e+t:""}function V7(n){return Si(" ",n.replace(/\n/g,"\n "))}function vw(n){var e;return null!==(e=n?.some(t=>t.includes("\n")))&&void 0!==e&&e}let O5;const B5=Object.assign(n=>{let e=O5.get(n);return e||(e=z7(n),O5.set(n,e)),e},{reset(){O5=new rw(_d.print||2e3)}});function Ro(n){return!(!n||"object"!=typeof n||"string"!=typeof n.__ref)}function P5(n={}){const{connector:e=()=>new Wn,resetOnError:t=!0,resetOnComplete:i=!0,resetOnRefCountZero:o=!0}=n;return r=>{let s,l,d,f=0,m=!1,v=!1;const A=()=>{l?.unsubscribe(),l=void 0},T=()=>{A(),s=d=void 0,m=v=!1},k=()=>{const Z=s;T(),Z?.unsubscribe()};return ia((Z,ee)=>{f++,!v&&!m&&A();const fe=d=d??e();ee.add(()=>{f--,0===f&&!v&&!m&&(l=Cw(k,o))}),fe.subscribe(ee),!s&&f>0&&(s=new vt({next:Le=>fe.next(Le),error:Le=>{v=!0,A(),l=Cw(T,t,Le),fe.error(Le)},complete:()=>{m=!0,A(),l=Cw(T,i),fe.complete()}}),hl(Z).subscribe(s))})(r)}}function Cw(n,e,...t){if(!0===e)return void n();if(!1===e)return;const i=new vt({next:()=>{i.unsubscribe(),n()}});return hl(e(...t)).subscribe(i)}function j7(n,e,t){let i,o=!1;return n&&"object"==typeof n?({bufferSize:i=1/0,windowTime:e=1/0,refCount:o=!1,scheduler:t}=n):i=n??1/0,P5({connector:()=>new $3(i,e,t),resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:o})}B5.reset();const sU=NH(function(e,t,i){return function hAe(n,e){let t,i;function o(r){return r!==t&&(t=r,i=e(t)),i}return Object.assign(n.pipe(mo(o),j7({bufferSize:1,refCount:!0})),{getCurrentResult:()=>o(n.getCurrentResult())})}(e,i)},{max:1,makeCacheKey:n=>n.slice(0,2)});function F5(n=[]){const e={};return n.forEach(t=>{e[t.name.value]=t}),e}function H5(n){return n.definitions.filter(e=>"FragmentDefinition"===e.kind)}function G7(n,e){switch(n.kind){case"InlineFragment":return n;case"FragmentSpread":{const t=n.name.value;if("function"==typeof e)return e(t);const i=e&&e[t];return bn(i,9,t),i||null}default:return null}}function yw(n){let e;zh(n);for(let t of n.definitions){if("OperationDefinition"===t.kind)return t;"FragmentDefinition"===t.kind&&!e&&(e=t)}if(e)return e;throw bl(12)}function U5(n){return"Field"===n.kind}function v1(n){return n.alias?n.alias.value:n.name.value}function W7({directives:n},e){return!n||!n.length||function fAe(n){const e=[];return n&&n.length&&n.forEach(t=>{if(!function pAe({name:{value:n}}){return"skip"===n||"include"===n}(t))return;const i=t.arguments,o=t.name.value;bn(i&&1===i.length,16,o);const r=i[0];bn(r.name&&"if"===r.name.value,17,o);const s=r.value;bn(s&&("Variable"===s.kind||"BooleanValue"===s.kind),18,o),e.push({directive:t,ifArgument:r})}),e}(n).every(({directive:t,ifArgument:i})=>{let o=!1;return"Variable"===i.value.kind?(o=e&&e[i.value.name.value],bn(void 0!==o,15,t.name.value)):o=i.value.value,"skip"===t.name.value?!o:o})}function aU(n,{data:e,...t},{data:i,...o},r){return sr(t,o)&&$7(yw(n).selectionSet,e,i,{fragmentMap:F5(H5(n)),variables:r})}function $7(n,e,t,i){if(e===t)return!0;const o=new Set;return n.selections.every(r=>{if(o.has(r)||(o.add(r),!W7(r,i.variables))||lU(r))return!0;if(U5(r)){const s=v1(r),l=e&&e[s],d=t&&t[s],f=r.selectionSet;if(!f)return sr(l,d);const m=Array.isArray(l),v=Array.isArray(d);if(m!==v)return!1;if(m&&v){const A=l.length;if(d.length!==A)return!1;for(let T=0;T<A;++T)if(!$7(f,l[T],d[T],i))return!1;return!0}return $7(f,l,d,i)}{const s=G7(r,i.fragmentMap);if(s)return!!lU(s)||$7(s.selectionSet,e,t,i)}})}function lU(n){return!!n.directives&&n.directives.some(gAe)}function gAe(n){return"nonreactive"===n.name.value}function mAe(n,e){let t=e;const i=[];return n.definitions.forEach(r=>{if("OperationDefinition"===r.kind)throw bl(10,r.operation,r.name?` named '${r.name.value}'`:"");"FragmentDefinition"===r.kind&&i.push(r)}),typeof t>"u"&&(bn(1===i.length,11,i.length),t=i[0].name.value),{...n,definitions:[{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:t}}]}},...n.definitions]}}function vAe(...n){return QH.bind(null,...n)}class cU{assumeImmutableResults=!1;lookupFragment(e){return null}batch(e){let i;return this.performTransaction(()=>i=e.update(this),"string"==typeof e.optimistic?e.optimistic:!1===e.optimistic?null:void 0),i}recordOptimisticTransaction(e,t){this.performTransaction(e,t)}transformDocument(e){return e}transformForLink(e){return e}identify(e){}gc(){return[]}modify(e){return!1}readQuery(e,t=!!e.optimistic){return this.read({...e,rootId:e.id||"ROOT_QUERY",optimistic:t})}fragmentWatches=new gu(!0);watchFragment(e){const{fragment:t,fragmentName:i,from:o}=e,r=this.getFragmentDoc(t,i),l=(Array.isArray(o)?o:[o]).map(T=>null==T?T:this.toCacheId(T));if(!Array.isArray(o)){const T=this.watchSingleFragment(l[0],r,e);return null===o?T:sU(T,Symbol.for("apollo.transform.individualResult"),k=>({...k,data:k.data??{}}))}let d;function f(T){const k=T.reduce((Z,ee,fe)=>(Z.data.push(ee.data),Z.complete&&=ee.complete,Z.dataState=Z.complete?"complete":"partial",ee.missing&&(Z.missing||={},Z.missing[fe]=ee.missing),Z),{data:[],dataState:"complete",complete:!0});return sr(d,k)||(d=k),d}if(0===l.length)return CAe;let m=!1;const v=l.map(T=>this.watchSingleFragment(T,r,e)),A=function _Ae(n){return 0===n.length?hd:new wn(e=>{const{length:t}=n,i=new Array(t),o=new Map;n.forEach((d,f)=>{o.has(d)||o.set(d,new Set),o.get(d).add(f)});let l,r=o.size,s=o.size;o.forEach((d,f)=>{let m=!1;const v=f.subscribe({next:A=>{d.forEach(T=>i[T]=A),m||(m=!0,s--),s||(l||=new Set(n.filter(T=>T.dirty)),l.delete(f),l.size||(e.next(i.slice()),l=void 0))},complete:()=>{r--,r||e.complete()},error:e.error.bind(e)});e.add(v)})})}(v).pipe(mo(f),u1({subscribe:()=>m=!0,unsubscribe:()=>m=!1}),j7({bufferSize:1,refCount:!0}));return Object.assign(A,{getCurrentResult:()=>m&&d?d:f(v.map(k=>k.getCurrentResult()))})}onAfterBroadcast=e=>e();watchSingleFragment(e,t,i){if(null===e)return bAe;const{optimistic:o=!0,variables:r}=i,s=[t,gd({id:e,optimistic:o,variables:r})],l=this.fragmentWatches.lookupArray(s);if(!l.observable){let f,m=function(A){const T=A.result;return(!f||!aU(t,{data:f.data},{data:T},i.variables))&&(f={data:T,dataState:A.complete?"complete":"partial",complete:A.complete},A.missing&&(f.missing=A.missing.missing)),f},d=!1;const v=new wn(A=>{d=!0;const T=this.watch({variables:r,returnPartialData:!0,id:e,query:t,optimistic:o,immediate:!0,callback:k=>{v.dirty=!0,this.onAfterBroadcast(()=>{A.next(m(k)),v.dirty=!1})}});return()=>{d=!1,T(),this.fragmentWatches.removeArray(s)}}).pipe(jB(),P5({connector:()=>new $3(1),resetOnRefCountZero:()=>function dAe(n=0,e,t=_ve){let i=-1;return null!=e&&(TO(e)?t=e:i=e),new wn(o=>{let r=function uAe(n){return n instanceof Date&&!isNaN(n)}(n)?+n-t.now():n;r<0&&(r=0);let s=0;return t.schedule(function(){o.closed||(o.next(s++),0<=i?this.schedule(void 0,i):o.complete())},r)})}(0)}));l.observable=Object.assign(v,{dirty:!1,getCurrentResult:()=>d&&f?f:m(this.diff({id:e,query:t,returnPartialData:!0,optimistic:o,variables:r}))})}return l.observable}getFragmentDoc=R5(mAe,{max:_d["cache.fragmentQueryDocuments"]||1e3,cache:F7,makeCacheKey:vAe(this)});readFragment(e,t=!!e.optimistic){const i=void 0!==e.from?this.toCacheId(e.from):e.id;return this.read({...e,query:this.getFragmentDoc(e.fragment,e.fragmentName),rootId:i,optimistic:t})}writeQuery({id:e,data:t,...i}){return this.write(Object.assign(i,{dataId:e||"ROOT_QUERY",result:t}))}writeFragment({data:e,fragment:t,fragmentName:i,...o}){const r=void 0!==o.from?this.toCacheId(o.from):o.id;return this.write(Object.assign(o,{query:this.getFragmentDoc(t,i),dataId:r,result:e}))}updateQuery(e,t){return this.batch({update(i){const o=i.readQuery(e),r=t(o);return null==r?o:(i.writeQuery({...e,data:r}),r)}})}updateFragment(e,t){return this.batch({update(i){const o=i.readFragment(e),r=t(o);return null==r?o:(i.writeFragment({...e,data:r}),r)}})}toCacheId(e){return"string"==typeof e?e:this.identify(e)}}const uU=Object.freeze({data:null,dataState:"complete",complete:!0}),bAe=Object.assign(new wn(n=>{n.next(uU)}),{dirty:!1,getCurrentResult:()=>uU}),dU=Object.freeze({data:[],dataState:"complete",complete:!0}),CAe=Object.assign(new wn(n=>{n.next(dU)}),{getCurrentResult:()=>dU});function Xs(n){return null!==n&&"object"==typeof n}const{hasOwnProperty:yAe}=Object.prototype,wAe=function(n,e,t){return this.merge(n[t],e[t])},hU=n=>isNaN(+n)?{}:[];class kf{options;reconciler;constructor(e={}){this.options=e,this.reconciler=e.reconciler||wAe}merge(e,t,i={}){const o=i.atPath;if(o?.length){const[r,...s]=o;void 0===e&&(e=hU(r));let l=e[r];void 0===l&&s.length&&(l=hU(s[0]));const d=this.merge(l,t,{...i,atPath:s});return l!==d&&((e=this.shallowCopyForMerge(e))[r]=d),e}return Array.isArray(e)&&Array.isArray(t)&&"truncate"===this.options.arrayMerge&&e.length>t.length&&(e=e.slice(0,t.length),this.pastCopies.add(e)),Xs(t)&&Xs(e)?(Object.keys(t).forEach(r=>{if(yAe.call(e,r)){const s=e[r];if(t[r]!==s){const l=this.reconciler(e,t,r);l!==s&&((e=this.shallowCopyForMerge(e))[r]=l)}}else(e=this.shallowCopyForMerge(e))[r]=t[r]}),e):t}isObject=Xs;pastCopies=new Set;shallowCopyForMerge(e){return Xs(e)&&(this.pastCopies.has(e)||(e=Array.isArray(e)?e.slice(0):{__proto__:Object.getPrototypeOf(e),...e},this.pastCopies.add(e))),e}}function Of(n){return{__ref:String(n)}}function b1(...n){const e={};return n.forEach(t=>{t&&Reflect.ownKeys(t).forEach(i=>{const o=t[i];void 0!==o&&(e[i]=o)})}),e}const Pr=Array.isArray,{hasOwnProperty:ms}=Object.prototype;function _U({__typename:n,id:e,_id:t},i){if("string"==typeof n&&(i&&(i.keyObject=null!=e?{id:e}:null!=t?{_id:t}:void 0),null==e&&null!=t&&(e=t),null!=e))return`${n}:${"number"==typeof e||"string"==typeof e?e:JSON.stringify(e)}`}const IAe={dataIdFromObject:_U,resultCaching:!0},pU=/^[_a-z][_0-9a-z]*/i;function Gh(n){const e=n.match(pU);return e?e[0]:n}function ww(n,e,t){return!!Xs(e)&&(Pr(e)?e.every(i=>ww(n,i,t)):n.selections.every(i=>{if(U5(i)&&W7(i,t)){const o=v1(i);return ms.call(e,o)&&(!i.selectionSet||ww(i.selectionSet,e[o],t))}return!0}))}function Bf(n){return Xs(n)&&!Ro(n)&&!Pr(n)}function fU(n,e){const t=F5(H5(n));return{fragmentMap:t,lookupFragment(i){let o=t[i];return!o&&e&&(o=e.lookup(i)),o||null}}}const Y7={},Aw=()=>Y7,gU={};class K7{policies;group;data={};constructor(e,t){this.policies=e,this.group=t}toObject(){return{...this.data}}has(e){return void 0!==this.lookup(e,!0)}get(e,t){if(this.group.depend(e,t),ms.call(this.data,e)){const i=this.data[e];if(i&&ms.call(i,t))return i[t]}return"__typename"===t&&ms.call(this.policies.rootTypenamesById,e)?this.policies.rootTypenamesById[e]:this instanceof mu?this.parent.get(e,t):void 0}lookup(e,t){return t&&this.group.depend(e,"__exists"),ms.call(this.data,e)?this.data[e]:this instanceof mu?this.parent.lookup(e,t):this.policies.rootTypenamesById[e]?{}:void 0}merge(e,t){let i;Ro(e)&&(e=e.__ref),Ro(t)&&(t=t.__ref);const o="string"==typeof e?this.lookup(i=e):e,r="string"==typeof t?this.lookup(i=t):t;if(!r)return;bn("string"==typeof i,104);const s=new kf({reconciler:LAe}).merge(o,r);if(this.data[i]=s,s!==o&&(delete this.refs[i],this.group.caching)){const l={};o||(l.__exists=1),Object.keys(r).forEach(d=>{if(!o||o[d]!==s[d]){l[d]=1;const f=Gh(d);f!==d&&!this.policies.hasKeyArgs(s.__typename,f)&&(l[f]=1),void 0===s[d]&&!(this instanceof mu)&&delete s[d]}}),l.__typename&&!(o&&o.__typename)&&this.policies.rootTypenamesById[i]===s.__typename&&delete l.__typename,Object.keys(l).forEach(d=>this.group.dirty(i,d))}}modify(e,t,i){const o=this.lookup(e);if(o){const r={};let s=!1,l=!0;const d={DELETE:Y7,INVALIDATE:gU,isReference:Ro,toReference:this.toReference,canRead:this.canRead,readField:(f,m)=>this.policies.readField("string"==typeof f?{fieldName:f,from:m||Of(e)}:f,{store:this})};if(Object.keys(o).forEach(f=>{const m=Gh(f);let v=o[f];if(void 0===v)return;const A="function"==typeof t?t:t[f]||(i?void 0:t[m]);if(A){let T=A===Aw?Y7:A(v,{...d,fieldName:m,storeFieldName:f,storage:this.getStorage(e,f)});if(T===gU)this.group.dirty(e,f);else if(T===Y7&&(T=void 0),T!==v&&(r[f]=T,s=!0,v=T,false)){const k=Z=>{if(void 0===this.lookup(Z.__ref))return!0};if(Ro(T))k(T);else if(Array.isArray(T)){let ee,Z=!1;for(const fe of T){if(Ro(fe)){if(Z=!0,k(fe))break}else if("object"==typeof fe&&fe){const[Le]=this.policies.identify(fe);Le&&(ee=fe)}if(Z&&void 0!==ee)break}}}}void 0!==v&&(l=!1)}),s)return this.merge(e,r),l&&(this instanceof mu?this.data[e]=void 0:delete this.data[e],this.group.dirty(e,"__exists")),!0}return!1}delete(e,t,i){const o=this.lookup(e);if(o){const r=this.getFieldValue(o,"__typename"),s=t&&i?this.policies.getStoreFieldName({typename:r,fieldName:t,args:i}):t;return this.modify(e,s?{[s]:Aw}:Aw,!!i)}return!1}evict(e,t){let i=!1;return e.id&&(ms.call(this.data,e.id)&&(i=this.delete(e.id,e.fieldName,e.args)),this instanceof mu&&this!==t&&(i=this.parent.evict(e,t)||i),(e.fieldName||i)&&this.group.dirty(e.id,e.fieldName||"__exists")),i}clear(){this.replace(null)}extract(){const e=this.toObject(),t=[];return this.getRootIdSet().forEach(i=>{ms.call(this.policies.rootTypenamesById,i)||t.push(i)}),t.length&&(e.__META={extraRootIds:t.sort()}),e}replace(e){if(Object.keys(this.data).forEach(t=>{e&&ms.call(e,t)||this.delete(t)}),e){const{__META:t,...i}=e;Object.keys(i).forEach(o=>{this.merge(o,i[o])}),t&&t.extraRootIds.forEach(this.retain,this)}}rootIds={};retain(e){return this.rootIds[e]=(this.rootIds[e]||0)+1}release(e){if(this.rootIds[e]>0){const t=--this.rootIds[e];return t||delete this.rootIds[e],t}return 0}getRootIdSet(e=new Set){return Object.keys(this.rootIds).forEach(e.add,e),this instanceof mu?this.parent.getRootIdSet(e):Object.keys(this.policies.rootTypenamesById).forEach(e.add,e),e}gc(){const e=this.getRootIdSet(),t=this.toObject();e.forEach(o=>{ms.call(t,o)&&(Object.keys(this.findChildRefIds(o)).forEach(e.add,e),delete t[o])});const i=Object.keys(t);if(i.length){let o=this;for(;o instanceof mu;)o=o.parent;i.forEach(r=>o.delete(r))}return i}refs={};findChildRefIds(e){if(!ms.call(this.refs,e)){const t=this.refs[e]={},i=this.data[e];if(!i)return t;const o=new Set([i]);o.forEach(r=>{Ro(r)&&(t[r.__ref]=!0),Xs(r)&&Object.keys(r).forEach(s=>{const l=r[s];Xs(l)&&o.add(l)})})}return this.refs[e]}makeCacheKey(){return this.group.keyMaker.lookupArray(arguments)}getFieldValue=(e,t)=>Ro(e)?this.get(e.__ref,t):e&&e[t];canRead=e=>Ro(e)?this.has(e.__ref):"object"==typeof e;toReference=(e,t)=>{if("string"==typeof e)return Of(e);if(Ro(e))return e;const[i]=this.policies.identify(e);if(i){const o=Of(i);return t&&this.merge(i,e),o}};get supportsResultCaching(){return this.group.caching}}class mU{caching;parent;d=null;keyMaker;constructor(e,t=null){this.caching=e,this.parent=t,this.resetCaching()}resetCaching(){this.d=this.caching?XH():null,this.keyMaker=new gu}depend(e,t){if(this.d){this.d(Tw(e,t));const i=Gh(t);i!==t&&this.d(Tw(e,i)),this.parent&&this.parent.depend(e,t)}}dirty(e,t){this.d&&this.d.dirty(Tw(e,t),"__exists"===t?"forget":"setDirty")}}function Tw(n,e){return e+"#"+n}function vU(n,e){z5(n)&&n.group.depend(e,"__exists")}K7.Root=class DAe extends K7{constructor({policies:e,resultCaching:t=!0,seed:i}){super(e,new mU(t)),i&&this.replace(i)}stump=new NAe(this);addLayer(e,t){return this.stump.addLayer(e,t)}removeLayer(){return this}storageTrie=new gu;getStorage(){return this.storageTrie.lookupArray(arguments)}};class mu extends K7{id;parent;replay;group;constructor(e,t,i,o){super(t.policies,o),this.id=e,this.parent=t,this.replay=i,this.group=o,i(this)}addLayer(e,t){return new mu(e,this,t,this.group)}removeLayer(e){const t=this.parent.removeLayer(e);return e===this.id?(this.group.caching&&Object.keys(this.data).forEach(i=>{const o=this.data[i],r=t.lookup(i);r?o?o!==r&&Object.keys(o).forEach(s=>{sr(o[s],r[s])||this.group.dirty(i,s)}):(this.group.dirty(i,"__exists"),Object.keys(r).forEach(s=>{this.group.dirty(i,s)})):this.delete(i)}),t):t===this.parent?this:t.addLayer(this.id,this.replay)}toObject(){return{...this.parent.toObject(),...this.data}}findChildRefIds(e){const t=this.parent.findChildRefIds(e);return ms.call(this.data,e)?{...t,...super.findChildRefIds(e)}:t}getStorage(...e){let t=this.parent;for(;t.parent;)t=t.parent;return t.getStorage(...e)}}class NAe extends mu{constructor(e){super("EntityStore.Stump",e,()=>{},new mU(e.group.caching,e.group))}removeLayer(){return this}merge(e,t){return this.parent.merge(e,t)}}function LAe(n,e,t){const i=n[t],o=e[t];return sr(i,o)?i:o}function z5(n){return!(!n||!n.supportsResultCaching)}const Iw=new H7;function MAe(n){const e=n.directives?.find(({name:i})=>"unmask"===i.value);if(!e)return"mask";const t=e.arguments?.find(({name:i})=>"mode"===i.value);return t&&"value"in t.value&&"migrate"===t.value.value?"migrate":"unmask"}const bU=Symbol.for("apollo.result.extensions"),Wh=Symbol.for("apollo.result.streamInfo"),RAe=Symbol.for("apollo.observableQuery.variablesUnknown");function Pf(n,e,t,i){if(t.kind===pn.INT||t.kind===pn.FLOAT)n[e.value]=Number(t.value);else if(t.kind===pn.BOOLEAN||t.kind===pn.STRING)n[e.value]=t.value;else if(t.kind===pn.OBJECT){const o={};t.fields.map(r=>Pf(o,r.name,r.value,i)),n[e.value]=o}else if(t.kind===pn.VARIABLE)n[e.value]=(i||{})[t.name.value];else if(t.kind===pn.LIST)n[e.value]=t.values.map(o=>{const r={};return Pf(r,e,o,i),r[e.value]});else if(t.kind===pn.ENUM)n[e.value]=t.value;else{if(t.kind!==pn.NULL)throw bl(19,e.value,t.kind);n[e.value]=null}}function Sw(n,e){if(n.arguments&&n.arguments.length){const t={};return n.arguments.forEach(({name:i,value:o})=>Pf(t,i,o,e)),t}return null}const kAe=["connection","include","skip","client","rest","export","nonreactive","stream"];let V5=gd;const CU=Object.assign(function(n,e,t){if(e&&t&&t.connection&&t.connection.key){if(t.connection.filter&&t.connection.filter.length>0){const o=t.connection.filter?t.connection.filter:[];o.sort();const r={};o.forEach(l=>{r[l]=e[l]});const s=V5(r);if("{}"!==s)return`${t.connection.key}(${s})`}return t.connection.key}let i=n;if(e){const o=V5(e);"{}"!==o&&(i+=`(${o})`)}return t&&Object.keys(t).forEach(o=>{-1===kAe.indexOf(o)&&(t[o]&&Object.keys(t[o]).length?i+=`@${o}(${V5(t[o])})`:i+=`@${o}`)}),i},{setStringify(n){const e=V5;return V5=n,e}});function Ew(n){return Array.isArray(n)&&n.length>0}const yU={};function xw(n){const e=JSON.stringify(n);return yU[e]||(yU[e]={})}function wU(n){const e=xw(n);return e.keyFieldsFn||(e.keyFieldsFn=(t,i)=>{const o=(s,l)=>i.readField(l,s),r=i.keyObject=Dw(n,s=>{let l=Ff(i.storeObject,s,o);return void 0===l&&t!==i.storeObject&&ms.call(t,s[0])&&(l=Ff(t,s,IU)),bn(void 0!==l,107,s.join("."),t),l});return`${i.typename}:${JSON.stringify(r)}`})}function AU(n){const e=xw(n);return e.keyArgsFn||(e.keyArgsFn=(t,{field:i,variables:o,fieldName:r})=>{const s=Dw(n,d=>{const f=d[0],m=f.charAt(0);if("@"!==m){if("$"===m){const v=f.slice(1);if(o&&ms.call(o,v)){const A=d.slice(0);return A[0]=v,Ff(o,A)}return}if(t)return Ff(t,d)}else if(i&&Ew(i.directives)){const v=f.slice(1),A=i.directives.find(k=>k.name.value===v),T=A&&Sw(A,o);return T&&Ff(T,d.slice(1))}}),l=JSON.stringify(s);return(t||"{}"!==l)&&(r+=":"+l),r})}function Dw(n,e){const t=new kf;return TU(n).reduce((i,o)=>{let r=e(o);if(void 0!==r){for(let s=o.length-1;s>=0;--s)r={[o[s]]:r};i=t.merge(i,r)}return i},{})}function TU(n){const e=xw(n);if(!e.paths){const t=e.paths=[],i=[];n.forEach((o,r)=>{Pr(o)?(TU(o).forEach(s=>t.push(i.concat(s))),i.length=0):(i.push(o),Pr(n[r+1])||(t.push(i.slice(0)),i.length=0))})}return e.paths}function IU(n,e){return n[e]}function Ff(n,e,t){return t=t||IU,SU(e.reduce(function i(o,r){return Pr(o)?o.map(s=>i(s,r)):o&&t(o,r)},n))}function SU(n){return Xs(n)?Pr(n)?n.map(SU):Dw(Object.keys(n).sort(),e=>Ff(n,e)):n}const EU=new H7,xU=new WeakMap;function j5(n){let e=xU.get(n);return e||xU.set(n,e={vars:new Set,dep:XH()}),e}function DU(n){j5(n).vars.forEach(e=>e.forgetCache(n))}function PAe(n){const e=new Set,t=new Set,i=function(r){if(arguments.length>0){if(n!==r){n=r,e.forEach(l=>{j5(l).dep.dirty(i),function FAe(n){n.broadcastWatches&&n.broadcastWatches()}(l)});const s=Array.from(t);t.clear(),s.forEach(l=>l(n))}}else{const s=EU.getValue();s&&(o(s),j5(s).dep(i))}return n};i.onNextChange=r=>(t.add(r),()=>{t.delete(r)});const o=i.attachCache=r=>(e.add(r),j5(r).vars.add(i),i);return i.forgetCache=r=>e.delete(r),i}function Nw(n){return void 0!==n.args?n.args:n.field?Sw(n.field,n.variables):null}const HAe=()=>{},NU=(n,e)=>e.fieldName,LU=(n,e,{mergeObjects:t})=>t(n,e),MU=(n,e)=>e,UAe=(n,e,{streamFieldInfo:t,existingData:i})=>{if(!n&&!i)return e;const o=[],r=n??i,s=t?.isLastChunk?e.length:Math.max(r.length,e.length);for(let l=0;l<s;l++)o[l]=void 0===e[l]?r[l]:e[l];return o};class zAe{config;typePolicies={};toBeAdded={};supertypeMap=new Map;fuzzySubtypes=new Map;cache;rootIdsByTypename={};rootTypenamesById={};usingPossibleTypes=!1;constructor(e){this.config=e,this.config={dataIdFromObject:_U,...e},this.cache=this.config.cache,this.setRootTypename("Query"),this.setRootTypename("Mutation"),this.setRootTypename("Subscription"),e.possibleTypes&&this.addPossibleTypes(e.possibleTypes),e.typePolicies&&this.addTypePolicies(e.typePolicies)}identify(e,t){const i=this,o=t&&(t.typename||t.storeObject?.__typename)||e.__typename;if(o===this.rootTypenamesById.ROOT_QUERY)return["ROOT_QUERY"];const r=t&&t.storeObject||e,s={...t,typename:o,storeObject:r,readField:t&&t.readField||((...m)=>{const v=Lw(m,r);return i.readField(v,{store:i.cache.data,variables:v.variables})})};let l;const d=o&&this.getTypePolicy(o);let f=d&&d.keyFn||this.config.dataIdFromObject;return Iw.withValue(!0,()=>{for(;f;){const m=f({...e,...r},s);if(!Pr(m)){l=m;break}f=wU(m)}}),l=l?String(l):void 0,s.keyObject?[l,s.keyObject]:[l]}addTypePolicies(e){Object.keys(e).forEach(t=>{const{queryType:i,mutationType:o,subscriptionType:r,...s}=e[t];i&&this.setRootTypename("Query",t),o&&this.setRootTypename("Mutation",t),r&&this.setRootTypename("Subscription",t),ms.call(this.toBeAdded,t)?this.toBeAdded[t].push(s):this.toBeAdded[t]=[s]})}updateTypePolicy(e,t,i){const o=this.getTypePolicy(e),{keyFields:r,fields:s}=t;function l(d,f){d.merge="function"==typeof f?f:!0===f?LU:!1===f?MU:d.merge}l(o,t.merge),o.keyFn=!1===r?HAe:Pr(r)?wU(r):"function"==typeof r?r:o.keyFn,s&&Object.keys(s).forEach(d=>{let f=i[d];(!f||f?.typename!==e)&&(f=i[d]={typename:e});const m=s[d];if("function"==typeof m)f.read=m;else{const{keyArgs:v,read:A,merge:T}=m;f.keyFn=!1===v?NU:Pr(v)?AU(v):"function"==typeof v?v:f.keyFn,"function"==typeof A&&(f.read=A),l(f,T)}f.read&&f.merge&&(f.keyFn=f.keyFn||NU)})}setRootTypename(e,t=e){const i="ROOT_"+e.toUpperCase(),o=this.rootTypenamesById[i];t!==o&&(bn(!o||o===e,108,e),o&&delete this.rootIdsByTypename[o],this.rootIdsByTypename[t]=i,this.rootTypenamesById[i]=t)}addPossibleTypes(e){this.usingPossibleTypes=!0,Object.keys(e).forEach(t=>{this.getSupertypeSet(t,!0),e[t].forEach(i=>{this.getSupertypeSet(i,!0).add(t);const o=i.match(pU);(!o||o[0]!==i)&&this.fuzzySubtypes.set(i,new RegExp(i))})})}getTypePolicy(e){if(!ms.call(this.typePolicies,e)){const i=this.typePolicies[e]={};i.fields={};let o=this.supertypeMap.get(e);!o&&this.fuzzySubtypes.size&&(o=this.getSupertypeSet(e,!0),this.fuzzySubtypes.forEach((r,s)=>{if(r.test(e)){const l=this.supertypeMap.get(s);l&&l.forEach(d=>o.add(d))}})),o&&o.size&&o.forEach(r=>{const{fields:s,...l}=this.getTypePolicy(r);Object.assign(i,l),Object.assign(i.fields,s)})}const t=this.toBeAdded[e];return t&&t.length&&t.splice(0).forEach(i=>{this.updateTypePolicy(e,i,this.typePolicies[e].fields)}),this.typePolicies[e]}getFieldPolicy(e,t){if(e)return this.getTypePolicy(e).fields[t]}getSupertypeSet(e,t){let i=this.supertypeMap.get(e);return!i&&t&&this.supertypeMap.set(e,i=new Set),i}fragmentMatches(e,t,i,o){if(!e.typeCondition)return!0;if(!t)return!1;const r=e.typeCondition.name.value;if(t===r)return!0;if(this.usingPossibleTypes&&this.supertypeMap.has(r)){const s=this.getSupertypeSet(t,!0),l=[s],d=v=>{const A=this.getSupertypeSet(v,!1);A&&A.size&&l.indexOf(A)<0&&l.push(A)};let f=!(!i||!this.fuzzySubtypes.size),m=!1;for(let v=0;v<l.length;++v){const A=l[v];if(A.has(r))return s.has(r)||s.add(r),!0;A.forEach(d),f&&v===l.length-1&&ww(e.selectionSet,i,o)&&(f=!1,m=!0,this.fuzzySubtypes.forEach((T,k)=>{const Z=t.match(T);Z&&Z[0]===t&&d(k)}))}}return!1}hasKeyArgs(e,t){const i=this.getFieldPolicy(e,t);return!(!i||!i.keyFn)}getStoreFieldName(e){const{typename:t,fieldName:i}=e,o=this.getFieldPolicy(t,i);let r,s=o&&o.keyFn;if(s&&t){const l={typename:t,fieldName:i,field:e.field||null,variables:e.variables},d=Nw(e);for(;s;){const f=s(d,l);if(!Pr(f)){r=f||i;break}s=AU(f)}}return void 0===r&&(r=e.field?function OAe(n,e){let t=null;n.directives&&(t={},n.directives.forEach(o=>{t[o.name.value]={},o.arguments&&o.arguments.forEach(({name:r,value:s})=>Pf(t[o.name.value],r,s,e))}));let i=null;return n.arguments&&n.arguments.length&&(i={},n.arguments.forEach(({name:o,value:r})=>Pf(i,o,r,e))),CU(n.name.value,i,t)}(e.field,e.variables):CU(i,Nw(e))),!1===r?i:i===Gh(r)?r:i+":"+r}readField(e,t){const i=e.from;if(!i||!e.field&&!e.fieldName)return;if(void 0===e.typename){const m=t.store.getFieldValue(i,"__typename");m&&(e.typename=m)}const r=this.getStoreFieldName(e),s=Gh(r),l=t.store.getFieldValue(i,r),d=this.getFieldPolicy(e.typename,s),f=d&&d.read;if(f){const m=RU(this,i,e,t,t.store.getStorage(Ro(i)?i.__ref:i,r));return EU.withValue(this.cache,f,[l,m])}return l}getReadFunction(e,t){const i=this.getFieldPolicy(e,t);return i&&i.read}getMergeFunction(e,t,i){let o=this.getFieldPolicy(e,t),r=o&&o.merge;return!r&&i&&(o=this.getTypePolicy(i),r=o&&o.merge),r}runMergeFunction(e,t,{field:i,typename:o,merge:r,path:s},l,d){const f=e;if(r===LU)return kU(l.store)(e,t);if(r===MU)return t;l.overwrite&&(e=void 0);const m=l.extensions?.[Wh]?.deref()?.peekArray(s);if(m){const{current:A,previous:T}=m;if(T&&sr(T.incoming,t)&&sr(T.streamFieldInfo,A))return T.result}const v=r(e,t,function VAe(n,e,t,i,o,r){const s={...RU(n,e,t,i,o),extensions:i.extensions,existingData:r},l=i.extensions;if(l&&Wh in l){const{[Wh]:d,...f}=l,m=d?.deref()?.peekArray(t.path);m&&(s.streamFieldInfo=m.current),s.extensions=0===Object.keys(f).length?void 0:f}return s}(this,void 0,{typename:o,fieldName:i.name.value,field:i,variables:l.variables,path:s},l,d||{},f));return m&&(m.previous={incoming:t,streamFieldInfo:m.current,result:v}),v}}function RU(n,e,t,i,o){const r=n.getStoreFieldName(t),s=Gh(r),l=t.variables||i.variables,{toReference:d,canRead:f}=i.store;return{args:Nw(t),field:t.field||null,fieldName:s,storeFieldName:r,variables:l,isReference:Ro,toReference:d,storage:o,cache:n.cache,canRead:f,readField:(...m)=>n.readField(Lw(m,e,l),i),mergeObjects:kU(i.store)}}function Lw(n,e,t){const{0:i,1:o,length:r}=n;let s;return"string"==typeof i?s={fieldName:i,from:r>1?o:e}:(s={...i},ms.call(s,"from")||(s.from=e)),void 0===s.variables&&(s.variables=t),s}function kU(n){return function(t,i){if(Pr(t)||Pr(i))throw bl(111);if(Xs(t)&&Xs(i)){const o=n.getFieldValue(t,"__typename"),r=n.getFieldValue(i,"__typename");if(o&&r&&o!==r)return i;if(Ro(t)&&Bf(i))return n.merge(t.__ref,i),t;if(Bf(t)&&Ro(i))return n.merge(t,i.__ref),i;if(Bf(t)&&Bf(i))return{...t,...i}}return i}}function Mw(n){const e={},t=n&&n.variableDefinitions;return t&&t.length&&t.forEach(i=>{i.defaultValue&&Pf(e,i.variable.name,i.defaultValue)}),e}function OU(n){const e=pd(n);return bn(e&&"query"===e.operation,13),e}function jAe(n){let e=n[0]||{};const t=n.length;if(t>1){const i=new kf;for(let o=1;o<t;++o)e=i.merge(e,n[o])}return e}class Rw extends Error{message;path;query;variables;constructor(e,t,i,o){if(super(e),this.message=e,this.path=t,this.query=i,this.variables=o,this.name="MissingFieldError",Array.isArray(this.path)){this.missing=this.message;for(let r=this.path.length-1;r>=0;--r)this.missing={[this.path[r]]:this.missing}}else this.missing=this.path;this.__proto__=Rw.prototype}missing}function BU(n){return[n.selectionSet,n.objectOrReference,n.context]}class GAe{executeSelectionSet;executeSubSelectedArray;config;knownResults=new WeakMap;constructor(e){this.config=e,this.executeSelectionSet=R5(t=>{const i=BU(t);return this.executeSelectionSet.peek(...i)||(vU(t.context.store,t.enclosingRef.__ref),this.execSelectionSetImpl(t))},{max:_d["inMemoryCache.executeSelectionSet"]||5e4,keyArgs:BU,makeCacheKey(t,i,o){if(z5(o.store))return o.store.makeCacheKey(t,Ro(i)?i.__ref:i,o.varString)}}),this.executeSubSelectedArray=R5(t=>(vU(t.context.store,t.enclosingRef.__ref),this.execSubSelectedArrayImpl(t)),{max:_d["inMemoryCache.executeSubSelectedArray"]||1e4,makeCacheKey({field:t,array:i,context:o}){if(z5(o.store))return o.store.makeCacheKey(t,i,o.varString)}})}diffQueryAgainstStore({store:e,query:t,rootId:i="ROOT_QUERY",variables:o,returnPartialData:r=!0}){const s=this.config.cache.policies;o={...Mw(OU(t)),...o};const l=Of(i),d=this.executeSelectionSet({selectionSet:yw(t).selectionSet,objectOrReference:l,enclosingRef:l,context:{store:e,query:t,policies:s,variables:o,varString:gd(o),...fU(t,this.config.fragments)}});let f;d.missing&&(f=new Rw(function WAe(n){try{JSON.stringify(n,(e,t)=>{if("string"==typeof t)throw t;return t})}catch(e){return e}}(d.missing),d.missing,t,o));const m=!f,{result:v}=d;return{result:m?v:r?0===Object.keys(v).length?null:v:null,complete:m,missing:f}}isFresh(e,t,i,o){if(z5(o.store)&&this.knownResults.get(e)===i){const r=this.executeSelectionSet.peek(i,t,o);if(r&&e===r.result)return!0}return!1}execSelectionSetImpl({selectionSet:e,objectOrReference:t,enclosingRef:i,context:o}){if(Ro(t)&&!o.policies.rootTypenamesById[t.__ref]&&!o.store.has(t.__ref))return{result:{},missing:`Dangling reference to missing ${t.__ref} object`};const{variables:r,policies:s,store:l}=o,d=l.getFieldValue(t,"__typename"),f=[];let m;const v=new kf;function A(fe,Le){return fe.missing&&(m=v.merge(m,{[Le]:fe.missing})),fe.result}"string"==typeof d&&!s.rootIdsByTypename[d]&&f.push({__typename:d});const T=new Set(e.selections);T.forEach(fe=>{if(W7(fe,r))if(U5(fe)){let Le=s.readField({fieldName:fe.name.value,field:fe,variables:o.variables,from:t},o);const Ct=v1(fe);void 0===Le?_w.added(fe)||(m=v.merge(m,{[Ct]:`Can't find field '${fe.name.value}' on ${Ro(t)?t.__ref+" object":"object "+JSON.stringify(t,null,2)}`})):Pr(Le)?Le.length>0&&(Le=A(this.executeSubSelectedArray({field:fe,array:Le,enclosingRef:i,context:o}),Ct)):fe.selectionSet&&null!=Le&&(Le=A(this.executeSelectionSet({selectionSet:fe.selectionSet,objectOrReference:Le,enclosingRef:Ro(Le)?Le:i,context:o}),Ct)),void 0!==Le&&f.push({[Ct]:Le})}else{const Le=G7(fe,o.lookupFragment);if(!Le&&fe.kind===pn.FRAGMENT_SPREAD)throw bl(112,fe.name.value);Le&&s.fragmentMatches(Le,d)&&Le.selectionSet.selections.forEach(T.add,T)}});const ee={result:jAe(f),missing:m};return ee.result&&this.knownResults.set(ee.result,e),ee}execSubSelectedArrayImpl({field:e,array:t,enclosingRef:i,context:o}){let r,s=new kf;function l(d,f){return d.missing&&(r=s.merge(r,{[f]:d.missing})),d.result}return e.selectionSet&&(t=t.filter(d=>void 0===d||o.store.canRead(d))),{result:t=t.map((d,f)=>null===d?null:Pr(d)?l(this.executeSubSelectedArray({field:e,array:d,enclosingRef:i,context:o}),f):e.selectionSet?l(this.executeSelectionSet({selectionSet:e.selectionSet,objectOrReference:d,enclosingRef:Ro(d)?d:i,context:o}),f):d),missing:r}}}function Ow(n,e,t){const i=`${e}${t}`;let o=n.flavors.get(i);return o||n.flavors.set(i,o=n.clientOnly===e&&n.deferred===t?n:{...n,clientOnly:e,deferred:t}),o}class KAe{cache;reader;fragments;constructor(e,t,i){this.cache=e,this.reader=t,this.fragments=i}writeToStore(e,{query:t,result:i,dataId:o,variables:r,overwrite:s,extensions:l}){const d=pd(t),f=function xAe(){return new kf}();r={...Mw(d),...r};const m={store:e,written:{},merge:(A,T)=>f.merge(A,T),variables:r,varString:gd(r),...fU(t,this.fragments),overwrite:!!s,incomingById:new Map,clientOnly:!1,deferred:!1,flavors:new Map,extensions:l},v=this.processSelectionSet({result:i||{},dataId:o,selectionSet:d.selectionSet,mergeTree:{map:new Map},context:m,path:[]});if(!Ro(v))throw bl(114,i);return m.incomingById.forEach(({storeObject:A,mergeTree:T},Z)=>{const ee=Of(Z);if(T&&T.map.size){const fe=this.applyMerges(T,ee,A,m);if(Ro(fe))return;A=fe}e.merge(Z,A)}),e.retain(v.__ref),v}processSelectionSet({dataId:e,result:t,selectionSet:i,context:o,mergeTree:r,path:s}){const{policies:l}=this.cache;let d={};const f=e&&l.rootTypenamesById[e]||Pw(t,i,o.fragmentMap)||e&&o.store.get(e,"__typename");"string"==typeof f&&(d.__typename=f);const m=(...A)=>{const T=Lw(A,d,o.variables);if(Ro(T.from)){const k=o.incomingById.get(T.from.__ref);if(k){const Z=l.readField({...T,from:k.storeObject},o);if(void 0!==Z)return Z}}return l.readField(T,o)},v=new Set;this.flattenFields(i,t,o,f).forEach((A,T)=>{const k=v1(T),Z=t[k],ee=[...s,T.name.value];if(v.add(T),void 0!==Z){const fe=l.getStoreFieldName({typename:f,fieldName:T.name.value,field:T,variables:A.variables}),Le=FU(r,fe);let Nt,Ct=this.processFieldValue(Z,T,T.selectionSet?Ow(A,!1,!1):A,Le,ee);T.selectionSet&&(Ro(Ct)||Bf(Ct))&&(Nt=m("__typename",Ct));const Zt=l.getMergeFunction(f,T.name.value,Nt);Zt?Le.info={field:T,typename:f,merge:Zt,path:ee}:A.extensions?.[Wh]&&Array.isArray(Ct)&&function XAe(n){return!!n.directives&&n.directives.some(e=>"stream"===e.name.value)}(T)?Le.info={field:T,typename:f,merge:UAe,path:ee}:HU(r,fe),d=A.merge(d,{[fe]:Ct})}});try{const[A,T]=l.identify(t,{typename:f,selectionSet:i,fragmentMap:o.fragmentMap,storeObject:d,readField:m});e=e||A,T&&(d=o.merge(d,T))}catch(A){if(!e)throw A}if("string"==typeof e){const A=Of(e),T=o.written[e]||(o.written[e]=[]);if(T.indexOf(i)>=0||(T.push(i),this.reader&&this.reader.isFresh(t,A,i,o)))return A;const k=o.incomingById.get(e);return k?(k.storeObject=o.merge(k.storeObject,d),k.mergeTree=Bw(k.mergeTree,r),v.forEach(Z=>k.fieldNodeSet.add(Z))):o.incomingById.set(e,{storeObject:d,mergeTree:X7(r)?void 0:r,fieldNodeSet:v}),A}return d}processFieldValue(e,t,i,o,r){return t.selectionSet&&null!==e?Pr(e)?e.map((s,l)=>{const d=this.processFieldValue(s,t,i,FU(o,l),[...r,l]);return HU(o,l),d}):this.processSelectionSet({result:e,selectionSet:t.selectionSet,context:i,mergeTree:o,path:r}):e}flattenFields(e,t,i,o=Pw(t,e,i.fragmentMap)){const r=new Map,{policies:s}=this.cache,l=new gu(!1);return function d(f,m){const v=l.lookup(f,m.clientOnly,m.deferred);v.visited||(v.visited=!0,f.selections.forEach(A=>{if(!W7(A,i.variables))return;let{clientOnly:T,deferred:k}=m;if(!(T&&k)&&Ew(A.directives)&&A.directives.forEach(Z=>{const ee=Z.name.value;if("client"===ee&&(T=!0),"defer"===ee){const fe=Sw(Z,i.variables);(!fe||!1!==fe.if)&&(k=!0)}}),U5(A)){const Z=r.get(A);Z&&(T=T&&Z.clientOnly,k=k&&Z.deferred),r.set(A,Ow(i,T,k))}else{const Z=G7(A,i.lookupFragment);if(!Z&&A.kind===pn.FRAGMENT_SPREAD)throw bl(116,A.name.value);Z&&s.fragmentMatches(Z,o,t,i.variables)&&d(Z.selectionSet,Ow(i,T,k))}}))}(e,i),r}applyMerges(e,t,i,o,r){if(e.map.size&&!Ro(i)){const s=Pr(i)||!Ro(t)&&!Bf(t)?void 0:t,l=i;let d;s&&!r&&(r=[Ro(s)?s.__ref:s]);const f=(m,v)=>Pr(m)?"number"==typeof v?m[v]:void 0:o.store.getFieldValue(m,String(v));e.map.forEach((m,v)=>{const A=f(s,v),T=f(l,v);if(void 0===T)return;r&&r.push(v);const k=this.applyMerges(m,A,T,o,r);k!==T&&(d=d||new Map,d.set(v,k)),r&&bn(r.pop()===v)}),d&&(i=Pr(l)?l.slice(0):{...l},d.forEach((m,v)=>{i[v]=m}))}return e.info?this.cache.policies.runMergeFunction(t,i,e.info,o,r&&o.store.getStorage(...r)):i}}const PU=[];function FU({map:n},e){return n.has(e)||n.set(e,PU.pop()||{map:new Map}),n.get(e)}function Bw(n,e){if(n===e||!e||X7(e))return n;if(!n||X7(n))return e;const t=n.info&&e.info?{...n.info,...e.info}:n.info||e.info,i=n.map.size&&e.map.size,r={info:t,map:i?new Map:n.map.size?n.map:e.map};if(i){const s=new Set(e.map.keys());n.map.forEach((l,d)=>{r.map.set(d,Bw(l,e.map.get(d))),s.delete(d)}),s.forEach(l=>{r.map.set(l,Bw(e.map.get(l),n.map.get(l)))})}return r}function X7(n){return!n||!(n.info||n.map.size)}function HU({map:n},e){const t=n.get(e);t&&X7(t)&&(PU.push(t),n.delete(e))}function Pw(n,e,t){let i;for(const o of e.selections)if(U5(o)){if("__typename"===o.name.value)return n[v1(o)]}else i?i.push(o):i=[o];if("string"==typeof n.__typename)return n.__typename;if(i)for(const o of i){const r=Pw(n,G7(o,t).selectionSet,t);if("string"==typeof r)return r}}class zU extends cU{data;optimisticData;config;watches=new Set;storeReader;storeWriter;addTypenameTransform=new fd(_w);maybeBroadcastWatch;assumeImmutableResults=!0;policies;makeVar=PAe;constructor(e={}){super(),this.config=function SAe(n){return b1(IAe,n)}(e),this.policies=new zAe({cache:this,dataIdFromObject:this.config.dataIdFromObject,possibleTypes:this.config.possibleTypes,typePolicies:this.config.typePolicies}),this.init()}init(){const e=this.data=new K7.Root({policies:this.policies,resultCaching:this.config.resultCaching});this.optimisticData=e.stump,this.resetResultCache()}resetResultCache(){const{fragments:e}=this.config;this.addTypenameTransform.resetCache(),e?.resetCaches(),this.storeWriter=new KAe(this,this.storeReader=new GAe({cache:this,fragments:e}),e),this.maybeBroadcastWatch=R5((t,i)=>this.broadcastWatch(t,i),{max:_d["inMemoryCache.maybeBroadcastWatch"]||5e3,makeCacheKey:t=>{const i=t.optimistic?this.optimisticData:this.data;if(z5(i)){const{optimistic:o,id:r,variables:s}=t;return i.makeCacheKey(t.query,t.callback,gd({optimistic:o,id:r,variables:s}))}}}),new Set([this.data.group,this.optimisticData.group]).forEach(t=>t.resetCaching())}restore(e){return this.init(),e&&this.data.replace(e),this}extract(e=!1){return(e?this.optimisticData:this.data).extract()}read(e){const{returnPartialData:t=!1}=e;return this.storeReader.diffQueryAgainstStore({...e,store:e.optimistic?this.optimisticData:this.data,config:this.config,returnPartialData:t}).result}write(e){try{return++this.txCount,this.storeWriter.writeToStore(this.data,e)}finally{! --this.txCount&&!1!==e.broadcast&&this.broadcastWatches()}}modify(e){if(ms.call(e,"id")&&!e.id)return!1;const t=e.optimistic?this.optimisticData:this.data;try{return++this.txCount,t.modify(e.id||"ROOT_QUERY",e.fields,!1)}finally{! --this.txCount&&!1!==e.broadcast&&this.broadcastWatches()}}diff(e){return this.storeReader.diffQueryAgainstStore({...e,store:e.optimistic?this.optimisticData:this.data,rootId:e.id||"ROOT_QUERY",config:this.config})}watch(e){return this.watches.size||function BAe(n){j5(n).vars.forEach(e=>e.attachCache(n))}(this),this.watches.add(e),e.immediate&&this.maybeBroadcastWatch(e),()=>{this.watches.delete(e)&&!this.watches.size&&DU(this),this.maybeBroadcastWatch.forget(e)}}gc(e){gd.reset(),B5.reset();const t=this.optimisticData.gc();return e&&!this.txCount&&e.resetResultCache&&this.resetResultCache(),t}retain(e,t){return(t?this.optimisticData:this.data).retain(e)}release(e,t){return(t?this.optimisticData:this.data).release(e)}identify(e){if(Ro(e))return e.__ref;try{return this.policies.identify(e)[0]}catch(t){}}evict(e){if(!e.id){if(ms.call(e,"id"))return!1;e={...e,id:"ROOT_QUERY"}}try{return++this.txCount,this.optimisticData.evict(e,this.data)}finally{! --this.txCount&&!1!==e.broadcast&&this.broadcastWatches()}}reset(e){return this.init(),gd.reset(),e&&e.discardWatches?(this.watches.forEach(t=>this.maybeBroadcastWatch.forget(t)),this.watches.clear(),DU(this)):this.broadcastWatches(),Promise.resolve()}removeOptimistic(e){const t=this.optimisticData.removeLayer(e);t!==this.optimisticData&&(this.optimisticData=t,this.broadcastWatches())}txCount=0;batch(e){const{update:t,optimistic:i=!0,removeOptimistic:o,onWatchUpdated:r}=e;let s;const l=f=>{const{data:m,optimisticData:v}=this;++this.txCount,f&&(this.data=this.optimisticData=f);try{return s=t(this)}finally{--this.txCount,this.data=m,this.optimisticData=v}},d=new Set;return r&&!this.txCount&&this.broadcastWatches({...e,onWatchUpdated:f=>(d.add(f),!1)}),"string"==typeof i?this.optimisticData=this.optimisticData.addLayer(i,l):!1===i?l(this.data):l(),"string"==typeof o&&(this.optimisticData=this.optimisticData.removeLayer(o)),r&&d.size?(this.broadcastWatches({...e,onWatchUpdated(f,m){const v=r.call(this,f,m);return!1!==v&&d.delete(f),v}}),d.size&&d.forEach(f=>this.maybeBroadcastWatch.dirty(f))):this.broadcastWatches(e),s}performTransaction(e,t){return this.batch({update:e,optimistic:t||null!==t})}transformDocument(e){return this.addTypenameTransform.transformDocument(this.addFragmentsToDocument(e))}fragmentMatches(e,t){return this.policies.fragmentMatches(e,t)}lookupFragment(e){return this.config.fragments?.lookup(e)||null}resolvesClientField(e,t){return!!this.policies.getReadFunction(e,t)}broadcastWatches(e){if(!this.txCount){const t=this.onAfterBroadcast,i=new Set;this.onAfterBroadcast=o=>{i.add(o)};try{this.watches.forEach(o=>this.maybeBroadcastWatch(o,e)),i.forEach(o=>o())}finally{this.onAfterBroadcast=t}}}addFragmentsToDocument(e){const{fragments:t}=this.config;return t?t.transform(e):e}broadcastWatch(e,t){const{lastDiff:i}=e,o=this.diff(e);t&&(e.optimistic&&"string"==typeof t.optimistic&&(o.fromOptimisticTransaction=!0),t.onWatchUpdated&&!1===t.onWatchUpdated.call(this,e,o,i))||(!i||!sr(i.result,o.result))&&e.callback(e.lastDiff=o,i)}}class VU extends Ks{constructor(e){super((t,i)=>{const{...o}=t;return Object.defineProperty(o,"client",{enumerable:!1,value:t.client}),new wn(r=>{let s=!1;return Promise.resolve(o).then(l=>e(t.getContext(),l)).then(t.setContext).then(()=>{s||i(t).subscribe(r)}).catch(r.error.bind(r)),()=>{s=!0}})})}}function G5(n,e,t){const i=new Set(n),o=i.size;return fu(e,{Directive(r){if(i.delete(r.name.value)&&(!t||!i.size))return Uh}}),t?!i.size:i.size<o}class QAe{isIncrementalResult(e){return!1}prepareRequest(e){return bn(!G5(["defer","stream"],e.query),67),e}extractErrors(){}startRequest=void 0}const Fw=Ks.execute;function q7(n,e){return b1(n,e,e.variables&&{variables:b1({...n&&n.variables,...e.variables})})}function JAe(n){return fu(n,{FragmentSpread(e){if(!e.directives?.some(({name:t})=>"unmask"===t.value))return null}})}function $h(n,e){const t=be(n)?n:()=>n,i=o=>o.error(t());return new wn(e?o=>e.schedule(i,0,o):i)}function md(n){return ia((e,t)=>{let r,i=null,o=!1;i=e.subscribe(Sa(t,void 0,void 0,s=>{r=hl(n(s,md(n)(e))),i?(i.unsubscribe(),i=null,r.subscribe(t)):o=!0})),o&&(i.unsubscribe(),i=null,r.subscribe(t))})}class vd{constructor(e,t,i){this.kind=e,this.value=t,this.error=i,this.hasValue="N"===e}observe(e){return function tTe(n,e){var t,i,o;const{kind:r,value:s,error:l}=n;if("string"!=typeof r)throw new TypeError('Invalid notification, missing "kind"');"N"===r?null===(t=e.next)||void 0===t||t.call(e,s):"E"===r?null===(i=e.error)||void 0===i||i.call(e,l):null===(o=e.complete)||void 0===o||o.call(e)}(this,e)}do(e,t,i){const{kind:o,value:r,error:s}=this;return"N"===o?e?.(r):"E"===o?t?.(s):i?.()}accept(e,t,i){var o;return be(null===(o=e)||void 0===o?void 0:o.next)?this.observe(e):this.do(e,t,i)}toObservable(){const{kind:e,value:t,error:i}=this,o="N"===e?au(t):"E"===e?$h(()=>i):"C"===e?hd:0;if(!o)throw new TypeError(`Unexpected notification kind ${e}`);return o}static createNext(e){return new vd("N",e)}static createError(e){return new vd("E",void 0,e)}static createComplete(){return vd.completeNotification}}function jU(n=1/0){return Mh(Sn,n)}function W5(...n){return function iTe(){return jU(1)}()(tu(n,y3(n)))}function Hw(n,e){return"object"==typeof n&&null!==n&&n[Symbol.for("apollo.error")]===e}function Uw(n){Object.defineProperty(n,Symbol.for("apollo.error"),{value:n.name,enumerable:!1,writable:!1,configurable:!1})}function GU(n){return n.filter(e=>e).map(e=>e.message||"Error message not found.").join("\n")}vd.completeNotification=new vd("C");let $5=(()=>{class n extends Error{static is(t){return Hw(t,"CombinedGraphQLErrors")}static formatMessage=GU;errors;data;extensions;constructor(t,i=t.errors||[]){super(n.formatMessage(i,{result:t,defaultFormatMessage:GU})),this.errors=i,this.data=t.data,this.extensions=t.extensions,this.name="CombinedGraphQLErrors",Uw(this),Object.setPrototypeOf(this,n.prototype)}}return n})();function WU(n){return n.map(e=>e.message||"Error message not found.").join("\n")}let oTe=(()=>{class n extends Error{static is(t){return Hw(t,"CombinedProtocolErrors")}static formatMessage=WU;errors;constructor(t){super(n.formatMessage(t,{defaultFormatMessage:WU})),this.name="CombinedProtocolErrors",this.errors=t,Uw(this),Object.setPrototypeOf(this,n.prototype)}}return n})();class zw extends Error{static is(e){return Hw(e,"UnconventionalError")}constructor(e){super("An error of unexpected shape occurred.",{cause:e}),this.name="UnconventionalError",Uw(this),Object.setPrototypeOf(this,zw.prototype)}}const Vw=Symbol(),$U=new WeakSet;function ZU(n,e,t){return Iw.withValue(!0,()=>{const i=Z5(n,e,t,!1);return Object.isFrozen(n),i})}function Z5(n,e,t,i,o){const{knownChanged:r}=t,s=function cTe(n,e){if(e.has(n))return e.get(n);const t=Array.isArray(n)?[]:{};return e.set(n,t),t}(n,t.mutableTargets);if(Array.isArray(n)){for(const[l,d]of Array.from(n.entries())){if(null===d){s[l]=null;continue}const f=Z5(d,e,t,i,void 0);r.has(f)&&r.add(s),s[l]=f}return r.has(s)?s:n}for(const l of e.selections){let d;if(i&&r.add(s),l.kind===pn.FIELD){const f=v1(l),m=l.selectionSet;if(d=s[f]||n[f],void 0===d)continue;if(m&&null!==d){const v=Z5(n[f],m,t,i,void 0);r.has(v)&&(d=v)}s[f]=d}if(l.kind===pn.INLINE_FRAGMENT&&(!l.typeCondition||t.cache.fragmentMatches(l,n.__typename))&&(d=Z5(n,l.selectionSet,t,i,o)),l.kind===pn.FRAGMENT_SPREAD){const f=l.name.value,m=t.fragmentMap[f]||(t.fragmentMap[f]=t.cache.lookupFragment(f));bn(m,39,f);const v=MAe(l);"mask"!==v&&(d=Z5(n,m.selectionSet,t,"migrate"===v,o))}r.has(d)&&r.add(s)}return"__typename"in n&&!("__typename"in s)&&(s.__typename=n.__typename),Object.keys(s).length!==Object.keys(n).length&&r.add(s),r.has(s)?s:n}function YU(n){return 7===n||8===n}function Q7(n){return!YU(n)}function Hf(n){return!!n.errors?.length}function jw(n,e=()=>{}){return t=>new wn(i=>{let o=e();return t.subscribe({next(r){let s;try{s=n(r,o)}catch(l){i.error(l)}void 0!==s&&i.next(s)},error(r){i.error(r)},complete(){i.complete()}})})}function Y5(n){const e={data:n.data};return n.error&&(e.error=n.error),e}function _Te(n){let e=!1;return fu(n,{Directive:{enter(t){if("client"===t.name.value&&t.arguments&&(e=t.arguments.some(i=>"always"===i.name.value&&"BooleanValue"===i.value.kind&&!0===i.value.value),e))return Uh}}}),e}function pTe(n,e){zh(e);const t=KU(""),i=KU(""),o=ee=>{for(let Le,fe=0;fe<ee.length&&(Le=ee[fe]);++fe)if(!Pr(Le)){if(Le.kind===pn.OPERATION_DEFINITION)return t(Le.name&&Le.name.value);if(Le.kind===pn.FRAGMENT_DEFINITION)return i(Le.name.value)}return bn.error(14),null};let r=0;for(let ee=e.definitions.length-1;ee>=0;--ee)e.definitions[ee].kind===pn.OPERATION_DEFINITION&&++r;const s=function fTe(n){const e=new Map,t=new Map;return n.forEach(i=>{i&&(i.name?e.set(i.name,i):i.test&&t.set(i.test,i))}),i=>{let o=e.get(i.name.value);return!o&&t.size&&t.forEach((r,s)=>{s(i)&&(o=r)}),o}}(n),l=ee=>Ew(ee)&&ee.map(s).some(fe=>fe&&fe.remove),d=new Map;let f=!1;const m={enter(ee){if(l(ee.directives))return f=!0,null}},v=fu(e,{Field:m,InlineFragment:m,VariableDefinition:{enter:()=>!1},Variable:{enter(ee,fe,Le,Ct,Nt){const Zt=o(Nt);Zt&&Zt.variables.add(ee.name.value)}},FragmentSpread:{enter(ee,fe,Le,Ct,Nt){if(l(ee.directives))return f=!0,null;const Zt=o(Nt);Zt&&Zt.fragmentSpreads.add(ee.name.value)}},FragmentDefinition:{enter(ee,fe,Le,Ct){d.set(JSON.stringify(Ct),ee)},leave:(ee,fe,Le,Ct)=>ee===d.get(JSON.stringify(Ct))?ee:r>0&&ee.selectionSet.selections.every(Zt=>Zt.kind===pn.FIELD&&"__typename"===Zt.name.value)?(i(ee.name.value).removed=!0,f=!0,null):void 0},Directive:{leave(ee){if(s(ee))return f=!0,null}}});if(!f)return e;const A=ee=>(ee.transitiveVars||(ee.transitiveVars=new Set(ee.variables),ee.removed||ee.fragmentSpreads.forEach(fe=>{A(i(fe)).transitiveVars.forEach(Le=>{ee.transitiveVars.add(Le)})})),ee),T=new Set;v.definitions.forEach(ee=>{ee.kind===pn.OPERATION_DEFINITION?A(t(ee.name&&ee.name.value)).fragmentSpreads.forEach(fe=>{T.add(fe)}):ee.kind===pn.FRAGMENT_DEFINITION&&0===r&&!i(ee.name.value).removed&&T.add(ee.name.value)}),T.forEach(ee=>{A(i(ee)).fragmentSpreads.forEach(fe=>{T.add(fe)})});const Z={enter(ee){if((ee=>!(T.has(ee)&&!i(ee).removed))(ee.name.value))return null}};return function gTe(n){return XU(pd(n)||function rU(n){bn("Document"===n.kind,6),bn(n.definitions.length<=1,7);const e=n.definitions[0];return bn("FragmentDefinition"===e.kind,8),e}(n),F5(H5(n)))?null:n}(fu(v,{FragmentSpread:Z,FragmentDefinition:Z,OperationDefinition:{leave(ee){if(ee.variableDefinitions){const fe=A(t(ee.name&&ee.name.value)).transitiveVars;if(fe.size<ee.variableDefinitions.length)return{...ee,variableDefinitions:ee.variableDefinitions.filter(Le=>fe.has(Le.variable.name.value))}}}}}))}function KU(n){const e=new Map;return function(i=n){let o=e.get(i);return o||e.set(i,o={variables:new Set,fragmentSpreads:new Set}),o}}function XU(n,e){return!n||n.selectionSet.selections.every(t=>t.kind===pn.FRAGMENT_SPREAD&&XU(e[t.name.value],e))}var Ei=function(n){return n[n.loading=1]="loading",n[n.setVariables=2]="setVariables",n[n.fetchMore=3]="fetchMore",n[n.refetch=4]="refetch",n[n.poll=6]="poll",n[n.ready=7]="ready",n[n.error=8]="error",n[n.streaming=9]="streaming",n}(Ei||{});function qU(n){return n.catch(()=>{}),n}const{assign:QU}=Object,Uf={loading:!0,networkStatus:Ei.loading,data:void 0,dataState:"empty",partial:!0},Gw={loading:!1,networkStatus:Ei.ready,data:void 0,dataState:"empty",partial:!0};class Ww{options;queryName;variablesUnknown=!1;_lastWrite;get query(){return this.lastQuery}get variables(){return this.options.variables}unsubscribeFromCache;input;subject;isTornDown;queryManager;subscriptions=new Set;waitForNetworkResult;lastQuery;linkSubscription;pollingInfo;get networkStatus(){return this.subject.getValue().result.networkStatus}get cache(){return this.queryManager.cache}constructor({queryManager:e,options:t,transformedQuery:i=e.transform(t.query)}){this.queryManager=e,this.waitForNetworkResult="network-only"===t.fetchPolicy,this.isTornDown=!1,this.subscribeToMore=this.subscribeToMore.bind(this),this.maskResult=this.maskResult.bind(this);const{watchQuery:{fetchPolicy:o="cache-first"}={}}=e.defaultOptions,{fetchPolicy:r=o,initialFetchPolicy:s=("standby"===r?o:r)}=t;t[RAe]&&(bn("standby"===r,82),this.variablesUnknown=!0),this.lastQuery=i,this.options={...t,initialFetchPolicy:s,fetchPolicy:r,variables:this.getVariablesWithDefaults(t.variables)},this.initializeObservablesQueue(),this["@@observable"]=()=>this,Symbol.observable&&(this[Symbol.observable]=()=>this);const l=pd(this.query);this.queryName=l&&l.name&&l.name.value}initializeObservablesQueue(){this.subject=new Mr({query:this.query,variables:this.variables,result:Uf,meta:{}});const e=this.subject.pipe(u1({subscribe:()=>{this.subject.observed||(this.reobserve(),setTimeout(()=>this.updatePolling()))},unsubscribe:()=>{this.subject.observed||this.tearDownQuery()}}),jw(({query:t,variables:i,result:o,meta:r},s)=>{const{shouldEmit:l}=r;if(o===Uf&&(s.previous=void 0,s.previousVariables=void 0),"standby"===this.options.fetchPolicy||2===l)return;if(1===l)return m();const{previous:d,previousVariables:f}=s;if(d){const v=this.queryManager.getDocumentInfo(t),A=this.queryManager.dataMasking;if((A||v.hasNonreactiveDirective?aU(A?v.nonReactiveQuery:t,d,o,i):sr(d,o))&&sr(f,i))return}if(3!==l||this.options.notifyOnNetworkStatusChange&&!sr(d,o))return m();function m(){return s.previous=o,s.previousVariables=i,o}},()=>({})));this.pipe=e.pipe.bind(e),this.subscribe=e.subscribe.bind(e),this.input=new Wn,this.input.complete=()=>{},this.input.pipe(this.operator).subscribe(this.subject)}subscribe;pipe;[Symbol.observable];"@@observable";getCacheDiff({optimistic:e=!0}={}){return this.cache.diff({query:this.query,variables:this.variables,returnPartialData:!0,optimistic:e})}getInitialResult(e){let t=e||this.options.fetchPolicy;this.queryManager.prioritizeCacheValues&&("network-only"===t||"cache-and-network"===t)&&(t="cache-first");const i=()=>{const o=this.getCacheDiff(),r=this.options.returnPartialData||o.complete?o.result??void 0:void 0;return this.maskResult({data:r,dataState:o.complete?"complete":void 0===r?"empty":"partial",loading:!o.complete,networkStatus:o.complete?Ei.ready:Ei.loading,partial:!o.complete})};switch(t){case"cache-only":return{...i(),loading:!1,networkStatus:Ei.ready};case"cache-first":return i();case"cache-and-network":return{...i(),loading:!0,networkStatus:Ei.loading};case"standby":return Gw;default:return Uf}}resubscribeCache(){const{variables:e,fetchPolicy:t}=this.options,i=this.query,o="standby"===t||"no-cache"===t||this.waitForNetworkResult,r=!K5({query:i,variables:e},this.unsubscribeFromCache)&&!this.waitForNetworkResult;if((o||r)&&this.unsubscribeFromCache?.(),o||!r)return;const s={query:i,variables:e,optimistic:!0,watcher:this,callback:d=>{const f=this.queryManager.getDocumentInfo(i);if((f.hasClientExports||f.hasForcedResolvers)&&(s.lastDiff=void 0),s.lastOwnDiff===d)return;const{result:m}=this.subject.getValue();!d.complete&&(m.error||m===Uf||m===Gw)||sr(m.data,d.result)||this.scheduleNotify()}},l=this.cache.watch(s);this.unsubscribeFromCache=Object.assign(()=>{this.unsubscribeFromCache=void 0,l()},{query:i,variables:e})}stableLastResult;getCurrentResult(){const{result:e}=this.subject.getValue();let t=e.networkStatus===Ei.error||this.hasObservers()||"no-cache"===this.options.fetchPolicy?e:this.getInitialResult();return t===Uf&&(t=this.getInitialResult()),sr(this.stableLastResult,t)||(this.stableLastResult=t),this.stableLastResult}refetch(e){const{fetchPolicy:t}=this.options,i={pollInterval:0};return i.fetchPolicy="no-cache"===t?"no-cache":"network-only",e&&!sr(this.variables,e)&&(i.variables=this.options.variables=this.getVariablesWithDefaults({...this.variables,...e})),this._lastWrite=void 0,this._reobserve(i,{newNetworkStatus:Ei.refetch})}fetchMore({query:e,variables:t,context:i,errorPolicy:o,updateQuery:r}){bn("cache-only"!==this.options.fetchPolicy,84,vl(this.query,"(anonymous)"));const s={...b1(this.options,{errorPolicy:"none"},{query:e,context:i,errorPolicy:o}),variables:e?t:{...this.variables,...t},fetchPolicy:"no-cache",notifyOnNetworkStatusChange:this.options.notifyOnNetworkStatusChange};s.query=this.transformDocument(s.query),this.lastQuery=e?this.transformDocument(this.options.query):s.query;let l=!1;const d="no-cache"!==this.options.fetchPolicy;d||bn(r,85);const{finalize:f,pushNotification:m}=this.pushOperation(Ei.fetchMore);m({source:"newNetworkStatus",kind:"N",value:{}},{shouldEmit:3});const{promise:v,operator:A}=JU(),{observable:T}=this.queryManager.fetchObservableWithInfo(s,{networkStatus:Ei.fetchMore,exposeExtensions:!0}),k=T.pipe(A,Y3(Z=>"N"===Z.kind&&"network"===Z.source)).subscribe({next:Z=>{l=!1;const ee=Z.value,fe=ee[bU];if(YU(Z.value.networkStatus)&&f(),d){const Le=this.getCacheDiff();this.cache.batch({update:Ct=>{r?Ct.updateQuery({query:this.query,variables:this.variables,returnPartialData:!0,optimistic:!1,extensions:fe},Nt=>r(Nt,{fetchMoreResult:ee.data,variables:s.variables})):Ct.writeQuery({query:s.query,variables:s.variables,data:ee.data,extensions:fe})},onWatchUpdated:(Ct,Nt)=>{if(Ct.watcher===this&&!sr(Nt.result,Le.result)){l=!0;const Zt=this.getCurrentResult();Q7(ee.networkStatus)&&m({kind:"N",source:"network",value:{...Zt,networkStatus:ee.networkStatus===Ei.error?Ei.ready:ee.networkStatus,loading:!1,data:Nt.result,dataState:"streaming"===ee.dataState?"streaming":"complete"}})}}})}else{const Le=this.getCurrentResult(),Ct=r(Le.data,{fetchMoreResult:ee.data,variables:s.variables});m({kind:"N",value:{...Le,networkStatus:Ei.ready,loading:!1,data:Ct,dataState:"streaming"===Le.dataState?"streaming":"complete"},source:"network"})}}});return qU(v.then(Z=>Y5(this.maskResult(Z))).finally(()=>{if(k.unsubscribe(),f(),d&&!l){const Z=this.getCurrentResult();"streaming"===Z.dataState?m({kind:"N",source:"network",value:{...Z,dataState:"complete",networkStatus:Ei.ready}}):m({kind:"N",source:"newNetworkStatus",value:{}},{shouldEmit:1})}}))}subscribeToMore(e){const t=this.queryManager.startGraphQLSubscription({query:e.document,variables:e.variables,context:e.context}).subscribe({next:i=>{const{updateQuery:o,onError:r}=e,{error:s}=i;s?r?r(s):bn.error(86,s):o&&this.updateQuery((l,d)=>o(l,{subscriptionData:i,...d}))}});return this.subscriptions.add(t),()=>{this.subscriptions.delete(t)&&t.unsubscribe()}}applyOptions(e){const t=b1(this.options,e||{});QU(this.options,t),this.updatePolling()}setVariables(e){var t=this;return(0,N.A)(function*(){return e=t.getVariablesWithDefaults(e),sr(t.variables,e)||(t.options.variables=e,!t.hasObservers())?Y5(t.getCurrentResult()):t._reobserve({fetchPolicy:t.options.initialFetchPolicy,variables:e},{newNetworkStatus:Ei.setVariables})})()}updateQuery(e){const{queryManager:t}=this,{result:i,complete:o}=this.getCacheDiff({optimistic:!1}),r=e(i,{variables:this.variables,complete:!!o,previousData:i});r&&(this.cache.writeQuery({query:this.options.query,data:r,variables:this.variables}),t.broadcastQueries())}startPolling(e){this.options.pollInterval=e,this.updatePolling()}stopPolling(){this.options.pollInterval=0,this.updatePolling()}applyNextFetchPolicy(e,t){if(t.nextFetchPolicy){const{fetchPolicy:i="cache-first",initialFetchPolicy:o=i}=t;"standby"===i||(t.fetchPolicy="function"==typeof t.nextFetchPolicy?t.nextFetchPolicy.call(t,i,{reason:e,options:t,observable:this,initialFetchPolicy:o}):"variables-changed"===e?o:t.nextFetchPolicy)}return t.fetchPolicy}fetch(e,t,i,o){const r=this.options.fetchPolicy;e.context??={};let s=!1,{observable:f,fromLink:m}=this.queryManager.fetchObservableWithInfo(e,{networkStatus:t,query:i,onCacheHit:()=>{s=!0},fetchQueryOperator:ee=>new wn(fe=>{try{return ee.subscribe({next(Le){s=!0,fe.next(Le)},error:Le=>fe.error(Le),complete:()=>fe.complete()})}finally{s||(T.override=t,this.input.next({kind:"N",source:"newNetworkStatus",value:{resetError:!0},query:v,variables:A,meta:{shouldEmit:3,fetchPolicy:r}}))}}),observableQuery:this});const{query:v,variables:A}=this,T={abort:()=>{Z.unsubscribe()},query:v,variables:A};this.activeOperations.add(T);let k=t==Ei.refetch||t==Ei.setVariables;f=f.pipe(o,P5());const Z=f.pipe(u1({next:ee=>{"newNetworkStatus"===ee.source||"N"===ee.kind&&ee.value.loading?T.override=t:delete T.override},finalize:()=>this.activeOperations.delete(T)})).subscribe({next:ee=>{const fe={};k&&"N"===ee.kind&&"loading"in ee.value&&!ee.value.loading&&(k=!1,fe.shouldEmit=1),this.input.next({...ee,query:v,variables:A,meta:fe})}});return{fromLink:m,subscription:Z,observable:f}}didWarnCacheOnlyPolling=!1;updatePolling(){if(this.queryManager.ssrMode)return;const{pollingInfo:e,options:{pollInterval:i}}=this,o=()=>{const{options:d}=this;return!d.pollInterval||!this.hasObservers()||"cache-only"===d.fetchPolicy||"standby"===d.fetchPolicy};if(o())return void this.cancelPolling();if(e?.interval===i)return;(e||(this.pollingInfo={})).interval=i;const s=()=>{if(o())return this.cancelPolling();this.pollingInfo&&(Q7(this.networkStatus)||this.options.skipPollAttempt?.()?l():this._reobserve({fetchPolicy:"no-cache"===this.options.initialFetchPolicy?"no-cache":"network-only"},{newNetworkStatus:Ei.poll}).then(l,l))},l=()=>{const d=this.pollingInfo;d&&(clearTimeout(d.timeout),d.timeout=setTimeout(s,d.interval))};l()}cancelPolling(){this.pollingInfo&&(clearTimeout(this.pollingInfo.timeout),delete this.pollingInfo)}reobserve(e){return this._reobserve(e)}_reobserve(e,t){this.isTornDown=!1;let{newNetworkStatus:i}=t||{};this.queryManager.obsQueries.add(this);const o=i===Ei.refetch||i===Ei.poll,r=this.variables,s=this.options.fetchPolicy,l=b1(this.options,e||{});this.variablesUnknown&&="standby"===l.fetchPolicy;const d=o?l:QU(this.options,l),f=this.transformDocument(d.query);this.lastQuery=f,e&&"variables"in e&&(d.variables=this.getVariablesWithDefaults(e.variables)),o||(this.updatePolling(),e&&e.variables&&!sr(e.variables,r)&&"standby"!==d.fetchPolicy&&(d.fetchPolicy===s||"function"==typeof d.nextFetchPolicy)&&(this.applyNextFetchPolicy("variables-changed",d),void 0===i&&(i=Ei.setVariables))),i||(i=Ei.loading,this.networkStatus!==Ei.loading&&e?.variables&&!sr(e.variables,r)&&(i=Ei.setVariables),"standby"===d.fetchPolicy&&(i=Ei.ready)),"standby"===d.fetchPolicy&&this.cancelPolling(),this.resubscribeCache();const{promise:v,operator:A}=JU("standby"===d.fetchPolicy?{data:void 0}:void 0),{subscription:T,observable:k,fromLink:Z}=this.fetch(d,i,f,A);!o&&(Z||!this.linkSubscription)&&(this.linkSubscription&&this.linkSubscription.unsubscribe(),this.linkSubscription=T);const ee=Object.assign(qU(v.then(fe=>Y5(this.maskResult(fe))).finally(()=>{!this.hasObservers()&&0===this.activeOperations.size&&this.tearDownQuery()})),{retain:()=>{const fe=k.subscribe({}),Le=()=>fe.unsubscribe();return v.then(Le,Le),ee}});return ee}hasObservers(){return this.subject.observed}stop(){this.subject.complete(),this.initializeObservablesQueue(),this.tearDownQuery()}tearDownQuery(){this.isTornDown||(this.resetNotifications(),this.unsubscribeFromCache?.(),this.linkSubscription&&(this.linkSubscription.unsubscribe(),delete this.linkSubscription),this.stopPolling(),this.subscriptions.forEach(e=>e.unsubscribe()),this.subscriptions.clear(),this.queryManager.obsQueries.delete(this),this.isTornDown=!0,this.abortActiveOperations(),this._lastWrite=void 0)}transformDocument(e){return this.queryManager.transform(e)}maskResult(e){const t=this.queryManager.maskOperation({document:this.query,data:e.data,fetchPolicy:this.options.fetchPolicy,cause:this});return t===e.data?e:{...e,data:t}}dirty=!1;notifyTimeout;resetNotifications(){this.notifyTimeout&&(clearTimeout(this.notifyTimeout),this.notifyTimeout=void 0),this.dirty=!1}scheduleNotify(){this.dirty||(this.dirty=!0,this.notifyTimeout||(this.notifyTimeout=setTimeout(()=>this.notify(!0),0)))}notify(e=!1){if(!e){const i=this.queryManager.getDocumentInfo(this.query);if(i.hasClientExports||i.hasForcedResolvers)return}const{dirty:t}=this;if(this.resetNotifications(),t&&("cache-only"===this.options.fetchPolicy||"cache-and-network"===this.options.fetchPolicy||!this.activeOperations.size)){const i=this.getCacheDiff();sr(i.result,this.getCacheDiff({optimistic:!1}).result)?this.reobserveCacheFirst():this.input.next({kind:"N",value:{data:i.result,dataState:i.complete?"complete":i.result?"partial":"empty",networkStatus:Ei.ready,loading:!1,error:void 0,partial:!i.complete},source:"cache",query:this.query,variables:this.variables,meta:{}})}}activeOperations=new Set;pushOperation(e){let t=!1;const{query:i,variables:o}=this,r=()=>{this.activeOperations.delete(s)},s={override:e,abort:()=>{t=!0,r()},query:i,variables:o};return this.activeOperations.add(s),{finalize:r,pushNotification:(l,d)=>{t||this.input.next({...l,query:i,variables:o,meta:{...d}})}}}calculateNetworkStatus(e){return e===Ei.streaming?e:Array.from(this.activeOperations.values()).reverse().find(i=>K5(i,this)&&void 0!==i.override)?.override??e}abortActiveOperations(){this.activeOperations.forEach(e=>e.abort())}reset(){const e="cache-only"===this.options.fetchPolicy;this.setResult(e?Gw:Uf,{shouldEmit:e?1:2}),this.abortActiveOperations()}setResult(e,t){this.input.next({source:"setResult",kind:"N",value:e,query:this.query,variables:this.variables,meta:{...t}})}operator=jw(e=>{const{query:t,variables:i,meta:o}=e;if("setResult"===e.source)return{query:t,variables:i,result:e.value,meta:o};if("C"===e.kind||!K5(e,this))return;let r;const s=this.subject.getValue();if("cache"===e.source){if(r=e.value,r.networkStatus===Ei.ready&&r.partial&&(!this.options.returnPartialData||s.result.networkStatus===Ei.error)&&"cache-only"!==this.options.fetchPolicy)return}else if("network"===e.source)this.waitForNetworkResult&&(this.waitForNetworkResult=!1,this.resubscribeCache()),r="E"===e.kind?{...K5(s,e)?s.result:{data:void 0,dataState:"empty",partial:!0},error:e.error,networkStatus:Ei.error,loading:!1}:e.value,"E"===e.kind&&"streaming"===r.dataState&&(r.dataState="complete"),r.error&&(o.shouldEmit=1);else if("newNetworkStatus"===e.source){const l=K5(s,e)?s.result:this.getInitialResult(o.fetchPolicy),{resetError:d}=e.value,f=d?void 0:l.error,m=f?Ei.error:Ei.ready;r={...l,error:f,networkStatus:m}}return bn(r),r.error||delete r.error,r.networkStatus=this.calculateNetworkStatus(r.networkStatus),r.loading=Q7(r.networkStatus),r=this.maskResult(r),void 0!==s.result.data&&r.data!==s.result.data&&sr(r.data,s.result.data)&&(r.data=s.result.data),{query:t,variables:i,result:r,meta:o}});reobserveCacheFirst(){const{fetchPolicy:e,nextFetchPolicy:t}=this.options;"cache-and-network"===e||"network-only"===e?this.reobserve({fetchPolicy:"cache-first",nextFetchPolicy(i,o){return this.nextFetchPolicy=t,"function"==typeof this.nextFetchPolicy?this.nextFetchPolicy(i,o):e}}):this.reobserve()}getVariablesWithDefaults(e){return this.queryManager.getVariables(this.query,e)}}function K5(n,e){return!!(n&&e&&n.query===e.query&&sr(n.variables,e.variables))}function JU(n){let t,i,e=n;return{promise:new Promise((s,l)=>{t=s,i=l}),operator:u1({next(s){if("E"===s.kind)return i(s.error);"N"===s.kind&&"newNetworkStatus"!==s.source&&!s.value.loading&&(e=s.value)},finalize:()=>{if(e)t(e);else{const s="The operation was aborted.",l="AbortError";i(typeof DOMException<"u"?new DOMException(s,l):Object.assign(new Error(s),{name:l}))}}})}}const ez={},zf=new WeakMap;function $w(n,e){const t=n[e];"function"==typeof t&&(n[e]=function(){return zf.set(n,(zf.get(n)+1)%1e15),t.apply(this,arguments)})}const tz=new WeakMap;class Zw{cache;queryManager;id;observableQuery;incremental;constructor(e,t){const i=this.cache=e.cache,o=(tz.get(e)||0)+1;tz.set(e,o),this.id=o+"",this.observableQuery=t,this.queryManager=e,zf.has(i)||(zf.set(i,0),$w(i,"evict"),$w(i,"modify"),$w(i,"reset"))}_lastWrite;get lastWrite(){return(this.observableQuery||this)._lastWrite}set lastWrite(e){(this.observableQuery||this)._lastWrite=e}resetLastWrite(){this.lastWrite=void 0}shouldWrite(e,t){const{lastWrite:i}=this;return!(i&&i.dmCount===zf.get(this.cache)&&sr(t,i.variables)&&sr(e.data,i.result.data)&&e.extensions?.[Wh]===i.result.extensions?.[Wh])}get hasNext(){return!!this.incremental&&this.incremental.hasNext}maybeHandleIncrementalResult(e,t,i){const{incrementalHandler:o}=this.queryManager;return o.isIncrementalResult(t)?(this.incremental||=o.startRequest({query:i}),this.incremental.handle(e,t)):t}markQueryResult(e,{document:t,variables:i,errorPolicy:o,cacheWriteBehavior:r}){const s={query:t,variables:i,returnPartialData:!0,optimistic:!0};this.observableQuery?.resetNotifications();const l=0===r,d=l?void 0:this.cache.diff(s);let f=this.maybeHandleIncrementalResult(d?.result,e,t);return l||(Yw(f,o)?this.cache.batch({onWatchUpdated:(m,v)=>{m.watcher===this.observableQuery&&(m.lastOwnDiff=v)},update:m=>{if(this.shouldWrite(f,i))m.writeQuery({query:t,data:f.data,variables:i,overwrite:1===r,extensions:f.extensions}),this.lastWrite={result:f,variables:i,dmCount:zf.get(this.cache)};else if(d&&d.complete)return void(f={...f,data:d.result});const v=m.diff(s);v.complete&&(f={...f,data:v.result})}}):this.lastWrite=void 0),f}markMutationResult(e,t,i=this.cache){const o=[],r=0===t.cacheWriteBehavior;let s=this.maybeHandleIncrementalResult(r?void 0:i.diff({id:"ROOT_MUTATION",query:this.queryManager.getDocumentInfo(t.document).asQuery,variables:t.variables,optimistic:!1,returnPartialData:!0}).result,e,t.document);if("ignore"===t.errorPolicy&&(s={...s,errors:[]}),Hf(s)&&"none"===t.errorPolicy)return Promise.resolve(s);const l=()=>({...s,dataState:this.hasNext?"streaming":"complete"});if(!r&&Yw(s,t.errorPolicy)){o.push({result:s.data,dataId:"ROOT_MUTATION",query:t.document,variables:t.variables,extensions:s.extensions});const{updateQueries:f}=t;f&&this.queryManager.getObservableQueries("all").forEach(m=>{const v=m&&m.queryName;if(!v||!Object.hasOwnProperty.call(f,v))return;const A=f[v],{query:T,variables:k}=m,{result:Z,complete:ee}=m.getCacheDiff({optimistic:!1});if(ee&&Z){const fe=A(Z,{mutationResult:l(),queryName:T&&vl(T)||void 0,queryVariables:k});fe&&o.push({result:fe,dataId:"ROOT_QUERY",query:T,variables:k})}})}let d=t.refetchQueries;if("function"==typeof d&&(d=d(l())),o.length>0||(d||"").length>0||t.update||t.onQueryUpdated||t.removeOptimistic){const f=[];if(this.queryManager.refetchQueries({updateCache:m=>{r||o.forEach(A=>m.write(A));const{update:v}=t;if(v){if(!r){const A=m.diff({id:"ROOT_MUTATION",query:this.queryManager.getDocumentInfo(t.document).asQuery,variables:t.variables,optimistic:!1,returnPartialData:!0});A.complete&&(s={...s,data:A.result})}this.hasNext||v(m,s,{context:t.context,variables:t.variables})}!r&&!t.keepRootFields&&!this.hasNext&&m.modify({id:"ROOT_MUTATION",fields:(A,{fieldName:T,DELETE:k})=>"__typename"===T?A:k})},include:d,optimistic:!1,removeOptimistic:t.removeOptimistic,onQueryUpdated:t.onQueryUpdated||null}).forEach(m=>f.push(m)),t.awaitRefetchQueries||t.onQueryUpdated)return Promise.all(f).then(()=>s)}return Promise.resolve(s)}markMutationOptimistic(e,t){const i="function"==typeof e?e(t.variables,{IGNORE:ez}):e;return i!==ez&&(this.cache.recordOptimisticTransaction(o=>{try{this.markMutationResult({data:i},t,o)}catch(r){bn.error(r)}},this.id),!0)}markSubscriptionResult(e,{document:t,variables:i,errorPolicy:o,cacheWriteBehavior:r}){0!==r&&(Yw(e,o)&&this.cache.write({query:t,result:e.data,dataId:"ROOT_SUBSCRIPTION",variables:i,extensions:e.extensions}),this.queryManager.broadcastQueries())}}function Yw(n,e="none"){const t="ignore"===e||"all"===e;let i=!Hf(n);return!i&&t&&n.data&&(i=!0),i}class CTe{defaultOptions;client;clientOptions;assumeImmutableResults;documentTransform;ssrMode;defaultContext;dataMasking;incrementalHandler;localState;queryDeduplication;prioritizeCacheValues=!1;onBroadcast;mutationStore;obsQueries=new Set;fetchCancelFns=new Map;constructor(e){const t=new fd(o=>this.cache.transformDocument(o),{cache:!1});this.client=e.client,this.defaultOptions=e.defaultOptions,this.queryDeduplication=e.queryDeduplication,this.clientOptions=e.clientOptions,this.ssrMode=e.ssrMode,this.assumeImmutableResults=e.assumeImmutableResults,this.dataMasking=e.dataMasking,this.localState=e.localState,this.incrementalHandler=e.incrementalHandler;const i=e.documentTransform;this.documentTransform=i?t.concat(i).concat(t):t,this.defaultContext=e.defaultContext||{},(this.onBroadcast=e.onBroadcast)&&(this.mutationStore={})}get link(){return this.client.link}get cache(){return this.client.cache}stop(){this.obsQueries.forEach(e=>e.stop()),this.cancelPendingFetches(bl(89))}cancelPendingFetches(e){this.fetchCancelFns.forEach(t=>t(e)),this.fetchCancelFns.clear()}mutate(e){var t=this;return(0,N.A)(function*({mutation:i,variables:o,optimisticResponse:r,updateQueries:s,refetchQueries:l=[],awaitRefetchQueries:d=!1,update:f,onQueryUpdated:m,fetchPolicy:v,errorPolicy:A,keepRootFields:T,context:k}){const Z=new Zw(t);i=t.cache.transformForLink(t.transform(i));const{hasClientExports:ee}=t.getDocumentInfo(i);o=t.getVariables(i,o),ee&&(o=yield t.localState.getExportedVariables({client:t.client,document:i,variables:o,context:k}));const fe=t.mutationStore&&(t.mutationStore[Z.id]={mutation:i,variables:o,loading:!0,error:null}),Le=r&&Z.markMutationOptimistic(r,{document:i,variables:o,cacheWriteBehavior:"no-cache"===v?0:2,errorPolicy:A,context:k,updateQueries:s,update:f,keepRootFields:T});return t.broadcastQueries(),new Promise((Ct,Nt)=>{const Zt={};return t.getObservableFromLink(i,{...k,optimisticResponse:Le?r:void 0},o,v,{},!1).observable.pipe(nz(),Mh(Zn=>{const Ri={...Zn};return tu(Z.markMutationResult(Ri,{document:i,variables:o,cacheWriteBehavior:"no-cache"===v?0:2,errorPolicy:A,context:k,update:f,updateQueries:s,awaitRefetchQueries:d,refetchQueries:l,removeOptimistic:Le?Z.id:void 0,onQueryUpdated:m,keepRootFields:T}))})).pipe(mo(Zn=>{if(Hf(Zn)&&"none"===A)throw new $5(Kw(Zn));return fe&&(fe.loading=!1,fe.error=null),Zn})).subscribe({next:Zn=>{if(t.broadcastQueries(),!Z.hasNext){const Ri={data:t.maskOperation({document:i,data:Zn.data,fetchPolicy:v,cause:Zt})};Hf(Zn)&&(Ri.error=new $5(Zn)),Object.keys(Zn.extensions||{}).length&&(Ri.extensions=Zn.extensions),Ct(Ri)}},error:Zn=>(fe&&(fe.loading=!1,fe.error=Zn),Le&&t.cache.removeOptimistic(Z.id),t.broadcastQueries(),"ignore"===A?Ct({data:void 0}):"all"===A?Ct({data:void 0,error:Zn}):void Nt(Zn))})})}).apply(this,arguments)}fetchQuery(e,t){var i=this;return zh(e.query,pu.QUERY),(0,N.A)(function*(){return m5(i.fetchObservableWithInfo(e,{networkStatus:t}).observable.pipe(jw(o=>{switch(o.kind){case"E":throw o.error;case"N":if("newNetworkStatus"!==o.source)return Y5(o.value)}})),{defaultValue:{data:void 0}})})()}transform(e){return this.documentTransform.transformDocument(e)}transformCache=new rw(_d["queryManager.getDocumentInfo"]||2e3);getDocumentInfo(e){const{transformCache:t}=this;if(!t.has(e)){const o=pd(e),r={hasClientExports:G5(["client","export"],e,!0),hasForcedResolvers:_Te(e),hasNonreactiveDirective:G5(["nonreactive"],e),hasIncrementalDirective:G5(["defer"],e),nonReactiveQuery:wTe(e),clientQuery:G5(["client"],e)?e:null,serverQuery:pTe([{name:"client",remove:!0},{name:"connection"},{name:"nonreactive"},{name:"unmask"}],e),operationType:o?.operation,defaultVars:Mw(o),asQuery:{...e,definitions:e.definitions.map(s=>"OperationDefinition"===s.kind&&"query"!==s.operation?{...s,operation:"query"}:s)}};t.set(e,r)}const i=t.get(e);if(i.violation)throw i.violation;return i}getVariables(e,t){const i=this.getDocumentInfo(e).defaultVars,o=Object.entries(t??{}).map(([r,s])=>[r,void 0===s?i[r]:s]);return{...i,...Object.fromEntries(o)}}watchQuery(e){zh(e.query,pu.QUERY);const t=this.transform(e.query);return typeof(e={...e,variables:this.getVariables(t,e.variables)}).notifyOnNetworkStatusChange>"u"&&(e.notifyOnNetworkStatusChange=!0),new Ww({queryManager:this,options:e,transformedQuery:t})}query(e){const t=this.transform(e.query);return this.fetchQuery({...e,query:t}).then(i=>({...i,data:this.maskOperation({document:t,data:i?.data,fetchPolicy:e.fetchPolicy})}))}clearStore(e={discardWatches:!0}){return this.cancelPendingFetches(bl(91)),this.obsQueries.forEach(t=>{t.reset()}),this.mutationStore&&(this.mutationStore={}),this.cache.reset(e)}getObservableQueries(e="active"){const t=new Set,i=new Map,o=new Map,r=new Set;return Array.isArray(e)&&e.forEach(s=>{if("string"==typeof s)i.set(s,s),o.set(s,!1);else if(function mTe(n){return Xs(n)&&"Document"===n.kind&&Array.isArray(n.definitions)}(s)){const l=B5(this.transform(s));i.set(l,vl(s)),o.set(l,!1)}else Xs(s)&&s.query&&r.add(s)}),this.obsQueries.forEach(s=>{const l=B5(this.transform(s.options.query));if("all"===e)return void t.add(s);const{queryName:d,options:{fetchPolicy:f}}=s;"active"===e&&"standby"===f||("active"===e||d&&o.has(d)||l&&o.has(l))&&(t.add(s),d&&o.set(d,!0),l&&o.set(l,!0))}),r.size&&r.forEach(s=>{const l=new Ww({queryManager:this,options:{...q7(this.defaultOptions.watchQuery,s),fetchPolicy:"network-only"}});t.add(l)}),t}refetchObservableQueries(e=!1){const t=[];return this.getObservableQueries(e?"all":"active").forEach(i=>{const{fetchPolicy:o}=i.options;(e||"standby"!==o)&&"cache-only"!==o&&t.push(i.refetch())}),this.broadcastQueries(),Promise.all(t)}startGraphQLSubscription(e){let{query:t,variables:i}=e;const{fetchPolicy:o="cache-first",errorPolicy:r="none",context:s={},extensions:l={}}=e;let d;zh(t,pu.SUBSCRIPTION),t=this.transform(t),i=this.getVariables(t,i);const f=(this.getDocumentInfo(t).hasClientExports?tu(this.localState.getExportedVariables({client:this.client,document:t,variables:i,context:s})):au(i)).pipe(Mh(m=>{const{observable:v,restart:A}=this.getObservableFromLink(t,s,m,o,l),T=new Zw(this);return d=A,v.pipe(mo(k=>{T.markSubscriptionResult(k,{document:t,variables:m,errorPolicy:r,cacheWriteBehavior:"no-cache"===o?0:2});const Z={data:k.data??void 0};return Hf(k)?Z.error=new $5(k):function sTe(n){return"extensions"in n&&oTe.is(n.extensions[Vw])}(k)&&(Z.error=k.extensions[Vw],delete k.extensions[Vw]),k.extensions&&Object.keys(k.extensions).length&&(Z.extensions=k.extensions),Z.error&&"none"===r&&(Z.data=void 0),"ignore"===r&&delete Z.error,Z}),md(k=>au("ignore"===r?{data:void 0}:{data:void 0,error:k})),Y3(k=>!(!k.data&&!k.error)))}));return Object.assign(f,{restart:()=>d?.()})}broadcastQueries(){this.onBroadcast&&this.onBroadcast(),this.obsQueries.forEach(e=>e.notify())}inFlightLinkObservables=new gu(!1);getObservableFromLink(e,t,i,o,r,s=t?.queryDeduplication??this.queryDeduplication){let l={};const{serverQuery:d,clientQuery:f,operationType:m,hasIncrementalDirective:v}=this.getDocumentInfo(e),A=vl(e),T={client:this.client};if(d){const{inFlightLinkObservables:k,link:Z}=this;try{let fe=function(Le){return new wn(Ct=>{function Nt(){return Le.subscribe({next:Ct.next.bind(Ct),complete:Ct.complete.bind(Ct),error:Ct.error.bind(Ct)})}let Zt=Nt();return l.restart||=()=>{Zt.unsubscribe(),Zt=Nt()},()=>{Zt.unsubscribe(),l.restart=void 0}})};const ee=this.incrementalHandler.prepareRequest({query:d,variables:i,context:{...this.defaultContext,...t,queryDeduplication:s},extensions:r});if(t=ee.context,s){const Le=B5(d),Ct=gd(i);l=k.lookup(Le,Ct),l.observable||(l.observable=Fw(Z,ee,T).pipe(fe,cy(()=>{k.peek(Le,Ct)===l&&k.remove(Le,Ct)}),m===pu.SUBSCRIPTION?P5():j7({refCount:!0})))}else l.observable=Fw(Z,ee,T).pipe(fe)}catch(ee){l.observable=$h(()=>ee)}}else l.observable=au({data:{}});if(f){const{operation:k}=pd(e);bn(!v,96,k[0].toUpperCase()+k.slice(1),A??"(anonymous)"),l.observable=l.observable.pipe(Mh(Z=>tu(this.localState.execute({client:this.client,document:f,remoteResult:Z,context:t,variables:i,fetchPolicy:o}))))}return{restart:()=>l.restart?.(),observable:l.observable.pipe(md(k=>{throw k=function aTe(n){return function rTe(n){return null!==n&&"object"==typeof n&&"string"==typeof n.message&&"string"==typeof n.name&&("string"==typeof n.stack||typeof n.stack>"u")}(n)?n:"string"==typeof n?new Error(n,{cause:n}):new zw(n)}(k),function lTe(n){$U.add(n)}(k),k}))}}getResultsFromLink(e,{queryInfo:t,cacheWriteBehavior:i,observableQuery:o,exposeExtensions:r}){const{errorPolicy:s}=e,l=this.cache.transformForLink(e.query);return this.getObservableFromLink(l,e.context,e.variables,e.fetchPolicy).observable.pipe(mo(d=>{const f=t.markQueryResult(d,{...e,document:l,cacheWriteBehavior:i}),m=Hf(f);if(m&&"none"===s)throw t.resetLastWrite(),o?.resetNotifications(),new $5(Kw(f));const v={data:f.data,...t.hasNext?{loading:!0,networkStatus:Ei.streaming,dataState:"streaming",partial:!0}:{dataState:f.data?"complete":"empty",loading:!1,networkStatus:Ei.ready,partial:!f.data}};return r&&"extensions"in f&&(v[bU]=f.extensions),m&&("none"===s&&(v.data=void 0,v.dataState="empty"),"ignore"!==s&&(v.error=new $5(Kw(f)),"streaming"!==v.dataState&&(v.networkStatus=Ei.error))),v}),md(d=>{if("none"===s)throw t.resetLastWrite(),o?.resetNotifications(),d;const f={data:void 0,dataState:"empty",loading:!1,networkStatus:Ei.ready,partial:!0};return"ignore"!==s&&(f.error=d,f.networkStatus=Ei.error),au(f)}))}fetchObservableWithInfo(e,{networkStatus:t=Ei.loading,query:i=e.query,fetchQueryOperator:o=d=>d,onCacheHit:r=()=>{},observableQuery:s,exposeExtensions:l}){const d=this.getVariables(i,e.variables);let{fetchPolicy:f="cache-first",errorPolicy:m="none",returnPartialData:v=!1,notifyOnNetworkStatusChange:A=!0,context:T={}}=e;this.prioritizeCacheValues&&("network-only"===f||"cache-and-network"===f)&&(f="cache-first");const k=Object.assign({},e,{query:i,variables:d,fetchPolicy:f,errorPolicy:m,returnPartialData:v,notifyOnNetworkStatusChange:A,context:T}),Z=new Zw(this,s),ee=Zt=>{k.variables=Zt;const Ri=this.fetchQueryByPolicy(k,{queryInfo:Z,cacheWriteBehavior:"no-cache"===f?0:t===Ei.refetch&&"merge"!==k.refetchWritePolicy?1:2,onCacheHit:r,observableQuery:s,exposeExtensions:l});return Ri.observable=Ri.observable.pipe(o),"standby"!==k.fetchPolicy&&s?.applyNextFetchPolicy("after-fetch",e),Ri},fe=()=>{this.fetchCancelFns.delete(Z.id)};this.fetchCancelFns.set(Z.id,Zt=>{Le.next({kind:"E",error:Zt,source:"network"})});const Le=new Wn;let Ct,Nt;if(this.getDocumentInfo(k.query).hasClientExports)Ct=tu(this.localState.getExportedVariables({client:this.client,document:k.query,variables:k.variables,context:k.context})).pipe(Mh(Zt=>ee(Zt).observable)),Nt=!0;else{const Zt=ee(k.variables);Nt=Zt.fromLink,Ct=Zt.observable}return{observable:new wn(Zt=>{Zt.add(fe),Ct.subscribe(Zt),Le.subscribe(Zt)}).pipe(P5()),fromLink:Nt}}refetchQueries({updateCache:e,include:t,optimistic:i=!1,removeOptimistic:o=(i?wH("refetchQueries"):void 0),onQueryUpdated:r}){const s=new Map;t&&this.getObservableQueries(t).forEach(d=>{if("cache-only"===d.options.fetchPolicy||d.variablesUnknown)return;const f=d.getCurrentResult();s.set(d,{oq:d,lastDiff:{result:f?.data,complete:!f?.partial}})});const l=new Map;if(e){const d=new Set;this.cache.batch({update:e,optimistic:i&&o||!1,removeOptimistic:o,onWatchUpdated(f,m,v){const A=f.watcher;if(A instanceof Ww&&!d.has(A)){if(d.add(A),r){s.delete(A);let T=r(A,m,v);return!0===T&&(T=A.refetch().retain()),!1!==T&&l.set(A,T),T}null!==r&&"cache-only"!==A.options.fetchPolicy&&s.set(A,{oq:A,lastDiff:v,diff:m})}}})}return s.size&&s.forEach(({oq:d,lastDiff:f,diff:m})=>{let v;r&&(m||(m=d.getCacheDiff()),v=r(d,m,f)),(!r||!0===v)&&(v=d.refetch().retain()),!1!==v&&l.set(d,v)}),o&&this.cache.removeOptimistic(o),l}noCacheWarningsByCause=new WeakSet;maskOperation(e){const{document:t,data:i}=e;return this.dataMasking?function dTe(n,e,t){const i=pd(e);return bn(i,43),null==n?n:ZU(n,i.selectionSet,{operationType:i.operation,operationName:i.name?.value,fragmentMap:F5(H5(e)),cache:t,mutableTargets:new WeakMap,knownChanged:new WeakSet})}(i,t,this.cache):i}maskFragment(e){const{data:t,fragment:i,fragmentName:o}=e;return this.dataMasking?function hTe(n,e,t,i){const o=e.definitions.filter(s=>s.kind===pn.FRAGMENT_DEFINITION);typeof i>"u"&&(bn(1===o.length,41,o.length),i=o[0].name.value);const r=o.find(s=>s.name.value===i);return bn(!!r,42,i),null==n||sr(n,{})?n:ZU(n,r.selectionSet,{operationType:"fragment",operationName:r.name.value,fragmentMap:F5(H5(e)),cache:t,mutableTargets:new WeakMap,knownChanged:new WeakSet})}(t,i,this.cache,o):t}fetchQueryByPolicy({query:e,variables:t,fetchPolicy:i,errorPolicy:o,returnPartialData:r,context:s},{cacheWriteBehavior:l,onCacheHit:d,queryInfo:f,observableQuery:m,exposeExtensions:v}){const A=()=>this.cache.diff({query:e,variables:t,returnPartialData:!0,optimistic:!0}),T=(Z,ee)=>{const fe=Z.result,Le=Nt=>(!Z.complete&&!r&&(Nt=void 0),{data:Nt,dataState:Z.complete?"complete":Nt?"partial":"empty",loading:Q7(ee),networkStatus:ee,partial:!Z.complete});return(Z.complete||r)&&this.getDocumentInfo(e).hasForcedResolvers?(d(),tu(this.localState.execute({client:this.client,document:e,remoteResult:fe?{data:fe}:void 0,context:s,variables:t,onlyRunForcedResolvers:!0,returnPartialData:!0,fetchPolicy:i}).then(Nt=>({kind:"N",value:Le(Nt.data||void 0),source:"cache"})))):au({kind:"N",value:Le("none"===o&&ee===Ei.refetch&&Z.missing?void 0:fe||void 0),source:"cache"})},k=()=>this.getResultsFromLink({query:e,variables:t,context:s,fetchPolicy:i,errorPolicy:o},{cacheWriteBehavior:l,queryInfo:f,observableQuery:m,exposeExtensions:v}).pipe(nz(),function nTe(){return ia((n,e)=>{n.subscribe(Sa(e,t=>{e.next(vd.createNext(t))},()=>{e.next(vd.createComplete()),e.complete()},t=>{e.next(vd.createError(t)),e.complete()}))})}(),mo(Z=>({...Z,source:"network"})));switch(i){default:case"cache-first":{const Z=A();return Z.complete?{fromLink:!1,observable:T(Z,Ei.ready)}:r?{fromLink:!0,observable:W5(T(Z,Ei.loading),k())}:{fromLink:!0,observable:k()}}case"cache-and-network":{const Z=A();return Z.complete||r?{fromLink:!0,observable:W5(T(Z,Ei.loading),k())}:{fromLink:!0,observable:k()}}case"cache-only":return{fromLink:!1,observable:W5(T(A(),Ei.ready))};case"network-only":case"no-cache":return{fromLink:!0,observable:k()};case"standby":return{fromLink:!1,observable:hd}}}}function nz(){let n=!1;return u1({next(){n=!0},complete(){bn(n,100)}})}function wTe(n){return fu(n,{FragmentSpread:e=>{if(!e.directives?.some(t=>"unmask"===t.name.value))return{...e,directives:[...e.directives||[],{kind:pn.DIRECTIVE,name:{kind:pn.NAME,value:"nonreactive"}}]}}})}function Kw(n){if(null==n.extensions?.[Wh])return n;const{extensions:{[Wh]:e,...t},...i}=n;return Object.keys(t).length>0&&(i.extensions=t),i}class Xw{link;cache;disableNetworkFetches;set prioritizeCacheValues(e){this.queryManager.prioritizeCacheValues=e}get prioritizeCacheValues(){return this.queryManager.prioritizeCacheValues}version;queryDeduplication;defaultOptions;devtoolsConfig;refetchEventManager;queryManager;devToolsHookCb;resetStoreCallbacks=[];clearStoreCallbacks=[];constructor(e){const{cache:t,documentTransform:i,ssrMode:o=!1,ssrForceFetchDelay:r=0,queryDeduplication:s=!0,defaultOptions:l,defaultContext:d,assumeImmutableResults:f=t.assumeImmutableResults,localState:m,devtools:v,dataMasking:A,link:T,incrementalHandler:k=new QAe,experiments:Z=[],refetchEventManager:ee}=e;this.link=T,this.cache=t,this.queryDeduplication=s,this.defaultOptions=l||{},this.devtoolsConfig={...v,enabled:v?.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=Qy,this.queryManager=new CTe({client:this,defaultOptions:this.defaultOptions,defaultContext:d,documentTransform:i,queryDeduplication:s,ssrMode:o,dataMasking:!!A,clientOptions:e,incrementalHandler:k,assumeImmutableResults:f,onBroadcast:this.devtoolsConfig.enabled?()=>{this.devToolsHookCb&&this.devToolsHookCb()}:void 0,localState:m}),this.prioritizeCacheValues=o||r>0,r&&setTimeout(()=>{this.prioritizeCacheValues=!1},r),this.devtoolsConfig.enabled&&this.connectToDevTools(),Z.forEach(fe=>fe.call(this,e)),this.refetchEventManager=ee,this.refetchEventManager?.connect(this)}connectToDevTools(){if(typeof window>"u")return;const e=window,t=Symbol.for("apollo.devtools");(e[t]=e[t]||[]).push(this),e.__APOLLO_CLIENT__=this}get documentTransform(){return this.queryManager.documentTransform}get localState(){return this.queryManager.localState}set localState(e){this.queryManager.localState=e}stop(){this.queryManager.stop(),this.refetchEventManager?.disconnect(this)}watchQuery(e){const{refetchOn:t}=e;if(this.defaultOptions.watchQuery){const i=this.defaultOptions.watchQuery.refetchOn;let o;t&&"object"==typeof t&&("object"==typeof i?o={...i,...t}:null!=i&&(o=r=>{const s=t[r.source]??i;return"function"==typeof s?s(r):s})),e=q7(this.defaultOptions.watchQuery,e),o&&(e.refetchOn=o)}return this.queryManager.watchQuery(e)}query=e=>(this.defaultOptions.query&&(e=q7(this.defaultOptions.query,e)),this.queryManager.query(e));mutate=e=>{const t=q7(b1({fetchPolicy:"network-only",errorPolicy:"none"},this.defaultOptions.mutate),e);return zh(t.mutation,pu.MUTATION),this.queryManager.mutate(t)};subscribe(e){const t={},i=this.queryManager.startGraphQLSubscription(e),o=i.pipe(mo(r=>({...r,data:this.queryManager.maskOperation({document:e.query,data:r.data,fetchPolicy:e.fetchPolicy,cause:t})})));return Object.assign(o,{restart:i.restart})}readQuery(e,t=!!e.optimistic){return this.cache.readQuery({...e,query:this.transform(e.query)},t)}watchFragment(e){const t=this.queryManager.dataMasking;return this.cache.watchFragment({...e,fragment:this.transform(e.fragment,t)})}readFragment(e,t=!!e.optimistic){return this.cache.readFragment({...e,fragment:this.transform(e.fragment)},t)}writeQuery(e){const t=this.cache.writeQuery(e);return!1!==e.broadcast&&this.queryManager.broadcastQueries(),t}writeFragment(e){const t=this.cache.writeFragment(e);return!1!==e.broadcast&&this.queryManager.broadcastQueries(),t}__actionHookForDevTools(e){this.devToolsHookCb=e}__requestRaw(e){return Fw(this.link,e,{client:this})}resetStore(){return Promise.resolve().then(()=>this.queryManager.clearStore({discardWatches:!1})).then(()=>Promise.all(this.resetStoreCallbacks.map(e=>e()))).then(()=>this.refetchObservableQueries())}clearStore(){return Promise.resolve().then(()=>this.queryManager.clearStore({discardWatches:!0})).then(()=>Promise.all(this.clearStoreCallbacks.map(e=>e())))}onResetStore(e){return this.resetStoreCallbacks.push(e),()=>{this.resetStoreCallbacks=this.resetStoreCallbacks.filter(t=>t!==e)}}onClearStore(e){return this.clearStoreCallbacks.push(e),()=>{this.clearStoreCallbacks=this.clearStoreCallbacks.filter(t=>t!==e)}}reFetchObservableQueries;refetchObservableQueries(e){return this.queryManager.refetchObservableQueries(e)}refetchQueries(e){const t=this.queryManager.refetchQueries(e),i=[],o=[];t.forEach((s,l)=>{i.push(l),o.push(s)});const r=Promise.all(o);return r.queries=i,r.results=o,r.catch(s=>{}),r}getObservableQueries(e="active"){return this.queryManager.getObservableQueries(e)}extract(e){return this.cache.extract(e)}restore(e){return this.cache.restore(e)}setLink(e){this.link=e}get defaultContext(){return this.queryManager.defaultContext}maskedFragmentTransform=new fd(JAe);transform(e,t=!1){const i=this.queryManager.transform(e);return t?this.maskedFragmentTransform.transformDocument(i):i}}function TTe(n,e){if(!n)throw new Error(e??"Unexpected invariant triggered.")}const ITe=/\r\n|[\n\r]/g;function qw(n,e){let t=0,i=1;for(const o of n.body.matchAll(ITe)){if("number"==typeof o.index||TTe(!1),o.index>=e)break;t=o.index+o[0].length,i+=1}return{line:i,column:e+1-t}}function STe(n){return oz(n.source,qw(n.source,n.start))}function oz(n,e){const t=n.locationOffset.column-1,i="".padStart(t)+n.body,o=e.line-1,s=e.line+(n.locationOffset.line-1),d=e.column+(1===e.line?t:0),f=`${n.name}:${s}:${d}\n`,m=i.split(/\r\n|[\n\r]/g),v=m[o];if(v.length>120){const A=Math.floor(d/80),T=d%80,k=[];for(let Z=0;Z<v.length;Z+=80)k.push(v.slice(Z,Z+80));return f+rz([[`${s} |`,k[0]],...k.slice(1,A+1).map(Z=>["|",Z]),["|","^".padStart(T)],["|",k[A+1]]])}return f+rz([[s-1+" |",m[o-1]],[`${s} |`,v],["|","^".padStart(d)],[`${s+1} |`,m[o+1]]])}function rz(n){const e=n.filter(([i,o])=>void 0!==o),t=Math.max(...e.map(([i])=>i.length));return e.map(([i,o])=>i.padStart(t)+(o?" "+o:"")).join("\n")}class Qw extends Error{constructor(e,...t){var i,o,r;const{nodes:s,source:l,positions:d,path:f,originalError:m,extensions:v}=function ETe(n){const e=n[0];return null==e||"kind"in e||"length"in e?{nodes:e,source:n[1],positions:n[2],path:n[3],originalError:n[4],extensions:n[5]}:e}(t);super(e),this.name="GraphQLError",this.path=f??void 0,this.originalError=m??void 0,this.nodes=sz(Array.isArray(s)?s:s?[s]:void 0);const A=sz(null===(i=this.nodes)||void 0===i?void 0:i.map(k=>k.loc).filter(k=>null!=k));this.source=l??(null==A||null===(o=A[0])||void 0===o?void 0:o.source),this.positions=d??A?.map(k=>k.start),this.locations=d&&l?d.map(k=>qw(l,k)):A?.map(k=>qw(k.source,k.start));const T=function ATe(n){return"object"==typeof n&&null!==n}(m?.extensions)?m?.extensions:void 0;this.extensions=null!==(r=v??T)&&void 0!==r?r:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),null!=m&&m.stack?Object.defineProperty(this,"stack",{value:m.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,Qw):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let e=this.message;if(this.nodes)for(const t of this.nodes)t.loc&&(e+="\n\n"+STe(t.loc));else if(this.source&&this.locations)for(const t of this.locations)e+="\n\n"+oz(this.source,t);return e}toJSON(){const e={message:this.message};return null!=this.locations&&(e.locations=this.locations),null!=this.path&&(e.path=this.path),null!=this.extensions&&Object.keys(this.extensions).length>0&&(e.extensions=this.extensions),e}}function sz(n){return void 0===n||0===n.length?void 0:n}function cs(n,e,t){return new Qw(`Syntax Error: ${t}`,{source:n,positions:[e]})}var az=function(n){return n.QUERY="QUERY",n.MUTATION="MUTATION",n.SUBSCRIPTION="SUBSCRIPTION",n.FIELD="FIELD",n.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",n.FRAGMENT_SPREAD="FRAGMENT_SPREAD",n.INLINE_FRAGMENT="INLINE_FRAGMENT",n.VARIABLE_DEFINITION="VARIABLE_DEFINITION",n.SCHEMA="SCHEMA",n.SCALAR="SCALAR",n.OBJECT="OBJECT",n.FIELD_DEFINITION="FIELD_DEFINITION",n.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",n.INTERFACE="INTERFACE",n.UNION="UNION",n.ENUM="ENUM",n.ENUM_VALUE="ENUM_VALUE",n.INPUT_OBJECT="INPUT_OBJECT",n.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION",n.DIRECTIVE_DEFINITION="DIRECTIVE_DEFINITION",n}(az||{}),kt=function(n){return n.SOF="<SOF>",n.EOF="<EOF>",n.BANG="!",n.DOLLAR="$",n.AMP="&",n.PAREN_L="(",n.PAREN_R=")",n.DOT=".",n.SPREAD="...",n.COLON=":",n.EQUALS="=",n.AT="@",n.BRACKET_L="[",n.BRACKET_R="]",n.BRACE_L="{",n.PIPE="|",n.BRACE_R="}",n.NAME="Name",n.INT="Int",n.FLOAT="Float",n.STRING="String",n.BLOCK_STRING="BlockString",n.COMMENT="Comment",n}(kt||{});class xTe{constructor(e){const t=new vH(kt.SOF,0,0,0,0);this.source=e,this.lastToken=t,this.token=t,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let e=this.token;if(e.kind!==kt.EOF)do{if(e.next)e=e.next;else{const t=NTe(this,e.end);e.next=t,t.prev=e,e=t}}while(e.kind===kt.COMMENT);return e}}function Vf(n){return n>=0&&n<=55295||n>=57344&&n<=1114111}function J7(n,e){return lz(n.charCodeAt(e))&&cz(n.charCodeAt(e+1))}function lz(n){return n>=55296&&n<=56319}function cz(n){return n>=56320&&n<=57343}function C1(n,e){const t=n.source.body.codePointAt(e);if(void 0===t)return kt.EOF;if(t>=32&&t<=126){const i=String.fromCodePoint(t);return'"'===i?"'\"'":`"${i}"`}return"U+"+t.toString(16).toUpperCase().padStart(4,"0")}function Jr(n,e,t,i,o){return new vH(e,t,i,n.line,1+t-n.lineStart,o)}function NTe(n,e){const t=n.source.body,i=t.length;let o=e;for(;o<i;){const r=t.charCodeAt(o);switch(r){case 65279:case 9:case 32:case 44:++o;continue;case 10:++o,++n.line,n.lineStart=o;continue;case 13:10===t.charCodeAt(o+1)?o+=2:++o,++n.line,n.lineStart=o;continue;case 35:return LTe(n,o);case 33:return Jr(n,kt.BANG,o,o+1);case 36:return Jr(n,kt.DOLLAR,o,o+1);case 38:return Jr(n,kt.AMP,o,o+1);case 40:return Jr(n,kt.PAREN_L,o,o+1);case 41:return Jr(n,kt.PAREN_R,o,o+1);case 46:if(46===t.charCodeAt(o+1)&&46===t.charCodeAt(o+2))return Jr(n,kt.SPREAD,o,o+3);break;case 58:return Jr(n,kt.COLON,o,o+1);case 61:return Jr(n,kt.EQUALS,o,o+1);case 64:return Jr(n,kt.AT,o,o+1);case 91:return Jr(n,kt.BRACKET_L,o,o+1);case 93:return Jr(n,kt.BRACKET_R,o,o+1);case 123:return Jr(n,kt.BRACE_L,o,o+1);case 124:return Jr(n,kt.PIPE,o,o+1);case 125:return Jr(n,kt.BRACE_R,o,o+1);case 34:return 34===t.charCodeAt(o+1)&&34===t.charCodeAt(o+2)?PTe(n,o):RTe(n,o)}if(k5(r)||45===r)return MTe(n,o,r);if(oU(r))return FTe(n,o);throw cs(n.source,o,39===r?"Unexpected single quote character ('), did you mean to use a double quote (\")?":Vf(r)||J7(t,o)?`Unexpected character: ${C1(n,o)}.`:`Invalid character: ${C1(n,o)}.`)}return Jr(n,kt.EOF,i,i)}function LTe(n,e){const t=n.source.body,i=t.length;let o=e+1;for(;o<i;){const r=t.charCodeAt(o);if(10===r||13===r)break;if(Vf(r))++o;else{if(!J7(t,o))break;o+=2}}return Jr(n,kt.COMMENT,e,o,t.slice(e+1,o))}function MTe(n,e,t){const i=n.source.body;let o=e,r=t,s=!1;if(45===r&&(r=i.charCodeAt(++o)),48===r){if(r=i.charCodeAt(++o),k5(r))throw cs(n.source,o,`Invalid number, unexpected digit after 0: ${C1(n,o)}.`)}else o=Jw(n,o,r),r=i.charCodeAt(o);if(46===r&&(s=!0,r=i.charCodeAt(++o),o=Jw(n,o,r),r=i.charCodeAt(o)),(69===r||101===r)&&(s=!0,r=i.charCodeAt(++o),(43===r||45===r)&&(r=i.charCodeAt(++o)),o=Jw(n,o,r),r=i.charCodeAt(o)),46===r||oU(r))throw cs(n.source,o,`Invalid number, expected digit but got: ${C1(n,o)}.`);return Jr(n,s?kt.FLOAT:kt.INT,e,o,i.slice(e,o))}function Jw(n,e,t){if(!k5(t))throw cs(n.source,e,`Invalid number, expected digit but got: ${C1(n,e)}.`);const i=n.source.body;let o=e+1;for(;k5(i.charCodeAt(o));)++o;return o}function RTe(n,e){const t=n.source.body,i=t.length;let o=e+1,r=o,s="";for(;o<i;){const l=t.charCodeAt(o);if(34===l)return s+=t.slice(r,o),Jr(n,kt.STRING,e,o+1,s);if(92===l){s+=t.slice(r,o);const d=117===t.charCodeAt(o+1)?123===t.charCodeAt(o+2)?kTe(n,o):OTe(n,o):BTe(n,o);s+=d.value,o+=d.size,r=o;continue}if(10===l||13===l)break;if(Vf(l))++o;else{if(!J7(t,o))throw cs(n.source,o,`Invalid character within String: ${C1(n,o)}.`);o+=2}}throw cs(n.source,o,"Unterminated string.")}function kTe(n,e){const t=n.source.body;let i=0,o=3;for(;o<12;){const r=t.charCodeAt(e+o++);if(125===r){if(o<5||!Vf(i))break;return{value:String.fromCodePoint(i),size:o}}if(i=i<<4|X5(r),i<0)break}throw cs(n.source,e,`Invalid Unicode escape sequence: "${t.slice(e,e+o)}".`)}function OTe(n,e){const t=n.source.body,i=uz(t,e+2);if(Vf(i))return{value:String.fromCodePoint(i),size:6};if(lz(i)&&92===t.charCodeAt(e+6)&&117===t.charCodeAt(e+7)){const o=uz(t,e+8);if(cz(o))return{value:String.fromCodePoint(i,o),size:12}}throw cs(n.source,e,`Invalid Unicode escape sequence: "${t.slice(e,e+6)}".`)}function uz(n,e){return X5(n.charCodeAt(e))<<12|X5(n.charCodeAt(e+1))<<8|X5(n.charCodeAt(e+2))<<4|X5(n.charCodeAt(e+3))}function X5(n){return n>=48&&n<=57?n-48:n>=65&&n<=70?n-55:n>=97&&n<=102?n-87:-1}function BTe(n,e){const t=n.source.body;switch(t.charCodeAt(e+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:"\n",size:2};case 114:return{value:"\r",size:2};case 116:return{value:"\t",size:2}}throw cs(n.source,e,`Invalid character escape sequence: "${t.slice(e,e+2)}".`)}function PTe(n,e){const t=n.source.body,i=t.length;let o=n.lineStart,r=e+3,s=r,l="";const d=[];for(;r<i;){const f=t.charCodeAt(r);if(34===f&&34===t.charCodeAt(r+1)&&34===t.charCodeAt(r+2)){l+=t.slice(s,r),d.push(l);const m=Jr(n,kt.BLOCK_STRING,e,r+3,Qwe(d).join("\n"));return n.line+=d.length-1,n.lineStart=o,m}if(92!==f||34!==t.charCodeAt(r+1)||34!==t.charCodeAt(r+2)||34!==t.charCodeAt(r+3))if(10!==f&&13!==f)if(Vf(f))++r;else{if(!J7(t,r))throw cs(n.source,r,`Invalid character within String: ${C1(n,r)}.`);r+=2}else l+=t.slice(s,r),d.push(l),13===f&&10===t.charCodeAt(r+1)?r+=2:++r,l="",s=r,o=r;else l+=t.slice(s,r),s=r+1,r+=4}throw cs(n.source,r,"Unterminated string.")}function FTe(n,e){const t=n.source.body,i=t.length;let o=e+1;for(;o<i&&qwe(t.charCodeAt(o));)++o;return Jr(n,kt.NAME,e,o,t.slice(e,o))}const HTe=globalThis.process?function(e,t){return e instanceof t}:function(e,t){if(e instanceof t)return!0;if("object"==typeof e&&null!==e){var i;const o=t.prototype[Symbol.toStringTag];if(o===(Symbol.toStringTag in e?e[Symbol.toStringTag]:null===(i=e.constructor)||void 0===i?void 0:i.name)){const s=Ky(e);throw new Error(`Cannot use ${o} "${s}" from another module or realm.\n\nEnsure that there is only one instance of "graphql" in the node_modules\ndirectory. If different versions of "graphql" are the dependencies of other\nrelied on modules, use "resolutions" to ensure only one version is installed.\n\nhttps://yarnpkg.com/en/docs/selective-version-resolutions\n\nDuplicate "graphql" modules cannot be used at the same time since different\nversions may have different capabilities and behavior. The data from one\nversion used in the function from another could produce confusing and\nspurious results.`)}}return!1};class dz{constructor(e,t="GraphQL request",i={line:1,column:1}){"string"==typeof e||k7(!1,`Body must be a string. Received: ${Ky(e)}.`),this.body=e,this.name=t,this.locationOffset=i,this.locationOffset.line>0||k7(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||k7(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}class q5{constructor(e,t={}){const{lexer:i,...o}=t;if(i)this._lexer=i;else{const r=function UTe(n){return HTe(n,dz)}(e)?e:new dz(e);this._lexer=new xTe(r)}this._options=o,this._tokenCounter=0}get tokenCount(){return this._tokenCounter}parseName(){const e=this.expectToken(kt.NAME);return this.node(e,{kind:pn.NAME,value:e.value})}parseDocument(){return this.node(this._lexer.token,{kind:pn.DOCUMENT,definitions:this.many(kt.SOF,this.parseDefinition,kt.EOF)})}parseDefinition(){if(this.peek(kt.BRACE_L))return this.parseOperationDefinition();const e=this.peekDescription(),t=e?this._lexer.lookahead():this._lexer.token;if(e&&t.kind===kt.BRACE_L)throw cs(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are not supported on shorthand queries.");if(t.kind===kt.NAME){switch(t.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}switch(t.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition()}if(e)throw cs(this._lexer.source,this._lexer.token.start,"Unexpected description, only GraphQL definitions support descriptions.");if("extend"===t.value)return this.parseTypeSystemExtension()}throw this.unexpected(t)}parseOperationDefinition(){const e=this._lexer.token;if(this.peek(kt.BRACE_L))return this.node(e,{kind:pn.OPERATION_DEFINITION,operation:pu.QUERY,description:void 0,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});const t=this.parseDescription(),i=this.parseOperationType();let o;return this.peek(kt.NAME)&&(o=this.parseName()),this.node(e,{kind:pn.OPERATION_DEFINITION,operation:i,description:t,name:o,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const e=this.expectToken(kt.NAME);switch(e.value){case"query":return pu.QUERY;case"mutation":return pu.MUTATION;case"subscription":return pu.SUBSCRIPTION}throw this.unexpected(e)}parseVariableDefinitions(){return this.optionalMany(kt.PAREN_L,this.parseVariableDefinition,kt.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:pn.VARIABLE_DEFINITION,description:this.parseDescription(),variable:this.parseVariable(),type:(this.expectToken(kt.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(kt.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const e=this._lexer.token;return this.expectToken(kt.DOLLAR),this.node(e,{kind:pn.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:pn.SELECTION_SET,selections:this.many(kt.BRACE_L,this.parseSelection,kt.BRACE_R)})}parseSelection(){return this.peek(kt.SPREAD)?this.parseFragment():this.parseField()}parseField(){const e=this._lexer.token,t=this.parseName();let i,o;return this.expectOptionalToken(kt.COLON)?(i=t,o=this.parseName()):o=t,this.node(e,{kind:pn.FIELD,alias:i,name:o,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(kt.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(e){return this.optionalMany(kt.PAREN_L,e?this.parseConstArgument:this.parseArgument,kt.PAREN_R)}parseArgument(e=!1){const t=this._lexer.token,i=this.parseName();return this.expectToken(kt.COLON),this.node(t,{kind:pn.ARGUMENT,name:i,value:this.parseValueLiteral(e)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){const e=this._lexer.token;this.expectToken(kt.SPREAD);const t=this.expectOptionalKeyword("on");return!t&&this.peek(kt.NAME)?this.node(e,{kind:pn.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(e,{kind:pn.INLINE_FRAGMENT,typeCondition:t?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){const e=this._lexer.token,t=this.parseDescription();return this.expectKeyword("fragment"),this.node(e,!0===this._options.allowLegacyFragmentVariables?{kind:pn.FRAGMENT_DEFINITION,description:t,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}:{kind:pn.FRAGMENT_DEFINITION,description:t,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if("on"===this._lexer.token.value)throw this.unexpected();return this.parseName()}parseValueLiteral(e){const t=this._lexer.token;switch(t.kind){case kt.BRACKET_L:return this.parseList(e);case kt.BRACE_L:return this.parseObject(e);case kt.INT:return this.advanceLexer(),this.node(t,{kind:pn.INT,value:t.value});case kt.FLOAT:return this.advanceLexer(),this.node(t,{kind:pn.FLOAT,value:t.value});case kt.STRING:case kt.BLOCK_STRING:return this.parseStringLiteral();case kt.NAME:switch(this.advanceLexer(),t.value){case"true":return this.node(t,{kind:pn.BOOLEAN,value:!0});case"false":return this.node(t,{kind:pn.BOOLEAN,value:!1});case"null":return this.node(t,{kind:pn.NULL});default:return this.node(t,{kind:pn.ENUM,value:t.value})}case kt.DOLLAR:if(e){if(this.expectToken(kt.DOLLAR),this._lexer.token.kind===kt.NAME)throw cs(this._lexer.source,t.start,`Unexpected variable "$${this._lexer.token.value}" in constant value.`);throw this.unexpected(t)}return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){const e=this._lexer.token;return this.advanceLexer(),this.node(e,{kind:pn.STRING,value:e.value,block:e.kind===kt.BLOCK_STRING})}parseList(e){return this.node(this._lexer.token,{kind:pn.LIST,values:this.any(kt.BRACKET_L,()=>this.parseValueLiteral(e),kt.BRACKET_R)})}parseObject(e){return this.node(this._lexer.token,{kind:pn.OBJECT,fields:this.any(kt.BRACE_L,()=>this.parseObjectField(e),kt.BRACE_R)})}parseObjectField(e){const t=this._lexer.token,i=this.parseName();return this.expectToken(kt.COLON),this.node(t,{kind:pn.OBJECT_FIELD,name:i,value:this.parseValueLiteral(e)})}parseDirectives(e){const t=[];for(;this.peek(kt.AT);)t.push(this.parseDirective(e));return t}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(e){const t=this._lexer.token;return this.expectToken(kt.AT),this.node(t,{kind:pn.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e)})}parseTypeReference(){const e=this._lexer.token;let t;if(this.expectOptionalToken(kt.BRACKET_L)){const i=this.parseTypeReference();this.expectToken(kt.BRACKET_R),t=this.node(e,{kind:pn.LIST_TYPE,type:i})}else t=this.parseNamedType();return this.expectOptionalToken(kt.BANG)?this.node(e,{kind:pn.NON_NULL_TYPE,type:t}):t}parseNamedType(){return this.node(this._lexer.token,{kind:pn.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(kt.STRING)||this.peek(kt.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("schema");const i=this.parseConstDirectives(),o=this.many(kt.BRACE_L,this.parseOperationTypeDefinition,kt.BRACE_R);return this.node(e,{kind:pn.SCHEMA_DEFINITION,description:t,directives:i,operationTypes:o})}parseOperationTypeDefinition(){const e=this._lexer.token,t=this.parseOperationType();this.expectToken(kt.COLON);const i=this.parseNamedType();return this.node(e,{kind:pn.OPERATION_TYPE_DEFINITION,operation:t,type:i})}parseScalarTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("scalar");const i=this.parseName(),o=this.parseConstDirectives();return this.node(e,{kind:pn.SCALAR_TYPE_DEFINITION,description:t,name:i,directives:o})}parseObjectTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("type");const i=this.parseName(),o=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),s=this.parseFieldsDefinition();return this.node(e,{kind:pn.OBJECT_TYPE_DEFINITION,description:t,name:i,interfaces:o,directives:r,fields:s})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(kt.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(kt.BRACE_L,this.parseFieldDefinition,kt.BRACE_R)}parseFieldDefinition(){const e=this._lexer.token,t=this.parseDescription(),i=this.parseName(),o=this.parseArgumentDefs();this.expectToken(kt.COLON);const r=this.parseTypeReference(),s=this.parseConstDirectives();return this.node(e,{kind:pn.FIELD_DEFINITION,description:t,name:i,arguments:o,type:r,directives:s})}parseArgumentDefs(){return this.optionalMany(kt.PAREN_L,this.parseInputValueDef,kt.PAREN_R)}parseInputValueDef(){const e=this._lexer.token,t=this.parseDescription(),i=this.parseName();this.expectToken(kt.COLON);const o=this.parseTypeReference();let r;this.expectOptionalToken(kt.EQUALS)&&(r=this.parseConstValueLiteral());const s=this.parseConstDirectives();return this.node(e,{kind:pn.INPUT_VALUE_DEFINITION,description:t,name:i,type:o,defaultValue:r,directives:s})}parseInterfaceTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("interface");const i=this.parseName(),o=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),s=this.parseFieldsDefinition();return this.node(e,{kind:pn.INTERFACE_TYPE_DEFINITION,description:t,name:i,interfaces:o,directives:r,fields:s})}parseUnionTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("union");const i=this.parseName(),o=this.parseConstDirectives(),r=this.parseUnionMemberTypes();return this.node(e,{kind:pn.UNION_TYPE_DEFINITION,description:t,name:i,directives:o,types:r})}parseUnionMemberTypes(){return this.expectOptionalToken(kt.EQUALS)?this.delimitedMany(kt.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("enum");const i=this.parseName(),o=this.parseConstDirectives(),r=this.parseEnumValuesDefinition();return this.node(e,{kind:pn.ENUM_TYPE_DEFINITION,description:t,name:i,directives:o,values:r})}parseEnumValuesDefinition(){return this.optionalMany(kt.BRACE_L,this.parseEnumValueDefinition,kt.BRACE_R)}parseEnumValueDefinition(){const e=this._lexer.token,t=this.parseDescription(),i=this.parseEnumValueName(),o=this.parseConstDirectives();return this.node(e,{kind:pn.ENUM_VALUE_DEFINITION,description:t,name:i,directives:o})}parseEnumValueName(){if("true"===this._lexer.token.value||"false"===this._lexer.token.value||"null"===this._lexer.token.value)throw cs(this._lexer.source,this._lexer.token.start,`${e8(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("input");const i=this.parseName(),o=this.parseConstDirectives(),r=this.parseInputFieldsDefinition();return this.node(e,{kind:pn.INPUT_OBJECT_TYPE_DEFINITION,description:t,name:i,directives:o,fields:r})}parseInputFieldsDefinition(){return this.optionalMany(kt.BRACE_L,this.parseInputValueDef,kt.BRACE_R)}parseTypeSystemExtension(){const e=this._lexer.lookahead();if(e.kind===kt.NAME)switch(e.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension();case"directive":if(this._options.experimentalDirectivesOnDirectiveDefinitions)return this.parseDirectiveDefinitionExtension()}throw this.unexpected(e)}parseSchemaExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");const t=this.parseConstDirectives(),i=this.optionalMany(kt.BRACE_L,this.parseOperationTypeDefinition,kt.BRACE_R);if(0===t.length&&0===i.length)throw this.unexpected();return this.node(e,{kind:pn.SCHEMA_EXTENSION,directives:t,operationTypes:i})}parseScalarTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");const t=this.parseName(),i=this.parseConstDirectives();if(0===i.length)throw this.unexpected();return this.node(e,{kind:pn.SCALAR_TYPE_EXTENSION,name:t,directives:i})}parseObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");const t=this.parseName(),i=this.parseImplementsInterfaces(),o=this.parseConstDirectives(),r=this.parseFieldsDefinition();if(0===i.length&&0===o.length&&0===r.length)throw this.unexpected();return this.node(e,{kind:pn.OBJECT_TYPE_EXTENSION,name:t,interfaces:i,directives:o,fields:r})}parseInterfaceTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const t=this.parseName(),i=this.parseImplementsInterfaces(),o=this.parseConstDirectives(),r=this.parseFieldsDefinition();if(0===i.length&&0===o.length&&0===r.length)throw this.unexpected();return this.node(e,{kind:pn.INTERFACE_TYPE_EXTENSION,name:t,interfaces:i,directives:o,fields:r})}parseUnionTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const t=this.parseName(),i=this.parseConstDirectives(),o=this.parseUnionMemberTypes();if(0===i.length&&0===o.length)throw this.unexpected();return this.node(e,{kind:pn.UNION_TYPE_EXTENSION,name:t,directives:i,types:o})}parseEnumTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const t=this.parseName(),i=this.parseConstDirectives(),o=this.parseEnumValuesDefinition();if(0===i.length&&0===o.length)throw this.unexpected();return this.node(e,{kind:pn.ENUM_TYPE_EXTENSION,name:t,directives:i,values:o})}parseInputObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const t=this.parseName(),i=this.parseConstDirectives(),o=this.parseInputFieldsDefinition();if(0===i.length&&0===o.length)throw this.unexpected();return this.node(e,{kind:pn.INPUT_OBJECT_TYPE_EXTENSION,name:t,directives:i,fields:o})}parseDirectiveDefinitionExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("directive"),this.expectToken(kt.AT);const t=this.parseName(),i=this.parseConstDirectives();if(0===i.length)throw this.unexpected();return this.node(e,{kind:pn.DIRECTIVE_EXTENSION,name:t,directives:i})}parseDirectiveDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("directive"),this.expectToken(kt.AT);const i=this.parseName(),o=this.parseArgumentDefs(),r=this._options.experimentalDirectivesOnDirectiveDefinitions?this.parseConstDirectives():[],s=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const l=this.parseDirectiveLocations();return this.node(e,{kind:pn.DIRECTIVE_DEFINITION,description:t,name:i,arguments:o,directives:r,repeatable:s,locations:l})}parseDirectiveLocations(){return this.delimitedMany(kt.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){const e=this._lexer.token,t=this.parseName();if(Object.prototype.hasOwnProperty.call(az,t.value))return t;throw this.unexpected(e)}parseSchemaCoordinate(){const e=this._lexer.token,t=this.expectOptionalToken(kt.AT),i=this.parseName();let o,r;return!t&&this.expectOptionalToken(kt.DOT)&&(o=this.parseName()),(t||o)&&this.expectOptionalToken(kt.PAREN_L)&&(r=this.parseName(),this.expectToken(kt.COLON),this.expectToken(kt.PAREN_R)),this.node(e,t?r?{kind:pn.DIRECTIVE_ARGUMENT_COORDINATE,name:i,argumentName:r}:{kind:pn.DIRECTIVE_COORDINATE,name:i}:o?r?{kind:pn.ARGUMENT_COORDINATE,name:i,fieldName:o,argumentName:r}:{kind:pn.MEMBER_COORDINATE,name:i,memberName:o}:{kind:pn.TYPE_COORDINATE,name:i})}node(e,t){return!0!==this._options.noLocation&&(t.loc=new dwe(e,this._lexer.lastToken,this._lexer.source)),t}peek(e){return this._lexer.token.kind===e}expectToken(e){const t=this._lexer.token;if(t.kind===e)return this.advanceLexer(),t;throw cs(this._lexer.source,t.start,`Expected ${hz(e)}, found ${e8(t)}.`)}expectOptionalToken(e){return this._lexer.token.kind===e&&(this.advanceLexer(),!0)}expectKeyword(e){const t=this._lexer.token;if(t.kind!==kt.NAME||t.value!==e)throw cs(this._lexer.source,t.start,`Expected "${e}", found ${e8(t)}.`);this.advanceLexer()}expectOptionalKeyword(e){const t=this._lexer.token;return t.kind===kt.NAME&&t.value===e&&(this.advanceLexer(),!0)}unexpected(e){const t=e??this._lexer.token;return cs(this._lexer.source,t.start,`Unexpected ${e8(t)}.`)}any(e,t,i){this.expectToken(e);const o=[];for(;!this.expectOptionalToken(i);)o.push(t.call(this));return o}optionalMany(e,t,i){if(this.expectOptionalToken(e)){const o=[];do{o.push(t.call(this))}while(!this.expectOptionalToken(i));return o}return[]}many(e,t,i){this.expectToken(e);const o=[];do{o.push(t.call(this))}while(!this.expectOptionalToken(i));return o}delimitedMany(e,t){this.expectOptionalToken(e);const i=[];do{i.push(t.call(this))}while(this.expectOptionalToken(e));return i}advanceLexer(){const{maxTokens:e}=this._options,t=this._lexer.advance();if(t.kind!==kt.EOF&&(++this._tokenCounter,void 0!==e&&this._tokenCounter>e))throw cs(this._lexer.source,t.start,`Document contains more that ${e} tokens. Parsing aborted.`)}}function e8(n){const e=n.value;return hz(n.kind)+(null!=e?` "${e}"`:"")}function hz(n){return function DTe(n){return n===kt.BANG||n===kt.DOLLAR||n===kt.AMP||n===kt.PAREN_L||n===kt.PAREN_R||n===kt.DOT||n===kt.SPREAD||n===kt.COLON||n===kt.EQUALS||n===kt.AT||n===kt.BRACKET_L||n===kt.BRACKET_R||n===kt.BRACE_L||n===kt.PIPE||n===kt.BRACE_R}(n)?`"${n}"`:n}var t8=new Map,eA=new Map,_z=!0,Q5=!1;function pz(n){return n.replace(/[\s,]+/g," ").trim()}function YTe(n){var e=pz(n);if(!t8.has(e)){var t=function GTe(n,e){const t=new q5(n,e),i=t.parseDocument();return Object.defineProperty(i,"tokenCount",{enumerable:!1,value:t.tokenCount}),i}(n,{experimentalFragmentVariables:Q5,allowLegacyFragmentVariables:Q5,experimentalFragmentArguments:Q5});if(!t||"Document"!==t.kind)throw new Error("Not a valid GraphQL document.");t8.set(e,function ZTe(n){var e=new Set(n.definitions);e.forEach(function(i){i.loc&&delete i.loc,Object.keys(i).forEach(function(o){var r=i[o];r&&"object"==typeof r&&e.add(r)})});var t=n.loc;return t&&(delete t.startToken,delete t.endToken),n}(function $Te(n){var e=new Set,t=[];return n.definitions.forEach(function(i){if("FragmentDefinition"===i.kind){var o=i.name.value,r=function WTe(n){return pz(n.source.body.substring(n.start,n.end))}(i.loc),s=eA.get(o);s&&!s.has(r)?_z&&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||eA.set(o,s=new Set),s.add(r),e.has(r)||(e.add(r),t.push(i))}else t.push(i)}),W0(W0({},n),{definitions:t})}(t)))}return t8.get(e)}function jf(n){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];"string"==typeof n&&(n=[n]);var i=n[0];return e.forEach(function(o,r){i+=o&&"Document"===o.kind?o.loc.source.body:o,i+=n[r+1]}),YTe(i)}var J5_gql=jf,J5_resetCaches=function KTe(){t8.clear(),eA.clear()},J5_disableFragmentWarnings=function XTe(){_z=!1},J5_enableExperimentalFragmentVariables=function qTe(){Q5=!0},J5_disableExperimentalFragmentVariables=function QTe(){Q5=!1};(function(n){n.gql=J5_gql,n.resetCaches=J5_resetCaches,n.disableFragmentWarnings=J5_disableFragmentWarnings,n.enableExperimentalFragmentVariables=J5_enableExperimentalFragmentVariables,n.disableExperimentalFragmentVariables=J5_disableExperimentalFragmentVariables})(jf||(jf={})),jf.default=jf;const tIe=new class eIe extends zB{}(class JTe extends UB{constructor(e,t){super(e,t),this.scheduler=e,this.work=t}schedule(e,t=0){return t>0?super.schedule(e,t):(this.delay=t,this.state=e,this.scheduler.flush(this),this)}execute(e,t){return t>0||this.closed?super.execute(e,t):this._execute(e,t)}requestAsyncId(e,t,i=0){return null!=i&&i>0||null==i&&this.delay>0?super.requestAsyncId(e,t,i):(e.flush(this),0)}});function gz(n){return new wn(e=>(n().then(t=>{e.closed||(e.next(t),e.complete())},t=>{e.closed||e.error(t)}),()=>e.unsubscribe()))}class oIe{zone;constructor(e){this.zone=e}now=Date.now;schedule(e,t=0,i){return this.zone.run(()=>tIe.schedule(e,t,i))}}function tA(n,e){return n.pipe(nC(new oIe(e)))}class rIe{obsQuery;valueChanges;constructor(e,t){this.obsQuery=e,this.valueChanges=tA(tu(this.obsQuery),t)}get options(){return this.obsQuery.options}get variables(){return this.obsQuery.variables}getCurrentResult(){return this.obsQuery.getCurrentResult()}refetch(e){return this.obsQuery.refetch(e)}fetchMore(e){return this.obsQuery.fetchMore(e)}subscribeToMore(e){return this.obsQuery.subscribeToMore(e)}updateQuery(e){return this.obsQuery.updateQuery(e)}stopPolling(){return this.obsQuery.stopPolling()}startPolling(e){return this.obsQuery.startPolling(e)}setVariables(e){return this.obsQuery.setVariables(e)}reobserve(e){return this.obsQuery.reobserve(e)}}const nA=new Ht("APOLLO_FLAGS"),mz=new Ht("APOLLO_OPTIONS"),vz=new Ht("APOLLO_NAMED_OPTIONS");class bz{ngZone;flags;_client;useMutationLoading;constructor(e,t,i){this.ngZone=e,this.flags=t,this._client=i,this.useMutationLoading=t?.useMutationLoading??!1}watchQuery(e){return new rIe(this.ensureClient().watchQuery({...e}),this.ngZone)}query(e){return gz(()=>this.ensureClient().query({...e}))}mutate(e){return function iIe(n,e){return e?n.pipe(mo(t=>({...t,loading:!1})),function nIe(...n){const e=y3(n);return ia((t,i)=>{(e?W5(n,t,e):W5(n,t)).subscribe(i)})}({data:void 0,loading:!0})):n.pipe(mo(t=>({...t,loading:!1})))}(gz(()=>this.ensureClient().mutate({...e})),e.useMutationLoading??this.useMutationLoading)}watchFragment(e){const{useZone:t,...i}=e,o=this.ensureClient().watchFragment({...i});return!0!==t?o:tA(o,this.ngZone)}subscribe(e){const{useZone:t,...i}=e,o=this.ensureClient().subscribe({...i});return!0!==t?o:tA(o,this.ngZone)}get client(){return this.ensureClient()}set client(e){if(this._client)throw new Error("Client has been already defined");this._client=e}ensureClient(){return this.checkInstance(),this._client}checkInstance(){if(this._client)return!0;throw new Error("Client has not been defined yet")}}let iA=(()=>{class n extends bz{map=new Map;constructor(t,i,o,r){if(super(t,r),i&&this.createDefault(i),o&&"object"==typeof o)for(let s in o)o.hasOwnProperty(s)&&this.create(o[s],s)}create(t,i){oA(i)?this.createNamed(i,t):this.createDefault(t)}default(){return this}use(t){return oA(t)?this.map.get(t):this.default()}createDefault(t){if(this._client)throw new Error("Apollo has been already created.");this.client=this.ngZone.runOutsideAngular(()=>new Xw(t))}createNamed(t,i){if(this.map.has(t))throw new Error(`Client ${t} has been already created`);this.map.set(t,new bz(this.ngZone,this.flags,this.ngZone.runOutsideAngular(()=>new Xw(i))))}removeClient(t){oA(t)?this.map.delete(t):this._client=void 0}static \u0275fac=function(i){return new(i||n)(xn(zo),xn(mz,8),xn(vz,8),xn(nA,8))};static \u0275prov=Ft({token:n,factory:n.\u0275fac})}return n})();function oA(n){return!!n&&"default"!==n}const rA=jf,n8=(n,e)=>n&&e?[...n.keys()].reduce((t,i)=>t.set(i,n.get(i)),e):e||n;const sA={batchInterval:10,batchMax:10,uri:"graphql",method:"POST",withCredentials:!1,includeQuery:!0,includeExtensions:!1,useMultipart:!1};function bd(n,e,t){return function i8(...n){return n.find(e=>typeof e<"u")}(n[t],e[t],sA[t])}class lIe extends Ks{httpClient;options;requester;print=z7;constructor(e,t){super(),this.httpClient=e,this.options=t,this.options.operationPrinter&&(this.print=this.options.operationPrinter),this.requester=i=>new wn(o=>{const r=i.getContext();let s=bd(r,this.options,"method");const l=bd(r,this.options,"includeQuery"),d=bd(r,this.options,"includeExtensions"),f=bd(r,this.options,"uri"),m=bd(r,this.options,"withCredentials"),v=bd(r,this.options,"useMultipart"),A=!0===this.options.useGETForQueries,T=n8(r.httpContext,n8(this.options.httpContext,new uy)),k=i.query.definitions.some(Le=>"OperationDefinition"===Le.kind&&"query"===Le.operation);A&&k&&(s="GET");const Z={method:s,url:"function"==typeof f?f(i):f,body:{operationName:i.operationName,variables:i.variables},options:{withCredentials:m,useMultipart:v,headers:this.options.headers,context:T}};d&&(Z.body.extensions=i.extensions),l&&(Z.body.query=this.print(i.query));const ee=function wz(n){let e=n.headers&&n.headers instanceof Ys?n.headers:new Ys(n.headers);if(n.clientAwareness){const{name:t,version:i}=n.clientAwareness;t&&!e.has("apollographql-client-name")&&(e=e.set("apollographql-client-name",t)),i&&!e.has("apollographql-client-version")&&(e=e.set("apollographql-client-version",i))}return e}(r);Z.options.headers=((n,e)=>n&&e?e.keys().reduce((i,o)=>i.set(o,e.getAll(o)),n):e||n)(Z.options.headers,ee);const fe=((n,e,t)=>{const i=-1!==["POST","PUT","PATCH"].indexOf(n.method.toUpperCase()),r=n.body.length;let l,s=n.options&&n.options.useMultipart;if(s){if(r)return new wn(f=>f.error(new Error("File upload is not available when combined with Batching")));if(!i)return new wn(f=>f.error(new Error("File upload is not available when GET is used")));if(!t)return new wn(f=>f.error(new Error('To use File upload you need to pass "extractFiles" function from "extract-files" library to HttpLink\'s options')));l=t(n.body),s=!!l.files.size}let d={};if(r){if(!i)return new wn(f=>f.error(new Error("Batching is not available for GET requests")));d={body:n.body}}else d=i?{body:s?l.clone:n.body}:{params:Object.keys(n.body).reduce((v,A)=>{const T=n.body[A];return v[A]=-1!==["variables","extensions"].indexOf(A.toLowerCase())?JSON.stringify(T):T,v},{})};if(s&&i){const f=new FormData;f.append("operations",JSON.stringify(d.body));const m={},v=l.files;let A=0;v.forEach(T=>{m[++A]=T}),f.append("map",JSON.stringify(m)),A=0,v.forEach((T,k)=>{f.append(++A+"",k,k.name)}),d.body=f}return e.request(n.method,n.url,{observe:"response",responseType:"json",reportProgress:!1,...d,...n.options})})(Z,this.httpClient,this.options.extractFiles).subscribe({next:Le=>{i.setContext({response:Le}),o.next(Le.body)},error:Le=>o.error(Le),complete:()=>o.complete()});return()=>{fe.closed||fe.unsubscribe()}})}request(e){return this.requester(e)}}let cIe=(()=>{class n{httpClient;constructor(t){this.httpClient=t}create(t){return new lIe(this.httpClient,t)}static \u0275fac=function(i){return new(i||n)(xn(cd))};static \u0275prov=Ft({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();function Az(n,e){this.v=n,this.k=e}function aA(n){return new Az(n,0)}function lA(n){return function(){return new em(n.apply(this,arguments))}}function em(n){var e,t;function i(r,s){try{var l=n[r](s),d=l.value,f=d instanceof Az;Promise.resolve(f?d.v:d).then(function(m){if(f){var v="return"===r&&d.k?r:"next";if(!d.k||m.done)return i(v,m);m=n[v](m).value}o(!!l.done,m)},function(m){i("throw",m)})}catch(m){o(2,m)}}function o(r,s){2===r?e.reject(s):e.resolve({value:s,done:r}),(e=e.next)?i(e.key,e.arg):t=null}this._invoke=function(r,s){return new Promise(function(l,d){var f={key:r,arg:s,resolve:l,reject:d,next:null};t?t=t.next=f:(e=t=f,i(r,s))})},"function"!=typeof n.return&&(this.return=void 0)}function cA(n){var e,t,i,o=2;for(typeof Symbol<"u"&&(t=Symbol.asyncIterator,i=Symbol.iterator);o--;){if(t&&null!=(e=n[t]))return e.call(n);if(i&&null!=(e=n[i]))return new o8(e.call(n));t="@@asyncIterator",i="@@iterator"}throw new TypeError("Object is not async iterable")}function o8(n){function e(t){if(Object(t)!==t)return Promise.reject(new TypeError(t+" is not an object."));var i=t.done;return Promise.resolve(t.value).then(function(o){return{value:o,done:i}})}return(o8=function(i){this.s=i,this.n=i.next}).prototype={s:null,n:null,next:function(){return e(this.n.apply(this.s,arguments))},return:function(i){var o=this.s.return;return void 0===o?Promise.resolve({value:i,done:!0}):e(o.apply(this.s,arguments))},throw:function(i){var o=this.s.return;return void 0===o?Promise.reject(i):e(o.apply(this.s,arguments))}},new o8(n)}function hIe(n){if("next"!==n&&"complete"!==n)throw new Error(`Invalid stream event "${n}"`);return n}function _Ie(n,e){if(e)try{e=JSON.parse(e)}catch{throw new Error("Invalid stream data")}if("next"===n&&!e)throw new Error('Stream data must be an object for "next" events');return e||null}em.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},em.prototype.next=function(n){return this._invoke("next",n)},em.prototype.throw=function(n){return this._invoke("throw",n)},em.prototype.return=function(n){return this._invoke("return",n)};var Gf=function(n){return n[n.NewLine=10]="NewLine",n[n.CarriageReturn=13]="CarriageReturn",n[n.Space=32]="Space",n[n.Colon=58]="Colon",n}(Gf||{});class Xl extends Error{constructor(e){let t,i;!function mIe(n){return function fIe(n){return"object"==typeof n&&null!==n}(n)&&"boolean"==typeof n.ok&&"number"==typeof n.status&&"string"==typeof n.statusText}(e)?t=e instanceof Error?e.message:String(e):(i=e,t="Server responded with "+e.status+": "+e.statusText),super(t),this.name=this.constructor.name,this.response=i}}function Tz(n){return uA.apply(this,arguments)}function uA(){return uA=(0,N.A)(function*(n){const{signal:e,url:t,credentials:i,headers:o,body:r,referrer:s,referrerPolicy:l,fetchFn:d,onMessage:f}=n,m={},v={};let A;try{A=yield d(t,{signal:e,method:r?"POST":"GET",credentials:i,referrer:s,referrerPolicy:l,headers:{...o,accept:"text/event-stream"},body:r})}catch(Z){throw new Xl(Z)}if(!A.ok)throw new Xl(A);if(!A.body)throw new Error("Missing response body");let k,T=null;return(0,N.A)(function*(){var Z;try{const Zt=function pIe(){let n,e,t,i=!1,o={event:"",data:""},r=[];const s=new TextDecoder;return function(d){if(void 0===n)n=d,e=0,t=-1;else{const v=new Uint8Array(n.length+d.length);v.set(n),v.set(d,n.length),n=v}const f=n.length;let m=0;for(;e<f;){i&&(n[e]===Gf.NewLine&&(m=++e),i=!1);let v=-1;for(;e<f&&-1===v;++e)switch(n[e]){case Gf.Colon:-1===t&&(t=e-m);break;case Gf.CarriageReturn:i=!0;case Gf.NewLine:v=e}if(-1===v)break;if(m===v){if(o.event||o.data){if(!o.event)throw new Error("Missing message event");const A=hIe(o.event),T=_Ie(A,o.data);r.push({event:A,data:T}),o={event:"",data:""}}}else if(t>0){const A=n.subarray(m,v),T=s.decode(A.subarray(0,t)),Z=s.decode(A.subarray(t+(A[t+1]===Gf.Space?2:1)));switch(T){case"event":o.event=Z;break;case"data":o.data=o.data?o.data+"\n"+Z:Z}}m=e,t=-1}if(m===f){n=void 0;const v=[...r];return r=[],v}0!==m&&(n=n.subarray(m),e-=m)}}();var Le,ee=!1,fe=!1;try{for(var Nt,Ct=cA(function vIe(n){return"function"==typeof Object(n)[Symbol.asyncIterator]?n:lA(function*(){const e=n.getReader();let t;do{t=yield aA(e.read()),void 0!==t.value&&(yield t.value)}while(!t.done)})()}(A.body));ee=!(Nt=yield Ct.next()).done;ee=!1){const Zn=Nt.value;{if("string"==typeof Zn)throw T=new Error(`Unexpected string chunk "${Zn}"`);let Ri;try{Ri=Zt(Zn)}catch(ci){throw T=ci}if(!Ri)continue;for(const ci of Ri){try{f?.(ci)}catch(ki){throw T=ki}const Yi=ci.data&&"id"in ci.data?ci.data.id:"";switch(Yi in v||(v[Yi]=[]),ci.event){case"next":v[Yi].push(Yi?ci.data.payload:ci.data);break;case"complete":v[Yi].push("complete");break;default:throw T=new Error(`Unexpected message event "${ci.event}"`)}null===(Z=m[Yi])||void 0===Z||Z.proceed()}}}}catch(Zn){fe=!0,Le=Zn}finally{try{ee&&null!=Ct.return&&(yield Ct.return())}finally{if(fe)throw Le}}if(Object.keys(m).length)throw new Error("Connection closed while having active streams")}catch(Zt){T=!T&&Object.keys(m).length?new Xl(Zt):Zt,k?.(T)}finally{Object.values(m).forEach(({proceed:Zt})=>Zt())}})(),{url:t,headers:o,waitForThrow:()=>new Promise((Z,ee)=>{if(T)return ee(T);k=ee}),getResults:Z=>lA(function*(){var ee;const{signal:fe,operationId:Le=""}=Z??{};try{for(;;){for(;null!==(ee=v[Le])&&void 0!==ee&&ee.length;){const Ct=v[Le].shift();if("complete"===Ct)return;yield Ct}if(T)throw T;if(fe?.aborted)throw new Error("Getting results aborted by the client");yield aA(new Promise(Ct=>{const Nt=()=>{fe?.removeEventListener("abort",Nt),delete m[Le],Ct()};fe?.addEventListener("abort",Nt),m[Le]={proceed:Nt}}))}}finally{delete v[Le]}})()}}),uA.apply(this,arguments)}class bIe extends Ks{constructor(e){super(),this.client=function gIe(n){const{singleConnection:e=!1,lazy:t=!0,lazyCloseTimeout:i=0,onNonLazyError:o=console.error,generateID:r=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,Yi=>{const ki=16*Math.random()|0;return("x"==Yi?ki:3&ki|8).toString(16)})},retryAttempts:s=5,retry:l=function(){var ci=(0,N.A)(function*(ki){let Ji=1e3;for(let ks=0;ks<ki;ks++)Ji*=2;yield new Promise(ks=>setTimeout(ks,Ji+Math.floor(2700*Math.random()+300)))});return function Yi(ki){return ci.apply(this,arguments)}}(),credentials:d="same-origin",referrer:f,referrerPolicy:m,onMessage:v,on:A}=n,T=n.fetchFn||fetch,k=n.abortControllerImpl||AbortController,Z=(()=>{let ci=!1;const Yi=[];return{get disposed(){return ci},onDispose:ki=>ci?(setTimeout(()=>ki(),0),()=>{}):(Yi.push(ki),()=>{Yi.splice(Yi.indexOf(ki),1)}),dispose(){if(!ci){ci=!0;for(const ki of[...Yi])ki()}}}})();let ee,fe,Le=0,Ct=null,Nt=0;function Zt(){return Zn.apply(this,arguments)}function Zn(){return(Zn=(0,N.A)(function*(){try{if(Z.disposed)throw new Error("Client has been disposed");return yield fe??(fe=(0,N.A)(function*(){var ci,Yi,ki;if(Ct){if(yield l(Nt),ee.signal.aborted)throw new Error("Connection aborted by the client");Nt++}null===(ci=A?.connecting)||void 0===ci||ci.call(A,!!Ct),ee=new k;const Ji=Z.onDispose(()=>ee.abort());ee.signal.addEventListener("abort",()=>{Ji(),fe=void 0});const ks=n,Lr="function"==typeof ks.url?yield ks.url(void 0):ks.url;if(ee.signal.aborted)throw new Error("Connection aborted by the client");const es="function"==typeof ks.headers?yield ks.headers(void 0):null!==(Yi=ks.headers)&&void 0!==Yi?Yi:{};if(ee.signal.aborted)throw new Error("Connection aborted by the client");let us;try{us=yield T(Lr,{signal:ee.signal,method:"PUT",credentials:d,referrer:f,referrerPolicy:m,headers:es})}catch(ql){throw new Xl(ql)}if(201!==us.status)throw new Xl(us);const vu=yield us.text();es["x-graphql-event-stream-token"]=vu;const wd=yield Tz({signal:ee.signal,headers:es,credentials:d,referrer:f,referrerPolicy:m,url:Lr,fetchFn:T,onMessage:ql=>{var bu;null===(bu=A?.message)||void 0===bu||bu.call(A,ql),v?.(ql)}});return null===(ki=A?.connected)||void 0===ki||ki.call(A,!!Ct),wd.waitForThrow().catch(()=>fe=void 0),wd})())}catch(ci){throw fe=void 0,ci}})).apply(this,arguments)}function Ri(ci,Yi,ki){if(!e){const Lr=new k,es=Z.onDispose(()=>{es(),Lr.abort()});return(0,N.A)(function*(){var us,vu,wd,ql,bu;let ya=null,w1=0;for(;;)try{if(ya){if(yield l(w1),Lr.signal.aborted)throw new Error("Connection aborted by the client");w1++}null===(us=A?.connecting)||void 0===us||us.call(A,!!ya),null===(vu=ki?.connecting)||void 0===vu||vu.call(ki,!!ya);const yl=n,FDe="function"==typeof yl.url?yield yl.url(ci):yl.url;if(Lr.signal.aborted)throw new Error("Connection aborted by the client");const HDe="function"==typeof yl.headers?yield yl.headers(ci):null!==(wd=yl.headers)&&void 0!==wd?wd:{};if(Lr.signal.aborted)throw new Error("Connection aborted by the client");const{getResults:UDe}=yield Tz({signal:Lr.signal,headers:{...HDe,"content-type":"application/json; charset=utf-8"},credentials:d,referrer:f,referrerPolicy:m,url:FDe,body:JSON.stringify(ci),fetchFn:T,onMessage:T1=>{var FA,HA;null===(FA=A?.message)||void 0===FA||FA.call(A,T1),null===(HA=ki?.message)||void 0===HA||HA.call(ki,T1),v?.(T1)}});null===(ql=A?.connected)||void 0===ql||ql.call(A,!!ya),null===(bu=ki?.connected)||void 0===bu||bu.call(ki,!!ya);var Cu,um=!1,$f=!1;try{for(var A1,Kh=cA(UDe());um=!(A1=yield Kh.next()).done;um=!1)ya=null,w1=0,Yi.next(A1.value)}catch(T1){$f=!0,Cu=T1}finally{try{um&&null!=Kh.return&&(yield Kh.return())}finally{if($f)throw Cu}}return Lr.abort()}catch(yl){if(Lr.signal.aborted)return;if(!(yl instanceof Xl)||!s||w1>=s)throw yl;ya=yl}})().then(()=>Yi.complete()).catch(us=>Yi.error(us)),()=>Lr.abort()}Le++;const Ji=new k,ks=Z.onDispose(()=>{ks(),Ji.abort()});return(0,N.A)(function*(){const Lr=r();ci={...ci,extensions:{...ci.extensions,operationId:Lr}};let es=null;for(;;){es=null;try{const{url:ya,headers:w1,getResults:um}=yield Zt();let $f;try{$f=yield T(ya,{signal:Ji.signal,method:"POST",credentials:d,referrer:f,referrerPolicy:m,headers:{...w1,"content-type":"application/json; charset=utf-8"},body:JSON.stringify(ci)})}catch(Cu){throw new Xl(Cu)}if(202!==$f.status)throw new Xl($f);es=function(){var Cu=(0,N.A)(function*(){let Kh;try{const A1=new k,yl=Z.onDispose(()=>{yl(),A1.abort()});Kh=yield T(ya+"?operationId="+Lr,{signal:A1.signal,method:"DELETE",credentials:d,referrer:f,referrerPolicy:m,headers:w1})}catch(A1){throw new Xl(A1)}if(200!==Kh.status)throw new Xl(Kh)});return function(){return Cu.apply(this,arguments)}}();var wd,us=!1,vu=!1;try{for(var bu,ql=cA(um({signal:Ji.signal,operationId:Lr}));us=!(bu=yield ql.next()).done;us=!1)Ct=null,Nt=0,Yi.next(bu.value)}catch(Cu){vu=!0,wd=Cu}finally{try{us&&null!=ql.return&&(yield ql.return())}finally{if(vu)throw wd}}return es=null,Ji.abort()}catch(ya){if(Ji.signal.aborted)return yield es?.();if(!(ya instanceof Xl)||(t&&(fe=void 0),!s||Nt>=s))throw Ji.abort(),ya;Ct=ya}finally{Ji.signal.aborted&&0===--Le&&(isFinite(i)&&i>0?setTimeout(()=>{Le||ee.abort()},i):ee.abort())}}})().then(()=>Yi.complete()).catch(Lr=>Yi.error(Lr)),()=>Ji.abort()}return e&&!t&&(0,N.A)(function*(){for(Le++;;)try{const{waitForThrow:ci}=yield Zt();yield ci()}catch(ci){if(Z.disposed)return;if(!(ci instanceof Xl)||(fe=void 0,!s||Nt>=s))return o?.(ci);Ct=ci}})(),{subscribe:Ri,iterate(ci,Yi){const ki=[],Ji={done:!1,error:null,resolve:()=>{}},ks=Ri(ci,{next(es){ki.push(es),Ji.resolve()},error(es){Ji.done=!0,Ji.error=es,Ji.resolve()},complete(){Ji.done=!0,Ji.resolve()}},Yi),Lr=(es=lA(function*(){for(;;){for(ki.length||(yield aA(new Promise(vu=>Ji.resolve=vu)));ki.length;)yield ki.shift();if(Ji.error)throw Ji.error;if(Ji.done)return}}),function us(){return es.apply(this,arguments)})();var es;return Lr.throw=function(){var es=(0,N.A)(function*(us){return Ji.done||(Ji.done=!0,Ji.error=us,Ji.resolve()),{done:!0,value:void 0}});return function(us){return es.apply(this,arguments)}}(),Lr.return=(0,N.A)(function*(){return ks(),{done:!0,value:void 0}}),Lr},dispose(){Z.dispose()}}}(e)}request(e){return new wn(t=>this.client.subscribe({...e,query:z7(e.query)},{next:t.next.bind(t),complete:t.complete.bind(t),error:t.error.bind(t)}))}}const CIe={run:n=>n(),runOutsideAngular:n=>n()};let Iz=(()=>{class n{constructor(){this.httpLink=we(cIe),this.gatewayService=we(gH),this.authService=we(_u),this.apollo=(t,i=!1)=>new iA(CIe,this.createApolloOptions(t,i))}resolveToken(t){return this.authService.getToken()||t.token}createApolloOptions(t,i=!1){const o=new VU(d=>{const f=d.headers instanceof Ys?d.headers:new Ys(d.headers??{});return{...d,uri:()=>this.gatewayService.getGatewayUrl(t,i),headers:f.set("Authorization",`Bearer ${this.resolveToken(t)}`).set("Accept","charset=utf-8")}}),r=Swe(({query:d})=>{const f=yw(d);return"OperationDefinition"===f.kind&&"subscription"===f.operation},new bIe({url:()=>this.gatewayService.getGatewayUrl(t,i),headers:()=>({Authorization:`Bearer ${this.resolveToken(t)}`})}),this.httpLink.create({}));return{link:Ks.from([o,r]),cache:new zU}}static{this.\u0275fac=function(i){return new(i||n)}}static{this.\u0275prov=Ft({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();function Sz(n){let e=n.replace(/[^a-zA-Z0-9]/g,"_");return/^[0-9]/.test(e)&&(e="_"+e),e}function dA(n){return n.split("_").filter(e=>e.length>0).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join("")}function Ez(n,e,t){let i;if(n&&e)i=dA(Sz(n)+"_"+e);else if(n)i=dA(Sz(n));else{if(!e)return`${t}_Input`;i=dA("_"+e)}return`${i}${t}_Input`}function tm(n,e="_"){return[n.apiGroup,n.version,n.entity].filter(t=>!!t).join(e)}const r8=n=>{const e=[];return n.map(t=>{t.property instanceof Array?t.property.map(i=>hA(i,e)):hA(t.property,e)}),e},hA=(n,e=[])=>{if(!n)return[];const t=n.split(".");for(const i of t)return 1===t.length?(e.push(i),e):(e.push({[i]:[...hA(t.splice(1).join("."))]}),e)},nm=(n,e)=>{const t=e.jsonPathExpression||e.property;if(!t)return;if(t instanceof Array)return void console.error(`Property defined as an array: ${JSON.stringify(t)}, provide "jsonPathExpression" field to properly ready resource value`);const o=po({path:`${t.startsWith("$.")?"":"$."}${t}`,json:n}),r=o.length?o[0]:void 0;return r&&e.propertyField?yIe(r[e.propertyField.key],e.propertyField.transform):r},yIe=(n,e)=>null!=n&&null!=e&&e.length?e.reduce((t,i)=>{if(null==t)return t;switch(i){case"uppercase":return t.toUpperCase();case"lowercase":return t.toLowerCase();case"capitalize":{const o=String(t);return o.length?o.charAt(0).toUpperCase()+o.slice(1):o}case"decode":try{return AIe(t)}catch{return t}case"encode":try{return wIe(t)}catch{return t}default:return t}},n):n,wIe=n=>{try{const e=(new TextEncoder).encode(n),t=Array.from(e,i=>String.fromCharCode(i)).join("");return btoa(t)}catch(e){throw console.error("Base64 encoding failed:",e),new Error("Failed to encode string to Base64")}},AIe=n=>{try{const e=atob(n),t=Uint8Array.from(e,i=>i.charCodeAt(0));return(new TextDecoder).decode(t)}catch(e){throw console.error("Base64 decoding failed:",e),new Error("Failed to decode Base64 string")}},y1=(n,e)=>nm(n,{jsonPathExpression:e});function Cd(n){return"Namespaced"===n?.resourceDefinition?.scope}function xz(n,e,t){if(!e)return n;const{getItemKey:i,mapSubscriptionObjectToItem:o}=t,r=new Map;n.forEach(m=>{const v=i(m);v&&r.set(v,m)});const{type:s,object:l}=e,d=l.metadata?.name;if(!d)return n;const f=o(l);return"ADDED"===s?r.set(d,f):"MODIFIED"===s?r.has(d)&&r.set(d,f):"DELETED"===s&&r.delete(d),[...r.values()]}function _A(n){if(Array.isArray(n))return n.map(e=>_A(e));if(n&&"object"==typeof n){const{__typename:e,...t}=n;for(const i of Object.keys(t))t[i]=_A(t[i]);return t}return n}function Dz(n){return"object"==typeof n&&null!==n&&(Object.hasOwn(n,"operation")&&Object.hasOwn(n,"variables")&&Object.hasOwn(n,"fields")||Object.hasOwn(n,"operation")&&Object.hasOwn(n,"fragment")&&Object.hasOwn(n,"fields"))}var Nz=Symbol.for("gql-query-builder.raw");function pA(n){if(function SIe(n){return"object"==typeof n&&null!==n&&!0===n[Nz]}(n))return String(n.value);if(null===n)return"null";if(Array.isArray(n))return`[${n.map(pA).join(", ")}]`;switch(typeof n){case"string":return JSON.stringify(n);case"number":case"boolean":return String(n);case"object":return`{${Object.entries(n).map(([e,t])=>`${e}: ${pA(t)}`).join(", ")}}`;default:throw new TypeError(`Cannot serialize ${typeof n} as a GraphQL literal`)}}function yd(n){let e={};for(const{variables:t,fields:i}of n)e={...e,...t,...i&&s8(i)||{}};return e}function Wf(n){return n&&Object.keys(n).length?`(${Object.entries(n).reduce((e,[t,i],o)=>`${e}${0!==o?", ":""}${i?.name?i.name:t}: $${t}`,"")})`:""}function Yh(n){return n?n.map(e=>{if(Dz(e))return function DIe(n){return`${fA(n)?"... on ":""}${function xIe(n){return fA(n)?n.operation:function EIe(n){return"string"==typeof n?n:`${n.alias}: ${n.name}`}(n.operation)}(n)} ${fA(n)?"":Wf(n.variables)} ${n.fields.length>0?`{ ${Yh(n.fields)} }`:""}`}(e);if("object"==typeof e){let t="";return Object.entries(e).forEach(([i,o],r,s)=>{t+=`${i} ${o.length>0?`{ ${Yh(o)} }`:""}`,r<s.length-1&&(t+=", ")}),t}return`${e}`}).join(", "):""}function fA(n){return!0===n?.fragment}function im(n,e){const t={},i=o=>{o&&Object.keys(o).forEach(r=>{t[r]=null!==o[r]&&"object"==typeof o[r]?o[r].value:o[r]})};return i(n),e&&"object"==typeof e&&i(s8(e)),t}function s8(n){let e={};return function t(i){return i?.forEach(o=>{if(Dz(o))e={...o.variables,...e,...o.fields&&t(o.fields)};else if("object"==typeof o)for(const[,r]of Object.entries(o))t(r)}),e}(n),e}function om(n){const e=function LIe(n){let e="String";const t=null!==n&&"object"==typeof n?n.value:n;if(null!=n?.type)e=n.type;else{const i=Array.isArray(t)?t[0]:t;if(null!=i)switch(typeof i){case"object":e="Object";break;case"boolean":e="Boolean";break;case"number":e=i%1==0?"Int":"Float"}}return null!==n&&"object"==typeof n&&(!0===n.list?e=`[${e}]`:Array.isArray(n.list)&&(e=`[${e}${n.list[0]?"!":""}]`),n.required&&(e+="!")),e}(n);return"object"!=typeof n||null===n||Array.isArray(n)||void 0===n.default?e:`${e} = ${pA(n.default)}`}var MIe=class{#e;#n;#t;#i;constructor(n,e){Array.isArray(n)?this.#e=yd(n):(this.#e=n.variables,this.#n=n.fields,this.#t=n.operation),this.#i={operationName:"",...e}}mutationBuilder(){return this.#o(this.#e,this.#s(this.#t))}mutationsBuilder(n){const e=n.map(t=>(this.#t=t.operation,this.#e=t.variables,this.#n=t.fields,this.#s(t.operation)));return this.#o(yd(n),e.join("\n "))}#r(n){return this.#n&&"object"==typeof this.#n&&(n={...s8(this.#n),...n}),n&&Object.keys(n).length>0?`(${Object.keys(n).reduce((e,t,i)=>`${e}${0!==i?", ":""}$${t}: ${om(n[t])}`,"")})`:""}#o(n,e){let t=`mutation ${this.#r(n)} {\n ${e}\n}`;return this.#i.operationName&&(t=t.replace("mutation",`mutation ${this.#i.operationName}`)),{query:t,variables:im(n,this.#n)}}#s(n){return`${"string"==typeof n?n:`${n.alias}: ${n.name}`} ${Wf(this.#e)} ${this.#n&&this.#n.length>0?`{\n ${Yh(this.#n)}\n }`:""}`}},RIe=class{#e;#n;#t;#i;constructor(n,e){this.#i={operationName:"",...e},Array.isArray(n)?this.#e=yd(n):(this.#e=n.variables,this.#n=n.fields||[],this.#t=n.operation)}queryBuilder(){return this.#o(this.#s(this.#e))}queriesBuilder(n){const e=n.filter(Boolean).map(t=>(this.#t=t.operation,this.#n=t.fields,this.#s(t.variables))).join(" ");return this.#o(e)}#r(){let n=this.#e;return this.#n&&"object"==typeof this.#n&&(n={...s8(this.#n),...n}),n&&Object.keys(n).length>0?`(${Object.keys(n).reduce((e,t,i)=>`${e}${0!==i?", ":""}$${t}: ${om(n[t])}`,"")})`:""}#o(n){let e=`query ${this.#r()} { ${n} }`;return e=e.replace("query","query"+(this.#i.operationName?` ${this.#i.operationName}`:"")),{query:e,variables:im(this.#e,this.#n)}}#s(n){return`${"string"==typeof this.#t?this.#t:`${this.#t.alias}: ${this.#t.name}`} ${n?Wf(n):""} ${this.#n&&this.#n.length>0?`{ ${Yh(this.#n)} }`:""}`}},kIe=class{#e;#n;#t;#i;constructor(n,e){Array.isArray(n)?this.#e=yd(n):(this.#e=n.variables,this.#n=n.fields,this.#t=n.operation),this.#i={operationName:"",...e}}subscriptionBuilder(){return this.#o(this.#e,this.#s())}subscriptionsBuilder(n){const e=n.map(t=>(this.#t=t.operation,this.#e=t.variables,this.#n=t.fields,this.#s()));return this.#o(yd(n),e.join("\n "))}#r(n){return n&&Object.keys(n).length?`(${Object.keys(n).reduce((e,t,i)=>`${e}${0!==i?", ":""}$${t}: ${om(n[t])}`,"")})`:""}#o(n,e){let t=`subscription ${this.#r(n)} {\n ${e}\n}`;return this.#i.operationName&&(t=t.replace("subscription",`subscription ${this.#i.operationName}`)),{query:t,variables:im(n)}}#s(){return`${"string"==typeof this.#t?this.#t:`${this.#t.alias}: ${this.#t.name}`} ${this.#e?Wf(this.#e):""} {\n ${Yh(this.#n)}\n }`}};function gA(n,e){const t=function NIe(n){return n?.length?n.map(e=>`\n\nfragment ${e.name} on ${e.on} { ${Yh(e.fields)} }`).join(""):""}(e?.fragments);return t?{...n,query:n.query+t}:n}function Lz(n,e,t){const o=new(e??RIe)(n,t);return gA(Array.isArray(n)?o.queriesBuilder(n):o.queryBuilder(),t)}function mA(n,e,t){const o=new(e??MIe)(n,t);return gA(Array.isArray(n)?o.mutationsBuilder(n):o.mutationBuilder(),t)}let rm=(()=>{class n{constructor(){this.apolloFactory=we(Iz),this.luigiCoreService=we(Cr)}read(t,i,o,r,s=!0){const l=Cd(r),d=this.getNamespace(r);let f=this.resolveReadQuery(i,o,t,l?d:void 0);return f=this.parseGQLQuery(f),this.apolloFactory.apollo(r,s).query({query:f,variables:{name:t,...l&&{namespace:d}}}).pipe(mo(m=>y1(m.data,tm(i,"."))))}resolveReadQuery(t,i,o,r){if(i instanceof Array){const{entity:s,version:l,apiGroup:d}=t,f=[{operation:s,variables:{name:{value:o,type:"String!"},...r&&{namespace:{value:r,type:"String"}}},fields:i}];return Lz(this.calcQueryOptions(f,[{operation:d},{operation:l}])).query}return i}list(t,i,o,r={}){const{readFromParentKcpPath:s=!1,pagination:l,variables:d}=r,m={...Cd(o)&&{namespace:{type:"String",value:this.getNamespace(o)}},...l?.limit&&{limit:{type:"Int",value:l?.limit}},...l?.continue&&{continue:{type:"String",value:l?.continue}},...d},v=o.resourceDefinition;return v?i instanceof Array?this.listWithFields(v,i,o,s,m):this.listWithRawQuery(t,i,o,s,m):$h(()=>new Error("Resource definition is required"))}getResourceReadyStatus(t,i){const o=i.resourceDefinition?.readyCondition;return!o||nm(t,o)}listWithFields(t,i,o,r,s){const{apiGroup:l,entityCollection:d,version:f}=t,A=Lz(this.calcQueryOptions([{operation:d,variables:s,fields:["resourceVersion","remainingItemCount","continue",{items:i}]}],[{operation:l},{operation:f}])),T=this.parseGQLQuery(A.query);return this.apolloFactory.apollo(o,r).query({query:T,variables:A.variables}).pipe(mo(k=>{const Z=y1(k.data,tm({apiGroup:l,version:f,entity:d},"."));if(!Z)throw new Error("Resource list result not found");return Z}),mo(k=>{const Z=k.items.map(ee=>({...ee,ready:this.getResourceReadyStatus(ee,o)})).map(ee=>({...ee,id:ee.metadata.name,isAvailable:this.isAvailable(ee),accessibleName:this.getAccessibleName(ee)}));return{...k,items:Z}}))}isAvailable(t){return!!t.ready&&!t.metadata?.deletionTimestamp}getAccessibleName(t){return t.metadata?.deletionTimestamp?"Resource is pending deletion":t.ready?void 0:"Resource is not ready"}listWithRawQuery(t,i,o,r,s){const l=this.parseGQLQuery(i);return this.apolloFactory.apollo(o,r).query({query:l,variables:this.normalizeGqlBuilderVariables(s)}).pipe(mo(d=>y1(d.data,t)??[]),md(d=>(this.alertErrors(d),console.error("Error executing GraphQL query.",d),$h(()=>d))))}resourceChangeSubscription(t,i,o,r,s){const d={...Cd(o)&&{namespace:{type:"String",value:this.getNamespace(o)}}},f=t.toLowerCase(),m=function PIe(n,e,t){const o=new(e??kIe)(n,t);return gA(Array.isArray(n)?o.subscriptionsBuilder(n):o.subscriptionBuilder(),t)}({operation:f,fields:["type",{object:i}],variables:{...d,resourceVersion:{type:"String",value:r}}}),v=this.parseGQLQuery(m.query);return this.apolloFactory.apollo(o,s).subscribe({query:v,variables:m.variables}).pipe(mo(A=>{const T=y1(A.data,f);return T&&(T.object.ready=this.getResourceReadyStatus(T.object,o),T.object.id=T.object.metadata.name,T.object.isAvailable=this.isAvailable(T.object),T.object.accessibleName=this.getAccessibleName(T.object)),T}))}alertErrors(t){this.luigiCoreService.showAlert({text:t.message,type:"error"})}delete(t,i,o,r=!1){const s=Cd(o),{apiGroup:l,entity:d,version:f}=i,m=[{operation:`delete${d}`,variables:{name:{type:"String!",value:t.metadata.name},...s&&{namespace:{type:"String",value:this.getNamespace(o)}}},fields:[]}],A=mA(this.calcQueryOptions(m,[{operation:l},{operation:f}])),T=this.parseGQLQuery(A.query);return this.apolloFactory.apollo(o,r).mutate({mutation:T,variables:A.variables}).pipe(md(k=>(this.alertErrors(k),console.error("Error executing GraphQL query.",k),$h(()=>k))))}create(t,i,o){const r=Cd(o),{apiGroup:s,entity:l,version:d}=i,f=this.getNamespace(o,t),m=[{operation:`create${l}`,variables:{...r&&{namespace:{type:"String",value:f}},object:{type:`${Ez(s,d,l)}!`,value:t}},fields:["__typename"]}],A=mA(this.calcQueryOptions(m,[{operation:s},{operation:d}])),T=this.parseGQLQuery(A.query);return this.apolloFactory.apollo(o).mutate({mutation:T,fetchPolicy:"no-cache",variables:A.variables}).pipe(md(k=>(this.alertErrors(k),console.error("Error executing GraphQL query.",k),$h(()=>k))))}update(t,i,o,r=!1,s=["__typename"]){const l=Cd(o),{apiGroup:d,entity:f,version:m}=i,v=this.getNamespace(o),A=_A(t),T=[{operation:`update${f}`,variables:{...l&&{namespace:{type:"String",value:v}},name:{type:"String!",value:t.metadata.name},object:{type:`${Ez(d,m,f)}!`,value:A}},fields:s}],Z=mA(this.calcQueryOptions(T,[{operation:d},{operation:m}])),ee=this.parseGQLQuery(Z.query);return this.apolloFactory.apollo(o,r).mutate({mutation:ee,fetchPolicy:"no-cache",variables:Z.variables}).pipe(mo(fe=>y1(fe.data,tm({apiGroup:d,entity:`update${f}`,version:m},"."))),md(fe=>(this.alertErrors(fe),console.error("Error executing GraphQL query.",fe),$h(()=>fe))))}getNamespace(t,i){if(t.namespaceId)return t.namespaceId;if(i?.metadata?.namespace)return i.metadata.namespace;const o=this.luigiCoreService.routing().getSearchParams().namespace;return o?"-all-"===o?void 0:o:void 0}normalizeGqlBuilderVariables(t){return Object.fromEntries(Object.entries(t).map(([i,o])=>[i,o.value]))}calcQueryOptions(t,i){const o=i.filter(l=>!!l?.operation);if(0===o.length){const l=t.pop();if(l&&l.operation&&l.fields)return l;throw new Error("At least one wrapper or inner fields is required")}let r=t,s=o.pop();return o.forEach(l=>{r=[{operation:s.operation,fields:t,variables:s.variables}],s=l}),{operation:s.operation,fields:r,variables:s.variables}}parseGQLQuery(t){try{return rA`
81
+ */globalThis.$localize=N7;const Mo=globalThis.Luigi;let Cr=(()=>{class n{setConfig(t){return Mo.setConfig(t)}get config(){return Mo.getConfig()}getConfigValue(t){return Mo.getConfigValue(t)}unloadConfig(){return Mo.unload()}sendCustomMessage(t){return Mo.sendCustomMessage(t)}configChanged(t){Mo.configChanged(t)}customMessages(){return Mo.customMessages()}navigation(){return Mo.navigation()}resetLuigi(){Mo.reset()}clearNavigationCache(){Mo.clearNavigationCache&&Mo.clearNavigationCache()}showAlert(t){return Mo.showAlert(t)}ux(){return Mo.ux()}theming(){return Mo.theming()}i18n(){return Mo.i18n()}globalSearch(){return Mo.globalSearch()}getGlobalContext(){return Mo.getGlobalContext()}getWcExtendedContext(){return document.querySelector(".wcContainer")?.querySelector("[lui_web_component]")?.extendedContext?.context}getWcModalExtendedContext(){return document.querySelector(".iframeModalCtn")?.querySelector("[lui_web_component]")?.extendedContext?.context}setGlobalContext(t,i=!1){Mo.setGlobalContext(t,i)}setInGlobalContext(t,i=!1){Mo.setGlobalContext({...this.getGlobalContext(),...t},i)}routing(){return Mo.routing()}setFeatureToggle(t){Mo.featureToggles().setFeatureToggle(t)}unsetFeatureToggle(t){Mo.featureToggles().unsetFeatureToggle(t)}unsetAllFeatureToggles(){Mo.featureToggles().getActiveFeatureToggleList().forEach(t=>{this.unsetFeatureToggle(t)})}setFeatureToggles(t){if(t)for(const i of Object.keys(t))t[i]&&this.setFeatureToggle(i)}isFeatureToggleActive(t){return Mo.featureToggles().getActiveFeatureToggleList().includes(t)}getActiveFeatureToggleList(){return Mo.featureToggles().getActiveFeatureToggleList()}setAuthData(t){Mo.auth().store.setAuthData(t),Mo.auth().store.setNewlyAuthorized()}removeAuthData(){Mo.auth().store.removeAuthData()}getAuthData(){return Mo.auth().store.getAuthData()}setCurrentLocale(t){Mo.i18n().setCurrentLocale(t)}static{this.\u0275fac=function(i){return new(i||n)}}static{this.\u0275prov=Ft({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})(),_u=(()=>{class n{constructor(t){this.http=t,this.authEventSubject=new Wn,this.parseJwt=i=>{try{return function JCe(n,e){if("string"!=typeof n)throw new x5("Invalid token specified: must be a string");e||(e={});const t=!0===e.header?0:1,i=n.split(".")[t];if("string"!=typeof i)throw new x5(`Invalid token specified: missing part #${t+1}`);let o;try{o=function QCe(n){let e=n.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return function qCe(n){return decodeURIComponent(atob(n).replace(/(.)/g,(e,t)=>{let i=t.charCodeAt(0).toString(16).toUpperCase();return i.length<2&&(i="0"+i),"%"+i}))}(e)}catch{return atob(e)}}(i)}catch(r){throw new x5(`Invalid token specified: invalid base64 for part #${t+1} (${r.message})`)}try{return JSON.parse(o)}catch(r){throw new x5(`Invalid token specified: invalid json for part #${t+1} (${r.message})`)}}(i)}catch{return null}},this.getToken=()=>this.getAuthData()?.idToken}get authEvents(){return this.authEventSubject.asObservable()}authEvent(t){this.authEventSubject.next(t)}refresh(){var t=this;return(0,N.A)(function*(){const i=yield m5(t.http.post("/rest/auth/refresh",{}));return t.setAuthData(i),i})()}setAuthData(t){t&&(this.authData={accessTokenExpirationDate:this.processExpDate(t.expires_in),idToken:t.id_token})}getAuthData(){return this.authData}getUser(){const t=this.getAuthData();return t?this.parseJwt(t.idToken):{}}getUserInfo(){const t=this.getUser()||{},i=t.first_name||t.given_name||"",o=t.last_name||t.family_name||"";return{name:`${i} ${o}`,email:t.mail||t.email||"",description:t.mail||t.email||"",icon:t.icon,initials:(i[0]||"")+(o[0]||""),userId:t.userId||t.sub||""}}processExpDate(t){const i=Number(t);return(new Date).getTime()+1e3*i}static{this.\u0275fac=function(i){return new(i||n)(xn(cd))}}static{this.\u0275prov=Ft({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})(),g1=(()=>{class n{constructor(){this.http=we(cd)}getEnvConfig(){var t=this;return(0,N.A)(function*(){return t.envConfigCache||(yield m5(t.http.get("/rest/envconfig").pipe(u1(i=>t.envConfigCache=i)))),t.envConfigCache})()}static{this.\u0275fac=function(i){return new(i||n)}}static{this.\u0275prov=Ft({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})(),dd=(()=>{class n{constructor(){this.envConfigService=we(g1),this.luigiCoreService=we(Cr),this.fallbackLanguage="en",this.translationTable={},this.currentLanguage=""}afterInit(){this.currentLanguage=this.luigiCoreService.i18n().getCurrentLocale(),this.luigiCoreService.i18n().addCurrentLocaleChangeListener(t=>{this.currentLanguage=t})}getTranslation(t,i,o){let r=this.getInternalTranslation(t,i,o);return r||(r=this.findTranslation(t,this.translationTable,this.fallbackLanguage,i)),r||t}getTranslationAsync(t,i,o){var r=this;return(0,N.A)(function*(){return new Promise(s=>{let l=r.getInternalTranslation(t,i,o);l?s(l||t):r.translationTable&&!r.translationTable[r.fallbackLanguage]?r.fetchTranslationFile(r.fallbackLanguage).then(()=>{l=r.findTranslation(t,r.translationTable,r.fallbackLanguage,i),s(l||t)}):(l=r.findTranslation(t,r.translationTable,r.fallbackLanguage,i),s(l||t))})})()}findTranslation(t,i,o,r){if(i[o]){const s="object"==typeof i[o][t]?i[o][t].join("<br>"):i[o][t];return r?this.findInterpolations(s,r):s}}findInterpolations(t,i){if(t)return Object.keys(i).forEach(o=>{t=t.replace(new RegExp("{"+o+"}","gi"),i[o])}),t}addTranslationFile(t,i){i&&t&&(this.translationTable[t]=i)}fetchTranslationFile(t){var i=this;return(0,N.A)(function*(){return new Promise(o=>{fetch(`/assets/translation-files/${t}.json`).then(r=>r.json()).then(r=>{i.addTranslationFile(t,r),o(!0)}).catch(r=>{console.error("Error:",r),i.addTranslationFile(t,{}),o(!1)})})})()}getInternalTranslation(t,i,o){return t?(this.currentLanguage=o||this.currentLanguage||this.luigiCoreService.i18n().getCurrentLocale(),this.findTranslation(t,this.translationTable,this.currentLanguage,i)):""}getValidLanguages(){var t=this;return(0,N.A)(function*(){const i=[{value:"en",label:"USERSETTINGSDIALOG_LANGUAGE_EN"}];try{const{developmentInstance:o}=yield t.envConfigService.getEnvConfig();o&&i.push({value:"de",label:"USERSETTINGSDIALOG_LANGUAGE_DE"})}finally{return i}})()}static{this.\u0275fac=function(i){return new(i||n)}}static{this.\u0275prov=Ft({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();var m1=function(n){return n.LAST_NAVIGATION_URL="openmfp.navigation.lastUrl",n.USER_SETTINGS="openmfp.settings.userSettings",n.LOCAL_DEVELOPMENT_SETTINGS="openmfp.settings.localDevelopmentSettings",n.FEATURE_TOGGLE_SETTINGS="openmfp.settings.featureToggleSettings",n.DEVELOPMENT_MODE_CONFIG="dev-mode-settings",n}(m1||{});(0,N.A)(function*(e){return e.frame_userAccount&&e.frame_userAccount.language?(delete e.frame_userAccount.name,delete e.frame_userAccount.email):delete e.frame_userAccount,new Promise((t,i)=>{try{localStorage.setItem(m1.USER_SETTINGS,JSON.stringify(e)),t(e)}catch(o){console.error("Error storing user settings",o),i({closeDialog:!0,message:"Could not write userSettings to storage..."})}})}),document.body.classList.add("ui5-content-density-compact");let gH=(()=>{class n{constructor(){this.luigiCoreService=we(Cr)}getGatewayUrl(t,i=!1){const o=t.portalContext.crdGatewayApiUrl,r=this.extractKcpPath(o);return o?.replace(r,this.resolveKcpPath(t,i))}updateCrdGatewayUrlWithEntityPath(t){const i=this.luigiCoreService.getGlobalContext().portalContext.crdGatewayApiUrl,o=this.extractKcpPath(i);this.luigiCoreService.getGlobalContext().portalContext.crdGatewayApiUrl=i.replace(o,t)}resolveKcpPath(t,i=!1){let r=this.extractKcpPath(t.portalContext.crdGatewayApiUrl);if(t.kcpPath&&(r=t.kcpPath),i){const s=r.lastIndexOf(":");-1!==s&&(r=r.slice(0,s))}return r}extractKcpPath(t){return t.match(new RegExp("(root:orgs[^/]*)"))?.[1]||""}static{this.\u0275fac=function(i){return new(i||n)}}static{this.\u0275prov=Ft({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();const hd=new wn(n=>n.complete());function vl(n,e){return n.definitions.find(t=>"OperationDefinition"===t.kind&&!!t.name)?.name.value??e}function k7(n,e){if(!n)throw new Error(e)}function Ky(n){return O7(n,[])}function O7(n,e){switch(typeof n){case"string":return JSON.stringify(n);case"function":return n.name?`[function ${n.name}]`:"[function]";case"object":return function swe(n,e){if(null===n)return"null";if(e.includes(n))return"[Circular]";const t=[...e,n];if(function awe(n){return"function"==typeof n.toJSON}(n)){const i=n.toJSON();if(i!==n)return"string"==typeof i?i:O7(i,t)}else if(Array.isArray(n))return function cwe(n,e){if(0===n.length)return"[]";if(e.length>2)return"[Array]";const t=Math.min(10,n.length),i=n.length-t,o=[];for(let r=0;r<t;++r)o.push(O7(n[r],e));return 1===i?o.push("... 1 more item"):i>1&&o.push(`... ${i} more items`),"["+o.join(", ")+"]"}(n,t);return function lwe(n,e){const t=Object.entries(n);return 0===t.length?"{}":e.length>2?"["+function uwe(n){const e=Object.prototype.toString.call(n).replace(/^\[object /,"").replace(/]$/,"");if("Object"===e&&"function"==typeof n.constructor){const t=n.constructor.name;if("string"==typeof t&&""!==t)return t}return e}(n)+"]":"{ "+t.map(([o,r])=>o+": "+O7(r,e)).join(", ")+" }"}(n,t)}(n,e);default:return String(n)}}class dwe{constructor(e,t,i){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=i}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}}class vH{constructor(e,t,i,o,r,s){this.kind=e,this.start=t,this.end=i,this.line=o,this.column=r,this.value=s,this.prev=null,this.next=null}get[Symbol.toStringTag](){return"Token"}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}}const bH={Name:[],Document:["definitions"],OperationDefinition:["description","name","variableDefinitions","directives","selectionSet"],VariableDefinition:["description","variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["description","name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","directives","locations"],SchemaExtension:["directives","operationTypes"],DirectiveExtension:["name","directives"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"],TypeCoordinate:["name"],MemberCoordinate:["name","memberName"],ArgumentCoordinate:["name","fieldName","argumentName"],DirectiveCoordinate:["name"],DirectiveArgumentCoordinate:["name","argumentName"]},hwe=new Set(Object.keys(bH));function CH(n){const e=n?.kind;return"string"==typeof e&&hwe.has(e)}var pu=function(n){return n.QUERY="query",n.MUTATION="mutation",n.SUBSCRIPTION="subscription",n}(pu||{}),pn=function(n){return n.NAME="Name",n.DOCUMENT="Document",n.OPERATION_DEFINITION="OperationDefinition",n.VARIABLE_DEFINITION="VariableDefinition",n.SELECTION_SET="SelectionSet",n.FIELD="Field",n.ARGUMENT="Argument",n.FRAGMENT_SPREAD="FragmentSpread",n.INLINE_FRAGMENT="InlineFragment",n.FRAGMENT_DEFINITION="FragmentDefinition",n.VARIABLE="Variable",n.INT="IntValue",n.FLOAT="FloatValue",n.STRING="StringValue",n.BOOLEAN="BooleanValue",n.NULL="NullValue",n.ENUM="EnumValue",n.LIST="ListValue",n.OBJECT="ObjectValue",n.OBJECT_FIELD="ObjectField",n.DIRECTIVE="Directive",n.NAMED_TYPE="NamedType",n.LIST_TYPE="ListType",n.NON_NULL_TYPE="NonNullType",n.SCHEMA_DEFINITION="SchemaDefinition",n.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",n.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",n.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",n.FIELD_DEFINITION="FieldDefinition",n.INPUT_VALUE_DEFINITION="InputValueDefinition",n.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",n.UNION_TYPE_DEFINITION="UnionTypeDefinition",n.ENUM_TYPE_DEFINITION="EnumTypeDefinition",n.ENUM_VALUE_DEFINITION="EnumValueDefinition",n.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",n.DIRECTIVE_DEFINITION="DirectiveDefinition",n.SCHEMA_EXTENSION="SchemaExtension",n.DIRECTIVE_EXTENSION="DirectiveExtension",n.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",n.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",n.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",n.UNION_TYPE_EXTENSION="UnionTypeExtension",n.ENUM_TYPE_EXTENSION="EnumTypeExtension",n.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension",n.TYPE_COORDINATE="TypeCoordinate",n.MEMBER_COORDINATE="MemberCoordinate",n.ARGUMENT_COORDINATE="ArgumentCoordinate",n.DIRECTIVE_COORDINATE="DirectiveCoordinate",n.DIRECTIVE_ARGUMENT_COORDINATE="DirectiveArgumentCoordinate",n}(pn||{});const Uh=Object.freeze({});function fu(n,e,t=bH){const i=new Map;for(const fe of Object.values(pn))i.set(fe,Xy(e,fe));let o,m,v,r=Array.isArray(n),s=[n],l=-1,d=[],f=n;const A=[],T=[];do{l++;const fe=l===s.length,Le=fe&&0!==d.length;if(fe){if(m=0===T.length?void 0:A[A.length-1],f=v,v=T.pop(),Le)if(r){f=f.slice();let Nt=0;for(const[Zt,Zn]of d){const Ri=Zt-Nt;null===Zn?(f.splice(Ri,1),Nt++):f[Ri]=Zn}}else{f={...f};for(const[Nt,Zt]of d)f[Nt]=Zt}l=o.index,s=o.keys,d=o.edits,r=o.inArray,o=o.prev}else if(v){if(m=r?l:s[l],f=v[m],null==f)continue;A.push(m)}let Ct;if(!Array.isArray(f)){var k,Z;CH(f)||k7(!1,`Invalid AST Node: ${Ky(f)}.`);const Nt=fe?null===(k=i.get(f.kind))||void 0===k?void 0:k.leave:null===(Z=i.get(f.kind))||void 0===Z?void 0:Z.enter;if(Ct=Nt?.call(e,f,m,v,A,T),Ct===Uh)break;if(!1===Ct){if(!fe){A.pop();continue}}else if(void 0!==Ct&&(d.push([m,Ct]),!fe)){if(!CH(Ct)){A.pop();continue}f=Ct}}var ee;void 0===Ct&&Le&&d.push([m,f]),fe?A.pop():(o={inArray:r,index:l,keys:s,edits:d,prev:o},r=Array.isArray(f),s=r?f:null!==(ee=t[f.kind])&&void 0!==ee?ee:[],l=-1,d=[],v&&T.push(v),v=f)}while(void 0!==o);return 0!==d.length?d[d.length-1][1]:n}function Xy(n,e){const t=n[e];return"object"==typeof t?t:"function"==typeof t?{enter:t,leave:void 0}:{enter:n.enter,leave:n.leave}}function Lf(n){try{return n()}catch{}}const qy=Lf(()=>globalThis)||Lf(()=>window)||Lf(()=>self)||Lf(()=>global)||Lf(function(){return Lf.constructor("return this")()}),Qy="4.2.8",yH=new Map;function wH(n){const e=yH.get(n)||1;return yH.set(n,e+1),`${n}:${e}:${Math.random().toString(36).slice(2)}`}const TH="Invariant Violation";class Jy extends Error{constructor(e=TH){super(e),this.name=TH,Object.setPrototypeOf(this,Jy.prototype)}}const B7=["debug","log","warn","error","silent"];let ew=B7.indexOf("silent");function bn(n,...e){if(!n)throw bl(...e)}function P7(n){return function(e,...t){if(B7.indexOf(n)>=ew){const i=console[n]||console.log;if("number"==typeof e){const o=e;(e=SH(o))||(e=EH(o,t),t=[])}i(e,...t)}}}function bl(n,...e){return new Jy(SH(n,e)||EH(n,e))}bn.debug=P7("debug"),bn.log=P7("log"),bn.warn=P7("warn"),bn.error=P7("error");const IH=Symbol.for("ApolloErrorMessageHandler_"+Qy);function tw(n){if("string"==typeof n)return n;try{return function AH(n,e=0){const t=wH("stringifyForDisplay");return JSON.stringify(n,(i,o)=>void 0===o?t:o,e).split(JSON.stringify(t)).join("<undefined>")}(n,2).slice(0,1e3)}catch{return"<non-serializable>"}}function SH(n,e=[]){if(n)return qy[IH]&&qy[IH](n,e.map(tw))}function EH(n,e=[]){if(n)return"string"==typeof n?e.reduce((t,i)=>t.replace(/%[sdfo]/,tw(i)),n):`An error occurred! For more details, see the full error text at https://go.apollo.dev/c/err#${encodeURIComponent(JSON.stringify({version:Qy,message:n,args:e.map(tw)}))}`}const _d={...qy[Symbol.for("apollo.cacheSize")]},pwe=()=>Object.create(null),{forEach:fwe,slice:xH}=Array.prototype,{hasOwnProperty:gwe}=Object.prototype;class gu{constructor(e=!0,t=pwe){this.weakness=e,this.makeData=t}lookup(){return this.lookupArray(arguments)}lookupArray(e){let t=this;return fwe.call(e,i=>t=t.getChildTrie(i)),gwe.call(t,"data")?t.data:t.data=this.makeData(xH.call(e))}peek(){return this.peekArray(arguments)}peekArray(e){let t=this;for(let i=0,o=e.length;t&&i<o;++i){const r=t.mapFor(e[i],!1);t=r&&r.get(e[i])}return t&&t.data}remove(){return this.removeArray(arguments)}removeArray(e){let t;if(e.length){const i=e[0],o=this.mapFor(i,!1),r=o&&o.get(i);r&&(t=r.removeArray(xH.call(e,1)),!r.data&&!r.weak&&(!r.strong||!r.strong.size)&&o.delete(i))}else t=this.data,delete this.data;return t}getChildTrie(e){const t=this.mapFor(e,!0);let i=t.get(e);return i||t.set(e,i=new gu(this.weakness,this.makeData)),i}mapFor(e,t){return this.weakness&&function mwe(n){switch(typeof n){case"object":if(null===n)break;case"function":return!0}return!1}(e)?this.weak||(t?this.weak=new WeakMap:void 0):this.strong||(t?this.strong=new Map:void 0)}}function nw(){}const vwe=nw,bwe=typeof WeakRef<"u"?WeakRef:function(n){return{deref:()=>n}},Cwe=typeof WeakMap<"u"?WeakMap:Map,ywe=typeof FinalizationRegistry<"u"?FinalizationRegistry:function(){return{register:nw,unregister:nw}};class F7{constructor(e=1/0,t=vwe){this.max=e,this.dispose=t,this.map=new Cwe,this.newest=null,this.oldest=null,this.unfinalizedNodes=new Set,this.finalizationScheduled=!1,this.size=0,this.finalize=()=>{const i=this.unfinalizedNodes.values();for(let o=0;o<10024;o++){const r=i.next().value;if(!r)break;this.unfinalizedNodes.delete(r);const s=r.key;delete r.key,r.keyRef=new bwe(s),this.registry.register(s,r,r)}this.unfinalizedNodes.size>0?queueMicrotask(this.finalize):this.finalizationScheduled=!1},this.registry=new ywe(this.deleteNode.bind(this))}has(e){return this.map.has(e)}get(e){const t=this.getNode(e);return t&&t.value}getNode(e){const t=this.map.get(e);if(t&&t!==this.newest){const{older:i,newer:o}=t;o&&(o.older=i),i&&(i.newer=o),t.older=this.newest,t.older.newer=t,t.newer=null,this.newest=t,t===this.oldest&&(this.oldest=o)}return t}set(e,t){let i=this.getNode(e);return i?i.value=t:(i={key:e,value:t,newer:null,older:this.newest},this.newest&&(this.newest.newer=i),this.newest=i,this.oldest=this.oldest||i,this.scheduleFinalization(i),this.map.set(e,i),this.size++,i.value)}clean(){for(;this.oldest&&this.size>this.max;)this.deleteNode(this.oldest)}deleteNode(e){e===this.newest&&(this.newest=e.older),e===this.oldest&&(this.oldest=e.newer),e.newer&&(e.newer.older=e.older),e.older&&(e.older.newer=e.newer),this.size--;const t=e.key||e.keyRef&&e.keyRef.deref();this.dispose(e.value,t),e.keyRef?this.registry.unregister(e):this.unfinalizedNodes.delete(e),t&&this.map.delete(t)}delete(e){const t=this.map.get(e);return!!t&&(this.deleteNode(t),!0)}scheduleFinalization(e){this.unfinalizedNodes.add(e),this.finalizationScheduled||(this.finalizationScheduled=!0,queueMicrotask(this.finalize))}}function Awe(){}class iw{constructor(e=1/0,t=Awe){this.max=e,this.dispose=t,this.map=new Map,this.newest=null,this.oldest=null}has(e){return this.map.has(e)}get(e){const t=this.getNode(e);return t&&t.value}get size(){return this.map.size}getNode(e){const t=this.map.get(e);if(t&&t!==this.newest){const{older:i,newer:o}=t;o&&(o.older=i),i&&(i.newer=o),t.older=this.newest,t.older.newer=t,t.newer=null,this.newest=t,t===this.oldest&&(this.oldest=o)}return t}set(e,t){let i=this.getNode(e);return i?i.value=t:(i={key:e,value:t,newer:null,older:this.newest},this.newest&&(this.newest.newer=i),this.newest=i,this.oldest=this.oldest||i,this.map.set(e,i),i.value)}clean(){for(;this.oldest&&this.map.size>this.max;)this.delete(this.oldest.key)}delete(e){const t=this.map.get(e);return!!t&&(t===this.newest&&(this.newest=t.older),t===this.oldest&&(this.oldest=t.newer),t.newer&&(t.newer.older=t.older),t.older&&(t.older.newer=t.newer),this.map.delete(e),this.dispose(t.value,e),!0)}}const ow=new WeakSet;function DH(n){n.size<=(n.max||-1)||ow.has(n)||(ow.add(n),setTimeout(()=>{n.clean(),ow.delete(n)},100))}const rw=function(n,e){const t=new F7(n,e);return t.set=function(i,o){const r=F7.prototype.set.call(this,i,o);return DH(this),r},t},Twe=function(n,e){const t=new iw(n,e);return t.set=function(i,o){const r=iw.prototype.set.call(this,i,o);return DH(this),r},t};function NH(n,{max:e,makeCacheKey:t=i=>i}){const i=new gu(!0),o=new rw(e);return(...r)=>{const s=i.lookupArray(t(r)),l=o.get(s);if(l){if(l.error)throw l.error;return l.result}const d=o.set(s,{});try{return d.result=n(...r)}catch(f){throw d.error=f,f}}}const zh=NH((n,e)=>{bn(n&&"Document"===n.kind,1);const t=n.definitions.filter(i=>"OperationDefinition"===i.kind);e&&bn(1==t.length&&t[0].operation===e,4,e,e,t[0].operation),fu(n,{Field(i,o,r,s){if(i.alias&&("__typename"===i.alias.value||i.alias.value.startsWith("__ac_"))&&i.alias.value!==i.name.value){let l=n,d=[];for(const f of s)l=l[f],l.kind===pn.FIELD&&d.push(l.alias?.value||l.name.value);throw d.splice(-1,1,i.name.value),bl(5,i.alias.value,d.join("."),t[0].operation,vl(n,"(anonymous)"))}}})},{max:_d.checkDocument||2e3});function pd(n){return zh(n),n.definitions.filter(e=>"OperationDefinition"===e.kind)[0]}class Ks{static empty(){return new Ks(()=>hd)}static from(e){if(0===e.length)return Ks.empty();const[t,...i]=e;return t.concat(...i)}static split(e,t,i=new Ks((o,r)=>r(o))){const o=new Ks((r,s)=>e(r)?t.request(r,s):i.request(r,s));return Object.assign(o,{left:t,right:i})}static execute(e,t,i){return e.request(function Iwe(n,{client:e}){const t={query:n.query,variables:n.variables||{},extensions:n.extensions||{},operationName:vl(n.query),operationType:pd(n.query).operation};let i={...n.context};const r=()=>Object.freeze({...i});return Object.defineProperty(t,"setContext",{enumerable:!1,value:s=>{i="function"==typeof s?{...i,...s(r())}:{...i,...s}}}),Object.defineProperty(t,"getContext",{enumerable:!1,value:r}),Object.defineProperty(t,"client",{enumerable:!1,value:e}),t}(t,i),()=>hd)}static concat(...e){return Ks.from(e)}constructor(e){e&&(this.request=e)}split(e,t,i){return this.concat(Ks.split(e,t,i))}concat(...e){return 0===e.length?this:e.reduce(this.combine.bind(this),this)}combine(e,t){const i=new Ks((o,r)=>e.request(o,s=>t.request(s,r)));return Object.assign(i,{left:e,right:t})}request(e,t){throw bl(65)}left;right}const Swe=Ks.split,{toString:LH,hasOwnProperty:Ewe}=Object.prototype,MH=Function.prototype.toString,sw=new Map;function sr(n,e){try{return aw(n,e)}finally{sw.clear()}}function aw(n,e){if(n===e)return!0;const t=LH.call(n);if(t!==LH.call(e))return!1;switch(t){case"[object Array]":if(n.length!==e.length)return!1;case"[object Object]":{if(kH(n,e))return!0;const o=RH(n),r=RH(e),s=o.length;if(s!==r.length)return!1;for(let l=0;l<s;++l)if(!Ewe.call(e,o[l]))return!1;for(let l=0;l<s;++l){const d=o[l];if(!aw(n[d],e[d]))return!1}return!0}case"[object Error]":return n.name===e.name&&n.message===e.message;case"[object Number]":if(n!=n)return e!=e;case"[object Boolean]":case"[object Date]":return+n==+e;case"[object RegExp]":case"[object String]":return n==`${e}`;case"[object Map]":case"[object Set]":{if(n.size!==e.size)return!1;if(kH(n,e))return!0;const o=n.entries(),r="[object Map]"===t;for(;;){const s=o.next();if(s.done)break;const[l,d]=s.value;if(!e.has(l)||r&&!aw(d,e.get(l)))return!1}return!0}case"[object Uint16Array]":case"[object Uint8Array]":case"[object Uint32Array]":case"[object Int32Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object ArrayBuffer]":n=new Uint8Array(n),e=new Uint8Array(e);case"[object DataView]":{let o=n.byteLength;if(o===e.byteLength)for(;o--&&n[o]===e[o];);return-1===o}case"[object AsyncFunction]":case"[object GeneratorFunction]":case"[object AsyncGeneratorFunction]":case"[object Function]":{const o=MH.call(n);return o===MH.call(e)&&!function Nwe(n,e){const t=n.length-e.length;return t>=0&&n.indexOf(e,t)===t}(o,Dwe)}}return!1}function RH(n){return Object.keys(n).filter(xwe,n)}function xwe(n){return void 0!==this[n]}const Dwe="{ [native code] }";function kH(n,e){let t=sw.get(n);if(t){if(t.has(e))return!0}else sw.set(n,t=new Set);return t.add(e),!1}let Rs=null;const OH={};let Lwe=1;function BH(n){try{return n()}catch{}}const lw="@wry/context:Slot",PH=BH(()=>globalThis)||BH(()=>global)||Object.create(null),H7=PH[lw]||Array[lw]||function(n){try{Object.defineProperty(PH,lw,{value:n,enumerable:!1,writable:!1,configurable:!0})}finally{return n}}(class{constructor(){this.id=["slot",Lwe++,Date.now(),Math.random().toString(36).slice(2)].join(":")}hasValue(){for(let e=Rs;e;e=e.parent)if(this.id in e.slots){const t=e.slots[this.id];if(t===OH)break;return e!==Rs&&(Rs.slots[this.id]=t),!0}return Rs&&(Rs.slots[this.id]=OH),!1}getValue(){if(this.hasValue())return Rs.slots[this.id]}withValue(e,t,i,o){const s=Rs;Rs={parent:s,slots:{__proto__:null,[this.id]:e}};try{return t.apply(o,i)}finally{Rs=s}}static bind(e){const t=Rs;return function(){const i=Rs;try{return Rs=t,e.apply(this,arguments)}finally{Rs=i}}}static noContext(e,t,i){if(!Rs)return e.apply(i,t);{const o=Rs;try{return Rs=null,e.apply(i,t)}finally{Rs=o}}}}),L5=new H7,{hasOwnProperty:Owe}=Object.prototype,uw=Array.from||function(n){const e=[];return n.forEach(t=>e.push(t)),e};function U7(n){const{unsubscribe:e}=n;"function"==typeof e&&(n.unsubscribe=void 0,e())}const M5=[];function Mf(n,e){if(!n)throw new Error(e||"assertion failure")}function HH(n,e){const t=n.length;return t>0&&t===e.length&&n[t-1]===e[t-1]}function UH(n){switch(n.length){case 0:throw new Error("unknown value");case 1:return n[0];case 2:throw n[1]}}function zH(n){return n.slice(0)}let Pwe=(()=>{class n{constructor(t){this.fn=t,this.parents=new Set,this.childValues=new Map,this.dirtyChildren=null,this.dirty=!0,this.recomputing=!1,this.value=[],this.deps=null,++n.count}peek(){if(1===this.value.length&&!Vh(this))return VH(this),this.value[0]}recompute(t){return Mf(!this.recomputing,"already recomputing"),VH(this),Vh(this)?function Fwe(n,e){return YH(n),L5.withValue(n,Hwe,[n,e]),function zwe(n,e){if("function"==typeof n.subscribe)try{U7(n),n.unsubscribe=n.subscribe.apply(null,e)}catch{return n.setDirty(),!1}return!0}(n,e)&&function Uwe(n){n.dirty=!1,!Vh(n)&&GH(n)}(n),UH(n.value)}(this,t):UH(this.value)}setDirty(){this.dirty||(this.dirty=!0,jH(this),U7(this))}dispose(){this.setDirty(),YH(this),dw(this,(t,i)=>{t.setDirty(),KH(t,this)})}forget(){this.dispose()}dependOn(t){t.add(this),this.deps||(this.deps=M5.pop()||new Set),this.deps.add(t)}forgetDeps(){this.deps&&(uw(this.deps).forEach(t=>t.delete(this)),this.deps.clear(),M5.push(this.deps),this.deps=null)}}return n.count=0,n})();function VH(n){const e=L5.getValue();if(e)return n.parents.add(e),e.childValues.has(n)||e.childValues.set(n,[]),Vh(n)?WH(e,n):$H(e,n),e}function Hwe(n,e){n.recomputing=!0;const{normalizeResult:t}=n;let i;t&&1===n.value.length&&(i=zH(n.value)),n.value.length=0;try{if(n.value[0]=n.fn.apply(null,e),t&&i&&!HH(i,n.value))try{n.value[0]=t(n.value[0],i[0])}catch{}}catch(o){n.value[1]=o}n.recomputing=!1}function Vh(n){return n.dirty||!(!n.dirtyChildren||!n.dirtyChildren.size)}function jH(n){dw(n,WH)}function GH(n){dw(n,$H)}function dw(n,e){const t=n.parents.size;if(t){const i=uw(n.parents);for(let o=0;o<t;++o)e(i[o],n)}}function WH(n,e){Mf(n.childValues.has(e)),Mf(Vh(e));const t=!Vh(n);if(n.dirtyChildren){if(n.dirtyChildren.has(e))return}else n.dirtyChildren=M5.pop()||new Set;n.dirtyChildren.add(e),t&&jH(n)}function $H(n,e){Mf(n.childValues.has(e)),Mf(!Vh(e));const t=n.childValues.get(e);0===t.length?n.childValues.set(e,zH(e.value)):HH(t,e.value)||n.setDirty(),ZH(n,e),!Vh(n)&&GH(n)}function ZH(n,e){const t=n.dirtyChildren;t&&(t.delete(e),0===t.size&&(M5.length<100&&M5.push(t),n.dirtyChildren=null))}function YH(n){n.childValues.size>0&&n.childValues.forEach((e,t)=>{KH(n,t)}),n.forgetDeps(),Mf(null===n.dirtyChildren)}function KH(n,e){e.parents.delete(n),n.childValues.delete(e),ZH(n,e)}const Vwe={setDirty:!0,dispose:!0,forget:!0};function XH(n){const e=new Map,t=n&&n.subscribe;function i(o){const r=L5.getValue();if(r){let s=e.get(o);s||e.set(o,s=new Set),r.dependOn(s),"function"==typeof t&&(U7(s),s.unsubscribe=t(o))}}return i.dirty=function(r,s){const l=e.get(r);if(l){const d=s&&Owe.call(Vwe,s)?s:"setDirty";uw(l).forEach(f=>f[d]()),e.delete(r),U7(l)}},i}let qH;function QH(...n){return(qH||(qH=new gu("function"==typeof WeakMap))).lookupArray(n)}const hw=new Set;function R5(n,{max:e=Math.pow(2,16),keyArgs:t,makeCacheKey:i=QH,normalizeResult:o,subscribe:r,cache:s=iw}=Object.create(null)){const l="function"==typeof s?new s(e,A=>A.dispose()):s,d=function(){const A=i.apply(null,t?t.apply(null,arguments):arguments);if(void 0===A)return n.apply(null,arguments);let T=l.get(A);T||(l.set(A,T=new Pwe(n)),T.normalizeResult=o,T.subscribe=r,T.forget=()=>l.delete(A));const k=T.recompute(Array.prototype.slice.call(arguments));return l.set(A,T),hw.add(l),L5.hasValue()||(hw.forEach(Z=>Z.clean()),hw.clear()),k};function f(A){const T=A&&l.get(A);T&&T.setDirty()}function m(A){const T=A&&l.get(A);if(T)return T.peek()}function v(A){return!!A&&l.delete(A)}return Object.defineProperty(d,"size",{get:()=>l.size,configurable:!1,enumerable:!1}),Object.freeze(d.options={max:e,keyArgs:t,makeCacheKey:i,normalizeResult:o,subscribe:r,cache:l}),d.dirtyKey=f,d.dirty=function(){f(i.apply(null,arguments))},d.peekKey=m,d.peek=function(){return m(i.apply(null,arguments))},d.forgetKey=v,d.forget=function(){return v(i.apply(null,arguments))},d.makeCacheKey=i,d.getKey=t?function(){return i.apply(null,t.apply(null,arguments))}:i,Object.freeze(d)}function jwe(n){return n}class fd{transform;cached;resultCache=new WeakSet;getCacheKey(e){return[e]}static identity(){return new fd(jwe,{cache:!1})}static split(e,t,i=fd.identity()){return Object.assign(new fd(o=>(e(o)?t:i).transformDocument(o),{cache:!1}),{left:t,right:i})}constructor(e,t={}){this.transform=e,t.getCacheKey&&(this.getCacheKey=t.getCacheKey),this.cached=!1!==t.cache,this.resetCache()}resetCache(){if(this.cached){const e=new gu;this.performWork=R5(fd.prototype.performWork.bind(this),{makeCacheKey:t=>{const i=this.getCacheKey(t);if(i)return bn(Array.isArray(i),20),e.lookupArray(i)},max:_d["documentTransform.cache"],cache:F7})}}performWork(e){return zh(e),this.transform(e)}transformDocument(e){if(this.resultCache.has(e))return e;const t=this.performWork(e);return this.resultCache.add(t),t}concat(e){return Object.assign(new fd(t=>e.transformDocument(this.transformDocument(t)),{cache:!1}),{left:this,right:e})}left;right}const JH={kind:pn.FIELD,name:{kind:pn.NAME,value:"__typename"}},_w=Object.assign(function(n){return fu(n,{SelectionSet:{enter(e,t,i){if(i&&i.kind===pn.OPERATION_DEFINITION)return;const{selections:o}=e;return o&&!o.some(l=>l.kind===pn.FIELD&&("__typename"===l.name.value||0===l.name.value.lastIndexOf("__",0)))?i.kind===pn.FIELD&&i.directives&&i.directives.some(l=>"export"===l.name.value)?void 0:{...e,selections:[...o,JH]}:void 0}}})},{added:n=>n===JH}),gd=Object.assign(function(e){return JSON.stringify(e,Kwe)},{reset(){Rf=new Twe(_d.canonicalStringify||1e3)}});let Rf;function Kwe(n,e){if(e&&"object"==typeof e){const t=Object.getPrototypeOf(e);if(t===Object.prototype||null===t){const i=Object.keys(e);if(i.every(Xwe))return e;const o=JSON.stringify(i);let r=Rf.get(o);if(!r){i.sort();const l=JSON.stringify(i);r=Rf.get(l)||i,Rf.set(o,r),Rf.set(l,r)}const s=Object.create(t);return r.forEach(l=>{s[l]=e[l]}),s}}return e}function Xwe(n,e,t){return 0===e||t[e-1]<=n}function mw(n){return 9===n||32===n}function k5(n){return n>=48&&n<=57}function iU(n){return n>=97&&n<=122||n>=65&&n<=90}function oU(n){return iU(n)||95===n}function qwe(n){return iU(n)||k5(n)||95===n}function Qwe(n){var e;let t=Number.MAX_SAFE_INTEGER,i=null,o=-1;for(let s=0;s<n.length;++s){var r;const l=n[s],d=Jwe(l);d!==l.length&&(i=null!==(r=i)&&void 0!==r?r:s,o=s,0!==s&&d<t&&(t=d))}return n.map((s,l)=>0===l?s:s.slice(t)).slice(null!==(e=i)&&void 0!==e?e:0,o+1)}function Jwe(n){let e=0;for(;e<n.length&&mw(n.charCodeAt(e));)++e;return e}gd.reset();const nAe=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function iAe(n){return oAe[n.charCodeAt(0)]}const oAe=["\\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 z7(n){return fu(n,sAe)}const sAe={Name:{leave:n=>n.value},Variable:{leave:n=>"$"+n.name},Document:{leave:n=>En(n.definitions,"\n\n")},OperationDefinition:{leave(n){const e=vw(n.variableDefinitions)?Si("(\n",En(n.variableDefinitions,"\n"),"\n)"):Si("(",En(n.variableDefinitions,", "),")"),t=Si("",n.description,"\n")+En([n.operation,En([n.name,e]),En(n.directives," ")]," ");return("query"===t?"":t+" ")+n.selectionSet}},VariableDefinition:{leave:({variable:n,type:e,defaultValue:t,directives:i,description:o})=>Si("",o,"\n")+n+": "+e+Si(" = ",t)+Si(" ",En(i," "))},SelectionSet:{leave:({selections:n})=>Tc(n)},Field:{leave({alias:n,name:e,arguments:t,directives:i,selectionSet:o}){const r=Si("",n,": ")+e;let s=r+Si("(",En(t,", "),")");return s.length>80&&(s=r+Si("(\n",V7(En(t,"\n")),"\n)")),En([s,En(i," "),o]," ")}},Argument:{leave:({name:n,value:e})=>n+": "+e},FragmentSpread:{leave:({name:n,directives:e})=>"..."+n+Si(" ",En(e," "))},InlineFragment:{leave:({typeCondition:n,directives:e,selectionSet:t})=>En(["...",Si("on ",n),En(e," "),t]," ")},FragmentDefinition:{leave:({name:n,typeCondition:e,variableDefinitions:t,directives:i,selectionSet:o,description:r})=>Si("",r,"\n")+`fragment ${n}${Si("(",En(t,", "),")")} on ${e} ${Si("",En(i," ")," ")}`+o},IntValue:{leave:({value:n})=>n},FloatValue:{leave:({value:n})=>n},StringValue:{leave:({value:n,block:e})=>e?function eAe(n,e){const t=n.replace(/"""/g,'\\"""'),i=t.split(/\r\n|[\n\r]/g),o=1===i.length,r=i.length>1&&i.slice(1).every(T=>0===T.length||mw(T.charCodeAt(0))),s=t.endsWith('\\"""'),l=n.endsWith('"')&&!s,d=n.endsWith("\\"),f=l||d,m=!(null!=e&&e.minimize)&&(!o||n.length>70||f||r||s);let v="";const A=o&&mw(n.charCodeAt(0));return(m&&!A||r)&&(v+="\n"),v+=t,(m||f)&&(v+="\n"),'"""'+v+'"""'}(n):function tAe(n){return`"${n.replace(nAe,iAe)}"`}(n)},BooleanValue:{leave:({value:n})=>n?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:n})=>n},ListValue:{leave:({values:n})=>"["+En(n,", ")+"]"},ObjectValue:{leave:({fields:n})=>"{"+En(n,", ")+"}"},ObjectField:{leave:({name:n,value:e})=>n+": "+e},Directive:{leave:({name:n,arguments:e})=>"@"+n+Si("(",En(e,", "),")")},NamedType:{leave:({name:n})=>n},ListType:{leave:({type:n})=>"["+n+"]"},NonNullType:{leave:({type:n})=>n+"!"},SchemaDefinition:{leave:({description:n,directives:e,operationTypes:t})=>Si("",n,"\n")+En(["schema",En(e," "),Tc(t)]," ")},OperationTypeDefinition:{leave:({operation:n,type:e})=>n+": "+e},ScalarTypeDefinition:{leave:({description:n,name:e,directives:t})=>Si("",n,"\n")+En(["scalar",e,En(t," ")]," ")},ObjectTypeDefinition:{leave:({description:n,name:e,interfaces:t,directives:i,fields:o})=>Si("",n,"\n")+En(["type",e,Si("implements ",En(t," & ")),En(i," "),Tc(o)]," ")},FieldDefinition:{leave:({description:n,name:e,arguments:t,type:i,directives:o})=>Si("",n,"\n")+e+(vw(t)?Si("(\n",V7(En(t,"\n")),"\n)"):Si("(",En(t,", "),")"))+": "+i+Si(" ",En(o," "))},InputValueDefinition:{leave:({description:n,name:e,type:t,defaultValue:i,directives:o})=>Si("",n,"\n")+En([e+": "+t,Si("= ",i),En(o," ")]," ")},InterfaceTypeDefinition:{leave:({description:n,name:e,interfaces:t,directives:i,fields:o})=>Si("",n,"\n")+En(["interface",e,Si("implements ",En(t," & ")),En(i," "),Tc(o)]," ")},UnionTypeDefinition:{leave:({description:n,name:e,directives:t,types:i})=>Si("",n,"\n")+En(["union",e,En(t," "),Si("= ",En(i," | "))]," ")},EnumTypeDefinition:{leave:({description:n,name:e,directives:t,values:i})=>Si("",n,"\n")+En(["enum",e,En(t," "),Tc(i)]," ")},EnumValueDefinition:{leave:({description:n,name:e,directives:t})=>Si("",n,"\n")+En([e,En(t," ")]," ")},InputObjectTypeDefinition:{leave:({description:n,name:e,directives:t,fields:i})=>Si("",n,"\n")+En(["input",e,En(t," "),Tc(i)]," ")},DirectiveDefinition:{leave:({description:n,name:e,arguments:t,directives:i,repeatable:o,locations:r})=>Si("",n,"\n")+"directive @"+e+(vw(t)?Si("(\n",V7(En(t,"\n")),"\n)"):Si("(",En(t,", "),")"))+Si(" ",En(i," "))+(o?" repeatable":"")+" on "+En(r," | ")},SchemaExtension:{leave:({directives:n,operationTypes:e})=>En(["extend schema",En(n," "),Tc(e)]," ")},ScalarTypeExtension:{leave:({name:n,directives:e})=>En(["extend scalar",n,En(e," ")]," ")},ObjectTypeExtension:{leave:({name:n,interfaces:e,directives:t,fields:i})=>En(["extend type",n,Si("implements ",En(e," & ")),En(t," "),Tc(i)]," ")},InterfaceTypeExtension:{leave:({name:n,interfaces:e,directives:t,fields:i})=>En(["extend interface",n,Si("implements ",En(e," & ")),En(t," "),Tc(i)]," ")},UnionTypeExtension:{leave:({name:n,directives:e,types:t})=>En(["extend union",n,En(e," "),Si("= ",En(t," | "))]," ")},EnumTypeExtension:{leave:({name:n,directives:e,values:t})=>En(["extend enum",n,En(e," "),Tc(t)]," ")},InputObjectTypeExtension:{leave:({name:n,directives:e,fields:t})=>En(["extend input",n,En(e," "),Tc(t)]," ")},DirectiveExtension:{leave:({name:n,directives:e})=>En(["extend directive @"+n,En(e," ")]," ")},TypeCoordinate:{leave:({name:n})=>n},MemberCoordinate:{leave:({name:n,memberName:e})=>En([n,Si(".",e)])},ArgumentCoordinate:{leave:({name:n,fieldName:e,argumentName:t})=>En([n,Si(".",e),Si("(",t,":)")])},DirectiveCoordinate:{leave:({name:n})=>En(["@",n])},DirectiveArgumentCoordinate:{leave:({name:n,argumentName:e})=>En(["@",n,Si("(",e,":)")])}};function En(n,e=""){var t;return null!==(t=n?.filter(i=>i).join(e))&&void 0!==t?t:""}function Tc(n){return Si("{\n",V7(En(n,"\n")),"\n}")}function Si(n,e,t=""){return null!=e&&""!==e?n+e+t:""}function V7(n){return Si(" ",n.replace(/\n/g,"\n "))}function vw(n){var e;return null!==(e=n?.some(t=>t.includes("\n")))&&void 0!==e&&e}let O5;const B5=Object.assign(n=>{let e=O5.get(n);return e||(e=z7(n),O5.set(n,e)),e},{reset(){O5=new rw(_d.print||2e3)}});function Ro(n){return!(!n||"object"!=typeof n||"string"!=typeof n.__ref)}function P5(n={}){const{connector:e=()=>new Wn,resetOnError:t=!0,resetOnComplete:i=!0,resetOnRefCountZero:o=!0}=n;return r=>{let s,l,d,f=0,m=!1,v=!1;const A=()=>{l?.unsubscribe(),l=void 0},T=()=>{A(),s=d=void 0,m=v=!1},k=()=>{const Z=s;T(),Z?.unsubscribe()};return ia((Z,ee)=>{f++,!v&&!m&&A();const fe=d=d??e();ee.add(()=>{f--,0===f&&!v&&!m&&(l=Cw(k,o))}),fe.subscribe(ee),!s&&f>0&&(s=new vt({next:Le=>fe.next(Le),error:Le=>{v=!0,A(),l=Cw(T,t,Le),fe.error(Le)},complete:()=>{m=!0,A(),l=Cw(T,i),fe.complete()}}),hl(Z).subscribe(s))})(r)}}function Cw(n,e,...t){if(!0===e)return void n();if(!1===e)return;const i=new vt({next:()=>{i.unsubscribe(),n()}});return hl(e(...t)).subscribe(i)}function j7(n,e,t){let i,o=!1;return n&&"object"==typeof n?({bufferSize:i=1/0,windowTime:e=1/0,refCount:o=!1,scheduler:t}=n):i=n??1/0,P5({connector:()=>new $3(i,e,t),resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:o})}B5.reset();const sU=NH(function(e,t,i){return function hAe(n,e){let t,i;function o(r){return r!==t&&(t=r,i=e(t)),i}return Object.assign(n.pipe(mo(o),j7({bufferSize:1,refCount:!0})),{getCurrentResult:()=>o(n.getCurrentResult())})}(e,i)},{max:1,makeCacheKey:n=>n.slice(0,2)});function F5(n=[]){const e={};return n.forEach(t=>{e[t.name.value]=t}),e}function H5(n){return n.definitions.filter(e=>"FragmentDefinition"===e.kind)}function G7(n,e){switch(n.kind){case"InlineFragment":return n;case"FragmentSpread":{const t=n.name.value;if("function"==typeof e)return e(t);const i=e&&e[t];return bn(i,9,t),i||null}default:return null}}function yw(n){let e;zh(n);for(let t of n.definitions){if("OperationDefinition"===t.kind)return t;"FragmentDefinition"===t.kind&&!e&&(e=t)}if(e)return e;throw bl(12)}function U5(n){return"Field"===n.kind}function v1(n){return n.alias?n.alias.value:n.name.value}function W7({directives:n},e){return!n||!n.length||function fAe(n){const e=[];return n&&n.length&&n.forEach(t=>{if(!function pAe({name:{value:n}}){return"skip"===n||"include"===n}(t))return;const i=t.arguments,o=t.name.value;bn(i&&1===i.length,16,o);const r=i[0];bn(r.name&&"if"===r.name.value,17,o);const s=r.value;bn(s&&("Variable"===s.kind||"BooleanValue"===s.kind),18,o),e.push({directive:t,ifArgument:r})}),e}(n).every(({directive:t,ifArgument:i})=>{let o=!1;return"Variable"===i.value.kind?(o=e&&e[i.value.name.value],bn(void 0!==o,15,t.name.value)):o=i.value.value,"skip"===t.name.value?!o:o})}function aU(n,{data:e,...t},{data:i,...o},r){return sr(t,o)&&$7(yw(n).selectionSet,e,i,{fragmentMap:F5(H5(n)),variables:r})}function $7(n,e,t,i){if(e===t)return!0;const o=new Set;return n.selections.every(r=>{if(o.has(r)||(o.add(r),!W7(r,i.variables))||lU(r))return!0;if(U5(r)){const s=v1(r),l=e&&e[s],d=t&&t[s],f=r.selectionSet;if(!f)return sr(l,d);const m=Array.isArray(l),v=Array.isArray(d);if(m!==v)return!1;if(m&&v){const A=l.length;if(d.length!==A)return!1;for(let T=0;T<A;++T)if(!$7(f,l[T],d[T],i))return!1;return!0}return $7(f,l,d,i)}{const s=G7(r,i.fragmentMap);if(s)return!!lU(s)||$7(s.selectionSet,e,t,i)}})}function lU(n){return!!n.directives&&n.directives.some(gAe)}function gAe(n){return"nonreactive"===n.name.value}function mAe(n,e){let t=e;const i=[];return n.definitions.forEach(r=>{if("OperationDefinition"===r.kind)throw bl(10,r.operation,r.name?` named '${r.name.value}'`:"");"FragmentDefinition"===r.kind&&i.push(r)}),typeof t>"u"&&(bn(1===i.length,11,i.length),t=i[0].name.value),{...n,definitions:[{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:t}}]}},...n.definitions]}}function vAe(...n){return QH.bind(null,...n)}class cU{assumeImmutableResults=!1;lookupFragment(e){return null}batch(e){let i;return this.performTransaction(()=>i=e.update(this),"string"==typeof e.optimistic?e.optimistic:!1===e.optimistic?null:void 0),i}recordOptimisticTransaction(e,t){this.performTransaction(e,t)}transformDocument(e){return e}transformForLink(e){return e}identify(e){}gc(){return[]}modify(e){return!1}readQuery(e,t=!!e.optimistic){return this.read({...e,rootId:e.id||"ROOT_QUERY",optimistic:t})}fragmentWatches=new gu(!0);watchFragment(e){const{fragment:t,fragmentName:i,from:o}=e,r=this.getFragmentDoc(t,i),l=(Array.isArray(o)?o:[o]).map(T=>null==T?T:this.toCacheId(T));if(!Array.isArray(o)){const T=this.watchSingleFragment(l[0],r,e);return null===o?T:sU(T,Symbol.for("apollo.transform.individualResult"),k=>({...k,data:k.data??{}}))}let d;function f(T){const k=T.reduce((Z,ee,fe)=>(Z.data.push(ee.data),Z.complete&&=ee.complete,Z.dataState=Z.complete?"complete":"partial",ee.missing&&(Z.missing||={},Z.missing[fe]=ee.missing),Z),{data:[],dataState:"complete",complete:!0});return sr(d,k)||(d=k),d}if(0===l.length)return CAe;let m=!1;const v=l.map(T=>this.watchSingleFragment(T,r,e)),A=function _Ae(n){return 0===n.length?hd:new wn(e=>{const{length:t}=n,i=new Array(t),o=new Map;n.forEach((d,f)=>{o.has(d)||o.set(d,new Set),o.get(d).add(f)});let l,r=o.size,s=o.size;o.forEach((d,f)=>{let m=!1;const v=f.subscribe({next:A=>{d.forEach(T=>i[T]=A),m||(m=!0,s--),s||(l||=new Set(n.filter(T=>T.dirty)),l.delete(f),l.size||(e.next(i.slice()),l=void 0))},complete:()=>{r--,r||e.complete()},error:e.error.bind(e)});e.add(v)})})}(v).pipe(mo(f),u1({subscribe:()=>m=!0,unsubscribe:()=>m=!1}),j7({bufferSize:1,refCount:!0}));return Object.assign(A,{getCurrentResult:()=>m&&d?d:f(v.map(k=>k.getCurrentResult()))})}onAfterBroadcast=e=>e();watchSingleFragment(e,t,i){if(null===e)return bAe;const{optimistic:o=!0,variables:r}=i,s=[t,gd({id:e,optimistic:o,variables:r})],l=this.fragmentWatches.lookupArray(s);if(!l.observable){let f,m=function(A){const T=A.result;return(!f||!aU(t,{data:f.data},{data:T},i.variables))&&(f={data:T,dataState:A.complete?"complete":"partial",complete:A.complete},A.missing&&(f.missing=A.missing.missing)),f},d=!1;const v=new wn(A=>{d=!0;const T=this.watch({variables:r,returnPartialData:!0,id:e,query:t,optimistic:o,immediate:!0,callback:k=>{v.dirty=!0,this.onAfterBroadcast(()=>{A.next(m(k)),v.dirty=!1})}});return()=>{d=!1,T(),this.fragmentWatches.removeArray(s)}}).pipe(jB(),P5({connector:()=>new $3(1),resetOnRefCountZero:()=>function dAe(n=0,e,t=_ve){let i=-1;return null!=e&&(TO(e)?t=e:i=e),new wn(o=>{let r=function uAe(n){return n instanceof Date&&!isNaN(n)}(n)?+n-t.now():n;r<0&&(r=0);let s=0;return t.schedule(function(){o.closed||(o.next(s++),0<=i?this.schedule(void 0,i):o.complete())},r)})}(0)}));l.observable=Object.assign(v,{dirty:!1,getCurrentResult:()=>d&&f?f:m(this.diff({id:e,query:t,returnPartialData:!0,optimistic:o,variables:r}))})}return l.observable}getFragmentDoc=R5(mAe,{max:_d["cache.fragmentQueryDocuments"]||1e3,cache:F7,makeCacheKey:vAe(this)});readFragment(e,t=!!e.optimistic){const i=void 0!==e.from?this.toCacheId(e.from):e.id;return this.read({...e,query:this.getFragmentDoc(e.fragment,e.fragmentName),rootId:i,optimistic:t})}writeQuery({id:e,data:t,...i}){return this.write(Object.assign(i,{dataId:e||"ROOT_QUERY",result:t}))}writeFragment({data:e,fragment:t,fragmentName:i,...o}){const r=void 0!==o.from?this.toCacheId(o.from):o.id;return this.write(Object.assign(o,{query:this.getFragmentDoc(t,i),dataId:r,result:e}))}updateQuery(e,t){return this.batch({update(i){const o=i.readQuery(e),r=t(o);return null==r?o:(i.writeQuery({...e,data:r}),r)}})}updateFragment(e,t){return this.batch({update(i){const o=i.readFragment(e),r=t(o);return null==r?o:(i.writeFragment({...e,data:r}),r)}})}toCacheId(e){return"string"==typeof e?e:this.identify(e)}}const uU=Object.freeze({data:null,dataState:"complete",complete:!0}),bAe=Object.assign(new wn(n=>{n.next(uU)}),{dirty:!1,getCurrentResult:()=>uU}),dU=Object.freeze({data:[],dataState:"complete",complete:!0}),CAe=Object.assign(new wn(n=>{n.next(dU)}),{getCurrentResult:()=>dU});function Xs(n){return null!==n&&"object"==typeof n}const{hasOwnProperty:yAe}=Object.prototype,wAe=function(n,e,t){return this.merge(n[t],e[t])},hU=n=>isNaN(+n)?{}:[];class kf{options;reconciler;constructor(e={}){this.options=e,this.reconciler=e.reconciler||wAe}merge(e,t,i={}){const o=i.atPath;if(o?.length){const[r,...s]=o;void 0===e&&(e=hU(r));let l=e[r];void 0===l&&s.length&&(l=hU(s[0]));const d=this.merge(l,t,{...i,atPath:s});return l!==d&&((e=this.shallowCopyForMerge(e))[r]=d),e}return Array.isArray(e)&&Array.isArray(t)&&"truncate"===this.options.arrayMerge&&e.length>t.length&&(e=e.slice(0,t.length),this.pastCopies.add(e)),Xs(t)&&Xs(e)?(Object.keys(t).forEach(r=>{if(yAe.call(e,r)){const s=e[r];if(t[r]!==s){const l=this.reconciler(e,t,r);l!==s&&((e=this.shallowCopyForMerge(e))[r]=l)}}else(e=this.shallowCopyForMerge(e))[r]=t[r]}),e):t}isObject=Xs;pastCopies=new Set;shallowCopyForMerge(e){return Xs(e)&&(this.pastCopies.has(e)||(e=Array.isArray(e)?e.slice(0):{__proto__:Object.getPrototypeOf(e),...e},this.pastCopies.add(e))),e}}function Of(n){return{__ref:String(n)}}function b1(...n){const e={};return n.forEach(t=>{t&&Reflect.ownKeys(t).forEach(i=>{const o=t[i];void 0!==o&&(e[i]=o)})}),e}const Pr=Array.isArray,{hasOwnProperty:ms}=Object.prototype;function _U({__typename:n,id:e,_id:t},i){if("string"==typeof n&&(i&&(i.keyObject=null!=e?{id:e}:null!=t?{_id:t}:void 0),null==e&&null!=t&&(e=t),null!=e))return`${n}:${"number"==typeof e||"string"==typeof e?e:JSON.stringify(e)}`}const IAe={dataIdFromObject:_U,resultCaching:!0},pU=/^[_a-z][_0-9a-z]*/i;function Gh(n){const e=n.match(pU);return e?e[0]:n}function ww(n,e,t){return!!Xs(e)&&(Pr(e)?e.every(i=>ww(n,i,t)):n.selections.every(i=>{if(U5(i)&&W7(i,t)){const o=v1(i);return ms.call(e,o)&&(!i.selectionSet||ww(i.selectionSet,e[o],t))}return!0}))}function Bf(n){return Xs(n)&&!Ro(n)&&!Pr(n)}function fU(n,e){const t=F5(H5(n));return{fragmentMap:t,lookupFragment(i){let o=t[i];return!o&&e&&(o=e.lookup(i)),o||null}}}const Y7={},Aw=()=>Y7,gU={};class K7{policies;group;data={};constructor(e,t){this.policies=e,this.group=t}toObject(){return{...this.data}}has(e){return void 0!==this.lookup(e,!0)}get(e,t){if(this.group.depend(e,t),ms.call(this.data,e)){const i=this.data[e];if(i&&ms.call(i,t))return i[t]}return"__typename"===t&&ms.call(this.policies.rootTypenamesById,e)?this.policies.rootTypenamesById[e]:this instanceof mu?this.parent.get(e,t):void 0}lookup(e,t){return t&&this.group.depend(e,"__exists"),ms.call(this.data,e)?this.data[e]:this instanceof mu?this.parent.lookup(e,t):this.policies.rootTypenamesById[e]?{}:void 0}merge(e,t){let i;Ro(e)&&(e=e.__ref),Ro(t)&&(t=t.__ref);const o="string"==typeof e?this.lookup(i=e):e,r="string"==typeof t?this.lookup(i=t):t;if(!r)return;bn("string"==typeof i,104);const s=new kf({reconciler:LAe}).merge(o,r);if(this.data[i]=s,s!==o&&(delete this.refs[i],this.group.caching)){const l={};o||(l.__exists=1),Object.keys(r).forEach(d=>{if(!o||o[d]!==s[d]){l[d]=1;const f=Gh(d);f!==d&&!this.policies.hasKeyArgs(s.__typename,f)&&(l[f]=1),void 0===s[d]&&!(this instanceof mu)&&delete s[d]}}),l.__typename&&!(o&&o.__typename)&&this.policies.rootTypenamesById[i]===s.__typename&&delete l.__typename,Object.keys(l).forEach(d=>this.group.dirty(i,d))}}modify(e,t,i){const o=this.lookup(e);if(o){const r={};let s=!1,l=!0;const d={DELETE:Y7,INVALIDATE:gU,isReference:Ro,toReference:this.toReference,canRead:this.canRead,readField:(f,m)=>this.policies.readField("string"==typeof f?{fieldName:f,from:m||Of(e)}:f,{store:this})};if(Object.keys(o).forEach(f=>{const m=Gh(f);let v=o[f];if(void 0===v)return;const A="function"==typeof t?t:t[f]||(i?void 0:t[m]);if(A){let T=A===Aw?Y7:A(v,{...d,fieldName:m,storeFieldName:f,storage:this.getStorage(e,f)});if(T===gU)this.group.dirty(e,f);else if(T===Y7&&(T=void 0),T!==v&&(r[f]=T,s=!0,v=T,false)){const k=Z=>{if(void 0===this.lookup(Z.__ref))return!0};if(Ro(T))k(T);else if(Array.isArray(T)){let ee,Z=!1;for(const fe of T){if(Ro(fe)){if(Z=!0,k(fe))break}else if("object"==typeof fe&&fe){const[Le]=this.policies.identify(fe);Le&&(ee=fe)}if(Z&&void 0!==ee)break}}}}void 0!==v&&(l=!1)}),s)return this.merge(e,r),l&&(this instanceof mu?this.data[e]=void 0:delete this.data[e],this.group.dirty(e,"__exists")),!0}return!1}delete(e,t,i){const o=this.lookup(e);if(o){const r=this.getFieldValue(o,"__typename"),s=t&&i?this.policies.getStoreFieldName({typename:r,fieldName:t,args:i}):t;return this.modify(e,s?{[s]:Aw}:Aw,!!i)}return!1}evict(e,t){let i=!1;return e.id&&(ms.call(this.data,e.id)&&(i=this.delete(e.id,e.fieldName,e.args)),this instanceof mu&&this!==t&&(i=this.parent.evict(e,t)||i),(e.fieldName||i)&&this.group.dirty(e.id,e.fieldName||"__exists")),i}clear(){this.replace(null)}extract(){const e=this.toObject(),t=[];return this.getRootIdSet().forEach(i=>{ms.call(this.policies.rootTypenamesById,i)||t.push(i)}),t.length&&(e.__META={extraRootIds:t.sort()}),e}replace(e){if(Object.keys(this.data).forEach(t=>{e&&ms.call(e,t)||this.delete(t)}),e){const{__META:t,...i}=e;Object.keys(i).forEach(o=>{this.merge(o,i[o])}),t&&t.extraRootIds.forEach(this.retain,this)}}rootIds={};retain(e){return this.rootIds[e]=(this.rootIds[e]||0)+1}release(e){if(this.rootIds[e]>0){const t=--this.rootIds[e];return t||delete this.rootIds[e],t}return 0}getRootIdSet(e=new Set){return Object.keys(this.rootIds).forEach(e.add,e),this instanceof mu?this.parent.getRootIdSet(e):Object.keys(this.policies.rootTypenamesById).forEach(e.add,e),e}gc(){const e=this.getRootIdSet(),t=this.toObject();e.forEach(o=>{ms.call(t,o)&&(Object.keys(this.findChildRefIds(o)).forEach(e.add,e),delete t[o])});const i=Object.keys(t);if(i.length){let o=this;for(;o instanceof mu;)o=o.parent;i.forEach(r=>o.delete(r))}return i}refs={};findChildRefIds(e){if(!ms.call(this.refs,e)){const t=this.refs[e]={},i=this.data[e];if(!i)return t;const o=new Set([i]);o.forEach(r=>{Ro(r)&&(t[r.__ref]=!0),Xs(r)&&Object.keys(r).forEach(s=>{const l=r[s];Xs(l)&&o.add(l)})})}return this.refs[e]}makeCacheKey(){return this.group.keyMaker.lookupArray(arguments)}getFieldValue=(e,t)=>Ro(e)?this.get(e.__ref,t):e&&e[t];canRead=e=>Ro(e)?this.has(e.__ref):"object"==typeof e;toReference=(e,t)=>{if("string"==typeof e)return Of(e);if(Ro(e))return e;const[i]=this.policies.identify(e);if(i){const o=Of(i);return t&&this.merge(i,e),o}};get supportsResultCaching(){return this.group.caching}}class mU{caching;parent;d=null;keyMaker;constructor(e,t=null){this.caching=e,this.parent=t,this.resetCaching()}resetCaching(){this.d=this.caching?XH():null,this.keyMaker=new gu}depend(e,t){if(this.d){this.d(Tw(e,t));const i=Gh(t);i!==t&&this.d(Tw(e,i)),this.parent&&this.parent.depend(e,t)}}dirty(e,t){this.d&&this.d.dirty(Tw(e,t),"__exists"===t?"forget":"setDirty")}}function Tw(n,e){return e+"#"+n}function vU(n,e){z5(n)&&n.group.depend(e,"__exists")}K7.Root=class DAe extends K7{constructor({policies:e,resultCaching:t=!0,seed:i}){super(e,new mU(t)),i&&this.replace(i)}stump=new NAe(this);addLayer(e,t){return this.stump.addLayer(e,t)}removeLayer(){return this}storageTrie=new gu;getStorage(){return this.storageTrie.lookupArray(arguments)}};class mu extends K7{id;parent;replay;group;constructor(e,t,i,o){super(t.policies,o),this.id=e,this.parent=t,this.replay=i,this.group=o,i(this)}addLayer(e,t){return new mu(e,this,t,this.group)}removeLayer(e){const t=this.parent.removeLayer(e);return e===this.id?(this.group.caching&&Object.keys(this.data).forEach(i=>{const o=this.data[i],r=t.lookup(i);r?o?o!==r&&Object.keys(o).forEach(s=>{sr(o[s],r[s])||this.group.dirty(i,s)}):(this.group.dirty(i,"__exists"),Object.keys(r).forEach(s=>{this.group.dirty(i,s)})):this.delete(i)}),t):t===this.parent?this:t.addLayer(this.id,this.replay)}toObject(){return{...this.parent.toObject(),...this.data}}findChildRefIds(e){const t=this.parent.findChildRefIds(e);return ms.call(this.data,e)?{...t,...super.findChildRefIds(e)}:t}getStorage(...e){let t=this.parent;for(;t.parent;)t=t.parent;return t.getStorage(...e)}}class NAe extends mu{constructor(e){super("EntityStore.Stump",e,()=>{},new mU(e.group.caching,e.group))}removeLayer(){return this}merge(e,t){return this.parent.merge(e,t)}}function LAe(n,e,t){const i=n[t],o=e[t];return sr(i,o)?i:o}function z5(n){return!(!n||!n.supportsResultCaching)}const Iw=new H7;function MAe(n){const e=n.directives?.find(({name:i})=>"unmask"===i.value);if(!e)return"mask";const t=e.arguments?.find(({name:i})=>"mode"===i.value);return t&&"value"in t.value&&"migrate"===t.value.value?"migrate":"unmask"}const bU=Symbol.for("apollo.result.extensions"),Wh=Symbol.for("apollo.result.streamInfo"),RAe=Symbol.for("apollo.observableQuery.variablesUnknown");function Pf(n,e,t,i){if(t.kind===pn.INT||t.kind===pn.FLOAT)n[e.value]=Number(t.value);else if(t.kind===pn.BOOLEAN||t.kind===pn.STRING)n[e.value]=t.value;else if(t.kind===pn.OBJECT){const o={};t.fields.map(r=>Pf(o,r.name,r.value,i)),n[e.value]=o}else if(t.kind===pn.VARIABLE)n[e.value]=(i||{})[t.name.value];else if(t.kind===pn.LIST)n[e.value]=t.values.map(o=>{const r={};return Pf(r,e,o,i),r[e.value]});else if(t.kind===pn.ENUM)n[e.value]=t.value;else{if(t.kind!==pn.NULL)throw bl(19,e.value,t.kind);n[e.value]=null}}function Sw(n,e){if(n.arguments&&n.arguments.length){const t={};return n.arguments.forEach(({name:i,value:o})=>Pf(t,i,o,e)),t}return null}const kAe=["connection","include","skip","client","rest","export","nonreactive","stream"];let V5=gd;const CU=Object.assign(function(n,e,t){if(e&&t&&t.connection&&t.connection.key){if(t.connection.filter&&t.connection.filter.length>0){const o=t.connection.filter?t.connection.filter:[];o.sort();const r={};o.forEach(l=>{r[l]=e[l]});const s=V5(r);if("{}"!==s)return`${t.connection.key}(${s})`}return t.connection.key}let i=n;if(e){const o=V5(e);"{}"!==o&&(i+=`(${o})`)}return t&&Object.keys(t).forEach(o=>{-1===kAe.indexOf(o)&&(t[o]&&Object.keys(t[o]).length?i+=`@${o}(${V5(t[o])})`:i+=`@${o}`)}),i},{setStringify(n){const e=V5;return V5=n,e}});function Ew(n){return Array.isArray(n)&&n.length>0}const yU={};function xw(n){const e=JSON.stringify(n);return yU[e]||(yU[e]={})}function wU(n){const e=xw(n);return e.keyFieldsFn||(e.keyFieldsFn=(t,i)=>{const o=(s,l)=>i.readField(l,s),r=i.keyObject=Dw(n,s=>{let l=Ff(i.storeObject,s,o);return void 0===l&&t!==i.storeObject&&ms.call(t,s[0])&&(l=Ff(t,s,IU)),bn(void 0!==l,107,s.join("."),t),l});return`${i.typename}:${JSON.stringify(r)}`})}function AU(n){const e=xw(n);return e.keyArgsFn||(e.keyArgsFn=(t,{field:i,variables:o,fieldName:r})=>{const s=Dw(n,d=>{const f=d[0],m=f.charAt(0);if("@"!==m){if("$"===m){const v=f.slice(1);if(o&&ms.call(o,v)){const A=d.slice(0);return A[0]=v,Ff(o,A)}return}if(t)return Ff(t,d)}else if(i&&Ew(i.directives)){const v=f.slice(1),A=i.directives.find(k=>k.name.value===v),T=A&&Sw(A,o);return T&&Ff(T,d.slice(1))}}),l=JSON.stringify(s);return(t||"{}"!==l)&&(r+=":"+l),r})}function Dw(n,e){const t=new kf;return TU(n).reduce((i,o)=>{let r=e(o);if(void 0!==r){for(let s=o.length-1;s>=0;--s)r={[o[s]]:r};i=t.merge(i,r)}return i},{})}function TU(n){const e=xw(n);if(!e.paths){const t=e.paths=[],i=[];n.forEach((o,r)=>{Pr(o)?(TU(o).forEach(s=>t.push(i.concat(s))),i.length=0):(i.push(o),Pr(n[r+1])||(t.push(i.slice(0)),i.length=0))})}return e.paths}function IU(n,e){return n[e]}function Ff(n,e,t){return t=t||IU,SU(e.reduce(function i(o,r){return Pr(o)?o.map(s=>i(s,r)):o&&t(o,r)},n))}function SU(n){return Xs(n)?Pr(n)?n.map(SU):Dw(Object.keys(n).sort(),e=>Ff(n,e)):n}const EU=new H7,xU=new WeakMap;function j5(n){let e=xU.get(n);return e||xU.set(n,e={vars:new Set,dep:XH()}),e}function DU(n){j5(n).vars.forEach(e=>e.forgetCache(n))}function PAe(n){const e=new Set,t=new Set,i=function(r){if(arguments.length>0){if(n!==r){n=r,e.forEach(l=>{j5(l).dep.dirty(i),function FAe(n){n.broadcastWatches&&n.broadcastWatches()}(l)});const s=Array.from(t);t.clear(),s.forEach(l=>l(n))}}else{const s=EU.getValue();s&&(o(s),j5(s).dep(i))}return n};i.onNextChange=r=>(t.add(r),()=>{t.delete(r)});const o=i.attachCache=r=>(e.add(r),j5(r).vars.add(i),i);return i.forgetCache=r=>e.delete(r),i}function Nw(n){return void 0!==n.args?n.args:n.field?Sw(n.field,n.variables):null}const HAe=()=>{},NU=(n,e)=>e.fieldName,LU=(n,e,{mergeObjects:t})=>t(n,e),MU=(n,e)=>e,UAe=(n,e,{streamFieldInfo:t,existingData:i})=>{if(!n&&!i)return e;const o=[],r=n??i,s=t?.isLastChunk?e.length:Math.max(r.length,e.length);for(let l=0;l<s;l++)o[l]=void 0===e[l]?r[l]:e[l];return o};class zAe{config;typePolicies={};toBeAdded={};supertypeMap=new Map;fuzzySubtypes=new Map;cache;rootIdsByTypename={};rootTypenamesById={};usingPossibleTypes=!1;constructor(e){this.config=e,this.config={dataIdFromObject:_U,...e},this.cache=this.config.cache,this.setRootTypename("Query"),this.setRootTypename("Mutation"),this.setRootTypename("Subscription"),e.possibleTypes&&this.addPossibleTypes(e.possibleTypes),e.typePolicies&&this.addTypePolicies(e.typePolicies)}identify(e,t){const i=this,o=t&&(t.typename||t.storeObject?.__typename)||e.__typename;if(o===this.rootTypenamesById.ROOT_QUERY)return["ROOT_QUERY"];const r=t&&t.storeObject||e,s={...t,typename:o,storeObject:r,readField:t&&t.readField||((...m)=>{const v=Lw(m,r);return i.readField(v,{store:i.cache.data,variables:v.variables})})};let l;const d=o&&this.getTypePolicy(o);let f=d&&d.keyFn||this.config.dataIdFromObject;return Iw.withValue(!0,()=>{for(;f;){const m=f({...e,...r},s);if(!Pr(m)){l=m;break}f=wU(m)}}),l=l?String(l):void 0,s.keyObject?[l,s.keyObject]:[l]}addTypePolicies(e){Object.keys(e).forEach(t=>{const{queryType:i,mutationType:o,subscriptionType:r,...s}=e[t];i&&this.setRootTypename("Query",t),o&&this.setRootTypename("Mutation",t),r&&this.setRootTypename("Subscription",t),ms.call(this.toBeAdded,t)?this.toBeAdded[t].push(s):this.toBeAdded[t]=[s]})}updateTypePolicy(e,t,i){const o=this.getTypePolicy(e),{keyFields:r,fields:s}=t;function l(d,f){d.merge="function"==typeof f?f:!0===f?LU:!1===f?MU:d.merge}l(o,t.merge),o.keyFn=!1===r?HAe:Pr(r)?wU(r):"function"==typeof r?r:o.keyFn,s&&Object.keys(s).forEach(d=>{let f=i[d];(!f||f?.typename!==e)&&(f=i[d]={typename:e});const m=s[d];if("function"==typeof m)f.read=m;else{const{keyArgs:v,read:A,merge:T}=m;f.keyFn=!1===v?NU:Pr(v)?AU(v):"function"==typeof v?v:f.keyFn,"function"==typeof A&&(f.read=A),l(f,T)}f.read&&f.merge&&(f.keyFn=f.keyFn||NU)})}setRootTypename(e,t=e){const i="ROOT_"+e.toUpperCase(),o=this.rootTypenamesById[i];t!==o&&(bn(!o||o===e,108,e),o&&delete this.rootIdsByTypename[o],this.rootIdsByTypename[t]=i,this.rootTypenamesById[i]=t)}addPossibleTypes(e){this.usingPossibleTypes=!0,Object.keys(e).forEach(t=>{this.getSupertypeSet(t,!0),e[t].forEach(i=>{this.getSupertypeSet(i,!0).add(t);const o=i.match(pU);(!o||o[0]!==i)&&this.fuzzySubtypes.set(i,new RegExp(i))})})}getTypePolicy(e){if(!ms.call(this.typePolicies,e)){const i=this.typePolicies[e]={};i.fields={};let o=this.supertypeMap.get(e);!o&&this.fuzzySubtypes.size&&(o=this.getSupertypeSet(e,!0),this.fuzzySubtypes.forEach((r,s)=>{if(r.test(e)){const l=this.supertypeMap.get(s);l&&l.forEach(d=>o.add(d))}})),o&&o.size&&o.forEach(r=>{const{fields:s,...l}=this.getTypePolicy(r);Object.assign(i,l),Object.assign(i.fields,s)})}const t=this.toBeAdded[e];return t&&t.length&&t.splice(0).forEach(i=>{this.updateTypePolicy(e,i,this.typePolicies[e].fields)}),this.typePolicies[e]}getFieldPolicy(e,t){if(e)return this.getTypePolicy(e).fields[t]}getSupertypeSet(e,t){let i=this.supertypeMap.get(e);return!i&&t&&this.supertypeMap.set(e,i=new Set),i}fragmentMatches(e,t,i,o){if(!e.typeCondition)return!0;if(!t)return!1;const r=e.typeCondition.name.value;if(t===r)return!0;if(this.usingPossibleTypes&&this.supertypeMap.has(r)){const s=this.getSupertypeSet(t,!0),l=[s],d=v=>{const A=this.getSupertypeSet(v,!1);A&&A.size&&l.indexOf(A)<0&&l.push(A)};let f=!(!i||!this.fuzzySubtypes.size),m=!1;for(let v=0;v<l.length;++v){const A=l[v];if(A.has(r))return s.has(r)||s.add(r),!0;A.forEach(d),f&&v===l.length-1&&ww(e.selectionSet,i,o)&&(f=!1,m=!0,this.fuzzySubtypes.forEach((T,k)=>{const Z=t.match(T);Z&&Z[0]===t&&d(k)}))}}return!1}hasKeyArgs(e,t){const i=this.getFieldPolicy(e,t);return!(!i||!i.keyFn)}getStoreFieldName(e){const{typename:t,fieldName:i}=e,o=this.getFieldPolicy(t,i);let r,s=o&&o.keyFn;if(s&&t){const l={typename:t,fieldName:i,field:e.field||null,variables:e.variables},d=Nw(e);for(;s;){const f=s(d,l);if(!Pr(f)){r=f||i;break}s=AU(f)}}return void 0===r&&(r=e.field?function OAe(n,e){let t=null;n.directives&&(t={},n.directives.forEach(o=>{t[o.name.value]={},o.arguments&&o.arguments.forEach(({name:r,value:s})=>Pf(t[o.name.value],r,s,e))}));let i=null;return n.arguments&&n.arguments.length&&(i={},n.arguments.forEach(({name:o,value:r})=>Pf(i,o,r,e))),CU(n.name.value,i,t)}(e.field,e.variables):CU(i,Nw(e))),!1===r?i:i===Gh(r)?r:i+":"+r}readField(e,t){const i=e.from;if(!i||!e.field&&!e.fieldName)return;if(void 0===e.typename){const m=t.store.getFieldValue(i,"__typename");m&&(e.typename=m)}const r=this.getStoreFieldName(e),s=Gh(r),l=t.store.getFieldValue(i,r),d=this.getFieldPolicy(e.typename,s),f=d&&d.read;if(f){const m=RU(this,i,e,t,t.store.getStorage(Ro(i)?i.__ref:i,r));return EU.withValue(this.cache,f,[l,m])}return l}getReadFunction(e,t){const i=this.getFieldPolicy(e,t);return i&&i.read}getMergeFunction(e,t,i){let o=this.getFieldPolicy(e,t),r=o&&o.merge;return!r&&i&&(o=this.getTypePolicy(i),r=o&&o.merge),r}runMergeFunction(e,t,{field:i,typename:o,merge:r,path:s},l,d){const f=e;if(r===LU)return kU(l.store)(e,t);if(r===MU)return t;l.overwrite&&(e=void 0);const m=l.extensions?.[Wh]?.deref()?.peekArray(s);if(m){const{current:A,previous:T}=m;if(T&&sr(T.incoming,t)&&sr(T.streamFieldInfo,A))return T.result}const v=r(e,t,function VAe(n,e,t,i,o,r){const s={...RU(n,e,t,i,o),extensions:i.extensions,existingData:r},l=i.extensions;if(l&&Wh in l){const{[Wh]:d,...f}=l,m=d?.deref()?.peekArray(t.path);m&&(s.streamFieldInfo=m.current),s.extensions=0===Object.keys(f).length?void 0:f}return s}(this,void 0,{typename:o,fieldName:i.name.value,field:i,variables:l.variables,path:s},l,d||{},f));return m&&(m.previous={incoming:t,streamFieldInfo:m.current,result:v}),v}}function RU(n,e,t,i,o){const r=n.getStoreFieldName(t),s=Gh(r),l=t.variables||i.variables,{toReference:d,canRead:f}=i.store;return{args:Nw(t),field:t.field||null,fieldName:s,storeFieldName:r,variables:l,isReference:Ro,toReference:d,storage:o,cache:n.cache,canRead:f,readField:(...m)=>n.readField(Lw(m,e,l),i),mergeObjects:kU(i.store)}}function Lw(n,e,t){const{0:i,1:o,length:r}=n;let s;return"string"==typeof i?s={fieldName:i,from:r>1?o:e}:(s={...i},ms.call(s,"from")||(s.from=e)),void 0===s.variables&&(s.variables=t),s}function kU(n){return function(t,i){if(Pr(t)||Pr(i))throw bl(111);if(Xs(t)&&Xs(i)){const o=n.getFieldValue(t,"__typename"),r=n.getFieldValue(i,"__typename");if(o&&r&&o!==r)return i;if(Ro(t)&&Bf(i))return n.merge(t.__ref,i),t;if(Bf(t)&&Ro(i))return n.merge(t,i.__ref),i;if(Bf(t)&&Bf(i))return{...t,...i}}return i}}function Mw(n){const e={},t=n&&n.variableDefinitions;return t&&t.length&&t.forEach(i=>{i.defaultValue&&Pf(e,i.variable.name,i.defaultValue)}),e}function OU(n){const e=pd(n);return bn(e&&"query"===e.operation,13),e}function jAe(n){let e=n[0]||{};const t=n.length;if(t>1){const i=new kf;for(let o=1;o<t;++o)e=i.merge(e,n[o])}return e}class Rw extends Error{message;path;query;variables;constructor(e,t,i,o){if(super(e),this.message=e,this.path=t,this.query=i,this.variables=o,this.name="MissingFieldError",Array.isArray(this.path)){this.missing=this.message;for(let r=this.path.length-1;r>=0;--r)this.missing={[this.path[r]]:this.missing}}else this.missing=this.path;this.__proto__=Rw.prototype}missing}function BU(n){return[n.selectionSet,n.objectOrReference,n.context]}class GAe{executeSelectionSet;executeSubSelectedArray;config;knownResults=new WeakMap;constructor(e){this.config=e,this.executeSelectionSet=R5(t=>{const i=BU(t);return this.executeSelectionSet.peek(...i)||(vU(t.context.store,t.enclosingRef.__ref),this.execSelectionSetImpl(t))},{max:_d["inMemoryCache.executeSelectionSet"]||5e4,keyArgs:BU,makeCacheKey(t,i,o){if(z5(o.store))return o.store.makeCacheKey(t,Ro(i)?i.__ref:i,o.varString)}}),this.executeSubSelectedArray=R5(t=>(vU(t.context.store,t.enclosingRef.__ref),this.execSubSelectedArrayImpl(t)),{max:_d["inMemoryCache.executeSubSelectedArray"]||1e4,makeCacheKey({field:t,array:i,context:o}){if(z5(o.store))return o.store.makeCacheKey(t,i,o.varString)}})}diffQueryAgainstStore({store:e,query:t,rootId:i="ROOT_QUERY",variables:o,returnPartialData:r=!0}){const s=this.config.cache.policies;o={...Mw(OU(t)),...o};const l=Of(i),d=this.executeSelectionSet({selectionSet:yw(t).selectionSet,objectOrReference:l,enclosingRef:l,context:{store:e,query:t,policies:s,variables:o,varString:gd(o),...fU(t,this.config.fragments)}});let f;d.missing&&(f=new Rw(function WAe(n){try{JSON.stringify(n,(e,t)=>{if("string"==typeof t)throw t;return t})}catch(e){return e}}(d.missing),d.missing,t,o));const m=!f,{result:v}=d;return{result:m?v:r?0===Object.keys(v).length?null:v:null,complete:m,missing:f}}isFresh(e,t,i,o){if(z5(o.store)&&this.knownResults.get(e)===i){const r=this.executeSelectionSet.peek(i,t,o);if(r&&e===r.result)return!0}return!1}execSelectionSetImpl({selectionSet:e,objectOrReference:t,enclosingRef:i,context:o}){if(Ro(t)&&!o.policies.rootTypenamesById[t.__ref]&&!o.store.has(t.__ref))return{result:{},missing:`Dangling reference to missing ${t.__ref} object`};const{variables:r,policies:s,store:l}=o,d=l.getFieldValue(t,"__typename"),f=[];let m;const v=new kf;function A(fe,Le){return fe.missing&&(m=v.merge(m,{[Le]:fe.missing})),fe.result}"string"==typeof d&&!s.rootIdsByTypename[d]&&f.push({__typename:d});const T=new Set(e.selections);T.forEach(fe=>{if(W7(fe,r))if(U5(fe)){let Le=s.readField({fieldName:fe.name.value,field:fe,variables:o.variables,from:t},o);const Ct=v1(fe);void 0===Le?_w.added(fe)||(m=v.merge(m,{[Ct]:`Can't find field '${fe.name.value}' on ${Ro(t)?t.__ref+" object":"object "+JSON.stringify(t,null,2)}`})):Pr(Le)?Le.length>0&&(Le=A(this.executeSubSelectedArray({field:fe,array:Le,enclosingRef:i,context:o}),Ct)):fe.selectionSet&&null!=Le&&(Le=A(this.executeSelectionSet({selectionSet:fe.selectionSet,objectOrReference:Le,enclosingRef:Ro(Le)?Le:i,context:o}),Ct)),void 0!==Le&&f.push({[Ct]:Le})}else{const Le=G7(fe,o.lookupFragment);if(!Le&&fe.kind===pn.FRAGMENT_SPREAD)throw bl(112,fe.name.value);Le&&s.fragmentMatches(Le,d)&&Le.selectionSet.selections.forEach(T.add,T)}});const ee={result:jAe(f),missing:m};return ee.result&&this.knownResults.set(ee.result,e),ee}execSubSelectedArrayImpl({field:e,array:t,enclosingRef:i,context:o}){let r,s=new kf;function l(d,f){return d.missing&&(r=s.merge(r,{[f]:d.missing})),d.result}return e.selectionSet&&(t=t.filter(d=>void 0===d||o.store.canRead(d))),{result:t=t.map((d,f)=>null===d?null:Pr(d)?l(this.executeSubSelectedArray({field:e,array:d,enclosingRef:i,context:o}),f):e.selectionSet?l(this.executeSelectionSet({selectionSet:e.selectionSet,objectOrReference:d,enclosingRef:Ro(d)?d:i,context:o}),f):d),missing:r}}}function Ow(n,e,t){const i=`${e}${t}`;let o=n.flavors.get(i);return o||n.flavors.set(i,o=n.clientOnly===e&&n.deferred===t?n:{...n,clientOnly:e,deferred:t}),o}class KAe{cache;reader;fragments;constructor(e,t,i){this.cache=e,this.reader=t,this.fragments=i}writeToStore(e,{query:t,result:i,dataId:o,variables:r,overwrite:s,extensions:l}){const d=pd(t),f=function xAe(){return new kf}();r={...Mw(d),...r};const m={store:e,written:{},merge:(A,T)=>f.merge(A,T),variables:r,varString:gd(r),...fU(t,this.fragments),overwrite:!!s,incomingById:new Map,clientOnly:!1,deferred:!1,flavors:new Map,extensions:l},v=this.processSelectionSet({result:i||{},dataId:o,selectionSet:d.selectionSet,mergeTree:{map:new Map},context:m,path:[]});if(!Ro(v))throw bl(114,i);return m.incomingById.forEach(({storeObject:A,mergeTree:T},Z)=>{const ee=Of(Z);if(T&&T.map.size){const fe=this.applyMerges(T,ee,A,m);if(Ro(fe))return;A=fe}e.merge(Z,A)}),e.retain(v.__ref),v}processSelectionSet({dataId:e,result:t,selectionSet:i,context:o,mergeTree:r,path:s}){const{policies:l}=this.cache;let d={};const f=e&&l.rootTypenamesById[e]||Pw(t,i,o.fragmentMap)||e&&o.store.get(e,"__typename");"string"==typeof f&&(d.__typename=f);const m=(...A)=>{const T=Lw(A,d,o.variables);if(Ro(T.from)){const k=o.incomingById.get(T.from.__ref);if(k){const Z=l.readField({...T,from:k.storeObject},o);if(void 0!==Z)return Z}}return l.readField(T,o)},v=new Set;this.flattenFields(i,t,o,f).forEach((A,T)=>{const k=v1(T),Z=t[k],ee=[...s,T.name.value];if(v.add(T),void 0!==Z){const fe=l.getStoreFieldName({typename:f,fieldName:T.name.value,field:T,variables:A.variables}),Le=FU(r,fe);let Nt,Ct=this.processFieldValue(Z,T,T.selectionSet?Ow(A,!1,!1):A,Le,ee);T.selectionSet&&(Ro(Ct)||Bf(Ct))&&(Nt=m("__typename",Ct));const Zt=l.getMergeFunction(f,T.name.value,Nt);Zt?Le.info={field:T,typename:f,merge:Zt,path:ee}:A.extensions?.[Wh]&&Array.isArray(Ct)&&function XAe(n){return!!n.directives&&n.directives.some(e=>"stream"===e.name.value)}(T)?Le.info={field:T,typename:f,merge:UAe,path:ee}:HU(r,fe),d=A.merge(d,{[fe]:Ct})}});try{const[A,T]=l.identify(t,{typename:f,selectionSet:i,fragmentMap:o.fragmentMap,storeObject:d,readField:m});e=e||A,T&&(d=o.merge(d,T))}catch(A){if(!e)throw A}if("string"==typeof e){const A=Of(e),T=o.written[e]||(o.written[e]=[]);if(T.indexOf(i)>=0||(T.push(i),this.reader&&this.reader.isFresh(t,A,i,o)))return A;const k=o.incomingById.get(e);return k?(k.storeObject=o.merge(k.storeObject,d),k.mergeTree=Bw(k.mergeTree,r),v.forEach(Z=>k.fieldNodeSet.add(Z))):o.incomingById.set(e,{storeObject:d,mergeTree:X7(r)?void 0:r,fieldNodeSet:v}),A}return d}processFieldValue(e,t,i,o,r){return t.selectionSet&&null!==e?Pr(e)?e.map((s,l)=>{const d=this.processFieldValue(s,t,i,FU(o,l),[...r,l]);return HU(o,l),d}):this.processSelectionSet({result:e,selectionSet:t.selectionSet,context:i,mergeTree:o,path:r}):e}flattenFields(e,t,i,o=Pw(t,e,i.fragmentMap)){const r=new Map,{policies:s}=this.cache,l=new gu(!1);return function d(f,m){const v=l.lookup(f,m.clientOnly,m.deferred);v.visited||(v.visited=!0,f.selections.forEach(A=>{if(!W7(A,i.variables))return;let{clientOnly:T,deferred:k}=m;if(!(T&&k)&&Ew(A.directives)&&A.directives.forEach(Z=>{const ee=Z.name.value;if("client"===ee&&(T=!0),"defer"===ee){const fe=Sw(Z,i.variables);(!fe||!1!==fe.if)&&(k=!0)}}),U5(A)){const Z=r.get(A);Z&&(T=T&&Z.clientOnly,k=k&&Z.deferred),r.set(A,Ow(i,T,k))}else{const Z=G7(A,i.lookupFragment);if(!Z&&A.kind===pn.FRAGMENT_SPREAD)throw bl(116,A.name.value);Z&&s.fragmentMatches(Z,o,t,i.variables)&&d(Z.selectionSet,Ow(i,T,k))}}))}(e,i),r}applyMerges(e,t,i,o,r){if(e.map.size&&!Ro(i)){const s=Pr(i)||!Ro(t)&&!Bf(t)?void 0:t,l=i;let d;s&&!r&&(r=[Ro(s)?s.__ref:s]);const f=(m,v)=>Pr(m)?"number"==typeof v?m[v]:void 0:o.store.getFieldValue(m,String(v));e.map.forEach((m,v)=>{const A=f(s,v),T=f(l,v);if(void 0===T)return;r&&r.push(v);const k=this.applyMerges(m,A,T,o,r);k!==T&&(d=d||new Map,d.set(v,k)),r&&bn(r.pop()===v)}),d&&(i=Pr(l)?l.slice(0):{...l},d.forEach((m,v)=>{i[v]=m}))}return e.info?this.cache.policies.runMergeFunction(t,i,e.info,o,r&&o.store.getStorage(...r)):i}}const PU=[];function FU({map:n},e){return n.has(e)||n.set(e,PU.pop()||{map:new Map}),n.get(e)}function Bw(n,e){if(n===e||!e||X7(e))return n;if(!n||X7(n))return e;const t=n.info&&e.info?{...n.info,...e.info}:n.info||e.info,i=n.map.size&&e.map.size,r={info:t,map:i?new Map:n.map.size?n.map:e.map};if(i){const s=new Set(e.map.keys());n.map.forEach((l,d)=>{r.map.set(d,Bw(l,e.map.get(d))),s.delete(d)}),s.forEach(l=>{r.map.set(l,Bw(e.map.get(l),n.map.get(l)))})}return r}function X7(n){return!n||!(n.info||n.map.size)}function HU({map:n},e){const t=n.get(e);t&&X7(t)&&(PU.push(t),n.delete(e))}function Pw(n,e,t){let i;for(const o of e.selections)if(U5(o)){if("__typename"===o.name.value)return n[v1(o)]}else i?i.push(o):i=[o];if("string"==typeof n.__typename)return n.__typename;if(i)for(const o of i){const r=Pw(n,G7(o,t).selectionSet,t);if("string"==typeof r)return r}}class zU extends cU{data;optimisticData;config;watches=new Set;storeReader;storeWriter;addTypenameTransform=new fd(_w);maybeBroadcastWatch;assumeImmutableResults=!0;policies;makeVar=PAe;constructor(e={}){super(),this.config=function SAe(n){return b1(IAe,n)}(e),this.policies=new zAe({cache:this,dataIdFromObject:this.config.dataIdFromObject,possibleTypes:this.config.possibleTypes,typePolicies:this.config.typePolicies}),this.init()}init(){const e=this.data=new K7.Root({policies:this.policies,resultCaching:this.config.resultCaching});this.optimisticData=e.stump,this.resetResultCache()}resetResultCache(){const{fragments:e}=this.config;this.addTypenameTransform.resetCache(),e?.resetCaches(),this.storeWriter=new KAe(this,this.storeReader=new GAe({cache:this,fragments:e}),e),this.maybeBroadcastWatch=R5((t,i)=>this.broadcastWatch(t,i),{max:_d["inMemoryCache.maybeBroadcastWatch"]||5e3,makeCacheKey:t=>{const i=t.optimistic?this.optimisticData:this.data;if(z5(i)){const{optimistic:o,id:r,variables:s}=t;return i.makeCacheKey(t.query,t.callback,gd({optimistic:o,id:r,variables:s}))}}}),new Set([this.data.group,this.optimisticData.group]).forEach(t=>t.resetCaching())}restore(e){return this.init(),e&&this.data.replace(e),this}extract(e=!1){return(e?this.optimisticData:this.data).extract()}read(e){const{returnPartialData:t=!1}=e;return this.storeReader.diffQueryAgainstStore({...e,store:e.optimistic?this.optimisticData:this.data,config:this.config,returnPartialData:t}).result}write(e){try{return++this.txCount,this.storeWriter.writeToStore(this.data,e)}finally{! --this.txCount&&!1!==e.broadcast&&this.broadcastWatches()}}modify(e){if(ms.call(e,"id")&&!e.id)return!1;const t=e.optimistic?this.optimisticData:this.data;try{return++this.txCount,t.modify(e.id||"ROOT_QUERY",e.fields,!1)}finally{! --this.txCount&&!1!==e.broadcast&&this.broadcastWatches()}}diff(e){return this.storeReader.diffQueryAgainstStore({...e,store:e.optimistic?this.optimisticData:this.data,rootId:e.id||"ROOT_QUERY",config:this.config})}watch(e){return this.watches.size||function BAe(n){j5(n).vars.forEach(e=>e.attachCache(n))}(this),this.watches.add(e),e.immediate&&this.maybeBroadcastWatch(e),()=>{this.watches.delete(e)&&!this.watches.size&&DU(this),this.maybeBroadcastWatch.forget(e)}}gc(e){gd.reset(),B5.reset();const t=this.optimisticData.gc();return e&&!this.txCount&&e.resetResultCache&&this.resetResultCache(),t}retain(e,t){return(t?this.optimisticData:this.data).retain(e)}release(e,t){return(t?this.optimisticData:this.data).release(e)}identify(e){if(Ro(e))return e.__ref;try{return this.policies.identify(e)[0]}catch(t){}}evict(e){if(!e.id){if(ms.call(e,"id"))return!1;e={...e,id:"ROOT_QUERY"}}try{return++this.txCount,this.optimisticData.evict(e,this.data)}finally{! --this.txCount&&!1!==e.broadcast&&this.broadcastWatches()}}reset(e){return this.init(),gd.reset(),e&&e.discardWatches?(this.watches.forEach(t=>this.maybeBroadcastWatch.forget(t)),this.watches.clear(),DU(this)):this.broadcastWatches(),Promise.resolve()}removeOptimistic(e){const t=this.optimisticData.removeLayer(e);t!==this.optimisticData&&(this.optimisticData=t,this.broadcastWatches())}txCount=0;batch(e){const{update:t,optimistic:i=!0,removeOptimistic:o,onWatchUpdated:r}=e;let s;const l=f=>{const{data:m,optimisticData:v}=this;++this.txCount,f&&(this.data=this.optimisticData=f);try{return s=t(this)}finally{--this.txCount,this.data=m,this.optimisticData=v}},d=new Set;return r&&!this.txCount&&this.broadcastWatches({...e,onWatchUpdated:f=>(d.add(f),!1)}),"string"==typeof i?this.optimisticData=this.optimisticData.addLayer(i,l):!1===i?l(this.data):l(),"string"==typeof o&&(this.optimisticData=this.optimisticData.removeLayer(o)),r&&d.size?(this.broadcastWatches({...e,onWatchUpdated(f,m){const v=r.call(this,f,m);return!1!==v&&d.delete(f),v}}),d.size&&d.forEach(f=>this.maybeBroadcastWatch.dirty(f))):this.broadcastWatches(e),s}performTransaction(e,t){return this.batch({update:e,optimistic:t||null!==t})}transformDocument(e){return this.addTypenameTransform.transformDocument(this.addFragmentsToDocument(e))}fragmentMatches(e,t){return this.policies.fragmentMatches(e,t)}lookupFragment(e){return this.config.fragments?.lookup(e)||null}resolvesClientField(e,t){return!!this.policies.getReadFunction(e,t)}broadcastWatches(e){if(!this.txCount){const t=this.onAfterBroadcast,i=new Set;this.onAfterBroadcast=o=>{i.add(o)};try{this.watches.forEach(o=>this.maybeBroadcastWatch(o,e)),i.forEach(o=>o())}finally{this.onAfterBroadcast=t}}}addFragmentsToDocument(e){const{fragments:t}=this.config;return t?t.transform(e):e}broadcastWatch(e,t){const{lastDiff:i}=e,o=this.diff(e);t&&(e.optimistic&&"string"==typeof t.optimistic&&(o.fromOptimisticTransaction=!0),t.onWatchUpdated&&!1===t.onWatchUpdated.call(this,e,o,i))||(!i||!sr(i.result,o.result))&&e.callback(e.lastDiff=o,i)}}class VU extends Ks{constructor(e){super((t,i)=>{const{...o}=t;return Object.defineProperty(o,"client",{enumerable:!1,value:t.client}),new wn(r=>{let s=!1;return Promise.resolve(o).then(l=>e(t.getContext(),l)).then(t.setContext).then(()=>{s||i(t).subscribe(r)}).catch(r.error.bind(r)),()=>{s=!0}})})}}function G5(n,e,t){const i=new Set(n),o=i.size;return fu(e,{Directive(r){if(i.delete(r.name.value)&&(!t||!i.size))return Uh}}),t?!i.size:i.size<o}class QAe{isIncrementalResult(e){return!1}prepareRequest(e){return bn(!G5(["defer","stream"],e.query),67),e}extractErrors(){}startRequest=void 0}const Fw=Ks.execute;function q7(n,e){return b1(n,e,e.variables&&{variables:b1({...n&&n.variables,...e.variables})})}function JAe(n){return fu(n,{FragmentSpread(e){if(!e.directives?.some(({name:t})=>"unmask"===t.value))return null}})}function $h(n,e){const t=be(n)?n:()=>n,i=o=>o.error(t());return new wn(e?o=>e.schedule(i,0,o):i)}function md(n){return ia((e,t)=>{let r,i=null,o=!1;i=e.subscribe(Sa(t,void 0,void 0,s=>{r=hl(n(s,md(n)(e))),i?(i.unsubscribe(),i=null,r.subscribe(t)):o=!0})),o&&(i.unsubscribe(),i=null,r.subscribe(t))})}class vd{constructor(e,t,i){this.kind=e,this.value=t,this.error=i,this.hasValue="N"===e}observe(e){return function tTe(n,e){var t,i,o;const{kind:r,value:s,error:l}=n;if("string"!=typeof r)throw new TypeError('Invalid notification, missing "kind"');"N"===r?null===(t=e.next)||void 0===t||t.call(e,s):"E"===r?null===(i=e.error)||void 0===i||i.call(e,l):null===(o=e.complete)||void 0===o||o.call(e)}(this,e)}do(e,t,i){const{kind:o,value:r,error:s}=this;return"N"===o?e?.(r):"E"===o?t?.(s):i?.()}accept(e,t,i){var o;return be(null===(o=e)||void 0===o?void 0:o.next)?this.observe(e):this.do(e,t,i)}toObservable(){const{kind:e,value:t,error:i}=this,o="N"===e?au(t):"E"===e?$h(()=>i):"C"===e?hd:0;if(!o)throw new TypeError(`Unexpected notification kind ${e}`);return o}static createNext(e){return new vd("N",e)}static createError(e){return new vd("E",void 0,e)}static createComplete(){return vd.completeNotification}}function jU(n=1/0){return Mh(Sn,n)}function W5(...n){return function iTe(){return jU(1)}()(tu(n,y3(n)))}function Hw(n,e){return"object"==typeof n&&null!==n&&n[Symbol.for("apollo.error")]===e}function Uw(n){Object.defineProperty(n,Symbol.for("apollo.error"),{value:n.name,enumerable:!1,writable:!1,configurable:!1})}function GU(n){return n.filter(e=>e).map(e=>e.message||"Error message not found.").join("\n")}vd.completeNotification=new vd("C");let $5=(()=>{class n extends Error{static is(t){return Hw(t,"CombinedGraphQLErrors")}static formatMessage=GU;errors;data;extensions;constructor(t,i=t.errors||[]){super(n.formatMessage(i,{result:t,defaultFormatMessage:GU})),this.errors=i,this.data=t.data,this.extensions=t.extensions,this.name="CombinedGraphQLErrors",Uw(this),Object.setPrototypeOf(this,n.prototype)}}return n})();function WU(n){return n.map(e=>e.message||"Error message not found.").join("\n")}let oTe=(()=>{class n extends Error{static is(t){return Hw(t,"CombinedProtocolErrors")}static formatMessage=WU;errors;constructor(t){super(n.formatMessage(t,{defaultFormatMessage:WU})),this.name="CombinedProtocolErrors",this.errors=t,Uw(this),Object.setPrototypeOf(this,n.prototype)}}return n})();class zw extends Error{static is(e){return Hw(e,"UnconventionalError")}constructor(e){super("An error of unexpected shape occurred.",{cause:e}),this.name="UnconventionalError",Uw(this),Object.setPrototypeOf(this,zw.prototype)}}const Vw=Symbol(),$U=new WeakSet;function ZU(n,e,t){return Iw.withValue(!0,()=>{const i=Z5(n,e,t,!1);return Object.isFrozen(n),i})}function Z5(n,e,t,i,o){const{knownChanged:r}=t,s=function cTe(n,e){if(e.has(n))return e.get(n);const t=Array.isArray(n)?[]:{};return e.set(n,t),t}(n,t.mutableTargets);if(Array.isArray(n)){for(const[l,d]of Array.from(n.entries())){if(null===d){s[l]=null;continue}const f=Z5(d,e,t,i,void 0);r.has(f)&&r.add(s),s[l]=f}return r.has(s)?s:n}for(const l of e.selections){let d;if(i&&r.add(s),l.kind===pn.FIELD){const f=v1(l),m=l.selectionSet;if(d=s[f]||n[f],void 0===d)continue;if(m&&null!==d){const v=Z5(n[f],m,t,i,void 0);r.has(v)&&(d=v)}s[f]=d}if(l.kind===pn.INLINE_FRAGMENT&&(!l.typeCondition||t.cache.fragmentMatches(l,n.__typename))&&(d=Z5(n,l.selectionSet,t,i,o)),l.kind===pn.FRAGMENT_SPREAD){const f=l.name.value,m=t.fragmentMap[f]||(t.fragmentMap[f]=t.cache.lookupFragment(f));bn(m,39,f);const v=MAe(l);"mask"!==v&&(d=Z5(n,m.selectionSet,t,"migrate"===v,o))}r.has(d)&&r.add(s)}return"__typename"in n&&!("__typename"in s)&&(s.__typename=n.__typename),Object.keys(s).length!==Object.keys(n).length&&r.add(s),r.has(s)?s:n}function YU(n){return 7===n||8===n}function Q7(n){return!YU(n)}function Hf(n){return!!n.errors?.length}function jw(n,e=()=>{}){return t=>new wn(i=>{let o=e();return t.subscribe({next(r){let s;try{s=n(r,o)}catch(l){i.error(l)}void 0!==s&&i.next(s)},error(r){i.error(r)},complete(){i.complete()}})})}function Y5(n){const e={data:n.data};return n.error&&(e.error=n.error),e}function _Te(n){let e=!1;return fu(n,{Directive:{enter(t){if("client"===t.name.value&&t.arguments&&(e=t.arguments.some(i=>"always"===i.name.value&&"BooleanValue"===i.value.kind&&!0===i.value.value),e))return Uh}}}),e}function pTe(n,e){zh(e);const t=KU(""),i=KU(""),o=ee=>{for(let Le,fe=0;fe<ee.length&&(Le=ee[fe]);++fe)if(!Pr(Le)){if(Le.kind===pn.OPERATION_DEFINITION)return t(Le.name&&Le.name.value);if(Le.kind===pn.FRAGMENT_DEFINITION)return i(Le.name.value)}return bn.error(14),null};let r=0;for(let ee=e.definitions.length-1;ee>=0;--ee)e.definitions[ee].kind===pn.OPERATION_DEFINITION&&++r;const s=function fTe(n){const e=new Map,t=new Map;return n.forEach(i=>{i&&(i.name?e.set(i.name,i):i.test&&t.set(i.test,i))}),i=>{let o=e.get(i.name.value);return!o&&t.size&&t.forEach((r,s)=>{s(i)&&(o=r)}),o}}(n),l=ee=>Ew(ee)&&ee.map(s).some(fe=>fe&&fe.remove),d=new Map;let f=!1;const m={enter(ee){if(l(ee.directives))return f=!0,null}},v=fu(e,{Field:m,InlineFragment:m,VariableDefinition:{enter:()=>!1},Variable:{enter(ee,fe,Le,Ct,Nt){const Zt=o(Nt);Zt&&Zt.variables.add(ee.name.value)}},FragmentSpread:{enter(ee,fe,Le,Ct,Nt){if(l(ee.directives))return f=!0,null;const Zt=o(Nt);Zt&&Zt.fragmentSpreads.add(ee.name.value)}},FragmentDefinition:{enter(ee,fe,Le,Ct){d.set(JSON.stringify(Ct),ee)},leave:(ee,fe,Le,Ct)=>ee===d.get(JSON.stringify(Ct))?ee:r>0&&ee.selectionSet.selections.every(Zt=>Zt.kind===pn.FIELD&&"__typename"===Zt.name.value)?(i(ee.name.value).removed=!0,f=!0,null):void 0},Directive:{leave(ee){if(s(ee))return f=!0,null}}});if(!f)return e;const A=ee=>(ee.transitiveVars||(ee.transitiveVars=new Set(ee.variables),ee.removed||ee.fragmentSpreads.forEach(fe=>{A(i(fe)).transitiveVars.forEach(Le=>{ee.transitiveVars.add(Le)})})),ee),T=new Set;v.definitions.forEach(ee=>{ee.kind===pn.OPERATION_DEFINITION?A(t(ee.name&&ee.name.value)).fragmentSpreads.forEach(fe=>{T.add(fe)}):ee.kind===pn.FRAGMENT_DEFINITION&&0===r&&!i(ee.name.value).removed&&T.add(ee.name.value)}),T.forEach(ee=>{A(i(ee)).fragmentSpreads.forEach(fe=>{T.add(fe)})});const Z={enter(ee){if((ee=>!(T.has(ee)&&!i(ee).removed))(ee.name.value))return null}};return function gTe(n){return XU(pd(n)||function rU(n){bn("Document"===n.kind,6),bn(n.definitions.length<=1,7);const e=n.definitions[0];return bn("FragmentDefinition"===e.kind,8),e}(n),F5(H5(n)))?null:n}(fu(v,{FragmentSpread:Z,FragmentDefinition:Z,OperationDefinition:{leave(ee){if(ee.variableDefinitions){const fe=A(t(ee.name&&ee.name.value)).transitiveVars;if(fe.size<ee.variableDefinitions.length)return{...ee,variableDefinitions:ee.variableDefinitions.filter(Le=>fe.has(Le.variable.name.value))}}}}}))}function KU(n){const e=new Map;return function(i=n){let o=e.get(i);return o||e.set(i,o={variables:new Set,fragmentSpreads:new Set}),o}}function XU(n,e){return!n||n.selectionSet.selections.every(t=>t.kind===pn.FRAGMENT_SPREAD&&XU(e[t.name.value],e))}var Ei=function(n){return n[n.loading=1]="loading",n[n.setVariables=2]="setVariables",n[n.fetchMore=3]="fetchMore",n[n.refetch=4]="refetch",n[n.poll=6]="poll",n[n.ready=7]="ready",n[n.error=8]="error",n[n.streaming=9]="streaming",n}(Ei||{});function qU(n){return n.catch(()=>{}),n}const{assign:QU}=Object,Uf={loading:!0,networkStatus:Ei.loading,data:void 0,dataState:"empty",partial:!0},Gw={loading:!1,networkStatus:Ei.ready,data:void 0,dataState:"empty",partial:!0};class Ww{options;queryName;variablesUnknown=!1;_lastWrite;get query(){return this.lastQuery}get variables(){return this.options.variables}unsubscribeFromCache;input;subject;isTornDown;queryManager;subscriptions=new Set;waitForNetworkResult;lastQuery;linkSubscription;pollingInfo;get networkStatus(){return this.subject.getValue().result.networkStatus}get cache(){return this.queryManager.cache}constructor({queryManager:e,options:t,transformedQuery:i=e.transform(t.query)}){this.queryManager=e,this.waitForNetworkResult="network-only"===t.fetchPolicy,this.isTornDown=!1,this.subscribeToMore=this.subscribeToMore.bind(this),this.maskResult=this.maskResult.bind(this);const{watchQuery:{fetchPolicy:o="cache-first"}={}}=e.defaultOptions,{fetchPolicy:r=o,initialFetchPolicy:s=("standby"===r?o:r)}=t;t[RAe]&&(bn("standby"===r,82),this.variablesUnknown=!0),this.lastQuery=i,this.options={...t,initialFetchPolicy:s,fetchPolicy:r,variables:this.getVariablesWithDefaults(t.variables)},this.initializeObservablesQueue(),this["@@observable"]=()=>this,Symbol.observable&&(this[Symbol.observable]=()=>this);const l=pd(this.query);this.queryName=l&&l.name&&l.name.value}initializeObservablesQueue(){this.subject=new Mr({query:this.query,variables:this.variables,result:Uf,meta:{}});const e=this.subject.pipe(u1({subscribe:()=>{this.subject.observed||(this.reobserve(),setTimeout(()=>this.updatePolling()))},unsubscribe:()=>{this.subject.observed||this.tearDownQuery()}}),jw(({query:t,variables:i,result:o,meta:r},s)=>{const{shouldEmit:l}=r;if(o===Uf&&(s.previous=void 0,s.previousVariables=void 0),"standby"===this.options.fetchPolicy||2===l)return;if(1===l)return m();const{previous:d,previousVariables:f}=s;if(d){const v=this.queryManager.getDocumentInfo(t),A=this.queryManager.dataMasking;if((A||v.hasNonreactiveDirective?aU(A?v.nonReactiveQuery:t,d,o,i):sr(d,o))&&sr(f,i))return}if(3!==l||this.options.notifyOnNetworkStatusChange&&!sr(d,o))return m();function m(){return s.previous=o,s.previousVariables=i,o}},()=>({})));this.pipe=e.pipe.bind(e),this.subscribe=e.subscribe.bind(e),this.input=new Wn,this.input.complete=()=>{},this.input.pipe(this.operator).subscribe(this.subject)}subscribe;pipe;[Symbol.observable];"@@observable";getCacheDiff({optimistic:e=!0}={}){return this.cache.diff({query:this.query,variables:this.variables,returnPartialData:!0,optimistic:e})}getInitialResult(e){let t=e||this.options.fetchPolicy;this.queryManager.prioritizeCacheValues&&("network-only"===t||"cache-and-network"===t)&&(t="cache-first");const i=()=>{const o=this.getCacheDiff(),r=this.options.returnPartialData||o.complete?o.result??void 0:void 0;return this.maskResult({data:r,dataState:o.complete?"complete":void 0===r?"empty":"partial",loading:!o.complete,networkStatus:o.complete?Ei.ready:Ei.loading,partial:!o.complete})};switch(t){case"cache-only":return{...i(),loading:!1,networkStatus:Ei.ready};case"cache-first":return i();case"cache-and-network":return{...i(),loading:!0,networkStatus:Ei.loading};case"standby":return Gw;default:return Uf}}resubscribeCache(){const{variables:e,fetchPolicy:t}=this.options,i=this.query,o="standby"===t||"no-cache"===t||this.waitForNetworkResult,r=!K5({query:i,variables:e},this.unsubscribeFromCache)&&!this.waitForNetworkResult;if((o||r)&&this.unsubscribeFromCache?.(),o||!r)return;const s={query:i,variables:e,optimistic:!0,watcher:this,callback:d=>{const f=this.queryManager.getDocumentInfo(i);if((f.hasClientExports||f.hasForcedResolvers)&&(s.lastDiff=void 0),s.lastOwnDiff===d)return;const{result:m}=this.subject.getValue();!d.complete&&(m.error||m===Uf||m===Gw)||sr(m.data,d.result)||this.scheduleNotify()}},l=this.cache.watch(s);this.unsubscribeFromCache=Object.assign(()=>{this.unsubscribeFromCache=void 0,l()},{query:i,variables:e})}stableLastResult;getCurrentResult(){const{result:e}=this.subject.getValue();let t=e.networkStatus===Ei.error||this.hasObservers()||"no-cache"===this.options.fetchPolicy?e:this.getInitialResult();return t===Uf&&(t=this.getInitialResult()),sr(this.stableLastResult,t)||(this.stableLastResult=t),this.stableLastResult}refetch(e){const{fetchPolicy:t}=this.options,i={pollInterval:0};return i.fetchPolicy="no-cache"===t?"no-cache":"network-only",e&&!sr(this.variables,e)&&(i.variables=this.options.variables=this.getVariablesWithDefaults({...this.variables,...e})),this._lastWrite=void 0,this._reobserve(i,{newNetworkStatus:Ei.refetch})}fetchMore({query:e,variables:t,context:i,errorPolicy:o,updateQuery:r}){bn("cache-only"!==this.options.fetchPolicy,84,vl(this.query,"(anonymous)"));const s={...b1(this.options,{errorPolicy:"none"},{query:e,context:i,errorPolicy:o}),variables:e?t:{...this.variables,...t},fetchPolicy:"no-cache",notifyOnNetworkStatusChange:this.options.notifyOnNetworkStatusChange};s.query=this.transformDocument(s.query),this.lastQuery=e?this.transformDocument(this.options.query):s.query;let l=!1;const d="no-cache"!==this.options.fetchPolicy;d||bn(r,85);const{finalize:f,pushNotification:m}=this.pushOperation(Ei.fetchMore);m({source:"newNetworkStatus",kind:"N",value:{}},{shouldEmit:3});const{promise:v,operator:A}=JU(),{observable:T}=this.queryManager.fetchObservableWithInfo(s,{networkStatus:Ei.fetchMore,exposeExtensions:!0}),k=T.pipe(A,Y3(Z=>"N"===Z.kind&&"network"===Z.source)).subscribe({next:Z=>{l=!1;const ee=Z.value,fe=ee[bU];if(YU(Z.value.networkStatus)&&f(),d){const Le=this.getCacheDiff();this.cache.batch({update:Ct=>{r?Ct.updateQuery({query:this.query,variables:this.variables,returnPartialData:!0,optimistic:!1,extensions:fe},Nt=>r(Nt,{fetchMoreResult:ee.data,variables:s.variables})):Ct.writeQuery({query:s.query,variables:s.variables,data:ee.data,extensions:fe})},onWatchUpdated:(Ct,Nt)=>{if(Ct.watcher===this&&!sr(Nt.result,Le.result)){l=!0;const Zt=this.getCurrentResult();Q7(ee.networkStatus)&&m({kind:"N",source:"network",value:{...Zt,networkStatus:ee.networkStatus===Ei.error?Ei.ready:ee.networkStatus,loading:!1,data:Nt.result,dataState:"streaming"===ee.dataState?"streaming":"complete"}})}}})}else{const Le=this.getCurrentResult(),Ct=r(Le.data,{fetchMoreResult:ee.data,variables:s.variables});m({kind:"N",value:{...Le,networkStatus:Ei.ready,loading:!1,data:Ct,dataState:"streaming"===Le.dataState?"streaming":"complete"},source:"network"})}}});return qU(v.then(Z=>Y5(this.maskResult(Z))).finally(()=>{if(k.unsubscribe(),f(),d&&!l){const Z=this.getCurrentResult();"streaming"===Z.dataState?m({kind:"N",source:"network",value:{...Z,dataState:"complete",networkStatus:Ei.ready}}):m({kind:"N",source:"newNetworkStatus",value:{}},{shouldEmit:1})}}))}subscribeToMore(e){const t=this.queryManager.startGraphQLSubscription({query:e.document,variables:e.variables,context:e.context}).subscribe({next:i=>{const{updateQuery:o,onError:r}=e,{error:s}=i;s?r?r(s):bn.error(86,s):o&&this.updateQuery((l,d)=>o(l,{subscriptionData:i,...d}))}});return this.subscriptions.add(t),()=>{this.subscriptions.delete(t)&&t.unsubscribe()}}applyOptions(e){const t=b1(this.options,e||{});QU(this.options,t),this.updatePolling()}setVariables(e){var t=this;return(0,N.A)(function*(){return e=t.getVariablesWithDefaults(e),sr(t.variables,e)||(t.options.variables=e,!t.hasObservers())?Y5(t.getCurrentResult()):t._reobserve({fetchPolicy:t.options.initialFetchPolicy,variables:e},{newNetworkStatus:Ei.setVariables})})()}updateQuery(e){const{queryManager:t}=this,{result:i,complete:o}=this.getCacheDiff({optimistic:!1}),r=e(i,{variables:this.variables,complete:!!o,previousData:i});r&&(this.cache.writeQuery({query:this.options.query,data:r,variables:this.variables}),t.broadcastQueries())}startPolling(e){this.options.pollInterval=e,this.updatePolling()}stopPolling(){this.options.pollInterval=0,this.updatePolling()}applyNextFetchPolicy(e,t){if(t.nextFetchPolicy){const{fetchPolicy:i="cache-first",initialFetchPolicy:o=i}=t;"standby"===i||(t.fetchPolicy="function"==typeof t.nextFetchPolicy?t.nextFetchPolicy.call(t,i,{reason:e,options:t,observable:this,initialFetchPolicy:o}):"variables-changed"===e?o:t.nextFetchPolicy)}return t.fetchPolicy}fetch(e,t,i,o){const r=this.options.fetchPolicy;e.context??={};let s=!1,{observable:f,fromLink:m}=this.queryManager.fetchObservableWithInfo(e,{networkStatus:t,query:i,onCacheHit:()=>{s=!0},fetchQueryOperator:ee=>new wn(fe=>{try{return ee.subscribe({next(Le){s=!0,fe.next(Le)},error:Le=>fe.error(Le),complete:()=>fe.complete()})}finally{s||(T.override=t,this.input.next({kind:"N",source:"newNetworkStatus",value:{resetError:!0},query:v,variables:A,meta:{shouldEmit:3,fetchPolicy:r}}))}}),observableQuery:this});const{query:v,variables:A}=this,T={abort:()=>{Z.unsubscribe()},query:v,variables:A};this.activeOperations.add(T);let k=t==Ei.refetch||t==Ei.setVariables;f=f.pipe(o,P5());const Z=f.pipe(u1({next:ee=>{"newNetworkStatus"===ee.source||"N"===ee.kind&&ee.value.loading?T.override=t:delete T.override},finalize:()=>this.activeOperations.delete(T)})).subscribe({next:ee=>{const fe={};k&&"N"===ee.kind&&"loading"in ee.value&&!ee.value.loading&&(k=!1,fe.shouldEmit=1),this.input.next({...ee,query:v,variables:A,meta:fe})}});return{fromLink:m,subscription:Z,observable:f}}didWarnCacheOnlyPolling=!1;updatePolling(){if(this.queryManager.ssrMode)return;const{pollingInfo:e,options:{pollInterval:i}}=this,o=()=>{const{options:d}=this;return!d.pollInterval||!this.hasObservers()||"cache-only"===d.fetchPolicy||"standby"===d.fetchPolicy};if(o())return void this.cancelPolling();if(e?.interval===i)return;(e||(this.pollingInfo={})).interval=i;const s=()=>{if(o())return this.cancelPolling();this.pollingInfo&&(Q7(this.networkStatus)||this.options.skipPollAttempt?.()?l():this._reobserve({fetchPolicy:"no-cache"===this.options.initialFetchPolicy?"no-cache":"network-only"},{newNetworkStatus:Ei.poll}).then(l,l))},l=()=>{const d=this.pollingInfo;d&&(clearTimeout(d.timeout),d.timeout=setTimeout(s,d.interval))};l()}cancelPolling(){this.pollingInfo&&(clearTimeout(this.pollingInfo.timeout),delete this.pollingInfo)}reobserve(e){return this._reobserve(e)}_reobserve(e,t){this.isTornDown=!1;let{newNetworkStatus:i}=t||{};this.queryManager.obsQueries.add(this);const o=i===Ei.refetch||i===Ei.poll,r=this.variables,s=this.options.fetchPolicy,l=b1(this.options,e||{});this.variablesUnknown&&="standby"===l.fetchPolicy;const d=o?l:QU(this.options,l),f=this.transformDocument(d.query);this.lastQuery=f,e&&"variables"in e&&(d.variables=this.getVariablesWithDefaults(e.variables)),o||(this.updatePolling(),e&&e.variables&&!sr(e.variables,r)&&"standby"!==d.fetchPolicy&&(d.fetchPolicy===s||"function"==typeof d.nextFetchPolicy)&&(this.applyNextFetchPolicy("variables-changed",d),void 0===i&&(i=Ei.setVariables))),i||(i=Ei.loading,this.networkStatus!==Ei.loading&&e?.variables&&!sr(e.variables,r)&&(i=Ei.setVariables),"standby"===d.fetchPolicy&&(i=Ei.ready)),"standby"===d.fetchPolicy&&this.cancelPolling(),this.resubscribeCache();const{promise:v,operator:A}=JU("standby"===d.fetchPolicy?{data:void 0}:void 0),{subscription:T,observable:k,fromLink:Z}=this.fetch(d,i,f,A);!o&&(Z||!this.linkSubscription)&&(this.linkSubscription&&this.linkSubscription.unsubscribe(),this.linkSubscription=T);const ee=Object.assign(qU(v.then(fe=>Y5(this.maskResult(fe))).finally(()=>{!this.hasObservers()&&0===this.activeOperations.size&&this.tearDownQuery()})),{retain:()=>{const fe=k.subscribe({}),Le=()=>fe.unsubscribe();return v.then(Le,Le),ee}});return ee}hasObservers(){return this.subject.observed}stop(){this.subject.complete(),this.initializeObservablesQueue(),this.tearDownQuery()}tearDownQuery(){this.isTornDown||(this.resetNotifications(),this.unsubscribeFromCache?.(),this.linkSubscription&&(this.linkSubscription.unsubscribe(),delete this.linkSubscription),this.stopPolling(),this.subscriptions.forEach(e=>e.unsubscribe()),this.subscriptions.clear(),this.queryManager.obsQueries.delete(this),this.isTornDown=!0,this.abortActiveOperations(),this._lastWrite=void 0)}transformDocument(e){return this.queryManager.transform(e)}maskResult(e){const t=this.queryManager.maskOperation({document:this.query,data:e.data,fetchPolicy:this.options.fetchPolicy,cause:this});return t===e.data?e:{...e,data:t}}dirty=!1;notifyTimeout;resetNotifications(){this.notifyTimeout&&(clearTimeout(this.notifyTimeout),this.notifyTimeout=void 0),this.dirty=!1}scheduleNotify(){this.dirty||(this.dirty=!0,this.notifyTimeout||(this.notifyTimeout=setTimeout(()=>this.notify(!0),0)))}notify(e=!1){if(!e){const i=this.queryManager.getDocumentInfo(this.query);if(i.hasClientExports||i.hasForcedResolvers)return}const{dirty:t}=this;if(this.resetNotifications(),t&&("cache-only"===this.options.fetchPolicy||"cache-and-network"===this.options.fetchPolicy||!this.activeOperations.size)){const i=this.getCacheDiff();sr(i.result,this.getCacheDiff({optimistic:!1}).result)?this.reobserveCacheFirst():this.input.next({kind:"N",value:{data:i.result,dataState:i.complete?"complete":i.result?"partial":"empty",networkStatus:Ei.ready,loading:!1,error:void 0,partial:!i.complete},source:"cache",query:this.query,variables:this.variables,meta:{}})}}activeOperations=new Set;pushOperation(e){let t=!1;const{query:i,variables:o}=this,r=()=>{this.activeOperations.delete(s)},s={override:e,abort:()=>{t=!0,r()},query:i,variables:o};return this.activeOperations.add(s),{finalize:r,pushNotification:(l,d)=>{t||this.input.next({...l,query:i,variables:o,meta:{...d}})}}}calculateNetworkStatus(e){return e===Ei.streaming?e:Array.from(this.activeOperations.values()).reverse().find(i=>K5(i,this)&&void 0!==i.override)?.override??e}abortActiveOperations(){this.activeOperations.forEach(e=>e.abort())}reset(){const e="cache-only"===this.options.fetchPolicy;this.setResult(e?Gw:Uf,{shouldEmit:e?1:2}),this.abortActiveOperations()}setResult(e,t){this.input.next({source:"setResult",kind:"N",value:e,query:this.query,variables:this.variables,meta:{...t}})}operator=jw(e=>{const{query:t,variables:i,meta:o}=e;if("setResult"===e.source)return{query:t,variables:i,result:e.value,meta:o};if("C"===e.kind||!K5(e,this))return;let r;const s=this.subject.getValue();if("cache"===e.source){if(r=e.value,r.networkStatus===Ei.ready&&r.partial&&(!this.options.returnPartialData||s.result.networkStatus===Ei.error)&&"cache-only"!==this.options.fetchPolicy)return}else if("network"===e.source)this.waitForNetworkResult&&(this.waitForNetworkResult=!1,this.resubscribeCache()),r="E"===e.kind?{...K5(s,e)?s.result:{data:void 0,dataState:"empty",partial:!0},error:e.error,networkStatus:Ei.error,loading:!1}:e.value,"E"===e.kind&&"streaming"===r.dataState&&(r.dataState="complete"),r.error&&(o.shouldEmit=1);else if("newNetworkStatus"===e.source){const l=K5(s,e)?s.result:this.getInitialResult(o.fetchPolicy),{resetError:d}=e.value,f=d?void 0:l.error,m=f?Ei.error:Ei.ready;r={...l,error:f,networkStatus:m}}return bn(r),r.error||delete r.error,r.networkStatus=this.calculateNetworkStatus(r.networkStatus),r.loading=Q7(r.networkStatus),r=this.maskResult(r),void 0!==s.result.data&&r.data!==s.result.data&&sr(r.data,s.result.data)&&(r.data=s.result.data),{query:t,variables:i,result:r,meta:o}});reobserveCacheFirst(){const{fetchPolicy:e,nextFetchPolicy:t}=this.options;"cache-and-network"===e||"network-only"===e?this.reobserve({fetchPolicy:"cache-first",nextFetchPolicy(i,o){return this.nextFetchPolicy=t,"function"==typeof this.nextFetchPolicy?this.nextFetchPolicy(i,o):e}}):this.reobserve()}getVariablesWithDefaults(e){return this.queryManager.getVariables(this.query,e)}}function K5(n,e){return!!(n&&e&&n.query===e.query&&sr(n.variables,e.variables))}function JU(n){let t,i,e=n;return{promise:new Promise((s,l)=>{t=s,i=l}),operator:u1({next(s){if("E"===s.kind)return i(s.error);"N"===s.kind&&"newNetworkStatus"!==s.source&&!s.value.loading&&(e=s.value)},finalize:()=>{if(e)t(e);else{const s="The operation was aborted.",l="AbortError";i(typeof DOMException<"u"?new DOMException(s,l):Object.assign(new Error(s),{name:l}))}}})}}const ez={},zf=new WeakMap;function $w(n,e){const t=n[e];"function"==typeof t&&(n[e]=function(){return zf.set(n,(zf.get(n)+1)%1e15),t.apply(this,arguments)})}const tz=new WeakMap;class Zw{cache;queryManager;id;observableQuery;incremental;constructor(e,t){const i=this.cache=e.cache,o=(tz.get(e)||0)+1;tz.set(e,o),this.id=o+"",this.observableQuery=t,this.queryManager=e,zf.has(i)||(zf.set(i,0),$w(i,"evict"),$w(i,"modify"),$w(i,"reset"))}_lastWrite;get lastWrite(){return(this.observableQuery||this)._lastWrite}set lastWrite(e){(this.observableQuery||this)._lastWrite=e}resetLastWrite(){this.lastWrite=void 0}shouldWrite(e,t){const{lastWrite:i}=this;return!(i&&i.dmCount===zf.get(this.cache)&&sr(t,i.variables)&&sr(e.data,i.result.data)&&e.extensions?.[Wh]===i.result.extensions?.[Wh])}get hasNext(){return!!this.incremental&&this.incremental.hasNext}maybeHandleIncrementalResult(e,t,i){const{incrementalHandler:o}=this.queryManager;return o.isIncrementalResult(t)?(this.incremental||=o.startRequest({query:i}),this.incremental.handle(e,t)):t}markQueryResult(e,{document:t,variables:i,errorPolicy:o,cacheWriteBehavior:r}){const s={query:t,variables:i,returnPartialData:!0,optimistic:!0};this.observableQuery?.resetNotifications();const l=0===r,d=l?void 0:this.cache.diff(s);let f=this.maybeHandleIncrementalResult(d?.result,e,t);return l||(Yw(f,o)?this.cache.batch({onWatchUpdated:(m,v)=>{m.watcher===this.observableQuery&&(m.lastOwnDiff=v)},update:m=>{if(this.shouldWrite(f,i))m.writeQuery({query:t,data:f.data,variables:i,overwrite:1===r,extensions:f.extensions}),this.lastWrite={result:f,variables:i,dmCount:zf.get(this.cache)};else if(d&&d.complete)return void(f={...f,data:d.result});const v=m.diff(s);v.complete&&(f={...f,data:v.result})}}):this.lastWrite=void 0),f}markMutationResult(e,t,i=this.cache){const o=[],r=0===t.cacheWriteBehavior;let s=this.maybeHandleIncrementalResult(r?void 0:i.diff({id:"ROOT_MUTATION",query:this.queryManager.getDocumentInfo(t.document).asQuery,variables:t.variables,optimistic:!1,returnPartialData:!0}).result,e,t.document);if("ignore"===t.errorPolicy&&(s={...s,errors:[]}),Hf(s)&&"none"===t.errorPolicy)return Promise.resolve(s);const l=()=>({...s,dataState:this.hasNext?"streaming":"complete"});if(!r&&Yw(s,t.errorPolicy)){o.push({result:s.data,dataId:"ROOT_MUTATION",query:t.document,variables:t.variables,extensions:s.extensions});const{updateQueries:f}=t;f&&this.queryManager.getObservableQueries("all").forEach(m=>{const v=m&&m.queryName;if(!v||!Object.hasOwnProperty.call(f,v))return;const A=f[v],{query:T,variables:k}=m,{result:Z,complete:ee}=m.getCacheDiff({optimistic:!1});if(ee&&Z){const fe=A(Z,{mutationResult:l(),queryName:T&&vl(T)||void 0,queryVariables:k});fe&&o.push({result:fe,dataId:"ROOT_QUERY",query:T,variables:k})}})}let d=t.refetchQueries;if("function"==typeof d&&(d=d(l())),o.length>0||(d||"").length>0||t.update||t.onQueryUpdated||t.removeOptimistic){const f=[];if(this.queryManager.refetchQueries({updateCache:m=>{r||o.forEach(A=>m.write(A));const{update:v}=t;if(v){if(!r){const A=m.diff({id:"ROOT_MUTATION",query:this.queryManager.getDocumentInfo(t.document).asQuery,variables:t.variables,optimistic:!1,returnPartialData:!0});A.complete&&(s={...s,data:A.result})}this.hasNext||v(m,s,{context:t.context,variables:t.variables})}!r&&!t.keepRootFields&&!this.hasNext&&m.modify({id:"ROOT_MUTATION",fields:(A,{fieldName:T,DELETE:k})=>"__typename"===T?A:k})},include:d,optimistic:!1,removeOptimistic:t.removeOptimistic,onQueryUpdated:t.onQueryUpdated||null}).forEach(m=>f.push(m)),t.awaitRefetchQueries||t.onQueryUpdated)return Promise.all(f).then(()=>s)}return Promise.resolve(s)}markMutationOptimistic(e,t){const i="function"==typeof e?e(t.variables,{IGNORE:ez}):e;return i!==ez&&(this.cache.recordOptimisticTransaction(o=>{try{this.markMutationResult({data:i},t,o)}catch(r){bn.error(r)}},this.id),!0)}markSubscriptionResult(e,{document:t,variables:i,errorPolicy:o,cacheWriteBehavior:r}){0!==r&&(Yw(e,o)&&this.cache.write({query:t,result:e.data,dataId:"ROOT_SUBSCRIPTION",variables:i,extensions:e.extensions}),this.queryManager.broadcastQueries())}}function Yw(n,e="none"){const t="ignore"===e||"all"===e;let i=!Hf(n);return!i&&t&&n.data&&(i=!0),i}class CTe{defaultOptions;client;clientOptions;assumeImmutableResults;documentTransform;ssrMode;defaultContext;dataMasking;incrementalHandler;localState;queryDeduplication;prioritizeCacheValues=!1;onBroadcast;mutationStore;obsQueries=new Set;fetchCancelFns=new Map;constructor(e){const t=new fd(o=>this.cache.transformDocument(o),{cache:!1});this.client=e.client,this.defaultOptions=e.defaultOptions,this.queryDeduplication=e.queryDeduplication,this.clientOptions=e.clientOptions,this.ssrMode=e.ssrMode,this.assumeImmutableResults=e.assumeImmutableResults,this.dataMasking=e.dataMasking,this.localState=e.localState,this.incrementalHandler=e.incrementalHandler;const i=e.documentTransform;this.documentTransform=i?t.concat(i).concat(t):t,this.defaultContext=e.defaultContext||{},(this.onBroadcast=e.onBroadcast)&&(this.mutationStore={})}get link(){return this.client.link}get cache(){return this.client.cache}stop(){this.obsQueries.forEach(e=>e.stop()),this.cancelPendingFetches(bl(89))}cancelPendingFetches(e){this.fetchCancelFns.forEach(t=>t(e)),this.fetchCancelFns.clear()}mutate(e){var t=this;return(0,N.A)(function*({mutation:i,variables:o,optimisticResponse:r,updateQueries:s,refetchQueries:l=[],awaitRefetchQueries:d=!1,update:f,onQueryUpdated:m,fetchPolicy:v,errorPolicy:A,keepRootFields:T,context:k}){const Z=new Zw(t);i=t.cache.transformForLink(t.transform(i));const{hasClientExports:ee}=t.getDocumentInfo(i);o=t.getVariables(i,o),ee&&(o=yield t.localState.getExportedVariables({client:t.client,document:i,variables:o,context:k}));const fe=t.mutationStore&&(t.mutationStore[Z.id]={mutation:i,variables:o,loading:!0,error:null}),Le=r&&Z.markMutationOptimistic(r,{document:i,variables:o,cacheWriteBehavior:"no-cache"===v?0:2,errorPolicy:A,context:k,updateQueries:s,update:f,keepRootFields:T});return t.broadcastQueries(),new Promise((Ct,Nt)=>{const Zt={};return t.getObservableFromLink(i,{...k,optimisticResponse:Le?r:void 0},o,v,{},!1).observable.pipe(nz(),Mh(Zn=>{const Ri={...Zn};return tu(Z.markMutationResult(Ri,{document:i,variables:o,cacheWriteBehavior:"no-cache"===v?0:2,errorPolicy:A,context:k,update:f,updateQueries:s,awaitRefetchQueries:d,refetchQueries:l,removeOptimistic:Le?Z.id:void 0,onQueryUpdated:m,keepRootFields:T}))})).pipe(mo(Zn=>{if(Hf(Zn)&&"none"===A)throw new $5(Kw(Zn));return fe&&(fe.loading=!1,fe.error=null),Zn})).subscribe({next:Zn=>{if(t.broadcastQueries(),!Z.hasNext){const Ri={data:t.maskOperation({document:i,data:Zn.data,fetchPolicy:v,cause:Zt})};Hf(Zn)&&(Ri.error=new $5(Zn)),Object.keys(Zn.extensions||{}).length&&(Ri.extensions=Zn.extensions),Ct(Ri)}},error:Zn=>(fe&&(fe.loading=!1,fe.error=Zn),Le&&t.cache.removeOptimistic(Z.id),t.broadcastQueries(),"ignore"===A?Ct({data:void 0}):"all"===A?Ct({data:void 0,error:Zn}):void Nt(Zn))})})}).apply(this,arguments)}fetchQuery(e,t){var i=this;return zh(e.query,pu.QUERY),(0,N.A)(function*(){return m5(i.fetchObservableWithInfo(e,{networkStatus:t}).observable.pipe(jw(o=>{switch(o.kind){case"E":throw o.error;case"N":if("newNetworkStatus"!==o.source)return Y5(o.value)}})),{defaultValue:{data:void 0}})})()}transform(e){return this.documentTransform.transformDocument(e)}transformCache=new rw(_d["queryManager.getDocumentInfo"]||2e3);getDocumentInfo(e){const{transformCache:t}=this;if(!t.has(e)){const o=pd(e),r={hasClientExports:G5(["client","export"],e,!0),hasForcedResolvers:_Te(e),hasNonreactiveDirective:G5(["nonreactive"],e),hasIncrementalDirective:G5(["defer"],e),nonReactiveQuery:wTe(e),clientQuery:G5(["client"],e)?e:null,serverQuery:pTe([{name:"client",remove:!0},{name:"connection"},{name:"nonreactive"},{name:"unmask"}],e),operationType:o?.operation,defaultVars:Mw(o),asQuery:{...e,definitions:e.definitions.map(s=>"OperationDefinition"===s.kind&&"query"!==s.operation?{...s,operation:"query"}:s)}};t.set(e,r)}const i=t.get(e);if(i.violation)throw i.violation;return i}getVariables(e,t){const i=this.getDocumentInfo(e).defaultVars,o=Object.entries(t??{}).map(([r,s])=>[r,void 0===s?i[r]:s]);return{...i,...Object.fromEntries(o)}}watchQuery(e){zh(e.query,pu.QUERY);const t=this.transform(e.query);return typeof(e={...e,variables:this.getVariables(t,e.variables)}).notifyOnNetworkStatusChange>"u"&&(e.notifyOnNetworkStatusChange=!0),new Ww({queryManager:this,options:e,transformedQuery:t})}query(e){const t=this.transform(e.query);return this.fetchQuery({...e,query:t}).then(i=>({...i,data:this.maskOperation({document:t,data:i?.data,fetchPolicy:e.fetchPolicy})}))}clearStore(e={discardWatches:!0}){return this.cancelPendingFetches(bl(91)),this.obsQueries.forEach(t=>{t.reset()}),this.mutationStore&&(this.mutationStore={}),this.cache.reset(e)}getObservableQueries(e="active"){const t=new Set,i=new Map,o=new Map,r=new Set;return Array.isArray(e)&&e.forEach(s=>{if("string"==typeof s)i.set(s,s),o.set(s,!1);else if(function mTe(n){return Xs(n)&&"Document"===n.kind&&Array.isArray(n.definitions)}(s)){const l=B5(this.transform(s));i.set(l,vl(s)),o.set(l,!1)}else Xs(s)&&s.query&&r.add(s)}),this.obsQueries.forEach(s=>{const l=B5(this.transform(s.options.query));if("all"===e)return void t.add(s);const{queryName:d,options:{fetchPolicy:f}}=s;"active"===e&&"standby"===f||("active"===e||d&&o.has(d)||l&&o.has(l))&&(t.add(s),d&&o.set(d,!0),l&&o.set(l,!0))}),r.size&&r.forEach(s=>{const l=new Ww({queryManager:this,options:{...q7(this.defaultOptions.watchQuery,s),fetchPolicy:"network-only"}});t.add(l)}),t}refetchObservableQueries(e=!1){const t=[];return this.getObservableQueries(e?"all":"active").forEach(i=>{const{fetchPolicy:o}=i.options;(e||"standby"!==o)&&"cache-only"!==o&&t.push(i.refetch())}),this.broadcastQueries(),Promise.all(t)}startGraphQLSubscription(e){let{query:t,variables:i}=e;const{fetchPolicy:o="cache-first",errorPolicy:r="none",context:s={},extensions:l={}}=e;let d;zh(t,pu.SUBSCRIPTION),t=this.transform(t),i=this.getVariables(t,i);const f=(this.getDocumentInfo(t).hasClientExports?tu(this.localState.getExportedVariables({client:this.client,document:t,variables:i,context:s})):au(i)).pipe(Mh(m=>{const{observable:v,restart:A}=this.getObservableFromLink(t,s,m,o,l),T=new Zw(this);return d=A,v.pipe(mo(k=>{T.markSubscriptionResult(k,{document:t,variables:m,errorPolicy:r,cacheWriteBehavior:"no-cache"===o?0:2});const Z={data:k.data??void 0};return Hf(k)?Z.error=new $5(k):function sTe(n){return"extensions"in n&&oTe.is(n.extensions[Vw])}(k)&&(Z.error=k.extensions[Vw],delete k.extensions[Vw]),k.extensions&&Object.keys(k.extensions).length&&(Z.extensions=k.extensions),Z.error&&"none"===r&&(Z.data=void 0),"ignore"===r&&delete Z.error,Z}),md(k=>au("ignore"===r?{data:void 0}:{data:void 0,error:k})),Y3(k=>!(!k.data&&!k.error)))}));return Object.assign(f,{restart:()=>d?.()})}broadcastQueries(){this.onBroadcast&&this.onBroadcast(),this.obsQueries.forEach(e=>e.notify())}inFlightLinkObservables=new gu(!1);getObservableFromLink(e,t,i,o,r,s=t?.queryDeduplication??this.queryDeduplication){let l={};const{serverQuery:d,clientQuery:f,operationType:m,hasIncrementalDirective:v}=this.getDocumentInfo(e),A=vl(e),T={client:this.client};if(d){const{inFlightLinkObservables:k,link:Z}=this;try{let fe=function(Le){return new wn(Ct=>{function Nt(){return Le.subscribe({next:Ct.next.bind(Ct),complete:Ct.complete.bind(Ct),error:Ct.error.bind(Ct)})}let Zt=Nt();return l.restart||=()=>{Zt.unsubscribe(),Zt=Nt()},()=>{Zt.unsubscribe(),l.restart=void 0}})};const ee=this.incrementalHandler.prepareRequest({query:d,variables:i,context:{...this.defaultContext,...t,queryDeduplication:s},extensions:r});if(t=ee.context,s){const Le=B5(d),Ct=gd(i);l=k.lookup(Le,Ct),l.observable||(l.observable=Fw(Z,ee,T).pipe(fe,cy(()=>{k.peek(Le,Ct)===l&&k.remove(Le,Ct)}),m===pu.SUBSCRIPTION?P5():j7({refCount:!0})))}else l.observable=Fw(Z,ee,T).pipe(fe)}catch(ee){l.observable=$h(()=>ee)}}else l.observable=au({data:{}});if(f){const{operation:k}=pd(e);bn(!v,96,k[0].toUpperCase()+k.slice(1),A??"(anonymous)"),l.observable=l.observable.pipe(Mh(Z=>tu(this.localState.execute({client:this.client,document:f,remoteResult:Z,context:t,variables:i,fetchPolicy:o}))))}return{restart:()=>l.restart?.(),observable:l.observable.pipe(md(k=>{throw k=function aTe(n){return function rTe(n){return null!==n&&"object"==typeof n&&"string"==typeof n.message&&"string"==typeof n.name&&("string"==typeof n.stack||typeof n.stack>"u")}(n)?n:"string"==typeof n?new Error(n,{cause:n}):new zw(n)}(k),function lTe(n){$U.add(n)}(k),k}))}}getResultsFromLink(e,{queryInfo:t,cacheWriteBehavior:i,observableQuery:o,exposeExtensions:r}){const{errorPolicy:s}=e,l=this.cache.transformForLink(e.query);return this.getObservableFromLink(l,e.context,e.variables,e.fetchPolicy).observable.pipe(mo(d=>{const f=t.markQueryResult(d,{...e,document:l,cacheWriteBehavior:i}),m=Hf(f);if(m&&"none"===s)throw t.resetLastWrite(),o?.resetNotifications(),new $5(Kw(f));const v={data:f.data,...t.hasNext?{loading:!0,networkStatus:Ei.streaming,dataState:"streaming",partial:!0}:{dataState:f.data?"complete":"empty",loading:!1,networkStatus:Ei.ready,partial:!f.data}};return r&&"extensions"in f&&(v[bU]=f.extensions),m&&("none"===s&&(v.data=void 0,v.dataState="empty"),"ignore"!==s&&(v.error=new $5(Kw(f)),"streaming"!==v.dataState&&(v.networkStatus=Ei.error))),v}),md(d=>{if("none"===s)throw t.resetLastWrite(),o?.resetNotifications(),d;const f={data:void 0,dataState:"empty",loading:!1,networkStatus:Ei.ready,partial:!0};return"ignore"!==s&&(f.error=d,f.networkStatus=Ei.error),au(f)}))}fetchObservableWithInfo(e,{networkStatus:t=Ei.loading,query:i=e.query,fetchQueryOperator:o=d=>d,onCacheHit:r=()=>{},observableQuery:s,exposeExtensions:l}){const d=this.getVariables(i,e.variables);let{fetchPolicy:f="cache-first",errorPolicy:m="none",returnPartialData:v=!1,notifyOnNetworkStatusChange:A=!0,context:T={}}=e;this.prioritizeCacheValues&&("network-only"===f||"cache-and-network"===f)&&(f="cache-first");const k=Object.assign({},e,{query:i,variables:d,fetchPolicy:f,errorPolicy:m,returnPartialData:v,notifyOnNetworkStatusChange:A,context:T}),Z=new Zw(this,s),ee=Zt=>{k.variables=Zt;const Ri=this.fetchQueryByPolicy(k,{queryInfo:Z,cacheWriteBehavior:"no-cache"===f?0:t===Ei.refetch&&"merge"!==k.refetchWritePolicy?1:2,onCacheHit:r,observableQuery:s,exposeExtensions:l});return Ri.observable=Ri.observable.pipe(o),"standby"!==k.fetchPolicy&&s?.applyNextFetchPolicy("after-fetch",e),Ri},fe=()=>{this.fetchCancelFns.delete(Z.id)};this.fetchCancelFns.set(Z.id,Zt=>{Le.next({kind:"E",error:Zt,source:"network"})});const Le=new Wn;let Ct,Nt;if(this.getDocumentInfo(k.query).hasClientExports)Ct=tu(this.localState.getExportedVariables({client:this.client,document:k.query,variables:k.variables,context:k.context})).pipe(Mh(Zt=>ee(Zt).observable)),Nt=!0;else{const Zt=ee(k.variables);Nt=Zt.fromLink,Ct=Zt.observable}return{observable:new wn(Zt=>{Zt.add(fe),Ct.subscribe(Zt),Le.subscribe(Zt)}).pipe(P5()),fromLink:Nt}}refetchQueries({updateCache:e,include:t,optimistic:i=!1,removeOptimistic:o=(i?wH("refetchQueries"):void 0),onQueryUpdated:r}){const s=new Map;t&&this.getObservableQueries(t).forEach(d=>{if("cache-only"===d.options.fetchPolicy||d.variablesUnknown)return;const f=d.getCurrentResult();s.set(d,{oq:d,lastDiff:{result:f?.data,complete:!f?.partial}})});const l=new Map;if(e){const d=new Set;this.cache.batch({update:e,optimistic:i&&o||!1,removeOptimistic:o,onWatchUpdated(f,m,v){const A=f.watcher;if(A instanceof Ww&&!d.has(A)){if(d.add(A),r){s.delete(A);let T=r(A,m,v);return!0===T&&(T=A.refetch().retain()),!1!==T&&l.set(A,T),T}null!==r&&"cache-only"!==A.options.fetchPolicy&&s.set(A,{oq:A,lastDiff:v,diff:m})}}})}return s.size&&s.forEach(({oq:d,lastDiff:f,diff:m})=>{let v;r&&(m||(m=d.getCacheDiff()),v=r(d,m,f)),(!r||!0===v)&&(v=d.refetch().retain()),!1!==v&&l.set(d,v)}),o&&this.cache.removeOptimistic(o),l}noCacheWarningsByCause=new WeakSet;maskOperation(e){const{document:t,data:i}=e;return this.dataMasking?function dTe(n,e,t){const i=pd(e);return bn(i,43),null==n?n:ZU(n,i.selectionSet,{operationType:i.operation,operationName:i.name?.value,fragmentMap:F5(H5(e)),cache:t,mutableTargets:new WeakMap,knownChanged:new WeakSet})}(i,t,this.cache):i}maskFragment(e){const{data:t,fragment:i,fragmentName:o}=e;return this.dataMasking?function hTe(n,e,t,i){const o=e.definitions.filter(s=>s.kind===pn.FRAGMENT_DEFINITION);typeof i>"u"&&(bn(1===o.length,41,o.length),i=o[0].name.value);const r=o.find(s=>s.name.value===i);return bn(!!r,42,i),null==n||sr(n,{})?n:ZU(n,r.selectionSet,{operationType:"fragment",operationName:r.name.value,fragmentMap:F5(H5(e)),cache:t,mutableTargets:new WeakMap,knownChanged:new WeakSet})}(t,i,this.cache,o):t}fetchQueryByPolicy({query:e,variables:t,fetchPolicy:i,errorPolicy:o,returnPartialData:r,context:s},{cacheWriteBehavior:l,onCacheHit:d,queryInfo:f,observableQuery:m,exposeExtensions:v}){const A=()=>this.cache.diff({query:e,variables:t,returnPartialData:!0,optimistic:!0}),T=(Z,ee)=>{const fe=Z.result,Le=Nt=>(!Z.complete&&!r&&(Nt=void 0),{data:Nt,dataState:Z.complete?"complete":Nt?"partial":"empty",loading:Q7(ee),networkStatus:ee,partial:!Z.complete});return(Z.complete||r)&&this.getDocumentInfo(e).hasForcedResolvers?(d(),tu(this.localState.execute({client:this.client,document:e,remoteResult:fe?{data:fe}:void 0,context:s,variables:t,onlyRunForcedResolvers:!0,returnPartialData:!0,fetchPolicy:i}).then(Nt=>({kind:"N",value:Le(Nt.data||void 0),source:"cache"})))):au({kind:"N",value:Le("none"===o&&ee===Ei.refetch&&Z.missing?void 0:fe||void 0),source:"cache"})},k=()=>this.getResultsFromLink({query:e,variables:t,context:s,fetchPolicy:i,errorPolicy:o},{cacheWriteBehavior:l,queryInfo:f,observableQuery:m,exposeExtensions:v}).pipe(nz(),function nTe(){return ia((n,e)=>{n.subscribe(Sa(e,t=>{e.next(vd.createNext(t))},()=>{e.next(vd.createComplete()),e.complete()},t=>{e.next(vd.createError(t)),e.complete()}))})}(),mo(Z=>({...Z,source:"network"})));switch(i){default:case"cache-first":{const Z=A();return Z.complete?{fromLink:!1,observable:T(Z,Ei.ready)}:r?{fromLink:!0,observable:W5(T(Z,Ei.loading),k())}:{fromLink:!0,observable:k()}}case"cache-and-network":{const Z=A();return Z.complete||r?{fromLink:!0,observable:W5(T(Z,Ei.loading),k())}:{fromLink:!0,observable:k()}}case"cache-only":return{fromLink:!1,observable:W5(T(A(),Ei.ready))};case"network-only":case"no-cache":return{fromLink:!0,observable:k()};case"standby":return{fromLink:!1,observable:hd}}}}function nz(){let n=!1;return u1({next(){n=!0},complete(){bn(n,100)}})}function wTe(n){return fu(n,{FragmentSpread:e=>{if(!e.directives?.some(t=>"unmask"===t.name.value))return{...e,directives:[...e.directives||[],{kind:pn.DIRECTIVE,name:{kind:pn.NAME,value:"nonreactive"}}]}}})}function Kw(n){if(null==n.extensions?.[Wh])return n;const{extensions:{[Wh]:e,...t},...i}=n;return Object.keys(t).length>0&&(i.extensions=t),i}class Xw{link;cache;disableNetworkFetches;set prioritizeCacheValues(e){this.queryManager.prioritizeCacheValues=e}get prioritizeCacheValues(){return this.queryManager.prioritizeCacheValues}version;queryDeduplication;defaultOptions;devtoolsConfig;refetchEventManager;queryManager;devToolsHookCb;resetStoreCallbacks=[];clearStoreCallbacks=[];constructor(e){const{cache:t,documentTransform:i,ssrMode:o=!1,ssrForceFetchDelay:r=0,queryDeduplication:s=!0,defaultOptions:l,defaultContext:d,assumeImmutableResults:f=t.assumeImmutableResults,localState:m,devtools:v,dataMasking:A,link:T,incrementalHandler:k=new QAe,experiments:Z=[],refetchEventManager:ee}=e;this.link=T,this.cache=t,this.queryDeduplication=s,this.defaultOptions=l||{},this.devtoolsConfig={...v,enabled:v?.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=Qy,this.queryManager=new CTe({client:this,defaultOptions:this.defaultOptions,defaultContext:d,documentTransform:i,queryDeduplication:s,ssrMode:o,dataMasking:!!A,clientOptions:e,incrementalHandler:k,assumeImmutableResults:f,onBroadcast:this.devtoolsConfig.enabled?()=>{this.devToolsHookCb&&this.devToolsHookCb()}:void 0,localState:m}),this.prioritizeCacheValues=o||r>0,r&&setTimeout(()=>{this.prioritizeCacheValues=!1},r),this.devtoolsConfig.enabled&&this.connectToDevTools(),Z.forEach(fe=>fe.call(this,e)),this.refetchEventManager=ee,this.refetchEventManager?.connect(this)}connectToDevTools(){if(typeof window>"u")return;const e=window,t=Symbol.for("apollo.devtools");(e[t]=e[t]||[]).push(this),e.__APOLLO_CLIENT__=this}get documentTransform(){return this.queryManager.documentTransform}get localState(){return this.queryManager.localState}set localState(e){this.queryManager.localState=e}stop(){this.queryManager.stop(),this.refetchEventManager?.disconnect(this)}watchQuery(e){const{refetchOn:t}=e;if(this.defaultOptions.watchQuery){const i=this.defaultOptions.watchQuery.refetchOn;let o;t&&"object"==typeof t&&("object"==typeof i?o={...i,...t}:null!=i&&(o=r=>{const s=t[r.source]??i;return"function"==typeof s?s(r):s})),e=q7(this.defaultOptions.watchQuery,e),o&&(e.refetchOn=o)}return this.queryManager.watchQuery(e)}query=e=>(this.defaultOptions.query&&(e=q7(this.defaultOptions.query,e)),this.queryManager.query(e));mutate=e=>{const t=q7(b1({fetchPolicy:"network-only",errorPolicy:"none"},this.defaultOptions.mutate),e);return zh(t.mutation,pu.MUTATION),this.queryManager.mutate(t)};subscribe(e){const t={},i=this.queryManager.startGraphQLSubscription(e),o=i.pipe(mo(r=>({...r,data:this.queryManager.maskOperation({document:e.query,data:r.data,fetchPolicy:e.fetchPolicy,cause:t})})));return Object.assign(o,{restart:i.restart})}readQuery(e,t=!!e.optimistic){return this.cache.readQuery({...e,query:this.transform(e.query)},t)}watchFragment(e){const t=this.queryManager.dataMasking;return this.cache.watchFragment({...e,fragment:this.transform(e.fragment,t)})}readFragment(e,t=!!e.optimistic){return this.cache.readFragment({...e,fragment:this.transform(e.fragment)},t)}writeQuery(e){const t=this.cache.writeQuery(e);return!1!==e.broadcast&&this.queryManager.broadcastQueries(),t}writeFragment(e){const t=this.cache.writeFragment(e);return!1!==e.broadcast&&this.queryManager.broadcastQueries(),t}__actionHookForDevTools(e){this.devToolsHookCb=e}__requestRaw(e){return Fw(this.link,e,{client:this})}resetStore(){return Promise.resolve().then(()=>this.queryManager.clearStore({discardWatches:!1})).then(()=>Promise.all(this.resetStoreCallbacks.map(e=>e()))).then(()=>this.refetchObservableQueries())}clearStore(){return Promise.resolve().then(()=>this.queryManager.clearStore({discardWatches:!0})).then(()=>Promise.all(this.clearStoreCallbacks.map(e=>e())))}onResetStore(e){return this.resetStoreCallbacks.push(e),()=>{this.resetStoreCallbacks=this.resetStoreCallbacks.filter(t=>t!==e)}}onClearStore(e){return this.clearStoreCallbacks.push(e),()=>{this.clearStoreCallbacks=this.clearStoreCallbacks.filter(t=>t!==e)}}reFetchObservableQueries;refetchObservableQueries(e){return this.queryManager.refetchObservableQueries(e)}refetchQueries(e){const t=this.queryManager.refetchQueries(e),i=[],o=[];t.forEach((s,l)=>{i.push(l),o.push(s)});const r=Promise.all(o);return r.queries=i,r.results=o,r.catch(s=>{}),r}getObservableQueries(e="active"){return this.queryManager.getObservableQueries(e)}extract(e){return this.cache.extract(e)}restore(e){return this.cache.restore(e)}setLink(e){this.link=e}get defaultContext(){return this.queryManager.defaultContext}maskedFragmentTransform=new fd(JAe);transform(e,t=!1){const i=this.queryManager.transform(e);return t?this.maskedFragmentTransform.transformDocument(i):i}}function TTe(n,e){if(!n)throw new Error(e??"Unexpected invariant triggered.")}const ITe=/\r\n|[\n\r]/g;function qw(n,e){let t=0,i=1;for(const o of n.body.matchAll(ITe)){if("number"==typeof o.index||TTe(!1),o.index>=e)break;t=o.index+o[0].length,i+=1}return{line:i,column:e+1-t}}function STe(n){return oz(n.source,qw(n.source,n.start))}function oz(n,e){const t=n.locationOffset.column-1,i="".padStart(t)+n.body,o=e.line-1,s=e.line+(n.locationOffset.line-1),d=e.column+(1===e.line?t:0),f=`${n.name}:${s}:${d}\n`,m=i.split(/\r\n|[\n\r]/g),v=m[o];if(v.length>120){const A=Math.floor(d/80),T=d%80,k=[];for(let Z=0;Z<v.length;Z+=80)k.push(v.slice(Z,Z+80));return f+rz([[`${s} |`,k[0]],...k.slice(1,A+1).map(Z=>["|",Z]),["|","^".padStart(T)],["|",k[A+1]]])}return f+rz([[s-1+" |",m[o-1]],[`${s} |`,v],["|","^".padStart(d)],[`${s+1} |`,m[o+1]]])}function rz(n){const e=n.filter(([i,o])=>void 0!==o),t=Math.max(...e.map(([i])=>i.length));return e.map(([i,o])=>i.padStart(t)+(o?" "+o:"")).join("\n")}class Qw extends Error{constructor(e,...t){var i,o,r;const{nodes:s,source:l,positions:d,path:f,originalError:m,extensions:v}=function ETe(n){const e=n[0];return null==e||"kind"in e||"length"in e?{nodes:e,source:n[1],positions:n[2],path:n[3],originalError:n[4],extensions:n[5]}:e}(t);super(e),this.name="GraphQLError",this.path=f??void 0,this.originalError=m??void 0,this.nodes=sz(Array.isArray(s)?s:s?[s]:void 0);const A=sz(null===(i=this.nodes)||void 0===i?void 0:i.map(k=>k.loc).filter(k=>null!=k));this.source=l??(null==A||null===(o=A[0])||void 0===o?void 0:o.source),this.positions=d??A?.map(k=>k.start),this.locations=d&&l?d.map(k=>qw(l,k)):A?.map(k=>qw(k.source,k.start));const T=function ATe(n){return"object"==typeof n&&null!==n}(m?.extensions)?m?.extensions:void 0;this.extensions=null!==(r=v??T)&&void 0!==r?r:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),null!=m&&m.stack?Object.defineProperty(this,"stack",{value:m.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,Qw):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let e=this.message;if(this.nodes)for(const t of this.nodes)t.loc&&(e+="\n\n"+STe(t.loc));else if(this.source&&this.locations)for(const t of this.locations)e+="\n\n"+oz(this.source,t);return e}toJSON(){const e={message:this.message};return null!=this.locations&&(e.locations=this.locations),null!=this.path&&(e.path=this.path),null!=this.extensions&&Object.keys(this.extensions).length>0&&(e.extensions=this.extensions),e}}function sz(n){return void 0===n||0===n.length?void 0:n}function cs(n,e,t){return new Qw(`Syntax Error: ${t}`,{source:n,positions:[e]})}var az=function(n){return n.QUERY="QUERY",n.MUTATION="MUTATION",n.SUBSCRIPTION="SUBSCRIPTION",n.FIELD="FIELD",n.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",n.FRAGMENT_SPREAD="FRAGMENT_SPREAD",n.INLINE_FRAGMENT="INLINE_FRAGMENT",n.VARIABLE_DEFINITION="VARIABLE_DEFINITION",n.SCHEMA="SCHEMA",n.SCALAR="SCALAR",n.OBJECT="OBJECT",n.FIELD_DEFINITION="FIELD_DEFINITION",n.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",n.INTERFACE="INTERFACE",n.UNION="UNION",n.ENUM="ENUM",n.ENUM_VALUE="ENUM_VALUE",n.INPUT_OBJECT="INPUT_OBJECT",n.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION",n.DIRECTIVE_DEFINITION="DIRECTIVE_DEFINITION",n}(az||{}),kt=function(n){return n.SOF="<SOF>",n.EOF="<EOF>",n.BANG="!",n.DOLLAR="$",n.AMP="&",n.PAREN_L="(",n.PAREN_R=")",n.DOT=".",n.SPREAD="...",n.COLON=":",n.EQUALS="=",n.AT="@",n.BRACKET_L="[",n.BRACKET_R="]",n.BRACE_L="{",n.PIPE="|",n.BRACE_R="}",n.NAME="Name",n.INT="Int",n.FLOAT="Float",n.STRING="String",n.BLOCK_STRING="BlockString",n.COMMENT="Comment",n}(kt||{});class xTe{constructor(e){const t=new vH(kt.SOF,0,0,0,0);this.source=e,this.lastToken=t,this.token=t,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let e=this.token;if(e.kind!==kt.EOF)do{if(e.next)e=e.next;else{const t=NTe(this,e.end);e.next=t,t.prev=e,e=t}}while(e.kind===kt.COMMENT);return e}}function Vf(n){return n>=0&&n<=55295||n>=57344&&n<=1114111}function J7(n,e){return lz(n.charCodeAt(e))&&cz(n.charCodeAt(e+1))}function lz(n){return n>=55296&&n<=56319}function cz(n){return n>=56320&&n<=57343}function C1(n,e){const t=n.source.body.codePointAt(e);if(void 0===t)return kt.EOF;if(t>=32&&t<=126){const i=String.fromCodePoint(t);return'"'===i?"'\"'":`"${i}"`}return"U+"+t.toString(16).toUpperCase().padStart(4,"0")}function Jr(n,e,t,i,o){return new vH(e,t,i,n.line,1+t-n.lineStart,o)}function NTe(n,e){const t=n.source.body,i=t.length;let o=e;for(;o<i;){const r=t.charCodeAt(o);switch(r){case 65279:case 9:case 32:case 44:++o;continue;case 10:++o,++n.line,n.lineStart=o;continue;case 13:10===t.charCodeAt(o+1)?o+=2:++o,++n.line,n.lineStart=o;continue;case 35:return LTe(n,o);case 33:return Jr(n,kt.BANG,o,o+1);case 36:return Jr(n,kt.DOLLAR,o,o+1);case 38:return Jr(n,kt.AMP,o,o+1);case 40:return Jr(n,kt.PAREN_L,o,o+1);case 41:return Jr(n,kt.PAREN_R,o,o+1);case 46:if(46===t.charCodeAt(o+1)&&46===t.charCodeAt(o+2))return Jr(n,kt.SPREAD,o,o+3);break;case 58:return Jr(n,kt.COLON,o,o+1);case 61:return Jr(n,kt.EQUALS,o,o+1);case 64:return Jr(n,kt.AT,o,o+1);case 91:return Jr(n,kt.BRACKET_L,o,o+1);case 93:return Jr(n,kt.BRACKET_R,o,o+1);case 123:return Jr(n,kt.BRACE_L,o,o+1);case 124:return Jr(n,kt.PIPE,o,o+1);case 125:return Jr(n,kt.BRACE_R,o,o+1);case 34:return 34===t.charCodeAt(o+1)&&34===t.charCodeAt(o+2)?PTe(n,o):RTe(n,o)}if(k5(r)||45===r)return MTe(n,o,r);if(oU(r))return FTe(n,o);throw cs(n.source,o,39===r?"Unexpected single quote character ('), did you mean to use a double quote (\")?":Vf(r)||J7(t,o)?`Unexpected character: ${C1(n,o)}.`:`Invalid character: ${C1(n,o)}.`)}return Jr(n,kt.EOF,i,i)}function LTe(n,e){const t=n.source.body,i=t.length;let o=e+1;for(;o<i;){const r=t.charCodeAt(o);if(10===r||13===r)break;if(Vf(r))++o;else{if(!J7(t,o))break;o+=2}}return Jr(n,kt.COMMENT,e,o,t.slice(e+1,o))}function MTe(n,e,t){const i=n.source.body;let o=e,r=t,s=!1;if(45===r&&(r=i.charCodeAt(++o)),48===r){if(r=i.charCodeAt(++o),k5(r))throw cs(n.source,o,`Invalid number, unexpected digit after 0: ${C1(n,o)}.`)}else o=Jw(n,o,r),r=i.charCodeAt(o);if(46===r&&(s=!0,r=i.charCodeAt(++o),o=Jw(n,o,r),r=i.charCodeAt(o)),(69===r||101===r)&&(s=!0,r=i.charCodeAt(++o),(43===r||45===r)&&(r=i.charCodeAt(++o)),o=Jw(n,o,r),r=i.charCodeAt(o)),46===r||oU(r))throw cs(n.source,o,`Invalid number, expected digit but got: ${C1(n,o)}.`);return Jr(n,s?kt.FLOAT:kt.INT,e,o,i.slice(e,o))}function Jw(n,e,t){if(!k5(t))throw cs(n.source,e,`Invalid number, expected digit but got: ${C1(n,e)}.`);const i=n.source.body;let o=e+1;for(;k5(i.charCodeAt(o));)++o;return o}function RTe(n,e){const t=n.source.body,i=t.length;let o=e+1,r=o,s="";for(;o<i;){const l=t.charCodeAt(o);if(34===l)return s+=t.slice(r,o),Jr(n,kt.STRING,e,o+1,s);if(92===l){s+=t.slice(r,o);const d=117===t.charCodeAt(o+1)?123===t.charCodeAt(o+2)?kTe(n,o):OTe(n,o):BTe(n,o);s+=d.value,o+=d.size,r=o;continue}if(10===l||13===l)break;if(Vf(l))++o;else{if(!J7(t,o))throw cs(n.source,o,`Invalid character within String: ${C1(n,o)}.`);o+=2}}throw cs(n.source,o,"Unterminated string.")}function kTe(n,e){const t=n.source.body;let i=0,o=3;for(;o<12;){const r=t.charCodeAt(e+o++);if(125===r){if(o<5||!Vf(i))break;return{value:String.fromCodePoint(i),size:o}}if(i=i<<4|X5(r),i<0)break}throw cs(n.source,e,`Invalid Unicode escape sequence: "${t.slice(e,e+o)}".`)}function OTe(n,e){const t=n.source.body,i=uz(t,e+2);if(Vf(i))return{value:String.fromCodePoint(i),size:6};if(lz(i)&&92===t.charCodeAt(e+6)&&117===t.charCodeAt(e+7)){const o=uz(t,e+8);if(cz(o))return{value:String.fromCodePoint(i,o),size:12}}throw cs(n.source,e,`Invalid Unicode escape sequence: "${t.slice(e,e+6)}".`)}function uz(n,e){return X5(n.charCodeAt(e))<<12|X5(n.charCodeAt(e+1))<<8|X5(n.charCodeAt(e+2))<<4|X5(n.charCodeAt(e+3))}function X5(n){return n>=48&&n<=57?n-48:n>=65&&n<=70?n-55:n>=97&&n<=102?n-87:-1}function BTe(n,e){const t=n.source.body;switch(t.charCodeAt(e+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:"\n",size:2};case 114:return{value:"\r",size:2};case 116:return{value:"\t",size:2}}throw cs(n.source,e,`Invalid character escape sequence: "${t.slice(e,e+2)}".`)}function PTe(n,e){const t=n.source.body,i=t.length;let o=n.lineStart,r=e+3,s=r,l="";const d=[];for(;r<i;){const f=t.charCodeAt(r);if(34===f&&34===t.charCodeAt(r+1)&&34===t.charCodeAt(r+2)){l+=t.slice(s,r),d.push(l);const m=Jr(n,kt.BLOCK_STRING,e,r+3,Qwe(d).join("\n"));return n.line+=d.length-1,n.lineStart=o,m}if(92!==f||34!==t.charCodeAt(r+1)||34!==t.charCodeAt(r+2)||34!==t.charCodeAt(r+3))if(10!==f&&13!==f)if(Vf(f))++r;else{if(!J7(t,r))throw cs(n.source,r,`Invalid character within String: ${C1(n,r)}.`);r+=2}else l+=t.slice(s,r),d.push(l),13===f&&10===t.charCodeAt(r+1)?r+=2:++r,l="",s=r,o=r;else l+=t.slice(s,r),s=r+1,r+=4}throw cs(n.source,r,"Unterminated string.")}function FTe(n,e){const t=n.source.body,i=t.length;let o=e+1;for(;o<i&&qwe(t.charCodeAt(o));)++o;return Jr(n,kt.NAME,e,o,t.slice(e,o))}const HTe=globalThis.process?function(e,t){return e instanceof t}:function(e,t){if(e instanceof t)return!0;if("object"==typeof e&&null!==e){var i;const o=t.prototype[Symbol.toStringTag];if(o===(Symbol.toStringTag in e?e[Symbol.toStringTag]:null===(i=e.constructor)||void 0===i?void 0:i.name)){const s=Ky(e);throw new Error(`Cannot use ${o} "${s}" from another module or realm.\n\nEnsure that there is only one instance of "graphql" in the node_modules\ndirectory. If different versions of "graphql" are the dependencies of other\nrelied on modules, use "resolutions" to ensure only one version is installed.\n\nhttps://yarnpkg.com/en/docs/selective-version-resolutions\n\nDuplicate "graphql" modules cannot be used at the same time since different\nversions may have different capabilities and behavior. The data from one\nversion used in the function from another could produce confusing and\nspurious results.`)}}return!1};class dz{constructor(e,t="GraphQL request",i={line:1,column:1}){"string"==typeof e||k7(!1,`Body must be a string. Received: ${Ky(e)}.`),this.body=e,this.name=t,this.locationOffset=i,this.locationOffset.line>0||k7(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||k7(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}class q5{constructor(e,t={}){const{lexer:i,...o}=t;if(i)this._lexer=i;else{const r=function UTe(n){return HTe(n,dz)}(e)?e:new dz(e);this._lexer=new xTe(r)}this._options=o,this._tokenCounter=0}get tokenCount(){return this._tokenCounter}parseName(){const e=this.expectToken(kt.NAME);return this.node(e,{kind:pn.NAME,value:e.value})}parseDocument(){return this.node(this._lexer.token,{kind:pn.DOCUMENT,definitions:this.many(kt.SOF,this.parseDefinition,kt.EOF)})}parseDefinition(){if(this.peek(kt.BRACE_L))return this.parseOperationDefinition();const e=this.peekDescription(),t=e?this._lexer.lookahead():this._lexer.token;if(e&&t.kind===kt.BRACE_L)throw cs(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are not supported on shorthand queries.");if(t.kind===kt.NAME){switch(t.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}switch(t.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition()}if(e)throw cs(this._lexer.source,this._lexer.token.start,"Unexpected description, only GraphQL definitions support descriptions.");if("extend"===t.value)return this.parseTypeSystemExtension()}throw this.unexpected(t)}parseOperationDefinition(){const e=this._lexer.token;if(this.peek(kt.BRACE_L))return this.node(e,{kind:pn.OPERATION_DEFINITION,operation:pu.QUERY,description:void 0,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});const t=this.parseDescription(),i=this.parseOperationType();let o;return this.peek(kt.NAME)&&(o=this.parseName()),this.node(e,{kind:pn.OPERATION_DEFINITION,operation:i,description:t,name:o,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const e=this.expectToken(kt.NAME);switch(e.value){case"query":return pu.QUERY;case"mutation":return pu.MUTATION;case"subscription":return pu.SUBSCRIPTION}throw this.unexpected(e)}parseVariableDefinitions(){return this.optionalMany(kt.PAREN_L,this.parseVariableDefinition,kt.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:pn.VARIABLE_DEFINITION,description:this.parseDescription(),variable:this.parseVariable(),type:(this.expectToken(kt.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(kt.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const e=this._lexer.token;return this.expectToken(kt.DOLLAR),this.node(e,{kind:pn.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:pn.SELECTION_SET,selections:this.many(kt.BRACE_L,this.parseSelection,kt.BRACE_R)})}parseSelection(){return this.peek(kt.SPREAD)?this.parseFragment():this.parseField()}parseField(){const e=this._lexer.token,t=this.parseName();let i,o;return this.expectOptionalToken(kt.COLON)?(i=t,o=this.parseName()):o=t,this.node(e,{kind:pn.FIELD,alias:i,name:o,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(kt.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(e){return this.optionalMany(kt.PAREN_L,e?this.parseConstArgument:this.parseArgument,kt.PAREN_R)}parseArgument(e=!1){const t=this._lexer.token,i=this.parseName();return this.expectToken(kt.COLON),this.node(t,{kind:pn.ARGUMENT,name:i,value:this.parseValueLiteral(e)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){const e=this._lexer.token;this.expectToken(kt.SPREAD);const t=this.expectOptionalKeyword("on");return!t&&this.peek(kt.NAME)?this.node(e,{kind:pn.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(e,{kind:pn.INLINE_FRAGMENT,typeCondition:t?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){const e=this._lexer.token,t=this.parseDescription();return this.expectKeyword("fragment"),this.node(e,!0===this._options.allowLegacyFragmentVariables?{kind:pn.FRAGMENT_DEFINITION,description:t,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}:{kind:pn.FRAGMENT_DEFINITION,description:t,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if("on"===this._lexer.token.value)throw this.unexpected();return this.parseName()}parseValueLiteral(e){const t=this._lexer.token;switch(t.kind){case kt.BRACKET_L:return this.parseList(e);case kt.BRACE_L:return this.parseObject(e);case kt.INT:return this.advanceLexer(),this.node(t,{kind:pn.INT,value:t.value});case kt.FLOAT:return this.advanceLexer(),this.node(t,{kind:pn.FLOAT,value:t.value});case kt.STRING:case kt.BLOCK_STRING:return this.parseStringLiteral();case kt.NAME:switch(this.advanceLexer(),t.value){case"true":return this.node(t,{kind:pn.BOOLEAN,value:!0});case"false":return this.node(t,{kind:pn.BOOLEAN,value:!1});case"null":return this.node(t,{kind:pn.NULL});default:return this.node(t,{kind:pn.ENUM,value:t.value})}case kt.DOLLAR:if(e){if(this.expectToken(kt.DOLLAR),this._lexer.token.kind===kt.NAME)throw cs(this._lexer.source,t.start,`Unexpected variable "$${this._lexer.token.value}" in constant value.`);throw this.unexpected(t)}return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){const e=this._lexer.token;return this.advanceLexer(),this.node(e,{kind:pn.STRING,value:e.value,block:e.kind===kt.BLOCK_STRING})}parseList(e){return this.node(this._lexer.token,{kind:pn.LIST,values:this.any(kt.BRACKET_L,()=>this.parseValueLiteral(e),kt.BRACKET_R)})}parseObject(e){return this.node(this._lexer.token,{kind:pn.OBJECT,fields:this.any(kt.BRACE_L,()=>this.parseObjectField(e),kt.BRACE_R)})}parseObjectField(e){const t=this._lexer.token,i=this.parseName();return this.expectToken(kt.COLON),this.node(t,{kind:pn.OBJECT_FIELD,name:i,value:this.parseValueLiteral(e)})}parseDirectives(e){const t=[];for(;this.peek(kt.AT);)t.push(this.parseDirective(e));return t}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(e){const t=this._lexer.token;return this.expectToken(kt.AT),this.node(t,{kind:pn.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e)})}parseTypeReference(){const e=this._lexer.token;let t;if(this.expectOptionalToken(kt.BRACKET_L)){const i=this.parseTypeReference();this.expectToken(kt.BRACKET_R),t=this.node(e,{kind:pn.LIST_TYPE,type:i})}else t=this.parseNamedType();return this.expectOptionalToken(kt.BANG)?this.node(e,{kind:pn.NON_NULL_TYPE,type:t}):t}parseNamedType(){return this.node(this._lexer.token,{kind:pn.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(kt.STRING)||this.peek(kt.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("schema");const i=this.parseConstDirectives(),o=this.many(kt.BRACE_L,this.parseOperationTypeDefinition,kt.BRACE_R);return this.node(e,{kind:pn.SCHEMA_DEFINITION,description:t,directives:i,operationTypes:o})}parseOperationTypeDefinition(){const e=this._lexer.token,t=this.parseOperationType();this.expectToken(kt.COLON);const i=this.parseNamedType();return this.node(e,{kind:pn.OPERATION_TYPE_DEFINITION,operation:t,type:i})}parseScalarTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("scalar");const i=this.parseName(),o=this.parseConstDirectives();return this.node(e,{kind:pn.SCALAR_TYPE_DEFINITION,description:t,name:i,directives:o})}parseObjectTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("type");const i=this.parseName(),o=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),s=this.parseFieldsDefinition();return this.node(e,{kind:pn.OBJECT_TYPE_DEFINITION,description:t,name:i,interfaces:o,directives:r,fields:s})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(kt.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(kt.BRACE_L,this.parseFieldDefinition,kt.BRACE_R)}parseFieldDefinition(){const e=this._lexer.token,t=this.parseDescription(),i=this.parseName(),o=this.parseArgumentDefs();this.expectToken(kt.COLON);const r=this.parseTypeReference(),s=this.parseConstDirectives();return this.node(e,{kind:pn.FIELD_DEFINITION,description:t,name:i,arguments:o,type:r,directives:s})}parseArgumentDefs(){return this.optionalMany(kt.PAREN_L,this.parseInputValueDef,kt.PAREN_R)}parseInputValueDef(){const e=this._lexer.token,t=this.parseDescription(),i=this.parseName();this.expectToken(kt.COLON);const o=this.parseTypeReference();let r;this.expectOptionalToken(kt.EQUALS)&&(r=this.parseConstValueLiteral());const s=this.parseConstDirectives();return this.node(e,{kind:pn.INPUT_VALUE_DEFINITION,description:t,name:i,type:o,defaultValue:r,directives:s})}parseInterfaceTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("interface");const i=this.parseName(),o=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),s=this.parseFieldsDefinition();return this.node(e,{kind:pn.INTERFACE_TYPE_DEFINITION,description:t,name:i,interfaces:o,directives:r,fields:s})}parseUnionTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("union");const i=this.parseName(),o=this.parseConstDirectives(),r=this.parseUnionMemberTypes();return this.node(e,{kind:pn.UNION_TYPE_DEFINITION,description:t,name:i,directives:o,types:r})}parseUnionMemberTypes(){return this.expectOptionalToken(kt.EQUALS)?this.delimitedMany(kt.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("enum");const i=this.parseName(),o=this.parseConstDirectives(),r=this.parseEnumValuesDefinition();return this.node(e,{kind:pn.ENUM_TYPE_DEFINITION,description:t,name:i,directives:o,values:r})}parseEnumValuesDefinition(){return this.optionalMany(kt.BRACE_L,this.parseEnumValueDefinition,kt.BRACE_R)}parseEnumValueDefinition(){const e=this._lexer.token,t=this.parseDescription(),i=this.parseEnumValueName(),o=this.parseConstDirectives();return this.node(e,{kind:pn.ENUM_VALUE_DEFINITION,description:t,name:i,directives:o})}parseEnumValueName(){if("true"===this._lexer.token.value||"false"===this._lexer.token.value||"null"===this._lexer.token.value)throw cs(this._lexer.source,this._lexer.token.start,`${e8(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("input");const i=this.parseName(),o=this.parseConstDirectives(),r=this.parseInputFieldsDefinition();return this.node(e,{kind:pn.INPUT_OBJECT_TYPE_DEFINITION,description:t,name:i,directives:o,fields:r})}parseInputFieldsDefinition(){return this.optionalMany(kt.BRACE_L,this.parseInputValueDef,kt.BRACE_R)}parseTypeSystemExtension(){const e=this._lexer.lookahead();if(e.kind===kt.NAME)switch(e.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension();case"directive":if(this._options.experimentalDirectivesOnDirectiveDefinitions)return this.parseDirectiveDefinitionExtension()}throw this.unexpected(e)}parseSchemaExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");const t=this.parseConstDirectives(),i=this.optionalMany(kt.BRACE_L,this.parseOperationTypeDefinition,kt.BRACE_R);if(0===t.length&&0===i.length)throw this.unexpected();return this.node(e,{kind:pn.SCHEMA_EXTENSION,directives:t,operationTypes:i})}parseScalarTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");const t=this.parseName(),i=this.parseConstDirectives();if(0===i.length)throw this.unexpected();return this.node(e,{kind:pn.SCALAR_TYPE_EXTENSION,name:t,directives:i})}parseObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");const t=this.parseName(),i=this.parseImplementsInterfaces(),o=this.parseConstDirectives(),r=this.parseFieldsDefinition();if(0===i.length&&0===o.length&&0===r.length)throw this.unexpected();return this.node(e,{kind:pn.OBJECT_TYPE_EXTENSION,name:t,interfaces:i,directives:o,fields:r})}parseInterfaceTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const t=this.parseName(),i=this.parseImplementsInterfaces(),o=this.parseConstDirectives(),r=this.parseFieldsDefinition();if(0===i.length&&0===o.length&&0===r.length)throw this.unexpected();return this.node(e,{kind:pn.INTERFACE_TYPE_EXTENSION,name:t,interfaces:i,directives:o,fields:r})}parseUnionTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const t=this.parseName(),i=this.parseConstDirectives(),o=this.parseUnionMemberTypes();if(0===i.length&&0===o.length)throw this.unexpected();return this.node(e,{kind:pn.UNION_TYPE_EXTENSION,name:t,directives:i,types:o})}parseEnumTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const t=this.parseName(),i=this.parseConstDirectives(),o=this.parseEnumValuesDefinition();if(0===i.length&&0===o.length)throw this.unexpected();return this.node(e,{kind:pn.ENUM_TYPE_EXTENSION,name:t,directives:i,values:o})}parseInputObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const t=this.parseName(),i=this.parseConstDirectives(),o=this.parseInputFieldsDefinition();if(0===i.length&&0===o.length)throw this.unexpected();return this.node(e,{kind:pn.INPUT_OBJECT_TYPE_EXTENSION,name:t,directives:i,fields:o})}parseDirectiveDefinitionExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("directive"),this.expectToken(kt.AT);const t=this.parseName(),i=this.parseConstDirectives();if(0===i.length)throw this.unexpected();return this.node(e,{kind:pn.DIRECTIVE_EXTENSION,name:t,directives:i})}parseDirectiveDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("directive"),this.expectToken(kt.AT);const i=this.parseName(),o=this.parseArgumentDefs(),r=this._options.experimentalDirectivesOnDirectiveDefinitions?this.parseConstDirectives():[],s=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const l=this.parseDirectiveLocations();return this.node(e,{kind:pn.DIRECTIVE_DEFINITION,description:t,name:i,arguments:o,directives:r,repeatable:s,locations:l})}parseDirectiveLocations(){return this.delimitedMany(kt.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){const e=this._lexer.token,t=this.parseName();if(Object.prototype.hasOwnProperty.call(az,t.value))return t;throw this.unexpected(e)}parseSchemaCoordinate(){const e=this._lexer.token,t=this.expectOptionalToken(kt.AT),i=this.parseName();let o,r;return!t&&this.expectOptionalToken(kt.DOT)&&(o=this.parseName()),(t||o)&&this.expectOptionalToken(kt.PAREN_L)&&(r=this.parseName(),this.expectToken(kt.COLON),this.expectToken(kt.PAREN_R)),this.node(e,t?r?{kind:pn.DIRECTIVE_ARGUMENT_COORDINATE,name:i,argumentName:r}:{kind:pn.DIRECTIVE_COORDINATE,name:i}:o?r?{kind:pn.ARGUMENT_COORDINATE,name:i,fieldName:o,argumentName:r}:{kind:pn.MEMBER_COORDINATE,name:i,memberName:o}:{kind:pn.TYPE_COORDINATE,name:i})}node(e,t){return!0!==this._options.noLocation&&(t.loc=new dwe(e,this._lexer.lastToken,this._lexer.source)),t}peek(e){return this._lexer.token.kind===e}expectToken(e){const t=this._lexer.token;if(t.kind===e)return this.advanceLexer(),t;throw cs(this._lexer.source,t.start,`Expected ${hz(e)}, found ${e8(t)}.`)}expectOptionalToken(e){return this._lexer.token.kind===e&&(this.advanceLexer(),!0)}expectKeyword(e){const t=this._lexer.token;if(t.kind!==kt.NAME||t.value!==e)throw cs(this._lexer.source,t.start,`Expected "${e}", found ${e8(t)}.`);this.advanceLexer()}expectOptionalKeyword(e){const t=this._lexer.token;return t.kind===kt.NAME&&t.value===e&&(this.advanceLexer(),!0)}unexpected(e){const t=e??this._lexer.token;return cs(this._lexer.source,t.start,`Unexpected ${e8(t)}.`)}any(e,t,i){this.expectToken(e);const o=[];for(;!this.expectOptionalToken(i);)o.push(t.call(this));return o}optionalMany(e,t,i){if(this.expectOptionalToken(e)){const o=[];do{o.push(t.call(this))}while(!this.expectOptionalToken(i));return o}return[]}many(e,t,i){this.expectToken(e);const o=[];do{o.push(t.call(this))}while(!this.expectOptionalToken(i));return o}delimitedMany(e,t){this.expectOptionalToken(e);const i=[];do{i.push(t.call(this))}while(this.expectOptionalToken(e));return i}advanceLexer(){const{maxTokens:e}=this._options,t=this._lexer.advance();if(t.kind!==kt.EOF&&(++this._tokenCounter,void 0!==e&&this._tokenCounter>e))throw cs(this._lexer.source,t.start,`Document contains more that ${e} tokens. Parsing aborted.`)}}function e8(n){const e=n.value;return hz(n.kind)+(null!=e?` "${e}"`:"")}function hz(n){return function DTe(n){return n===kt.BANG||n===kt.DOLLAR||n===kt.AMP||n===kt.PAREN_L||n===kt.PAREN_R||n===kt.DOT||n===kt.SPREAD||n===kt.COLON||n===kt.EQUALS||n===kt.AT||n===kt.BRACKET_L||n===kt.BRACKET_R||n===kt.BRACE_L||n===kt.PIPE||n===kt.BRACE_R}(n)?`"${n}"`:n}var t8=new Map,eA=new Map,_z=!0,Q5=!1;function pz(n){return n.replace(/[\s,]+/g," ").trim()}function YTe(n){var e=pz(n);if(!t8.has(e)){var t=function GTe(n,e){const t=new q5(n,e),i=t.parseDocument();return Object.defineProperty(i,"tokenCount",{enumerable:!1,value:t.tokenCount}),i}(n,{experimentalFragmentVariables:Q5,allowLegacyFragmentVariables:Q5,experimentalFragmentArguments:Q5});if(!t||"Document"!==t.kind)throw new Error("Not a valid GraphQL document.");t8.set(e,function ZTe(n){var e=new Set(n.definitions);e.forEach(function(i){i.loc&&delete i.loc,Object.keys(i).forEach(function(o){var r=i[o];r&&"object"==typeof r&&e.add(r)})});var t=n.loc;return t&&(delete t.startToken,delete t.endToken),n}(function $Te(n){var e=new Set,t=[];return n.definitions.forEach(function(i){if("FragmentDefinition"===i.kind){var o=i.name.value,r=function WTe(n){return pz(n.source.body.substring(n.start,n.end))}(i.loc),s=eA.get(o);s&&!s.has(r)?_z&&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||eA.set(o,s=new Set),s.add(r),e.has(r)||(e.add(r),t.push(i))}else t.push(i)}),W0(W0({},n),{definitions:t})}(t)))}return t8.get(e)}function jf(n){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];"string"==typeof n&&(n=[n]);var i=n[0];return e.forEach(function(o,r){i+=o&&"Document"===o.kind?o.loc.source.body:o,i+=n[r+1]}),YTe(i)}var J5_gql=jf,J5_resetCaches=function KTe(){t8.clear(),eA.clear()},J5_disableFragmentWarnings=function XTe(){_z=!1},J5_enableExperimentalFragmentVariables=function qTe(){Q5=!0},J5_disableExperimentalFragmentVariables=function QTe(){Q5=!1};(function(n){n.gql=J5_gql,n.resetCaches=J5_resetCaches,n.disableFragmentWarnings=J5_disableFragmentWarnings,n.enableExperimentalFragmentVariables=J5_enableExperimentalFragmentVariables,n.disableExperimentalFragmentVariables=J5_disableExperimentalFragmentVariables})(jf||(jf={})),jf.default=jf;const tIe=new class eIe extends zB{}(class JTe extends UB{constructor(e,t){super(e,t),this.scheduler=e,this.work=t}schedule(e,t=0){return t>0?super.schedule(e,t):(this.delay=t,this.state=e,this.scheduler.flush(this),this)}execute(e,t){return t>0||this.closed?super.execute(e,t):this._execute(e,t)}requestAsyncId(e,t,i=0){return null!=i&&i>0||null==i&&this.delay>0?super.requestAsyncId(e,t,i):(e.flush(this),0)}});function gz(n){return new wn(e=>(n().then(t=>{e.closed||(e.next(t),e.complete())},t=>{e.closed||e.error(t)}),()=>e.unsubscribe()))}class oIe{zone;constructor(e){this.zone=e}now=Date.now;schedule(e,t=0,i){return this.zone.run(()=>tIe.schedule(e,t,i))}}function tA(n,e){return n.pipe(nC(new oIe(e)))}class rIe{obsQuery;valueChanges;constructor(e,t){this.obsQuery=e,this.valueChanges=tA(tu(this.obsQuery),t)}get options(){return this.obsQuery.options}get variables(){return this.obsQuery.variables}getCurrentResult(){return this.obsQuery.getCurrentResult()}refetch(e){return this.obsQuery.refetch(e)}fetchMore(e){return this.obsQuery.fetchMore(e)}subscribeToMore(e){return this.obsQuery.subscribeToMore(e)}updateQuery(e){return this.obsQuery.updateQuery(e)}stopPolling(){return this.obsQuery.stopPolling()}startPolling(e){return this.obsQuery.startPolling(e)}setVariables(e){return this.obsQuery.setVariables(e)}reobserve(e){return this.obsQuery.reobserve(e)}}const nA=new Ht("APOLLO_FLAGS"),mz=new Ht("APOLLO_OPTIONS"),vz=new Ht("APOLLO_NAMED_OPTIONS");class bz{ngZone;flags;_client;useMutationLoading;constructor(e,t,i){this.ngZone=e,this.flags=t,this._client=i,this.useMutationLoading=t?.useMutationLoading??!1}watchQuery(e){return new rIe(this.ensureClient().watchQuery({...e}),this.ngZone)}query(e){return gz(()=>this.ensureClient().query({...e}))}mutate(e){return function iIe(n,e){return e?n.pipe(mo(t=>({...t,loading:!1})),function nIe(...n){const e=y3(n);return ia((t,i)=>{(e?W5(n,t,e):W5(n,t)).subscribe(i)})}({data:void 0,loading:!0})):n.pipe(mo(t=>({...t,loading:!1})))}(gz(()=>this.ensureClient().mutate({...e})),e.useMutationLoading??this.useMutationLoading)}watchFragment(e){const{useZone:t,...i}=e,o=this.ensureClient().watchFragment({...i});return!0!==t?o:tA(o,this.ngZone)}subscribe(e){const{useZone:t,...i}=e,o=this.ensureClient().subscribe({...i});return!0!==t?o:tA(o,this.ngZone)}get client(){return this.ensureClient()}set client(e){if(this._client)throw new Error("Client has been already defined");this._client=e}ensureClient(){return this.checkInstance(),this._client}checkInstance(){if(this._client)return!0;throw new Error("Client has not been defined yet")}}let iA=(()=>{class n extends bz{map=new Map;constructor(t,i,o,r){if(super(t,r),i&&this.createDefault(i),o&&"object"==typeof o)for(let s in o)o.hasOwnProperty(s)&&this.create(o[s],s)}create(t,i){oA(i)?this.createNamed(i,t):this.createDefault(t)}default(){return this}use(t){return oA(t)?this.map.get(t):this.default()}createDefault(t){if(this._client)throw new Error("Apollo has been already created.");this.client=this.ngZone.runOutsideAngular(()=>new Xw(t))}createNamed(t,i){if(this.map.has(t))throw new Error(`Client ${t} has been already created`);this.map.set(t,new bz(this.ngZone,this.flags,this.ngZone.runOutsideAngular(()=>new Xw(i))))}removeClient(t){oA(t)?this.map.delete(t):this._client=void 0}static \u0275fac=function(i){return new(i||n)(xn(zo),xn(mz,8),xn(vz,8),xn(nA,8))};static \u0275prov=Ft({token:n,factory:n.\u0275fac})}return n})();function oA(n){return!!n&&"default"!==n}const rA=jf,n8=(n,e)=>n&&e?[...n.keys()].reduce((t,i)=>t.set(i,n.get(i)),e):e||n;const sA={batchInterval:10,batchMax:10,uri:"graphql",method:"POST",withCredentials:!1,includeQuery:!0,includeExtensions:!1,useMultipart:!1};function bd(n,e,t){return function i8(...n){return n.find(e=>typeof e<"u")}(n[t],e[t],sA[t])}class lIe extends Ks{httpClient;options;requester;print=z7;constructor(e,t){super(),this.httpClient=e,this.options=t,this.options.operationPrinter&&(this.print=this.options.operationPrinter),this.requester=i=>new wn(o=>{const r=i.getContext();let s=bd(r,this.options,"method");const l=bd(r,this.options,"includeQuery"),d=bd(r,this.options,"includeExtensions"),f=bd(r,this.options,"uri"),m=bd(r,this.options,"withCredentials"),v=bd(r,this.options,"useMultipart"),A=!0===this.options.useGETForQueries,T=n8(r.httpContext,n8(this.options.httpContext,new uy)),k=i.query.definitions.some(Le=>"OperationDefinition"===Le.kind&&"query"===Le.operation);A&&k&&(s="GET");const Z={method:s,url:"function"==typeof f?f(i):f,body:{operationName:i.operationName,variables:i.variables},options:{withCredentials:m,useMultipart:v,headers:this.options.headers,context:T}};d&&(Z.body.extensions=i.extensions),l&&(Z.body.query=this.print(i.query));const ee=function wz(n){let e=n.headers&&n.headers instanceof Ys?n.headers:new Ys(n.headers);if(n.clientAwareness){const{name:t,version:i}=n.clientAwareness;t&&!e.has("apollographql-client-name")&&(e=e.set("apollographql-client-name",t)),i&&!e.has("apollographql-client-version")&&(e=e.set("apollographql-client-version",i))}return e}(r);Z.options.headers=((n,e)=>n&&e?e.keys().reduce((i,o)=>i.set(o,e.getAll(o)),n):e||n)(Z.options.headers,ee);const fe=((n,e,t)=>{const i=-1!==["POST","PUT","PATCH"].indexOf(n.method.toUpperCase()),r=n.body.length;let l,s=n.options&&n.options.useMultipart;if(s){if(r)return new wn(f=>f.error(new Error("File upload is not available when combined with Batching")));if(!i)return new wn(f=>f.error(new Error("File upload is not available when GET is used")));if(!t)return new wn(f=>f.error(new Error('To use File upload you need to pass "extractFiles" function from "extract-files" library to HttpLink\'s options')));l=t(n.body),s=!!l.files.size}let d={};if(r){if(!i)return new wn(f=>f.error(new Error("Batching is not available for GET requests")));d={body:n.body}}else d=i?{body:s?l.clone:n.body}:{params:Object.keys(n.body).reduce((v,A)=>{const T=n.body[A];return v[A]=-1!==["variables","extensions"].indexOf(A.toLowerCase())?JSON.stringify(T):T,v},{})};if(s&&i){const f=new FormData;f.append("operations",JSON.stringify(d.body));const m={},v=l.files;let A=0;v.forEach(T=>{m[++A]=T}),f.append("map",JSON.stringify(m)),A=0,v.forEach((T,k)=>{f.append(++A+"",k,k.name)}),d.body=f}return e.request(n.method,n.url,{observe:"response",responseType:"json",reportProgress:!1,...d,...n.options})})(Z,this.httpClient,this.options.extractFiles).subscribe({next:Le=>{i.setContext({response:Le}),o.next(Le.body)},error:Le=>o.error(Le),complete:()=>o.complete()});return()=>{fe.closed||fe.unsubscribe()}})}request(e){return this.requester(e)}}let cIe=(()=>{class n{httpClient;constructor(t){this.httpClient=t}create(t){return new lIe(this.httpClient,t)}static \u0275fac=function(i){return new(i||n)(xn(cd))};static \u0275prov=Ft({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();function Az(n,e){this.v=n,this.k=e}function aA(n){return new Az(n,0)}function lA(n){return function(){return new em(n.apply(this,arguments))}}function em(n){var e,t;function i(r,s){try{var l=n[r](s),d=l.value,f=d instanceof Az;Promise.resolve(f?d.v:d).then(function(m){if(f){var v="return"===r&&d.k?r:"next";if(!d.k||m.done)return i(v,m);m=n[v](m).value}o(!!l.done,m)},function(m){i("throw",m)})}catch(m){o(2,m)}}function o(r,s){2===r?e.reject(s):e.resolve({value:s,done:r}),(e=e.next)?i(e.key,e.arg):t=null}this._invoke=function(r,s){return new Promise(function(l,d){var f={key:r,arg:s,resolve:l,reject:d,next:null};t?t=t.next=f:(e=t=f,i(r,s))})},"function"!=typeof n.return&&(this.return=void 0)}function cA(n){var e,t,i,o=2;for(typeof Symbol<"u"&&(t=Symbol.asyncIterator,i=Symbol.iterator);o--;){if(t&&null!=(e=n[t]))return e.call(n);if(i&&null!=(e=n[i]))return new o8(e.call(n));t="@@asyncIterator",i="@@iterator"}throw new TypeError("Object is not async iterable")}function o8(n){function e(t){if(Object(t)!==t)return Promise.reject(new TypeError(t+" is not an object."));var i=t.done;return Promise.resolve(t.value).then(function(o){return{value:o,done:i}})}return(o8=function(i){this.s=i,this.n=i.next}).prototype={s:null,n:null,next:function(){return e(this.n.apply(this.s,arguments))},return:function(i){var o=this.s.return;return void 0===o?Promise.resolve({value:i,done:!0}):e(o.apply(this.s,arguments))},throw:function(i){var o=this.s.return;return void 0===o?Promise.reject(i):e(o.apply(this.s,arguments))}},new o8(n)}function hIe(n){if("next"!==n&&"complete"!==n)throw new Error(`Invalid stream event "${n}"`);return n}function _Ie(n,e){if(e)try{e=JSON.parse(e)}catch{throw new Error("Invalid stream data")}if("next"===n&&!e)throw new Error('Stream data must be an object for "next" events');return e||null}em.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},em.prototype.next=function(n){return this._invoke("next",n)},em.prototype.throw=function(n){return this._invoke("throw",n)},em.prototype.return=function(n){return this._invoke("return",n)};var Gf=function(n){return n[n.NewLine=10]="NewLine",n[n.CarriageReturn=13]="CarriageReturn",n[n.Space=32]="Space",n[n.Colon=58]="Colon",n}(Gf||{});class Xl extends Error{constructor(e){let t,i;!function mIe(n){return function fIe(n){return"object"==typeof n&&null!==n}(n)&&"boolean"==typeof n.ok&&"number"==typeof n.status&&"string"==typeof n.statusText}(e)?t=e instanceof Error?e.message:String(e):(i=e,t="Server responded with "+e.status+": "+e.statusText),super(t),this.name=this.constructor.name,this.response=i}}function Tz(n){return uA.apply(this,arguments)}function uA(){return uA=(0,N.A)(function*(n){const{signal:e,url:t,credentials:i,headers:o,body:r,referrer:s,referrerPolicy:l,fetchFn:d,onMessage:f}=n,m={},v={};let A;try{A=yield d(t,{signal:e,method:r?"POST":"GET",credentials:i,referrer:s,referrerPolicy:l,headers:{...o,accept:"text/event-stream"},body:r})}catch(Z){throw new Xl(Z)}if(!A.ok)throw new Xl(A);if(!A.body)throw new Error("Missing response body");let k,T=null;return(0,N.A)(function*(){var Z;try{const Zt=function pIe(){let n,e,t,i=!1,o={event:"",data:""},r=[];const s=new TextDecoder;return function(d){if(void 0===n)n=d,e=0,t=-1;else{const v=new Uint8Array(n.length+d.length);v.set(n),v.set(d,n.length),n=v}const f=n.length;let m=0;for(;e<f;){i&&(n[e]===Gf.NewLine&&(m=++e),i=!1);let v=-1;for(;e<f&&-1===v;++e)switch(n[e]){case Gf.Colon:-1===t&&(t=e-m);break;case Gf.CarriageReturn:i=!0;case Gf.NewLine:v=e}if(-1===v)break;if(m===v){if(o.event||o.data){if(!o.event)throw new Error("Missing message event");const A=hIe(o.event),T=_Ie(A,o.data);r.push({event:A,data:T}),o={event:"",data:""}}}else if(t>0){const A=n.subarray(m,v),T=s.decode(A.subarray(0,t)),Z=s.decode(A.subarray(t+(A[t+1]===Gf.Space?2:1)));switch(T){case"event":o.event=Z;break;case"data":o.data=o.data?o.data+"\n"+Z:Z}}m=e,t=-1}if(m===f){n=void 0;const v=[...r];return r=[],v}0!==m&&(n=n.subarray(m),e-=m)}}();var Le,ee=!1,fe=!1;try{for(var Nt,Ct=cA(function vIe(n){return"function"==typeof Object(n)[Symbol.asyncIterator]?n:lA(function*(){const e=n.getReader();let t;do{t=yield aA(e.read()),void 0!==t.value&&(yield t.value)}while(!t.done)})()}(A.body));ee=!(Nt=yield Ct.next()).done;ee=!1){const Zn=Nt.value;{if("string"==typeof Zn)throw T=new Error(`Unexpected string chunk "${Zn}"`);let Ri;try{Ri=Zt(Zn)}catch(ci){throw T=ci}if(!Ri)continue;for(const ci of Ri){try{f?.(ci)}catch(ki){throw T=ki}const Yi=ci.data&&"id"in ci.data?ci.data.id:"";switch(Yi in v||(v[Yi]=[]),ci.event){case"next":v[Yi].push(Yi?ci.data.payload:ci.data);break;case"complete":v[Yi].push("complete");break;default:throw T=new Error(`Unexpected message event "${ci.event}"`)}null===(Z=m[Yi])||void 0===Z||Z.proceed()}}}}catch(Zn){fe=!0,Le=Zn}finally{try{ee&&null!=Ct.return&&(yield Ct.return())}finally{if(fe)throw Le}}if(Object.keys(m).length)throw new Error("Connection closed while having active streams")}catch(Zt){T=!T&&Object.keys(m).length?new Xl(Zt):Zt,k?.(T)}finally{Object.values(m).forEach(({proceed:Zt})=>Zt())}})(),{url:t,headers:o,waitForThrow:()=>new Promise((Z,ee)=>{if(T)return ee(T);k=ee}),getResults:Z=>lA(function*(){var ee;const{signal:fe,operationId:Le=""}=Z??{};try{for(;;){for(;null!==(ee=v[Le])&&void 0!==ee&&ee.length;){const Ct=v[Le].shift();if("complete"===Ct)return;yield Ct}if(T)throw T;if(fe?.aborted)throw new Error("Getting results aborted by the client");yield aA(new Promise(Ct=>{const Nt=()=>{fe?.removeEventListener("abort",Nt),delete m[Le],Ct()};fe?.addEventListener("abort",Nt),m[Le]={proceed:Nt}}))}}finally{delete v[Le]}})()}}),uA.apply(this,arguments)}class bIe extends Ks{constructor(e){super(),this.client=function gIe(n){const{singleConnection:e=!1,lazy:t=!0,lazyCloseTimeout:i=0,onNonLazyError:o=console.error,generateID:r=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,Yi=>{const ki=16*Math.random()|0;return("x"==Yi?ki:3&ki|8).toString(16)})},retryAttempts:s=5,retry:l=function(){var ci=(0,N.A)(function*(ki){let Ji=1e3;for(let ks=0;ks<ki;ks++)Ji*=2;yield new Promise(ks=>setTimeout(ks,Ji+Math.floor(2700*Math.random()+300)))});return function Yi(ki){return ci.apply(this,arguments)}}(),credentials:d="same-origin",referrer:f,referrerPolicy:m,onMessage:v,on:A}=n,T=n.fetchFn||fetch,k=n.abortControllerImpl||AbortController,Z=(()=>{let ci=!1;const Yi=[];return{get disposed(){return ci},onDispose:ki=>ci?(setTimeout(()=>ki(),0),()=>{}):(Yi.push(ki),()=>{Yi.splice(Yi.indexOf(ki),1)}),dispose(){if(!ci){ci=!0;for(const ki of[...Yi])ki()}}}})();let ee,fe,Le=0,Ct=null,Nt=0;function Zt(){return Zn.apply(this,arguments)}function Zn(){return(Zn=(0,N.A)(function*(){try{if(Z.disposed)throw new Error("Client has been disposed");return yield fe??(fe=(0,N.A)(function*(){var ci,Yi,ki;if(Ct){if(yield l(Nt),ee.signal.aborted)throw new Error("Connection aborted by the client");Nt++}null===(ci=A?.connecting)||void 0===ci||ci.call(A,!!Ct),ee=new k;const Ji=Z.onDispose(()=>ee.abort());ee.signal.addEventListener("abort",()=>{Ji(),fe=void 0});const ks=n,Lr="function"==typeof ks.url?yield ks.url(void 0):ks.url;if(ee.signal.aborted)throw new Error("Connection aborted by the client");const es="function"==typeof ks.headers?yield ks.headers(void 0):null!==(Yi=ks.headers)&&void 0!==Yi?Yi:{};if(ee.signal.aborted)throw new Error("Connection aborted by the client");let us;try{us=yield T(Lr,{signal:ee.signal,method:"PUT",credentials:d,referrer:f,referrerPolicy:m,headers:es})}catch(ql){throw new Xl(ql)}if(201!==us.status)throw new Xl(us);const vu=yield us.text();es["x-graphql-event-stream-token"]=vu;const wd=yield Tz({signal:ee.signal,headers:es,credentials:d,referrer:f,referrerPolicy:m,url:Lr,fetchFn:T,onMessage:ql=>{var bu;null===(bu=A?.message)||void 0===bu||bu.call(A,ql),v?.(ql)}});return null===(ki=A?.connected)||void 0===ki||ki.call(A,!!Ct),wd.waitForThrow().catch(()=>fe=void 0),wd})())}catch(ci){throw fe=void 0,ci}})).apply(this,arguments)}function Ri(ci,Yi,ki){if(!e){const Lr=new k,es=Z.onDispose(()=>{es(),Lr.abort()});return(0,N.A)(function*(){var us,vu,wd,ql,bu;let ya=null,w1=0;for(;;)try{if(ya){if(yield l(w1),Lr.signal.aborted)throw new Error("Connection aborted by the client");w1++}null===(us=A?.connecting)||void 0===us||us.call(A,!!ya),null===(vu=ki?.connecting)||void 0===vu||vu.call(ki,!!ya);const yl=n,FDe="function"==typeof yl.url?yield yl.url(ci):yl.url;if(Lr.signal.aborted)throw new Error("Connection aborted by the client");const HDe="function"==typeof yl.headers?yield yl.headers(ci):null!==(wd=yl.headers)&&void 0!==wd?wd:{};if(Lr.signal.aborted)throw new Error("Connection aborted by the client");const{getResults:UDe}=yield Tz({signal:Lr.signal,headers:{...HDe,"content-type":"application/json; charset=utf-8"},credentials:d,referrer:f,referrerPolicy:m,url:FDe,body:JSON.stringify(ci),fetchFn:T,onMessage:T1=>{var FA,HA;null===(FA=A?.message)||void 0===FA||FA.call(A,T1),null===(HA=ki?.message)||void 0===HA||HA.call(ki,T1),v?.(T1)}});null===(ql=A?.connected)||void 0===ql||ql.call(A,!!ya),null===(bu=ki?.connected)||void 0===bu||bu.call(ki,!!ya);var Cu,um=!1,$f=!1;try{for(var A1,Kh=cA(UDe());um=!(A1=yield Kh.next()).done;um=!1)ya=null,w1=0,Yi.next(A1.value)}catch(T1){$f=!0,Cu=T1}finally{try{um&&null!=Kh.return&&(yield Kh.return())}finally{if($f)throw Cu}}return Lr.abort()}catch(yl){if(Lr.signal.aborted)return;if(!(yl instanceof Xl)||!s||w1>=s)throw yl;ya=yl}})().then(()=>Yi.complete()).catch(us=>Yi.error(us)),()=>Lr.abort()}Le++;const Ji=new k,ks=Z.onDispose(()=>{ks(),Ji.abort()});return(0,N.A)(function*(){const Lr=r();ci={...ci,extensions:{...ci.extensions,operationId:Lr}};let es=null;for(;;){es=null;try{const{url:ya,headers:w1,getResults:um}=yield Zt();let $f;try{$f=yield T(ya,{signal:Ji.signal,method:"POST",credentials:d,referrer:f,referrerPolicy:m,headers:{...w1,"content-type":"application/json; charset=utf-8"},body:JSON.stringify(ci)})}catch(Cu){throw new Xl(Cu)}if(202!==$f.status)throw new Xl($f);es=function(){var Cu=(0,N.A)(function*(){let Kh;try{const A1=new k,yl=Z.onDispose(()=>{yl(),A1.abort()});Kh=yield T(ya+"?operationId="+Lr,{signal:A1.signal,method:"DELETE",credentials:d,referrer:f,referrerPolicy:m,headers:w1})}catch(A1){throw new Xl(A1)}if(200!==Kh.status)throw new Xl(Kh)});return function(){return Cu.apply(this,arguments)}}();var wd,us=!1,vu=!1;try{for(var bu,ql=cA(um({signal:Ji.signal,operationId:Lr}));us=!(bu=yield ql.next()).done;us=!1)Ct=null,Nt=0,Yi.next(bu.value)}catch(Cu){vu=!0,wd=Cu}finally{try{us&&null!=ql.return&&(yield ql.return())}finally{if(vu)throw wd}}return es=null,Ji.abort()}catch(ya){if(Ji.signal.aborted)return yield es?.();if(!(ya instanceof Xl)||(t&&(fe=void 0),!s||Nt>=s))throw Ji.abort(),ya;Ct=ya}finally{Ji.signal.aborted&&0===--Le&&(isFinite(i)&&i>0?setTimeout(()=>{Le||ee.abort()},i):ee.abort())}}})().then(()=>Yi.complete()).catch(Lr=>Yi.error(Lr)),()=>Ji.abort()}return e&&!t&&(0,N.A)(function*(){for(Le++;;)try{const{waitForThrow:ci}=yield Zt();yield ci()}catch(ci){if(Z.disposed)return;if(!(ci instanceof Xl)||(fe=void 0,!s||Nt>=s))return o?.(ci);Ct=ci}})(),{subscribe:Ri,iterate(ci,Yi){const ki=[],Ji={done:!1,error:null,resolve:()=>{}},ks=Ri(ci,{next(es){ki.push(es),Ji.resolve()},error(es){Ji.done=!0,Ji.error=es,Ji.resolve()},complete(){Ji.done=!0,Ji.resolve()}},Yi),Lr=(es=lA(function*(){for(;;){for(ki.length||(yield aA(new Promise(vu=>Ji.resolve=vu)));ki.length;)yield ki.shift();if(Ji.error)throw Ji.error;if(Ji.done)return}}),function us(){return es.apply(this,arguments)})();var es;return Lr.throw=function(){var es=(0,N.A)(function*(us){return Ji.done||(Ji.done=!0,Ji.error=us,Ji.resolve()),{done:!0,value:void 0}});return function(us){return es.apply(this,arguments)}}(),Lr.return=(0,N.A)(function*(){return ks(),{done:!0,value:void 0}}),Lr},dispose(){Z.dispose()}}}(e)}request(e){return new wn(t=>this.client.subscribe({...e,query:z7(e.query)},{next:t.next.bind(t),complete:t.complete.bind(t),error:t.error.bind(t)}))}}const CIe={run:n=>n(),runOutsideAngular:n=>n()};let Iz=(()=>{class n{constructor(){this.httpLink=we(cIe),this.gatewayService=we(gH),this.authService=we(_u),this.apollo=(t,i=!1)=>new iA(CIe,this.createApolloOptions(t,i))}resolveToken(t){return this.authService.getToken()||t.token}createApolloOptions(t,i=!1){const o=new VU(d=>{const f=d.headers instanceof Ys?d.headers:new Ys(d.headers??{});return{...d,uri:()=>this.gatewayService.getGatewayUrl(t,i),headers:f.set("Authorization",`Bearer ${this.resolveToken(t)}`).set("Accept","charset=utf-8")}}),r=Swe(({query:d})=>{const f=yw(d);return"OperationDefinition"===f.kind&&"subscription"===f.operation},new bIe({url:()=>this.gatewayService.getGatewayUrl(t,i),headers:()=>({Authorization:`Bearer ${this.resolveToken(t)}`})}),this.httpLink.create({}));return{link:Ks.from([o,r]),cache:new zU}}static{this.\u0275fac=function(i){return new(i||n)}}static{this.\u0275prov=Ft({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();function Sz(n){let e=n.replace(/[^a-zA-Z0-9]/g,"_");return/^[0-9]/.test(e)&&(e="_"+e),e}function dA(n){return n.split("_").filter(e=>e.length>0).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join("")}function Ez(n,e,t){let i;if(n&&e)i=dA(Sz(n)+"_"+e);else if(n)i=dA(Sz(n));else{if(!e)return`${t}_Input`;i=dA("_"+e)}return`${i}${t}_Input`}function tm(n,e="_"){return[n.apiGroup,n.version,n.entity].filter(t=>!!t).join(e)}const r8=n=>{const e=[];return n.map(t=>{t.property instanceof Array?t.property.map(i=>hA(i,e)):hA(t.property,e)}),e},hA=(n,e=[])=>{if(!n)return[];const t=n.split(".");for(const i of t)return 1===t.length?(e.push(i),e):(e.push({[i]:[...hA(t.splice(1).join("."))]}),e)},nm=(n,e)=>{const t=e.jsonPathExpression||e.property;if(!t)return;if(t instanceof Array)return void console.error(`Property defined as an array: ${JSON.stringify(t)}, provide "jsonPathExpression" field to properly ready resource value`);const o=po({path:`${t.startsWith("$.")?"":"$."}${t}`,json:n}),r=o.length?o[0]:void 0;return r&&e.propertyField?yIe(r[e.propertyField.key],e.propertyField.transform):r},yIe=(n,e)=>null!=n&&null!=e&&e.length?e.reduce((t,i)=>{if(null==t)return t;switch(i){case"uppercase":return t.toUpperCase();case"lowercase":return t.toLowerCase();case"capitalize":{const o=String(t);return o.length?o.charAt(0).toUpperCase()+o.slice(1):o}case"decode":try{return AIe(t)}catch{return t}case"encode":try{return wIe(t)}catch{return t}default:return t}},n):n,wIe=n=>{try{const e=(new TextEncoder).encode(n),t=Array.from(e,i=>String.fromCharCode(i)).join("");return btoa(t)}catch(e){throw console.error("Base64 encoding failed:",e),new Error("Failed to encode string to Base64")}},AIe=n=>{try{const e=atob(n),t=Uint8Array.from(e,i=>i.charCodeAt(0));return(new TextDecoder).decode(t)}catch(e){throw console.error("Base64 decoding failed:",e),new Error("Failed to decode Base64 string")}},y1=(n,e)=>nm(n,{jsonPathExpression:e});function Cd(n){return"Namespaced"===n?.resourceDefinition?.scope}function xz(n,e,t){if(!e)return n;const{getItemKey:i,mapSubscriptionObjectToItem:o}=t,r=new Map;n.forEach(m=>{const v=i(m);v&&r.set(v,m)});const{type:s,object:l}=e,d=l.metadata?.name;if(!d)return n;const f=o(l);return"ADDED"===s?r.set(d,f):"MODIFIED"===s?r.has(d)&&r.set(d,f):"DELETED"===s&&r.delete(d),[...r.values()]}function _A(n){if(Array.isArray(n))return n.map(e=>_A(e));if(n&&"object"==typeof n){const{__typename:e,...t}=n;for(const i of Object.keys(t))t[i]=_A(t[i]);return t}return n}function Dz(n){return"object"==typeof n&&null!==n&&(Object.hasOwn(n,"operation")&&Object.hasOwn(n,"variables")&&Object.hasOwn(n,"fields")||Object.hasOwn(n,"operation")&&Object.hasOwn(n,"fragment")&&Object.hasOwn(n,"fields"))}var Nz=Symbol.for("gql-query-builder.raw");function pA(n){if(function SIe(n){return"object"==typeof n&&null!==n&&!0===n[Nz]}(n))return String(n.value);if(null===n)return"null";if(Array.isArray(n))return`[${n.map(pA).join(", ")}]`;switch(typeof n){case"string":return JSON.stringify(n);case"number":case"boolean":return String(n);case"object":return`{${Object.entries(n).map(([e,t])=>`${e}: ${pA(t)}`).join(", ")}}`;default:throw new TypeError(`Cannot serialize ${typeof n} as a GraphQL literal`)}}function yd(n){let e={};for(const{variables:t,fields:i}of n)e={...e,...t,...i&&s8(i)||{}};return e}function Wf(n){return n&&Object.keys(n).length?`(${Object.entries(n).reduce((e,[t,i],o)=>`${e}${0!==o?", ":""}${i?.name?i.name:t}: $${t}`,"")})`:""}function Yh(n){return n?n.map(e=>{if(Dz(e))return function DIe(n){return`${fA(n)?"... on ":""}${function xIe(n){return fA(n)?n.operation:function EIe(n){return"string"==typeof n?n:`${n.alias}: ${n.name}`}(n.operation)}(n)} ${fA(n)?"":Wf(n.variables)} ${n.fields.length>0?`{ ${Yh(n.fields)} }`:""}`}(e);if("object"==typeof e){let t="";return Object.entries(e).forEach(([i,o],r,s)=>{t+=`${i} ${o.length>0?`{ ${Yh(o)} }`:""}`,r<s.length-1&&(t+=", ")}),t}return`${e}`}).join(", "):""}function fA(n){return!0===n?.fragment}function im(n,e){const t={},i=o=>{o&&Object.keys(o).forEach(r=>{t[r]=null!==o[r]&&"object"==typeof o[r]?o[r].value:o[r]})};return i(n),e&&"object"==typeof e&&i(s8(e)),t}function s8(n){let e={};return function t(i){return i?.forEach(o=>{if(Dz(o))e={...o.variables,...e,...o.fields&&t(o.fields)};else if("object"==typeof o)for(const[,r]of Object.entries(o))t(r)}),e}(n),e}function om(n){const e=function LIe(n){let e="String";const t=null!==n&&"object"==typeof n?n.value:n;if(null!=n?.type)e=n.type;else{const i=Array.isArray(t)?t[0]:t;if(null!=i)switch(typeof i){case"object":e="Object";break;case"boolean":e="Boolean";break;case"number":e=i%1==0?"Int":"Float"}}return null!==n&&"object"==typeof n&&(!0===n.list?e=`[${e}]`:Array.isArray(n.list)&&(e=`[${e}${n.list[0]?"!":""}]`),n.required&&(e+="!")),e}(n);return"object"!=typeof n||null===n||Array.isArray(n)||void 0===n.default?e:`${e} = ${pA(n.default)}`}var MIe=class{#e;#n;#t;#i;constructor(n,e){Array.isArray(n)?this.#e=yd(n):(this.#e=n.variables,this.#n=n.fields,this.#t=n.operation),this.#i={operationName:"",...e}}mutationBuilder(){return this.#o(this.#e,this.#s(this.#t))}mutationsBuilder(n){const e=n.map(t=>(this.#t=t.operation,this.#e=t.variables,this.#n=t.fields,this.#s(t.operation)));return this.#o(yd(n),e.join("\n "))}#r(n){return this.#n&&"object"==typeof this.#n&&(n={...s8(this.#n),...n}),n&&Object.keys(n).length>0?`(${Object.keys(n).reduce((e,t,i)=>`${e}${0!==i?", ":""}$${t}: ${om(n[t])}`,"")})`:""}#o(n,e){let t=`mutation ${this.#r(n)} {\n ${e}\n}`;return this.#i.operationName&&(t=t.replace("mutation",`mutation ${this.#i.operationName}`)),{query:t,variables:im(n,this.#n)}}#s(n){return`${"string"==typeof n?n:`${n.alias}: ${n.name}`} ${Wf(this.#e)} ${this.#n&&this.#n.length>0?`{\n ${Yh(this.#n)}\n }`:""}`}},RIe=class{#e;#n;#t;#i;constructor(n,e){this.#i={operationName:"",...e},Array.isArray(n)?this.#e=yd(n):(this.#e=n.variables,this.#n=n.fields||[],this.#t=n.operation)}queryBuilder(){return this.#o(this.#s(this.#e))}queriesBuilder(n){const e=n.filter(Boolean).map(t=>(this.#t=t.operation,this.#n=t.fields,this.#s(t.variables))).join(" ");return this.#o(e)}#r(){let n=this.#e;return this.#n&&"object"==typeof this.#n&&(n={...s8(this.#n),...n}),n&&Object.keys(n).length>0?`(${Object.keys(n).reduce((e,t,i)=>`${e}${0!==i?", ":""}$${t}: ${om(n[t])}`,"")})`:""}#o(n){let e=`query ${this.#r()} { ${n} }`;return e=e.replace("query","query"+(this.#i.operationName?` ${this.#i.operationName}`:"")),{query:e,variables:im(this.#e,this.#n)}}#s(n){return`${"string"==typeof this.#t?this.#t:`${this.#t.alias}: ${this.#t.name}`} ${n?Wf(n):""} ${this.#n&&this.#n.length>0?`{ ${Yh(this.#n)} }`:""}`}},kIe=class{#e;#n;#t;#i;constructor(n,e){Array.isArray(n)?this.#e=yd(n):(this.#e=n.variables,this.#n=n.fields,this.#t=n.operation),this.#i={operationName:"",...e}}subscriptionBuilder(){return this.#o(this.#e,this.#s())}subscriptionsBuilder(n){const e=n.map(t=>(this.#t=t.operation,this.#e=t.variables,this.#n=t.fields,this.#s()));return this.#o(yd(n),e.join("\n "))}#r(n){return n&&Object.keys(n).length?`(${Object.keys(n).reduce((e,t,i)=>`${e}${0!==i?", ":""}$${t}: ${om(n[t])}`,"")})`:""}#o(n,e){let t=`subscription ${this.#r(n)} {\n ${e}\n}`;return this.#i.operationName&&(t=t.replace("subscription",`subscription ${this.#i.operationName}`)),{query:t,variables:im(n)}}#s(){return`${"string"==typeof this.#t?this.#t:`${this.#t.alias}: ${this.#t.name}`} ${this.#e?Wf(this.#e):""} {\n ${Yh(this.#n)}\n }`}};function gA(n,e){const t=function NIe(n){return n?.length?n.map(e=>`\n\nfragment ${e.name} on ${e.on} { ${Yh(e.fields)} }`).join(""):""}(e?.fragments);return t?{...n,query:n.query+t}:n}function Lz(n,e,t){const o=new(e??RIe)(n,t);return gA(Array.isArray(n)?o.queriesBuilder(n):o.queryBuilder(),t)}function mA(n,e,t){const o=new(e??MIe)(n,t);return gA(Array.isArray(n)?o.mutationsBuilder(n):o.mutationBuilder(),t)}let rm=(()=>{class n{constructor(){this.apolloFactory=we(Iz),this.luigiCoreService=we(Cr)}read(t,i,o,r,s=!0){const l=Cd(r),d=this.getNamespace(r);let f=this.resolveReadQuery(i,o,t,l?d:void 0);return f=this.parseGQLQuery(f),this.apolloFactory.apollo(r,s).query({query:f,variables:{name:t,...l&&{namespace:d}}}).pipe(mo(m=>y1(m.data,tm(i,"."))))}resolveReadQuery(t,i,o,r){if(i instanceof Array){const{entity:s,version:l,apiGroup:d}=t,f=[{operation:s,variables:{name:{value:o,type:"String!"},...r&&{namespace:{value:r,type:"String"}}},fields:i}];return Lz(this.calcQueryOptions(f,[{operation:d},{operation:l}])).query}return i}list(t,i,o,r={}){const{readFromParentKcpPath:s=!1,pagination:l,variables:d}=r,m={...Cd(o)&&{namespace:{type:"String",value:this.getNamespace(o)}},...l?.limit&&{limit:{type:"Int",value:l?.limit}},...l?.continue&&{continue:{type:"String",value:l?.continue}},...d},v=o.resourceDefinition;return v?i instanceof Array?this.listWithFields(v,i,o,s,m):this.listWithRawQuery(t,i,o,s,m):$h(()=>new Error("Resource definition is required"))}getResourceReadyStatus(t,i){const o=i.resourceDefinition?.readyCondition;return!o||nm(t,o)}listWithFields(t,i,o,r,s){const{apiGroup:l,entityCollection:d,version:f}=t,A=Lz(this.calcQueryOptions([{operation:d,variables:s,fields:["resourceVersion","remainingItemCount","continue",{items:i}]}],[{operation:l},{operation:f}])),T=this.parseGQLQuery(A.query);return this.apolloFactory.apollo(o,r).query({query:T,variables:A.variables}).pipe(mo(k=>{const Z=y1(k.data,tm({apiGroup:l,version:f,entity:d},"."));if(!Z)throw new Error("Resource list result not found");return Z}),mo(k=>{const Z=k.items.map(ee=>({...ee,ready:this.getResourceReadyStatus(ee,o)})).map(ee=>({...ee,id:ee.metadata.name,isAvailable:this.isAvailable(ee),accessibleName:this.getAccessibleName(ee)}));return{...k,items:Z}}))}isAvailable(t){return!!t.ready&&!t.metadata?.deletionTimestamp}getAccessibleName(t){return t.metadata?.deletionTimestamp?"Resource is pending deletion":t.ready?void 0:"Resource is not ready"}listWithRawQuery(t,i,o,r,s){const l=this.parseGQLQuery(i);return this.apolloFactory.apollo(o,r).query({query:l,variables:this.normalizeGqlBuilderVariables(s)}).pipe(mo(d=>y1(d.data,t)??[]),md(d=>(this.alertErrors(d),console.error("Error executing GraphQL query.",d),$h(()=>d))))}resourceChangeSubscription(t,i,o,r,s){const d={...Cd(o)&&{namespace:{type:"String",value:this.getNamespace(o)}}},f=t.toLowerCase(),m=function PIe(n,e,t){const o=new(e??kIe)(n,t);return gA(Array.isArray(n)?o.subscriptionsBuilder(n):o.subscriptionBuilder(),t)}({operation:f,fields:["type",{object:i}],variables:{...d,resourceVersion:{type:"String",value:r}}}),v=this.parseGQLQuery(m.query);return this.apolloFactory.apollo(o,s).subscribe({query:v,variables:m.variables}).pipe(mo(A=>{const T=y1(A.data,f);return T&&(T.object.ready=this.getResourceReadyStatus(T.object,o),T.object.id=T.object.metadata.name,T.object.isAvailable=this.isAvailable(T.object),T.object.accessibleName=this.getAccessibleName(T.object)),T}))}alertErrors(t){this.luigiCoreService.showAlert({text:t.message,type:"error"})}delete(t,i,o,r=!1){const s=Cd(o),{apiGroup:l,entity:d,version:f}=i,m=[{operation:`delete${d}`,variables:{name:{type:"String!",value:t.metadata.name},...s&&{namespace:{type:"String",value:this.getNamespace(o)}}},fields:[]}],A=mA(this.calcQueryOptions(m,[{operation:l},{operation:f}])),T=this.parseGQLQuery(A.query);return this.apolloFactory.apollo(o,r).mutate({mutation:T,variables:A.variables}).pipe(md(k=>(this.alertErrors(k),console.error("Error executing GraphQL query.",k),$h(()=>k))))}create(t,i,o){const r=Cd(o),{apiGroup:s,entity:l,version:d}=i,f=this.getNamespace(o,t),m=[{operation:`create${l}`,variables:{...r&&{namespace:{type:"String",value:f}},object:{type:`${Ez(s,d,l)}!`,value:t}},fields:["__typename"]}],A=mA(this.calcQueryOptions(m,[{operation:s},{operation:d}])),T=this.parseGQLQuery(A.query);return this.apolloFactory.apollo(o).mutate({mutation:T,fetchPolicy:"no-cache",variables:A.variables}).pipe(md(k=>(this.alertErrors(k),console.error("Error executing GraphQL query.",k),$h(()=>k))))}update(t,i,o,r=!1,s=["__typename"]){const l=Cd(o),{apiGroup:d,entity:f,version:m}=i,v=this.getNamespace(o),A=_A(t),T=[{operation:`update${f}`,variables:{...l&&{namespace:{type:"String",value:v}},name:{type:"String!",value:t.metadata.name},object:{type:`${Ez(d,m,f)}!`,value:A}},fields:s}],Z=mA(this.calcQueryOptions(T,[{operation:d},{operation:m}])),ee=this.parseGQLQuery(Z.query);return this.apolloFactory.apollo(o,r).mutate({mutation:ee,fetchPolicy:"no-cache",variables:Z.variables}).pipe(mo(fe=>y1(fe.data,tm({apiGroup:d,entity:`update${f}`,version:m},"."))),md(fe=>(this.alertErrors(fe),console.error("Error executing GraphQL query.",fe),$h(()=>fe))))}getNamespace(t,i){if(t.namespaceId)return t.namespaceId;if(i?.metadata?.namespace)return i.metadata.namespace;const o=this.luigiCoreService.routing().getSearchParams().namespace;return o?"-all-"===o?void 0:o:void 0}normalizeGqlBuilderVariables(t){return Object.fromEntries(Object.entries(t).map(([i,o])=>[i,o.value]))}calcQueryOptions(t,i){const o=i.filter(l=>!!l?.operation);if(0===o.length){const l=t.pop();if(l&&l.operation&&l.fields)return l;throw new Error("At least one wrapper or inner fields is required")}let r=t,s=o.pop();return o.forEach(l=>{r=[{operation:s.operation,fields:t,variables:s.variables}],s=l}),{operation:s.operation,fields:r,variables:s.variables}}parseGQLQuery(t){try{return rA`
82
82
  ${t}
83
83
  `}catch(i){throw this.luigiCoreService.showAlert({text:`Could not parse gql query: <br/><br/> ${t} <br/><br/> ${i.message}`,type:"error"}),i}}asReadResources(){return{list:(t,i,o)=>this.list(o.operation??t.resourceDefinition?.entityCollection??"",o.fields??t.resourceDefinition?.ui?.listView?.fields??[],t,{readFromParentKcpPath:o.readFromParentKcpPath??!1,pagination:{limit:i.limit,continue:i.cursor}}).pipe(mo(d=>({items:d?.items??[],nextCursor:d?.continue,remainingItemCount:d?.remainingItemCount,resourceVersion:d?.resourceVersion}))),subscribe:(t,i)=>{const o=t.resourceDefinition?.entityCollection??"",r=Array.isArray(i.fields)?i.fields:t.resourceDefinition?.ui?.listView?.fields??[];return this.resourceChangeSubscription(o,r,t,i.resourceVersion??"",i.readFromParentKcpPath??!1)}}}static{this.\u0275fac=function(i){return new(i||n)}}static{this.\u0275prov=Ft({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();const FIe=rA`
84
84
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platform-mesh/portal-ui-lib",
3
- "version": "0.49.38",
3
+ "version": "0.49.40",
4
4
  "repository": {
5
5
  "url": "git+https://github.com/platform-mesh/portal-ui-lib.git"
6
6
  },