@coasys/ad4m-connect 0.10.1-rc9-dev → 0.10.1-rc9-dev2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core.js +67 -63
- package/dist/utils.d.ts +1 -0
- package/dist/utils.js +1 -1
- package/dist/web.js +162 -158
- package/package.json +2 -2
package/dist/web.js
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
var um=Object.defineProperty;var lm=Object.getOwnPropertyDescriptor;var ve=(t,e,r,n)=>{for(var i=n>1?void 0:n?lm(e,r):e,a=t.length-1,o;a>=0;a--)(o=t[a])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&um(e,r,i),i};var pe=(t,e,r)=>new Promise((n,i)=>{var a=u=>{try{s(r.next(u))}catch(c){i(c)}},o=u=>{try{s(r.throw(u))}catch(c){i(c)}},s=u=>u.done?n(u.value):Promise.resolve(u.value).then(a,o);s((r=r.apply(t,e)).next())});import{ZBarSymbolType as re,ZBarConfigType as Pl,scanRGBABuffer as fm,getDefaultScanner as pm}from"https://cdn.jsdelivr.net/npm/@undecaf/zbar-wasm@0.9.15/dist/main.js";function dm(t,e,r,n){return new(r||(r=Promise))(function(i,a){function o(c){try{u(n.next(c))}catch(l){a(l)}}function s(c){try{u(n.throw(c))}catch(l){a(l)}}function u(c){var l;c.done?i(c.value):(l=c.value,l instanceof r?l:new r(function(d){d(l)})).then(o,s)}u((n=n.apply(t,e||[])).next())})}var R=class{constructor(e,r=Pl.ZBAR_CFG_ENABLE,n=1){this.symbolType=e,this.configType=r,this.number=n,this.configSteps=[this]}static register(e,r,n=r.symbolType){return R.formatsToConfigs[e]=r,R.typesToFormats[n]=R.typesToFormats[n]||e,r}static formats(){return Object.keys(R.formatsToConfigs)}static toFormat(e){return R.typesToFormats[e]}static configure(e,r){var n;(n=R.formatsToConfigs[r])===null||n===void 0||n.configSteps.forEach(i=>e.setConfig(i.symbolType,i.configType,i.number))}add(e){return this.configSteps.push(e),this}},Rl;R.formatsToConfigs={},R.typesToFormats={},R.register("codabar",new R(re.ZBAR_CODABAR)),R.register("code_39",new R(re.ZBAR_CODE39)),R.register("code_93",new R(re.ZBAR_CODE93)),R.register("code_128",new R(re.ZBAR_CODE128)),R.register("databar",new R(re.ZBAR_DATABAR)),R.register("databar_exp",new R(re.ZBAR_DATABAR_EXP)),R.register("ean_2",new R(re.ZBAR_EAN2)),R.register("ean_5",new R(re.ZBAR_EAN5)),R.register("ean_8",new R(re.ZBAR_EAN8)),R.register("ean_13",new R(re.ZBAR_EAN13)),R.register("ean_13+2",new R(re.ZBAR_EAN13)).add(new R(re.ZBAR_EAN2)),R.register("ean_13+5",new R(re.ZBAR_EAN13)).add(new R(re.ZBAR_EAN5)),R.register("isbn_10",new R(re.ZBAR_ISBN10)).add(new R(re.ZBAR_EAN13)),R.register("isbn_13",new R(re.ZBAR_ISBN13)).add(new R(re.ZBAR_EAN13)),R.register("isbn_13+2",new R(re.ZBAR_ISBN13)).add(new R(re.ZBAR_EAN13)).add(new R(re.ZBAR_EAN2)),R.register("isbn_13+5",new R(re.ZBAR_ISBN13)).add(new R(re.ZBAR_EAN13)).add(new R(re.ZBAR_EAN5)),R.register("itf",new R(re.ZBAR_I25)),R.register("qr_code",new R(re.ZBAR_QRCODE)),R.register("sq_code",new R(re.ZBAR_SQCODE)),R.register("upc_a",new R(re.ZBAR_UPCA)).add(new R(re.ZBAR_EAN13)),R.register("upc_e",new R(re.ZBAR_UPCE)).add(new R(re.ZBAR_EAN13)),function(t){t[t.UNKNOWN=-1]="UNKNOWN",t[t.UPRIGHT=0]="UPRIGHT",t[t.ROTATED_RIGHT=1]="ROTATED_RIGHT",t[t.UPSIDE_DOWN=2]="UPSIDE_DOWN",t[t.ROTATED_LEFT=3]="ROTATED_LEFT"}(Rl||(Rl={}));var $s=class{},hm=(()=>{try{return new OffscreenCanvas(1,1).getContext("2d")instanceof OffscreenCanvasRenderingContext2D}catch{return!1}})(),pr=class{constructor(e={}){if(e.formats!==void 0){if(!Array.isArray(e.formats)||!e.formats.length)throw new TypeError(`Barcode formats should be a non-empty array of strings but are: ${JSON.stringify(e)}`);let r=e.formats.filter(n=>!R.formats().includes(n));if(r.length)throw new TypeError(`Unsupported barcode format(s): ${r.join(", ")}`)}this.formats=e.formats||R.formats(),this.zbarConfig=e.zbar||new $s}static getSupportedFormats(){return Promise.resolve(R.formats())}detect(e){if(!pr.isImageBitmapSource(e))throw new TypeError("BarcodeDetector.detect() argument is not an ImageBitmapSource");let r=pr.intrinsicDimensions(e);if(r.width===0||r.height===0)return Promise.resolve([]);try{return Promise.all([this.toImageData(e),this.getScanner()]).then(n=>{let i=n[0],a=n[1];return this.zbarConfig.enableCache!==void 0&&a.enableCache(this.zbarConfig.enableCache),fm(i.data,i.width,i.height,a)}).then(n=>n.map(i=>this.toBarcodeDetectorResult(i)))}catch(n){return Promise.reject(n)}}getScanner(){return new Promise((e,r)=>dm(this,void 0,void 0,function*(){if(!this.scanner){let n=yield pm();this.formats.length>0&&(n.setConfig(re.ZBAR_NONE,Pl.ZBAR_CFG_ENABLE,0),this.formats.forEach(i=>R.configure(n,i))),this.scanner=n}e(this.scanner)}))}toImageData(e){let r=n=>{let i=pr.intrinsicDimensions(n);this.canvas&&this.canvas.width===i.width&&this.canvas.height===i.height||(this.canvas=function(s,u){if(hm)return new OffscreenCanvas(s,u);{let c=document.createElement("canvas");return c.width=s,c.height=u,c}}(i.width,i.height));let a=this.canvas,o=a.getContext("2d");return o.drawImage(n,0,0),o.getImageData(0,0,a.width,a.height)};if(e instanceof ImageData)return Promise.resolve(e);if(e instanceof Blob){let n=document.createElement("img");return n.src=URL.createObjectURL(e),n.decode().then(()=>r(n)).finally(()=>URL.revokeObjectURL(n.src))}return e instanceof CanvasRenderingContext2D?Promise.resolve(e.getImageData(0,0,e.canvas.width,e.canvas.height)):Promise.resolve(r(e))}toBarcodeDetectorResult(e){let r={minX:1/0,maxX:-1/0,minY:1/0,maxY:-1/0};return e.points.forEach(n=>{r.minX=Math.min(r.minX,n.x),r.maxX=Math.max(r.maxX,n.x),r.minY=Math.min(r.minY,n.y),r.maxY=Math.max(r.maxY,n.y)}),{format:R.toFormat(e.type),rawValue:e.decode(this.zbarConfig.encoding),orientation:e.orientation,quality:e.quality,boundingBox:DOMRectReadOnly.fromRect({x:r.minX,y:r.minY,width:r.maxX-r.minX,height:r.maxY-r.minY}),cornerPoints:[{x:r.minX,y:r.minY},{x:r.maxX,y:r.minY},{x:r.maxX,y:r.maxY},{x:r.minX,y:r.maxY}]}}static isImageBitmapSource(e){return e instanceof HTMLImageElement||e instanceof HTMLVideoElement||e instanceof HTMLCanvasElement||e instanceof Blob||e instanceof ImageData||e instanceof CanvasRenderingContext2D||e instanceof ImageBitmap||e&&e.width==0||e&&e.height==0}static intrinsicDimensions(e){return{width:Number(e.naturalWidth||e.videoWidth||e.width),height:Number(e.naturalHeight||e.videoHeight||e.height)}}};var Va=window,za=Va.ShadowRoot&&(Va.ShadyCSS===void 0||Va.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Fs=Symbol(),Ll=new WeakMap,xi=class{constructor(e,r,n){if(this._$cssResult$=!0,n!==Fs)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=r}get styleSheet(){let e=this.o,r=this.t;if(za&&e===void 0){let n=r!==void 0&&r.length===1;n&&(e=Ll.get(r)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&Ll.set(r,e))}return e}toString(){return this.cssText}},$l=t=>new xi(typeof t=="string"?t:t+"",void 0,Fs),Ms=(t,...e)=>{let r=t.length===1?t[0]:e.reduce((n,i,a)=>n+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[a+1],t[0]);return new xi(r,t,Fs)},Us=(t,e)=>{za?t.adoptedStyleSheets=e.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet):e.forEach(r=>{let n=document.createElement("style"),i=Va.litNonce;i!==void 0&&n.setAttribute("nonce",i),n.textContent=r.cssText,t.appendChild(n)})},Qa=za?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let r="";for(let n of e.cssRules)r+=n.cssText;return $l(r)})(t):t;var js,Ga=window,Fl=Ga.trustedTypes,mm=Fl?Fl.emptyScript:"",Ml=Ga.reactiveElementPolyfillSupport,Bs={toAttribute(t,e){switch(e){case Boolean:t=t?mm:null;break;case Object:case Array:t=t==null?t:JSON.stringify(t)}return t},fromAttribute(t,e){let r=t;switch(e){case Boolean:r=t!==null;break;case Number:r=t===null?null:Number(t);break;case Object:case Array:try{r=JSON.parse(t)}catch{r=null}}return r}},Ul=(t,e)=>e!==t&&(e==e||t==t),qs={attribute:!0,type:String,converter:Bs,reflect:!1,hasChanged:Ul},Vs="finalized",Xt=class extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this._$Eu()}static addInitializer(e){var r;this.finalize(),((r=this.h)!==null&&r!==void 0?r:this.h=[]).push(e)}static get observedAttributes(){this.finalize();let e=[];return this.elementProperties.forEach((r,n)=>{let i=this._$Ep(n,r);i!==void 0&&(this._$Ev.set(i,n),e.push(i))}),e}static createProperty(e,r=qs){if(r.state&&(r.attribute=!1),this.finalize(),this.elementProperties.set(e,r),!r.noAccessor&&!this.prototype.hasOwnProperty(e)){let n=typeof e=="symbol"?Symbol():"__"+e,i=this.getPropertyDescriptor(e,n,r);i!==void 0&&Object.defineProperty(this.prototype,e,i)}}static getPropertyDescriptor(e,r,n){return{get(){return this[r]},set(i){let a=this[e];this[r]=i,this.requestUpdate(e,a,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)||qs}static finalize(){if(this.hasOwnProperty(Vs))return!1;this[Vs]=!0;let e=Object.getPrototypeOf(this);if(e.finalize(),e.h!==void 0&&(this.h=[...e.h]),this.elementProperties=new Map(e.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){let r=this.properties,n=[...Object.getOwnPropertyNames(r),...Object.getOwnPropertySymbols(r)];for(let i of n)this.createProperty(i,r[i])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(e){let r=[];if(Array.isArray(e)){let n=new Set(e.flat(1/0).reverse());for(let i of n)r.unshift(Qa(i))}else e!==void 0&&r.push(Qa(e));return r}static _$Ep(e,r){let n=r.attribute;return n===!1?void 0:typeof n=="string"?n:typeof e=="string"?e.toLowerCase():void 0}_$Eu(){var e;this._$E_=new Promise(r=>this.enableUpdating=r),this._$AL=new Map,this._$Eg(),this.requestUpdate(),(e=this.constructor.h)===null||e===void 0||e.forEach(r=>r(this))}addController(e){var r,n;((r=this._$ES)!==null&&r!==void 0?r:this._$ES=[]).push(e),this.renderRoot!==void 0&&this.isConnected&&((n=e.hostConnected)===null||n===void 0||n.call(e))}removeController(e){var r;(r=this._$ES)===null||r===void 0||r.splice(this._$ES.indexOf(e)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach((e,r)=>{this.hasOwnProperty(r)&&(this._$Ei.set(r,this[r]),delete this[r])})}createRenderRoot(){var e;let r=(e=this.shadowRoot)!==null&&e!==void 0?e:this.attachShadow(this.constructor.shadowRootOptions);return Us(r,this.constructor.elementStyles),r}connectedCallback(){var e;this.renderRoot===void 0&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$ES)===null||e===void 0||e.forEach(r=>{var n;return(n=r.hostConnected)===null||n===void 0?void 0:n.call(r)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$ES)===null||e===void 0||e.forEach(r=>{var n;return(n=r.hostDisconnected)===null||n===void 0?void 0:n.call(r)})}attributeChangedCallback(e,r,n){this._$AK(e,n)}_$EO(e,r,n=qs){var i;let a=this.constructor._$Ep(e,n);if(a!==void 0&&n.reflect===!0){let o=(((i=n.converter)===null||i===void 0?void 0:i.toAttribute)!==void 0?n.converter:Bs).toAttribute(r,n.type);this._$El=e,o==null?this.removeAttribute(a):this.setAttribute(a,o),this._$El=null}}_$AK(e,r){var n;let i=this.constructor,a=i._$Ev.get(e);if(a!==void 0&&this._$El!==a){let o=i.getPropertyOptions(a),s=typeof o.converter=="function"?{fromAttribute:o.converter}:((n=o.converter)===null||n===void 0?void 0:n.fromAttribute)!==void 0?o.converter:Bs;this._$El=a,this[a]=s.fromAttribute(r,o.type),this._$El=null}}requestUpdate(e,r,n){let i=!0;e!==void 0&&(((n=n||this.constructor.getPropertyOptions(e)).hasChanged||Ul)(this[e],r)?(this._$AL.has(e)||this._$AL.set(e,r),n.reflect===!0&&this._$El!==e&&(this._$EC===void 0&&(this._$EC=new Map),this._$EC.set(e,n))):i=!1),!this.isUpdatePending&&i&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(r){Promise.reject(r)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var e;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach((i,a)=>this[a]=i),this._$Ei=void 0);let r=!1,n=this._$AL;try{r=this.shouldUpdate(n),r?(this.willUpdate(n),(e=this._$ES)===null||e===void 0||e.forEach(i=>{var a;return(a=i.hostUpdate)===null||a===void 0?void 0:a.call(i)}),this.update(n)):this._$Ek()}catch(i){throw r=!1,this._$Ek(),i}r&&this._$AE(n)}willUpdate(e){}_$AE(e){var r;(r=this._$ES)===null||r===void 0||r.forEach(n=>{var i;return(i=n.hostUpdated)===null||i===void 0?void 0:i.call(n)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(e){return!0}update(e){this._$EC!==void 0&&(this._$EC.forEach((r,n)=>this._$EO(n,this[n],r)),this._$EC=void 0),this._$Ek()}updated(e){}firstUpdated(e){}};Xt[Vs]=!0,Xt.elementProperties=new Map,Xt.elementStyles=[],Xt.shadowRootOptions={mode:"open"},Ml?.({ReactiveElement:Xt}),((js=Ga.reactiveElementVersions)!==null&&js!==void 0?js:Ga.reactiveElementVersions=[]).push("1.6.3");var zs,Ha=window,Fn=Ha.trustedTypes,jl=Fn?Fn.createPolicy("lit-html",{createHTML:t=>t}):void 0,Gs="$lit$",dr=`lit$${(Math.random()+"").slice(9)}$`,Hl="?"+dr,gm=`<${Hl}>`,Qr=document,Ti=()=>Qr.createComment(""),Ai=t=>t===null||typeof t!="object"&&typeof t!="function",Wl=Array.isArray,ym=t=>Wl(t)||typeof t?.[Symbol.iterator]=="function",Qs=`[
|
|
2
|
-
\f\r]`,
|
|
3
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),Vl=/'/g,zl=/"/g,Kl=/^(?:script|style|textarea|title)$/i,Zl=t=>(e,...r)=>({_$litType$:t,strings:e,values:r}),B=Zl(1),Q2=Zl(2),Gr=Symbol.for("lit-noChange"),Me=Symbol.for("lit-nothing"),Ql=new WeakMap,zr=Qr.createTreeWalker(Qr,129,null,!1);function Yl(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return jl!==void 0?jl.createHTML(e):e}var vm=(t,e)=>{let r=t.length-1,n=[],i,a=e===2?"<svg>":"",o=ki;for(let s=0;s<r;s++){let u=t[s],c,l,d=-1,p=0;for(;p<u.length&&(o.lastIndex=p,l=o.exec(u),l!==null);)p=o.lastIndex,o===ki?l[1]==="!--"?o=ql:l[1]!==void 0?o=Bl:l[2]!==void 0?(Kl.test(l[2])&&(i=RegExp("</"+l[2],"g")),o=Vr):l[3]!==void 0&&(o=Vr):o===Vr?l[0]===">"?(o=i??ki,d=-1):l[1]===void 0?d=-2:(d=o.lastIndex-l[2].length,c=l[1],o=l[3]===void 0?Vr:l[3]==='"'?zl:Vl):o===zl||o===Vl?o=Vr:o===ql||o===Bl?o=ki:(o=Vr,i=void 0);let f=o===Vr&&t[s+1].startsWith("/>")?" ":"";a+=o===ki?u+gm:d>=0?(n.push(c),u.slice(0,d)+Gs+u.slice(d)+dr+f):u+dr+(d===-2?(n.push(void 0),s):f)}return[Yl(t,a+(t[r]||"<?>")+(e===2?"</svg>":"")),n]},Hr=class{constructor({strings:e,_$litType$:r},n){let i;this.parts=[];let a=0,o=0,s=e.length-1,u=this.parts,[c,l]=vm(e,r);if(this.el=Hr.createElement(c,n),zr.currentNode=this.el.content,r===2){let d=this.el.content,p=d.firstChild;p.remove(),d.append(...p.childNodes)}for(;(i=zr.nextNode())!==null&&u.length<s;){if(i.nodeType===1){if(i.hasAttributes()){let d=[];for(let p of i.getAttributeNames())if(p.endsWith(Gs)||p.startsWith(dr)){let f=l[o++];if(d.push(p),f!==void 0){let h=i.getAttribute(f.toLowerCase()+Gs).split(dr),g=/([.?@])?(.*)/.exec(f);u.push({type:1,index:a,name:g[2],strings:h,ctor:g[1]==="."?Ws:g[1]==="?"?Ks:g[1]==="@"?Zs:Un})}else u.push({type:6,index:a})}for(let p of d)i.removeAttribute(p)}if(Kl.test(i.tagName)){let d=i.textContent.split(dr),p=d.length-1;if(p>0){i.textContent=Fn?Fn.emptyScript:"";for(let f=0;f<p;f++)i.append(d[f],Ti()),zr.nextNode(),u.push({type:2,index:++a});i.append(d[p],Ti())}}}else if(i.nodeType===8)if(i.data===Hl)u.push({type:2,index:a});else{let d=-1;for(;(d=i.data.indexOf(dr,d+1))!==-1;)u.push({type:7,index:a}),d+=dr.length-1}a++}}static createElement(e,r){let n=Qr.createElement("template");return n.innerHTML=e,n}};function Mn(t,e,r=t,n){var i,a,o,s;if(e===Gr)return e;let u=n!==void 0?(i=r._$Co)===null||i===void 0?void 0:i[n]:r._$Cl,c=Ai(e)?void 0:e._$litDirective$;return u?.constructor!==c&&((a=u?._$AO)===null||a===void 0||a.call(u,!1),c===void 0?u=void 0:(u=new c(t),u._$AT(t,r,n)),n!==void 0?((o=(s=r)._$Co)!==null&&o!==void 0?o:s._$Co=[])[n]=u:r._$Cl=u),u!==void 0&&(e=Mn(t,u._$AS(t,e.values),u,n)),e}var Hs=class{constructor(e,r){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=r}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){var r;let{el:{content:n},parts:i}=this._$AD,a=((r=e?.creationScope)!==null&&r!==void 0?r:Qr).importNode(n,!0);zr.currentNode=a;let o=zr.nextNode(),s=0,u=0,c=i[0];for(;c!==void 0;){if(s===c.index){let l;c.type===2?l=new Wr(o,o.nextSibling,this,e):c.type===1?l=new c.ctor(o,c.name,c.strings,this,e):c.type===6&&(l=new Ys(o,this,e)),this._$AV.push(l),c=i[++u]}s!==c?.index&&(o=zr.nextNode(),s++)}return zr.currentNode=Qr,a}v(e){let r=0;for(let n of this._$AV)n!==void 0&&(n.strings!==void 0?(n._$AI(e,n,r),r+=n.strings.length-2):n._$AI(e[r])),r++}},Wr=class{constructor(e,r,n,i){var a;this.type=2,this._$AH=Me,this._$AN=void 0,this._$AA=e,this._$AB=r,this._$AM=n,this.options=i,this._$Cp=(a=i?.isConnected)===null||a===void 0||a}get _$AU(){var e,r;return(r=(e=this._$AM)===null||e===void 0?void 0:e._$AU)!==null&&r!==void 0?r:this._$Cp}get parentNode(){let e=this._$AA.parentNode,r=this._$AM;return r!==void 0&&e?.nodeType===11&&(e=r.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,r=this){e=Mn(this,e,r),Ai(e)?e===Me||e==null||e===""?(this._$AH!==Me&&this._$AR(),this._$AH=Me):e!==this._$AH&&e!==Gr&&this._(e):e._$litType$!==void 0?this.g(e):e.nodeType!==void 0?this.$(e):ym(e)?this.T(e):this._(e)}k(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}$(e){this._$AH!==e&&(this._$AR(),this._$AH=this.k(e))}_(e){this._$AH!==Me&&Ai(this._$AH)?this._$AA.nextSibling.data=e:this.$(Qr.createTextNode(e)),this._$AH=e}g(e){var r;let{values:n,_$litType$:i}=e,a=typeof i=="number"?this._$AC(e):(i.el===void 0&&(i.el=Hr.createElement(Yl(i.h,i.h[0]),this.options)),i);if(((r=this._$AH)===null||r===void 0?void 0:r._$AD)===a)this._$AH.v(n);else{let o=new Hs(a,this),s=o.u(this.options);o.v(n),this.$(s),this._$AH=o}}_$AC(e){let r=Ql.get(e.strings);return r===void 0&&Ql.set(e.strings,r=new Hr(e)),r}T(e){Wl(this._$AH)||(this._$AH=[],this._$AR());let r=this._$AH,n,i=0;for(let a of e)i===r.length?r.push(n=new Wr(this.k(Ti()),this.k(Ti()),this,this.options)):n=r[i],n._$AI(a),i++;i<r.length&&(this._$AR(n&&n._$AB.nextSibling,i),r.length=i)}_$AR(e=this._$AA.nextSibling,r){var n;for((n=this._$AP)===null||n===void 0||n.call(this,!1,!0,r);e&&e!==this._$AB;){let i=e.nextSibling;e.remove(),e=i}}setConnected(e){var r;this._$AM===void 0&&(this._$Cp=e,(r=this._$AP)===null||r===void 0||r.call(this,e))}},Un=class{constructor(e,r,n,i,a){this.type=1,this._$AH=Me,this._$AN=void 0,this.element=e,this.name=r,this._$AM=i,this.options=a,n.length>2||n[0]!==""||n[1]!==""?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=Me}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(e,r=this,n,i){let a=this.strings,o=!1;if(a===void 0)e=Mn(this,e,r,0),o=!Ai(e)||e!==this._$AH&&e!==Gr,o&&(this._$AH=e);else{let s=e,u,c;for(e=a[0],u=0;u<a.length-1;u++)c=Mn(this,s[n+u],r,u),c===Gr&&(c=this._$AH[u]),o||(o=!Ai(c)||c!==this._$AH[u]),c===Me?e=Me:e!==Me&&(e+=(c??"")+a[u+1]),this._$AH[u]=c}o&&!i&&this.j(e)}j(e){e===Me?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},Ws=class extends Un{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===Me?void 0:e}},bm=Fn?Fn.emptyScript:"",Ks=class extends Un{constructor(){super(...arguments),this.type=4}j(e){e&&e!==Me?this.element.setAttribute(this.name,bm):this.element.removeAttribute(this.name)}},Zs=class extends Un{constructor(e,r,n,i,a){super(e,r,n,i,a),this.type=5}_$AI(e,r=this){var n;if((e=(n=Mn(this,e,r,0))!==null&&n!==void 0?n:Me)===Gr)return;let i=this._$AH,a=e===Me&&i!==Me||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,o=e!==Me&&(i===Me||a);a&&this.element.removeEventListener(this.name,this,i),o&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var r,n;typeof this._$AH=="function"?this._$AH.call((n=(r=this.options)===null||r===void 0?void 0:r.host)!==null&&n!==void 0?n:this.element,e):this._$AH.handleEvent(e)}},Ys=class{constructor(e,r,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=r,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){Mn(this,e)}};var Gl=Ha.litHtmlPolyfillSupport;Gl?.(Hr,Wr),((zs=Ha.litHtmlVersions)!==null&&zs!==void 0?zs:Ha.litHtmlVersions=[]).push("2.8.0");var Jl=(t,e,r)=>{var n,i;let a=(n=r?.renderBefore)!==null&&n!==void 0?n:e,o=a._$litPart$;if(o===void 0){let s=(i=r?.renderBefore)!==null&&i!==void 0?i:null;a._$litPart$=o=new Wr(e.insertBefore(Ti(),s),s,void 0,r??{})}return o._$AI(t),o};var Js,Xs;var hr=class extends Xt{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e,r;let n=super.createRenderRoot();return(e=(r=this.renderOptions).renderBefore)!==null&&e!==void 0||(r.renderBefore=n.firstChild),n}update(e){let r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Jl(r,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)===null||e===void 0||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)===null||e===void 0||e.setConnected(!1)}render(){return Gr}};hr.finalized=!0,hr._$litElement$=!0,(Js=globalThis.litElementHydrateSupport)===null||Js===void 0||Js.call(globalThis,{LitElement:hr});var Xl=globalThis.litElementPolyfillSupport;Xl?.({LitElement:hr});((Xs=globalThis.litElementVersions)!==null&&Xs!==void 0?Xs:globalThis.litElementVersions=[]).push("3.3.3");var ef=t=>e=>typeof e=="function"?((r,n)=>(customElements.define(r,n),n))(t,e):((r,n)=>{let{kind:i,elements:a}=n;return{kind:i,elements:a,finisher(o){customElements.define(r,o)}}})(t,e);var _m=(t,e)=>e.kind==="method"&&e.descriptor&&!("value"in e.descriptor)?{...e,finisher(r){r.createProperty(e.key,t)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){typeof e.initializer=="function"&&(this[e.key]=e.initializer.call(this))},finisher(r){r.createProperty(e.key,t)}},wm=(t,e,r)=>{e.constructor.createProperty(r,t)};function ft(t){return(e,r)=>r!==void 0?wm(t,e,r):_m(t,e)}function Ze(t){return ft({...t,state:!0})}var ec,v3=((ec=window.HTMLSlotElement)===null||ec===void 0?void 0:ec.prototype.assignedElements)!=null?(t,e)=>t.assignedElements(e):(t,e)=>t.assignedNodes(e).filter(r=>r.nodeType===Node.ELEMENT_NODE);var tc=function(t,e){return tc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},tc(t,e)};function xe(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");tc(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var _=function(){return _=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},_.apply(this,arguments)};function Ut(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function Tt(t,e,r,n){function i(a){return a instanceof r?a:new r(function(o){o(a)})}return new(r||(r=Promise))(function(a,o){function s(l){try{c(n.next(l))}catch(d){o(d)}}function u(l){try{c(n.throw(l))}catch(d){o(d)}}function c(l){l.done?a(l.value):i(l.value).then(s,u)}c((n=n.apply(t,e||[])).next())})}function At(t,e){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(c){return function(l){return u([c,l])}}function u(c){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(r=0)),r;)try{if(n=1,i&&(a=c[0]&2?i.return:c[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,c[1])).done)return a;switch(i=0,a&&(c=[c[0]&2,a.value]),c[0]){case 0:case 1:a=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,i=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!a||c[1]>a[0]&&c[1]<a[3])){r.label=c[1];break}if(c[0]===6&&r.label<a[1]){r.label=a[1],a=c;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(c);break}a[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(l){c=[6,l],i=0}finally{n=a=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function mr(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,a;n<i;n++)(a||!(n in e))&&(a||(a=Array.prototype.slice.call(e,0,n)),a[n]=e[n]);return t.concat(a||Array.prototype.slice.call(e))}var rc="Invariant Violation",tf=Object.setPrototypeOf,Sm=tf===void 0?function(t,e){return t.__proto__=e,t}:tf,V=function(t){xe(e,t);function e(r){r===void 0&&(r=rc);var n=t.call(this,typeof r=="number"?rc+": "+r+" (see https://github.com/apollographql/invariant-packages)":r)||this;return n.framesToPop=1,n.name=rc,Sm(n,e.prototype),n}return e}(Error);function I(t,e){if(!t)throw new V(e)}var Ka=["debug","log","warn","error","silent"],nc=Ka.indexOf("log");function Wa(t){return function(){if(Ka.indexOf(t)>=nc){var e=console[t]||console.log;return e.apply(console,arguments)}}}(function(t){t.debug=Wa("debug"),t.log=Wa("log"),t.warn=Wa("warn"),t.error=Wa("error")})(I||(I={}));function rf(t){var e=Ka[nc];return nc=Math.max(0,Ka.indexOf(t)),e}function Ue(t){try{return t()}catch{}}var Za=Ue(function(){return globalThis})||Ue(function(){return window})||Ue(function(){return self})||Ue(function(){return global})||Ue(function(){return Ue.constructor("return this")()});var nf="__",af=[nf,nf].join("DEV");function Cm(){try{return Boolean(__DEV__)}catch{return Object.defineProperty(Za,af,{value:Ue(function(){return"production"})!=="production",enumerable:!1,configurable:!0,writable:!0}),Za[af]}}var Kr=Cm();function gr(t){try{return t()}catch{}}var ic=gr(function(){return globalThis})||gr(function(){return window})||gr(function(){return self})||gr(function(){return global})||gr(function(){return gr.constructor("return this")()}),ac=!1;function Em(){ic&&!gr(function(){return"production"})&&!gr(function(){return process})&&(Object.defineProperty(ic,"process",{value:{env:{NODE_ENV:"production"}},configurable:!0,enumerable:!1,writable:!0}),ac=!0)}Em();function oc(){ac&&(delete ic.process,ac=!1)}var z3=typeof Symbol=="function"&&Symbol.iterator!=null?Symbol.iterator:"@@iterator",Q3=typeof Symbol=="function"&&Symbol.asyncIterator!=null?Symbol.asyncIterator:"@@asyncIterator",of=typeof Symbol=="function"&&Symbol.toStringTag!=null?Symbol.toStringTag:"@@toStringTag";var Oe=Object.freeze({NAME:"Name",DOCUMENT:"Document",OPERATION_DEFINITION:"OperationDefinition",VARIABLE_DEFINITION:"VariableDefinition",SELECTION_SET:"SelectionSet",FIELD:"Field",ARGUMENT:"Argument",FRAGMENT_SPREAD:"FragmentSpread",INLINE_FRAGMENT:"InlineFragment",FRAGMENT_DEFINITION:"FragmentDefinition",VARIABLE:"Variable",INT:"IntValue",FLOAT:"FloatValue",STRING:"StringValue",BOOLEAN:"BooleanValue",NULL:"NullValue",ENUM:"EnumValue",LIST:"ListValue",OBJECT:"ObjectValue",OBJECT_FIELD:"ObjectField",DIRECTIVE:"Directive",NAMED_TYPE:"NamedType",LIST_TYPE:"ListType",NON_NULL_TYPE:"NonNullType",SCHEMA_DEFINITION:"SchemaDefinition",OPERATION_TYPE_DEFINITION:"OperationTypeDefinition",SCALAR_TYPE_DEFINITION:"ScalarTypeDefinition",OBJECT_TYPE_DEFINITION:"ObjectTypeDefinition",FIELD_DEFINITION:"FieldDefinition",INPUT_VALUE_DEFINITION:"InputValueDefinition",INTERFACE_TYPE_DEFINITION:"InterfaceTypeDefinition",UNION_TYPE_DEFINITION:"UnionTypeDefinition",ENUM_TYPE_DEFINITION:"EnumTypeDefinition",ENUM_VALUE_DEFINITION:"EnumValueDefinition",INPUT_OBJECT_TYPE_DEFINITION:"InputObjectTypeDefinition",DIRECTIVE_DEFINITION:"DirectiveDefinition",SCHEMA_EXTENSION:"SchemaExtension",SCALAR_TYPE_EXTENSION:"ScalarTypeExtension",OBJECT_TYPE_EXTENSION:"ObjectTypeExtension",INTERFACE_TYPE_EXTENSION:"InterfaceTypeExtension",UNION_TYPE_EXTENSION:"UnionTypeExtension",ENUM_TYPE_EXTENSION:"EnumTypeExtension",INPUT_OBJECT_TYPE_EXTENSION:"InputObjectTypeExtension"});function sc(t,e){var r=Boolean(t);if(!r)throw new Error(e??"Unexpected invariant triggered.")}var xm=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):void 0,Oi=xm;function Ya(t){var e=t.prototype.toJSON;typeof e=="function"||sc(0),t.prototype.inspect=e,Oi&&(t.prototype[Oi]=e)}var sf=function(){function t(r,n,i){this.start=r.start,this.end=n.end,this.startToken=r,this.endToken=n,this.source=i}var e=t.prototype;return e.toJSON=function(){return{start:this.start,end:this.end}},t}();Ya(sf);var cf=function(){function t(r,n,i,a,o,s,u){this.kind=r,this.start=n,this.end=i,this.line=a,this.column=o,this.value=u,this.prev=s,this.next=null}var e=t.prototype;return e.toJSON=function(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}},t}();Ya(cf);function cc(t){return t!=null&&typeof t.kind=="string"}function Ja(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ja=function(r){return typeof r}:Ja=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Ja(t)}var km=10,uf=2;function Di(t){return Xa(t,[])}function Xa(t,e){switch(Ja(t)){case"string":return JSON.stringify(t);case"function":return t.name?"[function ".concat(t.name,"]"):"[function]";case"object":return t===null?"null":Tm(t,e);default:return String(t)}}function Tm(t,e){if(e.indexOf(t)!==-1)return"[Circular]";var r=[].concat(e,[t]),n=Om(t);if(n!==void 0){var i=n.call(t);if(i!==t)return typeof i=="string"?i:Xa(i,r)}else if(Array.isArray(t))return Im(t,r);return Am(t,r)}function Am(t,e){var r=Object.keys(t);if(r.length===0)return"{}";if(e.length>uf)return"["+Dm(t)+"]";var n=r.map(function(i){var a=Xa(t[i],e);return i+": "+a});return"{ "+n.join(", ")+" }"}function Im(t,e){if(t.length===0)return"[]";if(e.length>uf)return"[Array]";for(var r=Math.min(km,t.length),n=t.length-r,i=[],a=0;a<r;++a)i.push(Xa(t[a],e));return n===1?i.push("... 1 more item"):n>1&&i.push("... ".concat(n," more items")),"["+i.join(", ")+"]"}function Om(t){var e=t[String(Oi)];if(typeof e=="function")return e;if(typeof t.inspect=="function")return t.inspect}function Dm(t){var e=Object.prototype.toString.call(t).replace(/^\[object /,"").replace(/]$/,"");if(e==="Object"&&typeof t.constructor=="function"){var r=t.constructor.name;if(typeof r=="string"&&r!=="")return r}return e}function Ni(t,e){var r=Boolean(t);if(!r)throw new Error(e)}function lf(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Nm(t,e,r){return e&&lf(t.prototype,e),r&&lf(t,r),t}var eo=function(){function t(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"GraphQL request",n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{line:1,column:1};typeof e=="string"||Ni(0,"Body must be a string. Received: ".concat(Di(e),".")),this.body=e,this.name=r,this.locationOffset=n,this.locationOffset.line>0||Ni(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||Ni(0,"column in locationOffset is 1-indexed and must be positive.")}return Nm(t,[{key:of,get:function(){return"Source"}}]),t}();function ff(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,n=t.indexOf(`
|
|
1
|
+
var lm=Object.defineProperty;var fm=Object.getOwnPropertyDescriptor;var ve=(t,e,r,n)=>{for(var i=n>1?void 0:n?fm(e,r):e,a=t.length-1,o;a>=0;a--)(o=t[a])&&(i=(n?o(e,r,i):o(i))||i);return n&&i&&lm(e,r,i),i};var pe=(t,e,r)=>new Promise((n,i)=>{var a=u=>{try{s(r.next(u))}catch(c){i(c)}},o=u=>{try{s(r.throw(u))}catch(c){i(c)}},s=u=>u.done?n(u.value):Promise.resolve(u.value).then(a,o);s((r=r.apply(t,e)).next())});import{ZBarSymbolType as re,ZBarConfigType as Ll,scanRGBABuffer as pm,getDefaultScanner as dm}from"https://cdn.jsdelivr.net/npm/@undecaf/zbar-wasm@0.9.15/dist/main.js";function hm(t,e,r,n){return new(r||(r=Promise))(function(i,a){function o(c){try{u(n.next(c))}catch(l){a(l)}}function s(c){try{u(n.throw(c))}catch(l){a(l)}}function u(c){var l;c.done?i(c.value):(l=c.value,l instanceof r?l:new r(function(d){d(l)})).then(o,s)}u((n=n.apply(t,e||[])).next())})}var R=class{constructor(e,r=Ll.ZBAR_CFG_ENABLE,n=1){this.symbolType=e,this.configType=r,this.number=n,this.configSteps=[this]}static register(e,r,n=r.symbolType){return R.formatsToConfigs[e]=r,R.typesToFormats[n]=R.typesToFormats[n]||e,r}static formats(){return Object.keys(R.formatsToConfigs)}static toFormat(e){return R.typesToFormats[e]}static configure(e,r){var n;(n=R.formatsToConfigs[r])===null||n===void 0||n.configSteps.forEach(i=>e.setConfig(i.symbolType,i.configType,i.number))}add(e){return this.configSteps.push(e),this}},Pl;R.formatsToConfigs={},R.typesToFormats={},R.register("codabar",new R(re.ZBAR_CODABAR)),R.register("code_39",new R(re.ZBAR_CODE39)),R.register("code_93",new R(re.ZBAR_CODE93)),R.register("code_128",new R(re.ZBAR_CODE128)),R.register("databar",new R(re.ZBAR_DATABAR)),R.register("databar_exp",new R(re.ZBAR_DATABAR_EXP)),R.register("ean_2",new R(re.ZBAR_EAN2)),R.register("ean_5",new R(re.ZBAR_EAN5)),R.register("ean_8",new R(re.ZBAR_EAN8)),R.register("ean_13",new R(re.ZBAR_EAN13)),R.register("ean_13+2",new R(re.ZBAR_EAN13)).add(new R(re.ZBAR_EAN2)),R.register("ean_13+5",new R(re.ZBAR_EAN13)).add(new R(re.ZBAR_EAN5)),R.register("isbn_10",new R(re.ZBAR_ISBN10)).add(new R(re.ZBAR_EAN13)),R.register("isbn_13",new R(re.ZBAR_ISBN13)).add(new R(re.ZBAR_EAN13)),R.register("isbn_13+2",new R(re.ZBAR_ISBN13)).add(new R(re.ZBAR_EAN13)).add(new R(re.ZBAR_EAN2)),R.register("isbn_13+5",new R(re.ZBAR_ISBN13)).add(new R(re.ZBAR_EAN13)).add(new R(re.ZBAR_EAN5)),R.register("itf",new R(re.ZBAR_I25)),R.register("qr_code",new R(re.ZBAR_QRCODE)),R.register("sq_code",new R(re.ZBAR_SQCODE)),R.register("upc_a",new R(re.ZBAR_UPCA)).add(new R(re.ZBAR_EAN13)),R.register("upc_e",new R(re.ZBAR_UPCE)).add(new R(re.ZBAR_EAN13)),function(t){t[t.UNKNOWN=-1]="UNKNOWN",t[t.UPRIGHT=0]="UPRIGHT",t[t.ROTATED_RIGHT=1]="ROTATED_RIGHT",t[t.UPSIDE_DOWN=2]="UPSIDE_DOWN",t[t.ROTATED_LEFT=3]="ROTATED_LEFT"}(Pl||(Pl={}));var Ms=class{},mm=(()=>{try{return new OffscreenCanvas(1,1).getContext("2d")instanceof OffscreenCanvasRenderingContext2D}catch{return!1}})(),dr=class{constructor(e={}){if(e.formats!==void 0){if(!Array.isArray(e.formats)||!e.formats.length)throw new TypeError(`Barcode formats should be a non-empty array of strings but are: ${JSON.stringify(e)}`);let r=e.formats.filter(n=>!R.formats().includes(n));if(r.length)throw new TypeError(`Unsupported barcode format(s): ${r.join(", ")}`)}this.formats=e.formats||R.formats(),this.zbarConfig=e.zbar||new Ms}static getSupportedFormats(){return Promise.resolve(R.formats())}detect(e){if(!dr.isImageBitmapSource(e))throw new TypeError("BarcodeDetector.detect() argument is not an ImageBitmapSource");let r=dr.intrinsicDimensions(e);if(r.width===0||r.height===0)return Promise.resolve([]);try{return Promise.all([this.toImageData(e),this.getScanner()]).then(n=>{let i=n[0],a=n[1];return this.zbarConfig.enableCache!==void 0&&a.enableCache(this.zbarConfig.enableCache),pm(i.data,i.width,i.height,a)}).then(n=>n.map(i=>this.toBarcodeDetectorResult(i)))}catch(n){return Promise.reject(n)}}getScanner(){return new Promise((e,r)=>hm(this,void 0,void 0,function*(){if(!this.scanner){let n=yield dm();this.formats.length>0&&(n.setConfig(re.ZBAR_NONE,Ll.ZBAR_CFG_ENABLE,0),this.formats.forEach(i=>R.configure(n,i))),this.scanner=n}e(this.scanner)}))}toImageData(e){let r=n=>{let i=dr.intrinsicDimensions(n);this.canvas&&this.canvas.width===i.width&&this.canvas.height===i.height||(this.canvas=function(s,u){if(mm)return new OffscreenCanvas(s,u);{let c=document.createElement("canvas");return c.width=s,c.height=u,c}}(i.width,i.height));let a=this.canvas,o=a.getContext("2d");return o.drawImage(n,0,0),o.getImageData(0,0,a.width,a.height)};if(e instanceof ImageData)return Promise.resolve(e);if(e instanceof Blob){let n=document.createElement("img");return n.src=URL.createObjectURL(e),n.decode().then(()=>r(n)).finally(()=>URL.revokeObjectURL(n.src))}return e instanceof CanvasRenderingContext2D?Promise.resolve(e.getImageData(0,0,e.canvas.width,e.canvas.height)):Promise.resolve(r(e))}toBarcodeDetectorResult(e){let r={minX:1/0,maxX:-1/0,minY:1/0,maxY:-1/0};return e.points.forEach(n=>{r.minX=Math.min(r.minX,n.x),r.maxX=Math.max(r.maxX,n.x),r.minY=Math.min(r.minY,n.y),r.maxY=Math.max(r.maxY,n.y)}),{format:R.toFormat(e.type),rawValue:e.decode(this.zbarConfig.encoding),orientation:e.orientation,quality:e.quality,boundingBox:DOMRectReadOnly.fromRect({x:r.minX,y:r.minY,width:r.maxX-r.minX,height:r.maxY-r.minY}),cornerPoints:[{x:r.minX,y:r.minY},{x:r.maxX,y:r.minY},{x:r.maxX,y:r.maxY},{x:r.minX,y:r.maxY}]}}static isImageBitmapSource(e){return e instanceof HTMLImageElement||e instanceof HTMLVideoElement||e instanceof HTMLCanvasElement||e instanceof Blob||e instanceof ImageData||e instanceof CanvasRenderingContext2D||e instanceof ImageBitmap||e&&e.width==0||e&&e.height==0}static intrinsicDimensions(e){return{width:Number(e.naturalWidth||e.videoWidth||e.width),height:Number(e.naturalHeight||e.videoHeight||e.height)}}};var za=window,Qa=za.ShadowRoot&&(za.ShadyCSS===void 0||za.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Us=Symbol(),$l=new WeakMap,ki=class{constructor(e,r,n){if(this._$cssResult$=!0,n!==Us)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=r}get styleSheet(){let e=this.o,r=this.t;if(Qa&&e===void 0){let n=r!==void 0&&r.length===1;n&&(e=$l.get(r)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&$l.set(r,e))}return e}toString(){return this.cssText}},Fl=t=>new ki(typeof t=="string"?t:t+"",void 0,Us),js=(t,...e)=>{let r=t.length===1?t[0]:e.reduce((n,i,a)=>n+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[a+1],t[0]);return new ki(r,t,Us)},qs=(t,e)=>{Qa?t.adoptedStyleSheets=e.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet):e.forEach(r=>{let n=document.createElement("style"),i=za.litNonce;i!==void 0&&n.setAttribute("nonce",i),n.textContent=r.cssText,t.appendChild(n)})},Ga=Qa?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let r="";for(let n of e.cssRules)r+=n.cssText;return Fl(r)})(t):t;var Bs,Ha=window,Ml=Ha.trustedTypes,gm=Ml?Ml.emptyScript:"",Ul=Ha.reactiveElementPolyfillSupport,zs={toAttribute(t,e){switch(e){case Boolean:t=t?gm:null;break;case Object:case Array:t=t==null?t:JSON.stringify(t)}return t},fromAttribute(t,e){let r=t;switch(e){case Boolean:r=t!==null;break;case Number:r=t===null?null:Number(t);break;case Object:case Array:try{r=JSON.parse(t)}catch{r=null}}return r}},jl=(t,e)=>e!==t&&(e==e||t==t),Vs={attribute:!0,type:String,converter:zs,reflect:!1,hasChanged:jl},Qs="finalized",Xt=class extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this._$Eu()}static addInitializer(e){var r;this.finalize(),((r=this.h)!==null&&r!==void 0?r:this.h=[]).push(e)}static get observedAttributes(){this.finalize();let e=[];return this.elementProperties.forEach((r,n)=>{let i=this._$Ep(n,r);i!==void 0&&(this._$Ev.set(i,n),e.push(i))}),e}static createProperty(e,r=Vs){if(r.state&&(r.attribute=!1),this.finalize(),this.elementProperties.set(e,r),!r.noAccessor&&!this.prototype.hasOwnProperty(e)){let n=typeof e=="symbol"?Symbol():"__"+e,i=this.getPropertyDescriptor(e,n,r);i!==void 0&&Object.defineProperty(this.prototype,e,i)}}static getPropertyDescriptor(e,r,n){return{get(){return this[r]},set(i){let a=this[e];this[r]=i,this.requestUpdate(e,a,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)||Vs}static finalize(){if(this.hasOwnProperty(Qs))return!1;this[Qs]=!0;let e=Object.getPrototypeOf(this);if(e.finalize(),e.h!==void 0&&(this.h=[...e.h]),this.elementProperties=new Map(e.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){let r=this.properties,n=[...Object.getOwnPropertyNames(r),...Object.getOwnPropertySymbols(r)];for(let i of n)this.createProperty(i,r[i])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(e){let r=[];if(Array.isArray(e)){let n=new Set(e.flat(1/0).reverse());for(let i of n)r.unshift(Ga(i))}else e!==void 0&&r.push(Ga(e));return r}static _$Ep(e,r){let n=r.attribute;return n===!1?void 0:typeof n=="string"?n:typeof e=="string"?e.toLowerCase():void 0}_$Eu(){var e;this._$E_=new Promise(r=>this.enableUpdating=r),this._$AL=new Map,this._$Eg(),this.requestUpdate(),(e=this.constructor.h)===null||e===void 0||e.forEach(r=>r(this))}addController(e){var r,n;((r=this._$ES)!==null&&r!==void 0?r:this._$ES=[]).push(e),this.renderRoot!==void 0&&this.isConnected&&((n=e.hostConnected)===null||n===void 0||n.call(e))}removeController(e){var r;(r=this._$ES)===null||r===void 0||r.splice(this._$ES.indexOf(e)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach((e,r)=>{this.hasOwnProperty(r)&&(this._$Ei.set(r,this[r]),delete this[r])})}createRenderRoot(){var e;let r=(e=this.shadowRoot)!==null&&e!==void 0?e:this.attachShadow(this.constructor.shadowRootOptions);return qs(r,this.constructor.elementStyles),r}connectedCallback(){var e;this.renderRoot===void 0&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$ES)===null||e===void 0||e.forEach(r=>{var n;return(n=r.hostConnected)===null||n===void 0?void 0:n.call(r)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$ES)===null||e===void 0||e.forEach(r=>{var n;return(n=r.hostDisconnected)===null||n===void 0?void 0:n.call(r)})}attributeChangedCallback(e,r,n){this._$AK(e,n)}_$EO(e,r,n=Vs){var i;let a=this.constructor._$Ep(e,n);if(a!==void 0&&n.reflect===!0){let o=(((i=n.converter)===null||i===void 0?void 0:i.toAttribute)!==void 0?n.converter:zs).toAttribute(r,n.type);this._$El=e,o==null?this.removeAttribute(a):this.setAttribute(a,o),this._$El=null}}_$AK(e,r){var n;let i=this.constructor,a=i._$Ev.get(e);if(a!==void 0&&this._$El!==a){let o=i.getPropertyOptions(a),s=typeof o.converter=="function"?{fromAttribute:o.converter}:((n=o.converter)===null||n===void 0?void 0:n.fromAttribute)!==void 0?o.converter:zs;this._$El=a,this[a]=s.fromAttribute(r,o.type),this._$El=null}}requestUpdate(e,r,n){let i=!0;e!==void 0&&(((n=n||this.constructor.getPropertyOptions(e)).hasChanged||jl)(this[e],r)?(this._$AL.has(e)||this._$AL.set(e,r),n.reflect===!0&&this._$El!==e&&(this._$EC===void 0&&(this._$EC=new Map),this._$EC.set(e,n))):i=!1),!this.isUpdatePending&&i&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(r){Promise.reject(r)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var e;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach((i,a)=>this[a]=i),this._$Ei=void 0);let r=!1,n=this._$AL;try{r=this.shouldUpdate(n),r?(this.willUpdate(n),(e=this._$ES)===null||e===void 0||e.forEach(i=>{var a;return(a=i.hostUpdate)===null||a===void 0?void 0:a.call(i)}),this.update(n)):this._$Ek()}catch(i){throw r=!1,this._$Ek(),i}r&&this._$AE(n)}willUpdate(e){}_$AE(e){var r;(r=this._$ES)===null||r===void 0||r.forEach(n=>{var i;return(i=n.hostUpdated)===null||i===void 0?void 0:i.call(n)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(e){return!0}update(e){this._$EC!==void 0&&(this._$EC.forEach((r,n)=>this._$EO(n,this[n],r)),this._$EC=void 0),this._$Ek()}updated(e){}firstUpdated(e){}};Xt[Qs]=!0,Xt.elementProperties=new Map,Xt.elementStyles=[],Xt.shadowRootOptions={mode:"open"},Ul?.({ReactiveElement:Xt}),((Bs=Ha.reactiveElementVersions)!==null&&Bs!==void 0?Bs:Ha.reactiveElementVersions=[]).push("1.6.3");var Gs,Wa=window,Mn=Wa.trustedTypes,ql=Mn?Mn.createPolicy("lit-html",{createHTML:t=>t}):void 0,Ws="$lit$",hr=`lit$${(Math.random()+"").slice(9)}$`,Wl="?"+hr,ym=`<${Wl}>`,Gr=document,Ai=()=>Gr.createComment(""),Ii=t=>t===null||typeof t!="object"&&typeof t!="function",Kl=Array.isArray,vm=t=>Kl(t)||typeof t?.[Symbol.iterator]=="function",Hs=`[
|
|
2
|
+
\f\r]`,Ti=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Bl=/-->/g,Vl=/>/g,zr=RegExp(`>|${Hs}(?:([^\\s"'>=/]+)(${Hs}*=${Hs}*(?:[^
|
|
3
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),zl=/'/g,Ql=/"/g,Zl=/^(?:script|style|textarea|title)$/i,Yl=t=>(e,...r)=>({_$litType$:t,strings:e,values:r}),B=Yl(1),G2=Yl(2),Hr=Symbol.for("lit-noChange"),Me=Symbol.for("lit-nothing"),Gl=new WeakMap,Qr=Gr.createTreeWalker(Gr,129,null,!1);function Jl(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return ql!==void 0?ql.createHTML(e):e}var bm=(t,e)=>{let r=t.length-1,n=[],i,a=e===2?"<svg>":"",o=Ti;for(let s=0;s<r;s++){let u=t[s],c,l,d=-1,p=0;for(;p<u.length&&(o.lastIndex=p,l=o.exec(u),l!==null);)p=o.lastIndex,o===Ti?l[1]==="!--"?o=Bl:l[1]!==void 0?o=Vl:l[2]!==void 0?(Zl.test(l[2])&&(i=RegExp("</"+l[2],"g")),o=zr):l[3]!==void 0&&(o=zr):o===zr?l[0]===">"?(o=i??Ti,d=-1):l[1]===void 0?d=-2:(d=o.lastIndex-l[2].length,c=l[1],o=l[3]===void 0?zr:l[3]==='"'?Ql:zl):o===Ql||o===zl?o=zr:o===Bl||o===Vl?o=Ti:(o=zr,i=void 0);let f=o===zr&&t[s+1].startsWith("/>")?" ":"";a+=o===Ti?u+ym:d>=0?(n.push(c),u.slice(0,d)+Ws+u.slice(d)+hr+f):u+hr+(d===-2?(n.push(void 0),s):f)}return[Jl(t,a+(t[r]||"<?>")+(e===2?"</svg>":"")),n]},Wr=class{constructor({strings:e,_$litType$:r},n){let i;this.parts=[];let a=0,o=0,s=e.length-1,u=this.parts,[c,l]=bm(e,r);if(this.el=Wr.createElement(c,n),Qr.currentNode=this.el.content,r===2){let d=this.el.content,p=d.firstChild;p.remove(),d.append(...p.childNodes)}for(;(i=Qr.nextNode())!==null&&u.length<s;){if(i.nodeType===1){if(i.hasAttributes()){let d=[];for(let p of i.getAttributeNames())if(p.endsWith(Ws)||p.startsWith(hr)){let f=l[o++];if(d.push(p),f!==void 0){let h=i.getAttribute(f.toLowerCase()+Ws).split(hr),g=/([.?@])?(.*)/.exec(f);u.push({type:1,index:a,name:g[2],strings:h,ctor:g[1]==="."?Zs:g[1]==="?"?Ys:g[1]==="@"?Js:jn})}else u.push({type:6,index:a})}for(let p of d)i.removeAttribute(p)}if(Zl.test(i.tagName)){let d=i.textContent.split(hr),p=d.length-1;if(p>0){i.textContent=Mn?Mn.emptyScript:"";for(let f=0;f<p;f++)i.append(d[f],Ai()),Qr.nextNode(),u.push({type:2,index:++a});i.append(d[p],Ai())}}}else if(i.nodeType===8)if(i.data===Wl)u.push({type:2,index:a});else{let d=-1;for(;(d=i.data.indexOf(hr,d+1))!==-1;)u.push({type:7,index:a}),d+=hr.length-1}a++}}static createElement(e,r){let n=Gr.createElement("template");return n.innerHTML=e,n}};function Un(t,e,r=t,n){var i,a,o,s;if(e===Hr)return e;let u=n!==void 0?(i=r._$Co)===null||i===void 0?void 0:i[n]:r._$Cl,c=Ii(e)?void 0:e._$litDirective$;return u?.constructor!==c&&((a=u?._$AO)===null||a===void 0||a.call(u,!1),c===void 0?u=void 0:(u=new c(t),u._$AT(t,r,n)),n!==void 0?((o=(s=r)._$Co)!==null&&o!==void 0?o:s._$Co=[])[n]=u:r._$Cl=u),u!==void 0&&(e=Un(t,u._$AS(t,e.values),u,n)),e}var Ks=class{constructor(e,r){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=r}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){var r;let{el:{content:n},parts:i}=this._$AD,a=((r=e?.creationScope)!==null&&r!==void 0?r:Gr).importNode(n,!0);Qr.currentNode=a;let o=Qr.nextNode(),s=0,u=0,c=i[0];for(;c!==void 0;){if(s===c.index){let l;c.type===2?l=new Kr(o,o.nextSibling,this,e):c.type===1?l=new c.ctor(o,c.name,c.strings,this,e):c.type===6&&(l=new Xs(o,this,e)),this._$AV.push(l),c=i[++u]}s!==c?.index&&(o=Qr.nextNode(),s++)}return Qr.currentNode=Gr,a}v(e){let r=0;for(let n of this._$AV)n!==void 0&&(n.strings!==void 0?(n._$AI(e,n,r),r+=n.strings.length-2):n._$AI(e[r])),r++}},Kr=class{constructor(e,r,n,i){var a;this.type=2,this._$AH=Me,this._$AN=void 0,this._$AA=e,this._$AB=r,this._$AM=n,this.options=i,this._$Cp=(a=i?.isConnected)===null||a===void 0||a}get _$AU(){var e,r;return(r=(e=this._$AM)===null||e===void 0?void 0:e._$AU)!==null&&r!==void 0?r:this._$Cp}get parentNode(){let e=this._$AA.parentNode,r=this._$AM;return r!==void 0&&e?.nodeType===11&&(e=r.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,r=this){e=Un(this,e,r),Ii(e)?e===Me||e==null||e===""?(this._$AH!==Me&&this._$AR(),this._$AH=Me):e!==this._$AH&&e!==Hr&&this._(e):e._$litType$!==void 0?this.g(e):e.nodeType!==void 0?this.$(e):vm(e)?this.T(e):this._(e)}k(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}$(e){this._$AH!==e&&(this._$AR(),this._$AH=this.k(e))}_(e){this._$AH!==Me&&Ii(this._$AH)?this._$AA.nextSibling.data=e:this.$(Gr.createTextNode(e)),this._$AH=e}g(e){var r;let{values:n,_$litType$:i}=e,a=typeof i=="number"?this._$AC(e):(i.el===void 0&&(i.el=Wr.createElement(Jl(i.h,i.h[0]),this.options)),i);if(((r=this._$AH)===null||r===void 0?void 0:r._$AD)===a)this._$AH.v(n);else{let o=new Ks(a,this),s=o.u(this.options);o.v(n),this.$(s),this._$AH=o}}_$AC(e){let r=Gl.get(e.strings);return r===void 0&&Gl.set(e.strings,r=new Wr(e)),r}T(e){Kl(this._$AH)||(this._$AH=[],this._$AR());let r=this._$AH,n,i=0;for(let a of e)i===r.length?r.push(n=new Kr(this.k(Ai()),this.k(Ai()),this,this.options)):n=r[i],n._$AI(a),i++;i<r.length&&(this._$AR(n&&n._$AB.nextSibling,i),r.length=i)}_$AR(e=this._$AA.nextSibling,r){var n;for((n=this._$AP)===null||n===void 0||n.call(this,!1,!0,r);e&&e!==this._$AB;){let i=e.nextSibling;e.remove(),e=i}}setConnected(e){var r;this._$AM===void 0&&(this._$Cp=e,(r=this._$AP)===null||r===void 0||r.call(this,e))}},jn=class{constructor(e,r,n,i,a){this.type=1,this._$AH=Me,this._$AN=void 0,this.element=e,this.name=r,this._$AM=i,this.options=a,n.length>2||n[0]!==""||n[1]!==""?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=Me}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(e,r=this,n,i){let a=this.strings,o=!1;if(a===void 0)e=Un(this,e,r,0),o=!Ii(e)||e!==this._$AH&&e!==Hr,o&&(this._$AH=e);else{let s=e,u,c;for(e=a[0],u=0;u<a.length-1;u++)c=Un(this,s[n+u],r,u),c===Hr&&(c=this._$AH[u]),o||(o=!Ii(c)||c!==this._$AH[u]),c===Me?e=Me:e!==Me&&(e+=(c??"")+a[u+1]),this._$AH[u]=c}o&&!i&&this.j(e)}j(e){e===Me?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},Zs=class extends jn{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===Me?void 0:e}},_m=Mn?Mn.emptyScript:"",Ys=class extends jn{constructor(){super(...arguments),this.type=4}j(e){e&&e!==Me?this.element.setAttribute(this.name,_m):this.element.removeAttribute(this.name)}},Js=class extends jn{constructor(e,r,n,i,a){super(e,r,n,i,a),this.type=5}_$AI(e,r=this){var n;if((e=(n=Un(this,e,r,0))!==null&&n!==void 0?n:Me)===Hr)return;let i=this._$AH,a=e===Me&&i!==Me||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,o=e!==Me&&(i===Me||a);a&&this.element.removeEventListener(this.name,this,i),o&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var r,n;typeof this._$AH=="function"?this._$AH.call((n=(r=this.options)===null||r===void 0?void 0:r.host)!==null&&n!==void 0?n:this.element,e):this._$AH.handleEvent(e)}},Xs=class{constructor(e,r,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=r,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){Un(this,e)}};var Hl=Wa.litHtmlPolyfillSupport;Hl?.(Wr,Kr),((Gs=Wa.litHtmlVersions)!==null&&Gs!==void 0?Gs:Wa.litHtmlVersions=[]).push("2.8.0");var Xl=(t,e,r)=>{var n,i;let a=(n=r?.renderBefore)!==null&&n!==void 0?n:e,o=a._$litPart$;if(o===void 0){let s=(i=r?.renderBefore)!==null&&i!==void 0?i:null;a._$litPart$=o=new Kr(e.insertBefore(Ai(),s),s,void 0,r??{})}return o._$AI(t),o};var ec,tc;var mr=class extends Xt{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e,r;let n=super.createRenderRoot();return(e=(r=this.renderOptions).renderBefore)!==null&&e!==void 0||(r.renderBefore=n.firstChild),n}update(e){let r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Xl(r,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)===null||e===void 0||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)===null||e===void 0||e.setConnected(!1)}render(){return Hr}};mr.finalized=!0,mr._$litElement$=!0,(ec=globalThis.litElementHydrateSupport)===null||ec===void 0||ec.call(globalThis,{LitElement:mr});var ef=globalThis.litElementPolyfillSupport;ef?.({LitElement:mr});((tc=globalThis.litElementVersions)!==null&&tc!==void 0?tc:globalThis.litElementVersions=[]).push("3.3.3");var tf=t=>e=>typeof e=="function"?((r,n)=>(customElements.define(r,n),n))(t,e):((r,n)=>{let{kind:i,elements:a}=n;return{kind:i,elements:a,finisher(o){customElements.define(r,o)}}})(t,e);var wm=(t,e)=>e.kind==="method"&&e.descriptor&&!("value"in e.descriptor)?{...e,finisher(r){r.createProperty(e.key,t)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){typeof e.initializer=="function"&&(this[e.key]=e.initializer.call(this))},finisher(r){r.createProperty(e.key,t)}},Sm=(t,e,r)=>{e.constructor.createProperty(r,t)};function ft(t){return(e,r)=>r!==void 0?Sm(t,e,r):wm(t,e)}function Ze(t){return ft({...t,state:!0})}var rc,b3=((rc=window.HTMLSlotElement)===null||rc===void 0?void 0:rc.prototype.assignedElements)!=null?(t,e)=>t.assignedElements(e):(t,e)=>t.assignedNodes(e).filter(r=>r.nodeType===Node.ELEMENT_NODE);var nc=function(t,e){return nc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},nc(t,e)};function xe(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");nc(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var _=function(){return _=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},_.apply(this,arguments)};function Ut(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function Tt(t,e,r,n){function i(a){return a instanceof r?a:new r(function(o){o(a)})}return new(r||(r=Promise))(function(a,o){function s(l){try{c(n.next(l))}catch(d){o(d)}}function u(l){try{c(n.throw(l))}catch(d){o(d)}}function c(l){l.done?a(l.value):i(l.value).then(s,u)}c((n=n.apply(t,e||[])).next())})}function At(t,e){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(c){return function(l){return u([c,l])}}function u(c){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(r=0)),r;)try{if(n=1,i&&(a=c[0]&2?i.return:c[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,c[1])).done)return a;switch(i=0,a&&(c=[c[0]&2,a.value]),c[0]){case 0:case 1:a=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,i=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!a||c[1]>a[0]&&c[1]<a[3])){r.label=c[1];break}if(c[0]===6&&r.label<a[1]){r.label=a[1],a=c;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(c);break}a[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(l){c=[6,l],i=0}finally{n=a=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function gr(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,a;n<i;n++)(a||!(n in e))&&(a||(a=Array.prototype.slice.call(e,0,n)),a[n]=e[n]);return t.concat(a||Array.prototype.slice.call(e))}var ic="Invariant Violation",rf=Object.setPrototypeOf,Cm=rf===void 0?function(t,e){return t.__proto__=e,t}:rf,V=function(t){xe(e,t);function e(r){r===void 0&&(r=ic);var n=t.call(this,typeof r=="number"?ic+": "+r+" (see https://github.com/apollographql/invariant-packages)":r)||this;return n.framesToPop=1,n.name=ic,Cm(n,e.prototype),n}return e}(Error);function I(t,e){if(!t)throw new V(e)}var Za=["debug","log","warn","error","silent"],ac=Za.indexOf("log");function Ka(t){return function(){if(Za.indexOf(t)>=ac){var e=console[t]||console.log;return e.apply(console,arguments)}}}(function(t){t.debug=Ka("debug"),t.log=Ka("log"),t.warn=Ka("warn"),t.error=Ka("error")})(I||(I={}));function nf(t){var e=Za[ac];return ac=Math.max(0,Za.indexOf(t)),e}function Ue(t){try{return t()}catch{}}var Ya=Ue(function(){return globalThis})||Ue(function(){return window})||Ue(function(){return self})||Ue(function(){return global})||Ue(function(){return Ue.constructor("return this")()});var af="__",of=[af,af].join("DEV");function Em(){try{return Boolean(__DEV__)}catch{return Object.defineProperty(Ya,of,{value:Ue(function(){return"production"})!=="production",enumerable:!1,configurable:!0,writable:!0}),Ya[of]}}var Zr=Em();function yr(t){try{return t()}catch{}}var oc=yr(function(){return globalThis})||yr(function(){return window})||yr(function(){return self})||yr(function(){return global})||yr(function(){return yr.constructor("return this")()}),sc=!1;function xm(){oc&&!yr(function(){return"production"})&&!yr(function(){return process})&&(Object.defineProperty(oc,"process",{value:{env:{NODE_ENV:"production"}},configurable:!0,enumerable:!1,writable:!0}),sc=!0)}xm();function cc(){sc&&(delete oc.process,sc=!1)}var Q3=typeof Symbol=="function"&&Symbol.iterator!=null?Symbol.iterator:"@@iterator",G3=typeof Symbol=="function"&&Symbol.asyncIterator!=null?Symbol.asyncIterator:"@@asyncIterator",sf=typeof Symbol=="function"&&Symbol.toStringTag!=null?Symbol.toStringTag:"@@toStringTag";var Oe=Object.freeze({NAME:"Name",DOCUMENT:"Document",OPERATION_DEFINITION:"OperationDefinition",VARIABLE_DEFINITION:"VariableDefinition",SELECTION_SET:"SelectionSet",FIELD:"Field",ARGUMENT:"Argument",FRAGMENT_SPREAD:"FragmentSpread",INLINE_FRAGMENT:"InlineFragment",FRAGMENT_DEFINITION:"FragmentDefinition",VARIABLE:"Variable",INT:"IntValue",FLOAT:"FloatValue",STRING:"StringValue",BOOLEAN:"BooleanValue",NULL:"NullValue",ENUM:"EnumValue",LIST:"ListValue",OBJECT:"ObjectValue",OBJECT_FIELD:"ObjectField",DIRECTIVE:"Directive",NAMED_TYPE:"NamedType",LIST_TYPE:"ListType",NON_NULL_TYPE:"NonNullType",SCHEMA_DEFINITION:"SchemaDefinition",OPERATION_TYPE_DEFINITION:"OperationTypeDefinition",SCALAR_TYPE_DEFINITION:"ScalarTypeDefinition",OBJECT_TYPE_DEFINITION:"ObjectTypeDefinition",FIELD_DEFINITION:"FieldDefinition",INPUT_VALUE_DEFINITION:"InputValueDefinition",INTERFACE_TYPE_DEFINITION:"InterfaceTypeDefinition",UNION_TYPE_DEFINITION:"UnionTypeDefinition",ENUM_TYPE_DEFINITION:"EnumTypeDefinition",ENUM_VALUE_DEFINITION:"EnumValueDefinition",INPUT_OBJECT_TYPE_DEFINITION:"InputObjectTypeDefinition",DIRECTIVE_DEFINITION:"DirectiveDefinition",SCHEMA_EXTENSION:"SchemaExtension",SCALAR_TYPE_EXTENSION:"ScalarTypeExtension",OBJECT_TYPE_EXTENSION:"ObjectTypeExtension",INTERFACE_TYPE_EXTENSION:"InterfaceTypeExtension",UNION_TYPE_EXTENSION:"UnionTypeExtension",ENUM_TYPE_EXTENSION:"EnumTypeExtension",INPUT_OBJECT_TYPE_EXTENSION:"InputObjectTypeExtension"});function uc(t,e){var r=Boolean(t);if(!r)throw new Error(e??"Unexpected invariant triggered.")}var km=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):void 0,Di=km;function Ja(t){var e=t.prototype.toJSON;typeof e=="function"||uc(0),t.prototype.inspect=e,Di&&(t.prototype[Di]=e)}var cf=function(){function t(r,n,i){this.start=r.start,this.end=n.end,this.startToken=r,this.endToken=n,this.source=i}var e=t.prototype;return e.toJSON=function(){return{start:this.start,end:this.end}},t}();Ja(cf);var uf=function(){function t(r,n,i,a,o,s,u){this.kind=r,this.start=n,this.end=i,this.line=a,this.column=o,this.value=u,this.prev=s,this.next=null}var e=t.prototype;return e.toJSON=function(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}},t}();Ja(uf);function lc(t){return t!=null&&typeof t.kind=="string"}function Xa(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Xa=function(r){return typeof r}:Xa=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Xa(t)}var Tm=10,lf=2;function Ni(t){return eo(t,[])}function eo(t,e){switch(Xa(t)){case"string":return JSON.stringify(t);case"function":return t.name?"[function ".concat(t.name,"]"):"[function]";case"object":return t===null?"null":Am(t,e);default:return String(t)}}function Am(t,e){if(e.indexOf(t)!==-1)return"[Circular]";var r=[].concat(e,[t]),n=Dm(t);if(n!==void 0){var i=n.call(t);if(i!==t)return typeof i=="string"?i:eo(i,r)}else if(Array.isArray(t))return Om(t,r);return Im(t,r)}function Im(t,e){var r=Object.keys(t);if(r.length===0)return"{}";if(e.length>lf)return"["+Nm(t)+"]";var n=r.map(function(i){var a=eo(t[i],e);return i+": "+a});return"{ "+n.join(", ")+" }"}function Om(t,e){if(t.length===0)return"[]";if(e.length>lf)return"[Array]";for(var r=Math.min(Tm,t.length),n=t.length-r,i=[],a=0;a<r;++a)i.push(eo(t[a],e));return n===1?i.push("... 1 more item"):n>1&&i.push("... ".concat(n," more items")),"["+i.join(", ")+"]"}function Dm(t){var e=t[String(Di)];if(typeof e=="function")return e;if(typeof t.inspect=="function")return t.inspect}function Nm(t){var e=Object.prototype.toString.call(t).replace(/^\[object /,"").replace(/]$/,"");if(e==="Object"&&typeof t.constructor=="function"){var r=t.constructor.name;if(typeof r=="string"&&r!=="")return r}return e}function Ri(t,e){var r=Boolean(t);if(!r)throw new Error(e)}function ff(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Rm(t,e,r){return e&&ff(t.prototype,e),r&&ff(t,r),t}var to=function(){function t(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"GraphQL request",n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{line:1,column:1};typeof e=="string"||Ri(0,"Body must be a string. Received: ".concat(Ni(e),".")),this.body=e,this.name=r,this.locationOffset=n,this.locationOffset.line>0||Ri(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||Ri(0,"column in locationOffset is 1-indexed and must be positive.")}return Rm(t,[{key:sf,get:function(){return"Source"}}]),t}();function pf(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,n=t.indexOf(`
|
|
4
4
|
`)===-1,i=t[0]===" "||t[0]===" ",a=t[t.length-1]==='"',o=t[t.length-1]==="\\",s=!n||a||o||r,u="";return s&&!(n&&i)&&(u+=`
|
|
5
5
|
`+e),u+=e?t.replace(/\n/g,`
|
|
6
6
|
`+e):t,s&&(u+=`
|
|
7
|
-
`),'"""'+u.replace(/"""/g,'\\"""')+'"""'}var
|
|
7
|
+
`),'"""'+u.replace(/"""/g,'\\"""')+'"""'}var Pm={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]},Yr=Object.freeze({});function Ke(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Pm,n=void 0,i=Array.isArray(t),a=[t],o=-1,s=[],u=void 0,c=void 0,l=void 0,d=[],p=[],f=t;do{o++;var h=o===a.length,g=h&&s.length!==0;if(h){if(c=p.length===0?void 0:d[d.length-1],u=l,l=p.pop(),g){if(i)u=u.slice();else{for(var y={},S=0,b=Object.keys(u);S<b.length;S++){var v=b[S];y[v]=u[v]}u=y}for(var m=0,A=0;A<s.length;A++){var D=s[A][0],E=s[A][1];i&&(D-=m),i&&E===null?(u.splice(D,1),m++):u[D]=E}}o=n.index,a=n.keys,s=n.edits,i=n.inArray,n=n.prev}else{if(c=l?i?o:a[o]:void 0,u=l?l[c]:f,u==null)continue;l&&d.push(c)}var O=void 0;if(!Array.isArray(u)){if(!lc(u))throw new Error("Invalid AST Node: ".concat(Ni(u),"."));var P=fc(e,u.kind,h);if(P){if(O=P.call(e,u,c,l,d,p),O===Yr)break;if(O===!1){if(!h){d.pop();continue}}else if(O!==void 0&&(s.push([c,O]),!h))if(lc(O))u=O;else{d.pop();continue}}}if(O===void 0&&g&&s.push([c,u]),h)d.pop();else{var N;n={inArray:i,index:o,keys:a,edits:s,prev:n},i=Array.isArray(u),a=i?u:(N=r[u.kind])!==null&&N!==void 0?N:[],o=-1,s=[],l&&p.push(l),l=u}}while(n!==void 0);return s.length!==0&&(f=s[s.length-1][1]),f}function fc(t,e,r){var n=t[e];if(n){if(!r&&typeof n=="function")return n;var i=r?n.leave:n.enter;if(typeof i=="function")return i}else{var a=r?t.leave:t.enter;if(a){if(typeof a=="function")return a;var o=a[e];if(typeof o=="function")return o}}}function qn(t){return Ke(t,{leave:$m})}var Lm=80,$m={Name:function(e){return e.value},Variable:function(e){return"$"+e.name},Document:function(e){return L(e.definitions,`
|
|
8
8
|
|
|
9
9
|
`)+`
|
|
10
|
-
`},OperationDefinition:function(e){var r=e.operation,n=e.name,i=Ce("(",L(e.variableDefinitions,", "),")"),a=L(e.directives," "),o=e.selectionSet;return!n&&!a&&!i&&r==="query"?o:L([r,L([n,i]),a,o]," ")},VariableDefinition:function(e){var r=e.variable,n=e.type,i=e.defaultValue,a=e.directives;return r+": "+n+Ce(" = ",i)+Ce(" ",L(a," "))},SelectionSet:function(e){var r=e.selections;return Ot(r)},Field:function(e){var r=e.alias,n=e.name,i=e.arguments,a=e.directives,o=e.selectionSet,s=Ce("",r,": ")+n,u=s+Ce("(",L(i,", "),")");return u.length>
|
|
11
|
-
`,
|
|
10
|
+
`},OperationDefinition:function(e){var r=e.operation,n=e.name,i=Ce("(",L(e.variableDefinitions,", "),")"),a=L(e.directives," "),o=e.selectionSet;return!n&&!a&&!i&&r==="query"?o:L([r,L([n,i]),a,o]," ")},VariableDefinition:function(e){var r=e.variable,n=e.type,i=e.defaultValue,a=e.directives;return r+": "+n+Ce(" = ",i)+Ce(" ",L(a," "))},SelectionSet:function(e){var r=e.selections;return Ot(r)},Field:function(e){var r=e.alias,n=e.name,i=e.arguments,a=e.directives,o=e.selectionSet,s=Ce("",r,": ")+n,u=s+Ce("(",L(i,", "),")");return u.length>Lm&&(u=s+Ce(`(
|
|
11
|
+
`,ro(L(i,`
|
|
12
12
|
`)),`
|
|
13
|
-
)`)),L([u,L(a," "),o]," ")},Argument:function(e){var r=e.name,n=e.value;return r+": "+n},FragmentSpread:function(e){var r=e.name,n=e.directives;return"..."+r+Ce(" ",L(n," "))},InlineFragment:function(e){var r=e.typeCondition,n=e.directives,i=e.selectionSet;return L(["...",Ce("on ",r),L(n," "),i]," ")},FragmentDefinition:function(e){var r=e.name,n=e.typeCondition,i=e.variableDefinitions,a=e.directives,o=e.selectionSet;return"fragment ".concat(r).concat(Ce("(",L(i,", "),")")," ")+"on ".concat(n," ").concat(Ce("",L(a," ")," "))+o},IntValue:function(e){var r=e.value;return r},FloatValue:function(e){var r=e.value;return r},StringValue:function(e,r){var n=e.value,i=e.block;return i?
|
|
14
|
-
`,
|
|
13
|
+
)`)),L([u,L(a," "),o]," ")},Argument:function(e){var r=e.name,n=e.value;return r+": "+n},FragmentSpread:function(e){var r=e.name,n=e.directives;return"..."+r+Ce(" ",L(n," "))},InlineFragment:function(e){var r=e.typeCondition,n=e.directives,i=e.selectionSet;return L(["...",Ce("on ",r),L(n," "),i]," ")},FragmentDefinition:function(e){var r=e.name,n=e.typeCondition,i=e.variableDefinitions,a=e.directives,o=e.selectionSet;return"fragment ".concat(r).concat(Ce("(",L(i,", "),")")," ")+"on ".concat(n," ").concat(Ce("",L(a," ")," "))+o},IntValue:function(e){var r=e.value;return r},FloatValue:function(e){var r=e.value;return r},StringValue:function(e,r){var n=e.value,i=e.block;return i?pf(n,r==="description"?"":" "):JSON.stringify(n)},BooleanValue:function(e){var r=e.value;return r?"true":"false"},NullValue:function(){return"null"},EnumValue:function(e){var r=e.value;return r},ListValue:function(e){var r=e.values;return"["+L(r,", ")+"]"},ObjectValue:function(e){var r=e.fields;return"{"+L(r,", ")+"}"},ObjectField:function(e){var r=e.name,n=e.value;return r+": "+n},Directive:function(e){var r=e.name,n=e.arguments;return"@"+r+Ce("(",L(n,", "),")")},NamedType:function(e){var r=e.name;return r},ListType:function(e){var r=e.type;return"["+r+"]"},NonNullType:function(e){var r=e.type;return r+"!"},SchemaDefinition:It(function(t){var e=t.directives,r=t.operationTypes;return L(["schema",L(e," "),Ot(r)]," ")}),OperationTypeDefinition:function(e){var r=e.operation,n=e.type;return r+": "+n},ScalarTypeDefinition:It(function(t){var e=t.name,r=t.directives;return L(["scalar",e,L(r," ")]," ")}),ObjectTypeDefinition:It(function(t){var e=t.name,r=t.interfaces,n=t.directives,i=t.fields;return L(["type",e,Ce("implements ",L(r," & ")),L(n," "),Ot(i)]," ")}),FieldDefinition:It(function(t){var e=t.name,r=t.arguments,n=t.type,i=t.directives;return e+(df(r)?Ce(`(
|
|
14
|
+
`,ro(L(r,`
|
|
15
15
|
`)),`
|
|
16
|
-
)`):Ce("(",L(r,", "),")"))+": "+n+Ce(" ",L(i," "))}),InputValueDefinition:It(function(t){var e=t.name,r=t.type,n=t.defaultValue,i=t.directives;return L([e+": "+r,Ce("= ",n),L(i," ")]," ")}),InterfaceTypeDefinition:It(function(t){var e=t.name,r=t.interfaces,n=t.directives,i=t.fields;return L(["interface",e,Ce("implements ",L(r," & ")),L(n," "),Ot(i)]," ")}),UnionTypeDefinition:It(function(t){var e=t.name,r=t.directives,n=t.types;return L(["union",e,L(r," "),n&&n.length!==0?"= "+L(n," | "):""]," ")}),EnumTypeDefinition:It(function(t){var e=t.name,r=t.directives,n=t.values;return L(["enum",e,L(r," "),Ot(n)]," ")}),EnumValueDefinition:It(function(t){var e=t.name,r=t.directives;return L([e,L(r," ")]," ")}),InputObjectTypeDefinition:It(function(t){var e=t.name,r=t.directives,n=t.fields;return L(["input",e,L(r," "),Ot(n)]," ")}),DirectiveDefinition:It(function(t){var e=t.name,r=t.arguments,n=t.repeatable,i=t.locations;return"directive @"+e+(
|
|
17
|
-
`,
|
|
16
|
+
)`):Ce("(",L(r,", "),")"))+": "+n+Ce(" ",L(i," "))}),InputValueDefinition:It(function(t){var e=t.name,r=t.type,n=t.defaultValue,i=t.directives;return L([e+": "+r,Ce("= ",n),L(i," ")]," ")}),InterfaceTypeDefinition:It(function(t){var e=t.name,r=t.interfaces,n=t.directives,i=t.fields;return L(["interface",e,Ce("implements ",L(r," & ")),L(n," "),Ot(i)]," ")}),UnionTypeDefinition:It(function(t){var e=t.name,r=t.directives,n=t.types;return L(["union",e,L(r," "),n&&n.length!==0?"= "+L(n," | "):""]," ")}),EnumTypeDefinition:It(function(t){var e=t.name,r=t.directives,n=t.values;return L(["enum",e,L(r," "),Ot(n)]," ")}),EnumValueDefinition:It(function(t){var e=t.name,r=t.directives;return L([e,L(r," ")]," ")}),InputObjectTypeDefinition:It(function(t){var e=t.name,r=t.directives,n=t.fields;return L(["input",e,L(r," "),Ot(n)]," ")}),DirectiveDefinition:It(function(t){var e=t.name,r=t.arguments,n=t.repeatable,i=t.locations;return"directive @"+e+(df(r)?Ce(`(
|
|
17
|
+
`,ro(L(r,`
|
|
18
18
|
`)),`
|
|
19
19
|
)`):Ce("(",L(r,", "),")"))+(n?" repeatable":"")+" on "+L(i," | ")}),SchemaExtension:function(e){var r=e.directives,n=e.operationTypes;return L(["extend schema",L(r," "),Ot(n)]," ")},ScalarTypeExtension:function(e){var r=e.name,n=e.directives;return L(["extend scalar",r,L(n," ")]," ")},ObjectTypeExtension:function(e){var r=e.name,n=e.interfaces,i=e.directives,a=e.fields;return L(["extend type",r,Ce("implements ",L(n," & ")),L(i," "),Ot(a)]," ")},InterfaceTypeExtension:function(e){var r=e.name,n=e.interfaces,i=e.directives,a=e.fields;return L(["extend interface",r,Ce("implements ",L(n," & ")),L(i," "),Ot(a)]," ")},UnionTypeExtension:function(e){var r=e.name,n=e.directives,i=e.types;return L(["extend union",r,L(n," "),i&&i.length!==0?"= "+L(i," | "):""]," ")},EnumTypeExtension:function(e){var r=e.name,n=e.directives,i=e.values;return L(["extend enum",r,L(n," "),Ot(i)]," ")},InputObjectTypeExtension:function(e){var r=e.name,n=e.directives,i=e.fields;return L(["extend input",r,L(n," "),Ot(i)]," ")}};function It(t){return function(e){return L([e.description,t(e)],`
|
|
20
20
|
`)}}function L(t){var e,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return(e=t?.filter(function(n){return n}).join(r))!==null&&e!==void 0?e:""}function Ot(t){return Ce(`{
|
|
21
|
-
`,
|
|
21
|
+
`,ro(L(t,`
|
|
22
22
|
`)),`
|
|
23
|
-
}`)}function Ce(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";return e!=null&&e!==""?t+e+r:""}function
|
|
24
|
-
`))}function
|
|
25
|
-
`)!==-1}function pf(t){return t!=null&&t.some($m)}function Ri(t){return t.kind===Oe.FIELD||t.kind===Oe.FRAGMENT_SPREAD||t.kind===Oe.INLINE_FRAGMENT}function df(){return typeof eo=="function"?oc():oc()}function Gm(){__DEV__?I(typeof Kr=="boolean",Kr):I(typeof Kr=="boolean",39)}df();Gm();function er(t,e){var r=t.directives;return!r||!r.length?!0:hf(r).every(function(n){var i=n.directive,a=n.ifArgument,o=!1;return a.value.kind==="Variable"?(o=e&&e[a.value.name.value],__DEV__?I(o!==void 0,"Invalid variable referenced in @".concat(i.name.value," directive.")):I(o!==void 0,40)):o=a.value.value,i.name.value==="skip"?!o:o})}function qn(t,e,r){var n=new Set(t),i=n.size;return Ke(e,{Directive:function(a){if(n.delete(a.name.value)&&(!r||!n.size))return Zr}}),r?!n.size:n.size<i}function lc(t){return t&&qn(["client","export"],t,!0)}function Hm(t){var e=t.name.value;return e==="skip"||e==="include"}function hf(t){var e=[];return t&&t.length&&t.forEach(function(r){if(!!Hm(r)){var n=r.arguments,i=r.name.value;__DEV__?I(n&&n.length===1,"Incorrect number of arguments for the @".concat(i," directive.")):I(n&&n.length===1,41);var a=n[0];__DEV__?I(a.name&&a.name.value==="if","Invalid argument for the @".concat(i," directive.")):I(a.name&&a.name.value==="if",42);var o=a.value;__DEV__?I(o&&(o.kind==="Variable"||o.kind==="BooleanValue"),"Argument for the @".concat(i," directive must be a variable or a boolean value.")):I(o&&(o.kind==="Variable"||o.kind==="BooleanValue"),43),e.push({directive:r,ifArgument:a})}}),e}function fc(t,e){var r=e,n=[];t.definitions.forEach(function(a){if(a.kind==="OperationDefinition")throw __DEV__?new V("Found a ".concat(a.operation," operation").concat(a.name?" named '".concat(a.name.value,"'"):"",". ")+"No operations are allowed when using a fragment as a query. Only fragments are allowed."):new V(44);a.kind==="FragmentDefinition"&&n.push(a)}),typeof r>"u"&&(__DEV__?I(n.length===1,"Found ".concat(n.length," fragments. `fragmentName` must be provided when there is not exactly 1 fragment.")):I(n.length===1,45),r=n[0].name.value);var i=_(_({},t),{definitions:mr([{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:r}}]}}],t.definitions,!0)});return i}function Yr(t){t===void 0&&(t=[]);var e={};return t.forEach(function(r){e[r.name.value]=r}),e}function Jr(t,e){switch(t.kind){case"InlineFragment":return t;case"FragmentSpread":{var r=t.name.value;if(typeof e=="function")return e(r);var n=e&&e[r];return __DEV__?I(n,"No fragment named ".concat(r)):I(n,46),n||null}default:return null}}function ee(t){return t!==null&&typeof t=="object"}function jt(t){return{__ref:String(t)}}function K(t){return Boolean(t&&typeof t=="object"&&typeof t.__ref=="string")}function pc(t){return ee(t)&&t.kind==="Document"&&Array.isArray(t.definitions)}function Wm(t){return t.kind==="StringValue"}function Km(t){return t.kind==="BooleanValue"}function Zm(t){return t.kind==="IntValue"}function Ym(t){return t.kind==="FloatValue"}function Jm(t){return t.kind==="Variable"}function Xm(t){return t.kind==="ObjectValue"}function e1(t){return t.kind==="ListValue"}function t1(t){return t.kind==="EnumValue"}function r1(t){return t.kind==="NullValue"}function yr(t,e,r,n){if(Zm(r)||Ym(r))t[e.value]=Number(r.value);else if(Km(r)||Wm(r))t[e.value]=r.value;else if(Xm(r)){var i={};r.fields.map(function(o){return yr(i,o.name,o.value,n)}),t[e.value]=i}else if(Jm(r)){var a=(n||{})[r.name.value];t[e.value]=a}else if(e1(r))t[e.value]=r.values.map(function(o){var s={};return yr(s,e,o,n),s[e.value]});else if(t1(r))t[e.value]=r.value;else if(r1(r))t[e.value]=null;else throw __DEV__?new V('The inline argument "'.concat(e.value,'" of kind "').concat(r.kind,'"')+"is not supported. Use variables instead of inline arguments to overcome this limitation."):new V(55)}function dc(t,e){var r=null;t.directives&&(r={},t.directives.forEach(function(i){r[i.name.value]={},i.arguments&&i.arguments.forEach(function(a){var o=a.name,s=a.value;return yr(r[i.name.value],o,s,e)})}));var n=null;return t.arguments&&t.arguments.length&&(n={},t.arguments.forEach(function(i){var a=i.name,o=i.value;return yr(n,a,o,e)})),Li(t.name.value,n,r)}var n1=["connection","include","skip","client","rest","export"],Li=Object.assign(function(t,e,r){if(e&&r&&r.connection&&r.connection.key)if(r.connection.filter&&r.connection.filter.length>0){var n=r.connection.filter?r.connection.filter:[];n.sort();var i={};return n.forEach(function(s){i[s]=e[s]}),"".concat(r.connection.key,"(").concat(Pi(i),")")}else return r.connection.key;var a=t;if(e){var o=Pi(e);a+="(".concat(o,")")}return r&&Object.keys(r).forEach(function(s){n1.indexOf(s)===-1&&(r[s]&&Object.keys(r[s]).length?a+="@".concat(s,"(").concat(Pi(r[s]),")"):a+="@".concat(s))}),a},{setStringify:function(t){var e=Pi;return Pi=t,e}}),Pi=function(e){return JSON.stringify(e,i1)};function i1(t,e){return ee(e)&&!Array.isArray(e)&&(e=Object.keys(e).sort().reduce(function(r,n){return r[n]=e[n],r},{})),e}function tr(t,e){if(t.arguments&&t.arguments.length){var r={};return t.arguments.forEach(function(n){var i=n.name,a=n.value;return yr(r,i,a,e)}),r}return null}function _t(t){return t.alias?t.alias.value:t.name.value}function $i(t,e,r){if(typeof t.__typename=="string")return t.__typename;for(var n=0,i=e.selections;n<i.length;n++){var a=i[n];if(pt(a)){if(a.name.value==="__typename")return t[_t(a)]}else{var o=$i(t,Jr(a,r).selectionSet,r);if(typeof o=="string")return o}}}function pt(t){return t.kind==="Field"}function hc(t){return t.kind==="InlineFragment"}function Bn(t){__DEV__?I(t&&t.kind==="Document",'Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a "gql" tag? http://docs.apollostack.com/apollo-client/core.html#gql'):I(t&&t.kind==="Document",47);var e=t.definitions.filter(function(r){return r.kind!=="FragmentDefinition"}).map(function(r){if(r.kind!=="OperationDefinition")throw __DEV__?new V('Schema type definitions not allowed in queries. Found: "'.concat(r.kind,'"')):new V(48);return r});return __DEV__?I(e.length<=1,"Ambiguous GraphQL document: contains ".concat(e.length," operations")):I(e.length<=1,49),t}function qt(t){return Bn(t),t.definitions.filter(function(e){return e.kind==="OperationDefinition"})[0]}function Vn(t){return t.definitions.filter(function(e){return e.kind==="OperationDefinition"&&!!e.name}).map(function(e){return e.name.value})[0]||null}function Xr(t){return t.definitions.filter(function(e){return e.kind==="FragmentDefinition"})}function Fi(t){var e=qt(t);return __DEV__?I(e&&e.operation==="query","Must contain a query definition."):I(e&&e.operation==="query",50),e}function mc(t){__DEV__?I(t.kind==="Document",'Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a "gql" tag? http://docs.apollostack.com/apollo-client/core.html#gql'):I(t.kind==="Document",51),__DEV__?I(t.definitions.length<=1,"Fragment must have exactly one definition."):I(t.definitions.length<=1,52);var e=t.definitions[0];return __DEV__?I(e.kind==="FragmentDefinition","Must be a fragment definition."):I(e.kind==="FragmentDefinition",53),e}function en(t){Bn(t);for(var e,r=0,n=t.definitions;r<n.length;r++){var i=n[r];if(i.kind==="OperationDefinition"){var a=i.operation;if(a==="query"||a==="mutation"||a==="subscription")return i}i.kind==="FragmentDefinition"&&!e&&(e=i)}if(e)return e;throw __DEV__?new V("Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment."):new V(54)}function tn(t){var e=Object.create(null),r=t&&t.variableDefinitions;return r&&r.length&&r.forEach(function(n){n.defaultValue&&yr(e,n.variable.name,n.defaultValue)}),e}var ue=Array.isArray;function Re(t){return Array.isArray(t)&&t.length>0}var mf={kind:Oe.FIELD,name:{kind:Oe.NAME,value:"__typename"}};function yf(t,e){return!t||t.selectionSet.selections.every(function(r){return r.kind===Oe.FRAGMENT_SPREAD&&yf(e[r.name.value],e)})}function a1(t){return yf(qt(t)||mc(t),Yr(Xr(t)))?null:t}function o1(t){var e=new Set,r=[];return t.forEach(function(n){n.name?e.add(n.name):n.test&&r.push(n.test)}),function(n){return e.has(n.name.value)||r.some(function(i){return i(n)})}}function gf(t){var e=new Map;return function(n){n===void 0&&(n=t);var i=e.get(n);return i||e.set(n,i={variables:new Set,fragmentSpreads:new Set}),i}}function gc(t,e){for(var r=gf(""),n=gf(""),i=function(b){for(var v=0,m=void 0;v<b.length&&(m=b[v]);++v)if(!ue(m)){if(m.kind===Oe.OPERATION_DEFINITION)return r(m.name&&m.name.value);if(m.kind===Oe.FRAGMENT_DEFINITION)return n(m.name.value)}return __DEV__&&I.error("Could not find operation or fragment"),null},a=0,o=e.definitions.length-1;o>=0;--o)e.definitions[o].kind===Oe.OPERATION_DEFINITION&&++a;var s=o1(t),u=t.some(function(b){return b.remove}),c=function(b){return u&&b&&b.some(s)},l=new Map,d=!1,p={enter:function(b){if(c(b.directives))return d=!0,null}},f=Ke(e,{Field:p,InlineFragment:p,VariableDefinition:{enter:function(){return!1}},Variable:{enter:function(b,v,m,A,D){var E=i(D);E&&E.variables.add(b.name.value)}},FragmentSpread:{enter:function(b,v,m,A,D){if(c(b.directives))return d=!0,null;var E=i(D);E&&E.fragmentSpreads.add(b.name.value)}},FragmentDefinition:{enter:function(b,v,m,A){l.set(JSON.stringify(A),b)},leave:function(b,v,m,A){var D=l.get(JSON.stringify(A));if(b===D)return b;if(a>0&&b.selectionSet.selections.every(function(E){return E.kind===Oe.FIELD&&E.name.value==="__typename"}))return n(b.name.value).removed=!0,d=!0,null}},Directive:{leave:function(b){if(s(b))return d=!0,null}}});if(!d)return e;var h=function(b){return b.transitiveVars||(b.transitiveVars=new Set(b.variables),b.removed||b.fragmentSpreads.forEach(function(v){h(n(v)).transitiveVars.forEach(function(m){b.transitiveVars.add(m)})})),b},g=new Set;f.definitions.forEach(function(b){b.kind===Oe.OPERATION_DEFINITION?h(r(b.name&&b.name.value)).fragmentSpreads.forEach(function(v){g.add(v)}):b.kind===Oe.FRAGMENT_DEFINITION&&a===0&&!n(b.name.value).removed&&g.add(b.name.value)}),g.forEach(function(b){h(n(b)).fragmentSpreads.forEach(function(v){g.add(v)})});var y=function(b){return!!(!g.has(b)||n(b).removed)},S={enter:function(b){if(y(b.name.value))return null}};return a1(Ke(f,{FragmentSpread:S,FragmentDefinition:S,OperationDefinition:{leave:function(b){if(b.variableDefinitions){var v=h(r(b.name&&b.name.value)).transitiveVars;if(v.size<b.variableDefinitions.length)return _(_({},b),{variableDefinitions:b.variableDefinitions.filter(function(m){return v.has(m.variable.name.value)})})}}}}))}var rn=Object.assign(function(t){return Ke(t,{SelectionSet:{enter:function(e,r,n){if(!(n&&n.kind===Oe.OPERATION_DEFINITION)){var i=e.selections;if(!!i){var a=i.some(function(s){return pt(s)&&(s.name.value==="__typename"||s.name.value.lastIndexOf("__",0)===0)});if(!a){var o=n;if(!(pt(o)&&o.directives&&o.directives.some(function(s){return s.name.value==="export"})))return _(_({},e),{selections:mr(mr([],i,!0),[mf],!1)})}}}}}})},{added:function(t){return t===mf}}),s1={test:function(t){var e=t.name.value==="connection";return e&&(!t.arguments||!t.arguments.some(function(r){return r.name.value==="key"}))&&__DEV__&&I.warn("Removing an @connection directive even though it does not have a key. You may want to use the key parameter to specify a store key."),e}};function yc(t){return gc([s1],Bn(t))}function vc(t){var e=en(t),r=e.operation;if(r==="query")return t;var n=Ke(t,{OperationDefinition:{enter:function(i){return _(_({},i),{operation:"query"})}}});return n}function bc(t){Bn(t);var e=gc([{test:function(r){return r.name.value==="client"},remove:!0}],t);return e}var c1=Object.prototype.hasOwnProperty;function _c(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Mi(t)}function Mi(t){var e=t[0]||{},r=t.length;if(r>1)for(var n=new it,i=1;i<r;++i)e=n.merge(e,t[i]);return e}var u1=function(t,e,r){return this.merge(t[r],e[r])},it=function(){function t(e){e===void 0&&(e=u1),this.reconciler=e,this.isObject=ee,this.pastCopies=new Set}return t.prototype.merge=function(e,r){for(var n=this,i=[],a=2;a<arguments.length;a++)i[a-2]=arguments[a];return ee(r)&&ee(e)?(Object.keys(r).forEach(function(o){if(c1.call(e,o)){var s=e[o];if(r[o]!==s){var u=n.reconciler.apply(n,mr([e,r,o],i,!1));u!==s&&(e=n.shallowCopyForMerge(e),e[o]=u)}}else e=n.shallowCopyForMerge(e),e[o]=r[o]}),e):r},t.prototype.shallowCopyForMerge=function(e){return ee(e)&&(this.pastCopies.has(e)||(Array.isArray(e)?e=e.slice(0):e=_({__proto__:Object.getPrototypeOf(e)},e),this.pastCopies.add(e))),e},t}();function l1(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r)return(r=r.call(t)).next.bind(r);if(Array.isArray(t)||(r=f1(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0;return function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
26
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function f1(t,e){if(!!t){if(typeof t=="string")return vf(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return vf(t,e)}}function vf(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function bf(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Ec(t,e,r){return e&&bf(t.prototype,e),r&&bf(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}var xc=function(){return typeof Symbol=="function"},kc=function(t){return xc()&&Boolean(Symbol[t])},Tc=function(t){return kc(t)?Symbol[t]:"@@"+t};xc()&&!kc("observable")&&(Symbol.observable=Symbol("observable"));var p1=Tc("iterator"),Sc=Tc("observable"),_f=Tc("species");function no(t,e){var r=t[e];if(r!=null){if(typeof r!="function")throw new TypeError(r+" is not a function");return r}}function Ui(t){var e=t.constructor;return e!==void 0&&(e=e[_f],e===null&&(e=void 0)),e!==void 0?e:W}function d1(t){return t instanceof W}function zn(t){zn.log?zn.log(t):setTimeout(function(){throw t})}function ro(t){Promise.resolve().then(function(){try{t()}catch(e){zn(e)}})}function wf(t){var e=t._cleanup;if(e!==void 0&&(t._cleanup=void 0,!!e))try{if(typeof e=="function")e();else{var r=no(e,"unsubscribe");r&&r.call(e)}}catch(n){zn(n)}}function Cc(t){t._observer=void 0,t._queue=void 0,t._state="closed"}function h1(t){var e=t._queue;if(!!e){t._queue=void 0,t._state="ready";for(var r=0;r<e.length&&(Sf(t,e[r].type,e[r].value),t._state!=="closed");++r);}}function Sf(t,e,r){t._state="running";var n=t._observer;try{var i=no(n,e);switch(e){case"next":i&&i.call(n,r);break;case"error":if(Cc(t),i)i.call(n,r);else throw r;break;case"complete":Cc(t),i&&i.call(n);break}}catch(a){zn(a)}t._state==="closed"?wf(t):t._state==="running"&&(t._state="ready")}function wc(t,e,r){if(t._state!=="closed"){if(t._state==="buffering"){t._queue.push({type:e,value:r});return}if(t._state!=="ready"){t._state="buffering",t._queue=[{type:e,value:r}],ro(function(){return h1(t)});return}Sf(t,e,r)}}var m1=function(){function t(r,n){this._cleanup=void 0,this._observer=r,this._queue=void 0,this._state="initializing";var i=new g1(this);try{this._cleanup=n.call(void 0,i)}catch(a){i.error(a)}this._state==="initializing"&&(this._state="ready")}var e=t.prototype;return e.unsubscribe=function(){this._state!=="closed"&&(Cc(this),wf(this))},Ec(t,[{key:"closed",get:function(){return this._state==="closed"}}]),t}(),g1=function(){function t(r){this._subscription=r}var e=t.prototype;return e.next=function(n){wc(this._subscription,"next",n)},e.error=function(n){wc(this._subscription,"error",n)},e.complete=function(){wc(this._subscription,"complete")},Ec(t,[{key:"closed",get:function(){return this._subscription._state==="closed"}}]),t}(),W=function(){function t(r){if(!(this instanceof t))throw new TypeError("Observable cannot be called as a function");if(typeof r!="function")throw new TypeError("Observable initializer must be a function");this._subscriber=r}var e=t.prototype;return e.subscribe=function(n){return(typeof n!="object"||n===null)&&(n={next:n,error:arguments[1],complete:arguments[2]}),new m1(n,this._subscriber)},e.forEach=function(n){var i=this;return new Promise(function(a,o){if(typeof n!="function"){o(new TypeError(n+" is not a function"));return}function s(){u.unsubscribe(),a()}var u=i.subscribe({next:function(c){try{n(c,s)}catch(l){o(l),u.unsubscribe()}},error:o,complete:a})})},e.map=function(n){var i=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var a=Ui(this);return new a(function(o){return i.subscribe({next:function(s){try{s=n(s)}catch(u){return o.error(u)}o.next(s)},error:function(s){o.error(s)},complete:function(){o.complete()}})})},e.filter=function(n){var i=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var a=Ui(this);return new a(function(o){return i.subscribe({next:function(s){try{if(!n(s))return}catch(u){return o.error(u)}o.next(s)},error:function(s){o.error(s)},complete:function(){o.complete()}})})},e.reduce=function(n){var i=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var a=Ui(this),o=arguments.length>1,s=!1,u=arguments[1],c=u;return new a(function(l){return i.subscribe({next:function(d){var p=!s;if(s=!0,!p||o)try{c=n(c,d)}catch(f){return l.error(f)}else c=d},error:function(d){l.error(d)},complete:function(){if(!s&&!o)return l.error(new TypeError("Cannot reduce an empty sequence"));l.next(c),l.complete()}})})},e.concat=function(){for(var n=this,i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];var s=Ui(this);return new s(function(u){var c,l=0;function d(p){c=p.subscribe({next:function(f){u.next(f)},error:function(f){u.error(f)},complete:function(){l===a.length?(c=void 0,u.complete()):d(s.from(a[l++]))}})}return d(n),function(){c&&(c.unsubscribe(),c=void 0)}})},e.flatMap=function(n){var i=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var a=Ui(this);return new a(function(o){var s=[],u=i.subscribe({next:function(l){if(n)try{l=n(l)}catch(p){return o.error(p)}var d=a.from(l).subscribe({next:function(p){o.next(p)},error:function(p){o.error(p)},complete:function(){var p=s.indexOf(d);p>=0&&s.splice(p,1),c()}});s.push(d)},error:function(l){o.error(l)},complete:function(){c()}});function c(){u.closed&&s.length===0&&o.complete()}return function(){s.forEach(function(l){return l.unsubscribe()}),u.unsubscribe()}})},e[Sc]=function(){return this},t.from=function(n){var i=typeof this=="function"?this:t;if(n==null)throw new TypeError(n+" is not an object");var a=no(n,Sc);if(a){var o=a.call(n);if(Object(o)!==o)throw new TypeError(o+" is not an object");return d1(o)&&o.constructor===i?o:new i(function(s){return o.subscribe(s)})}if(kc("iterator")&&(a=no(n,p1),a))return new i(function(s){ro(function(){if(!s.closed){for(var u=l1(a.call(n)),c;!(c=u()).done;){var l=c.value;if(s.next(l),s.closed)return}s.complete()}})});if(Array.isArray(n))return new i(function(s){ro(function(){if(!s.closed){for(var u=0;u<n.length;++u)if(s.next(n[u]),s.closed)return;s.complete()}})});throw new TypeError(n+" is not observable")},t.of=function(){for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];var o=typeof this=="function"?this:t;return new o(function(s){ro(function(){if(!s.closed){for(var u=0;u<i.length;++u)if(s.next(i[u]),s.closed)return;s.complete()}})})},Ec(t,null,[{key:_f,get:function(){return this}}]),t}();xc()&&Object.defineProperty(W,Symbol("extensions"),{value:{symbol:Sc,hostReportError:zn},configurable:!0});function Ac(t){var e,r=t.Symbol;if(typeof r=="function")if(r.observable)e=r.observable;else{typeof r.for=="function"?e=r.for("https://github.com/benlesh/symbol-observable"):e=r("https://github.com/benlesh/symbol-observable");try{r.observable=e}catch{}}else e="@@observable";return e}var Qn;typeof self<"u"?Qn=self:typeof window<"u"?Qn=window:typeof global<"u"?Qn=global:typeof module<"u"?Qn=module:Qn=Function("return this")();var v_=Ac(Qn);var Cf=W.prototype,Ef="@@observable";Cf[Ef]||(Cf[Ef]=function(){return this});var y1=Object.prototype.toString;function io(t){return Ic(t)}function Ic(t,e){switch(y1.call(t)){case"[object Array]":{if(e=e||new Map,e.has(t))return e.get(t);var r=t.slice(0);return e.set(t,r),r.forEach(function(i,a){r[a]=Ic(i,e)}),r}case"[object Object]":{if(e=e||new Map,e.has(t))return e.get(t);var n=Object.create(Object.getPrototypeOf(t));return e.set(t,n),Object.keys(t).forEach(function(i){n[i]=Ic(t[i],e)}),n}default:return t}}function v1(t){var e=new Set([t]);return e.forEach(function(r){ee(r)&&b1(r)===r&&Object.getOwnPropertyNames(r).forEach(function(n){ee(r[n])&&e.add(r[n])})}),t}function b1(t){if(__DEV__&&!Object.isFrozen(t))try{Object.freeze(t)}catch(e){if(e instanceof TypeError)return null;throw e}return t}function ji(t){return __DEV__&&v1(t),t}function nn(t,e,r){var n=[];t.forEach(function(i){return i[e]&&n.push(i)}),n.forEach(function(i){return i[e](r)})}function ao(t,e,r){return new W(function(n){var i=n.next,a=n.error,o=n.complete,s=0,u=!1,c={then:function(f){return new Promise(function(h){return h(f())})}};function l(f,h){return f?function(g){++s;var y=function(){return f(g)};c=c.then(y,y).then(function(S){--s,i&&i.call(n,S),u&&d.complete()},function(S){throw--s,S}).catch(function(S){a&&a.call(n,S)})}:function(g){return h&&h.call(n,g)}}var d={next:l(e,i),error:l(r,a),complete:function(){u=!0,s||o&&o.call(n)}},p=t.subscribe(d);return function(){return p.unsubscribe()}})}var wt=typeof WeakMap=="function"&&Ue(function(){return navigator.product})!=="ReactNative",xf=typeof WeakSet=="function",Oc=typeof Symbol=="function"&&typeof Symbol.for=="function",vr=Oc&&Symbol.asyncIterator,D_=typeof Ue(function(){return window.document.createElement})=="function",N_=Ue(function(){return navigator.userAgent.indexOf("jsdom")>=0})||!1;function oo(t){function e(r){Object.defineProperty(t,r,{value:W})}return Oc&&Symbol.species&&e(Symbol.species),e("@@species"),t}function kf(t){return t&&typeof t.then=="function"}var Gn=function(t){xe(e,t);function e(r){var n=t.call(this,function(i){return n.addObserver(i),function(){return n.removeObserver(i)}})||this;return n.observers=new Set,n.promise=new Promise(function(i,a){n.resolve=i,n.reject=a}),n.handlers={next:function(i){n.sub!==null&&(n.latest=["next",i],n.notify("next",i),nn(n.observers,"next",i))},error:function(i){var a=n.sub;a!==null&&(a&&setTimeout(function(){return a.unsubscribe()}),n.sub=null,n.latest=["error",i],n.reject(i),n.notify("error",i),nn(n.observers,"error",i))},complete:function(){var i=n,a=i.sub,o=i.sources,s=o===void 0?[]:o;if(a!==null){var u=s.shift();u?kf(u)?u.then(function(c){return n.sub=c.subscribe(n.handlers)}):n.sub=u.subscribe(n.handlers):(a&&setTimeout(function(){return a.unsubscribe()}),n.sub=null,n.latest&&n.latest[0]==="next"?n.resolve(n.latest[1]):n.resolve(),n.notify("complete"),nn(n.observers,"complete"))}}},n.nextResultListeners=new Set,n.cancel=function(i){n.reject(i),n.sources=[],n.handlers.complete()},n.promise.catch(function(i){}),typeof r=="function"&&(r=[new W(r)]),kf(r)?r.then(function(i){return n.start(i)},n.handlers.error):n.start(r),n}return e.prototype.start=function(r){this.sub===void 0&&(this.sources=Array.from(r),this.handlers.complete())},e.prototype.deliverLastMessage=function(r){if(this.latest){var n=this.latest[0],i=r[n];i&&i.call(r,this.latest[1]),this.sub===null&&n==="next"&&r.complete&&r.complete()}},e.prototype.addObserver=function(r){this.observers.has(r)||(this.deliverLastMessage(r),this.observers.add(r))},e.prototype.removeObserver=function(r){this.observers.delete(r)&&this.observers.size<1&&this.handlers.complete()},e.prototype.notify=function(r,n){var i=this.nextResultListeners;i.size&&(this.nextResultListeners=new Set,i.forEach(function(a){return a(r,n)}))},e.prototype.beforeNext=function(r){var n=!1;this.nextResultListeners.add(function(i,a){n||(n=!0,r(i,a))})},e}(W);oo(Gn);function br(t){return"incremental"in t}function _1(t){return"hasNext"in t&&"data"in t}function Tf(t){return br(t)||_1(t)}function so(t,e){var r=t,n=new it;return br(e)&&Re(e.incremental)&&e.incremental.forEach(function(i){for(var a=i.data,o=i.path,s=o.length-1;s>=0;--s){var u=o[s],c=!isNaN(+u),l=c?[]:{};l[u]=a,a=l}r=n.merge(r,a)}),r}function Hn(t){var e=co(t);return Re(e)}function co(t){var e=Re(t.errors)?t.errors.slice(0):[];return br(t)&&Re(t.incremental)&&t.incremental.forEach(function(r){r.errors&&e.push.apply(e,r.errors)}),e}function _r(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=Object.create(null);return t.forEach(function(n){!n||Object.keys(n).forEach(function(i){var a=n[i];a!==void 0&&(r[i]=a)})}),r}var Af=new Map;function qi(t){var e=Af.get(t)||1;return Af.set(t,e+1),"".concat(t,":").concat(e,":").concat(Math.random().toString(36).slice(2))}function If(t){var e=qi("stringifyForDisplay");return JSON.stringify(t,function(r,n){return n===void 0?e:n}).split(JSON.stringify(e)).join("<undefined>")}function Bi(t,e){return _r(t,e,e.variables&&{variables:_(_({},t&&t.variables),e.variables)})}function uo(t){return new W(function(e){e.error(t)})}var Vi=function(t,e,r){var n=new Error(r);throw n.name="ServerError",n.response=t,n.statusCode=t.status,n.result=e,n};function Dc(t){for(var e=["query","operationName","variables","extensions","context"],r=0,n=Object.keys(t);r<n.length;r++){var i=n[r];if(e.indexOf(i)<0)throw __DEV__?new V("illegal argument: ".concat(i)):new V(27)}return t}function Nc(t,e){var r=_({},t),n=function(a){typeof a=="function"?r=_(_({},r),a(r)):r=_(_({},r),a)},i=function(){return _({},r)};return Object.defineProperty(e,"setContext",{enumerable:!1,value:n}),Object.defineProperty(e,"getContext",{enumerable:!1,value:i}),e}function Rc(t){var e={variables:t.variables||{},extensions:t.extensions||{},operationName:t.operationName,query:t.query};return e.operationName||(e.operationName=typeof e.query!="string"?Vn(e.query)||void 0:""),e}function Of(t,e){return e?e(t):W.of()}function zi(t){return typeof t=="function"?new St(t):t}function lo(t){return t.request.length<=1}var w1=function(t){xe(e,t);function e(r,n){var i=t.call(this,r)||this;return i.link=n,i}return e}(Error),St=function(){function t(e){e&&(this.request=e)}return t.empty=function(){return new t(function(){return W.of()})},t.from=function(e){return e.length===0?t.empty():e.map(zi).reduce(function(r,n){return r.concat(n)})},t.split=function(e,r,n){var i=zi(r),a=zi(n||new t(Of));return lo(i)&&lo(a)?new t(function(o){return e(o)?i.request(o)||W.of():a.request(o)||W.of()}):new t(function(o,s){return e(o)?i.request(o,s)||W.of():a.request(o,s)||W.of()})},t.execute=function(e,r){return e.request(Nc(r.context,Rc(Dc(r))))||W.of()},t.concat=function(e,r){var n=zi(e);if(lo(n))return __DEV__&&I.warn(new w1("You are calling concat on a terminating link, which will have no effect",n)),n;var i=zi(r);return lo(i)?new t(function(a){return n.request(a,function(o){return i.request(o)||W.of()})||W.of()}):new t(function(a,o){return n.request(a,function(s){return i.request(s,o)||W.of()})||W.of()})},t.prototype.split=function(e,r,n){return this.concat(t.split(e,r,n||new t(Of)))},t.prototype.concat=function(e){return t.concat(this,e)},t.prototype.request=function(e,r){throw __DEV__?new V("request is not implemented"):new V(22)},t.prototype.onError=function(e,r){if(r&&r.error)return r.error(e),!1;throw e},t.prototype.setOnError=function(e){return this.onError=e,this},t}();var Wn=St.execute;var Df="3.7.10";function Nf(t){return!!t.body}function Rf(t){return!!t.getReader}function Pf(t){return!!(vr&&t[Symbol.asyncIterator])}function Lf(t){return!!t.stream}function $f(t){return!!t.arrayBuffer}function Ff(t){return!!t.pipe}function Pc(t){var e,r=t[Symbol.asyncIterator]();return e={next:function(){return r.next()}},e[Symbol.asyncIterator]=function(){return this},e}function Lc(t){var e=null,r=null,n=!1,i=[],a=[];function o(d){if(!r){if(a.length){var p=a.shift();if(Array.isArray(p)&&p[0])return p[0]({value:d,done:!1})}i.push(d)}}function s(d){r=d;var p=a.slice();p.forEach(function(f){f[1](d)}),!e||e()}function u(){n=!0;var d=a.slice();d.forEach(function(p){p[0]({value:void 0,done:!0})}),!e||e()}e=function(){e=null,t.removeListener("data",o),t.removeListener("error",s),t.removeListener("end",u),t.removeListener("finish",u),t.removeListener("close",u)},t.on("data",o),t.on("error",s),t.on("end",u),t.on("finish",u),t.on("close",u);function c(){return new Promise(function(d,p){if(r)return p(r);if(i.length)return d({value:i.shift(),done:!1});if(n)return d({value:void 0,done:!0});a.push([d,p])})}var l={next:function(){return c()}};return vr&&(l[Symbol.asyncIterator]=function(){return this}),l}function $c(t){var e=!1,r={next:function(){return e?Promise.resolve({value:void 0,done:!0}):(e=!0,new Promise(function(n,i){t.then(function(a){n({value:a,done:!1})}).catch(i)}))}};return vr&&(r[Symbol.asyncIterator]=function(){return this}),r}function fo(t){var e={next:function(){return t.read()}};return vr&&(e[Symbol.asyncIterator]=function(){return this}),e}function Mf(t){var e=t;if(Nf(t)&&(e=t.body),Pf(e))return Pc(e);if(Rf(e))return fo(e.getReader());if(Lf(e))return fo(e.stream().getReader());if($f(e))return $c(e.arrayBuffer());if(Ff(e))return Lc(e);throw new Error("Unknown body type for responseIterator. Please pass a streamable response.")}var Uf=Object.prototype.hasOwnProperty;function jf(t,e){var r,n,i;return Tt(this,void 0,void 0,function(){var a,o,s,u,c,l,d,p,f,h,g,y,S,b,v,m,A,D,E,O;return At(this,function(P){switch(P.label){case 0:if(TextDecoder===void 0)throw new Error("TextDecoder must be defined in the environment: please import a polyfill.");a=new TextDecoder("utf-8"),o=(r=t.headers)===null||r===void 0?void 0:r.get("content-type"),s="boundary=",u=o?.includes(s)?o?.substring(o?.indexOf(s)+s.length).replace(/['"]/g,"").replace(/\;(.*)/gm,"").trim():"-",c="--".concat(u),l="",d=Mf(t),p=!0,P.label=1;case 1:return p?[4,d.next()]:[3,3];case 2:for(f=P.sent(),h=f.value,g=f.done,y=typeof h=="string"?h:a.decode(h),p=!g,l+=y,S=l.indexOf(c);S>-1;){if(b=void 0,O=[l.slice(0,S),l.slice(S+c.length)],b=O[0],l=O[1],b.trim()){if(v=b.indexOf(`\r
|
|
23
|
+
}`)}function Ce(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";return e!=null&&e!==""?t+e+r:""}function ro(t){return Ce(" ",t.replace(/\n/g,`
|
|
24
|
+
`))}function Fm(t){return t.indexOf(`
|
|
25
|
+
`)!==-1}function df(t){return t!=null&&t.some(Fm)}function Pi(t){return t.kind===Oe.FIELD||t.kind===Oe.FRAGMENT_SPREAD||t.kind===Oe.INLINE_FRAGMENT}function hf(){return typeof to=="function"?cc():cc()}function Hm(){__DEV__?I(typeof Zr=="boolean",Zr):I(typeof Zr=="boolean",39)}hf();Hm();function er(t,e){var r=t.directives;return!r||!r.length?!0:mf(r).every(function(n){var i=n.directive,a=n.ifArgument,o=!1;return a.value.kind==="Variable"?(o=e&&e[a.value.name.value],__DEV__?I(o!==void 0,"Invalid variable referenced in @".concat(i.name.value," directive.")):I(o!==void 0,40)):o=a.value.value,i.name.value==="skip"?!o:o})}function Bn(t,e,r){var n=new Set(t),i=n.size;return Ke(e,{Directive:function(a){if(n.delete(a.name.value)&&(!r||!n.size))return Yr}}),r?!n.size:n.size<i}function pc(t){return t&&Bn(["client","export"],t,!0)}function Wm(t){var e=t.name.value;return e==="skip"||e==="include"}function mf(t){var e=[];return t&&t.length&&t.forEach(function(r){if(!!Wm(r)){var n=r.arguments,i=r.name.value;__DEV__?I(n&&n.length===1,"Incorrect number of arguments for the @".concat(i," directive.")):I(n&&n.length===1,41);var a=n[0];__DEV__?I(a.name&&a.name.value==="if","Invalid argument for the @".concat(i," directive.")):I(a.name&&a.name.value==="if",42);var o=a.value;__DEV__?I(o&&(o.kind==="Variable"||o.kind==="BooleanValue"),"Argument for the @".concat(i," directive must be a variable or a boolean value.")):I(o&&(o.kind==="Variable"||o.kind==="BooleanValue"),43),e.push({directive:r,ifArgument:a})}}),e}function dc(t,e){var r=e,n=[];t.definitions.forEach(function(a){if(a.kind==="OperationDefinition")throw __DEV__?new V("Found a ".concat(a.operation," operation").concat(a.name?" named '".concat(a.name.value,"'"):"",". ")+"No operations are allowed when using a fragment as a query. Only fragments are allowed."):new V(44);a.kind==="FragmentDefinition"&&n.push(a)}),typeof r>"u"&&(__DEV__?I(n.length===1,"Found ".concat(n.length," fragments. `fragmentName` must be provided when there is not exactly 1 fragment.")):I(n.length===1,45),r=n[0].name.value);var i=_(_({},t),{definitions:gr([{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:r}}]}}],t.definitions,!0)});return i}function Jr(t){t===void 0&&(t=[]);var e={};return t.forEach(function(r){e[r.name.value]=r}),e}function Xr(t,e){switch(t.kind){case"InlineFragment":return t;case"FragmentSpread":{var r=t.name.value;if(typeof e=="function")return e(r);var n=e&&e[r];return __DEV__?I(n,"No fragment named ".concat(r)):I(n,46),n||null}default:return null}}function ee(t){return t!==null&&typeof t=="object"}function jt(t){return{__ref:String(t)}}function K(t){return Boolean(t&&typeof t=="object"&&typeof t.__ref=="string")}function hc(t){return ee(t)&&t.kind==="Document"&&Array.isArray(t.definitions)}function Km(t){return t.kind==="StringValue"}function Zm(t){return t.kind==="BooleanValue"}function Ym(t){return t.kind==="IntValue"}function Jm(t){return t.kind==="FloatValue"}function Xm(t){return t.kind==="Variable"}function e1(t){return t.kind==="ObjectValue"}function t1(t){return t.kind==="ListValue"}function r1(t){return t.kind==="EnumValue"}function n1(t){return t.kind==="NullValue"}function vr(t,e,r,n){if(Ym(r)||Jm(r))t[e.value]=Number(r.value);else if(Zm(r)||Km(r))t[e.value]=r.value;else if(e1(r)){var i={};r.fields.map(function(o){return vr(i,o.name,o.value,n)}),t[e.value]=i}else if(Xm(r)){var a=(n||{})[r.name.value];t[e.value]=a}else if(t1(r))t[e.value]=r.values.map(function(o){var s={};return vr(s,e,o,n),s[e.value]});else if(r1(r))t[e.value]=r.value;else if(n1(r))t[e.value]=null;else throw __DEV__?new V('The inline argument "'.concat(e.value,'" of kind "').concat(r.kind,'"')+"is not supported. Use variables instead of inline arguments to overcome this limitation."):new V(55)}function mc(t,e){var r=null;t.directives&&(r={},t.directives.forEach(function(i){r[i.name.value]={},i.arguments&&i.arguments.forEach(function(a){var o=a.name,s=a.value;return vr(r[i.name.value],o,s,e)})}));var n=null;return t.arguments&&t.arguments.length&&(n={},t.arguments.forEach(function(i){var a=i.name,o=i.value;return vr(n,a,o,e)})),$i(t.name.value,n,r)}var i1=["connection","include","skip","client","rest","export"],$i=Object.assign(function(t,e,r){if(e&&r&&r.connection&&r.connection.key)if(r.connection.filter&&r.connection.filter.length>0){var n=r.connection.filter?r.connection.filter:[];n.sort();var i={};return n.forEach(function(s){i[s]=e[s]}),"".concat(r.connection.key,"(").concat(Li(i),")")}else return r.connection.key;var a=t;if(e){var o=Li(e);a+="(".concat(o,")")}return r&&Object.keys(r).forEach(function(s){i1.indexOf(s)===-1&&(r[s]&&Object.keys(r[s]).length?a+="@".concat(s,"(").concat(Li(r[s]),")"):a+="@".concat(s))}),a},{setStringify:function(t){var e=Li;return Li=t,e}}),Li=function(e){return JSON.stringify(e,a1)};function a1(t,e){return ee(e)&&!Array.isArray(e)&&(e=Object.keys(e).sort().reduce(function(r,n){return r[n]=e[n],r},{})),e}function tr(t,e){if(t.arguments&&t.arguments.length){var r={};return t.arguments.forEach(function(n){var i=n.name,a=n.value;return vr(r,i,a,e)}),r}return null}function _t(t){return t.alias?t.alias.value:t.name.value}function Fi(t,e,r){if(typeof t.__typename=="string")return t.__typename;for(var n=0,i=e.selections;n<i.length;n++){var a=i[n];if(pt(a)){if(a.name.value==="__typename")return t[_t(a)]}else{var o=Fi(t,Xr(a,r).selectionSet,r);if(typeof o=="string")return o}}}function pt(t){return t.kind==="Field"}function gc(t){return t.kind==="InlineFragment"}function Vn(t){__DEV__?I(t&&t.kind==="Document",'Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a "gql" tag? http://docs.apollostack.com/apollo-client/core.html#gql'):I(t&&t.kind==="Document",47);var e=t.definitions.filter(function(r){return r.kind!=="FragmentDefinition"}).map(function(r){if(r.kind!=="OperationDefinition")throw __DEV__?new V('Schema type definitions not allowed in queries. Found: "'.concat(r.kind,'"')):new V(48);return r});return __DEV__?I(e.length<=1,"Ambiguous GraphQL document: contains ".concat(e.length," operations")):I(e.length<=1,49),t}function qt(t){return Vn(t),t.definitions.filter(function(e){return e.kind==="OperationDefinition"})[0]}function zn(t){return t.definitions.filter(function(e){return e.kind==="OperationDefinition"&&!!e.name}).map(function(e){return e.name.value})[0]||null}function en(t){return t.definitions.filter(function(e){return e.kind==="FragmentDefinition"})}function Mi(t){var e=qt(t);return __DEV__?I(e&&e.operation==="query","Must contain a query definition."):I(e&&e.operation==="query",50),e}function yc(t){__DEV__?I(t.kind==="Document",'Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a "gql" tag? http://docs.apollostack.com/apollo-client/core.html#gql'):I(t.kind==="Document",51),__DEV__?I(t.definitions.length<=1,"Fragment must have exactly one definition."):I(t.definitions.length<=1,52);var e=t.definitions[0];return __DEV__?I(e.kind==="FragmentDefinition","Must be a fragment definition."):I(e.kind==="FragmentDefinition",53),e}function tn(t){Vn(t);for(var e,r=0,n=t.definitions;r<n.length;r++){var i=n[r];if(i.kind==="OperationDefinition"){var a=i.operation;if(a==="query"||a==="mutation"||a==="subscription")return i}i.kind==="FragmentDefinition"&&!e&&(e=i)}if(e)return e;throw __DEV__?new V("Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment."):new V(54)}function rn(t){var e=Object.create(null),r=t&&t.variableDefinitions;return r&&r.length&&r.forEach(function(n){n.defaultValue&&vr(e,n.variable.name,n.defaultValue)}),e}var ue=Array.isArray;function Re(t){return Array.isArray(t)&&t.length>0}var gf={kind:Oe.FIELD,name:{kind:Oe.NAME,value:"__typename"}};function vf(t,e){return!t||t.selectionSet.selections.every(function(r){return r.kind===Oe.FRAGMENT_SPREAD&&vf(e[r.name.value],e)})}function o1(t){return vf(qt(t)||yc(t),Jr(en(t)))?null:t}function s1(t){var e=new Set,r=[];return t.forEach(function(n){n.name?e.add(n.name):n.test&&r.push(n.test)}),function(n){return e.has(n.name.value)||r.some(function(i){return i(n)})}}function yf(t){var e=new Map;return function(n){n===void 0&&(n=t);var i=e.get(n);return i||e.set(n,i={variables:new Set,fragmentSpreads:new Set}),i}}function vc(t,e){for(var r=yf(""),n=yf(""),i=function(b){for(var v=0,m=void 0;v<b.length&&(m=b[v]);++v)if(!ue(m)){if(m.kind===Oe.OPERATION_DEFINITION)return r(m.name&&m.name.value);if(m.kind===Oe.FRAGMENT_DEFINITION)return n(m.name.value)}return __DEV__&&I.error("Could not find operation or fragment"),null},a=0,o=e.definitions.length-1;o>=0;--o)e.definitions[o].kind===Oe.OPERATION_DEFINITION&&++a;var s=s1(t),u=t.some(function(b){return b.remove}),c=function(b){return u&&b&&b.some(s)},l=new Map,d=!1,p={enter:function(b){if(c(b.directives))return d=!0,null}},f=Ke(e,{Field:p,InlineFragment:p,VariableDefinition:{enter:function(){return!1}},Variable:{enter:function(b,v,m,A,D){var E=i(D);E&&E.variables.add(b.name.value)}},FragmentSpread:{enter:function(b,v,m,A,D){if(c(b.directives))return d=!0,null;var E=i(D);E&&E.fragmentSpreads.add(b.name.value)}},FragmentDefinition:{enter:function(b,v,m,A){l.set(JSON.stringify(A),b)},leave:function(b,v,m,A){var D=l.get(JSON.stringify(A));if(b===D)return b;if(a>0&&b.selectionSet.selections.every(function(E){return E.kind===Oe.FIELD&&E.name.value==="__typename"}))return n(b.name.value).removed=!0,d=!0,null}},Directive:{leave:function(b){if(s(b))return d=!0,null}}});if(!d)return e;var h=function(b){return b.transitiveVars||(b.transitiveVars=new Set(b.variables),b.removed||b.fragmentSpreads.forEach(function(v){h(n(v)).transitiveVars.forEach(function(m){b.transitiveVars.add(m)})})),b},g=new Set;f.definitions.forEach(function(b){b.kind===Oe.OPERATION_DEFINITION?h(r(b.name&&b.name.value)).fragmentSpreads.forEach(function(v){g.add(v)}):b.kind===Oe.FRAGMENT_DEFINITION&&a===0&&!n(b.name.value).removed&&g.add(b.name.value)}),g.forEach(function(b){h(n(b)).fragmentSpreads.forEach(function(v){g.add(v)})});var y=function(b){return!!(!g.has(b)||n(b).removed)},S={enter:function(b){if(y(b.name.value))return null}};return o1(Ke(f,{FragmentSpread:S,FragmentDefinition:S,OperationDefinition:{leave:function(b){if(b.variableDefinitions){var v=h(r(b.name&&b.name.value)).transitiveVars;if(v.size<b.variableDefinitions.length)return _(_({},b),{variableDefinitions:b.variableDefinitions.filter(function(m){return v.has(m.variable.name.value)})})}}}}))}var nn=Object.assign(function(t){return Ke(t,{SelectionSet:{enter:function(e,r,n){if(!(n&&n.kind===Oe.OPERATION_DEFINITION)){var i=e.selections;if(!!i){var a=i.some(function(s){return pt(s)&&(s.name.value==="__typename"||s.name.value.lastIndexOf("__",0)===0)});if(!a){var o=n;if(!(pt(o)&&o.directives&&o.directives.some(function(s){return s.name.value==="export"})))return _(_({},e),{selections:gr(gr([],i,!0),[gf],!1)})}}}}}})},{added:function(t){return t===gf}}),c1={test:function(t){var e=t.name.value==="connection";return e&&(!t.arguments||!t.arguments.some(function(r){return r.name.value==="key"}))&&__DEV__&&I.warn("Removing an @connection directive even though it does not have a key. You may want to use the key parameter to specify a store key."),e}};function bc(t){return vc([c1],Vn(t))}function _c(t){var e=tn(t),r=e.operation;if(r==="query")return t;var n=Ke(t,{OperationDefinition:{enter:function(i){return _(_({},i),{operation:"query"})}}});return n}function wc(t){Vn(t);var e=vc([{test:function(r){return r.name.value==="client"},remove:!0}],t);return e}var u1=Object.prototype.hasOwnProperty;function Sc(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Ui(t)}function Ui(t){var e=t[0]||{},r=t.length;if(r>1)for(var n=new it,i=1;i<r;++i)e=n.merge(e,t[i]);return e}var l1=function(t,e,r){return this.merge(t[r],e[r])},it=function(){function t(e){e===void 0&&(e=l1),this.reconciler=e,this.isObject=ee,this.pastCopies=new Set}return t.prototype.merge=function(e,r){for(var n=this,i=[],a=2;a<arguments.length;a++)i[a-2]=arguments[a];return ee(r)&&ee(e)?(Object.keys(r).forEach(function(o){if(u1.call(e,o)){var s=e[o];if(r[o]!==s){var u=n.reconciler.apply(n,gr([e,r,o],i,!1));u!==s&&(e=n.shallowCopyForMerge(e),e[o]=u)}}else e=n.shallowCopyForMerge(e),e[o]=r[o]}),e):r},t.prototype.shallowCopyForMerge=function(e){return ee(e)&&(this.pastCopies.has(e)||(Array.isArray(e)?e=e.slice(0):e=_({__proto__:Object.getPrototypeOf(e)},e),this.pastCopies.add(e))),e},t}();function f1(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r)return(r=r.call(t)).next.bind(r);if(Array.isArray(t)||(r=p1(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0;return function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
26
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function p1(t,e){if(!!t){if(typeof t=="string")return bf(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return bf(t,e)}}function bf(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function _f(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function kc(t,e,r){return e&&_f(t.prototype,e),r&&_f(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}var Tc=function(){return typeof Symbol=="function"},Ac=function(t){return Tc()&&Boolean(Symbol[t])},Ic=function(t){return Ac(t)?Symbol[t]:"@@"+t};Tc()&&!Ac("observable")&&(Symbol.observable=Symbol("observable"));var d1=Ic("iterator"),Ec=Ic("observable"),wf=Ic("species");function io(t,e){var r=t[e];if(r!=null){if(typeof r!="function")throw new TypeError(r+" is not a function");return r}}function ji(t){var e=t.constructor;return e!==void 0&&(e=e[wf],e===null&&(e=void 0)),e!==void 0?e:W}function h1(t){return t instanceof W}function Qn(t){Qn.log?Qn.log(t):setTimeout(function(){throw t})}function no(t){Promise.resolve().then(function(){try{t()}catch(e){Qn(e)}})}function Sf(t){var e=t._cleanup;if(e!==void 0&&(t._cleanup=void 0,!!e))try{if(typeof e=="function")e();else{var r=io(e,"unsubscribe");r&&r.call(e)}}catch(n){Qn(n)}}function xc(t){t._observer=void 0,t._queue=void 0,t._state="closed"}function m1(t){var e=t._queue;if(!!e){t._queue=void 0,t._state="ready";for(var r=0;r<e.length&&(Cf(t,e[r].type,e[r].value),t._state!=="closed");++r);}}function Cf(t,e,r){t._state="running";var n=t._observer;try{var i=io(n,e);switch(e){case"next":i&&i.call(n,r);break;case"error":if(xc(t),i)i.call(n,r);else throw r;break;case"complete":xc(t),i&&i.call(n);break}}catch(a){Qn(a)}t._state==="closed"?Sf(t):t._state==="running"&&(t._state="ready")}function Cc(t,e,r){if(t._state!=="closed"){if(t._state==="buffering"){t._queue.push({type:e,value:r});return}if(t._state!=="ready"){t._state="buffering",t._queue=[{type:e,value:r}],no(function(){return m1(t)});return}Cf(t,e,r)}}var g1=function(){function t(r,n){this._cleanup=void 0,this._observer=r,this._queue=void 0,this._state="initializing";var i=new y1(this);try{this._cleanup=n.call(void 0,i)}catch(a){i.error(a)}this._state==="initializing"&&(this._state="ready")}var e=t.prototype;return e.unsubscribe=function(){this._state!=="closed"&&(xc(this),Sf(this))},kc(t,[{key:"closed",get:function(){return this._state==="closed"}}]),t}(),y1=function(){function t(r){this._subscription=r}var e=t.prototype;return e.next=function(n){Cc(this._subscription,"next",n)},e.error=function(n){Cc(this._subscription,"error",n)},e.complete=function(){Cc(this._subscription,"complete")},kc(t,[{key:"closed",get:function(){return this._subscription._state==="closed"}}]),t}(),W=function(){function t(r){if(!(this instanceof t))throw new TypeError("Observable cannot be called as a function");if(typeof r!="function")throw new TypeError("Observable initializer must be a function");this._subscriber=r}var e=t.prototype;return e.subscribe=function(n){return(typeof n!="object"||n===null)&&(n={next:n,error:arguments[1],complete:arguments[2]}),new g1(n,this._subscriber)},e.forEach=function(n){var i=this;return new Promise(function(a,o){if(typeof n!="function"){o(new TypeError(n+" is not a function"));return}function s(){u.unsubscribe(),a()}var u=i.subscribe({next:function(c){try{n(c,s)}catch(l){o(l),u.unsubscribe()}},error:o,complete:a})})},e.map=function(n){var i=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var a=ji(this);return new a(function(o){return i.subscribe({next:function(s){try{s=n(s)}catch(u){return o.error(u)}o.next(s)},error:function(s){o.error(s)},complete:function(){o.complete()}})})},e.filter=function(n){var i=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var a=ji(this);return new a(function(o){return i.subscribe({next:function(s){try{if(!n(s))return}catch(u){return o.error(u)}o.next(s)},error:function(s){o.error(s)},complete:function(){o.complete()}})})},e.reduce=function(n){var i=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var a=ji(this),o=arguments.length>1,s=!1,u=arguments[1],c=u;return new a(function(l){return i.subscribe({next:function(d){var p=!s;if(s=!0,!p||o)try{c=n(c,d)}catch(f){return l.error(f)}else c=d},error:function(d){l.error(d)},complete:function(){if(!s&&!o)return l.error(new TypeError("Cannot reduce an empty sequence"));l.next(c),l.complete()}})})},e.concat=function(){for(var n=this,i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];var s=ji(this);return new s(function(u){var c,l=0;function d(p){c=p.subscribe({next:function(f){u.next(f)},error:function(f){u.error(f)},complete:function(){l===a.length?(c=void 0,u.complete()):d(s.from(a[l++]))}})}return d(n),function(){c&&(c.unsubscribe(),c=void 0)}})},e.flatMap=function(n){var i=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var a=ji(this);return new a(function(o){var s=[],u=i.subscribe({next:function(l){if(n)try{l=n(l)}catch(p){return o.error(p)}var d=a.from(l).subscribe({next:function(p){o.next(p)},error:function(p){o.error(p)},complete:function(){var p=s.indexOf(d);p>=0&&s.splice(p,1),c()}});s.push(d)},error:function(l){o.error(l)},complete:function(){c()}});function c(){u.closed&&s.length===0&&o.complete()}return function(){s.forEach(function(l){return l.unsubscribe()}),u.unsubscribe()}})},e[Ec]=function(){return this},t.from=function(n){var i=typeof this=="function"?this:t;if(n==null)throw new TypeError(n+" is not an object");var a=io(n,Ec);if(a){var o=a.call(n);if(Object(o)!==o)throw new TypeError(o+" is not an object");return h1(o)&&o.constructor===i?o:new i(function(s){return o.subscribe(s)})}if(Ac("iterator")&&(a=io(n,d1),a))return new i(function(s){no(function(){if(!s.closed){for(var u=f1(a.call(n)),c;!(c=u()).done;){var l=c.value;if(s.next(l),s.closed)return}s.complete()}})});if(Array.isArray(n))return new i(function(s){no(function(){if(!s.closed){for(var u=0;u<n.length;++u)if(s.next(n[u]),s.closed)return;s.complete()}})});throw new TypeError(n+" is not observable")},t.of=function(){for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];var o=typeof this=="function"?this:t;return new o(function(s){no(function(){if(!s.closed){for(var u=0;u<i.length;++u)if(s.next(i[u]),s.closed)return;s.complete()}})})},kc(t,null,[{key:wf,get:function(){return this}}]),t}();Tc()&&Object.defineProperty(W,Symbol("extensions"),{value:{symbol:Ec,hostReportError:Qn},configurable:!0});function Oc(t){var e,r=t.Symbol;if(typeof r=="function")if(r.observable)e=r.observable;else{typeof r.for=="function"?e=r.for("https://github.com/benlesh/symbol-observable"):e=r("https://github.com/benlesh/symbol-observable");try{r.observable=e}catch{}}else e="@@observable";return e}var Gn;typeof self<"u"?Gn=self:typeof window<"u"?Gn=window:typeof global<"u"?Gn=global:typeof module<"u"?Gn=module:Gn=Function("return this")();var b_=Oc(Gn);var Ef=W.prototype,xf="@@observable";Ef[xf]||(Ef[xf]=function(){return this});var v1=Object.prototype.toString;function ao(t){return Dc(t)}function Dc(t,e){switch(v1.call(t)){case"[object Array]":{if(e=e||new Map,e.has(t))return e.get(t);var r=t.slice(0);return e.set(t,r),r.forEach(function(i,a){r[a]=Dc(i,e)}),r}case"[object Object]":{if(e=e||new Map,e.has(t))return e.get(t);var n=Object.create(Object.getPrototypeOf(t));return e.set(t,n),Object.keys(t).forEach(function(i){n[i]=Dc(t[i],e)}),n}default:return t}}function b1(t){var e=new Set([t]);return e.forEach(function(r){ee(r)&&_1(r)===r&&Object.getOwnPropertyNames(r).forEach(function(n){ee(r[n])&&e.add(r[n])})}),t}function _1(t){if(__DEV__&&!Object.isFrozen(t))try{Object.freeze(t)}catch(e){if(e instanceof TypeError)return null;throw e}return t}function qi(t){return __DEV__&&b1(t),t}function an(t,e,r){var n=[];t.forEach(function(i){return i[e]&&n.push(i)}),n.forEach(function(i){return i[e](r)})}function oo(t,e,r){return new W(function(n){var i=n.next,a=n.error,o=n.complete,s=0,u=!1,c={then:function(f){return new Promise(function(h){return h(f())})}};function l(f,h){return f?function(g){++s;var y=function(){return f(g)};c=c.then(y,y).then(function(S){--s,i&&i.call(n,S),u&&d.complete()},function(S){throw--s,S}).catch(function(S){a&&a.call(n,S)})}:function(g){return h&&h.call(n,g)}}var d={next:l(e,i),error:l(r,a),complete:function(){u=!0,s||o&&o.call(n)}},p=t.subscribe(d);return function(){return p.unsubscribe()}})}var wt=typeof WeakMap=="function"&&Ue(function(){return navigator.product})!=="ReactNative",kf=typeof WeakSet=="function",Nc=typeof Symbol=="function"&&typeof Symbol.for=="function",br=Nc&&Symbol.asyncIterator,N_=typeof Ue(function(){return window.document.createElement})=="function",R_=Ue(function(){return navigator.userAgent.indexOf("jsdom")>=0})||!1;function so(t){function e(r){Object.defineProperty(t,r,{value:W})}return Nc&&Symbol.species&&e(Symbol.species),e("@@species"),t}function Tf(t){return t&&typeof t.then=="function"}var Hn=function(t){xe(e,t);function e(r){var n=t.call(this,function(i){return n.addObserver(i),function(){return n.removeObserver(i)}})||this;return n.observers=new Set,n.promise=new Promise(function(i,a){n.resolve=i,n.reject=a}),n.handlers={next:function(i){n.sub!==null&&(n.latest=["next",i],n.notify("next",i),an(n.observers,"next",i))},error:function(i){var a=n.sub;a!==null&&(a&&setTimeout(function(){return a.unsubscribe()}),n.sub=null,n.latest=["error",i],n.reject(i),n.notify("error",i),an(n.observers,"error",i))},complete:function(){var i=n,a=i.sub,o=i.sources,s=o===void 0?[]:o;if(a!==null){var u=s.shift();u?Tf(u)?u.then(function(c){return n.sub=c.subscribe(n.handlers)}):n.sub=u.subscribe(n.handlers):(a&&setTimeout(function(){return a.unsubscribe()}),n.sub=null,n.latest&&n.latest[0]==="next"?n.resolve(n.latest[1]):n.resolve(),n.notify("complete"),an(n.observers,"complete"))}}},n.nextResultListeners=new Set,n.cancel=function(i){n.reject(i),n.sources=[],n.handlers.complete()},n.promise.catch(function(i){}),typeof r=="function"&&(r=[new W(r)]),Tf(r)?r.then(function(i){return n.start(i)},n.handlers.error):n.start(r),n}return e.prototype.start=function(r){this.sub===void 0&&(this.sources=Array.from(r),this.handlers.complete())},e.prototype.deliverLastMessage=function(r){if(this.latest){var n=this.latest[0],i=r[n];i&&i.call(r,this.latest[1]),this.sub===null&&n==="next"&&r.complete&&r.complete()}},e.prototype.addObserver=function(r){this.observers.has(r)||(this.deliverLastMessage(r),this.observers.add(r))},e.prototype.removeObserver=function(r){this.observers.delete(r)&&this.observers.size<1&&this.handlers.complete()},e.prototype.notify=function(r,n){var i=this.nextResultListeners;i.size&&(this.nextResultListeners=new Set,i.forEach(function(a){return a(r,n)}))},e.prototype.beforeNext=function(r){var n=!1;this.nextResultListeners.add(function(i,a){n||(n=!0,r(i,a))})},e}(W);so(Hn);function _r(t){return"incremental"in t}function w1(t){return"hasNext"in t&&"data"in t}function Af(t){return _r(t)||w1(t)}function co(t,e){var r=t,n=new it;return _r(e)&&Re(e.incremental)&&e.incremental.forEach(function(i){for(var a=i.data,o=i.path,s=o.length-1;s>=0;--s){var u=o[s],c=!isNaN(+u),l=c?[]:{};l[u]=a,a=l}r=n.merge(r,a)}),r}function Wn(t){var e=uo(t);return Re(e)}function uo(t){var e=Re(t.errors)?t.errors.slice(0):[];return _r(t)&&Re(t.incremental)&&t.incremental.forEach(function(r){r.errors&&e.push.apply(e,r.errors)}),e}function wr(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=Object.create(null);return t.forEach(function(n){!n||Object.keys(n).forEach(function(i){var a=n[i];a!==void 0&&(r[i]=a)})}),r}var If=new Map;function Bi(t){var e=If.get(t)||1;return If.set(t,e+1),"".concat(t,":").concat(e,":").concat(Math.random().toString(36).slice(2))}function Of(t){var e=Bi("stringifyForDisplay");return JSON.stringify(t,function(r,n){return n===void 0?e:n}).split(JSON.stringify(e)).join("<undefined>")}function Vi(t,e){return wr(t,e,e.variables&&{variables:_(_({},t&&t.variables),e.variables)})}function lo(t){return new W(function(e){e.error(t)})}var zi=function(t,e,r){var n=new Error(r);throw n.name="ServerError",n.response=t,n.statusCode=t.status,n.result=e,n};function Rc(t){for(var e=["query","operationName","variables","extensions","context"],r=0,n=Object.keys(t);r<n.length;r++){var i=n[r];if(e.indexOf(i)<0)throw __DEV__?new V("illegal argument: ".concat(i)):new V(27)}return t}function Pc(t,e){var r=_({},t),n=function(a){typeof a=="function"?r=_(_({},r),a(r)):r=_(_({},r),a)},i=function(){return _({},r)};return Object.defineProperty(e,"setContext",{enumerable:!1,value:n}),Object.defineProperty(e,"getContext",{enumerable:!1,value:i}),e}function Lc(t){var e={variables:t.variables||{},extensions:t.extensions||{},operationName:t.operationName,query:t.query};return e.operationName||(e.operationName=typeof e.query!="string"?zn(e.query)||void 0:""),e}function Df(t,e){return e?e(t):W.of()}function Qi(t){return typeof t=="function"?new St(t):t}function fo(t){return t.request.length<=1}var S1=function(t){xe(e,t);function e(r,n){var i=t.call(this,r)||this;return i.link=n,i}return e}(Error),St=function(){function t(e){e&&(this.request=e)}return t.empty=function(){return new t(function(){return W.of()})},t.from=function(e){return e.length===0?t.empty():e.map(Qi).reduce(function(r,n){return r.concat(n)})},t.split=function(e,r,n){var i=Qi(r),a=Qi(n||new t(Df));return fo(i)&&fo(a)?new t(function(o){return e(o)?i.request(o)||W.of():a.request(o)||W.of()}):new t(function(o,s){return e(o)?i.request(o,s)||W.of():a.request(o,s)||W.of()})},t.execute=function(e,r){return e.request(Pc(r.context,Lc(Rc(r))))||W.of()},t.concat=function(e,r){var n=Qi(e);if(fo(n))return __DEV__&&I.warn(new S1("You are calling concat on a terminating link, which will have no effect",n)),n;var i=Qi(r);return fo(i)?new t(function(a){return n.request(a,function(o){return i.request(o)||W.of()})||W.of()}):new t(function(a,o){return n.request(a,function(s){return i.request(s,o)||W.of()})||W.of()})},t.prototype.split=function(e,r,n){return this.concat(t.split(e,r,n||new t(Df)))},t.prototype.concat=function(e){return t.concat(this,e)},t.prototype.request=function(e,r){throw __DEV__?new V("request is not implemented"):new V(22)},t.prototype.onError=function(e,r){if(r&&r.error)return r.error(e),!1;throw e},t.prototype.setOnError=function(e){return this.onError=e,this},t}();var Kn=St.execute;var Nf="3.7.10";function Rf(t){return!!t.body}function Pf(t){return!!t.getReader}function Lf(t){return!!(br&&t[Symbol.asyncIterator])}function $f(t){return!!t.stream}function Ff(t){return!!t.arrayBuffer}function Mf(t){return!!t.pipe}function $c(t){var e,r=t[Symbol.asyncIterator]();return e={next:function(){return r.next()}},e[Symbol.asyncIterator]=function(){return this},e}function Fc(t){var e=null,r=null,n=!1,i=[],a=[];function o(d){if(!r){if(a.length){var p=a.shift();if(Array.isArray(p)&&p[0])return p[0]({value:d,done:!1})}i.push(d)}}function s(d){r=d;var p=a.slice();p.forEach(function(f){f[1](d)}),!e||e()}function u(){n=!0;var d=a.slice();d.forEach(function(p){p[0]({value:void 0,done:!0})}),!e||e()}e=function(){e=null,t.removeListener("data",o),t.removeListener("error",s),t.removeListener("end",u),t.removeListener("finish",u),t.removeListener("close",u)},t.on("data",o),t.on("error",s),t.on("end",u),t.on("finish",u),t.on("close",u);function c(){return new Promise(function(d,p){if(r)return p(r);if(i.length)return d({value:i.shift(),done:!1});if(n)return d({value:void 0,done:!0});a.push([d,p])})}var l={next:function(){return c()}};return br&&(l[Symbol.asyncIterator]=function(){return this}),l}function Mc(t){var e=!1,r={next:function(){return e?Promise.resolve({value:void 0,done:!0}):(e=!0,new Promise(function(n,i){t.then(function(a){n({value:a,done:!1})}).catch(i)}))}};return br&&(r[Symbol.asyncIterator]=function(){return this}),r}function po(t){var e={next:function(){return t.read()}};return br&&(e[Symbol.asyncIterator]=function(){return this}),e}function Uf(t){var e=t;if(Rf(t)&&(e=t.body),Lf(e))return $c(e);if(Pf(e))return po(e.getReader());if($f(e))return po(e.stream().getReader());if(Ff(e))return Mc(e.arrayBuffer());if(Mf(e))return Fc(e);throw new Error("Unknown body type for responseIterator. Please pass a streamable response.")}var jf=Object.prototype.hasOwnProperty;function qf(t,e){var r,n,i;return Tt(this,void 0,void 0,function(){var a,o,s,u,c,l,d,p,f,h,g,y,S,b,v,m,A,D,E,O;return At(this,function(P){switch(P.label){case 0:if(TextDecoder===void 0)throw new Error("TextDecoder must be defined in the environment: please import a polyfill.");a=new TextDecoder("utf-8"),o=(r=t.headers)===null||r===void 0?void 0:r.get("content-type"),s="boundary=",u=o?.includes(s)?o?.substring(o?.indexOf(s)+s.length).replace(/['"]/g,"").replace(/\;(.*)/gm,"").trim():"-",c="--".concat(u),l="",d=Uf(t),p=!0,P.label=1;case 1:return p?[4,d.next()]:[3,3];case 2:for(f=P.sent(),h=f.value,g=f.done,y=typeof h=="string"?h:a.decode(h),p=!g,l+=y,S=l.indexOf(c);S>-1;){if(b=void 0,O=[l.slice(0,S),l.slice(S+c.length)],b=O[0],l=O[1],b.trim()){if(v=b.indexOf(`\r
|
|
27
27
|
\r
|
|
28
|
-
`),m=
|
|
29
|
-
`,"")),(Object.keys(E).length>1||"data"in E||"incremental"in E||"errors"in E)&&((n=e.next)===null||n===void 0||n.call(e,E))}catch(N){
|
|
30
|
-
`).forEach(function(r){var n=r.indexOf(":");if(n>-1){var i=r.slice(0,n).trim().toLowerCase(),a=r.slice(n+1).trim();e[i]=a}}),e}function
|
|
28
|
+
`),m=C1(b.slice(0,v)),A=m["content-type"],A&&A.toLowerCase().indexOf("application/json")===-1)throw new Error("Unsupported patch content type: application/json is required.");D=b.slice(v);try{E=Bf(t,D.replace(`\r
|
|
29
|
+
`,"")),(Object.keys(E).length>1||"data"in E||"incremental"in E||"errors"in E)&&((n=e.next)===null||n===void 0||n.call(e,E))}catch(N){ho(N,e)}}S=l.indexOf(c)}return[3,1];case 3:return(i=e.complete)===null||i===void 0||i.call(e),[2]}})})}function C1(t){var e={};return t.split(`
|
|
30
|
+
`).forEach(function(r){var n=r.indexOf(":");if(n>-1){var i=r.slice(0,n).trim().toLowerCase(),a=r.slice(n+1).trim();e[i]=a}}),e}function Bf(t,e){if(t.status>=300){var r=function(){try{return JSON.parse(e)}catch{return e}};zi(t,r(),"Response not successful: Received status code ".concat(t.status))}try{return JSON.parse(e)}catch(i){var n=i;throw n.name="ServerParseError",n.response=t,n.statusCode=t.status,n.bodyText=e,n}}function ho(t,e){var r,n;t.name!=="AbortError"&&(t.result&&t.result.errors&&t.result.data&&((r=e.next)===null||r===void 0||r.call(e,t.result)),(n=e.error)===null||n===void 0||n.call(e,t))}function Vf(t,e,r){E1(e)(t).then(function(n){var i,a;(i=r.next)===null||i===void 0||i.call(r,n),(a=r.complete)===null||a===void 0||a.call(r)}).catch(function(n){return ho(n,r)})}function E1(t){return function(e){return e.text().then(function(r){return Bf(e,r)}).then(function(r){return e.status>=300&&zi(e,r,"Response not successful: Received status code ".concat(e.status)),!Array.isArray(r)&&!jf.call(r,"data")&&!jf.call(r,"errors")&&zi(e,r,"Server response was missing for query '".concat(Array.isArray(t)?t.map(function(n){return n.operationName}):t.operationName,"'.")),r})}}var Gi=function(t,e){var r;try{r=JSON.stringify(t)}catch(i){var n=__DEV__?new V("Network request failed. ".concat(e," is not serializable: ").concat(i.message)):new V(24);throw n.parseError=i,n}return r};var x1={includeQuery:!0,includeExtensions:!1,preserveHeaderCase:!1},k1={accept:"*/*","content-type":"application/json"},T1={method:"POST"},zf={http:x1,headers:k1,options:T1},Qf=function(t,e){return e(t)};function Gf(t,e){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var i={},a={};r.forEach(function(d){i=_(_(_({},i),d.options),{headers:_(_({},i.headers),d.headers)}),d.credentials&&(i.credentials=d.credentials),a=_(_({},a),d.http)}),i.headers&&(i.headers=A1(i.headers,a.preserveHeaderCase));var o=t.operationName,s=t.extensions,u=t.variables,c=t.query,l={operationName:o,variables:u};return a.includeExtensions&&(l.extensions=s),a.includeQuery&&(l.query=e(c,qn)),{options:i,body:l}}function A1(t,e){if(!e){var r=Object.create(null);return Object.keys(Object(t)).forEach(function(a){r[a.toLowerCase()]=t[a]}),r}var n=Object.create(null);Object.keys(Object(t)).forEach(function(a){n[a.toLowerCase()]={originalName:a,value:t[a]}});var i=Object.create(null);return Object.keys(n).forEach(function(a){i[n[a].originalName]=n[a].value}),i}var Hf=function(t){if(!t&&typeof fetch>"u")throw __DEV__?new V(`
|
|
31
31
|
"fetch" has not been found globally and no fetcher has been configured. To fix this, install a fetch package (like https://www.npmjs.com/package/cross-fetch), instantiate the fetcher, and pass it into your HttpLink constructor. For example:
|
|
32
32
|
|
|
33
33
|
import fetch from 'cross-fetch';
|
|
@@ -35,7 +35,7 @@ import { ApolloClient, HttpLink } from '@apollo/client';
|
|
|
35
35
|
const client = new ApolloClient({
|
|
36
36
|
link: new HttpLink({ uri: '/graphql', fetch })
|
|
37
37
|
});
|
|
38
|
-
`):new V(23)};var Hf=function(){if(typeof AbortController>"u")return{controller:!1,signal:!1};var t=new AbortController,e=t.signal;return{controller:t,signal:e}};var Wf=function(t,e){var r=t.getContext(),n=r.uri;return n||(typeof e=="function"?e(t):e||"/graphql")};function Kf(t,e){var r=[],n=function(d,p){r.push("".concat(d,"=").concat(encodeURIComponent(p)))};if("query"in e&&n("query",e.query),e.operationName&&n("operationName",e.operationName),e.variables){var i=void 0;try{i=Qi(e.variables,"Variables map")}catch(d){return{parseError:d}}n("variables",i)}if(e.extensions){var a=void 0;try{a=Qi(e.extensions,"Extensions map")}catch(d){return{parseError:d}}n("extensions",a)}var o="",s=t,u=t.indexOf("#");u!==-1&&(o=t.substr(u),s=t.substr(0,u));var c=s.indexOf("?")===-1?"?":"&",l=s+c+r.join("&")+o;return{newURI:l}}var Zf=Ue(function(){return fetch}),Yf=function(t){t===void 0&&(t={});var e=t.uri,r=e===void 0?"/graphql":e,n=t.fetch,i=t.print,a=i===void 0?zf:i,o=t.includeExtensions,s=t.preserveHeaderCase,u=t.useGETForQueries,c=t.includeUnusedVariables,l=c===void 0?!1:c,d=Ut(t,["uri","fetch","print","includeExtensions","preserveHeaderCase","useGETForQueries","includeUnusedVariables"]);__DEV__&&Gf(n||Zf);var p={http:{includeExtensions:o,preserveHeaderCase:s},options:d.fetchOptions,credentials:d.credentials,headers:d.headers};return new St(function(f){var h=Wf(f,r),g=f.getContext(),y={};if(g.clientAwareness){var S=g.clientAwareness,b=S.name,v=S.version;b&&(y["apollographql-client-name"]=b),v&&(y["apollographql-client-version"]=v)}var m=_(_({},y),g.headers),A={http:g.http,options:g.fetchOptions,credentials:g.credentials,headers:m},D=Qf(f,a,Vf,p,A),E=D.options,O=D.body;if(O.variables&&!l){var P=new Set(Object.keys(O.variables));Ke(f.query,{Variable:function(X,Ft,H){H&&H.kind!=="VariableDefinition"&&P.delete(X.name.value)}}),P.size&&(O.variables=_({},O.variables),P.forEach(function(X){delete O.variables[X]}))}var N;if(!E.signal){var j=Hf(),qe=j.controller,Ne=j.signal;N=qe,N&&(E.signal=Ne)}var q=function(X){return X.kind==="OperationDefinition"&&X.operation==="mutation"};if(u&&!f.query.definitions.some(q)&&(E.method="GET"),qn(["defer"],f.query)&&(E.headers=E.headers||{},E.headers.accept="multipart/mixed; deferSpec=20220824, application/json"),E.method==="GET"){var de=Kf(h,O),he=de.newURI,J=de.parseError;if(J)return uo(J);h=he}else try{E.body=Qi(O,"Payload")}catch(X){return uo(X)}return new W(function(X){var Ft=n||Ue(function(){return fetch})||Zf;return Ft(h,E).then(function(H){var Mt;f.setContext({response:H});var fr=(Mt=H.headers)===null||Mt===void 0?void 0:Mt.get("content-type");return fr!==null&&/^multipart\/mixed/i.test(fr)?jf(H,X):Bf(H,f,X)}).catch(function(H){return po(H,X)}),function(){N&&N.abort()}})})};var Fc=function(t){xe(e,t);function e(r){r===void 0&&(r={});var n=t.call(this,Yf(r).request)||this;return n.options=r,n}return e}(St);var{toString:Jf,hasOwnProperty:A1}=Object.prototype,Xf=Function.prototype.toString,Mc=new Map;function be(t,e){try{return Uc(t,e)}finally{Mc.clear()}}function Uc(t,e){if(t===e)return!0;let r=Jf.call(t),n=Jf.call(e);if(r!==n)return!1;switch(r){case"[object Array]":if(t.length!==e.length)return!1;case"[object Object]":{if(tp(t,e))return!0;let i=ep(t),a=ep(e),o=i.length;if(o!==a.length)return!1;for(let s=0;s<o;++s)if(!A1.call(e,i[s]))return!1;for(let s=0;s<o;++s){let u=i[s];if(!Uc(t[u],e[u]))return!1}return!0}case"[object Error]":return t.name===e.name&&t.message===e.message;case"[object Number]":if(t!==t)return e!==e;case"[object Boolean]":case"[object Date]":return+t==+e;case"[object RegExp]":case"[object String]":return t==`${e}`;case"[object Map]":case"[object Set]":{if(t.size!==e.size)return!1;if(tp(t,e))return!0;let i=t.entries(),a=r==="[object Map]";for(;;){let o=i.next();if(o.done)break;let[s,u]=o.value;if(!e.has(s)||a&&!Uc(u,e.get(s)))return!1}return!0}case"[object Uint16Array]":case"[object Uint8Array]":case"[object Uint32Array]":case"[object Int32Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object ArrayBuffer]":t=new Uint8Array(t),e=new Uint8Array(e);case"[object DataView]":{let i=t.byteLength;if(i===e.byteLength)for(;i--&&t[i]===e[i];);return i===-1}case"[object AsyncFunction]":case"[object GeneratorFunction]":case"[object AsyncGeneratorFunction]":case"[object Function]":{let i=Xf.call(t);return i!==Xf.call(e)?!1:!D1(i,O1)}}return!1}function ep(t){return Object.keys(t).filter(I1,t)}function I1(t){return this[t]!==void 0}var O1="{ [native code] }";function D1(t,e){let r=t.length-e.length;return r>=0&&t.indexOf(e,r)===r}function tp(t,e){let r=Mc.get(t);if(r){if(r.has(e))return!0}else Mc.set(t,r=new Set);return r.add(e),!1}var N1=function(){return Object.create(null)},rp=Array.prototype,R1=rp.forEach,P1=rp.slice,Bt=function(){function t(e,r){e===void 0&&(e=!0),r===void 0&&(r=N1),this.weakness=e,this.makeData=r}return t.prototype.lookup=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return this.lookupArray(e)},t.prototype.lookupArray=function(e){var r=this;return R1.call(e,function(n){return r=r.getChildTrie(n)}),r.data||(r.data=this.makeData(P1.call(e)))},t.prototype.getChildTrie=function(e){var r=this.weakness&&L1(e)?this.weak||(this.weak=new WeakMap):this.strong||(this.strong=new Map),n=r.get(e);return n||r.set(e,n=new t(this.weakness,this.makeData)),n},t}();function L1(t){switch(typeof t){case"object":if(t===null)break;case"function":return!0}return!1}var ze=null,np={},$1=1,F1=()=>class{constructor(){this.id=["slot",$1++,Date.now(),Math.random().toString(36).slice(2)].join(":")}hasValue(){for(let e=ze;e;e=e.parent)if(this.id in e.slots){let r=e.slots[this.id];if(r===np)break;return e!==ze&&(ze.slots[this.id]=r),!0}return ze&&(ze.slots[this.id]=np),!1}getValue(){if(this.hasValue())return ze.slots[this.id]}withValue(e,r,n,i){let a={__proto__:null,[this.id]:e},o=ze;ze={parent:o,slots:a};try{return r.apply(i,n)}finally{ze=o}}static bind(e){let r=ze;return function(){let n=ze;try{return ze=r,e.apply(this,arguments)}finally{ze=n}}}static noContext(e,r,n){if(ze){let i=ze;try{return ze=null,e.apply(n,r)}finally{ze=i}}else return e.apply(n,r)}};function ip(t){try{return t()}catch{}}var jc="@wry/context:Slot",M1=ip(()=>globalThis)||ip(()=>global)||Object.create(null),ap=M1,Kn=ap[jc]||Array[jc]||function(t){try{Object.defineProperty(ap,jc,{value:t,enumerable:!1,writable:!1,configurable:!0})}finally{return t}}(F1());var{bind:U1,noContext:j1}=Kn;function q1(){}var B1=function(){function t(e,r){e===void 0&&(e=1/0),r===void 0&&(r=q1),this.max=e,this.dispose=r,this.map=new Map,this.newest=null,this.oldest=null}return t.prototype.has=function(e){return this.map.has(e)},t.prototype.get=function(e){var r=this.getNode(e);return r&&r.value},t.prototype.getNode=function(e){var r=this.map.get(e);if(r&&r!==this.newest){var n=r.older,i=r.newer;i&&(i.older=n),n&&(n.newer=i),r.older=this.newest,r.older.newer=r,r.newer=null,this.newest=r,r===this.oldest&&(this.oldest=i)}return r},t.prototype.set=function(e,r){var n=this.getNode(e);return n?n.value=r:(n={key:e,value:r,newer:null,older:this.newest},this.newest&&(this.newest.newer=n),this.newest=n,this.oldest=this.oldest||n,this.map.set(e,n),n.value)},t.prototype.clean=function(){for(;this.oldest&&this.map.size>this.max;)this.delete(this.oldest.key)},t.prototype.delete=function(e){var r=this.map.get(e);return r?(r===this.newest&&(this.newest=r.older),r===this.oldest&&(this.oldest=r.newer),r.newer&&(r.newer.older=r.older),r.older&&(r.older.newer=r.newer),this.map.delete(e),this.dispose(r.value,e),!0):!1},t}(),mo=new Kn,qc,V1=Object.prototype.hasOwnProperty,Vc=(qc=Array.from,qc===void 0?function(t){var e=[];return t.forEach(function(r){return e.push(r)}),e}:qc);function ho(t){var e=t.unsubscribe;typeof e=="function"&&(t.unsubscribe=void 0,e())}var Gi=[],z1=100;function Zn(t,e){if(!t)throw new Error(e||"assertion failure")}function Q1(t,e){var r=t.length;return r>0&&r===e.length&&t[r-1]===e[r-1]}function sp(t){switch(t.length){case 0:throw new Error("unknown value");case 1:return t[0];case 2:throw t[1]}}function G1(t){return t.slice(0)}var H1=function(){function t(e){this.fn=e,this.parents=new Set,this.childValues=new Map,this.dirtyChildren=null,this.dirty=!0,this.recomputing=!1,this.value=[],this.deps=null,++t.count}return t.prototype.peek=function(){if(this.value.length===1&&!wr(this))return op(this),this.value[0]},t.prototype.recompute=function(e){return Zn(!this.recomputing,"already recomputing"),op(this),wr(this)?W1(this,e):sp(this.value)},t.prototype.setDirty=function(){this.dirty||(this.dirty=!0,this.value.length=0,cp(this),ho(this))},t.prototype.dispose=function(){var e=this;this.setDirty(),dp(this),zc(this,function(r,n){r.setDirty(),hp(r,e)})},t.prototype.forget=function(){this.dispose()},t.prototype.dependOn=function(e){e.add(this),this.deps||(this.deps=Gi.pop()||new Set),this.deps.add(e)},t.prototype.forgetDeps=function(){var e=this;this.deps&&(Vc(this.deps).forEach(function(r){return r.delete(e)}),this.deps.clear(),Gi.push(this.deps),this.deps=null)},t.count=0,t}();function op(t){var e=mo.getValue();if(e)return t.parents.add(e),e.childValues.has(t)||e.childValues.set(t,[]),wr(t)?lp(e,t):fp(e,t),e}function W1(t,e){return dp(t),mo.withValue(t,K1,[t,e]),Y1(t,e)&&Z1(t),sp(t.value)}function K1(t,e){t.recomputing=!0,t.value.length=0;try{t.value[0]=t.fn.apply(null,e)}catch(r){t.value[1]=r}t.recomputing=!1}function wr(t){return t.dirty||!!(t.dirtyChildren&&t.dirtyChildren.size)}function Z1(t){t.dirty=!1,!wr(t)&&up(t)}function cp(t){zc(t,lp)}function up(t){zc(t,fp)}function zc(t,e){var r=t.parents.size;if(r)for(var n=Vc(t.parents),i=0;i<r;++i)e(n[i],t)}function lp(t,e){Zn(t.childValues.has(e)),Zn(wr(e));var r=!wr(t);if(!t.dirtyChildren)t.dirtyChildren=Gi.pop()||new Set;else if(t.dirtyChildren.has(e))return;t.dirtyChildren.add(e),r&&cp(t)}function fp(t,e){Zn(t.childValues.has(e)),Zn(!wr(e));var r=t.childValues.get(e);r.length===0?t.childValues.set(e,G1(e.value)):Q1(r,e.value)||t.setDirty(),pp(t,e),!wr(t)&&up(t)}function pp(t,e){var r=t.dirtyChildren;r&&(r.delete(e),r.size===0&&(Gi.length<z1&&Gi.push(r),t.dirtyChildren=null))}function dp(t){t.childValues.size>0&&t.childValues.forEach(function(e,r){hp(t,r)}),t.forgetDeps(),Zn(t.dirtyChildren===null)}function hp(t,e){e.parents.delete(t),t.childValues.delete(e),pp(t,e)}function Y1(t,e){if(typeof t.subscribe=="function")try{ho(t),t.unsubscribe=t.subscribe.apply(null,e)}catch{return t.setDirty(),!1}return!0}var J1={setDirty:!0,dispose:!0,forget:!0};function go(t){var e=new Map,r=t&&t.subscribe;function n(i){var a=mo.getValue();if(a){var o=e.get(i);o||e.set(i,o=new Set),a.dependOn(o),typeof r=="function"&&(ho(o),o.unsubscribe=r(i))}}return n.dirty=function(a,o){var s=e.get(a);if(s){var u=o&&V1.call(J1,o)?o:"setDirty";Vc(s).forEach(function(c){return c[u]()}),e.delete(a),ho(s)}},n}function mp(){var t=new Bt(typeof WeakMap=="function");return function(){return t.lookupArray(arguments)}}var d6=mp(),Bc=new Set;function an(t,e){e===void 0&&(e=Object.create(null));var r=new B1(e.max||Math.pow(2,16),function(c){return c.dispose()}),n=e.keyArgs,i=e.makeCacheKey||mp(),a=function(){var c=i.apply(null,n?n.apply(null,arguments):arguments);if(c===void 0)return t.apply(null,arguments);var l=r.get(c);l||(r.set(c,l=new H1(t)),l.subscribe=e.subscribe,l.forget=function(){return r.delete(c)});var d=l.recompute(Array.prototype.slice.call(arguments));return r.set(c,l),Bc.add(r),mo.hasValue()||(Bc.forEach(function(p){return p.clean()}),Bc.clear()),d};Object.defineProperty(a,"size",{get:function(){return r.map.size},configurable:!1,enumerable:!1});function o(c){var l=r.get(c);l&&l.setDirty()}a.dirtyKey=o,a.dirty=function(){o(i.apply(null,arguments))};function s(c){var l=r.get(c);if(l)return l.peek()}a.peekKey=s,a.peek=function(){return s(i.apply(null,arguments))};function u(c){return r.delete(c)}return a.forgetKey=u,a.forget=function(){return u(i.apply(null,arguments))},a.makeCacheKey=i,a.getKey=n?function(){return i.apply(null,n.apply(null,arguments))}:i,Object.freeze(a)}var Qc=function(){function t(){this.getFragmentDoc=an(fc)}return t.prototype.batch=function(e){var r=this,n=typeof e.optimistic=="string"?e.optimistic:e.optimistic===!1?null:void 0,i;return this.performTransaction(function(){return i=e.update(r)},n),i},t.prototype.recordOptimisticTransaction=function(e,r){this.performTransaction(e,r)},t.prototype.transformDocument=function(e){return e},t.prototype.transformForLink=function(e){return e},t.prototype.identify=function(e){},t.prototype.gc=function(){return[]},t.prototype.modify=function(e){return!1},t.prototype.readQuery=function(e,r){return r===void 0&&(r=!!e.optimistic),this.read(_(_({},e),{rootId:e.id||"ROOT_QUERY",optimistic:r}))},t.prototype.readFragment=function(e,r){return r===void 0&&(r=!!e.optimistic),this.read(_(_({},e),{query:this.getFragmentDoc(e.fragment,e.fragmentName),rootId:e.id,optimistic:r}))},t.prototype.writeQuery=function(e){var r=e.id,n=e.data,i=Ut(e,["id","data"]);return this.write(Object.assign(i,{dataId:r||"ROOT_QUERY",result:n}))},t.prototype.writeFragment=function(e){var r=e.id,n=e.data,i=e.fragment,a=e.fragmentName,o=Ut(e,["id","data","fragment","fragmentName"]);return this.write(Object.assign(o,{query:this.getFragmentDoc(i,a),dataId:r,result:n}))},t.prototype.updateQuery=function(e,r){return this.batch({update:function(n){var i=n.readQuery(e),a=r(i);return a==null?i:(n.writeQuery(_(_({},e),{data:a})),a)}})},t.prototype.updateFragment=function(e,r){return this.batch({update:function(n){var i=n.readFragment(e),a=r(i);return a==null?i:(n.writeFragment(_(_({},e),{data:a})),a)}})},t}();var Hi=function(t){xe(e,t);function e(r,n,i,a){var o,s=t.call(this,r)||this;if(s.message=r,s.path=n,s.query=i,s.variables=a,Array.isArray(s.path)){s.missing=s.message;for(var u=s.path.length-1;u>=0;--u)s.missing=(o={},o[s.path[u]]=s.missing,o)}else s.missing=s.path;return s.__proto__=e.prototype,s}return e}(Error);var ke=Object.prototype.hasOwnProperty;function Wi(t){return t==null}function vo(t,e){var r=t.__typename,n=t.id,i=t._id;if(typeof r=="string"&&(e&&(e.keyObject=Wi(n)?Wi(i)?void 0:{_id:i}:{id:n}),Wi(n)&&!Wi(i)&&(n=i),!Wi(n)))return"".concat(r,":").concat(typeof n=="number"||typeof n=="string"?n:JSON.stringify(n))}var gp={dataIdFromObject:vo,addTypename:!0,resultCaching:!0,canonizeResults:!1};function yp(t){return _r(gp,t)}function bo(t){var e=t.canonizeResults;return e===void 0?gp.canonizeResults:e}function vp(t,e){return K(e)?t.get(e.__ref,"__typename"):e&&e.__typename}var Gc=/^[_a-z][_0-9a-z]*/i;function Dt(t){var e=t.match(Gc);return e?e[0]:t}function yo(t,e,r){return ee(e)?ue(e)?e.every(function(n){return yo(t,n,r)}):t.selections.every(function(n){if(pt(n)&&er(n,r)){var i=_t(n);return ke.call(e,i)&&(!n.selectionSet||yo(n.selectionSet,e[i],r))}return!0}):!1}function Sr(t){return ee(t)&&!K(t)&&!ue(t)}function bp(){return new it}function _o(t,e){var r=Yr(Xr(t));return{fragmentMap:r,lookupFragment:function(n){var i=r[n];return!i&&e&&(i=e.lookup(n)),i||null}}}var wo=Object.create(null),Hc=function(){return wo},_p=Object.create(null),Yn=function(){function t(e,r){var n=this;this.policies=e,this.group=r,this.data=Object.create(null),this.rootIds=Object.create(null),this.refs=Object.create(null),this.getFieldValue=function(i,a){return ji(K(i)?n.get(i.__ref,a):i&&i[a])},this.canRead=function(i){return K(i)?n.has(i.__ref):typeof i=="object"},this.toReference=function(i,a){if(typeof i=="string")return jt(i);if(K(i))return i;var o=n.policies.identify(i)[0];if(o){var s=jt(o);return a&&n.merge(o,i),s}}}return t.prototype.toObject=function(){return _({},this.data)},t.prototype.has=function(e){return this.lookup(e,!0)!==void 0},t.prototype.get=function(e,r){if(this.group.depend(e,r),ke.call(this.data,e)){var n=this.data[e];if(n&&ke.call(n,r))return n[r]}if(r==="__typename"&&ke.call(this.policies.rootTypenamesById,e))return this.policies.rootTypenamesById[e];if(this instanceof Cr)return this.parent.get(e,r)},t.prototype.lookup=function(e,r){if(r&&this.group.depend(e,"__exists"),ke.call(this.data,e))return this.data[e];if(this instanceof Cr)return this.parent.lookup(e,r);if(this.policies.rootTypenamesById[e])return Object.create(null)},t.prototype.merge=function(e,r){var n=this,i;K(e)&&(e=e.__ref),K(r)&&(r=r.__ref);var a=typeof e=="string"?this.lookup(i=e):e,o=typeof r=="string"?this.lookup(i=r):r;if(!!o){__DEV__?I(typeof i=="string","store.merge expects a string ID"):I(typeof i=="string",1);var s=new it(eg).merge(a,o);if(this.data[i]=s,s!==a&&(delete this.refs[i],this.group.caching)){var u=Object.create(null);a||(u.__exists=1),Object.keys(o).forEach(function(c){if(!a||a[c]!==s[c]){u[c]=1;var l=Dt(c);l!==c&&!n.policies.hasKeyArgs(s.__typename,l)&&(u[l]=1),s[c]===void 0&&!(n instanceof Cr)&&delete s[c]}}),u.__typename&&!(a&&a.__typename)&&this.policies.rootTypenamesById[i]===s.__typename&&delete u.__typename,Object.keys(u).forEach(function(c){return n.group.dirty(i,c)})}}},t.prototype.modify=function(e,r){var n=this,i=this.lookup(e);if(i){var a=Object.create(null),o=!1,s=!0,u={DELETE:wo,INVALIDATE:_p,isReference:K,toReference:this.toReference,canRead:this.canRead,readField:function(c,l){return n.policies.readField(typeof c=="string"?{fieldName:c,from:l||jt(e)}:c,{store:n})}};if(Object.keys(i).forEach(function(c){var l=Dt(c),d=i[c];if(d!==void 0){var p=typeof r=="function"?r:r[c]||r[l];if(p){var f=p===Hc?wo:p(ji(d),_(_({},u),{fieldName:l,storeFieldName:c,storage:n.getStorage(e,c)}));f===_p?n.group.dirty(e,c):(f===wo&&(f=void 0),f!==d&&(a[c]=f,o=!0,d=f))}d!==void 0&&(s=!1)}}),o)return this.merge(e,a),s&&(this instanceof Cr?this.data[e]=void 0:delete this.data[e],this.group.dirty(e,"__exists")),!0}return!1},t.prototype.delete=function(e,r,n){var i,a=this.lookup(e);if(a){var o=this.getFieldValue(a,"__typename"),s=r&&n?this.policies.getStoreFieldName({typename:o,fieldName:r,args:n}):r;return this.modify(e,s?(i={},i[s]=Hc,i):Hc)}return!1},t.prototype.evict=function(e,r){var n=!1;return e.id&&(ke.call(this.data,e.id)&&(n=this.delete(e.id,e.fieldName,e.args)),this instanceof Cr&&this!==r&&(n=this.parent.evict(e,r)||n),(e.fieldName||n)&&this.group.dirty(e.id,e.fieldName||"__exists")),n},t.prototype.clear=function(){this.replace(null)},t.prototype.extract=function(){var e=this,r=this.toObject(),n=[];return this.getRootIdSet().forEach(function(i){ke.call(e.policies.rootTypenamesById,i)||n.push(i)}),n.length&&(r.__META={extraRootIds:n.sort()}),r},t.prototype.replace=function(e){var r=this;if(Object.keys(this.data).forEach(function(a){e&&ke.call(e,a)||r.delete(a)}),e){var n=e.__META,i=Ut(e,["__META"]);Object.keys(i).forEach(function(a){r.merge(a,i[a])}),n&&n.extraRootIds.forEach(this.retain,this)}},t.prototype.retain=function(e){return this.rootIds[e]=(this.rootIds[e]||0)+1},t.prototype.release=function(e){if(this.rootIds[e]>0){var r=--this.rootIds[e];return r||delete this.rootIds[e],r}return 0},t.prototype.getRootIdSet=function(e){return e===void 0&&(e=new Set),Object.keys(this.rootIds).forEach(e.add,e),this instanceof Cr?this.parent.getRootIdSet(e):Object.keys(this.policies.rootTypenamesById).forEach(e.add,e),e},t.prototype.gc=function(){var e=this,r=this.getRootIdSet(),n=this.toObject();r.forEach(function(o){ke.call(n,o)&&(Object.keys(e.findChildRefIds(o)).forEach(r.add,r),delete n[o])});var i=Object.keys(n);if(i.length){for(var a=this;a instanceof Cr;)a=a.parent;i.forEach(function(o){return a.delete(o)})}return i},t.prototype.findChildRefIds=function(e){if(!ke.call(this.refs,e)){var r=this.refs[e]=Object.create(null),n=this.data[e];if(!n)return r;var i=new Set([n]);i.forEach(function(a){K(a)&&(r[a.__ref]=!0),ee(a)&&Object.keys(a).forEach(function(o){var s=a[o];ee(s)&&i.add(s)})})}return this.refs[e]},t.prototype.makeCacheKey=function(){return this.group.keyMaker.lookupArray(arguments)},t}();var wp=function(){function t(e,r){r===void 0&&(r=null),this.caching=e,this.parent=r,this.d=null,this.resetCaching()}return t.prototype.resetCaching=function(){this.d=this.caching?go():null,this.keyMaker=new Bt(wt)},t.prototype.depend=function(e,r){if(this.d){this.d(Wc(e,r));var n=Dt(r);n!==r&&this.d(Wc(e,n)),this.parent&&this.parent.depend(e,r)}},t.prototype.dirty=function(e,r){this.d&&this.d.dirty(Wc(e,r),r==="__exists"?"forget":"setDirty")},t}();function Wc(t,e){return e+"#"+t}function Kc(t,e){on(t)&&t.group.depend(e,"__exists")}(function(t){var e=function(r){xe(n,r);function n(i){var a=i.policies,o=i.resultCaching,s=o===void 0?!0:o,u=i.seed,c=r.call(this,a,new wp(s))||this;return c.stump=new X1(c),c.storageTrie=new Bt(wt),u&&c.replace(u),c}return n.prototype.addLayer=function(i,a){return this.stump.addLayer(i,a)},n.prototype.removeLayer=function(){return this},n.prototype.getStorage=function(){return this.storageTrie.lookupArray(arguments)},n}(t);t.Root=e})(Yn||(Yn={}));var Cr=function(t){xe(e,t);function e(r,n,i,a){var o=t.call(this,n.policies,a)||this;return o.id=r,o.parent=n,o.replay=i,o.group=a,i(o),o}return e.prototype.addLayer=function(r,n){return new e(r,this,n,this.group)},e.prototype.removeLayer=function(r){var n=this,i=this.parent.removeLayer(r);return r===this.id?(this.group.caching&&Object.keys(this.data).forEach(function(a){var o=n.data[a],s=i.lookup(a);s?o?o!==s&&Object.keys(o).forEach(function(u){be(o[u],s[u])||n.group.dirty(a,u)}):(n.group.dirty(a,"__exists"),Object.keys(s).forEach(function(u){n.group.dirty(a,u)})):n.delete(a)}),i):i===this.parent?this:i.addLayer(this.id,this.replay)},e.prototype.toObject=function(){return _(_({},this.parent.toObject()),this.data)},e.prototype.findChildRefIds=function(r){var n=this.parent.findChildRefIds(r);return ke.call(this.data,r)?_(_({},n),t.prototype.findChildRefIds.call(this,r)):n},e.prototype.getStorage=function(){for(var r=this.parent;r.parent;)r=r.parent;return r.getStorage.apply(r,arguments)},e}(Yn),X1=function(t){xe(e,t);function e(r){return t.call(this,"EntityStore.Stump",r,function(){},new wp(r.group.caching,r.group))||this}return e.prototype.removeLayer=function(){return this},e.prototype.merge=function(){return this.parent.merge.apply(this.parent,arguments)},e}(Cr);function eg(t,e,r){var n=t[r],i=e[r];return be(n,i)?n:i}function on(t){return!!(t instanceof Yn&&t.group.caching)}function tg(t){return ee(t)?ue(t)?t.slice(0):_({__proto__:Object.getPrototypeOf(t)},t):t}var So=function(){function t(){this.known=new(xf?WeakSet:Set),this.pool=new Bt(wt),this.passes=new WeakMap,this.keysByJSON=new Map,this.empty=this.admit({})}return t.prototype.isKnown=function(e){return ee(e)&&this.known.has(e)},t.prototype.pass=function(e){if(ee(e)){var r=tg(e);return this.passes.set(r,e),r}return e},t.prototype.admit=function(e){var r=this;if(ee(e)){var n=this.passes.get(e);if(n)return n;var i=Object.getPrototypeOf(e);switch(i){case Array.prototype:{if(this.known.has(e))return e;var a=e.map(this.admit,this),o=this.pool.lookupArray(a);return o.array||(this.known.add(o.array=a),__DEV__&&Object.freeze(a)),o.array}case null:case Object.prototype:{if(this.known.has(e))return e;var s=Object.getPrototypeOf(e),u=[s],c=this.sortedKeys(e);u.push(c.json);var l=u.length;c.sorted.forEach(function(f){u.push(r.admit(e[f]))});var o=this.pool.lookupArray(u);if(!o.object){var d=o.object=Object.create(s);this.known.add(d),c.sorted.forEach(function(f,h){d[f]=u[l+h]}),__DEV__&&Object.freeze(d)}return o.object}}}return e},t.prototype.sortedKeys=function(e){var r=Object.keys(e),n=this.pool.lookupArray(r);if(!n.keys){r.sort();var i=JSON.stringify(r);(n.keys=this.keysByJSON.get(i))||this.keysByJSON.set(i,n.keys={sorted:r,json:i})}return n.keys},t}();var dt=Object.assign(function(t){if(ee(t)){Zc===void 0&&Sp();var e=Zc.admit(t),r=Yc.get(e);return r===void 0&&Yc.set(e,r=JSON.stringify(e)),r}return JSON.stringify(t)},{reset:Sp}),Zc,Yc;function Sp(){Zc=new So,Yc=new(wt?WeakMap:Map)}function Cp(t){return[t.selectionSet,t.objectOrReference,t.context,t.context.canonizeResults]}var Ep=function(){function t(e){var r=this;this.knownResults=new(wt?WeakMap:Map),this.config=_r(e,{addTypename:e.addTypename!==!1,canonizeResults:bo(e)}),this.canon=e.canon||new So,this.executeSelectionSet=an(function(n){var i,a=n.context.canonizeResults,o=Cp(n);o[3]=!a;var s=(i=r.executeSelectionSet).peek.apply(i,o);return s?a?_(_({},s),{result:r.canon.admit(s.result)}):s:(Kc(n.context.store,n.enclosingRef.__ref),r.execSelectionSetImpl(n))},{max:this.config.resultCacheMaxSize,keyArgs:Cp,makeCacheKey:function(n,i,a,o){if(on(a.store))return a.store.makeCacheKey(n,K(i)?i.__ref:i,a.varString,o)}}),this.executeSubSelectedArray=an(function(n){return Kc(n.context.store,n.enclosingRef.__ref),r.execSubSelectedArrayImpl(n)},{max:this.config.resultCacheMaxSize,makeCacheKey:function(n){var i=n.field,a=n.array,o=n.context;if(on(o.store))return o.store.makeCacheKey(i,a,o.varString)}})}return t.prototype.resetCanon=function(){this.canon=new So},t.prototype.diffQueryAgainstStore=function(e){var r=e.store,n=e.query,i=e.rootId,a=i===void 0?"ROOT_QUERY":i,o=e.variables,s=e.returnPartialData,u=s===void 0?!0:s,c=e.canonizeResults,l=c===void 0?this.config.canonizeResults:c,d=this.config.cache.policies;o=_(_({},tn(Fi(n))),o);var p=jt(a),f=this.executeSelectionSet({selectionSet:en(n).selectionSet,objectOrReference:p,enclosingRef:p,context:_({store:r,query:n,policies:d,variables:o,varString:dt(o),canonizeResults:l},_o(n,this.config.fragments))}),h;if(f.missing&&(h=[new Hi(rg(f.missing),f.missing,n,o)],!u))throw h[0];return{result:f.result,complete:!h,missing:h}},t.prototype.isFresh=function(e,r,n,i){if(on(i.store)&&this.knownResults.get(e)===n){var a=this.executeSelectionSet.peek(n,r,i,this.canon.isKnown(e));if(a&&e===a.result)return!0}return!1},t.prototype.execSelectionSetImpl=function(e){var r=this,n=e.selectionSet,i=e.objectOrReference,a=e.enclosingRef,o=e.context;if(K(i)&&!o.policies.rootTypenamesById[i.__ref]&&!o.store.has(i.__ref))return{result:this.canon.empty,missing:"Dangling reference to missing ".concat(i.__ref," object")};var s=o.variables,u=o.policies,c=o.store,l=c.getFieldValue(i,"__typename"),d=[],p,f=new it;this.config.addTypename&&typeof l=="string"&&!u.rootIdsByTypename[l]&&d.push({__typename:l});function h(v,m){var A;return v.missing&&(p=f.merge(p,(A={},A[m]=v.missing,A))),v.result}var g=new Set(n.selections);g.forEach(function(v){var m,A;if(!!er(v,s))if(pt(v)){var D=u.readField({fieldName:v.name.value,field:v,variables:o.variables,from:i},o),E=_t(v);D===void 0?rn.added(v)||(p=f.merge(p,(m={},m[E]="Can't find field '".concat(v.name.value,"' on ").concat(K(i)?i.__ref+" object":"object "+JSON.stringify(i,null,2)),m))):ue(D)?D=h(r.executeSubSelectedArray({field:v,array:D,enclosingRef:a,context:o}),E):v.selectionSet?D!=null&&(D=h(r.executeSelectionSet({selectionSet:v.selectionSet,objectOrReference:D,enclosingRef:K(D)?D:a,context:o}),E)):o.canonizeResults&&(D=r.canon.pass(D)),D!==void 0&&d.push((A={},A[E]=D,A))}else{var O=Jr(v,o.lookupFragment);if(!O&&v.kind===Oe.FRAGMENT_SPREAD)throw __DEV__?new V("No fragment named ".concat(v.name.value)):new V(5);O&&u.fragmentMatches(O,l)&&O.selectionSet.selections.forEach(g.add,g)}});var y=Mi(d),S={result:y,missing:p},b=o.canonizeResults?this.canon.admit(S):ji(S);return b.result&&this.knownResults.set(b.result,n),b},t.prototype.execSubSelectedArrayImpl=function(e){var r=this,n=e.field,i=e.array,a=e.enclosingRef,o=e.context,s,u=new it;function c(l,d){var p;return l.missing&&(s=u.merge(s,(p={},p[d]=l.missing,p))),l.result}return n.selectionSet&&(i=i.filter(o.store.canRead)),i=i.map(function(l,d){return l===null?null:ue(l)?c(r.executeSubSelectedArray({field:n,array:l,enclosingRef:a,context:o}),d):n.selectionSet?c(r.executeSelectionSet({selectionSet:n.selectionSet,objectOrReference:l,enclosingRef:K(l)?l:a,context:o}),d):(__DEV__&&ng(o.store,n,l),l)}),{result:o.canonizeResults?this.canon.admit(i):i,missing:s}},t}();function rg(t){try{JSON.stringify(t,function(e,r){if(typeof r=="string")throw r;return r})}catch(e){return e}}function ng(t,e,r){if(!e.selectionSet){var n=new Set([r]);n.forEach(function(i){ee(i)&&(__DEV__?I(!K(i),"Missing selection set for object of type ".concat(vp(t,i)," returned for query field ").concat(e.name.value)):I(!K(i),6),Object.values(i).forEach(n.add,n))})}}var Jn=new Kn,xp=new WeakMap;function Ki(t){var e=xp.get(t);return e||xp.set(t,e={vars:new Set,dep:go()}),e}function Jc(t){Ki(t).vars.forEach(function(e){return e.forgetCache(t)})}function kp(t){Ki(t).vars.forEach(function(e){return e.attachCache(t)})}function Co(t){var e=new Set,r=new Set,n=function(a){if(arguments.length>0){if(t!==a){t=a,e.forEach(function(u){Ki(u).dep.dirty(n),ig(u)});var o=Array.from(r);r.clear(),o.forEach(function(u){return u(t)})}}else{var s=Jn.getValue();s&&(i(s),Ki(s).dep(n))}return t};n.onNextChange=function(a){return r.add(a),function(){r.delete(a)}};var i=n.attachCache=function(a){return e.add(a),Ki(a).vars.add(n),n};return n.forgetCache=function(a){return e.delete(a)},n}function ig(t){t.broadcastWatches&&t.broadcastWatches()}var Tp=Object.create(null);function Xc(t){var e=JSON.stringify(t);return Tp[e]||(Tp[e]=Object.create(null))}function eu(t){var e=Xc(t);return e.keyFieldsFn||(e.keyFieldsFn=function(r,n){var i=function(o,s){return n.readField(s,o)},a=n.keyObject=ru(t,function(o){var s=Xn(n.storeObject,o,i);return s===void 0&&r!==n.storeObject&&ke.call(r,o[0])&&(s=Xn(r,o,Ip)),__DEV__?I(s!==void 0,"Missing field '".concat(o.join("."),"' while extracting keyFields from ").concat(JSON.stringify(r))):I(s!==void 0,2),s});return"".concat(n.typename,":").concat(JSON.stringify(a))})}function tu(t){var e=Xc(t);return e.keyArgsFn||(e.keyArgsFn=function(r,n){var i=n.field,a=n.variables,o=n.fieldName,s=ru(t,function(c){var l=c[0],d=l.charAt(0);if(d==="@"){if(i&&Re(i.directives)){var p=l.slice(1),f=i.directives.find(function(S){return S.name.value===p}),h=f&&tr(f,a);return h&&Xn(h,c.slice(1))}return}if(d==="$"){var g=l.slice(1);if(a&&ke.call(a,g)){var y=c.slice(0);return y[0]=g,Xn(a,y)}return}if(r)return Xn(r,c)}),u=JSON.stringify(s);return(r||u!=="{}")&&(o+=":"+u),o})}function ru(t,e){var r=new it;return Ap(t).reduce(function(n,i){var a,o=e(i);if(o!==void 0){for(var s=i.length-1;s>=0;--s)o=(a={},a[i[s]]=o,a);n=r.merge(n,o)}return n},Object.create(null))}function Ap(t){var e=Xc(t);if(!e.paths){var r=e.paths=[],n=[];t.forEach(function(i,a){ue(i)?(Ap(i).forEach(function(o){return r.push(n.concat(o))}),n.length=0):(n.push(i),ue(t[a+1])||(r.push(n.slice(0)),n.length=0))})}return e.paths}function Ip(t,e){return t[e]}function Xn(t,e,r){return r=r||Ip,Op(e.reduce(function n(i,a){return ue(i)?i.map(function(o){return n(o,a)}):i&&r(i,a)},t))}function Op(t){return ee(t)?ue(t)?t.map(Op):ru(Object.keys(t).sort(),function(e){return Xn(t,e)}):t}Li.setStringify(dt);function nu(t){return t.args!==void 0?t.args:t.field?tr(t.field,t.variables):null}var ag=function(){},Dp=function(t,e){return e.fieldName},Np=function(t,e,r){var n=r.mergeObjects;return n(t,e)},Rp=function(t,e){return e},Lp=function(){function t(e){this.config=e,this.typePolicies=Object.create(null),this.toBeAdded=Object.create(null),this.supertypeMap=new Map,this.fuzzySubtypes=new Map,this.rootIdsByTypename=Object.create(null),this.rootTypenamesById=Object.create(null),this.usingPossibleTypes=!1,this.config=_({dataIdFromObject:vo},e),this.cache=this.config.cache,this.setRootTypename("Query"),this.setRootTypename("Mutation"),this.setRootTypename("Subscription"),e.possibleTypes&&this.addPossibleTypes(e.possibleTypes),e.typePolicies&&this.addTypePolicies(e.typePolicies)}return t.prototype.identify=function(e,r){var n,i=this,a=r&&(r.typename||((n=r.storeObject)===null||n===void 0?void 0:n.__typename))||e.__typename;if(a===this.rootTypenamesById.ROOT_QUERY)return["ROOT_QUERY"];for(var o=r&&r.storeObject||e,s=_(_({},r),{typename:a,storeObject:o,readField:r&&r.readField||function(){var p=Eo(arguments,o);return i.readField(p,{store:i.cache.data,variables:p.variables})}}),u,c=a&&this.getTypePolicy(a),l=c&&c.keyFn||this.config.dataIdFromObject;l;){var d=l(e,s);if(ue(d))l=eu(d);else{u=d;break}}return u=u?String(u):void 0,s.keyObject?[u,s.keyObject]:[u]},t.prototype.addTypePolicies=function(e){var r=this;Object.keys(e).forEach(function(n){var i=e[n],a=i.queryType,o=i.mutationType,s=i.subscriptionType,u=Ut(i,["queryType","mutationType","subscriptionType"]);a&&r.setRootTypename("Query",n),o&&r.setRootTypename("Mutation",n),s&&r.setRootTypename("Subscription",n),ke.call(r.toBeAdded,n)?r.toBeAdded[n].push(u):r.toBeAdded[n]=[u]})},t.prototype.updateTypePolicy=function(e,r){var n=this,i=this.getTypePolicy(e),a=r.keyFields,o=r.fields;function s(u,c){u.merge=typeof c=="function"?c:c===!0?Np:c===!1?Rp:u.merge}s(i,r.merge),i.keyFn=a===!1?ag:ue(a)?eu(a):typeof a=="function"?a:i.keyFn,o&&Object.keys(o).forEach(function(u){var c=n.getFieldPolicy(e,u,!0),l=o[u];if(typeof l=="function")c.read=l;else{var d=l.keyArgs,p=l.read,f=l.merge;c.keyFn=d===!1?Dp:ue(d)?tu(d):typeof d=="function"?d:c.keyFn,typeof p=="function"&&(c.read=p),s(c,f)}c.read&&c.merge&&(c.keyFn=c.keyFn||Dp)})},t.prototype.setRootTypename=function(e,r){r===void 0&&(r=e);var n="ROOT_"+e.toUpperCase(),i=this.rootTypenamesById[n];r!==i&&(__DEV__?I(!i||i===e,"Cannot change root ".concat(e," __typename more than once")):I(!i||i===e,3),i&&delete this.rootIdsByTypename[i],this.rootIdsByTypename[r]=n,this.rootTypenamesById[n]=r)},t.prototype.addPossibleTypes=function(e){var r=this;this.usingPossibleTypes=!0,Object.keys(e).forEach(function(n){r.getSupertypeSet(n,!0),e[n].forEach(function(i){r.getSupertypeSet(i,!0).add(n);var a=i.match(Gc);(!a||a[0]!==i)&&r.fuzzySubtypes.set(i,new RegExp(i))})})},t.prototype.getTypePolicy=function(e){var r=this;if(!ke.call(this.typePolicies,e)){var n=this.typePolicies[e]=Object.create(null);n.fields=Object.create(null);var i=this.supertypeMap.get(e);i&&i.size&&i.forEach(function(o){var s=r.getTypePolicy(o),u=s.fields,c=Ut(s,["fields"]);Object.assign(n,c),Object.assign(n.fields,u)})}var a=this.toBeAdded[e];return a&&a.length&&a.splice(0).forEach(function(o){r.updateTypePolicy(e,o)}),this.typePolicies[e]},t.prototype.getFieldPolicy=function(e,r,n){if(e){var i=this.getTypePolicy(e).fields;return i[r]||n&&(i[r]=Object.create(null))}},t.prototype.getSupertypeSet=function(e,r){var n=this.supertypeMap.get(e);return!n&&r&&this.supertypeMap.set(e,n=new Set),n},t.prototype.fragmentMatches=function(e,r,n,i){var a=this;if(!e.typeCondition)return!0;if(!r)return!1;var o=e.typeCondition.name.value;if(r===o)return!0;if(this.usingPossibleTypes&&this.supertypeMap.has(o))for(var s=this.getSupertypeSet(r,!0),u=[s],c=function(h){var g=a.getSupertypeSet(h,!1);g&&g.size&&u.indexOf(g)<0&&u.push(g)},l=!!(n&&this.fuzzySubtypes.size),d=!1,p=0;p<u.length;++p){var f=u[p];if(f.has(o))return s.has(o)||(d&&__DEV__&&I.warn("Inferring subtype ".concat(r," of supertype ").concat(o)),s.add(o)),!0;f.forEach(c),l&&p===u.length-1&&yo(e.selectionSet,n,i)&&(l=!1,d=!0,this.fuzzySubtypes.forEach(function(h,g){var y=r.match(h);y&&y[0]===r&&c(g)}))}return!1},t.prototype.hasKeyArgs=function(e,r){var n=this.getFieldPolicy(e,r,!1);return!!(n&&n.keyFn)},t.prototype.getStoreFieldName=function(e){var r=e.typename,n=e.fieldName,i=this.getFieldPolicy(r,n,!1),a,o=i&&i.keyFn;if(o&&r)for(var s={typename:r,fieldName:n,field:e.field||null,variables:e.variables},u=nu(e);o;){var c=o(u,s);if(ue(c))o=tu(c);else{a=c||n;break}}return a===void 0&&(a=e.field?dc(e.field,e.variables):Li(n,nu(e))),a===!1?n:n===Dt(a)?a:n+":"+a},t.prototype.readField=function(e,r){var n=e.from;if(!!n){var i=e.field||e.fieldName;if(!!i){if(e.typename===void 0){var a=r.store.getFieldValue(n,"__typename");a&&(e.typename=a)}var o=this.getStoreFieldName(e),s=Dt(o),u=r.store.getFieldValue(n,o),c=this.getFieldPolicy(e.typename,s,!1),l=c&&c.read;if(l){var d=Pp(this,n,e,r,r.store.getStorage(K(n)?n.__ref:n,o));return Jn.withValue(this.cache,l,[u,d])}return u}}},t.prototype.getReadFunction=function(e,r){var n=this.getFieldPolicy(e,r,!1);return n&&n.read},t.prototype.getMergeFunction=function(e,r,n){var i=this.getFieldPolicy(e,r,!1),a=i&&i.merge;return!a&&n&&(i=this.getTypePolicy(n),a=i&&i.merge),a},t.prototype.runMergeFunction=function(e,r,n,i,a){var o=n.field,s=n.typename,u=n.merge;return u===Np?$p(i.store)(e,r):u===Rp?r:(i.overwrite&&(e=void 0),u(e,r,Pp(this,void 0,{typename:s,fieldName:o.name.value,field:o,variables:i.variables},i,a||Object.create(null))))},t}();function Pp(t,e,r,n,i){var a=t.getStoreFieldName(r),o=Dt(a),s=r.variables||n.variables,u=n.store,c=u.toReference,l=u.canRead;return{args:nu(r),field:r.field||null,fieldName:o,storeFieldName:a,variables:s,isReference:K,toReference:c,storage:i,cache:t.cache,canRead:l,readField:function(){return t.readField(Eo(arguments,e,s),n)},mergeObjects:$p(n.store)}}function Eo(t,e,r){var n=t[0],i=t[1],a=t.length,o;return typeof n=="string"?o={fieldName:n,from:a>1?i:e}:(o=_({},n),ke.call(o,"from")||(o.from=e)),__DEV__&&o.from===void 0&&__DEV__&&I.warn("Undefined 'from' passed to readField with arguments ".concat(If(Array.from(t)))),o.variables===void 0&&(o.variables=r),o}function $p(t){return function(r,n){if(ue(r)||ue(n))throw __DEV__?new V("Cannot automatically merge arrays"):new V(4);if(ee(r)&&ee(n)){var i=t.getFieldValue(r,"__typename"),a=t.getFieldValue(n,"__typename"),o=i&&a&&i!==a;if(o)return n;if(K(r)&&Sr(n))return t.merge(r.__ref,n),r;if(Sr(r)&&K(n))return t.merge(r,n.__ref),n;if(Sr(r)&&Sr(n))return _(_({},r),n)}return n}}function iu(t,e,r){var n="".concat(e).concat(r),i=t.flavors.get(n);return i||t.flavors.set(n,i=t.clientOnly===e&&t.deferred===r?t:_(_({},t),{clientOnly:e,deferred:r})),i}var jp=function(){function t(e,r,n){this.cache=e,this.reader=r,this.fragments=n}return t.prototype.writeToStore=function(e,r){var n=this,i=r.query,a=r.result,o=r.dataId,s=r.variables,u=r.overwrite,c=qt(i),l=bp();s=_(_({},tn(c)),s);var d=_(_({store:e,written:Object.create(null),merge:function(f,h){return l.merge(f,h)},variables:s,varString:dt(s)},_o(i,this.fragments)),{overwrite:!!u,incomingById:new Map,clientOnly:!1,deferred:!1,flavors:new Map}),p=this.processSelectionSet({result:a||Object.create(null),dataId:o,selectionSet:c.selectionSet,mergeTree:{map:new Map},context:d});if(!K(p))throw __DEV__?new V("Could not identify object ".concat(JSON.stringify(a))):new V(7);return d.incomingById.forEach(function(f,h){var g=f.storeObject,y=f.mergeTree,S=f.fieldNodeSet,b=jt(h);if(y&&y.map.size){var v=n.applyMerges(y,b,g,d);if(K(v))return;g=v}if(__DEV__&&!d.overwrite){var m=Object.create(null);S.forEach(function(E){E.selectionSet&&(m[E.name.value]=!0)});var A=function(E){return m[Dt(E)]===!0},D=function(E){var O=y&&y.map.get(E);return Boolean(O&&O.info&&O.info.merge)};Object.keys(g).forEach(function(E){A(E)&&!D(E)&&og(b,g,E,d.store)})}e.merge(h,g)}),e.retain(p.__ref),p},t.prototype.processSelectionSet=function(e){var r=this,n=e.dataId,i=e.result,a=e.selectionSet,o=e.context,s=e.mergeTree,u=this.cache.policies,c=Object.create(null),l=n&&u.rootTypenamesById[n]||$i(i,a,o.fragmentMap)||n&&o.store.get(n,"__typename");typeof l=="string"&&(c.__typename=l);var d=function(){var v=Eo(arguments,c,o.variables);if(K(v.from)){var m=o.incomingById.get(v.from.__ref);if(m){var A=u.readField(_(_({},v),{from:m.storeObject}),o);if(A!==void 0)return A}}return u.readField(v,o)},p=new Set;this.flattenFields(a,i,o,l).forEach(function(v,m){var A,D=_t(m),E=i[D];if(p.add(m),E!==void 0){var O=u.getStoreFieldName({typename:l,fieldName:m.name.value,field:m,variables:v.variables}),P=Fp(s,O),N=r.processFieldValue(E,m,m.selectionSet?iu(v,!1,!1):v,P),j=void 0;m.selectionSet&&(K(N)||Sr(N))&&(j=d("__typename",N));var qe=u.getMergeFunction(l,m.name.value,j);qe?P.info={field:m,typename:l,merge:qe}:Mp(s,O),c=v.merge(c,(A={},A[O]=N,A))}else __DEV__&&!v.clientOnly&&!v.deferred&&!rn.added(m)&&!u.getReadFunction(l,m.name.value)&&__DEV__&&I.error("Missing field '".concat(_t(m),"' while writing result ").concat(JSON.stringify(i,null,2)).substring(0,1e3))});try{var f=u.identify(i,{typename:l,selectionSet:a,fragmentMap:o.fragmentMap,storeObject:c,readField:d}),h=f[0],g=f[1];n=n||h,g&&(c=o.merge(c,g))}catch(v){if(!n)throw v}if(typeof n=="string"){var y=jt(n),S=o.written[n]||(o.written[n]=[]);if(S.indexOf(a)>=0||(S.push(a),this.reader&&this.reader.isFresh(i,y,a,o)))return y;var b=o.incomingById.get(n);return b?(b.storeObject=o.merge(b.storeObject,c),b.mergeTree=au(b.mergeTree,s),p.forEach(function(v){return b.fieldNodeSet.add(v)})):o.incomingById.set(n,{storeObject:c,mergeTree:xo(s)?void 0:s,fieldNodeSet:p}),y}return c},t.prototype.processFieldValue=function(e,r,n,i){var a=this;return!r.selectionSet||e===null?__DEV__?io(e):e:ue(e)?e.map(function(o,s){var u=a.processFieldValue(o,r,n,Fp(i,s));return Mp(i,s),u}):this.processSelectionSet({result:e,selectionSet:r.selectionSet,context:n,mergeTree:i})},t.prototype.flattenFields=function(e,r,n,i){i===void 0&&(i=$i(r,e,n.fragmentMap));var a=new Map,o=this.cache.policies,s=new Bt(!1);return function u(c,l){var d=s.lookup(c,l.clientOnly,l.deferred);d.visited||(d.visited=!0,c.selections.forEach(function(p){if(!!er(p,n.variables)){var f=l.clientOnly,h=l.deferred;if(!(f&&h)&&Re(p.directives)&&p.directives.forEach(function(S){var b=S.name.value;if(b==="client"&&(f=!0),b==="defer"){var v=tr(S,n.variables);(!v||v.if!==!1)&&(h=!0)}}),pt(p)){var g=a.get(p);g&&(f=f&&g.clientOnly,h=h&&g.deferred),a.set(p,iu(n,f,h))}else{var y=Jr(p,n.lookupFragment);if(!y&&p.kind===Oe.FRAGMENT_SPREAD)throw __DEV__?new V("No fragment named ".concat(p.name.value)):new V(8);y&&o.fragmentMatches(y,i,r,n.variables)&&u(y.selectionSet,iu(n,f,h))}}}))}(e,n),a},t.prototype.applyMerges=function(e,r,n,i,a){var o,s=this;if(e.map.size&&!K(n)){var u=!ue(n)&&(K(r)||Sr(r))?r:void 0,c=n;u&&!a&&(a=[K(u)?u.__ref:u]);var l,d=function(p,f){return ue(p)?typeof f=="number"?p[f]:void 0:i.store.getFieldValue(p,String(f))};e.map.forEach(function(p,f){var h=d(u,f),g=d(c,f);if(g!==void 0){a&&a.push(f);var y=s.applyMerges(p,h,g,i,a);y!==g&&(l=l||new Map,l.set(f,y)),a&&I(a.pop()===f)}}),l&&(n=ue(c)?c.slice(0):_({},c),l.forEach(function(p,f){n[f]=p}))}return e.info?this.cache.policies.runMergeFunction(r,n,e.info,i,a&&(o=i.store).getStorage.apply(o,a)):n},t}();var qp=[];function Fp(t,e){var r=t.map;return r.has(e)||r.set(e,qp.pop()||{map:new Map}),r.get(e)}function au(t,e){if(t===e||!e||xo(e))return t;if(!t||xo(t))return e;var r=t.info&&e.info?_(_({},t.info),e.info):t.info||e.info,n=t.map.size&&e.map.size,i=n?new Map:t.map.size?t.map:e.map,a={info:r,map:i};if(n){var o=new Set(e.map.keys());t.map.forEach(function(s,u){a.map.set(u,au(s,e.map.get(u))),o.delete(u)}),o.forEach(function(s){a.map.set(s,au(e.map.get(s),t.map.get(s)))})}return a}function xo(t){return!t||!(t.info||t.map.size)}function Mp(t,e){var r=t.map,n=r.get(e);n&&xo(n)&&(qp.push(n),r.delete(e))}var Up=new Set;function og(t,e,r,n){var i=function(d){var p=n.getFieldValue(d,r);return typeof p=="object"&&p},a=i(t);if(!!a){var o=i(e);if(!!o&&!K(a)&&!be(a,o)&&!Object.keys(a).every(function(d){return n.getFieldValue(o,d)!==void 0})){var s=n.getFieldValue(t,"__typename")||n.getFieldValue(e,"__typename"),u=Dt(r),c="".concat(s,".").concat(u);if(!Up.has(c)){Up.add(c);var l=[];!ue(a)&&!ue(o)&&[a,o].forEach(function(d){var p=n.getFieldValue(d,"__typename");typeof p=="string"&&!l.includes(p)&&l.push(p)}),__DEV__&&I.warn("Cache data may be lost when replacing the ".concat(u," field of a ").concat(s,` object.
|
|
38
|
+
`):new V(23)};var Wf=function(){if(typeof AbortController>"u")return{controller:!1,signal:!1};var t=new AbortController,e=t.signal;return{controller:t,signal:e}};var Kf=function(t,e){var r=t.getContext(),n=r.uri;return n||(typeof e=="function"?e(t):e||"/graphql")};function Zf(t,e){var r=[],n=function(d,p){r.push("".concat(d,"=").concat(encodeURIComponent(p)))};if("query"in e&&n("query",e.query),e.operationName&&n("operationName",e.operationName),e.variables){var i=void 0;try{i=Gi(e.variables,"Variables map")}catch(d){return{parseError:d}}n("variables",i)}if(e.extensions){var a=void 0;try{a=Gi(e.extensions,"Extensions map")}catch(d){return{parseError:d}}n("extensions",a)}var o="",s=t,u=t.indexOf("#");u!==-1&&(o=t.substr(u),s=t.substr(0,u));var c=s.indexOf("?")===-1?"?":"&",l=s+c+r.join("&")+o;return{newURI:l}}var Yf=Ue(function(){return fetch}),Jf=function(t){t===void 0&&(t={});var e=t.uri,r=e===void 0?"/graphql":e,n=t.fetch,i=t.print,a=i===void 0?Qf:i,o=t.includeExtensions,s=t.preserveHeaderCase,u=t.useGETForQueries,c=t.includeUnusedVariables,l=c===void 0?!1:c,d=Ut(t,["uri","fetch","print","includeExtensions","preserveHeaderCase","useGETForQueries","includeUnusedVariables"]);__DEV__&&Hf(n||Yf);var p={http:{includeExtensions:o,preserveHeaderCase:s},options:d.fetchOptions,credentials:d.credentials,headers:d.headers};return new St(function(f){var h=Kf(f,r),g=f.getContext(),y={};if(g.clientAwareness){var S=g.clientAwareness,b=S.name,v=S.version;b&&(y["apollographql-client-name"]=b),v&&(y["apollographql-client-version"]=v)}var m=_(_({},y),g.headers),A={http:g.http,options:g.fetchOptions,credentials:g.credentials,headers:m},D=Gf(f,a,zf,p,A),E=D.options,O=D.body;if(O.variables&&!l){var P=new Set(Object.keys(O.variables));Ke(f.query,{Variable:function(X,Ft,H){H&&H.kind!=="VariableDefinition"&&P.delete(X.name.value)}}),P.size&&(O.variables=_({},O.variables),P.forEach(function(X){delete O.variables[X]}))}var N;if(!E.signal){var j=Wf(),qe=j.controller,Ne=j.signal;N=qe,N&&(E.signal=Ne)}var q=function(X){return X.kind==="OperationDefinition"&&X.operation==="mutation"};if(u&&!f.query.definitions.some(q)&&(E.method="GET"),Bn(["defer"],f.query)&&(E.headers=E.headers||{},E.headers.accept="multipart/mixed; deferSpec=20220824, application/json"),E.method==="GET"){var de=Zf(h,O),he=de.newURI,J=de.parseError;if(J)return lo(J);h=he}else try{E.body=Gi(O,"Payload")}catch(X){return lo(X)}return new W(function(X){var Ft=n||Ue(function(){return fetch})||Yf;return Ft(h,E).then(function(H){var Mt;f.setContext({response:H});var pr=(Mt=H.headers)===null||Mt===void 0?void 0:Mt.get("content-type");return pr!==null&&/^multipart\/mixed/i.test(pr)?qf(H,X):Vf(H,f,X)}).catch(function(H){return ho(H,X)}),function(){N&&N.abort()}})})};var Uc=function(t){xe(e,t);function e(r){r===void 0&&(r={});var n=t.call(this,Jf(r).request)||this;return n.options=r,n}return e}(St);var{toString:Xf,hasOwnProperty:I1}=Object.prototype,ep=Function.prototype.toString,jc=new Map;function be(t,e){try{return qc(t,e)}finally{jc.clear()}}function qc(t,e){if(t===e)return!0;let r=Xf.call(t),n=Xf.call(e);if(r!==n)return!1;switch(r){case"[object Array]":if(t.length!==e.length)return!1;case"[object Object]":{if(rp(t,e))return!0;let i=tp(t),a=tp(e),o=i.length;if(o!==a.length)return!1;for(let s=0;s<o;++s)if(!I1.call(e,i[s]))return!1;for(let s=0;s<o;++s){let u=i[s];if(!qc(t[u],e[u]))return!1}return!0}case"[object Error]":return t.name===e.name&&t.message===e.message;case"[object Number]":if(t!==t)return e!==e;case"[object Boolean]":case"[object Date]":return+t==+e;case"[object RegExp]":case"[object String]":return t==`${e}`;case"[object Map]":case"[object Set]":{if(t.size!==e.size)return!1;if(rp(t,e))return!0;let i=t.entries(),a=r==="[object Map]";for(;;){let o=i.next();if(o.done)break;let[s,u]=o.value;if(!e.has(s)||a&&!qc(u,e.get(s)))return!1}return!0}case"[object Uint16Array]":case"[object Uint8Array]":case"[object Uint32Array]":case"[object Int32Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object ArrayBuffer]":t=new Uint8Array(t),e=new Uint8Array(e);case"[object DataView]":{let i=t.byteLength;if(i===e.byteLength)for(;i--&&t[i]===e[i];);return i===-1}case"[object AsyncFunction]":case"[object GeneratorFunction]":case"[object AsyncGeneratorFunction]":case"[object Function]":{let i=ep.call(t);return i!==ep.call(e)?!1:!N1(i,D1)}}return!1}function tp(t){return Object.keys(t).filter(O1,t)}function O1(t){return this[t]!==void 0}var D1="{ [native code] }";function N1(t,e){let r=t.length-e.length;return r>=0&&t.indexOf(e,r)===r}function rp(t,e){let r=jc.get(t);if(r){if(r.has(e))return!0}else jc.set(t,r=new Set);return r.add(e),!1}var R1=function(){return Object.create(null)},np=Array.prototype,P1=np.forEach,L1=np.slice,Bt=function(){function t(e,r){e===void 0&&(e=!0),r===void 0&&(r=R1),this.weakness=e,this.makeData=r}return t.prototype.lookup=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return this.lookupArray(e)},t.prototype.lookupArray=function(e){var r=this;return P1.call(e,function(n){return r=r.getChildTrie(n)}),r.data||(r.data=this.makeData(L1.call(e)))},t.prototype.getChildTrie=function(e){var r=this.weakness&&$1(e)?this.weak||(this.weak=new WeakMap):this.strong||(this.strong=new Map),n=r.get(e);return n||r.set(e,n=new t(this.weakness,this.makeData)),n},t}();function $1(t){switch(typeof t){case"object":if(t===null)break;case"function":return!0}return!1}var ze=null,ip={},F1=1,M1=()=>class{constructor(){this.id=["slot",F1++,Date.now(),Math.random().toString(36).slice(2)].join(":")}hasValue(){for(let e=ze;e;e=e.parent)if(this.id in e.slots){let r=e.slots[this.id];if(r===ip)break;return e!==ze&&(ze.slots[this.id]=r),!0}return ze&&(ze.slots[this.id]=ip),!1}getValue(){if(this.hasValue())return ze.slots[this.id]}withValue(e,r,n,i){let a={__proto__:null,[this.id]:e},o=ze;ze={parent:o,slots:a};try{return r.apply(i,n)}finally{ze=o}}static bind(e){let r=ze;return function(){let n=ze;try{return ze=r,e.apply(this,arguments)}finally{ze=n}}}static noContext(e,r,n){if(ze){let i=ze;try{return ze=null,e.apply(n,r)}finally{ze=i}}else return e.apply(n,r)}};function ap(t){try{return t()}catch{}}var Bc="@wry/context:Slot",U1=ap(()=>globalThis)||ap(()=>global)||Object.create(null),op=U1,Zn=op[Bc]||Array[Bc]||function(t){try{Object.defineProperty(op,Bc,{value:t,enumerable:!1,writable:!1,configurable:!0})}finally{return t}}(M1());var{bind:j1,noContext:q1}=Zn;function B1(){}var V1=function(){function t(e,r){e===void 0&&(e=1/0),r===void 0&&(r=B1),this.max=e,this.dispose=r,this.map=new Map,this.newest=null,this.oldest=null}return t.prototype.has=function(e){return this.map.has(e)},t.prototype.get=function(e){var r=this.getNode(e);return r&&r.value},t.prototype.getNode=function(e){var r=this.map.get(e);if(r&&r!==this.newest){var n=r.older,i=r.newer;i&&(i.older=n),n&&(n.newer=i),r.older=this.newest,r.older.newer=r,r.newer=null,this.newest=r,r===this.oldest&&(this.oldest=i)}return r},t.prototype.set=function(e,r){var n=this.getNode(e);return n?n.value=r:(n={key:e,value:r,newer:null,older:this.newest},this.newest&&(this.newest.newer=n),this.newest=n,this.oldest=this.oldest||n,this.map.set(e,n),n.value)},t.prototype.clean=function(){for(;this.oldest&&this.map.size>this.max;)this.delete(this.oldest.key)},t.prototype.delete=function(e){var r=this.map.get(e);return r?(r===this.newest&&(this.newest=r.older),r===this.oldest&&(this.oldest=r.newer),r.newer&&(r.newer.older=r.older),r.older&&(r.older.newer=r.newer),this.map.delete(e),this.dispose(r.value,e),!0):!1},t}(),go=new Zn,Vc,z1=Object.prototype.hasOwnProperty,Qc=(Vc=Array.from,Vc===void 0?function(t){var e=[];return t.forEach(function(r){return e.push(r)}),e}:Vc);function mo(t){var e=t.unsubscribe;typeof e=="function"&&(t.unsubscribe=void 0,e())}var Hi=[],Q1=100;function Yn(t,e){if(!t)throw new Error(e||"assertion failure")}function G1(t,e){var r=t.length;return r>0&&r===e.length&&t[r-1]===e[r-1]}function cp(t){switch(t.length){case 0:throw new Error("unknown value");case 1:return t[0];case 2:throw t[1]}}function H1(t){return t.slice(0)}var W1=function(){function t(e){this.fn=e,this.parents=new Set,this.childValues=new Map,this.dirtyChildren=null,this.dirty=!0,this.recomputing=!1,this.value=[],this.deps=null,++t.count}return t.prototype.peek=function(){if(this.value.length===1&&!Sr(this))return sp(this),this.value[0]},t.prototype.recompute=function(e){return Yn(!this.recomputing,"already recomputing"),sp(this),Sr(this)?K1(this,e):cp(this.value)},t.prototype.setDirty=function(){this.dirty||(this.dirty=!0,this.value.length=0,up(this),mo(this))},t.prototype.dispose=function(){var e=this;this.setDirty(),hp(this),Gc(this,function(r,n){r.setDirty(),mp(r,e)})},t.prototype.forget=function(){this.dispose()},t.prototype.dependOn=function(e){e.add(this),this.deps||(this.deps=Hi.pop()||new Set),this.deps.add(e)},t.prototype.forgetDeps=function(){var e=this;this.deps&&(Qc(this.deps).forEach(function(r){return r.delete(e)}),this.deps.clear(),Hi.push(this.deps),this.deps=null)},t.count=0,t}();function sp(t){var e=go.getValue();if(e)return t.parents.add(e),e.childValues.has(t)||e.childValues.set(t,[]),Sr(t)?fp(e,t):pp(e,t),e}function K1(t,e){return hp(t),go.withValue(t,Z1,[t,e]),J1(t,e)&&Y1(t),cp(t.value)}function Z1(t,e){t.recomputing=!0,t.value.length=0;try{t.value[0]=t.fn.apply(null,e)}catch(r){t.value[1]=r}t.recomputing=!1}function Sr(t){return t.dirty||!!(t.dirtyChildren&&t.dirtyChildren.size)}function Y1(t){t.dirty=!1,!Sr(t)&&lp(t)}function up(t){Gc(t,fp)}function lp(t){Gc(t,pp)}function Gc(t,e){var r=t.parents.size;if(r)for(var n=Qc(t.parents),i=0;i<r;++i)e(n[i],t)}function fp(t,e){Yn(t.childValues.has(e)),Yn(Sr(e));var r=!Sr(t);if(!t.dirtyChildren)t.dirtyChildren=Hi.pop()||new Set;else if(t.dirtyChildren.has(e))return;t.dirtyChildren.add(e),r&&up(t)}function pp(t,e){Yn(t.childValues.has(e)),Yn(!Sr(e));var r=t.childValues.get(e);r.length===0?t.childValues.set(e,H1(e.value)):G1(r,e.value)||t.setDirty(),dp(t,e),!Sr(t)&&lp(t)}function dp(t,e){var r=t.dirtyChildren;r&&(r.delete(e),r.size===0&&(Hi.length<Q1&&Hi.push(r),t.dirtyChildren=null))}function hp(t){t.childValues.size>0&&t.childValues.forEach(function(e,r){mp(t,r)}),t.forgetDeps(),Yn(t.dirtyChildren===null)}function mp(t,e){e.parents.delete(t),t.childValues.delete(e),dp(t,e)}function J1(t,e){if(typeof t.subscribe=="function")try{mo(t),t.unsubscribe=t.subscribe.apply(null,e)}catch{return t.setDirty(),!1}return!0}var X1={setDirty:!0,dispose:!0,forget:!0};function yo(t){var e=new Map,r=t&&t.subscribe;function n(i){var a=go.getValue();if(a){var o=e.get(i);o||e.set(i,o=new Set),a.dependOn(o),typeof r=="function"&&(mo(o),o.unsubscribe=r(i))}}return n.dirty=function(a,o){var s=e.get(a);if(s){var u=o&&z1.call(X1,o)?o:"setDirty";Qc(s).forEach(function(c){return c[u]()}),e.delete(a),mo(s)}},n}function gp(){var t=new Bt(typeof WeakMap=="function");return function(){return t.lookupArray(arguments)}}var h6=gp(),zc=new Set;function on(t,e){e===void 0&&(e=Object.create(null));var r=new V1(e.max||Math.pow(2,16),function(c){return c.dispose()}),n=e.keyArgs,i=e.makeCacheKey||gp(),a=function(){var c=i.apply(null,n?n.apply(null,arguments):arguments);if(c===void 0)return t.apply(null,arguments);var l=r.get(c);l||(r.set(c,l=new W1(t)),l.subscribe=e.subscribe,l.forget=function(){return r.delete(c)});var d=l.recompute(Array.prototype.slice.call(arguments));return r.set(c,l),zc.add(r),go.hasValue()||(zc.forEach(function(p){return p.clean()}),zc.clear()),d};Object.defineProperty(a,"size",{get:function(){return r.map.size},configurable:!1,enumerable:!1});function o(c){var l=r.get(c);l&&l.setDirty()}a.dirtyKey=o,a.dirty=function(){o(i.apply(null,arguments))};function s(c){var l=r.get(c);if(l)return l.peek()}a.peekKey=s,a.peek=function(){return s(i.apply(null,arguments))};function u(c){return r.delete(c)}return a.forgetKey=u,a.forget=function(){return u(i.apply(null,arguments))},a.makeCacheKey=i,a.getKey=n?function(){return i.apply(null,n.apply(null,arguments))}:i,Object.freeze(a)}var Hc=function(){function t(){this.getFragmentDoc=on(dc)}return t.prototype.batch=function(e){var r=this,n=typeof e.optimistic=="string"?e.optimistic:e.optimistic===!1?null:void 0,i;return this.performTransaction(function(){return i=e.update(r)},n),i},t.prototype.recordOptimisticTransaction=function(e,r){this.performTransaction(e,r)},t.prototype.transformDocument=function(e){return e},t.prototype.transformForLink=function(e){return e},t.prototype.identify=function(e){},t.prototype.gc=function(){return[]},t.prototype.modify=function(e){return!1},t.prototype.readQuery=function(e,r){return r===void 0&&(r=!!e.optimistic),this.read(_(_({},e),{rootId:e.id||"ROOT_QUERY",optimistic:r}))},t.prototype.readFragment=function(e,r){return r===void 0&&(r=!!e.optimistic),this.read(_(_({},e),{query:this.getFragmentDoc(e.fragment,e.fragmentName),rootId:e.id,optimistic:r}))},t.prototype.writeQuery=function(e){var r=e.id,n=e.data,i=Ut(e,["id","data"]);return this.write(Object.assign(i,{dataId:r||"ROOT_QUERY",result:n}))},t.prototype.writeFragment=function(e){var r=e.id,n=e.data,i=e.fragment,a=e.fragmentName,o=Ut(e,["id","data","fragment","fragmentName"]);return this.write(Object.assign(o,{query:this.getFragmentDoc(i,a),dataId:r,result:n}))},t.prototype.updateQuery=function(e,r){return this.batch({update:function(n){var i=n.readQuery(e),a=r(i);return a==null?i:(n.writeQuery(_(_({},e),{data:a})),a)}})},t.prototype.updateFragment=function(e,r){return this.batch({update:function(n){var i=n.readFragment(e),a=r(i);return a==null?i:(n.writeFragment(_(_({},e),{data:a})),a)}})},t}();var Wi=function(t){xe(e,t);function e(r,n,i,a){var o,s=t.call(this,r)||this;if(s.message=r,s.path=n,s.query=i,s.variables=a,Array.isArray(s.path)){s.missing=s.message;for(var u=s.path.length-1;u>=0;--u)s.missing=(o={},o[s.path[u]]=s.missing,o)}else s.missing=s.path;return s.__proto__=e.prototype,s}return e}(Error);var ke=Object.prototype.hasOwnProperty;function Ki(t){return t==null}function bo(t,e){var r=t.__typename,n=t.id,i=t._id;if(typeof r=="string"&&(e&&(e.keyObject=Ki(n)?Ki(i)?void 0:{_id:i}:{id:n}),Ki(n)&&!Ki(i)&&(n=i),!Ki(n)))return"".concat(r,":").concat(typeof n=="number"||typeof n=="string"?n:JSON.stringify(n))}var yp={dataIdFromObject:bo,addTypename:!0,resultCaching:!0,canonizeResults:!1};function vp(t){return wr(yp,t)}function _o(t){var e=t.canonizeResults;return e===void 0?yp.canonizeResults:e}function bp(t,e){return K(e)?t.get(e.__ref,"__typename"):e&&e.__typename}var Wc=/^[_a-z][_0-9a-z]*/i;function Dt(t){var e=t.match(Wc);return e?e[0]:t}function vo(t,e,r){return ee(e)?ue(e)?e.every(function(n){return vo(t,n,r)}):t.selections.every(function(n){if(pt(n)&&er(n,r)){var i=_t(n);return ke.call(e,i)&&(!n.selectionSet||vo(n.selectionSet,e[i],r))}return!0}):!1}function Cr(t){return ee(t)&&!K(t)&&!ue(t)}function _p(){return new it}function wo(t,e){var r=Jr(en(t));return{fragmentMap:r,lookupFragment:function(n){var i=r[n];return!i&&e&&(i=e.lookup(n)),i||null}}}var So=Object.create(null),Kc=function(){return So},wp=Object.create(null),Jn=function(){function t(e,r){var n=this;this.policies=e,this.group=r,this.data=Object.create(null),this.rootIds=Object.create(null),this.refs=Object.create(null),this.getFieldValue=function(i,a){return qi(K(i)?n.get(i.__ref,a):i&&i[a])},this.canRead=function(i){return K(i)?n.has(i.__ref):typeof i=="object"},this.toReference=function(i,a){if(typeof i=="string")return jt(i);if(K(i))return i;var o=n.policies.identify(i)[0];if(o){var s=jt(o);return a&&n.merge(o,i),s}}}return t.prototype.toObject=function(){return _({},this.data)},t.prototype.has=function(e){return this.lookup(e,!0)!==void 0},t.prototype.get=function(e,r){if(this.group.depend(e,r),ke.call(this.data,e)){var n=this.data[e];if(n&&ke.call(n,r))return n[r]}if(r==="__typename"&&ke.call(this.policies.rootTypenamesById,e))return this.policies.rootTypenamesById[e];if(this instanceof Er)return this.parent.get(e,r)},t.prototype.lookup=function(e,r){if(r&&this.group.depend(e,"__exists"),ke.call(this.data,e))return this.data[e];if(this instanceof Er)return this.parent.lookup(e,r);if(this.policies.rootTypenamesById[e])return Object.create(null)},t.prototype.merge=function(e,r){var n=this,i;K(e)&&(e=e.__ref),K(r)&&(r=r.__ref);var a=typeof e=="string"?this.lookup(i=e):e,o=typeof r=="string"?this.lookup(i=r):r;if(!!o){__DEV__?I(typeof i=="string","store.merge expects a string ID"):I(typeof i=="string",1);var s=new it(tg).merge(a,o);if(this.data[i]=s,s!==a&&(delete this.refs[i],this.group.caching)){var u=Object.create(null);a||(u.__exists=1),Object.keys(o).forEach(function(c){if(!a||a[c]!==s[c]){u[c]=1;var l=Dt(c);l!==c&&!n.policies.hasKeyArgs(s.__typename,l)&&(u[l]=1),s[c]===void 0&&!(n instanceof Er)&&delete s[c]}}),u.__typename&&!(a&&a.__typename)&&this.policies.rootTypenamesById[i]===s.__typename&&delete u.__typename,Object.keys(u).forEach(function(c){return n.group.dirty(i,c)})}}},t.prototype.modify=function(e,r){var n=this,i=this.lookup(e);if(i){var a=Object.create(null),o=!1,s=!0,u={DELETE:So,INVALIDATE:wp,isReference:K,toReference:this.toReference,canRead:this.canRead,readField:function(c,l){return n.policies.readField(typeof c=="string"?{fieldName:c,from:l||jt(e)}:c,{store:n})}};if(Object.keys(i).forEach(function(c){var l=Dt(c),d=i[c];if(d!==void 0){var p=typeof r=="function"?r:r[c]||r[l];if(p){var f=p===Kc?So:p(qi(d),_(_({},u),{fieldName:l,storeFieldName:c,storage:n.getStorage(e,c)}));f===wp?n.group.dirty(e,c):(f===So&&(f=void 0),f!==d&&(a[c]=f,o=!0,d=f))}d!==void 0&&(s=!1)}}),o)return this.merge(e,a),s&&(this instanceof Er?this.data[e]=void 0:delete this.data[e],this.group.dirty(e,"__exists")),!0}return!1},t.prototype.delete=function(e,r,n){var i,a=this.lookup(e);if(a){var o=this.getFieldValue(a,"__typename"),s=r&&n?this.policies.getStoreFieldName({typename:o,fieldName:r,args:n}):r;return this.modify(e,s?(i={},i[s]=Kc,i):Kc)}return!1},t.prototype.evict=function(e,r){var n=!1;return e.id&&(ke.call(this.data,e.id)&&(n=this.delete(e.id,e.fieldName,e.args)),this instanceof Er&&this!==r&&(n=this.parent.evict(e,r)||n),(e.fieldName||n)&&this.group.dirty(e.id,e.fieldName||"__exists")),n},t.prototype.clear=function(){this.replace(null)},t.prototype.extract=function(){var e=this,r=this.toObject(),n=[];return this.getRootIdSet().forEach(function(i){ke.call(e.policies.rootTypenamesById,i)||n.push(i)}),n.length&&(r.__META={extraRootIds:n.sort()}),r},t.prototype.replace=function(e){var r=this;if(Object.keys(this.data).forEach(function(a){e&&ke.call(e,a)||r.delete(a)}),e){var n=e.__META,i=Ut(e,["__META"]);Object.keys(i).forEach(function(a){r.merge(a,i[a])}),n&&n.extraRootIds.forEach(this.retain,this)}},t.prototype.retain=function(e){return this.rootIds[e]=(this.rootIds[e]||0)+1},t.prototype.release=function(e){if(this.rootIds[e]>0){var r=--this.rootIds[e];return r||delete this.rootIds[e],r}return 0},t.prototype.getRootIdSet=function(e){return e===void 0&&(e=new Set),Object.keys(this.rootIds).forEach(e.add,e),this instanceof Er?this.parent.getRootIdSet(e):Object.keys(this.policies.rootTypenamesById).forEach(e.add,e),e},t.prototype.gc=function(){var e=this,r=this.getRootIdSet(),n=this.toObject();r.forEach(function(o){ke.call(n,o)&&(Object.keys(e.findChildRefIds(o)).forEach(r.add,r),delete n[o])});var i=Object.keys(n);if(i.length){for(var a=this;a instanceof Er;)a=a.parent;i.forEach(function(o){return a.delete(o)})}return i},t.prototype.findChildRefIds=function(e){if(!ke.call(this.refs,e)){var r=this.refs[e]=Object.create(null),n=this.data[e];if(!n)return r;var i=new Set([n]);i.forEach(function(a){K(a)&&(r[a.__ref]=!0),ee(a)&&Object.keys(a).forEach(function(o){var s=a[o];ee(s)&&i.add(s)})})}return this.refs[e]},t.prototype.makeCacheKey=function(){return this.group.keyMaker.lookupArray(arguments)},t}();var Sp=function(){function t(e,r){r===void 0&&(r=null),this.caching=e,this.parent=r,this.d=null,this.resetCaching()}return t.prototype.resetCaching=function(){this.d=this.caching?yo():null,this.keyMaker=new Bt(wt)},t.prototype.depend=function(e,r){if(this.d){this.d(Zc(e,r));var n=Dt(r);n!==r&&this.d(Zc(e,n)),this.parent&&this.parent.depend(e,r)}},t.prototype.dirty=function(e,r){this.d&&this.d.dirty(Zc(e,r),r==="__exists"?"forget":"setDirty")},t}();function Zc(t,e){return e+"#"+t}function Yc(t,e){sn(t)&&t.group.depend(e,"__exists")}(function(t){var e=function(r){xe(n,r);function n(i){var a=i.policies,o=i.resultCaching,s=o===void 0?!0:o,u=i.seed,c=r.call(this,a,new Sp(s))||this;return c.stump=new eg(c),c.storageTrie=new Bt(wt),u&&c.replace(u),c}return n.prototype.addLayer=function(i,a){return this.stump.addLayer(i,a)},n.prototype.removeLayer=function(){return this},n.prototype.getStorage=function(){return this.storageTrie.lookupArray(arguments)},n}(t);t.Root=e})(Jn||(Jn={}));var Er=function(t){xe(e,t);function e(r,n,i,a){var o=t.call(this,n.policies,a)||this;return o.id=r,o.parent=n,o.replay=i,o.group=a,i(o),o}return e.prototype.addLayer=function(r,n){return new e(r,this,n,this.group)},e.prototype.removeLayer=function(r){var n=this,i=this.parent.removeLayer(r);return r===this.id?(this.group.caching&&Object.keys(this.data).forEach(function(a){var o=n.data[a],s=i.lookup(a);s?o?o!==s&&Object.keys(o).forEach(function(u){be(o[u],s[u])||n.group.dirty(a,u)}):(n.group.dirty(a,"__exists"),Object.keys(s).forEach(function(u){n.group.dirty(a,u)})):n.delete(a)}),i):i===this.parent?this:i.addLayer(this.id,this.replay)},e.prototype.toObject=function(){return _(_({},this.parent.toObject()),this.data)},e.prototype.findChildRefIds=function(r){var n=this.parent.findChildRefIds(r);return ke.call(this.data,r)?_(_({},n),t.prototype.findChildRefIds.call(this,r)):n},e.prototype.getStorage=function(){for(var r=this.parent;r.parent;)r=r.parent;return r.getStorage.apply(r,arguments)},e}(Jn),eg=function(t){xe(e,t);function e(r){return t.call(this,"EntityStore.Stump",r,function(){},new Sp(r.group.caching,r.group))||this}return e.prototype.removeLayer=function(){return this},e.prototype.merge=function(){return this.parent.merge.apply(this.parent,arguments)},e}(Er);function tg(t,e,r){var n=t[r],i=e[r];return be(n,i)?n:i}function sn(t){return!!(t instanceof Jn&&t.group.caching)}function rg(t){return ee(t)?ue(t)?t.slice(0):_({__proto__:Object.getPrototypeOf(t)},t):t}var Co=function(){function t(){this.known=new(kf?WeakSet:Set),this.pool=new Bt(wt),this.passes=new WeakMap,this.keysByJSON=new Map,this.empty=this.admit({})}return t.prototype.isKnown=function(e){return ee(e)&&this.known.has(e)},t.prototype.pass=function(e){if(ee(e)){var r=rg(e);return this.passes.set(r,e),r}return e},t.prototype.admit=function(e){var r=this;if(ee(e)){var n=this.passes.get(e);if(n)return n;var i=Object.getPrototypeOf(e);switch(i){case Array.prototype:{if(this.known.has(e))return e;var a=e.map(this.admit,this),o=this.pool.lookupArray(a);return o.array||(this.known.add(o.array=a),__DEV__&&Object.freeze(a)),o.array}case null:case Object.prototype:{if(this.known.has(e))return e;var s=Object.getPrototypeOf(e),u=[s],c=this.sortedKeys(e);u.push(c.json);var l=u.length;c.sorted.forEach(function(f){u.push(r.admit(e[f]))});var o=this.pool.lookupArray(u);if(!o.object){var d=o.object=Object.create(s);this.known.add(d),c.sorted.forEach(function(f,h){d[f]=u[l+h]}),__DEV__&&Object.freeze(d)}return o.object}}}return e},t.prototype.sortedKeys=function(e){var r=Object.keys(e),n=this.pool.lookupArray(r);if(!n.keys){r.sort();var i=JSON.stringify(r);(n.keys=this.keysByJSON.get(i))||this.keysByJSON.set(i,n.keys={sorted:r,json:i})}return n.keys},t}();var dt=Object.assign(function(t){if(ee(t)){Jc===void 0&&Cp();var e=Jc.admit(t),r=Xc.get(e);return r===void 0&&Xc.set(e,r=JSON.stringify(e)),r}return JSON.stringify(t)},{reset:Cp}),Jc,Xc;function Cp(){Jc=new Co,Xc=new(wt?WeakMap:Map)}function Ep(t){return[t.selectionSet,t.objectOrReference,t.context,t.context.canonizeResults]}var xp=function(){function t(e){var r=this;this.knownResults=new(wt?WeakMap:Map),this.config=wr(e,{addTypename:e.addTypename!==!1,canonizeResults:_o(e)}),this.canon=e.canon||new Co,this.executeSelectionSet=on(function(n){var i,a=n.context.canonizeResults,o=Ep(n);o[3]=!a;var s=(i=r.executeSelectionSet).peek.apply(i,o);return s?a?_(_({},s),{result:r.canon.admit(s.result)}):s:(Yc(n.context.store,n.enclosingRef.__ref),r.execSelectionSetImpl(n))},{max:this.config.resultCacheMaxSize,keyArgs:Ep,makeCacheKey:function(n,i,a,o){if(sn(a.store))return a.store.makeCacheKey(n,K(i)?i.__ref:i,a.varString,o)}}),this.executeSubSelectedArray=on(function(n){return Yc(n.context.store,n.enclosingRef.__ref),r.execSubSelectedArrayImpl(n)},{max:this.config.resultCacheMaxSize,makeCacheKey:function(n){var i=n.field,a=n.array,o=n.context;if(sn(o.store))return o.store.makeCacheKey(i,a,o.varString)}})}return t.prototype.resetCanon=function(){this.canon=new Co},t.prototype.diffQueryAgainstStore=function(e){var r=e.store,n=e.query,i=e.rootId,a=i===void 0?"ROOT_QUERY":i,o=e.variables,s=e.returnPartialData,u=s===void 0?!0:s,c=e.canonizeResults,l=c===void 0?this.config.canonizeResults:c,d=this.config.cache.policies;o=_(_({},rn(Mi(n))),o);var p=jt(a),f=this.executeSelectionSet({selectionSet:tn(n).selectionSet,objectOrReference:p,enclosingRef:p,context:_({store:r,query:n,policies:d,variables:o,varString:dt(o),canonizeResults:l},wo(n,this.config.fragments))}),h;if(f.missing&&(h=[new Wi(ng(f.missing),f.missing,n,o)],!u))throw h[0];return{result:f.result,complete:!h,missing:h}},t.prototype.isFresh=function(e,r,n,i){if(sn(i.store)&&this.knownResults.get(e)===n){var a=this.executeSelectionSet.peek(n,r,i,this.canon.isKnown(e));if(a&&e===a.result)return!0}return!1},t.prototype.execSelectionSetImpl=function(e){var r=this,n=e.selectionSet,i=e.objectOrReference,a=e.enclosingRef,o=e.context;if(K(i)&&!o.policies.rootTypenamesById[i.__ref]&&!o.store.has(i.__ref))return{result:this.canon.empty,missing:"Dangling reference to missing ".concat(i.__ref," object")};var s=o.variables,u=o.policies,c=o.store,l=c.getFieldValue(i,"__typename"),d=[],p,f=new it;this.config.addTypename&&typeof l=="string"&&!u.rootIdsByTypename[l]&&d.push({__typename:l});function h(v,m){var A;return v.missing&&(p=f.merge(p,(A={},A[m]=v.missing,A))),v.result}var g=new Set(n.selections);g.forEach(function(v){var m,A;if(!!er(v,s))if(pt(v)){var D=u.readField({fieldName:v.name.value,field:v,variables:o.variables,from:i},o),E=_t(v);D===void 0?nn.added(v)||(p=f.merge(p,(m={},m[E]="Can't find field '".concat(v.name.value,"' on ").concat(K(i)?i.__ref+" object":"object "+JSON.stringify(i,null,2)),m))):ue(D)?D=h(r.executeSubSelectedArray({field:v,array:D,enclosingRef:a,context:o}),E):v.selectionSet?D!=null&&(D=h(r.executeSelectionSet({selectionSet:v.selectionSet,objectOrReference:D,enclosingRef:K(D)?D:a,context:o}),E)):o.canonizeResults&&(D=r.canon.pass(D)),D!==void 0&&d.push((A={},A[E]=D,A))}else{var O=Xr(v,o.lookupFragment);if(!O&&v.kind===Oe.FRAGMENT_SPREAD)throw __DEV__?new V("No fragment named ".concat(v.name.value)):new V(5);O&&u.fragmentMatches(O,l)&&O.selectionSet.selections.forEach(g.add,g)}});var y=Ui(d),S={result:y,missing:p},b=o.canonizeResults?this.canon.admit(S):qi(S);return b.result&&this.knownResults.set(b.result,n),b},t.prototype.execSubSelectedArrayImpl=function(e){var r=this,n=e.field,i=e.array,a=e.enclosingRef,o=e.context,s,u=new it;function c(l,d){var p;return l.missing&&(s=u.merge(s,(p={},p[d]=l.missing,p))),l.result}return n.selectionSet&&(i=i.filter(o.store.canRead)),i=i.map(function(l,d){return l===null?null:ue(l)?c(r.executeSubSelectedArray({field:n,array:l,enclosingRef:a,context:o}),d):n.selectionSet?c(r.executeSelectionSet({selectionSet:n.selectionSet,objectOrReference:l,enclosingRef:K(l)?l:a,context:o}),d):(__DEV__&&ig(o.store,n,l),l)}),{result:o.canonizeResults?this.canon.admit(i):i,missing:s}},t}();function ng(t){try{JSON.stringify(t,function(e,r){if(typeof r=="string")throw r;return r})}catch(e){return e}}function ig(t,e,r){if(!e.selectionSet){var n=new Set([r]);n.forEach(function(i){ee(i)&&(__DEV__?I(!K(i),"Missing selection set for object of type ".concat(bp(t,i)," returned for query field ").concat(e.name.value)):I(!K(i),6),Object.values(i).forEach(n.add,n))})}}var Xn=new Zn,kp=new WeakMap;function Zi(t){var e=kp.get(t);return e||kp.set(t,e={vars:new Set,dep:yo()}),e}function eu(t){Zi(t).vars.forEach(function(e){return e.forgetCache(t)})}function Tp(t){Zi(t).vars.forEach(function(e){return e.attachCache(t)})}function Eo(t){var e=new Set,r=new Set,n=function(a){if(arguments.length>0){if(t!==a){t=a,e.forEach(function(u){Zi(u).dep.dirty(n),ag(u)});var o=Array.from(r);r.clear(),o.forEach(function(u){return u(t)})}}else{var s=Xn.getValue();s&&(i(s),Zi(s).dep(n))}return t};n.onNextChange=function(a){return r.add(a),function(){r.delete(a)}};var i=n.attachCache=function(a){return e.add(a),Zi(a).vars.add(n),n};return n.forgetCache=function(a){return e.delete(a)},n}function ag(t){t.broadcastWatches&&t.broadcastWatches()}var Ap=Object.create(null);function tu(t){var e=JSON.stringify(t);return Ap[e]||(Ap[e]=Object.create(null))}function ru(t){var e=tu(t);return e.keyFieldsFn||(e.keyFieldsFn=function(r,n){var i=function(o,s){return n.readField(s,o)},a=n.keyObject=iu(t,function(o){var s=ei(n.storeObject,o,i);return s===void 0&&r!==n.storeObject&&ke.call(r,o[0])&&(s=ei(r,o,Op)),__DEV__?I(s!==void 0,"Missing field '".concat(o.join("."),"' while extracting keyFields from ").concat(JSON.stringify(r))):I(s!==void 0,2),s});return"".concat(n.typename,":").concat(JSON.stringify(a))})}function nu(t){var e=tu(t);return e.keyArgsFn||(e.keyArgsFn=function(r,n){var i=n.field,a=n.variables,o=n.fieldName,s=iu(t,function(c){var l=c[0],d=l.charAt(0);if(d==="@"){if(i&&Re(i.directives)){var p=l.slice(1),f=i.directives.find(function(S){return S.name.value===p}),h=f&&tr(f,a);return h&&ei(h,c.slice(1))}return}if(d==="$"){var g=l.slice(1);if(a&&ke.call(a,g)){var y=c.slice(0);return y[0]=g,ei(a,y)}return}if(r)return ei(r,c)}),u=JSON.stringify(s);return(r||u!=="{}")&&(o+=":"+u),o})}function iu(t,e){var r=new it;return Ip(t).reduce(function(n,i){var a,o=e(i);if(o!==void 0){for(var s=i.length-1;s>=0;--s)o=(a={},a[i[s]]=o,a);n=r.merge(n,o)}return n},Object.create(null))}function Ip(t){var e=tu(t);if(!e.paths){var r=e.paths=[],n=[];t.forEach(function(i,a){ue(i)?(Ip(i).forEach(function(o){return r.push(n.concat(o))}),n.length=0):(n.push(i),ue(t[a+1])||(r.push(n.slice(0)),n.length=0))})}return e.paths}function Op(t,e){return t[e]}function ei(t,e,r){return r=r||Op,Dp(e.reduce(function n(i,a){return ue(i)?i.map(function(o){return n(o,a)}):i&&r(i,a)},t))}function Dp(t){return ee(t)?ue(t)?t.map(Dp):iu(Object.keys(t).sort(),function(e){return ei(t,e)}):t}$i.setStringify(dt);function au(t){return t.args!==void 0?t.args:t.field?tr(t.field,t.variables):null}var og=function(){},Np=function(t,e){return e.fieldName},Rp=function(t,e,r){var n=r.mergeObjects;return n(t,e)},Pp=function(t,e){return e},$p=function(){function t(e){this.config=e,this.typePolicies=Object.create(null),this.toBeAdded=Object.create(null),this.supertypeMap=new Map,this.fuzzySubtypes=new Map,this.rootIdsByTypename=Object.create(null),this.rootTypenamesById=Object.create(null),this.usingPossibleTypes=!1,this.config=_({dataIdFromObject:bo},e),this.cache=this.config.cache,this.setRootTypename("Query"),this.setRootTypename("Mutation"),this.setRootTypename("Subscription"),e.possibleTypes&&this.addPossibleTypes(e.possibleTypes),e.typePolicies&&this.addTypePolicies(e.typePolicies)}return t.prototype.identify=function(e,r){var n,i=this,a=r&&(r.typename||((n=r.storeObject)===null||n===void 0?void 0:n.__typename))||e.__typename;if(a===this.rootTypenamesById.ROOT_QUERY)return["ROOT_QUERY"];for(var o=r&&r.storeObject||e,s=_(_({},r),{typename:a,storeObject:o,readField:r&&r.readField||function(){var p=xo(arguments,o);return i.readField(p,{store:i.cache.data,variables:p.variables})}}),u,c=a&&this.getTypePolicy(a),l=c&&c.keyFn||this.config.dataIdFromObject;l;){var d=l(e,s);if(ue(d))l=ru(d);else{u=d;break}}return u=u?String(u):void 0,s.keyObject?[u,s.keyObject]:[u]},t.prototype.addTypePolicies=function(e){var r=this;Object.keys(e).forEach(function(n){var i=e[n],a=i.queryType,o=i.mutationType,s=i.subscriptionType,u=Ut(i,["queryType","mutationType","subscriptionType"]);a&&r.setRootTypename("Query",n),o&&r.setRootTypename("Mutation",n),s&&r.setRootTypename("Subscription",n),ke.call(r.toBeAdded,n)?r.toBeAdded[n].push(u):r.toBeAdded[n]=[u]})},t.prototype.updateTypePolicy=function(e,r){var n=this,i=this.getTypePolicy(e),a=r.keyFields,o=r.fields;function s(u,c){u.merge=typeof c=="function"?c:c===!0?Rp:c===!1?Pp:u.merge}s(i,r.merge),i.keyFn=a===!1?og:ue(a)?ru(a):typeof a=="function"?a:i.keyFn,o&&Object.keys(o).forEach(function(u){var c=n.getFieldPolicy(e,u,!0),l=o[u];if(typeof l=="function")c.read=l;else{var d=l.keyArgs,p=l.read,f=l.merge;c.keyFn=d===!1?Np:ue(d)?nu(d):typeof d=="function"?d:c.keyFn,typeof p=="function"&&(c.read=p),s(c,f)}c.read&&c.merge&&(c.keyFn=c.keyFn||Np)})},t.prototype.setRootTypename=function(e,r){r===void 0&&(r=e);var n="ROOT_"+e.toUpperCase(),i=this.rootTypenamesById[n];r!==i&&(__DEV__?I(!i||i===e,"Cannot change root ".concat(e," __typename more than once")):I(!i||i===e,3),i&&delete this.rootIdsByTypename[i],this.rootIdsByTypename[r]=n,this.rootTypenamesById[n]=r)},t.prototype.addPossibleTypes=function(e){var r=this;this.usingPossibleTypes=!0,Object.keys(e).forEach(function(n){r.getSupertypeSet(n,!0),e[n].forEach(function(i){r.getSupertypeSet(i,!0).add(n);var a=i.match(Wc);(!a||a[0]!==i)&&r.fuzzySubtypes.set(i,new RegExp(i))})})},t.prototype.getTypePolicy=function(e){var r=this;if(!ke.call(this.typePolicies,e)){var n=this.typePolicies[e]=Object.create(null);n.fields=Object.create(null);var i=this.supertypeMap.get(e);i&&i.size&&i.forEach(function(o){var s=r.getTypePolicy(o),u=s.fields,c=Ut(s,["fields"]);Object.assign(n,c),Object.assign(n.fields,u)})}var a=this.toBeAdded[e];return a&&a.length&&a.splice(0).forEach(function(o){r.updateTypePolicy(e,o)}),this.typePolicies[e]},t.prototype.getFieldPolicy=function(e,r,n){if(e){var i=this.getTypePolicy(e).fields;return i[r]||n&&(i[r]=Object.create(null))}},t.prototype.getSupertypeSet=function(e,r){var n=this.supertypeMap.get(e);return!n&&r&&this.supertypeMap.set(e,n=new Set),n},t.prototype.fragmentMatches=function(e,r,n,i){var a=this;if(!e.typeCondition)return!0;if(!r)return!1;var o=e.typeCondition.name.value;if(r===o)return!0;if(this.usingPossibleTypes&&this.supertypeMap.has(o))for(var s=this.getSupertypeSet(r,!0),u=[s],c=function(h){var g=a.getSupertypeSet(h,!1);g&&g.size&&u.indexOf(g)<0&&u.push(g)},l=!!(n&&this.fuzzySubtypes.size),d=!1,p=0;p<u.length;++p){var f=u[p];if(f.has(o))return s.has(o)||(d&&__DEV__&&I.warn("Inferring subtype ".concat(r," of supertype ").concat(o)),s.add(o)),!0;f.forEach(c),l&&p===u.length-1&&vo(e.selectionSet,n,i)&&(l=!1,d=!0,this.fuzzySubtypes.forEach(function(h,g){var y=r.match(h);y&&y[0]===r&&c(g)}))}return!1},t.prototype.hasKeyArgs=function(e,r){var n=this.getFieldPolicy(e,r,!1);return!!(n&&n.keyFn)},t.prototype.getStoreFieldName=function(e){var r=e.typename,n=e.fieldName,i=this.getFieldPolicy(r,n,!1),a,o=i&&i.keyFn;if(o&&r)for(var s={typename:r,fieldName:n,field:e.field||null,variables:e.variables},u=au(e);o;){var c=o(u,s);if(ue(c))o=nu(c);else{a=c||n;break}}return a===void 0&&(a=e.field?mc(e.field,e.variables):$i(n,au(e))),a===!1?n:n===Dt(a)?a:n+":"+a},t.prototype.readField=function(e,r){var n=e.from;if(!!n){var i=e.field||e.fieldName;if(!!i){if(e.typename===void 0){var a=r.store.getFieldValue(n,"__typename");a&&(e.typename=a)}var o=this.getStoreFieldName(e),s=Dt(o),u=r.store.getFieldValue(n,o),c=this.getFieldPolicy(e.typename,s,!1),l=c&&c.read;if(l){var d=Lp(this,n,e,r,r.store.getStorage(K(n)?n.__ref:n,o));return Xn.withValue(this.cache,l,[u,d])}return u}}},t.prototype.getReadFunction=function(e,r){var n=this.getFieldPolicy(e,r,!1);return n&&n.read},t.prototype.getMergeFunction=function(e,r,n){var i=this.getFieldPolicy(e,r,!1),a=i&&i.merge;return!a&&n&&(i=this.getTypePolicy(n),a=i&&i.merge),a},t.prototype.runMergeFunction=function(e,r,n,i,a){var o=n.field,s=n.typename,u=n.merge;return u===Rp?Fp(i.store)(e,r):u===Pp?r:(i.overwrite&&(e=void 0),u(e,r,Lp(this,void 0,{typename:s,fieldName:o.name.value,field:o,variables:i.variables},i,a||Object.create(null))))},t}();function Lp(t,e,r,n,i){var a=t.getStoreFieldName(r),o=Dt(a),s=r.variables||n.variables,u=n.store,c=u.toReference,l=u.canRead;return{args:au(r),field:r.field||null,fieldName:o,storeFieldName:a,variables:s,isReference:K,toReference:c,storage:i,cache:t.cache,canRead:l,readField:function(){return t.readField(xo(arguments,e,s),n)},mergeObjects:Fp(n.store)}}function xo(t,e,r){var n=t[0],i=t[1],a=t.length,o;return typeof n=="string"?o={fieldName:n,from:a>1?i:e}:(o=_({},n),ke.call(o,"from")||(o.from=e)),__DEV__&&o.from===void 0&&__DEV__&&I.warn("Undefined 'from' passed to readField with arguments ".concat(Of(Array.from(t)))),o.variables===void 0&&(o.variables=r),o}function Fp(t){return function(r,n){if(ue(r)||ue(n))throw __DEV__?new V("Cannot automatically merge arrays"):new V(4);if(ee(r)&&ee(n)){var i=t.getFieldValue(r,"__typename"),a=t.getFieldValue(n,"__typename"),o=i&&a&&i!==a;if(o)return n;if(K(r)&&Cr(n))return t.merge(r.__ref,n),r;if(Cr(r)&&K(n))return t.merge(r,n.__ref),n;if(Cr(r)&&Cr(n))return _(_({},r),n)}return n}}function ou(t,e,r){var n="".concat(e).concat(r),i=t.flavors.get(n);return i||t.flavors.set(n,i=t.clientOnly===e&&t.deferred===r?t:_(_({},t),{clientOnly:e,deferred:r})),i}var qp=function(){function t(e,r,n){this.cache=e,this.reader=r,this.fragments=n}return t.prototype.writeToStore=function(e,r){var n=this,i=r.query,a=r.result,o=r.dataId,s=r.variables,u=r.overwrite,c=qt(i),l=_p();s=_(_({},rn(c)),s);var d=_(_({store:e,written:Object.create(null),merge:function(f,h){return l.merge(f,h)},variables:s,varString:dt(s)},wo(i,this.fragments)),{overwrite:!!u,incomingById:new Map,clientOnly:!1,deferred:!1,flavors:new Map}),p=this.processSelectionSet({result:a||Object.create(null),dataId:o,selectionSet:c.selectionSet,mergeTree:{map:new Map},context:d});if(!K(p))throw __DEV__?new V("Could not identify object ".concat(JSON.stringify(a))):new V(7);return d.incomingById.forEach(function(f,h){var g=f.storeObject,y=f.mergeTree,S=f.fieldNodeSet,b=jt(h);if(y&&y.map.size){var v=n.applyMerges(y,b,g,d);if(K(v))return;g=v}if(__DEV__&&!d.overwrite){var m=Object.create(null);S.forEach(function(E){E.selectionSet&&(m[E.name.value]=!0)});var A=function(E){return m[Dt(E)]===!0},D=function(E){var O=y&&y.map.get(E);return Boolean(O&&O.info&&O.info.merge)};Object.keys(g).forEach(function(E){A(E)&&!D(E)&&sg(b,g,E,d.store)})}e.merge(h,g)}),e.retain(p.__ref),p},t.prototype.processSelectionSet=function(e){var r=this,n=e.dataId,i=e.result,a=e.selectionSet,o=e.context,s=e.mergeTree,u=this.cache.policies,c=Object.create(null),l=n&&u.rootTypenamesById[n]||Fi(i,a,o.fragmentMap)||n&&o.store.get(n,"__typename");typeof l=="string"&&(c.__typename=l);var d=function(){var v=xo(arguments,c,o.variables);if(K(v.from)){var m=o.incomingById.get(v.from.__ref);if(m){var A=u.readField(_(_({},v),{from:m.storeObject}),o);if(A!==void 0)return A}}return u.readField(v,o)},p=new Set;this.flattenFields(a,i,o,l).forEach(function(v,m){var A,D=_t(m),E=i[D];if(p.add(m),E!==void 0){var O=u.getStoreFieldName({typename:l,fieldName:m.name.value,field:m,variables:v.variables}),P=Mp(s,O),N=r.processFieldValue(E,m,m.selectionSet?ou(v,!1,!1):v,P),j=void 0;m.selectionSet&&(K(N)||Cr(N))&&(j=d("__typename",N));var qe=u.getMergeFunction(l,m.name.value,j);qe?P.info={field:m,typename:l,merge:qe}:Up(s,O),c=v.merge(c,(A={},A[O]=N,A))}else __DEV__&&!v.clientOnly&&!v.deferred&&!nn.added(m)&&!u.getReadFunction(l,m.name.value)&&__DEV__&&I.error("Missing field '".concat(_t(m),"' while writing result ").concat(JSON.stringify(i,null,2)).substring(0,1e3))});try{var f=u.identify(i,{typename:l,selectionSet:a,fragmentMap:o.fragmentMap,storeObject:c,readField:d}),h=f[0],g=f[1];n=n||h,g&&(c=o.merge(c,g))}catch(v){if(!n)throw v}if(typeof n=="string"){var y=jt(n),S=o.written[n]||(o.written[n]=[]);if(S.indexOf(a)>=0||(S.push(a),this.reader&&this.reader.isFresh(i,y,a,o)))return y;var b=o.incomingById.get(n);return b?(b.storeObject=o.merge(b.storeObject,c),b.mergeTree=su(b.mergeTree,s),p.forEach(function(v){return b.fieldNodeSet.add(v)})):o.incomingById.set(n,{storeObject:c,mergeTree:ko(s)?void 0:s,fieldNodeSet:p}),y}return c},t.prototype.processFieldValue=function(e,r,n,i){var a=this;return!r.selectionSet||e===null?__DEV__?ao(e):e:ue(e)?e.map(function(o,s){var u=a.processFieldValue(o,r,n,Mp(i,s));return Up(i,s),u}):this.processSelectionSet({result:e,selectionSet:r.selectionSet,context:n,mergeTree:i})},t.prototype.flattenFields=function(e,r,n,i){i===void 0&&(i=Fi(r,e,n.fragmentMap));var a=new Map,o=this.cache.policies,s=new Bt(!1);return function u(c,l){var d=s.lookup(c,l.clientOnly,l.deferred);d.visited||(d.visited=!0,c.selections.forEach(function(p){if(!!er(p,n.variables)){var f=l.clientOnly,h=l.deferred;if(!(f&&h)&&Re(p.directives)&&p.directives.forEach(function(S){var b=S.name.value;if(b==="client"&&(f=!0),b==="defer"){var v=tr(S,n.variables);(!v||v.if!==!1)&&(h=!0)}}),pt(p)){var g=a.get(p);g&&(f=f&&g.clientOnly,h=h&&g.deferred),a.set(p,ou(n,f,h))}else{var y=Xr(p,n.lookupFragment);if(!y&&p.kind===Oe.FRAGMENT_SPREAD)throw __DEV__?new V("No fragment named ".concat(p.name.value)):new V(8);y&&o.fragmentMatches(y,i,r,n.variables)&&u(y.selectionSet,ou(n,f,h))}}}))}(e,n),a},t.prototype.applyMerges=function(e,r,n,i,a){var o,s=this;if(e.map.size&&!K(n)){var u=!ue(n)&&(K(r)||Cr(r))?r:void 0,c=n;u&&!a&&(a=[K(u)?u.__ref:u]);var l,d=function(p,f){return ue(p)?typeof f=="number"?p[f]:void 0:i.store.getFieldValue(p,String(f))};e.map.forEach(function(p,f){var h=d(u,f),g=d(c,f);if(g!==void 0){a&&a.push(f);var y=s.applyMerges(p,h,g,i,a);y!==g&&(l=l||new Map,l.set(f,y)),a&&I(a.pop()===f)}}),l&&(n=ue(c)?c.slice(0):_({},c),l.forEach(function(p,f){n[f]=p}))}return e.info?this.cache.policies.runMergeFunction(r,n,e.info,i,a&&(o=i.store).getStorage.apply(o,a)):n},t}();var Bp=[];function Mp(t,e){var r=t.map;return r.has(e)||r.set(e,Bp.pop()||{map:new Map}),r.get(e)}function su(t,e){if(t===e||!e||ko(e))return t;if(!t||ko(t))return e;var r=t.info&&e.info?_(_({},t.info),e.info):t.info||e.info,n=t.map.size&&e.map.size,i=n?new Map:t.map.size?t.map:e.map,a={info:r,map:i};if(n){var o=new Set(e.map.keys());t.map.forEach(function(s,u){a.map.set(u,su(s,e.map.get(u))),o.delete(u)}),o.forEach(function(s){a.map.set(s,su(e.map.get(s),t.map.get(s)))})}return a}function ko(t){return!t||!(t.info||t.map.size)}function Up(t,e){var r=t.map,n=r.get(e);n&&ko(n)&&(Bp.push(n),r.delete(e))}var jp=new Set;function sg(t,e,r,n){var i=function(d){var p=n.getFieldValue(d,r);return typeof p=="object"&&p},a=i(t);if(!!a){var o=i(e);if(!!o&&!K(a)&&!be(a,o)&&!Object.keys(a).every(function(d){return n.getFieldValue(o,d)!==void 0})){var s=n.getFieldValue(t,"__typename")||n.getFieldValue(e,"__typename"),u=Dt(r),c="".concat(s,".").concat(u);if(!jp.has(c)){jp.add(c);var l=[];!ue(a)&&!ue(o)&&[a,o].forEach(function(d){var p=n.getFieldValue(d,"__typename");typeof p=="string"&&!l.includes(p)&&l.push(p)}),__DEV__&&I.warn("Cache data may be lost when replacing the ".concat(u," field of a ").concat(s,` object.
|
|
39
39
|
|
|
40
40
|
To address this problem (which is not a bug in Apollo Client), `).concat(l.length?"either ensure all objects of type "+l.join(" and ")+" have an ID or a custom merge function, or ":"","define a custom merge function for the ").concat(c,` field, so InMemoryCache can safely merge these objects:
|
|
41
41
|
|
|
@@ -46,27 +46,27 @@ For more information about these options, please refer to the documentation:
|
|
|
46
46
|
|
|
47
47
|
* Ensuring entity objects have IDs: https://go.apollo.dev/c/generating-unique-identifiers
|
|
48
48
|
* Defining custom merge functions: https://go.apollo.dev/c/merging-non-normalized-objects
|
|
49
|
-
`))}}}}var
|
|
49
|
+
`))}}}}var To=function(t){xe(e,t);function e(r){r===void 0&&(r={});var n=t.call(this)||this;return n.watches=new Set,n.typenameDocumentCache=new Map,n.makeVar=Eo,n.txCount=0,n.config=vp(r),n.addTypename=!!n.config.addTypename,n.policies=new $p({cache:n,dataIdFromObject:n.config.dataIdFromObject,possibleTypes:n.config.possibleTypes,typePolicies:n.config.typePolicies}),n.init(),n}return e.prototype.init=function(){var r=this.data=new Jn.Root({policies:this.policies,resultCaching:this.config.resultCaching});this.optimisticData=r.stump,this.resetResultCache()},e.prototype.resetResultCache=function(r){var n=this,i=this.storeReader,a=this.config.fragments;this.storeWriter=new qp(this,this.storeReader=new xp({cache:this,addTypename:this.addTypename,resultCacheMaxSize:this.config.resultCacheMaxSize,canonizeResults:_o(this.config),canon:r?void 0:i&&i.canon,fragments:a}),a),this.maybeBroadcastWatch=on(function(o,s){return n.broadcastWatch(o,s)},{max:this.config.resultCacheMaxSize,makeCacheKey:function(o){var s=o.optimistic?n.optimisticData:n.data;if(sn(s)){var u=o.optimistic,c=o.id,l=o.variables;return s.makeCacheKey(o.query,o.callback,dt({optimistic:u,id:c,variables:l}))}}}),new Set([this.data.group,this.optimisticData.group]).forEach(function(o){return o.resetCaching()})},e.prototype.restore=function(r){return this.init(),r&&this.data.replace(r),this},e.prototype.extract=function(r){return r===void 0&&(r=!1),(r?this.optimisticData:this.data).extract()},e.prototype.read=function(r){var n=r.returnPartialData,i=n===void 0?!1:n;try{return this.storeReader.diffQueryAgainstStore(_(_({},r),{store:r.optimistic?this.optimisticData:this.data,config:this.config,returnPartialData:i})).result||null}catch(a){if(a instanceof Wi)return null;throw a}},e.prototype.write=function(r){try{return++this.txCount,this.storeWriter.writeToStore(this.data,r)}finally{!--this.txCount&&r.broadcast!==!1&&this.broadcastWatches()}},e.prototype.modify=function(r){if(ke.call(r,"id")&&!r.id)return!1;var n=r.optimistic?this.optimisticData:this.data;try{return++this.txCount,n.modify(r.id||"ROOT_QUERY",r.fields)}finally{!--this.txCount&&r.broadcast!==!1&&this.broadcastWatches()}},e.prototype.diff=function(r){return this.storeReader.diffQueryAgainstStore(_(_({},r),{store:r.optimistic?this.optimisticData:this.data,rootId:r.id||"ROOT_QUERY",config:this.config}))},e.prototype.watch=function(r){var n=this;return this.watches.size||Tp(this),this.watches.add(r),r.immediate&&this.maybeBroadcastWatch(r),function(){n.watches.delete(r)&&!n.watches.size&&eu(n),n.maybeBroadcastWatch.forget(r)}},e.prototype.gc=function(r){dt.reset();var n=this.optimisticData.gc();return r&&!this.txCount&&(r.resetResultCache?this.resetResultCache(r.resetResultIdentities):r.resetResultIdentities&&this.storeReader.resetCanon()),n},e.prototype.retain=function(r,n){return(n?this.optimisticData:this.data).retain(r)},e.prototype.release=function(r,n){return(n?this.optimisticData:this.data).release(r)},e.prototype.identify=function(r){if(K(r))return r.__ref;try{return this.policies.identify(r)[0]}catch(n){__DEV__&&I.warn(n)}},e.prototype.evict=function(r){if(!r.id){if(ke.call(r,"id"))return!1;r=_(_({},r),{id:"ROOT_QUERY"})}try{return++this.txCount,this.optimisticData.evict(r,this.data)}finally{!--this.txCount&&r.broadcast!==!1&&this.broadcastWatches()}},e.prototype.reset=function(r){var n=this;return this.init(),dt.reset(),r&&r.discardWatches?(this.watches.forEach(function(i){return n.maybeBroadcastWatch.forget(i)}),this.watches.clear(),eu(this)):this.broadcastWatches(),Promise.resolve()},e.prototype.removeOptimistic=function(r){var n=this.optimisticData.removeLayer(r);n!==this.optimisticData&&(this.optimisticData=n,this.broadcastWatches())},e.prototype.batch=function(r){var n=this,i=r.update,a=r.optimistic,o=a===void 0?!0:a,s=r.removeOptimistic,u=r.onWatchUpdated,c,l=function(p){var f=n,h=f.data,g=f.optimisticData;++n.txCount,p&&(n.data=n.optimisticData=p);try{return c=i(n)}finally{--n.txCount,n.data=h,n.optimisticData=g}},d=new Set;return u&&!this.txCount&&this.broadcastWatches(_(_({},r),{onWatchUpdated:function(p){return d.add(p),!1}})),typeof o=="string"?this.optimisticData=this.optimisticData.addLayer(o,l):o===!1?l(this.data):l(),typeof s=="string"&&(this.optimisticData=this.optimisticData.removeLayer(s)),u&&d.size?(this.broadcastWatches(_(_({},r),{onWatchUpdated:function(p,f){var h=u.call(this,p,f);return h!==!1&&d.delete(p),h}})),d.size&&d.forEach(function(p){return n.maybeBroadcastWatch.dirty(p)})):this.broadcastWatches(r),c},e.prototype.performTransaction=function(r,n){return this.batch({update:r,optimistic:n||n!==null})},e.prototype.transformDocument=function(r){if(this.addTypename){var n=this.typenameDocumentCache.get(r);return n||(n=nn(r),this.typenameDocumentCache.set(r,n),this.typenameDocumentCache.set(n,n)),n}return r},e.prototype.transformForLink=function(r){var n=this.config.fragments;return n?n.transform(r):r},e.prototype.broadcastWatches=function(r){var n=this;this.txCount||this.watches.forEach(function(i){return n.maybeBroadcastWatch(i,r)})},e.prototype.broadcastWatch=function(r,n){var i=r.lastDiff,a=this.diff(r);n&&(r.optimistic&&typeof n.optimistic=="string"&&(a.fromOptimisticTransaction=!0),n.onWatchUpdated&&n.onWatchUpdated.call(this,r,a,i)===!1)||(!i||!be(i.result,a.result))&&r.callback(r.lastDiff=a,i)},e}(Hc);function Vp(t){return t.hasOwnProperty("graphQLErrors")}var cg=function(t){var e="";if(Re(t.graphQLErrors)||Re(t.clientErrors)){var r=(t.graphQLErrors||[]).concat(t.clientErrors||[]);r.forEach(function(n){var i=n?n.message:"Error message not found.";e+="".concat(i,`
|
|
50
50
|
`)})}return t.networkError&&(e+="".concat(t.networkError.message,`
|
|
51
|
-
`)),e=e.replace(/\n$/,""),e},rr=function(t){xe(e,t);function e(r){var n=r.graphQLErrors,i=r.clientErrors,a=r.networkError,o=r.errorMessage,s=r.extraInfo,u=t.call(this,o)||this;return u.name="ApolloError",u.graphQLErrors=n||[],u.clientErrors=i||[],u.networkError=a||null,u.message=o||
|
|
52
|
-
Did you mean to call refetch(variables) instead of refetch({ variables })?`))}return r&&!be(this.options.variables,r)&&(i.variables=this.options.variables=_(_({},this.options.variables),r)),this.queryInfo.resetLastWrite(),this.reobserve(i,ie.refetch)},e.prototype.fetchMore=function(r){var n=this,i=_(_({},r.query?r:_(_(_(_({},this.options),{query:this.query}),r),{variables:_(_({},this.options.variables),r.variables)})),{fetchPolicy:"no-cache"}),a=this.queryManager.generateQueryId(),o=this.queryInfo,s=o.networkStatus;o.networkStatus=ie.fetchMore,i.notifyOnNetworkStatusChange&&this.observe();var u=new Set;return this.queryManager.fetchQuery(a,i,ie.fetchMore).then(function(c){return n.queryManager.removeQuery(a),o.networkStatus===ie.fetchMore&&(o.networkStatus=s),n.queryManager.cache.batch({update:function(l){var d=r.updateQuery;d?l.updateQuery({query:n.query,variables:n.variables,returnPartialData:!0,optimistic:!1},function(p){return d(p,{fetchMoreResult:c.data,variables:i.variables})}):l.writeQuery({query:i.query,variables:i.variables,data:c.data})},onWatchUpdated:function(l){u.add(l.query)}}),c}).finally(function(){u.has(n.query)||ou(n)})},e.prototype.subscribeToMore=function(r){var n=this,i=this.queryManager.startGraphQLSubscription({query:r.document,variables:r.variables,context:r.context}).subscribe({next:function(a){var o=r.updateQuery;o&&n.updateQuery(function(s,u){var c=u.variables;return o(s,{subscriptionData:a,variables:c})})},error:function(a){if(r.onError){r.onError(a);return}__DEV__&&I.error("Unhandled GraphQL subscription error",a)}});return this.subscriptions.add(i),function(){n.subscriptions.delete(i)&&i.unsubscribe()}},e.prototype.setOptions=function(r){return this.reobserve(r)},e.prototype.setVariables=function(r){return be(this.variables,r)?this.observers.size?this.result():Promise.resolve():(this.options.variables=r,this.observers.size?this.reobserve({fetchPolicy:this.options.initialFetchPolicy,variables:r},ie.setVariables):Promise.resolve())},e.prototype.updateQuery=function(r){var n=this.queryManager,i=n.cache.diff({query:this.options.query,variables:this.variables,returnPartialData:!0,optimistic:!1}).result,a=r(i,{variables:this.variables});a&&(n.cache.writeQuery({query:this.options.query,data:a,variables:this.variables}),n.broadcastQueries())},e.prototype.startPolling=function(r){this.options.pollInterval=r,this.updatePolling()},e.prototype.stopPolling=function(){this.options.pollInterval=0,this.updatePolling()},e.prototype.applyNextFetchPolicy=function(r,n){if(n.nextFetchPolicy){var i=n.fetchPolicy,a=i===void 0?"cache-first":i,o=n.initialFetchPolicy,s=o===void 0?a:o;a==="standby"||(typeof n.nextFetchPolicy=="function"?n.fetchPolicy=n.nextFetchPolicy(a,{reason:r,options:n,observable:this,initialFetchPolicy:s}):r==="variables-changed"?n.fetchPolicy=s:n.fetchPolicy=n.nextFetchPolicy)}return n.fetchPolicy},e.prototype.fetch=function(r,n){return this.queryManager.setObservableQuery(this),this.queryManager.fetchQueryObservable(this.queryId,r,n)},e.prototype.updatePolling=function(){var r=this;if(!this.queryManager.ssrMode){var n=this,i=n.pollingInfo,a=n.options.pollInterval;if(!a){i&&(clearTimeout(i.timeout),delete this.pollingInfo);return}if(!(i&&i.interval===a)){__DEV__?I(a,"Attempted to start a polling query without a polling interval."):I(a,13);var o=i||(this.pollingInfo={});o.interval=a;var s=function(){r.pollingInfo&&(Er(r.queryInfo.networkStatus)?u():r.reobserve({fetchPolicy:r.options.initialFetchPolicy==="no-cache"?"no-cache":"network-only"},ie.poll).then(u,u))},u=function(){var c=r.pollingInfo;c&&(clearTimeout(c.timeout),c.timeout=setTimeout(s,c.interval))};u()}}},e.prototype.updateLastResult=function(r,n){return n===void 0&&(n=this.variables),this.last=_(_({},this.last),{result:this.queryManager.assumeImmutableResults?r:io(r),variables:n}),Re(r.errors)||delete this.last.error,this.last},e.prototype.reobserve=function(r,n){var i=this;this.isTornDown=!1;var a=n===ie.refetch||n===ie.fetchMore||n===ie.poll,o=this.options.variables,s=this.options.fetchPolicy,u=_r(this.options,r||{}),c=a?u:cg(this.options,u);a||(this.updatePolling(),r&&r.variables&&!be(r.variables,o)&&c.fetchPolicy!=="standby"&&c.fetchPolicy===s&&(this.applyNextFetchPolicy("variables-changed",c),n===void 0&&(n=ie.setVariables)));var l=c.variables&&_({},c.variables),d=this.fetch(c,n),p={next:function(f){i.reportResult(f,l)},error:function(f){i.reportError(f,l)}};return a||(this.concast&&this.observer&&this.concast.removeObserver(this.observer),this.concast=d,this.observer=p),d.addObserver(p),d.promise},e.prototype.observe=function(){this.reportResult(this.getCurrentResult(!1),this.variables)},e.prototype.reportResult=function(r,n){var i=this.getLastError();(i||this.isDifferentFromLastResult(r,n))&&((i||!r.partial||this.options.returnPartialData)&&this.updateLastResult(r,n),nn(this.observers,"next",r))},e.prototype.reportError=function(r,n){var i=_(_({},this.getLastResult()),{error:r,errors:r.graphQLErrors,networkStatus:ie.error,loading:!1});this.updateLastResult(i,n),nn(this.observers,"error",this.last.error=r)},e.prototype.hasObservers=function(){return this.observers.size>0},e.prototype.tearDownQuery=function(){this.isTornDown||(this.concast&&this.observer&&(this.concast.removeObserver(this.observer),delete this.concast,delete this.observer),this.stopPolling(),this.subscriptions.forEach(function(r){return r.unsubscribe()}),this.subscriptions.clear(),this.queryManager.stopQuery(this.queryId),this.observers.clear(),this.isTornDown=!0)},e}(W);oo(To);function ou(t){var e=t.options,r=e.fetchPolicy,n=e.nextFetchPolicy;return r==="cache-and-network"||r==="network-only"?t.reobserve({fetchPolicy:"cache-first",nextFetchPolicy:function(){return this.nextFetchPolicy=n,typeof n=="function"?n.apply(this,arguments):r}}):t.reobserve()}function lg(t){__DEV__&&I.error("Unhandled error",t.message,t.stack)}function su(t){__DEV__&&t&&__DEV__&&I.debug("Missing cache result fields: ".concat(JSON.stringify(t)),t)}var Ao=function(){function t(e){var r=e.cache,n=e.client,i=e.resolvers,a=e.fragmentMatcher;this.selectionsToResolveCache=new WeakMap,this.cache=r,n&&(this.client=n),i&&this.addResolvers(i),a&&this.setFragmentMatcher(a)}return t.prototype.addResolvers=function(e){var r=this;this.resolvers=this.resolvers||{},Array.isArray(e)?e.forEach(function(n){r.resolvers=_c(r.resolvers,n)}):this.resolvers=_c(this.resolvers,e)},t.prototype.setResolvers=function(e){this.resolvers={},this.addResolvers(e)},t.prototype.getResolvers=function(){return this.resolvers||{}},t.prototype.runResolvers=function(e){var r=e.document,n=e.remoteResult,i=e.context,a=e.variables,o=e.onlyRunForcedResolvers,s=o===void 0?!1:o;return Tt(this,void 0,void 0,function(){return At(this,function(u){return r?[2,this.resolveDocument(r,n.data,i,a,this.fragmentMatcher,s).then(function(c){return _(_({},n),{data:c.result})})]:[2,n]})})},t.prototype.setFragmentMatcher=function(e){this.fragmentMatcher=e},t.prototype.getFragmentMatcher=function(){return this.fragmentMatcher},t.prototype.clientQuery=function(e){return qn(["client"],e)&&this.resolvers?e:null},t.prototype.serverQuery=function(e){return bc(e)},t.prototype.prepareContext=function(e){var r=this.cache;return _(_({},e),{cache:r,getCacheKey:function(n){return r.identify(n)}})},t.prototype.addExportedVariables=function(e,r,n){return r===void 0&&(r={}),n===void 0&&(n={}),Tt(this,void 0,void 0,function(){return At(this,function(i){return e?[2,this.resolveDocument(e,this.buildRootValueFromCache(e,r)||{},this.prepareContext(n),r).then(function(a){return _(_({},r),a.exportedVariables)})]:[2,_({},r)]})})},t.prototype.shouldForceResolvers=function(e){var r=!1;return Ke(e,{Directive:{enter:function(n){if(n.name.value==="client"&&n.arguments&&(r=n.arguments.some(function(i){return i.name.value==="always"&&i.value.kind==="BooleanValue"&&i.value.value===!0}),r))return Zr}}}),r},t.prototype.buildRootValueFromCache=function(e,r){return this.cache.diff({query:vc(e),variables:r,returnPartialData:!0,optimistic:!1}).result},t.prototype.resolveDocument=function(e,r,n,i,a,o){return n===void 0&&(n={}),i===void 0&&(i={}),a===void 0&&(a=function(){return!0}),o===void 0&&(o=!1),Tt(this,void 0,void 0,function(){var s,u,c,l,d,p,f,h,g,y,S;return At(this,function(b){return s=en(e),u=Xr(e),c=Yr(u),l=this.collectSelectionsToResolve(s,c),d=s.operation,p=d?d.charAt(0).toUpperCase()+d.slice(1):"Query",f=this,h=f.cache,g=f.client,y={fragmentMap:c,context:_(_({},n),{cache:h,client:g}),variables:i,fragmentMatcher:a,defaultOperationType:p,exportedVariables:{},selectionsToResolve:l,onlyRunForcedResolvers:o},S=!1,[2,this.resolveSelectionSet(s.selectionSet,S,r,y).then(function(v){return{result:v,exportedVariables:y.exportedVariables}})]})})},t.prototype.resolveSelectionSet=function(e,r,n,i){return Tt(this,void 0,void 0,function(){var a,o,s,u,c,l=this;return At(this,function(d){return a=i.fragmentMap,o=i.context,s=i.variables,u=[n],c=function(p){return Tt(l,void 0,void 0,function(){var f,h;return At(this,function(g){return!r&&!i.selectionsToResolve.has(p)?[2]:er(p,s)?pt(p)?[2,this.resolveField(p,r,n,i).then(function(y){var S;typeof y<"u"&&u.push((S={},S[_t(p)]=y,S))})]:(hc(p)?f=p:(f=a[p.name.value],__DEV__?I(f,"No fragment named ".concat(p.name.value)):I(f,11)),f&&f.typeCondition&&(h=f.typeCondition.name.value,i.fragmentMatcher(n,h,o))?[2,this.resolveSelectionSet(f.selectionSet,r,n,i).then(function(y){u.push(y)})]:[2]):[2]})})},[2,Promise.all(e.selections.map(c)).then(function(){return Mi(u)})]})})},t.prototype.resolveField=function(e,r,n,i){return Tt(this,void 0,void 0,function(){var a,o,s,u,c,l,d,p,f,h=this;return At(this,function(g){return n?(a=i.variables,o=e.name.value,s=_t(e),u=o!==s,c=n[s]||n[o],l=Promise.resolve(c),(!i.onlyRunForcedResolvers||this.shouldForceResolvers(e))&&(d=n.__typename||i.defaultOperationType,p=this.resolvers&&this.resolvers[d],p&&(f=p[u?o:s],f&&(l=Promise.resolve(Jn.withValue(this.cache,f,[n,tr(e,a),i.context,{field:e,fragmentMap:i.fragmentMap}]))))),[2,l.then(function(y){var S,b;if(y===void 0&&(y=c),e.directives&&e.directives.forEach(function(m){m.name.value==="export"&&m.arguments&&m.arguments.forEach(function(A){A.name.value==="as"&&A.value.kind==="StringValue"&&(i.exportedVariables[A.value.value]=y)})}),!e.selectionSet||y==null)return y;var v=(b=(S=e.directives)===null||S===void 0?void 0:S.some(function(m){return m.name.value==="client"}))!==null&&b!==void 0?b:!1;if(Array.isArray(y))return h.resolveSubSelectedArray(e,r||v,y,i);if(e.selectionSet)return h.resolveSelectionSet(e.selectionSet,r||v,y,i)})]):[2,null]})})},t.prototype.resolveSubSelectedArray=function(e,r,n,i){var a=this;return Promise.all(n.map(function(o){if(o===null)return null;if(Array.isArray(o))return a.resolveSubSelectedArray(e,r,o,i);if(e.selectionSet)return a.resolveSelectionSet(e.selectionSet,r,o,i)}))},t.prototype.collectSelectionsToResolve=function(e,r){var n=function(o){return!Array.isArray(o)},i=this.selectionsToResolveCache;function a(o){if(!i.has(o)){var s=new Set;i.set(o,s),Ke(o,{Directive:function(u,c,l,d,p){u.name.value==="client"&&p.forEach(function(f){n(f)&&Ri(f)&&s.add(f)})},FragmentSpread:function(u,c,l,d,p){var f=r[u.name.value];__DEV__?I(f,"No fragment named ".concat(u.name.value)):I(f,12);var h=a(f);h.size>0&&(p.forEach(function(g){n(g)&&Ri(g)&&s.add(g)}),s.add(u),h.forEach(function(g){s.add(g)}))}})}return i.get(o)}return a(e)},t}();var ei=new(wt?WeakMap:Map);function cu(t,e){var r=t[e];typeof r=="function"&&(t[e]=function(){return ei.set(t,(ei.get(t)+1)%1e15),r.apply(this,arguments)})}function Vp(t){t.notifyTimeout&&(clearTimeout(t.notifyTimeout),t.notifyTimeout=void 0)}var Io=function(){function t(e,r){r===void 0&&(r=e.generateQueryId()),this.queryId=r,this.listeners=new Set,this.document=null,this.lastRequestId=1,this.subscriptions=new Set,this.stopped=!1,this.dirty=!1,this.observableQuery=null;var n=this.cache=e.cache;ei.has(n)||(ei.set(n,0),cu(n,"evict"),cu(n,"modify"),cu(n,"reset"))}return t.prototype.init=function(e){var r=e.networkStatus||ie.loading;return this.variables&&this.networkStatus!==ie.loading&&!be(this.variables,e.variables)&&(r=ie.setVariables),be(e.variables,this.variables)||(this.lastDiff=void 0),Object.assign(this,{document:e.document,variables:e.variables,networkError:null,graphQLErrors:this.graphQLErrors||[],networkStatus:r}),e.observableQuery&&this.setObservableQuery(e.observableQuery),e.lastRequestId&&(this.lastRequestId=e.lastRequestId),this},t.prototype.reset=function(){Vp(this),this.dirty=!1},t.prototype.getDiff=function(e){e===void 0&&(e=this.variables);var r=this.getDiffOptions(e);if(this.lastDiff&&be(r,this.lastDiff.options))return this.lastDiff.diff;this.updateWatch(this.variables=e);var n=this.observableQuery;if(n&&n.options.fetchPolicy==="no-cache")return{complete:!1};var i=this.cache.diff(r);return this.updateLastDiff(i,r),i},t.prototype.updateLastDiff=function(e,r){this.lastDiff=e?{diff:e,options:r||this.getDiffOptions()}:void 0},t.prototype.getDiffOptions=function(e){var r;return e===void 0&&(e=this.variables),{query:this.document,variables:e,returnPartialData:!0,optimistic:!0,canonizeResults:(r=this.observableQuery)===null||r===void 0?void 0:r.options.canonizeResults}},t.prototype.setDiff=function(e){var r=this,n=this.lastDiff&&this.lastDiff.diff;this.updateLastDiff(e),!this.dirty&&!be(n&&n.result,e&&e.result)&&(this.dirty=!0,this.notifyTimeout||(this.notifyTimeout=setTimeout(function(){return r.notify()},0)))},t.prototype.setObservableQuery=function(e){var r=this;e!==this.observableQuery&&(this.oqListener&&this.listeners.delete(this.oqListener),this.observableQuery=e,e?(e.queryInfo=this,this.listeners.add(this.oqListener=function(){var n=r.getDiff();n.fromOptimisticTransaction?e.observe():ou(e)})):delete this.oqListener)},t.prototype.notify=function(){var e=this;Vp(this),this.shouldNotify()&&this.listeners.forEach(function(r){return r(e)}),this.dirty=!1},t.prototype.shouldNotify=function(){if(!this.dirty||!this.listeners.size)return!1;if(Er(this.networkStatus)&&this.observableQuery){var e=this.observableQuery.options.fetchPolicy;if(e!=="cache-only"&&e!=="cache-and-network")return!1}return!0},t.prototype.stop=function(){if(!this.stopped){this.stopped=!0,this.reset(),this.cancel(),this.cancel=t.prototype.cancel,this.subscriptions.forEach(function(r){return r.unsubscribe()});var e=this.observableQuery;e&&e.stopPolling()}},t.prototype.cancel=function(){},t.prototype.updateWatch=function(e){var r=this;e===void 0&&(e=this.variables);var n=this.observableQuery;if(!(n&&n.options.fetchPolicy==="no-cache")){var i=_(_({},this.getDiffOptions(e)),{watcher:this,callback:function(a){return r.setDiff(a)}});(!this.lastWatch||!be(i,this.lastWatch))&&(this.cancel(),this.cancel=this.cache.watch(this.lastWatch=i))}},t.prototype.resetLastWrite=function(){this.lastWrite=void 0},t.prototype.shouldWrite=function(e,r){var n=this.lastWrite;return!(n&&n.dmCount===ei.get(this.cache)&&be(r,n.variables)&&be(e.data,n.result.data))},t.prototype.markResult=function(e,r,n,i){var a=this,o=new it,s=Re(e.errors)?e.errors.slice(0):[];if(this.reset(),"incremental"in e&&Re(e.incremental)){var u=so(this.getDiff().result,e);e.data=u}else if("hasNext"in e&&e.hasNext){var c=this.getDiff();e.data=o.merge(c.result,e.data)}this.graphQLErrors=s,n.fetchPolicy==="no-cache"?this.updateLastDiff({result:e.data,complete:!0},this.getDiffOptions(n.variables)):i!==0&&(Oo(e,n.errorPolicy)?this.cache.performTransaction(function(l){if(a.shouldWrite(e,n.variables))l.writeQuery({query:r,data:e.data,variables:n.variables,overwrite:i===1}),a.lastWrite={result:e,variables:n.variables,dmCount:ei.get(a.cache)};else if(a.lastDiff&&a.lastDiff.diff.complete){e.data=a.lastDiff.diff.result;return}var d=a.getDiffOptions(n.variables),p=l.diff(d);a.stopped||a.updateWatch(n.variables),a.updateLastDiff(p,d),p.complete&&(e.data=p.result)}):this.lastWrite=void 0)},t.prototype.markReady=function(){return this.networkError=null,this.networkStatus=ie.ready},t.prototype.markError=function(e){return this.networkStatus=ie.error,this.lastWrite=void 0,this.reset(),e.graphQLErrors&&(this.graphQLErrors=e.graphQLErrors),e.networkError&&(this.networkError=e.networkError),e},t}();function Oo(t,e){e===void 0&&(e="none");var r=e==="ignore"||e==="all",n=!Hn(t);return!n&&r&&t.data&&(n=!0),n}var fg=Object.prototype.hasOwnProperty,zp=function(){function t(e){var r=e.cache,n=e.link,i=e.defaultOptions,a=e.queryDeduplication,o=a===void 0?!1:a,s=e.onBroadcast,u=e.ssrMode,c=u===void 0?!1:u,l=e.clientAwareness,d=l===void 0?{}:l,p=e.localState,f=e.assumeImmutableResults;this.clientAwareness={},this.queries=new Map,this.fetchCancelFns=new Map,this.transformCache=new(wt?WeakMap:Map),this.queryIdCounter=1,this.requestIdCounter=1,this.mutationIdCounter=1,this.inFlightLinkObservables=new Map,this.cache=r,this.link=n,this.defaultOptions=i||Object.create(null),this.queryDeduplication=o,this.clientAwareness=d,this.localState=p||new Ao({cache:r}),this.ssrMode=c,this.assumeImmutableResults=!!f,(this.onBroadcast=s)&&(this.mutationStore=Object.create(null))}return t.prototype.stop=function(){var e=this;this.queries.forEach(function(r,n){e.stopQueryNoBroadcast(n)}),this.cancelPendingFetches(__DEV__?new V("QueryManager stopped while query was in flight"):new V(14))},t.prototype.cancelPendingFetches=function(e){this.fetchCancelFns.forEach(function(r){return r(e)}),this.fetchCancelFns.clear()},t.prototype.mutate=function(e){var r,n,i=e.mutation,a=e.variables,o=e.optimisticResponse,s=e.updateQueries,u=e.refetchQueries,c=u===void 0?[]:u,l=e.awaitRefetchQueries,d=l===void 0?!1:l,p=e.update,f=e.onQueryUpdated,h=e.fetchPolicy,g=h===void 0?((r=this.defaultOptions.mutate)===null||r===void 0?void 0:r.fetchPolicy)||"network-only":h,y=e.errorPolicy,S=y===void 0?((n=this.defaultOptions.mutate)===null||n===void 0?void 0:n.errorPolicy)||"none":y,b=e.keepRootFields,v=e.context;return Tt(this,void 0,void 0,function(){var m,A,D,E,O,P;return At(this,function(N){switch(N.label){case 0:return __DEV__?I(i,"mutation option is required. You must specify your GraphQL document in the mutation option."):I(i,15),__DEV__?I(g==="network-only"||g==="no-cache","Mutations support only 'network-only' or 'no-cache' fetchPolicy strings. The default `network-only` behavior automatically writes mutation results to the cache. Passing `no-cache` skips the cache write."):I(g==="network-only"||g==="no-cache",16),m=this.generateMutationId(),A=this.transform(i),D=A.document,E=A.hasClientExports,i=this.cache.transformForLink(D),a=this.getVariables(i,a),E?[4,this.localState.addExportedVariables(i,a,v)]:[3,2];case 1:a=N.sent(),N.label=2;case 2:return O=this.mutationStore&&(this.mutationStore[m]={mutation:i,variables:a,loading:!0,error:null}),o&&this.markMutationOptimistic(o,{mutationId:m,document:i,variables:a,fetchPolicy:g,errorPolicy:S,context:v,updateQueries:s,update:p,keepRootFields:b}),this.broadcastQueries(),P=this,[2,new Promise(function(j,qe){return ao(P.getObservableFromLink(i,_(_({},v),{optimisticResponse:o}),a,!1),function(Ne){if(Hn(Ne)&&S==="none")throw new rr({graphQLErrors:co(Ne)});O&&(O.loading=!1,O.error=null);var q=_({},Ne);return typeof c=="function"&&(c=c(q)),S==="ignore"&&Hn(q)&&delete q.errors,P.markMutationResult({mutationId:m,result:q,document:i,variables:a,fetchPolicy:g,errorPolicy:S,context:v,update:p,updateQueries:s,awaitRefetchQueries:d,refetchQueries:c,removeOptimistic:o?m:void 0,onQueryUpdated:f,keepRootFields:b})}).subscribe({next:function(Ne){P.broadcastQueries(),(!("hasNext"in Ne)||Ne.hasNext===!1)&&j(Ne)},error:function(Ne){O&&(O.loading=!1,O.error=Ne),o&&P.cache.removeOptimistic(m),P.broadcastQueries(),qe(Ne instanceof rr?Ne:new rr({networkError:Ne}))}})})]}})})},t.prototype.markMutationResult=function(e,r){var n=this;r===void 0&&(r=this.cache);var i=e.result,a=[],o=e.fetchPolicy==="no-cache";if(!o&&Oo(i,e.errorPolicy)){if(br(i)||a.push({result:i.data,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}),br(i)&&Re(i.incremental)){var s=r.diff({id:"ROOT_MUTATION",query:this.transform(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0}),u=void 0;s.result&&(u=so(s.result,i)),typeof u<"u"&&(i.data=u,a.push({result:u,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}))}var c=e.updateQueries;c&&this.queries.forEach(function(d,p){var f=d.observableQuery,h=f&&f.queryName;if(!(!h||!fg.call(c,h))){var g=c[h],y=n.queries.get(p),S=y.document,b=y.variables,v=r.diff({query:S,variables:b,returnPartialData:!0,optimistic:!1}),m=v.result,A=v.complete;if(A&&m){var D=g(m,{mutationResult:i,queryName:S&&Vn(S)||void 0,queryVariables:b});D&&a.push({result:D,dataId:"ROOT_QUERY",query:S,variables:b})}}})}if(a.length>0||e.refetchQueries||e.update||e.onQueryUpdated||e.removeOptimistic){var l=[];if(this.refetchQueries({updateCache:function(d){o||a.forEach(function(g){return d.write(g)});var p=e.update,f=!Tf(i)||br(i)&&!i.hasNext;if(p){if(!o){var h=d.diff({id:"ROOT_MUTATION",query:n.transform(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0});h.complete&&(i=_(_({},i),{data:h.result}),"incremental"in i&&delete i.incremental,"hasNext"in i&&delete i.hasNext)}f&&p(d,i,{context:e.context,variables:e.variables})}!o&&!e.keepRootFields&&f&&d.modify({id:"ROOT_MUTATION",fields:function(g,y){var S=y.fieldName,b=y.DELETE;return S==="__typename"?g:b}})},include:e.refetchQueries,optimistic:!1,removeOptimistic:e.removeOptimistic,onQueryUpdated:e.onQueryUpdated||null}).forEach(function(d){return l.push(d)}),e.awaitRefetchQueries||e.onQueryUpdated)return Promise.all(l).then(function(){return i})}return Promise.resolve(i)},t.prototype.markMutationOptimistic=function(e,r){var n=this,i=typeof e=="function"?e(r.variables):e;return this.cache.recordOptimisticTransaction(function(a){try{n.markMutationResult(_(_({},r),{result:{data:i}}),a)}catch(o){__DEV__&&I.error(o)}},r.mutationId)},t.prototype.fetchQuery=function(e,r,n){return this.fetchQueryObservable(e,r,n).promise},t.prototype.getQueryStore=function(){var e=Object.create(null);return this.queries.forEach(function(r,n){e[n]={variables:r.variables,networkStatus:r.networkStatus,networkError:r.networkError,graphQLErrors:r.graphQLErrors}}),e},t.prototype.resetErrors=function(e){var r=this.queries.get(e);r&&(r.networkError=void 0,r.graphQLErrors=[])},t.prototype.transform=function(e){var r=this.transformCache;if(!r.has(e)){var n=this.cache.transformDocument(e),i=yc(n),a=this.localState.clientQuery(n),o=i&&this.localState.serverQuery(i),s={document:n,hasClientExports:lc(n),hasForcedResolvers:this.localState.shouldForceResolvers(n),clientQuery:a,serverQuery:o,defaultVars:tn(qt(n)),asQuery:_(_({},n),{definitions:n.definitions.map(function(c){return c.kind==="OperationDefinition"&&c.operation!=="query"?_(_({},c),{operation:"query"}):c})})},u=function(c){c&&!r.has(c)&&r.set(c,s)};u(e),u(n),u(a),u(o)}return r.get(e)},t.prototype.getVariables=function(e,r){return _(_({},this.transform(e).defaultVars),r)},t.prototype.watchQuery=function(e){e=_(_({},e),{variables:this.getVariables(e.query,e.variables)}),typeof e.notifyOnNetworkStatusChange>"u"&&(e.notifyOnNetworkStatusChange=!1);var r=new Io(this),n=new To({queryManager:this,queryInfo:r,options:e});return this.queries.set(n.queryId,r),r.init({document:n.query,observableQuery:n,variables:n.variables}),n},t.prototype.query=function(e,r){var n=this;return r===void 0&&(r=this.generateQueryId()),__DEV__?I(e.query,"query option is required. You must specify your GraphQL document in the query option."):I(e.query,17),__DEV__?I(e.query.kind==="Document",'You must wrap the query string in a "gql" tag.'):I(e.query.kind==="Document",18),__DEV__?I(!e.returnPartialData,"returnPartialData option only supported on watchQuery."):I(!e.returnPartialData,19),__DEV__?I(!e.pollInterval,"pollInterval option only supported on watchQuery."):I(!e.pollInterval,20),this.fetchQuery(r,e).finally(function(){return n.stopQuery(r)})},t.prototype.generateQueryId=function(){return String(this.queryIdCounter++)},t.prototype.generateRequestId=function(){return this.requestIdCounter++},t.prototype.generateMutationId=function(){return String(this.mutationIdCounter++)},t.prototype.stopQueryInStore=function(e){this.stopQueryInStoreNoBroadcast(e),this.broadcastQueries()},t.prototype.stopQueryInStoreNoBroadcast=function(e){var r=this.queries.get(e);r&&r.stop()},t.prototype.clearStore=function(e){return e===void 0&&(e={discardWatches:!0}),this.cancelPendingFetches(__DEV__?new V("Store reset while query was in flight (not completed in link chain)"):new V(21)),this.queries.forEach(function(r){r.observableQuery?r.networkStatus=ie.loading:r.stop()}),this.mutationStore&&(this.mutationStore=Object.create(null)),this.cache.reset(e)},t.prototype.getObservableQueries=function(e){var r=this;e===void 0&&(e="active");var n=new Map,i=new Map,a=new Set;return Array.isArray(e)&&e.forEach(function(o){typeof o=="string"?i.set(o,!1):pc(o)?i.set(r.transform(o).document,!1):ee(o)&&o.query&&a.add(o)}),this.queries.forEach(function(o,s){var u=o.observableQuery,c=o.document;if(u){if(e==="all"){n.set(s,u);return}var l=u.queryName,d=u.options.fetchPolicy;if(d==="standby"||e==="active"&&!u.hasObservers())return;(e==="active"||l&&i.has(l)||c&&i.has(c))&&(n.set(s,u),l&&i.set(l,!0),c&&i.set(c,!0))}}),a.size&&a.forEach(function(o){var s=qi("legacyOneTimeQuery"),u=r.getQuery(s).init({document:o.query,variables:o.variables}),c=new To({queryManager:r,queryInfo:u,options:_(_({},o),{fetchPolicy:"network-only"})});I(c.queryId===s),u.setObservableQuery(c),n.set(s,c)}),__DEV__&&i.size&&i.forEach(function(o,s){o||__DEV__&&I.warn("Unknown query ".concat(typeof s=="string"?"named ":"").concat(JSON.stringify(s,null,2)," requested in refetchQueries options.include array"))}),n},t.prototype.reFetchObservableQueries=function(e){var r=this;e===void 0&&(e=!1);var n=[];return this.getObservableQueries(e?"all":"active").forEach(function(i,a){var o=i.options.fetchPolicy;i.resetLastResults(),(e||o!=="standby"&&o!=="cache-only")&&n.push(i.refetch()),r.getQuery(a).setDiff(null)}),this.broadcastQueries(),Promise.all(n)},t.prototype.setObservableQuery=function(e){this.getQuery(e.queryId).setObservableQuery(e)},t.prototype.startGraphQLSubscription=function(e){var r=this,n=e.query,i=e.fetchPolicy,a=e.errorPolicy,o=e.variables,s=e.context,u=s===void 0?{}:s;n=this.transform(n).document,o=this.getVariables(n,o);var c=function(d){return r.getObservableFromLink(n,u,d).map(function(p){if(i!=="no-cache"&&(Oo(p,a)&&r.cache.write({query:n,result:p.data,dataId:"ROOT_SUBSCRIPTION",variables:d}),r.broadcastQueries()),Hn(p))throw new rr({graphQLErrors:p.errors});return p})};if(this.transform(n).hasClientExports){var l=this.localState.addExportedVariables(n,o,u).then(c);return new W(function(d){var p=null;return l.then(function(f){return p=f.subscribe(d)},d.error),function(){return p&&p.unsubscribe()}})}return c(o)},t.prototype.stopQuery=function(e){this.stopQueryNoBroadcast(e),this.broadcastQueries()},t.prototype.stopQueryNoBroadcast=function(e){this.stopQueryInStoreNoBroadcast(e),this.removeQuery(e)},t.prototype.removeQuery=function(e){this.fetchCancelFns.delete(e),this.queries.has(e)&&(this.getQuery(e).stop(),this.queries.delete(e))},t.prototype.broadcastQueries=function(){this.onBroadcast&&this.onBroadcast(),this.queries.forEach(function(e){return e.notify()})},t.prototype.getLocalState=function(){return this.localState},t.prototype.getObservableFromLink=function(e,r,n,i){var a=this,o;i===void 0&&(i=(o=r?.queryDeduplication)!==null&&o!==void 0?o:this.queryDeduplication);var s,u=this.transform(e).serverQuery;if(u){var c=this,l=c.inFlightLinkObservables,d=c.link,p={query:u,variables:n,operationName:Vn(u)||void 0,context:this.prepareContext(_(_({},r),{forceFetch:!i}))};if(r=p.context,i){var f=l.get(u)||new Map;l.set(u,f);var h=dt(n);if(s=f.get(h),!s){var g=new Gn([Wn(d,p)]);f.set(h,s=g),g.beforeNext(function(){f.delete(h)&&f.size<1&&l.delete(u)})}}else s=new Gn([Wn(d,p)])}else s=new Gn([W.of({data:{}})]),r=this.prepareContext(r);var y=this.transform(e).clientQuery;return y&&(s=ao(s,function(S){return a.localState.runResolvers({document:y,remoteResult:S,context:r,variables:n})})),s},t.prototype.getResultsFromLink=function(e,r,n){var i=e.lastRequestId=this.generateRequestId(),a=this.cache.transformForLink(this.transform(e.document).document);return ao(this.getObservableFromLink(a,n.context,n.variables),function(o){var s=co(o),u=s.length>0;if(i>=e.lastRequestId){if(u&&n.errorPolicy==="none")throw e.markError(new rr({graphQLErrors:s}));e.markResult(o,a,n,r),e.markReady()}var c={data:o.data,loading:!1,networkStatus:ie.ready};return u&&n.errorPolicy!=="ignore"&&(c.errors=s,c.networkStatus=ie.error),c},function(o){var s=Bp(o)?o:new rr({networkError:o});throw i>=e.lastRequestId&&e.markError(s),s})},t.prototype.fetchQueryObservable=function(e,r,n){var i=this;n===void 0&&(n=ie.loading);var a=this.transform(r.query).document,o=this.getVariables(a,r.variables),s=this.getQuery(e),u=this.defaultOptions.watchQuery,c=r.fetchPolicy,l=c===void 0?u&&u.fetchPolicy||"cache-first":c,d=r.errorPolicy,p=d===void 0?u&&u.errorPolicy||"none":d,f=r.returnPartialData,h=f===void 0?!1:f,g=r.notifyOnNetworkStatusChange,y=g===void 0?!1:g,S=r.context,b=S===void 0?{}:S,v=Object.assign({},r,{query:a,variables:o,fetchPolicy:l,errorPolicy:p,returnPartialData:h,notifyOnNetworkStatusChange:y,context:b}),m=function(E){v.variables=E;var O=i.fetchQueryByPolicy(s,v,n);return v.fetchPolicy!=="standby"&&O.length>0&&s.observableQuery&&s.observableQuery.applyNextFetchPolicy("after-fetch",r),O},A=function(){return i.fetchCancelFns.delete(e)};this.fetchCancelFns.set(e,function(E){A(),setTimeout(function(){return D.cancel(E)})});var D=new Gn(this.transform(v.query).hasClientExports?this.localState.addExportedVariables(v.query,v.variables,v.context).then(m):m(v.variables));return D.promise.then(A,A),D},t.prototype.refetchQueries=function(e){var r=this,n=e.updateCache,i=e.include,a=e.optimistic,o=a===void 0?!1:a,s=e.removeOptimistic,u=s===void 0?o?qi("refetchQueries"):void 0:s,c=e.onQueryUpdated,l=new Map;i&&this.getObservableQueries(i).forEach(function(p,f){l.set(f,{oq:p,lastDiff:r.getQuery(f).getDiff()})});var d=new Map;return n&&this.cache.batch({update:n,optimistic:o&&u||!1,removeOptimistic:u,onWatchUpdated:function(p,f,h){var g=p.watcher instanceof Io&&p.watcher.observableQuery;if(g){if(c){l.delete(g.queryId);var y=c(g,f,h);return y===!0&&(y=g.refetch()),y!==!1&&d.set(g,y),y}c!==null&&l.set(g.queryId,{oq:g,lastDiff:h,diff:f})}}}),l.size&&l.forEach(function(p,f){var h=p.oq,g=p.lastDiff,y=p.diff,S;if(c){if(!y){var b=h.queryInfo;b.reset(),y=b.getDiff()}S=c(h,y,g)}(!c||S===!0)&&(S=h.refetch()),S!==!1&&d.set(h,S),f.indexOf("legacyOneTimeQuery")>=0&&r.stopQueryNoBroadcast(f)}),u&&this.cache.removeOptimistic(u),d},t.prototype.fetchQueryByPolicy=function(e,r,n){var i=this,a=r.query,o=r.variables,s=r.fetchPolicy,u=r.refetchWritePolicy,c=r.errorPolicy,l=r.returnPartialData,d=r.context,p=r.notifyOnNetworkStatusChange,f=e.networkStatus;e.init({document:this.transform(a).document,variables:o,networkStatus:n});var h=function(){return e.getDiff(o)},g=function(m,A){A===void 0&&(A=e.networkStatus||ie.loading);var D=m.result;__DEV__&&!l&&!be(D,{})&&su(m.missing);var E=function(O){return W.of(_({data:O,loading:Er(A),networkStatus:A},m.complete?null:{partial:!0}))};return D&&i.transform(a).hasForcedResolvers?i.localState.runResolvers({document:a,remoteResult:{data:D},context:d,variables:o,onlyRunForcedResolvers:!0}).then(function(O){return E(O.data||void 0)}):c==="none"&&A===ie.refetch&&Array.isArray(m.missing)?E(void 0):E(D)},y=s==="no-cache"?0:n===ie.refetch&&u!=="merge"?1:2,S=function(){return i.getResultsFromLink(e,y,{variables:o,context:d,fetchPolicy:s,errorPolicy:c})},b=p&&typeof f=="number"&&f!==n&&Er(n);switch(s){default:case"cache-first":{var v=h();return v.complete?[g(v,e.markReady())]:l||b?[g(v),S()]:[S()]}case"cache-and-network":{var v=h();return v.complete||l||b?[g(v),S()]:[S()]}case"cache-only":return[g(h(),e.markReady())];case"network-only":return b?[g(h()),S()]:[S()];case"no-cache":return b?[g(e.getDiff()),S()]:[S()];case"standby":return[]}},t.prototype.getQuery=function(e){return e&&!this.queries.has(e)&&this.queries.set(e,new Io(this,e)),this.queries.get(e)},t.prototype.prepareContext=function(e){e===void 0&&(e={});var r=this.localState.prepareContext(e);return _(_({},r),{clientAwareness:this.clientAwareness})},t}();var Qp=!1;var uu=function(){function t(e){var r=this;this.resetStoreCallbacks=[],this.clearStoreCallbacks=[];var n=e.uri,i=e.credentials,a=e.headers,o=e.cache,s=e.ssrMode,u=s===void 0?!1:s,c=e.ssrForceFetchDelay,l=c===void 0?0:c,d=e.connectToDevTools,p=d===void 0?typeof window=="object"&&!window.__APOLLO_CLIENT__&&__DEV__:d,f=e.queryDeduplication,h=f===void 0?!0:f,g=e.defaultOptions,y=e.assumeImmutableResults,S=y===void 0?!1:y,b=e.resolvers,v=e.typeDefs,m=e.fragmentMatcher,A=e.name,D=e.version,E=e.link;if(E||(E=n?new Fc({uri:n,credentials:i,headers:a}):St.empty()),!o)throw __DEV__?new V(`To initialize Apollo Client, you must specify a 'cache' property in the options object.
|
|
53
|
-
For more information, please visit: https://go.apollo.dev/c/docs`):new V(9);if(this.link=E,this.cache=o,this.disableNetworkFetches=u||l>0,this.queryDeduplication=h,this.defaultOptions=g||Object.create(null),this.typeDefs=v,l&&setTimeout(function(){return r.disableNetworkFetches=!1},l),this.watchQuery=this.watchQuery.bind(this),this.query=this.query.bind(this),this.mutate=this.mutate.bind(this),this.resetStore=this.resetStore.bind(this),this.reFetchObservableQueries=this.reFetchObservableQueries.bind(this),p&&typeof window=="object"&&(window.__APOLLO_CLIENT__=this),!Qp&&p&&__DEV__&&(Qp=!0,typeof window<"u"&&window.document&&window.top===window.self&&!window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__)){var O=window.navigator,P=O&&O.userAgent,N=void 0;typeof P=="string"&&(P.indexOf("Chrome/")>-1?N="https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm":P.indexOf("Firefox/")>-1&&(N="https://addons.mozilla.org/en-US/firefox/addon/apollo-developer-tools/")),N&&__DEV__&&I.log("Download the Apollo DevTools for a better development experience: "+N)}this.version=Df,this.localState=new Ao({cache:o,client:this,resolvers:b,fragmentMatcher:m}),this.queryManager=new zp({cache:this.cache,link:this.link,defaultOptions:this.defaultOptions,queryDeduplication:h,ssrMode:u,clientAwareness:{name:A,version:D},localState:this.localState,assumeImmutableResults:S,onBroadcast:p?function(){r.devToolsHookCb&&r.devToolsHookCb({action:{},state:{queries:r.queryManager.getQueryStore(),mutations:r.queryManager.mutationStore||{}},dataWithOptimisticResults:r.cache.extract(!0)})}:void 0})}return t.prototype.stop=function(){this.queryManager.stop()},t.prototype.watchQuery=function(e){return this.defaultOptions.watchQuery&&(e=Bi(this.defaultOptions.watchQuery,e)),this.disableNetworkFetches&&(e.fetchPolicy==="network-only"||e.fetchPolicy==="cache-and-network")&&(e=_(_({},e),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(e)},t.prototype.query=function(e){return this.defaultOptions.query&&(e=Bi(this.defaultOptions.query,e)),__DEV__?I(e.fetchPolicy!=="cache-and-network","The cache-and-network fetchPolicy does not work with client.query, because client.query can only return a single result. Please use client.watchQuery to receive multiple results from the cache and the network, or consider using a different fetchPolicy, such as cache-first or network-only."):I(e.fetchPolicy!=="cache-and-network",10),this.disableNetworkFetches&&e.fetchPolicy==="network-only"&&(e=_(_({},e),{fetchPolicy:"cache-first"})),this.queryManager.query(e)},t.prototype.mutate=function(e){return this.defaultOptions.mutate&&(e=Bi(this.defaultOptions.mutate,e)),this.queryManager.mutate(e)},t.prototype.subscribe=function(e){return this.queryManager.startGraphQLSubscription(e)},t.prototype.readQuery=function(e,r){return r===void 0&&(r=!1),this.cache.readQuery(e,r)},t.prototype.readFragment=function(e,r){return r===void 0&&(r=!1),this.cache.readFragment(e,r)},t.prototype.writeQuery=function(e){var r=this.cache.writeQuery(e);return e.broadcast!==!1&&this.queryManager.broadcastQueries(),r},t.prototype.writeFragment=function(e){var r=this.cache.writeFragment(e);return e.broadcast!==!1&&this.queryManager.broadcastQueries(),r},t.prototype.__actionHookForDevTools=function(e){this.devToolsHookCb=e},t.prototype.__requestRaw=function(e){return Wn(this.link,e)},t.prototype.resetStore=function(){var e=this;return Promise.resolve().then(function(){return e.queryManager.clearStore({discardWatches:!1})}).then(function(){return Promise.all(e.resetStoreCallbacks.map(function(r){return r()}))}).then(function(){return e.reFetchObservableQueries()})},t.prototype.clearStore=function(){var e=this;return Promise.resolve().then(function(){return e.queryManager.clearStore({discardWatches:!0})}).then(function(){return Promise.all(e.clearStoreCallbacks.map(function(r){return r()}))})},t.prototype.onResetStore=function(e){var r=this;return this.resetStoreCallbacks.push(e),function(){r.resetStoreCallbacks=r.resetStoreCallbacks.filter(function(n){return n!==e})}},t.prototype.onClearStore=function(e){var r=this;return this.clearStoreCallbacks.push(e),function(){r.clearStoreCallbacks=r.clearStoreCallbacks.filter(function(n){return n!==e})}},t.prototype.reFetchObservableQueries=function(e){return this.queryManager.reFetchObservableQueries(e)},t.prototype.refetchQueries=function(e){var r=this.queryManager.refetchQueries(e),n=[],i=[];r.forEach(function(o,s){n.push(s),i.push(o)});var a=Promise.all(i);return a.queries=n,a.results=i,a.catch(function(o){__DEV__&&I.debug("In client.refetchQueries, Promise.all promise rejected with error ".concat(o))}),a},t.prototype.getObservableQueries=function(e){return e===void 0&&(e="active"),this.queryManager.getObservableQueries(e)},t.prototype.extract=function(e){return this.cache.extract(e)},t.prototype.restore=function(e){return this.cache.restore(e)},t.prototype.addResolvers=function(e){this.localState.addResolvers(e)},t.prototype.setResolvers=function(e){this.localState.setResolvers(e)},t.prototype.getResolvers=function(){return this.localState.getResolvers()},t.prototype.setLocalStateFragmentMatcher=function(e){this.localState.setFragmentMatcher(e)},t.prototype.setLink=function(e){this.link=this.queryManager.link=e},t}();rf(Kr?"log":"silent");function Ye(t){return t===null?"null":Array.isArray(t)?"array":typeof t}function nr(t){return Ye(t)==="object"}function Gp(t){return Array.isArray(t)&&t.length>0&&t.every(e=>"message"in e)}function lu(t,e){return t.length<124?t:e}var Hp="graphql-transport-ws";var at;(function(t){t[t.InternalServerError=4500]="InternalServerError",t[t.InternalClientError=4005]="InternalClientError",t[t.BadRequest=4400]="BadRequest",t[t.BadResponse=4004]="BadResponse",t[t.Unauthorized=4401]="Unauthorized",t[t.Forbidden=4403]="Forbidden",t[t.SubprotocolNotAcceptable=4406]="SubprotocolNotAcceptable",t[t.ConnectionInitialisationTimeout=4408]="ConnectionInitialisationTimeout",t[t.ConnectionAcknowledgementTimeout=4504]="ConnectionAcknowledgementTimeout",t[t.SubscriberAlreadyExists=4409]="SubscriberAlreadyExists",t[t.TooManyInitialisationRequests=4429]="TooManyInitialisationRequests"})(at||(at={}));var Te;(function(t){t.ConnectionInit="connection_init",t.ConnectionAck="connection_ack",t.Ping="ping",t.Pong="pong",t.Subscribe="subscribe",t.Next="next",t.Error="error",t.Complete="complete"})(Te||(Te={}));function Wp(t){if(!nr(t))throw new Error(`Message is expected to be an object, but got ${Ye(t)}`);if(!t.type)throw new Error("Message is missing the 'type' property");if(typeof t.type!="string")throw new Error(`Message is expects the 'type' property to be a string, but got ${Ye(t.type)}`);switch(t.type){case Te.ConnectionInit:case Te.ConnectionAck:case Te.Ping:case Te.Pong:{if(t.payload!=null&&!nr(t.payload))throw new Error(`"${t.type}" message expects the 'payload' property to be an object or nullish or missing, but got "${t.payload}"`);break}case Te.Subscribe:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${Ye(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);if(!nr(t.payload))throw new Error(`"${t.type}" message expects the 'payload' property to be an object, but got ${Ye(t.payload)}`);if(typeof t.payload.query!="string")throw new Error(`"${t.type}" message payload expects the 'query' property to be a string, but got ${Ye(t.payload.query)}`);if(t.payload.variables!=null&&!nr(t.payload.variables))throw new Error(`"${t.type}" message payload expects the 'variables' property to be a an object or nullish or missing, but got ${Ye(t.payload.variables)}`);if(t.payload.operationName!=null&&Ye(t.payload.operationName)!=="string")throw new Error(`"${t.type}" message payload expects the 'operationName' property to be a string or nullish or missing, but got ${Ye(t.payload.operationName)}`);if(t.payload.extensions!=null&&!nr(t.payload.extensions))throw new Error(`"${t.type}" message payload expects the 'extensions' property to be a an object or nullish or missing, but got ${Ye(t.payload.extensions)}`);break}case Te.Next:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${Ye(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);if(!nr(t.payload))throw new Error(`"${t.type}" message expects the 'payload' property to be an object, but got ${Ye(t.payload)}`);break}case Te.Error:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${Ye(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);if(!Gp(t.payload))throw new Error(`"${t.type}" message expects the 'payload' property to be an array of GraphQL errors, but got ${JSON.stringify(t.payload)}`);break}case Te.Complete:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${Ye(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);break}default:throw new Error(`Invalid message 'type' property "${t.type}"`)}return t}function Kp(t,e){return Wp(typeof t=="string"?JSON.parse(t,e):t)}function ti(t,e){return Wp(t),JSON.stringify(t,e)}function Zp(t){let{url:e,connectionParams:r,lazy:n=!0,onNonLazyError:i=console.error,lazyCloseTimeout:a=0,keepAlive:o=0,disablePong:s,connectionAckWaitTimeout:u=0,retryAttempts:c=5,retryWait:l=async function(de){let he=1e3;for(let J=0;J<de;J++)he*=2;await new Promise(J=>setTimeout(J,he+Math.floor(Math.random()*(3e3-300)+300)))},shouldRetry:d=Do,isFatalConnectionProblem:p,on:f,webSocketImpl:h,generateID:g=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,de=>{let he=Math.random()*16|0;return(de=="x"?he:he&3|8).toString(16)})},jsonMessageReplacer:y,jsonMessageReviver:S}=t,b;if(h){if(!dg(h))throw new Error("Invalid WebSocket implementation provided");b=h}else typeof WebSocket<"u"?b=WebSocket:typeof global<"u"?b=global.WebSocket||global.MozWebSocket:typeof window<"u"&&(b=window.WebSocket||window.MozWebSocket);if(!b)throw new Error("WebSocket implementation missing; on Node you can `import WebSocket from 'ws';` and pass `webSocketImpl: WebSocket` to `createClient`");let v=b,m=(()=>{let q=(()=>{let he={};return{on(J,X){return he[J]=X,()=>{delete he[J]}},emit(J){var X;"id"in J&&((X=he[J.id])===null||X===void 0||X.call(he,J))}}})(),de={connecting:f?.connecting?[f.connecting]:[],opened:f?.opened?[f.opened]:[],connected:f?.connected?[f.connected]:[],ping:f?.ping?[f.ping]:[],pong:f?.pong?[f.pong]:[],message:f?.message?[q.emit,f.message]:[q.emit],closed:f?.closed?[f.closed]:[],error:f?.error?[f.error]:[]};return{onMessage:q.on,on(he,J){let X=de[he];return X.push(J),()=>{X.splice(X.indexOf(J),1)}},emit(he,...J){for(let X of[...de[he]])X(...J)}}})();function A(q){let de=[m.on("error",he=>{de.forEach(J=>J()),q(he)}),m.on("closed",he=>{de.forEach(J=>J()),q(he)})]}let D,E=0,O,P=!1,N=0,j=!1;async function qe(){clearTimeout(O);let[q,de]=await(D??(D=new Promise((X,Ft)=>(async()=>{if(P){if(await l(N),!E)return D=void 0,Ft({code:1e3,reason:"All Subscriptions Gone"});N++}m.emit("connecting");let H=new v(typeof e=="function"?await e():e,Hp),Mt,fr;function Ba(){isFinite(o)&&o>0&&(clearTimeout(fr),fr=setTimeout(()=>{H.readyState===v.OPEN&&(H.send(ti({type:Te.Ping})),m.emit("ping",!1,void 0))},o))}A(Be=>{D=void 0,clearTimeout(Mt),clearTimeout(fr),Ft(Be),Do(Be)&&Be.code===4499&&(H.close(4499,"Terminated"),H.onerror=null,H.onclose=null)}),H.onerror=Be=>m.emit("error",Be),H.onclose=Be=>m.emit("closed",Be),H.onopen=async()=>{try{m.emit("opened",H);let Be=typeof r=="function"?await r():r;if(H.readyState!==v.OPEN)return;H.send(ti(Be?{type:Te.ConnectionInit,payload:Be}:{type:Te.ConnectionInit},y)),isFinite(u)&&u>0&&(Mt=setTimeout(()=>{H.close(at.ConnectionAcknowledgementTimeout,"Connection acknowledgement timeout")},u)),Ba()}catch(Be){m.emit("error",Be),H.close(at.InternalClientError,lu(Be instanceof Error?Be.message:new Error(Be).message,"Internal client error"))}};let $n=!1;H.onmessage=({data:Be})=>{try{let Ve=Kp(Be,S);if(m.emit("message",Ve),Ve.type==="ping"||Ve.type==="pong"){m.emit(Ve.type,!0,Ve.payload),Ve.type==="pong"?Ba():s||(H.send(ti(Ve.payload?{type:Te.Pong,payload:Ve.payload}:{type:Te.Pong})),m.emit("pong",!1,Ve.payload));return}if($n)return;if(Ve.type!==Te.ConnectionAck)throw new Error(`First message cannot be of type ${Ve.type}`);clearTimeout(Mt),$n=!0,m.emit("connected",H,Ve.payload),P=!1,N=0,X([H,new Promise((F2,cm)=>A(cm))])}catch(Ve){H.onmessage=null,m.emit("error",Ve),H.close(at.BadResponse,lu(Ve instanceof Error?Ve.message:new Error(Ve).message,"Bad response"))}}})())));q.readyState===v.CLOSING&&await de;let he=()=>{},J=new Promise(X=>he=X);return[q,he,Promise.race([J.then(()=>{if(!E){let X=()=>q.close(1e3,"Normal Closure");isFinite(a)&&a>0?O=setTimeout(()=>{q.readyState===v.OPEN&&X()},a):X()}}),de])]}function Ne(q){if(Do(q)&&(pg(q.code)||[at.InternalServerError,at.InternalClientError,at.BadRequest,at.BadResponse,at.Unauthorized,at.SubprotocolNotAcceptable,at.SubscriberAlreadyExists,at.TooManyInitialisationRequests].includes(q.code)))throw q;if(j)return!1;if(Do(q)&&q.code===1e3)return E>0;if(!c||N>=c||!d(q)||p?.(q))throw q;return P=!0}return n||(async()=>{for(E++;;)try{let[,,q]=await qe();await q}catch(q){try{if(!Ne(q))return}catch(de){return i?.(de)}}})(),{on:m.on,subscribe(q,de){let he=g(q),J=!1,X=!1,Ft=()=>{E--,J=!0};return(async()=>{for(E++;;)try{let[H,Mt,fr]=await qe();if(J)return Mt();let Ba=m.onMessage(he,$n=>{switch($n.type){case Te.Next:{de.next($n.payload);return}case Te.Error:{X=!0,J=!0,de.error($n.payload),Ft();return}case Te.Complete:{J=!0,Ft();return}}});H.send(ti({id:he,type:Te.Subscribe,payload:q},y)),Ft=()=>{!J&&H.readyState===v.OPEN&&H.send(ti({id:he,type:Te.Complete},y)),E--,J=!0,Mt()},await fr.finally(Ba);return}catch(H){if(!Ne(H))return}})().then(()=>{X||de.complete()}).catch(H=>{de.error(H)}),()=>{J||Ft()}},async dispose(){if(j=!0,D){let[q]=await D;q.close(1e3,"Normal Closure")}},terminate(){D&&m.emit("closed",{code:4499,reason:"Terminated",wasClean:!1})}}}function Do(t){return nr(t)&&"code"in t&&"reason"in t}function pg(t){return[1e3,1001,1006,1005,1012,1013,1013].includes(t)?!1:t>=1e3&&t<=1999}function dg(t){return typeof t=="function"&&"constructor"in t&&"CLOSED"in t&&"CLOSING"in t&&"CONNECTING"in t&&"OPEN"in t}function hg(t){return ee(t)&&"code"in t&&"reason"in t}var Yp=function(t){xe(e,t);function e(r){var n=t.call(this)||this;return n.client=r,n}return e.prototype.request=function(r){var n=this;return new W(function(i){return n.client.subscribe(_(_({},r),{query:jn(r.query)}),{next:i.next.bind(i),complete:i.complete.bind(i),error:function(a){return a instanceof Error?i.error(a):hg(a)?i.error(new Error("Socket closed with event ".concat(a.code," ").concat(a.reason||""))):i.error(new rr({graphQLErrors:Array.isArray(a)?a:[a]}))}})})},e}(St);var as=function(){return as=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},as.apply(this,arguments)};typeof SuppressedError=="function"&&SuppressedError;function zo(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?zo=function(r){return typeof r}:zo=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},zo(t)}function mg(t){return zo(t)=="object"&&t!==null}var sh=typeof Symbol=="function"&&Symbol.toStringTag!=null?Symbol.toStringTag:"@@toStringTag";function Du(t,e){for(var r=/\r\n|[\n\r]/g,n=1,i=e+1,a;(a=r.exec(t.body))&&a.index<e;)n+=1,i=e+1-(a.index+a[0].length);return{line:n,column:i}}function gg(t){return ch(t.source,Du(t.source,t.start))}function ch(t,e){var r=t.locationOffset.column-1,n=Qo(r)+t.body,i=e.line-1,a=t.locationOffset.line-1,o=e.line+a,s=e.line===1?r:0,u=e.column+s,c="".concat(t.name,":").concat(o,":").concat(u,`
|
|
54
|
-
`),l=n.split(/\r\n|[\n\r]/g),d=l[i];if(d.length>120){for(var p=Math.floor(u/80),f=u%80,h=[],g=0;g<d.length;g+=80)h.push(d.slice(g,g+80));return c+
|
|
55
|
-
`)}function
|
|
51
|
+
`)),e=e.replace(/\n$/,""),e},rr=function(t){xe(e,t);function e(r){var n=r.graphQLErrors,i=r.clientErrors,a=r.networkError,o=r.errorMessage,s=r.extraInfo,u=t.call(this,o)||this;return u.name="ApolloError",u.graphQLErrors=n||[],u.clientErrors=i||[],u.networkError=a||null,u.message=o||cg(u),u.extraInfo=s,u.__proto__=e.prototype,u}return e}(Error);var ie;(function(t){t[t.loading=1]="loading",t[t.setVariables=2]="setVariables",t[t.fetchMore=3]="fetchMore",t[t.refetch=4]="refetch",t[t.poll=6]="poll",t[t.ready=7]="ready",t[t.error=8]="error"})(ie||(ie={}));function xr(t){return t?t<7:!1}var ug=Object.assign,lg=Object.hasOwnProperty,Ao=function(t){xe(e,t);function e(r){var n=r.queryManager,i=r.queryInfo,a=r.options,o=t.call(this,function(y){try{var S=y._subscription._observer;S&&!S.error&&(S.error=fg)}catch{}var b=!o.observers.size;o.observers.add(y);var v=o.last;return v&&v.error?y.error&&y.error(v.error):v&&v.result&&y.next&&y.next(v.result),b&&o.reobserve().catch(function(){}),function(){o.observers.delete(y)&&!o.observers.size&&o.tearDownQuery()}})||this;o.observers=new Set,o.subscriptions=new Set,o.queryInfo=i,o.queryManager=n,o.isTornDown=!1;var s=n.defaultOptions.watchQuery,u=s===void 0?{}:s,c=u.fetchPolicy,l=c===void 0?"cache-first":c,d=a.fetchPolicy,p=d===void 0?l:d,f=a.initialFetchPolicy,h=f===void 0?p==="standby"?l:p:f;o.options=_(_({},a),{initialFetchPolicy:h,fetchPolicy:p}),o.queryId=i.queryId||n.generateQueryId();var g=qt(o.query);return o.queryName=g&&g.name&&g.name.value,o}return Object.defineProperty(e.prototype,"query",{get:function(){return this.queryManager.transform(this.options.query).document},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"variables",{get:function(){return this.options.variables},enumerable:!1,configurable:!0}),e.prototype.result=function(){var r=this;return new Promise(function(n,i){var a={next:function(s){n(s),r.observers.delete(a),r.observers.size||r.queryManager.removeQuery(r.queryId),setTimeout(function(){o.unsubscribe()},0)},error:i},o=r.subscribe(a)})},e.prototype.getCurrentResult=function(r){r===void 0&&(r=!0);var n=this.getLastResult(!0),i=this.queryInfo.networkStatus||n&&n.networkStatus||ie.ready,a=_(_({},n),{loading:xr(i),networkStatus:i}),o=this.options.fetchPolicy,s=o===void 0?"cache-first":o;if(!(s==="network-only"||s==="no-cache"||s==="standby"||this.queryManager.transform(this.options.query).hasForcedResolvers)){var u=this.queryInfo.getDiff();(u.complete||this.options.returnPartialData)&&(a.data=u.result),be(a.data,{})&&(a.data=void 0),u.complete?(delete a.partial,u.complete&&a.networkStatus===ie.loading&&(s==="cache-first"||s==="cache-only")&&(a.networkStatus=ie.ready,a.loading=!1)):a.partial=!0,__DEV__&&!u.complete&&!this.options.partialRefetch&&!a.loading&&!a.data&&!a.error&&uu(u.missing)}return r&&this.updateLastResult(a),a},e.prototype.isDifferentFromLastResult=function(r,n){return!this.last||!be(this.last.result,r)||n&&!be(this.last.variables,n)},e.prototype.getLast=function(r,n){var i=this.last;if(i&&i[r]&&(!n||be(i.variables,this.variables)))return i[r]},e.prototype.getLastResult=function(r){return this.getLast("result",r)},e.prototype.getLastError=function(r){return this.getLast("error",r)},e.prototype.resetLastResults=function(){delete this.last,this.isTornDown=!1},e.prototype.resetQueryStoreErrors=function(){this.queryManager.resetErrors(this.queryId)},e.prototype.refetch=function(r){var n,i={pollInterval:0},a=this.options.fetchPolicy;if(a==="cache-and-network"?i.fetchPolicy=a:a==="no-cache"?i.fetchPolicy="no-cache":i.fetchPolicy="network-only",__DEV__&&r&&lg.call(r,"variables")){var o=Mi(this.query),s=o.variableDefinitions;(!s||!s.some(function(u){return u.variable.name.value==="variables"}))&&__DEV__&&I.warn("Called refetch(".concat(JSON.stringify(r),") for query ").concat(((n=o.name)===null||n===void 0?void 0:n.value)||JSON.stringify(o),`, which does not declare a $variables variable.
|
|
52
|
+
Did you mean to call refetch(variables) instead of refetch({ variables })?`))}return r&&!be(this.options.variables,r)&&(i.variables=this.options.variables=_(_({},this.options.variables),r)),this.queryInfo.resetLastWrite(),this.reobserve(i,ie.refetch)},e.prototype.fetchMore=function(r){var n=this,i=_(_({},r.query?r:_(_(_(_({},this.options),{query:this.query}),r),{variables:_(_({},this.options.variables),r.variables)})),{fetchPolicy:"no-cache"}),a=this.queryManager.generateQueryId(),o=this.queryInfo,s=o.networkStatus;o.networkStatus=ie.fetchMore,i.notifyOnNetworkStatusChange&&this.observe();var u=new Set;return this.queryManager.fetchQuery(a,i,ie.fetchMore).then(function(c){return n.queryManager.removeQuery(a),o.networkStatus===ie.fetchMore&&(o.networkStatus=s),n.queryManager.cache.batch({update:function(l){var d=r.updateQuery;d?l.updateQuery({query:n.query,variables:n.variables,returnPartialData:!0,optimistic:!1},function(p){return d(p,{fetchMoreResult:c.data,variables:i.variables})}):l.writeQuery({query:i.query,variables:i.variables,data:c.data})},onWatchUpdated:function(l){u.add(l.query)}}),c}).finally(function(){u.has(n.query)||cu(n)})},e.prototype.subscribeToMore=function(r){var n=this,i=this.queryManager.startGraphQLSubscription({query:r.document,variables:r.variables,context:r.context}).subscribe({next:function(a){var o=r.updateQuery;o&&n.updateQuery(function(s,u){var c=u.variables;return o(s,{subscriptionData:a,variables:c})})},error:function(a){if(r.onError){r.onError(a);return}__DEV__&&I.error("Unhandled GraphQL subscription error",a)}});return this.subscriptions.add(i),function(){n.subscriptions.delete(i)&&i.unsubscribe()}},e.prototype.setOptions=function(r){return this.reobserve(r)},e.prototype.setVariables=function(r){return be(this.variables,r)?this.observers.size?this.result():Promise.resolve():(this.options.variables=r,this.observers.size?this.reobserve({fetchPolicy:this.options.initialFetchPolicy,variables:r},ie.setVariables):Promise.resolve())},e.prototype.updateQuery=function(r){var n=this.queryManager,i=n.cache.diff({query:this.options.query,variables:this.variables,returnPartialData:!0,optimistic:!1}).result,a=r(i,{variables:this.variables});a&&(n.cache.writeQuery({query:this.options.query,data:a,variables:this.variables}),n.broadcastQueries())},e.prototype.startPolling=function(r){this.options.pollInterval=r,this.updatePolling()},e.prototype.stopPolling=function(){this.options.pollInterval=0,this.updatePolling()},e.prototype.applyNextFetchPolicy=function(r,n){if(n.nextFetchPolicy){var i=n.fetchPolicy,a=i===void 0?"cache-first":i,o=n.initialFetchPolicy,s=o===void 0?a:o;a==="standby"||(typeof n.nextFetchPolicy=="function"?n.fetchPolicy=n.nextFetchPolicy(a,{reason:r,options:n,observable:this,initialFetchPolicy:s}):r==="variables-changed"?n.fetchPolicy=s:n.fetchPolicy=n.nextFetchPolicy)}return n.fetchPolicy},e.prototype.fetch=function(r,n){return this.queryManager.setObservableQuery(this),this.queryManager.fetchQueryObservable(this.queryId,r,n)},e.prototype.updatePolling=function(){var r=this;if(!this.queryManager.ssrMode){var n=this,i=n.pollingInfo,a=n.options.pollInterval;if(!a){i&&(clearTimeout(i.timeout),delete this.pollingInfo);return}if(!(i&&i.interval===a)){__DEV__?I(a,"Attempted to start a polling query without a polling interval."):I(a,13);var o=i||(this.pollingInfo={});o.interval=a;var s=function(){r.pollingInfo&&(xr(r.queryInfo.networkStatus)?u():r.reobserve({fetchPolicy:r.options.initialFetchPolicy==="no-cache"?"no-cache":"network-only"},ie.poll).then(u,u))},u=function(){var c=r.pollingInfo;c&&(clearTimeout(c.timeout),c.timeout=setTimeout(s,c.interval))};u()}}},e.prototype.updateLastResult=function(r,n){return n===void 0&&(n=this.variables),this.last=_(_({},this.last),{result:this.queryManager.assumeImmutableResults?r:ao(r),variables:n}),Re(r.errors)||delete this.last.error,this.last},e.prototype.reobserve=function(r,n){var i=this;this.isTornDown=!1;var a=n===ie.refetch||n===ie.fetchMore||n===ie.poll,o=this.options.variables,s=this.options.fetchPolicy,u=wr(this.options,r||{}),c=a?u:ug(this.options,u);a||(this.updatePolling(),r&&r.variables&&!be(r.variables,o)&&c.fetchPolicy!=="standby"&&c.fetchPolicy===s&&(this.applyNextFetchPolicy("variables-changed",c),n===void 0&&(n=ie.setVariables)));var l=c.variables&&_({},c.variables),d=this.fetch(c,n),p={next:function(f){i.reportResult(f,l)},error:function(f){i.reportError(f,l)}};return a||(this.concast&&this.observer&&this.concast.removeObserver(this.observer),this.concast=d,this.observer=p),d.addObserver(p),d.promise},e.prototype.observe=function(){this.reportResult(this.getCurrentResult(!1),this.variables)},e.prototype.reportResult=function(r,n){var i=this.getLastError();(i||this.isDifferentFromLastResult(r,n))&&((i||!r.partial||this.options.returnPartialData)&&this.updateLastResult(r,n),an(this.observers,"next",r))},e.prototype.reportError=function(r,n){var i=_(_({},this.getLastResult()),{error:r,errors:r.graphQLErrors,networkStatus:ie.error,loading:!1});this.updateLastResult(i,n),an(this.observers,"error",this.last.error=r)},e.prototype.hasObservers=function(){return this.observers.size>0},e.prototype.tearDownQuery=function(){this.isTornDown||(this.concast&&this.observer&&(this.concast.removeObserver(this.observer),delete this.concast,delete this.observer),this.stopPolling(),this.subscriptions.forEach(function(r){return r.unsubscribe()}),this.subscriptions.clear(),this.queryManager.stopQuery(this.queryId),this.observers.clear(),this.isTornDown=!0)},e}(W);so(Ao);function cu(t){var e=t.options,r=e.fetchPolicy,n=e.nextFetchPolicy;return r==="cache-and-network"||r==="network-only"?t.reobserve({fetchPolicy:"cache-first",nextFetchPolicy:function(){return this.nextFetchPolicy=n,typeof n=="function"?n.apply(this,arguments):r}}):t.reobserve()}function fg(t){__DEV__&&I.error("Unhandled error",t.message,t.stack)}function uu(t){__DEV__&&t&&__DEV__&&I.debug("Missing cache result fields: ".concat(JSON.stringify(t)),t)}var Io=function(){function t(e){var r=e.cache,n=e.client,i=e.resolvers,a=e.fragmentMatcher;this.selectionsToResolveCache=new WeakMap,this.cache=r,n&&(this.client=n),i&&this.addResolvers(i),a&&this.setFragmentMatcher(a)}return t.prototype.addResolvers=function(e){var r=this;this.resolvers=this.resolvers||{},Array.isArray(e)?e.forEach(function(n){r.resolvers=Sc(r.resolvers,n)}):this.resolvers=Sc(this.resolvers,e)},t.prototype.setResolvers=function(e){this.resolvers={},this.addResolvers(e)},t.prototype.getResolvers=function(){return this.resolvers||{}},t.prototype.runResolvers=function(e){var r=e.document,n=e.remoteResult,i=e.context,a=e.variables,o=e.onlyRunForcedResolvers,s=o===void 0?!1:o;return Tt(this,void 0,void 0,function(){return At(this,function(u){return r?[2,this.resolveDocument(r,n.data,i,a,this.fragmentMatcher,s).then(function(c){return _(_({},n),{data:c.result})})]:[2,n]})})},t.prototype.setFragmentMatcher=function(e){this.fragmentMatcher=e},t.prototype.getFragmentMatcher=function(){return this.fragmentMatcher},t.prototype.clientQuery=function(e){return Bn(["client"],e)&&this.resolvers?e:null},t.prototype.serverQuery=function(e){return wc(e)},t.prototype.prepareContext=function(e){var r=this.cache;return _(_({},e),{cache:r,getCacheKey:function(n){return r.identify(n)}})},t.prototype.addExportedVariables=function(e,r,n){return r===void 0&&(r={}),n===void 0&&(n={}),Tt(this,void 0,void 0,function(){return At(this,function(i){return e?[2,this.resolveDocument(e,this.buildRootValueFromCache(e,r)||{},this.prepareContext(n),r).then(function(a){return _(_({},r),a.exportedVariables)})]:[2,_({},r)]})})},t.prototype.shouldForceResolvers=function(e){var r=!1;return Ke(e,{Directive:{enter:function(n){if(n.name.value==="client"&&n.arguments&&(r=n.arguments.some(function(i){return i.name.value==="always"&&i.value.kind==="BooleanValue"&&i.value.value===!0}),r))return Yr}}}),r},t.prototype.buildRootValueFromCache=function(e,r){return this.cache.diff({query:_c(e),variables:r,returnPartialData:!0,optimistic:!1}).result},t.prototype.resolveDocument=function(e,r,n,i,a,o){return n===void 0&&(n={}),i===void 0&&(i={}),a===void 0&&(a=function(){return!0}),o===void 0&&(o=!1),Tt(this,void 0,void 0,function(){var s,u,c,l,d,p,f,h,g,y,S;return At(this,function(b){return s=tn(e),u=en(e),c=Jr(u),l=this.collectSelectionsToResolve(s,c),d=s.operation,p=d?d.charAt(0).toUpperCase()+d.slice(1):"Query",f=this,h=f.cache,g=f.client,y={fragmentMap:c,context:_(_({},n),{cache:h,client:g}),variables:i,fragmentMatcher:a,defaultOperationType:p,exportedVariables:{},selectionsToResolve:l,onlyRunForcedResolvers:o},S=!1,[2,this.resolveSelectionSet(s.selectionSet,S,r,y).then(function(v){return{result:v,exportedVariables:y.exportedVariables}})]})})},t.prototype.resolveSelectionSet=function(e,r,n,i){return Tt(this,void 0,void 0,function(){var a,o,s,u,c,l=this;return At(this,function(d){return a=i.fragmentMap,o=i.context,s=i.variables,u=[n],c=function(p){return Tt(l,void 0,void 0,function(){var f,h;return At(this,function(g){return!r&&!i.selectionsToResolve.has(p)?[2]:er(p,s)?pt(p)?[2,this.resolveField(p,r,n,i).then(function(y){var S;typeof y<"u"&&u.push((S={},S[_t(p)]=y,S))})]:(gc(p)?f=p:(f=a[p.name.value],__DEV__?I(f,"No fragment named ".concat(p.name.value)):I(f,11)),f&&f.typeCondition&&(h=f.typeCondition.name.value,i.fragmentMatcher(n,h,o))?[2,this.resolveSelectionSet(f.selectionSet,r,n,i).then(function(y){u.push(y)})]:[2]):[2]})})},[2,Promise.all(e.selections.map(c)).then(function(){return Ui(u)})]})})},t.prototype.resolveField=function(e,r,n,i){return Tt(this,void 0,void 0,function(){var a,o,s,u,c,l,d,p,f,h=this;return At(this,function(g){return n?(a=i.variables,o=e.name.value,s=_t(e),u=o!==s,c=n[s]||n[o],l=Promise.resolve(c),(!i.onlyRunForcedResolvers||this.shouldForceResolvers(e))&&(d=n.__typename||i.defaultOperationType,p=this.resolvers&&this.resolvers[d],p&&(f=p[u?o:s],f&&(l=Promise.resolve(Xn.withValue(this.cache,f,[n,tr(e,a),i.context,{field:e,fragmentMap:i.fragmentMap}]))))),[2,l.then(function(y){var S,b;if(y===void 0&&(y=c),e.directives&&e.directives.forEach(function(m){m.name.value==="export"&&m.arguments&&m.arguments.forEach(function(A){A.name.value==="as"&&A.value.kind==="StringValue"&&(i.exportedVariables[A.value.value]=y)})}),!e.selectionSet||y==null)return y;var v=(b=(S=e.directives)===null||S===void 0?void 0:S.some(function(m){return m.name.value==="client"}))!==null&&b!==void 0?b:!1;if(Array.isArray(y))return h.resolveSubSelectedArray(e,r||v,y,i);if(e.selectionSet)return h.resolveSelectionSet(e.selectionSet,r||v,y,i)})]):[2,null]})})},t.prototype.resolveSubSelectedArray=function(e,r,n,i){var a=this;return Promise.all(n.map(function(o){if(o===null)return null;if(Array.isArray(o))return a.resolveSubSelectedArray(e,r,o,i);if(e.selectionSet)return a.resolveSelectionSet(e.selectionSet,r,o,i)}))},t.prototype.collectSelectionsToResolve=function(e,r){var n=function(o){return!Array.isArray(o)},i=this.selectionsToResolveCache;function a(o){if(!i.has(o)){var s=new Set;i.set(o,s),Ke(o,{Directive:function(u,c,l,d,p){u.name.value==="client"&&p.forEach(function(f){n(f)&&Pi(f)&&s.add(f)})},FragmentSpread:function(u,c,l,d,p){var f=r[u.name.value];__DEV__?I(f,"No fragment named ".concat(u.name.value)):I(f,12);var h=a(f);h.size>0&&(p.forEach(function(g){n(g)&&Pi(g)&&s.add(g)}),s.add(u),h.forEach(function(g){s.add(g)}))}})}return i.get(o)}return a(e)},t}();var ti=new(wt?WeakMap:Map);function lu(t,e){var r=t[e];typeof r=="function"&&(t[e]=function(){return ti.set(t,(ti.get(t)+1)%1e15),r.apply(this,arguments)})}function zp(t){t.notifyTimeout&&(clearTimeout(t.notifyTimeout),t.notifyTimeout=void 0)}var Oo=function(){function t(e,r){r===void 0&&(r=e.generateQueryId()),this.queryId=r,this.listeners=new Set,this.document=null,this.lastRequestId=1,this.subscriptions=new Set,this.stopped=!1,this.dirty=!1,this.observableQuery=null;var n=this.cache=e.cache;ti.has(n)||(ti.set(n,0),lu(n,"evict"),lu(n,"modify"),lu(n,"reset"))}return t.prototype.init=function(e){var r=e.networkStatus||ie.loading;return this.variables&&this.networkStatus!==ie.loading&&!be(this.variables,e.variables)&&(r=ie.setVariables),be(e.variables,this.variables)||(this.lastDiff=void 0),Object.assign(this,{document:e.document,variables:e.variables,networkError:null,graphQLErrors:this.graphQLErrors||[],networkStatus:r}),e.observableQuery&&this.setObservableQuery(e.observableQuery),e.lastRequestId&&(this.lastRequestId=e.lastRequestId),this},t.prototype.reset=function(){zp(this),this.dirty=!1},t.prototype.getDiff=function(e){e===void 0&&(e=this.variables);var r=this.getDiffOptions(e);if(this.lastDiff&&be(r,this.lastDiff.options))return this.lastDiff.diff;this.updateWatch(this.variables=e);var n=this.observableQuery;if(n&&n.options.fetchPolicy==="no-cache")return{complete:!1};var i=this.cache.diff(r);return this.updateLastDiff(i,r),i},t.prototype.updateLastDiff=function(e,r){this.lastDiff=e?{diff:e,options:r||this.getDiffOptions()}:void 0},t.prototype.getDiffOptions=function(e){var r;return e===void 0&&(e=this.variables),{query:this.document,variables:e,returnPartialData:!0,optimistic:!0,canonizeResults:(r=this.observableQuery)===null||r===void 0?void 0:r.options.canonizeResults}},t.prototype.setDiff=function(e){var r=this,n=this.lastDiff&&this.lastDiff.diff;this.updateLastDiff(e),!this.dirty&&!be(n&&n.result,e&&e.result)&&(this.dirty=!0,this.notifyTimeout||(this.notifyTimeout=setTimeout(function(){return r.notify()},0)))},t.prototype.setObservableQuery=function(e){var r=this;e!==this.observableQuery&&(this.oqListener&&this.listeners.delete(this.oqListener),this.observableQuery=e,e?(e.queryInfo=this,this.listeners.add(this.oqListener=function(){var n=r.getDiff();n.fromOptimisticTransaction?e.observe():cu(e)})):delete this.oqListener)},t.prototype.notify=function(){var e=this;zp(this),this.shouldNotify()&&this.listeners.forEach(function(r){return r(e)}),this.dirty=!1},t.prototype.shouldNotify=function(){if(!this.dirty||!this.listeners.size)return!1;if(xr(this.networkStatus)&&this.observableQuery){var e=this.observableQuery.options.fetchPolicy;if(e!=="cache-only"&&e!=="cache-and-network")return!1}return!0},t.prototype.stop=function(){if(!this.stopped){this.stopped=!0,this.reset(),this.cancel(),this.cancel=t.prototype.cancel,this.subscriptions.forEach(function(r){return r.unsubscribe()});var e=this.observableQuery;e&&e.stopPolling()}},t.prototype.cancel=function(){},t.prototype.updateWatch=function(e){var r=this;e===void 0&&(e=this.variables);var n=this.observableQuery;if(!(n&&n.options.fetchPolicy==="no-cache")){var i=_(_({},this.getDiffOptions(e)),{watcher:this,callback:function(a){return r.setDiff(a)}});(!this.lastWatch||!be(i,this.lastWatch))&&(this.cancel(),this.cancel=this.cache.watch(this.lastWatch=i))}},t.prototype.resetLastWrite=function(){this.lastWrite=void 0},t.prototype.shouldWrite=function(e,r){var n=this.lastWrite;return!(n&&n.dmCount===ti.get(this.cache)&&be(r,n.variables)&&be(e.data,n.result.data))},t.prototype.markResult=function(e,r,n,i){var a=this,o=new it,s=Re(e.errors)?e.errors.slice(0):[];if(this.reset(),"incremental"in e&&Re(e.incremental)){var u=co(this.getDiff().result,e);e.data=u}else if("hasNext"in e&&e.hasNext){var c=this.getDiff();e.data=o.merge(c.result,e.data)}this.graphQLErrors=s,n.fetchPolicy==="no-cache"?this.updateLastDiff({result:e.data,complete:!0},this.getDiffOptions(n.variables)):i!==0&&(Do(e,n.errorPolicy)?this.cache.performTransaction(function(l){if(a.shouldWrite(e,n.variables))l.writeQuery({query:r,data:e.data,variables:n.variables,overwrite:i===1}),a.lastWrite={result:e,variables:n.variables,dmCount:ti.get(a.cache)};else if(a.lastDiff&&a.lastDiff.diff.complete){e.data=a.lastDiff.diff.result;return}var d=a.getDiffOptions(n.variables),p=l.diff(d);a.stopped||a.updateWatch(n.variables),a.updateLastDiff(p,d),p.complete&&(e.data=p.result)}):this.lastWrite=void 0)},t.prototype.markReady=function(){return this.networkError=null,this.networkStatus=ie.ready},t.prototype.markError=function(e){return this.networkStatus=ie.error,this.lastWrite=void 0,this.reset(),e.graphQLErrors&&(this.graphQLErrors=e.graphQLErrors),e.networkError&&(this.networkError=e.networkError),e},t}();function Do(t,e){e===void 0&&(e="none");var r=e==="ignore"||e==="all",n=!Wn(t);return!n&&r&&t.data&&(n=!0),n}var pg=Object.prototype.hasOwnProperty,Qp=function(){function t(e){var r=e.cache,n=e.link,i=e.defaultOptions,a=e.queryDeduplication,o=a===void 0?!1:a,s=e.onBroadcast,u=e.ssrMode,c=u===void 0?!1:u,l=e.clientAwareness,d=l===void 0?{}:l,p=e.localState,f=e.assumeImmutableResults;this.clientAwareness={},this.queries=new Map,this.fetchCancelFns=new Map,this.transformCache=new(wt?WeakMap:Map),this.queryIdCounter=1,this.requestIdCounter=1,this.mutationIdCounter=1,this.inFlightLinkObservables=new Map,this.cache=r,this.link=n,this.defaultOptions=i||Object.create(null),this.queryDeduplication=o,this.clientAwareness=d,this.localState=p||new Io({cache:r}),this.ssrMode=c,this.assumeImmutableResults=!!f,(this.onBroadcast=s)&&(this.mutationStore=Object.create(null))}return t.prototype.stop=function(){var e=this;this.queries.forEach(function(r,n){e.stopQueryNoBroadcast(n)}),this.cancelPendingFetches(__DEV__?new V("QueryManager stopped while query was in flight"):new V(14))},t.prototype.cancelPendingFetches=function(e){this.fetchCancelFns.forEach(function(r){return r(e)}),this.fetchCancelFns.clear()},t.prototype.mutate=function(e){var r,n,i=e.mutation,a=e.variables,o=e.optimisticResponse,s=e.updateQueries,u=e.refetchQueries,c=u===void 0?[]:u,l=e.awaitRefetchQueries,d=l===void 0?!1:l,p=e.update,f=e.onQueryUpdated,h=e.fetchPolicy,g=h===void 0?((r=this.defaultOptions.mutate)===null||r===void 0?void 0:r.fetchPolicy)||"network-only":h,y=e.errorPolicy,S=y===void 0?((n=this.defaultOptions.mutate)===null||n===void 0?void 0:n.errorPolicy)||"none":y,b=e.keepRootFields,v=e.context;return Tt(this,void 0,void 0,function(){var m,A,D,E,O,P;return At(this,function(N){switch(N.label){case 0:return __DEV__?I(i,"mutation option is required. You must specify your GraphQL document in the mutation option."):I(i,15),__DEV__?I(g==="network-only"||g==="no-cache","Mutations support only 'network-only' or 'no-cache' fetchPolicy strings. The default `network-only` behavior automatically writes mutation results to the cache. Passing `no-cache` skips the cache write."):I(g==="network-only"||g==="no-cache",16),m=this.generateMutationId(),A=this.transform(i),D=A.document,E=A.hasClientExports,i=this.cache.transformForLink(D),a=this.getVariables(i,a),E?[4,this.localState.addExportedVariables(i,a,v)]:[3,2];case 1:a=N.sent(),N.label=2;case 2:return O=this.mutationStore&&(this.mutationStore[m]={mutation:i,variables:a,loading:!0,error:null}),o&&this.markMutationOptimistic(o,{mutationId:m,document:i,variables:a,fetchPolicy:g,errorPolicy:S,context:v,updateQueries:s,update:p,keepRootFields:b}),this.broadcastQueries(),P=this,[2,new Promise(function(j,qe){return oo(P.getObservableFromLink(i,_(_({},v),{optimisticResponse:o}),a,!1),function(Ne){if(Wn(Ne)&&S==="none")throw new rr({graphQLErrors:uo(Ne)});O&&(O.loading=!1,O.error=null);var q=_({},Ne);return typeof c=="function"&&(c=c(q)),S==="ignore"&&Wn(q)&&delete q.errors,P.markMutationResult({mutationId:m,result:q,document:i,variables:a,fetchPolicy:g,errorPolicy:S,context:v,update:p,updateQueries:s,awaitRefetchQueries:d,refetchQueries:c,removeOptimistic:o?m:void 0,onQueryUpdated:f,keepRootFields:b})}).subscribe({next:function(Ne){P.broadcastQueries(),(!("hasNext"in Ne)||Ne.hasNext===!1)&&j(Ne)},error:function(Ne){O&&(O.loading=!1,O.error=Ne),o&&P.cache.removeOptimistic(m),P.broadcastQueries(),qe(Ne instanceof rr?Ne:new rr({networkError:Ne}))}})})]}})})},t.prototype.markMutationResult=function(e,r){var n=this;r===void 0&&(r=this.cache);var i=e.result,a=[],o=e.fetchPolicy==="no-cache";if(!o&&Do(i,e.errorPolicy)){if(_r(i)||a.push({result:i.data,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}),_r(i)&&Re(i.incremental)){var s=r.diff({id:"ROOT_MUTATION",query:this.transform(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0}),u=void 0;s.result&&(u=co(s.result,i)),typeof u<"u"&&(i.data=u,a.push({result:u,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}))}var c=e.updateQueries;c&&this.queries.forEach(function(d,p){var f=d.observableQuery,h=f&&f.queryName;if(!(!h||!pg.call(c,h))){var g=c[h],y=n.queries.get(p),S=y.document,b=y.variables,v=r.diff({query:S,variables:b,returnPartialData:!0,optimistic:!1}),m=v.result,A=v.complete;if(A&&m){var D=g(m,{mutationResult:i,queryName:S&&zn(S)||void 0,queryVariables:b});D&&a.push({result:D,dataId:"ROOT_QUERY",query:S,variables:b})}}})}if(a.length>0||e.refetchQueries||e.update||e.onQueryUpdated||e.removeOptimistic){var l=[];if(this.refetchQueries({updateCache:function(d){o||a.forEach(function(g){return d.write(g)});var p=e.update,f=!Af(i)||_r(i)&&!i.hasNext;if(p){if(!o){var h=d.diff({id:"ROOT_MUTATION",query:n.transform(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0});h.complete&&(i=_(_({},i),{data:h.result}),"incremental"in i&&delete i.incremental,"hasNext"in i&&delete i.hasNext)}f&&p(d,i,{context:e.context,variables:e.variables})}!o&&!e.keepRootFields&&f&&d.modify({id:"ROOT_MUTATION",fields:function(g,y){var S=y.fieldName,b=y.DELETE;return S==="__typename"?g:b}})},include:e.refetchQueries,optimistic:!1,removeOptimistic:e.removeOptimistic,onQueryUpdated:e.onQueryUpdated||null}).forEach(function(d){return l.push(d)}),e.awaitRefetchQueries||e.onQueryUpdated)return Promise.all(l).then(function(){return i})}return Promise.resolve(i)},t.prototype.markMutationOptimistic=function(e,r){var n=this,i=typeof e=="function"?e(r.variables):e;return this.cache.recordOptimisticTransaction(function(a){try{n.markMutationResult(_(_({},r),{result:{data:i}}),a)}catch(o){__DEV__&&I.error(o)}},r.mutationId)},t.prototype.fetchQuery=function(e,r,n){return this.fetchQueryObservable(e,r,n).promise},t.prototype.getQueryStore=function(){var e=Object.create(null);return this.queries.forEach(function(r,n){e[n]={variables:r.variables,networkStatus:r.networkStatus,networkError:r.networkError,graphQLErrors:r.graphQLErrors}}),e},t.prototype.resetErrors=function(e){var r=this.queries.get(e);r&&(r.networkError=void 0,r.graphQLErrors=[])},t.prototype.transform=function(e){var r=this.transformCache;if(!r.has(e)){var n=this.cache.transformDocument(e),i=bc(n),a=this.localState.clientQuery(n),o=i&&this.localState.serverQuery(i),s={document:n,hasClientExports:pc(n),hasForcedResolvers:this.localState.shouldForceResolvers(n),clientQuery:a,serverQuery:o,defaultVars:rn(qt(n)),asQuery:_(_({},n),{definitions:n.definitions.map(function(c){return c.kind==="OperationDefinition"&&c.operation!=="query"?_(_({},c),{operation:"query"}):c})})},u=function(c){c&&!r.has(c)&&r.set(c,s)};u(e),u(n),u(a),u(o)}return r.get(e)},t.prototype.getVariables=function(e,r){return _(_({},this.transform(e).defaultVars),r)},t.prototype.watchQuery=function(e){e=_(_({},e),{variables:this.getVariables(e.query,e.variables)}),typeof e.notifyOnNetworkStatusChange>"u"&&(e.notifyOnNetworkStatusChange=!1);var r=new Oo(this),n=new Ao({queryManager:this,queryInfo:r,options:e});return this.queries.set(n.queryId,r),r.init({document:n.query,observableQuery:n,variables:n.variables}),n},t.prototype.query=function(e,r){var n=this;return r===void 0&&(r=this.generateQueryId()),__DEV__?I(e.query,"query option is required. You must specify your GraphQL document in the query option."):I(e.query,17),__DEV__?I(e.query.kind==="Document",'You must wrap the query string in a "gql" tag.'):I(e.query.kind==="Document",18),__DEV__?I(!e.returnPartialData,"returnPartialData option only supported on watchQuery."):I(!e.returnPartialData,19),__DEV__?I(!e.pollInterval,"pollInterval option only supported on watchQuery."):I(!e.pollInterval,20),this.fetchQuery(r,e).finally(function(){return n.stopQuery(r)})},t.prototype.generateQueryId=function(){return String(this.queryIdCounter++)},t.prototype.generateRequestId=function(){return this.requestIdCounter++},t.prototype.generateMutationId=function(){return String(this.mutationIdCounter++)},t.prototype.stopQueryInStore=function(e){this.stopQueryInStoreNoBroadcast(e),this.broadcastQueries()},t.prototype.stopQueryInStoreNoBroadcast=function(e){var r=this.queries.get(e);r&&r.stop()},t.prototype.clearStore=function(e){return e===void 0&&(e={discardWatches:!0}),this.cancelPendingFetches(__DEV__?new V("Store reset while query was in flight (not completed in link chain)"):new V(21)),this.queries.forEach(function(r){r.observableQuery?r.networkStatus=ie.loading:r.stop()}),this.mutationStore&&(this.mutationStore=Object.create(null)),this.cache.reset(e)},t.prototype.getObservableQueries=function(e){var r=this;e===void 0&&(e="active");var n=new Map,i=new Map,a=new Set;return Array.isArray(e)&&e.forEach(function(o){typeof o=="string"?i.set(o,!1):hc(o)?i.set(r.transform(o).document,!1):ee(o)&&o.query&&a.add(o)}),this.queries.forEach(function(o,s){var u=o.observableQuery,c=o.document;if(u){if(e==="all"){n.set(s,u);return}var l=u.queryName,d=u.options.fetchPolicy;if(d==="standby"||e==="active"&&!u.hasObservers())return;(e==="active"||l&&i.has(l)||c&&i.has(c))&&(n.set(s,u),l&&i.set(l,!0),c&&i.set(c,!0))}}),a.size&&a.forEach(function(o){var s=Bi("legacyOneTimeQuery"),u=r.getQuery(s).init({document:o.query,variables:o.variables}),c=new Ao({queryManager:r,queryInfo:u,options:_(_({},o),{fetchPolicy:"network-only"})});I(c.queryId===s),u.setObservableQuery(c),n.set(s,c)}),__DEV__&&i.size&&i.forEach(function(o,s){o||__DEV__&&I.warn("Unknown query ".concat(typeof s=="string"?"named ":"").concat(JSON.stringify(s,null,2)," requested in refetchQueries options.include array"))}),n},t.prototype.reFetchObservableQueries=function(e){var r=this;e===void 0&&(e=!1);var n=[];return this.getObservableQueries(e?"all":"active").forEach(function(i,a){var o=i.options.fetchPolicy;i.resetLastResults(),(e||o!=="standby"&&o!=="cache-only")&&n.push(i.refetch()),r.getQuery(a).setDiff(null)}),this.broadcastQueries(),Promise.all(n)},t.prototype.setObservableQuery=function(e){this.getQuery(e.queryId).setObservableQuery(e)},t.prototype.startGraphQLSubscription=function(e){var r=this,n=e.query,i=e.fetchPolicy,a=e.errorPolicy,o=e.variables,s=e.context,u=s===void 0?{}:s;n=this.transform(n).document,o=this.getVariables(n,o);var c=function(d){return r.getObservableFromLink(n,u,d).map(function(p){if(i!=="no-cache"&&(Do(p,a)&&r.cache.write({query:n,result:p.data,dataId:"ROOT_SUBSCRIPTION",variables:d}),r.broadcastQueries()),Wn(p))throw new rr({graphQLErrors:p.errors});return p})};if(this.transform(n).hasClientExports){var l=this.localState.addExportedVariables(n,o,u).then(c);return new W(function(d){var p=null;return l.then(function(f){return p=f.subscribe(d)},d.error),function(){return p&&p.unsubscribe()}})}return c(o)},t.prototype.stopQuery=function(e){this.stopQueryNoBroadcast(e),this.broadcastQueries()},t.prototype.stopQueryNoBroadcast=function(e){this.stopQueryInStoreNoBroadcast(e),this.removeQuery(e)},t.prototype.removeQuery=function(e){this.fetchCancelFns.delete(e),this.queries.has(e)&&(this.getQuery(e).stop(),this.queries.delete(e))},t.prototype.broadcastQueries=function(){this.onBroadcast&&this.onBroadcast(),this.queries.forEach(function(e){return e.notify()})},t.prototype.getLocalState=function(){return this.localState},t.prototype.getObservableFromLink=function(e,r,n,i){var a=this,o;i===void 0&&(i=(o=r?.queryDeduplication)!==null&&o!==void 0?o:this.queryDeduplication);var s,u=this.transform(e).serverQuery;if(u){var c=this,l=c.inFlightLinkObservables,d=c.link,p={query:u,variables:n,operationName:zn(u)||void 0,context:this.prepareContext(_(_({},r),{forceFetch:!i}))};if(r=p.context,i){var f=l.get(u)||new Map;l.set(u,f);var h=dt(n);if(s=f.get(h),!s){var g=new Hn([Kn(d,p)]);f.set(h,s=g),g.beforeNext(function(){f.delete(h)&&f.size<1&&l.delete(u)})}}else s=new Hn([Kn(d,p)])}else s=new Hn([W.of({data:{}})]),r=this.prepareContext(r);var y=this.transform(e).clientQuery;return y&&(s=oo(s,function(S){return a.localState.runResolvers({document:y,remoteResult:S,context:r,variables:n})})),s},t.prototype.getResultsFromLink=function(e,r,n){var i=e.lastRequestId=this.generateRequestId(),a=this.cache.transformForLink(this.transform(e.document).document);return oo(this.getObservableFromLink(a,n.context,n.variables),function(o){var s=uo(o),u=s.length>0;if(i>=e.lastRequestId){if(u&&n.errorPolicy==="none")throw e.markError(new rr({graphQLErrors:s}));e.markResult(o,a,n,r),e.markReady()}var c={data:o.data,loading:!1,networkStatus:ie.ready};return u&&n.errorPolicy!=="ignore"&&(c.errors=s,c.networkStatus=ie.error),c},function(o){var s=Vp(o)?o:new rr({networkError:o});throw i>=e.lastRequestId&&e.markError(s),s})},t.prototype.fetchQueryObservable=function(e,r,n){var i=this;n===void 0&&(n=ie.loading);var a=this.transform(r.query).document,o=this.getVariables(a,r.variables),s=this.getQuery(e),u=this.defaultOptions.watchQuery,c=r.fetchPolicy,l=c===void 0?u&&u.fetchPolicy||"cache-first":c,d=r.errorPolicy,p=d===void 0?u&&u.errorPolicy||"none":d,f=r.returnPartialData,h=f===void 0?!1:f,g=r.notifyOnNetworkStatusChange,y=g===void 0?!1:g,S=r.context,b=S===void 0?{}:S,v=Object.assign({},r,{query:a,variables:o,fetchPolicy:l,errorPolicy:p,returnPartialData:h,notifyOnNetworkStatusChange:y,context:b}),m=function(E){v.variables=E;var O=i.fetchQueryByPolicy(s,v,n);return v.fetchPolicy!=="standby"&&O.length>0&&s.observableQuery&&s.observableQuery.applyNextFetchPolicy("after-fetch",r),O},A=function(){return i.fetchCancelFns.delete(e)};this.fetchCancelFns.set(e,function(E){A(),setTimeout(function(){return D.cancel(E)})});var D=new Hn(this.transform(v.query).hasClientExports?this.localState.addExportedVariables(v.query,v.variables,v.context).then(m):m(v.variables));return D.promise.then(A,A),D},t.prototype.refetchQueries=function(e){var r=this,n=e.updateCache,i=e.include,a=e.optimistic,o=a===void 0?!1:a,s=e.removeOptimistic,u=s===void 0?o?Bi("refetchQueries"):void 0:s,c=e.onQueryUpdated,l=new Map;i&&this.getObservableQueries(i).forEach(function(p,f){l.set(f,{oq:p,lastDiff:r.getQuery(f).getDiff()})});var d=new Map;return n&&this.cache.batch({update:n,optimistic:o&&u||!1,removeOptimistic:u,onWatchUpdated:function(p,f,h){var g=p.watcher instanceof Oo&&p.watcher.observableQuery;if(g){if(c){l.delete(g.queryId);var y=c(g,f,h);return y===!0&&(y=g.refetch()),y!==!1&&d.set(g,y),y}c!==null&&l.set(g.queryId,{oq:g,lastDiff:h,diff:f})}}}),l.size&&l.forEach(function(p,f){var h=p.oq,g=p.lastDiff,y=p.diff,S;if(c){if(!y){var b=h.queryInfo;b.reset(),y=b.getDiff()}S=c(h,y,g)}(!c||S===!0)&&(S=h.refetch()),S!==!1&&d.set(h,S),f.indexOf("legacyOneTimeQuery")>=0&&r.stopQueryNoBroadcast(f)}),u&&this.cache.removeOptimistic(u),d},t.prototype.fetchQueryByPolicy=function(e,r,n){var i=this,a=r.query,o=r.variables,s=r.fetchPolicy,u=r.refetchWritePolicy,c=r.errorPolicy,l=r.returnPartialData,d=r.context,p=r.notifyOnNetworkStatusChange,f=e.networkStatus;e.init({document:this.transform(a).document,variables:o,networkStatus:n});var h=function(){return e.getDiff(o)},g=function(m,A){A===void 0&&(A=e.networkStatus||ie.loading);var D=m.result;__DEV__&&!l&&!be(D,{})&&uu(m.missing);var E=function(O){return W.of(_({data:O,loading:xr(A),networkStatus:A},m.complete?null:{partial:!0}))};return D&&i.transform(a).hasForcedResolvers?i.localState.runResolvers({document:a,remoteResult:{data:D},context:d,variables:o,onlyRunForcedResolvers:!0}).then(function(O){return E(O.data||void 0)}):c==="none"&&A===ie.refetch&&Array.isArray(m.missing)?E(void 0):E(D)},y=s==="no-cache"?0:n===ie.refetch&&u!=="merge"?1:2,S=function(){return i.getResultsFromLink(e,y,{variables:o,context:d,fetchPolicy:s,errorPolicy:c})},b=p&&typeof f=="number"&&f!==n&&xr(n);switch(s){default:case"cache-first":{var v=h();return v.complete?[g(v,e.markReady())]:l||b?[g(v),S()]:[S()]}case"cache-and-network":{var v=h();return v.complete||l||b?[g(v),S()]:[S()]}case"cache-only":return[g(h(),e.markReady())];case"network-only":return b?[g(h()),S()]:[S()];case"no-cache":return b?[g(e.getDiff()),S()]:[S()];case"standby":return[]}},t.prototype.getQuery=function(e){return e&&!this.queries.has(e)&&this.queries.set(e,new Oo(this,e)),this.queries.get(e)},t.prototype.prepareContext=function(e){e===void 0&&(e={});var r=this.localState.prepareContext(e);return _(_({},r),{clientAwareness:this.clientAwareness})},t}();var Gp=!1;var fu=function(){function t(e){var r=this;this.resetStoreCallbacks=[],this.clearStoreCallbacks=[];var n=e.uri,i=e.credentials,a=e.headers,o=e.cache,s=e.ssrMode,u=s===void 0?!1:s,c=e.ssrForceFetchDelay,l=c===void 0?0:c,d=e.connectToDevTools,p=d===void 0?typeof window=="object"&&!window.__APOLLO_CLIENT__&&__DEV__:d,f=e.queryDeduplication,h=f===void 0?!0:f,g=e.defaultOptions,y=e.assumeImmutableResults,S=y===void 0?!1:y,b=e.resolvers,v=e.typeDefs,m=e.fragmentMatcher,A=e.name,D=e.version,E=e.link;if(E||(E=n?new Uc({uri:n,credentials:i,headers:a}):St.empty()),!o)throw __DEV__?new V(`To initialize Apollo Client, you must specify a 'cache' property in the options object.
|
|
53
|
+
For more information, please visit: https://go.apollo.dev/c/docs`):new V(9);if(this.link=E,this.cache=o,this.disableNetworkFetches=u||l>0,this.queryDeduplication=h,this.defaultOptions=g||Object.create(null),this.typeDefs=v,l&&setTimeout(function(){return r.disableNetworkFetches=!1},l),this.watchQuery=this.watchQuery.bind(this),this.query=this.query.bind(this),this.mutate=this.mutate.bind(this),this.resetStore=this.resetStore.bind(this),this.reFetchObservableQueries=this.reFetchObservableQueries.bind(this),p&&typeof window=="object"&&(window.__APOLLO_CLIENT__=this),!Gp&&p&&__DEV__&&(Gp=!0,typeof window<"u"&&window.document&&window.top===window.self&&!window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__)){var O=window.navigator,P=O&&O.userAgent,N=void 0;typeof P=="string"&&(P.indexOf("Chrome/")>-1?N="https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm":P.indexOf("Firefox/")>-1&&(N="https://addons.mozilla.org/en-US/firefox/addon/apollo-developer-tools/")),N&&__DEV__&&I.log("Download the Apollo DevTools for a better development experience: "+N)}this.version=Nf,this.localState=new Io({cache:o,client:this,resolvers:b,fragmentMatcher:m}),this.queryManager=new Qp({cache:this.cache,link:this.link,defaultOptions:this.defaultOptions,queryDeduplication:h,ssrMode:u,clientAwareness:{name:A,version:D},localState:this.localState,assumeImmutableResults:S,onBroadcast:p?function(){r.devToolsHookCb&&r.devToolsHookCb({action:{},state:{queries:r.queryManager.getQueryStore(),mutations:r.queryManager.mutationStore||{}},dataWithOptimisticResults:r.cache.extract(!0)})}:void 0})}return t.prototype.stop=function(){this.queryManager.stop()},t.prototype.watchQuery=function(e){return this.defaultOptions.watchQuery&&(e=Vi(this.defaultOptions.watchQuery,e)),this.disableNetworkFetches&&(e.fetchPolicy==="network-only"||e.fetchPolicy==="cache-and-network")&&(e=_(_({},e),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(e)},t.prototype.query=function(e){return this.defaultOptions.query&&(e=Vi(this.defaultOptions.query,e)),__DEV__?I(e.fetchPolicy!=="cache-and-network","The cache-and-network fetchPolicy does not work with client.query, because client.query can only return a single result. Please use client.watchQuery to receive multiple results from the cache and the network, or consider using a different fetchPolicy, such as cache-first or network-only."):I(e.fetchPolicy!=="cache-and-network",10),this.disableNetworkFetches&&e.fetchPolicy==="network-only"&&(e=_(_({},e),{fetchPolicy:"cache-first"})),this.queryManager.query(e)},t.prototype.mutate=function(e){return this.defaultOptions.mutate&&(e=Vi(this.defaultOptions.mutate,e)),this.queryManager.mutate(e)},t.prototype.subscribe=function(e){return this.queryManager.startGraphQLSubscription(e)},t.prototype.readQuery=function(e,r){return r===void 0&&(r=!1),this.cache.readQuery(e,r)},t.prototype.readFragment=function(e,r){return r===void 0&&(r=!1),this.cache.readFragment(e,r)},t.prototype.writeQuery=function(e){var r=this.cache.writeQuery(e);return e.broadcast!==!1&&this.queryManager.broadcastQueries(),r},t.prototype.writeFragment=function(e){var r=this.cache.writeFragment(e);return e.broadcast!==!1&&this.queryManager.broadcastQueries(),r},t.prototype.__actionHookForDevTools=function(e){this.devToolsHookCb=e},t.prototype.__requestRaw=function(e){return Kn(this.link,e)},t.prototype.resetStore=function(){var e=this;return Promise.resolve().then(function(){return e.queryManager.clearStore({discardWatches:!1})}).then(function(){return Promise.all(e.resetStoreCallbacks.map(function(r){return r()}))}).then(function(){return e.reFetchObservableQueries()})},t.prototype.clearStore=function(){var e=this;return Promise.resolve().then(function(){return e.queryManager.clearStore({discardWatches:!0})}).then(function(){return Promise.all(e.clearStoreCallbacks.map(function(r){return r()}))})},t.prototype.onResetStore=function(e){var r=this;return this.resetStoreCallbacks.push(e),function(){r.resetStoreCallbacks=r.resetStoreCallbacks.filter(function(n){return n!==e})}},t.prototype.onClearStore=function(e){var r=this;return this.clearStoreCallbacks.push(e),function(){r.clearStoreCallbacks=r.clearStoreCallbacks.filter(function(n){return n!==e})}},t.prototype.reFetchObservableQueries=function(e){return this.queryManager.reFetchObservableQueries(e)},t.prototype.refetchQueries=function(e){var r=this.queryManager.refetchQueries(e),n=[],i=[];r.forEach(function(o,s){n.push(s),i.push(o)});var a=Promise.all(i);return a.queries=n,a.results=i,a.catch(function(o){__DEV__&&I.debug("In client.refetchQueries, Promise.all promise rejected with error ".concat(o))}),a},t.prototype.getObservableQueries=function(e){return e===void 0&&(e="active"),this.queryManager.getObservableQueries(e)},t.prototype.extract=function(e){return this.cache.extract(e)},t.prototype.restore=function(e){return this.cache.restore(e)},t.prototype.addResolvers=function(e){this.localState.addResolvers(e)},t.prototype.setResolvers=function(e){this.localState.setResolvers(e)},t.prototype.getResolvers=function(){return this.localState.getResolvers()},t.prototype.setLocalStateFragmentMatcher=function(e){this.localState.setFragmentMatcher(e)},t.prototype.setLink=function(e){this.link=this.queryManager.link=e},t}();nf(Zr?"log":"silent");function Ye(t){return t===null?"null":Array.isArray(t)?"array":typeof t}function nr(t){return Ye(t)==="object"}function Hp(t){return Array.isArray(t)&&t.length>0&&t.every(e=>"message"in e)}function pu(t,e){return t.length<124?t:e}var Wp="graphql-transport-ws";var at;(function(t){t[t.InternalServerError=4500]="InternalServerError",t[t.InternalClientError=4005]="InternalClientError",t[t.BadRequest=4400]="BadRequest",t[t.BadResponse=4004]="BadResponse",t[t.Unauthorized=4401]="Unauthorized",t[t.Forbidden=4403]="Forbidden",t[t.SubprotocolNotAcceptable=4406]="SubprotocolNotAcceptable",t[t.ConnectionInitialisationTimeout=4408]="ConnectionInitialisationTimeout",t[t.ConnectionAcknowledgementTimeout=4504]="ConnectionAcknowledgementTimeout",t[t.SubscriberAlreadyExists=4409]="SubscriberAlreadyExists",t[t.TooManyInitialisationRequests=4429]="TooManyInitialisationRequests"})(at||(at={}));var Te;(function(t){t.ConnectionInit="connection_init",t.ConnectionAck="connection_ack",t.Ping="ping",t.Pong="pong",t.Subscribe="subscribe",t.Next="next",t.Error="error",t.Complete="complete"})(Te||(Te={}));function Kp(t){if(!nr(t))throw new Error(`Message is expected to be an object, but got ${Ye(t)}`);if(!t.type)throw new Error("Message is missing the 'type' property");if(typeof t.type!="string")throw new Error(`Message is expects the 'type' property to be a string, but got ${Ye(t.type)}`);switch(t.type){case Te.ConnectionInit:case Te.ConnectionAck:case Te.Ping:case Te.Pong:{if(t.payload!=null&&!nr(t.payload))throw new Error(`"${t.type}" message expects the 'payload' property to be an object or nullish or missing, but got "${t.payload}"`);break}case Te.Subscribe:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${Ye(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);if(!nr(t.payload))throw new Error(`"${t.type}" message expects the 'payload' property to be an object, but got ${Ye(t.payload)}`);if(typeof t.payload.query!="string")throw new Error(`"${t.type}" message payload expects the 'query' property to be a string, but got ${Ye(t.payload.query)}`);if(t.payload.variables!=null&&!nr(t.payload.variables))throw new Error(`"${t.type}" message payload expects the 'variables' property to be a an object or nullish or missing, but got ${Ye(t.payload.variables)}`);if(t.payload.operationName!=null&&Ye(t.payload.operationName)!=="string")throw new Error(`"${t.type}" message payload expects the 'operationName' property to be a string or nullish or missing, but got ${Ye(t.payload.operationName)}`);if(t.payload.extensions!=null&&!nr(t.payload.extensions))throw new Error(`"${t.type}" message payload expects the 'extensions' property to be a an object or nullish or missing, but got ${Ye(t.payload.extensions)}`);break}case Te.Next:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${Ye(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);if(!nr(t.payload))throw new Error(`"${t.type}" message expects the 'payload' property to be an object, but got ${Ye(t.payload)}`);break}case Te.Error:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${Ye(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);if(!Hp(t.payload))throw new Error(`"${t.type}" message expects the 'payload' property to be an array of GraphQL errors, but got ${JSON.stringify(t.payload)}`);break}case Te.Complete:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${Ye(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);break}default:throw new Error(`Invalid message 'type' property "${t.type}"`)}return t}function Zp(t,e){return Kp(typeof t=="string"?JSON.parse(t,e):t)}function ri(t,e){return Kp(t),JSON.stringify(t,e)}function Yp(t){let{url:e,connectionParams:r,lazy:n=!0,onNonLazyError:i=console.error,lazyCloseTimeout:a=0,keepAlive:o=0,disablePong:s,connectionAckWaitTimeout:u=0,retryAttempts:c=5,retryWait:l=async function(de){let he=1e3;for(let J=0;J<de;J++)he*=2;await new Promise(J=>setTimeout(J,he+Math.floor(Math.random()*(3e3-300)+300)))},shouldRetry:d=No,isFatalConnectionProblem:p,on:f,webSocketImpl:h,generateID:g=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,de=>{let he=Math.random()*16|0;return(de=="x"?he:he&3|8).toString(16)})},jsonMessageReplacer:y,jsonMessageReviver:S}=t,b;if(h){if(!hg(h))throw new Error("Invalid WebSocket implementation provided");b=h}else typeof WebSocket<"u"?b=WebSocket:typeof global<"u"?b=global.WebSocket||global.MozWebSocket:typeof window<"u"&&(b=window.WebSocket||window.MozWebSocket);if(!b)throw new Error("WebSocket implementation missing; on Node you can `import WebSocket from 'ws';` and pass `webSocketImpl: WebSocket` to `createClient`");let v=b,m=(()=>{let q=(()=>{let he={};return{on(J,X){return he[J]=X,()=>{delete he[J]}},emit(J){var X;"id"in J&&((X=he[J.id])===null||X===void 0||X.call(he,J))}}})(),de={connecting:f?.connecting?[f.connecting]:[],opened:f?.opened?[f.opened]:[],connected:f?.connected?[f.connected]:[],ping:f?.ping?[f.ping]:[],pong:f?.pong?[f.pong]:[],message:f?.message?[q.emit,f.message]:[q.emit],closed:f?.closed?[f.closed]:[],error:f?.error?[f.error]:[]};return{onMessage:q.on,on(he,J){let X=de[he];return X.push(J),()=>{X.splice(X.indexOf(J),1)}},emit(he,...J){for(let X of[...de[he]])X(...J)}}})();function A(q){let de=[m.on("error",he=>{de.forEach(J=>J()),q(he)}),m.on("closed",he=>{de.forEach(J=>J()),q(he)})]}let D,E=0,O,P=!1,N=0,j=!1;async function qe(){clearTimeout(O);let[q,de]=await(D??(D=new Promise((X,Ft)=>(async()=>{if(P){if(await l(N),!E)return D=void 0,Ft({code:1e3,reason:"All Subscriptions Gone"});N++}m.emit("connecting");let H=new v(typeof e=="function"?await e():e,Wp),Mt,pr;function Va(){isFinite(o)&&o>0&&(clearTimeout(pr),pr=setTimeout(()=>{H.readyState===v.OPEN&&(H.send(ri({type:Te.Ping})),m.emit("ping",!1,void 0))},o))}A(Be=>{D=void 0,clearTimeout(Mt),clearTimeout(pr),Ft(Be),No(Be)&&Be.code===4499&&(H.close(4499,"Terminated"),H.onerror=null,H.onclose=null)}),H.onerror=Be=>m.emit("error",Be),H.onclose=Be=>m.emit("closed",Be),H.onopen=async()=>{try{m.emit("opened",H);let Be=typeof r=="function"?await r():r;if(H.readyState!==v.OPEN)return;H.send(ri(Be?{type:Te.ConnectionInit,payload:Be}:{type:Te.ConnectionInit},y)),isFinite(u)&&u>0&&(Mt=setTimeout(()=>{H.close(at.ConnectionAcknowledgementTimeout,"Connection acknowledgement timeout")},u)),Va()}catch(Be){m.emit("error",Be),H.close(at.InternalClientError,pu(Be instanceof Error?Be.message:new Error(Be).message,"Internal client error"))}};let Fn=!1;H.onmessage=({data:Be})=>{try{let Ve=Zp(Be,S);if(m.emit("message",Ve),Ve.type==="ping"||Ve.type==="pong"){m.emit(Ve.type,!0,Ve.payload),Ve.type==="pong"?Va():s||(H.send(ri(Ve.payload?{type:Te.Pong,payload:Ve.payload}:{type:Te.Pong})),m.emit("pong",!1,Ve.payload));return}if(Fn)return;if(Ve.type!==Te.ConnectionAck)throw new Error(`First message cannot be of type ${Ve.type}`);clearTimeout(Mt),Fn=!0,m.emit("connected",H,Ve.payload),P=!1,N=0,X([H,new Promise((M2,um)=>A(um))])}catch(Ve){H.onmessage=null,m.emit("error",Ve),H.close(at.BadResponse,pu(Ve instanceof Error?Ve.message:new Error(Ve).message,"Bad response"))}}})())));q.readyState===v.CLOSING&&await de;let he=()=>{},J=new Promise(X=>he=X);return[q,he,Promise.race([J.then(()=>{if(!E){let X=()=>q.close(1e3,"Normal Closure");isFinite(a)&&a>0?O=setTimeout(()=>{q.readyState===v.OPEN&&X()},a):X()}}),de])]}function Ne(q){if(No(q)&&(dg(q.code)||[at.InternalServerError,at.InternalClientError,at.BadRequest,at.BadResponse,at.Unauthorized,at.SubprotocolNotAcceptable,at.SubscriberAlreadyExists,at.TooManyInitialisationRequests].includes(q.code)))throw q;if(j)return!1;if(No(q)&&q.code===1e3)return E>0;if(!c||N>=c||!d(q)||p?.(q))throw q;return P=!0}return n||(async()=>{for(E++;;)try{let[,,q]=await qe();await q}catch(q){try{if(!Ne(q))return}catch(de){return i?.(de)}}})(),{on:m.on,subscribe(q,de){let he=g(q),J=!1,X=!1,Ft=()=>{E--,J=!0};return(async()=>{for(E++;;)try{let[H,Mt,pr]=await qe();if(J)return Mt();let Va=m.onMessage(he,Fn=>{switch(Fn.type){case Te.Next:{de.next(Fn.payload);return}case Te.Error:{X=!0,J=!0,de.error(Fn.payload),Ft();return}case Te.Complete:{J=!0,Ft();return}}});H.send(ri({id:he,type:Te.Subscribe,payload:q},y)),Ft=()=>{!J&&H.readyState===v.OPEN&&H.send(ri({id:he,type:Te.Complete},y)),E--,J=!0,Mt()},await pr.finally(Va);return}catch(H){if(!Ne(H))return}})().then(()=>{X||de.complete()}).catch(H=>{de.error(H)}),()=>{J||Ft()}},async dispose(){if(j=!0,D){let[q]=await D;q.close(1e3,"Normal Closure")}},terminate(){D&&m.emit("closed",{code:4499,reason:"Terminated",wasClean:!1})}}}function No(t){return nr(t)&&"code"in t&&"reason"in t}function dg(t){return[1e3,1001,1006,1005,1012,1013,1013].includes(t)?!1:t>=1e3&&t<=1999}function hg(t){return typeof t=="function"&&"constructor"in t&&"CLOSED"in t&&"CLOSING"in t&&"CONNECTING"in t&&"OPEN"in t}function mg(t){return ee(t)&&"code"in t&&"reason"in t}var Jp=function(t){xe(e,t);function e(r){var n=t.call(this)||this;return n.client=r,n}return e.prototype.request=function(r){var n=this;return new W(function(i){return n.client.subscribe(_(_({},r),{query:qn(r.query)}),{next:i.next.bind(i),complete:i.complete.bind(i),error:function(a){return a instanceof Error?i.error(a):mg(a)?i.error(new Error("Socket closed with event ".concat(a.code," ").concat(a.reason||""))):i.error(new rr({graphQLErrors:Array.isArray(a)?a:[a]}))}})})},e}(St);var os=function(){return os=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},os.apply(this,arguments)};typeof SuppressedError=="function"&&SuppressedError;function Qo(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Qo=function(r){return typeof r}:Qo=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Qo(t)}function gg(t){return Qo(t)=="object"&&t!==null}var ch=typeof Symbol=="function"&&Symbol.toStringTag!=null?Symbol.toStringTag:"@@toStringTag";function Ru(t,e){for(var r=/\r\n|[\n\r]/g,n=1,i=e+1,a;(a=r.exec(t.body))&&a.index<e;)n+=1,i=e+1-(a.index+a[0].length);return{line:n,column:i}}function yg(t){return uh(t.source,Ru(t.source,t.start))}function uh(t,e){var r=t.locationOffset.column-1,n=Go(r)+t.body,i=e.line-1,a=t.locationOffset.line-1,o=e.line+a,s=e.line===1?r:0,u=e.column+s,c="".concat(t.name,":").concat(o,":").concat(u,`
|
|
54
|
+
`),l=n.split(/\r\n|[\n\r]/g),d=l[i];if(d.length>120){for(var p=Math.floor(u/80),f=u%80,h=[],g=0;g<d.length;g+=80)h.push(d.slice(g,g+80));return c+Xp([["".concat(o),h[0]]].concat(h.slice(1,p+1).map(function(y){return["",y]}),[[" ",Go(f-1)+"^"],["",h[p+1]]]))}return c+Xp([["".concat(o-1),l[i-1]],["".concat(o),d],["",Go(u-1)+"^"],["".concat(o+1),l[i+1]]])}function Xp(t){var e=t.filter(function(n){n[0];var i=n[1];return i!==void 0}),r=Math.max.apply(Math,e.map(function(n){var i=n[0];return i.length}));return e.map(function(n){var i=n[0],a=n[1];return vg(r,i)+(a?" | "+a:" |")}).join(`
|
|
55
|
+
`)}function Go(t){return Array(t+1).join(" ")}function vg(t,e){return Go(t-e.length)+e}function Ho(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ho=function(r){return typeof r}:Ho=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Ho(t)}function ed(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function bg(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?ed(Object(r),!0).forEach(function(n){_g(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ed(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function _g(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function wg(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function td(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Sg(t,e,r){return e&&td(t.prototype,e),r&&td(t,r),t}function Cg(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&wa(t,e)}function Eg(t){var e=fh();return function(){var n=Sa(t),i;if(e){var a=Sa(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return lh(this,i)}}function lh(t,e){return e&&(Ho(e)==="object"||typeof e=="function")?e:ea(t)}function ea(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Pu(t){var e=typeof Map=="function"?new Map:void 0;return Pu=function(n){if(n===null||!xg(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(n))return e.get(n);e.set(n,i)}function i(){return Wo(n,arguments,Sa(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),wa(i,n)},Pu(t)}function Wo(t,e,r){return fh()?Wo=Reflect.construct:Wo=function(i,a,o){var s=[null];s.push.apply(s,a);var u=Function.bind.apply(i,s),c=new u;return o&&wa(c,o.prototype),c},Wo.apply(null,arguments)}function fh(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function xg(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function wa(t,e){return wa=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},wa(t,e)}function Sa(t){return Sa=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},Sa(t)}var kg=function(t){Cg(r,t);var e=Eg(r);function r(n,i,a,o,s,u,c){var l,d,p,f;wg(this,r),f=e.call(this,n),f.name="GraphQLError",f.originalError=u??void 0,f.nodes=rd(Array.isArray(i)?i:i?[i]:void 0);for(var h=[],g=0,y=(S=f.nodes)!==null&&S!==void 0?S:[];g<y.length;g++){var S,b=y[g],v=b.loc;v!=null&&h.push(v)}h=rd(h),f.source=a??((l=h)===null||l===void 0?void 0:l[0].source),f.positions=o??((d=h)===null||d===void 0?void 0:d.map(function(A){return A.start})),f.locations=o&&a?o.map(function(A){return Ru(a,A)}):(p=h)===null||p===void 0?void 0:p.map(function(A){return Ru(A.source,A.start)}),f.path=s??void 0;var m=u?.extensions;return c==null&&gg(m)?f.extensions=bg({},m):f.extensions=c??{},Object.defineProperties(ea(f),{message:{enumerable:!0},locations:{enumerable:f.locations!=null},path:{enumerable:f.path!=null},extensions:{enumerable:f.extensions!=null&&Object.keys(f.extensions).length>0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),u!=null&&u.stack?(Object.defineProperty(ea(f),"stack",{value:u.stack,writable:!0,configurable:!0}),lh(f)):(Error.captureStackTrace?Error.captureStackTrace(ea(f),r):Object.defineProperty(ea(f),"stack",{value:Error().stack,writable:!0,configurable:!0}),f)}return Sg(r,[{key:"toString",value:function(){return Tg(this)}},{key:ch,get:function(){return"Object"}}]),r}(Pu(Error));function rd(t){return t===void 0||t.length===0?void 0:t}function Tg(t){var e=t.message;if(t.nodes)for(var r=0,n=t.nodes;r<n.length;r++){var i=n[r];i.loc&&(e+=`
|
|
56
56
|
|
|
57
|
-
`+
|
|
57
|
+
`+yg(i.loc))}else if(t.source&&t.locations)for(var a=0,o=t.locations;a<o.length;a++){var s=o[a];e+=`
|
|
58
58
|
|
|
59
|
-
`+
|
|
60
|
-
`)}function
|
|
61
|
-
`;break;case 114:c+="\r";break;case 116:c+=" ";break;case 117:{var l=Zg(a.charCodeAt(o+1),a.charCodeAt(o+2),a.charCodeAt(o+3),a.charCodeAt(o+4));if(l<0){var d=a.slice(o+1,o+5);throw gt(t,o,"Invalid character escape sequence: \\u".concat(d,"."))}c+=String.fromCharCode(l),o+=4;break}default:throw gt(t,o,"Invalid character escape sequence: \\".concat(String.fromCharCode(u),"."))}++o,s=o}}throw gt(t,o,"Unterminated string.")}function Kg(t,e,r,n,i,a){for(var o=t.body,s=e+3,u=s,c=0,l="";s<o.length&&!isNaN(c=o.charCodeAt(s));){if(c===34&&o.charCodeAt(s+1)===34&&o.charCodeAt(s+2)===34)return l+=o.slice(u,s),new Ie(k.BLOCK_STRING,e,s+3,r,n,i,jg(l));if(c<32&&c!==9&&c!==10&&c!==13)throw gt(t,s,"Invalid character within String: ".concat(_n(c),"."));c===10?(++s,++a.line,a.lineStart=s):c===13?(o.charCodeAt(s+1)===10?s+=2:++s,++a.line,a.lineStart=s):c===92&&o.charCodeAt(s+1)===34&&o.charCodeAt(s+2)===34&&o.charCodeAt(s+3)===34?(l+=o.slice(u,s)+'"""',s+=4,u=s):++s}throw gt(t,s,"Unterminated string.")}function Zg(t,e,r,n){return No(t)<<12|No(e)<<8|No(r)<<4|No(n)}function No(t){return t>=48&&t<=57?t-48:t>=65&&t<=70?t-55:t>=97&&t<=102?t-87:-1}function Yg(t,e,r,n,i){for(var a=t.body,o=a.length,s=e+1,u=0;s!==o&&!isNaN(u=a.charCodeAt(s))&&(u===95||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122);)++s;return new Ie(k.NAME,e,s,r,n,i,a.slice(e,s))}function Jg(t){return t===95||t>=65&&t<=90||t>=97&&t<=122}function Xg(t,e){var r=new ey(t,e);return r.parseDocument()}var ey=function(){function t(r,n){var i=Mg(r)?r:new hh(r);this._lexer=new Bg(i),this._options=n}var e=t.prototype;return e.parseName=function(){var n=this.expectToken(k.NAME);return{kind:U.NAME,value:n.value,loc:this.loc(n)}},e.parseDocument=function(){var n=this._lexer.token;return{kind:U.DOCUMENT,definitions:this.many(k.SOF,this.parseDefinition,k.EOF),loc:this.loc(n)}},e.parseDefinition=function(){if(this.peek(k.NAME))switch(this._lexer.token.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"schema":case"scalar":case"type":case"interface":case"union":case"enum":case"input":case"directive":return this.parseTypeSystemDefinition();case"extend":return this.parseTypeSystemExtension()}else{if(this.peek(k.BRACE_L))return this.parseOperationDefinition();if(this.peekDescription())return this.parseTypeSystemDefinition()}throw this.unexpected()},e.parseOperationDefinition=function(){var n=this._lexer.token;if(this.peek(k.BRACE_L))return{kind:U.OPERATION_DEFINITION,operation:"query",name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet(),loc:this.loc(n)};var i=this.parseOperationType(),a;return this.peek(k.NAME)&&(a=this.parseName()),{kind:U.OPERATION_DEFINITION,operation:i,name:a,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(n)}},e.parseOperationType=function(){var n=this.expectToken(k.NAME);switch(n.value){case"query":return"query";case"mutation":return"mutation";case"subscription":return"subscription"}throw this.unexpected(n)},e.parseVariableDefinitions=function(){return this.optionalMany(k.PAREN_L,this.parseVariableDefinition,k.PAREN_R)},e.parseVariableDefinition=function(){var n=this._lexer.token;return{kind:U.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(k.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(k.EQUALS)?this.parseValueLiteral(!0):void 0,directives:this.parseDirectives(!0),loc:this.loc(n)}},e.parseVariable=function(){var n=this._lexer.token;return this.expectToken(k.DOLLAR),{kind:U.VARIABLE,name:this.parseName(),loc:this.loc(n)}},e.parseSelectionSet=function(){var n=this._lexer.token;return{kind:U.SELECTION_SET,selections:this.many(k.BRACE_L,this.parseSelection,k.BRACE_R),loc:this.loc(n)}},e.parseSelection=function(){return this.peek(k.SPREAD)?this.parseFragment():this.parseField()},e.parseField=function(){var n=this._lexer.token,i=this.parseName(),a,o;return this.expectOptionalToken(k.COLON)?(a=i,o=this.parseName()):o=i,{kind:U.FIELD,alias:a,name:o,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(k.BRACE_L)?this.parseSelectionSet():void 0,loc:this.loc(n)}},e.parseArguments=function(n){var i=n?this.parseConstArgument:this.parseArgument;return this.optionalMany(k.PAREN_L,i,k.PAREN_R)},e.parseArgument=function(){var n=this._lexer.token,i=this.parseName();return this.expectToken(k.COLON),{kind:U.ARGUMENT,name:i,value:this.parseValueLiteral(!1),loc:this.loc(n)}},e.parseConstArgument=function(){var n=this._lexer.token;return{kind:U.ARGUMENT,name:this.parseName(),value:(this.expectToken(k.COLON),this.parseValueLiteral(!0)),loc:this.loc(n)}},e.parseFragment=function(){var n=this._lexer.token;this.expectToken(k.SPREAD);var i=this.expectOptionalKeyword("on");return!i&&this.peek(k.NAME)?{kind:U.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1),loc:this.loc(n)}:{kind:U.INLINE_FRAGMENT,typeCondition:i?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(n)}},e.parseFragmentDefinition=function(){var n,i=this._lexer.token;return this.expectKeyword("fragment"),((n=this._options)===null||n===void 0?void 0:n.experimentalFragmentVariables)===!0?{kind:U.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(i)}:{kind:U.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(i)}},e.parseFragmentName=function(){if(this._lexer.token.value==="on")throw this.unexpected();return this.parseName()},e.parseValueLiteral=function(n){var i=this._lexer.token;switch(i.kind){case k.BRACKET_L:return this.parseList(n);case k.BRACE_L:return this.parseObject(n);case k.INT:return this._lexer.advance(),{kind:U.INT,value:i.value,loc:this.loc(i)};case k.FLOAT:return this._lexer.advance(),{kind:U.FLOAT,value:i.value,loc:this.loc(i)};case k.STRING:case k.BLOCK_STRING:return this.parseStringLiteral();case k.NAME:switch(this._lexer.advance(),i.value){case"true":return{kind:U.BOOLEAN,value:!0,loc:this.loc(i)};case"false":return{kind:U.BOOLEAN,value:!1,loc:this.loc(i)};case"null":return{kind:U.NULL,loc:this.loc(i)};default:return{kind:U.ENUM,value:i.value,loc:this.loc(i)}}case k.DOLLAR:if(!n)return this.parseVariable();break}throw this.unexpected()},e.parseStringLiteral=function(){var n=this._lexer.token;return this._lexer.advance(),{kind:U.STRING,value:n.value,block:n.kind===k.BLOCK_STRING,loc:this.loc(n)}},e.parseList=function(n){var i=this,a=this._lexer.token,o=function(){return i.parseValueLiteral(n)};return{kind:U.LIST,values:this.any(k.BRACKET_L,o,k.BRACKET_R),loc:this.loc(a)}},e.parseObject=function(n){var i=this,a=this._lexer.token,o=function(){return i.parseObjectField(n)};return{kind:U.OBJECT,fields:this.any(k.BRACE_L,o,k.BRACE_R),loc:this.loc(a)}},e.parseObjectField=function(n){var i=this._lexer.token,a=this.parseName();return this.expectToken(k.COLON),{kind:U.OBJECT_FIELD,name:a,value:this.parseValueLiteral(n),loc:this.loc(i)}},e.parseDirectives=function(n){for(var i=[];this.peek(k.AT);)i.push(this.parseDirective(n));return i},e.parseDirective=function(n){var i=this._lexer.token;return this.expectToken(k.AT),{kind:U.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(n),loc:this.loc(i)}},e.parseTypeReference=function(){var n=this._lexer.token,i;return this.expectOptionalToken(k.BRACKET_L)?(i=this.parseTypeReference(),this.expectToken(k.BRACKET_R),i={kind:U.LIST_TYPE,type:i,loc:this.loc(n)}):i=this.parseNamedType(),this.expectOptionalToken(k.BANG)?{kind:U.NON_NULL_TYPE,type:i,loc:this.loc(n)}:i},e.parseNamedType=function(){var n=this._lexer.token;return{kind:U.NAMED_TYPE,name:this.parseName(),loc:this.loc(n)}},e.parseTypeSystemDefinition=function(){var n=this.peekDescription()?this._lexer.lookahead():this._lexer.token;if(n.kind===k.NAME)switch(n.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}throw this.unexpected(n)},e.peekDescription=function(){return this.peek(k.STRING)||this.peek(k.BLOCK_STRING)},e.parseDescription=function(){if(this.peekDescription())return this.parseStringLiteral()},e.parseSchemaDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("schema");var a=this.parseDirectives(!0),o=this.many(k.BRACE_L,this.parseOperationTypeDefinition,k.BRACE_R);return{kind:U.SCHEMA_DEFINITION,description:i,directives:a,operationTypes:o,loc:this.loc(n)}},e.parseOperationTypeDefinition=function(){var n=this._lexer.token,i=this.parseOperationType();this.expectToken(k.COLON);var a=this.parseNamedType();return{kind:U.OPERATION_TYPE_DEFINITION,operation:i,type:a,loc:this.loc(n)}},e.parseScalarTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("scalar");var a=this.parseName(),o=this.parseDirectives(!0);return{kind:U.SCALAR_TYPE_DEFINITION,description:i,name:a,directives:o,loc:this.loc(n)}},e.parseObjectTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("type");var a=this.parseName(),o=this.parseImplementsInterfaces(),s=this.parseDirectives(!0),u=this.parseFieldsDefinition();return{kind:U.OBJECT_TYPE_DEFINITION,description:i,name:a,interfaces:o,directives:s,fields:u,loc:this.loc(n)}},e.parseImplementsInterfaces=function(){var n;if(!this.expectOptionalKeyword("implements"))return[];if(((n=this._options)===null||n===void 0?void 0:n.allowLegacySDLImplementsInterfaces)===!0){var i=[];this.expectOptionalToken(k.AMP);do i.push(this.parseNamedType());while(this.expectOptionalToken(k.AMP)||this.peek(k.NAME));return i}return this.delimitedMany(k.AMP,this.parseNamedType)},e.parseFieldsDefinition=function(){var n;return((n=this._options)===null||n===void 0?void 0:n.allowLegacySDLEmptyFields)===!0&&this.peek(k.BRACE_L)&&this._lexer.lookahead().kind===k.BRACE_R?(this._lexer.advance(),this._lexer.advance(),[]):this.optionalMany(k.BRACE_L,this.parseFieldDefinition,k.BRACE_R)},e.parseFieldDefinition=function(){var n=this._lexer.token,i=this.parseDescription(),a=this.parseName(),o=this.parseArgumentDefs();this.expectToken(k.COLON);var s=this.parseTypeReference(),u=this.parseDirectives(!0);return{kind:U.FIELD_DEFINITION,description:i,name:a,arguments:o,type:s,directives:u,loc:this.loc(n)}},e.parseArgumentDefs=function(){return this.optionalMany(k.PAREN_L,this.parseInputValueDef,k.PAREN_R)},e.parseInputValueDef=function(){var n=this._lexer.token,i=this.parseDescription(),a=this.parseName();this.expectToken(k.COLON);var o=this.parseTypeReference(),s;this.expectOptionalToken(k.EQUALS)&&(s=this.parseValueLiteral(!0));var u=this.parseDirectives(!0);return{kind:U.INPUT_VALUE_DEFINITION,description:i,name:a,type:o,defaultValue:s,directives:u,loc:this.loc(n)}},e.parseInterfaceTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("interface");var a=this.parseName(),o=this.parseImplementsInterfaces(),s=this.parseDirectives(!0),u=this.parseFieldsDefinition();return{kind:U.INTERFACE_TYPE_DEFINITION,description:i,name:a,interfaces:o,directives:s,fields:u,loc:this.loc(n)}},e.parseUnionTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("union");var a=this.parseName(),o=this.parseDirectives(!0),s=this.parseUnionMemberTypes();return{kind:U.UNION_TYPE_DEFINITION,description:i,name:a,directives:o,types:s,loc:this.loc(n)}},e.parseUnionMemberTypes=function(){return this.expectOptionalToken(k.EQUALS)?this.delimitedMany(k.PIPE,this.parseNamedType):[]},e.parseEnumTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("enum");var a=this.parseName(),o=this.parseDirectives(!0),s=this.parseEnumValuesDefinition();return{kind:U.ENUM_TYPE_DEFINITION,description:i,name:a,directives:o,values:s,loc:this.loc(n)}},e.parseEnumValuesDefinition=function(){return this.optionalMany(k.BRACE_L,this.parseEnumValueDefinition,k.BRACE_R)},e.parseEnumValueDefinition=function(){var n=this._lexer.token,i=this.parseDescription(),a=this.parseName(),o=this.parseDirectives(!0);return{kind:U.ENUM_VALUE_DEFINITION,description:i,name:a,directives:o,loc:this.loc(n)}},e.parseInputObjectTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("input");var a=this.parseName(),o=this.parseDirectives(!0),s=this.parseInputFieldsDefinition();return{kind:U.INPUT_OBJECT_TYPE_DEFINITION,description:i,name:a,directives:o,fields:s,loc:this.loc(n)}},e.parseInputFieldsDefinition=function(){return this.optionalMany(k.BRACE_L,this.parseInputValueDef,k.BRACE_R)},e.parseTypeSystemExtension=function(){var n=this._lexer.lookahead();if(n.kind===k.NAME)switch(n.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(n)},e.parseSchemaExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");var i=this.parseDirectives(!0),a=this.optionalMany(k.BRACE_L,this.parseOperationTypeDefinition,k.BRACE_R);if(i.length===0&&a.length===0)throw this.unexpected();return{kind:U.SCHEMA_EXTENSION,directives:i,operationTypes:a,loc:this.loc(n)}},e.parseScalarTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");var i=this.parseName(),a=this.parseDirectives(!0);if(a.length===0)throw this.unexpected();return{kind:U.SCALAR_TYPE_EXTENSION,name:i,directives:a,loc:this.loc(n)}},e.parseObjectTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");var i=this.parseName(),a=this.parseImplementsInterfaces(),o=this.parseDirectives(!0),s=this.parseFieldsDefinition();if(a.length===0&&o.length===0&&s.length===0)throw this.unexpected();return{kind:U.OBJECT_TYPE_EXTENSION,name:i,interfaces:a,directives:o,fields:s,loc:this.loc(n)}},e.parseInterfaceTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");var i=this.parseName(),a=this.parseImplementsInterfaces(),o=this.parseDirectives(!0),s=this.parseFieldsDefinition();if(a.length===0&&o.length===0&&s.length===0)throw this.unexpected();return{kind:U.INTERFACE_TYPE_EXTENSION,name:i,interfaces:a,directives:o,fields:s,loc:this.loc(n)}},e.parseUnionTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");var i=this.parseName(),a=this.parseDirectives(!0),o=this.parseUnionMemberTypes();if(a.length===0&&o.length===0)throw this.unexpected();return{kind:U.UNION_TYPE_EXTENSION,name:i,directives:a,types:o,loc:this.loc(n)}},e.parseEnumTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");var i=this.parseName(),a=this.parseDirectives(!0),o=this.parseEnumValuesDefinition();if(a.length===0&&o.length===0)throw this.unexpected();return{kind:U.ENUM_TYPE_EXTENSION,name:i,directives:a,values:o,loc:this.loc(n)}},e.parseInputObjectTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");var i=this.parseName(),a=this.parseDirectives(!0),o=this.parseInputFieldsDefinition();if(a.length===0&&o.length===0)throw this.unexpected();return{kind:U.INPUT_OBJECT_TYPE_EXTENSION,name:i,directives:a,fields:o,loc:this.loc(n)}},e.parseDirectiveDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("directive"),this.expectToken(k.AT);var a=this.parseName(),o=this.parseArgumentDefs(),s=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");var u=this.parseDirectiveLocations();return{kind:U.DIRECTIVE_DEFINITION,description:i,name:a,arguments:o,repeatable:s,locations:u,loc:this.loc(n)}},e.parseDirectiveLocations=function(){return this.delimitedMany(k.PIPE,this.parseDirectiveLocation)},e.parseDirectiveLocation=function(){var n=this._lexer.token,i=this.parseName();if(Ug[i.value]!==void 0)return i;throw this.unexpected(n)},e.loc=function(n){var i;if(((i=this._options)===null||i===void 0?void 0:i.noLocation)!==!0)return new ph(n,this._lexer.lastToken,this._lexer.source)},e.peek=function(n){return this._lexer.token.kind===n},e.expectToken=function(n){var i=this._lexer.token;if(i.kind===n)return this._lexer.advance(),i;throw gt(this._lexer.source,i.start,"Expected ".concat(mh(n),", found ").concat(du(i),"."))},e.expectOptionalToken=function(n){var i=this._lexer.token;if(i.kind===n)return this._lexer.advance(),i},e.expectKeyword=function(n){var i=this._lexer.token;if(i.kind===k.NAME&&i.value===n)this._lexer.advance();else throw gt(this._lexer.source,i.start,'Expected "'.concat(n,'", found ').concat(du(i),"."))},e.expectOptionalKeyword=function(n){var i=this._lexer.token;return i.kind===k.NAME&&i.value===n?(this._lexer.advance(),!0):!1},e.unexpected=function(n){var i=n??this._lexer.token;return gt(this._lexer.source,i.start,"Unexpected ".concat(du(i),"."))},e.any=function(n,i,a){this.expectToken(n);for(var o=[];!this.expectOptionalToken(a);)o.push(i.call(this));return o},e.optionalMany=function(n,i,a){if(this.expectOptionalToken(n)){var o=[];do o.push(i.call(this));while(!this.expectOptionalToken(a));return o}return[]},e.many=function(n,i,a){this.expectToken(n);var o=[];do o.push(i.call(this));while(!this.expectOptionalToken(a));return o},e.delimitedMany=function(n,i){this.expectOptionalToken(n);var a=[];do a.push(i.call(this));while(this.expectOptionalToken(n));return a},t}();function du(t){var e=t.value;return mh(t.kind)+(e!=null?' "'.concat(e,'"'):"")}function mh(t){return Vg(t)?'"'.concat(t,'"'):t}var Ko=new Map,Pu=new Map,gh=!0,os=!1;function yh(t){return t.replace(/[\s,]+/g," ").trim()}function ty(t){return yh(t.source.body.substring(t.start,t.end))}function ry(t){var e=new Set,r=[];return t.definitions.forEach(function(n){if(n.kind==="FragmentDefinition"){var i=n.name.value,a=ty(n.loc),o=Pu.get(i);o&&!o.has(a)?gh&&console.warn("Warning: fragment with name "+i+` already exists.
|
|
59
|
+
`+uh(t.source,s)}return e}function gt(t,e,r){return new kg("Syntax Error: ".concat(r),void 0,t,[e])}var U=Object.freeze({NAME:"Name",DOCUMENT:"Document",OPERATION_DEFINITION:"OperationDefinition",VARIABLE_DEFINITION:"VariableDefinition",SELECTION_SET:"SelectionSet",FIELD:"Field",ARGUMENT:"Argument",FRAGMENT_SPREAD:"FragmentSpread",INLINE_FRAGMENT:"InlineFragment",FRAGMENT_DEFINITION:"FragmentDefinition",VARIABLE:"Variable",INT:"IntValue",FLOAT:"FloatValue",STRING:"StringValue",BOOLEAN:"BooleanValue",NULL:"NullValue",ENUM:"EnumValue",LIST:"ListValue",OBJECT:"ObjectValue",OBJECT_FIELD:"ObjectField",DIRECTIVE:"Directive",NAMED_TYPE:"NamedType",LIST_TYPE:"ListType",NON_NULL_TYPE:"NonNullType",SCHEMA_DEFINITION:"SchemaDefinition",OPERATION_TYPE_DEFINITION:"OperationTypeDefinition",SCALAR_TYPE_DEFINITION:"ScalarTypeDefinition",OBJECT_TYPE_DEFINITION:"ObjectTypeDefinition",FIELD_DEFINITION:"FieldDefinition",INPUT_VALUE_DEFINITION:"InputValueDefinition",INTERFACE_TYPE_DEFINITION:"InterfaceTypeDefinition",UNION_TYPE_DEFINITION:"UnionTypeDefinition",ENUM_TYPE_DEFINITION:"EnumTypeDefinition",ENUM_VALUE_DEFINITION:"EnumValueDefinition",INPUT_OBJECT_TYPE_DEFINITION:"InputObjectTypeDefinition",DIRECTIVE_DEFINITION:"DirectiveDefinition",SCHEMA_EXTENSION:"SchemaExtension",SCALAR_TYPE_EXTENSION:"ScalarTypeExtension",OBJECT_TYPE_EXTENSION:"ObjectTypeExtension",INTERFACE_TYPE_EXTENSION:"InterfaceTypeExtension",UNION_TYPE_EXTENSION:"UnionTypeExtension",ENUM_TYPE_EXTENSION:"EnumTypeExtension",INPUT_OBJECT_TYPE_EXTENSION:"InputObjectTypeExtension"});function Ag(t,e){var r=Boolean(t);if(!r)throw new Error(e??"Unexpected invariant triggered.")}var Ig=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):void 0,Lu=Ig;function ph(t){var e=t.prototype.toJSON;typeof e=="function"||Ag(0),t.prototype.inspect=e,Lu&&(t.prototype[Lu]=e)}var dh=function(){function t(r,n,i){this.start=r.start,this.end=n.end,this.startToken=r,this.endToken=n,this.source=i}var e=t.prototype;return e.toJSON=function(){return{start:this.start,end:this.end}},t}();ph(dh);var Ie=function(){function t(r,n,i,a,o,s,u){this.kind=r,this.start=n,this.end=i,this.line=a,this.column=o,this.value=u,this.prev=s,this.next=null}var e=t.prototype;return e.toJSON=function(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}},t}();ph(Ie);var k=Object.freeze({SOF:"<SOF>",EOF:"<EOF>",BANG:"!",DOLLAR:"$",AMP:"&",PAREN_L:"(",PAREN_R:")",SPREAD:"...",COLON:":",EQUALS:"=",AT:"@",BRACKET_L:"[",BRACKET_R:"]",BRACE_L:"{",PIPE:"|",BRACE_R:"}",NAME:"Name",INT:"Int",FLOAT:"Float",STRING:"String",BLOCK_STRING:"BlockString",COMMENT:"Comment"});function Ko(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ko=function(r){return typeof r}:Ko=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Ko(t)}var Og=10,hh=2;function Dg(t){return As(t,[])}function As(t,e){switch(Ko(t)){case"string":return JSON.stringify(t);case"function":return t.name?"[function ".concat(t.name,"]"):"[function]";case"object":return t===null?"null":Ng(t,e);default:return String(t)}}function Ng(t,e){if(e.indexOf(t)!==-1)return"[Circular]";var r=[].concat(e,[t]),n=Lg(t);if(n!==void 0){var i=n.call(t);if(i!==t)return typeof i=="string"?i:As(i,r)}else if(Array.isArray(t))return Pg(t,r);return Rg(t,r)}function Rg(t,e){var r=Object.keys(t);if(r.length===0)return"{}";if(e.length>hh)return"["+$g(t)+"]";var n=r.map(function(i){var a=As(t[i],e);return i+": "+a});return"{ "+n.join(", ")+" }"}function Pg(t,e){if(t.length===0)return"[]";if(e.length>hh)return"[Array]";for(var r=Math.min(Og,t.length),n=t.length-r,i=[],a=0;a<r;++a)i.push(As(t[a],e));return n===1?i.push("... 1 more item"):n>1&&i.push("... ".concat(n," more items")),"["+i.join(", ")+"]"}function Lg(t){var e=t[String(Lu)];if(typeof e=="function")return e;if(typeof t.inspect=="function")return t.inspect}function $g(t){var e=Object.prototype.toString.call(t).replace(/^\[object /,"").replace(/]$/,"");if(e==="Object"&&typeof t.constructor=="function"){var r=t.constructor.name;if(typeof r=="string"&&r!=="")return r}return e}function du(t,e){var r=Boolean(t);if(!r)throw new Error(e)}var Fg=function(e,r){return e instanceof r};function nd(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Mg(t,e,r){return e&&nd(t.prototype,e),r&&nd(t,r),t}var mh=function(){function t(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"GraphQL request",n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{line:1,column:1};typeof e=="string"||du(0,"Body must be a string. Received: ".concat(Dg(e),".")),this.body=e,this.name=r,this.locationOffset=n,this.locationOffset.line>0||du(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||du(0,"column in locationOffset is 1-indexed and must be positive.")}return Mg(t,[{key:ch,get:function(){return"Source"}}]),t}();function Ug(t){return Fg(t,mh)}var jg=Object.freeze({QUERY:"QUERY",MUTATION:"MUTATION",SUBSCRIPTION:"SUBSCRIPTION",FIELD:"FIELD",FRAGMENT_DEFINITION:"FRAGMENT_DEFINITION",FRAGMENT_SPREAD:"FRAGMENT_SPREAD",INLINE_FRAGMENT:"INLINE_FRAGMENT",VARIABLE_DEFINITION:"VARIABLE_DEFINITION",SCHEMA:"SCHEMA",SCALAR:"SCALAR",OBJECT:"OBJECT",FIELD_DEFINITION:"FIELD_DEFINITION",ARGUMENT_DEFINITION:"ARGUMENT_DEFINITION",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",ENUM_VALUE:"ENUM_VALUE",INPUT_OBJECT:"INPUT_OBJECT",INPUT_FIELD_DEFINITION:"INPUT_FIELD_DEFINITION"});function qg(t){var e=t.split(/\r\n|[\n\r]/g),r=Bg(t);if(r!==0)for(var n=1;n<e.length;n++)e[n]=e[n].slice(r);for(var i=0;i<e.length&&id(e[i]);)++i;for(var a=e.length;a>i&&id(e[a-1]);)--a;return e.slice(i,a).join(`
|
|
60
|
+
`)}function id(t){for(var e=0;e<t.length;++e)if(t[e]!==" "&&t[e]!==" ")return!1;return!0}function Bg(t){for(var e,r=!0,n=!0,i=0,a=null,o=0;o<t.length;++o)switch(t.charCodeAt(o)){case 13:t.charCodeAt(o+1)===10&&++o;case 10:r=!1,n=!0,i=0;break;case 9:case 32:++i;break;default:n&&!r&&(a===null||i<a)&&(a=i),n=!1}return(e=a)!==null&&e!==void 0?e:0}var Vg=function(){function t(r){var n=new Ie(k.SOF,0,0,0,0,null);this.source=r,this.lastToken=n,this.token=n,this.line=1,this.lineStart=0}var e=t.prototype;return e.advance=function(){this.lastToken=this.token;var n=this.token=this.lookahead();return n},e.lookahead=function(){var n=this.token;if(n.kind!==k.EOF)do{var i;n=(i=n.next)!==null&&i!==void 0?i:n.next=Qg(this,n)}while(n.kind===k.COMMENT);return n},t}();function zg(t){return t===k.BANG||t===k.DOLLAR||t===k.AMP||t===k.PAREN_L||t===k.PAREN_R||t===k.SPREAD||t===k.COLON||t===k.EQUALS||t===k.AT||t===k.BRACKET_L||t===k.BRACKET_R||t===k.BRACE_L||t===k.PIPE||t===k.BRACE_R}function wn(t){return isNaN(t)?k.EOF:t<127?JSON.stringify(String.fromCharCode(t)):'"\\u'.concat(("00"+t.toString(16).toUpperCase()).slice(-4),'"')}function Qg(t,e){for(var r=t.source,n=r.body,i=n.length,a=e.end;a<i;){var o=n.charCodeAt(a),s=t.line,u=1+a-t.lineStart;switch(o){case 65279:case 9:case 32:case 44:++a;continue;case 10:++a,++t.line,t.lineStart=a;continue;case 13:n.charCodeAt(a+1)===10?a+=2:++a,++t.line,t.lineStart=a;continue;case 33:return new Ie(k.BANG,a,a+1,s,u,e);case 35:return Hg(r,a,s,u,e);case 36:return new Ie(k.DOLLAR,a,a+1,s,u,e);case 38:return new Ie(k.AMP,a,a+1,s,u,e);case 40:return new Ie(k.PAREN_L,a,a+1,s,u,e);case 41:return new Ie(k.PAREN_R,a,a+1,s,u,e);case 46:if(n.charCodeAt(a+1)===46&&n.charCodeAt(a+2)===46)return new Ie(k.SPREAD,a,a+3,s,u,e);break;case 58:return new Ie(k.COLON,a,a+1,s,u,e);case 61:return new Ie(k.EQUALS,a,a+1,s,u,e);case 64:return new Ie(k.AT,a,a+1,s,u,e);case 91:return new Ie(k.BRACKET_L,a,a+1,s,u,e);case 93:return new Ie(k.BRACKET_R,a,a+1,s,u,e);case 123:return new Ie(k.BRACE_L,a,a+1,s,u,e);case 124:return new Ie(k.PIPE,a,a+1,s,u,e);case 125:return new Ie(k.BRACE_R,a,a+1,s,u,e);case 34:return n.charCodeAt(a+1)===34&&n.charCodeAt(a+2)===34?Zg(r,a,s,u,e,t):Kg(r,a,s,u,e);case 45:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return Wg(r,a,o,s,u,e);case 65:case 66:case 67:case 68:case 69:case 70:case 71:case 72:case 73:case 74:case 75:case 76:case 77:case 78:case 79:case 80:case 81:case 82:case 83:case 84:case 85:case 86:case 87:case 88:case 89:case 90:case 95:case 97:case 98:case 99:case 100:case 101:case 102:case 103:case 104:case 105:case 106:case 107:case 108:case 109:case 110:case 111:case 112:case 113:case 114:case 115:case 116:case 117:case 118:case 119:case 120:case 121:case 122:return Jg(r,a,s,u,e)}throw gt(r,a,Gg(o))}var c=t.line,l=1+a-t.lineStart;return new Ie(k.EOF,i,i,c,l,e)}function Gg(t){return t<32&&t!==9&&t!==10&&t!==13?"Cannot contain the invalid character ".concat(wn(t),"."):t===39?`Unexpected single quote character ('), did you mean to use a double quote (")?`:"Cannot parse the unexpected character ".concat(wn(t),".")}function Hg(t,e,r,n,i){var a=t.body,o,s=e;do o=a.charCodeAt(++s);while(!isNaN(o)&&(o>31||o===9));return new Ie(k.COMMENT,e,s,r,n,i,a.slice(e+1,s))}function Wg(t,e,r,n,i,a){var o=t.body,s=r,u=e,c=!1;if(s===45&&(s=o.charCodeAt(++u)),s===48){if(s=o.charCodeAt(++u),s>=48&&s<=57)throw gt(t,u,"Invalid number, unexpected digit after 0: ".concat(wn(s),"."))}else u=hu(t,u,s),s=o.charCodeAt(u);if(s===46&&(c=!0,s=o.charCodeAt(++u),u=hu(t,u,s),s=o.charCodeAt(u)),(s===69||s===101)&&(c=!0,s=o.charCodeAt(++u),(s===43||s===45)&&(s=o.charCodeAt(++u)),u=hu(t,u,s),s=o.charCodeAt(u)),s===46||Xg(s))throw gt(t,u,"Invalid number, expected digit but got: ".concat(wn(s),"."));return new Ie(c?k.FLOAT:k.INT,e,u,n,i,a,o.slice(e,u))}function hu(t,e,r){var n=t.body,i=e,a=r;if(a>=48&&a<=57){do a=n.charCodeAt(++i);while(a>=48&&a<=57);return i}throw gt(t,i,"Invalid number, expected digit but got: ".concat(wn(a),"."))}function Kg(t,e,r,n,i){for(var a=t.body,o=e+1,s=o,u=0,c="";o<a.length&&!isNaN(u=a.charCodeAt(o))&&u!==10&&u!==13;){if(u===34)return c+=a.slice(s,o),new Ie(k.STRING,e,o+1,r,n,i,c);if(u<32&&u!==9)throw gt(t,o,"Invalid character within String: ".concat(wn(u),"."));if(++o,u===92){switch(c+=a.slice(s,o-1),u=a.charCodeAt(o),u){case 34:c+='"';break;case 47:c+="/";break;case 92:c+="\\";break;case 98:c+="\b";break;case 102:c+="\f";break;case 110:c+=`
|
|
61
|
+
`;break;case 114:c+="\r";break;case 116:c+=" ";break;case 117:{var l=Yg(a.charCodeAt(o+1),a.charCodeAt(o+2),a.charCodeAt(o+3),a.charCodeAt(o+4));if(l<0){var d=a.slice(o+1,o+5);throw gt(t,o,"Invalid character escape sequence: \\u".concat(d,"."))}c+=String.fromCharCode(l),o+=4;break}default:throw gt(t,o,"Invalid character escape sequence: \\".concat(String.fromCharCode(u),"."))}++o,s=o}}throw gt(t,o,"Unterminated string.")}function Zg(t,e,r,n,i,a){for(var o=t.body,s=e+3,u=s,c=0,l="";s<o.length&&!isNaN(c=o.charCodeAt(s));){if(c===34&&o.charCodeAt(s+1)===34&&o.charCodeAt(s+2)===34)return l+=o.slice(u,s),new Ie(k.BLOCK_STRING,e,s+3,r,n,i,qg(l));if(c<32&&c!==9&&c!==10&&c!==13)throw gt(t,s,"Invalid character within String: ".concat(wn(c),"."));c===10?(++s,++a.line,a.lineStart=s):c===13?(o.charCodeAt(s+1)===10?s+=2:++s,++a.line,a.lineStart=s):c===92&&o.charCodeAt(s+1)===34&&o.charCodeAt(s+2)===34&&o.charCodeAt(s+3)===34?(l+=o.slice(u,s)+'"""',s+=4,u=s):++s}throw gt(t,s,"Unterminated string.")}function Yg(t,e,r,n){return Ro(t)<<12|Ro(e)<<8|Ro(r)<<4|Ro(n)}function Ro(t){return t>=48&&t<=57?t-48:t>=65&&t<=70?t-55:t>=97&&t<=102?t-87:-1}function Jg(t,e,r,n,i){for(var a=t.body,o=a.length,s=e+1,u=0;s!==o&&!isNaN(u=a.charCodeAt(s))&&(u===95||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122);)++s;return new Ie(k.NAME,e,s,r,n,i,a.slice(e,s))}function Xg(t){return t===95||t>=65&&t<=90||t>=97&&t<=122}function ey(t,e){var r=new ty(t,e);return r.parseDocument()}var ty=function(){function t(r,n){var i=Ug(r)?r:new mh(r);this._lexer=new Vg(i),this._options=n}var e=t.prototype;return e.parseName=function(){var n=this.expectToken(k.NAME);return{kind:U.NAME,value:n.value,loc:this.loc(n)}},e.parseDocument=function(){var n=this._lexer.token;return{kind:U.DOCUMENT,definitions:this.many(k.SOF,this.parseDefinition,k.EOF),loc:this.loc(n)}},e.parseDefinition=function(){if(this.peek(k.NAME))switch(this._lexer.token.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"schema":case"scalar":case"type":case"interface":case"union":case"enum":case"input":case"directive":return this.parseTypeSystemDefinition();case"extend":return this.parseTypeSystemExtension()}else{if(this.peek(k.BRACE_L))return this.parseOperationDefinition();if(this.peekDescription())return this.parseTypeSystemDefinition()}throw this.unexpected()},e.parseOperationDefinition=function(){var n=this._lexer.token;if(this.peek(k.BRACE_L))return{kind:U.OPERATION_DEFINITION,operation:"query",name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet(),loc:this.loc(n)};var i=this.parseOperationType(),a;return this.peek(k.NAME)&&(a=this.parseName()),{kind:U.OPERATION_DEFINITION,operation:i,name:a,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(n)}},e.parseOperationType=function(){var n=this.expectToken(k.NAME);switch(n.value){case"query":return"query";case"mutation":return"mutation";case"subscription":return"subscription"}throw this.unexpected(n)},e.parseVariableDefinitions=function(){return this.optionalMany(k.PAREN_L,this.parseVariableDefinition,k.PAREN_R)},e.parseVariableDefinition=function(){var n=this._lexer.token;return{kind:U.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(k.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(k.EQUALS)?this.parseValueLiteral(!0):void 0,directives:this.parseDirectives(!0),loc:this.loc(n)}},e.parseVariable=function(){var n=this._lexer.token;return this.expectToken(k.DOLLAR),{kind:U.VARIABLE,name:this.parseName(),loc:this.loc(n)}},e.parseSelectionSet=function(){var n=this._lexer.token;return{kind:U.SELECTION_SET,selections:this.many(k.BRACE_L,this.parseSelection,k.BRACE_R),loc:this.loc(n)}},e.parseSelection=function(){return this.peek(k.SPREAD)?this.parseFragment():this.parseField()},e.parseField=function(){var n=this._lexer.token,i=this.parseName(),a,o;return this.expectOptionalToken(k.COLON)?(a=i,o=this.parseName()):o=i,{kind:U.FIELD,alias:a,name:o,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(k.BRACE_L)?this.parseSelectionSet():void 0,loc:this.loc(n)}},e.parseArguments=function(n){var i=n?this.parseConstArgument:this.parseArgument;return this.optionalMany(k.PAREN_L,i,k.PAREN_R)},e.parseArgument=function(){var n=this._lexer.token,i=this.parseName();return this.expectToken(k.COLON),{kind:U.ARGUMENT,name:i,value:this.parseValueLiteral(!1),loc:this.loc(n)}},e.parseConstArgument=function(){var n=this._lexer.token;return{kind:U.ARGUMENT,name:this.parseName(),value:(this.expectToken(k.COLON),this.parseValueLiteral(!0)),loc:this.loc(n)}},e.parseFragment=function(){var n=this._lexer.token;this.expectToken(k.SPREAD);var i=this.expectOptionalKeyword("on");return!i&&this.peek(k.NAME)?{kind:U.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1),loc:this.loc(n)}:{kind:U.INLINE_FRAGMENT,typeCondition:i?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(n)}},e.parseFragmentDefinition=function(){var n,i=this._lexer.token;return this.expectKeyword("fragment"),((n=this._options)===null||n===void 0?void 0:n.experimentalFragmentVariables)===!0?{kind:U.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(i)}:{kind:U.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(i)}},e.parseFragmentName=function(){if(this._lexer.token.value==="on")throw this.unexpected();return this.parseName()},e.parseValueLiteral=function(n){var i=this._lexer.token;switch(i.kind){case k.BRACKET_L:return this.parseList(n);case k.BRACE_L:return this.parseObject(n);case k.INT:return this._lexer.advance(),{kind:U.INT,value:i.value,loc:this.loc(i)};case k.FLOAT:return this._lexer.advance(),{kind:U.FLOAT,value:i.value,loc:this.loc(i)};case k.STRING:case k.BLOCK_STRING:return this.parseStringLiteral();case k.NAME:switch(this._lexer.advance(),i.value){case"true":return{kind:U.BOOLEAN,value:!0,loc:this.loc(i)};case"false":return{kind:U.BOOLEAN,value:!1,loc:this.loc(i)};case"null":return{kind:U.NULL,loc:this.loc(i)};default:return{kind:U.ENUM,value:i.value,loc:this.loc(i)}}case k.DOLLAR:if(!n)return this.parseVariable();break}throw this.unexpected()},e.parseStringLiteral=function(){var n=this._lexer.token;return this._lexer.advance(),{kind:U.STRING,value:n.value,block:n.kind===k.BLOCK_STRING,loc:this.loc(n)}},e.parseList=function(n){var i=this,a=this._lexer.token,o=function(){return i.parseValueLiteral(n)};return{kind:U.LIST,values:this.any(k.BRACKET_L,o,k.BRACKET_R),loc:this.loc(a)}},e.parseObject=function(n){var i=this,a=this._lexer.token,o=function(){return i.parseObjectField(n)};return{kind:U.OBJECT,fields:this.any(k.BRACE_L,o,k.BRACE_R),loc:this.loc(a)}},e.parseObjectField=function(n){var i=this._lexer.token,a=this.parseName();return this.expectToken(k.COLON),{kind:U.OBJECT_FIELD,name:a,value:this.parseValueLiteral(n),loc:this.loc(i)}},e.parseDirectives=function(n){for(var i=[];this.peek(k.AT);)i.push(this.parseDirective(n));return i},e.parseDirective=function(n){var i=this._lexer.token;return this.expectToken(k.AT),{kind:U.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(n),loc:this.loc(i)}},e.parseTypeReference=function(){var n=this._lexer.token,i;return this.expectOptionalToken(k.BRACKET_L)?(i=this.parseTypeReference(),this.expectToken(k.BRACKET_R),i={kind:U.LIST_TYPE,type:i,loc:this.loc(n)}):i=this.parseNamedType(),this.expectOptionalToken(k.BANG)?{kind:U.NON_NULL_TYPE,type:i,loc:this.loc(n)}:i},e.parseNamedType=function(){var n=this._lexer.token;return{kind:U.NAMED_TYPE,name:this.parseName(),loc:this.loc(n)}},e.parseTypeSystemDefinition=function(){var n=this.peekDescription()?this._lexer.lookahead():this._lexer.token;if(n.kind===k.NAME)switch(n.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}throw this.unexpected(n)},e.peekDescription=function(){return this.peek(k.STRING)||this.peek(k.BLOCK_STRING)},e.parseDescription=function(){if(this.peekDescription())return this.parseStringLiteral()},e.parseSchemaDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("schema");var a=this.parseDirectives(!0),o=this.many(k.BRACE_L,this.parseOperationTypeDefinition,k.BRACE_R);return{kind:U.SCHEMA_DEFINITION,description:i,directives:a,operationTypes:o,loc:this.loc(n)}},e.parseOperationTypeDefinition=function(){var n=this._lexer.token,i=this.parseOperationType();this.expectToken(k.COLON);var a=this.parseNamedType();return{kind:U.OPERATION_TYPE_DEFINITION,operation:i,type:a,loc:this.loc(n)}},e.parseScalarTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("scalar");var a=this.parseName(),o=this.parseDirectives(!0);return{kind:U.SCALAR_TYPE_DEFINITION,description:i,name:a,directives:o,loc:this.loc(n)}},e.parseObjectTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("type");var a=this.parseName(),o=this.parseImplementsInterfaces(),s=this.parseDirectives(!0),u=this.parseFieldsDefinition();return{kind:U.OBJECT_TYPE_DEFINITION,description:i,name:a,interfaces:o,directives:s,fields:u,loc:this.loc(n)}},e.parseImplementsInterfaces=function(){var n;if(!this.expectOptionalKeyword("implements"))return[];if(((n=this._options)===null||n===void 0?void 0:n.allowLegacySDLImplementsInterfaces)===!0){var i=[];this.expectOptionalToken(k.AMP);do i.push(this.parseNamedType());while(this.expectOptionalToken(k.AMP)||this.peek(k.NAME));return i}return this.delimitedMany(k.AMP,this.parseNamedType)},e.parseFieldsDefinition=function(){var n;return((n=this._options)===null||n===void 0?void 0:n.allowLegacySDLEmptyFields)===!0&&this.peek(k.BRACE_L)&&this._lexer.lookahead().kind===k.BRACE_R?(this._lexer.advance(),this._lexer.advance(),[]):this.optionalMany(k.BRACE_L,this.parseFieldDefinition,k.BRACE_R)},e.parseFieldDefinition=function(){var n=this._lexer.token,i=this.parseDescription(),a=this.parseName(),o=this.parseArgumentDefs();this.expectToken(k.COLON);var s=this.parseTypeReference(),u=this.parseDirectives(!0);return{kind:U.FIELD_DEFINITION,description:i,name:a,arguments:o,type:s,directives:u,loc:this.loc(n)}},e.parseArgumentDefs=function(){return this.optionalMany(k.PAREN_L,this.parseInputValueDef,k.PAREN_R)},e.parseInputValueDef=function(){var n=this._lexer.token,i=this.parseDescription(),a=this.parseName();this.expectToken(k.COLON);var o=this.parseTypeReference(),s;this.expectOptionalToken(k.EQUALS)&&(s=this.parseValueLiteral(!0));var u=this.parseDirectives(!0);return{kind:U.INPUT_VALUE_DEFINITION,description:i,name:a,type:o,defaultValue:s,directives:u,loc:this.loc(n)}},e.parseInterfaceTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("interface");var a=this.parseName(),o=this.parseImplementsInterfaces(),s=this.parseDirectives(!0),u=this.parseFieldsDefinition();return{kind:U.INTERFACE_TYPE_DEFINITION,description:i,name:a,interfaces:o,directives:s,fields:u,loc:this.loc(n)}},e.parseUnionTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("union");var a=this.parseName(),o=this.parseDirectives(!0),s=this.parseUnionMemberTypes();return{kind:U.UNION_TYPE_DEFINITION,description:i,name:a,directives:o,types:s,loc:this.loc(n)}},e.parseUnionMemberTypes=function(){return this.expectOptionalToken(k.EQUALS)?this.delimitedMany(k.PIPE,this.parseNamedType):[]},e.parseEnumTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("enum");var a=this.parseName(),o=this.parseDirectives(!0),s=this.parseEnumValuesDefinition();return{kind:U.ENUM_TYPE_DEFINITION,description:i,name:a,directives:o,values:s,loc:this.loc(n)}},e.parseEnumValuesDefinition=function(){return this.optionalMany(k.BRACE_L,this.parseEnumValueDefinition,k.BRACE_R)},e.parseEnumValueDefinition=function(){var n=this._lexer.token,i=this.parseDescription(),a=this.parseName(),o=this.parseDirectives(!0);return{kind:U.ENUM_VALUE_DEFINITION,description:i,name:a,directives:o,loc:this.loc(n)}},e.parseInputObjectTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("input");var a=this.parseName(),o=this.parseDirectives(!0),s=this.parseInputFieldsDefinition();return{kind:U.INPUT_OBJECT_TYPE_DEFINITION,description:i,name:a,directives:o,fields:s,loc:this.loc(n)}},e.parseInputFieldsDefinition=function(){return this.optionalMany(k.BRACE_L,this.parseInputValueDef,k.BRACE_R)},e.parseTypeSystemExtension=function(){var n=this._lexer.lookahead();if(n.kind===k.NAME)switch(n.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(n)},e.parseSchemaExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");var i=this.parseDirectives(!0),a=this.optionalMany(k.BRACE_L,this.parseOperationTypeDefinition,k.BRACE_R);if(i.length===0&&a.length===0)throw this.unexpected();return{kind:U.SCHEMA_EXTENSION,directives:i,operationTypes:a,loc:this.loc(n)}},e.parseScalarTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");var i=this.parseName(),a=this.parseDirectives(!0);if(a.length===0)throw this.unexpected();return{kind:U.SCALAR_TYPE_EXTENSION,name:i,directives:a,loc:this.loc(n)}},e.parseObjectTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");var i=this.parseName(),a=this.parseImplementsInterfaces(),o=this.parseDirectives(!0),s=this.parseFieldsDefinition();if(a.length===0&&o.length===0&&s.length===0)throw this.unexpected();return{kind:U.OBJECT_TYPE_EXTENSION,name:i,interfaces:a,directives:o,fields:s,loc:this.loc(n)}},e.parseInterfaceTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");var i=this.parseName(),a=this.parseImplementsInterfaces(),o=this.parseDirectives(!0),s=this.parseFieldsDefinition();if(a.length===0&&o.length===0&&s.length===0)throw this.unexpected();return{kind:U.INTERFACE_TYPE_EXTENSION,name:i,interfaces:a,directives:o,fields:s,loc:this.loc(n)}},e.parseUnionTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");var i=this.parseName(),a=this.parseDirectives(!0),o=this.parseUnionMemberTypes();if(a.length===0&&o.length===0)throw this.unexpected();return{kind:U.UNION_TYPE_EXTENSION,name:i,directives:a,types:o,loc:this.loc(n)}},e.parseEnumTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");var i=this.parseName(),a=this.parseDirectives(!0),o=this.parseEnumValuesDefinition();if(a.length===0&&o.length===0)throw this.unexpected();return{kind:U.ENUM_TYPE_EXTENSION,name:i,directives:a,values:o,loc:this.loc(n)}},e.parseInputObjectTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");var i=this.parseName(),a=this.parseDirectives(!0),o=this.parseInputFieldsDefinition();if(a.length===0&&o.length===0)throw this.unexpected();return{kind:U.INPUT_OBJECT_TYPE_EXTENSION,name:i,directives:a,fields:o,loc:this.loc(n)}},e.parseDirectiveDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("directive"),this.expectToken(k.AT);var a=this.parseName(),o=this.parseArgumentDefs(),s=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");var u=this.parseDirectiveLocations();return{kind:U.DIRECTIVE_DEFINITION,description:i,name:a,arguments:o,repeatable:s,locations:u,loc:this.loc(n)}},e.parseDirectiveLocations=function(){return this.delimitedMany(k.PIPE,this.parseDirectiveLocation)},e.parseDirectiveLocation=function(){var n=this._lexer.token,i=this.parseName();if(jg[i.value]!==void 0)return i;throw this.unexpected(n)},e.loc=function(n){var i;if(((i=this._options)===null||i===void 0?void 0:i.noLocation)!==!0)return new dh(n,this._lexer.lastToken,this._lexer.source)},e.peek=function(n){return this._lexer.token.kind===n},e.expectToken=function(n){var i=this._lexer.token;if(i.kind===n)return this._lexer.advance(),i;throw gt(this._lexer.source,i.start,"Expected ".concat(gh(n),", found ").concat(mu(i),"."))},e.expectOptionalToken=function(n){var i=this._lexer.token;if(i.kind===n)return this._lexer.advance(),i},e.expectKeyword=function(n){var i=this._lexer.token;if(i.kind===k.NAME&&i.value===n)this._lexer.advance();else throw gt(this._lexer.source,i.start,'Expected "'.concat(n,'", found ').concat(mu(i),"."))},e.expectOptionalKeyword=function(n){var i=this._lexer.token;return i.kind===k.NAME&&i.value===n?(this._lexer.advance(),!0):!1},e.unexpected=function(n){var i=n??this._lexer.token;return gt(this._lexer.source,i.start,"Unexpected ".concat(mu(i),"."))},e.any=function(n,i,a){this.expectToken(n);for(var o=[];!this.expectOptionalToken(a);)o.push(i.call(this));return o},e.optionalMany=function(n,i,a){if(this.expectOptionalToken(n)){var o=[];do o.push(i.call(this));while(!this.expectOptionalToken(a));return o}return[]},e.many=function(n,i,a){this.expectToken(n);var o=[];do o.push(i.call(this));while(!this.expectOptionalToken(a));return o},e.delimitedMany=function(n,i){this.expectOptionalToken(n);var a=[];do a.push(i.call(this));while(this.expectOptionalToken(n));return a},t}();function mu(t){var e=t.value;return gh(t.kind)+(e!=null?' "'.concat(e,'"'):"")}function gh(t){return zg(t)?'"'.concat(t,'"'):t}var Zo=new Map,$u=new Map,yh=!0,ss=!1;function vh(t){return t.replace(/[\s,]+/g," ").trim()}function ry(t){return vh(t.source.body.substring(t.start,t.end))}function ny(t){var e=new Set,r=[];return t.definitions.forEach(function(n){if(n.kind==="FragmentDefinition"){var i=n.name.value,a=ry(n.loc),o=$u.get(i);o&&!o.has(a)?yh&&console.warn("Warning: fragment with name "+i+` already exists.
|
|
62
62
|
graphql-tag enforces all fragment names across your application to be unique; read more about
|
|
63
|
-
this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`):o||Pu.set(i,o=new Set),o.add(a),e.has(a)||(e.add(a),r.push(n))}else r.push(n)}),as(as({},t),{definitions:r})}function ny(t){var e=new Set(t.definitions);e.forEach(function(n){n.loc&&delete n.loc,Object.keys(n).forEach(function(i){var a=n[i];a&&typeof a=="object"&&e.add(a)})});var r=t.loc;return r&&(delete r.startToken,delete r.endToken),t}function iy(t){var e=yh(t);if(!Ko.has(e)){var r=Xg(t,{experimentalFragmentVariables:os,allowLegacyFragmentVariables:os});if(!r||r.kind!=="Document")throw new Error("Not a valid GraphQL document.");Ko.set(e,ny(ry(r)))}return Ko.get(e)}function C(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];typeof t=="string"&&(t=[t]);var n=t[0];return e.forEach(function(i,a){i&&i.kind==="Document"?n+=i.loc.source.body:n+=i,n+=t[a+1]}),iy(n)}function ay(){Ko.clear(),Pu.clear()}function oy(){gh=!1}function sy(){os=!0}function cy(){os=!1}var Zi={gql:C,resetCaches:ay,disableFragmentWarnings:oy,enableExperimentalFragmentVariables:sy,disableExperimentalFragmentVariables:cy};(function(t){t.gql=Zi.gql,t.resetCaches=Zi.resetCaches,t.disableFragmentWarnings=Zi.disableFragmentWarnings,t.enableExperimentalFragmentVariables=Zi.enableExperimentalFragmentVariables,t.disableExperimentalFragmentVariables=Zi.disableExperimentalFragmentVariables})(C||(C={}));C.default=C;function T(t){if(!t)throw"Got no result from Apollo";if(t.error)throw t.error;if(t.errors)throw t.errors;return t.data}function uy(){}function nl(){return uy}var w=nl,He=nl,Z=nl,vh=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},bh=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},wn=class{constructor(e){this.code=e}};vh([w(),bh("design:type",String)],wn.prototype,"code",void 0);wn=vh([Z(),bh("design:paramtypes",[String])],wn);var il=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},al=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Ht=class{constructor(e,r){this.address=e,this.name=r}};il([w(),al("design:type",String)],Ht.prototype,"address",void 0);il([w(),al("design:type",String)],Ht.prototype,"name",void 0);Ht=il([Z(),al("design:paramtypes",[String,String])],Ht);var Se=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},$e=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Lr=class{constructor(e,r){this.key=r,this.signature=e}};Se([w(),$e("design:type",String)],Lr.prototype,"signature",void 0);Se([w(),$e("design:type",String)],Lr.prototype,"key",void 0);Se([w(),$e("design:type",Boolean)],Lr.prototype,"valid",void 0);Se([w(),$e("design:type",Boolean)],Lr.prototype,"invalid",void 0);Lr=Se([Z(),He(),$e("design:paramtypes",[String,String])],Lr);var Sn=class{};Se([w(),$e("design:type",String)],Sn.prototype,"signature",void 0);Se([w(),$e("design:type",String)],Sn.prototype,"key",void 0);Se([w(),$e("design:type",Boolean)],Sn.prototype,"valid",void 0);Se([w(),$e("design:type",Boolean)],Sn.prototype,"invalid",void 0);Sn=Se([He()],Sn);function Br(t){let e=class{constructor(n,i,a,o){this.author=n,this.timestamp=i,this.data=a,this.proof=o}};return Se([w(),$e("design:type",String)],e.prototype,"author",void 0),Se([w(),$e("design:type",String)],e.prototype,"timestamp",void 0),Se([w(),$e("design:type",Object)],e.prototype,"data",void 0),Se([w(),$e("design:type",Lr)],e.prototype,"proof",void 0),e=Se([Z(),$e("design:paramtypes",[String,String,Object,Lr])],e),e}function ly(t){let e=class{};return Se([w(),$e("design:type",String)],e.prototype,"author",void 0),Se([w(),$e("design:type",String)],e.prototype,"timestamp",void 0),Se([w(),$e("design:type",Object)],e.prototype,"data",void 0),Se([w(),$e("design:type",Sn)],e.prototype,"proof",void 0),e=Se([He()],e),e}var id=class extends Br(){};id=Se([Z()],id);var ss=class extends Br(){};Se([w(),$e("design:type",Ht)],ss.prototype,"language",void 0);Se([w(),$e("design:type",wn)],ss.prototype,"icon",void 0);ss=Se([Z()],ss);function p9(t){return t&&t.author&&t.timestamp&&t.data}var De=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},We=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Cn=class{constructor(e){this.source=e.source?e.source:"",this.target=e.target?e.target:"",this.predicate=e.predicate?e.predicate:""}};De([w(),We("design:type",String)],Cn.prototype,"source",void 0);De([w(),We("design:type",String)],Cn.prototype,"target",void 0);De([w(),We("design:type",String)],Cn.prototype,"predicate",void 0);Cn=De([Z(),We("design:paramtypes",[Object])],Cn);var cs=class{};De([w(),We("design:type",Array)],cs.prototype,"additions",void 0);De([w(),We("design:type",Array)],cs.prototype,"removals",void 0);cs=De([He()],cs);var us=class{constructor(e,r){this.additions=e,this.removals=r}};De([w(),We("design:type",Array)],us.prototype,"additions",void 0);De([w(),We("design:type",Array)],us.prototype,"removals",void 0);us=De([Z(),We("design:paramtypes",[Array,Array])],us);var Sa=class{};De([w(),We("design:type",String)],Sa.prototype,"source",void 0);De([w(),We("design:type",String)],Sa.prototype,"target",void 0);De([w(),We("design:type",String)],Sa.prototype,"predicate",void 0);Sa=De([He()],Sa);var En=class extends Br(){hash(){let e=JSON.stringify(this.data,Object.keys(this.data).sort())+JSON.stringify(this.author)+this.timestamp,r=0,n,i;for(n=0;n<e.length;n++)i=e.charCodeAt(n),r=(r<<5)-r+i,r|=0;return r}};De([w(),We("design:type",String)],En.prototype,"status",void 0);En=De([Z()],En);var Lu=class extends ly(){};De([w(),We("design:type",String)],Lu.prototype,"status",void 0);Lu=De([He()],Lu);function b9(t,e){return t.author==e.author&&t.timestamp==e.timestamp&&t.data.source==e.data.source&&t.data.predicate==e.data.predicate&&t.data.target==e.data.target}function _9(t){return t&&t.source&&t.target}var ls=class{constructor(e,r){this.oldLink=e,this.newLink=r}};De([w(),We("design:type",En)],ls.prototype,"oldLink",void 0);De([w(),We("design:type",En)],ls.prototype,"newLink",void 0);ls=De([Z(),We("design:paramtypes",[En,En])],ls);var On=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},Pa=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},$u,$r=class{constructor(e){e?this.links=e:this.links=[]}get(e){if(!e||!e.source&&!e.predicate&&!e.target)return this.links;if(e.source){let n=JSON.parse(JSON.stringify(this.links));return e.target&&(n=n.filter(i=>i.data.target===e.target)),e.predicate&&(n=n.filter(i=>i.data.predicate===e.predicate)),e.fromDate&&(n=n.filter(i=>new Date(i.timestamp)>=e.fromDate)),e.untilDate&&(n=n.filter(i=>new Date(i.timestamp)<=e.untilDate)),e.limit&&(n=n.slice(0,e.limit)),n}if(e.target){let n=JSON.parse(JSON.stringify(this.links));return e.predicate&&(n=n.filter(i=>i.data.predicate===e.predicate)),e.fromDate&&(n=n.filter(i=>new Date(i.timestamp)>=e.fromDate)),e.untilDate&&(n=n.filter(i=>new Date(i.timestamp)<=e.untilDate)),e.limit&&(n=n.slice(0,e.limit)),n}let r=JSON.parse(JSON.stringify(this.links));return r=r.filter(n=>n.data.predicate===e.predicate),e.limit&&(r=r.slice(0,e.limit)),r}getSingleTarget(e){delete e.target;let r=this.get(e);return r.length?r[0].data.target:null}};On([w(),Pa("design:type",Array)],$r.prototype,"links",void 0);$r=On([Z(),Pa("design:paramtypes",[Array])],$r);var Fu=class{};On([w(),Pa("design:type",Array)],Fu.prototype,"links",void 0);Fu=On([He()],Fu);var Mu=$u=class{constructor(e){e?this.links=e:this.links=[]}static fromLink(e){let r=new $u;return r.links.push(e),r}};On([w(),Pa("design:type",Array)],Mu.prototype,"links",void 0);Mu=$u=On([He(),Pa("design:paramtypes",[Array])],Mu);var Uu=class extends Br(){};Uu=On([Z()],Uu);var F=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},M=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Or=class{constructor(e,r){this.did=e,r?this.perspective=r:this.perspective=new $r}};F([w(),M("design:type",String)],Or.prototype,"did",void 0);F([w(),M("design:type",$r)],Or.prototype,"perspective",void 0);F([w(),M("design:type",String)],Or.prototype,"directMessageLanguage",void 0);Or=F([Z(),M("design:paramtypes",[String,$r])],Or);var ad=class extends Br(){};ad=F([Z()],ad);var Fr=class{constructor(e,r,n,i,a,o){this.did=e,this.didSigningKeyId=r,this.deviceKeyType=n,this.deviceKey=i,this.deviceKeySignedByDid=a,this.didSignedByDeviceKey=o}};F([w(),M("design:type",String)],Fr.prototype,"did",void 0);F([w(),M("design:type",String)],Fr.prototype,"didSigningKeyId",void 0);F([w(),M("design:type",String)],Fr.prototype,"deviceKeyType",void 0);F([w(),M("design:type",String)],Fr.prototype,"deviceKey",void 0);F([w(),M("design:type",String)],Fr.prototype,"deviceKeySignedByDid",void 0);F([w(),M("design:type",String)],Fr.prototype,"didSignedByDeviceKey",void 0);Fr=F([Z(),M("design:paramtypes",[String,String,String,String,String,String])],Fr);var Mr=class{constructor(e,r,n,i,a,o){this.did=e,this.didSigningKeyId=r,this.deviceKeyType=n,this.deviceKey=i,this.deviceKeySignedByDid=a,this.didSignedByDeviceKey=o}};F([w(),M("design:type",String)],Mr.prototype,"did",void 0);F([w(),M("design:type",String)],Mr.prototype,"didSigningKeyId",void 0);F([w(),M("design:type",String)],Mr.prototype,"deviceKeyType",void 0);F([w(),M("design:type",String)],Mr.prototype,"deviceKey",void 0);F([w(),M("design:type",String)],Mr.prototype,"deviceKeySignedByDid",void 0);F([w(),M("design:type",String)],Mr.prototype,"didSignedByDeviceKey",void 0);Mr=F([He(),M("design:paramtypes",[String,String,String,String,String,String])],Mr);var fs=class{constructor(e,r){this.signature=e,this.publicKey=r}};F([w(),M("design:type",String)],fs.prototype,"signature",void 0);F([w(),M("design:type",String)],fs.prototype,"publicKey",void 0);fs=F([Z(),M("design:paramtypes",[String,String])],fs);var fi=class{constructor(e,r){this.domain=e,this.pointers=r}};F([w(),M("design:type",String)],fi.prototype,"domain",void 0);F([w(),M("design:type",Array)],fi.prototype,"pointers",void 0);fi=F([Z(),M("design:paramtypes",[String,Array])],fi);var ps=class{constructor(e,r){this.with=e,this.can=r}};F([w(),M("design:type",fi)],ps.prototype,"with",void 0);F([w(),M("design:type",Array)],ps.prototype,"can",void 0);ps=F([Z(),M("design:paramtypes",[fi,Array])],ps);var lr=class{constructor(e,r,n,i,a){this.appName=e,this.appDesc=r,this.appIconPath=a,this.appUrl=n,this.capabilities=i}};F([w(),M("design:type",String)],lr.prototype,"appName",void 0);F([w(),M("design:type",String)],lr.prototype,"appDesc",void 0);F([w(),M("design:type",String)],lr.prototype,"appUrl",void 0);F([w(),M("design:type",String)],lr.prototype,"appIconPath",void 0);F([w(),M("design:type",Array)],lr.prototype,"capabilities",void 0);lr=F([Z(),M("design:paramtypes",[String,String,String,Array,String])],lr);var pi=class{constructor(e,r,n,i){this.requestId=e,this.auth=r,this.token=n,this.revoked=i}};F([w(),M("design:type",String)],pi.prototype,"requestId",void 0);F([w(),M("design:type",String)],pi.prototype,"token",void 0);F([w(),M("design:type",Boolean)],pi.prototype,"revoked",void 0);F([w(),M("design:type",lr)],pi.prototype,"auth",void 0);pi=F([Z(),M("design:paramtypes",[String,lr,String,Boolean])],pi);var di=class{constructor(e,r){this.domain=e,this.pointers=r}};F([w(),M("design:type",String)],di.prototype,"domain",void 0);F([w(),M("design:type",Array)],di.prototype,"pointers",void 0);di=F([He(),M("design:paramtypes",[String,Array])],di);var ds=class{constructor(e,r){this.with=e,this.can=r}};F([w(),M("design:type",di)],ds.prototype,"with",void 0);F([w(),M("design:type",Array)],ds.prototype,"can",void 0);ds=F([He(),M("design:paramtypes",[di,Array])],ds);var Ur=class{constructor(e,r,n,i,a,o){this.appName=e,this.appDesc=r,this.appUrl=i,this.appDomain=n,this.capabilities=o,this.appIconPath=a}};F([w(),M("design:type",String)],Ur.prototype,"appName",void 0);F([w(),M("design:type",String)],Ur.prototype,"appDesc",void 0);F([w(),M("design:type",String)],Ur.prototype,"appDomain",void 0);F([w(),M("design:type",String)],Ur.prototype,"appUrl",void 0);F([w(),M("design:type",String)],Ur.prototype,"appIconPath",void 0);F([w(),M("design:type",Array)],Ur.prototype,"capabilities",void 0);Ur=F([He(),M("design:paramtypes",[String,String,String,String,String,Array])],Ur);var yi=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},vi=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Et=class{constructor(e){e?(this.isInitialized=e.isInitialized,this.isInitialized||(this.isInitialized=!1),this.isUnlocked=e.isUnlocked,this.isUnlocked||(this.isUnlocked=!1),this.did=e.did,this.didDocument=e.didDocument,this.error=e.error):(this.isInitialized=!1,this.isUnlocked=!1)}};yi([w(),vi("design:type",Boolean)],Et.prototype,"isInitialized",void 0);yi([w(),vi("design:type",Boolean)],Et.prototype,"isUnlocked",void 0);yi([w(),vi("design:type",String)],Et.prototype,"did",void 0);yi([w(),vi("design:type",String)],Et.prototype,"didDocument",void 0);yi([w(),vi("design:type",String)],Et.prototype,"error",void 0);Et=yi([Z(),vi("design:paramtypes",[Object])],Et);var od=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Ae=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},st,ct,ju=class{constructor(e,r){st.set(this,void 0),ct.set(this,void 0),od(this,st,e,"f"),od(this,ct,r,"f")}async otherAgents(){return await Ae(this,st,"f").otherAgents(Ae(this,ct,"f"))}async hasTelepresenceAdapter(){return await Ae(this,st,"f").hasTelepresenceAdapter(Ae(this,ct,"f"))}async onlineAgents(){return await Ae(this,st,"f").onlineAgents(Ae(this,ct,"f"))}async setOnlineStatus(e){return await Ae(this,st,"f").setOnlineStatus(Ae(this,ct,"f"),e)}async setOnlineStatusU(e){return await Ae(this,st,"f").setOnlineStatusU(Ae(this,ct,"f"),e)}async sendSignal(e,r){return await Ae(this,st,"f").sendSignal(Ae(this,ct,"f"),e,r)}async sendSignalU(e,r){return await Ae(this,st,"f").sendSignalU(Ae(this,ct,"f"),e,r)}async sendBroadcast(e){return await Ae(this,st,"f").sendBroadcast(Ae(this,ct,"f"),e)}async sendBroadcastU(e){return await Ae(this,st,"f").sendBroadcastU(Ae(this,ct,"f"),e)}async addSignalHandler(e){await Ae(this,st,"f").addSignalHandler(Ae(this,ct,"f"),e)}removeSignalHandler(e){Ae(this,st,"f").removeSignalHandler(Ae(this,ct,"f"),e)}};st=new WeakMap,ct=new WeakMap;var Dn=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},Nn=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},vt=class{constructor(e){e&&(this.source=e.source,this.predicate=e.predicate,this.target=e.target,e.fromDate&&(this.fromDate=e.fromDate),e.untilDate&&(this.untilDate=e.untilDate),e.limit&&(this.limit=e.limit))}isMatch(e){return!(this.source&&this.source!==e.source||this.predicate&&this.predicate!==e.predicate||this.target&&this.target!==e.target)}};Dn([w(),Nn("design:type",String)],vt.prototype,"source",void 0);Dn([w(),Nn("design:type",String)],vt.prototype,"target",void 0);Dn([w(),Nn("design:type",String)],vt.prototype,"predicate",void 0);Dn([w(),Nn("design:type",Date)],vt.prototype,"fromDate",void 0);Dn([w(),Nn("design:type",Date)],vt.prototype,"untilDate",void 0);Dn([w(),Nn("design:type",Number)],vt.prototype,"limit",void 0);vt=Dn([Z(),He(),Nn("design:paramtypes",[Object])],vt);var sd=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},ot=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Nt,ar;function hu(t){return encodeURIComponent(t).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`)}var Lt=class{constructor(){Nt.set(this,void 0),ar.set(this,void 0)}static fromUrl(e){if(!e||!e.startsWith("literal://"))throw new Error("Can't create Literal from non-literal URL");let r=new Lt;return sd(r,ar,e,"f"),r}static from(e){let r=new Lt;return sd(r,Nt,e,"f"),r}toUrl(){if(ot(this,ar,"f")&&!ot(this,Nt,"f"))return ot(this,ar,"f");if(!ot(this,ar,"f")&&!ot(this,Nt,"f"))throw new Error("Can't turn empty Literal into URL");let e;switch(typeof ot(this,Nt,"f")){case"string":e=`string:${hu(ot(this,Nt,"f"))}`;break;case"number":e=`number:${hu(ot(this,Nt,"f"))}`;break;case"object":e=`json:${hu(JSON.stringify(ot(this,Nt,"f")))}`;break}return`literal://${e}`}get(){if(ot(this,Nt,"f"))return ot(this,Nt,"f");if(!ot(this,ar,"f"))throw new Error("Can't render empty Literal");if(!ot(this,ar,"f").startsWith("literal://"))throw new Error("Can't render Literal from non-literal URL");let e=ot(this,ar,"f").substring(10);if(e.startsWith("string:"))return decodeURIComponent(e.substring(7));if(e.startsWith("number:")){let r=e.substring(7);return parseFloat(r)}if(e.startsWith("json:")){let r=e.substring(5);return JSON.parse(decodeURIComponent(r))}throw new Error(`Can't parse unknown literal: ${e}`)}};Nt=new WeakMap,ar=new WeakMap;function Dr(t){return t.charAt(0).toUpperCase()+t.slice(1)}function _h(t){return`set${Dr(t)}`}function ur(t){return t.endsWith("y")?t.slice(0,-1)+"ies":t+"s"}function ol(t){return t.endsWith("ies")?t.slice(0,-3)+"y":t.endsWith("s")?t.slice(0,-1):t}function fy(t){return`add${Dr(ol(t))}`}function py(t){let e=t.substring(3),r=ur(e);return r.charAt(0).toLowerCase()+r.slice(1)}function dy(t){return`remove${Dr(ol(t))}`}function hy(t){let e=t.substring(6),r=ur(e);return r.charAt(0).toLowerCase()+r.slice(1)}function my(t){let e=t.substring(13),r=ur(e);return r.charAt(0).toLowerCase()+r.slice(1)}function gy(t){return`setCollection${Dr(ol(t))}`}function un(t){if(Array.isArray(t))return`[${t.map(un).join(", ")}]`;let e=Object.keys(t),r=[];for(let n of e){let i=JSON.stringify(t[n]),a=`${n}: ${i}`;r.push(a)}return`{${r.join(", ")}}`}var mu=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},z=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Je,Xe,Ee,hs=class{constructor(t,e,r){Je.set(this,void 0),Xe.set(this,void 0),Ee.set(this,void 0),mu(this,Je,e,"f"),mu(this,Xe,r,"f"),mu(this,Ee,t,"f")}get baseExpression(){return z(this,Je,"f")}async init(){let isInstance=await z(this,Ee,"f").isSubjectInstance(z(this,Je,"f"),z(this,Xe,"f"));if(!isInstance)throw`Not a valid subject instance of ${z(this,Xe,"f")} for ${z(this,Je,"f")}`;let results=await z(this,Ee,"f").infer(`subject_class("${z(this,Xe,"f")}", C), property(C, Property)`),properties=results.map(t=>t.Property);for(let t of properties){let e=await z(this,Ee,"f").infer(`subject_class("${z(this,Xe,"f")}", C), property_resolve(C, "${t}")`);Object.defineProperty(this,t,{configurable:!0,get:async()=>{let r=await z(this,Ee,"f").infer(`subject_class("${z(this,Xe,"f")}", C), property_getter(C, "${z(this,Je,"f")}", "${t}", Value)`);if(r&&r.length>0){let n=r[0].Value;if(e)try{if(n){let i=await z(this,Ee,"f").getExpression(n);try{return JSON.parse(i.data)}catch{return i.data}}else return n}catch{return n}else return n}else return r||void 0}})}let setters=await z(this,Ee,"f").infer(`subject_class("${z(this,Xe,"f")}", C), property_setter(C, Property, Setter)`);for(let setter of setters||[])if(setter){let property=setter.Property,actions=eval(setter.Setter),resolveLanguageResults=await z(this,Ee,"f").infer(`subject_class("${z(this,Xe,"f")}", C), property_resolve_language(C, "${property}", Language)`),resolveLanguage;resolveLanguageResults&&resolveLanguageResults.length>0&&(resolveLanguage=resolveLanguageResults[0].Language),this[_h(property)]=async t=>{resolveLanguage&&(t=await z(this,Ee,"f").createExpression(t,resolveLanguage)),await z(this,Ee,"f").executeAction(actions,z(this,Je,"f"),[{name:"value",value:t}])}}let results2=await z(this,Ee,"f").infer(`subject_class("${z(this,Xe,"f")}", C), collection(C, Collection)`);results2||(results2=[]);let collections=results2.map(t=>t.Collection);for(let t of collections)Object.defineProperty(this,t,{configurable:!0,get:async()=>{let e=await z(this,Ee,"f").infer(`subject_class("${z(this,Xe,"f")}", C), collection_getter(C, "${z(this,Je,"f")}", "${t}", Value)`);return e&&e.length>0&&e[0].Value?e[0].Value.filter(n=>n!==""&&n!==""):[]}});let adders=await z(this,Ee,"f").infer(`subject_class("${z(this,Xe,"f")}", C), collection_adder(C, Collection, Adder)`);adders||(adders=[]);for(let adder of adders)if(adder){let collection=adder.Collection,actions=eval(adder.Adder);this[fy(collection)]=async t=>{Array.isArray(t)?await Promise.all(t.map(e=>z(this,Ee,"f").executeAction(actions,z(this,Je,"f"),[{name:"value",value:e}]))):await z(this,Ee,"f").executeAction(actions,z(this,Je,"f"),[{name:"value",value:t}])}}let removers=await z(this,Ee,"f").infer(`subject_class("${z(this,Xe,"f")}", C), collection_remover(C, Collection, Remover)`);removers||(removers=[]);for(let remover of removers)if(remover){let collection=remover.Collection,actions=eval(remover.Remover);this[dy(collection)]=async t=>{Array.isArray(t)?await Promise.all(t.map(e=>z(this,Ee,"f").executeAction(actions,z(this,Je,"f"),[{name:"value",value:e}]))):await z(this,Ee,"f").executeAction(actions,z(this,Je,"f"),[{name:"value",value:t}])}}let collectionSetters=await z(this,Ee,"f").infer(`subject_class("${z(this,Xe,"f")}", C), collection_setter(C, Collection, Setter)`);collectionSetters||(collectionSetters=[]);for(let collectionSetter of collectionSetters)if(collectionSetter){let collection=collectionSetter.Collection,actions=eval(collectionSetter.Setter);this[gy(collection)]=async t=>{Array.isArray(t)?await z(this,Ee,"f").executeAction(actions,z(this,Je,"f"),t.map(e=>({name:"value",value:e}))):await z(this,Ee,"f").executeAction(actions,z(this,Je,"f"),[{name:"value",value:t}])}}}};Je=new WeakMap,Xe=new WeakMap,Ee=new WeakMap;var ri=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},$=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},le,me,ln,fn,pn,ea,ui=class{constructor(t,e){le.set(this,void 0),me.set(this,void 0),ln.set(this,void 0),fn.set(this,void 0),pn.set(this,void 0),ea.set(this,void 0),ri(this,ln,[],"f"),ri(this,fn,[],"f"),ri(this,pn,[],"f"),ri(this,ea,[],"f"),ri(this,le,t,"f"),ri(this,me,e,"f"),this.uuid=$(this,le,"f").uuid,this.name=$(this,le,"f").name,this.sharedUrl=$(this,le,"f").sharedUrl,this.neighbourhood=$(this,le,"f").neighbourhood,this.state=$(this,le,"f").state,$(this,me,"f").addPerspectiveLinkAddedListener($(this,le,"f").uuid,$(this,ln,"f")),$(this,me,"f").addPerspectiveLinkRemovedListener($(this,le,"f").uuid,$(this,fn,"f")),$(this,me,"f").addPerspectiveLinkUpdatedListener($(this,le,"f").uuid,$(this,pn,"f")),$(this,me,"f").addPerspectiveSyncStateChangeListener($(this,le,"f").uuid,$(this,ea,"f"))}async executeAction(t,e,r){return await $(this,me,"f").executeCommands($(this,le,"f").uuid,JSON.stringify(t),e,JSON.stringify(r))}async get(t){return await $(this,me,"f").queryLinks($(this,le,"f").uuid,t)}async infer(t){return await $(this,me,"f").queryProlog($(this,le,"f").uuid,t)}async add(t,e="shared"){return await $(this,me,"f").addLink($(this,le,"f").uuid,t,e)}async addLinks(t,e="shared"){return await $(this,me,"f").addLinks($(this,le,"f").uuid,t,e)}async removeLinks(t){return await $(this,me,"f").removeLinks($(this,le,"f").uuid,t)}async linkMutations(t,e="shared"){return await $(this,me,"f").linkMutations($(this,le,"f").uuid,t,e)}async addLinkExpression(t,e="shared"){return await $(this,me,"f").addLinkExpression($(this,le,"f").uuid,t,e)}async update(t,e){return await $(this,me,"f").updateLink($(this,le,"f").uuid,t,e)}async remove(t){return await $(this,me,"f").removeLink($(this,le,"f").uuid,t)}async getExpression(t){return await $(this,me,"f").getExpression(t)}async createExpression(t,e){return await $(this,me,"f").createExpression(t,e)}async addListener(t,e){t==="link-added"?$(this,ln,"f").push(e):t==="link-removed"?$(this,fn,"f").push(e):t==="link-updated"&&$(this,pn,"f").push(e)}async addSyncStateChangeListener(t){$(this,ea,"f").push(t)}async removeListener(t,e){if(t==="link-added"){let r=$(this,ln,"f").indexOf(e);$(this,ln,"f").splice(r,1)}else if(t==="link-removed"){let r=$(this,fn,"f").indexOf(e);$(this,fn,"f").splice(r,1)}else if(t==="link-updated"){let r=$(this,pn,"f").indexOf(e);$(this,pn,"f").splice(r,1)}}async snapshot(){return $(this,me,"f").snapshotByUUID($(this,le,"f").uuid)}async loadSnapshot(t){let e=JSON.parse(JSON.stringify(t));delete e.__typename,e.links.forEach(r=>{delete r.data.__typename});for(let r of e.links)await this.addLinkExpression(r)}async getSingleTarget(t){delete t.target;let e=await this.get(t);return e.length?e[0].data.target:null}async setSingleTarget(t,e="shared"){let r=new vt({source:t.source,predicate:t.predicate}),n=await this.get(r),i=[];for(let o of n)delete o.__typename,delete o.data.__typename,delete o.proof.__typename,i.push(o);let a=[t];await this.linkMutations({additions:a,removals:i},e)}async sdnaFlows(){return(await this.infer("register_sdna_flow(X, _)")).map(e=>e.X)}async availableFlows(t){return(await this.infer(`flowable("${t}", F), register_sdna_flow(X, F)`)).map(r=>r.X)}async startFlow(flowName,exprAddr){let startAction=await this.infer(`start_action(Action, F), register_sdna_flow("${flowName}", F)`);startAction=eval(startAction[0].Action),await this.executeAction(startAction,exprAddr,void 0)}async expressionsInFlowState(t,e){return(await this.infer(`register_sdna_flow("${t}", F), flow_state(X, ${e}, F)`)).map(n=>n.X)}async flowState(t,e){return(await this.infer(`register_sdna_flow("${t}", F), flow_state("${e}", X, F)`))[0].X}async flowActions(t,e){return(await this.infer(`register_sdna_flow("${t}", Flow), flow_state("${e}", State, Flow), action(State, Name, _, _)`)).map(n=>n.Name)}async runFlowAction(flowName,exprAddr,actionName){let action=await this.infer(`register_sdna_flow("${flowName}", Flow), flow_state("${exprAddr}", State, Flow), action(State, "${actionName}", _, Action)`);action=eval(action[0].Action),await this.executeAction(action,exprAddr,void 0)}async getSdna(){return(await this.get(new vt({predicate:"ad4m://sdna"}))).map(e=>e.data.target).map(e=>Lt.fromUrl(e).get())}async addSdna(t,e,r){return $(this,me,"f").addSdna($(this,le,"f").uuid,t,e,r)}async subjectClasses(){try{return(await this.infer("subject_class(X, _)")).map(t=>t.X)}catch{return[]}}async stringOrTemplateObjectToSubjectClass(t){if(typeof t=="string")return t;{let e=await this.subjectClassesByTemplate(t);return e[0]?e[0]:t.className}}async createSubject(t,e){let r;if(typeof t=="string")r=t,await $(this,me,"f").createSubject($(this,le,"f").uuid,JSON.stringify({className:r}),e);else{let n=this.buildQueryFromTemplate(t);await $(this,me,"f").createSubject($(this,le,"f").uuid,JSON.stringify({query:n}),e)}return this.getSubjectProxy(e,t)}async getSubjectData(t,e){if(typeof t=="string")return JSON.parse(await $(this,me,"f").getSubjectData($(this,le,"f").uuid,JSON.stringify({className:t}),e));let r=this.buildQueryFromTemplate(t);return JSON.parse(await $(this,me,"f").getSubjectData($(this,le,"f").uuid,JSON.stringify({query:r}),e))}async removeSubject(subjectClass,exprAddr){let className=await this.stringOrTemplateObjectToSubjectClass(subjectClass),result=await this.infer(`subject_class("${className}", C), destructor(C, Actions)`);if(!result.length)throw"No constructor found for given subject class: "+className;let actions=result.map(x=>eval(x.Actions));await this.executeAction(actions[0],exprAddr,void 0)}async isSubjectInstance(t,e){let r=await this.stringOrTemplateObjectToSubjectClass(e),n=!1,i=5,a=0;for(;a<i&&!n;)n=await this.infer(`subject_class("${r}", C), instance(C, "${t}")`),a++;return n}async getSubjectProxy(t,e){if(!await this.isSubjectInstance(t,e))throw`Expression ${t} is not a subject instance of given class: ${JSON.stringify(e)}`;let r=await this.stringOrTemplateObjectToSubjectClass(e),n=new hs(this,t,r);return await n.init(),n}async getAllSubjectInstances(t){let e=[];typeof t=="string"?e=[t]:e=await this.subjectClassesByTemplate(t);let r=[];for(let n of e){let i=await this.infer(`subject_class("${n}", C), instance(C, X)`),a=await Promise.all(i.map(async o=>await this.getSubjectProxy(o.X,n)));r=r.concat(a)}return r}async getAllSubjectProxies(t){let e=[];typeof t=="string"?e=[t]:e=await this.subjectClassesByTemplate(t);let r=[];for(let n of e)r=await this.infer(`subject_class("${n}", C), instance(C, X)`);return r}buildQueryFromTemplate(t){let e;return function(r){let n=[],i=[];Object.getPrototypeOf(r).__properties?Object.keys(Object.getPrototypeOf(r).__properties).forEach(l=>n.push(l)):n.push(...Object.keys(r).filter(l=>!Array.isArray(r[l]))),Object.getPrototypeOf(r).__collections?Object.keys(Object.getPrototypeOf(r).__collections).filter(l=>l!=="isSubjectInstance").forEach(l=>!i.includes(l)):i.push(...Object.keys(r).filter(l=>Array.isArray(r[l])).filter(l=>l!=="isSubjectInstance"));let a=Object.getOwnPropertyNames(r).filter(l=>typeof r[l]=="function"&&l.startsWith("set")&&!l.startsWith("setCollection"));a=a.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(r)).filter(l=>{let d=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(r),l);return d&&typeof d.value=="function"&&l.startsWith("set")&&!l.startsWith("setCollection")}));let o=Object.getOwnPropertyNames(r).filter(l=>Object.prototype.hasOwnProperty.call(r,l)&&typeof r[l]=="function"&&l.startsWith("add"));o=o.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(r)).filter(l=>{let d=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(r),l);return d&&typeof d.value=="function"&&l.startsWith("add")}));let s=Object.getOwnPropertyNames(r).filter(l=>Object.prototype.hasOwnProperty.call(r,l)&&typeof r[l]=="function"&&l.startsWith("remove"));s=s.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(r)).filter(l=>{let d=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(r),l);return d&&typeof d.value=="function"&&l.startsWith("remove")}));let u=Object.getOwnPropertyNames(r).filter(l=>Object.prototype.hasOwnProperty.call(r,l)&&typeof r[l]=="function"&&l.startsWith("setCollection"));u=u.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(r)).filter(l=>{let d=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(r),l);return d&&typeof d.value=="function"&&l.startsWith("setCollection")}));let c="subject_class(Class, C)";for(let l of n)c+=`, property(C, "${l}")`;for(let l of i)c+=`, collection(C, "${l}")`;for(let l of a){let d=l.substring(3);d=d.charAt(0).toLowerCase()+d.slice(1),c+=`, property_setter(C, "${d}", _)`}for(let l of o)c+=`, collection_adder(C, "${py(l)}", _)`;for(let l of s)c+=`, collection_remover(C, "${hy(l)}", _)`;for(let l of u)c+=`, collection_setter(C, "${my(l)}", _)`;c+=".",e=c}(t),e}async subjectClassesByTemplate(t){let e=this.buildQueryFromTemplate(t),r=await this.infer(e);return r?r.map(n=>n.Class):[]}async ensureSDNASubjectClass(t){if((await this.subjectClassesByTemplate(new t)).length>0)return;let{name:r,sdna:n}=t.generateSDNA();await this.addSdna(r,n,"subject_class")}getNeighbourhoodProxy(){return $(this,me,"f").getNeighbourhoodProxy($(this,le,"f").uuid)}get ai(){return $(this,me,"f").aiClient}};le=new WeakMap,me=new WeakMap,ln=new WeakMap,fn=new WeakMap,pn=new WeakMap,ea=new WeakMap;var xr=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},G=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},se,ta,ra,na,Zo,ia,Yo,Jo,ht=`
|
|
63
|
+
this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`):o||$u.set(i,o=new Set),o.add(a),e.has(a)||(e.add(a),r.push(n))}else r.push(n)}),os(os({},t),{definitions:r})}function iy(t){var e=new Set(t.definitions);e.forEach(function(n){n.loc&&delete n.loc,Object.keys(n).forEach(function(i){var a=n[i];a&&typeof a=="object"&&e.add(a)})});var r=t.loc;return r&&(delete r.startToken,delete r.endToken),t}function ay(t){var e=vh(t);if(!Zo.has(e)){var r=ey(t,{experimentalFragmentVariables:ss,allowLegacyFragmentVariables:ss});if(!r||r.kind!=="Document")throw new Error("Not a valid GraphQL document.");Zo.set(e,iy(ny(r)))}return Zo.get(e)}function C(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];typeof t=="string"&&(t=[t]);var n=t[0];return e.forEach(function(i,a){i&&i.kind==="Document"?n+=i.loc.source.body:n+=i,n+=t[a+1]}),ay(n)}function oy(){Zo.clear(),$u.clear()}function sy(){yh=!1}function cy(){ss=!0}function uy(){ss=!1}var Yi={gql:C,resetCaches:oy,disableFragmentWarnings:sy,enableExperimentalFragmentVariables:cy,disableExperimentalFragmentVariables:uy};(function(t){t.gql=Yi.gql,t.resetCaches=Yi.resetCaches,t.disableFragmentWarnings=Yi.disableFragmentWarnings,t.enableExperimentalFragmentVariables=Yi.enableExperimentalFragmentVariables,t.disableExperimentalFragmentVariables=Yi.disableExperimentalFragmentVariables})(C||(C={}));C.default=C;function T(t){if(!t)throw"Got no result from Apollo";if(t.error)throw t.error;if(t.errors)throw t.errors;return t.data}function ly(){}function al(){return ly}var w=al,He=al,Z=al,bh=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},_h=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Sn=class{constructor(e){this.code=e}};bh([w(),_h("design:type",String)],Sn.prototype,"code",void 0);Sn=bh([Z(),_h("design:paramtypes",[String])],Sn);var ol=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},sl=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Ht=class{constructor(e,r){this.address=e,this.name=r}};ol([w(),sl("design:type",String)],Ht.prototype,"address",void 0);ol([w(),sl("design:type",String)],Ht.prototype,"name",void 0);Ht=ol([Z(),sl("design:paramtypes",[String,String])],Ht);var Se=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},$e=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},$r=class{constructor(e,r){this.key=r,this.signature=e}};Se([w(),$e("design:type",String)],$r.prototype,"signature",void 0);Se([w(),$e("design:type",String)],$r.prototype,"key",void 0);Se([w(),$e("design:type",Boolean)],$r.prototype,"valid",void 0);Se([w(),$e("design:type",Boolean)],$r.prototype,"invalid",void 0);$r=Se([Z(),He(),$e("design:paramtypes",[String,String])],$r);var Cn=class{};Se([w(),$e("design:type",String)],Cn.prototype,"signature",void 0);Se([w(),$e("design:type",String)],Cn.prototype,"key",void 0);Se([w(),$e("design:type",Boolean)],Cn.prototype,"valid",void 0);Se([w(),$e("design:type",Boolean)],Cn.prototype,"invalid",void 0);Cn=Se([He()],Cn);function Vr(t){let e=class{constructor(n,i,a,o){this.author=n,this.timestamp=i,this.data=a,this.proof=o}};return Se([w(),$e("design:type",String)],e.prototype,"author",void 0),Se([w(),$e("design:type",String)],e.prototype,"timestamp",void 0),Se([w(),$e("design:type",Object)],e.prototype,"data",void 0),Se([w(),$e("design:type",$r)],e.prototype,"proof",void 0),e=Se([Z(),$e("design:paramtypes",[String,String,Object,$r])],e),e}function fy(t){let e=class{};return Se([w(),$e("design:type",String)],e.prototype,"author",void 0),Se([w(),$e("design:type",String)],e.prototype,"timestamp",void 0),Se([w(),$e("design:type",Object)],e.prototype,"data",void 0),Se([w(),$e("design:type",Cn)],e.prototype,"proof",void 0),e=Se([He()],e),e}var ad=class extends Vr(){};ad=Se([Z()],ad);var cs=class extends Vr(){};Se([w(),$e("design:type",Ht)],cs.prototype,"language",void 0);Se([w(),$e("design:type",Sn)],cs.prototype,"icon",void 0);cs=Se([Z()],cs);function d9(t){return t&&t.author&&t.timestamp&&t.data}var De=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},We=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},En=class{constructor(e){this.source=e.source?e.source:"",this.target=e.target?e.target:"",this.predicate=e.predicate?e.predicate:""}};De([w(),We("design:type",String)],En.prototype,"source",void 0);De([w(),We("design:type",String)],En.prototype,"target",void 0);De([w(),We("design:type",String)],En.prototype,"predicate",void 0);En=De([Z(),We("design:paramtypes",[Object])],En);var us=class{};De([w(),We("design:type",Array)],us.prototype,"additions",void 0);De([w(),We("design:type",Array)],us.prototype,"removals",void 0);us=De([He()],us);var ls=class{constructor(e,r){this.additions=e,this.removals=r}};De([w(),We("design:type",Array)],ls.prototype,"additions",void 0);De([w(),We("design:type",Array)],ls.prototype,"removals",void 0);ls=De([Z(),We("design:paramtypes",[Array,Array])],ls);var Ca=class{};De([w(),We("design:type",String)],Ca.prototype,"source",void 0);De([w(),We("design:type",String)],Ca.prototype,"target",void 0);De([w(),We("design:type",String)],Ca.prototype,"predicate",void 0);Ca=De([He()],Ca);var xn=class extends Vr(){hash(){let e=JSON.stringify(this.data,Object.keys(this.data).sort())+JSON.stringify(this.author)+this.timestamp,r=0,n,i;for(n=0;n<e.length;n++)i=e.charCodeAt(n),r=(r<<5)-r+i,r|=0;return r}};De([w(),We("design:type",String)],xn.prototype,"status",void 0);xn=De([Z()],xn);var Fu=class extends fy(){};De([w(),We("design:type",String)],Fu.prototype,"status",void 0);Fu=De([He()],Fu);function _9(t,e){return t.author==e.author&&t.timestamp==e.timestamp&&t.data.source==e.data.source&&t.data.predicate==e.data.predicate&&t.data.target==e.data.target}function w9(t){return t&&t.source&&t.target}var fs=class{constructor(e,r){this.oldLink=e,this.newLink=r}};De([w(),We("design:type",xn)],fs.prototype,"oldLink",void 0);De([w(),We("design:type",xn)],fs.prototype,"newLink",void 0);fs=De([Z(),We("design:paramtypes",[xn,xn])],fs);var Dn=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},La=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Mu,Fr=class{constructor(e){e?this.links=e:this.links=[]}get(e){if(!e||!e.source&&!e.predicate&&!e.target)return this.links;if(e.source){let n=JSON.parse(JSON.stringify(this.links));return e.target&&(n=n.filter(i=>i.data.target===e.target)),e.predicate&&(n=n.filter(i=>i.data.predicate===e.predicate)),e.fromDate&&(n=n.filter(i=>new Date(i.timestamp)>=e.fromDate)),e.untilDate&&(n=n.filter(i=>new Date(i.timestamp)<=e.untilDate)),e.limit&&(n=n.slice(0,e.limit)),n}if(e.target){let n=JSON.parse(JSON.stringify(this.links));return e.predicate&&(n=n.filter(i=>i.data.predicate===e.predicate)),e.fromDate&&(n=n.filter(i=>new Date(i.timestamp)>=e.fromDate)),e.untilDate&&(n=n.filter(i=>new Date(i.timestamp)<=e.untilDate)),e.limit&&(n=n.slice(0,e.limit)),n}let r=JSON.parse(JSON.stringify(this.links));return r=r.filter(n=>n.data.predicate===e.predicate),e.limit&&(r=r.slice(0,e.limit)),r}getSingleTarget(e){delete e.target;let r=this.get(e);return r.length?r[0].data.target:null}};Dn([w(),La("design:type",Array)],Fr.prototype,"links",void 0);Fr=Dn([Z(),La("design:paramtypes",[Array])],Fr);var Uu=class{};Dn([w(),La("design:type",Array)],Uu.prototype,"links",void 0);Uu=Dn([He()],Uu);var ju=Mu=class{constructor(e){e?this.links=e:this.links=[]}static fromLink(e){let r=new Mu;return r.links.push(e),r}};Dn([w(),La("design:type",Array)],ju.prototype,"links",void 0);ju=Mu=Dn([He(),La("design:paramtypes",[Array])],ju);var qu=class extends Vr(){};qu=Dn([Z()],qu);var F=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},M=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Dr=class{constructor(e,r){this.did=e,r?this.perspective=r:this.perspective=new Fr}};F([w(),M("design:type",String)],Dr.prototype,"did",void 0);F([w(),M("design:type",Fr)],Dr.prototype,"perspective",void 0);F([w(),M("design:type",String)],Dr.prototype,"directMessageLanguage",void 0);Dr=F([Z(),M("design:paramtypes",[String,Fr])],Dr);var od=class extends Vr(){};od=F([Z()],od);var Mr=class{constructor(e,r,n,i,a,o){this.did=e,this.didSigningKeyId=r,this.deviceKeyType=n,this.deviceKey=i,this.deviceKeySignedByDid=a,this.didSignedByDeviceKey=o}};F([w(),M("design:type",String)],Mr.prototype,"did",void 0);F([w(),M("design:type",String)],Mr.prototype,"didSigningKeyId",void 0);F([w(),M("design:type",String)],Mr.prototype,"deviceKeyType",void 0);F([w(),M("design:type",String)],Mr.prototype,"deviceKey",void 0);F([w(),M("design:type",String)],Mr.prototype,"deviceKeySignedByDid",void 0);F([w(),M("design:type",String)],Mr.prototype,"didSignedByDeviceKey",void 0);Mr=F([Z(),M("design:paramtypes",[String,String,String,String,String,String])],Mr);var Ur=class{constructor(e,r,n,i,a,o){this.did=e,this.didSigningKeyId=r,this.deviceKeyType=n,this.deviceKey=i,this.deviceKeySignedByDid=a,this.didSignedByDeviceKey=o}};F([w(),M("design:type",String)],Ur.prototype,"did",void 0);F([w(),M("design:type",String)],Ur.prototype,"didSigningKeyId",void 0);F([w(),M("design:type",String)],Ur.prototype,"deviceKeyType",void 0);F([w(),M("design:type",String)],Ur.prototype,"deviceKey",void 0);F([w(),M("design:type",String)],Ur.prototype,"deviceKeySignedByDid",void 0);F([w(),M("design:type",String)],Ur.prototype,"didSignedByDeviceKey",void 0);Ur=F([He(),M("design:paramtypes",[String,String,String,String,String,String])],Ur);var ps=class{constructor(e,r){this.signature=e,this.publicKey=r}};F([w(),M("design:type",String)],ps.prototype,"signature",void 0);F([w(),M("design:type",String)],ps.prototype,"publicKey",void 0);ps=F([Z(),M("design:paramtypes",[String,String])],ps);var pi=class{constructor(e,r){this.domain=e,this.pointers=r}};F([w(),M("design:type",String)],pi.prototype,"domain",void 0);F([w(),M("design:type",Array)],pi.prototype,"pointers",void 0);pi=F([Z(),M("design:paramtypes",[String,Array])],pi);var ds=class{constructor(e,r){this.with=e,this.can=r}};F([w(),M("design:type",pi)],ds.prototype,"with",void 0);F([w(),M("design:type",Array)],ds.prototype,"can",void 0);ds=F([Z(),M("design:paramtypes",[pi,Array])],ds);var lr=class{constructor(e,r,n,i,a){this.appName=e,this.appDesc=r,this.appIconPath=a,this.appUrl=n,this.capabilities=i}};F([w(),M("design:type",String)],lr.prototype,"appName",void 0);F([w(),M("design:type",String)],lr.prototype,"appDesc",void 0);F([w(),M("design:type",String)],lr.prototype,"appUrl",void 0);F([w(),M("design:type",String)],lr.prototype,"appIconPath",void 0);F([w(),M("design:type",Array)],lr.prototype,"capabilities",void 0);lr=F([Z(),M("design:paramtypes",[String,String,String,Array,String])],lr);var di=class{constructor(e,r,n,i){this.requestId=e,this.auth=r,this.token=n,this.revoked=i}};F([w(),M("design:type",String)],di.prototype,"requestId",void 0);F([w(),M("design:type",String)],di.prototype,"token",void 0);F([w(),M("design:type",Boolean)],di.prototype,"revoked",void 0);F([w(),M("design:type",lr)],di.prototype,"auth",void 0);di=F([Z(),M("design:paramtypes",[String,lr,String,Boolean])],di);var hi=class{constructor(e,r){this.domain=e,this.pointers=r}};F([w(),M("design:type",String)],hi.prototype,"domain",void 0);F([w(),M("design:type",Array)],hi.prototype,"pointers",void 0);hi=F([He(),M("design:paramtypes",[String,Array])],hi);var hs=class{constructor(e,r){this.with=e,this.can=r}};F([w(),M("design:type",hi)],hs.prototype,"with",void 0);F([w(),M("design:type",Array)],hs.prototype,"can",void 0);hs=F([He(),M("design:paramtypes",[hi,Array])],hs);var jr=class{constructor(e,r,n,i,a,o){this.appName=e,this.appDesc=r,this.appUrl=i,this.appDomain=n,this.capabilities=o,this.appIconPath=a}};F([w(),M("design:type",String)],jr.prototype,"appName",void 0);F([w(),M("design:type",String)],jr.prototype,"appDesc",void 0);F([w(),M("design:type",String)],jr.prototype,"appDomain",void 0);F([w(),M("design:type",String)],jr.prototype,"appUrl",void 0);F([w(),M("design:type",String)],jr.prototype,"appIconPath",void 0);F([w(),M("design:type",Array)],jr.prototype,"capabilities",void 0);jr=F([He(),M("design:paramtypes",[String,String,String,String,String,Array])],jr);var vi=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},bi=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Et=class{constructor(e){e?(this.isInitialized=e.isInitialized,this.isInitialized||(this.isInitialized=!1),this.isUnlocked=e.isUnlocked,this.isUnlocked||(this.isUnlocked=!1),this.did=e.did,this.didDocument=e.didDocument,this.error=e.error):(this.isInitialized=!1,this.isUnlocked=!1)}};vi([w(),bi("design:type",Boolean)],Et.prototype,"isInitialized",void 0);vi([w(),bi("design:type",Boolean)],Et.prototype,"isUnlocked",void 0);vi([w(),bi("design:type",String)],Et.prototype,"did",void 0);vi([w(),bi("design:type",String)],Et.prototype,"didDocument",void 0);vi([w(),bi("design:type",String)],Et.prototype,"error",void 0);Et=vi([Z(),bi("design:paramtypes",[Object])],Et);var sd=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Ae=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},st,ct,Bu=class{constructor(e,r){st.set(this,void 0),ct.set(this,void 0),sd(this,st,e,"f"),sd(this,ct,r,"f")}async otherAgents(){return await Ae(this,st,"f").otherAgents(Ae(this,ct,"f"))}async hasTelepresenceAdapter(){return await Ae(this,st,"f").hasTelepresenceAdapter(Ae(this,ct,"f"))}async onlineAgents(){return await Ae(this,st,"f").onlineAgents(Ae(this,ct,"f"))}async setOnlineStatus(e){return await Ae(this,st,"f").setOnlineStatus(Ae(this,ct,"f"),e)}async setOnlineStatusU(e){return await Ae(this,st,"f").setOnlineStatusU(Ae(this,ct,"f"),e)}async sendSignal(e,r){return await Ae(this,st,"f").sendSignal(Ae(this,ct,"f"),e,r)}async sendSignalU(e,r){return await Ae(this,st,"f").sendSignalU(Ae(this,ct,"f"),e,r)}async sendBroadcast(e,r=!1){return await Ae(this,st,"f").sendBroadcast(Ae(this,ct,"f"),e,r)}async sendBroadcastU(e,r=!1){return await Ae(this,st,"f").sendBroadcastU(Ae(this,ct,"f"),e,r)}async addSignalHandler(e){await Ae(this,st,"f").addSignalHandler(Ae(this,ct,"f"),e)}removeSignalHandler(e){Ae(this,st,"f").removeSignalHandler(Ae(this,ct,"f"),e)}};st=new WeakMap,ct=new WeakMap;var Nn=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},Rn=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},vt=class{constructor(e){e&&(this.source=e.source,this.predicate=e.predicate,this.target=e.target,e.fromDate&&(this.fromDate=e.fromDate),e.untilDate&&(this.untilDate=e.untilDate),e.limit&&(this.limit=e.limit))}isMatch(e){return!(this.source&&this.source!==e.source||this.predicate&&this.predicate!==e.predicate||this.target&&this.target!==e.target)}};Nn([w(),Rn("design:type",String)],vt.prototype,"source",void 0);Nn([w(),Rn("design:type",String)],vt.prototype,"target",void 0);Nn([w(),Rn("design:type",String)],vt.prototype,"predicate",void 0);Nn([w(),Rn("design:type",Date)],vt.prototype,"fromDate",void 0);Nn([w(),Rn("design:type",Date)],vt.prototype,"untilDate",void 0);Nn([w(),Rn("design:type",Number)],vt.prototype,"limit",void 0);vt=Nn([Z(),He(),Rn("design:paramtypes",[Object])],vt);var cd=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},ot=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Nt,ar;function gu(t){return encodeURIComponent(t).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`)}var Lt=class{constructor(){Nt.set(this,void 0),ar.set(this,void 0)}static fromUrl(e){if(!e||!e.startsWith("literal://"))throw new Error("Can't create Literal from non-literal URL");let r=new Lt;return cd(r,ar,e,"f"),r}static from(e){let r=new Lt;return cd(r,Nt,e,"f"),r}toUrl(){if(ot(this,ar,"f")&&!ot(this,Nt,"f"))return ot(this,ar,"f");if(!ot(this,ar,"f")&&!ot(this,Nt,"f"))throw new Error("Can't turn empty Literal into URL");let e;switch(typeof ot(this,Nt,"f")){case"string":e=`string:${gu(ot(this,Nt,"f"))}`;break;case"number":e=`number:${gu(ot(this,Nt,"f"))}`;break;case"object":e=`json:${gu(JSON.stringify(ot(this,Nt,"f")))}`;break}return`literal://${e}`}get(){if(ot(this,Nt,"f"))return ot(this,Nt,"f");if(!ot(this,ar,"f"))throw new Error("Can't render empty Literal");if(!ot(this,ar,"f").startsWith("literal://"))throw new Error("Can't render Literal from non-literal URL");let e=ot(this,ar,"f").substring(10);if(e.startsWith("string:"))return decodeURIComponent(e.substring(7));if(e.startsWith("number:")){let r=e.substring(7);return parseFloat(r)}if(e.startsWith("json:")){let r=e.substring(5);return JSON.parse(decodeURIComponent(r))}throw new Error(`Can't parse unknown literal: ${e}`)}};Nt=new WeakMap,ar=new WeakMap;function Nr(t){return t.charAt(0).toUpperCase()+t.slice(1)}function wh(t){return`set${Nr(t)}`}function ur(t){return t.endsWith("y")?t.slice(0,-1)+"ies":t+"s"}function cl(t){return t.endsWith("ies")?t.slice(0,-3)+"y":t.endsWith("s")?t.slice(0,-1):t}function py(t){return`add${Nr(cl(t))}`}function dy(t){let e=t.substring(3),r=ur(e);return r.charAt(0).toLowerCase()+r.slice(1)}function hy(t){return`remove${Nr(cl(t))}`}function my(t){let e=t.substring(6),r=ur(e);return r.charAt(0).toLowerCase()+r.slice(1)}function gy(t){let e=t.substring(13),r=ur(e);return r.charAt(0).toLowerCase()+r.slice(1)}function yy(t){return`setCollection${Nr(cl(t))}`}function ln(t){if(Array.isArray(t))return`[${t.map(ln).join(", ")}]`;let e=Object.keys(t),r=[];for(let n of e){let i=JSON.stringify(t[n]),a=`${n}: ${i}`;r.push(a)}return`{${r.join(", ")}}`}var yu=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},z=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Je,Xe,Ee,ms=class{constructor(t,e,r){Je.set(this,void 0),Xe.set(this,void 0),Ee.set(this,void 0),yu(this,Je,e,"f"),yu(this,Xe,r,"f"),yu(this,Ee,t,"f")}get baseExpression(){return z(this,Je,"f")}async init(){let isInstance=await z(this,Ee,"f").isSubjectInstance(z(this,Je,"f"),z(this,Xe,"f"));if(!isInstance)throw`Not a valid subject instance of ${z(this,Xe,"f")} for ${z(this,Je,"f")}`;let results=await z(this,Ee,"f").infer(`subject_class("${z(this,Xe,"f")}", C), property(C, Property)`),properties=results.map(t=>t.Property);for(let t of properties){let e=await z(this,Ee,"f").infer(`subject_class("${z(this,Xe,"f")}", C), property_resolve(C, "${t}")`);Object.defineProperty(this,t,{configurable:!0,get:async()=>{let r=await z(this,Ee,"f").infer(`subject_class("${z(this,Xe,"f")}", C), property_getter(C, "${z(this,Je,"f")}", "${t}", Value)`);if(r&&r.length>0){let n=r[0].Value;if(e)try{if(n){let i=await z(this,Ee,"f").getExpression(n);try{return JSON.parse(i.data)}catch{return i.data}}else return n}catch{return n}else return n}else return r||void 0}})}let setters=await z(this,Ee,"f").infer(`subject_class("${z(this,Xe,"f")}", C), property_setter(C, Property, Setter)`);for(let setter of setters||[])if(setter){let property=setter.Property,actions=eval(setter.Setter),resolveLanguageResults=await z(this,Ee,"f").infer(`subject_class("${z(this,Xe,"f")}", C), property_resolve_language(C, "${property}", Language)`),resolveLanguage;resolveLanguageResults&&resolveLanguageResults.length>0&&(resolveLanguage=resolveLanguageResults[0].Language),this[wh(property)]=async t=>{resolveLanguage&&(t=await z(this,Ee,"f").createExpression(t,resolveLanguage)),await z(this,Ee,"f").executeAction(actions,z(this,Je,"f"),[{name:"value",value:t}])}}let results2=await z(this,Ee,"f").infer(`subject_class("${z(this,Xe,"f")}", C), collection(C, Collection)`);results2||(results2=[]);let collections=results2.map(t=>t.Collection);for(let t of collections)Object.defineProperty(this,t,{configurable:!0,get:async()=>{let e=await z(this,Ee,"f").infer(`subject_class("${z(this,Xe,"f")}", C), collection_getter(C, "${z(this,Je,"f")}", "${t}", Value)`);return e&&e.length>0&&e[0].Value?e[0].Value.filter(n=>n!==""&&n!==""):[]}});let adders=await z(this,Ee,"f").infer(`subject_class("${z(this,Xe,"f")}", C), collection_adder(C, Collection, Adder)`);adders||(adders=[]);for(let adder of adders)if(adder){let collection=adder.Collection,actions=eval(adder.Adder);this[py(collection)]=async t=>{Array.isArray(t)?await Promise.all(t.map(e=>z(this,Ee,"f").executeAction(actions,z(this,Je,"f"),[{name:"value",value:e}]))):await z(this,Ee,"f").executeAction(actions,z(this,Je,"f"),[{name:"value",value:t}])}}let removers=await z(this,Ee,"f").infer(`subject_class("${z(this,Xe,"f")}", C), collection_remover(C, Collection, Remover)`);removers||(removers=[]);for(let remover of removers)if(remover){let collection=remover.Collection,actions=eval(remover.Remover);this[hy(collection)]=async t=>{Array.isArray(t)?await Promise.all(t.map(e=>z(this,Ee,"f").executeAction(actions,z(this,Je,"f"),[{name:"value",value:e}]))):await z(this,Ee,"f").executeAction(actions,z(this,Je,"f"),[{name:"value",value:t}])}}let collectionSetters=await z(this,Ee,"f").infer(`subject_class("${z(this,Xe,"f")}", C), collection_setter(C, Collection, Setter)`);collectionSetters||(collectionSetters=[]);for(let collectionSetter of collectionSetters)if(collectionSetter){let collection=collectionSetter.Collection,actions=eval(collectionSetter.Setter);this[yy(collection)]=async t=>{Array.isArray(t)?await z(this,Ee,"f").executeAction(actions,z(this,Je,"f"),t.map(e=>({name:"value",value:e}))):await z(this,Ee,"f").executeAction(actions,z(this,Je,"f"),[{name:"value",value:t}])}}}};Je=new WeakMap,Xe=new WeakMap,Ee=new WeakMap;var ni=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},$=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},le,me,fn,pn,dn,ta,li=class{constructor(t,e){le.set(this,void 0),me.set(this,void 0),fn.set(this,void 0),pn.set(this,void 0),dn.set(this,void 0),ta.set(this,void 0),ni(this,fn,[],"f"),ni(this,pn,[],"f"),ni(this,dn,[],"f"),ni(this,ta,[],"f"),ni(this,le,t,"f"),ni(this,me,e,"f"),this.uuid=$(this,le,"f").uuid,this.name=$(this,le,"f").name,this.sharedUrl=$(this,le,"f").sharedUrl,this.neighbourhood=$(this,le,"f").neighbourhood,this.state=$(this,le,"f").state,$(this,me,"f").addPerspectiveLinkAddedListener($(this,le,"f").uuid,$(this,fn,"f")),$(this,me,"f").addPerspectiveLinkRemovedListener($(this,le,"f").uuid,$(this,pn,"f")),$(this,me,"f").addPerspectiveLinkUpdatedListener($(this,le,"f").uuid,$(this,dn,"f")),$(this,me,"f").addPerspectiveSyncStateChangeListener($(this,le,"f").uuid,$(this,ta,"f"))}async executeAction(t,e,r){return await $(this,me,"f").executeCommands($(this,le,"f").uuid,JSON.stringify(t),e,JSON.stringify(r))}async get(t){return await $(this,me,"f").queryLinks($(this,le,"f").uuid,t)}async infer(t){return await $(this,me,"f").queryProlog($(this,le,"f").uuid,t)}async add(t,e="shared"){return await $(this,me,"f").addLink($(this,le,"f").uuid,t,e)}async addLinks(t,e="shared"){return await $(this,me,"f").addLinks($(this,le,"f").uuid,t,e)}async removeLinks(t){return await $(this,me,"f").removeLinks($(this,le,"f").uuid,t)}async linkMutations(t,e="shared"){return await $(this,me,"f").linkMutations($(this,le,"f").uuid,t,e)}async addLinkExpression(t,e="shared"){return await $(this,me,"f").addLinkExpression($(this,le,"f").uuid,t,e)}async update(t,e){return await $(this,me,"f").updateLink($(this,le,"f").uuid,t,e)}async remove(t){return await $(this,me,"f").removeLink($(this,le,"f").uuid,t)}async getExpression(t){return await $(this,me,"f").getExpression(t)}async createExpression(t,e){return await $(this,me,"f").createExpression(t,e)}async addListener(t,e){t==="link-added"?$(this,fn,"f").push(e):t==="link-removed"?$(this,pn,"f").push(e):t==="link-updated"&&$(this,dn,"f").push(e)}async addSyncStateChangeListener(t){$(this,ta,"f").push(t)}async removeListener(t,e){if(t==="link-added"){let r=$(this,fn,"f").indexOf(e);$(this,fn,"f").splice(r,1)}else if(t==="link-removed"){let r=$(this,pn,"f").indexOf(e);$(this,pn,"f").splice(r,1)}else if(t==="link-updated"){let r=$(this,dn,"f").indexOf(e);$(this,dn,"f").splice(r,1)}}async snapshot(){return $(this,me,"f").snapshotByUUID($(this,le,"f").uuid)}async loadSnapshot(t){let e=JSON.parse(JSON.stringify(t));delete e.__typename,e.links.forEach(r=>{delete r.data.__typename});for(let r of e.links)await this.addLinkExpression(r)}async getSingleTarget(t){delete t.target;let e=await this.get(t);return e.length?e[0].data.target:null}async setSingleTarget(t,e="shared"){let r=new vt({source:t.source,predicate:t.predicate}),n=await this.get(r),i=[];for(let o of n)delete o.__typename,delete o.data.__typename,delete o.proof.__typename,i.push(o);let a=[t];await this.linkMutations({additions:a,removals:i},e)}async sdnaFlows(){return(await this.infer("register_sdna_flow(X, _)")).map(e=>e.X)}async availableFlows(t){return(await this.infer(`flowable("${t}", F), register_sdna_flow(X, F)`)).map(r=>r.X)}async startFlow(flowName,exprAddr){let startAction=await this.infer(`start_action(Action, F), register_sdna_flow("${flowName}", F)`);startAction=eval(startAction[0].Action),await this.executeAction(startAction,exprAddr,void 0)}async expressionsInFlowState(t,e){return(await this.infer(`register_sdna_flow("${t}", F), flow_state(X, ${e}, F)`)).map(n=>n.X)}async flowState(t,e){return(await this.infer(`register_sdna_flow("${t}", F), flow_state("${e}", X, F)`))[0].X}async flowActions(t,e){return(await this.infer(`register_sdna_flow("${t}", Flow), flow_state("${e}", State, Flow), action(State, Name, _, _)`)).map(n=>n.Name)}async runFlowAction(flowName,exprAddr,actionName){let action=await this.infer(`register_sdna_flow("${flowName}", Flow), flow_state("${exprAddr}", State, Flow), action(State, "${actionName}", _, Action)`);action=eval(action[0].Action),await this.executeAction(action,exprAddr,void 0)}async getSdna(){return(await this.get(new vt({predicate:"ad4m://sdna"}))).map(e=>e.data.target).map(e=>Lt.fromUrl(e).get())}async addSdna(t,e,r){return $(this,me,"f").addSdna($(this,le,"f").uuid,t,e,r)}async subjectClasses(){try{return(await this.infer("subject_class(X, _)")).map(t=>t.X)}catch{return[]}}async stringOrTemplateObjectToSubjectClass(t){if(typeof t=="string")return t;{let e=await this.subjectClassesByTemplate(t);return e[0]?e[0]:t.className}}async createSubject(t,e){let r;if(typeof t=="string")r=t,await $(this,me,"f").createSubject($(this,le,"f").uuid,JSON.stringify({className:r}),e);else{let n=this.buildQueryFromTemplate(t);await $(this,me,"f").createSubject($(this,le,"f").uuid,JSON.stringify({query:n}),e)}return this.getSubjectProxy(e,t)}async getSubjectData(t,e){if(typeof t=="string")return JSON.parse(await $(this,me,"f").getSubjectData($(this,le,"f").uuid,JSON.stringify({className:t}),e));let r=this.buildQueryFromTemplate(t);return JSON.parse(await $(this,me,"f").getSubjectData($(this,le,"f").uuid,JSON.stringify({query:r}),e))}async removeSubject(subjectClass,exprAddr){let className=await this.stringOrTemplateObjectToSubjectClass(subjectClass),result=await this.infer(`subject_class("${className}", C), destructor(C, Actions)`);if(!result.length)throw"No constructor found for given subject class: "+className;let actions=result.map(x=>eval(x.Actions));await this.executeAction(actions[0],exprAddr,void 0)}async isSubjectInstance(t,e){let r=await this.stringOrTemplateObjectToSubjectClass(e),n=!1,i=5,a=0;for(;a<i&&!n;)n=await this.infer(`subject_class("${r}", C), instance(C, "${t}")`),a++;return n}async getSubjectProxy(t,e){if(!await this.isSubjectInstance(t,e))throw`Expression ${t} is not a subject instance of given class: ${JSON.stringify(e)}`;let r=await this.stringOrTemplateObjectToSubjectClass(e),n=new ms(this,t,r);return await n.init(),n}async getAllSubjectInstances(t){let e=[];typeof t=="string"?e=[t]:e=await this.subjectClassesByTemplate(t);let r=[];for(let n of e){let i=await this.infer(`subject_class("${n}", C), instance(C, X)`),a=await Promise.all(i.map(async o=>await this.getSubjectProxy(o.X,n)));r=r.concat(a)}return r}async getAllSubjectProxies(t){let e=[];typeof t=="string"?e=[t]:e=await this.subjectClassesByTemplate(t);let r=[];for(let n of e)r=await this.infer(`subject_class("${n}", C), instance(C, X)`);return r}buildQueryFromTemplate(t){let e;return function(r){let n=[],i=[];Object.getPrototypeOf(r).__properties?Object.keys(Object.getPrototypeOf(r).__properties).forEach(l=>n.push(l)):n.push(...Object.keys(r).filter(l=>!Array.isArray(r[l]))),Object.getPrototypeOf(r).__collections?Object.keys(Object.getPrototypeOf(r).__collections).filter(l=>l!=="isSubjectInstance").forEach(l=>!i.includes(l)):i.push(...Object.keys(r).filter(l=>Array.isArray(r[l])).filter(l=>l!=="isSubjectInstance"));let a=Object.getOwnPropertyNames(r).filter(l=>typeof r[l]=="function"&&l.startsWith("set")&&!l.startsWith("setCollection"));a=a.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(r)).filter(l=>{let d=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(r),l);return d&&typeof d.value=="function"&&l.startsWith("set")&&!l.startsWith("setCollection")}));let o=Object.getOwnPropertyNames(r).filter(l=>Object.prototype.hasOwnProperty.call(r,l)&&typeof r[l]=="function"&&l.startsWith("add"));o=o.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(r)).filter(l=>{let d=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(r),l);return d&&typeof d.value=="function"&&l.startsWith("add")}));let s=Object.getOwnPropertyNames(r).filter(l=>Object.prototype.hasOwnProperty.call(r,l)&&typeof r[l]=="function"&&l.startsWith("remove"));s=s.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(r)).filter(l=>{let d=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(r),l);return d&&typeof d.value=="function"&&l.startsWith("remove")}));let u=Object.getOwnPropertyNames(r).filter(l=>Object.prototype.hasOwnProperty.call(r,l)&&typeof r[l]=="function"&&l.startsWith("setCollection"));u=u.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(r)).filter(l=>{let d=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(r),l);return d&&typeof d.value=="function"&&l.startsWith("setCollection")}));let c="subject_class(Class, C)";for(let l of n)c+=`, property(C, "${l}")`;for(let l of i)c+=`, collection(C, "${l}")`;for(let l of a){let d=l.substring(3);d=d.charAt(0).toLowerCase()+d.slice(1),c+=`, property_setter(C, "${d}", _)`}for(let l of o)c+=`, collection_adder(C, "${dy(l)}", _)`;for(let l of s)c+=`, collection_remover(C, "${my(l)}", _)`;for(let l of u)c+=`, collection_setter(C, "${gy(l)}", _)`;c+=".",e=c}(t),e}async subjectClassesByTemplate(t){let e=this.buildQueryFromTemplate(t),r=await this.infer(e);return r?r.map(n=>n.Class):[]}async ensureSDNASubjectClass(t){if((await this.subjectClassesByTemplate(new t)).length>0)return;let{name:r,sdna:n}=t.generateSDNA();await this.addSdna(r,n,"subject_class")}getNeighbourhoodProxy(){return $(this,me,"f").getNeighbourhoodProxy($(this,le,"f").uuid)}get ai(){return $(this,me,"f").aiClient}};le=new WeakMap,me=new WeakMap,fn=new WeakMap,pn=new WeakMap,dn=new WeakMap,ta=new WeakMap;var kr=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},G=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},se,ra,na,ia,Yo,aa,Jo,Xo,ht=`
|
|
64
64
|
author
|
|
65
65
|
timestamp
|
|
66
66
|
status
|
|
67
67
|
data { source, predicate, target }
|
|
68
68
|
proof { valid, invalid, signature, key }
|
|
69
|
-
`,
|
|
69
|
+
`,ii=`
|
|
70
70
|
uuid
|
|
71
71
|
name
|
|
72
72
|
sharedUrl
|
|
@@ -86,15 +86,15 @@ neighbourhood {
|
|
|
86
86
|
}
|
|
87
87
|
author
|
|
88
88
|
}
|
|
89
|
-
`,
|
|
89
|
+
`,gs=class{constructor(e,r=!0){se.set(this,void 0),ra.set(this,void 0),na.set(this,void 0),ia.set(this,void 0),Yo.set(this,void 0),aa.set(this,void 0),Jo.set(this,void 0),Xo.set(this,void 0),kr(this,se,e,"f"),kr(this,ra,[],"f"),kr(this,na,[],"f"),kr(this,ia,[],"f"),kr(this,Yo,[],"f"),r&&(this.subscribePerspectiveAdded(),this.subscribePerspectiveUpdated(),this.subscribePerspectiveRemoved())}setExpressionClient(e){kr(this,aa,e,"f")}setNeighbourhoodClient(e){kr(this,Jo,e,"f")}setAIClient(e){kr(this,Xo,e,"f")}get aiClient(){return G(this,Xo,"f")}async all(){let{perspectives:e}=T(await G(this,se,"f").query({query:C`query perspectives {
|
|
90
90
|
perspectives {
|
|
91
|
-
${
|
|
91
|
+
${ii}
|
|
92
92
|
}
|
|
93
|
-
}`}));return e.map(r=>new
|
|
93
|
+
}`}));return e.map(r=>new li(r,this))}async byUUID(e){let{perspective:r}=T(await G(this,se,"f").query({query:C`query perspective($uuid: String!) {
|
|
94
94
|
perspective(uuid: $uuid) {
|
|
95
|
-
${
|
|
95
|
+
${ii}
|
|
96
96
|
}
|
|
97
|
-
}`,variables:{uuid:e}}));return r?new
|
|
97
|
+
}`,variables:{uuid:e}}));return r?new li(r,this):null}async snapshotByUUID(e){let{perspectiveSnapshot:r}=T(await G(this,se,"f").query({query:C`query perspectiveSnapshot($uuid: String!) {
|
|
98
98
|
perspectiveSnapshot(uuid: $uuid) {
|
|
99
99
|
links { ${ht} }
|
|
100
100
|
}
|
|
@@ -108,13 +108,13 @@ neighbourhood {
|
|
|
108
108
|
perspectiveQueryProlog(uuid: $uuid, query: $query)
|
|
109
109
|
}`,variables:{uuid:e,query:r}}));return JSON.parse(n)}async add(e){let{perspectiveAdd:r}=T(await G(this,se,"f").mutate({mutation:C`mutation perspectiveAdd($name: String!) {
|
|
110
110
|
perspectiveAdd(name: $name) {
|
|
111
|
-
${
|
|
111
|
+
${ii}
|
|
112
112
|
}
|
|
113
|
-
}`,variables:{name:e}}));return new
|
|
113
|
+
}`,variables:{name:e}}));return new li(r,this)}async update(e,r){let{perspectiveUpdate:n}=T(await G(this,se,"f").mutate({mutation:C`mutation perspectiveUpdate($uuid: String!, $name: String!) {
|
|
114
114
|
perspectiveUpdate(uuid: $uuid, name: $name) {
|
|
115
|
-
${
|
|
115
|
+
${ii}
|
|
116
116
|
}
|
|
117
|
-
}`,variables:{uuid:e,name:r}}));return new
|
|
117
|
+
}`,variables:{uuid:e,name:r}}));return new li(n,this)}async remove(e){return T(await G(this,se,"f").mutate({mutation:C`mutation perspectiveRemove($uuid: String!) {
|
|
118
118
|
perspectiveRemove(uuid: $uuid)
|
|
119
119
|
}`,variables:{uuid:e}}))}async addLink(e,r,n){let{perspectiveAddLink:i}=T(await G(this,se,"f").mutate({mutation:C`mutation perspectiveAddLink($uuid: String!, $link: LinkInput!, $status: String){
|
|
120
120
|
perspectiveAddLink(link: $link, uuid: $uuid, status: $status) {
|
|
@@ -163,19 +163,19 @@ neighbourhood {
|
|
|
163
163
|
perspectiveCreateSubject(uuid: $uuid, subjectClass: $subjectClass, expressionAddress: $expressionAddress)
|
|
164
164
|
}`,variables:{uuid:e,subjectClass:r,expressionAddress:n}})).perspectiveCreateSubject}async getSubjectData(e,r,n){return T(await G(this,se,"f").mutate({mutation:C`mutation perspectiveGetSubjectData($uuid: String!, $subjectClass: String!, $expressionAddress: String!) {
|
|
165
165
|
perspectiveGetSubjectData(uuid: $uuid, subjectClass: $subjectClass, expressionAddress: $expressionAddress)
|
|
166
|
-
}`,variables:{uuid:e,subjectClass:r,expressionAddress:n}})).perspectiveGetSubjectData}async getExpression(e){return await G(this,
|
|
167
|
-
perspectiveAdded { ${
|
|
166
|
+
}`,variables:{uuid:e,subjectClass:r,expressionAddress:n}})).perspectiveGetSubjectData}async getExpression(e){return await G(this,aa,"f").get(e)}async createExpression(e,r){return await G(this,aa,"f").create(e,r)}addPerspectiveAddedListener(e){G(this,ra,"f").push(e)}subscribePerspectiveAdded(){G(this,se,"f").subscribe({query:C` subscription {
|
|
167
|
+
perspectiveAdded { ${ii} }
|
|
168
168
|
}
|
|
169
|
-
`}).subscribe({next:e=>{G(this,
|
|
170
|
-
perspectiveUpdated { ${
|
|
169
|
+
`}).subscribe({next:e=>{G(this,ra,"f").forEach(r=>{r(e.data.perspectiveAdded)})},error:e=>console.error(e)})}addPerspectiveUpdatedListener(e){G(this,na,"f").push(e)}subscribePerspectiveUpdated(){G(this,se,"f").subscribe({query:C` subscription {
|
|
170
|
+
perspectiveUpdated { ${ii} }
|
|
171
171
|
}
|
|
172
|
-
`}).subscribe({next:e=>{G(this,
|
|
172
|
+
`}).subscribe({next:e=>{G(this,na,"f").forEach(r=>{r(e.data.perspectiveUpdated)})},error:e=>console.error(e)})}addPerspectiveSyncedListener(e){G(this,Yo,"f").push(e)}async addPerspectiveSyncStateChangeListener(e,r){G(this,se,"f").subscribe({query:C` subscription {
|
|
173
173
|
perspectiveSyncStateChange(uuid: "${e}")
|
|
174
174
|
}
|
|
175
|
-
`}).subscribe({next:n=>{r.forEach(i=>{i(n.data.perspectiveSyncStateChange)})},error:n=>console.error(n)}),await new Promise(n=>setTimeout(n,500))}addPerspectiveRemovedListener(e){G(this,
|
|
175
|
+
`}).subscribe({next:n=>{r.forEach(i=>{i(n.data.perspectiveSyncStateChange)})},error:n=>console.error(n)}),await new Promise(n=>setTimeout(n,500))}addPerspectiveRemovedListener(e){G(this,ia,"f").push(e)}subscribePerspectiveRemoved(){G(this,se,"f").subscribe({query:C` subscription {
|
|
176
176
|
perspectiveRemoved
|
|
177
177
|
}
|
|
178
|
-
`}).subscribe({next:e=>{G(this,
|
|
178
|
+
`}).subscribe({next:e=>{G(this,ia,"f").forEach(r=>{r(e.data.perspectiveRemoved)})},error:e=>console.error(e)})}async addPerspectiveLinkAddedListener(e,r){G(this,se,"f").subscribe({query:C` subscription {
|
|
179
179
|
perspectiveLinkAdded(uuid: "${e}") { ${ht} }
|
|
180
180
|
}
|
|
181
181
|
`}).subscribe({next:n=>{r.forEach(i=>{i(n.data.perspectiveLinkAdded)})},error:n=>console.error(n)}),await new Promise(n=>setTimeout(n,500))}async addPerspectiveLinkRemovedListener(e,r){G(this,se,"f").subscribe({query:C` subscription {
|
|
@@ -191,7 +191,7 @@ neighbourhood {
|
|
|
191
191
|
}
|
|
192
192
|
}
|
|
193
193
|
}
|
|
194
|
-
`}).subscribe({next:n=>{r.forEach(i=>{n.data.perspectiveLinkUpdated.newLink.status||delete n.data.perspectiveLinkUpdated.newLink.status,n.data.perspectiveLinkUpdated.oldLink.status||delete n.data.perspectiveLinkUpdated.oldLink.status,i(n.data.perspectiveLinkUpdated)})},error:n=>console.error(n)}),await new Promise(n=>setTimeout(n,500))}getNeighbourhoodProxy(e){return new
|
|
194
|
+
`}).subscribe({next:n=>{r.forEach(i=>{n.data.perspectiveLinkUpdated.newLink.status||delete n.data.perspectiveLinkUpdated.newLink.status,n.data.perspectiveLinkUpdated.oldLink.status||delete n.data.perspectiveLinkUpdated.oldLink.status,i(n.data.perspectiveLinkUpdated)})},error:n=>console.error(n)}),await new Promise(n=>setTimeout(n,500))}getNeighbourhoodProxy(e){return new Bu(G(this,Jo,"f"),e)}};se=new WeakMap,ra=new WeakMap,na=new WeakMap,ia=new WeakMap,Yo=new WeakMap,aa=new WeakMap,Jo=new WeakMap,Xo=new WeakMap;var Po=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},ne=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},fe,oa,sa,ca,Ji=`
|
|
195
195
|
did
|
|
196
196
|
directMessageLanguage
|
|
197
197
|
perspective {
|
|
@@ -205,7 +205,7 @@ neighbourhood {
|
|
|
205
205
|
}
|
|
206
206
|
}
|
|
207
207
|
}
|
|
208
|
-
`,
|
|
208
|
+
`,Lo=`
|
|
209
209
|
requestId
|
|
210
210
|
revoked
|
|
211
211
|
auth {
|
|
@@ -221,31 +221,31 @@ neighbourhood {
|
|
|
221
221
|
can
|
|
222
222
|
}
|
|
223
223
|
}
|
|
224
|
-
`,
|
|
224
|
+
`,ai=`
|
|
225
225
|
isInitialized
|
|
226
226
|
isUnlocked
|
|
227
227
|
did
|
|
228
228
|
didDocument
|
|
229
229
|
error
|
|
230
|
-
|
|
230
|
+
`,$o=`
|
|
231
231
|
did
|
|
232
232
|
didSigningKeyId
|
|
233
233
|
deviceKeyType
|
|
234
234
|
deviceKey
|
|
235
235
|
deviceKeySignedByDid
|
|
236
236
|
didSignedByDeviceKey
|
|
237
|
-
`,
|
|
237
|
+
`,vy=`
|
|
238
238
|
signature
|
|
239
239
|
publicKey
|
|
240
|
-
`,
|
|
240
|
+
`,Ea=class{constructor(e,r=!0){fe.set(this,void 0),oa.set(this,void 0),sa.set(this,void 0),ca.set(this,void 0),Po(this,fe,e,"f"),Po(this,sa,[],"f"),Po(this,ca,[],"f"),Po(this,oa,[],"f"),r&&(this.subscribeAgentUpdated(),this.subscribeAgentStatusChanged(),this.subscribeAppsChanged())}async me(){let{agent:e}=T(await ne(this,fe,"f").query({query:C`query agent { agent { ${Ji} } }`})),r=new Dr(e.did,e.perspective);return r.directMessageLanguage=e.directMessageLanguage,r}async status(){let{agentStatus:e}=T(await ne(this,fe,"f").query({query:C`query agentStatus {
|
|
241
241
|
agentStatus {
|
|
242
|
-
${
|
|
242
|
+
${ai}
|
|
243
243
|
}
|
|
244
244
|
}`}));return new Et(e)}async generate(e){let{agentGenerate:r}=T(await ne(this,fe,"f").mutate({mutation:C`mutation agentGenerate(
|
|
245
245
|
$passphrase: String!
|
|
246
246
|
) {
|
|
247
247
|
agentGenerate(passphrase: $passphrase) {
|
|
248
|
-
${
|
|
248
|
+
${ai}
|
|
249
249
|
}
|
|
250
250
|
}`,variables:{passphrase:e}}));return new Et(r)}async import(e){let{did:r,didDocument:n,keystore:i,passphrase:a}=e,{agentImport:o}=T(await ne(this,fe,"f").mutate({mutation:C`mutation agentImport(
|
|
251
251
|
$did: String!,
|
|
@@ -254,56 +254,56 @@ neighbourhood {
|
|
|
254
254
|
$passphrase: String!
|
|
255
255
|
) {
|
|
256
256
|
agentImport(did: $did, didDocument: $didDocument, keystore: $keystore, passphrase: $passphrase) {
|
|
257
|
-
${
|
|
257
|
+
${ai}
|
|
258
258
|
}
|
|
259
259
|
}`,variables:{did:r,didDocument:n,keystore:i,passphrase:a}}));return new Et(o)}async lock(e){let{agentLock:r}=T(await ne(this,fe,"f").mutate({mutation:C`mutation agentLock($passphrase: String!) {
|
|
260
260
|
agentLock(passphrase: $passphrase) {
|
|
261
|
-
${
|
|
261
|
+
${ai}
|
|
262
262
|
}
|
|
263
263
|
}`,variables:{passphrase:e}}));return new Et(r)}async unlock(e,r=!0){let{agentUnlock:n}=T(await ne(this,fe,"f").mutate({mutation:C`mutation agentUnlock($passphrase: String!, $holochain: Boolean!) {
|
|
264
264
|
agentUnlock(passphrase: $passphrase, holochain: $holochain) {
|
|
265
|
-
${
|
|
265
|
+
${ai}
|
|
266
266
|
}
|
|
267
267
|
}`,variables:{passphrase:e,holochain:r}}));return new Et(n)}async byDID(e){let{agentByDID:r}=T(await ne(this,fe,"f").query({query:C`query agentByDID($did: String!) {
|
|
268
268
|
agentByDID(did: $did) {
|
|
269
|
-
${
|
|
269
|
+
${Ji}
|
|
270
270
|
}
|
|
271
271
|
}`,variables:{did:e}}));return r}async updatePublicPerspective(e){let r=JSON.parse(JSON.stringify(e));delete r.__typename,r.links.forEach(o=>{delete o.__typename,delete o.data.__typename,delete o.proof.__typename,delete o.status});let{agentUpdatePublicPerspective:n}=T(await ne(this,fe,"f").mutate({mutation:C`mutation agentUpdatePublicPerspective($perspective: PerspectiveInput!) {
|
|
272
272
|
agentUpdatePublicPerspective(perspective: $perspective) {
|
|
273
|
-
${
|
|
273
|
+
${Ji}
|
|
274
274
|
}
|
|
275
|
-
}`,variables:{perspective:r}})),i=n,a=new
|
|
275
|
+
}`,variables:{perspective:r}})),i=n,a=new Dr(i.did,i.perspective);return a.directMessageLanguage=i.directMessageLanguage,a}async mutatePublicPerspective(e){let r=new gs(ne(this,fe,"f")),n=new Ea(ne(this,fe,"f")),i=await r.add("Agent Perspective Proxy"),a=await n.me();a.perspective&&await i.loadSnapshot(a.perspective);for(let u of e.additions)await i.add(u);for(let u of e.removals)await i.remove(u);let o=await i.snapshot(),s=await this.updatePublicPerspective(o);return await r.remove(i.uuid),s}async updateDirectMessageLanguage(e){let{agentUpdateDirectMessageLanguage:r}=T(await ne(this,fe,"f").mutate({mutation:C`mutation agentUpdateDirectMessageLanguage($directMessageLanguage: String!) {
|
|
276
276
|
agentUpdateDirectMessageLanguage(directMessageLanguage: $directMessageLanguage) {
|
|
277
|
-
${
|
|
277
|
+
${Ji}
|
|
278
278
|
}
|
|
279
|
-
}`,variables:{directMessageLanguage:e}})),n=r,i=new
|
|
279
|
+
}`,variables:{directMessageLanguage:e}})),n=r,i=new Dr(n.did,n.perspective);return i.directMessageLanguage=n.directMessageLanguage,i}async addEntanglementProofs(e){let{agentAddEntanglementProofs:r}=T(await ne(this,fe,"f").mutate({mutation:C`mutation agentAddEntanglementProofs($proofs: [EntanglementProofInput!]!) {
|
|
280
280
|
agentAddEntanglementProofs(proofs: $proofs) {
|
|
281
|
-
${
|
|
281
|
+
${$o}
|
|
282
282
|
}
|
|
283
283
|
}`,variables:{proofs:e}}));return r}async deleteEntanglementProofs(e){let{agentDeleteEntanglementProofs:r}=T(await ne(this,fe,"f").mutate({mutation:C`mutation agentDeleteEntanglementProofs($proofs: [EntanglementProofInput!]!) {
|
|
284
284
|
agentDeleteEntanglementProofs(proofs: $proofs) {
|
|
285
|
-
${
|
|
285
|
+
${$o}
|
|
286
286
|
}
|
|
287
287
|
}`,variables:{proofs:e}}));return r}async getEntanglementProofs(){let{agentGetEntanglementProofs:e}=T(await ne(this,fe,"f").query({query:C`query agentGetEntanglementProofs {
|
|
288
288
|
agentGetEntanglementProofs {
|
|
289
|
-
${
|
|
289
|
+
${$o}
|
|
290
290
|
}
|
|
291
291
|
}`}));return e}async entanglementProofPreFlight(e,r){let{agentEntanglementProofPreFlight:n}=T(await ne(this,fe,"f").mutate({mutation:C`mutation agentEntanglementProofPreFlight($deviceKey: String!, $deviceKeyType: String!) {
|
|
292
292
|
agentEntanglementProofPreFlight(deviceKey: $deviceKey, deviceKeyType: $deviceKeyType) {
|
|
293
|
-
${
|
|
293
|
+
${$o}
|
|
294
294
|
}
|
|
295
|
-
}`,variables:{deviceKey:e,deviceKeyType:r}}));return n}addUpdatedListener(e){ne(this,
|
|
296
|
-
agentUpdated { ${
|
|
295
|
+
}`,variables:{deviceKey:e,deviceKeyType:r}}));return n}addUpdatedListener(e){ne(this,sa,"f").push(e)}addAppChangedListener(e){ne(this,oa,"f").push(e)}subscribeAgentUpdated(){ne(this,fe,"f").subscribe({query:C` subscription {
|
|
296
|
+
agentUpdated { ${Ji} }
|
|
297
297
|
}
|
|
298
|
-
`}).subscribe({next:e=>{let r=e.data.agentUpdated;ne(this,
|
|
298
|
+
`}).subscribe({next:e=>{let r=e.data.agentUpdated;ne(this,sa,"f").forEach(n=>{n(r)})},error:e=>console.error(e)})}subscribeAppsChanged(){ne(this,fe,"f").subscribe({query:C` subscription {
|
|
299
299
|
agentAppsChanged {
|
|
300
|
-
${
|
|
300
|
+
${Lo}
|
|
301
301
|
}
|
|
302
302
|
}
|
|
303
|
-
`}).subscribe({next:e=>{ne(this,
|
|
304
|
-
agentStatusChanged { ${
|
|
303
|
+
`}).subscribe({next:e=>{ne(this,oa,"f").forEach(r=>{r()})},error:e=>console.error(e)})}addAgentStatusChangedListener(e){ne(this,ca,"f").push(e)}subscribeAgentStatusChanged(){ne(this,fe,"f").subscribe({query:C` subscription {
|
|
304
|
+
agentStatusChanged { ${ai} }
|
|
305
305
|
}
|
|
306
|
-
`}).subscribe({next:e=>{let r=e.data.agentStatusChanged;ne(this,
|
|
306
|
+
`}).subscribe({next:e=>{let r=e.data.agentStatusChanged;ne(this,ca,"f").forEach(n=>{n(r)})},error:e=>console.error(e)})}async requestCapability(e){let{agentRequestCapability:r}=T(await ne(this,fe,"f").mutate({mutation:C`
|
|
307
307
|
mutation agentRequestCapability($authInfo: AuthInfoInput!) {
|
|
308
308
|
agentRequestCapability(authInfo: $authInfo)
|
|
309
309
|
}
|
|
@@ -317,15 +317,15 @@ neighbourhood {
|
|
|
317
317
|
}
|
|
318
318
|
`,variables:{requestId:e,rand:r}}));return n}async getApps(){let{agentGetApps:e}=T(await ne(this,fe,"f").mutate({mutation:C`query agentGetApps {
|
|
319
319
|
agentGetApps {
|
|
320
|
-
${
|
|
320
|
+
${Lo}
|
|
321
321
|
}
|
|
322
322
|
}`}));return e}async removeApp(e){let{agentRemoveApp:r}=T(await ne(this,fe,"f").mutate({mutation:C`mutation agentRemoveApp($requestId: String!) {
|
|
323
323
|
agentRemoveApp(requestId: $requestId) {
|
|
324
|
-
${
|
|
324
|
+
${Lo}
|
|
325
325
|
}
|
|
326
326
|
}`,variables:{requestId:e}}));return r}async revokeToken(e){let{agentRevokeToken:r}=T(await ne(this,fe,"f").mutate({mutation:C`mutation agentRevokeToken($requestId: String!) {
|
|
327
327
|
agentRevokeToken(requestId: $requestId) {
|
|
328
|
-
${
|
|
328
|
+
${Lo}
|
|
329
329
|
}
|
|
330
330
|
}`,variables:{requestId:e}}));return r}async isLocked(){let{agentIsLocked:e}=T(await ne(this,fe,"f").mutate({mutation:C`
|
|
331
331
|
query agentIsLocked {
|
|
@@ -333,16 +333,16 @@ neighbourhood {
|
|
|
333
333
|
}
|
|
334
334
|
`}));return e}async signMessage(e){let{agentSignMessage:r}=T(await ne(this,fe,"f").mutate({mutation:C`mutation agentSignMessage($message: String!) {
|
|
335
335
|
agentSignMessage(message: $message) {
|
|
336
|
-
${
|
|
336
|
+
${vy}
|
|
337
337
|
}
|
|
338
|
-
}`,variables:{message:e}}));return r}};fe=new WeakMap,
|
|
338
|
+
}`,variables:{message:e}}));return r}};fe=new WeakMap,oa=new WeakMap,sa=new WeakMap,ca=new WeakMap;var by=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Tr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Rt,ud=`
|
|
339
339
|
name
|
|
340
340
|
address
|
|
341
341
|
settings
|
|
342
342
|
icon { code }
|
|
343
343
|
constructorIcon { code }
|
|
344
344
|
settingsIcon { code }
|
|
345
|
-
`,
|
|
345
|
+
`,ld=`
|
|
346
346
|
name
|
|
347
347
|
address
|
|
348
348
|
description
|
|
@@ -352,45 +352,45 @@ neighbourhood {
|
|
|
352
352
|
templateAppliedParams
|
|
353
353
|
possibleTemplateParams
|
|
354
354
|
sourceCodeLink
|
|
355
|
-
`,
|
|
355
|
+
`,Vu=class{constructor(e){Rt.set(this,void 0),by(this,Rt,e,"f")}async byAddress(e){let{language:r}=T(await Tr(this,Rt,"f").query({query:C`query byAddress($address: String!) {
|
|
356
356
|
language(address: $address) {
|
|
357
|
-
${
|
|
357
|
+
${ud}
|
|
358
358
|
}
|
|
359
|
-
}`,variables:{address:e}}));return r}async byFilter(e){let{languages:r}=T(await
|
|
359
|
+
}`,variables:{address:e}}));return r}async byFilter(e){let{languages:r}=T(await Tr(this,Rt,"f").query({query:C`query byFilter($filter: String!) {
|
|
360
360
|
languages(filter: $filter) {
|
|
361
|
-
${
|
|
361
|
+
${ud}
|
|
362
362
|
}
|
|
363
|
-
}`,variables:{filter:e}}));return r}async all(){return this.byFilter("")}async writeSettings(e,r){let{languageWriteSettings:n}=T(await
|
|
363
|
+
}`,variables:{filter:e}}));return r}async all(){return this.byFilter("")}async writeSettings(e,r){let{languageWriteSettings:n}=T(await Tr(this,Rt,"f").mutate({mutation:C`mutation writeSettings($languageAddress: String!, $settings: String!) {
|
|
364
364
|
languageWriteSettings(languageAddress: $languageAddress, settings: $settings)
|
|
365
|
-
}`,variables:{languageAddress:e,settings:r}}));return n}async applyTemplateAndPublish(e,r){let{languageApplyTemplateAndPublish:n}=T(await
|
|
365
|
+
}`,variables:{languageAddress:e,settings:r}}));return n}async applyTemplateAndPublish(e,r){let{languageApplyTemplateAndPublish:n}=T(await Tr(this,Rt,"f").mutate({mutation:C`mutation languageApplyTemplateAndPublish(
|
|
366
366
|
$sourceLanguageHash: String!,
|
|
367
367
|
$templateData: String!,
|
|
368
368
|
) {
|
|
369
369
|
languageApplyTemplateAndPublish(sourceLanguageHash: $sourceLanguageHash, templateData: $templateData) {
|
|
370
370
|
name, address
|
|
371
371
|
}
|
|
372
|
-
}`,variables:{sourceLanguageHash:e,templateData:r}}));return n}async publish(e,r){let{languagePublish:n}=T(await
|
|
372
|
+
}`,variables:{sourceLanguageHash:e,templateData:r}}));return n}async publish(e,r){let{languagePublish:n}=T(await Tr(this,Rt,"f").mutate({mutation:C`mutation languagePublish(
|
|
373
373
|
$languagePath: String!,
|
|
374
374
|
$languageMeta: LanguageMetaInput!,
|
|
375
375
|
) {
|
|
376
376
|
languagePublish(languagePath: $languagePath, languageMeta: $languageMeta) {
|
|
377
|
-
${
|
|
377
|
+
${ld}
|
|
378
378
|
}
|
|
379
|
-
}`,variables:{languagePath:e,languageMeta:r}}));return n}async meta(e){let{languageMeta:r}=T(await
|
|
379
|
+
}`,variables:{languagePath:e,languageMeta:r}}));return n}async meta(e){let{languageMeta:r}=T(await Tr(this,Rt,"f").query({query:C`query languageMeta(
|
|
380
380
|
$address: String!,
|
|
381
381
|
) {
|
|
382
382
|
languageMeta(address: $address) {
|
|
383
|
-
${
|
|
383
|
+
${ld}
|
|
384
384
|
}
|
|
385
|
-
}`,variables:{address:e}}));return r}async source(e){let{languageSource:r}=T(await
|
|
385
|
+
}`,variables:{address:e}}));return r}async source(e){let{languageSource:r}=T(await Tr(this,Rt,"f").query({query:C`query languageSource(
|
|
386
386
|
$address: String!,
|
|
387
387
|
) {
|
|
388
388
|
languageSource(address: $address)
|
|
389
|
-
}`,variables:{address:e}}));return r}async remove(e){let{languageRemove:r}=T(await
|
|
389
|
+
}`,variables:{address:e}}));return r}async remove(e){let{languageRemove:r}=T(await Tr(this,Rt,"f").mutate({mutation:C`mutation languageRemove(
|
|
390
390
|
$address: String!,
|
|
391
391
|
) {
|
|
392
392
|
languageRemove(address: $address)
|
|
393
|
-
}`,variables:{address:e}}));return r}};Rt=new WeakMap;var
|
|
393
|
+
}`,variables:{address:e}}));return r}};Rt=new WeakMap;var _y=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Qe=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},et,hn,zu=class{constructor(e){et.set(this,void 0),hn.set(this,new Map),_y(this,et,e,"f")}async publishFromPerspective(e,r,n){let{neighbourhoodPublishFromPerspective:i}=T(await Qe(this,et,"f").mutate({mutation:C`mutation neighbourhoodPublishFromPerspective(
|
|
394
394
|
$linkLanguage: String!,
|
|
395
395
|
$meta: PerspectiveInput!,
|
|
396
396
|
$perspectiveUUID: String!
|
|
@@ -479,23 +479,27 @@ neighbourhood {
|
|
|
479
479
|
remoteAgentDid: $remoteAgentDid,
|
|
480
480
|
payload: $payload
|
|
481
481
|
)
|
|
482
|
-
}`,variables:{perspectiveUUID:e,remoteAgentDid:r,payload:n}}));return i}async sendBroadcast(e,r){let{neighbourhoodSendBroadcast:
|
|
482
|
+
}`,variables:{perspectiveUUID:e,remoteAgentDid:r,payload:n}}));return i}async sendBroadcast(e,r,n=!1){let{neighbourhoodSendBroadcast:i}=T(await Qe(this,et,"f").mutate({mutation:C`mutation neighbourhoodSendBroadcast(
|
|
483
483
|
$perspectiveUUID: String!,
|
|
484
|
-
$payload: PerspectiveInput
|
|
484
|
+
$payload: PerspectiveInput!,
|
|
485
|
+
$loopback: Boolean
|
|
485
486
|
) {
|
|
486
487
|
neighbourhoodSendBroadcast(
|
|
487
488
|
perspectiveUUID: $perspectiveUUID,
|
|
488
|
-
payload: $payload
|
|
489
|
+
payload: $payload,
|
|
490
|
+
loopback: $loopback
|
|
489
491
|
)
|
|
490
|
-
}`,variables:{perspectiveUUID:e,payload:r}}));return
|
|
492
|
+
}`,variables:{perspectiveUUID:e,payload:r,loopback:n}}));return i}async sendBroadcastU(e,r,n=!1){let{neighbourhoodSendBroadcastU:i}=T(await Qe(this,et,"f").mutate({mutation:C`mutation neighbourhoodSendBroadcastU(
|
|
491
493
|
$perspectiveUUID: String!,
|
|
492
|
-
$payload: PerspectiveUnsignedInput
|
|
494
|
+
$payload: PerspectiveUnsignedInput!,
|
|
495
|
+
$loopback: Boolean
|
|
493
496
|
) {
|
|
494
497
|
neighbourhoodSendBroadcastU(
|
|
495
498
|
perspectiveUUID: $perspectiveUUID,
|
|
496
|
-
payload: $payload
|
|
499
|
+
payload: $payload,
|
|
500
|
+
loopback: $loopback
|
|
497
501
|
)
|
|
498
|
-
}`,variables:{perspectiveUUID:e,payload:r}}));return
|
|
502
|
+
}`,variables:{perspectiveUUID:e,payload:r,loopback:n}}));return i}dispatchSignal(e,r){let n=Qe(this,hn,"f").get(e);n&&n.forEach(i=>i(r))}async subscribeToSignals(e){let r=this;await Qe(this,et,"f").subscribe({query:C`subscription neighbourhoodSignal($perspectiveUUID: String!) {
|
|
499
503
|
neighbourhoodSignal(perspectiveUUID: $perspectiveUUID) {
|
|
500
504
|
author
|
|
501
505
|
timestamp
|
|
@@ -510,7 +514,7 @@ neighbourhood {
|
|
|
510
514
|
}
|
|
511
515
|
proof { valid, invalid, signature, key }
|
|
512
516
|
}
|
|
513
|
-
}`,variables:{perspectiveUUID:e}}).subscribe({next:n=>{let{neighbourhoodSignal:i}=T(n);r.dispatchSignal(e,i)}})}async addSignalHandler(e,r){let n=Qe(this,
|
|
517
|
+
}`,variables:{perspectiveUUID:e}}).subscribe({next:n=>{let{neighbourhoodSignal:i}=T(n);r.dispatchSignal(e,i)}})}async addSignalHandler(e,r){let n=Qe(this,hn,"f").get(e);n||(n=[],await this.subscribeToSignals(e)),n.push(r),Qe(this,hn,"f").set(e,n)}removeSignalHandler(e,r){let n=Qe(this,hn,"f").get(e);if(n){let i=n.indexOf(r);i>-1&&n.splice(i,1)}Qe(this,hn,"f").set(e,n)}};et=new WeakMap,hn=new WeakMap;var Fo=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},te=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},oe,ua,la,fa,Sh,Mo=`
|
|
514
518
|
author
|
|
515
519
|
timestamp
|
|
516
520
|
data {
|
|
@@ -522,7 +526,7 @@ data {
|
|
|
522
526
|
}
|
|
523
527
|
}
|
|
524
528
|
proof { valid, invalid, signature, key }
|
|
525
|
-
`,
|
|
529
|
+
`,wy=`
|
|
526
530
|
description
|
|
527
531
|
appName
|
|
528
532
|
appUrl
|
|
@@ -531,15 +535,15 @@ trigger
|
|
|
531
535
|
perspectiveIds
|
|
532
536
|
webhookUrl
|
|
533
537
|
webhookAuth
|
|
534
|
-
`,
|
|
538
|
+
`,Ch=`
|
|
535
539
|
id
|
|
536
540
|
granted
|
|
537
|
-
${
|
|
538
|
-
`,
|
|
539
|
-
notification { ${
|
|
541
|
+
${wy}
|
|
542
|
+
`,Sy=`
|
|
543
|
+
notification { ${Ch} }
|
|
540
544
|
perspectiveId
|
|
541
545
|
triggerMatch
|
|
542
|
-
`,
|
|
546
|
+
`,Qu=class{constructor(e,r=!0){oe.set(this,void 0),ua.set(this,void 0),la.set(this,void 0),fa.set(this,void 0),Sh.set(this,void 0),Fo(this,oe,e,"f"),Fo(this,ua,[],"f"),Fo(this,la,[],"f"),Fo(this,fa,[],"f"),r&&(this.subscribeMessageReceived(),this.subscribeExceptionOccurred(),this.subscribeNotificationTriggered())}async info(){let{runtimeInfo:e}=T(await te(this,oe,"f").query({query:C`query runtimeInfo {
|
|
543
547
|
runtimeInfo {
|
|
544
548
|
ad4mExecutorVersion,
|
|
545
549
|
isInitialized,
|
|
@@ -574,16 +578,16 @@ triggerMatch
|
|
|
574
578
|
}`,variables:{did:e,didSigningKeyId:r,data:n,signedData:i}}));return a}async setStatus(e){let{runtimeSetStatus:r}=T(await te(this,oe,"f").mutate({mutation:C`mutation runtimeSetStatus($status: PerspectiveInput!) {
|
|
575
579
|
runtimeSetStatus(status: $status)
|
|
576
580
|
}`,variables:{status:e}}));return r}async friendStatus(e){let{runtimeFriendStatus:r}=T(await te(this,oe,"f").query({query:C`query runtimeFriendStatus($did: String!) {
|
|
577
|
-
runtimeFriendStatus(did: $did) { ${
|
|
581
|
+
runtimeFriendStatus(did: $did) { ${Mo} }
|
|
578
582
|
}`,variables:{did:e}}));return r}async friendSendMessage(e,r){let{runtimeFriendSendMessage:n}=T(await te(this,oe,"f").mutate({mutation:C`mutation runtimeFriendSendMessage($did: String!, $message: PerspectiveInput!) {
|
|
579
583
|
runtimeFriendSendMessage(did: $did, message: $message)
|
|
580
584
|
}`,variables:{did:e,message:r}}));return n}async messageInbox(e){let{runtimeMessageInbox:r}=T(await te(this,oe,"f").query({query:C`query runtimeMessageInbox($filter: String) {
|
|
581
|
-
runtimeMessageInbox(filter: $filter) { ${
|
|
585
|
+
runtimeMessageInbox(filter: $filter) { ${Mo} }
|
|
582
586
|
}`,variables:{filter:e}}));return r}async messageOutbox(e){let{runtimeMessageOutbox:r}=T(await te(this,oe,"f").query({query:C`query runtimeMessageOutbox($filter: String) {
|
|
583
587
|
runtimeMessageOutbox(filter: $filter) {
|
|
584
588
|
recipient,
|
|
585
589
|
message {
|
|
586
|
-
${
|
|
590
|
+
${Mo}
|
|
587
591
|
}
|
|
588
592
|
}
|
|
589
593
|
}`,variables:{filter:e}}));return r}async requestInstallNotification(e){let{runtimeRequestInstallNotification:r}=T(await te(this,oe,"f").mutate({mutation:C`mutation runtimeRequestInstallNotification($notification: NotificationInput!) {
|
|
@@ -591,25 +595,25 @@ triggerMatch
|
|
|
591
595
|
}`,variables:{notification:e}}));return r}async grantNotification(e){let{runtimeGrantNotification:r}=T(await te(this,oe,"f").mutate({mutation:C`mutation runtimeGrantNotification($id: String!) {
|
|
592
596
|
runtimeGrantNotification(id: $id)
|
|
593
597
|
}`,variables:{id:e}}));return r}async notifications(){let{runtimeNotifications:e}=T(await te(this,oe,"f").query({query:C`query runtimeNotifications {
|
|
594
|
-
runtimeNotifications { ${
|
|
598
|
+
runtimeNotifications { ${Ch} }
|
|
595
599
|
}`}));return e}async updateNotification(e,r){let{runtimeUpdateNotification:n}=T(await te(this,oe,"f").mutate({mutation:C`mutation runtimeUpdateNotification($id: String!, $notification: NotificationInput!) {
|
|
596
600
|
runtimeUpdateNotification(id: $id, notification: $notification)
|
|
597
601
|
}`,variables:{id:e,notification:r}}));return n}async removeNotification(e){let{runtimeRemoveNotification:r}=T(await te(this,oe,"f").mutate({mutation:C`mutation runtimeRemoveNotification($id: String!) {
|
|
598
602
|
runtimeRemoveNotification(id: $id)
|
|
599
|
-
}`,variables:{id:e}}));return r}addNotificationTriggeredCallback(e){te(this,
|
|
600
|
-
runtimeNotificationTriggered { ${
|
|
603
|
+
}`,variables:{id:e}}));return r}addNotificationTriggeredCallback(e){te(this,fa,"f").push(e)}subscribeNotificationTriggered(){te(this,oe,"f").subscribe({query:C` subscription {
|
|
604
|
+
runtimeNotificationTriggered { ${Sy} }
|
|
601
605
|
}
|
|
602
|
-
`}).subscribe({next:e=>{te(this,
|
|
603
|
-
runtimeMessageReceived { ${
|
|
606
|
+
`}).subscribe({next:e=>{te(this,fa,"f").forEach(r=>{r(e.data.runtimeNotificationTriggered)})},error:e=>console.error(e)})}addMessageCallback(e){te(this,ua,"f").push(e)}subscribeMessageReceived(){te(this,oe,"f").subscribe({query:C` subscription {
|
|
607
|
+
runtimeMessageReceived { ${Mo} }
|
|
604
608
|
}
|
|
605
|
-
`}).subscribe({next:e=>{te(this,
|
|
609
|
+
`}).subscribe({next:e=>{te(this,ua,"f").forEach(r=>{r(e.data.runtimeMessageReceived)})},error:e=>console.error(e)})}addExceptionCallback(e){te(this,la,"f").push(e)}subscribeExceptionOccurred(){te(this,oe,"f").subscribe({query:C` subscription {
|
|
606
610
|
exceptionOccurred {
|
|
607
611
|
title
|
|
608
612
|
message
|
|
609
613
|
type
|
|
610
614
|
addon
|
|
611
615
|
}
|
|
612
|
-
}`}).subscribe({next:e=>{te(this,
|
|
616
|
+
}`}).subscribe({next:e=>{te(this,la,"f").forEach(r=>{r(e.data.exceptionOccurred)})},error:e=>console.error(e)})}};oe=new WeakMap,ua=new WeakMap,la=new WeakMap,fa=new WeakMap,Sh=new WeakMap;var Cy=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},oi=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},or,Gu=class{constructor(e){or.set(this,void 0),Cy(this,or,e,"f")}async get(e,r=!1){if(!r)try{let i=Lt.fromUrl(e).get();if(typeof i=="object"&&i!==null&&"author"in i&&"timestamp"in i&&"data"in i&&"proof"in i)return i}catch{}let{expression:n}=T(await oi(this,or,"f").query({query:C`query expression($url: String!) {
|
|
613
617
|
expression(url: $url) {
|
|
614
618
|
author
|
|
615
619
|
timestamp
|
|
@@ -622,7 +626,7 @@ triggerMatch
|
|
|
622
626
|
invalid
|
|
623
627
|
}
|
|
624
628
|
}
|
|
625
|
-
}`,variables:{url:e}}));return n}async getMany(e){let{expressionMany:r}=T(await
|
|
629
|
+
}`,variables:{url:e}}));return n}async getMany(e){let{expressionMany:r}=T(await oi(this,or,"f").query({query:C`query expressionMany($urls: [String!]!) {
|
|
626
630
|
expressionMany(urls: $urls) {
|
|
627
631
|
author
|
|
628
632
|
timestamp
|
|
@@ -635,19 +639,19 @@ triggerMatch
|
|
|
635
639
|
invalid
|
|
636
640
|
}
|
|
637
641
|
}
|
|
638
|
-
}`,variables:{urls:e}}));return r}async getRaw(e){let{expressionRaw:r}=T(await
|
|
642
|
+
}`,variables:{urls:e}}));return r}async getRaw(e){let{expressionRaw:r}=T(await oi(this,or,"f").query({query:C`query expressionRaw($url: String!) {
|
|
639
643
|
expressionRaw(url: $url)
|
|
640
|
-
}`,variables:{url:e}}));return r}async create(e,r){e=JSON.stringify(e);let{expressionCreate:n}=T(await
|
|
644
|
+
}`,variables:{url:e}}));return r}async create(e,r){e=JSON.stringify(e);let{expressionCreate:n}=T(await oi(this,or,"f").mutate({mutation:C`mutation expressionCreate($content: String!, $languageAddress: String!){
|
|
641
645
|
expressionCreate(content: $content, languageAddress: $languageAddress)
|
|
642
|
-
}`,variables:{content:e,languageAddress:r}}));return n}async interactions(e){let{expressionInteractions:r}=T(await
|
|
646
|
+
}`,variables:{content:e,languageAddress:r}}));return n}async interactions(e){let{expressionInteractions:r}=T(await oi(this,or,"f").query({query:C`query expressionInteractions($url: String!) {
|
|
643
647
|
expressionInteractions(url: $url) {
|
|
644
648
|
label
|
|
645
649
|
name
|
|
646
650
|
parameters { name, type }
|
|
647
651
|
}
|
|
648
|
-
}`,variables:{url:e}}));return r}async interact(e,r){let{expressionInteract:n}=T(await
|
|
652
|
+
}`,variables:{url:e}}));return r}async interact(e,r){let{expressionInteract:n}=T(await oi(this,or,"f").mutate({mutation:C`mutation expressionInteract($url: String!, $interactionCall: InteractionCall!){
|
|
649
653
|
expressionInteract(url: $url, interactionCall: $interactionCall)
|
|
650
|
-
}`,variables:{url:e,interactionCall:r}}));return n}};or=new WeakMap;var As={};As.byteLength=Ey;As.toByteArray=ky;As.fromByteArray=Iy;var Qt=[],Ct=[],Cy=typeof Uint8Array<"u"?Uint8Array:Array,gu="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(sn=0,ld=gu.length;sn<ld;++sn)Qt[sn]=gu[sn],Ct[gu.charCodeAt(sn)]=sn;var sn,ld;Ct["-".charCodeAt(0)]=62;Ct["_".charCodeAt(0)]=63;function Ch(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var n=r===e?0:4-r%4;return[r,n]}function Ey(t){var e=Ch(t),r=e[0],n=e[1];return(r+n)*3/4-n}function xy(t,e,r){return(e+r)*3/4-r}function ky(t){var e,r=Ch(t),n=r[0],i=r[1],a=new Cy(xy(t,n,i)),o=0,s=i>0?n-4:n,u;for(u=0;u<s;u+=4)e=Ct[t.charCodeAt(u)]<<18|Ct[t.charCodeAt(u+1)]<<12|Ct[t.charCodeAt(u+2)]<<6|Ct[t.charCodeAt(u+3)],a[o++]=e>>16&255,a[o++]=e>>8&255,a[o++]=e&255;return i===2&&(e=Ct[t.charCodeAt(u)]<<2|Ct[t.charCodeAt(u+1)]>>4,a[o++]=e&255),i===1&&(e=Ct[t.charCodeAt(u)]<<10|Ct[t.charCodeAt(u+1)]<<4|Ct[t.charCodeAt(u+2)]>>2,a[o++]=e>>8&255,a[o++]=e&255),a}function Ty(t){return Qt[t>>18&63]+Qt[t>>12&63]+Qt[t>>6&63]+Qt[t&63]}function Ay(t,e,r){for(var n,i=[],a=e;a<r;a+=3)n=(t[a]<<16&16711680)+(t[a+1]<<8&65280)+(t[a+2]&255),i.push(Ty(n));return i.join("")}function Iy(t){for(var e,r=t.length,n=r%3,i=[],a=16383,o=0,s=r-n;o<s;o+=a)i.push(Ay(t,o,o+a>s?s:o+a));return n===1?(e=t[r-1],i.push(Qt[e>>2]+Qt[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],i.push(Qt[e>>10]+Qt[e>>4&63]+Qt[e<<2&63]+"=")),i.join("")}var Oy=4,fd=0,pd=1,Dy=2;function bi(t){let e=t.length;for(;--e>=0;)t[e]=0}var Ny=0,Eh=1,Ry=2,Py=3,Ly=258,sl=29,La=256,Ea=La+1+sl,li=30,cl=19,xh=2*Ea+1,gn=15,yu=16,$y=7,ul=256,kh=16,Th=17,Ah=18,Qu=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),Xo=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),Fy=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),Ih=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),My=512,sr=new Array((Ea+2)*2);bi(sr);var ya=new Array(li*2);bi(ya);var xa=new Array(My);bi(xa);var ka=new Array(Ly-Py+1);bi(ka);var ll=new Array(sl);bi(ll);var gs=new Array(li);bi(gs);function vu(t,e,r,n,i){this.static_tree=t,this.extra_bits=e,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=t&&t.length}var Oh,Dh,Nh;function bu(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}var Rh=t=>t<256?xa[t]:xa[256+(t>>>7)],Ta=(t,e)=>{t.pending_buf[t.pending++]=e&255,t.pending_buf[t.pending++]=e>>>8&255},ut=(t,e,r)=>{t.bi_valid>yu-r?(t.bi_buf|=e<<t.bi_valid&65535,Ta(t,t.bi_buf),t.bi_buf=e>>yu-t.bi_valid,t.bi_valid+=r-yu):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=r)},Gt=(t,e,r)=>{ut(t,r[e*2],r[e*2+1])},Ph=(t,e)=>{let r=0;do r|=t&1,t>>>=1,r<<=1;while(--e>0);return r>>>1},Uy=t=>{t.bi_valid===16?(Ta(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=t.bi_buf&255,t.bi_buf>>=8,t.bi_valid-=8)},jy=(t,e)=>{let r=e.dyn_tree,n=e.max_code,i=e.stat_desc.static_tree,a=e.stat_desc.has_stree,o=e.stat_desc.extra_bits,s=e.stat_desc.extra_base,u=e.stat_desc.max_length,c,l,d,p,f,h,g=0;for(p=0;p<=gn;p++)t.bl_count[p]=0;for(r[t.heap[t.heap_max]*2+1]=0,c=t.heap_max+1;c<xh;c++)l=t.heap[c],p=r[r[l*2+1]*2+1]+1,p>u&&(p=u,g++),r[l*2+1]=p,!(l>n)&&(t.bl_count[p]++,f=0,l>=s&&(f=o[l-s]),h=r[l*2],t.opt_len+=h*(p+f),a&&(t.static_len+=h*(i[l*2+1]+f)));if(g!==0){do{for(p=u-1;t.bl_count[p]===0;)p--;t.bl_count[p]--,t.bl_count[p+1]+=2,t.bl_count[u]--,g-=2}while(g>0);for(p=u;p!==0;p--)for(l=t.bl_count[p];l!==0;)d=t.heap[--c],!(d>n)&&(r[d*2+1]!==p&&(t.opt_len+=(p-r[d*2+1])*r[d*2],r[d*2+1]=p),l--)}},Lh=(t,e,r)=>{let n=new Array(gn+1),i=0,a,o;for(a=1;a<=gn;a++)i=i+r[a-1]<<1,n[a]=i;for(o=0;o<=e;o++){let s=t[o*2+1];s!==0&&(t[o*2]=Ph(n[s]++,s))}},qy=()=>{let t,e,r,n,i,a=new Array(gn+1);for(r=0,n=0;n<sl-1;n++)for(ll[n]=r,t=0;t<1<<Qu[n];t++)ka[r++]=n;for(ka[r-1]=n,i=0,n=0;n<16;n++)for(gs[n]=i,t=0;t<1<<Xo[n];t++)xa[i++]=n;for(i>>=7;n<li;n++)for(gs[n]=i<<7,t=0;t<1<<Xo[n]-7;t++)xa[256+i++]=n;for(e=0;e<=gn;e++)a[e]=0;for(t=0;t<=143;)sr[t*2+1]=8,t++,a[8]++;for(;t<=255;)sr[t*2+1]=9,t++,a[9]++;for(;t<=279;)sr[t*2+1]=7,t++,a[7]++;for(;t<=287;)sr[t*2+1]=8,t++,a[8]++;for(Lh(sr,Ea+1,a),t=0;t<li;t++)ya[t*2+1]=5,ya[t*2]=Ph(t,5);Oh=new vu(sr,Qu,La+1,Ea,gn),Dh=new vu(ya,Xo,0,li,gn),Nh=new vu(new Array(0),Fy,0,cl,$y)},$h=t=>{let e;for(e=0;e<Ea;e++)t.dyn_ltree[e*2]=0;for(e=0;e<li;e++)t.dyn_dtree[e*2]=0;for(e=0;e<cl;e++)t.bl_tree[e*2]=0;t.dyn_ltree[ul*2]=1,t.opt_len=t.static_len=0,t.sym_next=t.matches=0},Fh=t=>{t.bi_valid>8?Ta(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},dd=(t,e,r,n)=>{let i=e*2,a=r*2;return t[i]<t[a]||t[i]===t[a]&&n[e]<=n[r]},_u=(t,e,r)=>{let n=t.heap[r],i=r<<1;for(;i<=t.heap_len&&(i<t.heap_len&&dd(e,t.heap[i+1],t.heap[i],t.depth)&&i++,!dd(e,n,t.heap[i],t.depth));)t.heap[r]=t.heap[i],r=i,i<<=1;t.heap[r]=n},hd=(t,e,r)=>{let n,i,a=0,o,s;if(t.sym_next!==0)do n=t.pending_buf[t.sym_buf+a++]&255,n+=(t.pending_buf[t.sym_buf+a++]&255)<<8,i=t.pending_buf[t.sym_buf+a++],n===0?Gt(t,i,e):(o=ka[i],Gt(t,o+La+1,e),s=Qu[o],s!==0&&(i-=ll[o],ut(t,i,s)),n--,o=Rh(n),Gt(t,o,r),s=Xo[o],s!==0&&(n-=gs[o],ut(t,n,s)));while(a<t.sym_next);Gt(t,ul,e)},Gu=(t,e)=>{let r=e.dyn_tree,n=e.stat_desc.static_tree,i=e.stat_desc.has_stree,a=e.stat_desc.elems,o,s,u=-1,c;for(t.heap_len=0,t.heap_max=xh,o=0;o<a;o++)r[o*2]!==0?(t.heap[++t.heap_len]=u=o,t.depth[o]=0):r[o*2+1]=0;for(;t.heap_len<2;)c=t.heap[++t.heap_len]=u<2?++u:0,r[c*2]=1,t.depth[c]=0,t.opt_len--,i&&(t.static_len-=n[c*2+1]);for(e.max_code=u,o=t.heap_len>>1;o>=1;o--)_u(t,r,o);c=a;do o=t.heap[1],t.heap[1]=t.heap[t.heap_len--],_u(t,r,1),s=t.heap[1],t.heap[--t.heap_max]=o,t.heap[--t.heap_max]=s,r[c*2]=r[o*2]+r[s*2],t.depth[c]=(t.depth[o]>=t.depth[s]?t.depth[o]:t.depth[s])+1,r[o*2+1]=r[s*2+1]=c,t.heap[1]=c++,_u(t,r,1);while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],jy(t,e),Lh(r,u,t.bl_count)},md=(t,e,r)=>{let n,i=-1,a,o=e[0*2+1],s=0,u=7,c=4;for(o===0&&(u=138,c=3),e[(r+1)*2+1]=65535,n=0;n<=r;n++)a=o,o=e[(n+1)*2+1],!(++s<u&&a===o)&&(s<c?t.bl_tree[a*2]+=s:a!==0?(a!==i&&t.bl_tree[a*2]++,t.bl_tree[kh*2]++):s<=10?t.bl_tree[Th*2]++:t.bl_tree[Ah*2]++,s=0,i=a,o===0?(u=138,c=3):a===o?(u=6,c=3):(u=7,c=4))},gd=(t,e,r)=>{let n,i=-1,a,o=e[0*2+1],s=0,u=7,c=4;for(o===0&&(u=138,c=3),n=0;n<=r;n++)if(a=o,o=e[(n+1)*2+1],!(++s<u&&a===o)){if(s<c)do Gt(t,a,t.bl_tree);while(--s!==0);else a!==0?(a!==i&&(Gt(t,a,t.bl_tree),s--),Gt(t,kh,t.bl_tree),ut(t,s-3,2)):s<=10?(Gt(t,Th,t.bl_tree),ut(t,s-3,3)):(Gt(t,Ah,t.bl_tree),ut(t,s-11,7));s=0,i=a,o===0?(u=138,c=3):a===o?(u=6,c=3):(u=7,c=4)}},By=t=>{let e;for(md(t,t.dyn_ltree,t.l_desc.max_code),md(t,t.dyn_dtree,t.d_desc.max_code),Gu(t,t.bl_desc),e=cl-1;e>=3&&t.bl_tree[Ih[e]*2+1]===0;e--);return t.opt_len+=3*(e+1)+5+5+4,e},Vy=(t,e,r,n)=>{let i;for(ut(t,e-257,5),ut(t,r-1,5),ut(t,n-4,4),i=0;i<n;i++)ut(t,t.bl_tree[Ih[i]*2+1],3);gd(t,t.dyn_ltree,e-1),gd(t,t.dyn_dtree,r-1)},zy=t=>{let e=4093624447,r;for(r=0;r<=31;r++,e>>>=1)if(e&1&&t.dyn_ltree[r*2]!==0)return fd;if(t.dyn_ltree[9*2]!==0||t.dyn_ltree[10*2]!==0||t.dyn_ltree[13*2]!==0)return pd;for(r=32;r<La;r++)if(t.dyn_ltree[r*2]!==0)return pd;return fd},yd=!1,Qy=t=>{yd||(qy(),yd=!0),t.l_desc=new bu(t.dyn_ltree,Oh),t.d_desc=new bu(t.dyn_dtree,Dh),t.bl_desc=new bu(t.bl_tree,Nh),t.bi_buf=0,t.bi_valid=0,$h(t)},Mh=(t,e,r,n)=>{ut(t,(Ny<<1)+(n?1:0),3),Fh(t),Ta(t,r),Ta(t,~r),r&&t.pending_buf.set(t.window.subarray(e,e+r),t.pending),t.pending+=r},Gy=t=>{ut(t,Eh<<1,3),Gt(t,ul,sr),Uy(t)},Hy=(t,e,r,n)=>{let i,a,o=0;t.level>0?(t.strm.data_type===Dy&&(t.strm.data_type=zy(t)),Gu(t,t.l_desc),Gu(t,t.d_desc),o=By(t),i=t.opt_len+3+7>>>3,a=t.static_len+3+7>>>3,a<=i&&(i=a)):i=a=r+5,r+4<=i&&e!==-1?Mh(t,e,r,n):t.strategy===Oy||a===i?(ut(t,(Eh<<1)+(n?1:0),3),hd(t,sr,ya)):(ut(t,(Ry<<1)+(n?1:0),3),Vy(t,t.l_desc.max_code+1,t.d_desc.max_code+1,o+1),hd(t,t.dyn_ltree,t.dyn_dtree)),$h(t),n&&Fh(t)},Wy=(t,e,r)=>(t.pending_buf[t.sym_buf+t.sym_next++]=e,t.pending_buf[t.sym_buf+t.sym_next++]=e>>8,t.pending_buf[t.sym_buf+t.sym_next++]=r,e===0?t.dyn_ltree[r*2]++:(t.matches++,e--,t.dyn_ltree[(ka[r]+La+1)*2]++,t.dyn_dtree[Rh(e)*2]++),t.sym_next===t.sym_end),Ky=Qy,Zy=Mh,Yy=Hy,Jy=Wy,Xy=Gy,ev={_tr_init:Ky,_tr_stored_block:Zy,_tr_flush_block:Yy,_tr_tally:Jy,_tr_align:Xy},tv=(t,e,r,n)=>{let i=t&65535|0,a=t>>>16&65535|0,o=0;for(;r!==0;){o=r>2e3?2e3:r,r-=o;do i=i+e[n++]|0,a=a+i|0;while(--o);i%=65521,a%=65521}return i|a<<16|0},Aa=tv,rv=()=>{let t,e=[];for(var r=0;r<256;r++){t=r;for(var n=0;n<8;n++)t=t&1?3988292384^t>>>1:t>>>1;e[r]=t}return e},nv=new Uint32Array(rv()),iv=(t,e,r,n)=>{let i=nv,a=n+r;t^=-1;for(let o=n;o<a;o++)t=t>>>8^i[(t^e[o])&255];return t^-1},je=iv,xn={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},Rn={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8},{_tr_init:av,_tr_stored_block:Hu,_tr_flush_block:ov,_tr_tally:Nr,_tr_align:sv}=ev,{Z_NO_FLUSH:Rr,Z_PARTIAL_FLUSH:cv,Z_FULL_FLUSH:uv,Z_FINISH:xt,Z_BLOCK:vd,Z_OK:Ge,Z_STREAM_END:bd,Z_STREAM_ERROR:Wt,Z_DATA_ERROR:lv,Z_BUF_ERROR:wu,Z_DEFAULT_COMPRESSION:fv,Z_FILTERED:pv,Z_HUFFMAN_ONLY:Mo,Z_RLE:dv,Z_FIXED:hv,Z_DEFAULT_STRATEGY:mv,Z_UNKNOWN:gv,Z_DEFLATED:Is}=Rn,yv=9,vv=15,bv=8,_v=29,wv=256,Wu=wv+1+_v,Sv=30,Cv=19,Ev=2*Wu+1,xv=15,Y=3,Ir=258,Kt=Ir+Y+1,kv=32,hi=42,fl=57,Ku=69,Zu=73,Yu=91,Ju=103,yn=113,fa=666,rt=1,_i=2,kn=3,wi=4,Tv=3,vn=(t,e)=>(t.msg=xn[e],e),_d=t=>t*2-(t>4?9:0),Ar=t=>{let e=t.length;for(;--e>=0;)t[e]=0},Av=t=>{let e,r,n,i=t.w_size;e=t.hash_size,n=e;do r=t.head[--n],t.head[n]=r>=i?r-i:0;while(--e);e=i,n=e;do r=t.prev[--n],t.prev[n]=r>=i?r-i:0;while(--e)},Iv=(t,e,r)=>(e<<t.hash_shift^r)&t.hash_mask,Pr=Iv,mt=t=>{let e=t.state,r=e.pending;r>t.avail_out&&(r=t.avail_out),r!==0&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+r),t.next_out),t.next_out+=r,e.pending_out+=r,t.total_out+=r,t.avail_out-=r,e.pending-=r,e.pending===0&&(e.pending_out=0))},yt=(t,e)=>{ov(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,mt(t.strm)},ae=(t,e)=>{t.pending_buf[t.pending++]=e},Ji=(t,e)=>{t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=e&255},Xu=(t,e,r,n)=>{let i=t.avail_in;return i>n&&(i=n),i===0?0:(t.avail_in-=i,e.set(t.input.subarray(t.next_in,t.next_in+i),r),t.state.wrap===1?t.adler=Aa(t.adler,e,i,r):t.state.wrap===2&&(t.adler=je(t.adler,e,i,r)),t.next_in+=i,t.total_in+=i,i)},Uh=(t,e)=>{let r=t.max_chain_length,n=t.strstart,i,a,o=t.prev_length,s=t.nice_match,u=t.strstart>t.w_size-Kt?t.strstart-(t.w_size-Kt):0,c=t.window,l=t.w_mask,d=t.prev,p=t.strstart+Ir,f=c[n+o-1],h=c[n+o];t.prev_length>=t.good_match&&(r>>=2),s>t.lookahead&&(s=t.lookahead);do if(i=e,!(c[i+o]!==h||c[i+o-1]!==f||c[i]!==c[n]||c[++i]!==c[n+1])){n+=2,i++;do;while(c[++n]===c[++i]&&c[++n]===c[++i]&&c[++n]===c[++i]&&c[++n]===c[++i]&&c[++n]===c[++i]&&c[++n]===c[++i]&&c[++n]===c[++i]&&c[++n]===c[++i]&&n<p);if(a=Ir-(p-n),n=p-Ir,a>o){if(t.match_start=e,o=a,a>=s)break;f=c[n+o-1],h=c[n+o]}}while((e=d[e&l])>u&&--r!==0);return o<=t.lookahead?o:t.lookahead},mi=t=>{let e=t.w_size,r,n,i;do{if(n=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-Kt)&&(t.window.set(t.window.subarray(e,e+e-n),0),t.match_start-=e,t.strstart-=e,t.block_start-=e,t.insert>t.strstart&&(t.insert=t.strstart),Av(t),n+=e),t.strm.avail_in===0)break;if(r=Xu(t.strm,t.window,t.strstart+t.lookahead,n),t.lookahead+=r,t.lookahead+t.insert>=Y)for(i=t.strstart-t.insert,t.ins_h=t.window[i],t.ins_h=Pr(t,t.ins_h,t.window[i+1]);t.insert&&(t.ins_h=Pr(t,t.ins_h,t.window[i+Y-1]),t.prev[i&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=i,i++,t.insert--,!(t.lookahead+t.insert<Y)););}while(t.lookahead<Kt&&t.strm.avail_in!==0)},jh=(t,e)=>{let r=t.pending_buf_size-5>t.w_size?t.w_size:t.pending_buf_size-5,n,i,a,o=0,s=t.strm.avail_in;do{if(n=65535,a=t.bi_valid+42>>3,t.strm.avail_out<a||(a=t.strm.avail_out-a,i=t.strstart-t.block_start,n>i+t.strm.avail_in&&(n=i+t.strm.avail_in),n>a&&(n=a),n<r&&(n===0&&e!==xt||e===Rr||n!==i+t.strm.avail_in)))break;o=e===xt&&n===i+t.strm.avail_in?1:0,Hu(t,0,0,o),t.pending_buf[t.pending-4]=n,t.pending_buf[t.pending-3]=n>>8,t.pending_buf[t.pending-2]=~n,t.pending_buf[t.pending-1]=~n>>8,mt(t.strm),i&&(i>n&&(i=n),t.strm.output.set(t.window.subarray(t.block_start,t.block_start+i),t.strm.next_out),t.strm.next_out+=i,t.strm.avail_out-=i,t.strm.total_out+=i,t.block_start+=i,n-=i),n&&(Xu(t.strm,t.strm.output,t.strm.next_out,n),t.strm.next_out+=n,t.strm.avail_out-=n,t.strm.total_out+=n)}while(o===0);return s-=t.strm.avail_in,s&&(s>=t.w_size?(t.matches=2,t.window.set(t.strm.input.subarray(t.strm.next_in-t.w_size,t.strm.next_in),0),t.strstart=t.w_size,t.insert=t.strstart):(t.window_size-t.strstart<=s&&(t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,t.insert>t.strstart&&(t.insert=t.strstart)),t.window.set(t.strm.input.subarray(t.strm.next_in-s,t.strm.next_in),t.strstart),t.strstart+=s,t.insert+=s>t.w_size-t.insert?t.w_size-t.insert:s),t.block_start=t.strstart),t.high_water<t.strstart&&(t.high_water=t.strstart),o?wi:e!==Rr&&e!==xt&&t.strm.avail_in===0&&t.strstart===t.block_start?_i:(a=t.window_size-t.strstart,t.strm.avail_in>a&&t.block_start>=t.w_size&&(t.block_start-=t.w_size,t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,a+=t.w_size,t.insert>t.strstart&&(t.insert=t.strstart)),a>t.strm.avail_in&&(a=t.strm.avail_in),a&&(Xu(t.strm,t.window,t.strstart,a),t.strstart+=a,t.insert+=a>t.w_size-t.insert?t.w_size-t.insert:a),t.high_water<t.strstart&&(t.high_water=t.strstart),a=t.bi_valid+42>>3,a=t.pending_buf_size-a>65535?65535:t.pending_buf_size-a,r=a>t.w_size?t.w_size:a,i=t.strstart-t.block_start,(i>=r||(i||e===xt)&&e!==Rr&&t.strm.avail_in===0&&i<=a)&&(n=i>a?a:i,o=e===xt&&t.strm.avail_in===0&&n===i?1:0,Hu(t,t.block_start,n,o),t.block_start+=n,mt(t.strm)),o?kn:rt)},Su=(t,e)=>{let r,n;for(;;){if(t.lookahead<Kt){if(mi(t),t.lookahead<Kt&&e===Rr)return rt;if(t.lookahead===0)break}if(r=0,t.lookahead>=Y&&(t.ins_h=Pr(t,t.ins_h,t.window[t.strstart+Y-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),r!==0&&t.strstart-r<=t.w_size-Kt&&(t.match_length=Uh(t,r)),t.match_length>=Y)if(n=Nr(t,t.strstart-t.match_start,t.match_length-Y),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=Y){t.match_length--;do t.strstart++,t.ins_h=Pr(t,t.ins_h,t.window[t.strstart+Y-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart;while(--t.match_length!==0);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=Pr(t,t.ins_h,t.window[t.strstart+1]);else n=Nr(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(yt(t,!1),t.strm.avail_out===0))return rt}return t.insert=t.strstart<Y-1?t.strstart:Y-1,e===xt?(yt(t,!0),t.strm.avail_out===0?kn:wi):t.sym_next&&(yt(t,!1),t.strm.avail_out===0)?rt:_i},oi=(t,e)=>{let r,n,i;for(;;){if(t.lookahead<Kt){if(mi(t),t.lookahead<Kt&&e===Rr)return rt;if(t.lookahead===0)break}if(r=0,t.lookahead>=Y&&(t.ins_h=Pr(t,t.ins_h,t.window[t.strstart+Y-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=Y-1,r!==0&&t.prev_length<t.max_lazy_match&&t.strstart-r<=t.w_size-Kt&&(t.match_length=Uh(t,r),t.match_length<=5&&(t.strategy===pv||t.match_length===Y&&t.strstart-t.match_start>4096)&&(t.match_length=Y-1)),t.prev_length>=Y&&t.match_length<=t.prev_length){i=t.strstart+t.lookahead-Y,n=Nr(t,t.strstart-1-t.prev_match,t.prev_length-Y),t.lookahead-=t.prev_length-1,t.prev_length-=2;do++t.strstart<=i&&(t.ins_h=Pr(t,t.ins_h,t.window[t.strstart+Y-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart);while(--t.prev_length!==0);if(t.match_available=0,t.match_length=Y-1,t.strstart++,n&&(yt(t,!1),t.strm.avail_out===0))return rt}else if(t.match_available){if(n=Nr(t,0,t.window[t.strstart-1]),n&&yt(t,!1),t.strstart++,t.lookahead--,t.strm.avail_out===0)return rt}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=Nr(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<Y-1?t.strstart:Y-1,e===xt?(yt(t,!0),t.strm.avail_out===0?kn:wi):t.sym_next&&(yt(t,!1),t.strm.avail_out===0)?rt:_i},Ov=(t,e)=>{let r,n,i,a,o=t.window;for(;;){if(t.lookahead<=Ir){if(mi(t),t.lookahead<=Ir&&e===Rr)return rt;if(t.lookahead===0)break}if(t.match_length=0,t.lookahead>=Y&&t.strstart>0&&(i=t.strstart-1,n=o[i],n===o[++i]&&n===o[++i]&&n===o[++i])){a=t.strstart+Ir;do;while(n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&i<a);t.match_length=Ir-(a-i),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=Y?(r=Nr(t,1,t.match_length-Y),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=Nr(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&(yt(t,!1),t.strm.avail_out===0))return rt}return t.insert=0,e===xt?(yt(t,!0),t.strm.avail_out===0?kn:wi):t.sym_next&&(yt(t,!1),t.strm.avail_out===0)?rt:_i},Dv=(t,e)=>{let r;for(;;){if(t.lookahead===0&&(mi(t),t.lookahead===0)){if(e===Rr)return rt;break}if(t.match_length=0,r=Nr(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(yt(t,!1),t.strm.avail_out===0))return rt}return t.insert=0,e===xt?(yt(t,!0),t.strm.avail_out===0?kn:wi):t.sym_next&&(yt(t,!1),t.strm.avail_out===0)?rt:_i};function Vt(t,e,r,n,i){this.good_length=t,this.max_lazy=e,this.nice_length=r,this.max_chain=n,this.func=i}var pa=[new Vt(0,0,0,0,jh),new Vt(4,4,8,4,Su),new Vt(4,5,16,8,Su),new Vt(4,6,32,32,Su),new Vt(4,4,16,16,oi),new Vt(8,16,32,32,oi),new Vt(8,16,128,128,oi),new Vt(8,32,128,256,oi),new Vt(32,128,258,1024,oi),new Vt(32,258,258,4096,oi)],Nv=t=>{t.window_size=2*t.w_size,Ar(t.head),t.max_lazy_match=pa[t.level].max_lazy,t.good_match=pa[t.level].good_length,t.nice_match=pa[t.level].nice_length,t.max_chain_length=pa[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=Y-1,t.match_available=0,t.ins_h=0};function Rv(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Is,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(Ev*2),this.dyn_dtree=new Uint16Array((2*Sv+1)*2),this.bl_tree=new Uint16Array((2*Cv+1)*2),Ar(this.dyn_ltree),Ar(this.dyn_dtree),Ar(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(xv+1),this.heap=new Uint16Array(2*Wu+1),Ar(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*Wu+1),Ar(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}var $a=t=>{if(!t)return 1;let e=t.state;return!e||e.strm!==t||e.status!==hi&&e.status!==fl&&e.status!==Ku&&e.status!==Zu&&e.status!==Yu&&e.status!==Ju&&e.status!==yn&&e.status!==fa?1:0},qh=t=>{if($a(t))return vn(t,Wt);t.total_in=t.total_out=0,t.data_type=gv;let e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap===2?fl:e.wrap?hi:yn,t.adler=e.wrap===2?0:1,e.last_flush=-2,av(e),Ge},Bh=t=>{let e=qh(t);return e===Ge&&Nv(t.state),e},Pv=(t,e)=>$a(t)||t.state.wrap!==2?Wt:(t.state.gzhead=e,Ge),Vh=(t,e,r,n,i,a)=>{if(!t)return Wt;let o=1;if(e===fv&&(e=6),n<0?(o=0,n=-n):n>15&&(o=2,n-=16),i<1||i>yv||r!==Is||n<8||n>15||e<0||e>9||a<0||a>hv||n===8&&o!==1)return vn(t,Wt);n===8&&(n=9);let s=new Rv;return t.state=s,s.strm=t,s.status=hi,s.wrap=o,s.gzhead=null,s.w_bits=n,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=i+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+Y-1)/Y),s.window=new Uint8Array(s.w_size*2),s.head=new Uint16Array(s.hash_size),s.prev=new Uint16Array(s.w_size),s.lit_bufsize=1<<i+6,s.pending_buf_size=s.lit_bufsize*4,s.pending_buf=new Uint8Array(s.pending_buf_size),s.sym_buf=s.lit_bufsize,s.sym_end=(s.lit_bufsize-1)*3,s.level=e,s.strategy=a,s.method=r,Bh(t)},Lv=(t,e)=>Vh(t,e,Is,vv,bv,mv),$v=(t,e)=>{if($a(t)||e>vd||e<0)return t?vn(t,Wt):Wt;let r=t.state;if(!t.output||t.avail_in!==0&&!t.input||r.status===fa&&e!==xt)return vn(t,t.avail_out===0?wu:Wt);let n=r.last_flush;if(r.last_flush=e,r.pending!==0){if(mt(t),t.avail_out===0)return r.last_flush=-1,Ge}else if(t.avail_in===0&&_d(e)<=_d(n)&&e!==xt)return vn(t,wu);if(r.status===fa&&t.avail_in!==0)return vn(t,wu);if(r.status===hi&&r.wrap===0&&(r.status=yn),r.status===hi){let i=Is+(r.w_bits-8<<4)<<8,a=-1;if(r.strategy>=Mo||r.level<2?a=0:r.level<6?a=1:r.level===6?a=2:a=3,i|=a<<6,r.strstart!==0&&(i|=kv),i+=31-i%31,Ji(r,i),r.strstart!==0&&(Ji(r,t.adler>>>16),Ji(r,t.adler&65535)),t.adler=1,r.status=yn,mt(t),r.pending!==0)return r.last_flush=-1,Ge}if(r.status===fl){if(t.adler=0,ae(r,31),ae(r,139),ae(r,8),r.gzhead)ae(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),ae(r,r.gzhead.time&255),ae(r,r.gzhead.time>>8&255),ae(r,r.gzhead.time>>16&255),ae(r,r.gzhead.time>>24&255),ae(r,r.level===9?2:r.strategy>=Mo||r.level<2?4:0),ae(r,r.gzhead.os&255),r.gzhead.extra&&r.gzhead.extra.length&&(ae(r,r.gzhead.extra.length&255),ae(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=je(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=Ku;else if(ae(r,0),ae(r,0),ae(r,0),ae(r,0),ae(r,0),ae(r,r.level===9?2:r.strategy>=Mo||r.level<2?4:0),ae(r,Tv),r.status=yn,mt(t),r.pending!==0)return r.last_flush=-1,Ge}if(r.status===Ku){if(r.gzhead.extra){let i=r.pending,a=(r.gzhead.extra.length&65535)-r.gzindex;for(;r.pending+a>r.pending_buf_size;){let s=r.pending_buf_size-r.pending;if(r.pending_buf.set(r.gzhead.extra.subarray(r.gzindex,r.gzindex+s),r.pending),r.pending=r.pending_buf_size,r.gzhead.hcrc&&r.pending>i&&(t.adler=je(t.adler,r.pending_buf,r.pending-i,i)),r.gzindex+=s,mt(t),r.pending!==0)return r.last_flush=-1,Ge;i=0,a-=s}let o=new Uint8Array(r.gzhead.extra);r.pending_buf.set(o.subarray(r.gzindex,r.gzindex+a),r.pending),r.pending+=a,r.gzhead.hcrc&&r.pending>i&&(t.adler=je(t.adler,r.pending_buf,r.pending-i,i)),r.gzindex=0}r.status=Zu}if(r.status===Zu){if(r.gzhead.name){let i=r.pending,a;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>i&&(t.adler=je(t.adler,r.pending_buf,r.pending-i,i)),mt(t),r.pending!==0)return r.last_flush=-1,Ge;i=0}r.gzindex<r.gzhead.name.length?a=r.gzhead.name.charCodeAt(r.gzindex++)&255:a=0,ae(r,a)}while(a!==0);r.gzhead.hcrc&&r.pending>i&&(t.adler=je(t.adler,r.pending_buf,r.pending-i,i)),r.gzindex=0}r.status=Yu}if(r.status===Yu){if(r.gzhead.comment){let i=r.pending,a;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>i&&(t.adler=je(t.adler,r.pending_buf,r.pending-i,i)),mt(t),r.pending!==0)return r.last_flush=-1,Ge;i=0}r.gzindex<r.gzhead.comment.length?a=r.gzhead.comment.charCodeAt(r.gzindex++)&255:a=0,ae(r,a)}while(a!==0);r.gzhead.hcrc&&r.pending>i&&(t.adler=je(t.adler,r.pending_buf,r.pending-i,i))}r.status=Ju}if(r.status===Ju){if(r.gzhead.hcrc){if(r.pending+2>r.pending_buf_size&&(mt(t),r.pending!==0))return r.last_flush=-1,Ge;ae(r,t.adler&255),ae(r,t.adler>>8&255),t.adler=0}if(r.status=yn,mt(t),r.pending!==0)return r.last_flush=-1,Ge}if(t.avail_in!==0||r.lookahead!==0||e!==Rr&&r.status!==fa){let i=r.level===0?jh(r,e):r.strategy===Mo?Dv(r,e):r.strategy===dv?Ov(r,e):pa[r.level].func(r,e);if((i===kn||i===wi)&&(r.status=fa),i===rt||i===kn)return t.avail_out===0&&(r.last_flush=-1),Ge;if(i===_i&&(e===cv?sv(r):e!==vd&&(Hu(r,0,0,!1),e===uv&&(Ar(r.head),r.lookahead===0&&(r.strstart=0,r.block_start=0,r.insert=0))),mt(t),t.avail_out===0))return r.last_flush=-1,Ge}return e!==xt?Ge:r.wrap<=0?bd:(r.wrap===2?(ae(r,t.adler&255),ae(r,t.adler>>8&255),ae(r,t.adler>>16&255),ae(r,t.adler>>24&255),ae(r,t.total_in&255),ae(r,t.total_in>>8&255),ae(r,t.total_in>>16&255),ae(r,t.total_in>>24&255)):(Ji(r,t.adler>>>16),Ji(r,t.adler&65535)),mt(t),r.wrap>0&&(r.wrap=-r.wrap),r.pending!==0?Ge:bd)},Fv=t=>{if($a(t))return Wt;let e=t.state.status;return t.state=null,e===yn?vn(t,lv):Ge},Mv=(t,e)=>{let r=e.length;if($a(t))return Wt;let n=t.state,i=n.wrap;if(i===2||i===1&&n.status!==hi||n.lookahead)return Wt;if(i===1&&(t.adler=Aa(t.adler,e,r,0)),n.wrap=0,r>=n.w_size){i===0&&(Ar(n.head),n.strstart=0,n.block_start=0,n.insert=0);let u=new Uint8Array(n.w_size);u.set(e.subarray(r-n.w_size,r),0),e=u,r=n.w_size}let a=t.avail_in,o=t.next_in,s=t.input;for(t.avail_in=r,t.next_in=0,t.input=e,mi(n);n.lookahead>=Y;){let u=n.strstart,c=n.lookahead-(Y-1);do n.ins_h=Pr(n,n.ins_h,n.window[u+Y-1]),n.prev[u&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=u,u++;while(--c);n.strstart=u,n.lookahead=Y-1,mi(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=Y-1,n.match_available=0,t.next_in=o,t.input=s,t.avail_in=a,n.wrap=i,Ge},Uv=Lv,jv=Vh,qv=Bh,Bv=qh,Vv=Pv,zv=$v,Qv=Fv,Gv=Mv,Hv="pako deflate (from Nodeca project)",va={deflateInit:Uv,deflateInit2:jv,deflateReset:qv,deflateResetKeep:Bv,deflateSetHeader:Vv,deflate:zv,deflateEnd:Qv,deflateSetDictionary:Gv,deflateInfo:Hv},Wv=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),Kv=function(t){let e=Array.prototype.slice.call(arguments,1);for(;e.length;){let r=e.shift();if(!!r){if(typeof r!="object")throw new TypeError(r+"must be non-object");for(let n in r)Wv(r,n)&&(t[n]=r[n])}}return t},Zv=t=>{let e=0;for(let n=0,i=t.length;n<i;n++)e+=t[n].length;let r=new Uint8Array(e);for(let n=0,i=0,a=t.length;n<a;n++){let o=t[n];r.set(o,i),i+=o.length}return r},Os={assign:Kv,flattenChunks:Zv},zh=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){zh=!1}var Ia=new Uint8Array(256);for(let t=0;t<256;t++)Ia[t]=t>=252?6:t>=248?5:t>=240?4:t>=224?3:t>=192?2:1;Ia[254]=Ia[254]=1;var Yv=t=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(t);let e,r,n,i,a,o=t.length,s=0;for(i=0;i<o;i++)r=t.charCodeAt(i),(r&64512)===55296&&i+1<o&&(n=t.charCodeAt(i+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),i++)),s+=r<128?1:r<2048?2:r<65536?3:4;for(e=new Uint8Array(s),a=0,i=0;a<s;i++)r=t.charCodeAt(i),(r&64512)===55296&&i+1<o&&(n=t.charCodeAt(i+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),i++)),r<128?e[a++]=r:r<2048?(e[a++]=192|r>>>6,e[a++]=128|r&63):r<65536?(e[a++]=224|r>>>12,e[a++]=128|r>>>6&63,e[a++]=128|r&63):(e[a++]=240|r>>>18,e[a++]=128|r>>>12&63,e[a++]=128|r>>>6&63,e[a++]=128|r&63);return e},Jv=(t,e)=>{if(e<65534&&t.subarray&&zh)return String.fromCharCode.apply(null,t.length===e?t:t.subarray(0,e));let r="";for(let n=0;n<e;n++)r+=String.fromCharCode(t[n]);return r},Xv=(t,e)=>{let r=e||t.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(t.subarray(0,e));let n,i,a=new Array(r*2);for(i=0,n=0;n<r;){let o=t[n++];if(o<128){a[i++]=o;continue}let s=Ia[o];if(s>4){a[i++]=65533,n+=s-1;continue}for(o&=s===2?31:s===3?15:7;s>1&&n<r;)o=o<<6|t[n++]&63,s--;if(s>1){a[i++]=65533;continue}o<65536?a[i++]=o:(o-=65536,a[i++]=55296|o>>10&1023,a[i++]=56320|o&1023)}return Jv(a,i)},e0=(t,e)=>{e=e||t.length,e>t.length&&(e=t.length);let r=e-1;for(;r>=0&&(t[r]&192)===128;)r--;return r<0||r===0?e:r+Ia[t[r]]>e?r:e},Oa={string2buf:Yv,buf2string:Xv,utf8border:e0};function t0(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var Qh=t0,Gh=Object.prototype.toString,{Z_NO_FLUSH:r0,Z_SYNC_FLUSH:n0,Z_FULL_FLUSH:i0,Z_FINISH:a0,Z_OK:ys,Z_STREAM_END:o0,Z_DEFAULT_COMPRESSION:s0,Z_DEFAULT_STRATEGY:c0,Z_DEFLATED:u0}=Rn;function Fa(t){this.options=Os.assign({level:s0,method:u0,chunkSize:16384,windowBits:15,memLevel:8,strategy:c0},t||{});let e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Qh,this.strm.avail_out=0;let r=va.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(r!==ys)throw new Error(xn[r]);if(e.header&&va.deflateSetHeader(this.strm,e.header),e.dictionary){let n;if(typeof e.dictionary=="string"?n=Oa.string2buf(e.dictionary):Gh.call(e.dictionary)==="[object ArrayBuffer]"?n=new Uint8Array(e.dictionary):n=e.dictionary,r=va.deflateSetDictionary(this.strm,n),r!==ys)throw new Error(xn[r]);this._dict_set=!0}}Fa.prototype.push=function(t,e){let r=this.strm,n=this.options.chunkSize,i,a;if(this.ended)return!1;for(e===~~e?a=e:a=e===!0?a0:r0,typeof t=="string"?r.input=Oa.string2buf(t):Gh.call(t)==="[object ArrayBuffer]"?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;){if(r.avail_out===0&&(r.output=new Uint8Array(n),r.next_out=0,r.avail_out=n),(a===n0||a===i0)&&r.avail_out<=6){this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;continue}if(i=va.deflate(r,a),i===o0)return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),i=va.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===ys;if(r.avail_out===0){this.onData(r.output);continue}if(a>0&&r.next_out>0){this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;continue}if(r.avail_in===0)break}return!0};Fa.prototype.onData=function(t){this.chunks.push(t)};Fa.prototype.onEnd=function(t){t===ys&&(this.result=Os.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function pl(t,e){let r=new Fa(e);if(r.push(t,!0),r.err)throw r.msg||xn[r.err];return r.result}function l0(t,e){return e=e||{},e.raw=!0,pl(t,e)}function f0(t,e){return e=e||{},e.gzip=!0,pl(t,e)}var p0=Fa,d0=pl,h0=l0,m0=f0,g0=Rn,y0={Deflate:p0,deflate:d0,deflateRaw:h0,gzip:m0,constants:g0},Uo=16209,v0=16191,b0=function t(e,r){let n,i,a,o,s,u,c,l,d,p,f,h,g,y,S,b,v,m,A,D,E,O,P,N,j=e.state;n=e.next_in,P=e.input,i=n+(e.avail_in-5),a=e.next_out,N=e.output,o=a-(r-e.avail_out),s=a+(e.avail_out-257),u=j.dmax,c=j.wsize,l=j.whave,d=j.wnext,p=j.window,f=j.hold,h=j.bits,g=j.lencode,y=j.distcode,S=(1<<j.lenbits)-1,b=(1<<j.distbits)-1;e:do{h<15&&(f+=P[n++]<<h,h+=8,f+=P[n++]<<h,h+=8),v=g[f&S];t:for(;;){if(m=v>>>24,f>>>=m,h-=m,m=v>>>16&255,m===0)N[a++]=v&65535;else if(m&16){A=v&65535,m&=15,m&&(h<m&&(f+=P[n++]<<h,h+=8),A+=f&(1<<m)-1,f>>>=m,h-=m),h<15&&(f+=P[n++]<<h,h+=8,f+=P[n++]<<h,h+=8),v=y[f&b];r:for(;;){if(m=v>>>24,f>>>=m,h-=m,m=v>>>16&255,m&16){if(D=v&65535,m&=15,h<m&&(f+=P[n++]<<h,h+=8,h<m&&(f+=P[n++]<<h,h+=8)),D+=f&(1<<m)-1,D>u){e.msg="invalid distance too far back",j.mode=Uo;break e}if(f>>>=m,h-=m,m=a-o,D>m){if(m=D-m,m>l&&j.sane){e.msg="invalid distance too far back",j.mode=Uo;break e}if(E=0,O=p,d===0){if(E+=c-m,m<A){A-=m;do N[a++]=p[E++];while(--m);E=a-D,O=N}}else if(d<m){if(E+=c+d-m,m-=d,m<A){A-=m;do N[a++]=p[E++];while(--m);if(E=0,d<A){m=d,A-=m;do N[a++]=p[E++];while(--m);E=a-D,O=N}}}else if(E+=d-m,m<A){A-=m;do N[a++]=p[E++];while(--m);E=a-D,O=N}for(;A>2;)N[a++]=O[E++],N[a++]=O[E++],N[a++]=O[E++],A-=3;A&&(N[a++]=O[E++],A>1&&(N[a++]=O[E++]))}else{E=a-D;do N[a++]=N[E++],N[a++]=N[E++],N[a++]=N[E++],A-=3;while(A>2);A&&(N[a++]=N[E++],A>1&&(N[a++]=N[E++]))}}else if((m&64)===0){v=y[(v&65535)+(f&(1<<m)-1)];continue r}else{e.msg="invalid distance code",j.mode=Uo;break e}break}}else if((m&64)===0){v=g[(v&65535)+(f&(1<<m)-1)];continue t}else if(m&32){j.mode=v0;break e}else{e.msg="invalid literal/length code",j.mode=Uo;break e}break}}while(n<i&&a<s);A=h>>3,n-=A,h-=A<<3,f&=(1<<h)-1,e.next_in=n,e.next_out=a,e.avail_in=n<i?5+(i-n):5-(n-i),e.avail_out=a<s?257+(s-a):257-(a-s),j.hold=f,j.bits=h},si=15,wd=852,Sd=592,Cd=0,Cu=1,Ed=2,_0=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),w0=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),S0=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),C0=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),E0=(t,e,r,n,i,a,o,s)=>{let u=s.bits,c=0,l=0,d=0,p=0,f=0,h=0,g=0,y=0,S=0,b=0,v,m,A,D,E,O=null,P,N=new Uint16Array(si+1),j=new Uint16Array(si+1),qe=null,Ne,q,de;for(c=0;c<=si;c++)N[c]=0;for(l=0;l<n;l++)N[e[r+l]]++;for(f=u,p=si;p>=1&&N[p]===0;p--);if(f>p&&(f=p),p===0)return i[a++]=1<<24|64<<16|0,i[a++]=1<<24|64<<16|0,s.bits=1,0;for(d=1;d<p&&N[d]===0;d++);for(f<d&&(f=d),y=1,c=1;c<=si;c++)if(y<<=1,y-=N[c],y<0)return-1;if(y>0&&(t===Cd||p!==1))return-1;for(j[1]=0,c=1;c<si;c++)j[c+1]=j[c]+N[c];for(l=0;l<n;l++)e[r+l]!==0&&(o[j[e[r+l]]++]=l);if(t===Cd?(O=qe=o,P=20):t===Cu?(O=_0,qe=w0,P=257):(O=S0,qe=C0,P=0),b=0,l=0,c=d,E=a,h=f,g=0,A=-1,S=1<<f,D=S-1,t===Cu&&S>wd||t===Ed&&S>Sd)return 1;for(;;){Ne=c-g,o[l]+1<P?(q=0,de=o[l]):o[l]>=P?(q=qe[o[l]-P],de=O[o[l]-P]):(q=32+64,de=0),v=1<<c-g,m=1<<h,d=m;do m-=v,i[E+(b>>g)+m]=Ne<<24|q<<16|de|0;while(m!==0);for(v=1<<c-1;b&v;)v>>=1;if(v!==0?(b&=v-1,b+=v):b=0,l++,--N[c]===0){if(c===p)break;c=e[r+o[l]]}if(c>f&&(b&D)!==A){for(g===0&&(g=f),E+=d,h=c-g,y=1<<h;h+g<p&&(y-=N[h+g],!(y<=0));)h++,y<<=1;if(S+=1<<h,t===Cu&&S>wd||t===Ed&&S>Sd)return 1;A=b&D,i[A]=f<<24|h<<16|E-a|0}}return b!==0&&(i[E+b]=c-g<<24|64<<16|0),s.bits=f,0},ba=E0,x0=0,Hh=1,Wh=2,{Z_FINISH:xd,Z_BLOCK:k0,Z_TREES:jo,Z_OK:Tn,Z_STREAM_END:T0,Z_NEED_DICT:A0,Z_STREAM_ERROR:kt,Z_DATA_ERROR:Kh,Z_MEM_ERROR:Zh,Z_BUF_ERROR:I0,Z_DEFLATED:kd}=Rn,Ds=16180,Td=16181,Ad=16182,Id=16183,Od=16184,Dd=16185,Nd=16186,Rd=16187,Pd=16188,Ld=16189,vs=16190,ir=16191,Eu=16192,$d=16193,xu=16194,Fd=16195,Md=16196,Ud=16197,jd=16198,qo=16199,Bo=16200,qd=16201,Bd=16202,Vd=16203,zd=16204,Qd=16205,ku=16206,Gd=16207,Hd=16208,_e=16209,Yh=16210,Jh=16211,O0=852,D0=592,N0=15,R0=N0,Wd=t=>(t>>>24&255)+(t>>>8&65280)+((t&65280)<<8)+((t&255)<<24);function P0(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}var Pn=t=>{if(!t)return 1;let e=t.state;return!e||e.strm!==t||e.mode<Ds||e.mode>Jh?1:0},Xh=t=>{if(Pn(t))return kt;let e=t.state;return t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=e.wrap&1),e.mode=Ds,e.last=0,e.havedict=0,e.flags=-1,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(O0),e.distcode=e.distdyn=new Int32Array(D0),e.sane=1,e.back=-1,Tn},em=t=>{if(Pn(t))return kt;let e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,Xh(t)},tm=(t,e)=>{let r;if(Pn(t))return kt;let n=t.state;return e<0?(r=0,e=-e):(r=(e>>4)+5,e<48&&(e&=15)),e&&(e<8||e>15)?kt:(n.window!==null&&n.wbits!==e&&(n.window=null),n.wrap=r,n.wbits=e,em(t))},rm=(t,e)=>{if(!t)return kt;let r=new P0;t.state=r,r.strm=t,r.window=null,r.mode=Ds;let n=tm(t,e);return n!==Tn&&(t.state=null),n},L0=t=>rm(t,R0),Kd=!0,Tu,Au,$0=t=>{if(Kd){Tu=new Int32Array(512),Au=new Int32Array(32);let e=0;for(;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(ba(Hh,t.lens,0,288,Tu,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;ba(Wh,t.lens,0,32,Au,0,t.work,{bits:5}),Kd=!1}t.lencode=Tu,t.lenbits=9,t.distcode=Au,t.distbits=5},nm=(t,e,r,n)=>{let i,a=t.state;return a.window===null&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new Uint8Array(a.wsize)),n>=a.wsize?(a.window.set(e.subarray(r-a.wsize,r),0),a.wnext=0,a.whave=a.wsize):(i=a.wsize-a.wnext,i>n&&(i=n),a.window.set(e.subarray(r-n,r-n+i),a.wnext),n-=i,n?(a.window.set(e.subarray(r-n,r),0),a.wnext=n,a.whave=a.wsize):(a.wnext+=i,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=i))),0},F0=(t,e)=>{let r,n,i,a,o,s,u,c,l,d,p,f,h,g,y=0,S,b,v,m,A,D,E,O,P=new Uint8Array(4),N,j,qe=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Pn(t)||!t.output||!t.input&&t.avail_in!==0)return kt;r=t.state,r.mode===ir&&(r.mode=Eu),o=t.next_out,i=t.output,u=t.avail_out,a=t.next_in,n=t.input,s=t.avail_in,c=r.hold,l=r.bits,d=s,p=u,O=Tn;e:for(;;)switch(r.mode){case Ds:if(r.wrap===0){r.mode=Eu;break}for(;l<16;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(r.wrap&2&&c===35615){r.wbits===0&&(r.wbits=15),r.check=0,P[0]=c&255,P[1]=c>>>8&255,r.check=je(r.check,P,2,0),c=0,l=0,r.mode=Td;break}if(r.head&&(r.head.done=!1),!(r.wrap&1)||(((c&255)<<8)+(c>>8))%31){t.msg="incorrect header check",r.mode=_e;break}if((c&15)!==kd){t.msg="unknown compression method",r.mode=_e;break}if(c>>>=4,l-=4,E=(c&15)+8,r.wbits===0&&(r.wbits=E),E>15||E>r.wbits){t.msg="invalid window size",r.mode=_e;break}r.dmax=1<<r.wbits,r.flags=0,t.adler=r.check=1,r.mode=c&512?Ld:ir,c=0,l=0;break;case Td:for(;l<16;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(r.flags=c,(r.flags&255)!==kd){t.msg="unknown compression method",r.mode=_e;break}if(r.flags&57344){t.msg="unknown header flags set",r.mode=_e;break}r.head&&(r.head.text=c>>8&1),r.flags&512&&r.wrap&4&&(P[0]=c&255,P[1]=c>>>8&255,r.check=je(r.check,P,2,0)),c=0,l=0,r.mode=Ad;case Ad:for(;l<32;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}r.head&&(r.head.time=c),r.flags&512&&r.wrap&4&&(P[0]=c&255,P[1]=c>>>8&255,P[2]=c>>>16&255,P[3]=c>>>24&255,r.check=je(r.check,P,4,0)),c=0,l=0,r.mode=Id;case Id:for(;l<16;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}r.head&&(r.head.xflags=c&255,r.head.os=c>>8),r.flags&512&&r.wrap&4&&(P[0]=c&255,P[1]=c>>>8&255,r.check=je(r.check,P,2,0)),c=0,l=0,r.mode=Od;case Od:if(r.flags&1024){for(;l<16;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}r.length=c,r.head&&(r.head.extra_len=c),r.flags&512&&r.wrap&4&&(P[0]=c&255,P[1]=c>>>8&255,r.check=je(r.check,P,2,0)),c=0,l=0}else r.head&&(r.head.extra=null);r.mode=Dd;case Dd:if(r.flags&1024&&(f=r.length,f>s&&(f=s),f&&(r.head&&(E=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Uint8Array(r.head.extra_len)),r.head.extra.set(n.subarray(a,a+f),E)),r.flags&512&&r.wrap&4&&(r.check=je(r.check,n,f,a)),s-=f,a+=f,r.length-=f),r.length))break e;r.length=0,r.mode=Nd;case Nd:if(r.flags&2048){if(s===0)break e;f=0;do E=n[a+f++],r.head&&E&&r.length<65536&&(r.head.name+=String.fromCharCode(E));while(E&&f<s);if(r.flags&512&&r.wrap&4&&(r.check=je(r.check,n,f,a)),s-=f,a+=f,E)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=Rd;case Rd:if(r.flags&4096){if(s===0)break e;f=0;do E=n[a+f++],r.head&&E&&r.length<65536&&(r.head.comment+=String.fromCharCode(E));while(E&&f<s);if(r.flags&512&&r.wrap&4&&(r.check=je(r.check,n,f,a)),s-=f,a+=f,E)break e}else r.head&&(r.head.comment=null);r.mode=Pd;case Pd:if(r.flags&512){for(;l<16;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(r.wrap&4&&c!==(r.check&65535)){t.msg="header crc mismatch",r.mode=_e;break}c=0,l=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),t.adler=r.check=0,r.mode=ir;break;case Ld:for(;l<32;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}t.adler=r.check=Wd(c),c=0,l=0,r.mode=vs;case vs:if(r.havedict===0)return t.next_out=o,t.avail_out=u,t.next_in=a,t.avail_in=s,r.hold=c,r.bits=l,A0;t.adler=r.check=1,r.mode=ir;case ir:if(e===k0||e===jo)break e;case Eu:if(r.last){c>>>=l&7,l-=l&7,r.mode=ku;break}for(;l<3;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}switch(r.last=c&1,c>>>=1,l-=1,c&3){case 0:r.mode=$d;break;case 1:if($0(r),r.mode=qo,e===jo){c>>>=2,l-=2;break e}break;case 2:r.mode=Md;break;case 3:t.msg="invalid block type",r.mode=_e}c>>>=2,l-=2;break;case $d:for(c>>>=l&7,l-=l&7;l<32;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if((c&65535)!==(c>>>16^65535)){t.msg="invalid stored block lengths",r.mode=_e;break}if(r.length=c&65535,c=0,l=0,r.mode=xu,e===jo)break e;case xu:r.mode=Fd;case Fd:if(f=r.length,f){if(f>s&&(f=s),f>u&&(f=u),f===0)break e;i.set(n.subarray(a,a+f),o),s-=f,a+=f,u-=f,o+=f,r.length-=f;break}r.mode=ir;break;case Md:for(;l<14;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(r.nlen=(c&31)+257,c>>>=5,l-=5,r.ndist=(c&31)+1,c>>>=5,l-=5,r.ncode=(c&15)+4,c>>>=4,l-=4,r.nlen>286||r.ndist>30){t.msg="too many length or distance symbols",r.mode=_e;break}r.have=0,r.mode=Ud;case Ud:for(;r.have<r.ncode;){for(;l<3;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}r.lens[qe[r.have++]]=c&7,c>>>=3,l-=3}for(;r.have<19;)r.lens[qe[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,N={bits:r.lenbits},O=ba(x0,r.lens,0,19,r.lencode,0,r.work,N),r.lenbits=N.bits,O){t.msg="invalid code lengths set",r.mode=_e;break}r.have=0,r.mode=jd;case jd:for(;r.have<r.nlen+r.ndist;){for(;y=r.lencode[c&(1<<r.lenbits)-1],S=y>>>24,b=y>>>16&255,v=y&65535,!(S<=l);){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(v<16)c>>>=S,l-=S,r.lens[r.have++]=v;else{if(v===16){for(j=S+2;l<j;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(c>>>=S,l-=S,r.have===0){t.msg="invalid bit length repeat",r.mode=_e;break}E=r.lens[r.have-1],f=3+(c&3),c>>>=2,l-=2}else if(v===17){for(j=S+3;l<j;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}c>>>=S,l-=S,E=0,f=3+(c&7),c>>>=3,l-=3}else{for(j=S+7;l<j;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}c>>>=S,l-=S,E=0,f=11+(c&127),c>>>=7,l-=7}if(r.have+f>r.nlen+r.ndist){t.msg="invalid bit length repeat",r.mode=_e;break}for(;f--;)r.lens[r.have++]=E}}if(r.mode===_e)break;if(r.lens[256]===0){t.msg="invalid code -- missing end-of-block",r.mode=_e;break}if(r.lenbits=9,N={bits:r.lenbits},O=ba(Hh,r.lens,0,r.nlen,r.lencode,0,r.work,N),r.lenbits=N.bits,O){t.msg="invalid literal/lengths set",r.mode=_e;break}if(r.distbits=6,r.distcode=r.distdyn,N={bits:r.distbits},O=ba(Wh,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,N),r.distbits=N.bits,O){t.msg="invalid distances set",r.mode=_e;break}if(r.mode=qo,e===jo)break e;case qo:r.mode=Bo;case Bo:if(s>=6&&u>=258){t.next_out=o,t.avail_out=u,t.next_in=a,t.avail_in=s,r.hold=c,r.bits=l,b0(t,p),o=t.next_out,i=t.output,u=t.avail_out,a=t.next_in,n=t.input,s=t.avail_in,c=r.hold,l=r.bits,r.mode===ir&&(r.back=-1);break}for(r.back=0;y=r.lencode[c&(1<<r.lenbits)-1],S=y>>>24,b=y>>>16&255,v=y&65535,!(S<=l);){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(b&&(b&240)===0){for(m=S,A=b,D=v;y=r.lencode[D+((c&(1<<m+A)-1)>>m)],S=y>>>24,b=y>>>16&255,v=y&65535,!(m+S<=l);){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}c>>>=m,l-=m,r.back+=m}if(c>>>=S,l-=S,r.back+=S,r.length=v,b===0){r.mode=Qd;break}if(b&32){r.back=-1,r.mode=ir;break}if(b&64){t.msg="invalid literal/length code",r.mode=_e;break}r.extra=b&15,r.mode=qd;case qd:if(r.extra){for(j=r.extra;l<j;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}r.length+=c&(1<<r.extra)-1,c>>>=r.extra,l-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=Bd;case Bd:for(;y=r.distcode[c&(1<<r.distbits)-1],S=y>>>24,b=y>>>16&255,v=y&65535,!(S<=l);){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if((b&240)===0){for(m=S,A=b,D=v;y=r.distcode[D+((c&(1<<m+A)-1)>>m)],S=y>>>24,b=y>>>16&255,v=y&65535,!(m+S<=l);){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}c>>>=m,l-=m,r.back+=m}if(c>>>=S,l-=S,r.back+=S,b&64){t.msg="invalid distance code",r.mode=_e;break}r.offset=v,r.extra=b&15,r.mode=Vd;case Vd:if(r.extra){for(j=r.extra;l<j;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}r.offset+=c&(1<<r.extra)-1,c>>>=r.extra,l-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){t.msg="invalid distance too far back",r.mode=_e;break}r.mode=zd;case zd:if(u===0)break e;if(f=p-u,r.offset>f){if(f=r.offset-f,f>r.whave&&r.sane){t.msg="invalid distance too far back",r.mode=_e;break}f>r.wnext?(f-=r.wnext,h=r.wsize-f):h=r.wnext-f,f>r.length&&(f=r.length),g=r.window}else g=i,h=o-r.offset,f=r.length;f>u&&(f=u),u-=f,r.length-=f;do i[o++]=g[h++];while(--f);r.length===0&&(r.mode=Bo);break;case Qd:if(u===0)break e;i[o++]=r.length,u--,r.mode=Bo;break;case ku:if(r.wrap){for(;l<32;){if(s===0)break e;s--,c|=n[a++]<<l,l+=8}if(p-=u,t.total_out+=p,r.total+=p,r.wrap&4&&p&&(t.adler=r.check=r.flags?je(r.check,i,p,o-p):Aa(r.check,i,p,o-p)),p=u,r.wrap&4&&(r.flags?c:Wd(c))!==r.check){t.msg="incorrect data check",r.mode=_e;break}c=0,l=0}r.mode=Gd;case Gd:if(r.wrap&&r.flags){for(;l<32;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(r.wrap&4&&c!==(r.total&4294967295)){t.msg="incorrect length check",r.mode=_e;break}c=0,l=0}r.mode=Hd;case Hd:O=T0;break e;case _e:O=Kh;break e;case Yh:return Zh;case Jh:default:return kt}return t.next_out=o,t.avail_out=u,t.next_in=a,t.avail_in=s,r.hold=c,r.bits=l,(r.wsize||p!==t.avail_out&&r.mode<_e&&(r.mode<ku||e!==xd))&&nm(t,t.output,t.next_out,p-t.avail_out),d-=t.avail_in,p-=t.avail_out,t.total_in+=d,t.total_out+=p,r.total+=p,r.wrap&4&&p&&(t.adler=r.check=r.flags?je(r.check,i,p,t.next_out-p):Aa(r.check,i,p,t.next_out-p)),t.data_type=r.bits+(r.last?64:0)+(r.mode===ir?128:0)+(r.mode===qo||r.mode===xu?256:0),(d===0&&p===0||e===xd)&&O===Tn&&(O=I0),O},M0=t=>{if(Pn(t))return kt;let e=t.state;return e.window&&(e.window=null),t.state=null,Tn},U0=(t,e)=>{if(Pn(t))return kt;let r=t.state;return(r.wrap&2)===0?kt:(r.head=e,e.done=!1,Tn)},j0=(t,e)=>{let r=e.length,n,i,a;return Pn(t)||(n=t.state,n.wrap!==0&&n.mode!==vs)?kt:n.mode===vs&&(i=1,i=Aa(i,e,r,0),i!==n.check)?Kh:(a=nm(t,e,r,r),a?(n.mode=Yh,Zh):(n.havedict=1,Tn))},q0=em,B0=tm,V0=Xh,z0=L0,Q0=rm,G0=F0,H0=M0,W0=U0,K0=j0,Z0="pako inflate (from Nodeca project)",cr={inflateReset:q0,inflateReset2:B0,inflateResetKeep:V0,inflateInit:z0,inflateInit2:Q0,inflate:G0,inflateEnd:H0,inflateGetHeader:W0,inflateSetDictionary:K0,inflateInfo:Z0};function Y0(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var J0=Y0,im=Object.prototype.toString,{Z_NO_FLUSH:X0,Z_FINISH:e2,Z_OK:Da,Z_STREAM_END:Iu,Z_NEED_DICT:Ou,Z_STREAM_ERROR:t2,Z_DATA_ERROR:Zd,Z_MEM_ERROR:r2}=Rn;function Ma(t){this.options=Os.assign({chunkSize:1024*64,windowBits:15,to:""},t||{});let e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,e.windowBits===0&&(e.windowBits=-15)),e.windowBits>=0&&e.windowBits<16&&!(t&&t.windowBits)&&(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(e.windowBits&15)===0&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Qh,this.strm.avail_out=0;let r=cr.inflateInit2(this.strm,e.windowBits);if(r!==Da)throw new Error(xn[r]);if(this.header=new J0,cr.inflateGetHeader(this.strm,this.header),e.dictionary&&(typeof e.dictionary=="string"?e.dictionary=Oa.string2buf(e.dictionary):im.call(e.dictionary)==="[object ArrayBuffer]"&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(r=cr.inflateSetDictionary(this.strm,e.dictionary),r!==Da)))throw new Error(xn[r])}Ma.prototype.push=function(t,e){let r=this.strm,n=this.options.chunkSize,i=this.options.dictionary,a,o,s;if(this.ended)return!1;for(e===~~e?o=e:o=e===!0?e2:X0,im.call(t)==="[object ArrayBuffer]"?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;){for(r.avail_out===0&&(r.output=new Uint8Array(n),r.next_out=0,r.avail_out=n),a=cr.inflate(r,o),a===Ou&&i&&(a=cr.inflateSetDictionary(r,i),a===Da?a=cr.inflate(r,o):a===Zd&&(a=Ou));r.avail_in>0&&a===Iu&&r.state.wrap>0&&t[r.next_in]!==0;)cr.inflateReset(r),a=cr.inflate(r,o);switch(a){case t2:case Zd:case Ou:case r2:return this.onEnd(a),this.ended=!0,!1}if(s=r.avail_out,r.next_out&&(r.avail_out===0||a===Iu))if(this.options.to==="string"){let u=Oa.utf8border(r.output,r.next_out),c=r.next_out-u,l=Oa.buf2string(r.output,u);r.next_out=c,r.avail_out=n-c,c&&r.output.set(r.output.subarray(u,u+c),0),this.onData(l)}else this.onData(r.output.length===r.next_out?r.output:r.output.subarray(0,r.next_out));if(!(a===Da&&s===0)){if(a===Iu)return a=cr.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,!0;if(r.avail_in===0)break}}return!0};Ma.prototype.onData=function(t){this.chunks.push(t)};Ma.prototype.onEnd=function(t){t===Da&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Os.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function dl(t,e){let r=new Ma(e);if(r.push(t),r.err)throw r.msg||xn[r.err];return r.result}function n2(t,e){return e=e||{},e.raw=!0,dl(t,e)}var i2=Ma,a2=dl,o2=n2,s2=dl,c2=Rn,u2={Inflate:i2,inflate:a2,inflateRaw:o2,ungzip:s2,constants:c2},{Deflate:l2,deflate:f2,deflateRaw:p2,gzip:d2}=y0,{Inflate:h2,inflate:m2,inflateRaw:g2,ungzip:y2}=u2,v2=l2,b2=f2,_2=p2,w2=d2,S2=h2,C2=m2,E2=g2,x2=y2,k2=Rn,T2={Deflate:v2,deflate:b2,deflateRaw:_2,gzip:w2,Inflate:S2,inflate:C2,inflateRaw:E2,ungzip:x2,constants:k2},ge=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},ye=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},bs=class{constructor(e,r){this.input=e,this.output=r}};ge([w(),ye("design:type",String)],bs.prototype,"input",void 0);ge([w(),ye("design:type",String)],bs.prototype,"output",void 0);bs=ge([He(),ye("design:paramtypes",[String,String])],bs);var _s=class{constructor(e,r){this.input=e,this.output=r}};ge([w(),ye("design:type",String)],_s.prototype,"input",void 0);ge([w(),ye("design:type",String)],_s.prototype,"output",void 0);_s=ge([Z(),ye("design:paramtypes",[String,String])],_s);var jr=class{constructor(e,r,n,i,a){this.name=e,this.modelId=r,this.systemPrompt=n,this.promptExamples=i,this.metaData=a}};ge([w(),ye("design:type",String)],jr.prototype,"name",void 0);ge([w(),ye("design:type",String)],jr.prototype,"modelId",void 0);ge([w(),ye("design:type",String)],jr.prototype,"systemPrompt",void 0);ge([w(),ye("design:type",Array)],jr.prototype,"promptExamples",void 0);ge([w(),ye("design:type",String)],jr.prototype,"metaData",void 0);jr=ge([He(),ye("design:paramtypes",[String,String,String,Array,String])],jr);var Zt=class{constructor(e,r,n,i,a,o,s,u){this.name=e,this.modelId=r,this.taskId=n,this.systemPrompt=i,this.promptExamples=a,this.metaData=o,this.createdAt=s,this.updatedAt=u}};ge([w(),ye("design:type",String)],Zt.prototype,"name",void 0);ge([w(),ye("design:type",String)],Zt.prototype,"modelId",void 0);ge([w(),ye("design:type",String)],Zt.prototype,"taskId",void 0);ge([w(),ye("design:type",String)],Zt.prototype,"systemPrompt",void 0);ge([w(),ye("design:type",Array)],Zt.prototype,"promptExamples",void 0);ge([w(),ye("design:type",String)],Zt.prototype,"metaData",void 0);ge([w(),ye("design:type",String)],Zt.prototype,"createdAt",void 0);ge([w(),ye("design:type",String)],Zt.prototype,"updatedAt",void 0);Zt=ge([Z(),ye("design:paramtypes",[String,String,String,String,Array,String,String,String])],Zt);var An=class{constructor(e,r,n,i,a){this.model=e,this.status=r,this.progress=n,this.downloaded=i,this.loaded=a}};ge([w(),ye("design:type",String)],An.prototype,"model",void 0);ge([w(),ye("design:type",String)],An.prototype,"status",void 0);ge([w(),ye("design:type",Number)],An.prototype,"progress",void 0);ge([w(),ye("design:type",Boolean)],An.prototype,"downloaded",void 0);ge([w(),ye("design:type",Boolean)],An.prototype,"loaded",void 0);An=ge([Z(),ye("design:paramtypes",[String,String,Number,Boolean,Boolean])],An);var A2=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Fe=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Le,es,el=class{constructor(e,r=!0){Le.set(this,void 0),es.set(this,new Map),A2(this,Le,e,"f")}async getModels(){let e=await Fe(this,Le,"f").query({query:C`
|
|
654
|
+
}`,variables:{url:e,interactionCall:r}}));return n}};or=new WeakMap;var Is={};Is.byteLength=xy;Is.toByteArray=Ty;Is.fromByteArray=Oy;var Qt=[],Ct=[],Ey=typeof Uint8Array<"u"?Uint8Array:Array,vu="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(cn=0,fd=vu.length;cn<fd;++cn)Qt[cn]=vu[cn],Ct[vu.charCodeAt(cn)]=cn;var cn,fd;Ct["-".charCodeAt(0)]=62;Ct["_".charCodeAt(0)]=63;function Eh(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var n=r===e?0:4-r%4;return[r,n]}function xy(t){var e=Eh(t),r=e[0],n=e[1];return(r+n)*3/4-n}function ky(t,e,r){return(e+r)*3/4-r}function Ty(t){var e,r=Eh(t),n=r[0],i=r[1],a=new Ey(ky(t,n,i)),o=0,s=i>0?n-4:n,u;for(u=0;u<s;u+=4)e=Ct[t.charCodeAt(u)]<<18|Ct[t.charCodeAt(u+1)]<<12|Ct[t.charCodeAt(u+2)]<<6|Ct[t.charCodeAt(u+3)],a[o++]=e>>16&255,a[o++]=e>>8&255,a[o++]=e&255;return i===2&&(e=Ct[t.charCodeAt(u)]<<2|Ct[t.charCodeAt(u+1)]>>4,a[o++]=e&255),i===1&&(e=Ct[t.charCodeAt(u)]<<10|Ct[t.charCodeAt(u+1)]<<4|Ct[t.charCodeAt(u+2)]>>2,a[o++]=e>>8&255,a[o++]=e&255),a}function Ay(t){return Qt[t>>18&63]+Qt[t>>12&63]+Qt[t>>6&63]+Qt[t&63]}function Iy(t,e,r){for(var n,i=[],a=e;a<r;a+=3)n=(t[a]<<16&16711680)+(t[a+1]<<8&65280)+(t[a+2]&255),i.push(Ay(n));return i.join("")}function Oy(t){for(var e,r=t.length,n=r%3,i=[],a=16383,o=0,s=r-n;o<s;o+=a)i.push(Iy(t,o,o+a>s?s:o+a));return n===1?(e=t[r-1],i.push(Qt[e>>2]+Qt[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],i.push(Qt[e>>10]+Qt[e>>4&63]+Qt[e<<2&63]+"=")),i.join("")}var Dy=4,pd=0,dd=1,Ny=2;function _i(t){let e=t.length;for(;--e>=0;)t[e]=0}var Ry=0,xh=1,Py=2,Ly=3,$y=258,ul=29,$a=256,xa=$a+1+ul,fi=30,ll=19,kh=2*xa+1,yn=15,bu=16,Fy=7,fl=256,Th=16,Ah=17,Ih=18,Hu=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),es=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),My=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),Oh=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Uy=512,sr=new Array((xa+2)*2);_i(sr);var va=new Array(fi*2);_i(va);var ka=new Array(Uy);_i(ka);var Ta=new Array($y-Ly+1);_i(Ta);var pl=new Array(ul);_i(pl);var ys=new Array(fi);_i(ys);function _u(t,e,r,n,i){this.static_tree=t,this.extra_bits=e,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=t&&t.length}var Dh,Nh,Rh;function wu(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}var Ph=t=>t<256?ka[t]:ka[256+(t>>>7)],Aa=(t,e)=>{t.pending_buf[t.pending++]=e&255,t.pending_buf[t.pending++]=e>>>8&255},ut=(t,e,r)=>{t.bi_valid>bu-r?(t.bi_buf|=e<<t.bi_valid&65535,Aa(t,t.bi_buf),t.bi_buf=e>>bu-t.bi_valid,t.bi_valid+=r-bu):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=r)},Gt=(t,e,r)=>{ut(t,r[e*2],r[e*2+1])},Lh=(t,e)=>{let r=0;do r|=t&1,t>>>=1,r<<=1;while(--e>0);return r>>>1},jy=t=>{t.bi_valid===16?(Aa(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=t.bi_buf&255,t.bi_buf>>=8,t.bi_valid-=8)},qy=(t,e)=>{let r=e.dyn_tree,n=e.max_code,i=e.stat_desc.static_tree,a=e.stat_desc.has_stree,o=e.stat_desc.extra_bits,s=e.stat_desc.extra_base,u=e.stat_desc.max_length,c,l,d,p,f,h,g=0;for(p=0;p<=yn;p++)t.bl_count[p]=0;for(r[t.heap[t.heap_max]*2+1]=0,c=t.heap_max+1;c<kh;c++)l=t.heap[c],p=r[r[l*2+1]*2+1]+1,p>u&&(p=u,g++),r[l*2+1]=p,!(l>n)&&(t.bl_count[p]++,f=0,l>=s&&(f=o[l-s]),h=r[l*2],t.opt_len+=h*(p+f),a&&(t.static_len+=h*(i[l*2+1]+f)));if(g!==0){do{for(p=u-1;t.bl_count[p]===0;)p--;t.bl_count[p]--,t.bl_count[p+1]+=2,t.bl_count[u]--,g-=2}while(g>0);for(p=u;p!==0;p--)for(l=t.bl_count[p];l!==0;)d=t.heap[--c],!(d>n)&&(r[d*2+1]!==p&&(t.opt_len+=(p-r[d*2+1])*r[d*2],r[d*2+1]=p),l--)}},$h=(t,e,r)=>{let n=new Array(yn+1),i=0,a,o;for(a=1;a<=yn;a++)i=i+r[a-1]<<1,n[a]=i;for(o=0;o<=e;o++){let s=t[o*2+1];s!==0&&(t[o*2]=Lh(n[s]++,s))}},By=()=>{let t,e,r,n,i,a=new Array(yn+1);for(r=0,n=0;n<ul-1;n++)for(pl[n]=r,t=0;t<1<<Hu[n];t++)Ta[r++]=n;for(Ta[r-1]=n,i=0,n=0;n<16;n++)for(ys[n]=i,t=0;t<1<<es[n];t++)ka[i++]=n;for(i>>=7;n<fi;n++)for(ys[n]=i<<7,t=0;t<1<<es[n]-7;t++)ka[256+i++]=n;for(e=0;e<=yn;e++)a[e]=0;for(t=0;t<=143;)sr[t*2+1]=8,t++,a[8]++;for(;t<=255;)sr[t*2+1]=9,t++,a[9]++;for(;t<=279;)sr[t*2+1]=7,t++,a[7]++;for(;t<=287;)sr[t*2+1]=8,t++,a[8]++;for($h(sr,xa+1,a),t=0;t<fi;t++)va[t*2+1]=5,va[t*2]=Lh(t,5);Dh=new _u(sr,Hu,$a+1,xa,yn),Nh=new _u(va,es,0,fi,yn),Rh=new _u(new Array(0),My,0,ll,Fy)},Fh=t=>{let e;for(e=0;e<xa;e++)t.dyn_ltree[e*2]=0;for(e=0;e<fi;e++)t.dyn_dtree[e*2]=0;for(e=0;e<ll;e++)t.bl_tree[e*2]=0;t.dyn_ltree[fl*2]=1,t.opt_len=t.static_len=0,t.sym_next=t.matches=0},Mh=t=>{t.bi_valid>8?Aa(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},hd=(t,e,r,n)=>{let i=e*2,a=r*2;return t[i]<t[a]||t[i]===t[a]&&n[e]<=n[r]},Su=(t,e,r)=>{let n=t.heap[r],i=r<<1;for(;i<=t.heap_len&&(i<t.heap_len&&hd(e,t.heap[i+1],t.heap[i],t.depth)&&i++,!hd(e,n,t.heap[i],t.depth));)t.heap[r]=t.heap[i],r=i,i<<=1;t.heap[r]=n},md=(t,e,r)=>{let n,i,a=0,o,s;if(t.sym_next!==0)do n=t.pending_buf[t.sym_buf+a++]&255,n+=(t.pending_buf[t.sym_buf+a++]&255)<<8,i=t.pending_buf[t.sym_buf+a++],n===0?Gt(t,i,e):(o=Ta[i],Gt(t,o+$a+1,e),s=Hu[o],s!==0&&(i-=pl[o],ut(t,i,s)),n--,o=Ph(n),Gt(t,o,r),s=es[o],s!==0&&(n-=ys[o],ut(t,n,s)));while(a<t.sym_next);Gt(t,fl,e)},Wu=(t,e)=>{let r=e.dyn_tree,n=e.stat_desc.static_tree,i=e.stat_desc.has_stree,a=e.stat_desc.elems,o,s,u=-1,c;for(t.heap_len=0,t.heap_max=kh,o=0;o<a;o++)r[o*2]!==0?(t.heap[++t.heap_len]=u=o,t.depth[o]=0):r[o*2+1]=0;for(;t.heap_len<2;)c=t.heap[++t.heap_len]=u<2?++u:0,r[c*2]=1,t.depth[c]=0,t.opt_len--,i&&(t.static_len-=n[c*2+1]);for(e.max_code=u,o=t.heap_len>>1;o>=1;o--)Su(t,r,o);c=a;do o=t.heap[1],t.heap[1]=t.heap[t.heap_len--],Su(t,r,1),s=t.heap[1],t.heap[--t.heap_max]=o,t.heap[--t.heap_max]=s,r[c*2]=r[o*2]+r[s*2],t.depth[c]=(t.depth[o]>=t.depth[s]?t.depth[o]:t.depth[s])+1,r[o*2+1]=r[s*2+1]=c,t.heap[1]=c++,Su(t,r,1);while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],qy(t,e),$h(r,u,t.bl_count)},gd=(t,e,r)=>{let n,i=-1,a,o=e[0*2+1],s=0,u=7,c=4;for(o===0&&(u=138,c=3),e[(r+1)*2+1]=65535,n=0;n<=r;n++)a=o,o=e[(n+1)*2+1],!(++s<u&&a===o)&&(s<c?t.bl_tree[a*2]+=s:a!==0?(a!==i&&t.bl_tree[a*2]++,t.bl_tree[Th*2]++):s<=10?t.bl_tree[Ah*2]++:t.bl_tree[Ih*2]++,s=0,i=a,o===0?(u=138,c=3):a===o?(u=6,c=3):(u=7,c=4))},yd=(t,e,r)=>{let n,i=-1,a,o=e[0*2+1],s=0,u=7,c=4;for(o===0&&(u=138,c=3),n=0;n<=r;n++)if(a=o,o=e[(n+1)*2+1],!(++s<u&&a===o)){if(s<c)do Gt(t,a,t.bl_tree);while(--s!==0);else a!==0?(a!==i&&(Gt(t,a,t.bl_tree),s--),Gt(t,Th,t.bl_tree),ut(t,s-3,2)):s<=10?(Gt(t,Ah,t.bl_tree),ut(t,s-3,3)):(Gt(t,Ih,t.bl_tree),ut(t,s-11,7));s=0,i=a,o===0?(u=138,c=3):a===o?(u=6,c=3):(u=7,c=4)}},Vy=t=>{let e;for(gd(t,t.dyn_ltree,t.l_desc.max_code),gd(t,t.dyn_dtree,t.d_desc.max_code),Wu(t,t.bl_desc),e=ll-1;e>=3&&t.bl_tree[Oh[e]*2+1]===0;e--);return t.opt_len+=3*(e+1)+5+5+4,e},zy=(t,e,r,n)=>{let i;for(ut(t,e-257,5),ut(t,r-1,5),ut(t,n-4,4),i=0;i<n;i++)ut(t,t.bl_tree[Oh[i]*2+1],3);yd(t,t.dyn_ltree,e-1),yd(t,t.dyn_dtree,r-1)},Qy=t=>{let e=4093624447,r;for(r=0;r<=31;r++,e>>>=1)if(e&1&&t.dyn_ltree[r*2]!==0)return pd;if(t.dyn_ltree[9*2]!==0||t.dyn_ltree[10*2]!==0||t.dyn_ltree[13*2]!==0)return dd;for(r=32;r<$a;r++)if(t.dyn_ltree[r*2]!==0)return dd;return pd},vd=!1,Gy=t=>{vd||(By(),vd=!0),t.l_desc=new wu(t.dyn_ltree,Dh),t.d_desc=new wu(t.dyn_dtree,Nh),t.bl_desc=new wu(t.bl_tree,Rh),t.bi_buf=0,t.bi_valid=0,Fh(t)},Uh=(t,e,r,n)=>{ut(t,(Ry<<1)+(n?1:0),3),Mh(t),Aa(t,r),Aa(t,~r),r&&t.pending_buf.set(t.window.subarray(e,e+r),t.pending),t.pending+=r},Hy=t=>{ut(t,xh<<1,3),Gt(t,fl,sr),jy(t)},Wy=(t,e,r,n)=>{let i,a,o=0;t.level>0?(t.strm.data_type===Ny&&(t.strm.data_type=Qy(t)),Wu(t,t.l_desc),Wu(t,t.d_desc),o=Vy(t),i=t.opt_len+3+7>>>3,a=t.static_len+3+7>>>3,a<=i&&(i=a)):i=a=r+5,r+4<=i&&e!==-1?Uh(t,e,r,n):t.strategy===Dy||a===i?(ut(t,(xh<<1)+(n?1:0),3),md(t,sr,va)):(ut(t,(Py<<1)+(n?1:0),3),zy(t,t.l_desc.max_code+1,t.d_desc.max_code+1,o+1),md(t,t.dyn_ltree,t.dyn_dtree)),Fh(t),n&&Mh(t)},Ky=(t,e,r)=>(t.pending_buf[t.sym_buf+t.sym_next++]=e,t.pending_buf[t.sym_buf+t.sym_next++]=e>>8,t.pending_buf[t.sym_buf+t.sym_next++]=r,e===0?t.dyn_ltree[r*2]++:(t.matches++,e--,t.dyn_ltree[(Ta[r]+$a+1)*2]++,t.dyn_dtree[Ph(e)*2]++),t.sym_next===t.sym_end),Zy=Gy,Yy=Uh,Jy=Wy,Xy=Ky,ev=Hy,tv={_tr_init:Zy,_tr_stored_block:Yy,_tr_flush_block:Jy,_tr_tally:Xy,_tr_align:ev},rv=(t,e,r,n)=>{let i=t&65535|0,a=t>>>16&65535|0,o=0;for(;r!==0;){o=r>2e3?2e3:r,r-=o;do i=i+e[n++]|0,a=a+i|0;while(--o);i%=65521,a%=65521}return i|a<<16|0},Ia=rv,nv=()=>{let t,e=[];for(var r=0;r<256;r++){t=r;for(var n=0;n<8;n++)t=t&1?3988292384^t>>>1:t>>>1;e[r]=t}return e},iv=new Uint32Array(nv()),av=(t,e,r,n)=>{let i=iv,a=n+r;t^=-1;for(let o=n;o<a;o++)t=t>>>8^i[(t^e[o])&255];return t^-1},je=av,kn={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},Pn={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8},{_tr_init:ov,_tr_stored_block:Ku,_tr_flush_block:sv,_tr_tally:Rr,_tr_align:cv}=tv,{Z_NO_FLUSH:Pr,Z_PARTIAL_FLUSH:uv,Z_FULL_FLUSH:lv,Z_FINISH:xt,Z_BLOCK:bd,Z_OK:Ge,Z_STREAM_END:_d,Z_STREAM_ERROR:Wt,Z_DATA_ERROR:fv,Z_BUF_ERROR:Cu,Z_DEFAULT_COMPRESSION:pv,Z_FILTERED:dv,Z_HUFFMAN_ONLY:Uo,Z_RLE:hv,Z_FIXED:mv,Z_DEFAULT_STRATEGY:gv,Z_UNKNOWN:yv,Z_DEFLATED:Os}=Pn,vv=9,bv=15,_v=8,wv=29,Sv=256,Zu=Sv+1+wv,Cv=30,Ev=19,xv=2*Zu+1,kv=15,Y=3,Or=258,Kt=Or+Y+1,Tv=32,mi=42,dl=57,Yu=69,Ju=73,Xu=91,el=103,vn=113,pa=666,rt=1,wi=2,Tn=3,Si=4,Av=3,bn=(t,e)=>(t.msg=kn[e],e),wd=t=>t*2-(t>4?9:0),Ir=t=>{let e=t.length;for(;--e>=0;)t[e]=0},Iv=t=>{let e,r,n,i=t.w_size;e=t.hash_size,n=e;do r=t.head[--n],t.head[n]=r>=i?r-i:0;while(--e);e=i,n=e;do r=t.prev[--n],t.prev[n]=r>=i?r-i:0;while(--e)},Ov=(t,e,r)=>(e<<t.hash_shift^r)&t.hash_mask,Lr=Ov,mt=t=>{let e=t.state,r=e.pending;r>t.avail_out&&(r=t.avail_out),r!==0&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+r),t.next_out),t.next_out+=r,e.pending_out+=r,t.total_out+=r,t.avail_out-=r,e.pending-=r,e.pending===0&&(e.pending_out=0))},yt=(t,e)=>{sv(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,mt(t.strm)},ae=(t,e)=>{t.pending_buf[t.pending++]=e},Xi=(t,e)=>{t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=e&255},tl=(t,e,r,n)=>{let i=t.avail_in;return i>n&&(i=n),i===0?0:(t.avail_in-=i,e.set(t.input.subarray(t.next_in,t.next_in+i),r),t.state.wrap===1?t.adler=Ia(t.adler,e,i,r):t.state.wrap===2&&(t.adler=je(t.adler,e,i,r)),t.next_in+=i,t.total_in+=i,i)},jh=(t,e)=>{let r=t.max_chain_length,n=t.strstart,i,a,o=t.prev_length,s=t.nice_match,u=t.strstart>t.w_size-Kt?t.strstart-(t.w_size-Kt):0,c=t.window,l=t.w_mask,d=t.prev,p=t.strstart+Or,f=c[n+o-1],h=c[n+o];t.prev_length>=t.good_match&&(r>>=2),s>t.lookahead&&(s=t.lookahead);do if(i=e,!(c[i+o]!==h||c[i+o-1]!==f||c[i]!==c[n]||c[++i]!==c[n+1])){n+=2,i++;do;while(c[++n]===c[++i]&&c[++n]===c[++i]&&c[++n]===c[++i]&&c[++n]===c[++i]&&c[++n]===c[++i]&&c[++n]===c[++i]&&c[++n]===c[++i]&&c[++n]===c[++i]&&n<p);if(a=Or-(p-n),n=p-Or,a>o){if(t.match_start=e,o=a,a>=s)break;f=c[n+o-1],h=c[n+o]}}while((e=d[e&l])>u&&--r!==0);return o<=t.lookahead?o:t.lookahead},gi=t=>{let e=t.w_size,r,n,i;do{if(n=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-Kt)&&(t.window.set(t.window.subarray(e,e+e-n),0),t.match_start-=e,t.strstart-=e,t.block_start-=e,t.insert>t.strstart&&(t.insert=t.strstart),Iv(t),n+=e),t.strm.avail_in===0)break;if(r=tl(t.strm,t.window,t.strstart+t.lookahead,n),t.lookahead+=r,t.lookahead+t.insert>=Y)for(i=t.strstart-t.insert,t.ins_h=t.window[i],t.ins_h=Lr(t,t.ins_h,t.window[i+1]);t.insert&&(t.ins_h=Lr(t,t.ins_h,t.window[i+Y-1]),t.prev[i&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=i,i++,t.insert--,!(t.lookahead+t.insert<Y)););}while(t.lookahead<Kt&&t.strm.avail_in!==0)},qh=(t,e)=>{let r=t.pending_buf_size-5>t.w_size?t.w_size:t.pending_buf_size-5,n,i,a,o=0,s=t.strm.avail_in;do{if(n=65535,a=t.bi_valid+42>>3,t.strm.avail_out<a||(a=t.strm.avail_out-a,i=t.strstart-t.block_start,n>i+t.strm.avail_in&&(n=i+t.strm.avail_in),n>a&&(n=a),n<r&&(n===0&&e!==xt||e===Pr||n!==i+t.strm.avail_in)))break;o=e===xt&&n===i+t.strm.avail_in?1:0,Ku(t,0,0,o),t.pending_buf[t.pending-4]=n,t.pending_buf[t.pending-3]=n>>8,t.pending_buf[t.pending-2]=~n,t.pending_buf[t.pending-1]=~n>>8,mt(t.strm),i&&(i>n&&(i=n),t.strm.output.set(t.window.subarray(t.block_start,t.block_start+i),t.strm.next_out),t.strm.next_out+=i,t.strm.avail_out-=i,t.strm.total_out+=i,t.block_start+=i,n-=i),n&&(tl(t.strm,t.strm.output,t.strm.next_out,n),t.strm.next_out+=n,t.strm.avail_out-=n,t.strm.total_out+=n)}while(o===0);return s-=t.strm.avail_in,s&&(s>=t.w_size?(t.matches=2,t.window.set(t.strm.input.subarray(t.strm.next_in-t.w_size,t.strm.next_in),0),t.strstart=t.w_size,t.insert=t.strstart):(t.window_size-t.strstart<=s&&(t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,t.insert>t.strstart&&(t.insert=t.strstart)),t.window.set(t.strm.input.subarray(t.strm.next_in-s,t.strm.next_in),t.strstart),t.strstart+=s,t.insert+=s>t.w_size-t.insert?t.w_size-t.insert:s),t.block_start=t.strstart),t.high_water<t.strstart&&(t.high_water=t.strstart),o?Si:e!==Pr&&e!==xt&&t.strm.avail_in===0&&t.strstart===t.block_start?wi:(a=t.window_size-t.strstart,t.strm.avail_in>a&&t.block_start>=t.w_size&&(t.block_start-=t.w_size,t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,a+=t.w_size,t.insert>t.strstart&&(t.insert=t.strstart)),a>t.strm.avail_in&&(a=t.strm.avail_in),a&&(tl(t.strm,t.window,t.strstart,a),t.strstart+=a,t.insert+=a>t.w_size-t.insert?t.w_size-t.insert:a),t.high_water<t.strstart&&(t.high_water=t.strstart),a=t.bi_valid+42>>3,a=t.pending_buf_size-a>65535?65535:t.pending_buf_size-a,r=a>t.w_size?t.w_size:a,i=t.strstart-t.block_start,(i>=r||(i||e===xt)&&e!==Pr&&t.strm.avail_in===0&&i<=a)&&(n=i>a?a:i,o=e===xt&&t.strm.avail_in===0&&n===i?1:0,Ku(t,t.block_start,n,o),t.block_start+=n,mt(t.strm)),o?Tn:rt)},Eu=(t,e)=>{let r,n;for(;;){if(t.lookahead<Kt){if(gi(t),t.lookahead<Kt&&e===Pr)return rt;if(t.lookahead===0)break}if(r=0,t.lookahead>=Y&&(t.ins_h=Lr(t,t.ins_h,t.window[t.strstart+Y-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),r!==0&&t.strstart-r<=t.w_size-Kt&&(t.match_length=jh(t,r)),t.match_length>=Y)if(n=Rr(t,t.strstart-t.match_start,t.match_length-Y),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=Y){t.match_length--;do t.strstart++,t.ins_h=Lr(t,t.ins_h,t.window[t.strstart+Y-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart;while(--t.match_length!==0);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=Lr(t,t.ins_h,t.window[t.strstart+1]);else n=Rr(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(yt(t,!1),t.strm.avail_out===0))return rt}return t.insert=t.strstart<Y-1?t.strstart:Y-1,e===xt?(yt(t,!0),t.strm.avail_out===0?Tn:Si):t.sym_next&&(yt(t,!1),t.strm.avail_out===0)?rt:wi},si=(t,e)=>{let r,n,i;for(;;){if(t.lookahead<Kt){if(gi(t),t.lookahead<Kt&&e===Pr)return rt;if(t.lookahead===0)break}if(r=0,t.lookahead>=Y&&(t.ins_h=Lr(t,t.ins_h,t.window[t.strstart+Y-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=Y-1,r!==0&&t.prev_length<t.max_lazy_match&&t.strstart-r<=t.w_size-Kt&&(t.match_length=jh(t,r),t.match_length<=5&&(t.strategy===dv||t.match_length===Y&&t.strstart-t.match_start>4096)&&(t.match_length=Y-1)),t.prev_length>=Y&&t.match_length<=t.prev_length){i=t.strstart+t.lookahead-Y,n=Rr(t,t.strstart-1-t.prev_match,t.prev_length-Y),t.lookahead-=t.prev_length-1,t.prev_length-=2;do++t.strstart<=i&&(t.ins_h=Lr(t,t.ins_h,t.window[t.strstart+Y-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart);while(--t.prev_length!==0);if(t.match_available=0,t.match_length=Y-1,t.strstart++,n&&(yt(t,!1),t.strm.avail_out===0))return rt}else if(t.match_available){if(n=Rr(t,0,t.window[t.strstart-1]),n&&yt(t,!1),t.strstart++,t.lookahead--,t.strm.avail_out===0)return rt}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=Rr(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<Y-1?t.strstart:Y-1,e===xt?(yt(t,!0),t.strm.avail_out===0?Tn:Si):t.sym_next&&(yt(t,!1),t.strm.avail_out===0)?rt:wi},Dv=(t,e)=>{let r,n,i,a,o=t.window;for(;;){if(t.lookahead<=Or){if(gi(t),t.lookahead<=Or&&e===Pr)return rt;if(t.lookahead===0)break}if(t.match_length=0,t.lookahead>=Y&&t.strstart>0&&(i=t.strstart-1,n=o[i],n===o[++i]&&n===o[++i]&&n===o[++i])){a=t.strstart+Or;do;while(n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&i<a);t.match_length=Or-(a-i),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=Y?(r=Rr(t,1,t.match_length-Y),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=Rr(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&(yt(t,!1),t.strm.avail_out===0))return rt}return t.insert=0,e===xt?(yt(t,!0),t.strm.avail_out===0?Tn:Si):t.sym_next&&(yt(t,!1),t.strm.avail_out===0)?rt:wi},Nv=(t,e)=>{let r;for(;;){if(t.lookahead===0&&(gi(t),t.lookahead===0)){if(e===Pr)return rt;break}if(t.match_length=0,r=Rr(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(yt(t,!1),t.strm.avail_out===0))return rt}return t.insert=0,e===xt?(yt(t,!0),t.strm.avail_out===0?Tn:Si):t.sym_next&&(yt(t,!1),t.strm.avail_out===0)?rt:wi};function Vt(t,e,r,n,i){this.good_length=t,this.max_lazy=e,this.nice_length=r,this.max_chain=n,this.func=i}var da=[new Vt(0,0,0,0,qh),new Vt(4,4,8,4,Eu),new Vt(4,5,16,8,Eu),new Vt(4,6,32,32,Eu),new Vt(4,4,16,16,si),new Vt(8,16,32,32,si),new Vt(8,16,128,128,si),new Vt(8,32,128,256,si),new Vt(32,128,258,1024,si),new Vt(32,258,258,4096,si)],Rv=t=>{t.window_size=2*t.w_size,Ir(t.head),t.max_lazy_match=da[t.level].max_lazy,t.good_match=da[t.level].good_length,t.nice_match=da[t.level].nice_length,t.max_chain_length=da[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=Y-1,t.match_available=0,t.ins_h=0};function Pv(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Os,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(xv*2),this.dyn_dtree=new Uint16Array((2*Cv+1)*2),this.bl_tree=new Uint16Array((2*Ev+1)*2),Ir(this.dyn_ltree),Ir(this.dyn_dtree),Ir(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(kv+1),this.heap=new Uint16Array(2*Zu+1),Ir(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*Zu+1),Ir(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}var Fa=t=>{if(!t)return 1;let e=t.state;return!e||e.strm!==t||e.status!==mi&&e.status!==dl&&e.status!==Yu&&e.status!==Ju&&e.status!==Xu&&e.status!==el&&e.status!==vn&&e.status!==pa?1:0},Bh=t=>{if(Fa(t))return bn(t,Wt);t.total_in=t.total_out=0,t.data_type=yv;let e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap===2?dl:e.wrap?mi:vn,t.adler=e.wrap===2?0:1,e.last_flush=-2,ov(e),Ge},Vh=t=>{let e=Bh(t);return e===Ge&&Rv(t.state),e},Lv=(t,e)=>Fa(t)||t.state.wrap!==2?Wt:(t.state.gzhead=e,Ge),zh=(t,e,r,n,i,a)=>{if(!t)return Wt;let o=1;if(e===pv&&(e=6),n<0?(o=0,n=-n):n>15&&(o=2,n-=16),i<1||i>vv||r!==Os||n<8||n>15||e<0||e>9||a<0||a>mv||n===8&&o!==1)return bn(t,Wt);n===8&&(n=9);let s=new Pv;return t.state=s,s.strm=t,s.status=mi,s.wrap=o,s.gzhead=null,s.w_bits=n,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=i+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+Y-1)/Y),s.window=new Uint8Array(s.w_size*2),s.head=new Uint16Array(s.hash_size),s.prev=new Uint16Array(s.w_size),s.lit_bufsize=1<<i+6,s.pending_buf_size=s.lit_bufsize*4,s.pending_buf=new Uint8Array(s.pending_buf_size),s.sym_buf=s.lit_bufsize,s.sym_end=(s.lit_bufsize-1)*3,s.level=e,s.strategy=a,s.method=r,Vh(t)},$v=(t,e)=>zh(t,e,Os,bv,_v,gv),Fv=(t,e)=>{if(Fa(t)||e>bd||e<0)return t?bn(t,Wt):Wt;let r=t.state;if(!t.output||t.avail_in!==0&&!t.input||r.status===pa&&e!==xt)return bn(t,t.avail_out===0?Cu:Wt);let n=r.last_flush;if(r.last_flush=e,r.pending!==0){if(mt(t),t.avail_out===0)return r.last_flush=-1,Ge}else if(t.avail_in===0&&wd(e)<=wd(n)&&e!==xt)return bn(t,Cu);if(r.status===pa&&t.avail_in!==0)return bn(t,Cu);if(r.status===mi&&r.wrap===0&&(r.status=vn),r.status===mi){let i=Os+(r.w_bits-8<<4)<<8,a=-1;if(r.strategy>=Uo||r.level<2?a=0:r.level<6?a=1:r.level===6?a=2:a=3,i|=a<<6,r.strstart!==0&&(i|=Tv),i+=31-i%31,Xi(r,i),r.strstart!==0&&(Xi(r,t.adler>>>16),Xi(r,t.adler&65535)),t.adler=1,r.status=vn,mt(t),r.pending!==0)return r.last_flush=-1,Ge}if(r.status===dl){if(t.adler=0,ae(r,31),ae(r,139),ae(r,8),r.gzhead)ae(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),ae(r,r.gzhead.time&255),ae(r,r.gzhead.time>>8&255),ae(r,r.gzhead.time>>16&255),ae(r,r.gzhead.time>>24&255),ae(r,r.level===9?2:r.strategy>=Uo||r.level<2?4:0),ae(r,r.gzhead.os&255),r.gzhead.extra&&r.gzhead.extra.length&&(ae(r,r.gzhead.extra.length&255),ae(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=je(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=Yu;else if(ae(r,0),ae(r,0),ae(r,0),ae(r,0),ae(r,0),ae(r,r.level===9?2:r.strategy>=Uo||r.level<2?4:0),ae(r,Av),r.status=vn,mt(t),r.pending!==0)return r.last_flush=-1,Ge}if(r.status===Yu){if(r.gzhead.extra){let i=r.pending,a=(r.gzhead.extra.length&65535)-r.gzindex;for(;r.pending+a>r.pending_buf_size;){let s=r.pending_buf_size-r.pending;if(r.pending_buf.set(r.gzhead.extra.subarray(r.gzindex,r.gzindex+s),r.pending),r.pending=r.pending_buf_size,r.gzhead.hcrc&&r.pending>i&&(t.adler=je(t.adler,r.pending_buf,r.pending-i,i)),r.gzindex+=s,mt(t),r.pending!==0)return r.last_flush=-1,Ge;i=0,a-=s}let o=new Uint8Array(r.gzhead.extra);r.pending_buf.set(o.subarray(r.gzindex,r.gzindex+a),r.pending),r.pending+=a,r.gzhead.hcrc&&r.pending>i&&(t.adler=je(t.adler,r.pending_buf,r.pending-i,i)),r.gzindex=0}r.status=Ju}if(r.status===Ju){if(r.gzhead.name){let i=r.pending,a;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>i&&(t.adler=je(t.adler,r.pending_buf,r.pending-i,i)),mt(t),r.pending!==0)return r.last_flush=-1,Ge;i=0}r.gzindex<r.gzhead.name.length?a=r.gzhead.name.charCodeAt(r.gzindex++)&255:a=0,ae(r,a)}while(a!==0);r.gzhead.hcrc&&r.pending>i&&(t.adler=je(t.adler,r.pending_buf,r.pending-i,i)),r.gzindex=0}r.status=Xu}if(r.status===Xu){if(r.gzhead.comment){let i=r.pending,a;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>i&&(t.adler=je(t.adler,r.pending_buf,r.pending-i,i)),mt(t),r.pending!==0)return r.last_flush=-1,Ge;i=0}r.gzindex<r.gzhead.comment.length?a=r.gzhead.comment.charCodeAt(r.gzindex++)&255:a=0,ae(r,a)}while(a!==0);r.gzhead.hcrc&&r.pending>i&&(t.adler=je(t.adler,r.pending_buf,r.pending-i,i))}r.status=el}if(r.status===el){if(r.gzhead.hcrc){if(r.pending+2>r.pending_buf_size&&(mt(t),r.pending!==0))return r.last_flush=-1,Ge;ae(r,t.adler&255),ae(r,t.adler>>8&255),t.adler=0}if(r.status=vn,mt(t),r.pending!==0)return r.last_flush=-1,Ge}if(t.avail_in!==0||r.lookahead!==0||e!==Pr&&r.status!==pa){let i=r.level===0?qh(r,e):r.strategy===Uo?Nv(r,e):r.strategy===hv?Dv(r,e):da[r.level].func(r,e);if((i===Tn||i===Si)&&(r.status=pa),i===rt||i===Tn)return t.avail_out===0&&(r.last_flush=-1),Ge;if(i===wi&&(e===uv?cv(r):e!==bd&&(Ku(r,0,0,!1),e===lv&&(Ir(r.head),r.lookahead===0&&(r.strstart=0,r.block_start=0,r.insert=0))),mt(t),t.avail_out===0))return r.last_flush=-1,Ge}return e!==xt?Ge:r.wrap<=0?_d:(r.wrap===2?(ae(r,t.adler&255),ae(r,t.adler>>8&255),ae(r,t.adler>>16&255),ae(r,t.adler>>24&255),ae(r,t.total_in&255),ae(r,t.total_in>>8&255),ae(r,t.total_in>>16&255),ae(r,t.total_in>>24&255)):(Xi(r,t.adler>>>16),Xi(r,t.adler&65535)),mt(t),r.wrap>0&&(r.wrap=-r.wrap),r.pending!==0?Ge:_d)},Mv=t=>{if(Fa(t))return Wt;let e=t.state.status;return t.state=null,e===vn?bn(t,fv):Ge},Uv=(t,e)=>{let r=e.length;if(Fa(t))return Wt;let n=t.state,i=n.wrap;if(i===2||i===1&&n.status!==mi||n.lookahead)return Wt;if(i===1&&(t.adler=Ia(t.adler,e,r,0)),n.wrap=0,r>=n.w_size){i===0&&(Ir(n.head),n.strstart=0,n.block_start=0,n.insert=0);let u=new Uint8Array(n.w_size);u.set(e.subarray(r-n.w_size,r),0),e=u,r=n.w_size}let a=t.avail_in,o=t.next_in,s=t.input;for(t.avail_in=r,t.next_in=0,t.input=e,gi(n);n.lookahead>=Y;){let u=n.strstart,c=n.lookahead-(Y-1);do n.ins_h=Lr(n,n.ins_h,n.window[u+Y-1]),n.prev[u&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=u,u++;while(--c);n.strstart=u,n.lookahead=Y-1,gi(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=Y-1,n.match_available=0,t.next_in=o,t.input=s,t.avail_in=a,n.wrap=i,Ge},jv=$v,qv=zh,Bv=Vh,Vv=Bh,zv=Lv,Qv=Fv,Gv=Mv,Hv=Uv,Wv="pako deflate (from Nodeca project)",ba={deflateInit:jv,deflateInit2:qv,deflateReset:Bv,deflateResetKeep:Vv,deflateSetHeader:zv,deflate:Qv,deflateEnd:Gv,deflateSetDictionary:Hv,deflateInfo:Wv},Kv=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),Zv=function(t){let e=Array.prototype.slice.call(arguments,1);for(;e.length;){let r=e.shift();if(!!r){if(typeof r!="object")throw new TypeError(r+"must be non-object");for(let n in r)Kv(r,n)&&(t[n]=r[n])}}return t},Yv=t=>{let e=0;for(let n=0,i=t.length;n<i;n++)e+=t[n].length;let r=new Uint8Array(e);for(let n=0,i=0,a=t.length;n<a;n++){let o=t[n];r.set(o,i),i+=o.length}return r},Ds={assign:Zv,flattenChunks:Yv},Qh=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){Qh=!1}var Oa=new Uint8Array(256);for(let t=0;t<256;t++)Oa[t]=t>=252?6:t>=248?5:t>=240?4:t>=224?3:t>=192?2:1;Oa[254]=Oa[254]=1;var Jv=t=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(t);let e,r,n,i,a,o=t.length,s=0;for(i=0;i<o;i++)r=t.charCodeAt(i),(r&64512)===55296&&i+1<o&&(n=t.charCodeAt(i+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),i++)),s+=r<128?1:r<2048?2:r<65536?3:4;for(e=new Uint8Array(s),a=0,i=0;a<s;i++)r=t.charCodeAt(i),(r&64512)===55296&&i+1<o&&(n=t.charCodeAt(i+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),i++)),r<128?e[a++]=r:r<2048?(e[a++]=192|r>>>6,e[a++]=128|r&63):r<65536?(e[a++]=224|r>>>12,e[a++]=128|r>>>6&63,e[a++]=128|r&63):(e[a++]=240|r>>>18,e[a++]=128|r>>>12&63,e[a++]=128|r>>>6&63,e[a++]=128|r&63);return e},Xv=(t,e)=>{if(e<65534&&t.subarray&&Qh)return String.fromCharCode.apply(null,t.length===e?t:t.subarray(0,e));let r="";for(let n=0;n<e;n++)r+=String.fromCharCode(t[n]);return r},e0=(t,e)=>{let r=e||t.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(t.subarray(0,e));let n,i,a=new Array(r*2);for(i=0,n=0;n<r;){let o=t[n++];if(o<128){a[i++]=o;continue}let s=Oa[o];if(s>4){a[i++]=65533,n+=s-1;continue}for(o&=s===2?31:s===3?15:7;s>1&&n<r;)o=o<<6|t[n++]&63,s--;if(s>1){a[i++]=65533;continue}o<65536?a[i++]=o:(o-=65536,a[i++]=55296|o>>10&1023,a[i++]=56320|o&1023)}return Xv(a,i)},t0=(t,e)=>{e=e||t.length,e>t.length&&(e=t.length);let r=e-1;for(;r>=0&&(t[r]&192)===128;)r--;return r<0||r===0?e:r+Oa[t[r]]>e?r:e},Da={string2buf:Jv,buf2string:e0,utf8border:t0};function r0(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var Gh=r0,Hh=Object.prototype.toString,{Z_NO_FLUSH:n0,Z_SYNC_FLUSH:i0,Z_FULL_FLUSH:a0,Z_FINISH:o0,Z_OK:vs,Z_STREAM_END:s0,Z_DEFAULT_COMPRESSION:c0,Z_DEFAULT_STRATEGY:u0,Z_DEFLATED:l0}=Pn;function Ma(t){this.options=Ds.assign({level:c0,method:l0,chunkSize:16384,windowBits:15,memLevel:8,strategy:u0},t||{});let e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Gh,this.strm.avail_out=0;let r=ba.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(r!==vs)throw new Error(kn[r]);if(e.header&&ba.deflateSetHeader(this.strm,e.header),e.dictionary){let n;if(typeof e.dictionary=="string"?n=Da.string2buf(e.dictionary):Hh.call(e.dictionary)==="[object ArrayBuffer]"?n=new Uint8Array(e.dictionary):n=e.dictionary,r=ba.deflateSetDictionary(this.strm,n),r!==vs)throw new Error(kn[r]);this._dict_set=!0}}Ma.prototype.push=function(t,e){let r=this.strm,n=this.options.chunkSize,i,a;if(this.ended)return!1;for(e===~~e?a=e:a=e===!0?o0:n0,typeof t=="string"?r.input=Da.string2buf(t):Hh.call(t)==="[object ArrayBuffer]"?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;){if(r.avail_out===0&&(r.output=new Uint8Array(n),r.next_out=0,r.avail_out=n),(a===i0||a===a0)&&r.avail_out<=6){this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;continue}if(i=ba.deflate(r,a),i===s0)return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),i=ba.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===vs;if(r.avail_out===0){this.onData(r.output);continue}if(a>0&&r.next_out>0){this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;continue}if(r.avail_in===0)break}return!0};Ma.prototype.onData=function(t){this.chunks.push(t)};Ma.prototype.onEnd=function(t){t===vs&&(this.result=Ds.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function hl(t,e){let r=new Ma(e);if(r.push(t,!0),r.err)throw r.msg||kn[r.err];return r.result}function f0(t,e){return e=e||{},e.raw=!0,hl(t,e)}function p0(t,e){return e=e||{},e.gzip=!0,hl(t,e)}var d0=Ma,h0=hl,m0=f0,g0=p0,y0=Pn,v0={Deflate:d0,deflate:h0,deflateRaw:m0,gzip:g0,constants:y0},jo=16209,b0=16191,_0=function t(e,r){let n,i,a,o,s,u,c,l,d,p,f,h,g,y,S,b,v,m,A,D,E,O,P,N,j=e.state;n=e.next_in,P=e.input,i=n+(e.avail_in-5),a=e.next_out,N=e.output,o=a-(r-e.avail_out),s=a+(e.avail_out-257),u=j.dmax,c=j.wsize,l=j.whave,d=j.wnext,p=j.window,f=j.hold,h=j.bits,g=j.lencode,y=j.distcode,S=(1<<j.lenbits)-1,b=(1<<j.distbits)-1;e:do{h<15&&(f+=P[n++]<<h,h+=8,f+=P[n++]<<h,h+=8),v=g[f&S];t:for(;;){if(m=v>>>24,f>>>=m,h-=m,m=v>>>16&255,m===0)N[a++]=v&65535;else if(m&16){A=v&65535,m&=15,m&&(h<m&&(f+=P[n++]<<h,h+=8),A+=f&(1<<m)-1,f>>>=m,h-=m),h<15&&(f+=P[n++]<<h,h+=8,f+=P[n++]<<h,h+=8),v=y[f&b];r:for(;;){if(m=v>>>24,f>>>=m,h-=m,m=v>>>16&255,m&16){if(D=v&65535,m&=15,h<m&&(f+=P[n++]<<h,h+=8,h<m&&(f+=P[n++]<<h,h+=8)),D+=f&(1<<m)-1,D>u){e.msg="invalid distance too far back",j.mode=jo;break e}if(f>>>=m,h-=m,m=a-o,D>m){if(m=D-m,m>l&&j.sane){e.msg="invalid distance too far back",j.mode=jo;break e}if(E=0,O=p,d===0){if(E+=c-m,m<A){A-=m;do N[a++]=p[E++];while(--m);E=a-D,O=N}}else if(d<m){if(E+=c+d-m,m-=d,m<A){A-=m;do N[a++]=p[E++];while(--m);if(E=0,d<A){m=d,A-=m;do N[a++]=p[E++];while(--m);E=a-D,O=N}}}else if(E+=d-m,m<A){A-=m;do N[a++]=p[E++];while(--m);E=a-D,O=N}for(;A>2;)N[a++]=O[E++],N[a++]=O[E++],N[a++]=O[E++],A-=3;A&&(N[a++]=O[E++],A>1&&(N[a++]=O[E++]))}else{E=a-D;do N[a++]=N[E++],N[a++]=N[E++],N[a++]=N[E++],A-=3;while(A>2);A&&(N[a++]=N[E++],A>1&&(N[a++]=N[E++]))}}else if((m&64)===0){v=y[(v&65535)+(f&(1<<m)-1)];continue r}else{e.msg="invalid distance code",j.mode=jo;break e}break}}else if((m&64)===0){v=g[(v&65535)+(f&(1<<m)-1)];continue t}else if(m&32){j.mode=b0;break e}else{e.msg="invalid literal/length code",j.mode=jo;break e}break}}while(n<i&&a<s);A=h>>3,n-=A,h-=A<<3,f&=(1<<h)-1,e.next_in=n,e.next_out=a,e.avail_in=n<i?5+(i-n):5-(n-i),e.avail_out=a<s?257+(s-a):257-(a-s),j.hold=f,j.bits=h},ci=15,Sd=852,Cd=592,Ed=0,xu=1,xd=2,w0=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),S0=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),C0=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),E0=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),x0=(t,e,r,n,i,a,o,s)=>{let u=s.bits,c=0,l=0,d=0,p=0,f=0,h=0,g=0,y=0,S=0,b=0,v,m,A,D,E,O=null,P,N=new Uint16Array(ci+1),j=new Uint16Array(ci+1),qe=null,Ne,q,de;for(c=0;c<=ci;c++)N[c]=0;for(l=0;l<n;l++)N[e[r+l]]++;for(f=u,p=ci;p>=1&&N[p]===0;p--);if(f>p&&(f=p),p===0)return i[a++]=1<<24|64<<16|0,i[a++]=1<<24|64<<16|0,s.bits=1,0;for(d=1;d<p&&N[d]===0;d++);for(f<d&&(f=d),y=1,c=1;c<=ci;c++)if(y<<=1,y-=N[c],y<0)return-1;if(y>0&&(t===Ed||p!==1))return-1;for(j[1]=0,c=1;c<ci;c++)j[c+1]=j[c]+N[c];for(l=0;l<n;l++)e[r+l]!==0&&(o[j[e[r+l]]++]=l);if(t===Ed?(O=qe=o,P=20):t===xu?(O=w0,qe=S0,P=257):(O=C0,qe=E0,P=0),b=0,l=0,c=d,E=a,h=f,g=0,A=-1,S=1<<f,D=S-1,t===xu&&S>Sd||t===xd&&S>Cd)return 1;for(;;){Ne=c-g,o[l]+1<P?(q=0,de=o[l]):o[l]>=P?(q=qe[o[l]-P],de=O[o[l]-P]):(q=32+64,de=0),v=1<<c-g,m=1<<h,d=m;do m-=v,i[E+(b>>g)+m]=Ne<<24|q<<16|de|0;while(m!==0);for(v=1<<c-1;b&v;)v>>=1;if(v!==0?(b&=v-1,b+=v):b=0,l++,--N[c]===0){if(c===p)break;c=e[r+o[l]]}if(c>f&&(b&D)!==A){for(g===0&&(g=f),E+=d,h=c-g,y=1<<h;h+g<p&&(y-=N[h+g],!(y<=0));)h++,y<<=1;if(S+=1<<h,t===xu&&S>Sd||t===xd&&S>Cd)return 1;A=b&D,i[A]=f<<24|h<<16|E-a|0}}return b!==0&&(i[E+b]=c-g<<24|64<<16|0),s.bits=f,0},_a=x0,k0=0,Wh=1,Kh=2,{Z_FINISH:kd,Z_BLOCK:T0,Z_TREES:qo,Z_OK:An,Z_STREAM_END:A0,Z_NEED_DICT:I0,Z_STREAM_ERROR:kt,Z_DATA_ERROR:Zh,Z_MEM_ERROR:Yh,Z_BUF_ERROR:O0,Z_DEFLATED:Td}=Pn,Ns=16180,Ad=16181,Id=16182,Od=16183,Dd=16184,Nd=16185,Rd=16186,Pd=16187,Ld=16188,$d=16189,bs=16190,ir=16191,ku=16192,Fd=16193,Tu=16194,Md=16195,Ud=16196,jd=16197,qd=16198,Bo=16199,Vo=16200,Bd=16201,Vd=16202,zd=16203,Qd=16204,Gd=16205,Au=16206,Hd=16207,Wd=16208,_e=16209,Jh=16210,Xh=16211,D0=852,N0=592,R0=15,P0=R0,Kd=t=>(t>>>24&255)+(t>>>8&65280)+((t&65280)<<8)+((t&255)<<24);function L0(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}var Ln=t=>{if(!t)return 1;let e=t.state;return!e||e.strm!==t||e.mode<Ns||e.mode>Xh?1:0},em=t=>{if(Ln(t))return kt;let e=t.state;return t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=e.wrap&1),e.mode=Ns,e.last=0,e.havedict=0,e.flags=-1,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(D0),e.distcode=e.distdyn=new Int32Array(N0),e.sane=1,e.back=-1,An},tm=t=>{if(Ln(t))return kt;let e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,em(t)},rm=(t,e)=>{let r;if(Ln(t))return kt;let n=t.state;return e<0?(r=0,e=-e):(r=(e>>4)+5,e<48&&(e&=15)),e&&(e<8||e>15)?kt:(n.window!==null&&n.wbits!==e&&(n.window=null),n.wrap=r,n.wbits=e,tm(t))},nm=(t,e)=>{if(!t)return kt;let r=new L0;t.state=r,r.strm=t,r.window=null,r.mode=Ns;let n=rm(t,e);return n!==An&&(t.state=null),n},$0=t=>nm(t,P0),Zd=!0,Iu,Ou,F0=t=>{if(Zd){Iu=new Int32Array(512),Ou=new Int32Array(32);let e=0;for(;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(_a(Wh,t.lens,0,288,Iu,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;_a(Kh,t.lens,0,32,Ou,0,t.work,{bits:5}),Zd=!1}t.lencode=Iu,t.lenbits=9,t.distcode=Ou,t.distbits=5},im=(t,e,r,n)=>{let i,a=t.state;return a.window===null&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new Uint8Array(a.wsize)),n>=a.wsize?(a.window.set(e.subarray(r-a.wsize,r),0),a.wnext=0,a.whave=a.wsize):(i=a.wsize-a.wnext,i>n&&(i=n),a.window.set(e.subarray(r-n,r-n+i),a.wnext),n-=i,n?(a.window.set(e.subarray(r-n,r),0),a.wnext=n,a.whave=a.wsize):(a.wnext+=i,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=i))),0},M0=(t,e)=>{let r,n,i,a,o,s,u,c,l,d,p,f,h,g,y=0,S,b,v,m,A,D,E,O,P=new Uint8Array(4),N,j,qe=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Ln(t)||!t.output||!t.input&&t.avail_in!==0)return kt;r=t.state,r.mode===ir&&(r.mode=ku),o=t.next_out,i=t.output,u=t.avail_out,a=t.next_in,n=t.input,s=t.avail_in,c=r.hold,l=r.bits,d=s,p=u,O=An;e:for(;;)switch(r.mode){case Ns:if(r.wrap===0){r.mode=ku;break}for(;l<16;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(r.wrap&2&&c===35615){r.wbits===0&&(r.wbits=15),r.check=0,P[0]=c&255,P[1]=c>>>8&255,r.check=je(r.check,P,2,0),c=0,l=0,r.mode=Ad;break}if(r.head&&(r.head.done=!1),!(r.wrap&1)||(((c&255)<<8)+(c>>8))%31){t.msg="incorrect header check",r.mode=_e;break}if((c&15)!==Td){t.msg="unknown compression method",r.mode=_e;break}if(c>>>=4,l-=4,E=(c&15)+8,r.wbits===0&&(r.wbits=E),E>15||E>r.wbits){t.msg="invalid window size",r.mode=_e;break}r.dmax=1<<r.wbits,r.flags=0,t.adler=r.check=1,r.mode=c&512?$d:ir,c=0,l=0;break;case Ad:for(;l<16;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(r.flags=c,(r.flags&255)!==Td){t.msg="unknown compression method",r.mode=_e;break}if(r.flags&57344){t.msg="unknown header flags set",r.mode=_e;break}r.head&&(r.head.text=c>>8&1),r.flags&512&&r.wrap&4&&(P[0]=c&255,P[1]=c>>>8&255,r.check=je(r.check,P,2,0)),c=0,l=0,r.mode=Id;case Id:for(;l<32;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}r.head&&(r.head.time=c),r.flags&512&&r.wrap&4&&(P[0]=c&255,P[1]=c>>>8&255,P[2]=c>>>16&255,P[3]=c>>>24&255,r.check=je(r.check,P,4,0)),c=0,l=0,r.mode=Od;case Od:for(;l<16;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}r.head&&(r.head.xflags=c&255,r.head.os=c>>8),r.flags&512&&r.wrap&4&&(P[0]=c&255,P[1]=c>>>8&255,r.check=je(r.check,P,2,0)),c=0,l=0,r.mode=Dd;case Dd:if(r.flags&1024){for(;l<16;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}r.length=c,r.head&&(r.head.extra_len=c),r.flags&512&&r.wrap&4&&(P[0]=c&255,P[1]=c>>>8&255,r.check=je(r.check,P,2,0)),c=0,l=0}else r.head&&(r.head.extra=null);r.mode=Nd;case Nd:if(r.flags&1024&&(f=r.length,f>s&&(f=s),f&&(r.head&&(E=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Uint8Array(r.head.extra_len)),r.head.extra.set(n.subarray(a,a+f),E)),r.flags&512&&r.wrap&4&&(r.check=je(r.check,n,f,a)),s-=f,a+=f,r.length-=f),r.length))break e;r.length=0,r.mode=Rd;case Rd:if(r.flags&2048){if(s===0)break e;f=0;do E=n[a+f++],r.head&&E&&r.length<65536&&(r.head.name+=String.fromCharCode(E));while(E&&f<s);if(r.flags&512&&r.wrap&4&&(r.check=je(r.check,n,f,a)),s-=f,a+=f,E)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=Pd;case Pd:if(r.flags&4096){if(s===0)break e;f=0;do E=n[a+f++],r.head&&E&&r.length<65536&&(r.head.comment+=String.fromCharCode(E));while(E&&f<s);if(r.flags&512&&r.wrap&4&&(r.check=je(r.check,n,f,a)),s-=f,a+=f,E)break e}else r.head&&(r.head.comment=null);r.mode=Ld;case Ld:if(r.flags&512){for(;l<16;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(r.wrap&4&&c!==(r.check&65535)){t.msg="header crc mismatch",r.mode=_e;break}c=0,l=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),t.adler=r.check=0,r.mode=ir;break;case $d:for(;l<32;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}t.adler=r.check=Kd(c),c=0,l=0,r.mode=bs;case bs:if(r.havedict===0)return t.next_out=o,t.avail_out=u,t.next_in=a,t.avail_in=s,r.hold=c,r.bits=l,I0;t.adler=r.check=1,r.mode=ir;case ir:if(e===T0||e===qo)break e;case ku:if(r.last){c>>>=l&7,l-=l&7,r.mode=Au;break}for(;l<3;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}switch(r.last=c&1,c>>>=1,l-=1,c&3){case 0:r.mode=Fd;break;case 1:if(F0(r),r.mode=Bo,e===qo){c>>>=2,l-=2;break e}break;case 2:r.mode=Ud;break;case 3:t.msg="invalid block type",r.mode=_e}c>>>=2,l-=2;break;case Fd:for(c>>>=l&7,l-=l&7;l<32;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if((c&65535)!==(c>>>16^65535)){t.msg="invalid stored block lengths",r.mode=_e;break}if(r.length=c&65535,c=0,l=0,r.mode=Tu,e===qo)break e;case Tu:r.mode=Md;case Md:if(f=r.length,f){if(f>s&&(f=s),f>u&&(f=u),f===0)break e;i.set(n.subarray(a,a+f),o),s-=f,a+=f,u-=f,o+=f,r.length-=f;break}r.mode=ir;break;case Ud:for(;l<14;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(r.nlen=(c&31)+257,c>>>=5,l-=5,r.ndist=(c&31)+1,c>>>=5,l-=5,r.ncode=(c&15)+4,c>>>=4,l-=4,r.nlen>286||r.ndist>30){t.msg="too many length or distance symbols",r.mode=_e;break}r.have=0,r.mode=jd;case jd:for(;r.have<r.ncode;){for(;l<3;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}r.lens[qe[r.have++]]=c&7,c>>>=3,l-=3}for(;r.have<19;)r.lens[qe[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,N={bits:r.lenbits},O=_a(k0,r.lens,0,19,r.lencode,0,r.work,N),r.lenbits=N.bits,O){t.msg="invalid code lengths set",r.mode=_e;break}r.have=0,r.mode=qd;case qd:for(;r.have<r.nlen+r.ndist;){for(;y=r.lencode[c&(1<<r.lenbits)-1],S=y>>>24,b=y>>>16&255,v=y&65535,!(S<=l);){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(v<16)c>>>=S,l-=S,r.lens[r.have++]=v;else{if(v===16){for(j=S+2;l<j;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(c>>>=S,l-=S,r.have===0){t.msg="invalid bit length repeat",r.mode=_e;break}E=r.lens[r.have-1],f=3+(c&3),c>>>=2,l-=2}else if(v===17){for(j=S+3;l<j;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}c>>>=S,l-=S,E=0,f=3+(c&7),c>>>=3,l-=3}else{for(j=S+7;l<j;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}c>>>=S,l-=S,E=0,f=11+(c&127),c>>>=7,l-=7}if(r.have+f>r.nlen+r.ndist){t.msg="invalid bit length repeat",r.mode=_e;break}for(;f--;)r.lens[r.have++]=E}}if(r.mode===_e)break;if(r.lens[256]===0){t.msg="invalid code -- missing end-of-block",r.mode=_e;break}if(r.lenbits=9,N={bits:r.lenbits},O=_a(Wh,r.lens,0,r.nlen,r.lencode,0,r.work,N),r.lenbits=N.bits,O){t.msg="invalid literal/lengths set",r.mode=_e;break}if(r.distbits=6,r.distcode=r.distdyn,N={bits:r.distbits},O=_a(Kh,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,N),r.distbits=N.bits,O){t.msg="invalid distances set",r.mode=_e;break}if(r.mode=Bo,e===qo)break e;case Bo:r.mode=Vo;case Vo:if(s>=6&&u>=258){t.next_out=o,t.avail_out=u,t.next_in=a,t.avail_in=s,r.hold=c,r.bits=l,_0(t,p),o=t.next_out,i=t.output,u=t.avail_out,a=t.next_in,n=t.input,s=t.avail_in,c=r.hold,l=r.bits,r.mode===ir&&(r.back=-1);break}for(r.back=0;y=r.lencode[c&(1<<r.lenbits)-1],S=y>>>24,b=y>>>16&255,v=y&65535,!(S<=l);){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(b&&(b&240)===0){for(m=S,A=b,D=v;y=r.lencode[D+((c&(1<<m+A)-1)>>m)],S=y>>>24,b=y>>>16&255,v=y&65535,!(m+S<=l);){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}c>>>=m,l-=m,r.back+=m}if(c>>>=S,l-=S,r.back+=S,r.length=v,b===0){r.mode=Gd;break}if(b&32){r.back=-1,r.mode=ir;break}if(b&64){t.msg="invalid literal/length code",r.mode=_e;break}r.extra=b&15,r.mode=Bd;case Bd:if(r.extra){for(j=r.extra;l<j;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}r.length+=c&(1<<r.extra)-1,c>>>=r.extra,l-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=Vd;case Vd:for(;y=r.distcode[c&(1<<r.distbits)-1],S=y>>>24,b=y>>>16&255,v=y&65535,!(S<=l);){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if((b&240)===0){for(m=S,A=b,D=v;y=r.distcode[D+((c&(1<<m+A)-1)>>m)],S=y>>>24,b=y>>>16&255,v=y&65535,!(m+S<=l);){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}c>>>=m,l-=m,r.back+=m}if(c>>>=S,l-=S,r.back+=S,b&64){t.msg="invalid distance code",r.mode=_e;break}r.offset=v,r.extra=b&15,r.mode=zd;case zd:if(r.extra){for(j=r.extra;l<j;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}r.offset+=c&(1<<r.extra)-1,c>>>=r.extra,l-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){t.msg="invalid distance too far back",r.mode=_e;break}r.mode=Qd;case Qd:if(u===0)break e;if(f=p-u,r.offset>f){if(f=r.offset-f,f>r.whave&&r.sane){t.msg="invalid distance too far back",r.mode=_e;break}f>r.wnext?(f-=r.wnext,h=r.wsize-f):h=r.wnext-f,f>r.length&&(f=r.length),g=r.window}else g=i,h=o-r.offset,f=r.length;f>u&&(f=u),u-=f,r.length-=f;do i[o++]=g[h++];while(--f);r.length===0&&(r.mode=Vo);break;case Gd:if(u===0)break e;i[o++]=r.length,u--,r.mode=Vo;break;case Au:if(r.wrap){for(;l<32;){if(s===0)break e;s--,c|=n[a++]<<l,l+=8}if(p-=u,t.total_out+=p,r.total+=p,r.wrap&4&&p&&(t.adler=r.check=r.flags?je(r.check,i,p,o-p):Ia(r.check,i,p,o-p)),p=u,r.wrap&4&&(r.flags?c:Kd(c))!==r.check){t.msg="incorrect data check",r.mode=_e;break}c=0,l=0}r.mode=Hd;case Hd:if(r.wrap&&r.flags){for(;l<32;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(r.wrap&4&&c!==(r.total&4294967295)){t.msg="incorrect length check",r.mode=_e;break}c=0,l=0}r.mode=Wd;case Wd:O=A0;break e;case _e:O=Zh;break e;case Jh:return Yh;case Xh:default:return kt}return t.next_out=o,t.avail_out=u,t.next_in=a,t.avail_in=s,r.hold=c,r.bits=l,(r.wsize||p!==t.avail_out&&r.mode<_e&&(r.mode<Au||e!==kd))&&im(t,t.output,t.next_out,p-t.avail_out),d-=t.avail_in,p-=t.avail_out,t.total_in+=d,t.total_out+=p,r.total+=p,r.wrap&4&&p&&(t.adler=r.check=r.flags?je(r.check,i,p,t.next_out-p):Ia(r.check,i,p,t.next_out-p)),t.data_type=r.bits+(r.last?64:0)+(r.mode===ir?128:0)+(r.mode===Bo||r.mode===Tu?256:0),(d===0&&p===0||e===kd)&&O===An&&(O=O0),O},U0=t=>{if(Ln(t))return kt;let e=t.state;return e.window&&(e.window=null),t.state=null,An},j0=(t,e)=>{if(Ln(t))return kt;let r=t.state;return(r.wrap&2)===0?kt:(r.head=e,e.done=!1,An)},q0=(t,e)=>{let r=e.length,n,i,a;return Ln(t)||(n=t.state,n.wrap!==0&&n.mode!==bs)?kt:n.mode===bs&&(i=1,i=Ia(i,e,r,0),i!==n.check)?Zh:(a=im(t,e,r,r),a?(n.mode=Jh,Yh):(n.havedict=1,An))},B0=tm,V0=rm,z0=em,Q0=$0,G0=nm,H0=M0,W0=U0,K0=j0,Z0=q0,Y0="pako inflate (from Nodeca project)",cr={inflateReset:B0,inflateReset2:V0,inflateResetKeep:z0,inflateInit:Q0,inflateInit2:G0,inflate:H0,inflateEnd:W0,inflateGetHeader:K0,inflateSetDictionary:Z0,inflateInfo:Y0};function J0(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var X0=J0,am=Object.prototype.toString,{Z_NO_FLUSH:e2,Z_FINISH:t2,Z_OK:Na,Z_STREAM_END:Du,Z_NEED_DICT:Nu,Z_STREAM_ERROR:r2,Z_DATA_ERROR:Yd,Z_MEM_ERROR:n2}=Pn;function Ua(t){this.options=Ds.assign({chunkSize:1024*64,windowBits:15,to:""},t||{});let e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,e.windowBits===0&&(e.windowBits=-15)),e.windowBits>=0&&e.windowBits<16&&!(t&&t.windowBits)&&(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(e.windowBits&15)===0&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Gh,this.strm.avail_out=0;let r=cr.inflateInit2(this.strm,e.windowBits);if(r!==Na)throw new Error(kn[r]);if(this.header=new X0,cr.inflateGetHeader(this.strm,this.header),e.dictionary&&(typeof e.dictionary=="string"?e.dictionary=Da.string2buf(e.dictionary):am.call(e.dictionary)==="[object ArrayBuffer]"&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(r=cr.inflateSetDictionary(this.strm,e.dictionary),r!==Na)))throw new Error(kn[r])}Ua.prototype.push=function(t,e){let r=this.strm,n=this.options.chunkSize,i=this.options.dictionary,a,o,s;if(this.ended)return!1;for(e===~~e?o=e:o=e===!0?t2:e2,am.call(t)==="[object ArrayBuffer]"?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;){for(r.avail_out===0&&(r.output=new Uint8Array(n),r.next_out=0,r.avail_out=n),a=cr.inflate(r,o),a===Nu&&i&&(a=cr.inflateSetDictionary(r,i),a===Na?a=cr.inflate(r,o):a===Yd&&(a=Nu));r.avail_in>0&&a===Du&&r.state.wrap>0&&t[r.next_in]!==0;)cr.inflateReset(r),a=cr.inflate(r,o);switch(a){case r2:case Yd:case Nu:case n2:return this.onEnd(a),this.ended=!0,!1}if(s=r.avail_out,r.next_out&&(r.avail_out===0||a===Du))if(this.options.to==="string"){let u=Da.utf8border(r.output,r.next_out),c=r.next_out-u,l=Da.buf2string(r.output,u);r.next_out=c,r.avail_out=n-c,c&&r.output.set(r.output.subarray(u,u+c),0),this.onData(l)}else this.onData(r.output.length===r.next_out?r.output:r.output.subarray(0,r.next_out));if(!(a===Na&&s===0)){if(a===Du)return a=cr.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,!0;if(r.avail_in===0)break}}return!0};Ua.prototype.onData=function(t){this.chunks.push(t)};Ua.prototype.onEnd=function(t){t===Na&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Ds.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function ml(t,e){let r=new Ua(e);if(r.push(t),r.err)throw r.msg||kn[r.err];return r.result}function i2(t,e){return e=e||{},e.raw=!0,ml(t,e)}var a2=Ua,o2=ml,s2=i2,c2=ml,u2=Pn,l2={Inflate:a2,inflate:o2,inflateRaw:s2,ungzip:c2,constants:u2},{Deflate:f2,deflate:p2,deflateRaw:d2,gzip:h2}=v0,{Inflate:m2,inflate:g2,inflateRaw:y2,ungzip:v2}=l2,b2=f2,_2=p2,w2=d2,S2=h2,C2=m2,E2=g2,x2=y2,k2=v2,T2=Pn,A2={Deflate:b2,deflate:_2,deflateRaw:w2,gzip:S2,Inflate:C2,inflate:E2,inflateRaw:x2,ungzip:k2,constants:T2},ge=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},ye=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},_s=class{constructor(e,r){this.input=e,this.output=r}};ge([w(),ye("design:type",String)],_s.prototype,"input",void 0);ge([w(),ye("design:type",String)],_s.prototype,"output",void 0);_s=ge([He(),ye("design:paramtypes",[String,String])],_s);var ws=class{constructor(e,r){this.input=e,this.output=r}};ge([w(),ye("design:type",String)],ws.prototype,"input",void 0);ge([w(),ye("design:type",String)],ws.prototype,"output",void 0);ws=ge([Z(),ye("design:paramtypes",[String,String])],ws);var qr=class{constructor(e,r,n,i,a){this.name=e,this.modelId=r,this.systemPrompt=n,this.promptExamples=i,this.metaData=a}};ge([w(),ye("design:type",String)],qr.prototype,"name",void 0);ge([w(),ye("design:type",String)],qr.prototype,"modelId",void 0);ge([w(),ye("design:type",String)],qr.prototype,"systemPrompt",void 0);ge([w(),ye("design:type",Array)],qr.prototype,"promptExamples",void 0);ge([w(),ye("design:type",String)],qr.prototype,"metaData",void 0);qr=ge([He(),ye("design:paramtypes",[String,String,String,Array,String])],qr);var Zt=class{constructor(e,r,n,i,a,o,s,u){this.name=e,this.modelId=r,this.taskId=n,this.systemPrompt=i,this.promptExamples=a,this.metaData=o,this.createdAt=s,this.updatedAt=u}};ge([w(),ye("design:type",String)],Zt.prototype,"name",void 0);ge([w(),ye("design:type",String)],Zt.prototype,"modelId",void 0);ge([w(),ye("design:type",String)],Zt.prototype,"taskId",void 0);ge([w(),ye("design:type",String)],Zt.prototype,"systemPrompt",void 0);ge([w(),ye("design:type",Array)],Zt.prototype,"promptExamples",void 0);ge([w(),ye("design:type",String)],Zt.prototype,"metaData",void 0);ge([w(),ye("design:type",String)],Zt.prototype,"createdAt",void 0);ge([w(),ye("design:type",String)],Zt.prototype,"updatedAt",void 0);Zt=ge([Z(),ye("design:paramtypes",[String,String,String,String,Array,String,String,String])],Zt);var In=class{constructor(e,r,n,i,a){this.model=e,this.status=r,this.progress=n,this.downloaded=i,this.loaded=a}};ge([w(),ye("design:type",String)],In.prototype,"model",void 0);ge([w(),ye("design:type",String)],In.prototype,"status",void 0);ge([w(),ye("design:type",Number)],In.prototype,"progress",void 0);ge([w(),ye("design:type",Boolean)],In.prototype,"downloaded",void 0);ge([w(),ye("design:type",Boolean)],In.prototype,"loaded",void 0);In=ge([Z(),ye("design:paramtypes",[String,String,Number,Boolean,Boolean])],In);var I2=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Fe=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Le,ts,rl=class{constructor(e,r=!0){Le.set(this,void 0),ts.set(this,new Map),I2(this,Le,e,"f")}async getModels(){let e=await Fe(this,Le,"f").query({query:C`
|
|
651
655
|
query {
|
|
652
656
|
aiGetModels {
|
|
653
657
|
id
|
|
@@ -727,7 +731,7 @@ triggerMatch
|
|
|
727
731
|
updatedAt
|
|
728
732
|
}
|
|
729
733
|
}
|
|
730
|
-
`}));return e}async addTask(e,r,n,i,a){let o=new
|
|
734
|
+
`}));return e}async addTask(e,r,n,i,a){let o=new qr(e,r,n,i,a),{aiAddTask:s}=T(await Fe(this,Le,"f").mutate({mutation:C`
|
|
731
735
|
mutation AiAddTask($task: AITaskInput!) {
|
|
732
736
|
aiAddTask(task: $task) {
|
|
733
737
|
name
|
|
@@ -793,43 +797,43 @@ triggerMatch
|
|
|
793
797
|
mutation aiEmbed($modelId: String!, $text: String!) {
|
|
794
798
|
aiEmbed(modelId: $modelId, text: $text)
|
|
795
799
|
}
|
|
796
|
-
`,variables:{modelId:e,text:r}})),i=
|
|
800
|
+
`,variables:{modelId:e,text:r}})),i=Is.toByteArray(n);return JSON.parse(A2.inflate(i,{to:"string"}))}async openTranscriptionStream(e,r,n){let{aiOpenTranscriptionStream:i}=T(await Fe(this,Le,"f").mutate({mutation:C`
|
|
797
801
|
mutation AiOpenTranscriptionStream($modelId: String!, $params: VoiceActivityParamsInput) {
|
|
798
802
|
aiOpenTranscriptionStream(modelId: $modelId, params: $params)
|
|
799
803
|
}
|
|
800
804
|
`,variables:{modelId:e,params:n}})),a=Fe(this,Le,"f").subscribe({query:C` subscription {
|
|
801
805
|
aiTranscriptionText(streamId: "${i}")
|
|
802
|
-
}`}).subscribe({next(o){return r(o.data.aiTranscriptionText),o.data.aiTranscriptionText},error(o){console.error(o)}});return Fe(this,
|
|
806
|
+
}`}).subscribe({next(o){return r(o.data.aiTranscriptionText),o.data.aiTranscriptionText},error(o){console.error(o)}});return Fe(this,ts,"f").set(i,a),i}async closeTranscriptionStream(e){let{aiCloseTranscriptionStream:r}=T(await Fe(this,Le,"f").mutate({mutation:C`
|
|
803
807
|
mutation aiCloseTranscriptionStream($streamId: String!) {
|
|
804
808
|
aiCloseTranscriptionStream(streamId: $streamId)
|
|
805
809
|
}
|
|
806
|
-
`,variables:{streamId:e}})),n=Fe(this,
|
|
810
|
+
`,variables:{streamId:e}})),n=Fe(this,ts,"f").get(e);return n.closed||n.unsubscribe(),r}async feedTranscriptionStream(e,r){let{feedTranscriptionStream:n}=T(await Fe(this,Le,"f").mutate({mutation:C`
|
|
807
811
|
mutation AiFeedTranscriptionStream($streamId: String!, $audio: [Float!]!) {
|
|
808
812
|
aiFeedTranscriptionStream(streamId: $streamId, audio: $audio)
|
|
809
813
|
}
|
|
810
|
-
`,variables:{streamId:e,audio:r}}));return n}};Le=new WeakMap,es=new WeakMap;var Tr=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Pe=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},zt,ts,da,rs,ha,hn,ns,ma,ws=class{constructor(e,r=!0){zt.set(this,void 0),ts.set(this,void 0),da.set(this,void 0),rs.set(this,void 0),ha.set(this,void 0),hn.set(this,void 0),ns.set(this,void 0),ma.set(this,void 0),Tr(this,zt,e,"f"),Tr(this,ts,new Ca(Pe(this,zt,"f"),r),"f"),Tr(this,da,new zu(Pe(this,zt,"f")),"f"),Tr(this,rs,new qu(Pe(this,zt,"f")),"f"),Tr(this,ha,new Bu(Pe(this,zt,"f")),"f"),Tr(this,ma,new el(Pe(this,zt,"f"),r),"f"),Tr(this,hn,new ms(Pe(this,zt,"f"),r),"f"),Pe(this,hn,"f").setExpressionClient(Pe(this,da,"f")),Pe(this,hn,"f").setNeighbourhoodClient(Pe(this,ha,"f")),Pe(this,hn,"f").setAIClient(Pe(this,ma,"f")),Tr(this,ns,new Vu(Pe(this,zt,"f"),r),"f")}get agent(){return Pe(this,ts,"f")}get expression(){return Pe(this,da,"f")}get languages(){return Pe(this,rs,"f")}get neighbourhood(){return Pe(this,ha,"f")}get perspective(){return Pe(this,hn,"f")}get runtime(){return Pe(this,ns,"f")}get ai(){return Pe(this,ma,"f")}};zt=new WeakMap,ts=new WeakMap,da=new WeakMap,rs=new WeakMap,ha=new WeakMap,hn=new WeakMap,ns=new WeakMap,ma=new WeakMap;var Yd;(function(t){t.LanguageIsNotLoaded="LANGUAGE_IS_NOT_LOADED",t.ExpressionIsNotVerified="EXPRESSION_IS_NOT_VERIFIED",t.AgentIsUntrusted="AGENT_IS_UNTRUSTED",t.CapabilityRequested="CAPABILITY_REQUESTED",t.InstallNotificationRequest="INSTALL_NOTIFICATION_REQUEST"})(Yd||(Yd={}));var hl=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},ml=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},bn=class{constructor(e,r){this.language=e,this.expression=r}};hl([w(),ml("design:type",Ht)],bn.prototype,"language",void 0);hl([w(),ml("design:type",String)],bn.prototype,"expression",void 0);bn=hl([Z(),ml("design:paramtypes",[Ht,String])],bn);function G9(t){return t.language.address==="did"?t.expression.toString():`${t.language.address}://${t.expression}`}function H9(t){if(t.startsWith("literal://")){let a=new Ht;a.address="literal",a.name="literal";let o=t.substring(10);return new bn(a,o)}let r=/^([^:^\s]+):\/\/([\s\S]+)$/.exec(t);if(r&&r.length==3){let a=r[1],o=r[2],s=new Ht;return s.address=a,new bn(s,o)}let i=/^did:([^\s]+)$/.exec(t);if(i&&i.length==2){let a=new Ht;return a.address="did",new bn(a,t)}throw new Error("Couldn't parse string as expression URL or DID: "+t)}var bt=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},Yt=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Ss=class{};bt([w(),Yt("design:type",String)],Ss.prototype,"name",void 0);bt([w(),Yt("design:type",String)],Ss.prototype,"type",void 0);Ss=bt([Z()],Ss);var Na=class{};bt([w(),Yt("design:type",String)],Na.prototype,"label",void 0);bt([w(),Yt("design:type",String)],Na.prototype,"name",void 0);bt([w(),Yt("design:type",Array)],Na.prototype,"parameters",void 0);Na=bt([Z()],Na);var Cs=class{get parameters(){return JSON.parse(this.parametersStringified)}constructor(e,r){this.name=e,this.parametersStringified=JSON.stringify(r)}};bt([w(),Yt("design:type",String)],Cs.prototype,"name",void 0);bt([w(),Yt("design:type",String)],Cs.prototype,"parametersStringified",void 0);Cs=bt([He(),Yt("design:paramtypes",[String,Object])],Cs);var Es=class{};bt([w(),Yt("design:type",String)],Es.prototype,"did",void 0);bt([w(),Yt("design:type",Uu)],Es.prototype,"status",void 0);Es=bt([Z()],Es);var Jd=class{},Ln=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},Si=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},qr=class{};Ln([w(),Si("design:type",String)],qr.prototype,"name",void 0);Ln([w(),Si("design:type",String)],qr.prototype,"address",void 0);Ln([w(),Si("design:type",String)],qr.prototype,"settings",void 0);Ln([w(),Si("design:type",wn)],qr.prototype,"icon",void 0);Ln([w(),Si("design:type",wn)],qr.prototype,"constructorIcon",void 0);Ln([w(),Si("design:type",wn)],qr.prototype,"settingsIcon",void 0);qr=Ln([Z()],qr);var nt=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},lt=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},$t=class{};nt([w(),lt("design:type",String)],$t.prototype,"name",void 0);nt([w(),lt("design:type",String)],$t.prototype,"address",void 0);nt([w(),lt("design:type",String)],$t.prototype,"description",void 0);nt([w(),lt("design:type",String)],$t.prototype,"author",void 0);nt([w(),lt("design:type",Boolean)],$t.prototype,"templated",void 0);nt([w(),lt("design:type",String)],$t.prototype,"templateSourceLanguageAddress",void 0);nt([w(),lt("design:type",String)],$t.prototype,"templateAppliedParams",void 0);nt([w(),lt("design:type",Array)],$t.prototype,"possibleTemplateParams",void 0);nt([w(),lt("design:type",String)],$t.prototype,"sourceCodeLink",void 0);$t=nt([Z()],$t);var gi=class{constructor(e,r){this.name=e,this.description=r,this.description||(this.description="")}};nt([w(),lt("design:type",String)],gi.prototype,"name",void 0);nt([w(),lt("design:type",String)],gi.prototype,"description",void 0);nt([w(),lt("design:type",Array)],gi.prototype,"possibleTemplateParams",void 0);nt([w(),lt("design:type",String)],gi.prototype,"sourceCodeLink",void 0);gi=nt([He(),lt("design:paramtypes",[String,String])],gi);var Xd=class{},eh=class extends Br(){},th=class{},Ns=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},gl=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},xs=class{constructor(e,r){this.linkLanguage=e,this.meta=r}};Ns([w(),gl("design:type",String)],xs.prototype,"linkLanguage",void 0);Ns([w(),gl("design:type",$r)],xs.prototype,"meta",void 0);xs=Ns([Z(),gl("design:paramtypes",[String,$r])],xs);var tl=class extends Br(){};tl=Ns([Z()],tl);var Ci=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},Ei=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},rl;(function(t){t.Private="PRIVATE",t.NeighboudhoodCreationInitiated="NEIGHBOURHOOD_CREATION_INITIATED",t.NeighbourhoodJoinInitiated="NEIGHBOURHOOD_JOIN_INITIATED",t.LinkLanguageFailedToInstall="LINK_LANGUAGE_FAILED_TO_INSTALL",t.LinkLanguageInstalledButNotSynced="LINK_LANGUAGE_INSTALLED_BUT_NOT_SYNCED",t.Synced="SYNCED"})(rl||(rl={}));var In=class{constructor(e,r,n){this.uuid=e,this.name=r,n?this.state=n:this.state=rl.Private}};Ci([w(),Ei("design:type",String)],In.prototype,"uuid",void 0);Ci([w(),Ei("design:type",String)],In.prototype,"name",void 0);Ci([w(),Ei("design:type",String)],In.prototype,"state",void 0);Ci([w(),Ei("design:type",String)],In.prototype,"sharedUrl",void 0);Ci([w(),Ei("design:type",tl)],In.prototype,"neighbourhood",void 0);In=Ci([Z(),Ei("design:paramtypes",[String,String,String])],In);var Rs=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},am=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},ks=class{};Rs([w(),am("design:type",Array)],ks.prototype,"additions",void 0);Rs([w(),am("design:type",Array)],ks.prototype,"removals",void 0);ks=Rs([Z()],ks);var rh=class extends Br(){};rh=Rs([Z()],rh);var nh=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},ci=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},ga,mn,Vo="smart_literal://content";function I2(t){let e="",r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=r.length;for(let i=0;i<t;i++)e+=r.charAt(Math.floor(Math.random()*n));return e}var Ra=class{constructor(e,r){ga.set(this,void 0),mn.set(this,void 0),nh(this,ga,e,"f"),nh(this,mn,r,"f")}get base(){return ci(this,mn,"f")}static async create(e,r){let n=Lt.from(I2(10)).toUrl(),i=new Ra(e,n);return await i.set(r),i}static async isSmartLiteralBase(e,r){return(await e.get(new vt({source:r,predicate:Vo}))).length>0}static async getAllSmartLiterals(e){return(await e.get(new vt({predicate:Vo}))).map(n=>new Ra(e,n.data.source))}async get(){let e=await ci(this,ga,"f").getSingleTarget(new vt({source:ci(this,mn,"f"),predicate:Vo}));if(!e)throw`No content for smart literal ${ci(this,mn,"f")}`;return Lt.fromUrl(e).get()}async set(e){let r=Lt.from(e);await ci(this,ga,"f").setSingleTarget(new Cn({source:ci(this,mn,"f"),predicate:Vo,target:r.toUrl()}))}};ga=new WeakMap,mn=new WeakMap;var ih=class{};function o7(t,e,r){return{action:"addLink",source:t,predicate:e,target:r}}function s7(t){return`triple(this, "${t}", _)`}function c7(t){return function(e,r,n){if(typeof n.value!="function")throw new Error("InstanceQuery decorator can only be applied to methods");n.value=async function(a){let o=[],s=e.name,u=`subject_class("${s}", C), instance(C, Instance)`;if(t&&t.where)for(let l in t.where){let d=t.where[l];u+=`, property_getter(C, Instance, "${l}", "${d}")`}t&&t.condition&&(u+=", "+t.condition);let c=await a.infer(u);if(c==!1)return o;if(typeof c=="string")throw c;for(let l of c){let d=l.Instance,p=new hs(a,d,s);await p.init(),o.push(p)}return o}}}function u7(t){return function(e,r){if(t.required&&!t.initial)throw new Error("SubjectProperty requires an 'initial' option if 'required' is true");if(!t.through&&!t.getter)throw new Error("SubjectProperty requires either 'through' or 'getter' option");if(e.__properties=e.__properties||{},e.__properties[r]=e.__properties[r]||{},e.__properties[r]={...e.__properties[r],...t},t.writable){let n=r;e[`set${Dr(n)}`]=()=>{}}Object.defineProperty(e,r,{configurable:!0,writable:!0})}}function l7(t){return function(e,r){if(!t.through&&!t.value)throw new Error("SubjectFlag requires a 'through' and 'value' option");if(!t.through)throw new Error("SubjectFlag requires a 'through' option");if(!t.value)throw new Error("SubjectFlag requires a 'value' option");e.__properties=e.__properties||{},e.__properties[r]=e.__properties[r]||{},e.__properties[r]={...e.__properties[r],through:t.through,required:!0,initial:t.value,flag:!0},e[r]=t.value,Object.defineProperty(e,r,{configurable:!0,writable:!0})}}function f7(t){return function(e,r){e.__collections=e.__collections||{},e.__collections[r]=t;let n=r;e[`add${Dr(n)}`]=()=>{},e[`remove${Dr(n)}`]=()=>{},e[`setCollection${Dr(n)}`]=()=>{},Object.defineProperty(e,r,{configurable:!0,writable:!0})}}function om(t){let e="",r="abcdefghijklmnopqrstuvwxyz",n=r.length;for(let i=0;i<t;i++)e+=r.charAt(Math.floor(Math.random()*n));return e}function p7(t){return function(e){e.prototype.className=t.name,e.className=t.name,e.generateSDNA=function(){let r="",n=t.name,i=e.prototype,a=om(8);r+=`subject_class("${n}", ${a}).
|
|
814
|
+
`,variables:{streamId:e,audio:r}}));return n}};Le=new WeakMap,ts=new WeakMap;var Ar=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Pe=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},zt,rs,ha,ns,ma,mn,is,ga,Ss=class{constructor(e,r=!0){zt.set(this,void 0),rs.set(this,void 0),ha.set(this,void 0),ns.set(this,void 0),ma.set(this,void 0),mn.set(this,void 0),is.set(this,void 0),ga.set(this,void 0),Ar(this,zt,e,"f"),Ar(this,rs,new Ea(Pe(this,zt,"f"),r),"f"),Ar(this,ha,new Gu(Pe(this,zt,"f")),"f"),Ar(this,ns,new Vu(Pe(this,zt,"f")),"f"),Ar(this,ma,new zu(Pe(this,zt,"f")),"f"),Ar(this,ga,new rl(Pe(this,zt,"f"),r),"f"),Ar(this,mn,new gs(Pe(this,zt,"f"),r),"f"),Pe(this,mn,"f").setExpressionClient(Pe(this,ha,"f")),Pe(this,mn,"f").setNeighbourhoodClient(Pe(this,ma,"f")),Pe(this,mn,"f").setAIClient(Pe(this,ga,"f")),Ar(this,is,new Qu(Pe(this,zt,"f"),r),"f")}get agent(){return Pe(this,rs,"f")}get expression(){return Pe(this,ha,"f")}get languages(){return Pe(this,ns,"f")}get neighbourhood(){return Pe(this,ma,"f")}get perspective(){return Pe(this,mn,"f")}get runtime(){return Pe(this,is,"f")}get ai(){return Pe(this,ga,"f")}};zt=new WeakMap,rs=new WeakMap,ha=new WeakMap,ns=new WeakMap,ma=new WeakMap,mn=new WeakMap,is=new WeakMap,ga=new WeakMap;var Jd;(function(t){t.LanguageIsNotLoaded="LANGUAGE_IS_NOT_LOADED",t.ExpressionIsNotVerified="EXPRESSION_IS_NOT_VERIFIED",t.AgentIsUntrusted="AGENT_IS_UNTRUSTED",t.CapabilityRequested="CAPABILITY_REQUESTED",t.InstallNotificationRequest="INSTALL_NOTIFICATION_REQUEST"})(Jd||(Jd={}));var gl=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},yl=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},_n=class{constructor(e,r){this.language=e,this.expression=r}};gl([w(),yl("design:type",Ht)],_n.prototype,"language",void 0);gl([w(),yl("design:type",String)],_n.prototype,"expression",void 0);_n=gl([Z(),yl("design:paramtypes",[Ht,String])],_n);function H9(t){return t.language.address==="did"?t.expression.toString():`${t.language.address}://${t.expression}`}function W9(t){if(t.startsWith("literal://")){let a=new Ht;a.address="literal",a.name="literal";let o=t.substring(10);return new _n(a,o)}let r=/^([^:^\s]+):\/\/([\s\S]+)$/.exec(t);if(r&&r.length==3){let a=r[1],o=r[2],s=new Ht;return s.address=a,new _n(s,o)}let i=/^did:([^\s]+)$/.exec(t);if(i&&i.length==2){let a=new Ht;return a.address="did",new _n(a,t)}throw new Error("Couldn't parse string as expression URL or DID: "+t)}var bt=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},Yt=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Cs=class{};bt([w(),Yt("design:type",String)],Cs.prototype,"name",void 0);bt([w(),Yt("design:type",String)],Cs.prototype,"type",void 0);Cs=bt([Z()],Cs);var Ra=class{};bt([w(),Yt("design:type",String)],Ra.prototype,"label",void 0);bt([w(),Yt("design:type",String)],Ra.prototype,"name",void 0);bt([w(),Yt("design:type",Array)],Ra.prototype,"parameters",void 0);Ra=bt([Z()],Ra);var Es=class{get parameters(){return JSON.parse(this.parametersStringified)}constructor(e,r){this.name=e,this.parametersStringified=JSON.stringify(r)}};bt([w(),Yt("design:type",String)],Es.prototype,"name",void 0);bt([w(),Yt("design:type",String)],Es.prototype,"parametersStringified",void 0);Es=bt([He(),Yt("design:paramtypes",[String,Object])],Es);var xs=class{};bt([w(),Yt("design:type",String)],xs.prototype,"did",void 0);bt([w(),Yt("design:type",qu)],xs.prototype,"status",void 0);xs=bt([Z()],xs);var Xd=class{},$n=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},Ci=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Br=class{};$n([w(),Ci("design:type",String)],Br.prototype,"name",void 0);$n([w(),Ci("design:type",String)],Br.prototype,"address",void 0);$n([w(),Ci("design:type",String)],Br.prototype,"settings",void 0);$n([w(),Ci("design:type",Sn)],Br.prototype,"icon",void 0);$n([w(),Ci("design:type",Sn)],Br.prototype,"constructorIcon",void 0);$n([w(),Ci("design:type",Sn)],Br.prototype,"settingsIcon",void 0);Br=$n([Z()],Br);var nt=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},lt=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},$t=class{};nt([w(),lt("design:type",String)],$t.prototype,"name",void 0);nt([w(),lt("design:type",String)],$t.prototype,"address",void 0);nt([w(),lt("design:type",String)],$t.prototype,"description",void 0);nt([w(),lt("design:type",String)],$t.prototype,"author",void 0);nt([w(),lt("design:type",Boolean)],$t.prototype,"templated",void 0);nt([w(),lt("design:type",String)],$t.prototype,"templateSourceLanguageAddress",void 0);nt([w(),lt("design:type",String)],$t.prototype,"templateAppliedParams",void 0);nt([w(),lt("design:type",Array)],$t.prototype,"possibleTemplateParams",void 0);nt([w(),lt("design:type",String)],$t.prototype,"sourceCodeLink",void 0);$t=nt([Z()],$t);var yi=class{constructor(e,r){this.name=e,this.description=r,this.description||(this.description="")}};nt([w(),lt("design:type",String)],yi.prototype,"name",void 0);nt([w(),lt("design:type",String)],yi.prototype,"description",void 0);nt([w(),lt("design:type",Array)],yi.prototype,"possibleTemplateParams",void 0);nt([w(),lt("design:type",String)],yi.prototype,"sourceCodeLink",void 0);yi=nt([He(),lt("design:paramtypes",[String,String])],yi);var eh=class{},th=class extends Vr(){},rh=class{},Rs=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},vl=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},ks=class{constructor(e,r){this.linkLanguage=e,this.meta=r}};Rs([w(),vl("design:type",String)],ks.prototype,"linkLanguage",void 0);Rs([w(),vl("design:type",Fr)],ks.prototype,"meta",void 0);ks=Rs([Z(),vl("design:paramtypes",[String,Fr])],ks);var nl=class extends Vr(){};nl=Rs([Z()],nl);var Ei=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},xi=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},il;(function(t){t.Private="PRIVATE",t.NeighboudhoodCreationInitiated="NEIGHBOURHOOD_CREATION_INITIATED",t.NeighbourhoodJoinInitiated="NEIGHBOURHOOD_JOIN_INITIATED",t.LinkLanguageFailedToInstall="LINK_LANGUAGE_FAILED_TO_INSTALL",t.LinkLanguageInstalledButNotSynced="LINK_LANGUAGE_INSTALLED_BUT_NOT_SYNCED",t.Synced="SYNCED"})(il||(il={}));var On=class{constructor(e,r,n){this.uuid=e,this.name=r,n?this.state=n:this.state=il.Private}};Ei([w(),xi("design:type",String)],On.prototype,"uuid",void 0);Ei([w(),xi("design:type",String)],On.prototype,"name",void 0);Ei([w(),xi("design:type",String)],On.prototype,"state",void 0);Ei([w(),xi("design:type",String)],On.prototype,"sharedUrl",void 0);Ei([w(),xi("design:type",nl)],On.prototype,"neighbourhood",void 0);On=Ei([Z(),xi("design:paramtypes",[String,String,String])],On);var Ps=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},om=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Ts=class{};Ps([w(),om("design:type",Array)],Ts.prototype,"additions",void 0);Ps([w(),om("design:type",Array)],Ts.prototype,"removals",void 0);Ts=Ps([Z()],Ts);var nh=class extends Vr(){};nh=Ps([Z()],nh);var ih=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},ui=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},ya,gn,zo="smart_literal://content";function O2(t){let e="",r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=r.length;for(let i=0;i<t;i++)e+=r.charAt(Math.floor(Math.random()*n));return e}var Pa=class{constructor(e,r){ya.set(this,void 0),gn.set(this,void 0),ih(this,ya,e,"f"),ih(this,gn,r,"f")}get base(){return ui(this,gn,"f")}static async create(e,r){let n=Lt.from(O2(10)).toUrl(),i=new Pa(e,n);return await i.set(r),i}static async isSmartLiteralBase(e,r){return(await e.get(new vt({source:r,predicate:zo}))).length>0}static async getAllSmartLiterals(e){return(await e.get(new vt({predicate:zo}))).map(n=>new Pa(e,n.data.source))}async get(){let e=await ui(this,ya,"f").getSingleTarget(new vt({source:ui(this,gn,"f"),predicate:zo}));if(!e)throw`No content for smart literal ${ui(this,gn,"f")}`;return Lt.fromUrl(e).get()}async set(e){let r=Lt.from(e);await ui(this,ya,"f").setSingleTarget(new En({source:ui(this,gn,"f"),predicate:zo,target:r.toUrl()}))}};ya=new WeakMap,gn=new WeakMap;var ah=class{};function s7(t,e,r){return{action:"addLink",source:t,predicate:e,target:r}}function c7(t){return`triple(this, "${t}", _)`}function u7(t){return function(e,r,n){if(typeof n.value!="function")throw new Error("InstanceQuery decorator can only be applied to methods");n.value=async function(a){let o=[],s=e.name,u=`subject_class("${s}", C), instance(C, Instance)`;if(t&&t.where)for(let l in t.where){let d=t.where[l];u+=`, property_getter(C, Instance, "${l}", "${d}")`}t&&t.condition&&(u+=", "+t.condition);let c=await a.infer(u);if(c==!1)return o;if(typeof c=="string")throw c;for(let l of c){let d=l.Instance,p=new ms(a,d,s);await p.init(),o.push(p)}return o}}}function l7(t){return function(e,r){if(t.required&&!t.initial)throw new Error("SubjectProperty requires an 'initial' option if 'required' is true");if(!t.through&&!t.getter)throw new Error("SubjectProperty requires either 'through' or 'getter' option");if(e.__properties=e.__properties||{},e.__properties[r]=e.__properties[r]||{},e.__properties[r]={...e.__properties[r],...t},t.writable){let n=r;e[`set${Nr(n)}`]=()=>{}}Object.defineProperty(e,r,{configurable:!0,writable:!0})}}function f7(t){return function(e,r){if(!t.through&&!t.value)throw new Error("SubjectFlag requires a 'through' and 'value' option");if(!t.through)throw new Error("SubjectFlag requires a 'through' option");if(!t.value)throw new Error("SubjectFlag requires a 'value' option");e.__properties=e.__properties||{},e.__properties[r]=e.__properties[r]||{},e.__properties[r]={...e.__properties[r],through:t.through,required:!0,initial:t.value,flag:!0},e[r]=t.value,Object.defineProperty(e,r,{configurable:!0,writable:!0})}}function p7(t){return function(e,r){e.__collections=e.__collections||{},e.__collections[r]=t;let n=r;e[`add${Nr(n)}`]=()=>{},e[`remove${Nr(n)}`]=()=>{},e[`setCollection${Nr(n)}`]=()=>{},Object.defineProperty(e,r,{configurable:!0,writable:!0})}}function sm(t){let e="",r="abcdefghijklmnopqrstuvwxyz",n=r.length;for(let i=0;i<t;i++)e+=r.charAt(Math.floor(Math.random()*n));return e}function d7(t){return function(e){e.prototype.className=t.name,e.className=t.name,e.generateSDNA=function(){let r="",n=t.name,i=e.prototype,a=sm(8);r+=`subject_class("${n}", ${a}).
|
|
811
815
|
`;let o=[],s=[];i.subjectConstructor&&i.subjectConstructor.length&&(s=s.concat(i.subjectConstructor));let u=[];i.isSubjectInstance&&i.isSubjectInstance.length&&(u=u.concat(i.isSubjectInstance));let c=[],l=i.__properties||{};for(let h in l){let g=`property(${a}, "${h}").
|
|
812
816
|
`,{through:y,initial:S,required:b,resolveLanguage:v,writable:m,flag:A,getter:D,setter:E,local:O}=l[h];if(v&&(g+=`property_resolve(${a}, "${h}").
|
|
813
817
|
`,g+=`property_resolve_language(${a}, "${h}", "${v}").
|
|
814
818
|
`),D?g+=`property_getter(${a}, Base, "${h}", Value) :- ${D}.
|
|
815
819
|
`:y&&(g+=`property_getter(${a}, Base, "${h}", Value) :- triple(Base, "${y}", Value).
|
|
816
820
|
`,b&&(A?u.push(`triple(Base, "${y}", "${S}")`):u.push(`triple(Base, "${y}", _)`))),E)g+=`property_setter(${a}, "${h}", Actions) :- ${E}.
|
|
817
|
-
`;else if(m&&typeof i[
|
|
821
|
+
`;else if(m&&typeof i[wh(h)]=="function"){let N=[{action:"setSingleTarget",source:"this",predicate:y,target:"value",...O&&{local:!0}}];g+=`property_setter(${a}, "${h}", '${ln(N)}').
|
|
818
822
|
`}c.push(g),S&&(s.push({action:"addLink",source:"this",predicate:y,target:S}),o.push({action:"removeLink",source:"this",predicate:y,target:S}))}let d=[],p=i.__collections||{};for(let h in p){let g=`collection(${a}, "${h}").
|
|
819
823
|
`,{through:y,where:S,local:b}=p[h];if(y){if(S){if(!S.isInstance&&!S.condition)throw"'where' needs one of 'isInstance' or 'condition'";let D=[];if(S.isInstance){let O;S.isInstance.name?O=S.isInstance.name:O=S.isInstance,D.push(`instance(OtherClass, Target), subject_class("${O}", OtherClass)`)}S.condition&&D.push(S.condition);let E=D.join(", ");g+=`collection_getter(${a}, Base, "${h}", List) :- setof(Target, (triple(Base, "${y}", Target), ${E}), List).
|
|
820
824
|
`}else g+=`collection_getter(${a}, Base, "${h}", List) :- findall(C, triple(Base, "${y}", C), List).
|
|
821
|
-
`;let v=[{action:"addLink",source:"this",predicate:y,target:"value",...b&&{local:!0}}],m=[{action:"removeLink",source:"this",predicate:y,target:"value"}],A=[{action:"collectionSetter",source:"this",predicate:y,target:"value",...b&&{local:!0}}];g+=`collection_adder(${a}, "${ur(h)}", '${
|
|
822
|
-
`,g+=`collection_remover(${a}, "${ur(h)}", '${
|
|
823
|
-
`,g+=`collection_setter(${a}, "${ur(h)}", '${
|
|
824
|
-
`}d.push(g)}let f=
|
|
825
|
+
`;let v=[{action:"addLink",source:"this",predicate:y,target:"value",...b&&{local:!0}}],m=[{action:"removeLink",source:"this",predicate:y,target:"value"}],A=[{action:"collectionSetter",source:"this",predicate:y,target:"value",...b&&{local:!0}}];g+=`collection_adder(${a}, "${ur(h)}", '${ln(v)}').
|
|
826
|
+
`,g+=`collection_remover(${a}, "${ur(h)}", '${ln(m)}').
|
|
827
|
+
`,g+=`collection_setter(${a}, "${ur(h)}", '${ln(A)}').
|
|
828
|
+
`}d.push(g)}let f=ln(s);if(r+=`constructor(${a}, '${f}').
|
|
825
829
|
`,u.length>0){let h=u.join(", ");r+=`instance(${a}, Base) :- ${h}.
|
|
826
830
|
`,r+=`
|
|
827
|
-
`}return r+=`destructor(${a}, '${
|
|
831
|
+
`}return r+=`destructor(${a}, '${ln(o)}').
|
|
828
832
|
`,r+=`
|
|
829
833
|
`,r+=c.join(`
|
|
830
834
|
`),r+=`
|
|
831
835
|
`,r+=d.join(`
|
|
832
|
-
`),{sdna:r,name:n}},Object.defineProperty(e,"type",{configurable:!0})}}var
|
|
836
|
+
`),{sdna:r,name:n}},Object.defineProperty(e,"type",{configurable:!0})}}var h7=`
|
|
833
837
|
type AIModelLoadingStatus {
|
|
834
838
|
downloaded: Boolean!
|
|
835
839
|
loaded: Boolean!
|
|
@@ -1156,8 +1160,8 @@ type Mutation {
|
|
|
1156
1160
|
languageWriteSettings(languageAddress: String!, settings: String!): Boolean!
|
|
1157
1161
|
neighbourhoodJoinFromUrl(url: String!): PerspectiveHandle!
|
|
1158
1162
|
neighbourhoodPublishFromPerspective(linkLanguage: String!, meta: PerspectiveInput!, perspectiveUUID: String!): String!
|
|
1159
|
-
neighbourhoodSendBroadcast(payload: PerspectiveInput!, perspectiveUUID: String!): Boolean!
|
|
1160
|
-
neighbourhoodSendBroadcastU(payload: PerspectiveUnsignedInput!, perspectiveUUID: String!): Boolean!
|
|
1163
|
+
neighbourhoodSendBroadcast(loopback: Boolean, payload: PerspectiveInput!, perspectiveUUID: String!): Boolean!
|
|
1164
|
+
neighbourhoodSendBroadcastU(loopback: Boolean, payload: PerspectiveUnsignedInput!, perspectiveUUID: String!): Boolean!
|
|
1161
1165
|
neighbourhoodSendSignal(payload: PerspectiveInput!, perspectiveUUID: String!, remoteAgentDid: String!): Boolean!
|
|
1162
1166
|
neighbourhoodSendSignalU(payload: PerspectiveUnsignedInput!, perspectiveUUID: String!, remoteAgentDid: String!): Boolean!
|
|
1163
1167
|
neighbourhoodSetOnlineStatus(perspectiveUUID: String!, status: PerspectiveInput!): Boolean!
|
|
@@ -1363,7 +1367,7 @@ input VoiceActivityParamsInput {
|
|
|
1363
1367
|
startWindow: Float
|
|
1364
1368
|
timeBeforeSpeech: Float
|
|
1365
1369
|
}
|
|
1366
|
-
`;function ah(t){return t?.length?t.length===1?t.toString():t.length===2?t.join(" and "):t.slice(0,-1).join(", ")+", and "+t.slice(-1):""}function sm(t){let e=t.can.includes("*")?["READ","WRITE","UPDATE"]:t.can,r=t.with.domain==="*"?"":t.with.domain,n=t.with.pointers.includes("*")?["all AD4M data"]:t.with.pointers;return`${ah(e)} your ${r} actions, with access to ${ah(n)}`}var cn=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Q=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},tt,Pt,is,we,oh=class{constructor(t,e,r){tt.set(this,void 0),Pt.set(this,void 0),is.set(this,void 0),we.set(this,void 0),cn(this,tt,e||Lt.from(om(24)).toUrl(),"f"),cn(this,we,t,"f"),cn(this,is,r||"ad4m://self","f")}get baseExpression(){return Q(this,tt,"f")}get perspective(){return Q(this,we,"f")}async getData(t){let e=t??Q(this,tt,"f"),r=await Q(this,we,"f").getSubjectData(Q(this,Pt,"f"),e);return Object.assign(this,r),cn(this,tt,e,"f"),this}async setProperty(key,value){let setters=await Q(this,we,"f").infer(`subject_class("${Q(this,Pt,"f")}", C), property_setter(C, "${key}", Setter)`);if(setters&&setters.length>0){let actions=eval(setters[0].Setter),resolveLanguageResults=await Q(this,we,"f").infer(`subject_class("${Q(this,Pt,"f")}", C), property_resolve_language(C, "${key}", Language)`),resolveLanguage;resolveLanguageResults&&resolveLanguageResults.length>0&&(resolveLanguage=resolveLanguageResults[0].Language),resolveLanguage&&(value=await Q(this,we,"f").createExpression(value,resolveLanguage)),await Q(this,we,"f").executeAction(actions,Q(this,tt,"f"),[{name:"value",value}])}}async setCollectionSetter(key,value){let collectionSetters=await Q(this,we,"f").infer(`subject_class("${Q(this,Pt,"f")}", C), collection_setter(C, "${ur(key)}", Setter)`);if(collectionSetters||(collectionSetters=[]),collectionSetters.length>0){let actions=eval(collectionSetters[0].Setter);value&&(Array.isArray(value)?await Q(this,we,"f").executeAction(actions,Q(this,tt,"f"),value.map(t=>({name:"value",value:t}))):await Q(this,we,"f").executeAction(actions,Q(this,tt,"f"),[{name:"value",value}]))}}async setCollectionAdder(key,value){let adders=await Q(this,we,"f").infer(`subject_class("${Q(this,Pt,"f")}", C), collection_adder(C, "${ur(key)}", Adder)`);if(adders||(adders=[]),adders.length>0){let actions=eval(adders[0].Adder);value&&(Array.isArray(value)?await Promise.all(value.map(t=>Q(this,we,"f").executeAction(actions,Q(this,tt,"f"),[{name:"value",value:t}]))):await Q(this,we,"f").executeAction(actions,Q(this,tt,"f"),[{name:"value",value}]))}}async setCollectionRemover(key,value){let removers=await Q(this,we,"f").infer(`subject_class("${Q(this,Pt,"f")}", C), collection_remover(C, "${ur(key)}", Remover)`);if(removers||(removers=[]),removers.length>0){let actions=eval(removers[0].Remover);value&&(Array.isArray(value)?await Promise.all(value.map(t=>Q(this,we,"f").executeAction(actions,Q(this,tt,"f"),[{name:"value",value:t}]))):await Q(this,we,"f").executeAction(actions,Q(this,tt,"f"),[{name:"value",value}]))}}async save(){cn(this,Pt,await Q(this,we,"f").stringOrTemplateObjectToSubjectClass(this),"f"),await Q(this,we,"f").createSubject(this,Q(this,tt,"f")),await Q(this,we,"f").add(new Cn({source:Q(this,is,"f"),predicate:"ad4m://has_child",target:this.baseExpression})),await this.update()}async update(){cn(this,Pt,await Q(this,we,"f").stringOrTemplateObjectToSubjectClass(this),"f");let t=Object.entries(this);for(let[e,r]of t)if(r!=null)if(r?.action)switch(r.action){case"setter":await this.setCollectionSetter(e,r.value);break;case"adder":await this.setCollectionAdder(e,r.value);break;case"remover":await this.setCollectionRemover(e,r.value);default:await this.setCollectionSetter(e,r.value);break}else Array.isArray(r)&&r.length>0?await this.setCollectionSetter(e,r):r!=null&&r!==""&&await this.setProperty(e,r);await this.getData()}async get(){return cn(this,Pt,await Q(this,we,"f").stringOrTemplateObjectToSubjectClass(this),"f"),await this.getData()}async delete(){await Q(this,we,"f").removeSubject(this,Q(this,tt,"f"))}static async all(t){let e=await t.stringOrTemplateObjectToSubjectClass(this),r=await t.getAllSubjectProxies(e),n=[];if(r){for(let i of r){let a=new this(t,i.X);n.push(await a.get())}return n}return[]}static async query(t,e){let r=e?.source||"ad4m://self",n=await t.stringOrTemplateObjectToSubjectClass(this),i=[],a=`subject_class("${n}", C), instance(C, Base), link("${r}", Predicate, Base, Timestamp, Author)`;if(e){if(e.where)if(e.where.condition)a+=", "+e.where.condition;else{let s=Object.entries(e.where);for(let u of s){let c=u[0],l=u[1];a+=`, property_getter(C, Base, "${c}", "${l}")`}}try{if((await t.infer(`findall([Timestamp, Base], (${a}), AllData), sort(AllData, SortedData), length(SortedData, DataLength).`))[0].DataLength>=e.size){let u=`findall([Timestamp, Base], (${a}), AllData), sort(AllData, SortedData), reverse(SortedData, ReverseSortedData), paginate(ReverseSortedData, ${e.page}, ${e.size}, PageData).`;i=await t.infer(u),i=i[0].PageData.map(c=>({Base:c[1],Timestamp:c[0]}))}else i=await t.infer(a)}catch(s){console.log("Query failed",s)}}else i=await t.infer(a);return i?await Promise.all(i.map(async s=>await new this(t,s.Base).get())):[]}};tt=new WeakMap,Pt=new WeakMap,is=new WeakMap,we=new WeakMap;var Ps="0.10.1-rc9-dev";function D2(){let t=new AbortController;return setTimeout(()=>t.abort(),20),t}function yl(t,e=1e4){return pe(this,null,function*(){return Promise.race([new Promise((r,n)=>{try{t.includes("localhost")||r(new WebSocket(t));let i=new WebSocket(t);i.onopen=()=>{r(i)},i.onerror=a=>{n(a)}}catch(i){n(i)}}),new Promise((r,n)=>{setTimeout(()=>{n(new Error("WebSocket connection timed out"))},e)})])})}function vl(t){return pe(this,null,function*(){try{let e=yield fetch(`http://localhost:${t}/graphql/`,{signal:D2().signal,mode:"cors"});if(e.status===400||e.status===0||e.status===200)return t;throw new Error(`Could not connect to port ${t}`)}catch(e){throw new Error(`Could not connect to port ${t}`)}})}function N2(){return new Promise((t,e)=>{let r=document.querySelector("ad4m-connect"),n=r==null?void 0:r.getAd4mClient();n?t(n):e("No Ad4mClient found")})}function bl(){try{localStorage.setItem("test",""),localStorage.removeItem("test")}catch(t){return!1}return!0}function Ls(t,e){bl()&&localStorage.setItem(`${Ps}/${t}`,e)}function Jt(t){return bl()?localStorage.getItem(`${Ps}/${t}`):null}function _l(t){bl()&&localStorage.removeItem(`${Ps}/${t}`)}var R2=t=>{let e=new Set;do for(let r of Reflect.ownKeys(t))e.add([t,r]);while((t=Reflect.getPrototypeOf(t))&&t!==Object.prototype);return e};function Ua(t,{include:e,exclude:r}={}){let n=i=>{let a=o=>typeof o=="string"?i===o:o.test(i);return e?e.some(a):r?!r.some(a):!0};for(let[i,a]of R2(t.constructor.prototype)){if(a==="constructor"||!n(a))continue;let o=Reflect.getOwnPropertyDescriptor(i,a);o&&typeof o.value=="function"&&(t[a]=t[a].bind(t))}return t}var ja=class{constructor({appName:e,appDesc:r,appIconPath:n,appUrl:i,appDomain:a,capabilities:o,port:s,token:u,url:c,hosting:l}){this.activeSocket=null;this.requestedRestart=!1;this.authState="unauthenticated";this.connectionState="not_connected";this.port=12e3;this.capabilities=[];this.isHosting=!1;this.listeners={authstatechange:[],configstatechange:[],connectionstatechange:[]};Ua(this);this.appName=e,this.appDesc=r,this.appDomain=a,this.appUrl=i,this.appIconPath=n,this.capabilities=o,this.port=s||this.port,this.url=c||`ws://localhost:${this.port}/graphql`,this.token=u||this.token,this.isHosting=l||!1,this.buildClient()}notifyConfigChange(e,r){this.listeners.configstatechange.forEach(n=>{n(e,r)})}notifyConnectionChange(e){this.connectionState!==e&&(this.connectionState=e,this.listeners.connectionstatechange.forEach(r=>{r(e)}))}notifyAuthChange(e){this.authState!==e&&(this.authState=e,this.listeners.authstatechange.forEach(r=>{r(e)}))}setPort(e){this.port!==e&&(this.port=e,this.setUrl(`ws://localhost:${this.port}/graphql`),this.notifyConfigChange("port",e))}setUrl(e){this.url!==e&&(this.url=e,this.notifyConfigChange("url",e))}setToken(e){this.token!==e&&(this.token=e,this.notifyConfigChange("token",e))}on(e,r){this.listeners[e].push(r)}connect(e){return pe(this,null,function*(){try{if(e){yield yl(e,1e4),this.setUrl(e);let r=this.buildClient();return yield this.checkAuth(),r}else{let r=yield this.ensureConnection();return yield this.checkAuth(),r}}catch(r){this.notifyConnectionChange("not_connected"),this.notifyAuthChange("unauthenticated")}})}loginToHosting(e,r){return pe(this,null,function*(){try{let n=yield fetch("https://hosting.ad4m.dev/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:e,password:r})});if(n.status===200){let i=yield n.json();localStorage.setItem("hosting_token",i.token);let a=localStorage.getItem("hosting_token"),o=yield fetch("https://hosting.ad4m.dev/api/service/info",{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+a}});if(o.status===200){let s=yield o.json();if(s.serviceId)if(this.setPort(s.port),this.setUrl(s.url),this.isHosting=!0,Ls("ad4mhosting","true"),!s.paused)this.connect();else throw new Error("Hosting is not running")}}else if((yield n.json()).message==="Passwords did not match")throw new Error("Passwords did not match")}catch(n){throw console.log(n),new Error(`Error logging in ${n}`)}})}checkEmail(e){return pe(this,null,function*(){try{return(yield fetch(`https://hosting.ad4m.dev/api/auth/check-email?email=${e}`,{method:"GET",headers:{"Content-Type":"application/json"}})).status===200}catch(r){console.log(r)}})}connectToPort(e){return pe(this,null,function*(){try{if(e){let r=yield vl(e);return this.setPort(r),this.buildClient()}else if(this.url.includes("localhost")){let r=yield this.findPort();return this.setPort(r),this.buildClient()}}catch(r){this.notifyConnectionChange("not_connected"),this.notifyAuthChange("unauthenticated")}})}ensureConnection(){return pe(this,null,function*(){var r,n;if(((r=this.activeSocket)==null?void 0:r.readyState)===WebSocket.OPEN&&((n=this.activeSocket)==null?void 0:n.url)===this.url&&this.ad4mClient)return this.ad4mClient;try{return this.notifyConnectionChange("connecting"),yield yl(this.url,1e4),this.buildClient()}catch(i){return this.notifyConnectionChange("not_connected"),this.connectToPort()}})}findPort(){return pe(this,null,function*(){let e=[...Array(10).keys()].map((i,a)=>vl(12e3+a)),n=(yield Promise.allSettled(e)).find(i=>i.status==="fulfilled");if(n)return n.value;throw Error("Couldn't find an open port")})}buildClient(){this.notifyConnectionChange("connecting");try{let e=new WebSocket(this.url)}catch(e){this.notifyConnectionChange("not_connected");return}return this.apolloClient&&this.wsClient&&(this.requestedRestart=!0,this.wsClient.dispose(),this.apolloClient.stop(),this.wsClient=null,this.apolloClient=null),this.wsClient=Zp({url:this.url,connectionParams:()=>pe(this,null,function*(){return{headers:{authorization:this.token}}}),on:{opened:e=>{this.activeSocket=e},error:e=>{this.notifyConnectionChange("not_connected"),this.notifyAuthChange("unauthenticated")},connected:()=>{this.notifyConnectionChange("connected"),this.checkAuth()},closed:()=>pe(this,null,function*(){if(!this.requestedRestart)if(!this.token)this.notifyConnectionChange(this.token?"disconnected":"not_connected"),this.notifyAuthChange("unauthenticated"),this.requestedRestart=!1;else{let e=yield this.connect();e?this.ad4mClient=e:(this.notifyConnectionChange(this.token?"disconnected":"not_connected"),this.notifyAuthChange("unauthenticated"),this.requestedRestart=!1)}})}}),this.apolloClient=new uu({link:new Yp(this.wsClient),cache:new ko({resultCaching:!1,addTypename:!1}),defaultOptions:{watchQuery:{fetchPolicy:"no-cache"},query:{fetchPolicy:"no-cache"},mutate:{fetchPolicy:"no-cache"}}}),this.ad4mClient=new ws(this.apolloClient),this.ad4mClient}checkAuth(){return pe(this,null,function*(){try{return(yield this.ad4mClient.agent.isLocked())?this.notifyAuthChange("locked"):(yield this.ad4mClient.agent.status(),this.notifyAuthChange("authenticated")),!0}catch(e){return e.message==="Socket closed with event 4500 Cannot extractByTags from a ciphered wallet. You must unlock first."?(this.notifyAuthChange("locked"),!0):(this.notifyAuthChange("unauthenticated"),!1)}})}requestCapability(e=!1){return pe(this,null,function*(){var r;if(e&&this.setToken(null),this.isHosting){let n=localStorage.getItem("hosting_token");(yield fetch("https://hosting.ad4m.dev/api/service/checkStatus",{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer "+n}})).status!==200&&console.error("Looks like the client is not running you might not recieve the mail with the code, please check your dashboard logs.")}return this.requestId=yield(r=this.ad4mClient)==null?void 0:r.agent.requestCapability({appName:this.appName,appDesc:this.appDesc,appUrl:this.appUrl,appIconPath:this.appIconPath,appDomain:this.appDomain,capabilities:this.capabilities}),this.requestId})}verifyCode(e){return pe(this,null,function*(){var r;try{let n=yield(r=this.ad4mClient)==null?void 0:r.agent.generateJwt(this.requestId,e);return this.setToken(n),yield this.buildClient(),yield this.checkAuth(),this.token}catch(n){throw new Error("Invalid code")}})}clearState(){this.setToken(null),this.setPort(12e3),this.notifyConnectionChange("not_connected"),this.notifyAuthChange("unauthenticated")}};function wl({unlockAgent:t,reconnect:e}){return B`
|
|
1370
|
+
`;function oh(t){return t?.length?t.length===1?t.toString():t.length===2?t.join(" and "):t.slice(0,-1).join(", ")+", and "+t.slice(-1):""}function cm(t){let e=t.can.includes("*")?["READ","WRITE","UPDATE"]:t.can,r=t.with.domain==="*"?"":t.with.domain,n=t.with.pointers.includes("*")?["all AD4M data"]:t.with.pointers;return`${oh(e)} your ${r} actions, with access to ${oh(n)}`}var un=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Q=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},tt,Pt,as,we,sh=class{constructor(t,e,r){tt.set(this,void 0),Pt.set(this,void 0),as.set(this,void 0),we.set(this,void 0),un(this,tt,e||Lt.from(sm(24)).toUrl(),"f"),un(this,we,t,"f"),un(this,as,r||"ad4m://self","f")}get baseExpression(){return Q(this,tt,"f")}get perspective(){return Q(this,we,"f")}async getData(t){let e=t??Q(this,tt,"f"),r=await Q(this,we,"f").getSubjectData(Q(this,Pt,"f"),e);return Object.assign(this,r),un(this,tt,e,"f"),this}async setProperty(key,value){let setters=await Q(this,we,"f").infer(`subject_class("${Q(this,Pt,"f")}", C), property_setter(C, "${key}", Setter)`);if(setters&&setters.length>0){let actions=eval(setters[0].Setter),resolveLanguageResults=await Q(this,we,"f").infer(`subject_class("${Q(this,Pt,"f")}", C), property_resolve_language(C, "${key}", Language)`),resolveLanguage;resolveLanguageResults&&resolveLanguageResults.length>0&&(resolveLanguage=resolveLanguageResults[0].Language),resolveLanguage&&(value=await Q(this,we,"f").createExpression(value,resolveLanguage)),await Q(this,we,"f").executeAction(actions,Q(this,tt,"f"),[{name:"value",value}])}}async setCollectionSetter(key,value){let collectionSetters=await Q(this,we,"f").infer(`subject_class("${Q(this,Pt,"f")}", C), collection_setter(C, "${ur(key)}", Setter)`);if(collectionSetters||(collectionSetters=[]),collectionSetters.length>0){let actions=eval(collectionSetters[0].Setter);value&&(Array.isArray(value)?await Q(this,we,"f").executeAction(actions,Q(this,tt,"f"),value.map(t=>({name:"value",value:t}))):await Q(this,we,"f").executeAction(actions,Q(this,tt,"f"),[{name:"value",value}]))}}async setCollectionAdder(key,value){let adders=await Q(this,we,"f").infer(`subject_class("${Q(this,Pt,"f")}", C), collection_adder(C, "${ur(key)}", Adder)`);if(adders||(adders=[]),adders.length>0){let actions=eval(adders[0].Adder);value&&(Array.isArray(value)?await Promise.all(value.map(t=>Q(this,we,"f").executeAction(actions,Q(this,tt,"f"),[{name:"value",value:t}]))):await Q(this,we,"f").executeAction(actions,Q(this,tt,"f"),[{name:"value",value}]))}}async setCollectionRemover(key,value){let removers=await Q(this,we,"f").infer(`subject_class("${Q(this,Pt,"f")}", C), collection_remover(C, "${ur(key)}", Remover)`);if(removers||(removers=[]),removers.length>0){let actions=eval(removers[0].Remover);value&&(Array.isArray(value)?await Promise.all(value.map(t=>Q(this,we,"f").executeAction(actions,Q(this,tt,"f"),[{name:"value",value:t}]))):await Q(this,we,"f").executeAction(actions,Q(this,tt,"f"),[{name:"value",value}]))}}async save(){un(this,Pt,await Q(this,we,"f").stringOrTemplateObjectToSubjectClass(this),"f"),await Q(this,we,"f").createSubject(this,Q(this,tt,"f")),await Q(this,we,"f").add(new En({source:Q(this,as,"f"),predicate:"ad4m://has_child",target:this.baseExpression})),await this.update()}async update(){un(this,Pt,await Q(this,we,"f").stringOrTemplateObjectToSubjectClass(this),"f");let t=Object.entries(this);for(let[e,r]of t)if(r!=null)if(r?.action)switch(r.action){case"setter":await this.setCollectionSetter(e,r.value);break;case"adder":await this.setCollectionAdder(e,r.value);break;case"remover":await this.setCollectionRemover(e,r.value);default:await this.setCollectionSetter(e,r.value);break}else Array.isArray(r)&&r.length>0?await this.setCollectionSetter(e,r):r!=null&&r!==""&&await this.setProperty(e,r);await this.getData()}async get(){return un(this,Pt,await Q(this,we,"f").stringOrTemplateObjectToSubjectClass(this),"f"),await this.getData()}async delete(){await Q(this,we,"f").removeSubject(this,Q(this,tt,"f"))}static async all(t){let e=await t.stringOrTemplateObjectToSubjectClass(this),r=await t.getAllSubjectProxies(e),n=[];if(r){for(let i of r){let a=new this(t,i.X);n.push(await a.get())}return n}return[]}static async query(t,e){let r=e?.source||"ad4m://self",n=await t.stringOrTemplateObjectToSubjectClass(this),i=[],a=`subject_class("${n}", C), instance(C, Base), link("${r}", Predicate, Base, Timestamp, Author)`;if(e){if(e.where)if(e.where.condition)a+=", "+e.where.condition;else{let s=Object.entries(e.where);for(let u of s){let c=u[0],l=u[1];a+=`, property_getter(C, Base, "${c}", "${l}")`}}try{if((await t.infer(`findall([Timestamp, Base], (${a}), AllData), sort(AllData, SortedData), length(SortedData, DataLength).`))[0].DataLength>=e.size){let u=`findall([Timestamp, Base], (${a}), AllData), sort(AllData, SortedData), reverse(SortedData, ReverseSortedData), paginate(ReverseSortedData, ${e.page}, ${e.size}, PageData).`;i=await t.infer(u),i=i[0].PageData.map(c=>({Base:c[1],Timestamp:c[0]}))}else i=await t.infer(a)}catch(s){console.log("Query failed",s)}}else i=await t.infer(a);return i?await Promise.all(i.map(async s=>await new this(t,s.Base).get())):[]}};tt=new WeakMap,Pt=new WeakMap,as=new WeakMap,we=new WeakMap;var Ls="0.10.1-rc9-dev";var fr=12e3;function N2(){let t=new AbortController;return setTimeout(()=>t.abort(),20),t}function $s(t,e=1e4){return pe(this,null,function*(){return Promise.race([new Promise((r,n)=>{try{t.includes("localhost")||r(new WebSocket(t));let i=new WebSocket(t);i.onopen=()=>{r(i)},i.onerror=a=>{n(a)}}catch(i){n(i)}}),new Promise((r,n)=>{setTimeout(()=>{n(new Error("WebSocket connection timed out"))},e)})])})}function bl(t){return pe(this,null,function*(){try{let e=yield fetch(`http://localhost:${t}/graphql/`,{signal:N2().signal,mode:"cors"});if(e.status===400||e.status===0||e.status===200)return t;throw new Error(`Could not connect to port ${t}`)}catch(e){throw new Error(`Could not connect to port ${t}`)}})}function R2(){return new Promise((t,e)=>{let r=document.querySelector("ad4m-connect"),n=r==null?void 0:r.getAd4mClient();n?t(n):e("No Ad4mClient found")})}function _l(){try{localStorage.setItem("test",""),localStorage.removeItem("test")}catch(t){return!1}return!0}function Fs(t,e){_l()&&localStorage.setItem(`${Ls}/${t}`,e)}function Jt(t){return _l()?localStorage.getItem(`${Ls}/${t}`):null}function wl(t){_l()&&localStorage.removeItem(`${Ls}/${t}`)}var P2=t=>{let e=new Set;do for(let r of Reflect.ownKeys(t))e.add([t,r]);while((t=Reflect.getPrototypeOf(t))&&t!==Object.prototype);return e};function ja(t,{include:e,exclude:r}={}){let n=i=>{let a=o=>typeof o=="string"?i===o:o.test(i);return e?e.some(a):r?!r.some(a):!0};for(let[i,a]of P2(t.constructor.prototype)){if(a==="constructor"||!n(a))continue;let o=Reflect.getOwnPropertyDescriptor(i,a);o&&typeof o.value=="function"&&(t[a]=t[a].bind(t))}return t}var qa=class{constructor({appName:e,appDesc:r,appIconPath:n,appUrl:i,appDomain:a,capabilities:o,port:s,token:u,url:c,hosting:l}){this.activeSocket=null;this.requestedRestart=!1;this.authState="unauthenticated";this.connectionState="not_connected";this.port=fr;this.capabilities=[];this.isHosting=!1;this.listeners={authstatechange:[],configstatechange:[],connectionstatechange:[]};ja(this);this.appName=e,this.appDesc=r,this.appDomain=a,this.appUrl=i,this.appIconPath=n,this.capabilities=o,this.port=s||this.port,this.url=c||`ws://localhost:${this.port}/graphql`,this.token=u||this.token,this.isHosting=l||!1,this.buildClient()}notifyConfigChange(e,r){this.listeners.configstatechange.forEach(n=>{n(e,r)})}notifyConnectionChange(e){this.connectionState!==e&&(this.connectionState=e,this.listeners.connectionstatechange.forEach(r=>{r(e)}))}notifyAuthChange(e){this.authState!==e&&(this.authState=e,this.listeners.authstatechange.forEach(r=>{r(e)}))}setPort(e){this.port!==e&&(this.port=e,this.setUrl(`ws://localhost:${this.port}/graphql`),this.notifyConfigChange("port",e))}setUrl(e){this.url!==e&&(this.url=e,this.notifyConfigChange("url",e))}setToken(e){this.token!==e&&(this.token=e,this.notifyConfigChange("token",e))}on(e,r){this.listeners[e].push(r)}connect(e){return pe(this,null,function*(){try{if(e){yield $s(e),this.setUrl(e);let r=this.buildClient();return yield this.checkAuth(),r}else{let r=yield this.ensureConnection();return yield this.checkAuth(),r}}catch(r){this.notifyConnectionChange("not_connected"),this.notifyAuthChange("unauthenticated")}})}loginToHosting(e,r){return pe(this,null,function*(){try{let n=yield fetch("https://hosting.ad4m.dev/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:e,password:r})});if(n.status===200){let i=yield n.json();localStorage.setItem("hosting_token",i.token);let a=localStorage.getItem("hosting_token"),o=yield fetch("https://hosting.ad4m.dev/api/service/info",{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+a}});if(o.status===200){let s=yield o.json();if(s.serviceId)if(this.setPort(s.port),this.setUrl(s.url),this.isHosting=!0,Fs("ad4mhosting","true"),!s.paused)this.connect();else throw new Error("Hosting is not running")}}else if((yield n.json()).message==="Passwords did not match")throw new Error("Passwords did not match")}catch(n){throw console.log(n),new Error(`Error logging in ${n}`)}})}checkEmail(e){return pe(this,null,function*(){try{return(yield fetch(`https://hosting.ad4m.dev/api/auth/check-email?email=${e}`,{method:"GET",headers:{"Content-Type":"application/json"}})).status===200}catch(r){console.log(r)}})}connectToPort(e){return pe(this,null,function*(){try{if(this.notifyConnectionChange("connecting"),e){let r=yield bl(e);return this.setPort(r),this.buildClient()}else if(this.url.includes("localhost")){let r=yield this.findPort();this.setPort(r);let n=this.buildClient();try{return yield $s(this.url),this.notifyConnectionChange("connected"),n}catch(i){throw this.notifyConnectionChange("not_connected"),i}}}catch(r){throw this.notifyConnectionChange("not_connected"),r}})}ensureConnection(){return pe(this,null,function*(){var r,n;if(((r=this.activeSocket)==null?void 0:r.readyState)===WebSocket.OPEN&&((n=this.activeSocket)==null?void 0:n.url)===this.url&&this.ad4mClient)return this.ad4mClient;try{return this.notifyConnectionChange("connecting"),yield $s(this.url),this.buildClient()}catch(i){return this.notifyConnectionChange("not_connected"),this.connectToPort()}})}findPort(){return pe(this,null,function*(){let e=[...Array(10).keys()].map((i,a)=>bl(fr+a)),n=(yield Promise.allSettled(e)).find(i=>i.status==="fulfilled");if(n)return n.value;throw Error("Couldn't find an open port")})}buildClient(){this.notifyConnectionChange("connecting");try{let e=new WebSocket(this.url)}catch(e){this.notifyConnectionChange("not_connected");return}return this.apolloClient&&this.wsClient&&(this.requestedRestart=!0,this.wsClient.dispose(),this.apolloClient.stop(),this.wsClient=null,this.apolloClient=null),this.wsClient=Yp({url:this.url,connectionParams:()=>pe(this,null,function*(){return{headers:{authorization:this.token}}}),on:{opened:e=>{this.activeSocket=e},error:e=>{this.notifyConnectionChange("not_connected"),this.notifyAuthChange("unauthenticated")},connected:()=>{this.notifyConnectionChange("connected"),this.checkAuth()},closed:()=>pe(this,null,function*(){if(!this.requestedRestart)if(!this.token)this.notifyConnectionChange(this.token?"disconnected":"not_connected"),this.notifyAuthChange("unauthenticated"),this.requestedRestart=!1;else{let e=yield this.connect();e?this.ad4mClient=e:(this.notifyConnectionChange(this.token?"disconnected":"not_connected"),this.notifyAuthChange("unauthenticated"),this.requestedRestart=!1)}})}}),this.apolloClient=new fu({link:new Jp(this.wsClient),cache:new To({resultCaching:!1,addTypename:!1}),defaultOptions:{watchQuery:{fetchPolicy:"no-cache"},query:{fetchPolicy:"no-cache"},mutate:{fetchPolicy:"no-cache"}}}),this.ad4mClient=new Ss(this.apolloClient),this.ad4mClient}checkAuth(){return pe(this,null,function*(){try{return(yield this.ad4mClient.agent.isLocked())?this.notifyAuthChange("locked"):(yield this.ad4mClient.agent.status(),this.notifyAuthChange("authenticated")),!0}catch(e){return e.message==="Socket closed with event 4500 Cannot extractByTags from a ciphered wallet. You must unlock first."?(this.notifyAuthChange("locked"),!0):(this.notifyAuthChange("unauthenticated"),!1)}})}requestCapability(e=!1){return pe(this,null,function*(){var r;if(e&&this.setToken(null),this.isHosting){let n=localStorage.getItem("hosting_token");(yield fetch("https://hosting.ad4m.dev/api/service/checkStatus",{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer "+n}})).status!==200&&console.error("Looks like the client is not running you might not recieve the mail with the code, please check your dashboard logs.")}return this.requestId=yield(r=this.ad4mClient)==null?void 0:r.agent.requestCapability({appName:this.appName,appDesc:this.appDesc,appUrl:this.appUrl,appIconPath:this.appIconPath,appDomain:this.appDomain,capabilities:this.capabilities}),this.requestId})}verifyCode(e){return pe(this,null,function*(){var r;try{let n=yield(r=this.ad4mClient)==null?void 0:r.agent.generateJwt(this.requestId,e);return this.setToken(n),yield this.buildClient(),yield this.checkAuth(),this.token}catch(n){throw new Error("Invalid code")}})}clearState(){this.setToken(null),this.setPort(fr),this.notifyConnectionChange("not_connected"),this.notifyAuthChange("unauthenticated")}};function Sl({unlockAgent:t,reconnect:e}){return B`
|
|
1367
1371
|
<div class="text-center">
|
|
1368
1372
|
<div class="items">
|
|
1369
1373
|
<div>
|
|
@@ -1375,7 +1379,7 @@ input VoiceActivityParamsInput {
|
|
|
1375
1379
|
<button class="button" @click=${e}>Reconnect</button>
|
|
1376
1380
|
</div>
|
|
1377
1381
|
</div>
|
|
1378
|
-
`}function
|
|
1382
|
+
`}function Cl(){return B`
|
|
1379
1383
|
<div class="items">
|
|
1380
1384
|
<div class="text-center">
|
|
1381
1385
|
<h1 class="heading">Request to AD4M blocked</h1>
|
|
@@ -1396,7 +1400,7 @@ input VoiceActivityParamsInput {
|
|
|
1396
1400
|
</button>
|
|
1397
1401
|
</div>
|
|
1398
1402
|
</div>
|
|
1399
|
-
`}function
|
|
1403
|
+
`}function El({reconnect:t}){return B`
|
|
1400
1404
|
<div class="items items--small">
|
|
1401
1405
|
<div class="text-center">
|
|
1402
1406
|
<h1 class="heading">Could not connect to AD4M</h1>
|
|
@@ -1405,7 +1409,7 @@ input VoiceActivityParamsInput {
|
|
|
1405
1409
|
<button class="button" @click=${()=>t()}>Try again</button>
|
|
1406
1410
|
</div>
|
|
1407
1411
|
</div>
|
|
1408
|
-
`}function
|
|
1412
|
+
`}function xl(){return B`<header class="dialog__header">
|
|
1409
1413
|
<div class="dialog__logo">
|
|
1410
1414
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 38 37" fill="none">
|
|
1411
1415
|
<path
|
|
@@ -1414,7 +1418,7 @@ input VoiceActivityParamsInput {
|
|
|
1414
1418
|
/>
|
|
1415
1419
|
</svg>
|
|
1416
1420
|
</div>
|
|
1417
|
-
</header>`}function
|
|
1421
|
+
</header>`}function kl({step:t,email:e,changeEmail:r,changeState:n,password:i,changePassword:a,login:o,checkEmail:s,passwordError:u,setHostingStep:c,isHostingRunning:l,setIsHostingRunning:d}){if(l)return B`
|
|
1418
1422
|
<div class="text-center">
|
|
1419
1423
|
<p>
|
|
1420
1424
|
Hosted executor does not seem to be running. Please check the logs in your <a href="https://hosting.ad4m.dev/dashboard">ADAM hosting dashboard</a> and potentially restart your executor there.
|
|
@@ -1489,7 +1493,7 @@ input VoiceActivityParamsInput {
|
|
|
1489
1493
|
Back
|
|
1490
1494
|
</button>
|
|
1491
1495
|
</div>
|
|
1492
|
-
`}function
|
|
1496
|
+
`}function Tl(){return B`
|
|
1493
1497
|
<div>
|
|
1494
1498
|
<div class="lds-ring">
|
|
1495
1499
|
<div></div>
|
|
@@ -1498,15 +1502,15 @@ input VoiceActivityParamsInput {
|
|
|
1498
1502
|
<div></div>
|
|
1499
1503
|
</div>
|
|
1500
1504
|
</div>
|
|
1501
|
-
`}function
|
|
1505
|
+
`}function Ba(){return B`
|
|
1502
1506
|
<svg width="44" height="40" viewBox="0 0 70 60" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
1503
1507
|
<path d="M63.2781 52.9928C62.4038 47.0393 59.8345 41.4763 55.9242 36.935C55.9403 36.5766 55.951 36.2182 55.951 35.8545C55.951 26.6328 50.7373 18.6039 43.0937 14.5333C41.093 9.35009 37.7352 4.72854 33.2402 1.14469L31.7705 0L30.2793 1.10725L30.2096 1.16074C25.7253 4.74458 22.3729 9.36079 20.3775 14.5386C12.7339 18.6039 7.52021 26.6328 7.52021 35.8599C7.52021 36.2236 7.53094 36.582 7.54703 36.9404C3.6421 41.471 1.06742 47.034 0.198465 52.9874L0 54.9131L1.70036 55.5817C5.40683 57.0313 9.32249 57.7695 13.3401 57.7695C15.668 57.7695 17.9369 57.5127 20.1254 57.0366C23.5744 58.9248 27.533 60 31.7383 60C35.9436 60 39.9022 58.9248 43.3512 57.0366C45.5397 57.5127 47.8086 57.7695 50.1365 57.7695C54.1541 57.7695 58.0698 57.0366 61.7762 55.5817L63.5624 54.881L63.2835 52.9874L63.2781 52.9928ZM42.5734 51.8802C40.0792 51.1581 37.7352 50.0829 35.595 48.7189C39.752 44.675 42.8041 39.5079 44.263 33.7202C46.1297 34.6938 47.8891 35.8866 49.4982 37.288C49.9917 37.716 50.4637 38.1653 50.9197 38.6253C50.1258 44.1294 46.9986 48.8954 42.568 51.8855L42.5734 51.8802ZM12.5516 38.62C13.0075 38.1599 13.4849 37.716 13.973 37.288C15.5822 35.8866 17.3415 34.6938 19.2082 33.7202C20.6672 39.5079 23.7192 44.675 27.8763 48.7189C25.7361 50.0829 23.392 51.1527 20.8978 51.8802C16.4672 48.8901 13.3401 44.1241 12.5462 38.62H12.5516ZM40.3957 25.9802C40.3957 26.3332 40.3903 26.6809 40.3742 27.0286C37.585 26.2477 34.6831 25.8411 31.7383 25.8411C28.7935 25.8411 25.8916 26.2477 23.1024 27.0286C23.0917 26.6809 23.0809 26.3279 23.0809 25.9802C23.0809 23.2362 23.494 20.5563 24.2825 18.0102C26.5782 17.0527 29.0993 16.5231 31.7383 16.5231C34.3773 16.5231 36.8984 17.0527 39.1941 18.0102C39.9826 20.5563 40.3957 23.2362 40.3957 25.9802ZM23.73 31.8641C26.3047 31.0671 29.0027 30.6553 31.7383 30.6553C34.4739 30.6553 37.1719 31.0671 39.7466 31.8641C38.5344 37.2827 35.6808 42.0915 31.7383 45.7395C27.7958 42.0861 24.9422 37.2773 23.73 31.8641ZM50.7641 32.1262C48.9887 30.8104 47.0898 29.6817 45.0998 28.7671C45.1803 27.847 45.2232 26.9163 45.2232 25.9802C45.2232 24.536 45.1266 23.1131 44.9335 21.7063C47.8676 24.4343 49.9595 28.0503 50.7641 32.1262ZM31.7383 6.19417C33.6639 7.97005 35.2946 9.99198 36.6087 12.1904C35.0371 11.8695 33.4065 11.6983 31.7383 11.6983C30.0701 11.6983 28.4395 11.8695 26.8679 12.1904C28.182 9.99198 29.8127 7.97005 31.7383 6.19417ZM18.5431 21.701C18.3553 23.1078 18.2534 24.5306 18.2534 25.9749C18.2534 26.9163 18.2963 27.8417 18.3768 28.7617C16.3868 29.6764 14.4879 30.805 12.7125 32.1209C13.5171 28.0449 15.6036 24.429 18.5377 21.701H18.5431ZM5.33173 51.7518C5.9915 48.7938 7.15547 45.9802 8.74855 43.418C9.95007 47.034 11.9776 50.2808 14.622 52.9179C14.1983 52.9393 13.7692 52.95 13.3401 52.95C10.5991 52.95 7.91178 52.5488 5.32637 51.7465L5.33173 51.7518ZM31.7383 55.1859C30.1506 55.1859 28.6058 54.988 27.1307 54.6296C28.7452 53.854 30.29 52.95 31.7383 51.923C33.1866 52.95 34.7314 53.854 36.3459 54.6296C34.8655 54.988 33.326 55.1859 31.7383 55.1859ZM50.1365 52.95C49.7074 52.95 49.2783 52.9339 48.8546 52.9179C51.499 50.2808 53.5265 47.0393 54.728 43.4234C56.3211 45.9802 57.4851 48.7938 58.1449 51.7518C55.5648 52.5488 52.8775 52.95 50.1365 52.95Z" fill="#91E3FD"/>
|
|
1504
1508
|
</svg>
|
|
1505
|
-
`}function
|
|
1509
|
+
`}function Al({openModal:t}){return B`
|
|
1506
1510
|
<div class="mainlogo" @click=${t}>
|
|
1507
|
-
${
|
|
1511
|
+
${Ba()}
|
|
1508
1512
|
</div>
|
|
1509
|
-
`}function
|
|
1513
|
+
`}function Il({capabilities:t,appname:e,appiconpath:r,changeState:n,setOpen:i,requestCapability:a}){return B`
|
|
1510
1514
|
<div class="items">
|
|
1511
1515
|
<div class="text-center">
|
|
1512
1516
|
<p class="body">An external application</p>
|
|
@@ -1516,7 +1520,7 @@ input VoiceActivityParamsInput {
|
|
|
1516
1520
|
${r&&B`<div class="dialog__connect">
|
|
1517
1521
|
<img class="dialog__connect-app" src=${r} alt="Logo" />
|
|
1518
1522
|
<div class="dialog__connect-check"></div>
|
|
1519
|
-
<div class="dialog__connect-ad4m">${
|
|
1523
|
+
<div class="dialog__connect-ad4m">${Ba()}</div>
|
|
1520
1524
|
</div>`}
|
|
1521
1525
|
<div>
|
|
1522
1526
|
<p class="text-center"><b>This will allow the developer to:</b></p>
|
|
@@ -1535,7 +1539,7 @@ input VoiceActivityParamsInput {
|
|
|
1535
1539
|
/>
|
|
1536
1540
|
</svg>
|
|
1537
1541
|
</span>
|
|
1538
|
-
<span>${
|
|
1542
|
+
<span>${cm(o)}</span>
|
|
1539
1543
|
</li>`)}
|
|
1540
1544
|
</ul>
|
|
1541
1545
|
</div>
|
|
@@ -1560,7 +1564,7 @@ input VoiceActivityParamsInput {
|
|
|
1560
1564
|
Connection settings
|
|
1561
1565
|
</button>
|
|
1562
1566
|
</div>
|
|
1563
|
-
`}function
|
|
1567
|
+
`}function Ol({changeState:t,onSuccess:e,uiState:r}){function n(i){let a=new BarcodeDetector,o=i.currentTarget,s=()=>pe(this,null,function*(){try{if(r!=="qr")return;let c=(yield a.detect(o)).find(l=>l.format==="qr_code");if(c!=null&&c.rawValue){t("requestcap"),e(c.rawValue);return}else requestAnimationFrame(s)}catch(u){console.error(u)}});s()}return B`
|
|
1564
1568
|
<div class="qr-scanner">
|
|
1565
1569
|
<div class="qr-content">
|
|
1566
1570
|
<button
|
|
@@ -1579,7 +1583,7 @@ input VoiceActivityParamsInput {
|
|
|
1579
1583
|
></video>
|
|
1580
1584
|
</div>
|
|
1581
1585
|
</div>
|
|
1582
|
-
`}function
|
|
1586
|
+
`}function Dl({port:t,url:e,isRemote:r,connectToPort:n,changeIsRemote:i,connectRemote:a,changeState:o,changeUrl:s,changePort:u,clearState:c}){return B`
|
|
1583
1587
|
<div class="items items--small">
|
|
1584
1588
|
<div class="text-center">
|
|
1585
1589
|
<h1 class="heading">Connection Settings</h1>
|
|
@@ -1647,7 +1651,7 @@ input VoiceActivityParamsInput {
|
|
|
1647
1651
|
</button>
|
|
1648
1652
|
</div
|
|
1649
1653
|
</div>
|
|
1650
|
-
`}function
|
|
1654
|
+
`}function Nl({connect:t,isMobile:e,hasClickedDownload:r,changeState:n,onDownloaded:i,scanQrcode:a,hosting:o}){let u=(Jt("ad4murl")||`http://localhost:${fr}`).includes("localhost");function c(l){l.preventDefault();let d=l.currentTarget;window.open(d.href,"_blank"),this.onDownloaded()}return B`
|
|
1651
1655
|
<div class="items">
|
|
1652
1656
|
${r?B`<div class="text-center">
|
|
1653
1657
|
<a class="button" target="_blank" @click=${()=>t()}>
|
|
@@ -1665,7 +1669,7 @@ input VoiceActivityParamsInput {
|
|
|
1665
1669
|
class="button"
|
|
1666
1670
|
target="_blank"
|
|
1667
1671
|
@click=${c}
|
|
1668
|
-
href="https://
|
|
1672
|
+
href="https://github.com/coasys/ad4m/releases"
|
|
1669
1673
|
>
|
|
1670
1674
|
Download AD4M
|
|
1671
1675
|
</a>`}
|
|
@@ -1704,7 +1708,7 @@ input VoiceActivityParamsInput {
|
|
|
1704
1708
|
>
|
|
1705
1709
|
</div>
|
|
1706
1710
|
</div>
|
|
1707
|
-
`}function
|
|
1711
|
+
`}function Rl({code:t,changeState:e,verifyCode:r,changeCode:n,isHosting:i,verifyCodeError:a}){return B`
|
|
1708
1712
|
<div class="items">
|
|
1709
1713
|
<div class="text-center">
|
|
1710
1714
|
<div class="heading">${i?"Please check your emails for the 2FA security code that was sent from the ADAM hosting service":"Please check your ADAM Launcher"}</div>
|
|
@@ -1736,7 +1740,7 @@ input VoiceActivityParamsInput {
|
|
|
1736
1740
|
</button>
|
|
1737
1741
|
</div>
|
|
1738
1742
|
</div>
|
|
1739
|
-
`}function
|
|
1743
|
+
`}function L2(){return[/Android/i,/webOS/i,/iPhone/i,/iPad/i,/iPod/i,/BlackBerry/i,/Windows Phone/i].some(e=>navigator.userAgent.match(e))}var $2=js`
|
|
1740
1744
|
:host {
|
|
1741
1745
|
--primary-color: #fff;
|
|
1742
1746
|
--heading-color: #fff;
|
|
@@ -2137,16 +2141,16 @@ input VoiceActivityParamsInput {
|
|
|
2137
2141
|
width: 100vw;
|
|
2138
2142
|
object-fit: cover;
|
|
2139
2143
|
}
|
|
2140
|
-
`,ce=class extends
|
|
2144
|
+
`,ce=class extends mr{constructor(){super(...arguments);this._code=null;this._isMobile=null;this._hasClickedDownload=null;this._isRemote=!1;this._isOpen=!1;this._hostingStep=0;this._email="";this._passowrd="";this._passwordError=null;this._hostingNotRunningError=null;this._verifyCodeError=null;this._isHostingLoading=!1;this.uiState="start";this.appName=null;this.appDesc=null;this.appDomain=null;this.appIconPath=null;this.mobile=null;this.capabilities=[];this.hosting=Jt("ad4mhosting")==="true"||!1;this.token=Jt("ad4mToken")||"";this.port=parseInt(Jt("ad4mport"))||fr;this.url=Jt("ad4murl")||""}get authState(){return this._client.authState}get connectionState(){return this._client.connectionState}injectFont(){let r=document.createElement("link");r.setAttribute("rel","stylesheet"),r.setAttribute("href","https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,200..800&display=swap"),document.head.appendChild(r)}connectedCallback(){super.connectedCallback(),ja(this),this.injectFont(),this._isMobile=L2(),this._client=new qa({appName:this.appName,appDesc:this.appDesc,appDomain:this.appDomain,appUrl:window.location.origin,appIconPath:this.appIconPath,capabilities:Array.isArray(this.capabilities)?this.capabilities:JSON.parse(this.capabilities),port:this.port||parseInt(Jt("ad4mport"))||fr,token:this.token||Jt("ad4mtoken"),url:this.url||Jt("ad4murl"),hosting:this.hosting}),this._client.on("configstatechange",this.handleConfigChange),this._client.on("authstatechange",this.handleAuthChange),this._client.on("connectionstatechange",this.handleConnectionChange),this.loadFont(),!this.token&&!this.url&&this._client.connectToPort().catch(()=>{console.log("Initial connection attempt failed")})}checkEmail(){return pe(this,null,function*(){try{(yield this._client.checkEmail(this._email))?this._hostingStep=1:this._hostingStep=2}catch(r){console.log(r)}})}loginToHosting(){return pe(this,null,function*(){try{yield this._client.loginToHosting(this._email,this._passowrd),this.changeUIState("connected")}catch(r){r.message.includes("Passwords did not match")?this._passwordError="Passwords did not match":this._hostingNotRunningError="Hosting is not running"}})}changeEmail(r){this._email=r}changePassword(r){this._passowrd=r}unlockAgent(r,n=!0){return pe(this,null,function*(){yield this._client.ad4mClient.agent.unlock(r,n)})}verifyCode(r){return pe(this,null,function*(){try{yield this._client.verifyCode(r)}catch(n){this._verifyCodeError="Invalid code"}})}changeUrl(r){r!==this._client.url&&(wl("ad4mtoken"),this._client.setToken(null)),this._client.setUrl(r)}changePort(r){this._client.setPort(r)}changeUIState(r){this.uiState=r}setIsHostingRunning(r){this._hostingNotRunningError=r}changeIsRemote(r){this._isRemote=r}changeCode(r){this._code=r}onDownloaded(){this._hasClickedDownload=!0}handleAuthChange(r){let n=new CustomEvent("authstatechange",{detail:r});r==="locked"&&(this._isOpen=!0),r==="authenticated"&&(this._isOpen=!1),this.dispatchEvent(n),this.requestUpdate()}handleConfigChange(r,n){this[r]=n,n?Fs("ad4m"+r,n):wl("ad4m"+r),this.requestUpdate()}handleConnectionChange(r){console.log(r),r==="connected"&&(this.authState!=="authenticated"?this.changeUIState("requestcap"):(this.changeUIState("connected"),this._isOpen=!1)),r==="disconnected"&&(this._isOpen=!0),r==="not_connected"&&(this._isOpen=!0,this.changeUIState("start"));let n=new CustomEvent("connectionstatechange",{detail:r});this.dispatchEvent(n),this.requestUpdate()}loadFont(){let r=document.createElement("link");r.rel="stylesheet",r.type="text/css",r.crossOrigin="anonymous",r.href="https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;700&display=swap",document.head.appendChild(r)}startCamera(r){return pe(this,null,function*(){try{window.BarcodeDetector.getSupportedFormats()}catch(n){window.BarcodeDetector=dr}yield this.changeUIState("qr"),setTimeout(()=>pe(this,null,function*(){let n=this.shadowRoot.querySelector("video");if(!n)return;let i=yield navigator.mediaDevices.getUserMedia({audio:!1,video:{facingMode:"environment"}});n.srcObject=i,n.autoplay=!0}),100)})}connect(){return pe(this,null,function*(){this._isOpen=!0,this.requestUpdate();let r=yield this._client.connect();try{let n=yield r.agent.status();n.isUnlocked&&n.isInitialized&&window.location.reload()}catch(n){console.warn(n)}return r})}getAd4mClient(){return this._client.ad4mClient}connectRemote(r){return pe(this,null,function*(){try{this.changeUrl(r);let n=yield this._client.connect(r),i=yield n.agent.status();return i.isUnlocked&&i.isInitialized||this.changeUIState("requestcap"),n}catch(n){this.changeUIState("requestcap"),this._isOpen=!0}})}requestCapability(r){return pe(this,null,function*(){try{yield this._client.requestCapability(r),this.changeUIState("verifycode")}catch(n){console.warn(n)}})}isAuthenticated(){return pe(this,null,function*(){return this._client.checkAuth()})}setOpen(r){this._isOpen=r}setHostingStep(r){this._hostingStep=r}clearState(){this.handleConfigChange("port",null),this.handleConfigChange("url",null),this.handleConfigChange("token",null),this.handleConnectionChange("not_connected"),this.handleAuthChange("unauthenticated"),this.changeUIState("start"),this._client.clearState()}renderViews(){if(this.connectionState==="connecting")return Tl();if(this.uiState==="hosting")return kl({email:this._email,password:this._passowrd,changeEmail:this.changeEmail,changePassword:this.changePassword,changeState:this.changeUIState,step:this._hostingStep,setHostingStep:this.setHostingStep,login:this.loginToHosting,checkEmail:this.checkEmail,passwordError:this._passwordError,isHostingRunning:this._hostingNotRunningError,setIsHostingRunning:this.setIsHostingRunning});if(this.uiState==="qr")return Ol({changeState:this.changeUIState,onSuccess:r=>{this.changeUrl(r),this._client.connect(r)},uiState:this.uiState});if(this.authState==="locked")return Sl({unlockAgent:this.unlockAgent,reconnect:this.connect});if(this.uiState==="settings")return Dl({port:this.port,changePort:this.changePort,isRemote:this._isRemote,changeIsRemote:this.changeIsRemote,url:this.url,changeState:this.changeUIState,changeUrl:this.changeUrl,connectToPort:this._client.connectToPort,connectRemote:this.connectRemote,clearState:this.clearState});if(this.connectionState==="not_connected")return Nl({scanQrcode:this.startCamera,connect:this.connect,isMobile:this._isMobile,hasClickedDownload:this._hasClickedDownload,onDownloaded:this.onDownloaded,changeState:this.changeUIState,hosting:this.hosting});if(this.connectionState==="connected")return this.uiState==="verifycode"?Rl({code:this._code,changeCode:this.changeCode,changeState:this.changeUIState,verifyCode:this.verifyCode,isHosting:this._client.isHosting,verifyCodeError:this._verifyCodeError}):Il({changeState:this.changeUIState,requestCapability:this.requestCapability,capabilities:this.capabilities,appname:this.appName,setOpen:this.setOpen,appiconpath:this.appIconPath});if(this.connectionState==="disconnected")return El({reconnect:this.connect});if(this.connectionState==="port_not_found")return Cl()}mobileView(){return this.mobile?Al({openModal:()=>{this.changeUIState("settings"),this._isOpen=!this._isOpen}}):null}render(){return console.log(this.authState,this.connectionState,this.uiState,this._isOpen),this._isOpen===!1?this.authState==="authenticated"?this.mobileView():null:B`
|
|
2141
2145
|
<div class="wrapper">
|
|
2142
2146
|
<div class="dialog">
|
|
2143
|
-
${
|
|
2147
|
+
${xl()}
|
|
2144
2148
|
<main class="dialog__content">${this.renderViews()}</main>
|
|
2145
2149
|
${this.mobileView()}
|
|
2146
2150
|
</div>
|
|
2147
2151
|
<div class="ad4mConnect__backdrop" />
|
|
2148
2152
|
</div>
|
|
2149
|
-
`}};ce.styles=[
|
|
2153
|
+
`}};ce.styles=[$2],ve([Ze()],ce.prototype,"_code",2),ve([Ze()],ce.prototype,"_isMobile",2),ve([Ze()],ce.prototype,"_hasClickedDownload",2),ve([Ze()],ce.prototype,"_isRemote",2),ve([Ze()],ce.prototype,"_client",2),ve([Ze()],ce.prototype,"_isOpen",2),ve([Ze()],ce.prototype,"_hostingStep",2),ve([Ze()],ce.prototype,"_email",2),ve([Ze()],ce.prototype,"_passowrd",2),ve([Ze()],ce.prototype,"_passwordError",2),ve([Ze()],ce.prototype,"_hostingNotRunningError",2),ve([Ze()],ce.prototype,"_verifyCodeError",2),ve([Ze()],ce.prototype,"_isHostingLoading",2),ve([Ze()],ce.prototype,"uiState",2),ve([ft({type:String,reflect:!0})],ce.prototype,"appName",2),ve([ft({type:String,reflect:!0})],ce.prototype,"appDesc",2),ve([ft({type:String,reflect:!0})],ce.prototype,"appDomain",2),ve([ft({type:String,reflect:!0})],ce.prototype,"appIconPath",2),ve([ft({type:Boolean,reflect:!0})],ce.prototype,"mobile",2),ve([ft({type:String,reflect:!0})],ce.prototype,"capabilities",2),ve([ft({type:Boolean,reflect:!0})],ce.prototype,"hosting",2),ve([ft({type:String})],ce.prototype,"token",2),ve([ft({type:String,reflect:!0})],ce.prototype,"port",2),ve([ft({type:String,reflect:!0})],ce.prototype,"url",2),ce=ve([tf("ad4m-connect")],ce);function F2(t){let e=new ce;return Object.entries(t).forEach(([r,n])=>{e[r]=n}),document.body.appendChild(e),e}export{ce as Ad4mConnectElement,F2 as default,R2 as getAd4mClient};
|
|
2150
2154
|
/*!
|
|
2151
2155
|
* @undecaf/barcode-detector-polyfill v0.9.20
|
|
2152
2156
|
* A WebAssembly polyfill for the Barcode Detection API
|