1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[122],{74025:function(e,t,i){i.d(t,{ZP:function(){return Q}});var n,r,s,a,o,l,c,h,u,p=i(22970);let d=/\r\n|[\n\r]/g;function f(e,t){let i=0,n=1;for(let r of e.body.matchAll(d)){if("number"==typeof r.index||function(e,t){if(!e)throw Error("Unexpected invariant triggered.")}(!1),r.index>=t)break;i=r.index+r[0].length,n+=1}return{line:n,column:t+1-i}}function m(e,t){let i=e.locationOffset.column-1,n="".padStart(i)+e.body,r=t.line-1,s=e.locationOffset.line-1,a=t.line+s,o=1===t.line?i:0,l=t.column+o,c=`${e.name}:${a}:${l} 2`,h=n.split(/\r\n|[\n\r]/g),u=h[r];if(u.length>120){let e=Math.floor(l/80),t=[];for(let e=0;e<u.length;e+=80)t.push(u.slice(e,e+80));return c+E([[`${a} |`,t[0]],...t.slice(1,e+1).map(e=>["|",e]),["|","^".padStart(l%80)],["|",t[e+1]]])}return c+E([[`${a-1} |`,h[r-1]],[`${a} |`,u],["|","^".padStart(l)],[`${a+1} |`,h[r+1]]])}function E(e){let t=e.filter(([e,t])=>void 0!==t),i=Math.max(...t.map(([e])=>e.length));return t.map(([e,t])=>e.padStart(i)+(t?" "+t:"")).join("\n")}class I extends Error{constructor(e,...t){var i,n,r,s;let{nodes:a,source:o,positions:l,path:c,originalError:h,extensions:u}=function(e){let t=e[0];return null==t||"kind"in t||"length"in t?{nodes:t,source:e[1],positions:e[2],path:e[3],originalError:e[4],extensions:e[5]}:t}(t);super(e),this.name="GraphQLError",this.path=null!=c?c:void 0,this.originalError=null!=h?h:void 0,this.nodes=y(Array.isArray(a)?a:a?[a]:void 0);let p=y(null===(i=this.nodes)||void 0===i?void 0:i.map(e=>e.loc).filter(e=>null!=e));this.source=null!=o?o:null==p?void 0:null===(n=p[0])||void 0===n?void 0:n.source,this.positions=null!=l?l:null==p?void 0:p.map(e=>e.start),this.locations=l&&o?l.map(e=>f(o,e)):null==p?void 0:p.map(e=>f(e.source,e.start));let d="object"==typeof(s=null==h?void 0:h.extensions)&&null!==s?null==h?void 0:h.extensions:void 0;this.extensions=null!==(r=null!=u?u:d)&&void 0!==r?r:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),null!=h&&h.stack?Object.defineProperty(this,"stack",{value:h.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,I):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let e=this.message;if(this.nodes){for(let i of this.nodes)if(i.loc){var t;e+="\n\n"+m((t=i.loc).source,f(t.source,t.start))}}else if(this.source&&this.locations)for(let t of this.locations)e+="\n\n"+m(this.source,t);return e}toJSON(){let e={message:this.message};return null!=this.locations&&(e.locations=this.locations),null!=this.path&&(e.path=this.path),null!=this.extensions&&Object.keys(this.extensions).length>0&&(e.extensions=this.extensions),e}}function y(e){return void 0===e||0===e.length?void 0:e}function N(e,t,i){return new I(`Syntax Error: ${i}`,{source:e,positions:[t]})}class g{constructor(e,t,i){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=i}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}}class T{constructor(e,t,i,n,r,s){this.kind=e,this.start=t,this.end=i,this.line=n,this.column=r,this.value=s,this.prev=null,this.next=null}get[Symbol.toStringTag](){return"Token"}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}}function v(e){return e>=48&&e<=57}function _(e){return e>=97&&e<=122||e>=65&&e<=90}function k(e){return _(e)||95===e}(n=l||(l={})).QUERY="query",n.MUTATION="mutation",n.SUBSCRIPTION="subscription",(r=c||(c={})).QUERY="QUERY",r.MUTATION="MUTATION",r.SUBSCRIPTION="SUBSCRIPTION",r.FIELD="FIELD",r.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",r.FRAGMENT_SPREAD="FRAGMENT_SPREAD",r.INLINE_FRAGMENT="INLINE_FRAGMENT",r.VARIABLE_DEFINITION="VARIABLE_DEFINITION",r.SCHEMA="SCHEMA",r.SCALAR="SCALAR",r.OBJECT="OBJECT",r.FIELD_DEFINITION="FIELD_DEFINITION",r.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",r.INTERFACE="INTERFACE",r.UNION="UNION",r.ENUM="ENUM",r.ENUM_VALUE="ENUM_VALUE",r.INPUT_OBJECT="INPUT_OBJECT",r.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION",(s=h||(h={})).NAME="Name",s.DOCUMENT="Document",s.OPERATION_DEFINITION="OperationDefinition",s.VARIABLE_DEFINITION="VariableDefinition",s.SELECTION_SET="SelectionSet",s.FIELD="Field",
2s.ARGUMENT="Argument",s.FRAGMENT_SPREAD="FragmentSpread",s.INLINE_FRAGMENT="InlineFragment",s.FRAGMENT_DEFINITION="FragmentDefinition",s.VARIABLE="Variable",s.INT="IntValue",s.FLOAT="FloatValue",s.STRING="StringValue",s.BOOLEAN="BooleanValue",s.NULL="NullValue",s.ENUM="EnumValue",s.LIST="ListValue",s.OBJECT="ObjectValue",s.OBJECT_FIELD="ObjectField",s.DIRECTIVE="Directive",s.NAMED_TYPE="NamedType",s.LIST_TYPE="ListType",s.NON_NULL_TYPE="NonNullType",s.SCHEMA_DEFINITION="SchemaDefinition",s.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",s.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",s.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",s.FIELD_DEFINITION="FieldDefinition",s.INPUT_VALUE_DEFINITION="InputValueDefinition",s.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",s.UNION_TYPE_DEFINITION="UnionTypeDefinition",s.ENUM_TYPE_DEFINITION="EnumTypeDefinition",s.ENUM_VALUE_DEFINITION="EnumValueDefinition",s.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",s.DIRECTIVE_DEFINITION="DirectiveDefinition",s.SCHEMA_EXTENSION="SchemaExtension",s.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",s.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",s.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",s.UNION_TYPE_EXTENSION="UnionTypeExtension",s.ENUM_TYPE_EXTENSION="EnumTypeExtension",s.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension",(a=u||(u={})).SOF="<SOF>",a.EOF="<EOF>",a.BANG="!",a.DOLLAR="$",a.AMP="&",a.PAREN_L="(",a.PAREN_R=")",a.SPREAD="...",a.COLON=":",a.EQUALS="=",a.AT="@",a.BRACKET_L="[",a.BRACKET_R="]",a.BRACE_L="{",a.PIPE="|",a.BRACE_R="}",a.NAME="Name",a.INT="Int",a.FLOAT="Float",a.STRING="String",a.BLOCK_STRING="BlockString",a.COMMENT="Comment";class A{constructor(e){let t=new T(u.SOF,0,0,0,0);this.source=e,this.lastToken=t,this.token=t,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let e=this.token;if(e.kind!==u.EOF)do if(e.next)e=e.next;else{let t=function(e,t){let i=e.source.body,n=i.length,r=t;for(;r<n;){let t=i.charCodeAt(r);switch(t){case 65279:case 9:case 32:case 44:++r;continue;case 10:++r,++e.line,e.lineStart=r;continue;case 13:10===i.charCodeAt(r+1)?r+=2:++r,++e.line,e.lineStart=r;continue;case 35:return function(e,t){let i=e.source.body,n=i.length,r=t+1;for(;r<n;){let e=i.charCodeAt(r);if(10===e||13===e)break;if(S(e))++r;else if(x(i,r))r+=2;else break}return b(e,u.COMMENT,t,r,i.slice(t+1,r))}(e,r);case 33:return b(e,u.BANG,r,r+1);case 36:return b(e,u.DOLLAR,r,r+1);case 38:return b(e,u.AMP,r,r+1);case 40:return b(e,u.PAREN_L,r,r+1);case 41:return b(e,u.PAREN_R,r,r+1);case 46:if(46===i.charCodeAt(r+1)&&46===i.charCodeAt(r+2))return b(e,u.SPREAD,r,r+3);break;case 58:return b(e,u.COLON,r,r+1);case 61:return b(e,u.EQUALS,r,r+1);case 64:return b(e,u.AT,r,r+1);case 91:return b(e,u.BRACKET_L,r,r+1);case 93:return b(e,u.BRACKET_R,r,r+1);case 123:return b(e,u.BRACE_L,r,r+1);case 124:return b(e,u.PIPE,r,r+1);case 125:return b(e,u.BRACE_R,r,r+1);case 34:if(34===i.charCodeAt(r+1)&&34===i.charCodeAt(r+2))return function(e,t){let i=e.source.body,n=i.length,r=e.lineStart,s=t+3,a=s,o="",l=[];for(;s<n;){let n=i.charCodeAt(s);if(34===n&&34===i.charCodeAt(s+1)&&34===i.charCodeAt(s+2)){o+=i.slice(a,s),l.push(o);let n=b(e,u.BLOCK_STRING,t,s+3,(function(e){var t,i;let n=Number.MAX_SAFE_INTEGER,r=null,s=-1;for(let t=0;t<e.length;++t){let a=e[t],o=function(e){var t;let i=0;for(;i<e.length&&(9===(t=e.charCodeAt(i))||32===t);)++i;return i}(a);o!==a.length&&(r=null!==(i=r)&&void 0!==i?i:t,s=t,0!==t&&o<n&&(n=o))}return e.map((e,t)=>0===t?e:e.slice(n)).slice(null!==(t=r)&&void 0!==t?t:0,s+1)})(l).join("\n"));return e.line+=l.length-1,e.lineStart=r,n}if(92===n&&34===i.charCodeAt(s+1)&&34===i.charCodeAt(s+2)&&34===i.charCodeAt(s+3)){o+=i.slice(a,s),a=s+1,s+=4;continue}if(10===n||13===n){o+=i.slice(a,s),l.push(o),13===n&&10===i.charCodeAt(s+1)?s+=2:++s,o="",a=s,r=s;continue}if(S(n))++s;else if(x(i,s))s+=2;else throw N(e.source,s,`Invalid character within String: ${w(e,s)}.`)}throw N(e.source,s,"Unterminated string.")}(e,r);return function(e,t){let i=e.source.body,n=i.length,r=t+1,s=r,a="";for(;r<n;){let n=i.charCodeAt(r);if(34===n)return a+=i.slice(s,r),b(e,u.STRING,t,r+1,a);if(92===n){a+=i.slice(s,r);let t=117===i.charCodeAt(r+1)?123===i.charCodeAt(r+2)?function(e,t){let i=e.source.body,n=0,r=3;for(;r<12;){let e=i.charCodeAt(t+r++);if(125===e){if(r<5||!S(n))break;return{value:String.fromCodePoint(n),size:r}}if((n=n<<4|L(e))<0)break}throw N(e.source,t,`Invalid Unicode escape sequence: "${i.slice(t,t+r)}".`)}(e,r):function(e,t){let i=e.source.body,n=R(i,t+2);if(S(n))return{value:String.fromCodePoint(n),size:6};if(O(n)&&92===i.charCodeAt(t+6)&&117===i.charCodeAt(t+7)){let e=R(i,t+8);if(C(e))return{value:String.fromCodePoint(n,e),size:12}}throw N(e.source,t,`Invalid Unicode escape sequence: "${i.slice(t,t+6)}".`)}(e,r):function(e,t){let i=e.source.body;switch(i.charCodeAt(t+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:"\n",size:2};case 114:return{value:"\r",size:2};case 116:return{value:" ",size:2}}throw N(e.source,t,`Invalid character escape sequence: "${i.slice(t,t+2)}".`)}(e,r);a+=t.value,r+=t.size,s=r;continue}if(10===n||13===n)break;if(S(n))++r;else if(x(i,r))r+=2;else throw N(e.source,r,`Invalid character within String: ${w(e,r)}.`)}throw N(e.source,r,"Unterminated string.")}(e,r)}if(v(t)||45===t)return function(e,t,i){let n=e.source.body,r=t,s=i,a=!1;if(45===s&&(s=n.charCodeAt(++r)),48===s){if(v(s=n.charCodeAt(++r)))throw N(e.source,r,`Invalid number, unexpected digit after 0: ${w(e,r)}.`)}else r=D(e,r,s),s=n.charCodeAt(r);if(46===s&&(a=!0,s=n.charCodeAt(++r),r=D(e,r,s),s=n.charCodeAt(r)),(69===s||101===s)&&(a=!0,(43===(s=n.charCodeAt(++r))||45===s)&&(s=n.charCodeAt(++r)),r=D(e,r,s),s=n.charCodeAt(r)),46===s||k(s))throw N(e.source,r,`Invalid number, expected digit but got: ${w(e,r)}.`);return b(e,a?u.FLOAT:u.INT,t,r,n.slice(t,r))}(e,r,t);if(k(t))return function(e,t){let i=e.source.body,n=i.length,r=t+1;for(;r<n;){var s;if(_(s=i.charCodeAt(r))||v(s)||95===s)++r;else break}return b(e,u.NAME,t,r,i.slice(t,r))}(e,r);throw N(e.source,r,39===t?"Unexpected single quote character ('), did you mean to use a double quote (\")?":S(t)||x(i,r)?`Unexpected character: ${w(e,r)}.`:`Invalid character: ${w(e,r)}.`)}return b(e,u.EOF,n,n)}(this,e.end);e.next=t,t.prev=e,e=t}while(e.kind===u.COMMENT);return e}}function S(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function x(e,t){return O(e.charCodeAt(t))&&C(e.charCodeAt(t+1))}function O(e){return e>=55296&&e<=56319}function C(e){return e>=56320&&e<=57343}function w(e,t){let i=e.source.body.codePointAt(t);if(void 0===i)return u.EOF;if(i>=32&&i<=126){let e=String.fromCodePoint(i);return'"'===e?"'\"'":`"${e}"`}return"U+"+i.toString(16).toUpperCase().padStart(4,"0")}function b(e,t,i,n,r){let s=e.line,a=1+i-e.lineStart;return new T(t,i,n,s,a,r)}function D(e,t,i){if(!v(i))throw N(e.source,t,`Invalid number, expected digit but got: ${w(e,t)}.`);let n=e.source.body,r=t+1;for(;v(n.charCodeAt(r));)++r;return r}function R(e,t){return L(e.charCodeAt(t))<<12|L(e.charCodeAt(t+1))<<8|L(e.charCodeAt(t+2))<<4|L(e.charCodeAt(t+3))}function L(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function P(e,t){if(!e)throw Error(t)}function F(e,t){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return function(e,t){if(null===e)return"null";if(t.includes(e))return"[Circular]";let i=[...t,e];if("function"==typeof e.toJSON){let t=e.toJSON();if(t!==e)return"string"==typeof t?t:F(t,i)}else if(Array.isArray(e))return function(e,t){if(0===e.length)return"[]";if(t.length>2)return"[Array]";let i=Math.min(10,e.length),n=e.length-i,r=[];for(let n=0;n<i;++n)r.push(F(e[n],t));return 1===n?r.push("... 1 more item"):n>1&&r.push(`... ${n} more items`),"["+r.join(", ")+"]"}(e,i);return function(e,t){let i=Object.entries(e);return 0===i.length?"{}":t.length>2?"["+function(e){let t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){let t=e.constructor.name;if("string"==typeof t&&""!==t)return t}return t}(e)+"]":"{ "+i.map(([e,i])=>e+": "+F(i,t)).join(", ")+" }"}(e,i)}(e,t);default:return String(e)}}let M=globalThis.process?function(e,t){return e instanceof t}:function(e,t){if(e instanceof t)return!0;
2if("object"==typeof e&&null!==e){var i;let n=t.prototype[Symbol.toStringTag];if(n===(Symbol.toStringTag in e?e[Symbol.toStringTag]:null===(i=e.constructor)||void 0===i?void 0:i.name)){let t=F(e,[]);throw Error(`Cannot use ${n} "${t}" from another module or realm. 3 4Ensure that there is only one instance of "graphql" in the node_modules 5directory. If different versions of "graphql" are the dependencies of other 6relied on modules, use "resolutions" to ensure only one version is installed. 7 8https://yarnpkg.com/en/docs/selective-version-resolutions 9 10Duplicate "graphql" modules cannot be used at the same time since different 11versions may have different capabilities and behavior. The data from one 12version used in the function from another could produce confusing and 13spurious results.`)}}return!1};class B{constructor(e,t="GraphQL request",i={line:1,column:1}){"string"==typeof e||P(!1,`Body must be a string. Received: ${F(e,[])}.`),this.body=e,this.name=t,this.locationOffset=i,this.locationOffset.line>0||P(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||P(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}class U{constructor(e,t={}){let i=M(e,B)?e:new B(e);this._lexer=new A(i),this._options=t,this._tokenCounter=0}get tokenCount(){return this._tokenCounter}parseName(){let e=this.expectToken(u.NAME);return this.node(e,{kind:h.NAME,value:e.value})}parseDocument(){return this.node(this._lexer.token,{kind:h.DOCUMENT,definitions:this.many(u.SOF,this.parseDefinition,u.EOF)})}parseDefinition(){if(this.peek(u.BRACE_L))return this.parseOperationDefinition();let e=this.peekDescription(),t=e?this._lexer.lookahead():this._lexer.token;if(t.kind===u.NAME){switch(t.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}if(e)throw N(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(t.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(t)}parseOperationDefinition(){let e;let t=this._lexer.token;if(this.peek(u.BRACE_L))return this.node(t,{kind:h.OPERATION_DEFINITION,operation:l.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});let i=this.parseOperationType();return this.peek(u.NAME)&&(e=this.parseName()),this.node(t,{kind:h.OPERATION_DEFINITION,operation:i,name:e,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){let e=this.expectToken(u.NAME);switch(e.value){case"query":return l.QUERY;case"mutation":return l.MUTATION;case"subscription":return l.SUBSCRIPTION}throw this.unexpected(e)}parseVariableDefinitions(){return this.optionalMany(u.PAREN_L,this.parseVariableDefinition,u.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:h.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(u.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(u.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){let e=this._lexer.token;return this.expectToken(u.DOLLAR),this.node(e,{kind:h.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:h.SELECTION_SET,selections:this.many(u.BRACE_L,this.parseSelection,u.BRACE_R)})}parseSelection(){return this.peek(u.SPREAD)?this.parseFragment():this.parseField()}parseField(){let e,t;let i=this._lexer.token,n=this.parseName();return this.expectOptionalToken(u.COLON)?(e=n,t=this.parseName()):t=n,this.node(i,{kind:h.FIELD,alias:e,name:t,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(u.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(e){let t=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(u.PAREN_L,t,u.PAREN_R)}parseArgument(e=!1){let t=this._lexer.token,i=this.parseName();return this.expectToken(u.COLON),this.node(t,{kind:h.ARGUMENT,name:i,value:this.parseValueLiteral(e)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){let e=this._lexer.token;this.expectToken(u.SPREAD);let t=this.expectOptionalKeyword("on");return!t&&this.peek(u.NAME)?this.node(e,{kind:h.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(e,{kind:h.INLINE_FRAGMENT,typeCondition:t?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){let e=this._lexer.token;return(this.expectKeyword("fragment"),!0===this._options.allowLegacyFragmentVariables)?this.node(e,{kind:h.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(e,{kind:h.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if("on"===this._lexer.token.value)throw this.unexpected();return this.parseName()}parseValueLiteral(e){let t=this._lexer.token;switch(t.kind){case u.BRACKET_L:return this.parseList(e);case u.BRACE_L:return this.parseObject(e);case u.INT:return this.advanceLexer(),this.node(t,{kind:h.INT,value:t.value});case u.FLOAT:return this.advanceLexer(),this.node(t,{kind:h.FLOAT,value:t.value});case u.STRING:case u.BLOCK_STRING:return this.parseStringLiteral();case u.NAME:switch(this.advanceLexer(),t.value){case"true":return this.node(t,{kind:h.BOOLEAN,value:!0});case"false":return this.node(t,{kind:h.BOOLEAN,value:!1});case"null":return this.node(t,{kind:h.NULL});default:return this.node(t,{kind:h.ENUM,value:t.value})}case u.DOLLAR:if(e){if(this.expectToken(u.DOLLAR),this._lexer.token.kind===u.NAME){let e=this._lexer.token.value;throw N(this._lexer.source,t.start,`Unexpected variable "$${e}" in constant value.`)}throw this.unexpected(t)}return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){let e=this._lexer.token;return this.advanceLexer(),this.node(e,{kind:h.STRING,value:e.value,block:e.kind===u.BLOCK_STRING})}parseList(e){return this.node(this._lexer.token,{kind:h.LIST,values:this.any(u.BRACKET_L,()=>this.parseValueLiteral(e),u.BRACKET_R)})}parseObject(e){return this.node(this._lexer.token,{kind:h.OBJECT,fields:this.any(u.BRACE_L,()=>this.parseObjectField(e),u.BRACE_R)})}parseObjectField(e){let t=this._lexer.token,i=this.parseName();return this.expectToken(u.COLON),this.node(t,{kind:h.OBJECT_FIELD,name:i,value:this.parseValueLiteral(e)})}parseDirectives(e){let t=[];for(;this.peek(u.AT);)t.push(this.parseDirective(e));return t}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(e){let t=this._lexer.token;return this.expectToken(u.AT),this.node(t,{kind:h.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e)})}parseTypeReference(){let e;let t=this._lexer.token;if(this.expectOptionalToken(u.BRACKET_L)){let i=this.parseTypeReference();this.expectToken(u.BRACKET_R),e=this.node(t,{kind:h.LIST_TYPE,type:i})}else e=this.parseNamedType();return this.expectOptionalToken(u.BANG)?this.node(t,{kind:h.NON_NULL_TYPE,type:e}):e}parseNamedType(){return this.node(this._lexer.token,{kind:h.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(u.STRING)||this.peek(u.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword("schema");let i=this.parseConstDirectives(),n=this.many(u.BRACE_L,this.parseOperationTypeDefinition,u.BRACE_R);return this.node(e,{kind:h.SCHEMA_DEFINITION,description:t,directives:i,operationTypes:n})}parseOperationTypeDefinition(){let e=this._lexer.token,t=this.parseOperationType();this.expectToken(u.COLON);let i=this.parseNamedType();return this.node(e,{kind:h.OPERATION_TYPE_DEFINITION,operation:t,type:i})}parseScalarTypeDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword("scalar");let i=this.parseName(),n=this.parseConstDirectives();return this.node(e,{kind:h.SCALAR_TYPE_DEFINITION,description:t,name:i,directives:n})}parseObjectTypeDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword("type");let i=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),s=this.parseFieldsDefinition();return this.node(e,{kind:h.OBJECT_TYPE_DEFINITION,description:t,name:i,interfaces:n,directives:r,fields:s})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(u.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(u.BRACE_L,this.parseFieldDefinition,u.BRACE_R)}parseFieldDefinition(){let e=this._lexer.token,t=this.parseDescription(),i=this.parseName(),n=this.parseArgumentDefs();this.expectToken(u.COLON);let r=this.parseTypeReference(),s=this.parseConstDirectives();return this.node(e,{kind:h.FIELD_DEFINITION,description:t,name:i,arguments:n,type:r,directives:s})}parseArgumentDefs(){return this.optionalMany(u.PAREN_L,this.parseInputValueDef,u.PAREN_R)}parseInputValueDef(){let e;let t=this._lexer.token,i=this.parseDescription(),n=this.parseName();this.expectToken(u.COLON);let r=this.parseTypeReference();this.expectOptionalToken(u.EQUALS)&&(e=this.parseConstValueLiteral());let s=this.parseConstDirectives();return this.node(t,{kind:h.INPUT_VALUE_DEFINITION,description:i,name:n,type:r,defaultValue:e,directives:s})}parseInterfaceTypeDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword("interface");let i=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),s=this.parseFieldsDefinition();return this.node(e,{kind:h.INTERFACE_TYPE_DEFINITION,description:t,name:i,interfaces:n,directives:r,fields:s})}parseUnionTypeDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword("union");let i=this.parseName(),n=this.parseConstDirectives(),r=this.parseUnionMemberTypes();return this.node(e,{kind:h.UNION_TYPE_DEFINITION,description:t,name:i,directives:n,types:r})}parseUnionMemberTypes(){return this.expectOptionalToken(u.EQUALS)?this.delimitedMany(u.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword("enum");let i=this.parseName(),n=this.parseConstDirectives(),r=this.parseEnumValuesDefinition();return this.node(e,{kind:h.ENUM_TYPE_DEFINITION,description:t,name:i,directives:n,values:r})}parseEnumValuesDefinition(){return this.optionalMany(u.BRACE_L,this.parseEnumValueDefinition,u.BRACE_R)}parseEnumValueDefinition(){let e=this._lexer.token,t=this.parseDescription(),i=this.parseEnumValueName(),n=this.parseConstDirectives();return this.node(e,{kind:h.ENUM_VALUE_DEFINITION,description:t,name:i,directives:n})}parseEnumValueName(){if("true"===this._lexer.token.value||"false"===this._lexer.token.value||"null"===this._lexer.token.value)throw N(this._lexer.source,this._lexer.token.start,`${$(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword("input");let i=this.parseName(),n=this.parseConstDirectives(),r=this.parseInputFieldsDefinition();return this.node(e,{kind:h.INPUT_OBJECT_TYPE_DEFINITION,description:t,name:i,directives:n,fields:r})}parseInputFieldsDefinition(){return this.optionalMany(u.BRACE_L,this.parseInputValueDef,u.BRACE_R)}parseTypeSystemExtension(){let e=this._lexer.lookahead();if(e.kind===u.NAME)switch(e.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(e)}parseSchemaExtension(){let e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");let t=this.parseConstDirectives(),i=this.optionalMany(u.BRACE_L,this.parseOperationTypeDefinition,u.BRACE_R);if(0===t.length&&0===i.length)throw this.unexpected();return this.node(e,{kind:h.SCHEMA_EXTENSION,directives:t,operationTypes:i})}parseScalarTypeExtension(){let e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");let t=this.parseName(),i=this.parseConstDirectives();if(0===i.length)throw this.unexpected();return this.node(e,{kind:h.SCALAR_TYPE_EXTENSION,name:t,directives:i})}parseObjectTypeExtension(){let e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");let t=this.parseName(),i=this.parseImplementsInterfaces(),n=this.parseConstDirectives(),r=this.parseFieldsDefinition();if(0===i.length&&0===n.length&&0===r.length)throw this.unexpected();return this.node(e,{kind:h.OBJECT_TYPE_EXTENSION,name:t,interfaces:i,directives:n,fields:r})}parseInterfaceTypeExtension(){let e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");let t=this.parseName(),i=this.parseImplementsInterfaces(),n=this.parseConstDirectives(),r=this.parseFieldsDefinition();if(0===i.length&&0===n.length&&0===r.length)throw this.unexpected();return this.node(e,{kind:h.INTERFACE_TYPE_EXTENSION,name:t,interfaces:i,directives:n,fields:r})}parseUnionTypeExtension(){let e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");let t=this.parseName(),i=this.parseConstDirectives(),n=this.parseUnionMemberTypes();if(0===i.length&&0===n.length)throw this.unexpected();return this.node(e,{kind:h.UNION_TYPE_EXTENSION,name:t,directives:i,types:n})}parseEnumTypeExtension(){let e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");let t=this.parseName(),i=this.parseConstDirectives(),n=this.parseEnumValuesDefinition();if(0===i.length&&0===n.length)throw this.unexpected();return this.node(e,{kind:h.ENUM_TYPE_EXTENSION,name:t,directives:i,values:n})}parseInputObjectTypeExtension(){let e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");let t=this.parseName(),i=this.parseConstDirectives(),n=this.parseInputFieldsDefinition();if(0===i.length&&0===n.length)throw this.unexpected();return this.node(e,{kind:h.INPUT_OBJECT_TYPE_EXTENSION,name:t,directives:i,fields:n})}parseDirectiveDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword("directive"),this.expectToken(u.AT);let i=this.parseName(),n=this.parseArgumentDefs(),r=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");let s=this.parseDirectiveLocations();return this.node(e,{kind:h.DIRECTIVE_DEFINITION,description:t,name:i,arguments:n,repeatable:r,locations:s})}parseDirectiveLocations(){return this.delimitedMany(u.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){let e=this._lexer.token,t=this.parseName();if(Object.prototype.hasOwnProperty.call(c,t.value))return t;throw this.unexpected(e)}node(e,t){return!0!==this._options.noLocation&&(t.loc=new g(e,this._lexer.lastToken,this._lexer.source)),t}peek(e){return this._lexer.token.kind===e}expectToken(e){let t=this._lexer.token;if(t.kind===e)return this.advanceLexer(),t;throw N(this._lexer.source,t.start,`Expected ${V(e)}, found ${$(t)}.`)}expectOptionalToken(e){return this._lexer.token.kind===e&&(this.advanceLexer(),!0)}expectKeyword(e){let t=this._lexer.token;if(t.kind===u.NAME&&t.value===e)this.advanceLexer();else throw N(this._lexer.source,t.start,`Expected "${e}", found ${$(t)}.`)}expectOptionalKeyword(e){let t=this
13._lexer.token;return t.kind===u.NAME&&t.value===e&&(this.advanceLexer(),!0)}unexpected(e){let t=null!=e?e:this._lexer.token;return N(this._lexer.source,t.start,`Unexpected ${$(t)}.`)}any(e,t,i){this.expectToken(e);let n=[];for(;!this.expectOptionalToken(i);)n.push(t.call(this));return n}optionalMany(e,t,i){if(this.expectOptionalToken(e)){let e=[];do e.push(t.call(this));while(!this.expectOptionalToken(i));return e}return[]}many(e,t,i){this.expectToken(e);let n=[];do n.push(t.call(this));while(!this.expectOptionalToken(i));return n}delimitedMany(e,t){this.expectOptionalToken(e);let i=[];do i.push(t.call(this));while(this.expectOptionalToken(e));return i}advanceLexer(){let{maxTokens:e}=this._options,t=this._lexer.advance();if(t.kind!==u.EOF&&(++this._tokenCounter,void 0!==e&&this._tokenCounter>e))throw N(this._lexer.source,t.start,`Document contains more that ${e} tokens. Parsing aborted.`)}}function $(e){let t=e.value;return V(e.kind)+(null!=t?` "${t}"`:"")}function V(e){return e===u.BANG||e===u.DOLLAR||e===u.AMP||e===u.PAREN_L||e===u.PAREN_R||e===u.SPREAD||e===u.COLON||e===u.EQUALS||e===u.AT||e===u.BRACKET_L||e===u.BRACKET_R||e===u.BRACE_L||e===u.PIPE||e===u.BRACE_R?`"${e}"`:e}var z=new Map,K=new Map,j=!0,G=!1;function Y(e){return e.replace(/[\s,]+/g," ").trim()}function J(e){for(var t=[],i=1;i<arguments.length;i++)t[i-1]=arguments[i];"string"==typeof e&&(e=[e]);var n=e[0];return t.forEach(function(t,i){t&&"Document"===t.kind?n+=t.loc.source.body:n+=t,n+=e[i+1]}),function(e){var t=Y(e);if(!z.has(t)){var i,n,r,s,a,o=function(e,t){let i=new U(e,t),n=i.parseDocument();return Object.defineProperty(n,"tokenCount",{enumerable:!1,value:i.tokenCount}),n}(e,{experimentalFragmentVariables:G,allowLegacyFragmentVariables:G});if(!o||"Document"!==o.kind)throw Error("Not a valid GraphQL document.");z.set(t,((s=new Set((i=new Set,n=[],o.definitions.forEach(function(e){if("FragmentDefinition"===e.kind){var t,r=e.name.value,s=Y((t=e.loc).source.body.substring(t.start,t.end)),a=K.get(r);a&&!a.has(s)?j&&console.warn("Warning: fragment with name "+r+" already exists.\ngraphql-tag enforces all fragment names across your application to be unique; read more about\nthis in the docs: http://dev.apollodata.com/core/fragments.html#unique-names"):a||K.set(r,a=new Set),a.add(s),i.has(s)||(i.add(s),n.push(e))}else n.push(e)}),r=(0,p.pi)((0,p.pi)({},o),{definitions:n})).definitions)).forEach(function(e){e.loc&&delete e.loc,Object.keys(e).forEach(function(t){var i=e[t];i&&"object"==typeof i&&s.add(i)})}),(a=r.loc)&&(delete a.startToken,delete a.endToken),r))}return z.get(t)}(n)}var q=J;(o=J||(J={})).gql=q,o.resetCaches=function(){z.clear(),K.clear()},o.disableFragmentWarnings=function(){j=!1},o.enableExperimentalFragmentVariables=function(){G=!0},o.disableExperimentalFragmentVariables=function(){G=!1},J.default=J;var Q=J},43031:function(e,t,i){let n;i.d(t,{I:function(){return eC}});var r,s,a,o,l,c=i(69029),h=i(83749),u=i(24101),p=i(35976),d=i(42788),f=i(98288);let m={keyPrefix:"aws-amplify-cache",capacityInBytes:1048576,itemMaxSize:21e4,defaultTTL:2592e5,defaultPriority:5,warningThreshold:.8},E="CurSize";function I(e){let t=0;t=e.length;for(let i=e.length;i>=0;i-=1){let n=e.charCodeAt(i);n>127&&n<=2047?t+=1:n>2047&&n<=65535&&(t+=2),n>=56320&&n<=57343&&(i-=1)}return t}function y(){return new Date().getTime()}let N=e=>`${e}${E}`;var g=i(51970);(r=a||(a={})).NoCacheItem="NoCacheItem",r.NullNextNode="NullNextNode",r.NullPreviousNode="NullPreviousNode";let T={[a.NoCacheItem]:{message:"Item not found in the cache storage."},[a.NullNextNode]:{message:"Next node is null."},[a.NullPreviousNode]:{message:"Previous node is null."}},v=(0,g.$)(T),_=new c.k("StorageCache");class k{constructor({config:e,keyValueStorage:t}){this.config={...m,...e},this.keyValueStorage=t,this.sanitizeConfig()}getModuleName(){return"Cache"}configure(e){return e&&(e.keyPrefix&&_.warn("keyPrefix can not be re-configured on an existing Cache instance."),this.config={...this.config,...e}),this.sanitizeConfig(),this.config}
13async getCurrentCacheSize(){let e=await this.getStorage().getItem(N(this.config.keyPrefix));return e||(await this.getStorage().setItem(N(this.config.keyPrefix),"0"),e="0"),Number(e)}async setItem(e,t,i){if(_.debug(`Set item: key is ${e}, value is ${t} with options: ${i}`),!e||e===E){_.warn(`Invalid key: should not be empty or reserved key: '${E}'`);return}if(void 0===t){_.warn("The value of item should not be undefined!");return}let n={priority:i?.priority!==void 0?i.priority:this.config.defaultPriority,expires:i?.expires!==void 0?i.expires:this.config.defaultTTL+y()};if(n.priority<1||n.priority>5){_.warn("Invalid parameter: priority due to out or range. It should be within 1 and 5.");return}let r=`${this.config.keyPrefix}${e}`,s=this.fillCacheItem(r,t,n);if(s.byteSize>this.config.itemMaxSize){_.warn(`Item with key: ${e} you are trying to put into is too big!`);return}try{let e=await this.getStorage().getItem(r);if(e&&await this.removeCacheItem(r,JSON.parse(e).byteSize),await this.isCacheFull(s.byteSize)){let e=await this.clearInvalidAndGetRemainingKeys();if(await this.isCacheFull(s.byteSize)){let t=await this.sizeToPop(s.byteSize);await this.popOutItems(e,t)}}return this.setCacheItem(r,s)}catch(e){_.warn(`setItem failed! ${e}`)}}async getItem(e,t){let i;if(_.debug(`Get item: key is ${e} with options ${t}`),!e||e===E)return _.warn(`Invalid key: should not be empty or reserved key: '${E}'`),null;let n=`${this.config.keyPrefix}${e}`;
13try{if(i=await this.getStorage().getItem(n),null!=i){if(!await this.isExpired(n))return(await this.updateVisitedTime(JSON.parse(i),n)).data;await this.removeCacheItem(n,JSON.parse(i).byteSize)}if(t?.callback){let i=t.callback();return null!==i&&await this.setItem(e,i,t),i}return null}catch(e){return _.warn(`getItem failed! ${e}`),null}}async removeItem(e){if(_.debug(`Remove item: key is ${e}`),!e||e===E){_.warn(`Invalid key: should not be empty or reserved key: '${E}'`);return}let t=`${this.config.keyPrefix}${e}`;try{let e=await this.getStorage().getItem(t);e&&await this.removeCacheItem(t,JSON.parse(e).byteSize)}catch(e){_.warn(`removeItem failed! ${e}`)}}async getAllKeys(){try{return await this.getAllCacheKeys()}catch(e){return _.warn(`getAllkeys failed! ${e}`),[]}}getStorage(){return this.keyValueStorage}async isExpired(e){let t=await this.getStorage().getItem(e);v(null!==t,a.NoCacheItem,`Key: ${e}`);let i=JSON.parse(t);return y()>=i.expires}async removeCacheItem(e,t){let i=await this.getStorage().getItem(e);v(null!==i,a.NoCacheItem,`Key: ${e}`);let n=t??JSON.parse(i).byteSize;await this.decreaseCurrentSizeInBytes(n);
13try{await this.getStorage().removeItem(e)}catch(e){await this.increaseCurrentSizeInBytes(n),_.error(`Failed to remove item: ${e}`)}}fillCacheItem(e,t,i){let n={key:e,data:t,timestamp:y(),visitedTime:y(),priority:i.priority??0,expires:i.expires??0,type:typeof t,byteSize:0};return n.byteSize=I(JSON.stringify(n)),n.byteSize=I(JSON.stringify(n)),n}sanitizeConfig(){this.config.itemMaxSize>this.config.capacityInBytes&&(_.error("Invalid parameter: itemMaxSize. It should be smaller than capacityInBytes. Setting back to default."),this.config.itemMaxSize=m.itemMaxSize),(this.config.defaultPriority>5||this.config.defaultPriority<1)&&(_.error("Invalid parameter: defaultPriority. It should be between 1 and 5. Setting back to default."),this.config.defaultPriority=m.defaultPriority),(Number(this.config.warningThreshold)>1||0>Number(this.config.warningThreshold))&&(_.error("Invalid parameter: warningThreshold. It should be between 0 and 1. Setting back to default."),this.config.warningThreshold=m.warningThreshold),this.config.capacityInBytes>5242880&&(_.error("Cache Capacity should be less than 5MB. Setting back to default. Setting back to default."),this.config.capacityInBytes=m.capacityInBytes)}async increaseCurrentSizeInBytes(e){let t=await this.getCurrentCacheSize();
13await this.getStorage().setItem(N(this.config.keyPrefix),(t+e).toString())}async decreaseCurrentSizeInBytes(e){let t=await this.getCurrentCacheSize();await this.getStorage().setItem(N(this.config.keyPrefix),(t-e).toString())}async updateVisitedTime(e,t){return e.visitedTime=y(),await this.getStorage().setItem(t,JSON.stringify(e)),e}async setCacheItem(e,t){await this.increaseCurrentSizeInBytes(t.byteSize);try{await this.getStorage().setItem(e,JSON.stringify(t))}catch(e){await this.decreaseCurrentSizeInBytes(t.byteSize),_.error(`Failed to set item ${e}`)}}async sizeToPop(e){let t=await this.getCurrentCacheSize()+e-this.config.capacityInBytes,i=(1-this.config.warningThreshold)*this.config.capacityInBytes;return t>i?t:i}async isCacheFull(e){return e+await this.getCurrentCacheSize()>this.config.capacityInBytes}async popOutItems(e,t){let i=[],n=t;for(let t of e){let e=await this.getStorage().getItem(t);if(null!=e){let t=JSON.parse(e);i.push(t)}}for(let e of(i.sort((e,t)=>e.priority>t.priority?-1:e.priority<t.priority?1:e.visitedTime<t.visitedTime?-1:1),i))if(await this.removeCacheItem(e.key,e.byteSize),(n-=e.byteSize)<=0)return}async clearInvalidAndGetRemainingKeys(){let e=[];for(let t of(await this.getAllCacheKeys({omitSizeKey:!0})))await this.isExpired(t)?await this.removeCacheItem(t):e.push(t);return e}async clear(){_.debug("Clear Cache");try{for(let e of(await this.getAllKeys())){let t=`${this.config.keyPrefix}${e}`;
13await this.getStorage().removeItem(t)}}catch(e){_.warn(`clear failed! ${e}`)}}}let A=new c.k("StorageCache");class S extends k{constructor(e){let t=(0,f.K)();super({config:e,keyValueStorage:new d.T(t)}),this.storage=t,this.getItem=this.getItem.bind(this),this.setItem=this.setItem.bind(this),this.removeItem=this.removeItem.bind(this)}async getAllCacheKeys(e){let{omitSizeKey:t}=e??{},i=[];for(let e=0;e<this.storage.length;e++){let n=this.storage.key(e);(!t||n!==N(this.config.keyPrefix))&&n?.startsWith(this.config.keyPrefix)&&i.push(n.substring(this.config.keyPrefix.length))}return i}createInstance(e){return e.keyPrefix&&e.keyPrefix!==m.keyPrefix||(A.error("invalid keyPrefix, setting keyPrefix with timeStamp"),e.keyPrefix=y.toString()),new S(e)}}let x=new S;var O=i(42290);let C={[O.Z.NoEndpointId]:{message:"Endpoint ID was not found and was unable to be created."},[O.Z.PlatformNotSupported]:{message:"Function not supported on current platform."},[O.Z.Unknown]:{message:"An unknown error occurred."},[O.Z.NetworkError]:{message:"A network error has occurred."}},w=(0,g.$)(C),b=new c.k("getClientInfo");i(66274),i(13519);var D=i(29895),R=i(5493),L=i(7464),P=i(60266),F=i(67757),M=i(23153),B=i(32205);let U=(0,M.V)(B.S,[F.n,R.t,D.d,L.F,P.w]);var $=i(91145),V=i(52797),z=i(47718),K=i(51639),j=i(75726),G=i(33573),Y=i(98498),J=i(44852),q=i(89650);let Q={service:"mobiletargeting",endpointResolver:({region:e})=>({url:new j.a(`https://pinpoint.${e}.${(0,G.b)(e)}`)}),retryDecider:(0,J.j)(K.f),computeDelay:Y.k,get userAgentValue(){return(0,q.Zm)()}},X=()=>({"content-type":"application/json"}),Z=async e=>{if(e.statusCode>=300)throw await (0,K.f)(e);{let{Message:t,RequestID:i}=await (0,K.e)(e);return{MessageBody:{Message:t,RequestID:i},$metadata:(0,z.B)(e)}}},H=(0,$.z)(U,({ApplicationId:e="",EndpointId:t="",EndpointRequest:i},n)=>{let r=X(),s=new j.a(n.url);return s.pathname=`v1/apps/${(0,V.j)(e)}/endpoints/${(0,V.j)(t)}`,{method:"PUT",headers:r,url:s,body:JSON.stringify(i)}},Z,Q),W=(e,t)=>`${t}:pinpoint:${e}`,ee=async(e,t,i)=>{let n=W(e,t),r=new Date().getTime()+31536e8;return x.setItem(n,i,{expires:r,priority:1})},et={},ei=(e,t)=>{let i=W(e,t);return et[i]||(et[i]=(0,p.r)()),et[i]},en=(e,t)=>{let i=W(e,t);delete et[i]},er=async(e,t)=>{let i=W(e,t);return await x.getItem(i)??void 0},es=async({address:e,appId:t,category:i,channelType:n,credentials:r,identityId:s,optOut:a,region:o,userAttributes:l,userId:c,userProfile:h,userAgentValue:u})=>{let d=await er(t,i),f=d?void 0:ei(t,i),{customProperties:m,demographic:E,email:I,location:y,metrics:N,name:g,plan:T}=h??{},v={},_=f?c??s:c;if(f){let e="undefined"==typeof window?{}:function(){if("undefined"==typeof window)return b.warn("No window object available to get browser client info"),{};let e=window.navigator;if(!e)return b.warn("No navigator object available to get browser client info"),{};let{platform:t,product:i,vendor:n,userAgent:r,language:s}=e,a=function(e){let t=/.+(Opera[\s[A-Z]*|OPR[\sA-Z]*)\/([0-9.]+).*/i.exec(e);if(t)return{type:t[1],version:t[2]};let i=/.+(Trident|Edge|Edg|EdgA|EdgiOS)\/([0-9.]+).*/i.exec(e);if(i)return{type:i[1],version:i[2]};let n=/.+(Chrome|CriOS|Firefox|FxiOS)\/([0-9.]+).*/i.exec(e);if(n)return{type:n[1],version:n[2]};let r=/.+(Safari)\/([0-9.]+).*/i.exec(e);if(r)return{type:r[1],version:r[2]};let s=/.+(AppleWebKit)\/([0-9.]+).*/i.exec(e);if(s)return{type:s[1],version:s[2]};let a=/.*([A-Z]+)\/([0-9.]+).*/i.exec(e);return a?{type:a[1],version:a[2]}:{type:"",version:""}}(r),o=function(){let e=/\(([A-Za-z\s].*)\)/.exec(new Date().toString());return e&&e[1]||""}();return{platform:t,make:i||n,model:a.type,version:a.version,appVersion:[a.type,a.version].join("/"),language:s,timezone:o}}();v.appVersion=e.appVersion,v.make=e.make,v.model=e.model,v.modelVersion=e.version,v.platform=e.platform}let k={...v,...E},A={...I&&{email:[I]},...g&&{name:[g]},...T&&{plan:[T]},...m},S=f||E,x={ApplicationId:t,EndpointId:d??f,EndpointRequest:{RequestId:(0,p.r)(),EffectiveDate:new Date().toISOString(),ChannelType:n,Address:e,...(I||m||g||T)&&{Attributes:A},...S&&{Demographic:{AppVersion:k.appVersion,Locale:k.locale,Make:k.make,Model:k.model,ModelVersion:k.modelVersion,Platform:k.platform,PlatformVersion:k.platformVersion,Timezone:k.timezone}},...y&&{Location:{City:y.city,Country:y.country,Latitude:y.latitude,Longitude:y.longitude,PostalCode:y.postalCode,Region:y.region}},Metrics:N,OptOut:a,...(_||l)&&{User:{UserId:_,UserAttributes:l}}}};try{await H({credentials:r,region:o,userAgentValue:u},x),f&&await ee(t,i,f)}finally{f&&en(t,i)}},ea=async({address:e,appId:t,category:i,channelType:n,credentials:r,identityId:s,region:a,userAgentValue:o})=>{let l=await er(t,i);return l||(await es({address:e,appId:t,category:i,channelType:n,credentials:r,identityId:s,region:a,userAgentValue:o}),l=await er(t,i)),w(!!l,O.Z.NoEndpointId),l},eo=(e,t)=>e.accessKeyId!==t.accessKeyId||e.sessionToken!==t.sessionToken||e.secretAccessKey!==t.secretAccessKey;(o||(o={})).NoAppId="NoAppId";let el={[o.NoAppId]:{message:"Missing application id."}},ec=(0,g.$)(el),eh=async e=>{if(e.statusCode>=300)throw await (0,K.f)(e);{let{Results:t}=await (0,K.e)(e);return{EventsResponse:{Results:t},$metadata:(0,z.B)(e)}}},eu=(0,$.z)(U,({ApplicationId:e,EventsRequest:t},i)=>{ec(!!e,o.NoAppId);let n=X(),r=new j.a(i.url);
13return r.pathname=`v1/apps/${(0,V.j)(e)}/events`,{method:"POST",headers:n,url:r,body:JSON.stringify(t??{})}},eh,Q),ep=new c.k("PinpointEventBuffer"),ed=[429,500],ef=[202];class em{constructor(e){this._interval=void 0,this._pause=!1,this._flush=!1,this._buffer=[],this._config=e,this._sendBatch=this._sendBatch.bind(this),this._startLoop()}push(e){if(this._buffer.length>=this._config.bufferSize){ep.debug("Exceeded Pinpoint event buffer limits, event dropped.",{eventId:e.eventId});return}this._buffer.push({[e.eventId]:e})}pause(){this._pause=!0}resume(){this._pause=!1}flush(){this._flush=!0}identityHasChanged(e){return this._config.identityId!==e}haveCredentialsChanged(e){return eo(this._config.credentials,e)}flushAll(){this._putEvents(this._buffer.splice(0,this._buffer.length))}_startLoop(){this._interval&&clearInterval(this._interval);let{flushInterval:e}=this._config;this._interval=setInterval(this._sendBatch,e)}_sendBatch(){let e=this._buffer.length;if(this._flush&&!e&&this._interval&&clearInterval(this._interval),this._pause||!e)return;let{flushSize:t}=this._config,i=this._buffer.splice(0,Math.min(t,e));this._putEvents(i)}async _putEvents(e){let t=this._bufferToMap(e),i=this._generateBatchEventParams(t);try{let{credentials:e,region:n,userAgentValue:r}=this._config,s=await eu({credentials:e,region:n,userAgentValue:r},i);this._processPutEventsSuccessResponse(s,t)}catch(e){this._handlePutEventsFailure(e,t)}}_generateBatchEventParams(e){let t={};return Object.values(e).forEach(e=>{let{event:i,timestamp:n,endpointId:r,eventId:s,session:a}=e,{name:o,attributes:l,metrics:c}=i;t[r]={Endpoint:{...t[r]?.Endpoint},Events:{...t[r]?.Events,[s]:{EventType:o,Timestamp:new Date(n).toISOString(),Attributes:l,Metrics:c,Session:a}}}}),{ApplicationId:this._config.appId,EventsRequest:{BatchItem:t}}}_handlePutEventsFailure(e,t){ep.debug("putEvents call to Pinpoint failed.",e);let i=e.$metadata&&e.$metadata.httpStatusCode;if(ed.includes(i)){let e=Object.values(t);this._retry(e)}}_processPutEventsSuccessResponse(e,t){let{Results:i={}}=e.EventsResponse??{},n=[];Object.entries(i).forEach(([e,i])=>{Object.entries(i.EventsItemResponse??{}).forEach(([e,i])=>{let r=t[e];if(!r)return;let{StatusCode:s,Message:a}=i??{};if(s&&ef.includes(s))return;if(s&&ed.includes(s)){n.push(r);return}let{name:o}=r.event;ep.warn("Pinpoint event failed to send.",{eventId:e,name:o,message:a})})}),n.length&&this._retry(n)}_retry(e){let t=[];e.forEach(e=>{let{eventId:i}=e,{name:n}=e.event;if(e.resendLimit-- >0){ep.debug("Resending event.",{eventId:i,name:n,remainingAttempts:e.resendLimit}),t.push({[i]:e});return}ep.debug("No retry attempts remaining for event.",{eventId:i,name:n})}),this._buffer.unshift(...t)}_bufferToMap(e){return e.reduce((e,t)=>{let[[i,n]]=Object.entries(t);return e[i]=n,e},{})}}let eE={},eI=({appId:e,region:t,credentials:i,bufferSize:n,flushInterval:r,flushSize:s,resendLimit:a,identityId:o,userAgentValue:l})=>{if(eE[t]?.[e]){let n=eE[t][e];if(!(n.identityHasChanged(o)||n.haveCredentialsChanged(i)))return n;n.flush()}let c=new em({appId:e,bufferSize:n,credentials:i,flushInterval:r,flushSize:s,identityId:o,region:t,resendLimit:a,userAgentValue:l});return eE[t]||(eE[t]={}),eE[t][e]=c,c},ey=async({appId:e,category:t,channelType:i,credentials:r,event:s,identityId:a,region:o,userAgentValue:l,bufferSize:c,flushInterval:h,flushSize:u,resendLimit:d})=>{let f=n,m=new Date,E=m.toISOString(),I=(0,p.r)(),y=eI({appId:e,region:o,credentials:r,bufferSize:c??1e3,flushInterval:h??5e3,flushSize:u??100,resendLimit:d??5,identityId:a,userAgentValue:l}),N=await ea({appId:e,category:t,channelType:i,credentials:r,identityId:a,region:o,userAgentValue:l});f&&"_session.start"!==s.name||(f=n={Id:(0,p.r)(),StartTimestamp:E}),n&&"_session.stop"===s.name&&(f={...n,StopTimestamp:E,Duration:m.getTime()-new Date(n.StartTimestamp).getTime()},n=void 0),y.push({eventId:I,endpointId:N,event:s,session:f,timestamp:E,resendLimit:d??5})};var eN=i(73426);class eg extends eN._{constructor(e){super(e),this.constructor=eg,Object.setPrototypeOf(this,eg.prototype)}}(s=l||(l={})).NoAppId="NoAppId",s.NoCredentials="NoCredentials",s.NoEventName="NoEventName",s.NoRegion="NoRegion",s.InvalidTracker="InvalidTracker",s.UnsupportedPlatform="UnsupportedPlatform",s.NoTrackingId="NoTrackingId",s.InvalidFlushSize="InvalidFlushSize";let eT={[l.NoAppId]:{message:"Missing application id."},[l.NoCredentials]:{message:"Credentials should not be empty."},[l.NoEventName]:{message:"Events must specify a name."},[l.NoRegion]:{message:"Missing region."},[l.InvalidTracker]:{message:"Invalid tracker type specified."},[l.UnsupportedPlatform]:{message:"Only session tracking is supported on React Native."},[l.InvalidFlushSize]:{message:"Invalid FlushSize, it should be smaller than BufferSize"},[l.NoTrackingId]:{message:"A trackingId is required to use Amazon Personalize"}};function ev(e,t,i){let{message:n,recoverySuggestion:r}=eT[t];if(!e)throw new eg({name:t,message:i??n,recoverySuggestion:r})}var e_=i(48549),ek=i(60293);let eA=()=>{let{appId:e,region:t,bufferSize:i,flushSize:n,flushInterval:r,resendLimit:s}=ek.d.getConfig().Analytics?.Pinpoint??{};return ev(!!e,l.NoAppId),ev(!!t,l.NoRegion),{appId:e,region:t,bufferSize:i,flushSize:n,flushInterval:r,resendLimit:s}};var eS=i(75813);let ex=async()=>{let{credentials:e,identityId:t}=await (0,eS.y)();return ev(!!e,l.NoCredentials),{credentials:e,identityId:t}},eO=new c.k("Analytics"),eC=e=>{let{appId:t,region:i,bufferSize:n,flushSize:r,flushInterval:s,resendLimit:a}=eA();if(!(0,e_.n)()){eO.debug("Analytics is disabled, event will not be recorded.");return}ev(!!e.name,l.NoEventName),ex().then(({credentials:o,identityId:l})=>{var c;h.Xb.dispatch("analytics",{event:"record",data:e,message:"Recording Analytics event"},"Analytics",h.SQ),ey({appId:t,category:"Analytics",credentials:o,event:e,identityId:l,region:i,userAgentValue:(c=u.m0.Record,(0,q.Zm)({category:u.WD.Analytics,action:c})),bufferSize:n,flushSize:r,flushInterval:s,resendLimit:a})}).catch(e=>{eO.warn("Failed to record event.",e)})}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.