UNPKG

altair-static

Version:

Static package for altair graphql client

16 lines • 235 kB
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="ef7fc831-7e69-5268-85ee-420007271761")}catch(e){}}();
import{b as Tc,c as Ac,d as kc,e as Ic,f as Nc}from"./chunk-GC5A67L5.js";import{a as Qo}from"./chunk-ANLTCLUB.js";import{Ia as Fc,Ja as Ze,d as Br}from"./chunk-PJ3NZ7HS.js";import{q as Bo,r as we,v as Vo,w as Cc,x as Rc}from"./chunk-ZYOLZTH5.js";import{c as qo,m as Uo,n as Kn,o as jo}from"./chunk-472WPQLO.js";import{e as N,f as Q,g as lt,h as jr,i as le}from"./chunk-B7YGBANW.js";var Hn={};lt(Hn,{__assign:()=>w,__asyncDelegator:()=>Bc,__asyncGenerator:()=>jc,__asyncValues:()=>Vc,__await:()=>rr,__awaiter:()=>Re,__classPrivateFieldGet:()=>Wc,__classPrivateFieldSet:()=>Hc,__createBinding:()=>Lc,__decorate:()=>Dc,__exportStar:()=>qc,__extends:()=>he,__generator:()=>Fe,__importDefault:()=>Gc,__importStar:()=>Kc,__makeTemplateObject:()=>Qc,__metadata:()=>Pc,__param:()=>Mc,__read:()=>Ko,__rest:()=>ve,__spread:()=>Uc,__spreadArrays:()=>De,__values:()=>Wn});function he(r,e){Gn(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function ve(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t}function Dc(r,e,t,n){var i=arguments.length,o=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,n);else for(var s=r.length-1;s>=0;s--)(a=r[s])&&(o=(i<3?a(o):i>3?a(e,t,o):a(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o}function Mc(r,e){return function(t,n){e(t,n,r)}}function Pc(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)}function Re(r,e,t,n){function i(o){return o instanceof t?o:new t(function(a){a(o)})}return new(t||(t=Promise))(function(o,a){function s(f){try{u(n.next(f))}catch(l){a(l)}}function c(f){try{u(n.throw(f))}catch(l){a(l)}}function u(f){f.done?o(f.value):i(f.value).then(s,c)}u((n=n.apply(r,e||[])).next())})}function Fe(r,e){var t={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(u){return function(f){return c([u,f])}}function c(u){if(n)throw new TypeError("Generator is already executing.");for(;t;)try{if(n=1,i&&(o=u[0]&2?i.return:u[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,u[1])).done)return o;switch(i=0,o&&(u=[u[0]&2,o.value]),u[0]){case 0:case 1:o=u;break;case 4:return t.label++,{value:u[1],done:!1};case 5:t.label++,i=u[1],u=[0];continue;case 7:u=t.ops.pop(),t.trys.pop();continue;default:if(o=t.trys,!(o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){t.label=u[1];break}if(u[0]===6&&t.label<o[1]){t.label=o[1],o=u;break}if(o&&t.label<o[2]){t.label=o[2],t.ops.push(u);break}o[2]&&t.ops.pop(),t.trys.pop();continue}u=e.call(r,t)}catch(f){u=[6,f],i=0}finally{n=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function Lc(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}function qc(r,e){for(var t in r)t!=="default"&&!e.hasOwnProperty(t)&&(e[t]=r[t])}function Wn(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Ko(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var n=t.call(r),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(a)throw a.error}}return o}function Uc(){for(var r=[],e=0;e<arguments.length;e++)r=r.concat(Ko(arguments[e]));return r}function De(){for(var r=0,e=0,t=arguments.length;e<t;e++)r+=arguments[e].length;for(var n=Array(r),i=0,e=0;e<t;e++)for(var o=arguments[e],a=0,s=o.length;a<s;a++,i++)n[i]=o[a];return n}function rr(r){return this instanceof rr?(this.v=r,this):new rr(r)}function jc(r,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=t.apply(r,e||[]),i,o=[];return i={},a("next"),a("throw"),a("return"),i[Symbol.asyncIterator]=function(){return this},i;function a(p){n[p]&&(i[p]=function(v){return new Promise(function(b,y){o.push([p,v,b,y])>1||s(p,v)})})}function s(p,v){try{c(n[p](v))}catch(b){l(o[0][3],b)}}function c(p){p.value instanceof rr?Promise.resolve(p.value.v).then(u,f):l(o[0][2],p)}function u(p){s("next",p)}function f(p){s("throw",p)}function l(p,v){p(v),o.shift(),o.length&&s(o[0][0],o[0][1])}}function Bc(r){var e,t;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,o){e[i]=r[i]?function(a){return(t=!t)?{value:rr(r[i](a)),done:i==="return"}:o?o(a):a}:o}}function Vc(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=r[Symbol.asyncIterator],t;return e?e.call(r):(r=typeof Wn=="function"?Wn(r):r[Symbol.iterator](),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(o){t[o]=r[o]&&function(a){return new Promise(function(s,c){a=r[o](a),i(s,c,a.done,a.value)})}}function i(o,a,s,c){Promise.resolve(c).then(function(u){o({value:u,done:s})},a)}}function Qc(r,e){return Object.defineProperty?Object.defineProperty(r,"raw",{value:e}):r.raw=e,r}function Kc(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)Object.hasOwnProperty.call(r,t)&&(e[t]=r[t]);return e.default=r,e}function Gc(r){return r&&r.__esModule?r:{default:r}}function Wc(r,e){if(!e.has(r))throw new TypeError("attempted to get private field on non-instance");return e.get(r)}function Hc(r,e,t){if(!e.has(r))throw new TypeError("attempted to set private field on non-instance");return e.set(r,t),t}var Gn,w,$=N(()=>{"use strict";Gn=function(r,e){return Gn=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)n.hasOwnProperty(i)&&(t[i]=n[i])},Gn(r,e)};w=function(){return w=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},w.apply(this,arguments)}});function j(r,e){if(!r)throw new H(e)}function Yn(r){return function(){if(Vr.indexOf(r)>=Jn)return console[r].apply(console,arguments)}}function Zn(r){var e=Vr[Jn];return Jn=Math.max(0,Vr.indexOf(r)),e}var zn,Go,zc,H,Vr,Jn,Up,ie=N(()=>{"use strict";jo();zn="Invariant Violation",Go=Object.setPrototypeOf,zc=Go===void 0?function(r,e){return r.__proto__=e,r}:Go,H=(function(r){Uo(e,r);function e(t){t===void 0&&(t=zn);var n=r.call(this,typeof t=="number"?zn+": "+t+" (see https://github.com/apollographql/invariant-packages)":t)||this;return n.framesToPop=1,n.name=zn,zc(n,e.prototype),n}return e})(Error);Vr=["log","warn","error","silent"],Jn=Vr.indexOf("log");(function(r){r.log=Yn("log"),r.warn=Yn("warn"),r.error=Yn("error")})(j||(j={}));Up=typeof process=="object"&&typeof process.env=="object"?process:{env:{}}});function Me(r,e){var t=r.directives;return!t||!t.length?!0:Xn(t).every(function(n){var i=n.directive,o=n.ifArgument,a=!1;return o.value.kind==="Variable"?(a=e&&e[o.value.name.value],j(a!==void 0,38)):a=o.value.value,i.name.value==="skip"?!a:a})}function $n(r){var e=[];return we(r,{Directive:function(t){e.push(t.name.value)}}),e}function $e(r,e){return $n(e).some(function(t){return r.indexOf(t)>-1})}function Qr(r){return r&&$e(["client"],r)&&$e(["export"],r)}function Yc(r){var e=r.name.value;return e==="skip"||e==="include"}function Xn(r){var e=[];return r&&r.length&&r.forEach(function(t){if(Yc(t)){var n=t.arguments,i=t.name.value;j(n&&n.length===1,39);var o=n[0];j(o.name&&o.name.value==="if",40);var a=o.value;j(a&&(a.kind==="Variable"||a.kind==="BooleanValue"),41),e.push({directive:t,ifArgument:o})}}),e}var Wo=N(()=>{"use strict";Ze();ie()});function Kr(r,e){var t=e,n=[];r.definitions.forEach(function(o){if(o.kind==="OperationDefinition")throw new H(42);o.kind==="FragmentDefinition"&&n.push(o)}),typeof t>"u"&&(j(n.length===1,43),t=n[0].name.value);var i=w(w({},r),{definitions:De([{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:t}}]}}],r.definitions)});return i}function Pe(r){r===void 0&&(r=[]);var e={};return r.forEach(function(t){e[t.name.value]=t}),e}function Le(r,e){switch(r.kind){case"InlineFragment":return r;case"FragmentSpread":{var t=e&&e[r.name.value];return j(t,44),t}default:return null}}var Gr=N(()=>{"use strict";$();ie()});var zo=Q((Hp,Ho)=>{"use strict";Ho.exports=function(r,e){e||(e={}),typeof e=="function"&&(e={cmp:e});var t=typeof e.cycles=="boolean"?e.cycles:!1,n=e.cmp&&(function(o){return function(a){return function(s,c){var u={key:s,value:a[s]},f={key:c,value:a[c]};return o(u,f)}}})(e.cmp),i=[];return(function o(a){if(a&&a.toJSON&&typeof a.toJSON=="function"&&(a=a.toJSON()),a!==void 0){if(typeof a=="number")return isFinite(a)?""+a:"null";if(typeof a!="object")return JSON.stringify(a);var s,c;if(Array.isArray(a)){for(c="[",s=0;s<a.length;s++)s&&(c+=","),c+=o(a[s])||"null";return c+"]"}if(a===null)return"null";if(i.indexOf(a)!==-1){if(t)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var u=i.push(a)-1,f=Object.keys(a).sort(n&&n(a));for(c="",s=0;s<f.length;s++){var l=f[s],p=o(a[l]);p&&(c&&(c+=","),c+=JSON.stringify(l)+":"+p)}return i.splice(u,1),"{"+c+"}"}})(r)}});function Ee(r){return{__ref:String(r)}}function X(r){return!!(r&&typeof r=="object"&&typeof r.__ref=="string")}function Jc(r){return r.kind==="StringValue"}function Zc(r){return r.kind==="BooleanValue"}function $c(r){return r.kind==="IntValue"}function Xc(r){return r.kind==="FloatValue"}function ef(r){return r.kind==="Variable"}function tf(r){return r.kind==="ObjectValue"}function rf(r){return r.kind==="ListValue"}function nf(r){return r.kind==="EnumValue"}function of(r){return r.kind==="NullValue"}function He(r,e,t,n){if($c(t)||Xc(t))r[e.value]=Number(t.value);else if(Zc(t)||Jc(t))r[e.value]=t.value;else if(tf(t)){var i={};t.fields.map(function(a){return He(i,a.name,a.value,n)}),r[e.value]=i}else if(ef(t)){var o=(n||{})[t.name.value];r[e.value]=o}else if(rf(t))r[e.value]=t.values.map(function(a){var s={};return He(s,e,a,n),s[e.value]});else if(nf(t))r[e.value]=t.value;else if(of(t))r[e.value]=null;else throw new H(53)}function Wr(r,e){var t=null;r.directives&&(t={},r.directives.forEach(function(i){t[i.name.value]={},i.arguments&&i.arguments.forEach(function(o){var a=o.name,s=o.value;return He(t[i.name.value],a,s,e)})}));var n=null;return r.arguments&&r.arguments.length&&(n={},r.arguments.forEach(function(i){var o=i.name,a=i.value;return He(n,o,a,e)})),nr(r.name.value,n,t)}function nr(r,e,t){if(e&&t&&t.connection&&t.connection.key)if(t.connection.filter&&t.connection.filter.length>0){var n=t.connection.filter?t.connection.filter:[];n.sort();var i={};return n.forEach(function(s){i[s]=e[s]}),t.connection.key+"("+JSON.stringify(i)+")"}else return t.connection.key;var o=r;if(e){var a=(0,Yo.default)(e);o+="("+a+")"}return t&&Object.keys(t).forEach(function(s){af.indexOf(s)===-1&&(t[s]&&Object.keys(t[s]).length?o+="@"+s+"("+JSON.stringify(t[s])+")":o+="@"+s)}),o}function It(r,e){if(r.arguments&&r.arguments.length){var t={};return r.arguments.forEach(function(n){var i=n.name,o=n.value;return He(t,i,o,e)}),t}return null}function xe(r){return r.alias?r.alias.value:r.name.value}function ht(r,e,t){if(typeof r.__typename=="string")return r.__typename;for(var n=0,i=e.selections;n<i.length;n++){var o=i[n];if(ae(o)){if(o.name.value==="__typename")return r[xe(o)]}else{var a=ht(r,Le(o,t).selectionSet,t);if(typeof a=="string")return a}}}function ae(r){return r.kind==="Field"}function Nt(r){return r.kind==="InlineFragment"}var Yo,af,Hr=N(()=>{"use strict";Yo=jr(zo());ie();Gr();af=["connection","include","skip","client","rest","export"]});function Xe(r){j(r&&r.kind==="Document",45);var e=r.definitions.filter(function(t){return t.kind!=="FragmentDefinition"}).map(function(t){if(t.kind!=="OperationDefinition")throw new H(46);return t});return j(e.length<=1,47),r}function Ce(r){return Xe(r),r.definitions.filter(function(e){return e.kind==="OperationDefinition"})[0]}function pt(r){return r.definitions.filter(function(e){return e.kind==="OperationDefinition"&&e.name}).map(function(e){return e.name.value})[0]||null}function qe(r){return r.definitions.filter(function(e){return e.kind==="FragmentDefinition"})}function zr(r){var e=Ce(r);return j(e&&e.operation==="query",48),e}function Yr(r){j(r.kind==="Document",49),j(r.definitions.length<=1,50);var e=r.definitions[0];return j(e.kind==="FragmentDefinition",51),e}function et(r){Xe(r);for(var e,t=0,n=r.definitions;t<n.length;t++){var i=n[t];if(i.kind==="OperationDefinition"){var o=i.operation;if(o==="query"||o==="mutation"||o==="subscription")return i}i.kind==="FragmentDefinition"&&!e&&(e=i)}if(e)return e;throw new H(52)}function tt(r){var e=Object.create(null),t=r&&r.variableDefinitions;return t&&t.length&&t.forEach(function(n){n.defaultValue&&He(e,n.variable.name,n.defaultValue)}),e}var ei=N(()=>{"use strict";ie();Hr()});function ti(r,e,t){var n=0;return r.forEach(function(i,o){e.call(this,i,o,r)&&(r[n++]=i)},t),r.length=n,r}var Jo=N(()=>{"use strict"});function Xo(r,e){return r.selectionSet.selections.every(function(t){return t.kind==="FragmentSpread"&&Xo(e[t.name.value],e)})}function ri(r){return Xo(Ce(r)||Yr(r),Pe(qe(r)))?null:r}function Zo(r){return function(t){return r.some(function(n){return n.name&&n.name===t.name.value||n.test&&n.test(t)})}}function Jr(r,e){var t=Object.create(null),n=[],i=Object.create(null),o=[],a=ri(we(e,{Variable:{enter:function(s,c,u){u.kind!=="VariableDefinition"&&(t[s.name.value]=!0)}},Field:{enter:function(s){if(r&&s.directives){var c=r.some(function(u){return u.remove});if(c&&s.directives&&s.directives.some(Zo(r)))return s.arguments&&s.arguments.forEach(function(u){u.value.kind==="Variable"&&n.push({name:u.value.name.value})}),s.selectionSet&&ea(s.selectionSet).forEach(function(u){o.push({name:u.name.value})}),null}}},FragmentSpread:{enter:function(s){i[s.name.value]=!0}},Directive:{enter:function(s){if(Zo(r)(s))return null}}}));return a&&ti(n,function(s){return!!s.name&&!t[s.name]}).length&&(a=ni(n,a)),a&&ti(o,function(s){return!!s.name&&!i[s.name]}).length&&(a=ii(o,a)),a}function dt(r){return we(Xe(r),{SelectionSet:{enter:function(e,t,n){if(!(n&&n.kind==="OperationDefinition")){var i=e.selections;if(i){var o=i.some(function(s){return ae(s)&&(s.name.value==="__typename"||s.name.value.lastIndexOf("__",0)===0)});if(!o){var a=n;if(!(ae(a)&&a.directives&&a.directives.some(function(s){return s.name.value==="export"})))return w(w({},e),{selections:De(i,[$o])})}}}}}})}function Zr(r){return Jr([sf],Xe(r))}function uf(r){return function(t){return r.some(function(n){return t.value&&t.value.kind==="Variable"&&t.value.name&&(n.name===t.value.name.value||n.test&&n.test(t))})}}function ni(r,e){var t=uf(r);return ri(we(e,{OperationDefinition:{enter:function(n){return w(w({},n),{variableDefinitions:n.variableDefinitions?n.variableDefinitions.filter(function(i){return!r.some(function(o){return o.name===i.variable.name.value})}):[]})}},Field:{enter:function(n){var i=r.some(function(a){return a.remove});if(i){var o=0;if(n.arguments&&n.arguments.forEach(function(a){t(a)&&(o+=1)}),o===1)return null}}},Argument:{enter:function(n){if(t(n))return null}}}))}function ii(r,e){function t(n){if(r.some(function(i){return i.name===n.name.value}))return null}return ri(we(e,{FragmentSpread:{enter:t},FragmentDefinition:{enter:t}}))}function ea(r){var e=[];return r.selections.forEach(function(t){(ae(t)||Nt(t))&&t.selectionSet?ea(t.selectionSet).forEach(function(n){return e.push(n)}):t.kind==="FragmentSpread"&&e.push(t)}),e}function $r(r){var e=et(r),t=e.operation;if(t==="query")return r;var n=we(r,{OperationDefinition:{enter:function(i){return w(w({},i),{operation:"query"})}}});return n}function Xr(r){Xe(r);var e=Jr([{test:function(t){return t.name.value==="client"},remove:!0}],r);return e&&(e=we(e,{FragmentDefinition:{enter:function(t){if(t.selectionSet){var n=t.selectionSet.selections.every(function(i){return ae(i)&&i.name.value==="__typename"});if(n)return null}}}})),e}var $o,sf,ta=N(()=>{"use strict";$();Ze();ie();ei();Jo();Hr();Gr();$o={kind:"Field",name:{kind:"Name",value:"__typename"}};dt.added=function(r){return r===$o};sf={test:function(r){var e=r.name.value==="connection";return e&&(!r.arguments||r.arguments.some(function(t){return t.name.value==="key"})),e}}});function vt(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return Ct(r)}function Ct(r){var e=r[0]||{},t=r.length;if(t>1)for(var n=new Rt,i=1;i<t;++i)e=n.merge(e,r[i]);return e}function en(r){return r!==null&&typeof r=="object"}var cf,ff,Rt,oi=N(()=>{"use strict";$();cf=Object.prototype.hasOwnProperty;ff=function(r,e,t){return this.merge(r[t],e[t])},Rt=(function(){function r(e){e===void 0&&(e=ff),this.reconciler=e,this.isObject=en,this.pastCopies=new Set}return r.prototype.merge=function(e,t){for(var n=this,i=[],o=2;o<arguments.length;o++)i[o-2]=arguments[o];return en(t)&&en(e)?(Object.keys(t).forEach(function(a){if(cf.call(e,a)){var s=e[a];if(t[a]!==s){var c=n.reconciler.apply(n,De([e,t,a],i));c!==s&&(e=n.shallowCopyForMerge(e),e[a]=c)}}else e=n.shallowCopyForMerge(e),e[a]=t[a]}),e):t},r.prototype.shallowCopyForMerge=function(e){return en(e)&&!this.pastCopies.has(e)&&(Array.isArray(e)?e=e.slice(0):e=w({__proto__:Object.getPrototypeOf(e)},e),this.pastCopies.add(e)),e},r})()});function ra(r){return r===void 0&&(r=!1),{keyArgs:r,merge:function(e,t){return e?De(e,t):t}}}function na(r){return r===void 0&&(r=!1),{keyArgs:r,merge:function(e,t,n){var i=n.args,o=e?e.slice(0):[];if(i)for(var a=i.offset,s=a===void 0?0:a,c=0;c<t.length;++c)o[s+c]=t[c];else o.push.apply(o,t);return o}}}function ia(r){return r===void 0&&(r=!1),{keyArgs:r,read:function(e,t){var n=t.canRead,i=t.readField;if(e){var o=[],a="",s="";return e.edges.forEach(function(c){n(i("node",c))&&(o.push(c),c.cursor&&(a=a||c.cursor,s=c.cursor))}),w(w({},ai(e)),{edges:o,pageInfo:w(w({},e.pageInfo),{startCursor:a,endCursor:s})})}},merge:function(e,t,n){e===void 0&&(e=hf());var i=n.args,o=n.isReference,a=n.readField,s=t.edges?t.edges.map(function(O){return o(O=w({},O))&&(O.cursor=a("cursor",O)),O}):[];if(t.pageInfo){var c=t.pageInfo,u=c.startCursor,f=c.endCursor,l=s[0],p=s[s.length-1];l&&u&&(l.cursor=u),p&&f&&(p.cursor=f);var v=l&&l.cursor;v&&!u&&(t=vt(t,{pageInfo:{startCursor:v}}));var b=p&&p.cursor;b&&!f&&(t=vt(t,{pageInfo:{endCursor:b}}))}var y=e.edges,_=[];if(i&&i.after){var T=y.findIndex(function(O){return O.cursor===i.after});T>=0&&(y=y.slice(0,T+1))}else if(i&&i.before){var T=y.findIndex(function(M){return M.cursor===i.before});_=T<0?y:y.slice(T),y=[]}else t.edges&&(y=[]);var k=De(y,s,_),I=w(w({},t.pageInfo),e.pageInfo);if(t.pageInfo){var D=t.pageInfo,C=D.hasPreviousPage,F=D.hasNextPage,u=D.startCursor,f=D.endCursor,q=ve(D,["hasPreviousPage","hasNextPage","startCursor","endCursor"]);Object.assign(I,q),y.length||(C!==void 0&&(I.hasPreviousPage=C),u!==void 0&&(I.startCursor=u)),_.length||(F!==void 0&&(I.hasNextPage=F),f!==void 0&&(I.endCursor=f))}return w(w(w({},ai(e)),ai(t)),{edges:k,pageInfo:I})}}}function hf(){return{edges:[],pageInfo:{hasPreviousPage:!1,hasNextPage:!0,startCursor:"",endCursor:""}}}var ai,lf,oa=N(()=>{"use strict";$();$();oi();ai=function(r){return ve(r,lf)},lf=["edges","pageInfo"]});var fa=Q(on=>{"use strict";Object.defineProperty(on,"__esModule",{value:!0});on.Observable=void 0;function fi(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function aa(r,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,n.key,n)}}function li(r,e,t){return e&&aa(r.prototype,e),t&&aa(r,t),r}var hi=function(){return typeof Symbol=="function"},pi=function(r){return hi()&&!!Symbol[r]},di=function(r){return pi(r)?Symbol[r]:"@@"+r};hi()&&!pi("observable")&&(Symbol.observable=Symbol("observable"));var pf=di("iterator"),ui=di("observable"),sa=di("species");function rn(r,e){var t=r[e];if(t!=null){if(typeof t!="function")throw new TypeError(t+" is not a function");return t}}function ir(r){var e=r.constructor;return e!==void 0&&(e=e[sa],e===null&&(e=void 0)),e!==void 0?e:nn}function df(r){return r instanceof nn}function Ft(r){Ft.log?Ft.log(r):setTimeout(function(){throw r})}function tn(r){Promise.resolve().then(function(){try{r()}catch(e){Ft(e)}})}function ua(r){var e=r._cleanup;if(e!==void 0&&(r._cleanup=void 0,!!e))try{if(typeof e=="function")e();else{var t=rn(e,"unsubscribe");t&&t.call(e)}}catch(n){Ft(n)}}function ci(r){r._observer=void 0,r._queue=void 0,r._state="closed"}function vf(r){var e=r._queue;if(e){r._queue=void 0,r._state="ready";for(var t=0;t<e.length&&(ca(r,e[t].type,e[t].value),r._state!=="closed");++t);}}function ca(r,e,t){r._state="running";var n=r._observer;try{var i=rn(n,e);switch(e){case"next":i&&i.call(n,t);break;case"error":if(ci(r),i)i.call(n,t);else throw t;break;case"complete":ci(r),i&&i.call(n);break}}catch(o){Ft(o)}r._state==="closed"?ua(r):r._state==="running"&&(r._state="ready")}function si(r,e,t){if(r._state!=="closed"){if(r._state==="buffering"){r._queue.push({type:e,value:t});return}if(r._state!=="ready"){r._state="buffering",r._queue=[{type:e,value:t}],tn(function(){return vf(r)});return}ca(r,e,t)}}var yf=(function(){function r(e,t){fi(this,r),this._cleanup=void 0,this._observer=e,this._queue=void 0,this._state="initializing";var n=new mf(this);try{this._cleanup=t.call(void 0,n)}catch(i){n.error(i)}this._state==="initializing"&&(this._state="ready")}return li(r,[{key:"unsubscribe",value:function(){this._state!=="closed"&&(ci(this),ua(this))}},{key:"closed",get:function(){return this._state==="closed"}}]),r})(),mf=(function(){function r(e){fi(this,r),this._subscription=e}return li(r,[{key:"next",value:function(t){si(this._subscription,"next",t)}},{key:"error",value:function(t){si(this._subscription,"error",t)}},{key:"complete",value:function(){si(this._subscription,"complete")}},{key:"closed",get:function(){return this._subscription._state==="closed"}}]),r})(),nn=(function(){function r(e){if(fi(this,r),!(this instanceof r))throw new TypeError("Observable cannot be called as a function");if(typeof e!="function")throw new TypeError("Observable initializer must be a function");this._subscriber=e}return li(r,[{key:"subscribe",value:function(t){return(typeof t!="object"||t===null)&&(t={next:t,error:arguments[1],complete:arguments[2]}),new yf(t,this._subscriber)}},{key:"forEach",value:function(t){var n=this;return new Promise(function(i,o){if(typeof t!="function"){o(new TypeError(t+" is not a function"));return}function a(){s.unsubscribe(),i()}var s=n.subscribe({next:function(c){try{t(c,a)}catch(u){o(u),s.unsubscribe()}},error:o,complete:i})})}},{key:"map",value:function(t){var n=this;if(typeof t!="function")throw new TypeError(t+" is not a function");var i=ir(this);return new i(function(o){return n.subscribe({next:function(a){try{a=t(a)}catch(s){return o.error(s)}o.next(a)},error:function(a){o.error(a)},complete:function(){o.complete()}})})}},{key:"filter",value:function(t){var n=this;if(typeof t!="function")throw new TypeError(t+" is not a function");var i=ir(this);return new i(function(o){return n.subscribe({next:function(a){try{if(!t(a))return}catch(s){return o.error(s)}o.next(a)},error:function(a){o.error(a)},complete:function(){o.complete()}})})}},{key:"reduce",value:function(t){var n=this;if(typeof t!="function")throw new TypeError(t+" is not a function");var i=ir(this),o=arguments.length>1,a=!1,s=arguments[1],c=s;return new i(function(u){return n.subscribe({next:function(f){var l=!a;if(a=!0,!l||o)try{c=t(c,f)}catch(p){return u.error(p)}else c=f},error:function(f){u.error(f)},complete:function(){if(!a&&!o)return u.error(new TypeError("Cannot reduce an empty sequence"));u.next(c),u.complete()}})})}},{key:"concat",value:function(){for(var t=this,n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];var a=ir(this);return new a(function(s){var c,u=0;function f(l){c=l.subscribe({next:function(p){s.next(p)},error:function(p){s.error(p)},complete:function(){u===i.length?(c=void 0,s.complete()):f(a.from(i[u++]))}})}return f(t),function(){c&&(c.unsubscribe(),c=void 0)}})}},{key:"flatMap",value:function(t){var n=this;if(typeof t!="function")throw new TypeError(t+" is not a function");var i=ir(this);return new i(function(o){var a=[],s=n.subscribe({next:function(u){if(t)try{u=t(u)}catch(l){return o.error(l)}var f=i.from(u).subscribe({next:function(l){o.next(l)},error:function(l){o.error(l)},complete:function(){var l=a.indexOf(f);l>=0&&a.splice(l,1),c()}});a.push(f)},error:function(u){o.error(u)},complete:function(){c()}});function c(){s.closed&&a.length===0&&o.complete()}return function(){a.forEach(function(u){return u.unsubscribe()}),s.unsubscribe()}})}},{key:ui,value:function(){return this}}],[{key:"from",value:function(t){var n=typeof this=="function"?this:r;if(t==null)throw new TypeError(t+" is not an object");var i=rn(t,ui);if(i){var o=i.call(t);if(Object(o)!==o)throw new TypeError(o+" is not an object");return df(o)&&o.constructor===n?o:new n(function(a){return o.subscribe(a)})}if(pi("iterator")&&(i=rn(t,pf),i))return new n(function(a){tn(function(){if(!a.closed){var s=!0,c=!1,u=void 0;try{for(var f=i.call(t)[Symbol.iterator](),l;!(s=(l=f.next()).done);s=!0){var p=l.value;if(a.next(p),a.closed)return}}catch(v){c=!0,u=v}finally{try{!s&&f.return!=null&&f.return()}finally{if(c)throw u}}a.complete()}})});if(Array.isArray(t))return new n(function(a){tn(function(){if(!a.closed){for(var s=0;s<t.length;++s)if(a.next(t[s]),a.closed)return;a.complete()}})});throw new TypeError(t+" is not observable")}},{key:"of",value:function(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];var o=typeof this=="function"?this:r;return new o(function(a){tn(function(){if(!a.closed){for(var s=0;s<n.length;++s)if(a.next(n[s]),a.closed)return;a.complete()}})})}},{key:sa,get:function(){return this}}]),r})();on.Observable=nn;hi()&&Object.defineProperty(nn,Symbol("extensions"),{value:{symbol:ui,hostReportError:Ft},configurable:!0})});var ha=Q((md,la)=>{"use strict";la.exports=fa().Observable});function vi(r){var e,t=r.Symbol;if(typeof t=="function")if(t.observable)e=t.observable;else{typeof t.for=="function"?e=t.for("https://github.com/benlesh/symbol-observable"):e=t("https://github.com/benlesh/symbol-observable");try{t.observable=e}catch{}}else e="@@observable";return e}var pa=N(()=>{"use strict"});var Dt,_d,da=N(()=>{"use strict";pa();typeof self<"u"?Dt=self:typeof window<"u"?Dt=window:typeof global<"u"?Dt=global:typeof module<"u"?Dt=module:Dt=Function("return this")();_d=vi(Dt)});var B,va,ya,or=N(()=>{"use strict";B=jr(ha());da();va=B.default.prototype,ya="@@observable";va[ya]||(va[ya]=function(){return this})});function mi(r){return yi(r)}function yi(r,e){switch(gf.call(r)){case"[object Array]":{if(e=e||new Map,e.has(r))return e.get(r);var t=r.slice(0);return e.set(r,t),t.forEach(function(i,o){t[o]=yi(i,e)}),t}case"[object Object]":{if(e=e||new Map,e.has(r))return e.get(r);var n=Object.create(Object.getPrototypeOf(r));return e.set(r,n),Object.keys(r).forEach(function(i){n[i]=yi(r[i],e)}),n}default:return r}}var gf,ma=N(()=>{"use strict";gf=Object.prototype.toString});function ga(r){return r}var ba=N(()=>{"use strict"});function rt(r,e,t){var n=[];r.forEach(function(i){return i[e]&&n.push(i)}),n.forEach(function(i){return i[e](t)})}var gi=N(()=>{"use strict"});function an(r,e,t){return new B.default(function(n){var i=n.next,o=n.error,a=n.complete,s=0,c=!1,u={then:function(v){return new Promise(function(b){return b(v())})}};function f(v,b){return v?function(y){++s;var _=function(){return v(y)};u=u.then(_,_).then(function(T){--s,i&&i.call(n,T),c&&l.complete()},function(T){throw--s,T}).catch(function(T){o&&o.call(n,T)})}:function(y){return b&&b.call(n,y)}}var l={next:f(e,i),error:f(t,o),complete:function(){c=!0,s||a&&a.call(n)}},p=r.subscribe(l);return function(){return p.unsubscribe()}})}var _a=N(()=>{"use strict";or()});function ar(r){function e(t){Object.defineProperty(r,t,{value:B.default})}return typeof Symbol=="function"&&Symbol.species&&e(Symbol.species),e("@@species"),r}var bi=N(()=>{"use strict";or()});function wa(r){return r&&typeof r.then=="function"}var yt,Ea=N(()=>{"use strict";$();or();gi();bi();yt=(function(r){he(e,r);function e(t){var n=r.call(this,function(i){return n.addObserver(i),function(){return n.removeObserver(i)}})||this;return n.observers=new Set,n.addCount=0,n.promise=new Promise(function(i,o){n.resolve=i,n.reject=o}),n.handlers={next:function(i){n.sub!==null&&(n.latest=["next",i],rt(n.observers,"next",i))},error:function(i){var o=n.sub;o!==null&&(o&&Promise.resolve().then(function(){return o.unsubscribe()}),n.sub=null,n.latest=["error",i],n.reject(i),rt(n.observers,"error",i))},complete:function(){if(n.sub!==null){var i=n.sources.shift();i?wa(i)?i.then(function(o){return n.sub=o.subscribe(n.handlers)}):n.sub=i.subscribe(n.handlers):(n.sub=null,n.latest&&n.latest[0]==="next"?n.resolve(n.latest[1]):n.resolve(),rt(n.observers,"complete"))}}},n.cancel=function(i){n.reject(i),n.sources=[],n.handlers.complete()},n.promise.catch(function(i){}),typeof t=="function"&&(t=[new B.default(t)]),wa(t)?t.then(function(i){return n.start(i)},n.handlers.error):n.start(t),n}return e.prototype.start=function(t){this.sub===void 0&&(this.sources=Array.from(t),this.handlers.complete())},e.prototype.deliverLastMessage=function(t){if(this.latest){var n=this.latest[0],i=t[n];i&&i.call(t,this.latest[1]),this.sub===null&&n==="next"&&t.complete&&t.complete()}},e.prototype.addObserver=function(t){this.observers.has(t)||(this.deliverLastMessage(t),this.observers.add(t),++this.addCount)},e.prototype.removeObserver=function(t,n){this.observers.delete(t)&&--this.addCount<1&&!n&&this.handlers.error(new Error("Observable cancelled prematurely"))},e.prototype.cleanup=function(t){var n=this,i=!1,o=function(){i||(i=!0,n.observers.delete(a),t())},a={next:o,error:o,complete:o},s=this.addCount;this.addObserver(a),this.addCount=s},e})(B.default);ar(yt)});function Ue(r){return Array.isArray(r)&&r.length>0}var Sa=N(()=>{"use strict"});function mt(r){return r.errors&&r.errors.length>0||!1}var xa=N(()=>{"use strict"});var je,Oa=N(()=>{"use strict";je=typeof WeakMap=="function"&&!(typeof navigator=="object"&&navigator.product==="ReactNative")});function sr(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var t=Object.create(null);return r.forEach(function(n){n&&Object.keys(n).forEach(function(i){var o=n[i];o!==void 0&&(t[i]=o)})}),t}var Ta=N(()=>{"use strict"});var _i={};lt(_i,{Concast:()=>yt,DeepMerger:()=>Rt,Observable:()=>B.default,addTypenameToDocument:()=>dt,argumentsObjectFromField:()=>It,asyncMap:()=>an,buildQueryFromSelectionSet:()=>$r,canUseWeakMap:()=>je,checkDocument:()=>Xe,cloneDeep:()=>mi,compact:()=>sr,concatPagination:()=>ra,createFragmentMap:()=>Pe,fixObservableSubclass:()=>ar,getDefaultValues:()=>tt,getDirectiveNames:()=>$n,getFragmentDefinition:()=>Yr,getFragmentDefinitions:()=>qe,getFragmentFromSelection:()=>Le,getFragmentQueryDocument:()=>Kr,getInclusionDirectives:()=>Xn,getMainDefinition:()=>et,getOperationDefinition:()=>Ce,getOperationName:()=>pt,getQueryDefinition:()=>zr,getStoreKeyName:()=>nr,getTypenameFromResult:()=>ht,graphQLResultHasError:()=>mt,hasClientExports:()=>Qr,hasDirectives:()=>$e,isField:()=>ae,isInlineFragment:()=>Nt,isNonEmptyArray:()=>Ue,isReference:()=>X,iterateObserversSafely:()=>rt,makeReference:()=>Ee,maybeDeepFreeze:()=>ga,mergeDeep:()=>vt,mergeDeepArray:()=>Ct,offsetLimitPagination:()=>na,relayStylePagination:()=>ia,removeArgumentsFromDocument:()=>ni,removeClientSetsFromDocument:()=>Xr,removeConnectionDirectiveFromDocument:()=>Zr,removeDirectivesFromDocument:()=>Jr,removeFragmentSpreadFromDocument:()=>ii,resultKeyNameFromField:()=>xe,shouldInclude:()=>Me,storeKeyNameFromField:()=>Wr,valueToObjectRepresentation:()=>He});var te=N(()=>{"use strict";Wo();Gr();ei();Hr();ta();oa();or();oi();ma();ba();gi();_a();Ea();bi();Sa();xa();Oa();Ta()});function Mt(r){return new B.default(function(e){e.error(r)})}var Aa=N(()=>{"use strict";te()});function wi(r){var e=!1;return new Promise(function(t,n){r.subscribe({next:function(i){e||(e=!0,t(i))},error:n})})}var ka=N(()=>{"use strict";ie()});function Ei(r){return new B.default(function(e){r.then(function(t){e.next(t),e.complete()}).catch(e.error.bind(e))})}var Ia=N(()=>{"use strict";te()});var Pt,Na=N(()=>{"use strict";Pt=function(r,e,t){var n=new Error(t);throw n.name="ServerError",n.response=r,n.statusCode=r.status,n.result=e,n}});function Si(r){for(var e=["query","operationName","variables","extensions","context"],t=0,n=Object.keys(r);t<n.length;t++){var i=n[t];if(e.indexOf(i)<0)throw new H(26)}return r}var Ca=N(()=>{"use strict";ie()});function xi(r,e){var t=w({},r),n=function(o){typeof o=="function"?t=w(w({},t),o(t)):t=w(w({},t),o)},i=function(){return w({},t)};return Object.defineProperty(e,"setContext",{enumerable:!1,value:n}),Object.defineProperty(e,"getContext",{enumerable:!1,value:i}),e}var Ra=N(()=>{"use strict";$()});function Oi(r){var e={variables:r.variables||{},extensions:r.extensions||{},operationName:r.operationName,query:r.query};return e.operationName||(e.operationName=typeof e.query!="string"?pt(e.query)||void 0:""),e}var Fa=N(()=>{"use strict";te()});var ur=N(()=>{"use strict";Aa();ka();Ia();Na();Ca();Ra();Fa()});function Da(r,e){return e?e(r):B.default.of()}function cr(r){return typeof r=="function"?new re(r):r}function sn(r){return r.request.length<=1}var Cv,re,gt=N(()=>{"use strict";$();ie();te();ur();Cv=(function(r){he(e,r);function e(t,n){var i=r.call(this,t)||this;return i.link=n,i}return e})(Error),re=(function(){function r(e){e&&(this.request=e)}return r.empty=function(){return new r(function(){return B.default.of()})},r.from=function(e){return e.length===0?r.empty():e.map(cr).reduce(function(t,n){return t.concat(n)})},r.split=function(e,t,n){var i=cr(t),o=cr(n||new r(Da));return sn(i)&&sn(o)?new r(function(a){return e(a)?i.request(a)||B.default.of():o.request(a)||B.default.of()}):new r(function(a,s){return e(a)?i.request(a,s)||B.default.of():o.request(a,s)||B.default.of()})},r.execute=function(e,t){return e.request(xi(t.context,Oi(Si(t))))||B.default.of()},r.concat=function(e,t){var n=cr(e);if(sn(n))return n;var i=cr(t);return sn(i)?new r(function(o){return n.request(o,function(a){return i.request(a)||B.default.of()})||B.default.of()}):new r(function(o,a){return n.request(o,function(s){return i.request(s,a)||B.default.of()})||B.default.of()})},r.prototype.split=function(e,t,n){return this.concat(r.split(e,t,n||new r(Da)))},r.prototype.concat=function(e){return r.concat(this,e)},r.prototype.request=function(e,t){throw new H(21)},r.prototype.onError=function(e,t){if(t&&t.error)return t.error(e),!1;throw e},r.prototype.setOnError=function(e){return this.onError=e,this},r})()});var Ma,Pa=N(()=>{"use strict";gt();Ma=re.empty});var La,qa=N(()=>{"use strict";gt();La=re.from});var Ua,ja=N(()=>{"use strict";gt();Ua=re.split});var Ba,Va=N(()=>{"use strict";gt();Ba=re.concat});var bt,Qa=N(()=>{"use strict";gt();bt=re.execute});var Ka=N(()=>{"use strict"});var _t=N(()=>{"use strict";Pa();qa();ja();Va();Qa();gt();Ka()});var Ga,Wa=N(()=>{"use strict";Ga="3.3.20"});function fr(r){return function(e){return e.text().then(function(t){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}}).then(function(t){return e.status>=300&&Pt(e,t,"Response not successful: Received status code "+e.status),!Array.isArray(t)&&!Ha.call(t,"data")&&!Ha.call(t,"errors")&&Pt(e,t,"Server response was missing for query '"+(Array.isArray(r)?r.map(function(n){return n.operationName}):r.operationName)+"'."),t})}}var Ha,Ti=N(()=>{"use strict";ur();Ha=Object.prototype.hasOwnProperty});var nt,un=N(()=>{"use strict";ie();nt=function(r,e){var t;try{t=JSON.stringify(r)}catch(i){var n=new H(23);throw n.parseError=i,n}return t}});var bf,_f,wf,lr,hr,Ai=N(()=>{"use strict";$();Ze();bf={includeQuery:!0,includeExtensions:!1},_f={accept:"*/*","content-type":"application/json"},wf={method:"POST"},lr={http:bf,headers:_f,options:wf},hr=function(r,e){for(var t=[],n=2;n<arguments.length;n++)t[n-2]=arguments[n];var i=w(w({},e.options),{headers:e.headers,credentials:e.credentials}),o=e.http||{};t.forEach(function(l){i=w(w(w({},i),l.options),{headers:w(w({},i.headers),l.headers)}),l.credentials&&(i.credentials=l.credentials),o=w(w({},o),l.http)});var a=r.operationName,s=r.extensions,c=r.variables,u=r.query,f={operationName:a,variables:c};return o.includeExtensions&&(f.extensions=s),o.includeQuery&&(f.query=Vo(u)),{options:i,body:f}}});var pr,ki=N(()=>{"use strict";ie();pr=function(r){if(!r&&typeof fetch>"u")throw new H(22)}});var dr,Ii=N(()=>{"use strict";dr=function(){if(typeof AbortController>"u")return{controller:!1,signal:!1};var r=new AbortController,e=r.signal;return{controller:r,signal:e}}});var vr,Ni=N(()=>{"use strict";vr=function(r,e){var t=r.getContext(),n=t.uri;return n||(typeof e=="function"?e(r):e||"/graphql")}});function yr(r,e){var t=[],n=function(l,p){t.push(l+"="+encodeURIComponent(p))};if("query"in e&&n("query",e.query),e.operationName&&n("operationName",e.operationName),e.variables){var i=void 0;try{i=nt(e.variables,"Variables map")}catch(l){return{parseError:l}}n("variables",i)}if(e.extensions){var o=void 0;try{o=nt(e.extensions,"Extensions map")}catch(l){return{parseError:l}}n("extensions",o)}var a="",s=r,c=r.indexOf("#");c!==-1&&(a=r.substr(c),s=r.substr(0,c));var u=s.indexOf("?")===-1?"?":"&",f=s+u+t.join("&")+a;return{newURI:f}}var Ci=N(()=>{"use strict";un()});var mr,Ri=N(()=>{"use strict";$();Ze();_t();te();un();Ni();Ti();ki();Ai();Ii();Ci();ur();mr=function(r){r===void 0&&(r={});var e=r.uri,t=e===void 0?"/graphql":e,n=r.fetch,i=r.includeExtensions,o=r.useGETForQueries,a=r.includeUnusedVariables,s=a===void 0?!1:a,c=ve(r,["uri","fetch","includeExtensions","useGETForQueries","includeUnusedVariables"]);pr(n),n||(n=fetch);var u={http:{includeExtensions:i},options:c.fetchOptions,credentials:c.credentials,headers:c.headers};return new re(function(f){var l=vr(f,t),p=f.getContext(),v={};if(p.clientAwareness){var b=p.clientAwareness,y=b.name,_=b.version;y&&(v["apollographql-client-name"]=y),_&&(v["apollographql-client-version"]=_)}var T=w(w({},v),p.headers),k={http:p.http,options:p.fetchOptions,credentials:p.credentials,headers:T},I=hr(f,lr,u,k),D=I.options,C=I.body;if(C.variables&&!s){var F=new Set(Object.keys(C.variables));we(f.query,{Variable:function(A,S,R){R&&R.kind!=="VariableDefinition"&&F.delete(A.name.value)}}),F.size&&(C.variables=w({},C.variables),F.forEach(function(A){delete C.variables[A]}))}var q;if(!D.signal){var O=dr(),M=O.controller,U=O.signal;q=M,q&&(D.signal=U)}var h=function(A){return A.kind==="OperationDefinition"&&A.operation==="mutation"};if(o&&!f.query.definitions.some(h)&&(D.method="GET"),D.method==="GET"){var d=yr(l,C),m=d.newURI,x=d.parseError;if(x)return Mt(x);l=m}else try{D.body=nt(C,"Payload")}catch(A){return Mt(A)}return new B.default(function(A){return n(l,D).then(function(S){return f.setContext({response:S}),S}).then(fr(f)).then(function(S){return A.next(S),A.complete(),S}).catch(function(S){S.name!=="AbortError"&&(S.result&&S.result.errors&&S.result.data&&A.next(S.result),A.error(S))}),function(){q&&q.abort()}})})}});var gr,za=N(()=>{"use strict";$();_t();Ri();gr=(function(r){he(e,r);function e(t){t===void 0&&(t={});var n=r.call(this,mr(t).request)||this;return n.options=t,n}return e})(re)});var Ya={};lt(Ya,{HttpLink:()=>gr,checkFetcher:()=>pr,createHttpLink:()=>mr,createSignalIfSupported:()=>dr,fallbackHttpConfig:()=>lr,parseAndCheckHttpResponse:()=>fr,rewriteURIForGET:()=>yr,selectHttpOptionsAndBody:()=>hr,selectURI:()=>vr,serializeFetchParameter:()=>nt});var cn=N(()=>{"use strict";Ti();un();Ai();ki();Ii();Ni();Ri();za();Ci()});function ye(r,e){try{return Di(r,e)}finally{Fi.clear()}}function Di(r,e){if(r===e)return!0;var t=Ja.call(r),n=Ja.call(e);if(t!==n)return!1;switch(t){case"[object Array]":if(r.length!==e.length)return!1;case"[object Object]":{if(Xa(r,e))return!0;var i=$a(r),o=$a(e),a=i.length;if(a!==o.length)return!1;for(var s=0;s<a;++s)if(!Ef.call(e,i[s]))return!1;for(var s=0;s<a;++s){var c=i[s];if(!Di(r[c],e[c]))return!1}return!0}case"[object Error]":return r.name===e.name&&r.message===e.message;case"[object Number]":if(r!==r)return e!==e;case"[object Boolean]":case"[object Date]":return+r==+e;case"[object RegExp]":case"[object String]":return r==""+e;case"[object Map]":case"[object Set]":{if(r.size!==e.size)return!1;if(Xa(r,e))return!0;for(var u=r.entries(),f=t==="[object Map]";;){var l=u.next();if(l.done)break;var p=l.value,v=p[0],b=p[1];if(!e.has(v)||f&&!Di(b,e.get(v)))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]":r=new Uint8Array(r),e=new Uint8Array(e);case"[object DataView]":{var y=r.byteLength;if(y===e.byteLength)for(;y--&&r[y]===e[y];);return y===-1}case"[object AsyncFunction]":case"[object GeneratorFunction]":case"[object AsyncGeneratorFunction]":case"[object Function]":{var _=Za.call(r);return _!==Za.call(e)?!1:!Of(_,xf)}}return!1}function $a(r){return Object.keys(r).filter(Sf,r)}function Sf(r){return this[r]!==void 0}function Of(r,e){var t=r.length-e.length;return t>=0&&r.indexOf(e,t)===t}function Xa(r,e){var t=Fi.get(r);if(t){if(t.has(e))return!0}else Fi.set(r,t=new Set);return t.add(e),!1}var es,Ja,Ef,Za,Fi,xf,Lt=N(()=>{"use strict";es=Object.prototype,Ja=es.toString,Ef=es.hasOwnProperty,Za=Function.prototype.toString,Fi=new Map;xf="{ [native code] }"});function fn(r){return r.hasOwnProperty("graphQLErrors")}var Tf,ze,Mi=N(()=>{"use strict";$();te();Tf=function(r){var e="";return Ue(r.graphQLErrors)&&r.graphQLErrors.forEach(function(t){var n=t?t.message:"Error message not found.";e+=n+`
`}),r.networkError&&(e+=r.networkError.message+`
`),e=e.replace(/\n$/,""),e},ze=(function(r){he(e,r);function e(t){var n=t.graphQLErrors,i=t.networkError,o=t.errorMessage,a=t.extraInfo,s=r.call(this,o)||this;return s.graphQLErrors=n||[],s.networkError=i||null,s.message=o||Tf(s),s.extraInfo=a,s.__proto__=e.prototype,s}return e})(Error)});function it(r){return r?r<7:!1}var ee,qt=N(()=>{"use strict";ee=(function(r){return r[r.loading=1]="loading",r[r.setVariables=2]="setVariables",r[r.fetchMore=3]="fetchMore",r[r.refetch=4]="refetch",r[r.poll=6]="poll",r[r.ready=7]="ready",r[r.error=8]="error",r})(ee||{})});var ts,rs=N(()=>{"use strict";qt();te();ie();ts=(function(){function r(e,t,n,i){this.observer=e,this.options=t,this.fetch=n,this.shouldFetch=i}return r.prototype.reobserve=function(e,t){e?this.updateOptions(e):this.updatePolling();var n=this.fetch(this.options,t);return this.concast&&this.concast.removeObserver(this.observer,!0),n.addObserver(this.observer),(this.concast=n).promise},r.prototype.updateOptions=function(e){return Object.assign(this.options,sr(e)),this.updatePolling(),this},r.prototype.stop=function(){this.concast&&(this.concast.removeObserver(this.observer),delete this.concast),this.pollingInfo&&(clearTimeout(this.pollingInfo.timeout),this.options.pollInterval=0,this.updatePolling())},r.prototype.updatePolling=function(){var e=this,t=this,n=t.pollingInfo,i=t.options.pollInterval;if(!i){n&&(clearTimeout(n.timeout),delete this.pollingInfo);return}if(!(n&&n.interval===i)&&(j(i,20),this.shouldFetch!==!1)){var o=n||(this.pollingInfo={});o.interval=i;var a=function(){e.pollingInfo&&(e.shouldFetch&&e.shouldFetch()?e.reobserve({fetchPolicy:"network-only",nextFetchPolicy:e.options.fetchPolicy||"cache-first"},ee.poll).then(s,s):s())},s=function(){var c=e.pollingInfo;c&&(clearTimeout(c.timeout),c.timeout=setTimeout(a,c.interval))};s()}},r})()});function Af(r){}var br,Pi=N(()=>{"use strict";$();ie();Lt();qt();te();rs();br=(function(r){he(e,r);function e(t){var n=t.queryManager,i=t.queryInfo,o=t.options,a=r.call(this,function(c){return a.onSubscribe(c)})||this;a.observers=new Set,a.subscriptions=new Set,a.observer={next:function(c){(a.lastError||a.isDifferentFromLastResult(c))&&(a.updateLastResult(c),rt(a.observers,"next",c))},error:function(c){a.updateLastResult(w(w({},a.lastResult),{error:c,errors:c.graphQLErrors,networkStatus:ee.error,loading:!1})),rt(a.observers,"error",a.lastError=c)}},a.isTornDown=!1,a.options=o,a.queryId=n.generateQueryId();var s=Ce(o.query);return a.queryName=s&&s.name&&s.name.value,a.queryManager=n,a.queryInfo=i,a}return Object.defineProperty(e.prototype,"variables",{get:function(){return this.options.variables},enumerable:!1,configurable:!0}),e.prototype.result=function(){var t=this;return new Promise(function(n,i){var o={next:function(s){n(s),t.observers.delete(o),t.observers.size||t.queryManager.removeQuery(t.queryId),setTimeout(function(){a.unsubscribe()},0)},error:i},a=t.subscribe(o)})},e.prototype.getCurrentResult=function(t){t===void 0&&(t=!0);var n=this.lastResult,i=this.queryInfo.networkStatus||n&&n.networkStatus||ee.ready,o=w(w({},n),{loading:it(i),networkStatus:i});if(this.isTornDown)return o;var a=this.options.fetchPolicy,s=a===void 0?"cache-first":a;if(s==="no-cache"||s==="network-only")delete o.partial;else if(!o.data||!this.queryManager.transform(this.options.query).hasForcedResolvers){var c=this.queryInfo.getDiff();o.data=c.complete||this.options.returnPartialData?c.result:void 0,c.complete?(o.networkStatus===ee.loading&&(s==="cache-first"||s==="cache-only")&&(o.networkStatus=ee.ready,o.loading=!1),delete o.partial):o.partial=!0}return t&&this.updateLastResult(o),o},e.prototype.isDifferentFromLastResult=function(t){return!ye(this.lastResultSnapshot,t)},e.prototype.getLastResult=function(){return this.lastResult},e.prototype.getLastError=function(){return this.lastError},e.prototype.resetLastResults=function(){delete this.lastResult,delete this.lastResultSnapshot,delete this.lastError,this.isTornDown=!1},e.prototype.resetQueryStoreErrors=function(){this.queryManager.resetErrors(this.queryId)},e.prototype.refetch=function(t){var n={pollInterval:0},i=this.options.fetchPolicy;return i!=="no-cache"&&i!=="cache-and-network"&&(n.fetchPolicy="network-only",n.nextFetchPolicy=i||"cache-first"),t&&!ye(this.options.variables,t)&&(n.variables=this.options.variables=w(w({},this.options.variables),t)),this.newReobserver(!1).reobserve(n,ee.refetch)},e.prototype.fetchMore=function(t){var n=this,i=w(w({},t.query?t:w(w(w({},this.options),t),{variables:w(w({},this.options.variables),t.variables)})),{fetchPolicy:"no-cache"}),o=this.queryManager.generateQueryId();return i.notifyOnNetworkStatusChange&&(this.queryInfo.networkStatus=ee.fetchMore,this.observe()),this.queryManager.fetchQuery(o,i,ee.fetchMore).then(function(a){var s=a.data,c=t.updateQuery;return c?n.updateQuery(function(u){return c(u,{fetchMoreResult:s,variables:i.variables})}):n.queryManager.cache.writeQuery({query:i.query,variables:i.variables,data:s}),a}).finally(function(){n.queryManager.stopQuery(o),n.reobserve()})},e.prototype.subscribeToMore=function(t){var n=this,i=this.queryManager.startGraphQLSubscription({query:t.document,variables:t.variables,context:t.context}).subscribe({next:function(o){var a=t.updateQuery;a&&n.updateQuery(function(s,c){var u=c.variables;return a(s,{subscriptionData:o,variables:u})})},error:function(o){if(t.onError){t.onError(o);return}}});return this.subscriptions.add(i),function(){n.subscriptions.delete(i)&&i.unsubscribe()}},e.prototype.setOptions=function(t){return this.reobserve(t)},e.prototype.setVariables=function(t){if(ye(this.variables,t))return this.observers.size?this.result():Promise.resolve();if(this.options.variables=t,!this.observers.size)return Promise.resolve();var n=this.options.fetchPolicy,i=n===void 0?"cache-first":n,o={fetchPolicy:i,variables:t};return i!=="cache-first"&&i!=="no-cache"&&i!=="network-only"&&(o.fetchPolicy="cache-and-network",o.nextFetchPolicy=i),this.reobserve(o,ee.setVariables)},e.prototype.updateQuery=function(t){var n,i=this.queryManager,o=i.cache.diff({query:this.options.query,variables:this.variables,previousResult:(n=this.lastResult)===null||n===void 0?void 0:n.data,returnPartialData:!0,optimistic:!1}).result,a=t(o,{variables:this.variables});a&&(i.cache.writeQuery({query:this.options.query,data:a,variables:this.variables}),i.broadcastQueries())},e.prototype.startPolling=function(t){this.getReobserver().updateOptions({pollInterval:t})},e.prototype.stopPolling=function(){this.reobserver&&this.reobserver.updateOptions({pollInterval:0})},e.prototype.updateLastResult=function(t){var n=this.lastResult;return this.lastResult=t,this.lastResultSnapshot=this.queryManager.assumeImmutableResults?t:mi(t),Ue(t.errors)||delete this.lastError,n},e.prototype.onSubscribe=function(t){var n=this;if(t===this.observer)return function(){};try{var i=t._subscription._observer;i&&!i.error&&(i.error=Af)}catch{}var o=!this.observers.size;return this.observers.add(t),this.lastError?t.error&&t.error(this.lastError):this.lastResult&&t.next&&t.next(this.lastResult),o&&this.reobserve().catch(function(a){}),function(){n.observers.delete(t)&&!n.observers.size&&n.tearDownQuery()}},e.prototype.getReobserver=function(){return this.reobserver||(this.reobserver=this.newReobserver(!0))},e.prototype.newReobserver=function(t){var n=this,i=this,o=i.queryManager,a=i.queryId;return o.setObservableQuery(this),new ts(this.observer,t?this.options:w({},this.options),function(s,c){return o.setObservableQuery(n),o.fetchQueryObservable(a,s,c)},!o.ssrMode&&function(){return!it(n.queryInfo.networkStatus)})},e.prototype.reobserve=function(t,n){return this.isTornDown=!1,this.getReobserver().reobserve(t,n)},e.prototype.observe=function(){this.observer.next(this.getCurrentResult(!1))},e.prototype.hasObservers=function(){return this.observers.size>0},e.prototype.tearDownQuery=function(){this.isTornDown||(this.reobserver&&(this.reobserver.stop(),delete this.reobserver),this.subscriptions.forEach(function(t){return t.unsubscribe()}),this.subscriptions.clear(),this.queryManager.stopQuery(this.queryId),this.observers.clear(),this.isTornDown=!0)},e})(B.default);ar(br)});function Cf(r){switch(typeof r){case"object":if(r===null)break;case"function":return!0}return!1}var kf,ns,If,Nf,ot,Li=N(()=>{"use strict";kf=function(){return Object.create(null)},ns=Array.prototype,If=ns.forEach,Nf=ns.slice,ot=(function(){function r(e,t){e===void 0&&(e=!0),t===void 0&&(t=kf),this.weakness=e,this.makeData=t}return r.prototype.lookup=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return this.lookupArray(e)},r.prototype.lookupArray=function(e){var t=this;return If.call(e,function(n){return t=t.getChildTrie(n)}),t.data||(t.data=this.makeData(Nf.call(e)))},r.prototype.getChildTrie=function(e){var t=this.weakness&&Cf(e)?this.weak||(this.weak=new WeakMap):this.strong||(this.strong=new Map),n=t.get(e);return n||t.set(e,n=new r(this.weakness,this.makeData)),n},r})()});var ce,is,Rf,Ff,qi,Ui,Ut,Df,Mf,ln=N(()=>{"use strict";ce=null,is={},Rf=1,Ff=function(){return(function(){function r(){this.id=["slot",Rf++,Date.now(),Math.random().toString(36).slice(2)].join(":")}return r.prototype.hasValue=function(){for(var e=ce;e;e=e.parent)if(this.id in e.slots){var t=e.slots[this.id];if(t===is)break;return e!==ce&&(ce.slots[this.id]=t),!0}return ce&&(ce.slots[this.id]=is),!1},r.prototype.getValue=function(){if(this.hasValue())return ce.slots[this.id]},r.prototype.withValue=function(e,t,n,i){var o,a=(o={__proto__:null},o[this.id]=e,o),s=ce;ce={parent:s,slots:a};try{return t.apply(i,n)}finally{ce=s}},r.bind=function(e){var t=ce;return function(){var n=ce;try{return ce=t,e.apply(this,arguments)}finally{ce=n}}},r.noContext=function(e,t,n){if(ce){var i=ce;try{return ce=null,e.apply(n,t)}finally{ce=i}}else return e.apply(n,t)},r})()},qi="@wry/context:Slot",Ui=Array,Ut=Ui[qi]||(function(){var r=Ff();try{Object.defineProperty(Ui,qi,{value:Ui[qi]=r,enumerable:!1,writable:!1,configurable:!1})}finally{return r}})(),Df=Ut.bind,Mf=Ut.noContext});function Pf(){}function hn(r){var e=r.unsubscribe;typeof e=="function"&&(r.unsubscribe=void 0,e())}function jt(r,e){if(!r)throw new Error(e||"assertion failure")}function jf(r,e){var t=r.length;return t>0&&t===e.length&&r[t-1]===e[t-1]}function as(r){switch(r.length){case 0:throw new Error("unknown value");case 1:return r[0];case 2:throw r[1]}}function Bf(r){return r.slice(0)}function os(r){var e=pn.getValue();if(e)return r.parents.add(e),e.childValues.has(r)||e.childValues.set(r,[]),at(r)?cs(e,r):fs(e,r),e}function Qf(r,e){return hs(r),pn.withValue(r,Kf,[r,e]),Wf(r,e)&&Gf(r),as(r.value)}function Kf(r,e){r.recomputing=!0,r.value.length=0;try{r.value[0]=r.fn.apply(null,e)}catch(t){r.value[1]=t}r.recomputing=!1}function at(r){return r.dirty||!!(r.dirtyChildren&&r.dirtyChildren.size)}function Gf(r){r.dirty=!1,!at(r)&&us(r)}function ss(r){Qi(r,cs)}function us(r){Qi(r,fs)}function Qi(r,e){var t=r.parents.size;if(t)for(var n=Vi(r.parents),i=0;i<t;++i)e(n[i],r)}function cs(r,e){jt(r.childValues.has(e)),jt(at(e));var t=!at(r);if(!r.dirtyChildren)r.dirtyChildren=_r.pop()||new Set;else if(r.dirtyChildren.has(e))return;r.dirtyChildren.add(e),t&&ss(r)}function fs(r,e){jt(r.childValues.has(e)),jt(!at(e));var t=r.childValues.get(e);t.length===0?r.childValues.set(e,Bf(e.value)):jf(t,e.value)||r.setDirty(),ls(r,e),!at(r)&&us(r)}function ls(r,e){var t=r.dirtyChildren;t&&(t.delete(e),t.size===0&&(_r.length<Uf&&_r.push(t),r.dirtyChildren=null))}function hs(r){r.childValues.size>0&&r.childValues.forEach(function(e,t){ps(r,t)}),r.forgetDeps(),jt(r.dirtyChildren===null)}function ps(r,e){e.parents.delete(r),r.childValues.delete(e),ls(r,e)}function Wf(r,e){if(typeof r.subscribe=="function")try{hn(r),r.unsubscribe=r.subscribe.apply(null,e)}catch{return r.setDirty(),!1}return!0}function Bt(r){var e=new Map,t=r&&r.subscribe;function n(i){var o=pn.getValue();if(o){var a=e.get(i);a||e.set(i,a=new Set),o.dependOn(a),typeof t=="function"&&(hn(a),a.unsubscribe=t(i))}}return n.dirty=function(o,a){var s=e.get(o);if(s){var c=a&&qf.call(Hf,a)?a:"setDirty";Vi(s).forEach(function(u){return u[c]()}),e.delete(o),hn(s)}},n}function ds(){var r=new ot(typeof WeakMap=="function");return function(){return r.lookupArray(arguments)}}function wt(r,e){e===void 0&&(e=Object.create(null));var t=new Lf(e.max||Math.pow(2,16),function(u){return u.dispose()}),n=e.keyArgs,i=e.makeCacheKey||ds(),o=function(){var u=i.apply(null,n?n.apply(null,arguments):arguments);if(u===void 0)return r.apply(null,arguments);var f=t.get(u);f||(t.set(u,f=new Vf(r)),f.subscribe=e.subscribe,f.forget=function(){return t.delete(u)});var l=f.recompute(Array.prototype.slice.call(arguments));return t.set(u,f),Bi.add(t),pn.hasValue()||(Bi.forEach(function(p){return p.clean()}),Bi.clear()),l};Object.defineProperty(o,"size",{get:function(){return t.map.size},configurable:!1,enumerable:!1});function a(u){var f=t.get(u);f&&f.setDirty()}o.dirtyKey=a,o.dirty=function(){a(i.apply(null,arguments))};function s(u){var f=t.get(u);if(f)return f.peek()}o.peekKey=s,o.peek=function(){return s(i.apply(null,arguments))};function c(u){return t.delete(u)}return o.forgetKey=c,o.forget=function(){return c(i.apply(null,arguments))},o.makeCacheKey=i,o.getKey=n?function(){return i.apply(null,n.apply(null,arguments))}:i,Object.freeze(o)}var Lf,pn,ji,qf,Vi,_r,Uf,Vf,Hf,am,Bi,Et=N(()=>{"use strict";Li();Li();ln();ln();Lf=(function(){function r(e,t){e===void 0&&(e=1/0),t===void 0&&(t=Pf),this.max=e,this.dispose=t,this.map=new Map,this.newest=null,this.oldest=null}return r.prototype.has=function(e){return this.map.has(e)},r.prototype.get=function(e){var t=this.getNode(e);return t&&t.value},r.prototype.getNode=function(e){var t=this.map.get(e);if(t&&t!==this.newest){var n=t.older,i=t.newer;i&&(i.older=n),n&&(n.newer=i),t.older=this.newest,t.older.newer=t,t.newer=null,this.newest=t,t===this.oldest&&(this.oldest=i)}return t},r.prototype.set=function(e,t){var n=this.getNode(e);return n?n.value=t:(n={key:e,value:t,newer:null,older:this.newest},this.newest&&(this.newest.newer=n),this.newest=n,this.oldest=this.oldest||n,this.map.set(e,n),n.value)},r.prototype.clean=function(){for(;this.oldest&&this.map.size>this.max;)this.delete(this.oldest.key)},r.prototype.delete=function(e){var t=this.map.get(e);return t?(t===this.newest&&(this.newest=t.older),t===this.oldest&&(this.oldest=t.newer),t.newer&&(t.newer.older=t.older),t.older&&(t.older.newer=t.newer),this.map.delete(e),this.dispose(t.value,e),!0):!1},r})(),pn=new Ut,qf=Object.prototype.hasOwnProperty,Vi=(ji=Array.from,ji===void 0?function(r){var e=[];return r.forEach(function(t){return e.push(t)}),e}:ji);_r=[],Uf=100;Vf=(function(){function r(e){this.fn=e,this.parents=new Set,this.childValues=new Map,this.dirtyChildren=null,this.dirty=!0,this.recomputing=!1,this.value=[],this.deps=null,++r.count}return r.prototype.peek=function(){if(this.value.length===1&&!at(this))return os(this),this.value[0]},r.prototype.recompute=function(e){return jt(!this.recomputing,"already recomputing"),os(this),at(this)?Qf(this,e):as(this.value)},r.prototype.setDirty=function(){this.dirty||(this.dirty=!0,this.value.length=0,ss(this),hn(this))},r.prototype.dispose=function(){var e=this;this.setDirty(),hs(this),Qi(this,function(t,n){t.setDirty(),ps(t,e)})},r.prototype.forget=function(){this.dispose()},r.prototype.dependOn=function(e){e.add(this),this.deps||(this.deps=_r.pop()||new Set),this.deps.add(e)},r.prototype.forgetDeps=function(){var e=this;this.deps&&(Vi(this.deps).forEach(function(t){return t.delete(e)}),this.deps.clear(),_r.push(this.deps),this.deps=null)},r.count=0,r})();Hf={setDirty:!0,dispose:!0,forget:!0};am=ds(),Bi=new Set});var wr,Ki=N(()=>{"use strict";Et();te();wr=(function(){function r(){this.getFragmentDoc=wt(Kr)}return r.prototype.recordOptimisticTransaction=function(e,t){this.performTransaction(e,t)},r.prototype.transformDocument=function(e){return e},r.prototype.identify=function(e){},r.prototype.gc=function(){return[]},r.prototype.modify=function(e){return!1},r.prototype.transformForLink=function(e){return e},r.prototype.readQuery=function(e,t){return t===void 0&&(t=!!e.optimistic),this.read({rootId:e.id||"ROOT_QUERY",query:e.query,variables:e.variables,returnPartialData:e.returnPartialData,optimistic:t})},r.prototype.readFragment=function(e,t){return t===void 0&&(t=!!e.optimistic),this.read({query:this.getFragmentDoc(e.fragment,e.fragmentName),variables:e.variables,rootId:e.id,returnPartialData:e.returnPartialData,optimistic:t})},r.prototype.writeQuery=function(e){return this.write({dataId:e.id||"ROOT_QUERY",result:e.data,query:e.query,variables:e.variables,broadcast:e.broadcast})},r.prototype.writeFragment=function(e){return this.write({dataId:e.id,result:e.data,variables:e.variables,query:this.getFragmentDoc(e.fragment,e.fragmentName),broadcast:e.broadcast})},r})()});var Er,vs=N(()=>{"use strict";Er||(Er={})});var St,dn=N(()=>{"use strict";St=(function(){function r(e,t,n,i,o){this.message=e,this.path=t,this.query=n,this.clientOnly=i,this.variables=o}return r})()});function Ye(r){var e=r.match(Gi);return e?e[0]:r}function vn(r,e,t){return e&&typeof e=="object"?Array.isArray(e)?e.every(function(n){return vn(r,n,t)}):r.selections.every(function(n){if(ae(n)&&Me(n,t)){var i=xe(n);return oe.call(e,i)&&(!n.selectionSet||vn(n.selectionSet,e[i],t))}return!0}):!1}function Sr(r){return r!==null&&typeof r=="object"&&!X(r)&&!Array.isArray(r)}function ys(){return new Rt}var oe,Gi,xr=N(()=>{"use strict";te();oe=Object.prototype.hasOwnProperty,Gi=/^[_a-z][_0-9a-z]*/i});function Hi(r,e){return e+"#"+r}function zf(r,e,t){var n=r[t],i=e[t];return ye(n,i)?n:i}function Qt(r){return!!(r instanceof Vt&&r.group.caching)}var yn,Wi,ms,Vt,gs,st,zi=N(()=>{"use strict";$();Et();Lt();te();xr();yn=Object.create(null),Wi=function(){return yn},ms=Object.create(null),Vt=(function(){function r(e,t){var n=this;this.policies=e,this.group=t,this.data=Object.create(null),this.rootIds=Object.create(null),this.refs=Object.create(null),this.getFieldValue=function(i,o){return X(i)?n.get(i.__ref,o):i&&i[o]},this.canRead=function(i){return X(i)?n.has(i.__ref):typeof i=="object"},this.toReference=function(i,o){if(typeof i=="string")return Ee(i);if(X(i))return i;var a=n.policies.identify(i)[0];if(a){var s=Ee(a);return o&&n.merge(a,i),s}}}return r.prototype.toObject=function(){return w({},this.data)},r.prototype.has=function(e){return this.lookup(e,!0)!==void 0},r.prototype.get=function(e,t){if(this.group.depend(e,t),oe.call(this.data,e)){var n=this.data[e];if(n&&oe.call(n,t))return n[t]}if(t==="__typename"&&oe.call(this.policies.rootTypenamesById,e))return this.policies.rootTypenamesById[e];if(this instanceof st)return this.parent.get(e,t)},r.prototype.lookup=function(e,t){if(t&&this.group.depend(e,"__exists"),oe.call(this.data,e))return this.data[e];if(this instanceof st)return this.parent.lookup(e,t);if(this.policies.rootTypenamesById[e])return Object.create(null)},r.prototype.merge=function(e,t){var n=this,i=this.lookup(e),o=new Rt(zf).merge(i,t);if(this.data[e]=o,o!==i&&(delete this.refs[e],this.group.caching)){var a=Object.create(null);i||(a.__exists=1),Object.keys(t).forEach(function(s){if(!i||i[s]!==o[s]){a[s]=1;var c=Ye(s);c!==s&&!n.policies.hasKeyArgs(o.__typename,c)&&(a[c]=1),o[s]===void 0&&!(n instanceof st)&&delete o[s]}}),Object.keys(a).forEach(function(s){return n.group.dirty(e,s)})}},r.prototype.modify=function(e,t){var n=this,i=this.lookup(e);if(i){var o=Object.create(null),a=!1,s=!0,c={DELETE:yn,INVALIDATE:ms,isReference:X,toReference:this.toReference,canRead:this.canRead,readField:function(u,f){return n.policies.readField(typeof u=="string"?{fieldName:u,from:f||Ee(e)}:u,{store:n})}};if(Object.keys(i).forEach(function(u){var f=Ye(u),l=i[u];if(l!==void 0){var p=typeof t=="function"?t:t[u]||t[f];if(p){var v=p===Wi?yn:p(l,w(w({},c),{fieldName:f,storeFieldName:u,storage:n.getStorage(e,u)}));v===ms?n.group.dirty(e,u):(v===yn&&(v=void 0),v!==l&&(o[u]=v,a=!0,l=v))}l!==void 0&&(s=!1)}}),a)return this.merge(e,o),s&&(this instanceof st?this.data[e]=void 0:delete this.data[e],this.group.dirty(e,"__exists")),!0}return!1},r.prototype.delete=function(e,t,n){var i,o=this.lookup(e);if(o){var a=this.getFieldValue(o,"__typename"),s=t&&n?this.policies.getStoreFieldName({typename:a,fieldName:t,args:n}):t;return this.modify(e,s?(i={},i[s]=Wi,i):Wi)}return!1},r.prototype.evict=function(e){var t=!1;return e.id&&(oe.call(this.data,e.id)&&(t=this.delete(e.id,e.fieldName,e.args)),this instanceof st&&(t=this.parent.evict(e)||t),(e.fieldName||t)&&this.group.dirty(e.id,e.fieldName||"__exists")),t},r.prototype.clear=function(){this.replace(null)},r.prototype.extract=function(){var e=this,t=this.toObject(),n=[];return this.getRootIdSet().forEach(function(i){oe.call(e.policies.rootTypenamesById,i)||n.push(i)}),n.length&&(t.__META={extraRootIds:n.sort()}),t},r.prototype.replace=function(e){var t=this;if(Object.keys(this.data).forEach(function(o){e&&oe.call(e,o)||t.delete(o)}),e){var n=e.__META,i=ve(e,["__META"]);Object.keys(i).forEach(function(o){t.merge(o,i[o])}),n&&n.extraRootIds.forEach(this.retain,this)}},r.prototype.retain=function(e){return this.rootIds[e]=(this.rootIds[e]||0)+1},r.prototype.release=function(e){if(this.rootIds[e]>0){var t=--this.rootIds[e];return t||delete this.rootIds[e],t}return 0},r.prototype.getRootIdSet=function(e){return e===void 0&&(e=new Set),Object.keys(this.rootIds).forEach(e.add,e),this instanceof st?this.parent.getRootIdSet(e):Object.keys(this.policies.rootTypenamesById).forEach(e.add,e),e},r.prototype.gc=function(){var e=this,t=this.getRootIdSet(),n=this.toObject();t.forEach(function(a){oe.call(n,a)&&(Object.keys(e.findChildRefIds(a)).forEach(t.add,t),delete n[a])});var i=Object.keys(n);if(i.length){for(var o=this;o instanceof st;)o=o.parent;i.forEach(function(a){return o.delete(a)})}return i},r.prototype.findChildRefIds=function(e){if(!oe.call(this.refs,e)){var t=this.refs[e]=Object.create(null),n=new Set([this.data[e]]),i=function(o){return o!==null&&typeof o=="object"};n.forEach(function(o){X(o)?t[o.__ref]=!0:i(o)&&Object.values(o).filter(i).forEach(n.add,n)})}return this.refs[e]},r.prototype.makeCacheKey=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return this.group.keyMaker.lookupArray(e)},r})(),gs=(function(){function r(e){this.caching=e,this.d=null,this.keyMaker=new ot(je),this.d=e?Bt():null}return r.prototype.depend=function(e,t){if(this.d){this.d(Hi(e,t));var n=Ye(t);n!==t&&this.d(Hi(e,n))}},r.prototype.dirty=function(e,t){this.d&&this.d.dirty(Hi(e,t))},r})();(function(r){var e=(function(t){he(n,t);function n(i){var o=i.policies,a=i.resultCaching,s=a===void 0?!0:a,c=i.seed,u=t.call(this,o,new gs(s))||this;return u.storageTrie=new ot(je),u.sharedLayerGroup=new gs(s),c&&u.replace(c),u}return n.prototype.addLayer=function(i,o){return new st(i,this,o,this.sharedLayerGroup)},n.prototype.removeLayer=function(){return this},n.prototype.getStorage=function(){return this.storageTrie.lookupArray(arguments)},n})(r);r.Root=e})(Vt||(Vt={}));st=(function(r){he(e,r);function e(t,n,i,o){var a=r.call(this,n.policies,o)||this;return a.id=t,a.parent=n,a.replay=i,a.group=o,i(a),a}return e.prototype.addLayer=function(t,n){return new e(t,this,n,this.group)},e.prototype.removeLayer=function(t){var n=this,i=this.parent.removeLayer(t);return t===this.id?(this.group.caching&&Object.keys(this.data).forEach(function(o){n.data[o]!==i.lookup(o)&&n.delete(o)}),i):i===this.parent?this:i.addLayer(this.id,this.replay)},e.prototype.toObject=function(){return w(w({},this.parent.toObject()),this.data)},e.prototype.findChildRefIds=function(t){var n=this.parent.findChildRefIds(t);return oe.call(this.data,t)?w(w({},n),r.prototype.findChildRefIds.call(this,t)):n},e.prototype.getStorage=function(){for(var t=this.parent;t.parent;)t=t.parent;return t.getStorage.apply(t,arguments)},e})(Vt)});function bs(r,e){return new St(r.message,e.path.slice(),e.query,e.clientOnly,e.variables)}var _s,ws=N(()=>{"use strict";$();Et();ie();te();zi();dn();_s=(function(){function r(e){var t=this;this.config=e,this.executeSelectionSet=wt(function(n){return t.execSelectionSetImpl(n)},{keyArgs:function(n){return[n.selectionSet,n.objectOrReference,n.context]},makeCacheKey:function(n,i,o){if(Qt(o.store))return o.store.makeCacheKey(n,X(i)?i.__ref:i,o.varString)}}),this.knownResults=new WeakMap,this.executeSubSelectedArray=wt(function(n){return t.execSubSelectedArrayImpl(n)},{makeCacheKey:function(n){var i=n.field,o=n.array,a=n.context;if(Qt(a.store))return a.store.makeCacheKey(i,o,a.varString)}}),this.config=w({addTypename:!0},e)}return r.prototype.diffQueryAgainstStore=function(e){var t=e.store,n=e.query,i=e.rootId,o=i===void 0?"ROOT_QUERY":i,a=e.variables,s=e.returnPartialData,c=s===void 0?!0:s,u=this.config.cache.policies;a=w(w({},tt(zr(n))),a);var f=this.executeSelectionSet({selectionSet:et(n).selectionSet,objectOrReference:Ee(o),context:{store:t,query:n,policies:u,variables:a,varString:JSON.stringify(a),fragmentMap:Pe(qe(n)),path:[],clientOnly:!1}}),l=f.missing&&f.missing.length>0;if(l&&!c)throw f.missing[0];return{result:f.result,missing:f.missing,complete:!l}},r.prototype.isFresh=function(e,t,n,i){if(Qt(i.store)&&this.knownResults.get(e)===n){var o=this.executeSelectionSet.peek(n,t,i);if(o&&e===o.result)return!0}return!1},r.prototype.execSelectionSetImpl=function(e){var t=this,n=e.selectionSet,i=e.objectOrReference,o=e.context;if(X(i)&&!o.policies.rootTypenamesById[i.__ref]&&!o.store.has(i.__ref))return{result:{},missing:[bs(new H(4),o)]};var a=o.variables,s=o.policies,c=o.store,u=[],f={result:null},l=c.getFieldValue(i,"__typename");this.config.addTypename&&typeof l=="string"&&!s.rootIdsByTypename[l]&&u.push({__typename:l});function p(){return f.missing||(f.missing=[])}function v(y){var _;return y.missing&&(_=p()).push.apply(_,y.missing),y.result}var b=new Set(n.selections);return b.forEach(function(y){var _;if(Me(y,a))if(ae(y)){var T=s.readField({fieldName:y.name.value,field:y,variables:o.variables,from:i},o),k=xe(y);o.path.push(k);var I=o.clientOnly;o.clientOnly=I||!!(y.directives&&y.directives.some(function(C){return C.name.value==="client"})),T===void 0?dt.added(y)||p().push(bs(new H(5),o)):Array.isArray(T)?T=v(t.executeSubSelectedArray({field:y,array:T,context:o})):y.selectionSet&&T!=null&&(T=v(t.executeSelectionSet({selectionSet:y.selectionSet,objectOrReference:T,context:o}))),T!==void 0&&u.push((_={},_[k]=T,_)),o.clientOnly=I,j(o.path.pop()===k)}else{var D=Le(y,o.fragmentMap);D&&s.fragmentMatches(D,l)&&D.selectionSet.selections.forEach(b.add,b)}}),f.result=Ct(u),this.knownResults.set(f.result,n),f},r.prototype.execSubSelectedArrayImpl=function(e){var t=this,n=e.field,i=e.array,o=e.context,a;function s(c,u){return c.missing&&(a=a||[],a.push.apply(a,c.missing)),j(o.path.pop()===u),c.result}return n.selectionSet&&(i=i.filter(o.store.canRead)),i=i.map(function(c,u){return c===null?null:(o.path.push(u),Array.isArray(c)?s(t.executeSubSelectedArray({field:n,array:c,context:o}),u):n.selectionSet?s(t.executeSelectionSet({selectionSet:n.selectionSet,objectOrReference:c,context:o}),u):(j(o.path.pop()===u),c))}),{result:i,missing:a}},r})()});function Es(r,e){var t=r.map;return t.has(e)||t.set(e,Os.pop()||{map:new Map}),t.get(e)}function Ss(r,e){var t=r.map,n=t.get(e);n&&!n.info&&!n.map.size&&(Os.push(n),t.delete(e))}var xs,Os,Ts=N(()=>{"use strict";$();ie();Lt();te();xr();xs=(function(){function r(e,t){this.cache=e,this.reader=t}return r.prototype.writeToStore=function(e){var t=e.query,n=e.result,i=e.dataId,o=e.store,a=e.variables,s=Ce(t),c=ys();a=w(w({},tt(s)),a);var u=this.processSelectionSet({result:n||Object.create(null),dataId:i,selectionSet:s.selectionSet,mergeTree:{map:new Map},context:{store:o,written:Object.create(null),merge:function(f,l){return c.merge(f,l)},variables:a,varString:JSON.stringify(a),fragmentMap:Pe(qe(t))}});if(!X(u))throw new H(7);return o.retain(u.__ref),u},r.prototype.processSelectionSet=function(e){var t=this,n=e.dataId,i=e.result,o=e.selectionSet,a=e.context,s=e.mergeTree,c=this.cache.policies,u=c.identify(i,o,a.fragmentMap),f=u[0],l=u[1];if(n=n||f,typeof n=="string"){var p=a.written[n]||(a.written[n]=[]),v=Ee(n);if(p.indexOf(o)>=0||(p.push(o),this.reader&&this.reader.isFresh(i,v,o,a)))return v}var b=Object.create(null);l&&(b=a.merge(b,l));var y=n&&c.rootTypenamesById[n]||ht(i,o,a.fragmentMap)||n&&a.store.get(n,"__typename");typeof y=="string"&&(b.__typename=y);var _=new Set(o.selections);if(_.forEach(function(C){var F;if(Me(C,a.variables))if(ae(C)){var q=xe(C),O=i[q];if(typeof O<"u"){var M=c.getStoreFieldName({typename:y,fieldName:C.name.value,field:C,variables:a.variables}),U=Es(s,M),h=t.processFieldValue(O,C,a,U),d=C.selectionSet&&a.store.getFieldValue(h,"__typename")||void 0,m=c.getMergeFunction(y,C.name.value,d);m?U.info={field:C,typename:y,merge:m}:Ss(s,M),b=a.merge(b,(F={},F[M]=h,F))}else if(c.usingPossibleTypes&&!$e(["defer","client"],C))throw new H(8)}else{var x=Le(C,a.fragmentMap);x&&c.fragmentMatches(x,y,i,a.variables)&&x.selectionSet.selections.forEach(_.add,_)}}),typeof n=="string"){var T=Ee(n);if(s.map.size&&(b=this.applyMerges(s,T,b,a)),0)var k,I,D;return a.store.merge(n,b),T}return b},r.prototype.processFieldValue=function(e,t,n,i){var o=this;return!t.selectionSet||e===null?e:Array.isArray(e)?e.map(function(a,s){var c=o.processFieldValue(a,t,n,Es(i,s));return Ss(i,s),c}):this.processSelectionSet({result:e,selectionSet:t.selectionSet,context:n,mergeTree:i})},r.prototype.applyMerges=function(e,t,n,i,o){var a,s=this;if(e.map.size&&!X(n)){var c=!Array.isArray(n)&&(X(t)||Sr(t))?t:void 0,u=n;c&&!o&&(o=[X(c)?c.__ref:c]);var f,l=function(p,v){return Array.isArray(p)?typeof v=="number"?p[v]:void 0:i.store.getFieldValue(p,String(v))};e.map.forEach(function(p,v){o&&o.push(v);var b=l(c,v),y=l(u,v),_=s.applyMerges(p,b,y,i,o);_!==y&&(f=f||new Map,f.set(v,_)),o&&j(o.pop()===v)}),f&&(n=Array.isArray(u)?u.slice(0):w({},u),f.forEach(function(p,v){n[v]=p}))}return e.info?this.cache.policies.runMergeFunction(t,n,e.info,i,o&&(a=i.store).getStorage.apply(a,o)):n},r})(),Os=[]});function Or(r){var e=As.get(r);return e||As.set(r,e={vars:new Set,dep:Bt()}),e}function ks(r){Or(r).vars.forEach(function(e){return e.forgetCache(r)})}function Is(r){Or(r).vars.forEach(function(e){return e.attachCache(r)})}function Tr(r){var e=new Set,t=new Set,n=function(o){if(arguments.length>0){if(r!==o){r=o,e.forEach(function(c){Or(c).dep.dirty(n),Yf(c)});var a=Array.from(t);t.clear(),a.forEach(function(c){return c(r)})}}else{var s=Kt.getValue();s&&(i(s),Or(s).dep(n))}return r};n.onNextChange=function(o){return t.add(o),function(){t.delete(o)}};var i=n.attachCache=function(o){return e.add(o),Or(o).vars.add(n),n};return n.forgetCache=function(o){return e.delete(o)},n}function Yf(r){r.broadcastWatches&&r.broadcastWatches()}var Kt,As,mn=N(()=>{"use strict";Et();ln();Kt=new Ut,As=new WeakMap});function Yi(r){return r.args!==void 0?r.args:r.field?It(r.field,r.variables):null}function Fs(r,e,t,n,i){var o=r.getStoreFieldName(t),a=Ye(o),s=t.variables||n.variables,c=n.store,u=c.getFieldValue,f=c.toReference,l=c.canRead;return{args:Yi(t),field:t.field||null,fieldName:a,storeFieldName:o,variables:s,isReference:X,toReference:f,storage:i,cache:r.cache,canRead:l,readField:function(p,v){var b=typeof p=="string"?{fieldName:p,from:v}:w({},p);return b.from===void 0&&(b.from=e),b.variables===void 0&&(b.variables=s),r.readField(b,n)},mergeObjects:Ls(u)}}function Ls(r){return function(t,n){if(Array.isArray(t)||Array.isArray(n))throw new H(2);if(t&&typeof t=="object"&&n&&typeof n=="object"){var i=r(t,"__typename"),o=r(n,"__typename"),a=i&&o&&i!==o;return a||!Sr(t)||!Sr(n)?n:w(w({},t),n)}return n}}function Ds(r){return function(e,t){return e?t.fieldName+":"+JSON.stringify(Ji(e,r,!1)):t.fieldName}}function Ms(r){var e=new ot(je);return function(t,n){var i;if(n.selectionSet&&n.fragmentMap){var o=e.lookupArray([n.selectionSet,n.fragmentMap]);i=o.aliasMap||(o.aliasMap=qs(n.selectionSet,n.fragmentMap))}var a=n.keyObject=Ji(t,r,!0,i);return n.typename+":"+JSON.stringify(a)}}function qs(r,e){var t=Object.create(null),n=new Set([r]);return n.forEach(function(i){i.selections.forEach(function(o){if(ae(o)){if(o.alias){var a=o.alias.value,s=o.name.value;if(s!==a){var c=t.aliases||(t.aliases=Object.create(null));c[s]=a}}if(o.selectionSet){var u=t.subsets||(t.subsets=Object.create(null));u[o.name.value]=qs(o.selectionSet,e)}}else{var f=Le(o,e);f&&n.add(f.selectionSet)}})}),t}function Ji(r,e,t,n){var i=Object.create(null),o;return e.forEach(function(a){if(Array.isArray(a)){if(typeof o=="string"){var s=n&&n.subsets,c=s&&s[o];i[o]=Ji(r[o],a,t,c)}}else{var u=n&&n.aliases,f=u&&u[a]||a;oe.call(r,f)?i[o=a]=r[f]:(j(!t,3),o=void 0)}}),i}var Gt,Jf,Ns,Cs,Rs,Ps,Zi=N(()=>{"use strict";$();Et();ie();te();xr();mn();Gt=function(r,e){var t=r.__typename,n=r.id,i=r._id;if(typeof t=="string"&&(e&&(e.keyObject=n!==void 0?{id:n}:i!==void 0?{_id:i}:void 0),n===void 0&&(n=i),n!==void 0))return t+":"+(typeof n=="number"||typeof n=="string"?n:JSON.stringify(n))},Jf=function(){},Ns=function(r,e){return e.fieldName},Cs=function(r,e,t){var n=t.mergeObjects;return n(r,e)},Rs=function(r,e){return e},Ps=(function(){function r(e){this.config=e,this.typePolicies=Object.create(null),this.toBeAdded=Object.create(null),this.supertypeMap=new Map,this.fuzzySubtypes=new Map,this.rootIdsByTypename=Object.create(null),this.rootTypenamesById=Object.create(null),this.usingPossibleTypes=!1,this.config=w({dataIdFromObject:Gt},e),this.cache=this.config.cache,this.setRootTypename("Query"),this.setRootTypename("Mutation"),this.setRootTypename("Subscription"),e.possibleTypes&&this.addPossibleTypes(e.possibleTypes),e.typePolicies&&this.addTypePolicies(e.typePolicies)}return r.prototype.identify=function(e,t,n){var i=t&&n?ht(e,t,n):e.__typename;if(i===this.rootTypenamesById.ROOT_QUERY)return["ROOT_QUERY"];for(var o={typename:i,selectionSet:t,fragmentMap:n},a,s=i&&this.getTypePolicy(i),c=s&&s.keyFn||this.config.dataIdFromObject;c;){var u=c(e,o);if(Array.isArray(u))c=Ms(u);else{a=u;break}}return a=a?String(a):void 0,o.keyObject?[a,o.keyObject]:[a]},r.prototype.addTypePolicies=function(e){var t=this;Object.keys(e).forEach(function(n){var i=e[n],o=i.queryType,a=i.mutationType,s=i.subscriptionType,c=ve(i,["queryType","mutationType","subscriptionType"]);o&&t.setRootTypename("Query",n),a&&t.setRootTypename("Mutation",n),s&&t.setRootTypename("Subscription",n),oe.call(t.toBeAdded,n)?t.toBeAdded[n].push(c):t.toBeAdded[n]=[c]})},r.prototype.updateTypePolicy=function(e,t){var n=this,i=this.getTypePolicy(e),o=t.keyFields,a=t.fields;function s(c,u){c.merge=typeof u=="function"?u:u===!0?Cs:u===!1?Rs:c.merge}s(i,t.merge),i.keyFn=o===!1?Jf:Array.isArray(o)?Ms(o):typeof o=="function"?o:i.keyFn,a&&Object.keys(a).forEach(function(c){var u=n.getFieldPolicy(e,c,!0),f=a[c];if(typeof f=="function")u.read=f;else{var l=f.keyArgs,p=f.read,v=f.merge;u.keyFn=l===!1?Ns:Array.isArray(l)?Ds(l):typeof l=="function"?l:u.keyFn,typeof p=="function"&&(u.read=p),s(u,v)}u.read&&u.merge&&(u.keyFn=u.keyFn||Ns)})},r.prototype.setRootTypename=function(e,t){t===void 0&&(t=e);var n="ROOT_"+e.toUpperCase(),i=this.rootTypenamesById[n];t!==i&&(j(!i||i===e,1),i&&delete this.rootIdsByTypename[i],this.rootIdsByTypename[t]=n,this.rootTypenamesById[n]=t)},r.prototype.addPossibleTypes=function(e){var t=this;this.usingPossibleTypes=!0,Object.keys(e).forEach(function(n){t.getSupertypeSet(n,!0),e[n].forEach(function(i){t.getSupertypeSet(i,!0).add(n);var o=i.match(Gi);(!o||o[0]!==i)&&t.fuzzySubtypes.set(i,new RegExp(i))})})},r.prototype.getTypePolicy=function(e){var t=this;if(!oe.call(this.typePolicies,e)){var n=this.typePolicies[e]=Object.create(null);n.fields=Object.create(null);var i=this.supertypeMap.get(e);i&&i.size&&i.forEach(function(a){var s=t.getTypePolicy(a),c=s.fields,u=ve(s,["fields"]);Object.assign(n,u),Object.assign(n.fields,c)})}var o=this.toBeAdded[e];return o&&o.length&&o.splice(0).forEach(function(a){t.updateTypePolicy(e,a)}),this.typePolicies[e]},r.prototype.getFieldPolicy=function(e,t,n){if(e){var i=this.getTypePolicy(e).fields;return i[t]||n&&(i[t]=Object.create(null))}},r.prototype.getSupertypeSet=function(e,t){var n=this.supertypeMap.get(e);return!n&&t&&this.supertypeMap.set(e,n=new Set),n},r.prototype.fragmentMatches=function(e,t,n,i){var o=this;if(!e.typeCondition)return!0;if(!t)return!1;var a=e.typeCondition.name.value;if(t===a)return!0;if(this.usingPossibleTypes&&this.supertypeMap.has(a))for(var s=this.getSupertypeSet(t,!0),c=[s],u=function(b){var y=o.getSupertypeSet(b,!1);y&&y.size&&c.indexOf(y)<0&&c.push(y)},f=!!(n&&this.fuzzySubtypes.size),l=!1,p=0;p<c.length;++p){var v=c[p];if(v.has(a))return s.has(a)||s.add(a),!0;v.forEach(u),f&&p===c.length-1&&vn(e.selectionSet,n,i)&&(f=!1,l=!0,this.fuzzySubtypes.forEach(function(b,y){var _=t.match(b);_&&_[0]===t&&u(y)}))}return!1},r.prototype.hasKeyArgs=function(e,t){var n=this.getFieldPolicy(e,t,!1);return!!(n&&n.keyFn)},r.prototype.getStoreFieldName=function(e){var t=e.typename,n=e.fieldName,i=this.getFieldPolicy(t,n,!1),o,a=i&&i.keyFn;if(a&&t)for(var s={typename:t,fieldName:n,field:e.field||null,variables:e.variables},c=Yi(e);a;){var u=a(c,s);if(Array.isArray(u))a=Ds(u);else{o=u||n;break}}return o===void 0&&(o=e.field?Wr(e.field,e.variables):nr(n,Yi(e))),o===!1?n:n===Ye(o)?o:n+":"+o},r.prototype.readField=function(e,t){var n=e.from;if(n){var i=e.field||e.fieldName;if(i){if(e.typename===void 0){var o=t.store.getFieldValue(n,"__typename");o&&(e.typename=o)}var a=this.getStoreFieldName(e),s=Ye(a),c=t.store.getFieldValue(n,a),u=this.getFieldPolicy(e.typename,s,!1),f=u&&u.read;if(f){var l=Fs(this,n,e,t,t.store.getStorage(X(n)?n.__ref:n,a));return Kt.withValue(this.cache,f,[c,l])}return c}}},r.prototype.getMergeFunction=function(e,t,n){var i=this.getFieldPolicy(e,t,!1),o=i&&i.merge;return!o&&n&&(i=this.getTypePolicy(n),o=i&&i.merge),o},r.prototype.runMergeFunction=function(e,t,n,i,o){var a=n.field,s=n.typename,c=n.merge;return c===Cs?Ls(i.store.getFieldValue)(e,t):c===Rs?t:c(e,t,Fs(this,void 0,{typename:s,fieldName:a.name.value,field:a,variables:i.variables},i,o||Object.create(null)))},r})()});var Zf,Ar,Us=N(()=>{"use strict";$();Et();Ki();dn();te();ws();Ts();zi();mn();Zi();xr();Zf={dataIdFromObject:Gt,addTypename:!0,resultCaching:!0,typePolicies:{}},Ar=(function(r){he(e,r);function e(t){t===void 0&&(t={});var n=r.call(this)||this;return n.watches=new Set,n.typenameDocumentCache=new Map,n.makeVar=Tr,n.txCount=0,n.maybeBroadcastWatch=wt(function(i,o){return n.broadcastWatch.call(n,i,!!o)},{makeCacheKey:function(i){var o=i.optimistic?n.optimisticData:n.data;if(Qt(o)){var a=i.optimistic,s=i.rootId,c=i.variables;return o.makeCacheKey(i.query,i.callback,JSON.stringify({optimistic:a,rootId:s,variables:c}))}}}),n.watchDep=Bt(),n.config=w(w({},Zf),t),n.addTypename=!!n.config.addTypename,n.policies=new Ps({cache:n,dataIdFromObject:n.config.dataIdFromObject,possibleTypes:n.config.possibleTypes,typePolicies:n.config.typePolicies}),n.data=new Vt.Root({policies:n.policies,resultCaching:n.config.resultCaching}),n.optimisticData=n.data,n.storeWriter=new xs(n,n.storeReader=new _s({cache:n,addTypename:n.addTypename})),n}return e.prototype.restore=function(t){return t&&this.data.replace(t),this},e.prototype.extract=function(t){return t===void 0&&(t=!1),(t?this.optimisticData:this.data).extract()},e.prototype.read=function(t){var n=t.returnPartialData,i=n===void 0?!1:n;try{return this.storeReader.diffQueryAgainstStore({store:t.optimistic?this.optimisticData:this.data,query:t.query,variables:t.variables,rootId:t.rootId,config:this.config,returnPartialData:i}).result||null}catch(o){if(o instanceof St)return null;throw o}},e.prototype.write=function(t){try{return++this.txCount,this.storeWriter.writeToStore({store:this.data,query:t.query,result:t.result,dataId:t.dataId,variables:t.variables})}finally{!--this.txCount&&t.broadcast!==!1&&this.broadcastWatches()}},e.prototype.modify=function(t){if(oe.call(t,"id")&&!t.id)return!1;var n=t.optimistic?this.optimisticData:this.data;try{return++this.txCount,n.modify(t.id||"ROOT_QUERY",t.fields)}finally{!--this.txCount&&t.broadcast!==!1&&this.broadcastWatches()}},e.prototype.diff=function(t){return this.storeReader.diffQueryAgainstStore({store:t.optimistic?this.optimisticData:this.data,rootId:t.id||"ROOT_QUERY",query:t.query,variables:t.variables,returnPartialData:t.returnPartialData,config:this.config})},e.prototype.watch=function(t){var n=this;return this.watches.size||Is(this),this.watches.add(t),t.immediate&&this.maybeBroadcastWatch(t),function(){n.watches.delete(t)&&!n.watches.size&&ks(n),n.watchDep.dirty(t),n.maybeBroadcastWatch.forget(t)}},e.prototype.gc=function(){return this.optimisticData.gc()},e.prototype.retain=function(t,n){return(n?this.optimisticData:this.data).retain(t)},e.prototype.release=function(t,n){return(n?this.optimisticData:this.data).release(t)},e.prototype.identify=function(t){return X(t)?t.__ref:this.policies.identify(t)[0]},e.prototype.evict=function(t){if(!t.id){if(oe.call(t,"id"))return!1;t=w(w({},t),{id:"ROOT_QUERY"})}try{return++this.txCount,this.optimisticData.evict(t)}finally{!--this.txCount&&t.broadcast!==!1&&this.broadcastWatches()}},e.prototype.reset=function(){return this.data.clear(),this.optimisticData=this.data,this.broadcastWatches(),Promise.resolve()},e.prototype.removeOptimistic=function(t){var n=this.optimisticData.removeLayer(t);n!==this.optimisticData&&(this.optimisticData=n,this.broadcastWatches())},e.prototype.performTransaction=function(t,n){var i=this,o=function(s){var c=i,u=c.data,f=c.optimisticData;++i.txCount,s&&(i.data=i.optimisticData=s);try{t(i)}finally{--i.txCount,i.data=u,i.optimisticData=f}},a=!1;typeof n=="string"?(this.optimisticData=this.optimisticData.addLayer(n,o),a=!0):n===null?o(this.data):o(),this.broadcastWatches(a)},e.prototype.transformDocument=function(t){if(this.addTypename){var n=this.typenameDocumentCache.get(t);return n||(n=dt(t),this.typenameDocumentCache.set(t,n),this.typenameDocumentCache.set(n,n)),n}return t},e.prototype.broadcastWatches=function(t){var n=this;this.txCount||this.watches.forEach(function(i){return n.maybeBroadcastWatch(i,t)})},e.prototype.broadcastWatch=function(t,n){this.watchDep.dirty(t),this.watchDep(t);var i=this.diff({query:t.query,variables:t.variables,optimistic:t.optimistic});t.optimistic&&n&&(i.fromOptimisticTransaction=!0),t.callback(i)},e})(wr)});var $i=N(()=>{"use strict"});var Xi=N(()=>{"use strict";Ki();vs();dn();Us();mn();Zi();$i()});var gn,eo=N(()=>{"use strict";$();Ze();ie();te();Xi();gn=(function(){function r(e){var t=e.cache,n=e.client,i=e.resolvers,o=e.fragmentMatcher;this.cache=t,n&&(this.client=n),i&&this.addResolvers(i),o&&this.setFragmentMatcher(o)}return r.prototype.addResolvers=function(e){var t=this;this.resolvers=this.resolvers||{},Array.isArray(e)?e.forEach(function(n){t.resolvers=vt(t.resolvers,n)}):this.resolvers=vt(this.resolvers,e)},r.prototype.setResolvers=function(e){this.resolvers={},this.addResolvers(e)},r.prototype.getResolvers=function(){return this.resolvers||{}},r.prototype.runResolvers=function(e){var t=e.document,n=e.remoteResult,i=e.context,o=e.variables,a=e.onlyRunForcedResolvers,s=a===void 0?!1:a;return Re(this,void 0,void 0,function(){return Fe(this,function(c){return t?[2,this.resolveDocument(t,n.data,i,o,this.fragmentMatcher,s).then(function(u){return w(w({},n),{data:u.result})})]:[2,n]})})},r.prototype.setFragmentMatcher=function(e){this.fragmentMatcher=e},r.prototype.getFragmentMatcher=function(){return this.fragmentMatcher},r.prototype.clientQuery=function(e){return $e(["client"],e)&&this.resolvers?e:null},r.prototype.serverQuery=function(e){return Xr(e)},r.prototype.prepareContext=function(e){var t=this.cache;return w(w({},e),{cache:t,getCacheKey:function(n){return t.identify(n)}})},r.prototype.addExportedVariables=function(e,t,n){return t===void 0&&(t={}),n===void 0&&(n={}),Re(this,void 0,void 0,function(){return Fe(this,function(i){return e?[2,this.resolveDocument(e,this.buildRootValueFromCache(e,t)||{},this.prepareContext(n),t).then(function(o){return w(w({},t),o.exportedVariables)})]:[2,w({},t)]})})},r.prototype.shouldForceResolvers=function(e){var t=!1;return we(e,{Directive:{enter:function(n){if(n.name.value==="client"&&n.arguments&&(t=n.arguments.some(function(i){return i.name.value==="always"&&i.value.kind==="BooleanValue"&&i.value.value===!0}),t))return Bo}}}),t},r.prototype.buildRootValueFromCache=function(e,t){return this.cache.diff({query:$r(e),variables:t,returnPartialData:!0,optimistic:!1}).result},r.prototype.resolveDocument=function(e,t,n,i,o,a){return n===void 0&&(n={}),i===void 0&&(i={}),o===void 0&&(o=function(){return!0}),a===void 0&&(a=!1),Re(this,void 0,void 0,function(){var s,c,u,f,l,p,v,b,y;return Fe(this,function(_){return s=et(e),c=qe(e),u=Pe(c),f=s.operation,l=f?f.charAt(0).toUpperCase()+f.slice(1):"Query",p=this,v=p.cache,b=p.client,y={fragmentMap:u,context:w(w({},n),{cache:v,client:b}),variables:i,fragmentMatcher:o,defaultOperationType:l,exportedVariables:{},onlyRunForcedResolvers:a},[2,this.resolveSelectionSet(s.selectionSet,t,y).then(function(T){return{result:T,exportedVariables:y.exportedVariables}})]})})},r.prototype.resolveSelectionSet=function(e,t,n){return Re(this,void 0,void 0,function(){var i,o,a,s,c,u=this;return Fe(this,function(f){return i=n.fragmentMap,o=n.context,a=n.variables,s=[t],c=function(l){return Re(u,void 0,void 0,function(){var p,v;return Fe(this,function(b){return Me(l,a)?ae(l)?[2,this.resolveField(l,t,n).then(function(y){var _;typeof y<"u"&&s.push((_={},_[xe(l)]=y,_))})]:(Nt(l)?p=l:(p=i[l.name.value],j(p,11)),p&&p.typeCondition&&(v=p.typeCondition.name.value,n.fragmentMatcher(t,v,o))?[2,this.resolveSelectionSet(p.selectionSet,t,n).then(function(y){s.push(y)})]:[2]):[2]})})},[2,Promise.all(e.selections.map(c)).then(function(){return Ct(s)})]})})},r.prototype.resolveField=function(e,t,n){return Re(this,void 0,void 0,function(){var i,o,a,s,c,u,f,l,p,v=this;return Fe(this,function(b){return i=n.variables,o=e.name.value,a=xe(e),s=o!==a,c=t[a]||t[o],u=Promise.resolve(c),(!n.onlyRunForcedResolvers||this.shouldForceResolvers(e))&&(f=t.__typename||n.defaultOperationType,l=this.resolvers&&this.resolvers[f],l&&(p=l[s?o:a],p&&(u=Promise.resolve(Kt.withValue(this.cache,p,[t,It(e,i),n.context,{field:e,fragmentMap:n.fragmentMap}]))))),[2,u.then(function(y){if(y===void 0&&(y=c),e.directives&&e.directives.forEach(function(_){_.name.value==="export"&&_.arguments&&_.arguments.forEach(function(T){T.name.value==="as"&&T.value.kind==="StringValue"&&(n.exportedVariables[T.value.value]=y)})}),!e.selectionSet||y==null)return y;if(Array.isArray(y))return v.resolveSubSelectedArray(e,y,n);if(e.selectionSet)return v.resolveSelectionSet(e.selectionSet,y,n)})]})})},r.prototype.resolveSubSelectedArray=function(e,t,n){var i=this;return Promise.all(t.map(function(o){if(o===null)return null;if(Array.isArray(o))return i.resolveSubSelectedArray(e,o,n);if(e.selectionSet)return i.resolveSelectionSet(e.selectionSet,o,n)}))},r})()});function to(r,e){var t=r[e];typeof t=="function"&&(r[e]=function(){return Wt.set(r,(Wt.get(r)+1)%1e15),t.apply(this,arguments)})}function js(r){r.notifyTimeout&&(clearTimeout(r.notifyTimeout),r.notifyTimeout=void 0)}function bn(r,e){e===void 0&&(e="none");var t=e==="ignore"||e==="all",n=!mt(r);return!n&&t&&r.data&&(n=!0),n}var Wt,ro,Bs=N(()=>{"use strict";Lt();te();qt();Wt=new(je?WeakMap:Map);ro=(function(){function r(e){this.cache=e,this.listeners=new Set,this.document=null,this.lastRequestId=1,this.subscriptions=new Set,this.stopped=!1,this.dirty=!1,this.diff=null,this.observableQuery=null,Wt.has(e)||(Wt.set(e,0),to(e,"evict"),to(e,"modify"),to(e,"reset"))}return r.prototype.init=function(e){var t=e.networkStatus||ee.loading;return this.variables&&this.networkStatus!==ee.loading&&!ye(this.variables,e.variables)&&(t=ee.setVariables),ye(e.variables,this.variables)||(this.diff=null),Object.assign(this,{document:e.document,variables:e.variables,networkError:null,graphQLErrors:this.graphQLErrors||[],networkStatus:t}),e.observableQuery&&this.setObservableQuery(e.observableQuery),e.lastRequestId&&(this.lastRequestId=e.lastRequestId),this},r.prototype.reset=function(){js(this),this.diff=null,this.dirty=!1},r.prototype.getDiff=function(e){return e===void 0&&(e=this.variables),this.diff&&ye(e,this.variables)?this.diff:(this.updateWatch(this.variables=e),this.diff=this.cache.diff({query:this.document,variables:e,returnPartialData:!0,optimistic:!0}))},r.prototype.setDiff=function(e){var t=this,n=this.diff;this.diff=e,!this.dirty&&(e&&e.result)!==(n&&n.result)&&(this.dirty=!0,this.notifyTimeout||(this.notifyTimeout=setTimeout(function(){return t.notify()},0)))},r.prototype.setObservableQuery=function(e){var t=this;e!==this.observableQuery&&(this.oqListener&&this.listeners.delete(this.oqListener),this.observableQuery=e,e?(e.queryInfo=this,this.listeners.add(this.oqListener=function(){t.getDiff().fromOptimisticTransaction?e.observe():e.reobserve()})):delete this.oqListener)},r.prototype.notify=function(){var e=this;js(this),this.shouldNotify()&&this.listeners.forEach(function(t){return t(e)}),this.dirty=!1},r.prototype.shouldNotify=function(){if(!this.dirty||!this.listeners.size)return!1;if(it(this.networkStatus)&&this.observableQuery){var e=this.observableQuery.options.fetchPolicy;if(e!=="cache-only"&&e!=="cache-and-network")return!1}return!0},r.prototype.stop=function(){if(!this.stopped){this.stopped=!0,this.reset(),this.cancel(),delete this.cancel,this.subscriptions.forEach(function(t){return t.unsubscribe()});var e=this.observableQuery;e&&e.stopPolling()}},r.prototype.cancel=function(){},r.prototype.updateWatch=function(e){var t=this;e===void 0&&(e=this.variables);var n=this.observableQuery;n&&n.options.fetchPolicy==="no-cache"||(!this.lastWatch||this.lastWatch.query!==this.document||!ye(e,this.lastWatch.variables))&&(this.cancel(),this.cancel=this.cache.watch(this.lastWatch={query:this.document,variables:e,optimistic:!0,callback:function(i){return t.setDiff(i)}}))},r.prototype.shouldWrite=function(e,t){var n=this.lastWrite;return!(n&&n.dmCount===Wt.get(this.cache)&&ye(t,n.variables)&&ye(e.data,n.result.data))},r.prototype.markResult=function(e,t,n){var i=this;this.graphQLErrors=Ue(e.errors)?e.errors:[],this.reset(),t.fetchPolicy==="no-cache"?this.diff={result:e.data,complete:!0}:!this.stopped&&n&&(bn(e,t.errorPolicy)?this.cache.performTransaction(function(o){if(i.shouldWrite(e,t.variables))o.writeQuery({query:i.document,data:e.data,variables:t.variables}),i.lastWrite={result:e,variables:t.variables,dmCount:Wt.get(i.cache)};else if(i.diff&&i.diff.complete){e.data=i.diff.result;return}var a=o.diff({query:i.document,variables:t.variables,returnPartialData:!0,optimistic:!0});i.stopped||i.updateWatch(t.variables),i.diff=a,a.complete&&(e.data=a.result)}):this.lastWrite=void 0)},r.prototype.markReady=function(){return this.networkError=null,this.networkStatus=ee.ready},r.prototype.markError=function(e){return this.networkStatus=ee.error,this.lastWrite=void 0,this.reset(),e.graphQLErrors&&(this.graphQLErrors=e.graphQLErrors),e.networkError&&(this.networkError=e.networkError),e},r})()});var $f,Vs,Qs=N(()=>{"use strict";$();ie();Lt();_t();te();Mi();Pi();qt();eo();Bs();$f=Object.prototype.hasOwnProperty,Vs=(function(){function r(e){var t=e.cache,n=e.link,i=e.queryDeduplication,o=i===void 0?!1:i,a=e.onBroadcast,s=e.ssrMode,c=s===void 0?!1:s,u=e.clientAwareness,f=u===void 0?{}:u,l=e.localState,p=e.assumeImmutableResults;this.clientAwareness={},this.queries=new Map,this.fetchCancelFns=new Map,this.transformCache=new(je?WeakMap:Map),this.queryIdCounter=1,this.requestIdCounter=1,this.mutationIdCounter=1,this.inFlightLinkObservables=new Map,this.cache=t,this.link=n,this.queryDeduplication=o,this.clientAwareness=f,this.localState=l||new gn({cache:t}),this.ssrMode=c,this.assumeImmutableResults=!!p,(this.onBroadcast=a)&&(this.mutationStore=Object.create(null))}return r.prototype.stop=function(){var e=this;this.queries.forEach(function(t,n){e.stopQueryNoBroadcast(n)}),this.cancelPendingFetches(new H(12))},r.prototype.cancelPendingFetches=function(e){this.fetchCancelFns.forEach(function(t){return t(e)}),this.fetchCancelFns.clear()},r.prototype.mutate=function(e){var t=e.mutation,n=e.variables,i=e.optimisticResponse,o=e.updateQueries,a=e.refetchQueries,s=a===void 0?[]:a,c=e.awaitRefetchQueries,u=c===void 0?!1:c,f=e.update,l=e.errorPolicy,p=l===void 0?"none":l,v=e.fetchPolicy,b=e.context,y=b===void 0?{}:b;return Re(this,void 0,void 0,function(){var _,T,k;return Fe(this,function(I){switch(I.label){case 0:return j(t,13),j(!v||v==="no-cache",14),_=this.generateMutationId(),t=this.transform(t).document,n=this.getVariables(t,n),this.transform(t).hasClientExports?[4,this.localState.addExportedVariables(t,n,y)]:[3,2];case 1:n=I.sent(),I.label=2;case 2:return T=this.mutationStore&&(this.mutationStore[_]={mutation:t,variables:n,loading:!0,error:null}),i&&this.markMutationOptimistic(i,{mutationId:_,document:t,variables:n,errorPolicy:p,updateQueries:o,update:f}),this.broadcastQueries(),k=this,[2,new Promise(function(D,C){var F,q;k.getObservableFromLink(t,w(w({},y),{optimisticResponse:i}),n,!1).subscribe({next:function(O){if(mt(O)&&p==="none"){q=new ze({graphQLErrors:O.errors});return}if(T&&(T.loading=!1,T.error=null),v!=="no-cache")try{k.markMutationResult({mutationId:_,result:O,document:t,variables:n,errorPolicy:p,updateQueries:o,update:f})}catch(M){q=new ze({networkError:M});return}F=O},error:function(O){T&&(T.loading=!1,T.error=O),i&&k.cache.removeOptimistic(_),k.broadcastQueries(),C(new ze({networkError:O}))},complete:function(){if(q&&T&&(T.loading=!1,T.error=q),i&&k.cache.removeOptimistic(_),k.broadcastQueries(),q){C(q);return}typeof s=="function"&&(s=s(F));var O=[];Ue(s)&&s.forEach(function(M){if(typeof M=="string")k.queries.forEach(function(h){var d=h.observableQuery;d&&d.hasObservers()&&d.queryName===M&&O.push(d.refetch())});else{var U={query:M.query,variables:M.variables,fetchPolicy:"network-only"};M.context&&(U.context=M.context),O.push(k.query(U))}}),Promise.all(u?O:[]).then(function(){p==="ignore"&&F&&mt(F)&&delete F.errors,D(F)},C)}})})]}})})},r.prototype.markMutationResult=function(e,t){var n=this;if(t===void 0&&(t=this.cache),bn(e.result,e.errorPolicy)){var i=[{result:e.result.data,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}],o=e.updateQueries;o&&this.queries.forEach(function(a,s){var c=a.observableQuery,u=c&&c.queryName;if(!(!u||!$f.call(o,u))){var f=o[u],l=n.queries.get(s),p=l.document,v=l.variables,b=t.diff({query:p,variables:v,returnPartialData:!0,optimistic:!1}),y=b.result,_=b.complete;if(_&&y){var T=f(y,{mutationResult:e.result,queryName:p&&pt(p)||void 0,queryVariables:v});T&&i.push({result:T,dataId:"ROOT_QUERY",query:p,variables:v})}}}),t.performTransaction(function(a){i.forEach(function(c){return a.write(c)});var s=e.update;s&&s(a,e.result)},null)}},r.prototype.markMutationOptimistic=function(e,t){var n=this,i=typeof e=="function"?e(t.variables):e;return this.cache.recordOptimisticTransaction(function(o){try{n.markMutationResult(w(w({},t),{result:{data:i}}),o)}catch{}},t.mutationId)},r.prototype.fetchQuery=function(e,t,n){return this.fetchQueryObservable(e,t,n).promise},r.prototype.getQueryStore=function(){var e=Object.create(null);return this.queries.forEach(function(t,n){e[n]={variables:t.variables,networkStatus:t.networkStatus,networkError:t.networkError,graphQLErrors:t.graphQLErrors}}),e},r.prototype.resetErrors=function(e){var t=this.queries.get(e);t&&(t.networkError=void 0,t.graphQLErrors=[])},r.prototype.transform=function(e){var t=this.transformCache;if(!t.has(e)){var n=this.cache.transformDocument(e),i=Zr(this.cache.transformForLink(n)),o=this.localState.clientQuery(n),a=i&&this.localState.serverQuery(i),s={document:n,hasClientExports:Qr(n),hasForcedResolvers:this.localState.shouldForceResolvers(n),clientQuery:o,serverQuery:a,defaultVars:tt(Ce(n))},c=function(u){u&&!t.has(u)&&t.set(u,s)};c(e),c(n),c(o),c(a)}return t.get(e)},r.prototype.getVariables=function(e,t){return w(w({},this.transform(e).defaultVars),t)},r.prototype.watchQuery=function(e){e=w(w({},e),{variables:this.getVariables(e.query,e.variables)}),typeof e.notifyOnNetworkStatusChange>"u"&&(e.notifyOnNetworkStatusChange=!1);var t=new ro(this.cache),n=new br({queryManager:this,queryInfo:t,options:e});return this.queries.set(n.queryId,t),t.init({document:e.query,observableQuery:n,variables:e.variables}),n},r.prototype.query=function(e){var t=this;j(e.query,15),j(e.query.kind==="Document",16),j(!e.returnPartialData,17),j(!e.pollInterval,18);var n=this.generateQueryId();return this.fetchQuery(n,e).finally(function(){return t.stopQuery(n)})},r.prototype.generateQueryId=function(){return String(this.queryIdCounter++)},r.prototype.generateRequestId=function(){return this.requestIdCounter++},r.prototype.generateMutationId=function(){return String(this.mutationIdCounter++)},r.prototype.stopQueryInStore=function(e){this.stopQueryInStoreNoBroadcast(e),this.broadcastQueries()},r.prototype.stopQueryInStoreNoBroadcast=function(e){var t=this.queries.get(e);t&&t.stop()},r.prototype.clearStore=function(){return this.cancelPendingFetches(new H(19)),this.queries.forEach(function(e){e.observableQuery?e.networkStatus=ee.loading:e.stop()}),this.mutationStore&&(this.mutationStore=Object.create(null)),this.cache.reset()},r.prototype.resetStore=function(){var e=this;return this.clearStore().then(function(){return e.reFetchObservableQueries()})},r.prototype.reFetchObservableQueries=function(e){var t=this;e===void 0&&(e=!1);var n=[];return this.queries.forEach(function(i,o){var a=i.observableQuery;if(a&&a.hasObservers()){var s=a.options.fetchPolicy;a.resetLastResults(),s!=="cache-only"&&(e||s!=="standby")&&n.push(a.refetch()),t.getQuery(o).setDiff(null)}}),this.broadcastQueries(),Promise.all(n)},r.prototype.setObservableQuery=function(e){this.getQuery(e.queryId).setObservableQuery(e)},r.prototype.startGraphQLSubscription=function(e){var t=this,n=e.query,i=e.fetchPolicy,o=e.errorPolicy,a=e.variables,s=e.context,c=s===void 0?{}:s;n=this.transform(n).document,a=this.getVariables(n,a);var u=function(l){return t.getObservableFromLink(n,c,l,!1).map(function(p){if(i!=="no-cache"&&(bn(p,o)&&t.cache.write({query:n,result:p.data,dataId:"ROOT_SUBSCRIPTION",variables:l}),t.broadcastQueries()),mt(p))throw new ze({graphQLErrors:p.errors});return p})};if(this.transform(n).hasClientExports){var f=this.localState.addExportedVariables(n,a,c).then(u);return new B.default(function(l){var p=null;return f.then(function(v){return p=v.subscribe(l)},l.error),function(){return p&&p.unsubscribe()}})}return u(a)},r.prototype.stopQuery=function(e){this.stopQueryNoBroadcast(e),this.broadcastQueries()},r.prototype.stopQueryNoBroadcast=function(e){this.stopQueryInStoreNoBroadcast(e),this.removeQuery(e)},r.prototype.removeQuery=function(e){this.fetchCancelFns.delete(e),this.getQuery(e).stop(),this.queries.delete(e)},r.prototype.broadcastQueries=function(){this.onBroadcast&&this.onBroadcast(),this.queries.forEach(function(e){return e.notify()})},r.prototype.getLocalState=function(){return this.localState},r.prototype.getObservableFromLink=function(e,t,n,i){var o=this,a;i===void 0&&(i=(a=t?.queryDeduplication)!==null&&a!==void 0?a:this.queryDeduplication);var s,c=this.transform(e).serverQuery;if(c){var u=this,f=u.inFlightLinkObservables,l=u.link,p={query:c,variables:n,operationName:pt(c)||void 0,context:this.prepareContext(w(w({},t),{forceFetch:!i}))};if(t=p.context,i){var v=f.get(c)||new Map;f.set(c,v);var b=JSON.stringify(n);if(s=v.get(b),!s){var y=new yt([bt(l,p)]);v.set(b,s=y),y.cleanup(function(){v.delete(b)&&v.size<1&&f.delete(c)})}}else s=new yt([bt(l,p)])}else s=new yt([B.default.of({data:{}})]),t=this.prepareContext(t);var _=this.transform(e).clientQuery;return _&&(s=an(s,function(T){return o.localState.runResolvers({document:_,remoteResult:T,context:t,variables:n})})),s},r.prototype.getResultsFromLink=function(e,t,n){var i=e.lastRequestId=this.generateRequestId();return an(this.getObservableFromLink(e.document,n.context,n.variables),function(o){var a=Ue(o.errors);if(i>=e.lastRequestId){if(a&&n.errorPolicy==="none")throw e.markError(new ze({graphQLErrors:o.errors}));e.markResult(o,n,t),e.markReady()}var s={data:o.data,loading:!1,networkStatus:e.networkStatus||ee.ready};return a&&n.errorPolicy!=="ignore"&&(s.errors=o.errors),s},function(o){var a=fn(o)?o:new ze({networkError:o});throw i>=e.lastRequestId&&e.markError(a),a})},r.prototype.fetchQueryObservable=function(e,t,n){var i=this;n===void 0&&(n=ee.loading);var o=this.transform(t.query).document,a=this.getVariables(o,t.variables),s=this.getQuery(e),c=s.networkStatus,u=t.fetchPolicy,f=u===void 0?"cache-first":u,l=t.errorPolicy,p=l===void 0?"none":l,v=t.returnPartialData,b=v===void 0?!1:v,y=t.notifyOnNetworkStatusChange,_=y===void 0?!1:y,T=t.context,k=T===void 0?{}:T,I=f==="cache-first"||f==="cache-and-network"||f==="network-only"||f==="no-cache";I&&_&&typeof c=="number"&&c!==n&&it(n)&&(f!=="cache-first"&&(f="cache-and-network"),b=!0);var D=Object.assign({},t,{query:o,variables:a,fetchPolicy:f,errorPolicy:p,returnPartialData:b,notifyOnNetworkStatusChange:_,context:k}),C=function(q){return D.variables=q,i.fetchQueryByPolicy(s,D,n)};this.fetchCancelFns.set(e,function(q){Promise.resolve().then(function(){return F.cancel(q)})});var F=new yt(this.transform(D.query).hasClientExports?this.localState.addExportedVariables(D.query,D.variables,D.context).then(C):C(D.variables));return F.cleanup(function(){i.fetchCancelFns.delete(e);var q=t.nextFetchPolicy;q&&(t.nextFetchPolicy=void 0,t.fetchPolicy=typeof q=="function"?q.call(t,t.fetchPolicy||"cache-first"):q)}),F},r.prototype.fetchQueryByPolicy=function(e,t,n){var i=this,o=t.query,a=t.variables,s=t.fetchPolicy,c=t.errorPolicy,u=t.returnPartialData,f=t.context;e.init({document:o,variables:a,networkStatus:n});var l=function(){return e.getDiff(a)},p=function(y,_){_===void 0&&(_=e.networkStatus||ee.loading);var T=y.result,k=function(I){return B.default.of(w({data:I,loading:it(_),networkStatus:_},y.complete?null:{partial:!0}))};return i.transform(o).hasForcedResolvers?i.localState.runResolvers({document:o,remoteResult:{data:T},context:f,variables:a,onlyRunForcedResolvers:!0}).then(function(I){return k(I.data)}):k(T)},v=function(y){return i.getResultsFromLink(e,y,{variables:a,context:f,fetchPolicy:s,errorPolicy:c})};switch(s){default:case"cache-first":{var b=l();return b.complete?[p(b,e.markReady())]:u?[p(b),v(!0)]:[v(!0)]}case"cache-and-network":{var b=l();return b.complete||u?[p(b),v(!0)]:[v(!0)]}case"cache-only":return[p(l(),e.markReady())];case"network-only":return[v(!0)];case"no-cache":return[v(!1)];case"standby":return[]}},r.prototype.getQuery=function(e){return e&&!this.queries.has(e)&&this.queries.set(e,new ro(this.cache)),this.queries.get(e)},r.prototype.prepareContext=function(e){e===void 0&&(e={});var t=this.localState.prepareContext(e);return w(w({},t),{clientAwareness:this.clientAwareness})},r})()});function kr(r,e){return sr(r,e,e.variables&&{variables:w(w({},r.variables),e.variables)})}var Xf,_n,Ks=N(()=>{"use strict";$();ie();_t();te();Wa();cn();Qs();eo();Xf=!1;_n=(function(){function r(e){var t=this;this.defaultOptions={},this.resetStoreCallbacks=[],this.clearStoreCallbacks=[];var n=e.uri,i=e.credentials,o=e.headers,a=e.cache,s=e.ssrMode,c=s===void 0?!1:s,u=e.ssrForceFetchDelay,f=u===void 0?0:u,l=e.connectToDevTools,p=l===void 0?typeof window=="object"&&!window.__APOLLO_CLIENT__&&!1:l,v=e.queryDeduplication,b=v===void 0?!0:v,y=e.defaultOptions,_=e.assumeImmutableResults,T=_===void 0?!1:_,k=e.resolvers,I=e.typeDefs,D=e.fragmentMatcher,C=e.name,F=e.version,q=e.link;if(q||(q=n?new gr({uri:n,credentials:i,headers:o}):re.empty()),!a)throw new H(9);if(this.link=q,this.cache=a,this.disableNetworkFetches=c||f>0,this.queryDeduplication=b,this.defaultOptions=y||{},this.typeDefs=I,f&&setTimeout(function(){return t.disableNetworkFetches=!1},f),this.watchQuery=this.watchQuery.bind(this),this.query=this.query.bind(this),this.mutate=this.mutate.bind(this),this.resetStore=this.resetStore.bind(this),this.reFetchObservableQueries=this.reFetchObservableQueries.bind(this),p&&typeof window=="object"&&(window.__APOLLO_CLIENT__=this),!Xf&&!1&&typeof window<"u"&&window.document&&window.top===window.self&&!window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__)var O,M,U;this.version=Ga,this.localState=new gn({cache:a,client:this,resolvers:k,fragmentMatcher:D}),this.queryManager=new Vs({cache:this.cache,link:this.link,queryDeduplication:b,ssrMode:c,clientAwareness:{name:C,version:F},localState:this.localState,assumeImmutableResults:T,onBroadcast:p?function(){t.devToolsHookCb&&t.devToolsHookCb({action:{},state:{queries:t.queryManager.getQueryStore(),mutations:t.queryManager.mutationStore||{}},dataWithOptimisticResults:t.cache.extract(!0)})}:void 0})}return r.prototype.stop=function(){this.queryManager.stop()},r.prototype.watchQuery=function(e){return this.defaultOptions.watchQuery&&(e=kr(this.defaultOptions.watchQuery,e)),this.disableNetworkFetches&&(e.fetchPolicy==="network-only"||e.fetchPolicy==="cache-and-network")&&(e=w(w({},e),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(e)},r.prototype.query=function(e){return this.defaultOptions.query&&(e=kr(this.defaultOptions.query,e)),j(e.fetchPolicy!=="cache-and-network",10),this.disableNetworkFetches&&e.fetchPolicy==="network-only"&&(e=w(w({},e),{fetchPolicy:"cache-first"})),this.queryManager.query(e)},r.prototype.mutate=function(e){return this.defaultOptions.mutate&&(e=kr(this.defaultOptions.mutate,e)),this.queryManager.mutate(e)},r.prototype.subscribe=function(e){return this.queryManager.startGraphQLSubscription(e)},r.prototype.readQuery=function(e,t){return t===void 0&&(t=!1),this.cache.readQuery(e,t)},r.prototype.readFragment=function(e,t){return t===void 0&&(t=!1),this.cache.readFragment(e,t)},r.prototype.writeQuery=function(e){this.cache.writeQuery(e),this.queryManager.broadcastQueries()},r.prototype.writeFragment=function(e){this.cache.writeFragment(e),this.queryManager.broadcastQueries()},r.prototype.__actionHookForDevTools=function(e){this.devToolsHookCb=e},r.prototype.__requestRaw=function(e){return bt(this.link,e)},r.prototype.resetStore=function(){var e=this;return Promise.resolve().then(function(){return e.queryManager.clearStore()}).then(function(){return Promise.all(e.resetStoreCallbacks.map(function(t){return t()}))}).then(function(){return e.reFetchObservableQueries()})},r.prototype.clearStore=function(){var e=this;return Promise.resolve().then(function(){return e.queryManager.clearStore()}).then(function(){return Promise.all(e.clearStoreCallbacks.map(function(t){return t()}))})},r.prototype.onResetStore=function(e){var t=this;return this.resetStoreCallbacks.push(e),function(){t.resetStoreCallbacks=t.resetStoreCallbacks.filter(function(n){return n!==e})}},r.prototype.onClearStore=function(e){var t=this;return this.clearStoreCallbacks.push(e),function(){t.clearStoreCallbacks=t.clearStoreCallbacks.filter(function(n){return n!==e})}},r.prototype.reFetchObservableQueries=function(e){return this.queryManager.reFetchObservableQueries(e)},r.prototype.extract=function(e){return this.cache.extract(e)},r.prototype.restore=function(e){return this.cache.restore(e)},r.prototype.addResolvers=function(e){this.localState.addResolvers(e)},r.prototype.setResolvers=function(e){this.localState.setResolvers(e)},r.prototype.getResolvers=function(){return this.localState.getResolvers()},r.prototype.setLocalStateFragmentMatcher=function(e){this.localState.setFragmentMatcher(e)},r.prototype.setLink=function(e){this.link=this.queryManager.link=e},r})()});var Gs=N(()=>{"use strict"});function Hs(r){return r.replace(/[\s,]+/g," ").trim()}function el(r){return Hs(r.source.body.substring(r.start,r.end))}function tl(r){var e=new Set,t=[];return r.definitions.forEach(function(n){if(n.kind==="FragmentDefinition"){var i=n.name.value,o=el(n.loc),a=no.get(i);a&&!a.has(o)?Ws&&console.warn("Warning: fragment with name "+i+` already exists.
graphql-tag enforces all fragment names across your application to be unique; read more about
this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`):a||no.set(i,a=new Set),a.add(o),e.has(o)||(e.add(o),t.push(n))}else t.push(n)}),Kn(Kn({},r),{definitions:t})}function rl(r){var e=new Set(r.definitions);e.forEach(function(n){n.loc&&delete n.loc,Object.keys(n).forEach(function(i){var o=n[i];o&&typeof o=="object"&&e.add(o)})});var t=r.loc;return t&&(delete t.startToken,delete t.endToken),r}function nl(r){var e=Hs(r);if(!wn.has(e)){var t=Br(r,{experimentalFragmentVariables:En,allowLegacyFragmentVariables:En});if(!t||t.kind!=="Document")throw new Error("Not a valid GraphQL document.");wn.set(e,rl(tl(t)))}return wn.get(e)}function Ht(r){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];typeof r=="string"&&(r=[r]);var n=r[0];return e.forEach(function(i,o){i&&i.kind==="Document"?n+=i.loc.source.body:n+=i,n+=r[o+1]}),nl(n)}function io(){wn.clear(),no.clear()}function oo(){Ws=!1}function ao(){En=!0}function so(){En=!1}var wn,no,Ws,En,Ir,zs,Ys=N(()=>{"use strict";jo();Ze();wn=new Map,no=new Map,Ws=!0,En=!1;Ir={gql:Ht,resetCaches:io,disableFragmentWarnings:oo,enableExperimentalFragmentVariables:ao,disableExperimentalFragmentVariables:so};(function(r){r.gql=Ir.gql,r.resetCaches=Ir.resetCaches,r.disableFragmentWarnings=Ir.disableFragmentWarnings,r.enableExperimentalFragmentVariables=Ir.enableExperimentalFragmentVariables,r.disableExperimentalFragmentVariables=Ir.disableExperimentalFragmentVariables})(Ht||(Ht={}));Ht.default=Ht;zs=Ht});var zt={};lt(zt,{ApolloCache:()=>wr,ApolloClient:()=>_n,ApolloError:()=>ze,ApolloLink:()=>re,Cache:()=>Er,HttpLink:()=>gr,InMemoryCache:()=>Ar,MissingFieldError:()=>St,NetworkStatus:()=>ee,Observable:()=>B.default,ObservableQuery:()=>br,checkFetcher:()=>pr,concat:()=>Ba,createHttpLink:()=>mr,createSignalIfSupported:()=>dr,defaultDataIdFromObject:()=>Gt,disableExperimentalFragmentVariables:()=>so,disableFragmentWarnings:()=>oo,empty:()=>Ma,enableExperimentalFragmentVariables:()=>ao,execute:()=>bt,fallbackHttpConfig:()=>lr,from:()=>La,fromError:()=>Mt,fromPromise:()=>Ei,gql:()=>zs,isApolloError:()=>fn,isReference:()=>X,makeReference:()=>Ee,makeVar:()=>Tr,mergeOptions:()=>kr,parseAndCheckHttpResponse:()=>fr,resetCaches:()=>io,rewriteURIForGET:()=>yr,selectHttpOptionsAndBody:()=>hr,selectURI:()=>vr,serializeFetchParameter:()=>nt,setLogVerbosity:()=>Zn,split:()=>Ua,throwServerError:()=>Pt,toPromise:()=>wi});var xt=N(()=>{"use strict";Ks();Pi();qt();Gs();Mi();Xi();$i();_t();cn();ur();te();ie();Ys();Zn("log")});var $s=Q(Sn=>{"use strict";Sn.byteLength=ol;Sn.toByteArray=sl;Sn.fromByteArray=fl;var Be=[],Oe=[],il=typeof Uint8Array<"u"?Uint8Array:Array,uo="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Ot=0,Js=uo.length;Ot<Js;++Ot)Be[Ot]=uo[Ot],Oe[uo.charCodeAt(Ot)]=Ot;var Ot,Js;Oe[45]=62;Oe[95]=63;function Zs(r){var e=r.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var t=r.indexOf("=");t===-1&&(t=e);var n=t===e?0:4-t%4;return[t,n]}function ol(r){var e=Zs(r),t=e[0],n=e[1];return(t+n)*3/4-n}function al(r,e,t){return(e+t)*3/4-t}function sl(r){var e,t=Zs(r),n=t[0],i=t[1],o=new il(al(r,n,i)),a=0,s=i>0?n-4:n,c;for(c=0;c<s;c+=4)e=Oe[r.charCodeAt(c)]<<18|Oe[r.charCodeAt(c+1)]<<12|Oe[r.charCodeAt(c+2)]<<6|Oe[r.charCodeAt(c+3)],o[a++]=e>>16&255,o[a++]=e>>8&255,o[a++]=e&255;return i===2&&(e=Oe[r.charCodeAt(c)]<<2|Oe[r.charCodeAt(c+1)]>>4,o[a++]=e&255),i===1&&(e=Oe[r.charCodeAt(c)]<<10|Oe[r.charCodeAt(c+1)]<<4|Oe[r.charCodeAt(c+2)]>>2,o[a++]=e>>8&255,o[a++]=e&255),o}function ul(r){return Be[r>>18&63]+Be[r>>12&63]+Be[r>>6&63]+Be[r&63]}function cl(r,e,t){for(var n,i=[],o=e;o<t;o+=3)n=(r[o]<<16&16711680)+(r[o+1]<<8&65280)+(r[o+2]&255),i.push(ul(n));return i.join("")}function fl(r){for(var e,t=r.length,n=t%3,i=[],o=16383,a=0,s=t-n;a<s;a+=o)i.push(cl(r,a,a+o>s?s:a+o));return n===1?(e=r[t-1],i.push(Be[e>>2]+Be[e<<4&63]+"==")):n===2&&(e=(r[t-2]<<8)+r[t-1],i.push(Be[e>>10]+Be[e>>4&63]+Be[e<<2&63]+"=")),i.join("")}});var Xs=Q(co=>{"use strict";co.read=function(r,e,t,n,i){var o,a,s=i*8-n-1,c=(1<<s)-1,u=c>>1,f=-7,l=t?i-1:0,p=t?-1:1,v=r[e+l];for(l+=p,o=v&(1<<-f)-1,v>>=-f,f+=s;f>0;o=o*256+r[e+l],l+=p,f-=8);for(a=o&(1<<-f)-1,o>>=-f,f+=n;f>0;a=a*256+r[e+l],l+=p,f-=8);if(o===0)o=1-u;else{if(o===c)return a?NaN:(v?-1:1)*(1/0);a=a+Math.pow(2,n),o=o-u}return(v?-1:1)*a*Math.pow(2,o-n)};co.write=function(r,e,t,n,i,o){var a,s,c,u=o*8-i-1,f=(1<<u)-1,l=f>>1,p=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,v=n?0:o-1,b=n?1:-1,y=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=f):(a=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-a))<1&&(a--,c*=2),a+l>=1?e+=p/c:e+=p*Math.pow(2,1-l),e*c>=2&&(a++,c/=2),a+l>=f?(s=0,a=f):a+l>=1?(s=(e*c-1)*Math.pow(2,i),a=a+l):(s=e*Math.pow(2,l-1)*Math.pow(2,i),a=0));i>=8;r[t+v]=s&255,v+=b,s/=256,i-=8);for(a=a<<i|s,u+=i;u>0;r[t+v]=a&255,v+=b,a/=256,u-=8);r[t+v-b]|=y*128}});var hu=Q(Jt=>{"use strict";var fo=$s(),Yt=Xs(),eu=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Jt.Buffer=E;Jt.SlowBuffer=yl;Jt.INSPECT_MAX_BYTES=50;var xn=2147483647;Jt.kMaxLength=xn;E.TYPED_ARRAY_SUPPORT=ll();!E.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function ll(){try{var r=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(r,e),r.foo()===42}catch{return!1}}Object.defineProperty(E.prototype,"parent",{enumerable:!0,get:function(){if(E.isBuffer(this))return this.buffer}});Object.defineProperty(E.prototype,"offset",{enumerable:!0,get:function(){if(E.isBuffer(this))return this.byteOffset}});function Je(r){if(r>xn)throw new RangeError('The value "'+r+'" is invalid for option "size"');var e=new Uint8Array(r);return Object.setPrototypeOf(e,E.prototype),e}function E(r,e,t){if(typeof r=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return vo(r)}return nu(r,e,t)}E.poolSize=8192;function nu(r,e,t){if(typeof r=="string")return pl(r,e);if(ArrayBuffer.isView(r))return dl(r);if(r==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r);if(Ve(r,ArrayBuffer)||r&&Ve(r.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Ve(r,SharedArrayBuffer)||r&&Ve(r.buffer,SharedArrayBuffer)))return ho(r,e,t);if(typeof r=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var n=r.valueOf&&r.valueOf();if(n!=null&&n!==r)return E.from(n,e,t);var i=vl(r);if(i)return i;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof r[Symbol.toPrimitive]=="function")return E.from(r[Symbol.toPrimitive]("string"),e,t);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r)}E.from=function(r,e,t){return nu(r,e,t)};Object.setPrototypeOf(E.prototype,Uint8Array.prototype);Object.setPrototypeOf(E,Uint8Array);function iu(r){if(typeof r!="number")throw new TypeError('"size" argument must be of type number');if(r<0)throw new RangeError('The value "'+r+'" is invalid for option "size"')}function hl(r,e,t){return iu(r),r<=0?Je(r):e!==void 0?typeof t=="string"?Je(r).fill(e,t):Je(r).fill(e):Je(r)}E.alloc=function(r,e,t){return hl(r,e,t)};function vo(r){return iu(r),Je(r<0?0:yo(r)|0)}E.allocUnsafe=function(r){return vo(r)};E.allocUnsafeSlow=function(r){return vo(r)};function pl(r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!E.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var t=ou(r,e)|0,n=Je(t),i=n.write(r,e);return i!==t&&(n=n.slice(0,i)),n}function lo(r){for(var e=r.length<0?0:yo(r.length)|0,t=Je(e),n=0;n<e;n+=1)t[n]=r[n]&255;return t}function dl(r){if(Ve(r,Uint8Array)){var e=new Uint8Array(r);return ho(e.buffer,e.byteOffset,e.byteLength)}return lo(r)}function ho(r,e,t){if(e<0||r.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(r.byteLength<e+(t||0))throw new RangeError('"length" is outside of buffer bounds');var n;return e===void 0&&t===void 0?n=new Uint8Array(r):t===void 0?n=new Uint8Array(r,e):n=new Uint8Array(r,e,t),Object.setPrototypeOf(n,E.prototype),n}function vl(r){if(E.isBuffer(r)){var e=yo(r.length)|0,t=Je(e);return t.length===0||r.copy(t,0,0,e),t}if(r.length!==void 0)return typeof r.length!="number"||mo(r.length)?Je(0):lo(r);if(r.type==="Buffer"&&Array.isArray(r.data))return lo(r.data)}function yo(r){if(r>=xn)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+xn.toString(16)+" bytes");return r|0}function yl(r){return+r!=r&&(r=0),E.alloc(+r)}E.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==E.prototype};E.compare=function(e,t){if(Ve(e,Uint8Array)&&(e=E.from(e,e.offset,e.byteLength)),Ve(t,Uint8Array)&&(t=E.from(t,t.offset,t.byteLength)),!E.isBuffer(e)||!E.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var n=e.length,i=t.length,o=0,a=Math.min(n,i);o<a;++o)if(e[o]!==t[o]){n=e[o],i=t[o];break}return n<i?-1:i<n?1:0};E.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};E.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return E.alloc(0);var n;if(t===void 0)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var i=E.allocUnsafe(t),o=0;for(n=0;n<e.length;++n){var a=e[n];if(Ve(a,Uint8Array))o+a.length>i.length?E.from(a).copy(i,o):Uint8Array.prototype.set.call(i,a,o);else if(E.isBuffer(a))a.copy(i,o);else throw new TypeError('"list" argument must be an Array of Buffers');o+=a.length}return i};function ou(r,e){if(E.isBuffer(r))return r.length;if(ArrayBuffer.isView(r)||Ve(r,ArrayBuffer))return r.byteLength;if(typeof r!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof r);var t=r.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&t===0)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":return po(r).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return lu(r).length;default:if(i)return n?-1:po(r).length;e=(""+e).toLowerCase(),i=!0}}E.byteLength=ou;function ml(r,e,t){var n=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)||(t>>>=0,e>>>=0,t<=e))return"";for(r||(r="utf8");;)switch(r){case"hex":return Al(this,e,t);case"utf8":case"utf-8":return su(this,e,t);case"ascii":return Ol(this,e,t);case"latin1":case"binary":return Tl(this,e,t);case"base64":return Sl(this,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return kl(this,e,t);default:if(n)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),n=!0}}E.prototype._isBuffer=!0;function Tt(r,e,t){var n=r[e];r[e]=r[t],r[t]=n}E.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)Tt(this,t,t+1);return this};E.prototype.swap32=function(){var e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)Tt(this,t,t+3),Tt(this,t+1,t+2);return this};E.prototype.swap64=function(){var e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)Tt(this,t,t+7),Tt(this,t+1,t+6),Tt(this,t+2,t+5),Tt(this,t+3,t+4);return this};E.prototype.toString=function(){var e=this.length;return e===0?"":arguments.length===0?su(this,0,e):ml.apply(this,arguments)};E.prototype.toLocaleString=E.prototype.toString;E.prototype.equals=function(e){if(!E.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:E.compare(this,e)===0};E.prototype.inspect=function(){var e="",t=Jt.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),"<Buffer "+e+">"};eu&&(E.prototype[eu]=E.prototype.inspect);E.prototype.compare=function(e,t,n,i,o){if(Ve(e,Uint8Array)&&(e=E.from(e,e.offset,e.byteLength)),!E.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(t===void 0&&(t=0),n===void 0&&(n=e?e.length:0),i===void 0&&(i=0),o===void 0&&(o=this.length),t<0||n>e.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&t>=n)return 0;if(i>=o)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,i>>>=0,o>>>=0,this===e)return 0;for(var a=o-i,s=n-t,c=Math.min(a,s),u=this.slice(i,o),f=e.slice(t,n),l=0;l<c;++l)if(u[l]!==f[l]){a=u[l],s=f[l];break}return a<s?-1:s<a?1:0};function au(r,e,t,n,i){if(r.length===0)return-1;if(typeof t=="string"?(n=t,t=0):t>2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,mo(t)&&(t=i?0:r.length-1),t<0&&(t=r.length+t),t>=r.length){if(i)return-1;t=r.length-1}else if(t<0)if(i)t=0;else return-1;if(typeof e=="string"&&(e=E.from(e,n)),E.isBuffer(e))return e.length===0?-1:tu(r,e,t,n,i);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(r,e,t):Uint8Array.prototype.lastIndexOf.call(r,e,t):tu(r,[e],t,n,i);throw new TypeError("val must be string, number or Buffer")}function tu(r,e,t,n,i){var o=1,a=r.length,s=e.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(r.length<2||e.length<2)return-1;o=2,a/=2,s/=2,t/=2}function c(v,b){return o===1?v[b]:v.readUInt16BE(b*o)}var u;if(i){var f=-1;for(u=t;u<a;u++)if(c(r,u)===c(e,f===-1?0:u-f)){if(f===-1&&(f=u),u-f+1===s)return f*o}else f!==-1&&(u-=u-f),f=-1}else for(t+s>a&&(t=a-s),u=t;u>=0;u--){for(var l=!0,p=0;p<s;p++)if(c(r,u+p)!==c(e,p)){l=!1;break}if(l)return u}return-1}E.prototype.includes=function(e,t,n){return this.indexOf(e,t,n)!==-1};E.prototype.indexOf=function(e,t,n){return au(this,e,t,n,!0)};E.prototype.lastIndexOf=function(e,t,n){return au(this,e,t,n,!1)};function gl(r,e,t,n){t=Number(t)||0;var i=r.length-t;n?(n=Number(n),n>i&&(n=i)):n=i;var o=e.length;n>o/2&&(n=o/2);for(var a=0;a<n;++a){var s=parseInt(e.substr(a*2,2),16);if(mo(s))return a;r[t+a]=s}return a}function bl(r,e,t,n){return On(po(e,r.length-t),r,t,n)}function _l(r,e,t,n){return On(Cl(e),r,t,n)}function wl(r,e,t,n){return On(lu(e),r,t,n)}function El(r,e,t,n){return On(Rl(e,r.length-t),r,t,n)}E.prototype.write=function(e,t,n,i){if(t===void 0)i="utf8",n=this.length,t=0;else if(n===void 0&&typeof t=="string")i=t,n=this.length,t=0;else if(isFinite(t))t=t>>>0,isFinite(n)?(n=n>>>0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var o=this.length-t;if((n===void 0||n>o)&&(n=o),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var a=!1;;)switch(i){case"hex":return gl(this,e,t,n);case"utf8":case"utf-8":return bl(this,e,t,n);case"ascii":case"latin1":case"binary":return _l(this,e,t,n);case"base64":return wl(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return El(this,e,t,n);default:if(a)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),a=!0}};E.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Sl(r,e,t){return e===0&&t===r.length?fo.fromByteArray(r):fo.fromByteArray(r.slice(e,t))}function su(r,e,t){t=Math.min(r.length,t);for(var n=[],i=e;i<t;){var o=r[i],a=null,s=o>239?4:o>223?3:o>191?2:1;if(i+s<=t){var c,u,f,l;switch(s){case 1:o<128&&(a=o);break;case 2:c=r[i+1],(c&192)===128&&(l=(o&31)<<6|c&63,l>127&&(a=l));break;case 3:c=r[i+1],u=r[i+2],(c&192)===128&&(u&192)===128&&(l=(o&15)<<12|(c&63)<<6|u&63,l>2047&&(l<55296||l>57343)&&(a=l));break;case 4:c=r[i+1],u=r[i+2],f=r[i+3],(c&192)===128&&(u&192)===128&&(f&192)===128&&(l=(o&15)<<18|(c&63)<<12|(u&63)<<6|f&63,l>65535&&l<1114112&&(a=l))}}a===null?(a=65533,s=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|a&1023),n.push(a),i+=s}return xl(n)}var ru=4096;function xl(r){var e=r.length;if(e<=ru)return String.fromCharCode.apply(String,r);for(var t="",n=0;n<e;)t+=String.fromCharCode.apply(String,r.slice(n,n+=ru));return t}function Ol(r,e,t){var n="";t=Math.min(r.length,t);for(var i=e;i<t;++i)n+=String.fromCharCode(r[i]&127);return n}function Tl(r,e,t){var n="";t=Math.min(r.length,t);for(var i=e;i<t;++i)n+=String.fromCharCode(r[i]);return n}function Al(r,e,t){var n=r.length;(!e||e<0)&&(e=0),(!t||t<0||t>n)&&(t=n);for(var i="",o=e;o<t;++o)i+=Fl[r[o]];return i}function kl(r,e,t){for(var n=r.slice(e,t),i="",o=0;o<n.length-1;o+=2)i+=String.fromCharCode(n[o]+n[o+1]*256);return i}E.prototype.slice=function(e,t){var n=this.length;e=~~e,t=t===void 0?n:~~t,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),t<e&&(t=e);var i=this.subarray(e,t);return Object.setPrototypeOf(i,E.prototype),i};function se(r,e,t){if(r%1!==0||r<0)throw new RangeError("offset is not uint");if(r+e>t)throw new RangeError("Trying to access beyond buffer length")}E.prototype.readUintLE=E.prototype.readUIntLE=function(e,t,n){e=e>>>0,t=t>>>0,n||se(e,t,this.length);for(var i=this[e],o=1,a=0;++a<t&&(o*=256);)i+=this[e+a]*o;return i};E.prototype.readUintBE=E.prototype.readUIntBE=function(e,t,n){e=e>>>0,t=t>>>0,n||se(e,t,this.length);for(var i=this[e+--t],o=1;t>0&&(o*=256);)i+=this[e+--t]*o;return i};E.prototype.readUint8=E.prototype.readUInt8=function(e,t){return e=e>>>0,t||se(e,1,this.length),this[e]};E.prototype.readUint16LE=E.prototype.readUInt16LE=function(e,t){return e=e>>>0,t||se(e,2,this.length),this[e]|this[e+1]<<8};E.prototype.readUint16BE=E.prototype.readUInt16BE=function(e,t){return e=e>>>0,t||se(e,2,this.length),this[e]<<8|this[e+1]};E.prototype.readUint32LE=E.prototype.readUInt32LE=function(e,t){return e=e>>>0,t||se(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};E.prototype.readUint32BE=E.prototype.readUInt32BE=function(e,t){return e=e>>>0,t||se(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};E.prototype.readIntLE=function(e,t,n){e=e>>>0,t=t>>>0,n||se(e,t,this.length);for(var i=this[e],o=1,a=0;++a<t&&(o*=256);)i+=this[e+a]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*t)),i};E.prototype.readIntBE=function(e,t,n){e=e>>>0,t=t>>>0,n||se(e,t,this.length);for(var i=t,o=1,a=this[e+--i];i>0&&(o*=256);)a+=this[e+--i]*o;return o*=128,a>=o&&(a-=Math.pow(2,8*t)),a};E.prototype.readInt8=function(e,t){return e=e>>>0,t||se(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};E.prototype.readInt16LE=function(e,t){e=e>>>0,t||se(e,2,this.length);var n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n};E.prototype.readInt16BE=function(e,t){e=e>>>0,t||se(e,2,this.length);var n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n};E.prototype.readInt32LE=function(e,t){return e=e>>>0,t||se(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};E.prototype.readInt32BE=function(e,t){return e=e>>>0,t||se(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};E.prototype.readFloatLE=function(e,t){return e=e>>>0,t||se(e,4,this.length),Yt.read(this,e,!0,23,4)};E.prototype.readFloatBE=function(e,t){return e=e>>>0,t||se(e,4,this.length),Yt.read(this,e,!1,23,4)};E.prototype.readDoubleLE=function(e,t){return e=e>>>0,t||se(e,8,this.length),Yt.read(this,e,!0,52,8)};E.prototype.readDoubleBE=function(e,t){return e=e>>>0,t||se(e,8,this.length),Yt.read(this,e,!1,52,8)};function me(r,e,t,n,i,o){if(!E.isBuffer(r))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(t+n>r.length)throw new RangeError("Index out of range")}E.prototype.writeUintLE=E.prototype.writeUIntLE=function(e,t,n,i){if(e=+e,t=t>>>0,n=n>>>0,!i){var o=Math.pow(2,8*n)-1;me(this,e,t,n,o,0)}var a=1,s=0;for(this[t]=e&255;++s<n&&(a*=256);)this[t+s]=e/a&255;return t+n};E.prototype.writeUintBE=E.prototype.writeUIntBE=function(e,t,n,i){if(e=+e,t=t>>>0,n=n>>>0,!i){var o=Math.pow(2,8*n)-1;me(this,e,t,n,o,0)}var a=n-1,s=1;for(this[t+a]=e&255;--a>=0&&(s*=256);)this[t+a]=e/s&255;return t+n};E.prototype.writeUint8=E.prototype.writeUInt8=function(e,t,n){return e=+e,t=t>>>0,n||me(this,e,t,1,255,0),this[t]=e&255,t+1};E.prototype.writeUint16LE=E.prototype.writeUInt16LE=function(e,t,n){return e=+e,t=t>>>0,n||me(this,e,t,2,65535,0),this[t]=e&255,this[t+1]=e>>>8,t+2};E.prototype.writeUint16BE=E.prototype.writeUInt16BE=function(e,t,n){return e=+e,t=t>>>0,n||me(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=e&255,t+2};E.prototype.writeUint32LE=E.prototype.writeUInt32LE=function(e,t,n){return e=+e,t=t>>>0,n||me(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255,t+4};E.prototype.writeUint32BE=E.prototype.writeUInt32BE=function(e,t,n){return e=+e,t=t>>>0,n||me(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};E.prototype.writeIntLE=function(e,t,n,i){if(e=+e,t=t>>>0,!i){var o=Math.pow(2,8*n-1);me(this,e,t,n,o-1,-o)}var a=0,s=1,c=0;for(this[t]=e&255;++a<n&&(s*=256);)e<0&&c===0&&this[t+a-1]!==0&&(c=1),this[t+a]=(e/s>>0)-c&255;return t+n};E.prototype.writeIntBE=function(e,t,n,i){if(e=+e,t=t>>>0,!i){var o=Math.pow(2,8*n-1);me(this,e,t,n,o-1,-o)}var a=n-1,s=1,c=0;for(this[t+a]=e&255;--a>=0&&(s*=256);)e<0&&c===0&&this[t+a+1]!==0&&(c=1),this[t+a]=(e/s>>0)-c&255;return t+n};E.prototype.writeInt8=function(e,t,n){return e=+e,t=t>>>0,n||me(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=e&255,t+1};E.prototype.writeInt16LE=function(e,t,n){return e=+e,t=t>>>0,n||me(this,e,t,2,32767,-32768),this[t]=e&255,this[t+1]=e>>>8,t+2};E.prototype.writeInt16BE=function(e,t,n){return e=+e,t=t>>>0,n||me(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=e&255,t+2};E.prototype.writeInt32LE=function(e,t,n){return e=+e,t=t>>>0,n||me(this,e,t,4,2147483647,-2147483648),this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4};E.prototype.writeInt32BE=function(e,t,n){return e=+e,t=t>>>0,n||me(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};function uu(r,e,t,n,i,o){if(t+n>r.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function cu(r,e,t,n,i){return e=+e,t=t>>>0,i||uu(r,e,t,4,34028234663852886e22,-34028234663852886e22),Yt.write(r,e,t,n,23,4),t+4}E.prototype.writeFloatLE=function(e,t,n){return cu(this,e,t,!0,n)};E.prototype.writeFloatBE=function(e,t,n){return cu(this,e,t,!1,n)};function fu(r,e,t,n,i){return e=+e,t=t>>>0,i||uu(r,e,t,8,17976931348623157e292,-17976931348623157e292),Yt.write(r,e,t,n,52,8),t+8}E.prototype.writeDoubleLE=function(e,t,n){return fu(this,e,t,!0,n)};E.prototype.writeDoubleBE=function(e,t,n){return fu(this,e,t,!1,n)};E.prototype.copy=function(e,t,n,i){if(!E.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),!i&&i!==0&&(i=this.length),t>=e.length&&(t=e.length),t||(t=0),i>0&&i<n&&(i=n),i===n||e.length===0||this.length===0)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t<i-n&&(i=e.length-t+n);var o=i-n;return this===e&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(t,n,i):Uint8Array.prototype.set.call(e,this.subarray(n,i),t),o};E.prototype.fill=function(e,t,n,i){if(typeof e=="string"){if(typeof t=="string"?(i=t,t=0,n=this.length):typeof n=="string"&&(i=n,n=this.length),i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!E.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(e.length===1){var o=e.charCodeAt(0);(i==="utf8"&&o<128||i==="latin1")&&(e=o)}}else typeof e=="number"?e=e&255:typeof e=="boolean"&&(e=Number(e));if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;t=t>>>0,n=n===void 0?this.length:n>>>0,e||(e=0);var a;if(typeof e=="number")for(a=t;a<n;++a)this[a]=e;else{var s=E.isBuffer(e)?e:E.from(e,i),c=s.length;if(c===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(a=0;a<n-t;++a)this[a+t]=s[a%c]}return this};var Il=/[^+/0-9A-Za-z-_]/g;function Nl(r){if(r=r.split("=")[0],r=r.trim().replace(Il,""),r.length<2)return"";for(;r.length%4!==0;)r=r+"=";return r}function po(r,e){e=e||1/0;for(var t,n=r.length,i=null,o=[],a=0;a<n;++a){if(t=r.charCodeAt(a),t>55295&&t<57344){if(!i){if(t>56319){(e-=3)>-1&&o.push(239,191,189);continue}else if(a+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=t;continue}if(t<56320){(e-=3)>-1&&o.push(239,191,189),i=t;continue}t=(i-55296<<10|t-56320)+65536}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,t<128){if((e-=1)<0)break;o.push(t)}else if(t<2048){if((e-=2)<0)break;o.push(t>>6|192,t&63|128)}else if(t<65536){if((e-=3)<0)break;o.push(t>>12|224,t>>6&63|128,t&63|128)}else if(t<1114112){if((e-=4)<0)break;o.push(t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return o}function Cl(r){for(var e=[],t=0;t<r.length;++t)e.push(r.charCodeAt(t)&255);return e}function Rl(r,e){for(var t,n,i,o=[],a=0;a<r.length&&!((e-=2)<0);++a)t=r.charCodeAt(a),n=t>>8,i=t%256,o.push(i),o.push(n);return o}function lu(r){return fo.toByteArray(Nl(r))}function On(r,e,t,n){for(var i=0;i<n&&!(i+t>=e.length||i>=r.length);++i)e[i+t]=r[i];return i}function Ve(r,e){return r instanceof e||r!=null&&r.constructor!=null&&r.constructor.name!=null&&r.constructor.name===e.name}function mo(r){return r!==r}var Fl=(function(){for(var r="0123456789abcdef",e=new Array(256),t=0;t<16;++t)for(var n=t*16,i=0;i<16;++i)e[n+i]=r[t]+r[i];return e})()});var Tn=Q($t=>{"use strict";var Dl=kc(),Qe=Ic();$t.parse=Nr;$t.resolve=Kl;$t.resolveObject=Gl;$t.format=Ql;$t.Url=Te;function Te(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var Ml=/^([a-z0-9.+-]+:)/i,Pl=/:[0-9]*$/,Ll=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,ql=["<",">",'"',"`"," ","\r",`
`,"	"],Ul=["{","}","|","\\","^","`"].concat(ql),go=["'"].concat(Ul),pu=["%","/","?",";","#"].concat(go),du=["/","?","#"],jl=255,vu=/^[+a-z0-9A-Z_-]{0,63}$/,Bl=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Vl={javascript:!0,"javascript:":!0},bo={javascript:!0,"javascript:":!0},Zt={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},_o=Nc();function Nr(r,e,t){if(r&&Qe.isObject(r)&&r instanceof Te)return r;var n=new Te;return n.parse(r,e,t),n}Te.prototype.parse=function(r,e,t){if(!Qe.isString(r))throw new TypeError("Parameter 'url' must be a string, not "+typeof r);var n=r.indexOf("?"),i=n!==-1&&n<r.indexOf("#")?"?":"#",o=r.split(i),a=/\\/g;o[0]=o[0].replace(a,"/"),r=o.join(i);var s=r;if(s=s.trim(),!t&&r.split("#").length===1){var c=Ll.exec(s);if(c)return this.path=s,this.href=s,this.pathname=c[1],c[2]?(this.search=c[2],e?this.query=_o.parse(this.search.substr(1)):this.query=this.search.substr(1)):e&&(this.search="",this.query={}),this}var u=Ml.exec(s);if(u){u=u[0];var f=u.toLowerCase();this.protocol=f,s=s.substr(u.length)}if(t||u||s.match(/^\/\/[^@\/]+@[^@\/]+/)){var l=s.substr(0,2)==="//";l&&!(u&&bo[u])&&(s=s.substr(2),this.slashes=!0)}if(!bo[u]&&(l||u&&!Zt[u])){for(var p=-1,v=0;v<du.length;v++){var b=s.indexOf(du[v]);b!==-1&&(p===-1||b<p)&&(p=b)}var y,_;p===-1?_=s.lastIndexOf("@"):_=s.lastIndexOf("@",p),_!==-1&&(y=s.slice(0,_),s=s.slice(_+1),this.auth=decodeURIComponent(y)),p=-1;for(var v=0;v<pu.length;v++){var b=s.indexOf(pu[v]);b!==-1&&(p===-1||b<p)&&(p=b)}p===-1&&(p=s.length),this.host=s.slice(0,p),s=s.slice(p),this.parseHost(),this.hostname=this.hostname||"";var T=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!T)for(var k=this.hostname.split(/\./),v=0,I=k.length;v<I;v++){var D=k[v];if(D&&!D.match(vu)){for(var C="",F=0,q=D.length;F<q;F++)D.charCodeAt(F)>127?C+="x":C+=D[F];if(!C.match(vu)){var O=k.slice(0,v),M=k.slice(v+1),U=D.match(Bl);U&&(O.push(U[1]),M.unshift(U[2])),M.length&&(s="/"+M.join(".")+s),this.hostname=O.join(".");break}}}this.hostname.length>jl?this.hostname="":this.hostname=this.hostname.toLowerCase(),T||(this.hostname=Dl.toASCII(this.hostname));var h=this.port?":"+this.port:"",d=this.hostname||"";this.host=d+h,this.href+=this.host,T&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),s[0]!=="/"&&(s="/"+s))}if(!Vl[f])for(var v=0,I=go.length;v<I;v++){var m=go[v];if(s.indexOf(m)!==-1){var x=encodeURIComponent(m);x===m&&(x=escape(m)),s=s.split(m).join(x)}}var A=s.indexOf("#");A!==-1&&(this.hash=s.substr(A),s=s.slice(0,A));var S=s.indexOf("?");if(S!==-1?(this.search=s.substr(S),this.query=s.substr(S+1),e&&(this.query=_o.parse(this.query)),s=s.slice(0,S)):e&&(this.search="",this.query={}),s&&(this.pathname=s),Zt[f]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var h=this.pathname||"",R=this.search||"";this.path=h+R}return this.href=this.format(),this};function Ql(r){return Qe.isString(r)&&(r=Nr(r)),r instanceof Te?r.format():Te.prototype.format.call(r)}Te.prototype.format=function(){var r=this.auth||"";r&&(r=encodeURIComponent(r),r=r.replace(/%3A/i,":"),r+="@");var e=this.protocol||"",t=this.pathname||"",n=this.hash||"",i=!1,o="";this.host?i=r+this.host:this.hostname&&(i=r+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(i+=":"+this.port)),this.query&&Qe.isObject(this.query)&&Object.keys(this.query).length&&(o=_o.stringify(this.query));var a=this.search||o&&"?"+o||"";return e&&e.substr(-1)!==":"&&(e+=":"),this.slashes||(!e||Zt[e])&&i!==!1?(i="//"+(i||""),t&&t.charAt(0)!=="/"&&(t="/"+t)):i||(i=""),n&&n.charAt(0)!=="#"&&(n="#"+n),a&&a.charAt(0)!=="?"&&(a="?"+a),t=t.replace(/[?#]/g,function(s){return encodeURIComponent(s)}),a=a.replace("#","%23"),e+i+t+a+n};function Kl(r,e){return Nr(r,!1,!0).resolve(e)}Te.prototype.resolve=function(r){return this.resolveObject(Nr(r,!1,!0)).format()};function Gl(r,e){return r?Nr(r,!1,!0).resolveObject(e):e}Te.prototype.resolveObject=function(r){if(Qe.isString(r)){var e=new Te;e.parse(r,!1,!0),r=e}for(var t=new Te,n=Object.keys(this),i=0;i<n.length;i++){var o=n[i];t[o]=this[o]}if(t.hash=r.hash,r.href==="")return t.href=t.format(),t;if(r.slashes&&!r.protocol){for(var a=Object.keys(r),s=0;s<a.length;s++){var c=a[s];c!=="protocol"&&(t[c]=r[c])}return Zt[t.protocol]&&t.hostname&&!t.pathname&&(t.path=t.pathname="/"),t.href=t.format(),t}if(r.protocol&&r.protocol!==t.protocol){if(!Zt[r.protocol]){for(var u=Object.keys(r),f=0;f<u.length;f++){var l=u[f];t[l]=r[l]}return t.href=t.format(),t}if(t.protocol=r.protocol,!r.host&&!bo[r.protocol]){for(var I=(r.pathname||"").split("/");I.length&&!(r.host=I.shift()););r.host||(r.host=""),r.hostname||(r.hostname=""),I[0]!==""&&I.unshift(""),I.length<2&&I.unshift(""),t.pathname=I.join("/")}else t.pathname=r.pathname;if(t.search=r.search,t.query=r.query,t.host=r.host||"",t.auth=r.auth,t.hostname=r.hostname||r.host,t.port=r.port,t.pathname||t.search){var p=t.pathname||"",v=t.search||"";t.path=p+v}return t.slashes=t.slashes||r.slashes,t.href=t.format(),t}var b=t.pathname&&t.pathname.charAt(0)==="/",y=r.host||r.pathname&&r.pathname.charAt(0)==="/",_=y||b||t.host&&r.pathname,T=_,k=t.pathname&&t.pathname.split("/")||[],I=r.pathname&&r.pathname.split("/")||[],D=t.protocol&&!Zt[t.protocol];if(D&&(t.hostname="",t.port=null,t.host&&(k[0]===""?k[0]=t.host:k.unshift(t.host)),t.host="",r.protocol&&(r.hostname=null,r.port=null,r.host&&(I[0]===""?I[0]=r.host:I.unshift(r.host)),r.host=null),_=_&&(I[0]===""||k[0]==="")),y)t.host=r.host||r.host===""?r.host:t.host,t.hostname=r.hostname||r.hostname===""?r.hostname:t.hostname,t.search=r.search,t.query=r.query,k=I;else if(I.length)k||(k=[]),k.pop(),k=k.concat(I),t.search=r.search,t.query=r.query;else if(!Qe.isNullOrUndefined(r.search)){if(D){t.hostname=t.host=k.shift();var C=t.host&&t.host.indexOf("@")>0?t.host.split("@"):!1;C&&(t.auth=C.shift(),t.host=t.hostname=C.shift())}return t.search=r.search,t.query=r.query,(!Qe.isNull(t.pathname)||!Qe.isNull(t.search))&&(t.path=(t.pathname?t.pathname:"")+(t.search?t.search:"")),t.href=t.format(),t}if(!k.length)return t.pathname=null,t.search?t.path="/"+t.search:t.path=null,t.href=t.format(),t;for(var F=k.slice(-1)[0],q=(t.host||r.host||k.length>1)&&(F==="."||F==="..")||F==="",O=0,M=k.length;M>=0;M--)F=k[M],F==="."?k.splice(M,1):F===".."?(k.splice(M,1),O++):O&&(k.splice(M,1),O--);if(!_&&!T)for(;O--;O)k.unshift("..");_&&k[0]!==""&&(!k[0]||k[0].charAt(0)!=="/")&&k.unshift(""),q&&k.join("/").substr(-1)!=="/"&&k.push("");var U=k[0]===""||k[0]&&k[0].charAt(0)==="/";if(D){t.hostname=t.host=U?"":k.length?k.shift():"";var C=t.host&&t.host.indexOf("@")>0?t.host.split("@"):!1;C&&(t.auth=C.shift(),t.host=t.hostname=C.shift())}return _=_||t.host&&k.length,_&&!U&&k.unshift(""),k.length?t.pathname=k.join("/"):(t.pathname=null,t.path=null),(!Qe.isNull(t.pathname)||!Qe.isNull(t.search))&&(t.path=(t.pathname?t.pathname:"")+(t.search?t.search:"")),t.auth=r.auth||t.auth,t.slashes=t.slashes||r.slashes,t.href=t.format(),t};Te.prototype.parseHost=function(){var r=this.host,e=Pl.exec(r);e&&(e=e[0],e!==":"&&(this.port=e.substr(1)),r=r.substr(0,r.length-e.length)),r&&(this.hostname=r)}});var wo=Q(Ae=>{"use strict";Object.defineProperty(Ae,"__esModule",{value:!0});Ae.MAX_HASHABLE_LENGTH=Ae.INIT=Ae.KEY=Ae.DIGEST_LENGTH=Ae.BLOCK_SIZE=void 0;Ae.BLOCK_SIZE=64;Ae.DIGEST_LENGTH=32;Ae.KEY=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);Ae.INIT=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225];Ae.MAX_HASHABLE_LENGTH=Math.pow(2,53)-1});var yu=Q(An=>{"use strict";Object.defineProperty(An,"__esModule",{value:!0});An.RawSha256=void 0;var ke=wo(),Wl=(function(){function r(){this.state=Int32Array.from(ke.INIT),this.temp=new Int32Array(64),this.buffer=new Uint8Array(64),this.bufferLength=0,this.bytesHashed=0,this.finished=!1}return r.prototype.update=function(e){if(this.finished)throw new Error("Attempted to update an already finished hash.");var t=0,n=e.byteLength;if(this.bytesHashed+=n,this.bytesHashed*8>ke.MAX_HASHABLE_LENGTH)throw new Error("Cannot hash more than 2^53 - 1 bits");for(;n>0;)this.buffer[this.bufferLength++]=e[t++],n--,this.bufferLength===ke.BLOCK_SIZE&&(this.hashBuffer(),this.bufferLength=0)},r.prototype.digest=function(){if(!this.finished){var e=this.bytesHashed*8,t=new DataView(this.buffer.buffer,this.buffer.byteOffset,this.buffer.byteLength),n=this.bufferLength;if(t.setUint8(this.bufferLength++,128),n%ke.BLOCK_SIZE>=ke.BLOCK_SIZE-8){for(var i=this.bufferLength;i<ke.BLOCK_SIZE;i++)t.setUint8(i,0);this.hashBuffer(),this.bufferLength=0}for(var i=this.bufferLength;i<ke.BLOCK_SIZE-8;i++)t.setUint8(i,0);t.setUint32(ke.BLOCK_SIZE-8,Math.floor(e/4294967296),!0),t.setUint32(ke.BLOCK_SIZE-4,e),this.hashBuffer(),this.finished=!0}for(var o=new Uint8Array(ke.DIGEST_LENGTH),i=0;i<8;i++)o[i*4]=this.state[i]>>>24&255,o[i*4+1]=this.state[i]>>>16&255,o[i*4+2]=this.state[i]>>>8&255,o[i*4+3]=this.state[i]>>>0&255;return o},r.prototype.hashBuffer=function(){for(var e=this,t=e.buffer,n=e.state,i=n[0],o=n[1],a=n[2],s=n[3],c=n[4],u=n[5],f=n[6],l=n[7],p=0;p<ke.BLOCK_SIZE;p++){if(p<16)this.temp[p]=(t[p*4]&255)<<24|(t[p*4+1]&255)<<16|(t[p*4+2]&255)<<8|t[p*4+3]&255;else{var v=this.temp[p-2],b=(v>>>17|v<<15)^(v>>>19|v<<13)^v>>>10;v=this.temp[p-15];var y=(v>>>7|v<<25)^(v>>>18|v<<14)^v>>>3;this.temp[p]=(b+this.temp[p-7]|0)+(y+this.temp[p-16]|0)}var _=(((c>>>6|c<<26)^(c>>>11|c<<21)^(c>>>25|c<<7))+(c&u^~c&f)|0)+(l+(ke.KEY[p]+this.temp[p]|0)|0)|0,T=((i>>>2|i<<30)^(i>>>13|i<<19)^(i>>>22|i<<10))+(i&o^i&a^o&a)|0;l=f,f=u,u=c,c=s+_|0,s=a,a=o,o=i,i=_+T|0}n[0]+=i,n[1]+=o,n[2]+=a,n[3]+=s,n[4]+=c,n[5]+=u,n[6]+=f,n[7]+=l},r})();An.RawSha256=Wl});var mu,gu,bu=N(()=>{"use strict";mu=function(r){for(var e=[],t=0,n=r.length;t<n;t++){var i=r.charCodeAt(t);if(i<128)e.push(i);else if(i<2048)e.push(i>>6|192,i&63|128);else if(t+1<r.length&&(i&64512)===55296&&(r.charCodeAt(t+1)&64512)===56320){var o=65536+((i&1023)<<10)+(r.charCodeAt(++t)&1023);e.push(o>>18|240,o>>12&63|128,o>>6&63|128,o&63|128)}else e.push(i>>12|224,i>>6&63|128,i&63|128)}return Uint8Array.from(e)},gu=function(r){for(var e="",t=0,n=r.length;t<n;t++){var i=r[t];if(i<128)e+=String.fromCharCode(i);else if(192<=i&&i<224){var o=r[++t];e+=String.fromCharCode((i&31)<<6|o&63)}else if(240<=i&&i<365){var a=[i,r[++t],r[++t],r[++t]],s="%"+a.map(function(c){return c.toString(16)}).join("%");e+=decodeURIComponent(s)}else e+=String.fromCharCode((i&15)<<12|(r[++t]&63)<<6|r[++t]&63)}return e}});function _u(r){return new TextEncoder().encode(r)}function wu(r){return new TextDecoder("utf-8").decode(r)}var Eu=N(()=>{"use strict"});var Su={};lt(Su,{fromUtf8:()=>Hl,toUtf8:()=>zl});var Hl,zl,xu=N(()=>{"use strict";bu();Eu();Hl=function(r){return typeof TextEncoder=="function"?_u(r):mu(r)},zl=function(r){return typeof TextDecoder=="function"?wu(r):gu(r)}});var Ou=Q(kn=>{"use strict";Object.defineProperty(kn,"__esModule",{value:!0});kn.convertToBuffer=void 0;var Yl=(xu(),le(Su)),Jl=typeof Buffer<"u"&&Buffer.from?function(r){return Buffer.from(r,"utf8")}:Yl.fromUtf8;function Zl(r){return r instanceof Uint8Array?r:typeof r=="string"?Jl(r):ArrayBuffer.isView(r)?new Uint8Array(r.buffer,r.byteOffset,r.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(r)}kn.convertToBuffer=Zl});var Tu=Q(In=>{"use strict";Object.defineProperty(In,"__esModule",{value:!0});In.isEmptyData=void 0;function $l(r){return typeof r=="string"?r.length===0:r.byteLength===0}In.isEmptyData=$l});var Au=Q(Nn=>{"use strict";Object.defineProperty(Nn,"__esModule",{value:!0});Nn.numToUint8=void 0;function Xl(r){return new Uint8Array([(r&4278190080)>>24,(r&16711680)>>16,(r&65280)>>8,r&255])}Nn.numToUint8=Xl});var ku=Q(Cn=>{"use strict";Object.defineProperty(Cn,"__esModule",{value:!0});Cn.uint32ArrayFrom=void 0;function eh(r){if(!Array.from){for(var e=new Uint32Array(r.length),t=0;t<r.length;)e[t]=r[t];return e}return Uint32Array.from(r)}Cn.uint32ArrayFrom=eh});var Iu=Q(Ke=>{"use strict";Object.defineProperty(Ke,"__esModule",{value:!0});Ke.uint32ArrayFrom=Ke.numToUint8=Ke.isEmptyData=Ke.convertToBuffer=void 0;var th=Ou();Object.defineProperty(Ke,"convertToBuffer",{enumerable:!0,get:function(){return th.convertToBuffer}});var rh=Tu();Object.defineProperty(Ke,"isEmptyData",{enumerable:!0,get:function(){return rh.isEmptyData}});var nh=Au();Object.defineProperty(Ke,"numToUint8",{enumerable:!0,get:function(){return nh.numToUint8}});var ih=ku();Object.defineProperty(Ke,"uint32ArrayFrom",{enumerable:!0,get:function(){return ih.uint32ArrayFrom}})});var Cu=Q(Fn=>{"use strict";Object.defineProperty(Fn,"__esModule",{value:!0});Fn.Sha256=void 0;var Nu=($(),le(Hn)),Rn=wo(),Eo=yu(),So=Iu(),oh=(function(){function r(e){if(this.hash=new Eo.RawSha256,e){this.outer=new Eo.RawSha256;var t=ah(e),n=new Uint8Array(Rn.BLOCK_SIZE);n.set(t);for(var i=0;i<Rn.BLOCK_SIZE;i++)t[i]^=54,n[i]^=92;this.hash.update(t),this.outer.update(n);for(var i=0;i<t.byteLength;i++)t[i]=0}}return r.prototype.update=function(e){if(!((0,So.isEmptyData)(e)||this.error))try{this.hash.update((0,So.convertToBuffer)(e))}catch(t){this.error=t}},r.prototype.digestSync=function(){if(this.error)throw this.error;return this.outer?(this.outer.finished||this.outer.update(this.hash.digest()),this.outer.digest()):this.hash.digest()},r.prototype.digest=function(){return(0,Nu.__awaiter)(this,void 0,void 0,function(){return(0,Nu.__generator)(this,function(e){return[2,this.digestSync()]})})},r})();Fn.Sha256=oh;function ah(r){var e=(0,So.convertToBuffer)(r);if(e.byteLength>Rn.BLOCK_SIZE){var t=new Eo.RawSha256;t.update(e),e=t.digest()}var n=new Uint8Array(Rn.BLOCK_SIZE);return n.set(e),n}});var Ru=Q(xo=>{"use strict";Object.defineProperty(xo,"__esModule",{value:!0});var sh=($(),le(Hn));(0,sh.__exportStar)(Cu(),xo)});var Du={};lt(Du,{fromHex:()=>uh,toHex:()=>ch});function uh(r){if(r.length%2!==0)throw new Error("Hex encoded strings must have an even number length");for(var e=new Uint8Array(r.length/2),t=0;t<r.length;t+=2){var n=r.slice(t,t+2).toLowerCase();if(n in Oo)e[t/2]=Oo[n];else throw new Error("Cannot decode unrecognized sequence ".concat(n," as hexadecimal"))}return e}function ch(r){for(var e="",t=0;t<r.byteLength;t++)e+=Fu[r[t]];return e}var Fu,Oo,er,Xt,Mu=N(()=>{"use strict";Fu={},Oo={};for(Xt=0;Xt<256;Xt++)er=Xt.toString(16).toLowerCase(),er.length===1&&(er="0".concat(er)),Fu[Xt]=er,Oo[er]=Xt});var Bu=Q(Rr=>{"use strict";Object.defineProperty(Rr,"__esModule",{value:!0});Rr.Signer=void 0;global.Buffer=global.Buffer||hu().Buffer;var To=Tn(),Pu=Ru().Sha256,Lu=(Mu(),le(Du)).toHex,Cr=function(r,e,t){t===void 0&&(t="");var n=new Pu(r);n.update(e);var i=n.digestSync();return t==="hex"?Lu(i):i},qu=function(r){var e=r||"",t=new Pu;return t.update(e),Lu(t.digestSync())},fh=function(r){return!r||Object.keys(r).length===0?"":Object.keys(r).map(function(e){return{key:e.toLowerCase(),value:r[e]?r[e].trim().replace(/\s+/g," "):""}}).sort(function(e,t){return e.key<t.key?-1:1}).map(function(e){return e.key+":"+e.value}).join(`
`)+`
`},Uu=function(r){return Object.keys(r).map(function(e){return e.toLowerCase()}).sort().join(";")},lh=function(r){var e=To.parse(r.url);return[r.method||"/",e.path,e.query,fh(r.headers),Uu(r.headers),qu(r.body)].join(`
`)},hh=function(r){var e=To.parse(r.url),t=e.host,n=t.match(/([^.]+)\.(?:([^.]*)\.)?amazonaws\.com$/),i=(n||[]).slice(1,3);return i[1]==="es"&&(i=i.reverse()),{service:r.service||i[0],region:r.region||i[1]}},ph=function(r,e,t){return[r,e,t,"aws4_request"].join("/")},dh=function(r,e,t,n){return[r,t,n,qu(e)].join(`
`)},vh=function(r,e,t){r===void 0&&(r="");var n="AWS4"+r,i=Cr(n,e),o=Cr(i,t.region),a=Cr(o,t.service),s=Cr(a,"aws4_request");return s},yh=function(r,e){return Cr(r,e,"hex")},mh=function(r,e,t,n,i){return e===void 0&&(e=""),[r+" Credential="+e+"/"+t,"SignedHeaders="+n,"Signature="+i].join(", ")},gh=function(r,e,t){t===void 0&&(t=null),r.headers=r.headers||{};var n=new Date,i=n.toISOString().replace(/[:-]|\.\d{3}/g,""),o=i.substr(0,8),a="AWS4-HMAC-SHA256",s=To.parse(r.url);r.headers.host=s.host,r.headers["x-amz-date"]=i,e.session_token&&(r.headers["X-Amz-Security-Token"]=e.session_token);var c=lh(r);t=t||hh(r);var u=ph(o,t.region,t.service),f=dh(a,c,i,u),l=vh(e.secret_key,o,t),p=yh(l,f),v=mh(a,e.access_key,u,Uu(r.headers),p);return r.headers.Authorization=v,r},ju=(function(){function r(){}return r.sign=gh,r})();Rr.Signer=ju;Rr.default=ju});var Ao=Q(At=>{"use strict";var bh=At&&At.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,i)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),_h=At&&At.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&bh(e,r,t)};Object.defineProperty(At,"__esModule",{value:!0});_h(Bu(),At)});var Vu=Q(Dn=>{"use strict";Object.defineProperty(Dn,"__esModule",{value:!0});Dn.userAgent=void 0;var wh="";Dn.userAgent=wh});var Qu=Q((A0,Eh)=>{Eh.exports={name:"aws-appsync-auth-link",version:"3.0.8",main:"lib/index.js",files:["lib"],license:"Apache-2.0",description:"AWS Mobile AppSync Auth Link for JavaScript",author:{name:"Amazon Web Services",url:"https://aws.amazon.com/"},homepage:"https://github.com/awslabs/aws-mobile-appsync-sdk-js.git",repository:{type:"git",url:"https://github.com/awslabs/aws-mobile-appsync-sdk-js.git"},scripts:{clean:"rm -rf lib",prepare:"tsc",test:"jest --coverage --coverageReporters=text --passWithNoTests","test-watch":"jest --watch"},dependencies:{"@aws-crypto/sha256-js":"^1.2.0","@aws-sdk/types":"^3.25.0","@aws-sdk/util-hex-encoding":"^3.29.0",debug:"2.6.9"},devDependencies:{"@apollo/client":"^3.2.0"},peerDependencies:{"@apollo/client":"3.x"}}});var Hu=Q(Z=>{"use strict";var Sh=Z&&Z.__extends||(function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}})(),fe=Z&&Z.__assign||function(){return fe=Object.assign||function(r){for(var e,t=1,n=arguments.length;t<n;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=e[i])}return r},fe.apply(this,arguments)},Gu=Z&&Z.__awaiter||function(r,e,t,n){function i(o){return o instanceof t?o:new t(function(a){a(o)})}return new(t||(t=Promise))(function(o,a){function s(f){try{u(n.next(f))}catch(l){a(l)}}function c(f){try{u(n.throw(f))}catch(l){a(l)}}function u(f){f.done?o(f.value):i(f.value).then(s,c)}u((n=n.apply(r,e||[])).next())})},Wu=Z&&Z.__generator||function(r,e){var t={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(u){return function(f){return c([u,f])}}function c(u){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(t=0)),t;)try{if(n=1,i&&(o=u[0]&2?i.return:u[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,u[1])).done)return o;switch(i=0,o&&(u=[u[0]&2,o.value]),u[0]){case 0:case 1:o=u;break;case 4:return t.label++,{value:u[1],done:!1};case 5:t.label++,i=u[1],u=[0];continue;case 7:u=t.ops.pop(),t.trys.pop();continue;default:if(o=t.trys,!(o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){t.label=u[1];break}if(u[0]===6&&t.label<o[1]){t.label=o[1],o=u;break}if(o&&t.label<o[2]){t.label=o[2],t.ops.push(u);break}o[2]&&t.ops.pop(),t.trys.pop();continue}u=e.call(r,t)}catch(f){u=[6,f],i=0}finally{n=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}};Object.defineProperty(Z,"__esModule",{value:!0});Z.authLink=Z.AuthLink=Z.AUTH_TYPE=Z.USER_AGENT=Z.USER_AGENT_HEADER=void 0;var ko=(xt(),le(zt)),xh=(Rc(),le(Cc)),Oh=Ao(),Th=Tn(),Ku=Vu(),Ah=Qu(),kh="appsync";Z.USER_AGENT_HEADER="x-amz-user-agent";Z.USER_AGENT="aws-amplify/".concat(Ah.version).concat(Ku.userAgent&&" ").concat(Ku.userAgent);var kt;(function(r){r.NONE="NONE",r.API_KEY="API_KEY",r.AWS_IAM="AWS_IAM",r.AMAZON_COGNITO_USER_POOLS="AMAZON_COGNITO_USER_POOLS",r.OPENID_CONNECT="OPENID_CONNECT",r.AWS_LAMBDA="AWS_LAMBDA"})(kt=Z.AUTH_TYPE||(Z.AUTH_TYPE={}));var Ih=(function(r){Sh(e,r);function e(t){var n=r.call(this)||this;return n.link=(0,Z.authLink)(t),n}return e.prototype.request=function(t,n){return this.link.request(t,n)},e})(ko.ApolloLink);Z.AuthLink=Ih;var Mn=function(r,e,t){var n=r===void 0?{header:"",value:""}:r,i=n.header,o=n.value;return Gu(void 0,void 0,void 0,function(){var a,s,c,u,f,l;return Wu(this,function(p){switch(p.label){case 0:return a=e.getContext(),s=fe(fe({},a.headers),(f={},f[Z.USER_AGENT_HEADER]=Z.USER_AGENT,f)),i&&o?typeof o!="function"?[3,2]:[4,o.call(void 0)]:[3,5];case 1:return u=p.sent(),[3,4];case 2:return[4,o];case 3:u=p.sent(),p.label=4;case 4:c=u,s=fe((l={},l[i]=c,l),s),p.label=5;case 5:return e.setContext(fe(fe({},a),{headers:s})),[2,t(e)]}})})},Nh=function(r,e,t){var n=r.credentials,i=r.region,o=r.url;return Gu(void 0,void 0,void 0,function(){var a,s,c,u,f,l,p,v,b,y,_,T,k;return Wu(this,function(I){switch(I.label){case 0:return a=kh,s=e.getContext(),c=typeof n=="function"?n.call():n||{},c&&typeof c.getPromise=="function"?[4,c.getPromise()]:[3,2];case 1:I.sent(),I.label=2;case 2:return[4,c];case 3:return u=I.sent(),f=u.accessKeyId,l=u.secretAccessKey,p=u.sessionToken,v=Th.parse(o),b=v.host,y=v.path,_=fe(fe({},Rh(e,{})),{service:a,region:i,url:o,host:b,path:y}),T=Oh.Signer.sign(_,{access_key:f,secret_key:l,session_token:p}).headers,e.setContext(fe(fe({},s),{headers:fe(fe(fe({},s.headers),T),(k={},k[Z.USER_AGENT_HEADER]=Z.USER_AGENT,k))})),[2,t(e)]}})})},Ch=function(r){var e=r.url,t=r.region,n=r.auth,i=n===void 0?{}:n,o=i.type,a=r.auth;return new ko.ApolloLink(function(s,c){return new ko.Observable(function(u){var f,l;switch(o){case kt.NONE:l=Mn(void 0,s,c);break;case kt.AWS_IAM:var p=a.credentials,v=p===void 0?{}:p;l=Nh({credentials:v,region:t,url:e},s,c);break;case kt.API_KEY:var b=a.apiKey,y=b===void 0?"":b;l=Mn({header:"X-Api-Key",value:y},s,c);break;case kt.AMAZON_COGNITO_USER_POOLS:case kt.OPENID_CONNECT:var _=a.jwtToken,T=_===void 0?"":_;l=Mn({header:"Authorization",value:T},s,c);break;case kt.AWS_LAMBDA:var k=a.token,I=k===void 0?"":k;l=Mn({header:"Authorization",value:I},s,c);break;default:var D=new Error("Invalid AUTH_TYPE: ".concat(a.type));throw D}return l.then(function(C){f=C.subscribe({next:u.next.bind(u),error:u.error.bind(u),complete:u.complete.bind(u)})}),function(){f&&f.unsubscribe()}})})};Z.authLink=Ch;var Rh=function(r,e){var t=r.operationName,n=r.variables,i=r.query,o={operationName:t,variables:Fh(n),query:(0,xh.print)(i)};return fe(fe({body:JSON.stringify(o),method:"POST"},e),{headers:fe({accept:"*/*","content-type":"application/json; charset=UTF-8"},e.headers)})},Fh=function(r){return Object.keys(r).filter(function(e){return!e.startsWith("@@")}).reduce(function(e,t){return e[t]=r[t],e},{})}});var Io=Q(ge=>{"use strict";Object.defineProperty(ge,"__esModule",{value:!0});ge.Signer=ge.USER_AGENT=ge.USER_AGENT_HEADER=ge.AUTH_TYPE=ge.AuthLink=ge.createAuthLink=void 0;var Fr=Hu();Object.defineProperty(ge,"AuthLink",{enumerable:!0,get:function(){return Fr.AuthLink}});Object.defineProperty(ge,"AUTH_TYPE",{enumerable:!0,get:function(){return Fr.AUTH_TYPE}});Object.defineProperty(ge,"USER_AGENT_HEADER",{enumerable:!0,get:function(){return Fr.USER_AGENT_HEADER}});Object.defineProperty(ge,"USER_AGENT",{enumerable:!0,get:function(){return Fr.USER_AGENT}});var Dh=function(r){var e=r.url,t=r.region,n=r.auth;return new Fr.AuthLink({url:e,region:t,auth:n})};ge.createAuthLink=Dh;var Mh=Ao();Object.defineProperty(ge,"Signer",{enumerable:!0,get:function(){return Mh.Signer}})});var Yu=Q((N0,zu)=>{"use strict";var Dr=1e3,Mr=Dr*60,Pr=Mr*60,Lr=Pr*24,Ph=Lr*365.25;zu.exports=function(r,e){e=e||{};var t=typeof r;if(t==="string"&&r.length>0)return Lh(r);if(t==="number"&&isNaN(r)===!1)return e.long?Uh(r):qh(r);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(r))};function Lh(r){if(r=String(r),!(r.length>100)){var e=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(r);if(e){var t=parseFloat(e[1]),n=(e[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return t*Ph;case"days":case"day":case"d":return t*Lr;case"hours":case"hour":case"hrs":case"hr":case"h":return t*Pr;case"minutes":case"minute":case"mins":case"min":case"m":return t*Mr;case"seconds":case"second":case"secs":case"sec":case"s":return t*Dr;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return t;default:return}}}}function qh(r){return r>=Lr?Math.round(r/Lr)+"d":r>=Pr?Math.round(r/Pr)+"h":r>=Mr?Math.round(r/Mr)+"m":r>=Dr?Math.round(r/Dr)+"s":r+"ms"}function Uh(r){return Pn(r,Lr,"day")||Pn(r,Pr,"hour")||Pn(r,Mr,"minute")||Pn(r,Dr,"second")||r+" ms"}function Pn(r,e,t){if(!(r<e))return r<e*1.5?Math.floor(r/e)+" "+t:Math.ceil(r/e)+" "+t+"s"}});var Zu=Q((W,Ju)=>{"use strict";W=Ju.exports=Co.debug=Co.default=Co;W.coerce=Kh;W.disable=Vh;W.enable=Bh;W.enabled=Qh;W.humanize=Yu();W.names=[];W.skips=[];W.formatters={};var No;function jh(r){var e=0,t;for(t in r)e=(e<<5)-e+r.charCodeAt(t),e|=0;return W.colors[Math.abs(e)%W.colors.length]}function Co(r){function e(){if(e.enabled){var t=e,n=+new Date,i=n-(No||n);t.diff=i,t.prev=No,t.curr=n,No=n;for(var o=new Array(arguments.length),a=0;a<o.length;a++)o[a]=arguments[a];o[0]=W.coerce(o[0]),typeof o[0]!="string"&&o.unshift("%O");var s=0;o[0]=o[0].replace(/%([a-zA-Z%])/g,function(u,f){if(u==="%%")return u;s++;var l=W.formatters[f];if(typeof l=="function"){var p=o[s];u=l.call(t,p),o.splice(s,1),s--}return u}),W.formatArgs.call(t,o);var c=e.log||W.log||console.log.bind(console);c.apply(t,o)}}return e.namespace=r,e.enabled=W.enabled(r),e.useColors=W.useColors(),e.color=jh(r),typeof W.init=="function"&&W.init(e),e}function Bh(r){W.save(r),W.names=[],W.skips=[];for(var e=(typeof r=="string"?r:"").split(/[\s,]+/),t=e.length,n=0;n<t;n++)e[n]&&(r=e[n].replace(/\*/g,".*?"),r[0]==="-"?W.skips.push(new RegExp("^"+r.substr(1)+"$")):W.names.push(new RegExp("^"+r+"$")))}function Vh(){W.enable("")}function Qh(r){var e,t;for(e=0,t=W.skips.length;e<t;e++)if(W.skips[e].test(r))return!1;for(e=0,t=W.names.length;e<t;e++)if(W.names[e].test(r))return!0;return!1}function Kh(r){return r instanceof Error?r.stack||r.message:r}});var ec=Q((de,Xu)=>{"use strict";de=Xu.exports=Zu();de.log=Hh;de.formatArgs=Wh;de.save=zh;de.load=$u;de.useColors=Gh;de.storage=typeof chrome<"u"&&typeof chrome.storage<"u"?chrome.storage.local:Yh();de.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"];function Gh(){return typeof window<"u"&&window.process&&window.process.type==="renderer"?!0:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}de.formatters.j=function(r){try{return JSON.stringify(r)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}};function Wh(r){var e=this.useColors;if(r[0]=(e?"%c":"")+this.namespace+(e?" %c":" ")+r[0]+(e?"%c ":" ")+"+"+de.humanize(this.diff),!!e){var t="color: "+this.color;r.splice(1,0,t,"color: inherit");var n=0,i=0;r[0].replace(/%[a-zA-Z%]/g,function(o){o!=="%%"&&(n++,o==="%c"&&(i=n))}),r.splice(i,0,t)}}function Hh(){return typeof console=="object"&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function zh(r){try{r==null?de.storage.removeItem("debug"):de.storage.debug=r}catch{}}function $u(){var r;try{r=de.storage.debug}catch{}return!r&&typeof process<"u"&&"env"in process&&(r=process.env.DEBUG),r}de.enable($u());function Yh(){try{return window.localStorage}catch{}}});var ic=Q(qr=>{"use strict";var tc=qr&&qr.__spreadArray||function(r,e,t){if(t||arguments.length===2)for(var n=0,i=e.length,o;n<i;n++)(o||!(n in e))&&(o||(o=Array.prototype.slice.call(e,0,n)),o[n]=e[n]);return r.concat(o||Array.prototype.slice.call(e))};Object.defineProperty(qr,"__esModule",{value:!0});var rc=ec(),Ro=(0,rc.default)("aws-appsync"),nc=function(r){r===void 0&&(r="");var e=r?tc(tc([],this.namespace.split(":"),!0),[r],!1).join(":"):this.namespace,t=(0,rc.default)(e);return t.extend=nc.bind(t),t};Ro.extend=nc.bind(Ro);qr.default=Ro});var qn=Q(Ln=>{"use strict";Object.defineProperty(Ln,"__esModule",{value:!0});Ln.rootLogger=void 0;var Jh=ic();Object.defineProperty(Ln,"rootLogger",{enumerable:!0,get:function(){return Jh.default}})});var oc=Q((Ur,Fo)=>{"use strict";(function(e,t){typeof Ur=="object"&&typeof Fo=="object"?Fo.exports=t():typeof define=="function"&&define.amd?define(t):typeof Ur=="object"?Ur=t():e.Paho=t()})(Ur,function(){var e=(function(t){var n="@VERSION@-@BUILDLEVEL@",i=t.localStorage||(function(){var h={};return{setItem:function(d,m){h[d]=m},getItem:function(d){return h[d]},removeItem:function(d){delete h[d]}}})(),o={CONNECT:1,CONNACK:2,PUBLISH:3,PUBACK:4,PUBREC:5,PUBREL:6,PUBCOMP:7,SUBSCRIBE:8,SUBACK:9,UNSUBSCRIBE:10,UNSUBACK:11,PINGREQ:12,PINGRESP:13,DISCONNECT:14},a=function(h,d){for(var m in h)if(h.hasOwnProperty(m))if(d.hasOwnProperty(m)){if(typeof h[m]!==d[m])throw new Error(f(c.INVALID_TYPE,[typeof h[m],m]))}else{var x="Unknown property, "+m+". Valid properties are:";for(var A in d)d.hasOwnProperty(A)&&(x=x+" "+A);throw new Error(x)}},s=function(h,d){return function(){return h.apply(d,arguments)}},c={OK:{code:0,text:"AMQJSC0000I OK."},CONNECT_TIMEOUT:{code:1,text:"AMQJSC0001E Connect timed out."},SUBSCRIBE_TIMEOUT:{code:2,text:"AMQJS0002E Subscribe timed out."},UNSUBSCRIBE_TIMEOUT:{code:3,text:"AMQJS0003E Unsubscribe timed out."},PING_TIMEOUT:{code:4,text:"AMQJS0004E Ping timed out."},INTERNAL_ERROR:{code:5,text:"AMQJS0005E Internal error. Error Message: {0}, Stack trace: {1}"},CONNACK_RETURNCODE:{code:6,text:"AMQJS0006E Bad Connack return code:{0} {1}."},SOCKET_ERROR:{code:7,text:"AMQJS0007E Socket error:{0}."},SOCKET_CLOSE:{code:8,text:"AMQJS0008I Socket closed."},MALFORMED_UTF:{code:9,text:"AMQJS0009E Malformed UTF data:{0} {1} {2}."},UNSUPPORTED:{code:10,text:"AMQJS0010E {0} is not supported by this browser."},INVALID_STATE:{code:11,text:"AMQJS0011E Invalid state {0}."},INVALID_TYPE:{code:12,text:"AMQJS0012E Invalid type {0} for {1}."},INVALID_ARGUMENT:{code:13,text:"AMQJS0013E Invalid argument {0} for {1}."},UNSUPPORTED_OPERATION:{code:14,text:"AMQJS0014E Unsupported operation."},INVALID_STORED_DATA:{code:15,text:"AMQJS0015E Invalid data in local storage key={0} value={1}."},INVALID_MQTT_MESSAGE_TYPE:{code:16,text:"AMQJS0016E Invalid MQTT message type {0}."},MALFORMED_UNICODE:{code:17,text:"AMQJS0017E Malformed Unicode string:{0} {1}."},BUFFER_FULL:{code:18,text:"AMQJS0018E Message buffer is full, maximum buffer size: {0}."}},u={0:"Connection Accepted",1:"Connection Refused: unacceptable protocol version",2:"Connection Refused: identifier rejected",3:"Connection Refused: server unavailable",4:"Connection Refused: bad user name or password",5:"Connection Refused: not authorized"},f=function(h,d){var m=h.text;if(d){for(var x,A,S=0;S<d.length;S++)if(x="{"+S+"}",A=m.indexOf(x),A>0){var R=m.substring(0,A),V=m.substring(A+x.length);m=R+d[S]+V}}return m},l=[0,6,77,81,73,115,100,112,3],p=[0,4,77,81,84,84,4],v=function(h,d){this.type=h;for(var m in d)d.hasOwnProperty(m)&&(this[m]=d[m])};v.prototype.encode=function(){var h=(this.type&15)<<4,d=0,m=[],x=0,A;switch(this.messageIdentifier!==void 0&&(d+=2),this.type){case o.CONNECT:switch(this.mqttVersion){case 3:d+=l.length+3;break;case 4:d+=p.length+3;break}d+=I(this.clientId)+2,this.willMessage!==void 0&&(d+=I(this.willMessage.destinationName)+2,A=this.willMessage.payloadBytes,A instanceof Uint8Array||(A=new Uint8Array(R)),d+=A.byteLength+2),this.userName!==void 0&&(d+=I(this.userName)+2),this.password!==void 0&&(d+=I(this.password)+2);break;case o.SUBSCRIBE:h|=2;for(var S=0;S<this.topics.length;S++)m[S]=I(this.topics[S]),d+=m[S]+2;d+=this.requestedQos.length;break;case o.UNSUBSCRIBE:h|=2;for(var S=0;S<this.topics.length;S++)m[S]=I(this.topics[S]),d+=m[S]+2;break;case o.PUBREL:h|=2;break;case o.PUBLISH:this.payloadMessage.duplicate&&(h|=8),h=h|=this.payloadMessage.qos<<1,this.payloadMessage.retained&&(h|=1),x=I(this.payloadMessage.destinationName),d+=x+2;var R=this.payloadMessage.payloadBytes;d+=R.byteLength,R instanceof ArrayBuffer?R=new Uint8Array(R):R instanceof Uint8Array||(R=new Uint8Array(R.buffer));break;case o.DISCONNECT:break;default:break}var V=k(d),L=V.length+1,J=new ArrayBuffer(d+L),P=new Uint8Array(J);if(P[0]=h,P.set(V,1),this.type==o.PUBLISH)L=_(this.payloadMessage.destinationName,x,P,L);else if(this.type==o.CONNECT){switch(this.mqttVersion){case 3:P.set(l,L),L+=l.length;break;case 4:P.set(p,L),L+=p.length;break}var g=0;this.cleanSession&&(g=2),this.willMessage!==void 0&&(g|=4,g|=this.willMessage.qos<<3,this.willMessage.retained&&(g|=32)),this.userName!==void 0&&(g|=128),this.password!==void 0&&(g|=64),P[L++]=g,L=y(this.keepAliveInterval,P,L)}switch(this.messageIdentifier!==void 0&&(L=y(this.messageIdentifier,P,L)),this.type){case o.CONNECT:L=_(this.clientId,I(this.clientId),P,L),this.willMessage!==void 0&&(L=_(this.willMessage.destinationName,I(this.willMessage.destinationName),P,L),L=y(A.byteLength,P,L),P.set(A,L),L+=A.byteLength),this.userName!==void 0&&(L=_(this.userName,I(this.userName),P,L)),this.password!==void 0&&(L=_(this.password,I(this.password),P,L));break;case o.PUBLISH:P.set(R,L);break;case o.SUBSCRIBE:for(var S=0;S<this.topics.length;S++)L=_(this.topics[S],m[S],P,L),P[L++]=this.requestedQos[S];break;case o.UNSUBSCRIBE:for(var S=0;S<this.topics.length;S++)L=_(this.topics[S],m[S],P,L);break;default:}return J};function b(h,d){var m=d,x=h[d],A=x>>4,S=x&=15;d+=1;var R,V=0,L=1;do{if(d==h.length)return[null,m];R=h[d++],V+=(R&127)*L,L*=128}while((R&128)!==0);var J=d+V;if(J>h.length)return[null,m];var P=new v(A);switch(A){case o.CONNACK:var g=h[d++];g&1&&(P.sessionPresent=!0),P.returnCode=h[d++];break;case o.PUBLISH:var G=S>>1&3,K=T(h,d);d+=2;var Ne=C(h,d,K);d+=K,G>0&&(P.messageIdentifier=T(h,d),d+=2);var Y=new e.Message(h.subarray(d,J));(S&1)==1&&(Y.retained=!0),(S&8)==8&&(Y.duplicate=!0),Y.qos=G,Y.destinationName=Ne,P.payloadMessage=Y;break;case o.PUBACK:case o.PUBREC:case o.PUBREL:case o.PUBCOMP:case o.UNSUBACK:P.messageIdentifier=T(h,d);break;case o.SUBACK:P.messageIdentifier=T(h,d),d+=2,P.returnCode=h.subarray(d,J);break;default:break}return[P,J]}function y(h,d,m){return d[m++]=h>>8,d[m++]=h%256,m}function _(h,d,m,x){return x=y(d,m,x),D(h,m,x),x+d}function T(h,d){return 256*h[d]+h[d+1]}function k(h){var d=new Array(1),m=0;do{var x=h%128;h=h>>7,h>0&&(x|=128),d[m++]=x}while(h>0&&m<4);return d}function I(h){for(var d=0,m=0;m<h.length;m++){var x=h.charCodeAt(m);x>2047?(55296<=x&&x<=56319&&(m++,d++),d+=3):x>127?d+=2:d++}return d}function D(h,d,m){for(var x=m,A=0;A<h.length;A++){var S=h.charCodeAt(A);if(55296<=S&&S<=56319){var R=h.charCodeAt(++A);if(isNaN(R))throw new Error(f(c.MALFORMED_UNICODE,[S,R]));S=(S-55296<<10)+(R-56320)+65536}S<=127?d[x++]=S:S<=2047?(d[x++]=S>>6&31|192,d[x++]=S&63|128):S<=65535?(d[x++]=S>>12&15|224,d[x++]=S>>6&63|128,d[x++]=S&63|128):(d[x++]=S>>18&7|240,d[x++]=S>>12&63|128,d[x++]=S>>6&63|128,d[x++]=S&63|128)}return d}function C(h,d,m){for(var x="",A,S=d;S<d+m;){var R=h[S++];if(R<128)A=R;else{var V=h[S++]-128;if(V<0)throw new Error(f(c.MALFORMED_UTF,[R.toString(16),V.toString(16),""]));if(R<224)A=64*(R-192)+V;else{var L=h[S++]-128;if(L<0)throw new Error(f(c.MALFORMED_UTF,[R.toString(16),V.toString(16),L.toString(16)]));if(R<240)A=4096*(R-224)+64*V+L;else{var J=h[S++]-128;if(J<0)throw new Error(f(c.MALFORMED_UTF,[R.toString(16),V.toString(16),L.toString(16),J.toString(16)]));if(R<248)A=262144*(R-240)+4096*V+64*L+J;else throw new Error(f(c.MALFORMED_UTF,[R.toString(16),V.toString(16),L.toString(16),J.toString(16)]))}}}A>65535&&(A-=65536,x+=String.fromCharCode(55296+(A>>10)),A=56320+(A&1023)),x+=String.fromCharCode(A)}return x}var F=function(h,d){this._client=h,this._keepAliveInterval=d*1e3,this.isReset=!1;var m=new v(o.PINGREQ).encode(),x=function(S){return function(){return A.apply(S)}},A=function(){this.isReset?(this.isReset=!1,this._client._trace("Pinger.doPing","send PINGREQ"),this._client.socket.send(m),this.timeout=setTimeout(x(this),this._keepAliveInterval)):(this._client._trace("Pinger.doPing","Timed out"),this._client._disconnected(c.PING_TIMEOUT.code,f(c.PING_TIMEOUT)))};this.reset=function(){this.isReset=!0,clearTimeout(this.timeout),this._keepAliveInterval>0&&(this.timeout=setTimeout(x(this),this._keepAliveInterval))},this.cancel=function(){clearTimeout(this.timeout)}},q=function(h,d,m,x){d||(d=30);var A=function(S,R,V){return function(){return S.apply(R,V)}};this.timeout=setTimeout(A(m,h,x),d*1e3),this.cancel=function(){clearTimeout(this.timeout)}},O=function(h,d,m,x,A){if(!("WebSocket"in t&&t.WebSocket!==null))throw new Error(f(c.UNSUPPORTED,["WebSocket"]));if(!("ArrayBuffer"in t&&t.ArrayBuffer!==null))throw new Error(f(c.UNSUPPORTED,["ArrayBuffer"]));this._trace("Paho.Client",h,d,m,x,A),this.host=d,this.port=m,this.path=x,this.uri=h,this.clientId=A,this._wsuri=null,this._localKey=d+":"+m+(x!="/mqtt"?":"+x:"")+":"+A+":",this._msg_queue=[],this._buffered_msg_queue=[],this._sentMessages={},this._receivedMessages={},this._notify_msg_sent={},this._message_identifier=1,this._sequence=0;for(var S in i)(S.indexOf("Sent:"+this._localKey)===0||S.indexOf("Received:"+this._localKey)===0)&&this.restore(S)};O.prototype.host=null,O.prototype.port=null,O.prototype.path=null,O.prototype.uri=null,O.prototype.clientId=null,O.prototype.socket=null,O.prototype.connected=!1,O.prototype.maxMessageIdentifier=65536,O.prototype.connectOptions=null,O.prototype.hostIndex=null,O.prototype.onConnected=null,O.prototype.onConnectionLost=null,O.prototype.onMessageDelivered=null,O.prototype.onMessageArrived=null,O.prototype.traceFunction=null,O.prototype._msg_queue=null,O.prototype._buffered_msg_queue=null,O.prototype._connectTimeout=null,O.prototype.sendPinger=null,O.prototype.receivePinger=null,O.prototype._reconnectInterval=1,O.prototype._reconnecting=!1,O.prototype._reconnectTimeout=null,O.prototype.disconnectedPublishing=!1,O.prototype.disconnectedBufferSize=5e3,O.prototype.receiveBuffer=null,O.prototype._traceBuffer=null,O.prototype._MAX_TRACE_ENTRIES=100,O.prototype.connect=function(h){var d=this._traceMask(h,"password");if(this._trace("Client.connect",d,this.socket,this.connected),this.connected)throw new Error(f(c.INVALID_STATE,["already connected"]));if(this.socket)throw new Error(f(c.INVALID_STATE,["already connected"]));this._reconnecting&&(this._reconnectTimeout.cancel(),this._reconnectTimeout=null,this._reconnecting=!1),this.connectOptions=h,this._reconnectInterval=1,this._reconnecting=!1,h.uris?(this.hostIndex=0,this._doConnect(h.uris[0])):this._doConnect(this.uri)},O.prototype.subscribe=function(h,d){if(this._trace("Client.subscribe",h,d),!this.connected)throw new Error(f(c.INVALID_STATE,["not connected"]));var m=new v(o.SUBSCRIBE);m.topics=[h],d.qos!==void 0?m.requestedQos=[d.qos]:m.requestedQos=[0],d.onSuccess&&(m.onSuccess=function(x){d.onSuccess({invocationContext:d.invocationContext,grantedQos:x})}),d.onFailure&&(m.onFailure=function(x){d.onFailure({invocationContext:d.invocationContext,errorCode:x,errorMessage:f(x)})}),d.timeout&&(m.timeOut=new q(this,d.timeout,d.onFailure,[{invocationContext:d.invocationContext,errorCode:c.SUBSCRIBE_TIMEOUT.code,errorMessage:f(c.SUBSCRIBE_TIMEOUT)}])),this._requires_ack(m),this._schedule_message(m)},O.prototype.unsubscribe=function(h,d){if(this._trace("Client.unsubscribe",h,d),!this.connected)throw new Error(f(c.INVALID_STATE,["not connected"]));var m=new v(o.UNSUBSCRIBE);m.topics=[h],d.onSuccess&&(m.callback=function(){d.onSuccess({invocationContext:d.invocationContext})}),d.timeout&&(m.timeOut=new q(this,d.timeout,d.onFailure,[{invocationContext:d.invocationContext,errorCode:c.UNSUBSCRIBE_TIMEOUT.code,errorMessage:f(c.UNSUBSCRIBE_TIMEOUT)}])),this._requires_ack(m),this._schedule_message(m)},O.prototype.send=function(h){this._trace("Client.send",h);var d=new v(o.PUBLISH);if(d.payloadMessage=h,this.connected)h.qos>0?this._requires_ack(d):this.onMessageDelivered&&(this._notify_msg_sent[d]=this.onMessageDelivered(d.payloadMessage)),this._schedule_message(d);else if(this._reconnecting&&this.disconnectedPublishing){var m=Object.keys(this._sentMessages).length+this._buffered_msg_queue.length;if(m>this.disconnectedBufferSize)throw new Error(f(c.BUFFER_FULL,[this.disconnectedBufferSize]));h.qos>0?this._requires_ack(d):(d.sequence=++this._sequence,this._buffered_msg_queue.unshift(d))}else throw new Error(f(c.INVALID_STATE,["not connected"]))},O.prototype.disconnect=function(){if(this._trace("Client.disconnect"),this._reconnecting&&(this._reconnectTimeout.cancel(),this._reconnectTimeout=null,this._reconnecting=!1),!this.socket)throw new Error(f(c.INVALID_STATE,["not connecting or connected"]));var h=new v(o.DISCONNECT);this._notify_msg_sent[h]=s(this._disconnected,this),this._schedule_message(h)},O.prototype.getTraceLog=function(){if(this._traceBuffer!==null){this._trace("Client.getTraceLog",new Date),this._trace("Client.getTraceLog in flight messages",this._sentMessages.length);for(var h in this._sentMessages)this._trace("_sentMessages ",h,this._sentMessages[h]);for(var h in this._receivedMessages)this._trace("_receivedMessages ",h,this._receivedMessages[h]);return this._traceBuffer}},O.prototype.startTrace=function(){this._traceBuffer===null&&(this._traceBuffer=[]),this._trace("Client.startTrace",new Date,n)},O.prototype.stopTrace=function(){delete this._traceBuffer},O.prototype._doConnect=function(h){if(this.connectOptions.useSSL){var d=h.split(":");d[0]="wss",h=d.join(":")}this._wsuri=h,this.connected=!1,this.connectOptions.mqttVersion<4?this.socket=new WebSocket(h,["mqttv3.1"]):this.socket=new WebSocket(h,["mqtt"]),this.socket.binaryType="arraybuffer",this.socket.onopen=s(this._on_socket_open,this),this.socket.onmessage=s(this._on_socket_message,this),this.socket.onerror=s(this._on_socket_error,this),this.socket.onclose=s(this._on_socket_close,this),this.sendPinger=new F(this,this.connectOptions.keepAliveInterval),this.receivePinger=new F(this,this.connectOptions.keepAliveInterval),this._connectTimeout&&(this._connectTimeout.cancel(),this._connectTimeout=null),this._connectTimeout=new q(this,this.connectOptions.timeout,this._disconnected,[c.CONNECT_TIMEOUT.code,f(c.CONNECT_TIMEOUT)])},O.prototype._schedule_message=function(h){this._msg_queue.unshift(h),this.connected&&this._process_queue()},O.prototype.store=function(h,d){var m={type:d.type,messageIdentifier:d.messageIdentifier,version:1};switch(d.type){case o.PUBLISH:d.pubRecReceived&&(m.pubRecReceived=!0),m.payloadMessage={};for(var x="",A=d.payloadMessage.payloadBytes,S=0;S<A.length;S++)A[S]<=15?x=x+"0"+A[S].toString(16):x=x+A[S].toString(16);m.payloadMessage.payloadHex=x,m.payloadMessage.qos=d.payloadMessage.qos,m.payloadMessage.destinationName=d.payloadMessage.destinationName,d.payloadMessage.duplicate&&(m.payloadMessage.duplicate=!0),d.payloadMessage.retained&&(m.payloadMessage.retained=!0),h.indexOf("Sent:")===0&&(d.sequence===void 0&&(d.sequence=++this._sequence),m.sequence=d.sequence);break;default:throw Error(f(c.INVALID_STORED_DATA,[h+this._localKey+d.messageIdentifier,m]))}i.setItem(h+this._localKey+d.messageIdentifier,JSON.stringify(m))},O.prototype.restore=function(h){var d=i.getItem(h),m=JSON.parse(d),x=new v(m.type,m);switch(m.type){case o.PUBLISH:for(var A=m.payloadMessage.payloadHex,S=new ArrayBuffer(A.length/2),R=new Uint8Array(S),V=0;A.length>=2;){var L=parseInt(A.substring(0,2),16);A=A.substring(2,A.length),R[V++]=L}var J=new e.Message(R);J.qos=m.payloadMessage.qos,J.destinationName=m.payloadMessage.destinationName,m.payloadMessage.duplicate&&(J.duplicate=!0),m.payloadMessage.retained&&(J.retained=!0),x.payloadMessage=J;break;default:throw Error(f(c.INVALID_STORED_DATA,[h,d]))}h.indexOf("Sent:"+this._localKey)===0?(x.payloadMessage.duplicate=!0,this._sentMessages[x.messageIdentifier]=x):h.indexOf("Received:"+this._localKey)===0&&(this._receivedMessages[x.messageIdentifier]=x)},O.prototype._process_queue=function(){for(var h=null;h=this._msg_queue.pop();)this._socket_send(h),this._notify_msg_sent[h]&&(this._notify_msg_sent[h](),delete this._notify_msg_sent[h])},O.prototype._requires_ack=function(h){var d=Object.keys(this._sentMessages).length;if(d>this.maxMessageIdentifier)throw Error("Too many messages:"+d);for(;this._sentMessages[this._message_identifier]!==void 0;)this._message_identifier++;h.messageIdentifier=this._message_identifier,this._sentMessages[h.messageIdentifier]=h,h.type===o.PUBLISH&&this.store("Sent:",h),this._message_identifier===this.maxMessageIdentifier&&(this._message_identifier=1)},O.prototype._on_socket_open=function(){var h=new v(o.CONNECT,this.connectOptions);h.clientId=this.clientId,this._socket_send(h)},O.prototype._on_socket_message=function(h){this._trace("Client._on_socket_message",h.data);for(var d=this._deframeMessages(h.data),m=0;m<d.length;m+=1)this._handleMessage(d[m])},O.prototype._deframeMessages=function(h){var d=new Uint8Array(h),m=[];if(this.receiveBuffer){var x=new Uint8Array(this.receiveBuffer.length+d.length);x.set(this.receiveBuffer),x.set(d,this.receiveBuffer.length),d=x,delete this.receiveBuffer}try{for(var A=0;A<d.length;){var S=b(d,A),R=S[0];if(A=S[1],R!==null)m.push(R);else break}A<d.length&&(this.receiveBuffer=d.subarray(A))}catch(L){var V=L.hasOwnProperty("stack")=="undefined"?L.stack.toString():"No Error Stack Available";this._disconnected(c.INTERNAL_ERROR.code,f(c.INTERNAL_ERROR,[L.message,V]));return}return m},O.prototype._handleMessage=function(h){this._trace("Client._handleMessage",h);try{switch(h.type){case o.CONNACK:if(this._connectTimeout.cancel(),this._reconnectTimeout&&this._reconnectTimeout.cancel(),this.connectOptions.cleanSession){for(var d in this._sentMessages){var g=this._sentMessages[d];i.removeItem("Sent:"+this._localKey+g.messageIdentifier)}this._sentMessages={};for(var d in this._receivedMessages){var J=this._receivedMessages[d];i.removeItem("Received:"+this._localKey+J.messageIdentifier)}this._receivedMessages={}}if(h.returnCode===0)this.connected=!0,this.connectOptions.uris&&(this.hostIndex=this.connectOptions.uris.length);else{this._disconnected(c.CONNACK_RETURNCODE.code,f(c.CONNACK_RETURNCODE,[h.returnCode,u[h.returnCode]]));break}var A=[];for(var m in this._sentMessages)this._sentMessages.hasOwnProperty(m)&&A.push(this._sentMessages[m]);if(this._buffered_msg_queue.length>0)for(var x=null;x=this._buffered_msg_queue.pop();)A.push(x),this.onMessageDelivered&&(this._notify_msg_sent[x]=this.onMessageDelivered(x.payloadMessage));for(var A=A.sort(function(K,Ne){return K.sequence-Ne.sequence}),S=0,R=A.length;S<R;S++){var g=A[S];if(g.type==o.PUBLISH&&g.pubRecReceived){var V=new v(o.PUBREL,{messageIdentifier:g.messageIdentifier});this._schedule_message(V)}else this._schedule_message(g)}this.connectOptions.onSuccess&&this.connectOptions.onSuccess({invocationContext:this.connectOptions.invocationContext});var L=!1;this._reconnecting&&(L=!0,this._reconnectInterval=1,this._reconnecting=!1),this._connected(L,this._wsuri),this._process_queue();break;case o.PUBLISH:this._receivePublish(h);break;case o.PUBACK:var g=this._sentMessages[h.messageIdentifier];g&&(delete this._sentMessages[h.messageIdentifier],i.removeItem("Sent:"+this._localKey+h.messageIdentifier),this.onMessageDelivered&&this.onMessageDelivered(g.payloadMessage));break;case o.PUBREC:var g=this._sentMessages[h.messageIdentifier];if(g){g.pubRecReceived=!0;var V=new v(o.PUBREL,{messageIdentifier:h.messageIdentifier});this.store("Sent:",g),this._schedule_message(V)}break;case o.PUBREL:var J=this._receivedMessages[h.messageIdentifier];i.removeItem("Received:"+this._localKey+h.messageIdentifier),J&&(this._receiveMessage(J),delete this._receivedMessages[h.messageIdentifier]);var P=new v(o.PUBCOMP,{messageIdentifier:h.messageIdentifier});this._schedule_message(P);break;case o.PUBCOMP:var g=this._sentMessages[h.messageIdentifier];delete this._sentMessages[h.messageIdentifier],i.removeItem("Sent:"+this._localKey+h.messageIdentifier),this.onMessageDelivered&&this.onMessageDelivered(g.payloadMessage);break;case o.SUBACK:var g=this._sentMessages[h.messageIdentifier];g&&(g.timeOut&&g.timeOut.cancel(),h.returnCode[0]===128?g.onFailure&&g.onFailure(h.returnCode):g.onSuccess&&g.onSuccess(h.returnCode),delete this._sentMessages[h.messageIdentifier]);break;case o.UNSUBACK:var g=this._sentMessages[h.messageIdentifier];g&&(g.timeOut&&g.timeOut.cancel(),g.callback&&g.callback(),delete this._sentMessages[h.messageIdentifier]);break;case o.PINGRESP:this.sendPinger.reset();break;case o.DISCONNECT:this._disconnected(c.INVALID_MQTT_MESSAGE_TYPE.code,f(c.INVALID_MQTT_MESSAGE_TYPE,[h.type]));break;default:this._disconnected(c.INVALID_MQTT_MESSAGE_TYPE.code,f(c.INVALID_MQTT_MESSAGE_TYPE,[h.type]))}}catch(K){var G=K.hasOwnProperty("stack")=="undefined"?K.stack.toString():"No Error Stack Available";this._disconnected(c.INTERNAL_ERROR.code,f(c.INTERNAL_ERROR,[K.message,G]));return}},O.prototype._on_socket_error=function(h){this._reconnecting||this._disconnected(c.SOCKET_ERROR.code,f(c.SOCKET_ERROR,[h.data]))},O.prototype._on_socket_close=function(){this._reconnecting||this._disconnected(c.SOCKET_CLOSE.code,f(c.SOCKET_CLOSE))},O.prototype._socket_send=function(h){if(h.type==1){var d=this._traceMask(h,"password");this._trace("Client._socket_send",d)}else this._trace("Client._socket_send",h);this.socket.send(h.encode()),this.sendPinger.reset()},O.prototype._receivePublish=function(h){switch(h.payloadMessage.qos){case"undefined":case 0:this._receiveMessage(h);break;case 1:var d=new v(o.PUBACK,{messageIdentifier:h.messageIdentifier});this._schedule_message(d),this._receiveMessage(h);break;case 2:this._receivedMessages[h.messageIdentifier]=h,this.store("Received:",h);var m=new v(o.PUBREC,{messageIdentifier:h.messageIdentifier});this._schedule_message(m);break;default:throw Error("Invaild qos="+h.payloadMessage.qos)}},O.prototype._receiveMessage=function(h){this.onMessageArrived&&this.onMessageArrived(h.payloadMessage)},O.prototype._connected=function(h,d){this.onConnected&&this.onConnected(h,d)},O.prototype._reconnect=function(){this._trace("Client._reconnect"),this.connected||(this._reconnecting=!0,this.sendPinger.cancel(),this.receivePinger.cancel(),this._reconnectInterval<128&&(this._reconnectInterval=this._reconnectInterval*2),this.connectOptions.uris?(this.hostIndex=0,this._doConnect(this.connectOptions.uris[0])):this._doConnect(this.uri))},O.prototype._disconnected=function(h,d){if(this._trace("Client._disconnected",h,d),h!==void 0&&this._reconnecting){this._reconnectTimeout=new q(this,this._reconnectInterval,this._reconnect);return}if(this.sendPinger.cancel(),this.receivePinger.cancel(),this._connectTimeout&&(this._connectTimeout.cancel(),this._connectTimeout=null),this._msg_queue=[],this._buffered_msg_queue=[],this._notify_msg_sent={},this.socket&&(this.socket.onopen=null,this.socket.onmessage=null,this.socket.onerror=null,this.socket.onclose=null,this.socket.readyState===1&&this.socket.close(),delete this.socket),this.connectOptions.uris&&this.hostIndex<this.connectOptions.uris.length-1)this.hostIndex++,this._doConnect(this.connectOptions.uris[this.hostIndex]);else if(h===void 0&&(h=c.OK.code,d=f(c.OK)),this.connected){if(this.connected=!1,this.onConnectionLost&&this.onConnectionLost({errorCode:h,errorMessage:d,reconnect:this.connectOptions.reconnect,uri:this._wsuri}),h!==c.OK.code&&this.connectOptions.reconnect){this._reconnectInterval=1,this._reconnect();return}}else this.connectOptions.mqttVersion===4&&this.connectOptions.mqttVersionExplicit===!1?(this._trace("Failed to connect V4, dropping back to V3"),this.connectOptions.mqttVersion=3,this.connectOptions.uris?(this.hostIndex=0,this._doConnect(this.connectOptions.uris[0])):this._doConnect(this.uri)):this.connectOptions.onFailure&&this.connectOptions.onFailure({invocationContext:this.connectOptions.invocationContext,errorCode:h,errorMessage:d})},O.prototype._trace=function(){if(this.traceFunction){var h=Array.prototype.slice.call(arguments);for(var d in h)typeof h[d]<"u"&&h.splice(d,1,JSON.stringify(h[d]));var m=h.join("");this.traceFunction({severity:"Debug",message:m})}if(this._traceBuffer!==null)for(var d=0,x=arguments.length;d<x;d++)this._traceBuffer.length==this._MAX_TRACE_ENTRIES&&this._traceBuffer.shift(),d===0?this._traceBuffer.push(arguments[d]):typeof arguments[d]>"u"?this._traceBuffer.push(arguments[d]):this._traceBuffer.push("  "+JSON.stringify(arguments[d]))},O.prototype._traceMask=function(h,d){var m={};for(var x in h)h.hasOwnProperty(x)&&(x==d?m[x]="******":m[x]=h[x]);return m};var M=function(h,d,m,x){var A;if(typeof h!="string")throw new Error(f(c.INVALID_TYPE,[typeof h,"host"]));if(arguments.length==2){x=d,A=h;var S=A.match(/^(wss?):\/\/((\[(.+)\])|([^\/]+?))(:(\d+))?(\/.*)$/);if(S)h=S[4]||S[2],d=parseInt(S[7]),m=S[8];else throw new Error(f(c.INVALID_ARGUMENT,[h,"host"]))}else{if(arguments.length==3&&(x=m,m="/mqtt"),typeof d!="number"||d<0)throw new Error(f(c.INVALID_TYPE,[typeof d,"port"]));if(typeof m!="string")throw new Error(f(c.INVALID_TYPE,[typeof m,"path"]));var R=h.indexOf(":")!==-1&&h.slice(0,1)!=="["&&h.slice(-1)!=="]";A="ws://"+(R?"["+h+"]":h)+":"+d+m}for(var V=0,L=0;L<x.length;L++){var J=x.charCodeAt(L);55296<=J&&J<=56319&&L++,V++}if(typeof x!="string"||V>65535)throw new Error(f(c.INVALID_ARGUMENT,[x,"clientId"]));var P=new O(A,h,d,m,x);Object.defineProperties(this,{host:{get:function(){return h},set:function(){throw new Error(f(c.UNSUPPORTED_OPERATION))}},port:{get:function(){return d},set:function(){throw new Error(f(c.UNSUPPORTED_OPERATION))}},path:{get:function(){return m},set:function(){throw new Error(f(c.UNSUPPORTED_OPERATION))}},uri:{get:function(){return A},set:function(){throw new Error(f(c.UNSUPPORTED_OPERATION))}},clientId:{get:function(){return P.clientId},set:function(){throw new Error(f(c.UNSUPPORTED_OPERATION))}},onConnected:{get:function(){return P.onConnected},set:function(g){if(typeof g=="function")P.onConnected=g;else throw new Error(f(c.INVALID_TYPE,[typeof g,"onConnected"]))}},disconnectedPublishing:{get:function(){return P.disconnectedPublishing},set:function(g){P.disconnectedPublishing=g}},disconnectedBufferSize:{get:function(){return P.disconnectedBufferSize},set:function(g){P.disconnectedBufferSize=g}},onConnectionLost:{get:function(){return P.onConnectionLost},set:function(g){if(typeof g=="function")P.onConnectionLost=g;else throw new Error(f(c.INVALID_TYPE,[typeof g,"onConnectionLost"]))}},onMessageDelivered:{get:function(){return P.onMessageDelivered},set:function(g){if(typeof g=="function")P.onMessageDelivered=g;else throw new Error(f(c.INVALID_TYPE,[typeof g,"onMessageDelivered"]))}},onMessageArrived:{get:function(){return P.onMessageArrived},set:function(g){if(typeof g=="function")P.onMessageArrived=g;else throw new Error(f(c.INVALID_TYPE,[typeof g,"onMessageArrived"]))}},trace:{get:function(){return P.traceFunction},set:function(g){if(typeof g=="function")P.traceFunction=g;else throw new Error(f(c.INVALID_TYPE,[typeof g,"onTrace"]))}}}),this.connect=function(g){if(g=g||{},a(g,{timeout:"number",userName:"string",password:"string",willMessage:"object",keepAliveInterval:"number",cleanSession:"boolean",useSSL:"boolean",invocationContext:"object",onSuccess:"function",onFailure:"function",hosts:"object",ports:"object",reconnect:"boolean",mqttVersion:"number",mqttVersionExplicit:"boolean",uris:"object"}),g.keepAliveInterval===void 0&&(g.keepAliveInterval=60),g.mqttVersion>4||g.mqttVersion<3)throw new Error(f(c.INVALID_ARGUMENT,[g.mqttVersion,"connectOptions.mqttVersion"]));if(g.mqttVersion===void 0?(g.mqttVersionExplicit=!1,g.mqttVersion=4):g.mqttVersionExplicit=!0,g.password!==void 0&&g.userName===void 0)throw new Error(f(c.INVALID_ARGUMENT,[g.password,"connectOptions.password"]));if(g.willMessage){if(!(g.willMessage instanceof U))throw new Error(f(c.INVALID_TYPE,[g.willMessage,"connectOptions.willMessage"]));if(g.willMessage.stringPayload=null,typeof g.willMessage.destinationName>"u")throw new Error(f(c.INVALID_TYPE,[typeof g.willMessage.destinationName,"connectOptions.willMessage.destinationName"]))}if(typeof g.cleanSession>"u"&&(g.cleanSession=!0),g.hosts){if(!(g.hosts instanceof Array))throw new Error(f(c.INVALID_ARGUMENT,[g.hosts,"connectOptions.hosts"]));if(g.hosts.length<1)throw new Error(f(c.INVALID_ARGUMENT,[g.hosts,"connectOptions.hosts"]));for(var G=!1,K=0;K<g.hosts.length;K++){if(typeof g.hosts[K]!="string")throw new Error(f(c.INVALID_TYPE,[typeof g.hosts[K],"connectOptions.hosts["+K+"]"]));if(/^(wss?):\/\/((\[(.+)\])|([^\/]+?))(:(\d+))?(\/.*)$/.test(g.hosts[K])){if(K===0)G=!0;else if(!G)throw new Error(f(c.INVALID_ARGUMENT,[g.hosts[K],"connectOptions.hosts["+K+"]"]))}else if(G)throw new Error(f(c.INVALID_ARGUMENT,[g.hosts[K],"connectOptions.hosts["+K+"]"]))}if(G)g.uris=g.hosts;else{if(!g.ports)throw new Error(f(c.INVALID_ARGUMENT,[g.ports,"connectOptions.ports"]));if(!(g.ports instanceof Array))throw new Error(f(c.INVALID_ARGUMENT,[g.ports,"connectOptions.ports"]));if(g.hosts.length!==g.ports.length)throw new Error(f(c.INVALID_ARGUMENT,[g.ports,"connectOptions.ports"]));g.uris=[];for(var K=0;K<g.hosts.length;K++){if(typeof g.ports[K]!="number"||g.ports[K]<0)throw new Error(f(c.INVALID_TYPE,[typeof g.ports[K],"connectOptions.ports["+K+"]"]));var Ne=g.hosts[K],Y=g.ports[K],Oc=Ne.indexOf(":")!==-1;A="ws://"+(Oc?"["+Ne+"]":Ne)+":"+Y+m,g.uris.push(A)}}}P.connect(g)},this.subscribe=function(g,G){if(typeof g!="string")throw new Error("Invalid argument:"+g);if(G=G||{},a(G,{qos:"number",invocationContext:"object",onSuccess:"function",onFailure:"function",timeout:"number"}),G.timeout&&!G.onFailure)throw new Error("subscribeOptions.timeout specified with no onFailure callback.");if(typeof G.qos<"u"&&!(G.qos===0||G.qos===1||G.qos===2))throw new Error(f(c.INVALID_ARGUMENT,[G.qos,"subscribeOptions.qos"]));P.subscribe(g,G)},this.unsubscribe=function(g,G){if(typeof g!="string")throw new Error("Invalid argument:"+g);if(G=G||{},a(G,{invocationContext:"object",onSuccess:"function",onFailure:"function",timeout:"number"}),G.timeout&&!G.onFailure)throw new Error("unsubscribeOptions.timeout specified with no onFailure callback.");P.unsubscribe(g,G)},this.send=function(g,G,K,Ne){var Y;if(arguments.length===0)throw new Error("Invalid argument.length");if(arguments.length==1){if(!(g instanceof U)&&typeof g!="string")throw new Error("Invalid argument:"+typeof g);if(Y=g,typeof Y.destinationName>"u")throw new Error(f(c.INVALID_ARGUMENT,[Y.destinationName,"Message.destinationName"]));P.send(Y)}else Y=new U(G),Y.destinationName=g,arguments.length>=3&&(Y.qos=K),arguments.length>=4&&(Y.retained=Ne),P.send(Y)},this.publish=function(g,G,K,Ne){var Y;if(arguments.length===0)throw new Error("Invalid argument.length");if(arguments.length==1){if(!(g instanceof U)&&typeof g!="string")throw new Error("Invalid argument:"+typeof g);if(Y=g,typeof Y.destinationName>"u")throw new Error(f(c.INVALID_ARGUMENT,[Y.destinationName,"Message.destinationName"]));P.send(Y)}else Y=new U(G),Y.destinationName=g,arguments.length>=3&&(Y.qos=K),arguments.length>=4&&(Y.retained=Ne),P.send(Y)},this.disconnect=function(){P.disconnect()},this.getTraceLog=function(){return P.getTraceLog()},this.startTrace=function(){P.startTrace()},this.stopTrace=function(){P.stopTrace()},this.isConnected=function(){return P.connected}},U=function(h){var d;if(typeof h=="string"||h instanceof ArrayBuffer||ArrayBuffer.isView(h)&&!(h instanceof DataView))d=h;else throw f(c.INVALID_ARGUMENT,[h,"newPayload"]);var m,x=0,A=!1,S=!1;Object.defineProperties(this,{payloadString:{enumerable:!0,get:function(){return typeof d=="string"?d:C(d,0,d.length)}},payloadBytes:{enumerable:!0,get:function(){if(typeof d=="string"){var R=new ArrayBuffer(I(d)),V=new Uint8Array(R);return D(d,V,0),V}else return d}},destinationName:{enumerable:!0,get:function(){return m},set:function(R){if(typeof R=="string")m=R;else throw new Error(f(c.INVALID_ARGUMENT,[R,"newDestinationName"]))}},qos:{enumerable:!0,get:function(){return x},set:function(R){if(R===0||R===1||R===2)x=R;else throw new Error("Invalid argument:"+R)}},retained:{enumerable:!0,get:function(){return A},set:function(R){if(typeof R=="boolean")A=R;else throw new Error(f(c.INVALID_ARGUMENT,[R,"newRetained"]))}},topic:{enumerable:!0,get:function(){return m},set:function(R){m=R}},duplicate:{enumerable:!0,get:function(){return S},set:function(R){S=R}}})};return{Client:M,Message:U}})(typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{});return e})});var cc=Q(ue=>{"use strict";var Zh=ue&&ue.__extends||(function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}})(),ut=ue&&ue.__assign||function(){return ut=Object.assign||function(r){for(var e,t=1,n=arguments.length;t<n;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=e[i])}return r},ut.apply(this,arguments)},ac=ue&&ue.__awaiter||function(r,e,t,n){function i(o){return o instanceof t?o:new t(function(a){a(o)})}return new(t||(t=Promise))(function(o,a){function s(f){try{u(n.next(f))}catch(l){a(l)}}function c(f){try{u(n.throw(f))}catch(l){a(l)}}function u(f){f.done?o(f.value):i(f.value).then(s,c)}u((n=n.apply(r,e||[])).next())})},sc=ue&&ue.__generator||function(r,e){var t={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(u){return function(f){return c([u,f])}}function c(u){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(t=0)),t;)try{if(n=1,i&&(o=u[0]&2?i.return:u[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,u[1])).done)return o;switch(i=0,o&&(u=[u[0]&2,o.value]),u[0]){case 0:case 1:o=u;break;case 4:return t.label++,{value:u[1],done:!1};case 5:t.label++,i=u[1],u=[0];continue;case 7:u=t.ops.pop(),t.trys.pop();continue;default:if(o=t.trys,!(o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){t.label=u[1];break}if(u[0]===6&&t.label<o[1]){t.label=o[1],o=u;break}if(o&&t.label<o[2]){t.label=o[2],t.ops.push(u);break}o[2]&&t.ops.pop(),t.trys.pop();continue}u=e.call(r,t)}catch(f){u=[6,f],i=0}finally{n=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},uc=ue&&ue.__rest||function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t};Object.defineProperty(ue,"__esModule",{value:!0});ue.SubscriptionHandshakeLink=ue.CONTROL_EVENTS_KEY=void 0;var Un=(xt(),le(zt)),$h=qn(),Xh=oc(),ep=(te(),le(_i)),Do=$h.rootLogger.extend("subscriptions"),tp=Do.extend("mqtt");ue.CONTROL_EVENTS_KEY="@@controlEvents";var rp=(function(r){Zh(e,r);function e(t){var n=r.call(this)||this;return n.topicObservers=new Map,n.clientObservers=new Map,n.onMessage=function(i,o,a){var s=JSON.parse(o),c=n.topicObservers.get(i),u=a.reduce(function(f,l){return f[l]=f[l]||null,f},s.data||{});Do("Message received",{data:u,topic:i,observers:c}),c.forEach(function(f){try{f.next(ut(ut({},s),{data:u}))}catch(l){Do(l)}})},n.subsInfoContextKey=t,n}return e.prototype.request=function(t){var n,i=this,o=t.getContext(),a=this.subsInfoContextKey,s=o[a],c=o.controlMessages,u=c===void 0?(n={},n[ue.CONTROL_EVENTS_KEY]=void 0,n):c,f=ue.CONTROL_EVENTS_KEY,l=u[f],p=s.extensions,v=p===void 0?{subscription:{newSubscriptions:{},mqttConnections:[]}}:p,b=v.subscription,y=b.newSubscriptions,_=b.mqttConnections,T=s.errors,k=T===void 0?[]:T;if(k&&k.length)return new Un.Observable(function(F){return F.error(new Un.ApolloError({errorMessage:"Error during subscription handshake",extraInfo:{errors:k},graphQLErrors:k})),function(){}});var I=Object.keys(y).map(function(F){return y[F].topic}),D=new Set(I.filter(function(F){return i.topicObservers.has(F)})),C=new Set(I.filter(function(F){return!D.has(F)}));return new Un.Observable(function(F){D.forEach(function(O){i.topicObservers.get(O).add(F);var M=Array.from(i.topicObservers.get(O)).find(function(){return!0}),U=Array.from(i.clientObservers).find(function(h){var d=h[1].observers;return d.has(M)})[0];i.clientObservers.get(U).observers.add(F)});var q=_.filter(function(O){return O.topics.some(function(M){return C.has(M)})}).map(function(O){var M=O.topics,U=uc(O,["topics"]);return ut(ut({},U),{topics:M.filter(function(h){return C.has(h)})})});return i.connectNewClients(q,F,t),function(){var O=Array.from(i.clientObservers).filter(function(M){var U=M[1].observers;return U.has(F)});O.forEach(function(M){var U=M[0];return i.clientObservers.get(U).observers.delete(F)}),i.clientObservers.forEach(function(M){var U=M.observers,h=M.client;U.size===0&&(h.isConnected()&&h.disconnect(),i.clientObservers.delete(h.clientId))}),i.clientObservers=new Map(Array.from(i.clientObservers).filter(function(M){var U=M[1].observers;return U.size>0})),i.topicObservers.forEach(function(M){return M.delete(F)}),i.topicObservers=new Map(Array.from(i.topicObservers).filter(function(M){var U=M[1];return U.size>0}))}}).filter(function(F){var q=F.extensions,O=q===void 0?{}:q,M=O.controlMsgType,U=M===void 0?void 0:M,h=typeof U<"u";return l===!0||!h})},e.prototype.connectNewClients=function(t,n,i){return ac(this,void 0,void 0,function(){var o,a,s,c,u=this;return sc(this,function(f){return o=i.query,a=(0,ep.getMainDefinition)(o).selectionSet.selections.map(function(l){var p=l.name.value;return p}),s=Promise.all(t.map(function(l){return u.connectNewClient(l,n,a)})),c=a.reduce(function(l,p){return l[p]=l[p]||null,l},{}),n.next({data:c,extensions:{controlMsgType:"CONNECTED",controlMsgInfo:{connectionInfo:t}}}),[2,s]})})},e.prototype.connectNewClient=function(t,n,i){return ac(this,void 0,void 0,function(){var o,a,s,c,u=this;return sc(this,function(f){switch(f.label){case 0:return o=t.client,a=t.url,s=t.topics,c=new Xh.Client(a,o),c.trace=tp.bind(null,o),c.onConnectionLost=function(l){var p=l.errorCode,v=uc(l,["errorCode"]);p!==0&&s.forEach(function(b){u.topicObservers.has(b)&&u.topicObservers.get(b).forEach(function(y){return y.error(ut(ut({},v),{permanent:!0}))})}),s.forEach(function(b){return u.topicObservers.delete(b)})},c.onMessageArrived=function(l){var p=l.destinationName,v=l.payloadString;return u.onMessage(p,v,i)},[4,new Promise(function(l,p){c.connect({useSSL:a.indexOf("wss://")===0,mqttVersion:3,onSuccess:function(){return l(c)},onFailure:p})})];case 1:return f.sent(),[4,this.subscribeToTopics(c,s,n)];case 2:return f.sent(),[2,c]}})})},e.prototype.subscribeToTopics=function(t,n,i){var o=this;return Promise.all(n.map(function(a){return o.subscribeToTopic(t,a,i)}))},e.prototype.subscribeToTopic=function(t,n,i){var o=this;return new Promise(function(a,s){t.subscribe(n,{onSuccess:function(){o.topicObservers.has(n)||o.topicObservers.set(n,new Set),o.clientObservers.has(t.clientId)||o.clientObservers.set(t.clientId,{client:t,observers:new Set}),o.topicObservers.get(n).add(i),o.clientObservers.get(t.clientId).observers.add(i),a(n)},onFailure:s})})},e})(Un.ApolloLink);ue.SubscriptionHandshakeLink=rp});var fc={};lt(fc,{setContext:()=>np});function np(r){return new re(function(e,t){var n=ve(e,[]);return new B.default(function(i){var o;return Promise.resolve(n).then(function(a){return r(a,e.getContext())}).then(e.setContext).then(function(){o=t(e).subscribe({next:i.next.bind(i),error:i.error.bind(i),complete:i.complete.bind(i)})}).catch(i.error.bind(i)),function(){o&&o.unsubscribe()}})})}var lc=N(()=>{"use strict";$();_t();te()});var hc=Q(Ie=>{"use strict";var ip=Ie&&Ie.__extends||(function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}})(),jn=Ie&&Ie.__assign||function(){return jn=Object.assign||function(r){for(var e,t=1,n=arguments.length;t<n;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=e[i])}return r},jn.apply(this,arguments)},op=Ie&&Ie.__awaiter||function(r,e,t,n){function i(o){return o instanceof t?o:new t(function(a){a(o)})}return new(t||(t=Promise))(function(o,a){function s(f){try{u(n.next(f))}catch(l){a(l)}}function c(f){try{u(n.throw(f))}catch(l){a(l)}}function u(f){f.done?o(f.value):i(f.value).then(s,c)}u((n=n.apply(r,e||[])).next())})},ap=Ie&&Ie.__generator||function(r,e){var t={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(u){return function(f){return c([u,f])}}function c(u){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(t=0)),t;)try{if(n=1,i&&(o=u[0]&2?i.return:u[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,u[1])).done)return o;switch(i=0,o&&(u=[u[0]&2,o.value]),u[0]){case 0:case 1:o=u;break;case 4:return t.label++,{value:u[1],done:!1};case 5:t.label++,i=u[1],u=[0];continue;case 7:u=t.ops.pop(),t.trys.pop();continue;default:if(o=t.trys,!(o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){t.label=u[1];break}if(u[0]===6&&t.label<o[1]){t.label=o[1],o=u;break}if(o&&t.label<o[2]){t.label=o[2],t.ops.push(u);break}o[2]&&t.ops.pop(),t.trys.pop();continue}u=e.call(r,t)}catch(f){u=[6,f],i=0}finally{n=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}};Object.defineProperty(Ie,"__esModule",{value:!0});Ie.NonTerminatingLink=void 0;var sp=(xt(),le(zt)),up=(lc(),le(fc)),cp=(function(r){ip(e,r);function e(t,n){var i=n.link,o=r.call(this)||this;return o.contextKey=t,o.link=i,o}return e.prototype.request=function(t,n){var i=this;return(0,up.setContext)(function(o,a){return op(i,void 0,void 0,function(){var s,c,u=this;return ap(this,function(f){switch(f.label){case 0:return[4,new Promise(function(l,p){u.link.request(t).subscribe({next:l,error:p})})];case 1:return s=f.sent(),[2,jn(jn({},a),(c={},c[this.contextKey]=s,c))]}})})}).request(t,n)},e})(sp.ApolloLink);Ie.NonTerminatingLink=cp});var pc=Q(be=>{"use strict";Object.defineProperty(be,"__esModule",{value:!0});be.CONTROL_MSG=be.MESSAGE_TYPES=be.SOCKET_STATUS=be.SUBSCRIPTION_STATUS=void 0;var fp;(function(r){r[r.PENDING=0]="PENDING",r[r.CONNECTED=1]="CONNECTED",r[r.FAILED=2]="FAILED"})(fp=be.SUBSCRIPTION_STATUS||(be.SUBSCRIPTION_STATUS={}));var lp;(function(r){r[r.CLOSED=0]="CLOSED",r[r.READY=1]="READY",r[r.CONNECTING=2]="CONNECTING"})(lp=be.SOCKET_STATUS||(be.SOCKET_STATUS={}));var hp;(function(r){r.GQL_CONNECTION_INIT="connection_init",r.GQL_CONNECTION_ERROR="connection_error",r.GQL_CONNECTION_ACK="connection_ack",r.GQL_START="start",r.GQL_START_ACK="start_ack",r.GQL_DATA="data",r.GQL_CONNECTION_KEEP_ALIVE="ka",r.GQL_STOP="stop",r.GQL_COMPLETE="complete",r.GQL_ERROR="error"})(hp=be.MESSAGE_TYPES||(be.MESSAGE_TYPES={}));var pp;(function(r){r.CONNECTION_CLOSED="Connection closed",r.TIMEOUT_DISCONNECT="Timeout disconnect",r.SUBSCRIPTION_ACK="Subscription ack"})(pp=be.CONTROL_MSG||(be.CONTROL_MSG={}))});var dc=Q(_e=>{"use strict";var dp=_e&&_e.__extends||(function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}})(),vp=_e&&_e.__awaiter||function(r,e,t,n){function i(o){return o instanceof t?o:new t(function(a){a(o)})}return new(t||(t=Promise))(function(o,a){function s(f){try{u(n.next(f))}catch(l){a(l)}}function c(f){try{u(n.throw(f))}catch(l){a(l)}}function u(f){f.done?o(f.value):i(f.value).then(s,c)}u((n=n.apply(r,e||[])).next())})},yp=_e&&_e.__generator||function(r,e){var t={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(u){return function(f){return c([u,f])}}function c(u){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(t=0)),t;)try{if(n=1,i&&(o=u[0]&2?i.return:u[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,u[1])).done)return o;switch(i=0,o&&(u=[u[0]&2,o.value]),u[0]){case 0:case 1:o=u;break;case 4:return t.label++,{value:u[1],done:!1};case 5:t.label++,i=u[1],u=[0];continue;case 7:u=t.ops.pop(),t.trys.pop();continue;default:if(o=t.trys,!(o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){t.label=u[1];break}if(u[0]===6&&t.label<o[1]){t.label=o[1],o=u;break}if(o&&t.label<o[2]){t.label=o[2],t.ops.push(u);break}o[2]&&t.ops.pop(),t.trys.pop();continue}u=e.call(r,t)}catch(f){u=[6,f],i=0}finally{n=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}};Object.defineProperty(_e,"__esModule",{value:!0});_e.jitteredExponentialRetry=_e.retry=_e.NonRetryableError=void 0;var mp=qn(),Bn=mp.rootLogger.extend("retry"),gp=5e3,bp=(function(r){dp(e,r);function e(t){var n=r.call(this,t)||this;return n.nonRetryable=!0,n}return e})(Error);_e.NonRetryableError=bp;var _p=function(r){var e="nonRetryable";return r&&r[e]};function Mo(r,e,t,n){return n===void 0&&(n=1),vp(this,void 0,void 0,function(){var i,o;return yp(this,function(a){switch(a.label){case 0:Bn("Attempt #".concat(n)),a.label=1;case 1:return a.trys.push([1,3,,8]),[4,r.apply(void 0,e)];case 2:return a.sent(),[3,8];case 3:if(i=a.sent(),Bn("error ".concat(i)),_p(i))throw Bn("non retryable error"),i;return o=t(n,e,i),Bn("retryIn ",o),o===!1?[3,6]:[4,new Promise(function(s){return setTimeout(s,o)})];case 4:return a.sent(),[4,Mo(r,e,t,n+1)];case 5:return[2,a.sent()];case 6:throw i;case 7:return[3,8];case 8:return[2]}})})}_e.retry=Mo;function wp(r){var e=100,t=100;return function(n){var i=Math.pow(2,n)*e+t*Math.random();return i>r?!1:i}}var Ep=function(r,e,t){return t===void 0&&(t=gp),Mo(r,e,wp(t))};_e.jitteredExponentialRetry=Ep});var gc=Q(pe=>{"use strict";var Sp=pe&&pe.__extends||(function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}})(),Se=pe&&pe.__assign||function(){return Se=Object.assign||function(r){for(var e,t=1,n=arguments.length;t<n;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=e[i])}return r},Se.apply(this,arguments)},Ge=pe&&pe.__awaiter||function(r,e,t,n){function i(o){return o instanceof t?o:new t(function(a){a(o)})}return new(t||(t=Promise))(function(o,a){function s(f){try{u(n.next(f))}catch(l){a(l)}}function c(f){try{u(n.throw(f))}catch(l){a(l)}}function u(f){f.done?o(f.value):i(f.value).then(s,c)}u((n=n.apply(r,e||[])).next())})},We=pe&&pe.__generator||function(r,e){var t={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(u){return function(f){return c([u,f])}}function c(u){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(t=0)),t;)try{if(n=1,i&&(o=u[0]&2?i.return:u[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,u[1])).done)return o;switch(i=0,o&&(u=[u[0]&2,o.value]),u[0]){case 0:case 1:o=u;break;case 4:return t.label++,{value:u[1],done:!1};case 5:t.label++,i=u[1],u=[0];continue;case 7:u=t.ops.pop(),t.trys.pop();continue;default:if(o=t.trys,!(o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){t.label=u[1];break}if(u[0]===6&&t.label<o[1]){t.label=o[1],o=u;break}if(o&&t.label<o[2]){t.label=o[2],t.ops.push(u);break}o[2]&&t.ops.pop(),t.trys.pop();continue}u=e.call(r,t)}catch(f){u=[6,f],i=0}finally{n=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}};Object.defineProperty(pe,"__esModule",{value:!0});pe.AppSyncRealTimeSubscriptionHandshakeLink=pe.CONTROL_EVENTS_KEY=void 0;var vc=(xt(),le(zt)),xp=qn(),ct=Io(),tr=(Ze(),le(Fc)),Op=Tn(),Tp=(Ac(),le(Tc)),z=pc(),Po=dc(),ne=xp.rootLogger.extend("subscriptions");pe.CONTROL_EVENTS_KEY="@@controlEvents";var Ap=[400,401,403],kp="appsync",Ip={accept:"application/json, text/javascript","content-encoding":"amz-1.0","content-type":"application/json; charset=UTF-8"},yc=15e3,Np=15e3,Lo=60*1e3,mc=300*1e3,Cp=/^https:\/\/\w{26}\.appsync\-api\.\w{2}(?:(?:\-\w{2,})+)\-\d\.amazonaws.com\/graphql$/i,Rp="/realtime",Fp=(function(r){Sp(e,r);function e(t){var n=t.url,i=t.region,o=t.auth,a=t.keepAliveTimeoutMs,s=r.call(this)||this;if(s.socketStatus=z.SOCKET_STATUS.CLOSED,s.keepAliveTimeout=void 0,s.subscriptionObserverMap=new Map,s.promiseArray=[],s.url=n,s.region=i,s.auth=o,s.keepAliveTimeout=a,s.url&&!s.url.startsWith("https://")&&ne("WARNING: AppSync endpoint URL is not using HTTPS. Credentials may be sent unencrypted: ".concat(s.url)),s.keepAliveTimeout<Lo){var c="keepAliveTimeoutMs";throw new Error("".concat(c," must be greater than or equal to ").concat(Lo," (").concat(s.keepAliveTimeout," used)."))}return s}return e.prototype.isCustomDomain=function(t){return t.match(Cp)===null},e.prototype.request=function(t){var n,i=this,o=t.query,a=t.variables,s=t.getContext(),c=s.controlMessages,u=c===void 0?(n={},n[pe.CONTROL_EVENTS_KEY]=void 0,n):c,f=pe.CONTROL_EVENTS_KEY,l=u[f],p=s.headers;return new vc.Observable(function(v){if(!i.url)v.error({errors:[Se({},new tr.GraphQLError("Subscribe only available for AWS AppSync endpoint"))]}),v.complete();else{var b=(0,Tp.v4)(),y=i.auth.type===ct.AUTH_TYPE.AMAZON_COGNITO_USER_POOLS||i.auth.type===ct.AUTH_TYPE.OPENID_CONNECT?i.auth.jwtToken:null;y=i.auth.type===ct.AUTH_TYPE.AWS_LAMBDA?i.auth.token:y;var _={appSyncGraphqlEndpoint:i.url,authenticationType:i.auth.type,query:(0,tr.print)(o),region:i.region,graphql_headers:function(){return p},variables:a,apiKey:i.auth.type===ct.AUTH_TYPE.API_KEY?i.auth.apiKey:"",credentials:i.auth.type===ct.AUTH_TYPE.AWS_IAM?i.auth.credentials:null,token:y};return i._startSubscriptionWithAWSAppSyncRealTime({options:_,observer:v,subscriptionId:b}),function(){return Ge(i,void 0,void 0,function(){var T;return We(this,function(k){try{if(this._verifySubscriptionAlreadyStarted(b),T=this.subscriptionObserverMap.get(b).subscriptionState,T===z.SUBSCRIPTION_STATUS.CONNECTED)this._sendUnsubscriptionMessage(b);else throw new Error("Subscription has failed, starting to remove subscription.")}catch{return this._removeSubscriptionObserver(b),[2]}return[2]})})}}}).filter(function(v){var b=v.extensions,y=b===void 0?{}:b,_=y.controlMsgType,T=_===void 0?void 0:_,k=typeof T<"u";return l===!0||!k})},e.prototype._verifySubscriptionAlreadyStarted=function(t){return Ge(this,void 0,void 0,function(){var n,i=this;return We(this,function(o){return n=this.subscriptionObserverMap.get(t).subscriptionState,n===z.SUBSCRIPTION_STATUS.PENDING?[2,new Promise(function(a,s){var c=i.subscriptionObserverMap.get(t),u=c.observer,f=c.subscriptionState,l=c.variables,p=c.query;i.subscriptionObserverMap.set(t,{observer:u,subscriptionState:f,variables:l,query:p,subscriptionReadyCallback:a,subscriptionFailedCallback:s})})]:[2]})})},e.prototype._sendUnsubscriptionMessage=function(t){try{if(this.awsRealTimeSocket&&this.awsRealTimeSocket.readyState===WebSocket.OPEN&&this.socketStatus===z.SOCKET_STATUS.READY){var n={id:t,type:z.MESSAGE_TYPES.GQL_STOP},i=JSON.stringify(n);this.awsRealTimeSocket.send(i),this._removeSubscriptionObserver(t)}}catch(o){ne({err:o})}},e.prototype._removeSubscriptionObserver=function(t){this.subscriptionObserverMap.delete(t),setTimeout(this._closeSocketIfRequired.bind(this),1e3)},e.prototype._closeSocketIfRequired=function(){if(!(this.subscriptionObserverMap.size>0)){if(!this.awsRealTimeSocket){this.socketStatus=z.SOCKET_STATUS.CLOSED;return}if(this.awsRealTimeSocket.bufferedAmount>0)setTimeout(this._closeSocketIfRequired.bind(this),1e3);else{ne("closing WebSocket..."),clearTimeout(this.keepAliveTimeoutId);var t=this.awsRealTimeSocket;t.close(1e3),this.awsRealTimeSocket=null,this.socketStatus=z.SOCKET_STATUS.CLOSED}}},e.prototype._startSubscriptionWithAWSAppSyncRealTime=function(t){var n=t.options,i=t.observer,o=t.subscriptionId;return Ge(this,void 0,void 0,function(){var a,s,c,u,f,l,p,v,b,y,_,T,k,I,D,C,F,q,O,M,U,h,d,m,x,A=this;return We(this,function(S){switch(S.label){case 0:return a=n.appSyncGraphqlEndpoint,s=n.authenticationType,c=n.query,u=n.variables,f=n.apiKey,l=n.region,p=n.graphql_headers,v=p===void 0?function(){return{}}:p,b=n.credentials,y=n.token,_=z.SUBSCRIPTION_STATUS.PENDING,T={query:c,variables:u},this.subscriptionObserverMap.set(o,{observer:i,query:c,variables:u,subscriptionState:_,startAckTimeoutId:null}),k=JSON.stringify(T),D=[{}],[4,this._awsRealTimeHeaderBasedAuth({apiKey:f,appSyncGraphqlEndpoint:a,authenticationType:s,payload:k,canonicalUri:"",region:l,credentials:b,token:y,graphql_headers:v})];case 1:I=Se.apply(void 0,[Se.apply(void 0,D.concat([S.sent()])),(x={},x[ct.USER_AGENT_HEADER]=ct.USER_AGENT,x)]),C={id:o,payload:{data:k,extensions:{authorization:Se({},I)}},type:z.MESSAGE_TYPES.GQL_START},F=JSON.stringify(C),S.label=2;case 2:return S.trys.push([2,4,,5]),[4,this._initializeWebSocketConnection({apiKey:f,appSyncGraphqlEndpoint:a,authenticationType:s,region:l,credentials:b,token:y})];case 3:return S.sent(),[3,5];case 4:return q=S.sent(),O=q.message,M=O===void 0?"":O,i.error({errors:[Se({},new tr.GraphQLError("Connection failed: ".concat(M)))]}),i.complete(),U=(this.subscriptionObserverMap.get(o)||{}).subscriptionFailedCallback,typeof U=="function"&&U(),[2];case 5:return h=this.subscriptionObserverMap.get(o)||{},d=h.subscriptionFailedCallback,m=h.subscriptionReadyCallback,this.subscriptionObserverMap.set(o,{observer:i,subscriptionState:_,variables:u,query:c,subscriptionReadyCallback:m,subscriptionFailedCallback:d,startAckTimeoutId:setTimeout(function(){A._timeoutStartSubscriptionAck.call(A,o)},Np)}),this.awsRealTimeSocket&&this.awsRealTimeSocket.send(F),[2]}})})},e.prototype._initializeWebSocketConnection=function(t){var n=this,i=t.appSyncGraphqlEndpoint,o=t.authenticationType,a=t.apiKey,s=t.region,c=t.credentials,u=t.token;if(this.socketStatus!==z.SOCKET_STATUS.READY)return new Promise(function(f,l){return Ge(n,void 0,void 0,function(){var p,v,b,y,_,T,k;return We(this,function(I){switch(I.label){case 0:if(this.promiseArray.push({res:f,rej:l}),this.socketStatus!==z.SOCKET_STATUS.CLOSED)return[3,5];I.label=1;case 1:return I.trys.push([1,4,,5]),this.socketStatus=z.SOCKET_STATUS.CONNECTING,p="{}",[4,this._awsRealTimeHeaderBasedAuth({authenticationType:o,payload:p,canonicalUri:"/connect",apiKey:a,appSyncGraphqlEndpoint:i,region:s,credentials:c,token:u,graphql_headers:function(){}})];case 2:return v=I.sent(),b=JSON.stringify(v),y=Buffer.from(b).toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,""),_=i,this.isCustomDomain(_)?_=_.concat(Rp):_=_.replace("appsync-api","appsync-realtime-api").replace("gogi-beta","grt-beta"),_=_.replace("https://","wss://").replace("http://","ws://"),T=["graphql-ws","header-".concat(y)],[4,this._initializeRetryableHandshake({awsRealTimeUrl:_,protocols:T})];case 3:return I.sent(),this.promiseArray.forEach(function(D){var C=D.res;ne("Notifying connection successful"),C()}),this.socketStatus=z.SOCKET_STATUS.READY,this.promiseArray=[],[3,5];case 4:return k=I.sent(),this.promiseArray.forEach(function(D){var C=D.rej;return C(k)}),this.promiseArray=[],this.awsRealTimeSocket&&this.awsRealTimeSocket.readyState===WebSocket.OPEN&&this.awsRealTimeSocket.close(3001),this.awsRealTimeSocket=null,this.socketStatus=z.SOCKET_STATUS.CLOSED,[3,5];case 5:return[2]}})})})},e.prototype._awsRealTimeHeaderBasedAuth=function(t){var n=t.authenticationType,i=t.payload,o=t.canonicalUri,a=t.appSyncGraphqlEndpoint,s=t.apiKey,c=t.region,u=t.credentials,f=t.token,l=t.graphql_headers;return Ge(this,void 0,void 0,function(){var p,v,b,y;return We(this,function(_){switch(_.label){case 0:if(p={API_KEY:this._awsRealTimeApiKeyHeader.bind(this),AWS_IAM:this._awsRealTimeIAMHeader.bind(this),OPENID_CONNECT:this._awsRealTimeAuthorizationHeader.bind(this),AMAZON_COGNITO_USER_POOLS:this._awsRealTimeAuthorizationHeader.bind(this),AWS_LAMBDA:this._awsRealTimeAuthorizationHeader.bind(this)},v=p[n],typeof v!="function")throw new Po.NonRetryableError("Authentication type ".concat(n," not supported"));return b=Op.parse(a).host,[4,v({payload:i,canonicalUri:o,appSyncGraphqlEndpoint:a,apiKey:s,region:c,host:b,credentials:u,token:f,graphql_headers:l})];case 1:return y=_.sent(),[2,y]}})})},e.prototype._awsRealTimeAuthorizationHeader=function(t){var n=t.host,i=t.token,o=t.graphql_headers;return Ge(this,void 0,void 0,function(){var a,s,c;return We(this,function(u){switch(u.label){case 0:return c={},typeof i!="function"?[3,2]:[4,i.call(void 0)];case 1:return a=u.sent(),[3,4];case 2:return[4,i];case 3:a=u.sent(),u.label=4;case 4:return s=[(c.Authorization=a,c.host=n,c)],[4,o()];case 5:return[2,Se.apply(void 0,s.concat([u.sent()]))]}})})},e.prototype._awsRealTimeApiKeyHeader=function(t){var n=t.apiKey,i=t.host,o=t.graphql_headers;return Ge(this,void 0,void 0,function(){var a,s,c;return We(this,function(u){switch(u.label){case 0:return a=new Date,s=a.toISOString().replace(/[:\-]|\.\d{3}/g,""),c=[{host:i,"x-amz-date":s,"x-api-key":n}],[4,o()];case 1:return[2,Se.apply(void 0,c.concat([u.sent()]))]}})})},e.prototype._awsRealTimeIAMHeader=function(t){var n=t.payload,i=t.canonicalUri,o=t.appSyncGraphqlEndpoint,a=t.region,s=t.credentials;return Ge(this,void 0,void 0,function(){var c,u,f,l,p,v,b,y,_;return We(this,function(T){switch(T.label){case 0:return c={region:a,service:kp},u=typeof s=="function"?s.call():s||{},u&&typeof u.getPromise=="function"?[4,u.getPromise()]:[3,2];case 1:T.sent(),T.label=2;case 2:if(!u)throw new Error("No credentials");return[4,u];case 3:return f=T.sent(),l=f.accessKeyId,p=f.secretAccessKey,v=f.sessionToken,b={access_key:l,secret_key:p,session_token:v},y={url:"".concat(o).concat(i),body:n,method:"POST",headers:Se({},Ip)},_=ct.Signer.sign(y,b,c),[2,_.headers]}})})},e.prototype._initializeRetryableHandshake=function(t){var n=t.awsRealTimeUrl,i=t.protocols;return Ge(this,void 0,void 0,function(){return We(this,function(o){switch(o.label){case 0:return ne("Initializaling retryable Handshake"),[4,(0,Po.jitteredExponentialRetry)(this._initializeHandshake.bind(this),[{awsRealTimeUrl:n,protocols:i}])];case 1:return o.sent(),[2]}})})},e.prototype._initializeHandshake=function(t){var n=t.awsRealTimeUrl,i=t.protocols;return Ge(this,void 0,void 0,function(){var o,a,s,c=this;return We(this,function(u){switch(u.label){case 0:ne("Initializing handshake ".concat(n)),u.label=1;case 1:return u.trys.push([1,4,,5]),[4,(function(){return new Promise(function(f,l){var p=e.createWebSocket(n,i);p.onerror=function(){ne("WebSocket connection error")},p.onclose=function(){l(new Error("Connection handshake error"))},p.onopen=function(){return c.awsRealTimeSocket=p,f()}})})()];case 2:return u.sent(),[4,(function(){return new Promise(function(f,l){var p=!1;c.awsRealTimeSocket.onerror=function(y){ne("WebSocket closed ".concat(JSON.stringify(y)))},c.awsRealTimeSocket.onclose=function(y){ne("WebSocket closed ".concat(y.reason)),l(new Error(JSON.stringify(y)))},c.awsRealTimeSocket.onmessage=function(y){var _,T;try{T=JSON.parse(y.data)}catch{ne("Failed to parse WebSocket message");return}var k=T.type,I=T.payload,D=I===void 0?{}:I,C=D.connectionTimeoutMs,F=C===void 0?mc:C;if(ne("subscription message from AWS AppSyncRealTime: ".concat(k)),k===z.MESSAGE_TYPES.GQL_CONNECTION_ACK){p=!0;var q=typeof F=="number"&&F>=Lo?F:mc;c.keepAliveTimeout=(_=c.keepAliveTimeout)!==null&&_!==void 0?_:q,c.awsRealTimeSocket.onmessage=c._handleIncomingSubscriptionMessage.bind(c),c.awsRealTimeSocket.onerror=function(V){ne(V),c._errorDisconnect(z.CONTROL_MSG.CONNECTION_CLOSED)},c.awsRealTimeSocket.onclose=function(V){ne("WebSocket closed ".concat(V.reason)),c._errorDisconnect(z.CONTROL_MSG.CONNECTION_CLOSED)},f("Cool, connected to AWS AppSyncRealTime");return}if(k===z.MESSAGE_TYPES.GQL_CONNECTION_ERROR){var O=T.payload,M=O===void 0?{}:O,U=M.errors,h=U===void 0?[]:U,d=h[0],m=d===void 0?{}:d,x=m.errorType,A=x===void 0?"":x,S=m.errorCode,R=S===void 0?0:S;l({errorType:A,errorCode:R})}};var v={type:z.MESSAGE_TYPES.GQL_CONNECTION_INIT};c.awsRealTimeSocket.send(JSON.stringify(v));function b(){p||l(new Error("Connection timeout: ack from AWSRealTime was not received on ".concat(yc," ms")))}setTimeout(b.bind(c),yc)})})()];case 3:return u.sent(),[3,5];case 4:throw o=u.sent(),a=o.errorType,s=o.errorCode,Ap.indexOf(s)>=0?new Po.NonRetryableError(a):a?new Error(a):o;case 5:return[2]}})})},e.prototype._handleIncomingSubscriptionMessage=function(t){var n;try{n=JSON.parse(t.data)}catch{ne("Failed to parse incoming subscription message");return}var i=n.id,o=i===void 0?"":i,a=n.payload,s=n.type;ne("subscription message from AWS AppSync RealTime: ".concat(s," id: ").concat(o));var c=this.subscriptionObserverMap.get(o)||{},u=c.observer,f=u===void 0?null:u,l=c.query,p=l===void 0?"":l,v=c.variables,b=v===void 0?{}:v,y=c.startAckTimeoutId,_=y===void 0?0:y,T=c.subscriptionReadyCallback,k=T===void 0?null:T,I=c.subscriptionFailedCallback,D=I===void 0?null:I;if(ne({id:o,observer:f,query:p,variables:b}),s===z.MESSAGE_TYPES.GQL_DATA&&a&&a.data){f?f.next(a):ne("observer not found for id: ".concat(o));return}if(s===z.MESSAGE_TYPES.GQL_START_ACK){ne("subscription ready for ".concat(JSON.stringify({query:p,variables:b}))),typeof k=="function"&&k(),clearTimeout(_),f?f.next({data:a,extensions:{controlMsgType:"CONNECTED"}}):ne("observer not found for id: ".concat(o));var C=z.SUBSCRIPTION_STATUS.CONNECTED;this.subscriptionObserverMap.set(o,{observer:f,query:p,variables:b,startAckTimeoutId:null,subscriptionState:C,subscriptionReadyCallback:k,subscriptionFailedCallback:D});return}if(s===z.MESSAGE_TYPES.GQL_CONNECTION_KEEP_ALIVE){clearTimeout(this.keepAliveTimeoutId),this.keepAliveTimeoutId=setTimeout(this._errorDisconnect.bind(this,z.CONTROL_MSG.TIMEOUT_DISCONNECT),this.keepAliveTimeout);return}if(s===z.MESSAGE_TYPES.GQL_ERROR){var C=z.SUBSCRIPTION_STATUS.FAILED;this.subscriptionObserverMap.set(o,{observer:f,query:p,variables:b,startAckTimeoutId:_,subscriptionReadyCallback:k,subscriptionFailedCallback:D,subscriptionState:C}),clearTimeout(_),f?(f.error({errors:[Se({},new tr.GraphQLError("Connection failed: ".concat(JSON.stringify(a))))]}),f.complete()):ne("observer not found for id: ".concat(o)),typeof D=="function"&&D()}},e.prototype._errorDisconnect=function(t){ne("Disconnect error: ".concat(t)),this.subscriptionObserverMap.forEach(function(n){var i=n.observer;i&&!i.closed&&i.error({errors:[Se({},new tr.GraphQLError(t))]})}),this.subscriptionObserverMap.clear(),this.awsRealTimeSocket&&this.awsRealTimeSocket.close(),this.socketStatus=z.SOCKET_STATUS.CLOSED},e.prototype._timeoutStartSubscriptionAck=function(t){var n=this.subscriptionObserverMap.get(t)||{},i=n.observer,o=n.query,a=n.variables;i&&(this.subscriptionObserverMap.set(t,{observer:i,query:o,variables:a,subscriptionState:z.SUBSCRIPTION_STATUS.FAILED}),i&&!i.closed&&(i.error({errors:[Se({},new tr.GraphQLError("Subscription timeout ".concat(JSON.stringify({query:o,variables:a}))))]}),i.complete()),ne("timeoutStartSubscription",JSON.stringify({query:o,variables:a})))},e.createWebSocket=function(t,n){return new WebSocket(t,n)},e})(vc.ApolloLink);pe.AppSyncRealTimeSubscriptionHandshakeLink=Fp});var wc=Q(ft=>{"use strict";var Dp=ft&&ft.__rest||function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t};Object.defineProperty(ft,"__esModule",{value:!0});ft.createSubscriptionHandshakeLink=ft.CONTROL_EVENTS_KEY=void 0;var Qn=cc();Object.defineProperty(ft,"CONTROL_EVENTS_KEY",{enumerable:!0,get:function(){return Qn.CONTROL_EVENTS_KEY}});var Vn=(xt(),le(zt)),bc=(cn(),le(Ya)),Mp=(te(),le(_i)),_c=hc(),Pp=gc();function Lp(r,e){var t,n;if(typeof r=="string")t=e||(0,bc.createHttpLink)({uri:r}),n=Vn.ApolloLink.from([new _c.NonTerminatingLink("controlMessages",{link:new Vn.ApolloLink(function(o,a){return new Vn.Observable(function(s){var c,u=o,f=u.variables,l=Qn.CONTROL_EVENTS_KEY,p=f[l],v=Dp(f,[typeof l=="symbol"?l:l+""]);return typeof p<"u"&&(o.variables=v),s.next((c={},c[Qn.CONTROL_EVENTS_KEY]=p,c)),function(){}})})}),new _c.NonTerminatingLink("subsInfo",{link:t}),new Qn.SubscriptionHandshakeLink("subsInfo")]);else{var i=r.url;t=e||(0,bc.createHttpLink)({uri:i}),n=new Pp.AppSyncRealTimeSubscriptionHandshakeLink(r)}return Vn.ApolloLink.split(function(o){var a=o.query,s=(0,Mp.getMainDefinition)(a),c=s.kind,u=s.operation,f=c==="OperationDefinition"&&u==="subscription";return f},n,t)}ft.createSubscriptionHandshakeLink=Lp});Ze();var Sc=jr(Io()),xc=jr(wc());xt();var Ec=class{handle(e){return new qo(t=>{let n=typeof e.additionalParams?.aws_appsync_graphqlEndpoint=="string"?e.additionalParams.aws_appsync_graphqlEndpoint:"",i=typeof e.additionalParams?.aws_appsync_region=="string"?e.additionalParams.aws_appsync_region:"",o={type:typeof e.additionalParams?.aws_appsync_authenticationType=="string"?e.additionalParams.aws_appsync_authenticationType:"",apiKey:typeof e.additionalParams?.aws_appsync_apiKey=="string"?e.additionalParams.aws_appsync_apiKey:"",jwtToken:typeof e.additionalParams?.aws_appsync_jwtToken=="string"?e.additionalParams.aws_appsync_jwtToken:"",token:typeof e.additionalParams?.aws_appsync_token=="string"?e.additionalParams.aws_appsync_token:""},a=re.from([(0,Sc.createAuthLink)({url:n,region:i,auth:o}),(0,xc.createSubscriptionHandshakeLink)({url:n,region:i,auth:o})]),s=new _n({link:a,cache:new Ar}),c=Date.now();return this.subscription=s.subscribe({query:Br(e.query),variables:e.variables}).subscribe(Qo(t,e.url,c)),()=>{this.destroy()}})}destroy(){this.subscription?.closed&&this.subscription?.unsubscribe()}};export{Ec as AppSyncRequestHandler};
//# sourceMappingURL=chunk-7THP26YK.js.map

//# debugId=ef7fc831-7e69-5268-85ee-420007271761