@coasys/ad4m-connect 0.10.1-dev-1 → 0.10.1-multi-user-1

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 Xe=(t,e,r)=>new Promise((n,i)=>{var a=u=>{try{s(r.next(u))}catch(c){i(c)}},o=u=>{try{s(r.throw(u))}catch(c){i(c)}},s=u=>u.done?n(u.value):Promise.resolve(u.value).then(a,o);s((r=r.apply(t,e)).next())});var Rs=function(t,e){return Rs=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])},Rs(t,e)};function xe(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Rs(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var w=function(){return w=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},w.apply(this,arguments)};function Bt(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 Pt(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{c(n.next(l))}catch(d){o(d)}}function u(l){try{c(n.throw(l))}catch(d){o(d)}}function c(l){l.done?a(l.value):i(l.value).then(s,u)}c((n=n.apply(t,e||[])).next())})}function Ct(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(c){return function(l){return u([c,l])}}function u(c){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(r=0)),r;)try{if(n=1,i&&(a=c[0]&2?i.return:c[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,c[1])).done)return a;switch(i=0,a&&(c=[c[0]&2,a.value]),c[0]){case 0:case 1:a=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,i=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!a||c[1]>a[0]&&c[1]<a[3])){r.label=c[1];break}if(c[0]===6&&r.label<a[1]){r.label=a[1],a=c;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(c);break}a[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(l){c=[6,l],i=0}finally{n=a=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function gr(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 Ls="Invariant Violation",rl=Object.setPrototypeOf,vh=rl===void 0?function(t,e){return t.__proto__=e,t}:rl,V=function(t){xe(e,t);function e(r){r===void 0&&(r=Ls);var n=t.call(this,typeof r=="number"?Ls+": "+r+" (see https://github.com/apollographql/invariant-packages)":r)||this;return n.framesToPop=1,n.name=Ls,vh(n,e.prototype),n}return e}(Error);function N(t,e){if(!t)throw new V(e)}var Ba=["debug","log","warn","error","silent"],Fs=Ba.indexOf("log");function qa(t){return function(){if(Ba.indexOf(t)>=Fs){var e=console[t]||console.log;return e.apply(console,arguments)}}}(function(t){t.debug=qa("debug"),t.log=qa("log"),t.warn=qa("warn"),t.error=qa("error")})(N||(N={}));function nl(t){var e=Ba[Fs];return Fs=Math.max(0,Ba.indexOf(t)),e}function je(t){try{return t()}catch{}}var Va=je(function(){return globalThis})||je(function(){return window})||je(function(){return self})||je(function(){return global})||je(function(){return je.constructor("return this")()});var il="__",al=[il,il].join("DEV");function bh(){try{return Boolean(__DEV__)}catch{return Object.defineProperty(Va,al,{value:je(function(){return"production"})!=="production",enumerable:!1,configurable:!0,writable:!0}),Va[al]}}var Wr=bh();function vr(t){try{return t()}catch{}}var $s=vr(function(){return globalThis})||vr(function(){return window})||vr(function(){return self})||vr(function(){return global})||vr(function(){return vr.constructor("return this")()}),Ms=!1;function _h(){$s&&!vr(function(){return"production"})&&!vr(function(){return process})&&(Object.defineProperty($s,"process",{value:{env:{NODE_ENV:"production"}},configurable:!0,enumerable:!1,writable:!0}),Ms=!0)}_h();function js(){Ms&&(delete $s.process,Ms=!1)}var Q_=typeof Symbol=="function"&&Symbol.iterator!=null?Symbol.iterator:"@@iterator",z_=typeof Symbol=="function"&&Symbol.asyncIterator!=null?Symbol.asyncIterator:"@@asyncIterator",ol=typeof Symbol=="function"&&Symbol.toStringTag!=null?Symbol.toStringTag:"@@toStringTag";var Ae=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 Us(t,e){var r=Boolean(t);if(!r)throw new Error(e??"Unexpected invariant triggered.")}var wh=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):void 0,Ii=wh;function Qa(t){var e=t.prototype.toJSON;typeof e=="function"||Us(0),t.prototype.inspect=e,Ii&&(t.prototype[Ii]=e)}var sl=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}();Qa(sl);var cl=function(){function t(r,n,i,a,o,s,u){this.kind=r,this.start=n,this.end=i,this.line=a,this.column=o,this.value=u,this.prev=s,this.next=null}var e=t.prototype;return e.toJSON=function(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}},t}();Qa(cl);function qs(t){return t!=null&&typeof t.kind=="string"}function za(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?za=function(r){return typeof r}:za=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},za(t)}var Sh=10,ul=2;function Ti(t){return Ga(t,[])}function Ga(t,e){switch(za(t)){case"string":return JSON.stringify(t);case"function":return t.name?"[function ".concat(t.name,"]"):"[function]";case"object":return t===null?"null":Eh(t,e);default:return String(t)}}function Eh(t,e){if(e.indexOf(t)!==-1)return"[Circular]";var r=[].concat(e,[t]),n=Th(t);if(n!==void 0){var i=n.call(t);if(i!==t)return typeof i=="string"?i:Ga(i,r)}else if(Array.isArray(t))return Ih(t,r);return xh(t,r)}function xh(t,e){var r=Object.keys(t);if(r.length===0)return"{}";if(e.length>ul)return"["+kh(t)+"]";var n=r.map(function(i){var a=Ga(t[i],e);return i+": "+a});return"{ "+n.join(", ")+" }"}function Ih(t,e){if(t.length===0)return"[]";if(e.length>ul)return"[Array]";for(var r=Math.min(Sh,t.length),n=t.length-r,i=[],a=0;a<r;++a)i.push(Ga(t[a],e));return n===1?i.push("... 1 more item"):n>1&&i.push("... ".concat(n," more items")),"["+i.join(", ")+"]"}function Th(t){var e=t[String(Ii)];if(typeof e=="function")return e;if(typeof t.inspect=="function")return t.inspect}function kh(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 ki(t,e){var r=Boolean(t);if(!r)throw new Error(e)}function ll(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 Oh(t,e,r){return e&&ll(t.prototype,e),r&&ll(t,r),t}var Wa=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"||ki(0,"Body must be a string. Received: ".concat(Ti(e),".")),this.body=e,this.name=r,this.locationOffset=n,this.locationOffset.line>0||ki(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||ki(0,"column in locationOffset is 1-indexed and must be positive.")}return Oh(t,[{key:ol,get:function(){return"Source"}}]),t}();function fl(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 Ge=(t,e,r)=>new Promise((n,i)=>{var a=u=>{try{s(r.next(u))}catch(c){i(c)}},o=u=>{try{s(r.throw(u))}catch(c){i(c)}},s=u=>u.done?n(u.value):Promise.resolve(u.value).then(a,o);s((r=r.apply(t,e)).next())});var $s=function(t,e){return $s=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])},$s(t,e)};function xe(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");$s(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var w=function(){return w=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},w.apply(this,arguments)};function Bt(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 Ct(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{c(n.next(l))}catch(d){o(d)}}function u(l){try{c(n.throw(l))}catch(d){o(d)}}function c(l){l.done?a(l.value):i(l.value).then(s,u)}c((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(c){return function(l){return u([c,l])}}function u(c){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(r=0)),r;)try{if(n=1,i&&(a=c[0]&2?i.return:c[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,c[1])).done)return a;switch(i=0,a&&(c=[c[0]&2,a.value]),c[0]){case 0:case 1:a=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,i=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!a||c[1]>a[0]&&c[1]<a[3])){r.label=c[1];break}if(c[0]===6&&r.label<a[1]){r.label=a[1],a=c;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(c);break}a[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(l){c=[6,l],i=0}finally{n=a=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function yr(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 Ms="Invariant Violation",al=Object.setPrototypeOf,_h=al===void 0?function(t,e){return t.__proto__=e,t}:al,Q=function(t){xe(e,t);function e(r){r===void 0&&(r=Ms);var n=t.call(this,typeof r=="number"?Ms+": "+r+" (see https://github.com/apollographql/invariant-packages)":r)||this;return n.framesToPop=1,n.name=Ms,_h(n,e.prototype),n}return e}(Error);function P(t,e){if(!t)throw new Q(e)}var Ka=["debug","log","warn","error","silent"],Us=Ka.indexOf("log");function Wa(t){return function(){if(Ka.indexOf(t)>=Us){var e=console[t]||console.log;return e.apply(console,arguments)}}}(function(t){t.debug=Wa("debug"),t.log=Wa("log"),t.warn=Wa("warn"),t.error=Wa("error")})(P||(P={}));function ol(t){var e=Ka[Us];return Us=Math.max(0,Ka.indexOf(t)),e}function Ue(t){try{return t()}catch{}}var Ha=Ue(function(){return globalThis})||Ue(function(){return window})||Ue(function(){return self})||Ue(function(){return global})||Ue(function(){return Ue.constructor("return this")()});var sl="__",cl=[sl,sl].join("DEV");function Sh(){try{return Boolean(__DEV__)}catch{return Object.defineProperty(Ha,cl,{value:Ue(function(){return"production"})!=="production",enumerable:!1,configurable:!0,writable:!0}),Ha[cl]}}var Wr=Sh();function vr(t){try{return t()}catch{}}var js=vr(function(){return globalThis})||vr(function(){return window})||vr(function(){return self})||vr(function(){return global})||vr(function(){return vr.constructor("return this")()}),qs=!1;function wh(){js&&!vr(function(){return"production"})&&!vr(function(){return process})&&(Object.defineProperty(js,"process",{value:{env:{NODE_ENV:"production"}},configurable:!0,enumerable:!1,writable:!0}),qs=!0)}wh();function Bs(){qs&&(delete js.process,qs=!1)}var G_=typeof Symbol=="function"&&Symbol.iterator!=null?Symbol.iterator:"@@iterator",W_=typeof Symbol=="function"&&Symbol.asyncIterator!=null?Symbol.asyncIterator:"@@asyncIterator",ul=typeof Symbol=="function"&&Symbol.toStringTag!=null?Symbol.toStringTag:"@@toStringTag";var Ae=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 Vs(t,e){var r=Boolean(t);if(!r)throw new Error(e??"Unexpected invariant triggered.")}var Eh=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):void 0,Ti=Eh;function Ja(t){var e=t.prototype.toJSON;typeof e=="function"||Vs(0),t.prototype.inspect=e,Ti&&(t.prototype[Ti]=e)}var ll=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}();Ja(ll);var fl=function(){function t(r,n,i,a,o,s,u){this.kind=r,this.start=n,this.end=i,this.line=a,this.column=o,this.value=u,this.prev=s,this.next=null}var e=t.prototype;return e.toJSON=function(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}},t}();Ja(fl);function Qs(t){return t!=null&&typeof t.kind=="string"}function Ya(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ya=function(r){return typeof r}:Ya=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Ya(t)}var xh=10,pl=2;function ki(t){return Za(t,[])}function Za(t,e){switch(Ya(t)){case"string":return JSON.stringify(t);case"function":return t.name?"[function ".concat(t.name,"]"):"[function]";case"object":return t===null?"null":Ih(t,e);default:return String(t)}}function Ih(t,e){if(e.indexOf(t)!==-1)return"[Circular]";var r=[].concat(e,[t]),n=Oh(t);if(n!==void 0){var i=n.call(t);if(i!==t)return typeof i=="string"?i:Za(i,r)}else if(Array.isArray(t))return kh(t,r);return Th(t,r)}function Th(t,e){var r=Object.keys(t);if(r.length===0)return"{}";if(e.length>pl)return"["+Ah(t)+"]";var n=r.map(function(i){var a=Za(t[i],e);return i+": "+a});return"{ "+n.join(", ")+" }"}function kh(t,e){if(t.length===0)return"[]";if(e.length>pl)return"[Array]";for(var r=Math.min(xh,t.length),n=t.length-r,i=[],a=0;a<r;++a)i.push(Za(t[a],e));return n===1?i.push("... 1 more item"):n>1&&i.push("... ".concat(n," more items")),"["+i.join(", ")+"]"}function Oh(t){var e=t[String(Ti)];if(typeof e=="function")return e;if(typeof t.inspect=="function")return t.inspect}function Ah(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 Oi(t,e){var r=Boolean(t);if(!r)throw new Error(e)}function dl(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 Dh(t,e,r){return e&&dl(t.prototype,e),r&&dl(t,r),t}var Xa=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"||Oi(0,"Body must be a string. Received: ".concat(ki(e),".")),this.body=e,this.name=r,this.locationOffset=n,this.locationOffset.line>0||Oi(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||Oi(0,"column in locationOffset is 1-indexed and must be positive.")}return Dh(t,[{key:ul,get:function(){return"Source"}}]),t}();function hl(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,n=t.indexOf(`
2
2
  `)===-1,i=t[0]===" "||t[0]===" ",a=t[t.length-1]==='"',o=t[t.length-1]==="\\",s=!n||a||o||r,u="";return s&&!(n&&i)&&(u+=`
3
3
  `+e),u+=e?t.replace(/\n/g,`
4
4
  `+e):t,s&&(u+=`
5
- `),'"""'+u.replace(/"""/g,'\\"""')+'"""'}var Ah={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"]},Kr=Object.freeze({});function Je(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Ah,n=void 0,i=Array.isArray(t),a=[t],o=-1,s=[],u=void 0,c=void 0,l=void 0,d=[],p=[],f=t;do{o++;var h=o===a.length,y=h&&s.length!==0;if(h){if(c=p.length===0?void 0:d[d.length-1],u=l,l=p.pop(),y){if(i)u=u.slice();else{for(var v={},E=0,_=Object.keys(u);E<_.length;E++){var b=_[E];v[b]=u[b]}u=v}for(var g=0,A=0;A<s.length;A++){var R=s[A][0],T=s[A][1];i&&(R-=g),i&&T===null?(u.splice(R,1),g++):u[R]=T}}o=n.index,a=n.keys,s=n.edits,i=n.inArray,n=n.prev}else{if(c=l?i?o:a[o]:void 0,u=l?l[c]:f,u==null)continue;l&&d.push(c)}var C=void 0;if(!Array.isArray(u)){if(!qs(u))throw new Error("Invalid AST Node: ".concat(Ti(u),"."));var F=Bs(e,u.kind,h);if(F){if(C=F.call(e,u,c,l,d,p),C===Kr)break;if(C===!1){if(!h){d.pop();continue}}else if(C!==void 0&&(s.push([c,C]),!h))if(qs(C))u=C;else{d.pop();continue}}}if(C===void 0&&y&&s.push([c,u]),h)d.pop();else{var L;n={inArray:i,index:o,keys:a,edits:s,prev:n},i=Array.isArray(u),a=i?u:(L=r[u.kind])!==null&&L!==void 0?L:[],o=-1,s=[],l&&p.push(l),l=u}}while(n!==void 0);return s.length!==0&&(f=s[s.length-1][1]),f}function Bs(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 Fn(t){return Je(t,{leave:Nh})}var Dh=80,Nh={Name:function(e){return e.value},Variable:function(e){return"$"+e.name},Document:function(e){return $(e.definitions,`
5
+ `),'"""'+u.replace(/"""/g,'\\"""')+'"""'}var Nh={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"]},Kr=Object.freeze({});function Ye(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Nh,n=void 0,i=Array.isArray(t),a=[t],o=-1,s=[],u=void 0,c=void 0,l=void 0,d=[],p=[],f=t;do{o++;var m=o===a.length,y=m&&s.length!==0;if(m){if(c=p.length===0?void 0:d[d.length-1],u=l,l=p.pop(),y){if(i)u=u.slice();else{for(var b={},E=0,S=Object.keys(u);E<S.length;E++){var _=S[E];b[_]=u[_]}u=b}for(var g=0,A=0;A<s.length;A++){var R=s[A][0],T=s[A][1];i&&(R-=g),i&&T===null?(u.splice(R,1),g++):u[R]=T}}o=n.index,a=n.keys,s=n.edits,i=n.inArray,n=n.prev}else{if(c=l?i?o:a[o]:void 0,u=l?l[c]:f,u==null)continue;l&&d.push(c)}var C=void 0;if(!Array.isArray(u)){if(!Qs(u))throw new Error("Invalid AST Node: ".concat(ki(u),"."));var F=zs(e,u.kind,m);if(F){if(C=F.call(e,u,c,l,d,p),C===Kr)break;if(C===!1){if(!m){d.pop();continue}}else if(C!==void 0&&(s.push([c,C]),!m))if(Qs(C))u=C;else{d.pop();continue}}}if(C===void 0&&y&&s.push([c,u]),m)d.pop();else{var L;n={inArray:i,index:o,keys:a,edits:s,prev:n},i=Array.isArray(u),a=i?u:(L=r[u.kind])!==null&&L!==void 0?L:[],o=-1,s=[],l&&p.push(l),l=u}}while(n!==void 0);return s.length!==0&&(f=s[s.length-1][1]),f}function zs(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 Fn(t){return Ye(t,{leave:Ch})}var Ph=80,Ch={Name:function(e){return e.value},Variable:function(e){return"$"+e.name},Document:function(e){return $(e.definitions,`
6
6
 
7
7
  `)+`
8
- `},OperationDefinition:function(e){var r=e.operation,n=e.name,i=we("(",$(e.variableDefinitions,", "),")"),a=$(e.directives," "),o=e.selectionSet;return!n&&!a&&!i&&r==="query"?o:$([r,$([n,i]),a,o]," ")},VariableDefinition:function(e){var r=e.variable,n=e.type,i=e.defaultValue,a=e.directives;return r+": "+n+we(" = ",i)+we(" ",$(a," "))},SelectionSet:function(e){var r=e.selections;return Lt(r)},Field:function(e){var r=e.alias,n=e.name,i=e.arguments,a=e.directives,o=e.selectionSet,s=we("",r,": ")+n,u=s+we("(",$(i,", "),")");return u.length>Dh&&(u=s+we(`(
9
- `,Ka($(i,`
8
+ `},OperationDefinition:function(e){var r=e.operation,n=e.name,i=Se("(",$(e.variableDefinitions,", "),")"),a=$(e.directives," "),o=e.selectionSet;return!n&&!a&&!i&&r==="query"?o:$([r,$([n,i]),a,o]," ")},VariableDefinition:function(e){var r=e.variable,n=e.type,i=e.defaultValue,a=e.directives;return r+": "+n+Se(" = ",i)+Se(" ",$(a," "))},SelectionSet:function(e){var r=e.selections;return Ft(r)},Field:function(e){var r=e.alias,n=e.name,i=e.arguments,a=e.directives,o=e.selectionSet,s=Se("",r,": ")+n,u=s+Se("(",$(i,", "),")");return u.length>Ph&&(u=s+Se(`(
9
+ `,eo($(i,`
10
10
  `)),`
11
- )`)),$([u,$(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+we(" ",$(n," "))},InlineFragment:function(e){var r=e.typeCondition,n=e.directives,i=e.selectionSet;return $(["...",we("on ",r),$(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(we("(",$(i,", "),")")," ")+"on ".concat(n," ").concat(we("",$(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?fl(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"["+$(r,", ")+"]"},ObjectValue:function(e){var r=e.fields;return"{"+$(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+we("(",$(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:Rt(function(t){var e=t.directives,r=t.operationTypes;return $(["schema",$(e," "),Lt(r)]," ")}),OperationTypeDefinition:function(e){var r=e.operation,n=e.type;return r+": "+n},ScalarTypeDefinition:Rt(function(t){var e=t.name,r=t.directives;return $(["scalar",e,$(r," ")]," ")}),ObjectTypeDefinition:Rt(function(t){var e=t.name,r=t.interfaces,n=t.directives,i=t.fields;return $(["type",e,we("implements ",$(r," & ")),$(n," "),Lt(i)]," ")}),FieldDefinition:Rt(function(t){var e=t.name,r=t.arguments,n=t.type,i=t.directives;return e+(pl(r)?we(`(
12
- `,Ka($(r,`
11
+ )`)),$([u,$(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+Se(" ",$(n," "))},InlineFragment:function(e){var r=e.typeCondition,n=e.directives,i=e.selectionSet;return $(["...",Se("on ",r),$(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(Se("(",$(i,", "),")")," ")+"on ".concat(n," ").concat(Se("",$(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?hl(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"["+$(r,", ")+"]"},ObjectValue:function(e){var r=e.fields;return"{"+$(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+Se("(",$(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:Lt(function(t){var e=t.directives,r=t.operationTypes;return $(["schema",$(e," "),Ft(r)]," ")}),OperationTypeDefinition:function(e){var r=e.operation,n=e.type;return r+": "+n},ScalarTypeDefinition:Lt(function(t){var e=t.name,r=t.directives;return $(["scalar",e,$(r," ")]," ")}),ObjectTypeDefinition:Lt(function(t){var e=t.name,r=t.interfaces,n=t.directives,i=t.fields;return $(["type",e,Se("implements ",$(r," & ")),$(n," "),Ft(i)]," ")}),FieldDefinition:Lt(function(t){var e=t.name,r=t.arguments,n=t.type,i=t.directives;return e+(ml(r)?Se(`(
12
+ `,eo($(r,`
13
13
  `)),`
14
- )`):we("(",$(r,", "),")"))+": "+n+we(" ",$(i," "))}),InputValueDefinition:Rt(function(t){var e=t.name,r=t.type,n=t.defaultValue,i=t.directives;return $([e+": "+r,we("= ",n),$(i," ")]," ")}),InterfaceTypeDefinition:Rt(function(t){var e=t.name,r=t.interfaces,n=t.directives,i=t.fields;return $(["interface",e,we("implements ",$(r," & ")),$(n," "),Lt(i)]," ")}),UnionTypeDefinition:Rt(function(t){var e=t.name,r=t.directives,n=t.types;return $(["union",e,$(r," "),n&&n.length!==0?"= "+$(n," | "):""]," ")}),EnumTypeDefinition:Rt(function(t){var e=t.name,r=t.directives,n=t.values;return $(["enum",e,$(r," "),Lt(n)]," ")}),EnumValueDefinition:Rt(function(t){var e=t.name,r=t.directives;return $([e,$(r," ")]," ")}),InputObjectTypeDefinition:Rt(function(t){var e=t.name,r=t.directives,n=t.fields;return $(["input",e,$(r," "),Lt(n)]," ")}),DirectiveDefinition:Rt(function(t){var e=t.name,r=t.arguments,n=t.repeatable,i=t.locations;return"directive @"+e+(pl(r)?we(`(
15
- `,Ka($(r,`
14
+ )`):Se("(",$(r,", "),")"))+": "+n+Se(" ",$(i," "))}),InputValueDefinition:Lt(function(t){var e=t.name,r=t.type,n=t.defaultValue,i=t.directives;return $([e+": "+r,Se("= ",n),$(i," ")]," ")}),InterfaceTypeDefinition:Lt(function(t){var e=t.name,r=t.interfaces,n=t.directives,i=t.fields;return $(["interface",e,Se("implements ",$(r," & ")),$(n," "),Ft(i)]," ")}),UnionTypeDefinition:Lt(function(t){var e=t.name,r=t.directives,n=t.types;return $(["union",e,$(r," "),n&&n.length!==0?"= "+$(n," | "):""]," ")}),EnumTypeDefinition:Lt(function(t){var e=t.name,r=t.directives,n=t.values;return $(["enum",e,$(r," "),Ft(n)]," ")}),EnumValueDefinition:Lt(function(t){var e=t.name,r=t.directives;return $([e,$(r," ")]," ")}),InputObjectTypeDefinition:Lt(function(t){var e=t.name,r=t.directives,n=t.fields;return $(["input",e,$(r," "),Ft(n)]," ")}),DirectiveDefinition:Lt(function(t){var e=t.name,r=t.arguments,n=t.repeatable,i=t.locations;return"directive @"+e+(ml(r)?Se(`(
15
+ `,eo($(r,`
16
16
  `)),`
17
- )`):we("(",$(r,", "),")"))+(n?" repeatable":"")+" on "+$(i," | ")}),SchemaExtension:function(e){var r=e.directives,n=e.operationTypes;return $(["extend schema",$(r," "),Lt(n)]," ")},ScalarTypeExtension:function(e){var r=e.name,n=e.directives;return $(["extend scalar",r,$(n," ")]," ")},ObjectTypeExtension:function(e){var r=e.name,n=e.interfaces,i=e.directives,a=e.fields;return $(["extend type",r,we("implements ",$(n," & ")),$(i," "),Lt(a)]," ")},InterfaceTypeExtension:function(e){var r=e.name,n=e.interfaces,i=e.directives,a=e.fields;return $(["extend interface",r,we("implements ",$(n," & ")),$(i," "),Lt(a)]," ")},UnionTypeExtension:function(e){var r=e.name,n=e.directives,i=e.types;return $(["extend union",r,$(n," "),i&&i.length!==0?"= "+$(i," | "):""]," ")},EnumTypeExtension:function(e){var r=e.name,n=e.directives,i=e.values;return $(["extend enum",r,$(n," "),Lt(i)]," ")},InputObjectTypeExtension:function(e){var r=e.name,n=e.directives,i=e.fields;return $(["extend input",r,$(n," "),Lt(i)]," ")}};function Rt(t){return function(e){return $([e.description,t(e)],`
18
- `)}}function $(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 Lt(t){return we(`{
19
- `,Ka($(t,`
17
+ )`):Se("(",$(r,", "),")"))+(n?" repeatable":"")+" on "+$(i," | ")}),SchemaExtension:function(e){var r=e.directives,n=e.operationTypes;return $(["extend schema",$(r," "),Ft(n)]," ")},ScalarTypeExtension:function(e){var r=e.name,n=e.directives;return $(["extend scalar",r,$(n," ")]," ")},ObjectTypeExtension:function(e){var r=e.name,n=e.interfaces,i=e.directives,a=e.fields;return $(["extend type",r,Se("implements ",$(n," & ")),$(i," "),Ft(a)]," ")},InterfaceTypeExtension:function(e){var r=e.name,n=e.interfaces,i=e.directives,a=e.fields;return $(["extend interface",r,Se("implements ",$(n," & ")),$(i," "),Ft(a)]," ")},UnionTypeExtension:function(e){var r=e.name,n=e.directives,i=e.types;return $(["extend union",r,$(n," "),i&&i.length!==0?"= "+$(i," | "):""]," ")},EnumTypeExtension:function(e){var r=e.name,n=e.directives,i=e.values;return $(["extend enum",r,$(n," "),Ft(i)]," ")},InputObjectTypeExtension:function(e){var r=e.name,n=e.directives,i=e.fields;return $(["extend input",r,$(n," "),Ft(i)]," ")}};function Lt(t){return function(e){return $([e.description,t(e)],`
18
+ `)}}function $(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 Ft(t){return Se(`{
19
+ `,eo($(t,`
20
20
  `)),`
21
- }`)}function we(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";return e!=null&&e!==""?t+e+r:""}function Ka(t){return we(" ",t.replace(/\n/g,`
22
- `))}function Ph(t){return t.indexOf(`
23
- `)!==-1}function pl(t){return t!=null&&t.some(Ph)}function Oi(t){return t.kind===Ae.FIELD||t.kind===Ae.FRAGMENT_SPREAD||t.kind===Ae.INLINE_FRAGMENT}function dl(){return typeof Wa=="function"?js():js()}function Bh(){__DEV__?N(typeof Wr=="boolean",Wr):N(typeof Wr=="boolean",39)}dl();Bh();function nr(t,e){var r=t.directives;return!r||!r.length?!0:hl(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__?N(o!==void 0,"Invalid variable referenced in @".concat(i.name.value," directive.")):N(o!==void 0,40)):o=a.value.value,i.name.value==="skip"?!o:o})}function $n(t,e,r){var n=new Set(t),i=n.size;return Je(e,{Directive:function(a){if(n.delete(a.name.value)&&(!r||!n.size))return Kr}}),r?!n.size:n.size<i}function Vs(t){return t&&$n(["client","export"],t,!0)}function Vh(t){var e=t.name.value;return e==="skip"||e==="include"}function hl(t){var e=[];return t&&t.length&&t.forEach(function(r){if(!!Vh(r)){var n=r.arguments,i=r.name.value;__DEV__?N(n&&n.length===1,"Incorrect number of arguments for the @".concat(i," directive.")):N(n&&n.length===1,41);var a=n[0];__DEV__?N(a.name&&a.name.value==="if","Invalid argument for the @".concat(i," directive.")):N(a.name&&a.name.value==="if",42);var o=a.value;__DEV__?N(o&&(o.kind==="Variable"||o.kind==="BooleanValue"),"Argument for the @".concat(i," directive must be a variable or a boolean value.")):N(o&&(o.kind==="Variable"||o.kind==="BooleanValue"),43),e.push({directive:r,ifArgument:a})}}),e}function Qs(t,e){var r=e,n=[];t.definitions.forEach(function(a){if(a.kind==="OperationDefinition")throw __DEV__?new V("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 V(44);a.kind==="FragmentDefinition"&&n.push(a)}),typeof r>"u"&&(__DEV__?N(n.length===1,"Found ".concat(n.length," fragments. `fragmentName` must be provided when there is not exactly 1 fragment.")):N(n.length===1,45),r=n[0].name.value);var i=w(w({},t),{definitions:gr([{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:r}}]}}],t.definitions,!0)});return i}function Hr(t){t===void 0&&(t=[]);var e={};return t.forEach(function(r){e[r.name.value]=r}),e}function Jr(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__?N(n,"No fragment named ".concat(r)):N(n,46),n||null}default:return null}}function ie(t){return t!==null&&typeof t=="object"}function Vt(t){return{__ref:String(t)}}function Z(t){return Boolean(t&&typeof t=="object"&&typeof t.__ref=="string")}function zs(t){return ie(t)&&t.kind==="Document"&&Array.isArray(t.definitions)}function Qh(t){return t.kind==="StringValue"}function zh(t){return t.kind==="BooleanValue"}function Gh(t){return t.kind==="IntValue"}function Wh(t){return t.kind==="FloatValue"}function Kh(t){return t.kind==="Variable"}function Hh(t){return t.kind==="ObjectValue"}function Jh(t){return t.kind==="ListValue"}function Yh(t){return t.kind==="EnumValue"}function Zh(t){return t.kind==="NullValue"}function br(t,e,r,n){if(Gh(r)||Wh(r))t[e.value]=Number(r.value);else if(zh(r)||Qh(r))t[e.value]=r.value;else if(Hh(r)){var i={};r.fields.map(function(o){return br(i,o.name,o.value,n)}),t[e.value]=i}else if(Kh(r)){var a=(n||{})[r.name.value];t[e.value]=a}else if(Jh(r))t[e.value]=r.values.map(function(o){var s={};return br(s,e,o,n),s[e.value]});else if(Yh(r))t[e.value]=r.value;else if(Zh(r))t[e.value]=null;else throw __DEV__?new V('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 V(55)}function Gs(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 br(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 br(n,a,o,e)})),Di(t.name.value,n,r)}var Xh=["connection","include","skip","client","rest","export"],Di=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(Ai(i),")")}else return r.connection.key;var a=t;if(e){var o=Ai(e);a+="(".concat(o,")")}return r&&Object.keys(r).forEach(function(s){Xh.indexOf(s)===-1&&(r[s]&&Object.keys(r[s]).length?a+="@".concat(s,"(").concat(Ai(r[s]),")"):a+="@".concat(s))}),a},{setStringify:function(t){var e=Ai;return Ai=t,e}}),Ai=function(e){return JSON.stringify(e,em)};function em(t,e){return ie(e)&&!Array.isArray(e)&&(e=Object.keys(e).sort().reduce(function(r,n){return r[n]=e[n],r},{})),e}function ir(t,e){if(t.arguments&&t.arguments.length){var r={};return t.arguments.forEach(function(n){var i=n.name,a=n.value;return br(r,i,a,e)}),r}return null}function xt(t){return t.alias?t.alias.value:t.name.value}function Ni(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(mt(a)){if(a.name.value==="__typename")return t[xt(a)]}else{var o=Ni(t,Jr(a,r).selectionSet,r);if(typeof o=="string")return o}}}function mt(t){return t.kind==="Field"}function Ws(t){return t.kind==="InlineFragment"}function Mn(t){__DEV__?N(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'):N(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 V('Schema type definitions not allowed in queries. Found: "'.concat(r.kind,'"')):new V(48);return r});return __DEV__?N(e.length<=1,"Ambiguous GraphQL document: contains ".concat(e.length," operations")):N(e.length<=1,49),t}function Qt(t){return Mn(t),t.definitions.filter(function(e){return e.kind==="OperationDefinition"})[0]}function jn(t){return t.definitions.filter(function(e){return e.kind==="OperationDefinition"&&!!e.name}).map(function(e){return e.name.value})[0]||null}function Yr(t){return t.definitions.filter(function(e){return e.kind==="FragmentDefinition"})}function Pi(t){var e=Qt(t);return __DEV__?N(e&&e.operation==="query","Must contain a query definition."):N(e&&e.operation==="query",50),e}function Ks(t){__DEV__?N(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'):N(t.kind==="Document",51),__DEV__?N(t.definitions.length<=1,"Fragment must have exactly one definition."):N(t.definitions.length<=1,52);var e=t.definitions[0];return __DEV__?N(e.kind==="FragmentDefinition","Must be a fragment definition."):N(e.kind==="FragmentDefinition",53),e}function Zr(t){Mn(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 V("Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment."):new V(54)}function Xr(t){var e=Object.create(null),r=t&&t.variableDefinitions;return r&&r.length&&r.forEach(function(n){n.defaultValue&&br(e,n.variable.name,n.defaultValue)}),e}var le=Array.isArray;function Ce(t){return Array.isArray(t)&&t.length>0}var ml={kind:Ae.FIELD,name:{kind:Ae.NAME,value:"__typename"}};function gl(t,e){return!t||t.selectionSet.selections.every(function(r){return r.kind===Ae.FRAGMENT_SPREAD&&gl(e[r.name.value],e)})}function tm(t){return gl(Qt(t)||Ks(t),Hr(Yr(t)))?null:t}function rm(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 yl(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 Hs(t,e){for(var r=yl(""),n=yl(""),i=function(_){for(var b=0,g=void 0;b<_.length&&(g=_[b]);++b)if(!le(g)){if(g.kind===Ae.OPERATION_DEFINITION)return r(g.name&&g.name.value);if(g.kind===Ae.FRAGMENT_DEFINITION)return n(g.name.value)}return __DEV__&&N.error("Could not find operation or fragment"),null},a=0,o=e.definitions.length-1;o>=0;--o)e.definitions[o].kind===Ae.OPERATION_DEFINITION&&++a;var s=rm(t),u=t.some(function(_){return _.remove}),c=function(_){return u&&_&&_.some(s)},l=new Map,d=!1,p={enter:function(_){if(c(_.directives))return d=!0,null}},f=Je(e,{Field:p,InlineFragment:p,VariableDefinition:{enter:function(){return!1}},Variable:{enter:function(_,b,g,A,R){var T=i(R);T&&T.variables.add(_.name.value)}},FragmentSpread:{enter:function(_,b,g,A,R){if(c(_.directives))return d=!0,null;var T=i(R);T&&T.fragmentSpreads.add(_.name.value)}},FragmentDefinition:{enter:function(_,b,g,A){l.set(JSON.stringify(A),_)},leave:function(_,b,g,A){var R=l.get(JSON.stringify(A));if(_===R)return _;if(a>0&&_.selectionSet.selections.every(function(T){return T.kind===Ae.FIELD&&T.name.value==="__typename"}))return n(_.name.value).removed=!0,d=!0,null}},Directive:{leave:function(_){if(s(_))return d=!0,null}}});if(!d)return e;var h=function(_){return _.transitiveVars||(_.transitiveVars=new Set(_.variables),_.removed||_.fragmentSpreads.forEach(function(b){h(n(b)).transitiveVars.forEach(function(g){_.transitiveVars.add(g)})})),_},y=new Set;f.definitions.forEach(function(_){_.kind===Ae.OPERATION_DEFINITION?h(r(_.name&&_.name.value)).fragmentSpreads.forEach(function(b){y.add(b)}):_.kind===Ae.FRAGMENT_DEFINITION&&a===0&&!n(_.name.value).removed&&y.add(_.name.value)}),y.forEach(function(_){h(n(_)).fragmentSpreads.forEach(function(b){y.add(b)})});var v=function(_){return!!(!y.has(_)||n(_).removed)},E={enter:function(_){if(v(_.name.value))return null}};return tm(Je(f,{FragmentSpread:E,FragmentDefinition:E,OperationDefinition:{leave:function(_){if(_.variableDefinitions){var b=h(r(_.name&&_.name.value)).transitiveVars;if(b.size<_.variableDefinitions.length)return w(w({},_),{variableDefinitions:_.variableDefinitions.filter(function(g){return b.has(g.variable.name.value)})})}}}}))}var en=Object.assign(function(t){return Je(t,{SelectionSet:{enter:function(e,r,n){if(!(n&&n.kind===Ae.OPERATION_DEFINITION)){var i=e.selections;if(!!i){var a=i.some(function(s){return mt(s)&&(s.name.value==="__typename"||s.name.value.lastIndexOf("__",0)===0)});if(!a){var o=n;if(!(mt(o)&&o.directives&&o.directives.some(function(s){return s.name.value==="export"})))return w(w({},e),{selections:gr(gr([],i,!0),[ml],!1)})}}}}}})},{added:function(t){return t===ml}}),nm={test:function(t){var e=t.name.value==="connection";return e&&(!t.arguments||!t.arguments.some(function(r){return r.name.value==="key"}))&&__DEV__&&N.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 Js(t){return Hs([nm],Mn(t))}function Ys(t){var e=Zr(t),r=e.operation;if(r==="query")return t;var n=Je(t,{OperationDefinition:{enter:function(i){return w(w({},i),{operation:"query"})}}});return n}function Zs(t){Mn(t);var e=Hs([{test:function(r){return r.name.value==="client"},remove:!0}],t);return e}var im=Object.prototype.hasOwnProperty;function Xs(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Ci(t)}function Ci(t){var e=t[0]||{},r=t.length;if(r>1)for(var n=new st,i=1;i<r;++i)e=n.merge(e,t[i]);return e}var am=function(t,e,r){return this.merge(t[r],e[r])},st=function(){function t(e){e===void 0&&(e=am),this.reconciler=e,this.isObject=ie,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 ie(r)&&ie(e)?(Object.keys(r).forEach(function(o){if(im.call(e,o)){var s=e[o];if(r[o]!==s){var u=n.reconciler.apply(n,gr([e,r,o],i,!1));u!==s&&(e=n.shallowCopyForMerge(e),e[o]=u)}}else e=n.shallowCopyForMerge(e),e[o]=r[o]}),e):r},t.prototype.shallowCopyForMerge=function(e){return ie(e)&&(this.pastCopies.has(e)||(Array.isArray(e)?e=e.slice(0):e=w({__proto__:Object.getPrototypeOf(e)},e),this.pastCopies.add(e))),e},t}();function om(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=sm(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 sm(t,e){if(!!t){if(typeof t=="string")return vl(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 vl(t,e)}}function vl(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 bl(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 nc(t,e,r){return e&&bl(t.prototype,e),r&&bl(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}var ic=function(){return typeof Symbol=="function"},ac=function(t){return ic()&&Boolean(Symbol[t])},oc=function(t){return ac(t)?Symbol[t]:"@@"+t};ic()&&!ac("observable")&&(Symbol.observable=Symbol("observable"));var cm=oc("iterator"),tc=oc("observable"),_l=oc("species");function Ja(t,e){var r=t[e];if(r!=null){if(typeof r!="function")throw new TypeError(r+" is not a function");return r}}function Ri(t){var e=t.constructor;return e!==void 0&&(e=e[_l],e===null&&(e=void 0)),e!==void 0?e:J}function um(t){return t instanceof J}function Un(t){Un.log?Un.log(t):setTimeout(function(){throw t})}function Ha(t){Promise.resolve().then(function(){try{t()}catch(e){Un(e)}})}function wl(t){var e=t._cleanup;if(e!==void 0&&(t._cleanup=void 0,!!e))try{if(typeof e=="function")e();else{var r=Ja(e,"unsubscribe");r&&r.call(e)}}catch(n){Un(n)}}function rc(t){t._observer=void 0,t._queue=void 0,t._state="closed"}function lm(t){var e=t._queue;if(!!e){t._queue=void 0,t._state="ready";for(var r=0;r<e.length&&(Sl(t,e[r].type,e[r].value),t._state!=="closed");++r);}}function Sl(t,e,r){t._state="running";var n=t._observer;try{var i=Ja(n,e);switch(e){case"next":i&&i.call(n,r);break;case"error":if(rc(t),i)i.call(n,r);else throw r;break;case"complete":rc(t),i&&i.call(n);break}}catch(a){Un(a)}t._state==="closed"?wl(t):t._state==="running"&&(t._state="ready")}function ec(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}],Ha(function(){return lm(t)});return}Sl(t,e,r)}}var fm=function(){function t(r,n){this._cleanup=void 0,this._observer=r,this._queue=void 0,this._state="initializing";var i=new pm(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"&&(rc(this),wl(this))},nc(t,[{key:"closed",get:function(){return this._state==="closed"}}]),t}(),pm=function(){function t(r){this._subscription=r}var e=t.prototype;return e.next=function(n){ec(this._subscription,"next",n)},e.error=function(n){ec(this._subscription,"error",n)},e.complete=function(){ec(this._subscription,"complete")},nc(t,[{key:"closed",get:function(){return this._subscription._state==="closed"}}]),t}(),J=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 fm(n,this._subscriber)},e.forEach=function(n){var i=this;return new Promise(function(a,o){if(typeof n!="function"){o(new TypeError(n+" is not a function"));return}function s(){u.unsubscribe(),a()}var u=i.subscribe({next:function(c){try{n(c,s)}catch(l){o(l),u.unsubscribe()}},error:o,complete:a})})},e.map=function(n){var i=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var a=Ri(this);return new a(function(o){return i.subscribe({next:function(s){try{s=n(s)}catch(u){return o.error(u)}o.next(s)},error:function(s){o.error(s)},complete:function(){o.complete()}})})},e.filter=function(n){var i=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var a=Ri(this);return new a(function(o){return i.subscribe({next:function(s){try{if(!n(s))return}catch(u){return o.error(u)}o.next(s)},error:function(s){o.error(s)},complete:function(){o.complete()}})})},e.reduce=function(n){var i=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var a=Ri(this),o=arguments.length>1,s=!1,u=arguments[1],c=u;return new a(function(l){return i.subscribe({next:function(d){var p=!s;if(s=!0,!p||o)try{c=n(c,d)}catch(f){return l.error(f)}else c=d},error:function(d){l.error(d)},complete:function(){if(!s&&!o)return l.error(new TypeError("Cannot reduce an empty sequence"));l.next(c),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=Ri(this);return new s(function(u){var c,l=0;function d(p){c=p.subscribe({next:function(f){u.next(f)},error:function(f){u.error(f)},complete:function(){l===a.length?(c=void 0,u.complete()):d(s.from(a[l++]))}})}return d(n),function(){c&&(c.unsubscribe(),c=void 0)}})},e.flatMap=function(n){var i=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var a=Ri(this);return new a(function(o){var s=[],u=i.subscribe({next:function(l){if(n)try{l=n(l)}catch(p){return o.error(p)}var d=a.from(l).subscribe({next:function(p){o.next(p)},error:function(p){o.error(p)},complete:function(){var p=s.indexOf(d);p>=0&&s.splice(p,1),c()}});s.push(d)},error:function(l){o.error(l)},complete:function(){c()}});function c(){u.closed&&s.length===0&&o.complete()}return function(){s.forEach(function(l){return l.unsubscribe()}),u.unsubscribe()}})},e[tc]=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=Ja(n,tc);if(a){var o=a.call(n);if(Object(o)!==o)throw new TypeError(o+" is not an object");return um(o)&&o.constructor===i?o:new i(function(s){return o.subscribe(s)})}if(ac("iterator")&&(a=Ja(n,cm),a))return new i(function(s){Ha(function(){if(!s.closed){for(var u=om(a.call(n)),c;!(c=u()).done;){var l=c.value;if(s.next(l),s.closed)return}s.complete()}})});if(Array.isArray(n))return new i(function(s){Ha(function(){if(!s.closed){for(var u=0;u<n.length;++u)if(s.next(n[u]),s.closed)return;s.complete()}})});throw new TypeError(n+" is not observable")},t.of=function(){for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];var o=typeof this=="function"?this:t;return new o(function(s){Ha(function(){if(!s.closed){for(var u=0;u<i.length;++u)if(s.next(i[u]),s.closed)return;s.complete()}})})},nc(t,null,[{key:_l,get:function(){return this}}]),t}();ic()&&Object.defineProperty(J,Symbol("extensions"),{value:{symbol:tc,hostReportError:Un},configurable:!0});function sc(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 qn;typeof self<"u"?qn=self:typeof window<"u"?qn=window:typeof global<"u"?qn=global:typeof module<"u"?qn=module:qn=Function("return this")();var vw=sc(qn);var El=J.prototype,xl="@@observable";El[xl]||(El[xl]=function(){return this});var dm=Object.prototype.toString;function Ya(t){return cc(t)}function cc(t,e){switch(dm.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]=cc(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]=cc(t[i],e)}),n}default:return t}}function hm(t){var e=new Set([t]);return e.forEach(function(r){ie(r)&&mm(r)===r&&Object.getOwnPropertyNames(r).forEach(function(n){ie(r[n])&&e.add(r[n])})}),t}function mm(t){if(__DEV__&&!Object.isFrozen(t))try{Object.freeze(t)}catch(e){if(e instanceof TypeError)return null;throw e}return t}function Li(t){return __DEV__&&hm(t),t}function tn(t,e,r){var n=[];t.forEach(function(i){return i[e]&&n.push(i)}),n.forEach(function(i){return i[e](r)})}function Za(t,e,r){return new J(function(n){var i=n.next,a=n.error,o=n.complete,s=0,u=!1,c={then:function(f){return new Promise(function(h){return h(f())})}};function l(f,h){return f?function(y){++s;var v=function(){return f(y)};c=c.then(v,v).then(function(E){--s,i&&i.call(n,E),u&&d.complete()},function(E){throw--s,E}).catch(function(E){a&&a.call(n,E)})}:function(y){return h&&h.call(n,y)}}var d={next:l(e,i),error:l(r,a),complete:function(){u=!0,s||o&&o.call(n)}},p=t.subscribe(d);return function(){return p.unsubscribe()}})}var It=typeof WeakMap=="function"&&je(function(){return navigator.product})!=="ReactNative",Il=typeof WeakSet=="function",uc=typeof Symbol=="function"&&typeof Symbol.for=="function",_r=uc&&Symbol.asyncIterator,Nw=typeof je(function(){return window.document.createElement})=="function",Pw=je(function(){return navigator.userAgent.indexOf("jsdom")>=0})||!1;function Xa(t){function e(r){Object.defineProperty(t,r,{value:J})}return uc&&Symbol.species&&e(Symbol.species),e("@@species"),t}function Tl(t){return t&&typeof t.then=="function"}var Bn=function(t){xe(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),tn(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),tn(n.observers,"error",i))},complete:function(){var i=n,a=i.sub,o=i.sources,s=o===void 0?[]:o;if(a!==null){var u=s.shift();u?Tl(u)?u.then(function(c){return n.sub=c.subscribe(n.handlers)}):n.sub=u.subscribe(n.handlers):(a&&setTimeout(function(){return a.unsubscribe()}),n.sub=null,n.latest&&n.latest[0]==="next"?n.resolve(n.latest[1]):n.resolve(),n.notify("complete"),tn(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 J(r)]),Tl(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}(J);Xa(Bn);function wr(t){return"incremental"in t}function ym(t){return"hasNext"in t&&"data"in t}function kl(t){return wr(t)||ym(t)}function eo(t,e){var r=t,n=new st;return wr(e)&&Ce(e.incremental)&&e.incremental.forEach(function(i){for(var a=i.data,o=i.path,s=o.length-1;s>=0;--s){var u=o[s],c=!isNaN(+u),l=c?[]:{};l[u]=a,a=l}r=n.merge(r,a)}),r}function Vn(t){var e=to(t);return Ce(e)}function to(t){var e=Ce(t.errors)?t.errors.slice(0):[];return wr(t)&&Ce(t.incremental)&&t.incremental.forEach(function(r){r.errors&&e.push.apply(e,r.errors)}),e}function Sr(){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 Ol=new Map;function Fi(t){var e=Ol.get(t)||1;return Ol.set(t,e+1),"".concat(t,":").concat(e,":").concat(Math.random().toString(36).slice(2))}function Al(t){var e=Fi("stringifyForDisplay");return JSON.stringify(t,function(r,n){return n===void 0?e:n}).split(JSON.stringify(e)).join("<undefined>")}function $i(t,e){return Sr(t,e,e.variables&&{variables:w(w({},t&&t.variables),e.variables)})}function ro(t){return new J(function(e){e.error(t)})}var Mi=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 lc(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 V("illegal argument: ".concat(i)):new V(27)}return t}function fc(t,e){var r=w({},t),n=function(a){typeof a=="function"?r=w(w({},r),a(r)):r=w(w({},r),a)},i=function(){return w({},r)};return Object.defineProperty(e,"setContext",{enumerable:!1,value:n}),Object.defineProperty(e,"getContext",{enumerable:!1,value:i}),e}function pc(t){var e={variables:t.variables||{},extensions:t.extensions||{},operationName:t.operationName,query:t.query};return e.operationName||(e.operationName=typeof e.query!="string"?jn(e.query)||void 0:""),e}function Dl(t,e){return e?e(t):J.of()}function ji(t){return typeof t=="function"?new Tt(t):t}function no(t){return t.request.length<=1}var gm=function(t){xe(e,t);function e(r,n){var i=t.call(this,r)||this;return i.link=n,i}return e}(Error),Tt=function(){function t(e){e&&(this.request=e)}return t.empty=function(){return new t(function(){return J.of()})},t.from=function(e){return e.length===0?t.empty():e.map(ji).reduce(function(r,n){return r.concat(n)})},t.split=function(e,r,n){var i=ji(r),a=ji(n||new t(Dl));return no(i)&&no(a)?new t(function(o){return e(o)?i.request(o)||J.of():a.request(o)||J.of()}):new t(function(o,s){return e(o)?i.request(o,s)||J.of():a.request(o,s)||J.of()})},t.execute=function(e,r){return e.request(fc(r.context,pc(lc(r))))||J.of()},t.concat=function(e,r){var n=ji(e);if(no(n))return __DEV__&&N.warn(new gm("You are calling concat on a terminating link, which will have no effect",n)),n;var i=ji(r);return no(i)?new t(function(a){return n.request(a,function(o){return i.request(o)||J.of()})||J.of()}):new t(function(a,o){return n.request(a,function(s){return i.request(s,o)||J.of()})||J.of()})},t.prototype.split=function(e,r,n){return this.concat(t.split(e,r,n||new t(Dl)))},t.prototype.concat=function(e){return t.concat(this,e)},t.prototype.request=function(e,r){throw __DEV__?new V("request is not implemented"):new V(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 Qn=Tt.execute;var Nl="3.7.10";function Pl(t){return!!t.body}function Cl(t){return!!t.getReader}function Rl(t){return!!(_r&&t[Symbol.asyncIterator])}function Ll(t){return!!t.stream}function Fl(t){return!!t.arrayBuffer}function $l(t){return!!t.pipe}function dc(t){var e,r=t[Symbol.asyncIterator]();return e={next:function(){return r.next()}},e[Symbol.asyncIterator]=function(){return this},e}function hc(t){var e=null,r=null,n=!1,i=[],a=[];function o(d){if(!r){if(a.length){var p=a.shift();if(Array.isArray(p)&&p[0])return p[0]({value:d,done:!1})}i.push(d)}}function s(d){r=d;var p=a.slice();p.forEach(function(f){f[1](d)}),!e||e()}function u(){n=!0;var d=a.slice();d.forEach(function(p){p[0]({value:void 0,done:!0})}),!e||e()}e=function(){e=null,t.removeListener("data",o),t.removeListener("error",s),t.removeListener("end",u),t.removeListener("finish",u),t.removeListener("close",u)},t.on("data",o),t.on("error",s),t.on("end",u),t.on("finish",u),t.on("close",u);function c(){return new Promise(function(d,p){if(r)return p(r);if(i.length)return d({value:i.shift(),done:!1});if(n)return d({value:void 0,done:!0});a.push([d,p])})}var l={next:function(){return c()}};return _r&&(l[Symbol.asyncIterator]=function(){return this}),l}function mc(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 _r&&(r[Symbol.asyncIterator]=function(){return this}),r}function io(t){var e={next:function(){return t.read()}};return _r&&(e[Symbol.asyncIterator]=function(){return this}),e}function Ml(t){var e=t;if(Pl(t)&&(e=t.body),Rl(e))return dc(e);if(Cl(e))return io(e.getReader());if(Ll(e))return io(e.stream().getReader());if(Fl(e))return mc(e.arrayBuffer());if($l(e))return hc(e);throw new Error("Unknown body type for responseIterator. Please pass a streamable response.")}var jl=Object.prototype.hasOwnProperty;function Ul(t,e){var r,n,i;return Pt(this,void 0,void 0,function(){var a,o,s,u,c,l,d,p,f,h,y,v,E,_,b,g,A,R,T,C;return Ct(this,function(F){switch(F.label){case 0:if(TextDecoder===void 0)throw new Error("TextDecoder must be defined in the environment: please import a polyfill.");a=new TextDecoder("utf-8"),o=(r=t.headers)===null||r===void 0?void 0:r.get("content-type"),s="boundary=",u=o?.includes(s)?o?.substring(o?.indexOf(s)+s.length).replace(/['"]/g,"").replace(/\;(.*)/gm,"").trim():"-",c="--".concat(u),l="",d=Ml(t),p=!0,F.label=1;case 1:return p?[4,d.next()]:[3,3];case 2:for(f=F.sent(),h=f.value,y=f.done,v=typeof h=="string"?h:a.decode(h),p=!y,l+=v,E=l.indexOf(c);E>-1;){if(_=void 0,C=[l.slice(0,E),l.slice(E+c.length)],_=C[0],l=C[1],_.trim()){if(b=_.indexOf(`\r
21
+ }`)}function Se(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";return e!=null&&e!==""?t+e+r:""}function eo(t){return Se(" ",t.replace(/\n/g,`
22
+ `))}function Rh(t){return t.indexOf(`
23
+ `)!==-1}function ml(t){return t!=null&&t.some(Rh)}function Ai(t){return t.kind===Ae.FIELD||t.kind===Ae.FRAGMENT_SPREAD||t.kind===Ae.INLINE_FRAGMENT}function gl(){return typeof Xa=="function"?Bs():Bs()}function Qh(){__DEV__?P(typeof Wr=="boolean",Wr):P(typeof Wr=="boolean",39)}gl();Qh();function nr(t,e){var r=t.directives;return!r||!r.length?!0:yl(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__?P(o!==void 0,"Invalid variable referenced in @".concat(i.name.value," directive.")):P(o!==void 0,40)):o=a.value.value,i.name.value==="skip"?!o:o})}function $n(t,e,r){var n=new Set(t),i=n.size;return Ye(e,{Directive:function(a){if(n.delete(a.name.value)&&(!r||!n.size))return Kr}}),r?!n.size:n.size<i}function Gs(t){return t&&$n(["client","export"],t,!0)}function zh(t){var e=t.name.value;return e==="skip"||e==="include"}function yl(t){var e=[];return t&&t.length&&t.forEach(function(r){if(!!zh(r)){var n=r.arguments,i=r.name.value;__DEV__?P(n&&n.length===1,"Incorrect number of arguments for the @".concat(i," directive.")):P(n&&n.length===1,41);var a=n[0];__DEV__?P(a.name&&a.name.value==="if","Invalid argument for the @".concat(i," directive.")):P(a.name&&a.name.value==="if",42);var o=a.value;__DEV__?P(o&&(o.kind==="Variable"||o.kind==="BooleanValue"),"Argument for the @".concat(i," directive must be a variable or a boolean value.")):P(o&&(o.kind==="Variable"||o.kind==="BooleanValue"),43),e.push({directive:r,ifArgument:a})}}),e}function Ws(t,e){var r=e,n=[];t.definitions.forEach(function(a){if(a.kind==="OperationDefinition")throw __DEV__?new Q("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 Q(44);a.kind==="FragmentDefinition"&&n.push(a)}),typeof r>"u"&&(__DEV__?P(n.length===1,"Found ".concat(n.length," fragments. `fragmentName` must be provided when there is not exactly 1 fragment.")):P(n.length===1,45),r=n[0].name.value);var i=w(w({},t),{definitions:yr([{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:r}}]}}],t.definitions,!0)});return i}function Hr(t){t===void 0&&(t=[]);var e={};return t.forEach(function(r){e[r.name.value]=r}),e}function Jr(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__?P(n,"No fragment named ".concat(r)):P(n,46),n||null}default:return null}}function ie(t){return t!==null&&typeof t=="object"}function Vt(t){return{__ref:String(t)}}function X(t){return Boolean(t&&typeof t=="object"&&typeof t.__ref=="string")}function Ks(t){return ie(t)&&t.kind==="Document"&&Array.isArray(t.definitions)}function Gh(t){return t.kind==="StringValue"}function Wh(t){return t.kind==="BooleanValue"}function Kh(t){return t.kind==="IntValue"}function Hh(t){return t.kind==="FloatValue"}function Jh(t){return t.kind==="Variable"}function Yh(t){return t.kind==="ObjectValue"}function Zh(t){return t.kind==="ListValue"}function Xh(t){return t.kind==="EnumValue"}function em(t){return t.kind==="NullValue"}function br(t,e,r,n){if(Kh(r)||Hh(r))t[e.value]=Number(r.value);else if(Wh(r)||Gh(r))t[e.value]=r.value;else if(Yh(r)){var i={};r.fields.map(function(o){return br(i,o.name,o.value,n)}),t[e.value]=i}else if(Jh(r)){var a=(n||{})[r.name.value];t[e.value]=a}else if(Zh(r))t[e.value]=r.values.map(function(o){var s={};return br(s,e,o,n),s[e.value]});else if(Xh(r))t[e.value]=r.value;else if(em(r))t[e.value]=null;else throw __DEV__?new Q('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 Q(55)}function Hs(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 br(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 br(n,a,o,e)})),Ni(t.name.value,n,r)}var tm=["connection","include","skip","client","rest","export"],Ni=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(Di(i),")")}else return r.connection.key;var a=t;if(e){var o=Di(e);a+="(".concat(o,")")}return r&&Object.keys(r).forEach(function(s){tm.indexOf(s)===-1&&(r[s]&&Object.keys(r[s]).length?a+="@".concat(s,"(").concat(Di(r[s]),")"):a+="@".concat(s))}),a},{setStringify:function(t){var e=Di;return Di=t,e}}),Di=function(e){return JSON.stringify(e,rm)};function rm(t,e){return ie(e)&&!Array.isArray(e)&&(e=Object.keys(e).sort().reduce(function(r,n){return r[n]=e[n],r},{})),e}function ir(t,e){if(t.arguments&&t.arguments.length){var r={};return t.arguments.forEach(function(n){var i=n.name,a=n.value;return br(r,i,a,e)}),r}return null}function It(t){return t.alias?t.alias.value:t.name.value}function Pi(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(mt(a)){if(a.name.value==="__typename")return t[It(a)]}else{var o=Pi(t,Jr(a,r).selectionSet,r);if(typeof o=="string")return o}}}function mt(t){return t.kind==="Field"}function Js(t){return t.kind==="InlineFragment"}function Mn(t){__DEV__?P(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'):P(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 Q('Schema type definitions not allowed in queries. Found: "'.concat(r.kind,'"')):new Q(48);return r});return __DEV__?P(e.length<=1,"Ambiguous GraphQL document: contains ".concat(e.length," operations")):P(e.length<=1,49),t}function Qt(t){return Mn(t),t.definitions.filter(function(e){return e.kind==="OperationDefinition"})[0]}function Un(t){return t.definitions.filter(function(e){return e.kind==="OperationDefinition"&&!!e.name}).map(function(e){return e.name.value})[0]||null}function Yr(t){return t.definitions.filter(function(e){return e.kind==="FragmentDefinition"})}function Ci(t){var e=Qt(t);return __DEV__?P(e&&e.operation==="query","Must contain a query definition."):P(e&&e.operation==="query",50),e}function Ys(t){__DEV__?P(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'):P(t.kind==="Document",51),__DEV__?P(t.definitions.length<=1,"Fragment must have exactly one definition."):P(t.definitions.length<=1,52);var e=t.definitions[0];return __DEV__?P(e.kind==="FragmentDefinition","Must be a fragment definition."):P(e.kind==="FragmentDefinition",53),e}function Zr(t){Mn(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 Q("Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment."):new Q(54)}function Xr(t){var e=Object.create(null),r=t&&t.variableDefinitions;return r&&r.length&&r.forEach(function(n){n.defaultValue&&br(e,n.variable.name,n.defaultValue)}),e}var fe=Array.isArray;function Re(t){return Array.isArray(t)&&t.length>0}var vl={kind:Ae.FIELD,name:{kind:Ae.NAME,value:"__typename"}};function _l(t,e){return!t||t.selectionSet.selections.every(function(r){return r.kind===Ae.FRAGMENT_SPREAD&&_l(e[r.name.value],e)})}function nm(t){return _l(Qt(t)||Ys(t),Hr(Yr(t)))?null:t}function im(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 bl(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 Zs(t,e){for(var r=bl(""),n=bl(""),i=function(S){for(var _=0,g=void 0;_<S.length&&(g=S[_]);++_)if(!fe(g)){if(g.kind===Ae.OPERATION_DEFINITION)return r(g.name&&g.name.value);if(g.kind===Ae.FRAGMENT_DEFINITION)return n(g.name.value)}return __DEV__&&P.error("Could not find operation or fragment"),null},a=0,o=e.definitions.length-1;o>=0;--o)e.definitions[o].kind===Ae.OPERATION_DEFINITION&&++a;var s=im(t),u=t.some(function(S){return S.remove}),c=function(S){return u&&S&&S.some(s)},l=new Map,d=!1,p={enter:function(S){if(c(S.directives))return d=!0,null}},f=Ye(e,{Field:p,InlineFragment:p,VariableDefinition:{enter:function(){return!1}},Variable:{enter:function(S,_,g,A,R){var T=i(R);T&&T.variables.add(S.name.value)}},FragmentSpread:{enter:function(S,_,g,A,R){if(c(S.directives))return d=!0,null;var T=i(R);T&&T.fragmentSpreads.add(S.name.value)}},FragmentDefinition:{enter:function(S,_,g,A){l.set(JSON.stringify(A),S)},leave:function(S,_,g,A){var R=l.get(JSON.stringify(A));if(S===R)return S;if(a>0&&S.selectionSet.selections.every(function(T){return T.kind===Ae.FIELD&&T.name.value==="__typename"}))return n(S.name.value).removed=!0,d=!0,null}},Directive:{leave:function(S){if(s(S))return d=!0,null}}});if(!d)return e;var m=function(S){return S.transitiveVars||(S.transitiveVars=new Set(S.variables),S.removed||S.fragmentSpreads.forEach(function(_){m(n(_)).transitiveVars.forEach(function(g){S.transitiveVars.add(g)})})),S},y=new Set;f.definitions.forEach(function(S){S.kind===Ae.OPERATION_DEFINITION?m(r(S.name&&S.name.value)).fragmentSpreads.forEach(function(_){y.add(_)}):S.kind===Ae.FRAGMENT_DEFINITION&&a===0&&!n(S.name.value).removed&&y.add(S.name.value)}),y.forEach(function(S){m(n(S)).fragmentSpreads.forEach(function(_){y.add(_)})});var b=function(S){return!!(!y.has(S)||n(S).removed)},E={enter:function(S){if(b(S.name.value))return null}};return nm(Ye(f,{FragmentSpread:E,FragmentDefinition:E,OperationDefinition:{leave:function(S){if(S.variableDefinitions){var _=m(r(S.name&&S.name.value)).transitiveVars;if(_.size<S.variableDefinitions.length)return w(w({},S),{variableDefinitions:S.variableDefinitions.filter(function(g){return _.has(g.variable.name.value)})})}}}}))}var en=Object.assign(function(t){return Ye(t,{SelectionSet:{enter:function(e,r,n){if(!(n&&n.kind===Ae.OPERATION_DEFINITION)){var i=e.selections;if(!!i){var a=i.some(function(s){return mt(s)&&(s.name.value==="__typename"||s.name.value.lastIndexOf("__",0)===0)});if(!a){var o=n;if(!(mt(o)&&o.directives&&o.directives.some(function(s){return s.name.value==="export"})))return w(w({},e),{selections:yr(yr([],i,!0),[vl],!1)})}}}}}})},{added:function(t){return t===vl}}),am={test:function(t){var e=t.name.value==="connection";return e&&(!t.arguments||!t.arguments.some(function(r){return r.name.value==="key"}))&&__DEV__&&P.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 Xs(t){return Zs([am],Mn(t))}function ec(t){var e=Zr(t),r=e.operation;if(r==="query")return t;var n=Ye(t,{OperationDefinition:{enter:function(i){return w(w({},i),{operation:"query"})}}});return n}function tc(t){Mn(t);var e=Zs([{test:function(r){return r.name.value==="client"},remove:!0}],t);return e}var om=Object.prototype.hasOwnProperty;function rc(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Ri(t)}function Ri(t){var e=t[0]||{},r=t.length;if(r>1)for(var n=new st,i=1;i<r;++i)e=n.merge(e,t[i]);return e}var sm=function(t,e,r){return this.merge(t[r],e[r])},st=function(){function t(e){e===void 0&&(e=sm),this.reconciler=e,this.isObject=ie,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 ie(r)&&ie(e)?(Object.keys(r).forEach(function(o){if(om.call(e,o)){var s=e[o];if(r[o]!==s){var u=n.reconciler.apply(n,yr([e,r,o],i,!1));u!==s&&(e=n.shallowCopyForMerge(e),e[o]=u)}}else e=n.shallowCopyForMerge(e),e[o]=r[o]}),e):r},t.prototype.shallowCopyForMerge=function(e){return ie(e)&&(this.pastCopies.has(e)||(Array.isArray(e)?e=e.slice(0):e=w({__proto__:Object.getPrototypeOf(e)},e),this.pastCopies.add(e))),e},t}();function cm(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=um(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 um(t,e){if(!!t){if(typeof t=="string")return Sl(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 Sl(t,e)}}function Sl(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 wl(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 oc(t,e,r){return e&&wl(t.prototype,e),r&&wl(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}var sc=function(){return typeof Symbol=="function"},cc=function(t){return sc()&&Boolean(Symbol[t])},uc=function(t){return cc(t)?Symbol[t]:"@@"+t};sc()&&!cc("observable")&&(Symbol.observable=Symbol("observable"));var lm=uc("iterator"),ic=uc("observable"),El=uc("species");function ro(t,e){var r=t[e];if(r!=null){if(typeof r!="function")throw new TypeError(r+" is not a function");return r}}function Li(t){var e=t.constructor;return e!==void 0&&(e=e[El],e===null&&(e=void 0)),e!==void 0?e:Z}function fm(t){return t instanceof Z}function jn(t){jn.log?jn.log(t):setTimeout(function(){throw t})}function to(t){Promise.resolve().then(function(){try{t()}catch(e){jn(e)}})}function xl(t){var e=t._cleanup;if(e!==void 0&&(t._cleanup=void 0,!!e))try{if(typeof e=="function")e();else{var r=ro(e,"unsubscribe");r&&r.call(e)}}catch(n){jn(n)}}function ac(t){t._observer=void 0,t._queue=void 0,t._state="closed"}function pm(t){var e=t._queue;if(!!e){t._queue=void 0,t._state="ready";for(var r=0;r<e.length&&(Il(t,e[r].type,e[r].value),t._state!=="closed");++r);}}function Il(t,e,r){t._state="running";var n=t._observer;try{var i=ro(n,e);switch(e){case"next":i&&i.call(n,r);break;case"error":if(ac(t),i)i.call(n,r);else throw r;break;case"complete":ac(t),i&&i.call(n);break}}catch(a){jn(a)}t._state==="closed"?xl(t):t._state==="running"&&(t._state="ready")}function nc(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}],to(function(){return pm(t)});return}Il(t,e,r)}}var dm=function(){function t(r,n){this._cleanup=void 0,this._observer=r,this._queue=void 0,this._state="initializing";var i=new hm(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"&&(ac(this),xl(this))},oc(t,[{key:"closed",get:function(){return this._state==="closed"}}]),t}(),hm=function(){function t(r){this._subscription=r}var e=t.prototype;return e.next=function(n){nc(this._subscription,"next",n)},e.error=function(n){nc(this._subscription,"error",n)},e.complete=function(){nc(this._subscription,"complete")},oc(t,[{key:"closed",get:function(){return this._subscription._state==="closed"}}]),t}(),Z=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 dm(n,this._subscriber)},e.forEach=function(n){var i=this;return new Promise(function(a,o){if(typeof n!="function"){o(new TypeError(n+" is not a function"));return}function s(){u.unsubscribe(),a()}var u=i.subscribe({next:function(c){try{n(c,s)}catch(l){o(l),u.unsubscribe()}},error:o,complete:a})})},e.map=function(n){var i=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var a=Li(this);return new a(function(o){return i.subscribe({next:function(s){try{s=n(s)}catch(u){return o.error(u)}o.next(s)},error:function(s){o.error(s)},complete:function(){o.complete()}})})},e.filter=function(n){var i=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var a=Li(this);return new a(function(o){return i.subscribe({next:function(s){try{if(!n(s))return}catch(u){return o.error(u)}o.next(s)},error:function(s){o.error(s)},complete:function(){o.complete()}})})},e.reduce=function(n){var i=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var a=Li(this),o=arguments.length>1,s=!1,u=arguments[1],c=u;return new a(function(l){return i.subscribe({next:function(d){var p=!s;if(s=!0,!p||o)try{c=n(c,d)}catch(f){return l.error(f)}else c=d},error:function(d){l.error(d)},complete:function(){if(!s&&!o)return l.error(new TypeError("Cannot reduce an empty sequence"));l.next(c),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=Li(this);return new s(function(u){var c,l=0;function d(p){c=p.subscribe({next:function(f){u.next(f)},error:function(f){u.error(f)},complete:function(){l===a.length?(c=void 0,u.complete()):d(s.from(a[l++]))}})}return d(n),function(){c&&(c.unsubscribe(),c=void 0)}})},e.flatMap=function(n){var i=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var a=Li(this);return new a(function(o){var s=[],u=i.subscribe({next:function(l){if(n)try{l=n(l)}catch(p){return o.error(p)}var d=a.from(l).subscribe({next:function(p){o.next(p)},error:function(p){o.error(p)},complete:function(){var p=s.indexOf(d);p>=0&&s.splice(p,1),c()}});s.push(d)},error:function(l){o.error(l)},complete:function(){c()}});function c(){u.closed&&s.length===0&&o.complete()}return function(){s.forEach(function(l){return l.unsubscribe()}),u.unsubscribe()}})},e[ic]=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=ro(n,ic);if(a){var o=a.call(n);if(Object(o)!==o)throw new TypeError(o+" is not an object");return fm(o)&&o.constructor===i?o:new i(function(s){return o.subscribe(s)})}if(cc("iterator")&&(a=ro(n,lm),a))return new i(function(s){to(function(){if(!s.closed){for(var u=cm(a.call(n)),c;!(c=u()).done;){var l=c.value;if(s.next(l),s.closed)return}s.complete()}})});if(Array.isArray(n))return new i(function(s){to(function(){if(!s.closed){for(var u=0;u<n.length;++u)if(s.next(n[u]),s.closed)return;s.complete()}})});throw new TypeError(n+" is not observable")},t.of=function(){for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];var o=typeof this=="function"?this:t;return new o(function(s){to(function(){if(!s.closed){for(var u=0;u<i.length;++u)if(s.next(i[u]),s.closed)return;s.complete()}})})},oc(t,null,[{key:El,get:function(){return this}}]),t}();sc()&&Object.defineProperty(Z,Symbol("extensions"),{value:{symbol:ic,hostReportError:jn},configurable:!0});function lc(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 qn;typeof self<"u"?qn=self:typeof window<"u"?qn=window:typeof global<"u"?qn=global:typeof module<"u"?qn=module:qn=Function("return this")();var _S=lc(qn);var Tl=Z.prototype,kl="@@observable";Tl[kl]||(Tl[kl]=function(){return this});var mm=Object.prototype.toString;function no(t){return fc(t)}function fc(t,e){switch(mm.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]=fc(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]=fc(t[i],e)}),n}default:return t}}function gm(t){var e=new Set([t]);return e.forEach(function(r){ie(r)&&ym(r)===r&&Object.getOwnPropertyNames(r).forEach(function(n){ie(r[n])&&e.add(r[n])})}),t}function ym(t){if(__DEV__&&!Object.isFrozen(t))try{Object.freeze(t)}catch(e){if(e instanceof TypeError)return null;throw e}return t}function Fi(t){return __DEV__&&gm(t),t}function tn(t,e,r){var n=[];t.forEach(function(i){return i[e]&&n.push(i)}),n.forEach(function(i){return i[e](r)})}function io(t,e,r){return new Z(function(n){var i=n.next,a=n.error,o=n.complete,s=0,u=!1,c={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)};c=c.then(b,b).then(function(E){--s,i&&i.call(n,E),u&&d.complete()},function(E){throw--s,E}).catch(function(E){a&&a.call(n,E)})}:function(y){return m&&m.call(n,y)}}var d={next:l(e,i),error:l(r,a),complete:function(){u=!0,s||o&&o.call(n)}},p=t.subscribe(d);return function(){return p.unsubscribe()}})}var Tt=typeof WeakMap=="function"&&Ue(function(){return navigator.product})!=="ReactNative",Ol=typeof WeakSet=="function",pc=typeof Symbol=="function"&&typeof Symbol.for=="function",_r=pc&&Symbol.asyncIterator,CS=typeof Ue(function(){return window.document.createElement})=="function",RS=Ue(function(){return navigator.userAgent.indexOf("jsdom")>=0})||!1;function ao(t){function e(r){Object.defineProperty(t,r,{value:Z})}return pc&&Symbol.species&&e(Symbol.species),e("@@species"),t}function Al(t){return t&&typeof t.then=="function"}var Bn=function(t){xe(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),tn(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),tn(n.observers,"error",i))},complete:function(){var i=n,a=i.sub,o=i.sources,s=o===void 0?[]:o;if(a!==null){var u=s.shift();u?Al(u)?u.then(function(c){return n.sub=c.subscribe(n.handlers)}):n.sub=u.subscribe(n.handlers):(a&&setTimeout(function(){return a.unsubscribe()}),n.sub=null,n.latest&&n.latest[0]==="next"?n.resolve(n.latest[1]):n.resolve(),n.notify("complete"),tn(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 Z(r)]),Al(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}(Z);ao(Bn);function Sr(t){return"incremental"in t}function vm(t){return"hasNext"in t&&"data"in t}function Dl(t){return Sr(t)||vm(t)}function oo(t,e){var r=t,n=new st;return Sr(e)&&Re(e.incremental)&&e.incremental.forEach(function(i){for(var a=i.data,o=i.path,s=o.length-1;s>=0;--s){var u=o[s],c=!isNaN(+u),l=c?[]:{};l[u]=a,a=l}r=n.merge(r,a)}),r}function Vn(t){var e=so(t);return Re(e)}function so(t){var e=Re(t.errors)?t.errors.slice(0):[];return Sr(t)&&Re(t.incremental)&&t.incremental.forEach(function(r){r.errors&&e.push.apply(e,r.errors)}),e}function wr(){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 Nl=new Map;function $i(t){var e=Nl.get(t)||1;return Nl.set(t,e+1),"".concat(t,":").concat(e,":").concat(Math.random().toString(36).slice(2))}function Pl(t){var e=$i("stringifyForDisplay");return JSON.stringify(t,function(r,n){return n===void 0?e:n}).split(JSON.stringify(e)).join("<undefined>")}function Mi(t,e){return wr(t,e,e.variables&&{variables:w(w({},t&&t.variables),e.variables)})}function co(t){return new Z(function(e){e.error(t)})}var Ui=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 dc(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 Q("illegal argument: ".concat(i)):new Q(27)}return t}function hc(t,e){var r=w({},t),n=function(a){typeof a=="function"?r=w(w({},r),a(r)):r=w(w({},r),a)},i=function(){return w({},r)};return Object.defineProperty(e,"setContext",{enumerable:!1,value:n}),Object.defineProperty(e,"getContext",{enumerable:!1,value:i}),e}function mc(t){var e={variables:t.variables||{},extensions:t.extensions||{},operationName:t.operationName,query:t.query};return e.operationName||(e.operationName=typeof e.query!="string"?Un(e.query)||void 0:""),e}function Cl(t,e){return e?e(t):Z.of()}function ji(t){return typeof t=="function"?new kt(t):t}function uo(t){return t.request.length<=1}var bm=function(t){xe(e,t);function e(r,n){var i=t.call(this,r)||this;return i.link=n,i}return e}(Error),kt=function(){function t(e){e&&(this.request=e)}return t.empty=function(){return new t(function(){return Z.of()})},t.from=function(e){return e.length===0?t.empty():e.map(ji).reduce(function(r,n){return r.concat(n)})},t.split=function(e,r,n){var i=ji(r),a=ji(n||new t(Cl));return uo(i)&&uo(a)?new t(function(o){return e(o)?i.request(o)||Z.of():a.request(o)||Z.of()}):new t(function(o,s){return e(o)?i.request(o,s)||Z.of():a.request(o,s)||Z.of()})},t.execute=function(e,r){return e.request(hc(r.context,mc(dc(r))))||Z.of()},t.concat=function(e,r){var n=ji(e);if(uo(n))return __DEV__&&P.warn(new bm("You are calling concat on a terminating link, which will have no effect",n)),n;var i=ji(r);return uo(i)?new t(function(a){return n.request(a,function(o){return i.request(o)||Z.of()})||Z.of()}):new t(function(a,o){return n.request(a,function(s){return i.request(s,o)||Z.of()})||Z.of()})},t.prototype.split=function(e,r,n){return this.concat(t.split(e,r,n||new t(Cl)))},t.prototype.concat=function(e){return t.concat(this,e)},t.prototype.request=function(e,r){throw __DEV__?new Q("request is not implemented"):new Q(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 Qn=kt.execute;var Rl="3.7.10";function Ll(t){return!!t.body}function Fl(t){return!!t.getReader}function $l(t){return!!(_r&&t[Symbol.asyncIterator])}function Ml(t){return!!t.stream}function Ul(t){return!!t.arrayBuffer}function jl(t){return!!t.pipe}function gc(t){var e,r=t[Symbol.asyncIterator]();return e={next:function(){return r.next()}},e[Symbol.asyncIterator]=function(){return this},e}function yc(t){var e=null,r=null,n=!1,i=[],a=[];function o(d){if(!r){if(a.length){var p=a.shift();if(Array.isArray(p)&&p[0])return p[0]({value:d,done:!1})}i.push(d)}}function s(d){r=d;var p=a.slice();p.forEach(function(f){f[1](d)}),!e||e()}function u(){n=!0;var d=a.slice();d.forEach(function(p){p[0]({value:void 0,done:!0})}),!e||e()}e=function(){e=null,t.removeListener("data",o),t.removeListener("error",s),t.removeListener("end",u),t.removeListener("finish",u),t.removeListener("close",u)},t.on("data",o),t.on("error",s),t.on("end",u),t.on("finish",u),t.on("close",u);function c(){return new Promise(function(d,p){if(r)return p(r);if(i.length)return d({value:i.shift(),done:!1});if(n)return d({value:void 0,done:!0});a.push([d,p])})}var l={next:function(){return c()}};return _r&&(l[Symbol.asyncIterator]=function(){return this}),l}function vc(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 _r&&(r[Symbol.asyncIterator]=function(){return this}),r}function lo(t){var e={next:function(){return t.read()}};return _r&&(e[Symbol.asyncIterator]=function(){return this}),e}function ql(t){var e=t;if(Ll(t)&&(e=t.body),$l(e))return gc(e);if(Fl(e))return lo(e.getReader());if(Ml(e))return lo(e.stream().getReader());if(Ul(e))return vc(e.arrayBuffer());if(jl(e))return yc(e);throw new Error("Unknown body type for responseIterator. Please pass a streamable response.")}var Bl=Object.prototype.hasOwnProperty;function Vl(t,e){var r,n,i;return Ct(this,void 0,void 0,function(){var a,o,s,u,c,l,d,p,f,m,y,b,E,S,_,g,A,R,T,C;return Rt(this,function(F){switch(F.label){case 0:if(TextDecoder===void 0)throw new Error("TextDecoder must be defined in the environment: please import a polyfill.");a=new TextDecoder("utf-8"),o=(r=t.headers)===null||r===void 0?void 0:r.get("content-type"),s="boundary=",u=o?.includes(s)?o?.substring(o?.indexOf(s)+s.length).replace(/['"]/g,"").replace(/\;(.*)/gm,"").trim():"-",c="--".concat(u),l="",d=ql(t),p=!0,F.label=1;case 1:return p?[4,d.next()]:[3,3];case 2:for(f=F.sent(),m=f.value,y=f.done,b=typeof m=="string"?m:a.decode(m),p=!y,l+=b,E=l.indexOf(c);E>-1;){if(S=void 0,C=[l.slice(0,E),l.slice(E+c.length)],S=C[0],l=C[1],S.trim()){if(_=S.indexOf(`\r
25
25
  \r
26
- `),g=vm(_.slice(0,b)),A=g["content-type"],A&&A.toLowerCase().indexOf("application/json")===-1)throw new Error("Unsupported patch content type: application/json is required.");R=_.slice(b);try{T=ql(t,R.replace(`\r
27
- `,"")),(Object.keys(T).length>1||"data"in T||"incremental"in T||"errors"in T)&&((n=e.next)===null||n===void 0||n.call(e,T))}catch(L){ao(L,e)}}E=l.indexOf(c)}return[3,1];case 3:return(i=e.complete)===null||i===void 0||i.call(e),[2]}})})}function vm(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 ql(t,e){if(t.status>=300){var r=function(){try{return JSON.parse(e)}catch{return e}};Mi(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 ao(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 Bl(t,e,r){bm(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 ao(n,r)})}function bm(t){return function(e){return e.text().then(function(r){return ql(e,r)}).then(function(r){return e.status>=300&&Mi(e,r,"Response not successful: Received status code ".concat(e.status)),!Array.isArray(r)&&!jl.call(r,"data")&&!jl.call(r,"errors")&&Mi(e,r,"Server response was missing for query '".concat(Array.isArray(t)?t.map(function(n){return n.operationName}):t.operationName,"'.")),r})}}var Ui=function(t,e){var r;try{r=JSON.stringify(t)}catch(i){var n=__DEV__?new V("Network request failed. ".concat(e," is not serializable: ").concat(i.message)):new V(24);throw n.parseError=i,n}return r};var _m={includeQuery:!0,includeExtensions:!1,preserveHeaderCase:!1},wm={accept:"*/*","content-type":"application/json"},Sm={method:"POST"},Vl={http:_m,headers:wm,options:Sm},Ql=function(t,e){return e(t)};function zl(t,e){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var i={},a={};r.forEach(function(d){i=w(w(w({},i),d.options),{headers:w(w({},i.headers),d.headers)}),d.credentials&&(i.credentials=d.credentials),a=w(w({},a),d.http)}),i.headers&&(i.headers=Em(i.headers,a.preserveHeaderCase));var o=t.operationName,s=t.extensions,u=t.variables,c=t.query,l={operationName:o,variables:u};return a.includeExtensions&&(l.extensions=s),a.includeQuery&&(l.query=e(c,Fn)),{options:i,body:l}}function Em(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 Gl=function(t){if(!t&&typeof fetch>"u")throw __DEV__?new V(`
26
+ `),g=_m(S.slice(0,_)),A=g["content-type"],A&&A.toLowerCase().indexOf("application/json")===-1)throw new Error("Unsupported patch content type: application/json is required.");R=S.slice(_);try{T=Ql(t,R.replace(`\r
27
+ `,"")),(Object.keys(T).length>1||"data"in T||"incremental"in T||"errors"in T)&&((n=e.next)===null||n===void 0||n.call(e,T))}catch(L){fo(L,e)}}E=l.indexOf(c)}return[3,1];case 3:return(i=e.complete)===null||i===void 0||i.call(e),[2]}})})}function _m(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 Ql(t,e){if(t.status>=300){var r=function(){try{return JSON.parse(e)}catch{return e}};Ui(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 fo(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 zl(t,e,r){Sm(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 fo(n,r)})}function Sm(t){return function(e){return e.text().then(function(r){return Ql(e,r)}).then(function(r){return e.status>=300&&Ui(e,r,"Response not successful: Received status code ".concat(e.status)),!Array.isArray(r)&&!Bl.call(r,"data")&&!Bl.call(r,"errors")&&Ui(e,r,"Server response was missing for query '".concat(Array.isArray(t)?t.map(function(n){return n.operationName}):t.operationName,"'.")),r})}}var qi=function(t,e){var r;try{r=JSON.stringify(t)}catch(i){var n=__DEV__?new Q("Network request failed. ".concat(e," is not serializable: ").concat(i.message)):new Q(24);throw n.parseError=i,n}return r};var wm={includeQuery:!0,includeExtensions:!1,preserveHeaderCase:!1},Em={accept:"*/*","content-type":"application/json"},xm={method:"POST"},Gl={http:wm,headers:Em,options:xm},Wl=function(t,e){return e(t)};function Kl(t,e){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var i={},a={};r.forEach(function(d){i=w(w(w({},i),d.options),{headers:w(w({},i.headers),d.headers)}),d.credentials&&(i.credentials=d.credentials),a=w(w({},a),d.http)}),i.headers&&(i.headers=Im(i.headers,a.preserveHeaderCase));var o=t.operationName,s=t.extensions,u=t.variables,c=t.query,l={operationName:o,variables:u};return a.includeExtensions&&(l.extensions=s),a.includeQuery&&(l.query=e(c,Fn)),{options:i,body:l}}function Im(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 Hl=function(t){if(!t&&typeof fetch>"u")throw __DEV__?new Q(`
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 V(23)};var Wl=function(){if(typeof AbortController>"u")return{controller:!1,signal:!1};var t=new AbortController,e=t.signal;return{controller:t,signal:e}};var Kl=function(t,e){var r=t.getContext(),n=r.uri;return n||(typeof e=="function"?e(t):e||"/graphql")};function Hl(t,e){var r=[],n=function(d,p){r.push("".concat(d,"=").concat(encodeURIComponent(p)))};if("query"in e&&n("query",e.query),e.operationName&&n("operationName",e.operationName),e.variables){var i=void 0;try{i=Ui(e.variables,"Variables map")}catch(d){return{parseError:d}}n("variables",i)}if(e.extensions){var a=void 0;try{a=Ui(e.extensions,"Extensions map")}catch(d){return{parseError:d}}n("extensions",a)}var o="",s=t,u=t.indexOf("#");u!==-1&&(o=t.substr(u),s=t.substr(0,u));var c=s.indexOf("?")===-1?"?":"&",l=s+c+r.join("&")+o;return{newURI:l}}var Jl=je(function(){return fetch}),Yl=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?Ql:i,o=t.includeExtensions,s=t.preserveHeaderCase,u=t.useGETForQueries,c=t.includeUnusedVariables,l=c===void 0?!1:c,d=Bt(t,["uri","fetch","print","includeExtensions","preserveHeaderCase","useGETForQueries","includeUnusedVariables"]);__DEV__&&Gl(n||Jl);var p={http:{includeExtensions:o,preserveHeaderCase:s},options:d.fetchOptions,credentials:d.credentials,headers:d.headers};return new Tt(function(f){var h=Kl(f,r),y=f.getContext(),v={};if(y.clientAwareness){var E=y.clientAwareness,_=E.name,b=E.version;_&&(v["apollographql-client-name"]=_),b&&(v["apollographql-client-version"]=b)}var g=w(w({},v),y.headers),A={http:y.http,options:y.fetchOptions,credentials:y.credentials,headers:g},R=zl(f,a,Vl,p,A),T=R.options,C=R.body;if(C.variables&&!l){var F=new Set(Object.keys(C.variables));Je(f.query,{Variable:function(ne,Ut,H){H&&H.kind!=="VariableDefinition"&&F.delete(ne.name.value)}}),F.size&&(C.variables=w({},C.variables),F.forEach(function(ne){delete C.variables[ne]}))}var L;if(!T.signal){var q=Wl(),Ve=q.controller,Pe=q.signal;L=Ve,L&&(T.signal=Pe)}var B=function(ne){return ne.kind==="OperationDefinition"&&ne.operation==="mutation"};if(u&&!f.query.definitions.some(B)&&(T.method="GET"),$n(["defer"],f.query)&&(T.headers=T.headers||{},T.headers.accept="multipart/mixed; deferSpec=20220824, application/json"),T.method==="GET"){var he=Hl(h,C),me=he.newURI,re=he.parseError;if(re)return ro(re);h=me}else try{T.body=Ui(C,"Payload")}catch(ne){return ro(ne)}return new J(function(ne){var Ut=n||je(function(){return fetch})||Jl;return Ut(h,T).then(function(H){var qt;f.setContext({response:H});var yr=(qt=H.headers)===null||qt===void 0?void 0:qt.get("content-type");return yr!==null&&/^multipart\/mixed/i.test(yr)?Ul(H,ne):Bl(H,f,ne)}).catch(function(H){return ao(H,ne)}),function(){L&&L.abort()}})})};var yc=function(t){xe(e,t);function e(r){r===void 0&&(r={});var n=t.call(this,Yl(r).request)||this;return n.options=r,n}return e}(Tt);var{toString:Zl,hasOwnProperty:xm}=Object.prototype,Xl=Function.prototype.toString,gc=new Map;function ve(t,e){try{return vc(t,e)}finally{gc.clear()}}function vc(t,e){if(t===e)return!0;let r=Zl.call(t),n=Zl.call(e);if(r!==n)return!1;switch(r){case"[object Array]":if(t.length!==e.length)return!1;case"[object Object]":{if(tf(t,e))return!0;let i=ef(t),a=ef(e),o=i.length;if(o!==a.length)return!1;for(let s=0;s<o;++s)if(!xm.call(e,i[s]))return!1;for(let s=0;s<o;++s){let u=i[s];if(!vc(t[u],e[u]))return!1}return!0}case"[object Error]":return t.name===e.name&&t.message===e.message;case"[object Number]":if(t!==t)return e!==e;case"[object Boolean]":case"[object Date]":return+t==+e;case"[object RegExp]":case"[object String]":return t==`${e}`;case"[object Map]":case"[object Set]":{if(t.size!==e.size)return!1;if(tf(t,e))return!0;let i=t.entries(),a=r==="[object Map]";for(;;){let o=i.next();if(o.done)break;let[s,u]=o.value;if(!e.has(s)||a&&!vc(u,e.get(s)))return!1}return!0}case"[object Uint16Array]":case"[object Uint8Array]":case"[object Uint32Array]":case"[object Int32Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object ArrayBuffer]":t=new Uint8Array(t),e=new Uint8Array(e);case"[object DataView]":{let i=t.byteLength;if(i===e.byteLength)for(;i--&&t[i]===e[i];);return i===-1}case"[object AsyncFunction]":case"[object GeneratorFunction]":case"[object AsyncGeneratorFunction]":case"[object Function]":{let i=Xl.call(t);return i!==Xl.call(e)?!1:!km(i,Tm)}}return!1}function ef(t){return Object.keys(t).filter(Im,t)}function Im(t){return this[t]!==void 0}var Tm="{ [native code] }";function km(t,e){let r=t.length-e.length;return r>=0&&t.indexOf(e,r)===r}function tf(t,e){let r=gc.get(t);if(r){if(r.has(e))return!0}else gc.set(t,r=new Set);return r.add(e),!1}var Om=function(){return Object.create(null)},rf=Array.prototype,Am=rf.forEach,Dm=rf.slice,zt=function(){function t(e,r){e===void 0&&(e=!0),r===void 0&&(r=Om),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 Am.call(e,function(n){return r=r.getChildTrie(n)}),r.data||(r.data=this.makeData(Dm.call(e)))},t.prototype.getChildTrie=function(e){var r=this.weakness&&Nm(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 Nm(t){switch(typeof t){case"object":if(t===null)break;case"function":return!0}return!1}var Ge=null,nf={},Pm=1,Cm=()=>class{constructor(){this.id=["slot",Pm++,Date.now(),Math.random().toString(36).slice(2)].join(":")}hasValue(){for(let e=Ge;e;e=e.parent)if(this.id in e.slots){let r=e.slots[this.id];if(r===nf)break;return e!==Ge&&(Ge.slots[this.id]=r),!0}return Ge&&(Ge.slots[this.id]=nf),!1}getValue(){if(this.hasValue())return Ge.slots[this.id]}withValue(e,r,n,i){let a={__proto__:null,[this.id]:e},o=Ge;Ge={parent:o,slots:a};try{return r.apply(i,n)}finally{Ge=o}}static bind(e){let r=Ge;return function(){let n=Ge;try{return Ge=r,e.apply(this,arguments)}finally{Ge=n}}}static noContext(e,r,n){if(Ge){let i=Ge;try{return Ge=null,e.apply(n,r)}finally{Ge=i}}else return e.apply(n,r)}};function af(t){try{return t()}catch{}}var bc="@wry/context:Slot",Rm=af(()=>globalThis)||af(()=>global)||Object.create(null),of=Rm,zn=of[bc]||Array[bc]||function(t){try{Object.defineProperty(of,bc,{value:t,enumerable:!1,writable:!1,configurable:!0})}finally{return t}}(Cm());var{bind:Lm,noContext:Fm}=zn;function $m(){}var Mm=function(){function t(e,r){e===void 0&&(e=1/0),r===void 0&&(r=$m),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}(),so=new zn,_c,jm=Object.prototype.hasOwnProperty,Sc=(_c=Array.from,_c===void 0?function(t){var e=[];return t.forEach(function(r){return e.push(r)}),e}:_c);function oo(t){var e=t.unsubscribe;typeof e=="function"&&(t.unsubscribe=void 0,e())}var qi=[],Um=100;function Gn(t,e){if(!t)throw new Error(e||"assertion failure")}function qm(t,e){var r=t.length;return r>0&&r===e.length&&t[r-1]===e[r-1]}function cf(t){switch(t.length){case 0:throw new Error("unknown value");case 1:return t[0];case 2:throw t[1]}}function Bm(t){return t.slice(0)}var Vm=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&&!Er(this))return sf(this),this.value[0]},t.prototype.recompute=function(e){return Gn(!this.recomputing,"already recomputing"),sf(this),Er(this)?Qm(this,e):cf(this.value)},t.prototype.setDirty=function(){this.dirty||(this.dirty=!0,this.value.length=0,uf(this),oo(this))},t.prototype.dispose=function(){var e=this;this.setDirty(),hf(this),Ec(this,function(r,n){r.setDirty(),mf(r,e)})},t.prototype.forget=function(){this.dispose()},t.prototype.dependOn=function(e){e.add(this),this.deps||(this.deps=qi.pop()||new Set),this.deps.add(e)},t.prototype.forgetDeps=function(){var e=this;this.deps&&(Sc(this.deps).forEach(function(r){return r.delete(e)}),this.deps.clear(),qi.push(this.deps),this.deps=null)},t.count=0,t}();function sf(t){var e=so.getValue();if(e)return t.parents.add(e),e.childValues.has(t)||e.childValues.set(t,[]),Er(t)?ff(e,t):pf(e,t),e}function Qm(t,e){return hf(t),so.withValue(t,zm,[t,e]),Wm(t,e)&&Gm(t),cf(t.value)}function zm(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 Er(t){return t.dirty||!!(t.dirtyChildren&&t.dirtyChildren.size)}function Gm(t){t.dirty=!1,!Er(t)&&lf(t)}function uf(t){Ec(t,ff)}function lf(t){Ec(t,pf)}function Ec(t,e){var r=t.parents.size;if(r)for(var n=Sc(t.parents),i=0;i<r;++i)e(n[i],t)}function ff(t,e){Gn(t.childValues.has(e)),Gn(Er(e));var r=!Er(t);if(!t.dirtyChildren)t.dirtyChildren=qi.pop()||new Set;else if(t.dirtyChildren.has(e))return;t.dirtyChildren.add(e),r&&uf(t)}function pf(t,e){Gn(t.childValues.has(e)),Gn(!Er(e));var r=t.childValues.get(e);r.length===0?t.childValues.set(e,Bm(e.value)):qm(r,e.value)||t.setDirty(),df(t,e),!Er(t)&&lf(t)}function df(t,e){var r=t.dirtyChildren;r&&(r.delete(e),r.size===0&&(qi.length<Um&&qi.push(r),t.dirtyChildren=null))}function hf(t){t.childValues.size>0&&t.childValues.forEach(function(e,r){mf(t,r)}),t.forgetDeps(),Gn(t.dirtyChildren===null)}function mf(t,e){e.parents.delete(t),t.childValues.delete(e),df(t,e)}function Wm(t,e){if(typeof t.subscribe=="function")try{oo(t),t.unsubscribe=t.subscribe.apply(null,e)}catch{return t.setDirty(),!1}return!0}var Km={setDirty:!0,dispose:!0,forget:!0};function co(t){var e=new Map,r=t&&t.subscribe;function n(i){var a=so.getValue();if(a){var o=e.get(i);o||e.set(i,o=new Set),a.dependOn(o),typeof r=="function"&&(oo(o),o.unsubscribe=r(i))}}return n.dirty=function(a,o){var s=e.get(a);if(s){var u=o&&jm.call(Km,o)?o:"setDirty";Sc(s).forEach(function(c){return c[u]()}),e.delete(a),oo(s)}},n}function yf(){var t=new zt(typeof WeakMap=="function");return function(){return t.lookupArray(arguments)}}var dE=yf(),wc=new Set;function rn(t,e){e===void 0&&(e=Object.create(null));var r=new Mm(e.max||Math.pow(2,16),function(c){return c.dispose()}),n=e.keyArgs,i=e.makeCacheKey||yf(),a=function(){var c=i.apply(null,n?n.apply(null,arguments):arguments);if(c===void 0)return t.apply(null,arguments);var l=r.get(c);l||(r.set(c,l=new Vm(t)),l.subscribe=e.subscribe,l.forget=function(){return r.delete(c)});var d=l.recompute(Array.prototype.slice.call(arguments));return r.set(c,l),wc.add(r),so.hasValue()||(wc.forEach(function(p){return p.clean()}),wc.clear()),d};Object.defineProperty(a,"size",{get:function(){return r.map.size},configurable:!1,enumerable:!1});function o(c){var l=r.get(c);l&&l.setDirty()}a.dirtyKey=o,a.dirty=function(){o(i.apply(null,arguments))};function s(c){var l=r.get(c);if(l)return l.peek()}a.peekKey=s,a.peek=function(){return s(i.apply(null,arguments))};function u(c){return r.delete(c)}return a.forgetKey=u,a.forget=function(){return u(i.apply(null,arguments))},a.makeCacheKey=i,a.getKey=n?function(){return i.apply(null,n.apply(null,arguments))}:i,Object.freeze(a)}var xc=function(){function t(){this.getFragmentDoc=rn(Qs)}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(w(w({},e),{rootId:e.id||"ROOT_QUERY",optimistic:r}))},t.prototype.readFragment=function(e,r){return r===void 0&&(r=!!e.optimistic),this.read(w(w({},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=Bt(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=Bt(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(w(w({},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(w(w({},e),{data:a})),a)}})},t}();var Bi=function(t){xe(e,t);function e(r,n,i,a){var o,s=t.call(this,r)||this;if(s.message=r,s.path=n,s.query=i,s.variables=a,Array.isArray(s.path)){s.missing=s.message;for(var u=s.path.length-1;u>=0;--u)s.missing=(o={},o[s.path[u]]=s.missing,o)}else s.missing=s.path;return s.__proto__=e.prototype,s}return e}(Error);var Ie=Object.prototype.hasOwnProperty;function Vi(t){return t==null}function lo(t,e){var r=t.__typename,n=t.id,i=t._id;if(typeof r=="string"&&(e&&(e.keyObject=Vi(n)?Vi(i)?void 0:{_id:i}:{id:n}),Vi(n)&&!Vi(i)&&(n=i),!Vi(n)))return"".concat(r,":").concat(typeof n=="number"||typeof n=="string"?n:JSON.stringify(n))}var gf={dataIdFromObject:lo,addTypename:!0,resultCaching:!0,canonizeResults:!1};function vf(t){return Sr(gf,t)}function fo(t){var e=t.canonizeResults;return e===void 0?gf.canonizeResults:e}function bf(t,e){return Z(e)?t.get(e.__ref,"__typename"):e&&e.__typename}var Ic=/^[_a-z][_0-9a-z]*/i;function Ft(t){var e=t.match(Ic);return e?e[0]:t}function uo(t,e,r){return ie(e)?le(e)?e.every(function(n){return uo(t,n,r)}):t.selections.every(function(n){if(mt(n)&&nr(n,r)){var i=xt(n);return Ie.call(e,i)&&(!n.selectionSet||uo(n.selectionSet,e[i],r))}return!0}):!1}function xr(t){return ie(t)&&!Z(t)&&!le(t)}function _f(){return new st}function po(t,e){var r=Hr(Yr(t));return{fragmentMap:r,lookupFragment:function(n){var i=r[n];return!i&&e&&(i=e.lookup(n)),i||null}}}var ho=Object.create(null),Tc=function(){return ho},wf=Object.create(null),Wn=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 Li(Z(i)?n.get(i.__ref,a):i&&i[a])},this.canRead=function(i){return Z(i)?n.has(i.__ref):typeof i=="object"},this.toReference=function(i,a){if(typeof i=="string")return Vt(i);if(Z(i))return i;var o=n.policies.identify(i)[0];if(o){var s=Vt(o);return a&&n.merge(o,i),s}}}return t.prototype.toObject=function(){return w({},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),Ie.call(this.data,e)){var n=this.data[e];if(n&&Ie.call(n,r))return n[r]}if(r==="__typename"&&Ie.call(this.policies.rootTypenamesById,e))return this.policies.rootTypenamesById[e];if(this instanceof Ir)return this.parent.get(e,r)},t.prototype.lookup=function(e,r){if(r&&this.group.depend(e,"__exists"),Ie.call(this.data,e))return this.data[e];if(this instanceof Ir)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;Z(e)&&(e=e.__ref),Z(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__?N(typeof i=="string","store.merge expects a string ID"):N(typeof i=="string",1);var s=new st(Jm).merge(a,o);if(this.data[i]=s,s!==a&&(delete this.refs[i],this.group.caching)){var u=Object.create(null);a||(u.__exists=1),Object.keys(o).forEach(function(c){if(!a||a[c]!==s[c]){u[c]=1;var l=Ft(c);l!==c&&!n.policies.hasKeyArgs(s.__typename,l)&&(u[l]=1),s[c]===void 0&&!(n instanceof Ir)&&delete s[c]}}),u.__typename&&!(a&&a.__typename)&&this.policies.rootTypenamesById[i]===s.__typename&&delete u.__typename,Object.keys(u).forEach(function(c){return n.group.dirty(i,c)})}}},t.prototype.modify=function(e,r){var n=this,i=this.lookup(e);if(i){var a=Object.create(null),o=!1,s=!0,u={DELETE:ho,INVALIDATE:wf,isReference:Z,toReference:this.toReference,canRead:this.canRead,readField:function(c,l){return n.policies.readField(typeof c=="string"?{fieldName:c,from:l||Vt(e)}:c,{store:n})}};if(Object.keys(i).forEach(function(c){var l=Ft(c),d=i[c];if(d!==void 0){var p=typeof r=="function"?r:r[c]||r[l];if(p){var f=p===Tc?ho:p(Li(d),w(w({},u),{fieldName:l,storeFieldName:c,storage:n.getStorage(e,c)}));f===wf?n.group.dirty(e,c):(f===ho&&(f=void 0),f!==d&&(a[c]=f,o=!0,d=f))}d!==void 0&&(s=!1)}}),o)return this.merge(e,a),s&&(this instanceof Ir?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]=Tc,i):Tc)}return!1},t.prototype.evict=function(e,r){var n=!1;return e.id&&(Ie.call(this.data,e.id)&&(n=this.delete(e.id,e.fieldName,e.args)),this instanceof Ir&&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){Ie.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&&Ie.call(e,a)||r.delete(a)}),e){var n=e.__META,i=Bt(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 Ir?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){Ie.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 Ir;)a=a.parent;i.forEach(function(o){return a.delete(o)})}return i},t.prototype.findChildRefIds=function(e){if(!Ie.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){Z(a)&&(r[a.__ref]=!0),ie(a)&&Object.keys(a).forEach(function(o){var s=a[o];ie(s)&&i.add(s)})})}return this.refs[e]},t.prototype.makeCacheKey=function(){return this.group.keyMaker.lookupArray(arguments)},t}();var Sf=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?co():null,this.keyMaker=new zt(It)},t.prototype.depend=function(e,r){if(this.d){this.d(kc(e,r));var n=Ft(r);n!==r&&this.d(kc(e,n)),this.parent&&this.parent.depend(e,r)}},t.prototype.dirty=function(e,r){this.d&&this.d.dirty(kc(e,r),r==="__exists"?"forget":"setDirty")},t}();function kc(t,e){return e+"#"+t}function Oc(t,e){nn(t)&&t.group.depend(e,"__exists")}(function(t){var e=function(r){xe(n,r);function n(i){var a=i.policies,o=i.resultCaching,s=o===void 0?!0:o,u=i.seed,c=r.call(this,a,new Sf(s))||this;return c.stump=new Hm(c),c.storageTrie=new zt(It),u&&c.replace(u),c}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})(Wn||(Wn={}));var Ir=function(t){xe(e,t);function e(r,n,i,a){var o=t.call(this,n.policies,a)||this;return o.id=r,o.parent=n,o.replay=i,o.group=a,i(o),o}return e.prototype.addLayer=function(r,n){return new e(r,this,n,this.group)},e.prototype.removeLayer=function(r){var n=this,i=this.parent.removeLayer(r);return r===this.id?(this.group.caching&&Object.keys(this.data).forEach(function(a){var o=n.data[a],s=i.lookup(a);s?o?o!==s&&Object.keys(o).forEach(function(u){ve(o[u],s[u])||n.group.dirty(a,u)}):(n.group.dirty(a,"__exists"),Object.keys(s).forEach(function(u){n.group.dirty(a,u)})):n.delete(a)}),i):i===this.parent?this:i.addLayer(this.id,this.replay)},e.prototype.toObject=function(){return w(w({},this.parent.toObject()),this.data)},e.prototype.findChildRefIds=function(r){var n=this.parent.findChildRefIds(r);return Ie.call(this.data,r)?w(w({},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}(Wn),Hm=function(t){xe(e,t);function e(r){return t.call(this,"EntityStore.Stump",r,function(){},new Sf(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}(Ir);function Jm(t,e,r){var n=t[r],i=e[r];return ve(n,i)?n:i}function nn(t){return!!(t instanceof Wn&&t.group.caching)}function Ym(t){return ie(t)?le(t)?t.slice(0):w({__proto__:Object.getPrototypeOf(t)},t):t}var mo=function(){function t(){this.known=new(Il?WeakSet:Set),this.pool=new zt(It),this.passes=new WeakMap,this.keysByJSON=new Map,this.empty=this.admit({})}return t.prototype.isKnown=function(e){return ie(e)&&this.known.has(e)},t.prototype.pass=function(e){if(ie(e)){var r=Ym(e);return this.passes.set(r,e),r}return e},t.prototype.admit=function(e){var r=this;if(ie(e)){var n=this.passes.get(e);if(n)return n;var i=Object.getPrototypeOf(e);switch(i){case Array.prototype:{if(this.known.has(e))return e;var a=e.map(this.admit,this),o=this.pool.lookupArray(a);return o.array||(this.known.add(o.array=a),__DEV__&&Object.freeze(a)),o.array}case null:case Object.prototype:{if(this.known.has(e))return e;var s=Object.getPrototypeOf(e),u=[s],c=this.sortedKeys(e);u.push(c.json);var l=u.length;c.sorted.forEach(function(f){u.push(r.admit(e[f]))});var o=this.pool.lookupArray(u);if(!o.object){var d=o.object=Object.create(s);this.known.add(d),c.sorted.forEach(function(f,h){d[f]=u[l+h]}),__DEV__&&Object.freeze(d)}return o.object}}}return e},t.prototype.sortedKeys=function(e){var r=Object.keys(e),n=this.pool.lookupArray(r);if(!n.keys){r.sort();var i=JSON.stringify(r);(n.keys=this.keysByJSON.get(i))||this.keysByJSON.set(i,n.keys={sorted:r,json:i})}return n.keys},t}();var yt=Object.assign(function(t){if(ie(t)){Ac===void 0&&Ef();var e=Ac.admit(t),r=Dc.get(e);return r===void 0&&Dc.set(e,r=JSON.stringify(e)),r}return JSON.stringify(t)},{reset:Ef}),Ac,Dc;function Ef(){Ac=new mo,Dc=new(It?WeakMap:Map)}function xf(t){return[t.selectionSet,t.objectOrReference,t.context,t.context.canonizeResults]}var If=function(){function t(e){var r=this;this.knownResults=new(It?WeakMap:Map),this.config=Sr(e,{addTypename:e.addTypename!==!1,canonizeResults:fo(e)}),this.canon=e.canon||new mo,this.executeSelectionSet=rn(function(n){var i,a=n.context.canonizeResults,o=xf(n);o[3]=!a;var s=(i=r.executeSelectionSet).peek.apply(i,o);return s?a?w(w({},s),{result:r.canon.admit(s.result)}):s:(Oc(n.context.store,n.enclosingRef.__ref),r.execSelectionSetImpl(n))},{max:this.config.resultCacheMaxSize,keyArgs:xf,makeCacheKey:function(n,i,a,o){if(nn(a.store))return a.store.makeCacheKey(n,Z(i)?i.__ref:i,a.varString,o)}}),this.executeSubSelectedArray=rn(function(n){return Oc(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(nn(o.store))return o.store.makeCacheKey(i,a,o.varString)}})}return t.prototype.resetCanon=function(){this.canon=new mo},t.prototype.diffQueryAgainstStore=function(e){var r=e.store,n=e.query,i=e.rootId,a=i===void 0?"ROOT_QUERY":i,o=e.variables,s=e.returnPartialData,u=s===void 0?!0:s,c=e.canonizeResults,l=c===void 0?this.config.canonizeResults:c,d=this.config.cache.policies;o=w(w({},Xr(Pi(n))),o);var p=Vt(a),f=this.executeSelectionSet({selectionSet:Zr(n).selectionSet,objectOrReference:p,enclosingRef:p,context:w({store:r,query:n,policies:d,variables:o,varString:yt(o),canonizeResults:l},po(n,this.config.fragments))}),h;if(f.missing&&(h=[new Bi(Zm(f.missing),f.missing,n,o)],!u))throw h[0];return{result:f.result,complete:!h,missing:h}},t.prototype.isFresh=function(e,r,n,i){if(nn(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(Z(i)&&!o.policies.rootTypenamesById[i.__ref]&&!o.store.has(i.__ref))return{result:this.canon.empty,missing:"Dangling reference to missing ".concat(i.__ref," object")};var s=o.variables,u=o.policies,c=o.store,l=c.getFieldValue(i,"__typename"),d=[],p,f=new st;this.config.addTypename&&typeof l=="string"&&!u.rootIdsByTypename[l]&&d.push({__typename:l});function h(b,g){var A;return b.missing&&(p=f.merge(p,(A={},A[g]=b.missing,A))),b.result}var y=new Set(n.selections);y.forEach(function(b){var g,A;if(!!nr(b,s))if(mt(b)){var R=u.readField({fieldName:b.name.value,field:b,variables:o.variables,from:i},o),T=xt(b);R===void 0?en.added(b)||(p=f.merge(p,(g={},g[T]="Can't find field '".concat(b.name.value,"' on ").concat(Z(i)?i.__ref+" object":"object "+JSON.stringify(i,null,2)),g))):le(R)?R=h(r.executeSubSelectedArray({field:b,array:R,enclosingRef:a,context:o}),T):b.selectionSet?R!=null&&(R=h(r.executeSelectionSet({selectionSet:b.selectionSet,objectOrReference:R,enclosingRef:Z(R)?R:a,context:o}),T)):o.canonizeResults&&(R=r.canon.pass(R)),R!==void 0&&d.push((A={},A[T]=R,A))}else{var C=Jr(b,o.lookupFragment);if(!C&&b.kind===Ae.FRAGMENT_SPREAD)throw __DEV__?new V("No fragment named ".concat(b.name.value)):new V(5);C&&u.fragmentMatches(C,l)&&C.selectionSet.selections.forEach(y.add,y)}});var v=Ci(d),E={result:v,missing:p},_=o.canonizeResults?this.canon.admit(E):Li(E);return _.result&&this.knownResults.set(_.result,n),_},t.prototype.execSubSelectedArrayImpl=function(e){var r=this,n=e.field,i=e.array,a=e.enclosingRef,o=e.context,s,u=new st;function c(l,d){var p;return l.missing&&(s=u.merge(s,(p={},p[d]=l.missing,p))),l.result}return n.selectionSet&&(i=i.filter(o.store.canRead)),i=i.map(function(l,d){return l===null?null:le(l)?c(r.executeSubSelectedArray({field:n,array:l,enclosingRef:a,context:o}),d):n.selectionSet?c(r.executeSelectionSet({selectionSet:n.selectionSet,objectOrReference:l,enclosingRef:Z(l)?l:a,context:o}),d):(__DEV__&&Xm(o.store,n,l),l)}),{result:o.canonizeResults?this.canon.admit(i):i,missing:s}},t}();function Zm(t){try{JSON.stringify(t,function(e,r){if(typeof r=="string")throw r;return r})}catch(e){return e}}function Xm(t,e,r){if(!e.selectionSet){var n=new Set([r]);n.forEach(function(i){ie(i)&&(__DEV__?N(!Z(i),"Missing selection set for object of type ".concat(bf(t,i)," returned for query field ").concat(e.name.value)):N(!Z(i),6),Object.values(i).forEach(n.add,n))})}}var Kn=new zn,Tf=new WeakMap;function Qi(t){var e=Tf.get(t);return e||Tf.set(t,e={vars:new Set,dep:co()}),e}function Nc(t){Qi(t).vars.forEach(function(e){return e.forgetCache(t)})}function kf(t){Qi(t).vars.forEach(function(e){return e.attachCache(t)})}function yo(t){var e=new Set,r=new Set,n=function(a){if(arguments.length>0){if(t!==a){t=a,e.forEach(function(u){Qi(u).dep.dirty(n),ey(u)});var o=Array.from(r);r.clear(),o.forEach(function(u){return u(t)})}}else{var s=Kn.getValue();s&&(i(s),Qi(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),Qi(a).vars.add(n),n};return n.forgetCache=function(a){return e.delete(a)},n}function ey(t){t.broadcastWatches&&t.broadcastWatches()}var Of=Object.create(null);function Pc(t){var e=JSON.stringify(t);return Of[e]||(Of[e]=Object.create(null))}function Cc(t){var e=Pc(t);return e.keyFieldsFn||(e.keyFieldsFn=function(r,n){var i=function(o,s){return n.readField(s,o)},a=n.keyObject=Lc(t,function(o){var s=Hn(n.storeObject,o,i);return s===void 0&&r!==n.storeObject&&Ie.call(r,o[0])&&(s=Hn(r,o,Df)),__DEV__?N(s!==void 0,"Missing field '".concat(o.join("."),"' while extracting keyFields from ").concat(JSON.stringify(r))):N(s!==void 0,2),s});return"".concat(n.typename,":").concat(JSON.stringify(a))})}function Rc(t){var e=Pc(t);return e.keyArgsFn||(e.keyArgsFn=function(r,n){var i=n.field,a=n.variables,o=n.fieldName,s=Lc(t,function(c){var l=c[0],d=l.charAt(0);if(d==="@"){if(i&&Ce(i.directives)){var p=l.slice(1),f=i.directives.find(function(E){return E.name.value===p}),h=f&&ir(f,a);return h&&Hn(h,c.slice(1))}return}if(d==="$"){var y=l.slice(1);if(a&&Ie.call(a,y)){var v=c.slice(0);return v[0]=y,Hn(a,v)}return}if(r)return Hn(r,c)}),u=JSON.stringify(s);return(r||u!=="{}")&&(o+=":"+u),o})}function Lc(t,e){var r=new st;return Af(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 Af(t){var e=Pc(t);if(!e.paths){var r=e.paths=[],n=[];t.forEach(function(i,a){le(i)?(Af(i).forEach(function(o){return r.push(n.concat(o))}),n.length=0):(n.push(i),le(t[a+1])||(r.push(n.slice(0)),n.length=0))})}return e.paths}function Df(t,e){return t[e]}function Hn(t,e,r){return r=r||Df,Nf(e.reduce(function n(i,a){return le(i)?i.map(function(o){return n(o,a)}):i&&r(i,a)},t))}function Nf(t){return ie(t)?le(t)?t.map(Nf):Lc(Object.keys(t).sort(),function(e){return Hn(t,e)}):t}Di.setStringify(yt);function Fc(t){return t.args!==void 0?t.args:t.field?ir(t.field,t.variables):null}var ty=function(){},Pf=function(t,e){return e.fieldName},Cf=function(t,e,r){var n=r.mergeObjects;return n(t,e)},Rf=function(t,e){return e},Ff=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=w({dataIdFromObject:lo},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=w(w({},r),{typename:a,storeObject:o,readField:r&&r.readField||function(){var p=go(arguments,o);return i.readField(p,{store:i.cache.data,variables:p.variables})}}),u,c=a&&this.getTypePolicy(a),l=c&&c.keyFn||this.config.dataIdFromObject;l;){var d=l(e,s);if(le(d))l=Cc(d);else{u=d;break}}return u=u?String(u):void 0,s.keyObject?[u,s.keyObject]:[u]},t.prototype.addTypePolicies=function(e){var r=this;Object.keys(e).forEach(function(n){var i=e[n],a=i.queryType,o=i.mutationType,s=i.subscriptionType,u=Bt(i,["queryType","mutationType","subscriptionType"]);a&&r.setRootTypename("Query",n),o&&r.setRootTypename("Mutation",n),s&&r.setRootTypename("Subscription",n),Ie.call(r.toBeAdded,n)?r.toBeAdded[n].push(u):r.toBeAdded[n]=[u]})},t.prototype.updateTypePolicy=function(e,r){var n=this,i=this.getTypePolicy(e),a=r.keyFields,o=r.fields;function s(u,c){u.merge=typeof c=="function"?c:c===!0?Cf:c===!1?Rf:u.merge}s(i,r.merge),i.keyFn=a===!1?ty:le(a)?Cc(a):typeof a=="function"?a:i.keyFn,o&&Object.keys(o).forEach(function(u){var c=n.getFieldPolicy(e,u,!0),l=o[u];if(typeof l=="function")c.read=l;else{var d=l.keyArgs,p=l.read,f=l.merge;c.keyFn=d===!1?Pf:le(d)?Rc(d):typeof d=="function"?d:c.keyFn,typeof p=="function"&&(c.read=p),s(c,f)}c.read&&c.merge&&(c.keyFn=c.keyFn||Pf)})},t.prototype.setRootTypename=function(e,r){r===void 0&&(r=e);var n="ROOT_"+e.toUpperCase(),i=this.rootTypenamesById[n];r!==i&&(__DEV__?N(!i||i===e,"Cannot change root ".concat(e," __typename more than once")):N(!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(Ic);(!a||a[0]!==i)&&r.fuzzySubtypes.set(i,new RegExp(i))})})},t.prototype.getTypePolicy=function(e){var r=this;if(!Ie.call(this.typePolicies,e)){var n=this.typePolicies[e]=Object.create(null);n.fields=Object.create(null);var i=this.supertypeMap.get(e);i&&i.size&&i.forEach(function(o){var s=r.getTypePolicy(o),u=s.fields,c=Bt(s,["fields"]);Object.assign(n,c),Object.assign(n.fields,u)})}var a=this.toBeAdded[e];return a&&a.length&&a.splice(0).forEach(function(o){r.updateTypePolicy(e,o)}),this.typePolicies[e]},t.prototype.getFieldPolicy=function(e,r,n){if(e){var i=this.getTypePolicy(e).fields;return i[r]||n&&(i[r]=Object.create(null))}},t.prototype.getSupertypeSet=function(e,r){var n=this.supertypeMap.get(e);return!n&&r&&this.supertypeMap.set(e,n=new Set),n},t.prototype.fragmentMatches=function(e,r,n,i){var a=this;if(!e.typeCondition)return!0;if(!r)return!1;var o=e.typeCondition.name.value;if(r===o)return!0;if(this.usingPossibleTypes&&this.supertypeMap.has(o))for(var s=this.getSupertypeSet(r,!0),u=[s],c=function(h){var y=a.getSupertypeSet(h,!1);y&&y.size&&u.indexOf(y)<0&&u.push(y)},l=!!(n&&this.fuzzySubtypes.size),d=!1,p=0;p<u.length;++p){var f=u[p];if(f.has(o))return s.has(o)||(d&&__DEV__&&N.warn("Inferring subtype ".concat(r," of supertype ").concat(o)),s.add(o)),!0;f.forEach(c),l&&p===u.length-1&&uo(e.selectionSet,n,i)&&(l=!1,d=!0,this.fuzzySubtypes.forEach(function(h,y){var v=r.match(h);v&&v[0]===r&&c(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},u=Fc(e);o;){var c=o(u,s);if(le(c))o=Rc(c);else{a=c||n;break}}return a===void 0&&(a=e.field?Gs(e.field,e.variables):Di(n,Fc(e))),a===!1?n:n===Ft(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=Ft(o),u=r.store.getFieldValue(n,o),c=this.getFieldPolicy(e.typename,s,!1),l=c&&c.read;if(l){var d=Lf(this,n,e,r,r.store.getStorage(Z(n)?n.__ref:n,o));return Kn.withValue(this.cache,l,[u,d])}return u}}},t.prototype.getReadFunction=function(e,r){var n=this.getFieldPolicy(e,r,!1);return n&&n.read},t.prototype.getMergeFunction=function(e,r,n){var i=this.getFieldPolicy(e,r,!1),a=i&&i.merge;return!a&&n&&(i=this.getTypePolicy(n),a=i&&i.merge),a},t.prototype.runMergeFunction=function(e,r,n,i,a){var o=n.field,s=n.typename,u=n.merge;return u===Cf?$f(i.store)(e,r):u===Rf?r:(i.overwrite&&(e=void 0),u(e,r,Lf(this,void 0,{typename:s,fieldName:o.name.value,field:o,variables:i.variables},i,a||Object.create(null))))},t}();function Lf(t,e,r,n,i){var a=t.getStoreFieldName(r),o=Ft(a),s=r.variables||n.variables,u=n.store,c=u.toReference,l=u.canRead;return{args:Fc(r),field:r.field||null,fieldName:o,storeFieldName:a,variables:s,isReference:Z,toReference:c,storage:i,cache:t.cache,canRead:l,readField:function(){return t.readField(go(arguments,e,s),n)},mergeObjects:$f(n.store)}}function go(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=w({},n),Ie.call(o,"from")||(o.from=e)),__DEV__&&o.from===void 0&&__DEV__&&N.warn("Undefined 'from' passed to readField with arguments ".concat(Al(Array.from(t)))),o.variables===void 0&&(o.variables=r),o}function $f(t){return function(r,n){if(le(r)||le(n))throw __DEV__?new V("Cannot automatically merge arrays"):new V(4);if(ie(r)&&ie(n)){var i=t.getFieldValue(r,"__typename"),a=t.getFieldValue(n,"__typename"),o=i&&a&&i!==a;if(o)return n;if(Z(r)&&xr(n))return t.merge(r.__ref,n),r;if(xr(r)&&Z(n))return t.merge(r,n.__ref),n;if(xr(r)&&xr(n))return w(w({},r),n)}return n}}function $c(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:w(w({},t),{clientOnly:e,deferred:r})),i}var qf=function(){function t(e,r,n){this.cache=e,this.reader=r,this.fragments=n}return t.prototype.writeToStore=function(e,r){var n=this,i=r.query,a=r.result,o=r.dataId,s=r.variables,u=r.overwrite,c=Qt(i),l=_f();s=w(w({},Xr(c)),s);var d=w(w({store:e,written:Object.create(null),merge:function(f,h){return l.merge(f,h)},variables:s,varString:yt(s)},po(i,this.fragments)),{overwrite:!!u,incomingById:new Map,clientOnly:!1,deferred:!1,flavors:new Map}),p=this.processSelectionSet({result:a||Object.create(null),dataId:o,selectionSet:c.selectionSet,mergeTree:{map:new Map},context:d});if(!Z(p))throw __DEV__?new V("Could not identify object ".concat(JSON.stringify(a))):new V(7);return d.incomingById.forEach(function(f,h){var y=f.storeObject,v=f.mergeTree,E=f.fieldNodeSet,_=Vt(h);if(v&&v.map.size){var b=n.applyMerges(v,_,y,d);if(Z(b))return;y=b}if(__DEV__&&!d.overwrite){var g=Object.create(null);E.forEach(function(T){T.selectionSet&&(g[T.name.value]=!0)});var A=function(T){return g[Ft(T)]===!0},R=function(T){var C=v&&v.map.get(T);return Boolean(C&&C.info&&C.info.merge)};Object.keys(y).forEach(function(T){A(T)&&!R(T)&&ry(_,y,T,d.store)})}e.merge(h,y)}),e.retain(p.__ref),p},t.prototype.processSelectionSet=function(e){var r=this,n=e.dataId,i=e.result,a=e.selectionSet,o=e.context,s=e.mergeTree,u=this.cache.policies,c=Object.create(null),l=n&&u.rootTypenamesById[n]||Ni(i,a,o.fragmentMap)||n&&o.store.get(n,"__typename");typeof l=="string"&&(c.__typename=l);var d=function(){var b=go(arguments,c,o.variables);if(Z(b.from)){var g=o.incomingById.get(b.from.__ref);if(g){var A=u.readField(w(w({},b),{from:g.storeObject}),o);if(A!==void 0)return A}}return u.readField(b,o)},p=new Set;this.flattenFields(a,i,o,l).forEach(function(b,g){var A,R=xt(g),T=i[R];if(p.add(g),T!==void 0){var C=u.getStoreFieldName({typename:l,fieldName:g.name.value,field:g,variables:b.variables}),F=Mf(s,C),L=r.processFieldValue(T,g,g.selectionSet?$c(b,!1,!1):b,F),q=void 0;g.selectionSet&&(Z(L)||xr(L))&&(q=d("__typename",L));var Ve=u.getMergeFunction(l,g.name.value,q);Ve?F.info={field:g,typename:l,merge:Ve}:jf(s,C),c=b.merge(c,(A={},A[C]=L,A))}else __DEV__&&!b.clientOnly&&!b.deferred&&!en.added(g)&&!u.getReadFunction(l,g.name.value)&&__DEV__&&N.error("Missing field '".concat(xt(g),"' while writing result ").concat(JSON.stringify(i,null,2)).substring(0,1e3))});try{var f=u.identify(i,{typename:l,selectionSet:a,fragmentMap:o.fragmentMap,storeObject:c,readField:d}),h=f[0],y=f[1];n=n||h,y&&(c=o.merge(c,y))}catch(b){if(!n)throw b}if(typeof n=="string"){var v=Vt(n),E=o.written[n]||(o.written[n]=[]);if(E.indexOf(a)>=0||(E.push(a),this.reader&&this.reader.isFresh(i,v,a,o)))return v;var _=o.incomingById.get(n);return _?(_.storeObject=o.merge(_.storeObject,c),_.mergeTree=Mc(_.mergeTree,s),p.forEach(function(b){return _.fieldNodeSet.add(b)})):o.incomingById.set(n,{storeObject:c,mergeTree:vo(s)?void 0:s,fieldNodeSet:p}),v}return c},t.prototype.processFieldValue=function(e,r,n,i){var a=this;return!r.selectionSet||e===null?__DEV__?Ya(e):e:le(e)?e.map(function(o,s){var u=a.processFieldValue(o,r,n,Mf(i,s));return jf(i,s),u}):this.processSelectionSet({result:e,selectionSet:r.selectionSet,context:n,mergeTree:i})},t.prototype.flattenFields=function(e,r,n,i){i===void 0&&(i=Ni(r,e,n.fragmentMap));var a=new Map,o=this.cache.policies,s=new zt(!1);return function u(c,l){var d=s.lookup(c,l.clientOnly,l.deferred);d.visited||(d.visited=!0,c.selections.forEach(function(p){if(!!nr(p,n.variables)){var f=l.clientOnly,h=l.deferred;if(!(f&&h)&&Ce(p.directives)&&p.directives.forEach(function(E){var _=E.name.value;if(_==="client"&&(f=!0),_==="defer"){var b=ir(E,n.variables);(!b||b.if!==!1)&&(h=!0)}}),mt(p)){var y=a.get(p);y&&(f=f&&y.clientOnly,h=h&&y.deferred),a.set(p,$c(n,f,h))}else{var v=Jr(p,n.lookupFragment);if(!v&&p.kind===Ae.FRAGMENT_SPREAD)throw __DEV__?new V("No fragment named ".concat(p.name.value)):new V(8);v&&o.fragmentMatches(v,i,r,n.variables)&&u(v.selectionSet,$c(n,f,h))}}}))}(e,n),a},t.prototype.applyMerges=function(e,r,n,i,a){var o,s=this;if(e.map.size&&!Z(n)){var u=!le(n)&&(Z(r)||xr(r))?r:void 0,c=n;u&&!a&&(a=[Z(u)?u.__ref:u]);var l,d=function(p,f){return le(p)?typeof f=="number"?p[f]:void 0:i.store.getFieldValue(p,String(f))};e.map.forEach(function(p,f){var h=d(u,f),y=d(c,f);if(y!==void 0){a&&a.push(f);var v=s.applyMerges(p,h,y,i,a);v!==y&&(l=l||new Map,l.set(f,v)),a&&N(a.pop()===f)}}),l&&(n=le(c)?c.slice(0):w({},c),l.forEach(function(p,f){n[f]=p}))}return e.info?this.cache.policies.runMergeFunction(r,n,e.info,i,a&&(o=i.store).getStorage.apply(o,a)):n},t}();var Bf=[];function Mf(t,e){var r=t.map;return r.has(e)||r.set(e,Bf.pop()||{map:new Map}),r.get(e)}function Mc(t,e){if(t===e||!e||vo(e))return t;if(!t||vo(t))return e;var r=t.info&&e.info?w(w({},t.info),e.info):t.info||e.info,n=t.map.size&&e.map.size,i=n?new Map:t.map.size?t.map:e.map,a={info:r,map:i};if(n){var o=new Set(e.map.keys());t.map.forEach(function(s,u){a.map.set(u,Mc(s,e.map.get(u))),o.delete(u)}),o.forEach(function(s){a.map.set(s,Mc(e.map.get(s),t.map.get(s)))})}return a}function vo(t){return!t||!(t.info||t.map.size)}function jf(t,e){var r=t.map,n=r.get(e);n&&vo(n)&&(Bf.push(n),r.delete(e))}var Uf=new Set;function ry(t,e,r,n){var i=function(d){var p=n.getFieldValue(d,r);return typeof p=="object"&&p},a=i(t);if(!!a){var o=i(e);if(!!o&&!Z(a)&&!ve(a,o)&&!Object.keys(a).every(function(d){return n.getFieldValue(o,d)!==void 0})){var s=n.getFieldValue(t,"__typename")||n.getFieldValue(e,"__typename"),u=Ft(r),c="".concat(s,".").concat(u);if(!Uf.has(c)){Uf.add(c);var l=[];!le(a)&&!le(o)&&[a,o].forEach(function(d){var p=n.getFieldValue(d,"__typename");typeof p=="string"&&!l.includes(p)&&l.push(p)}),__DEV__&&N.warn("Cache data may be lost when replacing the ".concat(u," field of a ").concat(s,` object.
36
+ `):new Q(23)};var Jl=function(){if(typeof AbortController>"u")return{controller:!1,signal:!1};var t=new AbortController,e=t.signal;return{controller:t,signal:e}};var Yl=function(t,e){var r=t.getContext(),n=r.uri;return n||(typeof e=="function"?e(t):e||"/graphql")};function Zl(t,e){var r=[],n=function(d,p){r.push("".concat(d,"=").concat(encodeURIComponent(p)))};if("query"in e&&n("query",e.query),e.operationName&&n("operationName",e.operationName),e.variables){var i=void 0;try{i=qi(e.variables,"Variables map")}catch(d){return{parseError:d}}n("variables",i)}if(e.extensions){var a=void 0;try{a=qi(e.extensions,"Extensions map")}catch(d){return{parseError:d}}n("extensions",a)}var o="",s=t,u=t.indexOf("#");u!==-1&&(o=t.substr(u),s=t.substr(0,u));var c=s.indexOf("?")===-1?"?":"&",l=s+c+r.join("&")+o;return{newURI:l}}var Xl=Ue(function(){return fetch}),ef=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?Wl:i,o=t.includeExtensions,s=t.preserveHeaderCase,u=t.useGETForQueries,c=t.includeUnusedVariables,l=c===void 0?!1:c,d=Bt(t,["uri","fetch","print","includeExtensions","preserveHeaderCase","useGETForQueries","includeUnusedVariables"]);__DEV__&&Hl(n||Xl);var p={http:{includeExtensions:o,preserveHeaderCase:s},options:d.fetchOptions,credentials:d.credentials,headers:d.headers};return new kt(function(f){var m=Yl(f,r),y=f.getContext(),b={};if(y.clientAwareness){var E=y.clientAwareness,S=E.name,_=E.version;S&&(b["apollographql-client-name"]=S),_&&(b["apollographql-client-version"]=_)}var g=w(w({},b),y.headers),A={http:y.http,options:y.fetchOptions,credentials:y.credentials,headers:g},R=Kl(f,a,Gl,p,A),T=R.options,C=R.body;if(C.variables&&!l){var F=new Set(Object.keys(C.variables));Ye(f.query,{Variable:function(ne,jt,Y){Y&&Y.kind!=="VariableDefinition"&&F.delete(ne.name.value)}}),F.size&&(C.variables=w({},C.variables),F.forEach(function(ne){delete C.variables[ne]}))}var L;if(!T.signal){var q=Jl(),Ve=q.controller,Ce=q.signal;L=Ve,L&&(T.signal=Ce)}var B=function(ne){return ne.kind==="OperationDefinition"&&ne.operation==="mutation"};if(u&&!f.query.definitions.some(B)&&(T.method="GET"),$n(["defer"],f.query)&&(T.headers=T.headers||{},T.headers.accept="multipart/mixed; deferSpec=20220824, application/json"),T.method==="GET"){var he=Zl(m,C),me=he.newURI,re=he.parseError;if(re)return co(re);m=me}else try{T.body=qi(C,"Payload")}catch(ne){return co(ne)}return new Z(function(ne){var jt=n||Ue(function(){return fetch})||Xl;return jt(m,T).then(function(Y){var qt;f.setContext({response:Y});var gr=(qt=Y.headers)===null||qt===void 0?void 0:qt.get("content-type");return gr!==null&&/^multipart\/mixed/i.test(gr)?Vl(Y,ne):zl(Y,f,ne)}).catch(function(Y){return fo(Y,ne)}),function(){L&&L.abort()}})})};var bc=function(t){xe(e,t);function e(r){r===void 0&&(r={});var n=t.call(this,ef(r).request)||this;return n.options=r,n}return e}(kt);var{toString:tf,hasOwnProperty:Tm}=Object.prototype,rf=Function.prototype.toString,_c=new Map;function ve(t,e){try{return Sc(t,e)}finally{_c.clear()}}function Sc(t,e){if(t===e)return!0;let r=tf.call(t),n=tf.call(e);if(r!==n)return!1;switch(r){case"[object Array]":if(t.length!==e.length)return!1;case"[object Object]":{if(af(t,e))return!0;let i=nf(t),a=nf(e),o=i.length;if(o!==a.length)return!1;for(let s=0;s<o;++s)if(!Tm.call(e,i[s]))return!1;for(let s=0;s<o;++s){let u=i[s];if(!Sc(t[u],e[u]))return!1}return!0}case"[object Error]":return t.name===e.name&&t.message===e.message;case"[object Number]":if(t!==t)return e!==e;case"[object Boolean]":case"[object Date]":return+t==+e;case"[object RegExp]":case"[object String]":return t==`${e}`;case"[object Map]":case"[object Set]":{if(t.size!==e.size)return!1;if(af(t,e))return!0;let i=t.entries(),a=r==="[object Map]";for(;;){let o=i.next();if(o.done)break;let[s,u]=o.value;if(!e.has(s)||a&&!Sc(u,e.get(s)))return!1}return!0}case"[object Uint16Array]":case"[object Uint8Array]":case"[object Uint32Array]":case"[object Int32Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object ArrayBuffer]":t=new Uint8Array(t),e=new Uint8Array(e);case"[object DataView]":{let i=t.byteLength;if(i===e.byteLength)for(;i--&&t[i]===e[i];);return i===-1}case"[object AsyncFunction]":case"[object GeneratorFunction]":case"[object AsyncGeneratorFunction]":case"[object Function]":{let i=rf.call(t);return i!==rf.call(e)?!1:!Am(i,Om)}}return!1}function nf(t){return Object.keys(t).filter(km,t)}function km(t){return this[t]!==void 0}var Om="{ [native code] }";function Am(t,e){let r=t.length-e.length;return r>=0&&t.indexOf(e,r)===r}function af(t,e){let r=_c.get(t);if(r){if(r.has(e))return!0}else _c.set(t,r=new Set);return r.add(e),!1}var Dm=function(){return Object.create(null)},of=Array.prototype,Nm=of.forEach,Pm=of.slice,zt=function(){function t(e,r){e===void 0&&(e=!0),r===void 0&&(r=Dm),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 Nm.call(e,function(n){return r=r.getChildTrie(n)}),r.data||(r.data=this.makeData(Pm.call(e)))},t.prototype.getChildTrie=function(e){var r=this.weakness&&Cm(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 Cm(t){switch(typeof t){case"object":if(t===null)break;case"function":return!0}return!1}var We=null,sf={},Rm=1,Lm=()=>class{constructor(){this.id=["slot",Rm++,Date.now(),Math.random().toString(36).slice(2)].join(":")}hasValue(){for(let e=We;e;e=e.parent)if(this.id in e.slots){let r=e.slots[this.id];if(r===sf)break;return e!==We&&(We.slots[this.id]=r),!0}return We&&(We.slots[this.id]=sf),!1}getValue(){if(this.hasValue())return We.slots[this.id]}withValue(e,r,n,i){let a={__proto__:null,[this.id]:e},o=We;We={parent:o,slots:a};try{return r.apply(i,n)}finally{We=o}}static bind(e){let r=We;return function(){let n=We;try{return We=r,e.apply(this,arguments)}finally{We=n}}}static noContext(e,r,n){if(We){let i=We;try{return We=null,e.apply(n,r)}finally{We=i}}else return e.apply(n,r)}};function cf(t){try{return t()}catch{}}var wc="@wry/context:Slot",Fm=cf(()=>globalThis)||cf(()=>global)||Object.create(null),uf=Fm,zn=uf[wc]||Array[wc]||function(t){try{Object.defineProperty(uf,wc,{value:t,enumerable:!1,writable:!1,configurable:!0})}finally{return t}}(Lm());var{bind:$m,noContext:Mm}=zn;function Um(){}var jm=function(){function t(e,r){e===void 0&&(e=1/0),r===void 0&&(r=Um),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}(),ho=new zn,Ec,qm=Object.prototype.hasOwnProperty,Ic=(Ec=Array.from,Ec===void 0?function(t){var e=[];return t.forEach(function(r){return e.push(r)}),e}:Ec);function po(t){var e=t.unsubscribe;typeof e=="function"&&(t.unsubscribe=void 0,e())}var Bi=[],Bm=100;function Gn(t,e){if(!t)throw new Error(e||"assertion failure")}function Vm(t,e){var r=t.length;return r>0&&r===e.length&&t[r-1]===e[r-1]}function ff(t){switch(t.length){case 0:throw new Error("unknown value");case 1:return t[0];case 2:throw t[1]}}function Qm(t){return t.slice(0)}var zm=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&&!Er(this))return lf(this),this.value[0]},t.prototype.recompute=function(e){return Gn(!this.recomputing,"already recomputing"),lf(this),Er(this)?Gm(this,e):ff(this.value)},t.prototype.setDirty=function(){this.dirty||(this.dirty=!0,this.value.length=0,pf(this),po(this))},t.prototype.dispose=function(){var e=this;this.setDirty(),yf(this),Tc(this,function(r,n){r.setDirty(),vf(r,e)})},t.prototype.forget=function(){this.dispose()},t.prototype.dependOn=function(e){e.add(this),this.deps||(this.deps=Bi.pop()||new Set),this.deps.add(e)},t.prototype.forgetDeps=function(){var e=this;this.deps&&(Ic(this.deps).forEach(function(r){return r.delete(e)}),this.deps.clear(),Bi.push(this.deps),this.deps=null)},t.count=0,t}();function lf(t){var e=ho.getValue();if(e)return t.parents.add(e),e.childValues.has(t)||e.childValues.set(t,[]),Er(t)?hf(e,t):mf(e,t),e}function Gm(t,e){return yf(t),ho.withValue(t,Wm,[t,e]),Hm(t,e)&&Km(t),ff(t.value)}function Wm(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 Er(t){return t.dirty||!!(t.dirtyChildren&&t.dirtyChildren.size)}function Km(t){t.dirty=!1,!Er(t)&&df(t)}function pf(t){Tc(t,hf)}function df(t){Tc(t,mf)}function Tc(t,e){var r=t.parents.size;if(r)for(var n=Ic(t.parents),i=0;i<r;++i)e(n[i],t)}function hf(t,e){Gn(t.childValues.has(e)),Gn(Er(e));var r=!Er(t);if(!t.dirtyChildren)t.dirtyChildren=Bi.pop()||new Set;else if(t.dirtyChildren.has(e))return;t.dirtyChildren.add(e),r&&pf(t)}function mf(t,e){Gn(t.childValues.has(e)),Gn(!Er(e));var r=t.childValues.get(e);r.length===0?t.childValues.set(e,Qm(e.value)):Vm(r,e.value)||t.setDirty(),gf(t,e),!Er(t)&&df(t)}function gf(t,e){var r=t.dirtyChildren;r&&(r.delete(e),r.size===0&&(Bi.length<Bm&&Bi.push(r),t.dirtyChildren=null))}function yf(t){t.childValues.size>0&&t.childValues.forEach(function(e,r){vf(t,r)}),t.forgetDeps(),Gn(t.dirtyChildren===null)}function vf(t,e){e.parents.delete(t),t.childValues.delete(e),gf(t,e)}function Hm(t,e){if(typeof t.subscribe=="function")try{po(t),t.unsubscribe=t.subscribe.apply(null,e)}catch{return t.setDirty(),!1}return!0}var Jm={setDirty:!0,dispose:!0,forget:!0};function mo(t){var e=new Map,r=t&&t.subscribe;function n(i){var a=ho.getValue();if(a){var o=e.get(i);o||e.set(i,o=new Set),a.dependOn(o),typeof r=="function"&&(po(o),o.unsubscribe=r(i))}}return n.dirty=function(a,o){var s=e.get(a);if(s){var u=o&&qm.call(Jm,o)?o:"setDirty";Ic(s).forEach(function(c){return c[u]()}),e.delete(a),po(s)}},n}function bf(){var t=new zt(typeof WeakMap=="function");return function(){return t.lookupArray(arguments)}}var mE=bf(),xc=new Set;function rn(t,e){e===void 0&&(e=Object.create(null));var r=new jm(e.max||Math.pow(2,16),function(c){return c.dispose()}),n=e.keyArgs,i=e.makeCacheKey||bf(),a=function(){var c=i.apply(null,n?n.apply(null,arguments):arguments);if(c===void 0)return t.apply(null,arguments);var l=r.get(c);l||(r.set(c,l=new zm(t)),l.subscribe=e.subscribe,l.forget=function(){return r.delete(c)});var d=l.recompute(Array.prototype.slice.call(arguments));return r.set(c,l),xc.add(r),ho.hasValue()||(xc.forEach(function(p){return p.clean()}),xc.clear()),d};Object.defineProperty(a,"size",{get:function(){return r.map.size},configurable:!1,enumerable:!1});function o(c){var l=r.get(c);l&&l.setDirty()}a.dirtyKey=o,a.dirty=function(){o(i.apply(null,arguments))};function s(c){var l=r.get(c);if(l)return l.peek()}a.peekKey=s,a.peek=function(){return s(i.apply(null,arguments))};function u(c){return r.delete(c)}return a.forgetKey=u,a.forget=function(){return u(i.apply(null,arguments))},a.makeCacheKey=i,a.getKey=n?function(){return i.apply(null,n.apply(null,arguments))}:i,Object.freeze(a)}var kc=function(){function t(){this.getFragmentDoc=rn(Ws)}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(w(w({},e),{rootId:e.id||"ROOT_QUERY",optimistic:r}))},t.prototype.readFragment=function(e,r){return r===void 0&&(r=!!e.optimistic),this.read(w(w({},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=Bt(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=Bt(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(w(w({},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(w(w({},e),{data:a})),a)}})},t}();var Vi=function(t){xe(e,t);function e(r,n,i,a){var o,s=t.call(this,r)||this;if(s.message=r,s.path=n,s.query=i,s.variables=a,Array.isArray(s.path)){s.missing=s.message;for(var u=s.path.length-1;u>=0;--u)s.missing=(o={},o[s.path[u]]=s.missing,o)}else s.missing=s.path;return s.__proto__=e.prototype,s}return e}(Error);var Ie=Object.prototype.hasOwnProperty;function Qi(t){return t==null}function yo(t,e){var r=t.__typename,n=t.id,i=t._id;if(typeof r=="string"&&(e&&(e.keyObject=Qi(n)?Qi(i)?void 0:{_id:i}:{id:n}),Qi(n)&&!Qi(i)&&(n=i),!Qi(n)))return"".concat(r,":").concat(typeof n=="number"||typeof n=="string"?n:JSON.stringify(n))}var _f={dataIdFromObject:yo,addTypename:!0,resultCaching:!0,canonizeResults:!1};function Sf(t){return wr(_f,t)}function vo(t){var e=t.canonizeResults;return e===void 0?_f.canonizeResults:e}function wf(t,e){return X(e)?t.get(e.__ref,"__typename"):e&&e.__typename}var Oc=/^[_a-z][_0-9a-z]*/i;function $t(t){var e=t.match(Oc);return e?e[0]:t}function go(t,e,r){return ie(e)?fe(e)?e.every(function(n){return go(t,n,r)}):t.selections.every(function(n){if(mt(n)&&nr(n,r)){var i=It(n);return Ie.call(e,i)&&(!n.selectionSet||go(n.selectionSet,e[i],r))}return!0}):!1}function xr(t){return ie(t)&&!X(t)&&!fe(t)}function Ef(){return new st}function bo(t,e){var r=Hr(Yr(t));return{fragmentMap:r,lookupFragment:function(n){var i=r[n];return!i&&e&&(i=e.lookup(n)),i||null}}}var _o=Object.create(null),Ac=function(){return _o},xf=Object.create(null),Wn=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 Fi(X(i)?n.get(i.__ref,a):i&&i[a])},this.canRead=function(i){return X(i)?n.has(i.__ref):typeof i=="object"},this.toReference=function(i,a){if(typeof i=="string")return Vt(i);if(X(i))return i;var o=n.policies.identify(i)[0];if(o){var s=Vt(o);return a&&n.merge(o,i),s}}}return t.prototype.toObject=function(){return w({},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),Ie.call(this.data,e)){var n=this.data[e];if(n&&Ie.call(n,r))return n[r]}if(r==="__typename"&&Ie.call(this.policies.rootTypenamesById,e))return this.policies.rootTypenamesById[e];if(this instanceof Ir)return this.parent.get(e,r)},t.prototype.lookup=function(e,r){if(r&&this.group.depend(e,"__exists"),Ie.call(this.data,e))return this.data[e];if(this instanceof Ir)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;X(e)&&(e=e.__ref),X(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__?P(typeof i=="string","store.merge expects a string ID"):P(typeof i=="string",1);var s=new st(Zm).merge(a,o);if(this.data[i]=s,s!==a&&(delete this.refs[i],this.group.caching)){var u=Object.create(null);a||(u.__exists=1),Object.keys(o).forEach(function(c){if(!a||a[c]!==s[c]){u[c]=1;var l=$t(c);l!==c&&!n.policies.hasKeyArgs(s.__typename,l)&&(u[l]=1),s[c]===void 0&&!(n instanceof Ir)&&delete s[c]}}),u.__typename&&!(a&&a.__typename)&&this.policies.rootTypenamesById[i]===s.__typename&&delete u.__typename,Object.keys(u).forEach(function(c){return n.group.dirty(i,c)})}}},t.prototype.modify=function(e,r){var n=this,i=this.lookup(e);if(i){var a=Object.create(null),o=!1,s=!0,u={DELETE:_o,INVALIDATE:xf,isReference:X,toReference:this.toReference,canRead:this.canRead,readField:function(c,l){return n.policies.readField(typeof c=="string"?{fieldName:c,from:l||Vt(e)}:c,{store:n})}};if(Object.keys(i).forEach(function(c){var l=$t(c),d=i[c];if(d!==void 0){var p=typeof r=="function"?r:r[c]||r[l];if(p){var f=p===Ac?_o:p(Fi(d),w(w({},u),{fieldName:l,storeFieldName:c,storage:n.getStorage(e,c)}));f===xf?n.group.dirty(e,c):(f===_o&&(f=void 0),f!==d&&(a[c]=f,o=!0,d=f))}d!==void 0&&(s=!1)}}),o)return this.merge(e,a),s&&(this instanceof Ir?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]=Ac,i):Ac)}return!1},t.prototype.evict=function(e,r){var n=!1;return e.id&&(Ie.call(this.data,e.id)&&(n=this.delete(e.id,e.fieldName,e.args)),this instanceof Ir&&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){Ie.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&&Ie.call(e,a)||r.delete(a)}),e){var n=e.__META,i=Bt(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 Ir?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){Ie.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 Ir;)a=a.parent;i.forEach(function(o){return a.delete(o)})}return i},t.prototype.findChildRefIds=function(e){if(!Ie.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){X(a)&&(r[a.__ref]=!0),ie(a)&&Object.keys(a).forEach(function(o){var s=a[o];ie(s)&&i.add(s)})})}return this.refs[e]},t.prototype.makeCacheKey=function(){return this.group.keyMaker.lookupArray(arguments)},t}();var If=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?mo():null,this.keyMaker=new zt(Tt)},t.prototype.depend=function(e,r){if(this.d){this.d(Dc(e,r));var n=$t(r);n!==r&&this.d(Dc(e,n)),this.parent&&this.parent.depend(e,r)}},t.prototype.dirty=function(e,r){this.d&&this.d.dirty(Dc(e,r),r==="__exists"?"forget":"setDirty")},t}();function Dc(t,e){return e+"#"+t}function Nc(t,e){nn(t)&&t.group.depend(e,"__exists")}(function(t){var e=function(r){xe(n,r);function n(i){var a=i.policies,o=i.resultCaching,s=o===void 0?!0:o,u=i.seed,c=r.call(this,a,new If(s))||this;return c.stump=new Ym(c),c.storageTrie=new zt(Tt),u&&c.replace(u),c}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})(Wn||(Wn={}));var Ir=function(t){xe(e,t);function e(r,n,i,a){var o=t.call(this,n.policies,a)||this;return o.id=r,o.parent=n,o.replay=i,o.group=a,i(o),o}return e.prototype.addLayer=function(r,n){return new e(r,this,n,this.group)},e.prototype.removeLayer=function(r){var n=this,i=this.parent.removeLayer(r);return r===this.id?(this.group.caching&&Object.keys(this.data).forEach(function(a){var o=n.data[a],s=i.lookup(a);s?o?o!==s&&Object.keys(o).forEach(function(u){ve(o[u],s[u])||n.group.dirty(a,u)}):(n.group.dirty(a,"__exists"),Object.keys(s).forEach(function(u){n.group.dirty(a,u)})):n.delete(a)}),i):i===this.parent?this:i.addLayer(this.id,this.replay)},e.prototype.toObject=function(){return w(w({},this.parent.toObject()),this.data)},e.prototype.findChildRefIds=function(r){var n=this.parent.findChildRefIds(r);return Ie.call(this.data,r)?w(w({},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}(Wn),Ym=function(t){xe(e,t);function e(r){return t.call(this,"EntityStore.Stump",r,function(){},new If(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}(Ir);function Zm(t,e,r){var n=t[r],i=e[r];return ve(n,i)?n:i}function nn(t){return!!(t instanceof Wn&&t.group.caching)}function Xm(t){return ie(t)?fe(t)?t.slice(0):w({__proto__:Object.getPrototypeOf(t)},t):t}var So=function(){function t(){this.known=new(Ol?WeakSet:Set),this.pool=new zt(Tt),this.passes=new WeakMap,this.keysByJSON=new Map,this.empty=this.admit({})}return t.prototype.isKnown=function(e){return ie(e)&&this.known.has(e)},t.prototype.pass=function(e){if(ie(e)){var r=Xm(e);return this.passes.set(r,e),r}return e},t.prototype.admit=function(e){var r=this;if(ie(e)){var n=this.passes.get(e);if(n)return n;var i=Object.getPrototypeOf(e);switch(i){case Array.prototype:{if(this.known.has(e))return e;var a=e.map(this.admit,this),o=this.pool.lookupArray(a);return o.array||(this.known.add(o.array=a),__DEV__&&Object.freeze(a)),o.array}case null:case Object.prototype:{if(this.known.has(e))return e;var s=Object.getPrototypeOf(e),u=[s],c=this.sortedKeys(e);u.push(c.json);var l=u.length;c.sorted.forEach(function(f){u.push(r.admit(e[f]))});var o=this.pool.lookupArray(u);if(!o.object){var d=o.object=Object.create(s);this.known.add(d),c.sorted.forEach(function(f,m){d[f]=u[l+m]}),__DEV__&&Object.freeze(d)}return o.object}}}return e},t.prototype.sortedKeys=function(e){var r=Object.keys(e),n=this.pool.lookupArray(r);if(!n.keys){r.sort();var i=JSON.stringify(r);(n.keys=this.keysByJSON.get(i))||this.keysByJSON.set(i,n.keys={sorted:r,json:i})}return n.keys},t}();var gt=Object.assign(function(t){if(ie(t)){Pc===void 0&&Tf();var e=Pc.admit(t),r=Cc.get(e);return r===void 0&&Cc.set(e,r=JSON.stringify(e)),r}return JSON.stringify(t)},{reset:Tf}),Pc,Cc;function Tf(){Pc=new So,Cc=new(Tt?WeakMap:Map)}function kf(t){return[t.selectionSet,t.objectOrReference,t.context,t.context.canonizeResults]}var Of=function(){function t(e){var r=this;this.knownResults=new(Tt?WeakMap:Map),this.config=wr(e,{addTypename:e.addTypename!==!1,canonizeResults:vo(e)}),this.canon=e.canon||new So,this.executeSelectionSet=rn(function(n){var i,a=n.context.canonizeResults,o=kf(n);o[3]=!a;var s=(i=r.executeSelectionSet).peek.apply(i,o);return s?a?w(w({},s),{result:r.canon.admit(s.result)}):s:(Nc(n.context.store,n.enclosingRef.__ref),r.execSelectionSetImpl(n))},{max:this.config.resultCacheMaxSize,keyArgs:kf,makeCacheKey:function(n,i,a,o){if(nn(a.store))return a.store.makeCacheKey(n,X(i)?i.__ref:i,a.varString,o)}}),this.executeSubSelectedArray=rn(function(n){return Nc(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(nn(o.store))return o.store.makeCacheKey(i,a,o.varString)}})}return t.prototype.resetCanon=function(){this.canon=new So},t.prototype.diffQueryAgainstStore=function(e){var r=e.store,n=e.query,i=e.rootId,a=i===void 0?"ROOT_QUERY":i,o=e.variables,s=e.returnPartialData,u=s===void 0?!0:s,c=e.canonizeResults,l=c===void 0?this.config.canonizeResults:c,d=this.config.cache.policies;o=w(w({},Xr(Ci(n))),o);var p=Vt(a),f=this.executeSelectionSet({selectionSet:Zr(n).selectionSet,objectOrReference:p,enclosingRef:p,context:w({store:r,query:n,policies:d,variables:o,varString:gt(o),canonizeResults:l},bo(n,this.config.fragments))}),m;if(f.missing&&(m=[new Vi(eg(f.missing),f.missing,n,o)],!u))throw m[0];return{result:f.result,complete:!m,missing:m}},t.prototype.isFresh=function(e,r,n,i){if(nn(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(X(i)&&!o.policies.rootTypenamesById[i.__ref]&&!o.store.has(i.__ref))return{result:this.canon.empty,missing:"Dangling reference to missing ".concat(i.__ref," object")};var s=o.variables,u=o.policies,c=o.store,l=c.getFieldValue(i,"__typename"),d=[],p,f=new st;this.config.addTypename&&typeof l=="string"&&!u.rootIdsByTypename[l]&&d.push({__typename:l});function m(_,g){var A;return _.missing&&(p=f.merge(p,(A={},A[g]=_.missing,A))),_.result}var y=new Set(n.selections);y.forEach(function(_){var g,A;if(!!nr(_,s))if(mt(_)){var R=u.readField({fieldName:_.name.value,field:_,variables:o.variables,from:i},o),T=It(_);R===void 0?en.added(_)||(p=f.merge(p,(g={},g[T]="Can't find field '".concat(_.name.value,"' on ").concat(X(i)?i.__ref+" object":"object "+JSON.stringify(i,null,2)),g))):fe(R)?R=m(r.executeSubSelectedArray({field:_,array:R,enclosingRef:a,context:o}),T):_.selectionSet?R!=null&&(R=m(r.executeSelectionSet({selectionSet:_.selectionSet,objectOrReference:R,enclosingRef:X(R)?R:a,context:o}),T)):o.canonizeResults&&(R=r.canon.pass(R)),R!==void 0&&d.push((A={},A[T]=R,A))}else{var C=Jr(_,o.lookupFragment);if(!C&&_.kind===Ae.FRAGMENT_SPREAD)throw __DEV__?new Q("No fragment named ".concat(_.name.value)):new Q(5);C&&u.fragmentMatches(C,l)&&C.selectionSet.selections.forEach(y.add,y)}});var b=Ri(d),E={result:b,missing:p},S=o.canonizeResults?this.canon.admit(E):Fi(E);return S.result&&this.knownResults.set(S.result,n),S},t.prototype.execSubSelectedArrayImpl=function(e){var r=this,n=e.field,i=e.array,a=e.enclosingRef,o=e.context,s,u=new st;function c(l,d){var p;return l.missing&&(s=u.merge(s,(p={},p[d]=l.missing,p))),l.result}return n.selectionSet&&(i=i.filter(o.store.canRead)),i=i.map(function(l,d){return l===null?null:fe(l)?c(r.executeSubSelectedArray({field:n,array:l,enclosingRef:a,context:o}),d):n.selectionSet?c(r.executeSelectionSet({selectionSet:n.selectionSet,objectOrReference:l,enclosingRef:X(l)?l:a,context:o}),d):(__DEV__&&tg(o.store,n,l),l)}),{result:o.canonizeResults?this.canon.admit(i):i,missing:s}},t}();function eg(t){try{JSON.stringify(t,function(e,r){if(typeof r=="string")throw r;return r})}catch(e){return e}}function tg(t,e,r){if(!e.selectionSet){var n=new Set([r]);n.forEach(function(i){ie(i)&&(__DEV__?P(!X(i),"Missing selection set for object of type ".concat(wf(t,i)," returned for query field ").concat(e.name.value)):P(!X(i),6),Object.values(i).forEach(n.add,n))})}}var Kn=new zn,Af=new WeakMap;function zi(t){var e=Af.get(t);return e||Af.set(t,e={vars:new Set,dep:mo()}),e}function Rc(t){zi(t).vars.forEach(function(e){return e.forgetCache(t)})}function Df(t){zi(t).vars.forEach(function(e){return e.attachCache(t)})}function wo(t){var e=new Set,r=new Set,n=function(a){if(arguments.length>0){if(t!==a){t=a,e.forEach(function(u){zi(u).dep.dirty(n),rg(u)});var o=Array.from(r);r.clear(),o.forEach(function(u){return u(t)})}}else{var s=Kn.getValue();s&&(i(s),zi(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),zi(a).vars.add(n),n};return n.forgetCache=function(a){return e.delete(a)},n}function rg(t){t.broadcastWatches&&t.broadcastWatches()}var Nf=Object.create(null);function Lc(t){var e=JSON.stringify(t);return Nf[e]||(Nf[e]=Object.create(null))}function Fc(t){var e=Lc(t);return e.keyFieldsFn||(e.keyFieldsFn=function(r,n){var i=function(o,s){return n.readField(s,o)},a=n.keyObject=Mc(t,function(o){var s=Hn(n.storeObject,o,i);return s===void 0&&r!==n.storeObject&&Ie.call(r,o[0])&&(s=Hn(r,o,Cf)),__DEV__?P(s!==void 0,"Missing field '".concat(o.join("."),"' while extracting keyFields from ").concat(JSON.stringify(r))):P(s!==void 0,2),s});return"".concat(n.typename,":").concat(JSON.stringify(a))})}function $c(t){var e=Lc(t);return e.keyArgsFn||(e.keyArgsFn=function(r,n){var i=n.field,a=n.variables,o=n.fieldName,s=Mc(t,function(c){var l=c[0],d=l.charAt(0);if(d==="@"){if(i&&Re(i.directives)){var p=l.slice(1),f=i.directives.find(function(E){return E.name.value===p}),m=f&&ir(f,a);return m&&Hn(m,c.slice(1))}return}if(d==="$"){var y=l.slice(1);if(a&&Ie.call(a,y)){var b=c.slice(0);return b[0]=y,Hn(a,b)}return}if(r)return Hn(r,c)}),u=JSON.stringify(s);return(r||u!=="{}")&&(o+=":"+u),o})}function Mc(t,e){var r=new st;return Pf(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 Pf(t){var e=Lc(t);if(!e.paths){var r=e.paths=[],n=[];t.forEach(function(i,a){fe(i)?(Pf(i).forEach(function(o){return r.push(n.concat(o))}),n.length=0):(n.push(i),fe(t[a+1])||(r.push(n.slice(0)),n.length=0))})}return e.paths}function Cf(t,e){return t[e]}function Hn(t,e,r){return r=r||Cf,Rf(e.reduce(function n(i,a){return fe(i)?i.map(function(o){return n(o,a)}):i&&r(i,a)},t))}function Rf(t){return ie(t)?fe(t)?t.map(Rf):Mc(Object.keys(t).sort(),function(e){return Hn(t,e)}):t}Ni.setStringify(gt);function Uc(t){return t.args!==void 0?t.args:t.field?ir(t.field,t.variables):null}var ng=function(){},Lf=function(t,e){return e.fieldName},Ff=function(t,e,r){var n=r.mergeObjects;return n(t,e)},$f=function(t,e){return e},Uf=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=w({dataIdFromObject:yo},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=w(w({},r),{typename:a,storeObject:o,readField:r&&r.readField||function(){var p=Eo(arguments,o);return i.readField(p,{store:i.cache.data,variables:p.variables})}}),u,c=a&&this.getTypePolicy(a),l=c&&c.keyFn||this.config.dataIdFromObject;l;){var d=l(e,s);if(fe(d))l=Fc(d);else{u=d;break}}return u=u?String(u):void 0,s.keyObject?[u,s.keyObject]:[u]},t.prototype.addTypePolicies=function(e){var r=this;Object.keys(e).forEach(function(n){var i=e[n],a=i.queryType,o=i.mutationType,s=i.subscriptionType,u=Bt(i,["queryType","mutationType","subscriptionType"]);a&&r.setRootTypename("Query",n),o&&r.setRootTypename("Mutation",n),s&&r.setRootTypename("Subscription",n),Ie.call(r.toBeAdded,n)?r.toBeAdded[n].push(u):r.toBeAdded[n]=[u]})},t.prototype.updateTypePolicy=function(e,r){var n=this,i=this.getTypePolicy(e),a=r.keyFields,o=r.fields;function s(u,c){u.merge=typeof c=="function"?c:c===!0?Ff:c===!1?$f:u.merge}s(i,r.merge),i.keyFn=a===!1?ng:fe(a)?Fc(a):typeof a=="function"?a:i.keyFn,o&&Object.keys(o).forEach(function(u){var c=n.getFieldPolicy(e,u,!0),l=o[u];if(typeof l=="function")c.read=l;else{var d=l.keyArgs,p=l.read,f=l.merge;c.keyFn=d===!1?Lf:fe(d)?$c(d):typeof d=="function"?d:c.keyFn,typeof p=="function"&&(c.read=p),s(c,f)}c.read&&c.merge&&(c.keyFn=c.keyFn||Lf)})},t.prototype.setRootTypename=function(e,r){r===void 0&&(r=e);var n="ROOT_"+e.toUpperCase(),i=this.rootTypenamesById[n];r!==i&&(__DEV__?P(!i||i===e,"Cannot change root ".concat(e," __typename more than once")):P(!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(Oc);(!a||a[0]!==i)&&r.fuzzySubtypes.set(i,new RegExp(i))})})},t.prototype.getTypePolicy=function(e){var r=this;if(!Ie.call(this.typePolicies,e)){var n=this.typePolicies[e]=Object.create(null);n.fields=Object.create(null);var i=this.supertypeMap.get(e);i&&i.size&&i.forEach(function(o){var s=r.getTypePolicy(o),u=s.fields,c=Bt(s,["fields"]);Object.assign(n,c),Object.assign(n.fields,u)})}var a=this.toBeAdded[e];return a&&a.length&&a.splice(0).forEach(function(o){r.updateTypePolicy(e,o)}),this.typePolicies[e]},t.prototype.getFieldPolicy=function(e,r,n){if(e){var i=this.getTypePolicy(e).fields;return i[r]||n&&(i[r]=Object.create(null))}},t.prototype.getSupertypeSet=function(e,r){var n=this.supertypeMap.get(e);return!n&&r&&this.supertypeMap.set(e,n=new Set),n},t.prototype.fragmentMatches=function(e,r,n,i){var a=this;if(!e.typeCondition)return!0;if(!r)return!1;var o=e.typeCondition.name.value;if(r===o)return!0;if(this.usingPossibleTypes&&this.supertypeMap.has(o))for(var s=this.getSupertypeSet(r,!0),u=[s],c=function(m){var y=a.getSupertypeSet(m,!1);y&&y.size&&u.indexOf(y)<0&&u.push(y)},l=!!(n&&this.fuzzySubtypes.size),d=!1,p=0;p<u.length;++p){var f=u[p];if(f.has(o))return s.has(o)||(d&&__DEV__&&P.warn("Inferring subtype ".concat(r," of supertype ").concat(o)),s.add(o)),!0;f.forEach(c),l&&p===u.length-1&&go(e.selectionSet,n,i)&&(l=!1,d=!0,this.fuzzySubtypes.forEach(function(m,y){var b=r.match(m);b&&b[0]===r&&c(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},u=Uc(e);o;){var c=o(u,s);if(fe(c))o=$c(c);else{a=c||n;break}}return a===void 0&&(a=e.field?Hs(e.field,e.variables):Ni(n,Uc(e))),a===!1?n:n===$t(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=$t(o),u=r.store.getFieldValue(n,o),c=this.getFieldPolicy(e.typename,s,!1),l=c&&c.read;if(l){var d=Mf(this,n,e,r,r.store.getStorage(X(n)?n.__ref:n,o));return Kn.withValue(this.cache,l,[u,d])}return u}}},t.prototype.getReadFunction=function(e,r){var n=this.getFieldPolicy(e,r,!1);return n&&n.read},t.prototype.getMergeFunction=function(e,r,n){var i=this.getFieldPolicy(e,r,!1),a=i&&i.merge;return!a&&n&&(i=this.getTypePolicy(n),a=i&&i.merge),a},t.prototype.runMergeFunction=function(e,r,n,i,a){var o=n.field,s=n.typename,u=n.merge;return u===Ff?jf(i.store)(e,r):u===$f?r:(i.overwrite&&(e=void 0),u(e,r,Mf(this,void 0,{typename:s,fieldName:o.name.value,field:o,variables:i.variables},i,a||Object.create(null))))},t}();function Mf(t,e,r,n,i){var a=t.getStoreFieldName(r),o=$t(a),s=r.variables||n.variables,u=n.store,c=u.toReference,l=u.canRead;return{args:Uc(r),field:r.field||null,fieldName:o,storeFieldName:a,variables:s,isReference:X,toReference:c,storage:i,cache:t.cache,canRead:l,readField:function(){return t.readField(Eo(arguments,e,s),n)},mergeObjects:jf(n.store)}}function Eo(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=w({},n),Ie.call(o,"from")||(o.from=e)),__DEV__&&o.from===void 0&&__DEV__&&P.warn("Undefined 'from' passed to readField with arguments ".concat(Pl(Array.from(t)))),o.variables===void 0&&(o.variables=r),o}function jf(t){return function(r,n){if(fe(r)||fe(n))throw __DEV__?new Q("Cannot automatically merge arrays"):new Q(4);if(ie(r)&&ie(n)){var i=t.getFieldValue(r,"__typename"),a=t.getFieldValue(n,"__typename"),o=i&&a&&i!==a;if(o)return n;if(X(r)&&xr(n))return t.merge(r.__ref,n),r;if(xr(r)&&X(n))return t.merge(r,n.__ref),n;if(xr(r)&&xr(n))return w(w({},r),n)}return n}}function jc(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:w(w({},t),{clientOnly:e,deferred:r})),i}var Qf=function(){function t(e,r,n){this.cache=e,this.reader=r,this.fragments=n}return t.prototype.writeToStore=function(e,r){var n=this,i=r.query,a=r.result,o=r.dataId,s=r.variables,u=r.overwrite,c=Qt(i),l=Ef();s=w(w({},Xr(c)),s);var d=w(w({store:e,written:Object.create(null),merge:function(f,m){return l.merge(f,m)},variables:s,varString:gt(s)},bo(i,this.fragments)),{overwrite:!!u,incomingById:new Map,clientOnly:!1,deferred:!1,flavors:new Map}),p=this.processSelectionSet({result:a||Object.create(null),dataId:o,selectionSet:c.selectionSet,mergeTree:{map:new Map},context:d});if(!X(p))throw __DEV__?new Q("Could not identify object ".concat(JSON.stringify(a))):new Q(7);return d.incomingById.forEach(function(f,m){var y=f.storeObject,b=f.mergeTree,E=f.fieldNodeSet,S=Vt(m);if(b&&b.map.size){var _=n.applyMerges(b,S,y,d);if(X(_))return;y=_}if(__DEV__&&!d.overwrite){var g=Object.create(null);E.forEach(function(T){T.selectionSet&&(g[T.name.value]=!0)});var A=function(T){return g[$t(T)]===!0},R=function(T){var C=b&&b.map.get(T);return Boolean(C&&C.info&&C.info.merge)};Object.keys(y).forEach(function(T){A(T)&&!R(T)&&ig(S,y,T,d.store)})}e.merge(m,y)}),e.retain(p.__ref),p},t.prototype.processSelectionSet=function(e){var r=this,n=e.dataId,i=e.result,a=e.selectionSet,o=e.context,s=e.mergeTree,u=this.cache.policies,c=Object.create(null),l=n&&u.rootTypenamesById[n]||Pi(i,a,o.fragmentMap)||n&&o.store.get(n,"__typename");typeof l=="string"&&(c.__typename=l);var d=function(){var _=Eo(arguments,c,o.variables);if(X(_.from)){var g=o.incomingById.get(_.from.__ref);if(g){var A=u.readField(w(w({},_),{from:g.storeObject}),o);if(A!==void 0)return A}}return u.readField(_,o)},p=new Set;this.flattenFields(a,i,o,l).forEach(function(_,g){var A,R=It(g),T=i[R];if(p.add(g),T!==void 0){var C=u.getStoreFieldName({typename:l,fieldName:g.name.value,field:g,variables:_.variables}),F=qf(s,C),L=r.processFieldValue(T,g,g.selectionSet?jc(_,!1,!1):_,F),q=void 0;g.selectionSet&&(X(L)||xr(L))&&(q=d("__typename",L));var Ve=u.getMergeFunction(l,g.name.value,q);Ve?F.info={field:g,typename:l,merge:Ve}:Bf(s,C),c=_.merge(c,(A={},A[C]=L,A))}else __DEV__&&!_.clientOnly&&!_.deferred&&!en.added(g)&&!u.getReadFunction(l,g.name.value)&&__DEV__&&P.error("Missing field '".concat(It(g),"' while writing result ").concat(JSON.stringify(i,null,2)).substring(0,1e3))});try{var f=u.identify(i,{typename:l,selectionSet:a,fragmentMap:o.fragmentMap,storeObject:c,readField:d}),m=f[0],y=f[1];n=n||m,y&&(c=o.merge(c,y))}catch(_){if(!n)throw _}if(typeof n=="string"){var b=Vt(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 S=o.incomingById.get(n);return S?(S.storeObject=o.merge(S.storeObject,c),S.mergeTree=qc(S.mergeTree,s),p.forEach(function(_){return S.fieldNodeSet.add(_)})):o.incomingById.set(n,{storeObject:c,mergeTree:xo(s)?void 0:s,fieldNodeSet:p}),b}return c},t.prototype.processFieldValue=function(e,r,n,i){var a=this;return!r.selectionSet||e===null?__DEV__?no(e):e:fe(e)?e.map(function(o,s){var u=a.processFieldValue(o,r,n,qf(i,s));return Bf(i,s),u}):this.processSelectionSet({result:e,selectionSet:r.selectionSet,context:n,mergeTree:i})},t.prototype.flattenFields=function(e,r,n,i){i===void 0&&(i=Pi(r,e,n.fragmentMap));var a=new Map,o=this.cache.policies,s=new zt(!1);return function u(c,l){var d=s.lookup(c,l.clientOnly,l.deferred);d.visited||(d.visited=!0,c.selections.forEach(function(p){if(!!nr(p,n.variables)){var f=l.clientOnly,m=l.deferred;if(!(f&&m)&&Re(p.directives)&&p.directives.forEach(function(E){var S=E.name.value;if(S==="client"&&(f=!0),S==="defer"){var _=ir(E,n.variables);(!_||_.if!==!1)&&(m=!0)}}),mt(p)){var y=a.get(p);y&&(f=f&&y.clientOnly,m=m&&y.deferred),a.set(p,jc(n,f,m))}else{var b=Jr(p,n.lookupFragment);if(!b&&p.kind===Ae.FRAGMENT_SPREAD)throw __DEV__?new Q("No fragment named ".concat(p.name.value)):new Q(8);b&&o.fragmentMatches(b,i,r,n.variables)&&u(b.selectionSet,jc(n,f,m))}}}))}(e,n),a},t.prototype.applyMerges=function(e,r,n,i,a){var o,s=this;if(e.map.size&&!X(n)){var u=!fe(n)&&(X(r)||xr(r))?r:void 0,c=n;u&&!a&&(a=[X(u)?u.__ref:u]);var l,d=function(p,f){return fe(p)?typeof f=="number"?p[f]:void 0:i.store.getFieldValue(p,String(f))};e.map.forEach(function(p,f){var m=d(u,f),y=d(c,f);if(y!==void 0){a&&a.push(f);var b=s.applyMerges(p,m,y,i,a);b!==y&&(l=l||new Map,l.set(f,b)),a&&P(a.pop()===f)}}),l&&(n=fe(c)?c.slice(0):w({},c),l.forEach(function(p,f){n[f]=p}))}return e.info?this.cache.policies.runMergeFunction(r,n,e.info,i,a&&(o=i.store).getStorage.apply(o,a)):n},t}();var zf=[];function qf(t,e){var r=t.map;return r.has(e)||r.set(e,zf.pop()||{map:new Map}),r.get(e)}function qc(t,e){if(t===e||!e||xo(e))return t;if(!t||xo(t))return e;var r=t.info&&e.info?w(w({},t.info),e.info):t.info||e.info,n=t.map.size&&e.map.size,i=n?new Map:t.map.size?t.map:e.map,a={info:r,map:i};if(n){var o=new Set(e.map.keys());t.map.forEach(function(s,u){a.map.set(u,qc(s,e.map.get(u))),o.delete(u)}),o.forEach(function(s){a.map.set(s,qc(e.map.get(s),t.map.get(s)))})}return a}function xo(t){return!t||!(t.info||t.map.size)}function Bf(t,e){var r=t.map,n=r.get(e);n&&xo(n)&&(zf.push(n),r.delete(e))}var Vf=new Set;function ig(t,e,r,n){var i=function(d){var p=n.getFieldValue(d,r);return typeof p=="object"&&p},a=i(t);if(!!a){var o=i(e);if(!!o&&!X(a)&&!ve(a,o)&&!Object.keys(a).every(function(d){return n.getFieldValue(o,d)!==void 0})){var s=n.getFieldValue(t,"__typename")||n.getFieldValue(e,"__typename"),u=$t(r),c="".concat(s,".").concat(u);if(!Vf.has(c)){Vf.add(c);var l=[];!fe(a)&&!fe(o)&&[a,o].forEach(function(d){var p=n.getFieldValue(d,"__typename");typeof p=="string"&&!l.includes(p)&&l.push(p)}),__DEV__&&P.warn("Cache data may be lost when replacing the ".concat(u," field of a ").concat(s,` object.
37
37
 
38
38
  To address this problem (which is not a bug in Apollo Client), `).concat(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(c,` 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 bo=function(t){xe(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=yo,n.txCount=0,n.config=vf(r),n.addTypename=!!n.config.addTypename,n.policies=new Ff({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 Wn.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 qf(this,this.storeReader=new If({cache:this,addTypename:this.addTypename,resultCacheMaxSize:this.config.resultCacheMaxSize,canonizeResults:fo(this.config),canon:r?void 0:i&&i.canon,fragments:a}),a),this.maybeBroadcastWatch=rn(function(o,s){return n.broadcastWatch(o,s)},{max:this.config.resultCacheMaxSize,makeCacheKey:function(o){var s=o.optimistic?n.optimisticData:n.data;if(nn(s)){var u=o.optimistic,c=o.id,l=o.variables;return s.makeCacheKey(o.query,o.callback,yt({optimistic:u,id:c,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(w(w({},r),{store:r.optimistic?this.optimisticData:this.data,config:this.config,returnPartialData:i})).result||null}catch(a){if(a instanceof Bi)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(Ie.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(w(w({},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||kf(this),this.watches.add(r),r.immediate&&this.maybeBroadcastWatch(r),function(){n.watches.delete(r)&&!n.watches.size&&Nc(n),n.maybeBroadcastWatch.forget(r)}},e.prototype.gc=function(r){yt.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(Z(r))return r.__ref;try{return this.policies.identify(r)[0]}catch(n){__DEV__&&N.warn(n)}},e.prototype.evict=function(r){if(!r.id){if(Ie.call(r,"id"))return!1;r=w(w({},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(),yt.reset(),r&&r.discardWatches?(this.watches.forEach(function(i){return n.maybeBroadcastWatch.forget(i)}),this.watches.clear(),Nc(this)):this.broadcastWatches(),Promise.resolve()},e.prototype.removeOptimistic=function(r){var n=this.optimisticData.removeLayer(r);n!==this.optimisticData&&(this.optimisticData=n,this.broadcastWatches())},e.prototype.batch=function(r){var n=this,i=r.update,a=r.optimistic,o=a===void 0?!0:a,s=r.removeOptimistic,u=r.onWatchUpdated,c,l=function(p){var f=n,h=f.data,y=f.optimisticData;++n.txCount,p&&(n.data=n.optimisticData=p);try{return c=i(n)}finally{--n.txCount,n.data=h,n.optimisticData=y}},d=new Set;return u&&!this.txCount&&this.broadcastWatches(w(w({},r),{onWatchUpdated:function(p){return d.add(p),!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)),u&&d.size?(this.broadcastWatches(w(w({},r),{onWatchUpdated:function(p,f){var h=u.call(this,p,f);return h!==!1&&d.delete(p),h}})),d.size&&d.forEach(function(p){return n.maybeBroadcastWatch.dirty(p)})):this.broadcastWatches(r),c},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=en(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||!ve(i.result,a.result))&&r.callback(r.lastDiff=a,i)},e}(xc);function Vf(t){return t.hasOwnProperty("graphQLErrors")}var ny=function(t){var e="";if(Ce(t.graphQLErrors)||Ce(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 Gi=function(t){xe(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=wo,n.txCount=0,n.config=Sf(r),n.addTypename=!!n.config.addTypename,n.policies=new Uf({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 Wn.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 Qf(this,this.storeReader=new Of({cache:this,addTypename:this.addTypename,resultCacheMaxSize:this.config.resultCacheMaxSize,canonizeResults:vo(this.config),canon:r?void 0:i&&i.canon,fragments:a}),a),this.maybeBroadcastWatch=rn(function(o,s){return n.broadcastWatch(o,s)},{max:this.config.resultCacheMaxSize,makeCacheKey:function(o){var s=o.optimistic?n.optimisticData:n.data;if(nn(s)){var u=o.optimistic,c=o.id,l=o.variables;return s.makeCacheKey(o.query,o.callback,gt({optimistic:u,id:c,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(w(w({},r),{store:r.optimistic?this.optimisticData:this.data,config:this.config,returnPartialData:i})).result||null}catch(a){if(a instanceof Vi)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(Ie.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(w(w({},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||Df(this),this.watches.add(r),r.immediate&&this.maybeBroadcastWatch(r),function(){n.watches.delete(r)&&!n.watches.size&&Rc(n),n.maybeBroadcastWatch.forget(r)}},e.prototype.gc=function(r){gt.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(X(r))return r.__ref;try{return this.policies.identify(r)[0]}catch(n){__DEV__&&P.warn(n)}},e.prototype.evict=function(r){if(!r.id){if(Ie.call(r,"id"))return!1;r=w(w({},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(),gt.reset(),r&&r.discardWatches?(this.watches.forEach(function(i){return n.maybeBroadcastWatch.forget(i)}),this.watches.clear(),Rc(this)):this.broadcastWatches(),Promise.resolve()},e.prototype.removeOptimistic=function(r){var n=this.optimisticData.removeLayer(r);n!==this.optimisticData&&(this.optimisticData=n,this.broadcastWatches())},e.prototype.batch=function(r){var n=this,i=r.update,a=r.optimistic,o=a===void 0?!0:a,s=r.removeOptimistic,u=r.onWatchUpdated,c,l=function(p){var f=n,m=f.data,y=f.optimisticData;++n.txCount,p&&(n.data=n.optimisticData=p);try{return c=i(n)}finally{--n.txCount,n.data=m,n.optimisticData=y}},d=new Set;return u&&!this.txCount&&this.broadcastWatches(w(w({},r),{onWatchUpdated:function(p){return d.add(p),!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)),u&&d.size?(this.broadcastWatches(w(w({},r),{onWatchUpdated:function(p,f){var m=u.call(this,p,f);return m!==!1&&d.delete(p),m}})),d.size&&d.forEach(function(p){return n.maybeBroadcastWatch.dirty(p)})):this.broadcastWatches(r),c},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=en(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||!ve(i.result,a.result))&&r.callback(r.lastDiff=a,i)},e}(kc);function Gf(t){return t.hasOwnProperty("graphQLErrors")}var ag=function(t){var e="";if(Re(t.graphQLErrors)||Re(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},ar=function(t){xe(e,t);function e(r){var n=r.graphQLErrors,i=r.clientErrors,a=r.networkError,o=r.errorMessage,s=r.extraInfo,u=t.call(this,o)||this;return u.name="ApolloError",u.graphQLErrors=n||[],u.clientErrors=i||[],u.networkError=a||null,u.message=o||ny(u),u.extraInfo=s,u.__proto__=e.prototype,u}return e}(Error);var oe;(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"})(oe||(oe={}));function Tr(t){return t?t<7:!1}var iy=Object.assign,ay=Object.hasOwnProperty,_o=function(t){xe(e,t);function e(r){var n=r.queryManager,i=r.queryInfo,a=r.options,o=t.call(this,function(v){try{var E=v._subscription._observer;E&&!E.error&&(E.error=oy)}catch{}var _=!o.observers.size;o.observers.add(v);var b=o.last;return b&&b.error?v.error&&v.error(b.error):b&&b.result&&v.next&&v.next(b.result),_&&o.reobserve().catch(function(){}),function(){o.observers.delete(v)&&!o.observers.size&&o.tearDownQuery()}})||this;o.observers=new Set,o.subscriptions=new Set,o.queryInfo=i,o.queryManager=n,o.isTornDown=!1;var s=n.defaultOptions.watchQuery,u=s===void 0?{}:s,c=u.fetchPolicy,l=c===void 0?"cache-first":c,d=a.fetchPolicy,p=d===void 0?l:d,f=a.initialFetchPolicy,h=f===void 0?p==="standby"?l:p:f;o.options=w(w({},a),{initialFetchPolicy:h,fetchPolicy:p}),o.queryId=i.queryId||n.generateQueryId();var y=Qt(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||oe.ready,a=w(w({},n),{loading:Tr(i),networkStatus:i}),o=this.options.fetchPolicy,s=o===void 0?"cache-first":o;if(!(s==="network-only"||s==="no-cache"||s==="standby"||this.queryManager.transform(this.options.query).hasForcedResolvers)){var u=this.queryInfo.getDiff();(u.complete||this.options.returnPartialData)&&(a.data=u.result),ve(a.data,{})&&(a.data=void 0),u.complete?(delete a.partial,u.complete&&a.networkStatus===oe.loading&&(s==="cache-first"||s==="cache-only")&&(a.networkStatus=oe.ready,a.loading=!1)):a.partial=!0,__DEV__&&!u.complete&&!this.options.partialRefetch&&!a.loading&&!a.data&&!a.error&&Uc(u.missing)}return r&&this.updateLastResult(a),a},e.prototype.isDifferentFromLastResult=function(r,n){return!this.last||!ve(this.last.result,r)||n&&!ve(this.last.variables,n)},e.prototype.getLast=function(r,n){var i=this.last;if(i&&i[r]&&(!n||ve(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&&ay.call(r,"variables")){var o=Pi(this.query),s=o.variableDefinitions;(!s||!s.some(function(u){return u.variable.name.value==="variables"}))&&__DEV__&&N.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&&!ve(this.options.variables,r)&&(i.variables=this.options.variables=w(w({},this.options.variables),r)),this.queryInfo.resetLastWrite(),this.reobserve(i,oe.refetch)},e.prototype.fetchMore=function(r){var n=this,i=w(w({},r.query?r:w(w(w(w({},this.options),{query:this.query}),r),{variables:w(w({},this.options.variables),r.variables)})),{fetchPolicy:"no-cache"}),a=this.queryManager.generateQueryId(),o=this.queryInfo,s=o.networkStatus;o.networkStatus=oe.fetchMore,i.notifyOnNetworkStatusChange&&this.observe();var u=new Set;return this.queryManager.fetchQuery(a,i,oe.fetchMore).then(function(c){return n.queryManager.removeQuery(a),o.networkStatus===oe.fetchMore&&(o.networkStatus=s),n.queryManager.cache.batch({update:function(l){var d=r.updateQuery;d?l.updateQuery({query:n.query,variables:n.variables,returnPartialData:!0,optimistic:!1},function(p){return d(p,{fetchMoreResult:c.data,variables:i.variables})}):l.writeQuery({query:i.query,variables:i.variables,data:c.data})},onWatchUpdated:function(l){u.add(l.query)}}),c}).finally(function(){u.has(n.query)||jc(n)})},e.prototype.subscribeToMore=function(r){var n=this,i=this.queryManager.startGraphQLSubscription({query:r.document,variables:r.variables,context:r.context}).subscribe({next:function(a){var o=r.updateQuery;o&&n.updateQuery(function(s,u){var c=u.variables;return o(s,{subscriptionData:a,variables:c})})},error:function(a){if(r.onError){r.onError(a);return}__DEV__&&N.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 ve(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},oe.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__?N(a,"Attempted to start a polling query without a polling interval."):N(a,13);var o=i||(this.pollingInfo={});o.interval=a;var s=function(){r.pollingInfo&&(Tr(r.queryInfo.networkStatus)?u():r.reobserve({fetchPolicy:r.options.initialFetchPolicy==="no-cache"?"no-cache":"network-only"},oe.poll).then(u,u))},u=function(){var c=r.pollingInfo;c&&(clearTimeout(c.timeout),c.timeout=setTimeout(s,c.interval))};u()}}},e.prototype.updateLastResult=function(r,n){return n===void 0&&(n=this.variables),this.last=w(w({},this.last),{result:this.queryManager.assumeImmutableResults?r:Ya(r),variables:n}),Ce(r.errors)||delete this.last.error,this.last},e.prototype.reobserve=function(r,n){var i=this;this.isTornDown=!1;var a=n===oe.refetch||n===oe.fetchMore||n===oe.poll,o=this.options.variables,s=this.options.fetchPolicy,u=Sr(this.options,r||{}),c=a?u:iy(this.options,u);a||(this.updatePolling(),r&&r.variables&&!ve(r.variables,o)&&c.fetchPolicy!=="standby"&&c.fetchPolicy===s&&(this.applyNextFetchPolicy("variables-changed",c),n===void 0&&(n=oe.setVariables)));var l=c.variables&&w({},c.variables),d=this.fetch(c,n),p={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=d,this.observer=p),d.addObserver(p),d.promise},e.prototype.observe=function(){this.reportResult(this.getCurrentResult(!1),this.variables)},e.prototype.reportResult=function(r,n){var i=this.getLastError();(i||this.isDifferentFromLastResult(r,n))&&((i||!r.partial||this.options.returnPartialData)&&this.updateLastResult(r,n),tn(this.observers,"next",r))},e.prototype.reportError=function(r,n){var i=w(w({},this.getLastResult()),{error:r,errors:r.graphQLErrors,networkStatus:oe.error,loading:!1});this.updateLastResult(i,n),tn(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}(J);Xa(_o);function jc(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 oy(t){__DEV__&&N.error("Unhandled error",t.message,t.stack)}function Uc(t){__DEV__&&t&&__DEV__&&N.debug("Missing cache result fields: ".concat(JSON.stringify(t)),t)}var wo=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=Xs(r.resolvers,n)}):this.resolvers=Xs(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 Pt(this,void 0,void 0,function(){return Ct(this,function(u){return r?[2,this.resolveDocument(r,n.data,i,a,this.fragmentMatcher,s).then(function(c){return w(w({},n),{data:c.result})})]:[2,n]})})},t.prototype.setFragmentMatcher=function(e){this.fragmentMatcher=e},t.prototype.getFragmentMatcher=function(){return this.fragmentMatcher},t.prototype.clientQuery=function(e){return $n(["client"],e)&&this.resolvers?e:null},t.prototype.serverQuery=function(e){return Zs(e)},t.prototype.prepareContext=function(e){var r=this.cache;return w(w({},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={}),Pt(this,void 0,void 0,function(){return Ct(this,function(i){return e?[2,this.resolveDocument(e,this.buildRootValueFromCache(e,r)||{},this.prepareContext(n),r).then(function(a){return w(w({},r),a.exportedVariables)})]:[2,w({},r)]})})},t.prototype.shouldForceResolvers=function(e){var r=!1;return Je(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 Kr}}}),r},t.prototype.buildRootValueFromCache=function(e,r){return this.cache.diff({query:Ys(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),Pt(this,void 0,void 0,function(){var s,u,c,l,d,p,f,h,y,v,E;return Ct(this,function(_){return s=Zr(e),u=Yr(e),c=Hr(u),l=this.collectSelectionsToResolve(s,c),d=s.operation,p=d?d.charAt(0).toUpperCase()+d.slice(1):"Query",f=this,h=f.cache,y=f.client,v={fragmentMap:c,context:w(w({},n),{cache:h,client:y}),variables:i,fragmentMatcher:a,defaultOperationType:p,exportedVariables:{},selectionsToResolve:l,onlyRunForcedResolvers:o},E=!1,[2,this.resolveSelectionSet(s.selectionSet,E,r,v).then(function(b){return{result:b,exportedVariables:v.exportedVariables}})]})})},t.prototype.resolveSelectionSet=function(e,r,n,i){return Pt(this,void 0,void 0,function(){var a,o,s,u,c,l=this;return Ct(this,function(d){return a=i.fragmentMap,o=i.context,s=i.variables,u=[n],c=function(p){return Pt(l,void 0,void 0,function(){var f,h;return Ct(this,function(y){return!r&&!i.selectionsToResolve.has(p)?[2]:nr(p,s)?mt(p)?[2,this.resolveField(p,r,n,i).then(function(v){var E;typeof v<"u"&&u.push((E={},E[xt(p)]=v,E))})]:(Ws(p)?f=p:(f=a[p.name.value],__DEV__?N(f,"No fragment named ".concat(p.name.value)):N(f,11)),f&&f.typeCondition&&(h=f.typeCondition.name.value,i.fragmentMatcher(n,h,o))?[2,this.resolveSelectionSet(f.selectionSet,r,n,i).then(function(v){u.push(v)})]:[2]):[2]})})},[2,Promise.all(e.selections.map(c)).then(function(){return Ci(u)})]})})},t.prototype.resolveField=function(e,r,n,i){return Pt(this,void 0,void 0,function(){var a,o,s,u,c,l,d,p,f,h=this;return Ct(this,function(y){return n?(a=i.variables,o=e.name.value,s=xt(e),u=o!==s,c=n[s]||n[o],l=Promise.resolve(c),(!i.onlyRunForcedResolvers||this.shouldForceResolvers(e))&&(d=n.__typename||i.defaultOperationType,p=this.resolvers&&this.resolvers[d],p&&(f=p[u?o:s],f&&(l=Promise.resolve(Kn.withValue(this.cache,f,[n,ir(e,a),i.context,{field:e,fragmentMap:i.fragmentMap}]))))),[2,l.then(function(v){var E,_;if(v===void 0&&(v=c),e.directives&&e.directives.forEach(function(g){g.name.value==="export"&&g.arguments&&g.arguments.forEach(function(A){A.name.value==="as"&&A.value.kind==="StringValue"&&(i.exportedVariables[A.value.value]=v)})}),!e.selectionSet||v==null)return v;var b=(_=(E=e.directives)===null||E===void 0?void 0:E.some(function(g){return g.name.value==="client"}))!==null&&_!==void 0?_:!1;if(Array.isArray(v))return h.resolveSubSelectedArray(e,r||b,v,i);if(e.selectionSet)return h.resolveSelectionSet(e.selectionSet,r||b,v,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),Je(o,{Directive:function(u,c,l,d,p){u.name.value==="client"&&p.forEach(function(f){n(f)&&Oi(f)&&s.add(f)})},FragmentSpread:function(u,c,l,d,p){var f=r[u.name.value];__DEV__?N(f,"No fragment named ".concat(u.name.value)):N(f,12);var h=a(f);h.size>0&&(p.forEach(function(y){n(y)&&Oi(y)&&s.add(y)}),s.add(u),h.forEach(function(y){s.add(y)}))}})}return i.get(o)}return a(e)},t}();var Jn=new(It?WeakMap:Map);function qc(t,e){var r=t[e];typeof r=="function"&&(t[e]=function(){return Jn.set(t,(Jn.get(t)+1)%1e15),r.apply(this,arguments)})}function Qf(t){t.notifyTimeout&&(clearTimeout(t.notifyTimeout),t.notifyTimeout=void 0)}var So=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;Jn.has(n)||(Jn.set(n,0),qc(n,"evict"),qc(n,"modify"),qc(n,"reset"))}return t.prototype.init=function(e){var r=e.networkStatus||oe.loading;return this.variables&&this.networkStatus!==oe.loading&&!ve(this.variables,e.variables)&&(r=oe.setVariables),ve(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(){Qf(this),this.dirty=!1},t.prototype.getDiff=function(e){e===void 0&&(e=this.variables);var r=this.getDiffOptions(e);if(this.lastDiff&&ve(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&&!ve(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():jc(e)})):delete this.oqListener)},t.prototype.notify=function(){var e=this;Qf(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(Tr(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=w(w({},this.getDiffOptions(e)),{watcher:this,callback:function(a){return r.setDiff(a)}});(!this.lastWatch||!ve(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===Jn.get(this.cache)&&ve(r,n.variables)&&ve(e.data,n.result.data))},t.prototype.markResult=function(e,r,n,i){var a=this,o=new st,s=Ce(e.errors)?e.errors.slice(0):[];if(this.reset(),"incremental"in e&&Ce(e.incremental)){var u=eo(this.getDiff().result,e);e.data=u}else if("hasNext"in e&&e.hasNext){var c=this.getDiff();e.data=o.merge(c.result,e.data)}this.graphQLErrors=s,n.fetchPolicy==="no-cache"?this.updateLastDiff({result:e.data,complete:!0},this.getDiffOptions(n.variables)):i!==0&&(Eo(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:Jn.get(a.cache)};else if(a.lastDiff&&a.lastDiff.diff.complete){e.data=a.lastDiff.diff.result;return}var d=a.getDiffOptions(n.variables),p=l.diff(d);a.stopped||a.updateWatch(n.variables),a.updateLastDiff(p,d),p.complete&&(e.data=p.result)}):this.lastWrite=void 0)},t.prototype.markReady=function(){return this.networkError=null,this.networkStatus=oe.ready},t.prototype.markError=function(e){return this.networkStatus=oe.error,this.lastWrite=void 0,this.reset(),e.graphQLErrors&&(this.graphQLErrors=e.graphQLErrors),e.networkError&&(this.networkError=e.networkError),e},t}();function Eo(t,e){e===void 0&&(e="none");var r=e==="ignore"||e==="all",n=!Vn(t);return!n&&r&&t.data&&(n=!0),n}var sy=Object.prototype.hasOwnProperty,zf=function(){function t(e){var r=e.cache,n=e.link,i=e.defaultOptions,a=e.queryDeduplication,o=a===void 0?!1:a,s=e.onBroadcast,u=e.ssrMode,c=u===void 0?!1:u,l=e.clientAwareness,d=l===void 0?{}:l,p=e.localState,f=e.assumeImmutableResults;this.clientAwareness={},this.queries=new Map,this.fetchCancelFns=new Map,this.transformCache=new(It?WeakMap:Map),this.queryIdCounter=1,this.requestIdCounter=1,this.mutationIdCounter=1,this.inFlightLinkObservables=new Map,this.cache=r,this.link=n,this.defaultOptions=i||Object.create(null),this.queryDeduplication=o,this.clientAwareness=d,this.localState=p||new wo({cache:r}),this.ssrMode=c,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 V("QueryManager stopped while query was in flight"):new V(14))},t.prototype.cancelPendingFetches=function(e){this.fetchCancelFns.forEach(function(r){return r(e)}),this.fetchCancelFns.clear()},t.prototype.mutate=function(e){var r,n,i=e.mutation,a=e.variables,o=e.optimisticResponse,s=e.updateQueries,u=e.refetchQueries,c=u===void 0?[]:u,l=e.awaitRefetchQueries,d=l===void 0?!1:l,p=e.update,f=e.onQueryUpdated,h=e.fetchPolicy,y=h===void 0?((r=this.defaultOptions.mutate)===null||r===void 0?void 0:r.fetchPolicy)||"network-only":h,v=e.errorPolicy,E=v===void 0?((n=this.defaultOptions.mutate)===null||n===void 0?void 0:n.errorPolicy)||"none":v,_=e.keepRootFields,b=e.context;return Pt(this,void 0,void 0,function(){var g,A,R,T,C,F;return Ct(this,function(L){switch(L.label){case 0:return __DEV__?N(i,"mutation option is required. You must specify your GraphQL document in the mutation option."):N(i,15),__DEV__?N(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."):N(y==="network-only"||y==="no-cache",16),g=this.generateMutationId(),A=this.transform(i),R=A.document,T=A.hasClientExports,i=this.cache.transformForLink(R),a=this.getVariables(i,a),T?[4,this.localState.addExportedVariables(i,a,b)]:[3,2];case 1:a=L.sent(),L.label=2;case 2:return C=this.mutationStore&&(this.mutationStore[g]={mutation:i,variables:a,loading:!0,error:null}),o&&this.markMutationOptimistic(o,{mutationId:g,document:i,variables:a,fetchPolicy:y,errorPolicy:E,context:b,updateQueries:s,update:p,keepRootFields:_}),this.broadcastQueries(),F=this,[2,new Promise(function(q,Ve){return Za(F.getObservableFromLink(i,w(w({},b),{optimisticResponse:o}),a,!1),function(Pe){if(Vn(Pe)&&E==="none")throw new ar({graphQLErrors:to(Pe)});C&&(C.loading=!1,C.error=null);var B=w({},Pe);return typeof c=="function"&&(c=c(B)),E==="ignore"&&Vn(B)&&delete B.errors,F.markMutationResult({mutationId:g,result:B,document:i,variables:a,fetchPolicy:y,errorPolicy:E,context:b,update:p,updateQueries:s,awaitRefetchQueries:d,refetchQueries:c,removeOptimistic:o?g:void 0,onQueryUpdated:f,keepRootFields:_})}).subscribe({next:function(Pe){F.broadcastQueries(),(!("hasNext"in Pe)||Pe.hasNext===!1)&&q(Pe)},error:function(Pe){C&&(C.loading=!1,C.error=Pe),o&&F.cache.removeOptimistic(g),F.broadcastQueries(),Ve(Pe instanceof ar?Pe:new ar({networkError:Pe}))}})})]}})})},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&&Eo(i,e.errorPolicy)){if(wr(i)||a.push({result:i.data,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}),wr(i)&&Ce(i.incremental)){var s=r.diff({id:"ROOT_MUTATION",query:this.transform(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0}),u=void 0;s.result&&(u=eo(s.result,i)),typeof u<"u"&&(i.data=u,a.push({result:u,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}))}var c=e.updateQueries;c&&this.queries.forEach(function(d,p){var f=d.observableQuery,h=f&&f.queryName;if(!(!h||!sy.call(c,h))){var y=c[h],v=n.queries.get(p),E=v.document,_=v.variables,b=r.diff({query:E,variables:_,returnPartialData:!0,optimistic:!1}),g=b.result,A=b.complete;if(A&&g){var R=y(g,{mutationResult:i,queryName:E&&jn(E)||void 0,queryVariables:_});R&&a.push({result:R,dataId:"ROOT_QUERY",query:E,variables:_})}}})}if(a.length>0||e.refetchQueries||e.update||e.onQueryUpdated||e.removeOptimistic){var l=[];if(this.refetchQueries({updateCache:function(d){o||a.forEach(function(y){return d.write(y)});var p=e.update,f=!kl(i)||wr(i)&&!i.hasNext;if(p){if(!o){var h=d.diff({id:"ROOT_MUTATION",query:n.transform(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0});h.complete&&(i=w(w({},i),{data:h.result}),"incremental"in i&&delete i.incremental,"hasNext"in i&&delete i.hasNext)}f&&p(d,i,{context:e.context,variables:e.variables})}!o&&!e.keepRootFields&&f&&d.modify({id:"ROOT_MUTATION",fields:function(y,v){var E=v.fieldName,_=v.DELETE;return E==="__typename"?y:_}})},include:e.refetchQueries,optimistic:!1,removeOptimistic:e.removeOptimistic,onQueryUpdated:e.onQueryUpdated||null}).forEach(function(d){return l.push(d)}),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(w(w({},r),{result:{data:i}}),a)}catch(o){__DEV__&&N.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=Js(n),a=this.localState.clientQuery(n),o=i&&this.localState.serverQuery(i),s={document:n,hasClientExports:Vs(n),hasForcedResolvers:this.localState.shouldForceResolvers(n),clientQuery:a,serverQuery:o,defaultVars:Xr(Qt(n)),asQuery:w(w({},n),{definitions:n.definitions.map(function(c){return c.kind==="OperationDefinition"&&c.operation!=="query"?w(w({},c),{operation:"query"}):c})})},u=function(c){c&&!r.has(c)&&r.set(c,s)};u(e),u(n),u(a),u(o)}return r.get(e)},t.prototype.getVariables=function(e,r){return w(w({},this.transform(e).defaultVars),r)},t.prototype.watchQuery=function(e){e=w(w({},e),{variables:this.getVariables(e.query,e.variables)}),typeof e.notifyOnNetworkStatusChange>"u"&&(e.notifyOnNetworkStatusChange=!1);var r=new So(this),n=new _o({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__?N(e.query,"query option is required. You must specify your GraphQL document in the query option."):N(e.query,17),__DEV__?N(e.query.kind==="Document",'You must wrap the query string in a "gql" tag.'):N(e.query.kind==="Document",18),__DEV__?N(!e.returnPartialData,"returnPartialData option only supported on watchQuery."):N(!e.returnPartialData,19),__DEV__?N(!e.pollInterval,"pollInterval option only supported on watchQuery."):N(!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 V("Store reset while query was in flight (not completed in link chain)"):new V(21)),this.queries.forEach(function(r){r.observableQuery?r.networkStatus=oe.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):zs(o)?i.set(r.transform(o).document,!1):ie(o)&&o.query&&a.add(o)}),this.queries.forEach(function(o,s){var u=o.observableQuery,c=o.document;if(u){if(e==="all"){n.set(s,u);return}var l=u.queryName,d=u.options.fetchPolicy;if(d==="standby"||e==="active"&&!u.hasObservers())return;(e==="active"||l&&i.has(l)||c&&i.has(c))&&(n.set(s,u),l&&i.set(l,!0),c&&i.set(c,!0))}}),a.size&&a.forEach(function(o){var s=Fi("legacyOneTimeQuery"),u=r.getQuery(s).init({document:o.query,variables:o.variables}),c=new _o({queryManager:r,queryInfo:u,options:w(w({},o),{fetchPolicy:"network-only"})});N(c.queryId===s),u.setObservableQuery(c),n.set(s,c)}),__DEV__&&i.size&&i.forEach(function(o,s){o||__DEV__&&N.warn("Unknown query ".concat(typeof s=="string"?"named ":"").concat(JSON.stringify(s,null,2)," requested in refetchQueries options.include array"))}),n},t.prototype.reFetchObservableQueries=function(e){var r=this;e===void 0&&(e=!1);var n=[];return this.getObservableQueries(e?"all":"active").forEach(function(i,a){var o=i.options.fetchPolicy;i.resetLastResults(),(e||o!=="standby"&&o!=="cache-only")&&n.push(i.refetch()),r.getQuery(a).setDiff(null)}),this.broadcastQueries(),Promise.all(n)},t.prototype.setObservableQuery=function(e){this.getQuery(e.queryId).setObservableQuery(e)},t.prototype.startGraphQLSubscription=function(e){var r=this,n=e.query,i=e.fetchPolicy,a=e.errorPolicy,o=e.variables,s=e.context,u=s===void 0?{}:s;n=this.transform(n).document,o=this.getVariables(n,o);var c=function(d){return r.getObservableFromLink(n,u,d).map(function(p){if(i!=="no-cache"&&(Eo(p,a)&&r.cache.write({query:n,result:p.data,dataId:"ROOT_SUBSCRIPTION",variables:d}),r.broadcastQueries()),Vn(p))throw new ar({graphQLErrors:p.errors});return p})};if(this.transform(n).hasClientExports){var l=this.localState.addExportedVariables(n,o,u).then(c);return new J(function(d){var p=null;return l.then(function(f){return p=f.subscribe(d)},d.error),function(){return p&&p.unsubscribe()}})}return c(o)},t.prototype.stopQuery=function(e){this.stopQueryNoBroadcast(e),this.broadcastQueries()},t.prototype.stopQueryNoBroadcast=function(e){this.stopQueryInStoreNoBroadcast(e),this.removeQuery(e)},t.prototype.removeQuery=function(e){this.fetchCancelFns.delete(e),this.queries.has(e)&&(this.getQuery(e).stop(),this.queries.delete(e))},t.prototype.broadcastQueries=function(){this.onBroadcast&&this.onBroadcast(),this.queries.forEach(function(e){return e.notify()})},t.prototype.getLocalState=function(){return this.localState},t.prototype.getObservableFromLink=function(e,r,n,i){var a=this,o;i===void 0&&(i=(o=r?.queryDeduplication)!==null&&o!==void 0?o:this.queryDeduplication);var s,u=this.transform(e).serverQuery;if(u){var c=this,l=c.inFlightLinkObservables,d=c.link,p={query:u,variables:n,operationName:jn(u)||void 0,context:this.prepareContext(w(w({},r),{forceFetch:!i}))};if(r=p.context,i){var f=l.get(u)||new Map;l.set(u,f);var h=yt(n);if(s=f.get(h),!s){var y=new Bn([Qn(d,p)]);f.set(h,s=y),y.beforeNext(function(){f.delete(h)&&f.size<1&&l.delete(u)})}}else s=new Bn([Qn(d,p)])}else s=new Bn([J.of({data:{}})]),r=this.prepareContext(r);var v=this.transform(e).clientQuery;return v&&(s=Za(s,function(E){return a.localState.runResolvers({document:v,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 Za(this.getObservableFromLink(a,n.context,n.variables),function(o){var s=to(o),u=s.length>0;if(i>=e.lastRequestId){if(u&&n.errorPolicy==="none")throw e.markError(new ar({graphQLErrors:s}));e.markResult(o,a,n,r),e.markReady()}var c={data:o.data,loading:!1,networkStatus:oe.ready};return u&&n.errorPolicy!=="ignore"&&(c.errors=s,c.networkStatus=oe.error),c},function(o){var s=Vf(o)?o:new ar({networkError:o});throw i>=e.lastRequestId&&e.markError(s),s})},t.prototype.fetchQueryObservable=function(e,r,n){var i=this;n===void 0&&(n=oe.loading);var a=this.transform(r.query).document,o=this.getVariables(a,r.variables),s=this.getQuery(e),u=this.defaultOptions.watchQuery,c=r.fetchPolicy,l=c===void 0?u&&u.fetchPolicy||"cache-first":c,d=r.errorPolicy,p=d===void 0?u&&u.errorPolicy||"none":d,f=r.returnPartialData,h=f===void 0?!1:f,y=r.notifyOnNetworkStatusChange,v=y===void 0?!1:y,E=r.context,_=E===void 0?{}:E,b=Object.assign({},r,{query:a,variables:o,fetchPolicy:l,errorPolicy:p,returnPartialData:h,notifyOnNetworkStatusChange:v,context:_}),g=function(T){b.variables=T;var C=i.fetchQueryByPolicy(s,b,n);return b.fetchPolicy!=="standby"&&C.length>0&&s.observableQuery&&s.observableQuery.applyNextFetchPolicy("after-fetch",r),C},A=function(){return i.fetchCancelFns.delete(e)};this.fetchCancelFns.set(e,function(T){A(),setTimeout(function(){return R.cancel(T)})});var R=new Bn(this.transform(b.query).hasClientExports?this.localState.addExportedVariables(b.query,b.variables,b.context).then(g):g(b.variables));return R.promise.then(A,A),R},t.prototype.refetchQueries=function(e){var r=this,n=e.updateCache,i=e.include,a=e.optimistic,o=a===void 0?!1:a,s=e.removeOptimistic,u=s===void 0?o?Fi("refetchQueries"):void 0:s,c=e.onQueryUpdated,l=new Map;i&&this.getObservableQueries(i).forEach(function(p,f){l.set(f,{oq:p,lastDiff:r.getQuery(f).getDiff()})});var d=new Map;return n&&this.cache.batch({update:n,optimistic:o&&u||!1,removeOptimistic:u,onWatchUpdated:function(p,f,h){var y=p.watcher instanceof So&&p.watcher.observableQuery;if(y){if(c){l.delete(y.queryId);var v=c(y,f,h);return v===!0&&(v=y.refetch()),v!==!1&&d.set(y,v),v}c!==null&&l.set(y.queryId,{oq:y,lastDiff:h,diff:f})}}}),l.size&&l.forEach(function(p,f){var h=p.oq,y=p.lastDiff,v=p.diff,E;if(c){if(!v){var _=h.queryInfo;_.reset(),v=_.getDiff()}E=c(h,v,y)}(!c||E===!0)&&(E=h.refetch()),E!==!1&&d.set(h,E),f.indexOf("legacyOneTimeQuery")>=0&&r.stopQueryNoBroadcast(f)}),u&&this.cache.removeOptimistic(u),d},t.prototype.fetchQueryByPolicy=function(e,r,n){var i=this,a=r.query,o=r.variables,s=r.fetchPolicy,u=r.refetchWritePolicy,c=r.errorPolicy,l=r.returnPartialData,d=r.context,p=r.notifyOnNetworkStatusChange,f=e.networkStatus;e.init({document:this.transform(a).document,variables:o,networkStatus:n});var h=function(){return e.getDiff(o)},y=function(g,A){A===void 0&&(A=e.networkStatus||oe.loading);var R=g.result;__DEV__&&!l&&!ve(R,{})&&Uc(g.missing);var T=function(C){return J.of(w({data:C,loading:Tr(A),networkStatus:A},g.complete?null:{partial:!0}))};return R&&i.transform(a).hasForcedResolvers?i.localState.runResolvers({document:a,remoteResult:{data:R},context:d,variables:o,onlyRunForcedResolvers:!0}).then(function(C){return T(C.data||void 0)}):c==="none"&&A===oe.refetch&&Array.isArray(g.missing)?T(void 0):T(R)},v=s==="no-cache"?0:n===oe.refetch&&u!=="merge"?1:2,E=function(){return i.getResultsFromLink(e,v,{variables:o,context:d,fetchPolicy:s,errorPolicy:c})},_=p&&typeof f=="number"&&f!==n&&Tr(n);switch(s){default:case"cache-first":{var b=h();return b.complete?[y(b,e.markReady())]:l||_?[y(b),E()]:[E()]}case"cache-and-network":{var b=h();return b.complete||l||_?[y(b),E()]:[E()]}case"cache-only":return[y(h(),e.markReady())];case"network-only":return _?[y(h()),E()]:[E()];case"no-cache":return _?[y(e.getDiff()),E()]:[E()];case"standby":return[]}},t.prototype.getQuery=function(e){return e&&!this.queries.has(e)&&this.queries.set(e,new So(this,e)),this.queries.get(e)},t.prototype.prepareContext=function(e){e===void 0&&(e={});var r=this.localState.prepareContext(e);return w(w({},r),{clientAwareness:this.clientAwareness})},t}();var Gf=!1;var Bc=function(){function t(e){var r=this;this.resetStoreCallbacks=[],this.clearStoreCallbacks=[];var n=e.uri,i=e.credentials,a=e.headers,o=e.cache,s=e.ssrMode,u=s===void 0?!1:s,c=e.ssrForceFetchDelay,l=c===void 0?0:c,d=e.connectToDevTools,p=d===void 0?typeof window=="object"&&!window.__APOLLO_CLIENT__&&__DEV__:d,f=e.queryDeduplication,h=f===void 0?!0:f,y=e.defaultOptions,v=e.assumeImmutableResults,E=v===void 0?!1:v,_=e.resolvers,b=e.typeDefs,g=e.fragmentMatcher,A=e.name,R=e.version,T=e.link;if(T||(T=n?new yc({uri:n,credentials:i,headers:a}):Tt.empty()),!o)throw __DEV__?new V(`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 V(9);if(this.link=T,this.cache=o,this.disableNetworkFetches=u||l>0,this.queryDeduplication=h,this.defaultOptions=y||Object.create(null),this.typeDefs=b,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),p&&typeof window=="object"&&(window.__APOLLO_CLIENT__=this),!Gf&&p&&__DEV__&&(Gf=!0,typeof window<"u"&&window.document&&window.top===window.self&&!window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__)){var C=window.navigator,F=C&&C.userAgent,L=void 0;typeof F=="string"&&(F.indexOf("Chrome/")>-1?L="https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm":F.indexOf("Firefox/")>-1&&(L="https://addons.mozilla.org/en-US/firefox/addon/apollo-developer-tools/")),L&&__DEV__&&N.log("Download the Apollo DevTools for a better development experience: "+L)}this.version=Nl,this.localState=new wo({cache:o,client:this,resolvers:_,fragmentMatcher:g}),this.queryManager=new zf({cache:this.cache,link:this.link,defaultOptions:this.defaultOptions,queryDeduplication:h,ssrMode:u,clientAwareness:{name:A,version:R},localState:this.localState,assumeImmutableResults:E,onBroadcast:p?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=$i(this.defaultOptions.watchQuery,e)),this.disableNetworkFetches&&(e.fetchPolicy==="network-only"||e.fetchPolicy==="cache-and-network")&&(e=w(w({},e),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(e)},t.prototype.query=function(e){return this.defaultOptions.query&&(e=$i(this.defaultOptions.query,e)),__DEV__?N(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."):N(e.fetchPolicy!=="cache-and-network",10),this.disableNetworkFetches&&e.fetchPolicy==="network-only"&&(e=w(w({},e),{fetchPolicy:"cache-first"})),this.queryManager.query(e)},t.prototype.mutate=function(e){return this.defaultOptions.mutate&&(e=$i(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 Qn(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__&&N.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}();nl(Wr?"log":"silent");function et(t){return t===null?"null":Array.isArray(t)?"array":typeof t}function or(t){return et(t)==="object"}function Wf(t){return Array.isArray(t)&&t.length>0&&t.every(e=>"message"in e)}function Vc(t,e){return t.length<124?t:e}var Kf="graphql-transport-ws";var ct;(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"})(ct||(ct={}));var Te;(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"})(Te||(Te={}));function Hf(t){if(!or(t))throw new Error(`Message is expected to be an object, but got ${et(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 ${et(t.type)}`);switch(t.type){case Te.ConnectionInit:case Te.ConnectionAck:case Te.Ping:case Te.Pong:{if(t.payload!=null&&!or(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 Te.Subscribe:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${et(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);if(!or(t.payload))throw new Error(`"${t.type}" message expects the 'payload' property to be an object, but got ${et(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 ${et(t.payload.query)}`);if(t.payload.variables!=null&&!or(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 ${et(t.payload.variables)}`);if(t.payload.operationName!=null&&et(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 ${et(t.payload.operationName)}`);if(t.payload.extensions!=null&&!or(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 ${et(t.payload.extensions)}`);break}case Te.Next:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${et(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);if(!or(t.payload))throw new Error(`"${t.type}" message expects the 'payload' property to be an object, but got ${et(t.payload)}`);break}case Te.Error:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${et(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);if(!Wf(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 Te.Complete:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${et(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 Jf(t,e){return Hf(typeof t=="string"?JSON.parse(t,e):t)}function Yn(t,e){return Hf(t),JSON.stringify(t,e)}function Yf(t){let{url:e,connectionParams:r,lazy:n=!0,onNonLazyError:i=console.error,lazyCloseTimeout:a=0,keepAlive:o=0,disablePong:s,connectionAckWaitTimeout:u=0,retryAttempts:c=5,retryWait:l=async function(he){let me=1e3;for(let re=0;re<he;re++)me*=2;await new Promise(re=>setTimeout(re,me+Math.floor(Math.random()*(3e3-300)+300)))},shouldRetry:d=xo,isFatalConnectionProblem:p,on:f,webSocketImpl:h,generateID:y=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,he=>{let me=Math.random()*16|0;return(he=="x"?me:me&3|8).toString(16)})},jsonMessageReplacer:v,jsonMessageReviver:E}=t,_;if(h){if(!uy(h))throw new Error("Invalid WebSocket implementation provided");_=h}else typeof WebSocket<"u"?_=WebSocket:typeof global<"u"?_=global.WebSocket||global.MozWebSocket:typeof window<"u"&&(_=window.WebSocket||window.MozWebSocket);if(!_)throw new Error("WebSocket implementation missing; on Node you can `import WebSocket from 'ws';` and pass `webSocketImpl: WebSocket` to `createClient`");let b=_,g=(()=>{let B=(()=>{let me={};return{on(re,ne){return me[re]=ne,()=>{delete me[re]}},emit(re){var ne;"id"in re&&((ne=me[re.id])===null||ne===void 0||ne.call(me,re))}}})(),he={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?[B.emit,f.message]:[B.emit],closed:f?.closed?[f.closed]:[],error:f?.error?[f.error]:[]};return{onMessage:B.on,on(me,re){let ne=he[me];return ne.push(re),()=>{ne.splice(ne.indexOf(re),1)}},emit(me,...re){for(let ne of[...he[me]])ne(...re)}}})();function A(B){let he=[g.on("error",me=>{he.forEach(re=>re()),B(me)}),g.on("closed",me=>{he.forEach(re=>re()),B(me)})]}let R,T=0,C,F=!1,L=0,q=!1;async function Ve(){clearTimeout(C);let[B,he]=await(R??(R=new Promise((ne,Ut)=>(async()=>{if(F){if(await l(L),!T)return R=void 0,Ut({code:1e3,reason:"All Subscriptions Gone"});L++}g.emit("connecting");let H=new b(typeof e=="function"?await e():e,Kf),qt,yr;function Ua(){isFinite(o)&&o>0&&(clearTimeout(yr),yr=setTimeout(()=>{H.readyState===b.OPEN&&(H.send(Yn({type:Te.Ping})),g.emit("ping",!1,void 0))},o))}A(Qe=>{R=void 0,clearTimeout(qt),clearTimeout(yr),Ut(Qe),xo(Qe)&&Qe.code===4499&&(H.close(4499,"Terminated"),H.onerror=null,H.onclose=null)}),H.onerror=Qe=>g.emit("error",Qe),H.onclose=Qe=>g.emit("closed",Qe),H.onopen=async()=>{try{g.emit("opened",H);let Qe=typeof r=="function"?await r():r;if(H.readyState!==b.OPEN)return;H.send(Yn(Qe?{type:Te.ConnectionInit,payload:Qe}:{type:Te.ConnectionInit},v)),isFinite(u)&&u>0&&(qt=setTimeout(()=>{H.close(ct.ConnectionAcknowledgementTimeout,"Connection acknowledgement timeout")},u)),Ua()}catch(Qe){g.emit("error",Qe),H.close(ct.InternalClientError,Vc(Qe instanceof Error?Qe.message:new Error(Qe).message,"Internal client error"))}};let Ln=!1;H.onmessage=({data:Qe})=>{try{let ze=Jf(Qe,E);if(g.emit("message",ze),ze.type==="ping"||ze.type==="pong"){g.emit(ze.type,!0,ze.payload),ze.type==="pong"?Ua():s||(H.send(Yn(ze.payload?{type:Te.Pong,payload:ze.payload}:{type:Te.Pong})),g.emit("pong",!1,ze.payload));return}if(Ln)return;if(ze.type!==Te.ConnectionAck)throw new Error(`First message cannot be of type ${ze.type}`);clearTimeout(qt),Ln=!0,g.emit("connected",H,ze.payload),F=!1,L=0,ne([H,new Promise((P_,gh)=>A(gh))])}catch(ze){H.onmessage=null,g.emit("error",ze),H.close(ct.BadResponse,Vc(ze instanceof Error?ze.message:new Error(ze).message,"Bad response"))}}})())));B.readyState===b.CLOSING&&await he;let me=()=>{},re=new Promise(ne=>me=ne);return[B,me,Promise.race([re.then(()=>{if(!T){let ne=()=>B.close(1e3,"Normal Closure");isFinite(a)&&a>0?C=setTimeout(()=>{B.readyState===b.OPEN&&ne()},a):ne()}}),he])]}function Pe(B){if(xo(B)&&(cy(B.code)||[ct.InternalServerError,ct.InternalClientError,ct.BadRequest,ct.BadResponse,ct.Unauthorized,ct.SubprotocolNotAcceptable,ct.SubscriberAlreadyExists,ct.TooManyInitialisationRequests].includes(B.code)))throw B;if(q)return!1;if(xo(B)&&B.code===1e3)return T>0;if(!c||L>=c||!d(B)||p?.(B))throw B;return F=!0}return n||(async()=>{for(T++;;)try{let[,,B]=await Ve();await B}catch(B){try{if(!Pe(B))return}catch(he){return i?.(he)}}})(),{on:g.on,subscribe(B,he){let me=y(B),re=!1,ne=!1,Ut=()=>{T--,re=!0};return(async()=>{for(T++;;)try{let[H,qt,yr]=await Ve();if(re)return qt();let Ua=g.onMessage(me,Ln=>{switch(Ln.type){case Te.Next:{he.next(Ln.payload);return}case Te.Error:{ne=!0,re=!0,he.error(Ln.payload),Ut();return}case Te.Complete:{re=!0,Ut();return}}});H.send(Yn({id:me,type:Te.Subscribe,payload:B},v)),Ut=()=>{!re&&H.readyState===b.OPEN&&H.send(Yn({id:me,type:Te.Complete},v)),T--,re=!0,qt()},await yr.finally(Ua);return}catch(H){if(!Pe(H))return}})().then(()=>{ne||he.complete()}).catch(H=>{he.error(H)}),()=>{re||Ut()}},async dispose(){if(q=!0,R){let[B]=await R;B.close(1e3,"Normal Closure")}},terminate(){R&&g.emit("closed",{code:4499,reason:"Terminated",wasClean:!1})}}}function xo(t){return or(t)&&"code"in t&&"reason"in t}function cy(t){return[1e3,1001,1006,1005,1012,1013,1013].includes(t)?!1:t>=1e3&&t<=1999}function uy(t){return typeof t=="function"&&"constructor"in t&&"CLOSED"in t&&"CLOSING"in t&&"CONNECTING"in t&&"OPEN"in t}function ly(t){return ie(t)&&"code"in t&&"reason"in t}var Zf=function(t){xe(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 J(function(i){return n.client.subscribe(w(w({},r),{query:Fn(r.query)}),{next:i.next.bind(i),complete:i.complete.bind(i),error:function(a){return a instanceof Error?i.error(a):ly(a)?i.error(new Error("Socket closed with event ".concat(a.code," ").concat(a.reason||""))):i.error(new ar({graphQLErrors:Array.isArray(a)?a:[a]}))}})})},e}(Tt);var ts=function(){return ts=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},ts.apply(this,arguments)};typeof SuppressedError=="function"&&SuppressedError;function Mo(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Mo=function(r){return typeof r}:Mo=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Mo(t)}function fy(t){return Mo(t)=="object"&&t!==null}var hd=typeof Symbol=="function"&&Symbol.toStringTag!=null?Symbol.toStringTag:"@@toStringTag";function lu(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 py(t){return md(t.source,lu(t.source,t.start))}function md(t,e){var r=t.locationOffset.column-1,n=jo(r)+t.body,i=e.line-1,a=t.locationOffset.line-1,o=e.line+a,s=e.line===1?r:0,u=e.column+s,c="".concat(t.name,":").concat(o,":").concat(u,`
52
- `),l=n.split(/\r\n|[\n\r]/g),d=l[i];if(d.length>120){for(var p=Math.floor(u/80),f=u%80,h=[],y=0;y<d.length;y+=80)h.push(d.slice(y,y+80));return c+Xf([["".concat(o),h[0]]].concat(h.slice(1,p+1).map(function(v){return["",v]}),[[" ",jo(f-1)+"^"],["",h[p+1]]]))}return c+Xf([["".concat(o-1),l[i-1]],["".concat(o),d],["",jo(u-1)+"^"],["".concat(o+1),l[i+1]]])}function Xf(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 dy(r,i)+(a?" | "+a:" |")}).join(`
53
- `)}function jo(t){return Array(t+1).join(" ")}function dy(t,e){return jo(t-e.length)+e}function Uo(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Uo=function(r){return typeof r}:Uo=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Uo(t)}function ep(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 hy(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?ep(Object(r),!0).forEach(function(n){my(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ep(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function my(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function yy(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function tp(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 gy(t,e,r){return e&&tp(t.prototype,e),r&&tp(t,r),t}function vy(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&&_a(t,e)}function by(t){var e=gd();return function(){var n=wa(t),i;if(e){var a=wa(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return yd(this,i)}}function yd(t,e){return e&&(Uo(e)==="object"||typeof e=="function")?e:Hi(t)}function Hi(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function fu(t){var e=typeof Map=="function"?new Map:void 0;return fu=function(n){if(n===null||!_y(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 qo(n,arguments,wa(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),_a(i,n)},fu(t)}function qo(t,e,r){return gd()?qo=Reflect.construct:qo=function(i,a,o){var s=[null];s.push.apply(s,a);var u=Function.bind.apply(i,s),c=new u;return o&&_a(c,o.prototype),c},qo.apply(null,arguments)}function gd(){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 _y(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function _a(t,e){return _a=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},_a(t,e)}function wa(t){return wa=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},wa(t)}var wy=function(t){vy(r,t);var e=by(r);function r(n,i,a,o,s,u,c){var l,d,p,f;yy(this,r),f=e.call(this,n),f.name="GraphQLError",f.originalError=u??void 0,f.nodes=rp(Array.isArray(i)?i:i?[i]:void 0);for(var h=[],y=0,v=(E=f.nodes)!==null&&E!==void 0?E:[];y<v.length;y++){var E,_=v[y],b=_.loc;b!=null&&h.push(b)}h=rp(h),f.source=a??((l=h)===null||l===void 0?void 0:l[0].source),f.positions=o??((d=h)===null||d===void 0?void 0:d.map(function(A){return A.start})),f.locations=o&&a?o.map(function(A){return lu(a,A)}):(p=h)===null||p===void 0?void 0:p.map(function(A){return lu(A.source,A.start)}),f.path=s??void 0;var g=u?.extensions;return c==null&&fy(g)?f.extensions=hy({},g):f.extensions=c??{},Object.defineProperties(Hi(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}}),u!=null&&u.stack?(Object.defineProperty(Hi(f),"stack",{value:u.stack,writable:!0,configurable:!0}),yd(f)):(Error.captureStackTrace?Error.captureStackTrace(Hi(f),r):Object.defineProperty(Hi(f),"stack",{value:Error().stack,writable:!0,configurable:!0}),f)}return gy(r,[{key:"toString",value:function(){return Sy(this)}},{key:hd,get:function(){return"Object"}}]),r}(fu(Error));function rp(t){return t===void 0||t.length===0?void 0:t}function Sy(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},ar=function(t){xe(e,t);function e(r){var n=r.graphQLErrors,i=r.clientErrors,a=r.networkError,o=r.errorMessage,s=r.extraInfo,u=t.call(this,o)||this;return u.name="ApolloError",u.graphQLErrors=n||[],u.clientErrors=i||[],u.networkError=a||null,u.message=o||ag(u),u.extraInfo=s,u.__proto__=e.prototype,u}return e}(Error);var oe;(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"})(oe||(oe={}));function Tr(t){return t?t<7:!1}var og=Object.assign,sg=Object.hasOwnProperty,Io=function(t){xe(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=cg)}catch{}var S=!o.observers.size;o.observers.add(b);var _=o.last;return _&&_.error?b.error&&b.error(_.error):_&&_.result&&b.next&&b.next(_.result),S&&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,u=s===void 0?{}:s,c=u.fetchPolicy,l=c===void 0?"cache-first":c,d=a.fetchPolicy,p=d===void 0?l:d,f=a.initialFetchPolicy,m=f===void 0?p==="standby"?l:p:f;o.options=w(w({},a),{initialFetchPolicy:m,fetchPolicy:p}),o.queryId=i.queryId||n.generateQueryId();var y=Qt(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||oe.ready,a=w(w({},n),{loading:Tr(i),networkStatus:i}),o=this.options.fetchPolicy,s=o===void 0?"cache-first":o;if(!(s==="network-only"||s==="no-cache"||s==="standby"||this.queryManager.transform(this.options.query).hasForcedResolvers)){var u=this.queryInfo.getDiff();(u.complete||this.options.returnPartialData)&&(a.data=u.result),ve(a.data,{})&&(a.data=void 0),u.complete?(delete a.partial,u.complete&&a.networkStatus===oe.loading&&(s==="cache-first"||s==="cache-only")&&(a.networkStatus=oe.ready,a.loading=!1)):a.partial=!0,__DEV__&&!u.complete&&!this.options.partialRefetch&&!a.loading&&!a.data&&!a.error&&Vc(u.missing)}return r&&this.updateLastResult(a),a},e.prototype.isDifferentFromLastResult=function(r,n){return!this.last||!ve(this.last.result,r)||n&&!ve(this.last.variables,n)},e.prototype.getLast=function(r,n){var i=this.last;if(i&&i[r]&&(!n||ve(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&&sg.call(r,"variables")){var o=Ci(this.query),s=o.variableDefinitions;(!s||!s.some(function(u){return u.variable.name.value==="variables"}))&&__DEV__&&P.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&&!ve(this.options.variables,r)&&(i.variables=this.options.variables=w(w({},this.options.variables),r)),this.queryInfo.resetLastWrite(),this.reobserve(i,oe.refetch)},e.prototype.fetchMore=function(r){var n=this,i=w(w({},r.query?r:w(w(w(w({},this.options),{query:this.query}),r),{variables:w(w({},this.options.variables),r.variables)})),{fetchPolicy:"no-cache"}),a=this.queryManager.generateQueryId(),o=this.queryInfo,s=o.networkStatus;o.networkStatus=oe.fetchMore,i.notifyOnNetworkStatusChange&&this.observe();var u=new Set;return this.queryManager.fetchQuery(a,i,oe.fetchMore).then(function(c){return n.queryManager.removeQuery(a),o.networkStatus===oe.fetchMore&&(o.networkStatus=s),n.queryManager.cache.batch({update:function(l){var d=r.updateQuery;d?l.updateQuery({query:n.query,variables:n.variables,returnPartialData:!0,optimistic:!1},function(p){return d(p,{fetchMoreResult:c.data,variables:i.variables})}):l.writeQuery({query:i.query,variables:i.variables,data:c.data})},onWatchUpdated:function(l){u.add(l.query)}}),c}).finally(function(){u.has(n.query)||Bc(n)})},e.prototype.subscribeToMore=function(r){var n=this,i=this.queryManager.startGraphQLSubscription({query:r.document,variables:r.variables,context:r.context}).subscribe({next:function(a){var o=r.updateQuery;o&&n.updateQuery(function(s,u){var c=u.variables;return o(s,{subscriptionData:a,variables:c})})},error:function(a){if(r.onError){r.onError(a);return}__DEV__&&P.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 ve(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},oe.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__?P(a,"Attempted to start a polling query without a polling interval."):P(a,13);var o=i||(this.pollingInfo={});o.interval=a;var s=function(){r.pollingInfo&&(Tr(r.queryInfo.networkStatus)?u():r.reobserve({fetchPolicy:r.options.initialFetchPolicy==="no-cache"?"no-cache":"network-only"},oe.poll).then(u,u))},u=function(){var c=r.pollingInfo;c&&(clearTimeout(c.timeout),c.timeout=setTimeout(s,c.interval))};u()}}},e.prototype.updateLastResult=function(r,n){return n===void 0&&(n=this.variables),this.last=w(w({},this.last),{result:this.queryManager.assumeImmutableResults?r:no(r),variables:n}),Re(r.errors)||delete this.last.error,this.last},e.prototype.reobserve=function(r,n){var i=this;this.isTornDown=!1;var a=n===oe.refetch||n===oe.fetchMore||n===oe.poll,o=this.options.variables,s=this.options.fetchPolicy,u=wr(this.options,r||{}),c=a?u:og(this.options,u);a||(this.updatePolling(),r&&r.variables&&!ve(r.variables,o)&&c.fetchPolicy!=="standby"&&c.fetchPolicy===s&&(this.applyNextFetchPolicy("variables-changed",c),n===void 0&&(n=oe.setVariables)));var l=c.variables&&w({},c.variables),d=this.fetch(c,n),p={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=d,this.observer=p),d.addObserver(p),d.promise},e.prototype.observe=function(){this.reportResult(this.getCurrentResult(!1),this.variables)},e.prototype.reportResult=function(r,n){var i=this.getLastError();(i||this.isDifferentFromLastResult(r,n))&&((i||!r.partial||this.options.returnPartialData)&&this.updateLastResult(r,n),tn(this.observers,"next",r))},e.prototype.reportError=function(r,n){var i=w(w({},this.getLastResult()),{error:r,errors:r.graphQLErrors,networkStatus:oe.error,loading:!1});this.updateLastResult(i,n),tn(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}(Z);ao(Io);function Bc(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 cg(t){__DEV__&&P.error("Unhandled error",t.message,t.stack)}function Vc(t){__DEV__&&t&&__DEV__&&P.debug("Missing cache result fields: ".concat(JSON.stringify(t)),t)}var To=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=rc(r.resolvers,n)}):this.resolvers=rc(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 Ct(this,void 0,void 0,function(){return Rt(this,function(u){return r?[2,this.resolveDocument(r,n.data,i,a,this.fragmentMatcher,s).then(function(c){return w(w({},n),{data:c.result})})]:[2,n]})})},t.prototype.setFragmentMatcher=function(e){this.fragmentMatcher=e},t.prototype.getFragmentMatcher=function(){return this.fragmentMatcher},t.prototype.clientQuery=function(e){return $n(["client"],e)&&this.resolvers?e:null},t.prototype.serverQuery=function(e){return tc(e)},t.prototype.prepareContext=function(e){var r=this.cache;return w(w({},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={}),Ct(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 w(w({},r),a.exportedVariables)})]:[2,w({},r)]})})},t.prototype.shouldForceResolvers=function(e){var r=!1;return Ye(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 Kr}}}),r},t.prototype.buildRootValueFromCache=function(e,r){return this.cache.diff({query:ec(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),Ct(this,void 0,void 0,function(){var s,u,c,l,d,p,f,m,y,b,E;return Rt(this,function(S){return s=Zr(e),u=Yr(e),c=Hr(u),l=this.collectSelectionsToResolve(s,c),d=s.operation,p=d?d.charAt(0).toUpperCase()+d.slice(1):"Query",f=this,m=f.cache,y=f.client,b={fragmentMap:c,context:w(w({},n),{cache:m,client:y}),variables:i,fragmentMatcher:a,defaultOperationType:p,exportedVariables:{},selectionsToResolve:l,onlyRunForcedResolvers:o},E=!1,[2,this.resolveSelectionSet(s.selectionSet,E,r,b).then(function(_){return{result:_,exportedVariables:b.exportedVariables}})]})})},t.prototype.resolveSelectionSet=function(e,r,n,i){return Ct(this,void 0,void 0,function(){var a,o,s,u,c,l=this;return Rt(this,function(d){return a=i.fragmentMap,o=i.context,s=i.variables,u=[n],c=function(p){return Ct(l,void 0,void 0,function(){var f,m;return Rt(this,function(y){return!r&&!i.selectionsToResolve.has(p)?[2]:nr(p,s)?mt(p)?[2,this.resolveField(p,r,n,i).then(function(b){var E;typeof b<"u"&&u.push((E={},E[It(p)]=b,E))})]:(Js(p)?f=p:(f=a[p.name.value],__DEV__?P(f,"No fragment named ".concat(p.name.value)):P(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){u.push(b)})]:[2]):[2]})})},[2,Promise.all(e.selections.map(c)).then(function(){return Ri(u)})]})})},t.prototype.resolveField=function(e,r,n,i){return Ct(this,void 0,void 0,function(){var a,o,s,u,c,l,d,p,f,m=this;return Rt(this,function(y){return n?(a=i.variables,o=e.name.value,s=It(e),u=o!==s,c=n[s]||n[o],l=Promise.resolve(c),(!i.onlyRunForcedResolvers||this.shouldForceResolvers(e))&&(d=n.__typename||i.defaultOperationType,p=this.resolvers&&this.resolvers[d],p&&(f=p[u?o:s],f&&(l=Promise.resolve(Kn.withValue(this.cache,f,[n,ir(e,a),i.context,{field:e,fragmentMap:i.fragmentMap}]))))),[2,l.then(function(b){var E,S;if(b===void 0&&(b=c),e.directives&&e.directives.forEach(function(g){g.name.value==="export"&&g.arguments&&g.arguments.forEach(function(A){A.name.value==="as"&&A.value.kind==="StringValue"&&(i.exportedVariables[A.value.value]=b)})}),!e.selectionSet||b==null)return b;var _=(S=(E=e.directives)===null||E===void 0?void 0:E.some(function(g){return g.name.value==="client"}))!==null&&S!==void 0?S:!1;if(Array.isArray(b))return m.resolveSubSelectedArray(e,r||_,b,i);if(e.selectionSet)return m.resolveSelectionSet(e.selectionSet,r||_,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),Ye(o,{Directive:function(u,c,l,d,p){u.name.value==="client"&&p.forEach(function(f){n(f)&&Ai(f)&&s.add(f)})},FragmentSpread:function(u,c,l,d,p){var f=r[u.name.value];__DEV__?P(f,"No fragment named ".concat(u.name.value)):P(f,12);var m=a(f);m.size>0&&(p.forEach(function(y){n(y)&&Ai(y)&&s.add(y)}),s.add(u),m.forEach(function(y){s.add(y)}))}})}return i.get(o)}return a(e)},t}();var Jn=new(Tt?WeakMap:Map);function Qc(t,e){var r=t[e];typeof r=="function"&&(t[e]=function(){return Jn.set(t,(Jn.get(t)+1)%1e15),r.apply(this,arguments)})}function Wf(t){t.notifyTimeout&&(clearTimeout(t.notifyTimeout),t.notifyTimeout=void 0)}var ko=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;Jn.has(n)||(Jn.set(n,0),Qc(n,"evict"),Qc(n,"modify"),Qc(n,"reset"))}return t.prototype.init=function(e){var r=e.networkStatus||oe.loading;return this.variables&&this.networkStatus!==oe.loading&&!ve(this.variables,e.variables)&&(r=oe.setVariables),ve(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(){Wf(this),this.dirty=!1},t.prototype.getDiff=function(e){e===void 0&&(e=this.variables);var r=this.getDiffOptions(e);if(this.lastDiff&&ve(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&&!ve(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():Bc(e)})):delete this.oqListener)},t.prototype.notify=function(){var e=this;Wf(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(Tr(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=w(w({},this.getDiffOptions(e)),{watcher:this,callback:function(a){return r.setDiff(a)}});(!this.lastWatch||!ve(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===Jn.get(this.cache)&&ve(r,n.variables)&&ve(e.data,n.result.data))},t.prototype.markResult=function(e,r,n,i){var a=this,o=new st,s=Re(e.errors)?e.errors.slice(0):[];if(this.reset(),"incremental"in e&&Re(e.incremental)){var u=oo(this.getDiff().result,e);e.data=u}else if("hasNext"in e&&e.hasNext){var c=this.getDiff();e.data=o.merge(c.result,e.data)}this.graphQLErrors=s,n.fetchPolicy==="no-cache"?this.updateLastDiff({result:e.data,complete:!0},this.getDiffOptions(n.variables)):i!==0&&(Oo(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:Jn.get(a.cache)};else if(a.lastDiff&&a.lastDiff.diff.complete){e.data=a.lastDiff.diff.result;return}var d=a.getDiffOptions(n.variables),p=l.diff(d);a.stopped||a.updateWatch(n.variables),a.updateLastDiff(p,d),p.complete&&(e.data=p.result)}):this.lastWrite=void 0)},t.prototype.markReady=function(){return this.networkError=null,this.networkStatus=oe.ready},t.prototype.markError=function(e){return this.networkStatus=oe.error,this.lastWrite=void 0,this.reset(),e.graphQLErrors&&(this.graphQLErrors=e.graphQLErrors),e.networkError&&(this.networkError=e.networkError),e},t}();function Oo(t,e){e===void 0&&(e="none");var r=e==="ignore"||e==="all",n=!Vn(t);return!n&&r&&t.data&&(n=!0),n}var ug=Object.prototype.hasOwnProperty,Kf=function(){function t(e){var r=e.cache,n=e.link,i=e.defaultOptions,a=e.queryDeduplication,o=a===void 0?!1:a,s=e.onBroadcast,u=e.ssrMode,c=u===void 0?!1:u,l=e.clientAwareness,d=l===void 0?{}:l,p=e.localState,f=e.assumeImmutableResults;this.clientAwareness={},this.queries=new Map,this.fetchCancelFns=new Map,this.transformCache=new(Tt?WeakMap:Map),this.queryIdCounter=1,this.requestIdCounter=1,this.mutationIdCounter=1,this.inFlightLinkObservables=new Map,this.cache=r,this.link=n,this.defaultOptions=i||Object.create(null),this.queryDeduplication=o,this.clientAwareness=d,this.localState=p||new To({cache:r}),this.ssrMode=c,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 Q("QueryManager stopped while query was in flight"):new Q(14))},t.prototype.cancelPendingFetches=function(e){this.fetchCancelFns.forEach(function(r){return r(e)}),this.fetchCancelFns.clear()},t.prototype.mutate=function(e){var r,n,i=e.mutation,a=e.variables,o=e.optimisticResponse,s=e.updateQueries,u=e.refetchQueries,c=u===void 0?[]:u,l=e.awaitRefetchQueries,d=l===void 0?!1:l,p=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,S=e.keepRootFields,_=e.context;return Ct(this,void 0,void 0,function(){var g,A,R,T,C,F;return Rt(this,function(L){switch(L.label){case 0:return __DEV__?P(i,"mutation option is required. You must specify your GraphQL document in the mutation option."):P(i,15),__DEV__?P(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."):P(y==="network-only"||y==="no-cache",16),g=this.generateMutationId(),A=this.transform(i),R=A.document,T=A.hasClientExports,i=this.cache.transformForLink(R),a=this.getVariables(i,a),T?[4,this.localState.addExportedVariables(i,a,_)]:[3,2];case 1:a=L.sent(),L.label=2;case 2:return C=this.mutationStore&&(this.mutationStore[g]={mutation:i,variables:a,loading:!0,error:null}),o&&this.markMutationOptimistic(o,{mutationId:g,document:i,variables:a,fetchPolicy:y,errorPolicy:E,context:_,updateQueries:s,update:p,keepRootFields:S}),this.broadcastQueries(),F=this,[2,new Promise(function(q,Ve){return io(F.getObservableFromLink(i,w(w({},_),{optimisticResponse:o}),a,!1),function(Ce){if(Vn(Ce)&&E==="none")throw new ar({graphQLErrors:so(Ce)});C&&(C.loading=!1,C.error=null);var B=w({},Ce);return typeof c=="function"&&(c=c(B)),E==="ignore"&&Vn(B)&&delete B.errors,F.markMutationResult({mutationId:g,result:B,document:i,variables:a,fetchPolicy:y,errorPolicy:E,context:_,update:p,updateQueries:s,awaitRefetchQueries:d,refetchQueries:c,removeOptimistic:o?g:void 0,onQueryUpdated:f,keepRootFields:S})}).subscribe({next:function(Ce){F.broadcastQueries(),(!("hasNext"in Ce)||Ce.hasNext===!1)&&q(Ce)},error:function(Ce){C&&(C.loading=!1,C.error=Ce),o&&F.cache.removeOptimistic(g),F.broadcastQueries(),Ve(Ce instanceof ar?Ce:new ar({networkError:Ce}))}})})]}})})},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&&Oo(i,e.errorPolicy)){if(Sr(i)||a.push({result:i.data,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}),Sr(i)&&Re(i.incremental)){var s=r.diff({id:"ROOT_MUTATION",query:this.transform(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0}),u=void 0;s.result&&(u=oo(s.result,i)),typeof u<"u"&&(i.data=u,a.push({result:u,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}))}var c=e.updateQueries;c&&this.queries.forEach(function(d,p){var f=d.observableQuery,m=f&&f.queryName;if(!(!m||!ug.call(c,m))){var y=c[m],b=n.queries.get(p),E=b.document,S=b.variables,_=r.diff({query:E,variables:S,returnPartialData:!0,optimistic:!1}),g=_.result,A=_.complete;if(A&&g){var R=y(g,{mutationResult:i,queryName:E&&Un(E)||void 0,queryVariables:S});R&&a.push({result:R,dataId:"ROOT_QUERY",query:E,variables:S})}}})}if(a.length>0||e.refetchQueries||e.update||e.onQueryUpdated||e.removeOptimistic){var l=[];if(this.refetchQueries({updateCache:function(d){o||a.forEach(function(y){return d.write(y)});var p=e.update,f=!Dl(i)||Sr(i)&&!i.hasNext;if(p){if(!o){var m=d.diff({id:"ROOT_MUTATION",query:n.transform(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0});m.complete&&(i=w(w({},i),{data:m.result}),"incremental"in i&&delete i.incremental,"hasNext"in i&&delete i.hasNext)}f&&p(d,i,{context:e.context,variables:e.variables})}!o&&!e.keepRootFields&&f&&d.modify({id:"ROOT_MUTATION",fields:function(y,b){var E=b.fieldName,S=b.DELETE;return E==="__typename"?y:S}})},include:e.refetchQueries,optimistic:!1,removeOptimistic:e.removeOptimistic,onQueryUpdated:e.onQueryUpdated||null}).forEach(function(d){return l.push(d)}),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(w(w({},r),{result:{data:i}}),a)}catch(o){__DEV__&&P.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=Xs(n),a=this.localState.clientQuery(n),o=i&&this.localState.serverQuery(i),s={document:n,hasClientExports:Gs(n),hasForcedResolvers:this.localState.shouldForceResolvers(n),clientQuery:a,serverQuery:o,defaultVars:Xr(Qt(n)),asQuery:w(w({},n),{definitions:n.definitions.map(function(c){return c.kind==="OperationDefinition"&&c.operation!=="query"?w(w({},c),{operation:"query"}):c})})},u=function(c){c&&!r.has(c)&&r.set(c,s)};u(e),u(n),u(a),u(o)}return r.get(e)},t.prototype.getVariables=function(e,r){return w(w({},this.transform(e).defaultVars),r)},t.prototype.watchQuery=function(e){e=w(w({},e),{variables:this.getVariables(e.query,e.variables)}),typeof e.notifyOnNetworkStatusChange>"u"&&(e.notifyOnNetworkStatusChange=!1);var r=new ko(this),n=new Io({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__?P(e.query,"query option is required. You must specify your GraphQL document in the query option."):P(e.query,17),__DEV__?P(e.query.kind==="Document",'You must wrap the query string in a "gql" tag.'):P(e.query.kind==="Document",18),__DEV__?P(!e.returnPartialData,"returnPartialData option only supported on watchQuery."):P(!e.returnPartialData,19),__DEV__?P(!e.pollInterval,"pollInterval option only supported on watchQuery."):P(!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 Q("Store reset while query was in flight (not completed in link chain)"):new Q(21)),this.queries.forEach(function(r){r.observableQuery?r.networkStatus=oe.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):Ks(o)?i.set(r.transform(o).document,!1):ie(o)&&o.query&&a.add(o)}),this.queries.forEach(function(o,s){var u=o.observableQuery,c=o.document;if(u){if(e==="all"){n.set(s,u);return}var l=u.queryName,d=u.options.fetchPolicy;if(d==="standby"||e==="active"&&!u.hasObservers())return;(e==="active"||l&&i.has(l)||c&&i.has(c))&&(n.set(s,u),l&&i.set(l,!0),c&&i.set(c,!0))}}),a.size&&a.forEach(function(o){var s=$i("legacyOneTimeQuery"),u=r.getQuery(s).init({document:o.query,variables:o.variables}),c=new Io({queryManager:r,queryInfo:u,options:w(w({},o),{fetchPolicy:"network-only"})});P(c.queryId===s),u.setObservableQuery(c),n.set(s,c)}),__DEV__&&i.size&&i.forEach(function(o,s){o||__DEV__&&P.warn("Unknown query ".concat(typeof s=="string"?"named ":"").concat(JSON.stringify(s,null,2)," requested in refetchQueries options.include array"))}),n},t.prototype.reFetchObservableQueries=function(e){var r=this;e===void 0&&(e=!1);var n=[];return this.getObservableQueries(e?"all":"active").forEach(function(i,a){var o=i.options.fetchPolicy;i.resetLastResults(),(e||o!=="standby"&&o!=="cache-only")&&n.push(i.refetch()),r.getQuery(a).setDiff(null)}),this.broadcastQueries(),Promise.all(n)},t.prototype.setObservableQuery=function(e){this.getQuery(e.queryId).setObservableQuery(e)},t.prototype.startGraphQLSubscription=function(e){var r=this,n=e.query,i=e.fetchPolicy,a=e.errorPolicy,o=e.variables,s=e.context,u=s===void 0?{}:s;n=this.transform(n).document,o=this.getVariables(n,o);var c=function(d){return r.getObservableFromLink(n,u,d).map(function(p){if(i!=="no-cache"&&(Oo(p,a)&&r.cache.write({query:n,result:p.data,dataId:"ROOT_SUBSCRIPTION",variables:d}),r.broadcastQueries()),Vn(p))throw new ar({graphQLErrors:p.errors});return p})};if(this.transform(n).hasClientExports){var l=this.localState.addExportedVariables(n,o,u).then(c);return new Z(function(d){var p=null;return l.then(function(f){return p=f.subscribe(d)},d.error),function(){return p&&p.unsubscribe()}})}return c(o)},t.prototype.stopQuery=function(e){this.stopQueryNoBroadcast(e),this.broadcastQueries()},t.prototype.stopQueryNoBroadcast=function(e){this.stopQueryInStoreNoBroadcast(e),this.removeQuery(e)},t.prototype.removeQuery=function(e){this.fetchCancelFns.delete(e),this.queries.has(e)&&(this.getQuery(e).stop(),this.queries.delete(e))},t.prototype.broadcastQueries=function(){this.onBroadcast&&this.onBroadcast(),this.queries.forEach(function(e){return e.notify()})},t.prototype.getLocalState=function(){return this.localState},t.prototype.getObservableFromLink=function(e,r,n,i){var a=this,o;i===void 0&&(i=(o=r?.queryDeduplication)!==null&&o!==void 0?o:this.queryDeduplication);var s,u=this.transform(e).serverQuery;if(u){var c=this,l=c.inFlightLinkObservables,d=c.link,p={query:u,variables:n,operationName:Un(u)||void 0,context:this.prepareContext(w(w({},r),{forceFetch:!i}))};if(r=p.context,i){var f=l.get(u)||new Map;l.set(u,f);var m=gt(n);if(s=f.get(m),!s){var y=new Bn([Qn(d,p)]);f.set(m,s=y),y.beforeNext(function(){f.delete(m)&&f.size<1&&l.delete(u)})}}else s=new Bn([Qn(d,p)])}else s=new Bn([Z.of({data:{}})]),r=this.prepareContext(r);var b=this.transform(e).clientQuery;return b&&(s=io(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 io(this.getObservableFromLink(a,n.context,n.variables),function(o){var s=so(o),u=s.length>0;if(i>=e.lastRequestId){if(u&&n.errorPolicy==="none")throw e.markError(new ar({graphQLErrors:s}));e.markResult(o,a,n,r),e.markReady()}var c={data:o.data,loading:!1,networkStatus:oe.ready};return u&&n.errorPolicy!=="ignore"&&(c.errors=s,c.networkStatus=oe.error),c},function(o){var s=Gf(o)?o:new ar({networkError:o});throw i>=e.lastRequestId&&e.markError(s),s})},t.prototype.fetchQueryObservable=function(e,r,n){var i=this;n===void 0&&(n=oe.loading);var a=this.transform(r.query).document,o=this.getVariables(a,r.variables),s=this.getQuery(e),u=this.defaultOptions.watchQuery,c=r.fetchPolicy,l=c===void 0?u&&u.fetchPolicy||"cache-first":c,d=r.errorPolicy,p=d===void 0?u&&u.errorPolicy||"none":d,f=r.returnPartialData,m=f===void 0?!1:f,y=r.notifyOnNetworkStatusChange,b=y===void 0?!1:y,E=r.context,S=E===void 0?{}:E,_=Object.assign({},r,{query:a,variables:o,fetchPolicy:l,errorPolicy:p,returnPartialData:m,notifyOnNetworkStatusChange:b,context:S}),g=function(T){_.variables=T;var C=i.fetchQueryByPolicy(s,_,n);return _.fetchPolicy!=="standby"&&C.length>0&&s.observableQuery&&s.observableQuery.applyNextFetchPolicy("after-fetch",r),C},A=function(){return i.fetchCancelFns.delete(e)};this.fetchCancelFns.set(e,function(T){A(),setTimeout(function(){return R.cancel(T)})});var R=new Bn(this.transform(_.query).hasClientExports?this.localState.addExportedVariables(_.query,_.variables,_.context).then(g):g(_.variables));return R.promise.then(A,A),R},t.prototype.refetchQueries=function(e){var r=this,n=e.updateCache,i=e.include,a=e.optimistic,o=a===void 0?!1:a,s=e.removeOptimistic,u=s===void 0?o?$i("refetchQueries"):void 0:s,c=e.onQueryUpdated,l=new Map;i&&this.getObservableQueries(i).forEach(function(p,f){l.set(f,{oq:p,lastDiff:r.getQuery(f).getDiff()})});var d=new Map;return n&&this.cache.batch({update:n,optimistic:o&&u||!1,removeOptimistic:u,onWatchUpdated:function(p,f,m){var y=p.watcher instanceof ko&&p.watcher.observableQuery;if(y){if(c){l.delete(y.queryId);var b=c(y,f,m);return b===!0&&(b=y.refetch()),b!==!1&&d.set(y,b),b}c!==null&&l.set(y.queryId,{oq:y,lastDiff:m,diff:f})}}}),l.size&&l.forEach(function(p,f){var m=p.oq,y=p.lastDiff,b=p.diff,E;if(c){if(!b){var S=m.queryInfo;S.reset(),b=S.getDiff()}E=c(m,b,y)}(!c||E===!0)&&(E=m.refetch()),E!==!1&&d.set(m,E),f.indexOf("legacyOneTimeQuery")>=0&&r.stopQueryNoBroadcast(f)}),u&&this.cache.removeOptimistic(u),d},t.prototype.fetchQueryByPolicy=function(e,r,n){var i=this,a=r.query,o=r.variables,s=r.fetchPolicy,u=r.refetchWritePolicy,c=r.errorPolicy,l=r.returnPartialData,d=r.context,p=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(g,A){A===void 0&&(A=e.networkStatus||oe.loading);var R=g.result;__DEV__&&!l&&!ve(R,{})&&Vc(g.missing);var T=function(C){return Z.of(w({data:C,loading:Tr(A),networkStatus:A},g.complete?null:{partial:!0}))};return R&&i.transform(a).hasForcedResolvers?i.localState.runResolvers({document:a,remoteResult:{data:R},context:d,variables:o,onlyRunForcedResolvers:!0}).then(function(C){return T(C.data||void 0)}):c==="none"&&A===oe.refetch&&Array.isArray(g.missing)?T(void 0):T(R)},b=s==="no-cache"?0:n===oe.refetch&&u!=="merge"?1:2,E=function(){return i.getResultsFromLink(e,b,{variables:o,context:d,fetchPolicy:s,errorPolicy:c})},S=p&&typeof f=="number"&&f!==n&&Tr(n);switch(s){default:case"cache-first":{var _=m();return _.complete?[y(_,e.markReady())]:l||S?[y(_),E()]:[E()]}case"cache-and-network":{var _=m();return _.complete||l||S?[y(_),E()]:[E()]}case"cache-only":return[y(m(),e.markReady())];case"network-only":return S?[y(m()),E()]:[E()];case"no-cache":return S?[y(e.getDiff()),E()]:[E()];case"standby":return[]}},t.prototype.getQuery=function(e){return e&&!this.queries.has(e)&&this.queries.set(e,new ko(this,e)),this.queries.get(e)},t.prototype.prepareContext=function(e){e===void 0&&(e={});var r=this.localState.prepareContext(e);return w(w({},r),{clientAwareness:this.clientAwareness})},t}();var Hf=!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,u=s===void 0?!1:s,c=e.ssrForceFetchDelay,l=c===void 0?0:c,d=e.connectToDevTools,p=d===void 0?typeof window=="object"&&!window.__APOLLO_CLIENT__&&__DEV__:d,f=e.queryDeduplication,m=f===void 0?!0:f,y=e.defaultOptions,b=e.assumeImmutableResults,E=b===void 0?!1:b,S=e.resolvers,_=e.typeDefs,g=e.fragmentMatcher,A=e.name,R=e.version,T=e.link;if(T||(T=n?new bc({uri:n,credentials:i,headers:a}):kt.empty()),!o)throw __DEV__?new Q(`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 Q(9);if(this.link=T,this.cache=o,this.disableNetworkFetches=u||l>0,this.queryDeduplication=m,this.defaultOptions=y||Object.create(null),this.typeDefs=_,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),p&&typeof window=="object"&&(window.__APOLLO_CLIENT__=this),!Hf&&p&&__DEV__&&(Hf=!0,typeof window<"u"&&window.document&&window.top===window.self&&!window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__)){var C=window.navigator,F=C&&C.userAgent,L=void 0;typeof F=="string"&&(F.indexOf("Chrome/")>-1?L="https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm":F.indexOf("Firefox/")>-1&&(L="https://addons.mozilla.org/en-US/firefox/addon/apollo-developer-tools/")),L&&__DEV__&&P.log("Download the Apollo DevTools for a better development experience: "+L)}this.version=Rl,this.localState=new To({cache:o,client:this,resolvers:S,fragmentMatcher:g}),this.queryManager=new Kf({cache:this.cache,link:this.link,defaultOptions:this.defaultOptions,queryDeduplication:m,ssrMode:u,clientAwareness:{name:A,version:R},localState:this.localState,assumeImmutableResults:E,onBroadcast:p?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=Mi(this.defaultOptions.watchQuery,e)),this.disableNetworkFetches&&(e.fetchPolicy==="network-only"||e.fetchPolicy==="cache-and-network")&&(e=w(w({},e),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(e)},t.prototype.query=function(e){return this.defaultOptions.query&&(e=Mi(this.defaultOptions.query,e)),__DEV__?P(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."):P(e.fetchPolicy!=="cache-and-network",10),this.disableNetworkFetches&&e.fetchPolicy==="network-only"&&(e=w(w({},e),{fetchPolicy:"cache-first"})),this.queryManager.query(e)},t.prototype.mutate=function(e){return this.defaultOptions.mutate&&(e=Mi(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 Qn(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__&&P.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}();ol(Wr?"log":"silent");function et(t){return t===null?"null":Array.isArray(t)?"array":typeof t}function or(t){return et(t)==="object"}function Jf(t){return Array.isArray(t)&&t.length>0&&t.every(e=>"message"in e)}function zc(t,e){return t.length<124?t:e}var Yf="graphql-transport-ws";var ct;(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"})(ct||(ct={}));var Te;(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"})(Te||(Te={}));function Zf(t){if(!or(t))throw new Error(`Message is expected to be an object, but got ${et(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 ${et(t.type)}`);switch(t.type){case Te.ConnectionInit:case Te.ConnectionAck:case Te.Ping:case Te.Pong:{if(t.payload!=null&&!or(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 Te.Subscribe:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${et(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);if(!or(t.payload))throw new Error(`"${t.type}" message expects the 'payload' property to be an object, but got ${et(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 ${et(t.payload.query)}`);if(t.payload.variables!=null&&!or(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 ${et(t.payload.variables)}`);if(t.payload.operationName!=null&&et(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 ${et(t.payload.operationName)}`);if(t.payload.extensions!=null&&!or(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 ${et(t.payload.extensions)}`);break}case Te.Next:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${et(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);if(!or(t.payload))throw new Error(`"${t.type}" message expects the 'payload' property to be an object, but got ${et(t.payload)}`);break}case Te.Error:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${et(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);if(!Jf(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 Te.Complete:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${et(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 Xf(t,e){return Zf(typeof t=="string"?JSON.parse(t,e):t)}function Yn(t,e){return Zf(t),JSON.stringify(t,e)}function Gc(t){let{url:e,connectionParams:r,lazy:n=!0,onNonLazyError:i=console.error,lazyCloseTimeout:a=0,keepAlive:o=0,disablePong:s,connectionAckWaitTimeout:u=0,retryAttempts:c=5,retryWait:l=async function(he){let me=1e3;for(let re=0;re<he;re++)me*=2;await new Promise(re=>setTimeout(re,me+Math.floor(Math.random()*(3e3-300)+300)))},shouldRetry:d=Do,isFatalConnectionProblem:p,on:f,webSocketImpl:m,generateID:y=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,he=>{let me=Math.random()*16|0;return(he=="x"?me:me&3|8).toString(16)})},jsonMessageReplacer:b,jsonMessageReviver:E}=t,S;if(m){if(!fg(m))throw new Error("Invalid WebSocket implementation provided");S=m}else typeof WebSocket<"u"?S=WebSocket:typeof global<"u"?S=global.WebSocket||global.MozWebSocket:typeof window<"u"&&(S=window.WebSocket||window.MozWebSocket);if(!S)throw new Error("WebSocket implementation missing; on Node you can `import WebSocket from 'ws';` and pass `webSocketImpl: WebSocket` to `createClient`");let _=S,g=(()=>{let B=(()=>{let me={};return{on(re,ne){return me[re]=ne,()=>{delete me[re]}},emit(re){var ne;"id"in re&&((ne=me[re.id])===null||ne===void 0||ne.call(me,re))}}})(),he={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?[B.emit,f.message]:[B.emit],closed:f?.closed?[f.closed]:[],error:f?.error?[f.error]:[]};return{onMessage:B.on,on(me,re){let ne=he[me];return ne.push(re),()=>{ne.splice(ne.indexOf(re),1)}},emit(me,...re){for(let ne of[...he[me]])ne(...re)}}})();function A(B){let he=[g.on("error",me=>{he.forEach(re=>re()),B(me)}),g.on("closed",me=>{he.forEach(re=>re()),B(me)})]}let R,T=0,C,F=!1,L=0,q=!1;async function Ve(){clearTimeout(C);let[B,he]=await(R??(R=new Promise((ne,jt)=>(async()=>{if(F){if(await l(L),!T)return R=void 0,jt({code:1e3,reason:"All Subscriptions Gone"});L++}g.emit("connecting");let Y=new _(typeof e=="function"?await e():e,Yf),qt,gr;function Ga(){isFinite(o)&&o>0&&(clearTimeout(gr),gr=setTimeout(()=>{Y.readyState===_.OPEN&&(Y.send(Yn({type:Te.Ping})),g.emit("ping",!1,void 0))},o))}A(Qe=>{R=void 0,clearTimeout(qt),clearTimeout(gr),jt(Qe),Do(Qe)&&Qe.code===4499&&(Y.close(4499,"Terminated"),Y.onerror=null,Y.onclose=null)}),Y.onerror=Qe=>g.emit("error",Qe),Y.onclose=Qe=>g.emit("closed",Qe),Y.onopen=async()=>{try{g.emit("opened",Y);let Qe=typeof r=="function"?await r():r;if(Y.readyState!==_.OPEN)return;Y.send(Yn(Qe?{type:Te.ConnectionInit,payload:Qe}:{type:Te.ConnectionInit},b)),isFinite(u)&&u>0&&(qt=setTimeout(()=>{Y.close(ct.ConnectionAcknowledgementTimeout,"Connection acknowledgement timeout")},u)),Ga()}catch(Qe){g.emit("error",Qe),Y.close(ct.InternalClientError,zc(Qe instanceof Error?Qe.message:new Error(Qe).message,"Internal client error"))}};let Ln=!1;Y.onmessage=({data:Qe})=>{try{let ze=Xf(Qe,E);if(g.emit("message",ze),ze.type==="ping"||ze.type==="pong"){g.emit(ze.type,!0,ze.payload),ze.type==="pong"?Ga():s||(Y.send(Yn(ze.payload?{type:Te.Pong,payload:ze.payload}:{type:Te.Pong})),g.emit("pong",!1,ze.payload));return}if(Ln)return;if(ze.type!==Te.ConnectionAck)throw new Error(`First message cannot be of type ${ze.type}`);clearTimeout(qt),Ln=!0,g.emit("connected",Y,ze.payload),F=!1,L=0,ne([Y,new Promise((R_,bh)=>A(bh))])}catch(ze){Y.onmessage=null,g.emit("error",ze),Y.close(ct.BadResponse,zc(ze instanceof Error?ze.message:new Error(ze).message,"Bad response"))}}})())));B.readyState===_.CLOSING&&await he;let me=()=>{},re=new Promise(ne=>me=ne);return[B,me,Promise.race([re.then(()=>{if(!T){let ne=()=>B.close(1e3,"Normal Closure");isFinite(a)&&a>0?C=setTimeout(()=>{B.readyState===_.OPEN&&ne()},a):ne()}}),he])]}function Ce(B){if(Do(B)&&(lg(B.code)||[ct.InternalServerError,ct.InternalClientError,ct.BadRequest,ct.BadResponse,ct.Unauthorized,ct.SubprotocolNotAcceptable,ct.SubscriberAlreadyExists,ct.TooManyInitialisationRequests].includes(B.code)))throw B;if(q)return!1;if(Do(B)&&B.code===1e3)return T>0;if(!c||L>=c||!d(B)||p?.(B))throw B;return F=!0}return n||(async()=>{for(T++;;)try{let[,,B]=await Ve();await B}catch(B){try{if(!Ce(B))return}catch(he){return i?.(he)}}})(),{on:g.on,subscribe(B,he){let me=y(B),re=!1,ne=!1,jt=()=>{T--,re=!0};return(async()=>{for(T++;;)try{let[Y,qt,gr]=await Ve();if(re)return qt();let Ga=g.onMessage(me,Ln=>{switch(Ln.type){case Te.Next:{he.next(Ln.payload);return}case Te.Error:{ne=!0,re=!0,he.error(Ln.payload),jt();return}case Te.Complete:{re=!0,jt();return}}});Y.send(Yn({id:me,type:Te.Subscribe,payload:B},b)),jt=()=>{!re&&Y.readyState===_.OPEN&&Y.send(Yn({id:me,type:Te.Complete},b)),T--,re=!0,qt()},await gr.finally(Ga);return}catch(Y){if(!Ce(Y))return}})().then(()=>{ne||he.complete()}).catch(Y=>{he.error(Y)}),()=>{re||jt()}},async dispose(){if(q=!0,R){let[B]=await R;B.close(1e3,"Normal Closure")}},terminate(){R&&g.emit("closed",{code:4499,reason:"Terminated",wasClean:!1})}}}function Do(t){return or(t)&&"code"in t&&"reason"in t}function lg(t){return[1e3,1001,1006,1005,1012,1013,1013].includes(t)?!1:t>=1e3&&t<=1999}function fg(t){return typeof t=="function"&&"constructor"in t&&"CLOSED"in t&&"CLOSING"in t&&"CONNECTING"in t&&"OPEN"in t}function pg(t){return ie(t)&&"code"in t&&"reason"in t}var Wc=function(t){xe(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 Z(function(i){return n.client.subscribe(w(w({},r),{query:Fn(r.query)}),{next:i.next.bind(i),complete:i.complete.bind(i),error:function(a){return a instanceof Error?i.error(a):pg(a)?i.error(new Error("Socket closed with event ".concat(a.code," ").concat(a.reason||""))):i.error(new ar({graphQLErrors:Array.isArray(a)?a:[a]}))}})})},e}(kt);var os=function(){return os=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},os.apply(this,arguments)};typeof SuppressedError=="function"&&SuppressedError;function Qo(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Qo=function(r){return typeof r}:Qo=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Qo(t)}function dg(t){return Qo(t)=="object"&&t!==null}var md=typeof Symbol=="function"&&Symbol.toStringTag!=null?Symbol.toStringTag:"@@toStringTag";function hu(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 hg(t){return gd(t.source,hu(t.source,t.start))}function gd(t,e){var r=t.locationOffset.column-1,n=zo(r)+t.body,i=e.line-1,a=t.locationOffset.line-1,o=e.line+a,s=e.line===1?r:0,u=e.column+s,c="".concat(t.name,":").concat(o,":").concat(u,`
52
+ `),l=n.split(/\r\n|[\n\r]/g),d=l[i];if(d.length>120){for(var p=Math.floor(u/80),f=u%80,m=[],y=0;y<d.length;y+=80)m.push(d.slice(y,y+80));return c+ep([["".concat(o),m[0]]].concat(m.slice(1,p+1).map(function(b){return["",b]}),[[" ",zo(f-1)+"^"],["",m[p+1]]]))}return c+ep([["".concat(o-1),l[i-1]],["".concat(o),d],["",zo(u-1)+"^"],["".concat(o+1),l[i+1]]])}function ep(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 mg(r,i)+(a?" | "+a:" |")}).join(`
53
+ `)}function zo(t){return Array(t+1).join(" ")}function mg(t,e){return zo(t-e.length)+e}function Go(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Go=function(r){return typeof r}:Go=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Go(t)}function tp(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 gg(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?tp(Object(r),!0).forEach(function(n){yg(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):tp(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function yg(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function vg(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function rp(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 bg(t,e,r){return e&&rp(t.prototype,e),r&&rp(t,r),t}function _g(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&&wa(t,e)}function Sg(t){var e=vd();return function(){var n=Ea(t),i;if(e){var a=Ea(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return yd(this,i)}}function yd(t,e){return e&&(Go(e)==="object"||typeof e=="function")?e:Yi(t)}function Yi(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function mu(t){var e=typeof Map=="function"?new Map:void 0;return mu=function(n){if(n===null||!wg(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 Wo(n,arguments,Ea(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),wa(i,n)},mu(t)}function Wo(t,e,r){return vd()?Wo=Reflect.construct:Wo=function(i,a,o){var s=[null];s.push.apply(s,a);var u=Function.bind.apply(i,s),c=new u;return o&&wa(c,o.prototype),c},Wo.apply(null,arguments)}function vd(){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 wg(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function wa(t,e){return wa=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},wa(t,e)}function Ea(t){return Ea=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},Ea(t)}var Eg=function(t){_g(r,t);var e=Sg(r);function r(n,i,a,o,s,u,c){var l,d,p,f;vg(this,r),f=e.call(this,n),f.name="GraphQLError",f.originalError=u??void 0,f.nodes=np(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,S=b[y],_=S.loc;_!=null&&m.push(_)}m=np(m),f.source=a??((l=m)===null||l===void 0?void 0:l[0].source),f.positions=o??((d=m)===null||d===void 0?void 0:d.map(function(A){return A.start})),f.locations=o&&a?o.map(function(A){return hu(a,A)}):(p=m)===null||p===void 0?void 0:p.map(function(A){return hu(A.source,A.start)}),f.path=s??void 0;var g=u?.extensions;return c==null&&dg(g)?f.extensions=gg({},g):f.extensions=c??{},Object.defineProperties(Yi(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}}),u!=null&&u.stack?(Object.defineProperty(Yi(f),"stack",{value:u.stack,writable:!0,configurable:!0}),yd(f)):(Error.captureStackTrace?Error.captureStackTrace(Yi(f),r):Object.defineProperty(Yi(f),"stack",{value:Error().stack,writable:!0,configurable:!0}),f)}return bg(r,[{key:"toString",value:function(){return xg(this)}},{key:md,get:function(){return"Object"}}]),r}(mu(Error));function np(t){return t===void 0||t.length===0?void 0:t}function xg(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
- `+py(i.loc))}else if(t.source&&t.locations)for(var a=0,o=t.locations;a<o.length;a++){var s=o[a];e+=`
55
+ `+hg(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
- `+md(t.source,s)}return e}function vt(t,e,r){return new wy("Syntax Error: ".concat(r),void 0,t,[e])}var U=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 Ey(t,e){var r=Boolean(t);if(!r)throw new Error(e??"Unexpected invariant triggered.")}var xy=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):void 0,pu=xy;function vd(t){var e=t.prototype.toJSON;typeof e=="function"||Ey(0),t.prototype.inspect=e,pu&&(t.prototype[pu]=e)}var bd=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}();vd(bd);var Oe=function(){function t(r,n,i,a,o,s,u){this.kind=r,this.start=n,this.end=i,this.line=a,this.column=o,this.value=u,this.prev=s,this.next=null}var e=t.prototype;return e.toJSON=function(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}},t}();vd(Oe);var O=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 Bo(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Bo=function(r){return typeof r}:Bo=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Bo(t)}var Iy=10,_d=2;function Ty(t){return Is(t,[])}function Is(t,e){switch(Bo(t)){case"string":return JSON.stringify(t);case"function":return t.name?"[function ".concat(t.name,"]"):"[function]";case"object":return t===null?"null":ky(t,e);default:return String(t)}}function ky(t,e){if(e.indexOf(t)!==-1)return"[Circular]";var r=[].concat(e,[t]),n=Dy(t);if(n!==void 0){var i=n.call(t);if(i!==t)return typeof i=="string"?i:Is(i,r)}else if(Array.isArray(t))return Ay(t,r);return Oy(t,r)}function Oy(t,e){var r=Object.keys(t);if(r.length===0)return"{}";if(e.length>_d)return"["+Ny(t)+"]";var n=r.map(function(i){var a=Is(t[i],e);return i+": "+a});return"{ "+n.join(", ")+" }"}function Ay(t,e){if(t.length===0)return"[]";if(e.length>_d)return"[Array]";for(var r=Math.min(Iy,t.length),n=t.length-r,i=[],a=0;a<r;++a)i.push(Is(t[a],e));return n===1?i.push("... 1 more item"):n>1&&i.push("... ".concat(n," more items")),"["+i.join(", ")+"]"}function Dy(t){var e=t[String(pu)];if(typeof e=="function")return e;if(typeof t.inspect=="function")return t.inspect}function Ny(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 Qc(t,e){var r=Boolean(t);if(!r)throw new Error(e)}var Py=function(e,r){return e instanceof r};function np(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 Cy(t,e,r){return e&&np(t.prototype,e),r&&np(t,r),t}var wd=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"||Qc(0,"Body must be a string. Received: ".concat(Ty(e),".")),this.body=e,this.name=r,this.locationOffset=n,this.locationOffset.line>0||Qc(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||Qc(0,"column in locationOffset is 1-indexed and must be positive.")}return Cy(t,[{key:hd,get:function(){return"Source"}}]),t}();function Ry(t){return Py(t,wd)}var Ly=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 Fy(t){var e=t.split(/\r\n|[\n\r]/g),r=$y(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&&ip(e[i]);)++i;for(var a=e.length;a>i&&ip(e[a-1]);)--a;return e.slice(i,a).join(`
58
- `)}function ip(t){for(var e=0;e<t.length;++e)if(t[e]!==" "&&t[e]!==" ")return!1;return!0}function $y(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 My=function(){function t(r){var n=new Oe(O.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!==O.EOF)do{var i;n=(i=n.next)!==null&&i!==void 0?i:n.next=Uy(this,n)}while(n.kind===O.COMMENT);return n},t}();function jy(t){return t===O.BANG||t===O.DOLLAR||t===O.AMP||t===O.PAREN_L||t===O.PAREN_R||t===O.SPREAD||t===O.COLON||t===O.EQUALS||t===O.AT||t===O.BRACKET_L||t===O.BRACKET_R||t===O.BRACE_L||t===O.PIPE||t===O.BRACE_R}function vn(t){return isNaN(t)?O.EOF:t<127?JSON.stringify(String.fromCharCode(t)):'"\\u'.concat(("00"+t.toString(16).toUpperCase()).slice(-4),'"')}function Uy(t,e){for(var r=t.source,n=r.body,i=n.length,a=e.end;a<i;){var o=n.charCodeAt(a),s=t.line,u=1+a-t.lineStart;switch(o){case 65279:case 9:case 32:case 44:++a;continue;case 10:++a,++t.line,t.lineStart=a;continue;case 13:n.charCodeAt(a+1)===10?a+=2:++a,++t.line,t.lineStart=a;continue;case 33:return new Oe(O.BANG,a,a+1,s,u,e);case 35:return By(r,a,s,u,e);case 36:return new Oe(O.DOLLAR,a,a+1,s,u,e);case 38:return new Oe(O.AMP,a,a+1,s,u,e);case 40:return new Oe(O.PAREN_L,a,a+1,s,u,e);case 41:return new Oe(O.PAREN_R,a,a+1,s,u,e);case 46:if(n.charCodeAt(a+1)===46&&n.charCodeAt(a+2)===46)return new Oe(O.SPREAD,a,a+3,s,u,e);break;case 58:return new Oe(O.COLON,a,a+1,s,u,e);case 61:return new Oe(O.EQUALS,a,a+1,s,u,e);case 64:return new Oe(O.AT,a,a+1,s,u,e);case 91:return new Oe(O.BRACKET_L,a,a+1,s,u,e);case 93:return new Oe(O.BRACKET_R,a,a+1,s,u,e);case 123:return new Oe(O.BRACE_L,a,a+1,s,u,e);case 124:return new Oe(O.PIPE,a,a+1,s,u,e);case 125:return new Oe(O.BRACE_R,a,a+1,s,u,e);case 34:return n.charCodeAt(a+1)===34&&n.charCodeAt(a+2)===34?zy(r,a,s,u,e,t):Qy(r,a,s,u,e);case 45:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return Vy(r,a,o,s,u,e);case 65:case 66:case 67:case 68:case 69:case 70:case 71:case 72:case 73:case 74:case 75:case 76:case 77:case 78:case 79:case 80:case 81:case 82:case 83:case 84:case 85:case 86:case 87:case 88:case 89:case 90:case 95:case 97:case 98:case 99:case 100:case 101:case 102:case 103:case 104:case 105:case 106:case 107:case 108:case 109:case 110:case 111:case 112:case 113:case 114:case 115:case 116:case 117:case 118:case 119:case 120:case 121:case 122:return Wy(r,a,s,u,e)}throw vt(r,a,qy(o))}var c=t.line,l=1+a-t.lineStart;return new Oe(O.EOF,i,i,c,l,e)}function qy(t){return t<32&&t!==9&&t!==10&&t!==13?"Cannot contain the invalid character ".concat(vn(t),"."):t===39?`Unexpected single quote character ('), did you mean to use a double quote (")?`:"Cannot parse the unexpected character ".concat(vn(t),".")}function By(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 Oe(O.COMMENT,e,s,r,n,i,a.slice(e+1,s))}function Vy(t,e,r,n,i,a){var o=t.body,s=r,u=e,c=!1;if(s===45&&(s=o.charCodeAt(++u)),s===48){if(s=o.charCodeAt(++u),s>=48&&s<=57)throw vt(t,u,"Invalid number, unexpected digit after 0: ".concat(vn(s),"."))}else u=zc(t,u,s),s=o.charCodeAt(u);if(s===46&&(c=!0,s=o.charCodeAt(++u),u=zc(t,u,s),s=o.charCodeAt(u)),(s===69||s===101)&&(c=!0,s=o.charCodeAt(++u),(s===43||s===45)&&(s=o.charCodeAt(++u)),u=zc(t,u,s),s=o.charCodeAt(u)),s===46||Ky(s))throw vt(t,u,"Invalid number, expected digit but got: ".concat(vn(s),"."));return new Oe(c?O.FLOAT:O.INT,e,u,n,i,a,o.slice(e,u))}function zc(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 vt(t,i,"Invalid number, expected digit but got: ".concat(vn(a),"."))}function Qy(t,e,r,n,i){for(var a=t.body,o=e+1,s=o,u=0,c="";o<a.length&&!isNaN(u=a.charCodeAt(o))&&u!==10&&u!==13;){if(u===34)return c+=a.slice(s,o),new Oe(O.STRING,e,o+1,r,n,i,c);if(u<32&&u!==9)throw vt(t,o,"Invalid character within String: ".concat(vn(u),"."));if(++o,u===92){switch(c+=a.slice(s,o-1),u=a.charCodeAt(o),u){case 34:c+='"';break;case 47:c+="/";break;case 92:c+="\\";break;case 98:c+="\b";break;case 102:c+="\f";break;case 110:c+=`
59
- `;break;case 114:c+="\r";break;case 116:c+=" ";break;case 117:{var l=Gy(a.charCodeAt(o+1),a.charCodeAt(o+2),a.charCodeAt(o+3),a.charCodeAt(o+4));if(l<0){var d=a.slice(o+1,o+5);throw vt(t,o,"Invalid character escape sequence: \\u".concat(d,"."))}c+=String.fromCharCode(l),o+=4;break}default:throw vt(t,o,"Invalid character escape sequence: \\".concat(String.fromCharCode(u),"."))}++o,s=o}}throw vt(t,o,"Unterminated string.")}function zy(t,e,r,n,i,a){for(var o=t.body,s=e+3,u=s,c=0,l="";s<o.length&&!isNaN(c=o.charCodeAt(s));){if(c===34&&o.charCodeAt(s+1)===34&&o.charCodeAt(s+2)===34)return l+=o.slice(u,s),new Oe(O.BLOCK_STRING,e,s+3,r,n,i,Fy(l));if(c<32&&c!==9&&c!==10&&c!==13)throw vt(t,s,"Invalid character within String: ".concat(vn(c),"."));c===10?(++s,++a.line,a.lineStart=s):c===13?(o.charCodeAt(s+1)===10?s+=2:++s,++a.line,a.lineStart=s):c===92&&o.charCodeAt(s+1)===34&&o.charCodeAt(s+2)===34&&o.charCodeAt(s+3)===34?(l+=o.slice(u,s)+'"""',s+=4,u=s):++s}throw vt(t,s,"Unterminated string.")}function Gy(t,e,r,n){return Io(t)<<12|Io(e)<<8|Io(r)<<4|Io(n)}function Io(t){return t>=48&&t<=57?t-48:t>=65&&t<=70?t-55:t>=97&&t<=102?t-87:-1}function Wy(t,e,r,n,i){for(var a=t.body,o=a.length,s=e+1,u=0;s!==o&&!isNaN(u=a.charCodeAt(s))&&(u===95||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122);)++s;return new Oe(O.NAME,e,s,r,n,i,a.slice(e,s))}function Ky(t){return t===95||t>=65&&t<=90||t>=97&&t<=122}function Hy(t,e){var r=new Jy(t,e);return r.parseDocument()}var Jy=function(){function t(r,n){var i=Ry(r)?r:new wd(r);this._lexer=new My(i),this._options=n}var e=t.prototype;return e.parseName=function(){var n=this.expectToken(O.NAME);return{kind:U.NAME,value:n.value,loc:this.loc(n)}},e.parseDocument=function(){var n=this._lexer.token;return{kind:U.DOCUMENT,definitions:this.many(O.SOF,this.parseDefinition,O.EOF),loc:this.loc(n)}},e.parseDefinition=function(){if(this.peek(O.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(O.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(O.BRACE_L))return{kind:U.OPERATION_DEFINITION,operation:"query",name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet(),loc:this.loc(n)};var i=this.parseOperationType(),a;return this.peek(O.NAME)&&(a=this.parseName()),{kind:U.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(O.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(O.PAREN_L,this.parseVariableDefinition,O.PAREN_R)},e.parseVariableDefinition=function(){var n=this._lexer.token;return{kind:U.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(O.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(O.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(O.DOLLAR),{kind:U.VARIABLE,name:this.parseName(),loc:this.loc(n)}},e.parseSelectionSet=function(){var n=this._lexer.token;return{kind:U.SELECTION_SET,selections:this.many(O.BRACE_L,this.parseSelection,O.BRACE_R),loc:this.loc(n)}},e.parseSelection=function(){return this.peek(O.SPREAD)?this.parseFragment():this.parseField()},e.parseField=function(){var n=this._lexer.token,i=this.parseName(),a,o;return this.expectOptionalToken(O.COLON)?(a=i,o=this.parseName()):o=i,{kind:U.FIELD,alias:a,name:o,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(O.BRACE_L)?this.parseSelectionSet():void 0,loc:this.loc(n)}},e.parseArguments=function(n){var i=n?this.parseConstArgument:this.parseArgument;return this.optionalMany(O.PAREN_L,i,O.PAREN_R)},e.parseArgument=function(){var n=this._lexer.token,i=this.parseName();return this.expectToken(O.COLON),{kind:U.ARGUMENT,name:i,value:this.parseValueLiteral(!1),loc:this.loc(n)}},e.parseConstArgument=function(){var n=this._lexer.token;return{kind:U.ARGUMENT,name:this.parseName(),value:(this.expectToken(O.COLON),this.parseValueLiteral(!0)),loc:this.loc(n)}},e.parseFragment=function(){var n=this._lexer.token;this.expectToken(O.SPREAD);var i=this.expectOptionalKeyword("on");return!i&&this.peek(O.NAME)?{kind:U.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1),loc:this.loc(n)}:{kind:U.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:U.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:U.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 O.BRACKET_L:return this.parseList(n);case O.BRACE_L:return this.parseObject(n);case O.INT:return this._lexer.advance(),{kind:U.INT,value:i.value,loc:this.loc(i)};case O.FLOAT:return this._lexer.advance(),{kind:U.FLOAT,value:i.value,loc:this.loc(i)};case O.STRING:case O.BLOCK_STRING:return this.parseStringLiteral();case O.NAME:switch(this._lexer.advance(),i.value){case"true":return{kind:U.BOOLEAN,value:!0,loc:this.loc(i)};case"false":return{kind:U.BOOLEAN,value:!1,loc:this.loc(i)};case"null":return{kind:U.NULL,loc:this.loc(i)};default:return{kind:U.ENUM,value:i.value,loc:this.loc(i)}}case O.DOLLAR:if(!n)return this.parseVariable();break}throw this.unexpected()},e.parseStringLiteral=function(){var n=this._lexer.token;return this._lexer.advance(),{kind:U.STRING,value:n.value,block:n.kind===O.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:U.LIST,values:this.any(O.BRACKET_L,o,O.BRACKET_R),loc:this.loc(a)}},e.parseObject=function(n){var i=this,a=this._lexer.token,o=function(){return i.parseObjectField(n)};return{kind:U.OBJECT,fields:this.any(O.BRACE_L,o,O.BRACE_R),loc:this.loc(a)}},e.parseObjectField=function(n){var i=this._lexer.token,a=this.parseName();return this.expectToken(O.COLON),{kind:U.OBJECT_FIELD,name:a,value:this.parseValueLiteral(n),loc:this.loc(i)}},e.parseDirectives=function(n){for(var i=[];this.peek(O.AT);)i.push(this.parseDirective(n));return i},e.parseDirective=function(n){var i=this._lexer.token;return this.expectToken(O.AT),{kind:U.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(n),loc:this.loc(i)}},e.parseTypeReference=function(){var n=this._lexer.token,i;return this.expectOptionalToken(O.BRACKET_L)?(i=this.parseTypeReference(),this.expectToken(O.BRACKET_R),i={kind:U.LIST_TYPE,type:i,loc:this.loc(n)}):i=this.parseNamedType(),this.expectOptionalToken(O.BANG)?{kind:U.NON_NULL_TYPE,type:i,loc:this.loc(n)}:i},e.parseNamedType=function(){var n=this._lexer.token;return{kind:U.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===O.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(O.STRING)||this.peek(O.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(O.BRACE_L,this.parseOperationTypeDefinition,O.BRACE_R);return{kind:U.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(O.COLON);var a=this.parseNamedType();return{kind:U.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:U.SCALAR_TYPE_DEFINITION,description:i,name:a,directives:o,loc:this.loc(n)}},e.parseObjectTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("type");var a=this.parseName(),o=this.parseImplementsInterfaces(),s=this.parseDirectives(!0),u=this.parseFieldsDefinition();return{kind:U.OBJECT_TYPE_DEFINITION,description:i,name:a,interfaces:o,directives:s,fields:u,loc:this.loc(n)}},e.parseImplementsInterfaces=function(){var n;if(!this.expectOptionalKeyword("implements"))return[];if(((n=this._options)===null||n===void 0?void 0:n.allowLegacySDLImplementsInterfaces)===!0){var i=[];this.expectOptionalToken(O.AMP);do i.push(this.parseNamedType());while(this.expectOptionalToken(O.AMP)||this.peek(O.NAME));return i}return this.delimitedMany(O.AMP,this.parseNamedType)},e.parseFieldsDefinition=function(){var n;return((n=this._options)===null||n===void 0?void 0:n.allowLegacySDLEmptyFields)===!0&&this.peek(O.BRACE_L)&&this._lexer.lookahead().kind===O.BRACE_R?(this._lexer.advance(),this._lexer.advance(),[]):this.optionalMany(O.BRACE_L,this.parseFieldDefinition,O.BRACE_R)},e.parseFieldDefinition=function(){var n=this._lexer.token,i=this.parseDescription(),a=this.parseName(),o=this.parseArgumentDefs();this.expectToken(O.COLON);var s=this.parseTypeReference(),u=this.parseDirectives(!0);return{kind:U.FIELD_DEFINITION,description:i,name:a,arguments:o,type:s,directives:u,loc:this.loc(n)}},e.parseArgumentDefs=function(){return this.optionalMany(O.PAREN_L,this.parseInputValueDef,O.PAREN_R)},e.parseInputValueDef=function(){var n=this._lexer.token,i=this.parseDescription(),a=this.parseName();this.expectToken(O.COLON);var o=this.parseTypeReference(),s;this.expectOptionalToken(O.EQUALS)&&(s=this.parseValueLiteral(!0));var u=this.parseDirectives(!0);return{kind:U.INPUT_VALUE_DEFINITION,description:i,name:a,type:o,defaultValue:s,directives:u,loc:this.loc(n)}},e.parseInterfaceTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("interface");var a=this.parseName(),o=this.parseImplementsInterfaces(),s=this.parseDirectives(!0),u=this.parseFieldsDefinition();return{kind:U.INTERFACE_TYPE_DEFINITION,description:i,name:a,interfaces:o,directives:s,fields:u,loc:this.loc(n)}},e.parseUnionTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("union");var a=this.parseName(),o=this.parseDirectives(!0),s=this.parseUnionMemberTypes();return{kind:U.UNION_TYPE_DEFINITION,description:i,name:a,directives:o,types:s,loc:this.loc(n)}},e.parseUnionMemberTypes=function(){return this.expectOptionalToken(O.EQUALS)?this.delimitedMany(O.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:U.ENUM_TYPE_DEFINITION,description:i,name:a,directives:o,values:s,loc:this.loc(n)}},e.parseEnumValuesDefinition=function(){return this.optionalMany(O.BRACE_L,this.parseEnumValueDefinition,O.BRACE_R)},e.parseEnumValueDefinition=function(){var n=this._lexer.token,i=this.parseDescription(),a=this.parseName(),o=this.parseDirectives(!0);return{kind:U.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:U.INPUT_OBJECT_TYPE_DEFINITION,description:i,name:a,directives:o,fields:s,loc:this.loc(n)}},e.parseInputFieldsDefinition=function(){return this.optionalMany(O.BRACE_L,this.parseInputValueDef,O.BRACE_R)},e.parseTypeSystemExtension=function(){var n=this._lexer.lookahead();if(n.kind===O.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(O.BRACE_L,this.parseOperationTypeDefinition,O.BRACE_R);if(i.length===0&&a.length===0)throw this.unexpected();return{kind:U.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:U.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:U.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:U.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:U.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:U.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:U.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(O.AT);var a=this.parseName(),o=this.parseArgumentDefs(),s=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");var u=this.parseDirectiveLocations();return{kind:U.DIRECTIVE_DEFINITION,description:i,name:a,arguments:o,repeatable:s,locations:u,loc:this.loc(n)}},e.parseDirectiveLocations=function(){return this.delimitedMany(O.PIPE,this.parseDirectiveLocation)},e.parseDirectiveLocation=function(){var n=this._lexer.token,i=this.parseName();if(Ly[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 bd(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 vt(this._lexer.source,i.start,"Expected ".concat(Sd(n),", found ").concat(Gc(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===O.NAME&&i.value===n)this._lexer.advance();else throw vt(this._lexer.source,i.start,'Expected "'.concat(n,'", found ').concat(Gc(i),"."))},e.expectOptionalKeyword=function(n){var i=this._lexer.token;return i.kind===O.NAME&&i.value===n?(this._lexer.advance(),!0):!1},e.unexpected=function(n){var i=n??this._lexer.token;return vt(this._lexer.source,i.start,"Unexpected ".concat(Gc(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 Gc(t){var e=t.value;return Sd(t.kind)+(e!=null?' "'.concat(e,'"'):"")}function Sd(t){return jy(t)?'"'.concat(t,'"'):t}var Vo=new Map,du=new Map,Ed=!0,rs=!1;function xd(t){return t.replace(/[\s,]+/g," ").trim()}function Yy(t){return xd(t.source.body.substring(t.start,t.end))}function Zy(t){var e=new Set,r=[];return t.definitions.forEach(function(n){if(n.kind==="FragmentDefinition"){var i=n.name.value,a=Yy(n.loc),o=du.get(i);o&&!o.has(a)?Ed&&console.warn("Warning: fragment with name "+i+` already exists.
57
+ `+gd(t.source,s)}return e}function vt(t,e,r){return new Eg("Syntax Error: ".concat(r),void 0,t,[e])}var j=Object.freeze({NAME:"Name",DOCUMENT:"Document",OPERATION_DEFINITION:"OperationDefinition",VARIABLE_DEFINITION:"VariableDefinition",SELECTION_SET:"SelectionSet",FIELD:"Field",ARGUMENT:"Argument",FRAGMENT_SPREAD:"FragmentSpread",INLINE_FRAGMENT:"InlineFragment",FRAGMENT_DEFINITION:"FragmentDefinition",VARIABLE:"Variable",INT:"IntValue",FLOAT:"FloatValue",STRING:"StringValue",BOOLEAN:"BooleanValue",NULL:"NullValue",ENUM:"EnumValue",LIST:"ListValue",OBJECT:"ObjectValue",OBJECT_FIELD:"ObjectField",DIRECTIVE:"Directive",NAMED_TYPE:"NamedType",LIST_TYPE:"ListType",NON_NULL_TYPE:"NonNullType",SCHEMA_DEFINITION:"SchemaDefinition",OPERATION_TYPE_DEFINITION:"OperationTypeDefinition",SCALAR_TYPE_DEFINITION:"ScalarTypeDefinition",OBJECT_TYPE_DEFINITION:"ObjectTypeDefinition",FIELD_DEFINITION:"FieldDefinition",INPUT_VALUE_DEFINITION:"InputValueDefinition",INTERFACE_TYPE_DEFINITION:"InterfaceTypeDefinition",UNION_TYPE_DEFINITION:"UnionTypeDefinition",ENUM_TYPE_DEFINITION:"EnumTypeDefinition",ENUM_VALUE_DEFINITION:"EnumValueDefinition",INPUT_OBJECT_TYPE_DEFINITION:"InputObjectTypeDefinition",DIRECTIVE_DEFINITION:"DirectiveDefinition",SCHEMA_EXTENSION:"SchemaExtension",SCALAR_TYPE_EXTENSION:"ScalarTypeExtension",OBJECT_TYPE_EXTENSION:"ObjectTypeExtension",INTERFACE_TYPE_EXTENSION:"InterfaceTypeExtension",UNION_TYPE_EXTENSION:"UnionTypeExtension",ENUM_TYPE_EXTENSION:"EnumTypeExtension",INPUT_OBJECT_TYPE_EXTENSION:"InputObjectTypeExtension"});function Ig(t,e){var r=Boolean(t);if(!r)throw new Error(e??"Unexpected invariant triggered.")}var Tg=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):void 0,gu=Tg;function bd(t){var e=t.prototype.toJSON;typeof e=="function"||Ig(0),t.prototype.inspect=e,gu&&(t.prototype[gu]=e)}var _d=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}();bd(_d);var Oe=function(){function t(r,n,i,a,o,s,u){this.kind=r,this.start=n,this.end=i,this.line=a,this.column=o,this.value=u,this.prev=s,this.next=null}var e=t.prototype;return e.toJSON=function(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}},t}();bd(Oe);var O=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 Ko(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ko=function(r){return typeof r}:Ko=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Ko(t)}var kg=10,Sd=2;function Og(t){return As(t,[])}function As(t,e){switch(Ko(t)){case"string":return JSON.stringify(t);case"function":return t.name?"[function ".concat(t.name,"]"):"[function]";case"object":return t===null?"null":Ag(t,e);default:return String(t)}}function Ag(t,e){if(e.indexOf(t)!==-1)return"[Circular]";var r=[].concat(e,[t]),n=Pg(t);if(n!==void 0){var i=n.call(t);if(i!==t)return typeof i=="string"?i:As(i,r)}else if(Array.isArray(t))return Ng(t,r);return Dg(t,r)}function Dg(t,e){var r=Object.keys(t);if(r.length===0)return"{}";if(e.length>Sd)return"["+Cg(t)+"]";var n=r.map(function(i){var a=As(t[i],e);return i+": "+a});return"{ "+n.join(", ")+" }"}function Ng(t,e){if(t.length===0)return"[]";if(e.length>Sd)return"[Array]";for(var r=Math.min(kg,t.length),n=t.length-r,i=[],a=0;a<r;++a)i.push(As(t[a],e));return n===1?i.push("... 1 more item"):n>1&&i.push("... ".concat(n," more items")),"["+i.join(", ")+"]"}function Pg(t){var e=t[String(gu)];if(typeof e=="function")return e;if(typeof t.inspect=="function")return t.inspect}function Cg(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 Kc(t,e){var r=Boolean(t);if(!r)throw new Error(e)}var Rg=function(e,r){return e instanceof r};function ip(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 Lg(t,e,r){return e&&ip(t.prototype,e),r&&ip(t,r),t}var wd=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"||Kc(0,"Body must be a string. Received: ".concat(Og(e),".")),this.body=e,this.name=r,this.locationOffset=n,this.locationOffset.line>0||Kc(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||Kc(0,"column in locationOffset is 1-indexed and must be positive.")}return Lg(t,[{key:md,get:function(){return"Source"}}]),t}();function Fg(t){return Rg(t,wd)}var $g=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 Mg(t){var e=t.split(/\r\n|[\n\r]/g),r=Ug(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&&ap(e[i]);)++i;for(var a=e.length;a>i&&ap(e[a-1]);)--a;return e.slice(i,a).join(`
58
+ `)}function ap(t){for(var e=0;e<t.length;++e)if(t[e]!==" "&&t[e]!==" ")return!1;return!0}function Ug(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 jg=function(){function t(r){var n=new Oe(O.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!==O.EOF)do{var i;n=(i=n.next)!==null&&i!==void 0?i:n.next=Bg(this,n)}while(n.kind===O.COMMENT);return n},t}();function qg(t){return t===O.BANG||t===O.DOLLAR||t===O.AMP||t===O.PAREN_L||t===O.PAREN_R||t===O.SPREAD||t===O.COLON||t===O.EQUALS||t===O.AT||t===O.BRACKET_L||t===O.BRACKET_R||t===O.BRACE_L||t===O.PIPE||t===O.BRACE_R}function vn(t){return isNaN(t)?O.EOF:t<127?JSON.stringify(String.fromCharCode(t)):'"\\u'.concat(("00"+t.toString(16).toUpperCase()).slice(-4),'"')}function Bg(t,e){for(var r=t.source,n=r.body,i=n.length,a=e.end;a<i;){var o=n.charCodeAt(a),s=t.line,u=1+a-t.lineStart;switch(o){case 65279:case 9:case 32:case 44:++a;continue;case 10:++a,++t.line,t.lineStart=a;continue;case 13:n.charCodeAt(a+1)===10?a+=2:++a,++t.line,t.lineStart=a;continue;case 33:return new Oe(O.BANG,a,a+1,s,u,e);case 35:return Qg(r,a,s,u,e);case 36:return new Oe(O.DOLLAR,a,a+1,s,u,e);case 38:return new Oe(O.AMP,a,a+1,s,u,e);case 40:return new Oe(O.PAREN_L,a,a+1,s,u,e);case 41:return new Oe(O.PAREN_R,a,a+1,s,u,e);case 46:if(n.charCodeAt(a+1)===46&&n.charCodeAt(a+2)===46)return new Oe(O.SPREAD,a,a+3,s,u,e);break;case 58:return new Oe(O.COLON,a,a+1,s,u,e);case 61:return new Oe(O.EQUALS,a,a+1,s,u,e);case 64:return new Oe(O.AT,a,a+1,s,u,e);case 91:return new Oe(O.BRACKET_L,a,a+1,s,u,e);case 93:return new Oe(O.BRACKET_R,a,a+1,s,u,e);case 123:return new Oe(O.BRACE_L,a,a+1,s,u,e);case 124:return new Oe(O.PIPE,a,a+1,s,u,e);case 125:return new Oe(O.BRACE_R,a,a+1,s,u,e);case 34:return n.charCodeAt(a+1)===34&&n.charCodeAt(a+2)===34?Wg(r,a,s,u,e,t):Gg(r,a,s,u,e);case 45:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return zg(r,a,o,s,u,e);case 65:case 66:case 67:case 68:case 69:case 70:case 71:case 72:case 73:case 74:case 75:case 76:case 77:case 78:case 79:case 80:case 81:case 82:case 83:case 84:case 85:case 86:case 87:case 88:case 89:case 90:case 95:case 97:case 98:case 99:case 100:case 101:case 102:case 103:case 104:case 105:case 106:case 107:case 108:case 109:case 110:case 111:case 112:case 113:case 114:case 115:case 116:case 117:case 118:case 119:case 120:case 121:case 122:return Hg(r,a,s,u,e)}throw vt(r,a,Vg(o))}var c=t.line,l=1+a-t.lineStart;return new Oe(O.EOF,i,i,c,l,e)}function Vg(t){return t<32&&t!==9&&t!==10&&t!==13?"Cannot contain the invalid character ".concat(vn(t),"."):t===39?`Unexpected single quote character ('), did you mean to use a double quote (")?`:"Cannot parse the unexpected character ".concat(vn(t),".")}function Qg(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 Oe(O.COMMENT,e,s,r,n,i,a.slice(e+1,s))}function zg(t,e,r,n,i,a){var o=t.body,s=r,u=e,c=!1;if(s===45&&(s=o.charCodeAt(++u)),s===48){if(s=o.charCodeAt(++u),s>=48&&s<=57)throw vt(t,u,"Invalid number, unexpected digit after 0: ".concat(vn(s),"."))}else u=Hc(t,u,s),s=o.charCodeAt(u);if(s===46&&(c=!0,s=o.charCodeAt(++u),u=Hc(t,u,s),s=o.charCodeAt(u)),(s===69||s===101)&&(c=!0,s=o.charCodeAt(++u),(s===43||s===45)&&(s=o.charCodeAt(++u)),u=Hc(t,u,s),s=o.charCodeAt(u)),s===46||Jg(s))throw vt(t,u,"Invalid number, expected digit but got: ".concat(vn(s),"."));return new Oe(c?O.FLOAT:O.INT,e,u,n,i,a,o.slice(e,u))}function Hc(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 vt(t,i,"Invalid number, expected digit but got: ".concat(vn(a),"."))}function Gg(t,e,r,n,i){for(var a=t.body,o=e+1,s=o,u=0,c="";o<a.length&&!isNaN(u=a.charCodeAt(o))&&u!==10&&u!==13;){if(u===34)return c+=a.slice(s,o),new Oe(O.STRING,e,o+1,r,n,i,c);if(u<32&&u!==9)throw vt(t,o,"Invalid character within String: ".concat(vn(u),"."));if(++o,u===92){switch(c+=a.slice(s,o-1),u=a.charCodeAt(o),u){case 34:c+='"';break;case 47:c+="/";break;case 92:c+="\\";break;case 98:c+="\b";break;case 102:c+="\f";break;case 110:c+=`
59
+ `;break;case 114:c+="\r";break;case 116:c+=" ";break;case 117:{var l=Kg(a.charCodeAt(o+1),a.charCodeAt(o+2),a.charCodeAt(o+3),a.charCodeAt(o+4));if(l<0){var d=a.slice(o+1,o+5);throw vt(t,o,"Invalid character escape sequence: \\u".concat(d,"."))}c+=String.fromCharCode(l),o+=4;break}default:throw vt(t,o,"Invalid character escape sequence: \\".concat(String.fromCharCode(u),"."))}++o,s=o}}throw vt(t,o,"Unterminated string.")}function Wg(t,e,r,n,i,a){for(var o=t.body,s=e+3,u=s,c=0,l="";s<o.length&&!isNaN(c=o.charCodeAt(s));){if(c===34&&o.charCodeAt(s+1)===34&&o.charCodeAt(s+2)===34)return l+=o.slice(u,s),new Oe(O.BLOCK_STRING,e,s+3,r,n,i,Mg(l));if(c<32&&c!==9&&c!==10&&c!==13)throw vt(t,s,"Invalid character within String: ".concat(vn(c),"."));c===10?(++s,++a.line,a.lineStart=s):c===13?(o.charCodeAt(s+1)===10?s+=2:++s,++a.line,a.lineStart=s):c===92&&o.charCodeAt(s+1)===34&&o.charCodeAt(s+2)===34&&o.charCodeAt(s+3)===34?(l+=o.slice(u,s)+'"""',s+=4,u=s):++s}throw vt(t,s,"Unterminated string.")}function Kg(t,e,r,n){return No(t)<<12|No(e)<<8|No(r)<<4|No(n)}function No(t){return t>=48&&t<=57?t-48:t>=65&&t<=70?t-55:t>=97&&t<=102?t-87:-1}function Hg(t,e,r,n,i){for(var a=t.body,o=a.length,s=e+1,u=0;s!==o&&!isNaN(u=a.charCodeAt(s))&&(u===95||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122);)++s;return new Oe(O.NAME,e,s,r,n,i,a.slice(e,s))}function Jg(t){return t===95||t>=65&&t<=90||t>=97&&t<=122}function Yg(t,e){var r=new Zg(t,e);return r.parseDocument()}var Zg=function(){function t(r,n){var i=Fg(r)?r:new wd(r);this._lexer=new jg(i),this._options=n}var e=t.prototype;return e.parseName=function(){var n=this.expectToken(O.NAME);return{kind:j.NAME,value:n.value,loc:this.loc(n)}},e.parseDocument=function(){var n=this._lexer.token;return{kind:j.DOCUMENT,definitions:this.many(O.SOF,this.parseDefinition,O.EOF),loc:this.loc(n)}},e.parseDefinition=function(){if(this.peek(O.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(O.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(O.BRACE_L))return{kind:j.OPERATION_DEFINITION,operation:"query",name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet(),loc:this.loc(n)};var i=this.parseOperationType(),a;return this.peek(O.NAME)&&(a=this.parseName()),{kind:j.OPERATION_DEFINITION,operation:i,name:a,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(n)}},e.parseOperationType=function(){var n=this.expectToken(O.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(O.PAREN_L,this.parseVariableDefinition,O.PAREN_R)},e.parseVariableDefinition=function(){var n=this._lexer.token;return{kind:j.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(O.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(O.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(O.DOLLAR),{kind:j.VARIABLE,name:this.parseName(),loc:this.loc(n)}},e.parseSelectionSet=function(){var n=this._lexer.token;return{kind:j.SELECTION_SET,selections:this.many(O.BRACE_L,this.parseSelection,O.BRACE_R),loc:this.loc(n)}},e.parseSelection=function(){return this.peek(O.SPREAD)?this.parseFragment():this.parseField()},e.parseField=function(){var n=this._lexer.token,i=this.parseName(),a,o;return this.expectOptionalToken(O.COLON)?(a=i,o=this.parseName()):o=i,{kind:j.FIELD,alias:a,name:o,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(O.BRACE_L)?this.parseSelectionSet():void 0,loc:this.loc(n)}},e.parseArguments=function(n){var i=n?this.parseConstArgument:this.parseArgument;return this.optionalMany(O.PAREN_L,i,O.PAREN_R)},e.parseArgument=function(){var n=this._lexer.token,i=this.parseName();return this.expectToken(O.COLON),{kind:j.ARGUMENT,name:i,value:this.parseValueLiteral(!1),loc:this.loc(n)}},e.parseConstArgument=function(){var n=this._lexer.token;return{kind:j.ARGUMENT,name:this.parseName(),value:(this.expectToken(O.COLON),this.parseValueLiteral(!0)),loc:this.loc(n)}},e.parseFragment=function(){var n=this._lexer.token;this.expectToken(O.SPREAD);var i=this.expectOptionalKeyword("on");return!i&&this.peek(O.NAME)?{kind:j.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1),loc:this.loc(n)}:{kind:j.INLINE_FRAGMENT,typeCondition:i?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(n)}},e.parseFragmentDefinition=function(){var n,i=this._lexer.token;return this.expectKeyword("fragment"),((n=this._options)===null||n===void 0?void 0:n.experimentalFragmentVariables)===!0?{kind:j.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(i)}:{kind:j.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(i)}},e.parseFragmentName=function(){if(this._lexer.token.value==="on")throw this.unexpected();return this.parseName()},e.parseValueLiteral=function(n){var i=this._lexer.token;switch(i.kind){case O.BRACKET_L:return this.parseList(n);case O.BRACE_L:return this.parseObject(n);case O.INT:return this._lexer.advance(),{kind:j.INT,value:i.value,loc:this.loc(i)};case O.FLOAT:return this._lexer.advance(),{kind:j.FLOAT,value:i.value,loc:this.loc(i)};case O.STRING:case O.BLOCK_STRING:return this.parseStringLiteral();case O.NAME:switch(this._lexer.advance(),i.value){case"true":return{kind:j.BOOLEAN,value:!0,loc:this.loc(i)};case"false":return{kind:j.BOOLEAN,value:!1,loc:this.loc(i)};case"null":return{kind:j.NULL,loc:this.loc(i)};default:return{kind:j.ENUM,value:i.value,loc:this.loc(i)}}case O.DOLLAR:if(!n)return this.parseVariable();break}throw this.unexpected()},e.parseStringLiteral=function(){var n=this._lexer.token;return this._lexer.advance(),{kind:j.STRING,value:n.value,block:n.kind===O.BLOCK_STRING,loc:this.loc(n)}},e.parseList=function(n){var i=this,a=this._lexer.token,o=function(){return i.parseValueLiteral(n)};return{kind:j.LIST,values:this.any(O.BRACKET_L,o,O.BRACKET_R),loc:this.loc(a)}},e.parseObject=function(n){var i=this,a=this._lexer.token,o=function(){return i.parseObjectField(n)};return{kind:j.OBJECT,fields:this.any(O.BRACE_L,o,O.BRACE_R),loc:this.loc(a)}},e.parseObjectField=function(n){var i=this._lexer.token,a=this.parseName();return this.expectToken(O.COLON),{kind:j.OBJECT_FIELD,name:a,value:this.parseValueLiteral(n),loc:this.loc(i)}},e.parseDirectives=function(n){for(var i=[];this.peek(O.AT);)i.push(this.parseDirective(n));return i},e.parseDirective=function(n){var i=this._lexer.token;return this.expectToken(O.AT),{kind:j.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(n),loc:this.loc(i)}},e.parseTypeReference=function(){var n=this._lexer.token,i;return this.expectOptionalToken(O.BRACKET_L)?(i=this.parseTypeReference(),this.expectToken(O.BRACKET_R),i={kind:j.LIST_TYPE,type:i,loc:this.loc(n)}):i=this.parseNamedType(),this.expectOptionalToken(O.BANG)?{kind:j.NON_NULL_TYPE,type:i,loc:this.loc(n)}:i},e.parseNamedType=function(){var n=this._lexer.token;return{kind:j.NAMED_TYPE,name:this.parseName(),loc:this.loc(n)}},e.parseTypeSystemDefinition=function(){var n=this.peekDescription()?this._lexer.lookahead():this._lexer.token;if(n.kind===O.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(O.STRING)||this.peek(O.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(O.BRACE_L,this.parseOperationTypeDefinition,O.BRACE_R);return{kind:j.SCHEMA_DEFINITION,description:i,directives:a,operationTypes:o,loc:this.loc(n)}},e.parseOperationTypeDefinition=function(){var n=this._lexer.token,i=this.parseOperationType();this.expectToken(O.COLON);var a=this.parseNamedType();return{kind:j.OPERATION_TYPE_DEFINITION,operation:i,type:a,loc:this.loc(n)}},e.parseScalarTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("scalar");var a=this.parseName(),o=this.parseDirectives(!0);return{kind:j.SCALAR_TYPE_DEFINITION,description:i,name:a,directives:o,loc:this.loc(n)}},e.parseObjectTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("type");var a=this.parseName(),o=this.parseImplementsInterfaces(),s=this.parseDirectives(!0),u=this.parseFieldsDefinition();return{kind:j.OBJECT_TYPE_DEFINITION,description:i,name:a,interfaces:o,directives:s,fields:u,loc:this.loc(n)}},e.parseImplementsInterfaces=function(){var n;if(!this.expectOptionalKeyword("implements"))return[];if(((n=this._options)===null||n===void 0?void 0:n.allowLegacySDLImplementsInterfaces)===!0){var i=[];this.expectOptionalToken(O.AMP);do i.push(this.parseNamedType());while(this.expectOptionalToken(O.AMP)||this.peek(O.NAME));return i}return this.delimitedMany(O.AMP,this.parseNamedType)},e.parseFieldsDefinition=function(){var n;return((n=this._options)===null||n===void 0?void 0:n.allowLegacySDLEmptyFields)===!0&&this.peek(O.BRACE_L)&&this._lexer.lookahead().kind===O.BRACE_R?(this._lexer.advance(),this._lexer.advance(),[]):this.optionalMany(O.BRACE_L,this.parseFieldDefinition,O.BRACE_R)},e.parseFieldDefinition=function(){var n=this._lexer.token,i=this.parseDescription(),a=this.parseName(),o=this.parseArgumentDefs();this.expectToken(O.COLON);var s=this.parseTypeReference(),u=this.parseDirectives(!0);return{kind:j.FIELD_DEFINITION,description:i,name:a,arguments:o,type:s,directives:u,loc:this.loc(n)}},e.parseArgumentDefs=function(){return this.optionalMany(O.PAREN_L,this.parseInputValueDef,O.PAREN_R)},e.parseInputValueDef=function(){var n=this._lexer.token,i=this.parseDescription(),a=this.parseName();this.expectToken(O.COLON);var o=this.parseTypeReference(),s;this.expectOptionalToken(O.EQUALS)&&(s=this.parseValueLiteral(!0));var u=this.parseDirectives(!0);return{kind:j.INPUT_VALUE_DEFINITION,description:i,name:a,type:o,defaultValue:s,directives:u,loc:this.loc(n)}},e.parseInterfaceTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("interface");var a=this.parseName(),o=this.parseImplementsInterfaces(),s=this.parseDirectives(!0),u=this.parseFieldsDefinition();return{kind:j.INTERFACE_TYPE_DEFINITION,description:i,name:a,interfaces:o,directives:s,fields:u,loc:this.loc(n)}},e.parseUnionTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("union");var a=this.parseName(),o=this.parseDirectives(!0),s=this.parseUnionMemberTypes();return{kind:j.UNION_TYPE_DEFINITION,description:i,name:a,directives:o,types:s,loc:this.loc(n)}},e.parseUnionMemberTypes=function(){return this.expectOptionalToken(O.EQUALS)?this.delimitedMany(O.PIPE,this.parseNamedType):[]},e.parseEnumTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("enum");var a=this.parseName(),o=this.parseDirectives(!0),s=this.parseEnumValuesDefinition();return{kind:j.ENUM_TYPE_DEFINITION,description:i,name:a,directives:o,values:s,loc:this.loc(n)}},e.parseEnumValuesDefinition=function(){return this.optionalMany(O.BRACE_L,this.parseEnumValueDefinition,O.BRACE_R)},e.parseEnumValueDefinition=function(){var n=this._lexer.token,i=this.parseDescription(),a=this.parseName(),o=this.parseDirectives(!0);return{kind:j.ENUM_VALUE_DEFINITION,description:i,name:a,directives:o,loc:this.loc(n)}},e.parseInputObjectTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("input");var a=this.parseName(),o=this.parseDirectives(!0),s=this.parseInputFieldsDefinition();return{kind:j.INPUT_OBJECT_TYPE_DEFINITION,description:i,name:a,directives:o,fields:s,loc:this.loc(n)}},e.parseInputFieldsDefinition=function(){return this.optionalMany(O.BRACE_L,this.parseInputValueDef,O.BRACE_R)},e.parseTypeSystemExtension=function(){var n=this._lexer.lookahead();if(n.kind===O.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(O.BRACE_L,this.parseOperationTypeDefinition,O.BRACE_R);if(i.length===0&&a.length===0)throw this.unexpected();return{kind:j.SCHEMA_EXTENSION,directives:i,operationTypes:a,loc:this.loc(n)}},e.parseScalarTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");var i=this.parseName(),a=this.parseDirectives(!0);if(a.length===0)throw this.unexpected();return{kind:j.SCALAR_TYPE_EXTENSION,name:i,directives:a,loc:this.loc(n)}},e.parseObjectTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");var i=this.parseName(),a=this.parseImplementsInterfaces(),o=this.parseDirectives(!0),s=this.parseFieldsDefinition();if(a.length===0&&o.length===0&&s.length===0)throw this.unexpected();return{kind:j.OBJECT_TYPE_EXTENSION,name:i,interfaces:a,directives:o,fields:s,loc:this.loc(n)}},e.parseInterfaceTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");var i=this.parseName(),a=this.parseImplementsInterfaces(),o=this.parseDirectives(!0),s=this.parseFieldsDefinition();if(a.length===0&&o.length===0&&s.length===0)throw this.unexpected();return{kind:j.INTERFACE_TYPE_EXTENSION,name:i,interfaces:a,directives:o,fields:s,loc:this.loc(n)}},e.parseUnionTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");var i=this.parseName(),a=this.parseDirectives(!0),o=this.parseUnionMemberTypes();if(a.length===0&&o.length===0)throw this.unexpected();return{kind:j.UNION_TYPE_EXTENSION,name:i,directives:a,types:o,loc:this.loc(n)}},e.parseEnumTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");var i=this.parseName(),a=this.parseDirectives(!0),o=this.parseEnumValuesDefinition();if(a.length===0&&o.length===0)throw this.unexpected();return{kind:j.ENUM_TYPE_EXTENSION,name:i,directives:a,values:o,loc:this.loc(n)}},e.parseInputObjectTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");var i=this.parseName(),a=this.parseDirectives(!0),o=this.parseInputFieldsDefinition();if(a.length===0&&o.length===0)throw this.unexpected();return{kind:j.INPUT_OBJECT_TYPE_EXTENSION,name:i,directives:a,fields:o,loc:this.loc(n)}},e.parseDirectiveDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("directive"),this.expectToken(O.AT);var a=this.parseName(),o=this.parseArgumentDefs(),s=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");var u=this.parseDirectiveLocations();return{kind:j.DIRECTIVE_DEFINITION,description:i,name:a,arguments:o,repeatable:s,locations:u,loc:this.loc(n)}},e.parseDirectiveLocations=function(){return this.delimitedMany(O.PIPE,this.parseDirectiveLocation)},e.parseDirectiveLocation=function(){var n=this._lexer.token,i=this.parseName();if($g[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 _d(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 vt(this._lexer.source,i.start,"Expected ".concat(Ed(n),", found ").concat(Jc(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===O.NAME&&i.value===n)this._lexer.advance();else throw vt(this._lexer.source,i.start,'Expected "'.concat(n,'", found ').concat(Jc(i),"."))},e.expectOptionalKeyword=function(n){var i=this._lexer.token;return i.kind===O.NAME&&i.value===n?(this._lexer.advance(),!0):!1},e.unexpected=function(n){var i=n??this._lexer.token;return vt(this._lexer.source,i.start,"Unexpected ".concat(Jc(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 Jc(t){var e=t.value;return Ed(t.kind)+(e!=null?' "'.concat(e,'"'):"")}function Ed(t){return qg(t)?'"'.concat(t,'"'):t}var Ho=new Map,yu=new Map,xd=!0,ss=!1;function Id(t){return t.replace(/[\s,]+/g," ").trim()}function Xg(t){return Id(t.source.body.substring(t.start,t.end))}function ey(t){var e=new Set,r=[];return t.definitions.forEach(function(n){if(n.kind==="FragmentDefinition"){var i=n.name.value,a=Xg(n.loc),o=yu.get(i);o&&!o.has(a)?xd&&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||du.set(i,o=new Set),o.add(a),e.has(a)||(e.add(a),r.push(n))}else r.push(n)}),ts(ts({},t),{definitions:r})}function Xy(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 eg(t){var e=xd(t);if(!Vo.has(e)){var r=Hy(t,{experimentalFragmentVariables:rs,allowLegacyFragmentVariables:rs});if(!r||r.kind!=="Document")throw new Error("Not a valid GraphQL document.");Vo.set(e,Xy(Zy(r)))}return Vo.get(e)}function I(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]}),eg(n)}function tg(){Vo.clear(),du.clear()}function rg(){Ed=!1}function ng(){rs=!0}function ig(){rs=!1}var zi={gql:I,resetCaches:tg,disableFragmentWarnings:rg,enableExperimentalFragmentVariables:ng,disableExperimentalFragmentVariables:ig};(function(t){t.gql=zi.gql,t.resetCaches=zi.resetCaches,t.disableFragmentWarnings=zi.disableFragmentWarnings,t.enableExperimentalFragmentVariables=zi.enableExperimentalFragmentVariables,t.disableExperimentalFragmentVariables=zi.disableExperimentalFragmentVariables})(I||(I={}));I.default=I;function k(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 ag(){}function zr(){return ag}var pe=zr,m=zr,Be=zr,$e=zr,G=zr,jt=zr,og=zr,Mu=zr,Id=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},Td=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},bn=class{constructor(e){this.code=e}};Id([m(),Td("design:type",String)],bn.prototype,"code",void 0);bn=Id([G(),Td("design:paramtypes",[String])],bn);var ju=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)},Yt=class{constructor(e,r){this.address=e,this.name=r}};ju([m(),Uu("design:type",String)],Yt.prototype,"address",void 0);ju([m(),Uu("design:type",String)],Yt.prototype,"name",void 0);Yt=ju([G(),Uu("design:paramtypes",[String,String])],Yt);var _e=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},Fe=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},hr=class{constructor(e,r){this.key=r,this.signature=e}};_e([m(),Fe("design:type",String)],hr.prototype,"signature",void 0);_e([m(),Fe("design:type",String)],hr.prototype,"key",void 0);_e([m(),Fe("design:type",Boolean)],hr.prototype,"valid",void 0);_e([m(),Fe("design:type",Boolean)],hr.prototype,"invalid",void 0);hr=_e([G(),Be(),Fe("design:paramtypes",[String,String])],hr);var _n=class{};_e([m(),Fe("design:type",String)],_n.prototype,"signature",void 0);_e([m(),Fe("design:type",String)],_n.prototype,"key",void 0);_e([m(),Fe("design:type",Boolean)],_n.prototype,"valid",void 0);_e([m(),Fe("design:type",Boolean)],_n.prototype,"invalid",void 0);_n=_e([Be()],_n);function Gr(t){let e=class{constructor(n,i,a,o){this.author=n,this.timestamp=i,this.data=a,this.proof=o}};return _e([m(),Fe("design:type",String)],e.prototype,"author",void 0),_e([m(),Fe("design:type",String)],e.prototype,"timestamp",void 0),_e([m(),Fe("design:type",Object)],e.prototype,"data",void 0),_e([m(),Fe("design:type",hr)],e.prototype,"proof",void 0),e=_e([G(),Fe("design:paramtypes",[String,String,Object,hr])],e),e}function sg(t){let e=class{};return _e([m(),Fe("design:type",String)],e.prototype,"author",void 0),_e([m(),Fe("design:type",String)],e.prototype,"timestamp",void 0),_e([m(),Fe("design:type",Object)],e.prototype,"data",void 0),_e([m(),Fe("design:type",_n)],e.prototype,"proof",void 0),e=_e([Be()],e),e}var ap=class extends Gr(){};ap=_e([G()],ap);var ns=class extends Gr(){};_e([m(),Fe("design:type",Yt)],ns.prototype,"language",void 0);_e([m(),Fe("design:type",bn)],ns.prototype,"icon",void 0);ns=_e([G()],ns);function pT(t){return t&&t.author&&t.timestamp&&t.data}var Ne=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},He=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},wn=class{constructor(e){this.source=e.source?e.source:"",this.target=e.target?e.target:"",this.predicate=e.predicate?e.predicate:""}};Ne([m(),He("design:type",String)],wn.prototype,"source",void 0);Ne([m(),He("design:type",String)],wn.prototype,"target",void 0);Ne([m(),He("design:type",String)],wn.prototype,"predicate",void 0);wn=Ne([G(),He("design:paramtypes",[Object])],wn);var is=class{};Ne([m(),He("design:type",Array)],is.prototype,"additions",void 0);Ne([m(),He("design:type",Array)],is.prototype,"removals",void 0);is=Ne([Be()],is);var as=class{constructor(e,r){this.additions=e,this.removals=r}};Ne([m(),He("design:type",Array)],as.prototype,"additions",void 0);Ne([m(),He("design:type",Array)],as.prototype,"removals",void 0);as=Ne([G(),He("design:paramtypes",[Array,Array])],as);var Sa=class{};Ne([m(),He("design:type",String)],Sa.prototype,"source",void 0);Ne([m(),He("design:type",String)],Sa.prototype,"target",void 0);Ne([m(),He("design:type",String)],Sa.prototype,"predicate",void 0);Sa=Ne([Be()],Sa);var jr=class extends Gr(){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}};Ne([m(),He("design:type",String)],jr.prototype,"status",void 0);jr=Ne([G()],jr);var hu=class extends sg(){};Ne([m(),He("design:type",String)],hu.prototype,"status",void 0);hu=Ne([Be()],hu);function bT(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 _T(t){return t&&t.source&&t.target}var os=class{constructor(e,r){this.oldLink=e,this.newLink=r}};Ne([m(),He("design:type",jr)],os.prototype,"oldLink",void 0);Ne([m(),He("design:type",jr)],os.prototype,"newLink",void 0);os=Ne([G(),He("design:paramtypes",[jr,jr])],os);var An=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},Ra=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},mu,er=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}};An([m(),Ra("design:type",Array)],er.prototype,"links",void 0);er=An([G(),Ra("design:paramtypes",[Array])],er);var ss=class{};An([m(),Ra("design:type",Array)],ss.prototype,"links",void 0);ss=An([Be()],ss);var yu=mu=class{constructor(e){e?this.links=e:this.links=[]}static fromLink(e){let r=new mu;return r.links.push(e),r}};An([m(),Ra("design:type",Array)],yu.prototype,"links",void 0);yu=mu=An([Be(),Ra("design:paramtypes",[Array])],yu);var Sn=class extends Gr(){};Sn=An([G()],Sn);var M=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},j=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Rr=class{constructor(e,r){this.did=e,r?this.perspective=r:this.perspective=new er}};M([m(),j("design:type",String)],Rr.prototype,"did",void 0);M([m(),j("design:type",er)],Rr.prototype,"perspective",void 0);M([m(),j("design:type",String)],Rr.prototype,"directMessageLanguage",void 0);Rr=M([G(),j("design:paramtypes",[String,er])],Rr);var op=class extends Gr(){};op=M([G()],op);var Ur=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}};M([m(),j("design:type",String)],Ur.prototype,"did",void 0);M([m(),j("design:type",String)],Ur.prototype,"didSigningKeyId",void 0);M([m(),j("design:type",String)],Ur.prototype,"deviceKeyType",void 0);M([m(),j("design:type",String)],Ur.prototype,"deviceKey",void 0);M([m(),j("design:type",String)],Ur.prototype,"deviceKeySignedByDid",void 0);M([m(),j("design:type",String)],Ur.prototype,"didSignedByDeviceKey",void 0);Ur=M([G(),j("design:paramtypes",[String,String,String,String,String,String])],Ur);var qr=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}};M([m(),j("design:type",String)],qr.prototype,"did",void 0);M([m(),j("design:type",String)],qr.prototype,"didSigningKeyId",void 0);M([m(),j("design:type",String)],qr.prototype,"deviceKeyType",void 0);M([m(),j("design:type",String)],qr.prototype,"deviceKey",void 0);M([m(),j("design:type",String)],qr.prototype,"deviceKeySignedByDid",void 0);M([m(),j("design:type",String)],qr.prototype,"didSignedByDeviceKey",void 0);qr=M([Be(),j("design:paramtypes",[String,String,String,String,String,String])],qr);var cs=class{constructor(e,r){this.signature=e,this.publicKey=r}};M([m(),j("design:type",String)],cs.prototype,"signature",void 0);M([m(),j("design:type",String)],cs.prototype,"publicKey",void 0);cs=M([G(),j("design:paramtypes",[String,String])],cs);var ui=class{constructor(e,r){this.domain=e,this.pointers=r}};M([m(),j("design:type",String)],ui.prototype,"domain",void 0);M([m(),j("design:type",Array)],ui.prototype,"pointers",void 0);ui=M([G(),j("design:paramtypes",[String,Array])],ui);var us=class{constructor(e,r){this.with=e,this.can=r}};M([m(),j("design:type",ui)],us.prototype,"with",void 0);M([m(),j("design:type",Array)],us.prototype,"can",void 0);us=M([G(),j("design:paramtypes",[ui,Array])],us);var mr=class{constructor(e,r,n,i,a){this.appName=e,this.appDesc=r,this.appIconPath=a,this.appUrl=n,this.capabilities=i}};M([m(),j("design:type",String)],mr.prototype,"appName",void 0);M([m(),j("design:type",String)],mr.prototype,"appDesc",void 0);M([m(),j("design:type",String)],mr.prototype,"appUrl",void 0);M([m(),j("design:type",String)],mr.prototype,"appIconPath",void 0);M([m(),j("design:type",Array)],mr.prototype,"capabilities",void 0);mr=M([G(),j("design:paramtypes",[String,String,String,Array,String])],mr);var li=class{constructor(e,r,n,i){this.requestId=e,this.auth=r,this.token=n,this.revoked=i}};M([m(),j("design:type",String)],li.prototype,"requestId",void 0);M([m(),j("design:type",String)],li.prototype,"token",void 0);M([m(),j("design:type",Boolean)],li.prototype,"revoked",void 0);M([m(),j("design:type",mr)],li.prototype,"auth",void 0);li=M([G(),j("design:paramtypes",[String,mr,String,Boolean])],li);var fi=class{constructor(e,r){this.domain=e,this.pointers=r}};M([m(),j("design:type",String)],fi.prototype,"domain",void 0);M([m(),j("design:type",Array)],fi.prototype,"pointers",void 0);fi=M([Be(),j("design:paramtypes",[String,Array])],fi);var ls=class{constructor(e,r){this.with=e,this.can=r}};M([m(),j("design:type",fi)],ls.prototype,"with",void 0);M([m(),j("design:type",Array)],ls.prototype,"can",void 0);ls=M([Be(),j("design:paramtypes",[fi,Array])],ls);var Br=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}};M([m(),j("design:type",String)],Br.prototype,"appName",void 0);M([m(),j("design:type",String)],Br.prototype,"appDesc",void 0);M([m(),j("design:type",String)],Br.prototype,"appDomain",void 0);M([m(),j("design:type",String)],Br.prototype,"appUrl",void 0);M([m(),j("design:type",String)],Br.prototype,"appIconPath",void 0);M([m(),j("design:type",Array)],Br.prototype,"capabilities",void 0);Br=M([Be(),j("design:paramtypes",[String,String,String,String,String,Array])],Br);var gi=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},vi=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Ot=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)}};gi([m(),vi("design:type",Boolean)],Ot.prototype,"isInitialized",void 0);gi([m(),vi("design:type",Boolean)],Ot.prototype,"isUnlocked",void 0);gi([m(),vi("design:type",String)],Ot.prototype,"did",void 0);gi([m(),vi("design:type",String)],Ot.prototype,"didDocument",void 0);gi([m(),vi("design:type",String)],Ot.prototype,"error",void 0);Ot=gi([G(),vi("design:paramtypes",[Object])],Ot);var sp=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},ke=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},ut,lt,gu=class{constructor(e,r){ut.set(this,void 0),lt.set(this,void 0),sp(this,ut,e,"f"),sp(this,lt,r,"f")}async otherAgents(){return await ke(this,ut,"f").otherAgents(ke(this,lt,"f"))}async hasTelepresenceAdapter(){return await ke(this,ut,"f").hasTelepresenceAdapter(ke(this,lt,"f"))}async onlineAgents(){return await ke(this,ut,"f").onlineAgents(ke(this,lt,"f"))}async setOnlineStatus(e){return await ke(this,ut,"f").setOnlineStatus(ke(this,lt,"f"),e)}async setOnlineStatusU(e){return await ke(this,ut,"f").setOnlineStatusU(ke(this,lt,"f"),e)}async sendSignal(e,r){return await ke(this,ut,"f").sendSignal(ke(this,lt,"f"),e,r)}async sendSignalU(e,r){return await ke(this,ut,"f").sendSignalU(ke(this,lt,"f"),e,r)}async sendBroadcast(e,r=!1){return await ke(this,ut,"f").sendBroadcast(ke(this,lt,"f"),e,r)}async sendBroadcastU(e,r=!1){return await ke(this,ut,"f").sendBroadcastU(ke(this,lt,"f"),e,r)}async addSignalHandler(e){await ke(this,ut,"f").addSignalHandler(ke(this,lt,"f"),e)}removeSignalHandler(e){ke(this,ut,"f").removeSignalHandler(ke(this,lt,"f"),e)}};ut=new WeakMap,lt=new WeakMap;var Dn=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)},Ze=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)}};Dn([m(),Nn("design:type",String)],Ze.prototype,"source",void 0);Dn([m(),Nn("design:type",String)],Ze.prototype,"target",void 0);Dn([m(),Nn("design:type",String)],Ze.prototype,"predicate",void 0);Dn([m(),Nn("design:type",Date)],Ze.prototype,"fromDate",void 0);Dn([m(),Nn("design:type",Date)],Ze.prototype,"untilDate",void 0);Dn([m(),Nn("design:type",Number)],Ze.prototype,"limit",void 0);Ze=Dn([G(),Be(),Nn("design:paramtypes",[Object])],Ze);var cp=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},We=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)},ft,cr;function To(t){return encodeURIComponent(t).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`)}var _t=class{constructor(){ft.set(this,void 0),cr.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 _t;return cp(r,cr,e,"f"),r}static from(e){let r=new _t;return cp(r,ft,e,"f"),r}toUrl(){if(We(this,cr,"f")&&!We(this,ft,"f"))return We(this,cr,"f");if(!We(this,cr,"f")&&(We(this,ft,"f")===void 0||We(this,ft,"f")===""||We(this,ft,"f")===null))throw new Error("Can't turn empty Literal into URL");let e;switch(typeof We(this,ft,"f")){case"string":e=`string:${To(We(this,ft,"f"))}`;break;case"number":e=`number:${To(We(this,ft,"f"))}`;break;case"boolean":e=`boolean:${To(We(this,ft,"f"))}`;break;case"object":e=`json:${To(JSON.stringify(We(this,ft,"f")))}`;break}return`literal://${e}`}get(){if(We(this,ft,"f"))return We(this,ft,"f");if(!We(this,cr,"f"))throw new Error("Can't render empty Literal");if(!We(this,cr,"f").startsWith("literal://"))throw new Error("Can't render Literal from non-literal URL");let e=We(this,cr,"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}`)}};ft=new WeakMap,cr=new WeakMap;function Lr(t){return t.charAt(0).toUpperCase()+t.slice(1)}function qu(t){return`set${Lr(t)}`}function dr(t){return t.endsWith("y")?t.slice(0,-1)+"ies":t+"s"}function Bu(t){return t.endsWith("ies")?t.slice(0,-3)+"y":t.endsWith("s")?t.slice(0,-1):t}function cg(t){return`add${Lr(Bu(t))}`}function ug(t){let e=t.substring(3),r=dr(e);return r.charAt(0).toLowerCase()+r.slice(1)}function lg(t){return`remove${Lr(Bu(t))}`}function fg(t){let e=t.substring(6),r=dr(e);return r.charAt(0).toLowerCase()+r.slice(1)}function pg(t){let e=t.substring(13),r=dr(e);return r.charAt(0).toLowerCase()+r.slice(1)}function dg(t){return`setCollection${Lr(Bu(t))}`}function on(t){if(Array.isArray(t))return`[${t.map(on).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 Wc=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)},rt,nt,Se,fs=class{constructor(t,e,r){rt.set(this,void 0),nt.set(this,void 0),Se.set(this,void 0),Wc(this,rt,e,"f"),Wc(this,nt,r,"f"),Wc(this,Se,t,"f")}get baseExpression(){return Q(this,rt,"f")}async init(){let isInstance=await Q(this,Se,"f").isSubjectInstance(Q(this,rt,"f"),Q(this,nt,"f"));if(!isInstance)throw`Not a valid subject instance of ${Q(this,nt,"f")} for ${Q(this,rt,"f")}`;let results=await Q(this,Se,"f").infer(`subject_class("${Q(this,nt,"f")}", C), property(C, Property)`),properties=results.map(t=>t.Property);for(let t of properties){let e=await Q(this,Se,"f").infer(`subject_class("${Q(this,nt,"f")}", C), property_resolve(C, "${t}")`);Object.defineProperty(this,t,{configurable:!0,get:async()=>{let r=await Q(this,Se,"f").infer(`subject_class("${Q(this,nt,"f")}", C), property_getter(C, "${Q(this,rt,"f")}", "${t}", Value)`);if(r&&r.length>0){let n=r[0].Value;if(e)try{if(n){let i=await Q(this,Se,"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 Q(this,Se,"f").infer(`subject_class("${Q(this,nt,"f")}", C), property_setter(C, Property, Setter)`);for(let setter of setters||[])if(setter){let property=setter.Property,actions=eval(setter.Setter),resolveLanguageResults=await Q(this,Se,"f").infer(`subject_class("${Q(this,nt,"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 Q(this,Se,"f").createExpression(t,resolveLanguage)),await Q(this,Se,"f").executeAction(actions,Q(this,rt,"f"),[{name:"value",value:t}])}}let results2=await Q(this,Se,"f").infer(`subject_class("${Q(this,nt,"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 Q(this,Se,"f").infer(`subject_class("${Q(this,nt,"f")}", C), collection_getter(C, "${Q(this,rt,"f")}", "${t}", Value)`);return e&&e.length>0&&e[0].Value?e[0].Value.filter(n=>n!==""&&n!==""):[]}});let adders=await Q(this,Se,"f").infer(`subject_class("${Q(this,nt,"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[cg(collection)]=async t=>{Array.isArray(t)?await Promise.all(t.map(e=>Q(this,Se,"f").executeAction(actions,Q(this,rt,"f"),[{name:"value",value:e}]))):await Q(this,Se,"f").executeAction(actions,Q(this,rt,"f"),[{name:"value",value:t}])}}let removers=await Q(this,Se,"f").infer(`subject_class("${Q(this,nt,"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[lg(collection)]=async t=>{Array.isArray(t)?await Promise.all(t.map(e=>Q(this,Se,"f").executeAction(actions,Q(this,rt,"f"),[{name:"value",value:e}]))):await Q(this,Se,"f").executeAction(actions,Q(this,rt,"f"),[{name:"value",value:t}])}}let collectionSetters=await Q(this,Se,"f").infer(`subject_class("${Q(this,nt,"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[dg(collection)]=async t=>{Array.isArray(t)?await Q(this,Se,"f").executeAction(actions,Q(this,rt,"f"),t.map(e=>({name:"value",value:e}))):await Q(this,Se,"f").executeAction(actions,Q(this,rt,"f"),[{name:"value",value:t}])}}}};rt=new WeakMap,nt=new WeakMap,Se=new WeakMap;var De=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},D=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)},vu,ii,Dr,sn,dn,Ji,Yi,ai,Zi,Qo,ur,Xi,kd,ce,ue,cn,un,ln,ea,bu=class{constructor(e,r,n){vu.add(this),ii.set(this,void 0),Dr.set(this,void 0),sn.set(this,void 0),dn.set(this,void 0),Ji.set(this,void 0),Yi.set(this,void 0),ai.set(this,void 0),Zi.set(this,!1),Qo.set(this,void 0),ur.set(this,void 0),Xi.set(this,void 0),De(this,ii,e,"f"),De(this,Xi,r,"f"),De(this,sn,n,"f"),De(this,dn,new Set,"f"),De(this,ai,null,"f")}async subscribe(){let e=await D(this,sn,"f").subscribeQuery(D(this,ii,"f"),D(this,Xi,"f"));De(this,Dr,e.subscriptionId,"f"),De(this,Qo,new Promise((n,i)=>{De(this,ur,setTimeout(()=>{i(new Error("Subscription initialization timed out after 30 seconds. Resubscribing...")),this.subscribe()},3e4),"f"),De(this,Yi,D(this,sn,"f").subscribeToQueryUpdates(D(this,Dr,"f"),a=>{D(this,ur,"f")&&(clearTimeout(D(this,ur,"f")),De(this,ur,void 0,"f")),n(!0),!(a.isInit&&D(this,ai,"f"))&&(De(this,ai,a,"f"),D(this,vu,"m",kd).call(this,a))}),"f")}),"f");let r=async()=>{if(!D(this,Zi,"f")){try{await D(this,sn,"f").keepAliveQuery(D(this,ii,"f"),D(this,Dr,"f"))}catch(n){console.error("Error in keepalive:",n),console.log("Reinitializing subscription for query:",D(this,Xi,"f")),await this.subscribe(),console.log("Subscription reinitialized")}D(this,Zi,"f")||De(this,Ji,setTimeout(r,3e4),"f")}};De(this,Ji,setTimeout(r,3e4),"f")}get id(){return D(this,Dr,"f")}get initialized(){return D(this,Qo,"f")}get result(){return D(this,ai,"f")}onResult(e){return D(this,dn,"f").add(e),()=>D(this,dn,"f").delete(e)}dispose(){De(this,Zi,!0,"f"),clearTimeout(D(this,Ji,"f")),D(this,Yi,"f")&&D(this,Yi,"f").call(this),D(this,dn,"f").clear(),D(this,ur,"f")&&(clearTimeout(D(this,ur,"f")),De(this,ur,void 0,"f")),D(this,Dr,"f")&&D(this,sn,"f").disposeQuerySubscription(D(this,ii,"f"),D(this,Dr,"f")).catch(e=>console.error("Error disposing query subscription:",e))}};ii=new WeakMap,Dr=new WeakMap,sn=new WeakMap,dn=new WeakMap,Ji=new WeakMap,Yi=new WeakMap,ai=new WeakMap,Zi=new WeakMap,Qo=new WeakMap,ur=new WeakMap,Xi=new WeakMap,vu=new WeakSet,kd=function t(e){for(let r of D(this,dn,"f"))try{r(e)}catch(n){console.error("Error in query subscription callback:",n)}};var si=class{constructor(t,e){ce.set(this,void 0),ue.set(this,void 0),cn.set(this,void 0),un.set(this,void 0),ln.set(this,void 0),ea.set(this,void 0),De(this,cn,[],"f"),De(this,un,[],"f"),De(this,ln,[],"f"),De(this,ea,[],"f"),De(this,ce,t,"f"),De(this,ue,e,"f"),this.uuid=D(this,ce,"f").uuid,this.name=D(this,ce,"f").name,this.sharedUrl=D(this,ce,"f").sharedUrl,this.neighbourhood=D(this,ce,"f").neighbourhood,this.state=D(this,ce,"f").state,D(this,ue,"f").addPerspectiveLinkAddedListener(D(this,ce,"f").uuid,D(this,cn,"f")),D(this,ue,"f").addPerspectiveLinkRemovedListener(D(this,ce,"f").uuid,D(this,un,"f")),D(this,ue,"f").addPerspectiveLinkUpdatedListener(D(this,ce,"f").uuid,D(this,ln,"f")),D(this,ue,"f").addPerspectiveSyncStateChangeListener(D(this,ce,"f").uuid,D(this,ea,"f"))}async executeAction(t,e,r,n){return await D(this,ue,"f").executeCommands(D(this,ce,"f").uuid,JSON.stringify(t),e,JSON.stringify(r),n)}async get(t){return await D(this,ue,"f").queryLinks(D(this,ce,"f").uuid,t)}async infer(t){return await D(this,ue,"f").queryProlog(D(this,ce,"f").uuid,t)}async add(t,e="shared",r){return await D(this,ue,"f").addLink(D(this,ce,"f").uuid,t,e,r)}async addLinks(t,e="shared",r){return await D(this,ue,"f").addLinks(D(this,ce,"f").uuid,t,e,r)}async removeLinks(t,e){return await D(this,ue,"f").removeLinks(D(this,ce,"f").uuid,t,e)}async linkMutations(t,e="shared"){return await D(this,ue,"f").linkMutations(D(this,ce,"f").uuid,t,e)}async addLinkExpression(t,e="shared",r){return await D(this,ue,"f").addLinkExpression(D(this,ce,"f").uuid,t,e,r)}async update(t,e,r){return await D(this,ue,"f").updateLink(D(this,ce,"f").uuid,t,e,r)}async remove(t,e){return await D(this,ue,"f").removeLink(D(this,ce,"f").uuid,t,e)}async createBatch(){return await D(this,ue,"f").createBatch(D(this,ce,"f").uuid)}async commitBatch(t){return await D(this,ue,"f").commitBatch(D(this,ce,"f").uuid,t)}async getExpression(t){return await D(this,ue,"f").getExpression(t)}async createExpression(t,e){return await D(this,ue,"f").createExpression(t,e)}async addListener(t,e){t==="link-added"?D(this,cn,"f").push(e):t==="link-removed"?D(this,un,"f").push(e):t==="link-updated"&&D(this,ln,"f").push(e)}async addSyncStateChangeListener(t){D(this,ea,"f").push(t)}async removeListener(t,e){if(t==="link-added"){let r=D(this,cn,"f").indexOf(e);D(this,cn,"f").splice(r,1)}else if(t==="link-removed"){let r=D(this,un,"f").indexOf(e);D(this,un,"f").splice(r,1)}else if(t==="link-updated"){let r=D(this,ln,"f").indexOf(e);D(this,ln,"f").splice(r,1)}}async snapshot(){return D(this,ue,"f").snapshotByUUID(D(this,ce,"f").uuid)}async loadSnapshot(t){let e=JSON.parse(JSON.stringify(t));delete e.__typename,e.links.forEach(r=>{delete r.data.__typename});for(let r of e.links)await this.addLinkExpression(r)}async getSingleTarget(t){delete t.target;let e=await this.get(t);return e.length?e[0].data.target:null}async setSingleTarget(t,e="shared"){let r=new Ze({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(){let t=["ad4m://has_subject_class","ad4m://has_flow","ad4m://has_custom_sdna"],e=[];for(let r of t){let n=await this.get(new Ze({source:"ad4m://self",predicate:r}));for(let i of n){let a=i.data.target,o=await this.get(new Ze({source:a,predicate:"ad4m://sdna"}));for(let s of o){let u=_t.fromUrl(s.data.target).get();typeof u=="string"&&e.push(u)}}}return e}async getSdnaForClass(t){let e=_t.from(t);if((await this.get(new Ze({source:"ad4m://self",target:e.toUrl(),predicate:"ad4m://has_subject_class"}))).length===0)return null;let n=await this.get(new Ze({source:e.toUrl(),predicate:"ad4m://sdna"}));if(n.length===0)return null;let i=_t.fromUrl(n[0].data.target).get();return typeof i=="string"?i:null}async addSdna(t,e,r){return D(this,ue,"f").addSdna(D(this,ce,"f").uuid,t,e,r)}async subjectClasses(){try{return(await this.infer("subject_class(X, _)")).map(t=>t.X)}catch{return[]}}async stringOrTemplateObjectToSubjectClassName(t){if(typeof t=="string")return t;{let e=await this.subjectClassesByTemplate(t);return e[0]?e[0]:t.className}}async createSubject(t,e,r,n){let i;if(typeof t=="string")i=t,await D(this,ue,"f").createSubject(D(this,ce,"f").uuid,JSON.stringify({className:i,initialValues:r}),e,r?JSON.stringify(r):void 0,n);else{let a=this.buildQueryFromTemplate(t);await D(this,ue,"f").createSubject(D(this,ce,"f").uuid,JSON.stringify({query:a,initialValues:r}),e,r?JSON.stringify(r):void 0,n)}return n?e:this.getSubjectProxy(e,t)}async getSubjectData(t,e){if(typeof t=="string")return JSON.parse(await D(this,ue,"f").getSubjectData(D(this,ce,"f").uuid,JSON.stringify({className:t}),e));let r=this.buildQueryFromTemplate(t);return JSON.parse(await D(this,ue,"f").getSubjectData(D(this,ce,"f").uuid,JSON.stringify({query:r}),e))}async removeSubject(subjectClass,exprAddr,batchId){let className=await this.stringOrTemplateObjectToSubjectClassName(subjectClass),result=await this.infer(`subject_class("${className}", C), destructor(C, Actions)`);if(!result.length)throw"No destructor found for given subject class: "+className;let actions=result.map(x=>eval(x.Actions));await this.executeAction(actions[0],exprAddr,void 0,batchId)}async isSubjectInstance(t,e){let r=await this.stringOrTemplateObjectToSubjectClassName(e),n=!1,i=5,a=0;for(;a<i&&!n;)n=await this.infer(`subject_class("${r}", C), instance(C, "${t}")`),a++;return n}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.stringOrTemplateObjectToSubjectClassName(e),n=new fs(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;return function(r){let n=[],i=[];Object.getPrototypeOf(r).__properties?Object.keys(Object.getPrototypeOf(r).__properties).forEach(l=>n.push(l)):n.push(...Object.keys(r).filter(l=>!Array.isArray(r[l]))),Object.getPrototypeOf(r).__collections?Object.keys(Object.getPrototypeOf(r).__collections).filter(l=>l!=="isSubjectInstance").forEach(l=>{i.includes(l)||i.push(l)}):i.push(...Object.keys(r).filter(l=>Array.isArray(r[l])).filter(l=>l!=="isSubjectInstance"));let a=Object.getOwnPropertyNames(r).filter(l=>typeof r[l]=="function"&&l.startsWith("set")&&!l.startsWith("setCollection"));a=a.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(r)).filter(l=>{let d=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(r),l);return d&&typeof d.value=="function"&&l.startsWith("set")&&!l.startsWith("setCollection")}));let o=Object.getOwnPropertyNames(r).filter(l=>Object.prototype.hasOwnProperty.call(r,l)&&typeof r[l]=="function"&&l.startsWith("add"));o=o.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(r)).filter(l=>{let d=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(r),l);return d&&typeof d.value=="function"&&l.startsWith("add")}));let s=Object.getOwnPropertyNames(r).filter(l=>Object.prototype.hasOwnProperty.call(r,l)&&typeof r[l]=="function"&&l.startsWith("remove"));s=s.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(r)).filter(l=>{let d=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(r),l);return d&&typeof d.value=="function"&&l.startsWith("remove")}));let u=Object.getOwnPropertyNames(r).filter(l=>Object.prototype.hasOwnProperty.call(r,l)&&typeof r[l]=="function"&&l.startsWith("setCollection"));u=u.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(r)).filter(l=>{let d=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(r),l);return d&&typeof d.value=="function"&&l.startsWith("setCollection")}));let c="subject_class(Class, C)";for(let l of n)c+=`, property(C, "${l}")`;for(let l of i)c+=`, collection(C, "${l}")`;for(let l of a){let d=l.substring(3);d=d.charAt(0).toLowerCase()+d.slice(1),c+=`, property_setter(C, "${d}", _)`}for(let l of o)c+=`, collection_adder(C, "${ug(l)}", _)`;for(let l of s)c+=`, collection_remover(C, "${fg(l)}", _)`;for(let l of u)c+=`, collection_setter(C, "${pg(l)}", _)`;c+=".",e=c}(t),e}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 D(this,ue,"f").getNeighbourhoodProxy(D(this,ce,"f").uuid)}get ai(){return D(this,ue,"f").aiClient}async subscribeInfer(t){let e=new bu(this.uuid,t,D(this,ue,"f"));return await e.subscribe(),await e.initialized,e}};ce=new WeakMap,ue=new WeakMap,cn=new WeakMap,un=new WeakMap,ln=new WeakMap,ea=new WeakMap;var kr=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)},X,ta,ra,na,zo,ia,Go,Wo,tt=`
61
+ this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`):o||yu.set(i,o=new Set),o.add(a),e.has(a)||(e.add(a),r.push(n))}else r.push(n)}),os(os({},t),{definitions:r})}function ty(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 ry(t){var e=Id(t);if(!Ho.has(e)){var r=Yg(t,{experimentalFragmentVariables:ss,allowLegacyFragmentVariables:ss});if(!r||r.kind!=="Document")throw new Error("Not a valid GraphQL document.");Ho.set(e,ty(ey(r)))}return Ho.get(e)}function I(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]}),ry(n)}function ny(){Ho.clear(),yu.clear()}function iy(){xd=!1}function ay(){ss=!0}function oy(){ss=!1}var Wi={gql:I,resetCaches:ny,disableFragmentWarnings:iy,enableExperimentalFragmentVariables:ay,disableExperimentalFragmentVariables:oy};(function(t){t.gql=Wi.gql,t.resetCaches=Wi.resetCaches,t.disableFragmentWarnings=Wi.disableFragmentWarnings,t.enableExperimentalFragmentVariables=Wi.enableExperimentalFragmentVariables,t.disableExperimentalFragmentVariables=Wi.disableExperimentalFragmentVariables})(I||(I={}));I.default=I;function k(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 sy(){}function zr(){return sy}var pe=zr,h=zr,Be=zr,Ne=zr,V=zr,Et=zr,cy=zr,Bu=zr,Td=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},kd=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},bn=class{constructor(e){this.code=e}};Td([h(),kd("design:type",String)],bn.prototype,"code",void 0);bn=Td([V(),kd("design:paramtypes",[String])],bn);var Vu=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},Qu=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Yt=class{constructor(e,r){this.address=e,this.name=r}};Vu([h(),Qu("design:type",String)],Yt.prototype,"address",void 0);Vu([h(),Qu("design:type",String)],Yt.prototype,"name",void 0);Yt=Vu([V(),Qu("design:paramtypes",[String,String])],Yt);var _e=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},$e=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},hr=class{constructor(e,r){this.key=r,this.signature=e}};_e([h(),$e("design:type",String)],hr.prototype,"signature",void 0);_e([h(),$e("design:type",String)],hr.prototype,"key",void 0);_e([h(),$e("design:type",Boolean)],hr.prototype,"valid",void 0);_e([h(),$e("design:type",Boolean)],hr.prototype,"invalid",void 0);hr=_e([V(),Be(),$e("design:paramtypes",[String,String])],hr);var _n=class{};_e([h(),$e("design:type",String)],_n.prototype,"signature",void 0);_e([h(),$e("design:type",String)],_n.prototype,"key",void 0);_e([h(),$e("design:type",Boolean)],_n.prototype,"valid",void 0);_e([h(),$e("design:type",Boolean)],_n.prototype,"invalid",void 0);_n=_e([Be()],_n);function Gr(t){let e=class{constructor(n,i,a,o){this.author=n,this.timestamp=i,this.data=a,this.proof=o}};return _e([h(),$e("design:type",String)],e.prototype,"author",void 0),_e([h(),$e("design:type",String)],e.prototype,"timestamp",void 0),_e([h(),$e("design:type",Object)],e.prototype,"data",void 0),_e([h(),$e("design:type",hr)],e.prototype,"proof",void 0),e=_e([V(),$e("design:paramtypes",[String,String,Object,hr])],e),e}function uy(t){let e=class{};return _e([h(),$e("design:type",String)],e.prototype,"author",void 0),_e([h(),$e("design:type",String)],e.prototype,"timestamp",void 0),_e([h(),$e("design:type",Object)],e.prototype,"data",void 0),_e([h(),$e("design:type",_n)],e.prototype,"proof",void 0),e=_e([Be()],e),e}var op=class extends Gr(){};op=_e([V()],op);var cs=class extends Gr(){};_e([h(),$e("design:type",Yt)],cs.prototype,"language",void 0);_e([h(),$e("design:type",bn)],cs.prototype,"icon",void 0);cs=_e([V()],cs);function hT(t){return t&&t.author&&t.timestamp&&t.data}var Pe=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},Je=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Sn=class{constructor(e){this.source=e.source?e.source:"",this.target=e.target?e.target:"",this.predicate=e.predicate?e.predicate:""}};Pe([h(),Je("design:type",String)],Sn.prototype,"source",void 0);Pe([h(),Je("design:type",String)],Sn.prototype,"target",void 0);Pe([h(),Je("design:type",String)],Sn.prototype,"predicate",void 0);Sn=Pe([V(),Je("design:paramtypes",[Object])],Sn);var us=class{};Pe([h(),Je("design:type",Array)],us.prototype,"additions",void 0);Pe([h(),Je("design:type",Array)],us.prototype,"removals",void 0);us=Pe([Be()],us);var ls=class{constructor(e,r){this.additions=e,this.removals=r}};Pe([h(),Je("design:type",Array)],ls.prototype,"additions",void 0);Pe([h(),Je("design:type",Array)],ls.prototype,"removals",void 0);ls=Pe([V(),Je("design:paramtypes",[Array,Array])],ls);var xa=class{};Pe([h(),Je("design:type",String)],xa.prototype,"source",void 0);Pe([h(),Je("design:type",String)],xa.prototype,"target",void 0);Pe([h(),Je("design:type",String)],xa.prototype,"predicate",void 0);xa=Pe([Be()],xa);var Ur=class extends Gr(){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}};Pe([h(),Je("design:type",String)],Ur.prototype,"status",void 0);Ur=Pe([V()],Ur);var vu=class extends uy(){};Pe([h(),Je("design:type",String)],vu.prototype,"status",void 0);vu=Pe([Be()],vu);function ST(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 wT(t){return t&&t.source&&t.target}var fs=class{constructor(e,r){this.oldLink=e,this.newLink=r}};Pe([h(),Je("design:type",Ur)],fs.prototype,"oldLink",void 0);Pe([h(),Je("design:type",Ur)],fs.prototype,"newLink",void 0);fs=Pe([V(),Je("design:paramtypes",[Ur,Ur])],fs);var An=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},Ua=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},bu,er=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}};An([h(),Ua("design:type",Array)],er.prototype,"links",void 0);er=An([V(),Ua("design:paramtypes",[Array])],er);var ps=class{};An([h(),Ua("design:type",Array)],ps.prototype,"links",void 0);ps=An([Be()],ps);var _u=bu=class{constructor(e){e?this.links=e:this.links=[]}static fromLink(e){let r=new bu;return r.links.push(e),r}};An([h(),Ua("design:type",Array)],_u.prototype,"links",void 0);_u=bu=An([Be(),Ua("design:paramtypes",[Array])],_u);var wn=class extends Gr(){};wn=An([V()],wn);var M=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},U=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Rr=class{constructor(e,r){this.did=e,r?this.perspective=r:this.perspective=new er}};M([h(),U("design:type",String)],Rr.prototype,"did",void 0);M([h(),U("design:type",er)],Rr.prototype,"perspective",void 0);M([h(),U("design:type",String)],Rr.prototype,"directMessageLanguage",void 0);Rr=M([V(),U("design:paramtypes",[String,er])],Rr);var sp=class extends Gr(){};sp=M([V()],sp);var jr=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}};M([h(),U("design:type",String)],jr.prototype,"did",void 0);M([h(),U("design:type",String)],jr.prototype,"didSigningKeyId",void 0);M([h(),U("design:type",String)],jr.prototype,"deviceKeyType",void 0);M([h(),U("design:type",String)],jr.prototype,"deviceKey",void 0);M([h(),U("design:type",String)],jr.prototype,"deviceKeySignedByDid",void 0);M([h(),U("design:type",String)],jr.prototype,"didSignedByDeviceKey",void 0);jr=M([V(),U("design:paramtypes",[String,String,String,String,String,String])],jr);var qr=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}};M([h(),U("design:type",String)],qr.prototype,"did",void 0);M([h(),U("design:type",String)],qr.prototype,"didSigningKeyId",void 0);M([h(),U("design:type",String)],qr.prototype,"deviceKeyType",void 0);M([h(),U("design:type",String)],qr.prototype,"deviceKey",void 0);M([h(),U("design:type",String)],qr.prototype,"deviceKeySignedByDid",void 0);M([h(),U("design:type",String)],qr.prototype,"didSignedByDeviceKey",void 0);qr=M([Be(),U("design:paramtypes",[String,String,String,String,String,String])],qr);var ds=class{constructor(e,r){this.signature=e,this.publicKey=r}};M([h(),U("design:type",String)],ds.prototype,"signature",void 0);M([h(),U("design:type",String)],ds.prototype,"publicKey",void 0);ds=M([V(),U("design:paramtypes",[String,String])],ds);var ui=class{constructor(e,r){this.domain=e,this.pointers=r}};M([h(),U("design:type",String)],ui.prototype,"domain",void 0);M([h(),U("design:type",Array)],ui.prototype,"pointers",void 0);ui=M([V(),U("design:paramtypes",[String,Array])],ui);var hs=class{constructor(e,r){this.with=e,this.can=r}};M([h(),U("design:type",ui)],hs.prototype,"with",void 0);M([h(),U("design:type",Array)],hs.prototype,"can",void 0);hs=M([V(),U("design:paramtypes",[ui,Array])],hs);var mr=class{constructor(e,r,n,i,a){this.appName=e,this.appDesc=r,this.appIconPath=a,this.appUrl=n,this.capabilities=i}};M([h(),U("design:type",String)],mr.prototype,"appName",void 0);M([h(),U("design:type",String)],mr.prototype,"appDesc",void 0);M([h(),U("design:type",String)],mr.prototype,"appUrl",void 0);M([h(),U("design:type",String)],mr.prototype,"appIconPath",void 0);M([h(),U("design:type",Array)],mr.prototype,"capabilities",void 0);mr=M([V(),U("design:paramtypes",[String,String,String,Array,String])],mr);var li=class{constructor(e,r,n,i){this.requestId=e,this.auth=r,this.token=n,this.revoked=i}};M([h(),U("design:type",String)],li.prototype,"requestId",void 0);M([h(),U("design:type",String)],li.prototype,"token",void 0);M([h(),U("design:type",Boolean)],li.prototype,"revoked",void 0);M([h(),U("design:type",mr)],li.prototype,"auth",void 0);li=M([V(),U("design:paramtypes",[String,mr,String,Boolean])],li);var fi=class{constructor(e,r){this.domain=e,this.pointers=r}};M([h(),U("design:type",String)],fi.prototype,"domain",void 0);M([h(),U("design:type",Array)],fi.prototype,"pointers",void 0);fi=M([Be(),U("design:paramtypes",[String,Array])],fi);var ms=class{constructor(e,r){this.with=e,this.can=r}};M([h(),U("design:type",fi)],ms.prototype,"with",void 0);M([h(),U("design:type",Array)],ms.prototype,"can",void 0);ms=M([Be(),U("design:paramtypes",[fi,Array])],ms);var Br=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}};M([h(),U("design:type",String)],Br.prototype,"appName",void 0);M([h(),U("design:type",String)],Br.prototype,"appDesc",void 0);M([h(),U("design:type",String)],Br.prototype,"appDomain",void 0);M([h(),U("design:type",String)],Br.prototype,"appUrl",void 0);M([h(),U("design:type",String)],Br.prototype,"appIconPath",void 0);M([h(),U("design:type",Array)],Br.prototype,"capabilities",void 0);Br=M([Be(),U("design:paramtypes",[String,String,String,String,String,Array])],Br);var Ia=class{constructor(e,r,n){this.username=e,this.did=r,this.password=n}};M([h(),U("design:type",String)],Ia.prototype,"username",void 0);M([h(),U("design:type",String)],Ia.prototype,"did",void 0);M([h(),U("design:type",String)],Ia.prototype,"password",void 0);Ia=M([V(),U("design:paramtypes",[String,String,String])],Ia);var Ta=class{constructor(e,r,n){this.did=e,this.success=r,this.error=n}};M([h(),U("design:type",String)],Ta.prototype,"did",void 0);M([h(),U("design:type",Boolean)],Ta.prototype,"success",void 0);M([h(),U("design:type",String)],Ta.prototype,"error",void 0);Ta=M([V(),U("design:paramtypes",[String,Boolean,String])],Ta);var vi=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},bi=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},At=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)}};vi([h(),bi("design:type",Boolean)],At.prototype,"isInitialized",void 0);vi([h(),bi("design:type",Boolean)],At.prototype,"isUnlocked",void 0);vi([h(),bi("design:type",String)],At.prototype,"did",void 0);vi([h(),bi("design:type",String)],At.prototype,"didDocument",void 0);vi([h(),bi("design:type",String)],At.prototype,"error",void 0);At=vi([V(),bi("design:paramtypes",[Object])],At);var cp=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},ke=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},ut,lt,Su=class{constructor(e,r){ut.set(this,void 0),lt.set(this,void 0),cp(this,ut,e,"f"),cp(this,lt,r,"f")}async otherAgents(){return await ke(this,ut,"f").otherAgents(ke(this,lt,"f"))}async hasTelepresenceAdapter(){return await ke(this,ut,"f").hasTelepresenceAdapter(ke(this,lt,"f"))}async onlineAgents(){return await ke(this,ut,"f").onlineAgents(ke(this,lt,"f"))}async setOnlineStatus(e){return await ke(this,ut,"f").setOnlineStatus(ke(this,lt,"f"),e)}async setOnlineStatusU(e){return await ke(this,ut,"f").setOnlineStatusU(ke(this,lt,"f"),e)}async sendSignal(e,r){return await ke(this,ut,"f").sendSignal(ke(this,lt,"f"),e,r)}async sendSignalU(e,r){return await ke(this,ut,"f").sendSignalU(ke(this,lt,"f"),e,r)}async sendBroadcast(e,r=!1){return await ke(this,ut,"f").sendBroadcast(ke(this,lt,"f"),e,r)}async sendBroadcastU(e,r=!1){return await ke(this,ut,"f").sendBroadcastU(ke(this,lt,"f"),e,r)}async addSignalHandler(e){await ke(this,ut,"f").addSignalHandler(ke(this,lt,"f"),e)}removeSignalHandler(e){ke(this,ut,"f").removeSignalHandler(ke(this,lt,"f"),e)}};ut=new WeakMap,lt=new WeakMap;var Dn=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)},Xe=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)}};Dn([h(),Nn("design:type",String)],Xe.prototype,"source",void 0);Dn([h(),Nn("design:type",String)],Xe.prototype,"target",void 0);Dn([h(),Nn("design:type",String)],Xe.prototype,"predicate",void 0);Dn([h(),Nn("design:type",Date)],Xe.prototype,"fromDate",void 0);Dn([h(),Nn("design:type",Date)],Xe.prototype,"untilDate",void 0);Dn([h(),Nn("design:type",Number)],Xe.prototype,"limit",void 0);Xe=Dn([V(),Be(),Nn("design:paramtypes",[Object])],Xe);var up=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},Ke=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)},ft,cr;function Po(t){return encodeURIComponent(t).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`)}var _t=class{constructor(){ft.set(this,void 0),cr.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 _t;return up(r,cr,e,"f"),r}static from(e){let r=new _t;return up(r,ft,e,"f"),r}toUrl(){if(Ke(this,cr,"f")&&!Ke(this,ft,"f"))return Ke(this,cr,"f");if(!Ke(this,cr,"f")&&(Ke(this,ft,"f")===void 0||Ke(this,ft,"f")===""||Ke(this,ft,"f")===null))throw new Error("Can't turn empty Literal into URL");let e;switch(typeof Ke(this,ft,"f")){case"string":e=`string:${Po(Ke(this,ft,"f"))}`;break;case"number":e=`number:${Po(Ke(this,ft,"f"))}`;break;case"boolean":e=`boolean:${Po(Ke(this,ft,"f"))}`;break;case"object":e=`json:${Po(JSON.stringify(Ke(this,ft,"f")))}`;break}return`literal://${e}`}get(){if(Ke(this,ft,"f"))return Ke(this,ft,"f");if(!Ke(this,cr,"f"))throw new Error("Can't render empty Literal");if(!Ke(this,cr,"f").startsWith("literal://"))throw new Error("Can't render Literal from non-literal URL");let e=Ke(this,cr,"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}`)}};ft=new WeakMap,cr=new WeakMap;function Lr(t){return t.charAt(0).toUpperCase()+t.slice(1)}function Od(t){return`set${Lr(t)}`}function dr(t){return t.endsWith("y")?t.slice(0,-1)+"ies":t+"s"}function zu(t){return t.endsWith("ies")?t.slice(0,-3)+"y":t.endsWith("s")?t.slice(0,-1):t}function ly(t){return`add${Lr(zu(t))}`}function fy(t){let e=t.substring(3),r=dr(e);return r.charAt(0).toLowerCase()+r.slice(1)}function py(t){return`remove${Lr(zu(t))}`}function dy(t){let e=t.substring(6),r=dr(e);return r.charAt(0).toLowerCase()+r.slice(1)}function hy(t){let e=t.substring(13),r=dr(e);return r.charAt(0).toLowerCase()+r.slice(1)}function my(t){return`setCollection${Lr(zu(t))}`}function on(t){if(Array.isArray(t))return`[${t.map(on).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 Yc=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)},rt,nt,we,gs=class{constructor(t,e,r){rt.set(this,void 0),nt.set(this,void 0),we.set(this,void 0),Yc(this,rt,e,"f"),Yc(this,nt,r,"f"),Yc(this,we,t,"f")}get baseExpression(){return z(this,rt,"f")}async init(){let isInstance=await z(this,we,"f").isSubjectInstance(z(this,rt,"f"),z(this,nt,"f"));if(!isInstance)throw`Not a valid subject instance of ${z(this,nt,"f")} for ${z(this,rt,"f")}`;let results=await z(this,we,"f").infer(`subject_class("${z(this,nt,"f")}", C), property(C, Property)`),properties=results.map(t=>t.Property);for(let t of properties){let e=await z(this,we,"f").infer(`subject_class("${z(this,nt,"f")}", C), property_resolve(C, "${t}")`);Object.defineProperty(this,t,{configurable:!0,get:async()=>{let r=await z(this,we,"f").infer(`subject_class("${z(this,nt,"f")}", C), property_getter(C, "${z(this,rt,"f")}", "${t}", Value)`);if(r&&r.length>0){let n=r[0].Value;if(e)try{if(n){let i=await z(this,we,"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 z(this,we,"f").infer(`subject_class("${z(this,nt,"f")}", C), property_setter(C, Property, Setter)`);for(let setter of setters||[])if(setter){let property=setter.Property,actions=eval(setter.Setter),resolveLanguageResults=await z(this,we,"f").infer(`subject_class("${z(this,nt,"f")}", C), property_resolve_language(C, "${property}", Language)`),resolveLanguage;resolveLanguageResults&&resolveLanguageResults.length>0&&(resolveLanguage=resolveLanguageResults[0].Language),this[Od(property)]=async t=>{resolveLanguage&&(t=await z(this,we,"f").createExpression(t,resolveLanguage)),await z(this,we,"f").executeAction(actions,z(this,rt,"f"),[{name:"value",value:t}])}}let results2=await z(this,we,"f").infer(`subject_class("${z(this,nt,"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 z(this,we,"f").infer(`subject_class("${z(this,nt,"f")}", C), collection_getter(C, "${z(this,rt,"f")}", "${t}", Value)`);return e&&e.length>0&&e[0].Value?e[0].Value.filter(n=>n!==""&&n!==""):[]}});let adders=await z(this,we,"f").infer(`subject_class("${z(this,nt,"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[ly(collection)]=async t=>{Array.isArray(t)?await Promise.all(t.map(e=>z(this,we,"f").executeAction(actions,z(this,rt,"f"),[{name:"value",value:e}]))):await z(this,we,"f").executeAction(actions,z(this,rt,"f"),[{name:"value",value:t}])}}let removers=await z(this,we,"f").infer(`subject_class("${z(this,nt,"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[py(collection)]=async t=>{Array.isArray(t)?await Promise.all(t.map(e=>z(this,we,"f").executeAction(actions,z(this,rt,"f"),[{name:"value",value:e}]))):await z(this,we,"f").executeAction(actions,z(this,rt,"f"),[{name:"value",value:t}])}}let collectionSetters=await z(this,we,"f").infer(`subject_class("${z(this,nt,"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[my(collection)]=async t=>{Array.isArray(t)?await z(this,we,"f").executeAction(actions,z(this,rt,"f"),t.map(e=>({name:"value",value:e}))):await z(this,we,"f").executeAction(actions,z(this,rt,"f"),[{name:"value",value:t}])}}}};rt=new WeakMap,nt=new WeakMap,we=new WeakMap;var De=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},D=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)},wu,ii,Dr,sn,dn,Zi,Xi,ai,ea,Jo,ur,ta,Ad,ce,le,cn,un,ln,ra,Eu=class{constructor(e,r,n){wu.add(this),ii.set(this,void 0),Dr.set(this,void 0),sn.set(this,void 0),dn.set(this,void 0),Zi.set(this,void 0),Xi.set(this,void 0),ai.set(this,void 0),ea.set(this,!1),Jo.set(this,void 0),ur.set(this,void 0),ta.set(this,void 0),De(this,ii,e,"f"),De(this,ta,r,"f"),De(this,sn,n,"f"),De(this,dn,new Set,"f"),De(this,ai,null,"f")}async subscribe(){let e=await D(this,sn,"f").subscribeQuery(D(this,ii,"f"),D(this,ta,"f"));De(this,Dr,e.subscriptionId,"f"),De(this,Jo,new Promise((n,i)=>{De(this,ur,setTimeout(()=>{i(new Error("Subscription initialization timed out after 30 seconds. Resubscribing...")),this.subscribe()},3e4),"f"),De(this,Xi,D(this,sn,"f").subscribeToQueryUpdates(D(this,Dr,"f"),a=>{D(this,ur,"f")&&(clearTimeout(D(this,ur,"f")),De(this,ur,void 0,"f")),n(!0),!(a.isInit&&D(this,ai,"f"))&&(De(this,ai,a,"f"),D(this,wu,"m",Ad).call(this,a))}),"f")}),"f");let r=async()=>{if(!D(this,ea,"f")){try{await D(this,sn,"f").keepAliveQuery(D(this,ii,"f"),D(this,Dr,"f"))}catch(n){console.error("Error in keepalive:",n),console.log("Reinitializing subscription for query:",D(this,ta,"f")),await this.subscribe(),console.log("Subscription reinitialized")}D(this,ea,"f")||De(this,Zi,setTimeout(r,3e4),"f")}};De(this,Zi,setTimeout(r,3e4),"f")}get id(){return D(this,Dr,"f")}get initialized(){return D(this,Jo,"f")}get result(){return D(this,ai,"f")}onResult(e){return D(this,dn,"f").add(e),()=>D(this,dn,"f").delete(e)}dispose(){De(this,ea,!0,"f"),clearTimeout(D(this,Zi,"f")),D(this,Xi,"f")&&D(this,Xi,"f").call(this),D(this,dn,"f").clear(),D(this,ur,"f")&&(clearTimeout(D(this,ur,"f")),De(this,ur,void 0,"f")),D(this,Dr,"f")&&D(this,sn,"f").disposeQuerySubscription(D(this,ii,"f"),D(this,Dr,"f")).catch(e=>console.error("Error disposing query subscription:",e))}};ii=new WeakMap,Dr=new WeakMap,sn=new WeakMap,dn=new WeakMap,Zi=new WeakMap,Xi=new WeakMap,ai=new WeakMap,ea=new WeakMap,Jo=new WeakMap,ur=new WeakMap,ta=new WeakMap,wu=new WeakSet,Ad=function t(e){for(let r of D(this,dn,"f"))try{r(e)}catch(n){console.error("Error in query subscription callback:",n)}};var si=class{constructor(t,e){ce.set(this,void 0),le.set(this,void 0),cn.set(this,void 0),un.set(this,void 0),ln.set(this,void 0),ra.set(this,void 0),De(this,cn,[],"f"),De(this,un,[],"f"),De(this,ln,[],"f"),De(this,ra,[],"f"),De(this,ce,t,"f"),De(this,le,e,"f"),this.uuid=D(this,ce,"f").uuid,this.name=D(this,ce,"f").name,this.sharedUrl=D(this,ce,"f").sharedUrl,this.neighbourhood=D(this,ce,"f").neighbourhood,this.state=D(this,ce,"f").state,D(this,le,"f").addPerspectiveLinkAddedListener(D(this,ce,"f").uuid,D(this,cn,"f")),D(this,le,"f").addPerspectiveLinkRemovedListener(D(this,ce,"f").uuid,D(this,un,"f")),D(this,le,"f").addPerspectiveLinkUpdatedListener(D(this,ce,"f").uuid,D(this,ln,"f")),D(this,le,"f").addPerspectiveSyncStateChangeListener(D(this,ce,"f").uuid,D(this,ra,"f"))}async executeAction(t,e,r,n){return await D(this,le,"f").executeCommands(D(this,ce,"f").uuid,JSON.stringify(t),e,JSON.stringify(r),n)}async get(t){return await D(this,le,"f").queryLinks(D(this,ce,"f").uuid,t)}async infer(t){return await D(this,le,"f").queryProlog(D(this,ce,"f").uuid,t)}async add(t,e="shared",r){return await D(this,le,"f").addLink(D(this,ce,"f").uuid,t,e,r)}async addLinks(t,e="shared",r){return await D(this,le,"f").addLinks(D(this,ce,"f").uuid,t,e,r)}async removeLinks(t,e){return await D(this,le,"f").removeLinks(D(this,ce,"f").uuid,t,e)}async linkMutations(t,e="shared"){return await D(this,le,"f").linkMutations(D(this,ce,"f").uuid,t,e)}async addLinkExpression(t,e="shared",r){return await D(this,le,"f").addLinkExpression(D(this,ce,"f").uuid,t,e,r)}async update(t,e,r){return await D(this,le,"f").updateLink(D(this,ce,"f").uuid,t,e,r)}async remove(t,e){return await D(this,le,"f").removeLink(D(this,ce,"f").uuid,t,e)}async createBatch(){return await D(this,le,"f").createBatch(D(this,ce,"f").uuid)}async commitBatch(t){return await D(this,le,"f").commitBatch(D(this,ce,"f").uuid,t)}async getExpression(t){return await D(this,le,"f").getExpression(t)}async createExpression(t,e){return await D(this,le,"f").createExpression(t,e)}async addListener(t,e){t==="link-added"?D(this,cn,"f").push(e):t==="link-removed"?D(this,un,"f").push(e):t==="link-updated"&&D(this,ln,"f").push(e)}async addSyncStateChangeListener(t){D(this,ra,"f").push(t)}async removeListener(t,e){if(t==="link-added"){let r=D(this,cn,"f").indexOf(e);D(this,cn,"f").splice(r,1)}else if(t==="link-removed"){let r=D(this,un,"f").indexOf(e);D(this,un,"f").splice(r,1)}else if(t==="link-updated"){let r=D(this,ln,"f").indexOf(e);D(this,ln,"f").splice(r,1)}}async snapshot(){return D(this,le,"f").snapshotByUUID(D(this,ce,"f").uuid)}async loadSnapshot(t){let e=JSON.parse(JSON.stringify(t));delete e.__typename,e.links.forEach(r=>{delete r.data.__typename});for(let r of e.links)await this.addLinkExpression(r)}async getSingleTarget(t){delete t.target;let e=await this.get(t);return e.length?e[0].data.target:null}async setSingleTarget(t,e="shared"){let r=new Xe({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(){let t=["ad4m://has_subject_class","ad4m://has_flow","ad4m://has_custom_sdna"],e=[];for(let r of t){let n=await this.get(new Xe({source:"ad4m://self",predicate:r}));for(let i of n){let a=i.data.target,o=await this.get(new Xe({source:a,predicate:"ad4m://sdna"}));for(let s of o){let u=_t.fromUrl(s.data.target).get();typeof u=="string"&&e.push(u)}}}return e}async getSdnaForClass(t){let e=_t.from(t);if((await this.get(new Xe({source:"ad4m://self",target:e.toUrl(),predicate:"ad4m://has_subject_class"}))).length===0)return null;let n=await this.get(new Xe({source:e.toUrl(),predicate:"ad4m://sdna"}));if(n.length===0)return null;let i=_t.fromUrl(n[0].data.target).get();return typeof i=="string"?i:null}async addSdna(t,e,r){return D(this,le,"f").addSdna(D(this,ce,"f").uuid,t,e,r)}async subjectClasses(){try{return(await this.infer("subject_class(X, _)")).map(t=>t.X)}catch{return[]}}async stringOrTemplateObjectToSubjectClassName(t){if(typeof t=="string")return t;{let e=await this.subjectClassesByTemplate(t);return e[0]?e[0]:t.className}}async createSubject(t,e,r,n){let i;if(typeof t=="string")i=t,await D(this,le,"f").createSubject(D(this,ce,"f").uuid,JSON.stringify({className:i,initialValues:r}),e,r?JSON.stringify(r):void 0,n);else{let a=this.buildQueryFromTemplate(t);await D(this,le,"f").createSubject(D(this,ce,"f").uuid,JSON.stringify({query:a,initialValues:r}),e,r?JSON.stringify(r):void 0,n)}return n?e:this.getSubjectProxy(e,t)}async getSubjectData(t,e){if(typeof t=="string")return JSON.parse(await D(this,le,"f").getSubjectData(D(this,ce,"f").uuid,JSON.stringify({className:t}),e));let r=this.buildQueryFromTemplate(t);return JSON.parse(await D(this,le,"f").getSubjectData(D(this,ce,"f").uuid,JSON.stringify({query:r}),e))}async removeSubject(subjectClass,exprAddr,batchId){let className=await this.stringOrTemplateObjectToSubjectClassName(subjectClass),result=await this.infer(`subject_class("${className}", C), destructor(C, Actions)`);if(!result.length)throw"No destructor found for given subject class: "+className;let actions=result.map(x=>eval(x.Actions));await this.executeAction(actions[0],exprAddr,void 0,batchId)}async isSubjectInstance(t,e){let r=await this.stringOrTemplateObjectToSubjectClassName(e),n=!1,i=5,a=0;for(;a<i&&!n;)n=await this.infer(`subject_class("${r}", C), instance(C, "${t}")`),a++;return n}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.stringOrTemplateObjectToSubjectClassName(e),n=new gs(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;return function(r){let n=[],i=[];Object.getPrototypeOf(r).__properties?Object.keys(Object.getPrototypeOf(r).__properties).forEach(l=>n.push(l)):n.push(...Object.keys(r).filter(l=>!Array.isArray(r[l]))),Object.getPrototypeOf(r).__collections?Object.keys(Object.getPrototypeOf(r).__collections).filter(l=>l!=="isSubjectInstance").forEach(l=>{i.includes(l)||i.push(l)}):i.push(...Object.keys(r).filter(l=>Array.isArray(r[l])).filter(l=>l!=="isSubjectInstance"));let a=Object.getOwnPropertyNames(r).filter(l=>typeof r[l]=="function"&&l.startsWith("set")&&!l.startsWith("setCollection"));a=a.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(r)).filter(l=>{let d=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(r),l);return d&&typeof d.value=="function"&&l.startsWith("set")&&!l.startsWith("setCollection")}));let o=Object.getOwnPropertyNames(r).filter(l=>Object.prototype.hasOwnProperty.call(r,l)&&typeof r[l]=="function"&&l.startsWith("add"));o=o.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(r)).filter(l=>{let d=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(r),l);return d&&typeof d.value=="function"&&l.startsWith("add")}));let s=Object.getOwnPropertyNames(r).filter(l=>Object.prototype.hasOwnProperty.call(r,l)&&typeof r[l]=="function"&&l.startsWith("remove"));s=s.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(r)).filter(l=>{let d=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(r),l);return d&&typeof d.value=="function"&&l.startsWith("remove")}));let u=Object.getOwnPropertyNames(r).filter(l=>Object.prototype.hasOwnProperty.call(r,l)&&typeof r[l]=="function"&&l.startsWith("setCollection"));u=u.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(r)).filter(l=>{let d=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(r),l);return d&&typeof d.value=="function"&&l.startsWith("setCollection")}));let c="subject_class(Class, C)";for(let l of n)c+=`, property(C, "${l}")`;for(let l of i)c+=`, collection(C, "${l}")`;for(let l of a){let d=l.substring(3);d=d.charAt(0).toLowerCase()+d.slice(1),c+=`, property_setter(C, "${d}", _)`}for(let l of o)c+=`, collection_adder(C, "${fy(l)}", _)`;for(let l of s)c+=`, collection_remover(C, "${dy(l)}", _)`;for(let l of u)c+=`, collection_setter(C, "${hy(l)}", _)`;c+=".",e=c}(t),e}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 D(this,le,"f").getNeighbourhoodProxy(D(this,ce,"f").uuid)}get ai(){return D(this,le,"f").aiClient}async subscribeInfer(t){let e=new Eu(this.uuid,t,D(this,le,"f"));return await e.subscribe(),await e.initialized,e}};ce=new WeakMap,le=new WeakMap,cn=new WeakMap,un=new WeakMap,ln=new WeakMap,ra=new WeakMap;var kr=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},G=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,na,ia,aa,Yo,oa,Zo,Xo,tt=`
62
62
  author
63
63
  timestamp
64
64
  status
@@ -84,62 +84,62 @@ neighbourhood {
84
84
  }
85
85
  author
86
86
  }
87
- `,ps=class{constructor(e,r=!0){X.set(this,void 0),ta.set(this,void 0),ra.set(this,void 0),na.set(this,void 0),zo.set(this,void 0),ia.set(this,void 0),Go.set(this,void 0),Wo.set(this,void 0),kr(this,X,e,"f"),kr(this,ta,[],"f"),kr(this,ra,[],"f"),kr(this,na,[],"f"),kr(this,zo,[],"f"),r&&(this.subscribePerspectiveAdded(),this.subscribePerspectiveUpdated(),this.subscribePerspectiveRemoved())}setExpressionClient(e){kr(this,ia,e,"f")}setNeighbourhoodClient(e){kr(this,Go,e,"f")}setAIClient(e){kr(this,Wo,e,"f")}get aiClient(){return z(this,Wo,"f")}async all(){let{perspectives:e}=k(await z(this,X,"f").query({query:I`query perspectives {
87
+ `,ys=class{constructor(e,r=!0){ee.set(this,void 0),na.set(this,void 0),ia.set(this,void 0),aa.set(this,void 0),Yo.set(this,void 0),oa.set(this,void 0),Zo.set(this,void 0),Xo.set(this,void 0),kr(this,ee,e,"f"),kr(this,na,[],"f"),kr(this,ia,[],"f"),kr(this,aa,[],"f"),kr(this,Yo,[],"f"),r&&(this.subscribePerspectiveAdded(),this.subscribePerspectiveUpdated(),this.subscribePerspectiveRemoved())}setExpressionClient(e){kr(this,oa,e,"f")}setNeighbourhoodClient(e){kr(this,Zo,e,"f")}setAIClient(e){kr(this,Xo,e,"f")}get aiClient(){return G(this,Xo,"f")}async all(){let{perspectives:e}=k(await G(this,ee,"f").query({query:I`query perspectives {
88
88
  perspectives {
89
89
  ${Zn}
90
90
  }
91
- }`}));return e.map(r=>new si(r,this))}async byUUID(e){let{perspective:r}=k(await z(this,X,"f").query({query:I`query perspective($uuid: String!) {
91
+ }`}));return e.map(r=>new si(r,this))}async byUUID(e){let{perspective:r}=k(await G(this,ee,"f").query({query:I`query perspective($uuid: String!) {
92
92
  perspective(uuid: $uuid) {
93
93
  ${Zn}
94
94
  }
95
- }`,variables:{uuid:e}}));return r?new si(r,this):null}async snapshotByUUID(e){let{perspectiveSnapshot:r}=k(await z(this,X,"f").query({query:I`query perspectiveSnapshot($uuid: String!) {
95
+ }`,variables:{uuid:e}}));return r?new si(r,this):null}async snapshotByUUID(e){let{perspectiveSnapshot:r}=k(await G(this,ee,"f").query({query:I`query perspectiveSnapshot($uuid: String!) {
96
96
  perspectiveSnapshot(uuid: $uuid) {
97
97
  links { ${tt} }
98
98
  }
99
- }`,variables:{uuid:e}}));return r}async publishSnapshotByUUID(e){let{perspectivePublishSnapshot:r}=k(await z(this,X,"f").mutate({mutation:I`mutation perspectivePublishSnapshot($uuid: String!) {
99
+ }`,variables:{uuid:e}}));return r}async publishSnapshotByUUID(e){let{perspectivePublishSnapshot:r}=k(await G(this,ee,"f").mutate({mutation:I`mutation perspectivePublishSnapshot($uuid: String!) {
100
100
  perspectivePublishSnapshot(uuid: $uuid)
101
- }`,variables:{uuid:e}}));return r}async queryLinks(e,r){let{perspectiveQueryLinks:n}=k(await z(this,X,"f").query({query:I`query perspectiveQueryLinks($uuid: String!, $query: LinkQuery!) {
101
+ }`,variables:{uuid:e}}));return r}async queryLinks(e,r){let{perspectiveQueryLinks:n}=k(await G(this,ee,"f").query({query:I`query perspectiveQueryLinks($uuid: String!, $query: LinkQuery!) {
102
102
  perspectiveQueryLinks(query: $query, uuid: $uuid) {
103
103
  ${tt}
104
104
  }
105
- }`,variables:{uuid:e,query:r}}));return n}async queryProlog(e,r){let{perspectiveQueryProlog:n}=k(await z(this,X,"f").query({query:I`query perspectiveQueryProlog($uuid: String!, $query: String!) {
105
+ }`,variables:{uuid:e,query:r}}));return n}async queryProlog(e,r){let{perspectiveQueryProlog:n}=k(await G(this,ee,"f").query({query:I`query perspectiveQueryProlog($uuid: String!, $query: String!) {
106
106
  perspectiveQueryProlog(uuid: $uuid, query: $query)
107
- }`,variables:{uuid:e,query:r}}));return JSON.parse(n)}async subscribeQuery(e,r){let{perspectiveSubscribeQuery:n}=k(await z(this,X,"f").mutate({mutation:I`mutation perspectiveSubscribeQuery($uuid: String!, $query: String!) {
107
+ }`,variables:{uuid:e,query:r}}));return JSON.parse(n)}async subscribeQuery(e,r){let{perspectiveSubscribeQuery:n}=k(await G(this,ee,"f").mutate({mutation:I`mutation perspectiveSubscribeQuery($uuid: String!, $query: String!) {
108
108
  perspectiveSubscribeQuery(uuid: $uuid, query: $query) {
109
109
  subscriptionId
110
110
  result
111
111
  }
112
- }`,variables:{uuid:e,query:r}})),{subscriptionId:i,result:a}=n,o=a,s=!1;o.startsWith("#init#")&&(o=o.substring(6),s=!0);try{o=JSON.parse(o)}catch(u){console.error("Error parsing perspectiveSubscribeQuery result:",u)}return{subscriptionId:i,result:o,isInit:s}}subscribeToQueryUpdates(e,r){let n=z(this,X,"f").subscribe({query:I`
112
+ }`,variables:{uuid:e,query:r}})),{subscriptionId:i,result:a}=n,o=a,s=!1;o.startsWith("#init#")&&(o=o.substring(6),s=!0);try{o=JSON.parse(o)}catch(u){console.error("Error parsing perspectiveSubscribeQuery result:",u)}return{subscriptionId:i,result:o,isInit:s}}subscribeToQueryUpdates(e,r){let n=G(this,ee,"f").subscribe({query:I`
113
113
  subscription perspectiveQuerySubscription($subscriptionId: String!) {
114
114
  perspectiveQuerySubscription(subscriptionId: $subscriptionId)
115
115
  }
116
- `,variables:{subscriptionId:e}}).subscribe({next:i=>{if(i.data&&i.data.perspectiveQuerySubscription){let a=i.data.perspectiveQuerySubscription,o=!1;a.startsWith("#init#")&&(a=a.substring(6),o=!0);try{a=JSON.parse(a),o&&typeof a=="object"&&(a.isInit=!0)}catch(s){console.error("Error parsing perspectiveQuerySubscription:",s)}r(a)}},error:i=>console.error("Error in query subscription:",i)});return()=>n.unsubscribe()}async keepAliveQuery(e,r){let{perspectiveKeepAliveQuery:n}=k(await z(this,X,"f").mutate({mutation:I`mutation perspectiveKeepAliveQuery($uuid: String!, $subscriptionId: String!) {
116
+ `,variables:{subscriptionId:e}}).subscribe({next:i=>{if(i.data&&i.data.perspectiveQuerySubscription){let a=i.data.perspectiveQuerySubscription,o=!1;a.startsWith("#init#")&&(a=a.substring(6),o=!0);try{a=JSON.parse(a),o&&typeof a=="object"&&(a.isInit=!0)}catch(s){console.error("Error parsing perspectiveQuerySubscription:",s)}r(a)}},error:i=>console.error("Error in query subscription:",i)});return()=>n.unsubscribe()}async keepAliveQuery(e,r){let{perspectiveKeepAliveQuery:n}=k(await G(this,ee,"f").mutate({mutation:I`mutation perspectiveKeepAliveQuery($uuid: String!, $subscriptionId: String!) {
117
117
  perspectiveKeepAliveQuery(uuid: $uuid, subscriptionId: $subscriptionId)
118
- }`,variables:{uuid:e,subscriptionId:r}}));return n}async disposeQuerySubscription(e,r){let{perspectiveDisposeQuerySubscription:n}=k(await z(this,X,"f").mutate({mutation:I`mutation perspectiveDisposeQuerySubscription($uuid: String!, $subscriptionId: String!) {
118
+ }`,variables:{uuid:e,subscriptionId:r}}));return n}async disposeQuerySubscription(e,r){let{perspectiveDisposeQuerySubscription:n}=k(await G(this,ee,"f").mutate({mutation:I`mutation perspectiveDisposeQuerySubscription($uuid: String!, $subscriptionId: String!) {
119
119
  perspectiveDisposeQuerySubscription(uuid: $uuid, subscriptionId: $subscriptionId)
120
- }`,variables:{uuid:e,subscriptionId:r}}));return n}async add(e){let{perspectiveAdd:r}=k(await z(this,X,"f").mutate({mutation:I`mutation perspectiveAdd($name: String!) {
120
+ }`,variables:{uuid:e,subscriptionId:r}}));return n}async add(e){let{perspectiveAdd:r}=k(await G(this,ee,"f").mutate({mutation:I`mutation perspectiveAdd($name: String!) {
121
121
  perspectiveAdd(name: $name) {
122
122
  ${Zn}
123
123
  }
124
- }`,variables:{name:e}}));return new si(r,this)}async update(e,r){let{perspectiveUpdate:n}=k(await z(this,X,"f").mutate({mutation:I`mutation perspectiveUpdate($uuid: String!, $name: String!) {
124
+ }`,variables:{name:e}}));return new si(r,this)}async update(e,r){let{perspectiveUpdate:n}=k(await G(this,ee,"f").mutate({mutation:I`mutation perspectiveUpdate($uuid: String!, $name: String!) {
125
125
  perspectiveUpdate(uuid: $uuid, name: $name) {
126
126
  ${Zn}
127
127
  }
128
- }`,variables:{uuid:e,name:r}}));return new si(n,this)}async remove(e){return k(await z(this,X,"f").mutate({mutation:I`mutation perspectiveRemove($uuid: String!) {
128
+ }`,variables:{uuid:e,name:r}}));return new si(n,this)}async remove(e){return k(await G(this,ee,"f").mutate({mutation:I`mutation perspectiveRemove($uuid: String!) {
129
129
  perspectiveRemove(uuid: $uuid)
130
- }`,variables:{uuid:e}}))}async addLink(e,r,n="shared",i){let{perspectiveAddLink:a}=k(await z(this,X,"f").mutate({mutation:I`mutation perspectiveAddLink($uuid: String!, $link: LinkInput!, $status: String!, $batchId: String) {
130
+ }`,variables:{uuid:e}}))}async addLink(e,r,n="shared",i){let{perspectiveAddLink:a}=k(await G(this,ee,"f").mutate({mutation:I`mutation perspectiveAddLink($uuid: String!, $link: LinkInput!, $status: String!, $batchId: String) {
131
131
  perspectiveAddLink(uuid: $uuid, link: $link, status: $status, batchId: $batchId) {
132
132
  ${tt}
133
133
  }
134
- }`,variables:{uuid:e,link:r,status:n,batchId:i}}));return a}async addLinks(e,r,n="shared",i){let{perspectiveAddLinks:a}=k(await z(this,X,"f").mutate({mutation:I`mutation perspectiveAddLinks($uuid: String!, $links: [LinkInput!]!, $status: String!, $batchId: String) {
134
+ }`,variables:{uuid:e,link:r,status:n,batchId:i}}));return a}async addLinks(e,r,n="shared",i){let{perspectiveAddLinks:a}=k(await G(this,ee,"f").mutate({mutation:I`mutation perspectiveAddLinks($uuid: String!, $links: [LinkInput!]!, $status: String!, $batchId: String) {
135
135
  perspectiveAddLinks(uuid: $uuid, links: $links, status: $status, batchId: $batchId) {
136
136
  ${tt}
137
137
  }
138
- }`,variables:{uuid:e,links:r,status:n,batchId:i}}));return a}async removeLinks(e,r,n){let{perspectiveRemoveLinks:i}=k(await z(this,X,"f").mutate({mutation:I`mutation perspectiveRemoveLinks($uuid: String!, $links: [LinkExpressionInput!]!, $batchId: String) {
138
+ }`,variables:{uuid:e,links:r,status:n,batchId:i}}));return a}async removeLinks(e,r,n){let{perspectiveRemoveLinks:i}=k(await G(this,ee,"f").mutate({mutation:I`mutation perspectiveRemoveLinks($uuid: String!, $links: [LinkExpressionInput!]!, $batchId: String) {
139
139
  perspectiveRemoveLinks(uuid: $uuid, links: $links, batchId: $batchId) {
140
140
  ${tt}
141
141
  }
142
- }`,variables:{uuid:e,links:r,batchId:n}}));return i}async linkMutations(e,r,n){let{perspectiveLinkMutations:i}=k(await z(this,X,"f").mutate({mutation:I`mutation perspectiveLinkMutations($uuid: String!, $mutations: LinkMutations!, $status: String){
142
+ }`,variables:{uuid:e,links:r,batchId:n}}));return i}async linkMutations(e,r,n){let{perspectiveLinkMutations:i}=k(await G(this,ee,"f").mutate({mutation:I`mutation perspectiveLinkMutations($uuid: String!, $mutations: LinkMutations!, $status: String){
143
143
  perspectiveLinkMutations(mutations: $mutations, uuid: $uuid, status: $status) {
144
144
  additions {
145
145
  ${tt}
@@ -148,43 +148,43 @@ neighbourhood {
148
148
  ${tt}
149
149
  }
150
150
  }
151
- }`,variables:{uuid:e,mutations:r,status:n}}));return i}async addLinkExpression(e,r,n="shared",i){let{perspectiveAddLinkExpression:a}=k(await z(this,X,"f").mutate({mutation:I`mutation perspectiveAddLinkExpression($uuid: String!, $link: LinkExpressionInput!, $status: String!, $batchId: String) {
151
+ }`,variables:{uuid:e,mutations:r,status:n}}));return i}async addLinkExpression(e,r,n="shared",i){let{perspectiveAddLinkExpression:a}=k(await G(this,ee,"f").mutate({mutation:I`mutation perspectiveAddLinkExpression($uuid: String!, $link: LinkExpressionInput!, $status: String!, $batchId: String) {
152
152
  perspectiveAddLinkExpression(uuid: $uuid, link: $link, status: $status, batchId: $batchId) {
153
153
  ${tt}
154
154
  }
155
- }`,variables:{uuid:e,link:r,status:n,batchId:i}}));return a}async updateLink(e,r,n,i){let{perspectiveUpdateLink:a}=k(await z(this,X,"f").mutate({mutation:I`mutation perspectiveUpdateLink($uuid: String!, $oldLink: LinkExpressionInput!, $newLink: LinkInput!, $batchId: String) {
155
+ }`,variables:{uuid:e,link:r,status:n,batchId:i}}));return a}async updateLink(e,r,n,i){let{perspectiveUpdateLink:a}=k(await G(this,ee,"f").mutate({mutation:I`mutation perspectiveUpdateLink($uuid: String!, $oldLink: LinkExpressionInput!, $newLink: LinkInput!, $batchId: String) {
156
156
  perspectiveUpdateLink(uuid: $uuid, oldLink: $oldLink, newLink: $newLink, batchId: $batchId) {
157
157
  ${tt}
158
158
  }
159
- }`,variables:{uuid:e,oldLink:r,newLink:n,batchId:i}}));return a}async removeLink(e,r,n){delete r.__typename,delete r.data.__typename,delete r.proof.__typename,delete r.status;let{perspectiveRemoveLink:i}=k(await z(this,X,"f").mutate({mutation:I`mutation perspectiveRemoveLink($link: LinkExpressionInput!, $uuid: String!, $batchId: String) {
159
+ }`,variables:{uuid:e,oldLink:r,newLink:n,batchId:i}}));return a}async removeLink(e,r,n){delete r.__typename,delete r.data.__typename,delete r.proof.__typename,delete r.status;let{perspectiveRemoveLink:i}=k(await G(this,ee,"f").mutate({mutation:I`mutation perspectiveRemoveLink($link: LinkExpressionInput!, $uuid: String!, $batchId: String) {
160
160
  perspectiveRemoveLink(link: $link, uuid: $uuid, batchId: $batchId)
161
- }`,variables:{uuid:e,link:r,batchId:n}}));return i}async addSdna(e,r,n,i){return k(await z(this,X,"f").mutate({mutation:I`mutation perspectiveAddSdna($uuid: String!, $name: String!, $sdnaCode: String!, $sdnaType: String!) {
161
+ }`,variables:{uuid:e,link:r,batchId:n}}));return i}async addSdna(e,r,n,i){return k(await G(this,ee,"f").mutate({mutation:I`mutation perspectiveAddSdna($uuid: String!, $name: String!, $sdnaCode: String!, $sdnaType: String!) {
162
162
  perspectiveAddSdna(uuid: $uuid, name: $name, sdnaCode: $sdnaCode, sdnaType: $sdnaType)
163
- }`,variables:{uuid:e,name:r,sdnaCode:n,sdnaType:i}})).perspectiveAddSdna}async executeCommands(e,r,n,i,a){return k(await z(this,X,"f").mutate({mutation:I`mutation perspectiveExecuteCommands($uuid: String!, $commands: String!, $expression: String!, $parameters: String, $batchId: String) {
163
+ }`,variables:{uuid:e,name:r,sdnaCode:n,sdnaType:i}})).perspectiveAddSdna}async executeCommands(e,r,n,i,a){return k(await G(this,ee,"f").mutate({mutation:I`mutation perspectiveExecuteCommands($uuid: String!, $commands: String!, $expression: String!, $parameters: String, $batchId: String) {
164
164
  perspectiveExecuteCommands(uuid: $uuid, commands: $commands, expression: $expression, parameters: $parameters, batchId: $batchId)
165
- }`,variables:{uuid:e,commands:r,expression:n,parameters:i,batchId:a}})).perspectiveExecuteCommands}async createSubject(e,r,n,i,a){return k(await z(this,X,"f").mutate({mutation:I`mutation perspectiveCreateSubject($uuid: String!, $subjectClass: String!, $expressionAddress: String!, $initialValues: String, $batchId: String) {
165
+ }`,variables:{uuid:e,commands:r,expression:n,parameters:i,batchId:a}})).perspectiveExecuteCommands}async createSubject(e,r,n,i,a){return k(await G(this,ee,"f").mutate({mutation:I`mutation perspectiveCreateSubject($uuid: String!, $subjectClass: String!, $expressionAddress: String!, $initialValues: String, $batchId: String) {
166
166
  perspectiveCreateSubject(uuid: $uuid, subjectClass: $subjectClass, expressionAddress: $expressionAddress, initialValues: $initialValues, batchId: $batchId)
167
- }`,variables:{uuid:e,subjectClass:r,expressionAddress:n,initialValues:i,batchId:a}})).perspectiveCreateSubject}async getSubjectData(e,r,n){return k(await z(this,X,"f").mutate({mutation:I`mutation perspectiveGetSubjectData($uuid: String!, $subjectClass: String!, $expressionAddress: String!) {
167
+ }`,variables:{uuid:e,subjectClass:r,expressionAddress:n,initialValues:i,batchId:a}})).perspectiveCreateSubject}async getSubjectData(e,r,n){return k(await G(this,ee,"f").mutate({mutation:I`mutation perspectiveGetSubjectData($uuid: String!, $subjectClass: String!, $expressionAddress: String!) {
168
168
  perspectiveGetSubjectData(uuid: $uuid, subjectClass: $subjectClass, expressionAddress: $expressionAddress)
169
- }`,variables:{uuid:e,subjectClass:r,expressionAddress:n}})).perspectiveGetSubjectData}async getExpression(e){return await z(this,ia,"f").get(e)}async createExpression(e,r){return await z(this,ia,"f").create(e,r)}addPerspectiveAddedListener(e){z(this,ta,"f").push(e)}subscribePerspectiveAdded(){z(this,X,"f").subscribe({query:I` subscription {
169
+ }`,variables:{uuid:e,subjectClass:r,expressionAddress:n}})).perspectiveGetSubjectData}async getExpression(e){return await G(this,oa,"f").get(e)}async createExpression(e,r){return await G(this,oa,"f").create(e,r)}addPerspectiveAddedListener(e){G(this,na,"f").push(e)}subscribePerspectiveAdded(){G(this,ee,"f").subscribe({query:I` subscription {
170
170
  perspectiveAdded { ${Zn} }
171
171
  }
172
- `}).subscribe({next:e=>{z(this,ta,"f").forEach(r=>{r(e.data.perspectiveAdded)})},error:e=>console.error(e)})}addPerspectiveUpdatedListener(e){z(this,ra,"f").push(e)}subscribePerspectiveUpdated(){z(this,X,"f").subscribe({query:I` subscription {
172
+ `}).subscribe({next:e=>{G(this,na,"f").forEach(r=>{r(e.data.perspectiveAdded)})},error:e=>console.error(e)})}addPerspectiveUpdatedListener(e){G(this,ia,"f").push(e)}subscribePerspectiveUpdated(){G(this,ee,"f").subscribe({query:I` subscription {
173
173
  perspectiveUpdated { ${Zn} }
174
174
  }
175
- `}).subscribe({next:e=>{z(this,ra,"f").forEach(r=>{r(e.data.perspectiveUpdated)})},error:e=>console.error(e)})}addPerspectiveSyncedListener(e){z(this,zo,"f").push(e)}async addPerspectiveSyncStateChangeListener(e,r){z(this,X,"f").subscribe({query:I` subscription {
175
+ `}).subscribe({next:e=>{G(this,ia,"f").forEach(r=>{r(e.data.perspectiveUpdated)})},error:e=>console.error(e)})}addPerspectiveSyncedListener(e){G(this,Yo,"f").push(e)}async addPerspectiveSyncStateChangeListener(e,r){G(this,ee,"f").subscribe({query:I` subscription {
176
176
  perspectiveSyncStateChange(uuid: "${e}")
177
177
  }
178
- `}).subscribe({next:n=>{r.forEach(i=>{i(n.data.perspectiveSyncStateChange)})},error:n=>console.error(n)}),await new Promise(n=>setTimeout(n,500))}addPerspectiveRemovedListener(e){z(this,na,"f").push(e)}subscribePerspectiveRemoved(){z(this,X,"f").subscribe({query:I` subscription {
178
+ `}).subscribe({next:n=>{r.forEach(i=>{i(n.data.perspectiveSyncStateChange)})},error:n=>console.error(n)}),await new Promise(n=>setTimeout(n,500))}addPerspectiveRemovedListener(e){G(this,aa,"f").push(e)}subscribePerspectiveRemoved(){G(this,ee,"f").subscribe({query:I` subscription {
179
179
  perspectiveRemoved
180
180
  }
181
- `}).subscribe({next:e=>{z(this,na,"f").forEach(r=>{r(e.data.perspectiveRemoved)})},error:e=>console.error(e)})}async addPerspectiveLinkAddedListener(e,r){z(this,X,"f").subscribe({query:I` subscription {
181
+ `}).subscribe({next:e=>{G(this,aa,"f").forEach(r=>{r(e.data.perspectiveRemoved)})},error:e=>console.error(e)})}async addPerspectiveLinkAddedListener(e,r){G(this,ee,"f").subscribe({query:I` subscription {
182
182
  perspectiveLinkAdded(uuid: "${e}") { ${tt} }
183
183
  }
184
- `}).subscribe({next:n=>{r.forEach(i=>{i(n.data.perspectiveLinkAdded)})},error:n=>console.error(n)}),await new Promise(n=>setTimeout(n,500))}async addPerspectiveLinkRemovedListener(e,r){z(this,X,"f").subscribe({query:I` subscription {
184
+ `}).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){G(this,ee,"f").subscribe({query:I` subscription {
185
185
  perspectiveLinkRemoved(uuid: "${e}") { ${tt} }
186
186
  }
187
- `}).subscribe({next:n=>{r.forEach(i=>{n.data.perspectiveLinkRemoved.status||delete n.data.perspectiveLinkRemoved.status,i(n.data.perspectiveLinkRemoved)})},error:n=>console.error(n)}),await new Promise(n=>setTimeout(n,500))}async addPerspectiveLinkUpdatedListener(e,r){z(this,X,"f").subscribe({query:I` subscription {
187
+ `}).subscribe({next:n=>{r.forEach(i=>{n.data.perspectiveLinkRemoved.status||delete n.data.perspectiveLinkRemoved.status,i(n.data.perspectiveLinkRemoved)})},error:n=>console.error(n)}),await new Promise(n=>setTimeout(n,500))}async addPerspectiveLinkUpdatedListener(e,r){G(this,ee,"f").subscribe({query:I` subscription {
188
188
  perspectiveLinkUpdated(uuid: "${e}") {
189
189
  oldLink {
190
190
  ${tt}
@@ -194,9 +194,9 @@ neighbourhood {
194
194
  }
195
195
  }
196
196
  }
197
- `}).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 gu(z(this,Go,"f"),e)}async createBatch(e){let{perspectiveCreateBatch:r}=k(await z(this,X,"f").mutate({mutation:I`mutation perspectiveCreateBatch($uuid: String!) {
197
+ `}).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 Su(G(this,Zo,"f"),e)}async createBatch(e){let{perspectiveCreateBatch:r}=k(await G(this,ee,"f").mutate({mutation:I`mutation perspectiveCreateBatch($uuid: String!) {
198
198
  perspectiveCreateBatch(uuid: $uuid)
199
- }`,variables:{uuid:e}}));return r}async commitBatch(e,r){let{perspectiveCommitBatch:n}=k(await z(this,X,"f").mutate({mutation:I`mutation perspectiveCommitBatch($uuid: String!, $batchId: String!) {
199
+ }`,variables:{uuid:e}}));return r}async commitBatch(e,r){let{perspectiveCommitBatch:n}=k(await G(this,ee,"f").mutate({mutation:I`mutation perspectiveCommitBatch($uuid: String!, $batchId: String!) {
200
200
  perspectiveCommitBatch(uuid: $uuid, batchId: $batchId) {
201
201
  additions {
202
202
  ${tt}
@@ -205,7 +205,7 @@ neighbourhood {
205
205
  ${tt}
206
206
  }
207
207
  }
208
- }`,variables:{uuid:e,batchId:r}}));return n}};X=new WeakMap,ta=new WeakMap,ra=new WeakMap,na=new WeakMap,zo=new WeakMap,ia=new WeakMap,Go=new WeakMap,Wo=new WeakMap;var ko=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},ae=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},fe,aa,oa,sa,Gi=`
208
+ }`,variables:{uuid:e,batchId:r}}));return n}};ee=new WeakMap,na=new WeakMap,ia=new WeakMap,aa=new WeakMap,Yo=new WeakMap,oa=new WeakMap,Zo=new WeakMap,Xo=new WeakMap;var Co=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},ae=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},ue,sa,ca,ua,Ki=`
209
209
  did
210
210
  directMessageLanguage
211
211
  perspective {
@@ -219,7 +219,7 @@ neighbourhood {
219
219
  }
220
220
  }
221
221
  }
222
- `,Oo=`
222
+ `,Ro=`
223
223
  requestId
224
224
  revoked
225
225
  auth {
@@ -241,27 +241,27 @@ neighbourhood {
241
241
  did
242
242
  didDocument
243
243
  error
244
- `,Ao=`
244
+ `,Lo=`
245
245
  did
246
246
  didSigningKeyId
247
247
  deviceKeyType
248
248
  deviceKey
249
249
  deviceKeySignedByDid
250
250
  didSignedByDeviceKey
251
- `,hg=`
251
+ `,gy=`
252
252
  signature
253
253
  publicKey
254
- `,Ea=class{constructor(e,r=!0){fe.set(this,void 0),aa.set(this,void 0),oa.set(this,void 0),sa.set(this,void 0),ko(this,fe,e,"f"),ko(this,oa,[],"f"),ko(this,sa,[],"f"),ko(this,aa,[],"f"),r&&(this.subscribeAgentUpdated(),this.subscribeAgentStatusChanged(),this.subscribeAppsChanged())}async me(){let{agent:e}=k(await ae(this,fe,"f").query({query:I`query agent { agent { ${Gi} } }`})),r=new Rr(e.did,e.perspective);return r.directMessageLanguage=e.directMessageLanguage,r}async status(){let{agentStatus:e}=k(await ae(this,fe,"f").query({query:I`query agentStatus {
254
+ `,ka=class{constructor(e,r=!0){ue.set(this,void 0),sa.set(this,void 0),ca.set(this,void 0),ua.set(this,void 0),Co(this,ue,e,"f"),Co(this,ca,[],"f"),Co(this,ua,[],"f"),Co(this,sa,[],"f"),r&&(this.subscribeAgentUpdated(),this.subscribeAgentStatusChanged(),this.subscribeAppsChanged())}async me(){let{agent:e}=k(await ae(this,ue,"f").query({query:I`query agent { agent { ${Ki} } }`})),r=new Rr(e.did,e.perspective);return r.directMessageLanguage=e.directMessageLanguage,r}async status(){let{agentStatus:e}=k(await ae(this,ue,"f").query({query:I`query agentStatus {
255
255
  agentStatus {
256
256
  ${Xn}
257
257
  }
258
- }`}));return new Ot(e)}async generate(e){let{agentGenerate:r}=k(await ae(this,fe,"f").mutate({mutation:I`mutation agentGenerate(
258
+ }`}));return new At(e)}async generate(e){let{agentGenerate:r}=k(await ae(this,ue,"f").mutate({mutation:I`mutation agentGenerate(
259
259
  $passphrase: String!
260
260
  ) {
261
261
  agentGenerate(passphrase: $passphrase) {
262
262
  ${Xn}
263
263
  }
264
- }`,variables:{passphrase:e}}));return new Ot(r)}async import(e){let{did:r,didDocument:n,keystore:i,passphrase:a}=e,{agentImport:o}=k(await ae(this,fe,"f").mutate({mutation:I`mutation agentImport(
264
+ }`,variables:{passphrase:e}}));return new At(r)}async import(e){let{did:r,didDocument:n,keystore:i,passphrase:a}=e,{agentImport:o}=k(await ae(this,ue,"f").mutate({mutation:I`mutation agentImport(
265
265
  $did: String!,
266
266
  $didDocument: String!,
267
267
  $keystore: String!,
@@ -270,93 +270,101 @@ neighbourhood {
270
270
  agentImport(did: $did, didDocument: $didDocument, keystore: $keystore, passphrase: $passphrase) {
271
271
  ${Xn}
272
272
  }
273
- }`,variables:{did:r,didDocument:n,keystore:i,passphrase:a}}));return new Ot(o)}async lock(e){let{agentLock:r}=k(await ae(this,fe,"f").mutate({mutation:I`mutation agentLock($passphrase: String!) {
273
+ }`,variables:{did:r,didDocument:n,keystore:i,passphrase:a}}));return new At(o)}async lock(e){let{agentLock:r}=k(await ae(this,ue,"f").mutate({mutation:I`mutation agentLock($passphrase: String!) {
274
274
  agentLock(passphrase: $passphrase) {
275
275
  ${Xn}
276
276
  }
277
- }`,variables:{passphrase:e}}));return new Ot(r)}async unlock(e,r=!0){let{agentUnlock:n}=k(await ae(this,fe,"f").mutate({mutation:I`mutation agentUnlock($passphrase: String!, $holochain: Boolean!) {
277
+ }`,variables:{passphrase:e}}));return new At(r)}async unlock(e,r=!0){let{agentUnlock:n}=k(await ae(this,ue,"f").mutate({mutation:I`mutation agentUnlock($passphrase: String!, $holochain: Boolean!) {
278
278
  agentUnlock(passphrase: $passphrase, holochain: $holochain) {
279
279
  ${Xn}
280
280
  }
281
- }`,variables:{passphrase:e,holochain:r}}));return new Ot(n)}async byDID(e){let{agentByDID:r}=k(await ae(this,fe,"f").query({query:I`query agentByDID($did: String!) {
281
+ }`,variables:{passphrase:e,holochain:r}}));return new At(n)}async byDID(e){let{agentByDID:r}=k(await ae(this,ue,"f").query({query:I`query agentByDID($did: String!) {
282
282
  agentByDID(did: $did) {
283
- ${Gi}
283
+ ${Ki}
284
284
  }
285
- }`,variables:{did:e}}));return r}async updatePublicPerspective(e){let r=JSON.parse(JSON.stringify(e));delete r.__typename,r.links.forEach(o=>{delete o.__typename,delete o.data.__typename,delete o.proof.__typename,delete o.status});let{agentUpdatePublicPerspective:n}=k(await ae(this,fe,"f").mutate({mutation:I`mutation agentUpdatePublicPerspective($perspective: PerspectiveInput!) {
285
+ }`,variables:{did:e}}));return r}async updatePublicPerspective(e){let r=JSON.parse(JSON.stringify(e));delete r.__typename,r.links.forEach(o=>{delete o.__typename,delete o.data.__typename,delete o.proof.__typename,delete o.status});let{agentUpdatePublicPerspective:n}=k(await ae(this,ue,"f").mutate({mutation:I`mutation agentUpdatePublicPerspective($perspective: PerspectiveInput!) {
286
286
  agentUpdatePublicPerspective(perspective: $perspective) {
287
- ${Gi}
287
+ ${Ki}
288
288
  }
289
- }`,variables:{perspective:r}})),i=n,a=new Rr(i.did,i.perspective);return a.directMessageLanguage=i.directMessageLanguage,a}async mutatePublicPerspective(e){let r=new ps(ae(this,fe,"f")),n=new Ea(ae(this,fe,"f")),i=await r.add("Agent Perspective Proxy"),a=await n.me();a.perspective&&await i.loadSnapshot(a.perspective);for(let u of e.additions)await i.add(u);for(let u of e.removals)await i.remove(u);let o=await i.snapshot(),s=await this.updatePublicPerspective(o);return await r.remove(i.uuid),s}async updateDirectMessageLanguage(e){let{agentUpdateDirectMessageLanguage:r}=k(await ae(this,fe,"f").mutate({mutation:I`mutation agentUpdateDirectMessageLanguage($directMessageLanguage: String!) {
289
+ }`,variables:{perspective:r}})),i=n,a=new Rr(i.did,i.perspective);return a.directMessageLanguage=i.directMessageLanguage,a}async mutatePublicPerspective(e){let r=new ys(ae(this,ue,"f")),n=new ka(ae(this,ue,"f")),i=await r.add("Agent Perspective Proxy"),a=await n.me();a.perspective&&await i.loadSnapshot(a.perspective);for(let u of e.additions)await i.add(u);for(let u of e.removals)await i.remove(u);let o=await i.snapshot(),s=await this.updatePublicPerspective(o);return await r.remove(i.uuid),s}async updateDirectMessageLanguage(e){let{agentUpdateDirectMessageLanguage:r}=k(await ae(this,ue,"f").mutate({mutation:I`mutation agentUpdateDirectMessageLanguage($directMessageLanguage: String!) {
290
290
  agentUpdateDirectMessageLanguage(directMessageLanguage: $directMessageLanguage) {
291
- ${Gi}
291
+ ${Ki}
292
292
  }
293
- }`,variables:{directMessageLanguage:e}})),n=r,i=new Rr(n.did,n.perspective);return i.directMessageLanguage=n.directMessageLanguage,i}async addEntanglementProofs(e){let{agentAddEntanglementProofs:r}=k(await ae(this,fe,"f").mutate({mutation:I`mutation agentAddEntanglementProofs($proofs: [EntanglementProofInput!]!) {
293
+ }`,variables:{directMessageLanguage:e}})),n=r,i=new Rr(n.did,n.perspective);return i.directMessageLanguage=n.directMessageLanguage,i}async addEntanglementProofs(e){let{agentAddEntanglementProofs:r}=k(await ae(this,ue,"f").mutate({mutation:I`mutation agentAddEntanglementProofs($proofs: [EntanglementProofInput!]!) {
294
294
  agentAddEntanglementProofs(proofs: $proofs) {
295
- ${Ao}
295
+ ${Lo}
296
296
  }
297
- }`,variables:{proofs:e}}));return r}async deleteEntanglementProofs(e){let{agentDeleteEntanglementProofs:r}=k(await ae(this,fe,"f").mutate({mutation:I`mutation agentDeleteEntanglementProofs($proofs: [EntanglementProofInput!]!) {
297
+ }`,variables:{proofs:e}}));return r}async deleteEntanglementProofs(e){let{agentDeleteEntanglementProofs:r}=k(await ae(this,ue,"f").mutate({mutation:I`mutation agentDeleteEntanglementProofs($proofs: [EntanglementProofInput!]!) {
298
298
  agentDeleteEntanglementProofs(proofs: $proofs) {
299
- ${Ao}
299
+ ${Lo}
300
300
  }
301
- }`,variables:{proofs:e}}));return r}async getEntanglementProofs(){let{agentGetEntanglementProofs:e}=k(await ae(this,fe,"f").query({query:I`query agentGetEntanglementProofs {
301
+ }`,variables:{proofs:e}}));return r}async getEntanglementProofs(){let{agentGetEntanglementProofs:e}=k(await ae(this,ue,"f").query({query:I`query agentGetEntanglementProofs {
302
302
  agentGetEntanglementProofs {
303
- ${Ao}
303
+ ${Lo}
304
304
  }
305
- }`}));return e}async entanglementProofPreFlight(e,r){let{agentEntanglementProofPreFlight:n}=k(await ae(this,fe,"f").mutate({mutation:I`mutation agentEntanglementProofPreFlight($deviceKey: String!, $deviceKeyType: String!) {
305
+ }`}));return e}async entanglementProofPreFlight(e,r){let{agentEntanglementProofPreFlight:n}=k(await ae(this,ue,"f").mutate({mutation:I`mutation agentEntanglementProofPreFlight($deviceKey: String!, $deviceKeyType: String!) {
306
306
  agentEntanglementProofPreFlight(deviceKey: $deviceKey, deviceKeyType: $deviceKeyType) {
307
- ${Ao}
307
+ ${Lo}
308
308
  }
309
- }`,variables:{deviceKey:e,deviceKeyType:r}}));return n}addUpdatedListener(e){ae(this,oa,"f").push(e)}addAppChangedListener(e){ae(this,aa,"f").push(e)}subscribeAgentUpdated(){ae(this,fe,"f").subscribe({query:I` subscription {
310
- agentUpdated { ${Gi} }
309
+ }`,variables:{deviceKey:e,deviceKeyType:r}}));return n}addUpdatedListener(e){ae(this,ca,"f").push(e)}addAppChangedListener(e){ae(this,sa,"f").push(e)}subscribeAgentUpdated(){ae(this,ue,"f").subscribe({query:I` subscription {
310
+ agentUpdated { ${Ki} }
311
311
  }
312
- `}).subscribe({next:e=>{let r=e.data.agentUpdated;ae(this,oa,"f").forEach(n=>{n(r)})},error:e=>console.error(e)})}subscribeAppsChanged(){ae(this,fe,"f").subscribe({query:I` subscription {
312
+ `}).subscribe({next:e=>{let r=e.data.agentUpdated;ae(this,ca,"f").forEach(n=>{n(r)})},error:e=>console.error(e)})}subscribeAppsChanged(){ae(this,ue,"f").subscribe({query:I` subscription {
313
313
  agentAppsChanged {
314
- ${Oo}
314
+ ${Ro}
315
315
  }
316
316
  }
317
- `}).subscribe({next:e=>{ae(this,aa,"f").forEach(r=>{r()})},error:e=>console.error(e)})}addAgentStatusChangedListener(e){ae(this,sa,"f").push(e)}subscribeAgentStatusChanged(){ae(this,fe,"f").subscribe({query:I` subscription {
317
+ `}).subscribe({next:e=>{ae(this,sa,"f").forEach(r=>{r()})},error:e=>console.error(e)})}addAgentStatusChangedListener(e){ae(this,ua,"f").push(e)}subscribeAgentStatusChanged(){ae(this,ue,"f").subscribe({query:I` subscription {
318
318
  agentStatusChanged { ${Xn} }
319
319
  }
320
- `}).subscribe({next:e=>{let r=e.data.agentStatusChanged;ae(this,sa,"f").forEach(n=>{n(r)})},error:e=>console.error(e)})}async requestCapability(e){let{agentRequestCapability:r}=k(await ae(this,fe,"f").mutate({mutation:I`
320
+ `}).subscribe({next:e=>{let r=e.data.agentStatusChanged;ae(this,ua,"f").forEach(n=>{n(r)})},error:e=>console.error(e)})}async requestCapability(e){let{agentRequestCapability:r}=k(await ae(this,ue,"f").mutate({mutation:I`
321
321
  mutation agentRequestCapability($authInfo: AuthInfoInput!) {
322
322
  agentRequestCapability(authInfo: $authInfo)
323
323
  }
324
- `,variables:{authInfo:e}}));return r}async permitCapability(e){let{agentPermitCapability:r}=k(await ae(this,fe,"f").mutate({mutation:I`
324
+ `,variables:{authInfo:e}}));return r}async permitCapability(e){let{agentPermitCapability:r}=k(await ae(this,ue,"f").mutate({mutation:I`
325
325
  mutation agentPermitCapability($auth: String!) {
326
326
  agentPermitCapability(auth: $auth)
327
327
  }
328
- `,variables:{auth:e}}));return r}async generateJwt(e,r){let{agentGenerateJwt:n}=k(await ae(this,fe,"f").mutate({mutation:I`
328
+ `,variables:{auth:e}}));return r}async generateJwt(e,r){let{agentGenerateJwt:n}=k(await ae(this,ue,"f").mutate({mutation:I`
329
329
  mutation agentGenerateJwt($requestId: String!, $rand: String!) {
330
330
  agentGenerateJwt(requestId: $requestId, rand: $rand)
331
331
  }
332
- `,variables:{requestId:e,rand:r}}));return n}async getApps(){let{agentGetApps:e}=k(await ae(this,fe,"f").mutate({mutation:I`query agentGetApps {
332
+ `,variables:{requestId:e,rand:r}}));return n}async getApps(){let{agentGetApps:e}=k(await ae(this,ue,"f").mutate({mutation:I`query agentGetApps {
333
333
  agentGetApps {
334
- ${Oo}
334
+ ${Ro}
335
335
  }
336
- }`}));return e}async removeApp(e){let{agentRemoveApp:r}=k(await ae(this,fe,"f").mutate({mutation:I`mutation agentRemoveApp($requestId: String!) {
336
+ }`}));return e}async removeApp(e){let{agentRemoveApp:r}=k(await ae(this,ue,"f").mutate({mutation:I`mutation agentRemoveApp($requestId: String!) {
337
337
  agentRemoveApp(requestId: $requestId) {
338
- ${Oo}
338
+ ${Ro}
339
339
  }
340
- }`,variables:{requestId:e}}));return r}async revokeToken(e){let{agentRevokeToken:r}=k(await ae(this,fe,"f").mutate({mutation:I`mutation agentRevokeToken($requestId: String!) {
340
+ }`,variables:{requestId:e}}));return r}async revokeToken(e){let{agentRevokeToken:r}=k(await ae(this,ue,"f").mutate({mutation:I`mutation agentRevokeToken($requestId: String!) {
341
341
  agentRevokeToken(requestId: $requestId) {
342
- ${Oo}
342
+ ${Ro}
343
343
  }
344
- }`,variables:{requestId:e}}));return r}async isLocked(){let{agentIsLocked:e}=k(await ae(this,fe,"f").mutate({mutation:I`
344
+ }`,variables:{requestId:e}}));return r}async isLocked(){let{agentIsLocked:e}=k(await ae(this,ue,"f").mutate({mutation:I`
345
345
  query agentIsLocked {
346
346
  agentIsLocked
347
347
  }
348
- `}));return e}async signMessage(e){let{agentSignMessage:r}=k(await ae(this,fe,"f").mutate({mutation:I`mutation agentSignMessage($message: String!) {
348
+ `}));return e}async signMessage(e){let{agentSignMessage:r}=k(await ae(this,ue,"f").mutate({mutation:I`mutation agentSignMessage($message: String!) {
349
349
  agentSignMessage(message: $message) {
350
- ${hg}
350
+ ${gy}
351
351
  }
352
- }`,variables:{message:e}}));return r}};fe=new WeakMap,aa=new WeakMap,oa=new WeakMap,sa=new WeakMap;var mg=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},Or=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)},$t,up=`
352
+ }`,variables:{message:e}}));return r}async createUser(e,r){let{runtimeCreateUser:n}=k(await ae(this,ue,"f").mutate({mutation:I`mutation runtimeCreateUser($email: String!, $password: String!) {
353
+ runtimeCreateUser(email: $email, password: $password) {
354
+ did
355
+ success
356
+ error
357
+ }
358
+ }`,variables:{email:e,password:r}}));return n}async loginUser(e,r){let{runtimeLoginUser:n}=k(await ae(this,ue,"f").mutate({mutation:I`mutation runtimeLoginUser($email: String!, $password: String!) {
359
+ runtimeLoginUser(email: $email, password: $password)
360
+ }`,variables:{email:e,password:r}}));return n}};ue=new WeakMap,sa=new WeakMap,ca=new WeakMap,ua=new WeakMap;var yy=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},Or=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)},Mt,lp=`
353
361
  name
354
362
  address
355
363
  settings
356
364
  icon { code }
357
365
  constructorIcon { code }
358
366
  settingsIcon { code }
359
- `,lp=`
367
+ `,fp=`
360
368
  name
361
369
  address
362
370
  description
@@ -366,45 +374,45 @@ neighbourhood {
366
374
  templateAppliedParams
367
375
  possibleTemplateParams
368
376
  sourceCodeLink
369
- `,_u=class{constructor(e){$t.set(this,void 0),mg(this,$t,e,"f")}async byAddress(e){let{language:r}=k(await Or(this,$t,"f").query({query:I`query byAddress($address: String!) {
377
+ `,xu=class{constructor(e){Mt.set(this,void 0),yy(this,Mt,e,"f")}async byAddress(e){let{language:r}=k(await Or(this,Mt,"f").query({query:I`query byAddress($address: String!) {
370
378
  language(address: $address) {
371
- ${up}
379
+ ${lp}
372
380
  }
373
- }`,variables:{address:e}}));return r}async byFilter(e){let{languages:r}=k(await Or(this,$t,"f").query({query:I`query byFilter($filter: String!) {
381
+ }`,variables:{address:e}}));return r}async byFilter(e){let{languages:r}=k(await Or(this,Mt,"f").query({query:I`query byFilter($filter: String!) {
374
382
  languages(filter: $filter) {
375
- ${up}
383
+ ${lp}
376
384
  }
377
- }`,variables:{filter:e}}));return r}async all(){return this.byFilter("")}async writeSettings(e,r){let{languageWriteSettings:n}=k(await Or(this,$t,"f").mutate({mutation:I`mutation writeSettings($languageAddress: String!, $settings: String!) {
385
+ }`,variables:{filter:e}}));return r}async all(){return this.byFilter("")}async writeSettings(e,r){let{languageWriteSettings:n}=k(await Or(this,Mt,"f").mutate({mutation:I`mutation writeSettings($languageAddress: String!, $settings: String!) {
378
386
  languageWriteSettings(languageAddress: $languageAddress, settings: $settings)
379
- }`,variables:{languageAddress:e,settings:r}}));return n}async applyTemplateAndPublish(e,r){let{languageApplyTemplateAndPublish:n}=k(await Or(this,$t,"f").mutate({mutation:I`mutation languageApplyTemplateAndPublish(
387
+ }`,variables:{languageAddress:e,settings:r}}));return n}async applyTemplateAndPublish(e,r){let{languageApplyTemplateAndPublish:n}=k(await Or(this,Mt,"f").mutate({mutation:I`mutation languageApplyTemplateAndPublish(
380
388
  $sourceLanguageHash: String!,
381
389
  $templateData: String!,
382
390
  ) {
383
391
  languageApplyTemplateAndPublish(sourceLanguageHash: $sourceLanguageHash, templateData: $templateData) {
384
392
  name, address
385
393
  }
386
- }`,variables:{sourceLanguageHash:e,templateData:r}}));return n}async publish(e,r){let{languagePublish:n}=k(await Or(this,$t,"f").mutate({mutation:I`mutation languagePublish(
394
+ }`,variables:{sourceLanguageHash:e,templateData:r}}));return n}async publish(e,r){let{languagePublish:n}=k(await Or(this,Mt,"f").mutate({mutation:I`mutation languagePublish(
387
395
  $languagePath: String!,
388
396
  $languageMeta: LanguageMetaInput!,
389
397
  ) {
390
398
  languagePublish(languagePath: $languagePath, languageMeta: $languageMeta) {
391
- ${lp}
399
+ ${fp}
392
400
  }
393
- }`,variables:{languagePath:e,languageMeta:r}}));return n}async meta(e){let{languageMeta:r}=k(await Or(this,$t,"f").query({query:I`query languageMeta(
401
+ }`,variables:{languagePath:e,languageMeta:r}}));return n}async meta(e){let{languageMeta:r}=k(await Or(this,Mt,"f").query({query:I`query languageMeta(
394
402
  $address: String!,
395
403
  ) {
396
404
  languageMeta(address: $address) {
397
- ${lp}
405
+ ${fp}
398
406
  }
399
- }`,variables:{address:e}}));return r}async source(e){let{languageSource:r}=k(await Or(this,$t,"f").query({query:I`query languageSource(
407
+ }`,variables:{address:e}}));return r}async source(e){let{languageSource:r}=k(await Or(this,Mt,"f").query({query:I`query languageSource(
400
408
  $address: String!,
401
409
  ) {
402
410
  languageSource(address: $address)
403
- }`,variables:{address:e}}));return r}async remove(e){let{languageRemove:r}=k(await Or(this,$t,"f").mutate({mutation:I`mutation languageRemove(
411
+ }`,variables:{address:e}}));return r}async remove(e){let{languageRemove:r}=k(await Or(this,Mt,"f").mutate({mutation:I`mutation languageRemove(
404
412
  $address: String!,
405
413
  ) {
406
414
  languageRemove(address: $address)
407
- }`,variables:{address:e}}));return r}};$t=new WeakMap;var yg=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)},it,oi,wu=class{constructor(e){it.set(this,void 0),oi.set(this,new Map),yg(this,it,e,"f")}async publishFromPerspective(e,r,n){let{neighbourhoodPublishFromPerspective:i}=k(await Ye(this,it,"f").mutate({mutation:I`mutation neighbourhoodPublishFromPerspective(
415
+ }`,variables:{address:e}}));return r}};Mt=new WeakMap;var vy=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},Ze=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,oi,Iu=class{constructor(e){it.set(this,void 0),oi.set(this,new Map),vy(this,it,e,"f")}async publishFromPerspective(e,r,n){let{neighbourhoodPublishFromPerspective:i}=k(await Ze(this,it,"f").mutate({mutation:I`mutation neighbourhoodPublishFromPerspective(
408
416
  $linkLanguage: String!,
409
417
  $meta: PerspectiveInput!,
410
418
  $perspectiveUUID: String!
@@ -414,7 +422,7 @@ neighbourhood {
414
422
  meta: $meta,
415
423
  perspectiveUUID: $perspectiveUUID
416
424
  )
417
- }`,variables:{perspectiveUUID:e,linkLanguage:r,meta:n}}));return i}async joinFromUrl(e){let{neighbourhoodJoinFromUrl:r}=k(await Ye(this,it,"f").mutate({mutation:I`mutation neighbourhoodJoinFromUrl($url: String!) {
425
+ }`,variables:{perspectiveUUID:e,linkLanguage:r,meta:n}}));return i}async joinFromUrl(e){let{neighbourhoodJoinFromUrl:r}=k(await Ze(this,it,"f").mutate({mutation:I`mutation neighbourhoodJoinFromUrl($url: String!) {
418
426
  neighbourhoodJoinFromUrl(url: $url) {
419
427
  uuid
420
428
  name
@@ -436,11 +444,11 @@ neighbourhood {
436
444
  author
437
445
  }
438
446
  }
439
- }`,variables:{url:e}}));return r}async otherAgents(e){let{neighbourhoodOtherAgents:r}=k(await Ye(this,it,"f").query({query:I`query neighbourhoodOtherAgents($perspectiveUUID: String!) {
447
+ }`,variables:{url:e}}));return r}async otherAgents(e){let{neighbourhoodOtherAgents:r}=k(await Ze(this,it,"f").query({query:I`query neighbourhoodOtherAgents($perspectiveUUID: String!) {
440
448
  neighbourhoodOtherAgents(perspectiveUUID: $perspectiveUUID)
441
- }`,variables:{perspectiveUUID:e}}));return r}async hasTelepresenceAdapter(e){let{neighbourhoodHasTelepresenceAdapter:r}=k(await Ye(this,it,"f").query({query:I`query neighbourhoodHasTelepresenceAdapter($perspectiveUUID: String!) {
449
+ }`,variables:{perspectiveUUID:e}}));return r}async hasTelepresenceAdapter(e){let{neighbourhoodHasTelepresenceAdapter:r}=k(await Ze(this,it,"f").query({query:I`query neighbourhoodHasTelepresenceAdapter($perspectiveUUID: String!) {
442
450
  neighbourhoodHasTelepresenceAdapter(perspectiveUUID: $perspectiveUUID)
443
- }`,variables:{perspectiveUUID:e}}));return r}async onlineAgents(e){let{neighbourhoodOnlineAgents:r}=k(await Ye(this,it,"f").query({query:I`query neighbourhoodOnlineAgents($perspectiveUUID: String!) {
451
+ }`,variables:{perspectiveUUID:e}}));return r}async onlineAgents(e){let{neighbourhoodOnlineAgents:r}=k(await Ze(this,it,"f").query({query:I`query neighbourhoodOnlineAgents($perspectiveUUID: String!) {
444
452
  neighbourhoodOnlineAgents(perspectiveUUID: $perspectiveUUID) {
445
453
  did
446
454
  status {
@@ -457,7 +465,7 @@ neighbourhood {
457
465
  proof { valid, invalid, signature, key }
458
466
  }
459
467
  }
460
- }`,variables:{perspectiveUUID:e}}));return r}async setOnlineStatus(e,r){let{neighbourhoodSetOnlineStatus:n}=k(await Ye(this,it,"f").mutate({mutation:I`mutation neighbourhoodSetOnlineStatus(
468
+ }`,variables:{perspectiveUUID:e}}));return r}async setOnlineStatus(e,r){let{neighbourhoodSetOnlineStatus:n}=k(await Ze(this,it,"f").mutate({mutation:I`mutation neighbourhoodSetOnlineStatus(
461
469
  $perspectiveUUID: String!,
462
470
  $status: PerspectiveInput!
463
471
  ) {
@@ -465,7 +473,7 @@ neighbourhood {
465
473
  perspectiveUUID: $perspectiveUUID,
466
474
  status: $status
467
475
  )
468
- }`,variables:{perspectiveUUID:e,status:r}}));return n}async setOnlineStatusU(e,r){let{neighbourhoodSetOnlineStatusU:n}=k(await Ye(this,it,"f").mutate({mutation:I`mutation neighbourhoodSetOnlineStatusU(
476
+ }`,variables:{perspectiveUUID:e,status:r}}));return n}async setOnlineStatusU(e,r){let{neighbourhoodSetOnlineStatusU:n}=k(await Ze(this,it,"f").mutate({mutation:I`mutation neighbourhoodSetOnlineStatusU(
469
477
  $perspectiveUUID: String!,
470
478
  $status: PerspectiveUnsignedInput!
471
479
  ) {
@@ -473,7 +481,7 @@ neighbourhood {
473
481
  perspectiveUUID: $perspectiveUUID,
474
482
  status: $status
475
483
  )
476
- }`,variables:{perspectiveUUID:e,status:r}}));return n}async sendSignal(e,r,n){let{neighbourhoodSendSignal:i}=k(await Ye(this,it,"f").mutate({mutation:I`mutation neighbourhoodSendSignal(
484
+ }`,variables:{perspectiveUUID:e,status:r}}));return n}async sendSignal(e,r,n){let{neighbourhoodSendSignal:i}=k(await Ze(this,it,"f").mutate({mutation:I`mutation neighbourhoodSendSignal(
477
485
  $perspectiveUUID: String!,
478
486
  $remoteAgentDid: String!,
479
487
  $payload: PerspectiveInput!
@@ -483,7 +491,7 @@ neighbourhood {
483
491
  remoteAgentDid: $remoteAgentDid,
484
492
  payload: $payload
485
493
  )
486
- }`,variables:{perspectiveUUID:e,remoteAgentDid:r,payload:n}}));return i}async sendSignalU(e,r,n){let{neighbourhoodSendSignalU:i}=k(await Ye(this,it,"f").mutate({mutation:I`mutation neighbourhoodSendSignalU(
494
+ }`,variables:{perspectiveUUID:e,remoteAgentDid:r,payload:n}}));return i}async sendSignalU(e,r,n){let{neighbourhoodSendSignalU:i}=k(await Ze(this,it,"f").mutate({mutation:I`mutation neighbourhoodSendSignalU(
487
495
  $perspectiveUUID: String!,
488
496
  $remoteAgentDid: String!,
489
497
  $payload: PerspectiveUnsignedInput!
@@ -493,7 +501,7 @@ neighbourhood {
493
501
  remoteAgentDid: $remoteAgentDid,
494
502
  payload: $payload
495
503
  )
496
- }`,variables:{perspectiveUUID:e,remoteAgentDid:r,payload:n}}));return i}async sendBroadcast(e,r,n=!1){let{neighbourhoodSendBroadcast:i}=k(await Ye(this,it,"f").mutate({mutation:I`mutation neighbourhoodSendBroadcast(
504
+ }`,variables:{perspectiveUUID:e,remoteAgentDid:r,payload:n}}));return i}async sendBroadcast(e,r,n=!1){let{neighbourhoodSendBroadcast:i}=k(await Ze(this,it,"f").mutate({mutation:I`mutation neighbourhoodSendBroadcast(
497
505
  $perspectiveUUID: String!,
498
506
  $payload: PerspectiveInput!,
499
507
  $loopback: Boolean
@@ -503,7 +511,7 @@ neighbourhood {
503
511
  payload: $payload,
504
512
  loopback: $loopback
505
513
  )
506
- }`,variables:{perspectiveUUID:e,payload:r,loopback:n}}));return i}async sendBroadcastU(e,r,n=!1){let{neighbourhoodSendBroadcastU:i}=k(await Ye(this,it,"f").mutate({mutation:I`mutation neighbourhoodSendBroadcastU(
514
+ }`,variables:{perspectiveUUID:e,payload:r,loopback:n}}));return i}async sendBroadcastU(e,r,n=!1){let{neighbourhoodSendBroadcastU:i}=k(await Ze(this,it,"f").mutate({mutation:I`mutation neighbourhoodSendBroadcastU(
507
515
  $perspectiveUUID: String!,
508
516
  $payload: PerspectiveUnsignedInput!,
509
517
  $loopback: Boolean
@@ -513,7 +521,7 @@ neighbourhood {
513
521
  payload: $payload,
514
522
  loopback: $loopback
515
523
  )
516
- }`,variables:{perspectiveUUID:e,payload:r,loopback:n}}));return i}dispatchSignal(e,r){let n=Ye(this,oi,"f").get(e);n&&n.forEach(i=>i(r))}async subscribeToSignals(e){let r=this;await Ye(this,it,"f").subscribe({query:I`subscription neighbourhoodSignal($perspectiveUUID: String!) {
524
+ }`,variables:{perspectiveUUID:e,payload:r,loopback:n}}));return i}dispatchSignal(e,r){let n=Ze(this,oi,"f").get(e);n&&n.forEach(i=>i(r))}async subscribeToSignals(e){let r=this;await Ze(this,it,"f").subscribe({query:I`subscription neighbourhoodSignal($perspectiveUUID: String!) {
517
525
  neighbourhoodSignal(perspectiveUUID: $perspectiveUUID) {
518
526
  author
519
527
  timestamp
@@ -528,7 +536,7 @@ neighbourhood {
528
536
  }
529
537
  proof { valid, invalid, signature, key }
530
538
  }
531
- }`,variables:{perspectiveUUID:e}}).subscribe({next:n=>{let{neighbourhoodSignal:i}=k(n);r.dispatchSignal(e,i)}})}async addSignalHandler(e,r){let n=Ye(this,oi,"f").get(e);n||(n=[],Ye(this,oi,"f").set(e,n),await this.subscribeToSignals(e)),n.push(r)}removeSignalHandler(e,r){let n=Ye(this,oi,"f").get(e);if(n){let i=n.indexOf(r);i>-1&&n.splice(i,1)}}};it=new WeakMap,oi=new WeakMap;var Do=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},W=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,ca,ua,la,Od,No=`
539
+ }`,variables:{perspectiveUUID:e}}).subscribe({next:n=>{let{neighbourhoodSignal:i}=k(n);r.dispatchSignal(e,i)}})}async addSignalHandler(e,r){let n=Ze(this,oi,"f").get(e);n||(n=[],Ze(this,oi,"f").set(e,n),await this.subscribeToSignals(e)),n.push(r)}removeSignalHandler(e,r){let n=Ze(this,oi,"f").get(e);if(n){let i=n.indexOf(r);i>-1&&n.splice(i,1)}}};it=new WeakMap,oi=new WeakMap;var Fo=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},W=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)},K,la,fa,pa,Dd,$o=`
532
540
  author
533
541
  timestamp
534
542
  data {
@@ -540,7 +548,7 @@ data {
540
548
  }
541
549
  }
542
550
  proof { valid, invalid, signature, key }
543
- `,gg=`
551
+ `,by=`
544
552
  description
545
553
  appName
546
554
  appUrl
@@ -549,72 +557,72 @@ trigger
549
557
  perspectiveIds
550
558
  webhookUrl
551
559
  webhookAuth
552
- `,Ad=`
560
+ `,Nd=`
553
561
  id
554
562
  granted
555
- ${gg}
556
- `,vg=`
557
- notification { ${Ad} }
563
+ ${by}
564
+ `,_y=`
565
+ notification { ${Nd} }
558
566
  perspectiveId
559
567
  triggerMatch
560
- `,Su=class{constructor(e,r=!0){Y.set(this,void 0),ca.set(this,void 0),ua.set(this,void 0),la.set(this,void 0),Od.set(this,void 0),Do(this,Y,e,"f"),Do(this,ca,[],"f"),Do(this,ua,[],"f"),Do(this,la,[],"f"),r&&(this.subscribeMessageReceived(),this.subscribeExceptionOccurred(),this.subscribeNotificationTriggered())}async info(){let{runtimeInfo:e}=k(await W(this,Y,"f").query({query:I`query runtimeInfo {
568
+ `,Tu=class{constructor(e,r=!0){K.set(this,void 0),la.set(this,void 0),fa.set(this,void 0),pa.set(this,void 0),Dd.set(this,void 0),Fo(this,K,e,"f"),Fo(this,la,[],"f"),Fo(this,fa,[],"f"),Fo(this,pa,[],"f"),r&&(this.subscribeMessageReceived(),this.subscribeExceptionOccurred(),this.subscribeNotificationTriggered())}async info(){let{runtimeInfo:e}=k(await W(this,K,"f").query({query:I`query runtimeInfo {
561
569
  runtimeInfo {
562
570
  ad4mExecutorVersion,
563
571
  isInitialized,
564
572
  isUnlocked
565
573
  }
566
- }`}));return e}async quit(){return k(await W(this,Y,"f").mutate({mutation:I`mutation runtimeQuit { runtimeQuit }`})).runtimeQuit}async openLink(e){let{runtimeOpenLink:r}=k(await W(this,Y,"f").mutate({mutation:I`mutation runtimeOpenLink($url: String!) {
574
+ }`}));return e}async quit(){return k(await W(this,K,"f").mutate({mutation:I`mutation runtimeQuit { runtimeQuit }`})).runtimeQuit}async openLink(e){let{runtimeOpenLink:r}=k(await W(this,K,"f").mutate({mutation:I`mutation runtimeOpenLink($url: String!) {
567
575
  runtimeOpenLink(url: $url)
568
- }`,variables:{url:e}}));return r}async addTrustedAgents(e){let{addTrustedAgents:r}=k(await W(this,Y,"f").mutate({mutation:I`mutation addTrustedAgents($agents: [String!]!) {
576
+ }`,variables:{url:e}}));return r}async addTrustedAgents(e){let{addTrustedAgents:r}=k(await W(this,K,"f").mutate({mutation:I`mutation addTrustedAgents($agents: [String!]!) {
569
577
  addTrustedAgents(agents: $agents)
570
- }`,variables:{agents:e}}));return r}async deleteTrustedAgents(e){let{deleteTrustedAgents:r}=k(await W(this,Y,"f").mutate({mutation:I`mutation deleteTrustedAgents($agents: [String!]!) {
578
+ }`,variables:{agents:e}}));return r}async deleteTrustedAgents(e){let{deleteTrustedAgents:r}=k(await W(this,K,"f").mutate({mutation:I`mutation deleteTrustedAgents($agents: [String!]!) {
571
579
  deleteTrustedAgents(agents: $agents)
572
- }`,variables:{agents:e}}));return r}async getTrustedAgents(){let{getTrustedAgents:e}=k(await W(this,Y,"f").query({query:I`query getTrustedAgents {
580
+ }`,variables:{agents:e}}));return r}async getTrustedAgents(){let{getTrustedAgents:e}=k(await W(this,K,"f").query({query:I`query getTrustedAgents {
573
581
  getTrustedAgents
574
- }`}));return e}async addKnownLinkLanguageTemplates(e){let{runtimeAddKnownLinkLanguageTemplates:r}=k(await W(this,Y,"f").mutate({mutation:I`mutation runtimeAddKnownLinkLanguageTemplates($addresses: [String!]!) {
582
+ }`}));return e}async addKnownLinkLanguageTemplates(e){let{runtimeAddKnownLinkLanguageTemplates:r}=k(await W(this,K,"f").mutate({mutation:I`mutation runtimeAddKnownLinkLanguageTemplates($addresses: [String!]!) {
575
583
  runtimeAddKnownLinkLanguageTemplates(addresses: $addresses)
576
- }`,variables:{addresses:e}}));return r}async removeKnownLinkLanguageTemplates(e){let{runtimeRemoveKnownLinkLanguageTemplates:r}=k(await W(this,Y,"f").mutate({mutation:I`mutation runtimeRemoveKnownLinkLanguageTemplates($addresses: [String!]!) {
584
+ }`,variables:{addresses:e}}));return r}async removeKnownLinkLanguageTemplates(e){let{runtimeRemoveKnownLinkLanguageTemplates:r}=k(await W(this,K,"f").mutate({mutation:I`mutation runtimeRemoveKnownLinkLanguageTemplates($addresses: [String!]!) {
577
585
  runtimeRemoveKnownLinkLanguageTemplates(addresses: $addresses)
578
- }`,variables:{addresses:e}}));return r}async knownLinkLanguageTemplates(){let{runtimeKnownLinkLanguageTemplates:e}=k(await W(this,Y,"f").query({query:I`query runtimeKnownLinkLanguageTemplates {
586
+ }`,variables:{addresses:e}}));return r}async knownLinkLanguageTemplates(){let{runtimeKnownLinkLanguageTemplates:e}=k(await W(this,K,"f").query({query:I`query runtimeKnownLinkLanguageTemplates {
579
587
  runtimeKnownLinkLanguageTemplates
580
- }`}));return e}async addFriends(e){let{runtimeAddFriends:r}=k(await W(this,Y,"f").mutate({mutation:I`mutation runtimeAddFriends($dids: [String!]!) {
588
+ }`}));return e}async addFriends(e){let{runtimeAddFriends:r}=k(await W(this,K,"f").mutate({mutation:I`mutation runtimeAddFriends($dids: [String!]!) {
581
589
  runtimeAddFriends(dids: $dids)
582
- }`,variables:{dids:e}}));return r}async removeFriends(e){let{runtimeRemoveFriends:r}=k(await W(this,Y,"f").mutate({mutation:I`mutation runtimeRemoveFriends($dids: [String!]!) {
590
+ }`,variables:{dids:e}}));return r}async removeFriends(e){let{runtimeRemoveFriends:r}=k(await W(this,K,"f").mutate({mutation:I`mutation runtimeRemoveFriends($dids: [String!]!) {
583
591
  runtimeRemoveFriends(dids: $dids)
584
- }`,variables:{dids:e}}));return r}async friends(){let{runtimeFriends:e}=k(await W(this,Y,"f").query({query:I`query runtimeFriends {
592
+ }`,variables:{dids:e}}));return r}async friends(){let{runtimeFriends:e}=k(await W(this,K,"f").query({query:I`query runtimeFriends {
585
593
  runtimeFriends
586
- }`}));return e}async hcAgentInfos(){let{runtimeHcAgentInfos:e}=k(await W(this,Y,"f").query({query:I`query runtimeHcAgentInfos {
594
+ }`}));return e}async hcAgentInfos(){let{runtimeHcAgentInfos:e}=k(await W(this,K,"f").query({query:I`query runtimeHcAgentInfos {
587
595
  runtimeHcAgentInfos
588
- }`}));return e}async getNetworkMetrics(){let{runtimeGetNetworkMetrics:e}=k(await W(this,Y,"f").query({query:I`query runtimeGetNetworkMetrics {
596
+ }`}));return e}async getNetworkMetrics(){let{runtimeGetNetworkMetrics:e}=k(await W(this,K,"f").query({query:I`query runtimeGetNetworkMetrics {
589
597
  runtimeGetNetworkMetrics
590
- }`}));return e}async restartHolochain(){let{runtimeRestartHolochain:e}=k(await W(this,Y,"f").mutate({mutation:I`mutation runtimeRestartHolochain {
598
+ }`}));return e}async restartHolochain(){let{runtimeRestartHolochain:e}=k(await W(this,K,"f").mutate({mutation:I`mutation runtimeRestartHolochain {
591
599
  runtimeRestartHolochain
592
- }`}));return e}async hcAddAgentInfos(e){let{runtimeHcAddAgentInfos:r}=k(await W(this,Y,"f").mutate({mutation:I`mutation runtimeHcAddAgentInfos($agentInfos: String!) {
600
+ }`}));return e}async hcAddAgentInfos(e){let{runtimeHcAddAgentInfos:r}=k(await W(this,K,"f").mutate({mutation:I`mutation runtimeHcAddAgentInfos($agentInfos: String!) {
593
601
  runtimeHcAddAgentInfos(agentInfos: $agentInfos)
594
- }`,variables:{agentInfos:e}}));return r}async verifyStringSignedByDid(e,r,n,i){let{runtimeVerifyStringSignedByDid:a}=k(await W(this,Y,"f").mutate({mutation:I`query runtimeVerifyStringSignedByDid($did: String!, $didSigningKeyId: String!, $data: String!, $signedData: String!) {
602
+ }`,variables:{agentInfos:e}}));return r}async verifyStringSignedByDid(e,r,n,i){let{runtimeVerifyStringSignedByDid:a}=k(await W(this,K,"f").mutate({mutation:I`query runtimeVerifyStringSignedByDid($did: String!, $didSigningKeyId: String!, $data: String!, $signedData: String!) {
595
603
  runtimeVerifyStringSignedByDid(did: $did, didSigningKeyId: $didSigningKeyId, data: $data, signedData: $signedData)
596
- }`,variables:{did:e,didSigningKeyId:r,data:n,signedData:i}}));return a}async setStatus(e){let{runtimeSetStatus:r}=k(await W(this,Y,"f").mutate({mutation:I`mutation runtimeSetStatus($status: PerspectiveInput!) {
604
+ }`,variables:{did:e,didSigningKeyId:r,data:n,signedData:i}}));return a}async setStatus(e){let{runtimeSetStatus:r}=k(await W(this,K,"f").mutate({mutation:I`mutation runtimeSetStatus($status: PerspectiveInput!) {
597
605
  runtimeSetStatus(status: $status)
598
- }`,variables:{status:e}}));return r}async friendStatus(e){let{runtimeFriendStatus:r}=k(await W(this,Y,"f").query({query:I`query runtimeFriendStatus($did: String!) {
599
- runtimeFriendStatus(did: $did) { ${No} }
600
- }`,variables:{did:e}}));return r}async friendSendMessage(e,r){let{runtimeFriendSendMessage:n}=k(await W(this,Y,"f").mutate({mutation:I`mutation runtimeFriendSendMessage($did: String!, $message: PerspectiveInput!) {
606
+ }`,variables:{status:e}}));return r}async friendStatus(e){let{runtimeFriendStatus:r}=k(await W(this,K,"f").query({query:I`query runtimeFriendStatus($did: String!) {
607
+ runtimeFriendStatus(did: $did) { ${$o} }
608
+ }`,variables:{did:e}}));return r}async friendSendMessage(e,r){let{runtimeFriendSendMessage:n}=k(await W(this,K,"f").mutate({mutation:I`mutation runtimeFriendSendMessage($did: String!, $message: PerspectiveInput!) {
601
609
  runtimeFriendSendMessage(did: $did, message: $message)
602
- }`,variables:{did:e,message:r}}));return n}async messageInbox(e){let{runtimeMessageInbox:r}=k(await W(this,Y,"f").query({query:I`query runtimeMessageInbox($filter: String) {
603
- runtimeMessageInbox(filter: $filter) { ${No} }
604
- }`,variables:{filter:e}}));return r}async messageOutbox(e){let{runtimeMessageOutbox:r}=k(await W(this,Y,"f").query({query:I`query runtimeMessageOutbox($filter: String) {
610
+ }`,variables:{did:e,message:r}}));return n}async messageInbox(e){let{runtimeMessageInbox:r}=k(await W(this,K,"f").query({query:I`query runtimeMessageInbox($filter: String) {
611
+ runtimeMessageInbox(filter: $filter) { ${$o} }
612
+ }`,variables:{filter:e}}));return r}async messageOutbox(e){let{runtimeMessageOutbox:r}=k(await W(this,K,"f").query({query:I`query runtimeMessageOutbox($filter: String) {
605
613
  runtimeMessageOutbox(filter: $filter) {
606
614
  recipient,
607
615
  message {
608
- ${No}
616
+ ${$o}
609
617
  }
610
618
  }
611
- }`,variables:{filter:e}}));return r}async requestInstallNotification(e){let{runtimeRequestInstallNotification:r}=k(await W(this,Y,"f").mutate({mutation:I`mutation runtimeRequestInstallNotification($notification: NotificationInput!) {
619
+ }`,variables:{filter:e}}));return r}async requestInstallNotification(e){let{runtimeRequestInstallNotification:r}=k(await W(this,K,"f").mutate({mutation:I`mutation runtimeRequestInstallNotification($notification: NotificationInput!) {
612
620
  runtimeRequestInstallNotification(notification: $notification)
613
- }`,variables:{notification:e}}));return r}async grantNotification(e){let{runtimeGrantNotification:r}=k(await W(this,Y,"f").mutate({mutation:I`mutation runtimeGrantNotification($id: String!) {
621
+ }`,variables:{notification:e}}));return r}async grantNotification(e){let{runtimeGrantNotification:r}=k(await W(this,K,"f").mutate({mutation:I`mutation runtimeGrantNotification($id: String!) {
614
622
  runtimeGrantNotification(id: $id)
615
- }`,variables:{id:e}}));return r}async exportDb(e){let{runtimeExportDb:r}=k(await W(this,Y,"f").mutate({mutation:I`mutation runtimeExportDb($filePath: String!) {
623
+ }`,variables:{id:e}}));return r}async exportDb(e){let{runtimeExportDb:r}=k(await W(this,K,"f").mutate({mutation:I`mutation runtimeExportDb($filePath: String!) {
616
624
  runtimeExportDb(filePath: $filePath)
617
- }`,variables:{filePath:e}}));return r}async importDb(e){let{runtimeImportDb:r}=k(await W(this,Y,"f").mutate({mutation:I`mutation runtimeImportDb($filePath: String!) {
625
+ }`,variables:{filePath:e}}));return r}async importDb(e){let{runtimeImportDb:r}=k(await W(this,K,"f").mutate({mutation:I`mutation runtimeImportDb($filePath: String!) {
618
626
  runtimeImportDb(filePath: $filePath) {
619
627
  perspectives { total imported failed omitted errors }
620
628
  links { total imported failed omitted errors }
@@ -628,30 +636,41 @@ triggerMatch
628
636
  trustedAgents { total imported failed omitted errors }
629
637
  knownLinkLanguages { total imported failed omitted errors }
630
638
  }
631
- }`,variables:{filePath:e}}));return r}async notifications(){let{runtimeNotifications:e}=k(await W(this,Y,"f").query({query:I`query runtimeNotifications {
632
- runtimeNotifications { ${Ad} }
633
- }`}));return e}async updateNotification(e,r){let{runtimeUpdateNotification:n}=k(await W(this,Y,"f").mutate({mutation:I`mutation runtimeUpdateNotification($id: String!, $notification: NotificationInput!) {
639
+ }`,variables:{filePath:e}}));return r}async notifications(){let{runtimeNotifications:e}=k(await W(this,K,"f").query({query:I`query runtimeNotifications {
640
+ runtimeNotifications { ${Nd} }
641
+ }`}));return e}async updateNotification(e,r){let{runtimeUpdateNotification:n}=k(await W(this,K,"f").mutate({mutation:I`mutation runtimeUpdateNotification($id: String!, $notification: NotificationInput!) {
634
642
  runtimeUpdateNotification(id: $id, notification: $notification)
635
- }`,variables:{id:e,notification:r}}));return n}async removeNotification(e){let{runtimeRemoveNotification:r}=k(await W(this,Y,"f").mutate({mutation:I`mutation runtimeRemoveNotification($id: String!) {
643
+ }`,variables:{id:e,notification:r}}));return n}async removeNotification(e){let{runtimeRemoveNotification:r}=k(await W(this,K,"f").mutate({mutation:I`mutation runtimeRemoveNotification($id: String!) {
636
644
  runtimeRemoveNotification(id: $id)
637
- }`,variables:{id:e}}));return r}async exportPerspective(e,r){let{runtimeExportPerspective:n}=k(await W(this,Y,"f").mutate({mutation:I`mutation runtimeExportPerspective($perspectiveUuid: String!, $filePath: String!) {
645
+ }`,variables:{id:e}}));return r}async exportPerspective(e,r){let{runtimeExportPerspective:n}=k(await W(this,K,"f").mutate({mutation:I`mutation runtimeExportPerspective($perspectiveUuid: String!, $filePath: String!) {
638
646
  runtimeExportPerspective(perspectiveUuid: $perspectiveUuid, filePath: $filePath)
639
- }`,variables:{perspectiveUuid:e,filePath:r}}));return n}async importPerspective(e){let{runtimeImportPerspective:r}=k(await W(this,Y,"f").mutate({mutation:I`mutation runtimeImportPerspective($filePath: String!) {
647
+ }`,variables:{perspectiveUuid:e,filePath:r}}));return n}async importPerspective(e){let{runtimeImportPerspective:r}=k(await W(this,K,"f").mutate({mutation:I`mutation runtimeImportPerspective($filePath: String!) {
640
648
  runtimeImportPerspective(filePath: $filePath)
641
- }`,variables:{filePath:e}}));return r}addNotificationTriggeredCallback(e){W(this,la,"f").push(e)}subscribeNotificationTriggered(){W(this,Y,"f").subscribe({query:I` subscription {
642
- runtimeNotificationTriggered { ${vg} }
649
+ }`,variables:{filePath:e}}));return r}async multiUserEnabled(){let{runtimeMultiUserEnabled:e}=k(await W(this,K,"f").query({query:I`query runtimeMultiUserEnabled {
650
+ runtimeMultiUserEnabled
651
+ }`}));return e}async setMultiUserEnabled(e){let{runtimeSetMultiUserEnabled:r}=k(await W(this,K,"f").mutate({mutation:I`mutation runtimeSetMultiUserEnabled($enabled: Boolean!) {
652
+ runtimeSetMultiUserEnabled(enabled: $enabled)
653
+ }`,variables:{enabled:e}}));return r}async listUsers(){let{runtimeListUsers:e}=k(await W(this,K,"f").query({query:I`query runtimeListUsers {
654
+ runtimeListUsers {
655
+ email
656
+ did
657
+ lastSeen
658
+ perspectiveCount
659
+ }
660
+ }`}));return e}addNotificationTriggeredCallback(e){W(this,pa,"f").push(e)}subscribeNotificationTriggered(){W(this,K,"f").subscribe({query:I` subscription {
661
+ runtimeNotificationTriggered { ${_y} }
643
662
  }
644
- `}).subscribe({next:e=>{W(this,la,"f").forEach(r=>{r(e.data.runtimeNotificationTriggered)})},error:e=>console.error(e)})}addMessageCallback(e){W(this,ca,"f").push(e)}subscribeMessageReceived(){W(this,Y,"f").subscribe({query:I` subscription {
645
- runtimeMessageReceived { ${No} }
663
+ `}).subscribe({next:e=>{W(this,pa,"f").forEach(r=>{r(e.data.runtimeNotificationTriggered)})},error:e=>console.error(e)})}addMessageCallback(e){W(this,la,"f").push(e)}subscribeMessageReceived(){W(this,K,"f").subscribe({query:I` subscription {
664
+ runtimeMessageReceived { ${$o} }
646
665
  }
647
- `}).subscribe({next:e=>{W(this,ca,"f").forEach(r=>{r(e.data.runtimeMessageReceived)})},error:e=>console.error(e)})}addExceptionCallback(e){W(this,ua,"f").push(e)}subscribeExceptionOccurred(){W(this,Y,"f").subscribe({query:I` subscription {
666
+ `}).subscribe({next:e=>{W(this,la,"f").forEach(r=>{r(e.data.runtimeMessageReceived)})},error:e=>console.error(e)})}addExceptionCallback(e){W(this,fa,"f").push(e)}subscribeExceptionOccurred(){W(this,K,"f").subscribe({query:I` subscription {
648
667
  exceptionOccurred {
649
668
  title
650
669
  message
651
670
  type
652
671
  addon
653
672
  }
654
- }`}).subscribe({next:e=>{W(this,ua,"f").forEach(r=>{r(e.data.exceptionOccurred)})},error:e=>console.error(e)})}};Y=new WeakMap,ca=new WeakMap,ua=new WeakMap,la=new WeakMap,Od=new WeakMap;var bg=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},ei=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)},lr,Eu=class{constructor(e){lr.set(this,void 0),bg(this,lr,e,"f")}async get(e,r=!1){if(!r)try{let i=_t.fromUrl(e).get();if(typeof i=="object"&&i!==null&&"author"in i&&"timestamp"in i&&"data"in i&&"proof"in i)return i}catch{}let{expression:n}=k(await ei(this,lr,"f").query({query:I`query expression($url: String!) {
673
+ }`}).subscribe({next:e=>{W(this,fa,"f").forEach(r=>{r(e.data.exceptionOccurred)})},error:e=>console.error(e)})}};K=new WeakMap,la=new WeakMap,fa=new WeakMap,pa=new WeakMap,Dd=new WeakMap;var Sy=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},ei=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)},lr,ku=class{constructor(e){lr.set(this,void 0),Sy(this,lr,e,"f")}async get(e,r=!1){if(!r)try{let i=_t.fromUrl(e).get();if(typeof i=="object"&&i!==null&&"author"in i&&"timestamp"in i&&"data"in i&&"proof"in i)return i}catch{}let{expression:n}=k(await ei(this,lr,"f").query({query:I`query expression($url: String!) {
655
674
  expression(url: $url) {
656
675
  author
657
676
  timestamp
@@ -689,7 +708,7 @@ triggerMatch
689
708
  }
690
709
  }`,variables:{url:e}}));return r}async interact(e,r){let{expressionInteract:n}=k(await ei(this,lr,"f").mutate({mutation:I`mutation expressionInteract($url: String!, $interactionCall: InteractionCall!){
691
710
  expressionInteract(url: $url, interactionCall: $interactionCall)
692
- }`,variables:{url:e,interactionCall:r}}));return n}};lr=new WeakMap;var Ts={};Ts.byteLength=wg;Ts.toByteArray=Eg;Ts.fromByteArray=Tg;var Ht=[],kt=[],_g=typeof Uint8Array<"u"?Uint8Array:Array,Kc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(an=0,fp=Kc.length;an<fp;++an)Ht[an]=Kc[an],kt[Kc.charCodeAt(an)]=an;var an,fp;kt["-".charCodeAt(0)]=62;kt["_".charCodeAt(0)]=63;function Dd(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var n=r===e?0:4-r%4;return[r,n]}function wg(t){var e=Dd(t),r=e[0],n=e[1];return(r+n)*3/4-n}function Sg(t,e,r){return(e+r)*3/4-r}function Eg(t){var e,r=Dd(t),n=r[0],i=r[1],a=new _g(Sg(t,n,i)),o=0,s=i>0?n-4:n,u;for(u=0;u<s;u+=4)e=kt[t.charCodeAt(u)]<<18|kt[t.charCodeAt(u+1)]<<12|kt[t.charCodeAt(u+2)]<<6|kt[t.charCodeAt(u+3)],a[o++]=e>>16&255,a[o++]=e>>8&255,a[o++]=e&255;return i===2&&(e=kt[t.charCodeAt(u)]<<2|kt[t.charCodeAt(u+1)]>>4,a[o++]=e&255),i===1&&(e=kt[t.charCodeAt(u)]<<10|kt[t.charCodeAt(u+1)]<<4|kt[t.charCodeAt(u+2)]>>2,a[o++]=e>>8&255,a[o++]=e&255),a}function xg(t){return Ht[t>>18&63]+Ht[t>>12&63]+Ht[t>>6&63]+Ht[t&63]}function Ig(t,e,r){for(var n,i=[],a=e;a<r;a+=3)n=(t[a]<<16&16711680)+(t[a+1]<<8&65280)+(t[a+2]&255),i.push(xg(n));return i.join("")}function Tg(t){for(var e,r=t.length,n=r%3,i=[],a=16383,o=0,s=r-n;o<s;o+=a)i.push(Ig(t,o,o+a>s?s:o+a));return n===1?(e=t[r-1],i.push(Ht[e>>2]+Ht[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],i.push(Ht[e>>10]+Ht[e>>4&63]+Ht[e<<2&63]+"=")),i.join("")}var kg=4,pp=0,dp=1,Og=2;function bi(t){let e=t.length;for(;--e>=0;)t[e]=0}var Ag=0,Nd=1,Dg=2,Ng=3,Pg=258,Vu=29,La=256,xa=La+1+Vu,ci=30,Qu=19,Pd=2*xa+1,hn=15,Hc=16,Cg=7,zu=256,Cd=16,Rd=17,Ld=18,xu=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),Ko=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),Rg=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),Fd=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Lg=512,fr=new Array((xa+2)*2);bi(fr);var ga=new Array(ci*2);bi(ga);var Ia=new Array(Lg);bi(Ia);var Ta=new Array(Pg-Ng+1);bi(Ta);var Gu=new Array(Vu);bi(Gu);var ds=new Array(ci);bi(ds);function Jc(t,e,r,n,i){this.static_tree=t,this.extra_bits=e,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=t&&t.length}var $d,Md,jd;function Yc(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}var Ud=t=>t<256?Ia[t]:Ia[256+(t>>>7)],ka=(t,e)=>{t.pending_buf[t.pending++]=e&255,t.pending_buf[t.pending++]=e>>>8&255},dt=(t,e,r)=>{t.bi_valid>Hc-r?(t.bi_buf|=e<<t.bi_valid&65535,ka(t,t.bi_buf),t.bi_buf=e>>Hc-t.bi_valid,t.bi_valid+=r-Hc):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=r)},Jt=(t,e,r)=>{dt(t,r[e*2],r[e*2+1])},qd=(t,e)=>{let r=0;do r|=t&1,t>>>=1,r<<=1;while(--e>0);return r>>>1},Fg=t=>{t.bi_valid===16?(ka(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=t.bi_buf&255,t.bi_buf>>=8,t.bi_valid-=8)},$g=(t,e)=>{let r=e.dyn_tree,n=e.max_code,i=e.stat_desc.static_tree,a=e.stat_desc.has_stree,o=e.stat_desc.extra_bits,s=e.stat_desc.extra_base,u=e.stat_desc.max_length,c,l,d,p,f,h,y=0;for(p=0;p<=hn;p++)t.bl_count[p]=0;for(r[t.heap[t.heap_max]*2+1]=0,c=t.heap_max+1;c<Pd;c++)l=t.heap[c],p=r[r[l*2+1]*2+1]+1,p>u&&(p=u,y++),r[l*2+1]=p,!(l>n)&&(t.bl_count[p]++,f=0,l>=s&&(f=o[l-s]),h=r[l*2],t.opt_len+=h*(p+f),a&&(t.static_len+=h*(i[l*2+1]+f)));if(y!==0){do{for(p=u-1;t.bl_count[p]===0;)p--;t.bl_count[p]--,t.bl_count[p+1]+=2,t.bl_count[u]--,y-=2}while(y>0);for(p=u;p!==0;p--)for(l=t.bl_count[p];l!==0;)d=t.heap[--c],!(d>n)&&(r[d*2+1]!==p&&(t.opt_len+=(p-r[d*2+1])*r[d*2],r[d*2+1]=p),l--)}},Bd=(t,e,r)=>{let n=new Array(hn+1),i=0,a,o;for(a=1;a<=hn;a++)i=i+r[a-1]<<1,n[a]=i;for(o=0;o<=e;o++){let s=t[o*2+1];s!==0&&(t[o*2]=qd(n[s]++,s))}},Mg=()=>{let t,e,r,n,i,a=new Array(hn+1);for(r=0,n=0;n<Vu-1;n++)for(Gu[n]=r,t=0;t<1<<xu[n];t++)Ta[r++]=n;for(Ta[r-1]=n,i=0,n=0;n<16;n++)for(ds[n]=i,t=0;t<1<<Ko[n];t++)Ia[i++]=n;for(i>>=7;n<ci;n++)for(ds[n]=i<<7,t=0;t<1<<Ko[n]-7;t++)Ia[256+i++]=n;for(e=0;e<=hn;e++)a[e]=0;for(t=0;t<=143;)fr[t*2+1]=8,t++,a[8]++;for(;t<=255;)fr[t*2+1]=9,t++,a[9]++;for(;t<=279;)fr[t*2+1]=7,t++,a[7]++;for(;t<=287;)fr[t*2+1]=8,t++,a[8]++;for(Bd(fr,xa+1,a),t=0;t<ci;t++)ga[t*2+1]=5,ga[t*2]=qd(t,5);$d=new Jc(fr,xu,La+1,xa,hn),Md=new Jc(ga,Ko,0,ci,hn),jd=new Jc(new Array(0),Rg,0,Qu,Cg)},Vd=t=>{let e;for(e=0;e<xa;e++)t.dyn_ltree[e*2]=0;for(e=0;e<ci;e++)t.dyn_dtree[e*2]=0;for(e=0;e<Qu;e++)t.bl_tree[e*2]=0;t.dyn_ltree[zu*2]=1,t.opt_len=t.static_len=0,t.sym_next=t.matches=0},Qd=t=>{t.bi_valid>8?ka(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},hp=(t,e,r,n)=>{let i=e*2,a=r*2;return t[i]<t[a]||t[i]===t[a]&&n[e]<=n[r]},Zc=(t,e,r)=>{let n=t.heap[r],i=r<<1;for(;i<=t.heap_len&&(i<t.heap_len&&hp(e,t.heap[i+1],t.heap[i],t.depth)&&i++,!hp(e,n,t.heap[i],t.depth));)t.heap[r]=t.heap[i],r=i,i<<=1;t.heap[r]=n},mp=(t,e,r)=>{let n,i,a=0,o,s;if(t.sym_next!==0)do n=t.pending_buf[t.sym_buf+a++]&255,n+=(t.pending_buf[t.sym_buf+a++]&255)<<8,i=t.pending_buf[t.sym_buf+a++],n===0?Jt(t,i,e):(o=Ta[i],Jt(t,o+La+1,e),s=xu[o],s!==0&&(i-=Gu[o],dt(t,i,s)),n--,o=Ud(n),Jt(t,o,r),s=Ko[o],s!==0&&(n-=ds[o],dt(t,n,s)));while(a<t.sym_next);Jt(t,zu,e)},Iu=(t,e)=>{let r=e.dyn_tree,n=e.stat_desc.static_tree,i=e.stat_desc.has_stree,a=e.stat_desc.elems,o,s,u=-1,c;for(t.heap_len=0,t.heap_max=Pd,o=0;o<a;o++)r[o*2]!==0?(t.heap[++t.heap_len]=u=o,t.depth[o]=0):r[o*2+1]=0;for(;t.heap_len<2;)c=t.heap[++t.heap_len]=u<2?++u:0,r[c*2]=1,t.depth[c]=0,t.opt_len--,i&&(t.static_len-=n[c*2+1]);for(e.max_code=u,o=t.heap_len>>1;o>=1;o--)Zc(t,r,o);c=a;do o=t.heap[1],t.heap[1]=t.heap[t.heap_len--],Zc(t,r,1),s=t.heap[1],t.heap[--t.heap_max]=o,t.heap[--t.heap_max]=s,r[c*2]=r[o*2]+r[s*2],t.depth[c]=(t.depth[o]>=t.depth[s]?t.depth[o]:t.depth[s])+1,r[o*2+1]=r[s*2+1]=c,t.heap[1]=c++,Zc(t,r,1);while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],$g(t,e),Bd(r,u,t.bl_count)},yp=(t,e,r)=>{let n,i=-1,a,o=e[0*2+1],s=0,u=7,c=4;for(o===0&&(u=138,c=3),e[(r+1)*2+1]=65535,n=0;n<=r;n++)a=o,o=e[(n+1)*2+1],!(++s<u&&a===o)&&(s<c?t.bl_tree[a*2]+=s:a!==0?(a!==i&&t.bl_tree[a*2]++,t.bl_tree[Cd*2]++):s<=10?t.bl_tree[Rd*2]++:t.bl_tree[Ld*2]++,s=0,i=a,o===0?(u=138,c=3):a===o?(u=6,c=3):(u=7,c=4))},gp=(t,e,r)=>{let n,i=-1,a,o=e[0*2+1],s=0,u=7,c=4;for(o===0&&(u=138,c=3),n=0;n<=r;n++)if(a=o,o=e[(n+1)*2+1],!(++s<u&&a===o)){if(s<c)do Jt(t,a,t.bl_tree);while(--s!==0);else a!==0?(a!==i&&(Jt(t,a,t.bl_tree),s--),Jt(t,Cd,t.bl_tree),dt(t,s-3,2)):s<=10?(Jt(t,Rd,t.bl_tree),dt(t,s-3,3)):(Jt(t,Ld,t.bl_tree),dt(t,s-11,7));s=0,i=a,o===0?(u=138,c=3):a===o?(u=6,c=3):(u=7,c=4)}},jg=t=>{let e;for(yp(t,t.dyn_ltree,t.l_desc.max_code),yp(t,t.dyn_dtree,t.d_desc.max_code),Iu(t,t.bl_desc),e=Qu-1;e>=3&&t.bl_tree[Fd[e]*2+1]===0;e--);return t.opt_len+=3*(e+1)+5+5+4,e},Ug=(t,e,r,n)=>{let i;for(dt(t,e-257,5),dt(t,r-1,5),dt(t,n-4,4),i=0;i<n;i++)dt(t,t.bl_tree[Fd[i]*2+1],3);gp(t,t.dyn_ltree,e-1),gp(t,t.dyn_dtree,r-1)},qg=t=>{let e=4093624447,r;for(r=0;r<=31;r++,e>>>=1)if(e&1&&t.dyn_ltree[r*2]!==0)return pp;if(t.dyn_ltree[9*2]!==0||t.dyn_ltree[10*2]!==0||t.dyn_ltree[13*2]!==0)return dp;for(r=32;r<La;r++)if(t.dyn_ltree[r*2]!==0)return dp;return pp},vp=!1,Bg=t=>{vp||(Mg(),vp=!0),t.l_desc=new Yc(t.dyn_ltree,$d),t.d_desc=new Yc(t.dyn_dtree,Md),t.bl_desc=new Yc(t.bl_tree,jd),t.bi_buf=0,t.bi_valid=0,Vd(t)},zd=(t,e,r,n)=>{dt(t,(Ag<<1)+(n?1:0),3),Qd(t),ka(t,r),ka(t,~r),r&&t.pending_buf.set(t.window.subarray(e,e+r),t.pending),t.pending+=r},Vg=t=>{dt(t,Nd<<1,3),Jt(t,zu,fr),Fg(t)},Qg=(t,e,r,n)=>{let i,a,o=0;t.level>0?(t.strm.data_type===Og&&(t.strm.data_type=qg(t)),Iu(t,t.l_desc),Iu(t,t.d_desc),o=jg(t),i=t.opt_len+3+7>>>3,a=t.static_len+3+7>>>3,a<=i&&(i=a)):i=a=r+5,r+4<=i&&e!==-1?zd(t,e,r,n):t.strategy===kg||a===i?(dt(t,(Nd<<1)+(n?1:0),3),mp(t,fr,ga)):(dt(t,(Dg<<1)+(n?1:0),3),Ug(t,t.l_desc.max_code+1,t.d_desc.max_code+1,o+1),mp(t,t.dyn_ltree,t.dyn_dtree)),Vd(t),n&&Qd(t)},zg=(t,e,r)=>(t.pending_buf[t.sym_buf+t.sym_next++]=e,t.pending_buf[t.sym_buf+t.sym_next++]=e>>8,t.pending_buf[t.sym_buf+t.sym_next++]=r,e===0?t.dyn_ltree[r*2]++:(t.matches++,e--,t.dyn_ltree[(Ta[r]+La+1)*2]++,t.dyn_dtree[Ud(e)*2]++),t.sym_next===t.sym_end),Gg=Bg,Wg=zd,Kg=Qg,Hg=zg,Jg=Vg,Yg={_tr_init:Gg,_tr_stored_block:Wg,_tr_flush_block:Kg,_tr_tally:Hg,_tr_align:Jg},Zg=(t,e,r,n)=>{let i=t&65535|0,a=t>>>16&65535|0,o=0;for(;r!==0;){o=r>2e3?2e3:r,r-=o;do i=i+e[n++]|0,a=a+i|0;while(--o);i%=65521,a%=65521}return i|a<<16|0},Oa=Zg,Xg=()=>{let t,e=[];for(var r=0;r<256;r++){t=r;for(var n=0;n<8;n++)t=t&1?3988292384^t>>>1:t>>>1;e[r]=t}return e},ev=new Uint32Array(Xg()),tv=(t,e,r,n)=>{let i=ev,a=n+r;t^=-1;for(let o=n;o<a;o++)t=t>>>8^i[(t^e[o])&255];return t^-1},Ue=tv,En={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},Pn={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8},{_tr_init:rv,_tr_stored_block:Tu,_tr_flush_block:nv,_tr_tally:Fr,_tr_align:iv}=Yg,{Z_NO_FLUSH:$r,Z_PARTIAL_FLUSH:av,Z_FULL_FLUSH:ov,Z_FINISH:At,Z_BLOCK:bp,Z_OK:Ke,Z_STREAM_END:_p,Z_STREAM_ERROR:Zt,Z_DATA_ERROR:sv,Z_BUF_ERROR:Xc,Z_DEFAULT_COMPRESSION:cv,Z_FILTERED:uv,Z_HUFFMAN_ONLY:Po,Z_RLE:lv,Z_FIXED:fv,Z_DEFAULT_STRATEGY:pv,Z_UNKNOWN:dv,Z_DEFLATED:ks}=Pn,hv=9,mv=15,yv=8,gv=29,vv=256,ku=vv+1+gv,bv=30,_v=19,wv=2*ku+1,Sv=15,te=3,Pr=258,Xt=Pr+te+1,Ev=32,pi=42,Wu=57,Ou=69,Au=73,Du=91,Nu=103,mn=113,fa=666,at=1,_i=2,xn=3,wi=4,xv=3,yn=(t,e)=>(t.msg=En[e],e),wp=t=>t*2-(t>4?9:0),Nr=t=>{let e=t.length;for(;--e>=0;)t[e]=0},Iv=t=>{let e,r,n,i=t.w_size;e=t.hash_size,n=e;do r=t.head[--n],t.head[n]=r>=i?r-i:0;while(--e);e=i,n=e;do r=t.prev[--n],t.prev[n]=r>=i?r-i:0;while(--e)},Tv=(t,e,r)=>(e<<t.hash_shift^r)&t.hash_mask,Mr=Tv,gt=t=>{let e=t.state,r=e.pending;r>t.avail_out&&(r=t.avail_out),r!==0&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+r),t.next_out),t.next_out+=r,e.pending_out+=r,t.total_out+=r,t.avail_out-=r,e.pending-=r,e.pending===0&&(e.pending_out=0))},bt=(t,e)=>{nv(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,gt(t.strm)},se=(t,e)=>{t.pending_buf[t.pending++]=e},Wi=(t,e)=>{t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=e&255},Pu=(t,e,r,n)=>{let i=t.avail_in;return i>n&&(i=n),i===0?0:(t.avail_in-=i,e.set(t.input.subarray(t.next_in,t.next_in+i),r),t.state.wrap===1?t.adler=Oa(t.adler,e,i,r):t.state.wrap===2&&(t.adler=Ue(t.adler,e,i,r)),t.next_in+=i,t.total_in+=i,i)},Gd=(t,e)=>{let r=t.max_chain_length,n=t.strstart,i,a,o=t.prev_length,s=t.nice_match,u=t.strstart>t.w_size-Xt?t.strstart-(t.w_size-Xt):0,c=t.window,l=t.w_mask,d=t.prev,p=t.strstart+Pr,f=c[n+o-1],h=c[n+o];t.prev_length>=t.good_match&&(r>>=2),s>t.lookahead&&(s=t.lookahead);do if(i=e,!(c[i+o]!==h||c[i+o-1]!==f||c[i]!==c[n]||c[++i]!==c[n+1])){n+=2,i++;do;while(c[++n]===c[++i]&&c[++n]===c[++i]&&c[++n]===c[++i]&&c[++n]===c[++i]&&c[++n]===c[++i]&&c[++n]===c[++i]&&c[++n]===c[++i]&&c[++n]===c[++i]&&n<p);if(a=Pr-(p-n),n=p-Pr,a>o){if(t.match_start=e,o=a,a>=s)break;f=c[n+o-1],h=c[n+o]}}while((e=d[e&l])>u&&--r!==0);return o<=t.lookahead?o:t.lookahead},di=t=>{let e=t.w_size,r,n,i;do{if(n=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-Xt)&&(t.window.set(t.window.subarray(e,e+e-n),0),t.match_start-=e,t.strstart-=e,t.block_start-=e,t.insert>t.strstart&&(t.insert=t.strstart),Iv(t),n+=e),t.strm.avail_in===0)break;if(r=Pu(t.strm,t.window,t.strstart+t.lookahead,n),t.lookahead+=r,t.lookahead+t.insert>=te)for(i=t.strstart-t.insert,t.ins_h=t.window[i],t.ins_h=Mr(t,t.ins_h,t.window[i+1]);t.insert&&(t.ins_h=Mr(t,t.ins_h,t.window[i+te-1]),t.prev[i&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=i,i++,t.insert--,!(t.lookahead+t.insert<te)););}while(t.lookahead<Xt&&t.strm.avail_in!==0)},Wd=(t,e)=>{let r=t.pending_buf_size-5>t.w_size?t.w_size:t.pending_buf_size-5,n,i,a,o=0,s=t.strm.avail_in;do{if(n=65535,a=t.bi_valid+42>>3,t.strm.avail_out<a||(a=t.strm.avail_out-a,i=t.strstart-t.block_start,n>i+t.strm.avail_in&&(n=i+t.strm.avail_in),n>a&&(n=a),n<r&&(n===0&&e!==At||e===$r||n!==i+t.strm.avail_in)))break;o=e===At&&n===i+t.strm.avail_in?1:0,Tu(t,0,0,o),t.pending_buf[t.pending-4]=n,t.pending_buf[t.pending-3]=n>>8,t.pending_buf[t.pending-2]=~n,t.pending_buf[t.pending-1]=~n>>8,gt(t.strm),i&&(i>n&&(i=n),t.strm.output.set(t.window.subarray(t.block_start,t.block_start+i),t.strm.next_out),t.strm.next_out+=i,t.strm.avail_out-=i,t.strm.total_out+=i,t.block_start+=i,n-=i),n&&(Pu(t.strm,t.strm.output,t.strm.next_out,n),t.strm.next_out+=n,t.strm.avail_out-=n,t.strm.total_out+=n)}while(o===0);return s-=t.strm.avail_in,s&&(s>=t.w_size?(t.matches=2,t.window.set(t.strm.input.subarray(t.strm.next_in-t.w_size,t.strm.next_in),0),t.strstart=t.w_size,t.insert=t.strstart):(t.window_size-t.strstart<=s&&(t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,t.insert>t.strstart&&(t.insert=t.strstart)),t.window.set(t.strm.input.subarray(t.strm.next_in-s,t.strm.next_in),t.strstart),t.strstart+=s,t.insert+=s>t.w_size-t.insert?t.w_size-t.insert:s),t.block_start=t.strstart),t.high_water<t.strstart&&(t.high_water=t.strstart),o?wi:e!==$r&&e!==At&&t.strm.avail_in===0&&t.strstart===t.block_start?_i:(a=t.window_size-t.strstart,t.strm.avail_in>a&&t.block_start>=t.w_size&&(t.block_start-=t.w_size,t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,a+=t.w_size,t.insert>t.strstart&&(t.insert=t.strstart)),a>t.strm.avail_in&&(a=t.strm.avail_in),a&&(Pu(t.strm,t.window,t.strstart,a),t.strstart+=a,t.insert+=a>t.w_size-t.insert?t.w_size-t.insert:a),t.high_water<t.strstart&&(t.high_water=t.strstart),a=t.bi_valid+42>>3,a=t.pending_buf_size-a>65535?65535:t.pending_buf_size-a,r=a>t.w_size?t.w_size:a,i=t.strstart-t.block_start,(i>=r||(i||e===At)&&e!==$r&&t.strm.avail_in===0&&i<=a)&&(n=i>a?a:i,o=e===At&&t.strm.avail_in===0&&n===i?1:0,Tu(t,t.block_start,n,o),t.block_start+=n,gt(t.strm)),o?xn:at)},eu=(t,e)=>{let r,n;for(;;){if(t.lookahead<Xt){if(di(t),t.lookahead<Xt&&e===$r)return at;if(t.lookahead===0)break}if(r=0,t.lookahead>=te&&(t.ins_h=Mr(t,t.ins_h,t.window[t.strstart+te-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),r!==0&&t.strstart-r<=t.w_size-Xt&&(t.match_length=Gd(t,r)),t.match_length>=te)if(n=Fr(t,t.strstart-t.match_start,t.match_length-te),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=te){t.match_length--;do t.strstart++,t.ins_h=Mr(t,t.ins_h,t.window[t.strstart+te-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart;while(--t.match_length!==0);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=Mr(t,t.ins_h,t.window[t.strstart+1]);else n=Fr(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(bt(t,!1),t.strm.avail_out===0))return at}return t.insert=t.strstart<te-1?t.strstart:te-1,e===At?(bt(t,!0),t.strm.avail_out===0?xn:wi):t.sym_next&&(bt(t,!1),t.strm.avail_out===0)?at:_i},ti=(t,e)=>{let r,n,i;for(;;){if(t.lookahead<Xt){if(di(t),t.lookahead<Xt&&e===$r)return at;if(t.lookahead===0)break}if(r=0,t.lookahead>=te&&(t.ins_h=Mr(t,t.ins_h,t.window[t.strstart+te-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=te-1,r!==0&&t.prev_length<t.max_lazy_match&&t.strstart-r<=t.w_size-Xt&&(t.match_length=Gd(t,r),t.match_length<=5&&(t.strategy===uv||t.match_length===te&&t.strstart-t.match_start>4096)&&(t.match_length=te-1)),t.prev_length>=te&&t.match_length<=t.prev_length){i=t.strstart+t.lookahead-te,n=Fr(t,t.strstart-1-t.prev_match,t.prev_length-te),t.lookahead-=t.prev_length-1,t.prev_length-=2;do++t.strstart<=i&&(t.ins_h=Mr(t,t.ins_h,t.window[t.strstart+te-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart);while(--t.prev_length!==0);if(t.match_available=0,t.match_length=te-1,t.strstart++,n&&(bt(t,!1),t.strm.avail_out===0))return at}else if(t.match_available){if(n=Fr(t,0,t.window[t.strstart-1]),n&&bt(t,!1),t.strstart++,t.lookahead--,t.strm.avail_out===0)return at}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=Fr(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<te-1?t.strstart:te-1,e===At?(bt(t,!0),t.strm.avail_out===0?xn:wi):t.sym_next&&(bt(t,!1),t.strm.avail_out===0)?at:_i},kv=(t,e)=>{let r,n,i,a,o=t.window;for(;;){if(t.lookahead<=Pr){if(di(t),t.lookahead<=Pr&&e===$r)return at;if(t.lookahead===0)break}if(t.match_length=0,t.lookahead>=te&&t.strstart>0&&(i=t.strstart-1,n=o[i],n===o[++i]&&n===o[++i]&&n===o[++i])){a=t.strstart+Pr;do;while(n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&i<a);t.match_length=Pr-(a-i),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=te?(r=Fr(t,1,t.match_length-te),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=Fr(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&(bt(t,!1),t.strm.avail_out===0))return at}return t.insert=0,e===At?(bt(t,!0),t.strm.avail_out===0?xn:wi):t.sym_next&&(bt(t,!1),t.strm.avail_out===0)?at:_i},Ov=(t,e)=>{let r;for(;;){if(t.lookahead===0&&(di(t),t.lookahead===0)){if(e===$r)return at;break}if(t.match_length=0,r=Fr(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(bt(t,!1),t.strm.avail_out===0))return at}return t.insert=0,e===At?(bt(t,!0),t.strm.avail_out===0?xn:wi):t.sym_next&&(bt(t,!1),t.strm.avail_out===0)?at:_i};function Gt(t,e,r,n,i){this.good_length=t,this.max_lazy=e,this.nice_length=r,this.max_chain=n,this.func=i}var pa=[new Gt(0,0,0,0,Wd),new Gt(4,4,8,4,eu),new Gt(4,5,16,8,eu),new Gt(4,6,32,32,eu),new Gt(4,4,16,16,ti),new Gt(8,16,32,32,ti),new Gt(8,16,128,128,ti),new Gt(8,32,128,256,ti),new Gt(32,128,258,1024,ti),new Gt(32,258,258,4096,ti)],Av=t=>{t.window_size=2*t.w_size,Nr(t.head),t.max_lazy_match=pa[t.level].max_lazy,t.good_match=pa[t.level].good_length,t.nice_match=pa[t.level].nice_length,t.max_chain_length=pa[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=te-1,t.match_available=0,t.ins_h=0};function Dv(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=ks,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(wv*2),this.dyn_dtree=new Uint16Array((2*bv+1)*2),this.bl_tree=new Uint16Array((2*_v+1)*2),Nr(this.dyn_ltree),Nr(this.dyn_dtree),Nr(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(Sv+1),this.heap=new Uint16Array(2*ku+1),Nr(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*ku+1),Nr(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}var Fa=t=>{if(!t)return 1;let e=t.state;return!e||e.strm!==t||e.status!==pi&&e.status!==Wu&&e.status!==Ou&&e.status!==Au&&e.status!==Du&&e.status!==Nu&&e.status!==mn&&e.status!==fa?1:0},Kd=t=>{if(Fa(t))return yn(t,Zt);t.total_in=t.total_out=0,t.data_type=dv;let e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap===2?Wu:e.wrap?pi:mn,t.adler=e.wrap===2?0:1,e.last_flush=-2,rv(e),Ke},Hd=t=>{let e=Kd(t);return e===Ke&&Av(t.state),e},Nv=(t,e)=>Fa(t)||t.state.wrap!==2?Zt:(t.state.gzhead=e,Ke),Jd=(t,e,r,n,i,a)=>{if(!t)return Zt;let o=1;if(e===cv&&(e=6),n<0?(o=0,n=-n):n>15&&(o=2,n-=16),i<1||i>hv||r!==ks||n<8||n>15||e<0||e>9||a<0||a>fv||n===8&&o!==1)return yn(t,Zt);n===8&&(n=9);let s=new Dv;return t.state=s,s.strm=t,s.status=pi,s.wrap=o,s.gzhead=null,s.w_bits=n,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=i+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+te-1)/te),s.window=new Uint8Array(s.w_size*2),s.head=new Uint16Array(s.hash_size),s.prev=new Uint16Array(s.w_size),s.lit_bufsize=1<<i+6,s.pending_buf_size=s.lit_bufsize*4,s.pending_buf=new Uint8Array(s.pending_buf_size),s.sym_buf=s.lit_bufsize,s.sym_end=(s.lit_bufsize-1)*3,s.level=e,s.strategy=a,s.method=r,Hd(t)},Pv=(t,e)=>Jd(t,e,ks,mv,yv,pv),Cv=(t,e)=>{if(Fa(t)||e>bp||e<0)return t?yn(t,Zt):Zt;let r=t.state;if(!t.output||t.avail_in!==0&&!t.input||r.status===fa&&e!==At)return yn(t,t.avail_out===0?Xc:Zt);let n=r.last_flush;if(r.last_flush=e,r.pending!==0){if(gt(t),t.avail_out===0)return r.last_flush=-1,Ke}else if(t.avail_in===0&&wp(e)<=wp(n)&&e!==At)return yn(t,Xc);if(r.status===fa&&t.avail_in!==0)return yn(t,Xc);if(r.status===pi&&r.wrap===0&&(r.status=mn),r.status===pi){let i=ks+(r.w_bits-8<<4)<<8,a=-1;if(r.strategy>=Po||r.level<2?a=0:r.level<6?a=1:r.level===6?a=2:a=3,i|=a<<6,r.strstart!==0&&(i|=Ev),i+=31-i%31,Wi(r,i),r.strstart!==0&&(Wi(r,t.adler>>>16),Wi(r,t.adler&65535)),t.adler=1,r.status=mn,gt(t),r.pending!==0)return r.last_flush=-1,Ke}if(r.status===Wu){if(t.adler=0,se(r,31),se(r,139),se(r,8),r.gzhead)se(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),se(r,r.gzhead.time&255),se(r,r.gzhead.time>>8&255),se(r,r.gzhead.time>>16&255),se(r,r.gzhead.time>>24&255),se(r,r.level===9?2:r.strategy>=Po||r.level<2?4:0),se(r,r.gzhead.os&255),r.gzhead.extra&&r.gzhead.extra.length&&(se(r,r.gzhead.extra.length&255),se(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=Ue(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=Ou;else if(se(r,0),se(r,0),se(r,0),se(r,0),se(r,0),se(r,r.level===9?2:r.strategy>=Po||r.level<2?4:0),se(r,xv),r.status=mn,gt(t),r.pending!==0)return r.last_flush=-1,Ke}if(r.status===Ou){if(r.gzhead.extra){let i=r.pending,a=(r.gzhead.extra.length&65535)-r.gzindex;for(;r.pending+a>r.pending_buf_size;){let s=r.pending_buf_size-r.pending;if(r.pending_buf.set(r.gzhead.extra.subarray(r.gzindex,r.gzindex+s),r.pending),r.pending=r.pending_buf_size,r.gzhead.hcrc&&r.pending>i&&(t.adler=Ue(t.adler,r.pending_buf,r.pending-i,i)),r.gzindex+=s,gt(t),r.pending!==0)return r.last_flush=-1,Ke;i=0,a-=s}let o=new Uint8Array(r.gzhead.extra);r.pending_buf.set(o.subarray(r.gzindex,r.gzindex+a),r.pending),r.pending+=a,r.gzhead.hcrc&&r.pending>i&&(t.adler=Ue(t.adler,r.pending_buf,r.pending-i,i)),r.gzindex=0}r.status=Au}if(r.status===Au){if(r.gzhead.name){let i=r.pending,a;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>i&&(t.adler=Ue(t.adler,r.pending_buf,r.pending-i,i)),gt(t),r.pending!==0)return r.last_flush=-1,Ke;i=0}r.gzindex<r.gzhead.name.length?a=r.gzhead.name.charCodeAt(r.gzindex++)&255:a=0,se(r,a)}while(a!==0);r.gzhead.hcrc&&r.pending>i&&(t.adler=Ue(t.adler,r.pending_buf,r.pending-i,i)),r.gzindex=0}r.status=Du}if(r.status===Du){if(r.gzhead.comment){let i=r.pending,a;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>i&&(t.adler=Ue(t.adler,r.pending_buf,r.pending-i,i)),gt(t),r.pending!==0)return r.last_flush=-1,Ke;i=0}r.gzindex<r.gzhead.comment.length?a=r.gzhead.comment.charCodeAt(r.gzindex++)&255:a=0,se(r,a)}while(a!==0);r.gzhead.hcrc&&r.pending>i&&(t.adler=Ue(t.adler,r.pending_buf,r.pending-i,i))}r.status=Nu}if(r.status===Nu){if(r.gzhead.hcrc){if(r.pending+2>r.pending_buf_size&&(gt(t),r.pending!==0))return r.last_flush=-1,Ke;se(r,t.adler&255),se(r,t.adler>>8&255),t.adler=0}if(r.status=mn,gt(t),r.pending!==0)return r.last_flush=-1,Ke}if(t.avail_in!==0||r.lookahead!==0||e!==$r&&r.status!==fa){let i=r.level===0?Wd(r,e):r.strategy===Po?Ov(r,e):r.strategy===lv?kv(r,e):pa[r.level].func(r,e);if((i===xn||i===wi)&&(r.status=fa),i===at||i===xn)return t.avail_out===0&&(r.last_flush=-1),Ke;if(i===_i&&(e===av?iv(r):e!==bp&&(Tu(r,0,0,!1),e===ov&&(Nr(r.head),r.lookahead===0&&(r.strstart=0,r.block_start=0,r.insert=0))),gt(t),t.avail_out===0))return r.last_flush=-1,Ke}return e!==At?Ke:r.wrap<=0?_p:(r.wrap===2?(se(r,t.adler&255),se(r,t.adler>>8&255),se(r,t.adler>>16&255),se(r,t.adler>>24&255),se(r,t.total_in&255),se(r,t.total_in>>8&255),se(r,t.total_in>>16&255),se(r,t.total_in>>24&255)):(Wi(r,t.adler>>>16),Wi(r,t.adler&65535)),gt(t),r.wrap>0&&(r.wrap=-r.wrap),r.pending!==0?Ke:_p)},Rv=t=>{if(Fa(t))return Zt;let e=t.state.status;return t.state=null,e===mn?yn(t,sv):Ke},Lv=(t,e)=>{let r=e.length;if(Fa(t))return Zt;let n=t.state,i=n.wrap;if(i===2||i===1&&n.status!==pi||n.lookahead)return Zt;if(i===1&&(t.adler=Oa(t.adler,e,r,0)),n.wrap=0,r>=n.w_size){i===0&&(Nr(n.head),n.strstart=0,n.block_start=0,n.insert=0);let u=new Uint8Array(n.w_size);u.set(e.subarray(r-n.w_size,r),0),e=u,r=n.w_size}let a=t.avail_in,o=t.next_in,s=t.input;for(t.avail_in=r,t.next_in=0,t.input=e,di(n);n.lookahead>=te;){let u=n.strstart,c=n.lookahead-(te-1);do n.ins_h=Mr(n,n.ins_h,n.window[u+te-1]),n.prev[u&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=u,u++;while(--c);n.strstart=u,n.lookahead=te-1,di(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=te-1,n.match_available=0,t.next_in=o,t.input=s,t.avail_in=a,n.wrap=i,Ke},Fv=Pv,$v=Jd,Mv=Hd,jv=Kd,Uv=Nv,qv=Cv,Bv=Rv,Vv=Lv,Qv="pako deflate (from Nodeca project)",va={deflateInit:Fv,deflateInit2:$v,deflateReset:Mv,deflateResetKeep:jv,deflateSetHeader:Uv,deflate:qv,deflateEnd:Bv,deflateSetDictionary:Vv,deflateInfo:Qv},zv=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),Gv=function(t){let e=Array.prototype.slice.call(arguments,1);for(;e.length;){let r=e.shift();if(!!r){if(typeof r!="object")throw new TypeError(r+"must be non-object");for(let n in r)zv(r,n)&&(t[n]=r[n])}}return t},Wv=t=>{let e=0;for(let n=0,i=t.length;n<i;n++)e+=t[n].length;let r=new Uint8Array(e);for(let n=0,i=0,a=t.length;n<a;n++){let o=t[n];r.set(o,i),i+=o.length}return r},Os={assign:Gv,flattenChunks:Wv},Yd=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){Yd=!1}var Aa=new Uint8Array(256);for(let t=0;t<256;t++)Aa[t]=t>=252?6:t>=248?5:t>=240?4:t>=224?3:t>=192?2:1;Aa[254]=Aa[254]=1;var Kv=t=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(t);let e,r,n,i,a,o=t.length,s=0;for(i=0;i<o;i++)r=t.charCodeAt(i),(r&64512)===55296&&i+1<o&&(n=t.charCodeAt(i+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),i++)),s+=r<128?1:r<2048?2:r<65536?3:4;for(e=new Uint8Array(s),a=0,i=0;a<s;i++)r=t.charCodeAt(i),(r&64512)===55296&&i+1<o&&(n=t.charCodeAt(i+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),i++)),r<128?e[a++]=r:r<2048?(e[a++]=192|r>>>6,e[a++]=128|r&63):r<65536?(e[a++]=224|r>>>12,e[a++]=128|r>>>6&63,e[a++]=128|r&63):(e[a++]=240|r>>>18,e[a++]=128|r>>>12&63,e[a++]=128|r>>>6&63,e[a++]=128|r&63);return e},Hv=(t,e)=>{if(e<65534&&t.subarray&&Yd)return String.fromCharCode.apply(null,t.length===e?t:t.subarray(0,e));let r="";for(let n=0;n<e;n++)r+=String.fromCharCode(t[n]);return r},Jv=(t,e)=>{let r=e||t.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(t.subarray(0,e));let n,i,a=new Array(r*2);for(i=0,n=0;n<r;){let o=t[n++];if(o<128){a[i++]=o;continue}let s=Aa[o];if(s>4){a[i++]=65533,n+=s-1;continue}for(o&=s===2?31:s===3?15:7;s>1&&n<r;)o=o<<6|t[n++]&63,s--;if(s>1){a[i++]=65533;continue}o<65536?a[i++]=o:(o-=65536,a[i++]=55296|o>>10&1023,a[i++]=56320|o&1023)}return Hv(a,i)},Yv=(t,e)=>{e=e||t.length,e>t.length&&(e=t.length);let r=e-1;for(;r>=0&&(t[r]&192)===128;)r--;return r<0||r===0?e:r+Aa[t[r]]>e?r:e},Da={string2buf:Kv,buf2string:Jv,utf8border:Yv};function Zv(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var Zd=Zv,Xd=Object.prototype.toString,{Z_NO_FLUSH:Xv,Z_SYNC_FLUSH:eb,Z_FULL_FLUSH:tb,Z_FINISH:rb,Z_OK:hs,Z_STREAM_END:nb,Z_DEFAULT_COMPRESSION:ib,Z_DEFAULT_STRATEGY:ab,Z_DEFLATED:ob}=Pn;function $a(t){this.options=Os.assign({level:ib,method:ob,chunkSize:16384,windowBits:15,memLevel:8,strategy:ab},t||{});let e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Zd,this.strm.avail_out=0;let r=va.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(r!==hs)throw new Error(En[r]);if(e.header&&va.deflateSetHeader(this.strm,e.header),e.dictionary){let n;if(typeof e.dictionary=="string"?n=Da.string2buf(e.dictionary):Xd.call(e.dictionary)==="[object ArrayBuffer]"?n=new Uint8Array(e.dictionary):n=e.dictionary,r=va.deflateSetDictionary(this.strm,n),r!==hs)throw new Error(En[r]);this._dict_set=!0}}$a.prototype.push=function(t,e){let r=this.strm,n=this.options.chunkSize,i,a;if(this.ended)return!1;for(e===~~e?a=e:a=e===!0?rb:Xv,typeof t=="string"?r.input=Da.string2buf(t):Xd.call(t)==="[object ArrayBuffer]"?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;){if(r.avail_out===0&&(r.output=new Uint8Array(n),r.next_out=0,r.avail_out=n),(a===eb||a===tb)&&r.avail_out<=6){this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;continue}if(i=va.deflate(r,a),i===nb)return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),i=va.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===hs;if(r.avail_out===0){this.onData(r.output);continue}if(a>0&&r.next_out>0){this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;continue}if(r.avail_in===0)break}return!0};$a.prototype.onData=function(t){this.chunks.push(t)};$a.prototype.onEnd=function(t){t===hs&&(this.result=Os.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function Ku(t,e){let r=new $a(e);if(r.push(t,!0),r.err)throw r.msg||En[r.err];return r.result}function sb(t,e){return e=e||{},e.raw=!0,Ku(t,e)}function cb(t,e){return e=e||{},e.gzip=!0,Ku(t,e)}var ub=$a,lb=Ku,fb=sb,pb=cb,db=Pn,hb={Deflate:ub,deflate:lb,deflateRaw:fb,gzip:pb,constants:db},Co=16209,mb=16191,yb=function t(e,r){let n,i,a,o,s,u,c,l,d,p,f,h,y,v,E,_,b,g,A,R,T,C,F,L,q=e.state;n=e.next_in,F=e.input,i=n+(e.avail_in-5),a=e.next_out,L=e.output,o=a-(r-e.avail_out),s=a+(e.avail_out-257),u=q.dmax,c=q.wsize,l=q.whave,d=q.wnext,p=q.window,f=q.hold,h=q.bits,y=q.lencode,v=q.distcode,E=(1<<q.lenbits)-1,_=(1<<q.distbits)-1;e:do{h<15&&(f+=F[n++]<<h,h+=8,f+=F[n++]<<h,h+=8),b=y[f&E];t:for(;;){if(g=b>>>24,f>>>=g,h-=g,g=b>>>16&255,g===0)L[a++]=b&65535;else if(g&16){A=b&65535,g&=15,g&&(h<g&&(f+=F[n++]<<h,h+=8),A+=f&(1<<g)-1,f>>>=g,h-=g),h<15&&(f+=F[n++]<<h,h+=8,f+=F[n++]<<h,h+=8),b=v[f&_];r:for(;;){if(g=b>>>24,f>>>=g,h-=g,g=b>>>16&255,g&16){if(R=b&65535,g&=15,h<g&&(f+=F[n++]<<h,h+=8,h<g&&(f+=F[n++]<<h,h+=8)),R+=f&(1<<g)-1,R>u){e.msg="invalid distance too far back",q.mode=Co;break e}if(f>>>=g,h-=g,g=a-o,R>g){if(g=R-g,g>l&&q.sane){e.msg="invalid distance too far back",q.mode=Co;break e}if(T=0,C=p,d===0){if(T+=c-g,g<A){A-=g;do L[a++]=p[T++];while(--g);T=a-R,C=L}}else if(d<g){if(T+=c+d-g,g-=d,g<A){A-=g;do L[a++]=p[T++];while(--g);if(T=0,d<A){g=d,A-=g;do L[a++]=p[T++];while(--g);T=a-R,C=L}}}else if(T+=d-g,g<A){A-=g;do L[a++]=p[T++];while(--g);T=a-R,C=L}for(;A>2;)L[a++]=C[T++],L[a++]=C[T++],L[a++]=C[T++],A-=3;A&&(L[a++]=C[T++],A>1&&(L[a++]=C[T++]))}else{T=a-R;do L[a++]=L[T++],L[a++]=L[T++],L[a++]=L[T++],A-=3;while(A>2);A&&(L[a++]=L[T++],A>1&&(L[a++]=L[T++]))}}else if((g&64)===0){b=v[(b&65535)+(f&(1<<g)-1)];continue r}else{e.msg="invalid distance code",q.mode=Co;break e}break}}else if((g&64)===0){b=y[(b&65535)+(f&(1<<g)-1)];continue t}else if(g&32){q.mode=mb;break e}else{e.msg="invalid literal/length code",q.mode=Co;break e}break}}while(n<i&&a<s);A=h>>3,n-=A,h-=A<<3,f&=(1<<h)-1,e.next_in=n,e.next_out=a,e.avail_in=n<i?5+(i-n):5-(n-i),e.avail_out=a<s?257+(s-a):257-(a-s),q.hold=f,q.bits=h},ri=15,Sp=852,Ep=592,xp=0,tu=1,Ip=2,gb=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),vb=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),bb=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),_b=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),wb=(t,e,r,n,i,a,o,s)=>{let u=s.bits,c=0,l=0,d=0,p=0,f=0,h=0,y=0,v=0,E=0,_=0,b,g,A,R,T,C=null,F,L=new Uint16Array(ri+1),q=new Uint16Array(ri+1),Ve=null,Pe,B,he;for(c=0;c<=ri;c++)L[c]=0;for(l=0;l<n;l++)L[e[r+l]]++;for(f=u,p=ri;p>=1&&L[p]===0;p--);if(f>p&&(f=p),p===0)return i[a++]=1<<24|64<<16|0,i[a++]=1<<24|64<<16|0,s.bits=1,0;for(d=1;d<p&&L[d]===0;d++);for(f<d&&(f=d),v=1,c=1;c<=ri;c++)if(v<<=1,v-=L[c],v<0)return-1;if(v>0&&(t===xp||p!==1))return-1;for(q[1]=0,c=1;c<ri;c++)q[c+1]=q[c]+L[c];for(l=0;l<n;l++)e[r+l]!==0&&(o[q[e[r+l]]++]=l);if(t===xp?(C=Ve=o,F=20):t===tu?(C=gb,Ve=vb,F=257):(C=bb,Ve=_b,F=0),_=0,l=0,c=d,T=a,h=f,y=0,A=-1,E=1<<f,R=E-1,t===tu&&E>Sp||t===Ip&&E>Ep)return 1;for(;;){Pe=c-y,o[l]+1<F?(B=0,he=o[l]):o[l]>=F?(B=Ve[o[l]-F],he=C[o[l]-F]):(B=32+64,he=0),b=1<<c-y,g=1<<h,d=g;do g-=b,i[T+(_>>y)+g]=Pe<<24|B<<16|he|0;while(g!==0);for(b=1<<c-1;_&b;)b>>=1;if(b!==0?(_&=b-1,_+=b):_=0,l++,--L[c]===0){if(c===p)break;c=e[r+o[l]]}if(c>f&&(_&R)!==A){for(y===0&&(y=f),T+=d,h=c-y,v=1<<h;h+y<p&&(v-=L[h+y],!(v<=0));)h++,v<<=1;if(E+=1<<h,t===tu&&E>Sp||t===Ip&&E>Ep)return 1;A=_&R,i[A]=f<<24|h<<16|T-a|0}}return _!==0&&(i[T+_]=c-y<<24|64<<16|0),s.bits=f,0},ba=wb,Sb=0,eh=1,th=2,{Z_FINISH:Tp,Z_BLOCK:Eb,Z_TREES:Ro,Z_OK:In,Z_STREAM_END:xb,Z_NEED_DICT:Ib,Z_STREAM_ERROR:Dt,Z_DATA_ERROR:rh,Z_MEM_ERROR:nh,Z_BUF_ERROR:Tb,Z_DEFLATED:kp}=Pn,As=16180,Op=16181,Ap=16182,Dp=16183,Np=16184,Pp=16185,Cp=16186,Rp=16187,Lp=16188,Fp=16189,ms=16190,sr=16191,ru=16192,$p=16193,nu=16194,Mp=16195,jp=16196,Up=16197,qp=16198,Lo=16199,Fo=16200,Bp=16201,Vp=16202,Qp=16203,zp=16204,Gp=16205,iu=16206,Wp=16207,Kp=16208,be=16209,ih=16210,ah=16211,kb=852,Ob=592,Ab=15,Db=Ab,Hp=t=>(t>>>24&255)+(t>>>8&65280)+((t&65280)<<8)+((t&255)<<24);function Nb(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}var Cn=t=>{if(!t)return 1;let e=t.state;return!e||e.strm!==t||e.mode<As||e.mode>ah?1:0},oh=t=>{if(Cn(t))return Dt;let e=t.state;return t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=e.wrap&1),e.mode=As,e.last=0,e.havedict=0,e.flags=-1,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(kb),e.distcode=e.distdyn=new Int32Array(Ob),e.sane=1,e.back=-1,In},sh=t=>{if(Cn(t))return Dt;let e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,oh(t)},ch=(t,e)=>{let r;if(Cn(t))return Dt;let n=t.state;return e<0?(r=0,e=-e):(r=(e>>4)+5,e<48&&(e&=15)),e&&(e<8||e>15)?Dt:(n.window!==null&&n.wbits!==e&&(n.window=null),n.wrap=r,n.wbits=e,sh(t))},uh=(t,e)=>{if(!t)return Dt;let r=new Nb;t.state=r,r.strm=t,r.window=null,r.mode=As;let n=ch(t,e);return n!==In&&(t.state=null),n},Pb=t=>uh(t,Db),Jp=!0,au,ou,Cb=t=>{if(Jp){au=new Int32Array(512),ou=new Int32Array(32);let e=0;for(;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(ba(eh,t.lens,0,288,au,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;ba(th,t.lens,0,32,ou,0,t.work,{bits:5}),Jp=!1}t.lencode=au,t.lenbits=9,t.distcode=ou,t.distbits=5},lh=(t,e,r,n)=>{let i,a=t.state;return a.window===null&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new Uint8Array(a.wsize)),n>=a.wsize?(a.window.set(e.subarray(r-a.wsize,r),0),a.wnext=0,a.whave=a.wsize):(i=a.wsize-a.wnext,i>n&&(i=n),a.window.set(e.subarray(r-n,r-n+i),a.wnext),n-=i,n?(a.window.set(e.subarray(r-n,r),0),a.wnext=n,a.whave=a.wsize):(a.wnext+=i,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=i))),0},Rb=(t,e)=>{let r,n,i,a,o,s,u,c,l,d,p,f,h,y,v=0,E,_,b,g,A,R,T,C,F=new Uint8Array(4),L,q,Ve=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Cn(t)||!t.output||!t.input&&t.avail_in!==0)return Dt;r=t.state,r.mode===sr&&(r.mode=ru),o=t.next_out,i=t.output,u=t.avail_out,a=t.next_in,n=t.input,s=t.avail_in,c=r.hold,l=r.bits,d=s,p=u,C=In;e:for(;;)switch(r.mode){case As:if(r.wrap===0){r.mode=ru;break}for(;l<16;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(r.wrap&2&&c===35615){r.wbits===0&&(r.wbits=15),r.check=0,F[0]=c&255,F[1]=c>>>8&255,r.check=Ue(r.check,F,2,0),c=0,l=0,r.mode=Op;break}if(r.head&&(r.head.done=!1),!(r.wrap&1)||(((c&255)<<8)+(c>>8))%31){t.msg="incorrect header check",r.mode=be;break}if((c&15)!==kp){t.msg="unknown compression method",r.mode=be;break}if(c>>>=4,l-=4,T=(c&15)+8,r.wbits===0&&(r.wbits=T),T>15||T>r.wbits){t.msg="invalid window size",r.mode=be;break}r.dmax=1<<r.wbits,r.flags=0,t.adler=r.check=1,r.mode=c&512?Fp:sr,c=0,l=0;break;case Op:for(;l<16;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(r.flags=c,(r.flags&255)!==kp){t.msg="unknown compression method",r.mode=be;break}if(r.flags&57344){t.msg="unknown header flags set",r.mode=be;break}r.head&&(r.head.text=c>>8&1),r.flags&512&&r.wrap&4&&(F[0]=c&255,F[1]=c>>>8&255,r.check=Ue(r.check,F,2,0)),c=0,l=0,r.mode=Ap;case Ap:for(;l<32;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}r.head&&(r.head.time=c),r.flags&512&&r.wrap&4&&(F[0]=c&255,F[1]=c>>>8&255,F[2]=c>>>16&255,F[3]=c>>>24&255,r.check=Ue(r.check,F,4,0)),c=0,l=0,r.mode=Dp;case Dp:for(;l<16;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}r.head&&(r.head.xflags=c&255,r.head.os=c>>8),r.flags&512&&r.wrap&4&&(F[0]=c&255,F[1]=c>>>8&255,r.check=Ue(r.check,F,2,0)),c=0,l=0,r.mode=Np;case Np:if(r.flags&1024){for(;l<16;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}r.length=c,r.head&&(r.head.extra_len=c),r.flags&512&&r.wrap&4&&(F[0]=c&255,F[1]=c>>>8&255,r.check=Ue(r.check,F,2,0)),c=0,l=0}else r.head&&(r.head.extra=null);r.mode=Pp;case Pp:if(r.flags&1024&&(f=r.length,f>s&&(f=s),f&&(r.head&&(T=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Uint8Array(r.head.extra_len)),r.head.extra.set(n.subarray(a,a+f),T)),r.flags&512&&r.wrap&4&&(r.check=Ue(r.check,n,f,a)),s-=f,a+=f,r.length-=f),r.length))break e;r.length=0,r.mode=Cp;case Cp:if(r.flags&2048){if(s===0)break e;f=0;do T=n[a+f++],r.head&&T&&r.length<65536&&(r.head.name+=String.fromCharCode(T));while(T&&f<s);if(r.flags&512&&r.wrap&4&&(r.check=Ue(r.check,n,f,a)),s-=f,a+=f,T)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=Rp;case Rp:if(r.flags&4096){if(s===0)break e;f=0;do T=n[a+f++],r.head&&T&&r.length<65536&&(r.head.comment+=String.fromCharCode(T));while(T&&f<s);if(r.flags&512&&r.wrap&4&&(r.check=Ue(r.check,n,f,a)),s-=f,a+=f,T)break e}else r.head&&(r.head.comment=null);r.mode=Lp;case Lp:if(r.flags&512){for(;l<16;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(r.wrap&4&&c!==(r.check&65535)){t.msg="header crc mismatch",r.mode=be;break}c=0,l=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),t.adler=r.check=0,r.mode=sr;break;case Fp:for(;l<32;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}t.adler=r.check=Hp(c),c=0,l=0,r.mode=ms;case ms:if(r.havedict===0)return t.next_out=o,t.avail_out=u,t.next_in=a,t.avail_in=s,r.hold=c,r.bits=l,Ib;t.adler=r.check=1,r.mode=sr;case sr:if(e===Eb||e===Ro)break e;case ru:if(r.last){c>>>=l&7,l-=l&7,r.mode=iu;break}for(;l<3;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}switch(r.last=c&1,c>>>=1,l-=1,c&3){case 0:r.mode=$p;break;case 1:if(Cb(r),r.mode=Lo,e===Ro){c>>>=2,l-=2;break e}break;case 2:r.mode=jp;break;case 3:t.msg="invalid block type",r.mode=be}c>>>=2,l-=2;break;case $p:for(c>>>=l&7,l-=l&7;l<32;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if((c&65535)!==(c>>>16^65535)){t.msg="invalid stored block lengths",r.mode=be;break}if(r.length=c&65535,c=0,l=0,r.mode=nu,e===Ro)break e;case nu:r.mode=Mp;case Mp:if(f=r.length,f){if(f>s&&(f=s),f>u&&(f=u),f===0)break e;i.set(n.subarray(a,a+f),o),s-=f,a+=f,u-=f,o+=f,r.length-=f;break}r.mode=sr;break;case jp:for(;l<14;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(r.nlen=(c&31)+257,c>>>=5,l-=5,r.ndist=(c&31)+1,c>>>=5,l-=5,r.ncode=(c&15)+4,c>>>=4,l-=4,r.nlen>286||r.ndist>30){t.msg="too many length or distance symbols",r.mode=be;break}r.have=0,r.mode=Up;case Up:for(;r.have<r.ncode;){for(;l<3;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}r.lens[Ve[r.have++]]=c&7,c>>>=3,l-=3}for(;r.have<19;)r.lens[Ve[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,L={bits:r.lenbits},C=ba(Sb,r.lens,0,19,r.lencode,0,r.work,L),r.lenbits=L.bits,C){t.msg="invalid code lengths set",r.mode=be;break}r.have=0,r.mode=qp;case qp:for(;r.have<r.nlen+r.ndist;){for(;v=r.lencode[c&(1<<r.lenbits)-1],E=v>>>24,_=v>>>16&255,b=v&65535,!(E<=l);){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(b<16)c>>>=E,l-=E,r.lens[r.have++]=b;else{if(b===16){for(q=E+2;l<q;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(c>>>=E,l-=E,r.have===0){t.msg="invalid bit length repeat",r.mode=be;break}T=r.lens[r.have-1],f=3+(c&3),c>>>=2,l-=2}else if(b===17){for(q=E+3;l<q;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}c>>>=E,l-=E,T=0,f=3+(c&7),c>>>=3,l-=3}else{for(q=E+7;l<q;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}c>>>=E,l-=E,T=0,f=11+(c&127),c>>>=7,l-=7}if(r.have+f>r.nlen+r.ndist){t.msg="invalid bit length repeat",r.mode=be;break}for(;f--;)r.lens[r.have++]=T}}if(r.mode===be)break;if(r.lens[256]===0){t.msg="invalid code -- missing end-of-block",r.mode=be;break}if(r.lenbits=9,L={bits:r.lenbits},C=ba(eh,r.lens,0,r.nlen,r.lencode,0,r.work,L),r.lenbits=L.bits,C){t.msg="invalid literal/lengths set",r.mode=be;break}if(r.distbits=6,r.distcode=r.distdyn,L={bits:r.distbits},C=ba(th,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,L),r.distbits=L.bits,C){t.msg="invalid distances set",r.mode=be;break}if(r.mode=Lo,e===Ro)break e;case Lo:r.mode=Fo;case Fo:if(s>=6&&u>=258){t.next_out=o,t.avail_out=u,t.next_in=a,t.avail_in=s,r.hold=c,r.bits=l,yb(t,p),o=t.next_out,i=t.output,u=t.avail_out,a=t.next_in,n=t.input,s=t.avail_in,c=r.hold,l=r.bits,r.mode===sr&&(r.back=-1);break}for(r.back=0;v=r.lencode[c&(1<<r.lenbits)-1],E=v>>>24,_=v>>>16&255,b=v&65535,!(E<=l);){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(_&&(_&240)===0){for(g=E,A=_,R=b;v=r.lencode[R+((c&(1<<g+A)-1)>>g)],E=v>>>24,_=v>>>16&255,b=v&65535,!(g+E<=l);){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}c>>>=g,l-=g,r.back+=g}if(c>>>=E,l-=E,r.back+=E,r.length=b,_===0){r.mode=Gp;break}if(_&32){r.back=-1,r.mode=sr;break}if(_&64){t.msg="invalid literal/length code",r.mode=be;break}r.extra=_&15,r.mode=Bp;case Bp:if(r.extra){for(q=r.extra;l<q;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}r.length+=c&(1<<r.extra)-1,c>>>=r.extra,l-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=Vp;case Vp:for(;v=r.distcode[c&(1<<r.distbits)-1],E=v>>>24,_=v>>>16&255,b=v&65535,!(E<=l);){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if((_&240)===0){for(g=E,A=_,R=b;v=r.distcode[R+((c&(1<<g+A)-1)>>g)],E=v>>>24,_=v>>>16&255,b=v&65535,!(g+E<=l);){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}c>>>=g,l-=g,r.back+=g}if(c>>>=E,l-=E,r.back+=E,_&64){t.msg="invalid distance code",r.mode=be;break}r.offset=b,r.extra=_&15,r.mode=Qp;case Qp:if(r.extra){for(q=r.extra;l<q;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}r.offset+=c&(1<<r.extra)-1,c>>>=r.extra,l-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){t.msg="invalid distance too far back",r.mode=be;break}r.mode=zp;case zp:if(u===0)break e;if(f=p-u,r.offset>f){if(f=r.offset-f,f>r.whave&&r.sane){t.msg="invalid distance too far back",r.mode=be;break}f>r.wnext?(f-=r.wnext,h=r.wsize-f):h=r.wnext-f,f>r.length&&(f=r.length),y=r.window}else y=i,h=o-r.offset,f=r.length;f>u&&(f=u),u-=f,r.length-=f;do i[o++]=y[h++];while(--f);r.length===0&&(r.mode=Fo);break;case Gp:if(u===0)break e;i[o++]=r.length,u--,r.mode=Fo;break;case iu:if(r.wrap){for(;l<32;){if(s===0)break e;s--,c|=n[a++]<<l,l+=8}if(p-=u,t.total_out+=p,r.total+=p,r.wrap&4&&p&&(t.adler=r.check=r.flags?Ue(r.check,i,p,o-p):Oa(r.check,i,p,o-p)),p=u,r.wrap&4&&(r.flags?c:Hp(c))!==r.check){t.msg="incorrect data check",r.mode=be;break}c=0,l=0}r.mode=Wp;case Wp:if(r.wrap&&r.flags){for(;l<32;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(r.wrap&4&&c!==(r.total&4294967295)){t.msg="incorrect length check",r.mode=be;break}c=0,l=0}r.mode=Kp;case Kp:C=xb;break e;case be:C=rh;break e;case ih:return nh;case ah:default:return Dt}return t.next_out=o,t.avail_out=u,t.next_in=a,t.avail_in=s,r.hold=c,r.bits=l,(r.wsize||p!==t.avail_out&&r.mode<be&&(r.mode<iu||e!==Tp))&&lh(t,t.output,t.next_out,p-t.avail_out),d-=t.avail_in,p-=t.avail_out,t.total_in+=d,t.total_out+=p,r.total+=p,r.wrap&4&&p&&(t.adler=r.check=r.flags?Ue(r.check,i,p,t.next_out-p):Oa(r.check,i,p,t.next_out-p)),t.data_type=r.bits+(r.last?64:0)+(r.mode===sr?128:0)+(r.mode===Lo||r.mode===nu?256:0),(d===0&&p===0||e===Tp)&&C===In&&(C=Tb),C},Lb=t=>{if(Cn(t))return Dt;let e=t.state;return e.window&&(e.window=null),t.state=null,In},Fb=(t,e)=>{if(Cn(t))return Dt;let r=t.state;return(r.wrap&2)===0?Dt:(r.head=e,e.done=!1,In)},$b=(t,e)=>{let r=e.length,n,i,a;return Cn(t)||(n=t.state,n.wrap!==0&&n.mode!==ms)?Dt:n.mode===ms&&(i=1,i=Oa(i,e,r,0),i!==n.check)?rh:(a=lh(t,e,r,r),a?(n.mode=ih,nh):(n.havedict=1,In))},Mb=sh,jb=ch,Ub=oh,qb=Pb,Bb=uh,Vb=Rb,Qb=Lb,zb=Fb,Gb=$b,Wb="pako inflate (from Nodeca project)",pr={inflateReset:Mb,inflateReset2:jb,inflateResetKeep:Ub,inflateInit:qb,inflateInit2:Bb,inflate:Vb,inflateEnd:Qb,inflateGetHeader:zb,inflateSetDictionary:Gb,inflateInfo:Wb};function Kb(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var Hb=Kb,fh=Object.prototype.toString,{Z_NO_FLUSH:Jb,Z_FINISH:Yb,Z_OK:Na,Z_STREAM_END:su,Z_NEED_DICT:cu,Z_STREAM_ERROR:Zb,Z_DATA_ERROR:Yp,Z_MEM_ERROR:Xb}=Pn;function Ma(t){this.options=Os.assign({chunkSize:1024*64,windowBits:15,to:""},t||{});let e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,e.windowBits===0&&(e.windowBits=-15)),e.windowBits>=0&&e.windowBits<16&&!(t&&t.windowBits)&&(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(e.windowBits&15)===0&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Zd,this.strm.avail_out=0;let r=pr.inflateInit2(this.strm,e.windowBits);if(r!==Na)throw new Error(En[r]);if(this.header=new Hb,pr.inflateGetHeader(this.strm,this.header),e.dictionary&&(typeof e.dictionary=="string"?e.dictionary=Da.string2buf(e.dictionary):fh.call(e.dictionary)==="[object ArrayBuffer]"&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(r=pr.inflateSetDictionary(this.strm,e.dictionary),r!==Na)))throw new Error(En[r])}Ma.prototype.push=function(t,e){let r=this.strm,n=this.options.chunkSize,i=this.options.dictionary,a,o,s;if(this.ended)return!1;for(e===~~e?o=e:o=e===!0?Yb:Jb,fh.call(t)==="[object ArrayBuffer]"?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;){for(r.avail_out===0&&(r.output=new Uint8Array(n),r.next_out=0,r.avail_out=n),a=pr.inflate(r,o),a===cu&&i&&(a=pr.inflateSetDictionary(r,i),a===Na?a=pr.inflate(r,o):a===Yp&&(a=cu));r.avail_in>0&&a===su&&r.state.wrap>0&&t[r.next_in]!==0;)pr.inflateReset(r),a=pr.inflate(r,o);switch(a){case Zb:case Yp:case cu:case Xb:return this.onEnd(a),this.ended=!0,!1}if(s=r.avail_out,r.next_out&&(r.avail_out===0||a===su))if(this.options.to==="string"){let u=Da.utf8border(r.output,r.next_out),c=r.next_out-u,l=Da.buf2string(r.output,u);r.next_out=c,r.avail_out=n-c,c&&r.output.set(r.output.subarray(u,u+c),0),this.onData(l)}else this.onData(r.output.length===r.next_out?r.output:r.output.subarray(0,r.next_out));if(!(a===Na&&s===0)){if(a===su)return a=pr.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,!0;if(r.avail_in===0)break}}return!0};Ma.prototype.onData=function(t){this.chunks.push(t)};Ma.prototype.onEnd=function(t){t===Na&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Os.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function Hu(t,e){let r=new Ma(e);if(r.push(t),r.err)throw r.msg||En[r.err];return r.result}function e_(t,e){return e=e||{},e.raw=!0,Hu(t,e)}var t_=Ma,r_=Hu,n_=e_,i_=Hu,a_=Pn,o_={Inflate:t_,inflate:r_,inflateRaw:n_,ungzip:i_,constants:a_},{Deflate:s_,deflate:c_,deflateRaw:u_,gzip:l_}=hb,{Inflate:f_,inflate:p_,inflateRaw:d_,ungzip:h_}=o_,m_=s_,y_=c_,g_=u_,v_=l_,b_=f_,__=p_,w_=d_,S_=h_,E_=Pn,x_={Deflate:m_,deflate:y_,deflateRaw:g_,gzip:v_,Inflate:b_,inflate:__,inflateRaw:w_,ungzip:S_,constants:E_},ye=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},ge=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},ys=class{constructor(e,r){this.input=e,this.output=r}};ye([m(),ge("design:type",String)],ys.prototype,"input",void 0);ye([m(),ge("design:type",String)],ys.prototype,"output",void 0);ys=ye([Be(),ge("design:paramtypes",[String,String])],ys);var gs=class{constructor(e,r){this.input=e,this.output=r}};ye([m(),ge("design:type",String)],gs.prototype,"input",void 0);ye([m(),ge("design:type",String)],gs.prototype,"output",void 0);gs=ye([G(),ge("design:paramtypes",[String,String])],gs);var Vr=class{constructor(e,r,n,i,a){this.name=e,this.modelId=r,this.systemPrompt=n,this.promptExamples=i,this.metaData=a}};ye([m(),ge("design:type",String)],Vr.prototype,"name",void 0);ye([m(),ge("design:type",String)],Vr.prototype,"modelId",void 0);ye([m(),ge("design:type",String)],Vr.prototype,"systemPrompt",void 0);ye([m(),ge("design:type",Array)],Vr.prototype,"promptExamples",void 0);ye([m(),ge("design:type",String)],Vr.prototype,"metaData",void 0);Vr=ye([Be(),ge("design:paramtypes",[String,String,String,Array,String])],Vr);var tr=class{constructor(e,r,n,i,a,o,s,u){this.name=e,this.modelId=r,this.taskId=n,this.systemPrompt=i,this.promptExamples=a,this.metaData=o,this.createdAt=s,this.updatedAt=u}};ye([m(),ge("design:type",String)],tr.prototype,"name",void 0);ye([m(),ge("design:type",String)],tr.prototype,"modelId",void 0);ye([m(),ge("design:type",String)],tr.prototype,"taskId",void 0);ye([m(),ge("design:type",String)],tr.prototype,"systemPrompt",void 0);ye([m(),ge("design:type",Array)],tr.prototype,"promptExamples",void 0);ye([m(),ge("design:type",String)],tr.prototype,"metaData",void 0);ye([m(),ge("design:type",String)],tr.prototype,"createdAt",void 0);ye([m(),ge("design:type",String)],tr.prototype,"updatedAt",void 0);tr=ye([G(),ge("design:paramtypes",[String,String,String,String,Array,String,String,String])],tr);var Tn=class{constructor(e,r,n,i,a){this.model=e,this.status=r,this.progress=n,this.downloaded=i,this.loaded=a}};ye([m(),ge("design:type",String)],Tn.prototype,"model",void 0);ye([m(),ge("design:type",String)],Tn.prototype,"status",void 0);ye([m(),ge("design:type",Number)],Tn.prototype,"progress",void 0);ye([m(),ge("design:type",Boolean)],Tn.prototype,"downloaded",void 0);ye([m(),ge("design:type",Boolean)],Tn.prototype,"loaded",void 0);Tn=ye([G(),ge("design:paramtypes",[String,String,Number,Boolean,Boolean])],Tn);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},Me=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,Ho,Cu=class{constructor(e,r=!0){Le.set(this,void 0),Ho.set(this,new Map),I_(this,Le,e,"f")}async getModels(){let e=await Me(this,Le,"f").query({query:I`
711
+ }`,variables:{url:e,interactionCall:r}}));return n}};lr=new WeakMap;var Ds={};Ds.byteLength=Ey;Ds.toByteArray=Iy;Ds.fromByteArray=Oy;var Ht=[],Ot=[],wy=typeof Uint8Array<"u"?Uint8Array:Array,Zc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(an=0,pp=Zc.length;an<pp;++an)Ht[an]=Zc[an],Ot[Zc.charCodeAt(an)]=an;var an,pp;Ot["-".charCodeAt(0)]=62;Ot["_".charCodeAt(0)]=63;function Pd(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var n=r===e?0:4-r%4;return[r,n]}function Ey(t){var e=Pd(t),r=e[0],n=e[1];return(r+n)*3/4-n}function xy(t,e,r){return(e+r)*3/4-r}function Iy(t){var e,r=Pd(t),n=r[0],i=r[1],a=new wy(xy(t,n,i)),o=0,s=i>0?n-4:n,u;for(u=0;u<s;u+=4)e=Ot[t.charCodeAt(u)]<<18|Ot[t.charCodeAt(u+1)]<<12|Ot[t.charCodeAt(u+2)]<<6|Ot[t.charCodeAt(u+3)],a[o++]=e>>16&255,a[o++]=e>>8&255,a[o++]=e&255;return i===2&&(e=Ot[t.charCodeAt(u)]<<2|Ot[t.charCodeAt(u+1)]>>4,a[o++]=e&255),i===1&&(e=Ot[t.charCodeAt(u)]<<10|Ot[t.charCodeAt(u+1)]<<4|Ot[t.charCodeAt(u+2)]>>2,a[o++]=e>>8&255,a[o++]=e&255),a}function Ty(t){return Ht[t>>18&63]+Ht[t>>12&63]+Ht[t>>6&63]+Ht[t&63]}function ky(t,e,r){for(var n,i=[],a=e;a<r;a+=3)n=(t[a]<<16&16711680)+(t[a+1]<<8&65280)+(t[a+2]&255),i.push(Ty(n));return i.join("")}function Oy(t){for(var e,r=t.length,n=r%3,i=[],a=16383,o=0,s=r-n;o<s;o+=a)i.push(ky(t,o,o+a>s?s:o+a));return n===1?(e=t[r-1],i.push(Ht[e>>2]+Ht[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],i.push(Ht[e>>10]+Ht[e>>4&63]+Ht[e<<2&63]+"=")),i.join("")}var Ay=4,dp=0,hp=1,Dy=2;function _i(t){let e=t.length;for(;--e>=0;)t[e]=0}var Ny=0,Cd=1,Py=2,Cy=3,Ry=258,Gu=29,ja=256,Oa=ja+1+Gu,ci=30,Wu=19,Rd=2*Oa+1,hn=15,Xc=16,Ly=7,Ku=256,Ld=16,Fd=17,$d=18,Ou=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),es=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),Fy=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),Md=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),$y=512,fr=new Array((Oa+2)*2);_i(fr);var ba=new Array(ci*2);_i(ba);var Aa=new Array($y);_i(Aa);var Da=new Array(Ry-Cy+1);_i(Da);var Hu=new Array(Gu);_i(Hu);var vs=new Array(ci);_i(vs);function eu(t,e,r,n,i){this.static_tree=t,this.extra_bits=e,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=t&&t.length}var Ud,jd,qd;function tu(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}var Bd=t=>t<256?Aa[t]:Aa[256+(t>>>7)],Na=(t,e)=>{t.pending_buf[t.pending++]=e&255,t.pending_buf[t.pending++]=e>>>8&255},dt=(t,e,r)=>{t.bi_valid>Xc-r?(t.bi_buf|=e<<t.bi_valid&65535,Na(t,t.bi_buf),t.bi_buf=e>>Xc-t.bi_valid,t.bi_valid+=r-Xc):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=r)},Jt=(t,e,r)=>{dt(t,r[e*2],r[e*2+1])},Vd=(t,e)=>{let r=0;do r|=t&1,t>>>=1,r<<=1;while(--e>0);return r>>>1},My=t=>{t.bi_valid===16?(Na(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=t.bi_buf&255,t.bi_buf>>=8,t.bi_valid-=8)},Uy=(t,e)=>{let r=e.dyn_tree,n=e.max_code,i=e.stat_desc.static_tree,a=e.stat_desc.has_stree,o=e.stat_desc.extra_bits,s=e.stat_desc.extra_base,u=e.stat_desc.max_length,c,l,d,p,f,m,y=0;for(p=0;p<=hn;p++)t.bl_count[p]=0;for(r[t.heap[t.heap_max]*2+1]=0,c=t.heap_max+1;c<Rd;c++)l=t.heap[c],p=r[r[l*2+1]*2+1]+1,p>u&&(p=u,y++),r[l*2+1]=p,!(l>n)&&(t.bl_count[p]++,f=0,l>=s&&(f=o[l-s]),m=r[l*2],t.opt_len+=m*(p+f),a&&(t.static_len+=m*(i[l*2+1]+f)));if(y!==0){do{for(p=u-1;t.bl_count[p]===0;)p--;t.bl_count[p]--,t.bl_count[p+1]+=2,t.bl_count[u]--,y-=2}while(y>0);for(p=u;p!==0;p--)for(l=t.bl_count[p];l!==0;)d=t.heap[--c],!(d>n)&&(r[d*2+1]!==p&&(t.opt_len+=(p-r[d*2+1])*r[d*2],r[d*2+1]=p),l--)}},Qd=(t,e,r)=>{let n=new Array(hn+1),i=0,a,o;for(a=1;a<=hn;a++)i=i+r[a-1]<<1,n[a]=i;for(o=0;o<=e;o++){let s=t[o*2+1];s!==0&&(t[o*2]=Vd(n[s]++,s))}},jy=()=>{let t,e,r,n,i,a=new Array(hn+1);for(r=0,n=0;n<Gu-1;n++)for(Hu[n]=r,t=0;t<1<<Ou[n];t++)Da[r++]=n;for(Da[r-1]=n,i=0,n=0;n<16;n++)for(vs[n]=i,t=0;t<1<<es[n];t++)Aa[i++]=n;for(i>>=7;n<ci;n++)for(vs[n]=i<<7,t=0;t<1<<es[n]-7;t++)Aa[256+i++]=n;for(e=0;e<=hn;e++)a[e]=0;for(t=0;t<=143;)fr[t*2+1]=8,t++,a[8]++;for(;t<=255;)fr[t*2+1]=9,t++,a[9]++;for(;t<=279;)fr[t*2+1]=7,t++,a[7]++;for(;t<=287;)fr[t*2+1]=8,t++,a[8]++;for(Qd(fr,Oa+1,a),t=0;t<ci;t++)ba[t*2+1]=5,ba[t*2]=Vd(t,5);Ud=new eu(fr,Ou,ja+1,Oa,hn),jd=new eu(ba,es,0,ci,hn),qd=new eu(new Array(0),Fy,0,Wu,Ly)},zd=t=>{let e;for(e=0;e<Oa;e++)t.dyn_ltree[e*2]=0;for(e=0;e<ci;e++)t.dyn_dtree[e*2]=0;for(e=0;e<Wu;e++)t.bl_tree[e*2]=0;t.dyn_ltree[Ku*2]=1,t.opt_len=t.static_len=0,t.sym_next=t.matches=0},Gd=t=>{t.bi_valid>8?Na(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},mp=(t,e,r,n)=>{let i=e*2,a=r*2;return t[i]<t[a]||t[i]===t[a]&&n[e]<=n[r]},ru=(t,e,r)=>{let n=t.heap[r],i=r<<1;for(;i<=t.heap_len&&(i<t.heap_len&&mp(e,t.heap[i+1],t.heap[i],t.depth)&&i++,!mp(e,n,t.heap[i],t.depth));)t.heap[r]=t.heap[i],r=i,i<<=1;t.heap[r]=n},gp=(t,e,r)=>{let n,i,a=0,o,s;if(t.sym_next!==0)do n=t.pending_buf[t.sym_buf+a++]&255,n+=(t.pending_buf[t.sym_buf+a++]&255)<<8,i=t.pending_buf[t.sym_buf+a++],n===0?Jt(t,i,e):(o=Da[i],Jt(t,o+ja+1,e),s=Ou[o],s!==0&&(i-=Hu[o],dt(t,i,s)),n--,o=Bd(n),Jt(t,o,r),s=es[o],s!==0&&(n-=vs[o],dt(t,n,s)));while(a<t.sym_next);Jt(t,Ku,e)},Au=(t,e)=>{let r=e.dyn_tree,n=e.stat_desc.static_tree,i=e.stat_desc.has_stree,a=e.stat_desc.elems,o,s,u=-1,c;for(t.heap_len=0,t.heap_max=Rd,o=0;o<a;o++)r[o*2]!==0?(t.heap[++t.heap_len]=u=o,t.depth[o]=0):r[o*2+1]=0;for(;t.heap_len<2;)c=t.heap[++t.heap_len]=u<2?++u:0,r[c*2]=1,t.depth[c]=0,t.opt_len--,i&&(t.static_len-=n[c*2+1]);for(e.max_code=u,o=t.heap_len>>1;o>=1;o--)ru(t,r,o);c=a;do o=t.heap[1],t.heap[1]=t.heap[t.heap_len--],ru(t,r,1),s=t.heap[1],t.heap[--t.heap_max]=o,t.heap[--t.heap_max]=s,r[c*2]=r[o*2]+r[s*2],t.depth[c]=(t.depth[o]>=t.depth[s]?t.depth[o]:t.depth[s])+1,r[o*2+1]=r[s*2+1]=c,t.heap[1]=c++,ru(t,r,1);while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],Uy(t,e),Qd(r,u,t.bl_count)},yp=(t,e,r)=>{let n,i=-1,a,o=e[0*2+1],s=0,u=7,c=4;for(o===0&&(u=138,c=3),e[(r+1)*2+1]=65535,n=0;n<=r;n++)a=o,o=e[(n+1)*2+1],!(++s<u&&a===o)&&(s<c?t.bl_tree[a*2]+=s:a!==0?(a!==i&&t.bl_tree[a*2]++,t.bl_tree[Ld*2]++):s<=10?t.bl_tree[Fd*2]++:t.bl_tree[$d*2]++,s=0,i=a,o===0?(u=138,c=3):a===o?(u=6,c=3):(u=7,c=4))},vp=(t,e,r)=>{let n,i=-1,a,o=e[0*2+1],s=0,u=7,c=4;for(o===0&&(u=138,c=3),n=0;n<=r;n++)if(a=o,o=e[(n+1)*2+1],!(++s<u&&a===o)){if(s<c)do Jt(t,a,t.bl_tree);while(--s!==0);else a!==0?(a!==i&&(Jt(t,a,t.bl_tree),s--),Jt(t,Ld,t.bl_tree),dt(t,s-3,2)):s<=10?(Jt(t,Fd,t.bl_tree),dt(t,s-3,3)):(Jt(t,$d,t.bl_tree),dt(t,s-11,7));s=0,i=a,o===0?(u=138,c=3):a===o?(u=6,c=3):(u=7,c=4)}},qy=t=>{let e;for(yp(t,t.dyn_ltree,t.l_desc.max_code),yp(t,t.dyn_dtree,t.d_desc.max_code),Au(t,t.bl_desc),e=Wu-1;e>=3&&t.bl_tree[Md[e]*2+1]===0;e--);return t.opt_len+=3*(e+1)+5+5+4,e},By=(t,e,r,n)=>{let i;for(dt(t,e-257,5),dt(t,r-1,5),dt(t,n-4,4),i=0;i<n;i++)dt(t,t.bl_tree[Md[i]*2+1],3);vp(t,t.dyn_ltree,e-1),vp(t,t.dyn_dtree,r-1)},Vy=t=>{let e=4093624447,r;for(r=0;r<=31;r++,e>>>=1)if(e&1&&t.dyn_ltree[r*2]!==0)return dp;if(t.dyn_ltree[9*2]!==0||t.dyn_ltree[10*2]!==0||t.dyn_ltree[13*2]!==0)return hp;for(r=32;r<ja;r++)if(t.dyn_ltree[r*2]!==0)return hp;return dp},bp=!1,Qy=t=>{bp||(jy(),bp=!0),t.l_desc=new tu(t.dyn_ltree,Ud),t.d_desc=new tu(t.dyn_dtree,jd),t.bl_desc=new tu(t.bl_tree,qd),t.bi_buf=0,t.bi_valid=0,zd(t)},Wd=(t,e,r,n)=>{dt(t,(Ny<<1)+(n?1:0),3),Gd(t),Na(t,r),Na(t,~r),r&&t.pending_buf.set(t.window.subarray(e,e+r),t.pending),t.pending+=r},zy=t=>{dt(t,Cd<<1,3),Jt(t,Ku,fr),My(t)},Gy=(t,e,r,n)=>{let i,a,o=0;t.level>0?(t.strm.data_type===Dy&&(t.strm.data_type=Vy(t)),Au(t,t.l_desc),Au(t,t.d_desc),o=qy(t),i=t.opt_len+3+7>>>3,a=t.static_len+3+7>>>3,a<=i&&(i=a)):i=a=r+5,r+4<=i&&e!==-1?Wd(t,e,r,n):t.strategy===Ay||a===i?(dt(t,(Cd<<1)+(n?1:0),3),gp(t,fr,ba)):(dt(t,(Py<<1)+(n?1:0),3),By(t,t.l_desc.max_code+1,t.d_desc.max_code+1,o+1),gp(t,t.dyn_ltree,t.dyn_dtree)),zd(t),n&&Gd(t)},Wy=(t,e,r)=>(t.pending_buf[t.sym_buf+t.sym_next++]=e,t.pending_buf[t.sym_buf+t.sym_next++]=e>>8,t.pending_buf[t.sym_buf+t.sym_next++]=r,e===0?t.dyn_ltree[r*2]++:(t.matches++,e--,t.dyn_ltree[(Da[r]+ja+1)*2]++,t.dyn_dtree[Bd(e)*2]++),t.sym_next===t.sym_end),Ky=Qy,Hy=Wd,Jy=Gy,Yy=Wy,Zy=zy,Xy={_tr_init:Ky,_tr_stored_block:Hy,_tr_flush_block:Jy,_tr_tally:Yy,_tr_align:Zy},ev=(t,e,r,n)=>{let i=t&65535|0,a=t>>>16&65535|0,o=0;for(;r!==0;){o=r>2e3?2e3:r,r-=o;do i=i+e[n++]|0,a=a+i|0;while(--o);i%=65521,a%=65521}return i|a<<16|0},Pa=ev,tv=()=>{let t,e=[];for(var r=0;r<256;r++){t=r;for(var n=0;n<8;n++)t=t&1?3988292384^t>>>1:t>>>1;e[r]=t}return e},rv=new Uint32Array(tv()),nv=(t,e,r,n)=>{let i=rv,a=n+r;t^=-1;for(let o=n;o<a;o++)t=t>>>8^i[(t^e[o])&255];return t^-1},je=nv,En={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},Pn={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8},{_tr_init:iv,_tr_stored_block:Du,_tr_flush_block:av,_tr_tally:Fr,_tr_align:ov}=Xy,{Z_NO_FLUSH:$r,Z_PARTIAL_FLUSH:sv,Z_FULL_FLUSH:cv,Z_FINISH:Dt,Z_BLOCK:_p,Z_OK:He,Z_STREAM_END:Sp,Z_STREAM_ERROR:Zt,Z_DATA_ERROR:uv,Z_BUF_ERROR:nu,Z_DEFAULT_COMPRESSION:lv,Z_FILTERED:fv,Z_HUFFMAN_ONLY:Mo,Z_RLE:pv,Z_FIXED:dv,Z_DEFAULT_STRATEGY:hv,Z_UNKNOWN:mv,Z_DEFLATED:Ns}=Pn,gv=9,yv=15,vv=8,bv=29,_v=256,Nu=_v+1+bv,Sv=30,wv=19,Ev=2*Nu+1,xv=15,te=3,Pr=258,Xt=Pr+te+1,Iv=32,pi=42,Ju=57,Pu=69,Cu=73,Ru=91,Lu=103,mn=113,da=666,at=1,Si=2,xn=3,wi=4,Tv=3,gn=(t,e)=>(t.msg=En[e],e),wp=t=>t*2-(t>4?9:0),Nr=t=>{let e=t.length;for(;--e>=0;)t[e]=0},kv=t=>{let e,r,n,i=t.w_size;e=t.hash_size,n=e;do r=t.head[--n],t.head[n]=r>=i?r-i:0;while(--e);e=i,n=e;do r=t.prev[--n],t.prev[n]=r>=i?r-i:0;while(--e)},Ov=(t,e,r)=>(e<<t.hash_shift^r)&t.hash_mask,Mr=Ov,yt=t=>{let e=t.state,r=e.pending;r>t.avail_out&&(r=t.avail_out),r!==0&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+r),t.next_out),t.next_out+=r,e.pending_out+=r,t.total_out+=r,t.avail_out-=r,e.pending-=r,e.pending===0&&(e.pending_out=0))},bt=(t,e)=>{av(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,yt(t.strm)},se=(t,e)=>{t.pending_buf[t.pending++]=e},Hi=(t,e)=>{t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=e&255},Fu=(t,e,r,n)=>{let i=t.avail_in;return i>n&&(i=n),i===0?0:(t.avail_in-=i,e.set(t.input.subarray(t.next_in,t.next_in+i),r),t.state.wrap===1?t.adler=Pa(t.adler,e,i,r):t.state.wrap===2&&(t.adler=je(t.adler,e,i,r)),t.next_in+=i,t.total_in+=i,i)},Kd=(t,e)=>{let r=t.max_chain_length,n=t.strstart,i,a,o=t.prev_length,s=t.nice_match,u=t.strstart>t.w_size-Xt?t.strstart-(t.w_size-Xt):0,c=t.window,l=t.w_mask,d=t.prev,p=t.strstart+Pr,f=c[n+o-1],m=c[n+o];t.prev_length>=t.good_match&&(r>>=2),s>t.lookahead&&(s=t.lookahead);do if(i=e,!(c[i+o]!==m||c[i+o-1]!==f||c[i]!==c[n]||c[++i]!==c[n+1])){n+=2,i++;do;while(c[++n]===c[++i]&&c[++n]===c[++i]&&c[++n]===c[++i]&&c[++n]===c[++i]&&c[++n]===c[++i]&&c[++n]===c[++i]&&c[++n]===c[++i]&&c[++n]===c[++i]&&n<p);if(a=Pr-(p-n),n=p-Pr,a>o){if(t.match_start=e,o=a,a>=s)break;f=c[n+o-1],m=c[n+o]}}while((e=d[e&l])>u&&--r!==0);return o<=t.lookahead?o:t.lookahead},di=t=>{let e=t.w_size,r,n,i;do{if(n=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-Xt)&&(t.window.set(t.window.subarray(e,e+e-n),0),t.match_start-=e,t.strstart-=e,t.block_start-=e,t.insert>t.strstart&&(t.insert=t.strstart),kv(t),n+=e),t.strm.avail_in===0)break;if(r=Fu(t.strm,t.window,t.strstart+t.lookahead,n),t.lookahead+=r,t.lookahead+t.insert>=te)for(i=t.strstart-t.insert,t.ins_h=t.window[i],t.ins_h=Mr(t,t.ins_h,t.window[i+1]);t.insert&&(t.ins_h=Mr(t,t.ins_h,t.window[i+te-1]),t.prev[i&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=i,i++,t.insert--,!(t.lookahead+t.insert<te)););}while(t.lookahead<Xt&&t.strm.avail_in!==0)},Hd=(t,e)=>{let r=t.pending_buf_size-5>t.w_size?t.w_size:t.pending_buf_size-5,n,i,a,o=0,s=t.strm.avail_in;do{if(n=65535,a=t.bi_valid+42>>3,t.strm.avail_out<a||(a=t.strm.avail_out-a,i=t.strstart-t.block_start,n>i+t.strm.avail_in&&(n=i+t.strm.avail_in),n>a&&(n=a),n<r&&(n===0&&e!==Dt||e===$r||n!==i+t.strm.avail_in)))break;o=e===Dt&&n===i+t.strm.avail_in?1:0,Du(t,0,0,o),t.pending_buf[t.pending-4]=n,t.pending_buf[t.pending-3]=n>>8,t.pending_buf[t.pending-2]=~n,t.pending_buf[t.pending-1]=~n>>8,yt(t.strm),i&&(i>n&&(i=n),t.strm.output.set(t.window.subarray(t.block_start,t.block_start+i),t.strm.next_out),t.strm.next_out+=i,t.strm.avail_out-=i,t.strm.total_out+=i,t.block_start+=i,n-=i),n&&(Fu(t.strm,t.strm.output,t.strm.next_out,n),t.strm.next_out+=n,t.strm.avail_out-=n,t.strm.total_out+=n)}while(o===0);return s-=t.strm.avail_in,s&&(s>=t.w_size?(t.matches=2,t.window.set(t.strm.input.subarray(t.strm.next_in-t.w_size,t.strm.next_in),0),t.strstart=t.w_size,t.insert=t.strstart):(t.window_size-t.strstart<=s&&(t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,t.insert>t.strstart&&(t.insert=t.strstart)),t.window.set(t.strm.input.subarray(t.strm.next_in-s,t.strm.next_in),t.strstart),t.strstart+=s,t.insert+=s>t.w_size-t.insert?t.w_size-t.insert:s),t.block_start=t.strstart),t.high_water<t.strstart&&(t.high_water=t.strstart),o?wi:e!==$r&&e!==Dt&&t.strm.avail_in===0&&t.strstart===t.block_start?Si:(a=t.window_size-t.strstart,t.strm.avail_in>a&&t.block_start>=t.w_size&&(t.block_start-=t.w_size,t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,a+=t.w_size,t.insert>t.strstart&&(t.insert=t.strstart)),a>t.strm.avail_in&&(a=t.strm.avail_in),a&&(Fu(t.strm,t.window,t.strstart,a),t.strstart+=a,t.insert+=a>t.w_size-t.insert?t.w_size-t.insert:a),t.high_water<t.strstart&&(t.high_water=t.strstart),a=t.bi_valid+42>>3,a=t.pending_buf_size-a>65535?65535:t.pending_buf_size-a,r=a>t.w_size?t.w_size:a,i=t.strstart-t.block_start,(i>=r||(i||e===Dt)&&e!==$r&&t.strm.avail_in===0&&i<=a)&&(n=i>a?a:i,o=e===Dt&&t.strm.avail_in===0&&n===i?1:0,Du(t,t.block_start,n,o),t.block_start+=n,yt(t.strm)),o?xn:at)},iu=(t,e)=>{let r,n;for(;;){if(t.lookahead<Xt){if(di(t),t.lookahead<Xt&&e===$r)return at;if(t.lookahead===0)break}if(r=0,t.lookahead>=te&&(t.ins_h=Mr(t,t.ins_h,t.window[t.strstart+te-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),r!==0&&t.strstart-r<=t.w_size-Xt&&(t.match_length=Kd(t,r)),t.match_length>=te)if(n=Fr(t,t.strstart-t.match_start,t.match_length-te),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=te){t.match_length--;do t.strstart++,t.ins_h=Mr(t,t.ins_h,t.window[t.strstart+te-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart;while(--t.match_length!==0);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=Mr(t,t.ins_h,t.window[t.strstart+1]);else n=Fr(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(bt(t,!1),t.strm.avail_out===0))return at}return t.insert=t.strstart<te-1?t.strstart:te-1,e===Dt?(bt(t,!0),t.strm.avail_out===0?xn:wi):t.sym_next&&(bt(t,!1),t.strm.avail_out===0)?at:Si},ti=(t,e)=>{let r,n,i;for(;;){if(t.lookahead<Xt){if(di(t),t.lookahead<Xt&&e===$r)return at;if(t.lookahead===0)break}if(r=0,t.lookahead>=te&&(t.ins_h=Mr(t,t.ins_h,t.window[t.strstart+te-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=te-1,r!==0&&t.prev_length<t.max_lazy_match&&t.strstart-r<=t.w_size-Xt&&(t.match_length=Kd(t,r),t.match_length<=5&&(t.strategy===fv||t.match_length===te&&t.strstart-t.match_start>4096)&&(t.match_length=te-1)),t.prev_length>=te&&t.match_length<=t.prev_length){i=t.strstart+t.lookahead-te,n=Fr(t,t.strstart-1-t.prev_match,t.prev_length-te),t.lookahead-=t.prev_length-1,t.prev_length-=2;do++t.strstart<=i&&(t.ins_h=Mr(t,t.ins_h,t.window[t.strstart+te-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart);while(--t.prev_length!==0);if(t.match_available=0,t.match_length=te-1,t.strstart++,n&&(bt(t,!1),t.strm.avail_out===0))return at}else if(t.match_available){if(n=Fr(t,0,t.window[t.strstart-1]),n&&bt(t,!1),t.strstart++,t.lookahead--,t.strm.avail_out===0)return at}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=Fr(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<te-1?t.strstart:te-1,e===Dt?(bt(t,!0),t.strm.avail_out===0?xn:wi):t.sym_next&&(bt(t,!1),t.strm.avail_out===0)?at:Si},Av=(t,e)=>{let r,n,i,a,o=t.window;for(;;){if(t.lookahead<=Pr){if(di(t),t.lookahead<=Pr&&e===$r)return at;if(t.lookahead===0)break}if(t.match_length=0,t.lookahead>=te&&t.strstart>0&&(i=t.strstart-1,n=o[i],n===o[++i]&&n===o[++i]&&n===o[++i])){a=t.strstart+Pr;do;while(n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&i<a);t.match_length=Pr-(a-i),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=te?(r=Fr(t,1,t.match_length-te),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=Fr(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&(bt(t,!1),t.strm.avail_out===0))return at}return t.insert=0,e===Dt?(bt(t,!0),t.strm.avail_out===0?xn:wi):t.sym_next&&(bt(t,!1),t.strm.avail_out===0)?at:Si},Dv=(t,e)=>{let r;for(;;){if(t.lookahead===0&&(di(t),t.lookahead===0)){if(e===$r)return at;break}if(t.match_length=0,r=Fr(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(bt(t,!1),t.strm.avail_out===0))return at}return t.insert=0,e===Dt?(bt(t,!0),t.strm.avail_out===0?xn:wi):t.sym_next&&(bt(t,!1),t.strm.avail_out===0)?at:Si};function Gt(t,e,r,n,i){this.good_length=t,this.max_lazy=e,this.nice_length=r,this.max_chain=n,this.func=i}var ha=[new Gt(0,0,0,0,Hd),new Gt(4,4,8,4,iu),new Gt(4,5,16,8,iu),new Gt(4,6,32,32,iu),new Gt(4,4,16,16,ti),new Gt(8,16,32,32,ti),new Gt(8,16,128,128,ti),new Gt(8,32,128,256,ti),new Gt(32,128,258,1024,ti),new Gt(32,258,258,4096,ti)],Nv=t=>{t.window_size=2*t.w_size,Nr(t.head),t.max_lazy_match=ha[t.level].max_lazy,t.good_match=ha[t.level].good_length,t.nice_match=ha[t.level].nice_length,t.max_chain_length=ha[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=te-1,t.match_available=0,t.ins_h=0};function Pv(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Ns,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(Ev*2),this.dyn_dtree=new Uint16Array((2*Sv+1)*2),this.bl_tree=new Uint16Array((2*wv+1)*2),Nr(this.dyn_ltree),Nr(this.dyn_dtree),Nr(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(xv+1),this.heap=new Uint16Array(2*Nu+1),Nr(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*Nu+1),Nr(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}var qa=t=>{if(!t)return 1;let e=t.state;return!e||e.strm!==t||e.status!==pi&&e.status!==Ju&&e.status!==Pu&&e.status!==Cu&&e.status!==Ru&&e.status!==Lu&&e.status!==mn&&e.status!==da?1:0},Jd=t=>{if(qa(t))return gn(t,Zt);t.total_in=t.total_out=0,t.data_type=mv;let e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap===2?Ju:e.wrap?pi:mn,t.adler=e.wrap===2?0:1,e.last_flush=-2,iv(e),He},Yd=t=>{let e=Jd(t);return e===He&&Nv(t.state),e},Cv=(t,e)=>qa(t)||t.state.wrap!==2?Zt:(t.state.gzhead=e,He),Zd=(t,e,r,n,i,a)=>{if(!t)return Zt;let o=1;if(e===lv&&(e=6),n<0?(o=0,n=-n):n>15&&(o=2,n-=16),i<1||i>gv||r!==Ns||n<8||n>15||e<0||e>9||a<0||a>dv||n===8&&o!==1)return gn(t,Zt);n===8&&(n=9);let s=new Pv;return t.state=s,s.strm=t,s.status=pi,s.wrap=o,s.gzhead=null,s.w_bits=n,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=i+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+te-1)/te),s.window=new Uint8Array(s.w_size*2),s.head=new Uint16Array(s.hash_size),s.prev=new Uint16Array(s.w_size),s.lit_bufsize=1<<i+6,s.pending_buf_size=s.lit_bufsize*4,s.pending_buf=new Uint8Array(s.pending_buf_size),s.sym_buf=s.lit_bufsize,s.sym_end=(s.lit_bufsize-1)*3,s.level=e,s.strategy=a,s.method=r,Yd(t)},Rv=(t,e)=>Zd(t,e,Ns,yv,vv,hv),Lv=(t,e)=>{if(qa(t)||e>_p||e<0)return t?gn(t,Zt):Zt;let r=t.state;if(!t.output||t.avail_in!==0&&!t.input||r.status===da&&e!==Dt)return gn(t,t.avail_out===0?nu:Zt);let n=r.last_flush;if(r.last_flush=e,r.pending!==0){if(yt(t),t.avail_out===0)return r.last_flush=-1,He}else if(t.avail_in===0&&wp(e)<=wp(n)&&e!==Dt)return gn(t,nu);if(r.status===da&&t.avail_in!==0)return gn(t,nu);if(r.status===pi&&r.wrap===0&&(r.status=mn),r.status===pi){let i=Ns+(r.w_bits-8<<4)<<8,a=-1;if(r.strategy>=Mo||r.level<2?a=0:r.level<6?a=1:r.level===6?a=2:a=3,i|=a<<6,r.strstart!==0&&(i|=Iv),i+=31-i%31,Hi(r,i),r.strstart!==0&&(Hi(r,t.adler>>>16),Hi(r,t.adler&65535)),t.adler=1,r.status=mn,yt(t),r.pending!==0)return r.last_flush=-1,He}if(r.status===Ju){if(t.adler=0,se(r,31),se(r,139),se(r,8),r.gzhead)se(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),se(r,r.gzhead.time&255),se(r,r.gzhead.time>>8&255),se(r,r.gzhead.time>>16&255),se(r,r.gzhead.time>>24&255),se(r,r.level===9?2:r.strategy>=Mo||r.level<2?4:0),se(r,r.gzhead.os&255),r.gzhead.extra&&r.gzhead.extra.length&&(se(r,r.gzhead.extra.length&255),se(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=je(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=Pu;else if(se(r,0),se(r,0),se(r,0),se(r,0),se(r,0),se(r,r.level===9?2:r.strategy>=Mo||r.level<2?4:0),se(r,Tv),r.status=mn,yt(t),r.pending!==0)return r.last_flush=-1,He}if(r.status===Pu){if(r.gzhead.extra){let i=r.pending,a=(r.gzhead.extra.length&65535)-r.gzindex;for(;r.pending+a>r.pending_buf_size;){let s=r.pending_buf_size-r.pending;if(r.pending_buf.set(r.gzhead.extra.subarray(r.gzindex,r.gzindex+s),r.pending),r.pending=r.pending_buf_size,r.gzhead.hcrc&&r.pending>i&&(t.adler=je(t.adler,r.pending_buf,r.pending-i,i)),r.gzindex+=s,yt(t),r.pending!==0)return r.last_flush=-1,He;i=0,a-=s}let o=new Uint8Array(r.gzhead.extra);r.pending_buf.set(o.subarray(r.gzindex,r.gzindex+a),r.pending),r.pending+=a,r.gzhead.hcrc&&r.pending>i&&(t.adler=je(t.adler,r.pending_buf,r.pending-i,i)),r.gzindex=0}r.status=Cu}if(r.status===Cu){if(r.gzhead.name){let i=r.pending,a;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>i&&(t.adler=je(t.adler,r.pending_buf,r.pending-i,i)),yt(t),r.pending!==0)return r.last_flush=-1,He;i=0}r.gzindex<r.gzhead.name.length?a=r.gzhead.name.charCodeAt(r.gzindex++)&255:a=0,se(r,a)}while(a!==0);r.gzhead.hcrc&&r.pending>i&&(t.adler=je(t.adler,r.pending_buf,r.pending-i,i)),r.gzindex=0}r.status=Ru}if(r.status===Ru){if(r.gzhead.comment){let i=r.pending,a;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>i&&(t.adler=je(t.adler,r.pending_buf,r.pending-i,i)),yt(t),r.pending!==0)return r.last_flush=-1,He;i=0}r.gzindex<r.gzhead.comment.length?a=r.gzhead.comment.charCodeAt(r.gzindex++)&255:a=0,se(r,a)}while(a!==0);r.gzhead.hcrc&&r.pending>i&&(t.adler=je(t.adler,r.pending_buf,r.pending-i,i))}r.status=Lu}if(r.status===Lu){if(r.gzhead.hcrc){if(r.pending+2>r.pending_buf_size&&(yt(t),r.pending!==0))return r.last_flush=-1,He;se(r,t.adler&255),se(r,t.adler>>8&255),t.adler=0}if(r.status=mn,yt(t),r.pending!==0)return r.last_flush=-1,He}if(t.avail_in!==0||r.lookahead!==0||e!==$r&&r.status!==da){let i=r.level===0?Hd(r,e):r.strategy===Mo?Dv(r,e):r.strategy===pv?Av(r,e):ha[r.level].func(r,e);if((i===xn||i===wi)&&(r.status=da),i===at||i===xn)return t.avail_out===0&&(r.last_flush=-1),He;if(i===Si&&(e===sv?ov(r):e!==_p&&(Du(r,0,0,!1),e===cv&&(Nr(r.head),r.lookahead===0&&(r.strstart=0,r.block_start=0,r.insert=0))),yt(t),t.avail_out===0))return r.last_flush=-1,He}return e!==Dt?He:r.wrap<=0?Sp:(r.wrap===2?(se(r,t.adler&255),se(r,t.adler>>8&255),se(r,t.adler>>16&255),se(r,t.adler>>24&255),se(r,t.total_in&255),se(r,t.total_in>>8&255),se(r,t.total_in>>16&255),se(r,t.total_in>>24&255)):(Hi(r,t.adler>>>16),Hi(r,t.adler&65535)),yt(t),r.wrap>0&&(r.wrap=-r.wrap),r.pending!==0?He:Sp)},Fv=t=>{if(qa(t))return Zt;let e=t.state.status;return t.state=null,e===mn?gn(t,uv):He},$v=(t,e)=>{let r=e.length;if(qa(t))return Zt;let n=t.state,i=n.wrap;if(i===2||i===1&&n.status!==pi||n.lookahead)return Zt;if(i===1&&(t.adler=Pa(t.adler,e,r,0)),n.wrap=0,r>=n.w_size){i===0&&(Nr(n.head),n.strstart=0,n.block_start=0,n.insert=0);let u=new Uint8Array(n.w_size);u.set(e.subarray(r-n.w_size,r),0),e=u,r=n.w_size}let a=t.avail_in,o=t.next_in,s=t.input;for(t.avail_in=r,t.next_in=0,t.input=e,di(n);n.lookahead>=te;){let u=n.strstart,c=n.lookahead-(te-1);do n.ins_h=Mr(n,n.ins_h,n.window[u+te-1]),n.prev[u&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=u,u++;while(--c);n.strstart=u,n.lookahead=te-1,di(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=te-1,n.match_available=0,t.next_in=o,t.input=s,t.avail_in=a,n.wrap=i,He},Mv=Rv,Uv=Zd,jv=Yd,qv=Jd,Bv=Cv,Vv=Lv,Qv=Fv,zv=$v,Gv="pako deflate (from Nodeca project)",_a={deflateInit:Mv,deflateInit2:Uv,deflateReset:jv,deflateResetKeep:qv,deflateSetHeader:Bv,deflate:Vv,deflateEnd:Qv,deflateSetDictionary:zv,deflateInfo:Gv},Wv=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),Kv=function(t){let e=Array.prototype.slice.call(arguments,1);for(;e.length;){let r=e.shift();if(!!r){if(typeof r!="object")throw new TypeError(r+"must be non-object");for(let n in r)Wv(r,n)&&(t[n]=r[n])}}return t},Hv=t=>{let e=0;for(let n=0,i=t.length;n<i;n++)e+=t[n].length;let r=new Uint8Array(e);for(let n=0,i=0,a=t.length;n<a;n++){let o=t[n];r.set(o,i),i+=o.length}return r},Ps={assign:Kv,flattenChunks:Hv},Xd=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){Xd=!1}var Ca=new Uint8Array(256);for(let t=0;t<256;t++)Ca[t]=t>=252?6:t>=248?5:t>=240?4:t>=224?3:t>=192?2:1;Ca[254]=Ca[254]=1;var Jv=t=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(t);let e,r,n,i,a,o=t.length,s=0;for(i=0;i<o;i++)r=t.charCodeAt(i),(r&64512)===55296&&i+1<o&&(n=t.charCodeAt(i+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),i++)),s+=r<128?1:r<2048?2:r<65536?3:4;for(e=new Uint8Array(s),a=0,i=0;a<s;i++)r=t.charCodeAt(i),(r&64512)===55296&&i+1<o&&(n=t.charCodeAt(i+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),i++)),r<128?e[a++]=r:r<2048?(e[a++]=192|r>>>6,e[a++]=128|r&63):r<65536?(e[a++]=224|r>>>12,e[a++]=128|r>>>6&63,e[a++]=128|r&63):(e[a++]=240|r>>>18,e[a++]=128|r>>>12&63,e[a++]=128|r>>>6&63,e[a++]=128|r&63);return e},Yv=(t,e)=>{if(e<65534&&t.subarray&&Xd)return String.fromCharCode.apply(null,t.length===e?t:t.subarray(0,e));let r="";for(let n=0;n<e;n++)r+=String.fromCharCode(t[n]);return r},Zv=(t,e)=>{let r=e||t.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(t.subarray(0,e));let n,i,a=new Array(r*2);for(i=0,n=0;n<r;){let o=t[n++];if(o<128){a[i++]=o;continue}let s=Ca[o];if(s>4){a[i++]=65533,n+=s-1;continue}for(o&=s===2?31:s===3?15:7;s>1&&n<r;)o=o<<6|t[n++]&63,s--;if(s>1){a[i++]=65533;continue}o<65536?a[i++]=o:(o-=65536,a[i++]=55296|o>>10&1023,a[i++]=56320|o&1023)}return Yv(a,i)},Xv=(t,e)=>{e=e||t.length,e>t.length&&(e=t.length);let r=e-1;for(;r>=0&&(t[r]&192)===128;)r--;return r<0||r===0?e:r+Ca[t[r]]>e?r:e},Ra={string2buf:Jv,buf2string:Zv,utf8border:Xv};function eb(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var eh=eb,th=Object.prototype.toString,{Z_NO_FLUSH:tb,Z_SYNC_FLUSH:rb,Z_FULL_FLUSH:nb,Z_FINISH:ib,Z_OK:bs,Z_STREAM_END:ab,Z_DEFAULT_COMPRESSION:ob,Z_DEFAULT_STRATEGY:sb,Z_DEFLATED:cb}=Pn;function Ba(t){this.options=Ps.assign({level:ob,method:cb,chunkSize:16384,windowBits:15,memLevel:8,strategy:sb},t||{});let e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new eh,this.strm.avail_out=0;let r=_a.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(r!==bs)throw new Error(En[r]);if(e.header&&_a.deflateSetHeader(this.strm,e.header),e.dictionary){let n;if(typeof e.dictionary=="string"?n=Ra.string2buf(e.dictionary):th.call(e.dictionary)==="[object ArrayBuffer]"?n=new Uint8Array(e.dictionary):n=e.dictionary,r=_a.deflateSetDictionary(this.strm,n),r!==bs)throw new Error(En[r]);this._dict_set=!0}}Ba.prototype.push=function(t,e){let r=this.strm,n=this.options.chunkSize,i,a;if(this.ended)return!1;for(e===~~e?a=e:a=e===!0?ib:tb,typeof t=="string"?r.input=Ra.string2buf(t):th.call(t)==="[object ArrayBuffer]"?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;){if(r.avail_out===0&&(r.output=new Uint8Array(n),r.next_out=0,r.avail_out=n),(a===rb||a===nb)&&r.avail_out<=6){this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;continue}if(i=_a.deflate(r,a),i===ab)return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),i=_a.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===bs;if(r.avail_out===0){this.onData(r.output);continue}if(a>0&&r.next_out>0){this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;continue}if(r.avail_in===0)break}return!0};Ba.prototype.onData=function(t){this.chunks.push(t)};Ba.prototype.onEnd=function(t){t===bs&&(this.result=Ps.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function Yu(t,e){let r=new Ba(e);if(r.push(t,!0),r.err)throw r.msg||En[r.err];return r.result}function ub(t,e){return e=e||{},e.raw=!0,Yu(t,e)}function lb(t,e){return e=e||{},e.gzip=!0,Yu(t,e)}var fb=Ba,pb=Yu,db=ub,hb=lb,mb=Pn,gb={Deflate:fb,deflate:pb,deflateRaw:db,gzip:hb,constants:mb},Uo=16209,yb=16191,vb=function t(e,r){let n,i,a,o,s,u,c,l,d,p,f,m,y,b,E,S,_,g,A,R,T,C,F,L,q=e.state;n=e.next_in,F=e.input,i=n+(e.avail_in-5),a=e.next_out,L=e.output,o=a-(r-e.avail_out),s=a+(e.avail_out-257),u=q.dmax,c=q.wsize,l=q.whave,d=q.wnext,p=q.window,f=q.hold,m=q.bits,y=q.lencode,b=q.distcode,E=(1<<q.lenbits)-1,S=(1<<q.distbits)-1;e:do{m<15&&(f+=F[n++]<<m,m+=8,f+=F[n++]<<m,m+=8),_=y[f&E];t:for(;;){if(g=_>>>24,f>>>=g,m-=g,g=_>>>16&255,g===0)L[a++]=_&65535;else if(g&16){A=_&65535,g&=15,g&&(m<g&&(f+=F[n++]<<m,m+=8),A+=f&(1<<g)-1,f>>>=g,m-=g),m<15&&(f+=F[n++]<<m,m+=8,f+=F[n++]<<m,m+=8),_=b[f&S];r:for(;;){if(g=_>>>24,f>>>=g,m-=g,g=_>>>16&255,g&16){if(R=_&65535,g&=15,m<g&&(f+=F[n++]<<m,m+=8,m<g&&(f+=F[n++]<<m,m+=8)),R+=f&(1<<g)-1,R>u){e.msg="invalid distance too far back",q.mode=Uo;break e}if(f>>>=g,m-=g,g=a-o,R>g){if(g=R-g,g>l&&q.sane){e.msg="invalid distance too far back",q.mode=Uo;break e}if(T=0,C=p,d===0){if(T+=c-g,g<A){A-=g;do L[a++]=p[T++];while(--g);T=a-R,C=L}}else if(d<g){if(T+=c+d-g,g-=d,g<A){A-=g;do L[a++]=p[T++];while(--g);if(T=0,d<A){g=d,A-=g;do L[a++]=p[T++];while(--g);T=a-R,C=L}}}else if(T+=d-g,g<A){A-=g;do L[a++]=p[T++];while(--g);T=a-R,C=L}for(;A>2;)L[a++]=C[T++],L[a++]=C[T++],L[a++]=C[T++],A-=3;A&&(L[a++]=C[T++],A>1&&(L[a++]=C[T++]))}else{T=a-R;do L[a++]=L[T++],L[a++]=L[T++],L[a++]=L[T++],A-=3;while(A>2);A&&(L[a++]=L[T++],A>1&&(L[a++]=L[T++]))}}else if((g&64)===0){_=b[(_&65535)+(f&(1<<g)-1)];continue r}else{e.msg="invalid distance code",q.mode=Uo;break e}break}}else if((g&64)===0){_=y[(_&65535)+(f&(1<<g)-1)];continue t}else if(g&32){q.mode=yb;break e}else{e.msg="invalid literal/length code",q.mode=Uo;break e}break}}while(n<i&&a<s);A=m>>3,n-=A,m-=A<<3,f&=(1<<m)-1,e.next_in=n,e.next_out=a,e.avail_in=n<i?5+(i-n):5-(n-i),e.avail_out=a<s?257+(s-a):257-(a-s),q.hold=f,q.bits=m},ri=15,Ep=852,xp=592,Ip=0,au=1,Tp=2,bb=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),_b=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),Sb=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),wb=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),Eb=(t,e,r,n,i,a,o,s)=>{let u=s.bits,c=0,l=0,d=0,p=0,f=0,m=0,y=0,b=0,E=0,S=0,_,g,A,R,T,C=null,F,L=new Uint16Array(ri+1),q=new Uint16Array(ri+1),Ve=null,Ce,B,he;for(c=0;c<=ri;c++)L[c]=0;for(l=0;l<n;l++)L[e[r+l]]++;for(f=u,p=ri;p>=1&&L[p]===0;p--);if(f>p&&(f=p),p===0)return i[a++]=1<<24|64<<16|0,i[a++]=1<<24|64<<16|0,s.bits=1,0;for(d=1;d<p&&L[d]===0;d++);for(f<d&&(f=d),b=1,c=1;c<=ri;c++)if(b<<=1,b-=L[c],b<0)return-1;if(b>0&&(t===Ip||p!==1))return-1;for(q[1]=0,c=1;c<ri;c++)q[c+1]=q[c]+L[c];for(l=0;l<n;l++)e[r+l]!==0&&(o[q[e[r+l]]++]=l);if(t===Ip?(C=Ve=o,F=20):t===au?(C=bb,Ve=_b,F=257):(C=Sb,Ve=wb,F=0),S=0,l=0,c=d,T=a,m=f,y=0,A=-1,E=1<<f,R=E-1,t===au&&E>Ep||t===Tp&&E>xp)return 1;for(;;){Ce=c-y,o[l]+1<F?(B=0,he=o[l]):o[l]>=F?(B=Ve[o[l]-F],he=C[o[l]-F]):(B=32+64,he=0),_=1<<c-y,g=1<<m,d=g;do g-=_,i[T+(S>>y)+g]=Ce<<24|B<<16|he|0;while(g!==0);for(_=1<<c-1;S&_;)_>>=1;if(_!==0?(S&=_-1,S+=_):S=0,l++,--L[c]===0){if(c===p)break;c=e[r+o[l]]}if(c>f&&(S&R)!==A){for(y===0&&(y=f),T+=d,m=c-y,b=1<<m;m+y<p&&(b-=L[m+y],!(b<=0));)m++,b<<=1;if(E+=1<<m,t===au&&E>Ep||t===Tp&&E>xp)return 1;A=S&R,i[A]=f<<24|m<<16|T-a|0}}return S!==0&&(i[T+S]=c-y<<24|64<<16|0),s.bits=f,0},Sa=Eb,xb=0,rh=1,nh=2,{Z_FINISH:kp,Z_BLOCK:Ib,Z_TREES:jo,Z_OK:In,Z_STREAM_END:Tb,Z_NEED_DICT:kb,Z_STREAM_ERROR:Nt,Z_DATA_ERROR:ih,Z_MEM_ERROR:ah,Z_BUF_ERROR:Ob,Z_DEFLATED:Op}=Pn,Cs=16180,Ap=16181,Dp=16182,Np=16183,Pp=16184,Cp=16185,Rp=16186,Lp=16187,Fp=16188,$p=16189,_s=16190,sr=16191,ou=16192,Mp=16193,su=16194,Up=16195,jp=16196,qp=16197,Bp=16198,qo=16199,Bo=16200,Vp=16201,Qp=16202,zp=16203,Gp=16204,Wp=16205,cu=16206,Kp=16207,Hp=16208,be=16209,oh=16210,sh=16211,Ab=852,Db=592,Nb=15,Pb=Nb,Jp=t=>(t>>>24&255)+(t>>>8&65280)+((t&65280)<<8)+((t&255)<<24);function Cb(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}var Cn=t=>{if(!t)return 1;let e=t.state;return!e||e.strm!==t||e.mode<Cs||e.mode>sh?1:0},ch=t=>{if(Cn(t))return Nt;let e=t.state;return t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=e.wrap&1),e.mode=Cs,e.last=0,e.havedict=0,e.flags=-1,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(Ab),e.distcode=e.distdyn=new Int32Array(Db),e.sane=1,e.back=-1,In},uh=t=>{if(Cn(t))return Nt;let e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,ch(t)},lh=(t,e)=>{let r;if(Cn(t))return Nt;let n=t.state;return e<0?(r=0,e=-e):(r=(e>>4)+5,e<48&&(e&=15)),e&&(e<8||e>15)?Nt:(n.window!==null&&n.wbits!==e&&(n.window=null),n.wrap=r,n.wbits=e,uh(t))},fh=(t,e)=>{if(!t)return Nt;let r=new Cb;t.state=r,r.strm=t,r.window=null,r.mode=Cs;let n=lh(t,e);return n!==In&&(t.state=null),n},Rb=t=>fh(t,Pb),Yp=!0,uu,lu,Lb=t=>{if(Yp){uu=new Int32Array(512),lu=new Int32Array(32);let e=0;for(;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(Sa(rh,t.lens,0,288,uu,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;Sa(nh,t.lens,0,32,lu,0,t.work,{bits:5}),Yp=!1}t.lencode=uu,t.lenbits=9,t.distcode=lu,t.distbits=5},ph=(t,e,r,n)=>{let i,a=t.state;return a.window===null&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new Uint8Array(a.wsize)),n>=a.wsize?(a.window.set(e.subarray(r-a.wsize,r),0),a.wnext=0,a.whave=a.wsize):(i=a.wsize-a.wnext,i>n&&(i=n),a.window.set(e.subarray(r-n,r-n+i),a.wnext),n-=i,n?(a.window.set(e.subarray(r-n,r),0),a.wnext=n,a.whave=a.wsize):(a.wnext+=i,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=i))),0},Fb=(t,e)=>{let r,n,i,a,o,s,u,c,l,d,p,f,m,y,b=0,E,S,_,g,A,R,T,C,F=new Uint8Array(4),L,q,Ve=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Cn(t)||!t.output||!t.input&&t.avail_in!==0)return Nt;r=t.state,r.mode===sr&&(r.mode=ou),o=t.next_out,i=t.output,u=t.avail_out,a=t.next_in,n=t.input,s=t.avail_in,c=r.hold,l=r.bits,d=s,p=u,C=In;e:for(;;)switch(r.mode){case Cs:if(r.wrap===0){r.mode=ou;break}for(;l<16;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(r.wrap&2&&c===35615){r.wbits===0&&(r.wbits=15),r.check=0,F[0]=c&255,F[1]=c>>>8&255,r.check=je(r.check,F,2,0),c=0,l=0,r.mode=Ap;break}if(r.head&&(r.head.done=!1),!(r.wrap&1)||(((c&255)<<8)+(c>>8))%31){t.msg="incorrect header check",r.mode=be;break}if((c&15)!==Op){t.msg="unknown compression method",r.mode=be;break}if(c>>>=4,l-=4,T=(c&15)+8,r.wbits===0&&(r.wbits=T),T>15||T>r.wbits){t.msg="invalid window size",r.mode=be;break}r.dmax=1<<r.wbits,r.flags=0,t.adler=r.check=1,r.mode=c&512?$p:sr,c=0,l=0;break;case Ap:for(;l<16;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(r.flags=c,(r.flags&255)!==Op){t.msg="unknown compression method",r.mode=be;break}if(r.flags&57344){t.msg="unknown header flags set",r.mode=be;break}r.head&&(r.head.text=c>>8&1),r.flags&512&&r.wrap&4&&(F[0]=c&255,F[1]=c>>>8&255,r.check=je(r.check,F,2,0)),c=0,l=0,r.mode=Dp;case Dp:for(;l<32;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}r.head&&(r.head.time=c),r.flags&512&&r.wrap&4&&(F[0]=c&255,F[1]=c>>>8&255,F[2]=c>>>16&255,F[3]=c>>>24&255,r.check=je(r.check,F,4,0)),c=0,l=0,r.mode=Np;case Np:for(;l<16;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}r.head&&(r.head.xflags=c&255,r.head.os=c>>8),r.flags&512&&r.wrap&4&&(F[0]=c&255,F[1]=c>>>8&255,r.check=je(r.check,F,2,0)),c=0,l=0,r.mode=Pp;case Pp:if(r.flags&1024){for(;l<16;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}r.length=c,r.head&&(r.head.extra_len=c),r.flags&512&&r.wrap&4&&(F[0]=c&255,F[1]=c>>>8&255,r.check=je(r.check,F,2,0)),c=0,l=0}else r.head&&(r.head.extra=null);r.mode=Cp;case Cp:if(r.flags&1024&&(f=r.length,f>s&&(f=s),f&&(r.head&&(T=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Uint8Array(r.head.extra_len)),r.head.extra.set(n.subarray(a,a+f),T)),r.flags&512&&r.wrap&4&&(r.check=je(r.check,n,f,a)),s-=f,a+=f,r.length-=f),r.length))break e;r.length=0,r.mode=Rp;case Rp:if(r.flags&2048){if(s===0)break e;f=0;do T=n[a+f++],r.head&&T&&r.length<65536&&(r.head.name+=String.fromCharCode(T));while(T&&f<s);if(r.flags&512&&r.wrap&4&&(r.check=je(r.check,n,f,a)),s-=f,a+=f,T)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=Lp;case Lp:if(r.flags&4096){if(s===0)break e;f=0;do T=n[a+f++],r.head&&T&&r.length<65536&&(r.head.comment+=String.fromCharCode(T));while(T&&f<s);if(r.flags&512&&r.wrap&4&&(r.check=je(r.check,n,f,a)),s-=f,a+=f,T)break e}else r.head&&(r.head.comment=null);r.mode=Fp;case Fp:if(r.flags&512){for(;l<16;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(r.wrap&4&&c!==(r.check&65535)){t.msg="header crc mismatch",r.mode=be;break}c=0,l=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),t.adler=r.check=0,r.mode=sr;break;case $p:for(;l<32;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}t.adler=r.check=Jp(c),c=0,l=0,r.mode=_s;case _s:if(r.havedict===0)return t.next_out=o,t.avail_out=u,t.next_in=a,t.avail_in=s,r.hold=c,r.bits=l,kb;t.adler=r.check=1,r.mode=sr;case sr:if(e===Ib||e===jo)break e;case ou:if(r.last){c>>>=l&7,l-=l&7,r.mode=cu;break}for(;l<3;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}switch(r.last=c&1,c>>>=1,l-=1,c&3){case 0:r.mode=Mp;break;case 1:if(Lb(r),r.mode=qo,e===jo){c>>>=2,l-=2;break e}break;case 2:r.mode=jp;break;case 3:t.msg="invalid block type",r.mode=be}c>>>=2,l-=2;break;case Mp:for(c>>>=l&7,l-=l&7;l<32;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if((c&65535)!==(c>>>16^65535)){t.msg="invalid stored block lengths",r.mode=be;break}if(r.length=c&65535,c=0,l=0,r.mode=su,e===jo)break e;case su:r.mode=Up;case Up:if(f=r.length,f){if(f>s&&(f=s),f>u&&(f=u),f===0)break e;i.set(n.subarray(a,a+f),o),s-=f,a+=f,u-=f,o+=f,r.length-=f;break}r.mode=sr;break;case jp:for(;l<14;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(r.nlen=(c&31)+257,c>>>=5,l-=5,r.ndist=(c&31)+1,c>>>=5,l-=5,r.ncode=(c&15)+4,c>>>=4,l-=4,r.nlen>286||r.ndist>30){t.msg="too many length or distance symbols",r.mode=be;break}r.have=0,r.mode=qp;case qp:for(;r.have<r.ncode;){for(;l<3;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}r.lens[Ve[r.have++]]=c&7,c>>>=3,l-=3}for(;r.have<19;)r.lens[Ve[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,L={bits:r.lenbits},C=Sa(xb,r.lens,0,19,r.lencode,0,r.work,L),r.lenbits=L.bits,C){t.msg="invalid code lengths set",r.mode=be;break}r.have=0,r.mode=Bp;case Bp:for(;r.have<r.nlen+r.ndist;){for(;b=r.lencode[c&(1<<r.lenbits)-1],E=b>>>24,S=b>>>16&255,_=b&65535,!(E<=l);){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(_<16)c>>>=E,l-=E,r.lens[r.have++]=_;else{if(_===16){for(q=E+2;l<q;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(c>>>=E,l-=E,r.have===0){t.msg="invalid bit length repeat",r.mode=be;break}T=r.lens[r.have-1],f=3+(c&3),c>>>=2,l-=2}else if(_===17){for(q=E+3;l<q;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}c>>>=E,l-=E,T=0,f=3+(c&7),c>>>=3,l-=3}else{for(q=E+7;l<q;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}c>>>=E,l-=E,T=0,f=11+(c&127),c>>>=7,l-=7}if(r.have+f>r.nlen+r.ndist){t.msg="invalid bit length repeat",r.mode=be;break}for(;f--;)r.lens[r.have++]=T}}if(r.mode===be)break;if(r.lens[256]===0){t.msg="invalid code -- missing end-of-block",r.mode=be;break}if(r.lenbits=9,L={bits:r.lenbits},C=Sa(rh,r.lens,0,r.nlen,r.lencode,0,r.work,L),r.lenbits=L.bits,C){t.msg="invalid literal/lengths set",r.mode=be;break}if(r.distbits=6,r.distcode=r.distdyn,L={bits:r.distbits},C=Sa(nh,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,L),r.distbits=L.bits,C){t.msg="invalid distances set",r.mode=be;break}if(r.mode=qo,e===jo)break e;case qo:r.mode=Bo;case Bo:if(s>=6&&u>=258){t.next_out=o,t.avail_out=u,t.next_in=a,t.avail_in=s,r.hold=c,r.bits=l,vb(t,p),o=t.next_out,i=t.output,u=t.avail_out,a=t.next_in,n=t.input,s=t.avail_in,c=r.hold,l=r.bits,r.mode===sr&&(r.back=-1);break}for(r.back=0;b=r.lencode[c&(1<<r.lenbits)-1],E=b>>>24,S=b>>>16&255,_=b&65535,!(E<=l);){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(S&&(S&240)===0){for(g=E,A=S,R=_;b=r.lencode[R+((c&(1<<g+A)-1)>>g)],E=b>>>24,S=b>>>16&255,_=b&65535,!(g+E<=l);){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}c>>>=g,l-=g,r.back+=g}if(c>>>=E,l-=E,r.back+=E,r.length=_,S===0){r.mode=Wp;break}if(S&32){r.back=-1,r.mode=sr;break}if(S&64){t.msg="invalid literal/length code",r.mode=be;break}r.extra=S&15,r.mode=Vp;case Vp:if(r.extra){for(q=r.extra;l<q;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}r.length+=c&(1<<r.extra)-1,c>>>=r.extra,l-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=Qp;case Qp:for(;b=r.distcode[c&(1<<r.distbits)-1],E=b>>>24,S=b>>>16&255,_=b&65535,!(E<=l);){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if((S&240)===0){for(g=E,A=S,R=_;b=r.distcode[R+((c&(1<<g+A)-1)>>g)],E=b>>>24,S=b>>>16&255,_=b&65535,!(g+E<=l);){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}c>>>=g,l-=g,r.back+=g}if(c>>>=E,l-=E,r.back+=E,S&64){t.msg="invalid distance code",r.mode=be;break}r.offset=_,r.extra=S&15,r.mode=zp;case zp:if(r.extra){for(q=r.extra;l<q;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}r.offset+=c&(1<<r.extra)-1,c>>>=r.extra,l-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){t.msg="invalid distance too far back",r.mode=be;break}r.mode=Gp;case Gp:if(u===0)break e;if(f=p-u,r.offset>f){if(f=r.offset-f,f>r.whave&&r.sane){t.msg="invalid distance too far back",r.mode=be;break}f>r.wnext?(f-=r.wnext,m=r.wsize-f):m=r.wnext-f,f>r.length&&(f=r.length),y=r.window}else y=i,m=o-r.offset,f=r.length;f>u&&(f=u),u-=f,r.length-=f;do i[o++]=y[m++];while(--f);r.length===0&&(r.mode=Bo);break;case Wp:if(u===0)break e;i[o++]=r.length,u--,r.mode=Bo;break;case cu:if(r.wrap){for(;l<32;){if(s===0)break e;s--,c|=n[a++]<<l,l+=8}if(p-=u,t.total_out+=p,r.total+=p,r.wrap&4&&p&&(t.adler=r.check=r.flags?je(r.check,i,p,o-p):Pa(r.check,i,p,o-p)),p=u,r.wrap&4&&(r.flags?c:Jp(c))!==r.check){t.msg="incorrect data check",r.mode=be;break}c=0,l=0}r.mode=Kp;case Kp:if(r.wrap&&r.flags){for(;l<32;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(r.wrap&4&&c!==(r.total&4294967295)){t.msg="incorrect length check",r.mode=be;break}c=0,l=0}r.mode=Hp;case Hp:C=Tb;break e;case be:C=ih;break e;case oh:return ah;case sh:default:return Nt}return t.next_out=o,t.avail_out=u,t.next_in=a,t.avail_in=s,r.hold=c,r.bits=l,(r.wsize||p!==t.avail_out&&r.mode<be&&(r.mode<cu||e!==kp))&&ph(t,t.output,t.next_out,p-t.avail_out),d-=t.avail_in,p-=t.avail_out,t.total_in+=d,t.total_out+=p,r.total+=p,r.wrap&4&&p&&(t.adler=r.check=r.flags?je(r.check,i,p,t.next_out-p):Pa(r.check,i,p,t.next_out-p)),t.data_type=r.bits+(r.last?64:0)+(r.mode===sr?128:0)+(r.mode===qo||r.mode===su?256:0),(d===0&&p===0||e===kp)&&C===In&&(C=Ob),C},$b=t=>{if(Cn(t))return Nt;let e=t.state;return e.window&&(e.window=null),t.state=null,In},Mb=(t,e)=>{if(Cn(t))return Nt;let r=t.state;return(r.wrap&2)===0?Nt:(r.head=e,e.done=!1,In)},Ub=(t,e)=>{let r=e.length,n,i,a;return Cn(t)||(n=t.state,n.wrap!==0&&n.mode!==_s)?Nt:n.mode===_s&&(i=1,i=Pa(i,e,r,0),i!==n.check)?ih:(a=ph(t,e,r,r),a?(n.mode=oh,ah):(n.havedict=1,In))},jb=uh,qb=lh,Bb=ch,Vb=Rb,Qb=fh,zb=Fb,Gb=$b,Wb=Mb,Kb=Ub,Hb="pako inflate (from Nodeca project)",pr={inflateReset:jb,inflateReset2:qb,inflateResetKeep:Bb,inflateInit:Vb,inflateInit2:Qb,inflate:zb,inflateEnd:Gb,inflateGetHeader:Wb,inflateSetDictionary:Kb,inflateInfo:Hb};function Jb(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var Yb=Jb,dh=Object.prototype.toString,{Z_NO_FLUSH:Zb,Z_FINISH:Xb,Z_OK:La,Z_STREAM_END:fu,Z_NEED_DICT:pu,Z_STREAM_ERROR:e_,Z_DATA_ERROR:Zp,Z_MEM_ERROR:t_}=Pn;function Va(t){this.options=Ps.assign({chunkSize:1024*64,windowBits:15,to:""},t||{});let e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,e.windowBits===0&&(e.windowBits=-15)),e.windowBits>=0&&e.windowBits<16&&!(t&&t.windowBits)&&(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(e.windowBits&15)===0&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new eh,this.strm.avail_out=0;let r=pr.inflateInit2(this.strm,e.windowBits);if(r!==La)throw new Error(En[r]);if(this.header=new Yb,pr.inflateGetHeader(this.strm,this.header),e.dictionary&&(typeof e.dictionary=="string"?e.dictionary=Ra.string2buf(e.dictionary):dh.call(e.dictionary)==="[object ArrayBuffer]"&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(r=pr.inflateSetDictionary(this.strm,e.dictionary),r!==La)))throw new Error(En[r])}Va.prototype.push=function(t,e){let r=this.strm,n=this.options.chunkSize,i=this.options.dictionary,a,o,s;if(this.ended)return!1;for(e===~~e?o=e:o=e===!0?Xb:Zb,dh.call(t)==="[object ArrayBuffer]"?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;){for(r.avail_out===0&&(r.output=new Uint8Array(n),r.next_out=0,r.avail_out=n),a=pr.inflate(r,o),a===pu&&i&&(a=pr.inflateSetDictionary(r,i),a===La?a=pr.inflate(r,o):a===Zp&&(a=pu));r.avail_in>0&&a===fu&&r.state.wrap>0&&t[r.next_in]!==0;)pr.inflateReset(r),a=pr.inflate(r,o);switch(a){case e_:case Zp:case pu:case t_:return this.onEnd(a),this.ended=!0,!1}if(s=r.avail_out,r.next_out&&(r.avail_out===0||a===fu))if(this.options.to==="string"){let u=Ra.utf8border(r.output,r.next_out),c=r.next_out-u,l=Ra.buf2string(r.output,u);r.next_out=c,r.avail_out=n-c,c&&r.output.set(r.output.subarray(u,u+c),0),this.onData(l)}else this.onData(r.output.length===r.next_out?r.output:r.output.subarray(0,r.next_out));if(!(a===La&&s===0)){if(a===fu)return a=pr.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,!0;if(r.avail_in===0)break}}return!0};Va.prototype.onData=function(t){this.chunks.push(t)};Va.prototype.onEnd=function(t){t===La&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Ps.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function Zu(t,e){let r=new Va(e);if(r.push(t),r.err)throw r.msg||En[r.err];return r.result}function r_(t,e){return e=e||{},e.raw=!0,Zu(t,e)}var n_=Va,i_=Zu,a_=r_,o_=Zu,s_=Pn,c_={Inflate:n_,inflate:i_,inflateRaw:a_,ungzip:o_,constants:s_},{Deflate:u_,deflate:l_,deflateRaw:f_,gzip:p_}=gb,{Inflate:d_,inflate:h_,inflateRaw:m_,ungzip:g_}=c_,y_=u_,v_=l_,b_=f_,__=p_,S_=d_,w_=h_,E_=m_,x_=g_,I_=Pn,T_={Deflate:y_,deflate:v_,deflateRaw:b_,gzip:__,Inflate:S_,inflate:w_,inflateRaw:E_,ungzip:x_,constants:I_},ge=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},ye=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Ss=class{constructor(e,r){this.input=e,this.output=r}};ge([h(),ye("design:type",String)],Ss.prototype,"input",void 0);ge([h(),ye("design:type",String)],Ss.prototype,"output",void 0);Ss=ge([Be(),ye("design:paramtypes",[String,String])],Ss);var ws=class{constructor(e,r){this.input=e,this.output=r}};ge([h(),ye("design:type",String)],ws.prototype,"input",void 0);ge([h(),ye("design:type",String)],ws.prototype,"output",void 0);ws=ge([V(),ye("design:paramtypes",[String,String])],ws);var Vr=class{constructor(e,r,n,i,a){this.name=e,this.modelId=r,this.systemPrompt=n,this.promptExamples=i,this.metaData=a}};ge([h(),ye("design:type",String)],Vr.prototype,"name",void 0);ge([h(),ye("design:type",String)],Vr.prototype,"modelId",void 0);ge([h(),ye("design:type",String)],Vr.prototype,"systemPrompt",void 0);ge([h(),ye("design:type",Array)],Vr.prototype,"promptExamples",void 0);ge([h(),ye("design:type",String)],Vr.prototype,"metaData",void 0);Vr=ge([Be(),ye("design:paramtypes",[String,String,String,Array,String])],Vr);var tr=class{constructor(e,r,n,i,a,o,s,u){this.name=e,this.modelId=r,this.taskId=n,this.systemPrompt=i,this.promptExamples=a,this.metaData=o,this.createdAt=s,this.updatedAt=u}};ge([h(),ye("design:type",String)],tr.prototype,"name",void 0);ge([h(),ye("design:type",String)],tr.prototype,"modelId",void 0);ge([h(),ye("design:type",String)],tr.prototype,"taskId",void 0);ge([h(),ye("design:type",String)],tr.prototype,"systemPrompt",void 0);ge([h(),ye("design:type",Array)],tr.prototype,"promptExamples",void 0);ge([h(),ye("design:type",String)],tr.prototype,"metaData",void 0);ge([h(),ye("design:type",String)],tr.prototype,"createdAt",void 0);ge([h(),ye("design:type",String)],tr.prototype,"updatedAt",void 0);tr=ge([V(),ye("design:paramtypes",[String,String,String,String,Array,String,String,String])],tr);var Tn=class{constructor(e,r,n,i,a){this.model=e,this.status=r,this.progress=n,this.downloaded=i,this.loaded=a}};ge([h(),ye("design:type",String)],Tn.prototype,"model",void 0);ge([h(),ye("design:type",String)],Tn.prototype,"status",void 0);ge([h(),ye("design:type",Number)],Tn.prototype,"progress",void 0);ge([h(),ye("design:type",Boolean)],Tn.prototype,"downloaded",void 0);ge([h(),ye("design:type",Boolean)],Tn.prototype,"loaded",void 0);Tn=ge([V(),ye("design:paramtypes",[String,String,Number,Boolean,Boolean])],Tn);var k_=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},Me=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,ts,$u=class{constructor(e,r=!0){Fe.set(this,void 0),ts.set(this,new Map),k_(this,Fe,e,"f")}async getModels(){let e=await Me(this,Fe,"f").query({query:I`
693
712
  query {
694
713
  aiGetModels {
695
714
  id
@@ -713,23 +732,23 @@ triggerMatch
713
732
  modelType
714
733
  }
715
734
  }
716
- `});return k(e).aiGetModels}async addModel(e){let r=await Me(this,Le,"f").mutate({mutation:I`
735
+ `});return k(e).aiGetModels}async addModel(e){let r=await Me(this,Fe,"f").mutate({mutation:I`
717
736
  mutation($model: ModelInput!) {
718
737
  aiAddModel(model: $model)
719
738
  }
720
- `,variables:{model:e}});return k(r).aiAddModel}async updateModel(e,r){let n=await Me(this,Le,"f").mutate({mutation:I`
739
+ `,variables:{model:e}});return k(r).aiAddModel}async updateModel(e,r){let n=await Me(this,Fe,"f").mutate({mutation:I`
721
740
  mutation($modelId: String!, $model: ModelInput!) {
722
741
  aiUpdateModel(modelId: $modelId, model: $model)
723
742
  }
724
- `,variables:{modelId:e,model:r}});return k(n).aiUpdateModel}async removeModel(e){let r=await Me(this,Le,"f").mutate({mutation:I`
743
+ `,variables:{modelId:e,model:r}});return k(n).aiUpdateModel}async removeModel(e){let r=await Me(this,Fe,"f").mutate({mutation:I`
725
744
  mutation($modelId: String!) {
726
745
  aiRemoveModel(modelId: $modelId)
727
746
  }
728
- `,variables:{modelId:e}});return k(r).aiRemoveModel}async setDefaultModel(e,r){let n=await Me(this,Le,"f").mutate({mutation:I`
747
+ `,variables:{modelId:e}});return k(r).aiRemoveModel}async setDefaultModel(e,r){let n=await Me(this,Fe,"f").mutate({mutation:I`
729
748
  mutation($modelType: ModelType!, $modelId: String!) {
730
749
  aiSetDefaultModel(modelType: $modelType modelId: $modelId)
731
750
  }
732
- `,variables:{modelId:r,modelType:e}});return k(n).aiSetDefaultModel}async getDefaultModel(e){let r=await Me(this,Le,"f").query({query:I`
751
+ `,variables:{modelId:r,modelType:e}});return k(n).aiSetDefaultModel}async getDefaultModel(e){let r=await Me(this,Fe,"f").query({query:I`
733
752
  query($modelType: ModelType!) {
734
753
  aiGetDefaultModel(modelType: $modelType) {
735
754
  id
@@ -753,7 +772,7 @@ triggerMatch
753
772
  modelType
754
773
  }
755
774
  }
756
- `,variables:{modelType:e}});return k(r).aiGetDefaultModel}async tasks(){let{aiTasks:e}=k(await Me(this,Le,"f").query({query:I`
775
+ `,variables:{modelType:e}});return k(r).aiGetDefaultModel}async tasks(){let{aiTasks:e}=k(await Me(this,Fe,"f").query({query:I`
757
776
  query {
758
777
  aiTasks {
759
778
  name
@@ -769,7 +788,7 @@ triggerMatch
769
788
  updatedAt
770
789
  }
771
790
  }
772
- `}));return e}async addTask(e,r,n,i,a){let o=new Vr(e,r,n,i,a),{aiAddTask:s}=k(await Me(this,Le,"f").mutate({mutation:I`
791
+ `}));return e}async addTask(e,r,n,i,a){let o=new Vr(e,r,n,i,a),{aiAddTask:s}=k(await Me(this,Fe,"f").mutate({mutation:I`
773
792
  mutation AiAddTask($task: AITaskInput!) {
774
793
  aiAddTask(task: $task) {
775
794
  name
@@ -785,7 +804,7 @@ triggerMatch
785
804
  updatedAt
786
805
  }
787
806
  }
788
- `,variables:{task:o}}));return s}async removeTask(e){let{aiRemoveTask:r}=k(await Me(this,Le,"f").mutate({mutation:I`
807
+ `,variables:{task:o}}));return s}async removeTask(e){let{aiRemoveTask:r}=k(await Me(this,Fe,"f").mutate({mutation:I`
789
808
  mutation AiRemoveTask($taskId: String!) {
790
809
  aiRemoveTask(taskId: $taskId) {
791
810
  name
@@ -801,7 +820,7 @@ triggerMatch
801
820
  updatedAt
802
821
  }
803
822
  }
804
- `,variables:{taskId:e}}));return r}async updateTask(e,r){let{aiUpdateTask:n}=k(await Me(this,Le,"f").mutate({mutation:I`
823
+ `,variables:{taskId:e}}));return r}async updateTask(e,r){let{aiUpdateTask:n}=k(await Me(this,Fe,"f").mutate({mutation:I`
805
824
  mutation AiUpdateTask($taskId: String!, $task: AITaskInput!) {
806
825
  aiUpdateTask(taskId: $taskId, task: $task) {
807
826
  name
@@ -817,7 +836,7 @@ triggerMatch
817
836
  updatedAt
818
837
  }
819
838
  }
820
- `,variables:{taskId:e,task:{name:r.name,modelId:r.modelId,systemPrompt:r.systemPrompt,promptExamples:r.promptExamples}}}));return n}async modelLoadingStatus(e){let{aiModelLoadingStatus:r}=k(await Me(this,Le,"f").query({query:I`
839
+ `,variables:{taskId:e,task:{name:r.name,modelId:r.modelId,systemPrompt:r.systemPrompt,promptExamples:r.promptExamples}}}));return n}async modelLoadingStatus(e){let{aiModelLoadingStatus:r}=k(await Me(this,Fe,"f").query({query:I`
821
840
  query AiModelLoadingStatus($model: String!) {
822
841
  aiModelLoadingStatus(model: $model) {
823
842
  model
@@ -827,51 +846,51 @@ triggerMatch
827
846
  downloaded
828
847
  }
829
848
  }
830
- `,variables:{model:e}}));return r}async prompt(e,r){let{aiPrompt:n}=k(await Me(this,Le,"f").mutate({mutation:I`
849
+ `,variables:{model:e}}));return r}async prompt(e,r){let{aiPrompt:n}=k(await Me(this,Fe,"f").mutate({mutation:I`
831
850
  mutation AiPrompt($taskId: String!, $prompt: String!) {
832
851
  aiPrompt(taskId: $taskId, prompt: $prompt)
833
852
  }
834
- `,variables:{taskId:e,prompt:r}}));return n}async embed(e,r){let{aiEmbed:n}=k(await Me(this,Le,"f").mutate({mutation:I`
853
+ `,variables:{taskId:e,prompt:r}}));return n}async embed(e,r){let{aiEmbed:n}=k(await Me(this,Fe,"f").mutate({mutation:I`
835
854
  mutation aiEmbed($modelId: String!, $text: String!) {
836
855
  aiEmbed(modelId: $modelId, text: $text)
837
856
  }
838
- `,variables:{modelId:e,text:r}})),i=Ts.toByteArray(n);return JSON.parse(x_.inflate(i,{to:"string"}))}async openTranscriptionStream(e,r,n){let{aiOpenTranscriptionStream:i}=k(await Me(this,Le,"f").mutate({mutation:I`
857
+ `,variables:{modelId:e,text:r}})),i=Ds.toByteArray(n);return JSON.parse(T_.inflate(i,{to:"string"}))}async openTranscriptionStream(e,r,n){let{aiOpenTranscriptionStream:i}=k(await Me(this,Fe,"f").mutate({mutation:I`
839
858
  mutation AiOpenTranscriptionStream($modelId: String!, $params: VoiceActivityParamsInput) {
840
859
  aiOpenTranscriptionStream(modelId: $modelId, params: $params)
841
860
  }
842
- `,variables:{modelId:e,params:n}})),a=Me(this,Le,"f").subscribe({query:I` subscription {
861
+ `,variables:{modelId:e,params:n}})),a=Me(this,Fe,"f").subscribe({query:I` subscription {
843
862
  aiTranscriptionText(streamId: "${i}")
844
- }`}).subscribe({next(o){return r(o.data.aiTranscriptionText),o.data.aiTranscriptionText},error(o){console.error(o)}});return Me(this,Ho,"f").set(i,a),i}async closeTranscriptionStream(e){let{aiCloseTranscriptionStream:r}=k(await Me(this,Le,"f").mutate({mutation:I`
863
+ }`}).subscribe({next(o){return r(o.data.aiTranscriptionText),o.data.aiTranscriptionText},error(o){console.error(o)}});return Me(this,ts,"f").set(i,a),i}async closeTranscriptionStream(e){let{aiCloseTranscriptionStream:r}=k(await Me(this,Fe,"f").mutate({mutation:I`
845
864
  mutation aiCloseTranscriptionStream($streamId: String!) {
846
865
  aiCloseTranscriptionStream(streamId: $streamId)
847
866
  }
848
- `,variables:{streamId:e}})),n=Me(this,Ho,"f").get(e);return n.closed||n.unsubscribe(),r}async feedTranscriptionStream(e,r){let{aiFeedTranscriptionStream:n}=k(await Me(this,Le,"f").mutate({mutation:I`
867
+ `,variables:{streamId:e}})),n=Me(this,ts,"f").get(e);return n.closed||n.unsubscribe(),r}async feedTranscriptionStream(e,r){let{aiFeedTranscriptionStream:n}=k(await Me(this,Fe,"f").mutate({mutation:I`
849
868
  mutation AiFeedTranscriptionStream($streamIds: [String!]!, $audio: [Float!]!) {
850
869
  aiFeedTranscriptionStream(streamIds: $streamIds, audio: $audio)
851
870
  }
852
- `,variables:{streamIds:Array.isArray(e)?e:[e],audio:r}}));return n}};Le=new WeakMap,Ho=new WeakMap;var Ar=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},Re=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)},Wt,Jo,da,Yo,ha,fn,Zo,ma,vs=class{constructor(e,r=!0){Wt.set(this,void 0),Jo.set(this,void 0),da.set(this,void 0),Yo.set(this,void 0),ha.set(this,void 0),fn.set(this,void 0),Zo.set(this,void 0),ma.set(this,void 0),Ar(this,Wt,e,"f"),Ar(this,Jo,new Ea(Re(this,Wt,"f"),r),"f"),Ar(this,da,new Eu(Re(this,Wt,"f")),"f"),Ar(this,Yo,new _u(Re(this,Wt,"f")),"f"),Ar(this,ha,new wu(Re(this,Wt,"f")),"f"),Ar(this,ma,new Cu(Re(this,Wt,"f"),r),"f"),Ar(this,fn,new ps(Re(this,Wt,"f"),r),"f"),Re(this,fn,"f").setExpressionClient(Re(this,da,"f")),Re(this,fn,"f").setNeighbourhoodClient(Re(this,ha,"f")),Re(this,fn,"f").setAIClient(Re(this,ma,"f")),Ar(this,Zo,new Su(Re(this,Wt,"f"),r),"f")}get agent(){return Re(this,Jo,"f")}get expression(){return Re(this,da,"f")}get languages(){return Re(this,Yo,"f")}get neighbourhood(){return Re(this,ha,"f")}get perspective(){return Re(this,fn,"f")}get runtime(){return Re(this,Zo,"f")}get ai(){return Re(this,ma,"f")}};Wt=new WeakMap,Jo=new WeakMap,da=new WeakMap,Yo=new WeakMap,ha=new WeakMap,fn=new WeakMap,Zo=new WeakMap,ma=new WeakMap;var Ru;(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"})(Ru||(Ru={}));var Ju=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},Yu=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},gn=class{constructor(e,r){this.language=e,this.expression=r}};Ju([m(),Yu("design:type",Yt)],gn.prototype,"language",void 0);Ju([m(),Yu("design:type",String)],gn.prototype,"expression",void 0);gn=Ju([G(),Yu("design:paramtypes",[Yt,String])],gn);function GT(t){return t.language.address==="did"?t.expression.toString():`${t.language.address}://${t.expression}`}function WT(t){if(t.startsWith("literal://")){let a=new Yt;a.address="literal",a.name="literal";let o=t.substring(10);return new gn(a,o)}let r=/^([^:^\s]+):\/\/([\s\S]+)$/.exec(t);if(r&&r.length==3){let a=r[1],o=r[2],s=new Yt;return s.address=a,new gn(s,o)}let i=/^did:([^\s]+)$/.exec(t);if(i&&i.length==2){let a=new Yt;return a.address="did",new gn(a,t)}throw new Error("Couldn't parse string as expression URL or DID: "+t)}var Et=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},rr=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},bs=class{};Et([m(),rr("design:type",String)],bs.prototype,"name",void 0);Et([m(),rr("design:type",String)],bs.prototype,"type",void 0);bs=Et([G()],bs);var Pa=class{};Et([m(),rr("design:type",String)],Pa.prototype,"label",void 0);Et([m(),rr("design:type",String)],Pa.prototype,"name",void 0);Et([m(),rr("design:type",Array)],Pa.prototype,"parameters",void 0);Pa=Et([G()],Pa);var _s=class{get parameters(){return JSON.parse(this.parametersStringified)}constructor(e,r){this.name=e,this.parametersStringified=JSON.stringify(r)}};Et([m(),rr("design:type",String)],_s.prototype,"name",void 0);Et([m(),rr("design:type",String)],_s.prototype,"parametersStringified",void 0);_s=Et([Be(),rr("design:paramtypes",[String,Object])],_s);var ws=class{};Et([m(),rr("design:type",String)],ws.prototype,"did",void 0);Et([m(),rr("design:type",Sn)],ws.prototype,"status",void 0);ws=Et([G()],ws);var Zp=class{},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},Si=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Qr=class{};Rn([m(),Si("design:type",String)],Qr.prototype,"name",void 0);Rn([m(),Si("design:type",String)],Qr.prototype,"address",void 0);Rn([m(),Si("design:type",String)],Qr.prototype,"settings",void 0);Rn([m(),Si("design:type",bn)],Qr.prototype,"icon",void 0);Rn([m(),Si("design:type",bn)],Qr.prototype,"constructorIcon",void 0);Rn([m(),Si("design:type",bn)],Qr.prototype,"settingsIcon",void 0);Qr=Rn([G()],Qr);var ot=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},ht=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Mt=class{};ot([m(),ht("design:type",String)],Mt.prototype,"name",void 0);ot([m(),ht("design:type",String)],Mt.prototype,"address",void 0);ot([m(),ht("design:type",String)],Mt.prototype,"description",void 0);ot([m(),ht("design:type",String)],Mt.prototype,"author",void 0);ot([m(),ht("design:type",Boolean)],Mt.prototype,"templated",void 0);ot([m(),ht("design:type",String)],Mt.prototype,"templateSourceLanguageAddress",void 0);ot([m(),ht("design:type",String)],Mt.prototype,"templateAppliedParams",void 0);ot([m(),ht("design:type",Array)],Mt.prototype,"possibleTemplateParams",void 0);ot([m(),ht("design:type",String)],Mt.prototype,"sourceCodeLink",void 0);Mt=ot([G()],Mt);var hi=class{constructor(e,r){this.name=e,this.description=r,this.description||(this.description="")}};ot([m(),ht("design:type",String)],hi.prototype,"name",void 0);ot([m(),ht("design:type",String)],hi.prototype,"description",void 0);ot([m(),ht("design:type",Array)],hi.prototype,"possibleTemplateParams",void 0);ot([m(),ht("design:type",String)],hi.prototype,"sourceCodeLink",void 0);hi=ot([Be(),ht("design:paramtypes",[String,String])],hi);var Xp=class{},ed=class extends Gr(){},td=class{},Ds=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},Zu=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Ss=class{constructor(e,r){this.linkLanguage=e,this.meta=r}};Ds([m(),Zu("design:type",String)],Ss.prototype,"linkLanguage",void 0);Ds([m(),Zu("design:type",er)],Ss.prototype,"meta",void 0);Ss=Ds([G(),Zu("design:paramtypes",[String,er])],Ss);var Lu=class extends Gr(){};Lu=Ds([G()],Lu);var Ei=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},xi=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Fu;(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"})(Fu||(Fu={}));var kn=class{constructor(e,r,n){this.uuid=e,this.name=r,n?this.state=n:this.state=Fu.Private}};Ei([m(),xi("design:type",String)],kn.prototype,"uuid",void 0);Ei([m(),xi("design:type",String)],kn.prototype,"name",void 0);Ei([m(),xi("design:type",String)],kn.prototype,"state",void 0);Ei([m(),xi("design:type",String)],kn.prototype,"sharedUrl",void 0);Ei([m(),xi("design:type",Lu)],kn.prototype,"neighbourhood",void 0);kn=Ei([G(),xi("design:paramtypes",[String,String,String])],kn);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},ph=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Es=class{};Ns([m(),ph("design:type",Array)],Es.prototype,"additions",void 0);Ns([m(),ph("design:type",Array)],Es.prototype,"removals",void 0);Es=Ns([G()],Es);var rd=class extends Gr(){};rd=Ns([G()],rd);var nd=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},ni=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)},ya,pn,$o="smart_literal://content";function T_(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 Ca=class{constructor(e,r){ya.set(this,void 0),pn.set(this,void 0),nd(this,ya,e,"f"),nd(this,pn,r,"f")}get base(){return ni(this,pn,"f")}static async create(e,r){let n=_t.from(T_(10)).toUrl(),i=new Ca(e,n);return await i.set(r),i}static async isSmartLiteralBase(e,r){return(await e.get(new Ze({source:r,predicate:$o}))).length>0}static async getAllSmartLiterals(e){return(await e.get(new Ze({predicate:$o}))).map(n=>new Ca(e,n.data.source))}async get(){let e=await ni(this,ya,"f").getSingleTarget(new Ze({source:ni(this,pn,"f"),predicate:$o}));if(!e)throw`No content for smart literal ${ni(this,pn,"f")}`;return _t.fromUrl(e).get()}async set(e){let r=_t.from(e);await ni(this,ya,"f").setSingleTarget(new wn({source:ni(this,pn,"f"),predicate:$o,target:r.toUrl()}))}};ya=new WeakMap,pn=new WeakMap;var id=class{};function ok(t,e,r){return{action:"addLink",source:t,predicate:e,target:r}}function sk(t){return`triple(this, "${t}", _)`}function ck(t){return function(e,r,n){if(typeof n.value!="function")throw new Error("InstanceQuery decorator can only be applied to methods");n.value=async function(a){let o=[],s=e.name,u=`subject_class("${s}", C), instance(C, Instance)`;if(t&&t.where)for(let l in t.where){let d=t.where[l];u+=`, property_getter(C, Instance, "${l}", "${d}")`}t&&t.condition&&(u+=", "+t.condition);let c=await a.infer(u);if(c==!1)return o;if(typeof c=="string")throw c;for(let l of c){let d=l.Instance,p=new fs(a,d,s);await p.init(),o.push(p)}return o}}}function dh(t){return function(e,r){if(typeof t.writable>"u"&&t.through&&(t.writable=!0),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${Lr(n)}`]=()=>{}}Object.defineProperty(e,r,{configurable:!0,writable:!0})}}function uk(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 lk(t){return function(e,r){e.__collections=e.__collections||{},e.__collections[r]=t;let n=r;e[`add${Lr(n)}`]=()=>{},e[`remove${Lr(n)}`]=()=>{},e[`setCollection${Lr(n)}`]=()=>{},Object.defineProperty(e,r,{configurable:!0,writable:!0})}}function hh(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 k_(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=hh(8);r+=`subject_class("${n}", ${a}).
853
- `;let o=[],s=[];i.subjectConstructor&&i.subjectConstructor.length&&(s=s.concat(i.subjectConstructor));let u=[];i.isSubjectInstance&&i.isSubjectInstance.length&&(u=u.concat(i.isSubjectInstance));let c=[],l=i.__properties||{};for(let h in l){let y=`property(${a}, "${h}").
854
- `,{through:v,initial:E,required:_,resolveLanguage:b,writable:g,flag:A,getter:R,setter:T,local:C}=l[h];if(b&&(y+=`property_resolve(${a}, "${h}").
855
- `,y+=`property_resolve_language(${a}, "${h}", "${b}").
856
- `),R?y+=`property_getter(${a}, Base, "${h}", Value) :- ${R}.
857
- `:v&&(y+=`property_getter(${a}, Base, "${h}", Value) :- triple(Base, "${v}", Value).
858
- `,_&&(A?u.push(`triple(Base, "${v}", "${E}")`):u.push(`triple(Base, "${v}", _)`))),T)y+=`property_setter(${a}, "${h}", Actions) :- ${T}.
859
- `;else if(g&&v&&typeof i[qu(h)]=="function"){let L=[{action:"setSingleTarget",source:"this",predicate:v,target:"value",...C&&{local:!0}}];y+=`property_setter(${a}, "${h}", '${on(L)}').
860
- `}c.push(y),E&&(s.push({action:"addLink",source:"this",predicate:v,target:E}),o.push({action:"removeLink",source:"this",predicate:v,target:"*"}))}let d=[],p=i.__collections||{};for(let h in p){let y=`collection(${a}, "${h}").
861
- `,{through:v,where:E,local:_}=p[h];if(v){if(E){if(!E.isInstance&&!E.condition)throw"'where' needs one of 'isInstance' or 'condition'";let R=[];if(E.isInstance){let C;E.isInstance.name?C=E.isInstance.name:C=E.isInstance,R.push(`instance(OtherClass, Target), subject_class("${C}", OtherClass)`)}E.condition&&R.push(E.condition);let T=R.join(", ");y+=`collection_getter(${a}, Base, "${h}", List) :- setof(Target, (triple(Base, "${v}", Target), ${T}), List).
862
- `}else y+=`collection_getter(${a}, Base, "${h}", List) :- findall(C, triple(Base, "${v}", C), List).
863
- `;let b=[{action:"addLink",source:"this",predicate:v,target:"value",..._&&{local:!0}}],g=[{action:"removeLink",source:"this",predicate:v,target:"value"}],A=[{action:"collectionSetter",source:"this",predicate:v,target:"value",..._&&{local:!0}}];y+=`collection_adder(${a}, "${dr(h)}", '${on(b)}').
864
- `,y+=`collection_remover(${a}, "${dr(h)}", '${on(g)}').
865
- `,y+=`collection_setter(${a}, "${dr(h)}", '${on(A)}').
871
+ `,variables:{streamIds:Array.isArray(e)?e:[e],audio:r}}));return n}};Fe=new WeakMap,ts=new WeakMap;var Ar=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},Le=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)},Wt,rs,ma,ns,ga,fn,is,ya,Fa=class{constructor(e,r=!0){Wt.set(this,void 0),rs.set(this,void 0),ma.set(this,void 0),ns.set(this,void 0),ga.set(this,void 0),fn.set(this,void 0),is.set(this,void 0),ya.set(this,void 0),Ar(this,Wt,e,"f"),Ar(this,rs,new ka(Le(this,Wt,"f"),r),"f"),Ar(this,ma,new ku(Le(this,Wt,"f")),"f"),Ar(this,ns,new xu(Le(this,Wt,"f")),"f"),Ar(this,ga,new Iu(Le(this,Wt,"f")),"f"),Ar(this,ya,new $u(Le(this,Wt,"f"),r),"f"),Ar(this,fn,new ys(Le(this,Wt,"f"),r),"f"),Le(this,fn,"f").setExpressionClient(Le(this,ma,"f")),Le(this,fn,"f").setNeighbourhoodClient(Le(this,ga,"f")),Le(this,fn,"f").setAIClient(Le(this,ya,"f")),Ar(this,is,new Tu(Le(this,Wt,"f"),r),"f")}get agent(){return Le(this,rs,"f")}get expression(){return Le(this,ma,"f")}get languages(){return Le(this,ns,"f")}get neighbourhood(){return Le(this,ga,"f")}get perspective(){return Le(this,fn,"f")}get runtime(){return Le(this,is,"f")}get ai(){return Le(this,ya,"f")}};Wt=new WeakMap,rs=new WeakMap,ma=new WeakMap,ns=new WeakMap,ga=new WeakMap,fn=new WeakMap,is=new WeakMap,ya=new WeakMap;var Mu;(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"})(Mu||(Mu={}));var Xu=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},el=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},yn=class{constructor(e,r){this.language=e,this.expression=r}};Xu([h(),el("design:type",Yt)],yn.prototype,"language",void 0);Xu([h(),el("design:type",String)],yn.prototype,"expression",void 0);yn=Xu([V(),el("design:paramtypes",[Yt,String])],yn);function JT(t){return t.language.address==="did"?t.expression.toString():`${t.language.address}://${t.expression}`}function YT(t){if(t.startsWith("literal://")){let a=new Yt;a.address="literal",a.name="literal";let o=t.substring(10);return new yn(a,o)}let r=/^([^:^\s]+):\/\/([\s\S]+)$/.exec(t);if(r&&r.length==3){let a=r[1],o=r[2],s=new Yt;return s.address=a,new yn(s,o)}let i=/^did:([^\s]+)$/.exec(t);if(i&&i.length==2){let a=new Yt;return a.address="did",new yn(a,t)}throw new Error("Couldn't parse string as expression URL or DID: "+t)}var xt=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},rr=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Es=class{};xt([h(),rr("design:type",String)],Es.prototype,"name",void 0);xt([h(),rr("design:type",String)],Es.prototype,"type",void 0);Es=xt([V()],Es);var $a=class{};xt([h(),rr("design:type",String)],$a.prototype,"label",void 0);xt([h(),rr("design:type",String)],$a.prototype,"name",void 0);xt([h(),rr("design:type",Array)],$a.prototype,"parameters",void 0);$a=xt([V()],$a);var xs=class{get parameters(){return JSON.parse(this.parametersStringified)}constructor(e,r){this.name=e,this.parametersStringified=JSON.stringify(r)}};xt([h(),rr("design:type",String)],xs.prototype,"name",void 0);xt([h(),rr("design:type",String)],xs.prototype,"parametersStringified",void 0);xs=xt([Be(),rr("design:paramtypes",[String,Object])],xs);var Is=class{};xt([h(),rr("design:type",String)],Is.prototype,"did",void 0);xt([h(),rr("design:type",wn)],Is.prototype,"status",void 0);Is=xt([V()],Is);var Xp=class{},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},Ei=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Qr=class{};Rn([h(),Ei("design:type",String)],Qr.prototype,"name",void 0);Rn([h(),Ei("design:type",String)],Qr.prototype,"address",void 0);Rn([h(),Ei("design:type",String)],Qr.prototype,"settings",void 0);Rn([h(),Ei("design:type",bn)],Qr.prototype,"icon",void 0);Rn([h(),Ei("design:type",bn)],Qr.prototype,"constructorIcon",void 0);Rn([h(),Ei("design:type",bn)],Qr.prototype,"settingsIcon",void 0);Qr=Rn([V()],Qr);var ot=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},ht=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Ut=class{};ot([h(),ht("design:type",String)],Ut.prototype,"name",void 0);ot([h(),ht("design:type",String)],Ut.prototype,"address",void 0);ot([h(),ht("design:type",String)],Ut.prototype,"description",void 0);ot([h(),ht("design:type",String)],Ut.prototype,"author",void 0);ot([h(),ht("design:type",Boolean)],Ut.prototype,"templated",void 0);ot([h(),ht("design:type",String)],Ut.prototype,"templateSourceLanguageAddress",void 0);ot([h(),ht("design:type",String)],Ut.prototype,"templateAppliedParams",void 0);ot([h(),ht("design:type",Array)],Ut.prototype,"possibleTemplateParams",void 0);ot([h(),ht("design:type",String)],Ut.prototype,"sourceCodeLink",void 0);Ut=ot([V()],Ut);var hi=class{constructor(e,r){this.name=e,this.description=r,this.description||(this.description="")}};ot([h(),ht("design:type",String)],hi.prototype,"name",void 0);ot([h(),ht("design:type",String)],hi.prototype,"description",void 0);ot([h(),ht("design:type",Array)],hi.prototype,"possibleTemplateParams",void 0);ot([h(),ht("design:type",String)],hi.prototype,"sourceCodeLink",void 0);hi=ot([Be(),ht("design:paramtypes",[String,String])],hi);var ed=class{},td=class extends Gr(){},rd=class{},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},tl=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Ts=class{constructor(e,r){this.linkLanguage=e,this.meta=r}};Rs([h(),tl("design:type",String)],Ts.prototype,"linkLanguage",void 0);Rs([h(),tl("design:type",er)],Ts.prototype,"meta",void 0);Ts=Rs([V(),tl("design:paramtypes",[String,er])],Ts);var Uu=class extends Gr(){};Uu=Rs([V()],Uu);var xi=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},Ii=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},ju;(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"})(ju||(ju={}));var kn=class{constructor(e,r,n){this.uuid=e,this.name=r,n?this.state=n:this.state=ju.Private}};xi([h(),Ii("design:type",String)],kn.prototype,"uuid",void 0);xi([h(),Ii("design:type",String)],kn.prototype,"name",void 0);xi([h(),Ii("design:type",String)],kn.prototype,"state",void 0);xi([h(),Ii("design:type",String)],kn.prototype,"sharedUrl",void 0);xi([h(),Ii("design:type",Uu)],kn.prototype,"neighbourhood",void 0);kn=xi([V(),Ii("design:paramtypes",[String,String,String])],kn);var Ls=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},hh=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},ks=class{};Ls([h(),hh("design:type",Array)],ks.prototype,"additions",void 0);Ls([h(),hh("design:type",Array)],ks.prototype,"removals",void 0);ks=Ls([V()],ks);var nd=class extends Gr(){};nd=Ls([V()],nd);var id=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},ni=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)},va,pn,Vo="smart_literal://content";function O_(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 Ma=class{constructor(e,r){va.set(this,void 0),pn.set(this,void 0),id(this,va,e,"f"),id(this,pn,r,"f")}get base(){return ni(this,pn,"f")}static async create(e,r){let n=_t.from(O_(10)).toUrl(),i=new Ma(e,n);return await i.set(r),i}static async isSmartLiteralBase(e,r){return(await e.get(new Xe({source:r,predicate:Vo}))).length>0}static async getAllSmartLiterals(e){return(await e.get(new Xe({predicate:Vo}))).map(n=>new Ma(e,n.data.source))}async get(){let e=await ni(this,va,"f").getSingleTarget(new Xe({source:ni(this,pn,"f"),predicate:Vo}));if(!e)throw`No content for smart literal ${ni(this,pn,"f")}`;return _t.fromUrl(e).get()}async set(e){let r=_t.from(e);await ni(this,va,"f").setSingleTarget(new Sn({source:ni(this,pn,"f"),predicate:Vo,target:r.toUrl()}))}};va=new WeakMap,pn=new WeakMap;var ad=class{};function lk(t,e,r){return{action:"addLink",source:t,predicate:e,target:r}}function fk(t){return`triple(this, "${t}", _)`}function pk(t){return function(e,r,n){if(typeof n.value!="function")throw new Error("InstanceQuery decorator can only be applied to methods");n.value=async function(a){let o=[],s=e.name,u=`subject_class("${s}", C), instance(C, Instance)`;if(t&&t.where)for(let l in t.where){let d=t.where[l];u+=`, property_getter(C, Instance, "${l}", "${d}")`}t&&t.condition&&(u+=", "+t.condition);let c=await a.infer(u);if(c==!1)return o;if(typeof c=="string")throw c;for(let l of c){let d=l.Instance,p=new gs(a,d,s);await p.init(),o.push(p)}return o}}}function mh(t){return function(e,r){if(typeof t.writable>"u"&&t.through&&(t.writable=!0),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${Lr(n)}`]=()=>{}}Object.defineProperty(e,r,{configurable:!0,writable:!0})}}function dk(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 hk(t){return function(e,r){e.__collections=e.__collections||{},e.__collections[r]=t;let n=r;e[`add${Lr(n)}`]=()=>{},e[`remove${Lr(n)}`]=()=>{},e[`setCollection${Lr(n)}`]=()=>{},Object.defineProperty(e,r,{configurable:!0,writable:!0})}}function gh(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 mk(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=gh(8);r+=`subject_class("${n}", ${a}).
872
+ `;let o=[],s=[];i.subjectConstructor&&i.subjectConstructor.length&&(s=s.concat(i.subjectConstructor));let u=[];i.isSubjectInstance&&i.isSubjectInstance.length&&(u=u.concat(i.isSubjectInstance));let c=[],l=i.__properties||{};for(let m in l){let y=`property(${a}, "${m}").
873
+ `,{through:b,initial:E,required:S,resolveLanguage:_,writable:g,flag:A,getter:R,setter:T,local:C}=l[m];if(_&&(y+=`property_resolve(${a}, "${m}").
874
+ `,y+=`property_resolve_language(${a}, "${m}", "${_}").
875
+ `),R?y+=`property_getter(${a}, Base, "${m}", Value) :- ${R}.
876
+ `:b&&(y+=`property_getter(${a}, Base, "${m}", Value) :- triple(Base, "${b}", Value).
877
+ `,S&&(A?u.push(`triple(Base, "${b}", "${E}")`):u.push(`triple(Base, "${b}", _)`))),T)y+=`property_setter(${a}, "${m}", Actions) :- ${T}.
878
+ `;else if(g&&b&&typeof i[Od(m)]=="function"){let L=[{action:"setSingleTarget",source:"this",predicate:b,target:"value",...C&&{local:!0}}];y+=`property_setter(${a}, "${m}", '${on(L)}').
879
+ `}c.push(y),E&&(s.push({action:"addLink",source:"this",predicate:b,target:E}),o.push({action:"removeLink",source:"this",predicate:b,target:"*"}))}let d=[],p=i.__collections||{};for(let m in p){let y=`collection(${a}, "${m}").
880
+ `,{through:b,where:E,local:S}=p[m];if(b){if(E){if(!E.isInstance&&!E.condition)throw"'where' needs one of 'isInstance' or 'condition'";let R=[];if(E.isInstance){let C;E.isInstance.name?C=E.isInstance.name:C=E.isInstance,R.push(`instance(OtherClass, Target), subject_class("${C}", OtherClass)`)}E.condition&&R.push(E.condition);let T=R.join(", ");y+=`collection_getter(${a}, Base, "${m}", List) :- setof(Target, (triple(Base, "${b}", Target), ${T}), List).
881
+ `}else y+=`collection_getter(${a}, Base, "${m}", List) :- findall(C, triple(Base, "${b}", C), List).
882
+ `;let _=[{action:"addLink",source:"this",predicate:b,target:"value",...S&&{local:!0}}],g=[{action:"removeLink",source:"this",predicate:b,target:"value"}],A=[{action:"collectionSetter",source:"this",predicate:b,target:"value",...S&&{local:!0}}];y+=`collection_adder(${a}, "${dr(m)}", '${on(_)}').
883
+ `,y+=`collection_remover(${a}, "${dr(m)}", '${on(g)}').
884
+ `,y+=`collection_setter(${a}, "${dr(m)}", '${on(A)}').
866
885
  `}d.push(y)}let f=on(s);if(r+=`constructor(${a}, '${f}').
867
- `,u.length>0){let h=u.join(", ");r+=`instance(${a}, Base) :- ${h}.
886
+ `,u.length>0){let m=u.join(", ");r+=`instance(${a}, Base) :- ${m}.
868
887
  `,r+=`
869
888
  `}return r+=`destructor(${a}, '${on(o)}').
870
889
  `,r+=`
871
890
  `,r+=c.join(`
872
891
  `),r+=`
873
892
  `,r+=d.join(`
874
- `),{sdna:r,name:n}},Object.defineProperty(e,"type",{configurable:!0})}}function fk(t){return dh({...t,required:!0,writable:!0,initial:t.initial||"literal://string:uninitialized"})}function pk(t){return dh({...t,writable:!1})}var dk=`
893
+ `),{sdna:r,name:n}},Object.defineProperty(e,"type",{configurable:!0})}}function gk(t){return mh({...t,required:!0,writable:!0,initial:t.initial||"literal://string:uninitialized"})}function yk(t){return mh({...t,writable:!1})}var vk=`
875
894
  type AIModelLoadingStatus {
876
895
  downloaded: Boolean!
877
896
  loaded: Boolean!
@@ -1240,6 +1259,7 @@ type Mutation {
1240
1259
  runtimeRemoveNotification(id: String!): Boolean!
1241
1260
  runtimeRequestInstallNotification(notification: NotificationInput!): String!
1242
1261
  runtimeRestartHolochain: Boolean!
1262
+ runtimeSetMultiUserEnabled(enabled: Boolean!): Boolean!
1243
1263
  runtimeSetStatus(status: PerspectiveInput!): Boolean!
1244
1264
  runtimeUpdateNotification(id: String!, notification: NotificationInput!): Boolean!
1245
1265
  }
@@ -1346,8 +1366,10 @@ type Query {
1346
1366
  runtimeHcAgentInfos: String!
1347
1367
  runtimeInfo: RuntimeInfo!
1348
1368
  runtimeKnownLinkLanguageTemplates: [String!]!
1369
+ runtimeListUsers: [UserStatistics!]!
1349
1370
  runtimeMessageInbox(filter: String): [PerspectiveExpression!]!
1350
1371
  runtimeMessageOutbox(filter: String): [SentMessage!]!
1372
+ runtimeMultiUserEnabled: Boolean!
1351
1373
  runtimeNotifications: [Notification!]!
1352
1374
  runtimeVerifyStringSignedByDid(data: String!, did: String!, didSigningKeyId: String!, signedData: String!): Boolean!
1353
1375
  }
@@ -1415,6 +1437,13 @@ type TriggeredNotification {
1415
1437
  triggerMatch: String!
1416
1438
  }
1417
1439
 
1440
+ type UserStatistics {
1441
+ did: String!
1442
+ email: String!
1443
+ lastSeen: String
1444
+ perspectiveCount: Int!
1445
+ }
1446
+
1418
1447
  input VoiceActivityParamsInput {
1419
1448
  endThreshold: Float
1420
1449
  endWindow: Float
@@ -1422,7 +1451,7 @@ input VoiceActivityParamsInput {
1422
1451
  startWindow: Float
1423
1452
  timeBeforeSpeech: Float
1424
1453
  }
1425
- `;function ad(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 hk(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`${ad(e)} your ${r} actions, with access to ${ad(n)}`}var P=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},S=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},de=function(t,e){return function(r,n){e(r,n,t)}},ja=new jr;ja.author="did:ad4m:test";ja.timestamp=Date.now();ja.data={source:"root",target:"neighbourhood://Qm12345"};ja.proof={signature:"",key:"",valid:!0};var Cr=new Sn;Cr.author="did:ad4m:test";Cr.timestamp=Date.now().toString();Cr.proof=new hr("","");Cr.data=new er([ja]);var xs=class{};P([m(),S("design:type",String)],xs.prototype,"recipient",void 0);P([m(),S("design:type",Sn)],xs.prototype,"message",void 0);xs=P([G()],xs);var mi=class{};P([m(),S("design:type",String)],mi.prototype,"ad4mExecutorVersion",void 0);P([m(),S("design:type",Boolean)],mi.prototype,"isInitialized",void 0);P([m(),S("design:type",Boolean)],mi.prototype,"isUnlocked",void 0);mi=P([G()],mi);var On=class{};P([m(),S("design:type",String)],On.prototype,"title",void 0);P([m(),S("design:type",String)],On.prototype,"message",void 0);P([m(),S("design:type",String)],On.prototype,"type",void 0);P([m(),S("design:type",String)],On.prototype,"addon",void 0);On=P([G()],On);var Nt=class{};P([m(),S("design:type",String)],Nt.prototype,"description",void 0);P([m(),S("design:type",String)],Nt.prototype,"appName",void 0);P([m(),S("design:type",String)],Nt.prototype,"appUrl",void 0);P([m(),S("design:type",String)],Nt.prototype,"appIconPath",void 0);P([m(),S("design:type",String)],Nt.prototype,"trigger",void 0);P([m(),S("design:type",Array)],Nt.prototype,"perspectiveIds",void 0);P([m(),S("design:type",String)],Nt.prototype,"webhookUrl",void 0);P([m(),S("design:type",String)],Nt.prototype,"webhookAuth",void 0);Nt=P([Be()],Nt);var wt=class{};P([m(),S("design:type",String)],wt.prototype,"id",void 0);P([m(),S("design:type",Boolean)],wt.prototype,"granted",void 0);P([m(),S("design:type",String)],wt.prototype,"description",void 0);P([m(),S("design:type",String)],wt.prototype,"appName",void 0);P([m(),S("design:type",String)],wt.prototype,"appUrl",void 0);P([m(),S("design:type",String)],wt.prototype,"appIconPath",void 0);P([m(),S("design:type",String)],wt.prototype,"trigger",void 0);P([m(),S("design:type",Array)],wt.prototype,"perspectiveIds",void 0);P([m(),S("design:type",String)],wt.prototype,"webhookUrl",void 0);P([m(),S("design:type",String)],wt.prototype,"webhookAuth",void 0);wt=P([G()],wt);var yi=class{};P([m(),S("design:type",wt)],yi.prototype,"notification",void 0);P([m(),S("design:type",String)],yi.prototype,"perspectiveId",void 0);P([m(),S("design:type",String)],yi.prototype,"triggerMatch",void 0);yi=P([G()],yi);var qe=class{};P([m(),S("design:type",Number)],qe.prototype,"total",void 0);P([m(),S("design:type",Number)],qe.prototype,"imported",void 0);P([m(),S("design:type",Number)],qe.prototype,"failed",void 0);P([m(),S("design:type",Number)],qe.prototype,"omitted",void 0);P([m(),S("design:type",Array)],qe.prototype,"errors",void 0);qe=P([G()],qe);var St=class{};P([m(),S("design:type",qe)],St.prototype,"perspectives",void 0);P([m(),S("design:type",qe)],St.prototype,"links",void 0);P([m(),S("design:type",qe)],St.prototype,"expressions",void 0);P([m(),S("design:type",qe)],St.prototype,"perspectiveDiffs",void 0);P([m(),S("design:type",qe)],St.prototype,"notifications",void 0);P([m(),S("design:type",qe)],St.prototype,"models",void 0);P([m(),S("design:type",qe)],St.prototype,"defaultModels",void 0);P([m(),S("design:type",qe)],St.prototype,"tasks",void 0);P([m(),S("design:type",qe)],St.prototype,"friends",void 0);P([m(),S("design:type",qe)],St.prototype,"trustedAgents",void 0);P([m(),S("design:type",qe)],St.prototype,"knownLinkLanguages",void 0);St=P([G()],St);var ee=class{runtimeQuit(){return!0}runtimeOpenLink(e){return!0}runtimeInfo(){return{ad4mExecutorVersion:"x.x.x",isInitialized:!0,isUnlocked:!0}}addTrustedAgents(e){return e}deleteTrustedAgents(e){return[]}getTrustedAgents(){return["agentPubKey"]}runtimeKnownLinkLanguageTemplates(){return["Qm12345abcdef"]}runtimeAddKnownLinkLanguageTemplates(e){return e}runtimeRemoveKnownLinkLanguageTemplates(e){return[]}runtimeFriends(){return["did:test:friend"]}runtimeAddFriends(e){return e}runtimeRemoveFriends(e){return[]}runtimeHcAgentInfos(){return JSON.stringify([{agent:{type:"Buffer",data:[9,191,231,58,255,107,202,55,206,57,9,103,17,34,206,195,207,114,5,73,77,198,56,136,17,227,242,231,194,135,128,48,170,189,119,186]},signature:{type:"Buffer",data:[195,143,170,36,234,123,255,85,188,138,124,2,91,18,53,231,44,41,240,8,80,131,100,150,165,125,146,90,17,200,190,129,114,211,11,146,150,128,198,199,79,118,157,101,194,68,58,245,98,182,79,139,140,41,143,129,8,136,87,77,180,231,218,11]},agent_info:{type:"Buffer",data:[134,165,115,112,97,99,101,196,36,203,165,212,173,24,215,165,196,25,145,248,113,246,139,205,182,241,138,57,0,26,8,217,179,23,126,59,136,128,213,110,225,173,72,197,95,165,97,103,101,110,116,196,36,9,191,231,58,255,107,202,55,206,57,9,103,17,34,206,195,207,114,5,73,77,198,56,136,17,227,242,231,194,135,128,48,170,189,119,186,164,117,114,108,115,145,217,99,107,105,116,115,117,110,101,45,112,114,111,120,121,58,47,47,101,83,52,86,112,54,109,118,80,48,122,116,85,101,104,114,117,113,89,52,102,66,53,101,69,98,121,48,69,66,100,89,84,50,95,67,48,69,112,77,111,76,111,47,107,105,116,115,117,110,101,45,113,117,105,99,47,104,47,49,57,50,46,49,54,56,46,49,55,56,46,54,48,47,112,47,55,55,52,52,47,45,45,172,115,105,103,110,101,100,95,97,116,95,109,115,207,0,0,1,123,233,104,189,50,176,101,120,112,105,114,101,115,95,97,102,116,101,114,95,109,115,206,0,18,79,128,169,109,101,116,97,95,105,110,102,111,196,34,129,187,100,104,116,95,115,116,111,114,97,103,101,95,97,114,99,95,104,97,108,102,95,108,101,110,103,116,104,206,128,0,0,1]}},{agent:{type:"Buffer",data:[98,187,145,48,115,209,94,143,31,153,102,69,138,29,133,213,34,52,39,164,157,139,178,111,23,33,118,250,28,155,78,246,128,49,179,38]},signature:{type:"Buffer",data:[233,192,38,3,59,248,124,231,57,255,40,154,50,60,119,252,68,198,154,109,175,155,106,217,211,155,109,223,249,91,221,210,17,132,72,230,11,230,247,119,72,244,145,91,75,7,67,5,130,151,44,231,52,220,28,154,212,82,58,90,203,211,236,4]},agent_info:{type:"Buffer",data:[134,165,115,112,97,99,101,196,36,203,165,212,173,24,215,165,196,25,145,248,113,246,139,205,182,241,138,57,0,26,8,217,179,23,126,59,136,128,213,110,225,173,72,197,95,165,97,103,101,110,116,196,36,98,187,145,48,115,209,94,143,31,153,102,69,138,29,133,213,34,52,39,164,157,139,178,111,23,33,118,250,28,155,78,246,128,49,179,38,164,117,114,108,115,145,217,99,107,105,116,115,117,110,101,45,112,114,111,120,121,58,47,47,55,101,77,106,48,73,83,72,56,56,81,56,45,89,51,74,89,70,53,76,72,57,83,54,68,119,71,73,49,88,45,115,87,53,68,104,66,87,121,71,119,78,115,47,107,105,116,115,117,110,101,45,113,117,105,99,47,104,47,49,57,50,46,49,54,56,46,49,55,56,46,54,48,47,112,47,55,55,52,52,47,45,45,172,115,105,103,110,101,100,95,97,116,95,109,115,207,0,0,1,123,233,103,45,197,176,101,120,112,105,114,101,115,95,97,102,116,101,114,95,109,115,206,0,18,79,128,169,109,101,116,97,95,105,110,102,111,196,34,129,187,100,104,116,95,115,116,111,114,97,103,101,95,97,114,99,95,104,97,108,102,95,108,101,110,103,116,104,206,128,0,0,1]}},{agent:{type:"Buffer",data:[181,101,115,45,214,127,198,153,159,184,30,87,67,224,208,184,203,176,130,158,236,127,153,125,243,183,188,167,154,25,118,254,101,145,210,109]},signature:{type:"Buffer",data:[88,189,229,122,44,171,194,156,90,79,148,49,207,224,34,199,219,88,24,243,103,127,123,41,87,171,127,92,6,216,198,171,26,226,237,217,122,78,98,146,55,255,68,240,202,83,58,140,147,185,3,66,15,216,210,22,99,197,73,234,120,17,74,1]},agent_info:{type:"Buffer",data:[134,165,115,112,97,99,101,196,36,203,165,212,173,24,215,165,196,25,145,248,113,246,139,205,182,241,138,57,0,26,8,217,179,23,126,59,136,128,213,110,225,173,72,197,95,165,97,103,101,110,116,196,36,181,101,115,45,214,127,198,153,159,184,30,87,67,224,208,184,203,176,130,158,236,127,153,125,243,183,188,167,154,25,118,254,101,145,210,109,164,117,114,108,115,145,217,99,107,105,116,115,117,110,101,45,112,114,111,120,121,58,47,47,114,70,71,83,100,113,104,101,68,107,70,70,56,69,102,109,45,69,116,55,119,81,101,120,83,88,55,65,112,69,51,89,86,99,45,120,102,52,104,106,77,115,77,47,107,105,116,115,117,110,101,45,113,117,105,99,47,104,47,49,57,50,46,49,54,56,46,49,55,56,46,54,48,47,112,47,55,55,52,52,47,45,45,172,115,105,103,110,101,100,95,97,116,95,109,115,207,0,0,1,123,233,113,23,220,176,101,120,112,105,114,101,115,95,97,102,116,101,114,95,109,115,206,0,18,79,128,169,109,101,116,97,95,105,110,102,111,196,34,129,187,100,104,116,95,115,116,111,114,97,103,101,95,97,114,99,95,104,97,108,102,95,108,101,110,103,116,104,206,128,0,0,1]}},{agent:{type:"Buffer",data:[3,171,237,107,186,245,165,47,237,235,211,49,245,62,113,53,255,252,223,226,75,118,148,187,23,53,70,174,160,184,64,63,94,210,227,56]},signature:{type:"Buffer",data:[129,12,55,104,239,121,138,2,86,106,136,51,219,79,170,8,195,69,81,188,225,192,247,196,54,39,164,110,75,39,240,56,245,189,154,77,72,11,97,250,202,149,242,97,128,28,47,164,236,104,136,82,212,246,44,143,132,119,255,135,112,11,20,13]},agent_info:{type:"Buffer",data:[134,165,115,112,97,99,101,196,36,203,165,212,173,24,215,165,196,25,145,248,113,246,139,205,182,241,138,57,0,26,8,217,179,23,126,59,136,128,213,110,225,173,72,197,95,165,97,103,101,110,116,196,36,3,171,237,107,186,245,165,47,237,235,211,49,245,62,113,53,255,252,223,226,75,118,148,187,23,53,70,174,160,184,64,63,94,210,227,56,164,117,114,108,115,145,217,97,107,105,116,115,117,110,101,45,112,114,111,120,121,58,47,47,104,121,112,115,86,121,103,117,80,84,115,53,118,73,80,65,102,97,112,90,88,113,117,84,115,79,80,100,67,81,79,79,117,103,57,51,82,103,106,95,114,85,73,47,107,105,116,115,117,110,101,45,113,117,105,99,47,104,47,49,54,53,46,50,50,46,51,50,46,49,49,47,112,47,53,55,55,57,47,45,45,172,115,105,103,110,101,100,95,97,116,95,109,115,207,0,0,1,123,233,113,188,123,176,101,120,112,105,114,101,115,95,97,102,116,101,114,95,109,115,206,0,18,79,128,169,109,101,116,97,95,105,110,102,111,196,34,129,187,100,104,116,95,115,116,111,114,97,103,101,95,97,114,99,95,104,97,108,102,95,108,101,110,103,116,104,206,128,0,0,1]}}])}runtimeGetNetworkMetrics(){return JSON.stringify({metrics:{},stats:{}})}runtimeRestartHolochain(){return!0}runtimeHcAddAgentInfos(e){return!0}runtimeVerifyStringSignedByDid(e,r,n,i){return!0}runtimeSetStatus(e){return!0}runtimeFriendStatus(e){return Cr}runtimeFriendSendMessage(e,r){return!0}runtimeMessageInbox(e){return[Cr]}runtimeMessageOutbox(e){return[{recipient:"did:test:recipient",message:Cr}]}runtimeMessageReceived(){return Cr}exceptionOccurred(){return{title:"Test title",message:"Test message",type:Ru.LanguageIsNotLoaded}}runtimeRequestInstallNotification(e){return"new-notification-id"}runtimeNotifications(){return[{id:"test-id",granted:!1,description:"Test description",appName:"Test app name",appUrl:"https://example.com",appIconPath:"https://fluxsocial.io/favicon",trigger:"triple(X, ad4m://has_type, flux://message)",perspectiveIds:["u983ud-jdhh38d"],webhookUrl:"https://example.com/webhook",webhookAuth:"test-auth"}]}runtimeUpdateNotification(e,r){return!0}runtimeRemoveNotification(e){return!0}runtimeGrantNotification(e){return!0}runtimeNotificationTriggered(){return{perspectiveId:"test-perspective-id",triggerMatch:"test-trigger-match",notification:{id:"test-id",granted:!1,description:"Test description",appName:"Test app name",appUrl:"https://example.com",appIconPath:"https://fluxsocial.io/favicon",trigger:"triple(X, ad4m://has_type, flux://message)",perspectiveIds:["u983ud-jdhh38d"],webhookUrl:"https://example.com/webhook",webhookAuth:"test-auth"}}}runtimeExportDb(e){return!0}runtimeImportDb(e){return!0}runtimeExportPerspective(e,r){return!0}runtimeImportPerspective(e){return!0}};P([$e(),S("design:type",Function),S("design:paramtypes",[]),S("design:returntype",Boolean)],ee.prototype,"runtimeQuit",null);P([$e(),de(0,pe()),S("design:type",Function),S("design:paramtypes",[String]),S("design:returntype",Boolean)],ee.prototype,"runtimeOpenLink",null);P([jt(),S("design:type",Function),S("design:paramtypes",[]),S("design:returntype",mi)],ee.prototype,"runtimeInfo",null);P([$e(),de(0,pe()),S("design:type",Function),S("design:paramtypes",[Array]),S("design:returntype",Array)],ee.prototype,"addTrustedAgents",null);P([$e(),de(0,pe()),S("design:type",Function),S("design:paramtypes",[Array]),S("design:returntype",Array)],ee.prototype,"deleteTrustedAgents",null);P([jt(),S("design:type",Function),S("design:paramtypes",[]),S("design:returntype",Array)],ee.prototype,"getTrustedAgents",null);P([jt(),S("design:type",Function),S("design:paramtypes",[]),S("design:returntype",Array)],ee.prototype,"runtimeKnownLinkLanguageTemplates",null);P([$e(),de(0,pe()),S("design:type",Function),S("design:paramtypes",[Array]),S("design:returntype",Array)],ee.prototype,"runtimeAddKnownLinkLanguageTemplates",null);P([$e(),de(0,pe()),S("design:type",Function),S("design:paramtypes",[Array]),S("design:returntype",Array)],ee.prototype,"runtimeRemoveKnownLinkLanguageTemplates",null);P([jt(),S("design:type",Function),S("design:paramtypes",[]),S("design:returntype",Array)],ee.prototype,"runtimeFriends",null);P([$e(),de(0,pe()),S("design:type",Function),S("design:paramtypes",[Array]),S("design:returntype",Array)],ee.prototype,"runtimeAddFriends",null);P([$e(),de(0,pe()),S("design:type",Function),S("design:paramtypes",[Array]),S("design:returntype",Array)],ee.prototype,"runtimeRemoveFriends",null);P([jt(),S("design:type",Function),S("design:paramtypes",[]),S("design:returntype",String)],ee.prototype,"runtimeHcAgentInfos",null);P([jt(),S("design:type",Function),S("design:paramtypes",[]),S("design:returntype",String)],ee.prototype,"runtimeGetNetworkMetrics",null);P([$e(),S("design:type",Function),S("design:paramtypes",[]),S("design:returntype",Boolean)],ee.prototype,"runtimeRestartHolochain",null);P([$e(),de(0,pe()),S("design:type",Function),S("design:paramtypes",[Object]),S("design:returntype",Boolean)],ee.prototype,"runtimeHcAddAgentInfos",null);P([jt(),de(0,pe()),de(1,pe()),de(2,pe()),de(3,pe()),S("design:type",Function),S("design:paramtypes",[String,String,String,String]),S("design:returntype",void 0)],ee.prototype,"runtimeVerifyStringSignedByDid",null);P([$e(),de(0,pe()),S("design:type",Function),S("design:paramtypes",[er]),S("design:returntype",Boolean)],ee.prototype,"runtimeSetStatus",null);P([jt(),de(0,pe()),S("design:type",Function),S("design:paramtypes",[String]),S("design:returntype",Sn)],ee.prototype,"runtimeFriendStatus",null);P([$e(),de(0,pe()),de(1,pe()),S("design:type",Function),S("design:paramtypes",[String,ss]),S("design:returntype",Boolean)],ee.prototype,"runtimeFriendSendMessage",null);P([jt(),de(0,pe()),S("design:type",Function),S("design:paramtypes",[String]),S("design:returntype",Array)],ee.prototype,"runtimeMessageInbox",null);P([jt(),de(0,pe()),S("design:type",Function),S("design:paramtypes",[String]),S("design:returntype",Array)],ee.prototype,"runtimeMessageOutbox",null);P([Mu(),S("design:type",Function),S("design:paramtypes",[]),S("design:returntype",Sn)],ee.prototype,"runtimeMessageReceived",null);P([Mu(),S("design:type",Function),S("design:paramtypes",[]),S("design:returntype",On)],ee.prototype,"exceptionOccurred",null);P([$e(),de(0,pe()),S("design:type",Function),S("design:paramtypes",[Nt]),S("design:returntype",String)],ee.prototype,"runtimeRequestInstallNotification",null);P([jt(),S("design:type",Function),S("design:paramtypes",[]),S("design:returntype",Array)],ee.prototype,"runtimeNotifications",null);P([$e(),de(0,pe()),de(1,pe()),S("design:type",Function),S("design:paramtypes",[String,Nt]),S("design:returntype",Boolean)],ee.prototype,"runtimeUpdateNotification",null);P([$e(),de(0,pe()),S("design:type",Function),S("design:paramtypes",[String]),S("design:returntype",Boolean)],ee.prototype,"runtimeRemoveNotification",null);P([$e(),de(0,pe()),S("design:type",Function),S("design:paramtypes",[String]),S("design:returntype",Boolean)],ee.prototype,"runtimeGrantNotification",null);P([Mu(),S("design:type",Function),S("design:paramtypes",[]),S("design:returntype",yi)],ee.prototype,"runtimeNotificationTriggered",null);P([$e(),de(0,pe()),S("design:type",Function),S("design:paramtypes",[String]),S("design:returntype",Boolean)],ee.prototype,"runtimeExportDb",null);P([$e(),de(0,pe()),S("design:type",Function),S("design:paramtypes",[String]),S("design:returntype",Boolean)],ee.prototype,"runtimeImportDb",null);P([$e(),de(0,pe()),de(1,pe()),S("design:type",Function),S("design:paramtypes",[String,String]),S("design:returntype",Boolean)],ee.prototype,"runtimeExportPerspective",null);P([$e(),de(0,pe()),S("design:type",Function),S("design:paramtypes",[String]),S("design:returntype",Boolean)],ee.prototype,"runtimeImportPerspective",null);ee=P([og()],ee);var Ki=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},K=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)},pt,Kt,Xo,Ee;function es(t){return t.charAt(0).toUpperCase()+t.slice(1)}function od(t){return t?`triple("${t}", "ad4m://has_child", Base)`:""}function uu(){return`
1454
+ `;function od(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 bk(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`${od(e)} your ${r} actions, with access to ${od(n)}`}var N=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},v=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},de=function(t,e){return function(r,n){e(r,n,t)}},Qa=new Ur;Qa.author="did:ad4m:test";Qa.timestamp=Date.now();Qa.data={source:"root",target:"neighbourhood://Qm12345"};Qa.proof={signature:"",key:"",valid:!0};var Cr=new wn;Cr.author="did:ad4m:test";Cr.timestamp=Date.now().toString();Cr.proof=new hr("","");Cr.data=new er([Qa]);var Os=class{};N([h(),v("design:type",String)],Os.prototype,"recipient",void 0);N([h(),v("design:type",wn)],Os.prototype,"message",void 0);Os=N([V()],Os);var mi=class{};N([h(),v("design:type",String)],mi.prototype,"ad4mExecutorVersion",void 0);N([h(),v("design:type",Boolean)],mi.prototype,"isInitialized",void 0);N([h(),v("design:type",Boolean)],mi.prototype,"isUnlocked",void 0);mi=N([V()],mi);var On=class{};N([h(),v("design:type",String)],On.prototype,"title",void 0);N([h(),v("design:type",String)],On.prototype,"message",void 0);N([h(),v("design:type",String)],On.prototype,"type",void 0);N([h(),v("design:type",String)],On.prototype,"addon",void 0);On=N([V()],On);var Pt=class{};N([h(),v("design:type",String)],Pt.prototype,"description",void 0);N([h(),v("design:type",String)],Pt.prototype,"appName",void 0);N([h(),v("design:type",String)],Pt.prototype,"appUrl",void 0);N([h(),v("design:type",String)],Pt.prototype,"appIconPath",void 0);N([h(),v("design:type",String)],Pt.prototype,"trigger",void 0);N([h(),v("design:type",Array)],Pt.prototype,"perspectiveIds",void 0);N([h(),v("design:type",String)],Pt.prototype,"webhookUrl",void 0);N([h(),v("design:type",String)],Pt.prototype,"webhookAuth",void 0);Pt=N([Be()],Pt);var St=class{};N([h(),v("design:type",String)],St.prototype,"id",void 0);N([h(),v("design:type",Boolean)],St.prototype,"granted",void 0);N([h(),v("design:type",String)],St.prototype,"description",void 0);N([h(),v("design:type",String)],St.prototype,"appName",void 0);N([h(),v("design:type",String)],St.prototype,"appUrl",void 0);N([h(),v("design:type",String)],St.prototype,"appIconPath",void 0);N([h(),v("design:type",String)],St.prototype,"trigger",void 0);N([h(),v("design:type",Array)],St.prototype,"perspectiveIds",void 0);N([h(),v("design:type",String)],St.prototype,"webhookUrl",void 0);N([h(),v("design:type",String)],St.prototype,"webhookAuth",void 0);St=N([V()],St);var gi=class{};N([h(),v("design:type",St)],gi.prototype,"notification",void 0);N([h(),v("design:type",String)],gi.prototype,"perspectiveId",void 0);N([h(),v("design:type",String)],gi.prototype,"triggerMatch",void 0);gi=N([V()],gi);var qe=class{};N([h(),v("design:type",Number)],qe.prototype,"total",void 0);N([h(),v("design:type",Number)],qe.prototype,"imported",void 0);N([h(),v("design:type",Number)],qe.prototype,"failed",void 0);N([h(),v("design:type",Number)],qe.prototype,"omitted",void 0);N([h(),v("design:type",Array)],qe.prototype,"errors",void 0);qe=N([V()],qe);var wt=class{};N([h(),v("design:type",qe)],wt.prototype,"perspectives",void 0);N([h(),v("design:type",qe)],wt.prototype,"links",void 0);N([h(),v("design:type",qe)],wt.prototype,"expressions",void 0);N([h(),v("design:type",qe)],wt.prototype,"perspectiveDiffs",void 0);N([h(),v("design:type",qe)],wt.prototype,"notifications",void 0);N([h(),v("design:type",qe)],wt.prototype,"models",void 0);N([h(),v("design:type",qe)],wt.prototype,"defaultModels",void 0);N([h(),v("design:type",qe)],wt.prototype,"tasks",void 0);N([h(),v("design:type",qe)],wt.prototype,"friends",void 0);N([h(),v("design:type",qe)],wt.prototype,"trustedAgents",void 0);N([h(),v("design:type",qe)],wt.prototype,"knownLinkLanguages",void 0);wt=N([V()],wt);var yi=class{};N([h(),v("design:type",String)],yi.prototype,"email",void 0);N([h(),v("design:type",String)],yi.prototype,"did",void 0);N([h(),v("design:type",String)],yi.prototype,"lastSeen",void 0);N([h(),v("design:type",Number)],yi.prototype,"perspectiveCount",void 0);yi=N([V()],yi);var H=class{runtimeQuit(){return!0}runtimeOpenLink(e){return!0}runtimeInfo(){return{ad4mExecutorVersion:"x.x.x",isInitialized:!0,isUnlocked:!0}}addTrustedAgents(e){return e}deleteTrustedAgents(e){return[]}getTrustedAgents(){return["agentPubKey"]}runtimeKnownLinkLanguageTemplates(){return["Qm12345abcdef"]}runtimeAddKnownLinkLanguageTemplates(e){return e}runtimeRemoveKnownLinkLanguageTemplates(e){return[]}runtimeFriends(){return["did:test:friend"]}runtimeAddFriends(e){return e}runtimeRemoveFriends(e){return[]}runtimeHcAgentInfos(){return JSON.stringify([{agent:{type:"Buffer",data:[9,191,231,58,255,107,202,55,206,57,9,103,17,34,206,195,207,114,5,73,77,198,56,136,17,227,242,231,194,135,128,48,170,189,119,186]},signature:{type:"Buffer",data:[195,143,170,36,234,123,255,85,188,138,124,2,91,18,53,231,44,41,240,8,80,131,100,150,165,125,146,90,17,200,190,129,114,211,11,146,150,128,198,199,79,118,157,101,194,68,58,245,98,182,79,139,140,41,143,129,8,136,87,77,180,231,218,11]},agent_info:{type:"Buffer",data:[134,165,115,112,97,99,101,196,36,203,165,212,173,24,215,165,196,25,145,248,113,246,139,205,182,241,138,57,0,26,8,217,179,23,126,59,136,128,213,110,225,173,72,197,95,165,97,103,101,110,116,196,36,9,191,231,58,255,107,202,55,206,57,9,103,17,34,206,195,207,114,5,73,77,198,56,136,17,227,242,231,194,135,128,48,170,189,119,186,164,117,114,108,115,145,217,99,107,105,116,115,117,110,101,45,112,114,111,120,121,58,47,47,101,83,52,86,112,54,109,118,80,48,122,116,85,101,104,114,117,113,89,52,102,66,53,101,69,98,121,48,69,66,100,89,84,50,95,67,48,69,112,77,111,76,111,47,107,105,116,115,117,110,101,45,113,117,105,99,47,104,47,49,57,50,46,49,54,56,46,49,55,56,46,54,48,47,112,47,55,55,52,52,47,45,45,172,115,105,103,110,101,100,95,97,116,95,109,115,207,0,0,1,123,233,104,189,50,176,101,120,112,105,114,101,115,95,97,102,116,101,114,95,109,115,206,0,18,79,128,169,109,101,116,97,95,105,110,102,111,196,34,129,187,100,104,116,95,115,116,111,114,97,103,101,95,97,114,99,95,104,97,108,102,95,108,101,110,103,116,104,206,128,0,0,1]}},{agent:{type:"Buffer",data:[98,187,145,48,115,209,94,143,31,153,102,69,138,29,133,213,34,52,39,164,157,139,178,111,23,33,118,250,28,155,78,246,128,49,179,38]},signature:{type:"Buffer",data:[233,192,38,3,59,248,124,231,57,255,40,154,50,60,119,252,68,198,154,109,175,155,106,217,211,155,109,223,249,91,221,210,17,132,72,230,11,230,247,119,72,244,145,91,75,7,67,5,130,151,44,231,52,220,28,154,212,82,58,90,203,211,236,4]},agent_info:{type:"Buffer",data:[134,165,115,112,97,99,101,196,36,203,165,212,173,24,215,165,196,25,145,248,113,246,139,205,182,241,138,57,0,26,8,217,179,23,126,59,136,128,213,110,225,173,72,197,95,165,97,103,101,110,116,196,36,98,187,145,48,115,209,94,143,31,153,102,69,138,29,133,213,34,52,39,164,157,139,178,111,23,33,118,250,28,155,78,246,128,49,179,38,164,117,114,108,115,145,217,99,107,105,116,115,117,110,101,45,112,114,111,120,121,58,47,47,55,101,77,106,48,73,83,72,56,56,81,56,45,89,51,74,89,70,53,76,72,57,83,54,68,119,71,73,49,88,45,115,87,53,68,104,66,87,121,71,119,78,115,47,107,105,116,115,117,110,101,45,113,117,105,99,47,104,47,49,57,50,46,49,54,56,46,49,55,56,46,54,48,47,112,47,55,55,52,52,47,45,45,172,115,105,103,110,101,100,95,97,116,95,109,115,207,0,0,1,123,233,103,45,197,176,101,120,112,105,114,101,115,95,97,102,116,101,114,95,109,115,206,0,18,79,128,169,109,101,116,97,95,105,110,102,111,196,34,129,187,100,104,116,95,115,116,111,114,97,103,101,95,97,114,99,95,104,97,108,102,95,108,101,110,103,116,104,206,128,0,0,1]}},{agent:{type:"Buffer",data:[181,101,115,45,214,127,198,153,159,184,30,87,67,224,208,184,203,176,130,158,236,127,153,125,243,183,188,167,154,25,118,254,101,145,210,109]},signature:{type:"Buffer",data:[88,189,229,122,44,171,194,156,90,79,148,49,207,224,34,199,219,88,24,243,103,127,123,41,87,171,127,92,6,216,198,171,26,226,237,217,122,78,98,146,55,255,68,240,202,83,58,140,147,185,3,66,15,216,210,22,99,197,73,234,120,17,74,1]},agent_info:{type:"Buffer",data:[134,165,115,112,97,99,101,196,36,203,165,212,173,24,215,165,196,25,145,248,113,246,139,205,182,241,138,57,0,26,8,217,179,23,126,59,136,128,213,110,225,173,72,197,95,165,97,103,101,110,116,196,36,181,101,115,45,214,127,198,153,159,184,30,87,67,224,208,184,203,176,130,158,236,127,153,125,243,183,188,167,154,25,118,254,101,145,210,109,164,117,114,108,115,145,217,99,107,105,116,115,117,110,101,45,112,114,111,120,121,58,47,47,114,70,71,83,100,113,104,101,68,107,70,70,56,69,102,109,45,69,116,55,119,81,101,120,83,88,55,65,112,69,51,89,86,99,45,120,102,52,104,106,77,115,77,47,107,105,116,115,117,110,101,45,113,117,105,99,47,104,47,49,57,50,46,49,54,56,46,49,55,56,46,54,48,47,112,47,55,55,52,52,47,45,45,172,115,105,103,110,101,100,95,97,116,95,109,115,207,0,0,1,123,233,113,23,220,176,101,120,112,105,114,101,115,95,97,102,116,101,114,95,109,115,206,0,18,79,128,169,109,101,116,97,95,105,110,102,111,196,34,129,187,100,104,116,95,115,116,111,114,97,103,101,95,97,114,99,95,104,97,108,102,95,108,101,110,103,116,104,206,128,0,0,1]}},{agent:{type:"Buffer",data:[3,171,237,107,186,245,165,47,237,235,211,49,245,62,113,53,255,252,223,226,75,118,148,187,23,53,70,174,160,184,64,63,94,210,227,56]},signature:{type:"Buffer",data:[129,12,55,104,239,121,138,2,86,106,136,51,219,79,170,8,195,69,81,188,225,192,247,196,54,39,164,110,75,39,240,56,245,189,154,77,72,11,97,250,202,149,242,97,128,28,47,164,236,104,136,82,212,246,44,143,132,119,255,135,112,11,20,13]},agent_info:{type:"Buffer",data:[134,165,115,112,97,99,101,196,36,203,165,212,173,24,215,165,196,25,145,248,113,246,139,205,182,241,138,57,0,26,8,217,179,23,126,59,136,128,213,110,225,173,72,197,95,165,97,103,101,110,116,196,36,3,171,237,107,186,245,165,47,237,235,211,49,245,62,113,53,255,252,223,226,75,118,148,187,23,53,70,174,160,184,64,63,94,210,227,56,164,117,114,108,115,145,217,97,107,105,116,115,117,110,101,45,112,114,111,120,121,58,47,47,104,121,112,115,86,121,103,117,80,84,115,53,118,73,80,65,102,97,112,90,88,113,117,84,115,79,80,100,67,81,79,79,117,103,57,51,82,103,106,95,114,85,73,47,107,105,116,115,117,110,101,45,113,117,105,99,47,104,47,49,54,53,46,50,50,46,51,50,46,49,49,47,112,47,53,55,55,57,47,45,45,172,115,105,103,110,101,100,95,97,116,95,109,115,207,0,0,1,123,233,113,188,123,176,101,120,112,105,114,101,115,95,97,102,116,101,114,95,109,115,206,0,18,79,128,169,109,101,116,97,95,105,110,102,111,196,34,129,187,100,104,116,95,115,116,111,114,97,103,101,95,97,114,99,95,104,97,108,102,95,108,101,110,103,116,104,206,128,0,0,1]}}])}runtimeGetNetworkMetrics(){return JSON.stringify({metrics:{},stats:{}})}runtimeRestartHolochain(){return!0}runtimeHcAddAgentInfos(e){return!0}runtimeVerifyStringSignedByDid(e,r,n,i){return!0}runtimeSetStatus(e){return!0}runtimeFriendStatus(e){return Cr}runtimeFriendSendMessage(e,r){return!0}runtimeMessageInbox(e){return[Cr]}runtimeMessageOutbox(e){return[{recipient:"did:test:recipient",message:Cr}]}runtimeMessageReceived(){return Cr}exceptionOccurred(){return{title:"Test title",message:"Test message",type:Mu.LanguageIsNotLoaded}}runtimeRequestInstallNotification(e){return"new-notification-id"}runtimeNotifications(){return[{id:"test-id",granted:!1,description:"Test description",appName:"Test app name",appUrl:"https://example.com",appIconPath:"https://fluxsocial.io/favicon",trigger:"triple(X, ad4m://has_type, flux://message)",perspectiveIds:["u983ud-jdhh38d"],webhookUrl:"https://example.com/webhook",webhookAuth:"test-auth"}]}runtimeUpdateNotification(e,r){return!0}runtimeRemoveNotification(e){return!0}runtimeGrantNotification(e){return!0}runtimeNotificationTriggered(){return{perspectiveId:"test-perspective-id",triggerMatch:"test-trigger-match",notification:{id:"test-id",granted:!1,description:"Test description",appName:"Test app name",appUrl:"https://example.com",appIconPath:"https://fluxsocial.io/favicon",trigger:"triple(X, ad4m://has_type, flux://message)",perspectiveIds:["u983ud-jdhh38d"],webhookUrl:"https://example.com/webhook",webhookAuth:"test-auth"}}}runtimeExportDb(e){return!0}runtimeImportDb(e){return!0}runtimeExportPerspective(e,r){return!0}runtimeImportPerspective(e){return!0}runtimeMultiUserEnabled(){return!1}runtimeSetMultiUserEnabled(e){return e}runtimeListUsers(){return[{email:"test@example.com",did:"did:key:test123",lastSeen:new Date().toISOString(),perspectiveCount:5}]}};N([Ne(),v("design:type",Function),v("design:paramtypes",[]),v("design:returntype",Boolean)],H.prototype,"runtimeQuit",null);N([Ne(),de(0,pe()),v("design:type",Function),v("design:paramtypes",[String]),v("design:returntype",Boolean)],H.prototype,"runtimeOpenLink",null);N([Et(),v("design:type",Function),v("design:paramtypes",[]),v("design:returntype",mi)],H.prototype,"runtimeInfo",null);N([Ne(),de(0,pe()),v("design:type",Function),v("design:paramtypes",[Array]),v("design:returntype",Array)],H.prototype,"addTrustedAgents",null);N([Ne(),de(0,pe()),v("design:type",Function),v("design:paramtypes",[Array]),v("design:returntype",Array)],H.prototype,"deleteTrustedAgents",null);N([Et(),v("design:type",Function),v("design:paramtypes",[]),v("design:returntype",Array)],H.prototype,"getTrustedAgents",null);N([Et(),v("design:type",Function),v("design:paramtypes",[]),v("design:returntype",Array)],H.prototype,"runtimeKnownLinkLanguageTemplates",null);N([Ne(),de(0,pe()),v("design:type",Function),v("design:paramtypes",[Array]),v("design:returntype",Array)],H.prototype,"runtimeAddKnownLinkLanguageTemplates",null);N([Ne(),de(0,pe()),v("design:type",Function),v("design:paramtypes",[Array]),v("design:returntype",Array)],H.prototype,"runtimeRemoveKnownLinkLanguageTemplates",null);N([Et(),v("design:type",Function),v("design:paramtypes",[]),v("design:returntype",Array)],H.prototype,"runtimeFriends",null);N([Ne(),de(0,pe()),v("design:type",Function),v("design:paramtypes",[Array]),v("design:returntype",Array)],H.prototype,"runtimeAddFriends",null);N([Ne(),de(0,pe()),v("design:type",Function),v("design:paramtypes",[Array]),v("design:returntype",Array)],H.prototype,"runtimeRemoveFriends",null);N([Et(),v("design:type",Function),v("design:paramtypes",[]),v("design:returntype",String)],H.prototype,"runtimeHcAgentInfos",null);N([Et(),v("design:type",Function),v("design:paramtypes",[]),v("design:returntype",String)],H.prototype,"runtimeGetNetworkMetrics",null);N([Ne(),v("design:type",Function),v("design:paramtypes",[]),v("design:returntype",Boolean)],H.prototype,"runtimeRestartHolochain",null);N([Ne(),de(0,pe()),v("design:type",Function),v("design:paramtypes",[Object]),v("design:returntype",Boolean)],H.prototype,"runtimeHcAddAgentInfos",null);N([Et(),de(0,pe()),de(1,pe()),de(2,pe()),de(3,pe()),v("design:type",Function),v("design:paramtypes",[String,String,String,String]),v("design:returntype",void 0)],H.prototype,"runtimeVerifyStringSignedByDid",null);N([Ne(),de(0,pe()),v("design:type",Function),v("design:paramtypes",[er]),v("design:returntype",Boolean)],H.prototype,"runtimeSetStatus",null);N([Et(),de(0,pe()),v("design:type",Function),v("design:paramtypes",[String]),v("design:returntype",wn)],H.prototype,"runtimeFriendStatus",null);N([Ne(),de(0,pe()),de(1,pe()),v("design:type",Function),v("design:paramtypes",[String,ps]),v("design:returntype",Boolean)],H.prototype,"runtimeFriendSendMessage",null);N([Et(),de(0,pe()),v("design:type",Function),v("design:paramtypes",[String]),v("design:returntype",Array)],H.prototype,"runtimeMessageInbox",null);N([Et(),de(0,pe()),v("design:type",Function),v("design:paramtypes",[String]),v("design:returntype",Array)],H.prototype,"runtimeMessageOutbox",null);N([Bu(),v("design:type",Function),v("design:paramtypes",[]),v("design:returntype",wn)],H.prototype,"runtimeMessageReceived",null);N([Bu(),v("design:type",Function),v("design:paramtypes",[]),v("design:returntype",On)],H.prototype,"exceptionOccurred",null);N([Ne(),de(0,pe()),v("design:type",Function),v("design:paramtypes",[Pt]),v("design:returntype",String)],H.prototype,"runtimeRequestInstallNotification",null);N([Et(),v("design:type",Function),v("design:paramtypes",[]),v("design:returntype",Array)],H.prototype,"runtimeNotifications",null);N([Ne(),de(0,pe()),de(1,pe()),v("design:type",Function),v("design:paramtypes",[String,Pt]),v("design:returntype",Boolean)],H.prototype,"runtimeUpdateNotification",null);N([Ne(),de(0,pe()),v("design:type",Function),v("design:paramtypes",[String]),v("design:returntype",Boolean)],H.prototype,"runtimeRemoveNotification",null);N([Ne(),de(0,pe()),v("design:type",Function),v("design:paramtypes",[String]),v("design:returntype",Boolean)],H.prototype,"runtimeGrantNotification",null);N([Bu(),v("design:type",Function),v("design:paramtypes",[]),v("design:returntype",gi)],H.prototype,"runtimeNotificationTriggered",null);N([Ne(),de(0,pe()),v("design:type",Function),v("design:paramtypes",[String]),v("design:returntype",Boolean)],H.prototype,"runtimeExportDb",null);N([Ne(),de(0,pe()),v("design:type",Function),v("design:paramtypes",[String]),v("design:returntype",Boolean)],H.prototype,"runtimeImportDb",null);N([Ne(),de(0,pe()),de(1,pe()),v("design:type",Function),v("design:paramtypes",[String,String]),v("design:returntype",Boolean)],H.prototype,"runtimeExportPerspective",null);N([Ne(),de(0,pe()),v("design:type",Function),v("design:paramtypes",[String]),v("design:returntype",Boolean)],H.prototype,"runtimeImportPerspective",null);N([Et(),v("design:type",Function),v("design:paramtypes",[]),v("design:returntype",Boolean)],H.prototype,"runtimeMultiUserEnabled",null);N([Ne(),de(0,pe()),v("design:type",Function),v("design:paramtypes",[Boolean]),v("design:returntype",Boolean)],H.prototype,"runtimeSetMultiUserEnabled",null);N([Et(),v("design:type",Function),v("design:paramtypes",[]),v("design:returntype",Array)],H.prototype,"runtimeListUsers",null);H=N([cy()],H);var Ji=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)},pt,Kt,as,Ee;function A_(t){return t.charAt(0).toUpperCase()+t.slice(1)}function sd(t){return t?`triple("${t}", "ad4m://has_child", Base)`:""}function du(){return`
1426
1455
  findall(
1427
1456
  [T, A],
1428
1457
  link(Base, _, _, T, A),
@@ -1430,13 +1459,13 @@ input VoiceActivityParamsInput {
1430
1459
  ),
1431
1460
  sort(AllLinks, SortedLinks),
1432
1461
  SortedLinks = [[Timestamp, Author]|_]
1433
- `}function sd(t){return`
1462
+ `}function cd(t){return`
1434
1463
  findall([PropertyName, PropertyValue, Resolve], (
1435
1464
  % Constrain to specified properties if provided
1436
1465
  ${t?`member(PropertyName, [${t.map(e=>`"${e}"`).join(", ")}]),`:""}
1437
1466
  resolve_property(SubjectClass, Base, PropertyName, PropertyValue, Resolve)
1438
1467
  ), Properties)
1439
- `}function cd(t){return`
1468
+ `}function ud(t){return`
1440
1469
  findall([CollectionName, CollectionValues], (
1441
1470
  % Constrain to specified collections if provided
1442
1471
  ${t?`member(CollectionName, [${t.map(e=>`"${e}"`).join(", ")}]),`:""}
@@ -1444,28 +1473,24 @@ input VoiceActivityParamsInput {
1444
1473
  collection(SubjectClass, CollectionName),
1445
1474
  collection_getter(SubjectClass, Base, CollectionName, CollectionValues)
1446
1475
  ), Collections)
1447
- `}function ud(t={}){function e(r){return typeof r=="string"?`"${r}"`:r}return Object.entries(t).map(([r,n])=>{let i=["base","author","timestamp"].includes(r),a=`resolve_property(SubjectClass, Base, "${r}", Value${r}, _)`,o=es(r);if(Array.isArray(n)){let s=n.map(u=>e(u)).join(", ");return i?`member(${o}, [${s}])`:`${a}, member(Value${r}, [${s}])`}if(typeof n=="object"&&n!==null){let{not:s,between:u,lt:c,lte:l,gt:d,gte:p}=n;if(s!==void 0)if(Array.isArray(s)){let h=s.map(y=>e(y)).join(", ");return i?`\\+ member(${o}, [${h}])`:`${a}, \\+ member(Value${r}, [${h}])`}else return i?`${o} \\= ${e(s)}`:`${a}, Value${r} \\= ${e(s)}`;if(u!==void 0&&Array.isArray(u)&&u.length===2)return i?`${o} >= ${u[0]}, ${o} =< ${u[1]}`:`${a}, Value${r} >= ${u[0]}, Value${r} =< ${u[1]}`;let f=[{value:c,symbol:"<"},{value:l,symbol:"=<"},{value:d,symbol:">"},{value:p,symbol:">="}];for(let{value:h,symbol:y}of f)if(h!==void 0)return i?`${o} ${y} ${h}`:`${a}, Value${r} ${y} ${h}`}return i?`${o} = ${e(n)}`:`${a}, Value${r} = ${e(n)}`}).join(", ")}function ld(t){return t?"length(UnsortedInstances, TotalCount)":""}function fd(t){if(!t)return"SortedInstances = UnsortedInstances";let[e,r]=Object.entries(t)[0];return`sort_instances(UnsortedInstances, "${e}", "${r}", SortedInstances)`}function pd(t){return!t||t<0?"InstancesWithOffset = SortedInstances":`skipN(SortedInstances, ${t}, InstancesWithOffset)`}function dd(t){return!t||t<0?"AllInstances = InstancesWithOffset":`takeN(InstancesWithOffset, ${t}, AllInstances)`}var _Ad4mModel=class{static async getClassName(t){if(this===_Ad4mModel)return await t.stringOrTemplateObjectToSubjectClassName(this);let r=this.classNamesByClass.get(this);r||(r={},this.classNamesByClass.set(this,r));let n=t.uuid;return r[n]||(r[n]=await t.stringOrTemplateObjectToSubjectClassName(this)),r[n]}constructor(t,e,r){pt.set(this,void 0),Kt.set(this,void 0),Xo.set(this,void 0),Ee.set(this,void 0),Ki(this,pt,e||_t.from(hh(24)).toUrl(),"f"),Ki(this,Ee,t,"f"),Ki(this,Xo,r||"ad4m://self","f")}get baseExpression(){return K(this,pt,"f")}get perspective(){return K(this,Ee,"f")}static async assignValuesToInstance(t,e,r){let n=Object.fromEntries(await Promise.all(r.map(async([i,a,o])=>{let s=a;if(!o&&typeof a=="string"){let c=Array.from(a,p=>p.codePointAt(0)),l=c.every(p=>p<=255),d=c.some(p=>p>=128);if(l&&d)try{let p=Uint8Array.from(c),f=new TextDecoder("utf-8",{fatal:!0}).decode(p);f!==a&&(s=f)}catch(p){console.warn(`UTF-8 byte reconstruction failed for property "${i}"`,{value:a,error:p})}}if(o){let c=await t.getExpression(a);if(c)try{s=JSON.parse(c.data)}catch{s=c.data}}let u=e.__properties?.[i]?.transform;return u&&typeof u=="function"&&(s=u(s)),[i,s]})));Object.assign(e,n)}async getData(){let t=[uu(),sd(),cd()],e=`
1448
- Base = "${K(this,pt,"f")}",
1449
- subject_class("${K(this,Kt,"f")}", SubjectClass),
1476
+ `}function ld(t={}){function e(r){return typeof r=="string"?`"${r}"`:r}return Object.entries(t).map(([r,n])=>{let i=["base","author","timestamp"].includes(r),a=`resolve_property(SubjectClass, Base, "${r}", Value${r}, _)`,o=A_(r);if(Array.isArray(n)){let s=n.map(u=>e(u)).join(", ");return i?`member(${o}, [${s}])`:`${a}, member(Value${r}, [${s}])`}if(typeof n=="object"&&n!==null){let{not:s,between:u,lt:c,lte:l,gt:d,gte:p}=n;if(s!==void 0)if(Array.isArray(s)){let m=s.map(y=>e(y)).join(", ");return i?`\\+ member(${o}, [${m}])`:`${a}, \\+ member(Value${r}, [${m}])`}else return i?`${o} \\= ${e(s)}`:`${a}, Value${r} \\= ${e(s)}`;if(u!==void 0&&Array.isArray(u)&&u.length===2)return i?`${o} >= ${u[0]}, ${o} =< ${u[1]}`:`${a}, Value${r} >= ${u[0]}, Value${r} =< ${u[1]}`;let f=[{value:c,symbol:"<"},{value:l,symbol:"=<"},{value:d,symbol:">"},{value:p,symbol:">="}];for(let{value:m,symbol:y}of f)if(m!==void 0)return i?`${o} ${y} ${m}`:`${a}, Value${r} ${y} ${m}`}return i?`${o} = ${e(n)}`:`${a}, Value${r} = ${e(n)}`}).join(", ")}function fd(t){return t?"length(UnsortedInstances, TotalCount)":""}function pd(t){if(!t)return"SortedInstances = UnsortedInstances";let[e,r]=Object.entries(t)[0];return`sort_instances(UnsortedInstances, "${e}", "${r}", SortedInstances)`}function dd(t){return!t||t<0?"InstancesWithOffset = SortedInstances":`skipN(SortedInstances, ${t}, InstancesWithOffset)`}function hd(t){return!t||t<0?"AllInstances = InstancesWithOffset":`takeN(InstancesWithOffset, ${t}, AllInstances)`}var _Ad4mModel=class{static async getClassName(t){if(this===_Ad4mModel)return await t.stringOrTemplateObjectToSubjectClassName(this);let r=this.classNamesByClass.get(this);r||(r={},this.classNamesByClass.set(this,r));let n=t.uuid;return r[n]||(r[n]=await t.stringOrTemplateObjectToSubjectClassName(this)),r[n]}constructor(t,e,r){pt.set(this,void 0),Kt.set(this,void 0),as.set(this,void 0),Ee.set(this,void 0),Ji(this,pt,e||_t.from(gh(24)).toUrl(),"f"),Ji(this,Ee,t,"f"),Ji(this,as,r||"ad4m://self","f")}get baseExpression(){return J(this,pt,"f")}get perspective(){return J(this,Ee,"f")}static async assignValuesToInstance(t,e,r){let n=Object.fromEntries(await Promise.all(r.map(async([i,a,o])=>{let s=a;if(!o&&typeof a=="string"){let c=Array.from(a,p=>p.codePointAt(0)),l=c.every(p=>p<=255),d=c.some(p=>p>=128);if(l&&d)try{let p=Uint8Array.from(c),f=new TextDecoder("utf-8",{fatal:!0}).decode(p);f!==a&&(s=f)}catch(p){console.warn(`UTF-8 byte reconstruction failed for property "${i}"`,{value:a,error:p})}}if(o){let c=await t.getExpression(a);if(c)try{s=JSON.parse(c.data)}catch{s=c.data}}let u=e.__properties?.[i]?.transform;return u&&typeof u=="function"&&(s=u(s)),[i,s]})));Object.assign(e,n)}async getData(){let t=[du(),cd(),ud()],e=`
1477
+ Base = "${J(this,pt,"f")}",
1478
+ subject_class("${J(this,Kt,"f")}", SubjectClass),
1450
1479
  ${t.join(", ")}
1451
- `,r=await K(this,Ee,"f").infer(e);if(r?.[0]){let{Properties:n,Collections:i,Timestamp:a,Author:o}=r?.[0],s=[...n,...i,["timestamp",a],["author",o]];await _Ad4mModel.assignValuesToInstance(K(this,Ee,"f"),this,s)}return this}static async queryToProlog(t,e,r){let{source:n,properties:i,collections:a,where:o,order:s,offset:u,limit:c,count:l}=e,d=r||await this.getClassName(t),p=[uu(),od(n),sd(i),cd(a),ud(o)],f=[ld(l),fd(s),pd(u),dd(c)];return`
1480
+ `,r=await J(this,Ee,"f").infer(e);if(r?.[0]){let{Properties:n,Collections:i,Timestamp:a,Author:o}=r?.[0],s=[...n,...i,["timestamp",a],["author",o]];await _Ad4mModel.assignValuesToInstance(J(this,Ee,"f"),this,s)}return this}static async queryToProlog(t,e,r){let{source:n,properties:i,collections:a,where:o,order:s,offset:u,limit:c,count:l}=e,d=r||await this.getClassName(t),p=[du(),sd(n),cd(i),ud(a),ld(o)],f=[fd(l),pd(s),dd(u),hd(c)];return`
1452
1481
  findall([Base, Properties, Collections, Timestamp, Author], (
1453
1482
  subject_class("${d}", SubjectClass),
1454
1483
  instance(SubjectClass, Base),
1455
1484
  ${p.filter(y=>y).join(", ")}
1456
1485
  ), UnsortedInstances),
1457
1486
  ${f.filter(y=>y).join(", ")}
1458
- `}static async instancesFromPrologResult(t,e,r){if(!r?.[0]?.AllInstances)return{results:[],totalCount:0};let n=[...e?.properties||[],...e?.collections||[]];return{results:(await Promise.all(r[0].AllInstances.map(async([a,o,s,u,c])=>{try{let l=new this(t,a);n.length&&Object.keys(l).forEach(p=>{n.includes(p)||delete l[p]});let d=[...o,...s,["timestamp",u],["author",c]];return await _Ad4mModel.assignValuesToInstance(t,l,d),l}catch(l){return console.error(`Failed to process instance ${a}:`,l),null}}))).filter(a=>a!==null),totalCount:r[0].TotalCount}}static async findAll(t,e={}){let r=await this.queryToProlog(t,e),n=await t.infer(r),{results:i}=await this.instancesFromPrologResult(t,e,n);return i}static async findAllAndCount(t,e={}){let r=await this.queryToProlog(t,e),n=await t.infer(r);return await this.instancesFromPrologResult(t,e,n)}static async paginate(t,e,r,n){let i={...n||{},limit:e,offset:e*(r-1),count:!0},a=await this.queryToProlog(t,i),o=await t.infer(a),{results:s,totalCount:u}=await this.instancesFromPrologResult(t,i,o);return{results:s,totalCount:u,pageSize:e,pageNumber:r}}static async countQueryToProlog(t,e={},r){let{source:n,where:i}=e,a=r||await this.getClassName(t),o=[uu(),od(n),ud(i)],s=[ld(!0),fd(),pd(),dd()];return`
1487
+ `}static async instancesFromPrologResult(t,e,r){if(!r?.[0]?.AllInstances)return{results:[],totalCount:0};let n=[...e?.properties||[],...e?.collections||[]];return{results:(await Promise.all(r[0].AllInstances.map(async([a,o,s,u,c])=>{try{let l=new this(t,a);n.length&&Object.keys(l).forEach(p=>{n.includes(p)||delete l[p]});let d=[...o,...s,["timestamp",u],["author",c]];return await _Ad4mModel.assignValuesToInstance(t,l,d),l}catch(l){return console.error(`Failed to process instance ${a}:`,l),null}}))).filter(a=>a!==null),totalCount:r[0].TotalCount}}static async findAll(t,e={}){let r=await this.queryToProlog(t,e),n=await t.infer(r),{results:i}=await this.instancesFromPrologResult(t,e,n);return i}static async findAllAndCount(t,e={}){let r=await this.queryToProlog(t,e),n=await t.infer(r);return await this.instancesFromPrologResult(t,e,n)}static async paginate(t,e,r,n){let i={...n||{},limit:e,offset:e*(r-1),count:!0},a=await this.queryToProlog(t,i),o=await t.infer(a),{results:s,totalCount:u}=await this.instancesFromPrologResult(t,i,o);return{results:s,totalCount:u,pageSize:e,pageNumber:r}}static async countQueryToProlog(t,e={},r){let{source:n,where:i}=e,a=r||await this.getClassName(t),o=[du(),sd(n),ld(i)],s=[fd(!0),pd(),dd(),hd()];return`
1459
1488
  findall([Base, Properties, Collections, Timestamp, Author], (
1460
1489
  subject_class("${a}", SubjectClass),
1461
1490
  instance(SubjectClass, Base),
1462
1491
  ${o.filter(c=>c).join(", ")}
1463
1492
  ), UnsortedInstances),
1464
1493
  ${s.filter(c=>c).join(", ")}
1465
- `}static async count(t,e={}){return(await t.infer(await this.countQueryToProlog(t,e)))?.[0]?.TotalCount||0}async setProperty(key,value,batchId){let setters=await K(this,Ee,"f").infer(`subject_class("${K(this,Kt,"f")}", C), property_setter(C, "${key}", Setter)`);if(setters&&setters.length>0){let actions=eval(setters[0].Setter),resolveLanguageResults=await K(this,Ee,"f").infer(`subject_class("${K(this,Kt,"f")}", C), property_resolve_language(C, "${key}", Language)`),resolveLanguage;resolveLanguageResults&&resolveLanguageResults.length>0&&(resolveLanguage=resolveLanguageResults[0].Language),resolveLanguage&&(value=await K(this,Ee,"f").createExpression(value,resolveLanguage)),await K(this,Ee,"f").executeAction(actions,K(this,pt,"f"),[{name:"value",value}],batchId)}}async setCollectionSetter(key,value,batchId){let collectionSetters=await K(this,Ee,"f").infer(`subject_class("${K(this,Kt,"f")}", C), collection_setter(C, "${dr(key)}", Setter)`);if(collectionSetters||(collectionSetters=[]),collectionSetters.length>0){let actions=eval(collectionSetters[0].Setter);value&&(Array.isArray(value)?await K(this,Ee,"f").executeAction(actions,K(this,pt,"f"),value.map(t=>({name:"value",value:t})),batchId):await K(this,Ee,"f").executeAction(actions,K(this,pt,"f"),[{name:"value",value}],batchId))}}async setCollectionAdder(key,value,batchId){let adders=await K(this,Ee,"f").infer(`subject_class("${K(this,Kt,"f")}", C), collection_adder(C, "${dr(key)}", Adder)`);if(adders||(adders=[]),adders.length>0){let actions=eval(adders[0].Adder);value&&(Array.isArray(value)?await Promise.all(value.map(t=>K(this,Ee,"f").executeAction(actions,K(this,pt,"f"),[{name:"value",value:t}],batchId))):await K(this,Ee,"f").executeAction(actions,K(this,pt,"f"),[{name:"value",value}],batchId))}}async setCollectionRemover(key,value,batchId){let removers=await K(this,Ee,"f").infer(`subject_class("${K(this,Kt,"f")}", C), collection_remover(C, "${dr(key)}", Remover)`);if(removers||(removers=[]),removers.length>0){let actions=eval(removers[0].Remover);value&&(Array.isArray(value)?await Promise.all(value.map(t=>K(this,Ee,"f").executeAction(actions,K(this,pt,"f"),[{name:"value",value:t}],batchId))):await K(this,Ee,"f").executeAction(actions,K(this,pt,"f"),[{name:"value",value}],batchId))}}async save(t){let e=!1;t||(t=await this.perspective.createBatch(),e=!0);let r={};for(let[n,i]of Object.entries(this))i!=null&&!(Array.isArray(i)&&i.length>0)&&!i?.action&&(r[n]=i);await this.perspective.createSubject(this,K(this,pt,"f"),r,t),await K(this,Ee,"f").add(new wn({source:K(this,Xo,"f"),predicate:"ad4m://has_child",target:this.baseExpression}),"shared",t),await this.innerUpdate(!1,t),e&&(await this.perspective.commitBatch(t),await this.getData())}cleanCopy(){let t={},e=Object.entries(this);for(let[r,n]of e)n!=null&&r!=="author"&&r!=="timestamp"&&(t[r]=n);return t}async innerUpdate(t=!0,e){Ki(this,Kt,await K(this,Ee,"f").stringOrTemplateObjectToSubjectClassName(this.cleanCopy()),"f");let r=Object.entries(this);for(let[n,i]of r)if(i!=null)if(i?.action)switch(i.action){case"setter":await this.setCollectionSetter(n,i.value,e);break;case"adder":await this.setCollectionAdder(n,i.value,e);break;case"remover":await this.setCollectionRemover(n,i.value,e);break;default:await this.setCollectionSetter(n,i.value,e);break}else Array.isArray(i)&&i.length>0?await this.setCollectionSetter(n,i,e):i!=null&&i!==""&&t&&await this.setProperty(n,i,e)}async update(t){await this.innerUpdate(!0,t),await this.getData()}async get(){return Ki(this,Kt,await K(this,Ee,"f").stringOrTemplateObjectToSubjectClassName(this.cleanCopy()),"f"),await this.getData()}async delete(t){await K(this,Ee,"f").removeSubject(this,K(this,pt,"f"),t)}static query(t,e){return new $u(t,this,e)}static fromJSONSchema(t,e){if(t?.properties&&Object.prototype.hasOwnProperty.call(t.properties,"author"))throw new Error('JSON Schema must not define a top-level "author" property because Ad4mModel already exposes it. Please rename the property (e.g., "writer").');let r=this.determineNamespace(t,e),n=class extends _Ad4mModel{};Object.defineProperty(n,"name",{value:e.name}),n.className=e.name,n.prototype.className=e.name;let i={},a={};if(t.properties)for(let[u,c]of Object.entries(t.properties)){let l=this.determinePredicate(t,u,c,r,e),d=t.required?.includes(u)||!1;if(c.type==="array"){a[u]={through:l,local:this.getPropertyOption(u,c,e,"local")},Object.defineProperty(n.prototype,u,{configurable:!0,writable:!0,value:[]});let f=`add${es(u)}`,h=`remove${es(u)}`,y=`setCollection${es(u)}`;n.prototype[f]=function(){},n.prototype[h]=function(){},n.prototype[y]=function(){}}else{let f=this.getPropertyOption(u,c,e,"resolveLanguage");!f&&e.resolveLanguage&&(f=e.resolveLanguage);let h=this.getPropertyOption(u,c,e,"local"),y=this.getPropertyOption(u,c,e,"writable",!0),v=this.getPropertyOption(u,c,e,"initial");if(c.type==="object"&&!f&&(f="literal",console.warn(`Property "${u}" is an object type. It will be stored as JSON. Consider flattening complex objects for better semantic querying.`)),f==null&&(c.type==="number"||c.type==="integer")&&(f="literal"),d&&!v&&(c.type==="object"?v="literal://json:{}":v="ad4m://undefined"),i[u]={through:l,required:d,writable:y,...f&&{resolveLanguage:f},...h!==void 0&&{local:h},...v&&{initial:v}},Object.defineProperty(n.prototype,u,{configurable:!0,writable:!0,value:this.getDefaultValueForType(c.type)}),y){let E=qu(u);n.prototype[E]=function(){}}}}if(!Object.values(i).some(u=>u.initial)){let u="ad4m://type",c=`${r.replace("://","")}://instance`;i.__ad4m_type={through:u,required:!0,writable:!1,initial:c,flag:!0},Object.defineProperty(n.prototype,"__ad4m_type",{configurable:!0,writable:!1,value:c}),console.warn(`No properties with initial values found. Added automatic type flag: ${u} = ${c}`)}return n.prototype.__properties=i,n.prototype.__collections=a,k_({name:e.name})(n),n}static determineNamespace(t,e){if(e.namespace)return e.namespace;if(t["x-ad4m"]?.namespace)return t["x-ad4m"].namespace;if(t.title)return`${t.title.toLowerCase()}://`;if(t.$id)try{let n=new URL(t.$id).pathname.split("/").filter(i=>i);if(n.length>0)return`${n[n.length-1].replace(/\.schema\.json$/,"").replace(/\.json$/,"").toLowerCase()}://`}catch{}throw new Error(`Cannot infer namespace for JSON Schema. Please provide one of:
1466
- - options.namespace
1467
- - schema["x-ad4m"].namespace
1468
- - schema.title
1469
- - valid schema.$id`)}static determinePredicate(t,e,r,n,i){return i.propertyMapping?.[e]?i.propertyMapping[e]:r["x-ad4m"]?.through?r["x-ad4m"].through:i.predicateTemplate?i.predicateTemplate.replace("${namespace}",n.replace("://","")).replace("${title}",t.title||"").replace("${property}",e):i.predicateGenerator?i.predicateGenerator(t.title||"",e):`${n.endsWith("://")?n.slice(0,-3):n}://${e}`}static getPropertyOption(t,e,r,n,i){return r.propertyOptions?.[t]?.[n]!==void 0?r.propertyOptions[t][n]:e["x-ad4m"]?.[n]!==void 0?e["x-ad4m"][n]:r[n]!==void 0?r[n]:i}static getDefaultValueForType(t){switch(t){case"string":return"";case"number":return 0;case"integer":return 0;case"boolean":return!1;case"array":return[];case"object":return{};default:return""}}};pt=new WeakMap,Kt=new WeakMap,Xo=new WeakMap,Ee=new WeakMap;_Ad4mModel.classNamesByClass=new WeakMap;var $u=class{constructor(e,r,n){this.queryParams={},this.modelClassName=null,this.perspective=e,this.ctor=r,n&&(this.queryParams=n)}dispose(){this.currentSubscription&&(this.currentSubscription.dispose(),this.currentSubscription=void 0)}where(e){return this.queryParams.where=e,this}order(e){return this.queryParams.order=e,this}limit(e){return this.queryParams.limit=e,this}offset(e){return this.queryParams.offset=e,this}source(e){return this.queryParams.source=e,this}properties(e){return this.queryParams.properties=e,this}collections(e){return this.queryParams.collections=e,this}overrideModelClassName(e){return this.modelClassName=e,this}async get(){let e=await this.ctor.queryToProlog(this.perspective,this.queryParams),r=await this.perspective.infer(e),{results:n}=await this.ctor.instancesFromPrologResult(this.perspective,this.queryParams,r);return n}async subscribe(e){this.dispose();let r=await this.ctor.queryToProlog(this.perspective,this.queryParams,this.modelClassName);this.currentSubscription=await this.perspective.subscribeInfer(r);let n=async a=>{let{results:o}=await this.ctor.instancesFromPrologResult(this.perspective,this.queryParams,a);e(o)};this.currentSubscription.onResult(n);let{results:i}=await this.ctor.instancesFromPrologResult(this.perspective,this.queryParams,this.currentSubscription.result);return i}async count(){let e=await this.ctor.countQueryToProlog(this.perspective,this.queryParams,this.modelClassName);return(await this.perspective.infer(e))?.[0]?.TotalCount||0}async countSubscribe(e){this.dispose();let r=await this.ctor.countQueryToProlog(this.perspective,this.queryParams,this.modelClassName);this.currentSubscription=await this.perspective.subscribeInfer(r);let n=async i=>{let a=i?.[0]?.TotalCount||0;e(a)};return this.currentSubscription.onResult(n),this.currentSubscription.result?.[0]?.TotalCount||0}async paginate(e,r){let n={...this.queryParams||{},limit:e,offset:e*(r-1),count:!0},i=await this.ctor.queryToProlog(this.perspective,n,this.modelClassName),a=await this.perspective.infer(i),{results:o,totalCount:s}=await this.ctor.instancesFromPrologResult(this.perspective,n,a);return{results:o,totalCount:s,pageSize:e,pageNumber:r}}async paginateSubscribe(e,r,n){this.dispose();let i={...this.queryParams||{},limit:e,offset:e*(r-1),count:!0},a=await this.ctor.queryToProlog(this.perspective,i,this.modelClassName);this.currentSubscription=await this.perspective.subscribeInfer(a);let o=async c=>{let{results:l,totalCount:d}=await this.ctor.instancesFromPrologResult(this.perspective,this.queryParams,c);n({results:l,totalCount:d,pageSize:e,pageNumber:r})};this.currentSubscription.onResult(o);let{results:s,totalCount:u}=await this.ctor.instancesFromPrologResult(this.perspective,i,this.currentSubscription.result);return{results:s,totalCount:u,pageSize:e,pageNumber:r}}};var mh="0.10.1-dev-1";var Ps=12e3;function A_(){let t=new AbortController;return setTimeout(()=>t.abort(),20),t}function Cs(t,e=1e4){return Xe(this,null,function*(){return Promise.race([new Promise((r,n)=>{try{t.includes("localhost")||r(new WebSocket(t));let i=new WebSocket(t);i.onopen=()=>{r(i)},i.onerror=a=>{n(a)}}catch(i){n(i)}}),new Promise((r,n)=>{setTimeout(()=>{n(new Error("WebSocket connection timed out"))},e)})])})}function Xu(t){return Xe(this,null,function*(){try{let e=yield fetch(`http://localhost:${t}/graphql/`,{signal:A_().signal,mode:"cors"});if(e.status===400||e.status===0||e.status===200)return t;throw new Error(`Could not connect to port ${t}`)}catch(e){throw new Error(`Could not connect to port ${t}`)}})}function D_(){try{localStorage.setItem("test",""),localStorage.removeItem("test")}catch(t){return!1}return!0}function yh(t,e){D_()&&localStorage.setItem(`${mh}/${t}`,e)}var N_=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 el(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 N_(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 tl=class{constructor({appName:e,appDesc:r,appIconPath:n,appUrl:i,appDomain:a,capabilities:o,port:s,token:u,url:c,hosting:l}){this.activeSocket=null;this.requestedRestart=!1;this.authState="unauthenticated";this.connectionState="not_connected";this.port=Ps;this.capabilities=[];this.isHosting=!1;this.listeners={authstatechange:[],configstatechange:[],connectionstatechange:[]};el(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=c||`ws://localhost:${this.port}/graphql`,this.token=u||this.token,this.isHosting=l||!1,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 Xe(this,null,function*(){try{if(e){yield Cs(e),this.setUrl(e);let r=this.buildClient();return yield this.checkAuth(),r}else{this.notifyConnectionChange("checking_local");try{yield Cs(`ws://localhost:${this.port}/graphql`,2e3);let r=this.buildClient();return yield this.checkAuth(),r}catch(r){let n=yield this.ensureConnection();return yield this.checkAuth(),n}}}catch(r){this.notifyConnectionChange("not_connected"),this.notifyAuthChange("unauthenticated")}})}loginToHosting(e,r){return Xe(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();if(s.serviceId)if(this.setPort(s.port),this.setUrl(s.url),this.isHosting=!0,yh("ad4mhosting","true"),!s.paused)this.connect();else throw new Error("Hosting is not running")}}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 Xe(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 Xe(this,null,function*(){try{if(e){let r=yield Xu(e);return this.setPort(r),this.buildClient()}else if(this.url.includes("localhost")){let r=yield this.findPort();return this.setPort(r),this.buildClient()}}catch(r){this.notifyConnectionChange("not_connected"),this.notifyAuthChange("unauthenticated")}})}ensureConnection(){return Xe(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 this.notifyConnectionChange("connecting"),yield Cs(this.url),this.buildClient()}catch(i){return this.notifyConnectionChange("not_connected"),this.connectToPort()}})}findPort(){return Xe(this,null,function*(){let e=[...Array(10).keys()].map((i,a)=>Xu(Ps+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{let e=new WebSocket(this.url)}catch(e){this.notifyConnectionChange("not_connected");return}return this.apolloClient&&this.wsClient&&(this.requestedRestart=!0,this.wsClient.dispose(),this.apolloClient.stop(),this.wsClient=null,this.apolloClient=null),this.wsClient=Yf({url:this.url,connectionParams:()=>Xe(this,null,function*(){return{headers:{authorization:this.token}}}),on:{opened:e=>{this.activeSocket=e},error:e=>{this.notifyConnectionChange("not_connected"),this.notifyAuthChange("unauthenticated")},connected:()=>{this.notifyConnectionChange("connected"),this.checkAuth()},closed:e=>Xe(this,null,function*(){if(!e.wasClean&&!this.requestedRestart)if(!this.token)this.notifyConnectionChange(this.token?"disconnected":"not_connected"),this.notifyAuthChange("unauthenticated"),this.requestedRestart=!1;else{let r=yield this.connect();r?this.ad4mClient=r:(this.notifyConnectionChange(this.token?"disconnected":"not_connected"),this.notifyAuthChange("unauthenticated"),this.requestedRestart=!1)}})}}),this.apolloClient=new Bc({link:new Zf(this.wsClient),cache:new bo({resultCaching:!1,addTypename:!1}),defaultOptions:{watchQuery:{fetchPolicy:"no-cache"},query:{fetchPolicy:"no-cache"},mutate:{fetchPolicy:"no-cache"}}}),this.ad4mClient=new vs(this.apolloClient),this.ad4mClient}checkAuth(){return Xe(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 Xe(this,null,function*(){var r;if(e&&this.setToken(null),this.isHosting){let n=localStorage.getItem("hosting_token");(yield fetch("https://hosting.ad4m.dev/api/service/checkStatus",{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer "+n}})).status!==200&&console.error("Looks like the client is not running you might not recieve the mail with the code, please check your dashboard logs.")}return 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 Xe(this,null,function*(){var r;try{let n=yield(r=this.ad4mClient)==null?void 0:r.agent.generateJwt(this.requestId,e);return this.setToken(n),yield this.buildClient(),yield this.checkAuth(),this.token}catch(n){throw new Error("Invalid code")}})}clearState(){this.setToken(null),this.setPort(Ps),this.notifyConnectionChange("not_connected"),this.notifyAuthChange("unauthenticated")}};export{tl as default};
1494
+ `}static async count(t,e={}){return(await t.infer(await this.countQueryToProlog(t,e)))?.[0]?.TotalCount||0}async setProperty(key,value,batchId){let setters=await J(this,Ee,"f").infer(`subject_class("${J(this,Kt,"f")}", C), property_setter(C, "${key}", Setter)`);if(setters&&setters.length>0){let actions=eval(setters[0].Setter),resolveLanguageResults=await J(this,Ee,"f").infer(`subject_class("${J(this,Kt,"f")}", C), property_resolve_language(C, "${key}", Language)`),resolveLanguage;resolveLanguageResults&&resolveLanguageResults.length>0&&(resolveLanguage=resolveLanguageResults[0].Language),resolveLanguage&&(value=await J(this,Ee,"f").createExpression(value,resolveLanguage)),await J(this,Ee,"f").executeAction(actions,J(this,pt,"f"),[{name:"value",value}],batchId)}}async setCollectionSetter(key,value,batchId){let collectionSetters=await J(this,Ee,"f").infer(`subject_class("${J(this,Kt,"f")}", C), collection_setter(C, "${dr(key)}", Setter)`);if(collectionSetters||(collectionSetters=[]),collectionSetters.length>0){let actions=eval(collectionSetters[0].Setter);value&&(Array.isArray(value)?await J(this,Ee,"f").executeAction(actions,J(this,pt,"f"),value.map(t=>({name:"value",value:t})),batchId):await J(this,Ee,"f").executeAction(actions,J(this,pt,"f"),[{name:"value",value}],batchId))}}async setCollectionAdder(key,value,batchId){let adders=await J(this,Ee,"f").infer(`subject_class("${J(this,Kt,"f")}", C), collection_adder(C, "${dr(key)}", Adder)`);if(adders||(adders=[]),adders.length>0){let actions=eval(adders[0].Adder);value&&(Array.isArray(value)?await Promise.all(value.map(t=>J(this,Ee,"f").executeAction(actions,J(this,pt,"f"),[{name:"value",value:t}],batchId))):await J(this,Ee,"f").executeAction(actions,J(this,pt,"f"),[{name:"value",value}],batchId))}}async setCollectionRemover(key,value,batchId){let removers=await J(this,Ee,"f").infer(`subject_class("${J(this,Kt,"f")}", C), collection_remover(C, "${dr(key)}", Remover)`);if(removers||(removers=[]),removers.length>0){let actions=eval(removers[0].Remover);value&&(Array.isArray(value)?await Promise.all(value.map(t=>J(this,Ee,"f").executeAction(actions,J(this,pt,"f"),[{name:"value",value:t}],batchId))):await J(this,Ee,"f").executeAction(actions,J(this,pt,"f"),[{name:"value",value}],batchId))}}async save(t){let e=!1;t||(t=await this.perspective.createBatch(),e=!0);let r={};for(let[n,i]of Object.entries(this))i!=null&&!(Array.isArray(i)&&i.length>0)&&!i?.action&&(r[n]=i);await this.perspective.createSubject(this,J(this,pt,"f"),r,t),await J(this,Ee,"f").add(new Sn({source:J(this,as,"f"),predicate:"ad4m://has_child",target:this.baseExpression}),"shared",t),await this.innerUpdate(!1,t),e&&(await this.perspective.commitBatch(t),await this.getData())}cleanCopy(){let t={},e=Object.entries(this);for(let[r,n]of e)n!=null&&r!=="author"&&r!=="timestamp"&&(t[r]=n);return t}async innerUpdate(t=!0,e){Ji(this,Kt,await J(this,Ee,"f").stringOrTemplateObjectToSubjectClassName(this.cleanCopy()),"f");let r=Object.entries(this);for(let[n,i]of r)if(i!=null)if(i?.action)switch(i.action){case"setter":await this.setCollectionSetter(n,i.value,e);break;case"adder":await this.setCollectionAdder(n,i.value,e);break;case"remover":await this.setCollectionRemover(n,i.value,e);break;default:await this.setCollectionSetter(n,i.value,e);break}else Array.isArray(i)&&i.length>0?await this.setCollectionSetter(n,i,e):i!=null&&i!==""&&t&&await this.setProperty(n,i,e)}async update(t){await this.innerUpdate(!0,t),await this.getData()}async get(){return Ji(this,Kt,await J(this,Ee,"f").stringOrTemplateObjectToSubjectClassName(this.cleanCopy()),"f"),await this.getData()}async delete(t){await J(this,Ee,"f").removeSubject(this,J(this,pt,"f"),t)}static query(t,e){return new qu(t,this,e)}};pt=new WeakMap,Kt=new WeakMap,as=new WeakMap,Ee=new WeakMap;_Ad4mModel.classNamesByClass=new WeakMap;var qu=class{constructor(e,r,n){this.queryParams={},this.modelClassName=null,this.perspective=e,this.ctor=r,n&&(this.queryParams=n)}dispose(){this.currentSubscription&&(this.currentSubscription.dispose(),this.currentSubscription=void 0)}where(e){return this.queryParams.where=e,this}order(e){return this.queryParams.order=e,this}limit(e){return this.queryParams.limit=e,this}offset(e){return this.queryParams.offset=e,this}source(e){return this.queryParams.source=e,this}properties(e){return this.queryParams.properties=e,this}collections(e){return this.queryParams.collections=e,this}overrideModelClassName(e){return this.modelClassName=e,this}async get(){let e=await this.ctor.queryToProlog(this.perspective,this.queryParams),r=await this.perspective.infer(e),{results:n}=await this.ctor.instancesFromPrologResult(this.perspective,this.queryParams,r);return n}async subscribe(e){this.dispose();let r=await this.ctor.queryToProlog(this.perspective,this.queryParams,this.modelClassName);this.currentSubscription=await this.perspective.subscribeInfer(r);let n=async a=>{let{results:o}=await this.ctor.instancesFromPrologResult(this.perspective,this.queryParams,a);e(o)};this.currentSubscription.onResult(n);let{results:i}=await this.ctor.instancesFromPrologResult(this.perspective,this.queryParams,this.currentSubscription.result);return i}async count(){let e=await this.ctor.countQueryToProlog(this.perspective,this.queryParams,this.modelClassName);return(await this.perspective.infer(e))?.[0]?.TotalCount||0}async countSubscribe(e){this.dispose();let r=await this.ctor.countQueryToProlog(this.perspective,this.queryParams,this.modelClassName);this.currentSubscription=await this.perspective.subscribeInfer(r);let n=async i=>{let a=i?.[0]?.TotalCount||0;e(a)};return this.currentSubscription.onResult(n),this.currentSubscription.result?.[0]?.TotalCount||0}async paginate(e,r){let n={...this.queryParams||{},limit:e,offset:e*(r-1),count:!0},i=await this.ctor.queryToProlog(this.perspective,n,this.modelClassName),a=await this.perspective.infer(i),{results:o,totalCount:s}=await this.ctor.instancesFromPrologResult(this.perspective,n,a);return{results:o,totalCount:s,pageSize:e,pageNumber:r}}async paginateSubscribe(e,r,n){this.dispose();let i={...this.queryParams||{},limit:e,offset:e*(r-1),count:!0},a=await this.ctor.queryToProlog(this.perspective,i,this.modelClassName);this.currentSubscription=await this.perspective.subscribeInfer(a);let o=async c=>{let{results:l,totalCount:d}=await this.ctor.instancesFromPrologResult(this.perspective,this.queryParams,c);n({results:l,totalCount:d,pageSize:e,pageNumber:r})};this.currentSubscription.onResult(o);let{results:s,totalCount:u}=await this.ctor.instancesFromPrologResult(this.perspective,i,this.currentSubscription.result);return{results:s,totalCount:u,pageSize:e,pageNumber:r}}};var yh="0.10.1-multi-user-1";var Fs=12e3;function N_(){let t=new AbortController;return setTimeout(()=>t.abort(),20),t}function za(t,e=1e4){return Ge(this,null,function*(){return Promise.race([new Promise((r,n)=>{let i;try{i=new WebSocket(t,"graphql-transport-ws"),i.onopen=()=>{i.close(),r(i)},i.onerror=a=>{n(a)},i.onclose=a=>{a.code!==1e3&&n(new Error(`WebSocket closed with code ${a.code}: ${a.reason}`))}}catch(a){i&&i.close(),n(a)}}),new Promise((r,n)=>{setTimeout(()=>{n(new Error("WebSocket connection timed out"))},e)})])})}function rl(t){return Ge(this,null,function*(){try{let e=yield fetch(`http://localhost:${t}/graphql/`,{signal:N_().signal,mode:"cors"});if(e.status===400||e.status===0||e.status===200)return t;throw new Error(`Could not connect to port ${t}`)}catch(e){throw new Error(`Could not connect to port ${t}`)}})}function P_(){try{localStorage.setItem("test",""),localStorage.removeItem("test")}catch(t){return!1}return!0}function vh(t,e){P_()&&localStorage.setItem(`${yh}/${t}`,e)}var C_=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 nl(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 C_(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 il=class{constructor(e){this.activeSocket=null;this.requestedRestart=!1;this.authState="unauthenticated";this.connectionState="not_connected";this.port=Fs;this.capabilities=[];this.isHosting=!1;this.listeners={authstatechange:[],configstatechange:[],connectionstatechange:[]};nl(this);this.options=e,this.appName=e.appName,this.appDesc=e.appDesc,this.appDomain=e.appDomain,this.appUrl=e.appUrl,this.appIconPath=e.appIconPath,this.capabilities=e.capabilities,this.port=e.port||this.port,this.url=e.url||`ws://localhost:${this.port}/graphql`,this.token=e.token||this.token,this.isHosting=e.hosting||!1}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)}buildTempClient(e){let r=Gc({url:e,connectionParams:()=>Ge(this,null,function*(){return{headers:{authorization:""}}})}),n=new Ao({link:new Wc(r),cache:new Gi({resultCaching:!1,addTypename:!1}),defaultOptions:{watchQuery:{fetchPolicy:"no-cache"},query:{fetchPolicy:"no-cache"}}});return new Fa(n)}connect(e){return Ge(this,null,function*(){try{if(e){yield za(e),this.setUrl(e);let r=this.buildClient();return yield this.checkAuth(),r}else{let r=`ws://localhost:${this.port}/graphql`;yield za(r),this.setUrl(r);let n=this.buildClient();return yield this.checkAuth(),n}}catch(r){this.notifyConnectionChange("not_connected"),this.notifyAuthChange("unauthenticated")}})}connectMultiUser(){return Ge(this,null,function*(){try{let e=this.options.backendUrl;console.debug("[Ad4m Connect] Connecting to backend:",e),yield za(e),this.setUrl(e);let r=this.buildClient();console.debug("[Ad4m Connect] Built client:",r);let n;try{console.debug("[Ad4m Connect] Logging in user:",this.options.userEmail),n=yield r.agent.loginUser(this.options.userEmail,this.options.userPassword),console.debug("[Ad4m Connect] Login successful")}catch(a){console.debug("[Ad4m Connect] Login error:",a),console.debug("[Ad4m Connect] User does not exist, trying to create user:",this.options.userEmail);try{console.debug("[Ad4m Connect] Creating user:",this.options.userEmail);try{let o=yield r.agent.createUser(this.options.userEmail,this.options.userPassword);if(console.debug("[Ad4m Connect] Create result:",o),!o.success)throw new Error(o.error||"Failed to create user")}catch(o){console.log("[Ad4m Connect] Failed to create user:",o)}console.debug("[Ad4m Connect] Logging in user after creation:",this.options.userEmail),n=yield r.agent.loginUser(this.options.userEmail,this.options.userPassword),console.log("[Ad4m Connect] Successfully created and logged in user")}catch(o){throw new Error(`Failed to create/login user: ${o.message}`)}}this.setToken(n);let i=this.buildClient();return yield i.agent.status(),this.notifyAuthChange("authenticated"),this.notifyConnectionChange("connected"),i}catch(e){throw this.notifyConnectionChange("error"),this.notifyAuthChange("unauthenticated"),e}})}loginToHosting(e,r){return Ge(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();if(s.serviceId)if(this.setPort(s.port),this.setUrl(s.url),this.isHosting=!0,vh("ad4mhosting","true"),!s.paused)this.connect();else throw new Error("Hosting is not running")}}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 Ge(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 Ge(this,null,function*(){try{if(e){let r=yield rl(e);return this.setPort(r),this.buildClient()}else if(this.url.includes("localhost")){let r=yield this.findPort();return this.setPort(r),this.buildClient()}}catch(r){this.notifyConnectionChange("not_connected"),this.notifyAuthChange("unauthenticated")}})}ensureConnection(){return Ge(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 this.notifyConnectionChange("connecting"),yield za(this.url),this.buildClient()}catch(i){return this.notifyConnectionChange("not_connected"),this.connectToPort()}})}findPort(){return Ge(this,null,function*(){let e=[...Array(10).keys()].map((i,a)=>rl(Fs+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{let e=new WebSocket(this.url)}catch(e){this.notifyConnectionChange("not_connected");return}return this.apolloClient&&this.wsClient&&(this.requestedRestart=!0,this.wsClient.dispose(),this.apolloClient.stop(),this.wsClient=null,this.apolloClient=null),this.wsClient=Gc({url:this.url,connectionParams:()=>Ge(this,null,function*(){return{headers:{authorization:this.token}}}),on:{opened:e=>{this.activeSocket=e},error:e=>{this.notifyConnectionChange("not_connected"),this.notifyAuthChange("unauthenticated")},connected:()=>{this.notifyConnectionChange("connected"),this.checkAuth()},closed:e=>Ge(this,null,function*(){if(!e.wasClean&&!this.requestedRestart)if(!this.token)this.notifyConnectionChange(this.token?"disconnected":"not_connected"),this.notifyAuthChange("unauthenticated"),this.requestedRestart=!1;else{let r=yield this.connect();r?this.ad4mClient=r:(this.notifyConnectionChange(this.token?"disconnected":"not_connected"),this.notifyAuthChange("unauthenticated"),this.requestedRestart=!1)}})}}),this.apolloClient=new Ao({link:new Wc(this.wsClient),cache:new Gi({resultCaching:!1,addTypename:!1}),defaultOptions:{watchQuery:{fetchPolicy:"no-cache"},query:{fetchPolicy:"no-cache"},mutate:{fetchPolicy:"no-cache"}}}),this.ad4mClient=new Fa(this.apolloClient),this.ad4mClient}checkAuth(){return Ge(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 Ge(this,null,function*(){var r;if(e&&this.setToken(null),this.isHosting){let n=localStorage.getItem("hosting_token");(yield fetch("https://hosting.ad4m.dev/api/service/checkStatus",{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer "+n}})).status!==200&&console.error("Looks like the client is not running you might not recieve the mail with the code, please check your dashboard logs.")}return 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 Ge(this,null,function*(){var r;try{let n=yield(r=this.ad4mClient)==null?void 0:r.agent.generateJwt(this.requestId,e);return this.setToken(n),yield this.buildClient(),yield this.checkAuth(),this.token}catch(n){throw new Error("Invalid code")}})}clearState(){this.setToken(null),this.setPort(Fs),this.notifyConnectionChange("not_connected"),this.notifyAuthChange("unauthenticated")}};export{il as default};
1470
1495
  /*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */
1471
1496
  //! @fayeed - make it support node.js