@coasys/ad4m-connect 0.9.1-prerelease.1 → 0.9.1-prerelease.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/core.js CHANGED
@@ -1,31 +1,31 @@
1
- var qe=(t,e,r)=>new Promise((n,i)=>{var a=u=>{try{s(r.next(u))}catch(l){i(l)}},o=u=>{try{s(r.throw(u))}catch(l){i(l)}},s=u=>u.done?n(u.value):Promise.resolve(u.value).then(a,o);s((r=r.apply(t,e)).next())});var Sa=function(t,e){return Sa=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},Sa(t,e)};function de(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Sa(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var m=function(){return m=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},m.apply(this,arguments)};function ht(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function nt(t,e,r,n){function i(a){return a instanceof r?a:new r(function(o){o(a)})}return new(r||(r=Promise))(function(a,o){function s(f){try{l(n.next(f))}catch(d){o(d)}}function u(f){try{l(n.throw(f))}catch(d){o(d)}}function l(f){f.done?a(f.value):i(f.value).then(s,u)}l((n=n.apply(t,e||[])).next())})}function it(t,e){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(l){return function(f){return u([l,f])}}function u(l){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,l[0]&&(r=0)),r;)try{if(n=1,i&&(a=l[0]&2?i.return:l[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,l[1])).done)return a;switch(i=0,a&&(l=[l[0]&2,a.value]),l[0]){case 0:case 1:a=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,i=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!a||l[1]>a[0]&&l[1]<a[3])){r.label=l[1];break}if(l[0]===6&&r.label<a[1]){r.label=a[1],a=l;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(l);break}a[2]&&r.ops.pop(),r.trys.pop();continue}l=e.call(t,r)}catch(f){l=[6,f],i=0}finally{n=a=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function Ct(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,a;n<i;n++)(a||!(n in e))&&(a||(a=Array.prototype.slice.call(e,0,n)),a[n]=e[n]);return t.concat(a||Array.prototype.slice.call(e))}var wa="Invariant Violation",ls=Object.setPrototypeOf,Gu=ls===void 0?function(t,e){return t.__proto__=e,t}:ls,$=function(t){de(e,t);function e(r){r===void 0&&(r=wa);var n=t.call(this,typeof r=="number"?wa+": "+r+" (see https://github.com/apollographql/invariant-packages)":r)||this;return n.framesToPop=1,n.name=wa,Gu(n,e.prototype),n}return e}(Error);function I(t,e){if(!t)throw new $(e)}var ei=["debug","log","warn","error","silent"],_a=ei.indexOf("log");function Zn(t){return function(){if(ei.indexOf(t)>=_a){var e=console[t]||console.log;return e.apply(console,arguments)}}}(function(t){t.debug=Zn("debug"),t.log=Zn("log"),t.warn=Zn("warn"),t.error=Zn("error")})(I||(I={}));function fs(t){var e=ei[_a];return _a=Math.max(0,ei.indexOf(t)),e}function Ee(t){try{return t()}catch{}}var ti=Ee(function(){return globalThis})||Ee(function(){return window})||Ee(function(){return self})||Ee(function(){return global})||Ee(function(){return Ee.constructor("return this")()});var ps="__",ds=[ps,ps].join("DEV");function Wu(){try{return Boolean(__DEV__)}catch{return Object.defineProperty(ti,ds,{value:Ee(function(){return"production"})!=="production",enumerable:!1,configurable:!0,writable:!0}),ti[ds]}}var Zt=Wu();function Rt(t){try{return t()}catch{}}var Ea=Rt(function(){return globalThis})||Rt(function(){return window})||Rt(function(){return self})||Rt(function(){return global})||Rt(function(){return Rt.constructor("return this")()}),xa=!1;function Ku(){Ea&&!Rt(function(){return"production"})&&!Rt(function(){return process})&&(Object.defineProperty(Ea,"process",{value:{env:{NODE_ENV:"production"}},configurable:!0,enumerable:!1,writable:!0}),xa=!0)}Ku();function Oa(){xa&&(delete Ea.process,xa=!1)}var sd=typeof Symbol=="function"&&Symbol.iterator!=null?Symbol.iterator:"@@iterator",cd=typeof Symbol=="function"&&Symbol.asyncIterator!=null?Symbol.asyncIterator:"@@asyncIterator",hs=typeof Symbol=="function"&&Symbol.toStringTag!=null?Symbol.toStringTag:"@@toStringTag";var ge=Object.freeze({NAME:"Name",DOCUMENT:"Document",OPERATION_DEFINITION:"OperationDefinition",VARIABLE_DEFINITION:"VariableDefinition",SELECTION_SET:"SelectionSet",FIELD:"Field",ARGUMENT:"Argument",FRAGMENT_SPREAD:"FragmentSpread",INLINE_FRAGMENT:"InlineFragment",FRAGMENT_DEFINITION:"FragmentDefinition",VARIABLE:"Variable",INT:"IntValue",FLOAT:"FloatValue",STRING:"StringValue",BOOLEAN:"BooleanValue",NULL:"NullValue",ENUM:"EnumValue",LIST:"ListValue",OBJECT:"ObjectValue",OBJECT_FIELD:"ObjectField",DIRECTIVE:"Directive",NAMED_TYPE:"NamedType",LIST_TYPE:"ListType",NON_NULL_TYPE:"NonNullType",SCHEMA_DEFINITION:"SchemaDefinition",OPERATION_TYPE_DEFINITION:"OperationTypeDefinition",SCALAR_TYPE_DEFINITION:"ScalarTypeDefinition",OBJECT_TYPE_DEFINITION:"ObjectTypeDefinition",FIELD_DEFINITION:"FieldDefinition",INPUT_VALUE_DEFINITION:"InputValueDefinition",INTERFACE_TYPE_DEFINITION:"InterfaceTypeDefinition",UNION_TYPE_DEFINITION:"UnionTypeDefinition",ENUM_TYPE_DEFINITION:"EnumTypeDefinition",ENUM_VALUE_DEFINITION:"EnumValueDefinition",INPUT_OBJECT_TYPE_DEFINITION:"InputObjectTypeDefinition",DIRECTIVE_DEFINITION:"DirectiveDefinition",SCHEMA_EXTENSION:"SchemaExtension",SCALAR_TYPE_EXTENSION:"ScalarTypeExtension",OBJECT_TYPE_EXTENSION:"ObjectTypeExtension",INTERFACE_TYPE_EXTENSION:"InterfaceTypeExtension",UNION_TYPE_EXTENSION:"UnionTypeExtension",ENUM_TYPE_EXTENSION:"EnumTypeExtension",INPUT_OBJECT_TYPE_EXTENSION:"InputObjectTypeExtension"});function Ta(t,e){var r=Boolean(t);if(!r)throw new Error(e??"Unexpected invariant triggered.")}var zu=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):void 0,un=zu;function ri(t){var e=t.prototype.toJSON;typeof e=="function"||Ta(0),t.prototype.inspect=e,un&&(t.prototype[un]=e)}var ms=function(){function t(r,n,i){this.start=r.start,this.end=n.end,this.startToken=r,this.endToken=n,this.source=i}var e=t.prototype;return e.toJSON=function(){return{start:this.start,end:this.end}},t}();ri(ms);var ys=function(){function t(r,n,i,a,o,s,u){this.kind=r,this.start=n,this.end=i,this.line=a,this.column=o,this.value=u,this.prev=s,this.next=null}var e=t.prototype;return e.toJSON=function(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}},t}();ri(ys);function Ia(t){return t!=null&&typeof t.kind=="string"}function ni(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ni=function(r){return typeof r}:ni=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},ni(t)}var Ju=10,vs=2;function ln(t){return ii(t,[])}function ii(t,e){switch(ni(t)){case"string":return JSON.stringify(t);case"function":return t.name?"[function ".concat(t.name,"]"):"[function]";case"object":return t===null?"null":Hu(t,e);default:return String(t)}}function Hu(t,e){if(e.indexOf(t)!==-1)return"[Circular]";var r=[].concat(e,[t]),n=Zu(t);if(n!==void 0){var i=n.call(t);if(i!==t)return typeof i=="string"?i:ii(i,r)}else if(Array.isArray(t))return Xu(t,r);return Yu(t,r)}function Yu(t,e){var r=Object.keys(t);if(r.length===0)return"{}";if(e.length>vs)return"["+el(t)+"]";var n=r.map(function(i){var a=ii(t[i],e);return i+": "+a});return"{ "+n.join(", ")+" }"}function Xu(t,e){if(t.length===0)return"[]";if(e.length>vs)return"[Array]";for(var r=Math.min(Ju,t.length),n=t.length-r,i=[],a=0;a<r;++a)i.push(ii(t[a],e));return n===1?i.push("... 1 more item"):n>1&&i.push("... ".concat(n," more items")),"["+i.join(", ")+"]"}function Zu(t){var e=t[String(un)];if(typeof e=="function")return e;if(typeof t.inspect=="function")return t.inspect}function el(t){var e=Object.prototype.toString.call(t).replace(/^\[object /,"").replace(/]$/,"");if(e==="Object"&&typeof t.constructor=="function"){var r=t.constructor.name;if(typeof r=="string"&&r!=="")return r}return e}function fn(t,e){var r=Boolean(t);if(!r)throw new Error(e)}function gs(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function tl(t,e,r){return e&&gs(t.prototype,e),r&&gs(t,r),t}var ai=function(){function t(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"GraphQL request",n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{line:1,column:1};typeof e=="string"||fn(0,"Body must be a string. Received: ".concat(ln(e),".")),this.body=e,this.name=r,this.locationOffset=n,this.locationOffset.line>0||fn(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||fn(0,"column in locationOffset is 1-indexed and must be positive.")}return tl(t,[{key:hs,get:function(){return"Source"}}]),t}();function bs(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,n=t.indexOf(`
1
+ var Ce=(t,e,r)=>new Promise((n,i)=>{var a=u=>{try{s(r.next(u))}catch(l){i(l)}},o=u=>{try{s(r.throw(u))}catch(l){i(l)}},s=u=>u.done?n(u.value):Promise.resolve(u.value).then(a,o);s((r=r.apply(t,e)).next())});var Ea=function(t,e){return Ea=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},Ea(t,e)};function de(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Ea(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var m=function(){return m=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},m.apply(this,arguments)};function ht(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function nt(t,e,r,n){function i(a){return a instanceof r?a:new r(function(o){o(a)})}return new(r||(r=Promise))(function(a,o){function s(f){try{l(n.next(f))}catch(d){o(d)}}function u(f){try{l(n.throw(f))}catch(d){o(d)}}function l(f){f.done?a(f.value):i(f.value).then(s,u)}l((n=n.apply(t,e||[])).next())})}function it(t,e){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(l){return function(f){return u([l,f])}}function u(l){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,l[0]&&(r=0)),r;)try{if(n=1,i&&(a=l[0]&2?i.return:l[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,l[1])).done)return a;switch(i=0,a&&(l=[l[0]&2,a.value]),l[0]){case 0:case 1:a=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,i=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!a||l[1]>a[0]&&l[1]<a[3])){r.label=l[1];break}if(l[0]===6&&r.label<a[1]){r.label=a[1],a=l;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(l);break}a[2]&&r.ops.pop(),r.trys.pop();continue}l=e.call(t,r)}catch(f){l=[6,f],i=0}finally{n=a=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function Ct(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,a;n<i;n++)(a||!(n in e))&&(a||(a=Array.prototype.slice.call(e,0,n)),a[n]=e[n]);return t.concat(a||Array.prototype.slice.call(e))}var Ta="Invariant Violation",ds=Object.setPrototypeOf,zu=ds===void 0?function(t,e){return t.__proto__=e,t}:ds,$=function(t){de(e,t);function e(r){r===void 0&&(r=Ta);var n=t.call(this,typeof r=="number"?Ta+": "+r+" (see https://github.com/apollographql/invariant-packages)":r)||this;return n.framesToPop=1,n.name=Ta,zu(n,e.prototype),n}return e}(Error);function I(t,e){if(!t)throw new $(e)}var ni=["debug","log","warn","error","silent"],Oa=ni.indexOf("log");function ri(t){return function(){if(ni.indexOf(t)>=Oa){var e=console[t]||console.log;return e.apply(console,arguments)}}}(function(t){t.debug=ri("debug"),t.log=ri("log"),t.warn=ri("warn"),t.error=ri("error")})(I||(I={}));function hs(t){var e=ni[Oa];return Oa=Math.max(0,ni.indexOf(t)),e}function Ee(t){try{return t()}catch{}}var ii=Ee(function(){return globalThis})||Ee(function(){return window})||Ee(function(){return self})||Ee(function(){return global})||Ee(function(){return Ee.constructor("return this")()});var ms="__",ys=[ms,ms].join("DEV");function Ju(){try{return Boolean(__DEV__)}catch{return Object.defineProperty(ii,ys,{value:Ee(function(){return"production"})!=="production",enumerable:!1,configurable:!0,writable:!0}),ii[ys]}}var Zt=Ju();function Rt(t){try{return t()}catch{}}var xa=Rt(function(){return globalThis})||Rt(function(){return window})||Rt(function(){return self})||Rt(function(){return global})||Rt(function(){return Rt.constructor("return this")()}),Ia=!1;function Hu(){xa&&!Rt(function(){return"production"})&&!Rt(function(){return process})&&(Object.defineProperty(xa,"process",{value:{env:{NODE_ENV:"production"}},configurable:!0,enumerable:!1,writable:!0}),Ia=!0)}Hu();function Da(){Ia&&(delete xa.process,Ia=!1)}var pd=typeof Symbol=="function"&&Symbol.iterator!=null?Symbol.iterator:"@@iterator",dd=typeof Symbol=="function"&&Symbol.asyncIterator!=null?Symbol.asyncIterator:"@@asyncIterator",gs=typeof Symbol=="function"&&Symbol.toStringTag!=null?Symbol.toStringTag:"@@toStringTag";var ve=Object.freeze({NAME:"Name",DOCUMENT:"Document",OPERATION_DEFINITION:"OperationDefinition",VARIABLE_DEFINITION:"VariableDefinition",SELECTION_SET:"SelectionSet",FIELD:"Field",ARGUMENT:"Argument",FRAGMENT_SPREAD:"FragmentSpread",INLINE_FRAGMENT:"InlineFragment",FRAGMENT_DEFINITION:"FragmentDefinition",VARIABLE:"Variable",INT:"IntValue",FLOAT:"FloatValue",STRING:"StringValue",BOOLEAN:"BooleanValue",NULL:"NullValue",ENUM:"EnumValue",LIST:"ListValue",OBJECT:"ObjectValue",OBJECT_FIELD:"ObjectField",DIRECTIVE:"Directive",NAMED_TYPE:"NamedType",LIST_TYPE:"ListType",NON_NULL_TYPE:"NonNullType",SCHEMA_DEFINITION:"SchemaDefinition",OPERATION_TYPE_DEFINITION:"OperationTypeDefinition",SCALAR_TYPE_DEFINITION:"ScalarTypeDefinition",OBJECT_TYPE_DEFINITION:"ObjectTypeDefinition",FIELD_DEFINITION:"FieldDefinition",INPUT_VALUE_DEFINITION:"InputValueDefinition",INTERFACE_TYPE_DEFINITION:"InterfaceTypeDefinition",UNION_TYPE_DEFINITION:"UnionTypeDefinition",ENUM_TYPE_DEFINITION:"EnumTypeDefinition",ENUM_VALUE_DEFINITION:"EnumValueDefinition",INPUT_OBJECT_TYPE_DEFINITION:"InputObjectTypeDefinition",DIRECTIVE_DEFINITION:"DirectiveDefinition",SCHEMA_EXTENSION:"SchemaExtension",SCALAR_TYPE_EXTENSION:"ScalarTypeExtension",OBJECT_TYPE_EXTENSION:"ObjectTypeExtension",INTERFACE_TYPE_EXTENSION:"InterfaceTypeExtension",UNION_TYPE_EXTENSION:"UnionTypeExtension",ENUM_TYPE_EXTENSION:"EnumTypeExtension",INPUT_OBJECT_TYPE_EXTENSION:"InputObjectTypeExtension"});function ka(t,e){var r=Boolean(t);if(!r)throw new Error(e??"Unexpected invariant triggered.")}var Yu=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):void 0,un=Yu;function ai(t){var e=t.prototype.toJSON;typeof e=="function"||ka(0),t.prototype.inspect=e,un&&(t.prototype[un]=e)}var vs=function(){function t(r,n,i){this.start=r.start,this.end=n.end,this.startToken=r,this.endToken=n,this.source=i}var e=t.prototype;return e.toJSON=function(){return{start:this.start,end:this.end}},t}();ai(vs);var bs=function(){function t(r,n,i,a,o,s,u){this.kind=r,this.start=n,this.end=i,this.line=a,this.column=o,this.value=u,this.prev=s,this.next=null}var e=t.prototype;return e.toJSON=function(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}},t}();ai(bs);function Na(t){return t!=null&&typeof t.kind=="string"}function oi(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?oi=function(r){return typeof r}:oi=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},oi(t)}var Xu=10,Ss=2;function ln(t){return si(t,[])}function si(t,e){switch(oi(t)){case"string":return JSON.stringify(t);case"function":return t.name?"[function ".concat(t.name,"]"):"[function]";case"object":return t===null?"null":Zu(t,e);default:return String(t)}}function Zu(t,e){if(e.indexOf(t)!==-1)return"[Circular]";var r=[].concat(e,[t]),n=rl(t);if(n!==void 0){var i=n.call(t);if(i!==t)return typeof i=="string"?i:si(i,r)}else if(Array.isArray(t))return tl(t,r);return el(t,r)}function el(t,e){var r=Object.keys(t);if(r.length===0)return"{}";if(e.length>Ss)return"["+nl(t)+"]";var n=r.map(function(i){var a=si(t[i],e);return i+": "+a});return"{ "+n.join(", ")+" }"}function tl(t,e){if(t.length===0)return"[]";if(e.length>Ss)return"[Array]";for(var r=Math.min(Xu,t.length),n=t.length-r,i=[],a=0;a<r;++a)i.push(si(t[a],e));return n===1?i.push("... 1 more item"):n>1&&i.push("... ".concat(n," more items")),"["+i.join(", ")+"]"}function rl(t){var e=t[String(un)];if(typeof e=="function")return e;if(typeof t.inspect=="function")return t.inspect}function nl(t){var e=Object.prototype.toString.call(t).replace(/^\[object /,"").replace(/]$/,"");if(e==="Object"&&typeof t.constructor=="function"){var r=t.constructor.name;if(typeof r=="string"&&r!=="")return r}return e}function fn(t,e){var r=Boolean(t);if(!r)throw new Error(e)}function ws(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function il(t,e,r){return e&&ws(t.prototype,e),r&&ws(t,r),t}var ci=function(){function t(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"GraphQL request",n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{line:1,column:1};typeof e=="string"||fn(0,"Body must be a string. Received: ".concat(ln(e),".")),this.body=e,this.name=r,this.locationOffset=n,this.locationOffset.line>0||fn(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||fn(0,"column in locationOffset is 1-indexed and must be positive.")}return il(t,[{key:gs,get:function(){return"Source"}}]),t}();function _s(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,n=t.indexOf(`
2
2
  `)===-1,i=t[0]===" "||t[0]===" ",a=t[t.length-1]==='"',o=t[t.length-1]==="\\",s=!n||a||o||r,u="";return s&&!(n&&i)&&(u+=`
3
3
  `+e),u+=e?t.replace(/\n/g,`
4
4
  `+e):t,s&&(u+=`
5
- `),'"""'+u.replace(/"""/g,'\\"""')+'"""'}var rl={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["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:["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"]},er=Object.freeze({});function Ne(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:rl,n=void 0,i=Array.isArray(t),a=[t],o=-1,s=[],u=void 0,l=void 0,f=void 0,d=[],h=[],p=t;do{o++;var y=o===a.length,v=y&&s.length!==0;if(y){if(l=h.length===0?void 0:d[d.length-1],u=f,f=h.pop(),v){if(i)u=u.slice();else{for(var S={},E=0,b=Object.keys(u);E<b.length;E++){var w=b[E];S[w]=u[w]}u=S}for(var T=0,A=0;A<s.length;A++){var N=s[A][0],k=s[A][1];i&&(N-=T),i&&k===null?(u.splice(N,1),T++):u[N]=k}}o=n.index,a=n.keys,s=n.edits,i=n.inArray,n=n.prev}else{if(l=f?i?o:a[o]:void 0,u=f?f[l]:p,u==null)continue;f&&d.push(l)}var C=void 0;if(!Array.isArray(u)){if(!Ia(u))throw new Error("Invalid AST Node: ".concat(ln(u),"."));var Z=Da(e,u.kind,y);if(Z){if(C=Z.call(e,u,l,f,d,h),C===er)break;if(C===!1){if(!y){d.pop();continue}}else if(C!==void 0&&(s.push([l,C]),!y))if(Ia(C))u=C;else{d.pop();continue}}}if(C===void 0&&v&&s.push([l,u]),y)d.pop();else{var Y;n={inArray:i,index:o,keys:a,edits:s,prev:n},i=Array.isArray(u),a=i?u:(Y=r[u.kind])!==null&&Y!==void 0?Y:[],o=-1,s=[],f&&h.push(f),f=u}}while(n!==void 0);return s.length!==0&&(p=s[s.length-1][1]),p}function Da(t,e,r){var n=t[e];if(n){if(!r&&typeof n=="function")return n;var i=r?n.leave:n.enter;if(typeof i=="function")return i}else{var a=r?t.leave:t.enter;if(a){if(typeof a=="function")return a;var o=a[e];if(typeof o=="function")return o}}}function Ar(t){return Ne(t,{leave:il})}var nl=80,il={Name:function(e){return e.value},Variable:function(e){return"$"+e.name},Document:function(e){return P(e.definitions,`
5
+ `),'"""'+u.replace(/"""/g,'\\"""')+'"""'}var al={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["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:["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"]},er=Object.freeze({});function Ae(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:al,n=void 0,i=Array.isArray(t),a=[t],o=-1,s=[],u=void 0,l=void 0,f=void 0,d=[],h=[],p=t;do{o++;var y=o===a.length,g=y&&s.length!==0;if(y){if(l=h.length===0?void 0:d[d.length-1],u=f,f=h.pop(),g){if(i)u=u.slice();else{for(var S={},T=0,b=Object.keys(u);T<b.length;T++){var w=b[T];S[w]=u[w]}u=S}for(var O=0,N=0;N<s.length;N++){var A=s[N][0],k=s[N][1];i&&(A-=O),i&&k===null?(u.splice(A,1),O++):u[A]=k}}o=n.index,a=n.keys,s=n.edits,i=n.inArray,n=n.prev}else{if(l=f?i?o:a[o]:void 0,u=f?f[l]:p,u==null)continue;f&&d.push(l)}var C=void 0;if(!Array.isArray(u)){if(!Na(u))throw new Error("Invalid AST Node: ".concat(ln(u),"."));var te=Aa(e,u.kind,y);if(te){if(C=te.call(e,u,l,f,d,h),C===er)break;if(C===!1){if(!y){d.pop();continue}}else if(C!==void 0&&(s.push([l,C]),!y))if(Na(C))u=C;else{d.pop();continue}}}if(C===void 0&&g&&s.push([l,u]),y)d.pop();else{var Z;n={inArray:i,index:o,keys:a,edits:s,prev:n},i=Array.isArray(u),a=i?u:(Z=r[u.kind])!==null&&Z!==void 0?Z:[],o=-1,s=[],f&&h.push(f),f=u}}while(n!==void 0);return s.length!==0&&(p=s[s.length-1][1]),p}function Aa(t,e,r){var n=t[e];if(n){if(!r&&typeof n=="function")return n;var i=r?n.leave:n.enter;if(typeof i=="function")return i}else{var a=r?t.leave:t.enter;if(a){if(typeof a=="function")return a;var o=a[e];if(typeof o=="function")return o}}}function Nr(t){return Ae(t,{leave:sl})}var ol=80,sl={Name:function(e){return e.value},Variable:function(e){return"$"+e.name},Document:function(e){return P(e.definitions,`
6
6
 
7
7
  `)+`
8
- `},OperationDefinition:function(e){var r=e.operation,n=e.name,i=le("(",P(e.variableDefinitions,", "),")"),a=P(e.directives," "),o=e.selectionSet;return!n&&!a&&!i&&r==="query"?o:P([r,P([n,i]),a,o]," ")},VariableDefinition:function(e){var r=e.variable,n=e.type,i=e.defaultValue,a=e.directives;return r+": "+n+le(" = ",i)+le(" ",P(a," "))},SelectionSet:function(e){var r=e.selections;return ot(r)},Field:function(e){var r=e.alias,n=e.name,i=e.arguments,a=e.directives,o=e.selectionSet,s=le("",r,": ")+n,u=s+le("(",P(i,", "),")");return u.length>nl&&(u=s+le(`(
9
- `,oi(P(i,`
8
+ `},OperationDefinition:function(e){var r=e.operation,n=e.name,i=le("(",P(e.variableDefinitions,", "),")"),a=P(e.directives," "),o=e.selectionSet;return!n&&!a&&!i&&r==="query"?o:P([r,P([n,i]),a,o]," ")},VariableDefinition:function(e){var r=e.variable,n=e.type,i=e.defaultValue,a=e.directives;return r+": "+n+le(" = ",i)+le(" ",P(a," "))},SelectionSet:function(e){var r=e.selections;return ot(r)},Field:function(e){var r=e.alias,n=e.name,i=e.arguments,a=e.directives,o=e.selectionSet,s=le("",r,": ")+n,u=s+le("(",P(i,", "),")");return u.length>ol&&(u=s+le(`(
9
+ `,ui(P(i,`
10
10
  `)),`
11
- )`)),P([u,P(a," "),o]," ")},Argument:function(e){var r=e.name,n=e.value;return r+": "+n},FragmentSpread:function(e){var r=e.name,n=e.directives;return"..."+r+le(" ",P(n," "))},InlineFragment:function(e){var r=e.typeCondition,n=e.directives,i=e.selectionSet;return P(["...",le("on ",r),P(n," "),i]," ")},FragmentDefinition:function(e){var r=e.name,n=e.typeCondition,i=e.variableDefinitions,a=e.directives,o=e.selectionSet;return"fragment ".concat(r).concat(le("(",P(i,", "),")")," ")+"on ".concat(n," ").concat(le("",P(a," ")," "))+o},IntValue:function(e){var r=e.value;return r},FloatValue:function(e){var r=e.value;return r},StringValue:function(e,r){var n=e.value,i=e.block;return i?bs(n,r==="description"?"":" "):JSON.stringify(n)},BooleanValue:function(e){var r=e.value;return r?"true":"false"},NullValue:function(){return"null"},EnumValue:function(e){var r=e.value;return r},ListValue:function(e){var r=e.values;return"["+P(r,", ")+"]"},ObjectValue:function(e){var r=e.fields;return"{"+P(r,", ")+"}"},ObjectField:function(e){var r=e.name,n=e.value;return r+": "+n},Directive:function(e){var r=e.name,n=e.arguments;return"@"+r+le("(",P(n,", "),")")},NamedType:function(e){var r=e.name;return r},ListType:function(e){var r=e.type;return"["+r+"]"},NonNullType:function(e){var r=e.type;return r+"!"},SchemaDefinition:at(function(t){var e=t.directives,r=t.operationTypes;return P(["schema",P(e," "),ot(r)]," ")}),OperationTypeDefinition:function(e){var r=e.operation,n=e.type;return r+": "+n},ScalarTypeDefinition:at(function(t){var e=t.name,r=t.directives;return P(["scalar",e,P(r," ")]," ")}),ObjectTypeDefinition:at(function(t){var e=t.name,r=t.interfaces,n=t.directives,i=t.fields;return P(["type",e,le("implements ",P(r," & ")),P(n," "),ot(i)]," ")}),FieldDefinition:at(function(t){var e=t.name,r=t.arguments,n=t.type,i=t.directives;return e+(Ss(r)?le(`(
12
- `,oi(P(r,`
11
+ )`)),P([u,P(a," "),o]," ")},Argument:function(e){var r=e.name,n=e.value;return r+": "+n},FragmentSpread:function(e){var r=e.name,n=e.directives;return"..."+r+le(" ",P(n," "))},InlineFragment:function(e){var r=e.typeCondition,n=e.directives,i=e.selectionSet;return P(["...",le("on ",r),P(n," "),i]," ")},FragmentDefinition:function(e){var r=e.name,n=e.typeCondition,i=e.variableDefinitions,a=e.directives,o=e.selectionSet;return"fragment ".concat(r).concat(le("(",P(i,", "),")")," ")+"on ".concat(n," ").concat(le("",P(a," ")," "))+o},IntValue:function(e){var r=e.value;return r},FloatValue:function(e){var r=e.value;return r},StringValue:function(e,r){var n=e.value,i=e.block;return i?_s(n,r==="description"?"":" "):JSON.stringify(n)},BooleanValue:function(e){var r=e.value;return r?"true":"false"},NullValue:function(){return"null"},EnumValue:function(e){var r=e.value;return r},ListValue:function(e){var r=e.values;return"["+P(r,", ")+"]"},ObjectValue:function(e){var r=e.fields;return"{"+P(r,", ")+"}"},ObjectField:function(e){var r=e.name,n=e.value;return r+": "+n},Directive:function(e){var r=e.name,n=e.arguments;return"@"+r+le("(",P(n,", "),")")},NamedType:function(e){var r=e.name;return r},ListType:function(e){var r=e.type;return"["+r+"]"},NonNullType:function(e){var r=e.type;return r+"!"},SchemaDefinition:at(function(t){var e=t.directives,r=t.operationTypes;return P(["schema",P(e," "),ot(r)]," ")}),OperationTypeDefinition:function(e){var r=e.operation,n=e.type;return r+": "+n},ScalarTypeDefinition:at(function(t){var e=t.name,r=t.directives;return P(["scalar",e,P(r," ")]," ")}),ObjectTypeDefinition:at(function(t){var e=t.name,r=t.interfaces,n=t.directives,i=t.fields;return P(["type",e,le("implements ",P(r," & ")),P(n," "),ot(i)]," ")}),FieldDefinition:at(function(t){var e=t.name,r=t.arguments,n=t.type,i=t.directives;return e+(Es(r)?le(`(
12
+ `,ui(P(r,`
13
13
  `)),`
14
- )`):le("(",P(r,", "),")"))+": "+n+le(" ",P(i," "))}),InputValueDefinition:at(function(t){var e=t.name,r=t.type,n=t.defaultValue,i=t.directives;return P([e+": "+r,le("= ",n),P(i," ")]," ")}),InterfaceTypeDefinition:at(function(t){var e=t.name,r=t.interfaces,n=t.directives,i=t.fields;return P(["interface",e,le("implements ",P(r," & ")),P(n," "),ot(i)]," ")}),UnionTypeDefinition:at(function(t){var e=t.name,r=t.directives,n=t.types;return P(["union",e,P(r," "),n&&n.length!==0?"= "+P(n," | "):""]," ")}),EnumTypeDefinition:at(function(t){var e=t.name,r=t.directives,n=t.values;return P(["enum",e,P(r," "),ot(n)]," ")}),EnumValueDefinition:at(function(t){var e=t.name,r=t.directives;return P([e,P(r," ")]," ")}),InputObjectTypeDefinition:at(function(t){var e=t.name,r=t.directives,n=t.fields;return P(["input",e,P(r," "),ot(n)]," ")}),DirectiveDefinition:at(function(t){var e=t.name,r=t.arguments,n=t.repeatable,i=t.locations;return"directive @"+e+(Ss(r)?le(`(
15
- `,oi(P(r,`
14
+ )`):le("(",P(r,", "),")"))+": "+n+le(" ",P(i," "))}),InputValueDefinition:at(function(t){var e=t.name,r=t.type,n=t.defaultValue,i=t.directives;return P([e+": "+r,le("= ",n),P(i," ")]," ")}),InterfaceTypeDefinition:at(function(t){var e=t.name,r=t.interfaces,n=t.directives,i=t.fields;return P(["interface",e,le("implements ",P(r," & ")),P(n," "),ot(i)]," ")}),UnionTypeDefinition:at(function(t){var e=t.name,r=t.directives,n=t.types;return P(["union",e,P(r," "),n&&n.length!==0?"= "+P(n," | "):""]," ")}),EnumTypeDefinition:at(function(t){var e=t.name,r=t.directives,n=t.values;return P(["enum",e,P(r," "),ot(n)]," ")}),EnumValueDefinition:at(function(t){var e=t.name,r=t.directives;return P([e,P(r," ")]," ")}),InputObjectTypeDefinition:at(function(t){var e=t.name,r=t.directives,n=t.fields;return P(["input",e,P(r," "),ot(n)]," ")}),DirectiveDefinition:at(function(t){var e=t.name,r=t.arguments,n=t.repeatable,i=t.locations;return"directive @"+e+(Es(r)?le(`(
15
+ `,ui(P(r,`
16
16
  `)),`
17
17
  )`):le("(",P(r,", "),")"))+(n?" repeatable":"")+" on "+P(i," | ")}),SchemaExtension:function(e){var r=e.directives,n=e.operationTypes;return P(["extend schema",P(r," "),ot(n)]," ")},ScalarTypeExtension:function(e){var r=e.name,n=e.directives;return P(["extend scalar",r,P(n," ")]," ")},ObjectTypeExtension:function(e){var r=e.name,n=e.interfaces,i=e.directives,a=e.fields;return P(["extend type",r,le("implements ",P(n," & ")),P(i," "),ot(a)]," ")},InterfaceTypeExtension:function(e){var r=e.name,n=e.interfaces,i=e.directives,a=e.fields;return P(["extend interface",r,le("implements ",P(n," & ")),P(i," "),ot(a)]," ")},UnionTypeExtension:function(e){var r=e.name,n=e.directives,i=e.types;return P(["extend union",r,P(n," "),i&&i.length!==0?"= "+P(i," | "):""]," ")},EnumTypeExtension:function(e){var r=e.name,n=e.directives,i=e.values;return P(["extend enum",r,P(n," "),ot(i)]," ")},InputObjectTypeExtension:function(e){var r=e.name,n=e.directives,i=e.fields;return P(["extend input",r,P(n," "),ot(i)]," ")}};function at(t){return function(e){return P([e.description,t(e)],`
18
18
  `)}}function P(t){var e,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return(e=t?.filter(function(n){return n}).join(r))!==null&&e!==void 0?e:""}function ot(t){return le(`{
19
- `,oi(P(t,`
19
+ `,ui(P(t,`
20
20
  `)),`
21
- }`)}function le(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";return e!=null&&e!==""?t+e+r:""}function oi(t){return le(" ",t.replace(/\n/g,`
22
- `))}function al(t){return t.indexOf(`
23
- `)!==-1}function Ss(t){return t!=null&&t.some(al)}function pn(t){return t.kind===ge.FIELD||t.kind===ge.FRAGMENT_SPREAD||t.kind===ge.INLINE_FRAGMENT}function ws(){return typeof ai=="function"?Oa():Oa()}function ml(){__DEV__?I(typeof Zt=="boolean",Zt):I(typeof Zt=="boolean",39)}ws();ml();function Et(t,e){var r=t.directives;return!r||!r.length?!0:_s(r).every(function(n){var i=n.directive,a=n.ifArgument,o=!1;return a.value.kind==="Variable"?(o=e&&e[a.value.name.value],__DEV__?I(o!==void 0,"Invalid variable referenced in @".concat(i.name.value," directive.")):I(o!==void 0,40)):o=a.value.value,i.name.value==="skip"?!o:o})}function Nr(t,e,r){var n=new Set(t),i=n.size;return Ne(e,{Directive:function(a){if(n.delete(a.name.value)&&(!r||!n.size))return er}}),r?!n.size:n.size<i}function ka(t){return t&&Nr(["client","export"],t,!0)}function yl(t){var e=t.name.value;return e==="skip"||e==="include"}function _s(t){var e=[];return t&&t.length&&t.forEach(function(r){if(!!yl(r)){var n=r.arguments,i=r.name.value;__DEV__?I(n&&n.length===1,"Incorrect number of arguments for the @".concat(i," directive.")):I(n&&n.length===1,41);var a=n[0];__DEV__?I(a.name&&a.name.value==="if","Invalid argument for the @".concat(i," directive.")):I(a.name&&a.name.value==="if",42);var o=a.value;__DEV__?I(o&&(o.kind==="Variable"||o.kind==="BooleanValue"),"Argument for the @".concat(i," directive must be a variable or a boolean value.")):I(o&&(o.kind==="Variable"||o.kind==="BooleanValue"),43),e.push({directive:r,ifArgument:a})}}),e}function Aa(t,e){var r=e,n=[];t.definitions.forEach(function(a){if(a.kind==="OperationDefinition")throw __DEV__?new $("Found a ".concat(a.operation," operation").concat(a.name?" named '".concat(a.name.value,"'"):"",". ")+"No operations are allowed when using a fragment as a query. Only fragments are allowed."):new $(44);a.kind==="FragmentDefinition"&&n.push(a)}),typeof r>"u"&&(__DEV__?I(n.length===1,"Found ".concat(n.length," fragments. `fragmentName` must be provided when there is not exactly 1 fragment.")):I(n.length===1,45),r=n[0].name.value);var i=m(m({},t),{definitions:Ct([{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:r}}]}}],t.definitions,!0)});return i}function tr(t){t===void 0&&(t=[]);var e={};return t.forEach(function(r){e[r.name.value]=r}),e}function rr(t,e){switch(t.kind){case"InlineFragment":return t;case"FragmentSpread":{var r=t.name.value;if(typeof e=="function")return e(r);var n=e&&e[r];return __DEV__?I(n,"No fragment named ".concat(r)):I(n,46),n||null}default:return null}}function K(t){return t!==null&&typeof t=="object"}function mt(t){return{__ref:String(t)}}function Q(t){return Boolean(t&&typeof t=="object"&&typeof t.__ref=="string")}function Na(t){return K(t)&&t.kind==="Document"&&Array.isArray(t.definitions)}function vl(t){return t.kind==="StringValue"}function gl(t){return t.kind==="BooleanValue"}function bl(t){return t.kind==="IntValue"}function Sl(t){return t.kind==="FloatValue"}function wl(t){return t.kind==="Variable"}function _l(t){return t.kind==="ObjectValue"}function El(t){return t.kind==="ListValue"}function xl(t){return t.kind==="EnumValue"}function Ol(t){return t.kind==="NullValue"}function Lt(t,e,r,n){if(bl(r)||Sl(r))t[e.value]=Number(r.value);else if(gl(r)||vl(r))t[e.value]=r.value;else if(_l(r)){var i={};r.fields.map(function(o){return Lt(i,o.name,o.value,n)}),t[e.value]=i}else if(wl(r)){var a=(n||{})[r.name.value];t[e.value]=a}else if(El(r))t[e.value]=r.values.map(function(o){var s={};return Lt(s,e,o,n),s[e.value]});else if(xl(r))t[e.value]=r.value;else if(Ol(r))t[e.value]=null;else throw __DEV__?new $('The inline argument "'.concat(e.value,'" of kind "').concat(r.kind,'"')+"is not supported. Use variables instead of inline arguments to overcome this limitation."):new $(55)}function Pa(t,e){var r=null;t.directives&&(r={},t.directives.forEach(function(i){r[i.name.value]={},i.arguments&&i.arguments.forEach(function(a){var o=a.name,s=a.value;return Lt(r[i.name.value],o,s,e)})}));var n=null;return t.arguments&&t.arguments.length&&(n={},t.arguments.forEach(function(i){var a=i.name,o=i.value;return Lt(n,a,o,e)})),hn(t.name.value,n,r)}var Tl=["connection","include","skip","client","rest","export"],hn=Object.assign(function(t,e,r){if(e&&r&&r.connection&&r.connection.key)if(r.connection.filter&&r.connection.filter.length>0){var n=r.connection.filter?r.connection.filter:[];n.sort();var i={};return n.forEach(function(s){i[s]=e[s]}),"".concat(r.connection.key,"(").concat(dn(i),")")}else return r.connection.key;var a=t;if(e){var o=dn(e);a+="(".concat(o,")")}return r&&Object.keys(r).forEach(function(s){Tl.indexOf(s)===-1&&(r[s]&&Object.keys(r[s]).length?a+="@".concat(s,"(").concat(dn(r[s]),")"):a+="@".concat(s))}),a},{setStringify:function(t){var e=dn;return dn=t,e}}),dn=function(e){return JSON.stringify(e,Il)};function Il(t,e){return K(e)&&!Array.isArray(e)&&(e=Object.keys(e).sort().reduce(function(r,n){return r[n]=e[n],r},{})),e}function xt(t,e){if(t.arguments&&t.arguments.length){var r={};return t.arguments.forEach(function(n){var i=n.name,a=n.value;return Lt(r,i,a,e)}),r}return null}function Ze(t){return t.alias?t.alias.value:t.name.value}function mn(t,e,r){if(typeof t.__typename=="string")return t.__typename;for(var n=0,i=e.selections;n<i.length;n++){var a=i[n];if(ze(a)){if(a.name.value==="__typename")return t[Ze(a)]}else{var o=mn(t,rr(a,r).selectionSet,r);if(typeof o=="string")return o}}}function ze(t){return t.kind==="Field"}function Ca(t){return t.kind==="InlineFragment"}function Pr(t){__DEV__?I(t&&t.kind==="Document",'Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a "gql" tag? http://docs.apollostack.com/apollo-client/core.html#gql'):I(t&&t.kind==="Document",47);var e=t.definitions.filter(function(r){return r.kind!=="FragmentDefinition"}).map(function(r){if(r.kind!=="OperationDefinition")throw __DEV__?new $('Schema type definitions not allowed in queries. Found: "'.concat(r.kind,'"')):new $(48);return r});return __DEV__?I(e.length<=1,"Ambiguous GraphQL document: contains ".concat(e.length," operations")):I(e.length<=1,49),t}function yt(t){return Pr(t),t.definitions.filter(function(e){return e.kind==="OperationDefinition"})[0]}function Cr(t){return t.definitions.filter(function(e){return e.kind==="OperationDefinition"&&!!e.name}).map(function(e){return e.name.value})[0]||null}function nr(t){return t.definitions.filter(function(e){return e.kind==="FragmentDefinition"})}function yn(t){var e=yt(t);return __DEV__?I(e&&e.operation==="query","Must contain a query definition."):I(e&&e.operation==="query",50),e}function Ra(t){__DEV__?I(t.kind==="Document",'Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a "gql" tag? http://docs.apollostack.com/apollo-client/core.html#gql'):I(t.kind==="Document",51),__DEV__?I(t.definitions.length<=1,"Fragment must have exactly one definition."):I(t.definitions.length<=1,52);var e=t.definitions[0];return __DEV__?I(e.kind==="FragmentDefinition","Must be a fragment definition."):I(e.kind==="FragmentDefinition",53),e}function ir(t){Pr(t);for(var e,r=0,n=t.definitions;r<n.length;r++){var i=n[r];if(i.kind==="OperationDefinition"){var a=i.operation;if(a==="query"||a==="mutation"||a==="subscription")return i}i.kind==="FragmentDefinition"&&!e&&(e=i)}if(e)return e;throw __DEV__?new $("Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment."):new $(54)}function ar(t){var e=Object.create(null),r=t&&t.variableDefinitions;return r&&r.length&&r.forEach(function(n){n.defaultValue&&Lt(e,n.variable.name,n.defaultValue)}),e}var ee=Array.isArray;function we(t){return Array.isArray(t)&&t.length>0}var Es={kind:ge.FIELD,name:{kind:ge.NAME,value:"__typename"}};function Os(t,e){return!t||t.selectionSet.selections.every(function(r){return r.kind===ge.FRAGMENT_SPREAD&&Os(e[r.name.value],e)})}function Dl(t){return Os(yt(t)||Ra(t),tr(nr(t)))?null:t}function kl(t){var e=new Set,r=[];return t.forEach(function(n){n.name?e.add(n.name):n.test&&r.push(n.test)}),function(n){return e.has(n.name.value)||r.some(function(i){return i(n)})}}function xs(t){var e=new Map;return function(n){n===void 0&&(n=t);var i=e.get(n);return i||e.set(n,i={variables:new Set,fragmentSpreads:new Set}),i}}function La(t,e){for(var r=xs(""),n=xs(""),i=function(b){for(var w=0,T=void 0;w<b.length&&(T=b[w]);++w)if(!ee(T)){if(T.kind===ge.OPERATION_DEFINITION)return r(T.name&&T.name.value);if(T.kind===ge.FRAGMENT_DEFINITION)return n(T.name.value)}return __DEV__&&I.error("Could not find operation or fragment"),null},a=0,o=e.definitions.length-1;o>=0;--o)e.definitions[o].kind===ge.OPERATION_DEFINITION&&++a;var s=kl(t),u=t.some(function(b){return b.remove}),l=function(b){return u&&b&&b.some(s)},f=new Map,d=!1,h={enter:function(b){if(l(b.directives))return d=!0,null}},p=Ne(e,{Field:h,InlineFragment:h,VariableDefinition:{enter:function(){return!1}},Variable:{enter:function(b,w,T,A,N){var k=i(N);k&&k.variables.add(b.name.value)}},FragmentSpread:{enter:function(b,w,T,A,N){if(l(b.directives))return d=!0,null;var k=i(N);k&&k.fragmentSpreads.add(b.name.value)}},FragmentDefinition:{enter:function(b,w,T,A){f.set(JSON.stringify(A),b)},leave:function(b,w,T,A){var N=f.get(JSON.stringify(A));if(b===N)return b;if(a>0&&b.selectionSet.selections.every(function(k){return k.kind===ge.FIELD&&k.name.value==="__typename"}))return n(b.name.value).removed=!0,d=!0,null}},Directive:{leave:function(b){if(s(b))return d=!0,null}}});if(!d)return e;var y=function(b){return b.transitiveVars||(b.transitiveVars=new Set(b.variables),b.removed||b.fragmentSpreads.forEach(function(w){y(n(w)).transitiveVars.forEach(function(T){b.transitiveVars.add(T)})})),b},v=new Set;p.definitions.forEach(function(b){b.kind===ge.OPERATION_DEFINITION?y(r(b.name&&b.name.value)).fragmentSpreads.forEach(function(w){v.add(w)}):b.kind===ge.FRAGMENT_DEFINITION&&a===0&&!n(b.name.value).removed&&v.add(b.name.value)}),v.forEach(function(b){y(n(b)).fragmentSpreads.forEach(function(w){v.add(w)})});var S=function(b){return!!(!v.has(b)||n(b).removed)},E={enter:function(b){if(S(b.name.value))return null}};return Dl(Ne(p,{FragmentSpread:E,FragmentDefinition:E,OperationDefinition:{leave:function(b){if(b.variableDefinitions){var w=y(r(b.name&&b.name.value)).transitiveVars;if(w.size<b.variableDefinitions.length)return m(m({},b),{variableDefinitions:b.variableDefinitions.filter(function(T){return w.has(T.variable.name.value)})})}}}}))}var or=Object.assign(function(t){return Ne(t,{SelectionSet:{enter:function(e,r,n){if(!(n&&n.kind===ge.OPERATION_DEFINITION)){var i=e.selections;if(!!i){var a=i.some(function(s){return ze(s)&&(s.name.value==="__typename"||s.name.value.lastIndexOf("__",0)===0)});if(!a){var o=n;if(!(ze(o)&&o.directives&&o.directives.some(function(s){return s.name.value==="export"})))return m(m({},e),{selections:Ct(Ct([],i,!0),[Es],!1)})}}}}}})},{added:function(t){return t===Es}}),Al={test:function(t){var e=t.name.value==="connection";return e&&(!t.arguments||!t.arguments.some(function(r){return r.name.value==="key"}))&&__DEV__&&I.warn("Removing an @connection directive even though it does not have a key. You may want to use the key parameter to specify a store key."),e}};function Fa(t){return La([Al],Pr(t))}function Ma(t){var e=ir(t),r=e.operation;if(r==="query")return t;var n=Ne(t,{OperationDefinition:{enter:function(i){return m(m({},i),{operation:"query"})}}});return n}function ja(t){Pr(t);var e=La([{test:function(r){return r.name.value==="client"},remove:!0}],t);return e}var Nl=Object.prototype.hasOwnProperty;function $a(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return vn(t)}function vn(t){var e=t[0]||{},r=t.length;if(r>1)for(var n=new Ve,i=1;i<r;++i)e=n.merge(e,t[i]);return e}var Pl=function(t,e,r){return this.merge(t[r],e[r])},Ve=function(){function t(e){e===void 0&&(e=Pl),this.reconciler=e,this.isObject=K,this.pastCopies=new Set}return t.prototype.merge=function(e,r){for(var n=this,i=[],a=2;a<arguments.length;a++)i[a-2]=arguments[a];return K(r)&&K(e)?(Object.keys(r).forEach(function(o){if(Nl.call(e,o)){var s=e[o];if(r[o]!==s){var u=n.reconciler.apply(n,Ct([e,r,o],i,!1));u!==s&&(e=n.shallowCopyForMerge(e),e[o]=u)}}else e=n.shallowCopyForMerge(e),e[o]=r[o]}),e):r},t.prototype.shallowCopyForMerge=function(e){return K(e)&&(this.pastCopies.has(e)||(Array.isArray(e)?e=e.slice(0):e=m({__proto__:Object.getPrototypeOf(e)},e),this.pastCopies.add(e))),e},t}();function Cl(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r)return(r=r.call(t)).next.bind(r);if(Array.isArray(t)||(r=Rl(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0;return function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
24
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Rl(t,e){if(!!t){if(typeof t=="string")return Ts(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ts(t,e)}}function Ts(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Is(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Ba(t,e,r){return e&&Is(t.prototype,e),r&&Is(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}var Qa=function(){return typeof Symbol=="function"},Ga=function(t){return Qa()&&Boolean(Symbol[t])},Wa=function(t){return Ga(t)?Symbol[t]:"@@"+t};Qa()&&!Ga("observable")&&(Symbol.observable=Symbol("observable"));var Ll=Wa("iterator"),qa=Wa("observable"),Ds=Wa("species");function ci(t,e){var r=t[e];if(r!=null){if(typeof r!="function")throw new TypeError(r+" is not a function");return r}}function gn(t){var e=t.constructor;return e!==void 0&&(e=e[Ds],e===null&&(e=void 0)),e!==void 0?e:B}function Fl(t){return t instanceof B}function Rr(t){Rr.log?Rr.log(t):setTimeout(function(){throw t})}function si(t){Promise.resolve().then(function(){try{t()}catch(e){Rr(e)}})}function ks(t){var e=t._cleanup;if(e!==void 0&&(t._cleanup=void 0,!!e))try{if(typeof e=="function")e();else{var r=ci(e,"unsubscribe");r&&r.call(e)}}catch(n){Rr(n)}}function Va(t){t._observer=void 0,t._queue=void 0,t._state="closed"}function Ml(t){var e=t._queue;if(!!e){t._queue=void 0,t._state="ready";for(var r=0;r<e.length&&(As(t,e[r].type,e[r].value),t._state!=="closed");++r);}}function As(t,e,r){t._state="running";var n=t._observer;try{var i=ci(n,e);switch(e){case"next":i&&i.call(n,r);break;case"error":if(Va(t),i)i.call(n,r);else throw r;break;case"complete":Va(t),i&&i.call(n);break}}catch(a){Rr(a)}t._state==="closed"?ks(t):t._state==="running"&&(t._state="ready")}function Ua(t,e,r){if(t._state!=="closed"){if(t._state==="buffering"){t._queue.push({type:e,value:r});return}if(t._state!=="ready"){t._state="buffering",t._queue=[{type:e,value:r}],si(function(){return Ml(t)});return}As(t,e,r)}}var jl=function(){function t(r,n){this._cleanup=void 0,this._observer=r,this._queue=void 0,this._state="initializing";var i=new $l(this);try{this._cleanup=n.call(void 0,i)}catch(a){i.error(a)}this._state==="initializing"&&(this._state="ready")}var e=t.prototype;return e.unsubscribe=function(){this._state!=="closed"&&(Va(this),ks(this))},Ba(t,[{key:"closed",get:function(){return this._state==="closed"}}]),t}(),$l=function(){function t(r){this._subscription=r}var e=t.prototype;return e.next=function(n){Ua(this._subscription,"next",n)},e.error=function(n){Ua(this._subscription,"error",n)},e.complete=function(){Ua(this._subscription,"complete")},Ba(t,[{key:"closed",get:function(){return this._subscription._state==="closed"}}]),t}(),B=function(){function t(r){if(!(this instanceof t))throw new TypeError("Observable cannot be called as a function");if(typeof r!="function")throw new TypeError("Observable initializer must be a function");this._subscriber=r}var e=t.prototype;return e.subscribe=function(n){return(typeof n!="object"||n===null)&&(n={next:n,error:arguments[1],complete:arguments[2]}),new jl(n,this._subscriber)},e.forEach=function(n){var i=this;return new Promise(function(a,o){if(typeof n!="function"){o(new TypeError(n+" is not a function"));return}function s(){u.unsubscribe(),a()}var u=i.subscribe({next:function(l){try{n(l,s)}catch(f){o(f),u.unsubscribe()}},error:o,complete:a})})},e.map=function(n){var i=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var a=gn(this);return new a(function(o){return i.subscribe({next:function(s){try{s=n(s)}catch(u){return o.error(u)}o.next(s)},error:function(s){o.error(s)},complete:function(){o.complete()}})})},e.filter=function(n){var i=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var a=gn(this);return new a(function(o){return i.subscribe({next:function(s){try{if(!n(s))return}catch(u){return o.error(u)}o.next(s)},error:function(s){o.error(s)},complete:function(){o.complete()}})})},e.reduce=function(n){var i=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var a=gn(this),o=arguments.length>1,s=!1,u=arguments[1],l=u;return new a(function(f){return i.subscribe({next:function(d){var h=!s;if(s=!0,!h||o)try{l=n(l,d)}catch(p){return f.error(p)}else l=d},error:function(d){f.error(d)},complete:function(){if(!s&&!o)return f.error(new TypeError("Cannot reduce an empty sequence"));f.next(l),f.complete()}})})},e.concat=function(){for(var n=this,i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];var s=gn(this);return new s(function(u){var l,f=0;function d(h){l=h.subscribe({next:function(p){u.next(p)},error:function(p){u.error(p)},complete:function(){f===a.length?(l=void 0,u.complete()):d(s.from(a[f++]))}})}return d(n),function(){l&&(l.unsubscribe(),l=void 0)}})},e.flatMap=function(n){var i=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var a=gn(this);return new a(function(o){var s=[],u=i.subscribe({next:function(f){if(n)try{f=n(f)}catch(h){return o.error(h)}var d=a.from(f).subscribe({next:function(h){o.next(h)},error:function(h){o.error(h)},complete:function(){var h=s.indexOf(d);h>=0&&s.splice(h,1),l()}});s.push(d)},error:function(f){o.error(f)},complete:function(){l()}});function l(){u.closed&&s.length===0&&o.complete()}return function(){s.forEach(function(f){return f.unsubscribe()}),u.unsubscribe()}})},e[qa]=function(){return this},t.from=function(n){var i=typeof this=="function"?this:t;if(n==null)throw new TypeError(n+" is not an object");var a=ci(n,qa);if(a){var o=a.call(n);if(Object(o)!==o)throw new TypeError(o+" is not an object");return Fl(o)&&o.constructor===i?o:new i(function(s){return o.subscribe(s)})}if(Ga("iterator")&&(a=ci(n,Ll),a))return new i(function(s){si(function(){if(!s.closed){for(var u=Cl(a.call(n)),l;!(l=u()).done;){var f=l.value;if(s.next(f),s.closed)return}s.complete()}})});if(Array.isArray(n))return new i(function(s){si(function(){if(!s.closed){for(var u=0;u<n.length;++u)if(s.next(n[u]),s.closed)return;s.complete()}})});throw new TypeError(n+" is not observable")},t.of=function(){for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];var o=typeof this=="function"?this:t;return new o(function(s){si(function(){if(!s.closed){for(var u=0;u<i.length;++u)if(s.next(i[u]),s.closed)return;s.complete()}})})},Ba(t,null,[{key:Ds,get:function(){return this}}]),t}();Qa()&&Object.defineProperty(B,Symbol("extensions"),{value:{symbol:qa,hostReportError:Rr},configurable:!0});function Ka(t){var e,r=t.Symbol;if(typeof r=="function")if(r.observable)e=r.observable;else{typeof r.for=="function"?e=r.for("https://github.com/benlesh/symbol-observable"):e=r("https://github.com/benlesh/symbol-observable");try{r.observable=e}catch{}}else e="@@observable";return e}var Lr;typeof self<"u"?Lr=self:typeof window<"u"?Lr=window:typeof global<"u"?Lr=global:typeof module<"u"?Lr=module:Lr=Function("return this")();var Lh=Ka(Lr);var Ns=B.prototype,Ps="@@observable";Ns[Ps]||(Ns[Ps]=function(){return this});var Ul=Object.prototype.toString;function ui(t){return za(t)}function za(t,e){switch(Ul.call(t)){case"[object Array]":{if(e=e||new Map,e.has(t))return e.get(t);var r=t.slice(0);return e.set(t,r),r.forEach(function(i,a){r[a]=za(i,e)}),r}case"[object Object]":{if(e=e||new Map,e.has(t))return e.get(t);var n=Object.create(Object.getPrototypeOf(t));return e.set(t,n),Object.keys(t).forEach(function(i){n[i]=za(t[i],e)}),n}default:return t}}function ql(t){var e=new Set([t]);return e.forEach(function(r){K(r)&&Vl(r)===r&&Object.getOwnPropertyNames(r).forEach(function(n){K(r[n])&&e.add(r[n])})}),t}function Vl(t){if(__DEV__&&!Object.isFrozen(t))try{Object.freeze(t)}catch(e){if(e instanceof TypeError)return null;throw e}return t}function bn(t){return __DEV__&&ql(t),t}function sr(t,e,r){var n=[];t.forEach(function(i){return i[e]&&n.push(i)}),n.forEach(function(i){return i[e](r)})}function li(t,e,r){return new B(function(n){var i=n.next,a=n.error,o=n.complete,s=0,u=!1,l={then:function(p){return new Promise(function(y){return y(p())})}};function f(p,y){return p?function(v){++s;var S=function(){return p(v)};l=l.then(S,S).then(function(E){--s,i&&i.call(n,E),u&&d.complete()},function(E){throw--s,E}).catch(function(E){a&&a.call(n,E)})}:function(v){return y&&y.call(n,v)}}var d={next:f(e,i),error:f(r,a),complete:function(){u=!0,s||o&&o.call(n)}},h=t.subscribe(d);return function(){return h.unsubscribe()}})}var et=typeof WeakMap=="function"&&Ee(function(){return navigator.product})!=="ReactNative",Cs=typeof WeakSet=="function",Ja=typeof Symbol=="function"&&typeof Symbol.for=="function",Ft=Ja&&Symbol.asyncIterator,zh=typeof Ee(function(){return window.document.createElement})=="function",Jh=Ee(function(){return navigator.userAgent.indexOf("jsdom")>=0})||!1;function fi(t){function e(r){Object.defineProperty(t,r,{value:B})}return Ja&&Symbol.species&&e(Symbol.species),e("@@species"),t}function Rs(t){return t&&typeof t.then=="function"}var Fr=function(t){de(e,t);function e(r){var n=t.call(this,function(i){return n.addObserver(i),function(){return n.removeObserver(i)}})||this;return n.observers=new Set,n.promise=new Promise(function(i,a){n.resolve=i,n.reject=a}),n.handlers={next:function(i){n.sub!==null&&(n.latest=["next",i],n.notify("next",i),sr(n.observers,"next",i))},error:function(i){var a=n.sub;a!==null&&(a&&setTimeout(function(){return a.unsubscribe()}),n.sub=null,n.latest=["error",i],n.reject(i),n.notify("error",i),sr(n.observers,"error",i))},complete:function(){var i=n,a=i.sub,o=i.sources,s=o===void 0?[]:o;if(a!==null){var u=s.shift();u?Rs(u)?u.then(function(l){return n.sub=l.subscribe(n.handlers)}):n.sub=u.subscribe(n.handlers):(a&&setTimeout(function(){return a.unsubscribe()}),n.sub=null,n.latest&&n.latest[0]==="next"?n.resolve(n.latest[1]):n.resolve(),n.notify("complete"),sr(n.observers,"complete"))}}},n.nextResultListeners=new Set,n.cancel=function(i){n.reject(i),n.sources=[],n.handlers.complete()},n.promise.catch(function(i){}),typeof r=="function"&&(r=[new B(r)]),Rs(r)?r.then(function(i){return n.start(i)},n.handlers.error):n.start(r),n}return e.prototype.start=function(r){this.sub===void 0&&(this.sources=Array.from(r),this.handlers.complete())},e.prototype.deliverLastMessage=function(r){if(this.latest){var n=this.latest[0],i=r[n];i&&i.call(r,this.latest[1]),this.sub===null&&n==="next"&&r.complete&&r.complete()}},e.prototype.addObserver=function(r){this.observers.has(r)||(this.deliverLastMessage(r),this.observers.add(r))},e.prototype.removeObserver=function(r){this.observers.delete(r)&&this.observers.size<1&&this.handlers.complete()},e.prototype.notify=function(r,n){var i=this.nextResultListeners;i.size&&(this.nextResultListeners=new Set,i.forEach(function(a){return a(r,n)}))},e.prototype.beforeNext=function(r){var n=!1;this.nextResultListeners.add(function(i,a){n||(n=!0,r(i,a))})},e}(B);fi(Fr);function Mt(t){return"incremental"in t}function Bl(t){return"hasNext"in t&&"data"in t}function Ls(t){return Mt(t)||Bl(t)}function pi(t,e){var r=t,n=new Ve;return Mt(e)&&we(e.incremental)&&e.incremental.forEach(function(i){for(var a=i.data,o=i.path,s=o.length-1;s>=0;--s){var u=o[s],l=!isNaN(+u),f=l?[]:{};f[u]=a,a=f}r=n.merge(r,a)}),r}function Mr(t){var e=di(t);return we(e)}function di(t){var e=we(t.errors)?t.errors.slice(0):[];return Mt(t)&&we(t.incremental)&&t.incremental.forEach(function(r){r.errors&&e.push.apply(e,r.errors)}),e}function jt(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=Object.create(null);return t.forEach(function(n){!n||Object.keys(n).forEach(function(i){var a=n[i];a!==void 0&&(r[i]=a)})}),r}var Fs=new Map;function Sn(t){var e=Fs.get(t)||1;return Fs.set(t,e+1),"".concat(t,":").concat(e,":").concat(Math.random().toString(36).slice(2))}function Ms(t){var e=Sn("stringifyForDisplay");return JSON.stringify(t,function(r,n){return n===void 0?e:n}).split(JSON.stringify(e)).join("<undefined>")}function wn(t,e){return jt(t,e,e.variables&&{variables:m(m({},t&&t.variables),e.variables)})}function hi(t){return new B(function(e){e.error(t)})}var _n=function(t,e,r){var n=new Error(r);throw n.name="ServerError",n.response=t,n.statusCode=t.status,n.result=e,n};function Ha(t){for(var e=["query","operationName","variables","extensions","context"],r=0,n=Object.keys(t);r<n.length;r++){var i=n[r];if(e.indexOf(i)<0)throw __DEV__?new $("illegal argument: ".concat(i)):new $(27)}return t}function Ya(t,e){var r=m({},t),n=function(a){typeof a=="function"?r=m(m({},r),a(r)):r=m(m({},r),a)},i=function(){return m({},r)};return Object.defineProperty(e,"setContext",{enumerable:!1,value:n}),Object.defineProperty(e,"getContext",{enumerable:!1,value:i}),e}function Xa(t){var e={variables:t.variables||{},extensions:t.extensions||{},operationName:t.operationName,query:t.query};return e.operationName||(e.operationName=typeof e.query!="string"?Cr(e.query)||void 0:""),e}function js(t,e){return e?e(t):B.of()}function En(t){return typeof t=="function"?new tt(t):t}function mi(t){return t.request.length<=1}var Ql=function(t){de(e,t);function e(r,n){var i=t.call(this,r)||this;return i.link=n,i}return e}(Error),tt=function(){function t(e){e&&(this.request=e)}return t.empty=function(){return new t(function(){return B.of()})},t.from=function(e){return e.length===0?t.empty():e.map(En).reduce(function(r,n){return r.concat(n)})},t.split=function(e,r,n){var i=En(r),a=En(n||new t(js));return mi(i)&&mi(a)?new t(function(o){return e(o)?i.request(o)||B.of():a.request(o)||B.of()}):new t(function(o,s){return e(o)?i.request(o,s)||B.of():a.request(o,s)||B.of()})},t.execute=function(e,r){return e.request(Ya(r.context,Xa(Ha(r))))||B.of()},t.concat=function(e,r){var n=En(e);if(mi(n))return __DEV__&&I.warn(new Ql("You are calling concat on a terminating link, which will have no effect",n)),n;var i=En(r);return mi(i)?new t(function(a){return n.request(a,function(o){return i.request(o)||B.of()})||B.of()}):new t(function(a,o){return n.request(a,function(s){return i.request(s,o)||B.of()})||B.of()})},t.prototype.split=function(e,r,n){return this.concat(t.split(e,r,n||new t(js)))},t.prototype.concat=function(e){return t.concat(this,e)},t.prototype.request=function(e,r){throw __DEV__?new $("request is not implemented"):new $(22)},t.prototype.onError=function(e,r){if(r&&r.error)return r.error(e),!1;throw e},t.prototype.setOnError=function(e){return this.onError=e,this},t}();var jr=tt.execute;var $s="3.7.10";function Us(t){return!!t.body}function qs(t){return!!t.getReader}function Vs(t){return!!(Ft&&t[Symbol.asyncIterator])}function Bs(t){return!!t.stream}function Qs(t){return!!t.arrayBuffer}function Gs(t){return!!t.pipe}function Za(t){var e,r=t[Symbol.asyncIterator]();return e={next:function(){return r.next()}},e[Symbol.asyncIterator]=function(){return this},e}function eo(t){var e=null,r=null,n=!1,i=[],a=[];function o(d){if(!r){if(a.length){var h=a.shift();if(Array.isArray(h)&&h[0])return h[0]({value:d,done:!1})}i.push(d)}}function s(d){r=d;var h=a.slice();h.forEach(function(p){p[1](d)}),!e||e()}function u(){n=!0;var d=a.slice();d.forEach(function(h){h[0]({value:void 0,done:!0})}),!e||e()}e=function(){e=null,t.removeListener("data",o),t.removeListener("error",s),t.removeListener("end",u),t.removeListener("finish",u),t.removeListener("close",u)},t.on("data",o),t.on("error",s),t.on("end",u),t.on("finish",u),t.on("close",u);function l(){return new Promise(function(d,h){if(r)return h(r);if(i.length)return d({value:i.shift(),done:!1});if(n)return d({value:void 0,done:!0});a.push([d,h])})}var f={next:function(){return l()}};return Ft&&(f[Symbol.asyncIterator]=function(){return this}),f}function to(t){var e=!1,r={next:function(){return e?Promise.resolve({value:void 0,done:!0}):(e=!0,new Promise(function(n,i){t.then(function(a){n({value:a,done:!1})}).catch(i)}))}};return Ft&&(r[Symbol.asyncIterator]=function(){return this}),r}function yi(t){var e={next:function(){return t.read()}};return Ft&&(e[Symbol.asyncIterator]=function(){return this}),e}function Ws(t){var e=t;if(Us(t)&&(e=t.body),Vs(e))return Za(e);if(qs(e))return yi(e.getReader());if(Bs(e))return yi(e.stream().getReader());if(Qs(e))return to(e.arrayBuffer());if(Gs(e))return eo(e);throw new Error("Unknown body type for responseIterator. Please pass a streamable response.")}var Ks=Object.prototype.hasOwnProperty;function zs(t,e){var r,n,i;return nt(this,void 0,void 0,function(){var a,o,s,u,l,f,d,h,p,y,v,S,E,b,w,T,A,N,k,C;return it(this,function(Z){switch(Z.label){case 0:if(TextDecoder===void 0)throw new Error("TextDecoder must be defined in the environment: please import a polyfill.");a=new TextDecoder("utf-8"),o=(r=t.headers)===null||r===void 0?void 0:r.get("content-type"),s="boundary=",u=o?.includes(s)?o?.substring(o?.indexOf(s)+s.length).replace(/['"]/g,"").replace(/\;(.*)/gm,"").trim():"-",l="--".concat(u),f="",d=Ws(t),h=!0,Z.label=1;case 1:return h?[4,d.next()]:[3,3];case 2:for(p=Z.sent(),y=p.value,v=p.done,S=typeof y=="string"?y:a.decode(y),h=!v,f+=S,E=f.indexOf(l);E>-1;){if(b=void 0,C=[f.slice(0,E),f.slice(E+l.length)],b=C[0],f=C[1],b.trim()){if(w=b.indexOf(`\r
21
+ }`)}function le(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";return e!=null&&e!==""?t+e+r:""}function ui(t){return le(" ",t.replace(/\n/g,`
22
+ `))}function cl(t){return t.indexOf(`
23
+ `)!==-1}function Es(t){return t!=null&&t.some(cl)}function pn(t){return t.kind===ve.FIELD||t.kind===ve.FRAGMENT_SPREAD||t.kind===ve.INLINE_FRAGMENT}function Ts(){return typeof ci=="function"?Da():Da()}function vl(){__DEV__?I(typeof Zt=="boolean",Zt):I(typeof Zt=="boolean",39)}Ts();vl();function Et(t,e){var r=t.directives;return!r||!r.length?!0:Os(r).every(function(n){var i=n.directive,a=n.ifArgument,o=!1;return a.value.kind==="Variable"?(o=e&&e[a.value.name.value],__DEV__?I(o!==void 0,"Invalid variable referenced in @".concat(i.name.value," directive.")):I(o!==void 0,40)):o=a.value.value,i.name.value==="skip"?!o:o})}function Ar(t,e,r){var n=new Set(t),i=n.size;return Ae(e,{Directive:function(a){if(n.delete(a.name.value)&&(!r||!n.size))return er}}),r?!n.size:n.size<i}function Pa(t){return t&&Ar(["client","export"],t,!0)}function bl(t){var e=t.name.value;return e==="skip"||e==="include"}function Os(t){var e=[];return t&&t.length&&t.forEach(function(r){if(!!bl(r)){var n=r.arguments,i=r.name.value;__DEV__?I(n&&n.length===1,"Incorrect number of arguments for the @".concat(i," directive.")):I(n&&n.length===1,41);var a=n[0];__DEV__?I(a.name&&a.name.value==="if","Invalid argument for the @".concat(i," directive.")):I(a.name&&a.name.value==="if",42);var o=a.value;__DEV__?I(o&&(o.kind==="Variable"||o.kind==="BooleanValue"),"Argument for the @".concat(i," directive must be a variable or a boolean value.")):I(o&&(o.kind==="Variable"||o.kind==="BooleanValue"),43),e.push({directive:r,ifArgument:a})}}),e}function Ca(t,e){var r=e,n=[];t.definitions.forEach(function(a){if(a.kind==="OperationDefinition")throw __DEV__?new $("Found a ".concat(a.operation," operation").concat(a.name?" named '".concat(a.name.value,"'"):"",". ")+"No operations are allowed when using a fragment as a query. Only fragments are allowed."):new $(44);a.kind==="FragmentDefinition"&&n.push(a)}),typeof r>"u"&&(__DEV__?I(n.length===1,"Found ".concat(n.length," fragments. `fragmentName` must be provided when there is not exactly 1 fragment.")):I(n.length===1,45),r=n[0].name.value);var i=m(m({},t),{definitions:Ct([{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:r}}]}}],t.definitions,!0)});return i}function tr(t){t===void 0&&(t=[]);var e={};return t.forEach(function(r){e[r.name.value]=r}),e}function rr(t,e){switch(t.kind){case"InlineFragment":return t;case"FragmentSpread":{var r=t.name.value;if(typeof e=="function")return e(r);var n=e&&e[r];return __DEV__?I(n,"No fragment named ".concat(r)):I(n,46),n||null}default:return null}}function z(t){return t!==null&&typeof t=="object"}function mt(t){return{__ref:String(t)}}function G(t){return Boolean(t&&typeof t=="object"&&typeof t.__ref=="string")}function Ra(t){return z(t)&&t.kind==="Document"&&Array.isArray(t.definitions)}function Sl(t){return t.kind==="StringValue"}function wl(t){return t.kind==="BooleanValue"}function _l(t){return t.kind==="IntValue"}function El(t){return t.kind==="FloatValue"}function Tl(t){return t.kind==="Variable"}function Ol(t){return t.kind==="ObjectValue"}function xl(t){return t.kind==="ListValue"}function Il(t){return t.kind==="EnumValue"}function Dl(t){return t.kind==="NullValue"}function Lt(t,e,r,n){if(_l(r)||El(r))t[e.value]=Number(r.value);else if(wl(r)||Sl(r))t[e.value]=r.value;else if(Ol(r)){var i={};r.fields.map(function(o){return Lt(i,o.name,o.value,n)}),t[e.value]=i}else if(Tl(r)){var a=(n||{})[r.name.value];t[e.value]=a}else if(xl(r))t[e.value]=r.values.map(function(o){var s={};return Lt(s,e,o,n),s[e.value]});else if(Il(r))t[e.value]=r.value;else if(Dl(r))t[e.value]=null;else throw __DEV__?new $('The inline argument "'.concat(e.value,'" of kind "').concat(r.kind,'"')+"is not supported. Use variables instead of inline arguments to overcome this limitation."):new $(55)}function La(t,e){var r=null;t.directives&&(r={},t.directives.forEach(function(i){r[i.name.value]={},i.arguments&&i.arguments.forEach(function(a){var o=a.name,s=a.value;return Lt(r[i.name.value],o,s,e)})}));var n=null;return t.arguments&&t.arguments.length&&(n={},t.arguments.forEach(function(i){var a=i.name,o=i.value;return Lt(n,a,o,e)})),hn(t.name.value,n,r)}var kl=["connection","include","skip","client","rest","export"],hn=Object.assign(function(t,e,r){if(e&&r&&r.connection&&r.connection.key)if(r.connection.filter&&r.connection.filter.length>0){var n=r.connection.filter?r.connection.filter:[];n.sort();var i={};return n.forEach(function(s){i[s]=e[s]}),"".concat(r.connection.key,"(").concat(dn(i),")")}else return r.connection.key;var a=t;if(e){var o=dn(e);a+="(".concat(o,")")}return r&&Object.keys(r).forEach(function(s){kl.indexOf(s)===-1&&(r[s]&&Object.keys(r[s]).length?a+="@".concat(s,"(").concat(dn(r[s]),")"):a+="@".concat(s))}),a},{setStringify:function(t){var e=dn;return dn=t,e}}),dn=function(e){return JSON.stringify(e,Nl)};function Nl(t,e){return z(e)&&!Array.isArray(e)&&(e=Object.keys(e).sort().reduce(function(r,n){return r[n]=e[n],r},{})),e}function Tt(t,e){if(t.arguments&&t.arguments.length){var r={};return t.arguments.forEach(function(n){var i=n.name,a=n.value;return Lt(r,i,a,e)}),r}return null}function Ze(t){return t.alias?t.alias.value:t.name.value}function mn(t,e,r){if(typeof t.__typename=="string")return t.__typename;for(var n=0,i=e.selections;n<i.length;n++){var a=i[n];if(ze(a)){if(a.name.value==="__typename")return t[Ze(a)]}else{var o=mn(t,rr(a,r).selectionSet,r);if(typeof o=="string")return o}}}function ze(t){return t.kind==="Field"}function Fa(t){return t.kind==="InlineFragment"}function Pr(t){__DEV__?I(t&&t.kind==="Document",'Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a "gql" tag? http://docs.apollostack.com/apollo-client/core.html#gql'):I(t&&t.kind==="Document",47);var e=t.definitions.filter(function(r){return r.kind!=="FragmentDefinition"}).map(function(r){if(r.kind!=="OperationDefinition")throw __DEV__?new $('Schema type definitions not allowed in queries. Found: "'.concat(r.kind,'"')):new $(48);return r});return __DEV__?I(e.length<=1,"Ambiguous GraphQL document: contains ".concat(e.length," operations")):I(e.length<=1,49),t}function yt(t){return Pr(t),t.definitions.filter(function(e){return e.kind==="OperationDefinition"})[0]}function Cr(t){return t.definitions.filter(function(e){return e.kind==="OperationDefinition"&&!!e.name}).map(function(e){return e.name.value})[0]||null}function nr(t){return t.definitions.filter(function(e){return e.kind==="FragmentDefinition"})}function yn(t){var e=yt(t);return __DEV__?I(e&&e.operation==="query","Must contain a query definition."):I(e&&e.operation==="query",50),e}function Ma(t){__DEV__?I(t.kind==="Document",'Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a "gql" tag? http://docs.apollostack.com/apollo-client/core.html#gql'):I(t.kind==="Document",51),__DEV__?I(t.definitions.length<=1,"Fragment must have exactly one definition."):I(t.definitions.length<=1,52);var e=t.definitions[0];return __DEV__?I(e.kind==="FragmentDefinition","Must be a fragment definition."):I(e.kind==="FragmentDefinition",53),e}function ir(t){Pr(t);for(var e,r=0,n=t.definitions;r<n.length;r++){var i=n[r];if(i.kind==="OperationDefinition"){var a=i.operation;if(a==="query"||a==="mutation"||a==="subscription")return i}i.kind==="FragmentDefinition"&&!e&&(e=i)}if(e)return e;throw __DEV__?new $("Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment."):new $(54)}function ar(t){var e=Object.create(null),r=t&&t.variableDefinitions;return r&&r.length&&r.forEach(function(n){n.defaultValue&&Lt(e,n.variable.name,n.defaultValue)}),e}var re=Array.isArray;function we(t){return Array.isArray(t)&&t.length>0}var xs={kind:ve.FIELD,name:{kind:ve.NAME,value:"__typename"}};function Ds(t,e){return!t||t.selectionSet.selections.every(function(r){return r.kind===ve.FRAGMENT_SPREAD&&Ds(e[r.name.value],e)})}function Al(t){return Ds(yt(t)||Ma(t),tr(nr(t)))?null:t}function Pl(t){var e=new Set,r=[];return t.forEach(function(n){n.name?e.add(n.name):n.test&&r.push(n.test)}),function(n){return e.has(n.name.value)||r.some(function(i){return i(n)})}}function Is(t){var e=new Map;return function(n){n===void 0&&(n=t);var i=e.get(n);return i||e.set(n,i={variables:new Set,fragmentSpreads:new Set}),i}}function ja(t,e){for(var r=Is(""),n=Is(""),i=function(b){for(var w=0,O=void 0;w<b.length&&(O=b[w]);++w)if(!re(O)){if(O.kind===ve.OPERATION_DEFINITION)return r(O.name&&O.name.value);if(O.kind===ve.FRAGMENT_DEFINITION)return n(O.name.value)}return __DEV__&&I.error("Could not find operation or fragment"),null},a=0,o=e.definitions.length-1;o>=0;--o)e.definitions[o].kind===ve.OPERATION_DEFINITION&&++a;var s=Pl(t),u=t.some(function(b){return b.remove}),l=function(b){return u&&b&&b.some(s)},f=new Map,d=!1,h={enter:function(b){if(l(b.directives))return d=!0,null}},p=Ae(e,{Field:h,InlineFragment:h,VariableDefinition:{enter:function(){return!1}},Variable:{enter:function(b,w,O,N,A){var k=i(A);k&&k.variables.add(b.name.value)}},FragmentSpread:{enter:function(b,w,O,N,A){if(l(b.directives))return d=!0,null;var k=i(A);k&&k.fragmentSpreads.add(b.name.value)}},FragmentDefinition:{enter:function(b,w,O,N){f.set(JSON.stringify(N),b)},leave:function(b,w,O,N){var A=f.get(JSON.stringify(N));if(b===A)return b;if(a>0&&b.selectionSet.selections.every(function(k){return k.kind===ve.FIELD&&k.name.value==="__typename"}))return n(b.name.value).removed=!0,d=!0,null}},Directive:{leave:function(b){if(s(b))return d=!0,null}}});if(!d)return e;var y=function(b){return b.transitiveVars||(b.transitiveVars=new Set(b.variables),b.removed||b.fragmentSpreads.forEach(function(w){y(n(w)).transitiveVars.forEach(function(O){b.transitiveVars.add(O)})})),b},g=new Set;p.definitions.forEach(function(b){b.kind===ve.OPERATION_DEFINITION?y(r(b.name&&b.name.value)).fragmentSpreads.forEach(function(w){g.add(w)}):b.kind===ve.FRAGMENT_DEFINITION&&a===0&&!n(b.name.value).removed&&g.add(b.name.value)}),g.forEach(function(b){y(n(b)).fragmentSpreads.forEach(function(w){g.add(w)})});var S=function(b){return!!(!g.has(b)||n(b).removed)},T={enter:function(b){if(S(b.name.value))return null}};return Al(Ae(p,{FragmentSpread:T,FragmentDefinition:T,OperationDefinition:{leave:function(b){if(b.variableDefinitions){var w=y(r(b.name&&b.name.value)).transitiveVars;if(w.size<b.variableDefinitions.length)return m(m({},b),{variableDefinitions:b.variableDefinitions.filter(function(O){return w.has(O.variable.name.value)})})}}}}))}var or=Object.assign(function(t){return Ae(t,{SelectionSet:{enter:function(e,r,n){if(!(n&&n.kind===ve.OPERATION_DEFINITION)){var i=e.selections;if(!!i){var a=i.some(function(s){return ze(s)&&(s.name.value==="__typename"||s.name.value.lastIndexOf("__",0)===0)});if(!a){var o=n;if(!(ze(o)&&o.directives&&o.directives.some(function(s){return s.name.value==="export"})))return m(m({},e),{selections:Ct(Ct([],i,!0),[xs],!1)})}}}}}})},{added:function(t){return t===xs}}),Cl={test:function(t){var e=t.name.value==="connection";return e&&(!t.arguments||!t.arguments.some(function(r){return r.name.value==="key"}))&&__DEV__&&I.warn("Removing an @connection directive even though it does not have a key. You may want to use the key parameter to specify a store key."),e}};function $a(t){return ja([Cl],Pr(t))}function Ua(t){var e=ir(t),r=e.operation;if(r==="query")return t;var n=Ae(t,{OperationDefinition:{enter:function(i){return m(m({},i),{operation:"query"})}}});return n}function qa(t){Pr(t);var e=ja([{test:function(r){return r.name.value==="client"},remove:!0}],t);return e}var Rl=Object.prototype.hasOwnProperty;function Va(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return gn(t)}function gn(t){var e=t[0]||{},r=t.length;if(r>1)for(var n=new Ve,i=1;i<r;++i)e=n.merge(e,t[i]);return e}var Ll=function(t,e,r){return this.merge(t[r],e[r])},Ve=function(){function t(e){e===void 0&&(e=Ll),this.reconciler=e,this.isObject=z,this.pastCopies=new Set}return t.prototype.merge=function(e,r){for(var n=this,i=[],a=2;a<arguments.length;a++)i[a-2]=arguments[a];return z(r)&&z(e)?(Object.keys(r).forEach(function(o){if(Rl.call(e,o)){var s=e[o];if(r[o]!==s){var u=n.reconciler.apply(n,Ct([e,r,o],i,!1));u!==s&&(e=n.shallowCopyForMerge(e),e[o]=u)}}else e=n.shallowCopyForMerge(e),e[o]=r[o]}),e):r},t.prototype.shallowCopyForMerge=function(e){return z(e)&&(this.pastCopies.has(e)||(Array.isArray(e)?e=e.slice(0):e=m({__proto__:Object.getPrototypeOf(e)},e),this.pastCopies.add(e))),e},t}();function Fl(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r)return(r=r.call(t)).next.bind(r);if(Array.isArray(t)||(r=Ml(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0;return function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
24
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ml(t,e){if(!!t){if(typeof t=="string")return ks(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ks(t,e)}}function ks(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Ns(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Wa(t,e,r){return e&&Ns(t.prototype,e),r&&Ns(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}var Ka=function(){return typeof Symbol=="function"},za=function(t){return Ka()&&Boolean(Symbol[t])},Ja=function(t){return za(t)?Symbol[t]:"@@"+t};Ka()&&!za("observable")&&(Symbol.observable=Symbol("observable"));var jl=Ja("iterator"),Qa=Ja("observable"),As=Ja("species");function fi(t,e){var r=t[e];if(r!=null){if(typeof r!="function")throw new TypeError(r+" is not a function");return r}}function vn(t){var e=t.constructor;return e!==void 0&&(e=e[As],e===null&&(e=void 0)),e!==void 0?e:B}function $l(t){return t instanceof B}function Rr(t){Rr.log?Rr.log(t):setTimeout(function(){throw t})}function li(t){Promise.resolve().then(function(){try{t()}catch(e){Rr(e)}})}function Ps(t){var e=t._cleanup;if(e!==void 0&&(t._cleanup=void 0,!!e))try{if(typeof e=="function")e();else{var r=fi(e,"unsubscribe");r&&r.call(e)}}catch(n){Rr(n)}}function Ga(t){t._observer=void 0,t._queue=void 0,t._state="closed"}function Ul(t){var e=t._queue;if(!!e){t._queue=void 0,t._state="ready";for(var r=0;r<e.length&&(Cs(t,e[r].type,e[r].value),t._state!=="closed");++r);}}function Cs(t,e,r){t._state="running";var n=t._observer;try{var i=fi(n,e);switch(e){case"next":i&&i.call(n,r);break;case"error":if(Ga(t),i)i.call(n,r);else throw r;break;case"complete":Ga(t),i&&i.call(n);break}}catch(a){Rr(a)}t._state==="closed"?Ps(t):t._state==="running"&&(t._state="ready")}function Ba(t,e,r){if(t._state!=="closed"){if(t._state==="buffering"){t._queue.push({type:e,value:r});return}if(t._state!=="ready"){t._state="buffering",t._queue=[{type:e,value:r}],li(function(){return Ul(t)});return}Cs(t,e,r)}}var ql=function(){function t(r,n){this._cleanup=void 0,this._observer=r,this._queue=void 0,this._state="initializing";var i=new Vl(this);try{this._cleanup=n.call(void 0,i)}catch(a){i.error(a)}this._state==="initializing"&&(this._state="ready")}var e=t.prototype;return e.unsubscribe=function(){this._state!=="closed"&&(Ga(this),Ps(this))},Wa(t,[{key:"closed",get:function(){return this._state==="closed"}}]),t}(),Vl=function(){function t(r){this._subscription=r}var e=t.prototype;return e.next=function(n){Ba(this._subscription,"next",n)},e.error=function(n){Ba(this._subscription,"error",n)},e.complete=function(){Ba(this._subscription,"complete")},Wa(t,[{key:"closed",get:function(){return this._subscription._state==="closed"}}]),t}(),B=function(){function t(r){if(!(this instanceof t))throw new TypeError("Observable cannot be called as a function");if(typeof r!="function")throw new TypeError("Observable initializer must be a function");this._subscriber=r}var e=t.prototype;return e.subscribe=function(n){return(typeof n!="object"||n===null)&&(n={next:n,error:arguments[1],complete:arguments[2]}),new ql(n,this._subscriber)},e.forEach=function(n){var i=this;return new Promise(function(a,o){if(typeof n!="function"){o(new TypeError(n+" is not a function"));return}function s(){u.unsubscribe(),a()}var u=i.subscribe({next:function(l){try{n(l,s)}catch(f){o(f),u.unsubscribe()}},error:o,complete:a})})},e.map=function(n){var i=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var a=vn(this);return new a(function(o){return i.subscribe({next:function(s){try{s=n(s)}catch(u){return o.error(u)}o.next(s)},error:function(s){o.error(s)},complete:function(){o.complete()}})})},e.filter=function(n){var i=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var a=vn(this);return new a(function(o){return i.subscribe({next:function(s){try{if(!n(s))return}catch(u){return o.error(u)}o.next(s)},error:function(s){o.error(s)},complete:function(){o.complete()}})})},e.reduce=function(n){var i=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var a=vn(this),o=arguments.length>1,s=!1,u=arguments[1],l=u;return new a(function(f){return i.subscribe({next:function(d){var h=!s;if(s=!0,!h||o)try{l=n(l,d)}catch(p){return f.error(p)}else l=d},error:function(d){f.error(d)},complete:function(){if(!s&&!o)return f.error(new TypeError("Cannot reduce an empty sequence"));f.next(l),f.complete()}})})},e.concat=function(){for(var n=this,i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];var s=vn(this);return new s(function(u){var l,f=0;function d(h){l=h.subscribe({next:function(p){u.next(p)},error:function(p){u.error(p)},complete:function(){f===a.length?(l=void 0,u.complete()):d(s.from(a[f++]))}})}return d(n),function(){l&&(l.unsubscribe(),l=void 0)}})},e.flatMap=function(n){var i=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var a=vn(this);return new a(function(o){var s=[],u=i.subscribe({next:function(f){if(n)try{f=n(f)}catch(h){return o.error(h)}var d=a.from(f).subscribe({next:function(h){o.next(h)},error:function(h){o.error(h)},complete:function(){var h=s.indexOf(d);h>=0&&s.splice(h,1),l()}});s.push(d)},error:function(f){o.error(f)},complete:function(){l()}});function l(){u.closed&&s.length===0&&o.complete()}return function(){s.forEach(function(f){return f.unsubscribe()}),u.unsubscribe()}})},e[Qa]=function(){return this},t.from=function(n){var i=typeof this=="function"?this:t;if(n==null)throw new TypeError(n+" is not an object");var a=fi(n,Qa);if(a){var o=a.call(n);if(Object(o)!==o)throw new TypeError(o+" is not an object");return $l(o)&&o.constructor===i?o:new i(function(s){return o.subscribe(s)})}if(za("iterator")&&(a=fi(n,jl),a))return new i(function(s){li(function(){if(!s.closed){for(var u=Fl(a.call(n)),l;!(l=u()).done;){var f=l.value;if(s.next(f),s.closed)return}s.complete()}})});if(Array.isArray(n))return new i(function(s){li(function(){if(!s.closed){for(var u=0;u<n.length;++u)if(s.next(n[u]),s.closed)return;s.complete()}})});throw new TypeError(n+" is not observable")},t.of=function(){for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];var o=typeof this=="function"?this:t;return new o(function(s){li(function(){if(!s.closed){for(var u=0;u<i.length;++u)if(s.next(i[u]),s.closed)return;s.complete()}})})},Wa(t,null,[{key:As,get:function(){return this}}]),t}();Ka()&&Object.defineProperty(B,Symbol("extensions"),{value:{symbol:Qa,hostReportError:Rr},configurable:!0});function Ha(t){var e,r=t.Symbol;if(typeof r=="function")if(r.observable)e=r.observable;else{typeof r.for=="function"?e=r.for("https://github.com/benlesh/symbol-observable"):e=r("https://github.com/benlesh/symbol-observable");try{r.observable=e}catch{}}else e="@@observable";return e}var Lr;typeof self<"u"?Lr=self:typeof window<"u"?Lr=window:typeof global<"u"?Lr=global:typeof module<"u"?Lr=module:Lr=Function("return this")();var Uh=Ha(Lr);var Rs=B.prototype,Ls="@@observable";Rs[Ls]||(Rs[Ls]=function(){return this});var Bl=Object.prototype.toString;function pi(t){return Ya(t)}function Ya(t,e){switch(Bl.call(t)){case"[object Array]":{if(e=e||new Map,e.has(t))return e.get(t);var r=t.slice(0);return e.set(t,r),r.forEach(function(i,a){r[a]=Ya(i,e)}),r}case"[object Object]":{if(e=e||new Map,e.has(t))return e.get(t);var n=Object.create(Object.getPrototypeOf(t));return e.set(t,n),Object.keys(t).forEach(function(i){n[i]=Ya(t[i],e)}),n}default:return t}}function Ql(t){var e=new Set([t]);return e.forEach(function(r){z(r)&&Gl(r)===r&&Object.getOwnPropertyNames(r).forEach(function(n){z(r[n])&&e.add(r[n])})}),t}function Gl(t){if(__DEV__&&!Object.isFrozen(t))try{Object.freeze(t)}catch(e){if(e instanceof TypeError)return null;throw e}return t}function bn(t){return __DEV__&&Ql(t),t}function sr(t,e,r){var n=[];t.forEach(function(i){return i[e]&&n.push(i)}),n.forEach(function(i){return i[e](r)})}function di(t,e,r){return new B(function(n){var i=n.next,a=n.error,o=n.complete,s=0,u=!1,l={then:function(p){return new Promise(function(y){return y(p())})}};function f(p,y){return p?function(g){++s;var S=function(){return p(g)};l=l.then(S,S).then(function(T){--s,i&&i.call(n,T),u&&d.complete()},function(T){throw--s,T}).catch(function(T){a&&a.call(n,T)})}:function(g){return y&&y.call(n,g)}}var d={next:f(e,i),error:f(r,a),complete:function(){u=!0,s||o&&o.call(n)}},h=t.subscribe(d);return function(){return h.unsubscribe()}})}var et=typeof WeakMap=="function"&&Ee(function(){return navigator.product})!=="ReactNative",Fs=typeof WeakSet=="function",Xa=typeof Symbol=="function"&&typeof Symbol.for=="function",Ft=Xa&&Symbol.asyncIterator,Zh=typeof Ee(function(){return window.document.createElement})=="function",em=Ee(function(){return navigator.userAgent.indexOf("jsdom")>=0})||!1;function hi(t){function e(r){Object.defineProperty(t,r,{value:B})}return Xa&&Symbol.species&&e(Symbol.species),e("@@species"),t}function Ms(t){return t&&typeof t.then=="function"}var Fr=function(t){de(e,t);function e(r){var n=t.call(this,function(i){return n.addObserver(i),function(){return n.removeObserver(i)}})||this;return n.observers=new Set,n.promise=new Promise(function(i,a){n.resolve=i,n.reject=a}),n.handlers={next:function(i){n.sub!==null&&(n.latest=["next",i],n.notify("next",i),sr(n.observers,"next",i))},error:function(i){var a=n.sub;a!==null&&(a&&setTimeout(function(){return a.unsubscribe()}),n.sub=null,n.latest=["error",i],n.reject(i),n.notify("error",i),sr(n.observers,"error",i))},complete:function(){var i=n,a=i.sub,o=i.sources,s=o===void 0?[]:o;if(a!==null){var u=s.shift();u?Ms(u)?u.then(function(l){return n.sub=l.subscribe(n.handlers)}):n.sub=u.subscribe(n.handlers):(a&&setTimeout(function(){return a.unsubscribe()}),n.sub=null,n.latest&&n.latest[0]==="next"?n.resolve(n.latest[1]):n.resolve(),n.notify("complete"),sr(n.observers,"complete"))}}},n.nextResultListeners=new Set,n.cancel=function(i){n.reject(i),n.sources=[],n.handlers.complete()},n.promise.catch(function(i){}),typeof r=="function"&&(r=[new B(r)]),Ms(r)?r.then(function(i){return n.start(i)},n.handlers.error):n.start(r),n}return e.prototype.start=function(r){this.sub===void 0&&(this.sources=Array.from(r),this.handlers.complete())},e.prototype.deliverLastMessage=function(r){if(this.latest){var n=this.latest[0],i=r[n];i&&i.call(r,this.latest[1]),this.sub===null&&n==="next"&&r.complete&&r.complete()}},e.prototype.addObserver=function(r){this.observers.has(r)||(this.deliverLastMessage(r),this.observers.add(r))},e.prototype.removeObserver=function(r){this.observers.delete(r)&&this.observers.size<1&&this.handlers.complete()},e.prototype.notify=function(r,n){var i=this.nextResultListeners;i.size&&(this.nextResultListeners=new Set,i.forEach(function(a){return a(r,n)}))},e.prototype.beforeNext=function(r){var n=!1;this.nextResultListeners.add(function(i,a){n||(n=!0,r(i,a))})},e}(B);hi(Fr);function Mt(t){return"incremental"in t}function Wl(t){return"hasNext"in t&&"data"in t}function js(t){return Mt(t)||Wl(t)}function mi(t,e){var r=t,n=new Ve;return Mt(e)&&we(e.incremental)&&e.incremental.forEach(function(i){for(var a=i.data,o=i.path,s=o.length-1;s>=0;--s){var u=o[s],l=!isNaN(+u),f=l?[]:{};f[u]=a,a=f}r=n.merge(r,a)}),r}function Mr(t){var e=yi(t);return we(e)}function yi(t){var e=we(t.errors)?t.errors.slice(0):[];return Mt(t)&&we(t.incremental)&&t.incremental.forEach(function(r){r.errors&&e.push.apply(e,r.errors)}),e}function jt(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=Object.create(null);return t.forEach(function(n){!n||Object.keys(n).forEach(function(i){var a=n[i];a!==void 0&&(r[i]=a)})}),r}var $s=new Map;function Sn(t){var e=$s.get(t)||1;return $s.set(t,e+1),"".concat(t,":").concat(e,":").concat(Math.random().toString(36).slice(2))}function Us(t){var e=Sn("stringifyForDisplay");return JSON.stringify(t,function(r,n){return n===void 0?e:n}).split(JSON.stringify(e)).join("<undefined>")}function wn(t,e){return jt(t,e,e.variables&&{variables:m(m({},t&&t.variables),e.variables)})}function gi(t){return new B(function(e){e.error(t)})}var _n=function(t,e,r){var n=new Error(r);throw n.name="ServerError",n.response=t,n.statusCode=t.status,n.result=e,n};function Za(t){for(var e=["query","operationName","variables","extensions","context"],r=0,n=Object.keys(t);r<n.length;r++){var i=n[r];if(e.indexOf(i)<0)throw __DEV__?new $("illegal argument: ".concat(i)):new $(27)}return t}function eo(t,e){var r=m({},t),n=function(a){typeof a=="function"?r=m(m({},r),a(r)):r=m(m({},r),a)},i=function(){return m({},r)};return Object.defineProperty(e,"setContext",{enumerable:!1,value:n}),Object.defineProperty(e,"getContext",{enumerable:!1,value:i}),e}function to(t){var e={variables:t.variables||{},extensions:t.extensions||{},operationName:t.operationName,query:t.query};return e.operationName||(e.operationName=typeof e.query!="string"?Cr(e.query)||void 0:""),e}function qs(t,e){return e?e(t):B.of()}function En(t){return typeof t=="function"?new tt(t):t}function vi(t){return t.request.length<=1}var Kl=function(t){de(e,t);function e(r,n){var i=t.call(this,r)||this;return i.link=n,i}return e}(Error),tt=function(){function t(e){e&&(this.request=e)}return t.empty=function(){return new t(function(){return B.of()})},t.from=function(e){return e.length===0?t.empty():e.map(En).reduce(function(r,n){return r.concat(n)})},t.split=function(e,r,n){var i=En(r),a=En(n||new t(qs));return vi(i)&&vi(a)?new t(function(o){return e(o)?i.request(o)||B.of():a.request(o)||B.of()}):new t(function(o,s){return e(o)?i.request(o,s)||B.of():a.request(o,s)||B.of()})},t.execute=function(e,r){return e.request(eo(r.context,to(Za(r))))||B.of()},t.concat=function(e,r){var n=En(e);if(vi(n))return __DEV__&&I.warn(new Kl("You are calling concat on a terminating link, which will have no effect",n)),n;var i=En(r);return vi(i)?new t(function(a){return n.request(a,function(o){return i.request(o)||B.of()})||B.of()}):new t(function(a,o){return n.request(a,function(s){return i.request(s,o)||B.of()})||B.of()})},t.prototype.split=function(e,r,n){return this.concat(t.split(e,r,n||new t(qs)))},t.prototype.concat=function(e){return t.concat(this,e)},t.prototype.request=function(e,r){throw __DEV__?new $("request is not implemented"):new $(22)},t.prototype.onError=function(e,r){if(r&&r.error)return r.error(e),!1;throw e},t.prototype.setOnError=function(e){return this.onError=e,this},t}();var jr=tt.execute;var Vs="3.7.10";function Bs(t){return!!t.body}function Qs(t){return!!t.getReader}function Gs(t){return!!(Ft&&t[Symbol.asyncIterator])}function Ws(t){return!!t.stream}function Ks(t){return!!t.arrayBuffer}function zs(t){return!!t.pipe}function ro(t){var e,r=t[Symbol.asyncIterator]();return e={next:function(){return r.next()}},e[Symbol.asyncIterator]=function(){return this},e}function no(t){var e=null,r=null,n=!1,i=[],a=[];function o(d){if(!r){if(a.length){var h=a.shift();if(Array.isArray(h)&&h[0])return h[0]({value:d,done:!1})}i.push(d)}}function s(d){r=d;var h=a.slice();h.forEach(function(p){p[1](d)}),!e||e()}function u(){n=!0;var d=a.slice();d.forEach(function(h){h[0]({value:void 0,done:!0})}),!e||e()}e=function(){e=null,t.removeListener("data",o),t.removeListener("error",s),t.removeListener("end",u),t.removeListener("finish",u),t.removeListener("close",u)},t.on("data",o),t.on("error",s),t.on("end",u),t.on("finish",u),t.on("close",u);function l(){return new Promise(function(d,h){if(r)return h(r);if(i.length)return d({value:i.shift(),done:!1});if(n)return d({value:void 0,done:!0});a.push([d,h])})}var f={next:function(){return l()}};return Ft&&(f[Symbol.asyncIterator]=function(){return this}),f}function io(t){var e=!1,r={next:function(){return e?Promise.resolve({value:void 0,done:!0}):(e=!0,new Promise(function(n,i){t.then(function(a){n({value:a,done:!1})}).catch(i)}))}};return Ft&&(r[Symbol.asyncIterator]=function(){return this}),r}function bi(t){var e={next:function(){return t.read()}};return Ft&&(e[Symbol.asyncIterator]=function(){return this}),e}function Js(t){var e=t;if(Bs(t)&&(e=t.body),Gs(e))return ro(e);if(Qs(e))return bi(e.getReader());if(Ws(e))return bi(e.stream().getReader());if(Ks(e))return io(e.arrayBuffer());if(zs(e))return no(e);throw new Error("Unknown body type for responseIterator. Please pass a streamable response.")}var Hs=Object.prototype.hasOwnProperty;function Ys(t,e){var r,n,i;return nt(this,void 0,void 0,function(){var a,o,s,u,l,f,d,h,p,y,g,S,T,b,w,O,N,A,k,C;return it(this,function(te){switch(te.label){case 0:if(TextDecoder===void 0)throw new Error("TextDecoder must be defined in the environment: please import a polyfill.");a=new TextDecoder("utf-8"),o=(r=t.headers)===null||r===void 0?void 0:r.get("content-type"),s="boundary=",u=o?.includes(s)?o?.substring(o?.indexOf(s)+s.length).replace(/['"]/g,"").replace(/\;(.*)/gm,"").trim():"-",l="--".concat(u),f="",d=Js(t),h=!0,te.label=1;case 1:return h?[4,d.next()]:[3,3];case 2:for(p=te.sent(),y=p.value,g=p.done,S=typeof y=="string"?y:a.decode(y),h=!g,f+=S,T=f.indexOf(l);T>-1;){if(b=void 0,C=[f.slice(0,T),f.slice(T+l.length)],b=C[0],f=C[1],b.trim()){if(w=b.indexOf(`\r
25
25
  \r
26
- `),T=Gl(b.slice(0,w)),A=T["content-type"],A&&A.toLowerCase().indexOf("application/json")===-1)throw new Error("Unsupported patch content type: application/json is required.");N=b.slice(w);try{k=Js(t,N.replace(`\r
27
- `,"")),(Object.keys(k).length>1||"data"in k||"incremental"in k||"errors"in k)&&((n=e.next)===null||n===void 0||n.call(e,k))}catch(Y){vi(Y,e)}}E=f.indexOf(l)}return[3,1];case 3:return(i=e.complete)===null||i===void 0||i.call(e),[2]}})})}function Gl(t){var e={};return t.split(`
28
- `).forEach(function(r){var n=r.indexOf(":");if(n>-1){var i=r.slice(0,n).trim().toLowerCase(),a=r.slice(n+1).trim();e[i]=a}}),e}function Js(t,e){if(t.status>=300){var r=function(){try{return JSON.parse(e)}catch{return e}};_n(t,r(),"Response not successful: Received status code ".concat(t.status))}try{return JSON.parse(e)}catch(i){var n=i;throw n.name="ServerParseError",n.response=t,n.statusCode=t.status,n.bodyText=e,n}}function vi(t,e){var r,n;t.name!=="AbortError"&&(t.result&&t.result.errors&&t.result.data&&((r=e.next)===null||r===void 0||r.call(e,t.result)),(n=e.error)===null||n===void 0||n.call(e,t))}function Hs(t,e,r){Wl(e)(t).then(function(n){var i,a;(i=r.next)===null||i===void 0||i.call(r,n),(a=r.complete)===null||a===void 0||a.call(r)}).catch(function(n){return vi(n,r)})}function Wl(t){return function(e){return e.text().then(function(r){return Js(e,r)}).then(function(r){return e.status>=300&&_n(e,r,"Response not successful: Received status code ".concat(e.status)),!Array.isArray(r)&&!Ks.call(r,"data")&&!Ks.call(r,"errors")&&_n(e,r,"Server response was missing for query '".concat(Array.isArray(t)?t.map(function(n){return n.operationName}):t.operationName,"'.")),r})}}var xn=function(t,e){var r;try{r=JSON.stringify(t)}catch(i){var n=__DEV__?new $("Network request failed. ".concat(e," is not serializable: ").concat(i.message)):new $(24);throw n.parseError=i,n}return r};var Kl={includeQuery:!0,includeExtensions:!1,preserveHeaderCase:!1},zl={accept:"*/*","content-type":"application/json"},Jl={method:"POST"},Ys={http:Kl,headers:zl,options:Jl},Xs=function(t,e){return e(t)};function Zs(t,e){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var i={},a={};r.forEach(function(d){i=m(m(m({},i),d.options),{headers:m(m({},i.headers),d.headers)}),d.credentials&&(i.credentials=d.credentials),a=m(m({},a),d.http)}),i.headers&&(i.headers=Hl(i.headers,a.preserveHeaderCase));var o=t.operationName,s=t.extensions,u=t.variables,l=t.query,f={operationName:o,variables:u};return a.includeExtensions&&(f.extensions=s),a.includeQuery&&(f.query=e(l,Ar)),{options:i,body:f}}function Hl(t,e){if(!e){var r=Object.create(null);return Object.keys(Object(t)).forEach(function(a){r[a.toLowerCase()]=t[a]}),r}var n=Object.create(null);Object.keys(Object(t)).forEach(function(a){n[a.toLowerCase()]={originalName:a,value:t[a]}});var i=Object.create(null);return Object.keys(n).forEach(function(a){i[n[a].originalName]=n[a].value}),i}var ec=function(t){if(!t&&typeof fetch>"u")throw __DEV__?new $(`
26
+ `),O=zl(b.slice(0,w)),N=O["content-type"],N&&N.toLowerCase().indexOf("application/json")===-1)throw new Error("Unsupported patch content type: application/json is required.");A=b.slice(w);try{k=Xs(t,A.replace(`\r
27
+ `,"")),(Object.keys(k).length>1||"data"in k||"incremental"in k||"errors"in k)&&((n=e.next)===null||n===void 0||n.call(e,k))}catch(Z){Si(Z,e)}}T=f.indexOf(l)}return[3,1];case 3:return(i=e.complete)===null||i===void 0||i.call(e),[2]}})})}function zl(t){var e={};return t.split(`
28
+ `).forEach(function(r){var n=r.indexOf(":");if(n>-1){var i=r.slice(0,n).trim().toLowerCase(),a=r.slice(n+1).trim();e[i]=a}}),e}function Xs(t,e){if(t.status>=300){var r=function(){try{return JSON.parse(e)}catch{return e}};_n(t,r(),"Response not successful: Received status code ".concat(t.status))}try{return JSON.parse(e)}catch(i){var n=i;throw n.name="ServerParseError",n.response=t,n.statusCode=t.status,n.bodyText=e,n}}function Si(t,e){var r,n;t.name!=="AbortError"&&(t.result&&t.result.errors&&t.result.data&&((r=e.next)===null||r===void 0||r.call(e,t.result)),(n=e.error)===null||n===void 0||n.call(e,t))}function Zs(t,e,r){Jl(e)(t).then(function(n){var i,a;(i=r.next)===null||i===void 0||i.call(r,n),(a=r.complete)===null||a===void 0||a.call(r)}).catch(function(n){return Si(n,r)})}function Jl(t){return function(e){return e.text().then(function(r){return Xs(e,r)}).then(function(r){return e.status>=300&&_n(e,r,"Response not successful: Received status code ".concat(e.status)),!Array.isArray(r)&&!Hs.call(r,"data")&&!Hs.call(r,"errors")&&_n(e,r,"Server response was missing for query '".concat(Array.isArray(t)?t.map(function(n){return n.operationName}):t.operationName,"'.")),r})}}var Tn=function(t,e){var r;try{r=JSON.stringify(t)}catch(i){var n=__DEV__?new $("Network request failed. ".concat(e," is not serializable: ").concat(i.message)):new $(24);throw n.parseError=i,n}return r};var Hl={includeQuery:!0,includeExtensions:!1,preserveHeaderCase:!1},Yl={accept:"*/*","content-type":"application/json"},Xl={method:"POST"},ec={http:Hl,headers:Yl,options:Xl},tc=function(t,e){return e(t)};function rc(t,e){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var i={},a={};r.forEach(function(d){i=m(m(m({},i),d.options),{headers:m(m({},i.headers),d.headers)}),d.credentials&&(i.credentials=d.credentials),a=m(m({},a),d.http)}),i.headers&&(i.headers=Zl(i.headers,a.preserveHeaderCase));var o=t.operationName,s=t.extensions,u=t.variables,l=t.query,f={operationName:o,variables:u};return a.includeExtensions&&(f.extensions=s),a.includeQuery&&(f.query=e(l,Nr)),{options:i,body:f}}function Zl(t,e){if(!e){var r=Object.create(null);return Object.keys(Object(t)).forEach(function(a){r[a.toLowerCase()]=t[a]}),r}var n=Object.create(null);Object.keys(Object(t)).forEach(function(a){n[a.toLowerCase()]={originalName:a,value:t[a]}});var i=Object.create(null);return Object.keys(n).forEach(function(a){i[n[a].originalName]=n[a].value}),i}var nc=function(t){if(!t&&typeof fetch>"u")throw __DEV__?new $(`
29
29
  "fetch" has not been found globally and no fetcher has been configured. To fix this, install a fetch package (like https://www.npmjs.com/package/cross-fetch), instantiate the fetcher, and pass it into your HttpLink constructor. For example:
30
30
 
31
31
  import fetch from 'cross-fetch';
@@ -33,7 +33,7 @@ import { ApolloClient, HttpLink } from '@apollo/client';
33
33
  const client = new ApolloClient({
34
34
  link: new HttpLink({ uri: '/graphql', fetch })
35
35
  });
36
- `):new $(23)};var tc=function(){if(typeof AbortController>"u")return{controller:!1,signal:!1};var t=new AbortController,e=t.signal;return{controller:t,signal:e}};var rc=function(t,e){var r=t.getContext(),n=r.uri;return n||(typeof e=="function"?e(t):e||"/graphql")};function nc(t,e){var r=[],n=function(d,h){r.push("".concat(d,"=").concat(encodeURIComponent(h)))};if("query"in e&&n("query",e.query),e.operationName&&n("operationName",e.operationName),e.variables){var i=void 0;try{i=xn(e.variables,"Variables map")}catch(d){return{parseError:d}}n("variables",i)}if(e.extensions){var a=void 0;try{a=xn(e.extensions,"Extensions map")}catch(d){return{parseError:d}}n("extensions",a)}var o="",s=t,u=t.indexOf("#");u!==-1&&(o=t.substr(u),s=t.substr(0,u));var l=s.indexOf("?")===-1?"?":"&",f=s+l+r.join("&")+o;return{newURI:f}}var ic=Ee(function(){return fetch}),ac=function(t){t===void 0&&(t={});var e=t.uri,r=e===void 0?"/graphql":e,n=t.fetch,i=t.print,a=i===void 0?Xs:i,o=t.includeExtensions,s=t.preserveHeaderCase,u=t.useGETForQueries,l=t.includeUnusedVariables,f=l===void 0?!1:l,d=ht(t,["uri","fetch","print","includeExtensions","preserveHeaderCase","useGETForQueries","includeUnusedVariables"]);__DEV__&&ec(n||ic);var h={http:{includeExtensions:o,preserveHeaderCase:s},options:d.fetchOptions,credentials:d.credentials,headers:d.headers};return new tt(function(p){var y=rc(p,r),v=p.getContext(),S={};if(v.clientAwareness){var E=v.clientAwareness,b=E.name,w=E.version;b&&(S["apollographql-client-name"]=b),w&&(S["apollographql-client-version"]=w)}var T=m(m({},S),v.headers),A={http:v.http,options:v.fetchOptions,credentials:v.credentials,headers:T},N=Zs(p,a,Ys,h,A),k=N.options,C=N.body;if(C.variables&&!f){var Z=new Set(Object.keys(C.variables));Ne(p.query,{Variable:function(W,pt,V){V&&V.kind!=="VariableDefinition"&&Z.delete(W.name.value)}}),Z.size&&(C.variables=m({},C.variables),Z.forEach(function(W){delete C.variables[W]}))}var Y;if(!k.signal){var ft=tc(),_t=ft.controller,xe=ft.signal;Y=_t,Y&&(k.signal=xe)}var q=function(W){return W.kind==="OperationDefinition"&&W.operation==="mutation"};if(u&&!p.query.definitions.some(q)&&(k.method="GET"),Nr(["defer"],p.query)&&(k.headers=k.headers||{},k.headers.accept="multipart/mixed; deferSpec=20220824, application/json"),k.method==="GET"){var pe=nc(y,C),ne=pe.newURI,G=pe.parseError;if(G)return hi(G);y=ne}else try{k.body=xn(C,"Payload")}catch(W){return hi(W)}return new B(function(W){var pt=n||Ee(function(){return fetch})||ic;return pt(y,k).then(function(V){var dt;p.setContext({response:V});var Pt=(dt=V.headers)===null||dt===void 0?void 0:dt.get("content-type");return Pt!==null&&/^multipart\/mixed/i.test(Pt)?zs(V,W):Hs(V,p,W)}).catch(function(V){return vi(V,W)}),function(){Y&&Y.abort()}})})};var ro=function(t){de(e,t);function e(r){r===void 0&&(r={});var n=t.call(this,ac(r).request)||this;return n.options=r,n}return e}(tt);var{toString:oc,hasOwnProperty:Yl}=Object.prototype,sc=Function.prototype.toString,no=new Map;function oe(t,e){try{return io(t,e)}finally{no.clear()}}function io(t,e){if(t===e)return!0;let r=oc.call(t),n=oc.call(e);if(r!==n)return!1;switch(r){case"[object Array]":if(t.length!==e.length)return!1;case"[object Object]":{if(uc(t,e))return!0;let i=cc(t),a=cc(e),o=i.length;if(o!==a.length)return!1;for(let s=0;s<o;++s)if(!Yl.call(e,i[s]))return!1;for(let s=0;s<o;++s){let u=i[s];if(!io(t[u],e[u]))return!1}return!0}case"[object Error]":return t.name===e.name&&t.message===e.message;case"[object Number]":if(t!==t)return e!==e;case"[object Boolean]":case"[object Date]":return+t==+e;case"[object RegExp]":case"[object String]":return t==`${e}`;case"[object Map]":case"[object Set]":{if(t.size!==e.size)return!1;if(uc(t,e))return!0;let i=t.entries(),a=r==="[object Map]";for(;;){let o=i.next();if(o.done)break;let[s,u]=o.value;if(!e.has(s)||a&&!io(u,e.get(s)))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]":t=new Uint8Array(t),e=new Uint8Array(e);case"[object DataView]":{let i=t.byteLength;if(i===e.byteLength)for(;i--&&t[i]===e[i];);return i===-1}case"[object AsyncFunction]":case"[object GeneratorFunction]":case"[object AsyncGeneratorFunction]":case"[object Function]":{let i=sc.call(t);return i!==sc.call(e)?!1:!ef(i,Zl)}}return!1}function cc(t){return Object.keys(t).filter(Xl,t)}function Xl(t){return this[t]!==void 0}var Zl="{ [native code] }";function ef(t,e){let r=t.length-e.length;return r>=0&&t.indexOf(e,r)===r}function uc(t,e){let r=no.get(t);if(r){if(r.has(e))return!0}else no.set(t,r=new Set);return r.add(e),!1}var tf=function(){return Object.create(null)},lc=Array.prototype,rf=lc.forEach,nf=lc.slice,vt=function(){function t(e,r){e===void 0&&(e=!0),r===void 0&&(r=tf),this.weakness=e,this.makeData=r}return t.prototype.lookup=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return this.lookupArray(e)},t.prototype.lookupArray=function(e){var r=this;return rf.call(e,function(n){return r=r.getChildTrie(n)}),r.data||(r.data=this.makeData(nf.call(e)))},t.prototype.getChildTrie=function(e){var r=this.weakness&&af(e)?this.weak||(this.weak=new WeakMap):this.strong||(this.strong=new Map),n=r.get(e);return n||r.set(e,n=new t(this.weakness,this.makeData)),n},t}();function af(t){switch(typeof t){case"object":if(t===null)break;case"function":return!0}return!1}var Ie=null,fc={},of=1,sf=()=>class{constructor(){this.id=["slot",of++,Date.now(),Math.random().toString(36).slice(2)].join(":")}hasValue(){for(let e=Ie;e;e=e.parent)if(this.id in e.slots){let r=e.slots[this.id];if(r===fc)break;return e!==Ie&&(Ie.slots[this.id]=r),!0}return Ie&&(Ie.slots[this.id]=fc),!1}getValue(){if(this.hasValue())return Ie.slots[this.id]}withValue(e,r,n,i){let a={__proto__:null,[this.id]:e},o=Ie;Ie={parent:o,slots:a};try{return r.apply(i,n)}finally{Ie=o}}static bind(e){let r=Ie;return function(){let n=Ie;try{return Ie=r,e.apply(this,arguments)}finally{Ie=n}}}static noContext(e,r,n){if(Ie){let i=Ie;try{return Ie=null,e.apply(n,r)}finally{Ie=i}}else return e.apply(n,r)}};function pc(t){try{return t()}catch{}}var ao="@wry/context:Slot",cf=pc(()=>globalThis)||pc(()=>global)||Object.create(null),dc=cf,$r=dc[ao]||Array[ao]||function(t){try{Object.defineProperty(dc,ao,{value:t,enumerable:!1,writable:!1,configurable:!0})}finally{return t}}(sf());var{bind:uf,noContext:lf}=$r;function ff(){}var pf=function(){function t(e,r){e===void 0&&(e=1/0),r===void 0&&(r=ff),this.max=e,this.dispose=r,this.map=new Map,this.newest=null,this.oldest=null}return t.prototype.has=function(e){return this.map.has(e)},t.prototype.get=function(e){var r=this.getNode(e);return r&&r.value},t.prototype.getNode=function(e){var r=this.map.get(e);if(r&&r!==this.newest){var n=r.older,i=r.newer;i&&(i.older=n),n&&(n.newer=i),r.older=this.newest,r.older.newer=r,r.newer=null,this.newest=r,r===this.oldest&&(this.oldest=i)}return r},t.prototype.set=function(e,r){var n=this.getNode(e);return n?n.value=r:(n={key:e,value:r,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)},t.prototype.clean=function(){for(;this.oldest&&this.map.size>this.max;)this.delete(this.oldest.key)},t.prototype.delete=function(e){var r=this.map.get(e);return r?(r===this.newest&&(this.newest=r.older),r===this.oldest&&(this.oldest=r.newer),r.newer&&(r.newer.older=r.older),r.older&&(r.older.newer=r.newer),this.map.delete(e),this.dispose(r.value,e),!0):!1},t}(),bi=new $r,oo,df=Object.prototype.hasOwnProperty,co=(oo=Array.from,oo===void 0?function(t){var e=[];return t.forEach(function(r){return e.push(r)}),e}:oo);function gi(t){var e=t.unsubscribe;typeof e=="function"&&(t.unsubscribe=void 0,e())}var On=[],hf=100;function Ur(t,e){if(!t)throw new Error(e||"assertion failure")}function mf(t,e){var r=t.length;return r>0&&r===e.length&&t[r-1]===e[r-1]}function mc(t){switch(t.length){case 0:throw new Error("unknown value");case 1:return t[0];case 2:throw t[1]}}function yf(t){return t.slice(0)}var vf=function(){function t(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,++t.count}return t.prototype.peek=function(){if(this.value.length===1&&!$t(this))return hc(this),this.value[0]},t.prototype.recompute=function(e){return Ur(!this.recomputing,"already recomputing"),hc(this),$t(this)?gf(this,e):mc(this.value)},t.prototype.setDirty=function(){this.dirty||(this.dirty=!0,this.value.length=0,yc(this),gi(this))},t.prototype.dispose=function(){var e=this;this.setDirty(),wc(this),uo(this,function(r,n){r.setDirty(),_c(r,e)})},t.prototype.forget=function(){this.dispose()},t.prototype.dependOn=function(e){e.add(this),this.deps||(this.deps=On.pop()||new Set),this.deps.add(e)},t.prototype.forgetDeps=function(){var e=this;this.deps&&(co(this.deps).forEach(function(r){return r.delete(e)}),this.deps.clear(),On.push(this.deps),this.deps=null)},t.count=0,t}();function hc(t){var e=bi.getValue();if(e)return t.parents.add(e),e.childValues.has(t)||e.childValues.set(t,[]),$t(t)?gc(e,t):bc(e,t),e}function gf(t,e){return wc(t),bi.withValue(t,bf,[t,e]),wf(t,e)&&Sf(t),mc(t.value)}function bf(t,e){t.recomputing=!0,t.value.length=0;try{t.value[0]=t.fn.apply(null,e)}catch(r){t.value[1]=r}t.recomputing=!1}function $t(t){return t.dirty||!!(t.dirtyChildren&&t.dirtyChildren.size)}function Sf(t){t.dirty=!1,!$t(t)&&vc(t)}function yc(t){uo(t,gc)}function vc(t){uo(t,bc)}function uo(t,e){var r=t.parents.size;if(r)for(var n=co(t.parents),i=0;i<r;++i)e(n[i],t)}function gc(t,e){Ur(t.childValues.has(e)),Ur($t(e));var r=!$t(t);if(!t.dirtyChildren)t.dirtyChildren=On.pop()||new Set;else if(t.dirtyChildren.has(e))return;t.dirtyChildren.add(e),r&&yc(t)}function bc(t,e){Ur(t.childValues.has(e)),Ur(!$t(e));var r=t.childValues.get(e);r.length===0?t.childValues.set(e,yf(e.value)):mf(r,e.value)||t.setDirty(),Sc(t,e),!$t(t)&&vc(t)}function Sc(t,e){var r=t.dirtyChildren;r&&(r.delete(e),r.size===0&&(On.length<hf&&On.push(r),t.dirtyChildren=null))}function wc(t){t.childValues.size>0&&t.childValues.forEach(function(e,r){_c(t,r)}),t.forgetDeps(),Ur(t.dirtyChildren===null)}function _c(t,e){e.parents.delete(t),t.childValues.delete(e),Sc(t,e)}function wf(t,e){if(typeof t.subscribe=="function")try{gi(t),t.unsubscribe=t.subscribe.apply(null,e)}catch{return t.setDirty(),!1}return!0}var _f={setDirty:!0,dispose:!0,forget:!0};function Si(t){var e=new Map,r=t&&t.subscribe;function n(i){var a=bi.getValue();if(a){var o=e.get(i);o||e.set(i,o=new Set),a.dependOn(o),typeof r=="function"&&(gi(o),o.unsubscribe=r(i))}}return n.dirty=function(a,o){var s=e.get(a);if(s){var u=o&&df.call(_f,o)?o:"setDirty";co(s).forEach(function(l){return l[u]()}),e.delete(a),gi(s)}},n}function Ec(){var t=new vt(typeof WeakMap=="function");return function(){return t.lookupArray(arguments)}}var Av=Ec(),so=new Set;function cr(t,e){e===void 0&&(e=Object.create(null));var r=new pf(e.max||Math.pow(2,16),function(l){return l.dispose()}),n=e.keyArgs,i=e.makeCacheKey||Ec(),a=function(){var l=i.apply(null,n?n.apply(null,arguments):arguments);if(l===void 0)return t.apply(null,arguments);var f=r.get(l);f||(r.set(l,f=new vf(t)),f.subscribe=e.subscribe,f.forget=function(){return r.delete(l)});var d=f.recompute(Array.prototype.slice.call(arguments));return r.set(l,f),so.add(r),bi.hasValue()||(so.forEach(function(h){return h.clean()}),so.clear()),d};Object.defineProperty(a,"size",{get:function(){return r.map.size},configurable:!1,enumerable:!1});function o(l){var f=r.get(l);f&&f.setDirty()}a.dirtyKey=o,a.dirty=function(){o(i.apply(null,arguments))};function s(l){var f=r.get(l);if(f)return f.peek()}a.peekKey=s,a.peek=function(){return s(i.apply(null,arguments))};function u(l){return r.delete(l)}return a.forgetKey=u,a.forget=function(){return u(i.apply(null,arguments))},a.makeCacheKey=i,a.getKey=n?function(){return i.apply(null,n.apply(null,arguments))}:i,Object.freeze(a)}var lo=function(){function t(){this.getFragmentDoc=cr(Aa)}return t.prototype.batch=function(e){var r=this,n=typeof e.optimistic=="string"?e.optimistic:e.optimistic===!1?null:void 0,i;return this.performTransaction(function(){return i=e.update(r)},n),i},t.prototype.recordOptimisticTransaction=function(e,r){this.performTransaction(e,r)},t.prototype.transformDocument=function(e){return e},t.prototype.transformForLink=function(e){return e},t.prototype.identify=function(e){},t.prototype.gc=function(){return[]},t.prototype.modify=function(e){return!1},t.prototype.readQuery=function(e,r){return r===void 0&&(r=!!e.optimistic),this.read(m(m({},e),{rootId:e.id||"ROOT_QUERY",optimistic:r}))},t.prototype.readFragment=function(e,r){return r===void 0&&(r=!!e.optimistic),this.read(m(m({},e),{query:this.getFragmentDoc(e.fragment,e.fragmentName),rootId:e.id,optimistic:r}))},t.prototype.writeQuery=function(e){var r=e.id,n=e.data,i=ht(e,["id","data"]);return this.write(Object.assign(i,{dataId:r||"ROOT_QUERY",result:n}))},t.prototype.writeFragment=function(e){var r=e.id,n=e.data,i=e.fragment,a=e.fragmentName,o=ht(e,["id","data","fragment","fragmentName"]);return this.write(Object.assign(o,{query:this.getFragmentDoc(i,a),dataId:r,result:n}))},t.prototype.updateQuery=function(e,r){return this.batch({update:function(n){var i=n.readQuery(e),a=r(i);return a==null?i:(n.writeQuery(m(m({},e),{data:a})),a)}})},t.prototype.updateFragment=function(e,r){return this.batch({update:function(n){var i=n.readFragment(e),a=r(i);return a==null?i:(n.writeFragment(m(m({},e),{data:a})),a)}})},t}();var Tn=function(t){de(e,t);function e(r,n,i,a){var o,s=t.call(this,r)||this;if(s.message=r,s.path=n,s.query=i,s.variables=a,Array.isArray(s.path)){s.missing=s.message;for(var u=s.path.length-1;u>=0;--u)s.missing=(o={},o[s.path[u]]=s.missing,o)}else s.missing=s.path;return s.__proto__=e.prototype,s}return e}(Error);var he=Object.prototype.hasOwnProperty;function In(t){return t==null}function _i(t,e){var r=t.__typename,n=t.id,i=t._id;if(typeof r=="string"&&(e&&(e.keyObject=In(n)?In(i)?void 0:{_id:i}:{id:n}),In(n)&&!In(i)&&(n=i),!In(n)))return"".concat(r,":").concat(typeof n=="number"||typeof n=="string"?n:JSON.stringify(n))}var xc={dataIdFromObject:_i,addTypename:!0,resultCaching:!0,canonizeResults:!1};function Oc(t){return jt(xc,t)}function Ei(t){var e=t.canonizeResults;return e===void 0?xc.canonizeResults:e}function Tc(t,e){return Q(e)?t.get(e.__ref,"__typename"):e&&e.__typename}var fo=/^[_a-z][_0-9a-z]*/i;function st(t){var e=t.match(fo);return e?e[0]:t}function wi(t,e,r){return K(e)?ee(e)?e.every(function(n){return wi(t,n,r)}):t.selections.every(function(n){if(ze(n)&&Et(n,r)){var i=Ze(n);return he.call(e,i)&&(!n.selectionSet||wi(n.selectionSet,e[i],r))}return!0}):!1}function Ut(t){return K(t)&&!Q(t)&&!ee(t)}function Ic(){return new Ve}function xi(t,e){var r=tr(nr(t));return{fragmentMap:r,lookupFragment:function(n){var i=r[n];return!i&&e&&(i=e.lookup(n)),i||null}}}var Oi=Object.create(null),po=function(){return Oi},Dc=Object.create(null),qr=function(){function t(e,r){var n=this;this.policies=e,this.group=r,this.data=Object.create(null),this.rootIds=Object.create(null),this.refs=Object.create(null),this.getFieldValue=function(i,a){return bn(Q(i)?n.get(i.__ref,a):i&&i[a])},this.canRead=function(i){return Q(i)?n.has(i.__ref):typeof i=="object"},this.toReference=function(i,a){if(typeof i=="string")return mt(i);if(Q(i))return i;var o=n.policies.identify(i)[0];if(o){var s=mt(o);return a&&n.merge(o,i),s}}}return t.prototype.toObject=function(){return m({},this.data)},t.prototype.has=function(e){return this.lookup(e,!0)!==void 0},t.prototype.get=function(e,r){if(this.group.depend(e,r),he.call(this.data,e)){var n=this.data[e];if(n&&he.call(n,r))return n[r]}if(r==="__typename"&&he.call(this.policies.rootTypenamesById,e))return this.policies.rootTypenamesById[e];if(this instanceof qt)return this.parent.get(e,r)},t.prototype.lookup=function(e,r){if(r&&this.group.depend(e,"__exists"),he.call(this.data,e))return this.data[e];if(this instanceof qt)return this.parent.lookup(e,r);if(this.policies.rootTypenamesById[e])return Object.create(null)},t.prototype.merge=function(e,r){var n=this,i;Q(e)&&(e=e.__ref),Q(r)&&(r=r.__ref);var a=typeof e=="string"?this.lookup(i=e):e,o=typeof r=="string"?this.lookup(i=r):r;if(!!o){__DEV__?I(typeof i=="string","store.merge expects a string ID"):I(typeof i=="string",1);var s=new Ve(xf).merge(a,o);if(this.data[i]=s,s!==a&&(delete this.refs[i],this.group.caching)){var u=Object.create(null);a||(u.__exists=1),Object.keys(o).forEach(function(l){if(!a||a[l]!==s[l]){u[l]=1;var f=st(l);f!==l&&!n.policies.hasKeyArgs(s.__typename,f)&&(u[f]=1),s[l]===void 0&&!(n instanceof qt)&&delete s[l]}}),u.__typename&&!(a&&a.__typename)&&this.policies.rootTypenamesById[i]===s.__typename&&delete u.__typename,Object.keys(u).forEach(function(l){return n.group.dirty(i,l)})}}},t.prototype.modify=function(e,r){var n=this,i=this.lookup(e);if(i){var a=Object.create(null),o=!1,s=!0,u={DELETE:Oi,INVALIDATE:Dc,isReference:Q,toReference:this.toReference,canRead:this.canRead,readField:function(l,f){return n.policies.readField(typeof l=="string"?{fieldName:l,from:f||mt(e)}:l,{store:n})}};if(Object.keys(i).forEach(function(l){var f=st(l),d=i[l];if(d!==void 0){var h=typeof r=="function"?r:r[l]||r[f];if(h){var p=h===po?Oi:h(bn(d),m(m({},u),{fieldName:f,storeFieldName:l,storage:n.getStorage(e,l)}));p===Dc?n.group.dirty(e,l):(p===Oi&&(p=void 0),p!==d&&(a[l]=p,o=!0,d=p))}d!==void 0&&(s=!1)}}),o)return this.merge(e,a),s&&(this instanceof qt?this.data[e]=void 0:delete this.data[e],this.group.dirty(e,"__exists")),!0}return!1},t.prototype.delete=function(e,r,n){var i,a=this.lookup(e);if(a){var o=this.getFieldValue(a,"__typename"),s=r&&n?this.policies.getStoreFieldName({typename:o,fieldName:r,args:n}):r;return this.modify(e,s?(i={},i[s]=po,i):po)}return!1},t.prototype.evict=function(e,r){var n=!1;return e.id&&(he.call(this.data,e.id)&&(n=this.delete(e.id,e.fieldName,e.args)),this instanceof qt&&this!==r&&(n=this.parent.evict(e,r)||n),(e.fieldName||n)&&this.group.dirty(e.id,e.fieldName||"__exists")),n},t.prototype.clear=function(){this.replace(null)},t.prototype.extract=function(){var e=this,r=this.toObject(),n=[];return this.getRootIdSet().forEach(function(i){he.call(e.policies.rootTypenamesById,i)||n.push(i)}),n.length&&(r.__META={extraRootIds:n.sort()}),r},t.prototype.replace=function(e){var r=this;if(Object.keys(this.data).forEach(function(a){e&&he.call(e,a)||r.delete(a)}),e){var n=e.__META,i=ht(e,["__META"]);Object.keys(i).forEach(function(a){r.merge(a,i[a])}),n&&n.extraRootIds.forEach(this.retain,this)}},t.prototype.retain=function(e){return this.rootIds[e]=(this.rootIds[e]||0)+1},t.prototype.release=function(e){if(this.rootIds[e]>0){var r=--this.rootIds[e];return r||delete this.rootIds[e],r}return 0},t.prototype.getRootIdSet=function(e){return e===void 0&&(e=new Set),Object.keys(this.rootIds).forEach(e.add,e),this instanceof qt?this.parent.getRootIdSet(e):Object.keys(this.policies.rootTypenamesById).forEach(e.add,e),e},t.prototype.gc=function(){var e=this,r=this.getRootIdSet(),n=this.toObject();r.forEach(function(o){he.call(n,o)&&(Object.keys(e.findChildRefIds(o)).forEach(r.add,r),delete n[o])});var i=Object.keys(n);if(i.length){for(var a=this;a instanceof qt;)a=a.parent;i.forEach(function(o){return a.delete(o)})}return i},t.prototype.findChildRefIds=function(e){if(!he.call(this.refs,e)){var r=this.refs[e]=Object.create(null),n=this.data[e];if(!n)return r;var i=new Set([n]);i.forEach(function(a){Q(a)&&(r[a.__ref]=!0),K(a)&&Object.keys(a).forEach(function(o){var s=a[o];K(s)&&i.add(s)})})}return this.refs[e]},t.prototype.makeCacheKey=function(){return this.group.keyMaker.lookupArray(arguments)},t}();var kc=function(){function t(e,r){r===void 0&&(r=null),this.caching=e,this.parent=r,this.d=null,this.resetCaching()}return t.prototype.resetCaching=function(){this.d=this.caching?Si():null,this.keyMaker=new vt(et)},t.prototype.depend=function(e,r){if(this.d){this.d(ho(e,r));var n=st(r);n!==r&&this.d(ho(e,n)),this.parent&&this.parent.depend(e,r)}},t.prototype.dirty=function(e,r){this.d&&this.d.dirty(ho(e,r),r==="__exists"?"forget":"setDirty")},t}();function ho(t,e){return e+"#"+t}function mo(t,e){ur(t)&&t.group.depend(e,"__exists")}(function(t){var e=function(r){de(n,r);function n(i){var a=i.policies,o=i.resultCaching,s=o===void 0?!0:o,u=i.seed,l=r.call(this,a,new kc(s))||this;return l.stump=new Ef(l),l.storageTrie=new vt(et),u&&l.replace(u),l}return n.prototype.addLayer=function(i,a){return this.stump.addLayer(i,a)},n.prototype.removeLayer=function(){return this},n.prototype.getStorage=function(){return this.storageTrie.lookupArray(arguments)},n}(t);t.Root=e})(qr||(qr={}));var qt=function(t){de(e,t);function e(r,n,i,a){var o=t.call(this,n.policies,a)||this;return o.id=r,o.parent=n,o.replay=i,o.group=a,i(o),o}return e.prototype.addLayer=function(r,n){return new e(r,this,n,this.group)},e.prototype.removeLayer=function(r){var n=this,i=this.parent.removeLayer(r);return r===this.id?(this.group.caching&&Object.keys(this.data).forEach(function(a){var o=n.data[a],s=i.lookup(a);s?o?o!==s&&Object.keys(o).forEach(function(u){oe(o[u],s[u])||n.group.dirty(a,u)}):(n.group.dirty(a,"__exists"),Object.keys(s).forEach(function(u){n.group.dirty(a,u)})):n.delete(a)}),i):i===this.parent?this:i.addLayer(this.id,this.replay)},e.prototype.toObject=function(){return m(m({},this.parent.toObject()),this.data)},e.prototype.findChildRefIds=function(r){var n=this.parent.findChildRefIds(r);return he.call(this.data,r)?m(m({},n),t.prototype.findChildRefIds.call(this,r)):n},e.prototype.getStorage=function(){for(var r=this.parent;r.parent;)r=r.parent;return r.getStorage.apply(r,arguments)},e}(qr),Ef=function(t){de(e,t);function e(r){return t.call(this,"EntityStore.Stump",r,function(){},new kc(r.group.caching,r.group))||this}return e.prototype.removeLayer=function(){return this},e.prototype.merge=function(){return this.parent.merge.apply(this.parent,arguments)},e}(qt);function xf(t,e,r){var n=t[r],i=e[r];return oe(n,i)?n:i}function ur(t){return!!(t instanceof qr&&t.group.caching)}function Of(t){return K(t)?ee(t)?t.slice(0):m({__proto__:Object.getPrototypeOf(t)},t):t}var Ti=function(){function t(){this.known=new(Cs?WeakSet:Set),this.pool=new vt(et),this.passes=new WeakMap,this.keysByJSON=new Map,this.empty=this.admit({})}return t.prototype.isKnown=function(e){return K(e)&&this.known.has(e)},t.prototype.pass=function(e){if(K(e)){var r=Of(e);return this.passes.set(r,e),r}return e},t.prototype.admit=function(e){var r=this;if(K(e)){var n=this.passes.get(e);if(n)return n;var i=Object.getPrototypeOf(e);switch(i){case Array.prototype:{if(this.known.has(e))return e;var a=e.map(this.admit,this),o=this.pool.lookupArray(a);return o.array||(this.known.add(o.array=a),__DEV__&&Object.freeze(a)),o.array}case null:case Object.prototype:{if(this.known.has(e))return e;var s=Object.getPrototypeOf(e),u=[s],l=this.sortedKeys(e);u.push(l.json);var f=u.length;l.sorted.forEach(function(p){u.push(r.admit(e[p]))});var o=this.pool.lookupArray(u);if(!o.object){var d=o.object=Object.create(s);this.known.add(d),l.sorted.forEach(function(p,y){d[p]=u[f+y]}),__DEV__&&Object.freeze(d)}return o.object}}}return e},t.prototype.sortedKeys=function(e){var r=Object.keys(e),n=this.pool.lookupArray(r);if(!n.keys){r.sort();var i=JSON.stringify(r);(n.keys=this.keysByJSON.get(i))||this.keysByJSON.set(i,n.keys={sorted:r,json:i})}return n.keys},t}();var Je=Object.assign(function(t){if(K(t)){yo===void 0&&Ac();var e=yo.admit(t),r=vo.get(e);return r===void 0&&vo.set(e,r=JSON.stringify(e)),r}return JSON.stringify(t)},{reset:Ac}),yo,vo;function Ac(){yo=new Ti,vo=new(et?WeakMap:Map)}function Nc(t){return[t.selectionSet,t.objectOrReference,t.context,t.context.canonizeResults]}var Pc=function(){function t(e){var r=this;this.knownResults=new(et?WeakMap:Map),this.config=jt(e,{addTypename:e.addTypename!==!1,canonizeResults:Ei(e)}),this.canon=e.canon||new Ti,this.executeSelectionSet=cr(function(n){var i,a=n.context.canonizeResults,o=Nc(n);o[3]=!a;var s=(i=r.executeSelectionSet).peek.apply(i,o);return s?a?m(m({},s),{result:r.canon.admit(s.result)}):s:(mo(n.context.store,n.enclosingRef.__ref),r.execSelectionSetImpl(n))},{max:this.config.resultCacheMaxSize,keyArgs:Nc,makeCacheKey:function(n,i,a,o){if(ur(a.store))return a.store.makeCacheKey(n,Q(i)?i.__ref:i,a.varString,o)}}),this.executeSubSelectedArray=cr(function(n){return mo(n.context.store,n.enclosingRef.__ref),r.execSubSelectedArrayImpl(n)},{max:this.config.resultCacheMaxSize,makeCacheKey:function(n){var i=n.field,a=n.array,o=n.context;if(ur(o.store))return o.store.makeCacheKey(i,a,o.varString)}})}return t.prototype.resetCanon=function(){this.canon=new Ti},t.prototype.diffQueryAgainstStore=function(e){var r=e.store,n=e.query,i=e.rootId,a=i===void 0?"ROOT_QUERY":i,o=e.variables,s=e.returnPartialData,u=s===void 0?!0:s,l=e.canonizeResults,f=l===void 0?this.config.canonizeResults:l,d=this.config.cache.policies;o=m(m({},ar(yn(n))),o);var h=mt(a),p=this.executeSelectionSet({selectionSet:ir(n).selectionSet,objectOrReference:h,enclosingRef:h,context:m({store:r,query:n,policies:d,variables:o,varString:Je(o),canonizeResults:f},xi(n,this.config.fragments))}),y;if(p.missing&&(y=[new Tn(Tf(p.missing),p.missing,n,o)],!u))throw y[0];return{result:p.result,complete:!y,missing:y}},t.prototype.isFresh=function(e,r,n,i){if(ur(i.store)&&this.knownResults.get(e)===n){var a=this.executeSelectionSet.peek(n,r,i,this.canon.isKnown(e));if(a&&e===a.result)return!0}return!1},t.prototype.execSelectionSetImpl=function(e){var r=this,n=e.selectionSet,i=e.objectOrReference,a=e.enclosingRef,o=e.context;if(Q(i)&&!o.policies.rootTypenamesById[i.__ref]&&!o.store.has(i.__ref))return{result:this.canon.empty,missing:"Dangling reference to missing ".concat(i.__ref," object")};var s=o.variables,u=o.policies,l=o.store,f=l.getFieldValue(i,"__typename"),d=[],h,p=new Ve;this.config.addTypename&&typeof f=="string"&&!u.rootIdsByTypename[f]&&d.push({__typename:f});function y(w,T){var A;return w.missing&&(h=p.merge(h,(A={},A[T]=w.missing,A))),w.result}var v=new Set(n.selections);v.forEach(function(w){var T,A;if(!!Et(w,s))if(ze(w)){var N=u.readField({fieldName:w.name.value,field:w,variables:o.variables,from:i},o),k=Ze(w);N===void 0?or.added(w)||(h=p.merge(h,(T={},T[k]="Can't find field '".concat(w.name.value,"' on ").concat(Q(i)?i.__ref+" object":"object "+JSON.stringify(i,null,2)),T))):ee(N)?N=y(r.executeSubSelectedArray({field:w,array:N,enclosingRef:a,context:o}),k):w.selectionSet?N!=null&&(N=y(r.executeSelectionSet({selectionSet:w.selectionSet,objectOrReference:N,enclosingRef:Q(N)?N:a,context:o}),k)):o.canonizeResults&&(N=r.canon.pass(N)),N!==void 0&&d.push((A={},A[k]=N,A))}else{var C=rr(w,o.lookupFragment);if(!C&&w.kind===ge.FRAGMENT_SPREAD)throw __DEV__?new $("No fragment named ".concat(w.name.value)):new $(5);C&&u.fragmentMatches(C,f)&&C.selectionSet.selections.forEach(v.add,v)}});var S=vn(d),E={result:S,missing:h},b=o.canonizeResults?this.canon.admit(E):bn(E);return b.result&&this.knownResults.set(b.result,n),b},t.prototype.execSubSelectedArrayImpl=function(e){var r=this,n=e.field,i=e.array,a=e.enclosingRef,o=e.context,s,u=new Ve;function l(f,d){var h;return f.missing&&(s=u.merge(s,(h={},h[d]=f.missing,h))),f.result}return n.selectionSet&&(i=i.filter(o.store.canRead)),i=i.map(function(f,d){return f===null?null:ee(f)?l(r.executeSubSelectedArray({field:n,array:f,enclosingRef:a,context:o}),d):n.selectionSet?l(r.executeSelectionSet({selectionSet:n.selectionSet,objectOrReference:f,enclosingRef:Q(f)?f:a,context:o}),d):(__DEV__&&If(o.store,n,f),f)}),{result:o.canonizeResults?this.canon.admit(i):i,missing:s}},t}();function Tf(t){try{JSON.stringify(t,function(e,r){if(typeof r=="string")throw r;return r})}catch(e){return e}}function If(t,e,r){if(!e.selectionSet){var n=new Set([r]);n.forEach(function(i){K(i)&&(__DEV__?I(!Q(i),"Missing selection set for object of type ".concat(Tc(t,i)," returned for query field ").concat(e.name.value)):I(!Q(i),6),Object.values(i).forEach(n.add,n))})}}var Vr=new $r,Cc=new WeakMap;function Dn(t){var e=Cc.get(t);return e||Cc.set(t,e={vars:new Set,dep:Si()}),e}function go(t){Dn(t).vars.forEach(function(e){return e.forgetCache(t)})}function Rc(t){Dn(t).vars.forEach(function(e){return e.attachCache(t)})}function Ii(t){var e=new Set,r=new Set,n=function(a){if(arguments.length>0){if(t!==a){t=a,e.forEach(function(u){Dn(u).dep.dirty(n),Df(u)});var o=Array.from(r);r.clear(),o.forEach(function(u){return u(t)})}}else{var s=Vr.getValue();s&&(i(s),Dn(s).dep(n))}return t};n.onNextChange=function(a){return r.add(a),function(){r.delete(a)}};var i=n.attachCache=function(a){return e.add(a),Dn(a).vars.add(n),n};return n.forgetCache=function(a){return e.delete(a)},n}function Df(t){t.broadcastWatches&&t.broadcastWatches()}var Lc=Object.create(null);function bo(t){var e=JSON.stringify(t);return Lc[e]||(Lc[e]=Object.create(null))}function So(t){var e=bo(t);return e.keyFieldsFn||(e.keyFieldsFn=function(r,n){var i=function(o,s){return n.readField(s,o)},a=n.keyObject=_o(t,function(o){var s=Br(n.storeObject,o,i);return s===void 0&&r!==n.storeObject&&he.call(r,o[0])&&(s=Br(r,o,Mc)),__DEV__?I(s!==void 0,"Missing field '".concat(o.join("."),"' while extracting keyFields from ").concat(JSON.stringify(r))):I(s!==void 0,2),s});return"".concat(n.typename,":").concat(JSON.stringify(a))})}function wo(t){var e=bo(t);return e.keyArgsFn||(e.keyArgsFn=function(r,n){var i=n.field,a=n.variables,o=n.fieldName,s=_o(t,function(l){var f=l[0],d=f.charAt(0);if(d==="@"){if(i&&we(i.directives)){var h=f.slice(1),p=i.directives.find(function(E){return E.name.value===h}),y=p&&xt(p,a);return y&&Br(y,l.slice(1))}return}if(d==="$"){var v=f.slice(1);if(a&&he.call(a,v)){var S=l.slice(0);return S[0]=v,Br(a,S)}return}if(r)return Br(r,l)}),u=JSON.stringify(s);return(r||u!=="{}")&&(o+=":"+u),o})}function _o(t,e){var r=new Ve;return Fc(t).reduce(function(n,i){var a,o=e(i);if(o!==void 0){for(var s=i.length-1;s>=0;--s)o=(a={},a[i[s]]=o,a);n=r.merge(n,o)}return n},Object.create(null))}function Fc(t){var e=bo(t);if(!e.paths){var r=e.paths=[],n=[];t.forEach(function(i,a){ee(i)?(Fc(i).forEach(function(o){return r.push(n.concat(o))}),n.length=0):(n.push(i),ee(t[a+1])||(r.push(n.slice(0)),n.length=0))})}return e.paths}function Mc(t,e){return t[e]}function Br(t,e,r){return r=r||Mc,jc(e.reduce(function n(i,a){return ee(i)?i.map(function(o){return n(o,a)}):i&&r(i,a)},t))}function jc(t){return K(t)?ee(t)?t.map(jc):_o(Object.keys(t).sort(),function(e){return Br(t,e)}):t}hn.setStringify(Je);function Eo(t){return t.args!==void 0?t.args:t.field?xt(t.field,t.variables):null}var kf=function(){},$c=function(t,e){return e.fieldName},Uc=function(t,e,r){var n=r.mergeObjects;return n(t,e)},qc=function(t,e){return e},Bc=function(){function t(e){this.config=e,this.typePolicies=Object.create(null),this.toBeAdded=Object.create(null),this.supertypeMap=new Map,this.fuzzySubtypes=new Map,this.rootIdsByTypename=Object.create(null),this.rootTypenamesById=Object.create(null),this.usingPossibleTypes=!1,this.config=m({dataIdFromObject:_i},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)}return t.prototype.identify=function(e,r){var n,i=this,a=r&&(r.typename||((n=r.storeObject)===null||n===void 0?void 0:n.__typename))||e.__typename;if(a===this.rootTypenamesById.ROOT_QUERY)return["ROOT_QUERY"];for(var o=r&&r.storeObject||e,s=m(m({},r),{typename:a,storeObject:o,readField:r&&r.readField||function(){var h=Di(arguments,o);return i.readField(h,{store:i.cache.data,variables:h.variables})}}),u,l=a&&this.getTypePolicy(a),f=l&&l.keyFn||this.config.dataIdFromObject;f;){var d=f(e,s);if(ee(d))f=So(d);else{u=d;break}}return u=u?String(u):void 0,s.keyObject?[u,s.keyObject]:[u]},t.prototype.addTypePolicies=function(e){var r=this;Object.keys(e).forEach(function(n){var i=e[n],a=i.queryType,o=i.mutationType,s=i.subscriptionType,u=ht(i,["queryType","mutationType","subscriptionType"]);a&&r.setRootTypename("Query",n),o&&r.setRootTypename("Mutation",n),s&&r.setRootTypename("Subscription",n),he.call(r.toBeAdded,n)?r.toBeAdded[n].push(u):r.toBeAdded[n]=[u]})},t.prototype.updateTypePolicy=function(e,r){var n=this,i=this.getTypePolicy(e),a=r.keyFields,o=r.fields;function s(u,l){u.merge=typeof l=="function"?l:l===!0?Uc:l===!1?qc:u.merge}s(i,r.merge),i.keyFn=a===!1?kf:ee(a)?So(a):typeof a=="function"?a:i.keyFn,o&&Object.keys(o).forEach(function(u){var l=n.getFieldPolicy(e,u,!0),f=o[u];if(typeof f=="function")l.read=f;else{var d=f.keyArgs,h=f.read,p=f.merge;l.keyFn=d===!1?$c:ee(d)?wo(d):typeof d=="function"?d:l.keyFn,typeof h=="function"&&(l.read=h),s(l,p)}l.read&&l.merge&&(l.keyFn=l.keyFn||$c)})},t.prototype.setRootTypename=function(e,r){r===void 0&&(r=e);var n="ROOT_"+e.toUpperCase(),i=this.rootTypenamesById[n];r!==i&&(__DEV__?I(!i||i===e,"Cannot change root ".concat(e," __typename more than once")):I(!i||i===e,3),i&&delete this.rootIdsByTypename[i],this.rootIdsByTypename[r]=n,this.rootTypenamesById[n]=r)},t.prototype.addPossibleTypes=function(e){var r=this;this.usingPossibleTypes=!0,Object.keys(e).forEach(function(n){r.getSupertypeSet(n,!0),e[n].forEach(function(i){r.getSupertypeSet(i,!0).add(n);var a=i.match(fo);(!a||a[0]!==i)&&r.fuzzySubtypes.set(i,new RegExp(i))})})},t.prototype.getTypePolicy=function(e){var r=this;if(!he.call(this.typePolicies,e)){var n=this.typePolicies[e]=Object.create(null);n.fields=Object.create(null);var i=this.supertypeMap.get(e);i&&i.size&&i.forEach(function(o){var s=r.getTypePolicy(o),u=s.fields,l=ht(s,["fields"]);Object.assign(n,l),Object.assign(n.fields,u)})}var a=this.toBeAdded[e];return a&&a.length&&a.splice(0).forEach(function(o){r.updateTypePolicy(e,o)}),this.typePolicies[e]},t.prototype.getFieldPolicy=function(e,r,n){if(e){var i=this.getTypePolicy(e).fields;return i[r]||n&&(i[r]=Object.create(null))}},t.prototype.getSupertypeSet=function(e,r){var n=this.supertypeMap.get(e);return!n&&r&&this.supertypeMap.set(e,n=new Set),n},t.prototype.fragmentMatches=function(e,r,n,i){var a=this;if(!e.typeCondition)return!0;if(!r)return!1;var o=e.typeCondition.name.value;if(r===o)return!0;if(this.usingPossibleTypes&&this.supertypeMap.has(o))for(var s=this.getSupertypeSet(r,!0),u=[s],l=function(y){var v=a.getSupertypeSet(y,!1);v&&v.size&&u.indexOf(v)<0&&u.push(v)},f=!!(n&&this.fuzzySubtypes.size),d=!1,h=0;h<u.length;++h){var p=u[h];if(p.has(o))return s.has(o)||(d&&__DEV__&&I.warn("Inferring subtype ".concat(r," of supertype ").concat(o)),s.add(o)),!0;p.forEach(l),f&&h===u.length-1&&wi(e.selectionSet,n,i)&&(f=!1,d=!0,this.fuzzySubtypes.forEach(function(y,v){var S=r.match(y);S&&S[0]===r&&l(v)}))}return!1},t.prototype.hasKeyArgs=function(e,r){var n=this.getFieldPolicy(e,r,!1);return!!(n&&n.keyFn)},t.prototype.getStoreFieldName=function(e){var r=e.typename,n=e.fieldName,i=this.getFieldPolicy(r,n,!1),a,o=i&&i.keyFn;if(o&&r)for(var s={typename:r,fieldName:n,field:e.field||null,variables:e.variables},u=Eo(e);o;){var l=o(u,s);if(ee(l))o=wo(l);else{a=l||n;break}}return a===void 0&&(a=e.field?Pa(e.field,e.variables):hn(n,Eo(e))),a===!1?n:n===st(a)?a:n+":"+a},t.prototype.readField=function(e,r){var n=e.from;if(!!n){var i=e.field||e.fieldName;if(!!i){if(e.typename===void 0){var a=r.store.getFieldValue(n,"__typename");a&&(e.typename=a)}var o=this.getStoreFieldName(e),s=st(o),u=r.store.getFieldValue(n,o),l=this.getFieldPolicy(e.typename,s,!1),f=l&&l.read;if(f){var d=Vc(this,n,e,r,r.store.getStorage(Q(n)?n.__ref:n,o));return Vr.withValue(this.cache,f,[u,d])}return u}}},t.prototype.getReadFunction=function(e,r){var n=this.getFieldPolicy(e,r,!1);return n&&n.read},t.prototype.getMergeFunction=function(e,r,n){var i=this.getFieldPolicy(e,r,!1),a=i&&i.merge;return!a&&n&&(i=this.getTypePolicy(n),a=i&&i.merge),a},t.prototype.runMergeFunction=function(e,r,n,i,a){var o=n.field,s=n.typename,u=n.merge;return u===Uc?Qc(i.store)(e,r):u===qc?r:(i.overwrite&&(e=void 0),u(e,r,Vc(this,void 0,{typename:s,fieldName:o.name.value,field:o,variables:i.variables},i,a||Object.create(null))))},t}();function Vc(t,e,r,n,i){var a=t.getStoreFieldName(r),o=st(a),s=r.variables||n.variables,u=n.store,l=u.toReference,f=u.canRead;return{args:Eo(r),field:r.field||null,fieldName:o,storeFieldName:a,variables:s,isReference:Q,toReference:l,storage:i,cache:t.cache,canRead:f,readField:function(){return t.readField(Di(arguments,e,s),n)},mergeObjects:Qc(n.store)}}function Di(t,e,r){var n=t[0],i=t[1],a=t.length,o;return typeof n=="string"?o={fieldName:n,from:a>1?i:e}:(o=m({},n),he.call(o,"from")||(o.from=e)),__DEV__&&o.from===void 0&&__DEV__&&I.warn("Undefined 'from' passed to readField with arguments ".concat(Ms(Array.from(t)))),o.variables===void 0&&(o.variables=r),o}function Qc(t){return function(r,n){if(ee(r)||ee(n))throw __DEV__?new $("Cannot automatically merge arrays"):new $(4);if(K(r)&&K(n)){var i=t.getFieldValue(r,"__typename"),a=t.getFieldValue(n,"__typename"),o=i&&a&&i!==a;if(o)return n;if(Q(r)&&Ut(n))return t.merge(r.__ref,n),r;if(Ut(r)&&Q(n))return t.merge(r,n.__ref),n;if(Ut(r)&&Ut(n))return m(m({},r),n)}return n}}function xo(t,e,r){var n="".concat(e).concat(r),i=t.flavors.get(n);return i||t.flavors.set(n,i=t.clientOnly===e&&t.deferred===r?t:m(m({},t),{clientOnly:e,deferred:r})),i}var zc=function(){function t(e,r,n){this.cache=e,this.reader=r,this.fragments=n}return t.prototype.writeToStore=function(e,r){var n=this,i=r.query,a=r.result,o=r.dataId,s=r.variables,u=r.overwrite,l=yt(i),f=Ic();s=m(m({},ar(l)),s);var d=m(m({store:e,written:Object.create(null),merge:function(p,y){return f.merge(p,y)},variables:s,varString:Je(s)},xi(i,this.fragments)),{overwrite:!!u,incomingById:new Map,clientOnly:!1,deferred:!1,flavors:new Map}),h=this.processSelectionSet({result:a||Object.create(null),dataId:o,selectionSet:l.selectionSet,mergeTree:{map:new Map},context:d});if(!Q(h))throw __DEV__?new $("Could not identify object ".concat(JSON.stringify(a))):new $(7);return d.incomingById.forEach(function(p,y){var v=p.storeObject,S=p.mergeTree,E=p.fieldNodeSet,b=mt(y);if(S&&S.map.size){var w=n.applyMerges(S,b,v,d);if(Q(w))return;v=w}if(__DEV__&&!d.overwrite){var T=Object.create(null);E.forEach(function(k){k.selectionSet&&(T[k.name.value]=!0)});var A=function(k){return T[st(k)]===!0},N=function(k){var C=S&&S.map.get(k);return Boolean(C&&C.info&&C.info.merge)};Object.keys(v).forEach(function(k){A(k)&&!N(k)&&Af(b,v,k,d.store)})}e.merge(y,v)}),e.retain(h.__ref),h},t.prototype.processSelectionSet=function(e){var r=this,n=e.dataId,i=e.result,a=e.selectionSet,o=e.context,s=e.mergeTree,u=this.cache.policies,l=Object.create(null),f=n&&u.rootTypenamesById[n]||mn(i,a,o.fragmentMap)||n&&o.store.get(n,"__typename");typeof f=="string"&&(l.__typename=f);var d=function(){var w=Di(arguments,l,o.variables);if(Q(w.from)){var T=o.incomingById.get(w.from.__ref);if(T){var A=u.readField(m(m({},w),{from:T.storeObject}),o);if(A!==void 0)return A}}return u.readField(w,o)},h=new Set;this.flattenFields(a,i,o,f).forEach(function(w,T){var A,N=Ze(T),k=i[N];if(h.add(T),k!==void 0){var C=u.getStoreFieldName({typename:f,fieldName:T.name.value,field:T,variables:w.variables}),Z=Gc(s,C),Y=r.processFieldValue(k,T,T.selectionSet?xo(w,!1,!1):w,Z),ft=void 0;T.selectionSet&&(Q(Y)||Ut(Y))&&(ft=d("__typename",Y));var _t=u.getMergeFunction(f,T.name.value,ft);_t?Z.info={field:T,typename:f,merge:_t}:Wc(s,C),l=w.merge(l,(A={},A[C]=Y,A))}else __DEV__&&!w.clientOnly&&!w.deferred&&!or.added(T)&&!u.getReadFunction(f,T.name.value)&&__DEV__&&I.error("Missing field '".concat(Ze(T),"' while writing result ").concat(JSON.stringify(i,null,2)).substring(0,1e3))});try{var p=u.identify(i,{typename:f,selectionSet:a,fragmentMap:o.fragmentMap,storeObject:l,readField:d}),y=p[0],v=p[1];n=n||y,v&&(l=o.merge(l,v))}catch(w){if(!n)throw w}if(typeof n=="string"){var S=mt(n),E=o.written[n]||(o.written[n]=[]);if(E.indexOf(a)>=0||(E.push(a),this.reader&&this.reader.isFresh(i,S,a,o)))return S;var b=o.incomingById.get(n);return b?(b.storeObject=o.merge(b.storeObject,l),b.mergeTree=Oo(b.mergeTree,s),h.forEach(function(w){return b.fieldNodeSet.add(w)})):o.incomingById.set(n,{storeObject:l,mergeTree:ki(s)?void 0:s,fieldNodeSet:h}),S}return l},t.prototype.processFieldValue=function(e,r,n,i){var a=this;return!r.selectionSet||e===null?__DEV__?ui(e):e:ee(e)?e.map(function(o,s){var u=a.processFieldValue(o,r,n,Gc(i,s));return Wc(i,s),u}):this.processSelectionSet({result:e,selectionSet:r.selectionSet,context:n,mergeTree:i})},t.prototype.flattenFields=function(e,r,n,i){i===void 0&&(i=mn(r,e,n.fragmentMap));var a=new Map,o=this.cache.policies,s=new vt(!1);return function u(l,f){var d=s.lookup(l,f.clientOnly,f.deferred);d.visited||(d.visited=!0,l.selections.forEach(function(h){if(!!Et(h,n.variables)){var p=f.clientOnly,y=f.deferred;if(!(p&&y)&&we(h.directives)&&h.directives.forEach(function(E){var b=E.name.value;if(b==="client"&&(p=!0),b==="defer"){var w=xt(E,n.variables);(!w||w.if!==!1)&&(y=!0)}}),ze(h)){var v=a.get(h);v&&(p=p&&v.clientOnly,y=y&&v.deferred),a.set(h,xo(n,p,y))}else{var S=rr(h,n.lookupFragment);if(!S&&h.kind===ge.FRAGMENT_SPREAD)throw __DEV__?new $("No fragment named ".concat(h.name.value)):new $(8);S&&o.fragmentMatches(S,i,r,n.variables)&&u(S.selectionSet,xo(n,p,y))}}}))}(e,n),a},t.prototype.applyMerges=function(e,r,n,i,a){var o,s=this;if(e.map.size&&!Q(n)){var u=!ee(n)&&(Q(r)||Ut(r))?r:void 0,l=n;u&&!a&&(a=[Q(u)?u.__ref:u]);var f,d=function(h,p){return ee(h)?typeof p=="number"?h[p]:void 0:i.store.getFieldValue(h,String(p))};e.map.forEach(function(h,p){var y=d(u,p),v=d(l,p);if(v!==void 0){a&&a.push(p);var S=s.applyMerges(h,y,v,i,a);S!==v&&(f=f||new Map,f.set(p,S)),a&&I(a.pop()===p)}}),f&&(n=ee(l)?l.slice(0):m({},l),f.forEach(function(h,p){n[p]=h}))}return e.info?this.cache.policies.runMergeFunction(r,n,e.info,i,a&&(o=i.store).getStorage.apply(o,a)):n},t}();var Jc=[];function Gc(t,e){var r=t.map;return r.has(e)||r.set(e,Jc.pop()||{map:new Map}),r.get(e)}function Oo(t,e){if(t===e||!e||ki(e))return t;if(!t||ki(t))return e;var r=t.info&&e.info?m(m({},t.info),e.info):t.info||e.info,n=t.map.size&&e.map.size,i=n?new Map:t.map.size?t.map:e.map,a={info:r,map:i};if(n){var o=new Set(e.map.keys());t.map.forEach(function(s,u){a.map.set(u,Oo(s,e.map.get(u))),o.delete(u)}),o.forEach(function(s){a.map.set(s,Oo(e.map.get(s),t.map.get(s)))})}return a}function ki(t){return!t||!(t.info||t.map.size)}function Wc(t,e){var r=t.map,n=r.get(e);n&&ki(n)&&(Jc.push(n),r.delete(e))}var Kc=new Set;function Af(t,e,r,n){var i=function(d){var h=n.getFieldValue(d,r);return typeof h=="object"&&h},a=i(t);if(!!a){var o=i(e);if(!!o&&!Q(a)&&!oe(a,o)&&!Object.keys(a).every(function(d){return n.getFieldValue(o,d)!==void 0})){var s=n.getFieldValue(t,"__typename")||n.getFieldValue(e,"__typename"),u=st(r),l="".concat(s,".").concat(u);if(!Kc.has(l)){Kc.add(l);var f=[];!ee(a)&&!ee(o)&&[a,o].forEach(function(d){var h=n.getFieldValue(d,"__typename");typeof h=="string"&&!f.includes(h)&&f.push(h)}),__DEV__&&I.warn("Cache data may be lost when replacing the ".concat(u," field of a ").concat(s,` object.
36
+ `):new $(23)};var ic=function(){if(typeof AbortController>"u")return{controller:!1,signal:!1};var t=new AbortController,e=t.signal;return{controller:t,signal:e}};var ac=function(t,e){var r=t.getContext(),n=r.uri;return n||(typeof e=="function"?e(t):e||"/graphql")};function oc(t,e){var r=[],n=function(d,h){r.push("".concat(d,"=").concat(encodeURIComponent(h)))};if("query"in e&&n("query",e.query),e.operationName&&n("operationName",e.operationName),e.variables){var i=void 0;try{i=Tn(e.variables,"Variables map")}catch(d){return{parseError:d}}n("variables",i)}if(e.extensions){var a=void 0;try{a=Tn(e.extensions,"Extensions map")}catch(d){return{parseError:d}}n("extensions",a)}var o="",s=t,u=t.indexOf("#");u!==-1&&(o=t.substr(u),s=t.substr(0,u));var l=s.indexOf("?")===-1?"?":"&",f=s+l+r.join("&")+o;return{newURI:f}}var sc=Ee(function(){return fetch}),cc=function(t){t===void 0&&(t={});var e=t.uri,r=e===void 0?"/graphql":e,n=t.fetch,i=t.print,a=i===void 0?tc:i,o=t.includeExtensions,s=t.preserveHeaderCase,u=t.useGETForQueries,l=t.includeUnusedVariables,f=l===void 0?!1:l,d=ht(t,["uri","fetch","print","includeExtensions","preserveHeaderCase","useGETForQueries","includeUnusedVariables"]);__DEV__&&nc(n||sc);var h={http:{includeExtensions:o,preserveHeaderCase:s},options:d.fetchOptions,credentials:d.credentials,headers:d.headers};return new tt(function(p){var y=ac(p,r),g=p.getContext(),S={};if(g.clientAwareness){var T=g.clientAwareness,b=T.name,w=T.version;b&&(S["apollographql-client-name"]=b),w&&(S["apollographql-client-version"]=w)}var O=m(m({},S),g.headers),N={http:g.http,options:g.fetchOptions,credentials:g.credentials,headers:O},A=rc(p,a,ec,h,N),k=A.options,C=A.body;if(C.variables&&!f){var te=new Set(Object.keys(C.variables));Ae(p.query,{Variable:function(K,pt,V){V&&V.kind!=="VariableDefinition"&&te.delete(K.name.value)}}),te.size&&(C.variables=m({},C.variables),te.forEach(function(K){delete C.variables[K]}))}var Z;if(!k.signal){var ft=ic(),_t=ft.controller,Te=ft.signal;Z=_t,Z&&(k.signal=Te)}var q=function(K){return K.kind==="OperationDefinition"&&K.operation==="mutation"};if(u&&!p.query.definitions.some(q)&&(k.method="GET"),Ar(["defer"],p.query)&&(k.headers=k.headers||{},k.headers.accept="multipart/mixed; deferSpec=20220824, application/json"),k.method==="GET"){var pe=oc(y,C),ae=pe.newURI,W=pe.parseError;if(W)return gi(W);y=ae}else try{k.body=Tn(C,"Payload")}catch(K){return gi(K)}return new B(function(K){var pt=n||Ee(function(){return fetch})||sc;return pt(y,k).then(function(V){var dt;p.setContext({response:V});var Pt=(dt=V.headers)===null||dt===void 0?void 0:dt.get("content-type");return Pt!==null&&/^multipart\/mixed/i.test(Pt)?Ys(V,K):Zs(V,p,K)}).catch(function(V){return Si(V,K)}),function(){Z&&Z.abort()}})})};var ao=function(t){de(e,t);function e(r){r===void 0&&(r={});var n=t.call(this,cc(r).request)||this;return n.options=r,n}return e}(tt);var{toString:uc,hasOwnProperty:ef}=Object.prototype,lc=Function.prototype.toString,oo=new Map;function se(t,e){try{return so(t,e)}finally{oo.clear()}}function so(t,e){if(t===e)return!0;let r=uc.call(t),n=uc.call(e);if(r!==n)return!1;switch(r){case"[object Array]":if(t.length!==e.length)return!1;case"[object Object]":{if(pc(t,e))return!0;let i=fc(t),a=fc(e),o=i.length;if(o!==a.length)return!1;for(let s=0;s<o;++s)if(!ef.call(e,i[s]))return!1;for(let s=0;s<o;++s){let u=i[s];if(!so(t[u],e[u]))return!1}return!0}case"[object Error]":return t.name===e.name&&t.message===e.message;case"[object Number]":if(t!==t)return e!==e;case"[object Boolean]":case"[object Date]":return+t==+e;case"[object RegExp]":case"[object String]":return t==`${e}`;case"[object Map]":case"[object Set]":{if(t.size!==e.size)return!1;if(pc(t,e))return!0;let i=t.entries(),a=r==="[object Map]";for(;;){let o=i.next();if(o.done)break;let[s,u]=o.value;if(!e.has(s)||a&&!so(u,e.get(s)))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]":t=new Uint8Array(t),e=new Uint8Array(e);case"[object DataView]":{let i=t.byteLength;if(i===e.byteLength)for(;i--&&t[i]===e[i];);return i===-1}case"[object AsyncFunction]":case"[object GeneratorFunction]":case"[object AsyncGeneratorFunction]":case"[object Function]":{let i=lc.call(t);return i!==lc.call(e)?!1:!nf(i,rf)}}return!1}function fc(t){return Object.keys(t).filter(tf,t)}function tf(t){return this[t]!==void 0}var rf="{ [native code] }";function nf(t,e){let r=t.length-e.length;return r>=0&&t.indexOf(e,r)===r}function pc(t,e){let r=oo.get(t);if(r){if(r.has(e))return!0}else oo.set(t,r=new Set);return r.add(e),!1}var af=function(){return Object.create(null)},dc=Array.prototype,of=dc.forEach,sf=dc.slice,gt=function(){function t(e,r){e===void 0&&(e=!0),r===void 0&&(r=af),this.weakness=e,this.makeData=r}return t.prototype.lookup=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return this.lookupArray(e)},t.prototype.lookupArray=function(e){var r=this;return of.call(e,function(n){return r=r.getChildTrie(n)}),r.data||(r.data=this.makeData(sf.call(e)))},t.prototype.getChildTrie=function(e){var r=this.weakness&&cf(e)?this.weak||(this.weak=new WeakMap):this.strong||(this.strong=new Map),n=r.get(e);return n||r.set(e,n=new t(this.weakness,this.makeData)),n},t}();function cf(t){switch(typeof t){case"object":if(t===null)break;case"function":return!0}return!1}var Ie=null,hc={},uf=1,lf=()=>class{constructor(){this.id=["slot",uf++,Date.now(),Math.random().toString(36).slice(2)].join(":")}hasValue(){for(let e=Ie;e;e=e.parent)if(this.id in e.slots){let r=e.slots[this.id];if(r===hc)break;return e!==Ie&&(Ie.slots[this.id]=r),!0}return Ie&&(Ie.slots[this.id]=hc),!1}getValue(){if(this.hasValue())return Ie.slots[this.id]}withValue(e,r,n,i){let a={__proto__:null,[this.id]:e},o=Ie;Ie={parent:o,slots:a};try{return r.apply(i,n)}finally{Ie=o}}static bind(e){let r=Ie;return function(){let n=Ie;try{return Ie=r,e.apply(this,arguments)}finally{Ie=n}}}static noContext(e,r,n){if(Ie){let i=Ie;try{return Ie=null,e.apply(n,r)}finally{Ie=i}}else return e.apply(n,r)}};function mc(t){try{return t()}catch{}}var co="@wry/context:Slot",ff=mc(()=>globalThis)||mc(()=>global)||Object.create(null),yc=ff,$r=yc[co]||Array[co]||function(t){try{Object.defineProperty(yc,co,{value:t,enumerable:!1,writable:!1,configurable:!0})}finally{return t}}(lf());var{bind:pf,noContext:df}=$r;function hf(){}var mf=function(){function t(e,r){e===void 0&&(e=1/0),r===void 0&&(r=hf),this.max=e,this.dispose=r,this.map=new Map,this.newest=null,this.oldest=null}return t.prototype.has=function(e){return this.map.has(e)},t.prototype.get=function(e){var r=this.getNode(e);return r&&r.value},t.prototype.getNode=function(e){var r=this.map.get(e);if(r&&r!==this.newest){var n=r.older,i=r.newer;i&&(i.older=n),n&&(n.newer=i),r.older=this.newest,r.older.newer=r,r.newer=null,this.newest=r,r===this.oldest&&(this.oldest=i)}return r},t.prototype.set=function(e,r){var n=this.getNode(e);return n?n.value=r:(n={key:e,value:r,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)},t.prototype.clean=function(){for(;this.oldest&&this.map.size>this.max;)this.delete(this.oldest.key)},t.prototype.delete=function(e){var r=this.map.get(e);return r?(r===this.newest&&(this.newest=r.older),r===this.oldest&&(this.oldest=r.newer),r.newer&&(r.newer.older=r.older),r.older&&(r.older.newer=r.newer),this.map.delete(e),this.dispose(r.value,e),!0):!1},t}(),_i=new $r,uo,yf=Object.prototype.hasOwnProperty,fo=(uo=Array.from,uo===void 0?function(t){var e=[];return t.forEach(function(r){return e.push(r)}),e}:uo);function wi(t){var e=t.unsubscribe;typeof e=="function"&&(t.unsubscribe=void 0,e())}var On=[],gf=100;function Ur(t,e){if(!t)throw new Error(e||"assertion failure")}function vf(t,e){var r=t.length;return r>0&&r===e.length&&t[r-1]===e[r-1]}function vc(t){switch(t.length){case 0:throw new Error("unknown value");case 1:return t[0];case 2:throw t[1]}}function bf(t){return t.slice(0)}var Sf=function(){function t(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,++t.count}return t.prototype.peek=function(){if(this.value.length===1&&!$t(this))return gc(this),this.value[0]},t.prototype.recompute=function(e){return Ur(!this.recomputing,"already recomputing"),gc(this),$t(this)?wf(this,e):vc(this.value)},t.prototype.setDirty=function(){this.dirty||(this.dirty=!0,this.value.length=0,bc(this),wi(this))},t.prototype.dispose=function(){var e=this;this.setDirty(),Tc(this),po(this,function(r,n){r.setDirty(),Oc(r,e)})},t.prototype.forget=function(){this.dispose()},t.prototype.dependOn=function(e){e.add(this),this.deps||(this.deps=On.pop()||new Set),this.deps.add(e)},t.prototype.forgetDeps=function(){var e=this;this.deps&&(fo(this.deps).forEach(function(r){return r.delete(e)}),this.deps.clear(),On.push(this.deps),this.deps=null)},t.count=0,t}();function gc(t){var e=_i.getValue();if(e)return t.parents.add(e),e.childValues.has(t)||e.childValues.set(t,[]),$t(t)?wc(e,t):_c(e,t),e}function wf(t,e){return Tc(t),_i.withValue(t,_f,[t,e]),Tf(t,e)&&Ef(t),vc(t.value)}function _f(t,e){t.recomputing=!0,t.value.length=0;try{t.value[0]=t.fn.apply(null,e)}catch(r){t.value[1]=r}t.recomputing=!1}function $t(t){return t.dirty||!!(t.dirtyChildren&&t.dirtyChildren.size)}function Ef(t){t.dirty=!1,!$t(t)&&Sc(t)}function bc(t){po(t,wc)}function Sc(t){po(t,_c)}function po(t,e){var r=t.parents.size;if(r)for(var n=fo(t.parents),i=0;i<r;++i)e(n[i],t)}function wc(t,e){Ur(t.childValues.has(e)),Ur($t(e));var r=!$t(t);if(!t.dirtyChildren)t.dirtyChildren=On.pop()||new Set;else if(t.dirtyChildren.has(e))return;t.dirtyChildren.add(e),r&&bc(t)}function _c(t,e){Ur(t.childValues.has(e)),Ur(!$t(e));var r=t.childValues.get(e);r.length===0?t.childValues.set(e,bf(e.value)):vf(r,e.value)||t.setDirty(),Ec(t,e),!$t(t)&&Sc(t)}function Ec(t,e){var r=t.dirtyChildren;r&&(r.delete(e),r.size===0&&(On.length<gf&&On.push(r),t.dirtyChildren=null))}function Tc(t){t.childValues.size>0&&t.childValues.forEach(function(e,r){Oc(t,r)}),t.forgetDeps(),Ur(t.dirtyChildren===null)}function Oc(t,e){e.parents.delete(t),t.childValues.delete(e),Ec(t,e)}function Tf(t,e){if(typeof t.subscribe=="function")try{wi(t),t.unsubscribe=t.subscribe.apply(null,e)}catch{return t.setDirty(),!1}return!0}var Of={setDirty:!0,dispose:!0,forget:!0};function Ei(t){var e=new Map,r=t&&t.subscribe;function n(i){var a=_i.getValue();if(a){var o=e.get(i);o||e.set(i,o=new Set),a.dependOn(o),typeof r=="function"&&(wi(o),o.unsubscribe=r(i))}}return n.dirty=function(a,o){var s=e.get(a);if(s){var u=o&&yf.call(Of,o)?o:"setDirty";fo(s).forEach(function(l){return l[u]()}),e.delete(a),wi(s)}},n}function xc(){var t=new gt(typeof WeakMap=="function");return function(){return t.lookupArray(arguments)}}var Lg=xc(),lo=new Set;function cr(t,e){e===void 0&&(e=Object.create(null));var r=new mf(e.max||Math.pow(2,16),function(l){return l.dispose()}),n=e.keyArgs,i=e.makeCacheKey||xc(),a=function(){var l=i.apply(null,n?n.apply(null,arguments):arguments);if(l===void 0)return t.apply(null,arguments);var f=r.get(l);f||(r.set(l,f=new Sf(t)),f.subscribe=e.subscribe,f.forget=function(){return r.delete(l)});var d=f.recompute(Array.prototype.slice.call(arguments));return r.set(l,f),lo.add(r),_i.hasValue()||(lo.forEach(function(h){return h.clean()}),lo.clear()),d};Object.defineProperty(a,"size",{get:function(){return r.map.size},configurable:!1,enumerable:!1});function o(l){var f=r.get(l);f&&f.setDirty()}a.dirtyKey=o,a.dirty=function(){o(i.apply(null,arguments))};function s(l){var f=r.get(l);if(f)return f.peek()}a.peekKey=s,a.peek=function(){return s(i.apply(null,arguments))};function u(l){return r.delete(l)}return a.forgetKey=u,a.forget=function(){return u(i.apply(null,arguments))},a.makeCacheKey=i,a.getKey=n?function(){return i.apply(null,n.apply(null,arguments))}:i,Object.freeze(a)}var ho=function(){function t(){this.getFragmentDoc=cr(Ca)}return t.prototype.batch=function(e){var r=this,n=typeof e.optimistic=="string"?e.optimistic:e.optimistic===!1?null:void 0,i;return this.performTransaction(function(){return i=e.update(r)},n),i},t.prototype.recordOptimisticTransaction=function(e,r){this.performTransaction(e,r)},t.prototype.transformDocument=function(e){return e},t.prototype.transformForLink=function(e){return e},t.prototype.identify=function(e){},t.prototype.gc=function(){return[]},t.prototype.modify=function(e){return!1},t.prototype.readQuery=function(e,r){return r===void 0&&(r=!!e.optimistic),this.read(m(m({},e),{rootId:e.id||"ROOT_QUERY",optimistic:r}))},t.prototype.readFragment=function(e,r){return r===void 0&&(r=!!e.optimistic),this.read(m(m({},e),{query:this.getFragmentDoc(e.fragment,e.fragmentName),rootId:e.id,optimistic:r}))},t.prototype.writeQuery=function(e){var r=e.id,n=e.data,i=ht(e,["id","data"]);return this.write(Object.assign(i,{dataId:r||"ROOT_QUERY",result:n}))},t.prototype.writeFragment=function(e){var r=e.id,n=e.data,i=e.fragment,a=e.fragmentName,o=ht(e,["id","data","fragment","fragmentName"]);return this.write(Object.assign(o,{query:this.getFragmentDoc(i,a),dataId:r,result:n}))},t.prototype.updateQuery=function(e,r){return this.batch({update:function(n){var i=n.readQuery(e),a=r(i);return a==null?i:(n.writeQuery(m(m({},e),{data:a})),a)}})},t.prototype.updateFragment=function(e,r){return this.batch({update:function(n){var i=n.readFragment(e),a=r(i);return a==null?i:(n.writeFragment(m(m({},e),{data:a})),a)}})},t}();var xn=function(t){de(e,t);function e(r,n,i,a){var o,s=t.call(this,r)||this;if(s.message=r,s.path=n,s.query=i,s.variables=a,Array.isArray(s.path)){s.missing=s.message;for(var u=s.path.length-1;u>=0;--u)s.missing=(o={},o[s.path[u]]=s.missing,o)}else s.missing=s.path;return s.__proto__=e.prototype,s}return e}(Error);var he=Object.prototype.hasOwnProperty;function In(t){return t==null}function Oi(t,e){var r=t.__typename,n=t.id,i=t._id;if(typeof r=="string"&&(e&&(e.keyObject=In(n)?In(i)?void 0:{_id:i}:{id:n}),In(n)&&!In(i)&&(n=i),!In(n)))return"".concat(r,":").concat(typeof n=="number"||typeof n=="string"?n:JSON.stringify(n))}var Ic={dataIdFromObject:Oi,addTypename:!0,resultCaching:!0,canonizeResults:!1};function Dc(t){return jt(Ic,t)}function xi(t){var e=t.canonizeResults;return e===void 0?Ic.canonizeResults:e}function kc(t,e){return G(e)?t.get(e.__ref,"__typename"):e&&e.__typename}var mo=/^[_a-z][_0-9a-z]*/i;function st(t){var e=t.match(mo);return e?e[0]:t}function Ti(t,e,r){return z(e)?re(e)?e.every(function(n){return Ti(t,n,r)}):t.selections.every(function(n){if(ze(n)&&Et(n,r)){var i=Ze(n);return he.call(e,i)&&(!n.selectionSet||Ti(n.selectionSet,e[i],r))}return!0}):!1}function Ut(t){return z(t)&&!G(t)&&!re(t)}function Nc(){return new Ve}function Ii(t,e){var r=tr(nr(t));return{fragmentMap:r,lookupFragment:function(n){var i=r[n];return!i&&e&&(i=e.lookup(n)),i||null}}}var Di=Object.create(null),yo=function(){return Di},Ac=Object.create(null),qr=function(){function t(e,r){var n=this;this.policies=e,this.group=r,this.data=Object.create(null),this.rootIds=Object.create(null),this.refs=Object.create(null),this.getFieldValue=function(i,a){return bn(G(i)?n.get(i.__ref,a):i&&i[a])},this.canRead=function(i){return G(i)?n.has(i.__ref):typeof i=="object"},this.toReference=function(i,a){if(typeof i=="string")return mt(i);if(G(i))return i;var o=n.policies.identify(i)[0];if(o){var s=mt(o);return a&&n.merge(o,i),s}}}return t.prototype.toObject=function(){return m({},this.data)},t.prototype.has=function(e){return this.lookup(e,!0)!==void 0},t.prototype.get=function(e,r){if(this.group.depend(e,r),he.call(this.data,e)){var n=this.data[e];if(n&&he.call(n,r))return n[r]}if(r==="__typename"&&he.call(this.policies.rootTypenamesById,e))return this.policies.rootTypenamesById[e];if(this instanceof qt)return this.parent.get(e,r)},t.prototype.lookup=function(e,r){if(r&&this.group.depend(e,"__exists"),he.call(this.data,e))return this.data[e];if(this instanceof qt)return this.parent.lookup(e,r);if(this.policies.rootTypenamesById[e])return Object.create(null)},t.prototype.merge=function(e,r){var n=this,i;G(e)&&(e=e.__ref),G(r)&&(r=r.__ref);var a=typeof e=="string"?this.lookup(i=e):e,o=typeof r=="string"?this.lookup(i=r):r;if(!!o){__DEV__?I(typeof i=="string","store.merge expects a string ID"):I(typeof i=="string",1);var s=new Ve(If).merge(a,o);if(this.data[i]=s,s!==a&&(delete this.refs[i],this.group.caching)){var u=Object.create(null);a||(u.__exists=1),Object.keys(o).forEach(function(l){if(!a||a[l]!==s[l]){u[l]=1;var f=st(l);f!==l&&!n.policies.hasKeyArgs(s.__typename,f)&&(u[f]=1),s[l]===void 0&&!(n instanceof qt)&&delete s[l]}}),u.__typename&&!(a&&a.__typename)&&this.policies.rootTypenamesById[i]===s.__typename&&delete u.__typename,Object.keys(u).forEach(function(l){return n.group.dirty(i,l)})}}},t.prototype.modify=function(e,r){var n=this,i=this.lookup(e);if(i){var a=Object.create(null),o=!1,s=!0,u={DELETE:Di,INVALIDATE:Ac,isReference:G,toReference:this.toReference,canRead:this.canRead,readField:function(l,f){return n.policies.readField(typeof l=="string"?{fieldName:l,from:f||mt(e)}:l,{store:n})}};if(Object.keys(i).forEach(function(l){var f=st(l),d=i[l];if(d!==void 0){var h=typeof r=="function"?r:r[l]||r[f];if(h){var p=h===yo?Di:h(bn(d),m(m({},u),{fieldName:f,storeFieldName:l,storage:n.getStorage(e,l)}));p===Ac?n.group.dirty(e,l):(p===Di&&(p=void 0),p!==d&&(a[l]=p,o=!0,d=p))}d!==void 0&&(s=!1)}}),o)return this.merge(e,a),s&&(this instanceof qt?this.data[e]=void 0:delete this.data[e],this.group.dirty(e,"__exists")),!0}return!1},t.prototype.delete=function(e,r,n){var i,a=this.lookup(e);if(a){var o=this.getFieldValue(a,"__typename"),s=r&&n?this.policies.getStoreFieldName({typename:o,fieldName:r,args:n}):r;return this.modify(e,s?(i={},i[s]=yo,i):yo)}return!1},t.prototype.evict=function(e,r){var n=!1;return e.id&&(he.call(this.data,e.id)&&(n=this.delete(e.id,e.fieldName,e.args)),this instanceof qt&&this!==r&&(n=this.parent.evict(e,r)||n),(e.fieldName||n)&&this.group.dirty(e.id,e.fieldName||"__exists")),n},t.prototype.clear=function(){this.replace(null)},t.prototype.extract=function(){var e=this,r=this.toObject(),n=[];return this.getRootIdSet().forEach(function(i){he.call(e.policies.rootTypenamesById,i)||n.push(i)}),n.length&&(r.__META={extraRootIds:n.sort()}),r},t.prototype.replace=function(e){var r=this;if(Object.keys(this.data).forEach(function(a){e&&he.call(e,a)||r.delete(a)}),e){var n=e.__META,i=ht(e,["__META"]);Object.keys(i).forEach(function(a){r.merge(a,i[a])}),n&&n.extraRootIds.forEach(this.retain,this)}},t.prototype.retain=function(e){return this.rootIds[e]=(this.rootIds[e]||0)+1},t.prototype.release=function(e){if(this.rootIds[e]>0){var r=--this.rootIds[e];return r||delete this.rootIds[e],r}return 0},t.prototype.getRootIdSet=function(e){return e===void 0&&(e=new Set),Object.keys(this.rootIds).forEach(e.add,e),this instanceof qt?this.parent.getRootIdSet(e):Object.keys(this.policies.rootTypenamesById).forEach(e.add,e),e},t.prototype.gc=function(){var e=this,r=this.getRootIdSet(),n=this.toObject();r.forEach(function(o){he.call(n,o)&&(Object.keys(e.findChildRefIds(o)).forEach(r.add,r),delete n[o])});var i=Object.keys(n);if(i.length){for(var a=this;a instanceof qt;)a=a.parent;i.forEach(function(o){return a.delete(o)})}return i},t.prototype.findChildRefIds=function(e){if(!he.call(this.refs,e)){var r=this.refs[e]=Object.create(null),n=this.data[e];if(!n)return r;var i=new Set([n]);i.forEach(function(a){G(a)&&(r[a.__ref]=!0),z(a)&&Object.keys(a).forEach(function(o){var s=a[o];z(s)&&i.add(s)})})}return this.refs[e]},t.prototype.makeCacheKey=function(){return this.group.keyMaker.lookupArray(arguments)},t}();var Pc=function(){function t(e,r){r===void 0&&(r=null),this.caching=e,this.parent=r,this.d=null,this.resetCaching()}return t.prototype.resetCaching=function(){this.d=this.caching?Ei():null,this.keyMaker=new gt(et)},t.prototype.depend=function(e,r){if(this.d){this.d(go(e,r));var n=st(r);n!==r&&this.d(go(e,n)),this.parent&&this.parent.depend(e,r)}},t.prototype.dirty=function(e,r){this.d&&this.d.dirty(go(e,r),r==="__exists"?"forget":"setDirty")},t}();function go(t,e){return e+"#"+t}function vo(t,e){ur(t)&&t.group.depend(e,"__exists")}(function(t){var e=function(r){de(n,r);function n(i){var a=i.policies,o=i.resultCaching,s=o===void 0?!0:o,u=i.seed,l=r.call(this,a,new Pc(s))||this;return l.stump=new xf(l),l.storageTrie=new gt(et),u&&l.replace(u),l}return n.prototype.addLayer=function(i,a){return this.stump.addLayer(i,a)},n.prototype.removeLayer=function(){return this},n.prototype.getStorage=function(){return this.storageTrie.lookupArray(arguments)},n}(t);t.Root=e})(qr||(qr={}));var qt=function(t){de(e,t);function e(r,n,i,a){var o=t.call(this,n.policies,a)||this;return o.id=r,o.parent=n,o.replay=i,o.group=a,i(o),o}return e.prototype.addLayer=function(r,n){return new e(r,this,n,this.group)},e.prototype.removeLayer=function(r){var n=this,i=this.parent.removeLayer(r);return r===this.id?(this.group.caching&&Object.keys(this.data).forEach(function(a){var o=n.data[a],s=i.lookup(a);s?o?o!==s&&Object.keys(o).forEach(function(u){se(o[u],s[u])||n.group.dirty(a,u)}):(n.group.dirty(a,"__exists"),Object.keys(s).forEach(function(u){n.group.dirty(a,u)})):n.delete(a)}),i):i===this.parent?this:i.addLayer(this.id,this.replay)},e.prototype.toObject=function(){return m(m({},this.parent.toObject()),this.data)},e.prototype.findChildRefIds=function(r){var n=this.parent.findChildRefIds(r);return he.call(this.data,r)?m(m({},n),t.prototype.findChildRefIds.call(this,r)):n},e.prototype.getStorage=function(){for(var r=this.parent;r.parent;)r=r.parent;return r.getStorage.apply(r,arguments)},e}(qr),xf=function(t){de(e,t);function e(r){return t.call(this,"EntityStore.Stump",r,function(){},new Pc(r.group.caching,r.group))||this}return e.prototype.removeLayer=function(){return this},e.prototype.merge=function(){return this.parent.merge.apply(this.parent,arguments)},e}(qt);function If(t,e,r){var n=t[r],i=e[r];return se(n,i)?n:i}function ur(t){return!!(t instanceof qr&&t.group.caching)}function Df(t){return z(t)?re(t)?t.slice(0):m({__proto__:Object.getPrototypeOf(t)},t):t}var ki=function(){function t(){this.known=new(Fs?WeakSet:Set),this.pool=new gt(et),this.passes=new WeakMap,this.keysByJSON=new Map,this.empty=this.admit({})}return t.prototype.isKnown=function(e){return z(e)&&this.known.has(e)},t.prototype.pass=function(e){if(z(e)){var r=Df(e);return this.passes.set(r,e),r}return e},t.prototype.admit=function(e){var r=this;if(z(e)){var n=this.passes.get(e);if(n)return n;var i=Object.getPrototypeOf(e);switch(i){case Array.prototype:{if(this.known.has(e))return e;var a=e.map(this.admit,this),o=this.pool.lookupArray(a);return o.array||(this.known.add(o.array=a),__DEV__&&Object.freeze(a)),o.array}case null:case Object.prototype:{if(this.known.has(e))return e;var s=Object.getPrototypeOf(e),u=[s],l=this.sortedKeys(e);u.push(l.json);var f=u.length;l.sorted.forEach(function(p){u.push(r.admit(e[p]))});var o=this.pool.lookupArray(u);if(!o.object){var d=o.object=Object.create(s);this.known.add(d),l.sorted.forEach(function(p,y){d[p]=u[f+y]}),__DEV__&&Object.freeze(d)}return o.object}}}return e},t.prototype.sortedKeys=function(e){var r=Object.keys(e),n=this.pool.lookupArray(r);if(!n.keys){r.sort();var i=JSON.stringify(r);(n.keys=this.keysByJSON.get(i))||this.keysByJSON.set(i,n.keys={sorted:r,json:i})}return n.keys},t}();var Je=Object.assign(function(t){if(z(t)){bo===void 0&&Cc();var e=bo.admit(t),r=So.get(e);return r===void 0&&So.set(e,r=JSON.stringify(e)),r}return JSON.stringify(t)},{reset:Cc}),bo,So;function Cc(){bo=new ki,So=new(et?WeakMap:Map)}function Rc(t){return[t.selectionSet,t.objectOrReference,t.context,t.context.canonizeResults]}var Lc=function(){function t(e){var r=this;this.knownResults=new(et?WeakMap:Map),this.config=jt(e,{addTypename:e.addTypename!==!1,canonizeResults:xi(e)}),this.canon=e.canon||new ki,this.executeSelectionSet=cr(function(n){var i,a=n.context.canonizeResults,o=Rc(n);o[3]=!a;var s=(i=r.executeSelectionSet).peek.apply(i,o);return s?a?m(m({},s),{result:r.canon.admit(s.result)}):s:(vo(n.context.store,n.enclosingRef.__ref),r.execSelectionSetImpl(n))},{max:this.config.resultCacheMaxSize,keyArgs:Rc,makeCacheKey:function(n,i,a,o){if(ur(a.store))return a.store.makeCacheKey(n,G(i)?i.__ref:i,a.varString,o)}}),this.executeSubSelectedArray=cr(function(n){return vo(n.context.store,n.enclosingRef.__ref),r.execSubSelectedArrayImpl(n)},{max:this.config.resultCacheMaxSize,makeCacheKey:function(n){var i=n.field,a=n.array,o=n.context;if(ur(o.store))return o.store.makeCacheKey(i,a,o.varString)}})}return t.prototype.resetCanon=function(){this.canon=new ki},t.prototype.diffQueryAgainstStore=function(e){var r=e.store,n=e.query,i=e.rootId,a=i===void 0?"ROOT_QUERY":i,o=e.variables,s=e.returnPartialData,u=s===void 0?!0:s,l=e.canonizeResults,f=l===void 0?this.config.canonizeResults:l,d=this.config.cache.policies;o=m(m({},ar(yn(n))),o);var h=mt(a),p=this.executeSelectionSet({selectionSet:ir(n).selectionSet,objectOrReference:h,enclosingRef:h,context:m({store:r,query:n,policies:d,variables:o,varString:Je(o),canonizeResults:f},Ii(n,this.config.fragments))}),y;if(p.missing&&(y=[new xn(kf(p.missing),p.missing,n,o)],!u))throw y[0];return{result:p.result,complete:!y,missing:y}},t.prototype.isFresh=function(e,r,n,i){if(ur(i.store)&&this.knownResults.get(e)===n){var a=this.executeSelectionSet.peek(n,r,i,this.canon.isKnown(e));if(a&&e===a.result)return!0}return!1},t.prototype.execSelectionSetImpl=function(e){var r=this,n=e.selectionSet,i=e.objectOrReference,a=e.enclosingRef,o=e.context;if(G(i)&&!o.policies.rootTypenamesById[i.__ref]&&!o.store.has(i.__ref))return{result:this.canon.empty,missing:"Dangling reference to missing ".concat(i.__ref," object")};var s=o.variables,u=o.policies,l=o.store,f=l.getFieldValue(i,"__typename"),d=[],h,p=new Ve;this.config.addTypename&&typeof f=="string"&&!u.rootIdsByTypename[f]&&d.push({__typename:f});function y(w,O){var N;return w.missing&&(h=p.merge(h,(N={},N[O]=w.missing,N))),w.result}var g=new Set(n.selections);g.forEach(function(w){var O,N;if(!!Et(w,s))if(ze(w)){var A=u.readField({fieldName:w.name.value,field:w,variables:o.variables,from:i},o),k=Ze(w);A===void 0?or.added(w)||(h=p.merge(h,(O={},O[k]="Can't find field '".concat(w.name.value,"' on ").concat(G(i)?i.__ref+" object":"object "+JSON.stringify(i,null,2)),O))):re(A)?A=y(r.executeSubSelectedArray({field:w,array:A,enclosingRef:a,context:o}),k):w.selectionSet?A!=null&&(A=y(r.executeSelectionSet({selectionSet:w.selectionSet,objectOrReference:A,enclosingRef:G(A)?A:a,context:o}),k)):o.canonizeResults&&(A=r.canon.pass(A)),A!==void 0&&d.push((N={},N[k]=A,N))}else{var C=rr(w,o.lookupFragment);if(!C&&w.kind===ve.FRAGMENT_SPREAD)throw __DEV__?new $("No fragment named ".concat(w.name.value)):new $(5);C&&u.fragmentMatches(C,f)&&C.selectionSet.selections.forEach(g.add,g)}});var S=gn(d),T={result:S,missing:h},b=o.canonizeResults?this.canon.admit(T):bn(T);return b.result&&this.knownResults.set(b.result,n),b},t.prototype.execSubSelectedArrayImpl=function(e){var r=this,n=e.field,i=e.array,a=e.enclosingRef,o=e.context,s,u=new Ve;function l(f,d){var h;return f.missing&&(s=u.merge(s,(h={},h[d]=f.missing,h))),f.result}return n.selectionSet&&(i=i.filter(o.store.canRead)),i=i.map(function(f,d){return f===null?null:re(f)?l(r.executeSubSelectedArray({field:n,array:f,enclosingRef:a,context:o}),d):n.selectionSet?l(r.executeSelectionSet({selectionSet:n.selectionSet,objectOrReference:f,enclosingRef:G(f)?f:a,context:o}),d):(__DEV__&&Nf(o.store,n,f),f)}),{result:o.canonizeResults?this.canon.admit(i):i,missing:s}},t}();function kf(t){try{JSON.stringify(t,function(e,r){if(typeof r=="string")throw r;return r})}catch(e){return e}}function Nf(t,e,r){if(!e.selectionSet){var n=new Set([r]);n.forEach(function(i){z(i)&&(__DEV__?I(!G(i),"Missing selection set for object of type ".concat(kc(t,i)," returned for query field ").concat(e.name.value)):I(!G(i),6),Object.values(i).forEach(n.add,n))})}}var Vr=new $r,Fc=new WeakMap;function Dn(t){var e=Fc.get(t);return e||Fc.set(t,e={vars:new Set,dep:Ei()}),e}function wo(t){Dn(t).vars.forEach(function(e){return e.forgetCache(t)})}function Mc(t){Dn(t).vars.forEach(function(e){return e.attachCache(t)})}function Ni(t){var e=new Set,r=new Set,n=function(a){if(arguments.length>0){if(t!==a){t=a,e.forEach(function(u){Dn(u).dep.dirty(n),Af(u)});var o=Array.from(r);r.clear(),o.forEach(function(u){return u(t)})}}else{var s=Vr.getValue();s&&(i(s),Dn(s).dep(n))}return t};n.onNextChange=function(a){return r.add(a),function(){r.delete(a)}};var i=n.attachCache=function(a){return e.add(a),Dn(a).vars.add(n),n};return n.forgetCache=function(a){return e.delete(a)},n}function Af(t){t.broadcastWatches&&t.broadcastWatches()}var jc=Object.create(null);function _o(t){var e=JSON.stringify(t);return jc[e]||(jc[e]=Object.create(null))}function Eo(t){var e=_o(t);return e.keyFieldsFn||(e.keyFieldsFn=function(r,n){var i=function(o,s){return n.readField(s,o)},a=n.keyObject=Oo(t,function(o){var s=Br(n.storeObject,o,i);return s===void 0&&r!==n.storeObject&&he.call(r,o[0])&&(s=Br(r,o,Uc)),__DEV__?I(s!==void 0,"Missing field '".concat(o.join("."),"' while extracting keyFields from ").concat(JSON.stringify(r))):I(s!==void 0,2),s});return"".concat(n.typename,":").concat(JSON.stringify(a))})}function To(t){var e=_o(t);return e.keyArgsFn||(e.keyArgsFn=function(r,n){var i=n.field,a=n.variables,o=n.fieldName,s=Oo(t,function(l){var f=l[0],d=f.charAt(0);if(d==="@"){if(i&&we(i.directives)){var h=f.slice(1),p=i.directives.find(function(T){return T.name.value===h}),y=p&&Tt(p,a);return y&&Br(y,l.slice(1))}return}if(d==="$"){var g=f.slice(1);if(a&&he.call(a,g)){var S=l.slice(0);return S[0]=g,Br(a,S)}return}if(r)return Br(r,l)}),u=JSON.stringify(s);return(r||u!=="{}")&&(o+=":"+u),o})}function Oo(t,e){var r=new Ve;return $c(t).reduce(function(n,i){var a,o=e(i);if(o!==void 0){for(var s=i.length-1;s>=0;--s)o=(a={},a[i[s]]=o,a);n=r.merge(n,o)}return n},Object.create(null))}function $c(t){var e=_o(t);if(!e.paths){var r=e.paths=[],n=[];t.forEach(function(i,a){re(i)?($c(i).forEach(function(o){return r.push(n.concat(o))}),n.length=0):(n.push(i),re(t[a+1])||(r.push(n.slice(0)),n.length=0))})}return e.paths}function Uc(t,e){return t[e]}function Br(t,e,r){return r=r||Uc,qc(e.reduce(function n(i,a){return re(i)?i.map(function(o){return n(o,a)}):i&&r(i,a)},t))}function qc(t){return z(t)?re(t)?t.map(qc):Oo(Object.keys(t).sort(),function(e){return Br(t,e)}):t}hn.setStringify(Je);function xo(t){return t.args!==void 0?t.args:t.field?Tt(t.field,t.variables):null}var Pf=function(){},Vc=function(t,e){return e.fieldName},Bc=function(t,e,r){var n=r.mergeObjects;return n(t,e)},Qc=function(t,e){return e},Wc=function(){function t(e){this.config=e,this.typePolicies=Object.create(null),this.toBeAdded=Object.create(null),this.supertypeMap=new Map,this.fuzzySubtypes=new Map,this.rootIdsByTypename=Object.create(null),this.rootTypenamesById=Object.create(null),this.usingPossibleTypes=!1,this.config=m({dataIdFromObject:Oi},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)}return t.prototype.identify=function(e,r){var n,i=this,a=r&&(r.typename||((n=r.storeObject)===null||n===void 0?void 0:n.__typename))||e.__typename;if(a===this.rootTypenamesById.ROOT_QUERY)return["ROOT_QUERY"];for(var o=r&&r.storeObject||e,s=m(m({},r),{typename:a,storeObject:o,readField:r&&r.readField||function(){var h=Ai(arguments,o);return i.readField(h,{store:i.cache.data,variables:h.variables})}}),u,l=a&&this.getTypePolicy(a),f=l&&l.keyFn||this.config.dataIdFromObject;f;){var d=f(e,s);if(re(d))f=Eo(d);else{u=d;break}}return u=u?String(u):void 0,s.keyObject?[u,s.keyObject]:[u]},t.prototype.addTypePolicies=function(e){var r=this;Object.keys(e).forEach(function(n){var i=e[n],a=i.queryType,o=i.mutationType,s=i.subscriptionType,u=ht(i,["queryType","mutationType","subscriptionType"]);a&&r.setRootTypename("Query",n),o&&r.setRootTypename("Mutation",n),s&&r.setRootTypename("Subscription",n),he.call(r.toBeAdded,n)?r.toBeAdded[n].push(u):r.toBeAdded[n]=[u]})},t.prototype.updateTypePolicy=function(e,r){var n=this,i=this.getTypePolicy(e),a=r.keyFields,o=r.fields;function s(u,l){u.merge=typeof l=="function"?l:l===!0?Bc:l===!1?Qc:u.merge}s(i,r.merge),i.keyFn=a===!1?Pf:re(a)?Eo(a):typeof a=="function"?a:i.keyFn,o&&Object.keys(o).forEach(function(u){var l=n.getFieldPolicy(e,u,!0),f=o[u];if(typeof f=="function")l.read=f;else{var d=f.keyArgs,h=f.read,p=f.merge;l.keyFn=d===!1?Vc:re(d)?To(d):typeof d=="function"?d:l.keyFn,typeof h=="function"&&(l.read=h),s(l,p)}l.read&&l.merge&&(l.keyFn=l.keyFn||Vc)})},t.prototype.setRootTypename=function(e,r){r===void 0&&(r=e);var n="ROOT_"+e.toUpperCase(),i=this.rootTypenamesById[n];r!==i&&(__DEV__?I(!i||i===e,"Cannot change root ".concat(e," __typename more than once")):I(!i||i===e,3),i&&delete this.rootIdsByTypename[i],this.rootIdsByTypename[r]=n,this.rootTypenamesById[n]=r)},t.prototype.addPossibleTypes=function(e){var r=this;this.usingPossibleTypes=!0,Object.keys(e).forEach(function(n){r.getSupertypeSet(n,!0),e[n].forEach(function(i){r.getSupertypeSet(i,!0).add(n);var a=i.match(mo);(!a||a[0]!==i)&&r.fuzzySubtypes.set(i,new RegExp(i))})})},t.prototype.getTypePolicy=function(e){var r=this;if(!he.call(this.typePolicies,e)){var n=this.typePolicies[e]=Object.create(null);n.fields=Object.create(null);var i=this.supertypeMap.get(e);i&&i.size&&i.forEach(function(o){var s=r.getTypePolicy(o),u=s.fields,l=ht(s,["fields"]);Object.assign(n,l),Object.assign(n.fields,u)})}var a=this.toBeAdded[e];return a&&a.length&&a.splice(0).forEach(function(o){r.updateTypePolicy(e,o)}),this.typePolicies[e]},t.prototype.getFieldPolicy=function(e,r,n){if(e){var i=this.getTypePolicy(e).fields;return i[r]||n&&(i[r]=Object.create(null))}},t.prototype.getSupertypeSet=function(e,r){var n=this.supertypeMap.get(e);return!n&&r&&this.supertypeMap.set(e,n=new Set),n},t.prototype.fragmentMatches=function(e,r,n,i){var a=this;if(!e.typeCondition)return!0;if(!r)return!1;var o=e.typeCondition.name.value;if(r===o)return!0;if(this.usingPossibleTypes&&this.supertypeMap.has(o))for(var s=this.getSupertypeSet(r,!0),u=[s],l=function(y){var g=a.getSupertypeSet(y,!1);g&&g.size&&u.indexOf(g)<0&&u.push(g)},f=!!(n&&this.fuzzySubtypes.size),d=!1,h=0;h<u.length;++h){var p=u[h];if(p.has(o))return s.has(o)||(d&&__DEV__&&I.warn("Inferring subtype ".concat(r," of supertype ").concat(o)),s.add(o)),!0;p.forEach(l),f&&h===u.length-1&&Ti(e.selectionSet,n,i)&&(f=!1,d=!0,this.fuzzySubtypes.forEach(function(y,g){var S=r.match(y);S&&S[0]===r&&l(g)}))}return!1},t.prototype.hasKeyArgs=function(e,r){var n=this.getFieldPolicy(e,r,!1);return!!(n&&n.keyFn)},t.prototype.getStoreFieldName=function(e){var r=e.typename,n=e.fieldName,i=this.getFieldPolicy(r,n,!1),a,o=i&&i.keyFn;if(o&&r)for(var s={typename:r,fieldName:n,field:e.field||null,variables:e.variables},u=xo(e);o;){var l=o(u,s);if(re(l))o=To(l);else{a=l||n;break}}return a===void 0&&(a=e.field?La(e.field,e.variables):hn(n,xo(e))),a===!1?n:n===st(a)?a:n+":"+a},t.prototype.readField=function(e,r){var n=e.from;if(!!n){var i=e.field||e.fieldName;if(!!i){if(e.typename===void 0){var a=r.store.getFieldValue(n,"__typename");a&&(e.typename=a)}var o=this.getStoreFieldName(e),s=st(o),u=r.store.getFieldValue(n,o),l=this.getFieldPolicy(e.typename,s,!1),f=l&&l.read;if(f){var d=Gc(this,n,e,r,r.store.getStorage(G(n)?n.__ref:n,o));return Vr.withValue(this.cache,f,[u,d])}return u}}},t.prototype.getReadFunction=function(e,r){var n=this.getFieldPolicy(e,r,!1);return n&&n.read},t.prototype.getMergeFunction=function(e,r,n){var i=this.getFieldPolicy(e,r,!1),a=i&&i.merge;return!a&&n&&(i=this.getTypePolicy(n),a=i&&i.merge),a},t.prototype.runMergeFunction=function(e,r,n,i,a){var o=n.field,s=n.typename,u=n.merge;return u===Bc?Kc(i.store)(e,r):u===Qc?r:(i.overwrite&&(e=void 0),u(e,r,Gc(this,void 0,{typename:s,fieldName:o.name.value,field:o,variables:i.variables},i,a||Object.create(null))))},t}();function Gc(t,e,r,n,i){var a=t.getStoreFieldName(r),o=st(a),s=r.variables||n.variables,u=n.store,l=u.toReference,f=u.canRead;return{args:xo(r),field:r.field||null,fieldName:o,storeFieldName:a,variables:s,isReference:G,toReference:l,storage:i,cache:t.cache,canRead:f,readField:function(){return t.readField(Ai(arguments,e,s),n)},mergeObjects:Kc(n.store)}}function Ai(t,e,r){var n=t[0],i=t[1],a=t.length,o;return typeof n=="string"?o={fieldName:n,from:a>1?i:e}:(o=m({},n),he.call(o,"from")||(o.from=e)),__DEV__&&o.from===void 0&&__DEV__&&I.warn("Undefined 'from' passed to readField with arguments ".concat(Us(Array.from(t)))),o.variables===void 0&&(o.variables=r),o}function Kc(t){return function(r,n){if(re(r)||re(n))throw __DEV__?new $("Cannot automatically merge arrays"):new $(4);if(z(r)&&z(n)){var i=t.getFieldValue(r,"__typename"),a=t.getFieldValue(n,"__typename"),o=i&&a&&i!==a;if(o)return n;if(G(r)&&Ut(n))return t.merge(r.__ref,n),r;if(Ut(r)&&G(n))return t.merge(r,n.__ref),n;if(Ut(r)&&Ut(n))return m(m({},r),n)}return n}}function Io(t,e,r){var n="".concat(e).concat(r),i=t.flavors.get(n);return i||t.flavors.set(n,i=t.clientOnly===e&&t.deferred===r?t:m(m({},t),{clientOnly:e,deferred:r})),i}var Yc=function(){function t(e,r,n){this.cache=e,this.reader=r,this.fragments=n}return t.prototype.writeToStore=function(e,r){var n=this,i=r.query,a=r.result,o=r.dataId,s=r.variables,u=r.overwrite,l=yt(i),f=Nc();s=m(m({},ar(l)),s);var d=m(m({store:e,written:Object.create(null),merge:function(p,y){return f.merge(p,y)},variables:s,varString:Je(s)},Ii(i,this.fragments)),{overwrite:!!u,incomingById:new Map,clientOnly:!1,deferred:!1,flavors:new Map}),h=this.processSelectionSet({result:a||Object.create(null),dataId:o,selectionSet:l.selectionSet,mergeTree:{map:new Map},context:d});if(!G(h))throw __DEV__?new $("Could not identify object ".concat(JSON.stringify(a))):new $(7);return d.incomingById.forEach(function(p,y){var g=p.storeObject,S=p.mergeTree,T=p.fieldNodeSet,b=mt(y);if(S&&S.map.size){var w=n.applyMerges(S,b,g,d);if(G(w))return;g=w}if(__DEV__&&!d.overwrite){var O=Object.create(null);T.forEach(function(k){k.selectionSet&&(O[k.name.value]=!0)});var N=function(k){return O[st(k)]===!0},A=function(k){var C=S&&S.map.get(k);return Boolean(C&&C.info&&C.info.merge)};Object.keys(g).forEach(function(k){N(k)&&!A(k)&&Cf(b,g,k,d.store)})}e.merge(y,g)}),e.retain(h.__ref),h},t.prototype.processSelectionSet=function(e){var r=this,n=e.dataId,i=e.result,a=e.selectionSet,o=e.context,s=e.mergeTree,u=this.cache.policies,l=Object.create(null),f=n&&u.rootTypenamesById[n]||mn(i,a,o.fragmentMap)||n&&o.store.get(n,"__typename");typeof f=="string"&&(l.__typename=f);var d=function(){var w=Ai(arguments,l,o.variables);if(G(w.from)){var O=o.incomingById.get(w.from.__ref);if(O){var N=u.readField(m(m({},w),{from:O.storeObject}),o);if(N!==void 0)return N}}return u.readField(w,o)},h=new Set;this.flattenFields(a,i,o,f).forEach(function(w,O){var N,A=Ze(O),k=i[A];if(h.add(O),k!==void 0){var C=u.getStoreFieldName({typename:f,fieldName:O.name.value,field:O,variables:w.variables}),te=zc(s,C),Z=r.processFieldValue(k,O,O.selectionSet?Io(w,!1,!1):w,te),ft=void 0;O.selectionSet&&(G(Z)||Ut(Z))&&(ft=d("__typename",Z));var _t=u.getMergeFunction(f,O.name.value,ft);_t?te.info={field:O,typename:f,merge:_t}:Jc(s,C),l=w.merge(l,(N={},N[C]=Z,N))}else __DEV__&&!w.clientOnly&&!w.deferred&&!or.added(O)&&!u.getReadFunction(f,O.name.value)&&__DEV__&&I.error("Missing field '".concat(Ze(O),"' while writing result ").concat(JSON.stringify(i,null,2)).substring(0,1e3))});try{var p=u.identify(i,{typename:f,selectionSet:a,fragmentMap:o.fragmentMap,storeObject:l,readField:d}),y=p[0],g=p[1];n=n||y,g&&(l=o.merge(l,g))}catch(w){if(!n)throw w}if(typeof n=="string"){var S=mt(n),T=o.written[n]||(o.written[n]=[]);if(T.indexOf(a)>=0||(T.push(a),this.reader&&this.reader.isFresh(i,S,a,o)))return S;var b=o.incomingById.get(n);return b?(b.storeObject=o.merge(b.storeObject,l),b.mergeTree=Do(b.mergeTree,s),h.forEach(function(w){return b.fieldNodeSet.add(w)})):o.incomingById.set(n,{storeObject:l,mergeTree:Pi(s)?void 0:s,fieldNodeSet:h}),S}return l},t.prototype.processFieldValue=function(e,r,n,i){var a=this;return!r.selectionSet||e===null?__DEV__?pi(e):e:re(e)?e.map(function(o,s){var u=a.processFieldValue(o,r,n,zc(i,s));return Jc(i,s),u}):this.processSelectionSet({result:e,selectionSet:r.selectionSet,context:n,mergeTree:i})},t.prototype.flattenFields=function(e,r,n,i){i===void 0&&(i=mn(r,e,n.fragmentMap));var a=new Map,o=this.cache.policies,s=new gt(!1);return function u(l,f){var d=s.lookup(l,f.clientOnly,f.deferred);d.visited||(d.visited=!0,l.selections.forEach(function(h){if(!!Et(h,n.variables)){var p=f.clientOnly,y=f.deferred;if(!(p&&y)&&we(h.directives)&&h.directives.forEach(function(T){var b=T.name.value;if(b==="client"&&(p=!0),b==="defer"){var w=Tt(T,n.variables);(!w||w.if!==!1)&&(y=!0)}}),ze(h)){var g=a.get(h);g&&(p=p&&g.clientOnly,y=y&&g.deferred),a.set(h,Io(n,p,y))}else{var S=rr(h,n.lookupFragment);if(!S&&h.kind===ve.FRAGMENT_SPREAD)throw __DEV__?new $("No fragment named ".concat(h.name.value)):new $(8);S&&o.fragmentMatches(S,i,r,n.variables)&&u(S.selectionSet,Io(n,p,y))}}}))}(e,n),a},t.prototype.applyMerges=function(e,r,n,i,a){var o,s=this;if(e.map.size&&!G(n)){var u=!re(n)&&(G(r)||Ut(r))?r:void 0,l=n;u&&!a&&(a=[G(u)?u.__ref:u]);var f,d=function(h,p){return re(h)?typeof p=="number"?h[p]:void 0:i.store.getFieldValue(h,String(p))};e.map.forEach(function(h,p){var y=d(u,p),g=d(l,p);if(g!==void 0){a&&a.push(p);var S=s.applyMerges(h,y,g,i,a);S!==g&&(f=f||new Map,f.set(p,S)),a&&I(a.pop()===p)}}),f&&(n=re(l)?l.slice(0):m({},l),f.forEach(function(h,p){n[p]=h}))}return e.info?this.cache.policies.runMergeFunction(r,n,e.info,i,a&&(o=i.store).getStorage.apply(o,a)):n},t}();var Xc=[];function zc(t,e){var r=t.map;return r.has(e)||r.set(e,Xc.pop()||{map:new Map}),r.get(e)}function Do(t,e){if(t===e||!e||Pi(e))return t;if(!t||Pi(t))return e;var r=t.info&&e.info?m(m({},t.info),e.info):t.info||e.info,n=t.map.size&&e.map.size,i=n?new Map:t.map.size?t.map:e.map,a={info:r,map:i};if(n){var o=new Set(e.map.keys());t.map.forEach(function(s,u){a.map.set(u,Do(s,e.map.get(u))),o.delete(u)}),o.forEach(function(s){a.map.set(s,Do(e.map.get(s),t.map.get(s)))})}return a}function Pi(t){return!t||!(t.info||t.map.size)}function Jc(t,e){var r=t.map,n=r.get(e);n&&Pi(n)&&(Xc.push(n),r.delete(e))}var Hc=new Set;function Cf(t,e,r,n){var i=function(d){var h=n.getFieldValue(d,r);return typeof h=="object"&&h},a=i(t);if(!!a){var o=i(e);if(!!o&&!G(a)&&!se(a,o)&&!Object.keys(a).every(function(d){return n.getFieldValue(o,d)!==void 0})){var s=n.getFieldValue(t,"__typename")||n.getFieldValue(e,"__typename"),u=st(r),l="".concat(s,".").concat(u);if(!Hc.has(l)){Hc.add(l);var f=[];!re(a)&&!re(o)&&[a,o].forEach(function(d){var h=n.getFieldValue(d,"__typename");typeof h=="string"&&!f.includes(h)&&f.push(h)}),__DEV__&&I.warn("Cache data may be lost when replacing the ".concat(u," field of a ").concat(s,` object.
37
37
 
38
38
  To address this problem (which is not a bug in Apollo Client), `).concat(f.length?"either ensure all objects of type "+f.join(" and ")+" have an ID or a custom merge function, or ":"","define a custom merge function for the ").concat(l,` field, so InMemoryCache can safely merge these objects:
39
39
 
@@ -44,21 +44,21 @@ For more information about these options, please refer to the documentation:
44
44
 
45
45
  * Ensuring entity objects have IDs: https://go.apollo.dev/c/generating-unique-identifiers
46
46
  * Defining custom merge functions: https://go.apollo.dev/c/merging-non-normalized-objects
47
- `))}}}}var Ai=function(t){de(e,t);function e(r){r===void 0&&(r={});var n=t.call(this)||this;return n.watches=new Set,n.typenameDocumentCache=new Map,n.makeVar=Ii,n.txCount=0,n.config=Oc(r),n.addTypename=!!n.config.addTypename,n.policies=new Bc({cache:n,dataIdFromObject:n.config.dataIdFromObject,possibleTypes:n.config.possibleTypes,typePolicies:n.config.typePolicies}),n.init(),n}return e.prototype.init=function(){var r=this.data=new qr.Root({policies:this.policies,resultCaching:this.config.resultCaching});this.optimisticData=r.stump,this.resetResultCache()},e.prototype.resetResultCache=function(r){var n=this,i=this.storeReader,a=this.config.fragments;this.storeWriter=new zc(this,this.storeReader=new Pc({cache:this,addTypename:this.addTypename,resultCacheMaxSize:this.config.resultCacheMaxSize,canonizeResults:Ei(this.config),canon:r?void 0:i&&i.canon,fragments:a}),a),this.maybeBroadcastWatch=cr(function(o,s){return n.broadcastWatch(o,s)},{max:this.config.resultCacheMaxSize,makeCacheKey:function(o){var s=o.optimistic?n.optimisticData:n.data;if(ur(s)){var u=o.optimistic,l=o.id,f=o.variables;return s.makeCacheKey(o.query,o.callback,Je({optimistic:u,id:l,variables:f}))}}}),new Set([this.data.group,this.optimisticData.group]).forEach(function(o){return o.resetCaching()})},e.prototype.restore=function(r){return this.init(),r&&this.data.replace(r),this},e.prototype.extract=function(r){return r===void 0&&(r=!1),(r?this.optimisticData:this.data).extract()},e.prototype.read=function(r){var n=r.returnPartialData,i=n===void 0?!1:n;try{return this.storeReader.diffQueryAgainstStore(m(m({},r),{store:r.optimistic?this.optimisticData:this.data,config:this.config,returnPartialData:i})).result||null}catch(a){if(a instanceof Tn)return null;throw a}},e.prototype.write=function(r){try{return++this.txCount,this.storeWriter.writeToStore(this.data,r)}finally{!--this.txCount&&r.broadcast!==!1&&this.broadcastWatches()}},e.prototype.modify=function(r){if(he.call(r,"id")&&!r.id)return!1;var n=r.optimistic?this.optimisticData:this.data;try{return++this.txCount,n.modify(r.id||"ROOT_QUERY",r.fields)}finally{!--this.txCount&&r.broadcast!==!1&&this.broadcastWatches()}},e.prototype.diff=function(r){return this.storeReader.diffQueryAgainstStore(m(m({},r),{store:r.optimistic?this.optimisticData:this.data,rootId:r.id||"ROOT_QUERY",config:this.config}))},e.prototype.watch=function(r){var n=this;return this.watches.size||Rc(this),this.watches.add(r),r.immediate&&this.maybeBroadcastWatch(r),function(){n.watches.delete(r)&&!n.watches.size&&go(n),n.maybeBroadcastWatch.forget(r)}},e.prototype.gc=function(r){Je.reset();var n=this.optimisticData.gc();return r&&!this.txCount&&(r.resetResultCache?this.resetResultCache(r.resetResultIdentities):r.resetResultIdentities&&this.storeReader.resetCanon()),n},e.prototype.retain=function(r,n){return(n?this.optimisticData:this.data).retain(r)},e.prototype.release=function(r,n){return(n?this.optimisticData:this.data).release(r)},e.prototype.identify=function(r){if(Q(r))return r.__ref;try{return this.policies.identify(r)[0]}catch(n){__DEV__&&I.warn(n)}},e.prototype.evict=function(r){if(!r.id){if(he.call(r,"id"))return!1;r=m(m({},r),{id:"ROOT_QUERY"})}try{return++this.txCount,this.optimisticData.evict(r,this.data)}finally{!--this.txCount&&r.broadcast!==!1&&this.broadcastWatches()}},e.prototype.reset=function(r){var n=this;return this.init(),Je.reset(),r&&r.discardWatches?(this.watches.forEach(function(i){return n.maybeBroadcastWatch.forget(i)}),this.watches.clear(),go(this)):this.broadcastWatches(),Promise.resolve()},e.prototype.removeOptimistic=function(r){var n=this.optimisticData.removeLayer(r);n!==this.optimisticData&&(this.optimisticData=n,this.broadcastWatches())},e.prototype.batch=function(r){var n=this,i=r.update,a=r.optimistic,o=a===void 0?!0:a,s=r.removeOptimistic,u=r.onWatchUpdated,l,f=function(h){var p=n,y=p.data,v=p.optimisticData;++n.txCount,h&&(n.data=n.optimisticData=h);try{return l=i(n)}finally{--n.txCount,n.data=y,n.optimisticData=v}},d=new Set;return u&&!this.txCount&&this.broadcastWatches(m(m({},r),{onWatchUpdated:function(h){return d.add(h),!1}})),typeof o=="string"?this.optimisticData=this.optimisticData.addLayer(o,f):o===!1?f(this.data):f(),typeof s=="string"&&(this.optimisticData=this.optimisticData.removeLayer(s)),u&&d.size?(this.broadcastWatches(m(m({},r),{onWatchUpdated:function(h,p){var y=u.call(this,h,p);return y!==!1&&d.delete(h),y}})),d.size&&d.forEach(function(h){return n.maybeBroadcastWatch.dirty(h)})):this.broadcastWatches(r),l},e.prototype.performTransaction=function(r,n){return this.batch({update:r,optimistic:n||n!==null})},e.prototype.transformDocument=function(r){if(this.addTypename){var n=this.typenameDocumentCache.get(r);return n||(n=or(r),this.typenameDocumentCache.set(r,n),this.typenameDocumentCache.set(n,n)),n}return r},e.prototype.transformForLink=function(r){var n=this.config.fragments;return n?n.transform(r):r},e.prototype.broadcastWatches=function(r){var n=this;this.txCount||this.watches.forEach(function(i){return n.maybeBroadcastWatch(i,r)})},e.prototype.broadcastWatch=function(r,n){var i=r.lastDiff,a=this.diff(r);n&&(r.optimistic&&typeof n.optimistic=="string"&&(a.fromOptimisticTransaction=!0),n.onWatchUpdated&&n.onWatchUpdated.call(this,r,a,i)===!1)||(!i||!oe(i.result,a.result))&&r.callback(r.lastDiff=a,i)},e}(lo);function Hc(t){return t.hasOwnProperty("graphQLErrors")}var Nf=function(t){var e="";if(we(t.graphQLErrors)||we(t.clientErrors)){var r=(t.graphQLErrors||[]).concat(t.clientErrors||[]);r.forEach(function(n){var i=n?n.message:"Error message not found.";e+="".concat(i,`
47
+ `))}}}}var Ci=function(t){de(e,t);function e(r){r===void 0&&(r={});var n=t.call(this)||this;return n.watches=new Set,n.typenameDocumentCache=new Map,n.makeVar=Ni,n.txCount=0,n.config=Dc(r),n.addTypename=!!n.config.addTypename,n.policies=new Wc({cache:n,dataIdFromObject:n.config.dataIdFromObject,possibleTypes:n.config.possibleTypes,typePolicies:n.config.typePolicies}),n.init(),n}return e.prototype.init=function(){var r=this.data=new qr.Root({policies:this.policies,resultCaching:this.config.resultCaching});this.optimisticData=r.stump,this.resetResultCache()},e.prototype.resetResultCache=function(r){var n=this,i=this.storeReader,a=this.config.fragments;this.storeWriter=new Yc(this,this.storeReader=new Lc({cache:this,addTypename:this.addTypename,resultCacheMaxSize:this.config.resultCacheMaxSize,canonizeResults:xi(this.config),canon:r?void 0:i&&i.canon,fragments:a}),a),this.maybeBroadcastWatch=cr(function(o,s){return n.broadcastWatch(o,s)},{max:this.config.resultCacheMaxSize,makeCacheKey:function(o){var s=o.optimistic?n.optimisticData:n.data;if(ur(s)){var u=o.optimistic,l=o.id,f=o.variables;return s.makeCacheKey(o.query,o.callback,Je({optimistic:u,id:l,variables:f}))}}}),new Set([this.data.group,this.optimisticData.group]).forEach(function(o){return o.resetCaching()})},e.prototype.restore=function(r){return this.init(),r&&this.data.replace(r),this},e.prototype.extract=function(r){return r===void 0&&(r=!1),(r?this.optimisticData:this.data).extract()},e.prototype.read=function(r){var n=r.returnPartialData,i=n===void 0?!1:n;try{return this.storeReader.diffQueryAgainstStore(m(m({},r),{store:r.optimistic?this.optimisticData:this.data,config:this.config,returnPartialData:i})).result||null}catch(a){if(a instanceof xn)return null;throw a}},e.prototype.write=function(r){try{return++this.txCount,this.storeWriter.writeToStore(this.data,r)}finally{!--this.txCount&&r.broadcast!==!1&&this.broadcastWatches()}},e.prototype.modify=function(r){if(he.call(r,"id")&&!r.id)return!1;var n=r.optimistic?this.optimisticData:this.data;try{return++this.txCount,n.modify(r.id||"ROOT_QUERY",r.fields)}finally{!--this.txCount&&r.broadcast!==!1&&this.broadcastWatches()}},e.prototype.diff=function(r){return this.storeReader.diffQueryAgainstStore(m(m({},r),{store:r.optimistic?this.optimisticData:this.data,rootId:r.id||"ROOT_QUERY",config:this.config}))},e.prototype.watch=function(r){var n=this;return this.watches.size||Mc(this),this.watches.add(r),r.immediate&&this.maybeBroadcastWatch(r),function(){n.watches.delete(r)&&!n.watches.size&&wo(n),n.maybeBroadcastWatch.forget(r)}},e.prototype.gc=function(r){Je.reset();var n=this.optimisticData.gc();return r&&!this.txCount&&(r.resetResultCache?this.resetResultCache(r.resetResultIdentities):r.resetResultIdentities&&this.storeReader.resetCanon()),n},e.prototype.retain=function(r,n){return(n?this.optimisticData:this.data).retain(r)},e.prototype.release=function(r,n){return(n?this.optimisticData:this.data).release(r)},e.prototype.identify=function(r){if(G(r))return r.__ref;try{return this.policies.identify(r)[0]}catch(n){__DEV__&&I.warn(n)}},e.prototype.evict=function(r){if(!r.id){if(he.call(r,"id"))return!1;r=m(m({},r),{id:"ROOT_QUERY"})}try{return++this.txCount,this.optimisticData.evict(r,this.data)}finally{!--this.txCount&&r.broadcast!==!1&&this.broadcastWatches()}},e.prototype.reset=function(r){var n=this;return this.init(),Je.reset(),r&&r.discardWatches?(this.watches.forEach(function(i){return n.maybeBroadcastWatch.forget(i)}),this.watches.clear(),wo(this)):this.broadcastWatches(),Promise.resolve()},e.prototype.removeOptimistic=function(r){var n=this.optimisticData.removeLayer(r);n!==this.optimisticData&&(this.optimisticData=n,this.broadcastWatches())},e.prototype.batch=function(r){var n=this,i=r.update,a=r.optimistic,o=a===void 0?!0:a,s=r.removeOptimistic,u=r.onWatchUpdated,l,f=function(h){var p=n,y=p.data,g=p.optimisticData;++n.txCount,h&&(n.data=n.optimisticData=h);try{return l=i(n)}finally{--n.txCount,n.data=y,n.optimisticData=g}},d=new Set;return u&&!this.txCount&&this.broadcastWatches(m(m({},r),{onWatchUpdated:function(h){return d.add(h),!1}})),typeof o=="string"?this.optimisticData=this.optimisticData.addLayer(o,f):o===!1?f(this.data):f(),typeof s=="string"&&(this.optimisticData=this.optimisticData.removeLayer(s)),u&&d.size?(this.broadcastWatches(m(m({},r),{onWatchUpdated:function(h,p){var y=u.call(this,h,p);return y!==!1&&d.delete(h),y}})),d.size&&d.forEach(function(h){return n.maybeBroadcastWatch.dirty(h)})):this.broadcastWatches(r),l},e.prototype.performTransaction=function(r,n){return this.batch({update:r,optimistic:n||n!==null})},e.prototype.transformDocument=function(r){if(this.addTypename){var n=this.typenameDocumentCache.get(r);return n||(n=or(r),this.typenameDocumentCache.set(r,n),this.typenameDocumentCache.set(n,n)),n}return r},e.prototype.transformForLink=function(r){var n=this.config.fragments;return n?n.transform(r):r},e.prototype.broadcastWatches=function(r){var n=this;this.txCount||this.watches.forEach(function(i){return n.maybeBroadcastWatch(i,r)})},e.prototype.broadcastWatch=function(r,n){var i=r.lastDiff,a=this.diff(r);n&&(r.optimistic&&typeof n.optimistic=="string"&&(a.fromOptimisticTransaction=!0),n.onWatchUpdated&&n.onWatchUpdated.call(this,r,a,i)===!1)||(!i||!se(i.result,a.result))&&r.callback(r.lastDiff=a,i)},e}(ho);function Zc(t){return t.hasOwnProperty("graphQLErrors")}var Rf=function(t){var e="";if(we(t.graphQLErrors)||we(t.clientErrors)){var r=(t.graphQLErrors||[]).concat(t.clientErrors||[]);r.forEach(function(n){var i=n?n.message:"Error message not found.";e+="".concat(i,`
48
48
  `)})}return t.networkError&&(e+="".concat(t.networkError.message,`
49
- `)),e=e.replace(/\n$/,""),e},Ot=function(t){de(e,t);function e(r){var n=r.graphQLErrors,i=r.clientErrors,a=r.networkError,o=r.errorMessage,s=r.extraInfo,u=t.call(this,o)||this;return u.name="ApolloError",u.graphQLErrors=n||[],u.clientErrors=i||[],u.networkError=a||null,u.message=o||Nf(u),u.extraInfo=s,u.__proto__=e.prototype,u}return e}(Error);var X;(function(t){t[t.loading=1]="loading",t[t.setVariables=2]="setVariables",t[t.fetchMore=3]="fetchMore",t[t.refetch=4]="refetch",t[t.poll=6]="poll",t[t.ready=7]="ready",t[t.error=8]="error"})(X||(X={}));function Vt(t){return t?t<7:!1}var Pf=Object.assign,Cf=Object.hasOwnProperty,Ni=function(t){de(e,t);function e(r){var n=r.queryManager,i=r.queryInfo,a=r.options,o=t.call(this,function(S){try{var E=S._subscription._observer;E&&!E.error&&(E.error=Rf)}catch{}var b=!o.observers.size;o.observers.add(S);var w=o.last;return w&&w.error?S.error&&S.error(w.error):w&&w.result&&S.next&&S.next(w.result),b&&o.reobserve().catch(function(){}),function(){o.observers.delete(S)&&!o.observers.size&&o.tearDownQuery()}})||this;o.observers=new Set,o.subscriptions=new Set,o.queryInfo=i,o.queryManager=n,o.isTornDown=!1;var s=n.defaultOptions.watchQuery,u=s===void 0?{}:s,l=u.fetchPolicy,f=l===void 0?"cache-first":l,d=a.fetchPolicy,h=d===void 0?f:d,p=a.initialFetchPolicy,y=p===void 0?h==="standby"?f:h:p;o.options=m(m({},a),{initialFetchPolicy:y,fetchPolicy:h}),o.queryId=i.queryId||n.generateQueryId();var v=yt(o.query);return o.queryName=v&&v.name&&v.name.value,o}return Object.defineProperty(e.prototype,"query",{get:function(){return this.queryManager.transform(this.options.query).document},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"variables",{get:function(){return this.options.variables},enumerable:!1,configurable:!0}),e.prototype.result=function(){var r=this;return new Promise(function(n,i){var a={next:function(s){n(s),r.observers.delete(a),r.observers.size||r.queryManager.removeQuery(r.queryId),setTimeout(function(){o.unsubscribe()},0)},error:i},o=r.subscribe(a)})},e.prototype.getCurrentResult=function(r){r===void 0&&(r=!0);var n=this.getLastResult(!0),i=this.queryInfo.networkStatus||n&&n.networkStatus||X.ready,a=m(m({},n),{loading:Vt(i),networkStatus:i}),o=this.options.fetchPolicy,s=o===void 0?"cache-first":o;if(!(s==="network-only"||s==="no-cache"||s==="standby"||this.queryManager.transform(this.options.query).hasForcedResolvers)){var u=this.queryInfo.getDiff();(u.complete||this.options.returnPartialData)&&(a.data=u.result),oe(a.data,{})&&(a.data=void 0),u.complete?(delete a.partial,u.complete&&a.networkStatus===X.loading&&(s==="cache-first"||s==="cache-only")&&(a.networkStatus=X.ready,a.loading=!1)):a.partial=!0,__DEV__&&!u.complete&&!this.options.partialRefetch&&!a.loading&&!a.data&&!a.error&&Io(u.missing)}return r&&this.updateLastResult(a),a},e.prototype.isDifferentFromLastResult=function(r,n){return!this.last||!oe(this.last.result,r)||n&&!oe(this.last.variables,n)},e.prototype.getLast=function(r,n){var i=this.last;if(i&&i[r]&&(!n||oe(i.variables,this.variables)))return i[r]},e.prototype.getLastResult=function(r){return this.getLast("result",r)},e.prototype.getLastError=function(r){return this.getLast("error",r)},e.prototype.resetLastResults=function(){delete this.last,this.isTornDown=!1},e.prototype.resetQueryStoreErrors=function(){this.queryManager.resetErrors(this.queryId)},e.prototype.refetch=function(r){var n,i={pollInterval:0},a=this.options.fetchPolicy;if(a==="cache-and-network"?i.fetchPolicy=a:a==="no-cache"?i.fetchPolicy="no-cache":i.fetchPolicy="network-only",__DEV__&&r&&Cf.call(r,"variables")){var o=yn(this.query),s=o.variableDefinitions;(!s||!s.some(function(u){return u.variable.name.value==="variables"}))&&__DEV__&&I.warn("Called refetch(".concat(JSON.stringify(r),") for query ").concat(((n=o.name)===null||n===void 0?void 0:n.value)||JSON.stringify(o),`, which does not declare a $variables variable.
50
- Did you mean to call refetch(variables) instead of refetch({ variables })?`))}return r&&!oe(this.options.variables,r)&&(i.variables=this.options.variables=m(m({},this.options.variables),r)),this.queryInfo.resetLastWrite(),this.reobserve(i,X.refetch)},e.prototype.fetchMore=function(r){var n=this,i=m(m({},r.query?r:m(m(m(m({},this.options),{query:this.query}),r),{variables:m(m({},this.options.variables),r.variables)})),{fetchPolicy:"no-cache"}),a=this.queryManager.generateQueryId(),o=this.queryInfo,s=o.networkStatus;o.networkStatus=X.fetchMore,i.notifyOnNetworkStatusChange&&this.observe();var u=new Set;return this.queryManager.fetchQuery(a,i,X.fetchMore).then(function(l){return n.queryManager.removeQuery(a),o.networkStatus===X.fetchMore&&(o.networkStatus=s),n.queryManager.cache.batch({update:function(f){var d=r.updateQuery;d?f.updateQuery({query:n.query,variables:n.variables,returnPartialData:!0,optimistic:!1},function(h){return d(h,{fetchMoreResult:l.data,variables:i.variables})}):f.writeQuery({query:i.query,variables:i.variables,data:l.data})},onWatchUpdated:function(f){u.add(f.query)}}),l}).finally(function(){u.has(n.query)||To(n)})},e.prototype.subscribeToMore=function(r){var n=this,i=this.queryManager.startGraphQLSubscription({query:r.document,variables:r.variables,context:r.context}).subscribe({next:function(a){var o=r.updateQuery;o&&n.updateQuery(function(s,u){var l=u.variables;return o(s,{subscriptionData:a,variables:l})})},error:function(a){if(r.onError){r.onError(a);return}__DEV__&&I.error("Unhandled GraphQL subscription error",a)}});return this.subscriptions.add(i),function(){n.subscriptions.delete(i)&&i.unsubscribe()}},e.prototype.setOptions=function(r){return this.reobserve(r)},e.prototype.setVariables=function(r){return oe(this.variables,r)?this.observers.size?this.result():Promise.resolve():(this.options.variables=r,this.observers.size?this.reobserve({fetchPolicy:this.options.initialFetchPolicy,variables:r},X.setVariables):Promise.resolve())},e.prototype.updateQuery=function(r){var n=this.queryManager,i=n.cache.diff({query:this.options.query,variables:this.variables,returnPartialData:!0,optimistic:!1}).result,a=r(i,{variables:this.variables});a&&(n.cache.writeQuery({query:this.options.query,data:a,variables:this.variables}),n.broadcastQueries())},e.prototype.startPolling=function(r){this.options.pollInterval=r,this.updatePolling()},e.prototype.stopPolling=function(){this.options.pollInterval=0,this.updatePolling()},e.prototype.applyNextFetchPolicy=function(r,n){if(n.nextFetchPolicy){var i=n.fetchPolicy,a=i===void 0?"cache-first":i,o=n.initialFetchPolicy,s=o===void 0?a:o;a==="standby"||(typeof n.nextFetchPolicy=="function"?n.fetchPolicy=n.nextFetchPolicy(a,{reason:r,options:n,observable:this,initialFetchPolicy:s}):r==="variables-changed"?n.fetchPolicy=s:n.fetchPolicy=n.nextFetchPolicy)}return n.fetchPolicy},e.prototype.fetch=function(r,n){return this.queryManager.setObservableQuery(this),this.queryManager.fetchQueryObservable(this.queryId,r,n)},e.prototype.updatePolling=function(){var r=this;if(!this.queryManager.ssrMode){var n=this,i=n.pollingInfo,a=n.options.pollInterval;if(!a){i&&(clearTimeout(i.timeout),delete this.pollingInfo);return}if(!(i&&i.interval===a)){__DEV__?I(a,"Attempted to start a polling query without a polling interval."):I(a,13);var o=i||(this.pollingInfo={});o.interval=a;var s=function(){r.pollingInfo&&(Vt(r.queryInfo.networkStatus)?u():r.reobserve({fetchPolicy:r.options.initialFetchPolicy==="no-cache"?"no-cache":"network-only"},X.poll).then(u,u))},u=function(){var l=r.pollingInfo;l&&(clearTimeout(l.timeout),l.timeout=setTimeout(s,l.interval))};u()}}},e.prototype.updateLastResult=function(r,n){return n===void 0&&(n=this.variables),this.last=m(m({},this.last),{result:this.queryManager.assumeImmutableResults?r:ui(r),variables:n}),we(r.errors)||delete this.last.error,this.last},e.prototype.reobserve=function(r,n){var i=this;this.isTornDown=!1;var a=n===X.refetch||n===X.fetchMore||n===X.poll,o=this.options.variables,s=this.options.fetchPolicy,u=jt(this.options,r||{}),l=a?u:Pf(this.options,u);a||(this.updatePolling(),r&&r.variables&&!oe(r.variables,o)&&l.fetchPolicy!=="standby"&&l.fetchPolicy===s&&(this.applyNextFetchPolicy("variables-changed",l),n===void 0&&(n=X.setVariables)));var f=l.variables&&m({},l.variables),d=this.fetch(l,n),h={next:function(p){i.reportResult(p,f)},error:function(p){i.reportError(p,f)}};return a||(this.concast&&this.observer&&this.concast.removeObserver(this.observer),this.concast=d,this.observer=h),d.addObserver(h),d.promise},e.prototype.observe=function(){this.reportResult(this.getCurrentResult(!1),this.variables)},e.prototype.reportResult=function(r,n){var i=this.getLastError();(i||this.isDifferentFromLastResult(r,n))&&((i||!r.partial||this.options.returnPartialData)&&this.updateLastResult(r,n),sr(this.observers,"next",r))},e.prototype.reportError=function(r,n){var i=m(m({},this.getLastResult()),{error:r,errors:r.graphQLErrors,networkStatus:X.error,loading:!1});this.updateLastResult(i,n),sr(this.observers,"error",this.last.error=r)},e.prototype.hasObservers=function(){return this.observers.size>0},e.prototype.tearDownQuery=function(){this.isTornDown||(this.concast&&this.observer&&(this.concast.removeObserver(this.observer),delete this.concast,delete this.observer),this.stopPolling(),this.subscriptions.forEach(function(r){return r.unsubscribe()}),this.subscriptions.clear(),this.queryManager.stopQuery(this.queryId),this.observers.clear(),this.isTornDown=!0)},e}(B);fi(Ni);function To(t){var e=t.options,r=e.fetchPolicy,n=e.nextFetchPolicy;return r==="cache-and-network"||r==="network-only"?t.reobserve({fetchPolicy:"cache-first",nextFetchPolicy:function(){return this.nextFetchPolicy=n,typeof n=="function"?n.apply(this,arguments):r}}):t.reobserve()}function Rf(t){__DEV__&&I.error("Unhandled error",t.message,t.stack)}function Io(t){__DEV__&&t&&__DEV__&&I.debug("Missing cache result fields: ".concat(JSON.stringify(t)),t)}var Pi=function(){function t(e){var r=e.cache,n=e.client,i=e.resolvers,a=e.fragmentMatcher;this.selectionsToResolveCache=new WeakMap,this.cache=r,n&&(this.client=n),i&&this.addResolvers(i),a&&this.setFragmentMatcher(a)}return t.prototype.addResolvers=function(e){var r=this;this.resolvers=this.resolvers||{},Array.isArray(e)?e.forEach(function(n){r.resolvers=$a(r.resolvers,n)}):this.resolvers=$a(this.resolvers,e)},t.prototype.setResolvers=function(e){this.resolvers={},this.addResolvers(e)},t.prototype.getResolvers=function(){return this.resolvers||{}},t.prototype.runResolvers=function(e){var r=e.document,n=e.remoteResult,i=e.context,a=e.variables,o=e.onlyRunForcedResolvers,s=o===void 0?!1:o;return nt(this,void 0,void 0,function(){return it(this,function(u){return r?[2,this.resolveDocument(r,n.data,i,a,this.fragmentMatcher,s).then(function(l){return m(m({},n),{data:l.result})})]:[2,n]})})},t.prototype.setFragmentMatcher=function(e){this.fragmentMatcher=e},t.prototype.getFragmentMatcher=function(){return this.fragmentMatcher},t.prototype.clientQuery=function(e){return Nr(["client"],e)&&this.resolvers?e:null},t.prototype.serverQuery=function(e){return ja(e)},t.prototype.prepareContext=function(e){var r=this.cache;return m(m({},e),{cache:r,getCacheKey:function(n){return r.identify(n)}})},t.prototype.addExportedVariables=function(e,r,n){return r===void 0&&(r={}),n===void 0&&(n={}),nt(this,void 0,void 0,function(){return it(this,function(i){return e?[2,this.resolveDocument(e,this.buildRootValueFromCache(e,r)||{},this.prepareContext(n),r).then(function(a){return m(m({},r),a.exportedVariables)})]:[2,m({},r)]})})},t.prototype.shouldForceResolvers=function(e){var r=!1;return Ne(e,{Directive:{enter:function(n){if(n.name.value==="client"&&n.arguments&&(r=n.arguments.some(function(i){return i.name.value==="always"&&i.value.kind==="BooleanValue"&&i.value.value===!0}),r))return er}}}),r},t.prototype.buildRootValueFromCache=function(e,r){return this.cache.diff({query:Ma(e),variables:r,returnPartialData:!0,optimistic:!1}).result},t.prototype.resolveDocument=function(e,r,n,i,a,o){return n===void 0&&(n={}),i===void 0&&(i={}),a===void 0&&(a=function(){return!0}),o===void 0&&(o=!1),nt(this,void 0,void 0,function(){var s,u,l,f,d,h,p,y,v,S,E;return it(this,function(b){return s=ir(e),u=nr(e),l=tr(u),f=this.collectSelectionsToResolve(s,l),d=s.operation,h=d?d.charAt(0).toUpperCase()+d.slice(1):"Query",p=this,y=p.cache,v=p.client,S={fragmentMap:l,context:m(m({},n),{cache:y,client:v}),variables:i,fragmentMatcher:a,defaultOperationType:h,exportedVariables:{},selectionsToResolve:f,onlyRunForcedResolvers:o},E=!1,[2,this.resolveSelectionSet(s.selectionSet,E,r,S).then(function(w){return{result:w,exportedVariables:S.exportedVariables}})]})})},t.prototype.resolveSelectionSet=function(e,r,n,i){return nt(this,void 0,void 0,function(){var a,o,s,u,l,f=this;return it(this,function(d){return a=i.fragmentMap,o=i.context,s=i.variables,u=[n],l=function(h){return nt(f,void 0,void 0,function(){var p,y;return it(this,function(v){return!r&&!i.selectionsToResolve.has(h)?[2]:Et(h,s)?ze(h)?[2,this.resolveField(h,r,n,i).then(function(S){var E;typeof S<"u"&&u.push((E={},E[Ze(h)]=S,E))})]:(Ca(h)?p=h:(p=a[h.name.value],__DEV__?I(p,"No fragment named ".concat(h.name.value)):I(p,11)),p&&p.typeCondition&&(y=p.typeCondition.name.value,i.fragmentMatcher(n,y,o))?[2,this.resolveSelectionSet(p.selectionSet,r,n,i).then(function(S){u.push(S)})]:[2]):[2]})})},[2,Promise.all(e.selections.map(l)).then(function(){return vn(u)})]})})},t.prototype.resolveField=function(e,r,n,i){return nt(this,void 0,void 0,function(){var a,o,s,u,l,f,d,h,p,y=this;return it(this,function(v){return n?(a=i.variables,o=e.name.value,s=Ze(e),u=o!==s,l=n[s]||n[o],f=Promise.resolve(l),(!i.onlyRunForcedResolvers||this.shouldForceResolvers(e))&&(d=n.__typename||i.defaultOperationType,h=this.resolvers&&this.resolvers[d],h&&(p=h[u?o:s],p&&(f=Promise.resolve(Vr.withValue(this.cache,p,[n,xt(e,a),i.context,{field:e,fragmentMap:i.fragmentMap}]))))),[2,f.then(function(S){var E,b;if(S===void 0&&(S=l),e.directives&&e.directives.forEach(function(T){T.name.value==="export"&&T.arguments&&T.arguments.forEach(function(A){A.name.value==="as"&&A.value.kind==="StringValue"&&(i.exportedVariables[A.value.value]=S)})}),!e.selectionSet||S==null)return S;var w=(b=(E=e.directives)===null||E===void 0?void 0:E.some(function(T){return T.name.value==="client"}))!==null&&b!==void 0?b:!1;if(Array.isArray(S))return y.resolveSubSelectedArray(e,r||w,S,i);if(e.selectionSet)return y.resolveSelectionSet(e.selectionSet,r||w,S,i)})]):[2,null]})})},t.prototype.resolveSubSelectedArray=function(e,r,n,i){var a=this;return Promise.all(n.map(function(o){if(o===null)return null;if(Array.isArray(o))return a.resolveSubSelectedArray(e,r,o,i);if(e.selectionSet)return a.resolveSelectionSet(e.selectionSet,r,o,i)}))},t.prototype.collectSelectionsToResolve=function(e,r){var n=function(o){return!Array.isArray(o)},i=this.selectionsToResolveCache;function a(o){if(!i.has(o)){var s=new Set;i.set(o,s),Ne(o,{Directive:function(u,l,f,d,h){u.name.value==="client"&&h.forEach(function(p){n(p)&&pn(p)&&s.add(p)})},FragmentSpread:function(u,l,f,d,h){var p=r[u.name.value];__DEV__?I(p,"No fragment named ".concat(u.name.value)):I(p,12);var y=a(p);y.size>0&&(h.forEach(function(v){n(v)&&pn(v)&&s.add(v)}),s.add(u),y.forEach(function(v){s.add(v)}))}})}return i.get(o)}return a(e)},t}();var Qr=new(et?WeakMap:Map);function Do(t,e){var r=t[e];typeof r=="function"&&(t[e]=function(){return Qr.set(t,(Qr.get(t)+1)%1e15),r.apply(this,arguments)})}function Yc(t){t.notifyTimeout&&(clearTimeout(t.notifyTimeout),t.notifyTimeout=void 0)}var Ci=function(){function t(e,r){r===void 0&&(r=e.generateQueryId()),this.queryId=r,this.listeners=new Set,this.document=null,this.lastRequestId=1,this.subscriptions=new Set,this.stopped=!1,this.dirty=!1,this.observableQuery=null;var n=this.cache=e.cache;Qr.has(n)||(Qr.set(n,0),Do(n,"evict"),Do(n,"modify"),Do(n,"reset"))}return t.prototype.init=function(e){var r=e.networkStatus||X.loading;return this.variables&&this.networkStatus!==X.loading&&!oe(this.variables,e.variables)&&(r=X.setVariables),oe(e.variables,this.variables)||(this.lastDiff=void 0),Object.assign(this,{document:e.document,variables:e.variables,networkError:null,graphQLErrors:this.graphQLErrors||[],networkStatus:r}),e.observableQuery&&this.setObservableQuery(e.observableQuery),e.lastRequestId&&(this.lastRequestId=e.lastRequestId),this},t.prototype.reset=function(){Yc(this),this.dirty=!1},t.prototype.getDiff=function(e){e===void 0&&(e=this.variables);var r=this.getDiffOptions(e);if(this.lastDiff&&oe(r,this.lastDiff.options))return this.lastDiff.diff;this.updateWatch(this.variables=e);var n=this.observableQuery;if(n&&n.options.fetchPolicy==="no-cache")return{complete:!1};var i=this.cache.diff(r);return this.updateLastDiff(i,r),i},t.prototype.updateLastDiff=function(e,r){this.lastDiff=e?{diff:e,options:r||this.getDiffOptions()}:void 0},t.prototype.getDiffOptions=function(e){var r;return e===void 0&&(e=this.variables),{query:this.document,variables:e,returnPartialData:!0,optimistic:!0,canonizeResults:(r=this.observableQuery)===null||r===void 0?void 0:r.options.canonizeResults}},t.prototype.setDiff=function(e){var r=this,n=this.lastDiff&&this.lastDiff.diff;this.updateLastDiff(e),!this.dirty&&!oe(n&&n.result,e&&e.result)&&(this.dirty=!0,this.notifyTimeout||(this.notifyTimeout=setTimeout(function(){return r.notify()},0)))},t.prototype.setObservableQuery=function(e){var r=this;e!==this.observableQuery&&(this.oqListener&&this.listeners.delete(this.oqListener),this.observableQuery=e,e?(e.queryInfo=this,this.listeners.add(this.oqListener=function(){var n=r.getDiff();n.fromOptimisticTransaction?e.observe():To(e)})):delete this.oqListener)},t.prototype.notify=function(){var e=this;Yc(this),this.shouldNotify()&&this.listeners.forEach(function(r){return r(e)}),this.dirty=!1},t.prototype.shouldNotify=function(){if(!this.dirty||!this.listeners.size)return!1;if(Vt(this.networkStatus)&&this.observableQuery){var e=this.observableQuery.options.fetchPolicy;if(e!=="cache-only"&&e!=="cache-and-network")return!1}return!0},t.prototype.stop=function(){if(!this.stopped){this.stopped=!0,this.reset(),this.cancel(),this.cancel=t.prototype.cancel,this.subscriptions.forEach(function(r){return r.unsubscribe()});var e=this.observableQuery;e&&e.stopPolling()}},t.prototype.cancel=function(){},t.prototype.updateWatch=function(e){var r=this;e===void 0&&(e=this.variables);var n=this.observableQuery;if(!(n&&n.options.fetchPolicy==="no-cache")){var i=m(m({},this.getDiffOptions(e)),{watcher:this,callback:function(a){return r.setDiff(a)}});(!this.lastWatch||!oe(i,this.lastWatch))&&(this.cancel(),this.cancel=this.cache.watch(this.lastWatch=i))}},t.prototype.resetLastWrite=function(){this.lastWrite=void 0},t.prototype.shouldWrite=function(e,r){var n=this.lastWrite;return!(n&&n.dmCount===Qr.get(this.cache)&&oe(r,n.variables)&&oe(e.data,n.result.data))},t.prototype.markResult=function(e,r,n,i){var a=this,o=new Ve,s=we(e.errors)?e.errors.slice(0):[];if(this.reset(),"incremental"in e&&we(e.incremental)){var u=pi(this.getDiff().result,e);e.data=u}else if("hasNext"in e&&e.hasNext){var l=this.getDiff();e.data=o.merge(l.result,e.data)}this.graphQLErrors=s,n.fetchPolicy==="no-cache"?this.updateLastDiff({result:e.data,complete:!0},this.getDiffOptions(n.variables)):i!==0&&(Ri(e,n.errorPolicy)?this.cache.performTransaction(function(f){if(a.shouldWrite(e,n.variables))f.writeQuery({query:r,data:e.data,variables:n.variables,overwrite:i===1}),a.lastWrite={result:e,variables:n.variables,dmCount:Qr.get(a.cache)};else if(a.lastDiff&&a.lastDiff.diff.complete){e.data=a.lastDiff.diff.result;return}var d=a.getDiffOptions(n.variables),h=f.diff(d);a.stopped||a.updateWatch(n.variables),a.updateLastDiff(h,d),h.complete&&(e.data=h.result)}):this.lastWrite=void 0)},t.prototype.markReady=function(){return this.networkError=null,this.networkStatus=X.ready},t.prototype.markError=function(e){return this.networkStatus=X.error,this.lastWrite=void 0,this.reset(),e.graphQLErrors&&(this.graphQLErrors=e.graphQLErrors),e.networkError&&(this.networkError=e.networkError),e},t}();function Ri(t,e){e===void 0&&(e="none");var r=e==="ignore"||e==="all",n=!Mr(t);return!n&&r&&t.data&&(n=!0),n}var Lf=Object.prototype.hasOwnProperty,Xc=function(){function t(e){var r=e.cache,n=e.link,i=e.defaultOptions,a=e.queryDeduplication,o=a===void 0?!1:a,s=e.onBroadcast,u=e.ssrMode,l=u===void 0?!1:u,f=e.clientAwareness,d=f===void 0?{}:f,h=e.localState,p=e.assumeImmutableResults;this.clientAwareness={},this.queries=new Map,this.fetchCancelFns=new Map,this.transformCache=new(et?WeakMap:Map),this.queryIdCounter=1,this.requestIdCounter=1,this.mutationIdCounter=1,this.inFlightLinkObservables=new Map,this.cache=r,this.link=n,this.defaultOptions=i||Object.create(null),this.queryDeduplication=o,this.clientAwareness=d,this.localState=h||new Pi({cache:r}),this.ssrMode=l,this.assumeImmutableResults=!!p,(this.onBroadcast=s)&&(this.mutationStore=Object.create(null))}return t.prototype.stop=function(){var e=this;this.queries.forEach(function(r,n){e.stopQueryNoBroadcast(n)}),this.cancelPendingFetches(__DEV__?new $("QueryManager stopped while query was in flight"):new $(14))},t.prototype.cancelPendingFetches=function(e){this.fetchCancelFns.forEach(function(r){return r(e)}),this.fetchCancelFns.clear()},t.prototype.mutate=function(e){var r,n,i=e.mutation,a=e.variables,o=e.optimisticResponse,s=e.updateQueries,u=e.refetchQueries,l=u===void 0?[]:u,f=e.awaitRefetchQueries,d=f===void 0?!1:f,h=e.update,p=e.onQueryUpdated,y=e.fetchPolicy,v=y===void 0?((r=this.defaultOptions.mutate)===null||r===void 0?void 0:r.fetchPolicy)||"network-only":y,S=e.errorPolicy,E=S===void 0?((n=this.defaultOptions.mutate)===null||n===void 0?void 0:n.errorPolicy)||"none":S,b=e.keepRootFields,w=e.context;return nt(this,void 0,void 0,function(){var T,A,N,k,C,Z;return it(this,function(Y){switch(Y.label){case 0:return __DEV__?I(i,"mutation option is required. You must specify your GraphQL document in the mutation option."):I(i,15),__DEV__?I(v==="network-only"||v==="no-cache","Mutations support only 'network-only' or 'no-cache' fetchPolicy strings. The default `network-only` behavior automatically writes mutation results to the cache. Passing `no-cache` skips the cache write."):I(v==="network-only"||v==="no-cache",16),T=this.generateMutationId(),A=this.transform(i),N=A.document,k=A.hasClientExports,i=this.cache.transformForLink(N),a=this.getVariables(i,a),k?[4,this.localState.addExportedVariables(i,a,w)]:[3,2];case 1:a=Y.sent(),Y.label=2;case 2:return C=this.mutationStore&&(this.mutationStore[T]={mutation:i,variables:a,loading:!0,error:null}),o&&this.markMutationOptimistic(o,{mutationId:T,document:i,variables:a,fetchPolicy:v,errorPolicy:E,context:w,updateQueries:s,update:h,keepRootFields:b}),this.broadcastQueries(),Z=this,[2,new Promise(function(ft,_t){return li(Z.getObservableFromLink(i,m(m({},w),{optimisticResponse:o}),a,!1),function(xe){if(Mr(xe)&&E==="none")throw new Ot({graphQLErrors:di(xe)});C&&(C.loading=!1,C.error=null);var q=m({},xe);return typeof l=="function"&&(l=l(q)),E==="ignore"&&Mr(q)&&delete q.errors,Z.markMutationResult({mutationId:T,result:q,document:i,variables:a,fetchPolicy:v,errorPolicy:E,context:w,update:h,updateQueries:s,awaitRefetchQueries:d,refetchQueries:l,removeOptimistic:o?T:void 0,onQueryUpdated:p,keepRootFields:b})}).subscribe({next:function(xe){Z.broadcastQueries(),(!("hasNext"in xe)||xe.hasNext===!1)&&ft(xe)},error:function(xe){C&&(C.loading=!1,C.error=xe),o&&Z.cache.removeOptimistic(T),Z.broadcastQueries(),_t(xe instanceof Ot?xe:new Ot({networkError:xe}))}})})]}})})},t.prototype.markMutationResult=function(e,r){var n=this;r===void 0&&(r=this.cache);var i=e.result,a=[],o=e.fetchPolicy==="no-cache";if(!o&&Ri(i,e.errorPolicy)){if(Mt(i)||a.push({result:i.data,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}),Mt(i)&&we(i.incremental)){var s=r.diff({id:"ROOT_MUTATION",query:this.transform(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0}),u=void 0;s.result&&(u=pi(s.result,i)),typeof u<"u"&&(i.data=u,a.push({result:u,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}))}var l=e.updateQueries;l&&this.queries.forEach(function(d,h){var p=d.observableQuery,y=p&&p.queryName;if(!(!y||!Lf.call(l,y))){var v=l[y],S=n.queries.get(h),E=S.document,b=S.variables,w=r.diff({query:E,variables:b,returnPartialData:!0,optimistic:!1}),T=w.result,A=w.complete;if(A&&T){var N=v(T,{mutationResult:i,queryName:E&&Cr(E)||void 0,queryVariables:b});N&&a.push({result:N,dataId:"ROOT_QUERY",query:E,variables:b})}}})}if(a.length>0||e.refetchQueries||e.update||e.onQueryUpdated||e.removeOptimistic){var f=[];if(this.refetchQueries({updateCache:function(d){o||a.forEach(function(v){return d.write(v)});var h=e.update,p=!Ls(i)||Mt(i)&&!i.hasNext;if(h){if(!o){var y=d.diff({id:"ROOT_MUTATION",query:n.transform(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0});y.complete&&(i=m(m({},i),{data:y.result}),"incremental"in i&&delete i.incremental,"hasNext"in i&&delete i.hasNext)}p&&h(d,i,{context:e.context,variables:e.variables})}!o&&!e.keepRootFields&&p&&d.modify({id:"ROOT_MUTATION",fields:function(v,S){var E=S.fieldName,b=S.DELETE;return E==="__typename"?v:b}})},include:e.refetchQueries,optimistic:!1,removeOptimistic:e.removeOptimistic,onQueryUpdated:e.onQueryUpdated||null}).forEach(function(d){return f.push(d)}),e.awaitRefetchQueries||e.onQueryUpdated)return Promise.all(f).then(function(){return i})}return Promise.resolve(i)},t.prototype.markMutationOptimistic=function(e,r){var n=this,i=typeof e=="function"?e(r.variables):e;return this.cache.recordOptimisticTransaction(function(a){try{n.markMutationResult(m(m({},r),{result:{data:i}}),a)}catch(o){__DEV__&&I.error(o)}},r.mutationId)},t.prototype.fetchQuery=function(e,r,n){return this.fetchQueryObservable(e,r,n).promise},t.prototype.getQueryStore=function(){var e=Object.create(null);return this.queries.forEach(function(r,n){e[n]={variables:r.variables,networkStatus:r.networkStatus,networkError:r.networkError,graphQLErrors:r.graphQLErrors}}),e},t.prototype.resetErrors=function(e){var r=this.queries.get(e);r&&(r.networkError=void 0,r.graphQLErrors=[])},t.prototype.transform=function(e){var r=this.transformCache;if(!r.has(e)){var n=this.cache.transformDocument(e),i=Fa(n),a=this.localState.clientQuery(n),o=i&&this.localState.serverQuery(i),s={document:n,hasClientExports:ka(n),hasForcedResolvers:this.localState.shouldForceResolvers(n),clientQuery:a,serverQuery:o,defaultVars:ar(yt(n)),asQuery:m(m({},n),{definitions:n.definitions.map(function(l){return l.kind==="OperationDefinition"&&l.operation!=="query"?m(m({},l),{operation:"query"}):l})})},u=function(l){l&&!r.has(l)&&r.set(l,s)};u(e),u(n),u(a),u(o)}return r.get(e)},t.prototype.getVariables=function(e,r){return m(m({},this.transform(e).defaultVars),r)},t.prototype.watchQuery=function(e){e=m(m({},e),{variables:this.getVariables(e.query,e.variables)}),typeof e.notifyOnNetworkStatusChange>"u"&&(e.notifyOnNetworkStatusChange=!1);var r=new Ci(this),n=new Ni({queryManager:this,queryInfo:r,options:e});return this.queries.set(n.queryId,r),r.init({document:n.query,observableQuery:n,variables:n.variables}),n},t.prototype.query=function(e,r){var n=this;return r===void 0&&(r=this.generateQueryId()),__DEV__?I(e.query,"query option is required. You must specify your GraphQL document in the query option."):I(e.query,17),__DEV__?I(e.query.kind==="Document",'You must wrap the query string in a "gql" tag.'):I(e.query.kind==="Document",18),__DEV__?I(!e.returnPartialData,"returnPartialData option only supported on watchQuery."):I(!e.returnPartialData,19),__DEV__?I(!e.pollInterval,"pollInterval option only supported on watchQuery."):I(!e.pollInterval,20),this.fetchQuery(r,e).finally(function(){return n.stopQuery(r)})},t.prototype.generateQueryId=function(){return String(this.queryIdCounter++)},t.prototype.generateRequestId=function(){return this.requestIdCounter++},t.prototype.generateMutationId=function(){return String(this.mutationIdCounter++)},t.prototype.stopQueryInStore=function(e){this.stopQueryInStoreNoBroadcast(e),this.broadcastQueries()},t.prototype.stopQueryInStoreNoBroadcast=function(e){var r=this.queries.get(e);r&&r.stop()},t.prototype.clearStore=function(e){return e===void 0&&(e={discardWatches:!0}),this.cancelPendingFetches(__DEV__?new $("Store reset while query was in flight (not completed in link chain)"):new $(21)),this.queries.forEach(function(r){r.observableQuery?r.networkStatus=X.loading:r.stop()}),this.mutationStore&&(this.mutationStore=Object.create(null)),this.cache.reset(e)},t.prototype.getObservableQueries=function(e){var r=this;e===void 0&&(e="active");var n=new Map,i=new Map,a=new Set;return Array.isArray(e)&&e.forEach(function(o){typeof o=="string"?i.set(o,!1):Na(o)?i.set(r.transform(o).document,!1):K(o)&&o.query&&a.add(o)}),this.queries.forEach(function(o,s){var u=o.observableQuery,l=o.document;if(u){if(e==="all"){n.set(s,u);return}var f=u.queryName,d=u.options.fetchPolicy;if(d==="standby"||e==="active"&&!u.hasObservers())return;(e==="active"||f&&i.has(f)||l&&i.has(l))&&(n.set(s,u),f&&i.set(f,!0),l&&i.set(l,!0))}}),a.size&&a.forEach(function(o){var s=Sn("legacyOneTimeQuery"),u=r.getQuery(s).init({document:o.query,variables:o.variables}),l=new Ni({queryManager:r,queryInfo:u,options:m(m({},o),{fetchPolicy:"network-only"})});I(l.queryId===s),u.setObservableQuery(l),n.set(s,l)}),__DEV__&&i.size&&i.forEach(function(o,s){o||__DEV__&&I.warn("Unknown query ".concat(typeof s=="string"?"named ":"").concat(JSON.stringify(s,null,2)," requested in refetchQueries options.include array"))}),n},t.prototype.reFetchObservableQueries=function(e){var r=this;e===void 0&&(e=!1);var n=[];return this.getObservableQueries(e?"all":"active").forEach(function(i,a){var o=i.options.fetchPolicy;i.resetLastResults(),(e||o!=="standby"&&o!=="cache-only")&&n.push(i.refetch()),r.getQuery(a).setDiff(null)}),this.broadcastQueries(),Promise.all(n)},t.prototype.setObservableQuery=function(e){this.getQuery(e.queryId).setObservableQuery(e)},t.prototype.startGraphQLSubscription=function(e){var r=this,n=e.query,i=e.fetchPolicy,a=e.errorPolicy,o=e.variables,s=e.context,u=s===void 0?{}:s;n=this.transform(n).document,o=this.getVariables(n,o);var l=function(d){return r.getObservableFromLink(n,u,d).map(function(h){if(i!=="no-cache"&&(Ri(h,a)&&r.cache.write({query:n,result:h.data,dataId:"ROOT_SUBSCRIPTION",variables:d}),r.broadcastQueries()),Mr(h))throw new Ot({graphQLErrors:h.errors});return h})};if(this.transform(n).hasClientExports){var f=this.localState.addExportedVariables(n,o,u).then(l);return new B(function(d){var h=null;return f.then(function(p){return h=p.subscribe(d)},d.error),function(){return h&&h.unsubscribe()}})}return l(o)},t.prototype.stopQuery=function(e){this.stopQueryNoBroadcast(e),this.broadcastQueries()},t.prototype.stopQueryNoBroadcast=function(e){this.stopQueryInStoreNoBroadcast(e),this.removeQuery(e)},t.prototype.removeQuery=function(e){this.fetchCancelFns.delete(e),this.queries.has(e)&&(this.getQuery(e).stop(),this.queries.delete(e))},t.prototype.broadcastQueries=function(){this.onBroadcast&&this.onBroadcast(),this.queries.forEach(function(e){return e.notify()})},t.prototype.getLocalState=function(){return this.localState},t.prototype.getObservableFromLink=function(e,r,n,i){var a=this,o;i===void 0&&(i=(o=r?.queryDeduplication)!==null&&o!==void 0?o:this.queryDeduplication);var s,u=this.transform(e).serverQuery;if(u){var l=this,f=l.inFlightLinkObservables,d=l.link,h={query:u,variables:n,operationName:Cr(u)||void 0,context:this.prepareContext(m(m({},r),{forceFetch:!i}))};if(r=h.context,i){var p=f.get(u)||new Map;f.set(u,p);var y=Je(n);if(s=p.get(y),!s){var v=new Fr([jr(d,h)]);p.set(y,s=v),v.beforeNext(function(){p.delete(y)&&p.size<1&&f.delete(u)})}}else s=new Fr([jr(d,h)])}else s=new Fr([B.of({data:{}})]),r=this.prepareContext(r);var S=this.transform(e).clientQuery;return S&&(s=li(s,function(E){return a.localState.runResolvers({document:S,remoteResult:E,context:r,variables:n})})),s},t.prototype.getResultsFromLink=function(e,r,n){var i=e.lastRequestId=this.generateRequestId(),a=this.cache.transformForLink(this.transform(e.document).document);return li(this.getObservableFromLink(a,n.context,n.variables),function(o){var s=di(o),u=s.length>0;if(i>=e.lastRequestId){if(u&&n.errorPolicy==="none")throw e.markError(new Ot({graphQLErrors:s}));e.markResult(o,a,n,r),e.markReady()}var l={data:o.data,loading:!1,networkStatus:X.ready};return u&&n.errorPolicy!=="ignore"&&(l.errors=s,l.networkStatus=X.error),l},function(o){var s=Hc(o)?o:new Ot({networkError:o});throw i>=e.lastRequestId&&e.markError(s),s})},t.prototype.fetchQueryObservable=function(e,r,n){var i=this;n===void 0&&(n=X.loading);var a=this.transform(r.query).document,o=this.getVariables(a,r.variables),s=this.getQuery(e),u=this.defaultOptions.watchQuery,l=r.fetchPolicy,f=l===void 0?u&&u.fetchPolicy||"cache-first":l,d=r.errorPolicy,h=d===void 0?u&&u.errorPolicy||"none":d,p=r.returnPartialData,y=p===void 0?!1:p,v=r.notifyOnNetworkStatusChange,S=v===void 0?!1:v,E=r.context,b=E===void 0?{}:E,w=Object.assign({},r,{query:a,variables:o,fetchPolicy:f,errorPolicy:h,returnPartialData:y,notifyOnNetworkStatusChange:S,context:b}),T=function(k){w.variables=k;var C=i.fetchQueryByPolicy(s,w,n);return w.fetchPolicy!=="standby"&&C.length>0&&s.observableQuery&&s.observableQuery.applyNextFetchPolicy("after-fetch",r),C},A=function(){return i.fetchCancelFns.delete(e)};this.fetchCancelFns.set(e,function(k){A(),setTimeout(function(){return N.cancel(k)})});var N=new Fr(this.transform(w.query).hasClientExports?this.localState.addExportedVariables(w.query,w.variables,w.context).then(T):T(w.variables));return N.promise.then(A,A),N},t.prototype.refetchQueries=function(e){var r=this,n=e.updateCache,i=e.include,a=e.optimistic,o=a===void 0?!1:a,s=e.removeOptimistic,u=s===void 0?o?Sn("refetchQueries"):void 0:s,l=e.onQueryUpdated,f=new Map;i&&this.getObservableQueries(i).forEach(function(h,p){f.set(p,{oq:h,lastDiff:r.getQuery(p).getDiff()})});var d=new Map;return n&&this.cache.batch({update:n,optimistic:o&&u||!1,removeOptimistic:u,onWatchUpdated:function(h,p,y){var v=h.watcher instanceof Ci&&h.watcher.observableQuery;if(v){if(l){f.delete(v.queryId);var S=l(v,p,y);return S===!0&&(S=v.refetch()),S!==!1&&d.set(v,S),S}l!==null&&f.set(v.queryId,{oq:v,lastDiff:y,diff:p})}}}),f.size&&f.forEach(function(h,p){var y=h.oq,v=h.lastDiff,S=h.diff,E;if(l){if(!S){var b=y.queryInfo;b.reset(),S=b.getDiff()}E=l(y,S,v)}(!l||E===!0)&&(E=y.refetch()),E!==!1&&d.set(y,E),p.indexOf("legacyOneTimeQuery")>=0&&r.stopQueryNoBroadcast(p)}),u&&this.cache.removeOptimistic(u),d},t.prototype.fetchQueryByPolicy=function(e,r,n){var i=this,a=r.query,o=r.variables,s=r.fetchPolicy,u=r.refetchWritePolicy,l=r.errorPolicy,f=r.returnPartialData,d=r.context,h=r.notifyOnNetworkStatusChange,p=e.networkStatus;e.init({document:this.transform(a).document,variables:o,networkStatus:n});var y=function(){return e.getDiff(o)},v=function(T,A){A===void 0&&(A=e.networkStatus||X.loading);var N=T.result;__DEV__&&!f&&!oe(N,{})&&Io(T.missing);var k=function(C){return B.of(m({data:C,loading:Vt(A),networkStatus:A},T.complete?null:{partial:!0}))};return N&&i.transform(a).hasForcedResolvers?i.localState.runResolvers({document:a,remoteResult:{data:N},context:d,variables:o,onlyRunForcedResolvers:!0}).then(function(C){return k(C.data||void 0)}):l==="none"&&A===X.refetch&&Array.isArray(T.missing)?k(void 0):k(N)},S=s==="no-cache"?0:n===X.refetch&&u!=="merge"?1:2,E=function(){return i.getResultsFromLink(e,S,{variables:o,context:d,fetchPolicy:s,errorPolicy:l})},b=h&&typeof p=="number"&&p!==n&&Vt(n);switch(s){default:case"cache-first":{var w=y();return w.complete?[v(w,e.markReady())]:f||b?[v(w),E()]:[E()]}case"cache-and-network":{var w=y();return w.complete||f||b?[v(w),E()]:[E()]}case"cache-only":return[v(y(),e.markReady())];case"network-only":return b?[v(y()),E()]:[E()];case"no-cache":return b?[v(e.getDiff()),E()]:[E()];case"standby":return[]}},t.prototype.getQuery=function(e){return e&&!this.queries.has(e)&&this.queries.set(e,new Ci(this,e)),this.queries.get(e)},t.prototype.prepareContext=function(e){e===void 0&&(e={});var r=this.localState.prepareContext(e);return m(m({},r),{clientAwareness:this.clientAwareness})},t}();var Zc=!1;var ko=function(){function t(e){var r=this;this.resetStoreCallbacks=[],this.clearStoreCallbacks=[];var n=e.uri,i=e.credentials,a=e.headers,o=e.cache,s=e.ssrMode,u=s===void 0?!1:s,l=e.ssrForceFetchDelay,f=l===void 0?0:l,d=e.connectToDevTools,h=d===void 0?typeof window=="object"&&!window.__APOLLO_CLIENT__&&__DEV__:d,p=e.queryDeduplication,y=p===void 0?!0:p,v=e.defaultOptions,S=e.assumeImmutableResults,E=S===void 0?!1:S,b=e.resolvers,w=e.typeDefs,T=e.fragmentMatcher,A=e.name,N=e.version,k=e.link;if(k||(k=n?new ro({uri:n,credentials:i,headers:a}):tt.empty()),!o)throw __DEV__?new $(`To initialize Apollo Client, you must specify a 'cache' property in the options object.
51
- For more information, please visit: https://go.apollo.dev/c/docs`):new $(9);if(this.link=k,this.cache=o,this.disableNetworkFetches=u||f>0,this.queryDeduplication=y,this.defaultOptions=v||Object.create(null),this.typeDefs=w,f&&setTimeout(function(){return r.disableNetworkFetches=!1},f),this.watchQuery=this.watchQuery.bind(this),this.query=this.query.bind(this),this.mutate=this.mutate.bind(this),this.resetStore=this.resetStore.bind(this),this.reFetchObservableQueries=this.reFetchObservableQueries.bind(this),h&&typeof window=="object"&&(window.__APOLLO_CLIENT__=this),!Zc&&h&&__DEV__&&(Zc=!0,typeof window<"u"&&window.document&&window.top===window.self&&!window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__)){var C=window.navigator,Z=C&&C.userAgent,Y=void 0;typeof Z=="string"&&(Z.indexOf("Chrome/")>-1?Y="https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm":Z.indexOf("Firefox/")>-1&&(Y="https://addons.mozilla.org/en-US/firefox/addon/apollo-developer-tools/")),Y&&__DEV__&&I.log("Download the Apollo DevTools for a better development experience: "+Y)}this.version=$s,this.localState=new Pi({cache:o,client:this,resolvers:b,fragmentMatcher:T}),this.queryManager=new Xc({cache:this.cache,link:this.link,defaultOptions:this.defaultOptions,queryDeduplication:y,ssrMode:u,clientAwareness:{name:A,version:N},localState:this.localState,assumeImmutableResults:E,onBroadcast:h?function(){r.devToolsHookCb&&r.devToolsHookCb({action:{},state:{queries:r.queryManager.getQueryStore(),mutations:r.queryManager.mutationStore||{}},dataWithOptimisticResults:r.cache.extract(!0)})}:void 0})}return t.prototype.stop=function(){this.queryManager.stop()},t.prototype.watchQuery=function(e){return this.defaultOptions.watchQuery&&(e=wn(this.defaultOptions.watchQuery,e)),this.disableNetworkFetches&&(e.fetchPolicy==="network-only"||e.fetchPolicy==="cache-and-network")&&(e=m(m({},e),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(e)},t.prototype.query=function(e){return this.defaultOptions.query&&(e=wn(this.defaultOptions.query,e)),__DEV__?I(e.fetchPolicy!=="cache-and-network","The cache-and-network fetchPolicy does not work with client.query, because client.query can only return a single result. Please use client.watchQuery to receive multiple results from the cache and the network, or consider using a different fetchPolicy, such as cache-first or network-only."):I(e.fetchPolicy!=="cache-and-network",10),this.disableNetworkFetches&&e.fetchPolicy==="network-only"&&(e=m(m({},e),{fetchPolicy:"cache-first"})),this.queryManager.query(e)},t.prototype.mutate=function(e){return this.defaultOptions.mutate&&(e=wn(this.defaultOptions.mutate,e)),this.queryManager.mutate(e)},t.prototype.subscribe=function(e){return this.queryManager.startGraphQLSubscription(e)},t.prototype.readQuery=function(e,r){return r===void 0&&(r=!1),this.cache.readQuery(e,r)},t.prototype.readFragment=function(e,r){return r===void 0&&(r=!1),this.cache.readFragment(e,r)},t.prototype.writeQuery=function(e){var r=this.cache.writeQuery(e);return e.broadcast!==!1&&this.queryManager.broadcastQueries(),r},t.prototype.writeFragment=function(e){var r=this.cache.writeFragment(e);return e.broadcast!==!1&&this.queryManager.broadcastQueries(),r},t.prototype.__actionHookForDevTools=function(e){this.devToolsHookCb=e},t.prototype.__requestRaw=function(e){return jr(this.link,e)},t.prototype.resetStore=function(){var e=this;return Promise.resolve().then(function(){return e.queryManager.clearStore({discardWatches:!1})}).then(function(){return Promise.all(e.resetStoreCallbacks.map(function(r){return r()}))}).then(function(){return e.reFetchObservableQueries()})},t.prototype.clearStore=function(){var e=this;return Promise.resolve().then(function(){return e.queryManager.clearStore({discardWatches:!0})}).then(function(){return Promise.all(e.clearStoreCallbacks.map(function(r){return r()}))})},t.prototype.onResetStore=function(e){var r=this;return this.resetStoreCallbacks.push(e),function(){r.resetStoreCallbacks=r.resetStoreCallbacks.filter(function(n){return n!==e})}},t.prototype.onClearStore=function(e){var r=this;return this.clearStoreCallbacks.push(e),function(){r.clearStoreCallbacks=r.clearStoreCallbacks.filter(function(n){return n!==e})}},t.prototype.reFetchObservableQueries=function(e){return this.queryManager.reFetchObservableQueries(e)},t.prototype.refetchQueries=function(e){var r=this.queryManager.refetchQueries(e),n=[],i=[];r.forEach(function(o,s){n.push(s),i.push(o)});var a=Promise.all(i);return a.queries=n,a.results=i,a.catch(function(o){__DEV__&&I.debug("In client.refetchQueries, Promise.all promise rejected with error ".concat(o))}),a},t.prototype.getObservableQueries=function(e){return e===void 0&&(e="active"),this.queryManager.getObservableQueries(e)},t.prototype.extract=function(e){return this.cache.extract(e)},t.prototype.restore=function(e){return this.cache.restore(e)},t.prototype.addResolvers=function(e){this.localState.addResolvers(e)},t.prototype.setResolvers=function(e){this.localState.setResolvers(e)},t.prototype.getResolvers=function(){return this.localState.getResolvers()},t.prototype.setLocalStateFragmentMatcher=function(e){this.localState.setFragmentMatcher(e)},t.prototype.setLink=function(e){this.link=this.queryManager.link=e},t}();fs(Zt?"log":"silent");function Ce(t){return t===null?"null":Array.isArray(t)?"array":typeof t}function Tt(t){return Ce(t)==="object"}function eu(t){return Array.isArray(t)&&t.length>0&&t.every(e=>"message"in e)}function Ao(t,e){return t.length<124?t:e}var tu="graphql-transport-ws";var Be;(function(t){t[t.InternalServerError=4500]="InternalServerError",t[t.InternalClientError=4005]="InternalClientError",t[t.BadRequest=4400]="BadRequest",t[t.BadResponse=4004]="BadResponse",t[t.Unauthorized=4401]="Unauthorized",t[t.Forbidden=4403]="Forbidden",t[t.SubprotocolNotAcceptable=4406]="SubprotocolNotAcceptable",t[t.ConnectionInitialisationTimeout=4408]="ConnectionInitialisationTimeout",t[t.ConnectionAcknowledgementTimeout=4504]="ConnectionAcknowledgementTimeout",t[t.SubscriberAlreadyExists=4409]="SubscriberAlreadyExists",t[t.TooManyInitialisationRequests=4429]="TooManyInitialisationRequests"})(Be||(Be={}));var me;(function(t){t.ConnectionInit="connection_init",t.ConnectionAck="connection_ack",t.Ping="ping",t.Pong="pong",t.Subscribe="subscribe",t.Next="next",t.Error="error",t.Complete="complete"})(me||(me={}));function ru(t){if(!Tt(t))throw new Error(`Message is expected to be an object, but got ${Ce(t)}`);if(!t.type)throw new Error("Message is missing the 'type' property");if(typeof t.type!="string")throw new Error(`Message is expects the 'type' property to be a string, but got ${Ce(t.type)}`);switch(t.type){case me.ConnectionInit:case me.ConnectionAck:case me.Ping:case me.Pong:{if(t.payload!=null&&!Tt(t.payload))throw new Error(`"${t.type}" message expects the 'payload' property to be an object or nullish or missing, but got "${t.payload}"`);break}case me.Subscribe:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${Ce(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);if(!Tt(t.payload))throw new Error(`"${t.type}" message expects the 'payload' property to be an object, but got ${Ce(t.payload)}`);if(typeof t.payload.query!="string")throw new Error(`"${t.type}" message payload expects the 'query' property to be a string, but got ${Ce(t.payload.query)}`);if(t.payload.variables!=null&&!Tt(t.payload.variables))throw new Error(`"${t.type}" message payload expects the 'variables' property to be a an object or nullish or missing, but got ${Ce(t.payload.variables)}`);if(t.payload.operationName!=null&&Ce(t.payload.operationName)!=="string")throw new Error(`"${t.type}" message payload expects the 'operationName' property to be a string or nullish or missing, but got ${Ce(t.payload.operationName)}`);if(t.payload.extensions!=null&&!Tt(t.payload.extensions))throw new Error(`"${t.type}" message payload expects the 'extensions' property to be a an object or nullish or missing, but got ${Ce(t.payload.extensions)}`);break}case me.Next:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${Ce(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);if(!Tt(t.payload))throw new Error(`"${t.type}" message expects the 'payload' property to be an object, but got ${Ce(t.payload)}`);break}case me.Error:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${Ce(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);if(!eu(t.payload))throw new Error(`"${t.type}" message expects the 'payload' property to be an array of GraphQL errors, but got ${JSON.stringify(t.payload)}`);break}case me.Complete:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${Ce(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);break}default:throw new Error(`Invalid message 'type' property "${t.type}"`)}return t}function nu(t,e){return ru(typeof t=="string"?JSON.parse(t,e):t)}function Gr(t,e){return ru(t),JSON.stringify(t,e)}function iu(t){let{url:e,connectionParams:r,lazy:n=!0,onNonLazyError:i=console.error,lazyCloseTimeout:a=0,keepAlive:o=0,disablePong:s,connectionAckWaitTimeout:u=0,retryAttempts:l=5,retryWait:f=async function(pe){let ne=1e3;for(let G=0;G<pe;G++)ne*=2;await new Promise(G=>setTimeout(G,ne+Math.floor(Math.random()*(3e3-300)+300)))},shouldRetry:d=Li,isFatalConnectionProblem:h,on:p,webSocketImpl:y,generateID:v=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,pe=>{let ne=Math.random()*16|0;return(pe=="x"?ne:ne&3|8).toString(16)})},jsonMessageReplacer:S,jsonMessageReviver:E}=t,b;if(y){if(!Mf(y))throw new Error("Invalid WebSocket implementation provided");b=y}else typeof WebSocket<"u"?b=WebSocket:typeof global<"u"?b=global.WebSocket||global.MozWebSocket:typeof window<"u"&&(b=window.WebSocket||window.MozWebSocket);if(!b)throw new Error("WebSocket implementation missing; on Node you can `import WebSocket from 'ws';` and pass `webSocketImpl: WebSocket` to `createClient`");let w=b,T=(()=>{let q=(()=>{let ne={};return{on(G,W){return ne[G]=W,()=>{delete ne[G]}},emit(G){var W;"id"in G&&((W=ne[G.id])===null||W===void 0||W.call(ne,G))}}})(),pe={connecting:p?.connecting?[p.connecting]:[],opened:p?.opened?[p.opened]:[],connected:p?.connected?[p.connected]:[],ping:p?.ping?[p.ping]:[],pong:p?.pong?[p.pong]:[],message:p?.message?[q.emit,p.message]:[q.emit],closed:p?.closed?[p.closed]:[],error:p?.error?[p.error]:[]};return{onMessage:q.on,on(ne,G){let W=pe[ne];return W.push(G),()=>{W.splice(W.indexOf(G),1)}},emit(ne,...G){for(let W of[...pe[ne]])W(...G)}}})();function A(q){let pe=[T.on("error",ne=>{pe.forEach(G=>G()),q(ne)}),T.on("closed",ne=>{pe.forEach(G=>G()),q(ne)})]}let N,k=0,C,Z=!1,Y=0,ft=!1;async function _t(){clearTimeout(C);let[q,pe]=await(N??(N=new Promise((W,pt)=>(async()=>{if(Z){if(await f(Y),!k)return N=void 0,pt({code:1e3,reason:"All Subscriptions Gone"});Y++}T.emit("connecting");let V=new w(typeof e=="function"?await e():e,tu),dt,Pt;function Xn(){isFinite(o)&&o>0&&(clearTimeout(Pt),Pt=setTimeout(()=>{V.readyState===w.OPEN&&(V.send(Gr({type:me.Ping})),T.emit("ping",!1,void 0))},o))}A(Oe=>{N=void 0,clearTimeout(dt),clearTimeout(Pt),pt(Oe),Li(Oe)&&Oe.code===4499&&(V.close(4499,"Terminated"),V.onerror=null,V.onclose=null)}),V.onerror=Oe=>T.emit("error",Oe),V.onclose=Oe=>T.emit("closed",Oe),V.onopen=async()=>{try{T.emit("opened",V);let Oe=typeof r=="function"?await r():r;if(V.readyState!==w.OPEN)return;V.send(Gr(Oe?{type:me.ConnectionInit,payload:Oe}:{type:me.ConnectionInit},S)),isFinite(u)&&u>0&&(dt=setTimeout(()=>{V.close(Be.ConnectionAcknowledgementTimeout,"Connection acknowledgement timeout")},u)),Xn()}catch(Oe){T.emit("error",Oe),V.close(Be.InternalClientError,Ao(Oe instanceof Error?Oe.message:new Error(Oe).message,"Internal client error"))}};let kr=!1;V.onmessage=({data:Oe})=>{try{let Te=nu(Oe,E);if(T.emit("message",Te),Te.type==="ping"||Te.type==="pong"){T.emit(Te.type,!0,Te.payload),Te.type==="pong"?Xn():s||(V.send(Gr(Te.payload?{type:me.Pong,payload:Te.payload}:{type:me.Pong})),T.emit("pong",!1,Te.payload));return}if(kr)return;if(Te.type!==me.ConnectionAck)throw new Error(`First message cannot be of type ${Te.type}`);clearTimeout(dt),kr=!0,T.emit("connected",V,Te.payload),Z=!1,Y=0,W([V,new Promise((zp,Qu)=>A(Qu))])}catch(Te){V.onmessage=null,T.emit("error",Te),V.close(Be.BadResponse,Ao(Te instanceof Error?Te.message:new Error(Te).message,"Bad response"))}}})())));q.readyState===w.CLOSING&&await pe;let ne=()=>{},G=new Promise(W=>ne=W);return[q,ne,Promise.race([G.then(()=>{if(!k){let W=()=>q.close(1e3,"Normal Closure");isFinite(a)&&a>0?C=setTimeout(()=>{q.readyState===w.OPEN&&W()},a):W()}}),pe])]}function xe(q){if(Li(q)&&(Ff(q.code)||[Be.InternalServerError,Be.InternalClientError,Be.BadRequest,Be.BadResponse,Be.Unauthorized,Be.SubprotocolNotAcceptable,Be.SubscriberAlreadyExists,Be.TooManyInitialisationRequests].includes(q.code)))throw q;if(ft)return!1;if(Li(q)&&q.code===1e3)return k>0;if(!l||Y>=l||!d(q)||h?.(q))throw q;return Z=!0}return n||(async()=>{for(k++;;)try{let[,,q]=await _t();await q}catch(q){try{if(!xe(q))return}catch(pe){return i?.(pe)}}})(),{on:T.on,subscribe(q,pe){let ne=v(q),G=!1,W=!1,pt=()=>{k--,G=!0};return(async()=>{for(k++;;)try{let[V,dt,Pt]=await _t();if(G)return dt();let Xn=T.onMessage(ne,kr=>{switch(kr.type){case me.Next:{pe.next(kr.payload);return}case me.Error:{W=!0,G=!0,pe.error(kr.payload),pt();return}case me.Complete:{G=!0,pt();return}}});V.send(Gr({id:ne,type:me.Subscribe,payload:q},S)),pt=()=>{!G&&V.readyState===w.OPEN&&V.send(Gr({id:ne,type:me.Complete},S)),k--,G=!0,dt()},await Pt.finally(Xn);return}catch(V){if(!xe(V))return}})().then(()=>{W||pe.complete()}).catch(V=>{pe.error(V)}),()=>{G||pt()}},async dispose(){if(ft=!0,N){let[q]=await N;q.close(1e3,"Normal Closure")}},terminate(){N&&T.emit("closed",{code:4499,reason:"Terminated",wasClean:!1})}}}function Li(t){return Tt(t)&&"code"in t&&"reason"in t}function Ff(t){return[1e3,1001,1006,1005,1012,1013,1013].includes(t)?!1:t>=1e3&&t<=1999}function Mf(t){return typeof t=="function"&&"constructor"in t&&"CLOSED"in t&&"CLOSING"in t&&"CONNECTING"in t&&"OPEN"in t}function jf(t){return K(t)&&"code"in t&&"reason"in t}var au=function(t){de(e,t);function e(r){var n=t.call(this)||this;return n.client=r,n}return e.prototype.request=function(r){var n=this;return new B(function(i){return n.client.subscribe(m(m({},r),{query:Ar(r.query)}),{next:i.next.bind(i),complete:i.complete.bind(i),error:function(a){return a instanceof Error?i.error(a):jf(a)?i.error(new Error("Socket closed with event ".concat(a.code," ").concat(a.reason||""))):i.error(new Ot({graphQLErrors:Array.isArray(a)?a:[a]}))}})})},e}(tt);var ea=function(){return ea=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},ea.apply(this,arguments)};typeof SuppressedError=="function"&&SuppressedError;function Vi(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Vi=function(r){return typeof r}:Vi=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Vi(t)}function $f(t){return Vi(t)=="object"&&t!==null}var Du=typeof Symbol=="function"&&Symbol.toStringTag!=null?Symbol.toStringTag:"@@toStringTag";function Mo(t,e){for(var r=/\r\n|[\n\r]/g,n=1,i=e+1,a;(a=r.exec(t.body))&&a.index<e;)n+=1,i=e+1-(a.index+a[0].length);return{line:n,column:i}}function Uf(t){return ku(t.source,Mo(t.source,t.start))}function ku(t,e){var r=t.locationOffset.column-1,n=Bi(r)+t.body,i=e.line-1,a=t.locationOffset.line-1,o=e.line+a,s=e.line===1?r:0,u=e.column+s,l="".concat(t.name,":").concat(o,":").concat(u,`
52
- `),f=n.split(/\r\n|[\n\r]/g),d=f[i];if(d.length>120){for(var h=Math.floor(u/80),p=u%80,y=[],v=0;v<d.length;v+=80)y.push(d.slice(v,v+80));return l+ou([["".concat(o),y[0]]].concat(y.slice(1,h+1).map(function(S){return["",S]}),[[" ",Bi(p-1)+"^"],["",y[h+1]]]))}return l+ou([["".concat(o-1),f[i-1]],["".concat(o),d],["",Bi(u-1)+"^"],["".concat(o+1),f[i+1]]])}function ou(t){var e=t.filter(function(n){n[0];var i=n[1];return i!==void 0}),r=Math.max.apply(Math,e.map(function(n){var i=n[0];return i.length}));return e.map(function(n){var i=n[0],a=n[1];return qf(r,i)+(a?" | "+a:" |")}).join(`
53
- `)}function Bi(t){return Array(t+1).join(" ")}function qf(t,e){return Bi(t-e.length)+e}function Qi(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Qi=function(r){return typeof r}:Qi=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Qi(t)}function su(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Vf(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?su(Object(r),!0).forEach(function(n){Bf(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):su(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Bf(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Qf(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function cu(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Gf(t,e,r){return e&&cu(t.prototype,e),r&&cu(t,r),t}function Wf(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Gn(t,e)}function Kf(t){var e=Nu();return function(){var n=Wn(t),i;if(e){var a=Wn(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return Au(this,i)}}function Au(t,e){return e&&(Qi(e)==="object"||typeof e=="function")?e:Nn(t)}function Nn(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function jo(t){var e=typeof Map=="function"?new Map:void 0;return jo=function(n){if(n===null||!zf(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(n))return e.get(n);e.set(n,i)}function i(){return Gi(n,arguments,Wn(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),Gn(i,n)},jo(t)}function Gi(t,e,r){return Nu()?Gi=Reflect.construct:Gi=function(i,a,o){var s=[null];s.push.apply(s,a);var u=Function.bind.apply(i,s),l=new u;return o&&Gn(l,o.prototype),l},Gi.apply(null,arguments)}function Nu(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function zf(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function Gn(t,e){return Gn=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},Gn(t,e)}function Wn(t){return Wn=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},Wn(t)}var Jf=function(t){Wf(r,t);var e=Kf(r);function r(n,i,a,o,s,u,l){var f,d,h,p;Qf(this,r),p=e.call(this,n),p.name="GraphQLError",p.originalError=u??void 0,p.nodes=uu(Array.isArray(i)?i:i?[i]:void 0);for(var y=[],v=0,S=(E=p.nodes)!==null&&E!==void 0?E:[];v<S.length;v++){var E,b=S[v],w=b.loc;w!=null&&y.push(w)}y=uu(y),p.source=a??((f=y)===null||f===void 0?void 0:f[0].source),p.positions=o??((d=y)===null||d===void 0?void 0:d.map(function(A){return A.start})),p.locations=o&&a?o.map(function(A){return Mo(a,A)}):(h=y)===null||h===void 0?void 0:h.map(function(A){return Mo(A.source,A.start)}),p.path=s??void 0;var T=u?.extensions;return l==null&&$f(T)?p.extensions=Vf({},T):p.extensions=l??{},Object.defineProperties(Nn(p),{message:{enumerable:!0},locations:{enumerable:p.locations!=null},path:{enumerable:p.path!=null},extensions:{enumerable:p.extensions!=null&&Object.keys(p.extensions).length>0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),u!=null&&u.stack?(Object.defineProperty(Nn(p),"stack",{value:u.stack,writable:!0,configurable:!0}),Au(p)):(Error.captureStackTrace?Error.captureStackTrace(Nn(p),r):Object.defineProperty(Nn(p),"stack",{value:Error().stack,writable:!0,configurable:!0}),p)}return Gf(r,[{key:"toString",value:function(){return Hf(this)}},{key:Du,get:function(){return"Object"}}]),r}(jo(Error));function uu(t){return t===void 0||t.length===0?void 0:t}function Hf(t){var e=t.message;if(t.nodes)for(var r=0,n=t.nodes;r<n.length;r++){var i=n[r];i.loc&&(e+=`
49
+ `)),e=e.replace(/\n$/,""),e},Ot=function(t){de(e,t);function e(r){var n=r.graphQLErrors,i=r.clientErrors,a=r.networkError,o=r.errorMessage,s=r.extraInfo,u=t.call(this,o)||this;return u.name="ApolloError",u.graphQLErrors=n||[],u.clientErrors=i||[],u.networkError=a||null,u.message=o||Rf(u),u.extraInfo=s,u.__proto__=e.prototype,u}return e}(Error);var ee;(function(t){t[t.loading=1]="loading",t[t.setVariables=2]="setVariables",t[t.fetchMore=3]="fetchMore",t[t.refetch=4]="refetch",t[t.poll=6]="poll",t[t.ready=7]="ready",t[t.error=8]="error"})(ee||(ee={}));function Vt(t){return t?t<7:!1}var Lf=Object.assign,Ff=Object.hasOwnProperty,Ri=function(t){de(e,t);function e(r){var n=r.queryManager,i=r.queryInfo,a=r.options,o=t.call(this,function(S){try{var T=S._subscription._observer;T&&!T.error&&(T.error=Mf)}catch{}var b=!o.observers.size;o.observers.add(S);var w=o.last;return w&&w.error?S.error&&S.error(w.error):w&&w.result&&S.next&&S.next(w.result),b&&o.reobserve().catch(function(){}),function(){o.observers.delete(S)&&!o.observers.size&&o.tearDownQuery()}})||this;o.observers=new Set,o.subscriptions=new Set,o.queryInfo=i,o.queryManager=n,o.isTornDown=!1;var s=n.defaultOptions.watchQuery,u=s===void 0?{}:s,l=u.fetchPolicy,f=l===void 0?"cache-first":l,d=a.fetchPolicy,h=d===void 0?f:d,p=a.initialFetchPolicy,y=p===void 0?h==="standby"?f:h:p;o.options=m(m({},a),{initialFetchPolicy:y,fetchPolicy:h}),o.queryId=i.queryId||n.generateQueryId();var g=yt(o.query);return o.queryName=g&&g.name&&g.name.value,o}return Object.defineProperty(e.prototype,"query",{get:function(){return this.queryManager.transform(this.options.query).document},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"variables",{get:function(){return this.options.variables},enumerable:!1,configurable:!0}),e.prototype.result=function(){var r=this;return new Promise(function(n,i){var a={next:function(s){n(s),r.observers.delete(a),r.observers.size||r.queryManager.removeQuery(r.queryId),setTimeout(function(){o.unsubscribe()},0)},error:i},o=r.subscribe(a)})},e.prototype.getCurrentResult=function(r){r===void 0&&(r=!0);var n=this.getLastResult(!0),i=this.queryInfo.networkStatus||n&&n.networkStatus||ee.ready,a=m(m({},n),{loading:Vt(i),networkStatus:i}),o=this.options.fetchPolicy,s=o===void 0?"cache-first":o;if(!(s==="network-only"||s==="no-cache"||s==="standby"||this.queryManager.transform(this.options.query).hasForcedResolvers)){var u=this.queryInfo.getDiff();(u.complete||this.options.returnPartialData)&&(a.data=u.result),se(a.data,{})&&(a.data=void 0),u.complete?(delete a.partial,u.complete&&a.networkStatus===ee.loading&&(s==="cache-first"||s==="cache-only")&&(a.networkStatus=ee.ready,a.loading=!1)):a.partial=!0,__DEV__&&!u.complete&&!this.options.partialRefetch&&!a.loading&&!a.data&&!a.error&&No(u.missing)}return r&&this.updateLastResult(a),a},e.prototype.isDifferentFromLastResult=function(r,n){return!this.last||!se(this.last.result,r)||n&&!se(this.last.variables,n)},e.prototype.getLast=function(r,n){var i=this.last;if(i&&i[r]&&(!n||se(i.variables,this.variables)))return i[r]},e.prototype.getLastResult=function(r){return this.getLast("result",r)},e.prototype.getLastError=function(r){return this.getLast("error",r)},e.prototype.resetLastResults=function(){delete this.last,this.isTornDown=!1},e.prototype.resetQueryStoreErrors=function(){this.queryManager.resetErrors(this.queryId)},e.prototype.refetch=function(r){var n,i={pollInterval:0},a=this.options.fetchPolicy;if(a==="cache-and-network"?i.fetchPolicy=a:a==="no-cache"?i.fetchPolicy="no-cache":i.fetchPolicy="network-only",__DEV__&&r&&Ff.call(r,"variables")){var o=yn(this.query),s=o.variableDefinitions;(!s||!s.some(function(u){return u.variable.name.value==="variables"}))&&__DEV__&&I.warn("Called refetch(".concat(JSON.stringify(r),") for query ").concat(((n=o.name)===null||n===void 0?void 0:n.value)||JSON.stringify(o),`, which does not declare a $variables variable.
50
+ Did you mean to call refetch(variables) instead of refetch({ variables })?`))}return r&&!se(this.options.variables,r)&&(i.variables=this.options.variables=m(m({},this.options.variables),r)),this.queryInfo.resetLastWrite(),this.reobserve(i,ee.refetch)},e.prototype.fetchMore=function(r){var n=this,i=m(m({},r.query?r:m(m(m(m({},this.options),{query:this.query}),r),{variables:m(m({},this.options.variables),r.variables)})),{fetchPolicy:"no-cache"}),a=this.queryManager.generateQueryId(),o=this.queryInfo,s=o.networkStatus;o.networkStatus=ee.fetchMore,i.notifyOnNetworkStatusChange&&this.observe();var u=new Set;return this.queryManager.fetchQuery(a,i,ee.fetchMore).then(function(l){return n.queryManager.removeQuery(a),o.networkStatus===ee.fetchMore&&(o.networkStatus=s),n.queryManager.cache.batch({update:function(f){var d=r.updateQuery;d?f.updateQuery({query:n.query,variables:n.variables,returnPartialData:!0,optimistic:!1},function(h){return d(h,{fetchMoreResult:l.data,variables:i.variables})}):f.writeQuery({query:i.query,variables:i.variables,data:l.data})},onWatchUpdated:function(f){u.add(f.query)}}),l}).finally(function(){u.has(n.query)||ko(n)})},e.prototype.subscribeToMore=function(r){var n=this,i=this.queryManager.startGraphQLSubscription({query:r.document,variables:r.variables,context:r.context}).subscribe({next:function(a){var o=r.updateQuery;o&&n.updateQuery(function(s,u){var l=u.variables;return o(s,{subscriptionData:a,variables:l})})},error:function(a){if(r.onError){r.onError(a);return}__DEV__&&I.error("Unhandled GraphQL subscription error",a)}});return this.subscriptions.add(i),function(){n.subscriptions.delete(i)&&i.unsubscribe()}},e.prototype.setOptions=function(r){return this.reobserve(r)},e.prototype.setVariables=function(r){return se(this.variables,r)?this.observers.size?this.result():Promise.resolve():(this.options.variables=r,this.observers.size?this.reobserve({fetchPolicy:this.options.initialFetchPolicy,variables:r},ee.setVariables):Promise.resolve())},e.prototype.updateQuery=function(r){var n=this.queryManager,i=n.cache.diff({query:this.options.query,variables:this.variables,returnPartialData:!0,optimistic:!1}).result,a=r(i,{variables:this.variables});a&&(n.cache.writeQuery({query:this.options.query,data:a,variables:this.variables}),n.broadcastQueries())},e.prototype.startPolling=function(r){this.options.pollInterval=r,this.updatePolling()},e.prototype.stopPolling=function(){this.options.pollInterval=0,this.updatePolling()},e.prototype.applyNextFetchPolicy=function(r,n){if(n.nextFetchPolicy){var i=n.fetchPolicy,a=i===void 0?"cache-first":i,o=n.initialFetchPolicy,s=o===void 0?a:o;a==="standby"||(typeof n.nextFetchPolicy=="function"?n.fetchPolicy=n.nextFetchPolicy(a,{reason:r,options:n,observable:this,initialFetchPolicy:s}):r==="variables-changed"?n.fetchPolicy=s:n.fetchPolicy=n.nextFetchPolicy)}return n.fetchPolicy},e.prototype.fetch=function(r,n){return this.queryManager.setObservableQuery(this),this.queryManager.fetchQueryObservable(this.queryId,r,n)},e.prototype.updatePolling=function(){var r=this;if(!this.queryManager.ssrMode){var n=this,i=n.pollingInfo,a=n.options.pollInterval;if(!a){i&&(clearTimeout(i.timeout),delete this.pollingInfo);return}if(!(i&&i.interval===a)){__DEV__?I(a,"Attempted to start a polling query without a polling interval."):I(a,13);var o=i||(this.pollingInfo={});o.interval=a;var s=function(){r.pollingInfo&&(Vt(r.queryInfo.networkStatus)?u():r.reobserve({fetchPolicy:r.options.initialFetchPolicy==="no-cache"?"no-cache":"network-only"},ee.poll).then(u,u))},u=function(){var l=r.pollingInfo;l&&(clearTimeout(l.timeout),l.timeout=setTimeout(s,l.interval))};u()}}},e.prototype.updateLastResult=function(r,n){return n===void 0&&(n=this.variables),this.last=m(m({},this.last),{result:this.queryManager.assumeImmutableResults?r:pi(r),variables:n}),we(r.errors)||delete this.last.error,this.last},e.prototype.reobserve=function(r,n){var i=this;this.isTornDown=!1;var a=n===ee.refetch||n===ee.fetchMore||n===ee.poll,o=this.options.variables,s=this.options.fetchPolicy,u=jt(this.options,r||{}),l=a?u:Lf(this.options,u);a||(this.updatePolling(),r&&r.variables&&!se(r.variables,o)&&l.fetchPolicy!=="standby"&&l.fetchPolicy===s&&(this.applyNextFetchPolicy("variables-changed",l),n===void 0&&(n=ee.setVariables)));var f=l.variables&&m({},l.variables),d=this.fetch(l,n),h={next:function(p){i.reportResult(p,f)},error:function(p){i.reportError(p,f)}};return a||(this.concast&&this.observer&&this.concast.removeObserver(this.observer),this.concast=d,this.observer=h),d.addObserver(h),d.promise},e.prototype.observe=function(){this.reportResult(this.getCurrentResult(!1),this.variables)},e.prototype.reportResult=function(r,n){var i=this.getLastError();(i||this.isDifferentFromLastResult(r,n))&&((i||!r.partial||this.options.returnPartialData)&&this.updateLastResult(r,n),sr(this.observers,"next",r))},e.prototype.reportError=function(r,n){var i=m(m({},this.getLastResult()),{error:r,errors:r.graphQLErrors,networkStatus:ee.error,loading:!1});this.updateLastResult(i,n),sr(this.observers,"error",this.last.error=r)},e.prototype.hasObservers=function(){return this.observers.size>0},e.prototype.tearDownQuery=function(){this.isTornDown||(this.concast&&this.observer&&(this.concast.removeObserver(this.observer),delete this.concast,delete this.observer),this.stopPolling(),this.subscriptions.forEach(function(r){return r.unsubscribe()}),this.subscriptions.clear(),this.queryManager.stopQuery(this.queryId),this.observers.clear(),this.isTornDown=!0)},e}(B);hi(Ri);function ko(t){var e=t.options,r=e.fetchPolicy,n=e.nextFetchPolicy;return r==="cache-and-network"||r==="network-only"?t.reobserve({fetchPolicy:"cache-first",nextFetchPolicy:function(){return this.nextFetchPolicy=n,typeof n=="function"?n.apply(this,arguments):r}}):t.reobserve()}function Mf(t){__DEV__&&I.error("Unhandled error",t.message,t.stack)}function No(t){__DEV__&&t&&__DEV__&&I.debug("Missing cache result fields: ".concat(JSON.stringify(t)),t)}var Li=function(){function t(e){var r=e.cache,n=e.client,i=e.resolvers,a=e.fragmentMatcher;this.selectionsToResolveCache=new WeakMap,this.cache=r,n&&(this.client=n),i&&this.addResolvers(i),a&&this.setFragmentMatcher(a)}return t.prototype.addResolvers=function(e){var r=this;this.resolvers=this.resolvers||{},Array.isArray(e)?e.forEach(function(n){r.resolvers=Va(r.resolvers,n)}):this.resolvers=Va(this.resolvers,e)},t.prototype.setResolvers=function(e){this.resolvers={},this.addResolvers(e)},t.prototype.getResolvers=function(){return this.resolvers||{}},t.prototype.runResolvers=function(e){var r=e.document,n=e.remoteResult,i=e.context,a=e.variables,o=e.onlyRunForcedResolvers,s=o===void 0?!1:o;return nt(this,void 0,void 0,function(){return it(this,function(u){return r?[2,this.resolveDocument(r,n.data,i,a,this.fragmentMatcher,s).then(function(l){return m(m({},n),{data:l.result})})]:[2,n]})})},t.prototype.setFragmentMatcher=function(e){this.fragmentMatcher=e},t.prototype.getFragmentMatcher=function(){return this.fragmentMatcher},t.prototype.clientQuery=function(e){return Ar(["client"],e)&&this.resolvers?e:null},t.prototype.serverQuery=function(e){return qa(e)},t.prototype.prepareContext=function(e){var r=this.cache;return m(m({},e),{cache:r,getCacheKey:function(n){return r.identify(n)}})},t.prototype.addExportedVariables=function(e,r,n){return r===void 0&&(r={}),n===void 0&&(n={}),nt(this,void 0,void 0,function(){return it(this,function(i){return e?[2,this.resolveDocument(e,this.buildRootValueFromCache(e,r)||{},this.prepareContext(n),r).then(function(a){return m(m({},r),a.exportedVariables)})]:[2,m({},r)]})})},t.prototype.shouldForceResolvers=function(e){var r=!1;return Ae(e,{Directive:{enter:function(n){if(n.name.value==="client"&&n.arguments&&(r=n.arguments.some(function(i){return i.name.value==="always"&&i.value.kind==="BooleanValue"&&i.value.value===!0}),r))return er}}}),r},t.prototype.buildRootValueFromCache=function(e,r){return this.cache.diff({query:Ua(e),variables:r,returnPartialData:!0,optimistic:!1}).result},t.prototype.resolveDocument=function(e,r,n,i,a,o){return n===void 0&&(n={}),i===void 0&&(i={}),a===void 0&&(a=function(){return!0}),o===void 0&&(o=!1),nt(this,void 0,void 0,function(){var s,u,l,f,d,h,p,y,g,S,T;return it(this,function(b){return s=ir(e),u=nr(e),l=tr(u),f=this.collectSelectionsToResolve(s,l),d=s.operation,h=d?d.charAt(0).toUpperCase()+d.slice(1):"Query",p=this,y=p.cache,g=p.client,S={fragmentMap:l,context:m(m({},n),{cache:y,client:g}),variables:i,fragmentMatcher:a,defaultOperationType:h,exportedVariables:{},selectionsToResolve:f,onlyRunForcedResolvers:o},T=!1,[2,this.resolveSelectionSet(s.selectionSet,T,r,S).then(function(w){return{result:w,exportedVariables:S.exportedVariables}})]})})},t.prototype.resolveSelectionSet=function(e,r,n,i){return nt(this,void 0,void 0,function(){var a,o,s,u,l,f=this;return it(this,function(d){return a=i.fragmentMap,o=i.context,s=i.variables,u=[n],l=function(h){return nt(f,void 0,void 0,function(){var p,y;return it(this,function(g){return!r&&!i.selectionsToResolve.has(h)?[2]:Et(h,s)?ze(h)?[2,this.resolveField(h,r,n,i).then(function(S){var T;typeof S<"u"&&u.push((T={},T[Ze(h)]=S,T))})]:(Fa(h)?p=h:(p=a[h.name.value],__DEV__?I(p,"No fragment named ".concat(h.name.value)):I(p,11)),p&&p.typeCondition&&(y=p.typeCondition.name.value,i.fragmentMatcher(n,y,o))?[2,this.resolveSelectionSet(p.selectionSet,r,n,i).then(function(S){u.push(S)})]:[2]):[2]})})},[2,Promise.all(e.selections.map(l)).then(function(){return gn(u)})]})})},t.prototype.resolveField=function(e,r,n,i){return nt(this,void 0,void 0,function(){var a,o,s,u,l,f,d,h,p,y=this;return it(this,function(g){return n?(a=i.variables,o=e.name.value,s=Ze(e),u=o!==s,l=n[s]||n[o],f=Promise.resolve(l),(!i.onlyRunForcedResolvers||this.shouldForceResolvers(e))&&(d=n.__typename||i.defaultOperationType,h=this.resolvers&&this.resolvers[d],h&&(p=h[u?o:s],p&&(f=Promise.resolve(Vr.withValue(this.cache,p,[n,Tt(e,a),i.context,{field:e,fragmentMap:i.fragmentMap}]))))),[2,f.then(function(S){var T,b;if(S===void 0&&(S=l),e.directives&&e.directives.forEach(function(O){O.name.value==="export"&&O.arguments&&O.arguments.forEach(function(N){N.name.value==="as"&&N.value.kind==="StringValue"&&(i.exportedVariables[N.value.value]=S)})}),!e.selectionSet||S==null)return S;var w=(b=(T=e.directives)===null||T===void 0?void 0:T.some(function(O){return O.name.value==="client"}))!==null&&b!==void 0?b:!1;if(Array.isArray(S))return y.resolveSubSelectedArray(e,r||w,S,i);if(e.selectionSet)return y.resolveSelectionSet(e.selectionSet,r||w,S,i)})]):[2,null]})})},t.prototype.resolveSubSelectedArray=function(e,r,n,i){var a=this;return Promise.all(n.map(function(o){if(o===null)return null;if(Array.isArray(o))return a.resolveSubSelectedArray(e,r,o,i);if(e.selectionSet)return a.resolveSelectionSet(e.selectionSet,r,o,i)}))},t.prototype.collectSelectionsToResolve=function(e,r){var n=function(o){return!Array.isArray(o)},i=this.selectionsToResolveCache;function a(o){if(!i.has(o)){var s=new Set;i.set(o,s),Ae(o,{Directive:function(u,l,f,d,h){u.name.value==="client"&&h.forEach(function(p){n(p)&&pn(p)&&s.add(p)})},FragmentSpread:function(u,l,f,d,h){var p=r[u.name.value];__DEV__?I(p,"No fragment named ".concat(u.name.value)):I(p,12);var y=a(p);y.size>0&&(h.forEach(function(g){n(g)&&pn(g)&&s.add(g)}),s.add(u),y.forEach(function(g){s.add(g)}))}})}return i.get(o)}return a(e)},t}();var Qr=new(et?WeakMap:Map);function Ao(t,e){var r=t[e];typeof r=="function"&&(t[e]=function(){return Qr.set(t,(Qr.get(t)+1)%1e15),r.apply(this,arguments)})}function eu(t){t.notifyTimeout&&(clearTimeout(t.notifyTimeout),t.notifyTimeout=void 0)}var Fi=function(){function t(e,r){r===void 0&&(r=e.generateQueryId()),this.queryId=r,this.listeners=new Set,this.document=null,this.lastRequestId=1,this.subscriptions=new Set,this.stopped=!1,this.dirty=!1,this.observableQuery=null;var n=this.cache=e.cache;Qr.has(n)||(Qr.set(n,0),Ao(n,"evict"),Ao(n,"modify"),Ao(n,"reset"))}return t.prototype.init=function(e){var r=e.networkStatus||ee.loading;return this.variables&&this.networkStatus!==ee.loading&&!se(this.variables,e.variables)&&(r=ee.setVariables),se(e.variables,this.variables)||(this.lastDiff=void 0),Object.assign(this,{document:e.document,variables:e.variables,networkError:null,graphQLErrors:this.graphQLErrors||[],networkStatus:r}),e.observableQuery&&this.setObservableQuery(e.observableQuery),e.lastRequestId&&(this.lastRequestId=e.lastRequestId),this},t.prototype.reset=function(){eu(this),this.dirty=!1},t.prototype.getDiff=function(e){e===void 0&&(e=this.variables);var r=this.getDiffOptions(e);if(this.lastDiff&&se(r,this.lastDiff.options))return this.lastDiff.diff;this.updateWatch(this.variables=e);var n=this.observableQuery;if(n&&n.options.fetchPolicy==="no-cache")return{complete:!1};var i=this.cache.diff(r);return this.updateLastDiff(i,r),i},t.prototype.updateLastDiff=function(e,r){this.lastDiff=e?{diff:e,options:r||this.getDiffOptions()}:void 0},t.prototype.getDiffOptions=function(e){var r;return e===void 0&&(e=this.variables),{query:this.document,variables:e,returnPartialData:!0,optimistic:!0,canonizeResults:(r=this.observableQuery)===null||r===void 0?void 0:r.options.canonizeResults}},t.prototype.setDiff=function(e){var r=this,n=this.lastDiff&&this.lastDiff.diff;this.updateLastDiff(e),!this.dirty&&!se(n&&n.result,e&&e.result)&&(this.dirty=!0,this.notifyTimeout||(this.notifyTimeout=setTimeout(function(){return r.notify()},0)))},t.prototype.setObservableQuery=function(e){var r=this;e!==this.observableQuery&&(this.oqListener&&this.listeners.delete(this.oqListener),this.observableQuery=e,e?(e.queryInfo=this,this.listeners.add(this.oqListener=function(){var n=r.getDiff();n.fromOptimisticTransaction?e.observe():ko(e)})):delete this.oqListener)},t.prototype.notify=function(){var e=this;eu(this),this.shouldNotify()&&this.listeners.forEach(function(r){return r(e)}),this.dirty=!1},t.prototype.shouldNotify=function(){if(!this.dirty||!this.listeners.size)return!1;if(Vt(this.networkStatus)&&this.observableQuery){var e=this.observableQuery.options.fetchPolicy;if(e!=="cache-only"&&e!=="cache-and-network")return!1}return!0},t.prototype.stop=function(){if(!this.stopped){this.stopped=!0,this.reset(),this.cancel(),this.cancel=t.prototype.cancel,this.subscriptions.forEach(function(r){return r.unsubscribe()});var e=this.observableQuery;e&&e.stopPolling()}},t.prototype.cancel=function(){},t.prototype.updateWatch=function(e){var r=this;e===void 0&&(e=this.variables);var n=this.observableQuery;if(!(n&&n.options.fetchPolicy==="no-cache")){var i=m(m({},this.getDiffOptions(e)),{watcher:this,callback:function(a){return r.setDiff(a)}});(!this.lastWatch||!se(i,this.lastWatch))&&(this.cancel(),this.cancel=this.cache.watch(this.lastWatch=i))}},t.prototype.resetLastWrite=function(){this.lastWrite=void 0},t.prototype.shouldWrite=function(e,r){var n=this.lastWrite;return!(n&&n.dmCount===Qr.get(this.cache)&&se(r,n.variables)&&se(e.data,n.result.data))},t.prototype.markResult=function(e,r,n,i){var a=this,o=new Ve,s=we(e.errors)?e.errors.slice(0):[];if(this.reset(),"incremental"in e&&we(e.incremental)){var u=mi(this.getDiff().result,e);e.data=u}else if("hasNext"in e&&e.hasNext){var l=this.getDiff();e.data=o.merge(l.result,e.data)}this.graphQLErrors=s,n.fetchPolicy==="no-cache"?this.updateLastDiff({result:e.data,complete:!0},this.getDiffOptions(n.variables)):i!==0&&(Mi(e,n.errorPolicy)?this.cache.performTransaction(function(f){if(a.shouldWrite(e,n.variables))f.writeQuery({query:r,data:e.data,variables:n.variables,overwrite:i===1}),a.lastWrite={result:e,variables:n.variables,dmCount:Qr.get(a.cache)};else if(a.lastDiff&&a.lastDiff.diff.complete){e.data=a.lastDiff.diff.result;return}var d=a.getDiffOptions(n.variables),h=f.diff(d);a.stopped||a.updateWatch(n.variables),a.updateLastDiff(h,d),h.complete&&(e.data=h.result)}):this.lastWrite=void 0)},t.prototype.markReady=function(){return this.networkError=null,this.networkStatus=ee.ready},t.prototype.markError=function(e){return this.networkStatus=ee.error,this.lastWrite=void 0,this.reset(),e.graphQLErrors&&(this.graphQLErrors=e.graphQLErrors),e.networkError&&(this.networkError=e.networkError),e},t}();function Mi(t,e){e===void 0&&(e="none");var r=e==="ignore"||e==="all",n=!Mr(t);return!n&&r&&t.data&&(n=!0),n}var jf=Object.prototype.hasOwnProperty,tu=function(){function t(e){var r=e.cache,n=e.link,i=e.defaultOptions,a=e.queryDeduplication,o=a===void 0?!1:a,s=e.onBroadcast,u=e.ssrMode,l=u===void 0?!1:u,f=e.clientAwareness,d=f===void 0?{}:f,h=e.localState,p=e.assumeImmutableResults;this.clientAwareness={},this.queries=new Map,this.fetchCancelFns=new Map,this.transformCache=new(et?WeakMap:Map),this.queryIdCounter=1,this.requestIdCounter=1,this.mutationIdCounter=1,this.inFlightLinkObservables=new Map,this.cache=r,this.link=n,this.defaultOptions=i||Object.create(null),this.queryDeduplication=o,this.clientAwareness=d,this.localState=h||new Li({cache:r}),this.ssrMode=l,this.assumeImmutableResults=!!p,(this.onBroadcast=s)&&(this.mutationStore=Object.create(null))}return t.prototype.stop=function(){var e=this;this.queries.forEach(function(r,n){e.stopQueryNoBroadcast(n)}),this.cancelPendingFetches(__DEV__?new $("QueryManager stopped while query was in flight"):new $(14))},t.prototype.cancelPendingFetches=function(e){this.fetchCancelFns.forEach(function(r){return r(e)}),this.fetchCancelFns.clear()},t.prototype.mutate=function(e){var r,n,i=e.mutation,a=e.variables,o=e.optimisticResponse,s=e.updateQueries,u=e.refetchQueries,l=u===void 0?[]:u,f=e.awaitRefetchQueries,d=f===void 0?!1:f,h=e.update,p=e.onQueryUpdated,y=e.fetchPolicy,g=y===void 0?((r=this.defaultOptions.mutate)===null||r===void 0?void 0:r.fetchPolicy)||"network-only":y,S=e.errorPolicy,T=S===void 0?((n=this.defaultOptions.mutate)===null||n===void 0?void 0:n.errorPolicy)||"none":S,b=e.keepRootFields,w=e.context;return nt(this,void 0,void 0,function(){var O,N,A,k,C,te;return it(this,function(Z){switch(Z.label){case 0:return __DEV__?I(i,"mutation option is required. You must specify your GraphQL document in the mutation option."):I(i,15),__DEV__?I(g==="network-only"||g==="no-cache","Mutations support only 'network-only' or 'no-cache' fetchPolicy strings. The default `network-only` behavior automatically writes mutation results to the cache. Passing `no-cache` skips the cache write."):I(g==="network-only"||g==="no-cache",16),O=this.generateMutationId(),N=this.transform(i),A=N.document,k=N.hasClientExports,i=this.cache.transformForLink(A),a=this.getVariables(i,a),k?[4,this.localState.addExportedVariables(i,a,w)]:[3,2];case 1:a=Z.sent(),Z.label=2;case 2:return C=this.mutationStore&&(this.mutationStore[O]={mutation:i,variables:a,loading:!0,error:null}),o&&this.markMutationOptimistic(o,{mutationId:O,document:i,variables:a,fetchPolicy:g,errorPolicy:T,context:w,updateQueries:s,update:h,keepRootFields:b}),this.broadcastQueries(),te=this,[2,new Promise(function(ft,_t){return di(te.getObservableFromLink(i,m(m({},w),{optimisticResponse:o}),a,!1),function(Te){if(Mr(Te)&&T==="none")throw new Ot({graphQLErrors:yi(Te)});C&&(C.loading=!1,C.error=null);var q=m({},Te);return typeof l=="function"&&(l=l(q)),T==="ignore"&&Mr(q)&&delete q.errors,te.markMutationResult({mutationId:O,result:q,document:i,variables:a,fetchPolicy:g,errorPolicy:T,context:w,update:h,updateQueries:s,awaitRefetchQueries:d,refetchQueries:l,removeOptimistic:o?O:void 0,onQueryUpdated:p,keepRootFields:b})}).subscribe({next:function(Te){te.broadcastQueries(),(!("hasNext"in Te)||Te.hasNext===!1)&&ft(Te)},error:function(Te){C&&(C.loading=!1,C.error=Te),o&&te.cache.removeOptimistic(O),te.broadcastQueries(),_t(Te instanceof Ot?Te:new Ot({networkError:Te}))}})})]}})})},t.prototype.markMutationResult=function(e,r){var n=this;r===void 0&&(r=this.cache);var i=e.result,a=[],o=e.fetchPolicy==="no-cache";if(!o&&Mi(i,e.errorPolicy)){if(Mt(i)||a.push({result:i.data,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}),Mt(i)&&we(i.incremental)){var s=r.diff({id:"ROOT_MUTATION",query:this.transform(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0}),u=void 0;s.result&&(u=mi(s.result,i)),typeof u<"u"&&(i.data=u,a.push({result:u,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}))}var l=e.updateQueries;l&&this.queries.forEach(function(d,h){var p=d.observableQuery,y=p&&p.queryName;if(!(!y||!jf.call(l,y))){var g=l[y],S=n.queries.get(h),T=S.document,b=S.variables,w=r.diff({query:T,variables:b,returnPartialData:!0,optimistic:!1}),O=w.result,N=w.complete;if(N&&O){var A=g(O,{mutationResult:i,queryName:T&&Cr(T)||void 0,queryVariables:b});A&&a.push({result:A,dataId:"ROOT_QUERY",query:T,variables:b})}}})}if(a.length>0||e.refetchQueries||e.update||e.onQueryUpdated||e.removeOptimistic){var f=[];if(this.refetchQueries({updateCache:function(d){o||a.forEach(function(g){return d.write(g)});var h=e.update,p=!js(i)||Mt(i)&&!i.hasNext;if(h){if(!o){var y=d.diff({id:"ROOT_MUTATION",query:n.transform(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0});y.complete&&(i=m(m({},i),{data:y.result}),"incremental"in i&&delete i.incremental,"hasNext"in i&&delete i.hasNext)}p&&h(d,i,{context:e.context,variables:e.variables})}!o&&!e.keepRootFields&&p&&d.modify({id:"ROOT_MUTATION",fields:function(g,S){var T=S.fieldName,b=S.DELETE;return T==="__typename"?g:b}})},include:e.refetchQueries,optimistic:!1,removeOptimistic:e.removeOptimistic,onQueryUpdated:e.onQueryUpdated||null}).forEach(function(d){return f.push(d)}),e.awaitRefetchQueries||e.onQueryUpdated)return Promise.all(f).then(function(){return i})}return Promise.resolve(i)},t.prototype.markMutationOptimistic=function(e,r){var n=this,i=typeof e=="function"?e(r.variables):e;return this.cache.recordOptimisticTransaction(function(a){try{n.markMutationResult(m(m({},r),{result:{data:i}}),a)}catch(o){__DEV__&&I.error(o)}},r.mutationId)},t.prototype.fetchQuery=function(e,r,n){return this.fetchQueryObservable(e,r,n).promise},t.prototype.getQueryStore=function(){var e=Object.create(null);return this.queries.forEach(function(r,n){e[n]={variables:r.variables,networkStatus:r.networkStatus,networkError:r.networkError,graphQLErrors:r.graphQLErrors}}),e},t.prototype.resetErrors=function(e){var r=this.queries.get(e);r&&(r.networkError=void 0,r.graphQLErrors=[])},t.prototype.transform=function(e){var r=this.transformCache;if(!r.has(e)){var n=this.cache.transformDocument(e),i=$a(n),a=this.localState.clientQuery(n),o=i&&this.localState.serverQuery(i),s={document:n,hasClientExports:Pa(n),hasForcedResolvers:this.localState.shouldForceResolvers(n),clientQuery:a,serverQuery:o,defaultVars:ar(yt(n)),asQuery:m(m({},n),{definitions:n.definitions.map(function(l){return l.kind==="OperationDefinition"&&l.operation!=="query"?m(m({},l),{operation:"query"}):l})})},u=function(l){l&&!r.has(l)&&r.set(l,s)};u(e),u(n),u(a),u(o)}return r.get(e)},t.prototype.getVariables=function(e,r){return m(m({},this.transform(e).defaultVars),r)},t.prototype.watchQuery=function(e){e=m(m({},e),{variables:this.getVariables(e.query,e.variables)}),typeof e.notifyOnNetworkStatusChange>"u"&&(e.notifyOnNetworkStatusChange=!1);var r=new Fi(this),n=new Ri({queryManager:this,queryInfo:r,options:e});return this.queries.set(n.queryId,r),r.init({document:n.query,observableQuery:n,variables:n.variables}),n},t.prototype.query=function(e,r){var n=this;return r===void 0&&(r=this.generateQueryId()),__DEV__?I(e.query,"query option is required. You must specify your GraphQL document in the query option."):I(e.query,17),__DEV__?I(e.query.kind==="Document",'You must wrap the query string in a "gql" tag.'):I(e.query.kind==="Document",18),__DEV__?I(!e.returnPartialData,"returnPartialData option only supported on watchQuery."):I(!e.returnPartialData,19),__DEV__?I(!e.pollInterval,"pollInterval option only supported on watchQuery."):I(!e.pollInterval,20),this.fetchQuery(r,e).finally(function(){return n.stopQuery(r)})},t.prototype.generateQueryId=function(){return String(this.queryIdCounter++)},t.prototype.generateRequestId=function(){return this.requestIdCounter++},t.prototype.generateMutationId=function(){return String(this.mutationIdCounter++)},t.prototype.stopQueryInStore=function(e){this.stopQueryInStoreNoBroadcast(e),this.broadcastQueries()},t.prototype.stopQueryInStoreNoBroadcast=function(e){var r=this.queries.get(e);r&&r.stop()},t.prototype.clearStore=function(e){return e===void 0&&(e={discardWatches:!0}),this.cancelPendingFetches(__DEV__?new $("Store reset while query was in flight (not completed in link chain)"):new $(21)),this.queries.forEach(function(r){r.observableQuery?r.networkStatus=ee.loading:r.stop()}),this.mutationStore&&(this.mutationStore=Object.create(null)),this.cache.reset(e)},t.prototype.getObservableQueries=function(e){var r=this;e===void 0&&(e="active");var n=new Map,i=new Map,a=new Set;return Array.isArray(e)&&e.forEach(function(o){typeof o=="string"?i.set(o,!1):Ra(o)?i.set(r.transform(o).document,!1):z(o)&&o.query&&a.add(o)}),this.queries.forEach(function(o,s){var u=o.observableQuery,l=o.document;if(u){if(e==="all"){n.set(s,u);return}var f=u.queryName,d=u.options.fetchPolicy;if(d==="standby"||e==="active"&&!u.hasObservers())return;(e==="active"||f&&i.has(f)||l&&i.has(l))&&(n.set(s,u),f&&i.set(f,!0),l&&i.set(l,!0))}}),a.size&&a.forEach(function(o){var s=Sn("legacyOneTimeQuery"),u=r.getQuery(s).init({document:o.query,variables:o.variables}),l=new Ri({queryManager:r,queryInfo:u,options:m(m({},o),{fetchPolicy:"network-only"})});I(l.queryId===s),u.setObservableQuery(l),n.set(s,l)}),__DEV__&&i.size&&i.forEach(function(o,s){o||__DEV__&&I.warn("Unknown query ".concat(typeof s=="string"?"named ":"").concat(JSON.stringify(s,null,2)," requested in refetchQueries options.include array"))}),n},t.prototype.reFetchObservableQueries=function(e){var r=this;e===void 0&&(e=!1);var n=[];return this.getObservableQueries(e?"all":"active").forEach(function(i,a){var o=i.options.fetchPolicy;i.resetLastResults(),(e||o!=="standby"&&o!=="cache-only")&&n.push(i.refetch()),r.getQuery(a).setDiff(null)}),this.broadcastQueries(),Promise.all(n)},t.prototype.setObservableQuery=function(e){this.getQuery(e.queryId).setObservableQuery(e)},t.prototype.startGraphQLSubscription=function(e){var r=this,n=e.query,i=e.fetchPolicy,a=e.errorPolicy,o=e.variables,s=e.context,u=s===void 0?{}:s;n=this.transform(n).document,o=this.getVariables(n,o);var l=function(d){return r.getObservableFromLink(n,u,d).map(function(h){if(i!=="no-cache"&&(Mi(h,a)&&r.cache.write({query:n,result:h.data,dataId:"ROOT_SUBSCRIPTION",variables:d}),r.broadcastQueries()),Mr(h))throw new Ot({graphQLErrors:h.errors});return h})};if(this.transform(n).hasClientExports){var f=this.localState.addExportedVariables(n,o,u).then(l);return new B(function(d){var h=null;return f.then(function(p){return h=p.subscribe(d)},d.error),function(){return h&&h.unsubscribe()}})}return l(o)},t.prototype.stopQuery=function(e){this.stopQueryNoBroadcast(e),this.broadcastQueries()},t.prototype.stopQueryNoBroadcast=function(e){this.stopQueryInStoreNoBroadcast(e),this.removeQuery(e)},t.prototype.removeQuery=function(e){this.fetchCancelFns.delete(e),this.queries.has(e)&&(this.getQuery(e).stop(),this.queries.delete(e))},t.prototype.broadcastQueries=function(){this.onBroadcast&&this.onBroadcast(),this.queries.forEach(function(e){return e.notify()})},t.prototype.getLocalState=function(){return this.localState},t.prototype.getObservableFromLink=function(e,r,n,i){var a=this,o;i===void 0&&(i=(o=r?.queryDeduplication)!==null&&o!==void 0?o:this.queryDeduplication);var s,u=this.transform(e).serverQuery;if(u){var l=this,f=l.inFlightLinkObservables,d=l.link,h={query:u,variables:n,operationName:Cr(u)||void 0,context:this.prepareContext(m(m({},r),{forceFetch:!i}))};if(r=h.context,i){var p=f.get(u)||new Map;f.set(u,p);var y=Je(n);if(s=p.get(y),!s){var g=new Fr([jr(d,h)]);p.set(y,s=g),g.beforeNext(function(){p.delete(y)&&p.size<1&&f.delete(u)})}}else s=new Fr([jr(d,h)])}else s=new Fr([B.of({data:{}})]),r=this.prepareContext(r);var S=this.transform(e).clientQuery;return S&&(s=di(s,function(T){return a.localState.runResolvers({document:S,remoteResult:T,context:r,variables:n})})),s},t.prototype.getResultsFromLink=function(e,r,n){var i=e.lastRequestId=this.generateRequestId(),a=this.cache.transformForLink(this.transform(e.document).document);return di(this.getObservableFromLink(a,n.context,n.variables),function(o){var s=yi(o),u=s.length>0;if(i>=e.lastRequestId){if(u&&n.errorPolicy==="none")throw e.markError(new Ot({graphQLErrors:s}));e.markResult(o,a,n,r),e.markReady()}var l={data:o.data,loading:!1,networkStatus:ee.ready};return u&&n.errorPolicy!=="ignore"&&(l.errors=s,l.networkStatus=ee.error),l},function(o){var s=Zc(o)?o:new Ot({networkError:o});throw i>=e.lastRequestId&&e.markError(s),s})},t.prototype.fetchQueryObservable=function(e,r,n){var i=this;n===void 0&&(n=ee.loading);var a=this.transform(r.query).document,o=this.getVariables(a,r.variables),s=this.getQuery(e),u=this.defaultOptions.watchQuery,l=r.fetchPolicy,f=l===void 0?u&&u.fetchPolicy||"cache-first":l,d=r.errorPolicy,h=d===void 0?u&&u.errorPolicy||"none":d,p=r.returnPartialData,y=p===void 0?!1:p,g=r.notifyOnNetworkStatusChange,S=g===void 0?!1:g,T=r.context,b=T===void 0?{}:T,w=Object.assign({},r,{query:a,variables:o,fetchPolicy:f,errorPolicy:h,returnPartialData:y,notifyOnNetworkStatusChange:S,context:b}),O=function(k){w.variables=k;var C=i.fetchQueryByPolicy(s,w,n);return w.fetchPolicy!=="standby"&&C.length>0&&s.observableQuery&&s.observableQuery.applyNextFetchPolicy("after-fetch",r),C},N=function(){return i.fetchCancelFns.delete(e)};this.fetchCancelFns.set(e,function(k){N(),setTimeout(function(){return A.cancel(k)})});var A=new Fr(this.transform(w.query).hasClientExports?this.localState.addExportedVariables(w.query,w.variables,w.context).then(O):O(w.variables));return A.promise.then(N,N),A},t.prototype.refetchQueries=function(e){var r=this,n=e.updateCache,i=e.include,a=e.optimistic,o=a===void 0?!1:a,s=e.removeOptimistic,u=s===void 0?o?Sn("refetchQueries"):void 0:s,l=e.onQueryUpdated,f=new Map;i&&this.getObservableQueries(i).forEach(function(h,p){f.set(p,{oq:h,lastDiff:r.getQuery(p).getDiff()})});var d=new Map;return n&&this.cache.batch({update:n,optimistic:o&&u||!1,removeOptimistic:u,onWatchUpdated:function(h,p,y){var g=h.watcher instanceof Fi&&h.watcher.observableQuery;if(g){if(l){f.delete(g.queryId);var S=l(g,p,y);return S===!0&&(S=g.refetch()),S!==!1&&d.set(g,S),S}l!==null&&f.set(g.queryId,{oq:g,lastDiff:y,diff:p})}}}),f.size&&f.forEach(function(h,p){var y=h.oq,g=h.lastDiff,S=h.diff,T;if(l){if(!S){var b=y.queryInfo;b.reset(),S=b.getDiff()}T=l(y,S,g)}(!l||T===!0)&&(T=y.refetch()),T!==!1&&d.set(y,T),p.indexOf("legacyOneTimeQuery")>=0&&r.stopQueryNoBroadcast(p)}),u&&this.cache.removeOptimistic(u),d},t.prototype.fetchQueryByPolicy=function(e,r,n){var i=this,a=r.query,o=r.variables,s=r.fetchPolicy,u=r.refetchWritePolicy,l=r.errorPolicy,f=r.returnPartialData,d=r.context,h=r.notifyOnNetworkStatusChange,p=e.networkStatus;e.init({document:this.transform(a).document,variables:o,networkStatus:n});var y=function(){return e.getDiff(o)},g=function(O,N){N===void 0&&(N=e.networkStatus||ee.loading);var A=O.result;__DEV__&&!f&&!se(A,{})&&No(O.missing);var k=function(C){return B.of(m({data:C,loading:Vt(N),networkStatus:N},O.complete?null:{partial:!0}))};return A&&i.transform(a).hasForcedResolvers?i.localState.runResolvers({document:a,remoteResult:{data:A},context:d,variables:o,onlyRunForcedResolvers:!0}).then(function(C){return k(C.data||void 0)}):l==="none"&&N===ee.refetch&&Array.isArray(O.missing)?k(void 0):k(A)},S=s==="no-cache"?0:n===ee.refetch&&u!=="merge"?1:2,T=function(){return i.getResultsFromLink(e,S,{variables:o,context:d,fetchPolicy:s,errorPolicy:l})},b=h&&typeof p=="number"&&p!==n&&Vt(n);switch(s){default:case"cache-first":{var w=y();return w.complete?[g(w,e.markReady())]:f||b?[g(w),T()]:[T()]}case"cache-and-network":{var w=y();return w.complete||f||b?[g(w),T()]:[T()]}case"cache-only":return[g(y(),e.markReady())];case"network-only":return b?[g(y()),T()]:[T()];case"no-cache":return b?[g(e.getDiff()),T()]:[T()];case"standby":return[]}},t.prototype.getQuery=function(e){return e&&!this.queries.has(e)&&this.queries.set(e,new Fi(this,e)),this.queries.get(e)},t.prototype.prepareContext=function(e){e===void 0&&(e={});var r=this.localState.prepareContext(e);return m(m({},r),{clientAwareness:this.clientAwareness})},t}();var ru=!1;var Po=function(){function t(e){var r=this;this.resetStoreCallbacks=[],this.clearStoreCallbacks=[];var n=e.uri,i=e.credentials,a=e.headers,o=e.cache,s=e.ssrMode,u=s===void 0?!1:s,l=e.ssrForceFetchDelay,f=l===void 0?0:l,d=e.connectToDevTools,h=d===void 0?typeof window=="object"&&!window.__APOLLO_CLIENT__&&__DEV__:d,p=e.queryDeduplication,y=p===void 0?!0:p,g=e.defaultOptions,S=e.assumeImmutableResults,T=S===void 0?!1:S,b=e.resolvers,w=e.typeDefs,O=e.fragmentMatcher,N=e.name,A=e.version,k=e.link;if(k||(k=n?new ao({uri:n,credentials:i,headers:a}):tt.empty()),!o)throw __DEV__?new $(`To initialize Apollo Client, you must specify a 'cache' property in the options object.
51
+ For more information, please visit: https://go.apollo.dev/c/docs`):new $(9);if(this.link=k,this.cache=o,this.disableNetworkFetches=u||f>0,this.queryDeduplication=y,this.defaultOptions=g||Object.create(null),this.typeDefs=w,f&&setTimeout(function(){return r.disableNetworkFetches=!1},f),this.watchQuery=this.watchQuery.bind(this),this.query=this.query.bind(this),this.mutate=this.mutate.bind(this),this.resetStore=this.resetStore.bind(this),this.reFetchObservableQueries=this.reFetchObservableQueries.bind(this),h&&typeof window=="object"&&(window.__APOLLO_CLIENT__=this),!ru&&h&&__DEV__&&(ru=!0,typeof window<"u"&&window.document&&window.top===window.self&&!window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__)){var C=window.navigator,te=C&&C.userAgent,Z=void 0;typeof te=="string"&&(te.indexOf("Chrome/")>-1?Z="https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm":te.indexOf("Firefox/")>-1&&(Z="https://addons.mozilla.org/en-US/firefox/addon/apollo-developer-tools/")),Z&&__DEV__&&I.log("Download the Apollo DevTools for a better development experience: "+Z)}this.version=Vs,this.localState=new Li({cache:o,client:this,resolvers:b,fragmentMatcher:O}),this.queryManager=new tu({cache:this.cache,link:this.link,defaultOptions:this.defaultOptions,queryDeduplication:y,ssrMode:u,clientAwareness:{name:N,version:A},localState:this.localState,assumeImmutableResults:T,onBroadcast:h?function(){r.devToolsHookCb&&r.devToolsHookCb({action:{},state:{queries:r.queryManager.getQueryStore(),mutations:r.queryManager.mutationStore||{}},dataWithOptimisticResults:r.cache.extract(!0)})}:void 0})}return t.prototype.stop=function(){this.queryManager.stop()},t.prototype.watchQuery=function(e){return this.defaultOptions.watchQuery&&(e=wn(this.defaultOptions.watchQuery,e)),this.disableNetworkFetches&&(e.fetchPolicy==="network-only"||e.fetchPolicy==="cache-and-network")&&(e=m(m({},e),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(e)},t.prototype.query=function(e){return this.defaultOptions.query&&(e=wn(this.defaultOptions.query,e)),__DEV__?I(e.fetchPolicy!=="cache-and-network","The cache-and-network fetchPolicy does not work with client.query, because client.query can only return a single result. Please use client.watchQuery to receive multiple results from the cache and the network, or consider using a different fetchPolicy, such as cache-first or network-only."):I(e.fetchPolicy!=="cache-and-network",10),this.disableNetworkFetches&&e.fetchPolicy==="network-only"&&(e=m(m({},e),{fetchPolicy:"cache-first"})),this.queryManager.query(e)},t.prototype.mutate=function(e){return this.defaultOptions.mutate&&(e=wn(this.defaultOptions.mutate,e)),this.queryManager.mutate(e)},t.prototype.subscribe=function(e){return this.queryManager.startGraphQLSubscription(e)},t.prototype.readQuery=function(e,r){return r===void 0&&(r=!1),this.cache.readQuery(e,r)},t.prototype.readFragment=function(e,r){return r===void 0&&(r=!1),this.cache.readFragment(e,r)},t.prototype.writeQuery=function(e){var r=this.cache.writeQuery(e);return e.broadcast!==!1&&this.queryManager.broadcastQueries(),r},t.prototype.writeFragment=function(e){var r=this.cache.writeFragment(e);return e.broadcast!==!1&&this.queryManager.broadcastQueries(),r},t.prototype.__actionHookForDevTools=function(e){this.devToolsHookCb=e},t.prototype.__requestRaw=function(e){return jr(this.link,e)},t.prototype.resetStore=function(){var e=this;return Promise.resolve().then(function(){return e.queryManager.clearStore({discardWatches:!1})}).then(function(){return Promise.all(e.resetStoreCallbacks.map(function(r){return r()}))}).then(function(){return e.reFetchObservableQueries()})},t.prototype.clearStore=function(){var e=this;return Promise.resolve().then(function(){return e.queryManager.clearStore({discardWatches:!0})}).then(function(){return Promise.all(e.clearStoreCallbacks.map(function(r){return r()}))})},t.prototype.onResetStore=function(e){var r=this;return this.resetStoreCallbacks.push(e),function(){r.resetStoreCallbacks=r.resetStoreCallbacks.filter(function(n){return n!==e})}},t.prototype.onClearStore=function(e){var r=this;return this.clearStoreCallbacks.push(e),function(){r.clearStoreCallbacks=r.clearStoreCallbacks.filter(function(n){return n!==e})}},t.prototype.reFetchObservableQueries=function(e){return this.queryManager.reFetchObservableQueries(e)},t.prototype.refetchQueries=function(e){var r=this.queryManager.refetchQueries(e),n=[],i=[];r.forEach(function(o,s){n.push(s),i.push(o)});var a=Promise.all(i);return a.queries=n,a.results=i,a.catch(function(o){__DEV__&&I.debug("In client.refetchQueries, Promise.all promise rejected with error ".concat(o))}),a},t.prototype.getObservableQueries=function(e){return e===void 0&&(e="active"),this.queryManager.getObservableQueries(e)},t.prototype.extract=function(e){return this.cache.extract(e)},t.prototype.restore=function(e){return this.cache.restore(e)},t.prototype.addResolvers=function(e){this.localState.addResolvers(e)},t.prototype.setResolvers=function(e){this.localState.setResolvers(e)},t.prototype.getResolvers=function(){return this.localState.getResolvers()},t.prototype.setLocalStateFragmentMatcher=function(e){this.localState.setFragmentMatcher(e)},t.prototype.setLink=function(e){this.link=this.queryManager.link=e},t}();hs(Zt?"log":"silent");function Re(t){return t===null?"null":Array.isArray(t)?"array":typeof t}function xt(t){return Re(t)==="object"}function nu(t){return Array.isArray(t)&&t.length>0&&t.every(e=>"message"in e)}function Co(t,e){return t.length<124?t:e}var iu="graphql-transport-ws";var Be;(function(t){t[t.InternalServerError=4500]="InternalServerError",t[t.InternalClientError=4005]="InternalClientError",t[t.BadRequest=4400]="BadRequest",t[t.BadResponse=4004]="BadResponse",t[t.Unauthorized=4401]="Unauthorized",t[t.Forbidden=4403]="Forbidden",t[t.SubprotocolNotAcceptable=4406]="SubprotocolNotAcceptable",t[t.ConnectionInitialisationTimeout=4408]="ConnectionInitialisationTimeout",t[t.ConnectionAcknowledgementTimeout=4504]="ConnectionAcknowledgementTimeout",t[t.SubscriberAlreadyExists=4409]="SubscriberAlreadyExists",t[t.TooManyInitialisationRequests=4429]="TooManyInitialisationRequests"})(Be||(Be={}));var me;(function(t){t.ConnectionInit="connection_init",t.ConnectionAck="connection_ack",t.Ping="ping",t.Pong="pong",t.Subscribe="subscribe",t.Next="next",t.Error="error",t.Complete="complete"})(me||(me={}));function au(t){if(!xt(t))throw new Error(`Message is expected to be an object, but got ${Re(t)}`);if(!t.type)throw new Error("Message is missing the 'type' property");if(typeof t.type!="string")throw new Error(`Message is expects the 'type' property to be a string, but got ${Re(t.type)}`);switch(t.type){case me.ConnectionInit:case me.ConnectionAck:case me.Ping:case me.Pong:{if(t.payload!=null&&!xt(t.payload))throw new Error(`"${t.type}" message expects the 'payload' property to be an object or nullish or missing, but got "${t.payload}"`);break}case me.Subscribe:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${Re(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);if(!xt(t.payload))throw new Error(`"${t.type}" message expects the 'payload' property to be an object, but got ${Re(t.payload)}`);if(typeof t.payload.query!="string")throw new Error(`"${t.type}" message payload expects the 'query' property to be a string, but got ${Re(t.payload.query)}`);if(t.payload.variables!=null&&!xt(t.payload.variables))throw new Error(`"${t.type}" message payload expects the 'variables' property to be a an object or nullish or missing, but got ${Re(t.payload.variables)}`);if(t.payload.operationName!=null&&Re(t.payload.operationName)!=="string")throw new Error(`"${t.type}" message payload expects the 'operationName' property to be a string or nullish or missing, but got ${Re(t.payload.operationName)}`);if(t.payload.extensions!=null&&!xt(t.payload.extensions))throw new Error(`"${t.type}" message payload expects the 'extensions' property to be a an object or nullish or missing, but got ${Re(t.payload.extensions)}`);break}case me.Next:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${Re(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);if(!xt(t.payload))throw new Error(`"${t.type}" message expects the 'payload' property to be an object, but got ${Re(t.payload)}`);break}case me.Error:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${Re(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);if(!nu(t.payload))throw new Error(`"${t.type}" message expects the 'payload' property to be an array of GraphQL errors, but got ${JSON.stringify(t.payload)}`);break}case me.Complete:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${Re(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);break}default:throw new Error(`Invalid message 'type' property "${t.type}"`)}return t}function ou(t,e){return au(typeof t=="string"?JSON.parse(t,e):t)}function Gr(t,e){return au(t),JSON.stringify(t,e)}function su(t){let{url:e,connectionParams:r,lazy:n=!0,onNonLazyError:i=console.error,lazyCloseTimeout:a=0,keepAlive:o=0,disablePong:s,connectionAckWaitTimeout:u=0,retryAttempts:l=5,retryWait:f=async function(pe){let ae=1e3;for(let W=0;W<pe;W++)ae*=2;await new Promise(W=>setTimeout(W,ae+Math.floor(Math.random()*(3e3-300)+300)))},shouldRetry:d=ji,isFatalConnectionProblem:h,on:p,webSocketImpl:y,generateID:g=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,pe=>{let ae=Math.random()*16|0;return(pe=="x"?ae:ae&3|8).toString(16)})},jsonMessageReplacer:S,jsonMessageReviver:T}=t,b;if(y){if(!Uf(y))throw new Error("Invalid WebSocket implementation provided");b=y}else typeof WebSocket<"u"?b=WebSocket:typeof global<"u"?b=global.WebSocket||global.MozWebSocket:typeof window<"u"&&(b=window.WebSocket||window.MozWebSocket);if(!b)throw new Error("WebSocket implementation missing; on Node you can `import WebSocket from 'ws';` and pass `webSocketImpl: WebSocket` to `createClient`");let w=b,O=(()=>{let q=(()=>{let ae={};return{on(W,K){return ae[W]=K,()=>{delete ae[W]}},emit(W){var K;"id"in W&&((K=ae[W.id])===null||K===void 0||K.call(ae,W))}}})(),pe={connecting:p?.connecting?[p.connecting]:[],opened:p?.opened?[p.opened]:[],connected:p?.connected?[p.connected]:[],ping:p?.ping?[p.ping]:[],pong:p?.pong?[p.pong]:[],message:p?.message?[q.emit,p.message]:[q.emit],closed:p?.closed?[p.closed]:[],error:p?.error?[p.error]:[]};return{onMessage:q.on,on(ae,W){let K=pe[ae];return K.push(W),()=>{K.splice(K.indexOf(W),1)}},emit(ae,...W){for(let K of[...pe[ae]])K(...W)}}})();function N(q){let pe=[O.on("error",ae=>{pe.forEach(W=>W()),q(ae)}),O.on("closed",ae=>{pe.forEach(W=>W()),q(ae)})]}let A,k=0,C,te=!1,Z=0,ft=!1;async function _t(){clearTimeout(C);let[q,pe]=await(A??(A=new Promise((K,pt)=>(async()=>{if(te){if(await f(Z),!k)return A=void 0,pt({code:1e3,reason:"All Subscriptions Gone"});Z++}O.emit("connecting");let V=new w(typeof e=="function"?await e():e,iu),dt,Pt;function ti(){isFinite(o)&&o>0&&(clearTimeout(Pt),Pt=setTimeout(()=>{V.readyState===w.OPEN&&(V.send(Gr({type:me.Ping})),O.emit("ping",!1,void 0))},o))}N(Oe=>{A=void 0,clearTimeout(dt),clearTimeout(Pt),pt(Oe),ji(Oe)&&Oe.code===4499&&(V.close(4499,"Terminated"),V.onerror=null,V.onclose=null)}),V.onerror=Oe=>O.emit("error",Oe),V.onclose=Oe=>O.emit("closed",Oe),V.onopen=async()=>{try{O.emit("opened",V);let Oe=typeof r=="function"?await r():r;if(V.readyState!==w.OPEN)return;V.send(Gr(Oe?{type:me.ConnectionInit,payload:Oe}:{type:me.ConnectionInit},S)),isFinite(u)&&u>0&&(dt=setTimeout(()=>{V.close(Be.ConnectionAcknowledgementTimeout,"Connection acknowledgement timeout")},u)),ti()}catch(Oe){O.emit("error",Oe),V.close(Be.InternalClientError,Co(Oe instanceof Error?Oe.message:new Error(Oe).message,"Internal client error"))}};let kr=!1;V.onmessage=({data:Oe})=>{try{let xe=ou(Oe,T);if(O.emit("message",xe),xe.type==="ping"||xe.type==="pong"){O.emit(xe.type,!0,xe.payload),xe.type==="pong"?ti():s||(V.send(Gr(xe.payload?{type:me.Pong,payload:xe.payload}:{type:me.Pong})),O.emit("pong",!1,xe.payload));return}if(kr)return;if(xe.type!==me.ConnectionAck)throw new Error(`First message cannot be of type ${xe.type}`);clearTimeout(dt),kr=!0,O.emit("connected",V,xe.payload),te=!1,Z=0,K([V,new Promise((Zp,Ku)=>N(Ku))])}catch(xe){V.onmessage=null,O.emit("error",xe),V.close(Be.BadResponse,Co(xe instanceof Error?xe.message:new Error(xe).message,"Bad response"))}}})())));q.readyState===w.CLOSING&&await pe;let ae=()=>{},W=new Promise(K=>ae=K);return[q,ae,Promise.race([W.then(()=>{if(!k){let K=()=>q.close(1e3,"Normal Closure");isFinite(a)&&a>0?C=setTimeout(()=>{q.readyState===w.OPEN&&K()},a):K()}}),pe])]}function Te(q){if(ji(q)&&($f(q.code)||[Be.InternalServerError,Be.InternalClientError,Be.BadRequest,Be.BadResponse,Be.Unauthorized,Be.SubprotocolNotAcceptable,Be.SubscriberAlreadyExists,Be.TooManyInitialisationRequests].includes(q.code)))throw q;if(ft)return!1;if(ji(q)&&q.code===1e3)return k>0;if(!l||Z>=l||!d(q)||h?.(q))throw q;return te=!0}return n||(async()=>{for(k++;;)try{let[,,q]=await _t();await q}catch(q){try{if(!Te(q))return}catch(pe){return i?.(pe)}}})(),{on:O.on,subscribe(q,pe){let ae=g(q),W=!1,K=!1,pt=()=>{k--,W=!0};return(async()=>{for(k++;;)try{let[V,dt,Pt]=await _t();if(W)return dt();let ti=O.onMessage(ae,kr=>{switch(kr.type){case me.Next:{pe.next(kr.payload);return}case me.Error:{K=!0,W=!0,pe.error(kr.payload),pt();return}case me.Complete:{W=!0,pt();return}}});V.send(Gr({id:ae,type:me.Subscribe,payload:q},S)),pt=()=>{!W&&V.readyState===w.OPEN&&V.send(Gr({id:ae,type:me.Complete},S)),k--,W=!0,dt()},await Pt.finally(ti);return}catch(V){if(!Te(V))return}})().then(()=>{K||pe.complete()}).catch(V=>{pe.error(V)}),()=>{W||pt()}},async dispose(){if(ft=!0,A){let[q]=await A;q.close(1e3,"Normal Closure")}},terminate(){A&&O.emit("closed",{code:4499,reason:"Terminated",wasClean:!1})}}}function ji(t){return xt(t)&&"code"in t&&"reason"in t}function $f(t){return[1e3,1001,1006,1005,1012,1013,1013].includes(t)?!1:t>=1e3&&t<=1999}function Uf(t){return typeof t=="function"&&"constructor"in t&&"CLOSED"in t&&"CLOSING"in t&&"CONNECTING"in t&&"OPEN"in t}function qf(t){return z(t)&&"code"in t&&"reason"in t}var cu=function(t){de(e,t);function e(r){var n=t.call(this)||this;return n.client=r,n}return e.prototype.request=function(r){var n=this;return new B(function(i){return n.client.subscribe(m(m({},r),{query:Nr(r.query)}),{next:i.next.bind(i),complete:i.complete.bind(i),error:function(a){return a instanceof Error?i.error(a):qf(a)?i.error(new Error("Socket closed with event ".concat(a.code," ").concat(a.reason||""))):i.error(new Ot({graphQLErrors:Array.isArray(a)?a:[a]}))}})})},e}(tt);var na=function(){return na=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},na.apply(this,arguments)};typeof SuppressedError=="function"&&SuppressedError;function Gi(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Gi=function(r){return typeof r}:Gi=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Gi(t)}function Vf(t){return Gi(t)=="object"&&t!==null}var Au=typeof Symbol=="function"&&Symbol.toStringTag!=null?Symbol.toStringTag:"@@toStringTag";function $o(t,e){for(var r=/\r\n|[\n\r]/g,n=1,i=e+1,a;(a=r.exec(t.body))&&a.index<e;)n+=1,i=e+1-(a.index+a[0].length);return{line:n,column:i}}function Bf(t){return Pu(t.source,$o(t.source,t.start))}function Pu(t,e){var r=t.locationOffset.column-1,n=Wi(r)+t.body,i=e.line-1,a=t.locationOffset.line-1,o=e.line+a,s=e.line===1?r:0,u=e.column+s,l="".concat(t.name,":").concat(o,":").concat(u,`
52
+ `),f=n.split(/\r\n|[\n\r]/g),d=f[i];if(d.length>120){for(var h=Math.floor(u/80),p=u%80,y=[],g=0;g<d.length;g+=80)y.push(d.slice(g,g+80));return l+uu([["".concat(o),y[0]]].concat(y.slice(1,h+1).map(function(S){return["",S]}),[[" ",Wi(p-1)+"^"],["",y[h+1]]]))}return l+uu([["".concat(o-1),f[i-1]],["".concat(o),d],["",Wi(u-1)+"^"],["".concat(o+1),f[i+1]]])}function uu(t){var e=t.filter(function(n){n[0];var i=n[1];return i!==void 0}),r=Math.max.apply(Math,e.map(function(n){var i=n[0];return i.length}));return e.map(function(n){var i=n[0],a=n[1];return Qf(r,i)+(a?" | "+a:" |")}).join(`
53
+ `)}function Wi(t){return Array(t+1).join(" ")}function Qf(t,e){return Wi(t-e.length)+e}function Ki(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ki=function(r){return typeof r}:Ki=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Ki(t)}function lu(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Gf(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?lu(Object(r),!0).forEach(function(n){Wf(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):lu(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Wf(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Kf(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function fu(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function zf(t,e,r){return e&&fu(t.prototype,e),r&&fu(t,r),t}function Jf(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&zn(t,e)}function Hf(t){var e=Ru();return function(){var n=Jn(t),i;if(e){var a=Jn(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return Cu(this,i)}}function Cu(t,e){return e&&(Ki(e)==="object"||typeof e=="function")?e:Pn(t)}function Pn(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Uo(t){var e=typeof Map=="function"?new Map:void 0;return Uo=function(n){if(n===null||!Yf(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(n))return e.get(n);e.set(n,i)}function i(){return zi(n,arguments,Jn(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),zn(i,n)},Uo(t)}function zi(t,e,r){return Ru()?zi=Reflect.construct:zi=function(i,a,o){var s=[null];s.push.apply(s,a);var u=Function.bind.apply(i,s),l=new u;return o&&zn(l,o.prototype),l},zi.apply(null,arguments)}function Ru(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function Yf(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function zn(t,e){return zn=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},zn(t,e)}function Jn(t){return Jn=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},Jn(t)}var Xf=function(t){Jf(r,t);var e=Hf(r);function r(n,i,a,o,s,u,l){var f,d,h,p;Kf(this,r),p=e.call(this,n),p.name="GraphQLError",p.originalError=u??void 0,p.nodes=pu(Array.isArray(i)?i:i?[i]:void 0);for(var y=[],g=0,S=(T=p.nodes)!==null&&T!==void 0?T:[];g<S.length;g++){var T,b=S[g],w=b.loc;w!=null&&y.push(w)}y=pu(y),p.source=a??((f=y)===null||f===void 0?void 0:f[0].source),p.positions=o??((d=y)===null||d===void 0?void 0:d.map(function(N){return N.start})),p.locations=o&&a?o.map(function(N){return $o(a,N)}):(h=y)===null||h===void 0?void 0:h.map(function(N){return $o(N.source,N.start)}),p.path=s??void 0;var O=u?.extensions;return l==null&&Vf(O)?p.extensions=Gf({},O):p.extensions=l??{},Object.defineProperties(Pn(p),{message:{enumerable:!0},locations:{enumerable:p.locations!=null},path:{enumerable:p.path!=null},extensions:{enumerable:p.extensions!=null&&Object.keys(p.extensions).length>0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),u!=null&&u.stack?(Object.defineProperty(Pn(p),"stack",{value:u.stack,writable:!0,configurable:!0}),Cu(p)):(Error.captureStackTrace?Error.captureStackTrace(Pn(p),r):Object.defineProperty(Pn(p),"stack",{value:Error().stack,writable:!0,configurable:!0}),p)}return zf(r,[{key:"toString",value:function(){return Zf(this)}},{key:Au,get:function(){return"Object"}}]),r}(Uo(Error));function pu(t){return t===void 0||t.length===0?void 0:t}function Zf(t){var e=t.message;if(t.nodes)for(var r=0,n=t.nodes;r<n.length;r++){var i=n[r];i.loc&&(e+=`
54
54
 
55
- `+Uf(i.loc))}else if(t.source&&t.locations)for(var a=0,o=t.locations;a<o.length;a++){var s=o[a];e+=`
55
+ `+Bf(i.loc))}else if(t.source&&t.locations)for(var a=0,o=t.locations;a<o.length;a++){var s=o[a];e+=`
56
56
 
57
- `+ku(t.source,s)}return e}function Ye(t,e,r){return new Jf("Syntax Error: ".concat(r),void 0,t,[e])}var j=Object.freeze({NAME:"Name",DOCUMENT:"Document",OPERATION_DEFINITION:"OperationDefinition",VARIABLE_DEFINITION:"VariableDefinition",SELECTION_SET:"SelectionSet",FIELD:"Field",ARGUMENT:"Argument",FRAGMENT_SPREAD:"FragmentSpread",INLINE_FRAGMENT:"InlineFragment",FRAGMENT_DEFINITION:"FragmentDefinition",VARIABLE:"Variable",INT:"IntValue",FLOAT:"FloatValue",STRING:"StringValue",BOOLEAN:"BooleanValue",NULL:"NullValue",ENUM:"EnumValue",LIST:"ListValue",OBJECT:"ObjectValue",OBJECT_FIELD:"ObjectField",DIRECTIVE:"Directive",NAMED_TYPE:"NamedType",LIST_TYPE:"ListType",NON_NULL_TYPE:"NonNullType",SCHEMA_DEFINITION:"SchemaDefinition",OPERATION_TYPE_DEFINITION:"OperationTypeDefinition",SCALAR_TYPE_DEFINITION:"ScalarTypeDefinition",OBJECT_TYPE_DEFINITION:"ObjectTypeDefinition",FIELD_DEFINITION:"FieldDefinition",INPUT_VALUE_DEFINITION:"InputValueDefinition",INTERFACE_TYPE_DEFINITION:"InterfaceTypeDefinition",UNION_TYPE_DEFINITION:"UnionTypeDefinition",ENUM_TYPE_DEFINITION:"EnumTypeDefinition",ENUM_VALUE_DEFINITION:"EnumValueDefinition",INPUT_OBJECT_TYPE_DEFINITION:"InputObjectTypeDefinition",DIRECTIVE_DEFINITION:"DirectiveDefinition",SCHEMA_EXTENSION:"SchemaExtension",SCALAR_TYPE_EXTENSION:"ScalarTypeExtension",OBJECT_TYPE_EXTENSION:"ObjectTypeExtension",INTERFACE_TYPE_EXTENSION:"InterfaceTypeExtension",UNION_TYPE_EXTENSION:"UnionTypeExtension",ENUM_TYPE_EXTENSION:"EnumTypeExtension",INPUT_OBJECT_TYPE_EXTENSION:"InputObjectTypeExtension"});function Yf(t,e){var r=Boolean(t);if(!r)throw new Error(e??"Unexpected invariant triggered.")}var Xf=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):void 0,$o=Xf;function Pu(t){var e=t.prototype.toJSON;typeof e=="function"||Yf(0),t.prototype.inspect=e,$o&&(t.prototype[$o]=e)}var Cu=function(){function t(r,n,i){this.start=r.start,this.end=n.end,this.startToken=r,this.endToken=n,this.source=i}var e=t.prototype;return e.toJSON=function(){return{start:this.start,end:this.end}},t}();Pu(Cu);var ve=function(){function t(r,n,i,a,o,s,u){this.kind=r,this.start=n,this.end=i,this.line=a,this.column=o,this.value=u,this.prev=s,this.next=null}var e=t.prototype;return e.toJSON=function(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}},t}();Pu(ve);var _=Object.freeze({SOF:"<SOF>",EOF:"<EOF>",BANG:"!",DOLLAR:"$",AMP:"&",PAREN_L:"(",PAREN_R:")",SPREAD:"...",COLON:":",EQUALS:"=",AT:"@",BRACKET_L:"[",BRACKET_R:"]",BRACE_L:"{",PIPE:"|",BRACE_R:"}",NAME:"Name",INT:"Int",FLOAT:"Float",STRING:"String",BLOCK_STRING:"BlockString",COMMENT:"Comment"});function Wi(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Wi=function(r){return typeof r}:Wi=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Wi(t)}var Zf=10,Ru=2;function ep(t){return va(t,[])}function va(t,e){switch(Wi(t)){case"string":return JSON.stringify(t);case"function":return t.name?"[function ".concat(t.name,"]"):"[function]";case"object":return t===null?"null":tp(t,e);default:return String(t)}}function tp(t,e){if(e.indexOf(t)!==-1)return"[Circular]";var r=[].concat(e,[t]),n=ip(t);if(n!==void 0){var i=n.call(t);if(i!==t)return typeof i=="string"?i:va(i,r)}else if(Array.isArray(t))return np(t,r);return rp(t,r)}function rp(t,e){var r=Object.keys(t);if(r.length===0)return"{}";if(e.length>Ru)return"["+ap(t)+"]";var n=r.map(function(i){var a=va(t[i],e);return i+": "+a});return"{ "+n.join(", ")+" }"}function np(t,e){if(t.length===0)return"[]";if(e.length>Ru)return"[Array]";for(var r=Math.min(Zf,t.length),n=t.length-r,i=[],a=0;a<r;++a)i.push(va(t[a],e));return n===1?i.push("... 1 more item"):n>1&&i.push("... ".concat(n," more items")),"["+i.join(", ")+"]"}function ip(t){var e=t[String($o)];if(typeof e=="function")return e;if(typeof t.inspect=="function")return t.inspect}function ap(t){var e=Object.prototype.toString.call(t).replace(/^\[object /,"").replace(/]$/,"");if(e==="Object"&&typeof t.constructor=="function"){var r=t.constructor.name;if(typeof r=="string"&&r!=="")return r}return e}function No(t,e){var r=Boolean(t);if(!r)throw new Error(e)}var op=function(e,r){return e instanceof r};function lu(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function sp(t,e,r){return e&&lu(t.prototype,e),r&&lu(t,r),t}var Lu=function(){function t(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"GraphQL request",n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{line:1,column:1};typeof e=="string"||No(0,"Body must be a string. Received: ".concat(ep(e),".")),this.body=e,this.name=r,this.locationOffset=n,this.locationOffset.line>0||No(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||No(0,"column in locationOffset is 1-indexed and must be positive.")}return sp(t,[{key:Du,get:function(){return"Source"}}]),t}();function cp(t){return op(t,Lu)}var up=Object.freeze({QUERY:"QUERY",MUTATION:"MUTATION",SUBSCRIPTION:"SUBSCRIPTION",FIELD:"FIELD",FRAGMENT_DEFINITION:"FRAGMENT_DEFINITION",FRAGMENT_SPREAD:"FRAGMENT_SPREAD",INLINE_FRAGMENT:"INLINE_FRAGMENT",VARIABLE_DEFINITION:"VARIABLE_DEFINITION",SCHEMA:"SCHEMA",SCALAR:"SCALAR",OBJECT:"OBJECT",FIELD_DEFINITION:"FIELD_DEFINITION",ARGUMENT_DEFINITION:"ARGUMENT_DEFINITION",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",ENUM_VALUE:"ENUM_VALUE",INPUT_OBJECT:"INPUT_OBJECT",INPUT_FIELD_DEFINITION:"INPUT_FIELD_DEFINITION"});function lp(t){var e=t.split(/\r\n|[\n\r]/g),r=fp(t);if(r!==0)for(var n=1;n<e.length;n++)e[n]=e[n].slice(r);for(var i=0;i<e.length&&fu(e[i]);)++i;for(var a=e.length;a>i&&fu(e[a-1]);)--a;return e.slice(i,a).join(`
58
- `)}function fu(t){for(var e=0;e<t.length;++e)if(t[e]!==" "&&t[e]!==" ")return!1;return!0}function fp(t){for(var e,r=!0,n=!0,i=0,a=null,o=0;o<t.length;++o)switch(t.charCodeAt(o)){case 13:t.charCodeAt(o+1)===10&&++o;case 10:r=!1,n=!0,i=0;break;case 9:case 32:++i;break;default:n&&!r&&(a===null||i<a)&&(a=i),n=!1}return(e=a)!==null&&e!==void 0?e:0}var pp=function(){function t(r){var n=new ve(_.SOF,0,0,0,0,null);this.source=r,this.lastToken=n,this.token=n,this.line=1,this.lineStart=0}var e=t.prototype;return e.advance=function(){this.lastToken=this.token;var n=this.token=this.lookahead();return n},e.lookahead=function(){var n=this.token;if(n.kind!==_.EOF)do{var i;n=(i=n.next)!==null&&i!==void 0?i:n.next=hp(this,n)}while(n.kind===_.COMMENT);return n},t}();function dp(t){return t===_.BANG||t===_.DOLLAR||t===_.AMP||t===_.PAREN_L||t===_.PAREN_R||t===_.SPREAD||t===_.COLON||t===_.EQUALS||t===_.AT||t===_.BRACKET_L||t===_.BRACKET_R||t===_.BRACE_L||t===_.PIPE||t===_.BRACE_R}function Sr(t){return isNaN(t)?_.EOF:t<127?JSON.stringify(String.fromCharCode(t)):'"\\u'.concat(("00"+t.toString(16).toUpperCase()).slice(-4),'"')}function hp(t,e){for(var r=t.source,n=r.body,i=n.length,a=e.end;a<i;){var o=n.charCodeAt(a),s=t.line,u=1+a-t.lineStart;switch(o){case 65279:case 9:case 32:case 44:++a;continue;case 10:++a,++t.line,t.lineStart=a;continue;case 13:n.charCodeAt(a+1)===10?a+=2:++a,++t.line,t.lineStart=a;continue;case 33:return new ve(_.BANG,a,a+1,s,u,e);case 35:return yp(r,a,s,u,e);case 36:return new ve(_.DOLLAR,a,a+1,s,u,e);case 38:return new ve(_.AMP,a,a+1,s,u,e);case 40:return new ve(_.PAREN_L,a,a+1,s,u,e);case 41:return new ve(_.PAREN_R,a,a+1,s,u,e);case 46:if(n.charCodeAt(a+1)===46&&n.charCodeAt(a+2)===46)return new ve(_.SPREAD,a,a+3,s,u,e);break;case 58:return new ve(_.COLON,a,a+1,s,u,e);case 61:return new ve(_.EQUALS,a,a+1,s,u,e);case 64:return new ve(_.AT,a,a+1,s,u,e);case 91:return new ve(_.BRACKET_L,a,a+1,s,u,e);case 93:return new ve(_.BRACKET_R,a,a+1,s,u,e);case 123:return new ve(_.BRACE_L,a,a+1,s,u,e);case 124:return new ve(_.PIPE,a,a+1,s,u,e);case 125:return new ve(_.BRACE_R,a,a+1,s,u,e);case 34:return n.charCodeAt(a+1)===34&&n.charCodeAt(a+2)===34?bp(r,a,s,u,e,t):gp(r,a,s,u,e);case 45:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return vp(r,a,o,s,u,e);case 65:case 66:case 67:case 68:case 69:case 70:case 71:case 72:case 73:case 74:case 75:case 76:case 77:case 78:case 79:case 80:case 81:case 82:case 83:case 84:case 85:case 86:case 87:case 88:case 89:case 90:case 95:case 97:case 98:case 99:case 100:case 101:case 102:case 103:case 104:case 105:case 106:case 107:case 108:case 109:case 110:case 111:case 112:case 113:case 114:case 115:case 116:case 117:case 118:case 119:case 120:case 121:case 122:return wp(r,a,s,u,e)}throw Ye(r,a,mp(o))}var l=t.line,f=1+a-t.lineStart;return new ve(_.EOF,i,i,l,f,e)}function mp(t){return t<32&&t!==9&&t!==10&&t!==13?"Cannot contain the invalid character ".concat(Sr(t),"."):t===39?`Unexpected single quote character ('), did you mean to use a double quote (")?`:"Cannot parse the unexpected character ".concat(Sr(t),".")}function yp(t,e,r,n,i){var a=t.body,o,s=e;do o=a.charCodeAt(++s);while(!isNaN(o)&&(o>31||o===9));return new ve(_.COMMENT,e,s,r,n,i,a.slice(e+1,s))}function vp(t,e,r,n,i,a){var o=t.body,s=r,u=e,l=!1;if(s===45&&(s=o.charCodeAt(++u)),s===48){if(s=o.charCodeAt(++u),s>=48&&s<=57)throw Ye(t,u,"Invalid number, unexpected digit after 0: ".concat(Sr(s),"."))}else u=Po(t,u,s),s=o.charCodeAt(u);if(s===46&&(l=!0,s=o.charCodeAt(++u),u=Po(t,u,s),s=o.charCodeAt(u)),(s===69||s===101)&&(l=!0,s=o.charCodeAt(++u),(s===43||s===45)&&(s=o.charCodeAt(++u)),u=Po(t,u,s),s=o.charCodeAt(u)),s===46||_p(s))throw Ye(t,u,"Invalid number, expected digit but got: ".concat(Sr(s),"."));return new ve(l?_.FLOAT:_.INT,e,u,n,i,a,o.slice(e,u))}function Po(t,e,r){var n=t.body,i=e,a=r;if(a>=48&&a<=57){do a=n.charCodeAt(++i);while(a>=48&&a<=57);return i}throw Ye(t,i,"Invalid number, expected digit but got: ".concat(Sr(a),"."))}function gp(t,e,r,n,i){for(var a=t.body,o=e+1,s=o,u=0,l="";o<a.length&&!isNaN(u=a.charCodeAt(o))&&u!==10&&u!==13;){if(u===34)return l+=a.slice(s,o),new ve(_.STRING,e,o+1,r,n,i,l);if(u<32&&u!==9)throw Ye(t,o,"Invalid character within String: ".concat(Sr(u),"."));if(++o,u===92){switch(l+=a.slice(s,o-1),u=a.charCodeAt(o),u){case 34:l+='"';break;case 47:l+="/";break;case 92:l+="\\";break;case 98:l+="\b";break;case 102:l+="\f";break;case 110:l+=`
59
- `;break;case 114:l+="\r";break;case 116:l+=" ";break;case 117:{var f=Sp(a.charCodeAt(o+1),a.charCodeAt(o+2),a.charCodeAt(o+3),a.charCodeAt(o+4));if(f<0){var d=a.slice(o+1,o+5);throw Ye(t,o,"Invalid character escape sequence: \\u".concat(d,"."))}l+=String.fromCharCode(f),o+=4;break}default:throw Ye(t,o,"Invalid character escape sequence: \\".concat(String.fromCharCode(u),"."))}++o,s=o}}throw Ye(t,o,"Unterminated string.")}function bp(t,e,r,n,i,a){for(var o=t.body,s=e+3,u=s,l=0,f="";s<o.length&&!isNaN(l=o.charCodeAt(s));){if(l===34&&o.charCodeAt(s+1)===34&&o.charCodeAt(s+2)===34)return f+=o.slice(u,s),new ve(_.BLOCK_STRING,e,s+3,r,n,i,lp(f));if(l<32&&l!==9&&l!==10&&l!==13)throw Ye(t,s,"Invalid character within String: ".concat(Sr(l),"."));l===10?(++s,++a.line,a.lineStart=s):l===13?(o.charCodeAt(s+1)===10?s+=2:++s,++a.line,a.lineStart=s):l===92&&o.charCodeAt(s+1)===34&&o.charCodeAt(s+2)===34&&o.charCodeAt(s+3)===34?(f+=o.slice(u,s)+'"""',s+=4,u=s):++s}throw Ye(t,s,"Unterminated string.")}function Sp(t,e,r,n){return Fi(t)<<12|Fi(e)<<8|Fi(r)<<4|Fi(n)}function Fi(t){return t>=48&&t<=57?t-48:t>=65&&t<=70?t-55:t>=97&&t<=102?t-87:-1}function wp(t,e,r,n,i){for(var a=t.body,o=a.length,s=e+1,u=0;s!==o&&!isNaN(u=a.charCodeAt(s))&&(u===95||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122);)++s;return new ve(_.NAME,e,s,r,n,i,a.slice(e,s))}function _p(t){return t===95||t>=65&&t<=90||t>=97&&t<=122}function Ep(t,e){var r=new xp(t,e);return r.parseDocument()}var xp=function(){function t(r,n){var i=cp(r)?r:new Lu(r);this._lexer=new pp(i),this._options=n}var e=t.prototype;return e.parseName=function(){var n=this.expectToken(_.NAME);return{kind:j.NAME,value:n.value,loc:this.loc(n)}},e.parseDocument=function(){var n=this._lexer.token;return{kind:j.DOCUMENT,definitions:this.many(_.SOF,this.parseDefinition,_.EOF),loc:this.loc(n)}},e.parseDefinition=function(){if(this.peek(_.NAME))switch(this._lexer.token.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"schema":case"scalar":case"type":case"interface":case"union":case"enum":case"input":case"directive":return this.parseTypeSystemDefinition();case"extend":return this.parseTypeSystemExtension()}else{if(this.peek(_.BRACE_L))return this.parseOperationDefinition();if(this.peekDescription())return this.parseTypeSystemDefinition()}throw this.unexpected()},e.parseOperationDefinition=function(){var n=this._lexer.token;if(this.peek(_.BRACE_L))return{kind:j.OPERATION_DEFINITION,operation:"query",name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet(),loc:this.loc(n)};var i=this.parseOperationType(),a;return this.peek(_.NAME)&&(a=this.parseName()),{kind:j.OPERATION_DEFINITION,operation:i,name:a,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(n)}},e.parseOperationType=function(){var n=this.expectToken(_.NAME);switch(n.value){case"query":return"query";case"mutation":return"mutation";case"subscription":return"subscription"}throw this.unexpected(n)},e.parseVariableDefinitions=function(){return this.optionalMany(_.PAREN_L,this.parseVariableDefinition,_.PAREN_R)},e.parseVariableDefinition=function(){var n=this._lexer.token;return{kind:j.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(_.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(_.EQUALS)?this.parseValueLiteral(!0):void 0,directives:this.parseDirectives(!0),loc:this.loc(n)}},e.parseVariable=function(){var n=this._lexer.token;return this.expectToken(_.DOLLAR),{kind:j.VARIABLE,name:this.parseName(),loc:this.loc(n)}},e.parseSelectionSet=function(){var n=this._lexer.token;return{kind:j.SELECTION_SET,selections:this.many(_.BRACE_L,this.parseSelection,_.BRACE_R),loc:this.loc(n)}},e.parseSelection=function(){return this.peek(_.SPREAD)?this.parseFragment():this.parseField()},e.parseField=function(){var n=this._lexer.token,i=this.parseName(),a,o;return this.expectOptionalToken(_.COLON)?(a=i,o=this.parseName()):o=i,{kind:j.FIELD,alias:a,name:o,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(_.BRACE_L)?this.parseSelectionSet():void 0,loc:this.loc(n)}},e.parseArguments=function(n){var i=n?this.parseConstArgument:this.parseArgument;return this.optionalMany(_.PAREN_L,i,_.PAREN_R)},e.parseArgument=function(){var n=this._lexer.token,i=this.parseName();return this.expectToken(_.COLON),{kind:j.ARGUMENT,name:i,value:this.parseValueLiteral(!1),loc:this.loc(n)}},e.parseConstArgument=function(){var n=this._lexer.token;return{kind:j.ARGUMENT,name:this.parseName(),value:(this.expectToken(_.COLON),this.parseValueLiteral(!0)),loc:this.loc(n)}},e.parseFragment=function(){var n=this._lexer.token;this.expectToken(_.SPREAD);var i=this.expectOptionalKeyword("on");return!i&&this.peek(_.NAME)?{kind:j.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1),loc:this.loc(n)}:{kind:j.INLINE_FRAGMENT,typeCondition:i?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(n)}},e.parseFragmentDefinition=function(){var n,i=this._lexer.token;return this.expectKeyword("fragment"),((n=this._options)===null||n===void 0?void 0:n.experimentalFragmentVariables)===!0?{kind:j.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(i)}:{kind:j.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(i)}},e.parseFragmentName=function(){if(this._lexer.token.value==="on")throw this.unexpected();return this.parseName()},e.parseValueLiteral=function(n){var i=this._lexer.token;switch(i.kind){case _.BRACKET_L:return this.parseList(n);case _.BRACE_L:return this.parseObject(n);case _.INT:return this._lexer.advance(),{kind:j.INT,value:i.value,loc:this.loc(i)};case _.FLOAT:return this._lexer.advance(),{kind:j.FLOAT,value:i.value,loc:this.loc(i)};case _.STRING:case _.BLOCK_STRING:return this.parseStringLiteral();case _.NAME:switch(this._lexer.advance(),i.value){case"true":return{kind:j.BOOLEAN,value:!0,loc:this.loc(i)};case"false":return{kind:j.BOOLEAN,value:!1,loc:this.loc(i)};case"null":return{kind:j.NULL,loc:this.loc(i)};default:return{kind:j.ENUM,value:i.value,loc:this.loc(i)}}case _.DOLLAR:if(!n)return this.parseVariable();break}throw this.unexpected()},e.parseStringLiteral=function(){var n=this._lexer.token;return this._lexer.advance(),{kind:j.STRING,value:n.value,block:n.kind===_.BLOCK_STRING,loc:this.loc(n)}},e.parseList=function(n){var i=this,a=this._lexer.token,o=function(){return i.parseValueLiteral(n)};return{kind:j.LIST,values:this.any(_.BRACKET_L,o,_.BRACKET_R),loc:this.loc(a)}},e.parseObject=function(n){var i=this,a=this._lexer.token,o=function(){return i.parseObjectField(n)};return{kind:j.OBJECT,fields:this.any(_.BRACE_L,o,_.BRACE_R),loc:this.loc(a)}},e.parseObjectField=function(n){var i=this._lexer.token,a=this.parseName();return this.expectToken(_.COLON),{kind:j.OBJECT_FIELD,name:a,value:this.parseValueLiteral(n),loc:this.loc(i)}},e.parseDirectives=function(n){for(var i=[];this.peek(_.AT);)i.push(this.parseDirective(n));return i},e.parseDirective=function(n){var i=this._lexer.token;return this.expectToken(_.AT),{kind:j.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(n),loc:this.loc(i)}},e.parseTypeReference=function(){var n=this._lexer.token,i;return this.expectOptionalToken(_.BRACKET_L)?(i=this.parseTypeReference(),this.expectToken(_.BRACKET_R),i={kind:j.LIST_TYPE,type:i,loc:this.loc(n)}):i=this.parseNamedType(),this.expectOptionalToken(_.BANG)?{kind:j.NON_NULL_TYPE,type:i,loc:this.loc(n)}:i},e.parseNamedType=function(){var n=this._lexer.token;return{kind:j.NAMED_TYPE,name:this.parseName(),loc:this.loc(n)}},e.parseTypeSystemDefinition=function(){var n=this.peekDescription()?this._lexer.lookahead():this._lexer.token;if(n.kind===_.NAME)switch(n.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}throw this.unexpected(n)},e.peekDescription=function(){return this.peek(_.STRING)||this.peek(_.BLOCK_STRING)},e.parseDescription=function(){if(this.peekDescription())return this.parseStringLiteral()},e.parseSchemaDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("schema");var a=this.parseDirectives(!0),o=this.many(_.BRACE_L,this.parseOperationTypeDefinition,_.BRACE_R);return{kind:j.SCHEMA_DEFINITION,description:i,directives:a,operationTypes:o,loc:this.loc(n)}},e.parseOperationTypeDefinition=function(){var n=this._lexer.token,i=this.parseOperationType();this.expectToken(_.COLON);var a=this.parseNamedType();return{kind:j.OPERATION_TYPE_DEFINITION,operation:i,type:a,loc:this.loc(n)}},e.parseScalarTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("scalar");var a=this.parseName(),o=this.parseDirectives(!0);return{kind:j.SCALAR_TYPE_DEFINITION,description:i,name:a,directives:o,loc:this.loc(n)}},e.parseObjectTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("type");var a=this.parseName(),o=this.parseImplementsInterfaces(),s=this.parseDirectives(!0),u=this.parseFieldsDefinition();return{kind:j.OBJECT_TYPE_DEFINITION,description:i,name:a,interfaces:o,directives:s,fields:u,loc:this.loc(n)}},e.parseImplementsInterfaces=function(){var n;if(!this.expectOptionalKeyword("implements"))return[];if(((n=this._options)===null||n===void 0?void 0:n.allowLegacySDLImplementsInterfaces)===!0){var i=[];this.expectOptionalToken(_.AMP);do i.push(this.parseNamedType());while(this.expectOptionalToken(_.AMP)||this.peek(_.NAME));return i}return this.delimitedMany(_.AMP,this.parseNamedType)},e.parseFieldsDefinition=function(){var n;return((n=this._options)===null||n===void 0?void 0:n.allowLegacySDLEmptyFields)===!0&&this.peek(_.BRACE_L)&&this._lexer.lookahead().kind===_.BRACE_R?(this._lexer.advance(),this._lexer.advance(),[]):this.optionalMany(_.BRACE_L,this.parseFieldDefinition,_.BRACE_R)},e.parseFieldDefinition=function(){var n=this._lexer.token,i=this.parseDescription(),a=this.parseName(),o=this.parseArgumentDefs();this.expectToken(_.COLON);var s=this.parseTypeReference(),u=this.parseDirectives(!0);return{kind:j.FIELD_DEFINITION,description:i,name:a,arguments:o,type:s,directives:u,loc:this.loc(n)}},e.parseArgumentDefs=function(){return this.optionalMany(_.PAREN_L,this.parseInputValueDef,_.PAREN_R)},e.parseInputValueDef=function(){var n=this._lexer.token,i=this.parseDescription(),a=this.parseName();this.expectToken(_.COLON);var o=this.parseTypeReference(),s;this.expectOptionalToken(_.EQUALS)&&(s=this.parseValueLiteral(!0));var u=this.parseDirectives(!0);return{kind:j.INPUT_VALUE_DEFINITION,description:i,name:a,type:o,defaultValue:s,directives:u,loc:this.loc(n)}},e.parseInterfaceTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("interface");var a=this.parseName(),o=this.parseImplementsInterfaces(),s=this.parseDirectives(!0),u=this.parseFieldsDefinition();return{kind:j.INTERFACE_TYPE_DEFINITION,description:i,name:a,interfaces:o,directives:s,fields:u,loc:this.loc(n)}},e.parseUnionTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("union");var a=this.parseName(),o=this.parseDirectives(!0),s=this.parseUnionMemberTypes();return{kind:j.UNION_TYPE_DEFINITION,description:i,name:a,directives:o,types:s,loc:this.loc(n)}},e.parseUnionMemberTypes=function(){return this.expectOptionalToken(_.EQUALS)?this.delimitedMany(_.PIPE,this.parseNamedType):[]},e.parseEnumTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("enum");var a=this.parseName(),o=this.parseDirectives(!0),s=this.parseEnumValuesDefinition();return{kind:j.ENUM_TYPE_DEFINITION,description:i,name:a,directives:o,values:s,loc:this.loc(n)}},e.parseEnumValuesDefinition=function(){return this.optionalMany(_.BRACE_L,this.parseEnumValueDefinition,_.BRACE_R)},e.parseEnumValueDefinition=function(){var n=this._lexer.token,i=this.parseDescription(),a=this.parseName(),o=this.parseDirectives(!0);return{kind:j.ENUM_VALUE_DEFINITION,description:i,name:a,directives:o,loc:this.loc(n)}},e.parseInputObjectTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("input");var a=this.parseName(),o=this.parseDirectives(!0),s=this.parseInputFieldsDefinition();return{kind:j.INPUT_OBJECT_TYPE_DEFINITION,description:i,name:a,directives:o,fields:s,loc:this.loc(n)}},e.parseInputFieldsDefinition=function(){return this.optionalMany(_.BRACE_L,this.parseInputValueDef,_.BRACE_R)},e.parseTypeSystemExtension=function(){var n=this._lexer.lookahead();if(n.kind===_.NAME)switch(n.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(n)},e.parseSchemaExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");var i=this.parseDirectives(!0),a=this.optionalMany(_.BRACE_L,this.parseOperationTypeDefinition,_.BRACE_R);if(i.length===0&&a.length===0)throw this.unexpected();return{kind:j.SCHEMA_EXTENSION,directives:i,operationTypes:a,loc:this.loc(n)}},e.parseScalarTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");var i=this.parseName(),a=this.parseDirectives(!0);if(a.length===0)throw this.unexpected();return{kind:j.SCALAR_TYPE_EXTENSION,name:i,directives:a,loc:this.loc(n)}},e.parseObjectTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");var i=this.parseName(),a=this.parseImplementsInterfaces(),o=this.parseDirectives(!0),s=this.parseFieldsDefinition();if(a.length===0&&o.length===0&&s.length===0)throw this.unexpected();return{kind:j.OBJECT_TYPE_EXTENSION,name:i,interfaces:a,directives:o,fields:s,loc:this.loc(n)}},e.parseInterfaceTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");var i=this.parseName(),a=this.parseImplementsInterfaces(),o=this.parseDirectives(!0),s=this.parseFieldsDefinition();if(a.length===0&&o.length===0&&s.length===0)throw this.unexpected();return{kind:j.INTERFACE_TYPE_EXTENSION,name:i,interfaces:a,directives:o,fields:s,loc:this.loc(n)}},e.parseUnionTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");var i=this.parseName(),a=this.parseDirectives(!0),o=this.parseUnionMemberTypes();if(a.length===0&&o.length===0)throw this.unexpected();return{kind:j.UNION_TYPE_EXTENSION,name:i,directives:a,types:o,loc:this.loc(n)}},e.parseEnumTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");var i=this.parseName(),a=this.parseDirectives(!0),o=this.parseEnumValuesDefinition();if(a.length===0&&o.length===0)throw this.unexpected();return{kind:j.ENUM_TYPE_EXTENSION,name:i,directives:a,values:o,loc:this.loc(n)}},e.parseInputObjectTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");var i=this.parseName(),a=this.parseDirectives(!0),o=this.parseInputFieldsDefinition();if(a.length===0&&o.length===0)throw this.unexpected();return{kind:j.INPUT_OBJECT_TYPE_EXTENSION,name:i,directives:a,fields:o,loc:this.loc(n)}},e.parseDirectiveDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("directive"),this.expectToken(_.AT);var a=this.parseName(),o=this.parseArgumentDefs(),s=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");var u=this.parseDirectiveLocations();return{kind:j.DIRECTIVE_DEFINITION,description:i,name:a,arguments:o,repeatable:s,locations:u,loc:this.loc(n)}},e.parseDirectiveLocations=function(){return this.delimitedMany(_.PIPE,this.parseDirectiveLocation)},e.parseDirectiveLocation=function(){var n=this._lexer.token,i=this.parseName();if(up[i.value]!==void 0)return i;throw this.unexpected(n)},e.loc=function(n){var i;if(((i=this._options)===null||i===void 0?void 0:i.noLocation)!==!0)return new Cu(n,this._lexer.lastToken,this._lexer.source)},e.peek=function(n){return this._lexer.token.kind===n},e.expectToken=function(n){var i=this._lexer.token;if(i.kind===n)return this._lexer.advance(),i;throw Ye(this._lexer.source,i.start,"Expected ".concat(Fu(n),", found ").concat(Co(i),"."))},e.expectOptionalToken=function(n){var i=this._lexer.token;if(i.kind===n)return this._lexer.advance(),i},e.expectKeyword=function(n){var i=this._lexer.token;if(i.kind===_.NAME&&i.value===n)this._lexer.advance();else throw Ye(this._lexer.source,i.start,'Expected "'.concat(n,'", found ').concat(Co(i),"."))},e.expectOptionalKeyword=function(n){var i=this._lexer.token;return i.kind===_.NAME&&i.value===n?(this._lexer.advance(),!0):!1},e.unexpected=function(n){var i=n??this._lexer.token;return Ye(this._lexer.source,i.start,"Unexpected ".concat(Co(i),"."))},e.any=function(n,i,a){this.expectToken(n);for(var o=[];!this.expectOptionalToken(a);)o.push(i.call(this));return o},e.optionalMany=function(n,i,a){if(this.expectOptionalToken(n)){var o=[];do o.push(i.call(this));while(!this.expectOptionalToken(a));return o}return[]},e.many=function(n,i,a){this.expectToken(n);var o=[];do o.push(i.call(this));while(!this.expectOptionalToken(a));return o},e.delimitedMany=function(n,i){this.expectOptionalToken(n);var a=[];do a.push(i.call(this));while(this.expectOptionalToken(n));return a},t}();function Co(t){var e=t.value;return Fu(t.kind)+(e!=null?' "'.concat(e,'"'):"")}function Fu(t){return dp(t)?'"'.concat(t,'"'):t}var Ki=new Map,Uo=new Map,Mu=!0,ta=!1;function ju(t){return t.replace(/[\s,]+/g," ").trim()}function Op(t){return ju(t.source.body.substring(t.start,t.end))}function Tp(t){var e=new Set,r=[];return t.definitions.forEach(function(n){if(n.kind==="FragmentDefinition"){var i=n.name.value,a=Op(n.loc),o=Uo.get(i);o&&!o.has(a)?Mu&&console.warn("Warning: fragment with name "+i+` already exists.
57
+ `+Pu(t.source,s)}return e}function Ye(t,e,r){return new Xf("Syntax Error: ".concat(r),void 0,t,[e])}var j=Object.freeze({NAME:"Name",DOCUMENT:"Document",OPERATION_DEFINITION:"OperationDefinition",VARIABLE_DEFINITION:"VariableDefinition",SELECTION_SET:"SelectionSet",FIELD:"Field",ARGUMENT:"Argument",FRAGMENT_SPREAD:"FragmentSpread",INLINE_FRAGMENT:"InlineFragment",FRAGMENT_DEFINITION:"FragmentDefinition",VARIABLE:"Variable",INT:"IntValue",FLOAT:"FloatValue",STRING:"StringValue",BOOLEAN:"BooleanValue",NULL:"NullValue",ENUM:"EnumValue",LIST:"ListValue",OBJECT:"ObjectValue",OBJECT_FIELD:"ObjectField",DIRECTIVE:"Directive",NAMED_TYPE:"NamedType",LIST_TYPE:"ListType",NON_NULL_TYPE:"NonNullType",SCHEMA_DEFINITION:"SchemaDefinition",OPERATION_TYPE_DEFINITION:"OperationTypeDefinition",SCALAR_TYPE_DEFINITION:"ScalarTypeDefinition",OBJECT_TYPE_DEFINITION:"ObjectTypeDefinition",FIELD_DEFINITION:"FieldDefinition",INPUT_VALUE_DEFINITION:"InputValueDefinition",INTERFACE_TYPE_DEFINITION:"InterfaceTypeDefinition",UNION_TYPE_DEFINITION:"UnionTypeDefinition",ENUM_TYPE_DEFINITION:"EnumTypeDefinition",ENUM_VALUE_DEFINITION:"EnumValueDefinition",INPUT_OBJECT_TYPE_DEFINITION:"InputObjectTypeDefinition",DIRECTIVE_DEFINITION:"DirectiveDefinition",SCHEMA_EXTENSION:"SchemaExtension",SCALAR_TYPE_EXTENSION:"ScalarTypeExtension",OBJECT_TYPE_EXTENSION:"ObjectTypeExtension",INTERFACE_TYPE_EXTENSION:"InterfaceTypeExtension",UNION_TYPE_EXTENSION:"UnionTypeExtension",ENUM_TYPE_EXTENSION:"EnumTypeExtension",INPUT_OBJECT_TYPE_EXTENSION:"InputObjectTypeExtension"});function ep(t,e){var r=Boolean(t);if(!r)throw new Error(e??"Unexpected invariant triggered.")}var tp=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):void 0,qo=tp;function Lu(t){var e=t.prototype.toJSON;typeof e=="function"||ep(0),t.prototype.inspect=e,qo&&(t.prototype[qo]=e)}var Fu=function(){function t(r,n,i){this.start=r.start,this.end=n.end,this.startToken=r,this.endToken=n,this.source=i}var e=t.prototype;return e.toJSON=function(){return{start:this.start,end:this.end}},t}();Lu(Fu);var ge=function(){function t(r,n,i,a,o,s,u){this.kind=r,this.start=n,this.end=i,this.line=a,this.column=o,this.value=u,this.prev=s,this.next=null}var e=t.prototype;return e.toJSON=function(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}},t}();Lu(ge);var _=Object.freeze({SOF:"<SOF>",EOF:"<EOF>",BANG:"!",DOLLAR:"$",AMP:"&",PAREN_L:"(",PAREN_R:")",SPREAD:"...",COLON:":",EQUALS:"=",AT:"@",BRACKET_L:"[",BRACKET_R:"]",BRACE_L:"{",PIPE:"|",BRACE_R:"}",NAME:"Name",INT:"Int",FLOAT:"Float",STRING:"String",BLOCK_STRING:"BlockString",COMMENT:"Comment"});function Ji(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ji=function(r){return typeof r}:Ji=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Ji(t)}var rp=10,Mu=2;function np(t){return Sa(t,[])}function Sa(t,e){switch(Ji(t)){case"string":return JSON.stringify(t);case"function":return t.name?"[function ".concat(t.name,"]"):"[function]";case"object":return t===null?"null":ip(t,e);default:return String(t)}}function ip(t,e){if(e.indexOf(t)!==-1)return"[Circular]";var r=[].concat(e,[t]),n=sp(t);if(n!==void 0){var i=n.call(t);if(i!==t)return typeof i=="string"?i:Sa(i,r)}else if(Array.isArray(t))return op(t,r);return ap(t,r)}function ap(t,e){var r=Object.keys(t);if(r.length===0)return"{}";if(e.length>Mu)return"["+cp(t)+"]";var n=r.map(function(i){var a=Sa(t[i],e);return i+": "+a});return"{ "+n.join(", ")+" }"}function op(t,e){if(t.length===0)return"[]";if(e.length>Mu)return"[Array]";for(var r=Math.min(rp,t.length),n=t.length-r,i=[],a=0;a<r;++a)i.push(Sa(t[a],e));return n===1?i.push("... 1 more item"):n>1&&i.push("... ".concat(n," more items")),"["+i.join(", ")+"]"}function sp(t){var e=t[String(qo)];if(typeof e=="function")return e;if(typeof t.inspect=="function")return t.inspect}function cp(t){var e=Object.prototype.toString.call(t).replace(/^\[object /,"").replace(/]$/,"");if(e==="Object"&&typeof t.constructor=="function"){var r=t.constructor.name;if(typeof r=="string"&&r!=="")return r}return e}function Ro(t,e){var r=Boolean(t);if(!r)throw new Error(e)}var up=function(e,r){return e instanceof r};function du(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function lp(t,e,r){return e&&du(t.prototype,e),r&&du(t,r),t}var ju=function(){function t(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"GraphQL request",n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{line:1,column:1};typeof e=="string"||Ro(0,"Body must be a string. Received: ".concat(np(e),".")),this.body=e,this.name=r,this.locationOffset=n,this.locationOffset.line>0||Ro(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||Ro(0,"column in locationOffset is 1-indexed and must be positive.")}return lp(t,[{key:Au,get:function(){return"Source"}}]),t}();function fp(t){return up(t,ju)}var pp=Object.freeze({QUERY:"QUERY",MUTATION:"MUTATION",SUBSCRIPTION:"SUBSCRIPTION",FIELD:"FIELD",FRAGMENT_DEFINITION:"FRAGMENT_DEFINITION",FRAGMENT_SPREAD:"FRAGMENT_SPREAD",INLINE_FRAGMENT:"INLINE_FRAGMENT",VARIABLE_DEFINITION:"VARIABLE_DEFINITION",SCHEMA:"SCHEMA",SCALAR:"SCALAR",OBJECT:"OBJECT",FIELD_DEFINITION:"FIELD_DEFINITION",ARGUMENT_DEFINITION:"ARGUMENT_DEFINITION",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",ENUM_VALUE:"ENUM_VALUE",INPUT_OBJECT:"INPUT_OBJECT",INPUT_FIELD_DEFINITION:"INPUT_FIELD_DEFINITION"});function dp(t){var e=t.split(/\r\n|[\n\r]/g),r=hp(t);if(r!==0)for(var n=1;n<e.length;n++)e[n]=e[n].slice(r);for(var i=0;i<e.length&&hu(e[i]);)++i;for(var a=e.length;a>i&&hu(e[a-1]);)--a;return e.slice(i,a).join(`
58
+ `)}function hu(t){for(var e=0;e<t.length;++e)if(t[e]!==" "&&t[e]!==" ")return!1;return!0}function hp(t){for(var e,r=!0,n=!0,i=0,a=null,o=0;o<t.length;++o)switch(t.charCodeAt(o)){case 13:t.charCodeAt(o+1)===10&&++o;case 10:r=!1,n=!0,i=0;break;case 9:case 32:++i;break;default:n&&!r&&(a===null||i<a)&&(a=i),n=!1}return(e=a)!==null&&e!==void 0?e:0}var mp=function(){function t(r){var n=new ge(_.SOF,0,0,0,0,null);this.source=r,this.lastToken=n,this.token=n,this.line=1,this.lineStart=0}var e=t.prototype;return e.advance=function(){this.lastToken=this.token;var n=this.token=this.lookahead();return n},e.lookahead=function(){var n=this.token;if(n.kind!==_.EOF)do{var i;n=(i=n.next)!==null&&i!==void 0?i:n.next=gp(this,n)}while(n.kind===_.COMMENT);return n},t}();function yp(t){return t===_.BANG||t===_.DOLLAR||t===_.AMP||t===_.PAREN_L||t===_.PAREN_R||t===_.SPREAD||t===_.COLON||t===_.EQUALS||t===_.AT||t===_.BRACKET_L||t===_.BRACKET_R||t===_.BRACE_L||t===_.PIPE||t===_.BRACE_R}function Sr(t){return isNaN(t)?_.EOF:t<127?JSON.stringify(String.fromCharCode(t)):'"\\u'.concat(("00"+t.toString(16).toUpperCase()).slice(-4),'"')}function gp(t,e){for(var r=t.source,n=r.body,i=n.length,a=e.end;a<i;){var o=n.charCodeAt(a),s=t.line,u=1+a-t.lineStart;switch(o){case 65279:case 9:case 32:case 44:++a;continue;case 10:++a,++t.line,t.lineStart=a;continue;case 13:n.charCodeAt(a+1)===10?a+=2:++a,++t.line,t.lineStart=a;continue;case 33:return new ge(_.BANG,a,a+1,s,u,e);case 35:return bp(r,a,s,u,e);case 36:return new ge(_.DOLLAR,a,a+1,s,u,e);case 38:return new ge(_.AMP,a,a+1,s,u,e);case 40:return new ge(_.PAREN_L,a,a+1,s,u,e);case 41:return new ge(_.PAREN_R,a,a+1,s,u,e);case 46:if(n.charCodeAt(a+1)===46&&n.charCodeAt(a+2)===46)return new ge(_.SPREAD,a,a+3,s,u,e);break;case 58:return new ge(_.COLON,a,a+1,s,u,e);case 61:return new ge(_.EQUALS,a,a+1,s,u,e);case 64:return new ge(_.AT,a,a+1,s,u,e);case 91:return new ge(_.BRACKET_L,a,a+1,s,u,e);case 93:return new ge(_.BRACKET_R,a,a+1,s,u,e);case 123:return new ge(_.BRACE_L,a,a+1,s,u,e);case 124:return new ge(_.PIPE,a,a+1,s,u,e);case 125:return new ge(_.BRACE_R,a,a+1,s,u,e);case 34:return n.charCodeAt(a+1)===34&&n.charCodeAt(a+2)===34?_p(r,a,s,u,e,t):wp(r,a,s,u,e);case 45:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return Sp(r,a,o,s,u,e);case 65:case 66:case 67:case 68:case 69:case 70:case 71:case 72:case 73:case 74:case 75:case 76:case 77:case 78:case 79:case 80:case 81:case 82:case 83:case 84:case 85:case 86:case 87:case 88:case 89:case 90:case 95:case 97:case 98:case 99:case 100:case 101:case 102:case 103:case 104:case 105:case 106:case 107:case 108:case 109:case 110:case 111:case 112:case 113:case 114:case 115:case 116:case 117:case 118:case 119:case 120:case 121:case 122:return Tp(r,a,s,u,e)}throw Ye(r,a,vp(o))}var l=t.line,f=1+a-t.lineStart;return new ge(_.EOF,i,i,l,f,e)}function vp(t){return t<32&&t!==9&&t!==10&&t!==13?"Cannot contain the invalid character ".concat(Sr(t),"."):t===39?`Unexpected single quote character ('), did you mean to use a double quote (")?`:"Cannot parse the unexpected character ".concat(Sr(t),".")}function bp(t,e,r,n,i){var a=t.body,o,s=e;do o=a.charCodeAt(++s);while(!isNaN(o)&&(o>31||o===9));return new ge(_.COMMENT,e,s,r,n,i,a.slice(e+1,s))}function Sp(t,e,r,n,i,a){var o=t.body,s=r,u=e,l=!1;if(s===45&&(s=o.charCodeAt(++u)),s===48){if(s=o.charCodeAt(++u),s>=48&&s<=57)throw Ye(t,u,"Invalid number, unexpected digit after 0: ".concat(Sr(s),"."))}else u=Lo(t,u,s),s=o.charCodeAt(u);if(s===46&&(l=!0,s=o.charCodeAt(++u),u=Lo(t,u,s),s=o.charCodeAt(u)),(s===69||s===101)&&(l=!0,s=o.charCodeAt(++u),(s===43||s===45)&&(s=o.charCodeAt(++u)),u=Lo(t,u,s),s=o.charCodeAt(u)),s===46||Op(s))throw Ye(t,u,"Invalid number, expected digit but got: ".concat(Sr(s),"."));return new ge(l?_.FLOAT:_.INT,e,u,n,i,a,o.slice(e,u))}function Lo(t,e,r){var n=t.body,i=e,a=r;if(a>=48&&a<=57){do a=n.charCodeAt(++i);while(a>=48&&a<=57);return i}throw Ye(t,i,"Invalid number, expected digit but got: ".concat(Sr(a),"."))}function wp(t,e,r,n,i){for(var a=t.body,o=e+1,s=o,u=0,l="";o<a.length&&!isNaN(u=a.charCodeAt(o))&&u!==10&&u!==13;){if(u===34)return l+=a.slice(s,o),new ge(_.STRING,e,o+1,r,n,i,l);if(u<32&&u!==9)throw Ye(t,o,"Invalid character within String: ".concat(Sr(u),"."));if(++o,u===92){switch(l+=a.slice(s,o-1),u=a.charCodeAt(o),u){case 34:l+='"';break;case 47:l+="/";break;case 92:l+="\\";break;case 98:l+="\b";break;case 102:l+="\f";break;case 110:l+=`
59
+ `;break;case 114:l+="\r";break;case 116:l+=" ";break;case 117:{var f=Ep(a.charCodeAt(o+1),a.charCodeAt(o+2),a.charCodeAt(o+3),a.charCodeAt(o+4));if(f<0){var d=a.slice(o+1,o+5);throw Ye(t,o,"Invalid character escape sequence: \\u".concat(d,"."))}l+=String.fromCharCode(f),o+=4;break}default:throw Ye(t,o,"Invalid character escape sequence: \\".concat(String.fromCharCode(u),"."))}++o,s=o}}throw Ye(t,o,"Unterminated string.")}function _p(t,e,r,n,i,a){for(var o=t.body,s=e+3,u=s,l=0,f="";s<o.length&&!isNaN(l=o.charCodeAt(s));){if(l===34&&o.charCodeAt(s+1)===34&&o.charCodeAt(s+2)===34)return f+=o.slice(u,s),new ge(_.BLOCK_STRING,e,s+3,r,n,i,dp(f));if(l<32&&l!==9&&l!==10&&l!==13)throw Ye(t,s,"Invalid character within String: ".concat(Sr(l),"."));l===10?(++s,++a.line,a.lineStart=s):l===13?(o.charCodeAt(s+1)===10?s+=2:++s,++a.line,a.lineStart=s):l===92&&o.charCodeAt(s+1)===34&&o.charCodeAt(s+2)===34&&o.charCodeAt(s+3)===34?(f+=o.slice(u,s)+'"""',s+=4,u=s):++s}throw Ye(t,s,"Unterminated string.")}function Ep(t,e,r,n){return $i(t)<<12|$i(e)<<8|$i(r)<<4|$i(n)}function $i(t){return t>=48&&t<=57?t-48:t>=65&&t<=70?t-55:t>=97&&t<=102?t-87:-1}function Tp(t,e,r,n,i){for(var a=t.body,o=a.length,s=e+1,u=0;s!==o&&!isNaN(u=a.charCodeAt(s))&&(u===95||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122);)++s;return new ge(_.NAME,e,s,r,n,i,a.slice(e,s))}function Op(t){return t===95||t>=65&&t<=90||t>=97&&t<=122}function xp(t,e){var r=new Ip(t,e);return r.parseDocument()}var Ip=function(){function t(r,n){var i=fp(r)?r:new ju(r);this._lexer=new mp(i),this._options=n}var e=t.prototype;return e.parseName=function(){var n=this.expectToken(_.NAME);return{kind:j.NAME,value:n.value,loc:this.loc(n)}},e.parseDocument=function(){var n=this._lexer.token;return{kind:j.DOCUMENT,definitions:this.many(_.SOF,this.parseDefinition,_.EOF),loc:this.loc(n)}},e.parseDefinition=function(){if(this.peek(_.NAME))switch(this._lexer.token.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"schema":case"scalar":case"type":case"interface":case"union":case"enum":case"input":case"directive":return this.parseTypeSystemDefinition();case"extend":return this.parseTypeSystemExtension()}else{if(this.peek(_.BRACE_L))return this.parseOperationDefinition();if(this.peekDescription())return this.parseTypeSystemDefinition()}throw this.unexpected()},e.parseOperationDefinition=function(){var n=this._lexer.token;if(this.peek(_.BRACE_L))return{kind:j.OPERATION_DEFINITION,operation:"query",name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet(),loc:this.loc(n)};var i=this.parseOperationType(),a;return this.peek(_.NAME)&&(a=this.parseName()),{kind:j.OPERATION_DEFINITION,operation:i,name:a,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(n)}},e.parseOperationType=function(){var n=this.expectToken(_.NAME);switch(n.value){case"query":return"query";case"mutation":return"mutation";case"subscription":return"subscription"}throw this.unexpected(n)},e.parseVariableDefinitions=function(){return this.optionalMany(_.PAREN_L,this.parseVariableDefinition,_.PAREN_R)},e.parseVariableDefinition=function(){var n=this._lexer.token;return{kind:j.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(_.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(_.EQUALS)?this.parseValueLiteral(!0):void 0,directives:this.parseDirectives(!0),loc:this.loc(n)}},e.parseVariable=function(){var n=this._lexer.token;return this.expectToken(_.DOLLAR),{kind:j.VARIABLE,name:this.parseName(),loc:this.loc(n)}},e.parseSelectionSet=function(){var n=this._lexer.token;return{kind:j.SELECTION_SET,selections:this.many(_.BRACE_L,this.parseSelection,_.BRACE_R),loc:this.loc(n)}},e.parseSelection=function(){return this.peek(_.SPREAD)?this.parseFragment():this.parseField()},e.parseField=function(){var n=this._lexer.token,i=this.parseName(),a,o;return this.expectOptionalToken(_.COLON)?(a=i,o=this.parseName()):o=i,{kind:j.FIELD,alias:a,name:o,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(_.BRACE_L)?this.parseSelectionSet():void 0,loc:this.loc(n)}},e.parseArguments=function(n){var i=n?this.parseConstArgument:this.parseArgument;return this.optionalMany(_.PAREN_L,i,_.PAREN_R)},e.parseArgument=function(){var n=this._lexer.token,i=this.parseName();return this.expectToken(_.COLON),{kind:j.ARGUMENT,name:i,value:this.parseValueLiteral(!1),loc:this.loc(n)}},e.parseConstArgument=function(){var n=this._lexer.token;return{kind:j.ARGUMENT,name:this.parseName(),value:(this.expectToken(_.COLON),this.parseValueLiteral(!0)),loc:this.loc(n)}},e.parseFragment=function(){var n=this._lexer.token;this.expectToken(_.SPREAD);var i=this.expectOptionalKeyword("on");return!i&&this.peek(_.NAME)?{kind:j.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1),loc:this.loc(n)}:{kind:j.INLINE_FRAGMENT,typeCondition:i?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(n)}},e.parseFragmentDefinition=function(){var n,i=this._lexer.token;return this.expectKeyword("fragment"),((n=this._options)===null||n===void 0?void 0:n.experimentalFragmentVariables)===!0?{kind:j.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(i)}:{kind:j.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(i)}},e.parseFragmentName=function(){if(this._lexer.token.value==="on")throw this.unexpected();return this.parseName()},e.parseValueLiteral=function(n){var i=this._lexer.token;switch(i.kind){case _.BRACKET_L:return this.parseList(n);case _.BRACE_L:return this.parseObject(n);case _.INT:return this._lexer.advance(),{kind:j.INT,value:i.value,loc:this.loc(i)};case _.FLOAT:return this._lexer.advance(),{kind:j.FLOAT,value:i.value,loc:this.loc(i)};case _.STRING:case _.BLOCK_STRING:return this.parseStringLiteral();case _.NAME:switch(this._lexer.advance(),i.value){case"true":return{kind:j.BOOLEAN,value:!0,loc:this.loc(i)};case"false":return{kind:j.BOOLEAN,value:!1,loc:this.loc(i)};case"null":return{kind:j.NULL,loc:this.loc(i)};default:return{kind:j.ENUM,value:i.value,loc:this.loc(i)}}case _.DOLLAR:if(!n)return this.parseVariable();break}throw this.unexpected()},e.parseStringLiteral=function(){var n=this._lexer.token;return this._lexer.advance(),{kind:j.STRING,value:n.value,block:n.kind===_.BLOCK_STRING,loc:this.loc(n)}},e.parseList=function(n){var i=this,a=this._lexer.token,o=function(){return i.parseValueLiteral(n)};return{kind:j.LIST,values:this.any(_.BRACKET_L,o,_.BRACKET_R),loc:this.loc(a)}},e.parseObject=function(n){var i=this,a=this._lexer.token,o=function(){return i.parseObjectField(n)};return{kind:j.OBJECT,fields:this.any(_.BRACE_L,o,_.BRACE_R),loc:this.loc(a)}},e.parseObjectField=function(n){var i=this._lexer.token,a=this.parseName();return this.expectToken(_.COLON),{kind:j.OBJECT_FIELD,name:a,value:this.parseValueLiteral(n),loc:this.loc(i)}},e.parseDirectives=function(n){for(var i=[];this.peek(_.AT);)i.push(this.parseDirective(n));return i},e.parseDirective=function(n){var i=this._lexer.token;return this.expectToken(_.AT),{kind:j.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(n),loc:this.loc(i)}},e.parseTypeReference=function(){var n=this._lexer.token,i;return this.expectOptionalToken(_.BRACKET_L)?(i=this.parseTypeReference(),this.expectToken(_.BRACKET_R),i={kind:j.LIST_TYPE,type:i,loc:this.loc(n)}):i=this.parseNamedType(),this.expectOptionalToken(_.BANG)?{kind:j.NON_NULL_TYPE,type:i,loc:this.loc(n)}:i},e.parseNamedType=function(){var n=this._lexer.token;return{kind:j.NAMED_TYPE,name:this.parseName(),loc:this.loc(n)}},e.parseTypeSystemDefinition=function(){var n=this.peekDescription()?this._lexer.lookahead():this._lexer.token;if(n.kind===_.NAME)switch(n.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}throw this.unexpected(n)},e.peekDescription=function(){return this.peek(_.STRING)||this.peek(_.BLOCK_STRING)},e.parseDescription=function(){if(this.peekDescription())return this.parseStringLiteral()},e.parseSchemaDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("schema");var a=this.parseDirectives(!0),o=this.many(_.BRACE_L,this.parseOperationTypeDefinition,_.BRACE_R);return{kind:j.SCHEMA_DEFINITION,description:i,directives:a,operationTypes:o,loc:this.loc(n)}},e.parseOperationTypeDefinition=function(){var n=this._lexer.token,i=this.parseOperationType();this.expectToken(_.COLON);var a=this.parseNamedType();return{kind:j.OPERATION_TYPE_DEFINITION,operation:i,type:a,loc:this.loc(n)}},e.parseScalarTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("scalar");var a=this.parseName(),o=this.parseDirectives(!0);return{kind:j.SCALAR_TYPE_DEFINITION,description:i,name:a,directives:o,loc:this.loc(n)}},e.parseObjectTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("type");var a=this.parseName(),o=this.parseImplementsInterfaces(),s=this.parseDirectives(!0),u=this.parseFieldsDefinition();return{kind:j.OBJECT_TYPE_DEFINITION,description:i,name:a,interfaces:o,directives:s,fields:u,loc:this.loc(n)}},e.parseImplementsInterfaces=function(){var n;if(!this.expectOptionalKeyword("implements"))return[];if(((n=this._options)===null||n===void 0?void 0:n.allowLegacySDLImplementsInterfaces)===!0){var i=[];this.expectOptionalToken(_.AMP);do i.push(this.parseNamedType());while(this.expectOptionalToken(_.AMP)||this.peek(_.NAME));return i}return this.delimitedMany(_.AMP,this.parseNamedType)},e.parseFieldsDefinition=function(){var n;return((n=this._options)===null||n===void 0?void 0:n.allowLegacySDLEmptyFields)===!0&&this.peek(_.BRACE_L)&&this._lexer.lookahead().kind===_.BRACE_R?(this._lexer.advance(),this._lexer.advance(),[]):this.optionalMany(_.BRACE_L,this.parseFieldDefinition,_.BRACE_R)},e.parseFieldDefinition=function(){var n=this._lexer.token,i=this.parseDescription(),a=this.parseName(),o=this.parseArgumentDefs();this.expectToken(_.COLON);var s=this.parseTypeReference(),u=this.parseDirectives(!0);return{kind:j.FIELD_DEFINITION,description:i,name:a,arguments:o,type:s,directives:u,loc:this.loc(n)}},e.parseArgumentDefs=function(){return this.optionalMany(_.PAREN_L,this.parseInputValueDef,_.PAREN_R)},e.parseInputValueDef=function(){var n=this._lexer.token,i=this.parseDescription(),a=this.parseName();this.expectToken(_.COLON);var o=this.parseTypeReference(),s;this.expectOptionalToken(_.EQUALS)&&(s=this.parseValueLiteral(!0));var u=this.parseDirectives(!0);return{kind:j.INPUT_VALUE_DEFINITION,description:i,name:a,type:o,defaultValue:s,directives:u,loc:this.loc(n)}},e.parseInterfaceTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("interface");var a=this.parseName(),o=this.parseImplementsInterfaces(),s=this.parseDirectives(!0),u=this.parseFieldsDefinition();return{kind:j.INTERFACE_TYPE_DEFINITION,description:i,name:a,interfaces:o,directives:s,fields:u,loc:this.loc(n)}},e.parseUnionTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("union");var a=this.parseName(),o=this.parseDirectives(!0),s=this.parseUnionMemberTypes();return{kind:j.UNION_TYPE_DEFINITION,description:i,name:a,directives:o,types:s,loc:this.loc(n)}},e.parseUnionMemberTypes=function(){return this.expectOptionalToken(_.EQUALS)?this.delimitedMany(_.PIPE,this.parseNamedType):[]},e.parseEnumTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("enum");var a=this.parseName(),o=this.parseDirectives(!0),s=this.parseEnumValuesDefinition();return{kind:j.ENUM_TYPE_DEFINITION,description:i,name:a,directives:o,values:s,loc:this.loc(n)}},e.parseEnumValuesDefinition=function(){return this.optionalMany(_.BRACE_L,this.parseEnumValueDefinition,_.BRACE_R)},e.parseEnumValueDefinition=function(){var n=this._lexer.token,i=this.parseDescription(),a=this.parseName(),o=this.parseDirectives(!0);return{kind:j.ENUM_VALUE_DEFINITION,description:i,name:a,directives:o,loc:this.loc(n)}},e.parseInputObjectTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("input");var a=this.parseName(),o=this.parseDirectives(!0),s=this.parseInputFieldsDefinition();return{kind:j.INPUT_OBJECT_TYPE_DEFINITION,description:i,name:a,directives:o,fields:s,loc:this.loc(n)}},e.parseInputFieldsDefinition=function(){return this.optionalMany(_.BRACE_L,this.parseInputValueDef,_.BRACE_R)},e.parseTypeSystemExtension=function(){var n=this._lexer.lookahead();if(n.kind===_.NAME)switch(n.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(n)},e.parseSchemaExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");var i=this.parseDirectives(!0),a=this.optionalMany(_.BRACE_L,this.parseOperationTypeDefinition,_.BRACE_R);if(i.length===0&&a.length===0)throw this.unexpected();return{kind:j.SCHEMA_EXTENSION,directives:i,operationTypes:a,loc:this.loc(n)}},e.parseScalarTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");var i=this.parseName(),a=this.parseDirectives(!0);if(a.length===0)throw this.unexpected();return{kind:j.SCALAR_TYPE_EXTENSION,name:i,directives:a,loc:this.loc(n)}},e.parseObjectTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");var i=this.parseName(),a=this.parseImplementsInterfaces(),o=this.parseDirectives(!0),s=this.parseFieldsDefinition();if(a.length===0&&o.length===0&&s.length===0)throw this.unexpected();return{kind:j.OBJECT_TYPE_EXTENSION,name:i,interfaces:a,directives:o,fields:s,loc:this.loc(n)}},e.parseInterfaceTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");var i=this.parseName(),a=this.parseImplementsInterfaces(),o=this.parseDirectives(!0),s=this.parseFieldsDefinition();if(a.length===0&&o.length===0&&s.length===0)throw this.unexpected();return{kind:j.INTERFACE_TYPE_EXTENSION,name:i,interfaces:a,directives:o,fields:s,loc:this.loc(n)}},e.parseUnionTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");var i=this.parseName(),a=this.parseDirectives(!0),o=this.parseUnionMemberTypes();if(a.length===0&&o.length===0)throw this.unexpected();return{kind:j.UNION_TYPE_EXTENSION,name:i,directives:a,types:o,loc:this.loc(n)}},e.parseEnumTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");var i=this.parseName(),a=this.parseDirectives(!0),o=this.parseEnumValuesDefinition();if(a.length===0&&o.length===0)throw this.unexpected();return{kind:j.ENUM_TYPE_EXTENSION,name:i,directives:a,values:o,loc:this.loc(n)}},e.parseInputObjectTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");var i=this.parseName(),a=this.parseDirectives(!0),o=this.parseInputFieldsDefinition();if(a.length===0&&o.length===0)throw this.unexpected();return{kind:j.INPUT_OBJECT_TYPE_EXTENSION,name:i,directives:a,fields:o,loc:this.loc(n)}},e.parseDirectiveDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("directive"),this.expectToken(_.AT);var a=this.parseName(),o=this.parseArgumentDefs(),s=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");var u=this.parseDirectiveLocations();return{kind:j.DIRECTIVE_DEFINITION,description:i,name:a,arguments:o,repeatable:s,locations:u,loc:this.loc(n)}},e.parseDirectiveLocations=function(){return this.delimitedMany(_.PIPE,this.parseDirectiveLocation)},e.parseDirectiveLocation=function(){var n=this._lexer.token,i=this.parseName();if(pp[i.value]!==void 0)return i;throw this.unexpected(n)},e.loc=function(n){var i;if(((i=this._options)===null||i===void 0?void 0:i.noLocation)!==!0)return new Fu(n,this._lexer.lastToken,this._lexer.source)},e.peek=function(n){return this._lexer.token.kind===n},e.expectToken=function(n){var i=this._lexer.token;if(i.kind===n)return this._lexer.advance(),i;throw Ye(this._lexer.source,i.start,"Expected ".concat($u(n),", found ").concat(Fo(i),"."))},e.expectOptionalToken=function(n){var i=this._lexer.token;if(i.kind===n)return this._lexer.advance(),i},e.expectKeyword=function(n){var i=this._lexer.token;if(i.kind===_.NAME&&i.value===n)this._lexer.advance();else throw Ye(this._lexer.source,i.start,'Expected "'.concat(n,'", found ').concat(Fo(i),"."))},e.expectOptionalKeyword=function(n){var i=this._lexer.token;return i.kind===_.NAME&&i.value===n?(this._lexer.advance(),!0):!1},e.unexpected=function(n){var i=n??this._lexer.token;return Ye(this._lexer.source,i.start,"Unexpected ".concat(Fo(i),"."))},e.any=function(n,i,a){this.expectToken(n);for(var o=[];!this.expectOptionalToken(a);)o.push(i.call(this));return o},e.optionalMany=function(n,i,a){if(this.expectOptionalToken(n)){var o=[];do o.push(i.call(this));while(!this.expectOptionalToken(a));return o}return[]},e.many=function(n,i,a){this.expectToken(n);var o=[];do o.push(i.call(this));while(!this.expectOptionalToken(a));return o},e.delimitedMany=function(n,i){this.expectOptionalToken(n);var a=[];do a.push(i.call(this));while(this.expectOptionalToken(n));return a},t}();function Fo(t){var e=t.value;return $u(t.kind)+(e!=null?' "'.concat(e,'"'):"")}function $u(t){return yp(t)?'"'.concat(t,'"'):t}var Hi=new Map,Vo=new Map,Uu=!0,ia=!1;function qu(t){return t.replace(/[\s,]+/g," ").trim()}function Dp(t){return qu(t.source.body.substring(t.start,t.end))}function kp(t){var e=new Set,r=[];return t.definitions.forEach(function(n){if(n.kind==="FragmentDefinition"){var i=n.name.value,a=Dp(n.loc),o=Vo.get(i);o&&!o.has(a)?Uu&&console.warn("Warning: fragment with name "+i+` already exists.
60
60
  graphql-tag enforces all fragment names across your application to be unique; read more about
61
- this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`):o||Uo.set(i,o=new Set),o.add(a),e.has(a)||(e.add(a),r.push(n))}else r.push(n)}),ea(ea({},t),{definitions:r})}function Ip(t){var e=new Set(t.definitions);e.forEach(function(n){n.loc&&delete n.loc,Object.keys(n).forEach(function(i){var a=n[i];a&&typeof a=="object"&&e.add(a)})});var r=t.loc;return r&&(delete r.startToken,delete r.endToken),t}function Dp(t){var e=ju(t);if(!Ki.has(e)){var r=Ep(t,{experimentalFragmentVariables:ta,allowLegacyFragmentVariables:ta});if(!r||r.kind!=="Document")throw new Error("Not a valid GraphQL document.");Ki.set(e,Ip(Tp(r)))}return Ki.get(e)}function O(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];typeof t=="string"&&(t=[t]);var n=t[0];return e.forEach(function(i,a){i&&i.kind==="Document"?n+=i.loc.source.body:n+=i,n+=t[a+1]}),Dp(n)}function kp(){Ki.clear(),Uo.clear()}function Ap(){Mu=!1}function Np(){ta=!0}function Pp(){ta=!1}var kn={gql:O,resetCaches:kp,disableFragmentWarnings:Ap,enableExperimentalFragmentVariables:Np,disableExperimentalFragmentVariables:Pp};(function(t){t.gql=kn.gql,t.resetCaches=kn.resetCaches,t.disableFragmentWarnings=kn.disableFragmentWarnings,t.enableExperimentalFragmentVariables=kn.enableExperimentalFragmentVariables,t.disableExperimentalFragmentVariables=kn.disableExperimentalFragmentVariables})(O||(O={}));O.default=O;function D(t){if(!t)throw"Got no result from Apollo";if(t.error)throw t.error;if(t.errors)throw t.errors;return t.data}function Cp(){}function Zo(){return Cp}var g=Zo,$e=Zo,J=Zo,$u=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},Uu=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},wr=class{constructor(e){this.code=e}};$u([g(),Uu("design:type",String)],wr.prototype,"code",void 0);wr=$u([J(),Uu("design:paramtypes",[String])],wr);var es=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},ts=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},gt=class{constructor(e,r){this.address=e,this.name=r}};es([g(),ts("design:type",String)],gt.prototype,"address",void 0);es([g(),ts("design:type",String)],gt.prototype,"name",void 0);gt=es([J(),ts("design:paramtypes",[String,String])],gt);var ue=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},_e=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Wt=class{constructor(e,r){this.key=r,this.signature=e}};ue([g(),_e("design:type",String)],Wt.prototype,"signature",void 0);ue([g(),_e("design:type",String)],Wt.prototype,"key",void 0);ue([g(),_e("design:type",Boolean)],Wt.prototype,"valid",void 0);ue([g(),_e("design:type",Boolean)],Wt.prototype,"invalid",void 0);Wt=ue([J(),$e(),_e("design:paramtypes",[String,String])],Wt);var _r=class{};ue([g(),_e("design:type",String)],_r.prototype,"signature",void 0);ue([g(),_e("design:type",String)],_r.prototype,"key",void 0);ue([g(),_e("design:type",Boolean)],_r.prototype,"valid",void 0);ue([g(),_e("design:type",Boolean)],_r.prototype,"invalid",void 0);_r=ue([$e()],_r);function Xt(t){let e=class{constructor(n,i,a,o){this.author=n,this.timestamp=i,this.data=a,this.proof=o}};return ue([g(),_e("design:type",String)],e.prototype,"author",void 0),ue([g(),_e("design:type",String)],e.prototype,"timestamp",void 0),ue([g(),_e("design:type",Object)],e.prototype,"data",void 0),ue([g(),_e("design:type",Wt)],e.prototype,"proof",void 0),e=ue([J(),_e("design:paramtypes",[String,String,Object,Wt])],e),e}function Rp(t){let e=class{};return ue([g(),_e("design:type",String)],e.prototype,"author",void 0),ue([g(),_e("design:type",String)],e.prototype,"timestamp",void 0),ue([g(),_e("design:type",Object)],e.prototype,"data",void 0),ue([g(),_e("design:type",_r)],e.prototype,"proof",void 0),e=ue([$e()],e),e}var pu=class extends Xt(){};pu=ue([J()],pu);var ra=class extends Xt(){};ue([g(),_e("design:type",gt)],ra.prototype,"language",void 0);ue([g(),_e("design:type",wr)],ra.prototype,"icon",void 0);ra=ue([J()],ra);function kS(t){return t&&t.author&&t.timestamp&&t.data}var Se=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},Ae=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},bt=class{constructor(e){this.source=e.source?e.source:"",this.target=e.target?e.target:"",this.predicate=e.predicate?e.predicate:""}};Se([g(),Ae("design:type",String)],bt.prototype,"source",void 0);Se([g(),Ae("design:type",String)],bt.prototype,"target",void 0);Se([g(),Ae("design:type",String)],bt.prototype,"predicate",void 0);bt=Se([J(),Ae("design:paramtypes",[Object])],bt);var na=class{};Se([g(),Ae("design:type",Array)],na.prototype,"additions",void 0);Se([g(),Ae("design:type",Array)],na.prototype,"removals",void 0);na=Se([$e()],na);var ia=class{constructor(e,r){this.additions=e,this.removals=r}};Se([g(),Ae("design:type",Array)],ia.prototype,"additions",void 0);Se([g(),Ae("design:type",Array)],ia.prototype,"removals",void 0);ia=Se([J(),Ae("design:paramtypes",[Array,Array])],ia);var Kn=class{};Se([g(),Ae("design:type",String)],Kn.prototype,"source",void 0);Se([g(),Ae("design:type",String)],Kn.prototype,"target",void 0);Se([g(),Ae("design:type",String)],Kn.prototype,"predicate",void 0);Kn=Se([$e()],Kn);var Er=class extends Xt(){hash(){let e=JSON.stringify(this.data,Object.keys(this.data).sort())+JSON.stringify(this.author)+this.timestamp,r=0,n,i;for(n=0;n<e.length;n++)i=e.charCodeAt(n),r=(r<<5)-r+i,r|=0;return r}};Se([g(),Ae("design:type",String)],Er.prototype,"status",void 0);Er=Se([J()],Er);var qo=class extends Rp(){};Se([g(),Ae("design:type",String)],qo.prototype,"status",void 0);qo=Se([$e()],qo);function FS(t,e){return t.author==e.author&&t.timestamp==e.timestamp&&t.data.source==e.data.source&&t.data.predicate==e.data.predicate&&t.data.target==e.data.target}function MS(t){return t&&t.source&&t.target}var aa=class{constructor(e,r){this.oldLink=e,this.newLink=r}};Se([g(),Ae("design:type",Er)],aa.prototype,"oldLink",void 0);Se([g(),Ae("design:type",Er)],aa.prototype,"newLink",void 0);aa=Se([J(),Ae("design:paramtypes",[Er,Er])],aa);var Or=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},Yn=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Vo,Kt=class{constructor(e){e?this.links=e:this.links=[]}get(e){if(!e||!e.source&&!e.predicate&&!e.target)return this.links;if(e.source){let n=JSON.parse(JSON.stringify(this.links));return e.target&&(n=n.filter(i=>i.data.target===e.target)),e.predicate&&(n=n.filter(i=>i.data.predicate===e.predicate)),e.fromDate&&(n=n.filter(i=>new Date(i.timestamp)>=e.fromDate)),e.untilDate&&(n=n.filter(i=>new Date(i.timestamp)<=e.untilDate)),e.limit&&(n=n.slice(0,e.limit)),n}if(e.target){let n=JSON.parse(JSON.stringify(this.links));return e.predicate&&(n=n.filter(i=>i.data.predicate===e.predicate)),e.fromDate&&(n=n.filter(i=>new Date(i.timestamp)>=e.fromDate)),e.untilDate&&(n=n.filter(i=>new Date(i.timestamp)<=e.untilDate)),e.limit&&(n=n.slice(0,e.limit)),n}let r=JSON.parse(JSON.stringify(this.links));return r=r.filter(n=>n.data.predicate===e.predicate),e.limit&&(r=r.slice(0,e.limit)),r}getSingleTarget(e){delete e.target;let r=this.get(e);return r.length?r[0].data.target:null}};Or([g(),Yn("design:type",Array)],Kt.prototype,"links",void 0);Kt=Or([J(),Yn("design:paramtypes",[Array])],Kt);var Bo=class{};Or([g(),Yn("design:type",Array)],Bo.prototype,"links",void 0);Bo=Or([$e()],Bo);var Qo=Vo=class{constructor(e){e?this.links=e:this.links=[]}static fromLink(e){let r=new Vo;return r.links.push(e),r}};Or([g(),Yn("design:type",Array)],Qo.prototype,"links",void 0);Qo=Vo=Or([$e(),Yn("design:paramtypes",[Array])],Qo);var Go=class extends Xt(){};Go=Or([J()],Go);var L=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},F=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Qt=class{constructor(e,r){this.did=e,r?this.perspective=r:this.perspective=new Kt}};L([g(),F("design:type",String)],Qt.prototype,"did",void 0);L([g(),F("design:type",Kt)],Qt.prototype,"perspective",void 0);L([g(),F("design:type",String)],Qt.prototype,"directMessageLanguage",void 0);Qt=L([J(),F("design:paramtypes",[String,Kt])],Qt);var du=class extends Xt(){};du=L([J()],du);var zt=class{constructor(e,r,n,i,a,o){this.did=e,this.didSigningKeyId=r,this.deviceKeyType=n,this.deviceKey=i,this.deviceKeySignedByDid=a,this.didSignedByDeviceKey=o}};L([g(),F("design:type",String)],zt.prototype,"did",void 0);L([g(),F("design:type",String)],zt.prototype,"didSigningKeyId",void 0);L([g(),F("design:type",String)],zt.prototype,"deviceKeyType",void 0);L([g(),F("design:type",String)],zt.prototype,"deviceKey",void 0);L([g(),F("design:type",String)],zt.prototype,"deviceKeySignedByDid",void 0);L([g(),F("design:type",String)],zt.prototype,"didSignedByDeviceKey",void 0);zt=L([J(),F("design:paramtypes",[String,String,String,String,String,String])],zt);var Jt=class{constructor(e,r,n,i,a,o){this.did=e,this.didSigningKeyId=r,this.deviceKeyType=n,this.deviceKey=i,this.deviceKeySignedByDid=a,this.didSignedByDeviceKey=o}};L([g(),F("design:type",String)],Jt.prototype,"did",void 0);L([g(),F("design:type",String)],Jt.prototype,"didSigningKeyId",void 0);L([g(),F("design:type",String)],Jt.prototype,"deviceKeyType",void 0);L([g(),F("design:type",String)],Jt.prototype,"deviceKey",void 0);L([g(),F("design:type",String)],Jt.prototype,"deviceKeySignedByDid",void 0);L([g(),F("design:type",String)],Jt.prototype,"didSignedByDeviceKey",void 0);Jt=L([$e(),F("design:paramtypes",[String,String,String,String,String,String])],Jt);var oa=class{constructor(e,r){this.signature=e,this.publicKey=r}};L([g(),F("design:type",String)],oa.prototype,"signature",void 0);L([g(),F("design:type",String)],oa.prototype,"publicKey",void 0);oa=L([J(),F("design:paramtypes",[String,String])],oa);var Zr=class{constructor(e,r){this.domain=e,this.pointers=r}};L([g(),F("design:type",String)],Zr.prototype,"domain",void 0);L([g(),F("design:type",Array)],Zr.prototype,"pointers",void 0);Zr=L([J(),F("design:paramtypes",[String,Array])],Zr);var sa=class{constructor(e,r){this.with=e,this.can=r}};L([g(),F("design:type",Zr)],sa.prototype,"with",void 0);L([g(),F("design:type",Array)],sa.prototype,"can",void 0);sa=L([J(),F("design:paramtypes",[Zr,Array])],sa);var Nt=class{constructor(e,r,n,i,a){this.appName=e,this.appDesc=r,this.appIconPath=a,this.appUrl=n,this.capabilities=i}};L([g(),F("design:type",String)],Nt.prototype,"appName",void 0);L([g(),F("design:type",String)],Nt.prototype,"appDesc",void 0);L([g(),F("design:type",String)],Nt.prototype,"appUrl",void 0);L([g(),F("design:type",String)],Nt.prototype,"appIconPath",void 0);L([g(),F("design:type",Array)],Nt.prototype,"capabilities",void 0);Nt=L([J(),F("design:paramtypes",[String,String,String,Array,String])],Nt);var en=class{constructor(e,r,n,i){this.requestId=e,this.auth=r,this.token=n,this.revoked=i}};L([g(),F("design:type",String)],en.prototype,"requestId",void 0);L([g(),F("design:type",String)],en.prototype,"token",void 0);L([g(),F("design:type",Boolean)],en.prototype,"revoked",void 0);L([g(),F("design:type",Nt)],en.prototype,"auth",void 0);en=L([J(),F("design:paramtypes",[String,Nt,String,Boolean])],en);var tn=class{constructor(e,r){this.domain=e,this.pointers=r}};L([g(),F("design:type",String)],tn.prototype,"domain",void 0);L([g(),F("design:type",Array)],tn.prototype,"pointers",void 0);tn=L([$e(),F("design:paramtypes",[String,Array])],tn);var ca=class{constructor(e,r){this.with=e,this.can=r}};L([g(),F("design:type",tn)],ca.prototype,"with",void 0);L([g(),F("design:type",Array)],ca.prototype,"can",void 0);ca=L([$e(),F("design:paramtypes",[tn,Array])],ca);var Ht=class{constructor(e,r,n,i,a,o){this.appName=e,this.appDesc=r,this.appUrl=i,this.appDomain=n,this.capabilities=o,this.appIconPath=a}};L([g(),F("design:type",String)],Ht.prototype,"appName",void 0);L([g(),F("design:type",String)],Ht.prototype,"appDesc",void 0);L([g(),F("design:type",String)],Ht.prototype,"appDomain",void 0);L([g(),F("design:type",String)],Ht.prototype,"appUrl",void 0);L([g(),F("design:type",String)],Ht.prototype,"appIconPath",void 0);L([g(),F("design:type",Array)],Ht.prototype,"capabilities",void 0);Ht=L([$e(),F("design:paramtypes",[String,String,String,String,String,Array])],Ht);var nn=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},an=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},rt=class{constructor(e){e?(this.isInitialized=e.isInitialized,this.isInitialized||(this.isInitialized=!1),this.isUnlocked=e.isUnlocked,this.isUnlocked||(this.isUnlocked=!1),this.did=e.did,this.didDocument=e.didDocument,this.error=e.error):(this.isInitialized=!1,this.isUnlocked=!1)}};nn([g(),an("design:type",Boolean)],rt.prototype,"isInitialized",void 0);nn([g(),an("design:type",Boolean)],rt.prototype,"isUnlocked",void 0);nn([g(),an("design:type",String)],rt.prototype,"did",void 0);nn([g(),an("design:type",String)],rt.prototype,"didDocument",void 0);nn([g(),an("design:type",String)],rt.prototype,"error",void 0);rt=nn([J(),an("design:paramtypes",[Object])],rt);var hu=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},ye=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Ge,We,Wo=class{constructor(e,r){Ge.set(this,void 0),We.set(this,void 0),hu(this,Ge,e,"f"),hu(this,We,r,"f")}async otherAgents(){return await ye(this,Ge,"f").otherAgents(ye(this,We,"f"))}async hasTelepresenceAdapter(){return await ye(this,Ge,"f").hasTelepresenceAdapter(ye(this,We,"f"))}async onlineAgents(){return await ye(this,Ge,"f").onlineAgents(ye(this,We,"f"))}async setOnlineStatus(e){return await ye(this,Ge,"f").setOnlineStatus(ye(this,We,"f"),e)}async setOnlineStatusU(e){return await ye(this,Ge,"f").setOnlineStatusU(ye(this,We,"f"),e)}async sendSignal(e,r){return await ye(this,Ge,"f").sendSignal(ye(this,We,"f"),e,r)}async sendSignalU(e,r){return await ye(this,Ge,"f").sendSignalU(ye(this,We,"f"),e,r)}async sendBroadcast(e){return await ye(this,Ge,"f").sendBroadcast(ye(this,We,"f"),e)}async sendBroadcastU(e){return await ye(this,Ge,"f").sendBroadcastU(ye(this,We,"f"),e)}async addSignalHandler(e){await ye(this,Ge,"f").addSignalHandler(ye(this,We,"f"),e)}removeSignalHandler(e){ye(this,Ge,"f").removeSignalHandler(ye(this,We,"f"),e)}};Ge=new WeakMap,We=new WeakMap;var Tr=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},Ir=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},je=class{constructor(e){e&&(this.source=e.source,this.predicate=e.predicate,this.target=e.target,e.fromDate&&(this.fromDate=e.fromDate),e.untilDate&&(this.untilDate=e.untilDate),e.limit&&(this.limit=e.limit))}isMatch(e){return!(this.source&&this.source!==e.source||this.predicate&&this.predicate!==e.predicate||this.target&&this.target!==e.target)}};Tr([g(),Ir("design:type",String)],je.prototype,"source",void 0);Tr([g(),Ir("design:type",String)],je.prototype,"target",void 0);Tr([g(),Ir("design:type",String)],je.prototype,"predicate",void 0);Tr([g(),Ir("design:type",Date)],je.prototype,"fromDate",void 0);Tr([g(),Ir("design:type",Date)],je.prototype,"untilDate",void 0);Tr([g(),Ir("design:type",Number)],je.prototype,"limit",void 0);je=Tr([J(),$e(),Ir("design:paramtypes",[Object])],je);var mu=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Qe=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},ct,It;function Ro(t){return encodeURIComponent(t).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`)}var St=class{constructor(){ct.set(this,void 0),It.set(this,void 0)}static fromUrl(e){if(!e||!e.startsWith("literal://"))throw new Error("Can't create Literal from non-literal URL");let r=new St;return mu(r,It,e,"f"),r}static from(e){let r=new St;return mu(r,ct,e,"f"),r}toUrl(){if(Qe(this,It,"f")&&!Qe(this,ct,"f"))return Qe(this,It,"f");if(!Qe(this,It,"f")&&!Qe(this,ct,"f"))throw new Error("Can't turn empty Literal into URL");let e;switch(typeof Qe(this,ct,"f")){case"string":e=`string:${Ro(Qe(this,ct,"f"))}`;break;case"number":e=`number:${Ro(Qe(this,ct,"f"))}`;break;case"object":e=`json:${Ro(JSON.stringify(Qe(this,ct,"f")))}`;break}return`literal://${e}`}get(){if(Qe(this,ct,"f"))return Qe(this,ct,"f");if(!Qe(this,It,"f"))throw new Error("Can't render empty Literal");if(!Qe(this,It,"f").startsWith("literal://"))throw new Error("Can't render Literal from non-literal URL");let e=Qe(this,It,"f").substring(10);if(e.startsWith("string:"))return decodeURIComponent(e.substring(7));if(e.startsWith("number:")){let r=e.substring(7);return parseFloat(r)}if(e.startsWith("json:")){let r=e.substring(5);return JSON.parse(decodeURIComponent(r))}throw new Error(`Can't parse unknown literal: ${e}`)}};ct=new WeakMap,It=new WeakMap;function Gt(t){return t.charAt(0).toUpperCase()+t.slice(1)}function qu(t){return`set${Gt(t)}`}function At(t){return t.endsWith("y")?t.slice(0,-1)+"ies":t+"s"}function rs(t){return t.endsWith("ies")?t.slice(0,-3)+"y":t.endsWith("s")?t.slice(0,-1):t}function Lp(t){return`add${Gt(rs(t))}`}function Fp(t){let e=t.substring(3),r=At(e);return r.charAt(0).toLowerCase()+r.slice(1)}function Mp(t){return`remove${Gt(rs(t))}`}function jp(t){let e=t.substring(6),r=At(e);return r.charAt(0).toLowerCase()+r.slice(1)}function $p(t){let e=t.substring(13),r=At(e);return r.charAt(0).toLowerCase()+r.slice(1)}function Up(t){return`setCollection${Gt(rs(t))}`}function dr(t){if(Array.isArray(t))return`[${t.map(dr).join(", ")}]`;let e=Object.keys(t),r=[];for(let n of e){let i=JSON.stringify(t[n]),a=`${n}: ${i}`;r.push(a)}return`{${r.join(", ")}}`}var Lo=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},U=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Re,Le,fe,ua=class{constructor(t,e,r){Re.set(this,void 0),Le.set(this,void 0),fe.set(this,void 0),Lo(this,Re,e,"f"),Lo(this,Le,r,"f"),Lo(this,fe,t,"f")}get baseExpression(){return U(this,Re,"f")}async init(){let isInstance=await U(this,fe,"f").isSubjectInstance(U(this,Re,"f"),U(this,Le,"f"));if(!isInstance)throw`Not a valid subject instance of ${U(this,Le,"f")} for ${U(this,Re,"f")}`;let results=await U(this,fe,"f").infer(`subject_class("${U(this,Le,"f")}", C), property(C, Property)`),properties=results.map(t=>t.Property);for(let t of properties){let e=await U(this,fe,"f").infer(`subject_class("${U(this,Le,"f")}", C), property_resolve(C, "${t}")`);Object.defineProperty(this,t,{configurable:!0,get:async()=>{let r=await U(this,fe,"f").infer(`subject_class("${U(this,Le,"f")}", C), property_getter(C, "${U(this,Re,"f")}", "${t}", Value)`);if(r&&r.length>0){let n=r[0].Value;if(e)try{if(n){let i=await U(this,fe,"f").getExpression(n);try{return JSON.parse(i.data)}catch{return i.data}}else return n}catch{return n}else return n}else return r||void 0}})}let setters=await U(this,fe,"f").infer(`subject_class("${U(this,Le,"f")}", C), property_setter(C, Property, Setter)`);for(let setter of setters||[])if(setter){let property=setter.Property,actions=eval(setter.Setter),resolveLanguageResults=await U(this,fe,"f").infer(`subject_class("${U(this,Le,"f")}", C), property_resolve_language(C, "${property}", Language)`),resolveLanguage;resolveLanguageResults&&resolveLanguageResults.length>0&&(resolveLanguage=resolveLanguageResults[0].Language),this[qu(property)]=async t=>{resolveLanguage&&(t=await U(this,fe,"f").createExpression(t,resolveLanguage)),await U(this,fe,"f").executeAction(actions,U(this,Re,"f"),[{name:"value",value:t}])}}let results2=await U(this,fe,"f").infer(`subject_class("${U(this,Le,"f")}", C), collection(C, Collection)`);results2||(results2=[]);let collections=results2.map(t=>t.Collection);for(let t of collections)Object.defineProperty(this,t,{configurable:!0,get:async()=>{let e=await U(this,fe,"f").infer(`subject_class("${U(this,Le,"f")}", C), collection_getter(C, "${U(this,Re,"f")}", "${t}", Value)`);return e&&e.length>0&&e[0].Value?e[0].Value.filter(n=>n!==""&&n!==""):[]}});let adders=await U(this,fe,"f").infer(`subject_class("${U(this,Le,"f")}", C), collection_adder(C, Collection, Adder)`);adders||(adders=[]);for(let adder of adders)if(adder){let collection=adder.Collection,actions=eval(adder.Adder);this[Lp(collection)]=async t=>{Array.isArray(t)?await Promise.all(t.map(e=>U(this,fe,"f").executeAction(actions,U(this,Re,"f"),[{name:"value",value:e}]))):await U(this,fe,"f").executeAction(actions,U(this,Re,"f"),[{name:"value",value:t}])}}let removers=await U(this,fe,"f").infer(`subject_class("${U(this,Le,"f")}", C), collection_remover(C, Collection, Remover)`);removers||(removers=[]);for(let remover of removers)if(remover){let collection=remover.Collection,actions=eval(remover.Remover);this[Mp(collection)]=async t=>{Array.isArray(t)?await Promise.all(t.map(e=>U(this,fe,"f").executeAction(actions,U(this,Re,"f"),[{name:"value",value:e}]))):await U(this,fe,"f").executeAction(actions,U(this,Re,"f"),[{name:"value",value:t}])}}let collectionSetters=await U(this,fe,"f").infer(`subject_class("${U(this,Le,"f")}", C), collection_setter(C, Collection, Setter)`);collectionSetters||(collectionSetters=[]);for(let collectionSetter of collectionSetters)if(collectionSetter){let collection=collectionSetter.Collection,actions=eval(collectionSetter.Setter);this[Up(collection)]=async t=>{Array.isArray(t)?await U(this,fe,"f").executeAction(actions,U(this,Re,"f"),t.map(e=>({name:"value",value:e}))):await U(this,fe,"f").executeAction(actions,U(this,Re,"f"),[{name:"value",value:t}])}}}};Re=new WeakMap,Le=new WeakMap,fe=new WeakMap;var Wr=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},R=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},ce,be,hr,mr,yr,Pn,Xr=class{constructor(t,e){ce.set(this,void 0),be.set(this,void 0),hr.set(this,void 0),mr.set(this,void 0),yr.set(this,void 0),Pn.set(this,void 0),Wr(this,hr,[],"f"),Wr(this,mr,[],"f"),Wr(this,yr,[],"f"),Wr(this,Pn,[],"f"),Wr(this,ce,t,"f"),Wr(this,be,e,"f"),this.uuid=R(this,ce,"f").uuid,this.name=R(this,ce,"f").name,this.sharedUrl=R(this,ce,"f").sharedUrl,this.neighbourhood=R(this,ce,"f").neighbourhood,this.state=R(this,ce,"f").state,R(this,be,"f").addPerspectiveLinkAddedListener(R(this,ce,"f").uuid,R(this,hr,"f")),R(this,be,"f").addPerspectiveLinkRemovedListener(R(this,ce,"f").uuid,R(this,mr,"f")),R(this,be,"f").addPerspectiveLinkUpdatedListener(R(this,ce,"f").uuid,R(this,yr,"f")),R(this,be,"f").addPerspectiveSyncStateChangeListener(R(this,ce,"f").uuid,R(this,Pn,"f"))}async executeAction(t,e,r){let n=a=>{if(a)return a==="this"?e:a},i=a=>{if(r){let o=a;for(let s of r)o=o.replace(s.name,s.value);return o}else return a};for(let a of t){let o=n(i(a.source)),s=n(i(a.predicate)),u=n(i(a.target)),l=a?.local??!1;switch(a.action){case"addLink":await this.add(new bt({source:o,predicate:s,target:u}),l?"local":"shared");break;case"removeLink":let f=await this.get(new je({source:o,predicate:s,target:u}));for(let h of f)await this.remove(h);break;case"setSingleTarget":await this.setSingleTarget(new bt({source:o,predicate:s,target:u}),l?"local":"shared");break;case"collectionSetter":let d=await this.get(new je({source:o,predicate:s}));await this.removeLinks(d),await this.addLinks(r.map(h=>new bt({source:o,predicate:s,target:h.value})),l?"local":"shared");break}}}async get(t){return await R(this,be,"f").queryLinks(R(this,ce,"f").uuid,t)}async infer(t){return await R(this,be,"f").queryProlog(R(this,ce,"f").uuid,t)}async add(t,e="shared"){return await R(this,be,"f").addLink(R(this,ce,"f").uuid,t,e)}async addLinks(t,e="shared"){return await R(this,be,"f").addLinks(R(this,ce,"f").uuid,t,e)}async removeLinks(t){return await R(this,be,"f").removeLinks(R(this,ce,"f").uuid,t)}async linkMutations(t,e="shared"){return await R(this,be,"f").linkMutations(R(this,ce,"f").uuid,t,e)}async addLinkExpression(t,e="shared"){return await R(this,be,"f").addLinkExpression(R(this,ce,"f").uuid,t,e)}async update(t,e){return await R(this,be,"f").updateLink(R(this,ce,"f").uuid,t,e)}async remove(t){return await R(this,be,"f").removeLink(R(this,ce,"f").uuid,t)}async getExpression(t){return await R(this,be,"f").getExpression(t)}async createExpression(t,e){return await R(this,be,"f").createExpression(t,e)}async addListener(t,e){t==="link-added"?R(this,hr,"f").push(e):t==="link-removed"?R(this,mr,"f").push(e):t==="link-updated"&&R(this,yr,"f").push(e)}async addSyncStateChangeListener(t){R(this,Pn,"f").push(t)}async removeListener(t,e){if(t==="link-added"){let r=R(this,hr,"f").indexOf(e);R(this,hr,"f").splice(r,1)}else if(t==="link-removed"){let r=R(this,mr,"f").indexOf(e);R(this,mr,"f").splice(r,1)}else if(t==="link-updated"){let r=R(this,yr,"f").indexOf(e);R(this,yr,"f").splice(r,1)}}async snapshot(){return R(this,be,"f").snapshotByUUID(R(this,ce,"f").uuid)}async loadSnapshot(t){let e=JSON.parse(JSON.stringify(t));delete e.__typename,e.links.forEach(r=>{delete r.data.__typename});for(let r of e.links)await this.addLinkExpression(r)}async getSingleTarget(t){delete t.target;let e=await this.get(t);return e.length?e[0].data.target:null}async setSingleTarget(t,e="shared"){let r=new je({source:t.source,predicate:t.predicate}),n=await this.get(r),i=[];for(let o of n)delete o.__typename,delete o.data.__typename,delete o.proof.__typename,i.push(o);let a=[t];await this.linkMutations({additions:a,removals:i},e)}async sdnaFlows(){return(await this.infer("register_sdna_flow(X, _)")).map(e=>e.X)}async availableFlows(t){return(await this.infer(`flowable("${t}", F), register_sdna_flow(X, F)`)).map(r=>r.X)}async startFlow(flowName,exprAddr){let startAction=await this.infer(`start_action(Action, F), register_sdna_flow("${flowName}", F)`);startAction=eval(startAction[0].Action),await this.executeAction(startAction,exprAddr,void 0)}async expressionsInFlowState(t,e){return(await this.infer(`register_sdna_flow("${t}", F), flow_state(X, ${e}, F)`)).map(n=>n.X)}async flowState(t,e){return(await this.infer(`register_sdna_flow("${t}", F), flow_state("${e}", X, F)`))[0].X}async flowActions(t,e){return(await this.infer(`register_sdna_flow("${t}", Flow), flow_state("${e}", State, Flow), action(State, Name, _, _)`)).map(n=>n.Name)}async runFlowAction(flowName,exprAddr,actionName){let action=await this.infer(`register_sdna_flow("${flowName}", Flow), flow_state("${exprAddr}", State, Flow), action(State, "${actionName}", _, Action)`);action=eval(action[0].Action),await this.executeAction(action,exprAddr,void 0)}async getSdna(){return(await this.get(new je({predicate:"ad4m://sdna"}))).map(e=>e.data.target).map(e=>St.fromUrl(e).get())}async addSdna(t,e,r){return R(this,be,"f").addSdna(R(this,ce,"f").uuid,t,e,r)}async subjectClasses(){try{return(await this.infer("subject_class(X, _)")).map(t=>t.X)}catch{return[]}}async stringOrTemplateObjectToSubjectClass(t){if(typeof t=="string")return t;{let e=await this.subjectClassesByTemplate(t);return e[0]?e[0]:t.className}}async createSubject(subjectClass,exprAddr){let className=await this.stringOrTemplateObjectToSubjectClass(subjectClass),result=await this.infer(`subject_class("${className}", C), constructor(C, Actions)`);if(!result.length)throw"No constructor found for given subject class: "+className;let actions=result.map(x=>eval(x.Actions));return await this.executeAction(actions[0],exprAddr,void 0),this.getSubjectProxy(exprAddr,subjectClass)}async removeSubject(subjectClass,exprAddr){let className=await this.stringOrTemplateObjectToSubjectClass(subjectClass),result=await this.infer(`subject_class("${className}", C), destructor(C, Actions)`);if(!result.length)throw"No constructor found for given subject class: "+className;let actions=result.map(x=>eval(x.Actions));await this.executeAction(actions[0],exprAddr,void 0)}async isSubjectInstance(t,e){let r=await this.stringOrTemplateObjectToSubjectClass(e);return await this.infer(`subject_class("${r}", C), instance(C, "${t}")`)}async getSubjectProxy(t,e){if(!await this.isSubjectInstance(t,e))throw`Expression ${t} is not a subject instance of given class: ${JSON.stringify(e)}`;let r=await this.stringOrTemplateObjectToSubjectClass(e),n=new ua(this,t,r);return await n.init(),n}async getAllSubjectInstances(t){let e=[];typeof t=="string"?e=[t]:e=await this.subjectClassesByTemplate(t);let r=[];for(let n of e){let i=await this.infer(`subject_class("${n}", C), instance(C, X)`),a=await Promise.all(i.map(async o=>await this.getSubjectProxy(o.X,n)));r=r.concat(a)}return r}async getAllSubjectProxies(t){let e=[];typeof t=="string"?e=[t]:e=await this.subjectClassesByTemplate(t);let r=[];for(let n of e)r=await this.infer(`subject_class("${n}", C), instance(C, X)`);return r}async subjectClassesByTemplate(t){let e=[],r=[];Object.getPrototypeOf(t).__properties?Object.keys(Object.getPrototypeOf(t).__properties).forEach(l=>e.push(l)):e.push(...Object.keys(t).filter(l=>!Array.isArray(t[l]))),Object.getPrototypeOf(t).__collections?Object.keys(Object.getPrototypeOf(t).__collections).filter(l=>l!=="isSubjectInstance").forEach(l=>!r.includes(l)):r.push(...Object.keys(t).filter(l=>Array.isArray(t[l])).filter(l=>l!=="isSubjectInstance"));let n=Object.getOwnPropertyNames(t).filter(l=>typeof t[l]=="function"&&l.startsWith("set")&&!l.startsWith("setCollection"));n=n.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(t)).filter(l=>typeof t[l]=="function"&&l.startsWith("set")&&!l.startsWith("setCollection")));let i=Object.getOwnPropertyNames(t).filter(l=>typeof t[l]=="function"&&l.startsWith("add"));i=i.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(t)).filter(l=>typeof t[l]=="function"&&l.startsWith("add")));let a=Object.getOwnPropertyNames(t).filter(l=>typeof t[l]=="function"&&l.startsWith("remove"));a=a.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(t)).filter(l=>typeof t[l]=="function"&&l.startsWith("remove")));let o=Object.getOwnPropertyNames(t).filter(l=>typeof t[l]=="function"&&l.startsWith("setCollection"));o=o.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(t)).filter(l=>typeof t[l]=="function"&&l.startsWith("setCollection")));let s="subject_class(Class, C)";for(let l of e)s+=`, property(C, "${l}")`;for(let l of r)s+=`, collection(C, "${l}")`;for(let l of n){let f=l.substring(3);f=f.charAt(0).toLowerCase()+f.slice(1),s+=`, property_setter(C, "${f}", _)`}for(let l of i)s+=`, collection_adder(C, "${Fp(l)}", _)`;for(let l of a)s+=`, collection_remover(C, "${jp(l)}", _)`;for(let l of o)s+=`, collection_setter(C, "${$p(l)}", _)`;s+=".";let u=await this.infer(s);return u?u.map(l=>l.Class):[]}async ensureSDNASubjectClass(t){if((await this.subjectClassesByTemplate(new t)).length>0)return;let{name:r,sdna:n}=t.generateSDNA();await this.addSdna(r,n,"subject_class")}getNeighbourhoodProxy(){return R(this,be,"f").getNeighbourhoodProxy(R(this,ce,"f").uuid)}};ce=new WeakMap,be=new WeakMap,hr=new WeakMap,mr=new WeakMap,yr=new WeakMap,Pn=new WeakMap;var lr=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},z=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},ie,Cn,Rn,Ln,zi,Fn,Ji,He=`
61
+ this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`):o||Vo.set(i,o=new Set),o.add(a),e.has(a)||(e.add(a),r.push(n))}else r.push(n)}),na(na({},t),{definitions:r})}function Np(t){var e=new Set(t.definitions);e.forEach(function(n){n.loc&&delete n.loc,Object.keys(n).forEach(function(i){var a=n[i];a&&typeof a=="object"&&e.add(a)})});var r=t.loc;return r&&(delete r.startToken,delete r.endToken),t}function Ap(t){var e=qu(t);if(!Hi.has(e)){var r=xp(t,{experimentalFragmentVariables:ia,allowLegacyFragmentVariables:ia});if(!r||r.kind!=="Document")throw new Error("Not a valid GraphQL document.");Hi.set(e,Np(kp(r)))}return Hi.get(e)}function E(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];typeof t=="string"&&(t=[t]);var n=t[0];return e.forEach(function(i,a){i&&i.kind==="Document"?n+=i.loc.source.body:n+=i,n+=t[a+1]}),Ap(n)}function Pp(){Hi.clear(),Vo.clear()}function Cp(){Uu=!1}function Rp(){ia=!0}function Lp(){ia=!1}var kn={gql:E,resetCaches:Pp,disableFragmentWarnings:Cp,enableExperimentalFragmentVariables:Rp,disableExperimentalFragmentVariables:Lp};(function(t){t.gql=kn.gql,t.resetCaches=kn.resetCaches,t.disableFragmentWarnings=kn.disableFragmentWarnings,t.enableExperimentalFragmentVariables=kn.enableExperimentalFragmentVariables,t.disableExperimentalFragmentVariables=kn.disableExperimentalFragmentVariables})(E||(E={}));E.default=E;function D(t){if(!t)throw"Got no result from Apollo";if(t.error)throw t.error;if(t.errors)throw t.errors;return t.data}function Fp(){}function rs(){return Fp}var v=rs,Ue=rs,H=rs,Vu=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},Bu=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},wr=class{constructor(e){this.code=e}};Vu([v(),Bu("design:type",String)],wr.prototype,"code",void 0);wr=Vu([H(),Bu("design:paramtypes",[String])],wr);var ns=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},is=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},vt=class{constructor(e,r){this.address=e,this.name=r}};ns([v(),is("design:type",String)],vt.prototype,"address",void 0);ns([v(),is("design:type",String)],vt.prototype,"name",void 0);vt=ns([H(),is("design:paramtypes",[String,String])],vt);var ue=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},_e=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Wt=class{constructor(e,r){this.key=r,this.signature=e}};ue([v(),_e("design:type",String)],Wt.prototype,"signature",void 0);ue([v(),_e("design:type",String)],Wt.prototype,"key",void 0);ue([v(),_e("design:type",Boolean)],Wt.prototype,"valid",void 0);ue([v(),_e("design:type",Boolean)],Wt.prototype,"invalid",void 0);Wt=ue([H(),Ue(),_e("design:paramtypes",[String,String])],Wt);var _r=class{};ue([v(),_e("design:type",String)],_r.prototype,"signature",void 0);ue([v(),_e("design:type",String)],_r.prototype,"key",void 0);ue([v(),_e("design:type",Boolean)],_r.prototype,"valid",void 0);ue([v(),_e("design:type",Boolean)],_r.prototype,"invalid",void 0);_r=ue([Ue()],_r);function Xt(t){let e=class{constructor(n,i,a,o){this.author=n,this.timestamp=i,this.data=a,this.proof=o}};return ue([v(),_e("design:type",String)],e.prototype,"author",void 0),ue([v(),_e("design:type",String)],e.prototype,"timestamp",void 0),ue([v(),_e("design:type",Object)],e.prototype,"data",void 0),ue([v(),_e("design:type",Wt)],e.prototype,"proof",void 0),e=ue([H(),_e("design:paramtypes",[String,String,Object,Wt])],e),e}function Mp(t){let e=class{};return ue([v(),_e("design:type",String)],e.prototype,"author",void 0),ue([v(),_e("design:type",String)],e.prototype,"timestamp",void 0),ue([v(),_e("design:type",Object)],e.prototype,"data",void 0),ue([v(),_e("design:type",_r)],e.prototype,"proof",void 0),e=ue([Ue()],e),e}var mu=class extends Xt(){};mu=ue([H()],mu);var aa=class extends Xt(){};ue([v(),_e("design:type",vt)],aa.prototype,"language",void 0);ue([v(),_e("design:type",wr)],aa.prototype,"icon",void 0);aa=ue([H()],aa);function RS(t){return t&&t.author&&t.timestamp&&t.data}var Se=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},Ne=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},bt=class{constructor(e){this.source=e.source?e.source:"",this.target=e.target?e.target:"",this.predicate=e.predicate?e.predicate:""}};Se([v(),Ne("design:type",String)],bt.prototype,"source",void 0);Se([v(),Ne("design:type",String)],bt.prototype,"target",void 0);Se([v(),Ne("design:type",String)],bt.prototype,"predicate",void 0);bt=Se([H(),Ne("design:paramtypes",[Object])],bt);var oa=class{};Se([v(),Ne("design:type",Array)],oa.prototype,"additions",void 0);Se([v(),Ne("design:type",Array)],oa.prototype,"removals",void 0);oa=Se([Ue()],oa);var sa=class{constructor(e,r){this.additions=e,this.removals=r}};Se([v(),Ne("design:type",Array)],sa.prototype,"additions",void 0);Se([v(),Ne("design:type",Array)],sa.prototype,"removals",void 0);sa=Se([H(),Ne("design:paramtypes",[Array,Array])],sa);var Hn=class{};Se([v(),Ne("design:type",String)],Hn.prototype,"source",void 0);Se([v(),Ne("design:type",String)],Hn.prototype,"target",void 0);Se([v(),Ne("design:type",String)],Hn.prototype,"predicate",void 0);Hn=Se([Ue()],Hn);var Er=class extends Xt(){hash(){let e=JSON.stringify(this.data,Object.keys(this.data).sort())+JSON.stringify(this.author)+this.timestamp,r=0,n,i;for(n=0;n<e.length;n++)i=e.charCodeAt(n),r=(r<<5)-r+i,r|=0;return r}};Se([v(),Ne("design:type",String)],Er.prototype,"status",void 0);Er=Se([H()],Er);var Bo=class extends Mp(){};Se([v(),Ne("design:type",String)],Bo.prototype,"status",void 0);Bo=Se([Ue()],Bo);function qS(t,e){return t.author==e.author&&t.timestamp==e.timestamp&&t.data.source==e.data.source&&t.data.predicate==e.data.predicate&&t.data.target==e.data.target}function VS(t){return t&&t.source&&t.target}var ca=class{constructor(e,r){this.oldLink=e,this.newLink=r}};Se([v(),Ne("design:type",Er)],ca.prototype,"oldLink",void 0);Se([v(),Ne("design:type",Er)],ca.prototype,"newLink",void 0);ca=Se([H(),Ne("design:paramtypes",[Er,Er])],ca);var Or=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},ei=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Qo,Kt=class{constructor(e){e?this.links=e:this.links=[]}get(e){if(!e||!e.source&&!e.predicate&&!e.target)return this.links;if(e.source){let n=JSON.parse(JSON.stringify(this.links));return e.target&&(n=n.filter(i=>i.data.target===e.target)),e.predicate&&(n=n.filter(i=>i.data.predicate===e.predicate)),e.fromDate&&(n=n.filter(i=>new Date(i.timestamp)>=e.fromDate)),e.untilDate&&(n=n.filter(i=>new Date(i.timestamp)<=e.untilDate)),e.limit&&(n=n.slice(0,e.limit)),n}if(e.target){let n=JSON.parse(JSON.stringify(this.links));return e.predicate&&(n=n.filter(i=>i.data.predicate===e.predicate)),e.fromDate&&(n=n.filter(i=>new Date(i.timestamp)>=e.fromDate)),e.untilDate&&(n=n.filter(i=>new Date(i.timestamp)<=e.untilDate)),e.limit&&(n=n.slice(0,e.limit)),n}let r=JSON.parse(JSON.stringify(this.links));return r=r.filter(n=>n.data.predicate===e.predicate),e.limit&&(r=r.slice(0,e.limit)),r}getSingleTarget(e){delete e.target;let r=this.get(e);return r.length?r[0].data.target:null}};Or([v(),ei("design:type",Array)],Kt.prototype,"links",void 0);Kt=Or([H(),ei("design:paramtypes",[Array])],Kt);var Go=class{};Or([v(),ei("design:type",Array)],Go.prototype,"links",void 0);Go=Or([Ue()],Go);var Wo=Qo=class{constructor(e){e?this.links=e:this.links=[]}static fromLink(e){let r=new Qo;return r.links.push(e),r}};Or([v(),ei("design:type",Array)],Wo.prototype,"links",void 0);Wo=Qo=Or([Ue(),ei("design:paramtypes",[Array])],Wo);var Ko=class extends Xt(){};Ko=Or([H()],Ko);var L=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},F=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Qt=class{constructor(e,r){this.did=e,r?this.perspective=r:this.perspective=new Kt}};L([v(),F("design:type",String)],Qt.prototype,"did",void 0);L([v(),F("design:type",Kt)],Qt.prototype,"perspective",void 0);L([v(),F("design:type",String)],Qt.prototype,"directMessageLanguage",void 0);Qt=L([H(),F("design:paramtypes",[String,Kt])],Qt);var yu=class extends Xt(){};yu=L([H()],yu);var zt=class{constructor(e,r,n,i,a,o){this.did=e,this.didSigningKeyId=r,this.deviceKeyType=n,this.deviceKey=i,this.deviceKeySignedByDid=a,this.didSignedByDeviceKey=o}};L([v(),F("design:type",String)],zt.prototype,"did",void 0);L([v(),F("design:type",String)],zt.prototype,"didSigningKeyId",void 0);L([v(),F("design:type",String)],zt.prototype,"deviceKeyType",void 0);L([v(),F("design:type",String)],zt.prototype,"deviceKey",void 0);L([v(),F("design:type",String)],zt.prototype,"deviceKeySignedByDid",void 0);L([v(),F("design:type",String)],zt.prototype,"didSignedByDeviceKey",void 0);zt=L([H(),F("design:paramtypes",[String,String,String,String,String,String])],zt);var Jt=class{constructor(e,r,n,i,a,o){this.did=e,this.didSigningKeyId=r,this.deviceKeyType=n,this.deviceKey=i,this.deviceKeySignedByDid=a,this.didSignedByDeviceKey=o}};L([v(),F("design:type",String)],Jt.prototype,"did",void 0);L([v(),F("design:type",String)],Jt.prototype,"didSigningKeyId",void 0);L([v(),F("design:type",String)],Jt.prototype,"deviceKeyType",void 0);L([v(),F("design:type",String)],Jt.prototype,"deviceKey",void 0);L([v(),F("design:type",String)],Jt.prototype,"deviceKeySignedByDid",void 0);L([v(),F("design:type",String)],Jt.prototype,"didSignedByDeviceKey",void 0);Jt=L([Ue(),F("design:paramtypes",[String,String,String,String,String,String])],Jt);var ua=class{constructor(e,r){this.signature=e,this.publicKey=r}};L([v(),F("design:type",String)],ua.prototype,"signature",void 0);L([v(),F("design:type",String)],ua.prototype,"publicKey",void 0);ua=L([H(),F("design:paramtypes",[String,String])],ua);var Zr=class{constructor(e,r){this.domain=e,this.pointers=r}};L([v(),F("design:type",String)],Zr.prototype,"domain",void 0);L([v(),F("design:type",Array)],Zr.prototype,"pointers",void 0);Zr=L([H(),F("design:paramtypes",[String,Array])],Zr);var la=class{constructor(e,r){this.with=e,this.can=r}};L([v(),F("design:type",Zr)],la.prototype,"with",void 0);L([v(),F("design:type",Array)],la.prototype,"can",void 0);la=L([H(),F("design:paramtypes",[Zr,Array])],la);var At=class{constructor(e,r,n,i,a){this.appName=e,this.appDesc=r,this.appIconPath=a,this.appUrl=n,this.capabilities=i}};L([v(),F("design:type",String)],At.prototype,"appName",void 0);L([v(),F("design:type",String)],At.prototype,"appDesc",void 0);L([v(),F("design:type",String)],At.prototype,"appUrl",void 0);L([v(),F("design:type",String)],At.prototype,"appIconPath",void 0);L([v(),F("design:type",Array)],At.prototype,"capabilities",void 0);At=L([H(),F("design:paramtypes",[String,String,String,Array,String])],At);var en=class{constructor(e,r,n,i){this.requestId=e,this.auth=r,this.token=n,this.revoked=i}};L([v(),F("design:type",String)],en.prototype,"requestId",void 0);L([v(),F("design:type",String)],en.prototype,"token",void 0);L([v(),F("design:type",Boolean)],en.prototype,"revoked",void 0);L([v(),F("design:type",At)],en.prototype,"auth",void 0);en=L([H(),F("design:paramtypes",[String,At,String,Boolean])],en);var tn=class{constructor(e,r){this.domain=e,this.pointers=r}};L([v(),F("design:type",String)],tn.prototype,"domain",void 0);L([v(),F("design:type",Array)],tn.prototype,"pointers",void 0);tn=L([Ue(),F("design:paramtypes",[String,Array])],tn);var fa=class{constructor(e,r){this.with=e,this.can=r}};L([v(),F("design:type",tn)],fa.prototype,"with",void 0);L([v(),F("design:type",Array)],fa.prototype,"can",void 0);fa=L([Ue(),F("design:paramtypes",[tn,Array])],fa);var Ht=class{constructor(e,r,n,i,a,o){this.appName=e,this.appDesc=r,this.appUrl=i,this.appDomain=n,this.capabilities=o,this.appIconPath=a}};L([v(),F("design:type",String)],Ht.prototype,"appName",void 0);L([v(),F("design:type",String)],Ht.prototype,"appDesc",void 0);L([v(),F("design:type",String)],Ht.prototype,"appDomain",void 0);L([v(),F("design:type",String)],Ht.prototype,"appUrl",void 0);L([v(),F("design:type",String)],Ht.prototype,"appIconPath",void 0);L([v(),F("design:type",Array)],Ht.prototype,"capabilities",void 0);Ht=L([Ue(),F("design:paramtypes",[String,String,String,String,String,Array])],Ht);var nn=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},an=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},rt=class{constructor(e){e?(this.isInitialized=e.isInitialized,this.isInitialized||(this.isInitialized=!1),this.isUnlocked=e.isUnlocked,this.isUnlocked||(this.isUnlocked=!1),this.did=e.did,this.didDocument=e.didDocument,this.error=e.error):(this.isInitialized=!1,this.isUnlocked=!1)}};nn([v(),an("design:type",Boolean)],rt.prototype,"isInitialized",void 0);nn([v(),an("design:type",Boolean)],rt.prototype,"isUnlocked",void 0);nn([v(),an("design:type",String)],rt.prototype,"did",void 0);nn([v(),an("design:type",String)],rt.prototype,"didDocument",void 0);nn([v(),an("design:type",String)],rt.prototype,"error",void 0);rt=nn([H(),an("design:paramtypes",[Object])],rt);var gu=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},ye=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Ge,We,zo=class{constructor(e,r){Ge.set(this,void 0),We.set(this,void 0),gu(this,Ge,e,"f"),gu(this,We,r,"f")}async otherAgents(){return await ye(this,Ge,"f").otherAgents(ye(this,We,"f"))}async hasTelepresenceAdapter(){return await ye(this,Ge,"f").hasTelepresenceAdapter(ye(this,We,"f"))}async onlineAgents(){return await ye(this,Ge,"f").onlineAgents(ye(this,We,"f"))}async setOnlineStatus(e){return await ye(this,Ge,"f").setOnlineStatus(ye(this,We,"f"),e)}async setOnlineStatusU(e){return await ye(this,Ge,"f").setOnlineStatusU(ye(this,We,"f"),e)}async sendSignal(e,r){return await ye(this,Ge,"f").sendSignal(ye(this,We,"f"),e,r)}async sendSignalU(e,r){return await ye(this,Ge,"f").sendSignalU(ye(this,We,"f"),e,r)}async sendBroadcast(e){return await ye(this,Ge,"f").sendBroadcast(ye(this,We,"f"),e)}async sendBroadcastU(e){return await ye(this,Ge,"f").sendBroadcastU(ye(this,We,"f"),e)}async addSignalHandler(e){await ye(this,Ge,"f").addSignalHandler(ye(this,We,"f"),e)}removeSignalHandler(e){ye(this,Ge,"f").removeSignalHandler(ye(this,We,"f"),e)}};Ge=new WeakMap,We=new WeakMap;var xr=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},Ir=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},$e=class{constructor(e){e&&(this.source=e.source,this.predicate=e.predicate,this.target=e.target,e.fromDate&&(this.fromDate=e.fromDate),e.untilDate&&(this.untilDate=e.untilDate),e.limit&&(this.limit=e.limit))}isMatch(e){return!(this.source&&this.source!==e.source||this.predicate&&this.predicate!==e.predicate||this.target&&this.target!==e.target)}};xr([v(),Ir("design:type",String)],$e.prototype,"source",void 0);xr([v(),Ir("design:type",String)],$e.prototype,"target",void 0);xr([v(),Ir("design:type",String)],$e.prototype,"predicate",void 0);xr([v(),Ir("design:type",Date)],$e.prototype,"fromDate",void 0);xr([v(),Ir("design:type",Date)],$e.prototype,"untilDate",void 0);xr([v(),Ir("design:type",Number)],$e.prototype,"limit",void 0);$e=xr([H(),Ue(),Ir("design:paramtypes",[Object])],$e);var vu=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Qe=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},ct,It;function Mo(t){return encodeURIComponent(t).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`)}var St=class{constructor(){ct.set(this,void 0),It.set(this,void 0)}static fromUrl(e){if(!e||!e.startsWith("literal://"))throw new Error("Can't create Literal from non-literal URL");let r=new St;return vu(r,It,e,"f"),r}static from(e){let r=new St;return vu(r,ct,e,"f"),r}toUrl(){if(Qe(this,It,"f")&&!Qe(this,ct,"f"))return Qe(this,It,"f");if(!Qe(this,It,"f")&&!Qe(this,ct,"f"))throw new Error("Can't turn empty Literal into URL");let e;switch(typeof Qe(this,ct,"f")){case"string":e=`string:${Mo(Qe(this,ct,"f"))}`;break;case"number":e=`number:${Mo(Qe(this,ct,"f"))}`;break;case"object":e=`json:${Mo(JSON.stringify(Qe(this,ct,"f")))}`;break}return`literal://${e}`}get(){if(Qe(this,ct,"f"))return Qe(this,ct,"f");if(!Qe(this,It,"f"))throw new Error("Can't render empty Literal");if(!Qe(this,It,"f").startsWith("literal://"))throw new Error("Can't render Literal from non-literal URL");let e=Qe(this,It,"f").substring(10);if(e.startsWith("string:"))return decodeURIComponent(e.substring(7));if(e.startsWith("number:")){let r=e.substring(7);return parseFloat(r)}if(e.startsWith("json:")){let r=e.substring(5);return JSON.parse(decodeURIComponent(r))}throw new Error(`Can't parse unknown literal: ${e}`)}};ct=new WeakMap,It=new WeakMap;function Gt(t){return t.charAt(0).toUpperCase()+t.slice(1)}function Qu(t){return`set${Gt(t)}`}function Nt(t){return t.endsWith("y")?t.slice(0,-1)+"ies":t+"s"}function as(t){return t.endsWith("ies")?t.slice(0,-3)+"y":t.endsWith("s")?t.slice(0,-1):t}function jp(t){return`add${Gt(as(t))}`}function $p(t){let e=t.substring(3),r=Nt(e);return r.charAt(0).toLowerCase()+r.slice(1)}function Up(t){return`remove${Gt(as(t))}`}function qp(t){let e=t.substring(6),r=Nt(e);return r.charAt(0).toLowerCase()+r.slice(1)}function Vp(t){let e=t.substring(13),r=Nt(e);return r.charAt(0).toLowerCase()+r.slice(1)}function Bp(t){return`setCollection${Gt(as(t))}`}function dr(t){if(Array.isArray(t))return`[${t.map(dr).join(", ")}]`;let e=Object.keys(t),r=[];for(let n of e){let i=JSON.stringify(t[n]),a=`${n}: ${i}`;r.push(a)}return`{${r.join(", ")}}`}var jo=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},U=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Le,Fe,fe,pa=class{constructor(t,e,r){Le.set(this,void 0),Fe.set(this,void 0),fe.set(this,void 0),jo(this,Le,e,"f"),jo(this,Fe,r,"f"),jo(this,fe,t,"f")}get baseExpression(){return U(this,Le,"f")}async init(){let isInstance=await U(this,fe,"f").isSubjectInstance(U(this,Le,"f"),U(this,Fe,"f"));if(!isInstance)throw`Not a valid subject instance of ${U(this,Fe,"f")} for ${U(this,Le,"f")}`;let results=await U(this,fe,"f").infer(`subject_class("${U(this,Fe,"f")}", C), property(C, Property)`),properties=results.map(t=>t.Property);for(let t of properties){let e=await U(this,fe,"f").infer(`subject_class("${U(this,Fe,"f")}", C), property_resolve(C, "${t}")`);Object.defineProperty(this,t,{configurable:!0,get:async()=>{let r=await U(this,fe,"f").infer(`subject_class("${U(this,Fe,"f")}", C), property_getter(C, "${U(this,Le,"f")}", "${t}", Value)`);if(r&&r.length>0){let n=r[0].Value;if(e)try{if(n){let i=await U(this,fe,"f").getExpression(n);try{return JSON.parse(i.data)}catch{return i.data}}else return n}catch{return n}else return n}else return r||void 0}})}let setters=await U(this,fe,"f").infer(`subject_class("${U(this,Fe,"f")}", C), property_setter(C, Property, Setter)`);for(let setter of setters||[])if(setter){let property=setter.Property,actions=eval(setter.Setter),resolveLanguageResults=await U(this,fe,"f").infer(`subject_class("${U(this,Fe,"f")}", C), property_resolve_language(C, "${property}", Language)`),resolveLanguage;resolveLanguageResults&&resolveLanguageResults.length>0&&(resolveLanguage=resolveLanguageResults[0].Language),this[Qu(property)]=async t=>{resolveLanguage&&(t=await U(this,fe,"f").createExpression(t,resolveLanguage)),await U(this,fe,"f").executeAction(actions,U(this,Le,"f"),[{name:"value",value:t}])}}let results2=await U(this,fe,"f").infer(`subject_class("${U(this,Fe,"f")}", C), collection(C, Collection)`);results2||(results2=[]);let collections=results2.map(t=>t.Collection);for(let t of collections)Object.defineProperty(this,t,{configurable:!0,get:async()=>{let e=await U(this,fe,"f").infer(`subject_class("${U(this,Fe,"f")}", C), collection_getter(C, "${U(this,Le,"f")}", "${t}", Value)`);return e&&e.length>0&&e[0].Value?e[0].Value.filter(n=>n!==""&&n!==""):[]}});let adders=await U(this,fe,"f").infer(`subject_class("${U(this,Fe,"f")}", C), collection_adder(C, Collection, Adder)`);adders||(adders=[]);for(let adder of adders)if(adder){let collection=adder.Collection,actions=eval(adder.Adder);this[jp(collection)]=async t=>{Array.isArray(t)?await Promise.all(t.map(e=>U(this,fe,"f").executeAction(actions,U(this,Le,"f"),[{name:"value",value:e}]))):await U(this,fe,"f").executeAction(actions,U(this,Le,"f"),[{name:"value",value:t}])}}let removers=await U(this,fe,"f").infer(`subject_class("${U(this,Fe,"f")}", C), collection_remover(C, Collection, Remover)`);removers||(removers=[]);for(let remover of removers)if(remover){let collection=remover.Collection,actions=eval(remover.Remover);this[Up(collection)]=async t=>{Array.isArray(t)?await Promise.all(t.map(e=>U(this,fe,"f").executeAction(actions,U(this,Le,"f"),[{name:"value",value:e}]))):await U(this,fe,"f").executeAction(actions,U(this,Le,"f"),[{name:"value",value:t}])}}let collectionSetters=await U(this,fe,"f").infer(`subject_class("${U(this,Fe,"f")}", C), collection_setter(C, Collection, Setter)`);collectionSetters||(collectionSetters=[]);for(let collectionSetter of collectionSetters)if(collectionSetter){let collection=collectionSetter.Collection,actions=eval(collectionSetter.Setter);this[Bp(collection)]=async t=>{Array.isArray(t)?await U(this,fe,"f").executeAction(actions,U(this,Le,"f"),t.map(e=>({name:"value",value:e}))):await U(this,fe,"f").executeAction(actions,U(this,Le,"f"),[{name:"value",value:t}])}}}};Le=new WeakMap,Fe=new WeakMap,fe=new WeakMap;var Wr=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},R=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},ce,be,hr,mr,yr,Cn,Xr=class{constructor(t,e){ce.set(this,void 0),be.set(this,void 0),hr.set(this,void 0),mr.set(this,void 0),yr.set(this,void 0),Cn.set(this,void 0),Wr(this,hr,[],"f"),Wr(this,mr,[],"f"),Wr(this,yr,[],"f"),Wr(this,Cn,[],"f"),Wr(this,ce,t,"f"),Wr(this,be,e,"f"),this.uuid=R(this,ce,"f").uuid,this.name=R(this,ce,"f").name,this.sharedUrl=R(this,ce,"f").sharedUrl,this.neighbourhood=R(this,ce,"f").neighbourhood,this.state=R(this,ce,"f").state,R(this,be,"f").addPerspectiveLinkAddedListener(R(this,ce,"f").uuid,R(this,hr,"f")),R(this,be,"f").addPerspectiveLinkRemovedListener(R(this,ce,"f").uuid,R(this,mr,"f")),R(this,be,"f").addPerspectiveLinkUpdatedListener(R(this,ce,"f").uuid,R(this,yr,"f")),R(this,be,"f").addPerspectiveSyncStateChangeListener(R(this,ce,"f").uuid,R(this,Cn,"f"))}async executeAction(t,e,r){let n=a=>{if(a)return a==="this"?e:a},i=a=>{if(r){let o=a;for(let s of r)o=o.replace(s.name,s.value);return o}else return a};for(let a of t){let o=n(i(a.source)),s=n(i(a.predicate)),u=n(i(a.target)),l=a?.local??!1;switch(a.action){case"addLink":await this.add(new bt({source:o,predicate:s,target:u}),l?"local":"shared");break;case"removeLink":let f=await this.get(new $e({source:o,predicate:s,target:u}));for(let h of f)await this.remove(h);break;case"setSingleTarget":await this.setSingleTarget(new bt({source:o,predicate:s,target:u}),l?"local":"shared");break;case"collectionSetter":let d=await this.get(new $e({source:o,predicate:s}));await this.removeLinks(d),await this.addLinks(r.map(h=>new bt({source:o,predicate:s,target:h.value})),l?"local":"shared");break}}}async get(t){return await R(this,be,"f").queryLinks(R(this,ce,"f").uuid,t)}async infer(t){return await R(this,be,"f").queryProlog(R(this,ce,"f").uuid,t)}async add(t,e="shared"){return await R(this,be,"f").addLink(R(this,ce,"f").uuid,t,e)}async addLinks(t,e="shared"){return await R(this,be,"f").addLinks(R(this,ce,"f").uuid,t,e)}async removeLinks(t){return await R(this,be,"f").removeLinks(R(this,ce,"f").uuid,t)}async linkMutations(t,e="shared"){return await R(this,be,"f").linkMutations(R(this,ce,"f").uuid,t,e)}async addLinkExpression(t,e="shared"){return await R(this,be,"f").addLinkExpression(R(this,ce,"f").uuid,t,e)}async update(t,e){return await R(this,be,"f").updateLink(R(this,ce,"f").uuid,t,e)}async remove(t){return await R(this,be,"f").removeLink(R(this,ce,"f").uuid,t)}async getExpression(t){return await R(this,be,"f").getExpression(t)}async createExpression(t,e){return await R(this,be,"f").createExpression(t,e)}async addListener(t,e){t==="link-added"?R(this,hr,"f").push(e):t==="link-removed"?R(this,mr,"f").push(e):t==="link-updated"&&R(this,yr,"f").push(e)}async addSyncStateChangeListener(t){R(this,Cn,"f").push(t)}async removeListener(t,e){if(t==="link-added"){let r=R(this,hr,"f").indexOf(e);R(this,hr,"f").splice(r,1)}else if(t==="link-removed"){let r=R(this,mr,"f").indexOf(e);R(this,mr,"f").splice(r,1)}else if(t==="link-updated"){let r=R(this,yr,"f").indexOf(e);R(this,yr,"f").splice(r,1)}}async snapshot(){return R(this,be,"f").snapshotByUUID(R(this,ce,"f").uuid)}async loadSnapshot(t){let e=JSON.parse(JSON.stringify(t));delete e.__typename,e.links.forEach(r=>{delete r.data.__typename});for(let r of e.links)await this.addLinkExpression(r)}async getSingleTarget(t){delete t.target;let e=await this.get(t);return e.length?e[0].data.target:null}async setSingleTarget(t,e="shared"){let r=new $e({source:t.source,predicate:t.predicate}),n=await this.get(r),i=[];for(let o of n)delete o.__typename,delete o.data.__typename,delete o.proof.__typename,i.push(o);let a=[t];await this.linkMutations({additions:a,removals:i},e)}async sdnaFlows(){return(await this.infer("register_sdna_flow(X, _)")).map(e=>e.X)}async availableFlows(t){return(await this.infer(`flowable("${t}", F), register_sdna_flow(X, F)`)).map(r=>r.X)}async startFlow(flowName,exprAddr){let startAction=await this.infer(`start_action(Action, F), register_sdna_flow("${flowName}", F)`);startAction=eval(startAction[0].Action),await this.executeAction(startAction,exprAddr,void 0)}async expressionsInFlowState(t,e){return(await this.infer(`register_sdna_flow("${t}", F), flow_state(X, ${e}, F)`)).map(n=>n.X)}async flowState(t,e){return(await this.infer(`register_sdna_flow("${t}", F), flow_state("${e}", X, F)`))[0].X}async flowActions(t,e){return(await this.infer(`register_sdna_flow("${t}", Flow), flow_state("${e}", State, Flow), action(State, Name, _, _)`)).map(n=>n.Name)}async runFlowAction(flowName,exprAddr,actionName){let action=await this.infer(`register_sdna_flow("${flowName}", Flow), flow_state("${exprAddr}", State, Flow), action(State, "${actionName}", _, Action)`);action=eval(action[0].Action),await this.executeAction(action,exprAddr,void 0)}async getSdna(){return(await this.get(new $e({predicate:"ad4m://sdna"}))).map(e=>e.data.target).map(e=>St.fromUrl(e).get())}async addSdna(t,e,r){return R(this,be,"f").addSdna(R(this,ce,"f").uuid,t,e,r)}async subjectClasses(){try{return(await this.infer("subject_class(X, _)")).map(t=>t.X)}catch{return[]}}async stringOrTemplateObjectToSubjectClass(t){if(typeof t=="string")return t;{let e=await this.subjectClassesByTemplate(t);return e[0]?e[0]:t.className}}async createSubject(subjectClass,exprAddr){let className=await this.stringOrTemplateObjectToSubjectClass(subjectClass),result=await this.infer(`subject_class("${className}", C), constructor(C, Actions)`);if(!result.length)throw"No constructor found for given subject class: "+className;let actions=result.map(x=>eval(x.Actions));return await this.executeAction(actions[0],exprAddr,void 0),this.getSubjectProxy(exprAddr,subjectClass)}async removeSubject(subjectClass,exprAddr){let className=await this.stringOrTemplateObjectToSubjectClass(subjectClass),result=await this.infer(`subject_class("${className}", C), destructor(C, Actions)`);if(!result.length)throw"No constructor found for given subject class: "+className;let actions=result.map(x=>eval(x.Actions));await this.executeAction(actions[0],exprAddr,void 0)}async isSubjectInstance(t,e){let r=await this.stringOrTemplateObjectToSubjectClass(e);return await this.infer(`subject_class("${r}", C), instance(C, "${t}")`)}async getSubjectProxy(t,e){if(!await this.isSubjectInstance(t,e))throw`Expression ${t} is not a subject instance of given class: ${JSON.stringify(e)}`;let r=await this.stringOrTemplateObjectToSubjectClass(e),n=new pa(this,t,r);return await n.init(),n}async getAllSubjectInstances(t){let e=[];typeof t=="string"?e=[t]:e=await this.subjectClassesByTemplate(t);let r=[];for(let n of e){let i=await this.infer(`subject_class("${n}", C), instance(C, X)`),a=await Promise.all(i.map(async o=>await this.getSubjectProxy(o.X,n)));r=r.concat(a)}return r}async getAllSubjectProxies(t){let e=[];typeof t=="string"?e=[t]:e=await this.subjectClassesByTemplate(t);let r=[];for(let n of e)r=await this.infer(`subject_class("${n}", C), instance(C, X)`);return r}async subjectClassesByTemplate(t){let e=[],r=[];Object.getPrototypeOf(t).__properties?Object.keys(Object.getPrototypeOf(t).__properties).forEach(l=>e.push(l)):e.push(...Object.keys(t).filter(l=>!Array.isArray(t[l]))),Object.getPrototypeOf(t).__collections?Object.keys(Object.getPrototypeOf(t).__collections).filter(l=>l!=="isSubjectInstance").forEach(l=>!r.includes(l)):r.push(...Object.keys(t).filter(l=>Array.isArray(t[l])).filter(l=>l!=="isSubjectInstance"));let n=Object.getOwnPropertyNames(t).filter(l=>typeof t[l]=="function"&&l.startsWith("set")&&!l.startsWith("setCollection"));n=n.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(t)).filter(l=>typeof t[l]=="function"&&l.startsWith("set")&&!l.startsWith("setCollection")));let i=Object.getOwnPropertyNames(t).filter(l=>typeof t[l]=="function"&&l.startsWith("add"));i=i.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(t)).filter(l=>typeof t[l]=="function"&&l.startsWith("add")));let a=Object.getOwnPropertyNames(t).filter(l=>typeof t[l]=="function"&&l.startsWith("remove"));a=a.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(t)).filter(l=>typeof t[l]=="function"&&l.startsWith("remove")));let o=Object.getOwnPropertyNames(t).filter(l=>typeof t[l]=="function"&&l.startsWith("setCollection"));o=o.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(t)).filter(l=>typeof t[l]=="function"&&l.startsWith("setCollection")));let s="subject_class(Class, C)";for(let l of e)s+=`, property(C, "${l}")`;for(let l of r)s+=`, collection(C, "${l}")`;for(let l of n){let f=l.substring(3);f=f.charAt(0).toLowerCase()+f.slice(1),s+=`, property_setter(C, "${f}", _)`}for(let l of i)s+=`, collection_adder(C, "${$p(l)}", _)`;for(let l of a)s+=`, collection_remover(C, "${qp(l)}", _)`;for(let l of o)s+=`, collection_setter(C, "${Vp(l)}", _)`;s+=".";let u=await this.infer(s);return u?u.map(l=>l.Class):[]}async ensureSDNASubjectClass(t){if((await this.subjectClassesByTemplate(new t)).length>0)return;let{name:r,sdna:n}=t.generateSDNA();await this.addSdna(r,n,"subject_class")}getNeighbourhoodProxy(){return R(this,be,"f").getNeighbourhoodProxy(R(this,ce,"f").uuid)}};ce=new WeakMap,be=new WeakMap,hr=new WeakMap,mr=new WeakMap,yr=new WeakMap,Cn=new WeakMap;var lr=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},J=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},oe,Rn,Ln,Fn,Yi,Mn,Xi,He=`
62
62
  author
63
63
  timestamp
64
64
  status
@@ -84,49 +84,49 @@ neighbourhood {
84
84
  }
85
85
  author
86
86
  }
87
- `,la=class{constructor(e,r=!0){ie.set(this,void 0),Cn.set(this,void 0),Rn.set(this,void 0),Ln.set(this,void 0),zi.set(this,void 0),Fn.set(this,void 0),Ji.set(this,void 0),lr(this,ie,e,"f"),lr(this,Cn,[],"f"),lr(this,Rn,[],"f"),lr(this,Ln,[],"f"),lr(this,zi,[],"f"),r&&(this.subscribePerspectiveAdded(),this.subscribePerspectiveUpdated(),this.subscribePerspectiveRemoved())}setExpressionClient(e){lr(this,Fn,e,"f")}setNeighbourhoodClient(e){lr(this,Ji,e,"f")}async all(){let{perspectives:e}=D(await z(this,ie,"f").query({query:O`query perspectives {
87
+ `,da=class{constructor(e,r=!0){oe.set(this,void 0),Rn.set(this,void 0),Ln.set(this,void 0),Fn.set(this,void 0),Yi.set(this,void 0),Mn.set(this,void 0),Xi.set(this,void 0),lr(this,oe,e,"f"),lr(this,Rn,[],"f"),lr(this,Ln,[],"f"),lr(this,Fn,[],"f"),lr(this,Yi,[],"f"),r&&(this.subscribePerspectiveAdded(),this.subscribePerspectiveUpdated(),this.subscribePerspectiveRemoved())}setExpressionClient(e){lr(this,Mn,e,"f")}setNeighbourhoodClient(e){lr(this,Xi,e,"f")}async all(){let{perspectives:e}=D(await J(this,oe,"f").query({query:E`query perspectives {
88
88
  perspectives {
89
89
  ${Kr}
90
90
  }
91
- }`}));return e.map(r=>new Xr(r,this))}async byUUID(e){let{perspective:r}=D(await z(this,ie,"f").query({query:O`query perspective($uuid: String!) {
91
+ }`}));return e.map(r=>new Xr(r,this))}async byUUID(e){let{perspective:r}=D(await J(this,oe,"f").query({query:E`query perspective($uuid: String!) {
92
92
  perspective(uuid: $uuid) {
93
93
  ${Kr}
94
94
  }
95
- }`,variables:{uuid:e}}));return r?new Xr(r,this):null}async snapshotByUUID(e){let{perspectiveSnapshot:r}=D(await z(this,ie,"f").query({query:O`query perspectiveSnapshot($uuid: String!) {
95
+ }`,variables:{uuid:e}}));return r?new Xr(r,this):null}async snapshotByUUID(e){let{perspectiveSnapshot:r}=D(await J(this,oe,"f").query({query:E`query perspectiveSnapshot($uuid: String!) {
96
96
  perspectiveSnapshot(uuid: $uuid) {
97
97
  links { ${He} }
98
98
  }
99
- }`,variables:{uuid:e}}));return r}async publishSnapshotByUUID(e){let{perspectivePublishSnapshot:r}=D(await z(this,ie,"f").mutate({mutation:O`mutation perspectivePublishSnapshot($uuid: String!) {
99
+ }`,variables:{uuid:e}}));return r}async publishSnapshotByUUID(e){let{perspectivePublishSnapshot:r}=D(await J(this,oe,"f").mutate({mutation:E`mutation perspectivePublishSnapshot($uuid: String!) {
100
100
  perspectivePublishSnapshot(uuid: $uuid)
101
- }`,variables:{uuid:e}}));return r}async queryLinks(e,r){let{perspectiveQueryLinks:n}=D(await z(this,ie,"f").query({query:O`query perspectiveQueryLinks($uuid: String!, $query: LinkQuery!) {
101
+ }`,variables:{uuid:e}}));return r}async queryLinks(e,r){let{perspectiveQueryLinks:n}=D(await J(this,oe,"f").query({query:E`query perspectiveQueryLinks($uuid: String!, $query: LinkQuery!) {
102
102
  perspectiveQueryLinks(query: $query, uuid: $uuid) {
103
103
  ${He}
104
104
  }
105
- }`,variables:{uuid:e,query:r}}));return n}async queryProlog(e,r){let{perspectiveQueryProlog:n}=D(await z(this,ie,"f").query({query:O`query perspectiveQueryProlog($uuid: String!, $query: String!) {
105
+ }`,variables:{uuid:e,query:r}}));return n}async queryProlog(e,r){let{perspectiveQueryProlog:n}=D(await J(this,oe,"f").query({query:E`query perspectiveQueryProlog($uuid: String!, $query: String!) {
106
106
  perspectiveQueryProlog(uuid: $uuid, query: $query)
107
- }`,variables:{uuid:e,query:r}}));return JSON.parse(n)}async add(e){let{perspectiveAdd:r}=D(await z(this,ie,"f").mutate({mutation:O`mutation perspectiveAdd($name: String!) {
107
+ }`,variables:{uuid:e,query:r}}));return JSON.parse(n)}async add(e){let{perspectiveAdd:r}=D(await J(this,oe,"f").mutate({mutation:E`mutation perspectiveAdd($name: String!) {
108
108
  perspectiveAdd(name: $name) {
109
109
  ${Kr}
110
110
  }
111
- }`,variables:{name:e}}));return new Xr(r,this)}async update(e,r){let{perspectiveUpdate:n}=D(await z(this,ie,"f").mutate({mutation:O`mutation perspectiveUpdate($uuid: String!, $name: String!) {
111
+ }`,variables:{name:e}}));return new Xr(r,this)}async update(e,r){let{perspectiveUpdate:n}=D(await J(this,oe,"f").mutate({mutation:E`mutation perspectiveUpdate($uuid: String!, $name: String!) {
112
112
  perspectiveUpdate(uuid: $uuid, name: $name) {
113
113
  ${Kr}
114
114
  }
115
- }`,variables:{uuid:e,name:r}}));return new Xr(n,this)}async remove(e){return D(await z(this,ie,"f").mutate({mutation:O`mutation perspectiveRemove($uuid: String!) {
115
+ }`,variables:{uuid:e,name:r}}));return new Xr(n,this)}async remove(e){return D(await J(this,oe,"f").mutate({mutation:E`mutation perspectiveRemove($uuid: String!) {
116
116
  perspectiveRemove(uuid: $uuid)
117
- }`,variables:{uuid:e}}))}async addLink(e,r,n){let{perspectiveAddLink:i}=D(await z(this,ie,"f").mutate({mutation:O`mutation perspectiveAddLink($uuid: String!, $link: LinkInput!, $status: String){
117
+ }`,variables:{uuid:e}}))}async addLink(e,r,n){let{perspectiveAddLink:i}=D(await J(this,oe,"f").mutate({mutation:E`mutation perspectiveAddLink($uuid: String!, $link: LinkInput!, $status: String){
118
118
  perspectiveAddLink(link: $link, uuid: $uuid, status: $status) {
119
119
  ${He}
120
120
  }
121
- }`,variables:{uuid:e,link:r,status:n}}));return i}async addLinks(e,r,n){let{perspectiveAddLinks:i}=D(await z(this,ie,"f").mutate({mutation:O`mutation perspectiveAddLinks($uuid: String!, $links: [LinkInput!]!, $status: String){
121
+ }`,variables:{uuid:e,link:r,status:n}}));return i}async addLinks(e,r,n){let{perspectiveAddLinks:i}=D(await J(this,oe,"f").mutate({mutation:E`mutation perspectiveAddLinks($uuid: String!, $links: [LinkInput!]!, $status: String){
122
122
  perspectiveAddLinks(links: $links, uuid: $uuid, status: $status) {
123
123
  ${He}
124
124
  }
125
- }`,variables:{uuid:e,links:r,status:n}}));return i}async removeLinks(e,r){let{perspectiveRemoveLinks:n}=D(await z(this,ie,"f").mutate({mutation:O`mutation perspectiveRemoveLinks($uuid: String!, $links: [LinkExpressionInput!]!){
125
+ }`,variables:{uuid:e,links:r,status:n}}));return i}async removeLinks(e,r){let{perspectiveRemoveLinks:n}=D(await J(this,oe,"f").mutate({mutation:E`mutation perspectiveRemoveLinks($uuid: String!, $links: [LinkExpressionInput!]!){
126
126
  perspectiveRemoveLinks(links: $links, uuid: $uuid) {
127
127
  ${He}
128
128
  }
129
- }`,variables:{uuid:e,links:r}}));return n}async linkMutations(e,r,n){let{perspectiveLinkMutations:i}=D(await z(this,ie,"f").mutate({mutation:O`mutation perspectiveLinkMutations($uuid: String!, $mutations: LinkMutations!, $status: String){
129
+ }`,variables:{uuid:e,links:r}}));return n}async linkMutations(e,r,n){let{perspectiveLinkMutations:i}=D(await J(this,oe,"f").mutate({mutation:E`mutation perspectiveLinkMutations($uuid: String!, $mutations: LinkMutations!, $status: String){
130
130
  perspectiveLinkMutations(mutations: $mutations, uuid: $uuid, status: $status) {
131
131
  additions {
132
132
  ${He}
@@ -135,11 +135,11 @@ neighbourhood {
135
135
  ${He}
136
136
  }
137
137
  }
138
- }`,variables:{uuid:e,mutations:r,status:n}}));return i}async addLinkExpression(e,r,n){let{perspectiveAddLinkExpression:i}=D(await z(this,ie,"f").mutate({mutation:O`mutation perspectiveAddLinkExpression($uuid: String!, $link: LinkExpressionInput!, $status: String){
138
+ }`,variables:{uuid:e,mutations:r,status:n}}));return i}async addLinkExpression(e,r,n){let{perspectiveAddLinkExpression:i}=D(await J(this,oe,"f").mutate({mutation:E`mutation perspectiveAddLinkExpression($uuid: String!, $link: LinkExpressionInput!, $status: String){
139
139
  perspectiveAddLinkExpression(link: $link, uuid: $uuid, status: $status) {
140
140
  ${He}
141
141
  }
142
- }`,variables:{uuid:e,link:r}}));return i}async updateLink(e,r,n){delete r.__typename,delete r.data.__typename,delete r.proof.__typename;let{perspectiveUpdateLink:i}=D(await z(this,ie,"f").mutate({mutation:O`mutation perspectiveUpdateLink(
142
+ }`,variables:{uuid:e,link:r}}));return i}async updateLink(e,r,n){delete r.__typename,delete r.data.__typename,delete r.proof.__typename;let{perspectiveUpdateLink:i}=D(await J(this,oe,"f").mutate({mutation:E`mutation perspectiveUpdateLink(
143
143
  $uuid: String!,
144
144
  $newLink: LinkInput!
145
145
  $oldLink: LinkExpressionInput!
@@ -151,29 +151,29 @@ neighbourhood {
151
151
  ) {
152
152
  ${He}
153
153
  }
154
- }`,variables:{uuid:e,oldLink:r,newLink:n}}));return i.status||delete i.status,i}async removeLink(e,r){return delete r.__typename,delete r.data.__typename,delete r.proof.__typename,delete r.status,D(await z(this,ie,"f").mutate({mutation:O`mutation perspectiveRemoveLink($link: LinkExpressionInput!, $uuid: String!) {
154
+ }`,variables:{uuid:e,oldLink:r,newLink:n}}));return i.status||delete i.status,i}async removeLink(e,r){return delete r.__typename,delete r.data.__typename,delete r.proof.__typename,delete r.status,D(await J(this,oe,"f").mutate({mutation:E`mutation perspectiveRemoveLink($link: LinkExpressionInput!, $uuid: String!) {
155
155
  perspectiveRemoveLink(link: $link, uuid: $uuid)
156
- }`,variables:{uuid:e,link:r}}))}async addSdna(e,r,n,i){return D(await z(this,ie,"f").mutate({mutation:O`mutation perspectiveAddSdna($uuid: String!, $name: String!, $sdnaCode: String!, $sdnaType: String!) {
156
+ }`,variables:{uuid:e,link:r}}))}async addSdna(e,r,n,i){return D(await J(this,oe,"f").mutate({mutation:E`mutation perspectiveAddSdna($uuid: String!, $name: String!, $sdnaCode: String!, $sdnaType: String!) {
157
157
  perspectiveAddSdna(uuid: $uuid, name: $name, sdnaCode: $sdnaCode, sdnaType: $sdnaType)
158
- }`,variables:{uuid:e,name:r,sdnaCode:n,sdnaType:i}})).perspectiveAddSdna}async getExpression(e){return await z(this,Fn,"f").get(e)}async createExpression(e,r){return await z(this,Fn,"f").create(e,r)}addPerspectiveAddedListener(e){z(this,Cn,"f").push(e)}subscribePerspectiveAdded(){z(this,ie,"f").subscribe({query:O` subscription {
158
+ }`,variables:{uuid:e,name:r,sdnaCode:n,sdnaType:i}})).perspectiveAddSdna}async getExpression(e){return await J(this,Mn,"f").get(e)}async createExpression(e,r){return await J(this,Mn,"f").create(e,r)}addPerspectiveAddedListener(e){J(this,Rn,"f").push(e)}subscribePerspectiveAdded(){J(this,oe,"f").subscribe({query:E` subscription {
159
159
  perspectiveAdded { ${Kr} }
160
160
  }
161
- `}).subscribe({next:e=>{z(this,Cn,"f").forEach(r=>{r(e.data.perspectiveAdded)})},error:e=>console.error(e)})}addPerspectiveUpdatedListener(e){z(this,Rn,"f").push(e)}subscribePerspectiveUpdated(){z(this,ie,"f").subscribe({query:O` subscription {
161
+ `}).subscribe({next:e=>{J(this,Rn,"f").forEach(r=>{r(e.data.perspectiveAdded)})},error:e=>console.error(e)})}addPerspectiveUpdatedListener(e){J(this,Ln,"f").push(e)}subscribePerspectiveUpdated(){J(this,oe,"f").subscribe({query:E` subscription {
162
162
  perspectiveUpdated { ${Kr} }
163
163
  }
164
- `}).subscribe({next:e=>{z(this,Rn,"f").forEach(r=>{r(e.data.perspectiveUpdated)})},error:e=>console.error(e)})}addPerspectiveSyncedListener(e){z(this,zi,"f").push(e)}async addPerspectiveSyncStateChangeListener(e,r){z(this,ie,"f").subscribe({query:O` subscription {
164
+ `}).subscribe({next:e=>{J(this,Ln,"f").forEach(r=>{r(e.data.perspectiveUpdated)})},error:e=>console.error(e)})}addPerspectiveSyncedListener(e){J(this,Yi,"f").push(e)}async addPerspectiveSyncStateChangeListener(e,r){J(this,oe,"f").subscribe({query:E` subscription {
165
165
  perspectiveSyncStateChange(uuid: "${e}")
166
166
  }
167
- `}).subscribe({next:n=>{r.forEach(i=>{i(n.data.perspectiveSyncStateChange)})},error:n=>console.error(n)}),await new Promise(n=>setTimeout(n,500))}addPerspectiveRemovedListener(e){z(this,Ln,"f").push(e)}subscribePerspectiveRemoved(){z(this,ie,"f").subscribe({query:O` subscription {
167
+ `}).subscribe({next:n=>{r.forEach(i=>{i(n.data.perspectiveSyncStateChange)})},error:n=>console.error(n)}),await new Promise(n=>setTimeout(n,500))}addPerspectiveRemovedListener(e){J(this,Fn,"f").push(e)}subscribePerspectiveRemoved(){J(this,oe,"f").subscribe({query:E` subscription {
168
168
  perspectiveRemoved
169
169
  }
170
- `}).subscribe({next:e=>{z(this,Ln,"f").forEach(r=>{r(e.data.perspectiveRemoved)})},error:e=>console.error(e)})}async addPerspectiveLinkAddedListener(e,r){z(this,ie,"f").subscribe({query:O` subscription {
170
+ `}).subscribe({next:e=>{J(this,Fn,"f").forEach(r=>{r(e.data.perspectiveRemoved)})},error:e=>console.error(e)})}async addPerspectiveLinkAddedListener(e,r){J(this,oe,"f").subscribe({query:E` subscription {
171
171
  perspectiveLinkAdded(uuid: "${e}") { ${He} }
172
172
  }
173
- `}).subscribe({next:n=>{r.forEach(i=>{i(n.data.perspectiveLinkAdded)})},error:n=>console.error(n)}),await new Promise(n=>setTimeout(n,500))}async addPerspectiveLinkRemovedListener(e,r){z(this,ie,"f").subscribe({query:O` subscription {
173
+ `}).subscribe({next:n=>{r.forEach(i=>{i(n.data.perspectiveLinkAdded)})},error:n=>console.error(n)}),await new Promise(n=>setTimeout(n,500))}async addPerspectiveLinkRemovedListener(e,r){J(this,oe,"f").subscribe({query:E` subscription {
174
174
  perspectiveLinkRemoved(uuid: "${e}") { ${He} }
175
175
  }
176
- `}).subscribe({next:n=>{r.forEach(i=>{n.data.perspectiveLinkRemoved.status||delete n.data.perspectiveLinkRemoved.status,i(n.data.perspectiveLinkRemoved)})},error:n=>console.error(n)}),await new Promise(n=>setTimeout(n,500))}async addPerspectiveLinkUpdatedListener(e,r){z(this,ie,"f").subscribe({query:O` subscription {
176
+ `}).subscribe({next:n=>{r.forEach(i=>{n.data.perspectiveLinkRemoved.status||delete n.data.perspectiveLinkRemoved.status,i(n.data.perspectiveLinkRemoved)})},error:n=>console.error(n)}),await new Promise(n=>setTimeout(n,500))}async addPerspectiveLinkUpdatedListener(e,r){J(this,oe,"f").subscribe({query:E` subscription {
177
177
  perspectiveLinkUpdated(uuid: "${e}") {
178
178
  oldLink {
179
179
  ${He}
@@ -183,7 +183,7 @@ neighbourhood {
183
183
  }
184
184
  }
185
185
  }
186
- `}).subscribe({next:n=>{r.forEach(i=>{n.data.perspectiveLinkUpdated.newLink.status||delete n.data.perspectiveLinkUpdated.newLink.status,n.data.perspectiveLinkUpdated.oldLink.status||delete n.data.perspectiveLinkUpdated.oldLink.status,i(n.data.perspectiveLinkUpdated)})},error:n=>console.error(n)}),await new Promise(n=>setTimeout(n,500))}getNeighbourhoodProxy(e){return new Wo(z(this,Ji,"f"),e)}};ie=new WeakMap,Cn=new WeakMap,Rn=new WeakMap,Ln=new WeakMap,zi=new WeakMap,Fn=new WeakMap,Ji=new WeakMap;var Mi=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},H=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},te,Mn,jn,$n,An=`
186
+ `}).subscribe({next:n=>{r.forEach(i=>{n.data.perspectiveLinkUpdated.newLink.status||delete n.data.perspectiveLinkUpdated.newLink.status,n.data.perspectiveLinkUpdated.oldLink.status||delete n.data.perspectiveLinkUpdated.oldLink.status,i(n.data.perspectiveLinkUpdated)})},error:n=>console.error(n)}),await new Promise(n=>setTimeout(n,500))}getNeighbourhoodProxy(e){return new zo(J(this,Xi,"f"),e)}};oe=new WeakMap,Rn=new WeakMap,Ln=new WeakMap,Fn=new WeakMap,Yi=new WeakMap,Mn=new WeakMap,Xi=new WeakMap;var Ui=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Y=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},ne,jn,$n,Un,Nn=`
187
187
  did
188
188
  directMessageLanguage
189
189
  perspective {
@@ -197,7 +197,7 @@ neighbourhood {
197
197
  }
198
198
  }
199
199
  }
200
- `,ji=`
200
+ `,qi=`
201
201
  requestId
202
202
  revoked
203
203
  auth {
@@ -219,27 +219,27 @@ neighbourhood {
219
219
  did
220
220
  didDocument
221
221
  error
222
- `,$i=`
222
+ `,Vi=`
223
223
  did
224
224
  didSigningKeyId
225
225
  deviceKeyType
226
226
  deviceKey
227
227
  deviceKeySignedByDid
228
228
  didSignedByDeviceKey
229
- `,qp=`
229
+ `,Qp=`
230
230
  signature
231
231
  publicKey
232
- `,zn=class{constructor(e,r=!0){te.set(this,void 0),Mn.set(this,void 0),jn.set(this,void 0),$n.set(this,void 0),Mi(this,te,e,"f"),Mi(this,jn,[],"f"),Mi(this,$n,[],"f"),Mi(this,Mn,[],"f"),r&&(this.subscribeAgentUpdated(),this.subscribeAgentStatusChanged(),this.subscribeAppsChanged())}async me(){let{agent:e}=D(await H(this,te,"f").query({query:O`query agent { agent { ${An} } }`})),r=new Qt(e.did,e.perspective);return r.directMessageLanguage=e.directMessageLanguage,r}async status(){let{agentStatus:e}=D(await H(this,te,"f").query({query:O`query agentStatus {
232
+ `,Yn=class{constructor(e,r=!0){ne.set(this,void 0),jn.set(this,void 0),$n.set(this,void 0),Un.set(this,void 0),Ui(this,ne,e,"f"),Ui(this,$n,[],"f"),Ui(this,Un,[],"f"),Ui(this,jn,[],"f"),r&&(this.subscribeAgentUpdated(),this.subscribeAgentStatusChanged(),this.subscribeAppsChanged())}async me(){let{agent:e}=D(await Y(this,ne,"f").query({query:E`query agent { agent { ${Nn} } }`})),r=new Qt(e.did,e.perspective);return r.directMessageLanguage=e.directMessageLanguage,r}async status(){let{agentStatus:e}=D(await Y(this,ne,"f").query({query:E`query agentStatus {
233
233
  agentStatus {
234
234
  ${zr}
235
235
  }
236
- }`}));return new rt(e)}async generate(e){let{agentGenerate:r}=D(await H(this,te,"f").mutate({mutation:O`mutation agentGenerate(
236
+ }`}));return new rt(e)}async generate(e){let{agentGenerate:r}=D(await Y(this,ne,"f").mutate({mutation:E`mutation agentGenerate(
237
237
  $passphrase: String!
238
238
  ) {
239
239
  agentGenerate(passphrase: $passphrase) {
240
240
  ${zr}
241
241
  }
242
- }`,variables:{passphrase:e}}));return new rt(r)}async import(e){let{did:r,didDocument:n,keystore:i,passphrase:a}=e,{agentImport:o}=D(await H(this,te,"f").mutate({mutation:O`mutation agentImport(
242
+ }`,variables:{passphrase:e}}));return new rt(r)}async import(e){let{did:r,didDocument:n,keystore:i,passphrase:a}=e,{agentImport:o}=D(await Y(this,ne,"f").mutate({mutation:E`mutation agentImport(
243
243
  $did: String!,
244
244
  $didDocument: String!,
245
245
  $keystore: String!,
@@ -248,93 +248,93 @@ neighbourhood {
248
248
  agentImport(did: $did, didDocument: $didDocument, keystore: $keystore, passphrase: $passphrase) {
249
249
  ${zr}
250
250
  }
251
- }`,variables:{did:r,didDocument:n,keystore:i,passphrase:a}}));return new rt(o)}async lock(e){let{agentLock:r}=D(await H(this,te,"f").mutate({mutation:O`mutation agentLock($passphrase: String!) {
251
+ }`,variables:{did:r,didDocument:n,keystore:i,passphrase:a}}));return new rt(o)}async lock(e){let{agentLock:r}=D(await Y(this,ne,"f").mutate({mutation:E`mutation agentLock($passphrase: String!) {
252
252
  agentLock(passphrase: $passphrase) {
253
253
  ${zr}
254
254
  }
255
- }`,variables:{passphrase:e}}));return new rt(r)}async unlock(e,r=!0){let{agentUnlock:n}=D(await H(this,te,"f").mutate({mutation:O`mutation agentUnlock($passphrase: String!, $holochain: Boolean!) {
255
+ }`,variables:{passphrase:e}}));return new rt(r)}async unlock(e,r=!0){let{agentUnlock:n}=D(await Y(this,ne,"f").mutate({mutation:E`mutation agentUnlock($passphrase: String!, $holochain: Boolean!) {
256
256
  agentUnlock(passphrase: $passphrase, holochain: $holochain) {
257
257
  ${zr}
258
258
  }
259
- }`,variables:{passphrase:e,holochain:r}}));return new rt(n)}async byDID(e){let{agentByDID:r}=D(await H(this,te,"f").query({query:O`query agentByDID($did: String!) {
259
+ }`,variables:{passphrase:e,holochain:r}}));return new rt(n)}async byDID(e){let{agentByDID:r}=D(await Y(this,ne,"f").query({query:E`query agentByDID($did: String!) {
260
260
  agentByDID(did: $did) {
261
- ${An}
261
+ ${Nn}
262
262
  }
263
- }`,variables:{did:e}}));return r}async updatePublicPerspective(e){let r=JSON.parse(JSON.stringify(e));delete r.__typename,r.links.forEach(o=>{delete o.__typename,delete o.data.__typename,delete o.proof.__typename,delete o.status});let{agentUpdatePublicPerspective:n}=D(await H(this,te,"f").mutate({mutation:O`mutation agentUpdatePublicPerspective($perspective: PerspectiveInput!) {
263
+ }`,variables:{did:e}}));return r}async updatePublicPerspective(e){let r=JSON.parse(JSON.stringify(e));delete r.__typename,r.links.forEach(o=>{delete o.__typename,delete o.data.__typename,delete o.proof.__typename,delete o.status});let{agentUpdatePublicPerspective:n}=D(await Y(this,ne,"f").mutate({mutation:E`mutation agentUpdatePublicPerspective($perspective: PerspectiveInput!) {
264
264
  agentUpdatePublicPerspective(perspective: $perspective) {
265
- ${An}
265
+ ${Nn}
266
266
  }
267
- }`,variables:{perspective:r}})),i=n,a=new Qt(i.did,i.perspective);return a.directMessageLanguage=i.directMessageLanguage,a}async mutatePublicPerspective(e){let r=new la(H(this,te,"f")),n=new zn(H(this,te,"f")),i=await r.add("Agent Perspective Proxy"),a=await n.me();a.perspective&&await i.loadSnapshot(a.perspective);for(let u of e.additions)await i.add(u);for(let u of e.removals)await i.remove(u);let o=await i.snapshot(),s=await this.updatePublicPerspective(o);return await r.remove(i.uuid),s}async updateDirectMessageLanguage(e){let{agentUpdateDirectMessageLanguage:r}=D(await H(this,te,"f").mutate({mutation:O`mutation agentUpdateDirectMessageLanguage($directMessageLanguage: String!) {
267
+ }`,variables:{perspective:r}})),i=n,a=new Qt(i.did,i.perspective);return a.directMessageLanguage=i.directMessageLanguage,a}async mutatePublicPerspective(e){let r=new da(Y(this,ne,"f")),n=new Yn(Y(this,ne,"f")),i=await r.add("Agent Perspective Proxy"),a=await n.me();a.perspective&&await i.loadSnapshot(a.perspective);for(let u of e.additions)await i.add(u);for(let u of e.removals)await i.remove(u);let o=await i.snapshot(),s=await this.updatePublicPerspective(o);return await r.remove(i.uuid),s}async updateDirectMessageLanguage(e){let{agentUpdateDirectMessageLanguage:r}=D(await Y(this,ne,"f").mutate({mutation:E`mutation agentUpdateDirectMessageLanguage($directMessageLanguage: String!) {
268
268
  agentUpdateDirectMessageLanguage(directMessageLanguage: $directMessageLanguage) {
269
- ${An}
269
+ ${Nn}
270
270
  }
271
- }`,variables:{directMessageLanguage:e}})),n=r,i=new Qt(n.did,n.perspective);return i.directMessageLanguage=n.directMessageLanguage,i}async addEntanglementProofs(e){let{agentAddEntanglementProofs:r}=D(await H(this,te,"f").mutate({mutation:O`mutation agentAddEntanglementProofs($proofs: [EntanglementProofInput!]!) {
271
+ }`,variables:{directMessageLanguage:e}})),n=r,i=new Qt(n.did,n.perspective);return i.directMessageLanguage=n.directMessageLanguage,i}async addEntanglementProofs(e){let{agentAddEntanglementProofs:r}=D(await Y(this,ne,"f").mutate({mutation:E`mutation agentAddEntanglementProofs($proofs: [EntanglementProofInput!]!) {
272
272
  agentAddEntanglementProofs(proofs: $proofs) {
273
- ${$i}
273
+ ${Vi}
274
274
  }
275
- }`,variables:{proofs:e}}));return r}async deleteEntanglementProofs(e){let{agentDeleteEntanglementProofs:r}=D(await H(this,te,"f").mutate({mutation:O`mutation agentDeleteEntanglementProofs($proofs: [EntanglementProofInput!]!) {
275
+ }`,variables:{proofs:e}}));return r}async deleteEntanglementProofs(e){let{agentDeleteEntanglementProofs:r}=D(await Y(this,ne,"f").mutate({mutation:E`mutation agentDeleteEntanglementProofs($proofs: [EntanglementProofInput!]!) {
276
276
  agentDeleteEntanglementProofs(proofs: $proofs) {
277
- ${$i}
277
+ ${Vi}
278
278
  }
279
- }`,variables:{proofs:e}}));return r}async getEntanglementProofs(){let{agentGetEntanglementProofs:e}=D(await H(this,te,"f").query({query:O`query agentGetEntanglementProofs {
279
+ }`,variables:{proofs:e}}));return r}async getEntanglementProofs(){let{agentGetEntanglementProofs:e}=D(await Y(this,ne,"f").query({query:E`query agentGetEntanglementProofs {
280
280
  agentGetEntanglementProofs {
281
- ${$i}
281
+ ${Vi}
282
282
  }
283
- }`}));return e}async entanglementProofPreFlight(e,r){let{agentEntanglementProofPreFlight:n}=D(await H(this,te,"f").mutate({mutation:O`mutation agentEntanglementProofPreFlight($deviceKey: String!, $deviceKeyType: String!) {
283
+ }`}));return e}async entanglementProofPreFlight(e,r){let{agentEntanglementProofPreFlight:n}=D(await Y(this,ne,"f").mutate({mutation:E`mutation agentEntanglementProofPreFlight($deviceKey: String!, $deviceKeyType: String!) {
284
284
  agentEntanglementProofPreFlight(deviceKey: $deviceKey, deviceKeyType: $deviceKeyType) {
285
- ${$i}
285
+ ${Vi}
286
286
  }
287
- }`,variables:{deviceKey:e,deviceKeyType:r}}));return n}addUpdatedListener(e){H(this,jn,"f").push(e)}addAppChangedListener(e){H(this,Mn,"f").push(e)}subscribeAgentUpdated(){H(this,te,"f").subscribe({query:O` subscription {
288
- agentUpdated { ${An} }
287
+ }`,variables:{deviceKey:e,deviceKeyType:r}}));return n}addUpdatedListener(e){Y(this,$n,"f").push(e)}addAppChangedListener(e){Y(this,jn,"f").push(e)}subscribeAgentUpdated(){Y(this,ne,"f").subscribe({query:E` subscription {
288
+ agentUpdated { ${Nn} }
289
289
  }
290
- `}).subscribe({next:e=>{let r=e.data.agentUpdated;H(this,jn,"f").forEach(n=>{n(r)})},error:e=>console.error(e)})}subscribeAppsChanged(){H(this,te,"f").subscribe({query:O` subscription {
290
+ `}).subscribe({next:e=>{let r=e.data.agentUpdated;Y(this,$n,"f").forEach(n=>{n(r)})},error:e=>console.error(e)})}subscribeAppsChanged(){Y(this,ne,"f").subscribe({query:E` subscription {
291
291
  agentAppsChanged {
292
- ${ji}
292
+ ${qi}
293
293
  }
294
294
  }
295
- `}).subscribe({next:e=>{H(this,Mn,"f").forEach(r=>{r()})},error:e=>console.error(e)})}addAgentStatusChangedListener(e){H(this,$n,"f").push(e)}subscribeAgentStatusChanged(){H(this,te,"f").subscribe({query:O` subscription {
295
+ `}).subscribe({next:e=>{Y(this,jn,"f").forEach(r=>{r()})},error:e=>console.error(e)})}addAgentStatusChangedListener(e){Y(this,Un,"f").push(e)}subscribeAgentStatusChanged(){Y(this,ne,"f").subscribe({query:E` subscription {
296
296
  agentStatusChanged { ${zr} }
297
297
  }
298
- `}).subscribe({next:e=>{let r=e.data.agentStatusChanged;H(this,$n,"f").forEach(n=>{n(r)})},error:e=>console.error(e)})}async requestCapability(e){let{agentRequestCapability:r}=D(await H(this,te,"f").mutate({mutation:O`
298
+ `}).subscribe({next:e=>{let r=e.data.agentStatusChanged;Y(this,Un,"f").forEach(n=>{n(r)})},error:e=>console.error(e)})}async requestCapability(e){let{agentRequestCapability:r}=D(await Y(this,ne,"f").mutate({mutation:E`
299
299
  mutation agentRequestCapability($authInfo: AuthInfoInput!) {
300
300
  agentRequestCapability(authInfo: $authInfo)
301
301
  }
302
- `,variables:{authInfo:e}}));return r}async permitCapability(e){let{agentPermitCapability:r}=D(await H(this,te,"f").mutate({mutation:O`
302
+ `,variables:{authInfo:e}}));return r}async permitCapability(e){let{agentPermitCapability:r}=D(await Y(this,ne,"f").mutate({mutation:E`
303
303
  mutation agentPermitCapability($auth: String!) {
304
304
  agentPermitCapability(auth: $auth)
305
305
  }
306
- `,variables:{auth:e}}));return r}async generateJwt(e,r){let{agentGenerateJwt:n}=D(await H(this,te,"f").mutate({mutation:O`
306
+ `,variables:{auth:e}}));return r}async generateJwt(e,r){let{agentGenerateJwt:n}=D(await Y(this,ne,"f").mutate({mutation:E`
307
307
  mutation agentGenerateJwt($requestId: String!, $rand: String!) {
308
308
  agentGenerateJwt(requestId: $requestId, rand: $rand)
309
309
  }
310
- `,variables:{requestId:e,rand:r}}));return n}async getApps(){let{agentGetApps:e}=D(await H(this,te,"f").mutate({mutation:O`query agentGetApps {
310
+ `,variables:{requestId:e,rand:r}}));return n}async getApps(){let{agentGetApps:e}=D(await Y(this,ne,"f").mutate({mutation:E`query agentGetApps {
311
311
  agentGetApps {
312
- ${ji}
312
+ ${qi}
313
313
  }
314
- }`}));return e}async removeApp(e){let{agentRemoveApp:r}=D(await H(this,te,"f").mutate({mutation:O`mutation agentRemoveApp($requestId: String!) {
314
+ }`}));return e}async removeApp(e){let{agentRemoveApp:r}=D(await Y(this,ne,"f").mutate({mutation:E`mutation agentRemoveApp($requestId: String!) {
315
315
  agentRemoveApp(requestId: $requestId) {
316
- ${ji}
316
+ ${qi}
317
317
  }
318
- }`,variables:{requestId:e}}));return r}async revokeToken(e){let{agentRevokeToken:r}=D(await H(this,te,"f").mutate({mutation:O`mutation agentRevokeToken($requestId: String!) {
318
+ }`,variables:{requestId:e}}));return r}async revokeToken(e){let{agentRevokeToken:r}=D(await Y(this,ne,"f").mutate({mutation:E`mutation agentRevokeToken($requestId: String!) {
319
319
  agentRevokeToken(requestId: $requestId) {
320
- ${ji}
320
+ ${qi}
321
321
  }
322
- }`,variables:{requestId:e}}));return r}async isLocked(){let{agentIsLocked:e}=D(await H(this,te,"f").mutate({mutation:O`
322
+ }`,variables:{requestId:e}}));return r}async isLocked(){let{agentIsLocked:e}=D(await Y(this,ne,"f").mutate({mutation:E`
323
323
  query agentIsLocked {
324
324
  agentIsLocked
325
325
  }
326
- `}));return e}async signMessage(e){let{agentSignMessage:r}=D(await H(this,te,"f").mutate({mutation:O`mutation agentSignMessage($message: String!) {
326
+ `}));return e}async signMessage(e){let{agentSignMessage:r}=D(await Y(this,ne,"f").mutate({mutation:E`mutation agentSignMessage($message: String!) {
327
327
  agentSignMessage(message: $message) {
328
- ${qp}
328
+ ${Qp}
329
329
  }
330
- }`,variables:{message:e}}));return r}};te=new WeakMap,Mn=new WeakMap,jn=new WeakMap,$n=new WeakMap;var Vp=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Bt=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},ut,yu=`
330
+ }`,variables:{message:e}}));return r}};ne=new WeakMap,jn=new WeakMap,$n=new WeakMap,Un=new WeakMap;var Gp=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Bt=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},ut,bu=`
331
331
  name
332
332
  address
333
333
  settings
334
334
  icon { code }
335
335
  constructorIcon { code }
336
336
  settingsIcon { code }
337
- `,vu=`
337
+ `,Su=`
338
338
  name
339
339
  address
340
340
  description
@@ -344,45 +344,45 @@ neighbourhood {
344
344
  templateAppliedParams
345
345
  possibleTemplateParams
346
346
  sourceCodeLink
347
- `,Ko=class{constructor(e){ut.set(this,void 0),Vp(this,ut,e,"f")}async byAddress(e){let{language:r}=D(await Bt(this,ut,"f").query({query:O`query byAddress($address: String!) {
347
+ `,Jo=class{constructor(e){ut.set(this,void 0),Gp(this,ut,e,"f")}async byAddress(e){let{language:r}=D(await Bt(this,ut,"f").query({query:E`query byAddress($address: String!) {
348
348
  language(address: $address) {
349
- ${yu}
349
+ ${bu}
350
350
  }
351
- }`,variables:{address:e}}));return r}async byFilter(e){let{languages:r}=D(await Bt(this,ut,"f").query({query:O`query byFilter($filter: String!) {
351
+ }`,variables:{address:e}}));return r}async byFilter(e){let{languages:r}=D(await Bt(this,ut,"f").query({query:E`query byFilter($filter: String!) {
352
352
  languages(filter: $filter) {
353
- ${yu}
353
+ ${bu}
354
354
  }
355
- }`,variables:{filter:e}}));return r}async all(){return this.byFilter("")}async writeSettings(e,r){let{languageWriteSettings:n}=D(await Bt(this,ut,"f").mutate({mutation:O`mutation writeSettings($languageAddress: String!, $settings: String!) {
355
+ }`,variables:{filter:e}}));return r}async all(){return this.byFilter("")}async writeSettings(e,r){let{languageWriteSettings:n}=D(await Bt(this,ut,"f").mutate({mutation:E`mutation writeSettings($languageAddress: String!, $settings: String!) {
356
356
  languageWriteSettings(languageAddress: $languageAddress, settings: $settings)
357
- }`,variables:{languageAddress:e,settings:r}}));return n}async applyTemplateAndPublish(e,r){let{languageApplyTemplateAndPublish:n}=D(await Bt(this,ut,"f").mutate({mutation:O`mutation languageApplyTemplateAndPublish(
357
+ }`,variables:{languageAddress:e,settings:r}}));return n}async applyTemplateAndPublish(e,r){let{languageApplyTemplateAndPublish:n}=D(await Bt(this,ut,"f").mutate({mutation:E`mutation languageApplyTemplateAndPublish(
358
358
  $sourceLanguageHash: String!,
359
359
  $templateData: String!,
360
360
  ) {
361
361
  languageApplyTemplateAndPublish(sourceLanguageHash: $sourceLanguageHash, templateData: $templateData) {
362
362
  name, address
363
363
  }
364
- }`,variables:{sourceLanguageHash:e,templateData:r}}));return n}async publish(e,r){let{languagePublish:n}=D(await Bt(this,ut,"f").mutate({mutation:O`mutation languagePublish(
364
+ }`,variables:{sourceLanguageHash:e,templateData:r}}));return n}async publish(e,r){let{languagePublish:n}=D(await Bt(this,ut,"f").mutate({mutation:E`mutation languagePublish(
365
365
  $languagePath: String!,
366
366
  $languageMeta: LanguageMetaInput!,
367
367
  ) {
368
368
  languagePublish(languagePath: $languagePath, languageMeta: $languageMeta) {
369
- ${vu}
369
+ ${Su}
370
370
  }
371
- }`,variables:{languagePath:e,languageMeta:r}}));return n}async meta(e){let{languageMeta:r}=D(await Bt(this,ut,"f").query({query:O`query languageMeta(
371
+ }`,variables:{languagePath:e,languageMeta:r}}));return n}async meta(e){let{languageMeta:r}=D(await Bt(this,ut,"f").query({query:E`query languageMeta(
372
372
  $address: String!,
373
373
  ) {
374
374
  languageMeta(address: $address) {
375
- ${vu}
375
+ ${Su}
376
376
  }
377
- }`,variables:{address:e}}));return r}async source(e){let{languageSource:r}=D(await Bt(this,ut,"f").query({query:O`query languageSource(
377
+ }`,variables:{address:e}}));return r}async source(e){let{languageSource:r}=D(await Bt(this,ut,"f").query({query:E`query languageSource(
378
378
  $address: String!,
379
379
  ) {
380
380
  languageSource(address: $address)
381
- }`,variables:{address:e}}));return r}async remove(e){let{languageRemove:r}=D(await Bt(this,ut,"f").mutate({mutation:O`mutation languageRemove(
381
+ }`,variables:{address:e}}));return r}async remove(e){let{languageRemove:r}=D(await Bt(this,ut,"f").mutate({mutation:E`mutation languageRemove(
382
382
  $address: String!,
383
383
  ) {
384
384
  languageRemove(address: $address)
385
- }`,variables:{address:e}}));return r}};ut=new WeakMap;var Bp=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},De=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Fe,vr,zo=class{constructor(e){Fe.set(this,void 0),vr.set(this,new Map),Bp(this,Fe,e,"f")}async publishFromPerspective(e,r,n){let{neighbourhoodPublishFromPerspective:i}=D(await De(this,Fe,"f").mutate({mutation:O`mutation neighbourhoodPublishFromPerspective(
385
+ }`,variables:{address:e}}));return r}};ut=new WeakMap;var Wp=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},De=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Me,gr,Ho=class{constructor(e){Me.set(this,void 0),gr.set(this,new Map),Wp(this,Me,e,"f")}async publishFromPerspective(e,r,n){let{neighbourhoodPublishFromPerspective:i}=D(await De(this,Me,"f").mutate({mutation:E`mutation neighbourhoodPublishFromPerspective(
386
386
  $linkLanguage: String!,
387
387
  $meta: PerspectiveInput!,
388
388
  $perspectiveUUID: String!
@@ -392,7 +392,7 @@ neighbourhood {
392
392
  meta: $meta,
393
393
  perspectiveUUID: $perspectiveUUID
394
394
  )
395
- }`,variables:{perspectiveUUID:e,linkLanguage:r,meta:n}}));return i}async joinFromUrl(e){let{neighbourhoodJoinFromUrl:r}=D(await De(this,Fe,"f").mutate({mutation:O`mutation neighbourhoodJoinFromUrl($url: String!) {
395
+ }`,variables:{perspectiveUUID:e,linkLanguage:r,meta:n}}));return i}async joinFromUrl(e){let{neighbourhoodJoinFromUrl:r}=D(await De(this,Me,"f").mutate({mutation:E`mutation neighbourhoodJoinFromUrl($url: String!) {
396
396
  neighbourhoodJoinFromUrl(url: $url) {
397
397
  uuid
398
398
  name
@@ -414,11 +414,11 @@ neighbourhood {
414
414
  author
415
415
  }
416
416
  }
417
- }`,variables:{url:e}}));return r}async otherAgents(e){let{neighbourhoodOtherAgents:r}=D(await De(this,Fe,"f").query({query:O`query neighbourhoodOtherAgents($perspectiveUUID: String!) {
417
+ }`,variables:{url:e}}));return r}async otherAgents(e){let{neighbourhoodOtherAgents:r}=D(await De(this,Me,"f").query({query:E`query neighbourhoodOtherAgents($perspectiveUUID: String!) {
418
418
  neighbourhoodOtherAgents(perspectiveUUID: $perspectiveUUID)
419
- }`,variables:{perspectiveUUID:e}}));return r}async hasTelepresenceAdapter(e){let{neighbourhoodHasTelepresenceAdapter:r}=D(await De(this,Fe,"f").query({query:O`query neighbourhoodHasTelepresenceAdapter($perspectiveUUID: String!) {
419
+ }`,variables:{perspectiveUUID:e}}));return r}async hasTelepresenceAdapter(e){let{neighbourhoodHasTelepresenceAdapter:r}=D(await De(this,Me,"f").query({query:E`query neighbourhoodHasTelepresenceAdapter($perspectiveUUID: String!) {
420
420
  neighbourhoodHasTelepresenceAdapter(perspectiveUUID: $perspectiveUUID)
421
- }`,variables:{perspectiveUUID:e}}));return r}async onlineAgents(e){let{neighbourhoodOnlineAgents:r}=D(await De(this,Fe,"f").query({query:O`query neighbourhoodOnlineAgents($perspectiveUUID: String!) {
421
+ }`,variables:{perspectiveUUID:e}}));return r}async onlineAgents(e){let{neighbourhoodOnlineAgents:r}=D(await De(this,Me,"f").query({query:E`query neighbourhoodOnlineAgents($perspectiveUUID: String!) {
422
422
  neighbourhoodOnlineAgents(perspectiveUUID: $perspectiveUUID) {
423
423
  did
424
424
  status {
@@ -435,7 +435,7 @@ neighbourhood {
435
435
  proof { valid, invalid, signature, key }
436
436
  }
437
437
  }
438
- }`,variables:{perspectiveUUID:e}}));return r}async setOnlineStatus(e,r){let{neighbourhoodSetOnlineStatus:n}=D(await De(this,Fe,"f").mutate({mutation:O`mutation neighbourhoodSetOnlineStatus(
438
+ }`,variables:{perspectiveUUID:e}}));return r}async setOnlineStatus(e,r){let{neighbourhoodSetOnlineStatus:n}=D(await De(this,Me,"f").mutate({mutation:E`mutation neighbourhoodSetOnlineStatus(
439
439
  $perspectiveUUID: String!,
440
440
  $status: PerspectiveInput!
441
441
  ) {
@@ -443,7 +443,7 @@ neighbourhood {
443
443
  perspectiveUUID: $perspectiveUUID,
444
444
  status: $status
445
445
  )
446
- }`,variables:{perspectiveUUID:e,status:r}}));return n}async setOnlineStatusU(e,r){let{neighbourhoodSetOnlineStatusU:n}=D(await De(this,Fe,"f").mutate({mutation:O`mutation neighbourhoodSetOnlineStatusU(
446
+ }`,variables:{perspectiveUUID:e,status:r}}));return n}async setOnlineStatusU(e,r){let{neighbourhoodSetOnlineStatusU:n}=D(await De(this,Me,"f").mutate({mutation:E`mutation neighbourhoodSetOnlineStatusU(
447
447
  $perspectiveUUID: String!,
448
448
  $status: PerspectiveUnsignedInput!
449
449
  ) {
@@ -451,7 +451,7 @@ neighbourhood {
451
451
  perspectiveUUID: $perspectiveUUID,
452
452
  status: $status
453
453
  )
454
- }`,variables:{perspectiveUUID:e,status:r}}));return n}async sendSignal(e,r,n){let{neighbourhoodSendSignal:i}=D(await De(this,Fe,"f").mutate({mutation:O`mutation neighbourhoodSendSignal(
454
+ }`,variables:{perspectiveUUID:e,status:r}}));return n}async sendSignal(e,r,n){let{neighbourhoodSendSignal:i}=D(await De(this,Me,"f").mutate({mutation:E`mutation neighbourhoodSendSignal(
455
455
  $perspectiveUUID: String!,
456
456
  $remoteAgentDid: String!,
457
457
  $payload: PerspectiveInput!
@@ -461,7 +461,7 @@ neighbourhood {
461
461
  remoteAgentDid: $remoteAgentDid,
462
462
  payload: $payload
463
463
  )
464
- }`,variables:{perspectiveUUID:e,remoteAgentDid:r,payload:n}}));return i}async sendSignalU(e,r,n){let{neighbourhoodSendSignalU:i}=D(await De(this,Fe,"f").mutate({mutation:O`mutation neighbourhoodSendSignalU(
464
+ }`,variables:{perspectiveUUID:e,remoteAgentDid:r,payload:n}}));return i}async sendSignalU(e,r,n){let{neighbourhoodSendSignalU:i}=D(await De(this,Me,"f").mutate({mutation:E`mutation neighbourhoodSendSignalU(
465
465
  $perspectiveUUID: String!,
466
466
  $remoteAgentDid: String!,
467
467
  $payload: PerspectiveUnsignedInput!
@@ -471,7 +471,7 @@ neighbourhood {
471
471
  remoteAgentDid: $remoteAgentDid,
472
472
  payload: $payload
473
473
  )
474
- }`,variables:{perspectiveUUID:e,remoteAgentDid:r,payload:n}}));return i}async sendBroadcast(e,r){let{neighbourhoodSendBroadcast:n}=D(await De(this,Fe,"f").mutate({mutation:O`mutation neighbourhoodSendBroadcast(
474
+ }`,variables:{perspectiveUUID:e,remoteAgentDid:r,payload:n}}));return i}async sendBroadcast(e,r){let{neighbourhoodSendBroadcast:n}=D(await De(this,Me,"f").mutate({mutation:E`mutation neighbourhoodSendBroadcast(
475
475
  $perspectiveUUID: String!,
476
476
  $payload: PerspectiveInput!
477
477
  ) {
@@ -479,7 +479,7 @@ neighbourhood {
479
479
  perspectiveUUID: $perspectiveUUID,
480
480
  payload: $payload
481
481
  )
482
- }`,variables:{perspectiveUUID:e,payload:r}}));return n}async sendBroadcastU(e,r){let{neighbourhoodSendBroadcastU:n}=D(await De(this,Fe,"f").mutate({mutation:O`mutation neighbourhoodSendBroadcastU(
482
+ }`,variables:{perspectiveUUID:e,payload:r}}));return n}async sendBroadcastU(e,r){let{neighbourhoodSendBroadcastU:n}=D(await De(this,Me,"f").mutate({mutation:E`mutation neighbourhoodSendBroadcastU(
483
483
  $perspectiveUUID: String!,
484
484
  $payload: PerspectiveUnsignedInput!
485
485
  ) {
@@ -487,7 +487,7 @@ neighbourhood {
487
487
  perspectiveUUID: $perspectiveUUID,
488
488
  payload: $payload
489
489
  )
490
- }`,variables:{perspectiveUUID:e,payload:r}}));return n}dispatchSignal(e,r){let n=De(this,vr,"f").get(e);n&&n.forEach(i=>i(r))}async subscribeToSignals(e){let r=this;await De(this,Fe,"f").subscribe({query:O`subscription neighbourhoodSignal($perspectiveUUID: String!) {
490
+ }`,variables:{perspectiveUUID:e,payload:r}}));return n}dispatchSignal(e,r){let n=De(this,gr,"f").get(e);n&&n.forEach(i=>i(r))}async subscribeToSignals(e){let r=this;await De(this,Me,"f").subscribe({query:E`subscription neighbourhoodSignal($perspectiveUUID: String!) {
491
491
  neighbourhoodSignal(perspectiveUUID: $perspectiveUUID) {
492
492
  author
493
493
  timestamp
@@ -502,7 +502,7 @@ neighbourhood {
502
502
  }
503
503
  proof { valid, invalid, signature, key }
504
504
  }
505
- }`,variables:{perspectiveUUID:e}}).subscribe({next:n=>{let{neighbourhoodSignal:i}=D(n);r.dispatchSignal(e,i)}})}async addSignalHandler(e,r){let n=De(this,vr,"f").get(e);n||(n=[],await this.subscribeToSignals(e)),n.push(r),De(this,vr,"f").set(e,n)}removeSignalHandler(e,r){let n=De(this,vr,"f").get(e);if(n){let i=n.indexOf(r);i>-1&&n.splice(i,1)}De(this,vr,"f").set(e,n)}};Fe=new WeakMap,vr=new WeakMap;var Fo=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},ae=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},se,Un,qn,Ui=`
505
+ }`,variables:{perspectiveUUID:e}}).subscribe({next:n=>{let{neighbourhoodSignal:i}=D(n);r.dispatchSignal(e,i)}})}async addSignalHandler(e,r){let n=De(this,gr,"f").get(e);n||(n=[],await this.subscribeToSignals(e)),n.push(r),De(this,gr,"f").set(e,n)}removeSignalHandler(e,r){let n=De(this,gr,"f").get(e);if(n){let i=n.indexOf(r);i>-1&&n.splice(i,1)}De(this,gr,"f").set(e,n)}};Me=new WeakMap,gr=new WeakMap;var An=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Q=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},X,qn,Vn,Bn,Qn,Bi=`
506
506
  author
507
507
  timestamp
508
508
  data {
@@ -514,64 +514,97 @@ data {
514
514
  }
515
515
  }
516
516
  proof { valid, invalid, signature, key }
517
- `,Jo=class{constructor(e,r=!0){se.set(this,void 0),Un.set(this,void 0),qn.set(this,void 0),Fo(this,se,e,"f"),Fo(this,Un,[],"f"),Fo(this,qn,[],"f"),r&&(this.subscribeMessageReceived(),this.subscribeExceptionOccurred())}async info(){let{runtimeInfo:e}=D(await ae(this,se,"f").query({query:O`query runtimeInfo {
517
+ `,Kp=`
518
+ description
519
+ appName
520
+ appUrl
521
+ appIconPath
522
+ trigger
523
+ perspectiveIds
524
+ webhookUrl
525
+ webhookAuth
526
+ `,Yo=`
527
+ id
528
+ granted
529
+ ${Kp}
530
+ `,zp=`
531
+ notification { ${Yo} }
532
+ perspectiveId
533
+ triggerMatch
534
+ `,Xo=class{constructor(e,r=!0){X.set(this,void 0),qn.set(this,void 0),Vn.set(this,void 0),Bn.set(this,void 0),Qn.set(this,void 0),An(this,X,e,"f"),An(this,qn,[],"f"),An(this,Vn,[],"f"),An(this,Bn,[],"f"),An(this,Qn,[],"f"),r&&(this.subscribeMessageReceived(),this.subscribeExceptionOccurred(),this.subscribeNotificationTriggered(),this.subscribeNotificationRequested())}async info(){let{runtimeInfo:e}=D(await Q(this,X,"f").query({query:E`query runtimeInfo {
518
535
  runtimeInfo {
519
536
  ad4mExecutorVersion,
520
537
  isInitialized,
521
538
  isUnlocked
522
539
  }
523
- }`}));return e}async quit(){return D(await ae(this,se,"f").mutate({mutation:O`mutation runtimeQuit { runtimeQuit }`})).runtimeQuit}async openLink(e){let{runtimeOpenLink:r}=D(await ae(this,se,"f").mutate({mutation:O`mutation runtimeOpenLink($url: String!) {
540
+ }`}));return e}async quit(){return D(await Q(this,X,"f").mutate({mutation:E`mutation runtimeQuit { runtimeQuit }`})).runtimeQuit}async openLink(e){let{runtimeOpenLink:r}=D(await Q(this,X,"f").mutate({mutation:E`mutation runtimeOpenLink($url: String!) {
524
541
  runtimeOpenLink(url: $url)
525
- }`,variables:{url:e}}));return r}async addTrustedAgents(e){let{addTrustedAgents:r}=D(await ae(this,se,"f").mutate({mutation:O`mutation addTrustedAgents($agents: [String!]!) {
542
+ }`,variables:{url:e}}));return r}async addTrustedAgents(e){let{addTrustedAgents:r}=D(await Q(this,X,"f").mutate({mutation:E`mutation addTrustedAgents($agents: [String!]!) {
526
543
  addTrustedAgents(agents: $agents)
527
- }`,variables:{agents:e}}));return r}async deleteTrustedAgents(e){let{deleteTrustedAgents:r}=D(await ae(this,se,"f").mutate({mutation:O`mutation deleteTrustedAgents($agents: [String!]!) {
544
+ }`,variables:{agents:e}}));return r}async deleteTrustedAgents(e){let{deleteTrustedAgents:r}=D(await Q(this,X,"f").mutate({mutation:E`mutation deleteTrustedAgents($agents: [String!]!) {
528
545
  deleteTrustedAgents(agents: $agents)
529
- }`,variables:{agents:e}}));return r}async getTrustedAgents(){let{getTrustedAgents:e}=D(await ae(this,se,"f").query({query:O`query getTrustedAgents {
546
+ }`,variables:{agents:e}}));return r}async getTrustedAgents(){let{getTrustedAgents:e}=D(await Q(this,X,"f").query({query:E`query getTrustedAgents {
530
547
  getTrustedAgents
531
- }`}));return e}async addKnownLinkLanguageTemplates(e){let{runtimeAddKnownLinkLanguageTemplates:r}=D(await ae(this,se,"f").mutate({mutation:O`mutation runtimeAddKnownLinkLanguageTemplates($addresses: [String!]!) {
548
+ }`}));return e}async addKnownLinkLanguageTemplates(e){let{runtimeAddKnownLinkLanguageTemplates:r}=D(await Q(this,X,"f").mutate({mutation:E`mutation runtimeAddKnownLinkLanguageTemplates($addresses: [String!]!) {
532
549
  runtimeAddKnownLinkLanguageTemplates(addresses: $addresses)
533
- }`,variables:{addresses:e}}));return r}async removeKnownLinkLanguageTemplates(e){let{runtimeRemoveKnownLinkLanguageTemplates:r}=D(await ae(this,se,"f").mutate({mutation:O`mutation runtimeRemoveKnownLinkLanguageTemplates($addresses: [String!]!) {
550
+ }`,variables:{addresses:e}}));return r}async removeKnownLinkLanguageTemplates(e){let{runtimeRemoveKnownLinkLanguageTemplates:r}=D(await Q(this,X,"f").mutate({mutation:E`mutation runtimeRemoveKnownLinkLanguageTemplates($addresses: [String!]!) {
534
551
  runtimeRemoveKnownLinkLanguageTemplates(addresses: $addresses)
535
- }`,variables:{addresses:e}}));return r}async knownLinkLanguageTemplates(){let{runtimeKnownLinkLanguageTemplates:e}=D(await ae(this,se,"f").query({query:O`query runtimeKnownLinkLanguageTemplates {
552
+ }`,variables:{addresses:e}}));return r}async knownLinkLanguageTemplates(){let{runtimeKnownLinkLanguageTemplates:e}=D(await Q(this,X,"f").query({query:E`query runtimeKnownLinkLanguageTemplates {
536
553
  runtimeKnownLinkLanguageTemplates
537
- }`}));return e}async addFriends(e){let{runtimeAddFriends:r}=D(await ae(this,se,"f").mutate({mutation:O`mutation runtimeAddFriends($dids: [String!]!) {
554
+ }`}));return e}async addFriends(e){let{runtimeAddFriends:r}=D(await Q(this,X,"f").mutate({mutation:E`mutation runtimeAddFriends($dids: [String!]!) {
538
555
  runtimeAddFriends(dids: $dids)
539
- }`,variables:{dids:e}}));return r}async removeFriends(e){let{runtimeRemoveFriends:r}=D(await ae(this,se,"f").mutate({mutation:O`mutation runtimeRemoveFriends($dids: [String!]!) {
556
+ }`,variables:{dids:e}}));return r}async removeFriends(e){let{runtimeRemoveFriends:r}=D(await Q(this,X,"f").mutate({mutation:E`mutation runtimeRemoveFriends($dids: [String!]!) {
540
557
  runtimeRemoveFriends(dids: $dids)
541
- }`,variables:{dids:e}}));return r}async friends(){let{runtimeFriends:e}=D(await ae(this,se,"f").query({query:O`query runtimeFriends {
558
+ }`,variables:{dids:e}}));return r}async friends(){let{runtimeFriends:e}=D(await Q(this,X,"f").query({query:E`query runtimeFriends {
542
559
  runtimeFriends
543
- }`}));return e}async hcAgentInfos(){let{runtimeHcAgentInfos:e}=D(await ae(this,se,"f").query({query:O`query runtimeHcAgentInfos {
560
+ }`}));return e}async hcAgentInfos(){let{runtimeHcAgentInfos:e}=D(await Q(this,X,"f").query({query:E`query runtimeHcAgentInfos {
544
561
  runtimeHcAgentInfos
545
- }`}));return e}async hcAddAgentInfos(e){let{runtimeHcAddAgentInfos:r}=D(await ae(this,se,"f").mutate({mutation:O`mutation runtimeHcAddAgentInfos($agentInfos: String!) {
562
+ }`}));return e}async hcAddAgentInfos(e){let{runtimeHcAddAgentInfos:r}=D(await Q(this,X,"f").mutate({mutation:E`mutation runtimeHcAddAgentInfos($agentInfos: String!) {
546
563
  runtimeHcAddAgentInfos(agentInfos: $agentInfos)
547
- }`,variables:{agentInfos:e}}));return r}async verifyStringSignedByDid(e,r,n,i){let{runtimeVerifyStringSignedByDid:a}=D(await ae(this,se,"f").mutate({mutation:O`query runtimeVerifyStringSignedByDid($did: String!, $didSigningKeyId: String!, $data: String!, $signedData: String!) {
564
+ }`,variables:{agentInfos:e}}));return r}async verifyStringSignedByDid(e,r,n,i){let{runtimeVerifyStringSignedByDid:a}=D(await Q(this,X,"f").mutate({mutation:E`query runtimeVerifyStringSignedByDid($did: String!, $didSigningKeyId: String!, $data: String!, $signedData: String!) {
548
565
  runtimeVerifyStringSignedByDid(did: $did, didSigningKeyId: $didSigningKeyId, data: $data, signedData: $signedData)
549
- }`,variables:{did:e,didSigningKeyId:r,data:n,signedData:i}}));return a}async setStatus(e){let{runtimeSetStatus:r}=D(await ae(this,se,"f").mutate({mutation:O`mutation runtimeSetStatus($status: PerspectiveInput!) {
566
+ }`,variables:{did:e,didSigningKeyId:r,data:n,signedData:i}}));return a}async setStatus(e){let{runtimeSetStatus:r}=D(await Q(this,X,"f").mutate({mutation:E`mutation runtimeSetStatus($status: PerspectiveInput!) {
550
567
  runtimeSetStatus(status: $status)
551
- }`,variables:{status:e}}));return r}async friendStatus(e){let{runtimeFriendStatus:r}=D(await ae(this,se,"f").query({query:O`query runtimeFriendStatus($did: String!) {
552
- runtimeFriendStatus(did: $did) { ${Ui} }
553
- }`,variables:{did:e}}));return r}async friendSendMessage(e,r){let{runtimeFriendSendMessage:n}=D(await ae(this,se,"f").mutate({mutation:O`mutation runtimeFriendSendMessage($did: String!, $message: PerspectiveInput!) {
568
+ }`,variables:{status:e}}));return r}async friendStatus(e){let{runtimeFriendStatus:r}=D(await Q(this,X,"f").query({query:E`query runtimeFriendStatus($did: String!) {
569
+ runtimeFriendStatus(did: $did) { ${Bi} }
570
+ }`,variables:{did:e}}));return r}async friendSendMessage(e,r){let{runtimeFriendSendMessage:n}=D(await Q(this,X,"f").mutate({mutation:E`mutation runtimeFriendSendMessage($did: String!, $message: PerspectiveInput!) {
554
571
  runtimeFriendSendMessage(did: $did, message: $message)
555
- }`,variables:{did:e,message:r}}));return n}async messageInbox(e){let{runtimeMessageInbox:r}=D(await ae(this,se,"f").query({query:O`query runtimeMessageInbox($filter: String) {
556
- runtimeMessageInbox(filter: $filter) { ${Ui} }
557
- }`,variables:{filter:e}}));return r}async messageOutbox(e){let{runtimeMessageOutbox:r}=D(await ae(this,se,"f").query({query:O`query runtimeMessageOutbox($filter: String) {
572
+ }`,variables:{did:e,message:r}}));return n}async messageInbox(e){let{runtimeMessageInbox:r}=D(await Q(this,X,"f").query({query:E`query runtimeMessageInbox($filter: String) {
573
+ runtimeMessageInbox(filter: $filter) { ${Bi} }
574
+ }`,variables:{filter:e}}));return r}async messageOutbox(e){let{runtimeMessageOutbox:r}=D(await Q(this,X,"f").query({query:E`query runtimeMessageOutbox($filter: String) {
558
575
  runtimeMessageOutbox(filter: $filter) {
559
576
  recipient,
560
577
  message {
561
- ${Ui}
578
+ ${Bi}
562
579
  }
563
580
  }
564
- }`,variables:{filter:e}}));return r}addMessageCallback(e){ae(this,Un,"f").push(e)}subscribeMessageReceived(){ae(this,se,"f").subscribe({query:O` subscription {
565
- runtimeMessageReceived { ${Ui} }
581
+ }`,variables:{filter:e}}));return r}async requestInstallNotification(e){let{runtimeRequestInstallNotification:r}=D(await Q(this,X,"f").mutate({mutation:E`mutation runtimeRequestInstallNotification($notification: NotificationInput!) {
582
+ runtimeRequestInstallNotification(notification: $notification)
583
+ }`,variables:{notification:e}}));return r}async grantNotification(e){let{runtimeGrantNotification:r}=D(await Q(this,X,"f").mutate({mutation:E`mutation runtimeGrantNotification($id: String!) {
584
+ runtimeGrantNotification(id: $id)
585
+ }`,variables:{id:e}}));return r}async notifications(){let{runtimeNotifications:e}=D(await Q(this,X,"f").query({query:E`query runtimeNotifications {
586
+ runtimeNotifications { ${Yo} }
587
+ }`}));return e}async updateNotification(e,r){let{runtimeUpdateNotification:n}=D(await Q(this,X,"f").mutate({mutation:E`mutation runtimeUpdateNotification($id: String!, $notification: NotificationInput!) {
588
+ runtimeUpdateNotification(id: $id, notification: $notification)
589
+ }`,variables:{id:e,notification:r}}));return n}async removeNotification(e){let{runtimeRemoveNotification:r}=D(await Q(this,X,"f").mutate({mutation:E`mutation runtimeRemoveNotification($id: String!) {
590
+ runtimeRemoveNotification(id: $id)
591
+ }`,variables:{id:e}}));return r}addNotificationTriggeredCallback(e){Q(this,Bn,"f").push(e)}addNotificationRequestedCallback(e){Q(this,Qn,"f").push(e)}subscribeNotificationTriggered(){Q(this,X,"f").subscribe({query:E` subscription {
592
+ runtimeNotificationTriggered { ${zp} }
566
593
  }
567
- `}).subscribe({next:e=>{ae(this,Un,"f").forEach(r=>{r(e.data.runtimeMessageReceived)})},error:e=>console.error(e)})}addExceptionCallback(e){ae(this,qn,"f").push(e)}subscribeExceptionOccurred(){ae(this,se,"f").subscribe({query:O` subscription {
594
+ `}).subscribe({next:e=>{Q(this,Bn,"f").forEach(r=>{r(e.data.runtimeNotificationTriggered)})},error:e=>console.error(e)})}subscribeNotificationRequested(){Q(this,X,"f").subscribe({query:E` subscription {
595
+ runtimeNotificationRequested { ${Yo} }
596
+ }
597
+ `}).subscribe({next:e=>{Q(this,Qn,"f").forEach(r=>{r(e.data.runtimeNotificationRequested)})},error:e=>console.error(e)})}addMessageCallback(e){Q(this,qn,"f").push(e)}subscribeMessageReceived(){Q(this,X,"f").subscribe({query:E` subscription {
598
+ runtimeMessageReceived { ${Bi} }
599
+ }
600
+ `}).subscribe({next:e=>{Q(this,qn,"f").forEach(r=>{r(e.data.runtimeMessageReceived)})},error:e=>console.error(e)})}addExceptionCallback(e){Q(this,Vn,"f").push(e)}subscribeExceptionOccurred(){Q(this,X,"f").subscribe({query:E` subscription {
568
601
  exceptionOccurred {
569
602
  title
570
603
  message
571
604
  type
572
605
  addon
573
606
  }
574
- }`}).subscribe({next:e=>{ae(this,qn,"f").forEach(r=>{r(e.data.exceptionOccurred)})},error:e=>console.error(e)})}};se=new WeakMap,Un=new WeakMap,qn=new WeakMap;var Qp=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Jr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Dt,Ho=class{constructor(e){Dt.set(this,void 0),Qp(this,Dt,e,"f")}async get(e){let{expression:r}=D(await Jr(this,Dt,"f").query({query:O`query expression($url: String!) {
607
+ }`}).subscribe({next:e=>{Q(this,Vn,"f").forEach(r=>{r(e.data.exceptionOccurred)})},error:e=>console.error(e)})}};X=new WeakMap,qn=new WeakMap,Vn=new WeakMap,Bn=new WeakMap,Qn=new WeakMap;var Jp=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Jr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Dt,Zo=class{constructor(e){Dt.set(this,void 0),Jp(this,Dt,e,"f")}async get(e){let{expression:r}=D(await Jr(this,Dt,"f").query({query:E`query expression($url: String!) {
575
608
  expression(url: $url) {
576
609
  author
577
610
  timestamp
@@ -584,7 +617,7 @@ proof { valid, invalid, signature, key }
584
617
  invalid
585
618
  }
586
619
  }
587
- }`,variables:{url:e}}));return r}async getMany(e){let{expressionMany:r}=D(await Jr(this,Dt,"f").query({query:O`query expressionMany($urls: [String!]!) {
620
+ }`,variables:{url:e}}));return r}async getMany(e){let{expressionMany:r}=D(await Jr(this,Dt,"f").query({query:E`query expressionMany($urls: [String!]!) {
588
621
  expressionMany(urls: $urls) {
589
622
  author
590
623
  timestamp
@@ -597,33 +630,33 @@ proof { valid, invalid, signature, key }
597
630
  invalid
598
631
  }
599
632
  }
600
- }`,variables:{urls:e}}));return r}async getRaw(e){let{expressionRaw:r}=D(await Jr(this,Dt,"f").query({query:O`query expressionRaw($url: String!) {
633
+ }`,variables:{urls:e}}));return r}async getRaw(e){let{expressionRaw:r}=D(await Jr(this,Dt,"f").query({query:E`query expressionRaw($url: String!) {
601
634
  expressionRaw(url: $url)
602
- }`,variables:{url:e}}));return r}async create(e,r){e=JSON.stringify(e);let{expressionCreate:n}=D(await Jr(this,Dt,"f").mutate({mutation:O`mutation expressionCreate($content: String!, $languageAddress: String!){
635
+ }`,variables:{url:e}}));return r}async create(e,r){e=JSON.stringify(e);let{expressionCreate:n}=D(await Jr(this,Dt,"f").mutate({mutation:E`mutation expressionCreate($content: String!, $languageAddress: String!){
603
636
  expressionCreate(content: $content, languageAddress: $languageAddress)
604
- }`,variables:{content:e,languageAddress:r}}));return n}async interactions(e){let{expressionInteractions:r}=D(await Jr(this,Dt,"f").query({query:O`query expressionInteractions($url: String!) {
637
+ }`,variables:{content:e,languageAddress:r}}));return n}async interactions(e){let{expressionInteractions:r}=D(await Jr(this,Dt,"f").query({query:E`query expressionInteractions($url: String!) {
605
638
  expressionInteractions(url: $url) {
606
639
  label
607
640
  name
608
641
  parameters { name, type }
609
642
  }
610
- }`,variables:{url:e}}));return r}async interact(e,r){let{expressionInteract:n}=D(await Jr(this,Dt,"f").mutate({mutation:O`mutation expressionInteract($url: String!, $interactionCall: InteractionCall!){
643
+ }`,variables:{url:e}}));return r}async interact(e,r){let{expressionInteract:n}=D(await Jr(this,Dt,"f").mutate({mutation:E`mutation expressionInteract($url: String!, $interactionCall: InteractionCall!){
611
644
  expressionInteract(url: $url, interactionCall: $interactionCall)
612
- }`,variables:{url:e,interactionCall:r}}));return n}};Dt=new WeakMap;var fr=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Pe=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},kt,Hi,Vn,Yi,Bn,Yr,Xi,fa=class{constructor(e,r=!0){kt.set(this,void 0),Hi.set(this,void 0),Vn.set(this,void 0),Yi.set(this,void 0),Bn.set(this,void 0),Yr.set(this,void 0),Xi.set(this,void 0),fr(this,kt,e,"f"),fr(this,Hi,new zn(Pe(this,kt,"f"),r),"f"),fr(this,Vn,new Ho(Pe(this,kt,"f")),"f"),fr(this,Yi,new Ko(Pe(this,kt,"f")),"f"),fr(this,Bn,new zo(Pe(this,kt,"f")),"f"),fr(this,Yr,new la(Pe(this,kt,"f"),r),"f"),Pe(this,Yr,"f").setExpressionClient(Pe(this,Vn,"f")),Pe(this,Yr,"f").setNeighbourhoodClient(Pe(this,Bn,"f")),fr(this,Xi,new Jo(Pe(this,kt,"f"),r),"f")}get agent(){return Pe(this,Hi,"f")}get expression(){return Pe(this,Vn,"f")}get languages(){return Pe(this,Yi,"f")}get neighbourhood(){return Pe(this,Bn,"f")}get perspective(){return Pe(this,Yr,"f")}get runtime(){return Pe(this,Xi,"f")}};kt=new WeakMap,Hi=new WeakMap,Vn=new WeakMap,Yi=new WeakMap,Bn=new WeakMap,Yr=new WeakMap,Xi=new WeakMap;var gu;(function(t){t.LanguageIsNotLoaded="LANGUAGE_IS_NOT_LOADED",t.ExpressionIsNotVerified="EXPRESSION_IS_NOT_VERIFIED",t.AgentIsUntrusted="AGENT_IS_UNTRUSTED",t.CapabilityRequested="CAPABILITY_REQUESTED"})(gu||(gu={}));var ns=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},is=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},br=class{constructor(e,r){this.language=e,this.expression=r}};ns([g(),is("design:type",gt)],br.prototype,"language",void 0);ns([g(),is("design:type",String)],br.prototype,"expression",void 0);br=ns([J(),is("design:paramtypes",[gt,String])],br);function iw(t){return t.language.address==="did"?t.expression.toString():`${t.language.address}://${t.expression}`}function aw(t){if(t.startsWith("literal://")){let a=new gt;a.address="literal",a.name="literal";let o=t.substring(10);return new br(a,o)}let r=/^([^:^\s]+):\/\/([\s\S]+)$/.exec(t);if(r&&r.length==3){let a=r[1],o=r[2],s=new gt;return s.address=a,new br(s,o)}let i=/^did:([^\s]+)$/.exec(t);if(i&&i.length==2){let a=new gt;return a.address="did",new br(a,t)}throw new Error("Couldn't parse string as expression URL or DID: "+t)}var Xe=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},wt=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},pa=class{};Xe([g(),wt("design:type",String)],pa.prototype,"name",void 0);Xe([g(),wt("design:type",String)],pa.prototype,"type",void 0);pa=Xe([J()],pa);var Jn=class{};Xe([g(),wt("design:type",String)],Jn.prototype,"label",void 0);Xe([g(),wt("design:type",String)],Jn.prototype,"name",void 0);Xe([g(),wt("design:type",Array)],Jn.prototype,"parameters",void 0);Jn=Xe([J()],Jn);var da=class{get parameters(){return JSON.parse(this.parametersStringified)}constructor(e,r){this.name=e,this.parametersStringified=JSON.stringify(r)}};Xe([g(),wt("design:type",String)],da.prototype,"name",void 0);Xe([g(),wt("design:type",String)],da.prototype,"parametersStringified",void 0);da=Xe([$e(),wt("design:paramtypes",[String,Object])],da);var ha=class{};Xe([g(),wt("design:type",String)],ha.prototype,"did",void 0);Xe([g(),wt("design:type",Go)],ha.prototype,"status",void 0);ha=Xe([J()],ha);var bu=class{},Dr=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},on=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Yt=class{};Dr([g(),on("design:type",String)],Yt.prototype,"name",void 0);Dr([g(),on("design:type",String)],Yt.prototype,"address",void 0);Dr([g(),on("design:type",String)],Yt.prototype,"settings",void 0);Dr([g(),on("design:type",wr)],Yt.prototype,"icon",void 0);Dr([g(),on("design:type",wr)],Yt.prototype,"constructorIcon",void 0);Dr([g(),on("design:type",wr)],Yt.prototype,"settingsIcon",void 0);Yt=Dr([J()],Yt);var Ue=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},Ke=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},lt=class{};Ue([g(),Ke("design:type",String)],lt.prototype,"name",void 0);Ue([g(),Ke("design:type",String)],lt.prototype,"address",void 0);Ue([g(),Ke("design:type",String)],lt.prototype,"description",void 0);Ue([g(),Ke("design:type",String)],lt.prototype,"author",void 0);Ue([g(),Ke("design:type",Boolean)],lt.prototype,"templated",void 0);Ue([g(),Ke("design:type",String)],lt.prototype,"templateSourceLanguageAddress",void 0);Ue([g(),Ke("design:type",String)],lt.prototype,"templateAppliedParams",void 0);Ue([g(),Ke("design:type",Array)],lt.prototype,"possibleTemplateParams",void 0);Ue([g(),Ke("design:type",String)],lt.prototype,"sourceCodeLink",void 0);lt=Ue([J()],lt);var rn=class{constructor(e,r){this.name=e,this.description=r,this.description||(this.description="")}};Ue([g(),Ke("design:type",String)],rn.prototype,"name",void 0);Ue([g(),Ke("design:type",String)],rn.prototype,"description",void 0);Ue([g(),Ke("design:type",Array)],rn.prototype,"possibleTemplateParams",void 0);Ue([g(),Ke("design:type",String)],rn.prototype,"sourceCodeLink",void 0);rn=Ue([$e(),Ke("design:paramtypes",[String,String])],rn);var Su=class{},wu=class extends Xt(){},_u=class{},ga=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},as=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},ma=class{constructor(e,r){this.linkLanguage=e,this.meta=r}};ga([g(),as("design:type",String)],ma.prototype,"linkLanguage",void 0);ga([g(),as("design:type",Kt)],ma.prototype,"meta",void 0);ma=ga([J(),as("design:paramtypes",[String,Kt])],ma);var Yo=class extends Xt(){};Yo=ga([J()],Yo);var sn=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},cn=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Xo;(function(t){t.Private="PRIVATE",t.NeighboudhoodCreationInitiated="NEIGHBOURHOOD_CREATION_INITIATED",t.NeighbourhoodJoinInitiated="NEIGHBOURHOOD_JOIN_INITIATED",t.LinkLanguageFailedToInstall="LINK_LANGUAGE_FAILED_TO_INSTALL",t.LinkLanguageInstalledButNotSynced="LINK_LANGUAGE_INSTALLED_BUT_NOT_SYNCED",t.Synced="SYNCED"})(Xo||(Xo={}));var xr=class{constructor(e,r,n){this.uuid=e,this.name=r,n?this.state=n:this.state=Xo.Private}};sn([g(),cn("design:type",String)],xr.prototype,"uuid",void 0);sn([g(),cn("design:type",String)],xr.prototype,"name",void 0);sn([g(),cn("design:type",String)],xr.prototype,"state",void 0);sn([g(),cn("design:type",String)],xr.prototype,"sharedUrl",void 0);sn([g(),cn("design:type",Yo)],xr.prototype,"neighbourhood",void 0);xr=sn([J(),cn("design:paramtypes",[String,String,String])],xr);var ba=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},Vu=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},ya=class{};ba([g(),Vu("design:type",Array)],ya.prototype,"additions",void 0);ba([g(),Vu("design:type",Array)],ya.prototype,"removals",void 0);ya=ba([J()],ya);var Eu=class extends Xt(){};Eu=ba([J()],Eu);var xu=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Hr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Qn,gr,qi="smart_literal://content";function Gp(t){let e="",r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=r.length;for(let i=0;i<t;i++)e+=r.charAt(Math.floor(Math.random()*n));return e}var Hn=class{constructor(e,r){Qn.set(this,void 0),gr.set(this,void 0),xu(this,Qn,e,"f"),xu(this,gr,r,"f")}get base(){return Hr(this,gr,"f")}static async create(e,r){let n=St.from(Gp(10)).toUrl(),i=new Hn(e,n);return await i.set(r),i}static async isSmartLiteralBase(e,r){return(await e.get(new je({source:r,predicate:qi}))).length>0}static async getAllSmartLiterals(e){return(await e.get(new je({predicate:qi}))).map(n=>new Hn(e,n.data.source))}async get(){let e=await Hr(this,Qn,"f").getSingleTarget(new je({source:Hr(this,gr,"f"),predicate:qi}));if(!e)throw`No content for smart literal ${Hr(this,gr,"f")}`;return St.fromUrl(e).get()}async set(e){let r=St.from(e);await Hr(this,Qn,"f").setSingleTarget(new bt({source:Hr(this,gr,"f"),predicate:qi,target:r.toUrl()}))}};Qn=new WeakMap,gr=new WeakMap;var Ou=class{};function gw(t,e,r){return{action:"addLink",source:t,predicate:e,target:r}}function bw(t){return`triple(this, "${t}", _)`}function Sw(t){return function(e,r,n){if(typeof n.value!="function")throw new Error("InstanceQuery decorator can only be applied to methods");n.value=async function(a){let o=[],s=e.name,u=`subject_class("${s}", C), instance(C, Instance)`;if(t&&t.where)for(let f in t.where){let d=t.where[f];u+=`, property_getter(C, Instance, "${f}", "${d}")`}t&&t.condition&&(u+=", "+t.condition);let l=await a.infer(u);if(l==!1)return o;if(typeof l=="string")throw l;for(let f of l){let d=f.Instance,h=new ua(a,d,s);await h.init(),o.push(h)}return o}}}function ww(t){return function(e,r){if(t.required&&!t.initial)throw new Error("SubjectProperty requires an 'initial' option if 'required' is true");if(!t.through&&!t.getter)throw new Error("SubjectProperty requires either 'through' or 'getter' option");if(e.__properties=e.__properties||{},e.__properties[r]=e.__properties[r]||{},e.__properties[r]={...e.__properties[r],...t},t.writable){let n=r;e[`set${Gt(n)}`]=()=>{}}Object.defineProperty(e,r,{configurable:!0,writable:!0})}}function _w(t){return function(e,r){if(!t.through&&!t.value)throw new Error("SubjectFlag requires a 'through' and 'value' option");if(!t.through)throw new Error("SubjectFlag requires a 'through' option");if(!t.value)throw new Error("SubjectFlag requires a 'value' option");e.__properties=e.__properties||{},e.__properties[r]=e.__properties[r]||{},e.__properties[r]={...e.__properties[r],through:t.through,required:!0,initial:t.value,flag:!0},e[r]=t.value,Object.defineProperty(e,r,{configurable:!0,writable:!0})}}function Ew(t){return function(e,r){e.__collections=e.__collections||{},e.__collections[r]=t;let n=r;e[`add${Gt(n)}`]=()=>{},e[`remove${Gt(n)}`]=()=>{},e[`setCollection${Gt(n)}`]=()=>{},Object.defineProperty(e,r,{configurable:!0,writable:!0})}}function Bu(t){let e="",r="abcdefghijklmnopqrstuvwxyz",n=r.length;for(let i=0;i<t;i++)e+=r.charAt(Math.floor(Math.random()*n));return e}function xw(t){return function(e){e.prototype.className=t.name,e.className=t.name,e.generateSDNA=function(){let r="",n=t.name,i=e.prototype,a=Bu(8);r+=`subject_class("${n}", ${a}).
613
- `;let o=[],s=[];i.subjectConstructor&&i.subjectConstructor.length&&(s=s.concat(i.subjectConstructor));let u=[];i.isSubjectInstance&&i.isSubjectInstance.length&&(u=u.concat(i.isSubjectInstance));let l=[],f=i.__properties||{};for(let y in f){let v=`property(${a}, "${y}").
614
- `,{through:S,initial:E,required:b,resolveLanguage:w,writable:T,flag:A,getter:N,setter:k,local:C}=f[y];if(w&&(v+=`property_resolve(${a}, "${y}").
615
- `,v+=`property_resolve_language(${a}, "${y}", "${w}").
616
- `),N?v+=`property_getter(${a}, Base, "${y}", Value) :- ${N}.
617
- `:S&&(v+=`property_getter(${a}, Base, "${y}", Value) :- triple(Base, "${S}", Value).
618
- `,b&&(A?u.push(`triple(Base, "${S}", "${E}")`):u.push(`triple(Base, "${S}", _)`))),k)v+=`property_setter(${a}, "${y}", Actions) :- ${k}.
619
- `;else if(T&&typeof i[qu(y)]=="function"){let Y=[{action:"setSingleTarget",source:"this",predicate:S,target:"value",...C&&{local:!0}}];v+=`property_setter(${a}, "${y}", '${dr(Y)}').
620
- `}l.push(v),E&&(s.push({action:"addLink",source:"this",predicate:S,target:E}),o.push({action:"removeLink",source:"this",predicate:S,target:E}))}let d=[],h=i.__collections||{};for(let y in h){let v=`collection(${a}, "${y}").
621
- `,{through:S,where:E,local:b}=h[y];if(S){if(E){if(!E.isInstance&&!E.condition)throw"'where' needs one of 'isInstance' or 'condition'";let N=[];if(E.isInstance){let C;E.isInstance.name?C=E.isInstance.name:C=E.isInstance,N.push(`instance(OtherClass, Target), subject_class("${C}", OtherClass)`)}E.condition&&N.push(E.condition);let k=N.join(", ");v+=`collection_getter(${a}, Base, "${y}", List) :- setof(Target, (triple(Base, "${S}", Target), ${k}), List).
622
- `}else v+=`collection_getter(${a}, Base, "${y}", List) :- findall(C, triple(Base, "${S}", C), List).
623
- `;let w=[{action:"addLink",source:"this",predicate:S,target:"value",...b&&{local:!0}}],T=[{action:"removeLink",source:"this",predicate:S,target:"value"}],A=[{action:"collectionSetter",source:"this",predicate:S,target:"value",...b&&{local:!0}}];v+=`collection_adder(${a}, "${At(y)}", '${dr(w)}').
624
- `,v+=`collection_remover(${a}, "${At(y)}", '${dr(T)}').
625
- `,v+=`collection_setter(${a}, "${At(y)}", '${dr(A)}').
626
- `}d.push(v)}let p=dr(s);if(r+=`constructor(${a}, '${p}').
645
+ }`,variables:{url:e,interactionCall:r}}));return n}};Dt=new WeakMap;var fr=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Pe=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},kt,Zi,Gn,ea,Wn,Yr,ta,ha=class{constructor(e,r=!0){kt.set(this,void 0),Zi.set(this,void 0),Gn.set(this,void 0),ea.set(this,void 0),Wn.set(this,void 0),Yr.set(this,void 0),ta.set(this,void 0),fr(this,kt,e,"f"),fr(this,Zi,new Yn(Pe(this,kt,"f"),r),"f"),fr(this,Gn,new Zo(Pe(this,kt,"f")),"f"),fr(this,ea,new Jo(Pe(this,kt,"f")),"f"),fr(this,Wn,new Ho(Pe(this,kt,"f")),"f"),fr(this,Yr,new da(Pe(this,kt,"f"),r),"f"),Pe(this,Yr,"f").setExpressionClient(Pe(this,Gn,"f")),Pe(this,Yr,"f").setNeighbourhoodClient(Pe(this,Wn,"f")),fr(this,ta,new Xo(Pe(this,kt,"f"),r),"f")}get agent(){return Pe(this,Zi,"f")}get expression(){return Pe(this,Gn,"f")}get languages(){return Pe(this,ea,"f")}get neighbourhood(){return Pe(this,Wn,"f")}get perspective(){return Pe(this,Yr,"f")}get runtime(){return Pe(this,ta,"f")}};kt=new WeakMap,Zi=new WeakMap,Gn=new WeakMap,ea=new WeakMap,Wn=new WeakMap,Yr=new WeakMap,ta=new WeakMap;var wu;(function(t){t.LanguageIsNotLoaded="LANGUAGE_IS_NOT_LOADED",t.ExpressionIsNotVerified="EXPRESSION_IS_NOT_VERIFIED",t.AgentIsUntrusted="AGENT_IS_UNTRUSTED",t.CapabilityRequested="CAPABILITY_REQUESTED",t.InstallNotificationRequest="INSTALL_NOTIFICATION_REQUEST"})(wu||(wu={}));var os=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},ss=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},br=class{constructor(e,r){this.language=e,this.expression=r}};os([v(),ss("design:type",vt)],br.prototype,"language",void 0);os([v(),ss("design:type",String)],br.prototype,"expression",void 0);br=os([H(),ss("design:paramtypes",[vt,String])],br);function uw(t){return t.language.address==="did"?t.expression.toString():`${t.language.address}://${t.expression}`}function lw(t){if(t.startsWith("literal://")){let a=new vt;a.address="literal",a.name="literal";let o=t.substring(10);return new br(a,o)}let r=/^([^:^\s]+):\/\/([\s\S]+)$/.exec(t);if(r&&r.length==3){let a=r[1],o=r[2],s=new vt;return s.address=a,new br(s,o)}let i=/^did:([^\s]+)$/.exec(t);if(i&&i.length==2){let a=new vt;return a.address="did",new br(a,t)}throw new Error("Couldn't parse string as expression URL or DID: "+t)}var Xe=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},wt=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},ma=class{};Xe([v(),wt("design:type",String)],ma.prototype,"name",void 0);Xe([v(),wt("design:type",String)],ma.prototype,"type",void 0);ma=Xe([H()],ma);var Xn=class{};Xe([v(),wt("design:type",String)],Xn.prototype,"label",void 0);Xe([v(),wt("design:type",String)],Xn.prototype,"name",void 0);Xe([v(),wt("design:type",Array)],Xn.prototype,"parameters",void 0);Xn=Xe([H()],Xn);var ya=class{get parameters(){return JSON.parse(this.parametersStringified)}constructor(e,r){this.name=e,this.parametersStringified=JSON.stringify(r)}};Xe([v(),wt("design:type",String)],ya.prototype,"name",void 0);Xe([v(),wt("design:type",String)],ya.prototype,"parametersStringified",void 0);ya=Xe([Ue(),wt("design:paramtypes",[String,Object])],ya);var ga=class{};Xe([v(),wt("design:type",String)],ga.prototype,"did",void 0);Xe([v(),wt("design:type",Ko)],ga.prototype,"status",void 0);ga=Xe([H()],ga);var _u=class{},Dr=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},on=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Yt=class{};Dr([v(),on("design:type",String)],Yt.prototype,"name",void 0);Dr([v(),on("design:type",String)],Yt.prototype,"address",void 0);Dr([v(),on("design:type",String)],Yt.prototype,"settings",void 0);Dr([v(),on("design:type",wr)],Yt.prototype,"icon",void 0);Dr([v(),on("design:type",wr)],Yt.prototype,"constructorIcon",void 0);Dr([v(),on("design:type",wr)],Yt.prototype,"settingsIcon",void 0);Yt=Dr([H()],Yt);var qe=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},Ke=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},lt=class{};qe([v(),Ke("design:type",String)],lt.prototype,"name",void 0);qe([v(),Ke("design:type",String)],lt.prototype,"address",void 0);qe([v(),Ke("design:type",String)],lt.prototype,"description",void 0);qe([v(),Ke("design:type",String)],lt.prototype,"author",void 0);qe([v(),Ke("design:type",Boolean)],lt.prototype,"templated",void 0);qe([v(),Ke("design:type",String)],lt.prototype,"templateSourceLanguageAddress",void 0);qe([v(),Ke("design:type",String)],lt.prototype,"templateAppliedParams",void 0);qe([v(),Ke("design:type",Array)],lt.prototype,"possibleTemplateParams",void 0);qe([v(),Ke("design:type",String)],lt.prototype,"sourceCodeLink",void 0);lt=qe([H()],lt);var rn=class{constructor(e,r){this.name=e,this.description=r,this.description||(this.description="")}};qe([v(),Ke("design:type",String)],rn.prototype,"name",void 0);qe([v(),Ke("design:type",String)],rn.prototype,"description",void 0);qe([v(),Ke("design:type",Array)],rn.prototype,"possibleTemplateParams",void 0);qe([v(),Ke("design:type",String)],rn.prototype,"sourceCodeLink",void 0);rn=qe([Ue(),Ke("design:paramtypes",[String,String])],rn);var Eu=class{},Tu=class extends Xt(){},Ou=class{},wa=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},cs=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},va=class{constructor(e,r){this.linkLanguage=e,this.meta=r}};wa([v(),cs("design:type",String)],va.prototype,"linkLanguage",void 0);wa([v(),cs("design:type",Kt)],va.prototype,"meta",void 0);va=wa([H(),cs("design:paramtypes",[String,Kt])],va);var es=class extends Xt(){};es=wa([H()],es);var sn=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},cn=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},ts;(function(t){t.Private="PRIVATE",t.NeighboudhoodCreationInitiated="NEIGHBOURHOOD_CREATION_INITIATED",t.NeighbourhoodJoinInitiated="NEIGHBOURHOOD_JOIN_INITIATED",t.LinkLanguageFailedToInstall="LINK_LANGUAGE_FAILED_TO_INSTALL",t.LinkLanguageInstalledButNotSynced="LINK_LANGUAGE_INSTALLED_BUT_NOT_SYNCED",t.Synced="SYNCED"})(ts||(ts={}));var Tr=class{constructor(e,r,n){this.uuid=e,this.name=r,n?this.state=n:this.state=ts.Private}};sn([v(),cn("design:type",String)],Tr.prototype,"uuid",void 0);sn([v(),cn("design:type",String)],Tr.prototype,"name",void 0);sn([v(),cn("design:type",String)],Tr.prototype,"state",void 0);sn([v(),cn("design:type",String)],Tr.prototype,"sharedUrl",void 0);sn([v(),cn("design:type",es)],Tr.prototype,"neighbourhood",void 0);Tr=sn([H(),cn("design:paramtypes",[String,String,String])],Tr);var _a=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},Gu=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},ba=class{};_a([v(),Gu("design:type",Array)],ba.prototype,"additions",void 0);_a([v(),Gu("design:type",Array)],ba.prototype,"removals",void 0);ba=_a([H()],ba);var xu=class extends Xt(){};xu=_a([H()],xu);var Iu=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Hr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Kn,vr,Qi="smart_literal://content";function Hp(t){let e="",r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=r.length;for(let i=0;i<t;i++)e+=r.charAt(Math.floor(Math.random()*n));return e}var Zn=class{constructor(e,r){Kn.set(this,void 0),vr.set(this,void 0),Iu(this,Kn,e,"f"),Iu(this,vr,r,"f")}get base(){return Hr(this,vr,"f")}static async create(e,r){let n=St.from(Hp(10)).toUrl(),i=new Zn(e,n);return await i.set(r),i}static async isSmartLiteralBase(e,r){return(await e.get(new $e({source:r,predicate:Qi}))).length>0}static async getAllSmartLiterals(e){return(await e.get(new $e({predicate:Qi}))).map(n=>new Zn(e,n.data.source))}async get(){let e=await Hr(this,Kn,"f").getSingleTarget(new $e({source:Hr(this,vr,"f"),predicate:Qi}));if(!e)throw`No content for smart literal ${Hr(this,vr,"f")}`;return St.fromUrl(e).get()}async set(e){let r=St.from(e);await Hr(this,Kn,"f").setSingleTarget(new bt({source:Hr(this,vr,"f"),predicate:Qi,target:r.toUrl()}))}};Kn=new WeakMap,vr=new WeakMap;var Du=class{};function Ew(t,e,r){return{action:"addLink",source:t,predicate:e,target:r}}function Tw(t){return`triple(this, "${t}", _)`}function Ow(t){return function(e,r,n){if(typeof n.value!="function")throw new Error("InstanceQuery decorator can only be applied to methods");n.value=async function(a){let o=[],s=e.name,u=`subject_class("${s}", C), instance(C, Instance)`;if(t&&t.where)for(let f in t.where){let d=t.where[f];u+=`, property_getter(C, Instance, "${f}", "${d}")`}t&&t.condition&&(u+=", "+t.condition);let l=await a.infer(u);if(l==!1)return o;if(typeof l=="string")throw l;for(let f of l){let d=f.Instance,h=new pa(a,d,s);await h.init(),o.push(h)}return o}}}function xw(t){return function(e,r){if(t.required&&!t.initial)throw new Error("SubjectProperty requires an 'initial' option if 'required' is true");if(!t.through&&!t.getter)throw new Error("SubjectProperty requires either 'through' or 'getter' option");if(e.__properties=e.__properties||{},e.__properties[r]=e.__properties[r]||{},e.__properties[r]={...e.__properties[r],...t},t.writable){let n=r;e[`set${Gt(n)}`]=()=>{}}Object.defineProperty(e,r,{configurable:!0,writable:!0})}}function Iw(t){return function(e,r){if(!t.through&&!t.value)throw new Error("SubjectFlag requires a 'through' and 'value' option");if(!t.through)throw new Error("SubjectFlag requires a 'through' option");if(!t.value)throw new Error("SubjectFlag requires a 'value' option");e.__properties=e.__properties||{},e.__properties[r]=e.__properties[r]||{},e.__properties[r]={...e.__properties[r],through:t.through,required:!0,initial:t.value,flag:!0},e[r]=t.value,Object.defineProperty(e,r,{configurable:!0,writable:!0})}}function Dw(t){return function(e,r){e.__collections=e.__collections||{},e.__collections[r]=t;let n=r;e[`add${Gt(n)}`]=()=>{},e[`remove${Gt(n)}`]=()=>{},e[`setCollection${Gt(n)}`]=()=>{},Object.defineProperty(e,r,{configurable:!0,writable:!0})}}function Wu(t){let e="",r="abcdefghijklmnopqrstuvwxyz",n=r.length;for(let i=0;i<t;i++)e+=r.charAt(Math.floor(Math.random()*n));return e}function kw(t){return function(e){e.prototype.className=t.name,e.className=t.name,e.generateSDNA=function(){let r="",n=t.name,i=e.prototype,a=Wu(8);r+=`subject_class("${n}", ${a}).
646
+ `;let o=[],s=[];i.subjectConstructor&&i.subjectConstructor.length&&(s=s.concat(i.subjectConstructor));let u=[];i.isSubjectInstance&&i.isSubjectInstance.length&&(u=u.concat(i.isSubjectInstance));let l=[],f=i.__properties||{};for(let y in f){let g=`property(${a}, "${y}").
647
+ `,{through:S,initial:T,required:b,resolveLanguage:w,writable:O,flag:N,getter:A,setter:k,local:C}=f[y];if(w&&(g+=`property_resolve(${a}, "${y}").
648
+ `,g+=`property_resolve_language(${a}, "${y}", "${w}").
649
+ `),A?g+=`property_getter(${a}, Base, "${y}", Value) :- ${A}.
650
+ `:S&&(g+=`property_getter(${a}, Base, "${y}", Value) :- triple(Base, "${S}", Value).
651
+ `,b&&(N?u.push(`triple(Base, "${S}", "${T}")`):u.push(`triple(Base, "${S}", _)`))),k)g+=`property_setter(${a}, "${y}", Actions) :- ${k}.
652
+ `;else if(O&&typeof i[Qu(y)]=="function"){let Z=[{action:"setSingleTarget",source:"this",predicate:S,target:"value",...C&&{local:!0}}];g+=`property_setter(${a}, "${y}", '${dr(Z)}').
653
+ `}l.push(g),T&&(s.push({action:"addLink",source:"this",predicate:S,target:T}),o.push({action:"removeLink",source:"this",predicate:S,target:T}))}let d=[],h=i.__collections||{};for(let y in h){let g=`collection(${a}, "${y}").
654
+ `,{through:S,where:T,local:b}=h[y];if(S){if(T){if(!T.isInstance&&!T.condition)throw"'where' needs one of 'isInstance' or 'condition'";let A=[];if(T.isInstance){let C;T.isInstance.name?C=T.isInstance.name:C=T.isInstance,A.push(`instance(OtherClass, Target), subject_class("${C}", OtherClass)`)}T.condition&&A.push(T.condition);let k=A.join(", ");g+=`collection_getter(${a}, Base, "${y}", List) :- setof(Target, (triple(Base, "${S}", Target), ${k}), List).
655
+ `}else g+=`collection_getter(${a}, Base, "${y}", List) :- findall(C, triple(Base, "${S}", C), List).
656
+ `;let w=[{action:"addLink",source:"this",predicate:S,target:"value",...b&&{local:!0}}],O=[{action:"removeLink",source:"this",predicate:S,target:"value"}],N=[{action:"collectionSetter",source:"this",predicate:S,target:"value",...b&&{local:!0}}];g+=`collection_adder(${a}, "${Nt(y)}", '${dr(w)}').
657
+ `,g+=`collection_remover(${a}, "${Nt(y)}", '${dr(O)}').
658
+ `,g+=`collection_setter(${a}, "${Nt(y)}", '${dr(N)}').
659
+ `}d.push(g)}let p=dr(s);if(r+=`constructor(${a}, '${p}').
627
660
  `,u.length>0){let y=u.join(", ");r+=`instance(${a}, Base) :- ${y}.
628
661
  `,r+=`
629
662
  `}return r+=`destructor(${a}, '${dr(o)}').
@@ -631,7 +664,7 @@ proof { valid, invalid, signature, key }
631
664
  `,r+=l.join(`
632
665
  `),r+=`
633
666
  `,r+=d.join(`
634
- `),{sdna:r,name:n}},Object.defineProperty(e,"type",{configurable:!0})}}var Ow=`
667
+ `),{sdna:r,name:n}},Object.defineProperty(e,"type",{configurable:!0})}}var Nw=`
635
668
  type Agent {
636
669
  did: String!
637
670
  directMessageLanguage: String
@@ -887,12 +920,16 @@ type Mutation {
887
920
  runtimeAddFriends(dids: [String!]!): [String!]!
888
921
  runtimeAddKnownLinkLanguageTemplates(addresses: [String!]!): [String!]!
889
922
  runtimeFriendSendMessage(did: String!, message: PerspectiveInput!): Boolean!
923
+ runtimeGrantNotification(id: String!): Boolean!
890
924
  runtimeHcAddAgentInfos(agentInfos: String!): Boolean!
891
925
  runtimeOpenLink(url: String!): Boolean!
892
926
  runtimeQuit: Boolean!
893
927
  runtimeRemoveFriends(dids: [String!]!): [String!]!
894
928
  runtimeRemoveKnownLinkLanguageTemplates(addresses: [String!]!): [String!]!
929
+ runtimeRemoveNotification(id: String!): Boolean!
930
+ runtimeRequestInstallNotification(notification: NotificationInput!): String!
895
931
  runtimeSetStatus(status: PerspectiveInput!): Boolean!
932
+ runtimeUpdateNotification(id: String!, notification: NotificationInput!): Boolean!
896
933
  }
897
934
 
898
935
  type Neighbourhood {
@@ -907,6 +944,30 @@ type NeighbourhoodExpression {
907
944
  timestamp: String!
908
945
  }
909
946
 
947
+ type Notification {
948
+ appIconPath: String!
949
+ appName: String!
950
+ appUrl: String!
951
+ description: String!
952
+ granted: Boolean!
953
+ id: String!
954
+ perspectiveIds: [String!]!
955
+ trigger: String!
956
+ webhookAuth: String!
957
+ webhookUrl: String!
958
+ }
959
+
960
+ input NotificationInput {
961
+ appIconPath: String!
962
+ appName: String!
963
+ appUrl: String!
964
+ description: String!
965
+ perspectiveIds: [String!]!
966
+ trigger: String!
967
+ webhookAuth: String!
968
+ webhookUrl: String!
969
+ }
970
+
910
971
  type OnlineAgent {
911
972
  did: String!
912
973
  status: PerspectiveExpression!
@@ -970,6 +1031,7 @@ type Query {
970
1031
  runtimeKnownLinkLanguageTemplates: [String!]!
971
1032
  runtimeMessageInbox(filter: String): [PerspectiveExpression!]!
972
1033
  runtimeMessageOutbox(filter: String): [SentMessage!]!
1034
+ runtimeNotifications: [Notification!]!
973
1035
  runtimeVerifyStringSignedByDid(data: String!, did: String!, didSigningKeyId: String!, signedData: String!): Boolean!
974
1036
  }
975
1037
 
@@ -1008,6 +1070,14 @@ type Subscription {
1008
1070
  perspectiveSyncStateChange(uuid: String!): String!
1009
1071
  perspectiveUpdated: PerspectiveHandle
1010
1072
  runtimeMessageReceived: PerspectiveExpression
1073
+ runtimeNotificationRequested: Notification
1074
+ runtimeNotificationTriggered: TriggeredNotification
1075
+ }
1076
+
1077
+ type TriggeredNotification {
1078
+ notification: Notification!
1079
+ perspectiveId: String!
1080
+ triggerMatch: String!
1011
1081
  }
1012
- `;function Tu(t){return t?.length?t.length===1?t.toString():t.length===2?t.join(" and "):t.slice(0,-1).join(", ")+", and "+t.slice(-1):""}function Tw(t){let e=t.can.includes("*")?["READ","WRITE","UPDATE"]:t.can,r=t.with.domain==="*"?"":t.with.domain,n=t.with.pointers.includes("*")?["all AD4M data"]:t.with.pointers;return`${Tu(e)} your ${r} actions, with access to ${Tu(n)}`}var pr=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},M=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Me,ke,Zi,re,Iu=class{constructor(t,e,r){Me.set(this,void 0),ke.set(this,void 0),Zi.set(this,void 0),re.set(this,void 0),pr(this,Me,e||St.from(Bu(24)).toUrl(),"f"),pr(this,re,t,"f"),pr(this,Zi,r||"ad4m://self","f")}get baseExpression(){return M(this,Me,"f")}async getData(id){let tempId=id??M(this,Me,"f"),isInstance=await M(this,re,"f").isSubjectInstance(tempId,M(this,ke,"f"));if(!isInstance)throw`Not a valid subject instance of ${M(this,ke,"f")} for ${tempId}`;let results=await M(this,re,"f").infer(`subject_class("${M(this,ke,"f")}", C), property(C, Property)`),properties=results.map(t=>t.Property);for(let t of properties){let e=await M(this,re,"f").infer(`subject_class("${M(this,ke,"f")}", C), property_resolve(C, "${t}")`),r=async()=>{let n=await M(this,re,"f").infer(`subject_class("${M(this,ke,"f")}", C), property_getter(C, "${tempId}", "${t}", Value)`);if(n&&n.length>0){let i=n[0].Value;if(e)try{let a=await M(this,re,"f").getExpression(i);try{return JSON.parse(a.data)}catch{return a.data}}catch{return i}else return i}else return n||void 0};this[t]=await r()}let results2=await M(this,re,"f").infer(`subject_class("${M(this,ke,"f")}", C), collection(C, Collection)`);results2||(results2=[]);let collections=results2.map(t=>t.Collection);for(let c of collections){let getProperty=async()=>{let results=await M(this,re,"f").infer(`subject_class("${M(this,ke,"f")}", C), collection_getter(C, "${tempId}", "${c}", Value)`);return results&&results.length>0&&results[0].Value?eval(results[0].Value):[]};this[c]=await getProperty()}return pr(this,Me,tempId,"f"),this}async setProperty(key,value){let setters=await M(this,re,"f").infer(`subject_class("${M(this,ke,"f")}", C), property_setter(C, "${key}", Setter)`);if(setters&&setters.length>0){let actions=eval(setters[0].Setter),resolveLanguageResults=await M(this,re,"f").infer(`subject_class("${M(this,ke,"f")}", C), property_resolve_language(C, "${key}", Language)`),resolveLanguage;resolveLanguageResults&&resolveLanguageResults.length>0&&(resolveLanguage=resolveLanguageResults[0].Language),resolveLanguage&&(value=await M(this,re,"f").createExpression(value,resolveLanguage)),await M(this,re,"f").executeAction(actions,M(this,Me,"f"),[{name:"value",value}])}}async setCollectionSetter(key,value){let collectionSetters=await M(this,re,"f").infer(`subject_class("${M(this,ke,"f")}", C), collection_setter(C, "${At(key)}", Setter)`);if(collectionSetters||(collectionSetters=[]),collectionSetters.length>0){let actions=eval(collectionSetters[0].Setter);value&&(Array.isArray(value)?await M(this,re,"f").executeAction(actions,M(this,Me,"f"),value.map(t=>({name:"value",value:t}))):await M(this,re,"f").executeAction(actions,M(this,Me,"f"),[{name:"value",value}]))}}async setCollectionAdder(key,value){let adders=await M(this,re,"f").infer(`subject_class("${M(this,ke,"f")}", C), collection_adder(C, "${At(key)}", Adder)`);if(adders||(adders=[]),adders.length>0){let actions=eval(adders[0].Adder);value&&(Array.isArray(value)?await Promise.all(value.map(t=>M(this,re,"f").executeAction(actions,M(this,Me,"f"),[{name:"value",value:t}]))):await M(this,re,"f").executeAction(actions,M(this,Me,"f"),[{name:"value",value}]))}}async setCollectionRemover(key,value){let removers=await M(this,re,"f").infer(`subject_class("${M(this,ke,"f")}", C), collection_remover(C, "${At(key)}", Remover)`);if(removers||(removers=[]),removers.length>0){let actions=eval(removers[0].Remover);value&&(Array.isArray(value)?await Promise.all(value.map(t=>M(this,re,"f").executeAction(actions,M(this,Me,"f"),[{name:"value",value:t}]))):await M(this,re,"f").executeAction(actions,M(this,Me,"f"),[{name:"value",value}]))}}async save(){pr(this,ke,await M(this,re,"f").stringOrTemplateObjectToSubjectClass(this),"f"),await M(this,re,"f").createSubject(this,M(this,Me,"f")),await M(this,re,"f").add(new bt({source:M(this,Zi,"f"),predicate:"ad4m://has_child",target:this.baseExpression})),await this.update()}async update(){pr(this,ke,await M(this,re,"f").stringOrTemplateObjectToSubjectClass(this),"f");let t=Object.entries(this);for(let[e,r]of t)if(r!=null)if(r?.action)switch(r.action){case"setter":await this.setCollectionSetter(e,r.value);break;case"adder":await this.setCollectionAdder(e,r.value);break;case"remover":await this.setCollectionRemover(e,r.value);default:await this.setCollectionSetter(e,r.value);break}else Array.isArray(r)&&r.length>0?await this.setCollectionSetter(e,r):r!=null&&r!==""&&await this.setProperty(e,r);await this.getData()}async get(){return pr(this,ke,await M(this,re,"f").stringOrTemplateObjectToSubjectClass(this),"f"),await this.getData()}async delete(){await M(this,re,"f").removeSubject(this,M(this,Me,"f"))}static async all(t){let e=await t.stringOrTemplateObjectToSubjectClass(this),r=await t.getAllSubjectProxies(e),n=[];if(r){for(let i of r){let a=new this(t,i.X);n.push(await a.get())}return n}return[]}static async query(t,e){let r=e?.source||"ad4m://self",n=await t.stringOrTemplateObjectToSubjectClass(this),i=[];if(e)try{if((await t.infer(`findall([Timestamp, Base], (subject_class("${n}", C), instance(C, Base), link("${r}", Predicate, Base, Timestamp, Author)), AllData), sort(AllData, SortedData), length(SortedData, DataLength).`))[0].DataLength>=e.size){let s=`findall([Timestamp, Base], (subject_class("${n}", C), instance(C, Base), link("${r}", Predicate, Base, Timestamp, Author)), AllData), sort(AllData, SortedData), reverse(SortedData, ReverseSortedData), paginate(ReverseSortedData, ${e.page}, ${e.size}, PageData).`;i=await t.infer(s),i=i[0].PageData.map(u=>({Base:u[1],Timestamp:u[0]}))}else i=await t.infer(`subject_class("${n}", C), instance(C, Base), triple("${r}", Predicate, Base).`)}catch(o){console.log("Query failed",o)}else i=await t.infer(`subject_class("${n}", C), instance(C, Base), triple("${r}", Predicate, Base).`);return i?await Promise.all(i.map(async o=>await new this(t,o.Base).get())):[]}};Me=new WeakMap,ke=new WeakMap,Zi=new WeakMap,re=new WeakMap;function Wp(){let t=new AbortController;return setTimeout(()=>t.abort(),20),t}function os(t,e=1e4){return qe(this,null,function*(){return Promise.race([new Promise((r,n)=>{t.includes("localhost")||r(new WebSocket(t));let i=new WebSocket(t);i.onopen=()=>{r(i)},i.onerror=a=>{n(a)}}),new Promise((r,n)=>{setTimeout(()=>{n(new Error("WebSocket connection timed out"))},e)})])})}function ss(t){return qe(this,null,function*(){try{let e=yield fetch(`http://localhost:${t}/graphql/`,{signal:Wp().signal,mode:"no-cors"});if(e.status===400||e.status===0)return t;throw new Error(`Could not connect to port ${t}`)}catch(e){throw new Error(`Could not connect to port ${t}`)}})}var Kp=t=>{let e=new Set;do for(let r of Reflect.ownKeys(t))e.add([t,r]);while((t=Reflect.getPrototypeOf(t))&&t!==Object.prototype);return e};function cs(t,{include:e,exclude:r}={}){let n=i=>{let a=o=>typeof o=="string"?i===o:o.test(i);return e?e.some(a):r?!r.some(a):!0};for(let[i,a]of Kp(t.constructor.prototype)){if(a==="constructor"||!n(a))continue;let o=Reflect.getOwnPropertyDescriptor(i,a);o&&typeof o.value=="function"&&(t[a]=t[a].bind(t))}return t}var us=class{constructor({appName:e,appDesc:r,appIconPath:n,appUrl:i,appDomain:a,capabilities:o,port:s,token:u,url:l}){this.activeSocket=null;this.requestedRestart=!1;this.authState="unauthenticated";this.connectionState="not_connected";this.port=12e3;this.capabilities=[];this.listeners={authstatechange:[],configstatechange:[],connectionstatechange:[]};cs(this);this.appName=e,this.appDesc=r,this.appDomain=a,this.appUrl=i,this.appIconPath=n,this.capabilities=o,this.port=s||this.port,this.url=l||`ws://localhost:${this.port}/graphql`,this.token=u||this.token,this.buildClient()}notifyConfigChange(e,r){this.listeners.configstatechange.forEach(n=>{n(e,r)})}notifyConnectionChange(e){this.connectionState!==e&&(this.connectionState=e,this.listeners.connectionstatechange.forEach(r=>{r(e)}))}notifyAuthChange(e){this.authState!==e&&(this.authState=e,this.listeners.authstatechange.forEach(r=>{r(e)}))}setPort(e){this.port!==e&&(this.port=e,this.setUrl(`ws://localhost:${this.port}/graphql`),this.notifyConfigChange("port",e))}setUrl(e){this.url!==e&&(this.url=e,this.notifyConfigChange("url",e))}setToken(e){this.token!==e&&(this.token=e,this.notifyConfigChange("token",e))}on(e,r){this.listeners[e].push(r)}connect(e){return qe(this,null,function*(){try{if(e){yield os(e,1e4),this.setUrl(e);let r=this.buildClient();return yield this.checkAuth(),r}else{let r=yield this.ensureConnection();return yield this.checkAuth(),r}}catch(r){this.notifyConnectionChange("not_connected"),this.notifyAuthChange("unauthenticated")}})}loginToHosting(e,r){return qe(this,null,function*(){try{let n=yield fetch("https://hosting.ad4m.dev/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:e,password:r})});if(n.status===200){let i=yield n.json();localStorage.setItem("hosting_token",i.token);let a=localStorage.getItem("hosting_token"),o=yield fetch("https://hosting.ad4m.dev/api/service/info",{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+a}});if(o.status===200){let s=yield o.json();s.serviceId&&(this.setPort(s.port),this.setUrl(`wss://${s.port}.hosting.ad4m.dev/graphql`))}}else if((yield n.json()).message==="Passwords did not match")throw new Error("Passwords did not match")}catch(n){throw console.log(n),new Error(`Error logging in ${n}`)}})}checkEmail(e){return qe(this,null,function*(){try{return(yield fetch(`https://hosting.ad4m.dev/api/auth/check-email?email=${e}`,{method:"GET",headers:{"Content-Type":"application/json"}})).status===200}catch(r){console.log(r)}})}connectToPort(e){return qe(this,null,function*(){try{if(e){let r=yield ss(e);this.setPort(r)}else{let r=yield this.findPort();this.setPort(r)}return this.buildClient()}catch(r){this.notifyConnectionChange("not_connected"),this.notifyAuthChange("unauthenticated")}})}ensureConnection(){return qe(this,null,function*(){var r,n;if(((r=this.activeSocket)==null?void 0:r.readyState)===WebSocket.OPEN&&((n=this.activeSocket)==null?void 0:n.url)===this.url&&this.ad4mClient)return this.ad4mClient;try{return yield os(this.url,1e4),this.buildClient()}catch(i){return this.connectToPort()}})}findPort(){return qe(this,null,function*(){let e=[...Array(10).keys()].map((i,a)=>ss(12e3+a)),n=(yield Promise.allSettled(e)).find(i=>i.status==="fulfilled");if(n)return n.value;throw Error("Couldn't find an open port")})}buildClient(){this.notifyConnectionChange("connecting");try{new WebSocket(this.url)}catch(e){this.notifyConnectionChange("not_connected")}return this.apolloClient&&this.wsClient&&(this.requestedRestart=!0,this.wsClient.dispose(),this.apolloClient.stop()),this.wsClient=iu({url:this.url,connectionParams:()=>qe(this,null,function*(){return{headers:{authorization:this.token}}}),on:{connecting:()=>{this.requestedRestart||this.notifyConnectionChange("connecting")},opened:e=>{this.activeSocket=e},error:e=>{this.notifyConnectionChange("not_connected"),this.notifyAuthChange("unauthenticated")},connected:()=>{this.notifyConnectionChange("connected")},closed:()=>{this.requestedRestart||(this.notifyConnectionChange(this.token?"disconnected":"not_connected"),this.notifyAuthChange("unauthenticated"),this.requestedRestart=!1)}}}),this.apolloClient=new ko({link:new au(this.wsClient),cache:new Ai({resultCaching:!1,addTypename:!1}),defaultOptions:{watchQuery:{fetchPolicy:"no-cache"},query:{fetchPolicy:"no-cache"},mutate:{fetchPolicy:"no-cache"}}}),this.ad4mClient=new fa(this.apolloClient),this.ad4mClient}checkAuth(){return qe(this,null,function*(){try{return(yield this.ad4mClient.agent.isLocked())?this.notifyAuthChange("locked"):(yield this.ad4mClient.agent.status(),this.notifyAuthChange("authenticated")),!0}catch(e){return e.message==="Socket closed with event 4500 Cannot extractByTags from a ciphered wallet. You must unlock first."?(this.notifyAuthChange("locked"),!0):(this.notifyAuthChange("unauthenticated"),!1)}})}requestCapability(e=!1){return qe(this,null,function*(){var r;return e&&this.setToken(null),this.requestId=yield(r=this.ad4mClient)==null?void 0:r.agent.requestCapability({appName:this.appName,appDesc:this.appDesc,appUrl:this.appUrl,appIconPath:this.appIconPath,appDomain:this.appDomain,capabilities:this.capabilities}),this.requestId})}verifyCode(e){return qe(this,null,function*(){var n;let r=yield(n=this.ad4mClient)==null?void 0:n.agent.generateJwt(this.requestId,e);return this.setToken(r),yield this.buildClient(),yield this.checkAuth(),this.token})}};export{us as default};
1082
+ `;function ku(t){return t?.length?t.length===1?t.toString():t.length===2?t.join(" and "):t.slice(0,-1).join(", ")+", and "+t.slice(-1):""}function Aw(t){let e=t.can.includes("*")?["READ","WRITE","UPDATE"]:t.can,r=t.with.domain==="*"?"":t.with.domain,n=t.with.pointers.includes("*")?["all AD4M data"]:t.with.pointers;return`${ku(e)} your ${r} actions, with access to ${ku(n)}`}var pr=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},M=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},je,ke,ra,ie,Nu=class{constructor(t,e,r){je.set(this,void 0),ke.set(this,void 0),ra.set(this,void 0),ie.set(this,void 0),pr(this,je,e||St.from(Wu(24)).toUrl(),"f"),pr(this,ie,t,"f"),pr(this,ra,r||"ad4m://self","f")}get baseExpression(){return M(this,je,"f")}async getData(id){let tempId=id??M(this,je,"f"),isInstance=await M(this,ie,"f").isSubjectInstance(tempId,M(this,ke,"f"));if(!isInstance)throw`Not a valid subject instance of ${M(this,ke,"f")} for ${tempId}`;let results=await M(this,ie,"f").infer(`subject_class("${M(this,ke,"f")}", C), property(C, Property)`),properties=results.map(t=>t.Property);for(let t of properties){let e=await M(this,ie,"f").infer(`subject_class("${M(this,ke,"f")}", C), property_resolve(C, "${t}")`),r=async()=>{let n=await M(this,ie,"f").infer(`subject_class("${M(this,ke,"f")}", C), property_getter(C, "${tempId}", "${t}", Value)`);if(n&&n.length>0){let i=n[0].Value;if(e)try{let a=await M(this,ie,"f").getExpression(i);try{return JSON.parse(a.data)}catch{return a.data}}catch{return i}else return i}else return n||void 0};this[t]=await r()}let results2=await M(this,ie,"f").infer(`subject_class("${M(this,ke,"f")}", C), collection(C, Collection)`);results2||(results2=[]);let collections=results2.map(t=>t.Collection);for(let c of collections){let getProperty=async()=>{let results=await M(this,ie,"f").infer(`subject_class("${M(this,ke,"f")}", C), collection_getter(C, "${tempId}", "${c}", Value)`);return results&&results.length>0&&results[0].Value?eval(results[0].Value):[]};this[c]=await getProperty()}return pr(this,je,tempId,"f"),this}async setProperty(key,value){let setters=await M(this,ie,"f").infer(`subject_class("${M(this,ke,"f")}", C), property_setter(C, "${key}", Setter)`);if(setters&&setters.length>0){let actions=eval(setters[0].Setter),resolveLanguageResults=await M(this,ie,"f").infer(`subject_class("${M(this,ke,"f")}", C), property_resolve_language(C, "${key}", Language)`),resolveLanguage;resolveLanguageResults&&resolveLanguageResults.length>0&&(resolveLanguage=resolveLanguageResults[0].Language),resolveLanguage&&(value=await M(this,ie,"f").createExpression(value,resolveLanguage)),await M(this,ie,"f").executeAction(actions,M(this,je,"f"),[{name:"value",value}])}}async setCollectionSetter(key,value){let collectionSetters=await M(this,ie,"f").infer(`subject_class("${M(this,ke,"f")}", C), collection_setter(C, "${Nt(key)}", Setter)`);if(collectionSetters||(collectionSetters=[]),collectionSetters.length>0){let actions=eval(collectionSetters[0].Setter);value&&(Array.isArray(value)?await M(this,ie,"f").executeAction(actions,M(this,je,"f"),value.map(t=>({name:"value",value:t}))):await M(this,ie,"f").executeAction(actions,M(this,je,"f"),[{name:"value",value}]))}}async setCollectionAdder(key,value){let adders=await M(this,ie,"f").infer(`subject_class("${M(this,ke,"f")}", C), collection_adder(C, "${Nt(key)}", Adder)`);if(adders||(adders=[]),adders.length>0){let actions=eval(adders[0].Adder);value&&(Array.isArray(value)?await Promise.all(value.map(t=>M(this,ie,"f").executeAction(actions,M(this,je,"f"),[{name:"value",value:t}]))):await M(this,ie,"f").executeAction(actions,M(this,je,"f"),[{name:"value",value}]))}}async setCollectionRemover(key,value){let removers=await M(this,ie,"f").infer(`subject_class("${M(this,ke,"f")}", C), collection_remover(C, "${Nt(key)}", Remover)`);if(removers||(removers=[]),removers.length>0){let actions=eval(removers[0].Remover);value&&(Array.isArray(value)?await Promise.all(value.map(t=>M(this,ie,"f").executeAction(actions,M(this,je,"f"),[{name:"value",value:t}]))):await M(this,ie,"f").executeAction(actions,M(this,je,"f"),[{name:"value",value}]))}}async save(){pr(this,ke,await M(this,ie,"f").stringOrTemplateObjectToSubjectClass(this),"f"),await M(this,ie,"f").createSubject(this,M(this,je,"f")),await M(this,ie,"f").add(new bt({source:M(this,ra,"f"),predicate:"ad4m://has_child",target:this.baseExpression})),await this.update()}async update(){pr(this,ke,await M(this,ie,"f").stringOrTemplateObjectToSubjectClass(this),"f");let t=Object.entries(this);for(let[e,r]of t)if(r!=null)if(r?.action)switch(r.action){case"setter":await this.setCollectionSetter(e,r.value);break;case"adder":await this.setCollectionAdder(e,r.value);break;case"remover":await this.setCollectionRemover(e,r.value);default:await this.setCollectionSetter(e,r.value);break}else Array.isArray(r)&&r.length>0?await this.setCollectionSetter(e,r):r!=null&&r!==""&&await this.setProperty(e,r);await this.getData()}async get(){return pr(this,ke,await M(this,ie,"f").stringOrTemplateObjectToSubjectClass(this),"f"),await this.getData()}async delete(){await M(this,ie,"f").removeSubject(this,M(this,je,"f"))}static async all(t){let e=await t.stringOrTemplateObjectToSubjectClass(this),r=await t.getAllSubjectProxies(e),n=[];if(r){for(let i of r){let a=new this(t,i.X);n.push(await a.get())}return n}return[]}static async query(t,e){let r=e?.source||"ad4m://self",n=await t.stringOrTemplateObjectToSubjectClass(this),i=[];if(e)try{if((await t.infer(`findall([Timestamp, Base], (subject_class("${n}", C), instance(C, Base), link("${r}", Predicate, Base, Timestamp, Author)), AllData), sort(AllData, SortedData), length(SortedData, DataLength).`))[0].DataLength>=e.size){let s=`findall([Timestamp, Base], (subject_class("${n}", C), instance(C, Base), link("${r}", Predicate, Base, Timestamp, Author)), AllData), sort(AllData, SortedData), reverse(SortedData, ReverseSortedData), paginate(ReverseSortedData, ${e.page}, ${e.size}, PageData).`;i=await t.infer(s),i=i[0].PageData.map(u=>({Base:u[1],Timestamp:u[0]}))}else i=await t.infer(`subject_class("${n}", C), instance(C, Base), triple("${r}", Predicate, Base).`)}catch(o){console.log("Query failed",o)}else i=await t.infer(`subject_class("${n}", C), instance(C, Base), triple("${r}", Predicate, Base).`);return i?await Promise.all(i.map(async o=>await new this(t,o.Base).get())):[]}};je=new WeakMap,ke=new WeakMap,ra=new WeakMap,ie=new WeakMap;function Yp(){let t=new AbortController;return setTimeout(()=>t.abort(),20),t}function us(t,e=1e4){return Ce(this,null,function*(){return Promise.race([new Promise((r,n)=>{t.includes("localhost")||r(new WebSocket(t));let i=new WebSocket(t);i.onopen=()=>{r(i)},i.onerror=a=>{n(a)}}),new Promise((r,n)=>{setTimeout(()=>{n(new Error("WebSocket connection timed out"))},e)})])})}function ls(t){return Ce(this,null,function*(){try{let e=yield fetch(`http://localhost:${t}/graphql/`,{signal:Yp().signal,mode:"no-cors"});if(e.status===400||e.status===0)return t;throw new Error(`Could not connect to port ${t}`)}catch(e){throw new Error(`Could not connect to port ${t}`)}})}var Xp=t=>{let e=new Set;do for(let r of Reflect.ownKeys(t))e.add([t,r]);while((t=Reflect.getPrototypeOf(t))&&t!==Object.prototype);return e};function fs(t,{include:e,exclude:r}={}){let n=i=>{let a=o=>typeof o=="string"?i===o:o.test(i);return e?e.some(a):r?!r.some(a):!0};for(let[i,a]of Xp(t.constructor.prototype)){if(a==="constructor"||!n(a))continue;let o=Reflect.getOwnPropertyDescriptor(i,a);o&&typeof o.value=="function"&&(t[a]=t[a].bind(t))}return t}var ps=class{constructor({appName:e,appDesc:r,appIconPath:n,appUrl:i,appDomain:a,capabilities:o,port:s,token:u,url:l}){this.activeSocket=null;this.requestedRestart=!1;this.authState="unauthenticated";this.connectionState="not_connected";this.port=12e3;this.capabilities=[];this.listeners={authstatechange:[],configstatechange:[],connectionstatechange:[]};fs(this);this.appName=e,this.appDesc=r,this.appDomain=a,this.appUrl=i,this.appIconPath=n,this.capabilities=o,this.port=s||this.port,this.url=l||`ws://localhost:${this.port}/graphql`,this.token=u||this.token,this.buildClient()}notifyConfigChange(e,r){this.listeners.configstatechange.forEach(n=>{n(e,r)})}notifyConnectionChange(e){this.connectionState!==e&&(this.connectionState=e,this.listeners.connectionstatechange.forEach(r=>{r(e)}))}notifyAuthChange(e){this.authState!==e&&(this.authState=e,this.listeners.authstatechange.forEach(r=>{r(e)}))}setPort(e){this.port!==e&&(this.port=e,this.setUrl(`ws://localhost:${this.port}/graphql`),this.notifyConfigChange("port",e))}setUrl(e){this.url!==e&&(this.url=e,this.notifyConfigChange("url",e))}setToken(e){this.token!==e&&(this.token=e,this.notifyConfigChange("token",e))}on(e,r){this.listeners[e].push(r)}connect(e){return Ce(this,null,function*(){try{if(e){yield us(e,1e4),this.setUrl(e);let r=this.buildClient();return yield this.checkAuth(),r}else{let r=yield this.ensureConnection();return yield this.checkAuth(),r}}catch(r){this.notifyConnectionChange("not_connected"),this.notifyAuthChange("unauthenticated")}})}loginToHosting(e,r){return Ce(this,null,function*(){try{let n=yield fetch("https://hosting.ad4m.dev/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:e,password:r})});if(n.status===200){let i=yield n.json();localStorage.setItem("hosting_token",i.token);let a=localStorage.getItem("hosting_token"),o=yield fetch("https://hosting.ad4m.dev/api/service/info",{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+a}});if(o.status===200){let s=yield o.json();s.serviceId&&(this.setPort(s.port),this.setUrl(`wss://${s.port}.hosting.ad4m.dev/graphql`))}}else if((yield n.json()).message==="Passwords did not match")throw new Error("Passwords did not match")}catch(n){throw console.log(n),new Error(`Error logging in ${n}`)}})}checkEmail(e){return Ce(this,null,function*(){try{return(yield fetch(`https://hosting.ad4m.dev/api/auth/check-email?email=${e}`,{method:"GET",headers:{"Content-Type":"application/json"}})).status===200}catch(r){console.log(r)}})}connectToPort(e){return Ce(this,null,function*(){try{if(e){let r=yield ls(e);this.setPort(r)}else{let r=yield this.findPort();this.setPort(r)}return this.buildClient()}catch(r){this.notifyConnectionChange("not_connected"),this.notifyAuthChange("unauthenticated")}})}ensureConnection(){return Ce(this,null,function*(){var r,n;if(((r=this.activeSocket)==null?void 0:r.readyState)===WebSocket.OPEN&&((n=this.activeSocket)==null?void 0:n.url)===this.url&&this.ad4mClient)return this.ad4mClient;try{return yield us(this.url,1e4),this.buildClient()}catch(i){return this.connectToPort()}})}findPort(){return Ce(this,null,function*(){let e=[...Array(10).keys()].map((i,a)=>ls(12e3+a)),n=(yield Promise.allSettled(e)).find(i=>i.status==="fulfilled");if(n)return n.value;throw Error("Couldn't find an open port")})}buildClient(){this.notifyConnectionChange("connecting");try{new WebSocket(this.url)}catch(e){this.notifyConnectionChange("not_connected")}return this.apolloClient&&this.wsClient&&(this.requestedRestart=!0,this.wsClient.dispose(),this.apolloClient.stop()),this.wsClient=su({url:this.url,connectionParams:()=>Ce(this,null,function*(){return{headers:{authorization:this.token}}}),on:{connecting:()=>{this.requestedRestart||this.notifyConnectionChange("connecting")},opened:e=>{this.activeSocket=e},error:e=>{this.notifyConnectionChange("not_connected"),this.notifyAuthChange("unauthenticated")},connected:()=>{this.notifyConnectionChange("connected")},closed:()=>{this.requestedRestart||setTimeout(()=>Ce(this,null,function*(){(yield this.connect())?yield this.checkAuth():(this.notifyConnectionChange(this.token?"disconnected":"not_connected"),this.notifyAuthChange("unauthenticated"),this.requestedRestart=!1)}),5e3)}}}),this.apolloClient=new Po({link:new cu(this.wsClient),cache:new Ci({resultCaching:!1,addTypename:!1}),defaultOptions:{watchQuery:{fetchPolicy:"no-cache"},query:{fetchPolicy:"no-cache"},mutate:{fetchPolicy:"no-cache"}}}),this.ad4mClient=new ha(this.apolloClient),this.ad4mClient}checkAuth(){return Ce(this,null,function*(){try{return(yield this.ad4mClient.agent.isLocked())?this.notifyAuthChange("locked"):(yield this.ad4mClient.agent.status(),this.notifyAuthChange("authenticated")),!0}catch(e){return e.message==="Socket closed with event 4500 Cannot extractByTags from a ciphered wallet. You must unlock first."?(this.notifyAuthChange("locked"),!0):(this.notifyAuthChange("unauthenticated"),!1)}})}requestCapability(e=!1){return Ce(this,null,function*(){var r;return e&&this.setToken(null),this.requestId=yield(r=this.ad4mClient)==null?void 0:r.agent.requestCapability({appName:this.appName,appDesc:this.appDesc,appUrl:this.appUrl,appIconPath:this.appIconPath,appDomain:this.appDomain,capabilities:this.capabilities}),this.requestId})}verifyCode(e){return Ce(this,null,function*(){var n;let r=yield(n=this.ad4mClient)==null?void 0:n.agent.generateJwt(this.requestId,e);return this.setToken(r),yield this.buildClient(),yield this.checkAuth(),this.token})}};export{ps as default};
1013
1083
  //! @fayeed - make it support node.js