@wazobiatech/wazui 0.0.12 → 0.0.13
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.
- package/.env.sample +18 -18
- package/.env.test +5 -0
- package/CONVERSION_COMPLETE.md +87 -0
- package/ENVIRONMENT.md +230 -0
- package/NEXTJS_GUIDE.md +186 -0
- package/QUICK_START_ENV.md +0 -0
- package/USAGE_EXAMPLES.tsx +76 -0
- package/package.json +3 -10
- package/src/config/env.ts +8 -8
- package/src/config/next.ts +79 -0
- package/src/decorators/ApolloDecorator.tsx +1 -1
- package/src/decorators/DolosApolloDecorator.tsx +1 -1
- package/src/env.ts +48 -93
- package/src/hooks/useMercuryProjectToken.ts +3 -3
- package/src/hooks/useProjectToken.ts +2 -2
- package/src/index.ts +17 -1
- package/src/mocks/env.ts +9 -9
- package/src/providers/EnvironmentProvider/WazUIEnvironmentProvider.tsx +50 -0
- package/src/providers/EnvironmentProvider/context.ts +5 -0
- package/src/providers/EnvironmentProvider/index.ts +5 -0
- package/src/providers/EnvironmentProvider/useWazUIEnvironment.ts +20 -0
- package/src/providers/EnvironmentProvider/utils.ts +122 -0
- package/src/utils/apolloClient.ts +6 -6
- package/src/utils/images.ts +14 -7
- package/storybook-static/assets/ApolloDecorator-DdFdPk9I.js +1 -0
- package/storybook-static/assets/BlogCategoryContent-j1uDZXn7.js +97 -0
- package/storybook-static/assets/BlogCategoryContent.stories-qYKLjb6F.js +9 -0
- package/storybook-static/assets/BlogPostContentComponent-C2AFWOqJ.js +956 -0
- package/storybook-static/assets/BlogPostContentComponent.stories-ZsTapbYf.js +18 -0
- package/storybook-static/assets/BlogPostsComponent.stories-CcjjSusf.js +11 -0
- package/storybook-static/assets/BlogTagContent-BnwuQUSW.js +92 -0
- package/storybook-static/assets/BlogTagContent.stories-BdzlB1N5.js +9 -0
- package/storybook-static/assets/CategoriesComponent.stories-C4qc6J3o.js +7 -0
- package/storybook-static/assets/ClearCacheHistory.stories-BFGJ9Cpr.js +6 -0
- package/storybook-static/assets/Color-YHDXOIA2-uT_23_Qt.js +1 -0
- package/storybook-static/assets/DocsRenderer-CFRXHY34-PYIpRFNk.js +575 -0
- package/storybook-static/assets/DolosApolloDecorator-DEvkQjrM.js +1 -0
- package/storybook-static/assets/FeatureJungle-Light-CFEx0Apr.woff +0 -0
- package/storybook-static/assets/PictureBlot-Ce0f3E3l.js +2 -0
- package/storybook-static/assets/PurgeCache-6QorPr5P.js +5 -0
- package/storybook-static/assets/PurgeCache.stories-9MRRLCNG.js +13 -0
- package/storybook-static/assets/ReactQueryDecorator-CrsXrNQd.js +1 -0
- package/storybook-static/assets/RecipeCategories.stories--J_t5Kqe.js +7 -0
- package/storybook-static/assets/RecipeCategoryContent-PlykHail.js +139 -0
- package/storybook-static/assets/RecipeCategoryContent.stories-kGW7yk1Q.js +9 -0
- package/storybook-static/assets/RecipeContentComponent.stories-BQ8Uxx67.js +18 -0
- package/storybook-static/assets/RecipeTags.stories-C1FTvpsL.js +7 -0
- package/storybook-static/assets/RecipeTagsContent-DS00_2mK.js +18 -0
- package/storybook-static/assets/RecipeTagsContent.stories-BiMSQhz1.js +5 -0
- package/storybook-static/assets/RecipesComponent.stories-CHZ8K6cH.js +9 -0
- package/storybook-static/assets/RedirectContent-CmGN0ktq.js +96 -0
- package/storybook-static/assets/RedirectContent.stories-9_qkEHzb.js +5 -0
- package/storybook-static/assets/RedirectsComponent.stories-CTycXldt.js +8 -0
- package/storybook-static/assets/TagsComponent.stories-DSohzxP0.js +7 -0
- package/storybook-static/assets/TimeAgo-BMs3lst-.js +5 -0
- package/storybook-static/assets/UniversalJungle-420-mm6ugnAQ.woff +0 -0
- package/storybook-static/assets/WazUIBlogComponent.stories-CCXKbbai.js +86 -0
- package/storybook-static/assets/WazUIBlogDashboard-CtU7uRTr.js +162 -0
- package/storybook-static/assets/WazUIBlogDashboard.stories-CqTZ4exx.js +38 -0
- package/storybook-static/assets/WazUIButton.stories-CDWIbKyS.js +59 -0
- package/storybook-static/assets/WazUIDataTable-DnneDnRd.js +22 -0
- package/storybook-static/assets/WazUIPostActions-BZQom1Yt.js +16 -0
- package/storybook-static/assets/WazUiBreadCrumb-BPc3tEqC.js +1 -0
- package/storybook-static/assets/WazUiBreadCrumb.stories-_gNokkDn.js +7 -0
- package/storybook-static/assets/WazUiButton-e06gz3US.js +27 -0
- package/storybook-static/assets/WazUiCreateBlogContent-DxC86Nwl.js +327 -0
- package/storybook-static/assets/WazUiCreateBlogContent.stories-Bzq3YtfW.js +94 -0
- package/storybook-static/assets/WazUiCreateContentPopup.stories-D_9OExPO.js +41 -0
- package/storybook-static/assets/WazUiDataTable.stories-D1Aj3wPk.js +23 -0
- package/storybook-static/assets/WazUiGqlMediaLibrary.stories-Cug9TM1_.js +105 -0
- package/storybook-static/assets/WazUiGqlMediaLibraryPopup.stories-CuwWYcJs.js +53 -0
- package/storybook-static/assets/WazUiInputBox-C2jVcTq2.js +734 -0
- package/storybook-static/assets/WazUiInputBox.stories-Bs1Vb_Rd.js +270 -0
- package/storybook-static/assets/WazUiNavigationBlocker-BrhA3ONc.js +1 -0
- package/storybook-static/assets/WazUiNavigationBlocker.stories-CgqwQbJ9.js +6 -0
- package/storybook-static/assets/WazUiPostCard-bQlmiDOB.js +99 -0
- package/storybook-static/assets/WazUiPostCard.stories-Dir2IwY1.js +9 -0
- package/storybook-static/assets/WazUiWysiwygInput.stories-BDO7EAIa.js +170 -0
- package/storybook-static/assets/WazuiActionModal-Cgw_QqFv.js +11 -0
- package/storybook-static/assets/WazuiActionModal.stories-CFCFlfLU.js +5 -0
- package/storybook-static/assets/WazuiCreateContentPopup-CXVvIFOU.js +130 -0
- package/storybook-static/assets/WazuiImage-BwRWaPkA.js +58 -0
- package/storybook-static/assets/WazuiImage.stories-CxpLgpmg.js +48 -0
- package/storybook-static/assets/button-BxNLA_J_.js +1 -0
- package/storybook-static/assets/calendar-CorT5FcI.js +6 -0
- package/storybook-static/assets/chunk-XP5HYGXS-BpfKkqn7.js +1 -0
- package/storybook-static/assets/emerald-GdtolcHR.svg +9 -0
- package/storybook-static/assets/entry-preview-Chux9cpU.js +2 -0
- package/storybook-static/assets/entry-preview-docs-DviPOtIv.js +46 -0
- package/storybook-static/assets/env-B_s3Ell7.js +1 -0
- package/storybook-static/assets/gold-CtN6pOVZ.svg +9 -0
- package/storybook-static/assets/groups-GzRK9wBi.js +6 -0
- package/storybook-static/assets/hooks-D-wca2rG.js +1 -0
- package/storybook-static/assets/iconBase-B7i_G6Rg.js +1 -0
- package/storybook-static/assets/iframe-DarAeeHv.js +211 -0
- package/storybook-static/assets/index-BAoN7Cmi.js +240 -0
- package/storybook-static/assets/index-BJvHeDRT.js +1 -0
- package/storybook-static/assets/index-BR89vyis.js +6 -0
- package/storybook-static/assets/index-BWnBDfn-.js +9 -0
- package/storybook-static/assets/index-Bqat3xNk.js +1 -0
- package/storybook-static/assets/index-CBYaBgW8.js +9 -0
- package/storybook-static/assets/index-CZ4jztst.js +30 -0
- package/storybook-static/assets/index-CeH2RAp8.js +22 -0
- package/storybook-static/assets/index-DarTc5kA.js +1 -0
- package/storybook-static/assets/index-DgH-xKnr.js +11 -0
- package/storybook-static/assets/index-DrFu-skq.js +6 -0
- package/storybook-static/assets/instagram-DKTomRJ8.svg +9 -0
- package/storybook-static/assets/jsx-runtime-D_zvdyIk.js +9 -0
- package/storybook-static/assets/no-data-image-Bhn_PKhS.svg +41 -0
- package/storybook-static/assets/no-image-icon-CjrDvlv3.svg +84 -0
- package/storybook-static/assets/pexels-DrnxyPAE.svg +9 -0
- package/storybook-static/assets/popover-BB1qMQFg.js +76 -0
- package/storybook-static/assets/preview-B8lJiyuQ.js +34 -0
- package/storybook-static/assets/preview-BBWR9nbA.js +1 -0
- package/storybook-static/assets/preview-BWzBA1C2.js +396 -0
- package/storybook-static/assets/preview-BaoH-L4j.js +1 -0
- package/storybook-static/assets/preview-C-LZrIW4.js +2 -0
- package/storybook-static/assets/preview-CVgpLj3b.js +1 -0
- package/storybook-static/assets/preview-CvbIS5ZJ.js +1 -0
- package/storybook-static/assets/preview-DGUiP6tS.js +7 -0
- package/storybook-static/assets/preview-DMG083aW.js +240 -0
- package/storybook-static/assets/preview-DoyfkCKF.css +1 -0
- package/storybook-static/assets/preview-TWlugwTp.js +3 -0
- package/storybook-static/assets/provider-Bst_TvlW.js +1 -0
- package/storybook-static/assets/queries-9Km_qMSB.js +125 -0
- package/storybook-static/assets/queries-Bdq7cXa5.js +231 -0
- package/storybook-static/assets/queries-ClywsDTl.js +103 -0
- package/storybook-static/assets/quill-Dex9Y0nc.js +49 -0
- package/storybook-static/assets/react-18-DbMmlWnz.js +25 -0
- package/storybook-static/assets/sapphire-BO-7mqXy.svg +9 -0
- package/storybook-static/assets/test-utils-DxU8HTJE.js +9 -0
- package/storybook-static/assets/upload-image-BZPKKzIo.svg +43 -0
- package/storybook-static/assets/useMercuryProjectToken-BgbQUYG9.js +49 -0
- package/storybook-static/assets/users-ClnJTo4A.js +1 -0
- package/storybook-static/assets/utils-3HBFSLrk.js +2 -0
- package/storybook-static/assets/v4-CtRu48qb.js +1 -0
- package/storybook-static/favicon.svg +1 -0
- package/storybook-static/iframe.html +669 -0
- package/storybook-static/index.html +185 -0
- package/storybook-static/index.json +1 -0
- package/storybook-static/nunito-sans-bold-italic.woff2 +0 -0
- package/storybook-static/nunito-sans-bold.woff2 +0 -0
- package/storybook-static/nunito-sans-italic.woff2 +0 -0
- package/storybook-static/nunito-sans-regular.woff2 +0 -0
- package/storybook-static/project.json +1 -0
- package/storybook-static/sb-addons/chromatic-com-storybook-10/manager-bundle.js +331 -0
- package/storybook-static/sb-addons/chromatic-com-storybook-10/manager-bundle.js.LEGAL.txt +51 -0
- package/storybook-static/sb-addons/essentials-actions-2/manager-bundle.js +3 -0
- package/storybook-static/sb-addons/essentials-backgrounds-4/manager-bundle.js +12 -0
- package/storybook-static/sb-addons/essentials-controls-1/manager-bundle.js +405 -0
- package/storybook-static/sb-addons/essentials-docs-3/manager-bundle.js +245 -0
- package/storybook-static/sb-addons/essentials-measure-7/manager-bundle.js +3 -0
- package/storybook-static/sb-addons/essentials-outline-8/manager-bundle.js +3 -0
- package/storybook-static/sb-addons/essentials-toolbars-6/manager-bundle.js +3 -0
- package/storybook-static/sb-addons/essentials-viewport-5/manager-bundle.js +3 -0
- package/storybook-static/sb-addons/onboarding-9/manager-bundle.js +127 -0
- package/storybook-static/sb-addons/storybook-core-core-server-presets-0/common-manager-bundle.js +3 -0
- package/storybook-static/sb-addons/storybook-experimental-addon-test-11/manager-bundle.js +223 -0
- package/storybook-static/sb-addons/themes-12/manager-bundle.js +3 -0
- package/storybook-static/sb-common-assets/favicon.svg +1 -0
- package/storybook-static/sb-common-assets/nunito-sans-bold-italic.woff2 +0 -0
- package/storybook-static/sb-common-assets/nunito-sans-bold.woff2 +0 -0
- package/storybook-static/sb-common-assets/nunito-sans-italic.woff2 +0 -0
- package/storybook-static/sb-common-assets/nunito-sans-regular.woff2 +0 -0
- package/storybook-static/sb-manager/globals-module-info.js +1051 -0
- package/storybook-static/sb-manager/globals-runtime.js +41591 -0
- package/storybook-static/sb-manager/globals.js +48 -0
- package/storybook-static/sb-manager/runtime.js +12048 -0
- package/vite.config.ts +1 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
var Ma=Object.defineProperty;var _i=r=>{throw TypeError(r)};var ja=(r,e,t)=>e in r?Ma(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var v=(r,e,t)=>ja(r,typeof e!="symbol"?e+"":e,t),$r=(r,e,t)=>e.has(r)||_i("Cannot "+t);var w=(r,e,t)=>($r(r,e,"read from private field"),t?t.call(r):e.get(r)),N=(r,e,t)=>e.has(r)?_i("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,t),C=(r,e,t,n)=>($r(r,e,"write to private field"),n?n.call(r,t):e.set(r,t),t),j=(r,e,t)=>($r(r,e,"access private method"),t);import{Y as vr,Q as wr,T as Sr,U as it,Z as qa,W as Gs,$ as Hr,V as La,a0 as Ua}from"./popover-BB1qMQFg.js";import{e as Jr}from"./env-B_s3Ell7.js";import{r as ie}from"./index-CBYaBgW8.js";import{j as Va}from"./jsx-runtime-D_zvdyIk.js";const Ba=!1;function ke(r){try{return r()}catch{}}const gn=ke(()=>globalThis)||ke(()=>window)||ke(()=>self)||ke(()=>global)||ke(function(){return ke.constructor("return this")()}),Zn="4.0.9",Di=new Map;function Ys(r){const e=Di.get(r)||1;return Di.set(r,e+1),`${r}:${e}:${Math.random().toString(36).slice(2)}`}function Qa(r,e=0){const t=Ys("stringifyForDisplay");return JSON.stringify(r,(n,i)=>i===void 0?t:i,e).split(JSON.stringify(t)).join("<undefined>")}const Ii="Invariant Violation";class ei extends Error{constructor(e=Ii){super(e),this.name=Ii,Object.setPrototypeOf(this,ei.prototype)}}const Ks=["debug","log","warn","error","silent"];let za=Ks.indexOf("silent");function I(r,...e){if(!r)throw oe(...e)}function _r(r){return function(e,...t){if(Ks.indexOf(r)>=za){const n=console[r]||console.log;if(typeof e=="number"){const i=e;e=Xs(i),e||(e=Zs(i,t),t=[])}n(e,...t)}}}I.debug=_r("debug");I.log=_r("log");I.warn=_r("warn");I.error=_r("error");function oe(r,...e){return new ei(Xs(r,e)||Zs(r,e))}const Ni=Symbol.for("ApolloErrorMessageHandler_"+Zn);function vn(r){if(typeof r=="string")return r;try{return Qa(r,2).slice(0,1e3)}catch{return"<non-serializable>"}}function Xs(r,e=[]){if(r)return gn[Ni]&&gn[Ni](r,e.map(vn))}function Zs(r,e=[]){if(r)return typeof r=="string"?e.reduce((t,n)=>t.replace(/%[sdfo]/,vn(n)),r):`An error occurred! For more details, see the full error text at https://go.apollo.dev/c/err#${encodeURIComponent(JSON.stringify({version:Zn,message:r,args:e.map(vn)}))}`}const{toString:Pi,hasOwnProperty:Wa}=Object.prototype,Ai=Function.prototype.toString,wn=new Map;function B(r,e){try{return Sn(r,e)}finally{wn.clear()}}function Sn(r,e){if(r===e)return!0;const t=Pi.call(r),n=Pi.call(e);if(t!==n)return!1;switch(t){case"[object Array]":if(r.length!==e.length)return!1;case"[object Object]":{if(Mi(r,e))return!0;const i=xi(r),s=xi(e),o=i.length;if(o!==s.length)return!1;for(let a=0;a<o;++a)if(!Wa.call(e,i[a]))return!1;for(let a=0;a<o;++a){const c=i[a];if(!Sn(r[c],e[c]))return!1}return!0}case"[object Error]":return r.name===e.name&&r.message===e.message;case"[object Number]":if(r!==r)return e!==e;case"[object Boolean]":case"[object Date]":return+r==+e;case"[object RegExp]":case"[object String]":return r==`${e}`;case"[object Map]":case"[object Set]":{if(r.size!==e.size)return!1;if(Mi(r,e))return!0;const i=r.entries(),s=t==="[object Map]";for(;;){const o=i.next();if(o.done)break;const[a,c]=o.value;if(!e.has(a)||s&&!Sn(c,e.get(a)))return!1}return!0}case"[object Uint16Array]":case"[object Uint8Array]":case"[object Uint32Array]":case"[object Int32Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object ArrayBuffer]":r=new Uint8Array(r),e=new Uint8Array(e);case"[object DataView]":{let i=r.byteLength;if(i===e.byteLength)for(;i--&&r[i]===e[i];);return i===-1}case"[object AsyncFunction]":case"[object GeneratorFunction]":case"[object AsyncGeneratorFunction]":case"[object Function]":{const i=Ai.call(r);return i!==Ai.call(e)?!1:!Ja(i,Ha)}}return!1}function xi(r){return Object.keys(r).filter($a,r)}function $a(r){return this[r]!==void 0}const Ha="{ [native code] }";function Ja(r,e){const t=r.length-e.length;return t>=0&&r.indexOf(e,t)===t}function Mi(r,e){let t=wn.get(r);if(t){if(t.has(e))return!0}else wn.set(r,t=new Set);return t.add(e),!1}function Ga(r,e){if(!!!r)throw new Error(e)}class id{constructor(e,t,n){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=n}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}}class sd{constructor(e,t,n,i,s,o){this.kind=e,this.start=t,this.end=n,this.line=i,this.column=s,this.value=o,this.prev=null,this.next=null}get[Symbol.toStringTag](){return"Token"}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}}const eo={Name:[],Document:["definitions"],OperationDefinition:["description","name","variableDefinitions","directives","selectionSet"],VariableDefinition:["description","variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["description","name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"],TypeCoordinate:["name"],MemberCoordinate:["name","memberName"],ArgumentCoordinate:["name","fieldName","argumentName"],DirectiveCoordinate:["name"],DirectiveArgumentCoordinate:["name","argumentName"]},Ya=new Set(Object.keys(eo));function ji(r){const e=r==null?void 0:r.kind;return typeof e=="string"&&Ya.has(e)}var Be;(function(r){r.QUERY="query",r.MUTATION="mutation",r.SUBSCRIPTION="subscription"})(Be||(Be={}));var P;(function(r){r.NAME="Name",r.DOCUMENT="Document",r.OPERATION_DEFINITION="OperationDefinition",r.VARIABLE_DEFINITION="VariableDefinition",r.SELECTION_SET="SelectionSet",r.FIELD="Field",r.ARGUMENT="Argument",r.FRAGMENT_SPREAD="FragmentSpread",r.INLINE_FRAGMENT="InlineFragment",r.FRAGMENT_DEFINITION="FragmentDefinition",r.VARIABLE="Variable",r.INT="IntValue",r.FLOAT="FloatValue",r.STRING="StringValue",r.BOOLEAN="BooleanValue",r.NULL="NullValue",r.ENUM="EnumValue",r.LIST="ListValue",r.OBJECT="ObjectValue",r.OBJECT_FIELD="ObjectField",r.DIRECTIVE="Directive",r.NAMED_TYPE="NamedType",r.LIST_TYPE="ListType",r.NON_NULL_TYPE="NonNullType",r.SCHEMA_DEFINITION="SchemaDefinition",r.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",r.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",r.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",r.FIELD_DEFINITION="FieldDefinition",r.INPUT_VALUE_DEFINITION="InputValueDefinition",r.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",r.UNION_TYPE_DEFINITION="UnionTypeDefinition",r.ENUM_TYPE_DEFINITION="EnumTypeDefinition",r.ENUM_VALUE_DEFINITION="EnumValueDefinition",r.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",r.DIRECTIVE_DEFINITION="DirectiveDefinition",r.SCHEMA_EXTENSION="SchemaExtension",r.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",r.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",r.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",r.UNION_TYPE_EXTENSION="UnionTypeExtension",r.ENUM_TYPE_EXTENSION="EnumTypeExtension",r.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension",r.TYPE_COORDINATE="TypeCoordinate",r.MEMBER_COORDINATE="MemberCoordinate",r.ARGUMENT_COORDINATE="ArgumentCoordinate",r.DIRECTIVE_COORDINATE="DirectiveCoordinate",r.DIRECTIVE_ARGUMENT_COORDINATE="DirectiveArgumentCoordinate"})(P||(P={}));function En(r){return r===9||r===32}function Ka(r){return r>=48&&r<=57}function to(r){return r>=97&&r<=122||r>=65&&r<=90}function od(r){return to(r)||r===95}function ad(r){return to(r)||Ka(r)||r===95}function cd(r){var e;let t=Number.MAX_SAFE_INTEGER,n=null,i=-1;for(let o=0;o<r.length;++o){var s;const a=r[o],c=Xa(a);c!==a.length&&(n=(s=n)!==null&&s!==void 0?s:o,i=o,o!==0&&c<t&&(t=c))}return r.map((o,a)=>a===0?o:o.slice(t)).slice((e=n)!==null&&e!==void 0?e:0,i+1)}function Xa(r){let e=0;for(;e<r.length&&En(r.charCodeAt(e));)++e;return e}function Za(r,e){const t=r.replace(/"""/g,'\\"""'),n=t.split(/\r\n|[\n\r]/g),i=n.length===1,s=n.length>1&&n.slice(1).every(p=>p.length===0||En(p.charCodeAt(0))),o=t.endsWith('\\"""'),a=r.endsWith('"')&&!o,c=r.endsWith("\\"),u=a||c,l=!i||r.length>70||u||s||o;let f="";const h=i&&En(r.charCodeAt(0));return(l&&!h||s)&&(f+=`
|
|
2
|
+
`),f+=t,(l||u)&&(f+=`
|
|
3
|
+
`),'"""'+f+'"""'}const ec=10,ro=2;function tc(r){return Dr(r,[])}function Dr(r,e){switch(typeof r){case"string":return JSON.stringify(r);case"function":return r.name?`[function ${r.name}]`:"[function]";case"object":return rc(r,e);default:return String(r)}}function rc(r,e){if(r===null)return"null";if(e.includes(r))return"[Circular]";const t=[...e,r];if(nc(r)){const n=r.toJSON();if(n!==r)return typeof n=="string"?n:Dr(n,t)}else if(Array.isArray(r))return sc(r,t);return ic(r,t)}function nc(r){return typeof r.toJSON=="function"}function ic(r,e){const t=Object.entries(r);return t.length===0?"{}":e.length>ro?"["+oc(r)+"]":"{ "+t.map(([i,s])=>i+": "+Dr(s,e)).join(", ")+" }"}function sc(r,e){if(r.length===0)return"[]";if(e.length>ro)return"[Array]";const t=Math.min(ec,r.length),n=r.length-t,i=[];for(let s=0;s<t;++s)i.push(Dr(r[s],e));return n===1?i.push("... 1 more item"):n>1&&i.push(`... ${n} more items`),"["+i.join(", ")+"]"}function oc(r){const e=Object.prototype.toString.call(r).replace(/^\[object /,"").replace(/]$/,"");if(e==="Object"&&typeof r.constructor=="function"){const t=r.constructor.name;if(typeof t=="string"&&t!=="")return t}return e}function ac(r){return`"${r.replace(cc,uc)}"`}const cc=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function uc(r){return lc[r.charCodeAt(0)]}const lc=["\\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"],ti=Object.freeze({});function ye(r,e,t=eo){const n=new Map;for(const b of Object.values(P))n.set(b,fc(e,b));let i,s=Array.isArray(r),o=[r],a=-1,c=[],u=r,l,f;const h=[],p=[];do{a++;const b=a===o.length,S=b&&c.length!==0;if(b){if(l=p.length===0?void 0:h[h.length-1],u=f,f=p.pop(),S)if(s){u=u.slice();let E=0;for(const[k,M]of c){const A=k-E;M===null?(u.splice(A,1),E++):u[A]=M}}else{u={...u};for(const[E,k]of c)u[E]=k}a=i.index,o=i.keys,c=i.edits,s=i.inArray,i=i.prev}else if(f){if(l=s?a:o[a],u=f[l],u==null)continue;h.push(l)}let O;if(!Array.isArray(u)){var d,y;ji(u)||Ga(!1,`Invalid AST Node: ${tc(u)}.`);const E=b?(d=n.get(u.kind))===null||d===void 0?void 0:d.leave:(y=n.get(u.kind))===null||y===void 0?void 0:y.enter;if(O=E==null?void 0:E.call(e,u,l,f,h,p),O===ti)break;if(O===!1){if(!b){h.pop();continue}}else if(O!==void 0&&(c.push([l,O]),!b))if(ji(O))u=O;else{h.pop();continue}}if(O===void 0&&S&&c.push([l,u]),b)h.pop();else{var m;i={inArray:s,index:a,keys:o,edits:c,prev:i},s=Array.isArray(u),o=s?u:(m=t[u.kind])!==null&&m!==void 0?m:[],a=-1,c=[],f&&p.push(f),f=u}}while(i!==void 0);return c.length!==0?c[c.length-1][1]:r}function fc(r,e){const t=r[e];return typeof t=="object"?t:typeof t=="function"?{enter:t,leave:void 0}:{enter:r.enter,leave:r.leave}}function hc(r){return ye(r,pc)}const dc=80,pc={Name:{leave:r=>r.value},Variable:{leave:r=>"$"+r.name},Document:{leave:r=>T(r.definitions,`
|
|
4
|
+
|
|
5
|
+
`)},OperationDefinition:{leave(r){const e=Gr(r.variableDefinitions)?R(`(
|
|
6
|
+
`,T(r.variableDefinitions,`
|
|
7
|
+
`),`
|
|
8
|
+
)`):R("(",T(r.variableDefinitions,", "),")"),t=R("",r.description,`
|
|
9
|
+
`)+T([r.operation,T([r.name,e]),T(r.directives," ")]," ");return(t==="query"?"":t+" ")+r.selectionSet}},VariableDefinition:{leave:({variable:r,type:e,defaultValue:t,directives:n,description:i})=>R("",i,`
|
|
10
|
+
`)+r+": "+e+R(" = ",t)+R(" ",T(n," "))},SelectionSet:{leave:({selections:r})=>ce(r)},Field:{leave({alias:r,name:e,arguments:t,directives:n,selectionSet:i}){const s=R("",r,": ")+e;let o=s+R("(",T(t,", "),")");return o.length>dc&&(o=s+R(`(
|
|
11
|
+
`,lr(T(t,`
|
|
12
|
+
`)),`
|
|
13
|
+
)`)),T([o,T(n," "),i]," ")}},Argument:{leave:({name:r,value:e})=>r+": "+e},FragmentSpread:{leave:({name:r,directives:e})=>"..."+r+R(" ",T(e," "))},InlineFragment:{leave:({typeCondition:r,directives:e,selectionSet:t})=>T(["...",R("on ",r),T(e," "),t]," ")},FragmentDefinition:{leave:({name:r,typeCondition:e,variableDefinitions:t,directives:n,selectionSet:i,description:s})=>R("",s,`
|
|
14
|
+
`)+`fragment ${r}${R("(",T(t,", "),")")} on ${e} ${R("",T(n," ")," ")}`+i},IntValue:{leave:({value:r})=>r},FloatValue:{leave:({value:r})=>r},StringValue:{leave:({value:r,block:e})=>e?Za(r):ac(r)},BooleanValue:{leave:({value:r})=>r?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:r})=>r},ListValue:{leave:({values:r})=>"["+T(r,", ")+"]"},ObjectValue:{leave:({fields:r})=>"{"+T(r,", ")+"}"},ObjectField:{leave:({name:r,value:e})=>r+": "+e},Directive:{leave:({name:r,arguments:e})=>"@"+r+R("(",T(e,", "),")")},NamedType:{leave:({name:r})=>r},ListType:{leave:({type:r})=>"["+r+"]"},NonNullType:{leave:({type:r})=>r+"!"},SchemaDefinition:{leave:({description:r,directives:e,operationTypes:t})=>R("",r,`
|
|
15
|
+
`)+T(["schema",T(e," "),ce(t)]," ")},OperationTypeDefinition:{leave:({operation:r,type:e})=>r+": "+e},ScalarTypeDefinition:{leave:({description:r,name:e,directives:t})=>R("",r,`
|
|
16
|
+
`)+T(["scalar",e,T(t," ")]," ")},ObjectTypeDefinition:{leave:({description:r,name:e,interfaces:t,directives:n,fields:i})=>R("",r,`
|
|
17
|
+
`)+T(["type",e,R("implements ",T(t," & ")),T(n," "),ce(i)]," ")},FieldDefinition:{leave:({description:r,name:e,arguments:t,type:n,directives:i})=>R("",r,`
|
|
18
|
+
`)+e+(Gr(t)?R(`(
|
|
19
|
+
`,lr(T(t,`
|
|
20
|
+
`)),`
|
|
21
|
+
)`):R("(",T(t,", "),")"))+": "+n+R(" ",T(i," "))},InputValueDefinition:{leave:({description:r,name:e,type:t,defaultValue:n,directives:i})=>R("",r,`
|
|
22
|
+
`)+T([e+": "+t,R("= ",n),T(i," ")]," ")},InterfaceTypeDefinition:{leave:({description:r,name:e,interfaces:t,directives:n,fields:i})=>R("",r,`
|
|
23
|
+
`)+T(["interface",e,R("implements ",T(t," & ")),T(n," "),ce(i)]," ")},UnionTypeDefinition:{leave:({description:r,name:e,directives:t,types:n})=>R("",r,`
|
|
24
|
+
`)+T(["union",e,T(t," "),R("= ",T(n," | "))]," ")},EnumTypeDefinition:{leave:({description:r,name:e,directives:t,values:n})=>R("",r,`
|
|
25
|
+
`)+T(["enum",e,T(t," "),ce(n)]," ")},EnumValueDefinition:{leave:({description:r,name:e,directives:t})=>R("",r,`
|
|
26
|
+
`)+T([e,T(t," ")]," ")},InputObjectTypeDefinition:{leave:({description:r,name:e,directives:t,fields:n})=>R("",r,`
|
|
27
|
+
`)+T(["input",e,T(t," "),ce(n)]," ")},DirectiveDefinition:{leave:({description:r,name:e,arguments:t,repeatable:n,locations:i})=>R("",r,`
|
|
28
|
+
`)+"directive @"+e+(Gr(t)?R(`(
|
|
29
|
+
`,lr(T(t,`
|
|
30
|
+
`)),`
|
|
31
|
+
)`):R("(",T(t,", "),")"))+(n?" repeatable":"")+" on "+T(i," | ")},SchemaExtension:{leave:({directives:r,operationTypes:e})=>T(["extend schema",T(r," "),ce(e)]," ")},ScalarTypeExtension:{leave:({name:r,directives:e})=>T(["extend scalar",r,T(e," ")]," ")},ObjectTypeExtension:{leave:({name:r,interfaces:e,directives:t,fields:n})=>T(["extend type",r,R("implements ",T(e," & ")),T(t," "),ce(n)]," ")},InterfaceTypeExtension:{leave:({name:r,interfaces:e,directives:t,fields:n})=>T(["extend interface",r,R("implements ",T(e," & ")),T(t," "),ce(n)]," ")},UnionTypeExtension:{leave:({name:r,directives:e,types:t})=>T(["extend union",r,T(e," "),R("= ",T(t," | "))]," ")},EnumTypeExtension:{leave:({name:r,directives:e,values:t})=>T(["extend enum",r,T(e," "),ce(t)]," ")},InputObjectTypeExtension:{leave:({name:r,directives:e,fields:t})=>T(["extend input",r,T(e," "),ce(t)]," ")},TypeCoordinate:{leave:({name:r})=>r},MemberCoordinate:{leave:({name:r,memberName:e})=>T([r,R(".",e)])},ArgumentCoordinate:{leave:({name:r,fieldName:e,argumentName:t})=>T([r,R(".",e),R("(",t,":)")])},DirectiveCoordinate:{leave:({name:r})=>T(["@",r])},DirectiveArgumentCoordinate:{leave:({name:r,argumentName:e})=>T(["@",r,R("(",e,":)")])}};function T(r,e=""){var t;return(t=r==null?void 0:r.filter(n=>n).join(e))!==null&&t!==void 0?t:""}function ce(r){return R(`{
|
|
32
|
+
`,lr(T(r,`
|
|
33
|
+
`)),`
|
|
34
|
+
}`)}function R(r,e,t=""){return e!=null&&e!==""?r+e+t:""}function lr(r){return R(" ",r.replace(/\n/g,`
|
|
35
|
+
`))}function Gr(r){var e;return(e=r==null?void 0:r.some(t=>t.includes(`
|
|
36
|
+
`)))!==null&&e!==void 0?e:!1}function L(r){return typeof r=="function"}function ri(r){var e=function(n){Error.call(n),n.stack=new Error().stack},t=r(e);return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var Yr=ri(function(r){return function(t){r(this),this.message=t?t.length+` errors occurred during unsubscription:
|
|
37
|
+
`+t.map(function(n,i){return i+1+") "+n.toString()}).join(`
|
|
38
|
+
`):"",this.name="UnsubscriptionError",this.errors=t}});function On(r,e){if(r){var t=r.indexOf(e);0<=t&&r.splice(t,1)}}var Ir=(function(){function r(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return r.prototype.unsubscribe=function(){var e,t,n,i,s;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var a=vr(o),c=a.next();!c.done;c=a.next()){var u=c.value;u.remove(this)}}catch(y){e={error:y}}finally{try{c&&!c.done&&(t=a.return)&&t.call(a)}finally{if(e)throw e.error}}else o.remove(this);var l=this.initialTeardown;if(L(l))try{l()}catch(y){s=y instanceof Yr?y.errors:[y]}var f=this._finalizers;if(f){this._finalizers=null;try{for(var h=vr(f),p=h.next();!p.done;p=h.next()){var d=p.value;try{qi(d)}catch(y){s=s??[],y instanceof Yr?s=wr(wr([],Sr(s)),Sr(y.errors)):s.push(y)}}}catch(y){n={error:y}}finally{try{p&&!p.done&&(i=h.return)&&i.call(h)}finally{if(n)throw n.error}}}if(s)throw new Yr(s)}},r.prototype.add=function(e){var t;if(e&&e!==this)if(this.closed)qi(e);else{if(e instanceof r){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(t=this._finalizers)!==null&&t!==void 0?t:[]).push(e)}},r.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},r.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},r.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&On(t,e)},r.prototype.remove=function(e){var t=this._finalizers;t&&On(t,e),e instanceof r&&e._removeParent(this)},r.EMPTY=(function(){var e=new r;return e.closed=!0,e})(),r})(),no=Ir.EMPTY;function io(r){return r instanceof Ir||r&&"closed"in r&&L(r.remove)&&L(r.add)&&L(r.unsubscribe)}function qi(r){L(r)?r():r.unsubscribe()}var mc={Promise:void 0},yc={setTimeout:function(r,e){for(var t=[],n=2;n<arguments.length;n++)t[n-2]=arguments[n];return setTimeout.apply(void 0,wr([r,e],Sr(t)))},clearTimeout:function(r){return clearTimeout(r)},delegate:void 0};function so(r){yc.setTimeout(function(){throw r})}function Li(){}function fr(r){r()}var ni=(function(r){it(e,r);function e(t){var n=r.call(this)||this;return n.isStopped=!1,t?(n.destination=t,io(t)&&t.add(n)):n.destination=vc,n}return e.create=function(t,n,i){return new Wt(t,n,i)},e.prototype.next=function(t){this.isStopped||this._next(t)},e.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,r.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){try{this.destination.error(t)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e})(Ir),bc=(function(){function r(e){this.partialObserver=e}return r.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(n){cr(n)}},r.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(n){cr(n)}else cr(e)},r.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(t){cr(t)}},r})(),Wt=(function(r){it(e,r);function e(t,n,i){var s=r.call(this)||this,o;return L(t)||!t?o={next:t??void 0,error:n??void 0,complete:i??void 0}:o=t,s.destination=new bc(o),s}return e})(ni);function cr(r){so(r)}function gc(r){throw r}var vc={closed:!0,next:Li,error:gc,complete:Li},ii=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})();function si(r){return r}function wc(r){return r.length===0?si:r.length===1?r[0]:function(t){return r.reduce(function(n,i){return i(n)},t)}}var z=(function(){function r(e){e&&(this._subscribe=e)}return r.prototype.lift=function(e){var t=new r;return t.source=this,t.operator=e,t},r.prototype.subscribe=function(e,t,n){var i=this,s=Ec(e)?e:new Wt(e,t,n);return fr(function(){var o=i,a=o.operator,c=o.source;s.add(a?a.call(s,c):c?i._subscribe(s):i._trySubscribe(s))}),s},r.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},r.prototype.forEach=function(e,t){var n=this;return t=Ui(t),new t(function(i,s){var o=new Wt({next:function(a){try{e(a)}catch(c){s(c),o.unsubscribe()}},error:s,complete:i});n.subscribe(o)})},r.prototype._subscribe=function(e){var t;return(t=this.source)===null||t===void 0?void 0:t.subscribe(e)},r.prototype[ii]=function(){return this},r.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return wc(e)(this)},r.prototype.toPromise=function(e){var t=this;return e=Ui(e),new e(function(n,i){var s;t.subscribe(function(o){return s=o},function(o){return i(o)},function(){return n(s)})})},r.create=function(e){return new r(e)},r})();function Ui(r){var e;return(e=r??mc.Promise)!==null&&e!==void 0?e:Promise}function Sc(r){return r&&L(r.next)&&L(r.error)&&L(r.complete)}function Ec(r){return r&&r instanceof ni||Sc(r)&&io(r)}function Oc(r){return L(r==null?void 0:r.lift)}function be(r){return function(e){if(Oc(e))return e.lift(function(t){try{return r(t,this)}catch(n){this.error(n)}});throw new TypeError("Unable to lift unknown Observable type")}}function Pe(r,e,t,n,i){return new Tc(r,e,t,n,i)}var Tc=(function(r){it(e,r);function e(t,n,i,s,o,a){var c=r.call(this,t)||this;return c.onFinalize=o,c.shouldUnsubscribe=a,c._next=n?function(u){try{n(u)}catch(l){t.error(l)}}:r.prototype._next,c._error=s?function(u){try{s(u)}catch(l){t.error(l)}finally{this.unsubscribe()}}:r.prototype._error,c._complete=i?function(){try{i()}catch(u){t.error(u)}finally{this.unsubscribe()}}:r.prototype._complete,c}return e.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;r.prototype.unsubscribe.call(this),!n&&((t=this.onFinalize)===null||t===void 0||t.call(this))}},e})(ni),kc=ri(function(r){return function(){r(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),Dt=(function(r){it(e,r);function e(){var t=r.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return e.prototype.lift=function(t){var n=new Vi(this,this);return n.operator=t,n},e.prototype._throwIfClosed=function(){if(this.closed)throw new kc},e.prototype.next=function(t){var n=this;fr(function(){var i,s;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var o=vr(n.currentObservers),a=o.next();!a.done;a=o.next()){var c=a.value;c.next(t)}}catch(u){i={error:u}}finally{try{a&&!a.done&&(s=o.return)&&s.call(o)}finally{if(i)throw i.error}}}})},e.prototype.error=function(t){var n=this;fr(function(){if(n._throwIfClosed(),!n.isStopped){n.hasError=n.isStopped=!0,n.thrownError=t;for(var i=n.observers;i.length;)i.shift().error(t)}})},e.prototype.complete=function(){var t=this;fr(function(){if(t._throwIfClosed(),!t.isStopped){t.isStopped=!0;for(var n=t.observers;n.length;)n.shift().complete()}})},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var t;return((t=this.observers)===null||t===void 0?void 0:t.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(t){return this._throwIfClosed(),r.prototype._trySubscribe.call(this,t)},e.prototype._subscribe=function(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)},e.prototype._innerSubscribe=function(t){var n=this,i=this,s=i.hasError,o=i.isStopped,a=i.observers;return s||o?no:(this.currentObservers=null,a.push(t),new Ir(function(){n.currentObservers=null,On(a,t)}))},e.prototype._checkFinalizedStatuses=function(t){var n=this,i=n.hasError,s=n.thrownError,o=n.isStopped;i?t.error(s):o&&t.complete()},e.prototype.asObservable=function(){var t=new z;return t.source=this,t},e.create=function(t,n){return new Vi(t,n)},e})(z),Vi=(function(r){it(e,r);function e(t,n){var i=r.call(this)||this;return i.destination=t,i.source=n,i}return e.prototype.next=function(t){var n,i;(i=(n=this.destination)===null||n===void 0?void 0:n.next)===null||i===void 0||i.call(n,t)},e.prototype.error=function(t){var n,i;(i=(n=this.destination)===null||n===void 0?void 0:n.error)===null||i===void 0||i.call(n,t)},e.prototype.complete=function(){var t,n;(n=(t=this.destination)===null||t===void 0?void 0:t.complete)===null||n===void 0||n.call(t)},e.prototype._subscribe=function(t){var n,i;return(i=(n=this.source)===null||n===void 0?void 0:n.subscribe(t))!==null&&i!==void 0?i:no},e})(Dt),Cc=(function(r){it(e,r);function e(t){var n=r.call(this)||this;return n._value=t,n}return Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),e.prototype._subscribe=function(t){var n=r.prototype._subscribe.call(this,t);return!n.closed&&t.next(this._value),n},e.prototype.getValue=function(){var t=this,n=t.hasError,i=t.thrownError,s=t._value;if(n)throw i;return this._throwIfClosed(),s},e.prototype.next=function(t){r.prototype.next.call(this,this._value=t)},e})(Dt),oo={now:function(){return(oo.delegate||Date).now()},delegate:void 0},Rc=(function(r){it(e,r);function e(t,n,i){t===void 0&&(t=1/0),n===void 0&&(n=1/0),i===void 0&&(i=oo);var s=r.call(this)||this;return s._bufferSize=t,s._windowTime=n,s._timestampProvider=i,s._buffer=[],s._infiniteTimeWindow=!0,s._infiniteTimeWindow=n===1/0,s._bufferSize=Math.max(1,t),s._windowTime=Math.max(1,n),s}return e.prototype.next=function(t){var n=this,i=n.isStopped,s=n._buffer,o=n._infiniteTimeWindow,a=n._timestampProvider,c=n._windowTime;i||(s.push(t),!o&&s.push(a.now()+c)),this._trimBuffer(),r.prototype.next.call(this,t)},e.prototype._subscribe=function(t){this._throwIfClosed(),this._trimBuffer();for(var n=this._innerSubscribe(t),i=this,s=i._infiniteTimeWindow,o=i._buffer,a=o.slice(),c=0;c<a.length&&!t.closed;c+=s?1:2)t.next(a[c]);return this._checkFinalizedStatuses(t),n},e.prototype._trimBuffer=function(){var t=this,n=t._bufferSize,i=t._timestampProvider,s=t._buffer,o=t._infiniteTimeWindow,a=(o?1:2)*n;if(n<1/0&&a<s.length&&s.splice(0,s.length-a),!o){for(var c=i.now(),u=0,l=1;l<s.length&&s[l]<=c;l+=2)u=l;u&&s.splice(0,u+1)}},e})(Dt),Er=new z(function(r){return r.complete()});function Fc(r){return r&&L(r.schedule)}function _c(r){return r[r.length-1]}function ao(r){return Fc(_c(r))?r.pop():void 0}var co=(function(r){return r&&typeof r.length=="number"&&typeof r!="function"});function uo(r){return L(r==null?void 0:r.then)}function lo(r){return L(r[ii])}function fo(r){return Symbol.asyncIterator&&L(r==null?void 0:r[Symbol.asyncIterator])}function ho(r){return new TypeError("You provided "+(r!==null&&typeof r=="object"?"an invalid object":"'"+r+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function Dc(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var po=Dc();function mo(r){return L(r==null?void 0:r[po])}function yo(r){return qa(this,arguments,function(){var t,n,i,s;return Gs(this,function(o){switch(o.label){case 0:t=r.getReader(),o.label=1;case 1:o.trys.push([1,,9,10]),o.label=2;case 2:return[4,Hr(t.read())];case 3:return n=o.sent(),i=n.value,s=n.done,s?[4,Hr(void 0)]:[3,5];case 4:return[2,o.sent()];case 5:return[4,Hr(i)];case 6:return[4,o.sent()];case 7:return o.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}})})}function bo(r){return L(r==null?void 0:r.getReader)}function xe(r){if(r instanceof z)return r;if(r!=null){if(lo(r))return Ic(r);if(co(r))return Nc(r);if(uo(r))return Pc(r);if(fo(r))return go(r);if(mo(r))return Ac(r);if(bo(r))return xc(r)}throw ho(r)}function Ic(r){return new z(function(e){var t=r[ii]();if(L(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function Nc(r){return new z(function(e){for(var t=0;t<r.length&&!e.closed;t++)e.next(r[t]);e.complete()})}function Pc(r){return new z(function(e){r.then(function(t){e.closed||(e.next(t),e.complete())},function(t){return e.error(t)}).then(null,so)})}function Ac(r){return new z(function(e){var t,n;try{for(var i=vr(r),s=i.next();!s.done;s=i.next()){var o=s.value;if(e.next(o),e.closed)return}}catch(a){t={error:a}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}e.complete()})}function go(r){return new z(function(e){Mc(r,e).catch(function(t){return e.error(t)})})}function xc(r){return go(yo(r))}function Mc(r,e){var t,n,i,s;return La(this,void 0,void 0,function(){var o,a;return Gs(this,function(c){switch(c.label){case 0:c.trys.push([0,5,6,11]),t=Ua(r),c.label=1;case 1:return[4,t.next()];case 2:if(n=c.sent(),!!n.done)return[3,4];if(o=n.value,e.next(o),e.closed)return[2];c.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return a=c.sent(),i={error:a},[3,11];case 6:return c.trys.push([6,,9,10]),n&&!n.done&&(s=t.return)?[4,s.call(t)]:[3,8];case 7:c.sent(),c.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return e.complete(),[2]}})})}function et(r,e,t,n,i){n===void 0&&(n=0),i===void 0&&(i=!1);var s=e.schedule(function(){t(),i?r.add(this.schedule(null,n)):this.unsubscribe()},n);if(r.add(s),!i)return s}function vo(r,e){return e===void 0&&(e=0),be(function(t,n){t.subscribe(Pe(n,function(i){return et(n,r,function(){return n.next(i)},e)},function(){return et(n,r,function(){return n.complete()},e)},function(i){return et(n,r,function(){return n.error(i)},e)}))})}function wo(r,e){return e===void 0&&(e=0),be(function(t,n){n.add(r.schedule(function(){return t.subscribe(n)},e))})}function jc(r,e){return xe(r).pipe(wo(e),vo(e))}function qc(r,e){return xe(r).pipe(wo(e),vo(e))}function Lc(r,e){return new z(function(t){var n=0;return e.schedule(function(){n===r.length?t.complete():(t.next(r[n++]),t.closed||this.schedule())})})}function Uc(r,e){return new z(function(t){var n;return et(t,e,function(){n=r[po](),et(t,e,function(){var i,s,o;try{i=n.next(),s=i.value,o=i.done}catch(a){t.error(a);return}o?t.complete():t.next(s)},0,!0)}),function(){return L(n==null?void 0:n.return)&&n.return()}})}function So(r,e){if(!r)throw new Error("Iterable cannot be null");return new z(function(t){et(t,e,function(){var n=r[Symbol.asyncIterator]();et(t,e,function(){n.next().then(function(i){i.done?t.complete():t.next(i.value)})},0,!0)})})}function Vc(r,e){return So(yo(r),e)}function Bc(r,e){if(r!=null){if(lo(r))return jc(r,e);if(co(r))return Lc(r,e);if(uo(r))return qc(r,e);if(fo(r))return So(r,e);if(mo(r))return Uc(r,e);if(bo(r))return Vc(r,e)}throw ho(r)}function Ue(r,e){return e?Bc(r,e):xe(r)}function Le(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var t=ao(r);return Ue(r,t)}function Eo(r,e){var t=L(r)?r:function(){return r},n=function(i){return i.error(t())};return new z(n)}var Bi;(function(r){r.NEXT="N",r.ERROR="E",r.COMPLETE="C"})(Bi||(Bi={}));var Kr=(function(){function r(e,t,n){this.kind=e,this.value=t,this.error=n,this.hasValue=e==="N"}return r.prototype.observe=function(e){return Qc(this,e)},r.prototype.do=function(e,t,n){var i=this,s=i.kind,o=i.value,a=i.error;return s==="N"?e==null?void 0:e(o):s==="E"?t==null?void 0:t(a):n==null?void 0:n()},r.prototype.accept=function(e,t,n){var i;return L((i=e)===null||i===void 0?void 0:i.next)?this.observe(e):this.do(e,t,n)},r.prototype.toObservable=function(){var e=this,t=e.kind,n=e.value,i=e.error,s=t==="N"?Le(n):t==="E"?Eo(function(){return i}):t==="C"?Er:0;if(!s)throw new TypeError("Unexpected notification kind "+t);return s},r.createNext=function(e){return new r("N",e)},r.createError=function(e){return new r("E",void 0,e)},r.createComplete=function(){return r.completeNotification},r.completeNotification=new r("C"),r})();function Qc(r,e){var t,n,i,s=r,o=s.kind,a=s.value,c=s.error;if(typeof o!="string")throw new TypeError('Invalid notification, missing "kind"');o==="N"?(t=e.next)===null||t===void 0||t.call(e,a):o==="E"?(n=e.error)===null||n===void 0||n.call(e,c):(i=e.complete)===null||i===void 0||i.call(e)}var zc=ri(function(r){return function(){r(this),this.name="EmptyError",this.message="no elements in sequence"}});function Wc(r,e){var t=typeof e=="object";return new Promise(function(n,i){var s=!1,o;r.subscribe({next:function(a){o=a,s=!0},error:i,complete:function(){s?n(o):t?n(e.defaultValue):i(new zc)}})})}function Qe(r,e){return be(function(t,n){var i=0;t.subscribe(Pe(n,function(s){n.next(r.call(e,s,i++))}))})}function $c(r,e,t,n,i,s,o,a){var c=[],u=0,l=0,f=!1,h=function(){f&&!c.length&&!u&&e.complete()},p=function(y){return u<n?d(y):c.push(y)},d=function(y){u++;var m=!1;xe(t(y,l++)).subscribe(Pe(e,function(b){e.next(b)},function(){m=!0},void 0,function(){if(m)try{u--;for(var b=function(){var S=c.shift();o||d(S)};c.length&&u<n;)b();h()}catch(S){e.error(S)}}))};return r.subscribe(Pe(e,p,function(){f=!0,h()})),function(){}}function at(r,e,t){return t===void 0&&(t=1/0),L(e)?at(function(n,i){return Qe(function(s,o){return e(n,s,i,o)})(xe(r(n,i)))},t):(typeof e=="number"&&(t=e),be(function(n,i){return $c(n,i,r,t)}))}function Hc(r){return at(si,r)}function Jc(){return Hc(1)}function Xr(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return Jc()(Ue(r,ao(r)))}function Gc(r,e){return be(function(t,n){var i=0;t.subscribe(Pe(n,function(s){return r.call(e,s,i++)&&n.next(s)}))})}function hr(r){return be(function(e,t){var n=null,i=!1,s;n=e.subscribe(Pe(t,void 0,void 0,function(o){s=xe(r(o,hr(r)(e))),n?(n.unsubscribe(),n=null,s.subscribe(t)):i=!0})),i&&(n.unsubscribe(),n=null,s.subscribe(t))})}function Yc(r){return be(function(e,t){try{e.subscribe(t)}finally{t.add(r)}})}function Kc(){return be(function(r,e){r.subscribe(Pe(e,function(t){e.next(Kr.createNext(t))},function(){e.next(Kr.createComplete()),e.complete()},function(t){e.next(Kr.createError(t)),e.complete()}))})}function Or(r){r===void 0&&(r={});var e=r.connector,t=e===void 0?function(){return new Dt}:e,n=r.resetOnError,i=n===void 0?!0:n,s=r.resetOnComplete,o=s===void 0?!0:s,a=r.resetOnRefCountZero,c=a===void 0?!0:a;return function(u){var l,f,h,p=0,d=!1,y=!1,m=function(){f==null||f.unsubscribe(),f=void 0},b=function(){m(),l=h=void 0,d=y=!1},S=function(){var O=l;b(),O==null||O.unsubscribe()};return be(function(O,E){p++,!y&&!d&&m();var k=h=h??t();E.add(function(){p--,p===0&&!y&&!d&&(f=Zr(S,c))}),k.subscribe(E),!l&&p>0&&(l=new Wt({next:function(M){return k.next(M)},error:function(M){y=!0,m(),f=Zr(b,i,M),k.error(M)},complete:function(){d=!0,m(),f=Zr(b,o),k.complete()}}),xe(O).subscribe(l))})(u)}}function Zr(r,e){for(var t=[],n=2;n<arguments.length;n++)t[n-2]=arguments[n];if(e===!0){r();return}if(e!==!1){var i=new Wt({next:function(){i.unsubscribe(),r()}});return xe(e.apply(void 0,wr([],Sr(t)))).subscribe(i)}}function Xc(r,e,t){var n,i,s,o,a=!1;return r&&typeof r=="object"?(n=r.bufferSize,o=n===void 0?1/0:n,i=r.windowTime,e=i===void 0?1/0:i,s=r.refCount,a=s===void 0?!1:s,t=r.scheduler):o=r??1/0,Or({connector:function(){return new Rc(o,e,t)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:a})}function Tr(r,e,t){var n=L(r)||e||t?{next:r,error:e,complete:t}:r;return n?be(function(i,s){var o;(o=n.subscribe)===null||o===void 0||o.call(n);var a=!0;i.subscribe(Pe(s,function(c){var u;(u=n.next)===null||u===void 0||u.call(n,c),s.next(c)},function(){var c;a=!1,(c=n.complete)===null||c===void 0||c.call(n),s.complete()},function(c){var u;a=!1,(u=n.error)===null||u===void 0||u.call(n,c),s.error(c)},function(){var c,u;a&&((c=n.unsubscribe)===null||c===void 0||c.call(n)),(u=n.finalize)===null||u===void 0||u.call(n)}))}):si}function Ot(r,e,t,n){if(t.kind===P.INT||t.kind===P.FLOAT)r[e.value]=Number(t.value);else if(t.kind===P.BOOLEAN||t.kind===P.STRING)r[e.value]=t.value;else if(t.kind===P.OBJECT){const i={};t.fields.map(s=>Ot(i,s.name,s.value,n)),r[e.value]=i}else if(t.kind===P.VARIABLE){const i=(n||{})[t.name.value];r[e.value]=i}else if(t.kind===P.LIST)r[e.value]=t.values.map(i=>{const s={};return Ot(s,e,i,n),s[e.value]});else if(t.kind===P.ENUM)r[e.value]=t.value;else if(t.kind===P.NULL)r[e.value]=null;else throw oe(19,e.value,t.kind)}function oi(r,e){if(r.arguments&&r.arguments.length){const t={};return r.arguments.forEach(({name:n,value:i})=>Ot(t,n,i,e)),t}return null}function Zc(){}class Tn{constructor(e=1/0,t=Zc){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:n,newer:i}=t;i&&(i.older=n),n&&(n.newer=i),t.older=this.newest,t.older.newer=t,t.newer=null,this.newest=t,t===this.oldest&&(this.oldest=i)}return t}set(e,t){let n=this.getNode(e);return n?n.value=t:(n={key:e,value:t,newer:null,older:this.newest},this.newest&&(this.newest.newer=n),this.newest=n,this.oldest=this.oldest||n,this.map.set(e,n),n.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):!1}}function kn(){}const eu=kn,tu=typeof WeakRef<"u"?WeakRef:function(r){return{deref:()=>r}},ru=typeof WeakMap<"u"?WeakMap:Map,nu=typeof FinalizationRegistry<"u"?FinalizationRegistry:function(){return{register:kn,unregister:kn}},iu=10024;class $t{constructor(e=1/0,t=eu){this.max=e,this.dispose=t,this.map=new ru,this.newest=null,this.oldest=null,this.unfinalizedNodes=new Set,this.finalizationScheduled=!1,this.size=0,this.finalize=()=>{const n=this.unfinalizedNodes.values();for(let i=0;i<iu;i++){const s=n.next().value;if(!s)break;this.unfinalizedNodes.delete(s);const o=s.key;delete s.key,s.keyRef=new tu(o),this.registry.register(o,s,s)}this.unfinalizedNodes.size>0?queueMicrotask(this.finalize):this.finalizationScheduled=!1},this.registry=new nu(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:n,newer:i}=t;i&&(i.older=n),n&&(n.newer=i),t.older=this.newest,t.older.newer=t,t.newer=null,this.newest=t,t===this.oldest&&(this.oldest=i)}return t}set(e,t){let n=this.getNode(e);return n?n.value=t:(n={key:e,value:t,newer:null,older:this.newest},this.newest&&(this.newest.newer=n),this.newest=n,this.oldest=this.oldest||n,this.scheduleFinalization(n),this.map.set(e,n),this.size++,n.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):!1}scheduleFinalization(e){this.unfinalizedNodes.add(e),this.finalizationScheduled||(this.finalizationScheduled=!0,queueMicrotask(this.finalize))}}const su=()=>Object.create(null),{forEach:ou,slice:Qi}=Array.prototype,{hasOwnProperty:au}=Object.prototype;class Me{constructor(e=!0,t=su){this.weakness=e,this.makeData=t}lookup(){return this.lookupArray(arguments)}lookupArray(e){let t=this;return ou.call(e,n=>t=t.getChildTrie(n)),au.call(t,"data")?t.data:t.data=this.makeData(Qi.call(e))}peek(){return this.peekArray(arguments)}peekArray(e){let t=this;for(let n=0,i=e.length;t&&n<i;++n){const s=t.mapFor(e[n],!1);t=s&&s.get(e[n])}return t&&t.data}remove(){return this.removeArray(arguments)}removeArray(e){let t;if(e.length){const n=e[0],i=this.mapFor(n,!1),s=i&&i.get(n);s&&(t=s.removeArray(Qi.call(e,1)),!s.data&&!s.weak&&!(s.strong&&s.strong.size)&&i.delete(n))}else t=this.data,delete this.data;return t}getChildTrie(e){const t=this.mapFor(e,!0);let n=t.get(e);return n||t.set(e,n=new Me(this.weakness,this.makeData)),n}mapFor(e,t){return this.weakness&&cu(e)?this.weak||(t?this.weak=new WeakMap:void 0):this.strong||(t?this.strong=new Map:void 0)}}function cu(r){switch(typeof r){case"object":if(r===null)break;case"function":return!0}return!1}let H=null;const zi={};let uu=1;const lu=()=>class{constructor(){this.id=["slot",uu++,Date.now(),Math.random().toString(36).slice(2)].join(":")}hasValue(){for(let e=H;e;e=e.parent)if(this.id in e.slots){const t=e.slots[this.id];if(t===zi)break;return e!==H&&(H.slots[this.id]=t),!0}return H&&(H.slots[this.id]=zi),!1}getValue(){if(this.hasValue())return H.slots[this.id]}withValue(e,t,n,i){const s={__proto__:null,[this.id]:e},o=H;H={parent:o,slots:s};try{return t.apply(i,n)}finally{H=o}}static bind(e){const t=H;return function(){const n=H;try{return H=t,e.apply(this,arguments)}finally{H=n}}}static noContext(e,t,n){if(H){const i=H;try{return H=null,e.apply(n,t)}finally{H=i}}else return e.apply(n,t)}};function Wi(r){try{return r()}catch{}}const en="@wry/context:Slot",fu=Wi(()=>globalThis)||Wi(()=>global)||Object.create(null),$i=fu,Nr=$i[en]||Array[en]||(function(r){try{Object.defineProperty($i,en,{value:r,enumerable:!1,writable:!1,configurable:!0})}finally{return r}})(lu()),{bind:ld,noContext:fd}=Nr,Pr=new Nr,{hasOwnProperty:hu}=Object.prototype,ai=Array.from||function(r){const e=[];return r.forEach(t=>e.push(t)),e};function ci(r){const{unsubscribe:e}=r;typeof e=="function"&&(r.unsubscribe=void 0,e())}const Ht=[],du=100;function Tt(r,e){if(!r)throw new Error(e||"assertion failure")}function Oo(r,e){const t=r.length;return t>0&&t===e.length&&r[t-1]===e[t-1]}function To(r){switch(r.length){case 0:throw new Error("unknown value");case 1:return r[0];case 2:throw r[1]}}function ko(r){return r.slice(0)}class Ar{constructor(e){this.fn=e,this.parents=new Set,this.childValues=new Map,this.dirtyChildren=null,this.dirty=!0,this.recomputing=!1,this.value=[],this.deps=null,++Ar.count}peek(){if(this.value.length===1&&!Ae(this))return Hi(this),this.value[0]}recompute(e){return Tt(!this.recomputing,"already recomputing"),Hi(this),Ae(this)?pu(this,e):To(this.value)}setDirty(){this.dirty||(this.dirty=!0,Co(this),ci(this))}dispose(){this.setDirty(),Io(this),ui(this,(e,t)=>{e.setDirty(),No(e,this)})}forget(){this.dispose()}dependOn(e){e.add(this),this.deps||(this.deps=Ht.pop()||new Set),this.deps.add(e)}forgetDeps(){this.deps&&(ai(this.deps).forEach(e=>e.delete(this)),this.deps.clear(),Ht.push(this.deps),this.deps=null)}}Ar.count=0;function Hi(r){const e=Pr.getValue();if(e)return r.parents.add(e),e.childValues.has(r)||e.childValues.set(r,[]),Ae(r)?Fo(e,r):_o(e,r),e}function pu(r,e){return Io(r),Pr.withValue(r,mu,[r,e]),bu(r,e)&&yu(r),To(r.value)}function mu(r,e){r.recomputing=!0;const{normalizeResult:t}=r;let n;t&&r.value.length===1&&(n=ko(r.value)),r.value.length=0;try{if(r.value[0]=r.fn.apply(null,e),t&&n&&!Oo(n,r.value))try{r.value[0]=t(r.value[0],n[0])}catch{}}catch(i){r.value[1]=i}r.recomputing=!1}function Ae(r){return r.dirty||!!(r.dirtyChildren&&r.dirtyChildren.size)}function yu(r){r.dirty=!1,!Ae(r)&&Ro(r)}function Co(r){ui(r,Fo)}function Ro(r){ui(r,_o)}function ui(r,e){const t=r.parents.size;if(t){const n=ai(r.parents);for(let i=0;i<t;++i)e(n[i],r)}}function Fo(r,e){Tt(r.childValues.has(e)),Tt(Ae(e));const t=!Ae(r);if(!r.dirtyChildren)r.dirtyChildren=Ht.pop()||new Set;else if(r.dirtyChildren.has(e))return;r.dirtyChildren.add(e),t&&Co(r)}function _o(r,e){Tt(r.childValues.has(e)),Tt(!Ae(e));const t=r.childValues.get(e);t.length===0?r.childValues.set(e,ko(e.value)):Oo(t,e.value)||r.setDirty(),Do(r,e),!Ae(r)&&Ro(r)}function Do(r,e){const t=r.dirtyChildren;t&&(t.delete(e),t.size===0&&(Ht.length<du&&Ht.push(t),r.dirtyChildren=null))}function Io(r){r.childValues.size>0&&r.childValues.forEach((e,t)=>{No(r,t)}),r.forgetDeps(),Tt(r.dirtyChildren===null)}function No(r,e){e.parents.delete(r),r.childValues.delete(e),Do(r,e)}function bu(r,e){if(typeof r.subscribe=="function")try{ci(r),r.unsubscribe=r.subscribe.apply(null,e)}catch{return r.setDirty(),!1}return!0}const gu={setDirty:!0,dispose:!0,forget:!0};function Po(r){const e=new Map;function t(n){const i=Pr.getValue();if(i){let s=e.get(n);s||e.set(n,s=new Set),i.dependOn(s)}}return t.dirty=function(i,s){const o=e.get(i);if(o){const a=s&&hu.call(gu,s)?s:"setDirty";ai(o).forEach(c=>c[a]()),e.delete(i),ci(o)}},t}let Ji;function vu(...r){return(Ji||(Ji=new Me(typeof WeakMap=="function"))).lookupArray(r)}const tn=new Set;function kt(r,{max:e=Math.pow(2,16),keyArgs:t,makeCacheKey:n=vu,normalizeResult:i,subscribe:s,cache:o=Tn}=Object.create(null)){const a=typeof o=="function"?new o(e,h=>h.dispose()):o,c=function(){const h=n.apply(null,t?t.apply(null,arguments):arguments);if(h===void 0)return r.apply(null,arguments);let p=a.get(h);p||(a.set(h,p=new Ar(r)),p.normalizeResult=i,p.subscribe=s,p.forget=()=>a.delete(h));const d=p.recompute(Array.prototype.slice.call(arguments));return a.set(h,p),tn.add(a),Pr.hasValue()||(tn.forEach(y=>y.clean()),tn.clear()),d};Object.defineProperty(c,"size",{get:()=>a.size,configurable:!1,enumerable:!1}),Object.freeze(c.options={max:e,keyArgs:t,makeCacheKey:n,normalizeResult:i,subscribe:s,cache:a});function u(h){const p=h&&a.get(h);p&&p.setDirty()}c.dirtyKey=u,c.dirty=function(){u(n.apply(null,arguments))};function l(h){const p=h&&a.get(h);if(p)return p.peek()}c.peekKey=l,c.peek=function(){return l(n.apply(null,arguments))};function f(h){return h?a.delete(h):!1}return c.forgetKey=f,c.forget=function(){return f(n.apply(null,arguments))},c.makeCacheKey=n,c.getKey=t?function(){return n.apply(null,t.apply(null,arguments))}:n,Object.freeze(c)}const wu=Symbol.for("apollo.cacheSize"),Se={...gn[wu]};function Ct(r,e){var t;return((t=r.definitions.find(n=>n.kind==="OperationDefinition"&&!!n.name))==null?void 0:t.name.value)??e}const Ie=kt((r,e)=>{I(r&&r.kind==="Document",1);const t=r.definitions.filter(n=>n.kind==="OperationDefinition");e&&I(t.length==1&&t[0].operation===e,4,e,e,t[0].operation),ye(r,{Field(n,i,s,o){var a;if(n.alias&&(n.alias.value==="__typename"||n.alias.value.startsWith("__ac_"))&&n.alias.value!==n.name.value){let c=r,u=[];for(const l of o)c=c[l],c.kind===P.FIELD&&u.push(((a=c.alias)==null?void 0:a.value)||c.name.value);throw u.splice(-1,1,n.name.value),oe(5,n.alias.value,u.join("."),t[0].operation,Ct(r,"(anonymous)"))}}})},{max:Se.checkDocument||2e3,cache:$t});function se(...r){const e={};return r.forEach(t=>{t&&Object.keys(t).forEach(n=>{const i=t[n];i!==void 0&&(e[n]=i)})}),e}function Xt(r=[]){const e={};return r.forEach(t=>{e[t.name.value]=t}),e}function X(r){return r!==null&&typeof r=="object"}const{hasOwnProperty:Su}=Object.prototype,Eu=function(r,e,t){return this.merge(r[t],e[t])};class Rt{constructor(e=Eu){v(this,"reconciler");v(this,"isObject",X);v(this,"pastCopies",new Set);this.reconciler=e}merge(e,t,...n){return X(t)&&X(e)?(Object.keys(t).forEach(i=>{if(Su.call(e,i)){const s=e[i];if(t[i]!==s){const o=this.reconciler(e,t,i,...n);o!==s&&(e=this.shallowCopyForMerge(e),e[i]=o)}}else e=this.shallowCopyForMerge(e),e[i]=t[i]}),e):t}shallowCopyForMerge(e){return X(e)&&(this.pastCopies.has(e)||(Array.isArray(e)?e=e.slice(0):e={__proto__:Object.getPrototypeOf(e),...e},this.pastCopies.add(e))),e}}function li(r){const e={},t=r&&r.variableDefinitions;return t&&t.length&&t.forEach(n=>{n.defaultValue&&Ot(e,n.variable.name,n.defaultValue)}),e}function xr(r,e){switch(r.kind){case"InlineFragment":return r;case"FragmentSpread":{const t=r.name.value;if(typeof e=="function")return e(t);const n=e&&e[t];return I(n,9,t),n||null}default:return null}}function Ou(r,e){let t=e;const n=[];return r.definitions.forEach(s=>{if(s.kind==="OperationDefinition")throw oe(10,s.operation,s.name?` named '${s.name.value}'`:"");s.kind==="FragmentDefinition"&&n.push(s)}),typeof t>"u"&&(I(n.length===1,11,n.length),t=n[0].name.value),{...r,definitions:[{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:t}}]}},...r.definitions]}}function Tu(r){I(r.kind==="Document",6),I(r.definitions.length<=1,7);const e=r.definitions[0];return I(e.kind==="FragmentDefinition",8),e}function Zt(r){return r.definitions.filter(e=>e.kind==="FragmentDefinition")}function Ao(r){Ie(r);let e;for(let t of r.definitions){if(t.kind==="OperationDefinition")return t;t.kind==="FragmentDefinition"&&!e&&(e=t)}if(e)return e;throw oe(12)}function Ee(r){return Ie(r),r.definitions.filter(e=>e.kind==="OperationDefinition")[0]}function ku(r){const e=Ee(r);return I(e&&e.operation==="query",13),e}const rn=new WeakSet;function xo(r){r.size<=(r.max||-1)||rn.has(r)||(rn.add(r),setTimeout(()=>{r.clean(),rn.delete(r)},100))}const Mo=function(r,e){const t=new $t(r,e);return t.set=function(n,i){const s=$t.prototype.set.call(this,n,i);return xo(this),s},t},Cu=function(r,e){const t=new Tn(r,e);return t.set=function(n,i){const s=Tn.prototype.set.call(this,n,i);return xo(this),s},t},Ne=Object.assign(function(e){return JSON.stringify(e,Ru)},{reset(){jt=new Cu(Se.canonicalStringify||1e3)}});let jt;Ne.reset();function Ru(r,e){if(e&&typeof e=="object"){const t=Object.getPrototypeOf(e);if(t===Object.prototype||t===null){const n=Object.keys(e);if(n.every(Fu))return e;const i=JSON.stringify(n);let s=jt.get(i);if(!s){n.sort();const a=JSON.stringify(n);s=jt.get(a)||n,jt.set(i,s),jt.set(a,s)}const o=Object.create(t);return s.forEach(a=>{o[a]=e[a]}),o}}return e}function Fu(r,e,t){return e===0||t[e-1]<=r}const _u=["connection","include","skip","client","rest","export","nonreactive"];let At=Ne;const jo=Object.assign(function(r,e,t){if(e&&t&&t.connection&&t.connection.key){if(t.connection.filter&&t.connection.filter.length>0){const i=t.connection.filter?t.connection.filter:[];i.sort();const s={};i.forEach(a=>{s[a]=e[a]});const o=At(s);if(o!=="{}")return`${t.connection.key}(${o})`}return t.connection.key}let n=r;if(e){const i=At(e);i!=="{}"&&(n+=`(${i})`)}return t&&Object.keys(t).forEach(i=>{_u.indexOf(i)===-1&&(t[i]&&Object.keys(t[i]).length?n+=`@${i}(${At(t[i])})`:n+=`@${i}`)}),n},{setStringify(r){const e=At;return At=r,e}});function ct(r){var e;return!!((e=r.errors)!=null&&e.length)}function qt(r,e,t){const n=new Set(r),i=n.size;return ye(e,{Directive(s){if(n.delete(s.name.value)&&(!t||!n.size))return ti}}),t?!n.size:n.size<i}function Du(r){let e=!1;return ye(r,{Directive:{enter(t){if(t.name.value==="client"&&t.arguments&&(e=t.arguments.some(n=>n.name.value==="always"&&n.value.kind==="BooleanValue"&&n.value.value===!0),e))return ti}}}),e}const Q=Array.isArray;function Iu(r){return X(r)&&r.kind==="Document"&&Array.isArray(r.definitions)}function er(r){return r.kind==="Field"}function fi(r){return Array.isArray(r)&&r.length>0}function ft(r){return{__ref:String(r)}}function Nu(r){let e=r[0]||{};const t=r.length;if(t>1){const n=new Rt;for(let i=1;i<t;++i)e=n.merge(e,r[i])}return e}function nn(r,e){return se(r,e,e.variables&&{variables:se({...r&&r.variables,...e.variables})})}function Pu(r){return r.catch(()=>{}),r}function Au(r,e){Ie(e);const t=Gi(""),n=Gi(""),i=m=>{for(let b=0,S;b<m.length&&(S=m[b]);++b)if(!Q(S)){if(S.kind===P.OPERATION_DEFINITION)return t(S.name&&S.name.value);if(S.kind===P.FRAGMENT_DEFINITION)return n(S.name.value)}return I.error(14),null};let s=0;for(let m=e.definitions.length-1;m>=0;--m)e.definitions[m].kind===P.OPERATION_DEFINITION&&++s;const o=xu(r),a=m=>fi(m)&&m.map(o).some(b=>b&&b.remove),c=new Map;let u=!1;const l={enter(m){if(a(m.directives))return u=!0,null}},f=ye(e,{Field:l,InlineFragment:l,VariableDefinition:{enter(){return!1}},Variable:{enter(m,b,S,O,E){const k=i(E);k&&k.variables.add(m.name.value)}},FragmentSpread:{enter(m,b,S,O,E){if(a(m.directives))return u=!0,null;const k=i(E);k&&k.fragmentSpreads.add(m.name.value)}},FragmentDefinition:{enter(m,b,S,O){c.set(JSON.stringify(O),m)},leave(m,b,S,O){const E=c.get(JSON.stringify(O));if(m===E)return m;if(s>0&&m.selectionSet.selections.every(k=>k.kind===P.FIELD&&k.name.value==="__typename"))return n(m.name.value).removed=!0,u=!0,null}},Directive:{leave(m){if(o(m))return u=!0,null}}});if(!u)return e;const h=m=>(m.transitiveVars||(m.transitiveVars=new Set(m.variables),m.removed||m.fragmentSpreads.forEach(b=>{h(n(b)).transitiveVars.forEach(S=>{m.transitiveVars.add(S)})})),m),p=new Set;f.definitions.forEach(m=>{m.kind===P.OPERATION_DEFINITION?h(t(m.name&&m.name.value)).fragmentSpreads.forEach(b=>{p.add(b)}):m.kind===P.FRAGMENT_DEFINITION&&s===0&&!n(m.name.value).removed&&p.add(m.name.value)}),p.forEach(m=>{h(n(m)).fragmentSpreads.forEach(b=>{p.add(b)})});const d=m=>!!(!p.has(m)||n(m).removed),y={enter(m){if(d(m.name.value))return null}};return Mu(ye(f,{FragmentSpread:y,FragmentDefinition:y,OperationDefinition:{leave(m){if(m.variableDefinitions){const b=h(t(m.name&&m.name.value)).transitiveVars;if(b.size<m.variableDefinitions.length)return{...m,variableDefinitions:m.variableDefinitions.filter(S=>b.has(S.variable.name.value))}}}}}))}function Gi(r){const e=new Map;return function(n=r){let i=e.get(n);return i||e.set(n,i={variables:new Set,fragmentSpreads:new Set}),i}}function xu(r){const e=new Map,t=new Map;return r.forEach(n=>{n&&(n.name?e.set(n.name,n):n.test&&t.set(n.test,n))}),n=>{let i=e.get(n.name.value);return!i&&t.size&&t.forEach((s,o)=>{o(n)&&(i=s)}),i}}function qo(r,e){return!r||r.selectionSet.selections.every(t=>t.kind===P.FRAGMENT_SPREAD&&qo(e[t.name.value],e))}function Mu(r){return qo(Ee(r)||Tu(r),Xt(Zt(r)))?null:r}function ju(r){return ye(r,{FragmentSpread(e){var t;if(!((t=e.directives)!=null&&t.some(({name:n})=>n.value==="unmask")))return null}})}function It(r){return r.alias?r.alias.value:r.name.value}function Mr({directives:r},e){return!r||!r.length?!0:Lu(r).every(({directive:t,ifArgument:n})=>{let i=!1;return n.value.kind==="Variable"?(i=e&&e[n.value.name.value],I(i!==void 0,15,t.name.value)):i=n.value.value,t.name.value==="skip"?!i:i})}function qu({name:{value:r}}){return r==="skip"||r==="include"}function Lu(r){const e=[];return r&&r.length&&r.forEach(t=>{if(!qu(t))return;const n=t.arguments,i=t.name.value;I(n&&n.length===1,16,i);const s=n[0];I(s.name&&s.name.value==="if",17,i);const o=s.value;I(o&&(o.kind==="Variable"||o.kind==="BooleanValue"),18,i),e.push({directive:t,ifArgument:s})}),e}function Uu(r,e){let t=null;r.directives&&(t={},r.directives.forEach(i=>{t[i.name.value]={},i.arguments&&i.arguments.forEach(({name:s,value:o})=>Ot(t[i.name.value],s,o,e))}));let n=null;return r.arguments&&r.arguments.length&&(n={},r.arguments.forEach(({name:i,value:s})=>Ot(n,i,s,e))),jo(r.name.value,n,t)}function dr(r){const e={data:r.data};return r.error&&(e.error=r.error),e}function Cn(r,e=()=>{}){return t=>new z(n=>{let i=e();return t.subscribe({next(s){let o;try{o=r(s,i)}catch(a){n.error(a)}o!==void 0&&n.next(o)},error(s){n.error(s)},complete(){n.complete()}})})}function Lo(r,{data:e,...t},{data:n,...i},s){return B(t,i)&&pr(Ao(r).selectionSet,e,n,{fragmentMap:Xt(Zt(r)),variables:s})}function pr(r,e,t,n){if(e===t)return!0;const i=new Set;return r.selections.every(s=>{if(i.has(s)||(i.add(s),!Mr(s,n.variables))||Yi(s))return!0;if(er(s)){const o=It(s),a=e&&e[o],c=t&&t[o],u=s.selectionSet;if(!u)return B(a,c);const l=Array.isArray(a),f=Array.isArray(c);if(l!==f)return!1;if(l&&f){const h=a.length;if(c.length!==h)return!1;for(let p=0;p<h;++p)if(!pr(u,a[p],c[p],n))return!1;return!0}return pr(u,a,c,n)}else{const o=xr(s,n.fragmentMap);if(o)return Yi(o)?!0:pr(o.selectionSet,e,t,n)}})}function Yi(r){return!!r.directives&&r.directives.some(Vu)}function Vu(r){return r.name.value==="nonreactive"}class Bu{constructor(){v(this,"startRequest")}isIncrementalResult(e){return!1}prepareRequest(e){return I(!qt(["defer"],e.query),64),e}extractErrors(){}}function Qu(r,{client:e}){const t={query:r.query,variables:r.variables||{},extensions:r.extensions||{},operationName:Ct(r.query),operationType:Ee(r.query).operation};let n={...r.context};const i=o=>{typeof o=="function"?n={...n,...o(s())}:n={...n,...o}},s=()=>Object.freeze({...n});return Object.defineProperty(t,"setContext",{enumerable:!1,value:i}),Object.defineProperty(t,"getContext",{enumerable:!1,value:s}),Object.defineProperty(t,"client",{enumerable:!1,value:e}),t}function zu(r,e){const t={...r},n=new Set(Object.keys(r));return ye(e,{Variable(i,s,o){o&&o.kind!=="VariableDefinition"&&n.delete(i.name.value)}}),n.forEach(i=>{delete t[i]}),t}class te{constructor(e){v(this,"left");v(this,"right");e&&(this.request=e)}static empty(){return new te(()=>Er)}static from(e){if(e.length===0)return te.empty();const[t,...n]=e;return t.concat(...n)}static split(e,t,n=new te((i,s)=>s(i))){const i=new te((s,o)=>e(s)?t.request(s,o):n.request(s,o));return Object.assign(i,{left:t,right:n})}static execute(e,t,n){return e.request(Qu(t,n),()=>Er)}static concat(...e){return te.from(e)}split(e,t,n){return this.concat(te.split(e,t,n))}concat(...e){return e.length===0?this:e.reduce(this.combine.bind(this),this)}combine(e,t){const n=new te((i,s)=>e.request(i,o=>t.request(o,s)));return Object.assign(n,{left:e,right:t})}request(e,t){throw oe(63)}}const Rn=te.execute;function Wu(r){return r}class we{constructor(e,t={}){v(this,"transform");v(this,"cached");v(this,"resultCache",new WeakSet);v(this,"left");v(this,"right");this.transform=e,t.getCacheKey&&(this.getCacheKey=t.getCacheKey),this.cached=t.cache!==!1,this.resetCache()}getCacheKey(e){return[e]}static identity(){return new we(Wu,{cache:!1})}static split(e,t,n=we.identity()){return Object.assign(new we(i=>(e(i)?t:n).transformDocument(i),{cache:!1}),{left:t,right:n})}resetCache(){if(this.cached){const e=new Me;this.performWork=kt(we.prototype.performWork.bind(this),{makeCacheKey:t=>{const n=this.getCacheKey(t);if(n)return I(Array.isArray(n),20),e.lookupArray(n)},max:Se["documentTransform.cache"],cache:$t})}}performWork(e){return Ie(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 we(t=>e.transformDocument(this.transformDocument(t)),{cache:!1}),{left:this,right:e})}}let sn;const ht=Object.assign(r=>{let e=sn.get(r);return e||(e=hc(r),sn.set(r,e)),e},{reset(){sn=new Mo(Se.print||2e3)}});ht.reset();function q(r){return!!(r&&typeof r=="object"&&typeof r.__ref=="string")}const Ki={kind:P.FIELD,name:{kind:P.NAME,value:"__typename"}},Uo=Object.assign(function(r){return ye(r,{SelectionSet:{enter(e,t,n){if(n&&n.kind===P.OPERATION_DEFINITION)return;const{selections:i}=e;if(!i||i.some(a=>a.kind===P.FIELD&&(a.name.value==="__typename"||a.name.value.lastIndexOf("__",0)===0)))return;const o=n;if(!(o.kind===P.FIELD&&o.directives&&o.directives.some(a=>a.name.value==="export")))return{...e,selections:[...i,Ki]}}}})},{added(r){return r===Ki}});function Vo(r,e){var t;return((t=Ee(r))==null?void 0:t.operation)===e}function $u(r){return Vo(r,"mutation")}function Hu(r){return Vo(r,"subscription")}function Ju(r){return r===7||r===8}function Fn(r){return!Ju(r)}class Gu{constructor(){v(this,"assumeImmutableResults",!1);v(this,"getFragmentDoc",kt(Ou,{max:Se["cache.fragmentQueryDocuments"]||1e3,cache:$t}))}lookupFragment(e){return null}batch(e){const t=typeof e.optimistic=="string"?e.optimistic:e.optimistic===!1?null:void 0;let n;return this.performTransaction(()=>n=e.update(this),t),n}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})}watchFragment(e){const{fragment:t,fragmentName:n,from:i,optimistic:s=!0,...o}=e,a=this.getFragmentDoc(t,n),c=typeof i>"u"||typeof i=="string"?i:this.identify(i),u={...o,returnPartialData:!0,id:c,query:a,optimistic:s};let l;return new z(f=>this.watch({...u,immediate:!0,callback:h=>{let p=h.result;if(p===null&&(p={}),l&&Lo(a,{data:l.result},{data:p},e.variables))return;const d={data:p,dataState:h.complete?"complete":"partial",complete:!!h.complete};h.missing&&(d.missing=h.missing.missing),l={...h,result:p},f.next(d)}}))}readFragment(e,t=!!e.optimistic){return this.read({...e,query:this.getFragmentDoc(e.fragment,e.fragmentName),rootId:e.id,optimistic:t})}writeQuery({id:e,data:t,...n}){return this.write(Object.assign(n,{dataId:e||"ROOT_QUERY",result:t}))}writeFragment({id:e,data:t,fragment:n,fragmentName:i,...s}){return this.write(Object.assign(s,{query:this.getFragmentDoc(n,i),dataId:e,result:t}))}updateQuery(e,t){return this.batch({update(n){const i=n.readQuery(e),s=t(i);return s==null?i:(n.writeQuery({...e,data:s}),s)}})}updateFragment(e,t){return this.batch({update(n){const i=n.readFragment(e),s=t(i);return s==null?i:(n.writeFragment({...e,data:s}),s)}})}}class hi extends Error{constructor(t,n,i,s){super(t);v(this,"message");v(this,"path");v(this,"query");v(this,"variables");v(this,"missing");if(this.message=t,this.path=n,this.query=i,this.variables=s,this.name="MissingFieldError",Array.isArray(this.path)){this.missing=this.message;for(let o=this.path.length-1;o>=0;--o)this.missing={[this.path[o]]:this.missing}}else this.missing=this.path;this.__proto__=hi.prototype}}const{hasOwnProperty:$}=Object.prototype;function Bo({__typename:r,id:e,_id:t},n){if(typeof r=="string"&&(n&&(n.keyObject=e!=null?{id:e}:t!=null?{_id:t}:void 0),e==null&&t!=null&&(e=t),e!=null))return`${r}:${typeof e=="number"||typeof e=="string"?e:JSON.stringify(e)}`}const Yu={dataIdFromObject:Bo,resultCaching:!0};function Ku(r){return se(Yu,r)}const Qo=/^[_a-z][_0-9a-z]*/i;function Ft(r){const e=r.match(Qo);return e?e[0]:r}function _n(r,e,t){return X(e)?Q(e)?e.every(n=>_n(r,n,t)):r.selections.every(n=>{if(er(n)&&Mr(n,t)){const i=It(n);return $.call(e,i)&&(!n.selectionSet||_n(n.selectionSet,e[i],t))}return!0}):!1}function ut(r){return X(r)&&!q(r)&&!Q(r)}function Xu(){return new Rt}function zo(r,e){const t=Xt(Zt(r));return{fragmentMap:t,lookupFragment(n){let i=t[n];return!i&&e&&(i=e.lookup(n)),i||null}}}const mr={},on=()=>mr,Xi={};class jr{constructor(e,t){v(this,"policies");v(this,"group");v(this,"data",{});v(this,"rootIds",{});v(this,"refs",{});v(this,"getFieldValue",(e,t)=>q(e)?this.get(e.__ref,t):e&&e[t]);v(this,"canRead",e=>q(e)?this.has(e.__ref):typeof e=="object");v(this,"toReference",(e,t)=>{if(typeof e=="string")return ft(e);if(q(e))return e;const[n]=this.policies.identify(e);if(n){const i=ft(n);return t&&this.merge(n,e),i}});this.policies=e,this.group=t}toObject(){return{...this.data}}has(e){return this.lookup(e,!0)!==void 0}get(e,t){if(this.group.depend(e,t),$.call(this.data,e)){const n=this.data[e];if(n&&$.call(n,t))return n[t]}if(t==="__typename"&&$.call(this.policies.rootTypenamesById,e))return this.policies.rootTypenamesById[e];if(this instanceof me)return this.parent.get(e,t)}lookup(e,t){if(t&&this.group.depend(e,"__exists"),$.call(this.data,e))return this.data[e];if(this instanceof me)return this.parent.lookup(e,t);if(this.policies.rootTypenamesById[e])return{}}merge(e,t){let n;q(e)&&(e=e.__ref),q(t)&&(t=t.__ref);const i=typeof e=="string"?this.lookup(n=e):e,s=typeof t=="string"?this.lookup(n=t):t;if(!s)return;I(typeof n=="string",95);const o=new Rt(tl).merge(i,s);if(this.data[n]=o,o!==i&&(delete this.refs[n],this.group.caching)){const a={};i||(a.__exists=1),Object.keys(s).forEach(c=>{if(!i||i[c]!==o[c]){a[c]=1;const u=Ft(c);u!==c&&!this.policies.hasKeyArgs(o.__typename,u)&&(a[u]=1),o[c]===void 0&&!(this instanceof me)&&delete o[c]}}),a.__typename&&!(i&&i.__typename)&&this.policies.rootTypenamesById[n]===o.__typename&&delete a.__typename,Object.keys(a).forEach(c=>this.group.dirty(n,c))}}modify(e,t,n){const i=this.lookup(e);if(i){const s={};let o=!1,a=!0;const c={DELETE:mr,INVALIDATE:Xi,isReference:q,toReference:this.toReference,canRead:this.canRead,readField:(u,l)=>this.policies.readField(typeof u=="string"?{fieldName:u,from:l||ft(e)}:u,{store:this})};if(Object.keys(i).forEach(u=>{const l=Ft(u);let f=i[u];if(f===void 0)return;const h=typeof t=="function"?t:t[u]||(n?void 0:t[l]);if(h){let p=h===on?mr:h(f,{...c,fieldName:l,storeFieldName:u,storage:this.getStorage(e,u)});p===Xi?this.group.dirty(e,u):(p===mr&&(p=void 0),p!==f&&(s[u]=p,o=!0,f=p))}f!==void 0&&(a=!1)}),o)return this.merge(e,s),a&&(this instanceof me?this.data[e]=void 0:delete this.data[e],this.group.dirty(e,"__exists")),!0}return!1}delete(e,t,n){const i=this.lookup(e);if(i){const s=this.getFieldValue(i,"__typename"),o=t&&n?this.policies.getStoreFieldName({typename:s,fieldName:t,args:n}):t;return this.modify(e,o?{[o]:on}:on,!!n)}return!1}evict(e,t){let n=!1;return e.id&&($.call(this.data,e.id)&&(n=this.delete(e.id,e.fieldName,e.args)),this instanceof me&&this!==t&&(n=this.parent.evict(e,t)||n),(e.fieldName||n)&&this.group.dirty(e.id,e.fieldName||"__exists")),n}clear(){this.replace(null)}extract(){const e=this.toObject(),t=[];return this.getRootIdSet().forEach(n=>{$.call(this.policies.rootTypenamesById,n)||t.push(n)}),t.length&&(e.__META={extraRootIds:t.sort()}),e}replace(e){if(Object.keys(this.data).forEach(t=>{e&&$.call(e,t)||this.delete(t)}),e){const{__META:t,...n}=e;Object.keys(n).forEach(i=>{this.merge(i,n[i])}),t&&t.extraRootIds.forEach(this.retain,this)}}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 me?this.parent.getRootIdSet(e):Object.keys(this.policies.rootTypenamesById).forEach(e.add,e),e}gc(){const e=this.getRootIdSet(),t=this.toObject();e.forEach(i=>{$.call(t,i)&&(Object.keys(this.findChildRefIds(i)).forEach(e.add,e),delete t[i])});const n=Object.keys(t);if(n.length){let i=this;for(;i instanceof me;)i=i.parent;n.forEach(s=>i.delete(s))}return n}findChildRefIds(e){if(!$.call(this.refs,e)){const t=this.refs[e]={},n=this.data[e];if(!n)return t;const i=new Set([n]);i.forEach(s=>{q(s)&&(t[s.__ref]=!0),X(s)&&Object.keys(s).forEach(o=>{const a=s[o];X(a)&&i.add(a)})})}return this.refs[e]}makeCacheKey(){return this.group.keyMaker.lookupArray(arguments)}get supportsResultCaching(){return this.group.caching}}class Wo{constructor(e,t=null){v(this,"caching");v(this,"parent");v(this,"d",null);v(this,"keyMaker");this.caching=e,this.parent=t,this.resetCaching()}resetCaching(){this.d=this.caching?Po():null,this.keyMaker=new Me}depend(e,t){if(this.d){this.d(an(e,t));const n=Ft(t);n!==t&&this.d(an(e,n)),this.parent&&this.parent.depend(e,t)}}dirty(e,t){this.d&&this.d.dirty(an(e,t),t==="__exists"?"forget":"setDirty")}}function an(r,e){return e+"#"+r}function Zi(r,e){Vt(r)&&r.group.depend(e,"__exists")}class Zu extends jr{constructor({policies:t,resultCaching:n=!0,seed:i}){super(t,new Wo(n));v(this,"stump",new el(this));v(this,"storageTrie",new Me);i&&this.replace(i)}addLayer(t,n){return this.stump.addLayer(t,n)}removeLayer(){return this}getStorage(){return this.storageTrie.lookupArray(arguments)}}jr.Root=Zu;class me extends jr{constructor(t,n,i,s){super(n.policies,s);v(this,"id");v(this,"parent");v(this,"replay");v(this,"group");this.id=t,this.parent=n,this.replay=i,this.group=s,i(this)}addLayer(t,n){return new me(t,this,n,this.group)}removeLayer(t){const n=this.parent.removeLayer(t);return t===this.id?(this.group.caching&&Object.keys(this.data).forEach(i=>{const s=this.data[i],o=n.lookup(i);o?s?s!==o&&Object.keys(s).forEach(a=>{B(s[a],o[a])||this.group.dirty(i,a)}):(this.group.dirty(i,"__exists"),Object.keys(o).forEach(a=>{this.group.dirty(i,a)})):this.delete(i)}),n):n===this.parent?this:n.addLayer(this.id,this.replay)}toObject(){return{...this.parent.toObject(),...this.data}}findChildRefIds(t){const n=this.parent.findChildRefIds(t);return $.call(this.data,t)?{...n,...super.findChildRefIds(t)}:n}getStorage(...t){let n=this.parent;for(;n.parent;)n=n.parent;return n.getStorage(...t)}}class el extends me{constructor(e){super("EntityStore.Stump",e,()=>{},new Wo(e.group.caching,e.group))}removeLayer(){return this}merge(e,t){return this.parent.merge(e,t)}}function tl(r,e,t){const n=r[t],i=e[t];return B(n,i)?n:i}function Vt(r){return!!(r&&r.supportsResultCaching)}const $o=new Nr;function rl(r){var n,i;const e=(n=r.directives)==null?void 0:n.find(({name:s})=>s.value==="unmask");if(!e)return"mask";const t=(i=e.arguments)==null?void 0:i.find(({name:s})=>s.value==="mode");return t&&"value"in t.value&&t.value.value==="migrate"?"migrate":"unmask"}function Ho(r,e,t){return $o.withValue(!0,()=>Lt(r,e,t,!1))}function nl(r,e){if(e.has(r))return e.get(r);const t=Array.isArray(r)?[]:{};return e.set(r,t),t}function Lt(r,e,t,n,i){const{knownChanged:s}=t,o=nl(r,t.mutableTargets);if(Array.isArray(r)){for(const[a,c]of Array.from(r.entries())){if(c===null){o[a]=null;continue}const u=Lt(c,e,t,n);s.has(u)&&s.add(o),o[a]=u}return s.has(o)?o:r}for(const a of e.selections){let c;if(n&&s.add(o),a.kind===P.FIELD){const u=It(a),l=a.selectionSet;if(c=o[u]||r[u],c===void 0)continue;if(l&&c!==null){const f=Lt(r[u],l,t,n);s.has(f)&&(c=f)}o[u]=c}if(a.kind===P.INLINE_FRAGMENT&&(!a.typeCondition||t.cache.fragmentMatches(a,r.__typename))&&(c=Lt(r,a.selectionSet,t,n)),a.kind===P.FRAGMENT_SPREAD){const u=a.name.value,l=t.fragmentMap[u]||(t.fragmentMap[u]=t.cache.lookupFragment(u));I(l,39,u);const f=rl(a);f!=="mask"&&(c=Lt(r,l.selectionSet,t,f==="migrate"))}s.has(c)&&s.add(o)}return"__typename"in r&&!("__typename"in o)&&(o.__typename=r.__typename),Object.keys(o).length!==Object.keys(r).length&&s.add(o),s.has(o)?o:r}function il(r,e,t,n){const i=e.definitions.filter(o=>o.kind===P.FRAGMENT_DEFINITION);typeof n>"u"&&(I(i.length===1,41,i.length),n=i[0].name.value);const s=i.find(o=>o.name.value===n);return I(!!s,42,n),r==null||B(r,{})?r:Ho(r,s.selectionSet,{operationName:s.name.value,fragmentMap:Xt(Zt(e)),cache:t,mutableTargets:new WeakMap,knownChanged:new WeakSet})}function sl(r,e,t){var i;const n=Ee(e);return I(n,43),r==null?r:Ho(r,n.selectionSet,{operationType:n.operation,operationName:(i=n.name)==null?void 0:i.value,fragmentMap:Xt(Zt(e)),cache:t,mutableTargets:new WeakMap,knownChanged:new WeakSet})}const es={};function di(r){const e=JSON.stringify(r);return es[e]||(es[e]={})}function ts(r){const e=di(r);return e.keyFieldsFn||(e.keyFieldsFn=(t,n)=>{const i=(o,a)=>n.readField(a,o),s=n.keyObject=pi(r,o=>{let a=dt(n.storeObject,o,i);return a===void 0&&t!==n.storeObject&&$.call(t,o[0])&&(a=dt(t,o,Go)),I(a!==void 0,98,o.join("."),t),a});return`${n.typename}:${JSON.stringify(s)}`})}function rs(r){const e=di(r);return e.keyArgsFn||(e.keyArgsFn=(t,{field:n,variables:i,fieldName:s})=>{const o=pi(r,c=>{const u=c[0],l=u.charAt(0);if(l==="@"){if(n&&fi(n.directives)){const f=u.slice(1),h=n.directives.find(d=>d.name.value===f),p=h&&oi(h,i);return p&&dt(p,c.slice(1))}return}if(l==="$"){const f=u.slice(1);if(i&&$.call(i,f)){const h=c.slice(0);return h[0]=f,dt(i,h)}return}if(t)return dt(t,c)}),a=JSON.stringify(o);return(t||a!=="{}")&&(s+=":"+a),s})}function pi(r,e){const t=new Rt;return Jo(r).reduce((n,i)=>{let s=e(i);if(s!==void 0){for(let o=i.length-1;o>=0;--o)s={[i[o]]:s};n=t.merge(n,s)}return n},{})}function Jo(r){const e=di(r);if(!e.paths){const t=e.paths=[],n=[];r.forEach((i,s)=>{Q(i)?(Jo(i).forEach(o=>t.push(n.concat(o))),n.length=0):(n.push(i),Q(r[s+1])||(t.push(n.slice(0)),n.length=0))})}return e.paths}function Go(r,e){return r[e]}function dt(r,e,t){return t=t||Go,Yo(e.reduce(function n(i,s){return Q(i)?i.map(o=>n(o,s)):i&&t(i,s)},r))}function Yo(r){return X(r)?Q(r)?r.map(Yo):pi(Object.keys(r).sort(),e=>dt(r,e)):r}const Ko=new Nr,ns=new WeakMap;function Bt(r){let e=ns.get(r);return e||ns.set(r,e={vars:new Set,dep:Po()}),e}function is(r){Bt(r).vars.forEach(e=>e.forgetCache(r))}function ol(r){Bt(r).vars.forEach(e=>e.attachCache(r))}function al(r){const e=new Set,t=new Set,n=function(s){if(arguments.length>0){if(r!==s){r=s,e.forEach(a=>{Bt(a).dep.dirty(n),cl(a)});const o=Array.from(t);t.clear(),o.forEach(a=>a(r))}}else{const o=Ko.getValue();o&&(i(o),Bt(o).dep(n))}return r};n.onNextChange=s=>(t.add(s),()=>{t.delete(s)});const i=n.attachCache=s=>(e.add(s),Bt(s).vars.add(n),n);return n.forgetCache=s=>e.delete(s),n}function cl(r){r.broadcastWatches&&r.broadcastWatches()}function Dn(r){return r.args!==void 0?r.args:r.field?oi(r.field,r.variables):null}const ul=()=>{},ss=(r,e)=>e.fieldName,os=(r,e,{mergeObjects:t})=>t(r,e),as=(r,e)=>e;class ll{constructor(e){v(this,"config");v(this,"typePolicies",{});v(this,"toBeAdded",{});v(this,"supertypeMap",new Map);v(this,"fuzzySubtypes",new Map);v(this,"cache");v(this,"rootIdsByTypename",{});v(this,"rootTypenamesById",{});v(this,"usingPossibleTypes",!1);this.config=e,this.config={dataIdFromObject:Bo,...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){var l;const n=this,i=t&&(t.typename||((l=t.storeObject)==null?void 0:l.__typename))||e.__typename;if(i===this.rootTypenamesById.ROOT_QUERY)return["ROOT_QUERY"];const s=t&&t.storeObject||e,o={...t,typename:i,storeObject:s,readField:t&&t.readField||((...f)=>{const h=mi(f,s);return n.readField(h,{store:n.cache.data,variables:h.variables})})};let a;const c=i&&this.getTypePolicy(i);let u=c&&c.keyFn||this.config.dataIdFromObject;return $o.withValue(!0,()=>{for(;u;){const f=u({...e,...s},o);if(Q(f))u=ts(f);else{a=f;break}}}),a=a?String(a):void 0,o.keyObject?[a,o.keyObject]:[a]}addTypePolicies(e){Object.keys(e).forEach(t=>{const{queryType:n,mutationType:i,subscriptionType:s,...o}=e[t];n&&this.setRootTypename("Query",t),i&&this.setRootTypename("Mutation",t),s&&this.setRootTypename("Subscription",t),$.call(this.toBeAdded,t)?this.toBeAdded[t].push(o):this.toBeAdded[t]=[o]})}updateTypePolicy(e,t,n){const i=this.getTypePolicy(e),{keyFields:s,fields:o}=t;function a(c,u){c.merge=typeof u=="function"?u:u===!0?os:u===!1?as:c.merge}a(i,t.merge),i.keyFn=s===!1?ul:Q(s)?ts(s):typeof s=="function"?s:i.keyFn,o&&Object.keys(o).forEach(c=>{let u=n[c];(!u||(u==null?void 0:u.typename)!==e)&&(u=n[c]={typename:e});const l=o[c];if(typeof l=="function")u.read=l;else{const{keyArgs:f,read:h,merge:p}=l;u.keyFn=f===!1?ss:Q(f)?rs(f):typeof f=="function"?f:u.keyFn,typeof h=="function"&&(u.read=h),a(u,p)}u.read&&u.merge&&(u.keyFn=u.keyFn||ss)})}setRootTypename(e,t=e){const n="ROOT_"+e.toUpperCase(),i=this.rootTypenamesById[n];t!==i&&(I(!i||i===e,99,e),i&&delete this.rootIdsByTypename[i],this.rootIdsByTypename[t]=n,this.rootTypenamesById[n]=t)}addPossibleTypes(e){this.usingPossibleTypes=!0,Object.keys(e).forEach(t=>{this.getSupertypeSet(t,!0),e[t].forEach(n=>{this.getSupertypeSet(n,!0).add(t);const i=n.match(Qo);(!i||i[0]!==n)&&this.fuzzySubtypes.set(n,new RegExp(n))})})}getTypePolicy(e){if(!$.call(this.typePolicies,e)){const n=this.typePolicies[e]={};n.fields={};let i=this.supertypeMap.get(e);!i&&this.fuzzySubtypes.size&&(i=this.getSupertypeSet(e,!0),this.fuzzySubtypes.forEach((s,o)=>{if(s.test(e)){const a=this.supertypeMap.get(o);a&&a.forEach(c=>i.add(c))}})),i&&i.size&&i.forEach(s=>{const{fields:o,...a}=this.getTypePolicy(s);Object.assign(n,a),Object.assign(n.fields,o)})}const t=this.toBeAdded[e];return t&&t.length&&t.splice(0).forEach(n=>{this.updateTypePolicy(e,n,this.typePolicies[e].fields)}),this.typePolicies[e]}getFieldPolicy(e,t){if(e)return this.getTypePolicy(e).fields[t]}getSupertypeSet(e,t){let n=this.supertypeMap.get(e);return!n&&t&&this.supertypeMap.set(e,n=new Set),n}fragmentMatches(e,t,n,i){if(!e.typeCondition)return!0;if(!t)return!1;const s=e.typeCondition.name.value;if(t===s)return!0;if(this.usingPossibleTypes&&this.supertypeMap.has(s)){const o=this.getSupertypeSet(t,!0),a=[o],c=l=>{const f=this.getSupertypeSet(l,!1);f&&f.size&&a.indexOf(f)<0&&a.push(f)};let u=!!(n&&this.fuzzySubtypes.size);for(let l=0;l<a.length;++l){const f=a[l];if(f.has(s))return o.has(s)||o.add(s),!0;f.forEach(c),u&&l===a.length-1&&_n(e.selectionSet,n,i)&&(u=!1,this.fuzzySubtypes.forEach((h,p)=>{const d=t.match(h);d&&d[0]===t&&c(p)}))}}return!1}hasKeyArgs(e,t){const n=this.getFieldPolicy(e,t);return!!(n&&n.keyFn)}getStoreFieldName(e){const{typename:t,fieldName:n}=e,i=this.getFieldPolicy(t,n);let s,o=i&&i.keyFn;if(o&&t){const a={typename:t,fieldName:n,field:e.field||null,variables:e.variables},c=Dn(e);for(;o;){const u=o(c,a);if(Q(u))o=rs(u);else{s=u||n;break}}}return s===void 0&&(s=e.field?Uu(e.field,e.variables):jo(n,Dn(e))),s===!1?n:n===Ft(s)?s:n+":"+s}readField(e,t){const n=e.from;if(!n||!(e.field||e.fieldName))return;if(e.typename===void 0){const l=t.store.getFieldValue(n,"__typename");l&&(e.typename=l)}const s=this.getStoreFieldName(e),o=Ft(s),a=t.store.getFieldValue(n,s),c=this.getFieldPolicy(e.typename,o),u=c&&c.read;if(u){const l=cs(this,n,e,t,t.store.getStorage(q(n)?n.__ref:n,s));return Ko.withValue(this.cache,u,[a,l])}return a}getReadFunction(e,t){const n=this.getFieldPolicy(e,t);return n&&n.read}getMergeFunction(e,t,n){let i=this.getFieldPolicy(e,t),s=i&&i.merge;return!s&&n&&(i=this.getTypePolicy(n),s=i&&i.merge),s}runMergeFunction(e,t,{field:n,typename:i,merge:s},o,a){return s===os?Xo(o.store)(e,t):s===as?t:(o.overwrite&&(e=void 0),s(e,t,cs(this,void 0,{typename:i,fieldName:n.name.value,field:n,variables:o.variables},o,a||{})))}}function cs(r,e,t,n,i){const s=r.getStoreFieldName(t),o=Ft(s),a=t.variables||n.variables,{toReference:c,canRead:u}=n.store;return{args:Dn(t),field:t.field||null,fieldName:o,storeFieldName:s,variables:a,isReference:q,toReference:c,storage:i,cache:r.cache,canRead:u,readField(...l){return r.readField(mi(l,e,a),n)},mergeObjects:Xo(n.store)}}function mi(r,e,t){const{0:n,1:i,length:s}=r;let o;return typeof n=="string"?o={fieldName:n,from:s>1?i:e}:(o={...n},$.call(o,"from")||(o.from=e)),o.variables===void 0&&(o.variables=t),o}function Xo(r){return function(t,n){if(Q(t)||Q(n))throw oe(102);if(X(t)&&X(n)){const i=r.getFieldValue(t,"__typename"),s=r.getFieldValue(n,"__typename");if(i&&s&&i!==s)return n;if(q(t)&&ut(n))return r.merge(t.__ref,n),t;if(ut(t)&&q(n))return r.merge(t,n.__ref),n;if(ut(t)&&ut(n))return{...t,...n}}return n}}function us(r){return[r.selectionSet,r.objectOrReference,r.context]}class fl{constructor(e){v(this,"executeSelectionSet");v(this,"executeSubSelectedArray");v(this,"config");v(this,"knownResults",new WeakMap);this.config=e,this.executeSelectionSet=kt(t=>{const n=us(t),i=this.executeSelectionSet.peek(...n);return i||(Zi(t.context.store,t.enclosingRef.__ref),this.execSelectionSetImpl(t))},{max:Se["inMemoryCache.executeSelectionSet"]||5e4,keyArgs:us,makeCacheKey(t,n,i){if(Vt(i.store))return i.store.makeCacheKey(t,q(n)?n.__ref:n,i.varString)}}),this.executeSubSelectedArray=kt(t=>(Zi(t.context.store,t.enclosingRef.__ref),this.execSubSelectedArrayImpl(t)),{max:Se["inMemoryCache.executeSubSelectedArray"]||1e4,makeCacheKey({field:t,array:n,context:i}){if(Vt(i.store))return i.store.makeCacheKey(t,n,i.varString)}})}diffQueryAgainstStore({store:e,query:t,rootId:n="ROOT_QUERY",variables:i,returnPartialData:s=!0}){const o=this.config.cache.policies;i={...li(ku(t)),...i};const a=ft(n),c=this.executeSelectionSet({selectionSet:Ao(t).selectionSet,objectOrReference:a,enclosingRef:a,context:{store:e,query:t,policies:o,variables:i,varString:Ne(i),...zo(t,this.config.fragments)}});let u;c.missing&&(u=new hi(hl(c.missing),c.missing,t,i));const l=!u,{result:f}=c;return{result:l||s?Object.keys(f).length===0?null:f:null,complete:l,missing:u}}isFresh(e,t,n,i){if(Vt(i.store)&&this.knownResults.get(e)===n){const s=this.executeSelectionSet.peek(n,t,i);if(s&&e===s.result)return!0}return!1}execSelectionSetImpl({selectionSet:e,objectOrReference:t,enclosingRef:n,context:i}){if(q(t)&&!i.policies.rootTypenamesById[t.__ref]&&!i.store.has(t.__ref))return{result:{},missing:`Dangling reference to missing ${t.__ref} object`};const{variables:s,policies:o,store:a}=i,c=a.getFieldValue(t,"__typename"),u=[];let l;const f=new Rt;typeof c=="string"&&!o.rootIdsByTypename[c]&&u.push({__typename:c});function h(b,S){return b.missing&&(l=f.merge(l,{[S]:b.missing})),b.result}const p=new Set(e.selections);p.forEach(b=>{if(Mr(b,s))if(er(b)){let S=o.readField({fieldName:b.name.value,field:b,variables:i.variables,from:t},i);const O=It(b);S===void 0?Uo.added(b)||(l=f.merge(l,{[O]:`Can't find field '${b.name.value}' on ${q(t)?t.__ref+" object":"object "+JSON.stringify(t,null,2)}`})):Q(S)?S.length>0&&(S=h(this.executeSubSelectedArray({field:b,array:S,enclosingRef:n,context:i}),O)):b.selectionSet&&S!=null&&(S=h(this.executeSelectionSet({selectionSet:b.selectionSet,objectOrReference:S,enclosingRef:q(S)?S:n,context:i}),O)),S!==void 0&&u.push({[O]:S})}else{const S=xr(b,i.lookupFragment);if(!S&&b.kind===P.FRAGMENT_SPREAD)throw oe(103,b.name.value);S&&o.fragmentMatches(S,c)&&S.selectionSet.selections.forEach(p.add,p)}});const y={result:Nu(u),missing:l},m=y;return m.result&&this.knownResults.set(m.result,e),m}execSubSelectedArrayImpl({field:e,array:t,enclosingRef:n,context:i}){let s,o=new Rt;function a(c,u){return c.missing&&(s=o.merge(s,{[u]:c.missing})),c.result}return e.selectionSet&&(t=t.filter(i.store.canRead)),t=t.map((c,u)=>c===null?null:Q(c)?a(this.executeSubSelectedArray({field:e,array:c,enclosingRef:n,context:i}),u):e.selectionSet?a(this.executeSelectionSet({selectionSet:e.selectionSet,objectOrReference:c,enclosingRef:q(c)?c:n,context:i}),u):c),{result:t,missing:s}}}function hl(r){try{JSON.stringify(r,(e,t)=>{if(typeof t=="string")throw t;return t})}catch(e){return e}}function cn(r,e,t){const n=`${e}${t}`;let i=r.flavors.get(n);return i||r.flavors.set(n,i=r.clientOnly===e&&r.deferred===t?r:{...r,clientOnly:e,deferred:t}),i}class dl{constructor(e,t,n){v(this,"cache");v(this,"reader");v(this,"fragments");this.cache=e,this.reader=t,this.fragments=n}writeToStore(e,{query:t,result:n,dataId:i,variables:s,overwrite:o}){const a=Ee(t),c=Xu();s={...li(a),...s};const u={store:e,written:{},merge(f,h){return c.merge(f,h)},variables:s,varString:Ne(s),...zo(t,this.fragments),overwrite:!!o,incomingById:new Map,clientOnly:!1,deferred:!1,flavors:new Map},l=this.processSelectionSet({result:n||{},dataId:i,selectionSet:a.selectionSet,mergeTree:{map:new Map},context:u});if(!q(l))throw oe(105,n);return u.incomingById.forEach(({storeObject:f,mergeTree:h,fieldNodeSet:p},d)=>{const y=ft(d);if(h&&h.map.size){const m=this.applyMerges(h,y,f,u);if(q(m))return;f=m}e.merge(d,f)}),e.retain(l.__ref),l}processSelectionSet({dataId:e,result:t,selectionSet:n,context:i,mergeTree:s}){const{policies:o}=this.cache;let a={};const c=e&&o.rootTypenamesById[e]||Nn(t,n,i.fragmentMap)||e&&i.store.get(e,"__typename");typeof c=="string"&&(a.__typename=c);const u=(...f)=>{const h=mi(f,a,i.variables);if(q(h.from)){const p=i.incomingById.get(h.from.__ref);if(p){const d=o.readField({...h,from:p.storeObject},i);if(d!==void 0)return d}}return o.readField(h,i)},l=new Set;this.flattenFields(n,t,i,c).forEach((f,h)=>{const p=It(h),d=t[p];if(l.add(h),d!==void 0){const y=o.getStoreFieldName({typename:c,fieldName:h.name.value,field:h,variables:f.variables}),m=ls(s,y);let b=this.processFieldValue(d,h,h.selectionSet?cn(f,!1,!1):f,m),S;h.selectionSet&&(q(b)||ut(b))&&(S=u("__typename",b));const O=o.getMergeFunction(c,h.name.value,S);O?m.info={field:h,typename:c,merge:O}:fs(s,y),a=f.merge(a,{[y]:b})}});try{const[f,h]=o.identify(t,{typename:c,selectionSet:n,fragmentMap:i.fragmentMap,storeObject:a,readField:u});e=e||f,h&&(a=i.merge(a,h))}catch(f){if(!e)throw f}if(typeof e=="string"){const f=ft(e),h=i.written[e]||(i.written[e]=[]);if(h.indexOf(n)>=0||(h.push(n),this.reader&&this.reader.isFresh(t,f,n,i)))return f;const p=i.incomingById.get(e);return p?(p.storeObject=i.merge(p.storeObject,a),p.mergeTree=In(p.mergeTree,s),l.forEach(d=>p.fieldNodeSet.add(d))):i.incomingById.set(e,{storeObject:a,mergeTree:kr(s)?void 0:s,fieldNodeSet:l}),f}return a}processFieldValue(e,t,n,i){return!t.selectionSet||e===null?e:Q(e)?e.map((s,o)=>{const a=this.processFieldValue(s,t,n,ls(i,o));return fs(i,o),a}):this.processSelectionSet({result:e,selectionSet:t.selectionSet,context:n,mergeTree:i})}flattenFields(e,t,n,i=Nn(t,e,n.fragmentMap)){const s=new Map,{policies:o}=this.cache,a=new Me(!1);return(function c(u,l){const f=a.lookup(u,l.clientOnly,l.deferred);f.visited||(f.visited=!0,u.selections.forEach(h=>{if(!Mr(h,n.variables))return;let{clientOnly:p,deferred:d}=l;if(!(p&&d)&&fi(h.directives)&&h.directives.forEach(y=>{const m=y.name.value;if(m==="client"&&(p=!0),m==="defer"){const b=oi(y,n.variables);(!b||b.if!==!1)&&(d=!0)}}),er(h)){const y=s.get(h);y&&(p=p&&y.clientOnly,d=d&&y.deferred),s.set(h,cn(n,p,d))}else{const y=xr(h,n.lookupFragment);if(!y&&h.kind===P.FRAGMENT_SPREAD)throw oe(107,h.name.value);y&&o.fragmentMatches(y,i,t,n.variables)&&c(y.selectionSet,cn(n,p,d))}}))})(e,n),s}applyMerges(e,t,n,i,s){if(e.map.size&&!q(n)){const o=!Q(n)&&(q(t)||ut(t))?t:void 0,a=n;o&&!s&&(s=[q(o)?o.__ref:o]);let c;const u=(l,f)=>Q(l)?typeof f=="number"?l[f]:void 0:i.store.getFieldValue(l,String(f));e.map.forEach((l,f)=>{const h=u(o,f),p=u(a,f);if(p===void 0)return;s&&s.push(f);const d=this.applyMerges(l,h,p,i,s);d!==p&&(c=c||new Map,c.set(f,d)),s&&I(s.pop()===f)}),c&&(n=Q(a)?a.slice(0):{...a},c.forEach((l,f)=>{n[f]=l}))}return e.info?this.cache.policies.runMergeFunction(t,n,e.info,i,s&&i.store.getStorage(...s)):n}}const Zo=[];function ls({map:r},e){return r.has(e)||r.set(e,Zo.pop()||{map:new Map}),r.get(e)}function In(r,e){if(r===e||!e||kr(e))return r;if(!r||kr(r))return e;const t=r.info&&e.info?{...r.info,...e.info}:r.info||e.info,n=r.map.size&&e.map.size,i=n?new Map:r.map.size?r.map:e.map,s={info:t,map:i};if(n){const o=new Set(e.map.keys());r.map.forEach((a,c)=>{s.map.set(c,In(a,e.map.get(c))),o.delete(c)}),o.forEach(a=>{s.map.set(a,In(e.map.get(a),r.map.get(a)))})}return s}function kr(r){return!r||!(r.info||r.map.size)}function fs({map:r},e){const t=r.get(e);t&&kr(t)&&(Zo.push(t),r.delete(e))}function Nn(r,e,t){let n;for(const i of e.selections)if(er(i)){if(i.name.value==="__typename")return r[It(i)]}else n?n.push(i):n=[i];if(typeof r.__typename=="string")return r.__typename;if(n)for(const i of n){const s=Nn(r,xr(i,t).selectionSet,t);if(typeof s=="string")return s}}class hd extends Gu{constructor(t={}){super();v(this,"data");v(this,"optimisticData");v(this,"config");v(this,"watches",new Set);v(this,"storeReader");v(this,"storeWriter");v(this,"addTypenameTransform",new we(Uo));v(this,"maybeBroadcastWatch");v(this,"assumeImmutableResults",!0);v(this,"policies");v(this,"makeVar",al);v(this,"txCount",0);this.config=Ku(t),this.policies=new ll({cache:this,dataIdFromObject:this.config.dataIdFromObject,possibleTypes:this.config.possibleTypes,typePolicies:this.config.typePolicies}),this.init()}init(){const t=this.data=new jr.Root({policies:this.policies,resultCaching:this.config.resultCaching});this.optimisticData=t.stump,this.resetResultCache()}resetResultCache(){const{fragments:t}=this.config;this.addTypenameTransform.resetCache(),t==null||t.resetCaches(),this.storeWriter=new dl(this,this.storeReader=new fl({cache:this,fragments:t}),t),this.maybeBroadcastWatch=kt((n,i)=>this.broadcastWatch(n,i),{max:Se["inMemoryCache.maybeBroadcastWatch"]||5e3,makeCacheKey:n=>{const i=n.optimistic?this.optimisticData:this.data;if(Vt(i)){const{optimistic:s,id:o,variables:a}=n;return i.makeCacheKey(n.query,n.callback,Ne({optimistic:s,id:o,variables:a}))}}}),new Set([this.data.group,this.optimisticData.group]).forEach(n=>n.resetCaching())}restore(t){return this.init(),t&&this.data.replace(t),this}extract(t=!1){return(t?this.optimisticData:this.data).extract()}read(t){const{returnPartialData:n=!1}=t;return this.storeReader.diffQueryAgainstStore({...t,store:t.optimistic?this.optimisticData:this.data,config:this.config,returnPartialData:n}).result}write(t){try{return++this.txCount,this.storeWriter.writeToStore(this.data,t)}finally{!--this.txCount&&t.broadcast!==!1&&this.broadcastWatches()}}modify(t){if($.call(t,"id")&&!t.id)return!1;const n=t.optimistic?this.optimisticData:this.data;try{return++this.txCount,n.modify(t.id||"ROOT_QUERY",t.fields,!1)}finally{!--this.txCount&&t.broadcast!==!1&&this.broadcastWatches()}}diff(t){return this.storeReader.diffQueryAgainstStore({...t,store:t.optimistic?this.optimisticData:this.data,rootId:t.id||"ROOT_QUERY",config:this.config})}watch(t){return this.watches.size||ol(this),this.watches.add(t),t.immediate&&this.maybeBroadcastWatch(t),()=>{this.watches.delete(t)&&!this.watches.size&&is(this),this.maybeBroadcastWatch.forget(t)}}gc(t){Ne.reset(),ht.reset();const n=this.optimisticData.gc();return t&&!this.txCount&&t.resetResultCache&&this.resetResultCache(),n}retain(t,n){return(n?this.optimisticData:this.data).retain(t)}release(t,n){return(n?this.optimisticData:this.data).release(t)}identify(t){if(q(t))return t.__ref;try{return this.policies.identify(t)[0]}catch{}}evict(t){if(!t.id){if($.call(t,"id"))return!1;t={...t,id:"ROOT_QUERY"}}try{return++this.txCount,this.optimisticData.evict(t,this.data)}finally{!--this.txCount&&t.broadcast!==!1&&this.broadcastWatches()}}reset(t){return this.init(),Ne.reset(),t&&t.discardWatches?(this.watches.forEach(n=>this.maybeBroadcastWatch.forget(n)),this.watches.clear(),is(this)):this.broadcastWatches(),Promise.resolve()}removeOptimistic(t){const n=this.optimisticData.removeLayer(t);n!==this.optimisticData&&(this.optimisticData=n,this.broadcastWatches())}batch(t){const{update:n,optimistic:i=!0,removeOptimistic:s,onWatchUpdated:o}=t;let a;const c=l=>{const{data:f,optimisticData:h}=this;++this.txCount,l&&(this.data=this.optimisticData=l);try{return a=n(this)}finally{--this.txCount,this.data=f,this.optimisticData=h}},u=new Set;return o&&!this.txCount&&this.broadcastWatches({...t,onWatchUpdated(l){return u.add(l),!1}}),typeof i=="string"?this.optimisticData=this.optimisticData.addLayer(i,c):i===!1?c(this.data):c(),typeof s=="string"&&(this.optimisticData=this.optimisticData.removeLayer(s)),o&&u.size?(this.broadcastWatches({...t,onWatchUpdated(l,f){const h=o.call(this,l,f);return h!==!1&&u.delete(l),h}}),u.size&&u.forEach(l=>this.maybeBroadcastWatch.dirty(l))):this.broadcastWatches(t),a}performTransaction(t,n){return this.batch({update:t,optimistic:n||n!==null})}transformDocument(t){return this.addTypenameTransform.transformDocument(this.addFragmentsToDocument(t))}fragmentMatches(t,n){return this.policies.fragmentMatches(t,n)}lookupFragment(t){var n;return((n=this.config.fragments)==null?void 0:n.lookup(t))||null}broadcastWatches(t){this.txCount||this.watches.forEach(n=>this.maybeBroadcastWatch(n,t))}addFragmentsToDocument(t){const{fragments:n}=this.config;return n?n.transform(t):t}broadcastWatch(t,n){const{lastDiff:i}=t,s=this.diff(t);n&&(t.optimistic&&typeof n.optimistic=="string"&&(s.fromOptimisticTransaction=!0),n.onWatchUpdated&&n.onWatchUpdated.call(this,t,s,i)===!1)||(!i||!B(i.result,s.result))&&t.callback(t.lastDiff=s,i)}}function tr(r,e){return typeof r=="object"&&r!==null&&r[Symbol.for("apollo.error")]===e}function rr(r){Object.defineProperty(r,Symbol.for("apollo.error"),{value:r.name,enumerable:!1,writable:!1,configurable:!1})}function hs(r){return r.map(e=>e.message||"Error message not found.").join(`
|
|
39
|
+
`)}const Qt=class Qt extends Error{constructor(t){super(Qt.formatMessage(t,{defaultFormatMessage:hs}));v(this,"errors");this.name="CombinedProtocolErrors",this.errors=t,rr(this),Object.setPrototypeOf(this,Qt.prototype)}static is(t){return tr(t,"CombinedProtocolErrors")}};v(Qt,"formatMessage",hs);let Cr=Qt;function pl(r){return r!==null&&typeof r=="object"&&typeof r.message=="string"&&typeof r.name=="string"&&(typeof r.stack=="string"||typeof r.stack>"u")}class yi extends Error{static is(e){return tr(e,"UnconventionalError")}constructor(e){super("An error of unexpected shape occurred.",{cause:e}),this.name="UnconventionalError",rr(this),Object.setPrototypeOf(this,yi.prototype)}}function ds(r){return r.filter(e=>e).map(e=>e.message||"Error message not found.").join(`
|
|
40
|
+
`)}const zt=class zt extends Error{constructor(t,n=t.errors||[]){super(zt.formatMessage(n,{result:t,defaultFormatMessage:ds}));v(this,"errors");v(this,"data");v(this,"extensions");this.errors=n,this.data=t.data,this.extensions=t.extensions,this.name="CombinedGraphQLErrors",rr(this),Object.setPrototypeOf(this,zt.prototype)}static is(t){return tr(t,"CombinedGraphQLErrors")}};v(zt,"formatMessage",ds);let Ve=zt;const ml=new WeakSet;function yl(r){ml.add(r)}class qr extends Error{constructor(t,n){super(t);v(this,"response");v(this,"statusCode");v(this,"bodyText");this.name="ServerError",this.response=n.response,this.statusCode=n.response.status,this.bodyText=n.bodyText,rr(this),Object.setPrototypeOf(this,qr.prototype)}static is(t){return tr(t,"ServerError")}}class Lr extends Error{constructor(t,n){super(t instanceof Error?t.message:"Could not parse server response",{cause:t});v(this,"response");v(this,"statusCode");v(this,"bodyText");this.name="ServerParseError",this.response=n.response,this.statusCode=n.response.status,this.bodyText=n.bodyText,rr(this),Object.setPrototypeOf(this,Lr.prototype)}static is(t){return tr(t,"ServerParseError")}}const Rr=Symbol();function bl(r){return"extensions"in r?Cr.is(r.extensions[Rr]):!1}function gl(r){return pl(r)?r:typeof r=="string"?new Error(r,{cause:r}):new yi(r)}var F;(function(r){r[r.loading=1]="loading",r[r.setVariables=2]="setVariables",r[r.fetchMore=3]="fetchMore",r[r.refetch=4]="refetch",r[r.poll=6]="poll",r[r.ready=7]="ready",r[r.error=8]="error",r[r.streaming=9]="streaming"})(F||(F={}));const{assign:ps}=Object,ot={loading:!0,networkStatus:F.loading,data:void 0,dataState:"empty",partial:!0},un={loading:!1,networkStatus:F.ready,data:void 0,dataState:"empty",partial:!0};var Bs;Bs=Symbol.observable;class ln{constructor({queryManager:e,options:t,transformedQuery:n=e.transform(t.query)}){v(this,"options");v(this,"queryName");v(this,"_lastWrite");v(this,"unsubscribeFromCache");v(this,"input");v(this,"subject");v(this,"isTornDown");v(this,"queryManager");v(this,"subscriptions",new Set);v(this,"waitForNetworkResult");v(this,"lastQuery");v(this,"linkSubscription");v(this,"pollingInfo");v(this,"subscribe");v(this,"pipe");v(this,Bs);v(this,"@@observable");v(this,"stableLastResult");v(this,"didWarnCacheOnlyPolling",!1);v(this,"dirty",!1);v(this,"notifyTimeout");v(this,"activeOperations",new Set);v(this,"operator",Cn(e=>{const{query:t,variables:n,meta:i}=e;if(e.source==="setResult")return{query:t,variables:n,result:e.value,meta:i};if(e.kind==="C"||!xt(e,this))return;let s;const o=this.subject.getValue();if(e.source==="cache"){if(s=e.value,s.networkStatus===F.ready&&s.partial&&(!this.options.returnPartialData||o.result.networkStatus===F.error)&&this.options.fetchPolicy!=="cache-only")return}else if(e.source==="network")this.waitForNetworkResult&&(this.waitForNetworkResult=!1,this.resubscribeCache()),s=e.kind==="E"?{...xt(o,e)?o.result:{data:void 0,dataState:"empty",partial:!0},error:e.error,networkStatus:F.error,loading:!1}:e.value,e.kind==="E"&&s.dataState==="streaming"&&(s.dataState="complete"),s.error&&(i.shouldEmit=1);else if(e.source==="newNetworkStatus"){const a=xt(o,e)?o.result:this.getInitialResult(i.fetchPolicy),{resetError:c}=e.value,u=c?void 0:a.error,l=u?F.error:F.ready;s={...a,error:u,networkStatus:l}}return I(s),s.error||delete s.error,s.networkStatus=this.calculateNetworkStatus(s.networkStatus),s.loading=Fn(s.networkStatus),s=this.maskResult(s),{query:t,variables:n,result:s,meta:i}}));this.queryManager=e,this.waitForNetworkResult=t.fetchPolicy==="network-only",this.isTornDown=!1,this.subscribeToMore=this.subscribeToMore.bind(this),this.maskResult=this.maskResult.bind(this);const{watchQuery:{fetchPolicy:i="cache-first"}={}}=e.defaultOptions,{fetchPolicy:s=i,initialFetchPolicy:o=s==="standby"?i:s}=t;this.lastQuery=n,this.options={...t,initialFetchPolicy:o,fetchPolicy:s,variables:this.getVariablesWithDefaults(t.variables)},this.initializeObservablesQueue(),this["@@observable"]=()=>this,Symbol.observable&&(this[Symbol.observable]=()=>this);const a=Ee(this.query);this.queryName=a&&a.name&&a.name.value}get query(){return this.lastQuery}get variables(){return this.options.variables}get networkStatus(){return this.subject.getValue().result.networkStatus}initializeObservablesQueue(){this.subject=new Cc({query:this.query,variables:this.variables,result:ot,meta:{}});const e=this.subject.pipe(Tr({subscribe:()=>{this.subject.observed||(this.reobserve(),setTimeout(()=>this.updatePolling()))},unsubscribe:()=>{this.subject.observed||this.tearDownQuery()}}),Cn(({query:t,variables:n,result:i,meta:s},o)=>{const{shouldEmit:a}=s;if(i===ot&&(o.previous=void 0,o.previousVariables=void 0),this.options.fetchPolicy==="standby"||a===2)return;if(a===1)return l();const{previous:c,previousVariables:u}=o;if(c){const f=this.queryManager.getDocumentInfo(t),h=this.queryManager.dataMasking,p=h?f.nonReactiveQuery:t;if((h||f.hasNonreactiveDirective?Lo(p,c,i,n):B(c,i))&&B(u,n))return}if(a===3&&(!this.options.notifyOnNetworkStatusChange||B(c,i)))return;return l();function l(){return o.previous=i,o.previousVariables=n,i}},()=>({})));this.pipe=e.pipe.bind(e),this.subscribe=e.subscribe.bind(e),this.input=new Dt,this.input.complete=()=>{},this.input.pipe(this.operator).subscribe(this.subject)}getCacheDiff({optimistic:e=!0}={}){return this.queryManager.cache.diff({query:this.query,variables:this.variables,returnPartialData:!0,optimistic:e})}getInitialResult(e){const t=this.queryManager.prioritizeCacheValues?"cache-first":e||this.options.fetchPolicy,n=()=>{const i=this.getCacheDiff(),s=this.options.returnPartialData||i.complete?i.result??void 0:void 0;return this.maskResult({data:s,dataState:i.complete?"complete":s===void 0?"empty":"partial",loading:!i.complete,networkStatus:i.complete?F.ready:F.loading,partial:!i.complete})};switch(t){case"cache-only":return{...n(),loading:!1,networkStatus:F.ready};case"cache-first":return n();case"cache-and-network":return{...n(),loading:!0,networkStatus:F.loading};case"standby":return un;default:return ot}}resubscribeCache(){var c;const{variables:e,fetchPolicy:t}=this.options,n=this.query,i=t==="standby"||t==="no-cache"||this.waitForNetworkResult,s=!xt({query:n,variables:e},this.unsubscribeFromCache)&&!this.waitForNetworkResult;if((i||s)&&((c=this.unsubscribeFromCache)==null||c.call(this)),i||!s)return;const o={query:n,variables:e,optimistic:!0,watcher:this,callback:u=>{const l=this.queryManager.getDocumentInfo(n);if((l.hasClientExports||l.hasForcedResolvers)&&(o.lastDiff=void 0),o.lastOwnDiff===u)return;const{result:f}=this.subject.getValue();!u.complete&&(f.error||f===ot||f===un)||B(f.data,u.result)||this.scheduleNotify()}},a=this.queryManager.cache.watch(o);this.unsubscribeFromCache=Object.assign(()=>{this.unsubscribeFromCache=void 0,a()},{query:n,variables:e})}getCurrentResult(){const{result:e}=this.subject.getValue();let t=e.networkStatus===F.error||this.hasObservers()||this.options.fetchPolicy==="no-cache"?e:this.getInitialResult();return t===ot&&(t=this.getInitialResult()),B(this.stableLastResult,t)||(this.stableLastResult=t),this.stableLastResult}refetch(e){const{fetchPolicy:t}=this.options,n={pollInterval:0};return t==="no-cache"?n.fetchPolicy="no-cache":n.fetchPolicy="network-only",e&&!B(this.variables,e)&&(n.variables=this.options.variables=this.getVariablesWithDefaults({...this.variables,...e})),this._lastWrite=void 0,this._reobserve(n,{newNetworkStatus:F.refetch})}fetchMore({query:e,variables:t,context:n,errorPolicy:i,updateQuery:s}){I(this.options.fetchPolicy!=="cache-only",78,Ct(this.query,"(anonymous)"));const o={...se(this.options,{errorPolicy:"none"},{query:e,context:n,errorPolicy:i}),variables:e?t:{...this.variables,...t},fetchPolicy:"no-cache",notifyOnNetworkStatusChange:this.options.notifyOnNetworkStatusChange};o.query=this.transformDocument(o.query),this.lastQuery=e?this.transformDocument(this.options.query):o.query;let a=!1;const c=this.options.fetchPolicy!=="no-cache";c||I(s,79);const{finalize:u,pushNotification:l}=this.pushOperation(F.fetchMore);return l({source:"newNetworkStatus",kind:"N",value:{}},{shouldEmit:3}),this.queryManager.fetchQuery(o,F.fetchMore).then(f=>{if(u(),c){const h=this.getCacheDiff();this.queryManager.cache.batch({update:p=>{s?p.updateQuery({query:this.query,variables:this.variables,returnPartialData:!0,optimistic:!1},d=>s(d,{fetchMoreResult:f.data,variables:o.variables})):p.writeQuery({query:o.query,variables:o.variables,data:f.data})},onWatchUpdated:(p,d)=>{p.watcher===this&&!B(d.result,h.result)&&(a=!0)}})}else{const h=this.getCurrentResult(),p=s(h.data,{fetchMoreResult:f.data,variables:o.variables});l({kind:"N",value:{...h,networkStatus:F.ready,loading:!1,data:p,dataState:h.dataState==="streaming"?"streaming":"complete"},source:"network"})}return this.maskResult(f)}).finally(()=>{u(),c&&!a&&l({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:n=>{const{updateQuery:i,onError:s}=e,{error:o}=n;if(o){s?s(o):I.error(80,o);return}i&&this.updateQuery((a,c)=>i(a,{subscriptionData:n,...c}))}});return this.subscriptions.add(t),()=>{this.subscriptions.delete(t)&&t.unsubscribe()}}applyOptions(e){const t=se(this.options,e||{});ps(this.options,t),this.updatePolling()}async setVariables(e){return e=this.getVariablesWithDefaults(e),B(this.variables,e)?dr(this.getCurrentResult()):(this.options.variables=e,this.hasObservers()?this._reobserve({fetchPolicy:this.options.initialFetchPolicy,variables:e},{newNetworkStatus:F.setVariables}):dr(this.getCurrentResult()))}updateQuery(e){const{queryManager:t}=this,{result:n,complete:i}=this.getCacheDiff({optimistic:!1}),s=e(n,{variables:this.variables,complete:!!i,previousData:n});s&&(t.cache.writeQuery({query:this.options.query,data:s,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:n="cache-first",initialFetchPolicy:i=n}=t;n==="standby"||(typeof t.nextFetchPolicy=="function"?t.fetchPolicy=t.nextFetchPolicy.call(t,n,{reason:e,options:t,observable:this,initialFetchPolicy:i}):e==="variables-changed"?t.fetchPolicy=i:t.fetchPolicy=t.nextFetchPolicy)}return t.fetchPolicy}fetch(e,t,n,i){const s=this.options.fetchPolicy;e.context??(e.context={});let o=!1;const a=()=>{o=!0},c=m=>new z(b=>{try{return m.subscribe({next(S){o=!0,b.next(S)},error:S=>b.error(S),complete:()=>b.complete()})}finally{o||(p.override=t,this.input.next({kind:"N",source:"newNetworkStatus",value:{resetError:!0},query:f,variables:h,meta:{shouldEmit:3,fetchPolicy:s}}))}});let{observable:u,fromLink:l}=this.queryManager.fetchObservableWithInfo(e,{networkStatus:t,query:n,onCacheHit:a,fetchQueryOperator:c,observableQuery:this});const{query:f,variables:h}=this,p={abort:()=>{y.unsubscribe()},query:f,variables:h};this.activeOperations.add(p);let d=t==F.refetch||t==F.setVariables;u=u.pipe(i,Or());const y=u.pipe(Tr({next:m=>{m.source==="newNetworkStatus"||m.kind==="N"&&m.value.loading?p.override=t:delete p.override},finalize:()=>this.activeOperations.delete(p)})).subscribe({next:m=>{const b={};d&&m.kind==="N"&&"loading"in m.value&&!m.value.loading&&(d=!1,b.shouldEmit=1),this.input.next({...m,query:f,variables:h,meta:b})}});return{fromLink:l,subscription:y,observable:u}}updatePolling(){if(this.queryManager.ssrMode)return;const{pollingInfo:e,options:{fetchPolicy:t,pollInterval:n}}=this;if(!n||!this.hasObservers()||t==="cache-only"){this.cancelPolling();return}if((e==null?void 0:e.interval)===n)return;const i=e||(this.pollingInfo={});i.interval=n;const s=()=>{var a,c;this.pollingInfo&&(!Fn(this.networkStatus)&&!((c=(a=this.options).skipPollAttempt)!=null&&c.call(a))?this._reobserve({fetchPolicy:this.options.initialFetchPolicy==="no-cache"?"no-cache":"network-only"},{newNetworkStatus:F.poll}).then(o,o):o())},o=()=>{const a=this.pollingInfo;a&&(clearTimeout(a.timeout),a.timeout=setTimeout(s,a.interval))};o()}cancelPolling(){this.pollingInfo&&(clearTimeout(this.pollingInfo.timeout),delete this.pollingInfo)}reobserve(e){return this._reobserve(e)}_reobserve(e,t){this.isTornDown=!1;let{newNetworkStatus:n}=t||{};this.queryManager.obsQueries.add(this);const i=n===F.refetch||n===F.poll,s=this.variables,o=this.options.fetchPolicy,a=se(this.options,e||{}),c=i?a:ps(this.options,a),u=this.transformDocument(c.query);this.lastQuery=u,e&&"variables"in e&&(c.variables=this.getVariablesWithDefaults(e.variables)),i||(this.updatePolling(),e&&e.variables&&!B(e.variables,s)&&c.fetchPolicy!=="standby"&&(c.fetchPolicy===o||typeof c.nextFetchPolicy=="function")&&(this.applyNextFetchPolicy("variables-changed",c),n===void 0&&(n=F.setVariables)));const l=this.networkStatus;n||(n=F.loading,l!==F.loading&&(e!=null&&e.variables)&&!B(e.variables,s)&&(n=F.setVariables),c.fetchPolicy==="standby"&&(n=F.ready)),c.fetchPolicy==="standby"&&this.cancelPolling(),this.resubscribeCache();const{promise:f,operator:h}=vl(b=>{switch(b.kind){case"E":throw b.error;case"N":if(b.source!=="newNetworkStatus"&&!b.value.loading)return b.value}},c.fetchPolicy==="standby"?{data:void 0}:void 0),{subscription:p,observable:d,fromLink:y}=this.fetch(c,n,u,h);!i&&(y||!this.linkSubscription)&&(this.linkSubscription&&this.linkSubscription.unsubscribe(),this.linkSubscription=p);const m=Object.assign(Pu(f.then(b=>dr(this.maskResult(b))).finally(()=>{!this.hasObservers()&&this.activeOperations.size===0&&this.tearDownQuery()})),{retain:()=>{const b=d.subscribe({}),S=()=>b.unsubscribe();return f.then(S,S),m}});return m}hasObservers(){return this.subject.observed}stop(){this.subject.complete(),this.initializeObservablesQueue(),this.tearDownQuery()}tearDownQuery(){var e;this.isTornDown||(this.resetNotifications(),(e=this.unsubscribeFromCache)==null||e.call(this),this.linkSubscription&&(this.linkSubscription.unsubscribe(),delete this.linkSubscription),this.stopPolling(),this.subscriptions.forEach(t=>t.unsubscribe()),this.subscriptions.clear(),this.queryManager.obsQueries.delete(this),this.isTornDown=!0,this.abortActiveOperations(),this._lastWrite=void 0)}transformDocument(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}}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 n=this.queryManager.getDocumentInfo(this.query);if(n.hasClientExports||n.hasForcedResolvers)return}const{dirty:t}=this;if(this.resetNotifications(),t&&(this.options.fetchPolicy=="cache-only"||this.options.fetchPolicy=="cache-and-network"||!this.activeOperations.size)){const n=this.getCacheDiff();B(n.result,this.getCacheDiff({optimistic:!1}).result)?this.reobserveCacheFirst():this.input.next({kind:"N",value:{data:n.result,dataState:n.complete?"complete":n.result?"partial":"empty",networkStatus:F.ready,loading:!1,error:void 0,partial:!n.complete},source:"cache",query:this.query,variables:this.variables,meta:{}})}}pushOperation(e){let t=!1;const{query:n,variables:i}=this,s=()=>{this.activeOperations.delete(o)},o={override:e,abort:()=>{t=!0,s()},query:n,variables:i};return this.activeOperations.add(o),{finalize:s,pushNotification:(a,c)=>{t||this.input.next({...a,query:n,variables:i,meta:{...c}})}}}calculateNetworkStatus(e){if(e===F.streaming)return e;const t=Array.from(this.activeOperations.values()).findLast(n=>xt(n,this)&&n.override!==void 0);return(t==null?void 0:t.override)??e}abortActiveOperations(){this.activeOperations.forEach(e=>e.abort())}reset(){const e=this.options.fetchPolicy==="cache-only";this.setResult(e?un:ot,{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}})}reobserveCacheFirst(){const{fetchPolicy:e,nextFetchPolicy:t}=this.options;e==="cache-and-network"||e==="network-only"?this.reobserve({fetchPolicy:"cache-first",nextFetchPolicy(n,i){return this.nextFetchPolicy=t,typeof this.nextFetchPolicy=="function"?this.nextFetchPolicy(n,i):e}}):this.reobserve()}getVariablesWithDefaults(e){return this.queryManager.getVariables(this.query,e)}}function xt(r,e){return!!(r&&e&&r.query===e.query&&B(r.variables,e.variables))}function vl(r,e){let t=e,n,i;const s=new Promise((a,c)=>{n=a,i=c}),o=Tr({next(a){try{const c=r(a);c!==void 0&&(t=c)}catch(c){i(c)}},finalize:()=>{if(t)n(t);else{const a="The operation was aborted.",c="AbortError";i(typeof DOMException<"u"?new DOMException(a,c):Object.assign(new Error(a),{name:c}))}}});return{promise:s,operator:o}}const ms={},lt=new WeakMap;function fn(r,e){const t=r[e];typeof t=="function"&&(r[e]=function(){return lt.set(r,(lt.get(r)+1)%1e15),t.apply(this,arguments)})}const ys=new WeakMap;class hn{constructor(e,t){v(this,"lastRequestId",1);v(this,"cache");v(this,"queryManager");v(this,"id");v(this,"observableQuery");v(this,"incremental");v(this,"_lastWrite");const n=this.cache=e.cache,i=(ys.get(e)||0)+1;ys.set(e,i),this.id=i+"",this.observableQuery=t,this.queryManager=e,lt.has(n)||(lt.set(n,0),fn(n,"evict"),fn(n,"modify"),fn(n,"reset"))}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:n}=this;return!(n&&n.dmCount===lt.get(this.cache)&&B(t,n.variables)&&B(e.data,n.result.data))}get hasNext(){return this.incremental?this.incremental.hasNext:!1}maybeHandleIncrementalResult(e,t,n){const{incrementalHandler:i}=this.queryManager;return i.isIncrementalResult(t)?(this.incremental||(this.incremental=i.startRequest({query:n})),this.incremental.handle(e,t)):t}markQueryResult(e,{document:t,variables:n,errorPolicy:i,cacheWriteBehavior:s}){var l;const o={query:t,variables:n,returnPartialData:!0,optimistic:!0};(l=this.observableQuery)==null||l.resetNotifications();const a=s===0,c=a?void 0:this.cache.diff(o);let u=this.maybeHandleIncrementalResult(c==null?void 0:c.result,e,t);return a||(dn(u,i)?this.cache.batch({onWatchUpdated:(f,h)=>{f.watcher===this.observableQuery&&(f.lastOwnDiff=h)},update:f=>{if(this.shouldWrite(u,n))f.writeQuery({query:t,data:u.data,variables:n,overwrite:s===1}),this.lastWrite={result:u,variables:n,dmCount:lt.get(this.cache)};else if(c&&c.complete){u={...u,data:c.result};return}const h=f.diff(o);h.complete&&(u={...u,data:h.result})}}):this.lastWrite=void 0),u}markMutationResult(e,t,n=this.cache){const i=[],s=t.cacheWriteBehavior===0;let o=this.maybeHandleIncrementalResult(s?void 0:n.diff({id:"ROOT_MUTATION",query:this.queryManager.getDocumentInfo(t.document).asQuery,variables:t.variables,optimistic:!1,returnPartialData:!0}).result,e,t.document);if(t.errorPolicy==="ignore"&&(o={...o,errors:[]}),ct(o)&&t.errorPolicy==="none")return Promise.resolve(o);const a=()=>({...o,dataState:this.hasNext?"streaming":"complete"});if(!s&&dn(o,t.errorPolicy)){i.push({result:o.data,dataId:"ROOT_MUTATION",query:t.document,variables:t.variables});const{updateQueries:u}=t;u&&this.queryManager.getObservableQueries("all").forEach(l=>{const f=l&&l.queryName;if(!f||!Object.hasOwnProperty.call(u,f))return;const h=u[f],{query:p,variables:d}=l,{result:y,complete:m}=l.getCacheDiff({optimistic:!1});if(m&&y){const b=h(y,{mutationResult:a(),queryName:p&&Ct(p)||void 0,queryVariables:d});b&&i.push({result:b,dataId:"ROOT_QUERY",query:p,variables:d})}})}let c=t.refetchQueries;if(typeof c=="function"&&(c=c(a())),i.length>0||(c||"").length>0||t.update||t.onQueryUpdated||t.removeOptimistic){const u=[];if(this.queryManager.refetchQueries({updateCache:l=>{s||i.forEach(h=>l.write(h));const{update:f}=t;if(f){if(!s){const h=l.diff({id:"ROOT_MUTATION",query:this.queryManager.getDocumentInfo(t.document).asQuery,variables:t.variables,optimistic:!1,returnPartialData:!0});h.complete&&(o={...o,data:h.result})}this.hasNext||f(l,o,{context:t.context,variables:t.variables})}!s&&!t.keepRootFields&&!this.hasNext&&l.modify({id:"ROOT_MUTATION",fields(h,{fieldName:p,DELETE:d}){return p==="__typename"?h:d}})},include:c,optimistic:!1,removeOptimistic:t.removeOptimistic,onQueryUpdated:t.onQueryUpdated||null}).forEach(l=>u.push(l)),t.awaitRefetchQueries||t.onQueryUpdated)return Promise.all(u).then(()=>o)}return Promise.resolve(o)}markMutationOptimistic(e,t){const n=typeof e=="function"?e(t.variables,{IGNORE:ms}):e;return n===ms?!1:(this.cache.recordOptimisticTransaction(i=>{try{this.markMutationResult({data:n},t,i)}catch(s){I.error(s)}},this.id),!0)}markSubscriptionResult(e,{document:t,variables:n,errorPolicy:i,cacheWriteBehavior:s}){s!==0&&(dn(e,i)&&this.cache.write({query:t,result:e.data,dataId:"ROOT_SUBSCRIPTION",variables:n}),this.queryManager.broadcastQueries())}}function dn(r,e="none"){const t=e==="ignore"||e==="all";let n=!ct(r);return!n&&t&&r.data&&(n=!0),n}class wl{constructor(e){v(this,"defaultOptions");v(this,"client");v(this,"clientOptions");v(this,"assumeImmutableResults");v(this,"documentTransform");v(this,"ssrMode");v(this,"defaultContext");v(this,"dataMasking");v(this,"incrementalHandler");v(this,"localState");v(this,"queryDeduplication");v(this,"prioritizeCacheValues",!1);v(this,"onBroadcast");v(this,"mutationStore");v(this,"obsQueries",new Set);v(this,"fetchCancelFns",new Map);v(this,"transformCache",new Mo(Se["queryManager.getDocumentInfo"]||2e3));v(this,"requestIdCounter",1);v(this,"inFlightLinkObservables",new Me(!1));v(this,"noCacheWarningsByCause",new WeakSet);const t=new we(i=>this.cache.transformDocument(i),{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 n=e.documentTransform;this.documentTransform=n?t.concat(n).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(oe(83))}cancelPendingFetches(e){this.fetchCancelFns.forEach(t=>t(e)),this.fetchCancelFns.clear()}async mutate({mutation:e,variables:t,optimisticResponse:n,updateQueries:i,refetchQueries:s=[],awaitRefetchQueries:o=!1,update:a,onQueryUpdated:c,fetchPolicy:u,errorPolicy:l,keepRootFields:f,context:h}){const p=new hn(this);e=this.cache.transformForLink(this.transform(e));const{hasClientExports:d}=this.getDocumentInfo(e);t=this.getVariables(e,t),d&&(t=await this.localState.getExportedVariables({client:this.client,document:e,variables:t,context:h}));const y=this.mutationStore&&(this.mutationStore[p.id]={mutation:e,variables:t,loading:!0,error:null}),m=n&&p.markMutationOptimistic(n,{document:e,variables:t,cacheWriteBehavior:u==="no-cache"?0:2,errorPolicy:l,context:h,updateQueries:i,update:a,keepRootFields:f});return this.broadcastQueries(),new Promise((b,S)=>{const O={};return this.getObservableFromLink(e,{...h,optimisticResponse:m?n:void 0},t,{},!1).observable.pipe(bs(),at(E=>{const k={...E};return Ue(p.markMutationResult(k,{document:e,variables:t,cacheWriteBehavior:u==="no-cache"?0:2,errorPolicy:l,context:h,update:a,updateQueries:i,awaitRefetchQueries:o,refetchQueries:s,removeOptimistic:m?p.id:void 0,onQueryUpdated:c,keepRootFields:f}))})).pipe(Qe(E=>{if(ct(E)&&l==="none")throw new Ve(E);return y&&(y.loading=!1,y.error=null),E})).subscribe({next:E=>{if(this.broadcastQueries(),!p.hasNext){const k={data:this.maskOperation({document:e,data:E.data,fetchPolicy:u,cause:O})};ct(E)&&(k.error=new Ve(E)),Object.keys(E.extensions||{}).length&&(k.extensions=E.extensions),b(k)}},error:E=>{if(y&&(y.loading=!1,y.error=E),m&&this.cache.removeOptimistic(p.id),this.broadcastQueries(),l==="ignore")return b({data:void 0});if(l==="all")return b({data:void 0,error:E});S(E)}})})}fetchQuery(e,t){return Ie(e.query,Be.QUERY),(async()=>Wc(this.fetchObservableWithInfo(e,{networkStatus:t}).observable.pipe(Cn(n=>{switch(n.kind){case"E":throw n.error;case"N":if(n.source!=="newNetworkStatus")return dr(n.value)}})),{defaultValue:{data:void 0}}))()}transform(e){return this.documentTransform.transformDocument(e)}getDocumentInfo(e){const{transformCache:t}=this;if(!t.has(e)){const i=Ee(e),s={hasClientExports:qt(["client","export"],e,!0),hasForcedResolvers:Du(e),hasNonreactiveDirective:qt(["nonreactive"],e),hasIncrementalDirective:qt(["defer"],e),nonReactiveQuery:Sl(e),clientQuery:qt(["client"],e)?e:null,serverQuery:Au([{name:"client",remove:!0},{name:"connection"},{name:"nonreactive"},{name:"unmask"}],e),operationType:i==null?void 0:i.operation,defaultVars:li(i),asQuery:{...e,definitions:e.definitions.map(o=>o.kind==="OperationDefinition"&&o.operation!=="query"?{...o,operation:"query"}:o)}};t.set(e,s)}const n=t.get(e);if(n.violation)throw n.violation;return n}getVariables(e,t){const n=this.getDocumentInfo(e).defaultVars,i=Object.entries(t??{}).map(([s,o])=>[s,o===void 0?n[s]:o]);return{...n,...Object.fromEntries(i)}}watchQuery(e){Ie(e.query,Be.QUERY);const t=this.transform(e.query);return e={...e,variables:this.getVariables(t,e.variables)},typeof e.notifyOnNetworkStatusChange>"u"&&(e.notifyOnNetworkStatusChange=!0),new ln({queryManager:this,options:e,transformedQuery:t})}query(e){const t=this.transform(e.query);return this.fetchQuery({...e,query:t}).then(n=>({...n,data:this.maskOperation({document:t,data:n==null?void 0:n.data,fetchPolicy:e.fetchPolicy})}))}generateRequestId(){return this.requestIdCounter++}clearStore(e={discardWatches:!0}){return this.cancelPendingFetches(oe(85)),this.obsQueries.forEach(t=>{t.reset()}),this.mutationStore&&(this.mutationStore={}),this.cache.reset(e)}getObservableQueries(e="active"){const t=new Set,n=new Map,i=new Map,s=new Set;return Array.isArray(e)&&e.forEach(o=>{if(typeof o=="string")n.set(o,o),i.set(o,!1);else if(Iu(o)){const a=ht(this.transform(o));n.set(a,Ct(o)),i.set(a,!1)}else X(o)&&o.query&&s.add(o)}),this.obsQueries.forEach(o=>{const a=ht(this.transform(o.options.query));if(e==="all"){t.add(o);return}const{queryName:c,options:{fetchPolicy:u}}=o;e==="active"&&u==="standby"||(e==="active"||c&&i.has(c)||a&&i.has(a))&&(t.add(o),c&&i.set(c,!0),a&&i.set(a,!0))}),s.size&&s.forEach(o=>{const a=new ln({queryManager:this,options:{...o,fetchPolicy:"network-only"}});t.add(a)}),t}refetchObservableQueries(e=!1){const t=[];return this.getObservableQueries(e?"all":"active").forEach(n=>{const{fetchPolicy:i}=n.options;(e||i!=="standby")&&i!=="cache-only"&&t.push(n.refetch())}),this.broadcastQueries(),Promise.all(t)}startGraphQLSubscription(e){let{query:t,variables:n}=e;const{fetchPolicy:i,errorPolicy:s="none",context:o={},extensions:a={}}=e;Ie(t,Be.SUBSCRIPTION),t=this.transform(t),n=this.getVariables(t,n);let c;const u=(this.getDocumentInfo(t).hasClientExports?Ue(this.localState.getExportedVariables({client:this.client,document:t,variables:n,context:o})):Le(n)).pipe(at(l=>{const{observable:f,restart:h}=this.getObservableFromLink(t,o,l,a),p=new hn(this);return c=h,f.pipe(Qe(d=>{p.markSubscriptionResult(d,{document:t,variables:l,errorPolicy:s,cacheWriteBehavior:i==="no-cache"?0:2});const y={data:d.data??void 0};return ct(d)?y.error=new Ve(d):bl(d)&&(y.error=d.extensions[Rr],delete d.extensions[Rr]),d.extensions&&Object.keys(d.extensions).length&&(y.extensions=d.extensions),y.error&&s==="none"&&(y.data=void 0),s==="ignore"&&delete y.error,y}),hr(d=>Le(s==="ignore"?{data:void 0}:{data:void 0,error:d})),Gc(d=>!!(d.data||d.error)))}));return Object.assign(u,{restart:()=>c==null?void 0:c()})}broadcastQueries(){this.onBroadcast&&this.onBroadcast(),this.obsQueries.forEach(e=>e.notify())}getObservableFromLink(e,t,n,i,s=(t==null?void 0:t.queryDeduplication)??this.queryDeduplication){let o={};const{serverQuery:a,clientQuery:c,operationType:u,hasIncrementalDirective:l}=this.getDocumentInfo(e),f=Ct(e),h={client:this.client};if(a){const{inFlightLinkObservables:p,link:d}=this;try{let m=function(b){return new z(S=>{function O(){return b.subscribe({next:S.next.bind(S),complete:S.complete.bind(S),error:S.error.bind(S)})}let E=O();return o.restart||(o.restart=()=>{E.unsubscribe(),E=O()}),()=>{E.unsubscribe(),o.restart=void 0}})};const y=this.incrementalHandler.prepareRequest({query:a,variables:n,context:{...this.defaultContext,...t,queryDeduplication:s},extensions:i});if(t=y.context,s){const b=ht(a),S=Ne(n);o=p.lookup(b,S),o.observable||(o.observable=Rn(d,y,h).pipe(m,Yc(()=>{p.peek(b,S)===o&&p.remove(b,S)}),u===Be.SUBSCRIPTION?Or():Xc({refCount:!0})))}else o.observable=Rn(d,y,h).pipe(m)}catch(y){o.observable=Eo(()=>y)}}else o.observable=Le({data:{}});if(c){const{operation:p}=Ee(e);I(!l,90,p[0].toUpperCase()+p.slice(1),f??"(anonymous)"),o.observable=o.observable.pipe(at(d=>Ue(this.localState.execute({client:this.client,document:c,remoteResult:d,context:t,variables:n}))))}return{restart:()=>{var p;return(p=o.restart)==null?void 0:p.call(o)},observable:o.observable.pipe(hr(p=>{throw p=gl(p),yl(p),p}))}}getResultsFromLink(e,{queryInfo:t,cacheWriteBehavior:n,observableQuery:i}){const s=t.lastRequestId=this.generateRequestId(),{errorPolicy:o}=e,a=this.cache.transformForLink(e.query);return this.getObservableFromLink(a,e.context,e.variables).observable.pipe(Qe(c=>{const u=t.markQueryResult(c,{...e,document:a,cacheWriteBehavior:n}),l=ct(u);if(l&&o==="none")throw t.resetLastWrite(),i==null||i.resetNotifications(),new Ve(u);const f={data:u.data,...t.hasNext?{loading:!0,networkStatus:F.streaming,dataState:"streaming",partial:!0}:{dataState:u.data?"complete":"empty",loading:!1,networkStatus:F.ready,partial:!u.data}};return l&&(o==="none"&&(f.data=void 0,f.dataState="empty"),o!=="ignore"&&(f.error=new Ve(u),f.dataState!=="streaming"&&(f.networkStatus=F.error))),f}),hr(c=>{if(s>=t.lastRequestId&&o==="none")throw t.resetLastWrite(),i==null||i.resetNotifications(),c;const u={data:void 0,dataState:"empty",loading:!1,networkStatus:F.ready,partial:!0};return o!=="ignore"&&(u.error=c,u.networkStatus=F.error),Le(u)}))}fetchObservableWithInfo(e,{networkStatus:t=F.loading,query:n=e.query,fetchQueryOperator:i=a=>a,onCacheHit:s=()=>{},observableQuery:o}){const a=this.getVariables(n,e.variables),c=this.defaultOptions.watchQuery;let{fetchPolicy:u=c&&c.fetchPolicy||"cache-first",errorPolicy:l=c&&c.errorPolicy||"none",returnPartialData:f=!1,notifyOnNetworkStatusChange:h=!0,context:p={}}=e;this.prioritizeCacheValues&&(u==="network-only"||u==="cache-and-network")&&(u="cache-first");const d=Object.assign({},e,{query:n,variables:a,fetchPolicy:u,errorPolicy:l,returnPartialData:f,notifyOnNetworkStatusChange:h,context:p}),y=new hn(this,o),m=k=>{d.variables=k;const M=u==="no-cache"?0:t===F.refetch&&d.refetchWritePolicy!=="merge"?1:2,A=this.fetchQueryByPolicy(d,{queryInfo:y,cacheWriteBehavior:M,onCacheHit:s,observableQuery:o});return A.observable=A.observable.pipe(i),d.fetchPolicy!=="standby"&&(o==null||o.applyNextFetchPolicy("after-fetch",e)),A},b=()=>{this.fetchCancelFns.delete(y.id)};this.fetchCancelFns.set(y.id,k=>{S.next({kind:"E",error:k,source:"network"})});const S=new Dt;let O,E;if(this.getDocumentInfo(d.query).hasClientExports)O=Ue(this.localState.getExportedVariables({client:this.client,document:d.query,variables:d.variables,context:d.context})).pipe(at(k=>m(k).observable)),E=!0;else{const k=m(d.variables);E=k.fromLink,O=k.observable}return{observable:new z(k=>{k.add(b),O.subscribe(k),S.subscribe(k)}).pipe(Or()),fromLink:E}}refetchQueries({updateCache:e,include:t,optimistic:n=!1,removeOptimistic:i=n?Ys("refetchQueries"):void 0,onQueryUpdated:s}){const o=new Map;t&&this.getObservableQueries(t).forEach(c=>{if(c.options.fetchPolicy==="cache-only")return;const u=c.getCurrentResult();o.set(c,{oq:c,lastDiff:{result:u==null?void 0:u.data,complete:!(u!=null&&u.partial)}})});const a=new Map;if(e){const c=new Set;this.cache.batch({update:e,optimistic:n&&i||!1,removeOptimistic:i,onWatchUpdated(u,l,f){const h=u.watcher;if(h instanceof ln&&!c.has(h)){if(c.add(h),s){o.delete(h);let p=s(h,l,f);return p===!0&&(p=h.refetch().retain()),p!==!1&&a.set(h,p),p}s!==null&&h.options.fetchPolicy!=="cache-only"&&o.set(h,{oq:h,lastDiff:f,diff:l})}}})}return o.size&&o.forEach(({oq:c,lastDiff:u,diff:l})=>{let f;s&&(l||(l=c.getCacheDiff()),f=s(c,l,u)),(!s||f===!0)&&(f=c.refetch().retain()),f!==!1&&a.set(c,f)}),i&&this.cache.removeOptimistic(i),a}maskOperation(e){const{document:t,data:n}=e;return this.dataMasking?sl(n,t,this.cache):n}maskFragment(e){const{data:t,fragment:n,fragmentName:i}=e;return this.dataMasking?il(t,n,this.cache,i):t}fetchQueryByPolicy({query:e,variables:t,fetchPolicy:n,errorPolicy:i,returnPartialData:s,context:o},{cacheWriteBehavior:a,onCacheHit:c,queryInfo:u,observableQuery:l}){const f=()=>this.cache.diff({query:e,variables:t,returnPartialData:!0,optimistic:!0}),h=(d,y)=>{const m=d.result,b=O=>(!d.complete&&!s&&(O=void 0),{data:O,dataState:d.complete?"complete":O?"partial":"empty",loading:Fn(y),networkStatus:y,partial:!d.complete}),S=O=>Le({kind:"N",value:b(O),source:"cache"});return(d.complete||s)&&this.getDocumentInfo(e).hasForcedResolvers?(c(),Ue(this.localState.execute({client:this.client,document:e,remoteResult:m?{data:m}:void 0,context:o,variables:t,onlyRunForcedResolvers:!0,returnPartialData:!0}).then(O=>({kind:"N",value:b(O.data||void 0),source:"cache"})))):i==="none"&&y===F.refetch&&d.missing?S(void 0):S(m||void 0)},p=()=>this.getResultsFromLink({query:e,variables:t,context:o,fetchPolicy:n,errorPolicy:i},{cacheWriteBehavior:a,queryInfo:u,observableQuery:l}).pipe(bs(),Kc(),Qe(d=>({...d,source:"network"})));switch(n){default:case"cache-first":{const d=f();return d.complete?{fromLink:!1,observable:h(d,F.ready)}:s?{fromLink:!0,observable:Xr(h(d,F.loading),p())}:{fromLink:!0,observable:p()}}case"cache-and-network":{const d=f();return d.complete||s?{fromLink:!0,observable:Xr(h(d,F.loading),p())}:{fromLink:!0,observable:p()}}case"cache-only":return{fromLink:!1,observable:Xr(h(f(),F.ready))};case"network-only":return{fromLink:!0,observable:p()};case"no-cache":return{fromLink:!0,observable:p()};case"standby":return{fromLink:!1,observable:Er}}}}function bs(){let r=!1;return Tr({next(){r=!0},complete(){I(r,94)}})}function Sl(r){return ye(r,{FragmentSpread:e=>{var t;if(!((t=e.directives)!=null&&t.some(n=>n.name.value==="unmask")))return{...e,directives:[...e.directives||[],{kind:P.DIRECTIVE,name:{kind:P.NAME,value:"nonreactive"}}]}}})}class dd{constructor(e){v(this,"link");v(this,"cache");v(this,"disableNetworkFetches");v(this,"version");v(this,"queryDeduplication");v(this,"defaultOptions");v(this,"devtoolsConfig");v(this,"queryManager");v(this,"devToolsHookCb");v(this,"resetStoreCallbacks",[]);v(this,"clearStoreCallbacks",[]);v(this,"reFetchObservableQueries");v(this,"maskedFragmentTransform",new we(ju));const{cache:t,documentTransform:n,ssrMode:i=!1,ssrForceFetchDelay:s=0,queryDeduplication:o=!0,defaultOptions:a,defaultContext:c,assumeImmutableResults:u=t.assumeImmutableResults,localState:l,devtools:f,dataMasking:h,link:p,incrementalHandler:d=new Bu}=e;this.link=p,this.cache=t,this.queryDeduplication=o,this.defaultOptions=a||{},this.devtoolsConfig={...f,enabled:(f==null?void 0:f.enabled)??Ba},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=Zn,this.queryManager=new wl({client:this,defaultOptions:this.defaultOptions,defaultContext:c,documentTransform:n,queryDeduplication:o,ssrMode:i,dataMasking:!!h,clientOptions:e,incrementalHandler:d,assumeImmutableResults:u,onBroadcast:this.devtoolsConfig.enabled?()=>{this.devToolsHookCb&&this.devToolsHookCb()}:void 0,localState:l}),this.prioritizeCacheValues=i||s>0,s&&setTimeout(()=>{this.prioritizeCacheValues=!1},s),this.devtoolsConfig.enabled&&this.connectToDevTools()}set prioritizeCacheValues(e){this.queryManager.prioritizeCacheValues=e}get prioritizeCacheValues(){return this.queryManager.prioritizeCacheValues}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()}watchQuery(e){return this.defaultOptions.watchQuery&&(e=nn(this.defaultOptions.watchQuery,e)),this.queryManager.watchQuery(e)}query(e){return this.defaultOptions.query&&(e=nn(this.defaultOptions.query,e)),this.queryManager.query(e)}mutate(e){const t=nn(se({fetchPolicy:"network-only",errorPolicy:"none"},this.defaultOptions.mutate),e);return Ie(t.mutation,Be.MUTATION),this.queryManager.mutate(t)}subscribe(e){const t={},n=this.queryManager.startGraphQLSubscription(e),i=n.pipe(Qe(s=>({...s,data:this.queryManager.maskOperation({document:e.query,data:s.data,fetchPolicy:e.fetchPolicy,cause:t})})));return Object.assign(i,{restart:n.restart})}readQuery(e,t=!1){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)}).pipe(Qe(n=>n))}readFragment(e,t=!1){return this.cache.readFragment({...e,fragment:this.transform(e.fragment)},t)}writeQuery(e){const t=this.cache.writeQuery(e);return e.broadcast!==!1&&this.queryManager.broadcastQueries(),t}writeFragment(e){const t=this.cache.writeFragment(e);return e.broadcast!==!1&&this.queryManager.broadcastQueries(),t}__actionHookForDevTools(e){this.devToolsHookCb=e}__requestRaw(e){return Rn(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(e){return this.queryManager.refetchObservableQueries(e)}refetchQueries(e){const t=this.queryManager.refetchQueries(e),n=[],i=[];t.forEach((o,a)=>{n.push(a),i.push(o)});const s=Promise.all(i);return s.queries=n,s.results=i,s.catch(o=>{}),s}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}transform(e,t=!1){const n=this.queryManager.transform(e);return t?this.maskedFragmentTransform.transformDocument(n):n}}const{hasOwnProperty:gs}=Object.prototype;function El(r){return X(r)&&"payload"in r}async function*Ol(r){var h;const e=new TextDecoder("utf-8"),t=(h=r.headers)==null?void 0:h.get("content-type"),n=t==null?void 0:t.match(/;\s*boundary=(?:'([^']+)'|"([^"]+)"|([^"'].+?))\s*(?:;|$)/i),i=`\r
|
|
41
|
+
--`+((n==null?void 0:n.findLast(p=>!!p))||"-");let s="";I(r.body&&typeof r.body.getReader=="function",60);const a=r.body.getReader();let c=!1,u=!1,l;const f=()=>u&&s[0]=="-"&&s[1]=="-";try{for(;!c;){({value:l,done:c}=await a.read());const p=typeof l=="string"?l:e.decode(l),d=s.length-i.length+1;s+=p;let y=s.indexOf(i,d);for(;y>-1&&!f();){u=!0;let m;[m,s]=[s.slice(0,y),s.slice(y+i.length)];const b=m.indexOf(`\r
|
|
42
|
+
\r
|
|
43
|
+
`),O=kl(m.slice(0,b))["content-type"];if(O&&O.toLowerCase().indexOf("application/json")===-1)throw new Error("Unsupported patch content type: application/json is required.");const E=m.slice(b);E&&(yield E),y=s.indexOf(i)}if(f())return}throw new Error("premature end of multipart body")}finally{a.cancel()}}async function Tl(r,e){for await(const t of Ol(r)){const n=ea(r,t);if(Object.keys(n).length!=0)if(El(n)){if(Object.keys(n).length===1&&n.payload===null)return;let i={...n.payload};"errors"in n&&(i.extensions={...i.extensions,[Rr]:new Cr(n.errors??[])}),e(i)}else e(n)}}function kl(r){const e={};return r.split(`
|
|
44
|
+
`).forEach(t=>{const n=t.indexOf(":");if(n>-1){const i=t.slice(0,n).trim().toLowerCase(),s=t.slice(n+1).trim();e[i]=s}}),e}function ea(r,e){if(r.status>=300)throw new qr(`Response not successful: Received status code ${r.status}`,{response:r,bodyText:e});try{return JSON.parse(e)}catch(t){throw new Lr(t,{response:r,bodyText:e})}}function Cl(r,e){try{return JSON.parse(e)}catch(t){throw new Lr(t,{response:r,bodyText:e})}}function Rl(r,e){const t=r.headers.get("content-type");return t!=null&&t.includes("application/graphql-response+json")?Cl(r,e):ea(r,e)}function Fl(r){return e=>e.text().then(t=>{const n=Rl(e,t);if(!Array.isArray(n)&&!gs.call(n,"data")&&!gs.call(n,"errors"))throw new qr(`Server response was malformed for query '${Array.isArray(r)?r.map(i=>i.operationName):r.operationName}'.`,{response:e,bodyText:t});return n})}const _l={includeQuery:!0,includeExtensions:!0,preserveHeaderCase:!1},Dl={accept:"application/graphql-response+json,application/json;q=0.9","content-type":"application/json"},Il={method:"POST"},Nl={http:_l,headers:Dl,options:Il},Pl=(r,e)=>e(r);function Al(r,e,...t){let n={},i={};t.forEach(l=>{var f;n={...n,...l.options,headers:{...n.headers,...l.headers}},l.credentials&&(n.credentials=l.credentials),n.headers.accept=(((f=l.http)==null?void 0:f.accept)||[]).concat(n.headers.accept).join(","),i={...i,...l.http}}),n.headers=xl(n.headers,i.preserveHeaderCase);const{operationName:s,extensions:o,variables:a,query:c}=r,u={operationName:s,variables:a};return i.includeExtensions&&Object.keys(o||{}).length&&(u.extensions=o),i.includeQuery&&(u.query=e(c,ht)),{options:n,body:u}}function xl(r,e){if(!e){const i={};return Object.keys(Object(r)).forEach(s=>{i[s.toLowerCase()]=r[s]}),i}const t={};Object.keys(Object(r)).forEach(i=>{t[i.toLowerCase()]={originalName:i,value:r[i]}});const n={};return Object.keys(t).forEach(i=>{n[t[i].originalName]=t[i].value}),n}const Ml=(r,e)=>{const n=r.getContext().uri;return n||(typeof e=="function"?e(r):e||"/graphql")};function jl(r,e){const t=[],n=(u,l)=>{t.push(`${u}=${encodeURIComponent(l)}`)};if("query"in e&&n("query",e.query),e.operationName&&n("operationName",e.operationName),e.variables){let u;try{u=JSON.stringify(e.variables)}catch(l){return{parseError:l}}n("variables",u)}if(e.extensions){let u;try{u=JSON.stringify(e.extensions)}catch(l){return{parseError:l}}n("extensions",u)}let i="",s=r;const o=r.indexOf("#");o!==-1&&(i=r.substr(o),s=r.substr(0,o));const a=s.indexOf("?")===-1?"?":"&";return{newURI:s+a+t.join("&")+i}}const ql=ke(()=>fetch);function Ll(){}class Ul extends te{constructor(e={}){let{uri:t="/graphql",fetch:n,print:i=Pl,includeExtensions:s,preserveHeaderCase:o,useGETForQueries:a,includeUnusedVariables:c=!1,...u}=e;const l={http:se({includeExtensions:s,preserveHeaderCase:o}),options:u.fetchOptions,credentials:u.credentials,headers:u.headers};super(f=>{let h=Ml(f,t);const p=f.getContext(),d={...p.http};Hu(f.query)&&(d.accept=["multipart/mixed;boundary=graphql;subscriptionSpec=1.0",...d.accept||[]]);const y={http:d,options:p.fetchOptions,credentials:p.credentials,headers:p.headers},{options:m,body:b}=Al(f,i,Nl,l,y);b.variables&&!c&&(b.variables=zu(b.variables,f.query));let S=new AbortController,O=()=>{S=void 0};if(m.signal){const E=m.signal,k=()=>{S==null||S.abort(E.reason)};E.addEventListener("abort",k,{once:!0}),O=()=>{S==null||S.signal.removeEventListener("abort",O),S=void 0,E.removeEventListener("abort",k),O=Ll},S.signal.addEventListener("abort",O,{once:!0})}return m.signal=S.signal,a&&!$u(f.query)&&(m.method="GET"),new z(E=>{if(m.method==="GET"){const{newURI:A,parseError:V}=jl(h,b);if(V)throw V;h=A}else m.body=JSON.stringify(b);const k=n||ke(()=>fetch)||ql,M=E.next.bind(E);return k(h,m).then(A=>{var fe;f.setContext({response:A});const V=(fe=A.headers)==null?void 0:fe.get("content-type");return V!==null&&/^multipart\/mixed/i.test(V)?Tl(A,M):Fl(f)(A).then(M)}).then(()=>{O(),E.complete()}).catch(A=>{O(),E.error(A)}),()=>{S&&S.abort()}})})}}class Vl extends te{constructor(e={}){super((t,n)=>{const i=t.client,s=i.queryManager.clientOptions,o=t.getContext();{const{name:a,version:c,transport:u="headers"}=se({},s.clientAwareness,e.clientAwareness,o.clientAwareness);u==="headers"&&t.setContext(({headers:l,extensions:f})=>({headers:se({"apollographql-client-name":a,"apollographql-client-version":c},l)}))}{const{transport:a="extensions"}=se({},s.enhancedClientAwareness,e.enhancedClientAwareness);a==="extensions"&&(t.extensions=se({clientLibrary:{name:"@apollo/client",version:i.version}},t.extensions))}return n(t)})}}class Bl extends te{constructor(e={}){const{left:t,right:n,request:i}=te.from([new Vl(e),new Ul(e)]);super(i),Object.assign(this,{left:t,right:n})}}const pd=(r={})=>new Bl(r);var bi=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(r){return this.listeners.add(r),this.onSubscribe(),()=>{this.listeners.delete(r),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Ql={setTimeout:(r,e)=>setTimeout(r,e),clearTimeout:r=>clearTimeout(r),setInterval:(r,e)=>setInterval(r,e),clearInterval:r=>clearInterval(r)},Ce,Xn,Qs,zl=(Qs=class{constructor(){N(this,Ce,Ql);N(this,Xn,!1)}setTimeoutProvider(r){C(this,Ce,r)}setTimeout(r,e){return w(this,Ce).setTimeout(r,e)}clearTimeout(r){w(this,Ce).clearTimeout(r)}setInterval(r,e){return w(this,Ce).setInterval(r,e)}clearInterval(r){w(this,Ce).clearInterval(r)}},Ce=new WeakMap,Xn=new WeakMap,Qs),ze=new zl;function Wl(r){setTimeout(r,0)}var rt=typeof window>"u"||"Deno"in globalThis;function Jt(){}function md(r,e){return typeof r=="function"?r(e):r}function Pn(r){return typeof r=="number"&&r>=0&&r!==1/0}function ta(r,e){return Math.max(r+(e||0)-Date.now(),0)}function pt(r,e){return typeof r=="function"?r(e):r}function ne(r,e){return typeof r=="function"?r(e):r}function yd(r,e){const{type:t="all",exact:n,fetchStatus:i,predicate:s,queryKey:o,stale:a}=r;if(o){if(n){if(e.queryHash!==$l(o,e.options))return!1}else if(!gi(e.queryKey,o))return!1}if(t!=="all"){const c=e.isActive();if(t==="active"&&!c||t==="inactive"&&c)return!1}return!(typeof a=="boolean"&&e.isStale()!==a||i&&i!==e.state.fetchStatus||s&&!s(e))}function bd(r,e){const{exact:t,status:n,predicate:i,mutationKey:s}=r;if(s){if(!e.options.mutationKey)return!1;if(t){if(An(e.options.mutationKey)!==An(s))return!1}else if(!gi(e.options.mutationKey,s))return!1}return!(n&&e.state.status!==n||i&&!i(e))}function $l(r,e){return((e==null?void 0:e.queryKeyHashFn)||An)(r)}function An(r){return JSON.stringify(r,(e,t)=>Mn(t)?Object.keys(t).sort().reduce((n,i)=>(n[i]=t[i],n),{}):t)}function gi(r,e){return r===e?!0:typeof r!=typeof e?!1:r&&e&&typeof r=="object"&&typeof e=="object"?Object.keys(e).every(t=>gi(r[t],e[t])):!1}var Hl=Object.prototype.hasOwnProperty;function ra(r,e){if(r===e)return r;const t=vs(r)&&vs(e);if(!t&&!(Mn(r)&&Mn(e)))return e;const i=(t?r:Object.keys(r)).length,s=t?e:Object.keys(e),o=s.length,a=t?new Array(o):{};let c=0;for(let u=0;u<o;u++){const l=t?u:s[u],f=r[l],h=e[l];if(f===h){a[l]=f,(t?u<i:Hl.call(r,l))&&c++;continue}if(f===null||h===null||typeof f!="object"||typeof h!="object"){a[l]=h;continue}const p=ra(f,h);a[l]=p,p===f&&c++}return i===o&&c===i?r:a}function xn(r,e){if(!e||Object.keys(r).length!==Object.keys(e).length)return!1;for(const t in r)if(r[t]!==e[t])return!1;return!0}function vs(r){return Array.isArray(r)&&r.length===Object.keys(r).length}function Mn(r){if(!ws(r))return!1;const e=r.constructor;if(e===void 0)return!0;const t=e.prototype;return!(!ws(t)||!t.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(r)!==Object.prototype)}function ws(r){return Object.prototype.toString.call(r)==="[object Object]"}function Jl(r){return new Promise(e=>{ze.setTimeout(e,r)})}function jn(r,e,t){return typeof t.structuralSharing=="function"?t.structuralSharing(r,e):t.structuralSharing!==!1?ra(r,e):e}function gd(r){return r}function vd(r,e,t=0){const n=[...r,e];return t&&n.length>t?n.slice(1):n}function wd(r,e,t=0){const n=[e,...r];return t&&n.length>t?n.slice(0,-1):n}var na=Symbol();function Gl(r,e){return!r.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!r.queryFn||r.queryFn===na?()=>Promise.reject(new Error(`Missing queryFn: '${r.queryHash}'`)):r.queryFn}function Yl(r,e){return typeof r=="function"?r(...e):!!r}var $e,Re,mt,zs,Kl=(zs=class extends bi{constructor(){super();N(this,$e);N(this,Re);N(this,mt);C(this,mt,e=>{if(!rt&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}})}onSubscribe(){w(this,Re)||this.setEventListener(w(this,mt))}onUnsubscribe(){var e;this.hasListeners()||((e=w(this,Re))==null||e.call(this),C(this,Re,void 0))}setEventListener(e){var t;C(this,mt,e),(t=w(this,Re))==null||t.call(this),C(this,Re,e(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(e){w(this,$e)!==e&&(C(this,$e,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){var e;return typeof w(this,$e)=="boolean"?w(this,$e):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},$e=new WeakMap,Re=new WeakMap,mt=new WeakMap,zs),ia=new Kl;function qn(){let r,e;const t=new Promise((i,s)=>{r=i,e=s});t.status="pending",t.catch(()=>{});function n(i){Object.assign(t,i),delete t.resolve,delete t.reject}return t.resolve=i=>{n({status:"fulfilled",value:i}),r(i)},t.reject=i=>{n({status:"rejected",reason:i}),e(i)},t}var Xl=Wl;function Zl(){let r=[],e=0,t=a=>{a()},n=a=>{a()},i=Xl;const s=a=>{e?r.push(a):i(()=>{t(a)})},o=()=>{const a=r;r=[],a.length&&i(()=>{n(()=>{a.forEach(c=>{t(c)})})})};return{batch:a=>{let c;e++;try{c=a()}finally{e--,e||o()}return c},batchCalls:a=>(...c)=>{s(()=>{a(...c)})},schedule:s,setNotifyFunction:a=>{t=a},setBatchNotifyFunction:a=>{n=a},setScheduler:a=>{i=a}}}var vi=Zl(),yt,Fe,bt,Ws,ef=(Ws=class extends bi{constructor(){super();N(this,yt,!0);N(this,Fe);N(this,bt);C(this,bt,e=>{if(!rt&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}})}onSubscribe(){w(this,Fe)||this.setEventListener(w(this,bt))}onUnsubscribe(){var e;this.hasListeners()||((e=w(this,Fe))==null||e.call(this),C(this,Fe,void 0))}setEventListener(e){var t;C(this,bt,e),(t=w(this,Fe))==null||t.call(this),C(this,Fe,e(this.setOnline.bind(this)))}setOnline(e){w(this,yt)!==e&&(C(this,yt,e),this.listeners.forEach(n=>{n(e)}))}isOnline(){return w(this,yt)}},yt=new WeakMap,Fe=new WeakMap,bt=new WeakMap,Ws),sa=new ef;function tf(r){return Math.min(1e3*2**r,3e4)}function oa(r){return(r??"online")==="online"?sa.isOnline():!0}var Ln=class extends Error{constructor(r){super("CancelledError"),this.revert=r==null?void 0:r.revert,this.silent=r==null?void 0:r.silent}};function rf(r){let e=!1,t=0,n;const i=qn(),s=()=>i.status!=="pending",o=y=>{var m;if(!s()){const b=new Ln(y);h(b),(m=r.onCancel)==null||m.call(r,b)}},a=()=>{e=!0},c=()=>{e=!1},u=()=>ia.isFocused()&&(r.networkMode==="always"||sa.isOnline())&&r.canRun(),l=()=>oa(r.networkMode)&&r.canRun(),f=y=>{s()||(n==null||n(),i.resolve(y))},h=y=>{s()||(n==null||n(),i.reject(y))},p=()=>new Promise(y=>{var m;n=b=>{(s()||u())&&y(b)},(m=r.onPause)==null||m.call(r)}).then(()=>{var y;n=void 0,s()||(y=r.onContinue)==null||y.call(r)}),d=()=>{if(s())return;let y;const m=t===0?r.initialPromise:void 0;try{y=m??r.fn()}catch(b){y=Promise.reject(b)}Promise.resolve(y).then(f).catch(b=>{var M;if(s())return;const S=r.retry??(rt?0:3),O=r.retryDelay??tf,E=typeof O=="function"?O(t,b):O,k=S===!0||typeof S=="number"&&t<S||typeof S=="function"&&S(t,b);if(e||!k){h(b);return}t++,(M=r.onFail)==null||M.call(r,t,b),Jl(E).then(()=>u()?void 0:p()).then(()=>{e?h(b):d()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(n==null||n(),i),cancelRetry:a,continueRetry:c,canStart:l,start:()=>(l()?d():p().then(d),i)}}var He,$s,nf=($s=class{constructor(){N(this,He)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Pn(this.gcTime)&&C(this,He,ze.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(r){this.gcTime=Math.max(this.gcTime||0,r??(rt?1/0:300*1e3))}clearGcTimeout(){w(this,He)&&(ze.clearTimeout(w(this,He)),C(this,He,void 0))}},He=new WeakMap,$s),Je,gt,re,Ge,W,Gt,Ye,ue,ge,Hs,Sd=(Hs=class extends nf{constructor(e){super();N(this,ue);N(this,Je);N(this,gt);N(this,re);N(this,Ge);N(this,W);N(this,Gt);N(this,Ye);C(this,Ye,!1),C(this,Gt,e.defaultOptions),this.setOptions(e.options),this.observers=[],C(this,Ge,e.client),C(this,re,w(this,Ge).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,C(this,Je,Es(this.options)),this.state=e.state??w(this,Je),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var e;return(e=w(this,W))==null?void 0:e.promise}setOptions(e){if(this.options={...w(this,Gt),...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=Es(this.options);t.data!==void 0&&(this.setState(Ss(t.data,t.dataUpdatedAt)),C(this,Je,t))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&w(this,re).remove(this)}setData(e,t){const n=jn(this.state.data,e,this.options);return j(this,ue,ge).call(this,{data:n,type:"success",dataUpdatedAt:t==null?void 0:t.updatedAt,manual:t==null?void 0:t.manual}),n}setState(e,t){j(this,ue,ge).call(this,{type:"setState",state:e,setStateOptions:t})}cancel(e){var n,i;const t=(n=w(this,W))==null?void 0:n.promise;return(i=w(this,W))==null||i.cancel(e),t?t.then(Jt).catch(Jt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(w(this,Je))}isActive(){return this.observers.some(e=>ne(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===na||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>pt(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!ta(this.state.dataUpdatedAt,e)}onFocus(){var t;const e=this.observers.find(n=>n.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(t=w(this,W))==null||t.continue()}onOnline(){var t;const e=this.observers.find(n=>n.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(t=w(this,W))==null||t.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),w(this,re).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(w(this,W)&&(w(this,Ye)?w(this,W).cancel({revert:!0}):w(this,W).cancelRetry()),this.scheduleGc()),w(this,re).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||j(this,ue,ge).call(this,{type:"invalidate"})}async fetch(e,t){var c,u,l,f,h,p,d,y,m,b,S,O;if(this.state.fetchStatus!=="idle"&&((c=w(this,W))==null?void 0:c.status())!=="rejected"){if(this.state.data!==void 0&&(t!=null&&t.cancelRefetch))this.cancel({silent:!0});else if(w(this,W))return w(this,W).continueRetry(),w(this,W).promise}if(e&&this.setOptions(e),!this.options.queryFn){const E=this.observers.find(k=>k.options.queryFn);E&&this.setOptions(E.options)}const n=new AbortController,i=E=>{Object.defineProperty(E,"signal",{enumerable:!0,get:()=>(C(this,Ye,!0),n.signal)})},s=()=>{const E=Gl(this.options,t),M=(()=>{const A={client:w(this,Ge),queryKey:this.queryKey,meta:this.meta};return i(A),A})();return C(this,Ye,!1),this.options.persister?this.options.persister(E,M,this):E(M)},a=(()=>{const E={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:w(this,Ge),state:this.state,fetchFn:s};return i(E),E})();(u=this.options.behavior)==null||u.onFetch(a,this),C(this,gt,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((l=a.fetchOptions)==null?void 0:l.meta))&&j(this,ue,ge).call(this,{type:"fetch",meta:(f=a.fetchOptions)==null?void 0:f.meta}),C(this,W,rf({initialPromise:t==null?void 0:t.initialPromise,fn:a.fetchFn,onCancel:E=>{E instanceof Ln&&E.revert&&this.setState({...w(this,gt),fetchStatus:"idle"}),n.abort()},onFail:(E,k)=>{j(this,ue,ge).call(this,{type:"failed",failureCount:E,error:k})},onPause:()=>{j(this,ue,ge).call(this,{type:"pause"})},onContinue:()=>{j(this,ue,ge).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0}));try{const E=await w(this,W).start();if(E===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(E),(p=(h=w(this,re).config).onSuccess)==null||p.call(h,E,this),(y=(d=w(this,re).config).onSettled)==null||y.call(d,E,this.state.error,this),E}catch(E){if(E instanceof Ln){if(E.silent)return w(this,W).promise;if(E.revert){if(this.state.data===void 0)throw E;return this.state.data}}throw j(this,ue,ge).call(this,{type:"error",error:E}),(b=(m=w(this,re).config).onError)==null||b.call(m,E,this),(O=(S=w(this,re).config).onSettled)==null||O.call(S,this.state.data,E,this),E}finally{this.scheduleGc()}}},Je=new WeakMap,gt=new WeakMap,re=new WeakMap,Ge=new WeakMap,W=new WeakMap,Gt=new WeakMap,Ye=new WeakMap,ue=new WeakSet,ge=function(e){const t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...aa(n.data,this.options),fetchMeta:e.meta??null};case"success":const i={...n,...Ss(e.data,e.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return C(this,gt,e.manual?i:void 0),i;case"error":const s=e.error;return{...n,error:s,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),vi.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),w(this,re).notify({query:this,type:"updated",action:e})})},Hs);function aa(r,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:oa(e.networkMode)?"fetching":"paused",...r===void 0&&{error:null,status:"pending"}}}function Ss(r,e){return{data:r,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Es(r){const e=typeof r.initialData=="function"?r.initialData():r.initialData,t=e!==void 0,n=t?typeof r.initialDataUpdatedAt=="function"?r.initialDataUpdatedAt():r.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:t?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:t?"success":"pending",fetchStatus:"idle"}}var K,D,Yt,Y,Ke,vt,ve,_e,Kt,wt,St,Xe,Ze,De,Et,x,Ut,Un,Vn,Bn,Qn,zn,Wn,$n,ca,Js,sf=(Js=class extends bi{constructor(e,t){super();N(this,x);N(this,K);N(this,D);N(this,Yt);N(this,Y);N(this,Ke);N(this,vt);N(this,ve);N(this,_e);N(this,Kt);N(this,wt);N(this,St);N(this,Xe);N(this,Ze);N(this,De);N(this,Et,new Set);this.options=t,C(this,K,e),C(this,_e,null),C(this,ve,qn()),this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(w(this,D).addObserver(this),Os(w(this,D),this.options)?j(this,x,Ut).call(this):this.updateResult(),j(this,x,Qn).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Hn(w(this,D),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Hn(w(this,D),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,j(this,x,zn).call(this),j(this,x,Wn).call(this),w(this,D).removeObserver(this)}setOptions(e){const t=this.options,n=w(this,D);if(this.options=w(this,K).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof ne(this.options.enabled,w(this,D))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");j(this,x,$n).call(this),w(this,D).setOptions(this.options),t._defaulted&&!xn(this.options,t)&&w(this,K).getQueryCache().notify({type:"observerOptionsUpdated",query:w(this,D),observer:this});const i=this.hasListeners();i&&Ts(w(this,D),n,this.options,t)&&j(this,x,Ut).call(this),this.updateResult(),i&&(w(this,D)!==n||ne(this.options.enabled,w(this,D))!==ne(t.enabled,w(this,D))||pt(this.options.staleTime,w(this,D))!==pt(t.staleTime,w(this,D)))&&j(this,x,Un).call(this);const s=j(this,x,Vn).call(this);i&&(w(this,D)!==n||ne(this.options.enabled,w(this,D))!==ne(t.enabled,w(this,D))||s!==w(this,De))&&j(this,x,Bn).call(this,s)}getOptimisticResult(e){const t=w(this,K).getQueryCache().build(w(this,K),e),n=this.createResult(t,e);return af(this,n)&&(C(this,Y,n),C(this,vt,this.options),C(this,Ke,w(this,D).state)),n}getCurrentResult(){return w(this,Y)}trackResult(e,t){return new Proxy(e,{get:(n,i)=>(this.trackProp(i),t==null||t(i),i==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&w(this,ve).status==="pending"&&w(this,ve).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,i))})}trackProp(e){w(this,Et).add(e)}getCurrentQuery(){return w(this,D)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=w(this,K).defaultQueryOptions(e),n=w(this,K).getQueryCache().build(w(this,K),t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return j(this,x,Ut).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),w(this,Y)))}createResult(e,t){var fe;const n=w(this,D),i=this.options,s=w(this,Y),o=w(this,Ke),a=w(this,vt),u=e!==n?e.state:w(this,Yt),{state:l}=e;let f={...l},h=!1,p;if(t._optimisticResults){const G=this.hasListeners(),je=!G&&Os(e,t),ae=G&&Ts(e,n,t,i);(je||ae)&&(f={...f,...aa(l.data,e.options)}),t._optimisticResults==="isRestoring"&&(f.fetchStatus="idle")}let{error:d,errorUpdatedAt:y,status:m}=f;p=f.data;let b=!1;if(t.placeholderData!==void 0&&p===void 0&&m==="pending"){let G;s!=null&&s.isPlaceholderData&&t.placeholderData===(a==null?void 0:a.placeholderData)?(G=s.data,b=!0):G=typeof t.placeholderData=="function"?t.placeholderData((fe=w(this,St))==null?void 0:fe.state.data,w(this,St)):t.placeholderData,G!==void 0&&(m="success",p=jn(s==null?void 0:s.data,G,t),h=!0)}if(t.select&&p!==void 0&&!b)if(s&&p===(o==null?void 0:o.data)&&t.select===w(this,Kt))p=w(this,wt);else try{C(this,Kt,t.select),p=t.select(p),p=jn(s==null?void 0:s.data,p,t),C(this,wt,p),C(this,_e,null)}catch(G){C(this,_e,G)}w(this,_e)&&(d=w(this,_e),p=w(this,wt),y=Date.now(),m="error");const S=f.fetchStatus==="fetching",O=m==="pending",E=m==="error",k=O&&S,M=p!==void 0,V={status:m,fetchStatus:f.fetchStatus,isPending:O,isSuccess:m==="success",isError:E,isInitialLoading:k,isLoading:k,data:p,dataUpdatedAt:f.dataUpdatedAt,error:d,errorUpdatedAt:y,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:f.dataUpdateCount>0||f.errorUpdateCount>0,isFetchedAfterMount:f.dataUpdateCount>u.dataUpdateCount||f.errorUpdateCount>u.errorUpdateCount,isFetching:S,isRefetching:S&&!O,isLoadingError:E&&!M,isPaused:f.fetchStatus==="paused",isPlaceholderData:h,isRefetchError:E&&M,isStale:wi(e,t),refetch:this.refetch,promise:w(this,ve),isEnabled:ne(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const G=he=>{V.status==="error"?he.reject(V.error):V.data!==void 0&&he.resolve(V.data)},je=()=>{const he=C(this,ve,V.promise=qn());G(he)},ae=w(this,ve);switch(ae.status){case"pending":e.queryHash===n.queryHash&&G(ae);break;case"fulfilled":(V.status==="error"||V.data!==ae.value)&&je();break;case"rejected":(V.status!=="error"||V.error!==ae.reason)&&je();break}}return V}updateResult(){const e=w(this,Y),t=this.createResult(w(this,D),this.options);if(C(this,Ke,w(this,D).state),C(this,vt,this.options),w(this,Ke).data!==void 0&&C(this,St,w(this,D)),xn(t,e))return;C(this,Y,t);const n=()=>{if(!e)return!0;const{notifyOnChangeProps:i}=this.options,s=typeof i=="function"?i():i;if(s==="all"||!s&&!w(this,Et).size)return!0;const o=new Set(s??w(this,Et));return this.options.throwOnError&&o.add("error"),Object.keys(w(this,Y)).some(a=>{const c=a;return w(this,Y)[c]!==e[c]&&o.has(c)})};j(this,x,ca).call(this,{listeners:n()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&j(this,x,Qn).call(this)}},K=new WeakMap,D=new WeakMap,Yt=new WeakMap,Y=new WeakMap,Ke=new WeakMap,vt=new WeakMap,ve=new WeakMap,_e=new WeakMap,Kt=new WeakMap,wt=new WeakMap,St=new WeakMap,Xe=new WeakMap,Ze=new WeakMap,De=new WeakMap,Et=new WeakMap,x=new WeakSet,Ut=function(e){j(this,x,$n).call(this);let t=w(this,D).fetch(this.options,e);return e!=null&&e.throwOnError||(t=t.catch(Jt)),t},Un=function(){j(this,x,zn).call(this);const e=pt(this.options.staleTime,w(this,D));if(rt||w(this,Y).isStale||!Pn(e))return;const n=ta(w(this,Y).dataUpdatedAt,e)+1;C(this,Xe,ze.setTimeout(()=>{w(this,Y).isStale||this.updateResult()},n))},Vn=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(w(this,D)):this.options.refetchInterval)??!1},Bn=function(e){j(this,x,Wn).call(this),C(this,De,e),!(rt||ne(this.options.enabled,w(this,D))===!1||!Pn(w(this,De))||w(this,De)===0)&&C(this,Ze,ze.setInterval(()=>{(this.options.refetchIntervalInBackground||ia.isFocused())&&j(this,x,Ut).call(this)},w(this,De)))},Qn=function(){j(this,x,Un).call(this),j(this,x,Bn).call(this,j(this,x,Vn).call(this))},zn=function(){w(this,Xe)&&(ze.clearTimeout(w(this,Xe)),C(this,Xe,void 0))},Wn=function(){w(this,Ze)&&(ze.clearInterval(w(this,Ze)),C(this,Ze,void 0))},$n=function(){const e=w(this,K).getQueryCache().build(w(this,K),this.options);if(e===w(this,D))return;const t=w(this,D);C(this,D,e),C(this,Yt,e.state),this.hasListeners()&&(t==null||t.removeObserver(this),e.addObserver(this))},ca=function(e){vi.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(w(this,Y))}),w(this,K).getQueryCache().notify({query:w(this,D),type:"observerResultsUpdated"})})},Js);function of(r,e){return ne(e.enabled,r)!==!1&&r.state.data===void 0&&!(r.state.status==="error"&&e.retryOnMount===!1)}function Os(r,e){return of(r,e)||r.state.data!==void 0&&Hn(r,e,e.refetchOnMount)}function Hn(r,e,t){if(ne(e.enabled,r)!==!1&&pt(e.staleTime,r)!=="static"){const n=typeof t=="function"?t(r):t;return n==="always"||n!==!1&&wi(r,e)}return!1}function Ts(r,e,t,n){return(r!==e||ne(n.enabled,r)===!1)&&(!t.suspense||r.state.status!=="error")&&wi(r,t)}function wi(r,e){return ne(e.enabled,r)!==!1&&r.isStaleByTime(pt(e.staleTime,r))}function af(r,e){return!xn(r.getCurrentResult(),e)}var ua=ie.createContext(void 0),cf=r=>{const e=ie.useContext(ua);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},Ed=({client:r,children:e})=>(ie.useEffect(()=>(r.mount(),()=>{r.unmount()}),[r]),Va.jsx(ua.Provider,{value:r,children:e})),la=ie.createContext(!1),uf=()=>ie.useContext(la);la.Provider;function lf(){let r=!1;return{clearReset:()=>{r=!1},reset:()=>{r=!0},isReset:()=>r}}var ff=ie.createContext(lf()),hf=()=>ie.useContext(ff),df=(r,e)=>{(r.suspense||r.throwOnError||r.experimental_prefetchInRender)&&(e.isReset()||(r.retryOnMount=!1))},pf=r=>{ie.useEffect(()=>{r.clearReset()},[r])},mf=({result:r,errorResetBoundary:e,throwOnError:t,query:n,suspense:i})=>r.isError&&!e.isReset()&&!r.isFetching&&n&&(i&&r.data===void 0||Yl(t,[r.error,n])),yf=r=>{if(r.suspense){const t=i=>i==="static"?i:Math.max(i??1e3,1e3),n=r.staleTime;r.staleTime=typeof n=="function"?(...i)=>t(n(...i)):t(n),typeof r.gcTime=="number"&&(r.gcTime=Math.max(r.gcTime,1e3))}},bf=(r,e)=>r.isLoading&&r.isFetching&&!e,gf=(r,e)=>(r==null?void 0:r.suspense)&&e.isPending,ks=(r,e,t)=>e.fetchOptimistic(r).catch(()=>{t.clearReset()});function vf(r,e,t){var f,h,p,d,y;const n=uf(),i=hf(),s=cf(),o=s.defaultQueryOptions(r);(h=(f=s.getDefaultOptions().queries)==null?void 0:f._experimental_beforeQuery)==null||h.call(f,o),o._optimisticResults=n?"isRestoring":"optimistic",yf(o),df(o,i),pf(i);const a=!s.getQueryCache().get(o.queryHash),[c]=ie.useState(()=>new e(s,o)),u=c.getOptimisticResult(o),l=!n&&r.subscribed!==!1;if(ie.useSyncExternalStore(ie.useCallback(m=>{const b=l?c.subscribe(vi.batchCalls(m)):Jt;return c.updateResult(),b},[c,l]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),ie.useEffect(()=>{c.setOptions(o)},[o,c]),gf(o,u))throw ks(o,c,i);if(mf({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s.getQueryCache().get(o.queryHash),suspense:o.suspense}))throw u.error;if((d=(p=s.getDefaultOptions().queries)==null?void 0:p._experimental_afterQuery)==null||d.call(p,o,u),o.experimental_prefetchInRender&&!rt&&bf(u,n)){const m=a?ks(o,c,i):(y=s.getQueryCache().get(o.queryHash))==null?void 0:y.promise;m==null||m.catch(Jt).finally(()=>{c.updateResult()})}return o.notifyOnChangeProps?u:c.trackResult(u)}function wf(r,e){return vf(r,sf)}function fa(r,e){return function(){return r.apply(e,arguments)}}const{toString:Sf}=Object.prototype,{getPrototypeOf:Si}=Object,{iterator:Ur,toStringTag:ha}=Symbol,Vr=(r=>e=>{const t=Sf.call(e);return r[t]||(r[t]=t.slice(8,-1).toLowerCase())})(Object.create(null)),le=r=>(r=r.toLowerCase(),e=>Vr(e)===r),Br=r=>e=>typeof e===r,{isArray:Nt}=Array,_t=Br("undefined");function nr(r){return r!==null&&!_t(r)&&r.constructor!==null&&!_t(r.constructor)&&Z(r.constructor.isBuffer)&&r.constructor.isBuffer(r)}const da=le("ArrayBuffer");function Ef(r){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(r):e=r&&r.buffer&&da(r.buffer),e}const Of=Br("string"),Z=Br("function"),pa=Br("number"),ir=r=>r!==null&&typeof r=="object",Tf=r=>r===!0||r===!1,yr=r=>{if(Vr(r)!=="object")return!1;const e=Si(r);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(ha in r)&&!(Ur in r)},kf=r=>{if(!ir(r)||nr(r))return!1;try{return Object.keys(r).length===0&&Object.getPrototypeOf(r)===Object.prototype}catch{return!1}},Cf=le("Date"),Rf=le("File"),Ff=le("Blob"),_f=le("FileList"),Df=r=>ir(r)&&Z(r.pipe),If=r=>{let e;return r&&(typeof FormData=="function"&&r instanceof FormData||Z(r.append)&&((e=Vr(r))==="formdata"||e==="object"&&Z(r.toString)&&r.toString()==="[object FormData]"))},Nf=le("URLSearchParams"),[Pf,Af,xf,Mf]=["ReadableStream","Request","Response","Headers"].map(le),jf=r=>r.trim?r.trim():r.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function sr(r,e,{allOwnKeys:t=!1}={}){if(r===null||typeof r>"u")return;let n,i;if(typeof r!="object"&&(r=[r]),Nt(r))for(n=0,i=r.length;n<i;n++)e.call(null,r[n],n,r);else{if(nr(r))return;const s=t?Object.getOwnPropertyNames(r):Object.keys(r),o=s.length;let a;for(n=0;n<o;n++)a=s[n],e.call(null,r[a],a,r)}}function ma(r,e){if(nr(r))return null;e=e.toLowerCase();const t=Object.keys(r);let n=t.length,i;for(;n-- >0;)if(i=t[n],e===i.toLowerCase())return i;return null}const We=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,ya=r=>!_t(r)&&r!==We;function Jn(){const{caseless:r,skipUndefined:e}=ya(this)&&this||{},t={},n=(i,s)=>{const o=r&&ma(t,s)||s;yr(t[o])&&yr(i)?t[o]=Jn(t[o],i):yr(i)?t[o]=Jn({},i):Nt(i)?t[o]=i.slice():(!e||!_t(i))&&(t[o]=i)};for(let i=0,s=arguments.length;i<s;i++)arguments[i]&&sr(arguments[i],n);return t}const qf=(r,e,t,{allOwnKeys:n}={})=>(sr(e,(i,s)=>{t&&Z(i)?r[s]=fa(i,t):r[s]=i},{allOwnKeys:n}),r),Lf=r=>(r.charCodeAt(0)===65279&&(r=r.slice(1)),r),Uf=(r,e,t,n)=>{r.prototype=Object.create(e.prototype,n),r.prototype.constructor=r,Object.defineProperty(r,"super",{value:e.prototype}),t&&Object.assign(r.prototype,t)},Vf=(r,e,t,n)=>{let i,s,o;const a={};if(e=e||{},r==null)return e;do{for(i=Object.getOwnPropertyNames(r),s=i.length;s-- >0;)o=i[s],(!n||n(o,r,e))&&!a[o]&&(e[o]=r[o],a[o]=!0);r=t!==!1&&Si(r)}while(r&&(!t||t(r,e))&&r!==Object.prototype);return e},Bf=(r,e,t)=>{r=String(r),(t===void 0||t>r.length)&&(t=r.length),t-=e.length;const n=r.indexOf(e,t);return n!==-1&&n===t},Qf=r=>{if(!r)return null;if(Nt(r))return r;let e=r.length;if(!pa(e))return null;const t=new Array(e);for(;e-- >0;)t[e]=r[e];return t},zf=(r=>e=>r&&e instanceof r)(typeof Uint8Array<"u"&&Si(Uint8Array)),Wf=(r,e)=>{const n=(r&&r[Ur]).call(r);let i;for(;(i=n.next())&&!i.done;){const s=i.value;e.call(r,s[0],s[1])}},$f=(r,e)=>{let t;const n=[];for(;(t=r.exec(e))!==null;)n.push(t);return n},Hf=le("HTMLFormElement"),Jf=r=>r.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(t,n,i){return n.toUpperCase()+i}),Cs=(({hasOwnProperty:r})=>(e,t)=>r.call(e,t))(Object.prototype),Gf=le("RegExp"),ba=(r,e)=>{const t=Object.getOwnPropertyDescriptors(r),n={};sr(t,(i,s)=>{let o;(o=e(i,s,r))!==!1&&(n[s]=o||i)}),Object.defineProperties(r,n)},Yf=r=>{ba(r,(e,t)=>{if(Z(r)&&["arguments","caller","callee"].indexOf(t)!==-1)return!1;const n=r[t];if(Z(n)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+t+"'")})}})},Kf=(r,e)=>{const t={},n=i=>{i.forEach(s=>{t[s]=!0})};return Nt(r)?n(r):n(String(r).split(e)),t},Xf=()=>{},Zf=(r,e)=>r!=null&&Number.isFinite(r=+r)?r:e;function eh(r){return!!(r&&Z(r.append)&&r[ha]==="FormData"&&r[Ur])}const th=r=>{const e=new Array(10),t=(n,i)=>{if(ir(n)){if(e.indexOf(n)>=0)return;if(nr(n))return n;if(!("toJSON"in n)){e[i]=n;const s=Nt(n)?[]:{};return sr(n,(o,a)=>{const c=t(o,i+1);!_t(c)&&(s[a]=c)}),e[i]=void 0,s}}return n};return t(r,0)},rh=le("AsyncFunction"),nh=r=>r&&(ir(r)||Z(r))&&Z(r.then)&&Z(r.catch),ga=((r,e)=>r?setImmediate:e?((t,n)=>(We.addEventListener("message",({source:i,data:s})=>{i===We&&s===t&&n.length&&n.shift()()},!1),i=>{n.push(i),We.postMessage(t,"*")}))(`axios@${Math.random()}`,[]):t=>setTimeout(t))(typeof setImmediate=="function",Z(We.postMessage)),ih=typeof queueMicrotask<"u"?queueMicrotask.bind(We):typeof process<"u"&&process.nextTick||ga,sh=r=>r!=null&&Z(r[Ur]),g={isArray:Nt,isArrayBuffer:da,isBuffer:nr,isFormData:If,isArrayBufferView:Ef,isString:Of,isNumber:pa,isBoolean:Tf,isObject:ir,isPlainObject:yr,isEmptyObject:kf,isReadableStream:Pf,isRequest:Af,isResponse:xf,isHeaders:Mf,isUndefined:_t,isDate:Cf,isFile:Rf,isBlob:Ff,isRegExp:Gf,isFunction:Z,isStream:Df,isURLSearchParams:Nf,isTypedArray:zf,isFileList:_f,forEach:sr,merge:Jn,extend:qf,trim:jf,stripBOM:Lf,inherits:Uf,toFlatObject:Vf,kindOf:Vr,kindOfTest:le,endsWith:Bf,toArray:Qf,forEachEntry:Wf,matchAll:$f,isHTMLForm:Hf,hasOwnProperty:Cs,hasOwnProp:Cs,reduceDescriptors:ba,freezeMethods:Yf,toObjectSet:Kf,toCamelCase:Jf,noop:Xf,toFiniteNumber:Zf,findKey:ma,global:We,isContextDefined:ya,isSpecCompliantForm:eh,toJSONObject:th,isAsyncFn:rh,isThenable:nh,setImmediate:ga,asap:ih,isIterable:sh};function _(r,e,t,n,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=r,this.name="AxiosError",e&&(this.code=e),t&&(this.config=t),n&&(this.request=n),i&&(this.response=i,this.status=i.status?i.status:null)}g.inherits(_,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:g.toJSONObject(this.config),code:this.code,status:this.status}}});const va=_.prototype,wa={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(r=>{wa[r]={value:r}});Object.defineProperties(_,wa);Object.defineProperty(va,"isAxiosError",{value:!0});_.from=(r,e,t,n,i,s)=>{const o=Object.create(va);g.toFlatObject(r,o,function(l){return l!==Error.prototype},u=>u!=="isAxiosError");const a=r&&r.message?r.message:"Error",c=e==null&&r?r.code:e;return _.call(o,a,c,t,n,i),r&&o.cause==null&&Object.defineProperty(o,"cause",{value:r,configurable:!0}),o.name=r&&r.name||"Error",s&&Object.assign(o,s),o};const oh=null;function Gn(r){return g.isPlainObject(r)||g.isArray(r)}function Sa(r){return g.endsWith(r,"[]")?r.slice(0,-2):r}function Rs(r,e,t){return r?r.concat(e).map(function(i,s){return i=Sa(i),!t&&s?"["+i+"]":i}).join(t?".":""):e}function ah(r){return g.isArray(r)&&!r.some(Gn)}const ch=g.toFlatObject(g,{},null,function(e){return/^is[A-Z]/.test(e)});function Qr(r,e,t){if(!g.isObject(r))throw new TypeError("target must be an object");e=e||new FormData,t=g.toFlatObject(t,{metaTokens:!0,dots:!1,indexes:!1},!1,function(y,m){return!g.isUndefined(m[y])});const n=t.metaTokens,i=t.visitor||l,s=t.dots,o=t.indexes,c=(t.Blob||typeof Blob<"u"&&Blob)&&g.isSpecCompliantForm(e);if(!g.isFunction(i))throw new TypeError("visitor must be a function");function u(d){if(d===null)return"";if(g.isDate(d))return d.toISOString();if(g.isBoolean(d))return d.toString();if(!c&&g.isBlob(d))throw new _("Blob is not supported. Use a Buffer instead.");return g.isArrayBuffer(d)||g.isTypedArray(d)?c&&typeof Blob=="function"?new Blob([d]):Buffer.from(d):d}function l(d,y,m){let b=d;if(d&&!m&&typeof d=="object"){if(g.endsWith(y,"{}"))y=n?y:y.slice(0,-2),d=JSON.stringify(d);else if(g.isArray(d)&&ah(d)||(g.isFileList(d)||g.endsWith(y,"[]"))&&(b=g.toArray(d)))return y=Sa(y),b.forEach(function(O,E){!(g.isUndefined(O)||O===null)&&e.append(o===!0?Rs([y],E,s):o===null?y:y+"[]",u(O))}),!1}return Gn(d)?!0:(e.append(Rs(m,y,s),u(d)),!1)}const f=[],h=Object.assign(ch,{defaultVisitor:l,convertValue:u,isVisitable:Gn});function p(d,y){if(!g.isUndefined(d)){if(f.indexOf(d)!==-1)throw Error("Circular reference detected in "+y.join("."));f.push(d),g.forEach(d,function(b,S){(!(g.isUndefined(b)||b===null)&&i.call(e,b,g.isString(S)?S.trim():S,y,h))===!0&&p(b,y?y.concat(S):[S])}),f.pop()}}if(!g.isObject(r))throw new TypeError("data must be an object");return p(r),e}function Fs(r){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(r).replace(/[!'()~]|%20|%00/g,function(n){return e[n]})}function Ei(r,e){this._pairs=[],r&&Qr(r,this,e)}const Ea=Ei.prototype;Ea.append=function(e,t){this._pairs.push([e,t])};Ea.toString=function(e){const t=e?function(n){return e.call(this,n,Fs)}:Fs;return this._pairs.map(function(i){return t(i[0])+"="+t(i[1])},"").join("&")};function uh(r){return encodeURIComponent(r).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Oa(r,e,t){if(!e)return r;const n=t&&t.encode||uh;g.isFunction(t)&&(t={serialize:t});const i=t&&t.serialize;let s;if(i?s=i(e,t):s=g.isURLSearchParams(e)?e.toString():new Ei(e,t).toString(n),s){const o=r.indexOf("#");o!==-1&&(r=r.slice(0,o)),r+=(r.indexOf("?")===-1?"?":"&")+s}return r}class _s{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){g.forEach(this.handlers,function(n){n!==null&&e(n)})}}const Ta={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},lh=typeof URLSearchParams<"u"?URLSearchParams:Ei,fh=typeof FormData<"u"?FormData:null,hh=typeof Blob<"u"?Blob:null,dh={isBrowser:!0,classes:{URLSearchParams:lh,FormData:fh,Blob:hh},protocols:["http","https","file","blob","url","data"]},Oi=typeof window<"u"&&typeof document<"u",Yn=typeof navigator=="object"&&navigator||void 0,ph=Oi&&(!Yn||["ReactNative","NativeScript","NS"].indexOf(Yn.product)<0),mh=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",yh=Oi&&window.location.href||"http://localhost",bh=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Oi,hasStandardBrowserEnv:ph,hasStandardBrowserWebWorkerEnv:mh,navigator:Yn,origin:yh},Symbol.toStringTag,{value:"Module"})),J={...bh,...dh};function gh(r,e){return Qr(r,new J.classes.URLSearchParams,{visitor:function(t,n,i,s){return J.isNode&&g.isBuffer(t)?(this.append(n,t.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)},...e})}function vh(r){return g.matchAll(/\w+|\[(\w*)]/g,r).map(e=>e[0]==="[]"?"":e[1]||e[0])}function wh(r){const e={},t=Object.keys(r);let n;const i=t.length;let s;for(n=0;n<i;n++)s=t[n],e[s]=r[s];return e}function ka(r){function e(t,n,i,s){let o=t[s++];if(o==="__proto__")return!0;const a=Number.isFinite(+o),c=s>=t.length;return o=!o&&g.isArray(i)?i.length:o,c?(g.hasOwnProp(i,o)?i[o]=[i[o],n]:i[o]=n,!a):((!i[o]||!g.isObject(i[o]))&&(i[o]=[]),e(t,n,i[o],s)&&g.isArray(i[o])&&(i[o]=wh(i[o])),!a)}if(g.isFormData(r)&&g.isFunction(r.entries)){const t={};return g.forEachEntry(r,(n,i)=>{e(vh(n),i,t,0)}),t}return null}function Sh(r,e,t){if(g.isString(r))try{return(e||JSON.parse)(r),g.trim(r)}catch(n){if(n.name!=="SyntaxError")throw n}return(t||JSON.stringify)(r)}const or={transitional:Ta,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",i=n.indexOf("application/json")>-1,s=g.isObject(e);if(s&&g.isHTMLForm(e)&&(e=new FormData(e)),g.isFormData(e))return i?JSON.stringify(ka(e)):e;if(g.isArrayBuffer(e)||g.isBuffer(e)||g.isStream(e)||g.isFile(e)||g.isBlob(e)||g.isReadableStream(e))return e;if(g.isArrayBufferView(e))return e.buffer;if(g.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(s){if(n.indexOf("application/x-www-form-urlencoded")>-1)return gh(e,this.formSerializer).toString();if((a=g.isFileList(e))||n.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return Qr(a?{"files[]":e}:e,c&&new c,this.formSerializer)}}return s||i?(t.setContentType("application/json",!1),Sh(e)):e}],transformResponse:[function(e){const t=this.transitional||or.transitional,n=t&&t.forcedJSONParsing,i=this.responseType==="json";if(g.isResponse(e)||g.isReadableStream(e))return e;if(e&&g.isString(e)&&(n&&!this.responseType||i)){const o=!(t&&t.silentJSONParsing)&&i;try{return JSON.parse(e,this.parseReviver)}catch(a){if(o)throw a.name==="SyntaxError"?_.from(a,_.ERR_BAD_RESPONSE,this,null,this.response):a}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:J.classes.FormData,Blob:J.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};g.forEach(["delete","get","head","post","put","patch"],r=>{or.headers[r]={}});const Eh=g.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Oh=r=>{const e={};let t,n,i;return r&&r.split(`
|
|
45
|
+
`).forEach(function(o){i=o.indexOf(":"),t=o.substring(0,i).trim().toLowerCase(),n=o.substring(i+1).trim(),!(!t||e[t]&&Eh[t])&&(t==="set-cookie"?e[t]?e[t].push(n):e[t]=[n]:e[t]=e[t]?e[t]+", "+n:n)}),e},Ds=Symbol("internals");function Mt(r){return r&&String(r).trim().toLowerCase()}function br(r){return r===!1||r==null?r:g.isArray(r)?r.map(br):String(r)}function Th(r){const e=Object.create(null),t=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=t.exec(r);)e[n[1]]=n[2];return e}const kh=r=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(r.trim());function pn(r,e,t,n,i){if(g.isFunction(n))return n.call(this,e,t);if(i&&(e=t),!!g.isString(e)){if(g.isString(n))return e.indexOf(n)!==-1;if(g.isRegExp(n))return n.test(e)}}function Ch(r){return r.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}function Rh(r,e){const t=g.toCamelCase(" "+e);["get","set","has"].forEach(n=>{Object.defineProperty(r,n+t,{value:function(i,s,o){return this[n].call(this,e,i,s,o)},configurable:!0})})}let ee=class{constructor(e){e&&this.set(e)}set(e,t,n){const i=this;function s(a,c,u){const l=Mt(c);if(!l)throw new Error("header name must be a non-empty string");const f=g.findKey(i,l);(!f||i[f]===void 0||u===!0||u===void 0&&i[f]!==!1)&&(i[f||c]=br(a))}const o=(a,c)=>g.forEach(a,(u,l)=>s(u,l,c));if(g.isPlainObject(e)||e instanceof this.constructor)o(e,t);else if(g.isString(e)&&(e=e.trim())&&!kh(e))o(Oh(e),t);else if(g.isObject(e)&&g.isIterable(e)){let a={},c,u;for(const l of e){if(!g.isArray(l))throw TypeError("Object iterator must return a key-value pair");a[u=l[0]]=(c=a[u])?g.isArray(c)?[...c,l[1]]:[c,l[1]]:l[1]}o(a,t)}else e!=null&&s(t,e,n);return this}get(e,t){if(e=Mt(e),e){const n=g.findKey(this,e);if(n){const i=this[n];if(!t)return i;if(t===!0)return Th(i);if(g.isFunction(t))return t.call(this,i,n);if(g.isRegExp(t))return t.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Mt(e),e){const n=g.findKey(this,e);return!!(n&&this[n]!==void 0&&(!t||pn(this,this[n],n,t)))}return!1}delete(e,t){const n=this;let i=!1;function s(o){if(o=Mt(o),o){const a=g.findKey(n,o);a&&(!t||pn(n,n[a],a,t))&&(delete n[a],i=!0)}}return g.isArray(e)?e.forEach(s):s(e),i}clear(e){const t=Object.keys(this);let n=t.length,i=!1;for(;n--;){const s=t[n];(!e||pn(this,this[s],s,e,!0))&&(delete this[s],i=!0)}return i}normalize(e){const t=this,n={};return g.forEach(this,(i,s)=>{const o=g.findKey(n,s);if(o){t[o]=br(i),delete t[s];return}const a=e?Ch(s):String(s).trim();a!==s&&delete t[s],t[a]=br(i),n[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return g.forEach(this,(n,i)=>{n!=null&&n!==!1&&(t[i]=e&&g.isArray(n)?n.join(", "):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join(`
|
|
46
|
+
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach(i=>n.set(i)),n}static accessor(e){const n=(this[Ds]=this[Ds]={accessors:{}}).accessors,i=this.prototype;function s(o){const a=Mt(o);n[a]||(Rh(i,o),n[a]=!0)}return g.isArray(e)?e.forEach(s):s(e),this}};ee.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);g.reduceDescriptors(ee.prototype,({value:r},e)=>{let t=e[0].toUpperCase()+e.slice(1);return{get:()=>r,set(n){this[t]=n}}});g.freezeMethods(ee);function mn(r,e){const t=this||or,n=e||t,i=ee.from(n.headers);let s=n.data;return g.forEach(r,function(a){s=a.call(t,s,i.normalize(),e?e.status:void 0)}),i.normalize(),s}function Ca(r){return!!(r&&r.__CANCEL__)}function Pt(r,e,t){_.call(this,r??"canceled",_.ERR_CANCELED,e,t),this.name="CanceledError"}g.inherits(Pt,_,{__CANCEL__:!0});function Ra(r,e,t){const n=t.config.validateStatus;!t.status||!n||n(t.status)?r(t):e(new _("Request failed with status code "+t.status,[_.ERR_BAD_REQUEST,_.ERR_BAD_RESPONSE][Math.floor(t.status/100)-4],t.config,t.request,t))}function Fh(r){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(r);return e&&e[1]||""}function _h(r,e){r=r||10;const t=new Array(r),n=new Array(r);let i=0,s=0,o;return e=e!==void 0?e:1e3,function(c){const u=Date.now(),l=n[s];o||(o=u),t[i]=c,n[i]=u;let f=s,h=0;for(;f!==i;)h+=t[f++],f=f%r;if(i=(i+1)%r,i===s&&(s=(s+1)%r),u-o<e)return;const p=l&&u-l;return p?Math.round(h*1e3/p):void 0}}function Dh(r,e){let t=0,n=1e3/e,i,s;const o=(u,l=Date.now())=>{t=l,i=null,s&&(clearTimeout(s),s=null),r(...u)};return[(...u)=>{const l=Date.now(),f=l-t;f>=n?o(u,l):(i=u,s||(s=setTimeout(()=>{s=null,o(i)},n-f)))},()=>i&&o(i)]}const Fr=(r,e,t=3)=>{let n=0;const i=_h(50,250);return Dh(s=>{const o=s.loaded,a=s.lengthComputable?s.total:void 0,c=o-n,u=i(c),l=o<=a;n=o;const f={loaded:o,total:a,progress:a?o/a:void 0,bytes:c,rate:u||void 0,estimated:u&&a&&l?(a-o)/u:void 0,event:s,lengthComputable:a!=null,[e?"download":"upload"]:!0};r(f)},t)},Is=(r,e)=>{const t=r!=null;return[n=>e[0]({lengthComputable:t,total:r,loaded:n}),e[1]]},Ns=r=>(...e)=>g.asap(()=>r(...e)),Ih=J.hasStandardBrowserEnv?((r,e)=>t=>(t=new URL(t,J.origin),r.protocol===t.protocol&&r.host===t.host&&(e||r.port===t.port)))(new URL(J.origin),J.navigator&&/(msie|trident)/i.test(J.navigator.userAgent)):()=>!0,Nh=J.hasStandardBrowserEnv?{write(r,e,t,n,i,s,o){if(typeof document>"u")return;const a=[`${r}=${encodeURIComponent(e)}`];g.isNumber(t)&&a.push(`expires=${new Date(t).toUTCString()}`),g.isString(n)&&a.push(`path=${n}`),g.isString(i)&&a.push(`domain=${i}`),s===!0&&a.push("secure"),g.isString(o)&&a.push(`SameSite=${o}`),document.cookie=a.join("; ")},read(r){if(typeof document>"u")return null;const e=document.cookie.match(new RegExp("(?:^|; )"+r+"=([^;]*)"));return e?decodeURIComponent(e[1]):null},remove(r){this.write(r,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function Ph(r){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(r)}function Ah(r,e){return e?r.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):r}function Fa(r,e,t){let n=!Ph(e);return r&&(n||t==!1)?Ah(r,e):e}const Ps=r=>r instanceof ee?{...r}:r;function nt(r,e){e=e||{};const t={};function n(u,l,f,h){return g.isPlainObject(u)&&g.isPlainObject(l)?g.merge.call({caseless:h},u,l):g.isPlainObject(l)?g.merge({},l):g.isArray(l)?l.slice():l}function i(u,l,f,h){if(g.isUndefined(l)){if(!g.isUndefined(u))return n(void 0,u,f,h)}else return n(u,l,f,h)}function s(u,l){if(!g.isUndefined(l))return n(void 0,l)}function o(u,l){if(g.isUndefined(l)){if(!g.isUndefined(u))return n(void 0,u)}else return n(void 0,l)}function a(u,l,f){if(f in e)return n(u,l);if(f in r)return n(void 0,u)}const c={url:s,method:s,data:s,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a,headers:(u,l,f)=>i(Ps(u),Ps(l),f,!0)};return g.forEach(Object.keys({...r,...e}),function(l){const f=c[l]||i,h=f(r[l],e[l],l);g.isUndefined(h)&&f!==a||(t[l]=h)}),t}const _a=r=>{const e=nt({},r);let{data:t,withXSRFToken:n,xsrfHeaderName:i,xsrfCookieName:s,headers:o,auth:a}=e;if(e.headers=o=ee.from(o),e.url=Oa(Fa(e.baseURL,e.url,e.allowAbsoluteUrls),r.params,r.paramsSerializer),a&&o.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),g.isFormData(t)){if(J.hasStandardBrowserEnv||J.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if(g.isFunction(t.getHeaders)){const c=t.getHeaders(),u=["content-type","content-length"];Object.entries(c).forEach(([l,f])=>{u.includes(l.toLowerCase())&&o.set(l,f)})}}if(J.hasStandardBrowserEnv&&(n&&g.isFunction(n)&&(n=n(e)),n||n!==!1&&Ih(e.url))){const c=i&&s&&Nh.read(s);c&&o.set(i,c)}return e},xh=typeof XMLHttpRequest<"u",Mh=xh&&function(r){return new Promise(function(t,n){const i=_a(r);let s=i.data;const o=ee.from(i.headers).normalize();let{responseType:a,onUploadProgress:c,onDownloadProgress:u}=i,l,f,h,p,d;function y(){p&&p(),d&&d(),i.cancelToken&&i.cancelToken.unsubscribe(l),i.signal&&i.signal.removeEventListener("abort",l)}let m=new XMLHttpRequest;m.open(i.method.toUpperCase(),i.url,!0),m.timeout=i.timeout;function b(){if(!m)return;const O=ee.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders()),k={data:!a||a==="text"||a==="json"?m.responseText:m.response,status:m.status,statusText:m.statusText,headers:O,config:r,request:m};Ra(function(A){t(A),y()},function(A){n(A),y()},k),m=null}"onloadend"in m?m.onloadend=b:m.onreadystatechange=function(){!m||m.readyState!==4||m.status===0&&!(m.responseURL&&m.responseURL.indexOf("file:")===0)||setTimeout(b)},m.onabort=function(){m&&(n(new _("Request aborted",_.ECONNABORTED,r,m)),m=null)},m.onerror=function(E){const k=E&&E.message?E.message:"Network Error",M=new _(k,_.ERR_NETWORK,r,m);M.event=E||null,n(M),m=null},m.ontimeout=function(){let E=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const k=i.transitional||Ta;i.timeoutErrorMessage&&(E=i.timeoutErrorMessage),n(new _(E,k.clarifyTimeoutError?_.ETIMEDOUT:_.ECONNABORTED,r,m)),m=null},s===void 0&&o.setContentType(null),"setRequestHeader"in m&&g.forEach(o.toJSON(),function(E,k){m.setRequestHeader(k,E)}),g.isUndefined(i.withCredentials)||(m.withCredentials=!!i.withCredentials),a&&a!=="json"&&(m.responseType=i.responseType),u&&([h,d]=Fr(u,!0),m.addEventListener("progress",h)),c&&m.upload&&([f,p]=Fr(c),m.upload.addEventListener("progress",f),m.upload.addEventListener("loadend",p)),(i.cancelToken||i.signal)&&(l=O=>{m&&(n(!O||O.type?new Pt(null,r,m):O),m.abort(),m=null)},i.cancelToken&&i.cancelToken.subscribe(l),i.signal&&(i.signal.aborted?l():i.signal.addEventListener("abort",l)));const S=Fh(i.url);if(S&&J.protocols.indexOf(S)===-1){n(new _("Unsupported protocol "+S+":",_.ERR_BAD_REQUEST,r));return}m.send(s||null)})},jh=(r,e)=>{const{length:t}=r=r?r.filter(Boolean):[];if(e||t){let n=new AbortController,i;const s=function(u){if(!i){i=!0,a();const l=u instanceof Error?u:this.reason;n.abort(l instanceof _?l:new Pt(l instanceof Error?l.message:l))}};let o=e&&setTimeout(()=>{o=null,s(new _(`timeout ${e} of ms exceeded`,_.ETIMEDOUT))},e);const a=()=>{r&&(o&&clearTimeout(o),o=null,r.forEach(u=>{u.unsubscribe?u.unsubscribe(s):u.removeEventListener("abort",s)}),r=null)};r.forEach(u=>u.addEventListener("abort",s));const{signal:c}=n;return c.unsubscribe=()=>g.asap(a),c}},qh=function*(r,e){let t=r.byteLength;if(t<e){yield r;return}let n=0,i;for(;n<t;)i=n+e,yield r.slice(n,i),n=i},Lh=async function*(r,e){for await(const t of Uh(r))yield*qh(t,e)},Uh=async function*(r){if(r[Symbol.asyncIterator]){yield*r;return}const e=r.getReader();try{for(;;){const{done:t,value:n}=await e.read();if(t)break;yield n}}finally{await e.cancel()}},As=(r,e,t,n)=>{const i=Lh(r,e);let s=0,o,a=c=>{o||(o=!0,n&&n(c))};return new ReadableStream({async pull(c){try{const{done:u,value:l}=await i.next();if(u){a(),c.close();return}let f=l.byteLength;if(t){let h=s+=f;t(h)}c.enqueue(new Uint8Array(l))}catch(u){throw a(u),u}},cancel(c){return a(c),i.return()}},{highWaterMark:2})},xs=64*1024,{isFunction:ur}=g,Vh=(({Request:r,Response:e})=>({Request:r,Response:e}))(g.global),{ReadableStream:Ms,TextEncoder:js}=g.global,qs=(r,...e)=>{try{return!!r(...e)}catch{return!1}},Bh=r=>{r=g.merge.call({skipUndefined:!0},Vh,r);const{fetch:e,Request:t,Response:n}=r,i=e?ur(e):typeof fetch=="function",s=ur(t),o=ur(n);if(!i)return!1;const a=i&&ur(Ms),c=i&&(typeof js=="function"?(d=>y=>d.encode(y))(new js):async d=>new Uint8Array(await new t(d).arrayBuffer())),u=s&&a&&qs(()=>{let d=!1;const y=new t(J.origin,{body:new Ms,method:"POST",get duplex(){return d=!0,"half"}}).headers.has("Content-Type");return d&&!y}),l=o&&a&&qs(()=>g.isReadableStream(new n("").body)),f={stream:l&&(d=>d.body)};i&&["text","arrayBuffer","blob","formData","stream"].forEach(d=>{!f[d]&&(f[d]=(y,m)=>{let b=y&&y[d];if(b)return b.call(y);throw new _(`Response type '${d}' is not supported`,_.ERR_NOT_SUPPORT,m)})});const h=async d=>{if(d==null)return 0;if(g.isBlob(d))return d.size;if(g.isSpecCompliantForm(d))return(await new t(J.origin,{method:"POST",body:d}).arrayBuffer()).byteLength;if(g.isArrayBufferView(d)||g.isArrayBuffer(d))return d.byteLength;if(g.isURLSearchParams(d)&&(d=d+""),g.isString(d))return(await c(d)).byteLength},p=async(d,y)=>{const m=g.toFiniteNumber(d.getContentLength());return m??h(y)};return async d=>{let{url:y,method:m,data:b,signal:S,cancelToken:O,timeout:E,onDownloadProgress:k,onUploadProgress:M,responseType:A,headers:V,withCredentials:fe="same-origin",fetchOptions:G}=_a(d),je=e||fetch;A=A?(A+"").toLowerCase():"text";let ae=jh([S,O&&O.toAbortSignal()],E),he=null;const qe=ae&&ae.unsubscribe&&(()=>{ae.unsubscribe()});let ki;try{if(M&&u&&m!=="get"&&m!=="head"&&(ki=await p(V,b))!==0){let Te=new t(y,{method:"POST",body:b,duplex:"half"}),st;if(g.isFormData(b)&&(st=Te.headers.get("content-type"))&&V.setContentType(st),Te.body){const[Wr,ar]=Is(ki,Fr(Ns(M)));b=As(Te.body,xs,Wr,ar)}}g.isString(fe)||(fe=fe?"include":"omit");const de=s&&"credentials"in t.prototype,Ci={...G,signal:ae,method:m.toUpperCase(),headers:V.normalize().toJSON(),body:b,duplex:"half",credentials:de?fe:void 0};he=s&&new t(y,Ci);let Oe=await(s?je(he,G):je(y,Ci));const Ri=l&&(A==="stream"||A==="response");if(l&&(k||Ri&&qe)){const Te={};["status","statusText","headers"].forEach(Fi=>{Te[Fi]=Oe[Fi]});const st=g.toFiniteNumber(Oe.headers.get("content-length")),[Wr,ar]=k&&Is(st,Fr(Ns(k),!0))||[];Oe=new n(As(Oe.body,xs,Wr,()=>{ar&&ar(),qe&&qe()}),Te)}A=A||"text";let xa=await f[g.findKey(f,A)||"text"](Oe,d);return!Ri&&qe&&qe(),await new Promise((Te,st)=>{Ra(Te,st,{data:xa,headers:ee.from(Oe.headers),status:Oe.status,statusText:Oe.statusText,config:d,request:he})})}catch(de){throw qe&&qe(),de&&de.name==="TypeError"&&/Load failed|fetch/i.test(de.message)?Object.assign(new _("Network Error",_.ERR_NETWORK,d,he),{cause:de.cause||de}):_.from(de,de&&de.code,d,he)}}},Qh=new Map,Da=r=>{let e=r&&r.env||{};const{fetch:t,Request:n,Response:i}=e,s=[n,i,t];let o=s.length,a=o,c,u,l=Qh;for(;a--;)c=s[a],u=l.get(c),u===void 0&&l.set(c,u=a?new Map:Bh(e)),l=u;return u};Da();const Ti={http:oh,xhr:Mh,fetch:{get:Da}};g.forEach(Ti,(r,e)=>{if(r){try{Object.defineProperty(r,"name",{value:e})}catch{}Object.defineProperty(r,"adapterName",{value:e})}});const Ls=r=>`- ${r}`,zh=r=>g.isFunction(r)||r===null||r===!1;function Wh(r,e){r=g.isArray(r)?r:[r];const{length:t}=r;let n,i;const s={};for(let o=0;o<t;o++){n=r[o];let a;if(i=n,!zh(n)&&(i=Ti[(a=String(n)).toLowerCase()],i===void 0))throw new _(`Unknown adapter '${a}'`);if(i&&(g.isFunction(i)||(i=i.get(e))))break;s[a||"#"+o]=i}if(!i){const o=Object.entries(s).map(([c,u])=>`adapter ${c} `+(u===!1?"is not supported by the environment":"is not available in the build"));let a=t?o.length>1?`since :
|
|
47
|
+
`+o.map(Ls).join(`
|
|
48
|
+
`):" "+Ls(o[0]):"as no adapter specified";throw new _("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return i}const Ia={getAdapter:Wh,adapters:Ti};function yn(r){if(r.cancelToken&&r.cancelToken.throwIfRequested(),r.signal&&r.signal.aborted)throw new Pt(null,r)}function Us(r){return yn(r),r.headers=ee.from(r.headers),r.data=mn.call(r,r.transformRequest),["post","put","patch"].indexOf(r.method)!==-1&&r.headers.setContentType("application/x-www-form-urlencoded",!1),Ia.getAdapter(r.adapter||or.adapter,r)(r).then(function(n){return yn(r),n.data=mn.call(r,r.transformResponse,n),n.headers=ee.from(n.headers),n},function(n){return Ca(n)||(yn(r),n&&n.response&&(n.response.data=mn.call(r,r.transformResponse,n.response),n.response.headers=ee.from(n.response.headers))),Promise.reject(n)})}const Na="1.13.2",zr={};["object","boolean","number","function","string","symbol"].forEach((r,e)=>{zr[r]=function(n){return typeof n===r||"a"+(e<1?"n ":" ")+r}});const Vs={};zr.transitional=function(e,t,n){function i(s,o){return"[Axios v"+Na+"] Transitional option '"+s+"'"+o+(n?". "+n:"")}return(s,o,a)=>{if(e===!1)throw new _(i(o," has been removed"+(t?" in "+t:"")),_.ERR_DEPRECATED);return t&&!Vs[o]&&(Vs[o]=!0,console.warn(i(o," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(s,o,a):!0}};zr.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};function $h(r,e,t){if(typeof r!="object")throw new _("options must be an object",_.ERR_BAD_OPTION_VALUE);const n=Object.keys(r);let i=n.length;for(;i-- >0;){const s=n[i],o=e[s];if(o){const a=r[s],c=a===void 0||o(a,s,r);if(c!==!0)throw new _("option "+s+" must be "+c,_.ERR_BAD_OPTION_VALUE);continue}if(t!==!0)throw new _("Unknown option "+s,_.ERR_BAD_OPTION)}}const gr={assertOptions:$h,validators:zr},pe=gr.validators;let tt=class{constructor(e){this.defaults=e||{},this.interceptors={request:new _s,response:new _s}}async request(e,t){try{return await this._request(e,t)}catch(n){if(n instanceof Error){let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;const s=i.stack?i.stack.replace(/^.+\n/,""):"";try{n.stack?s&&!String(n.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(n.stack+=`
|
|
49
|
+
`+s):n.stack=s}catch{}}throw n}}_request(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=nt(this.defaults,t);const{transitional:n,paramsSerializer:i,headers:s}=t;n!==void 0&&gr.assertOptions(n,{silentJSONParsing:pe.transitional(pe.boolean),forcedJSONParsing:pe.transitional(pe.boolean),clarifyTimeoutError:pe.transitional(pe.boolean)},!1),i!=null&&(g.isFunction(i)?t.paramsSerializer={serialize:i}:gr.assertOptions(i,{encode:pe.function,serialize:pe.function},!0)),t.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),gr.assertOptions(t,{baseUrl:pe.spelling("baseURL"),withXsrfToken:pe.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let o=s&&g.merge(s.common,s[t.method]);s&&g.forEach(["delete","get","head","post","put","patch","common"],d=>{delete s[d]}),t.headers=ee.concat(o,s);const a=[];let c=!0;this.interceptors.request.forEach(function(y){typeof y.runWhen=="function"&&y.runWhen(t)===!1||(c=c&&y.synchronous,a.unshift(y.fulfilled,y.rejected))});const u=[];this.interceptors.response.forEach(function(y){u.push(y.fulfilled,y.rejected)});let l,f=0,h;if(!c){const d=[Us.bind(this),void 0];for(d.unshift(...a),d.push(...u),h=d.length,l=Promise.resolve(t);f<h;)l=l.then(d[f++],d[f++]);return l}h=a.length;let p=t;for(;f<h;){const d=a[f++],y=a[f++];try{p=d(p)}catch(m){y.call(this,m);break}}try{l=Us.call(this,p)}catch(d){return Promise.reject(d)}for(f=0,h=u.length;f<h;)l=l.then(u[f++],u[f++]);return l}getUri(e){e=nt(this.defaults,e);const t=Fa(e.baseURL,e.url,e.allowAbsoluteUrls);return Oa(t,e.params,e.paramsSerializer)}};g.forEach(["delete","get","head","options"],function(e){tt.prototype[e]=function(t,n){return this.request(nt(n||{},{method:e,url:t,data:(n||{}).data}))}});g.forEach(["post","put","patch"],function(e){function t(n){return function(s,o,a){return this.request(nt(a||{},{method:e,headers:n?{"Content-Type":"multipart/form-data"}:{},url:s,data:o}))}}tt.prototype[e]=t(),tt.prototype[e+"Form"]=t(!0)});let Hh=class Pa{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(s){t=s});const n=this;this.promise.then(i=>{if(!n._listeners)return;let s=n._listeners.length;for(;s-- >0;)n._listeners[s](i);n._listeners=null}),this.promise.then=i=>{let s;const o=new Promise(a=>{n.subscribe(a),s=a}).then(i);return o.cancel=function(){n.unsubscribe(s)},o},e(function(s,o,a){n.reason||(n.reason=new Pt(s,o,a),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=n=>{e.abort(n)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new Pa(function(i){e=i}),cancel:e}}};function Jh(r){return function(t){return r.apply(null,t)}}function Gh(r){return g.isObject(r)&&r.isAxiosError===!0}const Kn={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Kn).forEach(([r,e])=>{Kn[e]=r});function Aa(r){const e=new tt(r),t=fa(tt.prototype.request,e);return g.extend(t,tt.prototype,e,{allOwnKeys:!0}),g.extend(t,e,null,{allOwnKeys:!0}),t.create=function(i){return Aa(nt(r,i))},t}const U=Aa(or);U.Axios=tt;U.CanceledError=Pt;U.CancelToken=Hh;U.isCancel=Ca;U.VERSION=Na;U.toFormData=Qr;U.AxiosError=_;U.Cancel=U.CanceledError;U.all=function(e){return Promise.all(e)};U.spread=Jh;U.isAxiosError=Gh;U.mergeConfig=nt;U.AxiosHeaders=ee;U.formToJSON=r=>ka(g.isHTMLForm(r)?new FormData(r):r);U.getAdapter=Ia.getAdapter;U.HttpStatusCode=Kn;U.default=U;const{Axios:kd,AxiosError:Cd,CanceledError:Rd,isCancel:Fd,CancelToken:_d,VERSION:Dd,all:Id,Cancel:Nd,isAxiosError:Pd,spread:Ad,toFormData:xd,AxiosHeaders:Md,HttpStatusCode:jd,formToJSON:qd,getAdapter:Ld,mergeConfig:Ud}=U;class Yh{constructor(e,t,n){v(this,"tokenCache",null);v(this,"refreshPromise",null);this.mercuryUrl=e,this.appId=t,this.appSecret=n}async getToken(){if(this.tokenCache&&this.isTokenValid())return this.tokenCache.token;if(this.refreshPromise)return this.refreshPromise;this.refreshPromise=this.fetchNewToken();try{return await this.refreshPromise}finally{this.refreshPromise=null}}isTokenValid(){return this.tokenCache?Date.now()<this.tokenCache.expiresAt:!1}async fetchNewToken(){try{const t=(await U.post(this.mercuryUrl,{app_id:this.appId,app_secret:this.appSecret})).data;if(!t.token)throw new Error("No token received from Mercury");return this.tokenCache={token:t.token,expiresAt:Date.now()+3600*1e3},t.token}catch(e){throw console.error("Failed to fetch token from Mercury:",e),e}}clearCache(){this.tokenCache=null,this.refreshPromise=null}}let bn=null;function Kh(){return bn||(bn=new Yh(Jr.VITE_MERCURY_TOKEN_ENDPOINT,Jr.VITE_ATHENS_APP_ID,Jr.VITE_ATHENS_APP_SECRET)),bn}const Xh=async()=>({success:!0,token:await Kh().getToken()});function Vd(){return wf({queryKey:["mercury-project-token"],staleTime:1/0,gcTime:1/0,queryFn:Xh,refetchOnWindowFocus:!1,refetchOnMount:!1})}export{Ve as $,dd as A,na as B,te as C,z as D,Al as E,Nl as F,Pl as G,zu as H,hd as I,Ml as J,P as K,id as L,jl as M,Fl as N,Be as O,pd as P,Ed as Q,nf as R,bi as S,sd as T,Xh as U,hc as V,Vd as W,sf as X,xn as Y,Yl as Z,vf as _,cf as a,qr as a0,yi as a1,gd as a2,U as b,od as c,cd as d,ad as e,tc as f,Ga as g,I as h,Ka as i,Gl as j,wd as k,vd as l,rf as m,vi as n,bd as o,Jt as p,$l as q,Sd as r,yd as s,ia as t,wf as u,sa as v,pt as w,md as x,An as y,gi as z};
|