@coasys/ad4m-connect 0.10.1-rc7 → 0.10.1-rc9-dev
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 +71 -39
- package/dist/utils.js +1 -1
- package/dist/web.js +63 -31
- package/package.json +2 -2
package/dist/core.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
var Ve=(e,t,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(e,t)).next())});var Xo=function(e,t){return Xo=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])},Xo(e,t)};function be(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Xo(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var _=function(){return _=Object.assign||function(t){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)&&(t[a]=r[a])}return t},_.apply(this,arguments)};function Nt(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r}function bt(e,t,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(e,t||[])).next())})}function _t(e,t){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=t.call(e,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 rr(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,a;n<i;n++)(a||!(n in t))&&(a||(a=Array.prototype.slice.call(t,0,n)),a[n]=t[n]);return e.concat(a||Array.prototype.slice.call(t))}var es="Invariant Violation",bu=Object.setPrototypeOf,Od=bu===void 0?function(e,t){return e.__proto__=t,e}:bu,q=function(e){be(t,e);function t(r){r===void 0&&(r=es);var n=e.call(this,typeof r=="number"?es+": "+r+" (see https://github.com/apollographql/invariant-packages)":r)||this;return n.framesToPop=1,n.name=es,Od(n,t.prototype),n}return t}(Error);function A(e,t){if(!e)throw new q(t)}var ha=["debug","log","warn","error","silent"],ts=ha.indexOf("log");function da(e){return function(){if(ha.indexOf(e)>=ts){var t=console[e]||console.log;return t.apply(console,arguments)}}}(function(e){e.debug=da("debug"),e.log=da("log"),e.warn=da("warn"),e.error=da("error")})(A||(A={}));function _u(e){var t=ha[ts];return ts=Math.max(0,ha.indexOf(e)),t}function
|
|
1
|
+
var Ve=(e,t,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(e,t)).next())});var Xo=function(e,t){return Xo=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])},Xo(e,t)};function be(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Xo(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var _=function(){return _=Object.assign||function(t){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)&&(t[a]=r[a])}return t},_.apply(this,arguments)};function Nt(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r}function bt(e,t,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(e,t||[])).next())})}function _t(e,t){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=t.call(e,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 rr(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,a;n<i;n++)(a||!(n in t))&&(a||(a=Array.prototype.slice.call(t,0,n)),a[n]=t[n]);return e.concat(a||Array.prototype.slice.call(t))}var es="Invariant Violation",bu=Object.setPrototypeOf,Od=bu===void 0?function(e,t){return e.__proto__=t,e}:bu,q=function(e){be(t,e);function t(r){r===void 0&&(r=es);var n=e.call(this,typeof r=="number"?es+": "+r+" (see https://github.com/apollographql/invariant-packages)":r)||this;return n.framesToPop=1,n.name=es,Od(n,t.prototype),n}return t}(Error);function A(e,t){if(!e)throw new q(t)}var ha=["debug","log","warn","error","silent"],ts=ha.indexOf("log");function da(e){return function(){if(ha.indexOf(e)>=ts){var t=console[e]||console.log;return t.apply(console,arguments)}}}(function(e){e.debug=da("debug"),e.log=da("log"),e.warn=da("warn"),e.error=da("error")})(A||(A={}));function _u(e){var t=ha[ts];return ts=Math.max(0,ha.indexOf(e)),t}function Re(e){try{return e()}catch{}}var ma=Re(function(){return globalThis})||Re(function(){return window})||Re(function(){return self})||Re(function(){return global})||Re(function(){return Re.constructor("return this")()});var wu="__",Su=[wu,wu].join("DEV");function Ad(){try{return Boolean(__DEV__)}catch{return Object.defineProperty(ma,Su,{value:Re(function(){return"production"})!=="production",enumerable:!1,configurable:!0,writable:!0}),ma[Su]}}var Dr=Ad();function nr(e){try{return e()}catch{}}var rs=nr(function(){return globalThis})||nr(function(){return window})||nr(function(){return self})||nr(function(){return global})||nr(function(){return nr.constructor("return this")()}),ns=!1;function Dd(){rs&&!nr(function(){return"production"})&&!nr(function(){return process})&&(Object.defineProperty(rs,"process",{value:{env:{NODE_ENV:"production"}},configurable:!0,enumerable:!1,writable:!0}),ns=!0)}Dd();function is(){ns&&(delete rs.process,ns=!1)}var Zb=typeof Symbol=="function"&&Symbol.iterator!=null?Symbol.iterator:"@@iterator",Xb=typeof Symbol=="function"&&Symbol.asyncIterator!=null?Symbol.asyncIterator:"@@asyncIterator",Eu=typeof Symbol=="function"&&Symbol.toStringTag!=null?Symbol.toStringTag:"@@toStringTag";var xe=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 as(e,t){var r=Boolean(e);if(!r)throw new Error(t??"Unexpected invariant triggered.")}var Nd=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):void 0,ni=Nd;function ga(e){var t=e.prototype.toJSON;typeof t=="function"||as(0),e.prototype.inspect=t,ni&&(e.prototype[ni]=t)}var xu=function(){function e(r,n,i){this.start=r.start,this.end=n.end,this.startToken=r,this.endToken=n,this.source=i}var t=e.prototype;return t.toJSON=function(){return{start:this.start,end:this.end}},e}();ga(xu);var Tu=function(){function e(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 t=e.prototype;return t.toJSON=function(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}},e}();ga(Tu);function os(e){return e!=null&&typeof e.kind=="string"}function ya(e){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(e)}var Rd=10,Iu=2;function ii(e){return va(e,[])}function va(e,t){switch(ya(e)){case"string":return JSON.stringify(e);case"function":return e.name?"[function ".concat(e.name,"]"):"[function]";case"object":return e===null?"null":Cd(e,t);default:return String(e)}}function Cd(e,t){if(t.indexOf(e)!==-1)return"[Circular]";var r=[].concat(t,[e]),n=Fd(e);if(n!==void 0){var i=n.call(e);if(i!==e)return typeof i=="string"?i:va(i,r)}else if(Array.isArray(e))return Ld(e,r);return Pd(e,r)}function Pd(e,t){var r=Object.keys(e);if(r.length===0)return"{}";if(t.length>Iu)return"["+Md(e)+"]";var n=r.map(function(i){var a=va(e[i],t);return i+": "+a});return"{ "+n.join(", ")+" }"}function Ld(e,t){if(e.length===0)return"[]";if(t.length>Iu)return"[Array]";for(var r=Math.min(Rd,e.length),n=e.length-r,i=[],a=0;a<r;++a)i.push(va(e[a],t));return n===1?i.push("... 1 more item"):n>1&&i.push("... ".concat(n," more items")),"["+i.join(", ")+"]"}function Fd(e){var t=e[String(ni)];if(typeof t=="function")return t;if(typeof e.inspect=="function")return e.inspect}function Md(e){var t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if(t==="Object"&&typeof e.constructor=="function"){var r=e.constructor.name;if(typeof r=="string"&&r!=="")return r}return t}function ai(e,t){var r=Boolean(e);if(!r)throw new Error(t)}function ku(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function $d(e,t,r){return t&&ku(e.prototype,t),r&&ku(e,r),e}var ba=function(){function e(t){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 t=="string"||ai(0,"Body must be a string. Received: ".concat(ii(t),".")),this.body=t,this.name=r,this.locationOffset=n,this.locationOffset.line>0||ai(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||ai(0,"column in locationOffset is 1-indexed and must be positive.")}return $d(e,[{key:Eu,get:function(){return"Source"}}]),e}();function Ou(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,n=e.indexOf(`
|
|
2
2
|
`)===-1,i=e[0]===" "||e[0]===" ",a=e[e.length-1]==='"',o=e[e.length-1]==="\\",s=!n||a||o||r,u="";return s&&!(n&&i)&&(u+=`
|
|
3
3
|
`+t),u+=t?e.replace(/\n/g,`
|
|
4
4
|
`+t):e,s&&(u+=`
|
|
5
|
-
`),'"""'+u.replace(/"""/g,'\\"""')+'"""'}var jd={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"]},Nr=Object.freeze({});function Be(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:jd,n=void 0,i=Array.isArray(e),a=[e],o=-1,s=[],u=void 0,c=void 0,l=void 0,d=[],p=[],f=e;do{o++;var h=o===a.length,g=h&&s.length!==0;if(h){if(c=p.length===0?void 0:d[d.length-1],u=l,l=p.pop(),g){if(i)u=u.slice();else{for(var y={},S=0,b=Object.keys(u);S<b.length;S++){var v=b[S];y[v]=u[v]}u=y}for(var m=0,O=0;O<s.length;O++){var N=s[O][0],T=s[O][1];i&&(N-=m),i&&T===null?(u.splice(N,1),m++):u[N]=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 D=void 0;if(!Array.isArray(u)){if(!os(u))throw new Error("Invalid AST Node: ".concat(ii(u),"."));var
|
|
5
|
+
`),'"""'+u.replace(/"""/g,'\\"""')+'"""'}var jd={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"]},Nr=Object.freeze({});function Be(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:jd,n=void 0,i=Array.isArray(e),a=[e],o=-1,s=[],u=void 0,c=void 0,l=void 0,d=[],p=[],f=e;do{o++;var h=o===a.length,g=h&&s.length!==0;if(h){if(c=p.length===0?void 0:d[d.length-1],u=l,l=p.pop(),g){if(i)u=u.slice();else{for(var y={},S=0,b=Object.keys(u);S<b.length;S++){var v=b[S];y[v]=u[v]}u=y}for(var m=0,O=0;O<s.length;O++){var N=s[O][0],T=s[O][1];i&&(N-=m),i&&T===null?(u.splice(N,1),m++):u[N]=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 D=void 0;if(!Array.isArray(u)){if(!os(u))throw new Error("Invalid AST Node: ".concat(ii(u),"."));var C=ss(t,u.kind,h);if(C){if(D=C.call(t,u,c,l,d,p),D===Nr)break;if(D===!1){if(!h){d.pop();continue}}else if(D!==void 0&&(s.push([c,D]),!h))if(os(D))u=D;else{d.pop();continue}}}if(D===void 0&&g&&s.push([c,u]),h)d.pop();else{var R;n={inArray:i,index:o,keys:a,edits:s,prev:n},i=Array.isArray(u),a=i?u:(R=r[u.kind])!==null&&R!==void 0?R:[],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 ss(e,t,r){var n=e[t];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?e.leave:e.enter;if(a){if(typeof a=="function")return a;var o=a[t];if(typeof o=="function")return o}}}function vn(e){return Be(e,{leave:qd})}var Ud=80,qd={Name:function(t){return t.value},Variable:function(t){return"$"+t.name},Document:function(t){return P(t.definitions,`
|
|
6
6
|
|
|
7
7
|
`)+`
|
|
8
8
|
`},OperationDefinition:function(t){var r=t.operation,n=t.name,i=ye("(",P(t.variableDefinitions,", "),")"),a=P(t.directives," "),o=t.selectionSet;return!n&&!a&&!i&&r==="query"?o:P([r,P([n,i]),a,o]," ")},VariableDefinition:function(t){var r=t.variable,n=t.type,i=t.defaultValue,a=t.directives;return r+": "+n+ye(" = ",i)+ye(" ",P(a," "))},SelectionSet:function(t){var r=t.selections;return St(r)},Field:function(t){var r=t.alias,n=t.name,i=t.arguments,a=t.directives,o=t.selectionSet,s=ye("",r,": ")+n,u=s+ye("(",P(i,", "),")");return u.length>Ud&&(u=s+ye(`(
|
|
@@ -20,12 +20,12 @@ var Ve=(e,t,r)=>new Promise((n,i)=>{var a=u=>{try{s(r.next(u))}catch(c){i(c)}},o
|
|
|
20
20
|
`)),`
|
|
21
21
|
}`)}function ye(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";return t!=null&&t!==""?e+t+r:""}function _a(e){return ye(" ",e.replace(/\n/g,`
|
|
22
22
|
`))}function Bd(e){return e.indexOf(`
|
|
23
|
-
`)!==-1}function Au(e){return e!=null&&e.some(Bd)}function oi(e){return e.kind===xe.FIELD||e.kind===xe.FRAGMENT_SPREAD||e.kind===xe.INLINE_FRAGMENT}function Du(){return typeof ba=="function"?is():is()}function Zd(){__DEV__?A(typeof Dr=="boolean",Dr):A(typeof Dr=="boolean",39)}Du();Zd();function Qt(e,t){var r=e.directives;return!r||!r.length?!0:Nu(r).every(function(n){var i=n.directive,a=n.ifArgument,o=!1;return a.value.kind==="Variable"?(o=t&&t[a.value.name.value],__DEV__?A(o!==void 0,"Invalid variable referenced in @".concat(i.name.value," directive.")):A(o!==void 0,40)):o=a.value.value,i.name.value==="skip"?!o:o})}function bn(e,t,r){var n=new Set(e),i=n.size;return Be(t,{Directive:function(a){if(n.delete(a.name.value)&&(!r||!n.size))return Nr}}),r?!n.size:n.size<i}function cs(e){return e&&bn(["client","export"],e,!0)}function Xd(e){var t=e.name.value;return t==="skip"||t==="include"}function Nu(e){var t=[];return e&&e.length&&e.forEach(function(r){if(!!Xd(r)){var n=r.arguments,i=r.name.value;__DEV__?A(n&&n.length===1,"Incorrect number of arguments for the @".concat(i," directive.")):A(n&&n.length===1,41);var a=n[0];__DEV__?A(a.name&&a.name.value==="if","Invalid argument for the @".concat(i," directive.")):A(a.name&&a.name.value==="if",42);var o=a.value;__DEV__?A(o&&(o.kind==="Variable"||o.kind==="BooleanValue"),"Argument for the @".concat(i," directive must be a variable or a boolean value.")):A(o&&(o.kind==="Variable"||o.kind==="BooleanValue"),43),t.push({directive:r,ifArgument:a})}}),t}function us(e,t){var r=t,n=[];e.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__?A(n.length===1,"Found ".concat(n.length," fragments. `fragmentName` must be provided when there is not exactly 1 fragment.")):A(n.length===1,45),r=n[0].name.value);var i=_(_({},e),{definitions:rr([{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:r}}]}}],e.definitions,!0)});return i}function Cr(e){e===void 0&&(e=[]);var t={};return e.forEach(function(r){t[r.name.value]=r}),t}function Rr(e,t){switch(e.kind){case"InlineFragment":return e;case"FragmentSpread":{var r=e.name.value;if(typeof t=="function")return t(r);var n=t&&t[r];return __DEV__?A(n,"No fragment named ".concat(r)):A(n,46),n||null}default:return null}}function Z(e){return e!==null&&typeof e=="object"}function Ct(e){return{__ref:String(e)}}function K(e){return Boolean(e&&typeof e=="object"&&typeof e.__ref=="string")}function ls(e){return Z(e)&&e.kind==="Document"&&Array.isArray(e.definitions)}function eh(e){return e.kind==="StringValue"}function th(e){return e.kind==="BooleanValue"}function rh(e){return e.kind==="IntValue"}function nh(e){return e.kind==="FloatValue"}function ih(e){return e.kind==="Variable"}function ah(e){return e.kind==="ObjectValue"}function oh(e){return e.kind==="ListValue"}function sh(e){return e.kind==="EnumValue"}function ch(e){return e.kind==="NullValue"}function ir(e,t,r,n){if(rh(r)||nh(r))e[t.value]=Number(r.value);else if(th(r)||eh(r))e[t.value]=r.value;else if(ah(r)){var i={};r.fields.map(function(o){return ir(i,o.name,o.value,n)}),e[t.value]=i}else if(ih(r)){var a=(n||{})[r.name.value];e[t.value]=a}else if(oh(r))e[t.value]=r.values.map(function(o){var s={};return ir(s,t,o,n),s[t.value]});else if(sh(r))e[t.value]=r.value;else if(ch(r))e[t.value]=null;else throw __DEV__?new q('The inline argument "'.concat(t.value,'" of kind "').concat(r.kind,'"')+"is not supported. Use variables instead of inline arguments to overcome this limitation."):new q(55)}function fs(e,t){var r=null;e.directives&&(r={},e.directives.forEach(function(i){r[i.name.value]={},i.arguments&&i.arguments.forEach(function(a){var o=a.name,s=a.value;return ir(r[i.name.value],o,s,t)})}));var n=null;return e.arguments&&e.arguments.length&&(n={},e.arguments.forEach(function(i){var a=i.name,o=i.value;return ir(n,a,o,t)})),ci(e.name.value,n,r)}var uh=["connection","include","skip","client","rest","export"],ci=Object.assign(function(e,t,r){if(t&&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]=t[s]}),"".concat(r.connection.key,"(").concat(si(i),")")}else return r.connection.key;var a=e;if(t){var o=si(t);a+="(".concat(o,")")}return r&&Object.keys(r).forEach(function(s){uh.indexOf(s)===-1&&(r[s]&&Object.keys(r[s]).length?a+="@".concat(s,"(").concat(si(r[s]),")"):a+="@".concat(s))}),a},{setStringify:function(e){var t=si;return si=e,t}}),si=function(t){return JSON.stringify(t,lh)};function lh(e,t){return Z(t)&&!Array.isArray(t)&&(t=Object.keys(t).sort().reduce(function(r,n){return r[n]=t[n],r},{})),t}function zt(e,t){if(e.arguments&&e.arguments.length){var r={};return e.arguments.forEach(function(n){var i=n.name,a=n.value;return ir(r,i,a,t)}),r}return null}function pt(e){return e.alias?e.alias.value:e.name.value}function ui(e,t,r){if(typeof e.__typename=="string")return e.__typename;for(var n=0,i=t.selections;n<i.length;n++){var a=i[n];if(it(a)){if(a.name.value==="__typename")return e[pt(a)]}else{var o=ui(e,Rr(a,r).selectionSet,r);if(typeof o=="string")return o}}}function it(e){return e.kind==="Field"}function ps(e){return e.kind==="InlineFragment"}function _n(e){__DEV__?A(e&&e.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'):A(e&&e.kind==="Document",47);var t=e.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__?A(t.length<=1,"Ambiguous GraphQL document: contains ".concat(t.length," operations")):A(t.length<=1,49),e}function Rt(e){return _n(e),e.definitions.filter(function(t){return t.kind==="OperationDefinition"})[0]}function wn(e){return e.definitions.filter(function(t){return t.kind==="OperationDefinition"&&!!t.name}).map(function(t){return t.name.value})[0]||null}function Pr(e){return e.definitions.filter(function(t){return t.kind==="FragmentDefinition"})}function li(e){var t=Rt(e);return __DEV__?A(t&&t.operation==="query","Must contain a query definition."):A(t&&t.operation==="query",50),t}function ds(e){__DEV__?A(e.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'):A(e.kind==="Document",51),__DEV__?A(e.definitions.length<=1,"Fragment must have exactly one definition."):A(e.definitions.length<=1,52);var t=e.definitions[0];return __DEV__?A(t.kind==="FragmentDefinition","Must be a fragment definition."):A(t.kind==="FragmentDefinition",53),t}function Lr(e){_n(e);for(var t,r=0,n=e.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"&&!t&&(t=i)}if(t)return t;throw __DEV__?new q("Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment."):new q(54)}function Fr(e){var t=Object.create(null),r=e&&e.variableDefinitions;return r&&r.length&&r.forEach(function(n){n.defaultValue&&ir(t,n.variable.name,n.defaultValue)}),t}var ae=Array.isArray;function ke(e){return Array.isArray(e)&&e.length>0}var Cu={kind:xe.FIELD,name:{kind:xe.NAME,value:"__typename"}};function Pu(e,t){return!e||e.selectionSet.selections.every(function(r){return r.kind===xe.FRAGMENT_SPREAD&&Pu(t[r.name.value],t)})}function fh(e){return Pu(Rt(e)||ds(e),Cr(Pr(e)))?null:e}function ph(e){var t=new Set,r=[];return e.forEach(function(n){n.name?t.add(n.name):n.test&&r.push(n.test)}),function(n){return t.has(n.name.value)||r.some(function(i){return i(n)})}}function Ru(e){var t=new Map;return function(n){n===void 0&&(n=e);var i=t.get(n);return i||t.set(n,i={variables:new Set,fragmentSpreads:new Set}),i}}function hs(e,t){for(var r=Ru(""),n=Ru(""),i=function(b){for(var v=0,m=void 0;v<b.length&&(m=b[v]);++v)if(!ae(m)){if(m.kind===xe.OPERATION_DEFINITION)return r(m.name&&m.name.value);if(m.kind===xe.FRAGMENT_DEFINITION)return n(m.name.value)}return __DEV__&&A.error("Could not find operation or fragment"),null},a=0,o=t.definitions.length-1;o>=0;--o)t.definitions[o].kind===xe.OPERATION_DEFINITION&&++a;var s=ph(e),u=e.some(function(b){return b.remove}),c=function(b){return u&&b&&b.some(s)},l=new Map,d=!1,p={enter:function(b){if(c(b.directives))return d=!0,null}},f=Be(t,{Field:p,InlineFragment:p,VariableDefinition:{enter:function(){return!1}},Variable:{enter:function(b,v,m,O,N){var T=i(N);T&&T.variables.add(b.name.value)}},FragmentSpread:{enter:function(b,v,m,O,N){if(c(b.directives))return d=!0,null;var T=i(N);T&&T.fragmentSpreads.add(b.name.value)}},FragmentDefinition:{enter:function(b,v,m,O){l.set(JSON.stringify(O),b)},leave:function(b,v,m,O){var N=l.get(JSON.stringify(O));if(b===N)return b;if(a>0&&b.selectionSet.selections.every(function(T){return T.kind===xe.FIELD&&T.name.value==="__typename"}))return n(b.name.value).removed=!0,d=!0,null}},Directive:{leave:function(b){if(s(b))return d=!0,null}}});if(!d)return t;var h=function(b){return b.transitiveVars||(b.transitiveVars=new Set(b.variables),b.removed||b.fragmentSpreads.forEach(function(v){h(n(v)).transitiveVars.forEach(function(m){b.transitiveVars.add(m)})})),b},g=new Set;f.definitions.forEach(function(b){b.kind===xe.OPERATION_DEFINITION?h(r(b.name&&b.name.value)).fragmentSpreads.forEach(function(v){g.add(v)}):b.kind===xe.FRAGMENT_DEFINITION&&a===0&&!n(b.name.value).removed&&g.add(b.name.value)}),g.forEach(function(b){h(n(b)).fragmentSpreads.forEach(function(v){g.add(v)})});var y=function(b){return!!(!g.has(b)||n(b).removed)},S={enter:function(b){if(y(b.name.value))return null}};return fh(Be(f,{FragmentSpread:S,FragmentDefinition:S,OperationDefinition:{leave:function(b){if(b.variableDefinitions){var v=h(r(b.name&&b.name.value)).transitiveVars;if(v.size<b.variableDefinitions.length)return _(_({},b),{variableDefinitions:b.variableDefinitions.filter(function(m){return v.has(m.variable.name.value)})})}}}}))}var Mr=Object.assign(function(e){return Be(e,{SelectionSet:{enter:function(t,r,n){if(!(n&&n.kind===xe.OPERATION_DEFINITION)){var i=t.selections;if(!!i){var a=i.some(function(s){return it(s)&&(s.name.value==="__typename"||s.name.value.lastIndexOf("__",0)===0)});if(!a){var o=n;if(!(it(o)&&o.directives&&o.directives.some(function(s){return s.name.value==="export"})))return _(_({},t),{selections:rr(rr([],i,!0),[Cu],!1)})}}}}}})},{added:function(e){return e===Cu}}),dh={test:function(e){var t=e.name.value==="connection";return t&&(!e.arguments||!e.arguments.some(function(r){return r.name.value==="key"}))&&__DEV__&&A.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."),t}};function ms(e){return hs([dh],_n(e))}function gs(e){var t=Lr(e),r=t.operation;if(r==="query")return e;var n=Be(e,{OperationDefinition:{enter:function(i){return _(_({},i),{operation:"query"})}}});return n}function ys(e){_n(e);var t=hs([{test:function(r){return r.name.value==="client"},remove:!0}],e);return t}var hh=Object.prototype.hasOwnProperty;function vs(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return fi(e)}function fi(e){var t=e[0]||{},r=e.length;if(r>1)for(var n=new Ye,i=1;i<r;++i)t=n.merge(t,e[i]);return t}var mh=function(e,t,r){return this.merge(e[r],t[r])},Ye=function(){function e(t){t===void 0&&(t=mh),this.reconciler=t,this.isObject=Z,this.pastCopies=new Set}return e.prototype.merge=function(t,r){for(var n=this,i=[],a=2;a<arguments.length;a++)i[a-2]=arguments[a];return Z(r)&&Z(t)?(Object.keys(r).forEach(function(o){if(hh.call(t,o)){var s=t[o];if(r[o]!==s){var u=n.reconciler.apply(n,rr([t,r,o],i,!1));u!==s&&(t=n.shallowCopyForMerge(t),t[o]=u)}}else t=n.shallowCopyForMerge(t),t[o]=r[o]}),t):r},e.prototype.shallowCopyForMerge=function(t){return Z(t)&&(this.pastCopies.has(t)||(Array.isArray(t)?t=t.slice(0):t=_({__proto__:Object.getPrototypeOf(t)},t),this.pastCopies.add(t))),t},e}();function gh(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=yh(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[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 yh(e,t){if(!!e){if(typeof e=="string")return Lu(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Lu(e,t)}}function Lu(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Fu(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Ss(e,t,r){return t&&Fu(e.prototype,t),r&&Fu(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}var Es=function(){return typeof Symbol=="function"},xs=function(e){return Es()&&Boolean(Symbol[e])},Ts=function(e){return xs(e)?Symbol[e]:"@@"+e};Es()&&!xs("observable")&&(Symbol.observable=Symbol("observable"));var vh=Ts("iterator"),_s=Ts("observable"),Mu=Ts("species");function Sa(e,t){var r=e[t];if(r!=null){if(typeof r!="function")throw new TypeError(r+" is not a function");return r}}function pi(e){var t=e.constructor;return t!==void 0&&(t=t[Mu],t===null&&(t=void 0)),t!==void 0?t:G}function bh(e){return e instanceof G}function Sn(e){Sn.log?Sn.log(e):setTimeout(function(){throw e})}function wa(e){Promise.resolve().then(function(){try{e()}catch(t){Sn(t)}})}function $u(e){var t=e._cleanup;if(t!==void 0&&(e._cleanup=void 0,!!t))try{if(typeof t=="function")t();else{var r=Sa(t,"unsubscribe");r&&r.call(t)}}catch(n){Sn(n)}}function ws(e){e._observer=void 0,e._queue=void 0,e._state="closed"}function _h(e){var t=e._queue;if(!!t){e._queue=void 0,e._state="ready";for(var r=0;r<t.length&&(ju(e,t[r].type,t[r].value),e._state!=="closed");++r);}}function ju(e,t,r){e._state="running";var n=e._observer;try{var i=Sa(n,t);switch(t){case"next":i&&i.call(n,r);break;case"error":if(ws(e),i)i.call(n,r);else throw r;break;case"complete":ws(e),i&&i.call(n);break}}catch(a){Sn(a)}e._state==="closed"?$u(e):e._state==="running"&&(e._state="ready")}function bs(e,t,r){if(e._state!=="closed"){if(e._state==="buffering"){e._queue.push({type:t,value:r});return}if(e._state!=="ready"){e._state="buffering",e._queue=[{type:t,value:r}],wa(function(){return _h(e)});return}ju(e,t,r)}}var wh=function(){function e(r,n){this._cleanup=void 0,this._observer=r,this._queue=void 0,this._state="initializing";var i=new Sh(this);try{this._cleanup=n.call(void 0,i)}catch(a){i.error(a)}this._state==="initializing"&&(this._state="ready")}var t=e.prototype;return t.unsubscribe=function(){this._state!=="closed"&&(ws(this),$u(this))},Ss(e,[{key:"closed",get:function(){return this._state==="closed"}}]),e}(),Sh=function(){function e(r){this._subscription=r}var t=e.prototype;return t.next=function(n){bs(this._subscription,"next",n)},t.error=function(n){bs(this._subscription,"error",n)},t.complete=function(){bs(this._subscription,"complete")},Ss(e,[{key:"closed",get:function(){return this._subscription._state==="closed"}}]),e}(),G=function(){function e(r){if(!(this instanceof e))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 t=e.prototype;return t.subscribe=function(n){return(typeof n!="object"||n===null)&&(n={next:n,error:arguments[1],complete:arguments[2]}),new wh(n,this._subscriber)},t.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})})},t.map=function(n){var i=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var a=pi(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()}})})},t.filter=function(n){var i=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var a=pi(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()}})})},t.reduce=function(n){var i=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var a=pi(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()}})})},t.concat=function(){for(var n=this,i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];var s=pi(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)}})},t.flatMap=function(n){var i=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var a=pi(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()}})},t[_s]=function(){return this},e.from=function(n){var i=typeof this=="function"?this:e;if(n==null)throw new TypeError(n+" is not an object");var a=Sa(n,_s);if(a){var o=a.call(n);if(Object(o)!==o)throw new TypeError(o+" is not an object");return bh(o)&&o.constructor===i?o:new i(function(s){return o.subscribe(s)})}if(xs("iterator")&&(a=Sa(n,vh),a))return new i(function(s){wa(function(){if(!s.closed){for(var u=gh(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){wa(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")},e.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:e;return new o(function(s){wa(function(){if(!s.closed){for(var u=0;u<i.length;++u)if(s.next(i[u]),s.closed)return;s.complete()}})})},Ss(e,null,[{key:Mu,get:function(){return this}}]),e}();Es()&&Object.defineProperty(G,Symbol("extensions"),{value:{symbol:_s,hostReportError:Sn},configurable:!0});function Is(e){var t,r=e.Symbol;if(typeof r=="function")if(r.observable)t=r.observable;else{typeof r.for=="function"?t=r.for("https://github.com/benlesh/symbol-observable"):t=r("https://github.com/benlesh/symbol-observable");try{r.observable=t}catch{}}else t="@@observable";return t}var En;typeof self<"u"?En=self:typeof window<"u"?En=window:typeof global<"u"?En=global:typeof module<"u"?En=module:En=Function("return this")();var Iw=Is(En);var Uu=G.prototype,qu="@@observable";Uu[qu]||(Uu[qu]=function(){return this});var Eh=Object.prototype.toString;function Ea(e){return ks(e)}function ks(e,t){switch(Eh.call(e)){case"[object Array]":{if(t=t||new Map,t.has(e))return t.get(e);var r=e.slice(0);return t.set(e,r),r.forEach(function(i,a){r[a]=ks(i,t)}),r}case"[object Object]":{if(t=t||new Map,t.has(e))return t.get(e);var n=Object.create(Object.getPrototypeOf(e));return t.set(e,n),Object.keys(e).forEach(function(i){n[i]=ks(e[i],t)}),n}default:return e}}function xh(e){var t=new Set([e]);return t.forEach(function(r){Z(r)&&Th(r)===r&&Object.getOwnPropertyNames(r).forEach(function(n){Z(r[n])&&t.add(r[n])})}),e}function Th(e){if(__DEV__&&!Object.isFrozen(e))try{Object.freeze(e)}catch(t){if(t instanceof TypeError)return null;throw t}return e}function di(e){return __DEV__&&xh(e),e}function $r(e,t,r){var n=[];e.forEach(function(i){return i[t]&&n.push(i)}),n.forEach(function(i){return i[t](r)})}function xa(e,t,r){return new G(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(g){++s;var y=function(){return f(g)};c=c.then(y,y).then(function(S){--s,i&&i.call(n,S),u&&d.complete()},function(S){throw--s,S}).catch(function(S){a&&a.call(n,S)})}:function(g){return h&&h.call(n,g)}}var d={next:l(t,i),error:l(r,a),complete:function(){u=!0,s||o&&o.call(n)}},p=e.subscribe(d);return function(){return p.unsubscribe()}})}var dt=typeof WeakMap=="function"&&Ce(function(){return navigator.product})!=="ReactNative",Bu=typeof WeakSet=="function",Os=typeof Symbol=="function"&&typeof Symbol.for=="function",ar=Os&&Symbol.asyncIterator,jw=typeof Ce(function(){return window.document.createElement})=="function",Uw=Ce(function(){return navigator.userAgent.indexOf("jsdom")>=0})||!1;function Ta(e){function t(r){Object.defineProperty(e,r,{value:G})}return Os&&Symbol.species&&t(Symbol.species),t("@@species"),e}function Vu(e){return e&&typeof e.then=="function"}var xn=function(e){be(t,e);function t(r){var n=e.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),$r(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),$r(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?Vu(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"),$r(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 G(r)]),Vu(r)?r.then(function(i){return n.start(i)},n.handlers.error):n.start(r),n}return t.prototype.start=function(r){this.sub===void 0&&(this.sources=Array.from(r),this.handlers.complete())},t.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()}},t.prototype.addObserver=function(r){this.observers.has(r)||(this.deliverLastMessage(r),this.observers.add(r))},t.prototype.removeObserver=function(r){this.observers.delete(r)&&this.observers.size<1&&this.handlers.complete()},t.prototype.notify=function(r,n){var i=this.nextResultListeners;i.size&&(this.nextResultListeners=new Set,i.forEach(function(a){return a(r,n)}))},t.prototype.beforeNext=function(r){var n=!1;this.nextResultListeners.add(function(i,a){n||(n=!0,r(i,a))})},t}(G);Ta(xn);function or(e){return"incremental"in e}function Ih(e){return"hasNext"in e&&"data"in e}function Qu(e){return or(e)||Ih(e)}function Ia(e,t){var r=e,n=new Ye;return or(t)&&ke(t.incremental)&&t.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 Tn(e){var t=ka(e);return ke(t)}function ka(e){var t=ke(e.errors)?e.errors.slice(0):[];return or(e)&&ke(e.incremental)&&e.incremental.forEach(function(r){r.errors&&t.push.apply(t,r.errors)}),t}function sr(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=Object.create(null);return e.forEach(function(n){!n||Object.keys(n).forEach(function(i){var a=n[i];a!==void 0&&(r[i]=a)})}),r}var zu=new Map;function hi(e){var t=zu.get(e)||1;return zu.set(e,t+1),"".concat(e,":").concat(t,":").concat(Math.random().toString(36).slice(2))}function Gu(e){var t=hi("stringifyForDisplay");return JSON.stringify(e,function(r,n){return n===void 0?t:n}).split(JSON.stringify(t)).join("<undefined>")}function mi(e,t){return sr(e,t,t.variables&&{variables:_(_({},e&&e.variables),t.variables)})}function Oa(e){return new G(function(t){t.error(e)})}var gi=function(e,t,r){var n=new Error(r);throw n.name="ServerError",n.response=e,n.statusCode=e.status,n.result=t,n};function As(e){for(var t=["query","operationName","variables","extensions","context"],r=0,n=Object.keys(e);r<n.length;r++){var i=n[r];if(t.indexOf(i)<0)throw __DEV__?new q("illegal argument: ".concat(i)):new q(27)}return e}function Ds(e,t){var r=_({},e),n=function(a){typeof a=="function"?r=_(_({},r),a(r)):r=_(_({},r),a)},i=function(){return _({},r)};return Object.defineProperty(t,"setContext",{enumerable:!1,value:n}),Object.defineProperty(t,"getContext",{enumerable:!1,value:i}),t}function Ns(e){var t={variables:e.variables||{},extensions:e.extensions||{},operationName:e.operationName,query:e.query};return t.operationName||(t.operationName=typeof t.query!="string"?wn(t.query)||void 0:""),t}function Ku(e,t){return t?t(e):G.of()}function yi(e){return typeof e=="function"?new ht(e):e}function Aa(e){return e.request.length<=1}var kh=function(e){be(t,e);function t(r,n){var i=e.call(this,r)||this;return i.link=n,i}return t}(Error),ht=function(){function e(t){t&&(this.request=t)}return e.empty=function(){return new e(function(){return G.of()})},e.from=function(t){return t.length===0?e.empty():t.map(yi).reduce(function(r,n){return r.concat(n)})},e.split=function(t,r,n){var i=yi(r),a=yi(n||new e(Ku));return Aa(i)&&Aa(a)?new e(function(o){return t(o)?i.request(o)||G.of():a.request(o)||G.of()}):new e(function(o,s){return t(o)?i.request(o,s)||G.of():a.request(o,s)||G.of()})},e.execute=function(t,r){return t.request(Ds(r.context,Ns(As(r))))||G.of()},e.concat=function(t,r){var n=yi(t);if(Aa(n))return __DEV__&&A.warn(new kh("You are calling concat on a terminating link, which will have no effect",n)),n;var i=yi(r);return Aa(i)?new e(function(a){return n.request(a,function(o){return i.request(o)||G.of()})||G.of()}):new e(function(a,o){return n.request(a,function(s){return i.request(s,o)||G.of()})||G.of()})},e.prototype.split=function(t,r,n){return this.concat(e.split(t,r,n||new e(Ku)))},e.prototype.concat=function(t){return e.concat(this,t)},e.prototype.request=function(t,r){throw __DEV__?new q("request is not implemented"):new q(22)},e.prototype.onError=function(t,r){if(r&&r.error)return r.error(t),!1;throw t},e.prototype.setOnError=function(t){return this.onError=t,this},e}();var In=ht.execute;var Wu="3.7.10";function Hu(e){return!!e.body}function Ju(e){return!!e.getReader}function Yu(e){return!!(ar&&e[Symbol.asyncIterator])}function Zu(e){return!!e.stream}function Xu(e){return!!e.arrayBuffer}function el(e){return!!e.pipe}function Cs(e){var t,r=e[Symbol.asyncIterator]();return t={next:function(){return r.next()}},t[Symbol.asyncIterator]=function(){return this},t}function Rs(e){var t=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)}),!t||t()}function u(){n=!0;var d=a.slice();d.forEach(function(p){p[0]({value:void 0,done:!0})}),!t||t()}t=function(){t=null,e.removeListener("data",o),e.removeListener("error",s),e.removeListener("end",u),e.removeListener("finish",u),e.removeListener("close",u)},e.on("data",o),e.on("error",s),e.on("end",u),e.on("finish",u),e.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 ar&&(l[Symbol.asyncIterator]=function(){return this}),l}function Ps(e){var t=!1,r={next:function(){return t?Promise.resolve({value:void 0,done:!0}):(t=!0,new Promise(function(n,i){e.then(function(a){n({value:a,done:!1})}).catch(i)}))}};return ar&&(r[Symbol.asyncIterator]=function(){return this}),r}function Da(e){var t={next:function(){return e.read()}};return ar&&(t[Symbol.asyncIterator]=function(){return this}),t}function tl(e){var t=e;if(Hu(e)&&(t=e.body),Yu(t))return Cs(t);if(Ju(t))return Da(t.getReader());if(Zu(t))return Da(t.stream().getReader());if(Xu(t))return Ps(t.arrayBuffer());if(el(t))return Rs(t);throw new Error("Unknown body type for responseIterator. Please pass a streamable response.")}var rl=Object.prototype.hasOwnProperty;function nl(e,t){var r,n,i;return bt(this,void 0,void 0,function(){var a,o,s,u,c,l,d,p,f,h,g,y,S,b,v,m,O,N,T,D;return _t(this,function(R){switch(R.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=e.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=tl(e),p=!0,R.label=1;case 1:return p?[4,d.next()]:[3,3];case 2:for(f=R.sent(),h=f.value,g=f.done,y=typeof h=="string"?h:a.decode(h),p=!g,l+=y,S=l.indexOf(c);S>-1;){if(b=void 0,D=[l.slice(0,S),l.slice(S+c.length)],b=D[0],l=D[1],b.trim()){if(v=b.indexOf(`\r
|
|
23
|
+
`)!==-1}function Au(e){return e!=null&&e.some(Bd)}function oi(e){return e.kind===xe.FIELD||e.kind===xe.FRAGMENT_SPREAD||e.kind===xe.INLINE_FRAGMENT}function Du(){return typeof ba=="function"?is():is()}function Zd(){__DEV__?A(typeof Dr=="boolean",Dr):A(typeof Dr=="boolean",39)}Du();Zd();function Qt(e,t){var r=e.directives;return!r||!r.length?!0:Nu(r).every(function(n){var i=n.directive,a=n.ifArgument,o=!1;return a.value.kind==="Variable"?(o=t&&t[a.value.name.value],__DEV__?A(o!==void 0,"Invalid variable referenced in @".concat(i.name.value," directive.")):A(o!==void 0,40)):o=a.value.value,i.name.value==="skip"?!o:o})}function bn(e,t,r){var n=new Set(e),i=n.size;return Be(t,{Directive:function(a){if(n.delete(a.name.value)&&(!r||!n.size))return Nr}}),r?!n.size:n.size<i}function cs(e){return e&&bn(["client","export"],e,!0)}function Xd(e){var t=e.name.value;return t==="skip"||t==="include"}function Nu(e){var t=[];return e&&e.length&&e.forEach(function(r){if(!!Xd(r)){var n=r.arguments,i=r.name.value;__DEV__?A(n&&n.length===1,"Incorrect number of arguments for the @".concat(i," directive.")):A(n&&n.length===1,41);var a=n[0];__DEV__?A(a.name&&a.name.value==="if","Invalid argument for the @".concat(i," directive.")):A(a.name&&a.name.value==="if",42);var o=a.value;__DEV__?A(o&&(o.kind==="Variable"||o.kind==="BooleanValue"),"Argument for the @".concat(i," directive must be a variable or a boolean value.")):A(o&&(o.kind==="Variable"||o.kind==="BooleanValue"),43),t.push({directive:r,ifArgument:a})}}),t}function us(e,t){var r=t,n=[];e.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__?A(n.length===1,"Found ".concat(n.length," fragments. `fragmentName` must be provided when there is not exactly 1 fragment.")):A(n.length===1,45),r=n[0].name.value);var i=_(_({},e),{definitions:rr([{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:r}}]}}],e.definitions,!0)});return i}function Rr(e){e===void 0&&(e=[]);var t={};return e.forEach(function(r){t[r.name.value]=r}),t}function Cr(e,t){switch(e.kind){case"InlineFragment":return e;case"FragmentSpread":{var r=e.name.value;if(typeof t=="function")return t(r);var n=t&&t[r];return __DEV__?A(n,"No fragment named ".concat(r)):A(n,46),n||null}default:return null}}function Z(e){return e!==null&&typeof e=="object"}function Rt(e){return{__ref:String(e)}}function K(e){return Boolean(e&&typeof e=="object"&&typeof e.__ref=="string")}function ls(e){return Z(e)&&e.kind==="Document"&&Array.isArray(e.definitions)}function eh(e){return e.kind==="StringValue"}function th(e){return e.kind==="BooleanValue"}function rh(e){return e.kind==="IntValue"}function nh(e){return e.kind==="FloatValue"}function ih(e){return e.kind==="Variable"}function ah(e){return e.kind==="ObjectValue"}function oh(e){return e.kind==="ListValue"}function sh(e){return e.kind==="EnumValue"}function ch(e){return e.kind==="NullValue"}function ir(e,t,r,n){if(rh(r)||nh(r))e[t.value]=Number(r.value);else if(th(r)||eh(r))e[t.value]=r.value;else if(ah(r)){var i={};r.fields.map(function(o){return ir(i,o.name,o.value,n)}),e[t.value]=i}else if(ih(r)){var a=(n||{})[r.name.value];e[t.value]=a}else if(oh(r))e[t.value]=r.values.map(function(o){var s={};return ir(s,t,o,n),s[t.value]});else if(sh(r))e[t.value]=r.value;else if(ch(r))e[t.value]=null;else throw __DEV__?new q('The inline argument "'.concat(t.value,'" of kind "').concat(r.kind,'"')+"is not supported. Use variables instead of inline arguments to overcome this limitation."):new q(55)}function fs(e,t){var r=null;e.directives&&(r={},e.directives.forEach(function(i){r[i.name.value]={},i.arguments&&i.arguments.forEach(function(a){var o=a.name,s=a.value;return ir(r[i.name.value],o,s,t)})}));var n=null;return e.arguments&&e.arguments.length&&(n={},e.arguments.forEach(function(i){var a=i.name,o=i.value;return ir(n,a,o,t)})),ci(e.name.value,n,r)}var uh=["connection","include","skip","client","rest","export"],ci=Object.assign(function(e,t,r){if(t&&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]=t[s]}),"".concat(r.connection.key,"(").concat(si(i),")")}else return r.connection.key;var a=e;if(t){var o=si(t);a+="(".concat(o,")")}return r&&Object.keys(r).forEach(function(s){uh.indexOf(s)===-1&&(r[s]&&Object.keys(r[s]).length?a+="@".concat(s,"(").concat(si(r[s]),")"):a+="@".concat(s))}),a},{setStringify:function(e){var t=si;return si=e,t}}),si=function(t){return JSON.stringify(t,lh)};function lh(e,t){return Z(t)&&!Array.isArray(t)&&(t=Object.keys(t).sort().reduce(function(r,n){return r[n]=t[n],r},{})),t}function zt(e,t){if(e.arguments&&e.arguments.length){var r={};return e.arguments.forEach(function(n){var i=n.name,a=n.value;return ir(r,i,a,t)}),r}return null}function pt(e){return e.alias?e.alias.value:e.name.value}function ui(e,t,r){if(typeof e.__typename=="string")return e.__typename;for(var n=0,i=t.selections;n<i.length;n++){var a=i[n];if(it(a)){if(a.name.value==="__typename")return e[pt(a)]}else{var o=ui(e,Cr(a,r).selectionSet,r);if(typeof o=="string")return o}}}function it(e){return e.kind==="Field"}function ps(e){return e.kind==="InlineFragment"}function _n(e){__DEV__?A(e&&e.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'):A(e&&e.kind==="Document",47);var t=e.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__?A(t.length<=1,"Ambiguous GraphQL document: contains ".concat(t.length," operations")):A(t.length<=1,49),e}function Ct(e){return _n(e),e.definitions.filter(function(t){return t.kind==="OperationDefinition"})[0]}function wn(e){return e.definitions.filter(function(t){return t.kind==="OperationDefinition"&&!!t.name}).map(function(t){return t.name.value})[0]||null}function Pr(e){return e.definitions.filter(function(t){return t.kind==="FragmentDefinition"})}function li(e){var t=Ct(e);return __DEV__?A(t&&t.operation==="query","Must contain a query definition."):A(t&&t.operation==="query",50),t}function ds(e){__DEV__?A(e.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'):A(e.kind==="Document",51),__DEV__?A(e.definitions.length<=1,"Fragment must have exactly one definition."):A(e.definitions.length<=1,52);var t=e.definitions[0];return __DEV__?A(t.kind==="FragmentDefinition","Must be a fragment definition."):A(t.kind==="FragmentDefinition",53),t}function Lr(e){_n(e);for(var t,r=0,n=e.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"&&!t&&(t=i)}if(t)return t;throw __DEV__?new q("Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment."):new q(54)}function Fr(e){var t=Object.create(null),r=e&&e.variableDefinitions;return r&&r.length&&r.forEach(function(n){n.defaultValue&&ir(t,n.variable.name,n.defaultValue)}),t}var ae=Array.isArray;function ke(e){return Array.isArray(e)&&e.length>0}var Ru={kind:xe.FIELD,name:{kind:xe.NAME,value:"__typename"}};function Pu(e,t){return!e||e.selectionSet.selections.every(function(r){return r.kind===xe.FRAGMENT_SPREAD&&Pu(t[r.name.value],t)})}function fh(e){return Pu(Ct(e)||ds(e),Rr(Pr(e)))?null:e}function ph(e){var t=new Set,r=[];return e.forEach(function(n){n.name?t.add(n.name):n.test&&r.push(n.test)}),function(n){return t.has(n.name.value)||r.some(function(i){return i(n)})}}function Cu(e){var t=new Map;return function(n){n===void 0&&(n=e);var i=t.get(n);return i||t.set(n,i={variables:new Set,fragmentSpreads:new Set}),i}}function hs(e,t){for(var r=Cu(""),n=Cu(""),i=function(b){for(var v=0,m=void 0;v<b.length&&(m=b[v]);++v)if(!ae(m)){if(m.kind===xe.OPERATION_DEFINITION)return r(m.name&&m.name.value);if(m.kind===xe.FRAGMENT_DEFINITION)return n(m.name.value)}return __DEV__&&A.error("Could not find operation or fragment"),null},a=0,o=t.definitions.length-1;o>=0;--o)t.definitions[o].kind===xe.OPERATION_DEFINITION&&++a;var s=ph(e),u=e.some(function(b){return b.remove}),c=function(b){return u&&b&&b.some(s)},l=new Map,d=!1,p={enter:function(b){if(c(b.directives))return d=!0,null}},f=Be(t,{Field:p,InlineFragment:p,VariableDefinition:{enter:function(){return!1}},Variable:{enter:function(b,v,m,O,N){var T=i(N);T&&T.variables.add(b.name.value)}},FragmentSpread:{enter:function(b,v,m,O,N){if(c(b.directives))return d=!0,null;var T=i(N);T&&T.fragmentSpreads.add(b.name.value)}},FragmentDefinition:{enter:function(b,v,m,O){l.set(JSON.stringify(O),b)},leave:function(b,v,m,O){var N=l.get(JSON.stringify(O));if(b===N)return b;if(a>0&&b.selectionSet.selections.every(function(T){return T.kind===xe.FIELD&&T.name.value==="__typename"}))return n(b.name.value).removed=!0,d=!0,null}},Directive:{leave:function(b){if(s(b))return d=!0,null}}});if(!d)return t;var h=function(b){return b.transitiveVars||(b.transitiveVars=new Set(b.variables),b.removed||b.fragmentSpreads.forEach(function(v){h(n(v)).transitiveVars.forEach(function(m){b.transitiveVars.add(m)})})),b},g=new Set;f.definitions.forEach(function(b){b.kind===xe.OPERATION_DEFINITION?h(r(b.name&&b.name.value)).fragmentSpreads.forEach(function(v){g.add(v)}):b.kind===xe.FRAGMENT_DEFINITION&&a===0&&!n(b.name.value).removed&&g.add(b.name.value)}),g.forEach(function(b){h(n(b)).fragmentSpreads.forEach(function(v){g.add(v)})});var y=function(b){return!!(!g.has(b)||n(b).removed)},S={enter:function(b){if(y(b.name.value))return null}};return fh(Be(f,{FragmentSpread:S,FragmentDefinition:S,OperationDefinition:{leave:function(b){if(b.variableDefinitions){var v=h(r(b.name&&b.name.value)).transitiveVars;if(v.size<b.variableDefinitions.length)return _(_({},b),{variableDefinitions:b.variableDefinitions.filter(function(m){return v.has(m.variable.name.value)})})}}}}))}var Mr=Object.assign(function(e){return Be(e,{SelectionSet:{enter:function(t,r,n){if(!(n&&n.kind===xe.OPERATION_DEFINITION)){var i=t.selections;if(!!i){var a=i.some(function(s){return it(s)&&(s.name.value==="__typename"||s.name.value.lastIndexOf("__",0)===0)});if(!a){var o=n;if(!(it(o)&&o.directives&&o.directives.some(function(s){return s.name.value==="export"})))return _(_({},t),{selections:rr(rr([],i,!0),[Ru],!1)})}}}}}})},{added:function(e){return e===Ru}}),dh={test:function(e){var t=e.name.value==="connection";return t&&(!e.arguments||!e.arguments.some(function(r){return r.name.value==="key"}))&&__DEV__&&A.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."),t}};function ms(e){return hs([dh],_n(e))}function gs(e){var t=Lr(e),r=t.operation;if(r==="query")return e;var n=Be(e,{OperationDefinition:{enter:function(i){return _(_({},i),{operation:"query"})}}});return n}function ys(e){_n(e);var t=hs([{test:function(r){return r.name.value==="client"},remove:!0}],e);return t}var hh=Object.prototype.hasOwnProperty;function vs(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return fi(e)}function fi(e){var t=e[0]||{},r=e.length;if(r>1)for(var n=new Ye,i=1;i<r;++i)t=n.merge(t,e[i]);return t}var mh=function(e,t,r){return this.merge(e[r],t[r])},Ye=function(){function e(t){t===void 0&&(t=mh),this.reconciler=t,this.isObject=Z,this.pastCopies=new Set}return e.prototype.merge=function(t,r){for(var n=this,i=[],a=2;a<arguments.length;a++)i[a-2]=arguments[a];return Z(r)&&Z(t)?(Object.keys(r).forEach(function(o){if(hh.call(t,o)){var s=t[o];if(r[o]!==s){var u=n.reconciler.apply(n,rr([t,r,o],i,!1));u!==s&&(t=n.shallowCopyForMerge(t),t[o]=u)}}else t=n.shallowCopyForMerge(t),t[o]=r[o]}),t):r},e.prototype.shallowCopyForMerge=function(t){return Z(t)&&(this.pastCopies.has(t)||(Array.isArray(t)?t=t.slice(0):t=_({__proto__:Object.getPrototypeOf(t)},t),this.pastCopies.add(t))),t},e}();function gh(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=yh(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[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 yh(e,t){if(!!e){if(typeof e=="string")return Lu(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Lu(e,t)}}function Lu(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Fu(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Ss(e,t,r){return t&&Fu(e.prototype,t),r&&Fu(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}var Es=function(){return typeof Symbol=="function"},xs=function(e){return Es()&&Boolean(Symbol[e])},Ts=function(e){return xs(e)?Symbol[e]:"@@"+e};Es()&&!xs("observable")&&(Symbol.observable=Symbol("observable"));var vh=Ts("iterator"),_s=Ts("observable"),Mu=Ts("species");function Sa(e,t){var r=e[t];if(r!=null){if(typeof r!="function")throw new TypeError(r+" is not a function");return r}}function pi(e){var t=e.constructor;return t!==void 0&&(t=t[Mu],t===null&&(t=void 0)),t!==void 0?t:G}function bh(e){return e instanceof G}function Sn(e){Sn.log?Sn.log(e):setTimeout(function(){throw e})}function wa(e){Promise.resolve().then(function(){try{e()}catch(t){Sn(t)}})}function $u(e){var t=e._cleanup;if(t!==void 0&&(e._cleanup=void 0,!!t))try{if(typeof t=="function")t();else{var r=Sa(t,"unsubscribe");r&&r.call(t)}}catch(n){Sn(n)}}function ws(e){e._observer=void 0,e._queue=void 0,e._state="closed"}function _h(e){var t=e._queue;if(!!t){e._queue=void 0,e._state="ready";for(var r=0;r<t.length&&(ju(e,t[r].type,t[r].value),e._state!=="closed");++r);}}function ju(e,t,r){e._state="running";var n=e._observer;try{var i=Sa(n,t);switch(t){case"next":i&&i.call(n,r);break;case"error":if(ws(e),i)i.call(n,r);else throw r;break;case"complete":ws(e),i&&i.call(n);break}}catch(a){Sn(a)}e._state==="closed"?$u(e):e._state==="running"&&(e._state="ready")}function bs(e,t,r){if(e._state!=="closed"){if(e._state==="buffering"){e._queue.push({type:t,value:r});return}if(e._state!=="ready"){e._state="buffering",e._queue=[{type:t,value:r}],wa(function(){return _h(e)});return}ju(e,t,r)}}var wh=function(){function e(r,n){this._cleanup=void 0,this._observer=r,this._queue=void 0,this._state="initializing";var i=new Sh(this);try{this._cleanup=n.call(void 0,i)}catch(a){i.error(a)}this._state==="initializing"&&(this._state="ready")}var t=e.prototype;return t.unsubscribe=function(){this._state!=="closed"&&(ws(this),$u(this))},Ss(e,[{key:"closed",get:function(){return this._state==="closed"}}]),e}(),Sh=function(){function e(r){this._subscription=r}var t=e.prototype;return t.next=function(n){bs(this._subscription,"next",n)},t.error=function(n){bs(this._subscription,"error",n)},t.complete=function(){bs(this._subscription,"complete")},Ss(e,[{key:"closed",get:function(){return this._subscription._state==="closed"}}]),e}(),G=function(){function e(r){if(!(this instanceof e))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 t=e.prototype;return t.subscribe=function(n){return(typeof n!="object"||n===null)&&(n={next:n,error:arguments[1],complete:arguments[2]}),new wh(n,this._subscriber)},t.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})})},t.map=function(n){var i=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var a=pi(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()}})})},t.filter=function(n){var i=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var a=pi(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()}})})},t.reduce=function(n){var i=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var a=pi(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()}})})},t.concat=function(){for(var n=this,i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];var s=pi(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)}})},t.flatMap=function(n){var i=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var a=pi(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()}})},t[_s]=function(){return this},e.from=function(n){var i=typeof this=="function"?this:e;if(n==null)throw new TypeError(n+" is not an object");var a=Sa(n,_s);if(a){var o=a.call(n);if(Object(o)!==o)throw new TypeError(o+" is not an object");return bh(o)&&o.constructor===i?o:new i(function(s){return o.subscribe(s)})}if(xs("iterator")&&(a=Sa(n,vh),a))return new i(function(s){wa(function(){if(!s.closed){for(var u=gh(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){wa(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")},e.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:e;return new o(function(s){wa(function(){if(!s.closed){for(var u=0;u<i.length;++u)if(s.next(i[u]),s.closed)return;s.complete()}})})},Ss(e,null,[{key:Mu,get:function(){return this}}]),e}();Es()&&Object.defineProperty(G,Symbol("extensions"),{value:{symbol:_s,hostReportError:Sn},configurable:!0});function Is(e){var t,r=e.Symbol;if(typeof r=="function")if(r.observable)t=r.observable;else{typeof r.for=="function"?t=r.for("https://github.com/benlesh/symbol-observable"):t=r("https://github.com/benlesh/symbol-observable");try{r.observable=t}catch{}}else t="@@observable";return t}var En;typeof self<"u"?En=self:typeof window<"u"?En=window:typeof global<"u"?En=global:typeof module<"u"?En=module:En=Function("return this")();var Iw=Is(En);var Uu=G.prototype,qu="@@observable";Uu[qu]||(Uu[qu]=function(){return this});var Eh=Object.prototype.toString;function Ea(e){return ks(e)}function ks(e,t){switch(Eh.call(e)){case"[object Array]":{if(t=t||new Map,t.has(e))return t.get(e);var r=e.slice(0);return t.set(e,r),r.forEach(function(i,a){r[a]=ks(i,t)}),r}case"[object Object]":{if(t=t||new Map,t.has(e))return t.get(e);var n=Object.create(Object.getPrototypeOf(e));return t.set(e,n),Object.keys(e).forEach(function(i){n[i]=ks(e[i],t)}),n}default:return e}}function xh(e){var t=new Set([e]);return t.forEach(function(r){Z(r)&&Th(r)===r&&Object.getOwnPropertyNames(r).forEach(function(n){Z(r[n])&&t.add(r[n])})}),e}function Th(e){if(__DEV__&&!Object.isFrozen(e))try{Object.freeze(e)}catch(t){if(t instanceof TypeError)return null;throw t}return e}function di(e){return __DEV__&&xh(e),e}function $r(e,t,r){var n=[];e.forEach(function(i){return i[t]&&n.push(i)}),n.forEach(function(i){return i[t](r)})}function xa(e,t,r){return new G(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(g){++s;var y=function(){return f(g)};c=c.then(y,y).then(function(S){--s,i&&i.call(n,S),u&&d.complete()},function(S){throw--s,S}).catch(function(S){a&&a.call(n,S)})}:function(g){return h&&h.call(n,g)}}var d={next:l(t,i),error:l(r,a),complete:function(){u=!0,s||o&&o.call(n)}},p=e.subscribe(d);return function(){return p.unsubscribe()}})}var dt=typeof WeakMap=="function"&&Re(function(){return navigator.product})!=="ReactNative",Bu=typeof WeakSet=="function",Os=typeof Symbol=="function"&&typeof Symbol.for=="function",ar=Os&&Symbol.asyncIterator,jw=typeof Re(function(){return window.document.createElement})=="function",Uw=Re(function(){return navigator.userAgent.indexOf("jsdom")>=0})||!1;function Ta(e){function t(r){Object.defineProperty(e,r,{value:G})}return Os&&Symbol.species&&t(Symbol.species),t("@@species"),e}function Vu(e){return e&&typeof e.then=="function"}var xn=function(e){be(t,e);function t(r){var n=e.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),$r(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),$r(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?Vu(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"),$r(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 G(r)]),Vu(r)?r.then(function(i){return n.start(i)},n.handlers.error):n.start(r),n}return t.prototype.start=function(r){this.sub===void 0&&(this.sources=Array.from(r),this.handlers.complete())},t.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()}},t.prototype.addObserver=function(r){this.observers.has(r)||(this.deliverLastMessage(r),this.observers.add(r))},t.prototype.removeObserver=function(r){this.observers.delete(r)&&this.observers.size<1&&this.handlers.complete()},t.prototype.notify=function(r,n){var i=this.nextResultListeners;i.size&&(this.nextResultListeners=new Set,i.forEach(function(a){return a(r,n)}))},t.prototype.beforeNext=function(r){var n=!1;this.nextResultListeners.add(function(i,a){n||(n=!0,r(i,a))})},t}(G);Ta(xn);function or(e){return"incremental"in e}function Ih(e){return"hasNext"in e&&"data"in e}function Qu(e){return or(e)||Ih(e)}function Ia(e,t){var r=e,n=new Ye;return or(t)&&ke(t.incremental)&&t.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 Tn(e){var t=ka(e);return ke(t)}function ka(e){var t=ke(e.errors)?e.errors.slice(0):[];return or(e)&&ke(e.incremental)&&e.incremental.forEach(function(r){r.errors&&t.push.apply(t,r.errors)}),t}function sr(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=Object.create(null);return e.forEach(function(n){!n||Object.keys(n).forEach(function(i){var a=n[i];a!==void 0&&(r[i]=a)})}),r}var zu=new Map;function hi(e){var t=zu.get(e)||1;return zu.set(e,t+1),"".concat(e,":").concat(t,":").concat(Math.random().toString(36).slice(2))}function Gu(e){var t=hi("stringifyForDisplay");return JSON.stringify(e,function(r,n){return n===void 0?t:n}).split(JSON.stringify(t)).join("<undefined>")}function mi(e,t){return sr(e,t,t.variables&&{variables:_(_({},e&&e.variables),t.variables)})}function Oa(e){return new G(function(t){t.error(e)})}var gi=function(e,t,r){var n=new Error(r);throw n.name="ServerError",n.response=e,n.statusCode=e.status,n.result=t,n};function As(e){for(var t=["query","operationName","variables","extensions","context"],r=0,n=Object.keys(e);r<n.length;r++){var i=n[r];if(t.indexOf(i)<0)throw __DEV__?new q("illegal argument: ".concat(i)):new q(27)}return e}function Ds(e,t){var r=_({},e),n=function(a){typeof a=="function"?r=_(_({},r),a(r)):r=_(_({},r),a)},i=function(){return _({},r)};return Object.defineProperty(t,"setContext",{enumerable:!1,value:n}),Object.defineProperty(t,"getContext",{enumerable:!1,value:i}),t}function Ns(e){var t={variables:e.variables||{},extensions:e.extensions||{},operationName:e.operationName,query:e.query};return t.operationName||(t.operationName=typeof t.query!="string"?wn(t.query)||void 0:""),t}function Ku(e,t){return t?t(e):G.of()}function yi(e){return typeof e=="function"?new ht(e):e}function Aa(e){return e.request.length<=1}var kh=function(e){be(t,e);function t(r,n){var i=e.call(this,r)||this;return i.link=n,i}return t}(Error),ht=function(){function e(t){t&&(this.request=t)}return e.empty=function(){return new e(function(){return G.of()})},e.from=function(t){return t.length===0?e.empty():t.map(yi).reduce(function(r,n){return r.concat(n)})},e.split=function(t,r,n){var i=yi(r),a=yi(n||new e(Ku));return Aa(i)&&Aa(a)?new e(function(o){return t(o)?i.request(o)||G.of():a.request(o)||G.of()}):new e(function(o,s){return t(o)?i.request(o,s)||G.of():a.request(o,s)||G.of()})},e.execute=function(t,r){return t.request(Ds(r.context,Ns(As(r))))||G.of()},e.concat=function(t,r){var n=yi(t);if(Aa(n))return __DEV__&&A.warn(new kh("You are calling concat on a terminating link, which will have no effect",n)),n;var i=yi(r);return Aa(i)?new e(function(a){return n.request(a,function(o){return i.request(o)||G.of()})||G.of()}):new e(function(a,o){return n.request(a,function(s){return i.request(s,o)||G.of()})||G.of()})},e.prototype.split=function(t,r,n){return this.concat(e.split(t,r,n||new e(Ku)))},e.prototype.concat=function(t){return e.concat(this,t)},e.prototype.request=function(t,r){throw __DEV__?new q("request is not implemented"):new q(22)},e.prototype.onError=function(t,r){if(r&&r.error)return r.error(t),!1;throw t},e.prototype.setOnError=function(t){return this.onError=t,this},e}();var In=ht.execute;var Wu="3.7.10";function Hu(e){return!!e.body}function Ju(e){return!!e.getReader}function Yu(e){return!!(ar&&e[Symbol.asyncIterator])}function Zu(e){return!!e.stream}function Xu(e){return!!e.arrayBuffer}function el(e){return!!e.pipe}function Rs(e){var t,r=e[Symbol.asyncIterator]();return t={next:function(){return r.next()}},t[Symbol.asyncIterator]=function(){return this},t}function Cs(e){var t=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)}),!t||t()}function u(){n=!0;var d=a.slice();d.forEach(function(p){p[0]({value:void 0,done:!0})}),!t||t()}t=function(){t=null,e.removeListener("data",o),e.removeListener("error",s),e.removeListener("end",u),e.removeListener("finish",u),e.removeListener("close",u)},e.on("data",o),e.on("error",s),e.on("end",u),e.on("finish",u),e.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 ar&&(l[Symbol.asyncIterator]=function(){return this}),l}function Ps(e){var t=!1,r={next:function(){return t?Promise.resolve({value:void 0,done:!0}):(t=!0,new Promise(function(n,i){e.then(function(a){n({value:a,done:!1})}).catch(i)}))}};return ar&&(r[Symbol.asyncIterator]=function(){return this}),r}function Da(e){var t={next:function(){return e.read()}};return ar&&(t[Symbol.asyncIterator]=function(){return this}),t}function tl(e){var t=e;if(Hu(e)&&(t=e.body),Yu(t))return Rs(t);if(Ju(t))return Da(t.getReader());if(Zu(t))return Da(t.stream().getReader());if(Xu(t))return Ps(t.arrayBuffer());if(el(t))return Cs(t);throw new Error("Unknown body type for responseIterator. Please pass a streamable response.")}var rl=Object.prototype.hasOwnProperty;function nl(e,t){var r,n,i;return bt(this,void 0,void 0,function(){var a,o,s,u,c,l,d,p,f,h,g,y,S,b,v,m,O,N,T,D;return _t(this,function(C){switch(C.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=e.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=tl(e),p=!0,C.label=1;case 1:return p?[4,d.next()]:[3,3];case 2:for(f=C.sent(),h=f.value,g=f.done,y=typeof h=="string"?h:a.decode(h),p=!g,l+=y,S=l.indexOf(c);S>-1;){if(b=void 0,D=[l.slice(0,S),l.slice(S+c.length)],b=D[0],l=D[1],b.trim()){if(v=b.indexOf(`\r
|
|
25
25
|
\r
|
|
26
26
|
`),m=Oh(b.slice(0,v)),O=m["content-type"],O&&O.toLowerCase().indexOf("application/json")===-1)throw new Error("Unsupported patch content type: application/json is required.");N=b.slice(v);try{T=il(e,N.replace(`\r
|
|
27
|
-
`,"")),(Object.keys(T).length>1||"data"in T||"incremental"in T||"errors"in T)&&((n=t.next)===null||n===void 0||n.call(t,T))}catch(
|
|
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();t[i]=a}}),t}function il(e,t){if(e.status>=300){var r=function(){try{return JSON.parse(t)}catch{return t}};gi(e,r(),"Response not successful: Received status code ".concat(e.status))}try{return JSON.parse(t)}catch(i){var n=i;throw n.name="ServerParseError",n.response=e,n.statusCode=e.status,n.bodyText=t,n}}function Na(e,t){var r,n;e.name!=="AbortError"&&(e.result&&e.result.errors&&e.result.data&&((r=t.next)===null||r===void 0||r.call(t,e.result)),(n=t.error)===null||n===void 0||n.call(t,e))}function al(e,t,r){Ah(t)(e).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 Na(n,r)})}function Ah(e){return function(t){return t.text().then(function(r){return il(t,r)}).then(function(r){return t.status>=300&&gi(t,r,"Response not successful: Received status code ".concat(t.status)),!Array.isArray(r)&&!rl.call(r,"data")&&!rl.call(r,"errors")&&gi(t,r,"Server response was missing for query '".concat(Array.isArray(e)?e.map(function(n){return n.operationName}):e.operationName,"'.")),r})}}var vi=function(e,t){var r;try{r=JSON.stringify(e)}catch(i){var n=__DEV__?new q("Network request failed. ".concat(t," is not serializable: ").concat(i.message)):new q(24);throw n.parseError=i,n}return r};var Dh={includeQuery:!0,includeExtensions:!1,preserveHeaderCase:!1},Nh={accept:"*/*","content-type":"application/json"},
|
|
27
|
+
`,"")),(Object.keys(T).length>1||"data"in T||"incremental"in T||"errors"in T)&&((n=t.next)===null||n===void 0||n.call(t,T))}catch(R){Na(R,t)}}S=l.indexOf(c)}return[3,1];case 3:return(i=t.complete)===null||i===void 0||i.call(t),[2]}})})}function Oh(e){var t={};return e.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();t[i]=a}}),t}function il(e,t){if(e.status>=300){var r=function(){try{return JSON.parse(t)}catch{return t}};gi(e,r(),"Response not successful: Received status code ".concat(e.status))}try{return JSON.parse(t)}catch(i){var n=i;throw n.name="ServerParseError",n.response=e,n.statusCode=e.status,n.bodyText=t,n}}function Na(e,t){var r,n;e.name!=="AbortError"&&(e.result&&e.result.errors&&e.result.data&&((r=t.next)===null||r===void 0||r.call(t,e.result)),(n=t.error)===null||n===void 0||n.call(t,e))}function al(e,t,r){Ah(t)(e).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 Na(n,r)})}function Ah(e){return function(t){return t.text().then(function(r){return il(t,r)}).then(function(r){return t.status>=300&&gi(t,r,"Response not successful: Received status code ".concat(t.status)),!Array.isArray(r)&&!rl.call(r,"data")&&!rl.call(r,"errors")&&gi(t,r,"Server response was missing for query '".concat(Array.isArray(e)?e.map(function(n){return n.operationName}):e.operationName,"'.")),r})}}var vi=function(e,t){var r;try{r=JSON.stringify(e)}catch(i){var n=__DEV__?new q("Network request failed. ".concat(t," is not serializable: ").concat(i.message)):new q(24);throw n.parseError=i,n}return r};var Dh={includeQuery:!0,includeExtensions:!1,preserveHeaderCase:!1},Nh={accept:"*/*","content-type":"application/json"},Rh={method:"POST"},ol={http:Dh,headers:Nh,options:Rh},sl=function(e,t){return t(e)};function cl(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var i={},a={};r.forEach(function(d){i=_(_(_({},i),d.options),{headers:_(_({},i.headers),d.headers)}),d.credentials&&(i.credentials=d.credentials),a=_(_({},a),d.http)}),i.headers&&(i.headers=Ch(i.headers,a.preserveHeaderCase));var o=e.operationName,s=e.extensions,u=e.variables,c=e.query,l={operationName:o,variables:u};return a.includeExtensions&&(l.extensions=s),a.includeQuery&&(l.query=t(c,vn)),{options:i,body:l}}function Ch(e,t){if(!t){var r=Object.create(null);return Object.keys(Object(e)).forEach(function(a){r[a.toLowerCase()]=e[a]}),r}var n=Object.create(null);Object.keys(Object(e)).forEach(function(a){n[a.toLowerCase()]={originalName:a,value:e[a]}});var i=Object.create(null);return Object.keys(n).forEach(function(a){i[n[a].originalName]=n[a].value}),i}var ul=function(e){if(!e&&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 q(23)};var ll=function(){if(typeof AbortController>"u")return{controller:!1,signal:!1};var e=new AbortController,t=e.signal;return{controller:e,signal:t}};var fl=function(e,t){var r=e.getContext(),n=r.uri;return n||(typeof t=="function"?t(e):t||"/graphql")};function pl(e,t){var r=[],n=function(d,p){r.push("".concat(d,"=").concat(encodeURIComponent(p)))};if("query"in t&&n("query",t.query),t.operationName&&n("operationName",t.operationName),t.variables){var i=void 0;try{i=vi(t.variables,"Variables map")}catch(d){return{parseError:d}}n("variables",i)}if(t.extensions){var a=void 0;try{a=vi(t.extensions,"Extensions map")}catch(d){return{parseError:d}}n("extensions",a)}var o="",s=e,u=e.indexOf("#");u!==-1&&(o=e.substr(u),s=e.substr(0,u));var c=s.indexOf("?")===-1?"?":"&",l=s+c+r.join("&")+o;return{newURI:l}}var dl=Ce(function(){return fetch}),hl=function(e){e===void 0&&(e={});var t=e.uri,r=t===void 0?"/graphql":t,n=e.fetch,i=e.print,a=i===void 0?sl:i,o=e.includeExtensions,s=e.preserveHeaderCase,u=e.useGETForQueries,c=e.includeUnusedVariables,l=c===void 0?!1:c,d=Nt(e,["uri","fetch","print","includeExtensions","preserveHeaderCase","useGETForQueries","includeUnusedVariables"]);__DEV__&&ul(n||dl);var p={http:{includeExtensions:o,preserveHeaderCase:s},options:d.fetchOptions,credentials:d.credentials,headers:d.headers};return new ht(function(f){var h=fl(f,r),g=f.getContext(),y={};if(g.clientAwareness){var S=g.clientAwareness,b=S.name,v=S.version;b&&(y["apollographql-client-name"]=b),v&&(y["apollographql-client-version"]=v)}var m=_(_({},y),g.headers),O={http:g.http,options:g.fetchOptions,credentials:g.credentials,headers:m},N=cl(f,a,ol,p,O),T=N.options,D=N.body;if(D.variables&&!l){var R=new Set(Object.keys(D.variables));Be(f.query,{Variable:function(Y,At,z){z&&z.kind!=="VariableDefinition"&&R.delete(Y.name.value)}}),R.size&&(D.variables=_({},D.variables),R.forEach(function(Y){delete D.variables[Y]}))}var C;if(!T.signal){var j=ll(),Pe=j.controller,Ie=j.signal;C=Pe,C&&(T.signal=Ie)}var U=function(Y){return Y.kind==="OperationDefinition"&&Y.operation==="mutation"};if(u&&!f.query.definitions.some(U)&&(T.method="GET"),bn(["defer"],f.query)&&(T.headers=T.headers||{},T.headers.accept="multipart/mixed; deferSpec=20220824, application/json"),T.method==="GET"){var ce=pl(h,D),ue=ce.newURI,J=ce.parseError;if(J)return Oa(J);h=ue}else try{T.body=vi(D,"Payload")}catch(Y){return Oa(Y)}return new G(function(Y){var At=n||Ce(function(){return fetch})||dl;return At(h,T).then(function(z){var Dt;f.setContext({response:z});var tr=(Dt=z.headers)===null||Dt===void 0?void 0:Dt.get("content-type");return tr!==null&&/^multipart\/mixed/i.test(tr)?nl(z,Y):al(z,f,Y)}).catch(function(z){return Na(z,Y)}),function(){C&&C.abort()}})})};var Ls=function(e){be(t,e);function t(r){r===void 0&&(r={});var n=e.call(this,hl(r).request)||this;return n.options=r,n}return t}(ht);var{toString:ml,hasOwnProperty:Ph}=Object.prototype,gl=Function.prototype.toString,Fs=new Map;function de(e,t){try{return Ms(e,t)}finally{Fs.clear()}}function Ms(e,t){if(e===t)return!0;let r=ml.call(e),n=ml.call(t);if(r!==n)return!1;switch(r){case"[object Array]":if(e.length!==t.length)return!1;case"[object Object]":{if(vl(e,t))return!0;let i=yl(e),a=yl(t),o=i.length;if(o!==a.length)return!1;for(let s=0;s<o;++s)if(!Ph.call(t,i[s]))return!1;for(let s=0;s<o;++s){let u=i[s];if(!Ms(e[u],t[u]))return!1}return!0}case"[object Error]":return e.name===t.name&&e.message===t.message;case"[object Number]":if(e!==e)return t!==t;case"[object Boolean]":case"[object Date]":return+e==+t;case"[object RegExp]":case"[object String]":return e==`${t}`;case"[object Map]":case"[object Set]":{if(e.size!==t.size)return!1;if(vl(e,t))return!0;let i=e.entries(),a=r==="[object Map]";for(;;){let o=i.next();if(o.done)break;let[s,u]=o.value;if(!t.has(s)||a&&!Ms(u,t.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]":e=new Uint8Array(e),t=new Uint8Array(t);case"[object DataView]":{let i=e.byteLength;if(i===t.byteLength)for(;i--&&e[i]===t[i];);return i===-1}case"[object AsyncFunction]":case"[object GeneratorFunction]":case"[object AsyncGeneratorFunction]":case"[object Function]":{let i=gl.call(e);return i!==gl.call(t)?!1:!Mh(i,Fh)}}return!1}function yl(e){return Object.keys(e).filter(Lh,e)}function Lh(e){return this[e]!==void 0}var Fh="{ [native code] }";function Mh(e,t){let r=e.length-t.length;return r>=0&&e.indexOf(t,r)===r}function vl(e,t){let r=Fs.get(e);if(r){if(r.has(t))return!0}else Fs.set(e,r=new Set);return r.add(t),!1}var $h=function(){return Object.create(null)},bl=Array.prototype,jh=bl.forEach,Uh=bl.slice,Pt=function(){function e(t,r){t===void 0&&(t=!0),r===void 0&&(r=$h),this.weakness=t,this.makeData=r}return e.prototype.lookup=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return this.lookupArray(t)},e.prototype.lookupArray=function(t){var r=this;return jh.call(t,function(n){return r=r.getChildTrie(n)}),r.data||(r.data=this.makeData(Uh.call(t)))},e.prototype.getChildTrie=function(t){var r=this.weakness&&qh(t)?this.weak||(this.weak=new WeakMap):this.strong||(this.strong=new Map),n=r.get(t);return n||r.set(t,n=new e(this.weakness,this.makeData)),n},e}();function qh(e){switch(typeof e){case"object":if(e===null)break;case"function":return!0}return!1}var Me=null,_l={},Bh=1,Vh=()=>class{constructor(){this.id=["slot",Bh++,Date.now(),Math.random().toString(36).slice(2)].join(":")}hasValue(){for(let t=Me;t;t=t.parent)if(this.id in t.slots){let r=t.slots[this.id];if(r===_l)break;return t!==Me&&(Me.slots[this.id]=r),!0}return Me&&(Me.slots[this.id]=_l),!1}getValue(){if(this.hasValue())return Me.slots[this.id]}withValue(t,r,n,i){let a={__proto__:null,[this.id]:t},o=Me;Me={parent:o,slots:a};try{return r.apply(i,n)}finally{Me=o}}static bind(t){let r=Me;return function(){let n=Me;try{return Me=r,t.apply(this,arguments)}finally{Me=n}}}static noContext(t,r,n){if(Me){let i=Me;try{return Me=null,t.apply(n,r)}finally{Me=i}}else return t.apply(n,r)}};function wl(e){try{return e()}catch{}}var $s="@wry/context:Slot",Qh=wl(()=>globalThis)||wl(()=>global)||Object.create(null),Sl=Qh,kn=Sl[$s]||Array[$s]||function(e){try{Object.defineProperty(Sl,$s,{value:e,enumerable:!1,writable:!1,configurable:!0})}finally{return e}}(Vh());var{bind:zh,noContext:Gh}=kn;function Kh(){}var Wh=function(){function e(t,r){t===void 0&&(t=1/0),r===void 0&&(r=Kh),this.max=t,this.dispose=r,this.map=new Map,this.newest=null,this.oldest=null}return e.prototype.has=function(t){return this.map.has(t)},e.prototype.get=function(t){var r=this.getNode(t);return r&&r.value},e.prototype.getNode=function(t){var r=this.map.get(t);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},e.prototype.set=function(t,r){var n=this.getNode(t);return n?n.value=r:(n={key:t,value:r,newer:null,older:this.newest},this.newest&&(this.newest.newer=n),this.newest=n,this.oldest=this.oldest||n,this.map.set(t,n),n.value)},e.prototype.clean=function(){for(;this.oldest&&this.map.size>this.max;)this.delete(this.oldest.key)},e.prototype.delete=function(t){var r=this.map.get(t);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(t),this.dispose(r.value,t),!0):!1},e}(),Ra=new kn,js,Hh=Object.prototype.hasOwnProperty,qs=(js=Array.from,js===void 0?function(e){var t=[];return e.forEach(function(r){return t.push(r)}),t}:js);function Ca(e){var t=e.unsubscribe;typeof t=="function"&&(e.unsubscribe=void 0,t())}var bi=[],Jh=100;function On(e,t){if(!e)throw new Error(t||"assertion failure")}function Yh(e,t){var r=e.length;return r>0&&r===t.length&&e[r-1]===t[r-1]}function xl(e){switch(e.length){case 0:throw new Error("unknown value");case 1:return e[0];case 2:throw e[1]}}function Zh(e){return e.slice(0)}var Xh=function(){function e(t){this.fn=t,this.parents=new Set,this.childValues=new Map,this.dirtyChildren=null,this.dirty=!0,this.recomputing=!1,this.value=[],this.deps=null,++e.count}return e.prototype.peek=function(){if(this.value.length===1&&!cr(this))return El(this),this.value[0]},e.prototype.recompute=function(t){return On(!this.recomputing,"already recomputing"),El(this),cr(this)?em(this,t):xl(this.value)},e.prototype.setDirty=function(){this.dirty||(this.dirty=!0,this.value.length=0,Tl(this),Ca(this))},e.prototype.dispose=function(){var t=this;this.setDirty(),Dl(this),Bs(this,function(r,n){r.setDirty(),Nl(r,t)})},e.prototype.forget=function(){this.dispose()},e.prototype.dependOn=function(t){t.add(this),this.deps||(this.deps=bi.pop()||new Set),this.deps.add(t)},e.prototype.forgetDeps=function(){var t=this;this.deps&&(qs(this.deps).forEach(function(r){return r.delete(t)}),this.deps.clear(),bi.push(this.deps),this.deps=null)},e.count=0,e}();function El(e){var t=Ra.getValue();if(t)return e.parents.add(t),t.childValues.has(e)||t.childValues.set(e,[]),cr(e)?kl(t,e):Ol(t,e),t}function em(e,t){return Dl(e),Ra.withValue(e,tm,[e,t]),nm(e,t)&&rm(e),xl(e.value)}function tm(e,t){e.recomputing=!0,e.value.length=0;try{e.value[0]=e.fn.apply(null,t)}catch(r){e.value[1]=r}e.recomputing=!1}function cr(e){return e.dirty||!!(e.dirtyChildren&&e.dirtyChildren.size)}function rm(e){e.dirty=!1,!cr(e)&&Il(e)}function Tl(e){Bs(e,kl)}function Il(e){Bs(e,Ol)}function Bs(e,t){var r=e.parents.size;if(r)for(var n=qs(e.parents),i=0;i<r;++i)t(n[i],e)}function kl(e,t){On(e.childValues.has(t)),On(cr(t));var r=!cr(e);if(!e.dirtyChildren)e.dirtyChildren=bi.pop()||new Set;else if(e.dirtyChildren.has(t))return;e.dirtyChildren.add(t),r&&Tl(e)}function Ol(e,t){On(e.childValues.has(t)),On(!cr(t));var r=e.childValues.get(t);r.length===0?e.childValues.set(t,Zh(t.value)):Yh(r,t.value)||e.setDirty(),Al(e,t),!cr(e)&&Il(e)}function Al(e,t){var r=e.dirtyChildren;r&&(r.delete(t),r.size===0&&(bi.length<Jh&&bi.push(r),e.dirtyChildren=null))}function Dl(e){e.childValues.size>0&&e.childValues.forEach(function(t,r){Nl(e,r)}),e.forgetDeps(),On(e.dirtyChildren===null)}function Nl(e,t){t.parents.delete(e),e.childValues.delete(t),Al(e,t)}function nm(e,t){if(typeof e.subscribe=="function")try{Ca(e),e.unsubscribe=e.subscribe.apply(null,t)}catch{return e.setDirty(),!1}return!0}var im={setDirty:!0,dispose:!0,forget:!0};function Pa(e){var t=new Map,r=e&&e.subscribe;function n(i){var a=Ra.getValue();if(a){var o=t.get(i);o||t.set(i,o=new Set),a.dependOn(o),typeof r=="function"&&(Ca(o),o.unsubscribe=r(i))}}return n.dirty=function(a,o){var s=t.get(a);if(s){var u=o&&Hh.call(im,o)?o:"setDirty";qs(s).forEach(function(c){return c[u]()}),t.delete(a),Ca(s)}},n}function Cl(){var e=new Pt(typeof WeakMap=="function");return function(){return e.lookupArray(arguments)}}var wE=Cl(),Us=new Set;function jr(e,t){t===void 0&&(t=Object.create(null));var r=new Wh(t.max||Math.pow(2,16),function(c){return c.dispose()}),n=t.keyArgs,i=t.makeCacheKey||Cl(),a=function(){var c=i.apply(null,n?n.apply(null,arguments):arguments);if(c===void 0)return e.apply(null,arguments);var l=r.get(c);l||(r.set(c,l=new Xh(e)),l.subscribe=t.subscribe,l.forget=function(){return r.delete(c)});var d=l.recompute(Array.prototype.slice.call(arguments));return r.set(c,l),Us.add(r),Ra.hasValue()||(Us.forEach(function(p){return p.clean()}),Us.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 Vs=function(){function e(){this.getFragmentDoc=jr(us)}return e.prototype.batch=function(t){var r=this,n=typeof t.optimistic=="string"?t.optimistic:t.optimistic===!1?null:void 0,i;return this.performTransaction(function(){return i=t.update(r)},n),i},e.prototype.recordOptimisticTransaction=function(t,r){this.performTransaction(t,r)},e.prototype.transformDocument=function(t){return t},e.prototype.transformForLink=function(t){return t},e.prototype.identify=function(t){},e.prototype.gc=function(){return[]},e.prototype.modify=function(t){return!1},e.prototype.readQuery=function(t,r){return r===void 0&&(r=!!t.optimistic),this.read(_(_({},t),{rootId:t.id||"ROOT_QUERY",optimistic:r}))},e.prototype.readFragment=function(t,r){return r===void 0&&(r=!!t.optimistic),this.read(_(_({},t),{query:this.getFragmentDoc(t.fragment,t.fragmentName),rootId:t.id,optimistic:r}))},e.prototype.writeQuery=function(t){var r=t.id,n=t.data,i=Nt(t,["id","data"]);return this.write(Object.assign(i,{dataId:r||"ROOT_QUERY",result:n}))},e.prototype.writeFragment=function(t){var r=t.id,n=t.data,i=t.fragment,a=t.fragmentName,o=Nt(t,["id","data","fragment","fragmentName"]);return this.write(Object.assign(o,{query:this.getFragmentDoc(i,a),dataId:r,result:n}))},e.prototype.updateQuery=function(t,r){return this.batch({update:function(n){var i=n.readQuery(t),a=r(i);return a==null?i:(n.writeQuery(_(_({},t),{data:a})),a)}})},e.prototype.updateFragment=function(t,r){return this.batch({update:function(n){var i=n.readFragment(t),a=r(i);return a==null?i:(n.writeFragment(_(_({},t),{data:a})),a)}})},e}();var _i=function(e){be(t,e);function t(r,n,i,a){var o,s=e.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__=t.prototype,s}return t}(Error);var _e=Object.prototype.hasOwnProperty;function wi(e){return e==null}function Fa(e,t){var r=e.__typename,n=e.id,i=e._id;if(typeof r=="string"&&(t&&(t.keyObject=wi(n)?wi(i)?void 0:{_id:i}:{id:n}),wi(n)&&!wi(i)&&(n=i),!wi(n)))return"".concat(r,":").concat(typeof n=="number"||typeof n=="string"?n:JSON.stringify(n))}var Rl={dataIdFromObject:Fa,addTypename:!0,resultCaching:!0,canonizeResults:!1};function Pl(e){return sr(Rl,e)}function Ma(e){var t=e.canonizeResults;return t===void 0?Rl.canonizeResults:t}function Ll(e,t){return K(t)?e.get(t.__ref,"__typename"):t&&t.__typename}var Qs=/^[_a-z][_0-9a-z]*/i;function Et(e){var t=e.match(Qs);return t?t[0]:e}function La(e,t,r){return Z(t)?ae(t)?t.every(function(n){return La(e,n,r)}):e.selections.every(function(n){if(it(n)&&Qt(n,r)){var i=pt(n);return _e.call(t,i)&&(!n.selectionSet||La(n.selectionSet,t[i],r))}return!0}):!1}function ur(e){return Z(e)&&!K(e)&&!ae(e)}function Fl(){return new Ye}function $a(e,t){var r=Cr(Pr(e));return{fragmentMap:r,lookupFragment:function(n){var i=r[n];return!i&&t&&(i=t.lookup(n)),i||null}}}var ja=Object.create(null),zs=function(){return ja},Ml=Object.create(null),An=function(){function e(t,r){var n=this;this.policies=t,this.group=r,this.data=Object.create(null),this.rootIds=Object.create(null),this.refs=Object.create(null),this.getFieldValue=function(i,a){return di(K(i)?n.get(i.__ref,a):i&&i[a])},this.canRead=function(i){return K(i)?n.has(i.__ref):typeof i=="object"},this.toReference=function(i,a){if(typeof i=="string")return Ct(i);if(K(i))return i;var o=n.policies.identify(i)[0];if(o){var s=Ct(o);return a&&n.merge(o,i),s}}}return e.prototype.toObject=function(){return _({},this.data)},e.prototype.has=function(t){return this.lookup(t,!0)!==void 0},e.prototype.get=function(t,r){if(this.group.depend(t,r),_e.call(this.data,t)){var n=this.data[t];if(n&&_e.call(n,r))return n[r]}if(r==="__typename"&&_e.call(this.policies.rootTypenamesById,t))return this.policies.rootTypenamesById[t];if(this instanceof lr)return this.parent.get(t,r)},e.prototype.lookup=function(t,r){if(r&&this.group.depend(t,"__exists"),_e.call(this.data,t))return this.data[t];if(this instanceof lr)return this.parent.lookup(t,r);if(this.policies.rootTypenamesById[t])return Object.create(null)},e.prototype.merge=function(t,r){var n=this,i;K(t)&&(t=t.__ref),K(r)&&(r=r.__ref);var a=typeof t=="string"?this.lookup(i=t):t,o=typeof r=="string"?this.lookup(i=r):r;if(!!o){__DEV__?A(typeof i=="string","store.merge expects a string ID"):A(typeof i=="string",1);var s=new Ye(om).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=Et(c);l!==c&&!n.policies.hasKeyArgs(s.__typename,l)&&(u[l]=1),s[c]===void 0&&!(n instanceof lr)&&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)})}}},e.prototype.modify=function(t,r){var n=this,i=this.lookup(t);if(i){var a=Object.create(null),o=!1,s=!0,u={DELETE:ja,INVALIDATE:Ml,isReference:K,toReference:this.toReference,canRead:this.canRead,readField:function(c,l){return n.policies.readField(typeof c=="string"?{fieldName:c,from:l||Ct(t)}:c,{store:n})}};if(Object.keys(i).forEach(function(c){var l=Et(c),d=i[c];if(d!==void 0){var p=typeof r=="function"?r:r[c]||r[l];if(p){var f=p===zs?ja:p(di(d),_(_({},u),{fieldName:l,storeFieldName:c,storage:n.getStorage(t,c)}));f===Ml?n.group.dirty(t,c):(f===ja&&(f=void 0),f!==d&&(a[c]=f,o=!0,d=f))}d!==void 0&&(s=!1)}}),o)return this.merge(t,a),s&&(this instanceof lr?this.data[t]=void 0:delete this.data[t],this.group.dirty(t,"__exists")),!0}return!1},e.prototype.delete=function(t,r,n){var i,a=this.lookup(t);if(a){var o=this.getFieldValue(a,"__typename"),s=r&&n?this.policies.getStoreFieldName({typename:o,fieldName:r,args:n}):r;return this.modify(t,s?(i={},i[s]=zs,i):zs)}return!1},e.prototype.evict=function(t,r){var n=!1;return t.id&&(_e.call(this.data,t.id)&&(n=this.delete(t.id,t.fieldName,t.args)),this instanceof lr&&this!==r&&(n=this.parent.evict(t,r)||n),(t.fieldName||n)&&this.group.dirty(t.id,t.fieldName||"__exists")),n},e.prototype.clear=function(){this.replace(null)},e.prototype.extract=function(){var t=this,r=this.toObject(),n=[];return this.getRootIdSet().forEach(function(i){_e.call(t.policies.rootTypenamesById,i)||n.push(i)}),n.length&&(r.__META={extraRootIds:n.sort()}),r},e.prototype.replace=function(t){var r=this;if(Object.keys(this.data).forEach(function(a){t&&_e.call(t,a)||r.delete(a)}),t){var n=t.__META,i=Nt(t,["__META"]);Object.keys(i).forEach(function(a){r.merge(a,i[a])}),n&&n.extraRootIds.forEach(this.retain,this)}},e.prototype.retain=function(t){return this.rootIds[t]=(this.rootIds[t]||0)+1},e.prototype.release=function(t){if(this.rootIds[t]>0){var r=--this.rootIds[t];return r||delete this.rootIds[t],r}return 0},e.prototype.getRootIdSet=function(t){return t===void 0&&(t=new Set),Object.keys(this.rootIds).forEach(t.add,t),this instanceof lr?this.parent.getRootIdSet(t):Object.keys(this.policies.rootTypenamesById).forEach(t.add,t),t},e.prototype.gc=function(){var t=this,r=this.getRootIdSet(),n=this.toObject();r.forEach(function(o){_e.call(n,o)&&(Object.keys(t.findChildRefIds(o)).forEach(r.add,r),delete n[o])});var i=Object.keys(n);if(i.length){for(var a=this;a instanceof lr;)a=a.parent;i.forEach(function(o){return a.delete(o)})}return i},e.prototype.findChildRefIds=function(t){if(!_e.call(this.refs,t)){var r=this.refs[t]=Object.create(null),n=this.data[t];if(!n)return r;var i=new Set([n]);i.forEach(function(a){K(a)&&(r[a.__ref]=!0),Z(a)&&Object.keys(a).forEach(function(o){var s=a[o];Z(s)&&i.add(s)})})}return this.refs[t]},e.prototype.makeCacheKey=function(){return this.group.keyMaker.lookupArray(arguments)},e}();var $l=function(){function e(t,r){r===void 0&&(r=null),this.caching=t,this.parent=r,this.d=null,this.resetCaching()}return e.prototype.resetCaching=function(){this.d=this.caching?Pa():null,this.keyMaker=new Pt(dt)},e.prototype.depend=function(t,r){if(this.d){this.d(Gs(t,r));var n=Et(r);n!==r&&this.d(Gs(t,n)),this.parent&&this.parent.depend(t,r)}},e.prototype.dirty=function(t,r){this.d&&this.d.dirty(Gs(t,r),r==="__exists"?"forget":"setDirty")},e}();function Gs(e,t){return t+"#"+e}function Ks(e,t){Ur(e)&&e.group.depend(t,"__exists")}(function(e){var t=function(r){be(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 $l(s))||this;return c.stump=new am(c),c.storageTrie=new Pt(dt),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}(e);e.Root=t})(An||(An={}));var lr=function(e){be(t,e);function t(r,n,i,a){var o=e.call(this,n.policies,a)||this;return o.id=r,o.parent=n,o.replay=i,o.group=a,i(o),o}return t.prototype.addLayer=function(r,n){return new t(r,this,n,this.group)},t.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){de(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)},t.prototype.toObject=function(){return _(_({},this.parent.toObject()),this.data)},t.prototype.findChildRefIds=function(r){var n=this.parent.findChildRefIds(r);return _e.call(this.data,r)?_(_({},n),e.prototype.findChildRefIds.call(this,r)):n},t.prototype.getStorage=function(){for(var r=this.parent;r.parent;)r=r.parent;return r.getStorage.apply(r,arguments)},t}(An),am=function(e){be(t,e);function t(r){return e.call(this,"EntityStore.Stump",r,function(){},new $l(r.group.caching,r.group))||this}return t.prototype.removeLayer=function(){return this},t.prototype.merge=function(){return this.parent.merge.apply(this.parent,arguments)},t}(lr);function om(e,t,r){var n=e[r],i=t[r];return de(n,i)?n:i}function Ur(e){return!!(e instanceof An&&e.group.caching)}function sm(e){return Z(e)?ae(e)?e.slice(0):_({__proto__:Object.getPrototypeOf(e)},e):e}var Ua=function(){function e(){this.known=new(Bu?WeakSet:Set),this.pool=new Pt(dt),this.passes=new WeakMap,this.keysByJSON=new Map,this.empty=this.admit({})}return e.prototype.isKnown=function(t){return Z(t)&&this.known.has(t)},e.prototype.pass=function(t){if(Z(t)){var r=sm(t);return this.passes.set(r,t),r}return t},e.prototype.admit=function(t){var r=this;if(Z(t)){var n=this.passes.get(t);if(n)return n;var i=Object.getPrototypeOf(t);switch(i){case Array.prototype:{if(this.known.has(t))return t;var a=t.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(t))return t;var s=Object.getPrototypeOf(t),u=[s],c=this.sortedKeys(t);u.push(c.json);var l=u.length;c.sorted.forEach(function(f){u.push(r.admit(t[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 t},e.prototype.sortedKeys=function(t){var r=Object.keys(t),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},e}();var at=Object.assign(function(e){if(Z(e)){Ws===void 0&&jl();var t=Ws.admit(e),r=Hs.get(t);return r===void 0&&Hs.set(t,r=JSON.stringify(t)),r}return JSON.stringify(e)},{reset:jl}),Ws,Hs;function jl(){Ws=new Ua,Hs=new(dt?WeakMap:Map)}function Ul(e){return[e.selectionSet,e.objectOrReference,e.context,e.context.canonizeResults]}var ql=function(){function e(t){var r=this;this.knownResults=new(dt?WeakMap:Map),this.config=sr(t,{addTypename:t.addTypename!==!1,canonizeResults:Ma(t)}),this.canon=t.canon||new Ua,this.executeSelectionSet=jr(function(n){var i,a=n.context.canonizeResults,o=Ul(n);o[3]=!a;var s=(i=r.executeSelectionSet).peek.apply(i,o);return s?a?_(_({},s),{result:r.canon.admit(s.result)}):s:(Ks(n.context.store,n.enclosingRef.__ref),r.execSelectionSetImpl(n))},{max:this.config.resultCacheMaxSize,keyArgs:Ul,makeCacheKey:function(n,i,a,o){if(Ur(a.store))return a.store.makeCacheKey(n,K(i)?i.__ref:i,a.varString,o)}}),this.executeSubSelectedArray=jr(function(n){return Ks(n.context.store,n.enclosingRef.__ref),r.execSubSelectedArrayImpl(n)},{max:this.config.resultCacheMaxSize,makeCacheKey:function(n){var i=n.field,a=n.array,o=n.context;if(Ur(o.store))return o.store.makeCacheKey(i,a,o.varString)}})}return e.prototype.resetCanon=function(){this.canon=new Ua},e.prototype.diffQueryAgainstStore=function(t){var r=t.store,n=t.query,i=t.rootId,a=i===void 0?"ROOT_QUERY":i,o=t.variables,s=t.returnPartialData,u=s===void 0?!0:s,c=t.canonizeResults,l=c===void 0?this.config.canonizeResults:c,d=this.config.cache.policies;o=_(_({},Fr(li(n))),o);var p=Ct(a),f=this.executeSelectionSet({selectionSet:Lr(n).selectionSet,objectOrReference:p,enclosingRef:p,context:_({store:r,query:n,policies:d,variables:o,varString:at(o),canonizeResults:l},$a(n,this.config.fragments))}),h;if(f.missing&&(h=[new _i(cm(f.missing),f.missing,n,o)],!u))throw h[0];return{result:f.result,complete:!h,missing:h}},e.prototype.isFresh=function(t,r,n,i){if(Ur(i.store)&&this.knownResults.get(t)===n){var a=this.executeSelectionSet.peek(n,r,i,this.canon.isKnown(t));if(a&&t===a.result)return!0}return!1},e.prototype.execSelectionSetImpl=function(t){var r=this,n=t.selectionSet,i=t.objectOrReference,a=t.enclosingRef,o=t.context;if(K(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 Ye;this.config.addTypename&&typeof l=="string"&&!u.rootIdsByTypename[l]&&d.push({__typename:l});function h(v,m){var O;return v.missing&&(p=f.merge(p,(O={},O[m]=v.missing,O))),v.result}var g=new Set(n.selections);g.forEach(function(v){var m,O;if(!!Qt(v,s))if(it(v)){var N=u.readField({fieldName:v.name.value,field:v,variables:o.variables,from:i},o),T=pt(v);N===void 0?Mr.added(v)||(p=f.merge(p,(m={},m[T]="Can't find field '".concat(v.name.value,"' on ").concat(K(i)?i.__ref+" object":"object "+JSON.stringify(i,null,2)),m))):ae(N)?N=h(r.executeSubSelectedArray({field:v,array:N,enclosingRef:a,context:o}),T):v.selectionSet?N!=null&&(N=h(r.executeSelectionSet({selectionSet:v.selectionSet,objectOrReference:N,enclosingRef:K(N)?N:a,context:o}),T)):o.canonizeResults&&(N=r.canon.pass(N)),N!==void 0&&d.push((O={},O[T]=N,O))}else{var D=Rr(v,o.lookupFragment);if(!D&&v.kind===xe.FRAGMENT_SPREAD)throw __DEV__?new q("No fragment named ".concat(v.name.value)):new q(5);D&&u.fragmentMatches(D,l)&&D.selectionSet.selections.forEach(g.add,g)}});var y=fi(d),S={result:y,missing:p},b=o.canonizeResults?this.canon.admit(S):di(S);return b.result&&this.knownResults.set(b.result,n),b},e.prototype.execSubSelectedArrayImpl=function(t){var r=this,n=t.field,i=t.array,a=t.enclosingRef,o=t.context,s,u=new Ye;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:ae(l)?c(r.executeSubSelectedArray({field:n,array:l,enclosingRef:a,context:o}),d):n.selectionSet?c(r.executeSelectionSet({selectionSet:n.selectionSet,objectOrReference:l,enclosingRef:K(l)?l:a,context:o}),d):(__DEV__&&um(o.store,n,l),l)}),{result:o.canonizeResults?this.canon.admit(i):i,missing:s}},e}();function cm(e){try{JSON.stringify(e,function(t,r){if(typeof r=="string")throw r;return r})}catch(t){return t}}function um(e,t,r){if(!t.selectionSet){var n=new Set([r]);n.forEach(function(i){Z(i)&&(__DEV__?A(!K(i),"Missing selection set for object of type ".concat(Ll(e,i)," returned for query field ").concat(t.name.value)):A(!K(i),6),Object.values(i).forEach(n.add,n))})}}var Dn=new kn,Bl=new WeakMap;function Si(e){var t=Bl.get(e);return t||Bl.set(e,t={vars:new Set,dep:Pa()}),t}function Js(e){Si(e).vars.forEach(function(t){return t.forgetCache(e)})}function Vl(e){Si(e).vars.forEach(function(t){return t.attachCache(e)})}function qa(e){var t=new Set,r=new Set,n=function(a){if(arguments.length>0){if(e!==a){e=a,t.forEach(function(u){Si(u).dep.dirty(n),lm(u)});var o=Array.from(r);r.clear(),o.forEach(function(u){return u(e)})}}else{var s=Dn.getValue();s&&(i(s),Si(s).dep(n))}return e};n.onNextChange=function(a){return r.add(a),function(){r.delete(a)}};var i=n.attachCache=function(a){return t.add(a),Si(a).vars.add(n),n};return n.forgetCache=function(a){return t.delete(a)},n}function lm(e){e.broadcastWatches&&e.broadcastWatches()}var Ql=Object.create(null);function Ys(e){var t=JSON.stringify(e);return Ql[t]||(Ql[t]=Object.create(null))}function Zs(e){var t=Ys(e);return t.keyFieldsFn||(t.keyFieldsFn=function(r,n){var i=function(o,s){return n.readField(s,o)},a=n.keyObject=ec(e,function(o){var s=Nn(n.storeObject,o,i);return s===void 0&&r!==n.storeObject&&_e.call(r,o[0])&&(s=Nn(r,o,Gl)),__DEV__?A(s!==void 0,"Missing field '".concat(o.join("."),"' while extracting keyFields from ").concat(JSON.stringify(r))):A(s!==void 0,2),s});return"".concat(n.typename,":").concat(JSON.stringify(a))})}function Xs(e){var t=Ys(e);return t.keyArgsFn||(t.keyArgsFn=function(r,n){var i=n.field,a=n.variables,o=n.fieldName,s=ec(e,function(c){var l=c[0],d=l.charAt(0);if(d==="@"){if(i&&ke(i.directives)){var p=l.slice(1),f=i.directives.find(function(S){return S.name.value===p}),h=f&&zt(f,a);return h&&Nn(h,c.slice(1))}return}if(d==="$"){var g=l.slice(1);if(a&&_e.call(a,g)){var y=c.slice(0);return y[0]=g,Nn(a,y)}return}if(r)return Nn(r,c)}),u=JSON.stringify(s);return(r||u!=="{}")&&(o+=":"+u),o})}function ec(e,t){var r=new Ye;return zl(e).reduce(function(n,i){var a,o=t(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 zl(e){var t=Ys(e);if(!t.paths){var r=t.paths=[],n=[];e.forEach(function(i,a){ae(i)?(zl(i).forEach(function(o){return r.push(n.concat(o))}),n.length=0):(n.push(i),ae(e[a+1])||(r.push(n.slice(0)),n.length=0))})}return t.paths}function Gl(e,t){return e[t]}function Nn(e,t,r){return r=r||Gl,Kl(t.reduce(function n(i,a){return ae(i)?i.map(function(o){return n(o,a)}):i&&r(i,a)},e))}function Kl(e){return Z(e)?ae(e)?e.map(Kl):ec(Object.keys(e).sort(),function(t){return Nn(e,t)}):e}ci.setStringify(at);function tc(e){return e.args!==void 0?e.args:e.field?zt(e.field,e.variables):null}var fm=function(){},Wl=function(e,t){return t.fieldName},Hl=function(e,t,r){var n=r.mergeObjects;return n(e,t)},Jl=function(e,t){return t},Zl=function(){function e(t){this.config=t,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=_({dataIdFromObject:Fa},t),this.cache=this.config.cache,this.setRootTypename("Query"),this.setRootTypename("Mutation"),this.setRootTypename("Subscription"),t.possibleTypes&&this.addPossibleTypes(t.possibleTypes),t.typePolicies&&this.addTypePolicies(t.typePolicies)}return e.prototype.identify=function(t,r){var n,i=this,a=r&&(r.typename||((n=r.storeObject)===null||n===void 0?void 0:n.__typename))||t.__typename;if(a===this.rootTypenamesById.ROOT_QUERY)return["ROOT_QUERY"];for(var o=r&&r.storeObject||t,s=_(_({},r),{typename:a,storeObject:o,readField:r&&r.readField||function(){var p=Ba(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(t,s);if(ae(d))l=Zs(d);else{u=d;break}}return u=u?String(u):void 0,s.keyObject?[u,s.keyObject]:[u]},e.prototype.addTypePolicies=function(t){var r=this;Object.keys(t).forEach(function(n){var i=t[n],a=i.queryType,o=i.mutationType,s=i.subscriptionType,u=Nt(i,["queryType","mutationType","subscriptionType"]);a&&r.setRootTypename("Query",n),o&&r.setRootTypename("Mutation",n),s&&r.setRootTypename("Subscription",n),_e.call(r.toBeAdded,n)?r.toBeAdded[n].push(u):r.toBeAdded[n]=[u]})},e.prototype.updateTypePolicy=function(t,r){var n=this,i=this.getTypePolicy(t),a=r.keyFields,o=r.fields;function s(u,c){u.merge=typeof c=="function"?c:c===!0?Hl:c===!1?Jl:u.merge}s(i,r.merge),i.keyFn=a===!1?fm:ae(a)?Zs(a):typeof a=="function"?a:i.keyFn,o&&Object.keys(o).forEach(function(u){var c=n.getFieldPolicy(t,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?Wl:ae(d)?Xs(d):typeof d=="function"?d:c.keyFn,typeof p=="function"&&(c.read=p),s(c,f)}c.read&&c.merge&&(c.keyFn=c.keyFn||Wl)})},e.prototype.setRootTypename=function(t,r){r===void 0&&(r=t);var n="ROOT_"+t.toUpperCase(),i=this.rootTypenamesById[n];r!==i&&(__DEV__?A(!i||i===t,"Cannot change root ".concat(t," __typename more than once")):A(!i||i===t,3),i&&delete this.rootIdsByTypename[i],this.rootIdsByTypename[r]=n,this.rootTypenamesById[n]=r)},e.prototype.addPossibleTypes=function(t){var r=this;this.usingPossibleTypes=!0,Object.keys(t).forEach(function(n){r.getSupertypeSet(n,!0),t[n].forEach(function(i){r.getSupertypeSet(i,!0).add(n);var a=i.match(Qs);(!a||a[0]!==i)&&r.fuzzySubtypes.set(i,new RegExp(i))})})},e.prototype.getTypePolicy=function(t){var r=this;if(!_e.call(this.typePolicies,t)){var n=this.typePolicies[t]=Object.create(null);n.fields=Object.create(null);var i=this.supertypeMap.get(t);i&&i.size&&i.forEach(function(o){var s=r.getTypePolicy(o),u=s.fields,c=Nt(s,["fields"]);Object.assign(n,c),Object.assign(n.fields,u)})}var a=this.toBeAdded[t];return a&&a.length&&a.splice(0).forEach(function(o){r.updateTypePolicy(t,o)}),this.typePolicies[t]},e.prototype.getFieldPolicy=function(t,r,n){if(t){var i=this.getTypePolicy(t).fields;return i[r]||n&&(i[r]=Object.create(null))}},e.prototype.getSupertypeSet=function(t,r){var n=this.supertypeMap.get(t);return!n&&r&&this.supertypeMap.set(t,n=new Set),n},e.prototype.fragmentMatches=function(t,r,n,i){var a=this;if(!t.typeCondition)return!0;if(!r)return!1;var o=t.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 g=a.getSupertypeSet(h,!1);g&&g.size&&u.indexOf(g)<0&&u.push(g)},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__&&A.warn("Inferring subtype ".concat(r," of supertype ").concat(o)),s.add(o)),!0;f.forEach(c),l&&p===u.length-1&&La(t.selectionSet,n,i)&&(l=!1,d=!0,this.fuzzySubtypes.forEach(function(h,g){var y=r.match(h);y&&y[0]===r&&c(g)}))}return!1},e.prototype.hasKeyArgs=function(t,r){var n=this.getFieldPolicy(t,r,!1);return!!(n&&n.keyFn)},e.prototype.getStoreFieldName=function(t){var r=t.typename,n=t.fieldName,i=this.getFieldPolicy(r,n,!1),a,o=i&&i.keyFn;if(o&&r)for(var s={typename:r,fieldName:n,field:t.field||null,variables:t.variables},u=tc(t);o;){var c=o(u,s);if(ae(c))o=Xs(c);else{a=c||n;break}}return a===void 0&&(a=t.field?fs(t.field,t.variables):ci(n,tc(t))),a===!1?n:n===Et(a)?a:n+":"+a},e.prototype.readField=function(t,r){var n=t.from;if(!!n){var i=t.field||t.fieldName;if(!!i){if(t.typename===void 0){var a=r.store.getFieldValue(n,"__typename");a&&(t.typename=a)}var o=this.getStoreFieldName(t),s=Et(o),u=r.store.getFieldValue(n,o),c=this.getFieldPolicy(t.typename,s,!1),l=c&&c.read;if(l){var d=Yl(this,n,t,r,r.store.getStorage(K(n)?n.__ref:n,o));return Dn.withValue(this.cache,l,[u,d])}return u}}},e.prototype.getReadFunction=function(t,r){var n=this.getFieldPolicy(t,r,!1);return n&&n.read},e.prototype.getMergeFunction=function(t,r,n){var i=this.getFieldPolicy(t,r,!1),a=i&&i.merge;return!a&&n&&(i=this.getTypePolicy(n),a=i&&i.merge),a},e.prototype.runMergeFunction=function(t,r,n,i,a){var o=n.field,s=n.typename,u=n.merge;return u===Hl?Xl(i.store)(t,r):u===Jl?r:(i.overwrite&&(t=void 0),u(t,r,Yl(this,void 0,{typename:s,fieldName:o.name.value,field:o,variables:i.variables},i,a||Object.create(null))))},e}();function Yl(e,t,r,n,i){var a=e.getStoreFieldName(r),o=Et(a),s=r.variables||n.variables,u=n.store,c=u.toReference,l=u.canRead;return{args:tc(r),field:r.field||null,fieldName:o,storeFieldName:a,variables:s,isReference:K,toReference:c,storage:i,cache:e.cache,canRead:l,readField:function(){return e.readField(Ba(arguments,t,s),n)},mergeObjects:Xl(n.store)}}function Ba(e,t,r){var n=e[0],i=e[1],a=e.length,o;return typeof n=="string"?o={fieldName:n,from:a>1?i:t}:(o=_({},n),_e.call(o,"from")||(o.from=t)),__DEV__&&o.from===void 0&&__DEV__&&A.warn("Undefined 'from' passed to readField with arguments ".concat(Gu(Array.from(e)))),o.variables===void 0&&(o.variables=r),o}function Xl(e){return function(r,n){if(ae(r)||ae(n))throw __DEV__?new q("Cannot automatically merge arrays"):new q(4);if(Z(r)&&Z(n)){var i=e.getFieldValue(r,"__typename"),a=e.getFieldValue(n,"__typename"),o=i&&a&&i!==a;if(o)return n;if(K(r)&&ur(n))return e.merge(r.__ref,n),r;if(ur(r)&&K(n))return e.merge(r,n.__ref),n;if(ur(r)&&ur(n))return _(_({},r),n)}return n}}function rc(e,t,r){var n="".concat(t).concat(r),i=e.flavors.get(n);return i||e.flavors.set(n,i=e.clientOnly===t&&e.deferred===r?e:_(_({},e),{clientOnly:t,deferred:r})),i}var nf=function(){function e(t,r,n){this.cache=t,this.reader=r,this.fragments=n}return e.prototype.writeToStore=function(t,r){var n=this,i=r.query,a=r.result,o=r.dataId,s=r.variables,u=r.overwrite,c=Rt(i),l=Fl();s=_(_({},Fr(c)),s);var d=_(_({store:t,written:Object.create(null),merge:function(f,h){return l.merge(f,h)},variables:s,varString:at(s)},$a(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(!K(p))throw __DEV__?new q("Could not identify object ".concat(JSON.stringify(a))):new q(7);return d.incomingById.forEach(function(f,h){var g=f.storeObject,y=f.mergeTree,S=f.fieldNodeSet,b=Ct(h);if(y&&y.map.size){var v=n.applyMerges(y,b,g,d);if(K(v))return;g=v}if(__DEV__&&!d.overwrite){var m=Object.create(null);S.forEach(function(T){T.selectionSet&&(m[T.name.value]=!0)});var O=function(T){return m[Et(T)]===!0},N=function(T){var D=y&&y.map.get(T);return Boolean(D&&D.info&&D.info.merge)};Object.keys(g).forEach(function(T){O(T)&&!N(T)&&pm(b,g,T,d.store)})}t.merge(h,g)}),t.retain(p.__ref),p},e.prototype.processSelectionSet=function(t){var r=this,n=t.dataId,i=t.result,a=t.selectionSet,o=t.context,s=t.mergeTree,u=this.cache.policies,c=Object.create(null),l=n&&u.rootTypenamesById[n]||ui(i,a,o.fragmentMap)||n&&o.store.get(n,"__typename");typeof l=="string"&&(c.__typename=l);var d=function(){var v=Ba(arguments,c,o.variables);if(K(v.from)){var m=o.incomingById.get(v.from.__ref);if(m){var O=u.readField(_(_({},v),{from:m.storeObject}),o);if(O!==void 0)return O}}return u.readField(v,o)},p=new Set;this.flattenFields(a,i,o,l).forEach(function(v,m){var O,N=pt(m),T=i[N];if(p.add(m),T!==void 0){var D=u.getStoreFieldName({typename:l,fieldName:m.name.value,field:m,variables:v.variables}),R=ef(s,D),C=r.processFieldValue(T,m,m.selectionSet?rc(v,!1,!1):v,R),j=void 0;m.selectionSet&&(K(C)||ur(C))&&(j=d("__typename",C));var Pe=u.getMergeFunction(l,m.name.value,j);Pe?R.info={field:m,typename:l,merge:Pe}:tf(s,D),c=v.merge(c,(O={},O[D]=C,O))}else __DEV__&&!v.clientOnly&&!v.deferred&&!Mr.added(m)&&!u.getReadFunction(l,m.name.value)&&__DEV__&&A.error("Missing field '".concat(pt(m),"' 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],g=f[1];n=n||h,g&&(c=o.merge(c,g))}catch(v){if(!n)throw v}if(typeof n=="string"){var y=Ct(n),S=o.written[n]||(o.written[n]=[]);if(S.indexOf(a)>=0||(S.push(a),this.reader&&this.reader.isFresh(i,y,a,o)))return y;var b=o.incomingById.get(n);return b?(b.storeObject=o.merge(b.storeObject,c),b.mergeTree=nc(b.mergeTree,s),p.forEach(function(v){return b.fieldNodeSet.add(v)})):o.incomingById.set(n,{storeObject:c,mergeTree:Va(s)?void 0:s,fieldNodeSet:p}),y}return c},e.prototype.processFieldValue=function(t,r,n,i){var a=this;return!r.selectionSet||t===null?__DEV__?Ea(t):t:ae(t)?t.map(function(o,s){var u=a.processFieldValue(o,r,n,ef(i,s));return tf(i,s),u}):this.processSelectionSet({result:t,selectionSet:r.selectionSet,context:n,mergeTree:i})},e.prototype.flattenFields=function(t,r,n,i){i===void 0&&(i=ui(r,t,n.fragmentMap));var a=new Map,o=this.cache.policies,s=new Pt(!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(!!Qt(p,n.variables)){var f=l.clientOnly,h=l.deferred;if(!(f&&h)&&ke(p.directives)&&p.directives.forEach(function(S){var b=S.name.value;if(b==="client"&&(f=!0),b==="defer"){var v=zt(S,n.variables);(!v||v.if!==!1)&&(h=!0)}}),it(p)){var g=a.get(p);g&&(f=f&&g.clientOnly,h=h&&g.deferred),a.set(p,rc(n,f,h))}else{var y=Rr(p,n.lookupFragment);if(!y&&p.kind===xe.FRAGMENT_SPREAD)throw __DEV__?new q("No fragment named ".concat(p.name.value)):new q(8);y&&o.fragmentMatches(y,i,r,n.variables)&&u(y.selectionSet,rc(n,f,h))}}}))}(t,n),a},e.prototype.applyMerges=function(t,r,n,i,a){var o,s=this;if(t.map.size&&!K(n)){var u=!ae(n)&&(K(r)||ur(r))?r:void 0,c=n;u&&!a&&(a=[K(u)?u.__ref:u]);var l,d=function(p,f){return ae(p)?typeof f=="number"?p[f]:void 0:i.store.getFieldValue(p,String(f))};t.map.forEach(function(p,f){var h=d(u,f),g=d(c,f);if(g!==void 0){a&&a.push(f);var y=s.applyMerges(p,h,g,i,a);y!==g&&(l=l||new Map,l.set(f,y)),a&&A(a.pop()===f)}}),l&&(n=ae(c)?c.slice(0):_({},c),l.forEach(function(p,f){n[f]=p}))}return t.info?this.cache.policies.runMergeFunction(r,n,t.info,i,a&&(o=i.store).getStorage.apply(o,a)):n},e}();var af=[];function ef(e,t){var r=e.map;return r.has(t)||r.set(t,af.pop()||{map:new Map}),r.get(t)}function nc(e,t){if(e===t||!t||Va(t))return e;if(!e||Va(e))return t;var r=e.info&&t.info?_(_({},e.info),t.info):e.info||t.info,n=e.map.size&&t.map.size,i=n?new Map:e.map.size?e.map:t.map,a={info:r,map:i};if(n){var o=new Set(t.map.keys());e.map.forEach(function(s,u){a.map.set(u,nc(s,t.map.get(u))),o.delete(u)}),o.forEach(function(s){a.map.set(s,nc(t.map.get(s),e.map.get(s)))})}return a}function Va(e){return!e||!(e.info||e.map.size)}function tf(e,t){var r=e.map,n=r.get(t);n&&Va(n)&&(af.push(n),r.delete(t))}var rf=new Set;function pm(e,t,r,n){var i=function(d){var p=n.getFieldValue(d,r);return typeof p=="object"&&p},a=i(e);if(!!a){var o=i(t);if(!!o&&!K(a)&&!de(a,o)&&!Object.keys(a).every(function(d){return n.getFieldValue(o,d)!==void 0})){var s=n.getFieldValue(e,"__typename")||n.getFieldValue(t,"__typename"),u=Et(r),c="".concat(s,".").concat(u);if(!rf.has(c)){rf.add(c);var l=[];!ae(a)&&!ae(o)&&[a,o].forEach(function(d){var p=n.getFieldValue(d,"__typename");typeof p=="string"&&!l.includes(p)&&l.push(p)}),__DEV__&&A.warn("Cache data may be lost when replacing the ".concat(u," field of a ").concat(s,` object.
|
|
36
|
+
`):new q(23)};var ll=function(){if(typeof AbortController>"u")return{controller:!1,signal:!1};var e=new AbortController,t=e.signal;return{controller:e,signal:t}};var fl=function(e,t){var r=e.getContext(),n=r.uri;return n||(typeof t=="function"?t(e):t||"/graphql")};function pl(e,t){var r=[],n=function(d,p){r.push("".concat(d,"=").concat(encodeURIComponent(p)))};if("query"in t&&n("query",t.query),t.operationName&&n("operationName",t.operationName),t.variables){var i=void 0;try{i=vi(t.variables,"Variables map")}catch(d){return{parseError:d}}n("variables",i)}if(t.extensions){var a=void 0;try{a=vi(t.extensions,"Extensions map")}catch(d){return{parseError:d}}n("extensions",a)}var o="",s=e,u=e.indexOf("#");u!==-1&&(o=e.substr(u),s=e.substr(0,u));var c=s.indexOf("?")===-1?"?":"&",l=s+c+r.join("&")+o;return{newURI:l}}var dl=Re(function(){return fetch}),hl=function(e){e===void 0&&(e={});var t=e.uri,r=t===void 0?"/graphql":t,n=e.fetch,i=e.print,a=i===void 0?sl:i,o=e.includeExtensions,s=e.preserveHeaderCase,u=e.useGETForQueries,c=e.includeUnusedVariables,l=c===void 0?!1:c,d=Nt(e,["uri","fetch","print","includeExtensions","preserveHeaderCase","useGETForQueries","includeUnusedVariables"]);__DEV__&&ul(n||dl);var p={http:{includeExtensions:o,preserveHeaderCase:s},options:d.fetchOptions,credentials:d.credentials,headers:d.headers};return new ht(function(f){var h=fl(f,r),g=f.getContext(),y={};if(g.clientAwareness){var S=g.clientAwareness,b=S.name,v=S.version;b&&(y["apollographql-client-name"]=b),v&&(y["apollographql-client-version"]=v)}var m=_(_({},y),g.headers),O={http:g.http,options:g.fetchOptions,credentials:g.credentials,headers:m},N=cl(f,a,ol,p,O),T=N.options,D=N.body;if(D.variables&&!l){var C=new Set(Object.keys(D.variables));Be(f.query,{Variable:function(Y,At,z){z&&z.kind!=="VariableDefinition"&&C.delete(Y.name.value)}}),C.size&&(D.variables=_({},D.variables),C.forEach(function(Y){delete D.variables[Y]}))}var R;if(!T.signal){var j=ll(),Pe=j.controller,Ie=j.signal;R=Pe,R&&(T.signal=Ie)}var U=function(Y){return Y.kind==="OperationDefinition"&&Y.operation==="mutation"};if(u&&!f.query.definitions.some(U)&&(T.method="GET"),bn(["defer"],f.query)&&(T.headers=T.headers||{},T.headers.accept="multipart/mixed; deferSpec=20220824, application/json"),T.method==="GET"){var ce=pl(h,D),ue=ce.newURI,J=ce.parseError;if(J)return Oa(J);h=ue}else try{T.body=vi(D,"Payload")}catch(Y){return Oa(Y)}return new G(function(Y){var At=n||Re(function(){return fetch})||dl;return At(h,T).then(function(z){var Dt;f.setContext({response:z});var tr=(Dt=z.headers)===null||Dt===void 0?void 0:Dt.get("content-type");return tr!==null&&/^multipart\/mixed/i.test(tr)?nl(z,Y):al(z,f,Y)}).catch(function(z){return Na(z,Y)}),function(){R&&R.abort()}})})};var Ls=function(e){be(t,e);function t(r){r===void 0&&(r={});var n=e.call(this,hl(r).request)||this;return n.options=r,n}return t}(ht);var{toString:ml,hasOwnProperty:Ph}=Object.prototype,gl=Function.prototype.toString,Fs=new Map;function de(e,t){try{return Ms(e,t)}finally{Fs.clear()}}function Ms(e,t){if(e===t)return!0;let r=ml.call(e),n=ml.call(t);if(r!==n)return!1;switch(r){case"[object Array]":if(e.length!==t.length)return!1;case"[object Object]":{if(vl(e,t))return!0;let i=yl(e),a=yl(t),o=i.length;if(o!==a.length)return!1;for(let s=0;s<o;++s)if(!Ph.call(t,i[s]))return!1;for(let s=0;s<o;++s){let u=i[s];if(!Ms(e[u],t[u]))return!1}return!0}case"[object Error]":return e.name===t.name&&e.message===t.message;case"[object Number]":if(e!==e)return t!==t;case"[object Boolean]":case"[object Date]":return+e==+t;case"[object RegExp]":case"[object String]":return e==`${t}`;case"[object Map]":case"[object Set]":{if(e.size!==t.size)return!1;if(vl(e,t))return!0;let i=e.entries(),a=r==="[object Map]";for(;;){let o=i.next();if(o.done)break;let[s,u]=o.value;if(!t.has(s)||a&&!Ms(u,t.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]":e=new Uint8Array(e),t=new Uint8Array(t);case"[object DataView]":{let i=e.byteLength;if(i===t.byteLength)for(;i--&&e[i]===t[i];);return i===-1}case"[object AsyncFunction]":case"[object GeneratorFunction]":case"[object AsyncGeneratorFunction]":case"[object Function]":{let i=gl.call(e);return i!==gl.call(t)?!1:!Mh(i,Fh)}}return!1}function yl(e){return Object.keys(e).filter(Lh,e)}function Lh(e){return this[e]!==void 0}var Fh="{ [native code] }";function Mh(e,t){let r=e.length-t.length;return r>=0&&e.indexOf(t,r)===r}function vl(e,t){let r=Fs.get(e);if(r){if(r.has(t))return!0}else Fs.set(e,r=new Set);return r.add(t),!1}var $h=function(){return Object.create(null)},bl=Array.prototype,jh=bl.forEach,Uh=bl.slice,Pt=function(){function e(t,r){t===void 0&&(t=!0),r===void 0&&(r=$h),this.weakness=t,this.makeData=r}return e.prototype.lookup=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return this.lookupArray(t)},e.prototype.lookupArray=function(t){var r=this;return jh.call(t,function(n){return r=r.getChildTrie(n)}),r.data||(r.data=this.makeData(Uh.call(t)))},e.prototype.getChildTrie=function(t){var r=this.weakness&&qh(t)?this.weak||(this.weak=new WeakMap):this.strong||(this.strong=new Map),n=r.get(t);return n||r.set(t,n=new e(this.weakness,this.makeData)),n},e}();function qh(e){switch(typeof e){case"object":if(e===null)break;case"function":return!0}return!1}var Me=null,_l={},Bh=1,Vh=()=>class{constructor(){this.id=["slot",Bh++,Date.now(),Math.random().toString(36).slice(2)].join(":")}hasValue(){for(let t=Me;t;t=t.parent)if(this.id in t.slots){let r=t.slots[this.id];if(r===_l)break;return t!==Me&&(Me.slots[this.id]=r),!0}return Me&&(Me.slots[this.id]=_l),!1}getValue(){if(this.hasValue())return Me.slots[this.id]}withValue(t,r,n,i){let a={__proto__:null,[this.id]:t},o=Me;Me={parent:o,slots:a};try{return r.apply(i,n)}finally{Me=o}}static bind(t){let r=Me;return function(){let n=Me;try{return Me=r,t.apply(this,arguments)}finally{Me=n}}}static noContext(t,r,n){if(Me){let i=Me;try{return Me=null,t.apply(n,r)}finally{Me=i}}else return t.apply(n,r)}};function wl(e){try{return e()}catch{}}var $s="@wry/context:Slot",Qh=wl(()=>globalThis)||wl(()=>global)||Object.create(null),Sl=Qh,kn=Sl[$s]||Array[$s]||function(e){try{Object.defineProperty(Sl,$s,{value:e,enumerable:!1,writable:!1,configurable:!0})}finally{return e}}(Vh());var{bind:zh,noContext:Gh}=kn;function Kh(){}var Wh=function(){function e(t,r){t===void 0&&(t=1/0),r===void 0&&(r=Kh),this.max=t,this.dispose=r,this.map=new Map,this.newest=null,this.oldest=null}return e.prototype.has=function(t){return this.map.has(t)},e.prototype.get=function(t){var r=this.getNode(t);return r&&r.value},e.prototype.getNode=function(t){var r=this.map.get(t);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},e.prototype.set=function(t,r){var n=this.getNode(t);return n?n.value=r:(n={key:t,value:r,newer:null,older:this.newest},this.newest&&(this.newest.newer=n),this.newest=n,this.oldest=this.oldest||n,this.map.set(t,n),n.value)},e.prototype.clean=function(){for(;this.oldest&&this.map.size>this.max;)this.delete(this.oldest.key)},e.prototype.delete=function(t){var r=this.map.get(t);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(t),this.dispose(r.value,t),!0):!1},e}(),Ca=new kn,js,Hh=Object.prototype.hasOwnProperty,qs=(js=Array.from,js===void 0?function(e){var t=[];return e.forEach(function(r){return t.push(r)}),t}:js);function Ra(e){var t=e.unsubscribe;typeof t=="function"&&(e.unsubscribe=void 0,t())}var bi=[],Jh=100;function On(e,t){if(!e)throw new Error(t||"assertion failure")}function Yh(e,t){var r=e.length;return r>0&&r===t.length&&e[r-1]===t[r-1]}function xl(e){switch(e.length){case 0:throw new Error("unknown value");case 1:return e[0];case 2:throw e[1]}}function Zh(e){return e.slice(0)}var Xh=function(){function e(t){this.fn=t,this.parents=new Set,this.childValues=new Map,this.dirtyChildren=null,this.dirty=!0,this.recomputing=!1,this.value=[],this.deps=null,++e.count}return e.prototype.peek=function(){if(this.value.length===1&&!cr(this))return El(this),this.value[0]},e.prototype.recompute=function(t){return On(!this.recomputing,"already recomputing"),El(this),cr(this)?em(this,t):xl(this.value)},e.prototype.setDirty=function(){this.dirty||(this.dirty=!0,this.value.length=0,Tl(this),Ra(this))},e.prototype.dispose=function(){var t=this;this.setDirty(),Dl(this),Bs(this,function(r,n){r.setDirty(),Nl(r,t)})},e.prototype.forget=function(){this.dispose()},e.prototype.dependOn=function(t){t.add(this),this.deps||(this.deps=bi.pop()||new Set),this.deps.add(t)},e.prototype.forgetDeps=function(){var t=this;this.deps&&(qs(this.deps).forEach(function(r){return r.delete(t)}),this.deps.clear(),bi.push(this.deps),this.deps=null)},e.count=0,e}();function El(e){var t=Ca.getValue();if(t)return e.parents.add(t),t.childValues.has(e)||t.childValues.set(e,[]),cr(e)?kl(t,e):Ol(t,e),t}function em(e,t){return Dl(e),Ca.withValue(e,tm,[e,t]),nm(e,t)&&rm(e),xl(e.value)}function tm(e,t){e.recomputing=!0,e.value.length=0;try{e.value[0]=e.fn.apply(null,t)}catch(r){e.value[1]=r}e.recomputing=!1}function cr(e){return e.dirty||!!(e.dirtyChildren&&e.dirtyChildren.size)}function rm(e){e.dirty=!1,!cr(e)&&Il(e)}function Tl(e){Bs(e,kl)}function Il(e){Bs(e,Ol)}function Bs(e,t){var r=e.parents.size;if(r)for(var n=qs(e.parents),i=0;i<r;++i)t(n[i],e)}function kl(e,t){On(e.childValues.has(t)),On(cr(t));var r=!cr(e);if(!e.dirtyChildren)e.dirtyChildren=bi.pop()||new Set;else if(e.dirtyChildren.has(t))return;e.dirtyChildren.add(t),r&&Tl(e)}function Ol(e,t){On(e.childValues.has(t)),On(!cr(t));var r=e.childValues.get(t);r.length===0?e.childValues.set(t,Zh(t.value)):Yh(r,t.value)||e.setDirty(),Al(e,t),!cr(e)&&Il(e)}function Al(e,t){var r=e.dirtyChildren;r&&(r.delete(t),r.size===0&&(bi.length<Jh&&bi.push(r),e.dirtyChildren=null))}function Dl(e){e.childValues.size>0&&e.childValues.forEach(function(t,r){Nl(e,r)}),e.forgetDeps(),On(e.dirtyChildren===null)}function Nl(e,t){t.parents.delete(e),e.childValues.delete(t),Al(e,t)}function nm(e,t){if(typeof e.subscribe=="function")try{Ra(e),e.unsubscribe=e.subscribe.apply(null,t)}catch{return e.setDirty(),!1}return!0}var im={setDirty:!0,dispose:!0,forget:!0};function Pa(e){var t=new Map,r=e&&e.subscribe;function n(i){var a=Ca.getValue();if(a){var o=t.get(i);o||t.set(i,o=new Set),a.dependOn(o),typeof r=="function"&&(Ra(o),o.unsubscribe=r(i))}}return n.dirty=function(a,o){var s=t.get(a);if(s){var u=o&&Hh.call(im,o)?o:"setDirty";qs(s).forEach(function(c){return c[u]()}),t.delete(a),Ra(s)}},n}function Rl(){var e=new Pt(typeof WeakMap=="function");return function(){return e.lookupArray(arguments)}}var wE=Rl(),Us=new Set;function jr(e,t){t===void 0&&(t=Object.create(null));var r=new Wh(t.max||Math.pow(2,16),function(c){return c.dispose()}),n=t.keyArgs,i=t.makeCacheKey||Rl(),a=function(){var c=i.apply(null,n?n.apply(null,arguments):arguments);if(c===void 0)return e.apply(null,arguments);var l=r.get(c);l||(r.set(c,l=new Xh(e)),l.subscribe=t.subscribe,l.forget=function(){return r.delete(c)});var d=l.recompute(Array.prototype.slice.call(arguments));return r.set(c,l),Us.add(r),Ca.hasValue()||(Us.forEach(function(p){return p.clean()}),Us.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 Vs=function(){function e(){this.getFragmentDoc=jr(us)}return e.prototype.batch=function(t){var r=this,n=typeof t.optimistic=="string"?t.optimistic:t.optimistic===!1?null:void 0,i;return this.performTransaction(function(){return i=t.update(r)},n),i},e.prototype.recordOptimisticTransaction=function(t,r){this.performTransaction(t,r)},e.prototype.transformDocument=function(t){return t},e.prototype.transformForLink=function(t){return t},e.prototype.identify=function(t){},e.prototype.gc=function(){return[]},e.prototype.modify=function(t){return!1},e.prototype.readQuery=function(t,r){return r===void 0&&(r=!!t.optimistic),this.read(_(_({},t),{rootId:t.id||"ROOT_QUERY",optimistic:r}))},e.prototype.readFragment=function(t,r){return r===void 0&&(r=!!t.optimistic),this.read(_(_({},t),{query:this.getFragmentDoc(t.fragment,t.fragmentName),rootId:t.id,optimistic:r}))},e.prototype.writeQuery=function(t){var r=t.id,n=t.data,i=Nt(t,["id","data"]);return this.write(Object.assign(i,{dataId:r||"ROOT_QUERY",result:n}))},e.prototype.writeFragment=function(t){var r=t.id,n=t.data,i=t.fragment,a=t.fragmentName,o=Nt(t,["id","data","fragment","fragmentName"]);return this.write(Object.assign(o,{query:this.getFragmentDoc(i,a),dataId:r,result:n}))},e.prototype.updateQuery=function(t,r){return this.batch({update:function(n){var i=n.readQuery(t),a=r(i);return a==null?i:(n.writeQuery(_(_({},t),{data:a})),a)}})},e.prototype.updateFragment=function(t,r){return this.batch({update:function(n){var i=n.readFragment(t),a=r(i);return a==null?i:(n.writeFragment(_(_({},t),{data:a})),a)}})},e}();var _i=function(e){be(t,e);function t(r,n,i,a){var o,s=e.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__=t.prototype,s}return t}(Error);var _e=Object.prototype.hasOwnProperty;function wi(e){return e==null}function Fa(e,t){var r=e.__typename,n=e.id,i=e._id;if(typeof r=="string"&&(t&&(t.keyObject=wi(n)?wi(i)?void 0:{_id:i}:{id:n}),wi(n)&&!wi(i)&&(n=i),!wi(n)))return"".concat(r,":").concat(typeof n=="number"||typeof n=="string"?n:JSON.stringify(n))}var Cl={dataIdFromObject:Fa,addTypename:!0,resultCaching:!0,canonizeResults:!1};function Pl(e){return sr(Cl,e)}function Ma(e){var t=e.canonizeResults;return t===void 0?Cl.canonizeResults:t}function Ll(e,t){return K(t)?e.get(t.__ref,"__typename"):t&&t.__typename}var Qs=/^[_a-z][_0-9a-z]*/i;function Et(e){var t=e.match(Qs);return t?t[0]:e}function La(e,t,r){return Z(t)?ae(t)?t.every(function(n){return La(e,n,r)}):e.selections.every(function(n){if(it(n)&&Qt(n,r)){var i=pt(n);return _e.call(t,i)&&(!n.selectionSet||La(n.selectionSet,t[i],r))}return!0}):!1}function ur(e){return Z(e)&&!K(e)&&!ae(e)}function Fl(){return new Ye}function $a(e,t){var r=Rr(Pr(e));return{fragmentMap:r,lookupFragment:function(n){var i=r[n];return!i&&t&&(i=t.lookup(n)),i||null}}}var ja=Object.create(null),zs=function(){return ja},Ml=Object.create(null),An=function(){function e(t,r){var n=this;this.policies=t,this.group=r,this.data=Object.create(null),this.rootIds=Object.create(null),this.refs=Object.create(null),this.getFieldValue=function(i,a){return di(K(i)?n.get(i.__ref,a):i&&i[a])},this.canRead=function(i){return K(i)?n.has(i.__ref):typeof i=="object"},this.toReference=function(i,a){if(typeof i=="string")return Rt(i);if(K(i))return i;var o=n.policies.identify(i)[0];if(o){var s=Rt(o);return a&&n.merge(o,i),s}}}return e.prototype.toObject=function(){return _({},this.data)},e.prototype.has=function(t){return this.lookup(t,!0)!==void 0},e.prototype.get=function(t,r){if(this.group.depend(t,r),_e.call(this.data,t)){var n=this.data[t];if(n&&_e.call(n,r))return n[r]}if(r==="__typename"&&_e.call(this.policies.rootTypenamesById,t))return this.policies.rootTypenamesById[t];if(this instanceof lr)return this.parent.get(t,r)},e.prototype.lookup=function(t,r){if(r&&this.group.depend(t,"__exists"),_e.call(this.data,t))return this.data[t];if(this instanceof lr)return this.parent.lookup(t,r);if(this.policies.rootTypenamesById[t])return Object.create(null)},e.prototype.merge=function(t,r){var n=this,i;K(t)&&(t=t.__ref),K(r)&&(r=r.__ref);var a=typeof t=="string"?this.lookup(i=t):t,o=typeof r=="string"?this.lookup(i=r):r;if(!!o){__DEV__?A(typeof i=="string","store.merge expects a string ID"):A(typeof i=="string",1);var s=new Ye(om).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=Et(c);l!==c&&!n.policies.hasKeyArgs(s.__typename,l)&&(u[l]=1),s[c]===void 0&&!(n instanceof lr)&&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)})}}},e.prototype.modify=function(t,r){var n=this,i=this.lookup(t);if(i){var a=Object.create(null),o=!1,s=!0,u={DELETE:ja,INVALIDATE:Ml,isReference:K,toReference:this.toReference,canRead:this.canRead,readField:function(c,l){return n.policies.readField(typeof c=="string"?{fieldName:c,from:l||Rt(t)}:c,{store:n})}};if(Object.keys(i).forEach(function(c){var l=Et(c),d=i[c];if(d!==void 0){var p=typeof r=="function"?r:r[c]||r[l];if(p){var f=p===zs?ja:p(di(d),_(_({},u),{fieldName:l,storeFieldName:c,storage:n.getStorage(t,c)}));f===Ml?n.group.dirty(t,c):(f===ja&&(f=void 0),f!==d&&(a[c]=f,o=!0,d=f))}d!==void 0&&(s=!1)}}),o)return this.merge(t,a),s&&(this instanceof lr?this.data[t]=void 0:delete this.data[t],this.group.dirty(t,"__exists")),!0}return!1},e.prototype.delete=function(t,r,n){var i,a=this.lookup(t);if(a){var o=this.getFieldValue(a,"__typename"),s=r&&n?this.policies.getStoreFieldName({typename:o,fieldName:r,args:n}):r;return this.modify(t,s?(i={},i[s]=zs,i):zs)}return!1},e.prototype.evict=function(t,r){var n=!1;return t.id&&(_e.call(this.data,t.id)&&(n=this.delete(t.id,t.fieldName,t.args)),this instanceof lr&&this!==r&&(n=this.parent.evict(t,r)||n),(t.fieldName||n)&&this.group.dirty(t.id,t.fieldName||"__exists")),n},e.prototype.clear=function(){this.replace(null)},e.prototype.extract=function(){var t=this,r=this.toObject(),n=[];return this.getRootIdSet().forEach(function(i){_e.call(t.policies.rootTypenamesById,i)||n.push(i)}),n.length&&(r.__META={extraRootIds:n.sort()}),r},e.prototype.replace=function(t){var r=this;if(Object.keys(this.data).forEach(function(a){t&&_e.call(t,a)||r.delete(a)}),t){var n=t.__META,i=Nt(t,["__META"]);Object.keys(i).forEach(function(a){r.merge(a,i[a])}),n&&n.extraRootIds.forEach(this.retain,this)}},e.prototype.retain=function(t){return this.rootIds[t]=(this.rootIds[t]||0)+1},e.prototype.release=function(t){if(this.rootIds[t]>0){var r=--this.rootIds[t];return r||delete this.rootIds[t],r}return 0},e.prototype.getRootIdSet=function(t){return t===void 0&&(t=new Set),Object.keys(this.rootIds).forEach(t.add,t),this instanceof lr?this.parent.getRootIdSet(t):Object.keys(this.policies.rootTypenamesById).forEach(t.add,t),t},e.prototype.gc=function(){var t=this,r=this.getRootIdSet(),n=this.toObject();r.forEach(function(o){_e.call(n,o)&&(Object.keys(t.findChildRefIds(o)).forEach(r.add,r),delete n[o])});var i=Object.keys(n);if(i.length){for(var a=this;a instanceof lr;)a=a.parent;i.forEach(function(o){return a.delete(o)})}return i},e.prototype.findChildRefIds=function(t){if(!_e.call(this.refs,t)){var r=this.refs[t]=Object.create(null),n=this.data[t];if(!n)return r;var i=new Set([n]);i.forEach(function(a){K(a)&&(r[a.__ref]=!0),Z(a)&&Object.keys(a).forEach(function(o){var s=a[o];Z(s)&&i.add(s)})})}return this.refs[t]},e.prototype.makeCacheKey=function(){return this.group.keyMaker.lookupArray(arguments)},e}();var $l=function(){function e(t,r){r===void 0&&(r=null),this.caching=t,this.parent=r,this.d=null,this.resetCaching()}return e.prototype.resetCaching=function(){this.d=this.caching?Pa():null,this.keyMaker=new Pt(dt)},e.prototype.depend=function(t,r){if(this.d){this.d(Gs(t,r));var n=Et(r);n!==r&&this.d(Gs(t,n)),this.parent&&this.parent.depend(t,r)}},e.prototype.dirty=function(t,r){this.d&&this.d.dirty(Gs(t,r),r==="__exists"?"forget":"setDirty")},e}();function Gs(e,t){return t+"#"+e}function Ks(e,t){Ur(e)&&e.group.depend(t,"__exists")}(function(e){var t=function(r){be(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 $l(s))||this;return c.stump=new am(c),c.storageTrie=new Pt(dt),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}(e);e.Root=t})(An||(An={}));var lr=function(e){be(t,e);function t(r,n,i,a){var o=e.call(this,n.policies,a)||this;return o.id=r,o.parent=n,o.replay=i,o.group=a,i(o),o}return t.prototype.addLayer=function(r,n){return new t(r,this,n,this.group)},t.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){de(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)},t.prototype.toObject=function(){return _(_({},this.parent.toObject()),this.data)},t.prototype.findChildRefIds=function(r){var n=this.parent.findChildRefIds(r);return _e.call(this.data,r)?_(_({},n),e.prototype.findChildRefIds.call(this,r)):n},t.prototype.getStorage=function(){for(var r=this.parent;r.parent;)r=r.parent;return r.getStorage.apply(r,arguments)},t}(An),am=function(e){be(t,e);function t(r){return e.call(this,"EntityStore.Stump",r,function(){},new $l(r.group.caching,r.group))||this}return t.prototype.removeLayer=function(){return this},t.prototype.merge=function(){return this.parent.merge.apply(this.parent,arguments)},t}(lr);function om(e,t,r){var n=e[r],i=t[r];return de(n,i)?n:i}function Ur(e){return!!(e instanceof An&&e.group.caching)}function sm(e){return Z(e)?ae(e)?e.slice(0):_({__proto__:Object.getPrototypeOf(e)},e):e}var Ua=function(){function e(){this.known=new(Bu?WeakSet:Set),this.pool=new Pt(dt),this.passes=new WeakMap,this.keysByJSON=new Map,this.empty=this.admit({})}return e.prototype.isKnown=function(t){return Z(t)&&this.known.has(t)},e.prototype.pass=function(t){if(Z(t)){var r=sm(t);return this.passes.set(r,t),r}return t},e.prototype.admit=function(t){var r=this;if(Z(t)){var n=this.passes.get(t);if(n)return n;var i=Object.getPrototypeOf(t);switch(i){case Array.prototype:{if(this.known.has(t))return t;var a=t.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(t))return t;var s=Object.getPrototypeOf(t),u=[s],c=this.sortedKeys(t);u.push(c.json);var l=u.length;c.sorted.forEach(function(f){u.push(r.admit(t[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 t},e.prototype.sortedKeys=function(t){var r=Object.keys(t),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},e}();var at=Object.assign(function(e){if(Z(e)){Ws===void 0&&jl();var t=Ws.admit(e),r=Hs.get(t);return r===void 0&&Hs.set(t,r=JSON.stringify(t)),r}return JSON.stringify(e)},{reset:jl}),Ws,Hs;function jl(){Ws=new Ua,Hs=new(dt?WeakMap:Map)}function Ul(e){return[e.selectionSet,e.objectOrReference,e.context,e.context.canonizeResults]}var ql=function(){function e(t){var r=this;this.knownResults=new(dt?WeakMap:Map),this.config=sr(t,{addTypename:t.addTypename!==!1,canonizeResults:Ma(t)}),this.canon=t.canon||new Ua,this.executeSelectionSet=jr(function(n){var i,a=n.context.canonizeResults,o=Ul(n);o[3]=!a;var s=(i=r.executeSelectionSet).peek.apply(i,o);return s?a?_(_({},s),{result:r.canon.admit(s.result)}):s:(Ks(n.context.store,n.enclosingRef.__ref),r.execSelectionSetImpl(n))},{max:this.config.resultCacheMaxSize,keyArgs:Ul,makeCacheKey:function(n,i,a,o){if(Ur(a.store))return a.store.makeCacheKey(n,K(i)?i.__ref:i,a.varString,o)}}),this.executeSubSelectedArray=jr(function(n){return Ks(n.context.store,n.enclosingRef.__ref),r.execSubSelectedArrayImpl(n)},{max:this.config.resultCacheMaxSize,makeCacheKey:function(n){var i=n.field,a=n.array,o=n.context;if(Ur(o.store))return o.store.makeCacheKey(i,a,o.varString)}})}return e.prototype.resetCanon=function(){this.canon=new Ua},e.prototype.diffQueryAgainstStore=function(t){var r=t.store,n=t.query,i=t.rootId,a=i===void 0?"ROOT_QUERY":i,o=t.variables,s=t.returnPartialData,u=s===void 0?!0:s,c=t.canonizeResults,l=c===void 0?this.config.canonizeResults:c,d=this.config.cache.policies;o=_(_({},Fr(li(n))),o);var p=Rt(a),f=this.executeSelectionSet({selectionSet:Lr(n).selectionSet,objectOrReference:p,enclosingRef:p,context:_({store:r,query:n,policies:d,variables:o,varString:at(o),canonizeResults:l},$a(n,this.config.fragments))}),h;if(f.missing&&(h=[new _i(cm(f.missing),f.missing,n,o)],!u))throw h[0];return{result:f.result,complete:!h,missing:h}},e.prototype.isFresh=function(t,r,n,i){if(Ur(i.store)&&this.knownResults.get(t)===n){var a=this.executeSelectionSet.peek(n,r,i,this.canon.isKnown(t));if(a&&t===a.result)return!0}return!1},e.prototype.execSelectionSetImpl=function(t){var r=this,n=t.selectionSet,i=t.objectOrReference,a=t.enclosingRef,o=t.context;if(K(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 Ye;this.config.addTypename&&typeof l=="string"&&!u.rootIdsByTypename[l]&&d.push({__typename:l});function h(v,m){var O;return v.missing&&(p=f.merge(p,(O={},O[m]=v.missing,O))),v.result}var g=new Set(n.selections);g.forEach(function(v){var m,O;if(!!Qt(v,s))if(it(v)){var N=u.readField({fieldName:v.name.value,field:v,variables:o.variables,from:i},o),T=pt(v);N===void 0?Mr.added(v)||(p=f.merge(p,(m={},m[T]="Can't find field '".concat(v.name.value,"' on ").concat(K(i)?i.__ref+" object":"object "+JSON.stringify(i,null,2)),m))):ae(N)?N=h(r.executeSubSelectedArray({field:v,array:N,enclosingRef:a,context:o}),T):v.selectionSet?N!=null&&(N=h(r.executeSelectionSet({selectionSet:v.selectionSet,objectOrReference:N,enclosingRef:K(N)?N:a,context:o}),T)):o.canonizeResults&&(N=r.canon.pass(N)),N!==void 0&&d.push((O={},O[T]=N,O))}else{var D=Cr(v,o.lookupFragment);if(!D&&v.kind===xe.FRAGMENT_SPREAD)throw __DEV__?new q("No fragment named ".concat(v.name.value)):new q(5);D&&u.fragmentMatches(D,l)&&D.selectionSet.selections.forEach(g.add,g)}});var y=fi(d),S={result:y,missing:p},b=o.canonizeResults?this.canon.admit(S):di(S);return b.result&&this.knownResults.set(b.result,n),b},e.prototype.execSubSelectedArrayImpl=function(t){var r=this,n=t.field,i=t.array,a=t.enclosingRef,o=t.context,s,u=new Ye;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:ae(l)?c(r.executeSubSelectedArray({field:n,array:l,enclosingRef:a,context:o}),d):n.selectionSet?c(r.executeSelectionSet({selectionSet:n.selectionSet,objectOrReference:l,enclosingRef:K(l)?l:a,context:o}),d):(__DEV__&&um(o.store,n,l),l)}),{result:o.canonizeResults?this.canon.admit(i):i,missing:s}},e}();function cm(e){try{JSON.stringify(e,function(t,r){if(typeof r=="string")throw r;return r})}catch(t){return t}}function um(e,t,r){if(!t.selectionSet){var n=new Set([r]);n.forEach(function(i){Z(i)&&(__DEV__?A(!K(i),"Missing selection set for object of type ".concat(Ll(e,i)," returned for query field ").concat(t.name.value)):A(!K(i),6),Object.values(i).forEach(n.add,n))})}}var Dn=new kn,Bl=new WeakMap;function Si(e){var t=Bl.get(e);return t||Bl.set(e,t={vars:new Set,dep:Pa()}),t}function Js(e){Si(e).vars.forEach(function(t){return t.forgetCache(e)})}function Vl(e){Si(e).vars.forEach(function(t){return t.attachCache(e)})}function qa(e){var t=new Set,r=new Set,n=function(a){if(arguments.length>0){if(e!==a){e=a,t.forEach(function(u){Si(u).dep.dirty(n),lm(u)});var o=Array.from(r);r.clear(),o.forEach(function(u){return u(e)})}}else{var s=Dn.getValue();s&&(i(s),Si(s).dep(n))}return e};n.onNextChange=function(a){return r.add(a),function(){r.delete(a)}};var i=n.attachCache=function(a){return t.add(a),Si(a).vars.add(n),n};return n.forgetCache=function(a){return t.delete(a)},n}function lm(e){e.broadcastWatches&&e.broadcastWatches()}var Ql=Object.create(null);function Ys(e){var t=JSON.stringify(e);return Ql[t]||(Ql[t]=Object.create(null))}function Zs(e){var t=Ys(e);return t.keyFieldsFn||(t.keyFieldsFn=function(r,n){var i=function(o,s){return n.readField(s,o)},a=n.keyObject=ec(e,function(o){var s=Nn(n.storeObject,o,i);return s===void 0&&r!==n.storeObject&&_e.call(r,o[0])&&(s=Nn(r,o,Gl)),__DEV__?A(s!==void 0,"Missing field '".concat(o.join("."),"' while extracting keyFields from ").concat(JSON.stringify(r))):A(s!==void 0,2),s});return"".concat(n.typename,":").concat(JSON.stringify(a))})}function Xs(e){var t=Ys(e);return t.keyArgsFn||(t.keyArgsFn=function(r,n){var i=n.field,a=n.variables,o=n.fieldName,s=ec(e,function(c){var l=c[0],d=l.charAt(0);if(d==="@"){if(i&&ke(i.directives)){var p=l.slice(1),f=i.directives.find(function(S){return S.name.value===p}),h=f&&zt(f,a);return h&&Nn(h,c.slice(1))}return}if(d==="$"){var g=l.slice(1);if(a&&_e.call(a,g)){var y=c.slice(0);return y[0]=g,Nn(a,y)}return}if(r)return Nn(r,c)}),u=JSON.stringify(s);return(r||u!=="{}")&&(o+=":"+u),o})}function ec(e,t){var r=new Ye;return zl(e).reduce(function(n,i){var a,o=t(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 zl(e){var t=Ys(e);if(!t.paths){var r=t.paths=[],n=[];e.forEach(function(i,a){ae(i)?(zl(i).forEach(function(o){return r.push(n.concat(o))}),n.length=0):(n.push(i),ae(e[a+1])||(r.push(n.slice(0)),n.length=0))})}return t.paths}function Gl(e,t){return e[t]}function Nn(e,t,r){return r=r||Gl,Kl(t.reduce(function n(i,a){return ae(i)?i.map(function(o){return n(o,a)}):i&&r(i,a)},e))}function Kl(e){return Z(e)?ae(e)?e.map(Kl):ec(Object.keys(e).sort(),function(t){return Nn(e,t)}):e}ci.setStringify(at);function tc(e){return e.args!==void 0?e.args:e.field?zt(e.field,e.variables):null}var fm=function(){},Wl=function(e,t){return t.fieldName},Hl=function(e,t,r){var n=r.mergeObjects;return n(e,t)},Jl=function(e,t){return t},Zl=function(){function e(t){this.config=t,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=_({dataIdFromObject:Fa},t),this.cache=this.config.cache,this.setRootTypename("Query"),this.setRootTypename("Mutation"),this.setRootTypename("Subscription"),t.possibleTypes&&this.addPossibleTypes(t.possibleTypes),t.typePolicies&&this.addTypePolicies(t.typePolicies)}return e.prototype.identify=function(t,r){var n,i=this,a=r&&(r.typename||((n=r.storeObject)===null||n===void 0?void 0:n.__typename))||t.__typename;if(a===this.rootTypenamesById.ROOT_QUERY)return["ROOT_QUERY"];for(var o=r&&r.storeObject||t,s=_(_({},r),{typename:a,storeObject:o,readField:r&&r.readField||function(){var p=Ba(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(t,s);if(ae(d))l=Zs(d);else{u=d;break}}return u=u?String(u):void 0,s.keyObject?[u,s.keyObject]:[u]},e.prototype.addTypePolicies=function(t){var r=this;Object.keys(t).forEach(function(n){var i=t[n],a=i.queryType,o=i.mutationType,s=i.subscriptionType,u=Nt(i,["queryType","mutationType","subscriptionType"]);a&&r.setRootTypename("Query",n),o&&r.setRootTypename("Mutation",n),s&&r.setRootTypename("Subscription",n),_e.call(r.toBeAdded,n)?r.toBeAdded[n].push(u):r.toBeAdded[n]=[u]})},e.prototype.updateTypePolicy=function(t,r){var n=this,i=this.getTypePolicy(t),a=r.keyFields,o=r.fields;function s(u,c){u.merge=typeof c=="function"?c:c===!0?Hl:c===!1?Jl:u.merge}s(i,r.merge),i.keyFn=a===!1?fm:ae(a)?Zs(a):typeof a=="function"?a:i.keyFn,o&&Object.keys(o).forEach(function(u){var c=n.getFieldPolicy(t,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?Wl:ae(d)?Xs(d):typeof d=="function"?d:c.keyFn,typeof p=="function"&&(c.read=p),s(c,f)}c.read&&c.merge&&(c.keyFn=c.keyFn||Wl)})},e.prototype.setRootTypename=function(t,r){r===void 0&&(r=t);var n="ROOT_"+t.toUpperCase(),i=this.rootTypenamesById[n];r!==i&&(__DEV__?A(!i||i===t,"Cannot change root ".concat(t," __typename more than once")):A(!i||i===t,3),i&&delete this.rootIdsByTypename[i],this.rootIdsByTypename[r]=n,this.rootTypenamesById[n]=r)},e.prototype.addPossibleTypes=function(t){var r=this;this.usingPossibleTypes=!0,Object.keys(t).forEach(function(n){r.getSupertypeSet(n,!0),t[n].forEach(function(i){r.getSupertypeSet(i,!0).add(n);var a=i.match(Qs);(!a||a[0]!==i)&&r.fuzzySubtypes.set(i,new RegExp(i))})})},e.prototype.getTypePolicy=function(t){var r=this;if(!_e.call(this.typePolicies,t)){var n=this.typePolicies[t]=Object.create(null);n.fields=Object.create(null);var i=this.supertypeMap.get(t);i&&i.size&&i.forEach(function(o){var s=r.getTypePolicy(o),u=s.fields,c=Nt(s,["fields"]);Object.assign(n,c),Object.assign(n.fields,u)})}var a=this.toBeAdded[t];return a&&a.length&&a.splice(0).forEach(function(o){r.updateTypePolicy(t,o)}),this.typePolicies[t]},e.prototype.getFieldPolicy=function(t,r,n){if(t){var i=this.getTypePolicy(t).fields;return i[r]||n&&(i[r]=Object.create(null))}},e.prototype.getSupertypeSet=function(t,r){var n=this.supertypeMap.get(t);return!n&&r&&this.supertypeMap.set(t,n=new Set),n},e.prototype.fragmentMatches=function(t,r,n,i){var a=this;if(!t.typeCondition)return!0;if(!r)return!1;var o=t.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 g=a.getSupertypeSet(h,!1);g&&g.size&&u.indexOf(g)<0&&u.push(g)},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__&&A.warn("Inferring subtype ".concat(r," of supertype ").concat(o)),s.add(o)),!0;f.forEach(c),l&&p===u.length-1&&La(t.selectionSet,n,i)&&(l=!1,d=!0,this.fuzzySubtypes.forEach(function(h,g){var y=r.match(h);y&&y[0]===r&&c(g)}))}return!1},e.prototype.hasKeyArgs=function(t,r){var n=this.getFieldPolicy(t,r,!1);return!!(n&&n.keyFn)},e.prototype.getStoreFieldName=function(t){var r=t.typename,n=t.fieldName,i=this.getFieldPolicy(r,n,!1),a,o=i&&i.keyFn;if(o&&r)for(var s={typename:r,fieldName:n,field:t.field||null,variables:t.variables},u=tc(t);o;){var c=o(u,s);if(ae(c))o=Xs(c);else{a=c||n;break}}return a===void 0&&(a=t.field?fs(t.field,t.variables):ci(n,tc(t))),a===!1?n:n===Et(a)?a:n+":"+a},e.prototype.readField=function(t,r){var n=t.from;if(!!n){var i=t.field||t.fieldName;if(!!i){if(t.typename===void 0){var a=r.store.getFieldValue(n,"__typename");a&&(t.typename=a)}var o=this.getStoreFieldName(t),s=Et(o),u=r.store.getFieldValue(n,o),c=this.getFieldPolicy(t.typename,s,!1),l=c&&c.read;if(l){var d=Yl(this,n,t,r,r.store.getStorage(K(n)?n.__ref:n,o));return Dn.withValue(this.cache,l,[u,d])}return u}}},e.prototype.getReadFunction=function(t,r){var n=this.getFieldPolicy(t,r,!1);return n&&n.read},e.prototype.getMergeFunction=function(t,r,n){var i=this.getFieldPolicy(t,r,!1),a=i&&i.merge;return!a&&n&&(i=this.getTypePolicy(n),a=i&&i.merge),a},e.prototype.runMergeFunction=function(t,r,n,i,a){var o=n.field,s=n.typename,u=n.merge;return u===Hl?Xl(i.store)(t,r):u===Jl?r:(i.overwrite&&(t=void 0),u(t,r,Yl(this,void 0,{typename:s,fieldName:o.name.value,field:o,variables:i.variables},i,a||Object.create(null))))},e}();function Yl(e,t,r,n,i){var a=e.getStoreFieldName(r),o=Et(a),s=r.variables||n.variables,u=n.store,c=u.toReference,l=u.canRead;return{args:tc(r),field:r.field||null,fieldName:o,storeFieldName:a,variables:s,isReference:K,toReference:c,storage:i,cache:e.cache,canRead:l,readField:function(){return e.readField(Ba(arguments,t,s),n)},mergeObjects:Xl(n.store)}}function Ba(e,t,r){var n=e[0],i=e[1],a=e.length,o;return typeof n=="string"?o={fieldName:n,from:a>1?i:t}:(o=_({},n),_e.call(o,"from")||(o.from=t)),__DEV__&&o.from===void 0&&__DEV__&&A.warn("Undefined 'from' passed to readField with arguments ".concat(Gu(Array.from(e)))),o.variables===void 0&&(o.variables=r),o}function Xl(e){return function(r,n){if(ae(r)||ae(n))throw __DEV__?new q("Cannot automatically merge arrays"):new q(4);if(Z(r)&&Z(n)){var i=e.getFieldValue(r,"__typename"),a=e.getFieldValue(n,"__typename"),o=i&&a&&i!==a;if(o)return n;if(K(r)&&ur(n))return e.merge(r.__ref,n),r;if(ur(r)&&K(n))return e.merge(r,n.__ref),n;if(ur(r)&&ur(n))return _(_({},r),n)}return n}}function rc(e,t,r){var n="".concat(t).concat(r),i=e.flavors.get(n);return i||e.flavors.set(n,i=e.clientOnly===t&&e.deferred===r?e:_(_({},e),{clientOnly:t,deferred:r})),i}var nf=function(){function e(t,r,n){this.cache=t,this.reader=r,this.fragments=n}return e.prototype.writeToStore=function(t,r){var n=this,i=r.query,a=r.result,o=r.dataId,s=r.variables,u=r.overwrite,c=Ct(i),l=Fl();s=_(_({},Fr(c)),s);var d=_(_({store:t,written:Object.create(null),merge:function(f,h){return l.merge(f,h)},variables:s,varString:at(s)},$a(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(!K(p))throw __DEV__?new q("Could not identify object ".concat(JSON.stringify(a))):new q(7);return d.incomingById.forEach(function(f,h){var g=f.storeObject,y=f.mergeTree,S=f.fieldNodeSet,b=Rt(h);if(y&&y.map.size){var v=n.applyMerges(y,b,g,d);if(K(v))return;g=v}if(__DEV__&&!d.overwrite){var m=Object.create(null);S.forEach(function(T){T.selectionSet&&(m[T.name.value]=!0)});var O=function(T){return m[Et(T)]===!0},N=function(T){var D=y&&y.map.get(T);return Boolean(D&&D.info&&D.info.merge)};Object.keys(g).forEach(function(T){O(T)&&!N(T)&&pm(b,g,T,d.store)})}t.merge(h,g)}),t.retain(p.__ref),p},e.prototype.processSelectionSet=function(t){var r=this,n=t.dataId,i=t.result,a=t.selectionSet,o=t.context,s=t.mergeTree,u=this.cache.policies,c=Object.create(null),l=n&&u.rootTypenamesById[n]||ui(i,a,o.fragmentMap)||n&&o.store.get(n,"__typename");typeof l=="string"&&(c.__typename=l);var d=function(){var v=Ba(arguments,c,o.variables);if(K(v.from)){var m=o.incomingById.get(v.from.__ref);if(m){var O=u.readField(_(_({},v),{from:m.storeObject}),o);if(O!==void 0)return O}}return u.readField(v,o)},p=new Set;this.flattenFields(a,i,o,l).forEach(function(v,m){var O,N=pt(m),T=i[N];if(p.add(m),T!==void 0){var D=u.getStoreFieldName({typename:l,fieldName:m.name.value,field:m,variables:v.variables}),C=ef(s,D),R=r.processFieldValue(T,m,m.selectionSet?rc(v,!1,!1):v,C),j=void 0;m.selectionSet&&(K(R)||ur(R))&&(j=d("__typename",R));var Pe=u.getMergeFunction(l,m.name.value,j);Pe?C.info={field:m,typename:l,merge:Pe}:tf(s,D),c=v.merge(c,(O={},O[D]=R,O))}else __DEV__&&!v.clientOnly&&!v.deferred&&!Mr.added(m)&&!u.getReadFunction(l,m.name.value)&&__DEV__&&A.error("Missing field '".concat(pt(m),"' 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],g=f[1];n=n||h,g&&(c=o.merge(c,g))}catch(v){if(!n)throw v}if(typeof n=="string"){var y=Rt(n),S=o.written[n]||(o.written[n]=[]);if(S.indexOf(a)>=0||(S.push(a),this.reader&&this.reader.isFresh(i,y,a,o)))return y;var b=o.incomingById.get(n);return b?(b.storeObject=o.merge(b.storeObject,c),b.mergeTree=nc(b.mergeTree,s),p.forEach(function(v){return b.fieldNodeSet.add(v)})):o.incomingById.set(n,{storeObject:c,mergeTree:Va(s)?void 0:s,fieldNodeSet:p}),y}return c},e.prototype.processFieldValue=function(t,r,n,i){var a=this;return!r.selectionSet||t===null?__DEV__?Ea(t):t:ae(t)?t.map(function(o,s){var u=a.processFieldValue(o,r,n,ef(i,s));return tf(i,s),u}):this.processSelectionSet({result:t,selectionSet:r.selectionSet,context:n,mergeTree:i})},e.prototype.flattenFields=function(t,r,n,i){i===void 0&&(i=ui(r,t,n.fragmentMap));var a=new Map,o=this.cache.policies,s=new Pt(!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(!!Qt(p,n.variables)){var f=l.clientOnly,h=l.deferred;if(!(f&&h)&&ke(p.directives)&&p.directives.forEach(function(S){var b=S.name.value;if(b==="client"&&(f=!0),b==="defer"){var v=zt(S,n.variables);(!v||v.if!==!1)&&(h=!0)}}),it(p)){var g=a.get(p);g&&(f=f&&g.clientOnly,h=h&&g.deferred),a.set(p,rc(n,f,h))}else{var y=Cr(p,n.lookupFragment);if(!y&&p.kind===xe.FRAGMENT_SPREAD)throw __DEV__?new q("No fragment named ".concat(p.name.value)):new q(8);y&&o.fragmentMatches(y,i,r,n.variables)&&u(y.selectionSet,rc(n,f,h))}}}))}(t,n),a},e.prototype.applyMerges=function(t,r,n,i,a){var o,s=this;if(t.map.size&&!K(n)){var u=!ae(n)&&(K(r)||ur(r))?r:void 0,c=n;u&&!a&&(a=[K(u)?u.__ref:u]);var l,d=function(p,f){return ae(p)?typeof f=="number"?p[f]:void 0:i.store.getFieldValue(p,String(f))};t.map.forEach(function(p,f){var h=d(u,f),g=d(c,f);if(g!==void 0){a&&a.push(f);var y=s.applyMerges(p,h,g,i,a);y!==g&&(l=l||new Map,l.set(f,y)),a&&A(a.pop()===f)}}),l&&(n=ae(c)?c.slice(0):_({},c),l.forEach(function(p,f){n[f]=p}))}return t.info?this.cache.policies.runMergeFunction(r,n,t.info,i,a&&(o=i.store).getStorage.apply(o,a)):n},e}();var af=[];function ef(e,t){var r=e.map;return r.has(t)||r.set(t,af.pop()||{map:new Map}),r.get(t)}function nc(e,t){if(e===t||!t||Va(t))return e;if(!e||Va(e))return t;var r=e.info&&t.info?_(_({},e.info),t.info):e.info||t.info,n=e.map.size&&t.map.size,i=n?new Map:e.map.size?e.map:t.map,a={info:r,map:i};if(n){var o=new Set(t.map.keys());e.map.forEach(function(s,u){a.map.set(u,nc(s,t.map.get(u))),o.delete(u)}),o.forEach(function(s){a.map.set(s,nc(t.map.get(s),e.map.get(s)))})}return a}function Va(e){return!e||!(e.info||e.map.size)}function tf(e,t){var r=e.map,n=r.get(t);n&&Va(n)&&(af.push(n),r.delete(t))}var rf=new Set;function pm(e,t,r,n){var i=function(d){var p=n.getFieldValue(d,r);return typeof p=="object"&&p},a=i(e);if(!!a){var o=i(t);if(!!o&&!K(a)&&!de(a,o)&&!Object.keys(a).every(function(d){return n.getFieldValue(o,d)!==void 0})){var s=n.getFieldValue(e,"__typename")||n.getFieldValue(t,"__typename"),u=Et(r),c="".concat(s,".").concat(u);if(!rf.has(c)){rf.add(c);var l=[];!ae(a)&&!ae(o)&&[a,o].forEach(function(d){var p=n.getFieldValue(d,"__typename");typeof p=="string"&&!l.includes(p)&&l.push(p)}),__DEV__&&A.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
|
|
|
@@ -46,19 +46,19 @@ For more information about these options, please refer to the documentation:
|
|
|
46
46
|
* Defining custom merge functions: https://go.apollo.dev/c/merging-non-normalized-objects
|
|
47
47
|
`))}}}}var Qa=function(e){be(t,e);function t(r){r===void 0&&(r={});var n=e.call(this)||this;return n.watches=new Set,n.typenameDocumentCache=new Map,n.makeVar=qa,n.txCount=0,n.config=Pl(r),n.addTypename=!!n.config.addTypename,n.policies=new Zl({cache:n,dataIdFromObject:n.config.dataIdFromObject,possibleTypes:n.config.possibleTypes,typePolicies:n.config.typePolicies}),n.init(),n}return t.prototype.init=function(){var r=this.data=new An.Root({policies:this.policies,resultCaching:this.config.resultCaching});this.optimisticData=r.stump,this.resetResultCache()},t.prototype.resetResultCache=function(r){var n=this,i=this.storeReader,a=this.config.fragments;this.storeWriter=new nf(this,this.storeReader=new ql({cache:this,addTypename:this.addTypename,resultCacheMaxSize:this.config.resultCacheMaxSize,canonizeResults:Ma(this.config),canon:r?void 0:i&&i.canon,fragments:a}),a),this.maybeBroadcastWatch=jr(function(o,s){return n.broadcastWatch(o,s)},{max:this.config.resultCacheMaxSize,makeCacheKey:function(o){var s=o.optimistic?n.optimisticData:n.data;if(Ur(s)){var u=o.optimistic,c=o.id,l=o.variables;return s.makeCacheKey(o.query,o.callback,at({optimistic:u,id:c,variables:l}))}}}),new Set([this.data.group,this.optimisticData.group]).forEach(function(o){return o.resetCaching()})},t.prototype.restore=function(r){return this.init(),r&&this.data.replace(r),this},t.prototype.extract=function(r){return r===void 0&&(r=!1),(r?this.optimisticData:this.data).extract()},t.prototype.read=function(r){var n=r.returnPartialData,i=n===void 0?!1:n;try{return this.storeReader.diffQueryAgainstStore(_(_({},r),{store:r.optimistic?this.optimisticData:this.data,config:this.config,returnPartialData:i})).result||null}catch(a){if(a instanceof _i)return null;throw a}},t.prototype.write=function(r){try{return++this.txCount,this.storeWriter.writeToStore(this.data,r)}finally{!--this.txCount&&r.broadcast!==!1&&this.broadcastWatches()}},t.prototype.modify=function(r){if(_e.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()}},t.prototype.diff=function(r){return this.storeReader.diffQueryAgainstStore(_(_({},r),{store:r.optimistic?this.optimisticData:this.data,rootId:r.id||"ROOT_QUERY",config:this.config}))},t.prototype.watch=function(r){var n=this;return this.watches.size||Vl(this),this.watches.add(r),r.immediate&&this.maybeBroadcastWatch(r),function(){n.watches.delete(r)&&!n.watches.size&&Js(n),n.maybeBroadcastWatch.forget(r)}},t.prototype.gc=function(r){at.reset();var n=this.optimisticData.gc();return r&&!this.txCount&&(r.resetResultCache?this.resetResultCache(r.resetResultIdentities):r.resetResultIdentities&&this.storeReader.resetCanon()),n},t.prototype.retain=function(r,n){return(n?this.optimisticData:this.data).retain(r)},t.prototype.release=function(r,n){return(n?this.optimisticData:this.data).release(r)},t.prototype.identify=function(r){if(K(r))return r.__ref;try{return this.policies.identify(r)[0]}catch(n){__DEV__&&A.warn(n)}},t.prototype.evict=function(r){if(!r.id){if(_e.call(r,"id"))return!1;r=_(_({},r),{id:"ROOT_QUERY"})}try{return++this.txCount,this.optimisticData.evict(r,this.data)}finally{!--this.txCount&&r.broadcast!==!1&&this.broadcastWatches()}},t.prototype.reset=function(r){var n=this;return this.init(),at.reset(),r&&r.discardWatches?(this.watches.forEach(function(i){return n.maybeBroadcastWatch.forget(i)}),this.watches.clear(),Js(this)):this.broadcastWatches(),Promise.resolve()},t.prototype.removeOptimistic=function(r){var n=this.optimisticData.removeLayer(r);n!==this.optimisticData&&(this.optimisticData=n,this.broadcastWatches())},t.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,g=f.optimisticData;++n.txCount,p&&(n.data=n.optimisticData=p);try{return c=i(n)}finally{--n.txCount,n.data=h,n.optimisticData=g}},d=new Set;return u&&!this.txCount&&this.broadcastWatches(_(_({},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(_(_({},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},t.prototype.performTransaction=function(r,n){return this.batch({update:r,optimistic:n||n!==null})},t.prototype.transformDocument=function(r){if(this.addTypename){var n=this.typenameDocumentCache.get(r);return n||(n=Mr(r),this.typenameDocumentCache.set(r,n),this.typenameDocumentCache.set(n,n)),n}return r},t.prototype.transformForLink=function(r){var n=this.config.fragments;return n?n.transform(r):r},t.prototype.broadcastWatches=function(r){var n=this;this.txCount||this.watches.forEach(function(i){return n.maybeBroadcastWatch(i,r)})},t.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||!de(i.result,a.result))&&r.callback(r.lastDiff=a,i)},t}(Vs);function of(e){return e.hasOwnProperty("graphQLErrors")}var dm=function(e){var t="";if(ke(e.graphQLErrors)||ke(e.clientErrors)){var r=(e.graphQLErrors||[]).concat(e.clientErrors||[]);r.forEach(function(n){var i=n?n.message:"Error message not found.";t+="".concat(i,`
|
|
48
48
|
`)})}return e.networkError&&(t+="".concat(e.networkError.message,`
|
|
49
|
-
`)),t=t.replace(/\n$/,""),t},Gt=function(e){be(t,e);function t(r){var n=r.graphQLErrors,i=r.clientErrors,a=r.networkError,o=r.errorMessage,s=r.extraInfo,u=e.call(this,o)||this;return u.name="ApolloError",u.graphQLErrors=n||[],u.clientErrors=i||[],u.networkError=a||null,u.message=o||dm(u),u.extraInfo=s,u.__proto__=t.prototype,u}return t}(Error);var te;(function(e){e[e.loading=1]="loading",e[e.setVariables=2]="setVariables",e[e.fetchMore=3]="fetchMore",e[e.refetch=4]="refetch",e[e.poll=6]="poll",e[e.ready=7]="ready",e[e.error=8]="error"})(te||(te={}));function fr(e){return e?e<7:!1}var hm=Object.assign,mm=Object.hasOwnProperty,za=function(e){be(t,e);function t(r){var n=r.queryManager,i=r.queryInfo,a=r.options,o=e.call(this,function(y){try{var S=y._subscription._observer;S&&!S.error&&(S.error=gm)}catch{}var b=!o.observers.size;o.observers.add(y);var v=o.last;return v&&v.error?y.error&&y.error(v.error):v&&v.result&&y.next&&y.next(v.result),b&&o.reobserve().catch(function(){}),function(){o.observers.delete(y)&&!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=_(_({},a),{initialFetchPolicy:h,fetchPolicy:p}),o.queryId=i.queryId||n.generateQueryId();var g=
|
|
50
|
-
Did you mean to call refetch(variables) instead of refetch({ variables })?`))}return r&&!de(this.options.variables,r)&&(i.variables=this.options.variables=_(_({},this.options.variables),r)),this.queryInfo.resetLastWrite(),this.reobserve(i,te.refetch)},t.prototype.fetchMore=function(r){var n=this,i=_(_({},r.query?r:_(_(_(_({},this.options),{query:this.query}),r),{variables:_(_({},this.options.variables),r.variables)})),{fetchPolicy:"no-cache"}),a=this.queryManager.generateQueryId(),o=this.queryInfo,s=o.networkStatus;o.networkStatus=te.fetchMore,i.notifyOnNetworkStatusChange&&this.observe();var u=new Set;return this.queryManager.fetchQuery(a,i,te.fetchMore).then(function(c){return n.queryManager.removeQuery(a),o.networkStatus===te.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)||ic(n)})},t.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__&&A.error("Unhandled GraphQL subscription error",a)}});return this.subscriptions.add(i),function(){n.subscriptions.delete(i)&&i.unsubscribe()}},t.prototype.setOptions=function(r){return this.reobserve(r)},t.prototype.setVariables=function(r){return de(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},te.setVariables):Promise.resolve())},t.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())},t.prototype.startPolling=function(r){this.options.pollInterval=r,this.updatePolling()},t.prototype.stopPolling=function(){this.options.pollInterval=0,this.updatePolling()},t.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},t.prototype.fetch=function(r,n){return this.queryManager.setObservableQuery(this),this.queryManager.fetchQueryObservable(this.queryId,r,n)},t.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__?A(a,"Attempted to start a polling query without a polling interval."):A(a,13);var o=i||(this.pollingInfo={});o.interval=a;var s=function(){r.pollingInfo&&(fr(r.queryInfo.networkStatus)?u():r.reobserve({fetchPolicy:r.options.initialFetchPolicy==="no-cache"?"no-cache":"network-only"},te.poll).then(u,u))},u=function(){var c=r.pollingInfo;c&&(clearTimeout(c.timeout),c.timeout=setTimeout(s,c.interval))};u()}}},t.prototype.updateLastResult=function(r,n){return n===void 0&&(n=this.variables),this.last=_(_({},this.last),{result:this.queryManager.assumeImmutableResults?r:Ea(r),variables:n}),ke(r.errors)||delete this.last.error,this.last},t.prototype.reobserve=function(r,n){var i=this;this.isTornDown=!1;var a=n===te.refetch||n===te.fetchMore||n===te.poll,o=this.options.variables,s=this.options.fetchPolicy,u=sr(this.options,r||{}),c=a?u:hm(this.options,u);a||(this.updatePolling(),r&&r.variables&&!de(r.variables,o)&&c.fetchPolicy!=="standby"&&c.fetchPolicy===s&&(this.applyNextFetchPolicy("variables-changed",c),n===void 0&&(n=te.setVariables)));var l=c.variables&&_({},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},t.prototype.observe=function(){this.reportResult(this.getCurrentResult(!1),this.variables)},t.prototype.reportResult=function(r,n){var i=this.getLastError();(i||this.isDifferentFromLastResult(r,n))&&((i||!r.partial||this.options.returnPartialData)&&this.updateLastResult(r,n),$r(this.observers,"next",r))},t.prototype.reportError=function(r,n){var i=_(_({},this.getLastResult()),{error:r,errors:r.graphQLErrors,networkStatus:te.error,loading:!1});this.updateLastResult(i,n),$r(this.observers,"error",this.last.error=r)},t.prototype.hasObservers=function(){return this.observers.size>0},t.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)},t}(G);Ta(za);function ic(e){var t=e.options,r=t.fetchPolicy,n=t.nextFetchPolicy;return r==="cache-and-network"||r==="network-only"?e.reobserve({fetchPolicy:"cache-first",nextFetchPolicy:function(){return this.nextFetchPolicy=n,typeof n=="function"?n.apply(this,arguments):r}}):e.reobserve()}function gm(e){__DEV__&&A.error("Unhandled error",e.message,e.stack)}function ac(e){__DEV__&&e&&__DEV__&&A.debug("Missing cache result fields: ".concat(JSON.stringify(e)),e)}var Ga=function(){function e(t){var r=t.cache,n=t.client,i=t.resolvers,a=t.fragmentMatcher;this.selectionsToResolveCache=new WeakMap,this.cache=r,n&&(this.client=n),i&&this.addResolvers(i),a&&this.setFragmentMatcher(a)}return e.prototype.addResolvers=function(t){var r=this;this.resolvers=this.resolvers||{},Array.isArray(t)?t.forEach(function(n){r.resolvers=vs(r.resolvers,n)}):this.resolvers=vs(this.resolvers,t)},e.prototype.setResolvers=function(t){this.resolvers={},this.addResolvers(t)},e.prototype.getResolvers=function(){return this.resolvers||{}},e.prototype.runResolvers=function(t){var r=t.document,n=t.remoteResult,i=t.context,a=t.variables,o=t.onlyRunForcedResolvers,s=o===void 0?!1:o;return bt(this,void 0,void 0,function(){return _t(this,function(u){return r?[2,this.resolveDocument(r,n.data,i,a,this.fragmentMatcher,s).then(function(c){return _(_({},n),{data:c.result})})]:[2,n]})})},e.prototype.setFragmentMatcher=function(t){this.fragmentMatcher=t},e.prototype.getFragmentMatcher=function(){return this.fragmentMatcher},e.prototype.clientQuery=function(t){return bn(["client"],t)&&this.resolvers?t:null},e.prototype.serverQuery=function(t){return ys(t)},e.prototype.prepareContext=function(t){var r=this.cache;return _(_({},t),{cache:r,getCacheKey:function(n){return r.identify(n)}})},e.prototype.addExportedVariables=function(t,r,n){return r===void 0&&(r={}),n===void 0&&(n={}),bt(this,void 0,void 0,function(){return _t(this,function(i){return t?[2,this.resolveDocument(t,this.buildRootValueFromCache(t,r)||{},this.prepareContext(n),r).then(function(a){return _(_({},r),a.exportedVariables)})]:[2,_({},r)]})})},e.prototype.shouldForceResolvers=function(t){var r=!1;return Be(t,{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 Nr}}}),r},e.prototype.buildRootValueFromCache=function(t,r){return this.cache.diff({query:gs(t),variables:r,returnPartialData:!0,optimistic:!1}).result},e.prototype.resolveDocument=function(t,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),bt(this,void 0,void 0,function(){var s,u,c,l,d,p,f,h,g,y,S;return _t(this,function(b){return s=Lr(t),u=Pr(t),c=Cr(u),l=this.collectSelectionsToResolve(s,c),d=s.operation,p=d?d.charAt(0).toUpperCase()+d.slice(1):"Query",f=this,h=f.cache,g=f.client,y={fragmentMap:c,context:_(_({},n),{cache:h,client:g}),variables:i,fragmentMatcher:a,defaultOperationType:p,exportedVariables:{},selectionsToResolve:l,onlyRunForcedResolvers:o},S=!1,[2,this.resolveSelectionSet(s.selectionSet,S,r,y).then(function(v){return{result:v,exportedVariables:y.exportedVariables}})]})})},e.prototype.resolveSelectionSet=function(t,r,n,i){return bt(this,void 0,void 0,function(){var a,o,s,u,c,l=this;return _t(this,function(d){return a=i.fragmentMap,o=i.context,s=i.variables,u=[n],c=function(p){return bt(l,void 0,void 0,function(){var f,h;return _t(this,function(g){return!r&&!i.selectionsToResolve.has(p)?[2]:Qt(p,s)?it(p)?[2,this.resolveField(p,r,n,i).then(function(y){var S;typeof y<"u"&&u.push((S={},S[pt(p)]=y,S))})]:(ps(p)?f=p:(f=a[p.name.value],__DEV__?A(f,"No fragment named ".concat(p.name.value)):A(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(y){u.push(y)})]:[2]):[2]})})},[2,Promise.all(t.selections.map(c)).then(function(){return fi(u)})]})})},e.prototype.resolveField=function(t,r,n,i){return bt(this,void 0,void 0,function(){var a,o,s,u,c,l,d,p,f,h=this;return _t(this,function(g){return n?(a=i.variables,o=t.name.value,s=pt(t),u=o!==s,c=n[s]||n[o],l=Promise.resolve(c),(!i.onlyRunForcedResolvers||this.shouldForceResolvers(t))&&(d=n.__typename||i.defaultOperationType,p=this.resolvers&&this.resolvers[d],p&&(f=p[u?o:s],f&&(l=Promise.resolve(Dn.withValue(this.cache,f,[n,zt(t,a),i.context,{field:t,fragmentMap:i.fragmentMap}]))))),[2,l.then(function(y){var S,b;if(y===void 0&&(y=c),t.directives&&t.directives.forEach(function(m){m.name.value==="export"&&m.arguments&&m.arguments.forEach(function(O){O.name.value==="as"&&O.value.kind==="StringValue"&&(i.exportedVariables[O.value.value]=y)})}),!t.selectionSet||y==null)return y;var v=(b=(S=t.directives)===null||S===void 0?void 0:S.some(function(m){return m.name.value==="client"}))!==null&&b!==void 0?b:!1;if(Array.isArray(y))return h.resolveSubSelectedArray(t,r||v,y,i);if(t.selectionSet)return h.resolveSelectionSet(t.selectionSet,r||v,y,i)})]):[2,null]})})},e.prototype.resolveSubSelectedArray=function(t,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(t,r,o,i);if(t.selectionSet)return a.resolveSelectionSet(t.selectionSet,r,o,i)}))},e.prototype.collectSelectionsToResolve=function(t,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),Be(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__?A(f,"No fragment named ".concat(u.name.value)):A(f,12);var h=a(f);h.size>0&&(p.forEach(function(g){n(g)&&oi(g)&&s.add(g)}),s.add(u),h.forEach(function(g){s.add(g)}))}})}return i.get(o)}return a(t)},e}();var Cn=new(dt?WeakMap:Map);function oc(e,t){var r=e[t];typeof r=="function"&&(e[t]=function(){return Cn.set(e,(Cn.get(e)+1)%1e15),r.apply(this,arguments)})}function sf(e){e.notifyTimeout&&(clearTimeout(e.notifyTimeout),e.notifyTimeout=void 0)}var Ka=function(){function e(t,r){r===void 0&&(r=t.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=t.cache;Cn.has(n)||(Cn.set(n,0),oc(n,"evict"),oc(n,"modify"),oc(n,"reset"))}return e.prototype.init=function(t){var r=t.networkStatus||te.loading;return this.variables&&this.networkStatus!==te.loading&&!de(this.variables,t.variables)&&(r=te.setVariables),de(t.variables,this.variables)||(this.lastDiff=void 0),Object.assign(this,{document:t.document,variables:t.variables,networkError:null,graphQLErrors:this.graphQLErrors||[],networkStatus:r}),t.observableQuery&&this.setObservableQuery(t.observableQuery),t.lastRequestId&&(this.lastRequestId=t.lastRequestId),this},e.prototype.reset=function(){sf(this),this.dirty=!1},e.prototype.getDiff=function(t){t===void 0&&(t=this.variables);var r=this.getDiffOptions(t);if(this.lastDiff&&de(r,this.lastDiff.options))return this.lastDiff.diff;this.updateWatch(this.variables=t);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},e.prototype.updateLastDiff=function(t,r){this.lastDiff=t?{diff:t,options:r||this.getDiffOptions()}:void 0},e.prototype.getDiffOptions=function(t){var r;return t===void 0&&(t=this.variables),{query:this.document,variables:t,returnPartialData:!0,optimistic:!0,canonizeResults:(r=this.observableQuery)===null||r===void 0?void 0:r.options.canonizeResults}},e.prototype.setDiff=function(t){var r=this,n=this.lastDiff&&this.lastDiff.diff;this.updateLastDiff(t),!this.dirty&&!de(n&&n.result,t&&t.result)&&(this.dirty=!0,this.notifyTimeout||(this.notifyTimeout=setTimeout(function(){return r.notify()},0)))},e.prototype.setObservableQuery=function(t){var r=this;t!==this.observableQuery&&(this.oqListener&&this.listeners.delete(this.oqListener),this.observableQuery=t,t?(t.queryInfo=this,this.listeners.add(this.oqListener=function(){var n=r.getDiff();n.fromOptimisticTransaction?t.observe():ic(t)})):delete this.oqListener)},e.prototype.notify=function(){var t=this;sf(this),this.shouldNotify()&&this.listeners.forEach(function(r){return r(t)}),this.dirty=!1},e.prototype.shouldNotify=function(){if(!this.dirty||!this.listeners.size)return!1;if(fr(this.networkStatus)&&this.observableQuery){var t=this.observableQuery.options.fetchPolicy;if(t!=="cache-only"&&t!=="cache-and-network")return!1}return!0},e.prototype.stop=function(){if(!this.stopped){this.stopped=!0,this.reset(),this.cancel(),this.cancel=e.prototype.cancel,this.subscriptions.forEach(function(r){return r.unsubscribe()});var t=this.observableQuery;t&&t.stopPolling()}},e.prototype.cancel=function(){},e.prototype.updateWatch=function(t){var r=this;t===void 0&&(t=this.variables);var n=this.observableQuery;if(!(n&&n.options.fetchPolicy==="no-cache")){var i=_(_({},this.getDiffOptions(t)),{watcher:this,callback:function(a){return r.setDiff(a)}});(!this.lastWatch||!de(i,this.lastWatch))&&(this.cancel(),this.cancel=this.cache.watch(this.lastWatch=i))}},e.prototype.resetLastWrite=function(){this.lastWrite=void 0},e.prototype.shouldWrite=function(t,r){var n=this.lastWrite;return!(n&&n.dmCount===Cn.get(this.cache)&&de(r,n.variables)&&de(t.data,n.result.data))},e.prototype.markResult=function(t,r,n,i){var a=this,o=new Ye,s=ke(t.errors)?t.errors.slice(0):[];if(this.reset(),"incremental"in t&&ke(t.incremental)){var u=Ia(this.getDiff().result,t);t.data=u}else if("hasNext"in t&&t.hasNext){var c=this.getDiff();t.data=o.merge(c.result,t.data)}this.graphQLErrors=s,n.fetchPolicy==="no-cache"?this.updateLastDiff({result:t.data,complete:!0},this.getDiffOptions(n.variables)):i!==0&&(Wa(t,n.errorPolicy)?this.cache.performTransaction(function(l){if(a.shouldWrite(t,n.variables))l.writeQuery({query:r,data:t.data,variables:n.variables,overwrite:i===1}),a.lastWrite={result:t,variables:n.variables,dmCount:Cn.get(a.cache)};else if(a.lastDiff&&a.lastDiff.diff.complete){t.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&&(t.data=p.result)}):this.lastWrite=void 0)},e.prototype.markReady=function(){return this.networkError=null,this.networkStatus=te.ready},e.prototype.markError=function(t){return this.networkStatus=te.error,this.lastWrite=void 0,this.reset(),t.graphQLErrors&&(this.graphQLErrors=t.graphQLErrors),t.networkError&&(this.networkError=t.networkError),t},e}();function Wa(e,t){t===void 0&&(t="none");var r=t==="ignore"||t==="all",n=!Tn(e);return!n&&r&&e.data&&(n=!0),n}var ym=Object.prototype.hasOwnProperty,cf=function(){function e(t){var r=t.cache,n=t.link,i=t.defaultOptions,a=t.queryDeduplication,o=a===void 0?!1:a,s=t.onBroadcast,u=t.ssrMode,c=u===void 0?!1:u,l=t.clientAwareness,d=l===void 0?{}:l,p=t.localState,f=t.assumeImmutableResults;this.clientAwareness={},this.queries=new Map,this.fetchCancelFns=new Map,this.transformCache=new(dt?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 Ga({cache:r}),this.ssrMode=c,this.assumeImmutableResults=!!f,(this.onBroadcast=s)&&(this.mutationStore=Object.create(null))}return e.prototype.stop=function(){var t=this;this.queries.forEach(function(r,n){t.stopQueryNoBroadcast(n)}),this.cancelPendingFetches(__DEV__?new q("QueryManager stopped while query was in flight"):new q(14))},e.prototype.cancelPendingFetches=function(t){this.fetchCancelFns.forEach(function(r){return r(t)}),this.fetchCancelFns.clear()},e.prototype.mutate=function(t){var r,n,i=t.mutation,a=t.variables,o=t.optimisticResponse,s=t.updateQueries,u=t.refetchQueries,c=u===void 0?[]:u,l=t.awaitRefetchQueries,d=l===void 0?!1:l,p=t.update,f=t.onQueryUpdated,h=t.fetchPolicy,g=h===void 0?((r=this.defaultOptions.mutate)===null||r===void 0?void 0:r.fetchPolicy)||"network-only":h,y=t.errorPolicy,S=y===void 0?((n=this.defaultOptions.mutate)===null||n===void 0?void 0:n.errorPolicy)||"none":y,b=t.keepRootFields,v=t.context;return bt(this,void 0,void 0,function(){var m,O,N,T,D,R;return _t(this,function(C){switch(C.label){case 0:return __DEV__?A(i,"mutation option is required. You must specify your GraphQL document in the mutation option."):A(i,15),__DEV__?A(g==="network-only"||g==="no-cache","Mutations support only 'network-only' or 'no-cache' fetchPolicy strings. The default `network-only` behavior automatically writes mutation results to the cache. Passing `no-cache` skips the cache write."):A(g==="network-only"||g==="no-cache",16),m=this.generateMutationId(),O=this.transform(i),N=O.document,T=O.hasClientExports,i=this.cache.transformForLink(N),a=this.getVariables(i,a),T?[4,this.localState.addExportedVariables(i,a,v)]:[3,2];case 1:a=C.sent(),C.label=2;case 2:return D=this.mutationStore&&(this.mutationStore[m]={mutation:i,variables:a,loading:!0,error:null}),o&&this.markMutationOptimistic(o,{mutationId:m,document:i,variables:a,fetchPolicy:g,errorPolicy:S,context:v,updateQueries:s,update:p,keepRootFields:b}),this.broadcastQueries(),R=this,[2,new Promise(function(j,Pe){return xa(R.getObservableFromLink(i,_(_({},v),{optimisticResponse:o}),a,!1),function(Ie){if(Tn(Ie)&&S==="none")throw new Gt({graphQLErrors:ka(Ie)});D&&(D.loading=!1,D.error=null);var U=_({},Ie);return typeof c=="function"&&(c=c(U)),S==="ignore"&&Tn(U)&&delete U.errors,R.markMutationResult({mutationId:m,result:U,document:i,variables:a,fetchPolicy:g,errorPolicy:S,context:v,update:p,updateQueries:s,awaitRefetchQueries:d,refetchQueries:c,removeOptimistic:o?m:void 0,onQueryUpdated:f,keepRootFields:b})}).subscribe({next:function(Ie){R.broadcastQueries(),(!("hasNext"in Ie)||Ie.hasNext===!1)&&j(Ie)},error:function(Ie){D&&(D.loading=!1,D.error=Ie),o&&R.cache.removeOptimistic(m),R.broadcastQueries(),Pe(Ie instanceof Gt?Ie:new Gt({networkError:Ie}))}})})]}})})},e.prototype.markMutationResult=function(t,r){var n=this;r===void 0&&(r=this.cache);var i=t.result,a=[],o=t.fetchPolicy==="no-cache";if(!o&&Wa(i,t.errorPolicy)){if(or(i)||a.push({result:i.data,dataId:"ROOT_MUTATION",query:t.document,variables:t.variables}),or(i)&&ke(i.incremental)){var s=r.diff({id:"ROOT_MUTATION",query:this.transform(t.document).asQuery,variables:t.variables,optimistic:!1,returnPartialData:!0}),u=void 0;s.result&&(u=Ia(s.result,i)),typeof u<"u"&&(i.data=u,a.push({result:u,dataId:"ROOT_MUTATION",query:t.document,variables:t.variables}))}var c=t.updateQueries;c&&this.queries.forEach(function(d,p){var f=d.observableQuery,h=f&&f.queryName;if(!(!h||!ym.call(c,h))){var g=c[h],y=n.queries.get(p),S=y.document,b=y.variables,v=r.diff({query:S,variables:b,returnPartialData:!0,optimistic:!1}),m=v.result,O=v.complete;if(O&&m){var N=g(m,{mutationResult:i,queryName:S&&wn(S)||void 0,queryVariables:b});N&&a.push({result:N,dataId:"ROOT_QUERY",query:S,variables:b})}}})}if(a.length>0||t.refetchQueries||t.update||t.onQueryUpdated||t.removeOptimistic){var l=[];if(this.refetchQueries({updateCache:function(d){o||a.forEach(function(g){return d.write(g)});var p=t.update,f=!Qu(i)||or(i)&&!i.hasNext;if(p){if(!o){var h=d.diff({id:"ROOT_MUTATION",query:n.transform(t.document).asQuery,variables:t.variables,optimistic:!1,returnPartialData:!0});h.complete&&(i=_(_({},i),{data:h.result}),"incremental"in i&&delete i.incremental,"hasNext"in i&&delete i.hasNext)}f&&p(d,i,{context:t.context,variables:t.variables})}!o&&!t.keepRootFields&&f&&d.modify({id:"ROOT_MUTATION",fields:function(g,y){var S=y.fieldName,b=y.DELETE;return S==="__typename"?g:b}})},include:t.refetchQueries,optimistic:!1,removeOptimistic:t.removeOptimistic,onQueryUpdated:t.onQueryUpdated||null}).forEach(function(d){return l.push(d)}),t.awaitRefetchQueries||t.onQueryUpdated)return Promise.all(l).then(function(){return i})}return Promise.resolve(i)},e.prototype.markMutationOptimistic=function(t,r){var n=this,i=typeof t=="function"?t(r.variables):t;return this.cache.recordOptimisticTransaction(function(a){try{n.markMutationResult(_(_({},r),{result:{data:i}}),a)}catch(o){__DEV__&&A.error(o)}},r.mutationId)},e.prototype.fetchQuery=function(t,r,n){return this.fetchQueryObservable(t,r,n).promise},e.prototype.getQueryStore=function(){var t=Object.create(null);return this.queries.forEach(function(r,n){t[n]={variables:r.variables,networkStatus:r.networkStatus,networkError:r.networkError,graphQLErrors:r.graphQLErrors}}),t},e.prototype.resetErrors=function(t){var r=this.queries.get(t);r&&(r.networkError=void 0,r.graphQLErrors=[])},e.prototype.transform=function(t){var r=this.transformCache;if(!r.has(t)){var n=this.cache.transformDocument(t),i=ms(n),a=this.localState.clientQuery(n),o=i&&this.localState.serverQuery(i),s={document:n,hasClientExports:cs(n),hasForcedResolvers:this.localState.shouldForceResolvers(n),clientQuery:a,serverQuery:o,defaultVars:Fr(Rt(n)),asQuery:_(_({},n),{definitions:n.definitions.map(function(c){return c.kind==="OperationDefinition"&&c.operation!=="query"?_(_({},c),{operation:"query"}):c})})},u=function(c){c&&!r.has(c)&&r.set(c,s)};u(t),u(n),u(a),u(o)}return r.get(t)},e.prototype.getVariables=function(t,r){return _(_({},this.transform(t).defaultVars),r)},e.prototype.watchQuery=function(t){t=_(_({},t),{variables:this.getVariables(t.query,t.variables)}),typeof t.notifyOnNetworkStatusChange>"u"&&(t.notifyOnNetworkStatusChange=!1);var r=new Ka(this),n=new za({queryManager:this,queryInfo:r,options:t});return this.queries.set(n.queryId,r),r.init({document:n.query,observableQuery:n,variables:n.variables}),n},e.prototype.query=function(t,r){var n=this;return r===void 0&&(r=this.generateQueryId()),__DEV__?A(t.query,"query option is required. You must specify your GraphQL document in the query option."):A(t.query,17),__DEV__?A(t.query.kind==="Document",'You must wrap the query string in a "gql" tag.'):A(t.query.kind==="Document",18),__DEV__?A(!t.returnPartialData,"returnPartialData option only supported on watchQuery."):A(!t.returnPartialData,19),__DEV__?A(!t.pollInterval,"pollInterval option only supported on watchQuery."):A(!t.pollInterval,20),this.fetchQuery(r,t).finally(function(){return n.stopQuery(r)})},e.prototype.generateQueryId=function(){return String(this.queryIdCounter++)},e.prototype.generateRequestId=function(){return this.requestIdCounter++},e.prototype.generateMutationId=function(){return String(this.mutationIdCounter++)},e.prototype.stopQueryInStore=function(t){this.stopQueryInStoreNoBroadcast(t),this.broadcastQueries()},e.prototype.stopQueryInStoreNoBroadcast=function(t){var r=this.queries.get(t);r&&r.stop()},e.prototype.clearStore=function(t){return t===void 0&&(t={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=te.loading:r.stop()}),this.mutationStore&&(this.mutationStore=Object.create(null)),this.cache.reset(t)},e.prototype.getObservableQueries=function(t){var r=this;t===void 0&&(t="active");var n=new Map,i=new Map,a=new Set;return Array.isArray(t)&&t.forEach(function(o){typeof o=="string"?i.set(o,!1):ls(o)?i.set(r.transform(o).document,!1):Z(o)&&o.query&&a.add(o)}),this.queries.forEach(function(o,s){var u=o.observableQuery,c=o.document;if(u){if(t==="all"){n.set(s,u);return}var l=u.queryName,d=u.options.fetchPolicy;if(d==="standby"||t==="active"&&!u.hasObservers())return;(t==="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=hi("legacyOneTimeQuery"),u=r.getQuery(s).init({document:o.query,variables:o.variables}),c=new za({queryManager:r,queryInfo:u,options:_(_({},o),{fetchPolicy:"network-only"})});A(c.queryId===s),u.setObservableQuery(c),n.set(s,c)}),__DEV__&&i.size&&i.forEach(function(o,s){o||__DEV__&&A.warn("Unknown query ".concat(typeof s=="string"?"named ":"").concat(JSON.stringify(s,null,2)," requested in refetchQueries options.include array"))}),n},e.prototype.reFetchObservableQueries=function(t){var r=this;t===void 0&&(t=!1);var n=[];return this.getObservableQueries(t?"all":"active").forEach(function(i,a){var o=i.options.fetchPolicy;i.resetLastResults(),(t||o!=="standby"&&o!=="cache-only")&&n.push(i.refetch()),r.getQuery(a).setDiff(null)}),this.broadcastQueries(),Promise.all(n)},e.prototype.setObservableQuery=function(t){this.getQuery(t.queryId).setObservableQuery(t)},e.prototype.startGraphQLSubscription=function(t){var r=this,n=t.query,i=t.fetchPolicy,a=t.errorPolicy,o=t.variables,s=t.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"&&(Wa(p,a)&&r.cache.write({query:n,result:p.data,dataId:"ROOT_SUBSCRIPTION",variables:d}),r.broadcastQueries()),Tn(p))throw new Gt({graphQLErrors:p.errors});return p})};if(this.transform(n).hasClientExports){var l=this.localState.addExportedVariables(n,o,u).then(c);return new G(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)},e.prototype.stopQuery=function(t){this.stopQueryNoBroadcast(t),this.broadcastQueries()},e.prototype.stopQueryNoBroadcast=function(t){this.stopQueryInStoreNoBroadcast(t),this.removeQuery(t)},e.prototype.removeQuery=function(t){this.fetchCancelFns.delete(t),this.queries.has(t)&&(this.getQuery(t).stop(),this.queries.delete(t))},e.prototype.broadcastQueries=function(){this.onBroadcast&&this.onBroadcast(),this.queries.forEach(function(t){return t.notify()})},e.prototype.getLocalState=function(){return this.localState},e.prototype.getObservableFromLink=function(t,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(t).serverQuery;if(u){var c=this,l=c.inFlightLinkObservables,d=c.link,p={query:u,variables:n,operationName:wn(u)||void 0,context:this.prepareContext(_(_({},r),{forceFetch:!i}))};if(r=p.context,i){var f=l.get(u)||new Map;l.set(u,f);var h=at(n);if(s=f.get(h),!s){var g=new xn([In(d,p)]);f.set(h,s=g),g.beforeNext(function(){f.delete(h)&&f.size<1&&l.delete(u)})}}else s=new xn([In(d,p)])}else s=new xn([G.of({data:{}})]),r=this.prepareContext(r);var y=this.transform(t).clientQuery;return y&&(s=xa(s,function(S){return a.localState.runResolvers({document:y,remoteResult:S,context:r,variables:n})})),s},e.prototype.getResultsFromLink=function(t,r,n){var i=t.lastRequestId=this.generateRequestId(),a=this.cache.transformForLink(this.transform(t.document).document);return xa(this.getObservableFromLink(a,n.context,n.variables),function(o){var s=ka(o),u=s.length>0;if(i>=t.lastRequestId){if(u&&n.errorPolicy==="none")throw t.markError(new Gt({graphQLErrors:s}));t.markResult(o,a,n,r),t.markReady()}var c={data:o.data,loading:!1,networkStatus:te.ready};return u&&n.errorPolicy!=="ignore"&&(c.errors=s,c.networkStatus=te.error),c},function(o){var s=of(o)?o:new Gt({networkError:o});throw i>=t.lastRequestId&&t.markError(s),s})},e.prototype.fetchQueryObservable=function(t,r,n){var i=this;n===void 0&&(n=te.loading);var a=this.transform(r.query).document,o=this.getVariables(a,r.variables),s=this.getQuery(t),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,g=r.notifyOnNetworkStatusChange,y=g===void 0?!1:g,S=r.context,b=S===void 0?{}:S,v=Object.assign({},r,{query:a,variables:o,fetchPolicy:l,errorPolicy:p,returnPartialData:h,notifyOnNetworkStatusChange:y,context:b}),m=function(T){v.variables=T;var D=i.fetchQueryByPolicy(s,v,n);return v.fetchPolicy!=="standby"&&D.length>0&&s.observableQuery&&s.observableQuery.applyNextFetchPolicy("after-fetch",r),D},O=function(){return i.fetchCancelFns.delete(t)};this.fetchCancelFns.set(t,function(T){O(),setTimeout(function(){return N.cancel(T)})});var N=new xn(this.transform(v.query).hasClientExports?this.localState.addExportedVariables(v.query,v.variables,v.context).then(m):m(v.variables));return N.promise.then(O,O),N},e.prototype.refetchQueries=function(t){var r=this,n=t.updateCache,i=t.include,a=t.optimistic,o=a===void 0?!1:a,s=t.removeOptimistic,u=s===void 0?o?hi("refetchQueries"):void 0:s,c=t.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 g=p.watcher instanceof Ka&&p.watcher.observableQuery;if(g){if(c){l.delete(g.queryId);var y=c(g,f,h);return y===!0&&(y=g.refetch()),y!==!1&&d.set(g,y),y}c!==null&&l.set(g.queryId,{oq:g,lastDiff:h,diff:f})}}}),l.size&&l.forEach(function(p,f){var h=p.oq,g=p.lastDiff,y=p.diff,S;if(c){if(!y){var b=h.queryInfo;b.reset(),y=b.getDiff()}S=c(h,y,g)}(!c||S===!0)&&(S=h.refetch()),S!==!1&&d.set(h,S),f.indexOf("legacyOneTimeQuery")>=0&&r.stopQueryNoBroadcast(f)}),u&&this.cache.removeOptimistic(u),d},e.prototype.fetchQueryByPolicy=function(t,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=t.networkStatus;t.init({document:this.transform(a).document,variables:o,networkStatus:n});var h=function(){return t.getDiff(o)},g=function(m,O){O===void 0&&(O=t.networkStatus||te.loading);var N=m.result;__DEV__&&!l&&!de(N,{})&&ac(m.missing);var T=function(D){return G.of(_({data:D,loading:fr(O),networkStatus:O},m.complete?null:{partial:!0}))};return N&&i.transform(a).hasForcedResolvers?i.localState.runResolvers({document:a,remoteResult:{data:N},context:d,variables:o,onlyRunForcedResolvers:!0}).then(function(D){return T(D.data||void 0)}):c==="none"&&O===te.refetch&&Array.isArray(m.missing)?T(void 0):T(N)},y=s==="no-cache"?0:n===te.refetch&&u!=="merge"?1:2,S=function(){return i.getResultsFromLink(t,y,{variables:o,context:d,fetchPolicy:s,errorPolicy:c})},b=p&&typeof f=="number"&&f!==n&&fr(n);switch(s){default:case"cache-first":{var v=h();return v.complete?[g(v,t.markReady())]:l||b?[g(v),S()]:[S()]}case"cache-and-network":{var v=h();return v.complete||l||b?[g(v),S()]:[S()]}case"cache-only":return[g(h(),t.markReady())];case"network-only":return b?[g(h()),S()]:[S()];case"no-cache":return b?[g(t.getDiff()),S()]:[S()];case"standby":return[]}},e.prototype.getQuery=function(t){return t&&!this.queries.has(t)&&this.queries.set(t,new Ka(this,t)),this.queries.get(t)},e.prototype.prepareContext=function(t){t===void 0&&(t={});var r=this.localState.prepareContext(t);return _(_({},r),{clientAwareness:this.clientAwareness})},e}();var uf=!1;var sc=function(){function e(t){var r=this;this.resetStoreCallbacks=[],this.clearStoreCallbacks=[];var n=t.uri,i=t.credentials,a=t.headers,o=t.cache,s=t.ssrMode,u=s===void 0?!1:s,c=t.ssrForceFetchDelay,l=c===void 0?0:c,d=t.connectToDevTools,p=d===void 0?typeof window=="object"&&!window.__APOLLO_CLIENT__&&__DEV__:d,f=t.queryDeduplication,h=f===void 0?!0:f,g=t.defaultOptions,y=t.assumeImmutableResults,S=y===void 0?!1:y,b=t.resolvers,v=t.typeDefs,m=t.fragmentMatcher,O=t.name,N=t.version,T=t.link;if(T||(T=n?new Ls({uri:n,credentials:i,headers:a}):ht.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=h,this.defaultOptions=g||Object.create(null),this.typeDefs=v,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),!uf&&p&&__DEV__&&(uf=!0,typeof window<"u"&&window.document&&window.top===window.self&&!window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__)){var D=window.navigator,R=D&&D.userAgent,C=void 0;typeof R=="string"&&(R.indexOf("Chrome/")>-1?C="https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm":R.indexOf("Firefox/")>-1&&(C="https://addons.mozilla.org/en-US/firefox/addon/apollo-developer-tools/")),C&&__DEV__&&A.log("Download the Apollo DevTools for a better development experience: "+C)}this.version=Wu,this.localState=new Ga({cache:o,client:this,resolvers:b,fragmentMatcher:m}),this.queryManager=new cf({cache:this.cache,link:this.link,defaultOptions:this.defaultOptions,queryDeduplication:h,ssrMode:u,clientAwareness:{name:O,version:N},localState:this.localState,assumeImmutableResults:S,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 e.prototype.stop=function(){this.queryManager.stop()},e.prototype.watchQuery=function(t){return this.defaultOptions.watchQuery&&(t=mi(this.defaultOptions.watchQuery,t)),this.disableNetworkFetches&&(t.fetchPolicy==="network-only"||t.fetchPolicy==="cache-and-network")&&(t=_(_({},t),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(t)},e.prototype.query=function(t){return this.defaultOptions.query&&(t=mi(this.defaultOptions.query,t)),__DEV__?A(t.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."):A(t.fetchPolicy!=="cache-and-network",10),this.disableNetworkFetches&&t.fetchPolicy==="network-only"&&(t=_(_({},t),{fetchPolicy:"cache-first"})),this.queryManager.query(t)},e.prototype.mutate=function(t){return this.defaultOptions.mutate&&(t=mi(this.defaultOptions.mutate,t)),this.queryManager.mutate(t)},e.prototype.subscribe=function(t){return this.queryManager.startGraphQLSubscription(t)},e.prototype.readQuery=function(t,r){return r===void 0&&(r=!1),this.cache.readQuery(t,r)},e.prototype.readFragment=function(t,r){return r===void 0&&(r=!1),this.cache.readFragment(t,r)},e.prototype.writeQuery=function(t){var r=this.cache.writeQuery(t);return t.broadcast!==!1&&this.queryManager.broadcastQueries(),r},e.prototype.writeFragment=function(t){var r=this.cache.writeFragment(t);return t.broadcast!==!1&&this.queryManager.broadcastQueries(),r},e.prototype.__actionHookForDevTools=function(t){this.devToolsHookCb=t},e.prototype.__requestRaw=function(t){return In(this.link,t)},e.prototype.resetStore=function(){var t=this;return Promise.resolve().then(function(){return t.queryManager.clearStore({discardWatches:!1})}).then(function(){return Promise.all(t.resetStoreCallbacks.map(function(r){return r()}))}).then(function(){return t.reFetchObservableQueries()})},e.prototype.clearStore=function(){var t=this;return Promise.resolve().then(function(){return t.queryManager.clearStore({discardWatches:!0})}).then(function(){return Promise.all(t.clearStoreCallbacks.map(function(r){return r()}))})},e.prototype.onResetStore=function(t){var r=this;return this.resetStoreCallbacks.push(t),function(){r.resetStoreCallbacks=r.resetStoreCallbacks.filter(function(n){return n!==t})}},e.prototype.onClearStore=function(t){var r=this;return this.clearStoreCallbacks.push(t),function(){r.clearStoreCallbacks=r.clearStoreCallbacks.filter(function(n){return n!==t})}},e.prototype.reFetchObservableQueries=function(t){return this.queryManager.reFetchObservableQueries(t)},e.prototype.refetchQueries=function(t){var r=this.queryManager.refetchQueries(t),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__&&A.debug("In client.refetchQueries, Promise.all promise rejected with error ".concat(o))}),a},e.prototype.getObservableQueries=function(t){return t===void 0&&(t="active"),this.queryManager.getObservableQueries(t)},e.prototype.extract=function(t){return this.cache.extract(t)},e.prototype.restore=function(t){return this.cache.restore(t)},e.prototype.addResolvers=function(t){this.localState.addResolvers(t)},e.prototype.setResolvers=function(t){this.localState.setResolvers(t)},e.prototype.getResolvers=function(){return this.localState.getResolvers()},e.prototype.setLocalStateFragmentMatcher=function(t){this.localState.setFragmentMatcher(t)},e.prototype.setLink=function(t){this.link=this.queryManager.link=t},e}();_u(Dr?"log":"silent");function Qe(e){return e===null?"null":Array.isArray(e)?"array":typeof e}function Kt(e){return Qe(e)==="object"}function lf(e){return Array.isArray(e)&&e.length>0&&e.every(t=>"message"in t)}function cc(e,t){return e.length<124?e:t}var ff="graphql-transport-ws";var Ze;(function(e){e[e.InternalServerError=4500]="InternalServerError",e[e.InternalClientError=4005]="InternalClientError",e[e.BadRequest=4400]="BadRequest",e[e.BadResponse=4004]="BadResponse",e[e.Unauthorized=4401]="Unauthorized",e[e.Forbidden=4403]="Forbidden",e[e.SubprotocolNotAcceptable=4406]="SubprotocolNotAcceptable",e[e.ConnectionInitialisationTimeout=4408]="ConnectionInitialisationTimeout",e[e.ConnectionAcknowledgementTimeout=4504]="ConnectionAcknowledgementTimeout",e[e.SubscriberAlreadyExists=4409]="SubscriberAlreadyExists",e[e.TooManyInitialisationRequests=4429]="TooManyInitialisationRequests"})(Ze||(Ze={}));var we;(function(e){e.ConnectionInit="connection_init",e.ConnectionAck="connection_ack",e.Ping="ping",e.Pong="pong",e.Subscribe="subscribe",e.Next="next",e.Error="error",e.Complete="complete"})(we||(we={}));function pf(e){if(!Kt(e))throw new Error(`Message is expected to be an object, but got ${Qe(e)}`);if(!e.type)throw new Error("Message is missing the 'type' property");if(typeof e.type!="string")throw new Error(`Message is expects the 'type' property to be a string, but got ${Qe(e.type)}`);switch(e.type){case we.ConnectionInit:case we.ConnectionAck:case we.Ping:case we.Pong:{if(e.payload!=null&&!Kt(e.payload))throw new Error(`"${e.type}" message expects the 'payload' property to be an object or nullish or missing, but got "${e.payload}"`);break}case we.Subscribe:{if(typeof e.id!="string")throw new Error(`"${e.type}" message expects the 'id' property to be a string, but got ${Qe(e.id)}`);if(!e.id)throw new Error(`"${e.type}" message requires a non-empty 'id' property`);if(!Kt(e.payload))throw new Error(`"${e.type}" message expects the 'payload' property to be an object, but got ${Qe(e.payload)}`);if(typeof e.payload.query!="string")throw new Error(`"${e.type}" message payload expects the 'query' property to be a string, but got ${Qe(e.payload.query)}`);if(e.payload.variables!=null&&!Kt(e.payload.variables))throw new Error(`"${e.type}" message payload expects the 'variables' property to be a an object or nullish or missing, but got ${Qe(e.payload.variables)}`);if(e.payload.operationName!=null&&Qe(e.payload.operationName)!=="string")throw new Error(`"${e.type}" message payload expects the 'operationName' property to be a string or nullish or missing, but got ${Qe(e.payload.operationName)}`);if(e.payload.extensions!=null&&!Kt(e.payload.extensions))throw new Error(`"${e.type}" message payload expects the 'extensions' property to be a an object or nullish or missing, but got ${Qe(e.payload.extensions)}`);break}case we.Next:{if(typeof e.id!="string")throw new Error(`"${e.type}" message expects the 'id' property to be a string, but got ${Qe(e.id)}`);if(!e.id)throw new Error(`"${e.type}" message requires a non-empty 'id' property`);if(!Kt(e.payload))throw new Error(`"${e.type}" message expects the 'payload' property to be an object, but got ${Qe(e.payload)}`);break}case we.Error:{if(typeof e.id!="string")throw new Error(`"${e.type}" message expects the 'id' property to be a string, but got ${Qe(e.id)}`);if(!e.id)throw new Error(`"${e.type}" message requires a non-empty 'id' property`);if(!lf(e.payload))throw new Error(`"${e.type}" message expects the 'payload' property to be an array of GraphQL errors, but got ${JSON.stringify(e.payload)}`);break}case we.Complete:{if(typeof e.id!="string")throw new Error(`"${e.type}" message expects the 'id' property to be a string, but got ${Qe(e.id)}`);if(!e.id)throw new Error(`"${e.type}" message requires a non-empty 'id' property`);break}default:throw new Error(`Invalid message 'type' property "${e.type}"`)}return e}function df(e,t){return pf(typeof e=="string"?JSON.parse(e,t):e)}function Rn(e,t){return pf(e),JSON.stringify(e,t)}function hf(e){let{url:t,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(ce){let ue=1e3;for(let J=0;J<ce;J++)ue*=2;await new Promise(J=>setTimeout(J,ue+Math.floor(Math.random()*(3e3-300)+300)))},shouldRetry:d=Ha,isFatalConnectionProblem:p,on:f,webSocketImpl:h,generateID:g=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,ce=>{let ue=Math.random()*16|0;return(ce=="x"?ue:ue&3|8).toString(16)})},jsonMessageReplacer:y,jsonMessageReviver:S}=e,b;if(h){if(!bm(h))throw new Error("Invalid WebSocket implementation provided");b=h}else typeof WebSocket<"u"?b=WebSocket:typeof global<"u"?b=global.WebSocket||global.MozWebSocket:typeof window<"u"&&(b=window.WebSocket||window.MozWebSocket);if(!b)throw new Error("WebSocket implementation missing; on Node you can `import WebSocket from 'ws';` and pass `webSocketImpl: WebSocket` to `createClient`");let v=b,m=(()=>{let U=(()=>{let ue={};return{on(J,Y){return ue[J]=Y,()=>{delete ue[J]}},emit(J){var Y;"id"in J&&((Y=ue[J.id])===null||Y===void 0||Y.call(ue,J))}}})(),ce={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?[U.emit,f.message]:[U.emit],closed:f?.closed?[f.closed]:[],error:f?.error?[f.error]:[]};return{onMessage:U.on,on(ue,J){let Y=ce[ue];return Y.push(J),()=>{Y.splice(Y.indexOf(J),1)}},emit(ue,...J){for(let Y of[...ce[ue]])Y(...J)}}})();function O(U){let ce=[m.on("error",ue=>{ce.forEach(J=>J()),U(ue)}),m.on("closed",ue=>{ce.forEach(J=>J()),U(ue)})]}let N,T=0,D,R=!1,C=0,j=!1;async function Pe(){clearTimeout(D);let[U,ce]=await(N??(N=new Promise((Y,At)=>(async()=>{if(R){if(await l(C),!T)return N=void 0,At({code:1e3,reason:"All Subscriptions Gone"});C++}m.emit("connecting");let z=new v(typeof t=="function"?await t():t,ff),Dt,tr;function pa(){isFinite(o)&&o>0&&(clearTimeout(tr),tr=setTimeout(()=>{z.readyState===v.OPEN&&(z.send(Rn({type:we.Ping})),m.emit("ping",!1,void 0))},o))}O(Le=>{N=void 0,clearTimeout(Dt),clearTimeout(tr),At(Le),Ha(Le)&&Le.code===4499&&(z.close(4499,"Terminated"),z.onerror=null,z.onclose=null)}),z.onerror=Le=>m.emit("error",Le),z.onclose=Le=>m.emit("closed",Le),z.onopen=async()=>{try{m.emit("opened",z);let Le=typeof r=="function"?await r():r;if(z.readyState!==v.OPEN)return;z.send(Rn(Le?{type:we.ConnectionInit,payload:Le}:{type:we.ConnectionInit},y)),isFinite(u)&&u>0&&(Dt=setTimeout(()=>{z.close(Ze.ConnectionAcknowledgementTimeout,"Connection acknowledgement timeout")},u)),pa()}catch(Le){m.emit("error",Le),z.close(Ze.InternalClientError,cc(Le instanceof Error?Le.message:new Error(Le).message,"Internal client error"))}};let yn=!1;z.onmessage=({data:Le})=>{try{let Fe=df(Le,S);if(m.emit("message",Fe),Fe.type==="ping"||Fe.type==="pong"){m.emit(Fe.type,!0,Fe.payload),Fe.type==="pong"?pa():s||(z.send(Rn(Fe.payload?{type:we.Pong,payload:Fe.payload}:{type:we.Pong})),m.emit("pong",!1,Fe.payload));return}if(yn)return;if(Fe.type!==we.ConnectionAck)throw new Error(`First message cannot be of type ${Fe.type}`);clearTimeout(Dt),yn=!0,m.emit("connected",z,Fe.payload),R=!1,C=0,Y([z,new Promise((Ub,kd)=>O(kd))])}catch(Fe){z.onmessage=null,m.emit("error",Fe),z.close(Ze.BadResponse,cc(Fe instanceof Error?Fe.message:new Error(Fe).message,"Bad response"))}}})())));U.readyState===v.CLOSING&&await ce;let ue=()=>{},J=new Promise(Y=>ue=Y);return[U,ue,Promise.race([J.then(()=>{if(!T){let Y=()=>U.close(1e3,"Normal Closure");isFinite(a)&&a>0?D=setTimeout(()=>{U.readyState===v.OPEN&&Y()},a):Y()}}),ce])]}function Ie(U){if(Ha(U)&&(vm(U.code)||[Ze.InternalServerError,Ze.InternalClientError,Ze.BadRequest,Ze.BadResponse,Ze.Unauthorized,Ze.SubprotocolNotAcceptable,Ze.SubscriberAlreadyExists,Ze.TooManyInitialisationRequests].includes(U.code)))throw U;if(j)return!1;if(Ha(U)&&U.code===1e3)return T>0;if(!c||C>=c||!d(U)||p?.(U))throw U;return R=!0}return n||(async()=>{for(T++;;)try{let[,,U]=await Pe();await U}catch(U){try{if(!Ie(U))return}catch(ce){return i?.(ce)}}})(),{on:m.on,subscribe(U,ce){let ue=g(U),J=!1,Y=!1,At=()=>{T--,J=!0};return(async()=>{for(T++;;)try{let[z,Dt,tr]=await Pe();if(J)return Dt();let pa=m.onMessage(ue,yn=>{switch(yn.type){case we.Next:{ce.next(yn.payload);return}case we.Error:{Y=!0,J=!0,ce.error(yn.payload),At();return}case we.Complete:{J=!0,At();return}}});z.send(Rn({id:ue,type:we.Subscribe,payload:U},y)),At=()=>{!J&&z.readyState===v.OPEN&&z.send(Rn({id:ue,type:we.Complete},y)),T--,J=!0,Dt()},await tr.finally(pa);return}catch(z){if(!Ie(z))return}})().then(()=>{Y||ce.complete()}).catch(z=>{ce.error(z)}),()=>{J||At()}},async dispose(){if(j=!0,N){let[U]=await N;U.close(1e3,"Normal Closure")}},terminate(){N&&m.emit("closed",{code:4499,reason:"Terminated",wasClean:!1})}}}function Ha(e){return Kt(e)&&"code"in e&&"reason"in e}function vm(e){return[1e3,1001,1006,1005,1012,1013,1013].includes(e)?!1:e>=1e3&&e<=1999}function bm(e){return typeof e=="function"&&"constructor"in e&&"CLOSED"in e&&"CLOSING"in e&&"CONNECTING"in e&&"OPEN"in e}function _m(e){return Z(e)&&"code"in e&&"reason"in e}var mf=function(e){be(t,e);function t(r){var n=e.call(this)||this;return n.client=r,n}return t.prototype.request=function(r){var n=this;return new G(function(i){return n.client.subscribe(_(_({},r),{query:vn(r.query)}),{next:i.next.bind(i),complete:i.complete.bind(i),error:function(a){return a instanceof Error?i.error(a):_m(a)?i.error(new Error("Socket closed with event ".concat(a.code," ").concat(a.reason||""))):i.error(new Gt({graphQLErrors:Array.isArray(a)?a:[a]}))}})})},t}(ht);var xo=function(){return xo=Object.assign||function(t){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)&&(t[a]=r[a])}return t},xo.apply(this,arguments)};typeof SuppressedError=="function"&&SuppressedError;function co(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?co=function(r){return typeof r}:co=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},co(e)}function wm(e){return co(e)=="object"&&e!==null}var Tp=typeof Symbol=="function"&&Symbol.toStringTag!=null?Symbol.toStringTag:"@@toStringTag";function Ac(e,t){for(var r=/\r\n|[\n\r]/g,n=1,i=t+1,a;(a=r.exec(e.body))&&a.index<t;)n+=1,i=t+1-(a.index+a[0].length);return{line:n,column:i}}function Sm(e){return Ip(e.source,Ac(e.source,e.start))}function Ip(e,t){var r=e.locationOffset.column-1,n=uo(r)+e.body,i=t.line-1,a=e.locationOffset.line-1,o=t.line+a,s=t.line===1?r:0,u=t.column+s,c="".concat(e.name,":").concat(o,":").concat(u,`
|
|
49
|
+
`)),t=t.replace(/\n$/,""),t},Gt=function(e){be(t,e);function t(r){var n=r.graphQLErrors,i=r.clientErrors,a=r.networkError,o=r.errorMessage,s=r.extraInfo,u=e.call(this,o)||this;return u.name="ApolloError",u.graphQLErrors=n||[],u.clientErrors=i||[],u.networkError=a||null,u.message=o||dm(u),u.extraInfo=s,u.__proto__=t.prototype,u}return t}(Error);var te;(function(e){e[e.loading=1]="loading",e[e.setVariables=2]="setVariables",e[e.fetchMore=3]="fetchMore",e[e.refetch=4]="refetch",e[e.poll=6]="poll",e[e.ready=7]="ready",e[e.error=8]="error"})(te||(te={}));function fr(e){return e?e<7:!1}var hm=Object.assign,mm=Object.hasOwnProperty,za=function(e){be(t,e);function t(r){var n=r.queryManager,i=r.queryInfo,a=r.options,o=e.call(this,function(y){try{var S=y._subscription._observer;S&&!S.error&&(S.error=gm)}catch{}var b=!o.observers.size;o.observers.add(y);var v=o.last;return v&&v.error?y.error&&y.error(v.error):v&&v.result&&y.next&&y.next(v.result),b&&o.reobserve().catch(function(){}),function(){o.observers.delete(y)&&!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=_(_({},a),{initialFetchPolicy:h,fetchPolicy:p}),o.queryId=i.queryId||n.generateQueryId();var g=Ct(o.query);return o.queryName=g&&g.name&&g.name.value,o}return Object.defineProperty(t.prototype,"query",{get:function(){return this.queryManager.transform(this.options.query).document},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"variables",{get:function(){return this.options.variables},enumerable:!1,configurable:!0}),t.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)})},t.prototype.getCurrentResult=function(r){r===void 0&&(r=!0);var n=this.getLastResult(!0),i=this.queryInfo.networkStatus||n&&n.networkStatus||te.ready,a=_(_({},n),{loading:fr(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),de(a.data,{})&&(a.data=void 0),u.complete?(delete a.partial,u.complete&&a.networkStatus===te.loading&&(s==="cache-first"||s==="cache-only")&&(a.networkStatus=te.ready,a.loading=!1)):a.partial=!0,__DEV__&&!u.complete&&!this.options.partialRefetch&&!a.loading&&!a.data&&!a.error&&ac(u.missing)}return r&&this.updateLastResult(a),a},t.prototype.isDifferentFromLastResult=function(r,n){return!this.last||!de(this.last.result,r)||n&&!de(this.last.variables,n)},t.prototype.getLast=function(r,n){var i=this.last;if(i&&i[r]&&(!n||de(i.variables,this.variables)))return i[r]},t.prototype.getLastResult=function(r){return this.getLast("result",r)},t.prototype.getLastError=function(r){return this.getLast("error",r)},t.prototype.resetLastResults=function(){delete this.last,this.isTornDown=!1},t.prototype.resetQueryStoreErrors=function(){this.queryManager.resetErrors(this.queryId)},t.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&&mm.call(r,"variables")){var o=li(this.query),s=o.variableDefinitions;(!s||!s.some(function(u){return u.variable.name.value==="variables"}))&&__DEV__&&A.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&&!de(this.options.variables,r)&&(i.variables=this.options.variables=_(_({},this.options.variables),r)),this.queryInfo.resetLastWrite(),this.reobserve(i,te.refetch)},t.prototype.fetchMore=function(r){var n=this,i=_(_({},r.query?r:_(_(_(_({},this.options),{query:this.query}),r),{variables:_(_({},this.options.variables),r.variables)})),{fetchPolicy:"no-cache"}),a=this.queryManager.generateQueryId(),o=this.queryInfo,s=o.networkStatus;o.networkStatus=te.fetchMore,i.notifyOnNetworkStatusChange&&this.observe();var u=new Set;return this.queryManager.fetchQuery(a,i,te.fetchMore).then(function(c){return n.queryManager.removeQuery(a),o.networkStatus===te.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)||ic(n)})},t.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__&&A.error("Unhandled GraphQL subscription error",a)}});return this.subscriptions.add(i),function(){n.subscriptions.delete(i)&&i.unsubscribe()}},t.prototype.setOptions=function(r){return this.reobserve(r)},t.prototype.setVariables=function(r){return de(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},te.setVariables):Promise.resolve())},t.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())},t.prototype.startPolling=function(r){this.options.pollInterval=r,this.updatePolling()},t.prototype.stopPolling=function(){this.options.pollInterval=0,this.updatePolling()},t.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},t.prototype.fetch=function(r,n){return this.queryManager.setObservableQuery(this),this.queryManager.fetchQueryObservable(this.queryId,r,n)},t.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__?A(a,"Attempted to start a polling query without a polling interval."):A(a,13);var o=i||(this.pollingInfo={});o.interval=a;var s=function(){r.pollingInfo&&(fr(r.queryInfo.networkStatus)?u():r.reobserve({fetchPolicy:r.options.initialFetchPolicy==="no-cache"?"no-cache":"network-only"},te.poll).then(u,u))},u=function(){var c=r.pollingInfo;c&&(clearTimeout(c.timeout),c.timeout=setTimeout(s,c.interval))};u()}}},t.prototype.updateLastResult=function(r,n){return n===void 0&&(n=this.variables),this.last=_(_({},this.last),{result:this.queryManager.assumeImmutableResults?r:Ea(r),variables:n}),ke(r.errors)||delete this.last.error,this.last},t.prototype.reobserve=function(r,n){var i=this;this.isTornDown=!1;var a=n===te.refetch||n===te.fetchMore||n===te.poll,o=this.options.variables,s=this.options.fetchPolicy,u=sr(this.options,r||{}),c=a?u:hm(this.options,u);a||(this.updatePolling(),r&&r.variables&&!de(r.variables,o)&&c.fetchPolicy!=="standby"&&c.fetchPolicy===s&&(this.applyNextFetchPolicy("variables-changed",c),n===void 0&&(n=te.setVariables)));var l=c.variables&&_({},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},t.prototype.observe=function(){this.reportResult(this.getCurrentResult(!1),this.variables)},t.prototype.reportResult=function(r,n){var i=this.getLastError();(i||this.isDifferentFromLastResult(r,n))&&((i||!r.partial||this.options.returnPartialData)&&this.updateLastResult(r,n),$r(this.observers,"next",r))},t.prototype.reportError=function(r,n){var i=_(_({},this.getLastResult()),{error:r,errors:r.graphQLErrors,networkStatus:te.error,loading:!1});this.updateLastResult(i,n),$r(this.observers,"error",this.last.error=r)},t.prototype.hasObservers=function(){return this.observers.size>0},t.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)},t}(G);Ta(za);function ic(e){var t=e.options,r=t.fetchPolicy,n=t.nextFetchPolicy;return r==="cache-and-network"||r==="network-only"?e.reobserve({fetchPolicy:"cache-first",nextFetchPolicy:function(){return this.nextFetchPolicy=n,typeof n=="function"?n.apply(this,arguments):r}}):e.reobserve()}function gm(e){__DEV__&&A.error("Unhandled error",e.message,e.stack)}function ac(e){__DEV__&&e&&__DEV__&&A.debug("Missing cache result fields: ".concat(JSON.stringify(e)),e)}var Ga=function(){function e(t){var r=t.cache,n=t.client,i=t.resolvers,a=t.fragmentMatcher;this.selectionsToResolveCache=new WeakMap,this.cache=r,n&&(this.client=n),i&&this.addResolvers(i),a&&this.setFragmentMatcher(a)}return e.prototype.addResolvers=function(t){var r=this;this.resolvers=this.resolvers||{},Array.isArray(t)?t.forEach(function(n){r.resolvers=vs(r.resolvers,n)}):this.resolvers=vs(this.resolvers,t)},e.prototype.setResolvers=function(t){this.resolvers={},this.addResolvers(t)},e.prototype.getResolvers=function(){return this.resolvers||{}},e.prototype.runResolvers=function(t){var r=t.document,n=t.remoteResult,i=t.context,a=t.variables,o=t.onlyRunForcedResolvers,s=o===void 0?!1:o;return bt(this,void 0,void 0,function(){return _t(this,function(u){return r?[2,this.resolveDocument(r,n.data,i,a,this.fragmentMatcher,s).then(function(c){return _(_({},n),{data:c.result})})]:[2,n]})})},e.prototype.setFragmentMatcher=function(t){this.fragmentMatcher=t},e.prototype.getFragmentMatcher=function(){return this.fragmentMatcher},e.prototype.clientQuery=function(t){return bn(["client"],t)&&this.resolvers?t:null},e.prototype.serverQuery=function(t){return ys(t)},e.prototype.prepareContext=function(t){var r=this.cache;return _(_({},t),{cache:r,getCacheKey:function(n){return r.identify(n)}})},e.prototype.addExportedVariables=function(t,r,n){return r===void 0&&(r={}),n===void 0&&(n={}),bt(this,void 0,void 0,function(){return _t(this,function(i){return t?[2,this.resolveDocument(t,this.buildRootValueFromCache(t,r)||{},this.prepareContext(n),r).then(function(a){return _(_({},r),a.exportedVariables)})]:[2,_({},r)]})})},e.prototype.shouldForceResolvers=function(t){var r=!1;return Be(t,{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 Nr}}}),r},e.prototype.buildRootValueFromCache=function(t,r){return this.cache.diff({query:gs(t),variables:r,returnPartialData:!0,optimistic:!1}).result},e.prototype.resolveDocument=function(t,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),bt(this,void 0,void 0,function(){var s,u,c,l,d,p,f,h,g,y,S;return _t(this,function(b){return s=Lr(t),u=Pr(t),c=Rr(u),l=this.collectSelectionsToResolve(s,c),d=s.operation,p=d?d.charAt(0).toUpperCase()+d.slice(1):"Query",f=this,h=f.cache,g=f.client,y={fragmentMap:c,context:_(_({},n),{cache:h,client:g}),variables:i,fragmentMatcher:a,defaultOperationType:p,exportedVariables:{},selectionsToResolve:l,onlyRunForcedResolvers:o},S=!1,[2,this.resolveSelectionSet(s.selectionSet,S,r,y).then(function(v){return{result:v,exportedVariables:y.exportedVariables}})]})})},e.prototype.resolveSelectionSet=function(t,r,n,i){return bt(this,void 0,void 0,function(){var a,o,s,u,c,l=this;return _t(this,function(d){return a=i.fragmentMap,o=i.context,s=i.variables,u=[n],c=function(p){return bt(l,void 0,void 0,function(){var f,h;return _t(this,function(g){return!r&&!i.selectionsToResolve.has(p)?[2]:Qt(p,s)?it(p)?[2,this.resolveField(p,r,n,i).then(function(y){var S;typeof y<"u"&&u.push((S={},S[pt(p)]=y,S))})]:(ps(p)?f=p:(f=a[p.name.value],__DEV__?A(f,"No fragment named ".concat(p.name.value)):A(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(y){u.push(y)})]:[2]):[2]})})},[2,Promise.all(t.selections.map(c)).then(function(){return fi(u)})]})})},e.prototype.resolveField=function(t,r,n,i){return bt(this,void 0,void 0,function(){var a,o,s,u,c,l,d,p,f,h=this;return _t(this,function(g){return n?(a=i.variables,o=t.name.value,s=pt(t),u=o!==s,c=n[s]||n[o],l=Promise.resolve(c),(!i.onlyRunForcedResolvers||this.shouldForceResolvers(t))&&(d=n.__typename||i.defaultOperationType,p=this.resolvers&&this.resolvers[d],p&&(f=p[u?o:s],f&&(l=Promise.resolve(Dn.withValue(this.cache,f,[n,zt(t,a),i.context,{field:t,fragmentMap:i.fragmentMap}]))))),[2,l.then(function(y){var S,b;if(y===void 0&&(y=c),t.directives&&t.directives.forEach(function(m){m.name.value==="export"&&m.arguments&&m.arguments.forEach(function(O){O.name.value==="as"&&O.value.kind==="StringValue"&&(i.exportedVariables[O.value.value]=y)})}),!t.selectionSet||y==null)return y;var v=(b=(S=t.directives)===null||S===void 0?void 0:S.some(function(m){return m.name.value==="client"}))!==null&&b!==void 0?b:!1;if(Array.isArray(y))return h.resolveSubSelectedArray(t,r||v,y,i);if(t.selectionSet)return h.resolveSelectionSet(t.selectionSet,r||v,y,i)})]):[2,null]})})},e.prototype.resolveSubSelectedArray=function(t,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(t,r,o,i);if(t.selectionSet)return a.resolveSelectionSet(t.selectionSet,r,o,i)}))},e.prototype.collectSelectionsToResolve=function(t,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),Be(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__?A(f,"No fragment named ".concat(u.name.value)):A(f,12);var h=a(f);h.size>0&&(p.forEach(function(g){n(g)&&oi(g)&&s.add(g)}),s.add(u),h.forEach(function(g){s.add(g)}))}})}return i.get(o)}return a(t)},e}();var Rn=new(dt?WeakMap:Map);function oc(e,t){var r=e[t];typeof r=="function"&&(e[t]=function(){return Rn.set(e,(Rn.get(e)+1)%1e15),r.apply(this,arguments)})}function sf(e){e.notifyTimeout&&(clearTimeout(e.notifyTimeout),e.notifyTimeout=void 0)}var Ka=function(){function e(t,r){r===void 0&&(r=t.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=t.cache;Rn.has(n)||(Rn.set(n,0),oc(n,"evict"),oc(n,"modify"),oc(n,"reset"))}return e.prototype.init=function(t){var r=t.networkStatus||te.loading;return this.variables&&this.networkStatus!==te.loading&&!de(this.variables,t.variables)&&(r=te.setVariables),de(t.variables,this.variables)||(this.lastDiff=void 0),Object.assign(this,{document:t.document,variables:t.variables,networkError:null,graphQLErrors:this.graphQLErrors||[],networkStatus:r}),t.observableQuery&&this.setObservableQuery(t.observableQuery),t.lastRequestId&&(this.lastRequestId=t.lastRequestId),this},e.prototype.reset=function(){sf(this),this.dirty=!1},e.prototype.getDiff=function(t){t===void 0&&(t=this.variables);var r=this.getDiffOptions(t);if(this.lastDiff&&de(r,this.lastDiff.options))return this.lastDiff.diff;this.updateWatch(this.variables=t);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},e.prototype.updateLastDiff=function(t,r){this.lastDiff=t?{diff:t,options:r||this.getDiffOptions()}:void 0},e.prototype.getDiffOptions=function(t){var r;return t===void 0&&(t=this.variables),{query:this.document,variables:t,returnPartialData:!0,optimistic:!0,canonizeResults:(r=this.observableQuery)===null||r===void 0?void 0:r.options.canonizeResults}},e.prototype.setDiff=function(t){var r=this,n=this.lastDiff&&this.lastDiff.diff;this.updateLastDiff(t),!this.dirty&&!de(n&&n.result,t&&t.result)&&(this.dirty=!0,this.notifyTimeout||(this.notifyTimeout=setTimeout(function(){return r.notify()},0)))},e.prototype.setObservableQuery=function(t){var r=this;t!==this.observableQuery&&(this.oqListener&&this.listeners.delete(this.oqListener),this.observableQuery=t,t?(t.queryInfo=this,this.listeners.add(this.oqListener=function(){var n=r.getDiff();n.fromOptimisticTransaction?t.observe():ic(t)})):delete this.oqListener)},e.prototype.notify=function(){var t=this;sf(this),this.shouldNotify()&&this.listeners.forEach(function(r){return r(t)}),this.dirty=!1},e.prototype.shouldNotify=function(){if(!this.dirty||!this.listeners.size)return!1;if(fr(this.networkStatus)&&this.observableQuery){var t=this.observableQuery.options.fetchPolicy;if(t!=="cache-only"&&t!=="cache-and-network")return!1}return!0},e.prototype.stop=function(){if(!this.stopped){this.stopped=!0,this.reset(),this.cancel(),this.cancel=e.prototype.cancel,this.subscriptions.forEach(function(r){return r.unsubscribe()});var t=this.observableQuery;t&&t.stopPolling()}},e.prototype.cancel=function(){},e.prototype.updateWatch=function(t){var r=this;t===void 0&&(t=this.variables);var n=this.observableQuery;if(!(n&&n.options.fetchPolicy==="no-cache")){var i=_(_({},this.getDiffOptions(t)),{watcher:this,callback:function(a){return r.setDiff(a)}});(!this.lastWatch||!de(i,this.lastWatch))&&(this.cancel(),this.cancel=this.cache.watch(this.lastWatch=i))}},e.prototype.resetLastWrite=function(){this.lastWrite=void 0},e.prototype.shouldWrite=function(t,r){var n=this.lastWrite;return!(n&&n.dmCount===Rn.get(this.cache)&&de(r,n.variables)&&de(t.data,n.result.data))},e.prototype.markResult=function(t,r,n,i){var a=this,o=new Ye,s=ke(t.errors)?t.errors.slice(0):[];if(this.reset(),"incremental"in t&&ke(t.incremental)){var u=Ia(this.getDiff().result,t);t.data=u}else if("hasNext"in t&&t.hasNext){var c=this.getDiff();t.data=o.merge(c.result,t.data)}this.graphQLErrors=s,n.fetchPolicy==="no-cache"?this.updateLastDiff({result:t.data,complete:!0},this.getDiffOptions(n.variables)):i!==0&&(Wa(t,n.errorPolicy)?this.cache.performTransaction(function(l){if(a.shouldWrite(t,n.variables))l.writeQuery({query:r,data:t.data,variables:n.variables,overwrite:i===1}),a.lastWrite={result:t,variables:n.variables,dmCount:Rn.get(a.cache)};else if(a.lastDiff&&a.lastDiff.diff.complete){t.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&&(t.data=p.result)}):this.lastWrite=void 0)},e.prototype.markReady=function(){return this.networkError=null,this.networkStatus=te.ready},e.prototype.markError=function(t){return this.networkStatus=te.error,this.lastWrite=void 0,this.reset(),t.graphQLErrors&&(this.graphQLErrors=t.graphQLErrors),t.networkError&&(this.networkError=t.networkError),t},e}();function Wa(e,t){t===void 0&&(t="none");var r=t==="ignore"||t==="all",n=!Tn(e);return!n&&r&&e.data&&(n=!0),n}var ym=Object.prototype.hasOwnProperty,cf=function(){function e(t){var r=t.cache,n=t.link,i=t.defaultOptions,a=t.queryDeduplication,o=a===void 0?!1:a,s=t.onBroadcast,u=t.ssrMode,c=u===void 0?!1:u,l=t.clientAwareness,d=l===void 0?{}:l,p=t.localState,f=t.assumeImmutableResults;this.clientAwareness={},this.queries=new Map,this.fetchCancelFns=new Map,this.transformCache=new(dt?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 Ga({cache:r}),this.ssrMode=c,this.assumeImmutableResults=!!f,(this.onBroadcast=s)&&(this.mutationStore=Object.create(null))}return e.prototype.stop=function(){var t=this;this.queries.forEach(function(r,n){t.stopQueryNoBroadcast(n)}),this.cancelPendingFetches(__DEV__?new q("QueryManager stopped while query was in flight"):new q(14))},e.prototype.cancelPendingFetches=function(t){this.fetchCancelFns.forEach(function(r){return r(t)}),this.fetchCancelFns.clear()},e.prototype.mutate=function(t){var r,n,i=t.mutation,a=t.variables,o=t.optimisticResponse,s=t.updateQueries,u=t.refetchQueries,c=u===void 0?[]:u,l=t.awaitRefetchQueries,d=l===void 0?!1:l,p=t.update,f=t.onQueryUpdated,h=t.fetchPolicy,g=h===void 0?((r=this.defaultOptions.mutate)===null||r===void 0?void 0:r.fetchPolicy)||"network-only":h,y=t.errorPolicy,S=y===void 0?((n=this.defaultOptions.mutate)===null||n===void 0?void 0:n.errorPolicy)||"none":y,b=t.keepRootFields,v=t.context;return bt(this,void 0,void 0,function(){var m,O,N,T,D,C;return _t(this,function(R){switch(R.label){case 0:return __DEV__?A(i,"mutation option is required. You must specify your GraphQL document in the mutation option."):A(i,15),__DEV__?A(g==="network-only"||g==="no-cache","Mutations support only 'network-only' or 'no-cache' fetchPolicy strings. The default `network-only` behavior automatically writes mutation results to the cache. Passing `no-cache` skips the cache write."):A(g==="network-only"||g==="no-cache",16),m=this.generateMutationId(),O=this.transform(i),N=O.document,T=O.hasClientExports,i=this.cache.transformForLink(N),a=this.getVariables(i,a),T?[4,this.localState.addExportedVariables(i,a,v)]:[3,2];case 1:a=R.sent(),R.label=2;case 2:return D=this.mutationStore&&(this.mutationStore[m]={mutation:i,variables:a,loading:!0,error:null}),o&&this.markMutationOptimistic(o,{mutationId:m,document:i,variables:a,fetchPolicy:g,errorPolicy:S,context:v,updateQueries:s,update:p,keepRootFields:b}),this.broadcastQueries(),C=this,[2,new Promise(function(j,Pe){return xa(C.getObservableFromLink(i,_(_({},v),{optimisticResponse:o}),a,!1),function(Ie){if(Tn(Ie)&&S==="none")throw new Gt({graphQLErrors:ka(Ie)});D&&(D.loading=!1,D.error=null);var U=_({},Ie);return typeof c=="function"&&(c=c(U)),S==="ignore"&&Tn(U)&&delete U.errors,C.markMutationResult({mutationId:m,result:U,document:i,variables:a,fetchPolicy:g,errorPolicy:S,context:v,update:p,updateQueries:s,awaitRefetchQueries:d,refetchQueries:c,removeOptimistic:o?m:void 0,onQueryUpdated:f,keepRootFields:b})}).subscribe({next:function(Ie){C.broadcastQueries(),(!("hasNext"in Ie)||Ie.hasNext===!1)&&j(Ie)},error:function(Ie){D&&(D.loading=!1,D.error=Ie),o&&C.cache.removeOptimistic(m),C.broadcastQueries(),Pe(Ie instanceof Gt?Ie:new Gt({networkError:Ie}))}})})]}})})},e.prototype.markMutationResult=function(t,r){var n=this;r===void 0&&(r=this.cache);var i=t.result,a=[],o=t.fetchPolicy==="no-cache";if(!o&&Wa(i,t.errorPolicy)){if(or(i)||a.push({result:i.data,dataId:"ROOT_MUTATION",query:t.document,variables:t.variables}),or(i)&&ke(i.incremental)){var s=r.diff({id:"ROOT_MUTATION",query:this.transform(t.document).asQuery,variables:t.variables,optimistic:!1,returnPartialData:!0}),u=void 0;s.result&&(u=Ia(s.result,i)),typeof u<"u"&&(i.data=u,a.push({result:u,dataId:"ROOT_MUTATION",query:t.document,variables:t.variables}))}var c=t.updateQueries;c&&this.queries.forEach(function(d,p){var f=d.observableQuery,h=f&&f.queryName;if(!(!h||!ym.call(c,h))){var g=c[h],y=n.queries.get(p),S=y.document,b=y.variables,v=r.diff({query:S,variables:b,returnPartialData:!0,optimistic:!1}),m=v.result,O=v.complete;if(O&&m){var N=g(m,{mutationResult:i,queryName:S&&wn(S)||void 0,queryVariables:b});N&&a.push({result:N,dataId:"ROOT_QUERY",query:S,variables:b})}}})}if(a.length>0||t.refetchQueries||t.update||t.onQueryUpdated||t.removeOptimistic){var l=[];if(this.refetchQueries({updateCache:function(d){o||a.forEach(function(g){return d.write(g)});var p=t.update,f=!Qu(i)||or(i)&&!i.hasNext;if(p){if(!o){var h=d.diff({id:"ROOT_MUTATION",query:n.transform(t.document).asQuery,variables:t.variables,optimistic:!1,returnPartialData:!0});h.complete&&(i=_(_({},i),{data:h.result}),"incremental"in i&&delete i.incremental,"hasNext"in i&&delete i.hasNext)}f&&p(d,i,{context:t.context,variables:t.variables})}!o&&!t.keepRootFields&&f&&d.modify({id:"ROOT_MUTATION",fields:function(g,y){var S=y.fieldName,b=y.DELETE;return S==="__typename"?g:b}})},include:t.refetchQueries,optimistic:!1,removeOptimistic:t.removeOptimistic,onQueryUpdated:t.onQueryUpdated||null}).forEach(function(d){return l.push(d)}),t.awaitRefetchQueries||t.onQueryUpdated)return Promise.all(l).then(function(){return i})}return Promise.resolve(i)},e.prototype.markMutationOptimistic=function(t,r){var n=this,i=typeof t=="function"?t(r.variables):t;return this.cache.recordOptimisticTransaction(function(a){try{n.markMutationResult(_(_({},r),{result:{data:i}}),a)}catch(o){__DEV__&&A.error(o)}},r.mutationId)},e.prototype.fetchQuery=function(t,r,n){return this.fetchQueryObservable(t,r,n).promise},e.prototype.getQueryStore=function(){var t=Object.create(null);return this.queries.forEach(function(r,n){t[n]={variables:r.variables,networkStatus:r.networkStatus,networkError:r.networkError,graphQLErrors:r.graphQLErrors}}),t},e.prototype.resetErrors=function(t){var r=this.queries.get(t);r&&(r.networkError=void 0,r.graphQLErrors=[])},e.prototype.transform=function(t){var r=this.transformCache;if(!r.has(t)){var n=this.cache.transformDocument(t),i=ms(n),a=this.localState.clientQuery(n),o=i&&this.localState.serverQuery(i),s={document:n,hasClientExports:cs(n),hasForcedResolvers:this.localState.shouldForceResolvers(n),clientQuery:a,serverQuery:o,defaultVars:Fr(Ct(n)),asQuery:_(_({},n),{definitions:n.definitions.map(function(c){return c.kind==="OperationDefinition"&&c.operation!=="query"?_(_({},c),{operation:"query"}):c})})},u=function(c){c&&!r.has(c)&&r.set(c,s)};u(t),u(n),u(a),u(o)}return r.get(t)},e.prototype.getVariables=function(t,r){return _(_({},this.transform(t).defaultVars),r)},e.prototype.watchQuery=function(t){t=_(_({},t),{variables:this.getVariables(t.query,t.variables)}),typeof t.notifyOnNetworkStatusChange>"u"&&(t.notifyOnNetworkStatusChange=!1);var r=new Ka(this),n=new za({queryManager:this,queryInfo:r,options:t});return this.queries.set(n.queryId,r),r.init({document:n.query,observableQuery:n,variables:n.variables}),n},e.prototype.query=function(t,r){var n=this;return r===void 0&&(r=this.generateQueryId()),__DEV__?A(t.query,"query option is required. You must specify your GraphQL document in the query option."):A(t.query,17),__DEV__?A(t.query.kind==="Document",'You must wrap the query string in a "gql" tag.'):A(t.query.kind==="Document",18),__DEV__?A(!t.returnPartialData,"returnPartialData option only supported on watchQuery."):A(!t.returnPartialData,19),__DEV__?A(!t.pollInterval,"pollInterval option only supported on watchQuery."):A(!t.pollInterval,20),this.fetchQuery(r,t).finally(function(){return n.stopQuery(r)})},e.prototype.generateQueryId=function(){return String(this.queryIdCounter++)},e.prototype.generateRequestId=function(){return this.requestIdCounter++},e.prototype.generateMutationId=function(){return String(this.mutationIdCounter++)},e.prototype.stopQueryInStore=function(t){this.stopQueryInStoreNoBroadcast(t),this.broadcastQueries()},e.prototype.stopQueryInStoreNoBroadcast=function(t){var r=this.queries.get(t);r&&r.stop()},e.prototype.clearStore=function(t){return t===void 0&&(t={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=te.loading:r.stop()}),this.mutationStore&&(this.mutationStore=Object.create(null)),this.cache.reset(t)},e.prototype.getObservableQueries=function(t){var r=this;t===void 0&&(t="active");var n=new Map,i=new Map,a=new Set;return Array.isArray(t)&&t.forEach(function(o){typeof o=="string"?i.set(o,!1):ls(o)?i.set(r.transform(o).document,!1):Z(o)&&o.query&&a.add(o)}),this.queries.forEach(function(o,s){var u=o.observableQuery,c=o.document;if(u){if(t==="all"){n.set(s,u);return}var l=u.queryName,d=u.options.fetchPolicy;if(d==="standby"||t==="active"&&!u.hasObservers())return;(t==="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=hi("legacyOneTimeQuery"),u=r.getQuery(s).init({document:o.query,variables:o.variables}),c=new za({queryManager:r,queryInfo:u,options:_(_({},o),{fetchPolicy:"network-only"})});A(c.queryId===s),u.setObservableQuery(c),n.set(s,c)}),__DEV__&&i.size&&i.forEach(function(o,s){o||__DEV__&&A.warn("Unknown query ".concat(typeof s=="string"?"named ":"").concat(JSON.stringify(s,null,2)," requested in refetchQueries options.include array"))}),n},e.prototype.reFetchObservableQueries=function(t){var r=this;t===void 0&&(t=!1);var n=[];return this.getObservableQueries(t?"all":"active").forEach(function(i,a){var o=i.options.fetchPolicy;i.resetLastResults(),(t||o!=="standby"&&o!=="cache-only")&&n.push(i.refetch()),r.getQuery(a).setDiff(null)}),this.broadcastQueries(),Promise.all(n)},e.prototype.setObservableQuery=function(t){this.getQuery(t.queryId).setObservableQuery(t)},e.prototype.startGraphQLSubscription=function(t){var r=this,n=t.query,i=t.fetchPolicy,a=t.errorPolicy,o=t.variables,s=t.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"&&(Wa(p,a)&&r.cache.write({query:n,result:p.data,dataId:"ROOT_SUBSCRIPTION",variables:d}),r.broadcastQueries()),Tn(p))throw new Gt({graphQLErrors:p.errors});return p})};if(this.transform(n).hasClientExports){var l=this.localState.addExportedVariables(n,o,u).then(c);return new G(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)},e.prototype.stopQuery=function(t){this.stopQueryNoBroadcast(t),this.broadcastQueries()},e.prototype.stopQueryNoBroadcast=function(t){this.stopQueryInStoreNoBroadcast(t),this.removeQuery(t)},e.prototype.removeQuery=function(t){this.fetchCancelFns.delete(t),this.queries.has(t)&&(this.getQuery(t).stop(),this.queries.delete(t))},e.prototype.broadcastQueries=function(){this.onBroadcast&&this.onBroadcast(),this.queries.forEach(function(t){return t.notify()})},e.prototype.getLocalState=function(){return this.localState},e.prototype.getObservableFromLink=function(t,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(t).serverQuery;if(u){var c=this,l=c.inFlightLinkObservables,d=c.link,p={query:u,variables:n,operationName:wn(u)||void 0,context:this.prepareContext(_(_({},r),{forceFetch:!i}))};if(r=p.context,i){var f=l.get(u)||new Map;l.set(u,f);var h=at(n);if(s=f.get(h),!s){var g=new xn([In(d,p)]);f.set(h,s=g),g.beforeNext(function(){f.delete(h)&&f.size<1&&l.delete(u)})}}else s=new xn([In(d,p)])}else s=new xn([G.of({data:{}})]),r=this.prepareContext(r);var y=this.transform(t).clientQuery;return y&&(s=xa(s,function(S){return a.localState.runResolvers({document:y,remoteResult:S,context:r,variables:n})})),s},e.prototype.getResultsFromLink=function(t,r,n){var i=t.lastRequestId=this.generateRequestId(),a=this.cache.transformForLink(this.transform(t.document).document);return xa(this.getObservableFromLink(a,n.context,n.variables),function(o){var s=ka(o),u=s.length>0;if(i>=t.lastRequestId){if(u&&n.errorPolicy==="none")throw t.markError(new Gt({graphQLErrors:s}));t.markResult(o,a,n,r),t.markReady()}var c={data:o.data,loading:!1,networkStatus:te.ready};return u&&n.errorPolicy!=="ignore"&&(c.errors=s,c.networkStatus=te.error),c},function(o){var s=of(o)?o:new Gt({networkError:o});throw i>=t.lastRequestId&&t.markError(s),s})},e.prototype.fetchQueryObservable=function(t,r,n){var i=this;n===void 0&&(n=te.loading);var a=this.transform(r.query).document,o=this.getVariables(a,r.variables),s=this.getQuery(t),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,g=r.notifyOnNetworkStatusChange,y=g===void 0?!1:g,S=r.context,b=S===void 0?{}:S,v=Object.assign({},r,{query:a,variables:o,fetchPolicy:l,errorPolicy:p,returnPartialData:h,notifyOnNetworkStatusChange:y,context:b}),m=function(T){v.variables=T;var D=i.fetchQueryByPolicy(s,v,n);return v.fetchPolicy!=="standby"&&D.length>0&&s.observableQuery&&s.observableQuery.applyNextFetchPolicy("after-fetch",r),D},O=function(){return i.fetchCancelFns.delete(t)};this.fetchCancelFns.set(t,function(T){O(),setTimeout(function(){return N.cancel(T)})});var N=new xn(this.transform(v.query).hasClientExports?this.localState.addExportedVariables(v.query,v.variables,v.context).then(m):m(v.variables));return N.promise.then(O,O),N},e.prototype.refetchQueries=function(t){var r=this,n=t.updateCache,i=t.include,a=t.optimistic,o=a===void 0?!1:a,s=t.removeOptimistic,u=s===void 0?o?hi("refetchQueries"):void 0:s,c=t.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 g=p.watcher instanceof Ka&&p.watcher.observableQuery;if(g){if(c){l.delete(g.queryId);var y=c(g,f,h);return y===!0&&(y=g.refetch()),y!==!1&&d.set(g,y),y}c!==null&&l.set(g.queryId,{oq:g,lastDiff:h,diff:f})}}}),l.size&&l.forEach(function(p,f){var h=p.oq,g=p.lastDiff,y=p.diff,S;if(c){if(!y){var b=h.queryInfo;b.reset(),y=b.getDiff()}S=c(h,y,g)}(!c||S===!0)&&(S=h.refetch()),S!==!1&&d.set(h,S),f.indexOf("legacyOneTimeQuery")>=0&&r.stopQueryNoBroadcast(f)}),u&&this.cache.removeOptimistic(u),d},e.prototype.fetchQueryByPolicy=function(t,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=t.networkStatus;t.init({document:this.transform(a).document,variables:o,networkStatus:n});var h=function(){return t.getDiff(o)},g=function(m,O){O===void 0&&(O=t.networkStatus||te.loading);var N=m.result;__DEV__&&!l&&!de(N,{})&&ac(m.missing);var T=function(D){return G.of(_({data:D,loading:fr(O),networkStatus:O},m.complete?null:{partial:!0}))};return N&&i.transform(a).hasForcedResolvers?i.localState.runResolvers({document:a,remoteResult:{data:N},context:d,variables:o,onlyRunForcedResolvers:!0}).then(function(D){return T(D.data||void 0)}):c==="none"&&O===te.refetch&&Array.isArray(m.missing)?T(void 0):T(N)},y=s==="no-cache"?0:n===te.refetch&&u!=="merge"?1:2,S=function(){return i.getResultsFromLink(t,y,{variables:o,context:d,fetchPolicy:s,errorPolicy:c})},b=p&&typeof f=="number"&&f!==n&&fr(n);switch(s){default:case"cache-first":{var v=h();return v.complete?[g(v,t.markReady())]:l||b?[g(v),S()]:[S()]}case"cache-and-network":{var v=h();return v.complete||l||b?[g(v),S()]:[S()]}case"cache-only":return[g(h(),t.markReady())];case"network-only":return b?[g(h()),S()]:[S()];case"no-cache":return b?[g(t.getDiff()),S()]:[S()];case"standby":return[]}},e.prototype.getQuery=function(t){return t&&!this.queries.has(t)&&this.queries.set(t,new Ka(this,t)),this.queries.get(t)},e.prototype.prepareContext=function(t){t===void 0&&(t={});var r=this.localState.prepareContext(t);return _(_({},r),{clientAwareness:this.clientAwareness})},e}();var uf=!1;var sc=function(){function e(t){var r=this;this.resetStoreCallbacks=[],this.clearStoreCallbacks=[];var n=t.uri,i=t.credentials,a=t.headers,o=t.cache,s=t.ssrMode,u=s===void 0?!1:s,c=t.ssrForceFetchDelay,l=c===void 0?0:c,d=t.connectToDevTools,p=d===void 0?typeof window=="object"&&!window.__APOLLO_CLIENT__&&__DEV__:d,f=t.queryDeduplication,h=f===void 0?!0:f,g=t.defaultOptions,y=t.assumeImmutableResults,S=y===void 0?!1:y,b=t.resolvers,v=t.typeDefs,m=t.fragmentMatcher,O=t.name,N=t.version,T=t.link;if(T||(T=n?new Ls({uri:n,credentials:i,headers:a}):ht.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=h,this.defaultOptions=g||Object.create(null),this.typeDefs=v,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),!uf&&p&&__DEV__&&(uf=!0,typeof window<"u"&&window.document&&window.top===window.self&&!window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__)){var D=window.navigator,C=D&&D.userAgent,R=void 0;typeof C=="string"&&(C.indexOf("Chrome/")>-1?R="https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm":C.indexOf("Firefox/")>-1&&(R="https://addons.mozilla.org/en-US/firefox/addon/apollo-developer-tools/")),R&&__DEV__&&A.log("Download the Apollo DevTools for a better development experience: "+R)}this.version=Wu,this.localState=new Ga({cache:o,client:this,resolvers:b,fragmentMatcher:m}),this.queryManager=new cf({cache:this.cache,link:this.link,defaultOptions:this.defaultOptions,queryDeduplication:h,ssrMode:u,clientAwareness:{name:O,version:N},localState:this.localState,assumeImmutableResults:S,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 e.prototype.stop=function(){this.queryManager.stop()},e.prototype.watchQuery=function(t){return this.defaultOptions.watchQuery&&(t=mi(this.defaultOptions.watchQuery,t)),this.disableNetworkFetches&&(t.fetchPolicy==="network-only"||t.fetchPolicy==="cache-and-network")&&(t=_(_({},t),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(t)},e.prototype.query=function(t){return this.defaultOptions.query&&(t=mi(this.defaultOptions.query,t)),__DEV__?A(t.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."):A(t.fetchPolicy!=="cache-and-network",10),this.disableNetworkFetches&&t.fetchPolicy==="network-only"&&(t=_(_({},t),{fetchPolicy:"cache-first"})),this.queryManager.query(t)},e.prototype.mutate=function(t){return this.defaultOptions.mutate&&(t=mi(this.defaultOptions.mutate,t)),this.queryManager.mutate(t)},e.prototype.subscribe=function(t){return this.queryManager.startGraphQLSubscription(t)},e.prototype.readQuery=function(t,r){return r===void 0&&(r=!1),this.cache.readQuery(t,r)},e.prototype.readFragment=function(t,r){return r===void 0&&(r=!1),this.cache.readFragment(t,r)},e.prototype.writeQuery=function(t){var r=this.cache.writeQuery(t);return t.broadcast!==!1&&this.queryManager.broadcastQueries(),r},e.prototype.writeFragment=function(t){var r=this.cache.writeFragment(t);return t.broadcast!==!1&&this.queryManager.broadcastQueries(),r},e.prototype.__actionHookForDevTools=function(t){this.devToolsHookCb=t},e.prototype.__requestRaw=function(t){return In(this.link,t)},e.prototype.resetStore=function(){var t=this;return Promise.resolve().then(function(){return t.queryManager.clearStore({discardWatches:!1})}).then(function(){return Promise.all(t.resetStoreCallbacks.map(function(r){return r()}))}).then(function(){return t.reFetchObservableQueries()})},e.prototype.clearStore=function(){var t=this;return Promise.resolve().then(function(){return t.queryManager.clearStore({discardWatches:!0})}).then(function(){return Promise.all(t.clearStoreCallbacks.map(function(r){return r()}))})},e.prototype.onResetStore=function(t){var r=this;return this.resetStoreCallbacks.push(t),function(){r.resetStoreCallbacks=r.resetStoreCallbacks.filter(function(n){return n!==t})}},e.prototype.onClearStore=function(t){var r=this;return this.clearStoreCallbacks.push(t),function(){r.clearStoreCallbacks=r.clearStoreCallbacks.filter(function(n){return n!==t})}},e.prototype.reFetchObservableQueries=function(t){return this.queryManager.reFetchObservableQueries(t)},e.prototype.refetchQueries=function(t){var r=this.queryManager.refetchQueries(t),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__&&A.debug("In client.refetchQueries, Promise.all promise rejected with error ".concat(o))}),a},e.prototype.getObservableQueries=function(t){return t===void 0&&(t="active"),this.queryManager.getObservableQueries(t)},e.prototype.extract=function(t){return this.cache.extract(t)},e.prototype.restore=function(t){return this.cache.restore(t)},e.prototype.addResolvers=function(t){this.localState.addResolvers(t)},e.prototype.setResolvers=function(t){this.localState.setResolvers(t)},e.prototype.getResolvers=function(){return this.localState.getResolvers()},e.prototype.setLocalStateFragmentMatcher=function(t){this.localState.setFragmentMatcher(t)},e.prototype.setLink=function(t){this.link=this.queryManager.link=t},e}();_u(Dr?"log":"silent");function Qe(e){return e===null?"null":Array.isArray(e)?"array":typeof e}function Kt(e){return Qe(e)==="object"}function lf(e){return Array.isArray(e)&&e.length>0&&e.every(t=>"message"in t)}function cc(e,t){return e.length<124?e:t}var ff="graphql-transport-ws";var Ze;(function(e){e[e.InternalServerError=4500]="InternalServerError",e[e.InternalClientError=4005]="InternalClientError",e[e.BadRequest=4400]="BadRequest",e[e.BadResponse=4004]="BadResponse",e[e.Unauthorized=4401]="Unauthorized",e[e.Forbidden=4403]="Forbidden",e[e.SubprotocolNotAcceptable=4406]="SubprotocolNotAcceptable",e[e.ConnectionInitialisationTimeout=4408]="ConnectionInitialisationTimeout",e[e.ConnectionAcknowledgementTimeout=4504]="ConnectionAcknowledgementTimeout",e[e.SubscriberAlreadyExists=4409]="SubscriberAlreadyExists",e[e.TooManyInitialisationRequests=4429]="TooManyInitialisationRequests"})(Ze||(Ze={}));var we;(function(e){e.ConnectionInit="connection_init",e.ConnectionAck="connection_ack",e.Ping="ping",e.Pong="pong",e.Subscribe="subscribe",e.Next="next",e.Error="error",e.Complete="complete"})(we||(we={}));function pf(e){if(!Kt(e))throw new Error(`Message is expected to be an object, but got ${Qe(e)}`);if(!e.type)throw new Error("Message is missing the 'type' property");if(typeof e.type!="string")throw new Error(`Message is expects the 'type' property to be a string, but got ${Qe(e.type)}`);switch(e.type){case we.ConnectionInit:case we.ConnectionAck:case we.Ping:case we.Pong:{if(e.payload!=null&&!Kt(e.payload))throw new Error(`"${e.type}" message expects the 'payload' property to be an object or nullish or missing, but got "${e.payload}"`);break}case we.Subscribe:{if(typeof e.id!="string")throw new Error(`"${e.type}" message expects the 'id' property to be a string, but got ${Qe(e.id)}`);if(!e.id)throw new Error(`"${e.type}" message requires a non-empty 'id' property`);if(!Kt(e.payload))throw new Error(`"${e.type}" message expects the 'payload' property to be an object, but got ${Qe(e.payload)}`);if(typeof e.payload.query!="string")throw new Error(`"${e.type}" message payload expects the 'query' property to be a string, but got ${Qe(e.payload.query)}`);if(e.payload.variables!=null&&!Kt(e.payload.variables))throw new Error(`"${e.type}" message payload expects the 'variables' property to be a an object or nullish or missing, but got ${Qe(e.payload.variables)}`);if(e.payload.operationName!=null&&Qe(e.payload.operationName)!=="string")throw new Error(`"${e.type}" message payload expects the 'operationName' property to be a string or nullish or missing, but got ${Qe(e.payload.operationName)}`);if(e.payload.extensions!=null&&!Kt(e.payload.extensions))throw new Error(`"${e.type}" message payload expects the 'extensions' property to be a an object or nullish or missing, but got ${Qe(e.payload.extensions)}`);break}case we.Next:{if(typeof e.id!="string")throw new Error(`"${e.type}" message expects the 'id' property to be a string, but got ${Qe(e.id)}`);if(!e.id)throw new Error(`"${e.type}" message requires a non-empty 'id' property`);if(!Kt(e.payload))throw new Error(`"${e.type}" message expects the 'payload' property to be an object, but got ${Qe(e.payload)}`);break}case we.Error:{if(typeof e.id!="string")throw new Error(`"${e.type}" message expects the 'id' property to be a string, but got ${Qe(e.id)}`);if(!e.id)throw new Error(`"${e.type}" message requires a non-empty 'id' property`);if(!lf(e.payload))throw new Error(`"${e.type}" message expects the 'payload' property to be an array of GraphQL errors, but got ${JSON.stringify(e.payload)}`);break}case we.Complete:{if(typeof e.id!="string")throw new Error(`"${e.type}" message expects the 'id' property to be a string, but got ${Qe(e.id)}`);if(!e.id)throw new Error(`"${e.type}" message requires a non-empty 'id' property`);break}default:throw new Error(`Invalid message 'type' property "${e.type}"`)}return e}function df(e,t){return pf(typeof e=="string"?JSON.parse(e,t):e)}function Cn(e,t){return pf(e),JSON.stringify(e,t)}function hf(e){let{url:t,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(ce){let ue=1e3;for(let J=0;J<ce;J++)ue*=2;await new Promise(J=>setTimeout(J,ue+Math.floor(Math.random()*(3e3-300)+300)))},shouldRetry:d=Ha,isFatalConnectionProblem:p,on:f,webSocketImpl:h,generateID:g=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,ce=>{let ue=Math.random()*16|0;return(ce=="x"?ue:ue&3|8).toString(16)})},jsonMessageReplacer:y,jsonMessageReviver:S}=e,b;if(h){if(!bm(h))throw new Error("Invalid WebSocket implementation provided");b=h}else typeof WebSocket<"u"?b=WebSocket:typeof global<"u"?b=global.WebSocket||global.MozWebSocket:typeof window<"u"&&(b=window.WebSocket||window.MozWebSocket);if(!b)throw new Error("WebSocket implementation missing; on Node you can `import WebSocket from 'ws';` and pass `webSocketImpl: WebSocket` to `createClient`");let v=b,m=(()=>{let U=(()=>{let ue={};return{on(J,Y){return ue[J]=Y,()=>{delete ue[J]}},emit(J){var Y;"id"in J&&((Y=ue[J.id])===null||Y===void 0||Y.call(ue,J))}}})(),ce={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?[U.emit,f.message]:[U.emit],closed:f?.closed?[f.closed]:[],error:f?.error?[f.error]:[]};return{onMessage:U.on,on(ue,J){let Y=ce[ue];return Y.push(J),()=>{Y.splice(Y.indexOf(J),1)}},emit(ue,...J){for(let Y of[...ce[ue]])Y(...J)}}})();function O(U){let ce=[m.on("error",ue=>{ce.forEach(J=>J()),U(ue)}),m.on("closed",ue=>{ce.forEach(J=>J()),U(ue)})]}let N,T=0,D,C=!1,R=0,j=!1;async function Pe(){clearTimeout(D);let[U,ce]=await(N??(N=new Promise((Y,At)=>(async()=>{if(C){if(await l(R),!T)return N=void 0,At({code:1e3,reason:"All Subscriptions Gone"});R++}m.emit("connecting");let z=new v(typeof t=="function"?await t():t,ff),Dt,tr;function pa(){isFinite(o)&&o>0&&(clearTimeout(tr),tr=setTimeout(()=>{z.readyState===v.OPEN&&(z.send(Cn({type:we.Ping})),m.emit("ping",!1,void 0))},o))}O(Le=>{N=void 0,clearTimeout(Dt),clearTimeout(tr),At(Le),Ha(Le)&&Le.code===4499&&(z.close(4499,"Terminated"),z.onerror=null,z.onclose=null)}),z.onerror=Le=>m.emit("error",Le),z.onclose=Le=>m.emit("closed",Le),z.onopen=async()=>{try{m.emit("opened",z);let Le=typeof r=="function"?await r():r;if(z.readyState!==v.OPEN)return;z.send(Cn(Le?{type:we.ConnectionInit,payload:Le}:{type:we.ConnectionInit},y)),isFinite(u)&&u>0&&(Dt=setTimeout(()=>{z.close(Ze.ConnectionAcknowledgementTimeout,"Connection acknowledgement timeout")},u)),pa()}catch(Le){m.emit("error",Le),z.close(Ze.InternalClientError,cc(Le instanceof Error?Le.message:new Error(Le).message,"Internal client error"))}};let yn=!1;z.onmessage=({data:Le})=>{try{let Fe=df(Le,S);if(m.emit("message",Fe),Fe.type==="ping"||Fe.type==="pong"){m.emit(Fe.type,!0,Fe.payload),Fe.type==="pong"?pa():s||(z.send(Cn(Fe.payload?{type:we.Pong,payload:Fe.payload}:{type:we.Pong})),m.emit("pong",!1,Fe.payload));return}if(yn)return;if(Fe.type!==we.ConnectionAck)throw new Error(`First message cannot be of type ${Fe.type}`);clearTimeout(Dt),yn=!0,m.emit("connected",z,Fe.payload),C=!1,R=0,Y([z,new Promise((Ub,kd)=>O(kd))])}catch(Fe){z.onmessage=null,m.emit("error",Fe),z.close(Ze.BadResponse,cc(Fe instanceof Error?Fe.message:new Error(Fe).message,"Bad response"))}}})())));U.readyState===v.CLOSING&&await ce;let ue=()=>{},J=new Promise(Y=>ue=Y);return[U,ue,Promise.race([J.then(()=>{if(!T){let Y=()=>U.close(1e3,"Normal Closure");isFinite(a)&&a>0?D=setTimeout(()=>{U.readyState===v.OPEN&&Y()},a):Y()}}),ce])]}function Ie(U){if(Ha(U)&&(vm(U.code)||[Ze.InternalServerError,Ze.InternalClientError,Ze.BadRequest,Ze.BadResponse,Ze.Unauthorized,Ze.SubprotocolNotAcceptable,Ze.SubscriberAlreadyExists,Ze.TooManyInitialisationRequests].includes(U.code)))throw U;if(j)return!1;if(Ha(U)&&U.code===1e3)return T>0;if(!c||R>=c||!d(U)||p?.(U))throw U;return C=!0}return n||(async()=>{for(T++;;)try{let[,,U]=await Pe();await U}catch(U){try{if(!Ie(U))return}catch(ce){return i?.(ce)}}})(),{on:m.on,subscribe(U,ce){let ue=g(U),J=!1,Y=!1,At=()=>{T--,J=!0};return(async()=>{for(T++;;)try{let[z,Dt,tr]=await Pe();if(J)return Dt();let pa=m.onMessage(ue,yn=>{switch(yn.type){case we.Next:{ce.next(yn.payload);return}case we.Error:{Y=!0,J=!0,ce.error(yn.payload),At();return}case we.Complete:{J=!0,At();return}}});z.send(Cn({id:ue,type:we.Subscribe,payload:U},y)),At=()=>{!J&&z.readyState===v.OPEN&&z.send(Cn({id:ue,type:we.Complete},y)),T--,J=!0,Dt()},await tr.finally(pa);return}catch(z){if(!Ie(z))return}})().then(()=>{Y||ce.complete()}).catch(z=>{ce.error(z)}),()=>{J||At()}},async dispose(){if(j=!0,N){let[U]=await N;U.close(1e3,"Normal Closure")}},terminate(){N&&m.emit("closed",{code:4499,reason:"Terminated",wasClean:!1})}}}function Ha(e){return Kt(e)&&"code"in e&&"reason"in e}function vm(e){return[1e3,1001,1006,1005,1012,1013,1013].includes(e)?!1:e>=1e3&&e<=1999}function bm(e){return typeof e=="function"&&"constructor"in e&&"CLOSED"in e&&"CLOSING"in e&&"CONNECTING"in e&&"OPEN"in e}function _m(e){return Z(e)&&"code"in e&&"reason"in e}var mf=function(e){be(t,e);function t(r){var n=e.call(this)||this;return n.client=r,n}return t.prototype.request=function(r){var n=this;return new G(function(i){return n.client.subscribe(_(_({},r),{query:vn(r.query)}),{next:i.next.bind(i),complete:i.complete.bind(i),error:function(a){return a instanceof Error?i.error(a):_m(a)?i.error(new Error("Socket closed with event ".concat(a.code," ").concat(a.reason||""))):i.error(new Gt({graphQLErrors:Array.isArray(a)?a:[a]}))}})})},t}(ht);var xo=function(){return xo=Object.assign||function(t){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)&&(t[a]=r[a])}return t},xo.apply(this,arguments)};typeof SuppressedError=="function"&&SuppressedError;function co(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?co=function(r){return typeof r}:co=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},co(e)}function wm(e){return co(e)=="object"&&e!==null}var Tp=typeof Symbol=="function"&&Symbol.toStringTag!=null?Symbol.toStringTag:"@@toStringTag";function Ac(e,t){for(var r=/\r\n|[\n\r]/g,n=1,i=t+1,a;(a=r.exec(e.body))&&a.index<t;)n+=1,i=t+1-(a.index+a[0].length);return{line:n,column:i}}function Sm(e){return Ip(e.source,Ac(e.source,e.start))}function Ip(e,t){var r=e.locationOffset.column-1,n=uo(r)+e.body,i=t.line-1,a=e.locationOffset.line-1,o=t.line+a,s=t.line===1?r:0,u=t.column+s,c="".concat(e.name,":").concat(o,":").concat(u,`
|
|
52
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=[],g=0;g<d.length;g+=80)h.push(d.slice(g,g+80));return c+gf([["".concat(o),h[0]]].concat(h.slice(1,p+1).map(function(y){return["",y]}),[[" ",uo(f-1)+"^"],["",h[p+1]]]))}return c+gf([["".concat(o-1),l[i-1]],["".concat(o),d],["",uo(u-1)+"^"],["".concat(o+1),l[i+1]]])}function gf(e){var t=e.filter(function(n){n[0];var i=n[1];return i!==void 0}),r=Math.max.apply(Math,t.map(function(n){var i=n[0];return i.length}));return t.map(function(n){var i=n[0],a=n[1];return Em(r,i)+(a?" | "+a:" |")}).join(`
|
|
53
|
-
`)}function uo(e){return Array(e+1).join(" ")}function Em(e,t){return uo(e-t.length)+t}function lo(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?lo=function(r){return typeof r}:lo=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},lo(e)}function yf(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function xm(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?yf(Object(r),!0).forEach(function(n){Tm(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):yf(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Tm(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Im(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function vf(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function km(e,t,r){return t&&vf(e.prototype,t),r&&vf(e,r),e}function Om(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ki(e,t)}function Am(e){var t=Op();return function(){var n=Wi(e),i;if(t){var a=Wi(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return kp(this,i)}}function kp(e,t){return t&&(lo(t)==="object"||typeof t=="function")?t:Ii(e)}function Ii(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Dc(e){var t=typeof Map=="function"?new Map:void 0;return Dc=function(n){if(n===null||!Dm(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof t<"u"){if(t.has(n))return t.get(n);t.set(n,i)}function i(){return fo(n,arguments,Wi(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),Ki(i,n)},Dc(e)}function fo(e,t,r){return Op()?fo=Reflect.construct:fo=function(i,a,o){var s=[null];s.push.apply(s,a);var u=Function.bind.apply(i,s),c=new u;return o&&Ki(c,o.prototype),c},fo.apply(null,arguments)}function Op(){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 Dm(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function Ki(e,t){return Ki=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},Ki(e,t)}function Wi(e){return Wi=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},Wi(e)}var Nm=function(e){Om(r,e);var t=Am(r);function r(n,i,a,o,s,u,c){var l,d,p,f;Im(this,r),f=t.call(this,n),f.name="GraphQLError",f.originalError=u??void 0,f.nodes=bf(Array.isArray(i)?i:i?[i]:void 0);for(var h=[],g=0,y=(S=f.nodes)!==null&&S!==void 0?S:[];g<y.length;g++){var S,b=y[g],v=b.loc;v!=null&&h.push(v)}h=bf(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(O){return O.start})),f.locations=o&&a?o.map(function(O){return Ac(a,O)}):(p=h)===null||p===void 0?void 0:p.map(function(O){return Ac(O.source,O.start)}),f.path=s??void 0;var m=u?.extensions;return c==null&&wm(m)?f.extensions=xm({},m):f.extensions=c??{},Object.defineProperties(Ii(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(Ii(f),"stack",{value:u.stack,writable:!0,configurable:!0}),kp(f)):(Error.captureStackTrace?Error.captureStackTrace(Ii(f),r):Object.defineProperty(Ii(f),"stack",{value:Error().stack,writable:!0,configurable:!0}),f)}return km(r,[{key:"toString",value:function(){return
|
|
53
|
+
`)}function uo(e){return Array(e+1).join(" ")}function Em(e,t){return uo(e-t.length)+t}function lo(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?lo=function(r){return typeof r}:lo=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},lo(e)}function yf(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function xm(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?yf(Object(r),!0).forEach(function(n){Tm(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):yf(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Tm(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Im(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function vf(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function km(e,t,r){return t&&vf(e.prototype,t),r&&vf(e,r),e}function Om(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ki(e,t)}function Am(e){var t=Op();return function(){var n=Wi(e),i;if(t){var a=Wi(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return kp(this,i)}}function kp(e,t){return t&&(lo(t)==="object"||typeof t=="function")?t:Ii(e)}function Ii(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Dc(e){var t=typeof Map=="function"?new Map:void 0;return Dc=function(n){if(n===null||!Dm(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof t<"u"){if(t.has(n))return t.get(n);t.set(n,i)}function i(){return fo(n,arguments,Wi(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),Ki(i,n)},Dc(e)}function fo(e,t,r){return Op()?fo=Reflect.construct:fo=function(i,a,o){var s=[null];s.push.apply(s,a);var u=Function.bind.apply(i,s),c=new u;return o&&Ki(c,o.prototype),c},fo.apply(null,arguments)}function Op(){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 Dm(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function Ki(e,t){return Ki=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},Ki(e,t)}function Wi(e){return Wi=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},Wi(e)}var Nm=function(e){Om(r,e);var t=Am(r);function r(n,i,a,o,s,u,c){var l,d,p,f;Im(this,r),f=t.call(this,n),f.name="GraphQLError",f.originalError=u??void 0,f.nodes=bf(Array.isArray(i)?i:i?[i]:void 0);for(var h=[],g=0,y=(S=f.nodes)!==null&&S!==void 0?S:[];g<y.length;g++){var S,b=y[g],v=b.loc;v!=null&&h.push(v)}h=bf(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(O){return O.start})),f.locations=o&&a?o.map(function(O){return Ac(a,O)}):(p=h)===null||p===void 0?void 0:p.map(function(O){return Ac(O.source,O.start)}),f.path=s??void 0;var m=u?.extensions;return c==null&&wm(m)?f.extensions=xm({},m):f.extensions=c??{},Object.defineProperties(Ii(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(Ii(f),"stack",{value:u.stack,writable:!0,configurable:!0}),kp(f)):(Error.captureStackTrace?Error.captureStackTrace(Ii(f),r):Object.defineProperty(Ii(f),"stack",{value:Error().stack,writable:!0,configurable:!0}),f)}return km(r,[{key:"toString",value:function(){return Rm(this)}},{key:Tp,get:function(){return"Object"}}]),r}(Dc(Error));function bf(e){return e===void 0||e.length===0?void 0:e}function Rm(e){var t=e.message;if(e.nodes)for(var r=0,n=e.nodes;r<n.length;r++){var i=n[r];i.loc&&(t+=`
|
|
54
54
|
|
|
55
55
|
`+Sm(i.loc))}else if(e.source&&e.locations)for(var a=0,o=e.locations;a<o.length;a++){var s=o[a];t+=`
|
|
56
56
|
|
|
57
|
-
`+Ip(e.source,s)}return t}function ct(e,t,r){return new Nm("Syntax Error: ".concat(r),void 0,e,[t])}var $=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
|
|
57
|
+
`+Ip(e.source,s)}return t}function ct(e,t,r){return new Nm("Syntax Error: ".concat(r),void 0,e,[t])}var $=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 Cm(e,t){var r=Boolean(e);if(!r)throw new Error(t??"Unexpected invariant triggered.")}var Pm=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):void 0,Nc=Pm;function Ap(e){var t=e.prototype.toJSON;typeof t=="function"||Cm(0),e.prototype.inspect=t,Nc&&(e.prototype[Nc]=t)}var Dp=function(){function e(r,n,i){this.start=r.start,this.end=n.end,this.startToken=r,this.endToken=n,this.source=i}var t=e.prototype;return t.toJSON=function(){return{start:this.start,end:this.end}},e}();Ap(Dp);var Ee=function(){function e(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 t=e.prototype;return t.toJSON=function(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}},e}();Ap(Ee);var I=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 po(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?po=function(r){return typeof r}:po=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},po(e)}var Lm=10,Np=2;function Fm(e){return Go(e,[])}function Go(e,t){switch(po(e)){case"string":return JSON.stringify(e);case"function":return e.name?"[function ".concat(e.name,"]"):"[function]";case"object":return e===null?"null":Mm(e,t);default:return String(e)}}function Mm(e,t){if(t.indexOf(e)!==-1)return"[Circular]";var r=[].concat(t,[e]),n=Um(e);if(n!==void 0){var i=n.call(e);if(i!==e)return typeof i=="string"?i:Go(i,r)}else if(Array.isArray(e))return jm(e,r);return $m(e,r)}function $m(e,t){var r=Object.keys(e);if(r.length===0)return"{}";if(t.length>Np)return"["+qm(e)+"]";var n=r.map(function(i){var a=Go(e[i],t);return i+": "+a});return"{ "+n.join(", ")+" }"}function jm(e,t){if(e.length===0)return"[]";if(t.length>Np)return"[Array]";for(var r=Math.min(Lm,e.length),n=e.length-r,i=[],a=0;a<r;++a)i.push(Go(e[a],t));return n===1?i.push("... 1 more item"):n>1&&i.push("... ".concat(n," more items")),"["+i.join(", ")+"]"}function Um(e){var t=e[String(Nc)];if(typeof t=="function")return t;if(typeof e.inspect=="function")return e.inspect}function qm(e){var t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if(t==="Object"&&typeof e.constructor=="function"){var r=e.constructor.name;if(typeof r=="string"&&r!=="")return r}return t}function uc(e,t){var r=Boolean(e);if(!r)throw new Error(t)}var Bm=function(t,r){return t instanceof r};function _f(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Vm(e,t,r){return t&&_f(e.prototype,t),r&&_f(e,r),e}var Rp=function(){function e(t){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 t=="string"||uc(0,"Body must be a string. Received: ".concat(Fm(t),".")),this.body=t,this.name=r,this.locationOffset=n,this.locationOffset.line>0||uc(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||uc(0,"column in locationOffset is 1-indexed and must be positive.")}return Vm(e,[{key:Tp,get:function(){return"Source"}}]),e}();function Qm(e){return Bm(e,Rp)}var zm=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 Gm(e){var t=e.split(/\r\n|[\n\r]/g),r=Km(e);if(r!==0)for(var n=1;n<t.length;n++)t[n]=t[n].slice(r);for(var i=0;i<t.length&&wf(t[i]);)++i;for(var a=t.length;a>i&&wf(t[a-1]);)--a;return t.slice(i,a).join(`
|
|
58
58
|
`)}function wf(e){for(var t=0;t<e.length;++t)if(e[t]!==" "&&e[t]!==" ")return!1;return!0}function Km(e){for(var t,r=!0,n=!0,i=0,a=null,o=0;o<e.length;++o)switch(e.charCodeAt(o)){case 13:e.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(t=a)!==null&&t!==void 0?t:0}var Wm=function(){function e(r){var n=new Ee(I.SOF,0,0,0,0,null);this.source=r,this.lastToken=n,this.token=n,this.line=1,this.lineStart=0}var t=e.prototype;return t.advance=function(){this.lastToken=this.token;var n=this.token=this.lookahead();return n},t.lookahead=function(){var n=this.token;if(n.kind!==I.EOF)do{var i;n=(i=n.next)!==null&&i!==void 0?i:n.next=Jm(this,n)}while(n.kind===I.COMMENT);return n},e}();function Hm(e){return e===I.BANG||e===I.DOLLAR||e===I.AMP||e===I.PAREN_L||e===I.PAREN_R||e===I.SPREAD||e===I.COLON||e===I.EQUALS||e===I.AT||e===I.BRACKET_L||e===I.BRACKET_R||e===I.BRACE_L||e===I.PIPE||e===I.BRACE_R}function en(e){return isNaN(e)?I.EOF:e<127?JSON.stringify(String.fromCharCode(e)):'"\\u'.concat(("00"+e.toString(16).toUpperCase()).slice(-4),'"')}function Jm(e,t){for(var r=e.source,n=r.body,i=n.length,a=t.end;a<i;){var o=n.charCodeAt(a),s=e.line,u=1+a-e.lineStart;switch(o){case 65279:case 9:case 32:case 44:++a;continue;case 10:++a,++e.line,e.lineStart=a;continue;case 13:n.charCodeAt(a+1)===10?a+=2:++a,++e.line,e.lineStart=a;continue;case 33:return new Ee(I.BANG,a,a+1,s,u,t);case 35:return Zm(r,a,s,u,t);case 36:return new Ee(I.DOLLAR,a,a+1,s,u,t);case 38:return new Ee(I.AMP,a,a+1,s,u,t);case 40:return new Ee(I.PAREN_L,a,a+1,s,u,t);case 41:return new Ee(I.PAREN_R,a,a+1,s,u,t);case 46:if(n.charCodeAt(a+1)===46&&n.charCodeAt(a+2)===46)return new Ee(I.SPREAD,a,a+3,s,u,t);break;case 58:return new Ee(I.COLON,a,a+1,s,u,t);case 61:return new Ee(I.EQUALS,a,a+1,s,u,t);case 64:return new Ee(I.AT,a,a+1,s,u,t);case 91:return new Ee(I.BRACKET_L,a,a+1,s,u,t);case 93:return new Ee(I.BRACKET_R,a,a+1,s,u,t);case 123:return new Ee(I.BRACE_L,a,a+1,s,u,t);case 124:return new Ee(I.PIPE,a,a+1,s,u,t);case 125:return new Ee(I.BRACE_R,a,a+1,s,u,t);case 34:return n.charCodeAt(a+1)===34&&n.charCodeAt(a+2)===34?tg(r,a,s,u,t,e):eg(r,a,s,u,t);case 45:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return Xm(r,a,o,s,u,t);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 ng(r,a,s,u,t)}throw ct(r,a,Ym(o))}var c=e.line,l=1+a-e.lineStart;return new Ee(I.EOF,i,i,c,l,t)}function Ym(e){return e<32&&e!==9&&e!==10&&e!==13?"Cannot contain the invalid character ".concat(en(e),"."):e===39?`Unexpected single quote character ('), did you mean to use a double quote (")?`:"Cannot parse the unexpected character ".concat(en(e),".")}function Zm(e,t,r,n,i){var a=e.body,o,s=t;do o=a.charCodeAt(++s);while(!isNaN(o)&&(o>31||o===9));return new Ee(I.COMMENT,t,s,r,n,i,a.slice(t+1,s))}function Xm(e,t,r,n,i,a){var o=e.body,s=r,u=t,c=!1;if(s===45&&(s=o.charCodeAt(++u)),s===48){if(s=o.charCodeAt(++u),s>=48&&s<=57)throw ct(e,u,"Invalid number, unexpected digit after 0: ".concat(en(s),"."))}else u=lc(e,u,s),s=o.charCodeAt(u);if(s===46&&(c=!0,s=o.charCodeAt(++u),u=lc(e,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=lc(e,u,s),s=o.charCodeAt(u)),s===46||ig(s))throw ct(e,u,"Invalid number, expected digit but got: ".concat(en(s),"."));return new Ee(c?I.FLOAT:I.INT,t,u,n,i,a,o.slice(t,u))}function lc(e,t,r){var n=e.body,i=t,a=r;if(a>=48&&a<=57){do a=n.charCodeAt(++i);while(a>=48&&a<=57);return i}throw ct(e,i,"Invalid number, expected digit but got: ".concat(en(a),"."))}function eg(e,t,r,n,i){for(var a=e.body,o=t+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 Ee(I.STRING,t,o+1,r,n,i,c);if(u<32&&u!==9)throw ct(e,o,"Invalid character within String: ".concat(en(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=rg(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 ct(e,o,"Invalid character escape sequence: \\u".concat(d,"."))}c+=String.fromCharCode(l),o+=4;break}default:throw ct(e,o,"Invalid character escape sequence: \\".concat(String.fromCharCode(u),"."))}++o,s=o}}throw ct(e,o,"Unterminated string.")}function tg(e,t,r,n,i,a){for(var o=e.body,s=t+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 Ee(I.BLOCK_STRING,t,s+3,r,n,i,Gm(l));if(c<32&&c!==9&&c!==10&&c!==13)throw ct(e,s,"Invalid character within String: ".concat(en(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 ct(e,s,"Unterminated string.")}function rg(e,t,r,n){return Ja(e)<<12|Ja(t)<<8|Ja(r)<<4|Ja(n)}function Ja(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function ng(e,t,r,n,i){for(var a=e.body,o=a.length,s=t+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 Ee(I.NAME,t,s,r,n,i,a.slice(t,s))}function ig(e){return e===95||e>=65&&e<=90||e>=97&&e<=122}function ag(e,t){var r=new og(e,t);return r.parseDocument()}var og=function(){function e(r,n){var i=Qm(r)?r:new Cp(r);this._lexer=new Wm(i),this._options=n}var t=e.prototype;return t.parseName=function(){var n=this.expectToken(I.NAME);return{kind:$.NAME,value:n.value,loc:this.loc(n)}},t.parseDocument=function(){var n=this._lexer.token;return{kind:$.DOCUMENT,definitions:this.many(I.SOF,this.parseDefinition,I.EOF),loc:this.loc(n)}},t.parseDefinition=function(){if(this.peek(I.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(I.BRACE_L))return this.parseOperationDefinition();if(this.peekDescription())return this.parseTypeSystemDefinition()}throw this.unexpected()},t.parseOperationDefinition=function(){var n=this._lexer.token;if(this.peek(I.BRACE_L))return{kind:$.OPERATION_DEFINITION,operation:"query",name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet(),loc:this.loc(n)};var i=this.parseOperationType(),a;return this.peek(I.NAME)&&(a=this.parseName()),{kind:$.OPERATION_DEFINITION,operation:i,name:a,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(n)}},t.parseOperationType=function(){var n=this.expectToken(I.NAME);switch(n.value){case"query":return"query";case"mutation":return"mutation";case"subscription":return"subscription"}throw this.unexpected(n)},t.parseVariableDefinitions=function(){return this.optionalMany(I.PAREN_L,this.parseVariableDefinition,I.PAREN_R)},t.parseVariableDefinition=function(){var n=this._lexer.token;return{kind:$.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(I.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(I.EQUALS)?this.parseValueLiteral(!0):void 0,directives:this.parseDirectives(!0),loc:this.loc(n)}},t.parseVariable=function(){var n=this._lexer.token;return this.expectToken(I.DOLLAR),{kind:$.VARIABLE,name:this.parseName(),loc:this.loc(n)}},t.parseSelectionSet=function(){var n=this._lexer.token;return{kind:$.SELECTION_SET,selections:this.many(I.BRACE_L,this.parseSelection,I.BRACE_R),loc:this.loc(n)}},t.parseSelection=function(){return this.peek(I.SPREAD)?this.parseFragment():this.parseField()},t.parseField=function(){var n=this._lexer.token,i=this.parseName(),a,o;return this.expectOptionalToken(I.COLON)?(a=i,o=this.parseName()):o=i,{kind:$.FIELD,alias:a,name:o,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(I.BRACE_L)?this.parseSelectionSet():void 0,loc:this.loc(n)}},t.parseArguments=function(n){var i=n?this.parseConstArgument:this.parseArgument;return this.optionalMany(I.PAREN_L,i,I.PAREN_R)},t.parseArgument=function(){var n=this._lexer.token,i=this.parseName();return this.expectToken(I.COLON),{kind:$.ARGUMENT,name:i,value:this.parseValueLiteral(!1),loc:this.loc(n)}},t.parseConstArgument=function(){var n=this._lexer.token;return{kind:$.ARGUMENT,name:this.parseName(),value:(this.expectToken(I.COLON),this.parseValueLiteral(!0)),loc:this.loc(n)}},t.parseFragment=function(){var n=this._lexer.token;this.expectToken(I.SPREAD);var i=this.expectOptionalKeyword("on");return!i&&this.peek(I.NAME)?{kind:$.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1),loc:this.loc(n)}:{kind:$.INLINE_FRAGMENT,typeCondition:i?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(n)}},t.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:$.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:$.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(i)}},t.parseFragmentName=function(){if(this._lexer.token.value==="on")throw this.unexpected();return this.parseName()},t.parseValueLiteral=function(n){var i=this._lexer.token;switch(i.kind){case I.BRACKET_L:return this.parseList(n);case I.BRACE_L:return this.parseObject(n);case I.INT:return this._lexer.advance(),{kind:$.INT,value:i.value,loc:this.loc(i)};case I.FLOAT:return this._lexer.advance(),{kind:$.FLOAT,value:i.value,loc:this.loc(i)};case I.STRING:case I.BLOCK_STRING:return this.parseStringLiteral();case I.NAME:switch(this._lexer.advance(),i.value){case"true":return{kind:$.BOOLEAN,value:!0,loc:this.loc(i)};case"false":return{kind:$.BOOLEAN,value:!1,loc:this.loc(i)};case"null":return{kind:$.NULL,loc:this.loc(i)};default:return{kind:$.ENUM,value:i.value,loc:this.loc(i)}}case I.DOLLAR:if(!n)return this.parseVariable();break}throw this.unexpected()},t.parseStringLiteral=function(){var n=this._lexer.token;return this._lexer.advance(),{kind:$.STRING,value:n.value,block:n.kind===I.BLOCK_STRING,loc:this.loc(n)}},t.parseList=function(n){var i=this,a=this._lexer.token,o=function(){return i.parseValueLiteral(n)};return{kind:$.LIST,values:this.any(I.BRACKET_L,o,I.BRACKET_R),loc:this.loc(a)}},t.parseObject=function(n){var i=this,a=this._lexer.token,o=function(){return i.parseObjectField(n)};return{kind:$.OBJECT,fields:this.any(I.BRACE_L,o,I.BRACE_R),loc:this.loc(a)}},t.parseObjectField=function(n){var i=this._lexer.token,a=this.parseName();return this.expectToken(I.COLON),{kind:$.OBJECT_FIELD,name:a,value:this.parseValueLiteral(n),loc:this.loc(i)}},t.parseDirectives=function(n){for(var i=[];this.peek(I.AT);)i.push(this.parseDirective(n));return i},t.parseDirective=function(n){var i=this._lexer.token;return this.expectToken(I.AT),{kind:$.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(n),loc:this.loc(i)}},t.parseTypeReference=function(){var n=this._lexer.token,i;return this.expectOptionalToken(I.BRACKET_L)?(i=this.parseTypeReference(),this.expectToken(I.BRACKET_R),i={kind:$.LIST_TYPE,type:i,loc:this.loc(n)}):i=this.parseNamedType(),this.expectOptionalToken(I.BANG)?{kind:$.NON_NULL_TYPE,type:i,loc:this.loc(n)}:i},t.parseNamedType=function(){var n=this._lexer.token;return{kind:$.NAMED_TYPE,name:this.parseName(),loc:this.loc(n)}},t.parseTypeSystemDefinition=function(){var n=this.peekDescription()?this._lexer.lookahead():this._lexer.token;if(n.kind===I.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)},t.peekDescription=function(){return this.peek(I.STRING)||this.peek(I.BLOCK_STRING)},t.parseDescription=function(){if(this.peekDescription())return this.parseStringLiteral()},t.parseSchemaDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("schema");var a=this.parseDirectives(!0),o=this.many(I.BRACE_L,this.parseOperationTypeDefinition,I.BRACE_R);return{kind:$.SCHEMA_DEFINITION,description:i,directives:a,operationTypes:o,loc:this.loc(n)}},t.parseOperationTypeDefinition=function(){var n=this._lexer.token,i=this.parseOperationType();this.expectToken(I.COLON);var a=this.parseNamedType();return{kind:$.OPERATION_TYPE_DEFINITION,operation:i,type:a,loc:this.loc(n)}},t.parseScalarTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("scalar");var a=this.parseName(),o=this.parseDirectives(!0);return{kind:$.SCALAR_TYPE_DEFINITION,description:i,name:a,directives:o,loc:this.loc(n)}},t.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:$.OBJECT_TYPE_DEFINITION,description:i,name:a,interfaces:o,directives:s,fields:u,loc:this.loc(n)}},t.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(I.AMP);do i.push(this.parseNamedType());while(this.expectOptionalToken(I.AMP)||this.peek(I.NAME));return i}return this.delimitedMany(I.AMP,this.parseNamedType)},t.parseFieldsDefinition=function(){var n;return((n=this._options)===null||n===void 0?void 0:n.allowLegacySDLEmptyFields)===!0&&this.peek(I.BRACE_L)&&this._lexer.lookahead().kind===I.BRACE_R?(this._lexer.advance(),this._lexer.advance(),[]):this.optionalMany(I.BRACE_L,this.parseFieldDefinition,I.BRACE_R)},t.parseFieldDefinition=function(){var n=this._lexer.token,i=this.parseDescription(),a=this.parseName(),o=this.parseArgumentDefs();this.expectToken(I.COLON);var s=this.parseTypeReference(),u=this.parseDirectives(!0);return{kind:$.FIELD_DEFINITION,description:i,name:a,arguments:o,type:s,directives:u,loc:this.loc(n)}},t.parseArgumentDefs=function(){return this.optionalMany(I.PAREN_L,this.parseInputValueDef,I.PAREN_R)},t.parseInputValueDef=function(){var n=this._lexer.token,i=this.parseDescription(),a=this.parseName();this.expectToken(I.COLON);var o=this.parseTypeReference(),s;this.expectOptionalToken(I.EQUALS)&&(s=this.parseValueLiteral(!0));var u=this.parseDirectives(!0);return{kind:$.INPUT_VALUE_DEFINITION,description:i,name:a,type:o,defaultValue:s,directives:u,loc:this.loc(n)}},t.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:$.INTERFACE_TYPE_DEFINITION,description:i,name:a,interfaces:o,directives:s,fields:u,loc:this.loc(n)}},t.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:$.UNION_TYPE_DEFINITION,description:i,name:a,directives:o,types:s,loc:this.loc(n)}},t.parseUnionMemberTypes=function(){return this.expectOptionalToken(I.EQUALS)?this.delimitedMany(I.PIPE,this.parseNamedType):[]},t.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:$.ENUM_TYPE_DEFINITION,description:i,name:a,directives:o,values:s,loc:this.loc(n)}},t.parseEnumValuesDefinition=function(){return this.optionalMany(I.BRACE_L,this.parseEnumValueDefinition,I.BRACE_R)},t.parseEnumValueDefinition=function(){var n=this._lexer.token,i=this.parseDescription(),a=this.parseName(),o=this.parseDirectives(!0);return{kind:$.ENUM_VALUE_DEFINITION,description:i,name:a,directives:o,loc:this.loc(n)}},t.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:$.INPUT_OBJECT_TYPE_DEFINITION,description:i,name:a,directives:o,fields:s,loc:this.loc(n)}},t.parseInputFieldsDefinition=function(){return this.optionalMany(I.BRACE_L,this.parseInputValueDef,I.BRACE_R)},t.parseTypeSystemExtension=function(){var n=this._lexer.lookahead();if(n.kind===I.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)},t.parseSchemaExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");var i=this.parseDirectives(!0),a=this.optionalMany(I.BRACE_L,this.parseOperationTypeDefinition,I.BRACE_R);if(i.length===0&&a.length===0)throw this.unexpected();return{kind:$.SCHEMA_EXTENSION,directives:i,operationTypes:a,loc:this.loc(n)}},t.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:$.SCALAR_TYPE_EXTENSION,name:i,directives:a,loc:this.loc(n)}},t.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:$.OBJECT_TYPE_EXTENSION,name:i,interfaces:a,directives:o,fields:s,loc:this.loc(n)}},t.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:$.INTERFACE_TYPE_EXTENSION,name:i,interfaces:a,directives:o,fields:s,loc:this.loc(n)}},t.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:$.UNION_TYPE_EXTENSION,name:i,directives:a,types:o,loc:this.loc(n)}},t.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:$.ENUM_TYPE_EXTENSION,name:i,directives:a,values:o,loc:this.loc(n)}},t.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:$.INPUT_OBJECT_TYPE_EXTENSION,name:i,directives:a,fields:o,loc:this.loc(n)}},t.parseDirectiveDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("directive"),this.expectToken(I.AT);var a=this.parseName(),o=this.parseArgumentDefs(),s=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");var u=this.parseDirectiveLocations();return{kind:$.DIRECTIVE_DEFINITION,description:i,name:a,arguments:o,repeatable:s,locations:u,loc:this.loc(n)}},t.parseDirectiveLocations=function(){return this.delimitedMany(I.PIPE,this.parseDirectiveLocation)},t.parseDirectiveLocation=function(){var n=this._lexer.token,i=this.parseName();if(zm[i.value]!==void 0)return i;throw this.unexpected(n)},t.loc=function(n){var i;if(((i=this._options)===null||i===void 0?void 0:i.noLocation)!==!0)return new Dp(n,this._lexer.lastToken,this._lexer.source)},t.peek=function(n){return this._lexer.token.kind===n},t.expectToken=function(n){var i=this._lexer.token;if(i.kind===n)return this._lexer.advance(),i;throw ct(this._lexer.source,i.start,"Expected ".concat(Rp(n),", found ").concat(fc(i),"."))},t.expectOptionalToken=function(n){var i=this._lexer.token;if(i.kind===n)return this._lexer.advance(),i},t.expectKeyword=function(n){var i=this._lexer.token;if(i.kind===I.NAME&&i.value===n)this._lexer.advance();else throw ct(this._lexer.source,i.start,'Expected "'.concat(n,'", found ').concat(fc(i),"."))},t.expectOptionalKeyword=function(n){var i=this._lexer.token;return i.kind===I.NAME&&i.value===n?(this._lexer.advance(),!0):!1},t.unexpected=function(n){var i=n??this._lexer.token;return ct(this._lexer.source,i.start,"Unexpected ".concat(fc(i),"."))},t.any=function(n,i,a){this.expectToken(n);for(var o=[];!this.expectOptionalToken(a);)o.push(i.call(this));return o},t.optionalMany=function(n,i,a){if(this.expectOptionalToken(n)){var o=[];do o.push(i.call(this));while(!this.expectOptionalToken(a));return o}return[]},t.many=function(n,i,a){this.expectToken(n);var o=[];do o.push(i.call(this));while(!this.expectOptionalToken(a));return o},t.delimitedMany=function(n,i){this.expectOptionalToken(n);var a=[];do a.push(i.call(this));while(this.expectOptionalToken(n));return a},e}();function fc(e){var t=e.value;return Rp(e.kind)+(t!=null?' "'.concat(t,'"'):"")}function Rp(e){return Hm(e)?'"'.concat(e,'"'):e}var ho=new Map,Cc=new Map,Pp=!0,To=!1;function Lp(e){return e.replace(/[\s,]+/g," ").trim()}function sg(e){return Lp(e.source.body.substring(e.start,e.end))}function cg(e){var t=new Set,r=[];return e.definitions.forEach(function(n){if(n.kind==="FragmentDefinition"){var i=n.name.value,a=sg(n.loc),o=Cc.get(i);o&&!o.has(a)?Pp&&console.warn("Warning: fragment with name "+i+` already exists.
|
|
59
|
+
`;break;case 114:c+="\r";break;case 116:c+=" ";break;case 117:{var l=rg(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 ct(e,o,"Invalid character escape sequence: \\u".concat(d,"."))}c+=String.fromCharCode(l),o+=4;break}default:throw ct(e,o,"Invalid character escape sequence: \\".concat(String.fromCharCode(u),"."))}++o,s=o}}throw ct(e,o,"Unterminated string.")}function tg(e,t,r,n,i,a){for(var o=e.body,s=t+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 Ee(I.BLOCK_STRING,t,s+3,r,n,i,Gm(l));if(c<32&&c!==9&&c!==10&&c!==13)throw ct(e,s,"Invalid character within String: ".concat(en(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 ct(e,s,"Unterminated string.")}function rg(e,t,r,n){return Ja(e)<<12|Ja(t)<<8|Ja(r)<<4|Ja(n)}function Ja(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function ng(e,t,r,n,i){for(var a=e.body,o=a.length,s=t+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 Ee(I.NAME,t,s,r,n,i,a.slice(t,s))}function ig(e){return e===95||e>=65&&e<=90||e>=97&&e<=122}function ag(e,t){var r=new og(e,t);return r.parseDocument()}var og=function(){function e(r,n){var i=Qm(r)?r:new Rp(r);this._lexer=new Wm(i),this._options=n}var t=e.prototype;return t.parseName=function(){var n=this.expectToken(I.NAME);return{kind:$.NAME,value:n.value,loc:this.loc(n)}},t.parseDocument=function(){var n=this._lexer.token;return{kind:$.DOCUMENT,definitions:this.many(I.SOF,this.parseDefinition,I.EOF),loc:this.loc(n)}},t.parseDefinition=function(){if(this.peek(I.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(I.BRACE_L))return this.parseOperationDefinition();if(this.peekDescription())return this.parseTypeSystemDefinition()}throw this.unexpected()},t.parseOperationDefinition=function(){var n=this._lexer.token;if(this.peek(I.BRACE_L))return{kind:$.OPERATION_DEFINITION,operation:"query",name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet(),loc:this.loc(n)};var i=this.parseOperationType(),a;return this.peek(I.NAME)&&(a=this.parseName()),{kind:$.OPERATION_DEFINITION,operation:i,name:a,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(n)}},t.parseOperationType=function(){var n=this.expectToken(I.NAME);switch(n.value){case"query":return"query";case"mutation":return"mutation";case"subscription":return"subscription"}throw this.unexpected(n)},t.parseVariableDefinitions=function(){return this.optionalMany(I.PAREN_L,this.parseVariableDefinition,I.PAREN_R)},t.parseVariableDefinition=function(){var n=this._lexer.token;return{kind:$.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(I.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(I.EQUALS)?this.parseValueLiteral(!0):void 0,directives:this.parseDirectives(!0),loc:this.loc(n)}},t.parseVariable=function(){var n=this._lexer.token;return this.expectToken(I.DOLLAR),{kind:$.VARIABLE,name:this.parseName(),loc:this.loc(n)}},t.parseSelectionSet=function(){var n=this._lexer.token;return{kind:$.SELECTION_SET,selections:this.many(I.BRACE_L,this.parseSelection,I.BRACE_R),loc:this.loc(n)}},t.parseSelection=function(){return this.peek(I.SPREAD)?this.parseFragment():this.parseField()},t.parseField=function(){var n=this._lexer.token,i=this.parseName(),a,o;return this.expectOptionalToken(I.COLON)?(a=i,o=this.parseName()):o=i,{kind:$.FIELD,alias:a,name:o,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(I.BRACE_L)?this.parseSelectionSet():void 0,loc:this.loc(n)}},t.parseArguments=function(n){var i=n?this.parseConstArgument:this.parseArgument;return this.optionalMany(I.PAREN_L,i,I.PAREN_R)},t.parseArgument=function(){var n=this._lexer.token,i=this.parseName();return this.expectToken(I.COLON),{kind:$.ARGUMENT,name:i,value:this.parseValueLiteral(!1),loc:this.loc(n)}},t.parseConstArgument=function(){var n=this._lexer.token;return{kind:$.ARGUMENT,name:this.parseName(),value:(this.expectToken(I.COLON),this.parseValueLiteral(!0)),loc:this.loc(n)}},t.parseFragment=function(){var n=this._lexer.token;this.expectToken(I.SPREAD);var i=this.expectOptionalKeyword("on");return!i&&this.peek(I.NAME)?{kind:$.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1),loc:this.loc(n)}:{kind:$.INLINE_FRAGMENT,typeCondition:i?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(n)}},t.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:$.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:$.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(i)}},t.parseFragmentName=function(){if(this._lexer.token.value==="on")throw this.unexpected();return this.parseName()},t.parseValueLiteral=function(n){var i=this._lexer.token;switch(i.kind){case I.BRACKET_L:return this.parseList(n);case I.BRACE_L:return this.parseObject(n);case I.INT:return this._lexer.advance(),{kind:$.INT,value:i.value,loc:this.loc(i)};case I.FLOAT:return this._lexer.advance(),{kind:$.FLOAT,value:i.value,loc:this.loc(i)};case I.STRING:case I.BLOCK_STRING:return this.parseStringLiteral();case I.NAME:switch(this._lexer.advance(),i.value){case"true":return{kind:$.BOOLEAN,value:!0,loc:this.loc(i)};case"false":return{kind:$.BOOLEAN,value:!1,loc:this.loc(i)};case"null":return{kind:$.NULL,loc:this.loc(i)};default:return{kind:$.ENUM,value:i.value,loc:this.loc(i)}}case I.DOLLAR:if(!n)return this.parseVariable();break}throw this.unexpected()},t.parseStringLiteral=function(){var n=this._lexer.token;return this._lexer.advance(),{kind:$.STRING,value:n.value,block:n.kind===I.BLOCK_STRING,loc:this.loc(n)}},t.parseList=function(n){var i=this,a=this._lexer.token,o=function(){return i.parseValueLiteral(n)};return{kind:$.LIST,values:this.any(I.BRACKET_L,o,I.BRACKET_R),loc:this.loc(a)}},t.parseObject=function(n){var i=this,a=this._lexer.token,o=function(){return i.parseObjectField(n)};return{kind:$.OBJECT,fields:this.any(I.BRACE_L,o,I.BRACE_R),loc:this.loc(a)}},t.parseObjectField=function(n){var i=this._lexer.token,a=this.parseName();return this.expectToken(I.COLON),{kind:$.OBJECT_FIELD,name:a,value:this.parseValueLiteral(n),loc:this.loc(i)}},t.parseDirectives=function(n){for(var i=[];this.peek(I.AT);)i.push(this.parseDirective(n));return i},t.parseDirective=function(n){var i=this._lexer.token;return this.expectToken(I.AT),{kind:$.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(n),loc:this.loc(i)}},t.parseTypeReference=function(){var n=this._lexer.token,i;return this.expectOptionalToken(I.BRACKET_L)?(i=this.parseTypeReference(),this.expectToken(I.BRACKET_R),i={kind:$.LIST_TYPE,type:i,loc:this.loc(n)}):i=this.parseNamedType(),this.expectOptionalToken(I.BANG)?{kind:$.NON_NULL_TYPE,type:i,loc:this.loc(n)}:i},t.parseNamedType=function(){var n=this._lexer.token;return{kind:$.NAMED_TYPE,name:this.parseName(),loc:this.loc(n)}},t.parseTypeSystemDefinition=function(){var n=this.peekDescription()?this._lexer.lookahead():this._lexer.token;if(n.kind===I.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)},t.peekDescription=function(){return this.peek(I.STRING)||this.peek(I.BLOCK_STRING)},t.parseDescription=function(){if(this.peekDescription())return this.parseStringLiteral()},t.parseSchemaDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("schema");var a=this.parseDirectives(!0),o=this.many(I.BRACE_L,this.parseOperationTypeDefinition,I.BRACE_R);return{kind:$.SCHEMA_DEFINITION,description:i,directives:a,operationTypes:o,loc:this.loc(n)}},t.parseOperationTypeDefinition=function(){var n=this._lexer.token,i=this.parseOperationType();this.expectToken(I.COLON);var a=this.parseNamedType();return{kind:$.OPERATION_TYPE_DEFINITION,operation:i,type:a,loc:this.loc(n)}},t.parseScalarTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("scalar");var a=this.parseName(),o=this.parseDirectives(!0);return{kind:$.SCALAR_TYPE_DEFINITION,description:i,name:a,directives:o,loc:this.loc(n)}},t.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:$.OBJECT_TYPE_DEFINITION,description:i,name:a,interfaces:o,directives:s,fields:u,loc:this.loc(n)}},t.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(I.AMP);do i.push(this.parseNamedType());while(this.expectOptionalToken(I.AMP)||this.peek(I.NAME));return i}return this.delimitedMany(I.AMP,this.parseNamedType)},t.parseFieldsDefinition=function(){var n;return((n=this._options)===null||n===void 0?void 0:n.allowLegacySDLEmptyFields)===!0&&this.peek(I.BRACE_L)&&this._lexer.lookahead().kind===I.BRACE_R?(this._lexer.advance(),this._lexer.advance(),[]):this.optionalMany(I.BRACE_L,this.parseFieldDefinition,I.BRACE_R)},t.parseFieldDefinition=function(){var n=this._lexer.token,i=this.parseDescription(),a=this.parseName(),o=this.parseArgumentDefs();this.expectToken(I.COLON);var s=this.parseTypeReference(),u=this.parseDirectives(!0);return{kind:$.FIELD_DEFINITION,description:i,name:a,arguments:o,type:s,directives:u,loc:this.loc(n)}},t.parseArgumentDefs=function(){return this.optionalMany(I.PAREN_L,this.parseInputValueDef,I.PAREN_R)},t.parseInputValueDef=function(){var n=this._lexer.token,i=this.parseDescription(),a=this.parseName();this.expectToken(I.COLON);var o=this.parseTypeReference(),s;this.expectOptionalToken(I.EQUALS)&&(s=this.parseValueLiteral(!0));var u=this.parseDirectives(!0);return{kind:$.INPUT_VALUE_DEFINITION,description:i,name:a,type:o,defaultValue:s,directives:u,loc:this.loc(n)}},t.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:$.INTERFACE_TYPE_DEFINITION,description:i,name:a,interfaces:o,directives:s,fields:u,loc:this.loc(n)}},t.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:$.UNION_TYPE_DEFINITION,description:i,name:a,directives:o,types:s,loc:this.loc(n)}},t.parseUnionMemberTypes=function(){return this.expectOptionalToken(I.EQUALS)?this.delimitedMany(I.PIPE,this.parseNamedType):[]},t.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:$.ENUM_TYPE_DEFINITION,description:i,name:a,directives:o,values:s,loc:this.loc(n)}},t.parseEnumValuesDefinition=function(){return this.optionalMany(I.BRACE_L,this.parseEnumValueDefinition,I.BRACE_R)},t.parseEnumValueDefinition=function(){var n=this._lexer.token,i=this.parseDescription(),a=this.parseName(),o=this.parseDirectives(!0);return{kind:$.ENUM_VALUE_DEFINITION,description:i,name:a,directives:o,loc:this.loc(n)}},t.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:$.INPUT_OBJECT_TYPE_DEFINITION,description:i,name:a,directives:o,fields:s,loc:this.loc(n)}},t.parseInputFieldsDefinition=function(){return this.optionalMany(I.BRACE_L,this.parseInputValueDef,I.BRACE_R)},t.parseTypeSystemExtension=function(){var n=this._lexer.lookahead();if(n.kind===I.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)},t.parseSchemaExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");var i=this.parseDirectives(!0),a=this.optionalMany(I.BRACE_L,this.parseOperationTypeDefinition,I.BRACE_R);if(i.length===0&&a.length===0)throw this.unexpected();return{kind:$.SCHEMA_EXTENSION,directives:i,operationTypes:a,loc:this.loc(n)}},t.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:$.SCALAR_TYPE_EXTENSION,name:i,directives:a,loc:this.loc(n)}},t.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:$.OBJECT_TYPE_EXTENSION,name:i,interfaces:a,directives:o,fields:s,loc:this.loc(n)}},t.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:$.INTERFACE_TYPE_EXTENSION,name:i,interfaces:a,directives:o,fields:s,loc:this.loc(n)}},t.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:$.UNION_TYPE_EXTENSION,name:i,directives:a,types:o,loc:this.loc(n)}},t.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:$.ENUM_TYPE_EXTENSION,name:i,directives:a,values:o,loc:this.loc(n)}},t.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:$.INPUT_OBJECT_TYPE_EXTENSION,name:i,directives:a,fields:o,loc:this.loc(n)}},t.parseDirectiveDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("directive"),this.expectToken(I.AT);var a=this.parseName(),o=this.parseArgumentDefs(),s=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");var u=this.parseDirectiveLocations();return{kind:$.DIRECTIVE_DEFINITION,description:i,name:a,arguments:o,repeatable:s,locations:u,loc:this.loc(n)}},t.parseDirectiveLocations=function(){return this.delimitedMany(I.PIPE,this.parseDirectiveLocation)},t.parseDirectiveLocation=function(){var n=this._lexer.token,i=this.parseName();if(zm[i.value]!==void 0)return i;throw this.unexpected(n)},t.loc=function(n){var i;if(((i=this._options)===null||i===void 0?void 0:i.noLocation)!==!0)return new Dp(n,this._lexer.lastToken,this._lexer.source)},t.peek=function(n){return this._lexer.token.kind===n},t.expectToken=function(n){var i=this._lexer.token;if(i.kind===n)return this._lexer.advance(),i;throw ct(this._lexer.source,i.start,"Expected ".concat(Cp(n),", found ").concat(fc(i),"."))},t.expectOptionalToken=function(n){var i=this._lexer.token;if(i.kind===n)return this._lexer.advance(),i},t.expectKeyword=function(n){var i=this._lexer.token;if(i.kind===I.NAME&&i.value===n)this._lexer.advance();else throw ct(this._lexer.source,i.start,'Expected "'.concat(n,'", found ').concat(fc(i),"."))},t.expectOptionalKeyword=function(n){var i=this._lexer.token;return i.kind===I.NAME&&i.value===n?(this._lexer.advance(),!0):!1},t.unexpected=function(n){var i=n??this._lexer.token;return ct(this._lexer.source,i.start,"Unexpected ".concat(fc(i),"."))},t.any=function(n,i,a){this.expectToken(n);for(var o=[];!this.expectOptionalToken(a);)o.push(i.call(this));return o},t.optionalMany=function(n,i,a){if(this.expectOptionalToken(n)){var o=[];do o.push(i.call(this));while(!this.expectOptionalToken(a));return o}return[]},t.many=function(n,i,a){this.expectToken(n);var o=[];do o.push(i.call(this));while(!this.expectOptionalToken(a));return o},t.delimitedMany=function(n,i){this.expectOptionalToken(n);var a=[];do a.push(i.call(this));while(this.expectOptionalToken(n));return a},e}();function fc(e){var t=e.value;return Cp(e.kind)+(t!=null?' "'.concat(t,'"'):"")}function Cp(e){return Hm(e)?'"'.concat(e,'"'):e}var ho=new Map,Rc=new Map,Pp=!0,To=!1;function Lp(e){return e.replace(/[\s,]+/g," ").trim()}function sg(e){return Lp(e.source.body.substring(e.start,e.end))}function cg(e){var t=new Set,r=[];return e.definitions.forEach(function(n){if(n.kind==="FragmentDefinition"){var i=n.name.value,a=sg(n.loc),o=Rc.get(i);o&&!o.has(a)?Pp&&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||Cc.set(i,o=new Set),o.add(a),t.has(a)||(t.add(a),r.push(n))}else r.push(n)}),xo(xo({},e),{definitions:r})}function ug(e){var t=new Set(e.definitions);t.forEach(function(n){n.loc&&delete n.loc,Object.keys(n).forEach(function(i){var a=n[i];a&&typeof a=="object"&&t.add(a)})});var r=e.loc;return r&&(delete r.startToken,delete r.endToken),e}function lg(e){var t=Lp(e);if(!ho.has(t)){var r=ag(e,{experimentalFragmentVariables:To,allowLegacyFragmentVariables:To});if(!r||r.kind!=="Document")throw new Error("Not a valid GraphQL document.");ho.set(t,ug(cg(r)))}return ho.get(t)}function E(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];typeof e=="string"&&(e=[e]);var n=e[0];return t.forEach(function(i,a){i&&i.kind==="Document"?n+=i.loc.source.body:n+=i,n+=e[a+1]}),lg(n)}function fg(){ho.clear(),Cc.clear()}function pg(){Pp=!1}function dg(){To=!0}function hg(){To=!1}var Ei={gql:E,resetCaches:fg,disableFragmentWarnings:pg,enableExperimentalFragmentVariables:dg,disableExperimentalFragmentVariables:hg};(function(e){e.gql=Ei.gql,e.resetCaches=Ei.resetCaches,e.disableFragmentWarnings=Ei.disableFragmentWarnings,e.enableExperimentalFragmentVariables=Ei.enableExperimentalFragmentVariables,e.disableExperimentalFragmentVariables=Ei.disableExperimentalFragmentVariables})(E||(E={}));E.default=E;function k(e){if(!e)throw"Got no result from Apollo";if(e.error)throw e.error;if(e.errors)throw e.errors;return e.data}function mg(){}function tu(){return mg}var w=tu,Ue=tu,W=tu,Fp=function(e,t,r,n){var i=arguments.length,a=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},Mp=function(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)},tn=class{constructor(t){this.code=t}};Fp([w(),Mp("design:type",String)],tn.prototype,"code",void 0);tn=Fp([W(),Mp("design:paramtypes",[String])],tn);var ru=function(e,t,r,n){var i=arguments.length,a=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},nu=function(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)},jt=class{constructor(t,r){this.address=t,this.name=r}};ru([w(),nu("design:type",String)],jt.prototype,"address",void 0);ru([w(),nu("design:type",String)],jt.prototype,"name",void 0);jt=ru([W(),nu("design:paramtypes",[String,String])],jt);var ge=function(e,t,r,n){var i=arguments.length,a=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},De=function(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)},Sr=class{constructor(t,r){this.key=r,this.signature=t}};ge([w(),De("design:type",String)],Sr.prototype,"signature",void 0);ge([w(),De("design:type",String)],Sr.prototype,"key",void 0);ge([w(),De("design:type",Boolean)],Sr.prototype,"valid",void 0);ge([w(),De("design:type",Boolean)],Sr.prototype,"invalid",void 0);Sr=ge([W(),Ue(),De("design:paramtypes",[String,String])],Sr);var rn=class{};ge([w(),De("design:type",String)],rn.prototype,"signature",void 0);ge([w(),De("design:type",String)],rn.prototype,"key",void 0);ge([w(),De("design:type",Boolean)],rn.prototype,"valid",void 0);ge([w(),De("design:type",Boolean)],rn.prototype,"invalid",void 0);rn=ge([Ue()],rn);function Ar(e){let t=class{constructor(n,i,a,o){this.author=n,this.timestamp=i,this.data=a,this.proof=o}};return ge([w(),De("design:type",String)],t.prototype,"author",void 0),ge([w(),De("design:type",String)],t.prototype,"timestamp",void 0),ge([w(),De("design:type",Object)],t.prototype,"data",void 0),ge([w(),De("design:type",Sr)],t.prototype,"proof",void 0),t=ge([W(),De("design:paramtypes",[String,String,Object,Sr])],t),t}function gg(e){let t=class{};return ge([w(),De("design:type",String)],t.prototype,"author",void 0),ge([w(),De("design:type",String)],t.prototype,"timestamp",void 0),ge([w(),De("design:type",Object)],t.prototype,"data",void 0),ge([w(),De("design:type",rn)],t.prototype,"proof",void 0),t=ge([Ue()],t),t}var Sf=class extends Ar(){};Sf=ge([W()],Sf);var Io=class extends Ar(){};ge([w(),De("design:type",jt)],Io.prototype,"language",void 0);ge([w(),De("design:type",tn)],Io.prototype,"icon",void 0);Io=ge([W()],Io);function _I(e){return e&&e.author&&e.timestamp&&e.data}var Te=function(e,t,r,n){var i=arguments.length,a=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},qe=function(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)},nn=class{constructor(t){this.source=t.source?t.source:"",this.target=t.target?t.target:"",this.predicate=t.predicate?t.predicate:""}};Te([w(),qe("design:type",String)],nn.prototype,"source",void 0);Te([w(),qe("design:type",String)],nn.prototype,"target",void 0);Te([w(),qe("design:type",String)],nn.prototype,"predicate",void 0);nn=Te([W(),qe("design:paramtypes",[Object])],nn);var ko=class{};Te([w(),qe("design:type",Array)],ko.prototype,"additions",void 0);Te([w(),qe("design:type",Array)],ko.prototype,"removals",void 0);ko=Te([Ue()],ko);var Oo=class{constructor(t,r){this.additions=t,this.removals=r}};Te([w(),qe("design:type",Array)],Oo.prototype,"additions",void 0);Te([w(),qe("design:type",Array)],Oo.prototype,"removals",void 0);Oo=Te([W(),qe("design:paramtypes",[Array,Array])],Oo);var Hi=class{};Te([w(),qe("design:type",String)],Hi.prototype,"source",void 0);Te([w(),qe("design:type",String)],Hi.prototype,"target",void 0);Te([w(),qe("design:type",String)],Hi.prototype,"predicate",void 0);Hi=Te([Ue()],Hi);var an=class extends Ar(){hash(){let t=JSON.stringify(this.data,Object.keys(this.data).sort())+JSON.stringify(this.author)+this.timestamp,r=0,n,i;for(n=0;n<t.length;n++)i=t.charCodeAt(n),r=(r<<5)-r+i,r|=0;return r}};Te([w(),qe("design:type",String)],an.prototype,"status",void 0);an=Te([W()],an);var Rc=class extends gg(){};Te([w(),qe("design:type",String)],Rc.prototype,"status",void 0);Rc=Te([Ue()],Rc);function kI(e,t){return e.author==t.author&&e.timestamp==t.timestamp&&e.data.source==t.data.source&&e.data.predicate==t.data.predicate&&e.data.target==t.data.target}function OI(e){return e&&e.source&&e.target}var Ao=class{constructor(t,r){this.oldLink=t,this.newLink=r}};Te([w(),qe("design:type",an)],Ao.prototype,"oldLink",void 0);Te([w(),qe("design:type",an)],Ao.prototype,"newLink",void 0);Ao=Te([W(),qe("design:paramtypes",[an,an])],Ao);var fn=function(e,t,r,n){var i=arguments.length,a=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},sa=function(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)},Pc,Er=class{constructor(t){t?this.links=t:this.links=[]}get(t){if(!t||!t.source&&!t.predicate&&!t.target)return this.links;if(t.source){let n=JSON.parse(JSON.stringify(this.links));return t.target&&(n=n.filter(i=>i.data.target===t.target)),t.predicate&&(n=n.filter(i=>i.data.predicate===t.predicate)),t.fromDate&&(n=n.filter(i=>new Date(i.timestamp)>=t.fromDate)),t.untilDate&&(n=n.filter(i=>new Date(i.timestamp)<=t.untilDate)),t.limit&&(n=n.slice(0,t.limit)),n}if(t.target){let n=JSON.parse(JSON.stringify(this.links));return t.predicate&&(n=n.filter(i=>i.data.predicate===t.predicate)),t.fromDate&&(n=n.filter(i=>new Date(i.timestamp)>=t.fromDate)),t.untilDate&&(n=n.filter(i=>new Date(i.timestamp)<=t.untilDate)),t.limit&&(n=n.slice(0,t.limit)),n}let r=JSON.parse(JSON.stringify(this.links));return r=r.filter(n=>n.data.predicate===t.predicate),t.limit&&(r=r.slice(0,t.limit)),r}getSingleTarget(t){delete t.target;let r=this.get(t);return r.length?r[0].data.target:null}};fn([w(),sa("design:type",Array)],Er.prototype,"links",void 0);Er=fn([W(),sa("design:paramtypes",[Array])],Er);var Lc=class{};fn([w(),sa("design:type",Array)],Lc.prototype,"links",void 0);Lc=fn([Ue()],Lc);var Fc=Pc=class{constructor(t){t?this.links=t:this.links=[]}static fromLink(t){let r=new Pc;return r.links.push(t),r}};fn([w(),sa("design:type",Array)],Fc.prototype,"links",void 0);Fc=Pc=fn([Ue(),sa("design:paramtypes",[Array])],Fc);var Mc=class extends Ar(){};Mc=fn([W()],Mc);var F=function(e,t,r,n){var i=arguments.length,a=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},M=function(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)},yr=class{constructor(t,r){this.did=t,r?this.perspective=r:this.perspective=new Er}};F([w(),M("design:type",String)],yr.prototype,"did",void 0);F([w(),M("design:type",Er)],yr.prototype,"perspective",void 0);F([w(),M("design:type",String)],yr.prototype,"directMessageLanguage",void 0);yr=F([W(),M("design:paramtypes",[String,Er])],yr);var Ef=class extends Ar(){};Ef=F([W()],Ef);var xr=class{constructor(t,r,n,i,a,o){this.did=t,this.didSigningKeyId=r,this.deviceKeyType=n,this.deviceKey=i,this.deviceKeySignedByDid=a,this.didSignedByDeviceKey=o}};F([w(),M("design:type",String)],xr.prototype,"did",void 0);F([w(),M("design:type",String)],xr.prototype,"didSigningKeyId",void 0);F([w(),M("design:type",String)],xr.prototype,"deviceKeyType",void 0);F([w(),M("design:type",String)],xr.prototype,"deviceKey",void 0);F([w(),M("design:type",String)],xr.prototype,"deviceKeySignedByDid",void 0);F([w(),M("design:type",String)],xr.prototype,"didSignedByDeviceKey",void 0);xr=F([W(),M("design:paramtypes",[String,String,String,String,String,String])],xr);var Tr=class{constructor(t,r,n,i,a,o){this.did=t,this.didSigningKeyId=r,this.deviceKeyType=n,this.deviceKey=i,this.deviceKeySignedByDid=a,this.didSignedByDeviceKey=o}};F([w(),M("design:type",String)],Tr.prototype,"did",void 0);F([w(),M("design:type",String)],Tr.prototype,"didSigningKeyId",void 0);F([w(),M("design:type",String)],Tr.prototype,"deviceKeyType",void 0);F([w(),M("design:type",String)],Tr.prototype,"deviceKey",void 0);F([w(),M("design:type",String)],Tr.prototype,"deviceKeySignedByDid",void 0);F([w(),M("design:type",String)],Tr.prototype,"didSignedByDeviceKey",void 0);Tr=F([Ue(),M("design:paramtypes",[String,String,String,String,String,String])],Tr);var Do=class{constructor(t,r){this.signature=t,this.publicKey=r}};F([w(),M("design:type",String)],Do.prototype,"signature",void 0);F([w(),M("design:type",String)],Do.prototype,"publicKey",void 0);Do=F([W(),M("design:paramtypes",[String,String])],Do);var Vn=class{constructor(t,r){this.domain=t,this.pointers=r}};F([w(),M("design:type",String)],Vn.prototype,"domain",void 0);F([w(),M("design:type",Array)],Vn.prototype,"pointers",void 0);Vn=F([W(),M("design:paramtypes",[String,Array])],Vn);var No=class{constructor(t,r){this.with=t,this.can=r}};F([w(),M("design:type",Vn)],No.prototype,"with",void 0);F([w(),M("design:type",Array)],No.prototype,"can",void 0);No=F([W(),M("design:paramtypes",[Vn,Array])],No);var er=class{constructor(t,r,n,i,a){this.appName=t,this.appDesc=r,this.appIconPath=a,this.appUrl=n,this.capabilities=i}};F([w(),M("design:type",String)],er.prototype,"appName",void 0);F([w(),M("design:type",String)],er.prototype,"appDesc",void 0);F([w(),M("design:type",String)],er.prototype,"appUrl",void 0);F([w(),M("design:type",String)],er.prototype,"appIconPath",void 0);F([w(),M("design:type",Array)],er.prototype,"capabilities",void 0);er=F([W(),M("design:paramtypes",[String,String,String,Array,String])],er);var Qn=class{constructor(t,r,n,i){this.requestId=t,this.auth=r,this.token=n,this.revoked=i}};F([w(),M("design:type",String)],Qn.prototype,"requestId",void 0);F([w(),M("design:type",String)],Qn.prototype,"token",void 0);F([w(),M("design:type",Boolean)],Qn.prototype,"revoked",void 0);F([w(),M("design:type",er)],Qn.prototype,"auth",void 0);Qn=F([W(),M("design:paramtypes",[String,er,String,Boolean])],Qn);var zn=class{constructor(t,r){this.domain=t,this.pointers=r}};F([w(),M("design:type",String)],zn.prototype,"domain",void 0);F([w(),M("design:type",Array)],zn.prototype,"pointers",void 0);zn=F([Ue(),M("design:paramtypes",[String,Array])],zn);var Co=class{constructor(t,r){this.with=t,this.can=r}};F([w(),M("design:type",zn)],Co.prototype,"with",void 0);F([w(),M("design:type",Array)],Co.prototype,"can",void 0);Co=F([Ue(),M("design:paramtypes",[zn,Array])],Co);var Ir=class{constructor(t,r,n,i,a,o){this.appName=t,this.appDesc=r,this.appUrl=i,this.appDomain=n,this.capabilities=o,this.appIconPath=a}};F([w(),M("design:type",String)],Ir.prototype,"appName",void 0);F([w(),M("design:type",String)],Ir.prototype,"appDesc",void 0);F([w(),M("design:type",String)],Ir.prototype,"appDomain",void 0);F([w(),M("design:type",String)],Ir.prototype,"appUrl",void 0);F([w(),M("design:type",String)],Ir.prototype,"appIconPath",void 0);F([w(),M("design:type",Array)],Ir.prototype,"capabilities",void 0);Ir=F([Ue(),M("design:paramtypes",[String,String,String,String,String,Array])],Ir);var Hn=function(e,t,r,n){var i=arguments.length,a=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},Jn=function(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)},gt=class{constructor(t){t?(this.isInitialized=t.isInitialized,this.isInitialized||(this.isInitialized=!1),this.isUnlocked=t.isUnlocked,this.isUnlocked||(this.isUnlocked=!1),this.did=t.did,this.didDocument=t.didDocument,this.error=t.error):(this.isInitialized=!1,this.isUnlocked=!1)}};Hn([w(),Jn("design:type",Boolean)],gt.prototype,"isInitialized",void 0);Hn([w(),Jn("design:type",Boolean)],gt.prototype,"isUnlocked",void 0);Hn([w(),Jn("design:type",String)],gt.prototype,"did",void 0);Hn([w(),Jn("design:type",String)],gt.prototype,"didDocument",void 0);Hn([w(),Jn("design:type",String)],gt.prototype,"error",void 0);gt=Hn([W(),Jn("design:paramtypes",[Object])],gt);var xf=function(e,t,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 t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(e,r):i?i.value=r:t.set(e,r),r},Se=function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},et,tt,$c=class{constructor(t,r){et.set(this,void 0),tt.set(this,void 0),xf(this,et,t,"f"),xf(this,tt,r,"f")}async otherAgents(){return await Se(this,et,"f").otherAgents(Se(this,tt,"f"))}async hasTelepresenceAdapter(){return await Se(this,et,"f").hasTelepresenceAdapter(Se(this,tt,"f"))}async onlineAgents(){return await Se(this,et,"f").onlineAgents(Se(this,tt,"f"))}async setOnlineStatus(t){return await Se(this,et,"f").setOnlineStatus(Se(this,tt,"f"),t)}async setOnlineStatusU(t){return await Se(this,et,"f").setOnlineStatusU(Se(this,tt,"f"),t)}async sendSignal(t,r){return await Se(this,et,"f").sendSignal(Se(this,tt,"f"),t,r)}async sendSignalU(t,r){return await Se(this,et,"f").sendSignalU(Se(this,tt,"f"),t,r)}async sendBroadcast(t){return await Se(this,et,"f").sendBroadcast(Se(this,tt,"f"),t)}async sendBroadcastU(t){return await Se(this,et,"f").sendBroadcastU(Se(this,tt,"f"),t)}async addSignalHandler(t){await Se(this,et,"f").addSignalHandler(Se(this,tt,"f"),t)}removeSignalHandler(t){Se(this,et,"f").removeSignalHandler(Se(this,tt,"f"),t)}};et=new WeakMap,tt=new WeakMap;var pn=function(e,t,r,n){var i=arguments.length,a=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},dn=function(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)},lt=class{constructor(t){t&&(this.source=t.source,this.predicate=t.predicate,this.target=t.target,t.fromDate&&(this.fromDate=t.fromDate),t.untilDate&&(this.untilDate=t.untilDate),t.limit&&(this.limit=t.limit))}isMatch(t){return!(this.source&&this.source!==t.source||this.predicate&&this.predicate!==t.predicate||this.target&&this.target!==t.target)}};pn([w(),dn("design:type",String)],lt.prototype,"source",void 0);pn([w(),dn("design:type",String)],lt.prototype,"target",void 0);pn([w(),dn("design:type",String)],lt.prototype,"predicate",void 0);pn([w(),dn("design:type",Date)],lt.prototype,"fromDate",void 0);pn([w(),dn("design:type",Date)],lt.prototype,"untilDate",void 0);pn([w(),dn("design:type",Number)],lt.prototype,"limit",void 0);lt=pn([W(),Ue(),dn("design:paramtypes",[Object])],lt);var Tf=function(e,t,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 t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(e,r):i?i.value=r:t.set(e,r),r},Xe=function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},xt,Ht;function pc(e){return encodeURIComponent(e).replace(/[!'()*]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`)}var kt=class{constructor(){xt.set(this,void 0),Ht.set(this,void 0)}static fromUrl(t){if(!t||!t.startsWith("literal://"))throw new Error("Can't create Literal from non-literal URL");let r=new kt;return Tf(r,Ht,t,"f"),r}static from(t){let r=new kt;return Tf(r,xt,t,"f"),r}toUrl(){if(Xe(this,Ht,"f")&&!Xe(this,xt,"f"))return Xe(this,Ht,"f");if(!Xe(this,Ht,"f")&&!Xe(this,xt,"f"))throw new Error("Can't turn empty Literal into URL");let t;switch(typeof Xe(this,xt,"f")){case"string":t=`string:${pc(Xe(this,xt,"f"))}`;break;case"number":t=`number:${pc(Xe(this,xt,"f"))}`;break;case"object":t=`json:${pc(JSON.stringify(Xe(this,xt,"f")))}`;break}return`literal://${t}`}get(){if(Xe(this,xt,"f"))return Xe(this,xt,"f");if(!Xe(this,Ht,"f"))throw new Error("Can't render empty Literal");if(!Xe(this,Ht,"f").startsWith("literal://"))throw new Error("Can't render Literal from non-literal URL");let t=Xe(this,Ht,"f").substring(10);if(t.startsWith("string:"))return decodeURIComponent(t.substring(7));if(t.startsWith("number:")){let r=t.substring(7);return parseFloat(r)}if(t.startsWith("json:")){let r=t.substring(5);return JSON.parse(decodeURIComponent(r))}throw new Error(`Can't parse unknown literal: ${t}`)}};xt=new WeakMap,Ht=new WeakMap;function vr(e){return e.charAt(0).toUpperCase()+e.slice(1)}function $p(e){return`set${vr(e)}`}function Xt(e){return e.endsWith("y")?e.slice(0,-1)+"ies":e+"s"}function iu(e){return e.endsWith("ies")?e.slice(0,-3)+"y":e.endsWith("s")?e.slice(0,-1):e}function yg(e){return`add${vr(iu(e))}`}function vg(e){let t=e.substring(3),r=Xt(t);return r.charAt(0).toLowerCase()+r.slice(1)}function bg(e){return`remove${vr(iu(e))}`}function _g(e){let t=e.substring(6),r=Xt(t);return r.charAt(0).toLowerCase()+r.slice(1)}function wg(e){let t=e.substring(13),r=Xt(t);return r.charAt(0).toLowerCase()+r.slice(1)}function Sg(e){return`setCollection${vr(iu(e))}`}function Vr(e){if(Array.isArray(e))return`[${e.map(Vr).join(", ")}]`;let t=Object.keys(e),r=[];for(let n of t){let i=JSON.stringify(e[n]),a=`${n}: ${i}`;r.push(a)}return`{${r.join(", ")}}`}var dc=function(e,t,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 t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(e,r):i?i.value=r:t.set(e,r),r},B=function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},ze,Ge,ve,Ro=class{constructor(e,t,r){ze.set(this,void 0),Ge.set(this,void 0),ve.set(this,void 0),dc(this,ze,t,"f"),dc(this,Ge,r,"f"),dc(this,ve,e,"f")}get baseExpression(){return B(this,ze,"f")}async init(){let isInstance=await B(this,ve,"f").isSubjectInstance(B(this,ze,"f"),B(this,Ge,"f"));if(!isInstance)throw`Not a valid subject instance of ${B(this,Ge,"f")} for ${B(this,ze,"f")}`;let results=await B(this,ve,"f").infer(`subject_class("${B(this,Ge,"f")}", C), property(C, Property)`),properties=results.map(e=>e.Property);for(let e of properties){let t=await B(this,ve,"f").infer(`subject_class("${B(this,Ge,"f")}", C), property_resolve(C, "${e}")`);Object.defineProperty(this,e,{configurable:!0,get:async()=>{let r=await B(this,ve,"f").infer(`subject_class("${B(this,Ge,"f")}", C), property_getter(C, "${B(this,ze,"f")}", "${e}", Value)`);if(r&&r.length>0){let n=r[0].Value;if(t)try{if(n){let i=await B(this,ve,"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 B(this,ve,"f").infer(`subject_class("${B(this,Ge,"f")}", C), property_setter(C, Property, Setter)`);for(let setter of setters||[])if(setter){let property=setter.Property,actions=eval(setter.Setter),resolveLanguageResults=await B(this,ve,"f").infer(`subject_class("${B(this,Ge,"f")}", C), property_resolve_language(C, "${property}", Language)`),resolveLanguage;resolveLanguageResults&&resolveLanguageResults.length>0&&(resolveLanguage=resolveLanguageResults[0].Language),this[$p(property)]=async e=>{resolveLanguage&&(e=await B(this,ve,"f").createExpression(e,resolveLanguage)),await B(this,ve,"f").executeAction(actions,B(this,ze,"f"),[{name:"value",value:e}])}}let results2=await B(this,ve,"f").infer(`subject_class("${B(this,Ge,"f")}", C), collection(C, Collection)`);results2||(results2=[]);let collections=results2.map(e=>e.Collection);for(let e of collections)Object.defineProperty(this,e,{configurable:!0,get:async()=>{let t=await B(this,ve,"f").infer(`subject_class("${B(this,Ge,"f")}", C), collection_getter(C, "${B(this,ze,"f")}", "${e}", Value)`);return t&&t.length>0&&t[0].Value?t[0].Value.filter(n=>n!==""&&n!==""):[]}});let adders=await B(this,ve,"f").infer(`subject_class("${B(this,Ge,"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[yg(collection)]=async e=>{Array.isArray(e)?await Promise.all(e.map(t=>B(this,ve,"f").executeAction(actions,B(this,ze,"f"),[{name:"value",value:t}]))):await B(this,ve,"f").executeAction(actions,B(this,ze,"f"),[{name:"value",value:e}])}}let removers=await B(this,ve,"f").infer(`subject_class("${B(this,Ge,"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[bg(collection)]=async e=>{Array.isArray(e)?await Promise.all(e.map(t=>B(this,ve,"f").executeAction(actions,B(this,ze,"f"),[{name:"value",value:t}]))):await B(this,ve,"f").executeAction(actions,B(this,ze,"f"),[{name:"value",value:e}])}}let collectionSetters=await B(this,ve,"f").infer(`subject_class("${B(this,Ge,"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[Sg(collection)]=async e=>{Array.isArray(e)?await B(this,ve,"f").executeAction(actions,B(this,ze,"f"),e.map(t=>({name:"value",value:t}))):await B(this,ve,"f").executeAction(actions,B(this,ze,"f"),[{name:"value",value:e}])}}}};ze=new WeakMap,Ge=new WeakMap,ve=new WeakMap;var Pn=function(e,t,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 t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(e,r):i?i.value=r:t.set(e,r),r},L=function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},oe,le,Qr,zr,Gr,ki,qn=class{constructor(e,t){oe.set(this,void 0),le.set(this,void 0),Qr.set(this,void 0),zr.set(this,void 0),Gr.set(this,void 0),ki.set(this,void 0),Pn(this,Qr,[],"f"),Pn(this,zr,[],"f"),Pn(this,Gr,[],"f"),Pn(this,ki,[],"f"),Pn(this,oe,e,"f"),Pn(this,le,t,"f"),this.uuid=L(this,oe,"f").uuid,this.name=L(this,oe,"f").name,this.sharedUrl=L(this,oe,"f").sharedUrl,this.neighbourhood=L(this,oe,"f").neighbourhood,this.state=L(this,oe,"f").state,L(this,le,"f").addPerspectiveLinkAddedListener(L(this,oe,"f").uuid,L(this,Qr,"f")),L(this,le,"f").addPerspectiveLinkRemovedListener(L(this,oe,"f").uuid,L(this,zr,"f")),L(this,le,"f").addPerspectiveLinkUpdatedListener(L(this,oe,"f").uuid,L(this,Gr,"f")),L(this,le,"f").addPerspectiveSyncStateChangeListener(L(this,oe,"f").uuid,L(this,ki,"f"))}async executeAction(e,t,r){return await L(this,le,"f").executeCommands(L(this,oe,"f").uuid,JSON.stringify(e),t,JSON.stringify(r))}async get(e){return await L(this,le,"f").queryLinks(L(this,oe,"f").uuid,e)}async infer(e){return await L(this,le,"f").queryProlog(L(this,oe,"f").uuid,e)}async add(e,t="shared"){return await L(this,le,"f").addLink(L(this,oe,"f").uuid,e,t)}async addLinks(e,t="shared"){return await L(this,le,"f").addLinks(L(this,oe,"f").uuid,e,t)}async removeLinks(e){return await L(this,le,"f").removeLinks(L(this,oe,"f").uuid,e)}async linkMutations(e,t="shared"){return await L(this,le,"f").linkMutations(L(this,oe,"f").uuid,e,t)}async addLinkExpression(e,t="shared"){return await L(this,le,"f").addLinkExpression(L(this,oe,"f").uuid,e,t)}async update(e,t){return await L(this,le,"f").updateLink(L(this,oe,"f").uuid,e,t)}async remove(e){return await L(this,le,"f").removeLink(L(this,oe,"f").uuid,e)}async getExpression(e){return await L(this,le,"f").getExpression(e)}async createExpression(e,t){return await L(this,le,"f").createExpression(e,t)}async addListener(e,t){e==="link-added"?L(this,Qr,"f").push(t):e==="link-removed"?L(this,zr,"f").push(t):e==="link-updated"&&L(this,Gr,"f").push(t)}async addSyncStateChangeListener(e){L(this,ki,"f").push(e)}async removeListener(e,t){if(e==="link-added"){let r=L(this,Qr,"f").indexOf(t);L(this,Qr,"f").splice(r,1)}else if(e==="link-removed"){let r=L(this,zr,"f").indexOf(t);L(this,zr,"f").splice(r,1)}else if(e==="link-updated"){let r=L(this,Gr,"f").indexOf(t);L(this,Gr,"f").splice(r,1)}}async snapshot(){return L(this,le,"f").snapshotByUUID(L(this,oe,"f").uuid)}async loadSnapshot(e){let t=JSON.parse(JSON.stringify(e));delete t.__typename,t.links.forEach(r=>{delete r.data.__typename});for(let r of t.links)await this.addLinkExpression(r)}async getSingleTarget(e){delete e.target;let t=await this.get(e);return t.length?t[0].data.target:null}async setSingleTarget(e,t="shared"){let r=new lt({source:e.source,predicate:e.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=[e];await this.linkMutations({additions:a,removals:i},t)}async sdnaFlows(){return(await this.infer("register_sdna_flow(X, _)")).map(t=>t.X)}async availableFlows(e){return(await this.infer(`flowable("${e}", 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(e,t){return(await this.infer(`register_sdna_flow("${e}", F), flow_state(X, ${t}, F)`)).map(n=>n.X)}async flowState(e,t){return(await this.infer(`register_sdna_flow("${e}", F), flow_state("${t}", X, F)`))[0].X}async flowActions(e,t){return(await this.infer(`register_sdna_flow("${e}", Flow), flow_state("${t}", State, Flow), action(State, Name, _, _)`)).map(n=>n.Name)}async runFlowAction(flowName,exprAddr,actionName){let action=await this.infer(`register_sdna_flow("${flowName}", Flow), flow_state("${exprAddr}", State, Flow), action(State, "${actionName}", _, Action)`);action=eval(action[0].Action),await this.executeAction(action,exprAddr,void 0)}async getSdna(){return(await this.get(new lt({predicate:"ad4m://sdna"}))).map(t=>t.data.target).map(t=>kt.fromUrl(t).get())}async addSdna(e,t,r){return L(this,le,"f").addSdna(L(this,oe,"f").uuid,e,t,r)}async subjectClasses(){try{return(await this.infer("subject_class(X, _)")).map(e=>e.X)}catch{return[]}}async stringOrTemplateObjectToSubjectClass(e){if(typeof e=="string")return e;{let t=await this.subjectClassesByTemplate(e);return t[0]?t[0]:e.className}}async createSubject(e,t){let r;if(typeof e=="string")r=e,await L(this,le,"f").createSubject(L(this,oe,"f").uuid,JSON.stringify({className:r}),t);else{let n=this.buildQueryFromTemplate(e);await L(this,le,"f").createSubject(L(this,oe,"f").uuid,JSON.stringify({query:n}),t)}return this.getSubjectProxy(t,e)}async getSubjectData(e,t){if(typeof e=="string")return JSON.parse(await L(this,le,"f").getSubjectData(L(this,oe,"f").uuid,JSON.stringify({className:e}),t));let r=this.buildQueryFromTemplate(e);return JSON.parse(await L(this,le,"f").getSubjectData(L(this,oe,"f").uuid,JSON.stringify({query:r}),t))}async removeSubject(subjectClass,exprAddr){let className=await this.stringOrTemplateObjectToSubjectClass(subjectClass),result=await this.infer(`subject_class("${className}", C), destructor(C, Actions)`);if(!result.length)throw"No constructor found for given subject class: "+className;let actions=result.map(x=>eval(x.Actions));await this.executeAction(actions[0],exprAddr,void 0)}async isSubjectInstance(e,t){let r=await this.stringOrTemplateObjectToSubjectClass(t),n=!1,i=5,a=0;for(;a<i&&!n;)n=await this.infer(`subject_class("${r}", C), instance(C, "${e}")`),a++;return n}async getSubjectProxy(e,t){if(!await this.isSubjectInstance(e,t))throw`Expression ${e} is not a subject instance of given class: ${JSON.stringify(t)}`;let r=await this.stringOrTemplateObjectToSubjectClass(t),n=new Ro(this,e,r);return await n.init(),n}async getAllSubjectInstances(e){let t=[];typeof e=="string"?t=[e]:t=await this.subjectClassesByTemplate(e);let r=[];for(let n of t){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(e){let t=[];typeof e=="string"?t=[e]:t=await this.subjectClassesByTemplate(e);let r=[];for(let n of t)r=await this.infer(`subject_class("${n}", C), instance(C, X)`);return r}buildQueryFromTemplate(e){let t;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(...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, "${vg(l)}", _)`;for(let l of s)c+=`, collection_remover(C, "${_g(l)}", _)`;for(let l of u)c+=`, collection_setter(C, "${wg(l)}", _)`;c+=".",t=c}(e),t}async subjectClassesByTemplate(e){let t=this.buildQueryFromTemplate(e),r=await this.infer(t);return r?r.map(n=>n.Class):[]}async ensureSDNASubjectClass(e){if((await this.subjectClassesByTemplate(new e)).length>0)return;let{name:r,sdna:n}=e.generateSDNA();await this.addSdna(r,n,"subject_class")}getNeighbourhoodProxy(){return L(this,le,"f").getNeighbourhoodProxy(L(this,oe,"f").uuid)}get ai(){return L(this,le,"f").aiClient}};oe=new WeakMap,le=new WeakMap,Qr=new WeakMap,zr=new WeakMap,Gr=new WeakMap,ki=new WeakMap;var pr=function(e,t,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 t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(e,r):i?i.value=r:t.set(e,r),r},Q=function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},ie,Oi,Ai,Di,mo,Ni,go,yo,ot=`
|
|
61
|
+
this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`):o||Rc.set(i,o=new Set),o.add(a),t.has(a)||(t.add(a),r.push(n))}else r.push(n)}),xo(xo({},e),{definitions:r})}function ug(e){var t=new Set(e.definitions);t.forEach(function(n){n.loc&&delete n.loc,Object.keys(n).forEach(function(i){var a=n[i];a&&typeof a=="object"&&t.add(a)})});var r=e.loc;return r&&(delete r.startToken,delete r.endToken),e}function lg(e){var t=Lp(e);if(!ho.has(t)){var r=ag(e,{experimentalFragmentVariables:To,allowLegacyFragmentVariables:To});if(!r||r.kind!=="Document")throw new Error("Not a valid GraphQL document.");ho.set(t,ug(cg(r)))}return ho.get(t)}function E(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];typeof e=="string"&&(e=[e]);var n=e[0];return t.forEach(function(i,a){i&&i.kind==="Document"?n+=i.loc.source.body:n+=i,n+=e[a+1]}),lg(n)}function fg(){ho.clear(),Rc.clear()}function pg(){Pp=!1}function dg(){To=!0}function hg(){To=!1}var Ei={gql:E,resetCaches:fg,disableFragmentWarnings:pg,enableExperimentalFragmentVariables:dg,disableExperimentalFragmentVariables:hg};(function(e){e.gql=Ei.gql,e.resetCaches=Ei.resetCaches,e.disableFragmentWarnings=Ei.disableFragmentWarnings,e.enableExperimentalFragmentVariables=Ei.enableExperimentalFragmentVariables,e.disableExperimentalFragmentVariables=Ei.disableExperimentalFragmentVariables})(E||(E={}));E.default=E;function k(e){if(!e)throw"Got no result from Apollo";if(e.error)throw e.error;if(e.errors)throw e.errors;return e.data}function mg(){}function tu(){return mg}var w=tu,Ue=tu,W=tu,Fp=function(e,t,r,n){var i=arguments.length,a=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},Mp=function(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)},tn=class{constructor(t){this.code=t}};Fp([w(),Mp("design:type",String)],tn.prototype,"code",void 0);tn=Fp([W(),Mp("design:paramtypes",[String])],tn);var ru=function(e,t,r,n){var i=arguments.length,a=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},nu=function(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)},jt=class{constructor(t,r){this.address=t,this.name=r}};ru([w(),nu("design:type",String)],jt.prototype,"address",void 0);ru([w(),nu("design:type",String)],jt.prototype,"name",void 0);jt=ru([W(),nu("design:paramtypes",[String,String])],jt);var ge=function(e,t,r,n){var i=arguments.length,a=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},De=function(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)},Sr=class{constructor(t,r){this.key=r,this.signature=t}};ge([w(),De("design:type",String)],Sr.prototype,"signature",void 0);ge([w(),De("design:type",String)],Sr.prototype,"key",void 0);ge([w(),De("design:type",Boolean)],Sr.prototype,"valid",void 0);ge([w(),De("design:type",Boolean)],Sr.prototype,"invalid",void 0);Sr=ge([W(),Ue(),De("design:paramtypes",[String,String])],Sr);var rn=class{};ge([w(),De("design:type",String)],rn.prototype,"signature",void 0);ge([w(),De("design:type",String)],rn.prototype,"key",void 0);ge([w(),De("design:type",Boolean)],rn.prototype,"valid",void 0);ge([w(),De("design:type",Boolean)],rn.prototype,"invalid",void 0);rn=ge([Ue()],rn);function Ar(e){let t=class{constructor(n,i,a,o){this.author=n,this.timestamp=i,this.data=a,this.proof=o}};return ge([w(),De("design:type",String)],t.prototype,"author",void 0),ge([w(),De("design:type",String)],t.prototype,"timestamp",void 0),ge([w(),De("design:type",Object)],t.prototype,"data",void 0),ge([w(),De("design:type",Sr)],t.prototype,"proof",void 0),t=ge([W(),De("design:paramtypes",[String,String,Object,Sr])],t),t}function gg(e){let t=class{};return ge([w(),De("design:type",String)],t.prototype,"author",void 0),ge([w(),De("design:type",String)],t.prototype,"timestamp",void 0),ge([w(),De("design:type",Object)],t.prototype,"data",void 0),ge([w(),De("design:type",rn)],t.prototype,"proof",void 0),t=ge([Ue()],t),t}var Sf=class extends Ar(){};Sf=ge([W()],Sf);var Io=class extends Ar(){};ge([w(),De("design:type",jt)],Io.prototype,"language",void 0);ge([w(),De("design:type",tn)],Io.prototype,"icon",void 0);Io=ge([W()],Io);function _I(e){return e&&e.author&&e.timestamp&&e.data}var Te=function(e,t,r,n){var i=arguments.length,a=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},qe=function(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)},nn=class{constructor(t){this.source=t.source?t.source:"",this.target=t.target?t.target:"",this.predicate=t.predicate?t.predicate:""}};Te([w(),qe("design:type",String)],nn.prototype,"source",void 0);Te([w(),qe("design:type",String)],nn.prototype,"target",void 0);Te([w(),qe("design:type",String)],nn.prototype,"predicate",void 0);nn=Te([W(),qe("design:paramtypes",[Object])],nn);var ko=class{};Te([w(),qe("design:type",Array)],ko.prototype,"additions",void 0);Te([w(),qe("design:type",Array)],ko.prototype,"removals",void 0);ko=Te([Ue()],ko);var Oo=class{constructor(t,r){this.additions=t,this.removals=r}};Te([w(),qe("design:type",Array)],Oo.prototype,"additions",void 0);Te([w(),qe("design:type",Array)],Oo.prototype,"removals",void 0);Oo=Te([W(),qe("design:paramtypes",[Array,Array])],Oo);var Hi=class{};Te([w(),qe("design:type",String)],Hi.prototype,"source",void 0);Te([w(),qe("design:type",String)],Hi.prototype,"target",void 0);Te([w(),qe("design:type",String)],Hi.prototype,"predicate",void 0);Hi=Te([Ue()],Hi);var an=class extends Ar(){hash(){let t=JSON.stringify(this.data,Object.keys(this.data).sort())+JSON.stringify(this.author)+this.timestamp,r=0,n,i;for(n=0;n<t.length;n++)i=t.charCodeAt(n),r=(r<<5)-r+i,r|=0;return r}};Te([w(),qe("design:type",String)],an.prototype,"status",void 0);an=Te([W()],an);var Cc=class extends gg(){};Te([w(),qe("design:type",String)],Cc.prototype,"status",void 0);Cc=Te([Ue()],Cc);function kI(e,t){return e.author==t.author&&e.timestamp==t.timestamp&&e.data.source==t.data.source&&e.data.predicate==t.data.predicate&&e.data.target==t.data.target}function OI(e){return e&&e.source&&e.target}var Ao=class{constructor(t,r){this.oldLink=t,this.newLink=r}};Te([w(),qe("design:type",an)],Ao.prototype,"oldLink",void 0);Te([w(),qe("design:type",an)],Ao.prototype,"newLink",void 0);Ao=Te([W(),qe("design:paramtypes",[an,an])],Ao);var fn=function(e,t,r,n){var i=arguments.length,a=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},sa=function(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)},Pc,Er=class{constructor(t){t?this.links=t:this.links=[]}get(t){if(!t||!t.source&&!t.predicate&&!t.target)return this.links;if(t.source){let n=JSON.parse(JSON.stringify(this.links));return t.target&&(n=n.filter(i=>i.data.target===t.target)),t.predicate&&(n=n.filter(i=>i.data.predicate===t.predicate)),t.fromDate&&(n=n.filter(i=>new Date(i.timestamp)>=t.fromDate)),t.untilDate&&(n=n.filter(i=>new Date(i.timestamp)<=t.untilDate)),t.limit&&(n=n.slice(0,t.limit)),n}if(t.target){let n=JSON.parse(JSON.stringify(this.links));return t.predicate&&(n=n.filter(i=>i.data.predicate===t.predicate)),t.fromDate&&(n=n.filter(i=>new Date(i.timestamp)>=t.fromDate)),t.untilDate&&(n=n.filter(i=>new Date(i.timestamp)<=t.untilDate)),t.limit&&(n=n.slice(0,t.limit)),n}let r=JSON.parse(JSON.stringify(this.links));return r=r.filter(n=>n.data.predicate===t.predicate),t.limit&&(r=r.slice(0,t.limit)),r}getSingleTarget(t){delete t.target;let r=this.get(t);return r.length?r[0].data.target:null}};fn([w(),sa("design:type",Array)],Er.prototype,"links",void 0);Er=fn([W(),sa("design:paramtypes",[Array])],Er);var Lc=class{};fn([w(),sa("design:type",Array)],Lc.prototype,"links",void 0);Lc=fn([Ue()],Lc);var Fc=Pc=class{constructor(t){t?this.links=t:this.links=[]}static fromLink(t){let r=new Pc;return r.links.push(t),r}};fn([w(),sa("design:type",Array)],Fc.prototype,"links",void 0);Fc=Pc=fn([Ue(),sa("design:paramtypes",[Array])],Fc);var Mc=class extends Ar(){};Mc=fn([W()],Mc);var F=function(e,t,r,n){var i=arguments.length,a=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},M=function(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)},yr=class{constructor(t,r){this.did=t,r?this.perspective=r:this.perspective=new Er}};F([w(),M("design:type",String)],yr.prototype,"did",void 0);F([w(),M("design:type",Er)],yr.prototype,"perspective",void 0);F([w(),M("design:type",String)],yr.prototype,"directMessageLanguage",void 0);yr=F([W(),M("design:paramtypes",[String,Er])],yr);var Ef=class extends Ar(){};Ef=F([W()],Ef);var xr=class{constructor(t,r,n,i,a,o){this.did=t,this.didSigningKeyId=r,this.deviceKeyType=n,this.deviceKey=i,this.deviceKeySignedByDid=a,this.didSignedByDeviceKey=o}};F([w(),M("design:type",String)],xr.prototype,"did",void 0);F([w(),M("design:type",String)],xr.prototype,"didSigningKeyId",void 0);F([w(),M("design:type",String)],xr.prototype,"deviceKeyType",void 0);F([w(),M("design:type",String)],xr.prototype,"deviceKey",void 0);F([w(),M("design:type",String)],xr.prototype,"deviceKeySignedByDid",void 0);F([w(),M("design:type",String)],xr.prototype,"didSignedByDeviceKey",void 0);xr=F([W(),M("design:paramtypes",[String,String,String,String,String,String])],xr);var Tr=class{constructor(t,r,n,i,a,o){this.did=t,this.didSigningKeyId=r,this.deviceKeyType=n,this.deviceKey=i,this.deviceKeySignedByDid=a,this.didSignedByDeviceKey=o}};F([w(),M("design:type",String)],Tr.prototype,"did",void 0);F([w(),M("design:type",String)],Tr.prototype,"didSigningKeyId",void 0);F([w(),M("design:type",String)],Tr.prototype,"deviceKeyType",void 0);F([w(),M("design:type",String)],Tr.prototype,"deviceKey",void 0);F([w(),M("design:type",String)],Tr.prototype,"deviceKeySignedByDid",void 0);F([w(),M("design:type",String)],Tr.prototype,"didSignedByDeviceKey",void 0);Tr=F([Ue(),M("design:paramtypes",[String,String,String,String,String,String])],Tr);var Do=class{constructor(t,r){this.signature=t,this.publicKey=r}};F([w(),M("design:type",String)],Do.prototype,"signature",void 0);F([w(),M("design:type",String)],Do.prototype,"publicKey",void 0);Do=F([W(),M("design:paramtypes",[String,String])],Do);var Vn=class{constructor(t,r){this.domain=t,this.pointers=r}};F([w(),M("design:type",String)],Vn.prototype,"domain",void 0);F([w(),M("design:type",Array)],Vn.prototype,"pointers",void 0);Vn=F([W(),M("design:paramtypes",[String,Array])],Vn);var No=class{constructor(t,r){this.with=t,this.can=r}};F([w(),M("design:type",Vn)],No.prototype,"with",void 0);F([w(),M("design:type",Array)],No.prototype,"can",void 0);No=F([W(),M("design:paramtypes",[Vn,Array])],No);var er=class{constructor(t,r,n,i,a){this.appName=t,this.appDesc=r,this.appIconPath=a,this.appUrl=n,this.capabilities=i}};F([w(),M("design:type",String)],er.prototype,"appName",void 0);F([w(),M("design:type",String)],er.prototype,"appDesc",void 0);F([w(),M("design:type",String)],er.prototype,"appUrl",void 0);F([w(),M("design:type",String)],er.prototype,"appIconPath",void 0);F([w(),M("design:type",Array)],er.prototype,"capabilities",void 0);er=F([W(),M("design:paramtypes",[String,String,String,Array,String])],er);var Qn=class{constructor(t,r,n,i){this.requestId=t,this.auth=r,this.token=n,this.revoked=i}};F([w(),M("design:type",String)],Qn.prototype,"requestId",void 0);F([w(),M("design:type",String)],Qn.prototype,"token",void 0);F([w(),M("design:type",Boolean)],Qn.prototype,"revoked",void 0);F([w(),M("design:type",er)],Qn.prototype,"auth",void 0);Qn=F([W(),M("design:paramtypes",[String,er,String,Boolean])],Qn);var zn=class{constructor(t,r){this.domain=t,this.pointers=r}};F([w(),M("design:type",String)],zn.prototype,"domain",void 0);F([w(),M("design:type",Array)],zn.prototype,"pointers",void 0);zn=F([Ue(),M("design:paramtypes",[String,Array])],zn);var Ro=class{constructor(t,r){this.with=t,this.can=r}};F([w(),M("design:type",zn)],Ro.prototype,"with",void 0);F([w(),M("design:type",Array)],Ro.prototype,"can",void 0);Ro=F([Ue(),M("design:paramtypes",[zn,Array])],Ro);var Ir=class{constructor(t,r,n,i,a,o){this.appName=t,this.appDesc=r,this.appUrl=i,this.appDomain=n,this.capabilities=o,this.appIconPath=a}};F([w(),M("design:type",String)],Ir.prototype,"appName",void 0);F([w(),M("design:type",String)],Ir.prototype,"appDesc",void 0);F([w(),M("design:type",String)],Ir.prototype,"appDomain",void 0);F([w(),M("design:type",String)],Ir.prototype,"appUrl",void 0);F([w(),M("design:type",String)],Ir.prototype,"appIconPath",void 0);F([w(),M("design:type",Array)],Ir.prototype,"capabilities",void 0);Ir=F([Ue(),M("design:paramtypes",[String,String,String,String,String,Array])],Ir);var Hn=function(e,t,r,n){var i=arguments.length,a=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},Jn=function(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)},gt=class{constructor(t){t?(this.isInitialized=t.isInitialized,this.isInitialized||(this.isInitialized=!1),this.isUnlocked=t.isUnlocked,this.isUnlocked||(this.isUnlocked=!1),this.did=t.did,this.didDocument=t.didDocument,this.error=t.error):(this.isInitialized=!1,this.isUnlocked=!1)}};Hn([w(),Jn("design:type",Boolean)],gt.prototype,"isInitialized",void 0);Hn([w(),Jn("design:type",Boolean)],gt.prototype,"isUnlocked",void 0);Hn([w(),Jn("design:type",String)],gt.prototype,"did",void 0);Hn([w(),Jn("design:type",String)],gt.prototype,"didDocument",void 0);Hn([w(),Jn("design:type",String)],gt.prototype,"error",void 0);gt=Hn([W(),Jn("design:paramtypes",[Object])],gt);var xf=function(e,t,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 t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(e,r):i?i.value=r:t.set(e,r),r},Se=function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},et,tt,$c=class{constructor(t,r){et.set(this,void 0),tt.set(this,void 0),xf(this,et,t,"f"),xf(this,tt,r,"f")}async otherAgents(){return await Se(this,et,"f").otherAgents(Se(this,tt,"f"))}async hasTelepresenceAdapter(){return await Se(this,et,"f").hasTelepresenceAdapter(Se(this,tt,"f"))}async onlineAgents(){return await Se(this,et,"f").onlineAgents(Se(this,tt,"f"))}async setOnlineStatus(t){return await Se(this,et,"f").setOnlineStatus(Se(this,tt,"f"),t)}async setOnlineStatusU(t){return await Se(this,et,"f").setOnlineStatusU(Se(this,tt,"f"),t)}async sendSignal(t,r){return await Se(this,et,"f").sendSignal(Se(this,tt,"f"),t,r)}async sendSignalU(t,r){return await Se(this,et,"f").sendSignalU(Se(this,tt,"f"),t,r)}async sendBroadcast(t){return await Se(this,et,"f").sendBroadcast(Se(this,tt,"f"),t)}async sendBroadcastU(t){return await Se(this,et,"f").sendBroadcastU(Se(this,tt,"f"),t)}async addSignalHandler(t){await Se(this,et,"f").addSignalHandler(Se(this,tt,"f"),t)}removeSignalHandler(t){Se(this,et,"f").removeSignalHandler(Se(this,tt,"f"),t)}};et=new WeakMap,tt=new WeakMap;var pn=function(e,t,r,n){var i=arguments.length,a=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},dn=function(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)},lt=class{constructor(t){t&&(this.source=t.source,this.predicate=t.predicate,this.target=t.target,t.fromDate&&(this.fromDate=t.fromDate),t.untilDate&&(this.untilDate=t.untilDate),t.limit&&(this.limit=t.limit))}isMatch(t){return!(this.source&&this.source!==t.source||this.predicate&&this.predicate!==t.predicate||this.target&&this.target!==t.target)}};pn([w(),dn("design:type",String)],lt.prototype,"source",void 0);pn([w(),dn("design:type",String)],lt.prototype,"target",void 0);pn([w(),dn("design:type",String)],lt.prototype,"predicate",void 0);pn([w(),dn("design:type",Date)],lt.prototype,"fromDate",void 0);pn([w(),dn("design:type",Date)],lt.prototype,"untilDate",void 0);pn([w(),dn("design:type",Number)],lt.prototype,"limit",void 0);lt=pn([W(),Ue(),dn("design:paramtypes",[Object])],lt);var Tf=function(e,t,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 t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(e,r):i?i.value=r:t.set(e,r),r},Xe=function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},xt,Ht;function pc(e){return encodeURIComponent(e).replace(/[!'()*]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`)}var kt=class{constructor(){xt.set(this,void 0),Ht.set(this,void 0)}static fromUrl(t){if(!t||!t.startsWith("literal://"))throw new Error("Can't create Literal from non-literal URL");let r=new kt;return Tf(r,Ht,t,"f"),r}static from(t){let r=new kt;return Tf(r,xt,t,"f"),r}toUrl(){if(Xe(this,Ht,"f")&&!Xe(this,xt,"f"))return Xe(this,Ht,"f");if(!Xe(this,Ht,"f")&&!Xe(this,xt,"f"))throw new Error("Can't turn empty Literal into URL");let t;switch(typeof Xe(this,xt,"f")){case"string":t=`string:${pc(Xe(this,xt,"f"))}`;break;case"number":t=`number:${pc(Xe(this,xt,"f"))}`;break;case"object":t=`json:${pc(JSON.stringify(Xe(this,xt,"f")))}`;break}return`literal://${t}`}get(){if(Xe(this,xt,"f"))return Xe(this,xt,"f");if(!Xe(this,Ht,"f"))throw new Error("Can't render empty Literal");if(!Xe(this,Ht,"f").startsWith("literal://"))throw new Error("Can't render Literal from non-literal URL");let t=Xe(this,Ht,"f").substring(10);if(t.startsWith("string:"))return decodeURIComponent(t.substring(7));if(t.startsWith("number:")){let r=t.substring(7);return parseFloat(r)}if(t.startsWith("json:")){let r=t.substring(5);return JSON.parse(decodeURIComponent(r))}throw new Error(`Can't parse unknown literal: ${t}`)}};xt=new WeakMap,Ht=new WeakMap;function vr(e){return e.charAt(0).toUpperCase()+e.slice(1)}function $p(e){return`set${vr(e)}`}function Xt(e){return e.endsWith("y")?e.slice(0,-1)+"ies":e+"s"}function iu(e){return e.endsWith("ies")?e.slice(0,-3)+"y":e.endsWith("s")?e.slice(0,-1):e}function yg(e){return`add${vr(iu(e))}`}function vg(e){let t=e.substring(3),r=Xt(t);return r.charAt(0).toLowerCase()+r.slice(1)}function bg(e){return`remove${vr(iu(e))}`}function _g(e){let t=e.substring(6),r=Xt(t);return r.charAt(0).toLowerCase()+r.slice(1)}function wg(e){let t=e.substring(13),r=Xt(t);return r.charAt(0).toLowerCase()+r.slice(1)}function Sg(e){return`setCollection${vr(iu(e))}`}function Vr(e){if(Array.isArray(e))return`[${e.map(Vr).join(", ")}]`;let t=Object.keys(e),r=[];for(let n of t){let i=JSON.stringify(e[n]),a=`${n}: ${i}`;r.push(a)}return`{${r.join(", ")}}`}var dc=function(e,t,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 t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(e,r):i?i.value=r:t.set(e,r),r},B=function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},ze,Ge,ve,Co=class{constructor(e,t,r){ze.set(this,void 0),Ge.set(this,void 0),ve.set(this,void 0),dc(this,ze,t,"f"),dc(this,Ge,r,"f"),dc(this,ve,e,"f")}get baseExpression(){return B(this,ze,"f")}async init(){let isInstance=await B(this,ve,"f").isSubjectInstance(B(this,ze,"f"),B(this,Ge,"f"));if(!isInstance)throw`Not a valid subject instance of ${B(this,Ge,"f")} for ${B(this,ze,"f")}`;let results=await B(this,ve,"f").infer(`subject_class("${B(this,Ge,"f")}", C), property(C, Property)`),properties=results.map(e=>e.Property);for(let e of properties){let t=await B(this,ve,"f").infer(`subject_class("${B(this,Ge,"f")}", C), property_resolve(C, "${e}")`);Object.defineProperty(this,e,{configurable:!0,get:async()=>{let r=await B(this,ve,"f").infer(`subject_class("${B(this,Ge,"f")}", C), property_getter(C, "${B(this,ze,"f")}", "${e}", Value)`);if(r&&r.length>0){let n=r[0].Value;if(t)try{if(n){let i=await B(this,ve,"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 B(this,ve,"f").infer(`subject_class("${B(this,Ge,"f")}", C), property_setter(C, Property, Setter)`);for(let setter of setters||[])if(setter){let property=setter.Property,actions=eval(setter.Setter),resolveLanguageResults=await B(this,ve,"f").infer(`subject_class("${B(this,Ge,"f")}", C), property_resolve_language(C, "${property}", Language)`),resolveLanguage;resolveLanguageResults&&resolveLanguageResults.length>0&&(resolveLanguage=resolveLanguageResults[0].Language),this[$p(property)]=async e=>{resolveLanguage&&(e=await B(this,ve,"f").createExpression(e,resolveLanguage)),await B(this,ve,"f").executeAction(actions,B(this,ze,"f"),[{name:"value",value:e}])}}let results2=await B(this,ve,"f").infer(`subject_class("${B(this,Ge,"f")}", C), collection(C, Collection)`);results2||(results2=[]);let collections=results2.map(e=>e.Collection);for(let e of collections)Object.defineProperty(this,e,{configurable:!0,get:async()=>{let t=await B(this,ve,"f").infer(`subject_class("${B(this,Ge,"f")}", C), collection_getter(C, "${B(this,ze,"f")}", "${e}", Value)`);return t&&t.length>0&&t[0].Value?t[0].Value.filter(n=>n!==""&&n!==""):[]}});let adders=await B(this,ve,"f").infer(`subject_class("${B(this,Ge,"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[yg(collection)]=async e=>{Array.isArray(e)?await Promise.all(e.map(t=>B(this,ve,"f").executeAction(actions,B(this,ze,"f"),[{name:"value",value:t}]))):await B(this,ve,"f").executeAction(actions,B(this,ze,"f"),[{name:"value",value:e}])}}let removers=await B(this,ve,"f").infer(`subject_class("${B(this,Ge,"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[bg(collection)]=async e=>{Array.isArray(e)?await Promise.all(e.map(t=>B(this,ve,"f").executeAction(actions,B(this,ze,"f"),[{name:"value",value:t}]))):await B(this,ve,"f").executeAction(actions,B(this,ze,"f"),[{name:"value",value:e}])}}let collectionSetters=await B(this,ve,"f").infer(`subject_class("${B(this,Ge,"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[Sg(collection)]=async e=>{Array.isArray(e)?await B(this,ve,"f").executeAction(actions,B(this,ze,"f"),e.map(t=>({name:"value",value:t}))):await B(this,ve,"f").executeAction(actions,B(this,ze,"f"),[{name:"value",value:e}])}}}};ze=new WeakMap,Ge=new WeakMap,ve=new WeakMap;var Pn=function(e,t,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 t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(e,r):i?i.value=r:t.set(e,r),r},L=function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},oe,le,Qr,zr,Gr,ki,qn=class{constructor(e,t){oe.set(this,void 0),le.set(this,void 0),Qr.set(this,void 0),zr.set(this,void 0),Gr.set(this,void 0),ki.set(this,void 0),Pn(this,Qr,[],"f"),Pn(this,zr,[],"f"),Pn(this,Gr,[],"f"),Pn(this,ki,[],"f"),Pn(this,oe,e,"f"),Pn(this,le,t,"f"),this.uuid=L(this,oe,"f").uuid,this.name=L(this,oe,"f").name,this.sharedUrl=L(this,oe,"f").sharedUrl,this.neighbourhood=L(this,oe,"f").neighbourhood,this.state=L(this,oe,"f").state,L(this,le,"f").addPerspectiveLinkAddedListener(L(this,oe,"f").uuid,L(this,Qr,"f")),L(this,le,"f").addPerspectiveLinkRemovedListener(L(this,oe,"f").uuid,L(this,zr,"f")),L(this,le,"f").addPerspectiveLinkUpdatedListener(L(this,oe,"f").uuid,L(this,Gr,"f")),L(this,le,"f").addPerspectiveSyncStateChangeListener(L(this,oe,"f").uuid,L(this,ki,"f"))}async executeAction(e,t,r){return await L(this,le,"f").executeCommands(L(this,oe,"f").uuid,JSON.stringify(e),t,JSON.stringify(r))}async get(e){return await L(this,le,"f").queryLinks(L(this,oe,"f").uuid,e)}async infer(e){return await L(this,le,"f").queryProlog(L(this,oe,"f").uuid,e)}async add(e,t="shared"){return await L(this,le,"f").addLink(L(this,oe,"f").uuid,e,t)}async addLinks(e,t="shared"){return await L(this,le,"f").addLinks(L(this,oe,"f").uuid,e,t)}async removeLinks(e){return await L(this,le,"f").removeLinks(L(this,oe,"f").uuid,e)}async linkMutations(e,t="shared"){return await L(this,le,"f").linkMutations(L(this,oe,"f").uuid,e,t)}async addLinkExpression(e,t="shared"){return await L(this,le,"f").addLinkExpression(L(this,oe,"f").uuid,e,t)}async update(e,t){return await L(this,le,"f").updateLink(L(this,oe,"f").uuid,e,t)}async remove(e){return await L(this,le,"f").removeLink(L(this,oe,"f").uuid,e)}async getExpression(e){return await L(this,le,"f").getExpression(e)}async createExpression(e,t){return await L(this,le,"f").createExpression(e,t)}async addListener(e,t){e==="link-added"?L(this,Qr,"f").push(t):e==="link-removed"?L(this,zr,"f").push(t):e==="link-updated"&&L(this,Gr,"f").push(t)}async addSyncStateChangeListener(e){L(this,ki,"f").push(e)}async removeListener(e,t){if(e==="link-added"){let r=L(this,Qr,"f").indexOf(t);L(this,Qr,"f").splice(r,1)}else if(e==="link-removed"){let r=L(this,zr,"f").indexOf(t);L(this,zr,"f").splice(r,1)}else if(e==="link-updated"){let r=L(this,Gr,"f").indexOf(t);L(this,Gr,"f").splice(r,1)}}async snapshot(){return L(this,le,"f").snapshotByUUID(L(this,oe,"f").uuid)}async loadSnapshot(e){let t=JSON.parse(JSON.stringify(e));delete t.__typename,t.links.forEach(r=>{delete r.data.__typename});for(let r of t.links)await this.addLinkExpression(r)}async getSingleTarget(e){delete e.target;let t=await this.get(e);return t.length?t[0].data.target:null}async setSingleTarget(e,t="shared"){let r=new lt({source:e.source,predicate:e.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=[e];await this.linkMutations({additions:a,removals:i},t)}async sdnaFlows(){return(await this.infer("register_sdna_flow(X, _)")).map(t=>t.X)}async availableFlows(e){return(await this.infer(`flowable("${e}", 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(e,t){return(await this.infer(`register_sdna_flow("${e}", F), flow_state(X, ${t}, F)`)).map(n=>n.X)}async flowState(e,t){return(await this.infer(`register_sdna_flow("${e}", F), flow_state("${t}", X, F)`))[0].X}async flowActions(e,t){return(await this.infer(`register_sdna_flow("${e}", Flow), flow_state("${t}", State, Flow), action(State, Name, _, _)`)).map(n=>n.Name)}async runFlowAction(flowName,exprAddr,actionName){let action=await this.infer(`register_sdna_flow("${flowName}", Flow), flow_state("${exprAddr}", State, Flow), action(State, "${actionName}", _, Action)`);action=eval(action[0].Action),await this.executeAction(action,exprAddr,void 0)}async getSdna(){return(await this.get(new lt({predicate:"ad4m://sdna"}))).map(t=>t.data.target).map(t=>kt.fromUrl(t).get())}async addSdna(e,t,r){return L(this,le,"f").addSdna(L(this,oe,"f").uuid,e,t,r)}async subjectClasses(){try{return(await this.infer("subject_class(X, _)")).map(e=>e.X)}catch{return[]}}async stringOrTemplateObjectToSubjectClass(e){if(typeof e=="string")return e;{let t=await this.subjectClassesByTemplate(e);return t[0]?t[0]:e.className}}async createSubject(e,t){let r;if(typeof e=="string")r=e,await L(this,le,"f").createSubject(L(this,oe,"f").uuid,JSON.stringify({className:r}),t);else{let n=this.buildQueryFromTemplate(e);await L(this,le,"f").createSubject(L(this,oe,"f").uuid,JSON.stringify({query:n}),t)}return this.getSubjectProxy(t,e)}async getSubjectData(e,t){if(typeof e=="string")return JSON.parse(await L(this,le,"f").getSubjectData(L(this,oe,"f").uuid,JSON.stringify({className:e}),t));let r=this.buildQueryFromTemplate(e);return JSON.parse(await L(this,le,"f").getSubjectData(L(this,oe,"f").uuid,JSON.stringify({query:r}),t))}async removeSubject(subjectClass,exprAddr){let className=await this.stringOrTemplateObjectToSubjectClass(subjectClass),result=await this.infer(`subject_class("${className}", C), destructor(C, Actions)`);if(!result.length)throw"No constructor found for given subject class: "+className;let actions=result.map(x=>eval(x.Actions));await this.executeAction(actions[0],exprAddr,void 0)}async isSubjectInstance(e,t){let r=await this.stringOrTemplateObjectToSubjectClass(t),n=!1,i=5,a=0;for(;a<i&&!n;)n=await this.infer(`subject_class("${r}", C), instance(C, "${e}")`),a++;return n}async getSubjectProxy(e,t){if(!await this.isSubjectInstance(e,t))throw`Expression ${e} is not a subject instance of given class: ${JSON.stringify(t)}`;let r=await this.stringOrTemplateObjectToSubjectClass(t),n=new Co(this,e,r);return await n.init(),n}async getAllSubjectInstances(e){let t=[];typeof e=="string"?t=[e]:t=await this.subjectClassesByTemplate(e);let r=[];for(let n of t){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(e){let t=[];typeof e=="string"?t=[e]:t=await this.subjectClassesByTemplate(e);let r=[];for(let n of t)r=await this.infer(`subject_class("${n}", C), instance(C, X)`);return r}buildQueryFromTemplate(e){let t;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(...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, "${vg(l)}", _)`;for(let l of s)c+=`, collection_remover(C, "${_g(l)}", _)`;for(let l of u)c+=`, collection_setter(C, "${wg(l)}", _)`;c+=".",t=c}(e),t}async subjectClassesByTemplate(e){let t=this.buildQueryFromTemplate(e),r=await this.infer(t);return r?r.map(n=>n.Class):[]}async ensureSDNASubjectClass(e){if((await this.subjectClassesByTemplate(new e)).length>0)return;let{name:r,sdna:n}=e.generateSDNA();await this.addSdna(r,n,"subject_class")}getNeighbourhoodProxy(){return L(this,le,"f").getNeighbourhoodProxy(L(this,oe,"f").uuid)}get ai(){return L(this,le,"f").aiClient}};oe=new WeakMap,le=new WeakMap,Qr=new WeakMap,zr=new WeakMap,Gr=new WeakMap,ki=new WeakMap;var pr=function(e,t,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 t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(e,r):i?i.value=r:t.set(e,r),r},Q=function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},ie,Oi,Ai,Di,mo,Ni,go,yo,ot=`
|
|
62
62
|
author
|
|
63
63
|
timestamp
|
|
64
64
|
status
|
|
@@ -189,7 +189,7 @@ neighbourhood {
|
|
|
189
189
|
}
|
|
190
190
|
}
|
|
191
191
|
}
|
|
192
|
-
`}).subscribe({next:n=>{r.forEach(i=>{n.data.perspectiveLinkUpdated.newLink.status||delete n.data.perspectiveLinkUpdated.newLink.status,n.data.perspectiveLinkUpdated.oldLink.status||delete n.data.perspectiveLinkUpdated.oldLink.status,i(n.data.perspectiveLinkUpdated)})},error:n=>console.error(n)}),await new Promise(n=>setTimeout(n,500))}getNeighbourhoodProxy(t){return new $c(Q(this,go,"f"),t)}};ie=new WeakMap,Oi=new WeakMap,Ai=new WeakMap,Di=new WeakMap,mo=new WeakMap,Ni=new WeakMap,go=new WeakMap,yo=new WeakMap;var Ya=function(e,t,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 t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(e,r):i?i.value=r:t.set(e,r),r},ee=function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},se,Ci,
|
|
192
|
+
`}).subscribe({next:n=>{r.forEach(i=>{n.data.perspectiveLinkUpdated.newLink.status||delete n.data.perspectiveLinkUpdated.newLink.status,n.data.perspectiveLinkUpdated.oldLink.status||delete n.data.perspectiveLinkUpdated.oldLink.status,i(n.data.perspectiveLinkUpdated)})},error:n=>console.error(n)}),await new Promise(n=>setTimeout(n,500))}getNeighbourhoodProxy(t){return new $c(Q(this,go,"f"),t)}};ie=new WeakMap,Oi=new WeakMap,Ai=new WeakMap,Di=new WeakMap,mo=new WeakMap,Ni=new WeakMap,go=new WeakMap,yo=new WeakMap;var Ya=function(e,t,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 t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(e,r):i?i.value=r:t.set(e,r),r},ee=function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},se,Ri,Ci,Pi,xi=`
|
|
193
193
|
did
|
|
194
194
|
directMessageLanguage
|
|
195
195
|
perspective {
|
|
@@ -235,7 +235,7 @@ neighbourhood {
|
|
|
235
235
|
`,Eg=`
|
|
236
236
|
signature
|
|
237
237
|
publicKey
|
|
238
|
-
`,Ji=class{constructor(t,r=!0){se.set(this,void 0),
|
|
238
|
+
`,Ji=class{constructor(t,r=!0){se.set(this,void 0),Ri.set(this,void 0),Ci.set(this,void 0),Pi.set(this,void 0),Ya(this,se,t,"f"),Ya(this,Ci,[],"f"),Ya(this,Pi,[],"f"),Ya(this,Ri,[],"f"),r&&(this.subscribeAgentUpdated(),this.subscribeAgentStatusChanged(),this.subscribeAppsChanged())}async me(){let{agent:t}=k(await ee(this,se,"f").query({query:E`query agent { agent { ${xi} } }`})),r=new yr(t.did,t.perspective);return r.directMessageLanguage=t.directMessageLanguage,r}async status(){let{agentStatus:t}=k(await ee(this,se,"f").query({query:E`query agentStatus {
|
|
239
239
|
agentStatus {
|
|
240
240
|
${Fn}
|
|
241
241
|
}
|
|
@@ -290,15 +290,15 @@ neighbourhood {
|
|
|
290
290
|
agentEntanglementProofPreFlight(deviceKey: $deviceKey, deviceKeyType: $deviceKeyType) {
|
|
291
291
|
${Xa}
|
|
292
292
|
}
|
|
293
|
-
}`,variables:{deviceKey:t,deviceKeyType:r}}));return n}addUpdatedListener(t){ee(this,
|
|
293
|
+
}`,variables:{deviceKey:t,deviceKeyType:r}}));return n}addUpdatedListener(t){ee(this,Ci,"f").push(t)}addAppChangedListener(t){ee(this,Ri,"f").push(t)}subscribeAgentUpdated(){ee(this,se,"f").subscribe({query:E` subscription {
|
|
294
294
|
agentUpdated { ${xi} }
|
|
295
295
|
}
|
|
296
|
-
`}).subscribe({next:t=>{let r=t.data.agentUpdated;ee(this,
|
|
296
|
+
`}).subscribe({next:t=>{let r=t.data.agentUpdated;ee(this,Ci,"f").forEach(n=>{n(r)})},error:t=>console.error(t)})}subscribeAppsChanged(){ee(this,se,"f").subscribe({query:E` subscription {
|
|
297
297
|
agentAppsChanged {
|
|
298
298
|
${Za}
|
|
299
299
|
}
|
|
300
300
|
}
|
|
301
|
-
`}).subscribe({next:t=>{ee(this,
|
|
301
|
+
`}).subscribe({next:t=>{ee(this,Ri,"f").forEach(r=>{r()})},error:t=>console.error(t)})}addAgentStatusChangedListener(t){ee(this,Pi,"f").push(t)}subscribeAgentStatusChanged(){ee(this,se,"f").subscribe({query:E` subscription {
|
|
302
302
|
agentStatusChanged { ${Fn} }
|
|
303
303
|
}
|
|
304
304
|
`}).subscribe({next:t=>{let r=t.data.agentStatusChanged;ee(this,Pi,"f").forEach(n=>{n(r)})},error:t=>console.error(t)})}async requestCapability(t){let{agentRequestCapability:r}=k(await ee(this,se,"f").mutate({mutation:E`
|
|
@@ -333,7 +333,7 @@ neighbourhood {
|
|
|
333
333
|
agentSignMessage(message: $message) {
|
|
334
334
|
${Eg}
|
|
335
335
|
}
|
|
336
|
-
}`,variables:{message:t}}));return r}};se=new WeakMap,
|
|
336
|
+
}`,variables:{message:t}}));return r}};se=new WeakMap,Ri=new WeakMap,Ci=new WeakMap,Pi=new WeakMap;var xg=function(e,t,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 t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(e,r):i?i.value=r:t.set(e,r),r},dr=function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},Tt,If=`
|
|
337
337
|
name
|
|
338
338
|
address
|
|
339
339
|
settings
|
|
@@ -645,7 +645,7 @@ triggerMatch
|
|
|
645
645
|
}
|
|
646
646
|
}`,variables:{url:t}}));return r}async interact(t,r){let{expressionInteract:n}=k(await Mn(this,Jt,"f").mutate({mutation:E`mutation expressionInteract($url: String!, $interactionCall: InteractionCall!){
|
|
647
647
|
expressionInteract(url: $url, interactionCall: $interactionCall)
|
|
648
|
-
}`,variables:{url:t,interactionCall:r}}));return n}};Jt=new WeakMap;var Ko={};Ko.byteLength=Dg;Ko.toByteArray=Cg;Ko.fromByteArray=Lg;var Mt=[],mt=[],Ag=typeof Uint8Array<"u"?Uint8Array:Array,hc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(qr=0,Of=hc.length;qr<Of;++qr)Mt[qr]=hc[qr],mt[hc.charCodeAt(qr)]=qr;var qr,Of;mt["-".charCodeAt(0)]=62;mt["_".charCodeAt(0)]=63;function qp(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");r===-1&&(r=t);var n=r===t?0:4-r%4;return[r,n]}function Dg(e){var t=qp(e),r=t[0],n=t[1];return(r+n)*3/4-n}function Ng(e,t,r){return(t+r)*3/4-r}function Cg(e){var t,r=qp(e),n=r[0],i=r[1],a=new Ag(Ng(e,n,i)),o=0,s=i>0?n-4:n,u;for(u=0;u<s;u+=4)t=mt[e.charCodeAt(u)]<<18|mt[e.charCodeAt(u+1)]<<12|mt[e.charCodeAt(u+2)]<<6|mt[e.charCodeAt(u+3)],a[o++]=t>>16&255,a[o++]=t>>8&255,a[o++]=t&255;return i===2&&(t=mt[e.charCodeAt(u)]<<2|mt[e.charCodeAt(u+1)]>>4,a[o++]=t&255),i===1&&(t=mt[e.charCodeAt(u)]<<10|mt[e.charCodeAt(u+1)]<<4|mt[e.charCodeAt(u+2)]>>2,a[o++]=t>>8&255,a[o++]=t&255),a}function Rg(e){return Mt[e>>18&63]+Mt[e>>12&63]+Mt[e>>6&63]+Mt[e&63]}function Pg(e,t,r){for(var n,i=[],a=t;a<r;a+=3)n=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(e[a+2]&255),i.push(Rg(n));return i.join("")}function Lg(e){for(var t,r=e.length,n=r%3,i=[],a=16383,o=0,s=r-n;o<s;o+=a)i.push(Pg(e,o,o+a>s?s:o+a));return n===1?(t=e[r-1],i.push(Mt[t>>2]+Mt[t<<4&63]+"==")):n===2&&(t=(e[r-2]<<8)+e[r-1],i.push(Mt[t>>10]+Mt[t>>4&63]+Mt[t<<2&63]+"=")),i.join("")}var Fg=4,Af=0,Df=1,Mg=2;function Yn(e){let t=e.length;for(;--t>=0;)e[t]=0}var $g=0,Bp=1,jg=2,Ug=3,qg=258,au=29,ca=256,Yi=ca+1+au,Bn=30,ou=19,Vp=2*Yi+1,Jr=15,mc=16,Bg=7,su=256,Qp=16,zp=17,Gp=18,Vc=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]),vo=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]),Vg=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),Kp=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Qg=512,Yt=new Array((Yi+2)*2);Yn(Yt);var Qi=new Array(Bn*2);Yn(Qi);var Zi=new Array(Qg);Yn(Zi);var Xi=new Array(qg-Ug+1);Yn(Xi);var cu=new Array(au);Yn(cu);var Lo=new Array(Bn);Yn(Lo);function gc(e,t,r,n,i){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=e&&e.length}var Wp,Hp,Jp;function yc(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}var Yp=e=>e<256?Zi[e]:Zi[256+(e>>>7)],ea=(e,t)=>{e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255},rt=(e,t,r)=>{e.bi_valid>mc-r?(e.bi_buf|=t<<e.bi_valid&65535,ea(e,e.bi_buf),e.bi_buf=t>>mc-e.bi_valid,e.bi_valid+=r-mc):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=r)},$t=(e,t,r)=>{rt(e,r[t*2],r[t*2+1])},Zp=(e,t)=>{let r=0;do r|=e&1,e>>>=1,r<<=1;while(--t>0);return r>>>1},zg=e=>{e.bi_valid===16?(ea(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)},Gg=(e,t)=>{let r=t.dyn_tree,n=t.max_code,i=t.stat_desc.static_tree,a=t.stat_desc.has_stree,o=t.stat_desc.extra_bits,s=t.stat_desc.extra_base,u=t.stat_desc.max_length,c,l,d,p,f,h,g=0;for(p=0;p<=Jr;p++)e.bl_count[p]=0;for(r[e.heap[e.heap_max]*2+1]=0,c=e.heap_max+1;c<Vp;c++)l=e.heap[c],p=r[r[l*2+1]*2+1]+1,p>u&&(p=u,g++),r[l*2+1]=p,!(l>n)&&(e.bl_count[p]++,f=0,l>=s&&(f=o[l-s]),h=r[l*2],e.opt_len+=h*(p+f),a&&(e.static_len+=h*(i[l*2+1]+f)));if(g!==0){do{for(p=u-1;e.bl_count[p]===0;)p--;e.bl_count[p]--,e.bl_count[p+1]+=2,e.bl_count[u]--,g-=2}while(g>0);for(p=u;p!==0;p--)for(l=e.bl_count[p];l!==0;)d=e.heap[--c],!(d>n)&&(r[d*2+1]!==p&&(e.opt_len+=(p-r[d*2+1])*r[d*2],r[d*2+1]=p),l--)}},Xp=(e,t,r)=>{let n=new Array(Jr+1),i=0,a,o;for(a=1;a<=Jr;a++)i=i+r[a-1]<<1,n[a]=i;for(o=0;o<=t;o++){let s=e[o*2+1];s!==0&&(e[o*2]=Zp(n[s]++,s))}},Kg=()=>{let e,t,r,n,i,a=new Array(Jr+1);for(r=0,n=0;n<au-1;n++)for(cu[n]=r,e=0;e<1<<Vc[n];e++)Xi[r++]=n;for(Xi[r-1]=n,i=0,n=0;n<16;n++)for(Lo[n]=i,e=0;e<1<<vo[n];e++)Zi[i++]=n;for(i>>=7;n<Bn;n++)for(Lo[n]=i<<7,e=0;e<1<<vo[n]-7;e++)Zi[256+i++]=n;for(t=0;t<=Jr;t++)a[t]=0;for(e=0;e<=143;)Yt[e*2+1]=8,e++,a[8]++;for(;e<=255;)Yt[e*2+1]=9,e++,a[9]++;for(;e<=279;)Yt[e*2+1]=7,e++,a[7]++;for(;e<=287;)Yt[e*2+1]=8,e++,a[8]++;for(Xp(Yt,Yi+1,a),e=0;e<Bn;e++)Qi[e*2+1]=5,Qi[e*2]=Zp(e,5);Wp=new gc(Yt,Vc,ca+1,Yi,Jr),Hp=new gc(Qi,vo,0,Bn,Jr),Jp=new gc(new Array(0),Vg,0,ou,Bg)},ed=e=>{let t;for(t=0;t<Yi;t++)e.dyn_ltree[t*2]=0;for(t=0;t<Bn;t++)e.dyn_dtree[t*2]=0;for(t=0;t<ou;t++)e.bl_tree[t*2]=0;e.dyn_ltree[su*2]=1,e.opt_len=e.static_len=0,e.sym_next=e.matches=0},td=e=>{e.bi_valid>8?ea(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},Nf=(e,t,r,n)=>{let i=t*2,a=r*2;return e[i]<e[a]||e[i]===e[a]&&n[t]<=n[r]},vc=(e,t,r)=>{let n=e.heap[r],i=r<<1;for(;i<=e.heap_len&&(i<e.heap_len&&Nf(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!Nf(t,n,e.heap[i],e.depth));)e.heap[r]=e.heap[i],r=i,i<<=1;e.heap[r]=n},Cf=(e,t,r)=>{let n,i,a=0,o,s;if(e.sym_next!==0)do n=e.pending_buf[e.sym_buf+a++]&255,n+=(e.pending_buf[e.sym_buf+a++]&255)<<8,i=e.pending_buf[e.sym_buf+a++],n===0?$t(e,i,t):(o=Xi[i],$t(e,o+ca+1,t),s=Vc[o],s!==0&&(i-=cu[o],rt(e,i,s)),n--,o=Yp(n),$t(e,o,r),s=vo[o],s!==0&&(n-=Lo[o],rt(e,n,s)));while(a<e.sym_next);$t(e,su,t)},Qc=(e,t)=>{let r=t.dyn_tree,n=t.stat_desc.static_tree,i=t.stat_desc.has_stree,a=t.stat_desc.elems,o,s,u=-1,c;for(e.heap_len=0,e.heap_max=Vp,o=0;o<a;o++)r[o*2]!==0?(e.heap[++e.heap_len]=u=o,e.depth[o]=0):r[o*2+1]=0;for(;e.heap_len<2;)c=e.heap[++e.heap_len]=u<2?++u:0,r[c*2]=1,e.depth[c]=0,e.opt_len--,i&&(e.static_len-=n[c*2+1]);for(t.max_code=u,o=e.heap_len>>1;o>=1;o--)vc(e,r,o);c=a;do o=e.heap[1],e.heap[1]=e.heap[e.heap_len--],vc(e,r,1),s=e.heap[1],e.heap[--e.heap_max]=o,e.heap[--e.heap_max]=s,r[c*2]=r[o*2]+r[s*2],e.depth[c]=(e.depth[o]>=e.depth[s]?e.depth[o]:e.depth[s])+1,r[o*2+1]=r[s*2+1]=c,e.heap[1]=c++,vc(e,r,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],Gg(e,t),Xp(r,u,e.bl_count)},Rf=(e,t,r)=>{let n,i=-1,a,o=t[0*2+1],s=0,u=7,c=4;for(o===0&&(u=138,c=3),t[(r+1)*2+1]=65535,n=0;n<=r;n++)a=o,o=t[(n+1)*2+1],!(++s<u&&a===o)&&(s<c?e.bl_tree[a*2]+=s:a!==0?(a!==i&&e.bl_tree[a*2]++,e.bl_tree[Qp*2]++):s<=10?e.bl_tree[zp*2]++:e.bl_tree[Gp*2]++,s=0,i=a,o===0?(u=138,c=3):a===o?(u=6,c=3):(u=7,c=4))},Pf=(e,t,r)=>{let n,i=-1,a,o=t[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=t[(n+1)*2+1],!(++s<u&&a===o)){if(s<c)do $t(e,a,e.bl_tree);while(--s!==0);else a!==0?(a!==i&&($t(e,a,e.bl_tree),s--),$t(e,Qp,e.bl_tree),rt(e,s-3,2)):s<=10?($t(e,zp,e.bl_tree),rt(e,s-3,3)):($t(e,Gp,e.bl_tree),rt(e,s-11,7));s=0,i=a,o===0?(u=138,c=3):a===o?(u=6,c=3):(u=7,c=4)}},Wg=e=>{let t;for(Rf(e,e.dyn_ltree,e.l_desc.max_code),Rf(e,e.dyn_dtree,e.d_desc.max_code),Qc(e,e.bl_desc),t=ou-1;t>=3&&e.bl_tree[Kp[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t},Hg=(e,t,r,n)=>{let i;for(rt(e,t-257,5),rt(e,r-1,5),rt(e,n-4,4),i=0;i<n;i++)rt(e,e.bl_tree[Kp[i]*2+1],3);Pf(e,e.dyn_ltree,t-1),Pf(e,e.dyn_dtree,r-1)},Jg=e=>{let t=4093624447,r;for(r=0;r<=31;r++,t>>>=1)if(t&1&&e.dyn_ltree[r*2]!==0)return Af;if(e.dyn_ltree[9*2]!==0||e.dyn_ltree[10*2]!==0||e.dyn_ltree[13*2]!==0)return Df;for(r=32;r<ca;r++)if(e.dyn_ltree[r*2]!==0)return Df;return Af},Lf=!1,Yg=e=>{Lf||(Kg(),Lf=!0),e.l_desc=new yc(e.dyn_ltree,Wp),e.d_desc=new yc(e.dyn_dtree,Hp),e.bl_desc=new yc(e.bl_tree,Jp),e.bi_buf=0,e.bi_valid=0,ed(e)},rd=(e,t,r,n)=>{rt(e,($g<<1)+(n?1:0),3),td(e),ea(e,r),ea(e,~r),r&&e.pending_buf.set(e.window.subarray(t,t+r),e.pending),e.pending+=r},Zg=e=>{rt(e,Bp<<1,3),$t(e,su,Yt),zg(e)},Xg=(e,t,r,n)=>{let i,a,o=0;e.level>0?(e.strm.data_type===Mg&&(e.strm.data_type=Jg(e)),Qc(e,e.l_desc),Qc(e,e.d_desc),o=Wg(e),i=e.opt_len+3+7>>>3,a=e.static_len+3+7>>>3,a<=i&&(i=a)):i=a=r+5,r+4<=i&&t!==-1?rd(e,t,r,n):e.strategy===Fg||a===i?(rt(e,(Bp<<1)+(n?1:0),3),Cf(e,Yt,Qi)):(rt(e,(jg<<1)+(n?1:0),3),Hg(e,e.l_desc.max_code+1,e.d_desc.max_code+1,o+1),Cf(e,e.dyn_ltree,e.dyn_dtree)),ed(e),n&&td(e)},ey=(e,t,r)=>(e.pending_buf[e.sym_buf+e.sym_next++]=t,e.pending_buf[e.sym_buf+e.sym_next++]=t>>8,e.pending_buf[e.sym_buf+e.sym_next++]=r,t===0?e.dyn_ltree[r*2]++:(e.matches++,t--,e.dyn_ltree[(Xi[r]+ca+1)*2]++,e.dyn_dtree[Yp(t)*2]++),e.sym_next===e.sym_end),ty=Yg,ry=rd,ny=Xg,iy=ey,ay=Zg,oy={_tr_init:ty,_tr_stored_block:ry,_tr_flush_block:ny,_tr_tally:iy,_tr_align:ay},sy=(e,t,r,n)=>{let i=e&65535|0,a=e>>>16&65535|0,o=0;for(;r!==0;){o=r>2e3?2e3:r,r-=o;do i=i+t[n++]|0,a=a+i|0;while(--o);i%=65521,a%=65521}return i|a<<16|0},ta=sy,cy=()=>{let e,t=[];for(var r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=e&1?3988292384^e>>>1:e>>>1;t[r]=e}return t},uy=new Uint32Array(cy()),ly=(e,t,r,n)=>{let i=uy,a=n+r;e^=-1;for(let o=n;o<a;o++)e=e>>>8^i[(e^t[o])&255];return e^-1},Re=ly,on={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"},hn={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:fy,_tr_stored_block:zc,_tr_flush_block:py,_tr_tally:br,_tr_align:dy}=oy,{Z_NO_FLUSH:_r,Z_PARTIAL_FLUSH:hy,Z_FULL_FLUSH:my,Z_FINISH:yt,Z_BLOCK:Ff,Z_OK:je,Z_STREAM_END:Mf,Z_STREAM_ERROR:Ut,Z_DATA_ERROR:gy,Z_BUF_ERROR:bc,Z_DEFAULT_COMPRESSION:yy,Z_FILTERED:vy,Z_HUFFMAN_ONLY:ro,Z_RLE:by,Z_FIXED:_y,Z_DEFAULT_STRATEGY:wy,Z_UNKNOWN:Sy,Z_DEFLATED:Wo}=hn,Ey=9,xy=15,Ty=8,Iy=29,ky=256,Gc=ky+1+Iy,Oy=30,Ay=19,Dy=2*Gc+1,Ny=15,H=3,gr=258,qt=gr+H+1,Cy=32,Gn=42,uu=57,Kc=69,Wc=73,Hc=91,Jc=103,Yr=113,$i=666,He=1,Zn=2,sn=3,Xn=4,Ry=3,Zr=(e,t)=>(e.msg=on[t],t),$f=e=>e*2-(e>4?9:0),mr=e=>{let t=e.length;for(;--t>=0;)e[t]=0},Py=e=>{let t,r,n,i=e.w_size;t=e.hash_size,n=t;do r=e.head[--n],e.head[n]=r>=i?r-i:0;while(--t);t=i,n=t;do r=e.prev[--n],e.prev[n]=r>=i?r-i:0;while(--t)},Ly=(e,t,r)=>(t<<e.hash_shift^r)&e.hash_mask,wr=Ly,st=e=>{let t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),r!==0&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+r),e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,t.pending===0&&(t.pending_out=0))},ut=(e,t)=>{py(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,st(e.strm)},re=(e,t)=>{e.pending_buf[e.pending++]=t},Ti=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255},Yc=(e,t,r,n)=>{let i=e.avail_in;return i>n&&(i=n),i===0?0:(e.avail_in-=i,t.set(e.input.subarray(e.next_in,e.next_in+i),r),e.state.wrap===1?e.adler=ta(e.adler,t,i,r):e.state.wrap===2&&(e.adler=Re(e.adler,t,i,r)),e.next_in+=i,e.total_in+=i,i)},nd=(e,t)=>{let r=e.max_chain_length,n=e.strstart,i,a,o=e.prev_length,s=e.nice_match,u=e.strstart>e.w_size-qt?e.strstart-(e.w_size-qt):0,c=e.window,l=e.w_mask,d=e.prev,p=e.strstart+gr,f=c[n+o-1],h=c[n+o];e.prev_length>=e.good_match&&(r>>=2),s>e.lookahead&&(s=e.lookahead);do if(i=t,!(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=gr-(p-n),n=p-gr,a>o){if(e.match_start=t,o=a,a>=s)break;f=c[n+o-1],h=c[n+o]}}while((t=d[t&l])>u&&--r!==0);return o<=e.lookahead?o:e.lookahead},Kn=e=>{let t=e.w_size,r,n,i;do{if(n=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-qt)&&(e.window.set(e.window.subarray(t,t+t-n),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,e.insert>e.strstart&&(e.insert=e.strstart),Py(e),n+=t),e.strm.avail_in===0)break;if(r=Yc(e.strm,e.window,e.strstart+e.lookahead,n),e.lookahead+=r,e.lookahead+e.insert>=H)for(i=e.strstart-e.insert,e.ins_h=e.window[i],e.ins_h=wr(e,e.ins_h,e.window[i+1]);e.insert&&(e.ins_h=wr(e,e.ins_h,e.window[i+H-1]),e.prev[i&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=i,i++,e.insert--,!(e.lookahead+e.insert<H)););}while(e.lookahead<qt&&e.strm.avail_in!==0)},id=(e,t)=>{let r=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,n,i,a,o=0,s=e.strm.avail_in;do{if(n=65535,a=e.bi_valid+42>>3,e.strm.avail_out<a||(a=e.strm.avail_out-a,i=e.strstart-e.block_start,n>i+e.strm.avail_in&&(n=i+e.strm.avail_in),n>a&&(n=a),n<r&&(n===0&&t!==yt||t===_r||n!==i+e.strm.avail_in)))break;o=t===yt&&n===i+e.strm.avail_in?1:0,zc(e,0,0,o),e.pending_buf[e.pending-4]=n,e.pending_buf[e.pending-3]=n>>8,e.pending_buf[e.pending-2]=~n,e.pending_buf[e.pending-1]=~n>>8,st(e.strm),i&&(i>n&&(i=n),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+i),e.strm.next_out),e.strm.next_out+=i,e.strm.avail_out-=i,e.strm.total_out+=i,e.block_start+=i,n-=i),n&&(Yc(e.strm,e.strm.output,e.strm.next_out,n),e.strm.next_out+=n,e.strm.avail_out-=n,e.strm.total_out+=n)}while(o===0);return s-=e.strm.avail_in,s&&(s>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=s&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-s,e.strm.next_in),e.strstart),e.strstart+=s,e.insert+=s>e.w_size-e.insert?e.w_size-e.insert:s),e.block_start=e.strstart),e.high_water<e.strstart&&(e.high_water=e.strstart),o?Xn:t!==_r&&t!==yt&&e.strm.avail_in===0&&e.strstart===e.block_start?Zn:(a=e.window_size-e.strstart,e.strm.avail_in>a&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,a+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),a>e.strm.avail_in&&(a=e.strm.avail_in),a&&(Yc(e.strm,e.window,e.strstart,a),e.strstart+=a,e.insert+=a>e.w_size-e.insert?e.w_size-e.insert:a),e.high_water<e.strstart&&(e.high_water=e.strstart),a=e.bi_valid+42>>3,a=e.pending_buf_size-a>65535?65535:e.pending_buf_size-a,r=a>e.w_size?e.w_size:a,i=e.strstart-e.block_start,(i>=r||(i||t===yt)&&t!==_r&&e.strm.avail_in===0&&i<=a)&&(n=i>a?a:i,o=t===yt&&e.strm.avail_in===0&&n===i?1:0,zc(e,e.block_start,n,o),e.block_start+=n,st(e.strm)),o?sn:He)},_c=(e,t)=>{let r,n;for(;;){if(e.lookahead<qt){if(Kn(e),e.lookahead<qt&&t===_r)return He;if(e.lookahead===0)break}if(r=0,e.lookahead>=H&&(e.ins_h=wr(e,e.ins_h,e.window[e.strstart+H-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),r!==0&&e.strstart-r<=e.w_size-qt&&(e.match_length=nd(e,r)),e.match_length>=H)if(n=br(e,e.strstart-e.match_start,e.match_length-H),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=H){e.match_length--;do e.strstart++,e.ins_h=wr(e,e.ins_h,e.window[e.strstart+H-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=wr(e,e.ins_h,e.window[e.strstart+1]);else n=br(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(n&&(ut(e,!1),e.strm.avail_out===0))return He}return e.insert=e.strstart<H-1?e.strstart:H-1,t===yt?(ut(e,!0),e.strm.avail_out===0?sn:Xn):e.sym_next&&(ut(e,!1),e.strm.avail_out===0)?He:Zn},$n=(e,t)=>{let r,n,i;for(;;){if(e.lookahead<qt){if(Kn(e),e.lookahead<qt&&t===_r)return He;if(e.lookahead===0)break}if(r=0,e.lookahead>=H&&(e.ins_h=wr(e,e.ins_h,e.window[e.strstart+H-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=H-1,r!==0&&e.prev_length<e.max_lazy_match&&e.strstart-r<=e.w_size-qt&&(e.match_length=nd(e,r),e.match_length<=5&&(e.strategy===vy||e.match_length===H&&e.strstart-e.match_start>4096)&&(e.match_length=H-1)),e.prev_length>=H&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-H,n=br(e,e.strstart-1-e.prev_match,e.prev_length-H),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=i&&(e.ins_h=wr(e,e.ins_h,e.window[e.strstart+H-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!==0);if(e.match_available=0,e.match_length=H-1,e.strstart++,n&&(ut(e,!1),e.strm.avail_out===0))return He}else if(e.match_available){if(n=br(e,0,e.window[e.strstart-1]),n&&ut(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return He}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(n=br(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<H-1?e.strstart:H-1,t===yt?(ut(e,!0),e.strm.avail_out===0?sn:Xn):e.sym_next&&(ut(e,!1),e.strm.avail_out===0)?He:Zn},Fy=(e,t)=>{let r,n,i,a,o=e.window;for(;;){if(e.lookahead<=gr){if(Kn(e),e.lookahead<=gr&&t===_r)return He;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=H&&e.strstart>0&&(i=e.strstart-1,n=o[i],n===o[++i]&&n===o[++i]&&n===o[++i])){a=e.strstart+gr;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);e.match_length=gr-(a-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=H?(r=br(e,1,e.match_length-H),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=br(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(ut(e,!1),e.strm.avail_out===0))return He}return e.insert=0,t===yt?(ut(e,!0),e.strm.avail_out===0?sn:Xn):e.sym_next&&(ut(e,!1),e.strm.avail_out===0)?He:Zn},My=(e,t)=>{let r;for(;;){if(e.lookahead===0&&(Kn(e),e.lookahead===0)){if(t===_r)return He;break}if(e.match_length=0,r=br(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(ut(e,!1),e.strm.avail_out===0))return He}return e.insert=0,t===yt?(ut(e,!0),e.strm.avail_out===0?sn:Xn):e.sym_next&&(ut(e,!1),e.strm.avail_out===0)?He:Zn};function Lt(e,t,r,n,i){this.good_length=e,this.max_lazy=t,this.nice_length=r,this.max_chain=n,this.func=i}var ji=[new Lt(0,0,0,0,id),new Lt(4,4,8,4,_c),new Lt(4,5,16,8,_c),new Lt(4,6,32,32,_c),new Lt(4,4,16,16,$n),new Lt(8,16,32,32,$n),new Lt(8,16,128,128,$n),new Lt(8,32,128,256,$n),new Lt(32,128,258,1024,$n),new Lt(32,258,258,4096,$n)],$y=e=>{e.window_size=2*e.w_size,mr(e.head),e.max_lazy_match=ji[e.level].max_lazy,e.good_match=ji[e.level].good_length,e.nice_match=ji[e.level].nice_length,e.max_chain_length=ji[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=H-1,e.match_available=0,e.ins_h=0};function jy(){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=Wo,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(Dy*2),this.dyn_dtree=new Uint16Array((2*Oy+1)*2),this.bl_tree=new Uint16Array((2*Ay+1)*2),mr(this.dyn_ltree),mr(this.dyn_dtree),mr(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(Ny+1),this.heap=new Uint16Array(2*Gc+1),mr(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*Gc+1),mr(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 ua=e=>{if(!e)return 1;let t=e.state;return!t||t.strm!==e||t.status!==Gn&&t.status!==uu&&t.status!==Kc&&t.status!==Wc&&t.status!==Hc&&t.status!==Jc&&t.status!==Yr&&t.status!==$i?1:0},ad=e=>{if(ua(e))return Zr(e,Ut);e.total_in=e.total_out=0,e.data_type=Sy;let t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap===2?uu:t.wrap?Gn:Yr,e.adler=t.wrap===2?0:1,t.last_flush=-2,fy(t),je},od=e=>{let t=ad(e);return t===je&&$y(e.state),t},Uy=(e,t)=>ua(e)||e.state.wrap!==2?Ut:(e.state.gzhead=t,je),sd=(e,t,r,n,i,a)=>{if(!e)return Ut;let o=1;if(t===yy&&(t=6),n<0?(o=0,n=-n):n>15&&(o=2,n-=16),i<1||i>Ey||r!==Wo||n<8||n>15||t<0||t>9||a<0||a>_y||n===8&&o!==1)return Zr(e,Ut);n===8&&(n=9);let s=new jy;return e.state=s,s.strm=e,s.status=Gn,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+H-1)/H),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=t,s.strategy=a,s.method=r,od(e)},qy=(e,t)=>sd(e,t,Wo,xy,Ty,wy),By=(e,t)=>{if(ua(e)||t>Ff||t<0)return e?Zr(e,Ut):Ut;let r=e.state;if(!e.output||e.avail_in!==0&&!e.input||r.status===$i&&t!==yt)return Zr(e,e.avail_out===0?bc:Ut);let n=r.last_flush;if(r.last_flush=t,r.pending!==0){if(st(e),e.avail_out===0)return r.last_flush=-1,je}else if(e.avail_in===0&&$f(t)<=$f(n)&&t!==yt)return Zr(e,bc);if(r.status===$i&&e.avail_in!==0)return Zr(e,bc);if(r.status===Gn&&r.wrap===0&&(r.status=Yr),r.status===Gn){let i=Wo+(r.w_bits-8<<4)<<8,a=-1;if(r.strategy>=ro||r.level<2?a=0:r.level<6?a=1:r.level===6?a=2:a=3,i|=a<<6,r.strstart!==0&&(i|=Cy),i+=31-i%31,Ti(r,i),r.strstart!==0&&(Ti(r,e.adler>>>16),Ti(r,e.adler&65535)),e.adler=1,r.status=Yr,st(e),r.pending!==0)return r.last_flush=-1,je}if(r.status===uu){if(e.adler=0,re(r,31),re(r,139),re(r,8),r.gzhead)re(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)),re(r,r.gzhead.time&255),re(r,r.gzhead.time>>8&255),re(r,r.gzhead.time>>16&255),re(r,r.gzhead.time>>24&255),re(r,r.level===9?2:r.strategy>=ro||r.level<2?4:0),re(r,r.gzhead.os&255),r.gzhead.extra&&r.gzhead.extra.length&&(re(r,r.gzhead.extra.length&255),re(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(e.adler=Re(e.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=Kc;else if(re(r,0),re(r,0),re(r,0),re(r,0),re(r,0),re(r,r.level===9?2:r.strategy>=ro||r.level<2?4:0),re(r,Ry),r.status=Yr,st(e),r.pending!==0)return r.last_flush=-1,je}if(r.status===Kc){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&&(e.adler=Re(e.adler,r.pending_buf,r.pending-i,i)),r.gzindex+=s,st(e),r.pending!==0)return r.last_flush=-1,je;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&&(e.adler=Re(e.adler,r.pending_buf,r.pending-i,i)),r.gzindex=0}r.status=Wc}if(r.status===Wc){if(r.gzhead.name){let i=r.pending,a;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>i&&(e.adler=Re(e.adler,r.pending_buf,r.pending-i,i)),st(e),r.pending!==0)return r.last_flush=-1,je;i=0}r.gzindex<r.gzhead.name.length?a=r.gzhead.name.charCodeAt(r.gzindex++)&255:a=0,re(r,a)}while(a!==0);r.gzhead.hcrc&&r.pending>i&&(e.adler=Re(e.adler,r.pending_buf,r.pending-i,i)),r.gzindex=0}r.status=Hc}if(r.status===Hc){if(r.gzhead.comment){let i=r.pending,a;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>i&&(e.adler=Re(e.adler,r.pending_buf,r.pending-i,i)),st(e),r.pending!==0)return r.last_flush=-1,je;i=0}r.gzindex<r.gzhead.comment.length?a=r.gzhead.comment.charCodeAt(r.gzindex++)&255:a=0,re(r,a)}while(a!==0);r.gzhead.hcrc&&r.pending>i&&(e.adler=Re(e.adler,r.pending_buf,r.pending-i,i))}r.status=Jc}if(r.status===Jc){if(r.gzhead.hcrc){if(r.pending+2>r.pending_buf_size&&(st(e),r.pending!==0))return r.last_flush=-1,je;re(r,e.adler&255),re(r,e.adler>>8&255),e.adler=0}if(r.status=Yr,st(e),r.pending!==0)return r.last_flush=-1,je}if(e.avail_in!==0||r.lookahead!==0||t!==_r&&r.status!==$i){let i=r.level===0?id(r,t):r.strategy===ro?My(r,t):r.strategy===by?Fy(r,t):ji[r.level].func(r,t);if((i===sn||i===Xn)&&(r.status=$i),i===He||i===sn)return e.avail_out===0&&(r.last_flush=-1),je;if(i===Zn&&(t===hy?dy(r):t!==Ff&&(zc(r,0,0,!1),t===my&&(mr(r.head),r.lookahead===0&&(r.strstart=0,r.block_start=0,r.insert=0))),st(e),e.avail_out===0))return r.last_flush=-1,je}return t!==yt?je:r.wrap<=0?Mf:(r.wrap===2?(re(r,e.adler&255),re(r,e.adler>>8&255),re(r,e.adler>>16&255),re(r,e.adler>>24&255),re(r,e.total_in&255),re(r,e.total_in>>8&255),re(r,e.total_in>>16&255),re(r,e.total_in>>24&255)):(Ti(r,e.adler>>>16),Ti(r,e.adler&65535)),st(e),r.wrap>0&&(r.wrap=-r.wrap),r.pending!==0?je:Mf)},Vy=e=>{if(ua(e))return Ut;let t=e.state.status;return e.state=null,t===Yr?Zr(e,gy):je},Qy=(e,t)=>{let r=t.length;if(ua(e))return Ut;let n=e.state,i=n.wrap;if(i===2||i===1&&n.status!==Gn||n.lookahead)return Ut;if(i===1&&(e.adler=ta(e.adler,t,r,0)),n.wrap=0,r>=n.w_size){i===0&&(mr(n.head),n.strstart=0,n.block_start=0,n.insert=0);let u=new Uint8Array(n.w_size);u.set(t.subarray(r-n.w_size,r),0),t=u,r=n.w_size}let a=e.avail_in,o=e.next_in,s=e.input;for(e.avail_in=r,e.next_in=0,e.input=t,Kn(n);n.lookahead>=H;){let u=n.strstart,c=n.lookahead-(H-1);do n.ins_h=wr(n,n.ins_h,n.window[u+H-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=H-1,Kn(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=H-1,n.match_available=0,e.next_in=o,e.input=s,e.avail_in=a,n.wrap=i,je},zy=qy,Gy=sd,Ky=od,Wy=ad,Hy=Uy,Jy=By,Yy=Vy,Zy=Qy,Xy="pako deflate (from Nodeca project)",zi={deflateInit:zy,deflateInit2:Gy,deflateReset:Ky,deflateResetKeep:Wy,deflateSetHeader:Hy,deflate:Jy,deflateEnd:Yy,deflateSetDictionary:Zy,deflateInfo:Xy},ev=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),tv=function(e){let t=Array.prototype.slice.call(arguments,1);for(;t.length;){let r=t.shift();if(!!r){if(typeof r!="object")throw new TypeError(r+"must be non-object");for(let n in r)ev(r,n)&&(e[n]=r[n])}}return e},rv=e=>{let t=0;for(let n=0,i=e.length;n<i;n++)t+=e[n].length;let r=new Uint8Array(t);for(let n=0,i=0,a=e.length;n<a;n++){let o=e[n];r.set(o,i),i+=o.length}return r},Ho={assign:tv,flattenChunks:rv},cd=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){cd=!1}var ra=new Uint8Array(256);for(let e=0;e<256;e++)ra[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;ra[254]=ra[254]=1;var nv=e=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(e);let t,r,n,i,a,o=e.length,s=0;for(i=0;i<o;i++)r=e.charCodeAt(i),(r&64512)===55296&&i+1<o&&(n=e.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(t=new Uint8Array(s),a=0,i=0;a<s;i++)r=e.charCodeAt(i),(r&64512)===55296&&i+1<o&&(n=e.charCodeAt(i+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),i++)),r<128?t[a++]=r:r<2048?(t[a++]=192|r>>>6,t[a++]=128|r&63):r<65536?(t[a++]=224|r>>>12,t[a++]=128|r>>>6&63,t[a++]=128|r&63):(t[a++]=240|r>>>18,t[a++]=128|r>>>12&63,t[a++]=128|r>>>6&63,t[a++]=128|r&63);return t},iv=(e,t)=>{if(t<65534&&e.subarray&&cd)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let r="";for(let n=0;n<t;n++)r+=String.fromCharCode(e[n]);return r},av=(e,t)=>{let r=t||e.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(e.subarray(0,t));let n,i,a=new Array(r*2);for(i=0,n=0;n<r;){let o=e[n++];if(o<128){a[i++]=o;continue}let s=ra[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|e[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 iv(a,i)},ov=(e,t)=>{t=t||e.length,t>e.length&&(t=e.length);let r=t-1;for(;r>=0&&(e[r]&192)===128;)r--;return r<0||r===0?t:r+ra[e[r]]>t?r:t},na={string2buf:nv,buf2string:av,utf8border:ov};function sv(){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 ud=sv,ld=Object.prototype.toString,{Z_NO_FLUSH:cv,Z_SYNC_FLUSH:uv,Z_FULL_FLUSH:lv,Z_FINISH:fv,Z_OK:Fo,Z_STREAM_END:pv,Z_DEFAULT_COMPRESSION:dv,Z_DEFAULT_STRATEGY:hv,Z_DEFLATED:mv}=hn;function la(e){this.options=Ho.assign({level:dv,method:mv,chunkSize:16384,windowBits:15,memLevel:8,strategy:hv},e||{});let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new ud,this.strm.avail_out=0;let r=zi.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(r!==Fo)throw new Error(on[r]);if(t.header&&zi.deflateSetHeader(this.strm,t.header),t.dictionary){let n;if(typeof t.dictionary=="string"?n=na.string2buf(t.dictionary):ld.call(t.dictionary)==="[object ArrayBuffer]"?n=new Uint8Array(t.dictionary):n=t.dictionary,r=zi.deflateSetDictionary(this.strm,n),r!==Fo)throw new Error(on[r]);this._dict_set=!0}}la.prototype.push=function(e,t){let r=this.strm,n=this.options.chunkSize,i,a;if(this.ended)return!1;for(t===~~t?a=t:a=t===!0?fv:cv,typeof e=="string"?r.input=na.string2buf(e):ld.call(e)==="[object ArrayBuffer]"?r.input=new Uint8Array(e):r.input=e,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===uv||a===lv)&&r.avail_out<=6){this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;continue}if(i=zi.deflate(r,a),i===pv)return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),i=zi.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===Fo;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};la.prototype.onData=function(e){this.chunks.push(e)};la.prototype.onEnd=function(e){e===Fo&&(this.result=Ho.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function lu(e,t){let r=new la(t);if(r.push(e,!0),r.err)throw r.msg||on[r.err];return r.result}function gv(e,t){return t=t||{},t.raw=!0,lu(e,t)}function yv(e,t){return t=t||{},t.gzip=!0,lu(e,t)}var vv=la,bv=lu,_v=gv,wv=yv,Sv=hn,Ev={Deflate:vv,deflate:bv,deflateRaw:_v,gzip:wv,constants:Sv},no=16209,xv=16191,Tv=function e(t,r){let n,i,a,o,s,u,c,l,d,p,f,h,g,y,S,b,v,m,O,N,T,D,R,C,j=t.state;n=t.next_in,R=t.input,i=n+(t.avail_in-5),a=t.next_out,C=t.output,o=a-(r-t.avail_out),s=a+(t.avail_out-257),u=j.dmax,c=j.wsize,l=j.whave,d=j.wnext,p=j.window,f=j.hold,h=j.bits,g=j.lencode,y=j.distcode,S=(1<<j.lenbits)-1,b=(1<<j.distbits)-1;e:do{h<15&&(f+=R[n++]<<h,h+=8,f+=R[n++]<<h,h+=8),v=g[f&S];t:for(;;){if(m=v>>>24,f>>>=m,h-=m,m=v>>>16&255,m===0)C[a++]=v&65535;else if(m&16){O=v&65535,m&=15,m&&(h<m&&(f+=R[n++]<<h,h+=8),O+=f&(1<<m)-1,f>>>=m,h-=m),h<15&&(f+=R[n++]<<h,h+=8,f+=R[n++]<<h,h+=8),v=y[f&b];r:for(;;){if(m=v>>>24,f>>>=m,h-=m,m=v>>>16&255,m&16){if(N=v&65535,m&=15,h<m&&(f+=R[n++]<<h,h+=8,h<m&&(f+=R[n++]<<h,h+=8)),N+=f&(1<<m)-1,N>u){t.msg="invalid distance too far back",j.mode=no;break e}if(f>>>=m,h-=m,m=a-o,N>m){if(m=N-m,m>l&&j.sane){t.msg="invalid distance too far back",j.mode=no;break e}if(T=0,D=p,d===0){if(T+=c-m,m<O){O-=m;do C[a++]=p[T++];while(--m);T=a-N,D=C}}else if(d<m){if(T+=c+d-m,m-=d,m<O){O-=m;do C[a++]=p[T++];while(--m);if(T=0,d<O){m=d,O-=m;do C[a++]=p[T++];while(--m);T=a-N,D=C}}}else if(T+=d-m,m<O){O-=m;do C[a++]=p[T++];while(--m);T=a-N,D=C}for(;O>2;)C[a++]=D[T++],C[a++]=D[T++],C[a++]=D[T++],O-=3;O&&(C[a++]=D[T++],O>1&&(C[a++]=D[T++]))}else{T=a-N;do C[a++]=C[T++],C[a++]=C[T++],C[a++]=C[T++],O-=3;while(O>2);O&&(C[a++]=C[T++],O>1&&(C[a++]=C[T++]))}}else if((m&64)===0){v=y[(v&65535)+(f&(1<<m)-1)];continue r}else{t.msg="invalid distance code",j.mode=no;break e}break}}else if((m&64)===0){v=g[(v&65535)+(f&(1<<m)-1)];continue t}else if(m&32){j.mode=xv;break e}else{t.msg="invalid literal/length code",j.mode=no;break e}break}}while(n<i&&a<s);O=h>>3,n-=O,h-=O<<3,f&=(1<<h)-1,t.next_in=n,t.next_out=a,t.avail_in=n<i?5+(i-n):5-(n-i),t.avail_out=a<s?257+(s-a):257-(a-s),j.hold=f,j.bits=h},jn=15,jf=852,Uf=592,qf=0,wc=1,Bf=2,Iv=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]),kv=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]),Ov=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]),Av=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]),Dv=(e,t,r,n,i,a,o,s)=>{let u=s.bits,c=0,l=0,d=0,p=0,f=0,h=0,g=0,y=0,S=0,b=0,v,m,O,N,T,D=null,R,C=new Uint16Array(jn+1),j=new Uint16Array(jn+1),Pe=null,Ie,U,ce;for(c=0;c<=jn;c++)C[c]=0;for(l=0;l<n;l++)C[t[r+l]]++;for(f=u,p=jn;p>=1&&C[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&&C[d]===0;d++);for(f<d&&(f=d),y=1,c=1;c<=jn;c++)if(y<<=1,y-=C[c],y<0)return-1;if(y>0&&(e===qf||p!==1))return-1;for(j[1]=0,c=1;c<jn;c++)j[c+1]=j[c]+C[c];for(l=0;l<n;l++)t[r+l]!==0&&(o[j[t[r+l]]++]=l);if(e===qf?(D=Pe=o,R=20):e===wc?(D=Iv,Pe=kv,R=257):(D=Ov,Pe=Av,R=0),b=0,l=0,c=d,T=a,h=f,g=0,O=-1,S=1<<f,N=S-1,e===wc&&S>jf||e===Bf&&S>Uf)return 1;for(;;){Ie=c-g,o[l]+1<R?(U=0,ce=o[l]):o[l]>=R?(U=Pe[o[l]-R],ce=D[o[l]-R]):(U=32+64,ce=0),v=1<<c-g,m=1<<h,d=m;do m-=v,i[T+(b>>g)+m]=Ie<<24|U<<16|ce|0;while(m!==0);for(v=1<<c-1;b&v;)v>>=1;if(v!==0?(b&=v-1,b+=v):b=0,l++,--C[c]===0){if(c===p)break;c=t[r+o[l]]}if(c>f&&(b&N)!==O){for(g===0&&(g=f),T+=d,h=c-g,y=1<<h;h+g<p&&(y-=C[h+g],!(y<=0));)h++,y<<=1;if(S+=1<<h,e===wc&&S>jf||e===Bf&&S>Uf)return 1;O=b&N,i[O]=f<<24|h<<16|T-a|0}}return b!==0&&(i[T+b]=c-g<<24|64<<16|0),s.bits=f,0},Gi=Dv,Nv=0,fd=1,pd=2,{Z_FINISH:Vf,Z_BLOCK:Cv,Z_TREES:io,Z_OK:cn,Z_STREAM_END:Rv,Z_NEED_DICT:Pv,Z_STREAM_ERROR:vt,Z_DATA_ERROR:dd,Z_MEM_ERROR:hd,Z_BUF_ERROR:Lv,Z_DEFLATED:Qf}=hn,Jo=16180,zf=16181,Gf=16182,Kf=16183,Wf=16184,Hf=16185,Jf=16186,Yf=16187,Zf=16188,Xf=16189,Mo=16190,Wt=16191,Sc=16192,ep=16193,Ec=16194,tp=16195,rp=16196,np=16197,ip=16198,ao=16199,oo=16200,ap=16201,op=16202,sp=16203,cp=16204,up=16205,xc=16206,lp=16207,fp=16208,he=16209,md=16210,gd=16211,Fv=852,Mv=592,$v=15,jv=$v,pp=e=>(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24);function Uv(){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 mn=e=>{if(!e)return 1;let t=e.state;return!t||t.strm!==e||t.mode<Jo||t.mode>gd?1:0},yd=e=>{if(mn(e))return vt;let t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=t.wrap&1),t.mode=Jo,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(Fv),t.distcode=t.distdyn=new Int32Array(Mv),t.sane=1,t.back=-1,cn},vd=e=>{if(mn(e))return vt;let t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,yd(e)},bd=(e,t)=>{let r;if(mn(e))return vt;let n=e.state;return t<0?(r=0,t=-t):(r=(t>>4)+5,t<48&&(t&=15)),t&&(t<8||t>15)?vt:(n.window!==null&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,vd(e))},_d=(e,t)=>{if(!e)return vt;let r=new Uv;e.state=r,r.strm=e,r.window=null,r.mode=Jo;let n=bd(e,t);return n!==cn&&(e.state=null),n},qv=e=>_d(e,jv),dp=!0,Tc,Ic,Bv=e=>{if(dp){Tc=new Int32Array(512),Ic=new Int32Array(32);let t=0;for(;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(Gi(fd,e.lens,0,288,Tc,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;Gi(pd,e.lens,0,32,Ic,0,e.work,{bits:5}),dp=!1}e.lencode=Tc,e.lenbits=9,e.distcode=Ic,e.distbits=5},wd=(e,t,r,n)=>{let i,a=e.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(t.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(t.subarray(r-n,r-n+i),a.wnext),n-=i,n?(a.window.set(t.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},Vv=(e,t)=>{let r,n,i,a,o,s,u,c,l,d,p,f,h,g,y=0,S,b,v,m,O,N,T,D,R=new Uint8Array(4),C,j,Pe=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(mn(e)||!e.output||!e.input&&e.avail_in!==0)return vt;r=e.state,r.mode===Wt&&(r.mode=Sc),o=e.next_out,i=e.output,u=e.avail_out,a=e.next_in,n=e.input,s=e.avail_in,c=r.hold,l=r.bits,d=s,p=u,D=cn;e:for(;;)switch(r.mode){case Jo:if(r.wrap===0){r.mode=Sc;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,R[0]=c&255,R[1]=c>>>8&255,r.check=Re(r.check,R,2,0),c=0,l=0,r.mode=zf;break}if(r.head&&(r.head.done=!1),!(r.wrap&1)||(((c&255)<<8)+(c>>8))%31){e.msg="incorrect header check",r.mode=he;break}if((c&15)!==Qf){e.msg="unknown compression method",r.mode=he;break}if(c>>>=4,l-=4,T=(c&15)+8,r.wbits===0&&(r.wbits=T),T>15||T>r.wbits){e.msg="invalid window size",r.mode=he;break}r.dmax=1<<r.wbits,r.flags=0,e.adler=r.check=1,r.mode=c&512?Xf:Wt,c=0,l=0;break;case zf:for(;l<16;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(r.flags=c,(r.flags&255)!==Qf){e.msg="unknown compression method",r.mode=he;break}if(r.flags&57344){e.msg="unknown header flags set",r.mode=he;break}r.head&&(r.head.text=c>>8&1),r.flags&512&&r.wrap&4&&(R[0]=c&255,R[1]=c>>>8&255,r.check=Re(r.check,R,2,0)),c=0,l=0,r.mode=Gf;case Gf: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&&(R[0]=c&255,R[1]=c>>>8&255,R[2]=c>>>16&255,R[3]=c>>>24&255,r.check=Re(r.check,R,4,0)),c=0,l=0,r.mode=Kf;case Kf: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&&(R[0]=c&255,R[1]=c>>>8&255,r.check=Re(r.check,R,2,0)),c=0,l=0,r.mode=Wf;case Wf: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&&(R[0]=c&255,R[1]=c>>>8&255,r.check=Re(r.check,R,2,0)),c=0,l=0}else r.head&&(r.head.extra=null);r.mode=Hf;case Hf: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=Re(r.check,n,f,a)),s-=f,a+=f,r.length-=f),r.length))break e;r.length=0,r.mode=Jf;case Jf: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=Re(r.check,n,f,a)),s-=f,a+=f,T)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=Yf;case Yf: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=Re(r.check,n,f,a)),s-=f,a+=f,T)break e}else r.head&&(r.head.comment=null);r.mode=Zf;case Zf: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)){e.msg="header crc mismatch",r.mode=he;break}c=0,l=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=Wt;break;case Xf:for(;l<32;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}e.adler=r.check=pp(c),c=0,l=0,r.mode=Mo;case Mo:if(r.havedict===0)return e.next_out=o,e.avail_out=u,e.next_in=a,e.avail_in=s,r.hold=c,r.bits=l,Pv;e.adler=r.check=1,r.mode=Wt;case Wt:if(t===Cv||t===io)break e;case Sc:if(r.last){c>>>=l&7,l-=l&7,r.mode=xc;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=ep;break;case 1:if(Bv(r),r.mode=ao,t===io){c>>>=2,l-=2;break e}break;case 2:r.mode=rp;break;case 3:e.msg="invalid block type",r.mode=he}c>>>=2,l-=2;break;case ep: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)){e.msg="invalid stored block lengths",r.mode=he;break}if(r.length=c&65535,c=0,l=0,r.mode=Ec,t===io)break e;case Ec:r.mode=tp;case tp: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=Wt;break;case rp: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){e.msg="too many length or distance symbols",r.mode=he;break}r.have=0,r.mode=np;case np:for(;r.have<r.ncode;){for(;l<3;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}r.lens[Pe[r.have++]]=c&7,c>>>=3,l-=3}for(;r.have<19;)r.lens[Pe[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,C={bits:r.lenbits},D=Gi(Nv,r.lens,0,19,r.lencode,0,r.work,C),r.lenbits=C.bits,D){e.msg="invalid code lengths set",r.mode=he;break}r.have=0,r.mode=ip;case ip:for(;r.have<r.nlen+r.ndist;){for(;y=r.lencode[c&(1<<r.lenbits)-1],S=y>>>24,b=y>>>16&255,v=y&65535,!(S<=l);){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(v<16)c>>>=S,l-=S,r.lens[r.have++]=v;else{if(v===16){for(j=S+2;l<j;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(c>>>=S,l-=S,r.have===0){e.msg="invalid bit length repeat",r.mode=he;break}T=r.lens[r.have-1],f=3+(c&3),c>>>=2,l-=2}else if(v===17){for(j=S+3;l<j;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}c>>>=S,l-=S,T=0,f=3+(c&7),c>>>=3,l-=3}else{for(j=S+7;l<j;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}c>>>=S,l-=S,T=0,f=11+(c&127),c>>>=7,l-=7}if(r.have+f>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=he;break}for(;f--;)r.lens[r.have++]=T}}if(r.mode===he)break;if(r.lens[256]===0){e.msg="invalid code -- missing end-of-block",r.mode=he;break}if(r.lenbits=9,C={bits:r.lenbits},D=Gi(fd,r.lens,0,r.nlen,r.lencode,0,r.work,C),r.lenbits=C.bits,D){e.msg="invalid literal/lengths set",r.mode=he;break}if(r.distbits=6,r.distcode=r.distdyn,C={bits:r.distbits},D=Gi(pd,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,C),r.distbits=C.bits,D){e.msg="invalid distances set",r.mode=he;break}if(r.mode=ao,t===io)break e;case ao:r.mode=oo;case oo:if(s>=6&&u>=258){e.next_out=o,e.avail_out=u,e.next_in=a,e.avail_in=s,r.hold=c,r.bits=l,Tv(e,p),o=e.next_out,i=e.output,u=e.avail_out,a=e.next_in,n=e.input,s=e.avail_in,c=r.hold,l=r.bits,r.mode===Wt&&(r.back=-1);break}for(r.back=0;y=r.lencode[c&(1<<r.lenbits)-1],S=y>>>24,b=y>>>16&255,v=y&65535,!(S<=l);){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(b&&(b&240)===0){for(m=S,O=b,N=v;y=r.lencode[N+((c&(1<<m+O)-1)>>m)],S=y>>>24,b=y>>>16&255,v=y&65535,!(m+S<=l);){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}c>>>=m,l-=m,r.back+=m}if(c>>>=S,l-=S,r.back+=S,r.length=v,b===0){r.mode=up;break}if(b&32){r.back=-1,r.mode=Wt;break}if(b&64){e.msg="invalid literal/length code",r.mode=he;break}r.extra=b&15,r.mode=ap;case ap:if(r.extra){for(j=r.extra;l<j;){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=op;case op:for(;y=r.distcode[c&(1<<r.distbits)-1],S=y>>>24,b=y>>>16&255,v=y&65535,!(S<=l);){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if((b&240)===0){for(m=S,O=b,N=v;y=r.distcode[N+((c&(1<<m+O)-1)>>m)],S=y>>>24,b=y>>>16&255,v=y&65535,!(m+S<=l);){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}c>>>=m,l-=m,r.back+=m}if(c>>>=S,l-=S,r.back+=S,b&64){e.msg="invalid distance code",r.mode=he;break}r.offset=v,r.extra=b&15,r.mode=sp;case sp:if(r.extra){for(j=r.extra;l<j;){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){e.msg="invalid distance too far back",r.mode=he;break}r.mode=cp;case cp:if(u===0)break e;if(f=p-u,r.offset>f){if(f=r.offset-f,f>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=he;break}f>r.wnext?(f-=r.wnext,h=r.wsize-f):h=r.wnext-f,f>r.length&&(f=r.length),g=r.window}else g=i,h=o-r.offset,f=r.length;f>u&&(f=u),u-=f,r.length-=f;do i[o++]=g[h++];while(--f);r.length===0&&(r.mode=oo);break;case up:if(u===0)break e;i[o++]=r.length,u--,r.mode=oo;break;case xc:if(r.wrap){for(;l<32;){if(s===0)break e;s--,c|=n[a++]<<l,l+=8}if(p-=u,e.total_out+=p,r.total+=p,r.wrap&4&&p&&(e.adler=r.check=r.flags?Re(r.check,i,p,o-p):ta(r.check,i,p,o-p)),p=u,r.wrap&4&&(r.flags?c:pp(c))!==r.check){e.msg="incorrect data check",r.mode=he;break}c=0,l=0}r.mode=lp;case lp: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)){e.msg="incorrect length check",r.mode=he;break}c=0,l=0}r.mode=fp;case fp:D=Rv;break e;case he:D=dd;break e;case md:return hd;case gd:default:return vt}return e.next_out=o,e.avail_out=u,e.next_in=a,e.avail_in=s,r.hold=c,r.bits=l,(r.wsize||p!==e.avail_out&&r.mode<he&&(r.mode<xc||t!==Vf))&&wd(e,e.output,e.next_out,p-e.avail_out),d-=e.avail_in,p-=e.avail_out,e.total_in+=d,e.total_out+=p,r.total+=p,r.wrap&4&&p&&(e.adler=r.check=r.flags?Re(r.check,i,p,e.next_out-p):ta(r.check,i,p,e.next_out-p)),e.data_type=r.bits+(r.last?64:0)+(r.mode===Wt?128:0)+(r.mode===ao||r.mode===Ec?256:0),(d===0&&p===0||t===Vf)&&D===cn&&(D=Lv),D},Qv=e=>{if(mn(e))return vt;let t=e.state;return t.window&&(t.window=null),e.state=null,cn},zv=(e,t)=>{if(mn(e))return vt;let r=e.state;return(r.wrap&2)===0?vt:(r.head=t,t.done=!1,cn)},Gv=(e,t)=>{let r=t.length,n,i,a;return mn(e)||(n=e.state,n.wrap!==0&&n.mode!==Mo)?vt:n.mode===Mo&&(i=1,i=ta(i,t,r,0),i!==n.check)?dd:(a=wd(e,t,r,r),a?(n.mode=md,hd):(n.havedict=1,cn))},Kv=vd,Wv=bd,Hv=yd,Jv=qv,Yv=_d,Zv=Vv,Xv=Qv,eb=zv,tb=Gv,rb="pako inflate (from Nodeca project)",Zt={inflateReset:Kv,inflateReset2:Wv,inflateResetKeep:Hv,inflateInit:Jv,inflateInit2:Yv,inflate:Zv,inflateEnd:Xv,inflateGetHeader:eb,inflateSetDictionary:tb,inflateInfo:rb};function nb(){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 ib=nb,Sd=Object.prototype.toString,{Z_NO_FLUSH:ab,Z_FINISH:ob,Z_OK:ia,Z_STREAM_END:kc,Z_NEED_DICT:Oc,Z_STREAM_ERROR:sb,Z_DATA_ERROR:hp,Z_MEM_ERROR:cb}=hn;function fa(e){this.options=Ho.assign({chunkSize:1024*64,windowBits:15,to:""},e||{});let t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),t.windowBits>=0&&t.windowBits<16&&!(e&&e.windowBits)&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(t.windowBits&15)===0&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new ud,this.strm.avail_out=0;let r=Zt.inflateInit2(this.strm,t.windowBits);if(r!==ia)throw new Error(on[r]);if(this.header=new ib,Zt.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=na.string2buf(t.dictionary):Sd.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(r=Zt.inflateSetDictionary(this.strm,t.dictionary),r!==ia)))throw new Error(on[r])}fa.prototype.push=function(e,t){let r=this.strm,n=this.options.chunkSize,i=this.options.dictionary,a,o,s;if(this.ended)return!1;for(t===~~t?o=t:o=t===!0?ob:ab,Sd.call(e)==="[object ArrayBuffer]"?r.input=new Uint8Array(e):r.input=e,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=Zt.inflate(r,o),a===Oc&&i&&(a=Zt.inflateSetDictionary(r,i),a===ia?a=Zt.inflate(r,o):a===hp&&(a=Oc));r.avail_in>0&&a===kc&&r.state.wrap>0&&e[r.next_in]!==0;)Zt.inflateReset(r),a=Zt.inflate(r,o);switch(a){case sb:case hp:case Oc:case cb:return this.onEnd(a),this.ended=!0,!1}if(s=r.avail_out,r.next_out&&(r.avail_out===0||a===kc))if(this.options.to==="string"){let u=na.utf8border(r.output,r.next_out),c=r.next_out-u,l=na.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===ia&&s===0)){if(a===kc)return a=Zt.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,!0;if(r.avail_in===0)break}}return!0};fa.prototype.onData=function(e){this.chunks.push(e)};fa.prototype.onEnd=function(e){e===ia&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Ho.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function fu(e,t){let r=new fa(t);if(r.push(e),r.err)throw r.msg||on[r.err];return r.result}function ub(e,t){return t=t||{},t.raw=!0,fu(e,t)}var lb=fa,fb=fu,pb=ub,db=fu,hb=hn,mb={Inflate:lb,inflate:fb,inflateRaw:pb,ungzip:db,constants:hb},{Deflate:gb,deflate:yb,deflateRaw:vb,gzip:bb}=Ev,{Inflate:_b,inflate:wb,inflateRaw:Sb,ungzip:Eb}=mb,xb=gb,Tb=yb,Ib=vb,kb=bb,Ob=_b,Ab=wb,Db=Sb,Nb=Eb,Cb=hn,Rb={Deflate:xb,deflate:Tb,deflateRaw:Ib,gzip:kb,Inflate:Ob,inflate:Ab,inflateRaw:Db,ungzip:Nb,constants:Cb},fe=function(e,t,r,n){var i=arguments.length,a=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},pe=function(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)},$o=class{constructor(t,r){this.input=t,this.output=r}};fe([w(),pe("design:type",String)],$o.prototype,"input",void 0);fe([w(),pe("design:type",String)],$o.prototype,"output",void 0);$o=fe([Ue(),pe("design:paramtypes",[String,String])],$o);var jo=class{constructor(t,r){this.input=t,this.output=r}};fe([w(),pe("design:type",String)],jo.prototype,"input",void 0);fe([w(),pe("design:type",String)],jo.prototype,"output",void 0);jo=fe([W(),pe("design:paramtypes",[String,String])],jo);var kr=class{constructor(t,r,n,i,a){this.name=t,this.modelId=r,this.systemPrompt=n,this.promptExamples=i,this.metaData=a}};fe([w(),pe("design:type",String)],kr.prototype,"name",void 0);fe([w(),pe("design:type",String)],kr.prototype,"modelId",void 0);fe([w(),pe("design:type",String)],kr.prototype,"systemPrompt",void 0);fe([w(),pe("design:type",Array)],kr.prototype,"promptExamples",void 0);fe([w(),pe("design:type",String)],kr.prototype,"metaData",void 0);kr=fe([Ue(),pe("design:paramtypes",[String,String,String,Array,String])],kr);var Bt=class{constructor(t,r,n,i,a,o,s,u){this.name=t,this.modelId=r,this.taskId=n,this.systemPrompt=i,this.promptExamples=a,this.metaData=o,this.createdAt=s,this.updatedAt=u}};fe([w(),pe("design:type",String)],Bt.prototype,"name",void 0);fe([w(),pe("design:type",String)],Bt.prototype,"modelId",void 0);fe([w(),pe("design:type",String)],Bt.prototype,"taskId",void 0);fe([w(),pe("design:type",String)],Bt.prototype,"systemPrompt",void 0);fe([w(),pe("design:type",Array)],Bt.prototype,"promptExamples",void 0);fe([w(),pe("design:type",String)],Bt.prototype,"metaData",void 0);fe([w(),pe("design:type",String)],Bt.prototype,"createdAt",void 0);fe([w(),pe("design:type",String)],Bt.prototype,"updatedAt",void 0);Bt=fe([W(),pe("design:paramtypes",[String,String,String,String,Array,String,String,String])],Bt);var un=class{constructor(t,r,n,i,a){this.model=t,this.status=r,this.progress=n,this.downloaded=i,this.loaded=a}};fe([w(),pe("design:type",String)],un.prototype,"model",void 0);fe([w(),pe("design:type",String)],un.prototype,"status",void 0);fe([w(),pe("design:type",Number)],un.prototype,"progress",void 0);fe([w(),pe("design:type",Boolean)],un.prototype,"downloaded",void 0);fe([w(),pe("design:type",Boolean)],un.prototype,"loaded",void 0);un=fe([W(),pe("design:paramtypes",[String,String,Number,Boolean,Boolean])],un);var Pb=function(e,t,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 t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(e,r):i?i.value=r:t.set(e,r),r},Ne=function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},Ae,bo,Zc=class{constructor(t,r=!0){Ae.set(this,void 0),bo.set(this,new Map),Pb(this,Ae,t,"f")}async getModels(){let t=await Ne(this,Ae,"f").query({query:E`
|
|
648
|
+
}`,variables:{url:t,interactionCall:r}}));return n}};Jt=new WeakMap;var Ko={};Ko.byteLength=Dg;Ko.toByteArray=Rg;Ko.fromByteArray=Lg;var Mt=[],mt=[],Ag=typeof Uint8Array<"u"?Uint8Array:Array,hc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(qr=0,Of=hc.length;qr<Of;++qr)Mt[qr]=hc[qr],mt[hc.charCodeAt(qr)]=qr;var qr,Of;mt["-".charCodeAt(0)]=62;mt["_".charCodeAt(0)]=63;function qp(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");r===-1&&(r=t);var n=r===t?0:4-r%4;return[r,n]}function Dg(e){var t=qp(e),r=t[0],n=t[1];return(r+n)*3/4-n}function Ng(e,t,r){return(t+r)*3/4-r}function Rg(e){var t,r=qp(e),n=r[0],i=r[1],a=new Ag(Ng(e,n,i)),o=0,s=i>0?n-4:n,u;for(u=0;u<s;u+=4)t=mt[e.charCodeAt(u)]<<18|mt[e.charCodeAt(u+1)]<<12|mt[e.charCodeAt(u+2)]<<6|mt[e.charCodeAt(u+3)],a[o++]=t>>16&255,a[o++]=t>>8&255,a[o++]=t&255;return i===2&&(t=mt[e.charCodeAt(u)]<<2|mt[e.charCodeAt(u+1)]>>4,a[o++]=t&255),i===1&&(t=mt[e.charCodeAt(u)]<<10|mt[e.charCodeAt(u+1)]<<4|mt[e.charCodeAt(u+2)]>>2,a[o++]=t>>8&255,a[o++]=t&255),a}function Cg(e){return Mt[e>>18&63]+Mt[e>>12&63]+Mt[e>>6&63]+Mt[e&63]}function Pg(e,t,r){for(var n,i=[],a=t;a<r;a+=3)n=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(e[a+2]&255),i.push(Cg(n));return i.join("")}function Lg(e){for(var t,r=e.length,n=r%3,i=[],a=16383,o=0,s=r-n;o<s;o+=a)i.push(Pg(e,o,o+a>s?s:o+a));return n===1?(t=e[r-1],i.push(Mt[t>>2]+Mt[t<<4&63]+"==")):n===2&&(t=(e[r-2]<<8)+e[r-1],i.push(Mt[t>>10]+Mt[t>>4&63]+Mt[t<<2&63]+"=")),i.join("")}var Fg=4,Af=0,Df=1,Mg=2;function Yn(e){let t=e.length;for(;--t>=0;)e[t]=0}var $g=0,Bp=1,jg=2,Ug=3,qg=258,au=29,ca=256,Yi=ca+1+au,Bn=30,ou=19,Vp=2*Yi+1,Jr=15,mc=16,Bg=7,su=256,Qp=16,zp=17,Gp=18,Vc=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]),vo=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]),Vg=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),Kp=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Qg=512,Yt=new Array((Yi+2)*2);Yn(Yt);var Qi=new Array(Bn*2);Yn(Qi);var Zi=new Array(Qg);Yn(Zi);var Xi=new Array(qg-Ug+1);Yn(Xi);var cu=new Array(au);Yn(cu);var Lo=new Array(Bn);Yn(Lo);function gc(e,t,r,n,i){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=e&&e.length}var Wp,Hp,Jp;function yc(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}var Yp=e=>e<256?Zi[e]:Zi[256+(e>>>7)],ea=(e,t)=>{e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255},rt=(e,t,r)=>{e.bi_valid>mc-r?(e.bi_buf|=t<<e.bi_valid&65535,ea(e,e.bi_buf),e.bi_buf=t>>mc-e.bi_valid,e.bi_valid+=r-mc):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=r)},$t=(e,t,r)=>{rt(e,r[t*2],r[t*2+1])},Zp=(e,t)=>{let r=0;do r|=e&1,e>>>=1,r<<=1;while(--t>0);return r>>>1},zg=e=>{e.bi_valid===16?(ea(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)},Gg=(e,t)=>{let r=t.dyn_tree,n=t.max_code,i=t.stat_desc.static_tree,a=t.stat_desc.has_stree,o=t.stat_desc.extra_bits,s=t.stat_desc.extra_base,u=t.stat_desc.max_length,c,l,d,p,f,h,g=0;for(p=0;p<=Jr;p++)e.bl_count[p]=0;for(r[e.heap[e.heap_max]*2+1]=0,c=e.heap_max+1;c<Vp;c++)l=e.heap[c],p=r[r[l*2+1]*2+1]+1,p>u&&(p=u,g++),r[l*2+1]=p,!(l>n)&&(e.bl_count[p]++,f=0,l>=s&&(f=o[l-s]),h=r[l*2],e.opt_len+=h*(p+f),a&&(e.static_len+=h*(i[l*2+1]+f)));if(g!==0){do{for(p=u-1;e.bl_count[p]===0;)p--;e.bl_count[p]--,e.bl_count[p+1]+=2,e.bl_count[u]--,g-=2}while(g>0);for(p=u;p!==0;p--)for(l=e.bl_count[p];l!==0;)d=e.heap[--c],!(d>n)&&(r[d*2+1]!==p&&(e.opt_len+=(p-r[d*2+1])*r[d*2],r[d*2+1]=p),l--)}},Xp=(e,t,r)=>{let n=new Array(Jr+1),i=0,a,o;for(a=1;a<=Jr;a++)i=i+r[a-1]<<1,n[a]=i;for(o=0;o<=t;o++){let s=e[o*2+1];s!==0&&(e[o*2]=Zp(n[s]++,s))}},Kg=()=>{let e,t,r,n,i,a=new Array(Jr+1);for(r=0,n=0;n<au-1;n++)for(cu[n]=r,e=0;e<1<<Vc[n];e++)Xi[r++]=n;for(Xi[r-1]=n,i=0,n=0;n<16;n++)for(Lo[n]=i,e=0;e<1<<vo[n];e++)Zi[i++]=n;for(i>>=7;n<Bn;n++)for(Lo[n]=i<<7,e=0;e<1<<vo[n]-7;e++)Zi[256+i++]=n;for(t=0;t<=Jr;t++)a[t]=0;for(e=0;e<=143;)Yt[e*2+1]=8,e++,a[8]++;for(;e<=255;)Yt[e*2+1]=9,e++,a[9]++;for(;e<=279;)Yt[e*2+1]=7,e++,a[7]++;for(;e<=287;)Yt[e*2+1]=8,e++,a[8]++;for(Xp(Yt,Yi+1,a),e=0;e<Bn;e++)Qi[e*2+1]=5,Qi[e*2]=Zp(e,5);Wp=new gc(Yt,Vc,ca+1,Yi,Jr),Hp=new gc(Qi,vo,0,Bn,Jr),Jp=new gc(new Array(0),Vg,0,ou,Bg)},ed=e=>{let t;for(t=0;t<Yi;t++)e.dyn_ltree[t*2]=0;for(t=0;t<Bn;t++)e.dyn_dtree[t*2]=0;for(t=0;t<ou;t++)e.bl_tree[t*2]=0;e.dyn_ltree[su*2]=1,e.opt_len=e.static_len=0,e.sym_next=e.matches=0},td=e=>{e.bi_valid>8?ea(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},Nf=(e,t,r,n)=>{let i=t*2,a=r*2;return e[i]<e[a]||e[i]===e[a]&&n[t]<=n[r]},vc=(e,t,r)=>{let n=e.heap[r],i=r<<1;for(;i<=e.heap_len&&(i<e.heap_len&&Nf(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!Nf(t,n,e.heap[i],e.depth));)e.heap[r]=e.heap[i],r=i,i<<=1;e.heap[r]=n},Rf=(e,t,r)=>{let n,i,a=0,o,s;if(e.sym_next!==0)do n=e.pending_buf[e.sym_buf+a++]&255,n+=(e.pending_buf[e.sym_buf+a++]&255)<<8,i=e.pending_buf[e.sym_buf+a++],n===0?$t(e,i,t):(o=Xi[i],$t(e,o+ca+1,t),s=Vc[o],s!==0&&(i-=cu[o],rt(e,i,s)),n--,o=Yp(n),$t(e,o,r),s=vo[o],s!==0&&(n-=Lo[o],rt(e,n,s)));while(a<e.sym_next);$t(e,su,t)},Qc=(e,t)=>{let r=t.dyn_tree,n=t.stat_desc.static_tree,i=t.stat_desc.has_stree,a=t.stat_desc.elems,o,s,u=-1,c;for(e.heap_len=0,e.heap_max=Vp,o=0;o<a;o++)r[o*2]!==0?(e.heap[++e.heap_len]=u=o,e.depth[o]=0):r[o*2+1]=0;for(;e.heap_len<2;)c=e.heap[++e.heap_len]=u<2?++u:0,r[c*2]=1,e.depth[c]=0,e.opt_len--,i&&(e.static_len-=n[c*2+1]);for(t.max_code=u,o=e.heap_len>>1;o>=1;o--)vc(e,r,o);c=a;do o=e.heap[1],e.heap[1]=e.heap[e.heap_len--],vc(e,r,1),s=e.heap[1],e.heap[--e.heap_max]=o,e.heap[--e.heap_max]=s,r[c*2]=r[o*2]+r[s*2],e.depth[c]=(e.depth[o]>=e.depth[s]?e.depth[o]:e.depth[s])+1,r[o*2+1]=r[s*2+1]=c,e.heap[1]=c++,vc(e,r,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],Gg(e,t),Xp(r,u,e.bl_count)},Cf=(e,t,r)=>{let n,i=-1,a,o=t[0*2+1],s=0,u=7,c=4;for(o===0&&(u=138,c=3),t[(r+1)*2+1]=65535,n=0;n<=r;n++)a=o,o=t[(n+1)*2+1],!(++s<u&&a===o)&&(s<c?e.bl_tree[a*2]+=s:a!==0?(a!==i&&e.bl_tree[a*2]++,e.bl_tree[Qp*2]++):s<=10?e.bl_tree[zp*2]++:e.bl_tree[Gp*2]++,s=0,i=a,o===0?(u=138,c=3):a===o?(u=6,c=3):(u=7,c=4))},Pf=(e,t,r)=>{let n,i=-1,a,o=t[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=t[(n+1)*2+1],!(++s<u&&a===o)){if(s<c)do $t(e,a,e.bl_tree);while(--s!==0);else a!==0?(a!==i&&($t(e,a,e.bl_tree),s--),$t(e,Qp,e.bl_tree),rt(e,s-3,2)):s<=10?($t(e,zp,e.bl_tree),rt(e,s-3,3)):($t(e,Gp,e.bl_tree),rt(e,s-11,7));s=0,i=a,o===0?(u=138,c=3):a===o?(u=6,c=3):(u=7,c=4)}},Wg=e=>{let t;for(Cf(e,e.dyn_ltree,e.l_desc.max_code),Cf(e,e.dyn_dtree,e.d_desc.max_code),Qc(e,e.bl_desc),t=ou-1;t>=3&&e.bl_tree[Kp[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t},Hg=(e,t,r,n)=>{let i;for(rt(e,t-257,5),rt(e,r-1,5),rt(e,n-4,4),i=0;i<n;i++)rt(e,e.bl_tree[Kp[i]*2+1],3);Pf(e,e.dyn_ltree,t-1),Pf(e,e.dyn_dtree,r-1)},Jg=e=>{let t=4093624447,r;for(r=0;r<=31;r++,t>>>=1)if(t&1&&e.dyn_ltree[r*2]!==0)return Af;if(e.dyn_ltree[9*2]!==0||e.dyn_ltree[10*2]!==0||e.dyn_ltree[13*2]!==0)return Df;for(r=32;r<ca;r++)if(e.dyn_ltree[r*2]!==0)return Df;return Af},Lf=!1,Yg=e=>{Lf||(Kg(),Lf=!0),e.l_desc=new yc(e.dyn_ltree,Wp),e.d_desc=new yc(e.dyn_dtree,Hp),e.bl_desc=new yc(e.bl_tree,Jp),e.bi_buf=0,e.bi_valid=0,ed(e)},rd=(e,t,r,n)=>{rt(e,($g<<1)+(n?1:0),3),td(e),ea(e,r),ea(e,~r),r&&e.pending_buf.set(e.window.subarray(t,t+r),e.pending),e.pending+=r},Zg=e=>{rt(e,Bp<<1,3),$t(e,su,Yt),zg(e)},Xg=(e,t,r,n)=>{let i,a,o=0;e.level>0?(e.strm.data_type===Mg&&(e.strm.data_type=Jg(e)),Qc(e,e.l_desc),Qc(e,e.d_desc),o=Wg(e),i=e.opt_len+3+7>>>3,a=e.static_len+3+7>>>3,a<=i&&(i=a)):i=a=r+5,r+4<=i&&t!==-1?rd(e,t,r,n):e.strategy===Fg||a===i?(rt(e,(Bp<<1)+(n?1:0),3),Rf(e,Yt,Qi)):(rt(e,(jg<<1)+(n?1:0),3),Hg(e,e.l_desc.max_code+1,e.d_desc.max_code+1,o+1),Rf(e,e.dyn_ltree,e.dyn_dtree)),ed(e),n&&td(e)},ey=(e,t,r)=>(e.pending_buf[e.sym_buf+e.sym_next++]=t,e.pending_buf[e.sym_buf+e.sym_next++]=t>>8,e.pending_buf[e.sym_buf+e.sym_next++]=r,t===0?e.dyn_ltree[r*2]++:(e.matches++,t--,e.dyn_ltree[(Xi[r]+ca+1)*2]++,e.dyn_dtree[Yp(t)*2]++),e.sym_next===e.sym_end),ty=Yg,ry=rd,ny=Xg,iy=ey,ay=Zg,oy={_tr_init:ty,_tr_stored_block:ry,_tr_flush_block:ny,_tr_tally:iy,_tr_align:ay},sy=(e,t,r,n)=>{let i=e&65535|0,a=e>>>16&65535|0,o=0;for(;r!==0;){o=r>2e3?2e3:r,r-=o;do i=i+t[n++]|0,a=a+i|0;while(--o);i%=65521,a%=65521}return i|a<<16|0},ta=sy,cy=()=>{let e,t=[];for(var r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=e&1?3988292384^e>>>1:e>>>1;t[r]=e}return t},uy=new Uint32Array(cy()),ly=(e,t,r,n)=>{let i=uy,a=n+r;e^=-1;for(let o=n;o<a;o++)e=e>>>8^i[(e^t[o])&255];return e^-1},Ce=ly,on={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"},hn={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:fy,_tr_stored_block:zc,_tr_flush_block:py,_tr_tally:br,_tr_align:dy}=oy,{Z_NO_FLUSH:_r,Z_PARTIAL_FLUSH:hy,Z_FULL_FLUSH:my,Z_FINISH:yt,Z_BLOCK:Ff,Z_OK:je,Z_STREAM_END:Mf,Z_STREAM_ERROR:Ut,Z_DATA_ERROR:gy,Z_BUF_ERROR:bc,Z_DEFAULT_COMPRESSION:yy,Z_FILTERED:vy,Z_HUFFMAN_ONLY:ro,Z_RLE:by,Z_FIXED:_y,Z_DEFAULT_STRATEGY:wy,Z_UNKNOWN:Sy,Z_DEFLATED:Wo}=hn,Ey=9,xy=15,Ty=8,Iy=29,ky=256,Gc=ky+1+Iy,Oy=30,Ay=19,Dy=2*Gc+1,Ny=15,H=3,gr=258,qt=gr+H+1,Ry=32,Gn=42,uu=57,Kc=69,Wc=73,Hc=91,Jc=103,Yr=113,$i=666,He=1,Zn=2,sn=3,Xn=4,Cy=3,Zr=(e,t)=>(e.msg=on[t],t),$f=e=>e*2-(e>4?9:0),mr=e=>{let t=e.length;for(;--t>=0;)e[t]=0},Py=e=>{let t,r,n,i=e.w_size;t=e.hash_size,n=t;do r=e.head[--n],e.head[n]=r>=i?r-i:0;while(--t);t=i,n=t;do r=e.prev[--n],e.prev[n]=r>=i?r-i:0;while(--t)},Ly=(e,t,r)=>(t<<e.hash_shift^r)&e.hash_mask,wr=Ly,st=e=>{let t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),r!==0&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+r),e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,t.pending===0&&(t.pending_out=0))},ut=(e,t)=>{py(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,st(e.strm)},re=(e,t)=>{e.pending_buf[e.pending++]=t},Ti=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255},Yc=(e,t,r,n)=>{let i=e.avail_in;return i>n&&(i=n),i===0?0:(e.avail_in-=i,t.set(e.input.subarray(e.next_in,e.next_in+i),r),e.state.wrap===1?e.adler=ta(e.adler,t,i,r):e.state.wrap===2&&(e.adler=Ce(e.adler,t,i,r)),e.next_in+=i,e.total_in+=i,i)},nd=(e,t)=>{let r=e.max_chain_length,n=e.strstart,i,a,o=e.prev_length,s=e.nice_match,u=e.strstart>e.w_size-qt?e.strstart-(e.w_size-qt):0,c=e.window,l=e.w_mask,d=e.prev,p=e.strstart+gr,f=c[n+o-1],h=c[n+o];e.prev_length>=e.good_match&&(r>>=2),s>e.lookahead&&(s=e.lookahead);do if(i=t,!(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=gr-(p-n),n=p-gr,a>o){if(e.match_start=t,o=a,a>=s)break;f=c[n+o-1],h=c[n+o]}}while((t=d[t&l])>u&&--r!==0);return o<=e.lookahead?o:e.lookahead},Kn=e=>{let t=e.w_size,r,n,i;do{if(n=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-qt)&&(e.window.set(e.window.subarray(t,t+t-n),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,e.insert>e.strstart&&(e.insert=e.strstart),Py(e),n+=t),e.strm.avail_in===0)break;if(r=Yc(e.strm,e.window,e.strstart+e.lookahead,n),e.lookahead+=r,e.lookahead+e.insert>=H)for(i=e.strstart-e.insert,e.ins_h=e.window[i],e.ins_h=wr(e,e.ins_h,e.window[i+1]);e.insert&&(e.ins_h=wr(e,e.ins_h,e.window[i+H-1]),e.prev[i&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=i,i++,e.insert--,!(e.lookahead+e.insert<H)););}while(e.lookahead<qt&&e.strm.avail_in!==0)},id=(e,t)=>{let r=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,n,i,a,o=0,s=e.strm.avail_in;do{if(n=65535,a=e.bi_valid+42>>3,e.strm.avail_out<a||(a=e.strm.avail_out-a,i=e.strstart-e.block_start,n>i+e.strm.avail_in&&(n=i+e.strm.avail_in),n>a&&(n=a),n<r&&(n===0&&t!==yt||t===_r||n!==i+e.strm.avail_in)))break;o=t===yt&&n===i+e.strm.avail_in?1:0,zc(e,0,0,o),e.pending_buf[e.pending-4]=n,e.pending_buf[e.pending-3]=n>>8,e.pending_buf[e.pending-2]=~n,e.pending_buf[e.pending-1]=~n>>8,st(e.strm),i&&(i>n&&(i=n),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+i),e.strm.next_out),e.strm.next_out+=i,e.strm.avail_out-=i,e.strm.total_out+=i,e.block_start+=i,n-=i),n&&(Yc(e.strm,e.strm.output,e.strm.next_out,n),e.strm.next_out+=n,e.strm.avail_out-=n,e.strm.total_out+=n)}while(o===0);return s-=e.strm.avail_in,s&&(s>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=s&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-s,e.strm.next_in),e.strstart),e.strstart+=s,e.insert+=s>e.w_size-e.insert?e.w_size-e.insert:s),e.block_start=e.strstart),e.high_water<e.strstart&&(e.high_water=e.strstart),o?Xn:t!==_r&&t!==yt&&e.strm.avail_in===0&&e.strstart===e.block_start?Zn:(a=e.window_size-e.strstart,e.strm.avail_in>a&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,a+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),a>e.strm.avail_in&&(a=e.strm.avail_in),a&&(Yc(e.strm,e.window,e.strstart,a),e.strstart+=a,e.insert+=a>e.w_size-e.insert?e.w_size-e.insert:a),e.high_water<e.strstart&&(e.high_water=e.strstart),a=e.bi_valid+42>>3,a=e.pending_buf_size-a>65535?65535:e.pending_buf_size-a,r=a>e.w_size?e.w_size:a,i=e.strstart-e.block_start,(i>=r||(i||t===yt)&&t!==_r&&e.strm.avail_in===0&&i<=a)&&(n=i>a?a:i,o=t===yt&&e.strm.avail_in===0&&n===i?1:0,zc(e,e.block_start,n,o),e.block_start+=n,st(e.strm)),o?sn:He)},_c=(e,t)=>{let r,n;for(;;){if(e.lookahead<qt){if(Kn(e),e.lookahead<qt&&t===_r)return He;if(e.lookahead===0)break}if(r=0,e.lookahead>=H&&(e.ins_h=wr(e,e.ins_h,e.window[e.strstart+H-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),r!==0&&e.strstart-r<=e.w_size-qt&&(e.match_length=nd(e,r)),e.match_length>=H)if(n=br(e,e.strstart-e.match_start,e.match_length-H),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=H){e.match_length--;do e.strstart++,e.ins_h=wr(e,e.ins_h,e.window[e.strstart+H-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=wr(e,e.ins_h,e.window[e.strstart+1]);else n=br(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(n&&(ut(e,!1),e.strm.avail_out===0))return He}return e.insert=e.strstart<H-1?e.strstart:H-1,t===yt?(ut(e,!0),e.strm.avail_out===0?sn:Xn):e.sym_next&&(ut(e,!1),e.strm.avail_out===0)?He:Zn},$n=(e,t)=>{let r,n,i;for(;;){if(e.lookahead<qt){if(Kn(e),e.lookahead<qt&&t===_r)return He;if(e.lookahead===0)break}if(r=0,e.lookahead>=H&&(e.ins_h=wr(e,e.ins_h,e.window[e.strstart+H-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=H-1,r!==0&&e.prev_length<e.max_lazy_match&&e.strstart-r<=e.w_size-qt&&(e.match_length=nd(e,r),e.match_length<=5&&(e.strategy===vy||e.match_length===H&&e.strstart-e.match_start>4096)&&(e.match_length=H-1)),e.prev_length>=H&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-H,n=br(e,e.strstart-1-e.prev_match,e.prev_length-H),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=i&&(e.ins_h=wr(e,e.ins_h,e.window[e.strstart+H-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!==0);if(e.match_available=0,e.match_length=H-1,e.strstart++,n&&(ut(e,!1),e.strm.avail_out===0))return He}else if(e.match_available){if(n=br(e,0,e.window[e.strstart-1]),n&&ut(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return He}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(n=br(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<H-1?e.strstart:H-1,t===yt?(ut(e,!0),e.strm.avail_out===0?sn:Xn):e.sym_next&&(ut(e,!1),e.strm.avail_out===0)?He:Zn},Fy=(e,t)=>{let r,n,i,a,o=e.window;for(;;){if(e.lookahead<=gr){if(Kn(e),e.lookahead<=gr&&t===_r)return He;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=H&&e.strstart>0&&(i=e.strstart-1,n=o[i],n===o[++i]&&n===o[++i]&&n===o[++i])){a=e.strstart+gr;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);e.match_length=gr-(a-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=H?(r=br(e,1,e.match_length-H),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=br(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(ut(e,!1),e.strm.avail_out===0))return He}return e.insert=0,t===yt?(ut(e,!0),e.strm.avail_out===0?sn:Xn):e.sym_next&&(ut(e,!1),e.strm.avail_out===0)?He:Zn},My=(e,t)=>{let r;for(;;){if(e.lookahead===0&&(Kn(e),e.lookahead===0)){if(t===_r)return He;break}if(e.match_length=0,r=br(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(ut(e,!1),e.strm.avail_out===0))return He}return e.insert=0,t===yt?(ut(e,!0),e.strm.avail_out===0?sn:Xn):e.sym_next&&(ut(e,!1),e.strm.avail_out===0)?He:Zn};function Lt(e,t,r,n,i){this.good_length=e,this.max_lazy=t,this.nice_length=r,this.max_chain=n,this.func=i}var ji=[new Lt(0,0,0,0,id),new Lt(4,4,8,4,_c),new Lt(4,5,16,8,_c),new Lt(4,6,32,32,_c),new Lt(4,4,16,16,$n),new Lt(8,16,32,32,$n),new Lt(8,16,128,128,$n),new Lt(8,32,128,256,$n),new Lt(32,128,258,1024,$n),new Lt(32,258,258,4096,$n)],$y=e=>{e.window_size=2*e.w_size,mr(e.head),e.max_lazy_match=ji[e.level].max_lazy,e.good_match=ji[e.level].good_length,e.nice_match=ji[e.level].nice_length,e.max_chain_length=ji[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=H-1,e.match_available=0,e.ins_h=0};function jy(){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=Wo,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(Dy*2),this.dyn_dtree=new Uint16Array((2*Oy+1)*2),this.bl_tree=new Uint16Array((2*Ay+1)*2),mr(this.dyn_ltree),mr(this.dyn_dtree),mr(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(Ny+1),this.heap=new Uint16Array(2*Gc+1),mr(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*Gc+1),mr(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 ua=e=>{if(!e)return 1;let t=e.state;return!t||t.strm!==e||t.status!==Gn&&t.status!==uu&&t.status!==Kc&&t.status!==Wc&&t.status!==Hc&&t.status!==Jc&&t.status!==Yr&&t.status!==$i?1:0},ad=e=>{if(ua(e))return Zr(e,Ut);e.total_in=e.total_out=0,e.data_type=Sy;let t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap===2?uu:t.wrap?Gn:Yr,e.adler=t.wrap===2?0:1,t.last_flush=-2,fy(t),je},od=e=>{let t=ad(e);return t===je&&$y(e.state),t},Uy=(e,t)=>ua(e)||e.state.wrap!==2?Ut:(e.state.gzhead=t,je),sd=(e,t,r,n,i,a)=>{if(!e)return Ut;let o=1;if(t===yy&&(t=6),n<0?(o=0,n=-n):n>15&&(o=2,n-=16),i<1||i>Ey||r!==Wo||n<8||n>15||t<0||t>9||a<0||a>_y||n===8&&o!==1)return Zr(e,Ut);n===8&&(n=9);let s=new jy;return e.state=s,s.strm=e,s.status=Gn,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+H-1)/H),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=t,s.strategy=a,s.method=r,od(e)},qy=(e,t)=>sd(e,t,Wo,xy,Ty,wy),By=(e,t)=>{if(ua(e)||t>Ff||t<0)return e?Zr(e,Ut):Ut;let r=e.state;if(!e.output||e.avail_in!==0&&!e.input||r.status===$i&&t!==yt)return Zr(e,e.avail_out===0?bc:Ut);let n=r.last_flush;if(r.last_flush=t,r.pending!==0){if(st(e),e.avail_out===0)return r.last_flush=-1,je}else if(e.avail_in===0&&$f(t)<=$f(n)&&t!==yt)return Zr(e,bc);if(r.status===$i&&e.avail_in!==0)return Zr(e,bc);if(r.status===Gn&&r.wrap===0&&(r.status=Yr),r.status===Gn){let i=Wo+(r.w_bits-8<<4)<<8,a=-1;if(r.strategy>=ro||r.level<2?a=0:r.level<6?a=1:r.level===6?a=2:a=3,i|=a<<6,r.strstart!==0&&(i|=Ry),i+=31-i%31,Ti(r,i),r.strstart!==0&&(Ti(r,e.adler>>>16),Ti(r,e.adler&65535)),e.adler=1,r.status=Yr,st(e),r.pending!==0)return r.last_flush=-1,je}if(r.status===uu){if(e.adler=0,re(r,31),re(r,139),re(r,8),r.gzhead)re(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)),re(r,r.gzhead.time&255),re(r,r.gzhead.time>>8&255),re(r,r.gzhead.time>>16&255),re(r,r.gzhead.time>>24&255),re(r,r.level===9?2:r.strategy>=ro||r.level<2?4:0),re(r,r.gzhead.os&255),r.gzhead.extra&&r.gzhead.extra.length&&(re(r,r.gzhead.extra.length&255),re(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(e.adler=Ce(e.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=Kc;else if(re(r,0),re(r,0),re(r,0),re(r,0),re(r,0),re(r,r.level===9?2:r.strategy>=ro||r.level<2?4:0),re(r,Cy),r.status=Yr,st(e),r.pending!==0)return r.last_flush=-1,je}if(r.status===Kc){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&&(e.adler=Ce(e.adler,r.pending_buf,r.pending-i,i)),r.gzindex+=s,st(e),r.pending!==0)return r.last_flush=-1,je;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&&(e.adler=Ce(e.adler,r.pending_buf,r.pending-i,i)),r.gzindex=0}r.status=Wc}if(r.status===Wc){if(r.gzhead.name){let i=r.pending,a;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>i&&(e.adler=Ce(e.adler,r.pending_buf,r.pending-i,i)),st(e),r.pending!==0)return r.last_flush=-1,je;i=0}r.gzindex<r.gzhead.name.length?a=r.gzhead.name.charCodeAt(r.gzindex++)&255:a=0,re(r,a)}while(a!==0);r.gzhead.hcrc&&r.pending>i&&(e.adler=Ce(e.adler,r.pending_buf,r.pending-i,i)),r.gzindex=0}r.status=Hc}if(r.status===Hc){if(r.gzhead.comment){let i=r.pending,a;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>i&&(e.adler=Ce(e.adler,r.pending_buf,r.pending-i,i)),st(e),r.pending!==0)return r.last_flush=-1,je;i=0}r.gzindex<r.gzhead.comment.length?a=r.gzhead.comment.charCodeAt(r.gzindex++)&255:a=0,re(r,a)}while(a!==0);r.gzhead.hcrc&&r.pending>i&&(e.adler=Ce(e.adler,r.pending_buf,r.pending-i,i))}r.status=Jc}if(r.status===Jc){if(r.gzhead.hcrc){if(r.pending+2>r.pending_buf_size&&(st(e),r.pending!==0))return r.last_flush=-1,je;re(r,e.adler&255),re(r,e.adler>>8&255),e.adler=0}if(r.status=Yr,st(e),r.pending!==0)return r.last_flush=-1,je}if(e.avail_in!==0||r.lookahead!==0||t!==_r&&r.status!==$i){let i=r.level===0?id(r,t):r.strategy===ro?My(r,t):r.strategy===by?Fy(r,t):ji[r.level].func(r,t);if((i===sn||i===Xn)&&(r.status=$i),i===He||i===sn)return e.avail_out===0&&(r.last_flush=-1),je;if(i===Zn&&(t===hy?dy(r):t!==Ff&&(zc(r,0,0,!1),t===my&&(mr(r.head),r.lookahead===0&&(r.strstart=0,r.block_start=0,r.insert=0))),st(e),e.avail_out===0))return r.last_flush=-1,je}return t!==yt?je:r.wrap<=0?Mf:(r.wrap===2?(re(r,e.adler&255),re(r,e.adler>>8&255),re(r,e.adler>>16&255),re(r,e.adler>>24&255),re(r,e.total_in&255),re(r,e.total_in>>8&255),re(r,e.total_in>>16&255),re(r,e.total_in>>24&255)):(Ti(r,e.adler>>>16),Ti(r,e.adler&65535)),st(e),r.wrap>0&&(r.wrap=-r.wrap),r.pending!==0?je:Mf)},Vy=e=>{if(ua(e))return Ut;let t=e.state.status;return e.state=null,t===Yr?Zr(e,gy):je},Qy=(e,t)=>{let r=t.length;if(ua(e))return Ut;let n=e.state,i=n.wrap;if(i===2||i===1&&n.status!==Gn||n.lookahead)return Ut;if(i===1&&(e.adler=ta(e.adler,t,r,0)),n.wrap=0,r>=n.w_size){i===0&&(mr(n.head),n.strstart=0,n.block_start=0,n.insert=0);let u=new Uint8Array(n.w_size);u.set(t.subarray(r-n.w_size,r),0),t=u,r=n.w_size}let a=e.avail_in,o=e.next_in,s=e.input;for(e.avail_in=r,e.next_in=0,e.input=t,Kn(n);n.lookahead>=H;){let u=n.strstart,c=n.lookahead-(H-1);do n.ins_h=wr(n,n.ins_h,n.window[u+H-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=H-1,Kn(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=H-1,n.match_available=0,e.next_in=o,e.input=s,e.avail_in=a,n.wrap=i,je},zy=qy,Gy=sd,Ky=od,Wy=ad,Hy=Uy,Jy=By,Yy=Vy,Zy=Qy,Xy="pako deflate (from Nodeca project)",zi={deflateInit:zy,deflateInit2:Gy,deflateReset:Ky,deflateResetKeep:Wy,deflateSetHeader:Hy,deflate:Jy,deflateEnd:Yy,deflateSetDictionary:Zy,deflateInfo:Xy},ev=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),tv=function(e){let t=Array.prototype.slice.call(arguments,1);for(;t.length;){let r=t.shift();if(!!r){if(typeof r!="object")throw new TypeError(r+"must be non-object");for(let n in r)ev(r,n)&&(e[n]=r[n])}}return e},rv=e=>{let t=0;for(let n=0,i=e.length;n<i;n++)t+=e[n].length;let r=new Uint8Array(t);for(let n=0,i=0,a=e.length;n<a;n++){let o=e[n];r.set(o,i),i+=o.length}return r},Ho={assign:tv,flattenChunks:rv},cd=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){cd=!1}var ra=new Uint8Array(256);for(let e=0;e<256;e++)ra[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;ra[254]=ra[254]=1;var nv=e=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(e);let t,r,n,i,a,o=e.length,s=0;for(i=0;i<o;i++)r=e.charCodeAt(i),(r&64512)===55296&&i+1<o&&(n=e.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(t=new Uint8Array(s),a=0,i=0;a<s;i++)r=e.charCodeAt(i),(r&64512)===55296&&i+1<o&&(n=e.charCodeAt(i+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),i++)),r<128?t[a++]=r:r<2048?(t[a++]=192|r>>>6,t[a++]=128|r&63):r<65536?(t[a++]=224|r>>>12,t[a++]=128|r>>>6&63,t[a++]=128|r&63):(t[a++]=240|r>>>18,t[a++]=128|r>>>12&63,t[a++]=128|r>>>6&63,t[a++]=128|r&63);return t},iv=(e,t)=>{if(t<65534&&e.subarray&&cd)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let r="";for(let n=0;n<t;n++)r+=String.fromCharCode(e[n]);return r},av=(e,t)=>{let r=t||e.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(e.subarray(0,t));let n,i,a=new Array(r*2);for(i=0,n=0;n<r;){let o=e[n++];if(o<128){a[i++]=o;continue}let s=ra[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|e[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 iv(a,i)},ov=(e,t)=>{t=t||e.length,t>e.length&&(t=e.length);let r=t-1;for(;r>=0&&(e[r]&192)===128;)r--;return r<0||r===0?t:r+ra[e[r]]>t?r:t},na={string2buf:nv,buf2string:av,utf8border:ov};function sv(){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 ud=sv,ld=Object.prototype.toString,{Z_NO_FLUSH:cv,Z_SYNC_FLUSH:uv,Z_FULL_FLUSH:lv,Z_FINISH:fv,Z_OK:Fo,Z_STREAM_END:pv,Z_DEFAULT_COMPRESSION:dv,Z_DEFAULT_STRATEGY:hv,Z_DEFLATED:mv}=hn;function la(e){this.options=Ho.assign({level:dv,method:mv,chunkSize:16384,windowBits:15,memLevel:8,strategy:hv},e||{});let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new ud,this.strm.avail_out=0;let r=zi.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(r!==Fo)throw new Error(on[r]);if(t.header&&zi.deflateSetHeader(this.strm,t.header),t.dictionary){let n;if(typeof t.dictionary=="string"?n=na.string2buf(t.dictionary):ld.call(t.dictionary)==="[object ArrayBuffer]"?n=new Uint8Array(t.dictionary):n=t.dictionary,r=zi.deflateSetDictionary(this.strm,n),r!==Fo)throw new Error(on[r]);this._dict_set=!0}}la.prototype.push=function(e,t){let r=this.strm,n=this.options.chunkSize,i,a;if(this.ended)return!1;for(t===~~t?a=t:a=t===!0?fv:cv,typeof e=="string"?r.input=na.string2buf(e):ld.call(e)==="[object ArrayBuffer]"?r.input=new Uint8Array(e):r.input=e,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===uv||a===lv)&&r.avail_out<=6){this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;continue}if(i=zi.deflate(r,a),i===pv)return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),i=zi.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===Fo;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};la.prototype.onData=function(e){this.chunks.push(e)};la.prototype.onEnd=function(e){e===Fo&&(this.result=Ho.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function lu(e,t){let r=new la(t);if(r.push(e,!0),r.err)throw r.msg||on[r.err];return r.result}function gv(e,t){return t=t||{},t.raw=!0,lu(e,t)}function yv(e,t){return t=t||{},t.gzip=!0,lu(e,t)}var vv=la,bv=lu,_v=gv,wv=yv,Sv=hn,Ev={Deflate:vv,deflate:bv,deflateRaw:_v,gzip:wv,constants:Sv},no=16209,xv=16191,Tv=function e(t,r){let n,i,a,o,s,u,c,l,d,p,f,h,g,y,S,b,v,m,O,N,T,D,C,R,j=t.state;n=t.next_in,C=t.input,i=n+(t.avail_in-5),a=t.next_out,R=t.output,o=a-(r-t.avail_out),s=a+(t.avail_out-257),u=j.dmax,c=j.wsize,l=j.whave,d=j.wnext,p=j.window,f=j.hold,h=j.bits,g=j.lencode,y=j.distcode,S=(1<<j.lenbits)-1,b=(1<<j.distbits)-1;e:do{h<15&&(f+=C[n++]<<h,h+=8,f+=C[n++]<<h,h+=8),v=g[f&S];t:for(;;){if(m=v>>>24,f>>>=m,h-=m,m=v>>>16&255,m===0)R[a++]=v&65535;else if(m&16){O=v&65535,m&=15,m&&(h<m&&(f+=C[n++]<<h,h+=8),O+=f&(1<<m)-1,f>>>=m,h-=m),h<15&&(f+=C[n++]<<h,h+=8,f+=C[n++]<<h,h+=8),v=y[f&b];r:for(;;){if(m=v>>>24,f>>>=m,h-=m,m=v>>>16&255,m&16){if(N=v&65535,m&=15,h<m&&(f+=C[n++]<<h,h+=8,h<m&&(f+=C[n++]<<h,h+=8)),N+=f&(1<<m)-1,N>u){t.msg="invalid distance too far back",j.mode=no;break e}if(f>>>=m,h-=m,m=a-o,N>m){if(m=N-m,m>l&&j.sane){t.msg="invalid distance too far back",j.mode=no;break e}if(T=0,D=p,d===0){if(T+=c-m,m<O){O-=m;do R[a++]=p[T++];while(--m);T=a-N,D=R}}else if(d<m){if(T+=c+d-m,m-=d,m<O){O-=m;do R[a++]=p[T++];while(--m);if(T=0,d<O){m=d,O-=m;do R[a++]=p[T++];while(--m);T=a-N,D=R}}}else if(T+=d-m,m<O){O-=m;do R[a++]=p[T++];while(--m);T=a-N,D=R}for(;O>2;)R[a++]=D[T++],R[a++]=D[T++],R[a++]=D[T++],O-=3;O&&(R[a++]=D[T++],O>1&&(R[a++]=D[T++]))}else{T=a-N;do R[a++]=R[T++],R[a++]=R[T++],R[a++]=R[T++],O-=3;while(O>2);O&&(R[a++]=R[T++],O>1&&(R[a++]=R[T++]))}}else if((m&64)===0){v=y[(v&65535)+(f&(1<<m)-1)];continue r}else{t.msg="invalid distance code",j.mode=no;break e}break}}else if((m&64)===0){v=g[(v&65535)+(f&(1<<m)-1)];continue t}else if(m&32){j.mode=xv;break e}else{t.msg="invalid literal/length code",j.mode=no;break e}break}}while(n<i&&a<s);O=h>>3,n-=O,h-=O<<3,f&=(1<<h)-1,t.next_in=n,t.next_out=a,t.avail_in=n<i?5+(i-n):5-(n-i),t.avail_out=a<s?257+(s-a):257-(a-s),j.hold=f,j.bits=h},jn=15,jf=852,Uf=592,qf=0,wc=1,Bf=2,Iv=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]),kv=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]),Ov=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]),Av=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]),Dv=(e,t,r,n,i,a,o,s)=>{let u=s.bits,c=0,l=0,d=0,p=0,f=0,h=0,g=0,y=0,S=0,b=0,v,m,O,N,T,D=null,C,R=new Uint16Array(jn+1),j=new Uint16Array(jn+1),Pe=null,Ie,U,ce;for(c=0;c<=jn;c++)R[c]=0;for(l=0;l<n;l++)R[t[r+l]]++;for(f=u,p=jn;p>=1&&R[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&&R[d]===0;d++);for(f<d&&(f=d),y=1,c=1;c<=jn;c++)if(y<<=1,y-=R[c],y<0)return-1;if(y>0&&(e===qf||p!==1))return-1;for(j[1]=0,c=1;c<jn;c++)j[c+1]=j[c]+R[c];for(l=0;l<n;l++)t[r+l]!==0&&(o[j[t[r+l]]++]=l);if(e===qf?(D=Pe=o,C=20):e===wc?(D=Iv,Pe=kv,C=257):(D=Ov,Pe=Av,C=0),b=0,l=0,c=d,T=a,h=f,g=0,O=-1,S=1<<f,N=S-1,e===wc&&S>jf||e===Bf&&S>Uf)return 1;for(;;){Ie=c-g,o[l]+1<C?(U=0,ce=o[l]):o[l]>=C?(U=Pe[o[l]-C],ce=D[o[l]-C]):(U=32+64,ce=0),v=1<<c-g,m=1<<h,d=m;do m-=v,i[T+(b>>g)+m]=Ie<<24|U<<16|ce|0;while(m!==0);for(v=1<<c-1;b&v;)v>>=1;if(v!==0?(b&=v-1,b+=v):b=0,l++,--R[c]===0){if(c===p)break;c=t[r+o[l]]}if(c>f&&(b&N)!==O){for(g===0&&(g=f),T+=d,h=c-g,y=1<<h;h+g<p&&(y-=R[h+g],!(y<=0));)h++,y<<=1;if(S+=1<<h,e===wc&&S>jf||e===Bf&&S>Uf)return 1;O=b&N,i[O]=f<<24|h<<16|T-a|0}}return b!==0&&(i[T+b]=c-g<<24|64<<16|0),s.bits=f,0},Gi=Dv,Nv=0,fd=1,pd=2,{Z_FINISH:Vf,Z_BLOCK:Rv,Z_TREES:io,Z_OK:cn,Z_STREAM_END:Cv,Z_NEED_DICT:Pv,Z_STREAM_ERROR:vt,Z_DATA_ERROR:dd,Z_MEM_ERROR:hd,Z_BUF_ERROR:Lv,Z_DEFLATED:Qf}=hn,Jo=16180,zf=16181,Gf=16182,Kf=16183,Wf=16184,Hf=16185,Jf=16186,Yf=16187,Zf=16188,Xf=16189,Mo=16190,Wt=16191,Sc=16192,ep=16193,Ec=16194,tp=16195,rp=16196,np=16197,ip=16198,ao=16199,oo=16200,ap=16201,op=16202,sp=16203,cp=16204,up=16205,xc=16206,lp=16207,fp=16208,he=16209,md=16210,gd=16211,Fv=852,Mv=592,$v=15,jv=$v,pp=e=>(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24);function Uv(){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 mn=e=>{if(!e)return 1;let t=e.state;return!t||t.strm!==e||t.mode<Jo||t.mode>gd?1:0},yd=e=>{if(mn(e))return vt;let t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=t.wrap&1),t.mode=Jo,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(Fv),t.distcode=t.distdyn=new Int32Array(Mv),t.sane=1,t.back=-1,cn},vd=e=>{if(mn(e))return vt;let t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,yd(e)},bd=(e,t)=>{let r;if(mn(e))return vt;let n=e.state;return t<0?(r=0,t=-t):(r=(t>>4)+5,t<48&&(t&=15)),t&&(t<8||t>15)?vt:(n.window!==null&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,vd(e))},_d=(e,t)=>{if(!e)return vt;let r=new Uv;e.state=r,r.strm=e,r.window=null,r.mode=Jo;let n=bd(e,t);return n!==cn&&(e.state=null),n},qv=e=>_d(e,jv),dp=!0,Tc,Ic,Bv=e=>{if(dp){Tc=new Int32Array(512),Ic=new Int32Array(32);let t=0;for(;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(Gi(fd,e.lens,0,288,Tc,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;Gi(pd,e.lens,0,32,Ic,0,e.work,{bits:5}),dp=!1}e.lencode=Tc,e.lenbits=9,e.distcode=Ic,e.distbits=5},wd=(e,t,r,n)=>{let i,a=e.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(t.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(t.subarray(r-n,r-n+i),a.wnext),n-=i,n?(a.window.set(t.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},Vv=(e,t)=>{let r,n,i,a,o,s,u,c,l,d,p,f,h,g,y=0,S,b,v,m,O,N,T,D,C=new Uint8Array(4),R,j,Pe=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(mn(e)||!e.output||!e.input&&e.avail_in!==0)return vt;r=e.state,r.mode===Wt&&(r.mode=Sc),o=e.next_out,i=e.output,u=e.avail_out,a=e.next_in,n=e.input,s=e.avail_in,c=r.hold,l=r.bits,d=s,p=u,D=cn;e:for(;;)switch(r.mode){case Jo:if(r.wrap===0){r.mode=Sc;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,C[0]=c&255,C[1]=c>>>8&255,r.check=Ce(r.check,C,2,0),c=0,l=0,r.mode=zf;break}if(r.head&&(r.head.done=!1),!(r.wrap&1)||(((c&255)<<8)+(c>>8))%31){e.msg="incorrect header check",r.mode=he;break}if((c&15)!==Qf){e.msg="unknown compression method",r.mode=he;break}if(c>>>=4,l-=4,T=(c&15)+8,r.wbits===0&&(r.wbits=T),T>15||T>r.wbits){e.msg="invalid window size",r.mode=he;break}r.dmax=1<<r.wbits,r.flags=0,e.adler=r.check=1,r.mode=c&512?Xf:Wt,c=0,l=0;break;case zf:for(;l<16;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(r.flags=c,(r.flags&255)!==Qf){e.msg="unknown compression method",r.mode=he;break}if(r.flags&57344){e.msg="unknown header flags set",r.mode=he;break}r.head&&(r.head.text=c>>8&1),r.flags&512&&r.wrap&4&&(C[0]=c&255,C[1]=c>>>8&255,r.check=Ce(r.check,C,2,0)),c=0,l=0,r.mode=Gf;case Gf: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&&(C[0]=c&255,C[1]=c>>>8&255,C[2]=c>>>16&255,C[3]=c>>>24&255,r.check=Ce(r.check,C,4,0)),c=0,l=0,r.mode=Kf;case Kf: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&&(C[0]=c&255,C[1]=c>>>8&255,r.check=Ce(r.check,C,2,0)),c=0,l=0,r.mode=Wf;case Wf: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&&(C[0]=c&255,C[1]=c>>>8&255,r.check=Ce(r.check,C,2,0)),c=0,l=0}else r.head&&(r.head.extra=null);r.mode=Hf;case Hf: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=Ce(r.check,n,f,a)),s-=f,a+=f,r.length-=f),r.length))break e;r.length=0,r.mode=Jf;case Jf: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=Ce(r.check,n,f,a)),s-=f,a+=f,T)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=Yf;case Yf: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=Ce(r.check,n,f,a)),s-=f,a+=f,T)break e}else r.head&&(r.head.comment=null);r.mode=Zf;case Zf: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)){e.msg="header crc mismatch",r.mode=he;break}c=0,l=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=Wt;break;case Xf:for(;l<32;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}e.adler=r.check=pp(c),c=0,l=0,r.mode=Mo;case Mo:if(r.havedict===0)return e.next_out=o,e.avail_out=u,e.next_in=a,e.avail_in=s,r.hold=c,r.bits=l,Pv;e.adler=r.check=1,r.mode=Wt;case Wt:if(t===Rv||t===io)break e;case Sc:if(r.last){c>>>=l&7,l-=l&7,r.mode=xc;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=ep;break;case 1:if(Bv(r),r.mode=ao,t===io){c>>>=2,l-=2;break e}break;case 2:r.mode=rp;break;case 3:e.msg="invalid block type",r.mode=he}c>>>=2,l-=2;break;case ep: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)){e.msg="invalid stored block lengths",r.mode=he;break}if(r.length=c&65535,c=0,l=0,r.mode=Ec,t===io)break e;case Ec:r.mode=tp;case tp: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=Wt;break;case rp: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){e.msg="too many length or distance symbols",r.mode=he;break}r.have=0,r.mode=np;case np:for(;r.have<r.ncode;){for(;l<3;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}r.lens[Pe[r.have++]]=c&7,c>>>=3,l-=3}for(;r.have<19;)r.lens[Pe[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,R={bits:r.lenbits},D=Gi(Nv,r.lens,0,19,r.lencode,0,r.work,R),r.lenbits=R.bits,D){e.msg="invalid code lengths set",r.mode=he;break}r.have=0,r.mode=ip;case ip:for(;r.have<r.nlen+r.ndist;){for(;y=r.lencode[c&(1<<r.lenbits)-1],S=y>>>24,b=y>>>16&255,v=y&65535,!(S<=l);){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(v<16)c>>>=S,l-=S,r.lens[r.have++]=v;else{if(v===16){for(j=S+2;l<j;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(c>>>=S,l-=S,r.have===0){e.msg="invalid bit length repeat",r.mode=he;break}T=r.lens[r.have-1],f=3+(c&3),c>>>=2,l-=2}else if(v===17){for(j=S+3;l<j;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}c>>>=S,l-=S,T=0,f=3+(c&7),c>>>=3,l-=3}else{for(j=S+7;l<j;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}c>>>=S,l-=S,T=0,f=11+(c&127),c>>>=7,l-=7}if(r.have+f>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=he;break}for(;f--;)r.lens[r.have++]=T}}if(r.mode===he)break;if(r.lens[256]===0){e.msg="invalid code -- missing end-of-block",r.mode=he;break}if(r.lenbits=9,R={bits:r.lenbits},D=Gi(fd,r.lens,0,r.nlen,r.lencode,0,r.work,R),r.lenbits=R.bits,D){e.msg="invalid literal/lengths set",r.mode=he;break}if(r.distbits=6,r.distcode=r.distdyn,R={bits:r.distbits},D=Gi(pd,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,R),r.distbits=R.bits,D){e.msg="invalid distances set",r.mode=he;break}if(r.mode=ao,t===io)break e;case ao:r.mode=oo;case oo:if(s>=6&&u>=258){e.next_out=o,e.avail_out=u,e.next_in=a,e.avail_in=s,r.hold=c,r.bits=l,Tv(e,p),o=e.next_out,i=e.output,u=e.avail_out,a=e.next_in,n=e.input,s=e.avail_in,c=r.hold,l=r.bits,r.mode===Wt&&(r.back=-1);break}for(r.back=0;y=r.lencode[c&(1<<r.lenbits)-1],S=y>>>24,b=y>>>16&255,v=y&65535,!(S<=l);){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(b&&(b&240)===0){for(m=S,O=b,N=v;y=r.lencode[N+((c&(1<<m+O)-1)>>m)],S=y>>>24,b=y>>>16&255,v=y&65535,!(m+S<=l);){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}c>>>=m,l-=m,r.back+=m}if(c>>>=S,l-=S,r.back+=S,r.length=v,b===0){r.mode=up;break}if(b&32){r.back=-1,r.mode=Wt;break}if(b&64){e.msg="invalid literal/length code",r.mode=he;break}r.extra=b&15,r.mode=ap;case ap:if(r.extra){for(j=r.extra;l<j;){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=op;case op:for(;y=r.distcode[c&(1<<r.distbits)-1],S=y>>>24,b=y>>>16&255,v=y&65535,!(S<=l);){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if((b&240)===0){for(m=S,O=b,N=v;y=r.distcode[N+((c&(1<<m+O)-1)>>m)],S=y>>>24,b=y>>>16&255,v=y&65535,!(m+S<=l);){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}c>>>=m,l-=m,r.back+=m}if(c>>>=S,l-=S,r.back+=S,b&64){e.msg="invalid distance code",r.mode=he;break}r.offset=v,r.extra=b&15,r.mode=sp;case sp:if(r.extra){for(j=r.extra;l<j;){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){e.msg="invalid distance too far back",r.mode=he;break}r.mode=cp;case cp:if(u===0)break e;if(f=p-u,r.offset>f){if(f=r.offset-f,f>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=he;break}f>r.wnext?(f-=r.wnext,h=r.wsize-f):h=r.wnext-f,f>r.length&&(f=r.length),g=r.window}else g=i,h=o-r.offset,f=r.length;f>u&&(f=u),u-=f,r.length-=f;do i[o++]=g[h++];while(--f);r.length===0&&(r.mode=oo);break;case up:if(u===0)break e;i[o++]=r.length,u--,r.mode=oo;break;case xc:if(r.wrap){for(;l<32;){if(s===0)break e;s--,c|=n[a++]<<l,l+=8}if(p-=u,e.total_out+=p,r.total+=p,r.wrap&4&&p&&(e.adler=r.check=r.flags?Ce(r.check,i,p,o-p):ta(r.check,i,p,o-p)),p=u,r.wrap&4&&(r.flags?c:pp(c))!==r.check){e.msg="incorrect data check",r.mode=he;break}c=0,l=0}r.mode=lp;case lp: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)){e.msg="incorrect length check",r.mode=he;break}c=0,l=0}r.mode=fp;case fp:D=Cv;break e;case he:D=dd;break e;case md:return hd;case gd:default:return vt}return e.next_out=o,e.avail_out=u,e.next_in=a,e.avail_in=s,r.hold=c,r.bits=l,(r.wsize||p!==e.avail_out&&r.mode<he&&(r.mode<xc||t!==Vf))&&wd(e,e.output,e.next_out,p-e.avail_out),d-=e.avail_in,p-=e.avail_out,e.total_in+=d,e.total_out+=p,r.total+=p,r.wrap&4&&p&&(e.adler=r.check=r.flags?Ce(r.check,i,p,e.next_out-p):ta(r.check,i,p,e.next_out-p)),e.data_type=r.bits+(r.last?64:0)+(r.mode===Wt?128:0)+(r.mode===ao||r.mode===Ec?256:0),(d===0&&p===0||t===Vf)&&D===cn&&(D=Lv),D},Qv=e=>{if(mn(e))return vt;let t=e.state;return t.window&&(t.window=null),e.state=null,cn},zv=(e,t)=>{if(mn(e))return vt;let r=e.state;return(r.wrap&2)===0?vt:(r.head=t,t.done=!1,cn)},Gv=(e,t)=>{let r=t.length,n,i,a;return mn(e)||(n=e.state,n.wrap!==0&&n.mode!==Mo)?vt:n.mode===Mo&&(i=1,i=ta(i,t,r,0),i!==n.check)?dd:(a=wd(e,t,r,r),a?(n.mode=md,hd):(n.havedict=1,cn))},Kv=vd,Wv=bd,Hv=yd,Jv=qv,Yv=_d,Zv=Vv,Xv=Qv,eb=zv,tb=Gv,rb="pako inflate (from Nodeca project)",Zt={inflateReset:Kv,inflateReset2:Wv,inflateResetKeep:Hv,inflateInit:Jv,inflateInit2:Yv,inflate:Zv,inflateEnd:Xv,inflateGetHeader:eb,inflateSetDictionary:tb,inflateInfo:rb};function nb(){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 ib=nb,Sd=Object.prototype.toString,{Z_NO_FLUSH:ab,Z_FINISH:ob,Z_OK:ia,Z_STREAM_END:kc,Z_NEED_DICT:Oc,Z_STREAM_ERROR:sb,Z_DATA_ERROR:hp,Z_MEM_ERROR:cb}=hn;function fa(e){this.options=Ho.assign({chunkSize:1024*64,windowBits:15,to:""},e||{});let t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),t.windowBits>=0&&t.windowBits<16&&!(e&&e.windowBits)&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(t.windowBits&15)===0&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new ud,this.strm.avail_out=0;let r=Zt.inflateInit2(this.strm,t.windowBits);if(r!==ia)throw new Error(on[r]);if(this.header=new ib,Zt.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=na.string2buf(t.dictionary):Sd.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(r=Zt.inflateSetDictionary(this.strm,t.dictionary),r!==ia)))throw new Error(on[r])}fa.prototype.push=function(e,t){let r=this.strm,n=this.options.chunkSize,i=this.options.dictionary,a,o,s;if(this.ended)return!1;for(t===~~t?o=t:o=t===!0?ob:ab,Sd.call(e)==="[object ArrayBuffer]"?r.input=new Uint8Array(e):r.input=e,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=Zt.inflate(r,o),a===Oc&&i&&(a=Zt.inflateSetDictionary(r,i),a===ia?a=Zt.inflate(r,o):a===hp&&(a=Oc));r.avail_in>0&&a===kc&&r.state.wrap>0&&e[r.next_in]!==0;)Zt.inflateReset(r),a=Zt.inflate(r,o);switch(a){case sb:case hp:case Oc:case cb:return this.onEnd(a),this.ended=!0,!1}if(s=r.avail_out,r.next_out&&(r.avail_out===0||a===kc))if(this.options.to==="string"){let u=na.utf8border(r.output,r.next_out),c=r.next_out-u,l=na.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===ia&&s===0)){if(a===kc)return a=Zt.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,!0;if(r.avail_in===0)break}}return!0};fa.prototype.onData=function(e){this.chunks.push(e)};fa.prototype.onEnd=function(e){e===ia&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Ho.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function fu(e,t){let r=new fa(t);if(r.push(e),r.err)throw r.msg||on[r.err];return r.result}function ub(e,t){return t=t||{},t.raw=!0,fu(e,t)}var lb=fa,fb=fu,pb=ub,db=fu,hb=hn,mb={Inflate:lb,inflate:fb,inflateRaw:pb,ungzip:db,constants:hb},{Deflate:gb,deflate:yb,deflateRaw:vb,gzip:bb}=Ev,{Inflate:_b,inflate:wb,inflateRaw:Sb,ungzip:Eb}=mb,xb=gb,Tb=yb,Ib=vb,kb=bb,Ob=_b,Ab=wb,Db=Sb,Nb=Eb,Rb=hn,Cb={Deflate:xb,deflate:Tb,deflateRaw:Ib,gzip:kb,Inflate:Ob,inflate:Ab,inflateRaw:Db,ungzip:Nb,constants:Rb},fe=function(e,t,r,n){var i=arguments.length,a=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},pe=function(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)},$o=class{constructor(t,r){this.input=t,this.output=r}};fe([w(),pe("design:type",String)],$o.prototype,"input",void 0);fe([w(),pe("design:type",String)],$o.prototype,"output",void 0);$o=fe([Ue(),pe("design:paramtypes",[String,String])],$o);var jo=class{constructor(t,r){this.input=t,this.output=r}};fe([w(),pe("design:type",String)],jo.prototype,"input",void 0);fe([w(),pe("design:type",String)],jo.prototype,"output",void 0);jo=fe([W(),pe("design:paramtypes",[String,String])],jo);var kr=class{constructor(t,r,n,i,a){this.name=t,this.modelId=r,this.systemPrompt=n,this.promptExamples=i,this.metaData=a}};fe([w(),pe("design:type",String)],kr.prototype,"name",void 0);fe([w(),pe("design:type",String)],kr.prototype,"modelId",void 0);fe([w(),pe("design:type",String)],kr.prototype,"systemPrompt",void 0);fe([w(),pe("design:type",Array)],kr.prototype,"promptExamples",void 0);fe([w(),pe("design:type",String)],kr.prototype,"metaData",void 0);kr=fe([Ue(),pe("design:paramtypes",[String,String,String,Array,String])],kr);var Bt=class{constructor(t,r,n,i,a,o,s,u){this.name=t,this.modelId=r,this.taskId=n,this.systemPrompt=i,this.promptExamples=a,this.metaData=o,this.createdAt=s,this.updatedAt=u}};fe([w(),pe("design:type",String)],Bt.prototype,"name",void 0);fe([w(),pe("design:type",String)],Bt.prototype,"modelId",void 0);fe([w(),pe("design:type",String)],Bt.prototype,"taskId",void 0);fe([w(),pe("design:type",String)],Bt.prototype,"systemPrompt",void 0);fe([w(),pe("design:type",Array)],Bt.prototype,"promptExamples",void 0);fe([w(),pe("design:type",String)],Bt.prototype,"metaData",void 0);fe([w(),pe("design:type",String)],Bt.prototype,"createdAt",void 0);fe([w(),pe("design:type",String)],Bt.prototype,"updatedAt",void 0);Bt=fe([W(),pe("design:paramtypes",[String,String,String,String,Array,String,String,String])],Bt);var un=class{constructor(t,r,n,i,a){this.model=t,this.status=r,this.progress=n,this.downloaded=i,this.loaded=a}};fe([w(),pe("design:type",String)],un.prototype,"model",void 0);fe([w(),pe("design:type",String)],un.prototype,"status",void 0);fe([w(),pe("design:type",Number)],un.prototype,"progress",void 0);fe([w(),pe("design:type",Boolean)],un.prototype,"downloaded",void 0);fe([w(),pe("design:type",Boolean)],un.prototype,"loaded",void 0);un=fe([W(),pe("design:paramtypes",[String,String,Number,Boolean,Boolean])],un);var Pb=function(e,t,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 t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(e,r):i?i.value=r:t.set(e,r),r},Ne=function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},Ae,bo,Zc=class{constructor(t,r=!0){Ae.set(this,void 0),bo.set(this,new Map),Pb(this,Ae,t,"f")}async getModels(){let t=await Ne(this,Ae,"f").query({query:E`
|
|
649
649
|
query {
|
|
650
650
|
aiGetModels {
|
|
651
651
|
id
|
|
@@ -658,8 +658,13 @@ triggerMatch
|
|
|
658
658
|
}
|
|
659
659
|
local {
|
|
660
660
|
fileName
|
|
661
|
-
tokenizerSource
|
|
662
|
-
|
|
661
|
+
tokenizerSource {
|
|
662
|
+
repo
|
|
663
|
+
revision
|
|
664
|
+
fileName
|
|
665
|
+
}
|
|
666
|
+
huggingfaceRepo
|
|
667
|
+
revision
|
|
663
668
|
}
|
|
664
669
|
modelType
|
|
665
670
|
}
|
|
@@ -693,8 +698,13 @@ triggerMatch
|
|
|
693
698
|
}
|
|
694
699
|
local {
|
|
695
700
|
fileName
|
|
696
|
-
tokenizerSource
|
|
697
|
-
|
|
701
|
+
tokenizerSource {
|
|
702
|
+
repo
|
|
703
|
+
revision
|
|
704
|
+
fileName
|
|
705
|
+
}
|
|
706
|
+
huggingfaceRepo
|
|
707
|
+
revision
|
|
698
708
|
}
|
|
699
709
|
modelType
|
|
700
710
|
}
|
|
@@ -781,13 +791,13 @@ triggerMatch
|
|
|
781
791
|
mutation aiEmbed($modelId: String!, $text: String!) {
|
|
782
792
|
aiEmbed(modelId: $modelId, text: $text)
|
|
783
793
|
}
|
|
784
|
-
`,variables:{modelId:t,text:r}})),i=Ko.toByteArray(n);return JSON.parse(
|
|
785
|
-
mutation AiOpenTranscriptionStream($modelId: String
|
|
786
|
-
aiOpenTranscriptionStream(modelId: $modelId)
|
|
794
|
+
`,variables:{modelId:t,text:r}})),i=Ko.toByteArray(n);return JSON.parse(Cb.inflate(i,{to:"string"}))}async openTranscriptionStream(t,r,n){let{aiOpenTranscriptionStream:i}=k(await Ne(this,Ae,"f").mutate({mutation:E`
|
|
795
|
+
mutation AiOpenTranscriptionStream($modelId: String!, $params: VoiceActivityParamsInput) {
|
|
796
|
+
aiOpenTranscriptionStream(modelId: $modelId, params: $params)
|
|
787
797
|
}
|
|
788
|
-
`,variables:{modelId:t}})),
|
|
789
|
-
aiTranscriptionText(streamId: "${
|
|
790
|
-
}`}).subscribe({next(
|
|
798
|
+
`,variables:{modelId:t,params:n}})),a=Ne(this,Ae,"f").subscribe({query:E` subscription {
|
|
799
|
+
aiTranscriptionText(streamId: "${i}")
|
|
800
|
+
}`}).subscribe({next(o){return r(o.data.aiTranscriptionText),o.data.aiTranscriptionText},error(o){console.error(o)}});return Ne(this,bo,"f").set(i,a),i}async closeTranscriptionStream(t){let{aiCloseTranscriptionStream:r}=k(await Ne(this,Ae,"f").mutate({mutation:E`
|
|
791
801
|
mutation aiCloseTranscriptionStream($streamId: String!) {
|
|
792
802
|
aiCloseTranscriptionStream(streamId: $streamId)
|
|
793
803
|
}
|
|
@@ -795,14 +805,14 @@ triggerMatch
|
|
|
795
805
|
mutation AiFeedTranscriptionStream($streamId: String!, $audio: [Float!]!) {
|
|
796
806
|
aiFeedTranscriptionStream(streamId: $streamId, audio: $audio)
|
|
797
807
|
}
|
|
798
|
-
`,variables:{streamId:t,audio:r}}));return n}};Ae=new WeakMap,bo=new WeakMap;var hr=function(e,t,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 t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(e,r):i?i.value=r:t.set(e,r),r},Oe=function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},Ft,_o,Ui,wo,qi,Wr,So,Bi,Uo=class{constructor(t,r=!0){Ft.set(this,void 0),_o.set(this,void 0),Ui.set(this,void 0),wo.set(this,void 0),qi.set(this,void 0),Wr.set(this,void 0),So.set(this,void 0),Bi.set(this,void 0),hr(this,Ft,t,"f"),hr(this,_o,new Ji(Oe(this,Ft,"f"),r),"f"),hr(this,Ui,new Bc(Oe(this,Ft,"f")),"f"),hr(this,wo,new jc(Oe(this,Ft,"f")),"f"),hr(this,qi,new Uc(Oe(this,Ft,"f")),"f"),hr(this,Bi,new Zc(Oe(this,Ft,"f"),r),"f"),hr(this,Wr,new Po(Oe(this,Ft,"f"),r),"f"),Oe(this,Wr,"f").setExpressionClient(Oe(this,Ui,"f")),Oe(this,Wr,"f").setNeighbourhoodClient(Oe(this,qi,"f")),Oe(this,Wr,"f").setAIClient(Oe(this,Bi,"f")),hr(this,So,new qc(Oe(this,Ft,"f"),r),"f")}get agent(){return Oe(this,_o,"f")}get expression(){return Oe(this,Ui,"f")}get languages(){return Oe(this,wo,"f")}get neighbourhood(){return Oe(this,qi,"f")}get perspective(){return Oe(this,Wr,"f")}get runtime(){return Oe(this,So,"f")}get ai(){return Oe(this,Bi,"f")}};Ft=new WeakMap,_o=new WeakMap,Ui=new WeakMap,wo=new WeakMap,qi=new WeakMap,Wr=new WeakMap,So=new WeakMap,Bi=new WeakMap;var mp;(function(e){e.LanguageIsNotLoaded="LANGUAGE_IS_NOT_LOADED",e.ExpressionIsNotVerified="EXPRESSION_IS_NOT_VERIFIED",e.AgentIsUntrusted="AGENT_IS_UNTRUSTED",e.CapabilityRequested="CAPABILITY_REQUESTED",e.InstallNotificationRequest="INSTALL_NOTIFICATION_REQUEST"})(mp||(mp={}));var pu=function(e,t,r,n){var i=arguments.length,a=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},du=function(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)},Xr=class{constructor(t,r){this.language=t,this.expression=r}};pu([w(),du("design:type",jt)],Xr.prototype,"language",void 0);pu([w(),du("design:type",String)],Xr.prototype,"expression",void 0);Xr=pu([W(),du("design:paramtypes",[jt,String])],Xr);function ek(e){return e.language.address==="did"?e.expression.toString():`${e.language.address}://${e.expression}`}function tk(e){if(e.startsWith("literal://")){let a=new jt;a.address="literal",a.name="literal";let o=e.substring(10);return new Xr(a,o)}let r=/^([^:^\s]+):\/\/([\s\S]+)$/.exec(e);if(r&&r.length==3){let a=r[1],o=r[2],s=new jt;return s.address=a,new Xr(s,o)}let i=/^did:([^\s]+)$/.exec(e);if(i&&i.length==2){let a=new jt;return a.address="did",new Xr(a,e)}throw new Error("Couldn't parse string as expression URL or DID: "+e)}var ft=function(e,t,r,n){var i=arguments.length,a=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},Vt=function(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)},qo=class{};ft([w(),Vt("design:type",String)],qo.prototype,"name",void 0);ft([w(),Vt("design:type",String)],qo.prototype,"type",void 0);qo=ft([W()],qo);var aa=class{};ft([w(),Vt("design:type",String)],aa.prototype,"label",void 0);ft([w(),Vt("design:type",String)],aa.prototype,"name",void 0);ft([w(),Vt("design:type",Array)],aa.prototype,"parameters",void 0);aa=ft([W()],aa);var Bo=class{get parameters(){return JSON.parse(this.parametersStringified)}constructor(t,r){this.name=t,this.parametersStringified=JSON.stringify(r)}};ft([w(),Vt("design:type",String)],Bo.prototype,"name",void 0);ft([w(),Vt("design:type",String)],Bo.prototype,"parametersStringified",void 0);Bo=ft([Ue(),Vt("design:paramtypes",[String,Object])],Bo);var Vo=class{};ft([w(),Vt("design:type",String)],Vo.prototype,"did",void 0);ft([w(),Vt("design:type",Mc)],Vo.prototype,"status",void 0);Vo=ft([W()],Vo);var gp=class{},gn=function(e,t,r,n){var i=arguments.length,a=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},ei=function(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)},Or=class{};gn([w(),ei("design:type",String)],Or.prototype,"name",void 0);gn([w(),ei("design:type",String)],Or.prototype,"address",void 0);gn([w(),ei("design:type",String)],Or.prototype,"settings",void 0);gn([w(),ei("design:type",tn)],Or.prototype,"icon",void 0);gn([w(),ei("design:type",tn)],Or.prototype,"constructorIcon",void 0);gn([w(),ei("design:type",tn)],Or.prototype,"settingsIcon",void 0);Or=gn([W()],Or);var Je=function(e,t,r,n){var i=arguments.length,a=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},nt=function(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)},Ot=class{};Je([w(),nt("design:type",String)],Ot.prototype,"name",void 0);Je([w(),nt("design:type",String)],Ot.prototype,"address",void 0);Je([w(),nt("design:type",String)],Ot.prototype,"description",void 0);Je([w(),nt("design:type",String)],Ot.prototype,"author",void 0);Je([w(),nt("design:type",Boolean)],Ot.prototype,"templated",void 0);Je([w(),nt("design:type",String)],Ot.prototype,"templateSourceLanguageAddress",void 0);Je([w(),nt("design:type",String)],Ot.prototype,"templateAppliedParams",void 0);Je([w(),nt("design:type",Array)],Ot.prototype,"possibleTemplateParams",void 0);Je([w(),nt("design:type",String)],Ot.prototype,"sourceCodeLink",void 0);Ot=Je([W()],Ot);var Wn=class{constructor(t,r){this.name=t,this.description=r,this.description||(this.description="")}};Je([w(),nt("design:type",String)],Wn.prototype,"name",void 0);Je([w(),nt("design:type",String)],Wn.prototype,"description",void 0);Je([w(),nt("design:type",Array)],Wn.prototype,"possibleTemplateParams",void 0);Je([w(),nt("design:type",String)],Wn.prototype,"sourceCodeLink",void 0);Wn=Je([Ue(),nt("design:paramtypes",[String,String])],Wn);var yp=class{},vp=class extends Ar(){},bp=class{},Yo=function(e,t,r,n){var i=arguments.length,a=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},hu=function(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)},Qo=class{constructor(t,r){this.linkLanguage=t,this.meta=r}};Yo([w(),hu("design:type",String)],Qo.prototype,"linkLanguage",void 0);Yo([w(),hu("design:type",Er)],Qo.prototype,"meta",void 0);Qo=Yo([W(),hu("design:paramtypes",[String,Er])],Qo);var Xc=class extends Ar(){};Xc=Yo([W()],Xc);var ti=function(e,t,r,n){var i=arguments.length,a=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},ri=function(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)},eu;(function(e){e.Private="PRIVATE",e.NeighboudhoodCreationInitiated="NEIGHBOURHOOD_CREATION_INITIATED",e.NeighbourhoodJoinInitiated="NEIGHBOURHOOD_JOIN_INITIATED",e.LinkLanguageFailedToInstall="LINK_LANGUAGE_FAILED_TO_INSTALL",e.LinkLanguageInstalledButNotSynced="LINK_LANGUAGE_INSTALLED_BUT_NOT_SYNCED",e.Synced="SYNCED"})(eu||(eu={}));var ln=class{constructor(t,r,n){this.uuid=t,this.name=r,n?this.state=n:this.state=eu.Private}};ti([w(),ri("design:type",String)],ln.prototype,"uuid",void 0);ti([w(),ri("design:type",String)],ln.prototype,"name",void 0);ti([w(),ri("design:type",String)],ln.prototype,"state",void 0);ti([w(),ri("design:type",String)],ln.prototype,"sharedUrl",void 0);ti([w(),ri("design:type",Xc)],ln.prototype,"neighbourhood",void 0);ln=ti([W(),ri("design:paramtypes",[String,String,String])],ln);var Zo=function(e,t,r,n){var i=arguments.length,a=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},Ed=function(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)},zo=class{};Zo([w(),Ed("design:type",Array)],zo.prototype,"additions",void 0);Zo([w(),Ed("design:type",Array)],zo.prototype,"removals",void 0);zo=Zo([W()],zo);var _p=class extends Ar(){};_p=Zo([W()],_p);var wp=function(e,t,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 t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(e,r):i?i.value=r:t.set(e,r),r},Un=function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},Vi,Hr,so="smart_literal://content";function Lb(e){let t="",r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=r.length;for(let i=0;i<e;i++)t+=r.charAt(Math.floor(Math.random()*n));return t}var oa=class{constructor(t,r){Vi.set(this,void 0),Hr.set(this,void 0),wp(this,Vi,t,"f"),wp(this,Hr,r,"f")}get base(){return Un(this,Hr,"f")}static async create(t,r){let n=kt.from(Lb(10)).toUrl(),i=new oa(t,n);return await i.set(r),i}static async isSmartLiteralBase(t,r){return(await t.get(new lt({source:r,predicate:so}))).length>0}static async getAllSmartLiterals(t){return(await t.get(new lt({predicate:so}))).map(n=>new oa(t,n.data.source))}async get(){let t=await Un(this,Vi,"f").getSingleTarget(new lt({source:Un(this,Hr,"f"),predicate:so}));if(!t)throw`No content for smart literal ${Un(this,Hr,"f")}`;return kt.fromUrl(t).get()}async set(t){let r=kt.from(t);await Un(this,Vi,"f").setSingleTarget(new nn({source:Un(this,Hr,"f"),predicate:so,target:r.toUrl()}))}};Vi=new WeakMap,Hr=new WeakMap;var Sp=class{};function hk(e,t,r){return{action:"addLink",source:e,predicate:t,target:r}}function mk(e){return`triple(this, "${e}", _)`}function gk(e){return function(t,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=t.name,u=`subject_class("${s}", C), instance(C, Instance)`;if(e&&e.where)for(let l in e.where){let d=e.where[l];u+=`, property_getter(C, Instance, "${l}", "${d}")`}e&&e.condition&&(u+=", "+e.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 Ro(a,d,s);await p.init(),o.push(p)}return o}}}function yk(e){return function(t,r){if(e.required&&!e.initial)throw new Error("SubjectProperty requires an 'initial' option if 'required' is true");if(!e.through&&!e.getter)throw new Error("SubjectProperty requires either 'through' or 'getter' option");if(t.__properties=t.__properties||{},t.__properties[r]=t.__properties[r]||{},t.__properties[r]={...t.__properties[r],...e},e.writable){let n=r;t[`set${vr(n)}`]=()=>{}}Object.defineProperty(t,r,{configurable:!0,writable:!0})}}function vk(e){return function(t,r){if(!e.through&&!e.value)throw new Error("SubjectFlag requires a 'through' and 'value' option");if(!e.through)throw new Error("SubjectFlag requires a 'through' option");if(!e.value)throw new Error("SubjectFlag requires a 'value' option");t.__properties=t.__properties||{},t.__properties[r]=t.__properties[r]||{},t.__properties[r]={...t.__properties[r],through:e.through,required:!0,initial:e.value,flag:!0},t[r]=e.value,Object.defineProperty(t,r,{configurable:!0,writable:!0})}}function bk(e){return function(t,r){t.__collections=t.__collections||{},t.__collections[r]=e;let n=r;t[`add${vr(n)}`]=()=>{},t[`remove${vr(n)}`]=()=>{},t[`setCollection${vr(n)}`]=()=>{},Object.defineProperty(t,r,{configurable:!0,writable:!0})}}function xd(e){let t="",r="abcdefghijklmnopqrstuvwxyz",n=r.length;for(let i=0;i<e;i++)t+=r.charAt(Math.floor(Math.random()*n));return t}function _k(e){return function(t){t.prototype.className=e.name,t.className=e.name,t.generateSDNA=function(){let r="",n=e.name,i=t.prototype,a=xd(8);r+=`subject_class("${n}", ${a}).
|
|
808
|
+
`,variables:{streamId:t,audio:r}}));return n}};Ae=new WeakMap,bo=new WeakMap;var hr=function(e,t,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 t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(e,r):i?i.value=r:t.set(e,r),r},Oe=function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},Ft,_o,Ui,wo,qi,Wr,So,Bi,Uo=class{constructor(t,r=!0){Ft.set(this,void 0),_o.set(this,void 0),Ui.set(this,void 0),wo.set(this,void 0),qi.set(this,void 0),Wr.set(this,void 0),So.set(this,void 0),Bi.set(this,void 0),hr(this,Ft,t,"f"),hr(this,_o,new Ji(Oe(this,Ft,"f"),r),"f"),hr(this,Ui,new Bc(Oe(this,Ft,"f")),"f"),hr(this,wo,new jc(Oe(this,Ft,"f")),"f"),hr(this,qi,new Uc(Oe(this,Ft,"f")),"f"),hr(this,Bi,new Zc(Oe(this,Ft,"f"),r),"f"),hr(this,Wr,new Po(Oe(this,Ft,"f"),r),"f"),Oe(this,Wr,"f").setExpressionClient(Oe(this,Ui,"f")),Oe(this,Wr,"f").setNeighbourhoodClient(Oe(this,qi,"f")),Oe(this,Wr,"f").setAIClient(Oe(this,Bi,"f")),hr(this,So,new qc(Oe(this,Ft,"f"),r),"f")}get agent(){return Oe(this,_o,"f")}get expression(){return Oe(this,Ui,"f")}get languages(){return Oe(this,wo,"f")}get neighbourhood(){return Oe(this,qi,"f")}get perspective(){return Oe(this,Wr,"f")}get runtime(){return Oe(this,So,"f")}get ai(){return Oe(this,Bi,"f")}};Ft=new WeakMap,_o=new WeakMap,Ui=new WeakMap,wo=new WeakMap,qi=new WeakMap,Wr=new WeakMap,So=new WeakMap,Bi=new WeakMap;var mp;(function(e){e.LanguageIsNotLoaded="LANGUAGE_IS_NOT_LOADED",e.ExpressionIsNotVerified="EXPRESSION_IS_NOT_VERIFIED",e.AgentIsUntrusted="AGENT_IS_UNTRUSTED",e.CapabilityRequested="CAPABILITY_REQUESTED",e.InstallNotificationRequest="INSTALL_NOTIFICATION_REQUEST"})(mp||(mp={}));var pu=function(e,t,r,n){var i=arguments.length,a=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},du=function(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)},Xr=class{constructor(t,r){this.language=t,this.expression=r}};pu([w(),du("design:type",jt)],Xr.prototype,"language",void 0);pu([w(),du("design:type",String)],Xr.prototype,"expression",void 0);Xr=pu([W(),du("design:paramtypes",[jt,String])],Xr);function ek(e){return e.language.address==="did"?e.expression.toString():`${e.language.address}://${e.expression}`}function tk(e){if(e.startsWith("literal://")){let a=new jt;a.address="literal",a.name="literal";let o=e.substring(10);return new Xr(a,o)}let r=/^([^:^\s]+):\/\/([\s\S]+)$/.exec(e);if(r&&r.length==3){let a=r[1],o=r[2],s=new jt;return s.address=a,new Xr(s,o)}let i=/^did:([^\s]+)$/.exec(e);if(i&&i.length==2){let a=new jt;return a.address="did",new Xr(a,e)}throw new Error("Couldn't parse string as expression URL or DID: "+e)}var ft=function(e,t,r,n){var i=arguments.length,a=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},Vt=function(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)},qo=class{};ft([w(),Vt("design:type",String)],qo.prototype,"name",void 0);ft([w(),Vt("design:type",String)],qo.prototype,"type",void 0);qo=ft([W()],qo);var aa=class{};ft([w(),Vt("design:type",String)],aa.prototype,"label",void 0);ft([w(),Vt("design:type",String)],aa.prototype,"name",void 0);ft([w(),Vt("design:type",Array)],aa.prototype,"parameters",void 0);aa=ft([W()],aa);var Bo=class{get parameters(){return JSON.parse(this.parametersStringified)}constructor(t,r){this.name=t,this.parametersStringified=JSON.stringify(r)}};ft([w(),Vt("design:type",String)],Bo.prototype,"name",void 0);ft([w(),Vt("design:type",String)],Bo.prototype,"parametersStringified",void 0);Bo=ft([Ue(),Vt("design:paramtypes",[String,Object])],Bo);var Vo=class{};ft([w(),Vt("design:type",String)],Vo.prototype,"did",void 0);ft([w(),Vt("design:type",Mc)],Vo.prototype,"status",void 0);Vo=ft([W()],Vo);var gp=class{},gn=function(e,t,r,n){var i=arguments.length,a=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},ei=function(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)},Or=class{};gn([w(),ei("design:type",String)],Or.prototype,"name",void 0);gn([w(),ei("design:type",String)],Or.prototype,"address",void 0);gn([w(),ei("design:type",String)],Or.prototype,"settings",void 0);gn([w(),ei("design:type",tn)],Or.prototype,"icon",void 0);gn([w(),ei("design:type",tn)],Or.prototype,"constructorIcon",void 0);gn([w(),ei("design:type",tn)],Or.prototype,"settingsIcon",void 0);Or=gn([W()],Or);var Je=function(e,t,r,n){var i=arguments.length,a=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},nt=function(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)},Ot=class{};Je([w(),nt("design:type",String)],Ot.prototype,"name",void 0);Je([w(),nt("design:type",String)],Ot.prototype,"address",void 0);Je([w(),nt("design:type",String)],Ot.prototype,"description",void 0);Je([w(),nt("design:type",String)],Ot.prototype,"author",void 0);Je([w(),nt("design:type",Boolean)],Ot.prototype,"templated",void 0);Je([w(),nt("design:type",String)],Ot.prototype,"templateSourceLanguageAddress",void 0);Je([w(),nt("design:type",String)],Ot.prototype,"templateAppliedParams",void 0);Je([w(),nt("design:type",Array)],Ot.prototype,"possibleTemplateParams",void 0);Je([w(),nt("design:type",String)],Ot.prototype,"sourceCodeLink",void 0);Ot=Je([W()],Ot);var Wn=class{constructor(t,r){this.name=t,this.description=r,this.description||(this.description="")}};Je([w(),nt("design:type",String)],Wn.prototype,"name",void 0);Je([w(),nt("design:type",String)],Wn.prototype,"description",void 0);Je([w(),nt("design:type",Array)],Wn.prototype,"possibleTemplateParams",void 0);Je([w(),nt("design:type",String)],Wn.prototype,"sourceCodeLink",void 0);Wn=Je([Ue(),nt("design:paramtypes",[String,String])],Wn);var yp=class{},vp=class extends Ar(){},bp=class{},Yo=function(e,t,r,n){var i=arguments.length,a=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},hu=function(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)},Qo=class{constructor(t,r){this.linkLanguage=t,this.meta=r}};Yo([w(),hu("design:type",String)],Qo.prototype,"linkLanguage",void 0);Yo([w(),hu("design:type",Er)],Qo.prototype,"meta",void 0);Qo=Yo([W(),hu("design:paramtypes",[String,Er])],Qo);var Xc=class extends Ar(){};Xc=Yo([W()],Xc);var ti=function(e,t,r,n){var i=arguments.length,a=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},ri=function(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)},eu;(function(e){e.Private="PRIVATE",e.NeighboudhoodCreationInitiated="NEIGHBOURHOOD_CREATION_INITIATED",e.NeighbourhoodJoinInitiated="NEIGHBOURHOOD_JOIN_INITIATED",e.LinkLanguageFailedToInstall="LINK_LANGUAGE_FAILED_TO_INSTALL",e.LinkLanguageInstalledButNotSynced="LINK_LANGUAGE_INSTALLED_BUT_NOT_SYNCED",e.Synced="SYNCED"})(eu||(eu={}));var ln=class{constructor(t,r,n){this.uuid=t,this.name=r,n?this.state=n:this.state=eu.Private}};ti([w(),ri("design:type",String)],ln.prototype,"uuid",void 0);ti([w(),ri("design:type",String)],ln.prototype,"name",void 0);ti([w(),ri("design:type",String)],ln.prototype,"state",void 0);ti([w(),ri("design:type",String)],ln.prototype,"sharedUrl",void 0);ti([w(),ri("design:type",Xc)],ln.prototype,"neighbourhood",void 0);ln=ti([W(),ri("design:paramtypes",[String,String,String])],ln);var Zo=function(e,t,r,n){var i=arguments.length,a=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},Ed=function(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)},zo=class{};Zo([w(),Ed("design:type",Array)],zo.prototype,"additions",void 0);Zo([w(),Ed("design:type",Array)],zo.prototype,"removals",void 0);zo=Zo([W()],zo);var _p=class extends Ar(){};_p=Zo([W()],_p);var wp=function(e,t,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 t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(e,r):i?i.value=r:t.set(e,r),r},Un=function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},Vi,Hr,so="smart_literal://content";function Lb(e){let t="",r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=r.length;for(let i=0;i<e;i++)t+=r.charAt(Math.floor(Math.random()*n));return t}var oa=class{constructor(t,r){Vi.set(this,void 0),Hr.set(this,void 0),wp(this,Vi,t,"f"),wp(this,Hr,r,"f")}get base(){return Un(this,Hr,"f")}static async create(t,r){let n=kt.from(Lb(10)).toUrl(),i=new oa(t,n);return await i.set(r),i}static async isSmartLiteralBase(t,r){return(await t.get(new lt({source:r,predicate:so}))).length>0}static async getAllSmartLiterals(t){return(await t.get(new lt({predicate:so}))).map(n=>new oa(t,n.data.source))}async get(){let t=await Un(this,Vi,"f").getSingleTarget(new lt({source:Un(this,Hr,"f"),predicate:so}));if(!t)throw`No content for smart literal ${Un(this,Hr,"f")}`;return kt.fromUrl(t).get()}async set(t){let r=kt.from(t);await Un(this,Vi,"f").setSingleTarget(new nn({source:Un(this,Hr,"f"),predicate:so,target:r.toUrl()}))}};Vi=new WeakMap,Hr=new WeakMap;var Sp=class{};function hk(e,t,r){return{action:"addLink",source:e,predicate:t,target:r}}function mk(e){return`triple(this, "${e}", _)`}function gk(e){return function(t,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=t.name,u=`subject_class("${s}", C), instance(C, Instance)`;if(e&&e.where)for(let l in e.where){let d=e.where[l];u+=`, property_getter(C, Instance, "${l}", "${d}")`}e&&e.condition&&(u+=", "+e.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 Co(a,d,s);await p.init(),o.push(p)}return o}}}function yk(e){return function(t,r){if(e.required&&!e.initial)throw new Error("SubjectProperty requires an 'initial' option if 'required' is true");if(!e.through&&!e.getter)throw new Error("SubjectProperty requires either 'through' or 'getter' option");if(t.__properties=t.__properties||{},t.__properties[r]=t.__properties[r]||{},t.__properties[r]={...t.__properties[r],...e},e.writable){let n=r;t[`set${vr(n)}`]=()=>{}}Object.defineProperty(t,r,{configurable:!0,writable:!0})}}function vk(e){return function(t,r){if(!e.through&&!e.value)throw new Error("SubjectFlag requires a 'through' and 'value' option");if(!e.through)throw new Error("SubjectFlag requires a 'through' option");if(!e.value)throw new Error("SubjectFlag requires a 'value' option");t.__properties=t.__properties||{},t.__properties[r]=t.__properties[r]||{},t.__properties[r]={...t.__properties[r],through:e.through,required:!0,initial:e.value,flag:!0},t[r]=e.value,Object.defineProperty(t,r,{configurable:!0,writable:!0})}}function bk(e){return function(t,r){t.__collections=t.__collections||{},t.__collections[r]=e;let n=r;t[`add${vr(n)}`]=()=>{},t[`remove${vr(n)}`]=()=>{},t[`setCollection${vr(n)}`]=()=>{},Object.defineProperty(t,r,{configurable:!0,writable:!0})}}function xd(e){let t="",r="abcdefghijklmnopqrstuvwxyz",n=r.length;for(let i=0;i<e;i++)t+=r.charAt(Math.floor(Math.random()*n));return t}function _k(e){return function(t){t.prototype.className=e.name,t.className=e.name,t.generateSDNA=function(){let r="",n=e.name,i=t.prototype,a=xd(8);r+=`subject_class("${n}", ${a}).
|
|
799
809
|
`;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 g=`property(${a}, "${h}").
|
|
800
810
|
`,{through:y,initial:S,required:b,resolveLanguage:v,writable:m,flag:O,getter:N,setter:T,local:D}=l[h];if(v&&(g+=`property_resolve(${a}, "${h}").
|
|
801
811
|
`,g+=`property_resolve_language(${a}, "${h}", "${v}").
|
|
802
812
|
`),N?g+=`property_getter(${a}, Base, "${h}", Value) :- ${N}.
|
|
803
813
|
`:y&&(g+=`property_getter(${a}, Base, "${h}", Value) :- triple(Base, "${y}", Value).
|
|
804
814
|
`,b&&(O?u.push(`triple(Base, "${y}", "${S}")`):u.push(`triple(Base, "${y}", _)`))),T)g+=`property_setter(${a}, "${h}", Actions) :- ${T}.
|
|
805
|
-
`;else if(m&&typeof i[$p(h)]=="function"){let
|
|
815
|
+
`;else if(m&&typeof i[$p(h)]=="function"){let R=[{action:"setSingleTarget",source:"this",predicate:y,target:"value",...D&&{local:!0}}];g+=`property_setter(${a}, "${h}", '${Vr(R)}').
|
|
806
816
|
`}c.push(g),S&&(s.push({action:"addLink",source:"this",predicate:y,target:S}),o.push({action:"removeLink",source:"this",predicate:y,target:S}))}let d=[],p=i.__collections||{};for(let h in p){let g=`collection(${a}, "${h}").
|
|
807
817
|
`,{through:y,where:S,local:b}=p[h];if(y){if(S){if(!S.isInstance&&!S.condition)throw"'where' needs one of 'isInstance' or 'condition'";let N=[];if(S.isInstance){let D;S.isInstance.name?D=S.isInstance.name:D=S.isInstance,N.push(`instance(OtherClass, Target), subject_class("${D}", OtherClass)`)}S.condition&&N.push(S.condition);let T=N.join(", ");g+=`collection_getter(${a}, Base, "${h}", List) :- setof(Target, (triple(Base, "${y}", Target), ${T}), List).
|
|
808
818
|
`}else g+=`collection_getter(${a}, Base, "${h}", List) :- findall(C, triple(Base, "${y}", C), List).
|
|
@@ -1065,14 +1075,16 @@ input LinkQuery {
|
|
|
1065
1075
|
|
|
1066
1076
|
type LocalModel {
|
|
1067
1077
|
fileName: String!
|
|
1068
|
-
|
|
1069
|
-
|
|
1078
|
+
huggingfaceRepo: String
|
|
1079
|
+
revision: String
|
|
1080
|
+
tokenizerSource: TokenizerSource
|
|
1070
1081
|
}
|
|
1071
1082
|
|
|
1072
1083
|
input LocalModelInput {
|
|
1073
1084
|
fileName: String!
|
|
1074
|
-
|
|
1075
|
-
|
|
1085
|
+
huggingfaceRepo: String
|
|
1086
|
+
revision: String
|
|
1087
|
+
tokenizerSource: TokenizerSourceInput
|
|
1076
1088
|
}
|
|
1077
1089
|
|
|
1078
1090
|
type Model {
|
|
@@ -1126,7 +1138,7 @@ type Mutation {
|
|
|
1126
1138
|
aiCloseTranscriptionStream(streamId: String!): String!
|
|
1127
1139
|
aiEmbed(modelId: String!, text: String!): String!
|
|
1128
1140
|
aiFeedTranscriptionStream(audio: [Float!]!, streamId: String!): String!
|
|
1129
|
-
aiOpenTranscriptionStream(modelId: String
|
|
1141
|
+
aiOpenTranscriptionStream(modelId: String!, params: VoiceActivityParamsInput): String!
|
|
1130
1142
|
aiPrompt(prompt: String!, taskId: String!): String!
|
|
1131
1143
|
aiRemoveModel(modelId: String!): Boolean!
|
|
1132
1144
|
aiRemoveTask(taskId: String!): AITask!
|
|
@@ -1324,11 +1336,31 @@ type Subscription {
|
|
|
1324
1336
|
runtimeNotificationTriggered: TriggeredNotification
|
|
1325
1337
|
}
|
|
1326
1338
|
|
|
1339
|
+
type TokenizerSource {
|
|
1340
|
+
fileName: String!
|
|
1341
|
+
repo: String!
|
|
1342
|
+
revision: String!
|
|
1343
|
+
}
|
|
1344
|
+
|
|
1345
|
+
input TokenizerSourceInput {
|
|
1346
|
+
fileName: String!
|
|
1347
|
+
repo: String!
|
|
1348
|
+
revision: String!
|
|
1349
|
+
}
|
|
1350
|
+
|
|
1327
1351
|
type TriggeredNotification {
|
|
1328
1352
|
notification: Notification!
|
|
1329
1353
|
perspectiveId: String!
|
|
1330
1354
|
triggerMatch: String!
|
|
1331
1355
|
}
|
|
1332
|
-
`;function Ep(e){return e?.length?e.length===1?e.toString():e.length===2?e.join(" and "):e.slice(0,-1).join(", ")+", and "+e.slice(-1):""}function Sk(e){let t=e.can.includes("*")?["READ","WRITE","UPDATE"]:e.can,r=e.with.domain==="*"?"":e.with.domain,n=e.with.pointers.includes("*")?["all AD4M data"]:e.with.pointers;return`${Ep(t)} your ${r} actions, with access to ${Ep(n)}`}var Br=function(e,t,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 t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(e,r):i?i.value=r:t.set(e,r),r},V=function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},We,It,Eo,me,xp=class{constructor(e,t,r){We.set(this,void 0),It.set(this,void 0),Eo.set(this,void 0),me.set(this,void 0),Br(this,We,t||kt.from(xd(24)).toUrl(),"f"),Br(this,me,e,"f"),Br(this,Eo,r||"ad4m://self","f")}get baseExpression(){return V(this,We,"f")}get perspective(){return V(this,me,"f")}async getData(e){let t=e??V(this,We,"f"),r=await V(this,me,"f").getSubjectData(V(this,It,"f"),t);return Object.assign(this,r),Br(this,We,t,"f"),this}async setProperty(key,value){let setters=await V(this,me,"f").infer(`subject_class("${V(this,It,"f")}", C), property_setter(C, "${key}", Setter)`);if(setters&&setters.length>0){let actions=eval(setters[0].Setter),resolveLanguageResults=await V(this,me,"f").infer(`subject_class("${V(this,It,"f")}", C), property_resolve_language(C, "${key}", Language)`),resolveLanguage;resolveLanguageResults&&resolveLanguageResults.length>0&&(resolveLanguage=resolveLanguageResults[0].Language),resolveLanguage&&(value=await V(this,me,"f").createExpression(value,resolveLanguage)),await V(this,me,"f").executeAction(actions,V(this,We,"f"),[{name:"value",value}])}}async setCollectionSetter(key,value){let collectionSetters=await V(this,me,"f").infer(`subject_class("${V(this,It,"f")}", C), collection_setter(C, "${Xt(key)}", Setter)`);if(collectionSetters||(collectionSetters=[]),collectionSetters.length>0){let actions=eval(collectionSetters[0].Setter);value&&(Array.isArray(value)?await V(this,me,"f").executeAction(actions,V(this,We,"f"),value.map(e=>({name:"value",value:e}))):await V(this,me,"f").executeAction(actions,V(this,We,"f"),[{name:"value",value}]))}}async setCollectionAdder(key,value){let adders=await V(this,me,"f").infer(`subject_class("${V(this,It,"f")}", C), collection_adder(C, "${Xt(key)}", Adder)`);if(adders||(adders=[]),adders.length>0){let actions=eval(adders[0].Adder);value&&(Array.isArray(value)?await Promise.all(value.map(e=>V(this,me,"f").executeAction(actions,V(this,We,"f"),[{name:"value",value:e}]))):await V(this,me,"f").executeAction(actions,V(this,We,"f"),[{name:"value",value}]))}}async setCollectionRemover(key,value){let removers=await V(this,me,"f").infer(`subject_class("${V(this,It,"f")}", C), collection_remover(C, "${Xt(key)}", Remover)`);if(removers||(removers=[]),removers.length>0){let actions=eval(removers[0].Remover);value&&(Array.isArray(value)?await Promise.all(value.map(e=>V(this,me,"f").executeAction(actions,V(this,We,"f"),[{name:"value",value:e}]))):await V(this,me,"f").executeAction(actions,V(this,We,"f"),[{name:"value",value}]))}}async save(){Br(this,It,await V(this,me,"f").stringOrTemplateObjectToSubjectClass(this),"f"),await V(this,me,"f").createSubject(this,V(this,We,"f")),await V(this,me,"f").add(new nn({source:V(this,Eo,"f"),predicate:"ad4m://has_child",target:this.baseExpression})),await this.update()}async update(){Br(this,It,await V(this,me,"f").stringOrTemplateObjectToSubjectClass(this),"f");let e=Object.entries(this);for(let[t,r]of e)if(r!=null)if(r?.action)switch(r.action){case"setter":await this.setCollectionSetter(t,r.value);break;case"adder":await this.setCollectionAdder(t,r.value);break;case"remover":await this.setCollectionRemover(t,r.value);default:await this.setCollectionSetter(t,r.value);break}else Array.isArray(r)&&r.length>0?await this.setCollectionSetter(t,r):r!=null&&r!==""&&await this.setProperty(t,r);await this.getData()}async get(){return Br(this,It,await V(this,me,"f").stringOrTemplateObjectToSubjectClass(this),"f"),await this.getData()}async delete(){await V(this,me,"f").removeSubject(this,V(this,We,"f"))}static async all(e){let t=await e.stringOrTemplateObjectToSubjectClass(this),r=await e.getAllSubjectProxies(t),n=[];if(r){for(let i of r){let a=new this(e,i.X);n.push(await a.get())}return n}return[]}static async query(e,t){let r=t?.source||"ad4m://self",n=await e.stringOrTemplateObjectToSubjectClass(this),i=[],a=`subject_class("${n}", C), instance(C, Base), link("${r}", Predicate, Base, Timestamp, Author)`;if(t){if(t.where)if(t.where.condition)a+=", "+t.where.condition;else{let s=Object.entries(t.where);for(let u of s){let c=u[0],l=u[1];a+=`, property_getter(C, Base, "${c}", "${l}")`}}try{if((await e.infer(`findall([Timestamp, Base], (${a}), AllData), sort(AllData, SortedData), length(SortedData, DataLength).`))[0].DataLength>=t.size){let u=`findall([Timestamp, Base], (${a}), AllData), sort(AllData, SortedData), reverse(SortedData, ReverseSortedData), paginate(ReverseSortedData, ${t.page}, ${t.size}, PageData).`;i=await e.infer(u),i=i[0].PageData.map(c=>({Base:c[1],Timestamp:c[0]}))}else i=await e.infer(a)}catch(s){console.log("Query failed",s)}}else i=await e.infer(a);return i?await Promise.all(i.map(async s=>await new this(e,s.Base).get())):[]}};We=new WeakMap,It=new WeakMap,Eo=new WeakMap,me=new WeakMap;var Td="0.10.1-rc7";function Mb(){let e=new AbortController;return setTimeout(()=>e.abort(),20),e}function mu(e,t=1e4){return Ve(this,null,function*(){return Promise.race([new Promise((r,n)=>{try{e.includes("localhost")||r(new WebSocket(e));let i=new WebSocket(e);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"))},t)})])})}function gu(e){return Ve(this,null,function*(){try{let t=yield fetch(`http://localhost:${e}/graphql/`,{signal:Mb().signal,mode:"cors"});if(t.status===400||t.status===0||t.status===200)return e;throw new Error(`Could not connect to port ${e}`)}catch(t){throw new Error(`Could not connect to port ${e}`)}})}function $b(){try{localStorage.setItem("test",""),localStorage.removeItem("test")}catch(e){return!1}return!0}function Id(e,t){$b()&&localStorage.setItem(`${Td}/${e}`,t)}var jb=e=>{let t=new Set;do for(let r of Reflect.ownKeys(e))t.add([e,r]);while((e=Reflect.getPrototypeOf(e))&&e!==Object.prototype);return t};function yu(e,{include:t,exclude:r}={}){let n=i=>{let a=o=>typeof o=="string"?i===o:o.test(i);return t?t.some(a):r?!r.some(a):!0};for(let[i,a]of jb(e.constructor.prototype)){if(a==="constructor"||!n(a))continue;let o=Reflect.getOwnPropertyDescriptor(i,a);o&&typeof o.value=="function"&&(e[a]=e[a].bind(e))}return e}var vu=class{constructor({appName:t,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=12e3;this.capabilities=[];this.isHosting=!1;this.listeners={authstatechange:[],configstatechange:[],connectionstatechange:[]};yu(this);this.appName=t,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(t,r){this.listeners.configstatechange.forEach(n=>{n(t,r)})}notifyConnectionChange(t){this.connectionState!==t&&(this.connectionState=t,this.listeners.connectionstatechange.forEach(r=>{r(t)}))}notifyAuthChange(t){this.authState!==t&&(this.authState=t,this.listeners.authstatechange.forEach(r=>{r(t)}))}setPort(t){this.port!==t&&(this.port=t,this.setUrl(`ws://localhost:${this.port}/graphql`),this.notifyConfigChange("port",t))}setUrl(t){this.url!==t&&(this.url=t,this.notifyConfigChange("url",t))}setToken(t){this.token!==t&&(this.token=t,this.notifyConfigChange("token",t))}on(t,r){this.listeners[t].push(r)}connect(t){return Ve(this,null,function*(){try{if(t){yield mu(t,1e4),this.setUrl(t);let r=this.buildClient();return yield this.checkAuth(),r}else{let r=yield this.ensureConnection();return yield this.checkAuth(),r}}catch(r){this.notifyConnectionChange("not_connected"),this.notifyAuthChange("unauthenticated")}})}loginToHosting(t,r){return Ve(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:t,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,Id("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(t){return Ve(this,null,function*(){try{return(yield fetch(`https://hosting.ad4m.dev/api/auth/check-email?email=${t}`,{method:"GET",headers:{"Content-Type":"application/json"}})).status===200}catch(r){console.log(r)}})}connectToPort(t){return Ve(this,null,function*(){try{if(t){let r=yield gu(t);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 Ve(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 mu(this.url,1e4),this.buildClient()}catch(i){return this.notifyConnectionChange("not_connected"),this.connectToPort()}})}findPort(){return Ve(this,null,function*(){let t=[...Array(10).keys()].map((i,a)=>gu(12e3+a)),n=(yield Promise.allSettled(t)).find(i=>i.status==="fulfilled");if(n)return n.value;throw Error("Couldn't find an open port")})}buildClient(){this.notifyConnectionChange("connecting");try{let t=new WebSocket(this.url)}catch(t){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=hf({url:this.url,connectionParams:()=>Ve(this,null,function*(){return{headers:{authorization:this.token}}}),on:{opened:t=>{this.activeSocket=t},error:t=>{this.notifyConnectionChange("not_connected"),this.notifyAuthChange("unauthenticated")},connected:()=>{this.notifyConnectionChange("connected"),this.checkAuth()},closed:()=>Ve(this,null,function*(){if(!this.requestedRestart)if(!this.token)this.notifyConnectionChange(this.token?"disconnected":"not_connected"),this.notifyAuthChange("unauthenticated"),this.requestedRestart=!1;else{let t=yield this.connect();t?this.ad4mClient=t:(this.notifyConnectionChange(this.token?"disconnected":"not_connected"),this.notifyAuthChange("unauthenticated"),this.requestedRestart=!1)}})}}),this.apolloClient=new sc({link:new mf(this.wsClient),cache:new Qa({resultCaching:!1,addTypename:!1}),defaultOptions:{watchQuery:{fetchPolicy:"no-cache"},query:{fetchPolicy:"no-cache"},mutate:{fetchPolicy:"no-cache"}}}),this.ad4mClient=new Uo(this.apolloClient),this.ad4mClient}checkAuth(){return Ve(this,null,function*(){try{return(yield this.ad4mClient.agent.isLocked())?this.notifyAuthChange("locked"):(yield this.ad4mClient.agent.status(),this.notifyAuthChange("authenticated")),!0}catch(t){return t.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(t=!1){return Ve(this,null,function*(){var r;if(t&&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(t){return Ve(this,null,function*(){var r;try{let n=yield(r=this.ad4mClient)==null?void 0:r.agent.generateJwt(this.requestId,t);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(12e3),this.notifyConnectionChange("not_connected"),this.notifyAuthChange("unauthenticated")}};export{vu as default};
|
|
1356
|
+
|
|
1357
|
+
input VoiceActivityParamsInput {
|
|
1358
|
+
endThreshold: Float
|
|
1359
|
+
endWindow: Float
|
|
1360
|
+
startThreshold: Float
|
|
1361
|
+
startWindow: Float
|
|
1362
|
+
timeBeforeSpeech: Float
|
|
1363
|
+
}
|
|
1364
|
+
`;function Ep(e){return e?.length?e.length===1?e.toString():e.length===2?e.join(" and "):e.slice(0,-1).join(", ")+", and "+e.slice(-1):""}function Sk(e){let t=e.can.includes("*")?["READ","WRITE","UPDATE"]:e.can,r=e.with.domain==="*"?"":e.with.domain,n=e.with.pointers.includes("*")?["all AD4M data"]:e.with.pointers;return`${Ep(t)} your ${r} actions, with access to ${Ep(n)}`}var Br=function(e,t,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 t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(e,r):i?i.value=r:t.set(e,r),r},V=function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},We,It,Eo,me,xp=class{constructor(e,t,r){We.set(this,void 0),It.set(this,void 0),Eo.set(this,void 0),me.set(this,void 0),Br(this,We,t||kt.from(xd(24)).toUrl(),"f"),Br(this,me,e,"f"),Br(this,Eo,r||"ad4m://self","f")}get baseExpression(){return V(this,We,"f")}get perspective(){return V(this,me,"f")}async getData(e){let t=e??V(this,We,"f"),r=await V(this,me,"f").getSubjectData(V(this,It,"f"),t);return Object.assign(this,r),Br(this,We,t,"f"),this}async setProperty(key,value){let setters=await V(this,me,"f").infer(`subject_class("${V(this,It,"f")}", C), property_setter(C, "${key}", Setter)`);if(setters&&setters.length>0){let actions=eval(setters[0].Setter),resolveLanguageResults=await V(this,me,"f").infer(`subject_class("${V(this,It,"f")}", C), property_resolve_language(C, "${key}", Language)`),resolveLanguage;resolveLanguageResults&&resolveLanguageResults.length>0&&(resolveLanguage=resolveLanguageResults[0].Language),resolveLanguage&&(value=await V(this,me,"f").createExpression(value,resolveLanguage)),await V(this,me,"f").executeAction(actions,V(this,We,"f"),[{name:"value",value}])}}async setCollectionSetter(key,value){let collectionSetters=await V(this,me,"f").infer(`subject_class("${V(this,It,"f")}", C), collection_setter(C, "${Xt(key)}", Setter)`);if(collectionSetters||(collectionSetters=[]),collectionSetters.length>0){let actions=eval(collectionSetters[0].Setter);value&&(Array.isArray(value)?await V(this,me,"f").executeAction(actions,V(this,We,"f"),value.map(e=>({name:"value",value:e}))):await V(this,me,"f").executeAction(actions,V(this,We,"f"),[{name:"value",value}]))}}async setCollectionAdder(key,value){let adders=await V(this,me,"f").infer(`subject_class("${V(this,It,"f")}", C), collection_adder(C, "${Xt(key)}", Adder)`);if(adders||(adders=[]),adders.length>0){let actions=eval(adders[0].Adder);value&&(Array.isArray(value)?await Promise.all(value.map(e=>V(this,me,"f").executeAction(actions,V(this,We,"f"),[{name:"value",value:e}]))):await V(this,me,"f").executeAction(actions,V(this,We,"f"),[{name:"value",value}]))}}async setCollectionRemover(key,value){let removers=await V(this,me,"f").infer(`subject_class("${V(this,It,"f")}", C), collection_remover(C, "${Xt(key)}", Remover)`);if(removers||(removers=[]),removers.length>0){let actions=eval(removers[0].Remover);value&&(Array.isArray(value)?await Promise.all(value.map(e=>V(this,me,"f").executeAction(actions,V(this,We,"f"),[{name:"value",value:e}]))):await V(this,me,"f").executeAction(actions,V(this,We,"f"),[{name:"value",value}]))}}async save(){Br(this,It,await V(this,me,"f").stringOrTemplateObjectToSubjectClass(this),"f"),await V(this,me,"f").createSubject(this,V(this,We,"f")),await V(this,me,"f").add(new nn({source:V(this,Eo,"f"),predicate:"ad4m://has_child",target:this.baseExpression})),await this.update()}async update(){Br(this,It,await V(this,me,"f").stringOrTemplateObjectToSubjectClass(this),"f");let e=Object.entries(this);for(let[t,r]of e)if(r!=null)if(r?.action)switch(r.action){case"setter":await this.setCollectionSetter(t,r.value);break;case"adder":await this.setCollectionAdder(t,r.value);break;case"remover":await this.setCollectionRemover(t,r.value);default:await this.setCollectionSetter(t,r.value);break}else Array.isArray(r)&&r.length>0?await this.setCollectionSetter(t,r):r!=null&&r!==""&&await this.setProperty(t,r);await this.getData()}async get(){return Br(this,It,await V(this,me,"f").stringOrTemplateObjectToSubjectClass(this),"f"),await this.getData()}async delete(){await V(this,me,"f").removeSubject(this,V(this,We,"f"))}static async all(e){let t=await e.stringOrTemplateObjectToSubjectClass(this),r=await e.getAllSubjectProxies(t),n=[];if(r){for(let i of r){let a=new this(e,i.X);n.push(await a.get())}return n}return[]}static async query(e,t){let r=t?.source||"ad4m://self",n=await e.stringOrTemplateObjectToSubjectClass(this),i=[],a=`subject_class("${n}", C), instance(C, Base), link("${r}", Predicate, Base, Timestamp, Author)`;if(t){if(t.where)if(t.where.condition)a+=", "+t.where.condition;else{let s=Object.entries(t.where);for(let u of s){let c=u[0],l=u[1];a+=`, property_getter(C, Base, "${c}", "${l}")`}}try{if((await e.infer(`findall([Timestamp, Base], (${a}), AllData), sort(AllData, SortedData), length(SortedData, DataLength).`))[0].DataLength>=t.size){let u=`findall([Timestamp, Base], (${a}), AllData), sort(AllData, SortedData), reverse(SortedData, ReverseSortedData), paginate(ReverseSortedData, ${t.page}, ${t.size}, PageData).`;i=await e.infer(u),i=i[0].PageData.map(c=>({Base:c[1],Timestamp:c[0]}))}else i=await e.infer(a)}catch(s){console.log("Query failed",s)}}else i=await e.infer(a);return i?await Promise.all(i.map(async s=>await new this(e,s.Base).get())):[]}};We=new WeakMap,It=new WeakMap,Eo=new WeakMap,me=new WeakMap;var Td="0.10.1-rc9-dev";function Mb(){let e=new AbortController;return setTimeout(()=>e.abort(),20),e}function mu(e,t=1e4){return Ve(this,null,function*(){return Promise.race([new Promise((r,n)=>{try{e.includes("localhost")||r(new WebSocket(e));let i=new WebSocket(e);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"))},t)})])})}function gu(e){return Ve(this,null,function*(){try{let t=yield fetch(`http://localhost:${e}/graphql/`,{signal:Mb().signal,mode:"cors"});if(t.status===400||t.status===0||t.status===200)return e;throw new Error(`Could not connect to port ${e}`)}catch(t){throw new Error(`Could not connect to port ${e}`)}})}function $b(){try{localStorage.setItem("test",""),localStorage.removeItem("test")}catch(e){return!1}return!0}function Id(e,t){$b()&&localStorage.setItem(`${Td}/${e}`,t)}var jb=e=>{let t=new Set;do for(let r of Reflect.ownKeys(e))t.add([e,r]);while((e=Reflect.getPrototypeOf(e))&&e!==Object.prototype);return t};function yu(e,{include:t,exclude:r}={}){let n=i=>{let a=o=>typeof o=="string"?i===o:o.test(i);return t?t.some(a):r?!r.some(a):!0};for(let[i,a]of jb(e.constructor.prototype)){if(a==="constructor"||!n(a))continue;let o=Reflect.getOwnPropertyDescriptor(i,a);o&&typeof o.value=="function"&&(e[a]=e[a].bind(e))}return e}var vu=class{constructor({appName:t,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=12e3;this.capabilities=[];this.isHosting=!1;this.listeners={authstatechange:[],configstatechange:[],connectionstatechange:[]};yu(this);this.appName=t,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(t,r){this.listeners.configstatechange.forEach(n=>{n(t,r)})}notifyConnectionChange(t){this.connectionState!==t&&(this.connectionState=t,this.listeners.connectionstatechange.forEach(r=>{r(t)}))}notifyAuthChange(t){this.authState!==t&&(this.authState=t,this.listeners.authstatechange.forEach(r=>{r(t)}))}setPort(t){this.port!==t&&(this.port=t,this.setUrl(`ws://localhost:${this.port}/graphql`),this.notifyConfigChange("port",t))}setUrl(t){this.url!==t&&(this.url=t,this.notifyConfigChange("url",t))}setToken(t){this.token!==t&&(this.token=t,this.notifyConfigChange("token",t))}on(t,r){this.listeners[t].push(r)}connect(t){return Ve(this,null,function*(){try{if(t){yield mu(t,1e4),this.setUrl(t);let r=this.buildClient();return yield this.checkAuth(),r}else{let r=yield this.ensureConnection();return yield this.checkAuth(),r}}catch(r){this.notifyConnectionChange("not_connected"),this.notifyAuthChange("unauthenticated")}})}loginToHosting(t,r){return Ve(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:t,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,Id("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(t){return Ve(this,null,function*(){try{return(yield fetch(`https://hosting.ad4m.dev/api/auth/check-email?email=${t}`,{method:"GET",headers:{"Content-Type":"application/json"}})).status===200}catch(r){console.log(r)}})}connectToPort(t){return Ve(this,null,function*(){try{if(t){let r=yield gu(t);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 Ve(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 mu(this.url,1e4),this.buildClient()}catch(i){return this.notifyConnectionChange("not_connected"),this.connectToPort()}})}findPort(){return Ve(this,null,function*(){let t=[...Array(10).keys()].map((i,a)=>gu(12e3+a)),n=(yield Promise.allSettled(t)).find(i=>i.status==="fulfilled");if(n)return n.value;throw Error("Couldn't find an open port")})}buildClient(){this.notifyConnectionChange("connecting");try{let t=new WebSocket(this.url)}catch(t){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=hf({url:this.url,connectionParams:()=>Ve(this,null,function*(){return{headers:{authorization:this.token}}}),on:{opened:t=>{this.activeSocket=t},error:t=>{this.notifyConnectionChange("not_connected"),this.notifyAuthChange("unauthenticated")},connected:()=>{this.notifyConnectionChange("connected"),this.checkAuth()},closed:()=>Ve(this,null,function*(){if(!this.requestedRestart)if(!this.token)this.notifyConnectionChange(this.token?"disconnected":"not_connected"),this.notifyAuthChange("unauthenticated"),this.requestedRestart=!1;else{let t=yield this.connect();t?this.ad4mClient=t:(this.notifyConnectionChange(this.token?"disconnected":"not_connected"),this.notifyAuthChange("unauthenticated"),this.requestedRestart=!1)}})}}),this.apolloClient=new sc({link:new mf(this.wsClient),cache:new Qa({resultCaching:!1,addTypename:!1}),defaultOptions:{watchQuery:{fetchPolicy:"no-cache"},query:{fetchPolicy:"no-cache"},mutate:{fetchPolicy:"no-cache"}}}),this.ad4mClient=new Uo(this.apolloClient),this.ad4mClient}checkAuth(){return Ve(this,null,function*(){try{return(yield this.ad4mClient.agent.isLocked())?this.notifyAuthChange("locked"):(yield this.ad4mClient.agent.status(),this.notifyAuthChange("authenticated")),!0}catch(t){return t.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(t=!1){return Ve(this,null,function*(){var r;if(t&&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(t){return Ve(this,null,function*(){var r;try{let n=yield(r=this.ad4mClient)==null?void 0:r.agent.generateJwt(this.requestId,t);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(12e3),this.notifyConnectionChange("not_connected"),this.notifyAuthChange("unauthenticated")}};export{vu as default};
|
|
1333
1365
|
/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */
|
|
1334
1366
|
//! @fayeed - make it support node.js
|