@coasys/ad4m-connect 0.9.1-prerelease.2 → 0.9.1-prerelease.4

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 je=(t,e,r)=>new Promise((n,i)=>{var a=c=>{try{s(r.next(c))}catch(u){i(u)}},o=c=>{try{s(r.throw(c))}catch(u){i(u)}},s=c=>c.done?n(c.value):Promise.resolve(c.value).then(a,o);s((r=r.apply(t,e)).next())});var _a=function(t,e){return _a=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])},_a(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");_a(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var h=function(){return h=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},h.apply(this,arguments)};function dt(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 tt(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(l){try{u(n.next(l))}catch(p){o(p)}}function c(l){try{u(n.throw(l))}catch(p){o(p)}}function u(l){l.done?a(l.value):i(l.value).then(s,c)}u((n=n.apply(t,e||[])).next())})}function rt(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(u){return function(l){return c([u,l])}}function c(u){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(r=0)),r;)try{if(n=1,i&&(a=u[0]&2?i.return:u[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,u[1])).done)return a;switch(i=0,a&&(u=[u[0]&2,a.value]),u[0]){case 0:case 1:a=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,i=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){r.label=u[1];break}if(u[0]===6&&r.label<a[1]){r.label=a[1],a=u;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(u);break}a[2]&&r.ops.pop(),r.trys.pop();continue}u=e.call(t,r)}catch(l){u=[6,l],i=0}finally{n=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function At(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 Ea="Invariant Violation",ps=Object.setPrototypeOf,Ku=ps===void 0?function(t,e){return t.__proto__=e,t}:ps,M=function(t){de(e,t);function e(r){r===void 0&&(r=Ea);var n=t.call(this,typeof r=="number"?Ea+": "+r+" (see https://github.com/apollographql/invariant-packages)":r)||this;return n.framesToPop=1,n.name=Ea,Ku(n,e.prototype),n}return e}(Error);function I(t,e){if(!t)throw new M(e)}var ri=["debug","log","warn","error","silent"],Oa=ri.indexOf("log");function ti(t){return function(){if(ri.indexOf(t)>=Oa){var e=console[t]||console.log;return e.apply(console,arguments)}}}(function(t){t.debug=ti("debug"),t.log=ti("log"),t.warn=ti("warn"),t.error=ti("error")})(I||(I={}));function ds(t){var e=ri[Oa];return Oa=Math.max(0,ri.indexOf(t)),e}function _e(t){try{return t()}catch{}}var ni=_e(function(){return globalThis})||_e(function(){return window})||_e(function(){return self})||_e(function(){return global})||_e(function(){return _e.constructor("return this")()});var hs="__",ms=[hs,hs].join("DEV");function zu(){try{return Boolean(__DEV__)}catch{return Object.defineProperty(ni,ms,{value:_e(function(){return"production"})!=="production",enumerable:!1,configurable:!0,writable:!0}),ni[ms]}}var Yt=zu();function Pt(t){try{return t()}catch{}}var Ta=Pt(function(){return globalThis})||Pt(function(){return window})||Pt(function(){return self})||Pt(function(){return global})||Pt(function(){return Pt.constructor("return this")()}),xa=!1;function Ju(){Ta&&!Pt(function(){return"production"})&&!Pt(function(){return process})&&(Object.defineProperty(Ta,"process",{value:{env:{NODE_ENV:"production"}},configurable:!0,enumerable:!1,writable:!0}),xa=!0)}Ju();function Ia(){xa&&(delete Ta.process,xa=!1)}var ld=typeof Symbol=="function"&&Symbol.iterator!=null?Symbol.iterator:"@@iterator",fd=typeof Symbol=="function"&&Symbol.asyncIterator!=null?Symbol.asyncIterator:"@@asyncIterator",ys=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 Da(t,e){var r=Boolean(t);if(!r)throw new Error(e??"Unexpected invariant triggered.")}var Hu=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):void 0,cn=Hu;function ii(t){var e=t.prototype.toJSON;typeof e=="function"||Da(0),t.prototype.inspect=e,cn&&(t.prototype[cn]=e)}var gs=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}();ii(gs);var vs=function(){function t(r,n,i,a,o,s,c){this.kind=r,this.start=n,this.end=i,this.line=a,this.column=o,this.value=c,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}();ii(vs);function ka(t){return t!=null&&typeof t.kind=="string"}function ai(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ai=function(r){return typeof r}:ai=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},ai(t)}var Yu=10,bs=2;function un(t){return oi(t,[])}function oi(t,e){switch(ai(t)){case"string":return JSON.stringify(t);case"function":return t.name?"[function ".concat(t.name,"]"):"[function]";case"object":return t===null?"null":Xu(t,e);default:return String(t)}}function Xu(t,e){if(e.indexOf(t)!==-1)return"[Circular]";var r=[].concat(e,[t]),n=tl(t);if(n!==void 0){var i=n.call(t);if(i!==t)return typeof i=="string"?i:oi(i,r)}else if(Array.isArray(t))return el(t,r);return Zu(t,r)}function Zu(t,e){var r=Object.keys(t);if(r.length===0)return"{}";if(e.length>bs)return"["+rl(t)+"]";var n=r.map(function(i){var a=oi(t[i],e);return i+": "+a});return"{ "+n.join(", ")+" }"}function el(t,e){if(t.length===0)return"[]";if(e.length>bs)return"[Array]";for(var r=Math.min(Yu,t.length),n=t.length-r,i=[],a=0;a<r;++a)i.push(oi(t[a],e));return n===1?i.push("... 1 more item"):n>1&&i.push("... ".concat(n," more items")),"["+i.join(", ")+"]"}function tl(t){var e=t[String(cn)];if(typeof e=="function")return e;if(typeof t.inspect=="function")return t.inspect}function rl(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 ln(t,e){var r=Boolean(t);if(!r)throw new Error(e)}function Ss(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 nl(t,e,r){return e&&Ss(t.prototype,e),r&&Ss(t,r),t}var si=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"||ln(0,"Body must be a string. Received: ".concat(un(e),".")),this.body=e,this.name=r,this.locationOffset=n,this.locationOffset.line>0||ln(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||ln(0,"column in locationOffset is 1-indexed and must be positive.")}return nl(t,[{key:ys,get:function(){return"Source"}}]),t}();function ws(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 Ae=(t,e,r)=>new Promise((n,i)=>{var a=c=>{try{s(r.next(c))}catch(u){i(u)}},o=c=>{try{s(r.throw(c))}catch(u){i(u)}},s=c=>c.done?n(c.value):Promise.resolve(c.value).then(a,o);s((r=r.apply(t,e)).next())});var wa=function(t,e){return wa=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])},wa(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");wa(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var h=function(){return h=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},h.apply(this,arguments)};function dt(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 tt(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(l){try{u(n.next(l))}catch(p){o(p)}}function c(l){try{u(n.throw(l))}catch(p){o(p)}}function u(l){l.done?a(l.value):i(l.value).then(s,c)}u((n=n.apply(t,e||[])).next())})}function rt(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(u){return function(l){return c([u,l])}}function c(u){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(r=0)),r;)try{if(n=1,i&&(a=u[0]&2?i.return:u[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,u[1])).done)return a;switch(i=0,a&&(u=[u[0]&2,a.value]),u[0]){case 0:case 1:a=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,i=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){r.label=u[1];break}if(u[0]===6&&r.label<a[1]){r.label=a[1],a=u;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(u);break}a[2]&&r.ops.pop(),r.trys.pop();continue}u=e.call(t,r)}catch(l){u=[6,l],i=0}finally{n=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function At(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 _a="Invariant Violation",ls=Object.setPrototypeOf,Ku=ls===void 0?function(t,e){return t.__proto__=e,t}:ls,M=function(t){de(e,t);function e(r){r===void 0&&(r=_a);var n=t.call(this,typeof r=="number"?_a+": "+r+" (see https://github.com/apollographql/invariant-packages)":r)||this;return n.framesToPop=1,n.name=_a,Ku(n,e.prototype),n}return e}(Error);function I(t,e){if(!t)throw new M(e)}var ei=["debug","log","warn","error","silent"],Ea=ei.indexOf("log");function Zn(t){return function(){if(ei.indexOf(t)>=Ea){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[Ea];return Ea=Math.max(0,ei.indexOf(t)),e}function _e(t){try{return t()}catch{}}var ti=_e(function(){return globalThis})||_e(function(){return window})||_e(function(){return self})||_e(function(){return global})||_e(function(){return _e.constructor("return this")()});var ps="__",ds=[ps,ps].join("DEV");function zu(){try{return Boolean(__DEV__)}catch{return Object.defineProperty(ti,ds,{value:_e(function(){return"production"})!=="production",enumerable:!1,configurable:!0,writable:!0}),ti[ds]}}var Yt=zu();function Pt(t){try{return t()}catch{}}var Oa=Pt(function(){return globalThis})||Pt(function(){return window})||Pt(function(){return self})||Pt(function(){return global})||Pt(function(){return Pt.constructor("return this")()}),Ta=!1;function Ju(){Oa&&!Pt(function(){return"production"})&&!Pt(function(){return process})&&(Object.defineProperty(Oa,"process",{value:{env:{NODE_ENV:"production"}},configurable:!0,enumerable:!1,writable:!0}),Ta=!0)}Ju();function xa(){Ta&&(delete Oa.process,Ta=!1)}var ld=typeof Symbol=="function"&&Symbol.iterator!=null?Symbol.iterator:"@@iterator",fd=typeof Symbol=="function"&&Symbol.asyncIterator!=null?Symbol.asyncIterator:"@@asyncIterator",hs=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 Ia(t,e){var r=Boolean(t);if(!r)throw new Error(e??"Unexpected invariant triggered.")}var Hu=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):void 0,cn=Hu;function ri(t){var e=t.prototype.toJSON;typeof e=="function"||Ia(0),t.prototype.inspect=e,cn&&(t.prototype[cn]=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,c){this.kind=r,this.start=n,this.end=i,this.line=a,this.column=o,this.value=c,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 Da(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 Yu=10,gs=2;function un(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":Xu(t,e);default:return String(t)}}function Xu(t,e){if(e.indexOf(t)!==-1)return"[Circular]";var r=[].concat(e,[t]),n=tl(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 el(t,r);return Zu(t,r)}function Zu(t,e){var r=Object.keys(t);if(r.length===0)return"{}";if(e.length>gs)return"["+rl(t)+"]";var n=r.map(function(i){var a=ii(t[i],e);return i+": "+a});return"{ "+n.join(", ")+" }"}function el(t,e){if(t.length===0)return"[]";if(e.length>gs)return"[Array]";for(var r=Math.min(Yu,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 tl(t){var e=t[String(cn)];if(typeof e=="function")return e;if(typeof t.inspect=="function")return t.inspect}function rl(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 ln(t,e){var r=Boolean(t);if(!r)throw new Error(e)}function vs(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 nl(t,e,r){return e&&vs(t.prototype,e),r&&vs(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"||ln(0,"Body must be a string. Received: ".concat(un(e),".")),this.body=e,this.name=r,this.locationOffset=n,this.locationOffset.line>0||ln(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||ln(0,"column in locationOffset is 1-indexed and must be positive.")}return nl(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(`
2
2
  `)===-1,i=t[0]===" "||t[0]===" ",a=t[t.length-1]==='"',o=t[t.length-1]==="\\",s=!n||a||o||r,c="";return s&&!(n&&i)&&(c+=`
3
3
  `+e),c+=e?t.replace(/\n/g,`
4
4
  `+e):t,s&&(c+=`
5
- `),'"""'+c.replace(/"""/g,'\\"""')+'"""'}var il={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"]},Xt=Object.freeze({});function ke(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:il,n=void 0,i=Array.isArray(t),a=[t],o=-1,s=[],c=void 0,u=void 0,l=void 0,p=[],d=[],f=t;do{o++;var m=o===a.length,y=m&&s.length!==0;if(m){if(u=d.length===0?void 0:p[p.length-1],c=l,l=d.pop(),y){if(i)c=c.slice();else{for(var b={},E=0,v=Object.keys(c);E<v.length;E++){var S=v[E];b[S]=c[S]}c=b}for(var O=0,k=0;k<s.length;k++){var N=s[k][0],D=s[k][1];i&&(N-=O),i&&D===null?(c.splice(N,1),O++):c[N]=D}}o=n.index,a=n.keys,s=n.edits,i=n.inArray,n=n.prev}else{if(u=l?i?o:a[o]:void 0,c=l?l[u]:f,c==null)continue;l&&p.push(u)}var C=void 0;if(!Array.isArray(c)){if(!ka(c))throw new Error("Invalid AST Node: ".concat(un(c),"."));var te=Na(e,c.kind,m);if(te){if(C=te.call(e,c,u,l,p,d),C===Xt)break;if(C===!1){if(!m){p.pop();continue}}else if(C!==void 0&&(s.push([u,C]),!m))if(ka(C))c=C;else{p.pop();continue}}}if(C===void 0&&y&&s.push([u,c]),m)p.pop();else{var X;n={inArray:i,index:o,keys:a,edits:s,prev:n},i=Array.isArray(c),a=i?c:(X=r[c.kind])!==null&&X!==void 0?X:[],o=-1,s=[],l&&d.push(l),l=c}}while(n!==void 0);return s.length!==0&&(f=s[s.length-1][1]),f}function Na(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 kr(t){return ke(t,{leave:ol})}var al=80,ol={Name:function(e){return e.value},Variable:function(e){return"$"+e.name},Document:function(e){return A(e.definitions,`
5
+ `),'"""'+c.replace(/"""/g,'\\"""')+'"""'}var il={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"]},Xt=Object.freeze({});function ke(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:il,n=void 0,i=Array.isArray(t),a=[t],o=-1,s=[],c=void 0,u=void 0,l=void 0,p=[],d=[],f=t;do{o++;var m=o===a.length,y=m&&s.length!==0;if(m){if(u=d.length===0?void 0:p[p.length-1],c=l,l=d.pop(),y){if(i)c=c.slice();else{for(var b={},E=0,v=Object.keys(c);E<v.length;E++){var S=v[E];b[S]=c[S]}c=b}for(var O=0,k=0;k<s.length;k++){var N=s[k][0],D=s[k][1];i&&(N-=O),i&&D===null?(c.splice(N,1),O++):c[N]=D}}o=n.index,a=n.keys,s=n.edits,i=n.inArray,n=n.prev}else{if(u=l?i?o:a[o]:void 0,c=l?l[u]:f,c==null)continue;l&&p.push(u)}var C=void 0;if(!Array.isArray(c)){if(!Da(c))throw new Error("Invalid AST Node: ".concat(un(c),"."));var te=ka(e,c.kind,m);if(te){if(C=te.call(e,c,u,l,p,d),C===Xt)break;if(C===!1){if(!m){p.pop();continue}}else if(C!==void 0&&(s.push([u,C]),!m))if(Da(C))c=C;else{p.pop();continue}}}if(C===void 0&&y&&s.push([u,c]),m)p.pop();else{var Y;n={inArray:i,index:o,keys:a,edits:s,prev:n},i=Array.isArray(c),a=i?c:(Y=r[c.kind])!==null&&Y!==void 0?Y:[],o=-1,s=[],l&&d.push(l),l=c}}while(n!==void 0);return s.length!==0&&(f=s[s.length-1][1]),f}function ka(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 kr(t){return ke(t,{leave:ol})}var al=80,ol={Name:function(e){return e.value},Variable:function(e){return"$"+e.name},Document:function(e){return A(e.definitions,`
6
6
 
7
7
  `)+`
8
8
  `},OperationDefinition:function(e){var r=e.operation,n=e.name,i=ue("(",A(e.variableDefinitions,", "),")"),a=A(e.directives," "),o=e.selectionSet;return!n&&!a&&!i&&r==="query"?o:A([r,A([n,i]),a,o]," ")},VariableDefinition:function(e){var r=e.variable,n=e.type,i=e.defaultValue,a=e.directives;return r+": "+n+ue(" = ",i)+ue(" ",A(a," "))},SelectionSet:function(e){var r=e.selections;return it(r)},Field:function(e){var r=e.alias,n=e.name,i=e.arguments,a=e.directives,o=e.selectionSet,s=ue("",r,": ")+n,c=s+ue("(",A(i,", "),")");return c.length>al&&(c=s+ue(`(
9
- `,ci(A(i,`
9
+ `,oi(A(i,`
10
10
  `)),`
11
- )`)),A([c,A(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+ue(" ",A(n," "))},InlineFragment:function(e){var r=e.typeCondition,n=e.directives,i=e.selectionSet;return A(["...",ue("on ",r),A(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(ue("(",A(i,", "),")")," ")+"on ".concat(n," ").concat(ue("",A(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?ws(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"["+A(r,", ")+"]"},ObjectValue:function(e){var r=e.fields;return"{"+A(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+ue("(",A(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:nt(function(t){var e=t.directives,r=t.operationTypes;return A(["schema",A(e," "),it(r)]," ")}),OperationTypeDefinition:function(e){var r=e.operation,n=e.type;return r+": "+n},ScalarTypeDefinition:nt(function(t){var e=t.name,r=t.directives;return A(["scalar",e,A(r," ")]," ")}),ObjectTypeDefinition:nt(function(t){var e=t.name,r=t.interfaces,n=t.directives,i=t.fields;return A(["type",e,ue("implements ",A(r," & ")),A(n," "),it(i)]," ")}),FieldDefinition:nt(function(t){var e=t.name,r=t.arguments,n=t.type,i=t.directives;return e+(_s(r)?ue(`(
12
- `,ci(A(r,`
11
+ )`)),A([c,A(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+ue(" ",A(n," "))},InlineFragment:function(e){var r=e.typeCondition,n=e.directives,i=e.selectionSet;return A(["...",ue("on ",r),A(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(ue("(",A(i,", "),")")," ")+"on ".concat(n," ").concat(ue("",A(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"["+A(r,", ")+"]"},ObjectValue:function(e){var r=e.fields;return"{"+A(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+ue("(",A(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:nt(function(t){var e=t.directives,r=t.operationTypes;return A(["schema",A(e," "),it(r)]," ")}),OperationTypeDefinition:function(e){var r=e.operation,n=e.type;return r+": "+n},ScalarTypeDefinition:nt(function(t){var e=t.name,r=t.directives;return A(["scalar",e,A(r," ")]," ")}),ObjectTypeDefinition:nt(function(t){var e=t.name,r=t.interfaces,n=t.directives,i=t.fields;return A(["type",e,ue("implements ",A(r," & ")),A(n," "),it(i)]," ")}),FieldDefinition:nt(function(t){var e=t.name,r=t.arguments,n=t.type,i=t.directives;return e+(Ss(r)?ue(`(
12
+ `,oi(A(r,`
13
13
  `)),`
14
- )`):ue("(",A(r,", "),")"))+": "+n+ue(" ",A(i," "))}),InputValueDefinition:nt(function(t){var e=t.name,r=t.type,n=t.defaultValue,i=t.directives;return A([e+": "+r,ue("= ",n),A(i," ")]," ")}),InterfaceTypeDefinition:nt(function(t){var e=t.name,r=t.interfaces,n=t.directives,i=t.fields;return A(["interface",e,ue("implements ",A(r," & ")),A(n," "),it(i)]," ")}),UnionTypeDefinition:nt(function(t){var e=t.name,r=t.directives,n=t.types;return A(["union",e,A(r," "),n&&n.length!==0?"= "+A(n," | "):""]," ")}),EnumTypeDefinition:nt(function(t){var e=t.name,r=t.directives,n=t.values;return A(["enum",e,A(r," "),it(n)]," ")}),EnumValueDefinition:nt(function(t){var e=t.name,r=t.directives;return A([e,A(r," ")]," ")}),InputObjectTypeDefinition:nt(function(t){var e=t.name,r=t.directives,n=t.fields;return A(["input",e,A(r," "),it(n)]," ")}),DirectiveDefinition:nt(function(t){var e=t.name,r=t.arguments,n=t.repeatable,i=t.locations;return"directive @"+e+(_s(r)?ue(`(
15
- `,ci(A(r,`
14
+ )`):ue("(",A(r,", "),")"))+": "+n+ue(" ",A(i," "))}),InputValueDefinition:nt(function(t){var e=t.name,r=t.type,n=t.defaultValue,i=t.directives;return A([e+": "+r,ue("= ",n),A(i," ")]," ")}),InterfaceTypeDefinition:nt(function(t){var e=t.name,r=t.interfaces,n=t.directives,i=t.fields;return A(["interface",e,ue("implements ",A(r," & ")),A(n," "),it(i)]," ")}),UnionTypeDefinition:nt(function(t){var e=t.name,r=t.directives,n=t.types;return A(["union",e,A(r," "),n&&n.length!==0?"= "+A(n," | "):""]," ")}),EnumTypeDefinition:nt(function(t){var e=t.name,r=t.directives,n=t.values;return A(["enum",e,A(r," "),it(n)]," ")}),EnumValueDefinition:nt(function(t){var e=t.name,r=t.directives;return A([e,A(r," ")]," ")}),InputObjectTypeDefinition:nt(function(t){var e=t.name,r=t.directives,n=t.fields;return A(["input",e,A(r," "),it(n)]," ")}),DirectiveDefinition:nt(function(t){var e=t.name,r=t.arguments,n=t.repeatable,i=t.locations;return"directive @"+e+(Ss(r)?ue(`(
15
+ `,oi(A(r,`
16
16
  `)),`
17
17
  )`):ue("(",A(r,", "),")"))+(n?" repeatable":"")+" on "+A(i," | ")}),SchemaExtension:function(e){var r=e.directives,n=e.operationTypes;return A(["extend schema",A(r," "),it(n)]," ")},ScalarTypeExtension:function(e){var r=e.name,n=e.directives;return A(["extend scalar",r,A(n," ")]," ")},ObjectTypeExtension:function(e){var r=e.name,n=e.interfaces,i=e.directives,a=e.fields;return A(["extend type",r,ue("implements ",A(n," & ")),A(i," "),it(a)]," ")},InterfaceTypeExtension:function(e){var r=e.name,n=e.interfaces,i=e.directives,a=e.fields;return A(["extend interface",r,ue("implements ",A(n," & ")),A(i," "),it(a)]," ")},UnionTypeExtension:function(e){var r=e.name,n=e.directives,i=e.types;return A(["extend union",r,A(n," "),i&&i.length!==0?"= "+A(i," | "):""]," ")},EnumTypeExtension:function(e){var r=e.name,n=e.directives,i=e.values;return A(["extend enum",r,A(n," "),it(i)]," ")},InputObjectTypeExtension:function(e){var r=e.name,n=e.directives,i=e.fields;return A(["extend input",r,A(n," "),it(i)]," ")}};function nt(t){return function(e){return A([e.description,t(e)],`
18
18
  `)}}function A(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 it(t){return ue(`{
19
- `,ci(A(t,`
19
+ `,oi(A(t,`
20
20
  `)),`
21
- }`)}function ue(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";return e!=null&&e!==""?t+e+r:""}function ci(t){return ue(" ",t.replace(/\n/g,`
21
+ }`)}function ue(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";return e!=null&&e!==""?t+e+r:""}function oi(t){return ue(" ",t.replace(/\n/g,`
22
22
  `))}function sl(t){return t.indexOf(`
23
- `)!==-1}function _s(t){return t!=null&&t.some(sl)}function fn(t){return t.kind===ve.FIELD||t.kind===ve.FRAGMENT_SPREAD||t.kind===ve.INLINE_FRAGMENT}function Es(){return typeof si=="function"?Ia():Ia()}function gl(){__DEV__?I(typeof Yt=="boolean",Yt):I(typeof Yt=="boolean",39)}Es();gl();function wt(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 Nr(t,e,r){var n=new Set(t),i=n.size;return ke(e,{Directive:function(a){if(n.delete(a.name.value)&&(!r||!n.size))return Xt}}),r?!n.size:n.size<i}function Aa(t){return t&&Nr(["client","export"],t,!0)}function vl(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(!!vl(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 Pa(t,e){var r=e,n=[];t.definitions.forEach(function(a){if(a.kind==="OperationDefinition")throw __DEV__?new M("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 M(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=h(h({},t),{definitions:At([{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:r}}]}}],t.definitions,!0)});return i}function Zt(t){t===void 0&&(t=[]);var e={};return t.forEach(function(r){e[r.name.value]=r}),e}function er(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 ht(t){return{__ref:String(t)}}function G(t){return Boolean(t&&typeof t=="object"&&typeof t.__ref=="string")}function Ca(t){return z(t)&&t.kind==="Document"&&Array.isArray(t.definitions)}function bl(t){return t.kind==="StringValue"}function Sl(t){return t.kind==="BooleanValue"}function wl(t){return t.kind==="IntValue"}function _l(t){return t.kind==="FloatValue"}function El(t){return t.kind==="Variable"}function Ol(t){return t.kind==="ObjectValue"}function Tl(t){return t.kind==="ListValue"}function xl(t){return t.kind==="EnumValue"}function Il(t){return t.kind==="NullValue"}function Ct(t,e,r,n){if(wl(r)||_l(r))t[e.value]=Number(r.value);else if(Sl(r)||bl(r))t[e.value]=r.value;else if(Ol(r)){var i={};r.fields.map(function(o){return Ct(i,o.name,o.value,n)}),t[e.value]=i}else if(El(r)){var a=(n||{})[r.name.value];t[e.value]=a}else if(Tl(r))t[e.value]=r.values.map(function(o){var s={};return Ct(s,e,o,n),s[e.value]});else if(xl(r))t[e.value]=r.value;else if(Il(r))t[e.value]=null;else throw __DEV__?new M('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 M(55)}function Ra(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 Ct(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 Ct(n,a,o,e)})),dn(t.name.value,n,r)}var Dl=["connection","include","skip","client","rest","export"],dn=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(pn(i),")")}else return r.connection.key;var a=t;if(e){var o=pn(e);a+="(".concat(o,")")}return r&&Object.keys(r).forEach(function(s){Dl.indexOf(s)===-1&&(r[s]&&Object.keys(r[s]).length?a+="@".concat(s,"(").concat(pn(r[s]),")"):a+="@".concat(s))}),a},{setStringify:function(t){var e=pn;return pn=t,e}}),pn=function(e){return JSON.stringify(e,kl)};function kl(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 _t(t,e){if(t.arguments&&t.arguments.length){var r={};return t.arguments.forEach(function(n){var i=n.name,a=n.value;return Ct(r,i,a,e)}),r}return null}function Ye(t){return t.alias?t.alias.value:t.name.value}function hn(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(Ge(a)){if(a.name.value==="__typename")return t[Ye(a)]}else{var o=hn(t,er(a,r).selectionSet,r);if(typeof o=="string")return o}}}function Ge(t){return t.kind==="Field"}function La(t){return t.kind==="InlineFragment"}function Ar(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 M('Schema type definitions not allowed in queries. Found: "'.concat(r.kind,'"')):new M(48);return r});return __DEV__?I(e.length<=1,"Ambiguous GraphQL document: contains ".concat(e.length," operations")):I(e.length<=1,49),t}function mt(t){return Ar(t),t.definitions.filter(function(e){return e.kind==="OperationDefinition"})[0]}function Pr(t){return t.definitions.filter(function(e){return e.kind==="OperationDefinition"&&!!e.name}).map(function(e){return e.name.value})[0]||null}function tr(t){return t.definitions.filter(function(e){return e.kind==="FragmentDefinition"})}function mn(t){var e=mt(t);return __DEV__?I(e&&e.operation==="query","Must contain a query definition."):I(e&&e.operation==="query",50),e}function Fa(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 rr(t){Ar(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 M("Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment."):new M(54)}function nr(t){var e=Object.create(null),r=t&&t.variableDefinitions;return r&&r.length&&r.forEach(function(n){n.defaultValue&&Ct(e,n.variable.name,n.defaultValue)}),e}var re=Array.isArray;function Se(t){return Array.isArray(t)&&t.length>0}var Ts={kind:ve.FIELD,name:{kind:ve.NAME,value:"__typename"}};function Is(t,e){return!t||t.selectionSet.selections.every(function(r){return r.kind===ve.FRAGMENT_SPREAD&&Is(e[r.name.value],e)})}function Nl(t){return Is(mt(t)||Fa(t),Zt(tr(t)))?null:t}function Al(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 Ma(t,e){for(var r=xs(""),n=xs(""),i=function(v){for(var S=0,O=void 0;S<v.length&&(O=v[S]);++S)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=Al(t),c=t.some(function(v){return v.remove}),u=function(v){return c&&v&&v.some(s)},l=new Map,p=!1,d={enter:function(v){if(u(v.directives))return p=!0,null}},f=ke(e,{Field:d,InlineFragment:d,VariableDefinition:{enter:function(){return!1}},Variable:{enter:function(v,S,O,k,N){var D=i(N);D&&D.variables.add(v.name.value)}},FragmentSpread:{enter:function(v,S,O,k,N){if(u(v.directives))return p=!0,null;var D=i(N);D&&D.fragmentSpreads.add(v.name.value)}},FragmentDefinition:{enter:function(v,S,O,k){l.set(JSON.stringify(k),v)},leave:function(v,S,O,k){var N=l.get(JSON.stringify(k));if(v===N)return v;if(a>0&&v.selectionSet.selections.every(function(D){return D.kind===ve.FIELD&&D.name.value==="__typename"}))return n(v.name.value).removed=!0,p=!0,null}},Directive:{leave:function(v){if(s(v))return p=!0,null}}});if(!p)return e;var m=function(v){return v.transitiveVars||(v.transitiveVars=new Set(v.variables),v.removed||v.fragmentSpreads.forEach(function(S){m(n(S)).transitiveVars.forEach(function(O){v.transitiveVars.add(O)})})),v},y=new Set;f.definitions.forEach(function(v){v.kind===ve.OPERATION_DEFINITION?m(r(v.name&&v.name.value)).fragmentSpreads.forEach(function(S){y.add(S)}):v.kind===ve.FRAGMENT_DEFINITION&&a===0&&!n(v.name.value).removed&&y.add(v.name.value)}),y.forEach(function(v){m(n(v)).fragmentSpreads.forEach(function(S){y.add(S)})});var b=function(v){return!!(!y.has(v)||n(v).removed)},E={enter:function(v){if(b(v.name.value))return null}};return Nl(ke(f,{FragmentSpread:E,FragmentDefinition:E,OperationDefinition:{leave:function(v){if(v.variableDefinitions){var S=m(r(v.name&&v.name.value)).transitiveVars;if(S.size<v.variableDefinitions.length)return h(h({},v),{variableDefinitions:v.variableDefinitions.filter(function(O){return S.has(O.variable.name.value)})})}}}}))}var ir=Object.assign(function(t){return ke(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 Ge(s)&&(s.name.value==="__typename"||s.name.value.lastIndexOf("__",0)===0)});if(!a){var o=n;if(!(Ge(o)&&o.directives&&o.directives.some(function(s){return s.name.value==="export"})))return h(h({},e),{selections:At(At([],i,!0),[Ts],!1)})}}}}}})},{added:function(t){return t===Ts}}),Pl={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 ja(t){return Ma([Pl],Ar(t))}function $a(t){var e=rr(t),r=e.operation;if(r==="query")return t;var n=ke(t,{OperationDefinition:{enter:function(i){return h(h({},i),{operation:"query"})}}});return n}function Ua(t){Ar(t);var e=Ma([{test:function(r){return r.name.value==="client"},remove:!0}],t);return e}var Cl=Object.prototype.hasOwnProperty;function qa(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return yn(t)}function yn(t){var e=t[0]||{},r=t.length;if(r>1)for(var n=new $e,i=1;i<r;++i)e=n.merge(e,t[i]);return e}var Rl=function(t,e,r){return this.merge(t[r],e[r])},$e=function(){function t(e){e===void 0&&(e=Rl),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(Cl.call(e,o)){var s=e[o];if(r[o]!==s){var c=n.reconciler.apply(n,At([e,r,o],i,!1));c!==s&&(e=n.shallowCopyForMerge(e),e[o]=c)}}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=h({__proto__:Object.getPrototypeOf(e)},e),this.pastCopies.add(e))),e},t}();function Ll(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=Fl(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 Fl(t,e){if(!!t){if(typeof t=="string")return Ds(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 Ds(t,e)}}function Ds(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 ks(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 Ga(t,e,r){return e&&ks(t.prototype,e),r&&ks(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}var Wa=function(){return typeof Symbol=="function"},Ka=function(t){return Wa()&&Boolean(Symbol[t])},za=function(t){return Ka(t)?Symbol[t]:"@@"+t};Wa()&&!Ka("observable")&&(Symbol.observable=Symbol("observable"));var Ml=za("iterator"),Ba=za("observable"),Ns=za("species");function li(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[Ns],e===null&&(e=void 0)),e!==void 0?e:V}function jl(t){return t instanceof V}function Cr(t){Cr.log?Cr.log(t):setTimeout(function(){throw t})}function ui(t){Promise.resolve().then(function(){try{t()}catch(e){Cr(e)}})}function As(t){var e=t._cleanup;if(e!==void 0&&(t._cleanup=void 0,!!e))try{if(typeof e=="function")e();else{var r=li(e,"unsubscribe");r&&r.call(e)}}catch(n){Cr(n)}}function Qa(t){t._observer=void 0,t._queue=void 0,t._state="closed"}function $l(t){var e=t._queue;if(!!e){t._queue=void 0,t._state="ready";for(var r=0;r<e.length&&(Ps(t,e[r].type,e[r].value),t._state!=="closed");++r);}}function Ps(t,e,r){t._state="running";var n=t._observer;try{var i=li(n,e);switch(e){case"next":i&&i.call(n,r);break;case"error":if(Qa(t),i)i.call(n,r);else throw r;break;case"complete":Qa(t),i&&i.call(n);break}}catch(a){Cr(a)}t._state==="closed"?As(t):t._state==="running"&&(t._state="ready")}function Va(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}],ui(function(){return $l(t)});return}Ps(t,e,r)}}var Ul=function(){function t(r,n){this._cleanup=void 0,this._observer=r,this._queue=void 0,this._state="initializing";var i=new ql(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"&&(Qa(this),As(this))},Ga(t,[{key:"closed",get:function(){return this._state==="closed"}}]),t}(),ql=function(){function t(r){this._subscription=r}var e=t.prototype;return e.next=function(n){Va(this._subscription,"next",n)},e.error=function(n){Va(this._subscription,"error",n)},e.complete=function(){Va(this._subscription,"complete")},Ga(t,[{key:"closed",get:function(){return this._subscription._state==="closed"}}]),t}(),V=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 Ul(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(){c.unsubscribe(),a()}var c=i.subscribe({next:function(u){try{n(u,s)}catch(l){o(l),c.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(c){return o.error(c)}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(c){return o.error(c)}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,c=arguments[1],u=c;return new a(function(l){return i.subscribe({next:function(p){var d=!s;if(s=!0,!d||o)try{u=n(u,p)}catch(f){return l.error(f)}else u=p},error:function(p){l.error(p)},complete:function(){if(!s&&!o)return l.error(new TypeError("Cannot reduce an empty sequence"));l.next(u),l.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(c){var u,l=0;function p(d){u=d.subscribe({next:function(f){c.next(f)},error:function(f){c.error(f)},complete:function(){l===a.length?(u=void 0,c.complete()):p(s.from(a[l++]))}})}return p(n),function(){u&&(u.unsubscribe(),u=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=[],c=i.subscribe({next:function(l){if(n)try{l=n(l)}catch(d){return o.error(d)}var p=a.from(l).subscribe({next:function(d){o.next(d)},error:function(d){o.error(d)},complete:function(){var d=s.indexOf(p);d>=0&&s.splice(d,1),u()}});s.push(p)},error:function(l){o.error(l)},complete:function(){u()}});function u(){c.closed&&s.length===0&&o.complete()}return function(){s.forEach(function(l){return l.unsubscribe()}),c.unsubscribe()}})},e[Ba]=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=li(n,Ba);if(a){var o=a.call(n);if(Object(o)!==o)throw new TypeError(o+" is not an object");return jl(o)&&o.constructor===i?o:new i(function(s){return o.subscribe(s)})}if(Ka("iterator")&&(a=li(n,Ml),a))return new i(function(s){ui(function(){if(!s.closed){for(var c=Ll(a.call(n)),u;!(u=c()).done;){var l=u.value;if(s.next(l),s.closed)return}s.complete()}})});if(Array.isArray(n))return new i(function(s){ui(function(){if(!s.closed){for(var c=0;c<n.length;++c)if(s.next(n[c]),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){ui(function(){if(!s.closed){for(var c=0;c<i.length;++c)if(s.next(i[c]),s.closed)return;s.complete()}})})},Ga(t,null,[{key:Ns,get:function(){return this}}]),t}();Wa()&&Object.defineProperty(V,Symbol("extensions"),{value:{symbol:Ba,hostReportError:Cr},configurable:!0});function Ja(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 Rr;typeof self<"u"?Rr=self:typeof window<"u"?Rr=window:typeof global<"u"?Rr=global:typeof module<"u"?Rr=module:Rr=Function("return this")();var jh=Ja(Rr);var Cs=V.prototype,Rs="@@observable";Cs[Rs]||(Cs[Rs]=function(){return this});var Vl=Object.prototype.toString;function fi(t){return Ha(t)}function Ha(t,e){switch(Vl.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]=Ha(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]=Ha(t[i],e)}),n}default:return t}}function Bl(t){var e=new Set([t]);return e.forEach(function(r){z(r)&&Ql(r)===r&&Object.getOwnPropertyNames(r).forEach(function(n){z(r[n])&&e.add(r[n])})}),t}function Ql(t){if(__DEV__&&!Object.isFrozen(t))try{Object.freeze(t)}catch(e){if(e instanceof TypeError)return null;throw e}return t}function vn(t){return __DEV__&&Bl(t),t}function ar(t,e,r){var n=[];t.forEach(function(i){return i[e]&&n.push(i)}),n.forEach(function(i){return i[e](r)})}function pi(t,e,r){return new V(function(n){var i=n.next,a=n.error,o=n.complete,s=0,c=!1,u={then:function(f){return new Promise(function(m){return m(f())})}};function l(f,m){return f?function(y){++s;var b=function(){return f(y)};u=u.then(b,b).then(function(E){--s,i&&i.call(n,E),c&&p.complete()},function(E){throw--s,E}).catch(function(E){a&&a.call(n,E)})}:function(y){return m&&m.call(n,y)}}var p={next:l(e,i),error:l(r,a),complete:function(){c=!0,s||o&&o.call(n)}},d=t.subscribe(p);return function(){return d.unsubscribe()}})}var Xe=typeof WeakMap=="function"&&_e(function(){return navigator.product})!=="ReactNative",Ls=typeof WeakSet=="function",Ya=typeof Symbol=="function"&&typeof Symbol.for=="function",Rt=Ya&&Symbol.asyncIterator,Yh=typeof _e(function(){return window.document.createElement})=="function",Xh=_e(function(){return navigator.userAgent.indexOf("jsdom")>=0})||!1;function di(t){function e(r){Object.defineProperty(t,r,{value:V})}return Ya&&Symbol.species&&e(Symbol.species),e("@@species"),t}function Fs(t){return t&&typeof t.then=="function"}var Lr=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),ar(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),ar(n.observers,"error",i))},complete:function(){var i=n,a=i.sub,o=i.sources,s=o===void 0?[]:o;if(a!==null){var c=s.shift();c?Fs(c)?c.then(function(u){return n.sub=u.subscribe(n.handlers)}):n.sub=c.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"),ar(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 V(r)]),Fs(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}(V);di(Lr);function Lt(t){return"incremental"in t}function Gl(t){return"hasNext"in t&&"data"in t}function Ms(t){return Lt(t)||Gl(t)}function hi(t,e){var r=t,n=new $e;return Lt(e)&&Se(e.incremental)&&e.incremental.forEach(function(i){for(var a=i.data,o=i.path,s=o.length-1;s>=0;--s){var c=o[s],u=!isNaN(+c),l=u?[]:{};l[c]=a,a=l}r=n.merge(r,a)}),r}function Fr(t){var e=mi(t);return Se(e)}function mi(t){var e=Se(t.errors)?t.errors.slice(0):[];return Lt(t)&&Se(t.incremental)&&t.incremental.forEach(function(r){r.errors&&e.push.apply(e,r.errors)}),e}function Ft(){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 js=new Map;function bn(t){var e=js.get(t)||1;return js.set(t,e+1),"".concat(t,":").concat(e,":").concat(Math.random().toString(36).slice(2))}function $s(t){var e=bn("stringifyForDisplay");return JSON.stringify(t,function(r,n){return n===void 0?e:n}).split(JSON.stringify(e)).join("<undefined>")}function Sn(t,e){return Ft(t,e,e.variables&&{variables:h(h({},t&&t.variables),e.variables)})}function yi(t){return new V(function(e){e.error(t)})}var wn=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 Xa(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 M("illegal argument: ".concat(i)):new M(27)}return t}function Za(t,e){var r=h({},t),n=function(a){typeof a=="function"?r=h(h({},r),a(r)):r=h(h({},r),a)},i=function(){return h({},r)};return Object.defineProperty(e,"setContext",{enumerable:!1,value:n}),Object.defineProperty(e,"getContext",{enumerable:!1,value:i}),e}function eo(t){var e={variables:t.variables||{},extensions:t.extensions||{},operationName:t.operationName,query:t.query};return e.operationName||(e.operationName=typeof e.query!="string"?Pr(e.query)||void 0:""),e}function Us(t,e){return e?e(t):V.of()}function _n(t){return typeof t=="function"?new Ze(t):t}function gi(t){return t.request.length<=1}var Wl=function(t){de(e,t);function e(r,n){var i=t.call(this,r)||this;return i.link=n,i}return e}(Error),Ze=function(){function t(e){e&&(this.request=e)}return t.empty=function(){return new t(function(){return V.of()})},t.from=function(e){return e.length===0?t.empty():e.map(_n).reduce(function(r,n){return r.concat(n)})},t.split=function(e,r,n){var i=_n(r),a=_n(n||new t(Us));return gi(i)&&gi(a)?new t(function(o){return e(o)?i.request(o)||V.of():a.request(o)||V.of()}):new t(function(o,s){return e(o)?i.request(o,s)||V.of():a.request(o,s)||V.of()})},t.execute=function(e,r){return e.request(Za(r.context,eo(Xa(r))))||V.of()},t.concat=function(e,r){var n=_n(e);if(gi(n))return __DEV__&&I.warn(new Wl("You are calling concat on a terminating link, which will have no effect",n)),n;var i=_n(r);return gi(i)?new t(function(a){return n.request(a,function(o){return i.request(o)||V.of()})||V.of()}):new t(function(a,o){return n.request(a,function(s){return i.request(s,o)||V.of()})||V.of()})},t.prototype.split=function(e,r,n){return this.concat(t.split(e,r,n||new t(Us)))},t.prototype.concat=function(e){return t.concat(this,e)},t.prototype.request=function(e,r){throw __DEV__?new M("request is not implemented"):new M(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 Mr=Ze.execute;var qs="3.7.10";function Vs(t){return!!t.body}function Bs(t){return!!t.getReader}function Qs(t){return!!(Rt&&t[Symbol.asyncIterator])}function Gs(t){return!!t.stream}function Ws(t){return!!t.arrayBuffer}function Ks(t){return!!t.pipe}function to(t){var e,r=t[Symbol.asyncIterator]();return e={next:function(){return r.next()}},e[Symbol.asyncIterator]=function(){return this},e}function ro(t){var e=null,r=null,n=!1,i=[],a=[];function o(p){if(!r){if(a.length){var d=a.shift();if(Array.isArray(d)&&d[0])return d[0]({value:p,done:!1})}i.push(p)}}function s(p){r=p;var d=a.slice();d.forEach(function(f){f[1](p)}),!e||e()}function c(){n=!0;var p=a.slice();p.forEach(function(d){d[0]({value:void 0,done:!0})}),!e||e()}e=function(){e=null,t.removeListener("data",o),t.removeListener("error",s),t.removeListener("end",c),t.removeListener("finish",c),t.removeListener("close",c)},t.on("data",o),t.on("error",s),t.on("end",c),t.on("finish",c),t.on("close",c);function u(){return new Promise(function(p,d){if(r)return d(r);if(i.length)return p({value:i.shift(),done:!1});if(n)return p({value:void 0,done:!0});a.push([p,d])})}var l={next:function(){return u()}};return Rt&&(l[Symbol.asyncIterator]=function(){return this}),l}function no(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 Rt&&(r[Symbol.asyncIterator]=function(){return this}),r}function vi(t){var e={next:function(){return t.read()}};return Rt&&(e[Symbol.asyncIterator]=function(){return this}),e}function zs(t){var e=t;if(Vs(t)&&(e=t.body),Qs(e))return to(e);if(Bs(e))return vi(e.getReader());if(Gs(e))return vi(e.stream().getReader());if(Ws(e))return no(e.arrayBuffer());if(Ks(e))return ro(e);throw new Error("Unknown body type for responseIterator. Please pass a streamable response.")}var Js=Object.prototype.hasOwnProperty;function Hs(t,e){var r,n,i;return tt(this,void 0,void 0,function(){var a,o,s,c,u,l,p,d,f,m,y,b,E,v,S,O,k,N,D,C;return rt(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=",c=o?.includes(s)?o?.substring(o?.indexOf(s)+s.length).replace(/['"]/g,"").replace(/\;(.*)/gm,"").trim():"-",u="--".concat(c),l="",p=zs(t),d=!0,te.label=1;case 1:return d?[4,p.next()]:[3,3];case 2:for(f=te.sent(),m=f.value,y=f.done,b=typeof m=="string"?m:a.decode(m),d=!y,l+=b,E=l.indexOf(u);E>-1;){if(v=void 0,C=[l.slice(0,E),l.slice(E+u.length)],v=C[0],l=C[1],v.trim()){if(S=v.indexOf(`\r
23
+ `)!==-1}function Ss(t){return t!=null&&t.some(sl)}function fn(t){return t.kind===ve.FIELD||t.kind===ve.FRAGMENT_SPREAD||t.kind===ve.INLINE_FRAGMENT}function ws(){return typeof ai=="function"?xa():xa()}function gl(){__DEV__?I(typeof Yt=="boolean",Yt):I(typeof Yt=="boolean",39)}ws();gl();function wt(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 ke(e,{Directive:function(a){if(n.delete(a.name.value)&&(!r||!n.size))return Xt}}),r?!n.size:n.size<i}function Na(t){return t&&Nr(["client","export"],t,!0)}function vl(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(!!vl(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 M("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 M(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=h(h({},t),{definitions:At([{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:r}}]}}],t.definitions,!0)});return i}function Zt(t){t===void 0&&(t=[]);var e={};return t.forEach(function(r){e[r.name.value]=r}),e}function er(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 ht(t){return{__ref:String(t)}}function Q(t){return Boolean(t&&typeof t=="object"&&typeof t.__ref=="string")}function Pa(t){return K(t)&&t.kind==="Document"&&Array.isArray(t.definitions)}function bl(t){return t.kind==="StringValue"}function Sl(t){return t.kind==="BooleanValue"}function wl(t){return t.kind==="IntValue"}function _l(t){return t.kind==="FloatValue"}function El(t){return t.kind==="Variable"}function Ol(t){return t.kind==="ObjectValue"}function Tl(t){return t.kind==="ListValue"}function xl(t){return t.kind==="EnumValue"}function Il(t){return t.kind==="NullValue"}function Ct(t,e,r,n){if(wl(r)||_l(r))t[e.value]=Number(r.value);else if(Sl(r)||bl(r))t[e.value]=r.value;else if(Ol(r)){var i={};r.fields.map(function(o){return Ct(i,o.name,o.value,n)}),t[e.value]=i}else if(El(r)){var a=(n||{})[r.name.value];t[e.value]=a}else if(Tl(r))t[e.value]=r.values.map(function(o){var s={};return Ct(s,e,o,n),s[e.value]});else if(xl(r))t[e.value]=r.value;else if(Il(r))t[e.value]=null;else throw __DEV__?new M('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 M(55)}function Ca(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 Ct(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 Ct(n,a,o,e)})),dn(t.name.value,n,r)}var Dl=["connection","include","skip","client","rest","export"],dn=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(pn(i),")")}else return r.connection.key;var a=t;if(e){var o=pn(e);a+="(".concat(o,")")}return r&&Object.keys(r).forEach(function(s){Dl.indexOf(s)===-1&&(r[s]&&Object.keys(r[s]).length?a+="@".concat(s,"(").concat(pn(r[s]),")"):a+="@".concat(s))}),a},{setStringify:function(t){var e=pn;return pn=t,e}}),pn=function(e){return JSON.stringify(e,kl)};function kl(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 _t(t,e){if(t.arguments&&t.arguments.length){var r={};return t.arguments.forEach(function(n){var i=n.name,a=n.value;return Ct(r,i,a,e)}),r}return null}function Ye(t){return t.alias?t.alias.value:t.name.value}function hn(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(Ge(a)){if(a.name.value==="__typename")return t[Ye(a)]}else{var o=hn(t,er(a,r).selectionSet,r);if(typeof o=="string")return o}}}function Ge(t){return t.kind==="Field"}function Ra(t){return t.kind==="InlineFragment"}function Ar(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 M('Schema type definitions not allowed in queries. Found: "'.concat(r.kind,'"')):new M(48);return r});return __DEV__?I(e.length<=1,"Ambiguous GraphQL document: contains ".concat(e.length," operations")):I(e.length<=1,49),t}function mt(t){return Ar(t),t.definitions.filter(function(e){return e.kind==="OperationDefinition"})[0]}function Pr(t){return t.definitions.filter(function(e){return e.kind==="OperationDefinition"&&!!e.name}).map(function(e){return e.name.value})[0]||null}function tr(t){return t.definitions.filter(function(e){return e.kind==="FragmentDefinition"})}function mn(t){var e=mt(t);return __DEV__?I(e&&e.operation==="query","Must contain a query definition."):I(e&&e.operation==="query",50),e}function La(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 rr(t){Ar(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 M("Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment."):new M(54)}function nr(t){var e=Object.create(null),r=t&&t.variableDefinitions;return r&&r.length&&r.forEach(function(n){n.defaultValue&&Ct(e,n.variable.name,n.defaultValue)}),e}var re=Array.isArray;function Se(t){return Array.isArray(t)&&t.length>0}var Es={kind:ve.FIELD,name:{kind:ve.NAME,value:"__typename"}};function Ts(t,e){return!t||t.selectionSet.selections.every(function(r){return r.kind===ve.FRAGMENT_SPREAD&&Ts(e[r.name.value],e)})}function Nl(t){return Ts(mt(t)||La(t),Zt(tr(t)))?null:t}function Al(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 Os(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 Fa(t,e){for(var r=Os(""),n=Os(""),i=function(v){for(var S=0,O=void 0;S<v.length&&(O=v[S]);++S)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=Al(t),c=t.some(function(v){return v.remove}),u=function(v){return c&&v&&v.some(s)},l=new Map,p=!1,d={enter:function(v){if(u(v.directives))return p=!0,null}},f=ke(e,{Field:d,InlineFragment:d,VariableDefinition:{enter:function(){return!1}},Variable:{enter:function(v,S,O,k,N){var D=i(N);D&&D.variables.add(v.name.value)}},FragmentSpread:{enter:function(v,S,O,k,N){if(u(v.directives))return p=!0,null;var D=i(N);D&&D.fragmentSpreads.add(v.name.value)}},FragmentDefinition:{enter:function(v,S,O,k){l.set(JSON.stringify(k),v)},leave:function(v,S,O,k){var N=l.get(JSON.stringify(k));if(v===N)return v;if(a>0&&v.selectionSet.selections.every(function(D){return D.kind===ve.FIELD&&D.name.value==="__typename"}))return n(v.name.value).removed=!0,p=!0,null}},Directive:{leave:function(v){if(s(v))return p=!0,null}}});if(!p)return e;var m=function(v){return v.transitiveVars||(v.transitiveVars=new Set(v.variables),v.removed||v.fragmentSpreads.forEach(function(S){m(n(S)).transitiveVars.forEach(function(O){v.transitiveVars.add(O)})})),v},y=new Set;f.definitions.forEach(function(v){v.kind===ve.OPERATION_DEFINITION?m(r(v.name&&v.name.value)).fragmentSpreads.forEach(function(S){y.add(S)}):v.kind===ve.FRAGMENT_DEFINITION&&a===0&&!n(v.name.value).removed&&y.add(v.name.value)}),y.forEach(function(v){m(n(v)).fragmentSpreads.forEach(function(S){y.add(S)})});var b=function(v){return!!(!y.has(v)||n(v).removed)},E={enter:function(v){if(b(v.name.value))return null}};return Nl(ke(f,{FragmentSpread:E,FragmentDefinition:E,OperationDefinition:{leave:function(v){if(v.variableDefinitions){var S=m(r(v.name&&v.name.value)).transitiveVars;if(S.size<v.variableDefinitions.length)return h(h({},v),{variableDefinitions:v.variableDefinitions.filter(function(O){return S.has(O.variable.name.value)})})}}}}))}var ir=Object.assign(function(t){return ke(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 Ge(s)&&(s.name.value==="__typename"||s.name.value.lastIndexOf("__",0)===0)});if(!a){var o=n;if(!(Ge(o)&&o.directives&&o.directives.some(function(s){return s.name.value==="export"})))return h(h({},e),{selections:At(At([],i,!0),[Es],!1)})}}}}}})},{added:function(t){return t===Es}}),Pl={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 Ma(t){return Fa([Pl],Ar(t))}function ja(t){var e=rr(t),r=e.operation;if(r==="query")return t;var n=ke(t,{OperationDefinition:{enter:function(i){return h(h({},i),{operation:"query"})}}});return n}function $a(t){Ar(t);var e=Fa([{test:function(r){return r.name.value==="client"},remove:!0}],t);return e}var Cl=Object.prototype.hasOwnProperty;function Ua(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return yn(t)}function yn(t){var e=t[0]||{},r=t.length;if(r>1)for(var n=new $e,i=1;i<r;++i)e=n.merge(e,t[i]);return e}var Rl=function(t,e,r){return this.merge(t[r],e[r])},$e=function(){function t(e){e===void 0&&(e=Rl),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(Cl.call(e,o)){var s=e[o];if(r[o]!==s){var c=n.reconciler.apply(n,At([e,r,o],i,!1));c!==s&&(e=n.shallowCopyForMerge(e),e[o]=c)}}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=h({__proto__:Object.getPrototypeOf(e)},e),this.pastCopies.add(e))),e},t}();function Ll(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=Fl(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 Fl(t,e){if(!!t){if(typeof t=="string")return xs(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 xs(t,e)}}function xs(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 Qa(t,e,r){return e&&Is(t.prototype,e),r&&Is(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}var Ga=function(){return typeof Symbol=="function"},Wa=function(t){return Ga()&&Boolean(Symbol[t])},Ka=function(t){return Wa(t)?Symbol[t]:"@@"+t};Ga()&&!Wa("observable")&&(Symbol.observable=Symbol("observable"));var Ml=Ka("iterator"),Va=Ka("observable"),Ds=Ka("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:V}function jl(t){return t instanceof V}function Cr(t){Cr.log?Cr.log(t):setTimeout(function(){throw t})}function si(t){Promise.resolve().then(function(){try{t()}catch(e){Cr(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){Cr(n)}}function Ba(t){t._observer=void 0,t._queue=void 0,t._state="closed"}function $l(t){var e=t._queue;if(!!e){t._queue=void 0,t._state="ready";for(var r=0;r<e.length&&(Ns(t,e[r].type,e[r].value),t._state!=="closed");++r);}}function Ns(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(Ba(t),i)i.call(n,r);else throw r;break;case"complete":Ba(t),i&&i.call(n);break}}catch(a){Cr(a)}t._state==="closed"?ks(t):t._state==="running"&&(t._state="ready")}function qa(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 $l(t)});return}Ns(t,e,r)}}var Ul=function(){function t(r,n){this._cleanup=void 0,this._observer=r,this._queue=void 0,this._state="initializing";var i=new ql(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"&&(Ba(this),ks(this))},Qa(t,[{key:"closed",get:function(){return this._state==="closed"}}]),t}(),ql=function(){function t(r){this._subscription=r}var e=t.prototype;return e.next=function(n){qa(this._subscription,"next",n)},e.error=function(n){qa(this._subscription,"error",n)},e.complete=function(){qa(this._subscription,"complete")},Qa(t,[{key:"closed",get:function(){return this._subscription._state==="closed"}}]),t}(),V=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 Ul(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(){c.unsubscribe(),a()}var c=i.subscribe({next:function(u){try{n(u,s)}catch(l){o(l),c.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(c){return o.error(c)}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(c){return o.error(c)}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,c=arguments[1],u=c;return new a(function(l){return i.subscribe({next:function(p){var d=!s;if(s=!0,!d||o)try{u=n(u,p)}catch(f){return l.error(f)}else u=p},error:function(p){l.error(p)},complete:function(){if(!s&&!o)return l.error(new TypeError("Cannot reduce an empty sequence"));l.next(u),l.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(c){var u,l=0;function p(d){u=d.subscribe({next:function(f){c.next(f)},error:function(f){c.error(f)},complete:function(){l===a.length?(u=void 0,c.complete()):p(s.from(a[l++]))}})}return p(n),function(){u&&(u.unsubscribe(),u=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=[],c=i.subscribe({next:function(l){if(n)try{l=n(l)}catch(d){return o.error(d)}var p=a.from(l).subscribe({next:function(d){o.next(d)},error:function(d){o.error(d)},complete:function(){var d=s.indexOf(p);d>=0&&s.splice(d,1),u()}});s.push(p)},error:function(l){o.error(l)},complete:function(){u()}});function u(){c.closed&&s.length===0&&o.complete()}return function(){s.forEach(function(l){return l.unsubscribe()}),c.unsubscribe()}})},e[Va]=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,Va);if(a){var o=a.call(n);if(Object(o)!==o)throw new TypeError(o+" is not an object");return jl(o)&&o.constructor===i?o:new i(function(s){return o.subscribe(s)})}if(Wa("iterator")&&(a=ci(n,Ml),a))return new i(function(s){si(function(){if(!s.closed){for(var c=Ll(a.call(n)),u;!(u=c()).done;){var l=u.value;if(s.next(l),s.closed)return}s.complete()}})});if(Array.isArray(n))return new i(function(s){si(function(){if(!s.closed){for(var c=0;c<n.length;++c)if(s.next(n[c]),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 c=0;c<i.length;++c)if(s.next(i[c]),s.closed)return;s.complete()}})})},Qa(t,null,[{key:Ds,get:function(){return this}}]),t}();Ga()&&Object.defineProperty(V,Symbol("extensions"),{value:{symbol:Va,hostReportError:Cr},configurable:!0});function za(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 Rr;typeof self<"u"?Rr=self:typeof window<"u"?Rr=window:typeof global<"u"?Rr=global:typeof module<"u"?Rr=module:Rr=Function("return this")();var jh=za(Rr);var As=V.prototype,Ps="@@observable";As[Ps]||(As[Ps]=function(){return this});var Vl=Object.prototype.toString;function ui(t){return Ja(t)}function Ja(t,e){switch(Vl.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]=Ja(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]=Ja(t[i],e)}),n}default:return t}}function Bl(t){var e=new Set([t]);return e.forEach(function(r){K(r)&&Ql(r)===r&&Object.getOwnPropertyNames(r).forEach(function(n){K(r[n])&&e.add(r[n])})}),t}function Ql(t){if(__DEV__&&!Object.isFrozen(t))try{Object.freeze(t)}catch(e){if(e instanceof TypeError)return null;throw e}return t}function vn(t){return __DEV__&&Bl(t),t}function ar(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 V(function(n){var i=n.next,a=n.error,o=n.complete,s=0,c=!1,u={then:function(f){return new Promise(function(m){return m(f())})}};function l(f,m){return f?function(y){++s;var b=function(){return f(y)};u=u.then(b,b).then(function(E){--s,i&&i.call(n,E),c&&p.complete()},function(E){throw--s,E}).catch(function(E){a&&a.call(n,E)})}:function(y){return m&&m.call(n,y)}}var p={next:l(e,i),error:l(r,a),complete:function(){c=!0,s||o&&o.call(n)}},d=t.subscribe(p);return function(){return d.unsubscribe()}})}var Xe=typeof WeakMap=="function"&&_e(function(){return navigator.product})!=="ReactNative",Cs=typeof WeakSet=="function",Ha=typeof Symbol=="function"&&typeof Symbol.for=="function",Rt=Ha&&Symbol.asyncIterator,Yh=typeof _e(function(){return window.document.createElement})=="function",Xh=_e(function(){return navigator.userAgent.indexOf("jsdom")>=0})||!1;function fi(t){function e(r){Object.defineProperty(t,r,{value:V})}return Ha&&Symbol.species&&e(Symbol.species),e("@@species"),t}function Rs(t){return t&&typeof t.then=="function"}var Lr=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),ar(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),ar(n.observers,"error",i))},complete:function(){var i=n,a=i.sub,o=i.sources,s=o===void 0?[]:o;if(a!==null){var c=s.shift();c?Rs(c)?c.then(function(u){return n.sub=u.subscribe(n.handlers)}):n.sub=c.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"),ar(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 V(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}(V);fi(Lr);function Lt(t){return"incremental"in t}function Gl(t){return"hasNext"in t&&"data"in t}function Ls(t){return Lt(t)||Gl(t)}function pi(t,e){var r=t,n=new $e;return Lt(e)&&Se(e.incremental)&&e.incremental.forEach(function(i){for(var a=i.data,o=i.path,s=o.length-1;s>=0;--s){var c=o[s],u=!isNaN(+c),l=u?[]:{};l[c]=a,a=l}r=n.merge(r,a)}),r}function Fr(t){var e=di(t);return Se(e)}function di(t){var e=Se(t.errors)?t.errors.slice(0):[];return Lt(t)&&Se(t.incremental)&&t.incremental.forEach(function(r){r.errors&&e.push.apply(e,r.errors)}),e}function Ft(){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 bn(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=bn("stringifyForDisplay");return JSON.stringify(t,function(r,n){return n===void 0?e:n}).split(JSON.stringify(e)).join("<undefined>")}function Sn(t,e){return Ft(t,e,e.variables&&{variables:h(h({},t&&t.variables),e.variables)})}function hi(t){return new V(function(e){e.error(t)})}var wn=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 Ya(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 M("illegal argument: ".concat(i)):new M(27)}return t}function Xa(t,e){var r=h({},t),n=function(a){typeof a=="function"?r=h(h({},r),a(r)):r=h(h({},r),a)},i=function(){return h({},r)};return Object.defineProperty(e,"setContext",{enumerable:!1,value:n}),Object.defineProperty(e,"getContext",{enumerable:!1,value:i}),e}function Za(t){var e={variables:t.variables||{},extensions:t.extensions||{},operationName:t.operationName,query:t.query};return e.operationName||(e.operationName=typeof e.query!="string"?Pr(e.query)||void 0:""),e}function js(t,e){return e?e(t):V.of()}function _n(t){return typeof t=="function"?new Ze(t):t}function mi(t){return t.request.length<=1}var Wl=function(t){de(e,t);function e(r,n){var i=t.call(this,r)||this;return i.link=n,i}return e}(Error),Ze=function(){function t(e){e&&(this.request=e)}return t.empty=function(){return new t(function(){return V.of()})},t.from=function(e){return e.length===0?t.empty():e.map(_n).reduce(function(r,n){return r.concat(n)})},t.split=function(e,r,n){var i=_n(r),a=_n(n||new t(js));return mi(i)&&mi(a)?new t(function(o){return e(o)?i.request(o)||V.of():a.request(o)||V.of()}):new t(function(o,s){return e(o)?i.request(o,s)||V.of():a.request(o,s)||V.of()})},t.execute=function(e,r){return e.request(Xa(r.context,Za(Ya(r))))||V.of()},t.concat=function(e,r){var n=_n(e);if(mi(n))return __DEV__&&I.warn(new Wl("You are calling concat on a terminating link, which will have no effect",n)),n;var i=_n(r);return mi(i)?new t(function(a){return n.request(a,function(o){return i.request(o)||V.of()})||V.of()}):new t(function(a,o){return n.request(a,function(s){return i.request(s,o)||V.of()})||V.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 M("request is not implemented"):new M(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 Mr=Ze.execute;var $s="3.7.10";function Us(t){return!!t.body}function qs(t){return!!t.getReader}function Vs(t){return!!(Rt&&t[Symbol.asyncIterator])}function Bs(t){return!!t.stream}function Qs(t){return!!t.arrayBuffer}function Gs(t){return!!t.pipe}function eo(t){var e,r=t[Symbol.asyncIterator]();return e={next:function(){return r.next()}},e[Symbol.asyncIterator]=function(){return this},e}function to(t){var e=null,r=null,n=!1,i=[],a=[];function o(p){if(!r){if(a.length){var d=a.shift();if(Array.isArray(d)&&d[0])return d[0]({value:p,done:!1})}i.push(p)}}function s(p){r=p;var d=a.slice();d.forEach(function(f){f[1](p)}),!e||e()}function c(){n=!0;var p=a.slice();p.forEach(function(d){d[0]({value:void 0,done:!0})}),!e||e()}e=function(){e=null,t.removeListener("data",o),t.removeListener("error",s),t.removeListener("end",c),t.removeListener("finish",c),t.removeListener("close",c)},t.on("data",o),t.on("error",s),t.on("end",c),t.on("finish",c),t.on("close",c);function u(){return new Promise(function(p,d){if(r)return d(r);if(i.length)return p({value:i.shift(),done:!1});if(n)return p({value:void 0,done:!0});a.push([p,d])})}var l={next:function(){return u()}};return Rt&&(l[Symbol.asyncIterator]=function(){return this}),l}function ro(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 Rt&&(r[Symbol.asyncIterator]=function(){return this}),r}function yi(t){var e={next:function(){return t.read()}};return Rt&&(e[Symbol.asyncIterator]=function(){return this}),e}function Ws(t){var e=t;if(Us(t)&&(e=t.body),Vs(e))return eo(e);if(qs(e))return yi(e.getReader());if(Bs(e))return yi(e.stream().getReader());if(Qs(e))return ro(e.arrayBuffer());if(Gs(e))return to(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 tt(this,void 0,void 0,function(){var a,o,s,c,u,l,p,d,f,m,y,b,E,v,S,O,k,N,D,C;return rt(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=",c=o?.includes(s)?o?.substring(o?.indexOf(s)+s.length).replace(/['"]/g,"").replace(/\;(.*)/gm,"").trim():"-",u="--".concat(c),l="",p=Ws(t),d=!0,te.label=1;case 1:return d?[4,p.next()]:[3,3];case 2:for(f=te.sent(),m=f.value,y=f.done,b=typeof m=="string"?m:a.decode(m),d=!y,l+=b,E=l.indexOf(u);E>-1;){if(v=void 0,C=[l.slice(0,E),l.slice(E+u.length)],v=C[0],l=C[1],v.trim()){if(S=v.indexOf(`\r
25
25
  \r
26
- `),O=Kl(v.slice(0,S)),k=O["content-type"],k&&k.toLowerCase().indexOf("application/json")===-1)throw new Error("Unsupported patch content type: application/json is required.");N=v.slice(S);try{D=Ys(t,N.replace(`\r
27
- `,"")),(Object.keys(D).length>1||"data"in D||"incremental"in D||"errors"in D)&&((n=e.next)===null||n===void 0||n.call(e,D))}catch(X){bi(X,e)}}E=l.indexOf(u)}return[3,1];case 3:return(i=e.complete)===null||i===void 0||i.call(e),[2]}})})}function Kl(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 Ys(t,e){if(t.status>=300){var r=function(){try{return JSON.parse(e)}catch{return e}};wn(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 bi(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 Xs(t,e,r){zl(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 bi(n,r)})}function zl(t){return function(e){return e.text().then(function(r){return Ys(e,r)}).then(function(r){return e.status>=300&&wn(e,r,"Response not successful: Received status code ".concat(e.status)),!Array.isArray(r)&&!Js.call(r,"data")&&!Js.call(r,"errors")&&wn(e,r,"Server response was missing for query '".concat(Array.isArray(t)?t.map(function(n){return n.operationName}):t.operationName,"'.")),r})}}var En=function(t,e){var r;try{r=JSON.stringify(t)}catch(i){var n=__DEV__?new M("Network request failed. ".concat(e," is not serializable: ").concat(i.message)):new M(24);throw n.parseError=i,n}return r};var Jl={includeQuery:!0,includeExtensions:!1,preserveHeaderCase:!1},Hl={accept:"*/*","content-type":"application/json"},Yl={method:"POST"},Zs={http:Jl,headers:Hl,options:Yl},ec=function(t,e){return e(t)};function tc(t,e){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var i={},a={};r.forEach(function(p){i=h(h(h({},i),p.options),{headers:h(h({},i.headers),p.headers)}),p.credentials&&(i.credentials=p.credentials),a=h(h({},a),p.http)}),i.headers&&(i.headers=Xl(i.headers,a.preserveHeaderCase));var o=t.operationName,s=t.extensions,c=t.variables,u=t.query,l={operationName:o,variables:c};return a.includeExtensions&&(l.extensions=s),a.includeQuery&&(l.query=e(u,kr)),{options:i,body:l}}function Xl(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 rc=function(t){if(!t&&typeof fetch>"u")throw __DEV__?new M(`
26
+ `),O=Kl(v.slice(0,S)),k=O["content-type"],k&&k.toLowerCase().indexOf("application/json")===-1)throw new Error("Unsupported patch content type: application/json is required.");N=v.slice(S);try{D=Js(t,N.replace(`\r
27
+ `,"")),(Object.keys(D).length>1||"data"in D||"incremental"in D||"errors"in D)&&((n=e.next)===null||n===void 0||n.call(e,D))}catch(Y){gi(Y,e)}}E=l.indexOf(u)}return[3,1];case 3:return(i=e.complete)===null||i===void 0||i.call(e),[2]}})})}function Kl(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}};wn(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 gi(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){zl(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 gi(n,r)})}function zl(t){return function(e){return e.text().then(function(r){return Js(e,r)}).then(function(r){return e.status>=300&&wn(e,r,"Response not successful: Received status code ".concat(e.status)),!Array.isArray(r)&&!Ks.call(r,"data")&&!Ks.call(r,"errors")&&wn(e,r,"Server response was missing for query '".concat(Array.isArray(t)?t.map(function(n){return n.operationName}):t.operationName,"'.")),r})}}var En=function(t,e){var r;try{r=JSON.stringify(t)}catch(i){var n=__DEV__?new M("Network request failed. ".concat(e," is not serializable: ").concat(i.message)):new M(24);throw n.parseError=i,n}return r};var Jl={includeQuery:!0,includeExtensions:!1,preserveHeaderCase:!1},Hl={accept:"*/*","content-type":"application/json"},Yl={method:"POST"},Ys={http:Jl,headers:Hl,options:Yl},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(p){i=h(h(h({},i),p.options),{headers:h(h({},i.headers),p.headers)}),p.credentials&&(i.credentials=p.credentials),a=h(h({},a),p.http)}),i.headers&&(i.headers=Xl(i.headers,a.preserveHeaderCase));var o=t.operationName,s=t.extensions,c=t.variables,u=t.query,l={operationName:o,variables:c};return a.includeExtensions&&(l.extensions=s),a.includeQuery&&(l.query=e(u,kr)),{options:i,body:l}}function Xl(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 M(`
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 M(23)};var nc=function(){if(typeof AbortController>"u")return{controller:!1,signal:!1};var t=new AbortController,e=t.signal;return{controller:t,signal:e}};var ic=function(t,e){var r=t.getContext(),n=r.uri;return n||(typeof e=="function"?e(t):e||"/graphql")};function ac(t,e){var r=[],n=function(p,d){r.push("".concat(p,"=").concat(encodeURIComponent(d)))};if("query"in e&&n("query",e.query),e.operationName&&n("operationName",e.operationName),e.variables){var i=void 0;try{i=En(e.variables,"Variables map")}catch(p){return{parseError:p}}n("variables",i)}if(e.extensions){var a=void 0;try{a=En(e.extensions,"Extensions map")}catch(p){return{parseError:p}}n("extensions",a)}var o="",s=t,c=t.indexOf("#");c!==-1&&(o=t.substr(c),s=t.substr(0,c));var u=s.indexOf("?")===-1?"?":"&",l=s+u+r.join("&")+o;return{newURI:l}}var oc=_e(function(){return fetch}),sc=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?ec:i,o=t.includeExtensions,s=t.preserveHeaderCase,c=t.useGETForQueries,u=t.includeUnusedVariables,l=u===void 0?!1:u,p=dt(t,["uri","fetch","print","includeExtensions","preserveHeaderCase","useGETForQueries","includeUnusedVariables"]);__DEV__&&rc(n||oc);var d={http:{includeExtensions:o,preserveHeaderCase:s},options:p.fetchOptions,credentials:p.credentials,headers:p.headers};return new Ze(function(f){var m=ic(f,r),y=f.getContext(),b={};if(y.clientAwareness){var E=y.clientAwareness,v=E.name,S=E.version;v&&(b["apollographql-client-name"]=v),S&&(b["apollographql-client-version"]=S)}var O=h(h({},b),y.headers),k={http:y.http,options:y.fetchOptions,credentials:y.credentials,headers:O},N=tc(f,a,Zs,d,k),D=N.options,C=N.body;if(C.variables&&!l){var te=new Set(Object.keys(C.variables));ke(f.query,{Variable:function(K,ft,q){q&&q.kind!=="VariableDefinition"&&te.delete(K.name.value)}}),te.size&&(C.variables=h({},C.variables),te.forEach(function(K){delete C.variables[K]}))}var X;if(!D.signal){var lt=nc(),St=lt.controller,Ee=lt.signal;X=St,X&&(D.signal=Ee)}var $=function(K){return K.kind==="OperationDefinition"&&K.operation==="mutation"};if(c&&!f.query.definitions.some($)&&(D.method="GET"),Nr(["defer"],f.query)&&(D.headers=D.headers||{},D.headers.accept="multipart/mixed; deferSpec=20220824, application/json"),D.method==="GET"){var pe=ac(m,C),ae=pe.newURI,W=pe.parseError;if(W)return yi(W);m=ae}else try{D.body=En(C,"Payload")}catch(K){return yi(K)}return new V(function(K){var ft=n||_e(function(){return fetch})||oc;return ft(m,D).then(function(q){var pt;f.setContext({response:q});var Nt=(pt=q.headers)===null||pt===void 0?void 0:pt.get("content-type");return Nt!==null&&/^multipart\/mixed/i.test(Nt)?Hs(q,K):Xs(q,f,K)}).catch(function(q){return bi(q,K)}),function(){X&&X.abort()}})})};var io=function(t){de(e,t);function e(r){r===void 0&&(r={});var n=t.call(this,sc(r).request)||this;return n.options=r,n}return e}(Ze);var{toString:cc,hasOwnProperty:Zl}=Object.prototype,uc=Function.prototype.toString,ao=new Map;function se(t,e){try{return oo(t,e)}finally{ao.clear()}}function oo(t,e){if(t===e)return!0;let r=cc.call(t),n=cc.call(e);if(r!==n)return!1;switch(r){case"[object Array]":if(t.length!==e.length)return!1;case"[object Object]":{if(fc(t,e))return!0;let i=lc(t),a=lc(e),o=i.length;if(o!==a.length)return!1;for(let s=0;s<o;++s)if(!Zl.call(e,i[s]))return!1;for(let s=0;s<o;++s){let c=i[s];if(!oo(t[c],e[c]))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(fc(t,e))return!0;let i=t.entries(),a=r==="[object Map]";for(;;){let o=i.next();if(o.done)break;let[s,c]=o.value;if(!e.has(s)||a&&!oo(c,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=uc.call(t);return i!==uc.call(e)?!1:!rf(i,tf)}}return!1}function lc(t){return Object.keys(t).filter(ef,t)}function ef(t){return this[t]!==void 0}var tf="{ [native code] }";function rf(t,e){let r=t.length-e.length;return r>=0&&t.indexOf(e,r)===r}function fc(t,e){let r=ao.get(t);if(r){if(r.has(e))return!0}else ao.set(t,r=new Set);return r.add(e),!1}var nf=function(){return Object.create(null)},pc=Array.prototype,af=pc.forEach,of=pc.slice,yt=function(){function t(e,r){e===void 0&&(e=!0),r===void 0&&(r=nf),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 af.call(e,function(n){return r=r.getChildTrie(n)}),r.data||(r.data=this.makeData(of.call(e)))},t.prototype.getChildTrie=function(e){var r=this.weakness&&sf(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 sf(t){switch(typeof t){case"object":if(t===null)break;case"function":return!0}return!1}var xe=null,dc={},cf=1,uf=()=>class{constructor(){this.id=["slot",cf++,Date.now(),Math.random().toString(36).slice(2)].join(":")}hasValue(){for(let e=xe;e;e=e.parent)if(this.id in e.slots){let r=e.slots[this.id];if(r===dc)break;return e!==xe&&(xe.slots[this.id]=r),!0}return xe&&(xe.slots[this.id]=dc),!1}getValue(){if(this.hasValue())return xe.slots[this.id]}withValue(e,r,n,i){let a={__proto__:null,[this.id]:e},o=xe;xe={parent:o,slots:a};try{return r.apply(i,n)}finally{xe=o}}static bind(e){let r=xe;return function(){let n=xe;try{return xe=r,e.apply(this,arguments)}finally{xe=n}}}static noContext(e,r,n){if(xe){let i=xe;try{return xe=null,e.apply(n,r)}finally{xe=i}}else return e.apply(n,r)}};function hc(t){try{return t()}catch{}}var so="@wry/context:Slot",lf=hc(()=>globalThis)||hc(()=>global)||Object.create(null),mc=lf,jr=mc[so]||Array[so]||function(t){try{Object.defineProperty(mc,so,{value:t,enumerable:!1,writable:!1,configurable:!0})}finally{return t}}(uf());var{bind:ff,noContext:pf}=jr;function df(){}var hf=function(){function t(e,r){e===void 0&&(e=1/0),r===void 0&&(r=df),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}(),wi=new jr,co,mf=Object.prototype.hasOwnProperty,lo=(co=Array.from,co===void 0?function(t){var e=[];return t.forEach(function(r){return e.push(r)}),e}:co);function Si(t){var e=t.unsubscribe;typeof e=="function"&&(t.unsubscribe=void 0,e())}var On=[],yf=100;function $r(t,e){if(!t)throw new Error(e||"assertion failure")}function gf(t,e){var r=t.length;return r>0&&r===e.length&&t[r-1]===e[r-1]}function gc(t){switch(t.length){case 0:throw new Error("unknown value");case 1:return t[0];case 2:throw t[1]}}function vf(t){return t.slice(0)}var bf=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&&!Mt(this))return yc(this),this.value[0]},t.prototype.recompute=function(e){return $r(!this.recomputing,"already recomputing"),yc(this),Mt(this)?Sf(this,e):gc(this.value)},t.prototype.setDirty=function(){this.dirty||(this.dirty=!0,this.value.length=0,vc(this),Si(this))},t.prototype.dispose=function(){var e=this;this.setDirty(),Ec(this),fo(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&&(lo(this.deps).forEach(function(r){return r.delete(e)}),this.deps.clear(),On.push(this.deps),this.deps=null)},t.count=0,t}();function yc(t){var e=wi.getValue();if(e)return t.parents.add(e),e.childValues.has(t)||e.childValues.set(t,[]),Mt(t)?Sc(e,t):wc(e,t),e}function Sf(t,e){return Ec(t),wi.withValue(t,wf,[t,e]),Ef(t,e)&&_f(t),gc(t.value)}function wf(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 Mt(t){return t.dirty||!!(t.dirtyChildren&&t.dirtyChildren.size)}function _f(t){t.dirty=!1,!Mt(t)&&bc(t)}function vc(t){fo(t,Sc)}function bc(t){fo(t,wc)}function fo(t,e){var r=t.parents.size;if(r)for(var n=lo(t.parents),i=0;i<r;++i)e(n[i],t)}function Sc(t,e){$r(t.childValues.has(e)),$r(Mt(e));var r=!Mt(t);if(!t.dirtyChildren)t.dirtyChildren=On.pop()||new Set;else if(t.dirtyChildren.has(e))return;t.dirtyChildren.add(e),r&&vc(t)}function wc(t,e){$r(t.childValues.has(e)),$r(!Mt(e));var r=t.childValues.get(e);r.length===0?t.childValues.set(e,vf(e.value)):gf(r,e.value)||t.setDirty(),_c(t,e),!Mt(t)&&bc(t)}function _c(t,e){var r=t.dirtyChildren;r&&(r.delete(e),r.size===0&&(On.length<yf&&On.push(r),t.dirtyChildren=null))}function Ec(t){t.childValues.size>0&&t.childValues.forEach(function(e,r){Oc(t,r)}),t.forgetDeps(),$r(t.dirtyChildren===null)}function Oc(t,e){e.parents.delete(t),t.childValues.delete(e),_c(t,e)}function Ef(t,e){if(typeof t.subscribe=="function")try{Si(t),t.unsubscribe=t.subscribe.apply(null,e)}catch{return t.setDirty(),!1}return!0}var Of={setDirty:!0,dispose:!0,forget:!0};function _i(t){var e=new Map,r=t&&t.subscribe;function n(i){var a=wi.getValue();if(a){var o=e.get(i);o||e.set(i,o=new Set),a.dependOn(o),typeof r=="function"&&(Si(o),o.unsubscribe=r(i))}}return n.dirty=function(a,o){var s=e.get(a);if(s){var c=o&&mf.call(Of,o)?o:"setDirty";lo(s).forEach(function(u){return u[c]()}),e.delete(a),Si(s)}},n}function Tc(){var t=new yt(typeof WeakMap=="function");return function(){return t.lookupArray(arguments)}}var Cg=Tc(),uo=new Set;function or(t,e){e===void 0&&(e=Object.create(null));var r=new hf(e.max||Math.pow(2,16),function(u){return u.dispose()}),n=e.keyArgs,i=e.makeCacheKey||Tc(),a=function(){var u=i.apply(null,n?n.apply(null,arguments):arguments);if(u===void 0)return t.apply(null,arguments);var l=r.get(u);l||(r.set(u,l=new bf(t)),l.subscribe=e.subscribe,l.forget=function(){return r.delete(u)});var p=l.recompute(Array.prototype.slice.call(arguments));return r.set(u,l),uo.add(r),wi.hasValue()||(uo.forEach(function(d){return d.clean()}),uo.clear()),p};Object.defineProperty(a,"size",{get:function(){return r.map.size},configurable:!1,enumerable:!1});function o(u){var l=r.get(u);l&&l.setDirty()}a.dirtyKey=o,a.dirty=function(){o(i.apply(null,arguments))};function s(u){var l=r.get(u);if(l)return l.peek()}a.peekKey=s,a.peek=function(){return s(i.apply(null,arguments))};function c(u){return r.delete(u)}return a.forgetKey=c,a.forget=function(){return c(i.apply(null,arguments))},a.makeCacheKey=i,a.getKey=n?function(){return i.apply(null,n.apply(null,arguments))}:i,Object.freeze(a)}var po=function(){function t(){this.getFragmentDoc=or(Pa)}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(h(h({},e),{rootId:e.id||"ROOT_QUERY",optimistic:r}))},t.prototype.readFragment=function(e,r){return r===void 0&&(r=!!e.optimistic),this.read(h(h({},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=dt(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=dt(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(h(h({},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(h(h({},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 c=s.path.length-1;c>=0;--c)s.missing=(o={},o[s.path[c]]=s.missing,o)}else s.missing=s.path;return s.__proto__=e.prototype,s}return e}(Error);var he=Object.prototype.hasOwnProperty;function xn(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=xn(n)?xn(i)?void 0:{_id:i}:{id:n}),xn(n)&&!xn(i)&&(n=i),!xn(n)))return"".concat(r,":").concat(typeof n=="number"||typeof n=="string"?n:JSON.stringify(n))}var xc={dataIdFromObject:Oi,addTypename:!0,resultCaching:!0,canonizeResults:!1};function Ic(t){return Ft(xc,t)}function Ti(t){var e=t.canonizeResults;return e===void 0?xc.canonizeResults:e}function Dc(t,e){return G(e)?t.get(e.__ref,"__typename"):e&&e.__typename}var ho=/^[_a-z][_0-9a-z]*/i;function at(t){var e=t.match(ho);return e?e[0]:t}function Ei(t,e,r){return z(e)?re(e)?e.every(function(n){return Ei(t,n,r)}):t.selections.every(function(n){if(Ge(n)&&wt(n,r)){var i=Ye(n);return he.call(e,i)&&(!n.selectionSet||Ei(n.selectionSet,e[i],r))}return!0}):!1}function jt(t){return z(t)&&!G(t)&&!re(t)}function kc(){return new $e}function xi(t,e){var r=Zt(tr(t));return{fragmentMap:r,lookupFragment:function(n){var i=r[n];return!i&&e&&(i=e.lookup(n)),i||null}}}var Ii=Object.create(null),mo=function(){return Ii},Nc=Object.create(null),Ur=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 vn(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 ht(i);if(G(i))return i;var o=n.policies.identify(i)[0];if(o){var s=ht(o);return a&&n.merge(o,i),s}}}return t.prototype.toObject=function(){return h({},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 $t)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 $t)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 $e(xf).merge(a,o);if(this.data[i]=s,s!==a&&(delete this.refs[i],this.group.caching)){var c=Object.create(null);a||(c.__exists=1),Object.keys(o).forEach(function(u){if(!a||a[u]!==s[u]){c[u]=1;var l=at(u);l!==u&&!n.policies.hasKeyArgs(s.__typename,l)&&(c[l]=1),s[u]===void 0&&!(n instanceof $t)&&delete s[u]}}),c.__typename&&!(a&&a.__typename)&&this.policies.rootTypenamesById[i]===s.__typename&&delete c.__typename,Object.keys(c).forEach(function(u){return n.group.dirty(i,u)})}}},t.prototype.modify=function(e,r){var n=this,i=this.lookup(e);if(i){var a=Object.create(null),o=!1,s=!0,c={DELETE:Ii,INVALIDATE:Nc,isReference:G,toReference:this.toReference,canRead:this.canRead,readField:function(u,l){return n.policies.readField(typeof u=="string"?{fieldName:u,from:l||ht(e)}:u,{store:n})}};if(Object.keys(i).forEach(function(u){var l=at(u),p=i[u];if(p!==void 0){var d=typeof r=="function"?r:r[u]||r[l];if(d){var f=d===mo?Ii:d(vn(p),h(h({},c),{fieldName:l,storeFieldName:u,storage:n.getStorage(e,u)}));f===Nc?n.group.dirty(e,u):(f===Ii&&(f=void 0),f!==p&&(a[u]=f,o=!0,p=f))}p!==void 0&&(s=!1)}}),o)return this.merge(e,a),s&&(this instanceof $t?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]=mo,i):mo)}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 $t&&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=dt(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 $t?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 $t;)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 Ac=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?_i():null,this.keyMaker=new yt(Xe)},t.prototype.depend=function(e,r){if(this.d){this.d(yo(e,r));var n=at(r);n!==r&&this.d(yo(e,n)),this.parent&&this.parent.depend(e,r)}},t.prototype.dirty=function(e,r){this.d&&this.d.dirty(yo(e,r),r==="__exists"?"forget":"setDirty")},t}();function yo(t,e){return e+"#"+t}function go(t,e){sr(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,c=i.seed,u=r.call(this,a,new Ac(s))||this;return u.stump=new Tf(u),u.storageTrie=new yt(Xe),c&&u.replace(c),u}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})(Ur||(Ur={}));var $t=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(c){se(o[c],s[c])||n.group.dirty(a,c)}):(n.group.dirty(a,"__exists"),Object.keys(s).forEach(function(c){n.group.dirty(a,c)})):n.delete(a)}),i):i===this.parent?this:i.addLayer(this.id,this.replay)},e.prototype.toObject=function(){return h(h({},this.parent.toObject()),this.data)},e.prototype.findChildRefIds=function(r){var n=this.parent.findChildRefIds(r);return he.call(this.data,r)?h(h({},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}(Ur),Tf=function(t){de(e,t);function e(r){return t.call(this,"EntityStore.Stump",r,function(){},new Ac(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}($t);function xf(t,e,r){var n=t[r],i=e[r];return se(n,i)?n:i}function sr(t){return!!(t instanceof Ur&&t.group.caching)}function If(t){return z(t)?re(t)?t.slice(0):h({__proto__:Object.getPrototypeOf(t)},t):t}var Di=function(){function t(){this.known=new(Ls?WeakSet:Set),this.pool=new yt(Xe),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=If(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),c=[s],u=this.sortedKeys(e);c.push(u.json);var l=c.length;u.sorted.forEach(function(f){c.push(r.admit(e[f]))});var o=this.pool.lookupArray(c);if(!o.object){var p=o.object=Object.create(s);this.known.add(p),u.sorted.forEach(function(f,m){p[f]=c[l+m]}),__DEV__&&Object.freeze(p)}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 We=Object.assign(function(t){if(z(t)){vo===void 0&&Pc();var e=vo.admit(t),r=bo.get(e);return r===void 0&&bo.set(e,r=JSON.stringify(e)),r}return JSON.stringify(t)},{reset:Pc}),vo,bo;function Pc(){vo=new Di,bo=new(Xe?WeakMap:Map)}function Cc(t){return[t.selectionSet,t.objectOrReference,t.context,t.context.canonizeResults]}var Rc=function(){function t(e){var r=this;this.knownResults=new(Xe?WeakMap:Map),this.config=Ft(e,{addTypename:e.addTypename!==!1,canonizeResults:Ti(e)}),this.canon=e.canon||new Di,this.executeSelectionSet=or(function(n){var i,a=n.context.canonizeResults,o=Cc(n);o[3]=!a;var s=(i=r.executeSelectionSet).peek.apply(i,o);return s?a?h(h({},s),{result:r.canon.admit(s.result)}):s:(go(n.context.store,n.enclosingRef.__ref),r.execSelectionSetImpl(n))},{max:this.config.resultCacheMaxSize,keyArgs:Cc,makeCacheKey:function(n,i,a,o){if(sr(a.store))return a.store.makeCacheKey(n,G(i)?i.__ref:i,a.varString,o)}}),this.executeSubSelectedArray=or(function(n){return go(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(sr(o.store))return o.store.makeCacheKey(i,a,o.varString)}})}return t.prototype.resetCanon=function(){this.canon=new Di},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,c=s===void 0?!0:s,u=e.canonizeResults,l=u===void 0?this.config.canonizeResults:u,p=this.config.cache.policies;o=h(h({},nr(mn(n))),o);var d=ht(a),f=this.executeSelectionSet({selectionSet:rr(n).selectionSet,objectOrReference:d,enclosingRef:d,context:h({store:r,query:n,policies:p,variables:o,varString:We(o),canonizeResults:l},xi(n,this.config.fragments))}),m;if(f.missing&&(m=[new Tn(Df(f.missing),f.missing,n,o)],!c))throw m[0];return{result:f.result,complete:!m,missing:m}},t.prototype.isFresh=function(e,r,n,i){if(sr(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,c=o.policies,u=o.store,l=u.getFieldValue(i,"__typename"),p=[],d,f=new $e;this.config.addTypename&&typeof l=="string"&&!c.rootIdsByTypename[l]&&p.push({__typename:l});function m(S,O){var k;return S.missing&&(d=f.merge(d,(k={},k[O]=S.missing,k))),S.result}var y=new Set(n.selections);y.forEach(function(S){var O,k;if(!!wt(S,s))if(Ge(S)){var N=c.readField({fieldName:S.name.value,field:S,variables:o.variables,from:i},o),D=Ye(S);N===void 0?ir.added(S)||(d=f.merge(d,(O={},O[D]="Can't find field '".concat(S.name.value,"' on ").concat(G(i)?i.__ref+" object":"object "+JSON.stringify(i,null,2)),O))):re(N)?N=m(r.executeSubSelectedArray({field:S,array:N,enclosingRef:a,context:o}),D):S.selectionSet?N!=null&&(N=m(r.executeSelectionSet({selectionSet:S.selectionSet,objectOrReference:N,enclosingRef:G(N)?N:a,context:o}),D)):o.canonizeResults&&(N=r.canon.pass(N)),N!==void 0&&p.push((k={},k[D]=N,k))}else{var C=er(S,o.lookupFragment);if(!C&&S.kind===ve.FRAGMENT_SPREAD)throw __DEV__?new M("No fragment named ".concat(S.name.value)):new M(5);C&&c.fragmentMatches(C,l)&&C.selectionSet.selections.forEach(y.add,y)}});var b=yn(p),E={result:b,missing:d},v=o.canonizeResults?this.canon.admit(E):vn(E);return v.result&&this.knownResults.set(v.result,n),v},t.prototype.execSubSelectedArrayImpl=function(e){var r=this,n=e.field,i=e.array,a=e.enclosingRef,o=e.context,s,c=new $e;function u(l,p){var d;return l.missing&&(s=c.merge(s,(d={},d[p]=l.missing,d))),l.result}return n.selectionSet&&(i=i.filter(o.store.canRead)),i=i.map(function(l,p){return l===null?null:re(l)?u(r.executeSubSelectedArray({field:n,array:l,enclosingRef:a,context:o}),p):n.selectionSet?u(r.executeSelectionSet({selectionSet:n.selectionSet,objectOrReference:l,enclosingRef:G(l)?l:a,context:o}),p):(__DEV__&&kf(o.store,n,l),l)}),{result:o.canonizeResults?this.canon.admit(i):i,missing:s}},t}();function Df(t){try{JSON.stringify(t,function(e,r){if(typeof r=="string")throw r;return r})}catch(e){return e}}function kf(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(Dc(t,i)," returned for query field ").concat(e.name.value)):I(!G(i),6),Object.values(i).forEach(n.add,n))})}}var qr=new jr,Lc=new WeakMap;function In(t){var e=Lc.get(t);return e||Lc.set(t,e={vars:new Set,dep:_i()}),e}function So(t){In(t).vars.forEach(function(e){return e.forgetCache(t)})}function Fc(t){In(t).vars.forEach(function(e){return e.attachCache(t)})}function ki(t){var e=new Set,r=new Set,n=function(a){if(arguments.length>0){if(t!==a){t=a,e.forEach(function(c){In(c).dep.dirty(n),Nf(c)});var o=Array.from(r);r.clear(),o.forEach(function(c){return c(t)})}}else{var s=qr.getValue();s&&(i(s),In(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),In(a).vars.add(n),n};return n.forgetCache=function(a){return e.delete(a)},n}function Nf(t){t.broadcastWatches&&t.broadcastWatches()}var Mc=Object.create(null);function wo(t){var e=JSON.stringify(t);return Mc[e]||(Mc[e]=Object.create(null))}function _o(t){var e=wo(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=Vr(n.storeObject,o,i);return s===void 0&&r!==n.storeObject&&he.call(r,o[0])&&(s=Vr(r,o,$c)),__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 Eo(t){var e=wo(t);return e.keyArgsFn||(e.keyArgsFn=function(r,n){var i=n.field,a=n.variables,o=n.fieldName,s=Oo(t,function(u){var l=u[0],p=l.charAt(0);if(p==="@"){if(i&&Se(i.directives)){var d=l.slice(1),f=i.directives.find(function(E){return E.name.value===d}),m=f&&_t(f,a);return m&&Vr(m,u.slice(1))}return}if(p==="$"){var y=l.slice(1);if(a&&he.call(a,y)){var b=u.slice(0);return b[0]=y,Vr(a,b)}return}if(r)return Vr(r,u)}),c=JSON.stringify(s);return(r||c!=="{}")&&(o+=":"+c),o})}function Oo(t,e){var r=new $e;return jc(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 jc(t){var e=wo(t);if(!e.paths){var r=e.paths=[],n=[];t.forEach(function(i,a){re(i)?(jc(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 $c(t,e){return t[e]}function Vr(t,e,r){return r=r||$c,Uc(e.reduce(function n(i,a){return re(i)?i.map(function(o){return n(o,a)}):i&&r(i,a)},t))}function Uc(t){return z(t)?re(t)?t.map(Uc):Oo(Object.keys(t).sort(),function(e){return Vr(t,e)}):t}dn.setStringify(We);function To(t){return t.args!==void 0?t.args:t.field?_t(t.field,t.variables):null}var Af=function(){},qc=function(t,e){return e.fieldName},Vc=function(t,e,r){var n=r.mergeObjects;return n(t,e)},Bc=function(t,e){return e},Gc=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=h({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=h(h({},r),{typename:a,storeObject:o,readField:r&&r.readField||function(){var d=Ni(arguments,o);return i.readField(d,{store:i.cache.data,variables:d.variables})}}),c,u=a&&this.getTypePolicy(a),l=u&&u.keyFn||this.config.dataIdFromObject;l;){var p=l(e,s);if(re(p))l=_o(p);else{c=p;break}}return c=c?String(c):void 0,s.keyObject?[c,s.keyObject]:[c]},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,c=dt(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(c):r.toBeAdded[n]=[c]})},t.prototype.updateTypePolicy=function(e,r){var n=this,i=this.getTypePolicy(e),a=r.keyFields,o=r.fields;function s(c,u){c.merge=typeof u=="function"?u:u===!0?Vc:u===!1?Bc:c.merge}s(i,r.merge),i.keyFn=a===!1?Af:re(a)?_o(a):typeof a=="function"?a:i.keyFn,o&&Object.keys(o).forEach(function(c){var u=n.getFieldPolicy(e,c,!0),l=o[c];if(typeof l=="function")u.read=l;else{var p=l.keyArgs,d=l.read,f=l.merge;u.keyFn=p===!1?qc:re(p)?Eo(p):typeof p=="function"?p:u.keyFn,typeof d=="function"&&(u.read=d),s(u,f)}u.read&&u.merge&&(u.keyFn=u.keyFn||qc)})},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(ho);(!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),c=s.fields,u=dt(s,["fields"]);Object.assign(n,u),Object.assign(n.fields,c)})}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),c=[s],u=function(m){var y=a.getSupertypeSet(m,!1);y&&y.size&&c.indexOf(y)<0&&c.push(y)},l=!!(n&&this.fuzzySubtypes.size),p=!1,d=0;d<c.length;++d){var f=c[d];if(f.has(o))return s.has(o)||(p&&__DEV__&&I.warn("Inferring subtype ".concat(r," of supertype ").concat(o)),s.add(o)),!0;f.forEach(u),l&&d===c.length-1&&Ei(e.selectionSet,n,i)&&(l=!1,p=!0,this.fuzzySubtypes.forEach(function(m,y){var b=r.match(m);b&&b[0]===r&&u(y)}))}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},c=To(e);o;){var u=o(c,s);if(re(u))o=Eo(u);else{a=u||n;break}}return a===void 0&&(a=e.field?Ra(e.field,e.variables):dn(n,To(e))),a===!1?n:n===at(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=at(o),c=r.store.getFieldValue(n,o),u=this.getFieldPolicy(e.typename,s,!1),l=u&&u.read;if(l){var p=Qc(this,n,e,r,r.store.getStorage(G(n)?n.__ref:n,o));return qr.withValue(this.cache,l,[c,p])}return c}}},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,c=n.merge;return c===Vc?Wc(i.store)(e,r):c===Bc?r:(i.overwrite&&(e=void 0),c(e,r,Qc(this,void 0,{typename:s,fieldName:o.name.value,field:o,variables:i.variables},i,a||Object.create(null))))},t}();function Qc(t,e,r,n,i){var a=t.getStoreFieldName(r),o=at(a),s=r.variables||n.variables,c=n.store,u=c.toReference,l=c.canRead;return{args:To(r),field:r.field||null,fieldName:o,storeFieldName:a,variables:s,isReference:G,toReference:u,storage:i,cache:t.cache,canRead:l,readField:function(){return t.readField(Ni(arguments,e,s),n)},mergeObjects:Wc(n.store)}}function Ni(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=h({},n),he.call(o,"from")||(o.from=e)),__DEV__&&o.from===void 0&&__DEV__&&I.warn("Undefined 'from' passed to readField with arguments ".concat($s(Array.from(t)))),o.variables===void 0&&(o.variables=r),o}function Wc(t){return function(r,n){if(re(r)||re(n))throw __DEV__?new M("Cannot automatically merge arrays"):new M(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)&&jt(n))return t.merge(r.__ref,n),r;if(jt(r)&&G(n))return t.merge(r,n.__ref),n;if(jt(r)&&jt(n))return h(h({},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:h(h({},t),{clientOnly:e,deferred:r})),i}var Hc=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,c=r.overwrite,u=mt(i),l=kc();s=h(h({},nr(u)),s);var p=h(h({store:e,written:Object.create(null),merge:function(f,m){return l.merge(f,m)},variables:s,varString:We(s)},xi(i,this.fragments)),{overwrite:!!c,incomingById:new Map,clientOnly:!1,deferred:!1,flavors:new Map}),d=this.processSelectionSet({result:a||Object.create(null),dataId:o,selectionSet:u.selectionSet,mergeTree:{map:new Map},context:p});if(!G(d))throw __DEV__?new M("Could not identify object ".concat(JSON.stringify(a))):new M(7);return p.incomingById.forEach(function(f,m){var y=f.storeObject,b=f.mergeTree,E=f.fieldNodeSet,v=ht(m);if(b&&b.map.size){var S=n.applyMerges(b,v,y,p);if(G(S))return;y=S}if(__DEV__&&!p.overwrite){var O=Object.create(null);E.forEach(function(D){D.selectionSet&&(O[D.name.value]=!0)});var k=function(D){return O[at(D)]===!0},N=function(D){var C=b&&b.map.get(D);return Boolean(C&&C.info&&C.info.merge)};Object.keys(y).forEach(function(D){k(D)&&!N(D)&&Pf(v,y,D,p.store)})}e.merge(m,y)}),e.retain(d.__ref),d},t.prototype.processSelectionSet=function(e){var r=this,n=e.dataId,i=e.result,a=e.selectionSet,o=e.context,s=e.mergeTree,c=this.cache.policies,u=Object.create(null),l=n&&c.rootTypenamesById[n]||hn(i,a,o.fragmentMap)||n&&o.store.get(n,"__typename");typeof l=="string"&&(u.__typename=l);var p=function(){var S=Ni(arguments,u,o.variables);if(G(S.from)){var O=o.incomingById.get(S.from.__ref);if(O){var k=c.readField(h(h({},S),{from:O.storeObject}),o);if(k!==void 0)return k}}return c.readField(S,o)},d=new Set;this.flattenFields(a,i,o,l).forEach(function(S,O){var k,N=Ye(O),D=i[N];if(d.add(O),D!==void 0){var C=c.getStoreFieldName({typename:l,fieldName:O.name.value,field:O,variables:S.variables}),te=Kc(s,C),X=r.processFieldValue(D,O,O.selectionSet?xo(S,!1,!1):S,te),lt=void 0;O.selectionSet&&(G(X)||jt(X))&&(lt=p("__typename",X));var St=c.getMergeFunction(l,O.name.value,lt);St?te.info={field:O,typename:l,merge:St}:zc(s,C),u=S.merge(u,(k={},k[C]=X,k))}else __DEV__&&!S.clientOnly&&!S.deferred&&!ir.added(O)&&!c.getReadFunction(l,O.name.value)&&__DEV__&&I.error("Missing field '".concat(Ye(O),"' while writing result ").concat(JSON.stringify(i,null,2)).substring(0,1e3))});try{var f=c.identify(i,{typename:l,selectionSet:a,fragmentMap:o.fragmentMap,storeObject:u,readField:p}),m=f[0],y=f[1];n=n||m,y&&(u=o.merge(u,y))}catch(S){if(!n)throw S}if(typeof n=="string"){var b=ht(n),E=o.written[n]||(o.written[n]=[]);if(E.indexOf(a)>=0||(E.push(a),this.reader&&this.reader.isFresh(i,b,a,o)))return b;var v=o.incomingById.get(n);return v?(v.storeObject=o.merge(v.storeObject,u),v.mergeTree=Io(v.mergeTree,s),d.forEach(function(S){return v.fieldNodeSet.add(S)})):o.incomingById.set(n,{storeObject:u,mergeTree:Ai(s)?void 0:s,fieldNodeSet:d}),b}return u},t.prototype.processFieldValue=function(e,r,n,i){var a=this;return!r.selectionSet||e===null?__DEV__?fi(e):e:re(e)?e.map(function(o,s){var c=a.processFieldValue(o,r,n,Kc(i,s));return zc(i,s),c}):this.processSelectionSet({result:e,selectionSet:r.selectionSet,context:n,mergeTree:i})},t.prototype.flattenFields=function(e,r,n,i){i===void 0&&(i=hn(r,e,n.fragmentMap));var a=new Map,o=this.cache.policies,s=new yt(!1);return function c(u,l){var p=s.lookup(u,l.clientOnly,l.deferred);p.visited||(p.visited=!0,u.selections.forEach(function(d){if(!!wt(d,n.variables)){var f=l.clientOnly,m=l.deferred;if(!(f&&m)&&Se(d.directives)&&d.directives.forEach(function(E){var v=E.name.value;if(v==="client"&&(f=!0),v==="defer"){var S=_t(E,n.variables);(!S||S.if!==!1)&&(m=!0)}}),Ge(d)){var y=a.get(d);y&&(f=f&&y.clientOnly,m=m&&y.deferred),a.set(d,xo(n,f,m))}else{var b=er(d,n.lookupFragment);if(!b&&d.kind===ve.FRAGMENT_SPREAD)throw __DEV__?new M("No fragment named ".concat(d.name.value)):new M(8);b&&o.fragmentMatches(b,i,r,n.variables)&&c(b.selectionSet,xo(n,f,m))}}}))}(e,n),a},t.prototype.applyMerges=function(e,r,n,i,a){var o,s=this;if(e.map.size&&!G(n)){var c=!re(n)&&(G(r)||jt(r))?r:void 0,u=n;c&&!a&&(a=[G(c)?c.__ref:c]);var l,p=function(d,f){return re(d)?typeof f=="number"?d[f]:void 0:i.store.getFieldValue(d,String(f))};e.map.forEach(function(d,f){var m=p(c,f),y=p(u,f);if(y!==void 0){a&&a.push(f);var b=s.applyMerges(d,m,y,i,a);b!==y&&(l=l||new Map,l.set(f,b)),a&&I(a.pop()===f)}}),l&&(n=re(u)?u.slice(0):h({},u),l.forEach(function(d,f){n[f]=d}))}return e.info?this.cache.policies.runMergeFunction(r,n,e.info,i,a&&(o=i.store).getStorage.apply(o,a)):n},t}();var Yc=[];function Kc(t,e){var r=t.map;return r.has(e)||r.set(e,Yc.pop()||{map:new Map}),r.get(e)}function Io(t,e){if(t===e||!e||Ai(e))return t;if(!t||Ai(t))return e;var r=t.info&&e.info?h(h({},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,c){a.map.set(c,Io(s,e.map.get(c))),o.delete(c)}),o.forEach(function(s){a.map.set(s,Io(e.map.get(s),t.map.get(s)))})}return a}function Ai(t){return!t||!(t.info||t.map.size)}function zc(t,e){var r=t.map,n=r.get(e);n&&Ai(n)&&(Yc.push(n),r.delete(e))}var Jc=new Set;function Pf(t,e,r,n){var i=function(p){var d=n.getFieldValue(p,r);return typeof d=="object"&&d},a=i(t);if(!!a){var o=i(e);if(!!o&&!G(a)&&!se(a,o)&&!Object.keys(a).every(function(p){return n.getFieldValue(o,p)!==void 0})){var s=n.getFieldValue(t,"__typename")||n.getFieldValue(e,"__typename"),c=at(r),u="".concat(s,".").concat(c);if(!Jc.has(u)){Jc.add(u);var l=[];!re(a)&&!re(o)&&[a,o].forEach(function(p){var d=n.getFieldValue(p,"__typename");typeof d=="string"&&!l.includes(d)&&l.push(d)}),__DEV__&&I.warn("Cache data may be lost when replacing the ".concat(c," field of a ").concat(s,` object.
36
+ `):new M(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(p,d){r.push("".concat(p,"=").concat(encodeURIComponent(d)))};if("query"in e&&n("query",e.query),e.operationName&&n("operationName",e.operationName),e.variables){var i=void 0;try{i=En(e.variables,"Variables map")}catch(p){return{parseError:p}}n("variables",i)}if(e.extensions){var a=void 0;try{a=En(e.extensions,"Extensions map")}catch(p){return{parseError:p}}n("extensions",a)}var o="",s=t,c=t.indexOf("#");c!==-1&&(o=t.substr(c),s=t.substr(0,c));var u=s.indexOf("?")===-1?"?":"&",l=s+u+r.join("&")+o;return{newURI:l}}var ic=_e(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,c=t.useGETForQueries,u=t.includeUnusedVariables,l=u===void 0?!1:u,p=dt(t,["uri","fetch","print","includeExtensions","preserveHeaderCase","useGETForQueries","includeUnusedVariables"]);__DEV__&&ec(n||ic);var d={http:{includeExtensions:o,preserveHeaderCase:s},options:p.fetchOptions,credentials:p.credentials,headers:p.headers};return new Ze(function(f){var m=rc(f,r),y=f.getContext(),b={};if(y.clientAwareness){var E=y.clientAwareness,v=E.name,S=E.version;v&&(b["apollographql-client-name"]=v),S&&(b["apollographql-client-version"]=S)}var O=h(h({},b),y.headers),k={http:y.http,options:y.fetchOptions,credentials:y.credentials,headers:O},N=Zs(f,a,Ys,d,k),D=N.options,C=N.body;if(C.variables&&!l){var te=new Set(Object.keys(C.variables));ke(f.query,{Variable:function(W,ft,q){q&&q.kind!=="VariableDefinition"&&te.delete(W.name.value)}}),te.size&&(C.variables=h({},C.variables),te.forEach(function(W){delete C.variables[W]}))}var Y;if(!D.signal){var lt=tc(),St=lt.controller,Ee=lt.signal;Y=St,Y&&(D.signal=Ee)}var $=function(W){return W.kind==="OperationDefinition"&&W.operation==="mutation"};if(c&&!f.query.definitions.some($)&&(D.method="GET"),Nr(["defer"],f.query)&&(D.headers=D.headers||{},D.headers.accept="multipart/mixed; deferSpec=20220824, application/json"),D.method==="GET"){var pe=nc(m,C),ae=pe.newURI,G=pe.parseError;if(G)return hi(G);m=ae}else try{D.body=En(C,"Payload")}catch(W){return hi(W)}return new V(function(W){var ft=n||_e(function(){return fetch})||ic;return ft(m,D).then(function(q){var pt;f.setContext({response:q});var Nt=(pt=q.headers)===null||pt===void 0?void 0:pt.get("content-type");return Nt!==null&&/^multipart\/mixed/i.test(Nt)?zs(q,W):Hs(q,f,W)}).catch(function(q){return gi(q,W)}),function(){Y&&Y.abort()}})})};var no=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}(Ze);var{toString:oc,hasOwnProperty:Zl}=Object.prototype,sc=Function.prototype.toString,io=new Map;function se(t,e){try{return ao(t,e)}finally{io.clear()}}function ao(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(!Zl.call(e,i[s]))return!1;for(let s=0;s<o;++s){let c=i[s];if(!ao(t[c],e[c]))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,c]=o.value;if(!e.has(s)||a&&!ao(c,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:!rf(i,tf)}}return!1}function cc(t){return Object.keys(t).filter(ef,t)}function ef(t){return this[t]!==void 0}var tf="{ [native code] }";function rf(t,e){let r=t.length-e.length;return r>=0&&t.indexOf(e,r)===r}function uc(t,e){let r=io.get(t);if(r){if(r.has(e))return!0}else io.set(t,r=new Set);return r.add(e),!1}var nf=function(){return Object.create(null)},lc=Array.prototype,af=lc.forEach,of=lc.slice,yt=function(){function t(e,r){e===void 0&&(e=!0),r===void 0&&(r=nf),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 af.call(e,function(n){return r=r.getChildTrie(n)}),r.data||(r.data=this.makeData(of.call(e)))},t.prototype.getChildTrie=function(e){var r=this.weakness&&sf(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 sf(t){switch(typeof t){case"object":if(t===null)break;case"function":return!0}return!1}var xe=null,fc={},cf=1,uf=()=>class{constructor(){this.id=["slot",cf++,Date.now(),Math.random().toString(36).slice(2)].join(":")}hasValue(){for(let e=xe;e;e=e.parent)if(this.id in e.slots){let r=e.slots[this.id];if(r===fc)break;return e!==xe&&(xe.slots[this.id]=r),!0}return xe&&(xe.slots[this.id]=fc),!1}getValue(){if(this.hasValue())return xe.slots[this.id]}withValue(e,r,n,i){let a={__proto__:null,[this.id]:e},o=xe;xe={parent:o,slots:a};try{return r.apply(i,n)}finally{xe=o}}static bind(e){let r=xe;return function(){let n=xe;try{return xe=r,e.apply(this,arguments)}finally{xe=n}}}static noContext(e,r,n){if(xe){let i=xe;try{return xe=null,e.apply(n,r)}finally{xe=i}}else return e.apply(n,r)}};function pc(t){try{return t()}catch{}}var oo="@wry/context:Slot",lf=pc(()=>globalThis)||pc(()=>global)||Object.create(null),dc=lf,jr=dc[oo]||Array[oo]||function(t){try{Object.defineProperty(dc,oo,{value:t,enumerable:!1,writable:!1,configurable:!0})}finally{return t}}(uf());var{bind:ff,noContext:pf}=jr;function df(){}var hf=function(){function t(e,r){e===void 0&&(e=1/0),r===void 0&&(r=df),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 jr,so,mf=Object.prototype.hasOwnProperty,uo=(so=Array.from,so===void 0?function(t){var e=[];return t.forEach(function(r){return e.push(r)}),e}:so);function vi(t){var e=t.unsubscribe;typeof e=="function"&&(t.unsubscribe=void 0,e())}var On=[],yf=100;function $r(t,e){if(!t)throw new Error(e||"assertion failure")}function gf(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 vf(t){return t.slice(0)}var bf=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&&!Mt(this))return hc(this),this.value[0]},t.prototype.recompute=function(e){return $r(!this.recomputing,"already recomputing"),hc(this),Mt(this)?Sf(this,e):mc(this.value)},t.prototype.setDirty=function(){this.dirty||(this.dirty=!0,this.value.length=0,yc(this),vi(this))},t.prototype.dispose=function(){var e=this;this.setDirty(),wc(this),lo(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&&(uo(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,[]),Mt(t)?vc(e,t):bc(e,t),e}function Sf(t,e){return wc(t),bi.withValue(t,wf,[t,e]),Ef(t,e)&&_f(t),mc(t.value)}function wf(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 Mt(t){return t.dirty||!!(t.dirtyChildren&&t.dirtyChildren.size)}function _f(t){t.dirty=!1,!Mt(t)&&gc(t)}function yc(t){lo(t,vc)}function gc(t){lo(t,bc)}function lo(t,e){var r=t.parents.size;if(r)for(var n=uo(t.parents),i=0;i<r;++i)e(n[i],t)}function vc(t,e){$r(t.childValues.has(e)),$r(Mt(e));var r=!Mt(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){$r(t.childValues.has(e)),$r(!Mt(e));var r=t.childValues.get(e);r.length===0?t.childValues.set(e,vf(e.value)):gf(r,e.value)||t.setDirty(),Sc(t,e),!Mt(t)&&gc(t)}function Sc(t,e){var r=t.dirtyChildren;r&&(r.delete(e),r.size===0&&(On.length<yf&&On.push(r),t.dirtyChildren=null))}function wc(t){t.childValues.size>0&&t.childValues.forEach(function(e,r){_c(t,r)}),t.forgetDeps(),$r(t.dirtyChildren===null)}function _c(t,e){e.parents.delete(t),t.childValues.delete(e),Sc(t,e)}function Ef(t,e){if(typeof t.subscribe=="function")try{vi(t),t.unsubscribe=t.subscribe.apply(null,e)}catch{return t.setDirty(),!1}return!0}var Of={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"&&(vi(o),o.unsubscribe=r(i))}}return n.dirty=function(a,o){var s=e.get(a);if(s){var c=o&&mf.call(Of,o)?o:"setDirty";uo(s).forEach(function(u){return u[c]()}),e.delete(a),vi(s)}},n}function Ec(){var t=new yt(typeof WeakMap=="function");return function(){return t.lookupArray(arguments)}}var Cg=Ec(),co=new Set;function or(t,e){e===void 0&&(e=Object.create(null));var r=new hf(e.max||Math.pow(2,16),function(u){return u.dispose()}),n=e.keyArgs,i=e.makeCacheKey||Ec(),a=function(){var u=i.apply(null,n?n.apply(null,arguments):arguments);if(u===void 0)return t.apply(null,arguments);var l=r.get(u);l||(r.set(u,l=new bf(t)),l.subscribe=e.subscribe,l.forget=function(){return r.delete(u)});var p=l.recompute(Array.prototype.slice.call(arguments));return r.set(u,l),co.add(r),bi.hasValue()||(co.forEach(function(d){return d.clean()}),co.clear()),p};Object.defineProperty(a,"size",{get:function(){return r.map.size},configurable:!1,enumerable:!1});function o(u){var l=r.get(u);l&&l.setDirty()}a.dirtyKey=o,a.dirty=function(){o(i.apply(null,arguments))};function s(u){var l=r.get(u);if(l)return l.peek()}a.peekKey=s,a.peek=function(){return s(i.apply(null,arguments))};function c(u){return r.delete(u)}return a.forgetKey=c,a.forget=function(){return c(i.apply(null,arguments))},a.makeCacheKey=i,a.getKey=n?function(){return i.apply(null,n.apply(null,arguments))}:i,Object.freeze(a)}var fo=function(){function t(){this.getFragmentDoc=or(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(h(h({},e),{rootId:e.id||"ROOT_QUERY",optimistic:r}))},t.prototype.readFragment=function(e,r){return r===void 0&&(r=!!e.optimistic),this.read(h(h({},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=dt(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=dt(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(h(h({},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(h(h({},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 c=s.path.length-1;c>=0;--c)s.missing=(o={},o[s.path[c]]=s.missing,o)}else s.missing=s.path;return s.__proto__=e.prototype,s}return e}(Error);var he=Object.prototype.hasOwnProperty;function xn(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=xn(n)?xn(i)?void 0:{_id:i}:{id:n}),xn(n)&&!xn(i)&&(n=i),!xn(n)))return"".concat(r,":").concat(typeof n=="number"||typeof n=="string"?n:JSON.stringify(n))}var Oc={dataIdFromObject:_i,addTypename:!0,resultCaching:!0,canonizeResults:!1};function Tc(t){return Ft(Oc,t)}function Ei(t){var e=t.canonizeResults;return e===void 0?Oc.canonizeResults:e}function xc(t,e){return Q(e)?t.get(e.__ref,"__typename"):e&&e.__typename}var po=/^[_a-z][_0-9a-z]*/i;function at(t){var e=t.match(po);return e?e[0]:t}function wi(t,e,r){return K(e)?re(e)?e.every(function(n){return wi(t,n,r)}):t.selections.every(function(n){if(Ge(n)&&wt(n,r)){var i=Ye(n);return he.call(e,i)&&(!n.selectionSet||wi(n.selectionSet,e[i],r))}return!0}):!1}function jt(t){return K(t)&&!Q(t)&&!re(t)}function Ic(){return new $e}function Oi(t,e){var r=Zt(tr(t));return{fragmentMap:r,lookupFragment:function(n){var i=r[n];return!i&&e&&(i=e.lookup(n)),i||null}}}var Ti=Object.create(null),ho=function(){return Ti},Dc=Object.create(null),Ur=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 vn(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 ht(i);if(Q(i))return i;var o=n.policies.identify(i)[0];if(o){var s=ht(o);return a&&n.merge(o,i),s}}}return t.prototype.toObject=function(){return h({},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 $t)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 $t)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 $e(xf).merge(a,o);if(this.data[i]=s,s!==a&&(delete this.refs[i],this.group.caching)){var c=Object.create(null);a||(c.__exists=1),Object.keys(o).forEach(function(u){if(!a||a[u]!==s[u]){c[u]=1;var l=at(u);l!==u&&!n.policies.hasKeyArgs(s.__typename,l)&&(c[l]=1),s[u]===void 0&&!(n instanceof $t)&&delete s[u]}}),c.__typename&&!(a&&a.__typename)&&this.policies.rootTypenamesById[i]===s.__typename&&delete c.__typename,Object.keys(c).forEach(function(u){return n.group.dirty(i,u)})}}},t.prototype.modify=function(e,r){var n=this,i=this.lookup(e);if(i){var a=Object.create(null),o=!1,s=!0,c={DELETE:Ti,INVALIDATE:Dc,isReference:Q,toReference:this.toReference,canRead:this.canRead,readField:function(u,l){return n.policies.readField(typeof u=="string"?{fieldName:u,from:l||ht(e)}:u,{store:n})}};if(Object.keys(i).forEach(function(u){var l=at(u),p=i[u];if(p!==void 0){var d=typeof r=="function"?r:r[u]||r[l];if(d){var f=d===ho?Ti:d(vn(p),h(h({},c),{fieldName:l,storeFieldName:u,storage:n.getStorage(e,u)}));f===Dc?n.group.dirty(e,u):(f===Ti&&(f=void 0),f!==p&&(a[u]=f,o=!0,p=f))}p!==void 0&&(s=!1)}}),o)return this.merge(e,a),s&&(this instanceof $t?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]=ho,i):ho)}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 $t&&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=dt(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 $t?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 $t;)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 yt(Xe)},t.prototype.depend=function(e,r){if(this.d){this.d(mo(e,r));var n=at(r);n!==r&&this.d(mo(e,n)),this.parent&&this.parent.depend(e,r)}},t.prototype.dirty=function(e,r){this.d&&this.d.dirty(mo(e,r),r==="__exists"?"forget":"setDirty")},t}();function mo(t,e){return e+"#"+t}function yo(t,e){sr(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,c=i.seed,u=r.call(this,a,new kc(s))||this;return u.stump=new Tf(u),u.storageTrie=new yt(Xe),c&&u.replace(c),u}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})(Ur||(Ur={}));var $t=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(c){se(o[c],s[c])||n.group.dirty(a,c)}):(n.group.dirty(a,"__exists"),Object.keys(s).forEach(function(c){n.group.dirty(a,c)})):n.delete(a)}),i):i===this.parent?this:i.addLayer(this.id,this.replay)},e.prototype.toObject=function(){return h(h({},this.parent.toObject()),this.data)},e.prototype.findChildRefIds=function(r){var n=this.parent.findChildRefIds(r);return he.call(this.data,r)?h(h({},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}(Ur),Tf=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}($t);function xf(t,e,r){var n=t[r],i=e[r];return se(n,i)?n:i}function sr(t){return!!(t instanceof Ur&&t.group.caching)}function If(t){return K(t)?re(t)?t.slice(0):h({__proto__:Object.getPrototypeOf(t)},t):t}var xi=function(){function t(){this.known=new(Cs?WeakSet:Set),this.pool=new yt(Xe),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=If(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),c=[s],u=this.sortedKeys(e);c.push(u.json);var l=c.length;u.sorted.forEach(function(f){c.push(r.admit(e[f]))});var o=this.pool.lookupArray(c);if(!o.object){var p=o.object=Object.create(s);this.known.add(p),u.sorted.forEach(function(f,m){p[f]=c[l+m]}),__DEV__&&Object.freeze(p)}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 We=Object.assign(function(t){if(K(t)){go===void 0&&Nc();var e=go.admit(t),r=vo.get(e);return r===void 0&&vo.set(e,r=JSON.stringify(e)),r}return JSON.stringify(t)},{reset:Nc}),go,vo;function Nc(){go=new xi,vo=new(Xe?WeakMap:Map)}function Ac(t){return[t.selectionSet,t.objectOrReference,t.context,t.context.canonizeResults]}var Pc=function(){function t(e){var r=this;this.knownResults=new(Xe?WeakMap:Map),this.config=Ft(e,{addTypename:e.addTypename!==!1,canonizeResults:Ei(e)}),this.canon=e.canon||new xi,this.executeSelectionSet=or(function(n){var i,a=n.context.canonizeResults,o=Ac(n);o[3]=!a;var s=(i=r.executeSelectionSet).peek.apply(i,o);return s?a?h(h({},s),{result:r.canon.admit(s.result)}):s:(yo(n.context.store,n.enclosingRef.__ref),r.execSelectionSetImpl(n))},{max:this.config.resultCacheMaxSize,keyArgs:Ac,makeCacheKey:function(n,i,a,o){if(sr(a.store))return a.store.makeCacheKey(n,Q(i)?i.__ref:i,a.varString,o)}}),this.executeSubSelectedArray=or(function(n){return yo(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(sr(o.store))return o.store.makeCacheKey(i,a,o.varString)}})}return t.prototype.resetCanon=function(){this.canon=new xi},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,c=s===void 0?!0:s,u=e.canonizeResults,l=u===void 0?this.config.canonizeResults:u,p=this.config.cache.policies;o=h(h({},nr(mn(n))),o);var d=ht(a),f=this.executeSelectionSet({selectionSet:rr(n).selectionSet,objectOrReference:d,enclosingRef:d,context:h({store:r,query:n,policies:p,variables:o,varString:We(o),canonizeResults:l},Oi(n,this.config.fragments))}),m;if(f.missing&&(m=[new Tn(Df(f.missing),f.missing,n,o)],!c))throw m[0];return{result:f.result,complete:!m,missing:m}},t.prototype.isFresh=function(e,r,n,i){if(sr(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,c=o.policies,u=o.store,l=u.getFieldValue(i,"__typename"),p=[],d,f=new $e;this.config.addTypename&&typeof l=="string"&&!c.rootIdsByTypename[l]&&p.push({__typename:l});function m(S,O){var k;return S.missing&&(d=f.merge(d,(k={},k[O]=S.missing,k))),S.result}var y=new Set(n.selections);y.forEach(function(S){var O,k;if(!!wt(S,s))if(Ge(S)){var N=c.readField({fieldName:S.name.value,field:S,variables:o.variables,from:i},o),D=Ye(S);N===void 0?ir.added(S)||(d=f.merge(d,(O={},O[D]="Can't find field '".concat(S.name.value,"' on ").concat(Q(i)?i.__ref+" object":"object "+JSON.stringify(i,null,2)),O))):re(N)?N=m(r.executeSubSelectedArray({field:S,array:N,enclosingRef:a,context:o}),D):S.selectionSet?N!=null&&(N=m(r.executeSelectionSet({selectionSet:S.selectionSet,objectOrReference:N,enclosingRef:Q(N)?N:a,context:o}),D)):o.canonizeResults&&(N=r.canon.pass(N)),N!==void 0&&p.push((k={},k[D]=N,k))}else{var C=er(S,o.lookupFragment);if(!C&&S.kind===ve.FRAGMENT_SPREAD)throw __DEV__?new M("No fragment named ".concat(S.name.value)):new M(5);C&&c.fragmentMatches(C,l)&&C.selectionSet.selections.forEach(y.add,y)}});var b=yn(p),E={result:b,missing:d},v=o.canonizeResults?this.canon.admit(E):vn(E);return v.result&&this.knownResults.set(v.result,n),v},t.prototype.execSubSelectedArrayImpl=function(e){var r=this,n=e.field,i=e.array,a=e.enclosingRef,o=e.context,s,c=new $e;function u(l,p){var d;return l.missing&&(s=c.merge(s,(d={},d[p]=l.missing,d))),l.result}return n.selectionSet&&(i=i.filter(o.store.canRead)),i=i.map(function(l,p){return l===null?null:re(l)?u(r.executeSubSelectedArray({field:n,array:l,enclosingRef:a,context:o}),p):n.selectionSet?u(r.executeSelectionSet({selectionSet:n.selectionSet,objectOrReference:l,enclosingRef:Q(l)?l:a,context:o}),p):(__DEV__&&kf(o.store,n,l),l)}),{result:o.canonizeResults?this.canon.admit(i):i,missing:s}},t}();function Df(t){try{JSON.stringify(t,function(e,r){if(typeof r=="string")throw r;return r})}catch(e){return e}}function kf(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(xc(t,i)," returned for query field ").concat(e.name.value)):I(!Q(i),6),Object.values(i).forEach(n.add,n))})}}var qr=new jr,Cc=new WeakMap;function In(t){var e=Cc.get(t);return e||Cc.set(t,e={vars:new Set,dep:Si()}),e}function bo(t){In(t).vars.forEach(function(e){return e.forgetCache(t)})}function Rc(t){In(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(c){In(c).dep.dirty(n),Nf(c)});var o=Array.from(r);r.clear(),o.forEach(function(c){return c(t)})}}else{var s=qr.getValue();s&&(i(s),In(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),In(a).vars.add(n),n};return n.forgetCache=function(a){return e.delete(a)},n}function Nf(t){t.broadcastWatches&&t.broadcastWatches()}var Lc=Object.create(null);function So(t){var e=JSON.stringify(t);return Lc[e]||(Lc[e]=Object.create(null))}function wo(t){var e=So(t);return e.keyFieldsFn||(e.keyFieldsFn=function(r,n){var i=function(o,s){return n.readField(s,o)},a=n.keyObject=Eo(t,function(o){var s=Vr(n.storeObject,o,i);return s===void 0&&r!==n.storeObject&&he.call(r,o[0])&&(s=Vr(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 _o(t){var e=So(t);return e.keyArgsFn||(e.keyArgsFn=function(r,n){var i=n.field,a=n.variables,o=n.fieldName,s=Eo(t,function(u){var l=u[0],p=l.charAt(0);if(p==="@"){if(i&&Se(i.directives)){var d=l.slice(1),f=i.directives.find(function(E){return E.name.value===d}),m=f&&_t(f,a);return m&&Vr(m,u.slice(1))}return}if(p==="$"){var y=l.slice(1);if(a&&he.call(a,y)){var b=u.slice(0);return b[0]=y,Vr(a,b)}return}if(r)return Vr(r,u)}),c=JSON.stringify(s);return(r||c!=="{}")&&(o+=":"+c),o})}function Eo(t,e){var r=new $e;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=So(t);if(!e.paths){var r=e.paths=[],n=[];t.forEach(function(i,a){re(i)?(Fc(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 Mc(t,e){return t[e]}function Vr(t,e,r){return r=r||Mc,jc(e.reduce(function n(i,a){return re(i)?i.map(function(o){return n(o,a)}):i&&r(i,a)},t))}function jc(t){return K(t)?re(t)?t.map(jc):Eo(Object.keys(t).sort(),function(e){return Vr(t,e)}):t}dn.setStringify(We);function Oo(t){return t.args!==void 0?t.args:t.field?_t(t.field,t.variables):null}var Af=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=h({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=h(h({},r),{typename:a,storeObject:o,readField:r&&r.readField||function(){var d=Di(arguments,o);return i.readField(d,{store:i.cache.data,variables:d.variables})}}),c,u=a&&this.getTypePolicy(a),l=u&&u.keyFn||this.config.dataIdFromObject;l;){var p=l(e,s);if(re(p))l=wo(p);else{c=p;break}}return c=c?String(c):void 0,s.keyObject?[c,s.keyObject]:[c]},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,c=dt(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(c):r.toBeAdded[n]=[c]})},t.prototype.updateTypePolicy=function(e,r){var n=this,i=this.getTypePolicy(e),a=r.keyFields,o=r.fields;function s(c,u){c.merge=typeof u=="function"?u:u===!0?Uc:u===!1?qc:c.merge}s(i,r.merge),i.keyFn=a===!1?Af:re(a)?wo(a):typeof a=="function"?a:i.keyFn,o&&Object.keys(o).forEach(function(c){var u=n.getFieldPolicy(e,c,!0),l=o[c];if(typeof l=="function")u.read=l;else{var p=l.keyArgs,d=l.read,f=l.merge;u.keyFn=p===!1?$c:re(p)?_o(p):typeof p=="function"?p:u.keyFn,typeof d=="function"&&(u.read=d),s(u,f)}u.read&&u.merge&&(u.keyFn=u.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(po);(!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),c=s.fields,u=dt(s,["fields"]);Object.assign(n,u),Object.assign(n.fields,c)})}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),c=[s],u=function(m){var y=a.getSupertypeSet(m,!1);y&&y.size&&c.indexOf(y)<0&&c.push(y)},l=!!(n&&this.fuzzySubtypes.size),p=!1,d=0;d<c.length;++d){var f=c[d];if(f.has(o))return s.has(o)||(p&&__DEV__&&I.warn("Inferring subtype ".concat(r," of supertype ").concat(o)),s.add(o)),!0;f.forEach(u),l&&d===c.length-1&&wi(e.selectionSet,n,i)&&(l=!1,p=!0,this.fuzzySubtypes.forEach(function(m,y){var b=r.match(m);b&&b[0]===r&&u(y)}))}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},c=Oo(e);o;){var u=o(c,s);if(re(u))o=_o(u);else{a=u||n;break}}return a===void 0&&(a=e.field?Ca(e.field,e.variables):dn(n,Oo(e))),a===!1?n:n===at(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=at(o),c=r.store.getFieldValue(n,o),u=this.getFieldPolicy(e.typename,s,!1),l=u&&u.read;if(l){var p=Vc(this,n,e,r,r.store.getStorage(Q(n)?n.__ref:n,o));return qr.withValue(this.cache,l,[c,p])}return c}}},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,c=n.merge;return c===Uc?Qc(i.store)(e,r):c===qc?r:(i.overwrite&&(e=void 0),c(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=at(a),s=r.variables||n.variables,c=n.store,u=c.toReference,l=c.canRead;return{args:Oo(r),field:r.field||null,fieldName:o,storeFieldName:a,variables:s,isReference:Q,toReference:u,storage:i,cache:t.cache,canRead:l,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=h({},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(re(r)||re(n))throw __DEV__?new M("Cannot automatically merge arrays"):new M(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)&&jt(n))return t.merge(r.__ref,n),r;if(jt(r)&&Q(n))return t.merge(r,n.__ref),n;if(jt(r)&&jt(n))return h(h({},r),n)}return n}}function To(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:h(h({},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,c=r.overwrite,u=mt(i),l=Ic();s=h(h({},nr(u)),s);var p=h(h({store:e,written:Object.create(null),merge:function(f,m){return l.merge(f,m)},variables:s,varString:We(s)},Oi(i,this.fragments)),{overwrite:!!c,incomingById:new Map,clientOnly:!1,deferred:!1,flavors:new Map}),d=this.processSelectionSet({result:a||Object.create(null),dataId:o,selectionSet:u.selectionSet,mergeTree:{map:new Map},context:p});if(!Q(d))throw __DEV__?new M("Could not identify object ".concat(JSON.stringify(a))):new M(7);return p.incomingById.forEach(function(f,m){var y=f.storeObject,b=f.mergeTree,E=f.fieldNodeSet,v=ht(m);if(b&&b.map.size){var S=n.applyMerges(b,v,y,p);if(Q(S))return;y=S}if(__DEV__&&!p.overwrite){var O=Object.create(null);E.forEach(function(D){D.selectionSet&&(O[D.name.value]=!0)});var k=function(D){return O[at(D)]===!0},N=function(D){var C=b&&b.map.get(D);return Boolean(C&&C.info&&C.info.merge)};Object.keys(y).forEach(function(D){k(D)&&!N(D)&&Pf(v,y,D,p.store)})}e.merge(m,y)}),e.retain(d.__ref),d},t.prototype.processSelectionSet=function(e){var r=this,n=e.dataId,i=e.result,a=e.selectionSet,o=e.context,s=e.mergeTree,c=this.cache.policies,u=Object.create(null),l=n&&c.rootTypenamesById[n]||hn(i,a,o.fragmentMap)||n&&o.store.get(n,"__typename");typeof l=="string"&&(u.__typename=l);var p=function(){var S=Di(arguments,u,o.variables);if(Q(S.from)){var O=o.incomingById.get(S.from.__ref);if(O){var k=c.readField(h(h({},S),{from:O.storeObject}),o);if(k!==void 0)return k}}return c.readField(S,o)},d=new Set;this.flattenFields(a,i,o,l).forEach(function(S,O){var k,N=Ye(O),D=i[N];if(d.add(O),D!==void 0){var C=c.getStoreFieldName({typename:l,fieldName:O.name.value,field:O,variables:S.variables}),te=Gc(s,C),Y=r.processFieldValue(D,O,O.selectionSet?To(S,!1,!1):S,te),lt=void 0;O.selectionSet&&(Q(Y)||jt(Y))&&(lt=p("__typename",Y));var St=c.getMergeFunction(l,O.name.value,lt);St?te.info={field:O,typename:l,merge:St}:Wc(s,C),u=S.merge(u,(k={},k[C]=Y,k))}else __DEV__&&!S.clientOnly&&!S.deferred&&!ir.added(O)&&!c.getReadFunction(l,O.name.value)&&__DEV__&&I.error("Missing field '".concat(Ye(O),"' while writing result ").concat(JSON.stringify(i,null,2)).substring(0,1e3))});try{var f=c.identify(i,{typename:l,selectionSet:a,fragmentMap:o.fragmentMap,storeObject:u,readField:p}),m=f[0],y=f[1];n=n||m,y&&(u=o.merge(u,y))}catch(S){if(!n)throw S}if(typeof n=="string"){var b=ht(n),E=o.written[n]||(o.written[n]=[]);if(E.indexOf(a)>=0||(E.push(a),this.reader&&this.reader.isFresh(i,b,a,o)))return b;var v=o.incomingById.get(n);return v?(v.storeObject=o.merge(v.storeObject,u),v.mergeTree=xo(v.mergeTree,s),d.forEach(function(S){return v.fieldNodeSet.add(S)})):o.incomingById.set(n,{storeObject:u,mergeTree:ki(s)?void 0:s,fieldNodeSet:d}),b}return u},t.prototype.processFieldValue=function(e,r,n,i){var a=this;return!r.selectionSet||e===null?__DEV__?ui(e):e:re(e)?e.map(function(o,s){var c=a.processFieldValue(o,r,n,Gc(i,s));return Wc(i,s),c}):this.processSelectionSet({result:e,selectionSet:r.selectionSet,context:n,mergeTree:i})},t.prototype.flattenFields=function(e,r,n,i){i===void 0&&(i=hn(r,e,n.fragmentMap));var a=new Map,o=this.cache.policies,s=new yt(!1);return function c(u,l){var p=s.lookup(u,l.clientOnly,l.deferred);p.visited||(p.visited=!0,u.selections.forEach(function(d){if(!!wt(d,n.variables)){var f=l.clientOnly,m=l.deferred;if(!(f&&m)&&Se(d.directives)&&d.directives.forEach(function(E){var v=E.name.value;if(v==="client"&&(f=!0),v==="defer"){var S=_t(E,n.variables);(!S||S.if!==!1)&&(m=!0)}}),Ge(d)){var y=a.get(d);y&&(f=f&&y.clientOnly,m=m&&y.deferred),a.set(d,To(n,f,m))}else{var b=er(d,n.lookupFragment);if(!b&&d.kind===ve.FRAGMENT_SPREAD)throw __DEV__?new M("No fragment named ".concat(d.name.value)):new M(8);b&&o.fragmentMatches(b,i,r,n.variables)&&c(b.selectionSet,To(n,f,m))}}}))}(e,n),a},t.prototype.applyMerges=function(e,r,n,i,a){var o,s=this;if(e.map.size&&!Q(n)){var c=!re(n)&&(Q(r)||jt(r))?r:void 0,u=n;c&&!a&&(a=[Q(c)?c.__ref:c]);var l,p=function(d,f){return re(d)?typeof f=="number"?d[f]:void 0:i.store.getFieldValue(d,String(f))};e.map.forEach(function(d,f){var m=p(c,f),y=p(u,f);if(y!==void 0){a&&a.push(f);var b=s.applyMerges(d,m,y,i,a);b!==y&&(l=l||new Map,l.set(f,b)),a&&I(a.pop()===f)}}),l&&(n=re(u)?u.slice(0):h({},u),l.forEach(function(d,f){n[f]=d}))}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 xo(t,e){if(t===e||!e||ki(e))return t;if(!t||ki(t))return e;var r=t.info&&e.info?h(h({},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,c){a.map.set(c,xo(s,e.map.get(c))),o.delete(c)}),o.forEach(function(s){a.map.set(s,xo(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 Pf(t,e,r,n){var i=function(p){var d=n.getFieldValue(p,r);return typeof d=="object"&&d},a=i(t);if(!!a){var o=i(e);if(!!o&&!Q(a)&&!se(a,o)&&!Object.keys(a).every(function(p){return n.getFieldValue(o,p)!==void 0})){var s=n.getFieldValue(t,"__typename")||n.getFieldValue(e,"__typename"),c=at(r),u="".concat(s,".").concat(c);if(!Kc.has(u)){Kc.add(u);var l=[];!re(a)&&!re(o)&&[a,o].forEach(function(p){var d=n.getFieldValue(p,"__typename");typeof d=="string"&&!l.includes(d)&&l.push(d)}),__DEV__&&I.warn("Cache data may be lost when replacing the ".concat(c," field of a ").concat(s,` object.
37
37
 
38
38
  To address this problem (which is not a bug in Apollo Client), `).concat(l.length?"either ensure all objects of type "+l.join(" and ")+" have an ID or a custom merge function, or ":"","define a custom merge function for the ").concat(u,` 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 Pi=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=ki,n.txCount=0,n.config=Ic(r),n.addTypename=!!n.config.addTypename,n.policies=new Gc({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 Ur.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 Hc(this,this.storeReader=new Rc({cache:this,addTypename:this.addTypename,resultCacheMaxSize:this.config.resultCacheMaxSize,canonizeResults:Ti(this.config),canon:r?void 0:i&&i.canon,fragments:a}),a),this.maybeBroadcastWatch=or(function(o,s){return n.broadcastWatch(o,s)},{max:this.config.resultCacheMaxSize,makeCacheKey:function(o){var s=o.optimistic?n.optimisticData:n.data;if(sr(s)){var c=o.optimistic,u=o.id,l=o.variables;return s.makeCacheKey(o.query,o.callback,We({optimistic:c,id:u,variables:l}))}}}),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(h(h({},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(h(h({},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||Fc(this),this.watches.add(r),r.immediate&&this.maybeBroadcastWatch(r),function(){n.watches.delete(r)&&!n.watches.size&&So(n),n.maybeBroadcastWatch.forget(r)}},e.prototype.gc=function(r){We.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=h(h({},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(),We.reset(),r&&r.discardWatches?(this.watches.forEach(function(i){return n.maybeBroadcastWatch.forget(i)}),this.watches.clear(),So(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,c=r.onWatchUpdated,u,l=function(d){var f=n,m=f.data,y=f.optimisticData;++n.txCount,d&&(n.data=n.optimisticData=d);try{return u=i(n)}finally{--n.txCount,n.data=m,n.optimisticData=y}},p=new Set;return c&&!this.txCount&&this.broadcastWatches(h(h({},r),{onWatchUpdated:function(d){return p.add(d),!1}})),typeof o=="string"?this.optimisticData=this.optimisticData.addLayer(o,l):o===!1?l(this.data):l(),typeof s=="string"&&(this.optimisticData=this.optimisticData.removeLayer(s)),c&&p.size?(this.broadcastWatches(h(h({},r),{onWatchUpdated:function(d,f){var m=c.call(this,d,f);return m!==!1&&p.delete(d),m}})),p.size&&p.forEach(function(d){return n.maybeBroadcastWatch.dirty(d)})):this.broadcastWatches(r),u},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=ir(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}(po);function Xc(t){return t.hasOwnProperty("graphQLErrors")}var Cf=function(t){var e="";if(Se(t.graphQLErrors)||Se(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 Ni=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=Tc(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 Ur.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=or(function(o,s){return n.broadcastWatch(o,s)},{max:this.config.resultCacheMaxSize,makeCacheKey:function(o){var s=o.optimistic?n.optimisticData:n.data;if(sr(s)){var c=o.optimistic,u=o.id,l=o.variables;return s.makeCacheKey(o.query,o.callback,We({optimistic:c,id:u,variables:l}))}}}),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(h(h({},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(h(h({},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&&bo(n),n.maybeBroadcastWatch.forget(r)}},e.prototype.gc=function(r){We.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=h(h({},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(),We.reset(),r&&r.discardWatches?(this.watches.forEach(function(i){return n.maybeBroadcastWatch.forget(i)}),this.watches.clear(),bo(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,c=r.onWatchUpdated,u,l=function(d){var f=n,m=f.data,y=f.optimisticData;++n.txCount,d&&(n.data=n.optimisticData=d);try{return u=i(n)}finally{--n.txCount,n.data=m,n.optimisticData=y}},p=new Set;return c&&!this.txCount&&this.broadcastWatches(h(h({},r),{onWatchUpdated:function(d){return p.add(d),!1}})),typeof o=="string"?this.optimisticData=this.optimisticData.addLayer(o,l):o===!1?l(this.data):l(),typeof s=="string"&&(this.optimisticData=this.optimisticData.removeLayer(s)),c&&p.size?(this.broadcastWatches(h(h({},r),{onWatchUpdated:function(d,f){var m=c.call(this,d,f);return m!==!1&&p.delete(d),m}})),p.size&&p.forEach(function(d){return n.maybeBroadcastWatch.dirty(d)})):this.broadcastWatches(r),u},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=ir(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}(fo);function Hc(t){return t.hasOwnProperty("graphQLErrors")}var Cf=function(t){var e="";if(Se(t.graphQLErrors)||Se(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},Et=function(t){de(e,t);function e(r){var n=r.graphQLErrors,i=r.clientErrors,a=r.networkError,o=r.errorMessage,s=r.extraInfo,c=t.call(this,o)||this;return c.name="ApolloError",c.graphQLErrors=n||[],c.clientErrors=i||[],c.networkError=a||null,c.message=o||Cf(c),c.extraInfo=s,c.__proto__=e.prototype,c}return e}(Error);var Z;(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"})(Z||(Z={}));function Ut(t){return t?t<7:!1}var Rf=Object.assign,Lf=Object.hasOwnProperty,Ci=function(t){de(e,t);function e(r){var n=r.queryManager,i=r.queryInfo,a=r.options,o=t.call(this,function(b){try{var E=b._subscription._observer;E&&!E.error&&(E.error=Ff)}catch{}var v=!o.observers.size;o.observers.add(b);var S=o.last;return S&&S.error?b.error&&b.error(S.error):S&&S.result&&b.next&&b.next(S.result),v&&o.reobserve().catch(function(){}),function(){o.observers.delete(b)&&!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,c=s===void 0?{}:s,u=c.fetchPolicy,l=u===void 0?"cache-first":u,p=a.fetchPolicy,d=p===void 0?l:p,f=a.initialFetchPolicy,m=f===void 0?d==="standby"?l:d:f;o.options=h(h({},a),{initialFetchPolicy:m,fetchPolicy:d}),o.queryId=i.queryId||n.generateQueryId();var y=mt(o.query);return o.queryName=y&&y.name&&y.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||Z.ready,a=h(h({},n),{loading:Ut(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 c=this.queryInfo.getDiff();(c.complete||this.options.returnPartialData)&&(a.data=c.result),se(a.data,{})&&(a.data=void 0),c.complete?(delete a.partial,c.complete&&a.networkStatus===Z.loading&&(s==="cache-first"||s==="cache-only")&&(a.networkStatus=Z.ready,a.loading=!1)):a.partial=!0,__DEV__&&!c.complete&&!this.options.partialRefetch&&!a.loading&&!a.data&&!a.error&&ko(c.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&&Lf.call(r,"variables")){var o=mn(this.query),s=o.variableDefinitions;(!s||!s.some(function(c){return c.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=h(h({},this.options.variables),r)),this.queryInfo.resetLastWrite(),this.reobserve(i,Z.refetch)},e.prototype.fetchMore=function(r){var n=this,i=h(h({},r.query?r:h(h(h(h({},this.options),{query:this.query}),r),{variables:h(h({},this.options.variables),r.variables)})),{fetchPolicy:"no-cache"}),a=this.queryManager.generateQueryId(),o=this.queryInfo,s=o.networkStatus;o.networkStatus=Z.fetchMore,i.notifyOnNetworkStatusChange&&this.observe();var c=new Set;return this.queryManager.fetchQuery(a,i,Z.fetchMore).then(function(u){return n.queryManager.removeQuery(a),o.networkStatus===Z.fetchMore&&(o.networkStatus=s),n.queryManager.cache.batch({update:function(l){var p=r.updateQuery;p?l.updateQuery({query:n.query,variables:n.variables,returnPartialData:!0,optimistic:!1},function(d){return p(d,{fetchMoreResult:u.data,variables:i.variables})}):l.writeQuery({query:i.query,variables:i.variables,data:u.data})},onWatchUpdated:function(l){c.add(l.query)}}),u}).finally(function(){c.has(n.query)||Do(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,c){var u=c.variables;return o(s,{subscriptionData:a,variables:u})})},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},Z.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&&(Ut(r.queryInfo.networkStatus)?c():r.reobserve({fetchPolicy:r.options.initialFetchPolicy==="no-cache"?"no-cache":"network-only"},Z.poll).then(c,c))},c=function(){var u=r.pollingInfo;u&&(clearTimeout(u.timeout),u.timeout=setTimeout(s,u.interval))};c()}}},e.prototype.updateLastResult=function(r,n){return n===void 0&&(n=this.variables),this.last=h(h({},this.last),{result:this.queryManager.assumeImmutableResults?r:fi(r),variables:n}),Se(r.errors)||delete this.last.error,this.last},e.prototype.reobserve=function(r,n){var i=this;this.isTornDown=!1;var a=n===Z.refetch||n===Z.fetchMore||n===Z.poll,o=this.options.variables,s=this.options.fetchPolicy,c=Ft(this.options,r||{}),u=a?c:Rf(this.options,c);a||(this.updatePolling(),r&&r.variables&&!se(r.variables,o)&&u.fetchPolicy!=="standby"&&u.fetchPolicy===s&&(this.applyNextFetchPolicy("variables-changed",u),n===void 0&&(n=Z.setVariables)));var l=u.variables&&h({},u.variables),p=this.fetch(u,n),d={next:function(f){i.reportResult(f,l)},error:function(f){i.reportError(f,l)}};return a||(this.concast&&this.observer&&this.concast.removeObserver(this.observer),this.concast=p,this.observer=d),p.addObserver(d),p.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),ar(this.observers,"next",r))},e.prototype.reportError=function(r,n){var i=h(h({},this.getLastResult()),{error:r,errors:r.graphQLErrors,networkStatus:Z.error,loading:!1});this.updateLastResult(i,n),ar(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}(V);di(Ci);function Do(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 Ff(t){__DEV__&&I.error("Unhandled error",t.message,t.stack)}function ko(t){__DEV__&&t&&__DEV__&&I.debug("Missing cache result fields: ".concat(JSON.stringify(t)),t)}var Ri=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=qa(r.resolvers,n)}):this.resolvers=qa(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 tt(this,void 0,void 0,function(){return rt(this,function(c){return r?[2,this.resolveDocument(r,n.data,i,a,this.fragmentMatcher,s).then(function(u){return h(h({},n),{data:u.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 Ua(e)},t.prototype.prepareContext=function(e){var r=this.cache;return h(h({},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={}),tt(this,void 0,void 0,function(){return rt(this,function(i){return e?[2,this.resolveDocument(e,this.buildRootValueFromCache(e,r)||{},this.prepareContext(n),r).then(function(a){return h(h({},r),a.exportedVariables)})]:[2,h({},r)]})})},t.prototype.shouldForceResolvers=function(e){var r=!1;return ke(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 Xt}}}),r},t.prototype.buildRootValueFromCache=function(e,r){return this.cache.diff({query:$a(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),tt(this,void 0,void 0,function(){var s,c,u,l,p,d,f,m,y,b,E;return rt(this,function(v){return s=rr(e),c=tr(e),u=Zt(c),l=this.collectSelectionsToResolve(s,u),p=s.operation,d=p?p.charAt(0).toUpperCase()+p.slice(1):"Query",f=this,m=f.cache,y=f.client,b={fragmentMap:u,context:h(h({},n),{cache:m,client:y}),variables:i,fragmentMatcher:a,defaultOperationType:d,exportedVariables:{},selectionsToResolve:l,onlyRunForcedResolvers:o},E=!1,[2,this.resolveSelectionSet(s.selectionSet,E,r,b).then(function(S){return{result:S,exportedVariables:b.exportedVariables}})]})})},t.prototype.resolveSelectionSet=function(e,r,n,i){return tt(this,void 0,void 0,function(){var a,o,s,c,u,l=this;return rt(this,function(p){return a=i.fragmentMap,o=i.context,s=i.variables,c=[n],u=function(d){return tt(l,void 0,void 0,function(){var f,m;return rt(this,function(y){return!r&&!i.selectionsToResolve.has(d)?[2]:wt(d,s)?Ge(d)?[2,this.resolveField(d,r,n,i).then(function(b){var E;typeof b<"u"&&c.push((E={},E[Ye(d)]=b,E))})]:(La(d)?f=d:(f=a[d.name.value],__DEV__?I(f,"No fragment named ".concat(d.name.value)):I(f,11)),f&&f.typeCondition&&(m=f.typeCondition.name.value,i.fragmentMatcher(n,m,o))?[2,this.resolveSelectionSet(f.selectionSet,r,n,i).then(function(b){c.push(b)})]:[2]):[2]})})},[2,Promise.all(e.selections.map(u)).then(function(){return yn(c)})]})})},t.prototype.resolveField=function(e,r,n,i){return tt(this,void 0,void 0,function(){var a,o,s,c,u,l,p,d,f,m=this;return rt(this,function(y){return n?(a=i.variables,o=e.name.value,s=Ye(e),c=o!==s,u=n[s]||n[o],l=Promise.resolve(u),(!i.onlyRunForcedResolvers||this.shouldForceResolvers(e))&&(p=n.__typename||i.defaultOperationType,d=this.resolvers&&this.resolvers[p],d&&(f=d[c?o:s],f&&(l=Promise.resolve(qr.withValue(this.cache,f,[n,_t(e,a),i.context,{field:e,fragmentMap:i.fragmentMap}]))))),[2,l.then(function(b){var E,v;if(b===void 0&&(b=u),e.directives&&e.directives.forEach(function(O){O.name.value==="export"&&O.arguments&&O.arguments.forEach(function(k){k.name.value==="as"&&k.value.kind==="StringValue"&&(i.exportedVariables[k.value.value]=b)})}),!e.selectionSet||b==null)return b;var S=(v=(E=e.directives)===null||E===void 0?void 0:E.some(function(O){return O.name.value==="client"}))!==null&&v!==void 0?v:!1;if(Array.isArray(b))return m.resolveSubSelectedArray(e,r||S,b,i);if(e.selectionSet)return m.resolveSelectionSet(e.selectionSet,r||S,b,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),ke(o,{Directive:function(c,u,l,p,d){c.name.value==="client"&&d.forEach(function(f){n(f)&&fn(f)&&s.add(f)})},FragmentSpread:function(c,u,l,p,d){var f=r[c.name.value];__DEV__?I(f,"No fragment named ".concat(c.name.value)):I(f,12);var m=a(f);m.size>0&&(d.forEach(function(y){n(y)&&fn(y)&&s.add(y)}),s.add(c),m.forEach(function(y){s.add(y)}))}})}return i.get(o)}return a(e)},t}();var Br=new(Xe?WeakMap:Map);function No(t,e){var r=t[e];typeof r=="function"&&(t[e]=function(){return Br.set(t,(Br.get(t)+1)%1e15),r.apply(this,arguments)})}function Zc(t){t.notifyTimeout&&(clearTimeout(t.notifyTimeout),t.notifyTimeout=void 0)}var Li=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;Br.has(n)||(Br.set(n,0),No(n,"evict"),No(n,"modify"),No(n,"reset"))}return t.prototype.init=function(e){var r=e.networkStatus||Z.loading;return this.variables&&this.networkStatus!==Z.loading&&!se(this.variables,e.variables)&&(r=Z.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(){Zc(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():Do(e)})):delete this.oqListener)},t.prototype.notify=function(){var e=this;Zc(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(Ut(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=h(h({},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===Br.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 $e,s=Se(e.errors)?e.errors.slice(0):[];if(this.reset(),"incremental"in e&&Se(e.incremental)){var c=hi(this.getDiff().result,e);e.data=c}else if("hasNext"in e&&e.hasNext){var u=this.getDiff();e.data=o.merge(u.result,e.data)}this.graphQLErrors=s,n.fetchPolicy==="no-cache"?this.updateLastDiff({result:e.data,complete:!0},this.getDiffOptions(n.variables)):i!==0&&(Fi(e,n.errorPolicy)?this.cache.performTransaction(function(l){if(a.shouldWrite(e,n.variables))l.writeQuery({query:r,data:e.data,variables:n.variables,overwrite:i===1}),a.lastWrite={result:e,variables:n.variables,dmCount:Br.get(a.cache)};else if(a.lastDiff&&a.lastDiff.diff.complete){e.data=a.lastDiff.diff.result;return}var p=a.getDiffOptions(n.variables),d=l.diff(p);a.stopped||a.updateWatch(n.variables),a.updateLastDiff(d,p),d.complete&&(e.data=d.result)}):this.lastWrite=void 0)},t.prototype.markReady=function(){return this.networkError=null,this.networkStatus=Z.ready},t.prototype.markError=function(e){return this.networkStatus=Z.error,this.lastWrite=void 0,this.reset(),e.graphQLErrors&&(this.graphQLErrors=e.graphQLErrors),e.networkError&&(this.networkError=e.networkError),e},t}();function Fi(t,e){e===void 0&&(e="none");var r=e==="ignore"||e==="all",n=!Fr(t);return!n&&r&&t.data&&(n=!0),n}var Mf=Object.prototype.hasOwnProperty,eu=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,c=e.ssrMode,u=c===void 0?!1:c,l=e.clientAwareness,p=l===void 0?{}:l,d=e.localState,f=e.assumeImmutableResults;this.clientAwareness={},this.queries=new Map,this.fetchCancelFns=new Map,this.transformCache=new(Xe?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=p,this.localState=d||new Ri({cache:r}),this.ssrMode=u,this.assumeImmutableResults=!!f,(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 M("QueryManager stopped while query was in flight"):new M(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,c=e.refetchQueries,u=c===void 0?[]:c,l=e.awaitRefetchQueries,p=l===void 0?!1:l,d=e.update,f=e.onQueryUpdated,m=e.fetchPolicy,y=m===void 0?((r=this.defaultOptions.mutate)===null||r===void 0?void 0:r.fetchPolicy)||"network-only":m,b=e.errorPolicy,E=b===void 0?((n=this.defaultOptions.mutate)===null||n===void 0?void 0:n.errorPolicy)||"none":b,v=e.keepRootFields,S=e.context;return tt(this,void 0,void 0,function(){var O,k,N,D,C,te;return rt(this,function(X){switch(X.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(y==="network-only"||y==="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(y==="network-only"||y==="no-cache",16),O=this.generateMutationId(),k=this.transform(i),N=k.document,D=k.hasClientExports,i=this.cache.transformForLink(N),a=this.getVariables(i,a),D?[4,this.localState.addExportedVariables(i,a,S)]:[3,2];case 1:a=X.sent(),X.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:y,errorPolicy:E,context:S,updateQueries:s,update:d,keepRootFields:v}),this.broadcastQueries(),te=this,[2,new Promise(function(lt,St){return pi(te.getObservableFromLink(i,h(h({},S),{optimisticResponse:o}),a,!1),function(Ee){if(Fr(Ee)&&E==="none")throw new Et({graphQLErrors:mi(Ee)});C&&(C.loading=!1,C.error=null);var $=h({},Ee);return typeof u=="function"&&(u=u($)),E==="ignore"&&Fr($)&&delete $.errors,te.markMutationResult({mutationId:O,result:$,document:i,variables:a,fetchPolicy:y,errorPolicy:E,context:S,update:d,updateQueries:s,awaitRefetchQueries:p,refetchQueries:u,removeOptimistic:o?O:void 0,onQueryUpdated:f,keepRootFields:v})}).subscribe({next:function(Ee){te.broadcastQueries(),(!("hasNext"in Ee)||Ee.hasNext===!1)&&lt(Ee)},error:function(Ee){C&&(C.loading=!1,C.error=Ee),o&&te.cache.removeOptimistic(O),te.broadcastQueries(),St(Ee instanceof Et?Ee:new Et({networkError:Ee}))}})})]}})})},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&&Fi(i,e.errorPolicy)){if(Lt(i)||a.push({result:i.data,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}),Lt(i)&&Se(i.incremental)){var s=r.diff({id:"ROOT_MUTATION",query:this.transform(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0}),c=void 0;s.result&&(c=hi(s.result,i)),typeof c<"u"&&(i.data=c,a.push({result:c,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}))}var u=e.updateQueries;u&&this.queries.forEach(function(p,d){var f=p.observableQuery,m=f&&f.queryName;if(!(!m||!Mf.call(u,m))){var y=u[m],b=n.queries.get(d),E=b.document,v=b.variables,S=r.diff({query:E,variables:v,returnPartialData:!0,optimistic:!1}),O=S.result,k=S.complete;if(k&&O){var N=y(O,{mutationResult:i,queryName:E&&Pr(E)||void 0,queryVariables:v});N&&a.push({result:N,dataId:"ROOT_QUERY",query:E,variables:v})}}})}if(a.length>0||e.refetchQueries||e.update||e.onQueryUpdated||e.removeOptimistic){var l=[];if(this.refetchQueries({updateCache:function(p){o||a.forEach(function(y){return p.write(y)});var d=e.update,f=!Ms(i)||Lt(i)&&!i.hasNext;if(d){if(!o){var m=p.diff({id:"ROOT_MUTATION",query:n.transform(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0});m.complete&&(i=h(h({},i),{data:m.result}),"incremental"in i&&delete i.incremental,"hasNext"in i&&delete i.hasNext)}f&&d(p,i,{context:e.context,variables:e.variables})}!o&&!e.keepRootFields&&f&&p.modify({id:"ROOT_MUTATION",fields:function(y,b){var E=b.fieldName,v=b.DELETE;return E==="__typename"?y:v}})},include:e.refetchQueries,optimistic:!1,removeOptimistic:e.removeOptimistic,onQueryUpdated:e.onQueryUpdated||null}).forEach(function(p){return l.push(p)}),e.awaitRefetchQueries||e.onQueryUpdated)return Promise.all(l).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(h(h({},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=ja(n),a=this.localState.clientQuery(n),o=i&&this.localState.serverQuery(i),s={document:n,hasClientExports:Aa(n),hasForcedResolvers:this.localState.shouldForceResolvers(n),clientQuery:a,serverQuery:o,defaultVars:nr(mt(n)),asQuery:h(h({},n),{definitions:n.definitions.map(function(u){return u.kind==="OperationDefinition"&&u.operation!=="query"?h(h({},u),{operation:"query"}):u})})},c=function(u){u&&!r.has(u)&&r.set(u,s)};c(e),c(n),c(a),c(o)}return r.get(e)},t.prototype.getVariables=function(e,r){return h(h({},this.transform(e).defaultVars),r)},t.prototype.watchQuery=function(e){e=h(h({},e),{variables:this.getVariables(e.query,e.variables)}),typeof e.notifyOnNetworkStatusChange>"u"&&(e.notifyOnNetworkStatusChange=!1);var r=new Li(this),n=new Ci({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 M("Store reset while query was in flight (not completed in link chain)"):new M(21)),this.queries.forEach(function(r){r.observableQuery?r.networkStatus=Z.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):Ca(o)?i.set(r.transform(o).document,!1):z(o)&&o.query&&a.add(o)}),this.queries.forEach(function(o,s){var c=o.observableQuery,u=o.document;if(c){if(e==="all"){n.set(s,c);return}var l=c.queryName,p=c.options.fetchPolicy;if(p==="standby"||e==="active"&&!c.hasObservers())return;(e==="active"||l&&i.has(l)||u&&i.has(u))&&(n.set(s,c),l&&i.set(l,!0),u&&i.set(u,!0))}}),a.size&&a.forEach(function(o){var s=bn("legacyOneTimeQuery"),c=r.getQuery(s).init({document:o.query,variables:o.variables}),u=new Ci({queryManager:r,queryInfo:c,options:h(h({},o),{fetchPolicy:"network-only"})});I(u.queryId===s),c.setObservableQuery(u),n.set(s,u)}),__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,c=s===void 0?{}:s;n=this.transform(n).document,o=this.getVariables(n,o);var u=function(p){return r.getObservableFromLink(n,c,p).map(function(d){if(i!=="no-cache"&&(Fi(d,a)&&r.cache.write({query:n,result:d.data,dataId:"ROOT_SUBSCRIPTION",variables:p}),r.broadcastQueries()),Fr(d))throw new Et({graphQLErrors:d.errors});return d})};if(this.transform(n).hasClientExports){var l=this.localState.addExportedVariables(n,o,c).then(u);return new V(function(p){var d=null;return l.then(function(f){return d=f.subscribe(p)},p.error),function(){return d&&d.unsubscribe()}})}return u(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,c=this.transform(e).serverQuery;if(c){var u=this,l=u.inFlightLinkObservables,p=u.link,d={query:c,variables:n,operationName:Pr(c)||void 0,context:this.prepareContext(h(h({},r),{forceFetch:!i}))};if(r=d.context,i){var f=l.get(c)||new Map;l.set(c,f);var m=We(n);if(s=f.get(m),!s){var y=new Lr([Mr(p,d)]);f.set(m,s=y),y.beforeNext(function(){f.delete(m)&&f.size<1&&l.delete(c)})}}else s=new Lr([Mr(p,d)])}else s=new Lr([V.of({data:{}})]),r=this.prepareContext(r);var b=this.transform(e).clientQuery;return b&&(s=pi(s,function(E){return a.localState.runResolvers({document:b,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 pi(this.getObservableFromLink(a,n.context,n.variables),function(o){var s=mi(o),c=s.length>0;if(i>=e.lastRequestId){if(c&&n.errorPolicy==="none")throw e.markError(new Et({graphQLErrors:s}));e.markResult(o,a,n,r),e.markReady()}var u={data:o.data,loading:!1,networkStatus:Z.ready};return c&&n.errorPolicy!=="ignore"&&(u.errors=s,u.networkStatus=Z.error),u},function(o){var s=Xc(o)?o:new Et({networkError:o});throw i>=e.lastRequestId&&e.markError(s),s})},t.prototype.fetchQueryObservable=function(e,r,n){var i=this;n===void 0&&(n=Z.loading);var a=this.transform(r.query).document,o=this.getVariables(a,r.variables),s=this.getQuery(e),c=this.defaultOptions.watchQuery,u=r.fetchPolicy,l=u===void 0?c&&c.fetchPolicy||"cache-first":u,p=r.errorPolicy,d=p===void 0?c&&c.errorPolicy||"none":p,f=r.returnPartialData,m=f===void 0?!1:f,y=r.notifyOnNetworkStatusChange,b=y===void 0?!1:y,E=r.context,v=E===void 0?{}:E,S=Object.assign({},r,{query:a,variables:o,fetchPolicy:l,errorPolicy:d,returnPartialData:m,notifyOnNetworkStatusChange:b,context:v}),O=function(D){S.variables=D;var C=i.fetchQueryByPolicy(s,S,n);return S.fetchPolicy!=="standby"&&C.length>0&&s.observableQuery&&s.observableQuery.applyNextFetchPolicy("after-fetch",r),C},k=function(){return i.fetchCancelFns.delete(e)};this.fetchCancelFns.set(e,function(D){k(),setTimeout(function(){return N.cancel(D)})});var N=new Lr(this.transform(S.query).hasClientExports?this.localState.addExportedVariables(S.query,S.variables,S.context).then(O):O(S.variables));return N.promise.then(k,k),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,c=s===void 0?o?bn("refetchQueries"):void 0:s,u=e.onQueryUpdated,l=new Map;i&&this.getObservableQueries(i).forEach(function(d,f){l.set(f,{oq:d,lastDiff:r.getQuery(f).getDiff()})});var p=new Map;return n&&this.cache.batch({update:n,optimistic:o&&c||!1,removeOptimistic:c,onWatchUpdated:function(d,f,m){var y=d.watcher instanceof Li&&d.watcher.observableQuery;if(y){if(u){l.delete(y.queryId);var b=u(y,f,m);return b===!0&&(b=y.refetch()),b!==!1&&p.set(y,b),b}u!==null&&l.set(y.queryId,{oq:y,lastDiff:m,diff:f})}}}),l.size&&l.forEach(function(d,f){var m=d.oq,y=d.lastDiff,b=d.diff,E;if(u){if(!b){var v=m.queryInfo;v.reset(),b=v.getDiff()}E=u(m,b,y)}(!u||E===!0)&&(E=m.refetch()),E!==!1&&p.set(m,E),f.indexOf("legacyOneTimeQuery")>=0&&r.stopQueryNoBroadcast(f)}),c&&this.cache.removeOptimistic(c),p},t.prototype.fetchQueryByPolicy=function(e,r,n){var i=this,a=r.query,o=r.variables,s=r.fetchPolicy,c=r.refetchWritePolicy,u=r.errorPolicy,l=r.returnPartialData,p=r.context,d=r.notifyOnNetworkStatusChange,f=e.networkStatus;e.init({document:this.transform(a).document,variables:o,networkStatus:n});var m=function(){return e.getDiff(o)},y=function(O,k){k===void 0&&(k=e.networkStatus||Z.loading);var N=O.result;__DEV__&&!l&&!se(N,{})&&ko(O.missing);var D=function(C){return V.of(h({data:C,loading:Ut(k),networkStatus:k},O.complete?null:{partial:!0}))};return N&&i.transform(a).hasForcedResolvers?i.localState.runResolvers({document:a,remoteResult:{data:N},context:p,variables:o,onlyRunForcedResolvers:!0}).then(function(C){return D(C.data||void 0)}):u==="none"&&k===Z.refetch&&Array.isArray(O.missing)?D(void 0):D(N)},b=s==="no-cache"?0:n===Z.refetch&&c!=="merge"?1:2,E=function(){return i.getResultsFromLink(e,b,{variables:o,context:p,fetchPolicy:s,errorPolicy:u})},v=d&&typeof f=="number"&&f!==n&&Ut(n);switch(s){default:case"cache-first":{var S=m();return S.complete?[y(S,e.markReady())]:l||v?[y(S),E()]:[E()]}case"cache-and-network":{var S=m();return S.complete||l||v?[y(S),E()]:[E()]}case"cache-only":return[y(m(),e.markReady())];case"network-only":return v?[y(m()),E()]:[E()];case"no-cache":return v?[y(e.getDiff()),E()]:[E()];case"standby":return[]}},t.prototype.getQuery=function(e){return e&&!this.queries.has(e)&&this.queries.set(e,new Li(this,e)),this.queries.get(e)},t.prototype.prepareContext=function(e){e===void 0&&(e={});var r=this.localState.prepareContext(e);return h(h({},r),{clientAwareness:this.clientAwareness})},t}();var tu=!1;var Ao=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,c=s===void 0?!1:s,u=e.ssrForceFetchDelay,l=u===void 0?0:u,p=e.connectToDevTools,d=p===void 0?typeof window=="object"&&!window.__APOLLO_CLIENT__&&__DEV__:p,f=e.queryDeduplication,m=f===void 0?!0:f,y=e.defaultOptions,b=e.assumeImmutableResults,E=b===void 0?!1:b,v=e.resolvers,S=e.typeDefs,O=e.fragmentMatcher,k=e.name,N=e.version,D=e.link;if(D||(D=n?new io({uri:n,credentials:i,headers:a}):Ze.empty()),!o)throw __DEV__?new M(`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 M(9);if(this.link=D,this.cache=o,this.disableNetworkFetches=c||l>0,this.queryDeduplication=m,this.defaultOptions=y||Object.create(null),this.typeDefs=S,l&&setTimeout(function(){return r.disableNetworkFetches=!1},l),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),d&&typeof window=="object"&&(window.__APOLLO_CLIENT__=this),!tu&&d&&__DEV__&&(tu=!0,typeof window<"u"&&window.document&&window.top===window.self&&!window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__)){var C=window.navigator,te=C&&C.userAgent,X=void 0;typeof te=="string"&&(te.indexOf("Chrome/")>-1?X="https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm":te.indexOf("Firefox/")>-1&&(X="https://addons.mozilla.org/en-US/firefox/addon/apollo-developer-tools/")),X&&__DEV__&&I.log("Download the Apollo DevTools for a better development experience: "+X)}this.version=qs,this.localState=new Ri({cache:o,client:this,resolvers:v,fragmentMatcher:O}),this.queryManager=new eu({cache:this.cache,link:this.link,defaultOptions:this.defaultOptions,queryDeduplication:m,ssrMode:c,clientAwareness:{name:k,version:N},localState:this.localState,assumeImmutableResults:E,onBroadcast:d?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=Sn(this.defaultOptions.watchQuery,e)),this.disableNetworkFetches&&(e.fetchPolicy==="network-only"||e.fetchPolicy==="cache-and-network")&&(e=h(h({},e),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(e)},t.prototype.query=function(e){return this.defaultOptions.query&&(e=Sn(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=h(h({},e),{fetchPolicy:"cache-first"})),this.queryManager.query(e)},t.prototype.mutate=function(e){return this.defaultOptions.mutate&&(e=Sn(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 Mr(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}();ds(Yt?"log":"silent");function Ae(t){return t===null?"null":Array.isArray(t)?"array":typeof t}function Ot(t){return Ae(t)==="object"}function ru(t){return Array.isArray(t)&&t.length>0&&t.every(e=>"message"in e)}function Po(t,e){return t.length<124?t:e}var nu="graphql-transport-ws";var Ue;(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"})(Ue||(Ue={}));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 iu(t){if(!Ot(t))throw new Error(`Message is expected to be an object, but got ${Ae(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 ${Ae(t.type)}`);switch(t.type){case me.ConnectionInit:case me.ConnectionAck:case me.Ping:case me.Pong:{if(t.payload!=null&&!Ot(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 ${Ae(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);if(!Ot(t.payload))throw new Error(`"${t.type}" message expects the 'payload' property to be an object, but got ${Ae(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 ${Ae(t.payload.query)}`);if(t.payload.variables!=null&&!Ot(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 ${Ae(t.payload.variables)}`);if(t.payload.operationName!=null&&Ae(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 ${Ae(t.payload.operationName)}`);if(t.payload.extensions!=null&&!Ot(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 ${Ae(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 ${Ae(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);if(!Ot(t.payload))throw new Error(`"${t.type}" message expects the 'payload' property to be an object, but got ${Ae(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 ${Ae(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);if(!ru(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 ${Ae(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 au(t,e){return iu(typeof t=="string"?JSON.parse(t,e):t)}function Qr(t,e){return iu(t),JSON.stringify(t,e)}function ou(t){let{url:e,connectionParams:r,lazy:n=!0,onNonLazyError:i=console.error,lazyCloseTimeout:a=0,keepAlive:o=0,disablePong:s,connectionAckWaitTimeout:c=0,retryAttempts:u=5,retryWait:l=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:p=Mi,isFatalConnectionProblem:d,on:f,webSocketImpl:m,generateID:y=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:b,jsonMessageReviver:E}=t,v;if(m){if(!$f(m))throw new Error("Invalid WebSocket implementation provided");v=m}else typeof WebSocket<"u"?v=WebSocket:typeof global<"u"?v=global.WebSocket||global.MozWebSocket:typeof window<"u"&&(v=window.WebSocket||window.MozWebSocket);if(!v)throw new Error("WebSocket implementation missing; on Node you can `import WebSocket from 'ws';` and pass `webSocketImpl: WebSocket` to `createClient`");let S=v,O=(()=>{let $=(()=>{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:f?.connecting?[f.connecting]:[],opened:f?.opened?[f.opened]:[],connected:f?.connected?[f.connected]:[],ping:f?.ping?[f.ping]:[],pong:f?.pong?[f.pong]:[],message:f?.message?[$.emit,f.message]:[$.emit],closed:f?.closed?[f.closed]:[],error:f?.error?[f.error]:[]};return{onMessage:$.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 k($){let pe=[O.on("error",ae=>{pe.forEach(W=>W()),$(ae)}),O.on("closed",ae=>{pe.forEach(W=>W()),$(ae)})]}let N,D=0,C,te=!1,X=0,lt=!1;async function St(){clearTimeout(C);let[$,pe]=await(N??(N=new Promise((K,ft)=>(async()=>{if(te){if(await l(X),!D)return N=void 0,ft({code:1e3,reason:"All Subscriptions Gone"});X++}O.emit("connecting");let q=new S(typeof e=="function"?await e():e,nu),pt,Nt;function ei(){isFinite(o)&&o>0&&(clearTimeout(Nt),Nt=setTimeout(()=>{q.readyState===S.OPEN&&(q.send(Qr({type:me.Ping})),O.emit("ping",!1,void 0))},o))}k(Oe=>{N=void 0,clearTimeout(pt),clearTimeout(Nt),ft(Oe),Mi(Oe)&&Oe.code===4499&&(q.close(4499,"Terminated"),q.onerror=null,q.onclose=null)}),q.onerror=Oe=>O.emit("error",Oe),q.onclose=Oe=>O.emit("closed",Oe),q.onopen=async()=>{try{O.emit("opened",q);let Oe=typeof r=="function"?await r():r;if(q.readyState!==S.OPEN)return;q.send(Qr(Oe?{type:me.ConnectionInit,payload:Oe}:{type:me.ConnectionInit},b)),isFinite(c)&&c>0&&(pt=setTimeout(()=>{q.close(Ue.ConnectionAcknowledgementTimeout,"Connection acknowledgement timeout")},c)),ei()}catch(Oe){O.emit("error",Oe),q.close(Ue.InternalClientError,Po(Oe instanceof Error?Oe.message:new Error(Oe).message,"Internal client error"))}};let Dr=!1;q.onmessage=({data:Oe})=>{try{let Te=au(Oe,E);if(O.emit("message",Te),Te.type==="ping"||Te.type==="pong"){O.emit(Te.type,!0,Te.payload),Te.type==="pong"?ei():s||(q.send(Qr(Te.payload?{type:me.Pong,payload:Te.payload}:{type:me.Pong})),O.emit("pong",!1,Te.payload));return}if(Dr)return;if(Te.type!==me.ConnectionAck)throw new Error(`First message cannot be of type ${Te.type}`);clearTimeout(pt),Dr=!0,O.emit("connected",q,Te.payload),te=!1,X=0,K([q,new Promise((Xp,Wu)=>k(Wu))])}catch(Te){q.onmessage=null,O.emit("error",Te),q.close(Ue.BadResponse,Po(Te instanceof Error?Te.message:new Error(Te).message,"Bad response"))}}})())));$.readyState===S.CLOSING&&await pe;let ae=()=>{},W=new Promise(K=>ae=K);return[$,ae,Promise.race([W.then(()=>{if(!D){let K=()=>$.close(1e3,"Normal Closure");isFinite(a)&&a>0?C=setTimeout(()=>{$.readyState===S.OPEN&&K()},a):K()}}),pe])]}function Ee($){if(Mi($)&&(jf($.code)||[Ue.InternalServerError,Ue.InternalClientError,Ue.BadRequest,Ue.BadResponse,Ue.Unauthorized,Ue.SubprotocolNotAcceptable,Ue.SubscriberAlreadyExists,Ue.TooManyInitialisationRequests].includes($.code)))throw $;if(lt)return!1;if(Mi($)&&$.code===1e3)return D>0;if(!u||X>=u||!p($)||d?.($))throw $;return te=!0}return n||(async()=>{for(D++;;)try{let[,,$]=await St();await $}catch($){try{if(!Ee($))return}catch(pe){return i?.(pe)}}})(),{on:O.on,subscribe($,pe){let ae=y($),W=!1,K=!1,ft=()=>{D--,W=!0};return(async()=>{for(D++;;)try{let[q,pt,Nt]=await St();if(W)return pt();let ei=O.onMessage(ae,Dr=>{switch(Dr.type){case me.Next:{pe.next(Dr.payload);return}case me.Error:{K=!0,W=!0,pe.error(Dr.payload),ft();return}case me.Complete:{W=!0,ft();return}}});q.send(Qr({id:ae,type:me.Subscribe,payload:$},b)),ft=()=>{!W&&q.readyState===S.OPEN&&q.send(Qr({id:ae,type:me.Complete},b)),D--,W=!0,pt()},await Nt.finally(ei);return}catch(q){if(!Ee(q))return}})().then(()=>{K||pe.complete()}).catch(q=>{pe.error(q)}),()=>{W||ft()}},async dispose(){if(lt=!0,N){let[$]=await N;$.close(1e3,"Normal Closure")}},terminate(){N&&O.emit("closed",{code:4499,reason:"Terminated",wasClean:!1})}}}function Mi(t){return Ot(t)&&"code"in t&&"reason"in t}function jf(t){return[1e3,1001,1006,1005,1012,1013,1013].includes(t)?!1:t>=1e3&&t<=1999}function $f(t){return typeof t=="function"&&"constructor"in t&&"CLOSED"in t&&"CLOSING"in t&&"CONNECTING"in t&&"OPEN"in t}function Uf(t){return z(t)&&"code"in t&&"reason"in t}var su=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 V(function(i){return n.client.subscribe(h(h({},r),{query:kr(r.query)}),{next:i.next.bind(i),complete:i.complete.bind(i),error:function(a){return a instanceof Error?i.error(a):Uf(a)?i.error(new Error("Socket closed with event ".concat(a.code," ").concat(a.reason||""))):i.error(new Et({graphQLErrors:Array.isArray(a)?a:[a]}))}})})},e}(Ze);var ra=function(){return ra=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},ra.apply(this,arguments)};typeof SuppressedError=="function"&&SuppressedError;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 qf(t){return Qi(t)=="object"&&t!==null}var Nu=typeof Symbol=="function"&&Symbol.toStringTag!=null?Symbol.toStringTag:"@@toStringTag";function jo(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 Vf(t){return Au(t.source,jo(t.source,t.start))}function Au(t,e){var r=t.locationOffset.column-1,n=Gi(r)+t.body,i=e.line-1,a=t.locationOffset.line-1,o=e.line+a,s=e.line===1?r:0,c=e.column+s,u="".concat(t.name,":").concat(o,":").concat(c,`
52
- `),l=n.split(/\r\n|[\n\r]/g),p=l[i];if(p.length>120){for(var d=Math.floor(c/80),f=c%80,m=[],y=0;y<p.length;y+=80)m.push(p.slice(y,y+80));return u+cu([["".concat(o),m[0]]].concat(m.slice(1,d+1).map(function(b){return["",b]}),[[" ",Gi(f-1)+"^"],["",m[d+1]]]))}return u+cu([["".concat(o-1),l[i-1]],["".concat(o),p],["",Gi(c-1)+"^"],["".concat(o+1),l[i+1]]])}function cu(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 Bf(r,i)+(a?" | "+a:" |")}).join(`
53
- `)}function Gi(t){return Array(t+1).join(" ")}function Bf(t,e){return Gi(t-e.length)+e}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)}function uu(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 Qf(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?uu(Object(r),!0).forEach(function(n){Gf(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):uu(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Gf(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Wf(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}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 Kf(t,e,r){return e&&lu(t.prototype,e),r&&lu(t,r),t}function zf(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&&Kn(t,e)}function Jf(t){var e=Cu();return function(){var n=zn(t),i;if(e){var a=zn(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return Pu(this,i)}}function Pu(t,e){return e&&(Wi(e)==="object"||typeof e=="function")?e:An(t)}function An(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function $o(t){var e=typeof Map=="function"?new Map:void 0;return $o=function(n){if(n===null||!Hf(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 Ki(n,arguments,zn(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),Kn(i,n)},$o(t)}function Ki(t,e,r){return Cu()?Ki=Reflect.construct:Ki=function(i,a,o){var s=[null];s.push.apply(s,a);var c=Function.bind.apply(i,s),u=new c;return o&&Kn(u,o.prototype),u},Ki.apply(null,arguments)}function Cu(){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 Hf(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function Kn(t,e){return Kn=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},Kn(t,e)}function zn(t){return zn=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},zn(t)}var Yf=function(t){zf(r,t);var e=Jf(r);function r(n,i,a,o,s,c,u){var l,p,d,f;Wf(this,r),f=e.call(this,n),f.name="GraphQLError",f.originalError=c??void 0,f.nodes=fu(Array.isArray(i)?i:i?[i]:void 0);for(var m=[],y=0,b=(E=f.nodes)!==null&&E!==void 0?E:[];y<b.length;y++){var E,v=b[y],S=v.loc;S!=null&&m.push(S)}m=fu(m),f.source=a??((l=m)===null||l===void 0?void 0:l[0].source),f.positions=o??((p=m)===null||p===void 0?void 0:p.map(function(k){return k.start})),f.locations=o&&a?o.map(function(k){return jo(a,k)}):(d=m)===null||d===void 0?void 0:d.map(function(k){return jo(k.source,k.start)}),f.path=s??void 0;var O=c?.extensions;return u==null&&qf(O)?f.extensions=Qf({},O):f.extensions=u??{},Object.defineProperties(An(f),{message:{enumerable:!0},locations:{enumerable:f.locations!=null},path:{enumerable:f.path!=null},extensions:{enumerable:f.extensions!=null&&Object.keys(f.extensions).length>0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),c!=null&&c.stack?(Object.defineProperty(An(f),"stack",{value:c.stack,writable:!0,configurable:!0}),Pu(f)):(Error.captureStackTrace?Error.captureStackTrace(An(f),r):Object.defineProperty(An(f),"stack",{value:Error().stack,writable:!0,configurable:!0}),f)}return Kf(r,[{key:"toString",value:function(){return Xf(this)}},{key:Nu,get:function(){return"Object"}}]),r}($o(Error));function fu(t){return t===void 0||t.length===0?void 0:t}function Xf(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},Et=function(t){de(e,t);function e(r){var n=r.graphQLErrors,i=r.clientErrors,a=r.networkError,o=r.errorMessage,s=r.extraInfo,c=t.call(this,o)||this;return c.name="ApolloError",c.graphQLErrors=n||[],c.clientErrors=i||[],c.networkError=a||null,c.message=o||Cf(c),c.extraInfo=s,c.__proto__=e.prototype,c}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 Ut(t){return t?t<7:!1}var Rf=Object.assign,Lf=Object.hasOwnProperty,Ai=function(t){de(e,t);function e(r){var n=r.queryManager,i=r.queryInfo,a=r.options,o=t.call(this,function(b){try{var E=b._subscription._observer;E&&!E.error&&(E.error=Ff)}catch{}var v=!o.observers.size;o.observers.add(b);var S=o.last;return S&&S.error?b.error&&b.error(S.error):S&&S.result&&b.next&&b.next(S.result),v&&o.reobserve().catch(function(){}),function(){o.observers.delete(b)&&!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,c=s===void 0?{}:s,u=c.fetchPolicy,l=u===void 0?"cache-first":u,p=a.fetchPolicy,d=p===void 0?l:p,f=a.initialFetchPolicy,m=f===void 0?d==="standby"?l:d:f;o.options=h(h({},a),{initialFetchPolicy:m,fetchPolicy:d}),o.queryId=i.queryId||n.generateQueryId();var y=mt(o.query);return o.queryName=y&&y.name&&y.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=h(h({},n),{loading:Ut(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 c=this.queryInfo.getDiff();(c.complete||this.options.returnPartialData)&&(a.data=c.result),se(a.data,{})&&(a.data=void 0),c.complete?(delete a.partial,c.complete&&a.networkStatus===X.loading&&(s==="cache-first"||s==="cache-only")&&(a.networkStatus=X.ready,a.loading=!1)):a.partial=!0,__DEV__&&!c.complete&&!this.options.partialRefetch&&!a.loading&&!a.data&&!a.error&&Do(c.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&&Lf.call(r,"variables")){var o=mn(this.query),s=o.variableDefinitions;(!s||!s.some(function(c){return c.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=h(h({},this.options.variables),r)),this.queryInfo.resetLastWrite(),this.reobserve(i,X.refetch)},e.prototype.fetchMore=function(r){var n=this,i=h(h({},r.query?r:h(h(h(h({},this.options),{query:this.query}),r),{variables:h(h({},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 c=new Set;return this.queryManager.fetchQuery(a,i,X.fetchMore).then(function(u){return n.queryManager.removeQuery(a),o.networkStatus===X.fetchMore&&(o.networkStatus=s),n.queryManager.cache.batch({update:function(l){var p=r.updateQuery;p?l.updateQuery({query:n.query,variables:n.variables,returnPartialData:!0,optimistic:!1},function(d){return p(d,{fetchMoreResult:u.data,variables:i.variables})}):l.writeQuery({query:i.query,variables:i.variables,data:u.data})},onWatchUpdated:function(l){c.add(l.query)}}),u}).finally(function(){c.has(n.query)||Io(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,c){var u=c.variables;return o(s,{subscriptionData:a,variables:u})})},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},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&&(Ut(r.queryInfo.networkStatus)?c():r.reobserve({fetchPolicy:r.options.initialFetchPolicy==="no-cache"?"no-cache":"network-only"},X.poll).then(c,c))},c=function(){var u=r.pollingInfo;u&&(clearTimeout(u.timeout),u.timeout=setTimeout(s,u.interval))};c()}}},e.prototype.updateLastResult=function(r,n){return n===void 0&&(n=this.variables),this.last=h(h({},this.last),{result:this.queryManager.assumeImmutableResults?r:ui(r),variables:n}),Se(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,c=Ft(this.options,r||{}),u=a?c:Rf(this.options,c);a||(this.updatePolling(),r&&r.variables&&!se(r.variables,o)&&u.fetchPolicy!=="standby"&&u.fetchPolicy===s&&(this.applyNextFetchPolicy("variables-changed",u),n===void 0&&(n=X.setVariables)));var l=u.variables&&h({},u.variables),p=this.fetch(u,n),d={next:function(f){i.reportResult(f,l)},error:function(f){i.reportError(f,l)}};return a||(this.concast&&this.observer&&this.concast.removeObserver(this.observer),this.concast=p,this.observer=d),p.addObserver(d),p.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),ar(this.observers,"next",r))},e.prototype.reportError=function(r,n){var i=h(h({},this.getLastResult()),{error:r,errors:r.graphQLErrors,networkStatus:X.error,loading:!1});this.updateLastResult(i,n),ar(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}(V);fi(Ai);function Io(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 Ff(t){__DEV__&&I.error("Unhandled error",t.message,t.stack)}function Do(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=Ua(r.resolvers,n)}):this.resolvers=Ua(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 tt(this,void 0,void 0,function(){return rt(this,function(c){return r?[2,this.resolveDocument(r,n.data,i,a,this.fragmentMatcher,s).then(function(u){return h(h({},n),{data:u.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 $a(e)},t.prototype.prepareContext=function(e){var r=this.cache;return h(h({},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={}),tt(this,void 0,void 0,function(){return rt(this,function(i){return e?[2,this.resolveDocument(e,this.buildRootValueFromCache(e,r)||{},this.prepareContext(n),r).then(function(a){return h(h({},r),a.exportedVariables)})]:[2,h({},r)]})})},t.prototype.shouldForceResolvers=function(e){var r=!1;return ke(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 Xt}}}),r},t.prototype.buildRootValueFromCache=function(e,r){return this.cache.diff({query:ja(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),tt(this,void 0,void 0,function(){var s,c,u,l,p,d,f,m,y,b,E;return rt(this,function(v){return s=rr(e),c=tr(e),u=Zt(c),l=this.collectSelectionsToResolve(s,u),p=s.operation,d=p?p.charAt(0).toUpperCase()+p.slice(1):"Query",f=this,m=f.cache,y=f.client,b={fragmentMap:u,context:h(h({},n),{cache:m,client:y}),variables:i,fragmentMatcher:a,defaultOperationType:d,exportedVariables:{},selectionsToResolve:l,onlyRunForcedResolvers:o},E=!1,[2,this.resolveSelectionSet(s.selectionSet,E,r,b).then(function(S){return{result:S,exportedVariables:b.exportedVariables}})]})})},t.prototype.resolveSelectionSet=function(e,r,n,i){return tt(this,void 0,void 0,function(){var a,o,s,c,u,l=this;return rt(this,function(p){return a=i.fragmentMap,o=i.context,s=i.variables,c=[n],u=function(d){return tt(l,void 0,void 0,function(){var f,m;return rt(this,function(y){return!r&&!i.selectionsToResolve.has(d)?[2]:wt(d,s)?Ge(d)?[2,this.resolveField(d,r,n,i).then(function(b){var E;typeof b<"u"&&c.push((E={},E[Ye(d)]=b,E))})]:(Ra(d)?f=d:(f=a[d.name.value],__DEV__?I(f,"No fragment named ".concat(d.name.value)):I(f,11)),f&&f.typeCondition&&(m=f.typeCondition.name.value,i.fragmentMatcher(n,m,o))?[2,this.resolveSelectionSet(f.selectionSet,r,n,i).then(function(b){c.push(b)})]:[2]):[2]})})},[2,Promise.all(e.selections.map(u)).then(function(){return yn(c)})]})})},t.prototype.resolveField=function(e,r,n,i){return tt(this,void 0,void 0,function(){var a,o,s,c,u,l,p,d,f,m=this;return rt(this,function(y){return n?(a=i.variables,o=e.name.value,s=Ye(e),c=o!==s,u=n[s]||n[o],l=Promise.resolve(u),(!i.onlyRunForcedResolvers||this.shouldForceResolvers(e))&&(p=n.__typename||i.defaultOperationType,d=this.resolvers&&this.resolvers[p],d&&(f=d[c?o:s],f&&(l=Promise.resolve(qr.withValue(this.cache,f,[n,_t(e,a),i.context,{field:e,fragmentMap:i.fragmentMap}]))))),[2,l.then(function(b){var E,v;if(b===void 0&&(b=u),e.directives&&e.directives.forEach(function(O){O.name.value==="export"&&O.arguments&&O.arguments.forEach(function(k){k.name.value==="as"&&k.value.kind==="StringValue"&&(i.exportedVariables[k.value.value]=b)})}),!e.selectionSet||b==null)return b;var S=(v=(E=e.directives)===null||E===void 0?void 0:E.some(function(O){return O.name.value==="client"}))!==null&&v!==void 0?v:!1;if(Array.isArray(b))return m.resolveSubSelectedArray(e,r||S,b,i);if(e.selectionSet)return m.resolveSelectionSet(e.selectionSet,r||S,b,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),ke(o,{Directive:function(c,u,l,p,d){c.name.value==="client"&&d.forEach(function(f){n(f)&&fn(f)&&s.add(f)})},FragmentSpread:function(c,u,l,p,d){var f=r[c.name.value];__DEV__?I(f,"No fragment named ".concat(c.name.value)):I(f,12);var m=a(f);m.size>0&&(d.forEach(function(y){n(y)&&fn(y)&&s.add(y)}),s.add(c),m.forEach(function(y){s.add(y)}))}})}return i.get(o)}return a(e)},t}();var Br=new(Xe?WeakMap:Map);function ko(t,e){var r=t[e];typeof r=="function"&&(t[e]=function(){return Br.set(t,(Br.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;Br.has(n)||(Br.set(n,0),ko(n,"evict"),ko(n,"modify"),ko(n,"reset"))}return t.prototype.init=function(e){var r=e.networkStatus||X.loading;return this.variables&&this.networkStatus!==X.loading&&!se(this.variables,e.variables)&&(r=X.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(){Yc(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():Io(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(Ut(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=h(h({},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===Br.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 $e,s=Se(e.errors)?e.errors.slice(0):[];if(this.reset(),"incremental"in e&&Se(e.incremental)){var c=pi(this.getDiff().result,e);e.data=c}else if("hasNext"in e&&e.hasNext){var u=this.getDiff();e.data=o.merge(u.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(l){if(a.shouldWrite(e,n.variables))l.writeQuery({query:r,data:e.data,variables:n.variables,overwrite:i===1}),a.lastWrite={result:e,variables:n.variables,dmCount:Br.get(a.cache)};else if(a.lastDiff&&a.lastDiff.diff.complete){e.data=a.lastDiff.diff.result;return}var p=a.getDiffOptions(n.variables),d=l.diff(p);a.stopped||a.updateWatch(n.variables),a.updateLastDiff(d,p),d.complete&&(e.data=d.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=!Fr(t);return!n&&r&&t.data&&(n=!0),n}var Mf=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,c=e.ssrMode,u=c===void 0?!1:c,l=e.clientAwareness,p=l===void 0?{}:l,d=e.localState,f=e.assumeImmutableResults;this.clientAwareness={},this.queries=new Map,this.fetchCancelFns=new Map,this.transformCache=new(Xe?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=p,this.localState=d||new Pi({cache:r}),this.ssrMode=u,this.assumeImmutableResults=!!f,(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 M("QueryManager stopped while query was in flight"):new M(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,c=e.refetchQueries,u=c===void 0?[]:c,l=e.awaitRefetchQueries,p=l===void 0?!1:l,d=e.update,f=e.onQueryUpdated,m=e.fetchPolicy,y=m===void 0?((r=this.defaultOptions.mutate)===null||r===void 0?void 0:r.fetchPolicy)||"network-only":m,b=e.errorPolicy,E=b===void 0?((n=this.defaultOptions.mutate)===null||n===void 0?void 0:n.errorPolicy)||"none":b,v=e.keepRootFields,S=e.context;return tt(this,void 0,void 0,function(){var O,k,N,D,C,te;return rt(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(y==="network-only"||y==="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(y==="network-only"||y==="no-cache",16),O=this.generateMutationId(),k=this.transform(i),N=k.document,D=k.hasClientExports,i=this.cache.transformForLink(N),a=this.getVariables(i,a),D?[4,this.localState.addExportedVariables(i,a,S)]:[3,2];case 1:a=Y.sent(),Y.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:y,errorPolicy:E,context:S,updateQueries:s,update:d,keepRootFields:v}),this.broadcastQueries(),te=this,[2,new Promise(function(lt,St){return li(te.getObservableFromLink(i,h(h({},S),{optimisticResponse:o}),a,!1),function(Ee){if(Fr(Ee)&&E==="none")throw new Et({graphQLErrors:di(Ee)});C&&(C.loading=!1,C.error=null);var $=h({},Ee);return typeof u=="function"&&(u=u($)),E==="ignore"&&Fr($)&&delete $.errors,te.markMutationResult({mutationId:O,result:$,document:i,variables:a,fetchPolicy:y,errorPolicy:E,context:S,update:d,updateQueries:s,awaitRefetchQueries:p,refetchQueries:u,removeOptimistic:o?O:void 0,onQueryUpdated:f,keepRootFields:v})}).subscribe({next:function(Ee){te.broadcastQueries(),(!("hasNext"in Ee)||Ee.hasNext===!1)&&lt(Ee)},error:function(Ee){C&&(C.loading=!1,C.error=Ee),o&&te.cache.removeOptimistic(O),te.broadcastQueries(),St(Ee instanceof Et?Ee:new Et({networkError:Ee}))}})})]}})})},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(Lt(i)||a.push({result:i.data,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}),Lt(i)&&Se(i.incremental)){var s=r.diff({id:"ROOT_MUTATION",query:this.transform(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0}),c=void 0;s.result&&(c=pi(s.result,i)),typeof c<"u"&&(i.data=c,a.push({result:c,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}))}var u=e.updateQueries;u&&this.queries.forEach(function(p,d){var f=p.observableQuery,m=f&&f.queryName;if(!(!m||!Mf.call(u,m))){var y=u[m],b=n.queries.get(d),E=b.document,v=b.variables,S=r.diff({query:E,variables:v,returnPartialData:!0,optimistic:!1}),O=S.result,k=S.complete;if(k&&O){var N=y(O,{mutationResult:i,queryName:E&&Pr(E)||void 0,queryVariables:v});N&&a.push({result:N,dataId:"ROOT_QUERY",query:E,variables:v})}}})}if(a.length>0||e.refetchQueries||e.update||e.onQueryUpdated||e.removeOptimistic){var l=[];if(this.refetchQueries({updateCache:function(p){o||a.forEach(function(y){return p.write(y)});var d=e.update,f=!Ls(i)||Lt(i)&&!i.hasNext;if(d){if(!o){var m=p.diff({id:"ROOT_MUTATION",query:n.transform(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0});m.complete&&(i=h(h({},i),{data:m.result}),"incremental"in i&&delete i.incremental,"hasNext"in i&&delete i.hasNext)}f&&d(p,i,{context:e.context,variables:e.variables})}!o&&!e.keepRootFields&&f&&p.modify({id:"ROOT_MUTATION",fields:function(y,b){var E=b.fieldName,v=b.DELETE;return E==="__typename"?y:v}})},include:e.refetchQueries,optimistic:!1,removeOptimistic:e.removeOptimistic,onQueryUpdated:e.onQueryUpdated||null}).forEach(function(p){return l.push(p)}),e.awaitRefetchQueries||e.onQueryUpdated)return Promise.all(l).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(h(h({},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=Ma(n),a=this.localState.clientQuery(n),o=i&&this.localState.serverQuery(i),s={document:n,hasClientExports:Na(n),hasForcedResolvers:this.localState.shouldForceResolvers(n),clientQuery:a,serverQuery:o,defaultVars:nr(mt(n)),asQuery:h(h({},n),{definitions:n.definitions.map(function(u){return u.kind==="OperationDefinition"&&u.operation!=="query"?h(h({},u),{operation:"query"}):u})})},c=function(u){u&&!r.has(u)&&r.set(u,s)};c(e),c(n),c(a),c(o)}return r.get(e)},t.prototype.getVariables=function(e,r){return h(h({},this.transform(e).defaultVars),r)},t.prototype.watchQuery=function(e){e=h(h({},e),{variables:this.getVariables(e.query,e.variables)}),typeof e.notifyOnNetworkStatusChange>"u"&&(e.notifyOnNetworkStatusChange=!1);var r=new Ci(this),n=new Ai({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 M("Store reset while query was in flight (not completed in link chain)"):new M(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):Pa(o)?i.set(r.transform(o).document,!1):K(o)&&o.query&&a.add(o)}),this.queries.forEach(function(o,s){var c=o.observableQuery,u=o.document;if(c){if(e==="all"){n.set(s,c);return}var l=c.queryName,p=c.options.fetchPolicy;if(p==="standby"||e==="active"&&!c.hasObservers())return;(e==="active"||l&&i.has(l)||u&&i.has(u))&&(n.set(s,c),l&&i.set(l,!0),u&&i.set(u,!0))}}),a.size&&a.forEach(function(o){var s=bn("legacyOneTimeQuery"),c=r.getQuery(s).init({document:o.query,variables:o.variables}),u=new Ai({queryManager:r,queryInfo:c,options:h(h({},o),{fetchPolicy:"network-only"})});I(u.queryId===s),c.setObservableQuery(u),n.set(s,u)}),__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,c=s===void 0?{}:s;n=this.transform(n).document,o=this.getVariables(n,o);var u=function(p){return r.getObservableFromLink(n,c,p).map(function(d){if(i!=="no-cache"&&(Ri(d,a)&&r.cache.write({query:n,result:d.data,dataId:"ROOT_SUBSCRIPTION",variables:p}),r.broadcastQueries()),Fr(d))throw new Et({graphQLErrors:d.errors});return d})};if(this.transform(n).hasClientExports){var l=this.localState.addExportedVariables(n,o,c).then(u);return new V(function(p){var d=null;return l.then(function(f){return d=f.subscribe(p)},p.error),function(){return d&&d.unsubscribe()}})}return u(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,c=this.transform(e).serverQuery;if(c){var u=this,l=u.inFlightLinkObservables,p=u.link,d={query:c,variables:n,operationName:Pr(c)||void 0,context:this.prepareContext(h(h({},r),{forceFetch:!i}))};if(r=d.context,i){var f=l.get(c)||new Map;l.set(c,f);var m=We(n);if(s=f.get(m),!s){var y=new Lr([Mr(p,d)]);f.set(m,s=y),y.beforeNext(function(){f.delete(m)&&f.size<1&&l.delete(c)})}}else s=new Lr([Mr(p,d)])}else s=new Lr([V.of({data:{}})]),r=this.prepareContext(r);var b=this.transform(e).clientQuery;return b&&(s=li(s,function(E){return a.localState.runResolvers({document:b,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),c=s.length>0;if(i>=e.lastRequestId){if(c&&n.errorPolicy==="none")throw e.markError(new Et({graphQLErrors:s}));e.markResult(o,a,n,r),e.markReady()}var u={data:o.data,loading:!1,networkStatus:X.ready};return c&&n.errorPolicy!=="ignore"&&(u.errors=s,u.networkStatus=X.error),u},function(o){var s=Hc(o)?o:new Et({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),c=this.defaultOptions.watchQuery,u=r.fetchPolicy,l=u===void 0?c&&c.fetchPolicy||"cache-first":u,p=r.errorPolicy,d=p===void 0?c&&c.errorPolicy||"none":p,f=r.returnPartialData,m=f===void 0?!1:f,y=r.notifyOnNetworkStatusChange,b=y===void 0?!1:y,E=r.context,v=E===void 0?{}:E,S=Object.assign({},r,{query:a,variables:o,fetchPolicy:l,errorPolicy:d,returnPartialData:m,notifyOnNetworkStatusChange:b,context:v}),O=function(D){S.variables=D;var C=i.fetchQueryByPolicy(s,S,n);return S.fetchPolicy!=="standby"&&C.length>0&&s.observableQuery&&s.observableQuery.applyNextFetchPolicy("after-fetch",r),C},k=function(){return i.fetchCancelFns.delete(e)};this.fetchCancelFns.set(e,function(D){k(),setTimeout(function(){return N.cancel(D)})});var N=new Lr(this.transform(S.query).hasClientExports?this.localState.addExportedVariables(S.query,S.variables,S.context).then(O):O(S.variables));return N.promise.then(k,k),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,c=s===void 0?o?bn("refetchQueries"):void 0:s,u=e.onQueryUpdated,l=new Map;i&&this.getObservableQueries(i).forEach(function(d,f){l.set(f,{oq:d,lastDiff:r.getQuery(f).getDiff()})});var p=new Map;return n&&this.cache.batch({update:n,optimistic:o&&c||!1,removeOptimistic:c,onWatchUpdated:function(d,f,m){var y=d.watcher instanceof Ci&&d.watcher.observableQuery;if(y){if(u){l.delete(y.queryId);var b=u(y,f,m);return b===!0&&(b=y.refetch()),b!==!1&&p.set(y,b),b}u!==null&&l.set(y.queryId,{oq:y,lastDiff:m,diff:f})}}}),l.size&&l.forEach(function(d,f){var m=d.oq,y=d.lastDiff,b=d.diff,E;if(u){if(!b){var v=m.queryInfo;v.reset(),b=v.getDiff()}E=u(m,b,y)}(!u||E===!0)&&(E=m.refetch()),E!==!1&&p.set(m,E),f.indexOf("legacyOneTimeQuery")>=0&&r.stopQueryNoBroadcast(f)}),c&&this.cache.removeOptimistic(c),p},t.prototype.fetchQueryByPolicy=function(e,r,n){var i=this,a=r.query,o=r.variables,s=r.fetchPolicy,c=r.refetchWritePolicy,u=r.errorPolicy,l=r.returnPartialData,p=r.context,d=r.notifyOnNetworkStatusChange,f=e.networkStatus;e.init({document:this.transform(a).document,variables:o,networkStatus:n});var m=function(){return e.getDiff(o)},y=function(O,k){k===void 0&&(k=e.networkStatus||X.loading);var N=O.result;__DEV__&&!l&&!se(N,{})&&Do(O.missing);var D=function(C){return V.of(h({data:C,loading:Ut(k),networkStatus:k},O.complete?null:{partial:!0}))};return N&&i.transform(a).hasForcedResolvers?i.localState.runResolvers({document:a,remoteResult:{data:N},context:p,variables:o,onlyRunForcedResolvers:!0}).then(function(C){return D(C.data||void 0)}):u==="none"&&k===X.refetch&&Array.isArray(O.missing)?D(void 0):D(N)},b=s==="no-cache"?0:n===X.refetch&&c!=="merge"?1:2,E=function(){return i.getResultsFromLink(e,b,{variables:o,context:p,fetchPolicy:s,errorPolicy:u})},v=d&&typeof f=="number"&&f!==n&&Ut(n);switch(s){default:case"cache-first":{var S=m();return S.complete?[y(S,e.markReady())]:l||v?[y(S),E()]:[E()]}case"cache-and-network":{var S=m();return S.complete||l||v?[y(S),E()]:[E()]}case"cache-only":return[y(m(),e.markReady())];case"network-only":return v?[y(m()),E()]:[E()];case"no-cache":return v?[y(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 h(h({},r),{clientAwareness:this.clientAwareness})},t}();var Zc=!1;var No=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,c=s===void 0?!1:s,u=e.ssrForceFetchDelay,l=u===void 0?0:u,p=e.connectToDevTools,d=p===void 0?typeof window=="object"&&!window.__APOLLO_CLIENT__&&__DEV__:p,f=e.queryDeduplication,m=f===void 0?!0:f,y=e.defaultOptions,b=e.assumeImmutableResults,E=b===void 0?!1:b,v=e.resolvers,S=e.typeDefs,O=e.fragmentMatcher,k=e.name,N=e.version,D=e.link;if(D||(D=n?new no({uri:n,credentials:i,headers:a}):Ze.empty()),!o)throw __DEV__?new M(`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 M(9);if(this.link=D,this.cache=o,this.disableNetworkFetches=c||l>0,this.queryDeduplication=m,this.defaultOptions=y||Object.create(null),this.typeDefs=S,l&&setTimeout(function(){return r.disableNetworkFetches=!1},l),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),d&&typeof window=="object"&&(window.__APOLLO_CLIENT__=this),!Zc&&d&&__DEV__&&(Zc=!0,typeof window<"u"&&window.document&&window.top===window.self&&!window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__)){var C=window.navigator,te=C&&C.userAgent,Y=void 0;typeof te=="string"&&(te.indexOf("Chrome/")>-1?Y="https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm":te.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:v,fragmentMatcher:O}),this.queryManager=new Xc({cache:this.cache,link:this.link,defaultOptions:this.defaultOptions,queryDeduplication:m,ssrMode:c,clientAwareness:{name:k,version:N},localState:this.localState,assumeImmutableResults:E,onBroadcast:d?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=Sn(this.defaultOptions.watchQuery,e)),this.disableNetworkFetches&&(e.fetchPolicy==="network-only"||e.fetchPolicy==="cache-and-network")&&(e=h(h({},e),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(e)},t.prototype.query=function(e){return this.defaultOptions.query&&(e=Sn(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=h(h({},e),{fetchPolicy:"cache-first"})),this.queryManager.query(e)},t.prototype.mutate=function(e){return this.defaultOptions.mutate&&(e=Sn(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 Mr(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(Yt?"log":"silent");function Pe(t){return t===null?"null":Array.isArray(t)?"array":typeof t}function Ot(t){return Pe(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 Ue;(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"})(Ue||(Ue={}));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(!Ot(t))throw new Error(`Message is expected to be an object, but got ${Pe(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 ${Pe(t.type)}`);switch(t.type){case me.ConnectionInit:case me.ConnectionAck:case me.Ping:case me.Pong:{if(t.payload!=null&&!Ot(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 ${Pe(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);if(!Ot(t.payload))throw new Error(`"${t.type}" message expects the 'payload' property to be an object, but got ${Pe(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 ${Pe(t.payload.query)}`);if(t.payload.variables!=null&&!Ot(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 ${Pe(t.payload.variables)}`);if(t.payload.operationName!=null&&Pe(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 ${Pe(t.payload.operationName)}`);if(t.payload.extensions!=null&&!Ot(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 ${Pe(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 ${Pe(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);if(!Ot(t.payload))throw new Error(`"${t.type}" message expects the 'payload' property to be an object, but got ${Pe(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 ${Pe(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 ${Pe(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 Qr(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:c=0,retryAttempts:u=5,retryWait:l=async function(pe){let ae=1e3;for(let G=0;G<pe;G++)ae*=2;await new Promise(G=>setTimeout(G,ae+Math.floor(Math.random()*(3e3-300)+300)))},shouldRetry:p=Li,isFatalConnectionProblem:d,on:f,webSocketImpl:m,generateID:y=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:b,jsonMessageReviver:E}=t,v;if(m){if(!$f(m))throw new Error("Invalid WebSocket implementation provided");v=m}else typeof WebSocket<"u"?v=WebSocket:typeof global<"u"?v=global.WebSocket||global.MozWebSocket:typeof window<"u"&&(v=window.WebSocket||window.MozWebSocket);if(!v)throw new Error("WebSocket implementation missing; on Node you can `import WebSocket from 'ws';` and pass `webSocketImpl: WebSocket` to `createClient`");let S=v,O=(()=>{let $=(()=>{let ae={};return{on(G,W){return ae[G]=W,()=>{delete ae[G]}},emit(G){var W;"id"in G&&((W=ae[G.id])===null||W===void 0||W.call(ae,G))}}})(),pe={connecting:f?.connecting?[f.connecting]:[],opened:f?.opened?[f.opened]:[],connected:f?.connected?[f.connected]:[],ping:f?.ping?[f.ping]:[],pong:f?.pong?[f.pong]:[],message:f?.message?[$.emit,f.message]:[$.emit],closed:f?.closed?[f.closed]:[],error:f?.error?[f.error]:[]};return{onMessage:$.on,on(ae,G){let W=pe[ae];return W.push(G),()=>{W.splice(W.indexOf(G),1)}},emit(ae,...G){for(let W of[...pe[ae]])W(...G)}}})();function k($){let pe=[O.on("error",ae=>{pe.forEach(G=>G()),$(ae)}),O.on("closed",ae=>{pe.forEach(G=>G()),$(ae)})]}let N,D=0,C,te=!1,Y=0,lt=!1;async function St(){clearTimeout(C);let[$,pe]=await(N??(N=new Promise((W,ft)=>(async()=>{if(te){if(await l(Y),!D)return N=void 0,ft({code:1e3,reason:"All Subscriptions Gone"});Y++}O.emit("connecting");let q=new S(typeof e=="function"?await e():e,tu),pt,Nt;function Xn(){isFinite(o)&&o>0&&(clearTimeout(Nt),Nt=setTimeout(()=>{q.readyState===S.OPEN&&(q.send(Qr({type:me.Ping})),O.emit("ping",!1,void 0))},o))}k(Oe=>{N=void 0,clearTimeout(pt),clearTimeout(Nt),ft(Oe),Li(Oe)&&Oe.code===4499&&(q.close(4499,"Terminated"),q.onerror=null,q.onclose=null)}),q.onerror=Oe=>O.emit("error",Oe),q.onclose=Oe=>O.emit("closed",Oe),q.onopen=async()=>{try{O.emit("opened",q);let Oe=typeof r=="function"?await r():r;if(q.readyState!==S.OPEN)return;q.send(Qr(Oe?{type:me.ConnectionInit,payload:Oe}:{type:me.ConnectionInit},b)),isFinite(c)&&c>0&&(pt=setTimeout(()=>{q.close(Ue.ConnectionAcknowledgementTimeout,"Connection acknowledgement timeout")},c)),Xn()}catch(Oe){O.emit("error",Oe),q.close(Ue.InternalClientError,Ao(Oe instanceof Error?Oe.message:new Error(Oe).message,"Internal client error"))}};let Dr=!1;q.onmessage=({data:Oe})=>{try{let Te=nu(Oe,E);if(O.emit("message",Te),Te.type==="ping"||Te.type==="pong"){O.emit(Te.type,!0,Te.payload),Te.type==="pong"?Xn():s||(q.send(Qr(Te.payload?{type:me.Pong,payload:Te.payload}:{type:me.Pong})),O.emit("pong",!1,Te.payload));return}if(Dr)return;if(Te.type!==me.ConnectionAck)throw new Error(`First message cannot be of type ${Te.type}`);clearTimeout(pt),Dr=!0,O.emit("connected",q,Te.payload),te=!1,Y=0,W([q,new Promise((Xp,Wu)=>k(Wu))])}catch(Te){q.onmessage=null,O.emit("error",Te),q.close(Ue.BadResponse,Ao(Te instanceof Error?Te.message:new Error(Te).message,"Bad response"))}}})())));$.readyState===S.CLOSING&&await pe;let ae=()=>{},G=new Promise(W=>ae=W);return[$,ae,Promise.race([G.then(()=>{if(!D){let W=()=>$.close(1e3,"Normal Closure");isFinite(a)&&a>0?C=setTimeout(()=>{$.readyState===S.OPEN&&W()},a):W()}}),pe])]}function Ee($){if(Li($)&&(jf($.code)||[Ue.InternalServerError,Ue.InternalClientError,Ue.BadRequest,Ue.BadResponse,Ue.Unauthorized,Ue.SubprotocolNotAcceptable,Ue.SubscriberAlreadyExists,Ue.TooManyInitialisationRequests].includes($.code)))throw $;if(lt)return!1;if(Li($)&&$.code===1e3)return D>0;if(!u||Y>=u||!p($)||d?.($))throw $;return te=!0}return n||(async()=>{for(D++;;)try{let[,,$]=await St();await $}catch($){try{if(!Ee($))return}catch(pe){return i?.(pe)}}})(),{on:O.on,subscribe($,pe){let ae=y($),G=!1,W=!1,ft=()=>{D--,G=!0};return(async()=>{for(D++;;)try{let[q,pt,Nt]=await St();if(G)return pt();let Xn=O.onMessage(ae,Dr=>{switch(Dr.type){case me.Next:{pe.next(Dr.payload);return}case me.Error:{W=!0,G=!0,pe.error(Dr.payload),ft();return}case me.Complete:{G=!0,ft();return}}});q.send(Qr({id:ae,type:me.Subscribe,payload:$},b)),ft=()=>{!G&&q.readyState===S.OPEN&&q.send(Qr({id:ae,type:me.Complete},b)),D--,G=!0,pt()},await Nt.finally(Xn);return}catch(q){if(!Ee(q))return}})().then(()=>{W||pe.complete()}).catch(q=>{pe.error(q)}),()=>{G||ft()}},async dispose(){if(lt=!0,N){let[$]=await N;$.close(1e3,"Normal Closure")}},terminate(){N&&O.emit("closed",{code:4499,reason:"Terminated",wasClean:!1})}}}function Li(t){return Ot(t)&&"code"in t&&"reason"in t}function jf(t){return[1e3,1001,1006,1005,1012,1013,1013].includes(t)?!1:t>=1e3&&t<=1999}function $f(t){return typeof t=="function"&&"constructor"in t&&"CLOSED"in t&&"CLOSING"in t&&"CONNECTING"in t&&"OPEN"in t}function Uf(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 V(function(i){return n.client.subscribe(h(h({},r),{query:kr(r.query)}),{next:i.next.bind(i),complete:i.complete.bind(i),error:function(a){return a instanceof Error?i.error(a):Uf(a)?i.error(new Error("Socket closed with event ".concat(a.code," ").concat(a.reason||""))):i.error(new Et({graphQLErrors:Array.isArray(a)?a:[a]}))}})})},e}(Ze);var ta=function(){return ta=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},ta.apply(this,arguments)};typeof SuppressedError=="function"&&SuppressedError;function Bi(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Bi=function(r){return typeof r}:Bi=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Bi(t)}function qf(t){return Bi(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 Vf(t){return ku(t.source,Mo(t.source,t.start))}function ku(t,e){var r=t.locationOffset.column-1,n=Qi(r)+t.body,i=e.line-1,a=t.locationOffset.line-1,o=e.line+a,s=e.line===1?r:0,c=e.column+s,u="".concat(t.name,":").concat(o,":").concat(c,`
52
+ `),l=n.split(/\r\n|[\n\r]/g),p=l[i];if(p.length>120){for(var d=Math.floor(c/80),f=c%80,m=[],y=0;y<p.length;y+=80)m.push(p.slice(y,y+80));return u+ou([["".concat(o),m[0]]].concat(m.slice(1,d+1).map(function(b){return["",b]}),[[" ",Qi(f-1)+"^"],["",m[d+1]]]))}return u+ou([["".concat(o-1),l[i-1]],["".concat(o),p],["",Qi(c-1)+"^"],["".concat(o+1),l[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 Bf(r,i)+(a?" | "+a:" |")}).join(`
53
+ `)}function Qi(t){return Array(t+1).join(" ")}function Bf(t,e){return Qi(t-e.length)+e}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 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 Qf(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){Gf(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 Gf(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Wf(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 Kf(t,e,r){return e&&cu(t.prototype,e),r&&cu(t,r),t}function zf(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 Jf(t){var e=Au();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 Nu(this,i)}}function Nu(t,e){return e&&(Gi(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||!Hf(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 Wi(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 Wi(t,e,r){return Au()?Wi=Reflect.construct:Wi=function(i,a,o){var s=[null];s.push.apply(s,a);var c=Function.bind.apply(i,s),u=new c;return o&&Gn(u,o.prototype),u},Wi.apply(null,arguments)}function Au(){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 Hf(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 Yf=function(t){zf(r,t);var e=Jf(r);function r(n,i,a,o,s,c,u){var l,p,d,f;Wf(this,r),f=e.call(this,n),f.name="GraphQLError",f.originalError=c??void 0,f.nodes=uu(Array.isArray(i)?i:i?[i]:void 0);for(var m=[],y=0,b=(E=f.nodes)!==null&&E!==void 0?E:[];y<b.length;y++){var E,v=b[y],S=v.loc;S!=null&&m.push(S)}m=uu(m),f.source=a??((l=m)===null||l===void 0?void 0:l[0].source),f.positions=o??((p=m)===null||p===void 0?void 0:p.map(function(k){return k.start})),f.locations=o&&a?o.map(function(k){return Mo(a,k)}):(d=m)===null||d===void 0?void 0:d.map(function(k){return Mo(k.source,k.start)}),f.path=s??void 0;var O=c?.extensions;return u==null&&qf(O)?f.extensions=Qf({},O):f.extensions=u??{},Object.defineProperties(Nn(f),{message:{enumerable:!0},locations:{enumerable:f.locations!=null},path:{enumerable:f.path!=null},extensions:{enumerable:f.extensions!=null&&Object.keys(f.extensions).length>0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),c!=null&&c.stack?(Object.defineProperty(Nn(f),"stack",{value:c.stack,writable:!0,configurable:!0}),Nu(f)):(Error.captureStackTrace?Error.captureStackTrace(Nn(f),r):Object.defineProperty(Nn(f),"stack",{value:Error().stack,writable:!0,configurable:!0}),f)}return Kf(r,[{key:"toString",value:function(){return Xf(this)}},{key:Du,get:function(){return"Object"}}]),r}(jo(Error));function uu(t){return t===void 0||t.length===0?void 0:t}function Xf(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
55
  `+Vf(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
- `+Au(t.source,s)}return e}function ze(t,e,r){return new Yf("Syntax Error: ".concat(r),void 0,t,[e])}var F=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 Zf(t,e){var r=Boolean(t);if(!r)throw new Error(e??"Unexpected invariant triggered.")}var ep=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):void 0,Uo=ep;function Ru(t){var e=t.prototype.toJSON;typeof e=="function"||Zf(0),t.prototype.inspect=e,Uo&&(t.prototype[Uo]=e)}var Lu=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}();Ru(Lu);var ge=function(){function t(r,n,i,a,o,s,c){this.kind=r,this.start=n,this.end=i,this.line=a,this.column=o,this.value=c,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}();Ru(ge);var w=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 zi(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?zi=function(r){return typeof r}:zi=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},zi(t)}var tp=10,Fu=2;function rp(t){return ba(t,[])}function ba(t,e){switch(zi(t)){case"string":return JSON.stringify(t);case"function":return t.name?"[function ".concat(t.name,"]"):"[function]";case"object":return t===null?"null":np(t,e);default:return String(t)}}function np(t,e){if(e.indexOf(t)!==-1)return"[Circular]";var r=[].concat(e,[t]),n=op(t);if(n!==void 0){var i=n.call(t);if(i!==t)return typeof i=="string"?i:ba(i,r)}else if(Array.isArray(t))return ap(t,r);return ip(t,r)}function ip(t,e){var r=Object.keys(t);if(r.length===0)return"{}";if(e.length>Fu)return"["+sp(t)+"]";var n=r.map(function(i){var a=ba(t[i],e);return i+": "+a});return"{ "+n.join(", ")+" }"}function ap(t,e){if(t.length===0)return"[]";if(e.length>Fu)return"[Array]";for(var r=Math.min(tp,t.length),n=t.length-r,i=[],a=0;a<r;++a)i.push(ba(t[a],e));return n===1?i.push("... 1 more item"):n>1&&i.push("... ".concat(n," more items")),"["+i.join(", ")+"]"}function op(t){var e=t[String(Uo)];if(typeof e=="function")return e;if(typeof t.inspect=="function")return t.inspect}function sp(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 Co(t,e){var r=Boolean(t);if(!r)throw new Error(e)}var cp=function(e,r){return e instanceof r};function pu(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 up(t,e,r){return e&&pu(t.prototype,e),r&&pu(t,r),t}var Mu=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"||Co(0,"Body must be a string. Received: ".concat(rp(e),".")),this.body=e,this.name=r,this.locationOffset=n,this.locationOffset.line>0||Co(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||Co(0,"column in locationOffset is 1-indexed and must be positive.")}return up(t,[{key:Nu,get:function(){return"Source"}}]),t}();function lp(t){return cp(t,Mu)}var fp=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 pp(t){var e=t.split(/\r\n|[\n\r]/g),r=dp(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&&du(e[i]);)++i;for(var a=e.length;a>i&&du(e[a-1]);)--a;return e.slice(i,a).join(`
58
- `)}function du(t){for(var e=0;e<t.length;++e)if(t[e]!==" "&&t[e]!==" ")return!1;return!0}function dp(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 hp=function(){function t(r){var n=new ge(w.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!==w.EOF)do{var i;n=(i=n.next)!==null&&i!==void 0?i:n.next=yp(this,n)}while(n.kind===w.COMMENT);return n},t}();function mp(t){return t===w.BANG||t===w.DOLLAR||t===w.AMP||t===w.PAREN_L||t===w.PAREN_R||t===w.SPREAD||t===w.COLON||t===w.EQUALS||t===w.AT||t===w.BRACKET_L||t===w.BRACKET_R||t===w.BRACE_L||t===w.PIPE||t===w.BRACE_R}function vr(t){return isNaN(t)?w.EOF:t<127?JSON.stringify(String.fromCharCode(t)):'"\\u'.concat(("00"+t.toString(16).toUpperCase()).slice(-4),'"')}function yp(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,c=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(w.BANG,a,a+1,s,c,e);case 35:return vp(r,a,s,c,e);case 36:return new ge(w.DOLLAR,a,a+1,s,c,e);case 38:return new ge(w.AMP,a,a+1,s,c,e);case 40:return new ge(w.PAREN_L,a,a+1,s,c,e);case 41:return new ge(w.PAREN_R,a,a+1,s,c,e);case 46:if(n.charCodeAt(a+1)===46&&n.charCodeAt(a+2)===46)return new ge(w.SPREAD,a,a+3,s,c,e);break;case 58:return new ge(w.COLON,a,a+1,s,c,e);case 61:return new ge(w.EQUALS,a,a+1,s,c,e);case 64:return new ge(w.AT,a,a+1,s,c,e);case 91:return new ge(w.BRACKET_L,a,a+1,s,c,e);case 93:return new ge(w.BRACKET_R,a,a+1,s,c,e);case 123:return new ge(w.BRACE_L,a,a+1,s,c,e);case 124:return new ge(w.PIPE,a,a+1,s,c,e);case 125:return new ge(w.BRACE_R,a,a+1,s,c,e);case 34:return n.charCodeAt(a+1)===34&&n.charCodeAt(a+2)===34?wp(r,a,s,c,e,t):Sp(r,a,s,c,e);case 45:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return bp(r,a,o,s,c,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 Ep(r,a,s,c,e)}throw ze(r,a,gp(o))}var u=t.line,l=1+a-t.lineStart;return new ge(w.EOF,i,i,u,l,e)}function gp(t){return t<32&&t!==9&&t!==10&&t!==13?"Cannot contain the invalid character ".concat(vr(t),"."):t===39?`Unexpected single quote character ('), did you mean to use a double quote (")?`:"Cannot parse the unexpected character ".concat(vr(t),".")}function vp(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(w.COMMENT,e,s,r,n,i,a.slice(e+1,s))}function bp(t,e,r,n,i,a){var o=t.body,s=r,c=e,u=!1;if(s===45&&(s=o.charCodeAt(++c)),s===48){if(s=o.charCodeAt(++c),s>=48&&s<=57)throw ze(t,c,"Invalid number, unexpected digit after 0: ".concat(vr(s),"."))}else c=Ro(t,c,s),s=o.charCodeAt(c);if(s===46&&(u=!0,s=o.charCodeAt(++c),c=Ro(t,c,s),s=o.charCodeAt(c)),(s===69||s===101)&&(u=!0,s=o.charCodeAt(++c),(s===43||s===45)&&(s=o.charCodeAt(++c)),c=Ro(t,c,s),s=o.charCodeAt(c)),s===46||Op(s))throw ze(t,c,"Invalid number, expected digit but got: ".concat(vr(s),"."));return new ge(u?w.FLOAT:w.INT,e,c,n,i,a,o.slice(e,c))}function Ro(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 ze(t,i,"Invalid number, expected digit but got: ".concat(vr(a),"."))}function Sp(t,e,r,n,i){for(var a=t.body,o=e+1,s=o,c=0,u="";o<a.length&&!isNaN(c=a.charCodeAt(o))&&c!==10&&c!==13;){if(c===34)return u+=a.slice(s,o),new ge(w.STRING,e,o+1,r,n,i,u);if(c<32&&c!==9)throw ze(t,o,"Invalid character within String: ".concat(vr(c),"."));if(++o,c===92){switch(u+=a.slice(s,o-1),c=a.charCodeAt(o),c){case 34:u+='"';break;case 47:u+="/";break;case 92:u+="\\";break;case 98:u+="\b";break;case 102:u+="\f";break;case 110:u+=`
59
- `;break;case 114:u+="\r";break;case 116:u+=" ";break;case 117:{var l=_p(a.charCodeAt(o+1),a.charCodeAt(o+2),a.charCodeAt(o+3),a.charCodeAt(o+4));if(l<0){var p=a.slice(o+1,o+5);throw ze(t,o,"Invalid character escape sequence: \\u".concat(p,"."))}u+=String.fromCharCode(l),o+=4;break}default:throw ze(t,o,"Invalid character escape sequence: \\".concat(String.fromCharCode(c),"."))}++o,s=o}}throw ze(t,o,"Unterminated string.")}function wp(t,e,r,n,i,a){for(var o=t.body,s=e+3,c=s,u=0,l="";s<o.length&&!isNaN(u=o.charCodeAt(s));){if(u===34&&o.charCodeAt(s+1)===34&&o.charCodeAt(s+2)===34)return l+=o.slice(c,s),new ge(w.BLOCK_STRING,e,s+3,r,n,i,pp(l));if(u<32&&u!==9&&u!==10&&u!==13)throw ze(t,s,"Invalid character within String: ".concat(vr(u),"."));u===10?(++s,++a.line,a.lineStart=s):u===13?(o.charCodeAt(s+1)===10?s+=2:++s,++a.line,a.lineStart=s):u===92&&o.charCodeAt(s+1)===34&&o.charCodeAt(s+2)===34&&o.charCodeAt(s+3)===34?(l+=o.slice(c,s)+'"""',s+=4,c=s):++s}throw ze(t,s,"Unterminated string.")}function _p(t,e,r,n){return ji(t)<<12|ji(e)<<8|ji(r)<<4|ji(n)}function ji(t){return t>=48&&t<=57?t-48:t>=65&&t<=70?t-55:t>=97&&t<=102?t-87:-1}function Ep(t,e,r,n,i){for(var a=t.body,o=a.length,s=e+1,c=0;s!==o&&!isNaN(c=a.charCodeAt(s))&&(c===95||c>=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122);)++s;return new ge(w.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 Tp(t,e){var r=new xp(t,e);return r.parseDocument()}var xp=function(){function t(r,n){var i=lp(r)?r:new Mu(r);this._lexer=new hp(i),this._options=n}var e=t.prototype;return e.parseName=function(){var n=this.expectToken(w.NAME);return{kind:F.NAME,value:n.value,loc:this.loc(n)}},e.parseDocument=function(){var n=this._lexer.token;return{kind:F.DOCUMENT,definitions:this.many(w.SOF,this.parseDefinition,w.EOF),loc:this.loc(n)}},e.parseDefinition=function(){if(this.peek(w.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(w.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(w.BRACE_L))return{kind:F.OPERATION_DEFINITION,operation:"query",name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet(),loc:this.loc(n)};var i=this.parseOperationType(),a;return this.peek(w.NAME)&&(a=this.parseName()),{kind:F.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(w.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(w.PAREN_L,this.parseVariableDefinition,w.PAREN_R)},e.parseVariableDefinition=function(){var n=this._lexer.token;return{kind:F.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(w.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(w.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(w.DOLLAR),{kind:F.VARIABLE,name:this.parseName(),loc:this.loc(n)}},e.parseSelectionSet=function(){var n=this._lexer.token;return{kind:F.SELECTION_SET,selections:this.many(w.BRACE_L,this.parseSelection,w.BRACE_R),loc:this.loc(n)}},e.parseSelection=function(){return this.peek(w.SPREAD)?this.parseFragment():this.parseField()},e.parseField=function(){var n=this._lexer.token,i=this.parseName(),a,o;return this.expectOptionalToken(w.COLON)?(a=i,o=this.parseName()):o=i,{kind:F.FIELD,alias:a,name:o,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(w.BRACE_L)?this.parseSelectionSet():void 0,loc:this.loc(n)}},e.parseArguments=function(n){var i=n?this.parseConstArgument:this.parseArgument;return this.optionalMany(w.PAREN_L,i,w.PAREN_R)},e.parseArgument=function(){var n=this._lexer.token,i=this.parseName();return this.expectToken(w.COLON),{kind:F.ARGUMENT,name:i,value:this.parseValueLiteral(!1),loc:this.loc(n)}},e.parseConstArgument=function(){var n=this._lexer.token;return{kind:F.ARGUMENT,name:this.parseName(),value:(this.expectToken(w.COLON),this.parseValueLiteral(!0)),loc:this.loc(n)}},e.parseFragment=function(){var n=this._lexer.token;this.expectToken(w.SPREAD);var i=this.expectOptionalKeyword("on");return!i&&this.peek(w.NAME)?{kind:F.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1),loc:this.loc(n)}:{kind:F.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:F.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:F.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 w.BRACKET_L:return this.parseList(n);case w.BRACE_L:return this.parseObject(n);case w.INT:return this._lexer.advance(),{kind:F.INT,value:i.value,loc:this.loc(i)};case w.FLOAT:return this._lexer.advance(),{kind:F.FLOAT,value:i.value,loc:this.loc(i)};case w.STRING:case w.BLOCK_STRING:return this.parseStringLiteral();case w.NAME:switch(this._lexer.advance(),i.value){case"true":return{kind:F.BOOLEAN,value:!0,loc:this.loc(i)};case"false":return{kind:F.BOOLEAN,value:!1,loc:this.loc(i)};case"null":return{kind:F.NULL,loc:this.loc(i)};default:return{kind:F.ENUM,value:i.value,loc:this.loc(i)}}case w.DOLLAR:if(!n)return this.parseVariable();break}throw this.unexpected()},e.parseStringLiteral=function(){var n=this._lexer.token;return this._lexer.advance(),{kind:F.STRING,value:n.value,block:n.kind===w.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:F.LIST,values:this.any(w.BRACKET_L,o,w.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:F.OBJECT,fields:this.any(w.BRACE_L,o,w.BRACE_R),loc:this.loc(a)}},e.parseObjectField=function(n){var i=this._lexer.token,a=this.parseName();return this.expectToken(w.COLON),{kind:F.OBJECT_FIELD,name:a,value:this.parseValueLiteral(n),loc:this.loc(i)}},e.parseDirectives=function(n){for(var i=[];this.peek(w.AT);)i.push(this.parseDirective(n));return i},e.parseDirective=function(n){var i=this._lexer.token;return this.expectToken(w.AT),{kind:F.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(n),loc:this.loc(i)}},e.parseTypeReference=function(){var n=this._lexer.token,i;return this.expectOptionalToken(w.BRACKET_L)?(i=this.parseTypeReference(),this.expectToken(w.BRACKET_R),i={kind:F.LIST_TYPE,type:i,loc:this.loc(n)}):i=this.parseNamedType(),this.expectOptionalToken(w.BANG)?{kind:F.NON_NULL_TYPE,type:i,loc:this.loc(n)}:i},e.parseNamedType=function(){var n=this._lexer.token;return{kind:F.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===w.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(w.STRING)||this.peek(w.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(w.BRACE_L,this.parseOperationTypeDefinition,w.BRACE_R);return{kind:F.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(w.COLON);var a=this.parseNamedType();return{kind:F.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:F.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),c=this.parseFieldsDefinition();return{kind:F.OBJECT_TYPE_DEFINITION,description:i,name:a,interfaces:o,directives:s,fields:c,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(w.AMP);do i.push(this.parseNamedType());while(this.expectOptionalToken(w.AMP)||this.peek(w.NAME));return i}return this.delimitedMany(w.AMP,this.parseNamedType)},e.parseFieldsDefinition=function(){var n;return((n=this._options)===null||n===void 0?void 0:n.allowLegacySDLEmptyFields)===!0&&this.peek(w.BRACE_L)&&this._lexer.lookahead().kind===w.BRACE_R?(this._lexer.advance(),this._lexer.advance(),[]):this.optionalMany(w.BRACE_L,this.parseFieldDefinition,w.BRACE_R)},e.parseFieldDefinition=function(){var n=this._lexer.token,i=this.parseDescription(),a=this.parseName(),o=this.parseArgumentDefs();this.expectToken(w.COLON);var s=this.parseTypeReference(),c=this.parseDirectives(!0);return{kind:F.FIELD_DEFINITION,description:i,name:a,arguments:o,type:s,directives:c,loc:this.loc(n)}},e.parseArgumentDefs=function(){return this.optionalMany(w.PAREN_L,this.parseInputValueDef,w.PAREN_R)},e.parseInputValueDef=function(){var n=this._lexer.token,i=this.parseDescription(),a=this.parseName();this.expectToken(w.COLON);var o=this.parseTypeReference(),s;this.expectOptionalToken(w.EQUALS)&&(s=this.parseValueLiteral(!0));var c=this.parseDirectives(!0);return{kind:F.INPUT_VALUE_DEFINITION,description:i,name:a,type:o,defaultValue:s,directives:c,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),c=this.parseFieldsDefinition();return{kind:F.INTERFACE_TYPE_DEFINITION,description:i,name:a,interfaces:o,directives:s,fields:c,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:F.UNION_TYPE_DEFINITION,description:i,name:a,directives:o,types:s,loc:this.loc(n)}},e.parseUnionMemberTypes=function(){return this.expectOptionalToken(w.EQUALS)?this.delimitedMany(w.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:F.ENUM_TYPE_DEFINITION,description:i,name:a,directives:o,values:s,loc:this.loc(n)}},e.parseEnumValuesDefinition=function(){return this.optionalMany(w.BRACE_L,this.parseEnumValueDefinition,w.BRACE_R)},e.parseEnumValueDefinition=function(){var n=this._lexer.token,i=this.parseDescription(),a=this.parseName(),o=this.parseDirectives(!0);return{kind:F.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:F.INPUT_OBJECT_TYPE_DEFINITION,description:i,name:a,directives:o,fields:s,loc:this.loc(n)}},e.parseInputFieldsDefinition=function(){return this.optionalMany(w.BRACE_L,this.parseInputValueDef,w.BRACE_R)},e.parseTypeSystemExtension=function(){var n=this._lexer.lookahead();if(n.kind===w.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(w.BRACE_L,this.parseOperationTypeDefinition,w.BRACE_R);if(i.length===0&&a.length===0)throw this.unexpected();return{kind:F.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:F.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:F.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:F.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:F.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:F.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:F.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(w.AT);var a=this.parseName(),o=this.parseArgumentDefs(),s=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");var c=this.parseDirectiveLocations();return{kind:F.DIRECTIVE_DEFINITION,description:i,name:a,arguments:o,repeatable:s,locations:c,loc:this.loc(n)}},e.parseDirectiveLocations=function(){return this.delimitedMany(w.PIPE,this.parseDirectiveLocation)},e.parseDirectiveLocation=function(){var n=this._lexer.token,i=this.parseName();if(fp[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 Lu(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 ze(this._lexer.source,i.start,"Expected ".concat(ju(n),", found ").concat(Lo(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===w.NAME&&i.value===n)this._lexer.advance();else throw ze(this._lexer.source,i.start,'Expected "'.concat(n,'", found ').concat(Lo(i),"."))},e.expectOptionalKeyword=function(n){var i=this._lexer.token;return i.kind===w.NAME&&i.value===n?(this._lexer.advance(),!0):!1},e.unexpected=function(n){var i=n??this._lexer.token;return ze(this._lexer.source,i.start,"Unexpected ".concat(Lo(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 Lo(t){var e=t.value;return ju(t.kind)+(e!=null?' "'.concat(e,'"'):"")}function ju(t){return mp(t)?'"'.concat(t,'"'):t}var Ji=new Map,qo=new Map,$u=!0,na=!1;function Uu(t){return t.replace(/[\s,]+/g," ").trim()}function Ip(t){return Uu(t.source.body.substring(t.start,t.end))}function Dp(t){var e=new Set,r=[];return t.definitions.forEach(function(n){if(n.kind==="FragmentDefinition"){var i=n.name.value,a=Ip(n.loc),o=qo.get(i);o&&!o.has(a)?$u&&console.warn("Warning: fragment with name "+i+` already exists.
57
+ `+ku(t.source,s)}return e}function ze(t,e,r){return new Yf("Syntax Error: ".concat(r),void 0,t,[e])}var F=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 Zf(t,e){var r=Boolean(t);if(!r)throw new Error(e??"Unexpected invariant triggered.")}var ep=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):void 0,$o=ep;function Pu(t){var e=t.prototype.toJSON;typeof e=="function"||Zf(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 ge=function(){function t(r,n,i,a,o,s,c){this.kind=r,this.start=n,this.end=i,this.line=a,this.column=o,this.value=c,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(ge);var w=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 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)}var tp=10,Ru=2;function rp(t){return va(t,[])}function va(t,e){switch(Ki(t)){case"string":return JSON.stringify(t);case"function":return t.name?"[function ".concat(t.name,"]"):"[function]";case"object":return t===null?"null":np(t,e);default:return String(t)}}function np(t,e){if(e.indexOf(t)!==-1)return"[Circular]";var r=[].concat(e,[t]),n=op(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 ap(t,r);return ip(t,r)}function ip(t,e){var r=Object.keys(t);if(r.length===0)return"{}";if(e.length>Ru)return"["+sp(t)+"]";var n=r.map(function(i){var a=va(t[i],e);return i+": "+a});return"{ "+n.join(", ")+" }"}function ap(t,e){if(t.length===0)return"[]";if(e.length>Ru)return"[Array]";for(var r=Math.min(tp,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 op(t){var e=t[String($o)];if(typeof e=="function")return e;if(typeof t.inspect=="function")return t.inspect}function sp(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 Po(t,e){var r=Boolean(t);if(!r)throw new Error(e)}var cp=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 up(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"||Po(0,"Body must be a string. Received: ".concat(rp(e),".")),this.body=e,this.name=r,this.locationOffset=n,this.locationOffset.line>0||Po(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||Po(0,"column in locationOffset is 1-indexed and must be positive.")}return up(t,[{key:Du,get:function(){return"Source"}}]),t}();function lp(t){return cp(t,Lu)}var fp=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 pp(t){var e=t.split(/\r\n|[\n\r]/g),r=dp(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 dp(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 hp=function(){function t(r){var n=new ge(w.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!==w.EOF)do{var i;n=(i=n.next)!==null&&i!==void 0?i:n.next=yp(this,n)}while(n.kind===w.COMMENT);return n},t}();function mp(t){return t===w.BANG||t===w.DOLLAR||t===w.AMP||t===w.PAREN_L||t===w.PAREN_R||t===w.SPREAD||t===w.COLON||t===w.EQUALS||t===w.AT||t===w.BRACKET_L||t===w.BRACKET_R||t===w.BRACE_L||t===w.PIPE||t===w.BRACE_R}function vr(t){return isNaN(t)?w.EOF:t<127?JSON.stringify(String.fromCharCode(t)):'"\\u'.concat(("00"+t.toString(16).toUpperCase()).slice(-4),'"')}function yp(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,c=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(w.BANG,a,a+1,s,c,e);case 35:return vp(r,a,s,c,e);case 36:return new ge(w.DOLLAR,a,a+1,s,c,e);case 38:return new ge(w.AMP,a,a+1,s,c,e);case 40:return new ge(w.PAREN_L,a,a+1,s,c,e);case 41:return new ge(w.PAREN_R,a,a+1,s,c,e);case 46:if(n.charCodeAt(a+1)===46&&n.charCodeAt(a+2)===46)return new ge(w.SPREAD,a,a+3,s,c,e);break;case 58:return new ge(w.COLON,a,a+1,s,c,e);case 61:return new ge(w.EQUALS,a,a+1,s,c,e);case 64:return new ge(w.AT,a,a+1,s,c,e);case 91:return new ge(w.BRACKET_L,a,a+1,s,c,e);case 93:return new ge(w.BRACKET_R,a,a+1,s,c,e);case 123:return new ge(w.BRACE_L,a,a+1,s,c,e);case 124:return new ge(w.PIPE,a,a+1,s,c,e);case 125:return new ge(w.BRACE_R,a,a+1,s,c,e);case 34:return n.charCodeAt(a+1)===34&&n.charCodeAt(a+2)===34?wp(r,a,s,c,e,t):Sp(r,a,s,c,e);case 45:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return bp(r,a,o,s,c,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 Ep(r,a,s,c,e)}throw ze(r,a,gp(o))}var u=t.line,l=1+a-t.lineStart;return new ge(w.EOF,i,i,u,l,e)}function gp(t){return t<32&&t!==9&&t!==10&&t!==13?"Cannot contain the invalid character ".concat(vr(t),"."):t===39?`Unexpected single quote character ('), did you mean to use a double quote (")?`:"Cannot parse the unexpected character ".concat(vr(t),".")}function vp(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(w.COMMENT,e,s,r,n,i,a.slice(e+1,s))}function bp(t,e,r,n,i,a){var o=t.body,s=r,c=e,u=!1;if(s===45&&(s=o.charCodeAt(++c)),s===48){if(s=o.charCodeAt(++c),s>=48&&s<=57)throw ze(t,c,"Invalid number, unexpected digit after 0: ".concat(vr(s),"."))}else c=Co(t,c,s),s=o.charCodeAt(c);if(s===46&&(u=!0,s=o.charCodeAt(++c),c=Co(t,c,s),s=o.charCodeAt(c)),(s===69||s===101)&&(u=!0,s=o.charCodeAt(++c),(s===43||s===45)&&(s=o.charCodeAt(++c)),c=Co(t,c,s),s=o.charCodeAt(c)),s===46||Op(s))throw ze(t,c,"Invalid number, expected digit but got: ".concat(vr(s),"."));return new ge(u?w.FLOAT:w.INT,e,c,n,i,a,o.slice(e,c))}function Co(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 ze(t,i,"Invalid number, expected digit but got: ".concat(vr(a),"."))}function Sp(t,e,r,n,i){for(var a=t.body,o=e+1,s=o,c=0,u="";o<a.length&&!isNaN(c=a.charCodeAt(o))&&c!==10&&c!==13;){if(c===34)return u+=a.slice(s,o),new ge(w.STRING,e,o+1,r,n,i,u);if(c<32&&c!==9)throw ze(t,o,"Invalid character within String: ".concat(vr(c),"."));if(++o,c===92){switch(u+=a.slice(s,o-1),c=a.charCodeAt(o),c){case 34:u+='"';break;case 47:u+="/";break;case 92:u+="\\";break;case 98:u+="\b";break;case 102:u+="\f";break;case 110:u+=`
59
+ `;break;case 114:u+="\r";break;case 116:u+=" ";break;case 117:{var l=_p(a.charCodeAt(o+1),a.charCodeAt(o+2),a.charCodeAt(o+3),a.charCodeAt(o+4));if(l<0){var p=a.slice(o+1,o+5);throw ze(t,o,"Invalid character escape sequence: \\u".concat(p,"."))}u+=String.fromCharCode(l),o+=4;break}default:throw ze(t,o,"Invalid character escape sequence: \\".concat(String.fromCharCode(c),"."))}++o,s=o}}throw ze(t,o,"Unterminated string.")}function wp(t,e,r,n,i,a){for(var o=t.body,s=e+3,c=s,u=0,l="";s<o.length&&!isNaN(u=o.charCodeAt(s));){if(u===34&&o.charCodeAt(s+1)===34&&o.charCodeAt(s+2)===34)return l+=o.slice(c,s),new ge(w.BLOCK_STRING,e,s+3,r,n,i,pp(l));if(u<32&&u!==9&&u!==10&&u!==13)throw ze(t,s,"Invalid character within String: ".concat(vr(u),"."));u===10?(++s,++a.line,a.lineStart=s):u===13?(o.charCodeAt(s+1)===10?s+=2:++s,++a.line,a.lineStart=s):u===92&&o.charCodeAt(s+1)===34&&o.charCodeAt(s+2)===34&&o.charCodeAt(s+3)===34?(l+=o.slice(c,s)+'"""',s+=4,c=s):++s}throw ze(t,s,"Unterminated string.")}function _p(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 Ep(t,e,r,n,i){for(var a=t.body,o=a.length,s=e+1,c=0;s!==o&&!isNaN(c=a.charCodeAt(s))&&(c===95||c>=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122);)++s;return new ge(w.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 Tp(t,e){var r=new xp(t,e);return r.parseDocument()}var xp=function(){function t(r,n){var i=lp(r)?r:new Lu(r);this._lexer=new hp(i),this._options=n}var e=t.prototype;return e.parseName=function(){var n=this.expectToken(w.NAME);return{kind:F.NAME,value:n.value,loc:this.loc(n)}},e.parseDocument=function(){var n=this._lexer.token;return{kind:F.DOCUMENT,definitions:this.many(w.SOF,this.parseDefinition,w.EOF),loc:this.loc(n)}},e.parseDefinition=function(){if(this.peek(w.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(w.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(w.BRACE_L))return{kind:F.OPERATION_DEFINITION,operation:"query",name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet(),loc:this.loc(n)};var i=this.parseOperationType(),a;return this.peek(w.NAME)&&(a=this.parseName()),{kind:F.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(w.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(w.PAREN_L,this.parseVariableDefinition,w.PAREN_R)},e.parseVariableDefinition=function(){var n=this._lexer.token;return{kind:F.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(w.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(w.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(w.DOLLAR),{kind:F.VARIABLE,name:this.parseName(),loc:this.loc(n)}},e.parseSelectionSet=function(){var n=this._lexer.token;return{kind:F.SELECTION_SET,selections:this.many(w.BRACE_L,this.parseSelection,w.BRACE_R),loc:this.loc(n)}},e.parseSelection=function(){return this.peek(w.SPREAD)?this.parseFragment():this.parseField()},e.parseField=function(){var n=this._lexer.token,i=this.parseName(),a,o;return this.expectOptionalToken(w.COLON)?(a=i,o=this.parseName()):o=i,{kind:F.FIELD,alias:a,name:o,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(w.BRACE_L)?this.parseSelectionSet():void 0,loc:this.loc(n)}},e.parseArguments=function(n){var i=n?this.parseConstArgument:this.parseArgument;return this.optionalMany(w.PAREN_L,i,w.PAREN_R)},e.parseArgument=function(){var n=this._lexer.token,i=this.parseName();return this.expectToken(w.COLON),{kind:F.ARGUMENT,name:i,value:this.parseValueLiteral(!1),loc:this.loc(n)}},e.parseConstArgument=function(){var n=this._lexer.token;return{kind:F.ARGUMENT,name:this.parseName(),value:(this.expectToken(w.COLON),this.parseValueLiteral(!0)),loc:this.loc(n)}},e.parseFragment=function(){var n=this._lexer.token;this.expectToken(w.SPREAD);var i=this.expectOptionalKeyword("on");return!i&&this.peek(w.NAME)?{kind:F.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1),loc:this.loc(n)}:{kind:F.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:F.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:F.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 w.BRACKET_L:return this.parseList(n);case w.BRACE_L:return this.parseObject(n);case w.INT:return this._lexer.advance(),{kind:F.INT,value:i.value,loc:this.loc(i)};case w.FLOAT:return this._lexer.advance(),{kind:F.FLOAT,value:i.value,loc:this.loc(i)};case w.STRING:case w.BLOCK_STRING:return this.parseStringLiteral();case w.NAME:switch(this._lexer.advance(),i.value){case"true":return{kind:F.BOOLEAN,value:!0,loc:this.loc(i)};case"false":return{kind:F.BOOLEAN,value:!1,loc:this.loc(i)};case"null":return{kind:F.NULL,loc:this.loc(i)};default:return{kind:F.ENUM,value:i.value,loc:this.loc(i)}}case w.DOLLAR:if(!n)return this.parseVariable();break}throw this.unexpected()},e.parseStringLiteral=function(){var n=this._lexer.token;return this._lexer.advance(),{kind:F.STRING,value:n.value,block:n.kind===w.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:F.LIST,values:this.any(w.BRACKET_L,o,w.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:F.OBJECT,fields:this.any(w.BRACE_L,o,w.BRACE_R),loc:this.loc(a)}},e.parseObjectField=function(n){var i=this._lexer.token,a=this.parseName();return this.expectToken(w.COLON),{kind:F.OBJECT_FIELD,name:a,value:this.parseValueLiteral(n),loc:this.loc(i)}},e.parseDirectives=function(n){for(var i=[];this.peek(w.AT);)i.push(this.parseDirective(n));return i},e.parseDirective=function(n){var i=this._lexer.token;return this.expectToken(w.AT),{kind:F.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(n),loc:this.loc(i)}},e.parseTypeReference=function(){var n=this._lexer.token,i;return this.expectOptionalToken(w.BRACKET_L)?(i=this.parseTypeReference(),this.expectToken(w.BRACKET_R),i={kind:F.LIST_TYPE,type:i,loc:this.loc(n)}):i=this.parseNamedType(),this.expectOptionalToken(w.BANG)?{kind:F.NON_NULL_TYPE,type:i,loc:this.loc(n)}:i},e.parseNamedType=function(){var n=this._lexer.token;return{kind:F.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===w.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(w.STRING)||this.peek(w.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(w.BRACE_L,this.parseOperationTypeDefinition,w.BRACE_R);return{kind:F.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(w.COLON);var a=this.parseNamedType();return{kind:F.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:F.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),c=this.parseFieldsDefinition();return{kind:F.OBJECT_TYPE_DEFINITION,description:i,name:a,interfaces:o,directives:s,fields:c,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(w.AMP);do i.push(this.parseNamedType());while(this.expectOptionalToken(w.AMP)||this.peek(w.NAME));return i}return this.delimitedMany(w.AMP,this.parseNamedType)},e.parseFieldsDefinition=function(){var n;return((n=this._options)===null||n===void 0?void 0:n.allowLegacySDLEmptyFields)===!0&&this.peek(w.BRACE_L)&&this._lexer.lookahead().kind===w.BRACE_R?(this._lexer.advance(),this._lexer.advance(),[]):this.optionalMany(w.BRACE_L,this.parseFieldDefinition,w.BRACE_R)},e.parseFieldDefinition=function(){var n=this._lexer.token,i=this.parseDescription(),a=this.parseName(),o=this.parseArgumentDefs();this.expectToken(w.COLON);var s=this.parseTypeReference(),c=this.parseDirectives(!0);return{kind:F.FIELD_DEFINITION,description:i,name:a,arguments:o,type:s,directives:c,loc:this.loc(n)}},e.parseArgumentDefs=function(){return this.optionalMany(w.PAREN_L,this.parseInputValueDef,w.PAREN_R)},e.parseInputValueDef=function(){var n=this._lexer.token,i=this.parseDescription(),a=this.parseName();this.expectToken(w.COLON);var o=this.parseTypeReference(),s;this.expectOptionalToken(w.EQUALS)&&(s=this.parseValueLiteral(!0));var c=this.parseDirectives(!0);return{kind:F.INPUT_VALUE_DEFINITION,description:i,name:a,type:o,defaultValue:s,directives:c,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),c=this.parseFieldsDefinition();return{kind:F.INTERFACE_TYPE_DEFINITION,description:i,name:a,interfaces:o,directives:s,fields:c,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:F.UNION_TYPE_DEFINITION,description:i,name:a,directives:o,types:s,loc:this.loc(n)}},e.parseUnionMemberTypes=function(){return this.expectOptionalToken(w.EQUALS)?this.delimitedMany(w.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:F.ENUM_TYPE_DEFINITION,description:i,name:a,directives:o,values:s,loc:this.loc(n)}},e.parseEnumValuesDefinition=function(){return this.optionalMany(w.BRACE_L,this.parseEnumValueDefinition,w.BRACE_R)},e.parseEnumValueDefinition=function(){var n=this._lexer.token,i=this.parseDescription(),a=this.parseName(),o=this.parseDirectives(!0);return{kind:F.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:F.INPUT_OBJECT_TYPE_DEFINITION,description:i,name:a,directives:o,fields:s,loc:this.loc(n)}},e.parseInputFieldsDefinition=function(){return this.optionalMany(w.BRACE_L,this.parseInputValueDef,w.BRACE_R)},e.parseTypeSystemExtension=function(){var n=this._lexer.lookahead();if(n.kind===w.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(w.BRACE_L,this.parseOperationTypeDefinition,w.BRACE_R);if(i.length===0&&a.length===0)throw this.unexpected();return{kind:F.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:F.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:F.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:F.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:F.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:F.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:F.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(w.AT);var a=this.parseName(),o=this.parseArgumentDefs(),s=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");var c=this.parseDirectiveLocations();return{kind:F.DIRECTIVE_DEFINITION,description:i,name:a,arguments:o,repeatable:s,locations:c,loc:this.loc(n)}},e.parseDirectiveLocations=function(){return this.delimitedMany(w.PIPE,this.parseDirectiveLocation)},e.parseDirectiveLocation=function(){var n=this._lexer.token,i=this.parseName();if(fp[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 ze(this._lexer.source,i.start,"Expected ".concat(Fu(n),", found ").concat(Ro(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===w.NAME&&i.value===n)this._lexer.advance();else throw ze(this._lexer.source,i.start,'Expected "'.concat(n,'", found ').concat(Ro(i),"."))},e.expectOptionalKeyword=function(n){var i=this._lexer.token;return i.kind===w.NAME&&i.value===n?(this._lexer.advance(),!0):!1},e.unexpected=function(n){var i=n??this._lexer.token;return ze(this._lexer.source,i.start,"Unexpected ".concat(Ro(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 Ro(t){var e=t.value;return Fu(t.kind)+(e!=null?' "'.concat(e,'"'):"")}function Fu(t){return mp(t)?'"'.concat(t,'"'):t}var zi=new Map,Uo=new Map,Mu=!0,ra=!1;function ju(t){return t.replace(/[\s,]+/g," ").trim()}function Ip(t){return ju(t.source.body.substring(t.start,t.end))}function Dp(t){var e=new Set,r=[];return t.definitions.forEach(function(n){if(n.kind==="FragmentDefinition"){var i=n.name.value,a=Ip(n.loc),o=Uo.get(i);o&&!o.has(a)?Mu&&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||qo.set(i,o=new Set),o.add(a),e.has(a)||(e.add(a),r.push(n))}else r.push(n)}),ra(ra({},t),{definitions:r})}function kp(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 Np(t){var e=Uu(t);if(!Ji.has(e)){var r=Tp(t,{experimentalFragmentVariables:na,allowLegacyFragmentVariables:na});if(!r||r.kind!=="Document")throw new Error("Not a valid GraphQL document.");Ji.set(e,kp(Dp(r)))}return Ji.get(e)}function _(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]}),Np(n)}function Ap(){Ji.clear(),qo.clear()}function Pp(){$u=!1}function Cp(){na=!0}function Rp(){na=!1}var Dn={gql:_,resetCaches:Ap,disableFragmentWarnings:Pp,enableExperimentalFragmentVariables:Cp,disableExperimentalFragmentVariables:Rp};(function(t){t.gql=Dn.gql,t.resetCaches=Dn.resetCaches,t.disableFragmentWarnings=Dn.disableFragmentWarnings,t.enableExperimentalFragmentVariables=Dn.enableExperimentalFragmentVariables,t.disableExperimentalFragmentVariables=Dn.disableExperimentalFragmentVariables})(_||(_={}));_.default=_;function T(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 Lp(){}function ts(){return Lp}var g=ts,Fe=ts,J=ts,qu=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)},br=class{constructor(e){this.code=e}};qu([g(),Vu("design:type",String)],br.prototype,"code",void 0);br=qu([J(),Vu("design:paramtypes",[String])],br);var rs=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},ns=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}};rs([g(),ns("design:type",String)],gt.prototype,"address",void 0);rs([g(),ns("design:type",String)],gt.prototype,"name",void 0);gt=rs([J(),ns("design:paramtypes",[String,String])],gt);var ce=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},we=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Qt=class{constructor(e,r){this.key=r,this.signature=e}};ce([g(),we("design:type",String)],Qt.prototype,"signature",void 0);ce([g(),we("design:type",String)],Qt.prototype,"key",void 0);ce([g(),we("design:type",Boolean)],Qt.prototype,"valid",void 0);ce([g(),we("design:type",Boolean)],Qt.prototype,"invalid",void 0);Qt=ce([J(),Fe(),we("design:paramtypes",[String,String])],Qt);var Sr=class{};ce([g(),we("design:type",String)],Sr.prototype,"signature",void 0);ce([g(),we("design:type",String)],Sr.prototype,"key",void 0);ce([g(),we("design:type",Boolean)],Sr.prototype,"valid",void 0);ce([g(),we("design:type",Boolean)],Sr.prototype,"invalid",void 0);Sr=ce([Fe()],Sr);function Ht(t){let e=class{constructor(n,i,a,o){this.author=n,this.timestamp=i,this.data=a,this.proof=o}};return ce([g(),we("design:type",String)],e.prototype,"author",void 0),ce([g(),we("design:type",String)],e.prototype,"timestamp",void 0),ce([g(),we("design:type",Object)],e.prototype,"data",void 0),ce([g(),we("design:type",Qt)],e.prototype,"proof",void 0),e=ce([J(),we("design:paramtypes",[String,String,Object,Qt])],e),e}function Fp(t){let e=class{};return ce([g(),we("design:type",String)],e.prototype,"author",void 0),ce([g(),we("design:type",String)],e.prototype,"timestamp",void 0),ce([g(),we("design:type",Object)],e.prototype,"data",void 0),ce([g(),we("design:type",Sr)],e.prototype,"proof",void 0),e=ce([Fe()],e),e}var hu=class extends Ht(){};hu=ce([J()],hu);var ia=class extends Ht(){};ce([g(),we("design:type",gt)],ia.prototype,"language",void 0);ce([g(),we("design:type",br)],ia.prototype,"icon",void 0);ia=ce([J()],ia);function PS(t){return t&&t.author&&t.timestamp&&t.data}var be=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},De=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},wr=class{constructor(e){this.source=e.source?e.source:"",this.target=e.target?e.target:"",this.predicate=e.predicate?e.predicate:""}};be([g(),De("design:type",String)],wr.prototype,"source",void 0);be([g(),De("design:type",String)],wr.prototype,"target",void 0);be([g(),De("design:type",String)],wr.prototype,"predicate",void 0);wr=be([J(),De("design:paramtypes",[Object])],wr);var aa=class{};be([g(),De("design:type",Array)],aa.prototype,"additions",void 0);be([g(),De("design:type",Array)],aa.prototype,"removals",void 0);aa=be([Fe()],aa);var oa=class{constructor(e,r){this.additions=e,this.removals=r}};be([g(),De("design:type",Array)],oa.prototype,"additions",void 0);be([g(),De("design:type",Array)],oa.prototype,"removals",void 0);oa=be([J(),De("design:paramtypes",[Array,Array])],oa);var Jn=class{};be([g(),De("design:type",String)],Jn.prototype,"source",void 0);be([g(),De("design:type",String)],Jn.prototype,"target",void 0);be([g(),De("design:type",String)],Jn.prototype,"predicate",void 0);Jn=be([Fe()],Jn);var _r=class extends Ht(){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}};be([g(),De("design:type",String)],_r.prototype,"status",void 0);_r=be([J()],_r);var Vo=class extends Fp(){};be([g(),De("design:type",String)],Vo.prototype,"status",void 0);Vo=be([Fe()],Vo);function $S(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 US(t){return t&&t.source&&t.target}var sa=class{constructor(e,r){this.oldLink=e,this.newLink=r}};be([g(),De("design:type",_r)],sa.prototype,"oldLink",void 0);be([g(),De("design:type",_r)],sa.prototype,"newLink",void 0);sa=be([J(),De("design:paramtypes",[_r,_r])],sa);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},Zn=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Bo,Gt=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(),Zn("design:type",Array)],Gt.prototype,"links",void 0);Gt=Or([J(),Zn("design:paramtypes",[Array])],Gt);var Qo=class{};Or([g(),Zn("design:type",Array)],Qo.prototype,"links",void 0);Qo=Or([Fe()],Qo);var Go=Bo=class{constructor(e){e?this.links=e:this.links=[]}static fromLink(e){let r=new Bo;return r.links.push(e),r}};Or([g(),Zn("design:type",Array)],Go.prototype,"links",void 0);Go=Bo=Or([Fe(),Zn("design:paramtypes",[Array])],Go);var Wo=class extends Ht(){};Wo=Or([J()],Wo);var R=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},L=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Vt=class{constructor(e,r){this.did=e,r?this.perspective=r:this.perspective=new Gt}};R([g(),L("design:type",String)],Vt.prototype,"did",void 0);R([g(),L("design:type",Gt)],Vt.prototype,"perspective",void 0);R([g(),L("design:type",String)],Vt.prototype,"directMessageLanguage",void 0);Vt=R([J(),L("design:paramtypes",[String,Gt])],Vt);var mu=class extends Ht(){};mu=R([J()],mu);var Wt=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}};R([g(),L("design:type",String)],Wt.prototype,"did",void 0);R([g(),L("design:type",String)],Wt.prototype,"didSigningKeyId",void 0);R([g(),L("design:type",String)],Wt.prototype,"deviceKeyType",void 0);R([g(),L("design:type",String)],Wt.prototype,"deviceKey",void 0);R([g(),L("design:type",String)],Wt.prototype,"deviceKeySignedByDid",void 0);R([g(),L("design:type",String)],Wt.prototype,"didSignedByDeviceKey",void 0);Wt=R([J(),L("design:paramtypes",[String,String,String,String,String,String])],Wt);var Kt=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}};R([g(),L("design:type",String)],Kt.prototype,"did",void 0);R([g(),L("design:type",String)],Kt.prototype,"didSigningKeyId",void 0);R([g(),L("design:type",String)],Kt.prototype,"deviceKeyType",void 0);R([g(),L("design:type",String)],Kt.prototype,"deviceKey",void 0);R([g(),L("design:type",String)],Kt.prototype,"deviceKeySignedByDid",void 0);R([g(),L("design:type",String)],Kt.prototype,"didSignedByDeviceKey",void 0);Kt=R([Fe(),L("design:paramtypes",[String,String,String,String,String,String])],Kt);var ca=class{constructor(e,r){this.signature=e,this.publicKey=r}};R([g(),L("design:type",String)],ca.prototype,"signature",void 0);R([g(),L("design:type",String)],ca.prototype,"publicKey",void 0);ca=R([J(),L("design:paramtypes",[String,String])],ca);var Xr=class{constructor(e,r){this.domain=e,this.pointers=r}};R([g(),L("design:type",String)],Xr.prototype,"domain",void 0);R([g(),L("design:type",Array)],Xr.prototype,"pointers",void 0);Xr=R([J(),L("design:paramtypes",[String,Array])],Xr);var ua=class{constructor(e,r){this.with=e,this.can=r}};R([g(),L("design:type",Xr)],ua.prototype,"with",void 0);R([g(),L("design:type",Array)],ua.prototype,"can",void 0);ua=R([J(),L("design:paramtypes",[Xr,Array])],ua);var kt=class{constructor(e,r,n,i,a){this.appName=e,this.appDesc=r,this.appIconPath=a,this.appUrl=n,this.capabilities=i}};R([g(),L("design:type",String)],kt.prototype,"appName",void 0);R([g(),L("design:type",String)],kt.prototype,"appDesc",void 0);R([g(),L("design:type",String)],kt.prototype,"appUrl",void 0);R([g(),L("design:type",String)],kt.prototype,"appIconPath",void 0);R([g(),L("design:type",Array)],kt.prototype,"capabilities",void 0);kt=R([J(),L("design:paramtypes",[String,String,String,Array,String])],kt);var Zr=class{constructor(e,r,n,i){this.requestId=e,this.auth=r,this.token=n,this.revoked=i}};R([g(),L("design:type",String)],Zr.prototype,"requestId",void 0);R([g(),L("design:type",String)],Zr.prototype,"token",void 0);R([g(),L("design:type",Boolean)],Zr.prototype,"revoked",void 0);R([g(),L("design:type",kt)],Zr.prototype,"auth",void 0);Zr=R([J(),L("design:paramtypes",[String,kt,String,Boolean])],Zr);var en=class{constructor(e,r){this.domain=e,this.pointers=r}};R([g(),L("design:type",String)],en.prototype,"domain",void 0);R([g(),L("design:type",Array)],en.prototype,"pointers",void 0);en=R([Fe(),L("design:paramtypes",[String,Array])],en);var la=class{constructor(e,r){this.with=e,this.can=r}};R([g(),L("design:type",en)],la.prototype,"with",void 0);R([g(),L("design:type",Array)],la.prototype,"can",void 0);la=R([Fe(),L("design:paramtypes",[en,Array])],la);var zt=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}};R([g(),L("design:type",String)],zt.prototype,"appName",void 0);R([g(),L("design:type",String)],zt.prototype,"appDesc",void 0);R([g(),L("design:type",String)],zt.prototype,"appDomain",void 0);R([g(),L("design:type",String)],zt.prototype,"appUrl",void 0);R([g(),L("design:type",String)],zt.prototype,"appIconPath",void 0);R([g(),L("design:type",Array)],zt.prototype,"capabilities",void 0);zt=R([Fe(),L("design:paramtypes",[String,String,String,String,String,Array])],zt);var rn=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},nn=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},et=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)}};rn([g(),nn("design:type",Boolean)],et.prototype,"isInitialized",void 0);rn([g(),nn("design:type",Boolean)],et.prototype,"isUnlocked",void 0);rn([g(),nn("design:type",String)],et.prototype,"did",void 0);rn([g(),nn("design:type",String)],et.prototype,"didDocument",void 0);rn([g(),nn("design:type",String)],et.prototype,"error",void 0);et=rn([J(),nn("design:paramtypes",[Object])],et);var yu=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)},Ve,Be,Ko=class{constructor(e,r){Ve.set(this,void 0),Be.set(this,void 0),yu(this,Ve,e,"f"),yu(this,Be,r,"f")}async otherAgents(){return await ye(this,Ve,"f").otherAgents(ye(this,Be,"f"))}async hasTelepresenceAdapter(){return await ye(this,Ve,"f").hasTelepresenceAdapter(ye(this,Be,"f"))}async onlineAgents(){return await ye(this,Ve,"f").onlineAgents(ye(this,Be,"f"))}async setOnlineStatus(e){return await ye(this,Ve,"f").setOnlineStatus(ye(this,Be,"f"),e)}async setOnlineStatusU(e){return await ye(this,Ve,"f").setOnlineStatusU(ye(this,Be,"f"),e)}async sendSignal(e,r){return await ye(this,Ve,"f").sendSignal(ye(this,Be,"f"),e,r)}async sendSignalU(e,r){return await ye(this,Ve,"f").sendSignalU(ye(this,Be,"f"),e,r)}async sendBroadcast(e){return await ye(this,Ve,"f").sendBroadcast(ye(this,Be,"f"),e)}async sendBroadcastU(e){return await ye(this,Ve,"f").sendBroadcastU(ye(this,Be,"f"),e)}async addSignalHandler(e){await ye(this,Ve,"f").addSignalHandler(ye(this,Be,"f"),e)}removeSignalHandler(e){ye(this,Ve,"f").removeSignalHandler(ye(this,Be,"f"),e)}};Ve=new WeakMap,Be=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},xr=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(),xr("design:type",String)],Je.prototype,"source",void 0);Tr([g(),xr("design:type",String)],Je.prototype,"target",void 0);Tr([g(),xr("design:type",String)],Je.prototype,"predicate",void 0);Tr([g(),xr("design:type",Date)],Je.prototype,"fromDate",void 0);Tr([g(),xr("design:type",Date)],Je.prototype,"untilDate",void 0);Tr([g(),xr("design:type",Number)],Je.prototype,"limit",void 0);Je=Tr([J(),Fe(),xr("design:paramtypes",[Object])],Je);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},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)},ot,Tt;function Fo(t){return encodeURIComponent(t).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`)}var vt=class{constructor(){ot.set(this,void 0),Tt.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 vt;return gu(r,Tt,e,"f"),r}static from(e){let r=new vt;return gu(r,ot,e,"f"),r}toUrl(){if(qe(this,Tt,"f")&&!qe(this,ot,"f"))return qe(this,Tt,"f");if(!qe(this,Tt,"f")&&!qe(this,ot,"f"))throw new Error("Can't turn empty Literal into URL");let e;switch(typeof qe(this,ot,"f")){case"string":e=`string:${Fo(qe(this,ot,"f"))}`;break;case"number":e=`number:${Fo(qe(this,ot,"f"))}`;break;case"object":e=`json:${Fo(JSON.stringify(qe(this,ot,"f")))}`;break}return`literal://${e}`}get(){if(qe(this,ot,"f"))return qe(this,ot,"f");if(!qe(this,Tt,"f"))throw new Error("Can't render empty Literal");if(!qe(this,Tt,"f").startsWith("literal://"))throw new Error("Can't render Literal from non-literal URL");let e=qe(this,Tt,"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}`)}};ot=new WeakMap,Tt=new WeakMap;function Bt(t){return t.charAt(0).toUpperCase()+t.slice(1)}function Bu(t){return`set${Bt(t)}`}function Dt(t){return t.endsWith("y")?t.slice(0,-1)+"ies":t+"s"}function is(t){return t.endsWith("ies")?t.slice(0,-3)+"y":t.endsWith("s")?t.slice(0,-1):t}function Mp(t){return`add${Bt(is(t))}`}function jp(t){let e=t.substring(3),r=Dt(e);return r.charAt(0).toLowerCase()+r.slice(1)}function $p(t){return`remove${Bt(is(t))}`}function Up(t){let e=t.substring(6),r=Dt(e);return r.charAt(0).toLowerCase()+r.slice(1)}function qp(t){let e=t.substring(13),r=Dt(e);return r.charAt(0).toLowerCase()+r.slice(1)}function Vp(t){return`setCollection${Bt(is(t))}`}function fr(t){if(Array.isArray(t))return`[${t.map(fr).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 Mo=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)},Pe,Ce,le,fa=class{constructor(t,e,r){Pe.set(this,void 0),Ce.set(this,void 0),le.set(this,void 0),Mo(this,Pe,e,"f"),Mo(this,Ce,r,"f"),Mo(this,le,t,"f")}get baseExpression(){return j(this,Pe,"f")}async init(){let isInstance=await j(this,le,"f").isSubjectInstance(j(this,Pe,"f"),j(this,Ce,"f"));if(!isInstance)throw`Not a valid subject instance of ${j(this,Ce,"f")} for ${j(this,Pe,"f")}`;let results=await j(this,le,"f").infer(`subject_class("${j(this,Ce,"f")}", C), property(C, Property)`),properties=results.map(t=>t.Property);for(let t of properties){let e=await j(this,le,"f").infer(`subject_class("${j(this,Ce,"f")}", C), property_resolve(C, "${t}")`);Object.defineProperty(this,t,{configurable:!0,get:async()=>{let r=await j(this,le,"f").infer(`subject_class("${j(this,Ce,"f")}", C), property_getter(C, "${j(this,Pe,"f")}", "${t}", Value)`);if(r&&r.length>0){let n=r[0].Value;if(e)try{if(n){let i=await j(this,le,"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 j(this,le,"f").infer(`subject_class("${j(this,Ce,"f")}", C), property_setter(C, Property, Setter)`);for(let setter of setters||[])if(setter){let property=setter.Property,actions=eval(setter.Setter),resolveLanguageResults=await j(this,le,"f").infer(`subject_class("${j(this,Ce,"f")}", C), property_resolve_language(C, "${property}", Language)`),resolveLanguage;resolveLanguageResults&&resolveLanguageResults.length>0&&(resolveLanguage=resolveLanguageResults[0].Language),this[Bu(property)]=async t=>{resolveLanguage&&(t=await j(this,le,"f").createExpression(t,resolveLanguage)),await j(this,le,"f").executeAction(actions,j(this,Pe,"f"),[{name:"value",value:t}])}}let results2=await j(this,le,"f").infer(`subject_class("${j(this,Ce,"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 j(this,le,"f").infer(`subject_class("${j(this,Ce,"f")}", C), collection_getter(C, "${j(this,Pe,"f")}", "${t}", Value)`);return e&&e.length>0&&e[0].Value?e[0].Value.filter(n=>n!==""&&n!==""):[]}});let adders=await j(this,le,"f").infer(`subject_class("${j(this,Ce,"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[Mp(collection)]=async t=>{Array.isArray(t)?await Promise.all(t.map(e=>j(this,le,"f").executeAction(actions,j(this,Pe,"f"),[{name:"value",value:e}]))):await j(this,le,"f").executeAction(actions,j(this,Pe,"f"),[{name:"value",value:t}])}}let removers=await j(this,le,"f").infer(`subject_class("${j(this,Ce,"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[$p(collection)]=async t=>{Array.isArray(t)?await Promise.all(t.map(e=>j(this,le,"f").executeAction(actions,j(this,Pe,"f"),[{name:"value",value:e}]))):await j(this,le,"f").executeAction(actions,j(this,Pe,"f"),[{name:"value",value:t}])}}let collectionSetters=await j(this,le,"f").infer(`subject_class("${j(this,Ce,"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[Vp(collection)]=async t=>{Array.isArray(t)?await j(this,le,"f").executeAction(actions,j(this,Pe,"f"),t.map(e=>({name:"value",value:e}))):await j(this,le,"f").executeAction(actions,j(this,Pe,"f"),[{name:"value",value:t}])}}}};Pe=new WeakMap,Ce=new WeakMap,le=new WeakMap;var Gr=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},P=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,oe,pr,dr,hr,Pn,Yr=class{constructor(t,e){ne.set(this,void 0),oe.set(this,void 0),pr.set(this,void 0),dr.set(this,void 0),hr.set(this,void 0),Pn.set(this,void 0),Gr(this,pr,[],"f"),Gr(this,dr,[],"f"),Gr(this,hr,[],"f"),Gr(this,Pn,[],"f"),Gr(this,ne,t,"f"),Gr(this,oe,e,"f"),this.uuid=P(this,ne,"f").uuid,this.name=P(this,ne,"f").name,this.sharedUrl=P(this,ne,"f").sharedUrl,this.neighbourhood=P(this,ne,"f").neighbourhood,this.state=P(this,ne,"f").state,P(this,oe,"f").addPerspectiveLinkAddedListener(P(this,ne,"f").uuid,P(this,pr,"f")),P(this,oe,"f").addPerspectiveLinkRemovedListener(P(this,ne,"f").uuid,P(this,dr,"f")),P(this,oe,"f").addPerspectiveLinkUpdatedListener(P(this,ne,"f").uuid,P(this,hr,"f")),P(this,oe,"f").addPerspectiveSyncStateChangeListener(P(this,ne,"f").uuid,P(this,Pn,"f"))}async executeAction(t,e,r){return await P(this,oe,"f").executeCommands(P(this,ne,"f").uuid,JSON.stringify(t),e,JSON.stringify(r))}async get(t){return await P(this,oe,"f").queryLinks(P(this,ne,"f").uuid,t)}async infer(t){return await P(this,oe,"f").queryProlog(P(this,ne,"f").uuid,t)}async add(t,e="shared"){return await P(this,oe,"f").addLink(P(this,ne,"f").uuid,t,e)}async addLinks(t,e="shared"){return await P(this,oe,"f").addLinks(P(this,ne,"f").uuid,t,e)}async removeLinks(t){return await P(this,oe,"f").removeLinks(P(this,ne,"f").uuid,t)}async linkMutations(t,e="shared"){return await P(this,oe,"f").linkMutations(P(this,ne,"f").uuid,t,e)}async addLinkExpression(t,e="shared"){return await P(this,oe,"f").addLinkExpression(P(this,ne,"f").uuid,t,e)}async update(t,e){return await P(this,oe,"f").updateLink(P(this,ne,"f").uuid,t,e)}async remove(t){return await P(this,oe,"f").removeLink(P(this,ne,"f").uuid,t)}async getExpression(t){return await P(this,oe,"f").getExpression(t)}async createExpression(t,e){return await P(this,oe,"f").createExpression(t,e)}async addListener(t,e){t==="link-added"?P(this,pr,"f").push(e):t==="link-removed"?P(this,dr,"f").push(e):t==="link-updated"&&P(this,hr,"f").push(e)}async addSyncStateChangeListener(t){P(this,Pn,"f").push(t)}async removeListener(t,e){if(t==="link-added"){let r=P(this,pr,"f").indexOf(e);P(this,pr,"f").splice(r,1)}else if(t==="link-removed"){let r=P(this,dr,"f").indexOf(e);P(this,dr,"f").splice(r,1)}else if(t==="link-updated"){let r=P(this,hr,"f").indexOf(e);P(this,hr,"f").splice(r,1)}}async snapshot(){return P(this,oe,"f").snapshotByUUID(P(this,ne,"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=>vt.fromUrl(e).get())}async addSdna(t,e,r){return P(this,oe,"f").addSdna(P(this,ne,"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(t,e){let r;if(typeof t=="string")r=t,await P(this,oe,"f").createSubject(P(this,ne,"f").uuid,JSON.stringify({className:r}),e);else{let n=this.buildQueryFromTemplate(t);await P(this,oe,"f").createSubject(P(this,ne,"f").uuid,JSON.stringify({query:n}),e)}return this.getSubjectProxy(e,t)}async getSubjectData(t,e){if(typeof t=="string")return JSON.parse(await P(this,oe,"f").getSubjectData(P(this,ne,"f").uuid,JSON.stringify({className:t}),e));let r=this.buildQueryFromTemplate(t);return JSON.parse(await P(this,oe,"f").getSubjectData(P(this,ne,"f").uuid,JSON.stringify({query:r}),e))}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 fa(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}buildQueryFromTemplate(t){let e=[],r=[];Object.getPrototypeOf(t).__properties?Object.keys(Object.getPrototypeOf(t).__properties).forEach(c=>e.push(c)):e.push(...Object.keys(t).filter(c=>!Array.isArray(t[c]))),Object.getPrototypeOf(t).__collections?Object.keys(Object.getPrototypeOf(t).__collections).filter(c=>c!=="isSubjectInstance").forEach(c=>!r.includes(c)):r.push(...Object.keys(t).filter(c=>Array.isArray(t[c])).filter(c=>c!=="isSubjectInstance"));let n=Object.getOwnPropertyNames(t).filter(c=>typeof t[c]=="function"&&c.startsWith("set")&&!c.startsWith("setCollection"));n=n.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(t)).filter(c=>typeof t[c]=="function"&&c.startsWith("set")&&!c.startsWith("setCollection")));let i=Object.getOwnPropertyNames(t).filter(c=>typeof t[c]=="function"&&c.startsWith("add"));i=i.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(t)).filter(c=>typeof t[c]=="function"&&c.startsWith("add")));let a=Object.getOwnPropertyNames(t).filter(c=>typeof t[c]=="function"&&c.startsWith("remove"));a=a.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(t)).filter(c=>typeof t[c]=="function"&&c.startsWith("remove")));let o=Object.getOwnPropertyNames(t).filter(c=>typeof t[c]=="function"&&c.startsWith("setCollection"));o=o.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(t)).filter(c=>typeof t[c]=="function"&&c.startsWith("setCollection")));let s="subject_class(Class, C)";for(let c of e)s+=`, property(C, "${c}")`;for(let c of r)s+=`, collection(C, "${c}")`;for(let c of n){let u=c.substring(3);u=u.charAt(0).toLowerCase()+u.slice(1),s+=`, property_setter(C, "${u}", _)`}for(let c of i)s+=`, collection_adder(C, "${jp(c)}", _)`;for(let c of a)s+=`, collection_remover(C, "${Up(c)}", _)`;for(let c of o)s+=`, collection_setter(C, "${qp(c)}", _)`;return s+=".",s}async subjectClassesByTemplate(t){let e=this.buildQueryFromTemplate(t),r=await this.infer(e);return r?r.map(n=>n.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 P(this,oe,"f").getNeighbourhoodProxy(P(this,ne,"f").uuid)}};ne=new WeakMap,oe=new WeakMap,pr=new WeakMap,dr=new WeakMap,hr=new WeakMap,Pn=new WeakMap;var cr=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},B=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)},ee,Cn,Rn,Ln,Hi,Fn,Yi,Ke=`
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)}),ta(ta({},t),{definitions:r})}function kp(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 Np(t){var e=ju(t);if(!zi.has(e)){var r=Tp(t,{experimentalFragmentVariables:ra,allowLegacyFragmentVariables:ra});if(!r||r.kind!=="Document")throw new Error("Not a valid GraphQL document.");zi.set(e,kp(Dp(r)))}return zi.get(e)}function _(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]}),Np(n)}function Ap(){zi.clear(),Uo.clear()}function Pp(){Mu=!1}function Cp(){ra=!0}function Rp(){ra=!1}var Dn={gql:_,resetCaches:Ap,disableFragmentWarnings:Pp,enableExperimentalFragmentVariables:Cp,disableExperimentalFragmentVariables:Rp};(function(t){t.gql=Dn.gql,t.resetCaches=Dn.resetCaches,t.disableFragmentWarnings=Dn.disableFragmentWarnings,t.enableExperimentalFragmentVariables=Dn.enableExperimentalFragmentVariables,t.disableExperimentalFragmentVariables=Dn.disableExperimentalFragmentVariables})(_||(_={}));_.default=_;function T(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 Lp(){}function Zo(){return Lp}var g=Zo,Me=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)},br=class{constructor(e){this.code=e}};$u([g(),Uu("design:type",String)],br.prototype,"code",void 0);br=$u([J(),Uu("design:paramtypes",[String])],br);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 ce=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},we=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Qt=class{constructor(e,r){this.key=r,this.signature=e}};ce([g(),we("design:type",String)],Qt.prototype,"signature",void 0);ce([g(),we("design:type",String)],Qt.prototype,"key",void 0);ce([g(),we("design:type",Boolean)],Qt.prototype,"valid",void 0);ce([g(),we("design:type",Boolean)],Qt.prototype,"invalid",void 0);Qt=ce([J(),Me(),we("design:paramtypes",[String,String])],Qt);var Sr=class{};ce([g(),we("design:type",String)],Sr.prototype,"signature",void 0);ce([g(),we("design:type",String)],Sr.prototype,"key",void 0);ce([g(),we("design:type",Boolean)],Sr.prototype,"valid",void 0);ce([g(),we("design:type",Boolean)],Sr.prototype,"invalid",void 0);Sr=ce([Me()],Sr);function Ht(t){let e=class{constructor(n,i,a,o){this.author=n,this.timestamp=i,this.data=a,this.proof=o}};return ce([g(),we("design:type",String)],e.prototype,"author",void 0),ce([g(),we("design:type",String)],e.prototype,"timestamp",void 0),ce([g(),we("design:type",Object)],e.prototype,"data",void 0),ce([g(),we("design:type",Qt)],e.prototype,"proof",void 0),e=ce([J(),we("design:paramtypes",[String,String,Object,Qt])],e),e}function Fp(t){let e=class{};return ce([g(),we("design:type",String)],e.prototype,"author",void 0),ce([g(),we("design:type",String)],e.prototype,"timestamp",void 0),ce([g(),we("design:type",Object)],e.prototype,"data",void 0),ce([g(),we("design:type",Sr)],e.prototype,"proof",void 0),e=ce([Me()],e),e}var pu=class extends Ht(){};pu=ce([J()],pu);var na=class extends Ht(){};ce([g(),we("design:type",gt)],na.prototype,"language",void 0);ce([g(),we("design:type",br)],na.prototype,"icon",void 0);na=ce([J()],na);function PS(t){return t&&t.author&&t.timestamp&&t.data}var be=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},De=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},wr=class{constructor(e){this.source=e.source?e.source:"",this.target=e.target?e.target:"",this.predicate=e.predicate?e.predicate:""}};be([g(),De("design:type",String)],wr.prototype,"source",void 0);be([g(),De("design:type",String)],wr.prototype,"target",void 0);be([g(),De("design:type",String)],wr.prototype,"predicate",void 0);wr=be([J(),De("design:paramtypes",[Object])],wr);var ia=class{};be([g(),De("design:type",Array)],ia.prototype,"additions",void 0);be([g(),De("design:type",Array)],ia.prototype,"removals",void 0);ia=be([Me()],ia);var aa=class{constructor(e,r){this.additions=e,this.removals=r}};be([g(),De("design:type",Array)],aa.prototype,"additions",void 0);be([g(),De("design:type",Array)],aa.prototype,"removals",void 0);aa=be([J(),De("design:paramtypes",[Array,Array])],aa);var Kn=class{};be([g(),De("design:type",String)],Kn.prototype,"source",void 0);be([g(),De("design:type",String)],Kn.prototype,"target",void 0);be([g(),De("design:type",String)],Kn.prototype,"predicate",void 0);Kn=be([Me()],Kn);var _r=class extends Ht(){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}};be([g(),De("design:type",String)],_r.prototype,"status",void 0);_r=be([J()],_r);var qo=class extends Fp(){};be([g(),De("design:type",String)],qo.prototype,"status",void 0);qo=be([Me()],qo);function $S(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 US(t){return t&&t.source&&t.target}var oa=class{constructor(e,r){this.oldLink=e,this.newLink=r}};be([g(),De("design:type",_r)],oa.prototype,"oldLink",void 0);be([g(),De("design:type",_r)],oa.prototype,"newLink",void 0);oa=be([J(),De("design:paramtypes",[_r,_r])],oa);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,Gt=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)],Gt.prototype,"links",void 0);Gt=Or([J(),Yn("design:paramtypes",[Array])],Gt);var Bo=class{};Or([g(),Yn("design:type",Array)],Bo.prototype,"links",void 0);Bo=Or([Me()],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([Me(),Yn("design:paramtypes",[Array])],Qo);var Go=class extends Ht(){};Go=Or([J()],Go);var R=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},L=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Vt=class{constructor(e,r){this.did=e,r?this.perspective=r:this.perspective=new Gt}};R([g(),L("design:type",String)],Vt.prototype,"did",void 0);R([g(),L("design:type",Gt)],Vt.prototype,"perspective",void 0);R([g(),L("design:type",String)],Vt.prototype,"directMessageLanguage",void 0);Vt=R([J(),L("design:paramtypes",[String,Gt])],Vt);var du=class extends Ht(){};du=R([J()],du);var Wt=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}};R([g(),L("design:type",String)],Wt.prototype,"did",void 0);R([g(),L("design:type",String)],Wt.prototype,"didSigningKeyId",void 0);R([g(),L("design:type",String)],Wt.prototype,"deviceKeyType",void 0);R([g(),L("design:type",String)],Wt.prototype,"deviceKey",void 0);R([g(),L("design:type",String)],Wt.prototype,"deviceKeySignedByDid",void 0);R([g(),L("design:type",String)],Wt.prototype,"didSignedByDeviceKey",void 0);Wt=R([J(),L("design:paramtypes",[String,String,String,String,String,String])],Wt);var Kt=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}};R([g(),L("design:type",String)],Kt.prototype,"did",void 0);R([g(),L("design:type",String)],Kt.prototype,"didSigningKeyId",void 0);R([g(),L("design:type",String)],Kt.prototype,"deviceKeyType",void 0);R([g(),L("design:type",String)],Kt.prototype,"deviceKey",void 0);R([g(),L("design:type",String)],Kt.prototype,"deviceKeySignedByDid",void 0);R([g(),L("design:type",String)],Kt.prototype,"didSignedByDeviceKey",void 0);Kt=R([Me(),L("design:paramtypes",[String,String,String,String,String,String])],Kt);var sa=class{constructor(e,r){this.signature=e,this.publicKey=r}};R([g(),L("design:type",String)],sa.prototype,"signature",void 0);R([g(),L("design:type",String)],sa.prototype,"publicKey",void 0);sa=R([J(),L("design:paramtypes",[String,String])],sa);var Xr=class{constructor(e,r){this.domain=e,this.pointers=r}};R([g(),L("design:type",String)],Xr.prototype,"domain",void 0);R([g(),L("design:type",Array)],Xr.prototype,"pointers",void 0);Xr=R([J(),L("design:paramtypes",[String,Array])],Xr);var ca=class{constructor(e,r){this.with=e,this.can=r}};R([g(),L("design:type",Xr)],ca.prototype,"with",void 0);R([g(),L("design:type",Array)],ca.prototype,"can",void 0);ca=R([J(),L("design:paramtypes",[Xr,Array])],ca);var kt=class{constructor(e,r,n,i,a){this.appName=e,this.appDesc=r,this.appIconPath=a,this.appUrl=n,this.capabilities=i}};R([g(),L("design:type",String)],kt.prototype,"appName",void 0);R([g(),L("design:type",String)],kt.prototype,"appDesc",void 0);R([g(),L("design:type",String)],kt.prototype,"appUrl",void 0);R([g(),L("design:type",String)],kt.prototype,"appIconPath",void 0);R([g(),L("design:type",Array)],kt.prototype,"capabilities",void 0);kt=R([J(),L("design:paramtypes",[String,String,String,Array,String])],kt);var Zr=class{constructor(e,r,n,i){this.requestId=e,this.auth=r,this.token=n,this.revoked=i}};R([g(),L("design:type",String)],Zr.prototype,"requestId",void 0);R([g(),L("design:type",String)],Zr.prototype,"token",void 0);R([g(),L("design:type",Boolean)],Zr.prototype,"revoked",void 0);R([g(),L("design:type",kt)],Zr.prototype,"auth",void 0);Zr=R([J(),L("design:paramtypes",[String,kt,String,Boolean])],Zr);var en=class{constructor(e,r){this.domain=e,this.pointers=r}};R([g(),L("design:type",String)],en.prototype,"domain",void 0);R([g(),L("design:type",Array)],en.prototype,"pointers",void 0);en=R([Me(),L("design:paramtypes",[String,Array])],en);var ua=class{constructor(e,r){this.with=e,this.can=r}};R([g(),L("design:type",en)],ua.prototype,"with",void 0);R([g(),L("design:type",Array)],ua.prototype,"can",void 0);ua=R([Me(),L("design:paramtypes",[en,Array])],ua);var zt=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}};R([g(),L("design:type",String)],zt.prototype,"appName",void 0);R([g(),L("design:type",String)],zt.prototype,"appDesc",void 0);R([g(),L("design:type",String)],zt.prototype,"appDomain",void 0);R([g(),L("design:type",String)],zt.prototype,"appUrl",void 0);R([g(),L("design:type",String)],zt.prototype,"appIconPath",void 0);R([g(),L("design:type",Array)],zt.prototype,"capabilities",void 0);zt=R([Me(),L("design:paramtypes",[String,String,String,String,String,Array])],zt);var rn=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},nn=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},et=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)}};rn([g(),nn("design:type",Boolean)],et.prototype,"isInitialized",void 0);rn([g(),nn("design:type",Boolean)],et.prototype,"isUnlocked",void 0);rn([g(),nn("design:type",String)],et.prototype,"did",void 0);rn([g(),nn("design:type",String)],et.prototype,"didDocument",void 0);rn([g(),nn("design:type",String)],et.prototype,"error",void 0);et=rn([J(),nn("design:paramtypes",[Object])],et);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)},Ve,Be,Wo=class{constructor(e,r){Ve.set(this,void 0),Be.set(this,void 0),hu(this,Ve,e,"f"),hu(this,Be,r,"f")}async otherAgents(){return await ye(this,Ve,"f").otherAgents(ye(this,Be,"f"))}async hasTelepresenceAdapter(){return await ye(this,Ve,"f").hasTelepresenceAdapter(ye(this,Be,"f"))}async onlineAgents(){return await ye(this,Ve,"f").onlineAgents(ye(this,Be,"f"))}async setOnlineStatus(e){return await ye(this,Ve,"f").setOnlineStatus(ye(this,Be,"f"),e)}async setOnlineStatusU(e){return await ye(this,Ve,"f").setOnlineStatusU(ye(this,Be,"f"),e)}async sendSignal(e,r){return await ye(this,Ve,"f").sendSignal(ye(this,Be,"f"),e,r)}async sendSignalU(e,r){return await ye(this,Ve,"f").sendSignalU(ye(this,Be,"f"),e,r)}async sendBroadcast(e){return await ye(this,Ve,"f").sendBroadcast(ye(this,Be,"f"),e)}async sendBroadcastU(e){return await ye(this,Ve,"f").sendBroadcastU(ye(this,Be,"f"),e)}async addSignalHandler(e){await ye(this,Ve,"f").addSignalHandler(ye(this,Be,"f"),e)}removeSignalHandler(e){ye(this,Ve,"f").removeSignalHandler(ye(this,Be,"f"),e)}};Ve=new WeakMap,Be=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},xr=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(),xr("design:type",String)],Je.prototype,"source",void 0);Tr([g(),xr("design:type",String)],Je.prototype,"target",void 0);Tr([g(),xr("design:type",String)],Je.prototype,"predicate",void 0);Tr([g(),xr("design:type",Date)],Je.prototype,"fromDate",void 0);Tr([g(),xr("design:type",Date)],Je.prototype,"untilDate",void 0);Tr([g(),xr("design:type",Number)],Je.prototype,"limit",void 0);Je=Tr([J(),Me(),xr("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)},ot,Tt;function Lo(t){return encodeURIComponent(t).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`)}var vt=class{constructor(){ot.set(this,void 0),Tt.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 vt;return mu(r,Tt,e,"f"),r}static from(e){let r=new vt;return mu(r,ot,e,"f"),r}toUrl(){if(qe(this,Tt,"f")&&!qe(this,ot,"f"))return qe(this,Tt,"f");if(!qe(this,Tt,"f")&&!qe(this,ot,"f"))throw new Error("Can't turn empty Literal into URL");let e;switch(typeof qe(this,ot,"f")){case"string":e=`string:${Lo(qe(this,ot,"f"))}`;break;case"number":e=`number:${Lo(qe(this,ot,"f"))}`;break;case"object":e=`json:${Lo(JSON.stringify(qe(this,ot,"f")))}`;break}return`literal://${e}`}get(){if(qe(this,ot,"f"))return qe(this,ot,"f");if(!qe(this,Tt,"f"))throw new Error("Can't render empty Literal");if(!qe(this,Tt,"f").startsWith("literal://"))throw new Error("Can't render Literal from non-literal URL");let e=qe(this,Tt,"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}`)}};ot=new WeakMap,Tt=new WeakMap;function Bt(t){return t.charAt(0).toUpperCase()+t.slice(1)}function qu(t){return`set${Bt(t)}`}function Dt(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 Mp(t){return`add${Bt(rs(t))}`}function jp(t){let e=t.substring(3),r=Dt(e);return r.charAt(0).toLowerCase()+r.slice(1)}function $p(t){return`remove${Bt(rs(t))}`}function Up(t){let e=t.substring(6),r=Dt(e);return r.charAt(0).toLowerCase()+r.slice(1)}function qp(t){let e=t.substring(13),r=Dt(e);return r.charAt(0).toLowerCase()+r.slice(1)}function Vp(t){return`setCollection${Bt(rs(t))}`}function fr(t){if(Array.isArray(t))return`[${t.map(fr).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 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},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)},Ce,Re,le,la=class{constructor(t,e,r){Ce.set(this,void 0),Re.set(this,void 0),le.set(this,void 0),Fo(this,Ce,e,"f"),Fo(this,Re,r,"f"),Fo(this,le,t,"f")}get baseExpression(){return j(this,Ce,"f")}async init(){let isInstance=await j(this,le,"f").isSubjectInstance(j(this,Ce,"f"),j(this,Re,"f"));if(!isInstance)throw`Not a valid subject instance of ${j(this,Re,"f")} for ${j(this,Ce,"f")}`;let results=await j(this,le,"f").infer(`subject_class("${j(this,Re,"f")}", C), property(C, Property)`),properties=results.map(t=>t.Property);for(let t of properties){let e=await j(this,le,"f").infer(`subject_class("${j(this,Re,"f")}", C), property_resolve(C, "${t}")`);Object.defineProperty(this,t,{configurable:!0,get:async()=>{let r=await j(this,le,"f").infer(`subject_class("${j(this,Re,"f")}", C), property_getter(C, "${j(this,Ce,"f")}", "${t}", Value)`);if(r&&r.length>0){let n=r[0].Value;if(e)try{if(n){let i=await j(this,le,"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 j(this,le,"f").infer(`subject_class("${j(this,Re,"f")}", C), property_setter(C, Property, Setter)`);for(let setter of setters||[])if(setter){let property=setter.Property,actions=eval(setter.Setter),resolveLanguageResults=await j(this,le,"f").infer(`subject_class("${j(this,Re,"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 j(this,le,"f").createExpression(t,resolveLanguage)),await j(this,le,"f").executeAction(actions,j(this,Ce,"f"),[{name:"value",value:t}])}}let results2=await j(this,le,"f").infer(`subject_class("${j(this,Re,"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 j(this,le,"f").infer(`subject_class("${j(this,Re,"f")}", C), collection_getter(C, "${j(this,Ce,"f")}", "${t}", Value)`);return e&&e.length>0&&e[0].Value?e[0].Value.filter(n=>n!==""&&n!==""):[]}});let adders=await j(this,le,"f").infer(`subject_class("${j(this,Re,"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[Mp(collection)]=async t=>{Array.isArray(t)?await Promise.all(t.map(e=>j(this,le,"f").executeAction(actions,j(this,Ce,"f"),[{name:"value",value:e}]))):await j(this,le,"f").executeAction(actions,j(this,Ce,"f"),[{name:"value",value:t}])}}let removers=await j(this,le,"f").infer(`subject_class("${j(this,Re,"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[$p(collection)]=async t=>{Array.isArray(t)?await Promise.all(t.map(e=>j(this,le,"f").executeAction(actions,j(this,Ce,"f"),[{name:"value",value:e}]))):await j(this,le,"f").executeAction(actions,j(this,Ce,"f"),[{name:"value",value:t}])}}let collectionSetters=await j(this,le,"f").infer(`subject_class("${j(this,Re,"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[Vp(collection)]=async t=>{Array.isArray(t)?await j(this,le,"f").executeAction(actions,j(this,Ce,"f"),t.map(e=>({name:"value",value:e}))):await j(this,le,"f").executeAction(actions,j(this,Ce,"f"),[{name:"value",value:t}])}}}};Ce=new WeakMap,Re=new WeakMap,le=new WeakMap;var Gr=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},P=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,oe,pr,dr,hr,An,Yr=class{constructor(t,e){ne.set(this,void 0),oe.set(this,void 0),pr.set(this,void 0),dr.set(this,void 0),hr.set(this,void 0),An.set(this,void 0),Gr(this,pr,[],"f"),Gr(this,dr,[],"f"),Gr(this,hr,[],"f"),Gr(this,An,[],"f"),Gr(this,ne,t,"f"),Gr(this,oe,e,"f"),this.uuid=P(this,ne,"f").uuid,this.name=P(this,ne,"f").name,this.sharedUrl=P(this,ne,"f").sharedUrl,this.neighbourhood=P(this,ne,"f").neighbourhood,this.state=P(this,ne,"f").state,P(this,oe,"f").addPerspectiveLinkAddedListener(P(this,ne,"f").uuid,P(this,pr,"f")),P(this,oe,"f").addPerspectiveLinkRemovedListener(P(this,ne,"f").uuid,P(this,dr,"f")),P(this,oe,"f").addPerspectiveLinkUpdatedListener(P(this,ne,"f").uuid,P(this,hr,"f")),P(this,oe,"f").addPerspectiveSyncStateChangeListener(P(this,ne,"f").uuid,P(this,An,"f"))}async executeAction(t,e,r){return await P(this,oe,"f").executeCommands(P(this,ne,"f").uuid,JSON.stringify(t),e,JSON.stringify(r))}async get(t){return await P(this,oe,"f").queryLinks(P(this,ne,"f").uuid,t)}async infer(t){return await P(this,oe,"f").queryProlog(P(this,ne,"f").uuid,t)}async add(t,e="shared"){return await P(this,oe,"f").addLink(P(this,ne,"f").uuid,t,e)}async addLinks(t,e="shared"){return await P(this,oe,"f").addLinks(P(this,ne,"f").uuid,t,e)}async removeLinks(t){return await P(this,oe,"f").removeLinks(P(this,ne,"f").uuid,t)}async linkMutations(t,e="shared"){return await P(this,oe,"f").linkMutations(P(this,ne,"f").uuid,t,e)}async addLinkExpression(t,e="shared"){return await P(this,oe,"f").addLinkExpression(P(this,ne,"f").uuid,t,e)}async update(t,e){return await P(this,oe,"f").updateLink(P(this,ne,"f").uuid,t,e)}async remove(t){return await P(this,oe,"f").removeLink(P(this,ne,"f").uuid,t)}async getExpression(t){return await P(this,oe,"f").getExpression(t)}async createExpression(t,e){return await P(this,oe,"f").createExpression(t,e)}async addListener(t,e){t==="link-added"?P(this,pr,"f").push(e):t==="link-removed"?P(this,dr,"f").push(e):t==="link-updated"&&P(this,hr,"f").push(e)}async addSyncStateChangeListener(t){P(this,An,"f").push(t)}async removeListener(t,e){if(t==="link-added"){let r=P(this,pr,"f").indexOf(e);P(this,pr,"f").splice(r,1)}else if(t==="link-removed"){let r=P(this,dr,"f").indexOf(e);P(this,dr,"f").splice(r,1)}else if(t==="link-updated"){let r=P(this,hr,"f").indexOf(e);P(this,hr,"f").splice(r,1)}}async snapshot(){return P(this,oe,"f").snapshotByUUID(P(this,ne,"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=>vt.fromUrl(e).get())}async addSdna(t,e,r){return P(this,oe,"f").addSdna(P(this,ne,"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(t,e){let r;if(typeof t=="string")r=t,await P(this,oe,"f").createSubject(P(this,ne,"f").uuid,JSON.stringify({className:r}),e);else{let n=this.buildQueryFromTemplate(t);await P(this,oe,"f").createSubject(P(this,ne,"f").uuid,JSON.stringify({query:n}),e)}return this.getSubjectProxy(e,t)}async getSubjectData(t,e){if(typeof t=="string")return JSON.parse(await P(this,oe,"f").getSubjectData(P(this,ne,"f").uuid,JSON.stringify({className:t}),e));let r=this.buildQueryFromTemplate(t);return JSON.parse(await P(this,oe,"f").getSubjectData(P(this,ne,"f").uuid,JSON.stringify({query:r}),e))}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 la(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}buildQueryFromTemplate(t){let e=[],r=[];Object.getPrototypeOf(t).__properties?Object.keys(Object.getPrototypeOf(t).__properties).forEach(c=>e.push(c)):e.push(...Object.keys(t).filter(c=>!Array.isArray(t[c]))),Object.getPrototypeOf(t).__collections?Object.keys(Object.getPrototypeOf(t).__collections).filter(c=>c!=="isSubjectInstance").forEach(c=>!r.includes(c)):r.push(...Object.keys(t).filter(c=>Array.isArray(t[c])).filter(c=>c!=="isSubjectInstance"));let n=Object.getOwnPropertyNames(t).filter(c=>typeof t[c]=="function"&&c.startsWith("set")&&!c.startsWith("setCollection"));n=n.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(t)).filter(c=>typeof t[c]=="function"&&c.startsWith("set")&&!c.startsWith("setCollection")));let i=Object.getOwnPropertyNames(t).filter(c=>typeof t[c]=="function"&&c.startsWith("add"));i=i.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(t)).filter(c=>typeof t[c]=="function"&&c.startsWith("add")));let a=Object.getOwnPropertyNames(t).filter(c=>typeof t[c]=="function"&&c.startsWith("remove"));a=a.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(t)).filter(c=>typeof t[c]=="function"&&c.startsWith("remove")));let o=Object.getOwnPropertyNames(t).filter(c=>typeof t[c]=="function"&&c.startsWith("setCollection"));o=o.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(t)).filter(c=>typeof t[c]=="function"&&c.startsWith("setCollection")));let s="subject_class(Class, C)";for(let c of e)s+=`, property(C, "${c}")`;for(let c of r)s+=`, collection(C, "${c}")`;for(let c of n){let u=c.substring(3);u=u.charAt(0).toLowerCase()+u.slice(1),s+=`, property_setter(C, "${u}", _)`}for(let c of i)s+=`, collection_adder(C, "${jp(c)}", _)`;for(let c of a)s+=`, collection_remover(C, "${Up(c)}", _)`;for(let c of o)s+=`, collection_setter(C, "${qp(c)}", _)`;return s+=".",s}async subjectClassesByTemplate(t){let e=this.buildQueryFromTemplate(t),r=await this.infer(e);return r?r.map(n=>n.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 P(this,oe,"f").getNeighbourhoodProxy(P(this,ne,"f").uuid)}};ne=new WeakMap,oe=new WeakMap,pr=new WeakMap,dr=new WeakMap,hr=new WeakMap,An=new WeakMap;var cr=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},B=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)},ee,Pn,Cn,Rn,Ji,Ln,Hi,Ke=`
62
62
  author
63
63
  timestamp
64
64
  status
@@ -84,7 +84,7 @@ neighbourhood {
84
84
  }
85
85
  author
86
86
  }
87
- `,pa=class{constructor(e,r=!0){ee.set(this,void 0),Cn.set(this,void 0),Rn.set(this,void 0),Ln.set(this,void 0),Hi.set(this,void 0),Fn.set(this,void 0),Yi.set(this,void 0),cr(this,ee,e,"f"),cr(this,Cn,[],"f"),cr(this,Rn,[],"f"),cr(this,Ln,[],"f"),cr(this,Hi,[],"f"),r&&(this.subscribePerspectiveAdded(),this.subscribePerspectiveUpdated(),this.subscribePerspectiveRemoved())}setExpressionClient(e){cr(this,Fn,e,"f")}setNeighbourhoodClient(e){cr(this,Yi,e,"f")}async all(){let{perspectives:e}=T(await B(this,ee,"f").query({query:_`query perspectives {
87
+ `,fa=class{constructor(e,r=!0){ee.set(this,void 0),Pn.set(this,void 0),Cn.set(this,void 0),Rn.set(this,void 0),Ji.set(this,void 0),Ln.set(this,void 0),Hi.set(this,void 0),cr(this,ee,e,"f"),cr(this,Pn,[],"f"),cr(this,Cn,[],"f"),cr(this,Rn,[],"f"),cr(this,Ji,[],"f"),r&&(this.subscribePerspectiveAdded(),this.subscribePerspectiveUpdated(),this.subscribePerspectiveRemoved())}setExpressionClient(e){cr(this,Ln,e,"f")}setNeighbourhoodClient(e){cr(this,Hi,e,"f")}async all(){let{perspectives:e}=T(await B(this,ee,"f").query({query:_`query perspectives {
88
88
  perspectives {
89
89
  ${Wr}
90
90
  }
@@ -161,19 +161,19 @@ neighbourhood {
161
161
  perspectiveCreateSubject(uuid: $uuid, subjectClass: $subjectClass, expressionAddress: $expressionAddress)
162
162
  }`,variables:{uuid:e,subjectClass:r,expressionAddress:n}})).perspectiveCreateSubject}async getSubjectData(e,r,n){return T(await B(this,ee,"f").mutate({mutation:_`mutation perspectiveGetSubjectData($uuid: String!, $subjectClass: String!, $expressionAddress: String!) {
163
163
  perspectiveGetSubjectData(uuid: $uuid, subjectClass: $subjectClass, expressionAddress: $expressionAddress)
164
- }`,variables:{uuid:e,subjectClass:r,expressionAddress:n}})).perspectiveGetSubjectData}async getExpression(e){return await B(this,Fn,"f").get(e)}async createExpression(e,r){return await B(this,Fn,"f").create(e,r)}addPerspectiveAddedListener(e){B(this,Cn,"f").push(e)}subscribePerspectiveAdded(){B(this,ee,"f").subscribe({query:_` subscription {
164
+ }`,variables:{uuid:e,subjectClass:r,expressionAddress:n}})).perspectiveGetSubjectData}async getExpression(e){return await B(this,Ln,"f").get(e)}async createExpression(e,r){return await B(this,Ln,"f").create(e,r)}addPerspectiveAddedListener(e){B(this,Pn,"f").push(e)}subscribePerspectiveAdded(){B(this,ee,"f").subscribe({query:_` subscription {
165
165
  perspectiveAdded { ${Wr} }
166
166
  }
167
- `}).subscribe({next:e=>{B(this,Cn,"f").forEach(r=>{r(e.data.perspectiveAdded)})},error:e=>console.error(e)})}addPerspectiveUpdatedListener(e){B(this,Rn,"f").push(e)}subscribePerspectiveUpdated(){B(this,ee,"f").subscribe({query:_` subscription {
167
+ `}).subscribe({next:e=>{B(this,Pn,"f").forEach(r=>{r(e.data.perspectiveAdded)})},error:e=>console.error(e)})}addPerspectiveUpdatedListener(e){B(this,Cn,"f").push(e)}subscribePerspectiveUpdated(){B(this,ee,"f").subscribe({query:_` subscription {
168
168
  perspectiveUpdated { ${Wr} }
169
169
  }
170
- `}).subscribe({next:e=>{B(this,Rn,"f").forEach(r=>{r(e.data.perspectiveUpdated)})},error:e=>console.error(e)})}addPerspectiveSyncedListener(e){B(this,Hi,"f").push(e)}async addPerspectiveSyncStateChangeListener(e,r){B(this,ee,"f").subscribe({query:_` subscription {
170
+ `}).subscribe({next:e=>{B(this,Cn,"f").forEach(r=>{r(e.data.perspectiveUpdated)})},error:e=>console.error(e)})}addPerspectiveSyncedListener(e){B(this,Ji,"f").push(e)}async addPerspectiveSyncStateChangeListener(e,r){B(this,ee,"f").subscribe({query:_` subscription {
171
171
  perspectiveSyncStateChange(uuid: "${e}")
172
172
  }
173
- `}).subscribe({next:n=>{r.forEach(i=>{i(n.data.perspectiveSyncStateChange)})},error:n=>console.error(n)}),await new Promise(n=>setTimeout(n,500))}addPerspectiveRemovedListener(e){B(this,Ln,"f").push(e)}subscribePerspectiveRemoved(){B(this,ee,"f").subscribe({query:_` subscription {
173
+ `}).subscribe({next:n=>{r.forEach(i=>{i(n.data.perspectiveSyncStateChange)})},error:n=>console.error(n)}),await new Promise(n=>setTimeout(n,500))}addPerspectiveRemovedListener(e){B(this,Rn,"f").push(e)}subscribePerspectiveRemoved(){B(this,ee,"f").subscribe({query:_` subscription {
174
174
  perspectiveRemoved
175
175
  }
176
- `}).subscribe({next:e=>{B(this,Ln,"f").forEach(r=>{r(e.data.perspectiveRemoved)})},error:e=>console.error(e)})}async addPerspectiveLinkAddedListener(e,r){B(this,ee,"f").subscribe({query:_` subscription {
176
+ `}).subscribe({next:e=>{B(this,Rn,"f").forEach(r=>{r(e.data.perspectiveRemoved)})},error:e=>console.error(e)})}async addPerspectiveLinkAddedListener(e,r){B(this,ee,"f").subscribe({query:_` subscription {
177
177
  perspectiveLinkAdded(uuid: "${e}") { ${Ke} }
178
178
  }
179
179
  `}).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){B(this,ee,"f").subscribe({query:_` subscription {
@@ -189,7 +189,7 @@ neighbourhood {
189
189
  }
190
190
  }
191
191
  }
192
- `}).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 Ko(B(this,Yi,"f"),e)}};ee=new WeakMap,Cn=new WeakMap,Rn=new WeakMap,Ln=new WeakMap,Hi=new WeakMap,Fn=new WeakMap,Yi=new WeakMap;var $i=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)},ie,Mn,jn,$n,kn=`
192
+ `}).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(B(this,Hi,"f"),e)}};ee=new WeakMap,Pn=new WeakMap,Cn=new WeakMap,Rn=new WeakMap,Ji=new WeakMap,Ln=new WeakMap,Hi=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)},ie,Fn,Mn,jn,kn=`
193
193
  did
194
194
  directMessageLanguage
195
195
  perspective {
@@ -203,7 +203,7 @@ neighbourhood {
203
203
  }
204
204
  }
205
205
  }
206
- `,Ui=`
206
+ `,ji=`
207
207
  requestId
208
208
  revoked
209
209
  auth {
@@ -225,7 +225,7 @@ neighbourhood {
225
225
  did
226
226
  didDocument
227
227
  error
228
- `,qi=`
228
+ `,$i=`
229
229
  did
230
230
  didSigningKeyId
231
231
  deviceKeyType
@@ -235,7 +235,7 @@ neighbourhood {
235
235
  `,Bp=`
236
236
  signature
237
237
  publicKey
238
- `,Hn=class{constructor(e,r=!0){ie.set(this,void 0),Mn.set(this,void 0),jn.set(this,void 0),$n.set(this,void 0),$i(this,ie,e,"f"),$i(this,jn,[],"f"),$i(this,$n,[],"f"),$i(this,Mn,[],"f"),r&&(this.subscribeAgentUpdated(),this.subscribeAgentStatusChanged(),this.subscribeAppsChanged())}async me(){let{agent:e}=T(await H(this,ie,"f").query({query:_`query agent { agent { ${kn} } }`})),r=new Vt(e.did,e.perspective);return r.directMessageLanguage=e.directMessageLanguage,r}async status(){let{agentStatus:e}=T(await H(this,ie,"f").query({query:_`query agentStatus {
238
+ `,zn=class{constructor(e,r=!0){ie.set(this,void 0),Fn.set(this,void 0),Mn.set(this,void 0),jn.set(this,void 0),Mi(this,ie,e,"f"),Mi(this,Mn,[],"f"),Mi(this,jn,[],"f"),Mi(this,Fn,[],"f"),r&&(this.subscribeAgentUpdated(),this.subscribeAgentStatusChanged(),this.subscribeAppsChanged())}async me(){let{agent:e}=T(await H(this,ie,"f").query({query:_`query agent { agent { ${kn} } }`})),r=new Vt(e.did,e.perspective);return r.directMessageLanguage=e.directMessageLanguage,r}async status(){let{agentStatus:e}=T(await H(this,ie,"f").query({query:_`query agentStatus {
239
239
  agentStatus {
240
240
  ${Kr}
241
241
  }
@@ -270,38 +270,38 @@ neighbourhood {
270
270
  agentUpdatePublicPerspective(perspective: $perspective) {
271
271
  ${kn}
272
272
  }
273
- }`,variables:{perspective:r}})),i=n,a=new Vt(i.did,i.perspective);return a.directMessageLanguage=i.directMessageLanguage,a}async mutatePublicPerspective(e){let r=new pa(H(this,ie,"f")),n=new Hn(H(this,ie,"f")),i=await r.add("Agent Perspective Proxy"),a=await n.me();a.perspective&&await i.loadSnapshot(a.perspective);for(let c of e.additions)await i.add(c);for(let c of e.removals)await i.remove(c);let o=await i.snapshot(),s=await this.updatePublicPerspective(o);return await r.remove(i.uuid),s}async updateDirectMessageLanguage(e){let{agentUpdateDirectMessageLanguage:r}=T(await H(this,ie,"f").mutate({mutation:_`mutation agentUpdateDirectMessageLanguage($directMessageLanguage: String!) {
273
+ }`,variables:{perspective:r}})),i=n,a=new Vt(i.did,i.perspective);return a.directMessageLanguage=i.directMessageLanguage,a}async mutatePublicPerspective(e){let r=new fa(H(this,ie,"f")),n=new zn(H(this,ie,"f")),i=await r.add("Agent Perspective Proxy"),a=await n.me();a.perspective&&await i.loadSnapshot(a.perspective);for(let c of e.additions)await i.add(c);for(let c of e.removals)await i.remove(c);let o=await i.snapshot(),s=await this.updatePublicPerspective(o);return await r.remove(i.uuid),s}async updateDirectMessageLanguage(e){let{agentUpdateDirectMessageLanguage:r}=T(await H(this,ie,"f").mutate({mutation:_`mutation agentUpdateDirectMessageLanguage($directMessageLanguage: String!) {
274
274
  agentUpdateDirectMessageLanguage(directMessageLanguage: $directMessageLanguage) {
275
275
  ${kn}
276
276
  }
277
277
  }`,variables:{directMessageLanguage:e}})),n=r,i=new Vt(n.did,n.perspective);return i.directMessageLanguage=n.directMessageLanguage,i}async addEntanglementProofs(e){let{agentAddEntanglementProofs:r}=T(await H(this,ie,"f").mutate({mutation:_`mutation agentAddEntanglementProofs($proofs: [EntanglementProofInput!]!) {
278
278
  agentAddEntanglementProofs(proofs: $proofs) {
279
- ${qi}
279
+ ${$i}
280
280
  }
281
281
  }`,variables:{proofs:e}}));return r}async deleteEntanglementProofs(e){let{agentDeleteEntanglementProofs:r}=T(await H(this,ie,"f").mutate({mutation:_`mutation agentDeleteEntanglementProofs($proofs: [EntanglementProofInput!]!) {
282
282
  agentDeleteEntanglementProofs(proofs: $proofs) {
283
- ${qi}
283
+ ${$i}
284
284
  }
285
285
  }`,variables:{proofs:e}}));return r}async getEntanglementProofs(){let{agentGetEntanglementProofs:e}=T(await H(this,ie,"f").query({query:_`query agentGetEntanglementProofs {
286
286
  agentGetEntanglementProofs {
287
- ${qi}
287
+ ${$i}
288
288
  }
289
289
  }`}));return e}async entanglementProofPreFlight(e,r){let{agentEntanglementProofPreFlight:n}=T(await H(this,ie,"f").mutate({mutation:_`mutation agentEntanglementProofPreFlight($deviceKey: String!, $deviceKeyType: String!) {
290
290
  agentEntanglementProofPreFlight(deviceKey: $deviceKey, deviceKeyType: $deviceKeyType) {
291
- ${qi}
291
+ ${$i}
292
292
  }
293
- }`,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,ie,"f").subscribe({query:_` subscription {
293
+ }`,variables:{deviceKey:e,deviceKeyType:r}}));return n}addUpdatedListener(e){H(this,Mn,"f").push(e)}addAppChangedListener(e){H(this,Fn,"f").push(e)}subscribeAgentUpdated(){H(this,ie,"f").subscribe({query:_` subscription {
294
294
  agentUpdated { ${kn} }
295
295
  }
296
- `}).subscribe({next:e=>{let r=e.data.agentUpdated;H(this,jn,"f").forEach(n=>{n(r)})},error:e=>console.error(e)})}subscribeAppsChanged(){H(this,ie,"f").subscribe({query:_` subscription {
296
+ `}).subscribe({next:e=>{let r=e.data.agentUpdated;H(this,Mn,"f").forEach(n=>{n(r)})},error:e=>console.error(e)})}subscribeAppsChanged(){H(this,ie,"f").subscribe({query:_` subscription {
297
297
  agentAppsChanged {
298
- ${Ui}
298
+ ${ji}
299
299
  }
300
300
  }
301
- `}).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,ie,"f").subscribe({query:_` subscription {
301
+ `}).subscribe({next:e=>{H(this,Fn,"f").forEach(r=>{r()})},error:e=>console.error(e)})}addAgentStatusChangedListener(e){H(this,jn,"f").push(e)}subscribeAgentStatusChanged(){H(this,ie,"f").subscribe({query:_` subscription {
302
302
  agentStatusChanged { ${Kr} }
303
303
  }
304
- `}).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}=T(await H(this,ie,"f").mutate({mutation:_`
304
+ `}).subscribe({next:e=>{let r=e.data.agentStatusChanged;H(this,jn,"f").forEach(n=>{n(r)})},error:e=>console.error(e)})}async requestCapability(e){let{agentRequestCapability:r}=T(await H(this,ie,"f").mutate({mutation:_`
305
305
  mutation agentRequestCapability($authInfo: AuthInfoInput!) {
306
306
  agentRequestCapability(authInfo: $authInfo)
307
307
  }
@@ -315,15 +315,15 @@ neighbourhood {
315
315
  }
316
316
  `,variables:{requestId:e,rand:r}}));return n}async getApps(){let{agentGetApps:e}=T(await H(this,ie,"f").mutate({mutation:_`query agentGetApps {
317
317
  agentGetApps {
318
- ${Ui}
318
+ ${ji}
319
319
  }
320
320
  }`}));return e}async removeApp(e){let{agentRemoveApp:r}=T(await H(this,ie,"f").mutate({mutation:_`mutation agentRemoveApp($requestId: String!) {
321
321
  agentRemoveApp(requestId: $requestId) {
322
- ${Ui}
322
+ ${ji}
323
323
  }
324
324
  }`,variables:{requestId:e}}));return r}async revokeToken(e){let{agentRevokeToken:r}=T(await H(this,ie,"f").mutate({mutation:_`mutation agentRevokeToken($requestId: String!) {
325
325
  agentRevokeToken(requestId: $requestId) {
326
- ${Ui}
326
+ ${ji}
327
327
  }
328
328
  }`,variables:{requestId:e}}));return r}async isLocked(){let{agentIsLocked:e}=T(await H(this,ie,"f").mutate({mutation:_`
329
329
  query agentIsLocked {
@@ -333,14 +333,14 @@ neighbourhood {
333
333
  agentSignMessage(message: $message) {
334
334
  ${Bp}
335
335
  }
336
- }`,variables:{message:e}}));return r}};ie=new WeakMap,Mn=new WeakMap,jn=new WeakMap,$n=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},qt=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)},st,vu=`
336
+ }`,variables:{message:e}}));return r}};ie=new WeakMap,Fn=new WeakMap,Mn=new WeakMap,jn=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},qt=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)},st,yu=`
337
337
  name
338
338
  address
339
339
  settings
340
340
  icon { code }
341
341
  constructorIcon { code }
342
342
  settingsIcon { code }
343
- `,bu=`
343
+ `,gu=`
344
344
  name
345
345
  address
346
346
  description
@@ -350,13 +350,13 @@ neighbourhood {
350
350
  templateAppliedParams
351
351
  possibleTemplateParams
352
352
  sourceCodeLink
353
- `,zo=class{constructor(e){st.set(this,void 0),Qp(this,st,e,"f")}async byAddress(e){let{language:r}=T(await qt(this,st,"f").query({query:_`query byAddress($address: String!) {
353
+ `,Ko=class{constructor(e){st.set(this,void 0),Qp(this,st,e,"f")}async byAddress(e){let{language:r}=T(await qt(this,st,"f").query({query:_`query byAddress($address: String!) {
354
354
  language(address: $address) {
355
- ${vu}
355
+ ${yu}
356
356
  }
357
357
  }`,variables:{address:e}}));return r}async byFilter(e){let{languages:r}=T(await qt(this,st,"f").query({query:_`query byFilter($filter: String!) {
358
358
  languages(filter: $filter) {
359
- ${vu}
359
+ ${yu}
360
360
  }
361
361
  }`,variables:{filter:e}}));return r}async all(){return this.byFilter("")}async writeSettings(e,r){let{languageWriteSettings:n}=T(await qt(this,st,"f").mutate({mutation:_`mutation writeSettings($languageAddress: String!, $settings: String!) {
362
362
  languageWriteSettings(languageAddress: $languageAddress, settings: $settings)
@@ -372,13 +372,13 @@ neighbourhood {
372
372
  $languageMeta: LanguageMetaInput!,
373
373
  ) {
374
374
  languagePublish(languagePath: $languagePath, languageMeta: $languageMeta) {
375
- ${bu}
375
+ ${gu}
376
376
  }
377
377
  }`,variables:{languagePath:e,languageMeta:r}}));return n}async meta(e){let{languageMeta:r}=T(await qt(this,st,"f").query({query:_`query languageMeta(
378
378
  $address: String!,
379
379
  ) {
380
380
  languageMeta(address: $address) {
381
- ${bu}
381
+ ${gu}
382
382
  }
383
383
  }`,variables:{address:e}}));return r}async source(e){let{languageSource:r}=T(await qt(this,st,"f").query({query:_`query languageSource(
384
384
  $address: String!,
@@ -388,7 +388,7 @@ neighbourhood {
388
388
  $address: String!,
389
389
  ) {
390
390
  languageRemove(address: $address)
391
- }`,variables:{address:e}}));return r}};st=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},Ie=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,mr,Jo=class{constructor(e){Re.set(this,void 0),mr.set(this,new Map),Gp(this,Re,e,"f")}async publishFromPerspective(e,r,n){let{neighbourhoodPublishFromPerspective:i}=T(await Ie(this,Re,"f").mutate({mutation:_`mutation neighbourhoodPublishFromPerspective(
391
+ }`,variables:{address:e}}));return r}};st=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},Ie=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,mr,zo=class{constructor(e){Le.set(this,void 0),mr.set(this,new Map),Gp(this,Le,e,"f")}async publishFromPerspective(e,r,n){let{neighbourhoodPublishFromPerspective:i}=T(await Ie(this,Le,"f").mutate({mutation:_`mutation neighbourhoodPublishFromPerspective(
392
392
  $linkLanguage: String!,
393
393
  $meta: PerspectiveInput!,
394
394
  $perspectiveUUID: String!
@@ -398,7 +398,7 @@ neighbourhood {
398
398
  meta: $meta,
399
399
  perspectiveUUID: $perspectiveUUID
400
400
  )
401
- }`,variables:{perspectiveUUID:e,linkLanguage:r,meta:n}}));return i}async joinFromUrl(e){let{neighbourhoodJoinFromUrl:r}=T(await Ie(this,Re,"f").mutate({mutation:_`mutation neighbourhoodJoinFromUrl($url: String!) {
401
+ }`,variables:{perspectiveUUID:e,linkLanguage:r,meta:n}}));return i}async joinFromUrl(e){let{neighbourhoodJoinFromUrl:r}=T(await Ie(this,Le,"f").mutate({mutation:_`mutation neighbourhoodJoinFromUrl($url: String!) {
402
402
  neighbourhoodJoinFromUrl(url: $url) {
403
403
  uuid
404
404
  name
@@ -420,11 +420,11 @@ neighbourhood {
420
420
  author
421
421
  }
422
422
  }
423
- }`,variables:{url:e}}));return r}async otherAgents(e){let{neighbourhoodOtherAgents:r}=T(await Ie(this,Re,"f").query({query:_`query neighbourhoodOtherAgents($perspectiveUUID: String!) {
423
+ }`,variables:{url:e}}));return r}async otherAgents(e){let{neighbourhoodOtherAgents:r}=T(await Ie(this,Le,"f").query({query:_`query neighbourhoodOtherAgents($perspectiveUUID: String!) {
424
424
  neighbourhoodOtherAgents(perspectiveUUID: $perspectiveUUID)
425
- }`,variables:{perspectiveUUID:e}}));return r}async hasTelepresenceAdapter(e){let{neighbourhoodHasTelepresenceAdapter:r}=T(await Ie(this,Re,"f").query({query:_`query neighbourhoodHasTelepresenceAdapter($perspectiveUUID: String!) {
425
+ }`,variables:{perspectiveUUID:e}}));return r}async hasTelepresenceAdapter(e){let{neighbourhoodHasTelepresenceAdapter:r}=T(await Ie(this,Le,"f").query({query:_`query neighbourhoodHasTelepresenceAdapter($perspectiveUUID: String!) {
426
426
  neighbourhoodHasTelepresenceAdapter(perspectiveUUID: $perspectiveUUID)
427
- }`,variables:{perspectiveUUID:e}}));return r}async onlineAgents(e){let{neighbourhoodOnlineAgents:r}=T(await Ie(this,Re,"f").query({query:_`query neighbourhoodOnlineAgents($perspectiveUUID: String!) {
427
+ }`,variables:{perspectiveUUID:e}}));return r}async onlineAgents(e){let{neighbourhoodOnlineAgents:r}=T(await Ie(this,Le,"f").query({query:_`query neighbourhoodOnlineAgents($perspectiveUUID: String!) {
428
428
  neighbourhoodOnlineAgents(perspectiveUUID: $perspectiveUUID) {
429
429
  did
430
430
  status {
@@ -441,7 +441,7 @@ neighbourhood {
441
441
  proof { valid, invalid, signature, key }
442
442
  }
443
443
  }
444
- }`,variables:{perspectiveUUID:e}}));return r}async setOnlineStatus(e,r){let{neighbourhoodSetOnlineStatus:n}=T(await Ie(this,Re,"f").mutate({mutation:_`mutation neighbourhoodSetOnlineStatus(
444
+ }`,variables:{perspectiveUUID:e}}));return r}async setOnlineStatus(e,r){let{neighbourhoodSetOnlineStatus:n}=T(await Ie(this,Le,"f").mutate({mutation:_`mutation neighbourhoodSetOnlineStatus(
445
445
  $perspectiveUUID: String!,
446
446
  $status: PerspectiveInput!
447
447
  ) {
@@ -449,7 +449,7 @@ neighbourhood {
449
449
  perspectiveUUID: $perspectiveUUID,
450
450
  status: $status
451
451
  )
452
- }`,variables:{perspectiveUUID:e,status:r}}));return n}async setOnlineStatusU(e,r){let{neighbourhoodSetOnlineStatusU:n}=T(await Ie(this,Re,"f").mutate({mutation:_`mutation neighbourhoodSetOnlineStatusU(
452
+ }`,variables:{perspectiveUUID:e,status:r}}));return n}async setOnlineStatusU(e,r){let{neighbourhoodSetOnlineStatusU:n}=T(await Ie(this,Le,"f").mutate({mutation:_`mutation neighbourhoodSetOnlineStatusU(
453
453
  $perspectiveUUID: String!,
454
454
  $status: PerspectiveUnsignedInput!
455
455
  ) {
@@ -457,7 +457,7 @@ neighbourhood {
457
457
  perspectiveUUID: $perspectiveUUID,
458
458
  status: $status
459
459
  )
460
- }`,variables:{perspectiveUUID:e,status:r}}));return n}async sendSignal(e,r,n){let{neighbourhoodSendSignal:i}=T(await Ie(this,Re,"f").mutate({mutation:_`mutation neighbourhoodSendSignal(
460
+ }`,variables:{perspectiveUUID:e,status:r}}));return n}async sendSignal(e,r,n){let{neighbourhoodSendSignal:i}=T(await Ie(this,Le,"f").mutate({mutation:_`mutation neighbourhoodSendSignal(
461
461
  $perspectiveUUID: String!,
462
462
  $remoteAgentDid: String!,
463
463
  $payload: PerspectiveInput!
@@ -467,7 +467,7 @@ neighbourhood {
467
467
  remoteAgentDid: $remoteAgentDid,
468
468
  payload: $payload
469
469
  )
470
- }`,variables:{perspectiveUUID:e,remoteAgentDid:r,payload:n}}));return i}async sendSignalU(e,r,n){let{neighbourhoodSendSignalU:i}=T(await Ie(this,Re,"f").mutate({mutation:_`mutation neighbourhoodSendSignalU(
470
+ }`,variables:{perspectiveUUID:e,remoteAgentDid:r,payload:n}}));return i}async sendSignalU(e,r,n){let{neighbourhoodSendSignalU:i}=T(await Ie(this,Le,"f").mutate({mutation:_`mutation neighbourhoodSendSignalU(
471
471
  $perspectiveUUID: String!,
472
472
  $remoteAgentDid: String!,
473
473
  $payload: PerspectiveUnsignedInput!
@@ -477,7 +477,7 @@ neighbourhood {
477
477
  remoteAgentDid: $remoteAgentDid,
478
478
  payload: $payload
479
479
  )
480
- }`,variables:{perspectiveUUID:e,remoteAgentDid:r,payload:n}}));return i}async sendBroadcast(e,r){let{neighbourhoodSendBroadcast:n}=T(await Ie(this,Re,"f").mutate({mutation:_`mutation neighbourhoodSendBroadcast(
480
+ }`,variables:{perspectiveUUID:e,remoteAgentDid:r,payload:n}}));return i}async sendBroadcast(e,r){let{neighbourhoodSendBroadcast:n}=T(await Ie(this,Le,"f").mutate({mutation:_`mutation neighbourhoodSendBroadcast(
481
481
  $perspectiveUUID: String!,
482
482
  $payload: PerspectiveInput!
483
483
  ) {
@@ -485,7 +485,7 @@ neighbourhood {
485
485
  perspectiveUUID: $perspectiveUUID,
486
486
  payload: $payload
487
487
  )
488
- }`,variables:{perspectiveUUID:e,payload:r}}));return n}async sendBroadcastU(e,r){let{neighbourhoodSendBroadcastU:n}=T(await Ie(this,Re,"f").mutate({mutation:_`mutation neighbourhoodSendBroadcastU(
488
+ }`,variables:{perspectiveUUID:e,payload:r}}));return n}async sendBroadcastU(e,r){let{neighbourhoodSendBroadcastU:n}=T(await Ie(this,Le,"f").mutate({mutation:_`mutation neighbourhoodSendBroadcastU(
489
489
  $perspectiveUUID: String!,
490
490
  $payload: PerspectiveUnsignedInput!
491
491
  ) {
@@ -493,7 +493,7 @@ neighbourhood {
493
493
  perspectiveUUID: $perspectiveUUID,
494
494
  payload: $payload
495
495
  )
496
- }`,variables:{perspectiveUUID:e,payload:r}}));return n}dispatchSignal(e,r){let n=Ie(this,mr,"f").get(e);n&&n.forEach(i=>i(r))}async subscribeToSignals(e){let r=this;await Ie(this,Re,"f").subscribe({query:_`subscription neighbourhoodSignal($perspectiveUUID: String!) {
496
+ }`,variables:{perspectiveUUID:e,payload:r}}));return n}dispatchSignal(e,r){let n=Ie(this,mr,"f").get(e);n&&n.forEach(i=>i(r))}async subscribeToSignals(e){let r=this;await Ie(this,Le,"f").subscribe({query:_`subscription neighbourhoodSignal($perspectiveUUID: String!) {
497
497
  neighbourhoodSignal(perspectiveUUID: $perspectiveUUID) {
498
498
  author
499
499
  timestamp
@@ -508,7 +508,7 @@ neighbourhood {
508
508
  }
509
509
  proof { valid, invalid, signature, key }
510
510
  }
511
- }`,variables:{perspectiveUUID:e}}).subscribe({next:n=>{let{neighbourhoodSignal:i}=T(n);r.dispatchSignal(e,i)}})}async addSignalHandler(e,r){let n=Ie(this,mr,"f").get(e);n||(n=[],await this.subscribeToSignals(e)),n.push(r),Ie(this,mr,"f").set(e,n)}removeSignalHandler(e,r){let n=Ie(this,mr,"f").get(e);if(n){let i=n.indexOf(r);i>-1&&n.splice(i,1)}Ie(this,mr,"f").set(e,n)}};Re=new WeakMap,mr=new WeakMap;var Nn=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)},Y,Un,qn,Vn,Bn,Vi=`
511
+ }`,variables:{perspectiveUUID:e}}).subscribe({next:n=>{let{neighbourhoodSignal:i}=T(n);r.dispatchSignal(e,i)}})}async addSignalHandler(e,r){let n=Ie(this,mr,"f").get(e);n||(n=[],await this.subscribeToSignals(e)),n.push(r),Ie(this,mr,"f").set(e,n)}removeSignalHandler(e,r){let n=Ie(this,mr,"f").get(e);if(n){let i=n.indexOf(r);i>-1&&n.splice(i,1)}Ie(this,mr,"f").set(e,n)}};Le=new WeakMap,mr=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},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)},Z,$n,Un,qn,Vu,qi=`
512
512
  author
513
513
  timestamp
514
514
  data {
@@ -529,88 +529,85 @@ trigger
529
529
  perspectiveIds
530
530
  webhookUrl
531
531
  webhookAuth
532
- `,Ho=`
532
+ `,Bu=`
533
533
  id
534
534
  granted
535
535
  ${Wp}
536
536
  `,Kp=`
537
- notification { ${Ho} }
537
+ notification { ${Bu} }
538
538
  perspectiveId
539
539
  triggerMatch
540
- `,Yo=class{constructor(e,r=!0){Y.set(this,void 0),Un.set(this,void 0),qn.set(this,void 0),Vn.set(this,void 0),Bn.set(this,void 0),Nn(this,Y,e,"f"),Nn(this,Un,[],"f"),Nn(this,qn,[],"f"),Nn(this,Vn,[],"f"),Nn(this,Bn,[],"f"),r&&(this.subscribeMessageReceived(),this.subscribeExceptionOccurred(),this.subscribeNotificationTriggered(),this.subscribeNotificationRequested())}async info(){let{runtimeInfo:e}=T(await Q(this,Y,"f").query({query:_`query runtimeInfo {
540
+ `,Jo=class{constructor(e,r=!0){Z.set(this,void 0),$n.set(this,void 0),Un.set(this,void 0),qn.set(this,void 0),Vu.set(this,void 0),Ui(this,Z,e,"f"),Ui(this,$n,[],"f"),Ui(this,Un,[],"f"),Ui(this,qn,[],"f"),r&&(this.subscribeMessageReceived(),this.subscribeExceptionOccurred(),this.subscribeNotificationTriggered())}async info(){let{runtimeInfo:e}=T(await z(this,Z,"f").query({query:_`query runtimeInfo {
541
541
  runtimeInfo {
542
542
  ad4mExecutorVersion,
543
543
  isInitialized,
544
544
  isUnlocked
545
545
  }
546
- }`}));return e}async quit(){return T(await Q(this,Y,"f").mutate({mutation:_`mutation runtimeQuit { runtimeQuit }`})).runtimeQuit}async openLink(e){let{runtimeOpenLink:r}=T(await Q(this,Y,"f").mutate({mutation:_`mutation runtimeOpenLink($url: String!) {
546
+ }`}));return e}async quit(){return T(await z(this,Z,"f").mutate({mutation:_`mutation runtimeQuit { runtimeQuit }`})).runtimeQuit}async openLink(e){let{runtimeOpenLink:r}=T(await z(this,Z,"f").mutate({mutation:_`mutation runtimeOpenLink($url: String!) {
547
547
  runtimeOpenLink(url: $url)
548
- }`,variables:{url:e}}));return r}async addTrustedAgents(e){let{addTrustedAgents:r}=T(await Q(this,Y,"f").mutate({mutation:_`mutation addTrustedAgents($agents: [String!]!) {
548
+ }`,variables:{url:e}}));return r}async addTrustedAgents(e){let{addTrustedAgents:r}=T(await z(this,Z,"f").mutate({mutation:_`mutation addTrustedAgents($agents: [String!]!) {
549
549
  addTrustedAgents(agents: $agents)
550
- }`,variables:{agents:e}}));return r}async deleteTrustedAgents(e){let{deleteTrustedAgents:r}=T(await Q(this,Y,"f").mutate({mutation:_`mutation deleteTrustedAgents($agents: [String!]!) {
550
+ }`,variables:{agents:e}}));return r}async deleteTrustedAgents(e){let{deleteTrustedAgents:r}=T(await z(this,Z,"f").mutate({mutation:_`mutation deleteTrustedAgents($agents: [String!]!) {
551
551
  deleteTrustedAgents(agents: $agents)
552
- }`,variables:{agents:e}}));return r}async getTrustedAgents(){let{getTrustedAgents:e}=T(await Q(this,Y,"f").query({query:_`query getTrustedAgents {
552
+ }`,variables:{agents:e}}));return r}async getTrustedAgents(){let{getTrustedAgents:e}=T(await z(this,Z,"f").query({query:_`query getTrustedAgents {
553
553
  getTrustedAgents
554
- }`}));return e}async addKnownLinkLanguageTemplates(e){let{runtimeAddKnownLinkLanguageTemplates:r}=T(await Q(this,Y,"f").mutate({mutation:_`mutation runtimeAddKnownLinkLanguageTemplates($addresses: [String!]!) {
554
+ }`}));return e}async addKnownLinkLanguageTemplates(e){let{runtimeAddKnownLinkLanguageTemplates:r}=T(await z(this,Z,"f").mutate({mutation:_`mutation runtimeAddKnownLinkLanguageTemplates($addresses: [String!]!) {
555
555
  runtimeAddKnownLinkLanguageTemplates(addresses: $addresses)
556
- }`,variables:{addresses:e}}));return r}async removeKnownLinkLanguageTemplates(e){let{runtimeRemoveKnownLinkLanguageTemplates:r}=T(await Q(this,Y,"f").mutate({mutation:_`mutation runtimeRemoveKnownLinkLanguageTemplates($addresses: [String!]!) {
556
+ }`,variables:{addresses:e}}));return r}async removeKnownLinkLanguageTemplates(e){let{runtimeRemoveKnownLinkLanguageTemplates:r}=T(await z(this,Z,"f").mutate({mutation:_`mutation runtimeRemoveKnownLinkLanguageTemplates($addresses: [String!]!) {
557
557
  runtimeRemoveKnownLinkLanguageTemplates(addresses: $addresses)
558
- }`,variables:{addresses:e}}));return r}async knownLinkLanguageTemplates(){let{runtimeKnownLinkLanguageTemplates:e}=T(await Q(this,Y,"f").query({query:_`query runtimeKnownLinkLanguageTemplates {
558
+ }`,variables:{addresses:e}}));return r}async knownLinkLanguageTemplates(){let{runtimeKnownLinkLanguageTemplates:e}=T(await z(this,Z,"f").query({query:_`query runtimeKnownLinkLanguageTemplates {
559
559
  runtimeKnownLinkLanguageTemplates
560
- }`}));return e}async addFriends(e){let{runtimeAddFriends:r}=T(await Q(this,Y,"f").mutate({mutation:_`mutation runtimeAddFriends($dids: [String!]!) {
560
+ }`}));return e}async addFriends(e){let{runtimeAddFriends:r}=T(await z(this,Z,"f").mutate({mutation:_`mutation runtimeAddFriends($dids: [String!]!) {
561
561
  runtimeAddFriends(dids: $dids)
562
- }`,variables:{dids:e}}));return r}async removeFriends(e){let{runtimeRemoveFriends:r}=T(await Q(this,Y,"f").mutate({mutation:_`mutation runtimeRemoveFriends($dids: [String!]!) {
562
+ }`,variables:{dids:e}}));return r}async removeFriends(e){let{runtimeRemoveFriends:r}=T(await z(this,Z,"f").mutate({mutation:_`mutation runtimeRemoveFriends($dids: [String!]!) {
563
563
  runtimeRemoveFriends(dids: $dids)
564
- }`,variables:{dids:e}}));return r}async friends(){let{runtimeFriends:e}=T(await Q(this,Y,"f").query({query:_`query runtimeFriends {
564
+ }`,variables:{dids:e}}));return r}async friends(){let{runtimeFriends:e}=T(await z(this,Z,"f").query({query:_`query runtimeFriends {
565
565
  runtimeFriends
566
- }`}));return e}async hcAgentInfos(){let{runtimeHcAgentInfos:e}=T(await Q(this,Y,"f").query({query:_`query runtimeHcAgentInfos {
566
+ }`}));return e}async hcAgentInfos(){let{runtimeHcAgentInfos:e}=T(await z(this,Z,"f").query({query:_`query runtimeHcAgentInfos {
567
567
  runtimeHcAgentInfos
568
- }`}));return e}async hcAddAgentInfos(e){let{runtimeHcAddAgentInfos:r}=T(await Q(this,Y,"f").mutate({mutation:_`mutation runtimeHcAddAgentInfos($agentInfos: String!) {
568
+ }`}));return e}async hcAddAgentInfos(e){let{runtimeHcAddAgentInfos:r}=T(await z(this,Z,"f").mutate({mutation:_`mutation runtimeHcAddAgentInfos($agentInfos: String!) {
569
569
  runtimeHcAddAgentInfos(agentInfos: $agentInfos)
570
- }`,variables:{agentInfos:e}}));return r}async verifyStringSignedByDid(e,r,n,i){let{runtimeVerifyStringSignedByDid:a}=T(await Q(this,Y,"f").mutate({mutation:_`query runtimeVerifyStringSignedByDid($did: String!, $didSigningKeyId: String!, $data: String!, $signedData: String!) {
570
+ }`,variables:{agentInfos:e}}));return r}async verifyStringSignedByDid(e,r,n,i){let{runtimeVerifyStringSignedByDid:a}=T(await z(this,Z,"f").mutate({mutation:_`query runtimeVerifyStringSignedByDid($did: String!, $didSigningKeyId: String!, $data: String!, $signedData: String!) {
571
571
  runtimeVerifyStringSignedByDid(did: $did, didSigningKeyId: $didSigningKeyId, data: $data, signedData: $signedData)
572
- }`,variables:{did:e,didSigningKeyId:r,data:n,signedData:i}}));return a}async setStatus(e){let{runtimeSetStatus:r}=T(await Q(this,Y,"f").mutate({mutation:_`mutation runtimeSetStatus($status: PerspectiveInput!) {
572
+ }`,variables:{did:e,didSigningKeyId:r,data:n,signedData:i}}));return a}async setStatus(e){let{runtimeSetStatus:r}=T(await z(this,Z,"f").mutate({mutation:_`mutation runtimeSetStatus($status: PerspectiveInput!) {
573
573
  runtimeSetStatus(status: $status)
574
- }`,variables:{status:e}}));return r}async friendStatus(e){let{runtimeFriendStatus:r}=T(await Q(this,Y,"f").query({query:_`query runtimeFriendStatus($did: String!) {
575
- runtimeFriendStatus(did: $did) { ${Vi} }
576
- }`,variables:{did:e}}));return r}async friendSendMessage(e,r){let{runtimeFriendSendMessage:n}=T(await Q(this,Y,"f").mutate({mutation:_`mutation runtimeFriendSendMessage($did: String!, $message: PerspectiveInput!) {
574
+ }`,variables:{status:e}}));return r}async friendStatus(e){let{runtimeFriendStatus:r}=T(await z(this,Z,"f").query({query:_`query runtimeFriendStatus($did: String!) {
575
+ runtimeFriendStatus(did: $did) { ${qi} }
576
+ }`,variables:{did:e}}));return r}async friendSendMessage(e,r){let{runtimeFriendSendMessage:n}=T(await z(this,Z,"f").mutate({mutation:_`mutation runtimeFriendSendMessage($did: String!, $message: PerspectiveInput!) {
577
577
  runtimeFriendSendMessage(did: $did, message: $message)
578
- }`,variables:{did:e,message:r}}));return n}async messageInbox(e){let{runtimeMessageInbox:r}=T(await Q(this,Y,"f").query({query:_`query runtimeMessageInbox($filter: String) {
579
- runtimeMessageInbox(filter: $filter) { ${Vi} }
580
- }`,variables:{filter:e}}));return r}async messageOutbox(e){let{runtimeMessageOutbox:r}=T(await Q(this,Y,"f").query({query:_`query runtimeMessageOutbox($filter: String) {
578
+ }`,variables:{did:e,message:r}}));return n}async messageInbox(e){let{runtimeMessageInbox:r}=T(await z(this,Z,"f").query({query:_`query runtimeMessageInbox($filter: String) {
579
+ runtimeMessageInbox(filter: $filter) { ${qi} }
580
+ }`,variables:{filter:e}}));return r}async messageOutbox(e){let{runtimeMessageOutbox:r}=T(await z(this,Z,"f").query({query:_`query runtimeMessageOutbox($filter: String) {
581
581
  runtimeMessageOutbox(filter: $filter) {
582
582
  recipient,
583
583
  message {
584
- ${Vi}
584
+ ${qi}
585
585
  }
586
586
  }
587
- }`,variables:{filter:e}}));return r}async requestInstallNotification(e){let{runtimeRequestInstallNotification:r}=T(await Q(this,Y,"f").mutate({mutation:_`mutation runtimeRequestInstallNotification($notification: NotificationInput!) {
587
+ }`,variables:{filter:e}}));return r}async requestInstallNotification(e){let{runtimeRequestInstallNotification:r}=T(await z(this,Z,"f").mutate({mutation:_`mutation runtimeRequestInstallNotification($notification: NotificationInput!) {
588
588
  runtimeRequestInstallNotification(notification: $notification)
589
- }`,variables:{notification:e}}));return r}async grantNotification(e){let{runtimeGrantNotification:r}=T(await Q(this,Y,"f").mutate({mutation:_`mutation runtimeGrantNotification($id: String!) {
589
+ }`,variables:{notification:e}}));return r}async grantNotification(e){let{runtimeGrantNotification:r}=T(await z(this,Z,"f").mutate({mutation:_`mutation runtimeGrantNotification($id: String!) {
590
590
  runtimeGrantNotification(id: $id)
591
- }`,variables:{id:e}}));return r}async notifications(){let{runtimeNotifications:e}=T(await Q(this,Y,"f").query({query:_`query runtimeNotifications {
592
- runtimeNotifications { ${Ho} }
593
- }`}));return e}async updateNotification(e,r){let{runtimeUpdateNotification:n}=T(await Q(this,Y,"f").mutate({mutation:_`mutation runtimeUpdateNotification($id: String!, $notification: NotificationInput!) {
591
+ }`,variables:{id:e}}));return r}async notifications(){let{runtimeNotifications:e}=T(await z(this,Z,"f").query({query:_`query runtimeNotifications {
592
+ runtimeNotifications { ${Bu} }
593
+ }`}));return e}async updateNotification(e,r){let{runtimeUpdateNotification:n}=T(await z(this,Z,"f").mutate({mutation:_`mutation runtimeUpdateNotification($id: String!, $notification: NotificationInput!) {
594
594
  runtimeUpdateNotification(id: $id, notification: $notification)
595
- }`,variables:{id:e,notification:r}}));return n}async removeNotification(e){let{runtimeRemoveNotification:r}=T(await Q(this,Y,"f").mutate({mutation:_`mutation runtimeRemoveNotification($id: String!) {
595
+ }`,variables:{id:e,notification:r}}));return n}async removeNotification(e){let{runtimeRemoveNotification:r}=T(await z(this,Z,"f").mutate({mutation:_`mutation runtimeRemoveNotification($id: String!) {
596
596
  runtimeRemoveNotification(id: $id)
597
- }`,variables:{id:e}}));return r}addNotificationTriggeredCallback(e){Q(this,Vn,"f").push(e)}addNotificationRequestedCallback(e){Q(this,Bn,"f").push(e)}subscribeNotificationTriggered(){Q(this,Y,"f").subscribe({query:_` subscription {
597
+ }`,variables:{id:e}}));return r}addNotificationTriggeredCallback(e){z(this,qn,"f").push(e)}subscribeNotificationTriggered(){z(this,Z,"f").subscribe({query:_` subscription {
598
598
  runtimeNotificationTriggered { ${Kp} }
599
599
  }
600
- `}).subscribe({next:e=>{Q(this,Vn,"f").forEach(r=>{r(e.data.runtimeNotificationTriggered)})},error:e=>console.error(e)})}subscribeNotificationRequested(){Q(this,Y,"f").subscribe({query:_` subscription {
601
- runtimeNotificationRequested { ${Ho} }
600
+ `}).subscribe({next:e=>{z(this,qn,"f").forEach(r=>{r(e.data.runtimeNotificationTriggered)})},error:e=>console.error(e)})}addMessageCallback(e){z(this,$n,"f").push(e)}subscribeMessageReceived(){z(this,Z,"f").subscribe({query:_` subscription {
601
+ runtimeMessageReceived { ${qi} }
602
602
  }
603
- `}).subscribe({next:e=>{Q(this,Bn,"f").forEach(r=>{r(e.data.runtimeNotificationRequested)})},error:e=>console.error(e)})}addMessageCallback(e){Q(this,Un,"f").push(e)}subscribeMessageReceived(){Q(this,Y,"f").subscribe({query:_` subscription {
604
- runtimeMessageReceived { ${Vi} }
605
- }
606
- `}).subscribe({next:e=>{Q(this,Un,"f").forEach(r=>{r(e.data.runtimeMessageReceived)})},error:e=>console.error(e)})}addExceptionCallback(e){Q(this,qn,"f").push(e)}subscribeExceptionOccurred(){Q(this,Y,"f").subscribe({query:_` subscription {
603
+ `}).subscribe({next:e=>{z(this,$n,"f").forEach(r=>{r(e.data.runtimeMessageReceived)})},error:e=>console.error(e)})}addExceptionCallback(e){z(this,Un,"f").push(e)}subscribeExceptionOccurred(){z(this,Z,"f").subscribe({query:_` subscription {
607
604
  exceptionOccurred {
608
605
  title
609
606
  message
610
607
  type
611
608
  addon
612
609
  }
613
- }`}).subscribe({next:e=>{Q(this,qn,"f").forEach(r=>{r(e.data.exceptionOccurred)})},error:e=>console.error(e)})}};Y=new WeakMap,Un=new WeakMap,qn=new WeakMap,Vn=new WeakMap,Bn=new WeakMap;var zp=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},zr=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)},xt,Xo=class{constructor(e){xt.set(this,void 0),zp(this,xt,e,"f")}async get(e){let{expression:r}=T(await zr(this,xt,"f").query({query:_`query expression($url: String!) {
610
+ }`}).subscribe({next:e=>{z(this,Un,"f").forEach(r=>{r(e.data.exceptionOccurred)})},error:e=>console.error(e)})}};Z=new WeakMap,$n=new WeakMap,Un=new WeakMap,qn=new WeakMap,Vu=new WeakMap;var zp=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},zr=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)},xt,Ho=class{constructor(e){xt.set(this,void 0),zp(this,xt,e,"f")}async get(e){let{expression:r}=T(await zr(this,xt,"f").query({query:_`query expression($url: String!) {
614
611
  expression(url: $url) {
615
612
  author
616
613
  timestamp
@@ -648,14 +645,14 @@ triggerMatch
648
645
  }
649
646
  }`,variables:{url:e}}));return r}async interact(e,r){let{expressionInteract:n}=T(await zr(this,xt,"f").mutate({mutation:_`mutation expressionInteract($url: String!, $interactionCall: InteractionCall!){
650
647
  expressionInteract(url: $url, interactionCall: $interactionCall)
651
- }`,variables:{url:e,interactionCall:r}}));return n}};xt=new WeakMap;var ur=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},Ne=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)},It,Xi,Qn,Zi,Gn,Hr,ea,da=class{constructor(e,r=!0){It.set(this,void 0),Xi.set(this,void 0),Qn.set(this,void 0),Zi.set(this,void 0),Gn.set(this,void 0),Hr.set(this,void 0),ea.set(this,void 0),ur(this,It,e,"f"),ur(this,Xi,new Hn(Ne(this,It,"f"),r),"f"),ur(this,Qn,new Xo(Ne(this,It,"f")),"f"),ur(this,Zi,new zo(Ne(this,It,"f")),"f"),ur(this,Gn,new Jo(Ne(this,It,"f")),"f"),ur(this,Hr,new pa(Ne(this,It,"f"),r),"f"),Ne(this,Hr,"f").setExpressionClient(Ne(this,Qn,"f")),Ne(this,Hr,"f").setNeighbourhoodClient(Ne(this,Gn,"f")),ur(this,ea,new Yo(Ne(this,It,"f"),r),"f")}get agent(){return Ne(this,Xi,"f")}get expression(){return Ne(this,Qn,"f")}get languages(){return Ne(this,Zi,"f")}get neighbourhood(){return Ne(this,Gn,"f")}get perspective(){return Ne(this,Hr,"f")}get runtime(){return Ne(this,ea,"f")}};It=new WeakMap,Xi=new WeakMap,Qn=new WeakMap,Zi=new WeakMap,Gn=new WeakMap,Hr=new WeakMap,ea=new WeakMap;var Su;(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"})(Su||(Su={}));var as=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},os=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},gr=class{constructor(e,r){this.language=e,this.expression=r}};as([g(),os("design:type",gt)],gr.prototype,"language",void 0);as([g(),os("design:type",String)],gr.prototype,"expression",void 0);gr=as([J(),os("design:paramtypes",[gt,String])],gr);function sw(t){return t.language.address==="did"?t.expression.toString():`${t.language.address}://${t.expression}`}function cw(t){if(t.startsWith("literal://")){let a=new gt;a.address="literal",a.name="literal";let o=t.substring(10);return new gr(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 gr(s,o)}let i=/^did:([^\s]+)$/.exec(t);if(i&&i.length==2){let a=new gt;return a.address="did",new gr(a,t)}throw new Error("Couldn't parse string as expression URL or DID: "+t)}var He=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},bt=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},ha=class{};He([g(),bt("design:type",String)],ha.prototype,"name",void 0);He([g(),bt("design:type",String)],ha.prototype,"type",void 0);ha=He([J()],ha);var Yn=class{};He([g(),bt("design:type",String)],Yn.prototype,"label",void 0);He([g(),bt("design:type",String)],Yn.prototype,"name",void 0);He([g(),bt("design:type",Array)],Yn.prototype,"parameters",void 0);Yn=He([J()],Yn);var ma=class{get parameters(){return JSON.parse(this.parametersStringified)}constructor(e,r){this.name=e,this.parametersStringified=JSON.stringify(r)}};He([g(),bt("design:type",String)],ma.prototype,"name",void 0);He([g(),bt("design:type",String)],ma.prototype,"parametersStringified",void 0);ma=He([Fe(),bt("design:paramtypes",[String,Object])],ma);var ya=class{};He([g(),bt("design:type",String)],ya.prototype,"did",void 0);He([g(),bt("design:type",Wo)],ya.prototype,"status",void 0);ya=He([J()],ya);var wu=class{},Ir=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)},Jt=class{};Ir([g(),an("design:type",String)],Jt.prototype,"name",void 0);Ir([g(),an("design:type",String)],Jt.prototype,"address",void 0);Ir([g(),an("design:type",String)],Jt.prototype,"settings",void 0);Ir([g(),an("design:type",br)],Jt.prototype,"icon",void 0);Ir([g(),an("design:type",br)],Jt.prototype,"constructorIcon",void 0);Ir([g(),an("design:type",br)],Jt.prototype,"settingsIcon",void 0);Jt=Ir([J()],Jt);var Me=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},Qe=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},ut=class{};Me([g(),Qe("design:type",String)],ut.prototype,"name",void 0);Me([g(),Qe("design:type",String)],ut.prototype,"address",void 0);Me([g(),Qe("design:type",String)],ut.prototype,"description",void 0);Me([g(),Qe("design:type",String)],ut.prototype,"author",void 0);Me([g(),Qe("design:type",Boolean)],ut.prototype,"templated",void 0);Me([g(),Qe("design:type",String)],ut.prototype,"templateSourceLanguageAddress",void 0);Me([g(),Qe("design:type",String)],ut.prototype,"templateAppliedParams",void 0);Me([g(),Qe("design:type",Array)],ut.prototype,"possibleTemplateParams",void 0);Me([g(),Qe("design:type",String)],ut.prototype,"sourceCodeLink",void 0);ut=Me([J()],ut);var tn=class{constructor(e,r){this.name=e,this.description=r,this.description||(this.description="")}};Me([g(),Qe("design:type",String)],tn.prototype,"name",void 0);Me([g(),Qe("design:type",String)],tn.prototype,"description",void 0);Me([g(),Qe("design:type",Array)],tn.prototype,"possibleTemplateParams",void 0);Me([g(),Qe("design:type",String)],tn.prototype,"sourceCodeLink",void 0);tn=Me([Fe(),Qe("design:paramtypes",[String,String])],tn);var _u=class{},Eu=class extends Ht(){},Ou=class{},Sa=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)},ga=class{constructor(e,r){this.linkLanguage=e,this.meta=r}};Sa([g(),ss("design:type",String)],ga.prototype,"linkLanguage",void 0);Sa([g(),ss("design:type",Gt)],ga.prototype,"meta",void 0);ga=Sa([J(),ss("design:paramtypes",[String,Gt])],ga);var Zo=class extends Ht(){};Zo=Sa([J()],Zo);var on=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},sn=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},es;(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"})(es||(es={}));var Er=class{constructor(e,r,n){this.uuid=e,this.name=r,n?this.state=n:this.state=es.Private}};on([g(),sn("design:type",String)],Er.prototype,"uuid",void 0);on([g(),sn("design:type",String)],Er.prototype,"name",void 0);on([g(),sn("design:type",String)],Er.prototype,"state",void 0);on([g(),sn("design:type",String)],Er.prototype,"sharedUrl",void 0);on([g(),sn("design:type",Zo)],Er.prototype,"neighbourhood",void 0);Er=on([J(),sn("design:paramtypes",[String,String,String])],Er);var 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},Qu=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},va=class{};wa([g(),Qu("design:type",Array)],va.prototype,"additions",void 0);wa([g(),Qu("design:type",Array)],va.prototype,"removals",void 0);va=wa([J()],va);var Tu=class extends Ht(){};Tu=wa([J()],Tu);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},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)},Wn,yr,Bi="smart_literal://content";function Jp(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 Xn=class{constructor(e,r){Wn.set(this,void 0),yr.set(this,void 0),xu(this,Wn,e,"f"),xu(this,yr,r,"f")}get base(){return Jr(this,yr,"f")}static async create(e,r){let n=vt.from(Jp(10)).toUrl(),i=new Xn(e,n);return await i.set(r),i}static async isSmartLiteralBase(e,r){return(await e.get(new Je({source:r,predicate:Bi}))).length>0}static async getAllSmartLiterals(e){return(await e.get(new Je({predicate:Bi}))).map(n=>new Xn(e,n.data.source))}async get(){let e=await Jr(this,Wn,"f").getSingleTarget(new Je({source:Jr(this,yr,"f"),predicate:Bi}));if(!e)throw`No content for smart literal ${Jr(this,yr,"f")}`;return vt.fromUrl(e).get()}async set(e){let r=vt.from(e);await Jr(this,Wn,"f").setSingleTarget(new wr({source:Jr(this,yr,"f"),predicate:Bi,target:r.toUrl()}))}};Wn=new WeakMap,yr=new WeakMap;var Iu=class{};function ww(t,e,r){return{action:"addLink",source:t,predicate:e,target:r}}function _w(t){return`triple(this, "${t}", _)`}function Ew(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,c=`subject_class("${s}", C), instance(C, Instance)`;if(t&&t.where)for(let l in t.where){let p=t.where[l];c+=`, property_getter(C, Instance, "${l}", "${p}")`}t&&t.condition&&(c+=", "+t.condition);let u=await a.infer(c);if(u==!1)return o;if(typeof u=="string")throw u;for(let l of u){let p=l.Instance,d=new fa(a,p,s);await d.init(),o.push(d)}return o}}}function Ow(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${Bt(n)}`]=()=>{}}Object.defineProperty(e,r,{configurable:!0,writable:!0})}}function Tw(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 xw(t){return function(e,r){e.__collections=e.__collections||{},e.__collections[r]=t;let n=r;e[`add${Bt(n)}`]=()=>{},e[`remove${Bt(n)}`]=()=>{},e[`setCollection${Bt(n)}`]=()=>{},Object.defineProperty(e,r,{configurable:!0,writable:!0})}}function Gu(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 Iw(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=Gu(8);r+=`subject_class("${n}", ${a}).
648
+ }`,variables:{url:e,interactionCall:r}}));return n}};xt=new WeakMap;var ur=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},Ne=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)},It,Yi,Vn,Xi,Bn,Hr,Zi,pa=class{constructor(e,r=!0){It.set(this,void 0),Yi.set(this,void 0),Vn.set(this,void 0),Xi.set(this,void 0),Bn.set(this,void 0),Hr.set(this,void 0),Zi.set(this,void 0),ur(this,It,e,"f"),ur(this,Yi,new zn(Ne(this,It,"f"),r),"f"),ur(this,Vn,new Ho(Ne(this,It,"f")),"f"),ur(this,Xi,new Ko(Ne(this,It,"f")),"f"),ur(this,Bn,new zo(Ne(this,It,"f")),"f"),ur(this,Hr,new fa(Ne(this,It,"f"),r),"f"),Ne(this,Hr,"f").setExpressionClient(Ne(this,Vn,"f")),Ne(this,Hr,"f").setNeighbourhoodClient(Ne(this,Bn,"f")),ur(this,Zi,new Jo(Ne(this,It,"f"),r),"f")}get agent(){return Ne(this,Yi,"f")}get expression(){return Ne(this,Vn,"f")}get languages(){return Ne(this,Xi,"f")}get neighbourhood(){return Ne(this,Bn,"f")}get perspective(){return Ne(this,Hr,"f")}get runtime(){return Ne(this,Zi,"f")}};It=new WeakMap,Yi=new WeakMap,Vn=new WeakMap,Xi=new WeakMap,Bn=new WeakMap,Hr=new WeakMap,Zi=new WeakMap;var vu;(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"})(vu||(vu={}));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)},gr=class{constructor(e,r){this.language=e,this.expression=r}};ns([g(),is("design:type",gt)],gr.prototype,"language",void 0);ns([g(),is("design:type",String)],gr.prototype,"expression",void 0);gr=ns([J(),is("design:paramtypes",[gt,String])],gr);function sw(t){return t.language.address==="did"?t.expression.toString():`${t.language.address}://${t.expression}`}function cw(t){if(t.startsWith("literal://")){let a=new gt;a.address="literal",a.name="literal";let o=t.substring(10);return new gr(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 gr(s,o)}let i=/^did:([^\s]+)$/.exec(t);if(i&&i.length==2){let a=new gt;return a.address="did",new gr(a,t)}throw new Error("Couldn't parse string as expression URL or DID: "+t)}var He=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},bt=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},da=class{};He([g(),bt("design:type",String)],da.prototype,"name",void 0);He([g(),bt("design:type",String)],da.prototype,"type",void 0);da=He([J()],da);var Jn=class{};He([g(),bt("design:type",String)],Jn.prototype,"label",void 0);He([g(),bt("design:type",String)],Jn.prototype,"name",void 0);He([g(),bt("design:type",Array)],Jn.prototype,"parameters",void 0);Jn=He([J()],Jn);var ha=class{get parameters(){return JSON.parse(this.parametersStringified)}constructor(e,r){this.name=e,this.parametersStringified=JSON.stringify(r)}};He([g(),bt("design:type",String)],ha.prototype,"name",void 0);He([g(),bt("design:type",String)],ha.prototype,"parametersStringified",void 0);ha=He([Me(),bt("design:paramtypes",[String,Object])],ha);var ma=class{};He([g(),bt("design:type",String)],ma.prototype,"did",void 0);He([g(),bt("design:type",Go)],ma.prototype,"status",void 0);ma=He([J()],ma);var bu=class{},Ir=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)},Jt=class{};Ir([g(),an("design:type",String)],Jt.prototype,"name",void 0);Ir([g(),an("design:type",String)],Jt.prototype,"address",void 0);Ir([g(),an("design:type",String)],Jt.prototype,"settings",void 0);Ir([g(),an("design:type",br)],Jt.prototype,"icon",void 0);Ir([g(),an("design:type",br)],Jt.prototype,"constructorIcon",void 0);Ir([g(),an("design:type",br)],Jt.prototype,"settingsIcon",void 0);Jt=Ir([J()],Jt);var je=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},Qe=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},ut=class{};je([g(),Qe("design:type",String)],ut.prototype,"name",void 0);je([g(),Qe("design:type",String)],ut.prototype,"address",void 0);je([g(),Qe("design:type",String)],ut.prototype,"description",void 0);je([g(),Qe("design:type",String)],ut.prototype,"author",void 0);je([g(),Qe("design:type",Boolean)],ut.prototype,"templated",void 0);je([g(),Qe("design:type",String)],ut.prototype,"templateSourceLanguageAddress",void 0);je([g(),Qe("design:type",String)],ut.prototype,"templateAppliedParams",void 0);je([g(),Qe("design:type",Array)],ut.prototype,"possibleTemplateParams",void 0);je([g(),Qe("design:type",String)],ut.prototype,"sourceCodeLink",void 0);ut=je([J()],ut);var tn=class{constructor(e,r){this.name=e,this.description=r,this.description||(this.description="")}};je([g(),Qe("design:type",String)],tn.prototype,"name",void 0);je([g(),Qe("design:type",String)],tn.prototype,"description",void 0);je([g(),Qe("design:type",Array)],tn.prototype,"possibleTemplateParams",void 0);je([g(),Qe("design:type",String)],tn.prototype,"sourceCodeLink",void 0);tn=je([Me(),Qe("design:paramtypes",[String,String])],tn);var Su=class{},wu=class extends Ht(){},_u=class{},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},as=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},ya=class{constructor(e,r){this.linkLanguage=e,this.meta=r}};ba([g(),as("design:type",String)],ya.prototype,"linkLanguage",void 0);ba([g(),as("design:type",Gt)],ya.prototype,"meta",void 0);ya=ba([J(),as("design:paramtypes",[String,Gt])],ya);var Yo=class extends Ht(){};Yo=ba([J()],Yo);var on=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},sn=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 Er=class{constructor(e,r,n){this.uuid=e,this.name=r,n?this.state=n:this.state=Xo.Private}};on([g(),sn("design:type",String)],Er.prototype,"uuid",void 0);on([g(),sn("design:type",String)],Er.prototype,"name",void 0);on([g(),sn("design:type",String)],Er.prototype,"state",void 0);on([g(),sn("design:type",String)],Er.prototype,"sharedUrl",void 0);on([g(),sn("design:type",Yo)],Er.prototype,"neighbourhood",void 0);Er=on([J(),sn("design:paramtypes",[String,String,String])],Er);var Sa=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},Qu=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},ga=class{};Sa([g(),Qu("design:type",Array)],ga.prototype,"additions",void 0);Sa([g(),Qu("design:type",Array)],ga.prototype,"removals",void 0);ga=Sa([J()],ga);var Eu=class extends Ht(){};Eu=Sa([J()],Eu);var Ou=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)},Qn,yr,Vi="smart_literal://content";function Jp(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),yr.set(this,void 0),Ou(this,Qn,e,"f"),Ou(this,yr,r,"f")}get base(){return Jr(this,yr,"f")}static async create(e,r){let n=vt.from(Jp(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:Vi}))).length>0}static async getAllSmartLiterals(e){return(await e.get(new Je({predicate:Vi}))).map(n=>new Hn(e,n.data.source))}async get(){let e=await Jr(this,Qn,"f").getSingleTarget(new Je({source:Jr(this,yr,"f"),predicate:Vi}));if(!e)throw`No content for smart literal ${Jr(this,yr,"f")}`;return vt.fromUrl(e).get()}async set(e){let r=vt.from(e);await Jr(this,Qn,"f").setSingleTarget(new wr({source:Jr(this,yr,"f"),predicate:Vi,target:r.toUrl()}))}};Qn=new WeakMap,yr=new WeakMap;var Tu=class{};function ww(t,e,r){return{action:"addLink",source:t,predicate:e,target:r}}function _w(t){return`triple(this, "${t}", _)`}function Ew(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,c=`subject_class("${s}", C), instance(C, Instance)`;if(t&&t.where)for(let l in t.where){let p=t.where[l];c+=`, property_getter(C, Instance, "${l}", "${p}")`}t&&t.condition&&(c+=", "+t.condition);let u=await a.infer(c);if(u==!1)return o;if(typeof u=="string")throw u;for(let l of u){let p=l.Instance,d=new la(a,p,s);await d.init(),o.push(d)}return o}}}function Ow(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${Bt(n)}`]=()=>{}}Object.defineProperty(e,r,{configurable:!0,writable:!0})}}function Tw(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 xw(t){return function(e,r){e.__collections=e.__collections||{},e.__collections[r]=t;let n=r;e[`add${Bt(n)}`]=()=>{},e[`remove${Bt(n)}`]=()=>{},e[`setCollection${Bt(n)}`]=()=>{},Object.defineProperty(e,r,{configurable:!0,writable:!0})}}function Gu(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 Iw(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=Gu(8);r+=`subject_class("${n}", ${a}).
652
649
  `;let o=[],s=[];i.subjectConstructor&&i.subjectConstructor.length&&(s=s.concat(i.subjectConstructor));let c=[];i.isSubjectInstance&&i.isSubjectInstance.length&&(c=c.concat(i.isSubjectInstance));let u=[],l=i.__properties||{};for(let m in l){let y=`property(${a}, "${m}").
653
650
  `,{through:b,initial:E,required:v,resolveLanguage:S,writable:O,flag:k,getter:N,setter:D,local:C}=l[m];if(S&&(y+=`property_resolve(${a}, "${m}").
654
651
  `,y+=`property_resolve_language(${a}, "${m}", "${S}").
655
652
  `),N?y+=`property_getter(${a}, Base, "${m}", Value) :- ${N}.
656
653
  `:b&&(y+=`property_getter(${a}, Base, "${m}", Value) :- triple(Base, "${b}", Value).
657
654
  `,v&&(k?c.push(`triple(Base, "${b}", "${E}")`):c.push(`triple(Base, "${b}", _)`))),D)y+=`property_setter(${a}, "${m}", Actions) :- ${D}.
658
- `;else if(O&&typeof i[Bu(m)]=="function"){let X=[{action:"setSingleTarget",source:"this",predicate:b,target:"value",...C&&{local:!0}}];y+=`property_setter(${a}, "${m}", '${fr(X)}').
655
+ `;else if(O&&typeof i[qu(m)]=="function"){let Y=[{action:"setSingleTarget",source:"this",predicate:b,target:"value",...C&&{local:!0}}];y+=`property_setter(${a}, "${m}", '${fr(Y)}').
659
656
  `}u.push(y),E&&(s.push({action:"addLink",source:"this",predicate:b,target:E}),o.push({action:"removeLink",source:"this",predicate:b,target:E}))}let p=[],d=i.__collections||{};for(let m in d){let y=`collection(${a}, "${m}").
660
657
  `,{through:b,where:E,local:v}=d[m];if(b){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 D=N.join(", ");y+=`collection_getter(${a}, Base, "${m}", List) :- setof(Target, (triple(Base, "${b}", Target), ${D}), List).
661
658
  `}else y+=`collection_getter(${a}, Base, "${m}", List) :- findall(C, triple(Base, "${b}", C), List).
@@ -1079,7 +1076,6 @@ type Subscription {
1079
1076
  perspectiveSyncStateChange(uuid: String!): String!
1080
1077
  perspectiveUpdated: PerspectiveHandle
1081
1078
  runtimeMessageReceived: PerspectiveExpression
1082
- runtimeNotificationRequested: Notification
1083
1079
  runtimeNotificationTriggered: TriggeredNotification
1084
1080
  }
1085
1081
 
@@ -1088,5 +1084,5 @@ type TriggeredNotification {
1088
1084
  perspectiveId: String!
1089
1085
  triggerMatch: String!
1090
1086
  }
1091
- `;function Du(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 kw(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`${Du(e)} your ${r} actions, with access to ${Du(n)}`}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},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,ct,ta,fe,ku=class{constructor(t,e,r){Le.set(this,void 0),ct.set(this,void 0),ta.set(this,void 0),fe.set(this,void 0),lr(this,Le,e||vt.from(Gu(24)).toUrl(),"f"),lr(this,fe,t,"f"),lr(this,ta,r||"ad4m://self","f")}get baseExpression(){return U(this,Le,"f")}async getData(t){let e=t??U(this,Le,"f");console.log("SubjectEntity: getData");let r=await U(this,fe,"f").getSubjectData(U(this,ct,"f"),e);return console.log("SubjectEntity got data:",r),Object.assign(this,r),lr(this,Le,e,"f"),this}async setProperty(key,value){let setters=await U(this,fe,"f").infer(`subject_class("${U(this,ct,"f")}", C), property_setter(C, "${key}", Setter)`);if(setters&&setters.length>0){let actions=eval(setters[0].Setter),resolveLanguageResults=await U(this,fe,"f").infer(`subject_class("${U(this,ct,"f")}", C), property_resolve_language(C, "${key}", Language)`),resolveLanguage;resolveLanguageResults&&resolveLanguageResults.length>0&&(resolveLanguage=resolveLanguageResults[0].Language),resolveLanguage&&(value=await U(this,fe,"f").createExpression(value,resolveLanguage)),await U(this,fe,"f").executeAction(actions,U(this,Le,"f"),[{name:"value",value}])}}async setCollectionSetter(key,value){let collectionSetters=await U(this,fe,"f").infer(`subject_class("${U(this,ct,"f")}", C), collection_setter(C, "${Dt(key)}", Setter)`);if(collectionSetters||(collectionSetters=[]),collectionSetters.length>0){let actions=eval(collectionSetters[0].Setter);value&&(Array.isArray(value)?await U(this,fe,"f").executeAction(actions,U(this,Le,"f"),value.map(t=>({name:"value",value:t}))):await U(this,fe,"f").executeAction(actions,U(this,Le,"f"),[{name:"value",value}]))}}async setCollectionAdder(key,value){let adders=await U(this,fe,"f").infer(`subject_class("${U(this,ct,"f")}", C), collection_adder(C, "${Dt(key)}", Adder)`);if(adders||(adders=[]),adders.length>0){let actions=eval(adders[0].Adder);value&&(Array.isArray(value)?await Promise.all(value.map(t=>U(this,fe,"f").executeAction(actions,U(this,Le,"f"),[{name:"value",value:t}]))):await U(this,fe,"f").executeAction(actions,U(this,Le,"f"),[{name:"value",value}]))}}async setCollectionRemover(key,value){let removers=await U(this,fe,"f").infer(`subject_class("${U(this,ct,"f")}", C), collection_remover(C, "${Dt(key)}", Remover)`);if(removers||(removers=[]),removers.length>0){let actions=eval(removers[0].Remover);value&&(Array.isArray(value)?await Promise.all(value.map(t=>U(this,fe,"f").executeAction(actions,U(this,Le,"f"),[{name:"value",value:t}]))):await U(this,fe,"f").executeAction(actions,U(this,Le,"f"),[{name:"value",value}]))}}async save(){lr(this,ct,await U(this,fe,"f").stringOrTemplateObjectToSubjectClass(this),"f"),await U(this,fe,"f").createSubject(this,U(this,Le,"f")),await U(this,fe,"f").add(new wr({source:U(this,ta,"f"),predicate:"ad4m://has_child",target:this.baseExpression})),await this.update()}async update(){lr(this,ct,await U(this,fe,"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 lr(this,ct,await U(this,fe,"f").stringOrTemplateObjectToSubjectClass(this),"f"),await this.getData()}async delete(){await U(this,fe,"f").removeSubject(this,U(this,Le,"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(c=>({Base:c[1],Timestamp:c[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())):[]}};Le=new WeakMap,ct=new WeakMap,ta=new WeakMap,fe=new WeakMap;function Hp(){let t=new AbortController;return setTimeout(()=>t.abort(),20),t}function cs(t,e=1e4){return je(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 us(t){return je(this,null,function*(){try{let e=yield fetch(`http://localhost:${t}/graphql/`,{signal:Hp().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 Yp=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 ls(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 Yp(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 fs=class{constructor({appName:e,appDesc:r,appIconPath:n,appUrl:i,appDomain:a,capabilities:o,port:s,token:c,url:u}){this.activeSocket=null;this.requestedRestart=!1;this.authState="unauthenticated";this.connectionState="not_connected";this.port=12e3;this.capabilities=[];this.listeners={authstatechange:[],configstatechange:[],connectionstatechange:[]};ls(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=u||`ws://localhost:${this.port}/graphql`,this.token=c||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 je(this,null,function*(){try{if(e){yield cs(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 je(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 je(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 je(this,null,function*(){try{if(e){let r=yield us(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 je(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 cs(this.url,1e4),this.buildClient()}catch(i){return this.connectToPort()}})}findPort(){return je(this,null,function*(){let e=[...Array(10).keys()].map((i,a)=>us(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=ou({url:this.url,connectionParams:()=>je(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 Ao({link:new su(this.wsClient),cache:new Pi({resultCaching:!1,addTypename:!1}),defaultOptions:{watchQuery:{fetchPolicy:"no-cache"},query:{fetchPolicy:"no-cache"},mutate:{fetchPolicy:"no-cache"}}}),this.ad4mClient=new da(this.apolloClient),this.ad4mClient}checkAuth(){return je(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 je(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 je(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{fs as default};
1087
+ `;function xu(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 kw(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`${xu(e)} your ${r} actions, with access to ${xu(n)}`}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},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)},Fe,ct,ea,fe,Iu=class{constructor(t,e,r){Fe.set(this,void 0),ct.set(this,void 0),ea.set(this,void 0),fe.set(this,void 0),lr(this,Fe,e||vt.from(Gu(24)).toUrl(),"f"),lr(this,fe,t,"f"),lr(this,ea,r||"ad4m://self","f")}get baseExpression(){return U(this,Fe,"f")}async getData(t){let e=t??U(this,Fe,"f"),r=await U(this,fe,"f").getSubjectData(U(this,ct,"f"),e);return Object.assign(this,r),lr(this,Fe,e,"f"),this}async setProperty(key,value){let setters=await U(this,fe,"f").infer(`subject_class("${U(this,ct,"f")}", C), property_setter(C, "${key}", Setter)`);if(setters&&setters.length>0){let actions=eval(setters[0].Setter),resolveLanguageResults=await U(this,fe,"f").infer(`subject_class("${U(this,ct,"f")}", C), property_resolve_language(C, "${key}", Language)`),resolveLanguage;resolveLanguageResults&&resolveLanguageResults.length>0&&(resolveLanguage=resolveLanguageResults[0].Language),resolveLanguage&&(value=await U(this,fe,"f").createExpression(value,resolveLanguage)),await U(this,fe,"f").executeAction(actions,U(this,Fe,"f"),[{name:"value",value}])}}async setCollectionSetter(key,value){let collectionSetters=await U(this,fe,"f").infer(`subject_class("${U(this,ct,"f")}", C), collection_setter(C, "${Dt(key)}", Setter)`);if(collectionSetters||(collectionSetters=[]),collectionSetters.length>0){let actions=eval(collectionSetters[0].Setter);value&&(Array.isArray(value)?await U(this,fe,"f").executeAction(actions,U(this,Fe,"f"),value.map(t=>({name:"value",value:t}))):await U(this,fe,"f").executeAction(actions,U(this,Fe,"f"),[{name:"value",value}]))}}async setCollectionAdder(key,value){let adders=await U(this,fe,"f").infer(`subject_class("${U(this,ct,"f")}", C), collection_adder(C, "${Dt(key)}", Adder)`);if(adders||(adders=[]),adders.length>0){let actions=eval(adders[0].Adder);value&&(Array.isArray(value)?await Promise.all(value.map(t=>U(this,fe,"f").executeAction(actions,U(this,Fe,"f"),[{name:"value",value:t}]))):await U(this,fe,"f").executeAction(actions,U(this,Fe,"f"),[{name:"value",value}]))}}async setCollectionRemover(key,value){let removers=await U(this,fe,"f").infer(`subject_class("${U(this,ct,"f")}", C), collection_remover(C, "${Dt(key)}", Remover)`);if(removers||(removers=[]),removers.length>0){let actions=eval(removers[0].Remover);value&&(Array.isArray(value)?await Promise.all(value.map(t=>U(this,fe,"f").executeAction(actions,U(this,Fe,"f"),[{name:"value",value:t}]))):await U(this,fe,"f").executeAction(actions,U(this,Fe,"f"),[{name:"value",value}]))}}async save(){lr(this,ct,await U(this,fe,"f").stringOrTemplateObjectToSubjectClass(this),"f"),await U(this,fe,"f").createSubject(this,U(this,Fe,"f")),await U(this,fe,"f").add(new wr({source:U(this,ea,"f"),predicate:"ad4m://has_child",target:this.baseExpression})),await this.update()}async update(){lr(this,ct,await U(this,fe,"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 lr(this,ct,await U(this,fe,"f").stringOrTemplateObjectToSubjectClass(this),"f"),await this.getData()}async delete(){await U(this,fe,"f").removeSubject(this,U(this,Fe,"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(c=>({Base:c[1],Timestamp:c[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())):[]}};Fe=new WeakMap,ct=new WeakMap,ea=new WeakMap,fe=new WeakMap;function Hp(){let t=new AbortController;return setTimeout(()=>t.abort(),20),t}function os(t,e=1e4){return Ae(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 Ae(this,null,function*(){try{let e=yield fetch(`http://localhost:${t}/graphql/`,{signal:Hp().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 Yp=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 Yp(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:c,url:u}){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=u||`ws://localhost:${this.port}/graphql`,this.token=c||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 Ae(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 Ae(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 Ae(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 Ae(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 Ae(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 Ae(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:()=>Ae(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(()=>Ae(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 No({link:new au(this.wsClient),cache:new Ni({resultCaching:!1,addTypename:!1}),defaultOptions:{watchQuery:{fetchPolicy:"no-cache"},query:{fetchPolicy:"no-cache"},mutate:{fetchPolicy:"no-cache"}}}),this.ad4mClient=new pa(this.apolloClient),this.ad4mClient}checkAuth(){return Ae(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 Ae(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 Ae(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};
1092
1088
  //! @fayeed - make it support node.js