@platform-mesh/portal-ui-lib 0.53.1 → 0.53.3

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.
@@ -79,7 +79,7 @@ class Xs{headers;normalizedNames=new Map;lazyInit;lazyUpdate=null;constructor(e)
79
79
  * @license Angular v21.2.20
80
80
  * (c) 2010-2026 Google LLC. https://angular.dev/
81
81
  * License: MIT
82
- */globalThis.$localize=H7;const xo=globalThis.Luigi;let ar=(()=>{class n{setConfig(t){return xo.setConfig(t)}get config(){return xo.getConfig()}getConfigValue(t){return xo.getConfigValue(t)}unloadConfig(){return xo.unload()}sendCustomMessage(t){return xo.sendCustomMessage(t)}configChanged(t){xo.configChanged(t)}customMessages(){return xo.customMessages()}navigation(){return xo.navigation()}resetLuigi(){xo.reset()}clearNavigationCache(){xo.clearNavigationCache&&xo.clearNavigationCache()}showAlert(t){return xo.showAlert(t)}ux(){return xo.ux()}theming(){return xo.theming()}i18n(){return xo.i18n()}globalSearch(){return xo.globalSearch()}getGlobalContext(){return xo.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){xo.setGlobalContext(t,i)}setInGlobalContext(t,i=!1){xo.setGlobalContext({...this.getGlobalContext(),...t},i)}routing(){return xo.routing()}setFeatureToggle(t){xo.featureToggles().setFeatureToggle(t)}unsetFeatureToggle(t){xo.featureToggles().unsetFeatureToggle(t)}unsetAllFeatureToggles(){xo.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 xo.featureToggles().getActiveFeatureToggleList().includes(t)}getActiveFeatureToggleList(){return xo.featureToggles().getActiveFeatureToggleList()}setAuthData(t){xo.auth().store.setAuthData(t),xo.auth().store.setNewlyAuthorized()}removeAuthData(){xo.auth().store.removeAuthData()}getAuthData(){return xo.auth().store.getAuthData()}setCurrentLocale(t){xo.i18n().setCurrentLocale(t)}static{this.\u0275fac=function(i){return new(i||n)}}static{this.\u0275prov=Bt({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})(),vu=(()=>{class n{constructor(t){this.http=t,this.authEventSubject=new Li,this.parseJwt=i=>{try{return function xye(n,e){if("string"!=typeof n)throw new P5("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 P5(`Invalid token specified: missing part #${t+1}`);let o;try{o=function Eye(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 Sye(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 P5(`Invalid token specified: invalid base64 for part #${t+1} (${r.message})`)}try{return JSON.parse(o)}catch(r){throw new P5(`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 S5(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)(Dn(hu))}}static{this.\u0275prov=Bt({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})(),y1=(()=>{class n{constructor(){this.http=we(hu)}getEnvConfig(){var t=this;return(0,N.A)(function*(){return t.envConfigCache||(yield S5(t.http.get("/rest/envconfig").pipe(f1(i=>t.envConfigCache=i)))),t.envConfigCache})()}static{this.\u0275fac=function(i){return new(i||n)}}static{this.\u0275prov=Bt({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})(),bd=(()=>{class n{constructor(){this.envConfigService=we(y1),this.luigiCoreService=we(ar),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=Bt({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();var w1=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}(w1||{});(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(w1.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 WH=(()=>{class n{constructor(){this.luigiCoreService=we(ar)}getGatewayUrl(t,i=!1){const o=t.portalContext.crdGatewayApiUrl,r=this.extractKcpPath(o);return o?.replace(r,this.resolveKcpPath(t,i))}updateCrdGatewayUrlWithEntityPath(t){const i=this.luigiCoreService.getGlobalContext().portalContext.crdGatewayApiUrl,o=this.extractKcpPath(i);this.luigiCoreService.getGlobalContext().portalContext.crdGatewayApiUrl=i.replace(o,t)}resolveKcpPath(t,i=!1){let r=this.extractKcpPath(t.portalContext.crdGatewayApiUrl);if(t.kcpPath&&(r=t.kcpPath),i){const s=r.lastIndexOf(":");-1!==s&&(r=r.slice(0,s))}return r}extractKcpPath(t){return t.match(new RegExp("(root:orgs[^/]*)"))?.[1]||""}static{this.\u0275fac=function(i){return new(i||n)}}static{this.\u0275prov=Bt({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();const bu=new Ln(n=>n.complete());function Wa(n,e){return n.definitions.find(t=>"OperationDefinition"===t.kind&&!!t.name)?.name.value??e}function j7(n,e){if(!n)throw new Error(e)}function aw(n){return G7(n,[])}function G7(n,e){switch(typeof n){case"string":return JSON.stringify(n);case"function":return n.name?`[function ${n.name}]`:"[function]";case"object":return function Owe(n,e){if(null===n)return"null";if(e.includes(n))return"[Circular]";const t=[...e,n];if(function Bwe(n){return"function"==typeof n.toJSON}(n)){const i=n.toJSON();if(i!==n)return"string"==typeof i?i:G7(i,t)}else if(Array.isArray(n))return function Fwe(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(G7(n[r],e));return 1===i?o.push("... 1 more item"):i>1&&o.push(`... ${i} more items`),"["+o.join(", ")+"]"}(n,t);return function Pwe(n,e){const t=Object.entries(n);return 0===t.length?"{}":e.length>2?"["+function Hwe(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+": "+G7(r,e)).join(", ")+" }"}(n,t)}(n,e);default:return String(n)}}class Uwe{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 ZH{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 YH={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"]},zwe=new Set(Object.keys(YH));function KH(n){const e=n?.kind;return"string"==typeof e&&zwe.has(e)}var Cu=function(n){return n.QUERY="query",n.MUTATION="mutation",n.SUBSCRIPTION="subscription",n}(Cu||{}),hn=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}(hn||{});const zh=Object.freeze({});function yu(n,e,t=YH){const i=new Map;for(const _e of Object.values(hn))i.set(_e,lw(e,_e));let o,m,b,r=Array.isArray(n),s=[n],l=-1,d=[],f=n;const w=[],T=[];do{l++;const _e=l===s.length,xe=_e&&0!==d.length;if(_e){if(m=0===T.length?void 0:w[w.length-1],f=b,b=T.pop(),xe)if(r){f=f.slice();let St=0;for(const[Vt,Un]of d){const In=Vt-St;null===Un?(f.splice(In,1),St++):f[In]=Un}}else{f={...f};for(const[St,Vt]of d)f[St]=Vt}l=o.index,s=o.keys,d=o.edits,r=o.inArray,o=o.prev}else if(b){if(m=r?l:s[l],f=b[m],null==f)continue;w.push(m)}let pt;if(!Array.isArray(f)){var M,Y;KH(f)||j7(!1,`Invalid AST Node: ${aw(f)}.`);const St=_e?null===(M=i.get(f.kind))||void 0===M?void 0:M.leave:null===(Y=i.get(f.kind))||void 0===Y?void 0:Y.enter;if(pt=St?.call(e,f,m,b,w,T),pt===zh)break;if(!1===pt){if(!_e){w.pop();continue}}else if(void 0!==pt&&(d.push([m,pt]),!_e)){if(!KH(pt)){w.pop();continue}f=pt}}var te;void 0===pt&&xe&&d.push([m,f]),_e?w.pop():(o={inArray:r,index:l,keys:s,edits:d,prev:o},r=Array.isArray(f),s=r?f:null!==(te=t[f.kind])&&void 0!==te?te:[],l=-1,d=[],b&&T.push(b),b=f)}while(void 0!==o);return 0!==d.length?d[d.length-1][1]:n}function lw(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 kf(n){try{return n()}catch{}}const cw=kf(()=>globalThis)||kf(()=>window)||kf(()=>self)||kf(()=>global)||kf(function(){return kf.constructor("return this")()}),uw="4.2.11",XH=new Map;function qH(n){const e=XH.get(n)||1;return XH.set(n,e+1),`${n}:${e}:${Math.random().toString(36).slice(2)}`}const JH="Invariant Violation";class dw extends Error{constructor(e=JH){super(e),this.name=JH,Object.setPrototypeOf(this,dw.prototype)}}const W7=["debug","log","warn","error","silent"];let hw=W7.indexOf("silent");function vn(n,...e){if(!n)throw yl(...e)}function $7(n){return function(e,...t){if(W7.indexOf(n)>=hw){const i=console[n]||console.log;if("number"==typeof e){const o=e;(e=tU(o))||(e=nU(o,t),t=[])}i(e,...t)}}}function yl(n,...e){return new dw(tU(n,e)||nU(n,e))}vn.debug=$7("debug"),vn.log=$7("log"),vn.warn=$7("warn"),vn.error=$7("error");const eU=Symbol.for("ApolloErrorMessageHandler_"+uw);function _w(n){if("string"==typeof n)return n;try{return function QH(n,e=0){const t=qH("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 tU(n,e=[]){if(n)return cw[eU]&&cw[eU](n,e.map(_w))}function nU(n,e=[]){if(n)return"string"==typeof n?e.reduce((t,i)=>t.replace(/%[sdfo]/,_w(i)),n):`An error occurred! For more details, see the full error text at https://go.apollo.dev/c/err#${encodeURIComponent(JSON.stringify({version:uw,message:n,args:e.map(_w)}))}`}const Cd={...cw[Symbol.for("apollo.cacheSize")]},jwe=()=>Object.create(null),{forEach:Gwe,slice:iU}=Array.prototype,{hasOwnProperty:Wwe}=Object.prototype;class wu{constructor(e=!0,t=jwe){this.weakness=e,this.makeData=t}lookup(){return this.lookupArray(arguments)}lookupArray(e){let t=this;return Gwe.call(e,i=>t=t.getChildTrie(i)),Wwe.call(t,"data")?t.data:t.data=this.makeData(iU.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(iU.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 wu(this.weakness,this.makeData)),i}mapFor(e,t){return this.weakness&&function $we(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 pw(){}const Zwe=pw,Ywe=typeof WeakRef<"u"?WeakRef:function(n){return{deref:()=>n}},Kwe=typeof WeakMap<"u"?WeakMap:Map,Xwe=typeof FinalizationRegistry<"u"?FinalizationRegistry:function(){return{register:pw,unregister:pw}};class Z7{constructor(e=1/0,t=Zwe){this.max=e,this.dispose=t,this.map=new Kwe,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 Ywe(s),this.registry.register(s,r,r)}this.unfinalizedNodes.size>0?queueMicrotask(this.finalize):this.finalizationScheduled=!1},this.registry=new Xwe(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 Qwe(){}class fw{constructor(e=1/0,t=Qwe){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 gw=new WeakSet;function oU(n){n.size<=(n.max||-1)||gw.has(n)||(gw.add(n),setTimeout(()=>{n.clean(),gw.delete(n)},100))}const mw=function(n,e){const t=new Z7(n,e);return t.set=function(i,o){const r=Z7.prototype.set.call(this,i,o);return oU(this),r},t},Jwe=function(n,e){const t=new fw(n,e);return t.set=function(i,o){const r=fw.prototype.set.call(this,i,o);return oU(this),r},t};function rU(n,{max:e,makeCacheKey:t=i=>i}){const i=new wu(!0),o=new mw(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 Vh=rU((n,e)=>{vn(n&&"Document"===n.kind,1);const t=n.definitions.filter(i=>"OperationDefinition"===i.kind);e&&vn(1==t.length&&t[0].operation===e,4,e,e,t[0].operation),yu(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===hn.FIELD&&d.push(l.alias?.value||l.name.value);throw d.splice(-1,1,i.name.value),yl(5,i.alias.value,d.join("."),t[0].operation,Wa(n,"(anonymous)"))}}})},{max:Cd.checkDocument||2e3});function yd(n){return Vh(n),n.definitions.filter(e=>"OperationDefinition"===e.kind)[0]}class ks{static empty(){return new ks(()=>bu)}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 eAe(n,{client:e}){const t={query:n.query,variables:n.variables||{},extensions:n.extensions||{},operationName:Wa(n.query),operationType:yd(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),()=>bu)}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 yl(65)}left;right}const tAe=ks.split,{toString:sU,hasOwnProperty:nAe}=Object.prototype,aU=Function.prototype.toString,vw=new Map;function jo(n,e){try{return bw(n,e)}finally{vw.clear()}}function bw(n,e){if(n===e)return!0;const t=sU.call(n);if(t!==sU.call(e))return!1;switch(t){case"[object Array]":if(n.length!==e.length)return!1;case"[object Object]":{if(cU(n,e))return!0;const o=lU(n),r=lU(e),s=o.length;if(s!==r.length)return!1;for(let l=0;l<s;++l)if(!nAe.call(e,o[l]))return!1;for(let l=0;l<s;++l){const d=o[l];if(!bw(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(cU(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&&!bw(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=aU.call(n);return o===aU.call(e)&&!function rAe(n,e){const t=n.length-e.length;return t>=0&&n.indexOf(e,t)===t}(o,oAe)}}return!1}function lU(n){return Object.keys(n).filter(iAe,n)}function iAe(n){return void 0!==this[n]}const oAe="{ [native code] }";function cU(n,e){let t=vw.get(n);if(t){if(t.has(e))return!0}else vw.set(n,t=new Set);return t.add(e),!1}let Os=null;const uU={};let sAe=1;function dU(n){try{return n()}catch{}}const Cw="@wry/context:Slot",hU=dU(()=>globalThis)||dU(()=>global)||Object.create(null),Y7=hU[Cw]||Array[Cw]||function(n){try{Object.defineProperty(hU,Cw,{value:n,enumerable:!1,writable:!1,configurable:!0})}finally{return n}}(class{constructor(){this.id=["slot",sAe++,Date.now(),Math.random().toString(36).slice(2)].join(":")}hasValue(){for(let e=Os;e;e=e.parent)if(this.id in e.slots){const t=e.slots[this.id];if(t===uU)break;return e!==Os&&(Os.slots[this.id]=t),!0}return Os&&(Os.slots[this.id]=uU),!1}getValue(){if(this.hasValue())return Os.slots[this.id]}withValue(e,t,i,o){const s=Os;Os={parent:s,slots:{__proto__:null,[this.id]:e}};try{return t.apply(o,i)}finally{Os=s}}static bind(e){const t=Os;return function(){const i=Os;try{return Os=t,e.apply(this,arguments)}finally{Os=i}}}static noContext(e,t,i){if(!Os)return e.apply(i,t);{const o=Os;try{return Os=null,e.apply(i,t)}finally{Os=o}}}}),U5=new Y7,{hasOwnProperty:uAe}=Object.prototype,ww=Array.from||function(n){const e=[];return n.forEach(t=>e.push(t)),e};function K7(n){const{unsubscribe:e}=n;"function"==typeof e&&(n.unsubscribe=void 0,e())}const z5=[];function Of(n,e){if(!n)throw new Error(e||"assertion failure")}function pU(n,e){const t=n.length;return t>0&&t===e.length&&n[t-1]===e[t-1]}function fU(n){switch(n.length){case 0:throw new Error("unknown value");case 1:return n[0];case 2:throw n[1]}}function gU(n){return n.slice(0)}let hAe=(()=>{class n{constructor(t){this.fn=t,this.parents=new Set,this.childValues=new Map,this.dirtyChildren=null,this.dirty=!0,this.recomputing=!1,this.value=[],this.deps=null,++n.count}peek(){if(1===this.value.length&&!jh(this))return mU(this),this.value[0]}recompute(t){return Of(!this.recomputing,"already recomputing"),mU(this),jh(this)?function _Ae(n,e){return AU(n),U5.withValue(n,pAe,[n,e]),function gAe(n,e){if("function"==typeof n.subscribe)try{K7(n),n.unsubscribe=n.subscribe.apply(null,e)}catch{return n.setDirty(),!1}return!0}(n,e)&&function fAe(n){n.dirty=!1,!jh(n)&&bU(n)}(n),fU(n.value)}(this,t):fU(this.value)}setDirty(){this.dirty||(this.dirty=!0,vU(this),K7(this))}dispose(){this.setDirty(),AU(this),Aw(this,(t,i)=>{t.setDirty(),TU(t,this)})}forget(){this.dispose()}dependOn(t){t.add(this),this.deps||(this.deps=z5.pop()||new Set),this.deps.add(t)}forgetDeps(){this.deps&&(ww(this.deps).forEach(t=>t.delete(this)),this.deps.clear(),z5.push(this.deps),this.deps=null)}}return n.count=0,n})();function mU(n){const e=U5.getValue();if(e)return n.parents.add(e),e.childValues.has(n)||e.childValues.set(n,[]),jh(n)?CU(e,n):yU(e,n),e}function pAe(n,e){n.recomputing=!0;const{normalizeResult:t}=n;let i;t&&1===n.value.length&&(i=gU(n.value)),n.value.length=0;try{if(n.value[0]=n.fn.apply(null,e),t&&i&&!pU(i,n.value))try{n.value[0]=t(n.value[0],i[0])}catch{}}catch(o){n.value[1]=o}n.recomputing=!1}function jh(n){return n.dirty||!(!n.dirtyChildren||!n.dirtyChildren.size)}function vU(n){Aw(n,CU)}function bU(n){Aw(n,yU)}function Aw(n,e){const t=n.parents.size;if(t){const i=ww(n.parents);for(let o=0;o<t;++o)e(i[o],n)}}function CU(n,e){Of(n.childValues.has(e)),Of(jh(e));const t=!jh(n);if(n.dirtyChildren){if(n.dirtyChildren.has(e))return}else n.dirtyChildren=z5.pop()||new Set;n.dirtyChildren.add(e),t&&vU(n)}function yU(n,e){Of(n.childValues.has(e)),Of(!jh(e));const t=n.childValues.get(e);0===t.length?n.childValues.set(e,gU(e.value)):pU(t,e.value)||n.setDirty(),wU(n,e),!jh(n)&&bU(n)}function wU(n,e){const t=n.dirtyChildren;t&&(t.delete(e),0===t.size&&(z5.length<100&&z5.push(t),n.dirtyChildren=null))}function AU(n){n.childValues.size>0&&n.childValues.forEach((e,t)=>{TU(n,t)}),n.forgetDeps(),Of(null===n.dirtyChildren)}function TU(n,e){e.parents.delete(n),n.childValues.delete(e),wU(n,e)}const mAe={setDirty:!0,dispose:!0,forget:!0};function IU(n){const e=new Map,t=n&&n.subscribe;function i(o){const r=U5.getValue();if(r){let s=e.get(o);s||e.set(o,s=new Set),r.dependOn(s),"function"==typeof t&&(K7(s),s.unsubscribe=t(o))}}return i.dirty=function(r,s){const l=e.get(r);if(l){const d=s&&uAe.call(mAe,s)?s:"setDirty";ww(l).forEach(f=>f[d]()),e.delete(r),K7(l)}},i}let SU;function EU(...n){return(SU||(SU=new wu("function"==typeof WeakMap))).lookupArray(n)}const Tw=new Set;function V5(n,{max:e=Math.pow(2,16),keyArgs:t,makeCacheKey:i=EU,normalizeResult:o,subscribe:r,cache:s=fw}=Object.create(null)){const l="function"==typeof s?new s(e,w=>w.dispose()):s,d=function(){const w=i.apply(null,t?t.apply(null,arguments):arguments);if(void 0===w)return n.apply(null,arguments);let T=l.get(w);T||(l.set(w,T=new hAe(n)),T.normalizeResult=o,T.subscribe=r,T.forget=()=>l.delete(w));const M=T.recompute(Array.prototype.slice.call(arguments));return l.set(w,T),Tw.add(l),U5.hasValue()||(Tw.forEach(Y=>Y.clean()),Tw.clear()),M};function f(w){const T=w&&l.get(w);T&&T.setDirty()}function m(w){const T=w&&l.get(w);if(T)return T.peek()}function b(w){return!!w&&l.delete(w)}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=b,d.forget=function(){return b(i.apply(null,arguments))},d.makeCacheKey=i,d.getKey=t?function(){return i.apply(null,t.apply(null,arguments))}:i,Object.freeze(d)}function vAe(n){return n}class wd{transform;cached;resultCache=new WeakSet;getCacheKey(e){return[e]}static identity(){return new wd(vAe,{cache:!1})}static split(e,t,i=wd.identity()){return Object.assign(new wd(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 wu;this.performWork=V5(wd.prototype.performWork.bind(this),{makeCacheKey:t=>{const i=this.getCacheKey(t);if(i)return vn(Array.isArray(i),20),e.lookupArray(i)},max:Cd["documentTransform.cache"],cache:Z7})}}performWork(e){return Vh(e),this.transform(e)}transformDocument(e){if(this.resultCache.has(e))return e;const t=this.performWork(e);return this.resultCache.add(t),t}concat(e){return Object.assign(new wd(t=>e.transformDocument(this.transformDocument(t)),{cache:!1}),{left:this,right:e})}left;right}const xU={kind:hn.FIELD,name:{kind:hn.NAME,value:"__typename"}},Iw=Object.assign(function(n){return yu(n,{SelectionSet:{enter(e,t,i){if(i&&i.kind===hn.OPERATION_DEFINITION)return;const{selections:o}=e;return o&&!o.some(l=>l.kind===hn.FIELD&&("__typename"===l.name.value||0===l.name.value.lastIndexOf("__",0)))?i.kind===hn.FIELD&&i.directives&&i.directives.some(l=>"export"===l.name.value)?void 0:{...e,selections:[...o,xU]}:void 0}}})},{added:n=>n===xU}),Ad=Object.assign(function(e){return JSON.stringify(e,TAe)},{reset(){Bf=new Jwe(Cd.canonicalStringify||1e3)}});let Bf;function TAe(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(IAe))return e;const o=JSON.stringify(i);let r=Bf.get(o);if(!r){i.sort();const l=JSON.stringify(i);r=Bf.get(l)||i,Bf.set(o,r),Bf.set(l,r)}const s=Object.create(t);return r.forEach(l=>{s[l]=e[l]}),s}}return e}function IAe(n,e,t){return 0===e||t[e-1]<=n}function Dw(n){return 9===n||32===n}function j5(n){return n>=48&&n<=57}function MU(n){return n>=97&&n<=122||n>=65&&n<=90}function RU(n){return MU(n)||95===n}function SAe(n){return MU(n)||j5(n)||95===n}function EAe(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=xAe(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 xAe(n){let e=0;for(;e<n.length&&Dw(n.charCodeAt(e));)++e;return e}Ad.reset();const LAe=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function MAe(n){return RAe[n.charCodeAt(0)]}const RAe=["\\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 X7(n){return yu(n,OAe)}const OAe={Name:{leave:n=>n.value},Variable:{leave:n=>"$"+n.name},Document:{leave:n=>En(n.definitions,"\n\n")},OperationDefinition:{leave(n){const e=Nw(n.variableDefinitions)?Ti("(\n",En(n.variableDefinitions,"\n"),"\n)"):Ti("(",En(n.variableDefinitions,", "),")"),t=Ti("",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})=>Ti("",o,"\n")+n+": "+e+Ti(" = ",t)+Ti(" ",En(i," "))},SelectionSet:{leave:({selections:n})=>Ec(n)},Field:{leave({alias:n,name:e,arguments:t,directives:i,selectionSet:o}){const r=Ti("",n,": ")+e;let s=r+Ti("(",En(t,", "),")");return s.length>80&&(s=r+Ti("(\n",q7(En(t,"\n")),"\n)")),En([s,En(i," "),o]," ")}},Argument:{leave:({name:n,value:e})=>n+": "+e},FragmentSpread:{leave:({name:n,directives:e})=>"..."+n+Ti(" ",En(e," "))},InlineFragment:{leave:({typeCondition:n,directives:e,selectionSet:t})=>En(["...",Ti("on ",n),En(e," "),t]," ")},FragmentDefinition:{leave:({name:n,typeCondition:e,variableDefinitions:t,directives:i,selectionSet:o,description:r})=>Ti("",r,"\n")+`fragment ${n}${Ti("(",En(t,", "),")")} on ${e} ${Ti("",En(i," ")," ")}`+o},IntValue:{leave:({value:n})=>n},FloatValue:{leave:({value:n})=>n},StringValue:{leave:({value:n,block:e})=>e?function DAe(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||Dw(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 b="";const w=o&&Dw(n.charCodeAt(0));return(m&&!w||r)&&(b+="\n"),b+=t,(m||f)&&(b+="\n"),'"""'+b+'"""'}(n):function NAe(n){return`"${n.replace(LAe,MAe)}"`}(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+Ti("(",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})=>Ti("",n,"\n")+En(["schema",En(e," "),Ec(t)]," ")},OperationTypeDefinition:{leave:({operation:n,type:e})=>n+": "+e},ScalarTypeDefinition:{leave:({description:n,name:e,directives:t})=>Ti("",n,"\n")+En(["scalar",e,En(t," ")]," ")},ObjectTypeDefinition:{leave:({description:n,name:e,interfaces:t,directives:i,fields:o})=>Ti("",n,"\n")+En(["type",e,Ti("implements ",En(t," & ")),En(i," "),Ec(o)]," ")},FieldDefinition:{leave:({description:n,name:e,arguments:t,type:i,directives:o})=>Ti("",n,"\n")+e+(Nw(t)?Ti("(\n",q7(En(t,"\n")),"\n)"):Ti("(",En(t,", "),")"))+": "+i+Ti(" ",En(o," "))},InputValueDefinition:{leave:({description:n,name:e,type:t,defaultValue:i,directives:o})=>Ti("",n,"\n")+En([e+": "+t,Ti("= ",i),En(o," ")]," ")},InterfaceTypeDefinition:{leave:({description:n,name:e,interfaces:t,directives:i,fields:o})=>Ti("",n,"\n")+En(["interface",e,Ti("implements ",En(t," & ")),En(i," "),Ec(o)]," ")},UnionTypeDefinition:{leave:({description:n,name:e,directives:t,types:i})=>Ti("",n,"\n")+En(["union",e,En(t," "),Ti("= ",En(i," | "))]," ")},EnumTypeDefinition:{leave:({description:n,name:e,directives:t,values:i})=>Ti("",n,"\n")+En(["enum",e,En(t," "),Ec(i)]," ")},EnumValueDefinition:{leave:({description:n,name:e,directives:t})=>Ti("",n,"\n")+En([e,En(t," ")]," ")},InputObjectTypeDefinition:{leave:({description:n,name:e,directives:t,fields:i})=>Ti("",n,"\n")+En(["input",e,En(t," "),Ec(i)]," ")},DirectiveDefinition:{leave:({description:n,name:e,arguments:t,directives:i,repeatable:o,locations:r})=>Ti("",n,"\n")+"directive @"+e+(Nw(t)?Ti("(\n",q7(En(t,"\n")),"\n)"):Ti("(",En(t,", "),")"))+Ti(" ",En(i," "))+(o?" repeatable":"")+" on "+En(r," | ")},SchemaExtension:{leave:({directives:n,operationTypes:e})=>En(["extend schema",En(n," "),Ec(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,Ti("implements ",En(e," & ")),En(t," "),Ec(i)]," ")},InterfaceTypeExtension:{leave:({name:n,interfaces:e,directives:t,fields:i})=>En(["extend interface",n,Ti("implements ",En(e," & ")),En(t," "),Ec(i)]," ")},UnionTypeExtension:{leave:({name:n,directives:e,types:t})=>En(["extend union",n,En(e," "),Ti("= ",En(t," | "))]," ")},EnumTypeExtension:{leave:({name:n,directives:e,values:t})=>En(["extend enum",n,En(e," "),Ec(t)]," ")},InputObjectTypeExtension:{leave:({name:n,directives:e,fields:t})=>En(["extend input",n,En(e," "),Ec(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,Ti(".",e)])},ArgumentCoordinate:{leave:({name:n,fieldName:e,argumentName:t})=>En([n,Ti(".",e),Ti("(",t,":)")])},DirectiveCoordinate:{leave:({name:n})=>En(["@",n])},DirectiveArgumentCoordinate:{leave:({name:n,argumentName:e})=>En(["@",n,Ti("(",e,":)")])}};function En(n,e=""){var t;return null!==(t=n?.filter(i=>i).join(e))&&void 0!==t?t:""}function Ec(n){return Ti("{\n",q7(En(n,"\n")),"\n}")}function Ti(n,e,t=""){return null!=e&&""!==e?n+e+t:""}function q7(n){return Ti(" ",n.replace(/\n/g,"\n "))}function Nw(n){var e;return null!==(e=n?.some(t=>t.includes("\n")))&&void 0!==e&&e}let G5;const W5=Object.assign(n=>{let e=G5.get(n);return e||(e=X7(n),G5.set(n,e)),e},{reset(){G5=new mw(Cd.print||2e3)}});function Do(n){return!(!n||"object"!=typeof n||"string"!=typeof n.__ref)}function $5(n={}){const{connector:e=()=>new Li,resetOnError:t=!0,resetOnComplete:i=!0,resetOnRefCountZero:o=!0}=n;return r=>{let s,l,d,f=0,m=!1,b=!1;const w=()=>{l?.unsubscribe(),l=void 0},T=()=>{w(),s=d=void 0,m=b=!1},M=()=>{const Y=s;T(),Y?.unsubscribe()};return Hs((Y,te)=>{f++,!b&&!m&&w();const _e=d=d??e();te.add(()=>{f--,0===f&&!b&&!m&&(l=Mw(M,o))}),_e.subscribe(te),!s&&f>0&&(s=new bn({next:xe=>_e.next(xe),error:xe=>{b=!0,w(),l=Mw(T,t,xe),_e.error(xe)},complete:()=>{m=!0,w(),l=Mw(T,i),_e.complete()}}),nl(Y).subscribe(s))})(r)}}function Mw(n,e,...t){if(!0===e)return void n();if(!1===e)return;const i=new bn({next:()=>{i.unsubscribe(),n()}});return nl(e(...t)).subscribe(i)}function Q7(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,$5({connector:()=>new k3(i,e,t),resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:o})}W5.reset();const OU=rU(function(e,t,i){return function zAe(n,e){let t,i;function o(r){return r!==t&&(t=r,i=e(t)),i}return Object.assign(n.pipe(_o(o),Q7({bufferSize:1,refCount:!0})),{getCurrentResult:()=>o(n.getCurrentResult())})}(e,i)},{max:1,makeCacheKey:n=>n.slice(0,2)});function Z5(n=[]){const e={};return n.forEach(t=>{e[t.name.value]=t}),e}function Y5(n){return n.definitions.filter(e=>"FragmentDefinition"===e.kind)}function J7(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 vn(i,9,t),i||null}default:return null}}function Rw(n){let e;Vh(n);for(let t of n.definitions){if("OperationDefinition"===t.kind)return t;"FragmentDefinition"===t.kind&&!e&&(e=t)}if(e)return e;throw yl(12)}function K5(n){return"Field"===n.kind}function A1(n){return n.alias?n.alias.value:n.name.value}function e8({directives:n},e){return!n||!n.length||function GAe(n){const e=[];return n&&n.length&&n.forEach(t=>{if(!function jAe({name:{value:n}}){return"skip"===n||"include"===n}(t))return;const i=t.arguments,o=t.name.value;vn(i&&1===i.length,16,o);const r=i[0];vn(r.name&&"if"===r.name.value,17,o);const s=r.value;vn(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],vn(void 0!==o,15,t.name.value)):o=i.value.value,"skip"===t.name.value?!o:o})}function BU(n,{data:e,...t},{data:i,...o},r){return jo(t,o)&&t8(Rw(n).selectionSet,e,i,{fragmentMap:Z5(Y5(n)),variables:r})}function t8(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),!e8(r,i.variables))||PU(r))return!0;if(K5(r)){const s=A1(r),l=e&&e[s],d=t&&t[s],f=r.selectionSet;if(!f)return jo(l,d);const m=Array.isArray(l),b=Array.isArray(d);if(m!==b)return!1;if(m&&b){const w=l.length;if(d.length!==w)return!1;for(let T=0;T<w;++T)if(!t8(f,l[T],d[T],i))return!1;return!0}return t8(f,l,d,i)}{const s=J7(r,i.fragmentMap);if(s)return!!PU(s)||t8(s.selectionSet,e,t,i)}})}function PU(n){return!!n.directives&&n.directives.some(WAe)}function WAe(n){return"nonreactive"===n.name.value}function $Ae(n,e){let t=e;const i=[];return n.definitions.forEach(r=>{if("OperationDefinition"===r.kind)throw yl(10,r.operation,r.name?` named '${r.name.value}'`:"");"FragmentDefinition"===r.kind&&i.push(r)}),typeof t>"u"&&(vn(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 ZAe(...n){return EU.bind(null,...n)}class FU{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 wu(!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:OU(T,Symbol.for("apollo.transform.individualResult"),M=>({...M,data:M.data??{}}))}let d;function f(T){const M=T.reduce((Y,te,_e)=>(Y.data.push(te.data),Y.complete&&=te.complete,Y.dataState=Y.complete?"complete":"partial",te.missing&&(Y.missing||={},Y.missing[_e]=te.missing),Y),{data:[],dataState:"complete",complete:!0});return jo(d,M)||(d=M),d}if(0===l.length)return KAe;let m=!1;const b=l.map(T=>this.watchSingleFragment(T,r,e)),w=function VAe(n){return 0===n.length?bu:new Ln(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 b=f.subscribe({next:w=>{d.forEach(T=>i[T]=w),m||(m=!0,s--),s||(l||=new Set(n.filter(T=>T.dirty)),l.delete(f),l.size||(e.next(i.slice()),l=void 0))},complete:()=>{r--,r||e.complete()},error:e.error.bind(e)});e.add(b)})})}(b).pipe(_o(f),f1({subscribe:()=>m=!0,unsubscribe:()=>m=!1}),Q7({bufferSize:1,refCount:!0}));return Object.assign(w,{getCurrentResult:()=>m&&d?d:f(b.map(M=>M.getCurrentResult()))})}onAfterBroadcast=e=>e();watchSingleFragment(e,t,i){if(null===e)return YAe;const{optimistic:o=!0,variables:r}=i,s=[t,Ad({id:e,optimistic:o,variables:r})],l=this.fragmentWatches.lookupArray(s);if(!l.observable){let f,m=function(w){const T=w.result;return(!f||!BU(t,{data:f.data},{data:T},i.variables))&&(f={data:T,dataState:w.complete?"complete":"partial",complete:w.complete},w.missing&&(f.missing=w.missing.missing)),f},d=!1;const b=new Ln(w=>{d=!0;const T=this.watch({variables:r,returnPartialData:!0,id:e,query:t,optimistic:o,immediate:!0,callback:M=>{b.dirty=!0,this.onAfterBroadcast(()=>{w.next(m(M)),b.dirty=!1})}});return()=>{d=!1,T(),this.fragmentWatches.removeArray(s)}}).pipe(BP(),$5({connector:()=>new k3(1),resetOnRefCountZero:()=>function UAe(n=0,e,t=p8e){let i=-1;return null!=e&&(PR(e)?t=e:i=e),new Ln(o=>{let r=function HAe(n){return n instanceof Date&&!isNaN(n)}(n)?+n-t.now():n;r<0&&(r=0);let s=0;return t.schedule(function(){o.closed||(o.next(s++),0<=i?this.schedule(void 0,i):o.complete())},r)})}(0)}));l.observable=Object.assign(b,{dirty:!1,getCurrentResult:()=>d&&f?f:m(this.diff({id:e,query:t,returnPartialData:!0,optimistic:o,variables:r}))})}return l.observable}getFragmentDoc=V5($Ae,{max:Cd["cache.fragmentQueryDocuments"]||1e3,cache:Z7,makeCacheKey:ZAe(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 HU=Object.freeze({data:null,dataState:"complete",complete:!0}),YAe=Object.assign(new Ln(n=>{n.next(HU)}),{dirty:!1,getCurrentResult:()=>HU}),UU=Object.freeze({data:[],dataState:"complete",complete:!0}),KAe=Object.assign(new Ln(n=>{n.next(UU)}),{getCurrentResult:()=>UU});function qs(n){return null!==n&&"object"==typeof n}const{hasOwnProperty:XAe}=Object.prototype,qAe=function(n,e,t){return this.merge(n[t],e[t])},zU=n=>isNaN(+n)?{}:[];class Pf{options;reconciler;constructor(e={}){this.options=e,this.reconciler=e.reconciler||qAe}merge(e,t,i={}){const o=i.atPath;if(o?.length){const[r,...s]=o;void 0===e&&(e=zU(r));let l=e[r];void 0===l&&s.length&&(l=zU(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)),qs(t)&&qs(e)?(Object.keys(t).forEach(r=>{if(XAe.call(e,r)){const s=e[r];if(t[r]!==s){const l=this.reconciler(e,t,r);l!==s&&((e=this.shallowCopyForMerge(e))[r]=l)}}else(e=this.shallowCopyForMerge(e))[r]=t[r]}),e):t}isObject=qs;pastCopies=new Set;shallowCopyForMerge(e){return qs(e)&&(this.pastCopies.has(e)||(e=Array.isArray(e)?e.slice(0):{__proto__:Object.getPrototypeOf(e),...e},this.pastCopies.add(e))),e}}function Ff(n){return{__ref:String(n)}}function Wh(...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 Br=Array.isArray,{hasOwnProperty:vs}=Object.prototype;function VU({__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 eTe={dataIdFromObject:VU,resultCaching:!0},jU=/^[_a-z][_0-9a-z]*/i;function $h(n){const e=n.match(jU);return e?e[0]:n}function kw(n,e,t){return!!qs(e)&&(Br(e)?e.every(i=>kw(n,i,t)):n.selections.every(i=>{if(K5(i)&&e8(i,t)){const o=A1(i);return vs.call(e,o)&&(!i.selectionSet||kw(i.selectionSet,e[o],t))}return!0}))}function Hf(n){return qs(n)&&!Do(n)&&!Br(n)}function GU(n,e){const t=Z5(Y5(n));return{fragmentMap:t,lookupFragment(i){let o=t[i];return!o&&e&&(o=e.lookup(i)),o||null}}}const i8={},Ow=()=>i8,WU={};class o8{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),vs.call(this.data,e)){const i=this.data[e];if(i&&vs.call(i,t))return i[t]}return"__typename"===t&&vs.call(this.policies.rootTypenamesById,e)?this.policies.rootTypenamesById[e]:this instanceof Au?this.parent.get(e,t):void 0}lookup(e,t){return t&&this.group.depend(e,"__exists"),vs.call(this.data,e)?this.data[e]:this instanceof Au?this.parent.lookup(e,t):this.policies.rootTypenamesById[e]?{}:void 0}merge(e,t){let i;Do(e)&&(e=e.__ref),Do(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;vn("string"==typeof i,105);const s=new Pf({reconciler:sTe}).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=$h(d);f!==d&&!this.policies.hasKeyArgs(s.__typename,f)&&(l[f]=1),void 0===s[d]&&!(this instanceof Au)&&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:i8,INVALIDATE:WU,isReference:Do,toReference:this.toReference,canRead:this.canRead,readField:(f,m)=>this.policies.readField("string"==typeof f?{fieldName:f,from:m||Ff(e)}:f,{store:this})};if(Object.keys(o).forEach(f=>{const m=$h(f);let b=o[f];if(void 0===b)return;const w="function"==typeof t?t:t[f]||(i?void 0:t[m]);if(w){let T=w===Ow?i8:w(b,{...d,fieldName:m,storeFieldName:f,storage:this.getStorage(e,f)});if(T===WU)this.group.dirty(e,f);else if(T===i8&&(T=void 0),T!==b&&(r[f]=T,s=!0,b=T,false)){const M=Y=>{if(void 0===this.lookup(Y.__ref))return!0};if(Do(T))M(T);else if(Array.isArray(T)){let te,Y=!1;for(const _e of T){if(Do(_e)){if(Y=!0,M(_e))break}else if("object"==typeof _e&&_e){const[xe]=this.policies.identify(_e);xe&&(te=_e)}if(Y&&void 0!==te)break}}}}void 0!==b&&(l=!1)}),s)return this.merge(e,r),l&&(this instanceof Au?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]:Ow}:Ow,!!i)}return!1}evict(e,t){let i=!1;return e.id&&(vs.call(this.data,e.id)&&(i=this.delete(e.id,e.fieldName,e.args)),this instanceof Au&&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=>{vs.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&&vs.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 Au?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=>{vs.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 Au;)o=o.parent;i.forEach(r=>o.delete(r))}return i}refs={};findChildRefIds(e){if(!vs.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=>{Do(r)&&(t[r.__ref]=!0),qs(r)&&Object.keys(r).forEach(s=>{const l=r[s];qs(l)&&o.add(l)})})}return this.refs[e]}makeCacheKey(){return this.group.keyMaker.lookupArray(arguments)}getFieldValue=(e,t)=>Do(e)?this.get(e.__ref,t):e&&e[t];canRead=e=>Do(e)?this.has(e.__ref):"object"==typeof e;toReference=(e,t)=>{if("string"==typeof e)return Ff(e);if(Do(e))return e;const[i]=this.policies.identify(e);if(i){const o=Ff(i);return t&&this.merge(i,e),o}};get supportsResultCaching(){return this.group.caching}}class $U{caching;parent;d=null;keyMaker;constructor(e,t=null){this.caching=e,this.parent=t,this.resetCaching()}resetCaching(){this.d=this.caching?IU():null,this.keyMaker=new wu}depend(e,t){if(this.d){this.d(Bw(e,t));const i=$h(t);i!==t&&this.d(Bw(e,i)),this.parent&&this.parent.depend(e,t)}}dirty(e,t){this.d&&this.d.dirty(Bw(e,t),"__exists"===t?"forget":"setDirty")}}function Bw(n,e){return e+"#"+n}function ZU(n,e){X5(n)&&n.group.depend(e,"__exists")}o8.Root=class oTe extends o8{constructor({policies:e,resultCaching:t=!0,seed:i}){super(e,new $U(t)),i&&this.replace(i)}stump=new rTe(this);addLayer(e,t){return this.stump.addLayer(e,t)}removeLayer(){return this}storageTrie=new wu;getStorage(){return this.storageTrie.lookupArray(arguments)}};class Au extends o8{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 Au(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=>{jo(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 vs.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 rTe extends Au{constructor(e){super("EntityStore.Stump",e,()=>{},new $U(e.group.caching,e.group))}removeLayer(){return this}merge(e,t){return this.parent.merge(e,t)}}function sTe(n,e,t){const i=n[t],o=e[t];return jo(i,o)?i:o}function X5(n){return!(!n||!n.supportsResultCaching)}const Pw=new Y7;function aTe(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 YU=Symbol.for("apollo.result.extensions"),Zh=Symbol.for("apollo.result.streamInfo"),lTe=Symbol.for("apollo.observableQuery.variablesUnknown");function Uf(n,e,t,i){if(t.kind===hn.INT||t.kind===hn.FLOAT)n[e.value]=Number(t.value);else if(t.kind===hn.BOOLEAN||t.kind===hn.STRING)n[e.value]=t.value;else if(t.kind===hn.OBJECT){const o={};t.fields.map(r=>Uf(o,r.name,r.value,i)),n[e.value]=o}else if(t.kind===hn.VARIABLE)n[e.value]=(i||{})[t.name.value];else if(t.kind===hn.LIST)n[e.value]=t.values.map(o=>{const r={};return Uf(r,e,o,i),r[e.value]});else if(t.kind===hn.ENUM)n[e.value]=t.value;else{if(t.kind!==hn.NULL)throw yl(19,e.value,t.kind);n[e.value]=null}}function Fw(n,e){if(n.arguments&&n.arguments.length){const t={};return n.arguments.forEach(({name:i,value:o})=>Uf(t,i,o,e)),t}return null}const cTe=["connection","include","skip","client","rest","export","nonreactive","stream"];let q5=Ad;const KU=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=q5(r);if("{}"!==s)return`${t.connection.key}(${s})`}return t.connection.key}let i=n;if(e){const o=q5(e);"{}"!==o&&(i+=`(${o})`)}return t&&Object.keys(t).forEach(o=>{-1===cTe.indexOf(o)&&(t[o]&&Object.keys(t[o]).length?i+=`@${o}(${q5(t[o])})`:i+=`@${o}`)}),i},{setStringify(n){const e=q5;return q5=n,e}});function Hw(n){return Array.isArray(n)&&n.length>0}const XU={};function Uw(n){const e=JSON.stringify(n);return XU[e]||(XU[e]={})}function qU(n){const e=Uw(n);return e.keyFieldsFn||(e.keyFieldsFn=(t,i)=>{const o=(s,l)=>i.readField(l,s),r=i.keyObject=zw(n,s=>{let l=zf(i.storeObject,s,o);return void 0===l&&t!==i.storeObject&&vs.call(t,s[0])&&(l=zf(t,s,ez)),vn(void 0!==l,108,s.join("."),t),l});return`${i.typename}:${JSON.stringify(r)}`})}function QU(n){const e=Uw(n);return e.keyArgsFn||(e.keyArgsFn=(t,{field:i,variables:o,fieldName:r})=>{const s=zw(n,d=>{const f=d[0],m=f.charAt(0);if("@"!==m){if("$"===m){const b=f.slice(1);if(o&&vs.call(o,b)){const w=d.slice(0);return w[0]=b,zf(o,w)}return}if(t)return zf(t,d)}else if(i&&Hw(i.directives)){const b=f.slice(1),w=i.directives.find(M=>M.name.value===b),T=w&&Fw(w,o);return T&&zf(T,d.slice(1))}}),l=JSON.stringify(s);return(t||"{}"!==l)&&(r+=":"+l),r})}function zw(n,e){const t=new Pf;return JU(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 JU(n){const e=Uw(n);if(!e.paths){const t=e.paths=[],i=[];n.forEach((o,r)=>{Br(o)?(JU(o).forEach(s=>t.push(i.concat(s))),i.length=0):(i.push(o),Br(n[r+1])||(t.push(i.slice(0)),i.length=0))})}return e.paths}function ez(n,e){return n[e]}function zf(n,e,t){return t=t||ez,tz(e.reduce(function i(o,r){return Br(o)?o.map(s=>i(s,r)):o&&t(o,r)},n))}function tz(n){return qs(n)?Br(n)?n.map(tz):zw(Object.keys(n).sort(),e=>zf(n,e)):n}const nz=new Y7,iz=new WeakMap;function Q5(n){let e=iz.get(n);return e||iz.set(n,e={vars:new Set,dep:IU()}),e}function oz(n){Q5(n).vars.forEach(e=>e.forgetCache(n))}function hTe(n){const e=new Set,t=new Set,i=function(r){if(arguments.length>0){if(n!==r){n=r,e.forEach(l=>{Q5(l).dep.dirty(i),function _Te(n){n.broadcastWatches&&n.broadcastWatches()}(l)});const s=Array.from(t);t.clear(),s.forEach(l=>l(n))}}else{const s=nz.getValue();s&&(o(s),Q5(s).dep(i))}return n};i.onNextChange=r=>(t.add(r),()=>{t.delete(r)});const o=i.attachCache=r=>(e.add(r),Q5(r).vars.add(i),i);return i.forgetCache=r=>e.delete(r),i}function Vw(n){return void 0!==n.args?n.args:n.field?Fw(n.field,n.variables):null}const pTe=()=>{},rz=(n,e)=>e.fieldName,sz=(n,e,{mergeObjects:t})=>t(n,e),az=(n,e)=>e,fTe=(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 gTe{config;typePolicies={};toBeAdded={};supertypeMap=new Map;fuzzySubtypes=new Map;cache;rootIdsByTypename={};rootTypenamesById={};usingPossibleTypes=!1;constructor(e){this.config=e,this.config={dataIdFromObject:VU,...e},this.cache=this.config.cache,this.setRootTypename("Query"),this.setRootTypename("Mutation"),this.setRootTypename("Subscription"),e.possibleTypes&&this.addPossibleTypes(e.possibleTypes),e.typePolicies&&this.addTypePolicies(e.typePolicies)}identify(e,t){const i=this,o=t&&(t.typename||t.storeObject?.__typename)||e.__typename;if(o===this.rootTypenamesById.ROOT_QUERY)return["ROOT_QUERY"];const r=t&&t.storeObject||e,s={...t,typename:o,storeObject:r,readField:t&&t.readField||((...m)=>{const b=jw(m,r);return i.readField(b,{store:i.cache.data,variables:b.variables})})};let l;const d=o&&this.getTypePolicy(o);let f=d&&d.keyFn||this.config.dataIdFromObject;return Pw.withValue(!0,()=>{for(;f;){const m=f({...e,...r},s);if(!Br(m)){l=m;break}f=qU(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),vs.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?sz:!1===f?az:d.merge}l(o,t.merge),o.keyFn=!1===r?pTe:Br(r)?qU(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:b,read:w,merge:T}=m;f.keyFn=!1===b?rz:Br(b)?QU(b):"function"==typeof b?b:f.keyFn,"function"==typeof w&&(f.read=w),l(f,T)}f.read&&f.merge&&(f.keyFn=f.keyFn||rz)})}setRootTypename(e,t=e){const i="ROOT_"+e.toUpperCase(),o=this.rootTypenamesById[i];t!==o&&(vn(!o||o===e,109,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(jU);(!o||o[0]!==i)&&this.fuzzySubtypes.set(i,new RegExp(i))})})}getTypePolicy(e){if(!vs.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=b=>{const w=this.getSupertypeSet(b,!1);w&&w.size&&l.indexOf(w)<0&&l.push(w)};let f=!(!i||!this.fuzzySubtypes.size),m=!1;for(let b=0;b<l.length;++b){const w=l[b];if(w.has(r))return s.has(r)||s.add(r),!0;w.forEach(d),f&&b===l.length-1&&kw(e.selectionSet,i,o)&&(f=!1,m=!0,this.fuzzySubtypes.forEach((T,M)=>{const Y=t.match(T);Y&&Y[0]===t&&d(M)}))}}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=Vw(e);for(;s;){const f=s(d,l);if(!Br(f)){r=f||i;break}s=QU(f)}}return void 0===r&&(r=e.field?function uTe(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})=>Uf(t[o.name.value],r,s,e))}));let i=null;return n.arguments&&n.arguments.length&&(i={},n.arguments.forEach(({name:o,value:r})=>Uf(i,o,r,e))),KU(n.name.value,i,t)}(e.field,e.variables):KU(i,Vw(e))),!1===r?i:i===$h(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=$h(r),l=t.store.getFieldValue(i,r),d=this.getFieldPolicy(e.typename,s),f=d&&d.read;if(f){const m=lz(this,i,e,t,t.store.getStorage(Do(i)?i.__ref:i,r));return nz.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===sz)return cz(l.store)(e,t);if(r===az)return t;l.overwrite&&(e=void 0);const m=l.extensions?.[Zh]?.deref()?.peekArray(s);if(m){const{current:w,previous:T}=m;if(T&&jo(T.incoming,t)&&jo(T.streamFieldInfo,w))return T.result}const b=r(e,t,function mTe(n,e,t,i,o,r){const s={...lz(n,e,t,i,o),extensions:i.extensions,existingData:r},l=i.extensions;if(l&&Zh in l){const{[Zh]: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:b}),b}}function lz(n,e,t,i,o){const r=n.getStoreFieldName(t),s=$h(r),l=t.variables||i.variables,{toReference:d,canRead:f}=i.store;return{args:Vw(t),field:t.field||null,fieldName:s,storeFieldName:r,variables:l,isReference:Do,toReference:d,storage:o,cache:n.cache,canRead:f,readField:(...m)=>n.readField(jw(m,e,l),i),mergeObjects:cz(i.store)}}function jw(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},vs.call(s,"from")||(s.from=e)),void 0===s.variables&&(s.variables=t),s}function cz(n){return function(t,i){if(Br(t)||Br(i))throw yl(112);if(qs(t)&&qs(i)){const o=n.getFieldValue(t,"__typename"),r=n.getFieldValue(i,"__typename");if(o&&r&&o!==r)return i;if(Do(t)&&Hf(i))return n.merge(t.__ref,i),t;if(Hf(t)&&Do(i))return n.merge(t,i.__ref),i;if(Hf(t)&&Hf(i))return{...t,...i}}return i}}function Gw(n){const e={},t=n&&n.variableDefinitions;return t&&t.length&&t.forEach(i=>{i.defaultValue&&Uf(e,i.variable.name,i.defaultValue)}),e}function vTe(n){let e=n[0]||{};const t=n.length;if(t>1){const i=new Pf;for(let o=1;o<t;++o)e=i.merge(e,n[o])}return e}class Ww 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__=Ww.prototype}missing}function dz(n){return[n.selectionSet,n.objectOrReference,n.context]}class bTe{executeSelectionSet;executeSubSelectedArray;config;knownResults=new WeakMap;constructor(e){this.config=e,this.executeSelectionSet=V5(t=>{const i=dz(t);return this.executeSelectionSet.peek(...i)||(ZU(t.context.store,t.enclosingRef.__ref),this.execSelectionSetImpl(t))},{max:Cd["inMemoryCache.executeSelectionSet"]||5e4,keyArgs:dz,makeCacheKey(t,i,o){if(X5(o.store))return o.store.makeCacheKey(t,Do(i)?i.__ref:i,o.varString)}}),this.executeSubSelectedArray=V5(t=>(ZU(t.context.store,t.enclosingRef.__ref),this.execSubSelectedArrayImpl(t)),{max:Cd["inMemoryCache.executeSubSelectedArray"]||1e4,makeCacheKey({field:t,array:i,context:o}){if(X5(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=Wh(Gw(function uz(n){const e=yd(n);return vn(e&&"query"===e.operation,13),e}(t)),o);const l=Ff(i),d=this.executeSelectionSet({selectionSet:Rw(t).selectionSet,objectOrReference:l,enclosingRef:l,context:{store:e,query:t,policies:s,variables:o,varString:Ad(o),...GU(t,this.config.fragments)}});let f;d.missing&&(f=new Ww(function CTe(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:b}=d;return{result:m?b:r?0===Object.keys(b).length?null:b:null,complete:m,missing:f}}isFresh(e,t,i,o){if(X5(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(Do(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 b=new Pf;function w(_e,xe){return _e.missing&&(m=b.merge(m,{[xe]:_e.missing})),_e.result}"string"==typeof d&&!s.rootIdsByTypename[d]&&f.push({__typename:d});const T=new Set(e.selections);T.forEach(_e=>{if(e8(_e,r))if(K5(_e)){let xe=s.readField({fieldName:_e.name.value,field:_e,variables:o.variables,from:t},o);const pt=A1(_e);void 0===xe?Iw.added(_e)||(m=b.merge(m,{[pt]:`Can't find field '${_e.name.value}' on ${Do(t)?t.__ref+" object":"object "+JSON.stringify(t,null,2)}`})):Br(xe)?xe.length>0&&(xe=w(this.executeSubSelectedArray({field:_e,array:xe,enclosingRef:i,context:o}),pt)):_e.selectionSet&&null!=xe&&(xe=w(this.executeSelectionSet({selectionSet:_e.selectionSet,objectOrReference:xe,enclosingRef:Do(xe)?xe:i,context:o}),pt)),void 0!==xe&&f.push({[pt]:xe})}else{const xe=J7(_e,o.lookupFragment);if(!xe&&_e.kind===hn.FRAGMENT_SPREAD)throw yl(113,_e.name.value);xe&&s.fragmentMatches(xe,d)&&xe.selectionSet.selections.forEach(T.add,T)}});const te={result:vTe(f),missing:m};return te.result&&this.knownResults.set(te.result,e),te}execSubSelectedArrayImpl({field:e,array:t,enclosingRef:i,context:o}){let r,s=new Pf;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:Br(d)?l(this.executeSubSelectedArray({field:e,array:d,enclosingRef:i,context:o}),f):e.selectionSet?l(this.executeSelectionSet({selectionSet:e.selectionSet,objectOrReference:d,enclosingRef:Do(d)?d:i,context:o}),f):d),missing:r}}}function Zw(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 TTe{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=yd(t),f=function iTe(){return new Pf}();r={...Gw(d),...r};const m={store:e,written:{},merge:(w,T)=>f.merge(w,T),variables:r,varString:Ad(r),...GU(t,this.fragments),overwrite:!!s,incomingById:new Map,clientOnly:!1,deferred:!1,flavors:new Map,extensions:l},b=this.processSelectionSet({result:i||{},dataId:o,selectionSet:d.selectionSet,mergeTree:{map:new Map},context:m,path:[]});if(!Do(b))throw yl(115,i);return m.incomingById.forEach(({storeObject:w,mergeTree:T},Y)=>{const te=Ff(Y);if(T&&T.map.size){const _e=this.applyMerges(T,te,w,m);if(Do(_e))return;w=_e}e.merge(Y,w)}),e.retain(b.__ref),b}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]||Kw(t,i,o.fragmentMap)||e&&o.store.get(e,"__typename");"string"==typeof f&&(d.__typename=f);const m=(...w)=>{const T=jw(w,d,o.variables);if(Do(T.from)){const M=o.incomingById.get(T.from.__ref);if(M){const Y=l.readField({...T,from:M.storeObject},o);if(void 0!==Y)return Y}}return l.readField(T,o)},b=new Set;this.flattenFields(i,t,o,f).forEach((w,T)=>{const M=A1(T),Y=t[M],te=[...s,T.name.value];if(b.add(T),void 0!==Y){const _e=l.getStoreFieldName({typename:f,fieldName:T.name.value,field:T,variables:w.variables}),xe=_z(r,_e);let St,pt=this.processFieldValue(Y,T,T.selectionSet?Zw(w,!1,!1):w,xe,te);T.selectionSet&&(Do(pt)||Hf(pt))&&(St=m("__typename",pt));const Vt=l.getMergeFunction(f,T.name.value,St);Vt?xe.info={field:T,typename:f,merge:Vt,path:te}:w.extensions?.[Zh]&&Array.isArray(pt)&&function ITe(n){return!!n.directives&&n.directives.some(e=>"stream"===e.name.value)}(T)?xe.info={field:T,typename:f,merge:fTe,path:te}:pz(r,_e),d=w.merge(d,{[_e]:pt})}});try{const[w,T]=l.identify(t,{typename:f,selectionSet:i,fragmentMap:o.fragmentMap,storeObject:d,readField:m});e=e||w,T&&(d=o.merge(d,T))}catch(w){if(!e)throw w}if("string"==typeof e){const w=Ff(e),T=o.written[e]||(o.written[e]=[]);if(T.indexOf(i)>=0||(T.push(i),this.reader&&this.reader.isFresh(t,w,i,o)))return w;const M=o.incomingById.get(e);return M?(M.storeObject=o.merge(M.storeObject,d),M.mergeTree=Yw(M.mergeTree,r),b.forEach(Y=>M.fieldNodeSet.add(Y))):o.incomingById.set(e,{storeObject:d,mergeTree:r8(r)?void 0:r,fieldNodeSet:b}),w}return d}processFieldValue(e,t,i,o,r){return t.selectionSet&&null!==e?Br(e)?e.map((s,l)=>{const d=this.processFieldValue(s,t,i,_z(o,l),[...r,l]);return pz(o,l),d}):this.processSelectionSet({result:e,selectionSet:t.selectionSet,context:i,mergeTree:o,path:r}):e}flattenFields(e,t,i,o=Kw(t,e,i.fragmentMap)){const r=new Map,{policies:s}=this.cache,l=new wu(!1);return function d(f,m){const b=l.lookup(f,m.clientOnly,m.deferred);b.visited||(b.visited=!0,f.selections.forEach(w=>{if(!e8(w,i.variables))return;let{clientOnly:T,deferred:M}=m;if(!(T&&M)&&Hw(w.directives)&&w.directives.forEach(Y=>{const te=Y.name.value;if("client"===te&&(T=!0),"defer"===te){const _e=Fw(Y,i.variables);(!_e||!1!==_e.if)&&(M=!0)}}),K5(w)){const Y=r.get(w);Y&&(T=T&&Y.clientOnly,M=M&&Y.deferred),r.set(w,Zw(i,T,M))}else{const Y=J7(w,i.lookupFragment);if(!Y&&w.kind===hn.FRAGMENT_SPREAD)throw yl(117,w.name.value);Y&&s.fragmentMatches(Y,o,t,i.variables)&&d(Y.selectionSet,Zw(i,T,M))}}))}(e,i),r}applyMerges(e,t,i,o,r){if(e.map.size&&!Do(i)){const s=Br(i)||!Do(t)&&!Hf(t)?void 0:t,l=i;let d;s&&!r&&(r=[Do(s)?s.__ref:s]);const f=(m,b)=>Br(m)?"number"==typeof b?m[b]:void 0:o.store.getFieldValue(m,String(b));e.map.forEach((m,b)=>{const w=f(s,b),T=f(l,b);if(void 0===T)return;r&&r.push(b);const M=this.applyMerges(m,w,T,o,r);M!==T&&(d=d||new Map,d.set(b,M)),r&&vn(r.pop()===b)}),d&&(i=Br(l)?l.slice(0):{...l},d.forEach((m,b)=>{i[b]=m}))}return e.info?this.cache.policies.runMergeFunction(t,i,e.info,o,r&&o.store.getStorage(...r)):i}}const hz=[];function _z({map:n},e){return n.has(e)||n.set(e,hz.pop()||{map:new Map}),n.get(e)}function Yw(n,e){if(n===e||!e||r8(e))return n;if(!n||r8(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,Yw(l,e.map.get(d))),s.delete(d)}),s.forEach(l=>{r.map.set(l,Yw(e.map.get(l),n.map.get(l)))})}return r}function r8(n){return!n||!(n.info||n.map.size)}function pz({map:n},e){const t=n.get(e);t&&r8(t)&&(hz.push(t),n.delete(e))}function Kw(n,e,t){let i;for(const o of e.selections)if(K5(o)){if("__typename"===o.name.value)return n[A1(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=Kw(n,J7(o,t).selectionSet,t);if("string"==typeof r)return r}}class gz extends FU{data;optimisticData;config;watches=new Set;storeReader;storeWriter;addTypenameTransform=new wd(Iw);maybeBroadcastWatch;assumeImmutableResults=!0;policies;makeVar=hTe;constructor(e={}){super(),this.config=function tTe(n){return Wh(eTe,n)}(e),this.policies=new gTe({cache:this,dataIdFromObject:this.config.dataIdFromObject,possibleTypes:this.config.possibleTypes,typePolicies:this.config.typePolicies}),this.init()}init(){const e=this.data=new o8.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 TTe(this,this.storeReader=new bTe({cache:this,fragments:e}),e),this.maybeBroadcastWatch=V5((t,i)=>this.broadcastWatch(t,i),{max:Cd["inMemoryCache.maybeBroadcastWatch"]||5e3,makeCacheKey:t=>{const i=t.optimistic?this.optimisticData:this.data;if(X5(i)){const{optimistic:o,id:r,variables:s}=t;return i.makeCacheKey(t.query,t.callback,Ad({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(vs.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 dTe(n){Q5(n).vars.forEach(e=>e.attachCache(n))}(this),this.watches.add(e),e.immediate&&this.maybeBroadcastWatch(e),()=>{this.watches.delete(e)&&!this.watches.size&&oz(this),this.maybeBroadcastWatch.forget(e)}}gc(e){Ad.reset(),W5.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(Do(e))return e.__ref;try{return this.policies.identify(e)[0]}catch(t){}}evict(e){if(!e.id){if(vs.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(),Ad.reset(),e&&e.discardWatches?(this.watches.forEach(t=>this.maybeBroadcastWatch.forget(t)),this.watches.clear(),oz(this)):this.broadcastWatches(),Promise.resolve()}removeOptimistic(e){const t=this.optimisticData.removeLayer(e);t!==this.optimisticData&&(this.optimisticData=t,this.broadcastWatches())}txCount=0;batch(e){const{update:t,optimistic:i=!0,removeOptimistic:o,onWatchUpdated:r}=e;let s;const l=f=>{const{data:m,optimisticData:b}=this;++this.txCount,f&&(this.data=this.optimisticData=f);try{return s=t(this)}finally{--this.txCount,this.data=m,this.optimisticData=b}},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 b=r.call(this,f,m);return!1!==b&&d.delete(f),b}}),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||!jo(i.result,o.result))&&e.callback(e.lastDiff=o,i)}}class mz extends ks{constructor(e){super((t,i)=>{const{...o}=t;return Object.defineProperty(o,"client",{enumerable:!1,value:t.client}),new Ln(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 J5(n,e,t){const i=new Set(n),o=i.size;return yu(e,{Directive(r){if(i.delete(r.name.value)&&(!t||!i.size))return zh}}),t?!i.size:i.size<o}class ETe{isIncrementalResult(e){return!1}prepareRequest(e){return vn(!J5(["defer","stream"],e.query),67),e}extractErrors(){}startRequest=void 0}const Xw=ks.execute;function s8(n,e){return Wh(n,e,e.variables&&{variables:Wh({...n&&n.variables,...e.variables})})}function xTe(n){return yu(n,{FragmentSpread(e){if(!e.directives?.some(({name:t})=>"unmask"===t.value))return null}})}function Yh(n,e){const t=Ce(n)?n:()=>n,i=o=>o.error(t());return new Ln(e?o=>e.schedule(i,0,o):i)}function Tu(n){return Hs((e,t)=>{let r,i=null,o=!1;i=e.subscribe(oa(t,void 0,void 0,s=>{r=nl(n(s,Tu(n)(e))),i?(i.unsubscribe(),i=null,r.subscribe(t)):o=!0})),o&&(i.unsubscribe(),i=null,r.subscribe(t))})}class Td{constructor(e,t,i){this.kind=e,this.value=t,this.error=i,this.hasValue="N"===e}observe(e){return function NTe(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 Ce(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?Cl(t):"E"===e?Yh(()=>i):"C"===e?bu:0;if(!o)throw new TypeError(`Unexpected notification kind ${e}`);return o}static createNext(e){return new Td("N",e)}static createError(e){return new Td("E",void 0,e)}static createComplete(){return Td.completeNotification}}function vz(n=1/0){return Rh(ci,n)}function em(...n){return function MTe(){return vz(1)}()(Vc(n,Yv(n)))}function qw(n,e){return"object"==typeof n&&null!==n&&n[Symbol.for("apollo.error")]===e}function Qw(n){Object.defineProperty(n,Symbol.for("apollo.error"),{value:n.name,enumerable:!1,writable:!1,configurable:!1})}function bz(n){return n.filter(e=>e).map(e=>e.message||"Error message not found.").join("\n")}Td.completeNotification=new Td("C");let tm=(()=>{class n extends Error{static is(t){return qw(t,"CombinedGraphQLErrors")}static formatMessage=bz;errors;data;extensions;constructor(t,i=t.errors||[]){super(n.formatMessage(i,{result:t,defaultFormatMessage:bz})),this.errors=i,this.data=t.data,this.extensions=t.extensions,this.name="CombinedGraphQLErrors",Qw(this),Object.setPrototypeOf(this,n.prototype)}}return n})();function Cz(n){return n.map(e=>e.message||"Error message not found.").join("\n")}let RTe=(()=>{class n extends Error{static is(t){return qw(t,"CombinedProtocolErrors")}static formatMessage=Cz;errors;constructor(t){super(n.formatMessage(t,{defaultFormatMessage:Cz})),this.name="CombinedProtocolErrors",this.errors=t,Qw(this),Object.setPrototypeOf(this,n.prototype)}}return n})();class Jw extends Error{static is(e){return qw(e,"UnconventionalError")}constructor(e){super("An error of unexpected shape occurred.",{cause:e}),this.name="UnconventionalError",Qw(this),Object.setPrototypeOf(this,Jw.prototype)}}const eA=Symbol(),yz=new WeakSet;function wz(n,e,t){return Pw.withValue(!0,()=>{const i=nm(n,e,t,!1);return Object.isFrozen(n),i})}function nm(n,e,t,i,o){const{knownChanged:r}=t,s=function FTe(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=nm(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===hn.FIELD){const f=A1(l),m=l.selectionSet;if(d=s[f]||n[f],void 0===d)continue;if(m&&null!==d){const b=nm(n[f],m,t,i,void 0);r.has(b)&&(d=b)}s[f]=d}if(l.kind===hn.INLINE_FRAGMENT&&(!l.typeCondition||t.cache.fragmentMatches(l,n.__typename))&&(d=nm(n,l.selectionSet,t,i,o)),l.kind===hn.FRAGMENT_SPREAD){const f=l.name.value,m=t.fragmentMap[f]||(t.fragmentMap[f]=t.cache.lookupFragment(f));vn(m,39,f);const b=aTe(l);"mask"!==b&&(d=nm(n,m.selectionSet,t,"migrate"===b,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 Az(n){return 7===n||8===n}function a8(n){return!Az(n)}function Vf(n){return!!n.errors?.length}function tA(n,e=()=>{}){return t=>new Ln(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 im(n){const e={data:n.data};return n.error&&(e.error=n.error),e}function VTe(n){let e=!1;return yu(n,{Directive:{enter(t){if("client"===t.name.value&&t.arguments&&(e=t.arguments.some(i=>"always"===i.name.value&&"BooleanValue"===i.value.kind&&!0===i.value.value),e))return zh}}}),e}function jTe(n,e){Vh(e);const t=Tz(""),i=Tz(""),o=te=>{for(let xe,_e=0;_e<te.length&&(xe=te[_e]);++_e)if(!Br(xe)){if(xe.kind===hn.OPERATION_DEFINITION)return t(xe.name&&xe.name.value);if(xe.kind===hn.FRAGMENT_DEFINITION)return i(xe.name.value)}return vn.error(14),null};let r=0;for(let te=e.definitions.length-1;te>=0;--te)e.definitions[te].kind===hn.OPERATION_DEFINITION&&++r;const s=function GTe(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=te=>Hw(te)&&te.map(s).some(_e=>_e&&_e.remove),d=new Map;let f=!1;const m={enter(te){if(l(te.directives))return f=!0,null}},b=yu(e,{Field:m,InlineFragment:m,VariableDefinition:{enter:()=>!1},Variable:{enter(te,_e,xe,pt,St){const Vt=o(St);Vt&&Vt.variables.add(te.name.value)}},FragmentSpread:{enter(te,_e,xe,pt,St){if(l(te.directives))return f=!0,null;const Vt=o(St);Vt&&Vt.fragmentSpreads.add(te.name.value)}},FragmentDefinition:{enter(te,_e,xe,pt){d.set(JSON.stringify(pt),te)},leave:(te,_e,xe,pt)=>te===d.get(JSON.stringify(pt))?te:r>0&&te.selectionSet.selections.every(Vt=>Vt.kind===hn.FIELD&&"__typename"===Vt.name.value)?(i(te.name.value).removed=!0,f=!0,null):void 0},Directive:{leave(te){if(s(te))return f=!0,null}}});if(!f)return e;const w=te=>(te.transitiveVars||(te.transitiveVars=new Set(te.variables),te.removed||te.fragmentSpreads.forEach(_e=>{w(i(_e)).transitiveVars.forEach(xe=>{te.transitiveVars.add(xe)})})),te),T=new Set;b.definitions.forEach(te=>{te.kind===hn.OPERATION_DEFINITION?w(t(te.name&&te.name.value)).fragmentSpreads.forEach(_e=>{T.add(_e)}):te.kind===hn.FRAGMENT_DEFINITION&&0===r&&!i(te.name.value).removed&&T.add(te.name.value)}),T.forEach(te=>{w(i(te)).fragmentSpreads.forEach(_e=>{T.add(_e)})});const Y={enter(te){if((te=>!(T.has(te)&&!i(te).removed))(te.name.value))return null}};return function WTe(n){return Iz(yd(n)||function kU(n){vn("Document"===n.kind,6),vn(n.definitions.length<=1,7);const e=n.definitions[0];return vn("FragmentDefinition"===e.kind,8),e}(n),Z5(Y5(n)))?null:n}(yu(b,{FragmentSpread:Y,FragmentDefinition:Y,OperationDefinition:{leave(te){if(te.variableDefinitions){const _e=w(t(te.name&&te.name.value)).transitiveVars;if(_e.size<te.variableDefinitions.length)return{...te,variableDefinitions:te.variableDefinitions.filter(xe=>_e.has(xe.variable.name.value))}}}}}))}function Tz(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 Iz(n,e){return!n||n.selectionSet.selections.every(t=>t.kind===hn.FRAGMENT_SPREAD&&Iz(e[t.name.value],e))}var Ii=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}(Ii||{});function Sz(n){return n.catch(()=>{}),n}const{assign:Ez}=Object,jf={loading:!0,networkStatus:Ii.loading,data:void 0,dataState:"empty",partial:!0},nA={loading:!1,networkStatus:Ii.ready,data:void 0,dataState:"empty",partial:!0};class iA{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[lTe]&&(vn("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=yd(this.query);this.queryName=l&&l.name&&l.name.value}initializeObservablesQueue(){this.subject=new Bs({query:this.query,variables:this.variables,result:jf,meta:{}});const e=this.subject.pipe(f1({subscribe:()=>{this.subject.observed||(this.reobserve(),setTimeout(()=>this.updatePolling()))},unsubscribe:()=>{this.subject.observed||this.tearDownQuery()}}),tA(({query:t,variables:i,result:o,meta:r},s)=>{const{shouldEmit:l}=r;if(o===jf&&(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 b=this.queryManager.getDocumentInfo(t),w=this.queryManager.dataMasking;if((w||b.hasNonreactiveDirective?BU(w?b.nonReactiveQuery:t,d,o,i):jo(d,o))&&jo(f,i))return}if(3!==l||this.options.notifyOnNetworkStatusChange&&!jo(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 Li,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?Ii.ready:Ii.loading,partial:!o.complete})};switch(t){case"cache-only":return{...i(),loading:!1,networkStatus:Ii.ready};case"cache-first":return i();case"cache-and-network":return{...i(),loading:!0,networkStatus:Ii.loading};case"standby":return nA;default:return jf}}resubscribeCache(){const{variables:e,fetchPolicy:t}=this.options,i=this.query,o="standby"===t||"no-cache"===t||this.waitForNetworkResult,r=!l8({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===jf||m===nA)||jo(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===Ii.error||this.hasObservers()||"no-cache"===this.options.fetchPolicy?e:this.getInitialResult();return t===jf&&(t=this.getInitialResult()),jo(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&&!jo(this.variables,e)&&(i.variables=this.options.variables=this.getVariablesWithDefaults({...this.variables,...e})),this._lastWrite=void 0,this._reobserve(i,{newNetworkStatus:Ii.refetch})}fetchMore({query:e,variables:t,context:i,errorPolicy:o,updateQuery:r}){vn("cache-only"!==this.options.fetchPolicy,84,Wa(this.query,"(anonymous)"));const s={...Wh(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||vn(r,85);const{finalize:f,pushNotification:m}=this.pushOperation(Ii.fetchMore);m({source:"newNetworkStatus",kind:"N",value:{}},{shouldEmit:3});const{promise:b,operator:w}=xz(),{observable:T}=this.queryManager.fetchObservableWithInfo(s,{networkStatus:Ii.fetchMore,exposeExtensions:!0}),M=T.pipe(w,v7(Y=>"N"===Y.kind&&"network"===Y.source)).subscribe({next:Y=>{l=!1;const te=Y.value,_e=te[YU];if(Az(Y.value.networkStatus)&&f(),d){const xe=this.getCacheDiff();this.cache.batch({update:pt=>{r?pt.updateQuery({query:this.query,variables:this.variables,returnPartialData:!0,optimistic:!1,extensions:_e},St=>r(St,{fetchMoreResult:te.data,variables:s.variables})):pt.writeQuery({query:s.query,variables:s.variables,data:te.data,extensions:_e})},onWatchUpdated:(pt,St)=>{if(pt.watcher===this&&!jo(St.result,xe.result)){l=!0;const Vt=this.getCurrentResult();a8(te.networkStatus)&&m({kind:"N",source:"network",value:{...Vt,networkStatus:te.networkStatus===Ii.error?Ii.ready:te.networkStatus,loading:!1,data:St.result,dataState:"streaming"===te.dataState?"streaming":"complete"}})}}})}else{const xe=this.getCurrentResult(),pt=r(xe.data,{fetchMoreResult:te.data,variables:s.variables});m({kind:"N",value:{...xe,networkStatus:Ii.ready,loading:!1,data:pt,dataState:"streaming"===xe.dataState?"streaming":"complete"},source:"network"})}}});return Sz(b.then(Y=>im(this.maskResult(Y))).finally(()=>{if(M.unsubscribe(),f(),d&&!l){const Y=this.getCurrentResult();"streaming"===Y.dataState?m({kind:"N",source:"network",value:{...Y,dataState:"complete",networkStatus:Ii.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):vn.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=Wh(this.options,e||{});Ez(this.options,t),this.updatePolling()}setVariables(e){var t=this;return(0,N.A)(function*(){return e=t.getVariablesWithDefaults(e),jo(t.variables,e)||(t.options.variables=e,!t.hasObservers())?im(t.getCurrentResult()):t._reobserve({fetchPolicy:t.options.initialFetchPolicy,variables:e},{newNetworkStatus:Ii.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:te=>new Ln(_e=>{try{return te.subscribe({next(xe){s=!0,_e.next(xe)},error:xe=>_e.error(xe),complete:()=>_e.complete()})}finally{s||(T.override=t,this.input.next({kind:"N",source:"newNetworkStatus",value:{resetError:!0},query:b,variables:w,meta:{shouldEmit:3,fetchPolicy:r}}))}}),observableQuery:this});const{query:b,variables:w}=this,T={abort:()=>{Y.unsubscribe()},query:b,variables:w};this.activeOperations.add(T);let M=t==Ii.refetch||t==Ii.setVariables;f=f.pipe(o,$5());const Y=f.pipe(f1({next:te=>{"newNetworkStatus"===te.source||"N"===te.kind&&te.value.loading?T.override=t:delete T.override},finalize:()=>this.activeOperations.delete(T)})).subscribe({next:te=>{const _e={};M&&"N"===te.kind&&"loading"in te.value&&!te.value.loading&&(M=!1,_e.shouldEmit=1),this.input.next({...te,query:b,variables:w,meta:_e})}});return{fromLink:m,subscription:Y,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&&(a8(this.networkStatus)||this.options.skipPollAttempt?.()?l():this._reobserve({fetchPolicy:"no-cache"===this.options.initialFetchPolicy?"no-cache":"network-only"},{newNetworkStatus:Ii.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===Ii.refetch||i===Ii.poll,r=this.variables,s=this.options.fetchPolicy,l=Wh(this.options,e||{});this.variablesUnknown&&="standby"===l.fetchPolicy;const d=o?l:Ez(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&&!jo(e.variables,r)&&"standby"!==d.fetchPolicy&&(d.fetchPolicy===s||"function"==typeof d.nextFetchPolicy)&&(this.applyNextFetchPolicy("variables-changed",d),void 0===i&&(i=Ii.setVariables))),i||(i=Ii.loading,this.networkStatus!==Ii.loading&&e?.variables&&!jo(e.variables,r)&&(i=Ii.setVariables),"standby"===d.fetchPolicy&&(i=Ii.ready)),"standby"===d.fetchPolicy&&this.cancelPolling(),this.resubscribeCache();const{promise:b,operator:w}=xz("standby"===d.fetchPolicy?{data:void 0}:void 0),{subscription:T,observable:M,fromLink:Y}=this.fetch(d,i,f,w);!o&&(Y||!this.linkSubscription)&&(this.linkSubscription&&this.linkSubscription.unsubscribe(),this.linkSubscription=T);const te=Object.assign(Sz(b.then(_e=>im(this.maskResult(_e))).finally(()=>{!this.hasObservers()&&0===this.activeOperations.size&&this.tearDownQuery()})),{retain:()=>{const _e=M.subscribe({}),xe=()=>_e.unsubscribe();return b.then(xe,xe),te}});return te}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();jo(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:Ii.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===Ii.streaming?e:Array.from(this.activeOperations.values()).reverse().find(i=>l8(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?nA:jf,{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=tA(e=>{const{query:t,meta:i}=e;if("setResult"===e.source)return{query:t,variables:this.variables,result:e.value,meta:i};if("C"===e.kind)return;const o="resolvedVariables"in e?e.resolvedVariables:void 0;if(e.query!==this.query)return;if(!jo(o,this.variables)){if(!jo(e.variables,this.variables))return;o&&(this.options.variables=o,this.resubscribeCache())}const r=this.variables;let s;const l=this.subject.getValue();if("cache"===e.source){if(s=e.value,s.networkStatus===Ii.ready&&s.partial&&(!this.options.returnPartialData||l.result.networkStatus===Ii.error)&&"cache-only"!==this.options.fetchPolicy)return}else if("network"===e.source)this.waitForNetworkResult&&(this.waitForNetworkResult=!1,this.resubscribeCache()),s="E"===e.kind?{...l8(l,e)||o&&jo(o,l.variables)?l.result:{data:void 0,dataState:"empty",partial:!0},error:e.error,networkStatus:Ii.error,loading:!1}:e.value,"E"===e.kind&&"streaming"===s.dataState&&(s.dataState="complete"),s.error&&(i.shouldEmit=1);else if("newNetworkStatus"===e.source){const d=l8(l,e)?l.result:this.getInitialResult(i.fetchPolicy),{resetError:f}=e.value,m=f?void 0:d.error,b=m?Ii.error:Ii.ready;s={...d,error:m,networkStatus:b}}return vn(s),s.error||delete s.error,s.networkStatus=this.calculateNetworkStatus(s.networkStatus),s.loading=a8(s.networkStatus),s=this.maskResult(s),void 0!==l.result.data&&s.data!==l.result.data&&jo(s.data,l.result.data)&&(s.data=l.result.data),{query:t,variables:r,result:s,meta:i}});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 l8(n,e){return!!(n&&e&&n.query===e.query&&jo(n.variables,e.variables))}function xz(n){let t,i,e=n;return{promise:new Promise((s,l)=>{t=s,i=l}),operator:f1({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 Dz={},Gf=new WeakMap;function oA(n,e){const t=n[e];"function"==typeof t&&(n[e]=function(){return Gf.set(n,(Gf.get(n)+1)%1e15),t.apply(this,arguments)})}const Nz=new WeakMap;class rA{cache;queryManager;id;observableQuery;incremental;constructor(e,t){const i=this.cache=e.cache,o=(Nz.get(e)||0)+1;Nz.set(e,o),this.id=o+"",this.observableQuery=t,this.queryManager=e,Gf.has(i)||(Gf.set(i,0),oA(i,"evict"),oA(i,"modify"),oA(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===Gf.get(this.cache)&&jo(t,i.variables)&&jo(e.data,i.result.data)&&e.extensions?.[Zh]===i.result.extensions?.[Zh])}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);if(l)return f;if(sA(f,o)){let m=!1;this.cache.batch({onWatchUpdated:(b,w)=>{b.watcher===this.observableQuery&&(b.lastOwnDiff=w)},update:b=>{if(this.shouldWrite(f,i))b.writeQuery({query:t,data:f.data,variables:i,overwrite:1===r,extensions:f.extensions}),m=!0,this.lastWrite={result:f,variables:i,dmCount:Gf.get(this.cache)};else if(d&&d.complete)return void(f={...f,data:d.result});const w=b.diff(s);w.complete&&(f={...f,data:w.result})}})}else this.lastWrite=void 0;return 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:[]}),Vf(s)&&"none"===t.errorPolicy)return Promise.resolve(s);const l=()=>({...s,dataState:this.hasNext?"streaming":"complete"});if(!r&&sA(s,t.errorPolicy)){o.push({result:s.data,dataId:"ROOT_MUTATION",query:t.document,variables:t.variables,extensions:s.extensions});const{updateQueries:f}=t;f&&this.queryManager.getObservableQueries("all").forEach(m=>{const b=m&&m.queryName;if(!b||!Object.hasOwnProperty.call(f,b))return;const w=f[b],{query:T,variables:M}=m,{result:Y,complete:te}=m.getCacheDiff({optimistic:!1});if(te&&Y){const _e=w(Y,{mutationResult:l(),queryName:T&&Wa(T)||void 0,queryVariables:M});_e&&o.push({result:_e,dataId:"ROOT_QUERY",query:T,variables:M})}})}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(w=>m.write(w));const{update:b}=t;if(b){if(!r){const w=m.diff({id:"ROOT_MUTATION",query:this.queryManager.getDocumentInfo(t.document).asQuery,variables:t.variables,optimistic:!1,returnPartialData:!0});w.complete&&(s={...s,data:w.result})}this.hasNext||b(m,s,{context:t.context,variables:t.variables})}!r&&!t.keepRootFields&&!this.hasNext&&m.modify({id:"ROOT_MUTATION",fields:(w,{fieldName:T,DELETE:M})=>"__typename"===T?w:M})},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:Dz}):e;return i!==Dz&&(this.cache.recordOptimisticTransaction(o=>{try{this.markMutationResult({data:i},t,o)}catch(r){vn.error(r)}},this.id),!0)}markSubscriptionResult(e,{document:t,variables:i,errorPolicy:o,cacheWriteBehavior:r}){0!==r&&(sA(e,o)&&this.cache.write({query:t,result:e.data,dataId:"ROOT_SUBSCRIPTION",variables:i,extensions:e.extensions}),this.queryManager.broadcastQueries())}}function sA(n,e="none"){const t="ignore"===e||"all"===e;let i=!Vf(n);return!i&&t&&n.data&&(i=!0),i}class XTe{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 wd(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(yl(90))}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:b,errorPolicy:w,keepRootFields:T,context:M}){const Y=new rA(t);i=t.cache.transformForLink(t.transform(i));const{hasClientExports:te}=t.getDocumentInfo(i);o=t.getVariables(i,o),te&&(o=yield t.localState.getExportedVariables({client:t.client,document:i,variables:o,context:M}));const _e=t.mutationStore&&(t.mutationStore[Y.id]={mutation:i,variables:o,loading:!0,error:null}),xe=r&&Y.markMutationOptimistic(r,{document:i,variables:o,cacheWriteBehavior:"no-cache"===b?0:2,errorPolicy:w,context:M,updateQueries:s,update:f,keepRootFields:T});return t.broadcastQueries(),new Promise((pt,St)=>{const Vt={};return t.getObservableFromLink(i,{...M,optimisticResponse:xe?r:void 0},o,b,{},!1).observable.pipe(Lz(),Rh(Un=>{const In={...Un};return Vc(Y.markMutationResult(In,{document:i,variables:o,cacheWriteBehavior:"no-cache"===b?0:2,errorPolicy:w,context:M,update:f,updateQueries:s,awaitRefetchQueries:d,refetchQueries:l,removeOptimistic:xe?Y.id:void 0,onQueryUpdated:m,keepRootFields:T}))})).pipe(_o(Un=>{if(Vf(Un)&&"none"===w)throw new tm(aA(Un));return _e&&(_e.loading=!1,_e.error=null),Un})).subscribe({next:Un=>{if(t.broadcastQueries(),!Y.hasNext){const In={data:t.maskOperation({document:i,data:Un.data,fetchPolicy:b,cause:Vt})};Vf(Un)&&(In.error=new tm(Un)),Object.keys(Un.extensions||{}).length&&(In.extensions=Un.extensions),pt(In)}},error:Un=>(_e&&(_e.loading=!1,_e.error=Un),xe&&t.cache.removeOptimistic(Y.id),t.broadcastQueries(),"ignore"===w?pt({data:void 0}):"all"===w?pt({data:void 0,error:Un}):void St(Un))})})}).apply(this,arguments)}fetchQuery(e,t){var i=this;return Vh(e.query,Cu.QUERY),(0,N.A)(function*(){return S5(i.fetchObservableWithInfo(e,{networkStatus:t}).observable.pipe(tA(o=>{switch(o.kind){case"E":throw o.error;case"N":if("newNetworkStatus"!==o.source)return im(o.value)}})),{defaultValue:{data:void 0}})})()}transform(e){return this.documentTransform.transformDocument(e)}transformCache=new mw(Cd["queryManager.getDocumentInfo"]||2e3);getDocumentInfo(e){const{transformCache:t}=this;if(!t.has(e)){const o=yd(e),r={hasClientExports:J5(["client","export"],e,!0),hasForcedResolvers:VTe(e),hasNonreactiveDirective:J5(["nonreactive"],e),hasIncrementalDirective:J5(["defer"],e),nonReactiveQuery:QTe(e),clientQuery:J5(["client"],e)?e:null,serverQuery:jTe([{name:"client",remove:!0},{name:"connection"},{name:"nonreactive"},{name:"unmask"}],e),operationType:o?.operation,defaultVars:Gw(o),asQuery:{...e,definitions:e.definitions.map(s=>"OperationDefinition"===s.kind&&"query"!==s.operation?{...s,operation:"query"}:s)}};t.set(e,r)}const i=t.get(e);if(i.violation)throw i.violation;return i}getVariables(e,t){const i=this.getDocumentInfo(e).defaultVars,o=Object.entries(t??{}).map(([r,s])=>[r,void 0===s?i[r]:s]);return{...i,...Object.fromEntries(o)}}watchQuery(e){Vh(e.query,Cu.QUERY);const t=this.transform(e.query);return typeof(e={...e,variables:this.getVariables(t,e.variables)}).notifyOnNetworkStatusChange>"u"&&(e.notifyOnNetworkStatusChange=!0),new iA({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(yl(92)),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 $Te(n){return qs(n)&&"Document"===n.kind&&Array.isArray(n.definitions)}(s)){const l=W5(this.transform(s));i.set(l,Wa(s)),o.set(l,!1)}else qs(s)&&s.query&&r.add(s)}),this.obsQueries.forEach(s=>{const l=W5(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 iA({queryManager:this,options:{...s8(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;Vh(t,Cu.SUBSCRIPTION),t=this.transform(t),i=this.getVariables(t,i);const f=(this.getDocumentInfo(t).hasClientExports?Vc(this.localState.getExportedVariables({client:this.client,document:t,variables:i,context:s})):Cl(i)).pipe(Rh(m=>{const{observable:b,restart:w}=this.getObservableFromLink(t,s,m,o,l),T=new rA(this);return d=w,b.pipe(_o(M=>{T.markSubscriptionResult(M,{document:t,variables:m,errorPolicy:r,cacheWriteBehavior:"no-cache"===o?0:2});const Y={data:M.data??void 0};return Vf(M)?Y.error=new tm(M):function OTe(n){return"extensions"in n&&RTe.is(n.extensions[eA])}(M)&&(Y.error=M.extensions[eA],delete M.extensions[eA]),M.extensions&&Object.keys(M.extensions).length&&(Y.extensions=M.extensions),Y.error&&"none"===r&&(Y.data=void 0),"ignore"===r&&delete Y.error,Y}),Tu(M=>Cl("ignore"===r?{data:void 0}:{data:void 0,error:M})),v7(M=>!(!M.data&&!M.error)))}));return Object.assign(f,{restart:()=>d?.()})}broadcastQueries(){this.onBroadcast&&this.onBroadcast(),this.obsQueries.forEach(e=>e.notify())}inFlightLinkObservables=new wu(!1);getObservableFromLink(e,t,i,o,r,s=t?.queryDeduplication??this.queryDeduplication){let l={};const{serverQuery:d,clientQuery:f,operationType:m,hasIncrementalDirective:b}=this.getDocumentInfo(e),w=Wa(e),T={client:this.client};if(d){const{inFlightLinkObservables:M,link:Y}=this;try{let _e=function(xe){return new Ln(pt=>{function St(){return xe.subscribe({next:pt.next.bind(pt),complete:pt.complete.bind(pt),error:pt.error.bind(pt)})}let Vt=St();return l.restart||=()=>{Vt.unsubscribe(),Vt=St()},()=>{Vt.unsubscribe(),l.restart=void 0}})};const te=this.incrementalHandler.prepareRequest({query:d,variables:i,context:{...this.defaultContext,...t,queryDeduplication:s},extensions:r});if(t=te.context,s){const xe=W5(d),pt=Ad(i);l=M.lookup(xe,pt),l.observable||(l.observable=Xw(Y,te,T).pipe(_e,wy(()=>{M.peek(xe,pt)===l&&M.remove(xe,pt)}),m===Cu.SUBSCRIPTION?$5():Q7({refCount:!0})))}else l.observable=Xw(Y,te,T).pipe(_e)}catch(te){l.observable=Yh(()=>te)}}else l.observable=Cl({data:{}});if(f){const{operation:M}=yd(e);vn(!b,97,M[0].toUpperCase()+M.slice(1),w??"(anonymous)"),l.observable=l.observable.pipe(Rh(Y=>Vc(this.localState.execute({client:this.client,document:f,remoteResult:Y,context:t,variables:i,fetchPolicy:o}))))}return{restart:()=>l.restart?.(),observable:l.observable.pipe(Tu(M=>{throw M=function BTe(n){return function kTe(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 Jw(n)}(M),function PTe(n){yz.add(n)}(M),M}))}}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(_o(d=>{const f=t.markQueryResult(d,{...e,document:l,cacheWriteBehavior:i}),m=Vf(f);if(m&&"none"===s)throw t.resetLastWrite(),o?.resetNotifications(),new tm(aA(f));const b={data:f.data,...t.hasNext?{loading:!0,networkStatus:Ii.streaming,dataState:"streaming",partial:!0}:{dataState:f.data?"complete":"empty",loading:!1,networkStatus:Ii.ready,partial:!f.data}};return r&&"extensions"in f&&(b[YU]=f.extensions),m&&("none"===s&&(b.data=void 0,b.dataState="empty"),"ignore"!==s&&(b.error=new tm(aA(f)),"streaming"!==b.dataState&&(b.networkStatus=Ii.error))),b}),Tu(d=>{if("none"===s)throw t.resetLastWrite(),o?.resetNotifications(),d;const f={data:void 0,dataState:"empty",loading:!1,networkStatus:Ii.ready,partial:!0};return"ignore"!==s&&(f.error=d,f.networkStatus=Ii.error),Cl(f)}))}fetchObservableWithInfo(e,{networkStatus:t=Ii.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:b=!1,notifyOnNetworkStatusChange:w=!0,context:T={}}=e;this.prioritizeCacheValues&&("network-only"===f||"cache-and-network"===f)&&(f="cache-first");const M=Object.assign({},e,{query:i,variables:d,fetchPolicy:f,errorPolicy:m,returnPartialData:b,notifyOnNetworkStatusChange:w,context:T}),Y=new rA(this,s),te=Vt=>{M.variables=Vt;const In=this.fetchQueryByPolicy(M,{queryInfo:Y,cacheWriteBehavior:"no-cache"===f?0:t===Ii.refetch&&"merge"!==M.refetchWritePolicy?1:2,onCacheHit:r,observableQuery:s,exposeExtensions:l});return In.observable=In.observable.pipe(o),"standby"!==M.fetchPolicy&&s?.applyNextFetchPolicy("after-fetch",e),In},_e=()=>{this.fetchCancelFns.delete(Y.id)};this.fetchCancelFns.set(Y.id,Vt=>{xe.next({kind:"E",error:Vt,source:"network"})});const xe=new Li;let pt,St;if(this.getDocumentInfo(M.query).hasClientExports)pt=Vc(this.localState.getExportedVariables({client:this.client,document:M.query,variables:M.variables,context:M.context})).pipe(Rh(Vt=>te(Vt).observable)),St=!0;else{const Vt=te(M.variables);St=Vt.fromLink,pt=Vt.observable}return{observable:new Ln(Vt=>{Vt.add(_e),pt.subscribe(Vt),xe.subscribe(Vt)}).pipe($5()),fromLink:St}}refetchQueries({updateCache:e,include:t,optimistic:i=!1,removeOptimistic:o=(i?qH("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,b){const w=f.watcher;if(w instanceof iA&&!d.has(w)){if(d.add(w),r){s.delete(w);let T=r(w,m,b);return!0===T&&(T=w.refetch().retain()),!1!==T&&l.set(w,T),T}null!==r&&"cache-only"!==w.options.fetchPolicy&&s.set(w,{oq:w,lastDiff:b,diff:m})}}})}return s.size&&s.forEach(({oq:d,lastDiff:f,diff:m})=>{let b;r&&(m||(m=d.getCacheDiff()),b=r(d,m,f)),(!r||!0===b)&&(b=d.refetch().retain()),!1!==b&&l.set(d,b)}),o&&this.cache.removeOptimistic(o),l}noCacheWarningsByCause=new WeakSet;maskOperation(e){const{document:t,data:i}=e;return this.dataMasking?function UTe(n,e,t){const i=yd(e);return vn(i,43),null==n?n:wz(n,i.selectionSet,{operationType:i.operation,operationName:i.name?.value,fragmentMap:Z5(Y5(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 zTe(n,e,t,i){const o=e.definitions.filter(s=>s.kind===hn.FRAGMENT_DEFINITION);typeof i>"u"&&(vn(1===o.length,41,o.length),i=o[0].name.value);const r=o.find(s=>s.name.value===i);return vn(!!r,42,i),null==n||jo(n,{})?n:wz(n,r.selectionSet,{operationType:"fragment",operationName:r.name.value,fragmentMap:Z5(Y5(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:b}){const w=()=>this.cache.diff({query:e,variables:t,returnPartialData:!0,optimistic:!0}),T=(Y,te)=>{const _e=Y.result,xe=St=>(!Y.complete&&!r&&(St=void 0),{data:St,dataState:Y.complete?"complete":St?"partial":"empty",loading:a8(te),networkStatus:te,partial:!Y.complete});return(Y.complete||r)&&this.getDocumentInfo(e).hasForcedResolvers?(d(),Vc(this.localState.execute({client:this.client,document:e,remoteResult:_e?{data:_e}:void 0,context:s,variables:t,onlyRunForcedResolvers:!0,returnPartialData:!0,fetchPolicy:i}).then(St=>({kind:"N",value:xe(St.data||void 0),resolvedVariables:t,source:"cache"})))):Cl({kind:"N",value:xe("none"===o&&te===Ii.refetch&&Y.missing?void 0:_e||void 0),resolvedVariables:t,source:"cache"})},M=()=>this.getResultsFromLink({query:e,variables:t,context:s,fetchPolicy:i,errorPolicy:o},{cacheWriteBehavior:l,queryInfo:f,observableQuery:m,exposeExtensions:b}).pipe(Lz(),function LTe(){return Hs((n,e)=>{n.subscribe(oa(e,t=>{e.next(Td.createNext(t))},()=>{e.next(Td.createComplete()),e.complete()},t=>{e.next(Td.createError(t)),e.complete()}))})}(),_o(Y=>({...Y,resolvedVariables:t,source:"network"})));switch(i){default:case"cache-first":{const Y=w();return Y.complete?{fromLink:!1,observable:T(Y,Ii.ready)}:r?{fromLink:!0,observable:em(T(Y,Ii.loading),M())}:{fromLink:!0,observable:M()}}case"cache-and-network":{const Y=w();return Y.complete||r?{fromLink:!0,observable:em(T(Y,Ii.loading),M())}:{fromLink:!0,observable:M()}}case"cache-only":return{fromLink:!1,observable:em(T(w(),Ii.ready))};case"network-only":case"no-cache":return{fromLink:!0,observable:M()};case"standby":return{fromLink:!1,observable:bu}}}}function Lz(){let n=!1;return f1({next(){n=!0},complete(){vn(n,101)}})}function QTe(n){return yu(n,{FragmentSpread:e=>{if(!e.directives?.some(t=>"unmask"===t.name.value))return{...e,directives:[...e.directives||[],{kind:hn.DIRECTIVE,name:{kind:hn.NAME,value:"nonreactive"}}]}}})}function aA(n){if(null==n.extensions?.[Zh])return n;const{extensions:{[Zh]:e,...t},...i}=n;return Object.keys(t).length>0&&(i.extensions=t),i}class lA{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:b,dataMasking:w,link:T,incrementalHandler:M=new ETe,experiments:Y=[],refetchEventManager:te}=e;this.link=T,this.cache=t,this.queryDeduplication=s,this.defaultOptions=l||{},this.devtoolsConfig={...b,enabled:b?.enabled??false},this.watchQuery=this.watchQuery.bind(this),this.query=this.query.bind(this),this.mutate=this.mutate.bind(this),this.watchFragment=this.watchFragment.bind(this),this.resetStore=this.resetStore.bind(this),this.reFetchObservableQueries=this.refetchObservableQueries=this.refetchObservableQueries.bind(this),this.version=uw,this.queryManager=new XTe({client:this,defaultOptions:this.defaultOptions,defaultContext:d,documentTransform:i,queryDeduplication:s,ssrMode:o,dataMasking:!!w,clientOptions:e,incrementalHandler:M,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(),Y.forEach(_e=>_e.call(this,e)),this.refetchEventManager=te,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=s8(this.defaultOptions.watchQuery,e),o&&(e.refetchOn=o)}return this.queryManager.watchQuery(e)}query=e=>(this.defaultOptions.query&&(e=s8(this.defaultOptions.query,e)),this.queryManager.query(e));mutate=e=>{const t=s8(Wh({fetchPolicy:"network-only",errorPolicy:"none"},this.defaultOptions.mutate),e);return Vh(t.mutation,Cu.MUTATION),this.queryManager.mutate(t)};subscribe(e){const t={},i=this.queryManager.startGraphQLSubscription(e),o=i.pipe(_o(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 Xw(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 wd(xTe);transform(e,t=!1){const i=this.queryManager.transform(e);return t?this.maskedFragmentTransform.transformDocument(i):i}}function eIe(n,e){if(!n)throw new Error(e??"Unexpected invariant triggered.")}const tIe=/\r\n|[\n\r]/g;function cA(n,e){let t=0,i=1;for(const o of n.body.matchAll(tIe)){if("number"==typeof o.index||eIe(!1),o.index>=e)break;t=o.index+o[0].length,i+=1}return{line:i,column:e+1-t}}function nIe(n){return Rz(n.source,cA(n.source,n.start))}function Rz(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),b=m[o];if(b.length>120){const w=Math.floor(d/80),T=d%80,M=[];for(let Y=0;Y<b.length;Y+=80)M.push(b.slice(Y,Y+80));return f+kz([[`${s} |`,M[0]],...M.slice(1,w+1).map(Y=>["|",Y]),["|","^".padStart(T)],["|",M[w+1]]])}return f+kz([[s-1+" |",m[o-1]],[`${s} |`,b],["|","^".padStart(d)],[`${s+1} |`,m[o+1]]])}function kz(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 uA extends Error{constructor(e,...t){var i,o,r;const{nodes:s,source:l,positions:d,path:f,originalError:m,extensions:b}=function iIe(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=Oz(Array.isArray(s)?s:s?[s]:void 0);const w=Oz(null===(i=this.nodes)||void 0===i?void 0:i.map(M=>M.loc).filter(M=>null!=M));this.source=l??(null==w||null===(o=w[0])||void 0===o?void 0:o.source),this.positions=d??w?.map(M=>M.start),this.locations=d&&l?d.map(M=>cA(l,M)):w?.map(M=>cA(M.source,M.start));const T=function JTe(n){return"object"==typeof n&&null!==n}(m?.extensions)?m?.extensions:void 0;this.extensions=null!==(r=b??T)&&void 0!==r?r:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),null!=m&&m.stack?Object.defineProperty(this,"stack",{value:m.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,uA):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"+nIe(t.loc));else if(this.source&&this.locations)for(const t of this.locations)e+="\n\n"+Rz(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 Oz(n){return void 0===n||0===n.length?void 0:n}function cs(n,e,t){return new uA(`Syntax Error: ${t}`,{source:n,positions:[e]})}var Bz=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}(Bz||{}),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 oIe{constructor(e){const t=new ZH(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=sIe(this,e.end);e.next=t,t.prev=e,e=t}}while(e.kind===kt.COMMENT);return e}}function Wf(n){return n>=0&&n<=55295||n>=57344&&n<=1114111}function c8(n,e){return Pz(n.charCodeAt(e))&&Fz(n.charCodeAt(e+1))}function Pz(n){return n>=55296&&n<=56319}function Fz(n){return n>=56320&&n<=57343}function T1(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 es(n,e,t,i,o){return new ZH(e,t,i,n.line,1+t-n.lineStart,o)}function sIe(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 aIe(n,o);case 33:return es(n,kt.BANG,o,o+1);case 36:return es(n,kt.DOLLAR,o,o+1);case 38:return es(n,kt.AMP,o,o+1);case 40:return es(n,kt.PAREN_L,o,o+1);case 41:return es(n,kt.PAREN_R,o,o+1);case 46:if(46===t.charCodeAt(o+1)&&46===t.charCodeAt(o+2))return es(n,kt.SPREAD,o,o+3);break;case 58:return es(n,kt.COLON,o,o+1);case 61:return es(n,kt.EQUALS,o,o+1);case 64:return es(n,kt.AT,o,o+1);case 91:return es(n,kt.BRACKET_L,o,o+1);case 93:return es(n,kt.BRACKET_R,o,o+1);case 123:return es(n,kt.BRACE_L,o,o+1);case 124:return es(n,kt.PIPE,o,o+1);case 125:return es(n,kt.BRACE_R,o,o+1);case 34:return 34===t.charCodeAt(o+1)&&34===t.charCodeAt(o+2)?_Ie(n,o):cIe(n,o)}if(j5(r)||45===r)return lIe(n,o,r);if(RU(r))return pIe(n,o);throw cs(n.source,o,39===r?"Unexpected single quote character ('), did you mean to use a double quote (\")?":Wf(r)||c8(t,o)?`Unexpected character: ${T1(n,o)}.`:`Invalid character: ${T1(n,o)}.`)}return es(n,kt.EOF,i,i)}function aIe(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(Wf(r))++o;else{if(!c8(t,o))break;o+=2}}return es(n,kt.COMMENT,e,o,t.slice(e+1,o))}function lIe(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),j5(r))throw cs(n.source,o,`Invalid number, unexpected digit after 0: ${T1(n,o)}.`)}else o=dA(n,o,r),r=i.charCodeAt(o);if(46===r&&(s=!0,r=i.charCodeAt(++o),o=dA(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=dA(n,o,r),r=i.charCodeAt(o)),46===r||RU(r))throw cs(n.source,o,`Invalid number, expected digit but got: ${T1(n,o)}.`);return es(n,s?kt.FLOAT:kt.INT,e,o,i.slice(e,o))}function dA(n,e,t){if(!j5(t))throw cs(n.source,e,`Invalid number, expected digit but got: ${T1(n,e)}.`);const i=n.source.body;let o=e+1;for(;j5(i.charCodeAt(o));)++o;return o}function cIe(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),es(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)?uIe(n,o):dIe(n,o):hIe(n,o);s+=d.value,o+=d.size,r=o;continue}if(10===l||13===l)break;if(Wf(l))++o;else{if(!c8(t,o))throw cs(n.source,o,`Invalid character within String: ${T1(n,o)}.`);o+=2}}throw cs(n.source,o,"Unterminated string.")}function uIe(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||!Wf(i))break;return{value:String.fromCodePoint(i),size:o}}if(i=i<<4|om(r),i<0)break}throw cs(n.source,e,`Invalid Unicode escape sequence: "${t.slice(e,e+o)}".`)}function dIe(n,e){const t=n.source.body,i=Hz(t,e+2);if(Wf(i))return{value:String.fromCodePoint(i),size:6};if(Pz(i)&&92===t.charCodeAt(e+6)&&117===t.charCodeAt(e+7)){const o=Hz(t,e+8);if(Fz(o))return{value:String.fromCodePoint(i,o),size:12}}throw cs(n.source,e,`Invalid Unicode escape sequence: "${t.slice(e,e+6)}".`)}function Hz(n,e){return om(n.charCodeAt(e))<<12|om(n.charCodeAt(e+1))<<8|om(n.charCodeAt(e+2))<<4|om(n.charCodeAt(e+3))}function om(n){return n>=48&&n<=57?n-48:n>=65&&n<=70?n-55:n>=97&&n<=102?n-87:-1}function hIe(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 _Ie(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=es(n,kt.BLOCK_STRING,e,r+3,EAe(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(Wf(f))++r;else{if(!c8(t,r))throw cs(n.source,r,`Invalid character within String: ${T1(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 pIe(n,e){const t=n.source.body,i=t.length;let o=e+1;for(;o<i&&SAe(t.charCodeAt(o));)++o;return es(n,kt.NAME,e,o,t.slice(e,o))}const fIe=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=aw(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 Uz{constructor(e,t="GraphQL request",i={line:1,column:1}){"string"==typeof e||j7(!1,`Body must be a string. Received: ${aw(e)}.`),this.body=e,this.name=t,this.locationOffset=i,this.locationOffset.line>0||j7(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||j7(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}class rm{constructor(e,t={}){const{lexer:i,...o}=t;if(i)this._lexer=i;else{const r=function gIe(n){return fIe(n,Uz)}(e)?e:new Uz(e);this._lexer=new oIe(r)}this._options=o,this._tokenCounter=0}get tokenCount(){return this._tokenCounter}parseName(){const e=this.expectToken(kt.NAME);return this.node(e,{kind:hn.NAME,value:e.value})}parseDocument(){return this.node(this._lexer.token,{kind:hn.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:hn.OPERATION_DEFINITION,operation:Cu.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:hn.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 Cu.QUERY;case"mutation":return Cu.MUTATION;case"subscription":return Cu.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:hn.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:hn.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:hn.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:hn.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:hn.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:hn.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(e,{kind:hn.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:hn.FRAGMENT_DEFINITION,description:t,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}:{kind:hn.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:hn.INT,value:t.value});case kt.FLOAT:return this.advanceLexer(),this.node(t,{kind:hn.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:hn.BOOLEAN,value:!0});case"false":return this.node(t,{kind:hn.BOOLEAN,value:!1});case"null":return this.node(t,{kind:hn.NULL});default:return this.node(t,{kind:hn.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:hn.STRING,value:e.value,block:e.kind===kt.BLOCK_STRING})}parseList(e){return this.node(this._lexer.token,{kind:hn.LIST,values:this.any(kt.BRACKET_L,()=>this.parseValueLiteral(e),kt.BRACKET_R)})}parseObject(e){return this.node(this._lexer.token,{kind:hn.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:hn.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:hn.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:hn.LIST_TYPE,type:i})}else t=this.parseNamedType();return this.expectOptionalToken(kt.BANG)?this.node(e,{kind:hn.NON_NULL_TYPE,type:t}):t}parseNamedType(){return this.node(this._lexer.token,{kind:hn.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:hn.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:hn.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:hn.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:hn.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:hn.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:hn.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:hn.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:hn.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:hn.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:hn.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,`${u8(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:hn.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:hn.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:hn.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:hn.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:hn.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:hn.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:hn.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:hn.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:hn.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:hn.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(Bz,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:hn.DIRECTIVE_ARGUMENT_COORDINATE,name:i,argumentName:r}:{kind:hn.DIRECTIVE_COORDINATE,name:i}:o?r?{kind:hn.ARGUMENT_COORDINATE,name:i,fieldName:o,argumentName:r}:{kind:hn.MEMBER_COORDINATE,name:i,memberName:o}:{kind:hn.TYPE_COORDINATE,name:i})}node(e,t){return!0!==this._options.noLocation&&(t.loc=new Uwe(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 ${zz(e)}, found ${u8(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 ${u8(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 ${u8(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 u8(n){const e=n.value;return zz(n.kind)+(null!=e?` "${e}"`:"")}function zz(n){return function rIe(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 d8=new Map,hA=new Map,Vz=!0,sm=!1;function jz(n){return n.replace(/[\s,]+/g," ").trim()}function TIe(n){var e=jz(n);if(!d8.has(e)){var t=function CIe(n,e){const t=new rm(n,e),i=t.parseDocument();return Object.defineProperty(i,"tokenCount",{enumerable:!1,value:t.tokenCount}),i}(n,{experimentalFragmentVariables:sm,allowLegacyFragmentVariables:sm,experimentalFragmentArguments:sm});if(!t||"Document"!==t.kind)throw new Error("Not a valid GraphQL document.");d8.set(e,function AIe(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 wIe(n){var e=new Set,t=[];return n.definitions.forEach(function(i){if("FragmentDefinition"===i.kind){var o=i.name.value,r=function yIe(n){return jz(n.source.body.substring(n.start,n.end))}(i.loc),s=hA.get(o);s&&!s.has(r)?Vz&&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||hA.set(o,s=new Set),s.add(r),e.has(r)||(e.add(r),t.push(i))}else t.push(i)}),T0(T0({},n),{definitions:t})}(t)))}return d8.get(e)}function $f(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]}),TIe(i)}var am_gql=$f,am_resetCaches=function IIe(){d8.clear(),hA.clear()},am_disableFragmentWarnings=function SIe(){Vz=!1},am_enableExperimentalFragmentVariables=function EIe(){sm=!0},am_disableExperimentalFragmentVariables=function xIe(){sm=!1};(function(n){n.gql=am_gql,n.resetCaches=am_resetCaches,n.disableFragmentWarnings=am_disableFragmentWarnings,n.enableExperimentalFragmentVariables=am_enableExperimentalFragmentVariables,n.disableExperimentalFragmentVariables=am_disableExperimentalFragmentVariables})($f||($f={})),$f.default=$f;const LIe=new class NIe extends kP{}(class DIe extends RP{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 Wz(n){return new Ln(e=>(n().then(t=>{e.closed||(e.next(t),e.complete())},t=>{e.closed||e.error(t)}),()=>e.unsubscribe()))}class kIe{zone;constructor(e){this.zone=e}now=Date.now;schedule(e,t=0,i){return this.zone.run(()=>LIe.schedule(e,t,i))}}function _A(n,e){return n.pipe(p9(new kIe(e)))}class OIe{obsQuery;valueChanges;constructor(e,t){this.obsQuery=e,this.valueChanges=_A(Vc(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 pA=new Ht("APOLLO_FLAGS"),$z=new Ht("APOLLO_OPTIONS"),Zz=new Ht("APOLLO_NAMED_OPTIONS");class Yz{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 OIe(this.ensureClient().watchQuery({...e}),this.ngZone)}query(e){return Wz(()=>this.ensureClient().query({...e}))}mutate(e){return function RIe(n,e){return e?n.pipe(_o(t=>({...t,loading:!1})),function MIe(...n){const e=Yv(n);return Hs((t,i)=>{(e?em(n,t,e):em(n,t)).subscribe(i)})}({data:void 0,loading:!0})):n.pipe(_o(t=>({...t,loading:!1})))}(Wz(()=>this.ensureClient().mutate({...e})),e.useMutationLoading??this.useMutationLoading)}watchFragment(e){const{useZone:t,...i}=e,o=this.ensureClient().watchFragment({...i});return!0!==t?o:_A(o,this.ngZone)}subscribe(e){const{useZone:t,...i}=e,o=this.ensureClient().subscribe({...i});return!0!==t?o:_A(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 fA=(()=>{class n extends Yz{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){gA(i)?this.createNamed(i,t):this.createDefault(t)}default(){return this}use(t){return gA(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 lA(t))}createNamed(t,i){if(this.map.has(t))throw new Error(`Client ${t} has been already created`);this.map.set(t,new Yz(this.ngZone,this.flags,this.ngZone.runOutsideAngular(()=>new lA(i))))}removeClient(t){gA(t)?this.map.delete(t):this._client=void 0}static \u0275fac=function(i){return new(i||n)(Dn(Fo),Dn($z,8),Dn(Zz,8),Dn(pA,8))};static \u0275prov=Bt({token:n,factory:n.\u0275fac})}return n})();function gA(n){return!!n&&"default"!==n}const mA=$f,h8=(n,e)=>n&&e?[...n.keys()].reduce((t,i)=>t.set(i,n.get(i)),e):e||n;const vA={batchInterval:10,batchMax:10,uri:"graphql",method:"POST",withCredentials:!1,includeQuery:!0,includeExtensions:!1,useMultipart:!1};function Id(n,e,t){return function _8(...n){return n.find(e=>typeof e<"u")}(n[t],e[t],vA[t])}class FIe extends ks{httpClient;options;requester;print=X7;constructor(e,t){super(),this.httpClient=e,this.options=t,this.options.operationPrinter&&(this.print=this.options.operationPrinter),this.requester=i=>new Ln(o=>{const r=i.getContext();let s=Id(r,this.options,"method");const l=Id(r,this.options,"includeQuery"),d=Id(r,this.options,"includeExtensions"),f=Id(r,this.options,"uri"),m=Id(r,this.options,"withCredentials"),b=Id(r,this.options,"useMultipart"),w=!0===this.options.useGETForQueries,T=h8(r.httpContext,h8(this.options.httpContext,new Ay)),M=i.query.definitions.some(xe=>"OperationDefinition"===xe.kind&&"query"===xe.operation);w&&M&&(s="GET");const Y={method:s,url:"function"==typeof f?f(i):f,body:{operationName:i.operationName,variables:i.variables},options:{withCredentials:m,useMultipart:b,headers:this.options.headers,context:T}};d&&(Y.body.extensions=i.extensions),l&&(Y.body.query=this.print(i.query));const te=function qz(n){let e=n.headers&&n.headers instanceof Xs?n.headers:new Xs(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);Y.options.headers=((n,e)=>n&&e?e.keys().reduce((i,o)=>i.set(o,e.getAll(o)),n):e||n)(Y.options.headers,te);const _e=((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 Ln(f=>f.error(new Error("File upload is not available when combined with Batching")));if(!i)return new Ln(f=>f.error(new Error("File upload is not available when GET is used")));if(!t)return new Ln(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 Ln(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((b,w)=>{const T=n.body[w];return b[w]=-1!==["variables","extensions"].indexOf(w.toLowerCase())?JSON.stringify(T):T,b},{})};if(s&&i){const f=new FormData;f.append("operations",JSON.stringify(d.body));const m={},b=l.files;let w=0;b.forEach(T=>{m[++w]=T}),f.append("map",JSON.stringify(m)),w=0,b.forEach((T,M)=>{f.append(++w+"",M,M.name)}),d.body=f}return e.request(n.method,n.url,{observe:"response",responseType:"json",reportProgress:!1,...d,...n.options})})(Y,this.httpClient,this.options.extractFiles).subscribe({next:xe=>{i.setContext({response:xe}),o.next(xe.body)},error:xe=>o.error(xe),complete:()=>o.complete()});return()=>{_e.closed||_e.unsubscribe()}})}request(e){return this.requester(e)}}let HIe=(()=>{class n{httpClient;constructor(t){this.httpClient=t}create(t){return new FIe(this.httpClient,t)}static \u0275fac=function(i){return new(i||n)(Dn(hu))};static \u0275prov=Bt({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();function Qz(n,e){this.v=n,this.k=e}function bA(n){return new Qz(n,0)}function CA(n){return function(){return new lm(n.apply(this,arguments))}}function lm(n){var e,t;function i(r,s){try{var l=n[r](s),d=l.value,f=d instanceof Qz;Promise.resolve(f?d.v:d).then(function(m){if(f){var b="return"===r&&d.k?r:"next";if(!d.k||m.done)return i(b,m);m=n[b](m).value}o(!!l.done,m)},function(m){i("throw",m)})}catch(m){o(2,m)}}function o(r,s){2===r?e.reject(s):e.resolve({value:s,done:r}),(e=e.next)?i(e.key,e.arg):t=null}this._invoke=function(r,s){return new Promise(function(l,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 yA(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 p8(e.call(n));t="@@asyncIterator",i="@@iterator"}throw new TypeError("Object is not async iterable")}function p8(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(p8=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 p8(n)}function VIe(n){if("next"!==n&&"complete"!==n)throw new Error(`Invalid stream event "${n}"`);return n}function jIe(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}lm.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},lm.prototype.next=function(n){return this._invoke("next",n)},lm.prototype.throw=function(n){return this._invoke("throw",n)},lm.prototype.return=function(n){return this._invoke("return",n)};var Zf=function(n){return n[n.NewLine=10]="NewLine",n[n.CarriageReturn=13]="CarriageReturn",n[n.Space=32]="Space",n[n.Colon=58]="Colon",n}(Zf||{});class Ql extends Error{constructor(e){let t,i;!function ZIe(n){return function WIe(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 Jz(n){return wA.apply(this,arguments)}function wA(){return wA=(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={},b={};let w;try{w=yield d(t,{signal:e,method:r?"POST":"GET",credentials:i,referrer:s,referrerPolicy:l,headers:{...o,accept:"text/event-stream"},body:r})}catch(Y){throw new Ql(Y)}if(!w.ok)throw new Ql(w);if(!w.body)throw new Error("Missing response body");let M,T=null;return(0,N.A)(function*(){var Y;try{const Vt=function GIe(){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 b=new Uint8Array(n.length+d.length);b.set(n),b.set(d,n.length),n=b}const f=n.length;let m=0;for(;e<f;){i&&(n[e]===Zf.NewLine&&(m=++e),i=!1);let b=-1;for(;e<f&&-1===b;++e)switch(n[e]){case Zf.Colon:-1===t&&(t=e-m);break;case Zf.CarriageReturn:i=!0;case Zf.NewLine:b=e}if(-1===b)break;if(m===b){if(o.event||o.data){if(!o.event)throw new Error("Missing message event");const w=VIe(o.event),T=jIe(w,o.data);r.push({event:w,data:T}),o={event:"",data:""}}}else if(t>0){const w=n.subarray(m,b),T=s.decode(w.subarray(0,t)),Y=s.decode(w.subarray(t+(w[t+1]===Zf.Space?2:1)));switch(T){case"event":o.event=Y;break;case"data":o.data=o.data?o.data+"\n"+Y:Y}}m=e,t=-1}if(m===f){n=void 0;const b=[...r];return r=[],b}0!==m&&(n=n.subarray(m),e-=m)}}();var xe,te=!1,_e=!1;try{for(var St,pt=yA(function YIe(n){return"function"==typeof Object(n)[Symbol.asyncIterator]?n:CA(function*(){const e=n.getReader();let t;do{t=yield bA(e.read()),void 0!==t.value&&(yield t.value)}while(!t.done)})()}(w.body));te=!(St=yield pt.next()).done;te=!1){const Un=St.value;{if("string"==typeof Un)throw T=new Error(`Unexpected string chunk "${Un}"`);let In;try{In=Vt(Un)}catch(Gn){throw T=Gn}if(!In)continue;for(const Gn of In){try{f?.(Gn)}catch(Qn){throw T=Qn}const Si=Gn.data&&"id"in Gn.data?Gn.data.id:"";switch(Si in b||(b[Si]=[]),Gn.event){case"next":b[Si].push(Si?Gn.data.payload:Gn.data);break;case"complete":b[Si].push("complete");break;default:throw T=new Error(`Unexpected message event "${Gn.event}"`)}null===(Y=m[Si])||void 0===Y||Y.proceed()}}}}catch(Un){_e=!0,xe=Un}finally{try{te&&null!=pt.return&&(yield pt.return())}finally{if(_e)throw xe}}if(Object.keys(m).length)throw new Error("Connection closed while having active streams")}catch(Vt){T=!T&&Object.keys(m).length?new Ql(Vt):Vt,M?.(T)}finally{Object.values(m).forEach(({proceed:Vt})=>Vt())}})(),{url:t,headers:o,waitForThrow:()=>new Promise((Y,te)=>{if(T)return te(T);M=te}),getResults:Y=>CA(function*(){var te;const{signal:_e,operationId:xe=""}=Y??{};try{for(;;){for(;null!==(te=b[xe])&&void 0!==te&&te.length;){const pt=b[xe].shift();if("complete"===pt)return;yield pt}if(T)throw T;if(_e?.aborted)throw new Error("Getting results aborted by the client");yield bA(new Promise(pt=>{const St=()=>{_e?.removeEventListener("abort",St),delete m[xe],pt()};_e?.addEventListener("abort",St),m[xe]={proceed:St}}))}}finally{delete b[xe]}})()}}),wA.apply(this,arguments)}class KIe extends ks{constructor(e){super(),this.client=function $Ie(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,Si=>{const Qn=16*Math.random()|0;return("x"==Si?Qn:3&Qn|8).toString(16)})},retryAttempts:s=5,retry:l=function(){var Gn=(0,N.A)(function*(Qn){let Ui=1e3;for(let ts=0;ts<Qn;ts++)Ui*=2;yield new Promise(ts=>setTimeout(ts,Ui+Math.floor(2700*Math.random()+300)))});return function Si(Qn){return Gn.apply(this,arguments)}}(),credentials:d="same-origin",referrer:f,referrerPolicy:m,onMessage:b,on:w}=n,T=n.fetchFn||fetch,M=n.abortControllerImpl||AbortController,Y=(()=>{let Gn=!1;const Si=[];return{get disposed(){return Gn},onDispose:Qn=>Gn?(setTimeout(()=>Qn(),0),()=>{}):(Si.push(Qn),()=>{Si.splice(Si.indexOf(Qn),1)}),dispose(){if(!Gn){Gn=!0;for(const Qn of[...Si])Qn()}}}})();let te,_e,xe=0,pt=null,St=0;function Vt(){return Un.apply(this,arguments)}function Un(){return(Un=(0,N.A)(function*(){try{if(Y.disposed)throw new Error("Client has been disposed");return yield _e??(_e=(0,N.A)(function*(){var Gn,Si,Qn;if(pt){if(yield l(St),te.signal.aborted)throw new Error("Connection aborted by the client");St++}null===(Gn=w?.connecting)||void 0===Gn||Gn.call(w,!!pt),te=new M;const Ui=Y.onDispose(()=>te.abort());te.signal.addEventListener("abort",()=>{Ui(),_e=void 0});const ts=n,yr="function"==typeof ts.url?yield ts.url(void 0):ts.url;if(te.signal.aborted)throw new Error("Connection aborted by the client");const Pr="function"==typeof ts.headers?yield ts.headers(void 0):null!==(Si=ts.headers)&&void 0!==Si?Si:{};if(te.signal.aborted)throw new Error("Connection aborted by the client");let us;try{us=yield T(yr,{signal:te.signal,method:"PUT",credentials:d,referrer:f,referrerPolicy:m,headers:Pr})}catch(Jl){throw new Ql(Jl)}if(201!==us.status)throw new Ql(us);const Su=yield us.text();Pr["x-graphql-event-stream-token"]=Su;const Ed=yield Jz({signal:te.signal,headers:Pr,credentials:d,referrer:f,referrerPolicy:m,url:yr,fetchFn:T,onMessage:Jl=>{var Eu;null===(Eu=w?.message)||void 0===Eu||Eu.call(w,Jl),b?.(Jl)}});return null===(Qn=w?.connected)||void 0===Qn||Qn.call(w,!!pt),Ed.waitForThrow().catch(()=>_e=void 0),Ed})())}catch(Gn){throw _e=void 0,Gn}})).apply(this,arguments)}function In(Gn,Si,Qn){if(!e){const yr=new M,Pr=Y.onDispose(()=>{Pr(),yr.abort()});return(0,N.A)(function*(){var us,Su,Ed,Jl,Eu;let Sa=null,S1=0;for(;;)try{if(Sa){if(yield l(S1),yr.signal.aborted)throw new Error("Connection aborted by the client");S1++}null===(us=w?.connecting)||void 0===us||us.call(w,!!Sa),null===(Su=Qn?.connecting)||void 0===Su||Su.call(Qn,!!Sa);const Al=n,vNe="function"==typeof Al.url?yield Al.url(Gn):Al.url;if(yr.signal.aborted)throw new Error("Connection aborted by the client");const bNe="function"==typeof Al.headers?yield Al.headers(Gn):null!==(Ed=Al.headers)&&void 0!==Ed?Ed:{};if(yr.signal.aborted)throw new Error("Connection aborted by the client");const{getResults:CNe}=yield Jz({signal:yr.signal,headers:{...bNe,"content-type":"application/json; charset=utf-8"},credentials:d,referrer:f,referrerPolicy:m,url:vNe,body:JSON.stringify(Gn),fetchFn:T,onMessage:x1=>{var XA,qA;null===(XA=w?.message)||void 0===XA||XA.call(w,x1),null===(qA=Qn?.message)||void 0===qA||qA.call(Qn,x1),b?.(x1)}});null===(Jl=w?.connected)||void 0===Jl||Jl.call(w,!!Sa),null===(Eu=Qn?.connected)||void 0===Eu||Eu.call(Qn,!!Sa);var xu,bm=!1,Xf=!1;try{for(var E1,qh=yA(CNe());bm=!(E1=yield qh.next()).done;bm=!1)Sa=null,S1=0,Si.next(E1.value)}catch(x1){Xf=!0,xu=x1}finally{try{bm&&null!=qh.return&&(yield qh.return())}finally{if(Xf)throw xu}}return yr.abort()}catch(Al){if(yr.signal.aborted)return;if(!(Al instanceof Ql)||!s||S1>=s)throw Al;Sa=Al}})().then(()=>Si.complete()).catch(us=>Si.error(us)),()=>yr.abort()}xe++;const Ui=new M,ts=Y.onDispose(()=>{ts(),Ui.abort()});return(0,N.A)(function*(){const yr=r();Gn={...Gn,extensions:{...Gn.extensions,operationId:yr}};let Pr=null;for(;;){Pr=null;try{const{url:Sa,headers:S1,getResults:bm}=yield Vt();let Xf;try{Xf=yield T(Sa,{signal:Ui.signal,method:"POST",credentials:d,referrer:f,referrerPolicy:m,headers:{...S1,"content-type":"application/json; charset=utf-8"},body:JSON.stringify(Gn)})}catch(xu){throw new Ql(xu)}if(202!==Xf.status)throw new Ql(Xf);Pr=function(){var xu=(0,N.A)(function*(){let qh;try{const E1=new M,Al=Y.onDispose(()=>{Al(),E1.abort()});qh=yield T(Sa+"?operationId="+yr,{signal:E1.signal,method:"DELETE",credentials:d,referrer:f,referrerPolicy:m,headers:S1})}catch(E1){throw new Ql(E1)}if(200!==qh.status)throw new Ql(qh)});return function(){return xu.apply(this,arguments)}}();var Ed,us=!1,Su=!1;try{for(var Eu,Jl=yA(bm({signal:Ui.signal,operationId:yr}));us=!(Eu=yield Jl.next()).done;us=!1)pt=null,St=0,Si.next(Eu.value)}catch(xu){Su=!0,Ed=xu}finally{try{us&&null!=Jl.return&&(yield Jl.return())}finally{if(Su)throw Ed}}return Pr=null,Ui.abort()}catch(Sa){if(Ui.signal.aborted)return yield Pr?.();if(!(Sa instanceof Ql)||(t&&(_e=void 0),!s||St>=s))throw Ui.abort(),Sa;pt=Sa}finally{Ui.signal.aborted&&0===--xe&&(isFinite(i)&&i>0?setTimeout(()=>{xe||te.abort()},i):te.abort())}}})().then(()=>Si.complete()).catch(yr=>Si.error(yr)),()=>Ui.abort()}return e&&!t&&(0,N.A)(function*(){for(xe++;;)try{const{waitForThrow:Gn}=yield Vt();yield Gn()}catch(Gn){if(Y.disposed)return;if(!(Gn instanceof Ql)||(_e=void 0,!s||St>=s))return o?.(Gn);pt=Gn}})(),{subscribe:In,iterate(Gn,Si){const Qn=[],Ui={done:!1,error:null,resolve:()=>{}},ts=In(Gn,{next(Pr){Qn.push(Pr),Ui.resolve()},error(Pr){Ui.done=!0,Ui.error=Pr,Ui.resolve()},complete(){Ui.done=!0,Ui.resolve()}},Si),yr=(Pr=CA(function*(){for(;;){for(Qn.length||(yield bA(new Promise(Su=>Ui.resolve=Su)));Qn.length;)yield Qn.shift();if(Ui.error)throw Ui.error;if(Ui.done)return}}),function us(){return Pr.apply(this,arguments)})();var Pr;return yr.throw=function(){var Pr=(0,N.A)(function*(us){return Ui.done||(Ui.done=!0,Ui.error=us,Ui.resolve()),{done:!0,value:void 0}});return function(us){return Pr.apply(this,arguments)}}(),yr.return=(0,N.A)(function*(){return ts(),{done:!0,value:void 0}}),yr},dispose(){Y.dispose()}}}(e)}request(e){return new Ln(t=>this.client.subscribe({...e,query:X7(e.query)},{next:t.next.bind(t),complete:t.complete.bind(t),error:t.error.bind(t)}))}}const XIe={run:n=>n(),runOutsideAngular:n=>n()};let eV=(()=>{class n{constructor(){this.httpLink=we(HIe),this.gatewayService=we(WH),this.authService=we(vu),this.luigiCoreService=we(ar),this.apollo=(t,i=!1)=>new fA(XIe,this.createApolloOptions(t,i))}resolveToken(t){return this.authService.getToken()||this.resolveLuigiStoreToken()||t.token}resolveLuigiStoreToken(){try{return this.luigiCoreService.getAuthData()?.idToken}catch{return}}createAuthRetryLink(){return new ks((t,i)=>new Ln(o=>{let r,s;const l=d=>{r?.unsubscribe(),r=i(t).subscribe({next:o.next.bind(o),complete:o.complete.bind(o),error:f=>{d||!(n=>{const e=n;return[e?.status,e?.statusCode,e?.networkError?.status,e?.networkError?.statusCode].includes(401)})(f)?o.error(f):s=setTimeout(()=>l(!0),750)}})};return l(!1),()=>{void 0!==s&&clearTimeout(s),r?.unsubscribe()}}))}createApolloOptions(t,i=!1){const o=new mz(d=>{const f=d.headers instanceof Xs?d.headers:new Xs(d.headers??{});return{...d,uri:()=>this.gatewayService.getGatewayUrl(t,i),headers:f.set("Authorization",`Bearer ${this.resolveToken(t)}`).set("Accept","charset=utf-8")}}),r=tAe(({query:d})=>{const f=Rw(d);return"OperationDefinition"===f.kind&&"subscription"===f.operation},new KIe({url:()=>this.gatewayService.getGatewayUrl(t,i),headers:()=>({Authorization:`Bearer ${this.resolveToken(t)}`})}),this.httpLink.create({}));return{link:ks.from([this.createAuthRetryLink(),o,r]),cache:new gz}}static{this.\u0275fac=function(i){return new(i||n)}}static{this.\u0275prov=Bt({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})(),JIe=(()=>{class n{constructor(){this.httpClient=we(hu),this.luigiCoreService=we(ar)}requestChecks(t,i,o){if(!i?.entityActions.length||!o.length)return Cl([]);const r=t.organization,s=t.accountPath,l=this.luigiCoreService.getAuthData()?.idToken;if(!r||!l)return Cl([]);const d=o.map(m=>({resource:i.resource,group:i.group,name:m.name,namespace:m.namespace,actions:i.entityActions}));return this.httpClient.post("/rest/permissions/resource-check",{organization:r,accountPath:s,checks:d},{headers:{Authorization:`Bearer ${l}`}}).pipe(Tu(()=>Cl([])))}checkInstance(t,i,o){return this.requestChecks(t,i,[o])}checkInstances(t,i,o){return this.requestChecks(t,i,o)}static{this.\u0275fac=function(i){return new(i||n)}}static{this.\u0275prov=Bt({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();function tV(n){let e=n.replace(/[^a-zA-Z0-9]/g,"_");return/^[0-9]/.test(e)&&(e="_"+e),e}function AA(n){return n.split("_").filter(e=>e.length>0).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join("")}function nV(n,e,t){let i;if(n&&e)i=AA(tV(n)+"_"+e);else if(n)i=AA(tV(n));else{if(!e)return`${t}_Input`;i=AA("_"+e)}return`${i}${t}_Input`}function cm(n,e="_"){return[n.apiGroup,n.version,n.entity].filter(t=>!!t).join(e)}const um=n=>{const e=[];return n.map(t=>{t.property instanceof Array?t.property.map(i=>TA(i,e)):TA(t.property,e)}),e},TA=(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]:[...TA(t.splice(1).join("."))]}),e)},dm=(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=co({path:`${t.startsWith("$.")?"":"$."}${t}`,json:n}),r=o.length?o[0]:void 0;return r&&e.propertyField?eSe(r[e.propertyField.key],e.propertyField.transform):r},eSe=(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 nSe(t)}catch{return t}case"encode":try{return tSe(t)}catch{return t}default:return t}},n):n,tSe=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")}},nSe=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")}},I1=(n,e)=>dm(n,{jsonPathExpression:e}),Yf=n=>[n.resource,n.namespace,n.name].filter(Boolean).join("/");function Iu(n){return"Namespaced"===n?.resourceDefinition?.scope}function iV(n,e,t){if(!e)return n;const{getItemKey:i,mapSubscriptionObjectToItem:o}=t,r=new Map;n.forEach(m=>{const b=i(m);b&&r.set(b,m)});const{type:s,object:l}=e,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()]}const oV=(n,e,t)=>n?.[e??""]?.includes(t)??!0;function IA(n){if(Array.isArray(n))return n.map(e=>IA(e));if(n&&"object"==typeof n){const{__typename:e,...t}=n;for(const i of Object.keys(t))t[i]=IA(t[i]);return t}return n}function rV(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 sV=Symbol.for("gql-query-builder.raw");function SA(n){if(function rSe(n){return"object"==typeof n&&null!==n&&!0===n[sV]}(n))return String(n.value);if(null===n)return"null";if(Array.isArray(n))return`[${n.map(SA).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}: ${SA(t)}`).join(", ")}}`;default:throw new TypeError(`Cannot serialize ${typeof n} as a GraphQL literal`)}}function Sd(n){let e={};for(const{variables:t,fields:i}of n)e={...e,...t,...i&&f8(i)||{}};return e}function Kf(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 Xh(n){return n?n.map(e=>{if(rV(e))return function lSe(n){return`${EA(n)?"... on ":""}${function aSe(n){return EA(n)?n.operation:function sSe(n){return"string"==typeof n?n:`${n.alias}: ${n.name}`}(n.operation)}(n)} ${EA(n)?"":Kf(n.variables)} ${n.fields.length>0?`{ ${Xh(n.fields)} }`:""}`}(e);if("object"==typeof e){let t="";return Object.entries(e).forEach(([i,o],r,s)=>{t+=`${i} ${o.length>0?`{ ${Xh(o)} }`:""}`,r<s.length-1&&(t+=", ")}),t}return`${e}`}).join(", "):""}function EA(n){return!0===n?.fragment}function hm(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(f8(e)),t}function f8(n){let e={};return function t(i){return i?.forEach(o=>{if(rV(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 _m(n){const e=function uSe(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} = ${SA(n.default)}`}var dSe=class{#e;#n;#t;#i;constructor(n,e){Array.isArray(n)?this.#e=Sd(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(Sd(n),e.join("\n "))}#r(n){return this.#n&&"object"==typeof this.#n&&(n={...f8(this.#n),...n}),n&&Object.keys(n).length>0?`(${Object.keys(n).reduce((e,t,i)=>`${e}${0!==i?", ":""}$${t}: ${_m(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:hm(n,this.#n)}}#s(n){return`${"string"==typeof n?n:`${n.alias}: ${n.name}`} ${Kf(this.#e)} ${this.#n&&this.#n.length>0?`{\n ${Xh(this.#n)}\n }`:""}`}},hSe=class{#e;#n;#t;#i;constructor(n,e){this.#i={operationName:"",...e},Array.isArray(n)?this.#e=Sd(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={...f8(this.#n),...n}),n&&Object.keys(n).length>0?`(${Object.keys(n).reduce((e,t,i)=>`${e}${0!==i?", ":""}$${t}: ${_m(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:hm(this.#e,this.#n)}}#s(n){return`${"string"==typeof this.#t?this.#t:`${this.#t.alias}: ${this.#t.name}`} ${n?Kf(n):""} ${this.#n&&this.#n.length>0?`{ ${Xh(this.#n)} }`:""}`}},_Se=class{#e;#n;#t;#i;constructor(n,e){Array.isArray(n)?this.#e=Sd(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(Sd(n),e.join("\n "))}#r(n){return n&&Object.keys(n).length?`(${Object.keys(n).reduce((e,t,i)=>`${e}${0!==i?", ":""}$${t}: ${_m(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:hm(n)}}#s(){return`${"string"==typeof this.#t?this.#t:`${this.#t.alias}: ${this.#t.name}`} ${this.#e?Kf(this.#e):""} {\n ${Xh(this.#n)}\n }`}};function xA(n,e){const t=function cSe(n){return n?.length?n.map(e=>`\n\nfragment ${e.name} on ${e.on} { ${Xh(e.fields)} }`).join(""):""}(e?.fragments);return t?{...n,query:n.query+t}:n}function aV(n,e,t){const o=new(e??hSe)(n,t);return xA(Array.isArray(n)?o.queriesBuilder(n):o.queryBuilder(),t)}function DA(n,e,t){const o=new(e??dSe)(n,t);return xA(Array.isArray(n)?o.mutationsBuilder(n):o.mutationBuilder(),t)}let pm=(()=>{class n{constructor(){this.apolloFactory=we(eV),this.luigiCoreService=we(ar)}read(t,i,o,r,s=!0){const l=Iu(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(_o(m=>I1(m.data,cm(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 aV(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={...Iu(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},b=o.resourceDefinition;return b?i instanceof Array?this.listWithFields(b,i,o,s,m):this.listWithRawQuery(t,i,o,s,m):Yh(()=>new Error("Resource definition is required"))}getResourceReadyStatus(t,i){const o=i.resourceDefinition?.readyCondition;return!o||dm(t,o)}listWithFields(t,i,o,r,s){const{apiGroup:l,entityCollection:d,version:f}=t,w=aV(this.calcQueryOptions([{operation:d,variables:s,fields:["resourceVersion","remainingItemCount","continue",{items:i}]}],[{operation:l},{operation:f}])),T=this.parseGQLQuery(w.query);return this.apolloFactory.apollo(o,r).query({query:T,variables:w.variables}).pipe(_o(M=>{const Y=I1(M.data,cm({apiGroup:l,version:f,entity:d},"."));if(!Y)throw new Error("Resource list result not found");return Y}),_o(M=>{const Y=M.items.map(te=>({...te,ready:this.getResourceReadyStatus(te,o)})).map(te=>({...te,id:te.metadata.name,isAvailable:this.isAvailable(te),accessibleName:this.getAccessibleName(te)}));return{...M,items:Y}}))}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(_o(d=>I1(d.data,t)??[]),Tu(d=>(this.alertErrors(d),console.error("Error executing GraphQL query.",d),Yh(()=>d))))}resourceChangeSubscription(t,i,o,r,s){const d={...Iu(o)&&{namespace:{type:"String",value:this.getNamespace(o)}}},f=t.toLowerCase(),m=function gSe(n,e,t){const o=new(e??_Se)(n,t);return xA(Array.isArray(n)?o.subscriptionsBuilder(n):o.subscriptionBuilder(),t)}({operation:f,fields:["type",{object:i}],variables:{...d,resourceVersion:{type:"String",value:r}}}),b=this.parseGQLQuery(m.query);return this.apolloFactory.apollo(o,s).subscribe({query:b,variables:m.variables}).pipe(_o(w=>{const T=I1(w.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=Iu(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:[]}],w=DA(this.calcQueryOptions(m,[{operation:l},{operation:f}])),T=this.parseGQLQuery(w.query);return this.apolloFactory.apollo(o,r).mutate({mutation:T,variables:w.variables}).pipe(Tu(M=>(this.alertErrors(M),console.error("Error executing GraphQL query.",M),Yh(()=>M))))}create(t,i,o){const r=Iu(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:`${nV(s,d,l)}!`,value:t}},fields:["__typename"]}],w=DA(this.calcQueryOptions(m,[{operation:s},{operation:d}])),T=this.parseGQLQuery(w.query);return this.apolloFactory.apollo(o).mutate({mutation:T,fetchPolicy:"no-cache",variables:w.variables}).pipe(Tu(M=>(this.alertErrors(M),console.error("Error executing GraphQL query.",M),Yh(()=>M))))}update(t,i,o,r=!1,s=["__typename"]){const l=Iu(o),{apiGroup:d,entity:f,version:m}=i,b=this.getNamespace(o),w=IA(t),T=[{operation:`update${f}`,variables:{...l&&{namespace:{type:"String",value:b}},name:{type:"String!",value:t.metadata.name},object:{type:`${nV(d,m,f)}!`,value:w}},fields:s}],Y=DA(this.calcQueryOptions(T,[{operation:d},{operation:m}])),te=this.parseGQLQuery(Y.query);return this.apolloFactory.apollo(o,r).mutate({mutation:te,fetchPolicy:"no-cache",variables:Y.variables}).pipe(_o(_e=>I1(_e.data,cm({apiGroup:d,entity:`update${f}`,version:m},"."))),Tu(_e=>(this.alertErrors(_e),console.error("Error executing GraphQL query.",_e),Yh(()=>_e))))}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 mA`
82
+ */globalThis.$localize=H7;const xo=globalThis.Luigi;let ar=(()=>{class n{setConfig(t){return xo.setConfig(t)}get config(){return xo.getConfig()}getConfigValue(t){return xo.getConfigValue(t)}unloadConfig(){return xo.unload()}sendCustomMessage(t){return xo.sendCustomMessage(t)}configChanged(t){xo.configChanged(t)}customMessages(){return xo.customMessages()}navigation(){return xo.navigation()}resetLuigi(){xo.reset()}clearNavigationCache(){xo.clearNavigationCache&&xo.clearNavigationCache()}showAlert(t){return xo.showAlert(t)}ux(){return xo.ux()}theming(){return xo.theming()}i18n(){return xo.i18n()}globalSearch(){return xo.globalSearch()}getGlobalContext(){return xo.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){xo.setGlobalContext(t,i)}setInGlobalContext(t,i=!1){xo.setGlobalContext({...this.getGlobalContext(),...t},i)}routing(){return xo.routing()}setFeatureToggle(t){xo.featureToggles().setFeatureToggle(t)}unsetFeatureToggle(t){xo.featureToggles().unsetFeatureToggle(t)}unsetAllFeatureToggles(){xo.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 xo.featureToggles().getActiveFeatureToggleList().includes(t)}getActiveFeatureToggleList(){return xo.featureToggles().getActiveFeatureToggleList()}setAuthData(t){xo.auth().store.setAuthData(t),xo.auth().store.setNewlyAuthorized()}removeAuthData(){xo.auth().store.removeAuthData()}getAuthData(){return xo.auth().store.getAuthData()}setCurrentLocale(t){xo.i18n().setCurrentLocale(t)}static{this.\u0275fac=function(i){return new(i||n)}}static{this.\u0275prov=Bt({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})(),vu=(()=>{class n{constructor(t){this.http=t,this.authEventSubject=new Li,this.parseJwt=i=>{try{return function xye(n,e){if("string"!=typeof n)throw new P5("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 P5(`Invalid token specified: missing part #${t+1}`);let o;try{o=function Eye(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 Sye(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 P5(`Invalid token specified: invalid base64 for part #${t+1} (${r.message})`)}try{return JSON.parse(o)}catch(r){throw new P5(`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 S5(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)(Dn(hu))}}static{this.\u0275prov=Bt({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})(),y1=(()=>{class n{constructor(){this.http=we(hu)}getEnvConfig(){var t=this;return(0,N.A)(function*(){return t.envConfigCache||(yield S5(t.http.get("/rest/envconfig").pipe(f1(i=>t.envConfigCache=i)))),t.envConfigCache})()}static{this.\u0275fac=function(i){return new(i||n)}}static{this.\u0275prov=Bt({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})(),bd=(()=>{class n{constructor(){this.envConfigService=we(y1),this.luigiCoreService=we(ar),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=Bt({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();var w1=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}(w1||{});(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(w1.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 WH=(()=>{class n{constructor(){this.luigiCoreService=we(ar)}getGatewayUrl(t,i=!1){const o=t.portalContext.crdGatewayApiUrl,r=this.extractKcpPath(o);return o?.replace(r,this.resolveKcpPath(t,i))}updateCrdGatewayUrlWithEntityPath(t){const i=this.luigiCoreService.getGlobalContext().portalContext.crdGatewayApiUrl,o=this.extractKcpPath(i);this.luigiCoreService.getGlobalContext().portalContext.crdGatewayApiUrl=i.replace(o,t)}resolveKcpPath(t,i=!1){let r=this.extractKcpPath(t.portalContext.crdGatewayApiUrl);if(t.kcpPath&&(r=t.kcpPath),i){const s=r.lastIndexOf(":");-1!==s&&(r=r.slice(0,s))}return r}extractKcpPath(t){return t.match(new RegExp("(root:orgs[^/]*)"))?.[1]||""}static{this.\u0275fac=function(i){return new(i||n)}}static{this.\u0275prov=Bt({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();const bu=new Ln(n=>n.complete());function Wa(n,e){return n.definitions.find(t=>"OperationDefinition"===t.kind&&!!t.name)?.name.value??e}function j7(n,e){if(!n)throw new Error(e)}function aw(n){return G7(n,[])}function G7(n,e){switch(typeof n){case"string":return JSON.stringify(n);case"function":return n.name?`[function ${n.name}]`:"[function]";case"object":return function Owe(n,e){if(null===n)return"null";if(e.includes(n))return"[Circular]";const t=[...e,n];if(function Bwe(n){return"function"==typeof n.toJSON}(n)){const i=n.toJSON();if(i!==n)return"string"==typeof i?i:G7(i,t)}else if(Array.isArray(n))return function Fwe(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(G7(n[r],e));return 1===i?o.push("... 1 more item"):i>1&&o.push(`... ${i} more items`),"["+o.join(", ")+"]"}(n,t);return function Pwe(n,e){const t=Object.entries(n);return 0===t.length?"{}":e.length>2?"["+function Hwe(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+": "+G7(r,e)).join(", ")+" }"}(n,t)}(n,e);default:return String(n)}}class Uwe{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 ZH{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 YH={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"]},zwe=new Set(Object.keys(YH));function KH(n){const e=n?.kind;return"string"==typeof e&&zwe.has(e)}var Cu=function(n){return n.QUERY="query",n.MUTATION="mutation",n.SUBSCRIPTION="subscription",n}(Cu||{}),hn=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}(hn||{});const zh=Object.freeze({});function yu(n,e,t=YH){const i=new Map;for(const _e of Object.values(hn))i.set(_e,lw(e,_e));let o,m,b,r=Array.isArray(n),s=[n],l=-1,d=[],f=n;const w=[],T=[];do{l++;const _e=l===s.length,xe=_e&&0!==d.length;if(_e){if(m=0===T.length?void 0:w[w.length-1],f=b,b=T.pop(),xe)if(r){f=f.slice();let St=0;for(const[Vt,Un]of d){const In=Vt-St;null===Un?(f.splice(In,1),St++):f[In]=Un}}else{f={...f};for(const[St,Vt]of d)f[St]=Vt}l=o.index,s=o.keys,d=o.edits,r=o.inArray,o=o.prev}else if(b){if(m=r?l:s[l],f=b[m],null==f)continue;w.push(m)}let pt;if(!Array.isArray(f)){var M,Y;KH(f)||j7(!1,`Invalid AST Node: ${aw(f)}.`);const St=_e?null===(M=i.get(f.kind))||void 0===M?void 0:M.leave:null===(Y=i.get(f.kind))||void 0===Y?void 0:Y.enter;if(pt=St?.call(e,f,m,b,w,T),pt===zh)break;if(!1===pt){if(!_e){w.pop();continue}}else if(void 0!==pt&&(d.push([m,pt]),!_e)){if(!KH(pt)){w.pop();continue}f=pt}}var te;void 0===pt&&xe&&d.push([m,f]),_e?w.pop():(o={inArray:r,index:l,keys:s,edits:d,prev:o},r=Array.isArray(f),s=r?f:null!==(te=t[f.kind])&&void 0!==te?te:[],l=-1,d=[],b&&T.push(b),b=f)}while(void 0!==o);return 0!==d.length?d[d.length-1][1]:n}function lw(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 kf(n){try{return n()}catch{}}const cw=kf(()=>globalThis)||kf(()=>window)||kf(()=>self)||kf(()=>global)||kf(function(){return kf.constructor("return this")()}),uw="4.2.11",XH=new Map;function qH(n){const e=XH.get(n)||1;return XH.set(n,e+1),`${n}:${e}:${Math.random().toString(36).slice(2)}`}const JH="Invariant Violation";class dw extends Error{constructor(e=JH){super(e),this.name=JH,Object.setPrototypeOf(this,dw.prototype)}}const W7=["debug","log","warn","error","silent"];let hw=W7.indexOf("silent");function vn(n,...e){if(!n)throw yl(...e)}function $7(n){return function(e,...t){if(W7.indexOf(n)>=hw){const i=console[n]||console.log;if("number"==typeof e){const o=e;(e=tU(o))||(e=nU(o,t),t=[])}i(e,...t)}}}function yl(n,...e){return new dw(tU(n,e)||nU(n,e))}vn.debug=$7("debug"),vn.log=$7("log"),vn.warn=$7("warn"),vn.error=$7("error");const eU=Symbol.for("ApolloErrorMessageHandler_"+uw);function _w(n){if("string"==typeof n)return n;try{return function QH(n,e=0){const t=qH("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 tU(n,e=[]){if(n)return cw[eU]&&cw[eU](n,e.map(_w))}function nU(n,e=[]){if(n)return"string"==typeof n?e.reduce((t,i)=>t.replace(/%[sdfo]/,_w(i)),n):`An error occurred! For more details, see the full error text at https://go.apollo.dev/c/err#${encodeURIComponent(JSON.stringify({version:uw,message:n,args:e.map(_w)}))}`}const Cd={...cw[Symbol.for("apollo.cacheSize")]},jwe=()=>Object.create(null),{forEach:Gwe,slice:iU}=Array.prototype,{hasOwnProperty:Wwe}=Object.prototype;class wu{constructor(e=!0,t=jwe){this.weakness=e,this.makeData=t}lookup(){return this.lookupArray(arguments)}lookupArray(e){let t=this;return Gwe.call(e,i=>t=t.getChildTrie(i)),Wwe.call(t,"data")?t.data:t.data=this.makeData(iU.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(iU.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 wu(this.weakness,this.makeData)),i}mapFor(e,t){return this.weakness&&function $we(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 pw(){}const Zwe=pw,Ywe=typeof WeakRef<"u"?WeakRef:function(n){return{deref:()=>n}},Kwe=typeof WeakMap<"u"?WeakMap:Map,Xwe=typeof FinalizationRegistry<"u"?FinalizationRegistry:function(){return{register:pw,unregister:pw}};class Z7{constructor(e=1/0,t=Zwe){this.max=e,this.dispose=t,this.map=new Kwe,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 Ywe(s),this.registry.register(s,r,r)}this.unfinalizedNodes.size>0?queueMicrotask(this.finalize):this.finalizationScheduled=!1},this.registry=new Xwe(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 Qwe(){}class fw{constructor(e=1/0,t=Qwe){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 gw=new WeakSet;function oU(n){n.size<=(n.max||-1)||gw.has(n)||(gw.add(n),setTimeout(()=>{n.clean(),gw.delete(n)},100))}const mw=function(n,e){const t=new Z7(n,e);return t.set=function(i,o){const r=Z7.prototype.set.call(this,i,o);return oU(this),r},t},Jwe=function(n,e){const t=new fw(n,e);return t.set=function(i,o){const r=fw.prototype.set.call(this,i,o);return oU(this),r},t};function rU(n,{max:e,makeCacheKey:t=i=>i}){const i=new wu(!0),o=new mw(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 Vh=rU((n,e)=>{vn(n&&"Document"===n.kind,1);const t=n.definitions.filter(i=>"OperationDefinition"===i.kind);e&&vn(1==t.length&&t[0].operation===e,4,e,e,t[0].operation),yu(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===hn.FIELD&&d.push(l.alias?.value||l.name.value);throw d.splice(-1,1,i.name.value),yl(5,i.alias.value,d.join("."),t[0].operation,Wa(n,"(anonymous)"))}}})},{max:Cd.checkDocument||2e3});function yd(n){return Vh(n),n.definitions.filter(e=>"OperationDefinition"===e.kind)[0]}class ks{static empty(){return new ks(()=>bu)}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 eAe(n,{client:e}){const t={query:n.query,variables:n.variables||{},extensions:n.extensions||{},operationName:Wa(n.query),operationType:yd(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),()=>bu)}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 yl(65)}left;right}const tAe=ks.split,{toString:sU,hasOwnProperty:nAe}=Object.prototype,aU=Function.prototype.toString,vw=new Map;function jo(n,e){try{return bw(n,e)}finally{vw.clear()}}function bw(n,e){if(n===e)return!0;const t=sU.call(n);if(t!==sU.call(e))return!1;switch(t){case"[object Array]":if(n.length!==e.length)return!1;case"[object Object]":{if(cU(n,e))return!0;const o=lU(n),r=lU(e),s=o.length;if(s!==r.length)return!1;for(let l=0;l<s;++l)if(!nAe.call(e,o[l]))return!1;for(let l=0;l<s;++l){const d=o[l];if(!bw(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(cU(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&&!bw(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=aU.call(n);return o===aU.call(e)&&!function rAe(n,e){const t=n.length-e.length;return t>=0&&n.indexOf(e,t)===t}(o,oAe)}}return!1}function lU(n){return Object.keys(n).filter(iAe,n)}function iAe(n){return void 0!==this[n]}const oAe="{ [native code] }";function cU(n,e){let t=vw.get(n);if(t){if(t.has(e))return!0}else vw.set(n,t=new Set);return t.add(e),!1}let Os=null;const uU={};let sAe=1;function dU(n){try{return n()}catch{}}const Cw="@wry/context:Slot",hU=dU(()=>globalThis)||dU(()=>global)||Object.create(null),Y7=hU[Cw]||Array[Cw]||function(n){try{Object.defineProperty(hU,Cw,{value:n,enumerable:!1,writable:!1,configurable:!0})}finally{return n}}(class{constructor(){this.id=["slot",sAe++,Date.now(),Math.random().toString(36).slice(2)].join(":")}hasValue(){for(let e=Os;e;e=e.parent)if(this.id in e.slots){const t=e.slots[this.id];if(t===uU)break;return e!==Os&&(Os.slots[this.id]=t),!0}return Os&&(Os.slots[this.id]=uU),!1}getValue(){if(this.hasValue())return Os.slots[this.id]}withValue(e,t,i,o){const s=Os;Os={parent:s,slots:{__proto__:null,[this.id]:e}};try{return t.apply(o,i)}finally{Os=s}}static bind(e){const t=Os;return function(){const i=Os;try{return Os=t,e.apply(this,arguments)}finally{Os=i}}}static noContext(e,t,i){if(!Os)return e.apply(i,t);{const o=Os;try{return Os=null,e.apply(i,t)}finally{Os=o}}}}),U5=new Y7,{hasOwnProperty:uAe}=Object.prototype,ww=Array.from||function(n){const e=[];return n.forEach(t=>e.push(t)),e};function K7(n){const{unsubscribe:e}=n;"function"==typeof e&&(n.unsubscribe=void 0,e())}const z5=[];function Of(n,e){if(!n)throw new Error(e||"assertion failure")}function pU(n,e){const t=n.length;return t>0&&t===e.length&&n[t-1]===e[t-1]}function fU(n){switch(n.length){case 0:throw new Error("unknown value");case 1:return n[0];case 2:throw n[1]}}function gU(n){return n.slice(0)}let hAe=(()=>{class n{constructor(t){this.fn=t,this.parents=new Set,this.childValues=new Map,this.dirtyChildren=null,this.dirty=!0,this.recomputing=!1,this.value=[],this.deps=null,++n.count}peek(){if(1===this.value.length&&!jh(this))return mU(this),this.value[0]}recompute(t){return Of(!this.recomputing,"already recomputing"),mU(this),jh(this)?function _Ae(n,e){return AU(n),U5.withValue(n,pAe,[n,e]),function gAe(n,e){if("function"==typeof n.subscribe)try{K7(n),n.unsubscribe=n.subscribe.apply(null,e)}catch{return n.setDirty(),!1}return!0}(n,e)&&function fAe(n){n.dirty=!1,!jh(n)&&bU(n)}(n),fU(n.value)}(this,t):fU(this.value)}setDirty(){this.dirty||(this.dirty=!0,vU(this),K7(this))}dispose(){this.setDirty(),AU(this),Aw(this,(t,i)=>{t.setDirty(),TU(t,this)})}forget(){this.dispose()}dependOn(t){t.add(this),this.deps||(this.deps=z5.pop()||new Set),this.deps.add(t)}forgetDeps(){this.deps&&(ww(this.deps).forEach(t=>t.delete(this)),this.deps.clear(),z5.push(this.deps),this.deps=null)}}return n.count=0,n})();function mU(n){const e=U5.getValue();if(e)return n.parents.add(e),e.childValues.has(n)||e.childValues.set(n,[]),jh(n)?CU(e,n):yU(e,n),e}function pAe(n,e){n.recomputing=!0;const{normalizeResult:t}=n;let i;t&&1===n.value.length&&(i=gU(n.value)),n.value.length=0;try{if(n.value[0]=n.fn.apply(null,e),t&&i&&!pU(i,n.value))try{n.value[0]=t(n.value[0],i[0])}catch{}}catch(o){n.value[1]=o}n.recomputing=!1}function jh(n){return n.dirty||!(!n.dirtyChildren||!n.dirtyChildren.size)}function vU(n){Aw(n,CU)}function bU(n){Aw(n,yU)}function Aw(n,e){const t=n.parents.size;if(t){const i=ww(n.parents);for(let o=0;o<t;++o)e(i[o],n)}}function CU(n,e){Of(n.childValues.has(e)),Of(jh(e));const t=!jh(n);if(n.dirtyChildren){if(n.dirtyChildren.has(e))return}else n.dirtyChildren=z5.pop()||new Set;n.dirtyChildren.add(e),t&&vU(n)}function yU(n,e){Of(n.childValues.has(e)),Of(!jh(e));const t=n.childValues.get(e);0===t.length?n.childValues.set(e,gU(e.value)):pU(t,e.value)||n.setDirty(),wU(n,e),!jh(n)&&bU(n)}function wU(n,e){const t=n.dirtyChildren;t&&(t.delete(e),0===t.size&&(z5.length<100&&z5.push(t),n.dirtyChildren=null))}function AU(n){n.childValues.size>0&&n.childValues.forEach((e,t)=>{TU(n,t)}),n.forgetDeps(),Of(null===n.dirtyChildren)}function TU(n,e){e.parents.delete(n),n.childValues.delete(e),wU(n,e)}const mAe={setDirty:!0,dispose:!0,forget:!0};function IU(n){const e=new Map,t=n&&n.subscribe;function i(o){const r=U5.getValue();if(r){let s=e.get(o);s||e.set(o,s=new Set),r.dependOn(s),"function"==typeof t&&(K7(s),s.unsubscribe=t(o))}}return i.dirty=function(r,s){const l=e.get(r);if(l){const d=s&&uAe.call(mAe,s)?s:"setDirty";ww(l).forEach(f=>f[d]()),e.delete(r),K7(l)}},i}let SU;function EU(...n){return(SU||(SU=new wu("function"==typeof WeakMap))).lookupArray(n)}const Tw=new Set;function V5(n,{max:e=Math.pow(2,16),keyArgs:t,makeCacheKey:i=EU,normalizeResult:o,subscribe:r,cache:s=fw}=Object.create(null)){const l="function"==typeof s?new s(e,w=>w.dispose()):s,d=function(){const w=i.apply(null,t?t.apply(null,arguments):arguments);if(void 0===w)return n.apply(null,arguments);let T=l.get(w);T||(l.set(w,T=new hAe(n)),T.normalizeResult=o,T.subscribe=r,T.forget=()=>l.delete(w));const M=T.recompute(Array.prototype.slice.call(arguments));return l.set(w,T),Tw.add(l),U5.hasValue()||(Tw.forEach(Y=>Y.clean()),Tw.clear()),M};function f(w){const T=w&&l.get(w);T&&T.setDirty()}function m(w){const T=w&&l.get(w);if(T)return T.peek()}function b(w){return!!w&&l.delete(w)}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=b,d.forget=function(){return b(i.apply(null,arguments))},d.makeCacheKey=i,d.getKey=t?function(){return i.apply(null,t.apply(null,arguments))}:i,Object.freeze(d)}function vAe(n){return n}class wd{transform;cached;resultCache=new WeakSet;getCacheKey(e){return[e]}static identity(){return new wd(vAe,{cache:!1})}static split(e,t,i=wd.identity()){return Object.assign(new wd(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 wu;this.performWork=V5(wd.prototype.performWork.bind(this),{makeCacheKey:t=>{const i=this.getCacheKey(t);if(i)return vn(Array.isArray(i),20),e.lookupArray(i)},max:Cd["documentTransform.cache"],cache:Z7})}}performWork(e){return Vh(e),this.transform(e)}transformDocument(e){if(this.resultCache.has(e))return e;const t=this.performWork(e);return this.resultCache.add(t),t}concat(e){return Object.assign(new wd(t=>e.transformDocument(this.transformDocument(t)),{cache:!1}),{left:this,right:e})}left;right}const xU={kind:hn.FIELD,name:{kind:hn.NAME,value:"__typename"}},Iw=Object.assign(function(n){return yu(n,{SelectionSet:{enter(e,t,i){if(i&&i.kind===hn.OPERATION_DEFINITION)return;const{selections:o}=e;return o&&!o.some(l=>l.kind===hn.FIELD&&("__typename"===l.name.value||0===l.name.value.lastIndexOf("__",0)))?i.kind===hn.FIELD&&i.directives&&i.directives.some(l=>"export"===l.name.value)?void 0:{...e,selections:[...o,xU]}:void 0}}})},{added:n=>n===xU}),Ad=Object.assign(function(e){return JSON.stringify(e,TAe)},{reset(){Bf=new Jwe(Cd.canonicalStringify||1e3)}});let Bf;function TAe(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(IAe))return e;const o=JSON.stringify(i);let r=Bf.get(o);if(!r){i.sort();const l=JSON.stringify(i);r=Bf.get(l)||i,Bf.set(o,r),Bf.set(l,r)}const s=Object.create(t);return r.forEach(l=>{s[l]=e[l]}),s}}return e}function IAe(n,e,t){return 0===e||t[e-1]<=n}function Dw(n){return 9===n||32===n}function j5(n){return n>=48&&n<=57}function MU(n){return n>=97&&n<=122||n>=65&&n<=90}function RU(n){return MU(n)||95===n}function SAe(n){return MU(n)||j5(n)||95===n}function EAe(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=xAe(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 xAe(n){let e=0;for(;e<n.length&&Dw(n.charCodeAt(e));)++e;return e}Ad.reset();const LAe=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function MAe(n){return RAe[n.charCodeAt(0)]}const RAe=["\\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 X7(n){return yu(n,OAe)}const OAe={Name:{leave:n=>n.value},Variable:{leave:n=>"$"+n.name},Document:{leave:n=>En(n.definitions,"\n\n")},OperationDefinition:{leave(n){const e=Nw(n.variableDefinitions)?Ti("(\n",En(n.variableDefinitions,"\n"),"\n)"):Ti("(",En(n.variableDefinitions,", "),")"),t=Ti("",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})=>Ti("",o,"\n")+n+": "+e+Ti(" = ",t)+Ti(" ",En(i," "))},SelectionSet:{leave:({selections:n})=>Ec(n)},Field:{leave({alias:n,name:e,arguments:t,directives:i,selectionSet:o}){const r=Ti("",n,": ")+e;let s=r+Ti("(",En(t,", "),")");return s.length>80&&(s=r+Ti("(\n",q7(En(t,"\n")),"\n)")),En([s,En(i," "),o]," ")}},Argument:{leave:({name:n,value:e})=>n+": "+e},FragmentSpread:{leave:({name:n,directives:e})=>"..."+n+Ti(" ",En(e," "))},InlineFragment:{leave:({typeCondition:n,directives:e,selectionSet:t})=>En(["...",Ti("on ",n),En(e," "),t]," ")},FragmentDefinition:{leave:({name:n,typeCondition:e,variableDefinitions:t,directives:i,selectionSet:o,description:r})=>Ti("",r,"\n")+`fragment ${n}${Ti("(",En(t,", "),")")} on ${e} ${Ti("",En(i," ")," ")}`+o},IntValue:{leave:({value:n})=>n},FloatValue:{leave:({value:n})=>n},StringValue:{leave:({value:n,block:e})=>e?function DAe(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||Dw(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 b="";const w=o&&Dw(n.charCodeAt(0));return(m&&!w||r)&&(b+="\n"),b+=t,(m||f)&&(b+="\n"),'"""'+b+'"""'}(n):function NAe(n){return`"${n.replace(LAe,MAe)}"`}(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+Ti("(",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})=>Ti("",n,"\n")+En(["schema",En(e," "),Ec(t)]," ")},OperationTypeDefinition:{leave:({operation:n,type:e})=>n+": "+e},ScalarTypeDefinition:{leave:({description:n,name:e,directives:t})=>Ti("",n,"\n")+En(["scalar",e,En(t," ")]," ")},ObjectTypeDefinition:{leave:({description:n,name:e,interfaces:t,directives:i,fields:o})=>Ti("",n,"\n")+En(["type",e,Ti("implements ",En(t," & ")),En(i," "),Ec(o)]," ")},FieldDefinition:{leave:({description:n,name:e,arguments:t,type:i,directives:o})=>Ti("",n,"\n")+e+(Nw(t)?Ti("(\n",q7(En(t,"\n")),"\n)"):Ti("(",En(t,", "),")"))+": "+i+Ti(" ",En(o," "))},InputValueDefinition:{leave:({description:n,name:e,type:t,defaultValue:i,directives:o})=>Ti("",n,"\n")+En([e+": "+t,Ti("= ",i),En(o," ")]," ")},InterfaceTypeDefinition:{leave:({description:n,name:e,interfaces:t,directives:i,fields:o})=>Ti("",n,"\n")+En(["interface",e,Ti("implements ",En(t," & ")),En(i," "),Ec(o)]," ")},UnionTypeDefinition:{leave:({description:n,name:e,directives:t,types:i})=>Ti("",n,"\n")+En(["union",e,En(t," "),Ti("= ",En(i," | "))]," ")},EnumTypeDefinition:{leave:({description:n,name:e,directives:t,values:i})=>Ti("",n,"\n")+En(["enum",e,En(t," "),Ec(i)]," ")},EnumValueDefinition:{leave:({description:n,name:e,directives:t})=>Ti("",n,"\n")+En([e,En(t," ")]," ")},InputObjectTypeDefinition:{leave:({description:n,name:e,directives:t,fields:i})=>Ti("",n,"\n")+En(["input",e,En(t," "),Ec(i)]," ")},DirectiveDefinition:{leave:({description:n,name:e,arguments:t,directives:i,repeatable:o,locations:r})=>Ti("",n,"\n")+"directive @"+e+(Nw(t)?Ti("(\n",q7(En(t,"\n")),"\n)"):Ti("(",En(t,", "),")"))+Ti(" ",En(i," "))+(o?" repeatable":"")+" on "+En(r," | ")},SchemaExtension:{leave:({directives:n,operationTypes:e})=>En(["extend schema",En(n," "),Ec(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,Ti("implements ",En(e," & ")),En(t," "),Ec(i)]," ")},InterfaceTypeExtension:{leave:({name:n,interfaces:e,directives:t,fields:i})=>En(["extend interface",n,Ti("implements ",En(e," & ")),En(t," "),Ec(i)]," ")},UnionTypeExtension:{leave:({name:n,directives:e,types:t})=>En(["extend union",n,En(e," "),Ti("= ",En(t," | "))]," ")},EnumTypeExtension:{leave:({name:n,directives:e,values:t})=>En(["extend enum",n,En(e," "),Ec(t)]," ")},InputObjectTypeExtension:{leave:({name:n,directives:e,fields:t})=>En(["extend input",n,En(e," "),Ec(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,Ti(".",e)])},ArgumentCoordinate:{leave:({name:n,fieldName:e,argumentName:t})=>En([n,Ti(".",e),Ti("(",t,":)")])},DirectiveCoordinate:{leave:({name:n})=>En(["@",n])},DirectiveArgumentCoordinate:{leave:({name:n,argumentName:e})=>En(["@",n,Ti("(",e,":)")])}};function En(n,e=""){var t;return null!==(t=n?.filter(i=>i).join(e))&&void 0!==t?t:""}function Ec(n){return Ti("{\n",q7(En(n,"\n")),"\n}")}function Ti(n,e,t=""){return null!=e&&""!==e?n+e+t:""}function q7(n){return Ti(" ",n.replace(/\n/g,"\n "))}function Nw(n){var e;return null!==(e=n?.some(t=>t.includes("\n")))&&void 0!==e&&e}let G5;const W5=Object.assign(n=>{let e=G5.get(n);return e||(e=X7(n),G5.set(n,e)),e},{reset(){G5=new mw(Cd.print||2e3)}});function Do(n){return!(!n||"object"!=typeof n||"string"!=typeof n.__ref)}function $5(n={}){const{connector:e=()=>new Li,resetOnError:t=!0,resetOnComplete:i=!0,resetOnRefCountZero:o=!0}=n;return r=>{let s,l,d,f=0,m=!1,b=!1;const w=()=>{l?.unsubscribe(),l=void 0},T=()=>{w(),s=d=void 0,m=b=!1},M=()=>{const Y=s;T(),Y?.unsubscribe()};return Hs((Y,te)=>{f++,!b&&!m&&w();const _e=d=d??e();te.add(()=>{f--,0===f&&!b&&!m&&(l=Mw(M,o))}),_e.subscribe(te),!s&&f>0&&(s=new bn({next:xe=>_e.next(xe),error:xe=>{b=!0,w(),l=Mw(T,t,xe),_e.error(xe)},complete:()=>{m=!0,w(),l=Mw(T,i),_e.complete()}}),nl(Y).subscribe(s))})(r)}}function Mw(n,e,...t){if(!0===e)return void n();if(!1===e)return;const i=new bn({next:()=>{i.unsubscribe(),n()}});return nl(e(...t)).subscribe(i)}function Q7(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,$5({connector:()=>new k3(i,e,t),resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:o})}W5.reset();const OU=rU(function(e,t,i){return function zAe(n,e){let t,i;function o(r){return r!==t&&(t=r,i=e(t)),i}return Object.assign(n.pipe(_o(o),Q7({bufferSize:1,refCount:!0})),{getCurrentResult:()=>o(n.getCurrentResult())})}(e,i)},{max:1,makeCacheKey:n=>n.slice(0,2)});function Z5(n=[]){const e={};return n.forEach(t=>{e[t.name.value]=t}),e}function Y5(n){return n.definitions.filter(e=>"FragmentDefinition"===e.kind)}function J7(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 vn(i,9,t),i||null}default:return null}}function Rw(n){let e;Vh(n);for(let t of n.definitions){if("OperationDefinition"===t.kind)return t;"FragmentDefinition"===t.kind&&!e&&(e=t)}if(e)return e;throw yl(12)}function K5(n){return"Field"===n.kind}function A1(n){return n.alias?n.alias.value:n.name.value}function e8({directives:n},e){return!n||!n.length||function GAe(n){const e=[];return n&&n.length&&n.forEach(t=>{if(!function jAe({name:{value:n}}){return"skip"===n||"include"===n}(t))return;const i=t.arguments,o=t.name.value;vn(i&&1===i.length,16,o);const r=i[0];vn(r.name&&"if"===r.name.value,17,o);const s=r.value;vn(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],vn(void 0!==o,15,t.name.value)):o=i.value.value,"skip"===t.name.value?!o:o})}function BU(n,{data:e,...t},{data:i,...o},r){return jo(t,o)&&t8(Rw(n).selectionSet,e,i,{fragmentMap:Z5(Y5(n)),variables:r})}function t8(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),!e8(r,i.variables))||PU(r))return!0;if(K5(r)){const s=A1(r),l=e&&e[s],d=t&&t[s],f=r.selectionSet;if(!f)return jo(l,d);const m=Array.isArray(l),b=Array.isArray(d);if(m!==b)return!1;if(m&&b){const w=l.length;if(d.length!==w)return!1;for(let T=0;T<w;++T)if(!t8(f,l[T],d[T],i))return!1;return!0}return t8(f,l,d,i)}{const s=J7(r,i.fragmentMap);if(s)return!!PU(s)||t8(s.selectionSet,e,t,i)}})}function PU(n){return!!n.directives&&n.directives.some(WAe)}function WAe(n){return"nonreactive"===n.name.value}function $Ae(n,e){let t=e;const i=[];return n.definitions.forEach(r=>{if("OperationDefinition"===r.kind)throw yl(10,r.operation,r.name?` named '${r.name.value}'`:"");"FragmentDefinition"===r.kind&&i.push(r)}),typeof t>"u"&&(vn(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 ZAe(...n){return EU.bind(null,...n)}class FU{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 wu(!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:OU(T,Symbol.for("apollo.transform.individualResult"),M=>({...M,data:M.data??{}}))}let d;function f(T){const M=T.reduce((Y,te,_e)=>(Y.data.push(te.data),Y.complete&&=te.complete,Y.dataState=Y.complete?"complete":"partial",te.missing&&(Y.missing||={},Y.missing[_e]=te.missing),Y),{data:[],dataState:"complete",complete:!0});return jo(d,M)||(d=M),d}if(0===l.length)return KAe;let m=!1;const b=l.map(T=>this.watchSingleFragment(T,r,e)),w=function VAe(n){return 0===n.length?bu:new Ln(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 b=f.subscribe({next:w=>{d.forEach(T=>i[T]=w),m||(m=!0,s--),s||(l||=new Set(n.filter(T=>T.dirty)),l.delete(f),l.size||(e.next(i.slice()),l=void 0))},complete:()=>{r--,r||e.complete()},error:e.error.bind(e)});e.add(b)})})}(b).pipe(_o(f),f1({subscribe:()=>m=!0,unsubscribe:()=>m=!1}),Q7({bufferSize:1,refCount:!0}));return Object.assign(w,{getCurrentResult:()=>m&&d?d:f(b.map(M=>M.getCurrentResult()))})}onAfterBroadcast=e=>e();watchSingleFragment(e,t,i){if(null===e)return YAe;const{optimistic:o=!0,variables:r}=i,s=[t,Ad({id:e,optimistic:o,variables:r})],l=this.fragmentWatches.lookupArray(s);if(!l.observable){let f,m=function(w){const T=w.result;return(!f||!BU(t,{data:f.data},{data:T},i.variables))&&(f={data:T,dataState:w.complete?"complete":"partial",complete:w.complete},w.missing&&(f.missing=w.missing.missing)),f},d=!1;const b=new Ln(w=>{d=!0;const T=this.watch({variables:r,returnPartialData:!0,id:e,query:t,optimistic:o,immediate:!0,callback:M=>{b.dirty=!0,this.onAfterBroadcast(()=>{w.next(m(M)),b.dirty=!1})}});return()=>{d=!1,T(),this.fragmentWatches.removeArray(s)}}).pipe(BP(),$5({connector:()=>new k3(1),resetOnRefCountZero:()=>function UAe(n=0,e,t=p8e){let i=-1;return null!=e&&(PR(e)?t=e:i=e),new Ln(o=>{let r=function HAe(n){return n instanceof Date&&!isNaN(n)}(n)?+n-t.now():n;r<0&&(r=0);let s=0;return t.schedule(function(){o.closed||(o.next(s++),0<=i?this.schedule(void 0,i):o.complete())},r)})}(0)}));l.observable=Object.assign(b,{dirty:!1,getCurrentResult:()=>d&&f?f:m(this.diff({id:e,query:t,returnPartialData:!0,optimistic:o,variables:r}))})}return l.observable}getFragmentDoc=V5($Ae,{max:Cd["cache.fragmentQueryDocuments"]||1e3,cache:Z7,makeCacheKey:ZAe(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 HU=Object.freeze({data:null,dataState:"complete",complete:!0}),YAe=Object.assign(new Ln(n=>{n.next(HU)}),{dirty:!1,getCurrentResult:()=>HU}),UU=Object.freeze({data:[],dataState:"complete",complete:!0}),KAe=Object.assign(new Ln(n=>{n.next(UU)}),{getCurrentResult:()=>UU});function qs(n){return null!==n&&"object"==typeof n}const{hasOwnProperty:XAe}=Object.prototype,qAe=function(n,e,t){return this.merge(n[t],e[t])},zU=n=>isNaN(+n)?{}:[];class Pf{options;reconciler;constructor(e={}){this.options=e,this.reconciler=e.reconciler||qAe}merge(e,t,i={}){const o=i.atPath;if(o?.length){const[r,...s]=o;void 0===e&&(e=zU(r));let l=e[r];void 0===l&&s.length&&(l=zU(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)),qs(t)&&qs(e)?(Object.keys(t).forEach(r=>{if(XAe.call(e,r)){const s=e[r];if(t[r]!==s){const l=this.reconciler(e,t,r);l!==s&&((e=this.shallowCopyForMerge(e))[r]=l)}}else(e=this.shallowCopyForMerge(e))[r]=t[r]}),e):t}isObject=qs;pastCopies=new Set;shallowCopyForMerge(e){return qs(e)&&(this.pastCopies.has(e)||(e=Array.isArray(e)?e.slice(0):{__proto__:Object.getPrototypeOf(e),...e},this.pastCopies.add(e))),e}}function Ff(n){return{__ref:String(n)}}function Wh(...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 Br=Array.isArray,{hasOwnProperty:vs}=Object.prototype;function VU({__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 eTe={dataIdFromObject:VU,resultCaching:!0},jU=/^[_a-z][_0-9a-z]*/i;function $h(n){const e=n.match(jU);return e?e[0]:n}function kw(n,e,t){return!!qs(e)&&(Br(e)?e.every(i=>kw(n,i,t)):n.selections.every(i=>{if(K5(i)&&e8(i,t)){const o=A1(i);return vs.call(e,o)&&(!i.selectionSet||kw(i.selectionSet,e[o],t))}return!0}))}function Hf(n){return qs(n)&&!Do(n)&&!Br(n)}function GU(n,e){const t=Z5(Y5(n));return{fragmentMap:t,lookupFragment(i){let o=t[i];return!o&&e&&(o=e.lookup(i)),o||null}}}const i8={},Ow=()=>i8,WU={};class o8{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),vs.call(this.data,e)){const i=this.data[e];if(i&&vs.call(i,t))return i[t]}return"__typename"===t&&vs.call(this.policies.rootTypenamesById,e)?this.policies.rootTypenamesById[e]:this instanceof Au?this.parent.get(e,t):void 0}lookup(e,t){return t&&this.group.depend(e,"__exists"),vs.call(this.data,e)?this.data[e]:this instanceof Au?this.parent.lookup(e,t):this.policies.rootTypenamesById[e]?{}:void 0}merge(e,t){let i;Do(e)&&(e=e.__ref),Do(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;vn("string"==typeof i,105);const s=new Pf({reconciler:sTe}).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=$h(d);f!==d&&!this.policies.hasKeyArgs(s.__typename,f)&&(l[f]=1),void 0===s[d]&&!(this instanceof Au)&&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:i8,INVALIDATE:WU,isReference:Do,toReference:this.toReference,canRead:this.canRead,readField:(f,m)=>this.policies.readField("string"==typeof f?{fieldName:f,from:m||Ff(e)}:f,{store:this})};if(Object.keys(o).forEach(f=>{const m=$h(f);let b=o[f];if(void 0===b)return;const w="function"==typeof t?t:t[f]||(i?void 0:t[m]);if(w){let T=w===Ow?i8:w(b,{...d,fieldName:m,storeFieldName:f,storage:this.getStorage(e,f)});if(T===WU)this.group.dirty(e,f);else if(T===i8&&(T=void 0),T!==b&&(r[f]=T,s=!0,b=T,false)){const M=Y=>{if(void 0===this.lookup(Y.__ref))return!0};if(Do(T))M(T);else if(Array.isArray(T)){let te,Y=!1;for(const _e of T){if(Do(_e)){if(Y=!0,M(_e))break}else if("object"==typeof _e&&_e){const[xe]=this.policies.identify(_e);xe&&(te=_e)}if(Y&&void 0!==te)break}}}}void 0!==b&&(l=!1)}),s)return this.merge(e,r),l&&(this instanceof Au?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]:Ow}:Ow,!!i)}return!1}evict(e,t){let i=!1;return e.id&&(vs.call(this.data,e.id)&&(i=this.delete(e.id,e.fieldName,e.args)),this instanceof Au&&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=>{vs.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&&vs.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 Au?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=>{vs.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 Au;)o=o.parent;i.forEach(r=>o.delete(r))}return i}refs={};findChildRefIds(e){if(!vs.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=>{Do(r)&&(t[r.__ref]=!0),qs(r)&&Object.keys(r).forEach(s=>{const l=r[s];qs(l)&&o.add(l)})})}return this.refs[e]}makeCacheKey(){return this.group.keyMaker.lookupArray(arguments)}getFieldValue=(e,t)=>Do(e)?this.get(e.__ref,t):e&&e[t];canRead=e=>Do(e)?this.has(e.__ref):"object"==typeof e;toReference=(e,t)=>{if("string"==typeof e)return Ff(e);if(Do(e))return e;const[i]=this.policies.identify(e);if(i){const o=Ff(i);return t&&this.merge(i,e),o}};get supportsResultCaching(){return this.group.caching}}class $U{caching;parent;d=null;keyMaker;constructor(e,t=null){this.caching=e,this.parent=t,this.resetCaching()}resetCaching(){this.d=this.caching?IU():null,this.keyMaker=new wu}depend(e,t){if(this.d){this.d(Bw(e,t));const i=$h(t);i!==t&&this.d(Bw(e,i)),this.parent&&this.parent.depend(e,t)}}dirty(e,t){this.d&&this.d.dirty(Bw(e,t),"__exists"===t?"forget":"setDirty")}}function Bw(n,e){return e+"#"+n}function ZU(n,e){X5(n)&&n.group.depend(e,"__exists")}o8.Root=class oTe extends o8{constructor({policies:e,resultCaching:t=!0,seed:i}){super(e,new $U(t)),i&&this.replace(i)}stump=new rTe(this);addLayer(e,t){return this.stump.addLayer(e,t)}removeLayer(){return this}storageTrie=new wu;getStorage(){return this.storageTrie.lookupArray(arguments)}};class Au extends o8{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 Au(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=>{jo(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 vs.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 rTe extends Au{constructor(e){super("EntityStore.Stump",e,()=>{},new $U(e.group.caching,e.group))}removeLayer(){return this}merge(e,t){return this.parent.merge(e,t)}}function sTe(n,e,t){const i=n[t],o=e[t];return jo(i,o)?i:o}function X5(n){return!(!n||!n.supportsResultCaching)}const Pw=new Y7;function aTe(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 YU=Symbol.for("apollo.result.extensions"),Zh=Symbol.for("apollo.result.streamInfo"),lTe=Symbol.for("apollo.observableQuery.variablesUnknown");function Uf(n,e,t,i){if(t.kind===hn.INT||t.kind===hn.FLOAT)n[e.value]=Number(t.value);else if(t.kind===hn.BOOLEAN||t.kind===hn.STRING)n[e.value]=t.value;else if(t.kind===hn.OBJECT){const o={};t.fields.map(r=>Uf(o,r.name,r.value,i)),n[e.value]=o}else if(t.kind===hn.VARIABLE)n[e.value]=(i||{})[t.name.value];else if(t.kind===hn.LIST)n[e.value]=t.values.map(o=>{const r={};return Uf(r,e,o,i),r[e.value]});else if(t.kind===hn.ENUM)n[e.value]=t.value;else{if(t.kind!==hn.NULL)throw yl(19,e.value,t.kind);n[e.value]=null}}function Fw(n,e){if(n.arguments&&n.arguments.length){const t={};return n.arguments.forEach(({name:i,value:o})=>Uf(t,i,o,e)),t}return null}const cTe=["connection","include","skip","client","rest","export","nonreactive","stream"];let q5=Ad;const KU=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=q5(r);if("{}"!==s)return`${t.connection.key}(${s})`}return t.connection.key}let i=n;if(e){const o=q5(e);"{}"!==o&&(i+=`(${o})`)}return t&&Object.keys(t).forEach(o=>{-1===cTe.indexOf(o)&&(t[o]&&Object.keys(t[o]).length?i+=`@${o}(${q5(t[o])})`:i+=`@${o}`)}),i},{setStringify(n){const e=q5;return q5=n,e}});function Hw(n){return Array.isArray(n)&&n.length>0}const XU={};function Uw(n){const e=JSON.stringify(n);return XU[e]||(XU[e]={})}function qU(n){const e=Uw(n);return e.keyFieldsFn||(e.keyFieldsFn=(t,i)=>{const o=(s,l)=>i.readField(l,s),r=i.keyObject=zw(n,s=>{let l=zf(i.storeObject,s,o);return void 0===l&&t!==i.storeObject&&vs.call(t,s[0])&&(l=zf(t,s,ez)),vn(void 0!==l,108,s.join("."),t),l});return`${i.typename}:${JSON.stringify(r)}`})}function QU(n){const e=Uw(n);return e.keyArgsFn||(e.keyArgsFn=(t,{field:i,variables:o,fieldName:r})=>{const s=zw(n,d=>{const f=d[0],m=f.charAt(0);if("@"!==m){if("$"===m){const b=f.slice(1);if(o&&vs.call(o,b)){const w=d.slice(0);return w[0]=b,zf(o,w)}return}if(t)return zf(t,d)}else if(i&&Hw(i.directives)){const b=f.slice(1),w=i.directives.find(M=>M.name.value===b),T=w&&Fw(w,o);return T&&zf(T,d.slice(1))}}),l=JSON.stringify(s);return(t||"{}"!==l)&&(r+=":"+l),r})}function zw(n,e){const t=new Pf;return JU(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 JU(n){const e=Uw(n);if(!e.paths){const t=e.paths=[],i=[];n.forEach((o,r)=>{Br(o)?(JU(o).forEach(s=>t.push(i.concat(s))),i.length=0):(i.push(o),Br(n[r+1])||(t.push(i.slice(0)),i.length=0))})}return e.paths}function ez(n,e){return n[e]}function zf(n,e,t){return t=t||ez,tz(e.reduce(function i(o,r){return Br(o)?o.map(s=>i(s,r)):o&&t(o,r)},n))}function tz(n){return qs(n)?Br(n)?n.map(tz):zw(Object.keys(n).sort(),e=>zf(n,e)):n}const nz=new Y7,iz=new WeakMap;function Q5(n){let e=iz.get(n);return e||iz.set(n,e={vars:new Set,dep:IU()}),e}function oz(n){Q5(n).vars.forEach(e=>e.forgetCache(n))}function hTe(n){const e=new Set,t=new Set,i=function(r){if(arguments.length>0){if(n!==r){n=r,e.forEach(l=>{Q5(l).dep.dirty(i),function _Te(n){n.broadcastWatches&&n.broadcastWatches()}(l)});const s=Array.from(t);t.clear(),s.forEach(l=>l(n))}}else{const s=nz.getValue();s&&(o(s),Q5(s).dep(i))}return n};i.onNextChange=r=>(t.add(r),()=>{t.delete(r)});const o=i.attachCache=r=>(e.add(r),Q5(r).vars.add(i),i);return i.forgetCache=r=>e.delete(r),i}function Vw(n){return void 0!==n.args?n.args:n.field?Fw(n.field,n.variables):null}const pTe=()=>{},rz=(n,e)=>e.fieldName,sz=(n,e,{mergeObjects:t})=>t(n,e),az=(n,e)=>e,fTe=(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 gTe{config;typePolicies={};toBeAdded={};supertypeMap=new Map;fuzzySubtypes=new Map;cache;rootIdsByTypename={};rootTypenamesById={};usingPossibleTypes=!1;constructor(e){this.config=e,this.config={dataIdFromObject:VU,...e},this.cache=this.config.cache,this.setRootTypename("Query"),this.setRootTypename("Mutation"),this.setRootTypename("Subscription"),e.possibleTypes&&this.addPossibleTypes(e.possibleTypes),e.typePolicies&&this.addTypePolicies(e.typePolicies)}identify(e,t){const i=this,o=t&&(t.typename||t.storeObject?.__typename)||e.__typename;if(o===this.rootTypenamesById.ROOT_QUERY)return["ROOT_QUERY"];const r=t&&t.storeObject||e,s={...t,typename:o,storeObject:r,readField:t&&t.readField||((...m)=>{const b=jw(m,r);return i.readField(b,{store:i.cache.data,variables:b.variables})})};let l;const d=o&&this.getTypePolicy(o);let f=d&&d.keyFn||this.config.dataIdFromObject;return Pw.withValue(!0,()=>{for(;f;){const m=f({...e,...r},s);if(!Br(m)){l=m;break}f=qU(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),vs.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?sz:!1===f?az:d.merge}l(o,t.merge),o.keyFn=!1===r?pTe:Br(r)?qU(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:b,read:w,merge:T}=m;f.keyFn=!1===b?rz:Br(b)?QU(b):"function"==typeof b?b:f.keyFn,"function"==typeof w&&(f.read=w),l(f,T)}f.read&&f.merge&&(f.keyFn=f.keyFn||rz)})}setRootTypename(e,t=e){const i="ROOT_"+e.toUpperCase(),o=this.rootTypenamesById[i];t!==o&&(vn(!o||o===e,109,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(jU);(!o||o[0]!==i)&&this.fuzzySubtypes.set(i,new RegExp(i))})})}getTypePolicy(e){if(!vs.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=b=>{const w=this.getSupertypeSet(b,!1);w&&w.size&&l.indexOf(w)<0&&l.push(w)};let f=!(!i||!this.fuzzySubtypes.size),m=!1;for(let b=0;b<l.length;++b){const w=l[b];if(w.has(r))return s.has(r)||s.add(r),!0;w.forEach(d),f&&b===l.length-1&&kw(e.selectionSet,i,o)&&(f=!1,m=!0,this.fuzzySubtypes.forEach((T,M)=>{const Y=t.match(T);Y&&Y[0]===t&&d(M)}))}}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=Vw(e);for(;s;){const f=s(d,l);if(!Br(f)){r=f||i;break}s=QU(f)}}return void 0===r&&(r=e.field?function uTe(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})=>Uf(t[o.name.value],r,s,e))}));let i=null;return n.arguments&&n.arguments.length&&(i={},n.arguments.forEach(({name:o,value:r})=>Uf(i,o,r,e))),KU(n.name.value,i,t)}(e.field,e.variables):KU(i,Vw(e))),!1===r?i:i===$h(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=$h(r),l=t.store.getFieldValue(i,r),d=this.getFieldPolicy(e.typename,s),f=d&&d.read;if(f){const m=lz(this,i,e,t,t.store.getStorage(Do(i)?i.__ref:i,r));return nz.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===sz)return cz(l.store)(e,t);if(r===az)return t;l.overwrite&&(e=void 0);const m=l.extensions?.[Zh]?.deref()?.peekArray(s);if(m){const{current:w,previous:T}=m;if(T&&jo(T.incoming,t)&&jo(T.streamFieldInfo,w))return T.result}const b=r(e,t,function mTe(n,e,t,i,o,r){const s={...lz(n,e,t,i,o),extensions:i.extensions,existingData:r},l=i.extensions;if(l&&Zh in l){const{[Zh]: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:b}),b}}function lz(n,e,t,i,o){const r=n.getStoreFieldName(t),s=$h(r),l=t.variables||i.variables,{toReference:d,canRead:f}=i.store;return{args:Vw(t),field:t.field||null,fieldName:s,storeFieldName:r,variables:l,isReference:Do,toReference:d,storage:o,cache:n.cache,canRead:f,readField:(...m)=>n.readField(jw(m,e,l),i),mergeObjects:cz(i.store)}}function jw(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},vs.call(s,"from")||(s.from=e)),void 0===s.variables&&(s.variables=t),s}function cz(n){return function(t,i){if(Br(t)||Br(i))throw yl(112);if(qs(t)&&qs(i)){const o=n.getFieldValue(t,"__typename"),r=n.getFieldValue(i,"__typename");if(o&&r&&o!==r)return i;if(Do(t)&&Hf(i))return n.merge(t.__ref,i),t;if(Hf(t)&&Do(i))return n.merge(t,i.__ref),i;if(Hf(t)&&Hf(i))return{...t,...i}}return i}}function Gw(n){const e={},t=n&&n.variableDefinitions;return t&&t.length&&t.forEach(i=>{i.defaultValue&&Uf(e,i.variable.name,i.defaultValue)}),e}function vTe(n){let e=n[0]||{};const t=n.length;if(t>1){const i=new Pf;for(let o=1;o<t;++o)e=i.merge(e,n[o])}return e}class Ww 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__=Ww.prototype}missing}function dz(n){return[n.selectionSet,n.objectOrReference,n.context]}class bTe{executeSelectionSet;executeSubSelectedArray;config;knownResults=new WeakMap;constructor(e){this.config=e,this.executeSelectionSet=V5(t=>{const i=dz(t);return this.executeSelectionSet.peek(...i)||(ZU(t.context.store,t.enclosingRef.__ref),this.execSelectionSetImpl(t))},{max:Cd["inMemoryCache.executeSelectionSet"]||5e4,keyArgs:dz,makeCacheKey(t,i,o){if(X5(o.store))return o.store.makeCacheKey(t,Do(i)?i.__ref:i,o.varString)}}),this.executeSubSelectedArray=V5(t=>(ZU(t.context.store,t.enclosingRef.__ref),this.execSubSelectedArrayImpl(t)),{max:Cd["inMemoryCache.executeSubSelectedArray"]||1e4,makeCacheKey({field:t,array:i,context:o}){if(X5(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=Wh(Gw(function uz(n){const e=yd(n);return vn(e&&"query"===e.operation,13),e}(t)),o);const l=Ff(i),d=this.executeSelectionSet({selectionSet:Rw(t).selectionSet,objectOrReference:l,enclosingRef:l,context:{store:e,query:t,policies:s,variables:o,varString:Ad(o),...GU(t,this.config.fragments)}});let f;d.missing&&(f=new Ww(function CTe(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:b}=d;return{result:m?b:r?0===Object.keys(b).length?null:b:null,complete:m,missing:f}}isFresh(e,t,i,o){if(X5(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(Do(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 b=new Pf;function w(_e,xe){return _e.missing&&(m=b.merge(m,{[xe]:_e.missing})),_e.result}"string"==typeof d&&!s.rootIdsByTypename[d]&&f.push({__typename:d});const T=new Set(e.selections);T.forEach(_e=>{if(e8(_e,r))if(K5(_e)){let xe=s.readField({fieldName:_e.name.value,field:_e,variables:o.variables,from:t},o);const pt=A1(_e);void 0===xe?Iw.added(_e)||(m=b.merge(m,{[pt]:`Can't find field '${_e.name.value}' on ${Do(t)?t.__ref+" object":"object "+JSON.stringify(t,null,2)}`})):Br(xe)?xe.length>0&&(xe=w(this.executeSubSelectedArray({field:_e,array:xe,enclosingRef:i,context:o}),pt)):_e.selectionSet&&null!=xe&&(xe=w(this.executeSelectionSet({selectionSet:_e.selectionSet,objectOrReference:xe,enclosingRef:Do(xe)?xe:i,context:o}),pt)),void 0!==xe&&f.push({[pt]:xe})}else{const xe=J7(_e,o.lookupFragment);if(!xe&&_e.kind===hn.FRAGMENT_SPREAD)throw yl(113,_e.name.value);xe&&s.fragmentMatches(xe,d)&&xe.selectionSet.selections.forEach(T.add,T)}});const te={result:vTe(f),missing:m};return te.result&&this.knownResults.set(te.result,e),te}execSubSelectedArrayImpl({field:e,array:t,enclosingRef:i,context:o}){let r,s=new Pf;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:Br(d)?l(this.executeSubSelectedArray({field:e,array:d,enclosingRef:i,context:o}),f):e.selectionSet?l(this.executeSelectionSet({selectionSet:e.selectionSet,objectOrReference:d,enclosingRef:Do(d)?d:i,context:o}),f):d),missing:r}}}function Zw(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 TTe{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=yd(t),f=function iTe(){return new Pf}();r={...Gw(d),...r};const m={store:e,written:{},merge:(w,T)=>f.merge(w,T),variables:r,varString:Ad(r),...GU(t,this.fragments),overwrite:!!s,incomingById:new Map,clientOnly:!1,deferred:!1,flavors:new Map,extensions:l},b=this.processSelectionSet({result:i||{},dataId:o,selectionSet:d.selectionSet,mergeTree:{map:new Map},context:m,path:[]});if(!Do(b))throw yl(115,i);return m.incomingById.forEach(({storeObject:w,mergeTree:T},Y)=>{const te=Ff(Y);if(T&&T.map.size){const _e=this.applyMerges(T,te,w,m);if(Do(_e))return;w=_e}e.merge(Y,w)}),e.retain(b.__ref),b}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]||Kw(t,i,o.fragmentMap)||e&&o.store.get(e,"__typename");"string"==typeof f&&(d.__typename=f);const m=(...w)=>{const T=jw(w,d,o.variables);if(Do(T.from)){const M=o.incomingById.get(T.from.__ref);if(M){const Y=l.readField({...T,from:M.storeObject},o);if(void 0!==Y)return Y}}return l.readField(T,o)},b=new Set;this.flattenFields(i,t,o,f).forEach((w,T)=>{const M=A1(T),Y=t[M],te=[...s,T.name.value];if(b.add(T),void 0!==Y){const _e=l.getStoreFieldName({typename:f,fieldName:T.name.value,field:T,variables:w.variables}),xe=_z(r,_e);let St,pt=this.processFieldValue(Y,T,T.selectionSet?Zw(w,!1,!1):w,xe,te);T.selectionSet&&(Do(pt)||Hf(pt))&&(St=m("__typename",pt));const Vt=l.getMergeFunction(f,T.name.value,St);Vt?xe.info={field:T,typename:f,merge:Vt,path:te}:w.extensions?.[Zh]&&Array.isArray(pt)&&function ITe(n){return!!n.directives&&n.directives.some(e=>"stream"===e.name.value)}(T)?xe.info={field:T,typename:f,merge:fTe,path:te}:pz(r,_e),d=w.merge(d,{[_e]:pt})}});try{const[w,T]=l.identify(t,{typename:f,selectionSet:i,fragmentMap:o.fragmentMap,storeObject:d,readField:m});e=e||w,T&&(d=o.merge(d,T))}catch(w){if(!e)throw w}if("string"==typeof e){const w=Ff(e),T=o.written[e]||(o.written[e]=[]);if(T.indexOf(i)>=0||(T.push(i),this.reader&&this.reader.isFresh(t,w,i,o)))return w;const M=o.incomingById.get(e);return M?(M.storeObject=o.merge(M.storeObject,d),M.mergeTree=Yw(M.mergeTree,r),b.forEach(Y=>M.fieldNodeSet.add(Y))):o.incomingById.set(e,{storeObject:d,mergeTree:r8(r)?void 0:r,fieldNodeSet:b}),w}return d}processFieldValue(e,t,i,o,r){return t.selectionSet&&null!==e?Br(e)?e.map((s,l)=>{const d=this.processFieldValue(s,t,i,_z(o,l),[...r,l]);return pz(o,l),d}):this.processSelectionSet({result:e,selectionSet:t.selectionSet,context:i,mergeTree:o,path:r}):e}flattenFields(e,t,i,o=Kw(t,e,i.fragmentMap)){const r=new Map,{policies:s}=this.cache,l=new wu(!1);return function d(f,m){const b=l.lookup(f,m.clientOnly,m.deferred);b.visited||(b.visited=!0,f.selections.forEach(w=>{if(!e8(w,i.variables))return;let{clientOnly:T,deferred:M}=m;if(!(T&&M)&&Hw(w.directives)&&w.directives.forEach(Y=>{const te=Y.name.value;if("client"===te&&(T=!0),"defer"===te){const _e=Fw(Y,i.variables);(!_e||!1!==_e.if)&&(M=!0)}}),K5(w)){const Y=r.get(w);Y&&(T=T&&Y.clientOnly,M=M&&Y.deferred),r.set(w,Zw(i,T,M))}else{const Y=J7(w,i.lookupFragment);if(!Y&&w.kind===hn.FRAGMENT_SPREAD)throw yl(117,w.name.value);Y&&s.fragmentMatches(Y,o,t,i.variables)&&d(Y.selectionSet,Zw(i,T,M))}}))}(e,i),r}applyMerges(e,t,i,o,r){if(e.map.size&&!Do(i)){const s=Br(i)||!Do(t)&&!Hf(t)?void 0:t,l=i;let d;s&&!r&&(r=[Do(s)?s.__ref:s]);const f=(m,b)=>Br(m)?"number"==typeof b?m[b]:void 0:o.store.getFieldValue(m,String(b));e.map.forEach((m,b)=>{const w=f(s,b),T=f(l,b);if(void 0===T)return;r&&r.push(b);const M=this.applyMerges(m,w,T,o,r);M!==T&&(d=d||new Map,d.set(b,M)),r&&vn(r.pop()===b)}),d&&(i=Br(l)?l.slice(0):{...l},d.forEach((m,b)=>{i[b]=m}))}return e.info?this.cache.policies.runMergeFunction(t,i,e.info,o,r&&o.store.getStorage(...r)):i}}const hz=[];function _z({map:n},e){return n.has(e)||n.set(e,hz.pop()||{map:new Map}),n.get(e)}function Yw(n,e){if(n===e||!e||r8(e))return n;if(!n||r8(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,Yw(l,e.map.get(d))),s.delete(d)}),s.forEach(l=>{r.map.set(l,Yw(e.map.get(l),n.map.get(l)))})}return r}function r8(n){return!n||!(n.info||n.map.size)}function pz({map:n},e){const t=n.get(e);t&&r8(t)&&(hz.push(t),n.delete(e))}function Kw(n,e,t){let i;for(const o of e.selections)if(K5(o)){if("__typename"===o.name.value)return n[A1(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=Kw(n,J7(o,t).selectionSet,t);if("string"==typeof r)return r}}class gz extends FU{data;optimisticData;config;watches=new Set;storeReader;storeWriter;addTypenameTransform=new wd(Iw);maybeBroadcastWatch;assumeImmutableResults=!0;policies;makeVar=hTe;constructor(e={}){super(),this.config=function tTe(n){return Wh(eTe,n)}(e),this.policies=new gTe({cache:this,dataIdFromObject:this.config.dataIdFromObject,possibleTypes:this.config.possibleTypes,typePolicies:this.config.typePolicies}),this.init()}init(){const e=this.data=new o8.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 TTe(this,this.storeReader=new bTe({cache:this,fragments:e}),e),this.maybeBroadcastWatch=V5((t,i)=>this.broadcastWatch(t,i),{max:Cd["inMemoryCache.maybeBroadcastWatch"]||5e3,makeCacheKey:t=>{const i=t.optimistic?this.optimisticData:this.data;if(X5(i)){const{optimistic:o,id:r,variables:s}=t;return i.makeCacheKey(t.query,t.callback,Ad({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(vs.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 dTe(n){Q5(n).vars.forEach(e=>e.attachCache(n))}(this),this.watches.add(e),e.immediate&&this.maybeBroadcastWatch(e),()=>{this.watches.delete(e)&&!this.watches.size&&oz(this),this.maybeBroadcastWatch.forget(e)}}gc(e){Ad.reset(),W5.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(Do(e))return e.__ref;try{return this.policies.identify(e)[0]}catch(t){}}evict(e){if(!e.id){if(vs.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(),Ad.reset(),e&&e.discardWatches?(this.watches.forEach(t=>this.maybeBroadcastWatch.forget(t)),this.watches.clear(),oz(this)):this.broadcastWatches(),Promise.resolve()}removeOptimistic(e){const t=this.optimisticData.removeLayer(e);t!==this.optimisticData&&(this.optimisticData=t,this.broadcastWatches())}txCount=0;batch(e){const{update:t,optimistic:i=!0,removeOptimistic:o,onWatchUpdated:r}=e;let s;const l=f=>{const{data:m,optimisticData:b}=this;++this.txCount,f&&(this.data=this.optimisticData=f);try{return s=t(this)}finally{--this.txCount,this.data=m,this.optimisticData=b}},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 b=r.call(this,f,m);return!1!==b&&d.delete(f),b}}),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||!jo(i.result,o.result))&&e.callback(e.lastDiff=o,i)}}class mz extends ks{constructor(e){super((t,i)=>{const{...o}=t;return Object.defineProperty(o,"client",{enumerable:!1,value:t.client}),new Ln(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 J5(n,e,t){const i=new Set(n),o=i.size;return yu(e,{Directive(r){if(i.delete(r.name.value)&&(!t||!i.size))return zh}}),t?!i.size:i.size<o}class ETe{isIncrementalResult(e){return!1}prepareRequest(e){return vn(!J5(["defer","stream"],e.query),67),e}extractErrors(){}startRequest=void 0}const Xw=ks.execute;function s8(n,e){return Wh(n,e,e.variables&&{variables:Wh({...n&&n.variables,...e.variables})})}function xTe(n){return yu(n,{FragmentSpread(e){if(!e.directives?.some(({name:t})=>"unmask"===t.value))return null}})}function Yh(n,e){const t=Ce(n)?n:()=>n,i=o=>o.error(t());return new Ln(e?o=>e.schedule(i,0,o):i)}function Tu(n){return Hs((e,t)=>{let r,i=null,o=!1;i=e.subscribe(oa(t,void 0,void 0,s=>{r=nl(n(s,Tu(n)(e))),i?(i.unsubscribe(),i=null,r.subscribe(t)):o=!0})),o&&(i.unsubscribe(),i=null,r.subscribe(t))})}class Td{constructor(e,t,i){this.kind=e,this.value=t,this.error=i,this.hasValue="N"===e}observe(e){return function NTe(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 Ce(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?Cl(t):"E"===e?Yh(()=>i):"C"===e?bu:0;if(!o)throw new TypeError(`Unexpected notification kind ${e}`);return o}static createNext(e){return new Td("N",e)}static createError(e){return new Td("E",void 0,e)}static createComplete(){return Td.completeNotification}}function vz(n=1/0){return Rh(ci,n)}function em(...n){return function MTe(){return vz(1)}()(Vc(n,Yv(n)))}function qw(n,e){return"object"==typeof n&&null!==n&&n[Symbol.for("apollo.error")]===e}function Qw(n){Object.defineProperty(n,Symbol.for("apollo.error"),{value:n.name,enumerable:!1,writable:!1,configurable:!1})}function bz(n){return n.filter(e=>e).map(e=>e.message||"Error message not found.").join("\n")}Td.completeNotification=new Td("C");let tm=(()=>{class n extends Error{static is(t){return qw(t,"CombinedGraphQLErrors")}static formatMessage=bz;errors;data;extensions;constructor(t,i=t.errors||[]){super(n.formatMessage(i,{result:t,defaultFormatMessage:bz})),this.errors=i,this.data=t.data,this.extensions=t.extensions,this.name="CombinedGraphQLErrors",Qw(this),Object.setPrototypeOf(this,n.prototype)}}return n})();function Cz(n){return n.map(e=>e.message||"Error message not found.").join("\n")}let RTe=(()=>{class n extends Error{static is(t){return qw(t,"CombinedProtocolErrors")}static formatMessage=Cz;errors;constructor(t){super(n.formatMessage(t,{defaultFormatMessage:Cz})),this.name="CombinedProtocolErrors",this.errors=t,Qw(this),Object.setPrototypeOf(this,n.prototype)}}return n})();class Jw extends Error{static is(e){return qw(e,"UnconventionalError")}constructor(e){super("An error of unexpected shape occurred.",{cause:e}),this.name="UnconventionalError",Qw(this),Object.setPrototypeOf(this,Jw.prototype)}}const eA=Symbol(),yz=new WeakSet;function wz(n,e,t){return Pw.withValue(!0,()=>{const i=nm(n,e,t,!1);return Object.isFrozen(n),i})}function nm(n,e,t,i,o){const{knownChanged:r}=t,s=function FTe(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=nm(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===hn.FIELD){const f=A1(l),m=l.selectionSet;if(d=s[f]||n[f],void 0===d)continue;if(m&&null!==d){const b=nm(n[f],m,t,i,void 0);r.has(b)&&(d=b)}s[f]=d}if(l.kind===hn.INLINE_FRAGMENT&&(!l.typeCondition||t.cache.fragmentMatches(l,n.__typename))&&(d=nm(n,l.selectionSet,t,i,o)),l.kind===hn.FRAGMENT_SPREAD){const f=l.name.value,m=t.fragmentMap[f]||(t.fragmentMap[f]=t.cache.lookupFragment(f));vn(m,39,f);const b=aTe(l);"mask"!==b&&(d=nm(n,m.selectionSet,t,"migrate"===b,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 Az(n){return 7===n||8===n}function a8(n){return!Az(n)}function Vf(n){return!!n.errors?.length}function tA(n,e=()=>{}){return t=>new Ln(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 im(n){const e={data:n.data};return n.error&&(e.error=n.error),e}function VTe(n){let e=!1;return yu(n,{Directive:{enter(t){if("client"===t.name.value&&t.arguments&&(e=t.arguments.some(i=>"always"===i.name.value&&"BooleanValue"===i.value.kind&&!0===i.value.value),e))return zh}}}),e}function jTe(n,e){Vh(e);const t=Tz(""),i=Tz(""),o=te=>{for(let xe,_e=0;_e<te.length&&(xe=te[_e]);++_e)if(!Br(xe)){if(xe.kind===hn.OPERATION_DEFINITION)return t(xe.name&&xe.name.value);if(xe.kind===hn.FRAGMENT_DEFINITION)return i(xe.name.value)}return vn.error(14),null};let r=0;for(let te=e.definitions.length-1;te>=0;--te)e.definitions[te].kind===hn.OPERATION_DEFINITION&&++r;const s=function GTe(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=te=>Hw(te)&&te.map(s).some(_e=>_e&&_e.remove),d=new Map;let f=!1;const m={enter(te){if(l(te.directives))return f=!0,null}},b=yu(e,{Field:m,InlineFragment:m,VariableDefinition:{enter:()=>!1},Variable:{enter(te,_e,xe,pt,St){const Vt=o(St);Vt&&Vt.variables.add(te.name.value)}},FragmentSpread:{enter(te,_e,xe,pt,St){if(l(te.directives))return f=!0,null;const Vt=o(St);Vt&&Vt.fragmentSpreads.add(te.name.value)}},FragmentDefinition:{enter(te,_e,xe,pt){d.set(JSON.stringify(pt),te)},leave:(te,_e,xe,pt)=>te===d.get(JSON.stringify(pt))?te:r>0&&te.selectionSet.selections.every(Vt=>Vt.kind===hn.FIELD&&"__typename"===Vt.name.value)?(i(te.name.value).removed=!0,f=!0,null):void 0},Directive:{leave(te){if(s(te))return f=!0,null}}});if(!f)return e;const w=te=>(te.transitiveVars||(te.transitiveVars=new Set(te.variables),te.removed||te.fragmentSpreads.forEach(_e=>{w(i(_e)).transitiveVars.forEach(xe=>{te.transitiveVars.add(xe)})})),te),T=new Set;b.definitions.forEach(te=>{te.kind===hn.OPERATION_DEFINITION?w(t(te.name&&te.name.value)).fragmentSpreads.forEach(_e=>{T.add(_e)}):te.kind===hn.FRAGMENT_DEFINITION&&0===r&&!i(te.name.value).removed&&T.add(te.name.value)}),T.forEach(te=>{w(i(te)).fragmentSpreads.forEach(_e=>{T.add(_e)})});const Y={enter(te){if((te=>!(T.has(te)&&!i(te).removed))(te.name.value))return null}};return function WTe(n){return Iz(yd(n)||function kU(n){vn("Document"===n.kind,6),vn(n.definitions.length<=1,7);const e=n.definitions[0];return vn("FragmentDefinition"===e.kind,8),e}(n),Z5(Y5(n)))?null:n}(yu(b,{FragmentSpread:Y,FragmentDefinition:Y,OperationDefinition:{leave(te){if(te.variableDefinitions){const _e=w(t(te.name&&te.name.value)).transitiveVars;if(_e.size<te.variableDefinitions.length)return{...te,variableDefinitions:te.variableDefinitions.filter(xe=>_e.has(xe.variable.name.value))}}}}}))}function Tz(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 Iz(n,e){return!n||n.selectionSet.selections.every(t=>t.kind===hn.FRAGMENT_SPREAD&&Iz(e[t.name.value],e))}var Ii=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}(Ii||{});function Sz(n){return n.catch(()=>{}),n}const{assign:Ez}=Object,jf={loading:!0,networkStatus:Ii.loading,data:void 0,dataState:"empty",partial:!0},nA={loading:!1,networkStatus:Ii.ready,data:void 0,dataState:"empty",partial:!0};class iA{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[lTe]&&(vn("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=yd(this.query);this.queryName=l&&l.name&&l.name.value}initializeObservablesQueue(){this.subject=new Bs({query:this.query,variables:this.variables,result:jf,meta:{}});const e=this.subject.pipe(f1({subscribe:()=>{this.subject.observed||(this.reobserve(),setTimeout(()=>this.updatePolling()))},unsubscribe:()=>{this.subject.observed||this.tearDownQuery()}}),tA(({query:t,variables:i,result:o,meta:r},s)=>{const{shouldEmit:l}=r;if(o===jf&&(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 b=this.queryManager.getDocumentInfo(t),w=this.queryManager.dataMasking;if((w||b.hasNonreactiveDirective?BU(w?b.nonReactiveQuery:t,d,o,i):jo(d,o))&&jo(f,i))return}if(3!==l||this.options.notifyOnNetworkStatusChange&&!jo(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 Li,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?Ii.ready:Ii.loading,partial:!o.complete})};switch(t){case"cache-only":return{...i(),loading:!1,networkStatus:Ii.ready};case"cache-first":return i();case"cache-and-network":return{...i(),loading:!0,networkStatus:Ii.loading};case"standby":return nA;default:return jf}}resubscribeCache(){const{variables:e,fetchPolicy:t}=this.options,i=this.query,o="standby"===t||"no-cache"===t||this.waitForNetworkResult,r=!l8({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===jf||m===nA)||jo(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===Ii.error||this.hasObservers()||"no-cache"===this.options.fetchPolicy?e:this.getInitialResult();return t===jf&&(t=this.getInitialResult()),jo(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&&!jo(this.variables,e)&&(i.variables=this.options.variables=this.getVariablesWithDefaults({...this.variables,...e})),this._lastWrite=void 0,this._reobserve(i,{newNetworkStatus:Ii.refetch})}fetchMore({query:e,variables:t,context:i,errorPolicy:o,updateQuery:r}){vn("cache-only"!==this.options.fetchPolicy,84,Wa(this.query,"(anonymous)"));const s={...Wh(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||vn(r,85);const{finalize:f,pushNotification:m}=this.pushOperation(Ii.fetchMore);m({source:"newNetworkStatus",kind:"N",value:{}},{shouldEmit:3});const{promise:b,operator:w}=xz(),{observable:T}=this.queryManager.fetchObservableWithInfo(s,{networkStatus:Ii.fetchMore,exposeExtensions:!0}),M=T.pipe(w,v7(Y=>"N"===Y.kind&&"network"===Y.source)).subscribe({next:Y=>{l=!1;const te=Y.value,_e=te[YU];if(Az(Y.value.networkStatus)&&f(),d){const xe=this.getCacheDiff();this.cache.batch({update:pt=>{r?pt.updateQuery({query:this.query,variables:this.variables,returnPartialData:!0,optimistic:!1,extensions:_e},St=>r(St,{fetchMoreResult:te.data,variables:s.variables})):pt.writeQuery({query:s.query,variables:s.variables,data:te.data,extensions:_e})},onWatchUpdated:(pt,St)=>{if(pt.watcher===this&&!jo(St.result,xe.result)){l=!0;const Vt=this.getCurrentResult();a8(te.networkStatus)&&m({kind:"N",source:"network",value:{...Vt,networkStatus:te.networkStatus===Ii.error?Ii.ready:te.networkStatus,loading:!1,data:St.result,dataState:"streaming"===te.dataState?"streaming":"complete"}})}}})}else{const xe=this.getCurrentResult(),pt=r(xe.data,{fetchMoreResult:te.data,variables:s.variables});m({kind:"N",value:{...xe,networkStatus:Ii.ready,loading:!1,data:pt,dataState:"streaming"===xe.dataState?"streaming":"complete"},source:"network"})}}});return Sz(b.then(Y=>im(this.maskResult(Y))).finally(()=>{if(M.unsubscribe(),f(),d&&!l){const Y=this.getCurrentResult();"streaming"===Y.dataState?m({kind:"N",source:"network",value:{...Y,dataState:"complete",networkStatus:Ii.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):vn.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=Wh(this.options,e||{});Ez(this.options,t),this.updatePolling()}setVariables(e){var t=this;return(0,N.A)(function*(){return e=t.getVariablesWithDefaults(e),jo(t.variables,e)||(t.options.variables=e,!t.hasObservers())?im(t.getCurrentResult()):t._reobserve({fetchPolicy:t.options.initialFetchPolicy,variables:e},{newNetworkStatus:Ii.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:te=>new Ln(_e=>{try{return te.subscribe({next(xe){s=!0,_e.next(xe)},error:xe=>_e.error(xe),complete:()=>_e.complete()})}finally{s||(T.override=t,this.input.next({kind:"N",source:"newNetworkStatus",value:{resetError:!0},query:b,variables:w,meta:{shouldEmit:3,fetchPolicy:r}}))}}),observableQuery:this});const{query:b,variables:w}=this,T={abort:()=>{Y.unsubscribe()},query:b,variables:w};this.activeOperations.add(T);let M=t==Ii.refetch||t==Ii.setVariables;f=f.pipe(o,$5());const Y=f.pipe(f1({next:te=>{"newNetworkStatus"===te.source||"N"===te.kind&&te.value.loading?T.override=t:delete T.override},finalize:()=>this.activeOperations.delete(T)})).subscribe({next:te=>{const _e={};M&&"N"===te.kind&&"loading"in te.value&&!te.value.loading&&(M=!1,_e.shouldEmit=1),this.input.next({...te,query:b,variables:w,meta:_e})}});return{fromLink:m,subscription:Y,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&&(a8(this.networkStatus)||this.options.skipPollAttempt?.()?l():this._reobserve({fetchPolicy:"no-cache"===this.options.initialFetchPolicy?"no-cache":"network-only"},{newNetworkStatus:Ii.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===Ii.refetch||i===Ii.poll,r=this.variables,s=this.options.fetchPolicy,l=Wh(this.options,e||{});this.variablesUnknown&&="standby"===l.fetchPolicy;const d=o?l:Ez(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&&!jo(e.variables,r)&&"standby"!==d.fetchPolicy&&(d.fetchPolicy===s||"function"==typeof d.nextFetchPolicy)&&(this.applyNextFetchPolicy("variables-changed",d),void 0===i&&(i=Ii.setVariables))),i||(i=Ii.loading,this.networkStatus!==Ii.loading&&e?.variables&&!jo(e.variables,r)&&(i=Ii.setVariables),"standby"===d.fetchPolicy&&(i=Ii.ready)),"standby"===d.fetchPolicy&&this.cancelPolling(),this.resubscribeCache();const{promise:b,operator:w}=xz("standby"===d.fetchPolicy?{data:void 0}:void 0),{subscription:T,observable:M,fromLink:Y}=this.fetch(d,i,f,w);!o&&(Y||!this.linkSubscription)&&(this.linkSubscription&&this.linkSubscription.unsubscribe(),this.linkSubscription=T);const te=Object.assign(Sz(b.then(_e=>im(this.maskResult(_e))).finally(()=>{!this.hasObservers()&&0===this.activeOperations.size&&this.tearDownQuery()})),{retain:()=>{const _e=M.subscribe({}),xe=()=>_e.unsubscribe();return b.then(xe,xe),te}});return te}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();jo(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:Ii.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===Ii.streaming?e:Array.from(this.activeOperations.values()).reverse().find(i=>l8(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?nA:jf,{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=tA(e=>{const{query:t,meta:i}=e;if("setResult"===e.source)return{query:t,variables:this.variables,result:e.value,meta:i};if("C"===e.kind)return;const o="resolvedVariables"in e?e.resolvedVariables:void 0;if(e.query!==this.query)return;if(!jo(o,this.variables)){if(!jo(e.variables,this.variables))return;o&&(this.options.variables=o,this.resubscribeCache())}const r=this.variables;let s;const l=this.subject.getValue();if("cache"===e.source){if(s=e.value,s.networkStatus===Ii.ready&&s.partial&&(!this.options.returnPartialData||l.result.networkStatus===Ii.error)&&"cache-only"!==this.options.fetchPolicy)return}else if("network"===e.source)this.waitForNetworkResult&&(this.waitForNetworkResult=!1,this.resubscribeCache()),s="E"===e.kind?{...l8(l,e)||o&&jo(o,l.variables)?l.result:{data:void 0,dataState:"empty",partial:!0},error:e.error,networkStatus:Ii.error,loading:!1}:e.value,"E"===e.kind&&"streaming"===s.dataState&&(s.dataState="complete"),s.error&&(i.shouldEmit=1);else if("newNetworkStatus"===e.source){const d=l8(l,e)?l.result:this.getInitialResult(i.fetchPolicy),{resetError:f}=e.value,m=f?void 0:d.error,b=m?Ii.error:Ii.ready;s={...d,error:m,networkStatus:b}}return vn(s),s.error||delete s.error,s.networkStatus=this.calculateNetworkStatus(s.networkStatus),s.loading=a8(s.networkStatus),s=this.maskResult(s),void 0!==l.result.data&&s.data!==l.result.data&&jo(s.data,l.result.data)&&(s.data=l.result.data),{query:t,variables:r,result:s,meta:i}});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 l8(n,e){return!!(n&&e&&n.query===e.query&&jo(n.variables,e.variables))}function xz(n){let t,i,e=n;return{promise:new Promise((s,l)=>{t=s,i=l}),operator:f1({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 Dz={},Gf=new WeakMap;function oA(n,e){const t=n[e];"function"==typeof t&&(n[e]=function(){return Gf.set(n,(Gf.get(n)+1)%1e15),t.apply(this,arguments)})}const Nz=new WeakMap;class rA{cache;queryManager;id;observableQuery;incremental;constructor(e,t){const i=this.cache=e.cache,o=(Nz.get(e)||0)+1;Nz.set(e,o),this.id=o+"",this.observableQuery=t,this.queryManager=e,Gf.has(i)||(Gf.set(i,0),oA(i,"evict"),oA(i,"modify"),oA(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===Gf.get(this.cache)&&jo(t,i.variables)&&jo(e.data,i.result.data)&&e.extensions?.[Zh]===i.result.extensions?.[Zh])}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);if(l)return f;if(sA(f,o)){let m=!1;this.cache.batch({onWatchUpdated:(b,w)=>{b.watcher===this.observableQuery&&(b.lastOwnDiff=w)},update:b=>{if(this.shouldWrite(f,i))b.writeQuery({query:t,data:f.data,variables:i,overwrite:1===r,extensions:f.extensions}),m=!0,this.lastWrite={result:f,variables:i,dmCount:Gf.get(this.cache)};else if(d&&d.complete)return void(f={...f,data:d.result});const w=b.diff(s);w.complete&&(f={...f,data:w.result})}})}else this.lastWrite=void 0;return 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:[]}),Vf(s)&&"none"===t.errorPolicy)return Promise.resolve(s);const l=()=>({...s,dataState:this.hasNext?"streaming":"complete"});if(!r&&sA(s,t.errorPolicy)){o.push({result:s.data,dataId:"ROOT_MUTATION",query:t.document,variables:t.variables,extensions:s.extensions});const{updateQueries:f}=t;f&&this.queryManager.getObservableQueries("all").forEach(m=>{const b=m&&m.queryName;if(!b||!Object.hasOwnProperty.call(f,b))return;const w=f[b],{query:T,variables:M}=m,{result:Y,complete:te}=m.getCacheDiff({optimistic:!1});if(te&&Y){const _e=w(Y,{mutationResult:l(),queryName:T&&Wa(T)||void 0,queryVariables:M});_e&&o.push({result:_e,dataId:"ROOT_QUERY",query:T,variables:M})}})}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(w=>m.write(w));const{update:b}=t;if(b){if(!r){const w=m.diff({id:"ROOT_MUTATION",query:this.queryManager.getDocumentInfo(t.document).asQuery,variables:t.variables,optimistic:!1,returnPartialData:!0});w.complete&&(s={...s,data:w.result})}this.hasNext||b(m,s,{context:t.context,variables:t.variables})}!r&&!t.keepRootFields&&!this.hasNext&&m.modify({id:"ROOT_MUTATION",fields:(w,{fieldName:T,DELETE:M})=>"__typename"===T?w:M})},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:Dz}):e;return i!==Dz&&(this.cache.recordOptimisticTransaction(o=>{try{this.markMutationResult({data:i},t,o)}catch(r){vn.error(r)}},this.id),!0)}markSubscriptionResult(e,{document:t,variables:i,errorPolicy:o,cacheWriteBehavior:r}){0!==r&&(sA(e,o)&&this.cache.write({query:t,result:e.data,dataId:"ROOT_SUBSCRIPTION",variables:i,extensions:e.extensions}),this.queryManager.broadcastQueries())}}function sA(n,e="none"){const t="ignore"===e||"all"===e;let i=!Vf(n);return!i&&t&&n.data&&(i=!0),i}class XTe{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 wd(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(yl(90))}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:b,errorPolicy:w,keepRootFields:T,context:M}){const Y=new rA(t);i=t.cache.transformForLink(t.transform(i));const{hasClientExports:te}=t.getDocumentInfo(i);o=t.getVariables(i,o),te&&(o=yield t.localState.getExportedVariables({client:t.client,document:i,variables:o,context:M}));const _e=t.mutationStore&&(t.mutationStore[Y.id]={mutation:i,variables:o,loading:!0,error:null}),xe=r&&Y.markMutationOptimistic(r,{document:i,variables:o,cacheWriteBehavior:"no-cache"===b?0:2,errorPolicy:w,context:M,updateQueries:s,update:f,keepRootFields:T});return t.broadcastQueries(),new Promise((pt,St)=>{const Vt={};return t.getObservableFromLink(i,{...M,optimisticResponse:xe?r:void 0},o,b,{},!1).observable.pipe(Lz(),Rh(Un=>{const In={...Un};return Vc(Y.markMutationResult(In,{document:i,variables:o,cacheWriteBehavior:"no-cache"===b?0:2,errorPolicy:w,context:M,update:f,updateQueries:s,awaitRefetchQueries:d,refetchQueries:l,removeOptimistic:xe?Y.id:void 0,onQueryUpdated:m,keepRootFields:T}))})).pipe(_o(Un=>{if(Vf(Un)&&"none"===w)throw new tm(aA(Un));return _e&&(_e.loading=!1,_e.error=null),Un})).subscribe({next:Un=>{if(t.broadcastQueries(),!Y.hasNext){const In={data:t.maskOperation({document:i,data:Un.data,fetchPolicy:b,cause:Vt})};Vf(Un)&&(In.error=new tm(Un)),Object.keys(Un.extensions||{}).length&&(In.extensions=Un.extensions),pt(In)}},error:Un=>(_e&&(_e.loading=!1,_e.error=Un),xe&&t.cache.removeOptimistic(Y.id),t.broadcastQueries(),"ignore"===w?pt({data:void 0}):"all"===w?pt({data:void 0,error:Un}):void St(Un))})})}).apply(this,arguments)}fetchQuery(e,t){var i=this;return Vh(e.query,Cu.QUERY),(0,N.A)(function*(){return S5(i.fetchObservableWithInfo(e,{networkStatus:t}).observable.pipe(tA(o=>{switch(o.kind){case"E":throw o.error;case"N":if("newNetworkStatus"!==o.source)return im(o.value)}})),{defaultValue:{data:void 0}})})()}transform(e){return this.documentTransform.transformDocument(e)}transformCache=new mw(Cd["queryManager.getDocumentInfo"]||2e3);getDocumentInfo(e){const{transformCache:t}=this;if(!t.has(e)){const o=yd(e),r={hasClientExports:J5(["client","export"],e,!0),hasForcedResolvers:VTe(e),hasNonreactiveDirective:J5(["nonreactive"],e),hasIncrementalDirective:J5(["defer"],e),nonReactiveQuery:QTe(e),clientQuery:J5(["client"],e)?e:null,serverQuery:jTe([{name:"client",remove:!0},{name:"connection"},{name:"nonreactive"},{name:"unmask"}],e),operationType:o?.operation,defaultVars:Gw(o),asQuery:{...e,definitions:e.definitions.map(s=>"OperationDefinition"===s.kind&&"query"!==s.operation?{...s,operation:"query"}:s)}};t.set(e,r)}const i=t.get(e);if(i.violation)throw i.violation;return i}getVariables(e,t){const i=this.getDocumentInfo(e).defaultVars,o=Object.entries(t??{}).map(([r,s])=>[r,void 0===s?i[r]:s]);return{...i,...Object.fromEntries(o)}}watchQuery(e){Vh(e.query,Cu.QUERY);const t=this.transform(e.query);return typeof(e={...e,variables:this.getVariables(t,e.variables)}).notifyOnNetworkStatusChange>"u"&&(e.notifyOnNetworkStatusChange=!0),new iA({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(yl(92)),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 $Te(n){return qs(n)&&"Document"===n.kind&&Array.isArray(n.definitions)}(s)){const l=W5(this.transform(s));i.set(l,Wa(s)),o.set(l,!1)}else qs(s)&&s.query&&r.add(s)}),this.obsQueries.forEach(s=>{const l=W5(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 iA({queryManager:this,options:{...s8(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;Vh(t,Cu.SUBSCRIPTION),t=this.transform(t),i=this.getVariables(t,i);const f=(this.getDocumentInfo(t).hasClientExports?Vc(this.localState.getExportedVariables({client:this.client,document:t,variables:i,context:s})):Cl(i)).pipe(Rh(m=>{const{observable:b,restart:w}=this.getObservableFromLink(t,s,m,o,l),T=new rA(this);return d=w,b.pipe(_o(M=>{T.markSubscriptionResult(M,{document:t,variables:m,errorPolicy:r,cacheWriteBehavior:"no-cache"===o?0:2});const Y={data:M.data??void 0};return Vf(M)?Y.error=new tm(M):function OTe(n){return"extensions"in n&&RTe.is(n.extensions[eA])}(M)&&(Y.error=M.extensions[eA],delete M.extensions[eA]),M.extensions&&Object.keys(M.extensions).length&&(Y.extensions=M.extensions),Y.error&&"none"===r&&(Y.data=void 0),"ignore"===r&&delete Y.error,Y}),Tu(M=>Cl("ignore"===r?{data:void 0}:{data:void 0,error:M})),v7(M=>!(!M.data&&!M.error)))}));return Object.assign(f,{restart:()=>d?.()})}broadcastQueries(){this.onBroadcast&&this.onBroadcast(),this.obsQueries.forEach(e=>e.notify())}inFlightLinkObservables=new wu(!1);getObservableFromLink(e,t,i,o,r,s=t?.queryDeduplication??this.queryDeduplication){let l={};const{serverQuery:d,clientQuery:f,operationType:m,hasIncrementalDirective:b}=this.getDocumentInfo(e),w=Wa(e),T={client:this.client};if(d){const{inFlightLinkObservables:M,link:Y}=this;try{let _e=function(xe){return new Ln(pt=>{function St(){return xe.subscribe({next:pt.next.bind(pt),complete:pt.complete.bind(pt),error:pt.error.bind(pt)})}let Vt=St();return l.restart||=()=>{Vt.unsubscribe(),Vt=St()},()=>{Vt.unsubscribe(),l.restart=void 0}})};const te=this.incrementalHandler.prepareRequest({query:d,variables:i,context:{...this.defaultContext,...t,queryDeduplication:s},extensions:r});if(t=te.context,s){const xe=W5(d),pt=Ad(i);l=M.lookup(xe,pt),l.observable||(l.observable=Xw(Y,te,T).pipe(_e,wy(()=>{M.peek(xe,pt)===l&&M.remove(xe,pt)}),m===Cu.SUBSCRIPTION?$5():Q7({refCount:!0})))}else l.observable=Xw(Y,te,T).pipe(_e)}catch(te){l.observable=Yh(()=>te)}}else l.observable=Cl({data:{}});if(f){const{operation:M}=yd(e);vn(!b,97,M[0].toUpperCase()+M.slice(1),w??"(anonymous)"),l.observable=l.observable.pipe(Rh(Y=>Vc(this.localState.execute({client:this.client,document:f,remoteResult:Y,context:t,variables:i,fetchPolicy:o}))))}return{restart:()=>l.restart?.(),observable:l.observable.pipe(Tu(M=>{throw M=function BTe(n){return function kTe(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 Jw(n)}(M),function PTe(n){yz.add(n)}(M),M}))}}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(_o(d=>{const f=t.markQueryResult(d,{...e,document:l,cacheWriteBehavior:i}),m=Vf(f);if(m&&"none"===s)throw t.resetLastWrite(),o?.resetNotifications(),new tm(aA(f));const b={data:f.data,...t.hasNext?{loading:!0,networkStatus:Ii.streaming,dataState:"streaming",partial:!0}:{dataState:f.data?"complete":"empty",loading:!1,networkStatus:Ii.ready,partial:!f.data}};return r&&"extensions"in f&&(b[YU]=f.extensions),m&&("none"===s&&(b.data=void 0,b.dataState="empty"),"ignore"!==s&&(b.error=new tm(aA(f)),"streaming"!==b.dataState&&(b.networkStatus=Ii.error))),b}),Tu(d=>{if("none"===s)throw t.resetLastWrite(),o?.resetNotifications(),d;const f={data:void 0,dataState:"empty",loading:!1,networkStatus:Ii.ready,partial:!0};return"ignore"!==s&&(f.error=d,f.networkStatus=Ii.error),Cl(f)}))}fetchObservableWithInfo(e,{networkStatus:t=Ii.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:b=!1,notifyOnNetworkStatusChange:w=!0,context:T={}}=e;this.prioritizeCacheValues&&("network-only"===f||"cache-and-network"===f)&&(f="cache-first");const M=Object.assign({},e,{query:i,variables:d,fetchPolicy:f,errorPolicy:m,returnPartialData:b,notifyOnNetworkStatusChange:w,context:T}),Y=new rA(this,s),te=Vt=>{M.variables=Vt;const In=this.fetchQueryByPolicy(M,{queryInfo:Y,cacheWriteBehavior:"no-cache"===f?0:t===Ii.refetch&&"merge"!==M.refetchWritePolicy?1:2,onCacheHit:r,observableQuery:s,exposeExtensions:l});return In.observable=In.observable.pipe(o),"standby"!==M.fetchPolicy&&s?.applyNextFetchPolicy("after-fetch",e),In},_e=()=>{this.fetchCancelFns.delete(Y.id)};this.fetchCancelFns.set(Y.id,Vt=>{xe.next({kind:"E",error:Vt,source:"network"})});const xe=new Li;let pt,St;if(this.getDocumentInfo(M.query).hasClientExports)pt=Vc(this.localState.getExportedVariables({client:this.client,document:M.query,variables:M.variables,context:M.context})).pipe(Rh(Vt=>te(Vt).observable)),St=!0;else{const Vt=te(M.variables);St=Vt.fromLink,pt=Vt.observable}return{observable:new Ln(Vt=>{Vt.add(_e),pt.subscribe(Vt),xe.subscribe(Vt)}).pipe($5()),fromLink:St}}refetchQueries({updateCache:e,include:t,optimistic:i=!1,removeOptimistic:o=(i?qH("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,b){const w=f.watcher;if(w instanceof iA&&!d.has(w)){if(d.add(w),r){s.delete(w);let T=r(w,m,b);return!0===T&&(T=w.refetch().retain()),!1!==T&&l.set(w,T),T}null!==r&&"cache-only"!==w.options.fetchPolicy&&s.set(w,{oq:w,lastDiff:b,diff:m})}}})}return s.size&&s.forEach(({oq:d,lastDiff:f,diff:m})=>{let b;r&&(m||(m=d.getCacheDiff()),b=r(d,m,f)),(!r||!0===b)&&(b=d.refetch().retain()),!1!==b&&l.set(d,b)}),o&&this.cache.removeOptimistic(o),l}noCacheWarningsByCause=new WeakSet;maskOperation(e){const{document:t,data:i}=e;return this.dataMasking?function UTe(n,e,t){const i=yd(e);return vn(i,43),null==n?n:wz(n,i.selectionSet,{operationType:i.operation,operationName:i.name?.value,fragmentMap:Z5(Y5(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 zTe(n,e,t,i){const o=e.definitions.filter(s=>s.kind===hn.FRAGMENT_DEFINITION);typeof i>"u"&&(vn(1===o.length,41,o.length),i=o[0].name.value);const r=o.find(s=>s.name.value===i);return vn(!!r,42,i),null==n||jo(n,{})?n:wz(n,r.selectionSet,{operationType:"fragment",operationName:r.name.value,fragmentMap:Z5(Y5(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:b}){const w=()=>this.cache.diff({query:e,variables:t,returnPartialData:!0,optimistic:!0}),T=(Y,te)=>{const _e=Y.result,xe=St=>(!Y.complete&&!r&&(St=void 0),{data:St,dataState:Y.complete?"complete":St?"partial":"empty",loading:a8(te),networkStatus:te,partial:!Y.complete});return(Y.complete||r)&&this.getDocumentInfo(e).hasForcedResolvers?(d(),Vc(this.localState.execute({client:this.client,document:e,remoteResult:_e?{data:_e}:void 0,context:s,variables:t,onlyRunForcedResolvers:!0,returnPartialData:!0,fetchPolicy:i}).then(St=>({kind:"N",value:xe(St.data||void 0),resolvedVariables:t,source:"cache"})))):Cl({kind:"N",value:xe("none"===o&&te===Ii.refetch&&Y.missing?void 0:_e||void 0),resolvedVariables:t,source:"cache"})},M=()=>this.getResultsFromLink({query:e,variables:t,context:s,fetchPolicy:i,errorPolicy:o},{cacheWriteBehavior:l,queryInfo:f,observableQuery:m,exposeExtensions:b}).pipe(Lz(),function LTe(){return Hs((n,e)=>{n.subscribe(oa(e,t=>{e.next(Td.createNext(t))},()=>{e.next(Td.createComplete()),e.complete()},t=>{e.next(Td.createError(t)),e.complete()}))})}(),_o(Y=>({...Y,resolvedVariables:t,source:"network"})));switch(i){default:case"cache-first":{const Y=w();return Y.complete?{fromLink:!1,observable:T(Y,Ii.ready)}:r?{fromLink:!0,observable:em(T(Y,Ii.loading),M())}:{fromLink:!0,observable:M()}}case"cache-and-network":{const Y=w();return Y.complete||r?{fromLink:!0,observable:em(T(Y,Ii.loading),M())}:{fromLink:!0,observable:M()}}case"cache-only":return{fromLink:!1,observable:em(T(w(),Ii.ready))};case"network-only":case"no-cache":return{fromLink:!0,observable:M()};case"standby":return{fromLink:!1,observable:bu}}}}function Lz(){let n=!1;return f1({next(){n=!0},complete(){vn(n,101)}})}function QTe(n){return yu(n,{FragmentSpread:e=>{if(!e.directives?.some(t=>"unmask"===t.name.value))return{...e,directives:[...e.directives||[],{kind:hn.DIRECTIVE,name:{kind:hn.NAME,value:"nonreactive"}}]}}})}function aA(n){if(null==n.extensions?.[Zh])return n;const{extensions:{[Zh]:e,...t},...i}=n;return Object.keys(t).length>0&&(i.extensions=t),i}class lA{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:b,dataMasking:w,link:T,incrementalHandler:M=new ETe,experiments:Y=[],refetchEventManager:te}=e;this.link=T,this.cache=t,this.queryDeduplication=s,this.defaultOptions=l||{},this.devtoolsConfig={...b,enabled:b?.enabled??false},this.watchQuery=this.watchQuery.bind(this),this.query=this.query.bind(this),this.mutate=this.mutate.bind(this),this.watchFragment=this.watchFragment.bind(this),this.resetStore=this.resetStore.bind(this),this.reFetchObservableQueries=this.refetchObservableQueries=this.refetchObservableQueries.bind(this),this.version=uw,this.queryManager=new XTe({client:this,defaultOptions:this.defaultOptions,defaultContext:d,documentTransform:i,queryDeduplication:s,ssrMode:o,dataMasking:!!w,clientOptions:e,incrementalHandler:M,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(),Y.forEach(_e=>_e.call(this,e)),this.refetchEventManager=te,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=s8(this.defaultOptions.watchQuery,e),o&&(e.refetchOn=o)}return this.queryManager.watchQuery(e)}query=e=>(this.defaultOptions.query&&(e=s8(this.defaultOptions.query,e)),this.queryManager.query(e));mutate=e=>{const t=s8(Wh({fetchPolicy:"network-only",errorPolicy:"none"},this.defaultOptions.mutate),e);return Vh(t.mutation,Cu.MUTATION),this.queryManager.mutate(t)};subscribe(e){const t={},i=this.queryManager.startGraphQLSubscription(e),o=i.pipe(_o(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 Xw(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 wd(xTe);transform(e,t=!1){const i=this.queryManager.transform(e);return t?this.maskedFragmentTransform.transformDocument(i):i}}function eIe(n,e){if(!n)throw new Error(e??"Unexpected invariant triggered.")}const tIe=/\r\n|[\n\r]/g;function cA(n,e){let t=0,i=1;for(const o of n.body.matchAll(tIe)){if("number"==typeof o.index||eIe(!1),o.index>=e)break;t=o.index+o[0].length,i+=1}return{line:i,column:e+1-t}}function nIe(n){return Rz(n.source,cA(n.source,n.start))}function Rz(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),b=m[o];if(b.length>120){const w=Math.floor(d/80),T=d%80,M=[];for(let Y=0;Y<b.length;Y+=80)M.push(b.slice(Y,Y+80));return f+kz([[`${s} |`,M[0]],...M.slice(1,w+1).map(Y=>["|",Y]),["|","^".padStart(T)],["|",M[w+1]]])}return f+kz([[s-1+" |",m[o-1]],[`${s} |`,b],["|","^".padStart(d)],[`${s+1} |`,m[o+1]]])}function kz(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 uA extends Error{constructor(e,...t){var i,o,r;const{nodes:s,source:l,positions:d,path:f,originalError:m,extensions:b}=function iIe(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=Oz(Array.isArray(s)?s:s?[s]:void 0);const w=Oz(null===(i=this.nodes)||void 0===i?void 0:i.map(M=>M.loc).filter(M=>null!=M));this.source=l??(null==w||null===(o=w[0])||void 0===o?void 0:o.source),this.positions=d??w?.map(M=>M.start),this.locations=d&&l?d.map(M=>cA(l,M)):w?.map(M=>cA(M.source,M.start));const T=function JTe(n){return"object"==typeof n&&null!==n}(m?.extensions)?m?.extensions:void 0;this.extensions=null!==(r=b??T)&&void 0!==r?r:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),null!=m&&m.stack?Object.defineProperty(this,"stack",{value:m.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,uA):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"+nIe(t.loc));else if(this.source&&this.locations)for(const t of this.locations)e+="\n\n"+Rz(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 Oz(n){return void 0===n||0===n.length?void 0:n}function cs(n,e,t){return new uA(`Syntax Error: ${t}`,{source:n,positions:[e]})}var Bz=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}(Bz||{}),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 oIe{constructor(e){const t=new ZH(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=sIe(this,e.end);e.next=t,t.prev=e,e=t}}while(e.kind===kt.COMMENT);return e}}function Wf(n){return n>=0&&n<=55295||n>=57344&&n<=1114111}function c8(n,e){return Pz(n.charCodeAt(e))&&Fz(n.charCodeAt(e+1))}function Pz(n){return n>=55296&&n<=56319}function Fz(n){return n>=56320&&n<=57343}function T1(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 es(n,e,t,i,o){return new ZH(e,t,i,n.line,1+t-n.lineStart,o)}function sIe(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 aIe(n,o);case 33:return es(n,kt.BANG,o,o+1);case 36:return es(n,kt.DOLLAR,o,o+1);case 38:return es(n,kt.AMP,o,o+1);case 40:return es(n,kt.PAREN_L,o,o+1);case 41:return es(n,kt.PAREN_R,o,o+1);case 46:if(46===t.charCodeAt(o+1)&&46===t.charCodeAt(o+2))return es(n,kt.SPREAD,o,o+3);break;case 58:return es(n,kt.COLON,o,o+1);case 61:return es(n,kt.EQUALS,o,o+1);case 64:return es(n,kt.AT,o,o+1);case 91:return es(n,kt.BRACKET_L,o,o+1);case 93:return es(n,kt.BRACKET_R,o,o+1);case 123:return es(n,kt.BRACE_L,o,o+1);case 124:return es(n,kt.PIPE,o,o+1);case 125:return es(n,kt.BRACE_R,o,o+1);case 34:return 34===t.charCodeAt(o+1)&&34===t.charCodeAt(o+2)?_Ie(n,o):cIe(n,o)}if(j5(r)||45===r)return lIe(n,o,r);if(RU(r))return pIe(n,o);throw cs(n.source,o,39===r?"Unexpected single quote character ('), did you mean to use a double quote (\")?":Wf(r)||c8(t,o)?`Unexpected character: ${T1(n,o)}.`:`Invalid character: ${T1(n,o)}.`)}return es(n,kt.EOF,i,i)}function aIe(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(Wf(r))++o;else{if(!c8(t,o))break;o+=2}}return es(n,kt.COMMENT,e,o,t.slice(e+1,o))}function lIe(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),j5(r))throw cs(n.source,o,`Invalid number, unexpected digit after 0: ${T1(n,o)}.`)}else o=dA(n,o,r),r=i.charCodeAt(o);if(46===r&&(s=!0,r=i.charCodeAt(++o),o=dA(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=dA(n,o,r),r=i.charCodeAt(o)),46===r||RU(r))throw cs(n.source,o,`Invalid number, expected digit but got: ${T1(n,o)}.`);return es(n,s?kt.FLOAT:kt.INT,e,o,i.slice(e,o))}function dA(n,e,t){if(!j5(t))throw cs(n.source,e,`Invalid number, expected digit but got: ${T1(n,e)}.`);const i=n.source.body;let o=e+1;for(;j5(i.charCodeAt(o));)++o;return o}function cIe(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),es(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)?uIe(n,o):dIe(n,o):hIe(n,o);s+=d.value,o+=d.size,r=o;continue}if(10===l||13===l)break;if(Wf(l))++o;else{if(!c8(t,o))throw cs(n.source,o,`Invalid character within String: ${T1(n,o)}.`);o+=2}}throw cs(n.source,o,"Unterminated string.")}function uIe(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||!Wf(i))break;return{value:String.fromCodePoint(i),size:o}}if(i=i<<4|om(r),i<0)break}throw cs(n.source,e,`Invalid Unicode escape sequence: "${t.slice(e,e+o)}".`)}function dIe(n,e){const t=n.source.body,i=Hz(t,e+2);if(Wf(i))return{value:String.fromCodePoint(i),size:6};if(Pz(i)&&92===t.charCodeAt(e+6)&&117===t.charCodeAt(e+7)){const o=Hz(t,e+8);if(Fz(o))return{value:String.fromCodePoint(i,o),size:12}}throw cs(n.source,e,`Invalid Unicode escape sequence: "${t.slice(e,e+6)}".`)}function Hz(n,e){return om(n.charCodeAt(e))<<12|om(n.charCodeAt(e+1))<<8|om(n.charCodeAt(e+2))<<4|om(n.charCodeAt(e+3))}function om(n){return n>=48&&n<=57?n-48:n>=65&&n<=70?n-55:n>=97&&n<=102?n-87:-1}function hIe(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 _Ie(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=es(n,kt.BLOCK_STRING,e,r+3,EAe(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(Wf(f))++r;else{if(!c8(t,r))throw cs(n.source,r,`Invalid character within String: ${T1(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 pIe(n,e){const t=n.source.body,i=t.length;let o=e+1;for(;o<i&&SAe(t.charCodeAt(o));)++o;return es(n,kt.NAME,e,o,t.slice(e,o))}const fIe=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=aw(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 Uz{constructor(e,t="GraphQL request",i={line:1,column:1}){"string"==typeof e||j7(!1,`Body must be a string. Received: ${aw(e)}.`),this.body=e,this.name=t,this.locationOffset=i,this.locationOffset.line>0||j7(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||j7(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}class rm{constructor(e,t={}){const{lexer:i,...o}=t;if(i)this._lexer=i;else{const r=function gIe(n){return fIe(n,Uz)}(e)?e:new Uz(e);this._lexer=new oIe(r)}this._options=o,this._tokenCounter=0}get tokenCount(){return this._tokenCounter}parseName(){const e=this.expectToken(kt.NAME);return this.node(e,{kind:hn.NAME,value:e.value})}parseDocument(){return this.node(this._lexer.token,{kind:hn.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:hn.OPERATION_DEFINITION,operation:Cu.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:hn.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 Cu.QUERY;case"mutation":return Cu.MUTATION;case"subscription":return Cu.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:hn.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:hn.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:hn.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:hn.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:hn.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:hn.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(e,{kind:hn.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:hn.FRAGMENT_DEFINITION,description:t,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}:{kind:hn.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:hn.INT,value:t.value});case kt.FLOAT:return this.advanceLexer(),this.node(t,{kind:hn.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:hn.BOOLEAN,value:!0});case"false":return this.node(t,{kind:hn.BOOLEAN,value:!1});case"null":return this.node(t,{kind:hn.NULL});default:return this.node(t,{kind:hn.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:hn.STRING,value:e.value,block:e.kind===kt.BLOCK_STRING})}parseList(e){return this.node(this._lexer.token,{kind:hn.LIST,values:this.any(kt.BRACKET_L,()=>this.parseValueLiteral(e),kt.BRACKET_R)})}parseObject(e){return this.node(this._lexer.token,{kind:hn.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:hn.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:hn.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:hn.LIST_TYPE,type:i})}else t=this.parseNamedType();return this.expectOptionalToken(kt.BANG)?this.node(e,{kind:hn.NON_NULL_TYPE,type:t}):t}parseNamedType(){return this.node(this._lexer.token,{kind:hn.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:hn.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:hn.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:hn.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:hn.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:hn.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:hn.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:hn.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:hn.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:hn.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:hn.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,`${u8(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:hn.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:hn.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:hn.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:hn.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:hn.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:hn.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:hn.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:hn.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:hn.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:hn.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(Bz,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:hn.DIRECTIVE_ARGUMENT_COORDINATE,name:i,argumentName:r}:{kind:hn.DIRECTIVE_COORDINATE,name:i}:o?r?{kind:hn.ARGUMENT_COORDINATE,name:i,fieldName:o,argumentName:r}:{kind:hn.MEMBER_COORDINATE,name:i,memberName:o}:{kind:hn.TYPE_COORDINATE,name:i})}node(e,t){return!0!==this._options.noLocation&&(t.loc=new Uwe(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 ${zz(e)}, found ${u8(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 ${u8(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 ${u8(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 u8(n){const e=n.value;return zz(n.kind)+(null!=e?` "${e}"`:"")}function zz(n){return function rIe(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 d8=new Map,hA=new Map,Vz=!0,sm=!1;function jz(n){return n.replace(/[\s,]+/g," ").trim()}function TIe(n){var e=jz(n);if(!d8.has(e)){var t=function CIe(n,e){const t=new rm(n,e),i=t.parseDocument();return Object.defineProperty(i,"tokenCount",{enumerable:!1,value:t.tokenCount}),i}(n,{experimentalFragmentVariables:sm,allowLegacyFragmentVariables:sm,experimentalFragmentArguments:sm});if(!t||"Document"!==t.kind)throw new Error("Not a valid GraphQL document.");d8.set(e,function AIe(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 wIe(n){var e=new Set,t=[];return n.definitions.forEach(function(i){if("FragmentDefinition"===i.kind){var o=i.name.value,r=function yIe(n){return jz(n.source.body.substring(n.start,n.end))}(i.loc),s=hA.get(o);s&&!s.has(r)?Vz&&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||hA.set(o,s=new Set),s.add(r),e.has(r)||(e.add(r),t.push(i))}else t.push(i)}),T0(T0({},n),{definitions:t})}(t)))}return d8.get(e)}function $f(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]}),TIe(i)}var am_gql=$f,am_resetCaches=function IIe(){d8.clear(),hA.clear()},am_disableFragmentWarnings=function SIe(){Vz=!1},am_enableExperimentalFragmentVariables=function EIe(){sm=!0},am_disableExperimentalFragmentVariables=function xIe(){sm=!1};(function(n){n.gql=am_gql,n.resetCaches=am_resetCaches,n.disableFragmentWarnings=am_disableFragmentWarnings,n.enableExperimentalFragmentVariables=am_enableExperimentalFragmentVariables,n.disableExperimentalFragmentVariables=am_disableExperimentalFragmentVariables})($f||($f={})),$f.default=$f;const LIe=new class NIe extends kP{}(class DIe extends RP{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 Wz(n){return new Ln(e=>(n().then(t=>{e.closed||(e.next(t),e.complete())},t=>{e.closed||e.error(t)}),()=>e.unsubscribe()))}class kIe{zone;constructor(e){this.zone=e}now=Date.now;schedule(e,t=0,i){return this.zone.run(()=>LIe.schedule(e,t,i))}}function _A(n,e){return n.pipe(p9(new kIe(e)))}class OIe{obsQuery;valueChanges;constructor(e,t){this.obsQuery=e,this.valueChanges=_A(Vc(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 pA=new Ht("APOLLO_FLAGS"),$z=new Ht("APOLLO_OPTIONS"),Zz=new Ht("APOLLO_NAMED_OPTIONS");class Yz{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 OIe(this.ensureClient().watchQuery({...e}),this.ngZone)}query(e){return Wz(()=>this.ensureClient().query({...e}))}mutate(e){return function RIe(n,e){return e?n.pipe(_o(t=>({...t,loading:!1})),function MIe(...n){const e=Yv(n);return Hs((t,i)=>{(e?em(n,t,e):em(n,t)).subscribe(i)})}({data:void 0,loading:!0})):n.pipe(_o(t=>({...t,loading:!1})))}(Wz(()=>this.ensureClient().mutate({...e})),e.useMutationLoading??this.useMutationLoading)}watchFragment(e){const{useZone:t,...i}=e,o=this.ensureClient().watchFragment({...i});return!0!==t?o:_A(o,this.ngZone)}subscribe(e){const{useZone:t,...i}=e,o=this.ensureClient().subscribe({...i});return!0!==t?o:_A(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 fA=(()=>{class n extends Yz{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){gA(i)?this.createNamed(i,t):this.createDefault(t)}default(){return this}use(t){return gA(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 lA(t))}createNamed(t,i){if(this.map.has(t))throw new Error(`Client ${t} has been already created`);this.map.set(t,new Yz(this.ngZone,this.flags,this.ngZone.runOutsideAngular(()=>new lA(i))))}removeClient(t){gA(t)?this.map.delete(t):this._client=void 0}static \u0275fac=function(i){return new(i||n)(Dn(Fo),Dn($z,8),Dn(Zz,8),Dn(pA,8))};static \u0275prov=Bt({token:n,factory:n.\u0275fac})}return n})();function gA(n){return!!n&&"default"!==n}const mA=$f,h8=(n,e)=>n&&e?[...n.keys()].reduce((t,i)=>t.set(i,n.get(i)),e):e||n;const vA={batchInterval:10,batchMax:10,uri:"graphql",method:"POST",withCredentials:!1,includeQuery:!0,includeExtensions:!1,useMultipart:!1};function Id(n,e,t){return function _8(...n){return n.find(e=>typeof e<"u")}(n[t],e[t],vA[t])}class FIe extends ks{httpClient;options;requester;print=X7;constructor(e,t){super(),this.httpClient=e,this.options=t,this.options.operationPrinter&&(this.print=this.options.operationPrinter),this.requester=i=>new Ln(o=>{const r=i.getContext();let s=Id(r,this.options,"method");const l=Id(r,this.options,"includeQuery"),d=Id(r,this.options,"includeExtensions"),f=Id(r,this.options,"uri"),m=Id(r,this.options,"withCredentials"),b=Id(r,this.options,"useMultipart"),w=!0===this.options.useGETForQueries,T=h8(r.httpContext,h8(this.options.httpContext,new Ay)),M=i.query.definitions.some(xe=>"OperationDefinition"===xe.kind&&"query"===xe.operation);w&&M&&(s="GET");const Y={method:s,url:"function"==typeof f?f(i):f,body:{operationName:i.operationName,variables:i.variables},options:{withCredentials:m,useMultipart:b,headers:this.options.headers,context:T}};d&&(Y.body.extensions=i.extensions),l&&(Y.body.query=this.print(i.query));const te=function qz(n){let e=n.headers&&n.headers instanceof Xs?n.headers:new Xs(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);Y.options.headers=((n,e)=>n&&e?e.keys().reduce((i,o)=>i.set(o,e.getAll(o)),n):e||n)(Y.options.headers,te);const _e=((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 Ln(f=>f.error(new Error("File upload is not available when combined with Batching")));if(!i)return new Ln(f=>f.error(new Error("File upload is not available when GET is used")));if(!t)return new Ln(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 Ln(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((b,w)=>{const T=n.body[w];return b[w]=-1!==["variables","extensions"].indexOf(w.toLowerCase())?JSON.stringify(T):T,b},{})};if(s&&i){const f=new FormData;f.append("operations",JSON.stringify(d.body));const m={},b=l.files;let w=0;b.forEach(T=>{m[++w]=T}),f.append("map",JSON.stringify(m)),w=0,b.forEach((T,M)=>{f.append(++w+"",M,M.name)}),d.body=f}return e.request(n.method,n.url,{observe:"response",responseType:"json",reportProgress:!1,...d,...n.options})})(Y,this.httpClient,this.options.extractFiles).subscribe({next:xe=>{i.setContext({response:xe}),o.next(xe.body)},error:xe=>o.error(xe),complete:()=>o.complete()});return()=>{_e.closed||_e.unsubscribe()}})}request(e){return this.requester(e)}}let HIe=(()=>{class n{httpClient;constructor(t){this.httpClient=t}create(t){return new FIe(this.httpClient,t)}static \u0275fac=function(i){return new(i||n)(Dn(hu))};static \u0275prov=Bt({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();function Qz(n,e){this.v=n,this.k=e}function bA(n){return new Qz(n,0)}function CA(n){return function(){return new lm(n.apply(this,arguments))}}function lm(n){var e,t;function i(r,s){try{var l=n[r](s),d=l.value,f=d instanceof Qz;Promise.resolve(f?d.v:d).then(function(m){if(f){var b="return"===r&&d.k?r:"next";if(!d.k||m.done)return i(b,m);m=n[b](m).value}o(!!l.done,m)},function(m){i("throw",m)})}catch(m){o(2,m)}}function o(r,s){2===r?e.reject(s):e.resolve({value:s,done:r}),(e=e.next)?i(e.key,e.arg):t=null}this._invoke=function(r,s){return new Promise(function(l,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 yA(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 p8(e.call(n));t="@@asyncIterator",i="@@iterator"}throw new TypeError("Object is not async iterable")}function p8(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(p8=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 p8(n)}function VIe(n){if("next"!==n&&"complete"!==n)throw new Error(`Invalid stream event "${n}"`);return n}function jIe(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}lm.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},lm.prototype.next=function(n){return this._invoke("next",n)},lm.prototype.throw=function(n){return this._invoke("throw",n)},lm.prototype.return=function(n){return this._invoke("return",n)};var Zf=function(n){return n[n.NewLine=10]="NewLine",n[n.CarriageReturn=13]="CarriageReturn",n[n.Space=32]="Space",n[n.Colon=58]="Colon",n}(Zf||{});class Ql extends Error{constructor(e){let t,i;!function ZIe(n){return function WIe(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 Jz(n){return wA.apply(this,arguments)}function wA(){return wA=(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={},b={};let w;try{w=yield d(t,{signal:e,method:r?"POST":"GET",credentials:i,referrer:s,referrerPolicy:l,headers:{...o,accept:"text/event-stream"},body:r})}catch(Y){throw new Ql(Y)}if(!w.ok)throw new Ql(w);if(!w.body)throw new Error("Missing response body");let M,T=null;return(0,N.A)(function*(){var Y;try{const Vt=function GIe(){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 b=new Uint8Array(n.length+d.length);b.set(n),b.set(d,n.length),n=b}const f=n.length;let m=0;for(;e<f;){i&&(n[e]===Zf.NewLine&&(m=++e),i=!1);let b=-1;for(;e<f&&-1===b;++e)switch(n[e]){case Zf.Colon:-1===t&&(t=e-m);break;case Zf.CarriageReturn:i=!0;case Zf.NewLine:b=e}if(-1===b)break;if(m===b){if(o.event||o.data){if(!o.event)throw new Error("Missing message event");const w=VIe(o.event),T=jIe(w,o.data);r.push({event:w,data:T}),o={event:"",data:""}}}else if(t>0){const w=n.subarray(m,b),T=s.decode(w.subarray(0,t)),Y=s.decode(w.subarray(t+(w[t+1]===Zf.Space?2:1)));switch(T){case"event":o.event=Y;break;case"data":o.data=o.data?o.data+"\n"+Y:Y}}m=e,t=-1}if(m===f){n=void 0;const b=[...r];return r=[],b}0!==m&&(n=n.subarray(m),e-=m)}}();var xe,te=!1,_e=!1;try{for(var St,pt=yA(function YIe(n){return"function"==typeof Object(n)[Symbol.asyncIterator]?n:CA(function*(){const e=n.getReader();let t;do{t=yield bA(e.read()),void 0!==t.value&&(yield t.value)}while(!t.done)})()}(w.body));te=!(St=yield pt.next()).done;te=!1){const Un=St.value;{if("string"==typeof Un)throw T=new Error(`Unexpected string chunk "${Un}"`);let In;try{In=Vt(Un)}catch(Gn){throw T=Gn}if(!In)continue;for(const Gn of In){try{f?.(Gn)}catch(Qn){throw T=Qn}const Si=Gn.data&&"id"in Gn.data?Gn.data.id:"";switch(Si in b||(b[Si]=[]),Gn.event){case"next":b[Si].push(Si?Gn.data.payload:Gn.data);break;case"complete":b[Si].push("complete");break;default:throw T=new Error(`Unexpected message event "${Gn.event}"`)}null===(Y=m[Si])||void 0===Y||Y.proceed()}}}}catch(Un){_e=!0,xe=Un}finally{try{te&&null!=pt.return&&(yield pt.return())}finally{if(_e)throw xe}}if(Object.keys(m).length)throw new Error("Connection closed while having active streams")}catch(Vt){T=!T&&Object.keys(m).length?new Ql(Vt):Vt,M?.(T)}finally{Object.values(m).forEach(({proceed:Vt})=>Vt())}})(),{url:t,headers:o,waitForThrow:()=>new Promise((Y,te)=>{if(T)return te(T);M=te}),getResults:Y=>CA(function*(){var te;const{signal:_e,operationId:xe=""}=Y??{};try{for(;;){for(;null!==(te=b[xe])&&void 0!==te&&te.length;){const pt=b[xe].shift();if("complete"===pt)return;yield pt}if(T)throw T;if(_e?.aborted)throw new Error("Getting results aborted by the client");yield bA(new Promise(pt=>{const St=()=>{_e?.removeEventListener("abort",St),delete m[xe],pt()};_e?.addEventListener("abort",St),m[xe]={proceed:St}}))}}finally{delete b[xe]}})()}}),wA.apply(this,arguments)}class KIe extends ks{constructor(e){super(),this.client=function $Ie(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,Si=>{const Qn=16*Math.random()|0;return("x"==Si?Qn:3&Qn|8).toString(16)})},retryAttempts:s=5,retry:l=function(){var Gn=(0,N.A)(function*(Qn){let Ui=1e3;for(let ts=0;ts<Qn;ts++)Ui*=2;yield new Promise(ts=>setTimeout(ts,Ui+Math.floor(2700*Math.random()+300)))});return function Si(Qn){return Gn.apply(this,arguments)}}(),credentials:d="same-origin",referrer:f,referrerPolicy:m,onMessage:b,on:w}=n,T=n.fetchFn||fetch,M=n.abortControllerImpl||AbortController,Y=(()=>{let Gn=!1;const Si=[];return{get disposed(){return Gn},onDispose:Qn=>Gn?(setTimeout(()=>Qn(),0),()=>{}):(Si.push(Qn),()=>{Si.splice(Si.indexOf(Qn),1)}),dispose(){if(!Gn){Gn=!0;for(const Qn of[...Si])Qn()}}}})();let te,_e,xe=0,pt=null,St=0;function Vt(){return Un.apply(this,arguments)}function Un(){return(Un=(0,N.A)(function*(){try{if(Y.disposed)throw new Error("Client has been disposed");return yield _e??(_e=(0,N.A)(function*(){var Gn,Si,Qn;if(pt){if(yield l(St),te.signal.aborted)throw new Error("Connection aborted by the client");St++}null===(Gn=w?.connecting)||void 0===Gn||Gn.call(w,!!pt),te=new M;const Ui=Y.onDispose(()=>te.abort());te.signal.addEventListener("abort",()=>{Ui(),_e=void 0});const ts=n,yr="function"==typeof ts.url?yield ts.url(void 0):ts.url;if(te.signal.aborted)throw new Error("Connection aborted by the client");const Pr="function"==typeof ts.headers?yield ts.headers(void 0):null!==(Si=ts.headers)&&void 0!==Si?Si:{};if(te.signal.aborted)throw new Error("Connection aborted by the client");let us;try{us=yield T(yr,{signal:te.signal,method:"PUT",credentials:d,referrer:f,referrerPolicy:m,headers:Pr})}catch(Jl){throw new Ql(Jl)}if(201!==us.status)throw new Ql(us);const Su=yield us.text();Pr["x-graphql-event-stream-token"]=Su;const Ed=yield Jz({signal:te.signal,headers:Pr,credentials:d,referrer:f,referrerPolicy:m,url:yr,fetchFn:T,onMessage:Jl=>{var Eu;null===(Eu=w?.message)||void 0===Eu||Eu.call(w,Jl),b?.(Jl)}});return null===(Qn=w?.connected)||void 0===Qn||Qn.call(w,!!pt),Ed.waitForThrow().catch(()=>_e=void 0),Ed})())}catch(Gn){throw _e=void 0,Gn}})).apply(this,arguments)}function In(Gn,Si,Qn){if(!e){const yr=new M,Pr=Y.onDispose(()=>{Pr(),yr.abort()});return(0,N.A)(function*(){var us,Su,Ed,Jl,Eu;let Sa=null,S1=0;for(;;)try{if(Sa){if(yield l(S1),yr.signal.aborted)throw new Error("Connection aborted by the client");S1++}null===(us=w?.connecting)||void 0===us||us.call(w,!!Sa),null===(Su=Qn?.connecting)||void 0===Su||Su.call(Qn,!!Sa);const Al=n,vNe="function"==typeof Al.url?yield Al.url(Gn):Al.url;if(yr.signal.aborted)throw new Error("Connection aborted by the client");const bNe="function"==typeof Al.headers?yield Al.headers(Gn):null!==(Ed=Al.headers)&&void 0!==Ed?Ed:{};if(yr.signal.aborted)throw new Error("Connection aborted by the client");const{getResults:CNe}=yield Jz({signal:yr.signal,headers:{...bNe,"content-type":"application/json; charset=utf-8"},credentials:d,referrer:f,referrerPolicy:m,url:vNe,body:JSON.stringify(Gn),fetchFn:T,onMessage:x1=>{var XA,qA;null===(XA=w?.message)||void 0===XA||XA.call(w,x1),null===(qA=Qn?.message)||void 0===qA||qA.call(Qn,x1),b?.(x1)}});null===(Jl=w?.connected)||void 0===Jl||Jl.call(w,!!Sa),null===(Eu=Qn?.connected)||void 0===Eu||Eu.call(Qn,!!Sa);var xu,bm=!1,Xf=!1;try{for(var E1,qh=yA(CNe());bm=!(E1=yield qh.next()).done;bm=!1)Sa=null,S1=0,Si.next(E1.value)}catch(x1){Xf=!0,xu=x1}finally{try{bm&&null!=qh.return&&(yield qh.return())}finally{if(Xf)throw xu}}return yr.abort()}catch(Al){if(yr.signal.aborted)return;if(!(Al instanceof Ql)||!s||S1>=s)throw Al;Sa=Al}})().then(()=>Si.complete()).catch(us=>Si.error(us)),()=>yr.abort()}xe++;const Ui=new M,ts=Y.onDispose(()=>{ts(),Ui.abort()});return(0,N.A)(function*(){const yr=r();Gn={...Gn,extensions:{...Gn.extensions,operationId:yr}};let Pr=null;for(;;){Pr=null;try{const{url:Sa,headers:S1,getResults:bm}=yield Vt();let Xf;try{Xf=yield T(Sa,{signal:Ui.signal,method:"POST",credentials:d,referrer:f,referrerPolicy:m,headers:{...S1,"content-type":"application/json; charset=utf-8"},body:JSON.stringify(Gn)})}catch(xu){throw new Ql(xu)}if(202!==Xf.status)throw new Ql(Xf);Pr=function(){var xu=(0,N.A)(function*(){let qh;try{const E1=new M,Al=Y.onDispose(()=>{Al(),E1.abort()});qh=yield T(Sa+"?operationId="+yr,{signal:E1.signal,method:"DELETE",credentials:d,referrer:f,referrerPolicy:m,headers:S1})}catch(E1){throw new Ql(E1)}if(200!==qh.status)throw new Ql(qh)});return function(){return xu.apply(this,arguments)}}();var Ed,us=!1,Su=!1;try{for(var Eu,Jl=yA(bm({signal:Ui.signal,operationId:yr}));us=!(Eu=yield Jl.next()).done;us=!1)pt=null,St=0,Si.next(Eu.value)}catch(xu){Su=!0,Ed=xu}finally{try{us&&null!=Jl.return&&(yield Jl.return())}finally{if(Su)throw Ed}}return Pr=null,Ui.abort()}catch(Sa){if(Ui.signal.aborted)return yield Pr?.();if(!(Sa instanceof Ql)||(t&&(_e=void 0),!s||St>=s))throw Ui.abort(),Sa;pt=Sa}finally{Ui.signal.aborted&&0===--xe&&(isFinite(i)&&i>0?setTimeout(()=>{xe||te.abort()},i):te.abort())}}})().then(()=>Si.complete()).catch(yr=>Si.error(yr)),()=>Ui.abort()}return e&&!t&&(0,N.A)(function*(){for(xe++;;)try{const{waitForThrow:Gn}=yield Vt();yield Gn()}catch(Gn){if(Y.disposed)return;if(!(Gn instanceof Ql)||(_e=void 0,!s||St>=s))return o?.(Gn);pt=Gn}})(),{subscribe:In,iterate(Gn,Si){const Qn=[],Ui={done:!1,error:null,resolve:()=>{}},ts=In(Gn,{next(Pr){Qn.push(Pr),Ui.resolve()},error(Pr){Ui.done=!0,Ui.error=Pr,Ui.resolve()},complete(){Ui.done=!0,Ui.resolve()}},Si),yr=(Pr=CA(function*(){for(;;){for(Qn.length||(yield bA(new Promise(Su=>Ui.resolve=Su)));Qn.length;)yield Qn.shift();if(Ui.error)throw Ui.error;if(Ui.done)return}}),function us(){return Pr.apply(this,arguments)})();var Pr;return yr.throw=function(){var Pr=(0,N.A)(function*(us){return Ui.done||(Ui.done=!0,Ui.error=us,Ui.resolve()),{done:!0,value:void 0}});return function(us){return Pr.apply(this,arguments)}}(),yr.return=(0,N.A)(function*(){return ts(),{done:!0,value:void 0}}),yr},dispose(){Y.dispose()}}}(e)}request(e){return new Ln(t=>this.client.subscribe({...e,query:X7(e.query)},{next:t.next.bind(t),complete:t.complete.bind(t),error:t.error.bind(t)}))}}const XIe={run:n=>n(),runOutsideAngular:n=>n()};let eV=(()=>{class n{constructor(){this.httpLink=we(HIe),this.gatewayService=we(WH),this.authService=we(vu),this.luigiCoreService=we(ar),this.apollo=(t,i=!1)=>new fA(XIe,this.createApolloOptions(t,i))}resolveToken(t){return this.authService.getToken()||this.resolveLuigiStoreToken()||t.token}resolveLuigiStoreToken(){try{return this.luigiCoreService.getAuthData()?.idToken}catch{return}}createAuthRetryLink(){return new ks((t,i)=>new Ln(o=>{let r,s;const l=d=>{r?.unsubscribe(),r=i(t).subscribe({next:o.next.bind(o),complete:o.complete.bind(o),error:f=>{d||!(n=>{const e=n;return[e?.status,e?.statusCode,e?.networkError?.status,e?.networkError?.statusCode].includes(401)})(f)?o.error(f):s=setTimeout(()=>l(!0),750)}})};return l(!1),()=>{void 0!==s&&clearTimeout(s),r?.unsubscribe()}}))}createApolloOptions(t,i=!1){const o=new mz(d=>{const f=d.headers instanceof Xs?d.headers:new Xs(d.headers??{});return{...d,uri:()=>this.gatewayService.getGatewayUrl(t,i),headers:f.set("Authorization",`Bearer ${this.resolveToken(t)}`).set("Accept","charset=utf-8")}}),r=tAe(({query:d})=>{const f=Rw(d);return"OperationDefinition"===f.kind&&"subscription"===f.operation},new KIe({url:()=>this.gatewayService.getGatewayUrl(t,i),headers:()=>({Authorization:`Bearer ${this.resolveToken(t)}`})}),this.httpLink.create({}));return{link:ks.from([this.createAuthRetryLink(),o,r]),cache:new gz}}static{this.\u0275fac=function(i){return new(i||n)}}static{this.\u0275prov=Bt({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})(),JIe=(()=>{class n{constructor(){this.httpClient=we(hu),this.luigiCoreService=we(ar)}requestChecks(t,i,o){if(!i?.entityActions.length||!o.length)return Cl([]);const r=t.organization,s=t.accountPath,l=this.luigiCoreService.getAuthData()?.idToken;if(!r||!l)return Cl([]);const d=o.map(m=>({resource:i.resource,group:i.group,name:m.name,namespace:m.namespace,actions:i.entityActions}));return this.httpClient.post("/rest/permissions/resource-check",{organization:r,accountPath:s,checks:d},{headers:{Authorization:`Bearer ${l}`}}).pipe(Tu(()=>Cl([])))}checkInstance(t,i,o){return this.requestChecks(t,i,[o])}checkInstances(t,i,o){return this.requestChecks(t,i,o)}static{this.\u0275fac=function(i){return new(i||n)}}static{this.\u0275prov=Bt({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();function tV(n){let e=n.replace(/[^a-zA-Z0-9]/g,"_");return/^[0-9]/.test(e)&&(e="_"+e),e}function AA(n){return n.split("_").filter(e=>e.length>0).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join("")}function nV(n,e,t){let i;if(n&&e)i=AA(tV(n)+"_"+e);else if(n)i=AA(tV(n));else{if(!e)return`${t}_Input`;i=AA("_"+e)}return`${i}${t}_Input`}function cm(n,e="_"){return[n.apiGroup,n.version,n.entity].filter(t=>!!t).join(e)}const um=n=>{const e=[];return n.map(t=>{t.property instanceof Array?t.property.map(i=>TA(i,e)):TA(t.property,e)}),e},TA=(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]:[...TA(t.splice(1).join("."))]}),e)},dm=(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=co({path:`${t.startsWith("$.")?"":"$."}${t}`,json:n}),r=o.length?o[0]:void 0;return r&&e.propertyField?eSe(r[e.propertyField.key],e.propertyField.transform):r},eSe=(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 nSe(t)}catch{return t}case"encode":try{return tSe(t)}catch{return t}default:return t}},n):n,tSe=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")}},nSe=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")}},I1=(n,e)=>dm(n,{jsonPathExpression:e}),Yf=n=>[n.resource,n.namespace,n.name].filter(Boolean).join("/");function Iu(n){return"Namespaced"===n?.resourceDefinition?.scope}function iV(n,e,t){if(!e)return n;const{getItemKey:i,mapSubscriptionObjectToItem:o}=t,r=new Map;n.forEach(m=>{const b=i(m);b&&r.set(b,m)});const{type:s,object:l}=e,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()]}const oV=(n,e,t)=>n?.[e??""]?.includes(t)??!0;function IA(n){if(Array.isArray(n))return n.map(e=>IA(e));if(n&&"object"==typeof n){const{__typename:e,...t}=n;for(const i of Object.keys(t))t[i]=IA(t[i]);return t}return n}function rV(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 sV=Symbol.for("gql-query-builder.raw");function SA(n){if(function rSe(n){return"object"==typeof n&&null!==n&&!0===n[sV]}(n))return String(n.value);if(null===n)return"null";if(Array.isArray(n))return`[${n.map(SA).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}: ${SA(t)}`).join(", ")}}`;default:throw new TypeError(`Cannot serialize ${typeof n} as a GraphQL literal`)}}function Sd(n){let e={};for(const{variables:t,fields:i}of n)e={...e,...t,...i&&f8(i)||{}};return e}function Kf(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 Xh(n){return n?n.map(e=>{if(rV(e))return function lSe(n){return`${EA(n)?"... on ":""}${function aSe(n){return EA(n)?n.operation:function sSe(n){return"string"==typeof n?n:`${n.alias}: ${n.name}`}(n.operation)}(n)} ${EA(n)?"":Kf(n.variables)} ${n.fields.length>0?`{ ${Xh(n.fields)} }`:""}`}(e);if("object"==typeof e){let t="";return Object.entries(e).forEach(([i,o],r,s)=>{t+=`${i} ${o.length>0?`{ ${Xh(o)} }`:""}`,r<s.length-1&&(t+=", ")}),t}return`${e}`}).join(", "):""}function EA(n){return!0===n?.fragment}function hm(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(f8(e)),t}function f8(n){let e={};return function t(i){return i?.forEach(o=>{if(rV(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 _m(n){const e=function uSe(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} = ${SA(n.default)}`}var dSe=class{#e;#n;#t;#i;constructor(n,e){Array.isArray(n)?this.#e=Sd(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(Sd(n),e.join("\n "))}#r(n){return this.#n&&"object"==typeof this.#n&&(n={...f8(this.#n),...n}),n&&Object.keys(n).length>0?`(${Object.keys(n).reduce((e,t,i)=>`${e}${0!==i?", ":""}$${t}: ${_m(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:hm(n,this.#n)}}#s(n){return`${"string"==typeof n?n:`${n.alias}: ${n.name}`} ${Kf(this.#e)} ${this.#n&&this.#n.length>0?`{\n ${Xh(this.#n)}\n }`:""}`}},hSe=class{#e;#n;#t;#i;constructor(n,e){this.#i={operationName:"",...e},Array.isArray(n)?this.#e=Sd(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={...f8(this.#n),...n}),n&&Object.keys(n).length>0?`(${Object.keys(n).reduce((e,t,i)=>`${e}${0!==i?", ":""}$${t}: ${_m(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:hm(this.#e,this.#n)}}#s(n){return`${"string"==typeof this.#t?this.#t:`${this.#t.alias}: ${this.#t.name}`} ${n?Kf(n):""} ${this.#n&&this.#n.length>0?`{ ${Xh(this.#n)} }`:""}`}},_Se=class{#e;#n;#t;#i;constructor(n,e){Array.isArray(n)?this.#e=Sd(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(Sd(n),e.join("\n "))}#r(n){return n&&Object.keys(n).length?`(${Object.keys(n).reduce((e,t,i)=>`${e}${0!==i?", ":""}$${t}: ${_m(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:hm(n)}}#s(){return`${"string"==typeof this.#t?this.#t:`${this.#t.alias}: ${this.#t.name}`} ${this.#e?Kf(this.#e):""} {\n ${Xh(this.#n)}\n }`}};function xA(n,e){const t=function cSe(n){return n?.length?n.map(e=>`\n\nfragment ${e.name} on ${e.on} { ${Xh(e.fields)} }`).join(""):""}(e?.fragments);return t?{...n,query:n.query+t}:n}function aV(n,e,t){const o=new(e??hSe)(n,t);return xA(Array.isArray(n)?o.queriesBuilder(n):o.queryBuilder(),t)}function DA(n,e,t){const o=new(e??dSe)(n,t);return xA(Array.isArray(n)?o.mutationsBuilder(n):o.mutationBuilder(),t)}let pm=(()=>{class n{constructor(){this.apolloFactory=we(eV),this.luigiCoreService=we(ar)}read(t,i,o,r,s=!0){const l=Iu(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(_o(m=>I1(m.data,cm(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 aV(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={...Iu(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},b=o.resourceDefinition;return b?i instanceof Array?this.listWithFields(b,i,o,s,m):this.listWithRawQuery(t,i,o,s,m):Yh(()=>new Error("Resource definition is required"))}getResourceReadyStatus(t,i){const o=i.resourceDefinition?.readyCondition;return!o||dm(t,o)}listWithFields(t,i,o,r,s){const{apiGroup:l,entityCollection:d,version:f}=t,w=aV(this.calcQueryOptions([{operation:d,variables:s,fields:["resourceVersion","remainingItemCount","continue",{items:i}]}],[{operation:l},{operation:f}])),T=this.parseGQLQuery(w.query);return this.apolloFactory.apollo(o,r).query({query:T,variables:w.variables}).pipe(_o(M=>{const Y=I1(M.data,cm({apiGroup:l,version:f,entity:d},"."));if(!Y)throw new Error("Resource list result not found");return Y}),_o(M=>{const Y=M.items.map(te=>({...te,ready:this.getResourceReadyStatus(te,o)})).map(te=>({...te,id:te.metadata.name,isAvailable:this.isAvailable(te,t.availableWhenNotReady),accessibleName:this.getAccessibleName(te)}));return{...M,items:Y}}))}isAvailable(t,i=!1){return(!!t.ready||i)&&!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(_o(d=>I1(d.data,t)??[]),Tu(d=>(this.alertErrors(d),console.error("Error executing GraphQL query.",d),Yh(()=>d))))}resourceChangeSubscription(t,i,o,r,s){const d={...Iu(o)&&{namespace:{type:"String",value:this.getNamespace(o)}}},f=t.toLowerCase(),m=function gSe(n,e,t){const o=new(e??_Se)(n,t);return xA(Array.isArray(n)?o.subscriptionsBuilder(n):o.subscriptionBuilder(),t)}({operation:f,fields:["type",{object:i}],variables:{...d,resourceVersion:{type:"String",value:r}}}),b=this.parseGQLQuery(m.query);return this.apolloFactory.apollo(o,s).subscribe({query:b,variables:m.variables}).pipe(_o(w=>{const T=I1(w.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,o.resourceDefinition?.availableWhenNotReady),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=Iu(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:[]}],w=DA(this.calcQueryOptions(m,[{operation:l},{operation:f}])),T=this.parseGQLQuery(w.query);return this.apolloFactory.apollo(o,r).mutate({mutation:T,variables:w.variables}).pipe(Tu(M=>(this.alertErrors(M),console.error("Error executing GraphQL query.",M),Yh(()=>M))))}create(t,i,o){const r=Iu(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:`${nV(s,d,l)}!`,value:t}},fields:["__typename"]}],w=DA(this.calcQueryOptions(m,[{operation:s},{operation:d}])),T=this.parseGQLQuery(w.query);return this.apolloFactory.apollo(o).mutate({mutation:T,fetchPolicy:"no-cache",variables:w.variables}).pipe(Tu(M=>(this.alertErrors(M),console.error("Error executing GraphQL query.",M),Yh(()=>M))))}update(t,i,o,r=!1,s=["__typename"]){const l=Iu(o),{apiGroup:d,entity:f,version:m}=i,b=this.getNamespace(o),w=IA(t),T=[{operation:`update${f}`,variables:{...l&&{namespace:{type:"String",value:b}},name:{type:"String!",value:t.metadata.name},object:{type:`${nV(d,m,f)}!`,value:w}},fields:s}],Y=DA(this.calcQueryOptions(T,[{operation:d},{operation:m}])),te=this.parseGQLQuery(Y.query);return this.apolloFactory.apollo(o,r).mutate({mutation:te,fetchPolicy:"no-cache",variables:Y.variables}).pipe(_o(_e=>I1(_e.data,cm({apiGroup:d,entity:`update${f}`,version:m},"."))),Tu(_e=>(this.alertErrors(_e),console.error("Error executing GraphQL query.",_e),Yh(()=>_e))))}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 mA`
83
83
  ${t}
84
84
  `}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(_o(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=Bt({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();const mSe=mA`
85
85
  {