@coasys/ad4m-connect 0.10.1-rc9-dev9 → 0.10.1-release-candidate-1-dev1
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 +284 -248
- package/dist/utils.js +1 -1
- package/dist/web.js +314 -278
- package/package.json +2 -2
package/dist/web.js
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
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]`,
|
|
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(`
|
|
1
|
+
var A1=Object.defineProperty;var I1=Object.getOwnPropertyDescriptor;var xe=(t,e,r,n)=>{for(var i=n>1?void 0:n?I1(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&&A1(e,r,i),i};var me=(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 oe,ZBarConfigType as ef,scanRGBABuffer as O1,getDefaultScanner as D1}from"https://cdn.jsdelivr.net/npm/@undecaf/zbar-wasm@0.9.15/dist/main.js";function N1(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 L=class{constructor(e,r=ef.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 L.formatsToConfigs[e]=r,L.typesToFormats[n]=L.typesToFormats[n]||e,r}static formats(){return Object.keys(L.formatsToConfigs)}static toFormat(e){return L.typesToFormats[e]}static configure(e,r){var n;(n=L.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}},Xl;L.formatsToConfigs={},L.typesToFormats={},L.register("codabar",new L(oe.ZBAR_CODABAR)),L.register("code_39",new L(oe.ZBAR_CODE39)),L.register("code_93",new L(oe.ZBAR_CODE93)),L.register("code_128",new L(oe.ZBAR_CODE128)),L.register("databar",new L(oe.ZBAR_DATABAR)),L.register("databar_exp",new L(oe.ZBAR_DATABAR_EXP)),L.register("ean_2",new L(oe.ZBAR_EAN2)),L.register("ean_5",new L(oe.ZBAR_EAN5)),L.register("ean_8",new L(oe.ZBAR_EAN8)),L.register("ean_13",new L(oe.ZBAR_EAN13)),L.register("ean_13+2",new L(oe.ZBAR_EAN13)).add(new L(oe.ZBAR_EAN2)),L.register("ean_13+5",new L(oe.ZBAR_EAN13)).add(new L(oe.ZBAR_EAN5)),L.register("isbn_10",new L(oe.ZBAR_ISBN10)).add(new L(oe.ZBAR_EAN13)),L.register("isbn_13",new L(oe.ZBAR_ISBN13)).add(new L(oe.ZBAR_EAN13)),L.register("isbn_13+2",new L(oe.ZBAR_ISBN13)).add(new L(oe.ZBAR_EAN13)).add(new L(oe.ZBAR_EAN2)),L.register("isbn_13+5",new L(oe.ZBAR_ISBN13)).add(new L(oe.ZBAR_EAN13)).add(new L(oe.ZBAR_EAN5)),L.register("itf",new L(oe.ZBAR_I25)),L.register("qr_code",new L(oe.ZBAR_QRCODE)),L.register("sq_code",new L(oe.ZBAR_SQCODE)),L.register("upc_a",new L(oe.ZBAR_UPCA)).add(new L(oe.ZBAR_EAN13)),L.register("upc_e",new L(oe.ZBAR_UPCE)).add(new L(oe.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"}(Xl||(Xl={}));var ic=class{},R1=(()=>{try{return new OffscreenCanvas(1,1).getContext("2d")instanceof OffscreenCanvasRenderingContext2D}catch{return!1}})(),kr=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=>!L.formats().includes(n));if(r.length)throw new TypeError(`Unsupported barcode format(s): ${r.join(", ")}`)}this.formats=e.formats||L.formats(),this.zbarConfig=e.zbar||new ic}static getSupportedFormats(){return Promise.resolve(L.formats())}detect(e){if(!kr.isImageBitmapSource(e))throw new TypeError("BarcodeDetector.detect() argument is not an ImageBitmapSource");let r=kr.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),O1(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)=>N1(this,void 0,void 0,function*(){if(!this.scanner){let n=yield D1();this.formats.length>0&&(n.setConfig(oe.ZBAR_NONE,ef.ZBAR_CFG_ENABLE,0),this.formats.forEach(i=>L.configure(n,i))),this.scanner=n}e(this.scanner)}))}toImageData(e){let r=n=>{let i=kr.intrinsicDimensions(n);this.canvas&&this.canvas.width===i.width&&this.canvas.height===i.height||(this.canvas=function(s,u){if(R1)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:L.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 co=window,uo=co.ShadowRoot&&(co.ShadyCSS===void 0||co.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,ac=Symbol(),tf=new WeakMap,Vi=class{constructor(e,r,n){if(this._$cssResult$=!0,n!==ac)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(uo&&e===void 0){let n=r!==void 0&&r.length===1;n&&(e=tf.get(r)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&tf.set(r,e))}return e}toString(){return this.cssText}},rf=t=>new Vi(typeof t=="string"?t:t+"",void 0,ac),oc=(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 Vi(r,t,ac)},sc=(t,e)=>{uo?t.adoptedStyleSheets=e.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet):e.forEach(r=>{let n=document.createElement("style"),i=co.litNonce;i!==void 0&&n.setAttribute("nonce",i),n.textContent=r.cssText,t.appendChild(n)})},lo=uo?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let r="";for(let n of e.cssRules)r+=n.cssText;return rf(r)})(t):t;var cc,fo=window,nf=fo.trustedTypes,P1=nf?nf.emptyScript:"",af=fo.reactiveElementPolyfillSupport,lc={toAttribute(t,e){switch(e){case Boolean:t=t?P1: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}},of=(t,e)=>e!==t&&(e==e||t==t),uc={attribute:!0,type:String,converter:lc,reflect:!1,hasChanged:of},fc="finalized",fr=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=uc){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)||uc}static finalize(){if(this.hasOwnProperty(fc))return!1;this[fc]=!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(lo(i))}else e!==void 0&&r.push(lo(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 sc(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=uc){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:lc).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:lc;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||of)(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){}};fr[fc]=!0,fr.elementProperties=new Map,fr.elementStyles=[],fr.shadowRootOptions={mode:"open"},af?.({ReactiveElement:fr}),((cc=fo.reactiveElementVersions)!==null&&cc!==void 0?cc:fo.reactiveElementVersions=[]).push("1.6.3");var pc,po=window,Xn=po.trustedTypes,sf=Xn?Xn.createPolicy("lit-html",{createHTML:t=>t}):void 0,hc="$lit$",Tr=`lit$${(Math.random()+"").slice(9)}$`,hf="?"+Tr,L1=`<${hf}>`,sn=document,Qi=()=>sn.createComment(""),Gi=t=>t===null||typeof t!="object"&&typeof t!="function",mf=Array.isArray,F1=t=>mf(t)||typeof t?.[Symbol.iterator]=="function",dc=`[
|
|
2
|
+
\f\r]`,zi=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,cf=/-->/g,uf=/>/g,an=RegExp(`>|${dc}(?:([^\\s"'>=/]+)(${dc}*=${dc}*(?:[^
|
|
3
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),lf=/'/g,ff=/"/g,gf=/^(?:script|style|textarea|title)$/i,yf=t=>(e,...r)=>({_$litType$:t,strings:e,values:r}),z=yf(1),f3=yf(2),cn=Symbol.for("lit-noChange"),ze=Symbol.for("lit-nothing"),pf=new WeakMap,on=sn.createTreeWalker(sn,129,null,!1);function vf(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return sf!==void 0?sf.createHTML(e):e}var $1=(t,e)=>{let r=t.length-1,n=[],i,a=e===2?"<svg>":"",o=zi;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===zi?l[1]==="!--"?o=cf:l[1]!==void 0?o=uf:l[2]!==void 0?(gf.test(l[2])&&(i=RegExp("</"+l[2],"g")),o=an):l[3]!==void 0&&(o=an):o===an?l[0]===">"?(o=i??zi,d=-1):l[1]===void 0?d=-2:(d=o.lastIndex-l[2].length,c=l[1],o=l[3]===void 0?an:l[3]==='"'?ff:lf):o===ff||o===lf?o=an:o===cf||o===uf?o=zi:(o=an,i=void 0);let f=o===an&&t[s+1].startsWith("/>")?" ":"";a+=o===zi?u+L1:d>=0?(n.push(c),u.slice(0,d)+hc+u.slice(d)+Tr+f):u+Tr+(d===-2?(n.push(void 0),s):f)}return[vf(t,a+(t[r]||"<?>")+(e===2?"</svg>":"")),n]},un=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]=$1(e,r);if(this.el=un.createElement(c,n),on.currentNode=this.el.content,r===2){let d=this.el.content,p=d.firstChild;p.remove(),d.append(...p.childNodes)}for(;(i=on.nextNode())!==null&&u.length<s;){if(i.nodeType===1){if(i.hasAttributes()){let d=[];for(let p of i.getAttributeNames())if(p.endsWith(hc)||p.startsWith(Tr)){let f=l[o++];if(d.push(p),f!==void 0){let h=i.getAttribute(f.toLowerCase()+hc).split(Tr),y=/([.?@])?(.*)/.exec(f);u.push({type:1,index:a,name:y[2],strings:h,ctor:y[1]==="."?gc:y[1]==="?"?yc:y[1]==="@"?vc:ti})}else u.push({type:6,index:a})}for(let p of d)i.removeAttribute(p)}if(gf.test(i.tagName)){let d=i.textContent.split(Tr),p=d.length-1;if(p>0){i.textContent=Xn?Xn.emptyScript:"";for(let f=0;f<p;f++)i.append(d[f],Qi()),on.nextNode(),u.push({type:2,index:++a});i.append(d[p],Qi())}}}else if(i.nodeType===8)if(i.data===hf)u.push({type:2,index:a});else{let d=-1;for(;(d=i.data.indexOf(Tr,d+1))!==-1;)u.push({type:7,index:a}),d+=Tr.length-1}a++}}static createElement(e,r){let n=sn.createElement("template");return n.innerHTML=e,n}};function ei(t,e,r=t,n){var i,a,o,s;if(e===cn)return e;let u=n!==void 0?(i=r._$Co)===null||i===void 0?void 0:i[n]:r._$Cl,c=Gi(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=ei(t,u._$AS(t,e.values),u,n)),e}var mc=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:sn).importNode(n,!0);on.currentNode=a;let o=on.nextNode(),s=0,u=0,c=i[0];for(;c!==void 0;){if(s===c.index){let l;c.type===2?l=new ln(o,o.nextSibling,this,e):c.type===1?l=new c.ctor(o,c.name,c.strings,this,e):c.type===6&&(l=new bc(o,this,e)),this._$AV.push(l),c=i[++u]}s!==c?.index&&(o=on.nextNode(),s++)}return on.currentNode=sn,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++}},ln=class{constructor(e,r,n,i){var a;this.type=2,this._$AH=ze,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=ei(this,e,r),Gi(e)?e===ze||e==null||e===""?(this._$AH!==ze&&this._$AR(),this._$AH=ze):e!==this._$AH&&e!==cn&&this._(e):e._$litType$!==void 0?this.g(e):e.nodeType!==void 0?this.$(e):F1(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!==ze&&Gi(this._$AH)?this._$AA.nextSibling.data=e:this.$(sn.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=un.createElement(vf(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 mc(a,this),s=o.u(this.options);o.v(n),this.$(s),this._$AH=o}}_$AC(e){let r=pf.get(e.strings);return r===void 0&&pf.set(e.strings,r=new un(e)),r}T(e){mf(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 ln(this.k(Qi()),this.k(Qi()),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))}},ti=class{constructor(e,r,n,i,a){this.type=1,this._$AH=ze,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=ze}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=ei(this,e,r,0),o=!Gi(e)||e!==this._$AH&&e!==cn,o&&(this._$AH=e);else{let s=e,u,c;for(e=a[0],u=0;u<a.length-1;u++)c=ei(this,s[n+u],r,u),c===cn&&(c=this._$AH[u]),o||(o=!Gi(c)||c!==this._$AH[u]),c===ze?e=ze:e!==ze&&(e+=(c??"")+a[u+1]),this._$AH[u]=c}o&&!i&&this.j(e)}j(e){e===ze?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},gc=class extends ti{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===ze?void 0:e}},M1=Xn?Xn.emptyScript:"",yc=class extends ti{constructor(){super(...arguments),this.type=4}j(e){e&&e!==ze?this.element.setAttribute(this.name,M1):this.element.removeAttribute(this.name)}},vc=class extends ti{constructor(e,r,n,i,a){super(e,r,n,i,a),this.type=5}_$AI(e,r=this){var n;if((e=(n=ei(this,e,r,0))!==null&&n!==void 0?n:ze)===cn)return;let i=this._$AH,a=e===ze&&i!==ze||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,o=e!==ze&&(i===ze||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)}},bc=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){ei(this,e)}};var df=po.litHtmlPolyfillSupport;df?.(un,ln),((pc=po.litHtmlVersions)!==null&&pc!==void 0?pc:po.litHtmlVersions=[]).push("2.8.0");var bf=(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 ln(e.insertBefore(Qi(),s),s,void 0,r??{})}return o._$AI(t),o};var _c,wc;var Ar=class extends fr{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=bf(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 cn}};Ar.finalized=!0,Ar._$litElement$=!0,(_c=globalThis.litElementHydrateSupport)===null||_c===void 0||_c.call(globalThis,{LitElement:Ar});var _f=globalThis.litElementPolyfillSupport;_f?.({LitElement:Ar});((wc=globalThis.litElementVersions)!==null&&wc!==void 0?wc:globalThis.litElementVersions=[]).push("3.3.3");var wf=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 U1=(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)}},j1=(t,e,r)=>{e.constructor.createProperty(r,t)};function vt(t){return(e,r)=>r!==void 0?j1(t,e,r):U1(t,e)}function nt(t){return vt({...t,state:!0})}var Sc,M3=((Sc=window.HTMLSlotElement)===null||Sc===void 0?void 0:Sc.prototype.assignedElements)!=null?(t,e)=>t.assignedElements(e):(t,e)=>t.assignedNodes(e).filter(r=>r.nodeType===Node.ELEMENT_NODE);var xc=function(t,e){return xc=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])},xc(t,e)};function Oe(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");xc(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var w=function(){return w=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},w.apply(this,arguments)};function Wt(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 $t(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 Mt(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 Ir(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 Ec="Invariant Violation",Sf=Object.setPrototypeOf,B1=Sf===void 0?function(t,e){return t.__proto__=e,t}:Sf,Q=function(t){Oe(e,t);function e(r){r===void 0&&(r=Ec);var n=t.call(this,typeof r=="number"?Ec+": "+r+" (see https://github.com/apollographql/invariant-packages)":r)||this;return n.framesToPop=1,n.name=Ec,B1(n,e.prototype),n}return e}(Error);function O(t,e){if(!t)throw new Q(e)}var mo=["debug","log","warn","error","silent"],Cc=mo.indexOf("log");function ho(t){return function(){if(mo.indexOf(t)>=Cc){var e=console[t]||console.log;return e.apply(console,arguments)}}}(function(t){t.debug=ho("debug"),t.log=ho("log"),t.warn=ho("warn"),t.error=ho("error")})(O||(O={}));function xf(t){var e=mo[Cc];return Cc=Math.max(0,mo.indexOf(t)),e}function Qe(t){try{return t()}catch{}}var go=Qe(function(){return globalThis})||Qe(function(){return window})||Qe(function(){return self})||Qe(function(){return global})||Qe(function(){return Qe.constructor("return this")()});var Ef="__",Cf=[Ef,Ef].join("DEV");function q1(){try{return Boolean(__DEV__)}catch{return Object.defineProperty(go,Cf,{value:Qe(function(){return"production"})!=="production",enumerable:!1,configurable:!0,writable:!0}),go[Cf]}}var fn=q1();function Or(t){try{return t()}catch{}}var kc=Or(function(){return globalThis})||Or(function(){return window})||Or(function(){return self})||Or(function(){return global})||Or(function(){return Or.constructor("return this")()}),Tc=!1;function V1(){kc&&!Or(function(){return"production"})&&!Or(function(){return process})&&(Object.defineProperty(kc,"process",{value:{env:{NODE_ENV:"production"}},configurable:!0,enumerable:!1,writable:!0}),Tc=!0)}V1();function Ac(){Tc&&(delete kc.process,Tc=!1)}var lb=typeof Symbol=="function"&&Symbol.iterator!=null?Symbol.iterator:"@@iterator",fb=typeof Symbol=="function"&&Symbol.asyncIterator!=null?Symbol.asyncIterator:"@@asyncIterator",kf=typeof Symbol=="function"&&Symbol.toStringTag!=null?Symbol.toStringTag:"@@toStringTag";var Le=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 Ic(t,e){var r=Boolean(t);if(!r)throw new Error(e??"Unexpected invariant triggered.")}var z1=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):void 0,Ki=z1;function yo(t){var e=t.prototype.toJSON;typeof e=="function"||Ic(0),t.prototype.inspect=e,Ki&&(t.prototype[Ki]=e)}var Tf=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}();yo(Tf);var Af=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}();yo(Af);function Oc(t){return t!=null&&typeof t.kind=="string"}function vo(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?vo=function(r){return typeof r}:vo=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},vo(t)}var Q1=10,If=2;function Wi(t){return bo(t,[])}function bo(t,e){switch(vo(t)){case"string":return JSON.stringify(t);case"function":return t.name?"[function ".concat(t.name,"]"):"[function]";case"object":return t===null?"null":G1(t,e);default:return String(t)}}function G1(t,e){if(e.indexOf(t)!==-1)return"[Circular]";var r=[].concat(e,[t]),n=W1(t);if(n!==void 0){var i=n.call(t);if(i!==t)return typeof i=="string"?i:bo(i,r)}else if(Array.isArray(t))return K1(t,r);return H1(t,r)}function H1(t,e){var r=Object.keys(t);if(r.length===0)return"{}";if(e.length>If)return"["+Z1(t)+"]";var n=r.map(function(i){var a=bo(t[i],e);return i+": "+a});return"{ "+n.join(", ")+" }"}function K1(t,e){if(t.length===0)return"[]";if(e.length>If)return"[Array]";for(var r=Math.min(Q1,t.length),n=t.length-r,i=[],a=0;a<r;++a)i.push(bo(t[a],e));return n===1?i.push("... 1 more item"):n>1&&i.push("... ".concat(n," more items")),"["+i.join(", ")+"]"}function W1(t){var e=t[String(Ki)];if(typeof e=="function")return e;if(typeof t.inspect=="function")return t.inspect}function Z1(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 Zi(t,e){var r=Boolean(t);if(!r)throw new Error(e)}function Of(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 Y1(t,e,r){return e&&Of(t.prototype,e),r&&Of(t,r),t}var _o=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"||Zi(0,"Body must be a string. Received: ".concat(Wi(e),".")),this.body=e,this.name=r,this.locationOffset=n,this.locationOffset.line>0||Zi(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||Zi(0,"column in locationOffset is 1-indexed and must be positive.")}return Y1(t,[{key:kf,get:function(){return"Source"}}]),t}();function Df(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 J1={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"]},pn=Object.freeze({});function rt(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:J1,n=void 0,i=Array.isArray(t),a=[t],o=-1,s=[],u=void 0,c=void 0,l=void 0,d=[],p=[],f=t;do{o++;var h=o===a.length,y=h&&s.length!==0;if(h){if(c=p.length===0?void 0:d[d.length-1],u=l,l=p.pop(),y){if(i)u=u.slice();else{for(var v={},S=0,_=Object.keys(u);S<_.length;S++){var b=_[S];v[b]=u[b]}u=v}for(var g=0,I=0;I<s.length;I++){var R=s[I][0],k=s[I][1];i&&(R-=g),i&&k===null?(u.splice(R,1),g++):u[R]=k}}o=n.index,a=n.keys,s=n.edits,i=n.inArray,n=n.prev}else{if(c=l?i?o:a[o]:void 0,u=l?l[c]:f,u==null)continue;l&&d.push(c)}var D=void 0;if(!Array.isArray(u)){if(!Oc(u))throw new Error("Invalid AST Node: ".concat(Wi(u),"."));var F=Dc(e,u.kind,h);if(F){if(D=F.call(e,u,c,l,d,p),D===pn)break;if(D===!1){if(!h){d.pop();continue}}else if(D!==void 0&&(s.push([c,D]),!h))if(Oc(D))u=D;else{d.pop();continue}}}if(D===void 0&&y&&s.push([c,u]),h)d.pop();else{var P;n={inArray:i,index:o,keys:a,edits:s,prev:n},i=Array.isArray(u),a=i?u:(P=r[u.kind])!==null&&P!==void 0?P:[],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 Dc(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 ri(t){return rt(t,{leave:em})}var X1=80,em={Name:function(e){return e.value},Variable:function(e){return"$"+e.name},Document:function(e){return $(e.definitions,`
|
|
8
8
|
|
|
9
9
|
`)+`
|
|
10
|
-
`},OperationDefinition:function(e){var r=e.operation,n=e.name,i=
|
|
11
|
-
`,
|
|
10
|
+
`},OperationDefinition:function(e){var r=e.operation,n=e.name,i=Ae("(",$(e.variableDefinitions,", "),")"),a=$(e.directives," "),o=e.selectionSet;return!n&&!a&&!i&&r==="query"?o:$([r,$([n,i]),a,o]," ")},VariableDefinition:function(e){var r=e.variable,n=e.type,i=e.defaultValue,a=e.directives;return r+": "+n+Ae(" = ",i)+Ae(" ",$(a," "))},SelectionSet:function(e){var r=e.selections;return jt(r)},Field:function(e){var r=e.alias,n=e.name,i=e.arguments,a=e.directives,o=e.selectionSet,s=Ae("",r,": ")+n,u=s+Ae("(",$(i,", "),")");return u.length>X1&&(u=s+Ae(`(
|
|
11
|
+
`,wo($(i,`
|
|
12
12
|
`)),`
|
|
13
|
-
)`))
|
|
14
|
-
`,
|
|
13
|
+
)`)),$([u,$(a," "),o]," ")},Argument:function(e){var r=e.name,n=e.value;return r+": "+n},FragmentSpread:function(e){var r=e.name,n=e.directives;return"..."+r+Ae(" ",$(n," "))},InlineFragment:function(e){var r=e.typeCondition,n=e.directives,i=e.selectionSet;return $(["...",Ae("on ",r),$(n," "),i]," ")},FragmentDefinition:function(e){var r=e.name,n=e.typeCondition,i=e.variableDefinitions,a=e.directives,o=e.selectionSet;return"fragment ".concat(r).concat(Ae("(",$(i,", "),")")," ")+"on ".concat(n," ").concat(Ae("",$(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?Df(n,r==="description"?"":" "):JSON.stringify(n)},BooleanValue:function(e){var r=e.value;return r?"true":"false"},NullValue:function(){return"null"},EnumValue:function(e){var r=e.value;return r},ListValue:function(e){var r=e.values;return"["+$(r,", ")+"]"},ObjectValue:function(e){var r=e.fields;return"{"+$(r,", ")+"}"},ObjectField:function(e){var r=e.name,n=e.value;return r+": "+n},Directive:function(e){var r=e.name,n=e.arguments;return"@"+r+Ae("(",$(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:Ut(function(t){var e=t.directives,r=t.operationTypes;return $(["schema",$(e," "),jt(r)]," ")}),OperationTypeDefinition:function(e){var r=e.operation,n=e.type;return r+": "+n},ScalarTypeDefinition:Ut(function(t){var e=t.name,r=t.directives;return $(["scalar",e,$(r," ")]," ")}),ObjectTypeDefinition:Ut(function(t){var e=t.name,r=t.interfaces,n=t.directives,i=t.fields;return $(["type",e,Ae("implements ",$(r," & ")),$(n," "),jt(i)]," ")}),FieldDefinition:Ut(function(t){var e=t.name,r=t.arguments,n=t.type,i=t.directives;return e+(Nf(r)?Ae(`(
|
|
14
|
+
`,wo($(r,`
|
|
15
15
|
`)),`
|
|
16
|
-
)`):
|
|
17
|
-
`,
|
|
16
|
+
)`):Ae("(",$(r,", "),")"))+": "+n+Ae(" ",$(i," "))}),InputValueDefinition:Ut(function(t){var e=t.name,r=t.type,n=t.defaultValue,i=t.directives;return $([e+": "+r,Ae("= ",n),$(i," ")]," ")}),InterfaceTypeDefinition:Ut(function(t){var e=t.name,r=t.interfaces,n=t.directives,i=t.fields;return $(["interface",e,Ae("implements ",$(r," & ")),$(n," "),jt(i)]," ")}),UnionTypeDefinition:Ut(function(t){var e=t.name,r=t.directives,n=t.types;return $(["union",e,$(r," "),n&&n.length!==0?"= "+$(n," | "):""]," ")}),EnumTypeDefinition:Ut(function(t){var e=t.name,r=t.directives,n=t.values;return $(["enum",e,$(r," "),jt(n)]," ")}),EnumValueDefinition:Ut(function(t){var e=t.name,r=t.directives;return $([e,$(r," ")]," ")}),InputObjectTypeDefinition:Ut(function(t){var e=t.name,r=t.directives,n=t.fields;return $(["input",e,$(r," "),jt(n)]," ")}),DirectiveDefinition:Ut(function(t){var e=t.name,r=t.arguments,n=t.repeatable,i=t.locations;return"directive @"+e+(Nf(r)?Ae(`(
|
|
17
|
+
`,wo($(r,`
|
|
18
18
|
`)),`
|
|
19
|
-
)`):
|
|
20
|
-
`)}}function
|
|
21
|
-
`,
|
|
19
|
+
)`):Ae("(",$(r,", "),")"))+(n?" repeatable":"")+" on "+$(i," | ")}),SchemaExtension:function(e){var r=e.directives,n=e.operationTypes;return $(["extend schema",$(r," "),jt(n)]," ")},ScalarTypeExtension:function(e){var r=e.name,n=e.directives;return $(["extend scalar",r,$(n," ")]," ")},ObjectTypeExtension:function(e){var r=e.name,n=e.interfaces,i=e.directives,a=e.fields;return $(["extend type",r,Ae("implements ",$(n," & ")),$(i," "),jt(a)]," ")},InterfaceTypeExtension:function(e){var r=e.name,n=e.interfaces,i=e.directives,a=e.fields;return $(["extend interface",r,Ae("implements ",$(n," & ")),$(i," "),jt(a)]," ")},UnionTypeExtension:function(e){var r=e.name,n=e.directives,i=e.types;return $(["extend union",r,$(n," "),i&&i.length!==0?"= "+$(i," | "):""]," ")},EnumTypeExtension:function(e){var r=e.name,n=e.directives,i=e.values;return $(["extend enum",r,$(n," "),jt(i)]," ")},InputObjectTypeExtension:function(e){var r=e.name,n=e.directives,i=e.fields;return $(["extend input",r,$(n," "),jt(i)]," ")}};function Ut(t){return function(e){return $([e.description,t(e)],`
|
|
20
|
+
`)}}function $(t){var e,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return(e=t?.filter(function(n){return n}).join(r))!==null&&e!==void 0?e:""}function jt(t){return Ae(`{
|
|
21
|
+
`,wo($(t,`
|
|
22
22
|
`)),`
|
|
23
|
-
}`)}function
|
|
24
|
-
`))}function
|
|
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
|
|
23
|
+
}`)}function Ae(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";return e!=null&&e!==""?t+e+r:""}function wo(t){return Ae(" ",t.replace(/\n/g,`
|
|
24
|
+
`))}function tm(t){return t.indexOf(`
|
|
25
|
+
`)!==-1}function Nf(t){return t!=null&&t.some(tm)}function Yi(t){return t.kind===Le.FIELD||t.kind===Le.FRAGMENT_SPREAD||t.kind===Le.INLINE_FRAGMENT}function Rf(){return typeof _o=="function"?Ac():Ac()}function fm(){__DEV__?O(typeof fn=="boolean",fn):O(typeof fn=="boolean",39)}Rf();fm();function pr(t,e){var r=t.directives;return!r||!r.length?!0:Pf(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__?O(o!==void 0,"Invalid variable referenced in @".concat(i.name.value," directive.")):O(o!==void 0,40)):o=a.value.value,i.name.value==="skip"?!o:o})}function ni(t,e,r){var n=new Set(t),i=n.size;return rt(e,{Directive:function(a){if(n.delete(a.name.value)&&(!r||!n.size))return pn}}),r?!n.size:n.size<i}function Nc(t){return t&&ni(["client","export"],t,!0)}function pm(t){var e=t.name.value;return e==="skip"||e==="include"}function Pf(t){var e=[];return t&&t.length&&t.forEach(function(r){if(!!pm(r)){var n=r.arguments,i=r.name.value;__DEV__?O(n&&n.length===1,"Incorrect number of arguments for the @".concat(i," directive.")):O(n&&n.length===1,41);var a=n[0];__DEV__?O(a.name&&a.name.value==="if","Invalid argument for the @".concat(i," directive.")):O(a.name&&a.name.value==="if",42);var o=a.value;__DEV__?O(o&&(o.kind==="Variable"||o.kind==="BooleanValue"),"Argument for the @".concat(i," directive must be a variable or a boolean value.")):O(o&&(o.kind==="Variable"||o.kind==="BooleanValue"),43),e.push({directive:r,ifArgument:a})}}),e}function Rc(t,e){var r=e,n=[];t.definitions.forEach(function(a){if(a.kind==="OperationDefinition")throw __DEV__?new Q("Found a ".concat(a.operation," operation").concat(a.name?" named '".concat(a.name.value,"'"):"",". ")+"No operations are allowed when using a fragment as a query. Only fragments are allowed."):new Q(44);a.kind==="FragmentDefinition"&&n.push(a)}),typeof r>"u"&&(__DEV__?O(n.length===1,"Found ".concat(n.length," fragments. `fragmentName` must be provided when there is not exactly 1 fragment.")):O(n.length===1,45),r=n[0].name.value);var i=w(w({},t),{definitions:Ir([{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:r}}]}}],t.definitions,!0)});return i}function dn(t){t===void 0&&(t=[]);var e={};return t.forEach(function(r){e[r.name.value]=r}),e}function hn(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__?O(n,"No fragment named ".concat(r)):O(n,46),n||null}default:return null}}function ie(t){return t!==null&&typeof t=="object"}function Zt(t){return{__ref:String(t)}}function X(t){return Boolean(t&&typeof t=="object"&&typeof t.__ref=="string")}function Pc(t){return ie(t)&&t.kind==="Document"&&Array.isArray(t.definitions)}function dm(t){return t.kind==="StringValue"}function hm(t){return t.kind==="BooleanValue"}function mm(t){return t.kind==="IntValue"}function gm(t){return t.kind==="FloatValue"}function ym(t){return t.kind==="Variable"}function vm(t){return t.kind==="ObjectValue"}function bm(t){return t.kind==="ListValue"}function _m(t){return t.kind==="EnumValue"}function wm(t){return t.kind==="NullValue"}function Dr(t,e,r,n){if(mm(r)||gm(r))t[e.value]=Number(r.value);else if(hm(r)||dm(r))t[e.value]=r.value;else if(vm(r)){var i={};r.fields.map(function(o){return Dr(i,o.name,o.value,n)}),t[e.value]=i}else if(ym(r)){var a=(n||{})[r.name.value];t[e.value]=a}else if(bm(r))t[e.value]=r.values.map(function(o){var s={};return Dr(s,e,o,n),s[e.value]});else if(_m(r))t[e.value]=r.value;else if(wm(r))t[e.value]=null;else throw __DEV__?new Q('The inline argument "'.concat(e.value,'" of kind "').concat(r.kind,'"')+"is not supported. Use variables instead of inline arguments to overcome this limitation."):new Q(55)}function Lc(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 Dr(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 Dr(n,a,o,e)})),Xi(t.name.value,n,r)}var Sm=["connection","include","skip","client","rest","export"],Xi=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(Ji(i),")")}else return r.connection.key;var a=t;if(e){var o=Ji(e);a+="(".concat(o,")")}return r&&Object.keys(r).forEach(function(s){Sm.indexOf(s)===-1&&(r[s]&&Object.keys(r[s]).length?a+="@".concat(s,"(").concat(Ji(r[s]),")"):a+="@".concat(s))}),a},{setStringify:function(t){var e=Ji;return Ji=t,e}}),Ji=function(e){return JSON.stringify(e,xm)};function xm(t,e){return ie(e)&&!Array.isArray(e)&&(e=Object.keys(e).sort().reduce(function(r,n){return r[n]=e[n],r},{})),e}function dr(t,e){if(t.arguments&&t.arguments.length){var r={};return t.arguments.forEach(function(n){var i=n.name,a=n.value;return Dr(r,i,a,e)}),r}return null}function It(t){return t.alias?t.alias.value:t.name.value}function ea(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(bt(a)){if(a.name.value==="__typename")return t[It(a)]}else{var o=ea(t,hn(a,r).selectionSet,r);if(typeof o=="string")return o}}}function bt(t){return t.kind==="Field"}function Fc(t){return t.kind==="InlineFragment"}function ii(t){__DEV__?O(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'):O(t&&t.kind==="Document",47);var e=t.definitions.filter(function(r){return r.kind!=="FragmentDefinition"}).map(function(r){if(r.kind!=="OperationDefinition")throw __DEV__?new Q('Schema type definitions not allowed in queries. Found: "'.concat(r.kind,'"')):new Q(48);return r});return __DEV__?O(e.length<=1,"Ambiguous GraphQL document: contains ".concat(e.length," operations")):O(e.length<=1,49),t}function Yt(t){return ii(t),t.definitions.filter(function(e){return e.kind==="OperationDefinition"})[0]}function ai(t){return t.definitions.filter(function(e){return e.kind==="OperationDefinition"&&!!e.name}).map(function(e){return e.name.value})[0]||null}function mn(t){return t.definitions.filter(function(e){return e.kind==="FragmentDefinition"})}function ta(t){var e=Yt(t);return __DEV__?O(e&&e.operation==="query","Must contain a query definition."):O(e&&e.operation==="query",50),e}function $c(t){__DEV__?O(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'):O(t.kind==="Document",51),__DEV__?O(t.definitions.length<=1,"Fragment must have exactly one definition."):O(t.definitions.length<=1,52);var e=t.definitions[0];return __DEV__?O(e.kind==="FragmentDefinition","Must be a fragment definition."):O(e.kind==="FragmentDefinition",53),e}function gn(t){ii(t);for(var e,r=0,n=t.definitions;r<n.length;r++){var i=n[r];if(i.kind==="OperationDefinition"){var a=i.operation;if(a==="query"||a==="mutation"||a==="subscription")return i}i.kind==="FragmentDefinition"&&!e&&(e=i)}if(e)return e;throw __DEV__?new Q("Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment."):new Q(54)}function yn(t){var e=Object.create(null),r=t&&t.variableDefinitions;return r&&r.length&&r.forEach(function(n){n.defaultValue&&Dr(e,n.variable.name,n.defaultValue)}),e}var pe=Array.isArray;function Me(t){return Array.isArray(t)&&t.length>0}var Lf={kind:Le.FIELD,name:{kind:Le.NAME,value:"__typename"}};function $f(t,e){return!t||t.selectionSet.selections.every(function(r){return r.kind===Le.FRAGMENT_SPREAD&&$f(e[r.name.value],e)})}function Em(t){return $f(Yt(t)||$c(t),dn(mn(t)))?null:t}function Cm(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 Ff(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 Mc(t,e){for(var r=Ff(""),n=Ff(""),i=function(_){for(var b=0,g=void 0;b<_.length&&(g=_[b]);++b)if(!pe(g)){if(g.kind===Le.OPERATION_DEFINITION)return r(g.name&&g.name.value);if(g.kind===Le.FRAGMENT_DEFINITION)return n(g.name.value)}return __DEV__&&O.error("Could not find operation or fragment"),null},a=0,o=e.definitions.length-1;o>=0;--o)e.definitions[o].kind===Le.OPERATION_DEFINITION&&++a;var s=Cm(t),u=t.some(function(_){return _.remove}),c=function(_){return u&&_&&_.some(s)},l=new Map,d=!1,p={enter:function(_){if(c(_.directives))return d=!0,null}},f=rt(e,{Field:p,InlineFragment:p,VariableDefinition:{enter:function(){return!1}},Variable:{enter:function(_,b,g,I,R){var k=i(R);k&&k.variables.add(_.name.value)}},FragmentSpread:{enter:function(_,b,g,I,R){if(c(_.directives))return d=!0,null;var k=i(R);k&&k.fragmentSpreads.add(_.name.value)}},FragmentDefinition:{enter:function(_,b,g,I){l.set(JSON.stringify(I),_)},leave:function(_,b,g,I){var R=l.get(JSON.stringify(I));if(_===R)return _;if(a>0&&_.selectionSet.selections.every(function(k){return k.kind===Le.FIELD&&k.name.value==="__typename"}))return n(_.name.value).removed=!0,d=!0,null}},Directive:{leave:function(_){if(s(_))return d=!0,null}}});if(!d)return e;var h=function(_){return _.transitiveVars||(_.transitiveVars=new Set(_.variables),_.removed||_.fragmentSpreads.forEach(function(b){h(n(b)).transitiveVars.forEach(function(g){_.transitiveVars.add(g)})})),_},y=new Set;f.definitions.forEach(function(_){_.kind===Le.OPERATION_DEFINITION?h(r(_.name&&_.name.value)).fragmentSpreads.forEach(function(b){y.add(b)}):_.kind===Le.FRAGMENT_DEFINITION&&a===0&&!n(_.name.value).removed&&y.add(_.name.value)}),y.forEach(function(_){h(n(_)).fragmentSpreads.forEach(function(b){y.add(b)})});var v=function(_){return!!(!y.has(_)||n(_).removed)},S={enter:function(_){if(v(_.name.value))return null}};return Em(rt(f,{FragmentSpread:S,FragmentDefinition:S,OperationDefinition:{leave:function(_){if(_.variableDefinitions){var b=h(r(_.name&&_.name.value)).transitiveVars;if(b.size<_.variableDefinitions.length)return w(w({},_),{variableDefinitions:_.variableDefinitions.filter(function(g){return b.has(g.variable.name.value)})})}}}}))}var vn=Object.assign(function(t){return rt(t,{SelectionSet:{enter:function(e,r,n){if(!(n&&n.kind===Le.OPERATION_DEFINITION)){var i=e.selections;if(!!i){var a=i.some(function(s){return bt(s)&&(s.name.value==="__typename"||s.name.value.lastIndexOf("__",0)===0)});if(!a){var o=n;if(!(bt(o)&&o.directives&&o.directives.some(function(s){return s.name.value==="export"})))return w(w({},e),{selections:Ir(Ir([],i,!0),[Lf],!1)})}}}}}})},{added:function(t){return t===Lf}}),km={test:function(t){var e=t.name.value==="connection";return e&&(!t.arguments||!t.arguments.some(function(r){return r.name.value==="key"}))&&__DEV__&&O.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 Uc(t){return Mc([km],ii(t))}function jc(t){var e=gn(t),r=e.operation;if(r==="query")return t;var n=rt(t,{OperationDefinition:{enter:function(i){return w(w({},i),{operation:"query"})}}});return n}function Bc(t){ii(t);var e=Mc([{test:function(r){return r.name.value==="client"},remove:!0}],t);return e}var Tm=Object.prototype.hasOwnProperty;function qc(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return ra(t)}function ra(t){var e=t[0]||{},r=t.length;if(r>1)for(var n=new ft,i=1;i<r;++i)e=n.merge(e,t[i]);return e}var Am=function(t,e,r){return this.merge(t[r],e[r])},ft=function(){function t(e){e===void 0&&(e=Am),this.reconciler=e,this.isObject=ie,this.pastCopies=new Set}return t.prototype.merge=function(e,r){for(var n=this,i=[],a=2;a<arguments.length;a++)i[a-2]=arguments[a];return ie(r)&&ie(e)?(Object.keys(r).forEach(function(o){if(Tm.call(e,o)){var s=e[o];if(r[o]!==s){var u=n.reconciler.apply(n,Ir([e,r,o],i,!1));u!==s&&(e=n.shallowCopyForMerge(e),e[o]=u)}}else e=n.shallowCopyForMerge(e),e[o]=r[o]}),e):r},t.prototype.shallowCopyForMerge=function(e){return ie(e)&&(this.pastCopies.has(e)||(Array.isArray(e)?e=e.slice(0):e=w({__proto__:Object.getPrototypeOf(e)},e),this.pastCopies.add(e))),e},t}();function Im(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=Om(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 Om(t,e){if(!!t){if(typeof t=="string")return Mf(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 Mf(t,e)}}function Mf(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 Uf(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 Gc(t,e,r){return e&&Uf(t.prototype,e),r&&Uf(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}var Hc=function(){return typeof Symbol=="function"},Kc=function(t){return Hc()&&Boolean(Symbol[t])},Wc=function(t){return Kc(t)?Symbol[t]:"@@"+t};Hc()&&!Kc("observable")&&(Symbol.observable=Symbol("observable"));var Dm=Wc("iterator"),zc=Wc("observable"),jf=Wc("species");function xo(t,e){var r=t[e];if(r!=null){if(typeof r!="function")throw new TypeError(r+" is not a function");return r}}function na(t){var e=t.constructor;return e!==void 0&&(e=e[jf],e===null&&(e=void 0)),e!==void 0?e:J}function Nm(t){return t instanceof J}function oi(t){oi.log?oi.log(t):setTimeout(function(){throw t})}function So(t){Promise.resolve().then(function(){try{t()}catch(e){oi(e)}})}function Bf(t){var e=t._cleanup;if(e!==void 0&&(t._cleanup=void 0,!!e))try{if(typeof e=="function")e();else{var r=xo(e,"unsubscribe");r&&r.call(e)}}catch(n){oi(n)}}function Qc(t){t._observer=void 0,t._queue=void 0,t._state="closed"}function Rm(t){var e=t._queue;if(!!e){t._queue=void 0,t._state="ready";for(var r=0;r<e.length&&(qf(t,e[r].type,e[r].value),t._state!=="closed");++r);}}function qf(t,e,r){t._state="running";var n=t._observer;try{var i=xo(n,e);switch(e){case"next":i&&i.call(n,r);break;case"error":if(Qc(t),i)i.call(n,r);else throw r;break;case"complete":Qc(t),i&&i.call(n);break}}catch(a){oi(a)}t._state==="closed"?Bf(t):t._state==="running"&&(t._state="ready")}function Vc(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}],So(function(){return Rm(t)});return}qf(t,e,r)}}var Pm=function(){function t(r,n){this._cleanup=void 0,this._observer=r,this._queue=void 0,this._state="initializing";var i=new Lm(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"&&(Qc(this),Bf(this))},Gc(t,[{key:"closed",get:function(){return this._state==="closed"}}]),t}(),Lm=function(){function t(r){this._subscription=r}var e=t.prototype;return e.next=function(n){Vc(this._subscription,"next",n)},e.error=function(n){Vc(this._subscription,"error",n)},e.complete=function(){Vc(this._subscription,"complete")},Gc(t,[{key:"closed",get:function(){return this._subscription._state==="closed"}}]),t}(),J=function(){function t(r){if(!(this instanceof t))throw new TypeError("Observable cannot be called as a function");if(typeof r!="function")throw new TypeError("Observable initializer must be a function");this._subscriber=r}var e=t.prototype;return e.subscribe=function(n){return(typeof n!="object"||n===null)&&(n={next:n,error:arguments[1],complete:arguments[2]}),new Pm(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=na(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=na(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=na(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=na(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=na(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[zc]=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=xo(n,zc);if(a){var o=a.call(n);if(Object(o)!==o)throw new TypeError(o+" is not an object");return Nm(o)&&o.constructor===i?o:new i(function(s){return o.subscribe(s)})}if(Kc("iterator")&&(a=xo(n,Dm),a))return new i(function(s){So(function(){if(!s.closed){for(var u=Im(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){So(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){So(function(){if(!s.closed){for(var u=0;u<i.length;++u)if(s.next(i[u]),s.closed)return;s.complete()}})})},Gc(t,null,[{key:jf,get:function(){return this}}]),t}();Hc()&&Object.defineProperty(J,Symbol("extensions"),{value:{symbol:zc,hostReportError:oi},configurable:!0});function Zc(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 si;typeof self<"u"?si=self:typeof window<"u"?si=window:typeof global<"u"?si=global:typeof module<"u"?si=module:si=Function("return this")();var M4=Zc(si);var Vf=J.prototype,zf="@@observable";Vf[zf]||(Vf[zf]=function(){return this});var Fm=Object.prototype.toString;function Eo(t){return Yc(t)}function Yc(t,e){switch(Fm.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]=Yc(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]=Yc(t[i],e)}),n}default:return t}}function $m(t){var e=new Set([t]);return e.forEach(function(r){ie(r)&&Mm(r)===r&&Object.getOwnPropertyNames(r).forEach(function(n){ie(r[n])&&e.add(r[n])})}),t}function Mm(t){if(__DEV__&&!Object.isFrozen(t))try{Object.freeze(t)}catch(e){if(e instanceof TypeError)return null;throw e}return t}function ia(t){return __DEV__&&$m(t),t}function bn(t,e,r){var n=[];t.forEach(function(i){return i[e]&&n.push(i)}),n.forEach(function(i){return i[e](r)})}function Co(t,e,r){return new J(function(n){var i=n.next,a=n.error,o=n.complete,s=0,u=!1,c={then:function(f){return new Promise(function(h){return h(f())})}};function l(f,h){return f?function(y){++s;var v=function(){return f(y)};c=c.then(v,v).then(function(S){--s,i&&i.call(n,S),u&&d.complete()},function(S){throw--s,S}).catch(function(S){a&&a.call(n,S)})}:function(y){return h&&h.call(n,y)}}var d={next:l(e,i),error:l(r,a),complete:function(){u=!0,s||o&&o.call(n)}},p=t.subscribe(d);return function(){return p.unsubscribe()}})}var Ot=typeof WeakMap=="function"&&Qe(function(){return navigator.product})!=="ReactNative",Qf=typeof WeakSet=="function",Jc=typeof Symbol=="function"&&typeof Symbol.for=="function",Nr=Jc&&Symbol.asyncIterator,Y4=typeof Qe(function(){return window.document.createElement})=="function",J4=Qe(function(){return navigator.userAgent.indexOf("jsdom")>=0})||!1;function ko(t){function e(r){Object.defineProperty(t,r,{value:J})}return Jc&&Symbol.species&&e(Symbol.species),e("@@species"),t}function Gf(t){return t&&typeof t.then=="function"}var ci=function(t){Oe(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),bn(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),bn(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?Gf(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"),bn(n.observers,"complete"))}}},n.nextResultListeners=new Set,n.cancel=function(i){n.reject(i),n.sources=[],n.handlers.complete()},n.promise.catch(function(i){}),typeof r=="function"&&(r=[new J(r)]),Gf(r)?r.then(function(i){return n.start(i)},n.handlers.error):n.start(r),n}return e.prototype.start=function(r){this.sub===void 0&&(this.sources=Array.from(r),this.handlers.complete())},e.prototype.deliverLastMessage=function(r){if(this.latest){var n=this.latest[0],i=r[n];i&&i.call(r,this.latest[1]),this.sub===null&&n==="next"&&r.complete&&r.complete()}},e.prototype.addObserver=function(r){this.observers.has(r)||(this.deliverLastMessage(r),this.observers.add(r))},e.prototype.removeObserver=function(r){this.observers.delete(r)&&this.observers.size<1&&this.handlers.complete()},e.prototype.notify=function(r,n){var i=this.nextResultListeners;i.size&&(this.nextResultListeners=new Set,i.forEach(function(a){return a(r,n)}))},e.prototype.beforeNext=function(r){var n=!1;this.nextResultListeners.add(function(i,a){n||(n=!0,r(i,a))})},e}(J);ko(ci);function Rr(t){return"incremental"in t}function Um(t){return"hasNext"in t&&"data"in t}function Hf(t){return Rr(t)||Um(t)}function To(t,e){var r=t,n=new ft;return Rr(e)&&Me(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 ui(t){var e=Ao(t);return Me(e)}function Ao(t){var e=Me(t.errors)?t.errors.slice(0):[];return Rr(t)&&Me(t.incremental)&&t.incremental.forEach(function(r){r.errors&&e.push.apply(e,r.errors)}),e}function Pr(){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 Kf=new Map;function aa(t){var e=Kf.get(t)||1;return Kf.set(t,e+1),"".concat(t,":").concat(e,":").concat(Math.random().toString(36).slice(2))}function Wf(t){var e=aa("stringifyForDisplay");return JSON.stringify(t,function(r,n){return n===void 0?e:n}).split(JSON.stringify(e)).join("<undefined>")}function oa(t,e){return Pr(t,e,e.variables&&{variables:w(w({},t&&t.variables),e.variables)})}function Io(t){return new J(function(e){e.error(t)})}var sa=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 Xc(t){for(var e=["query","operationName","variables","extensions","context"],r=0,n=Object.keys(t);r<n.length;r++){var i=n[r];if(e.indexOf(i)<0)throw __DEV__?new Q("illegal argument: ".concat(i)):new Q(27)}return t}function eu(t,e){var r=w({},t),n=function(a){typeof a=="function"?r=w(w({},r),a(r)):r=w(w({},r),a)},i=function(){return w({},r)};return Object.defineProperty(e,"setContext",{enumerable:!1,value:n}),Object.defineProperty(e,"getContext",{enumerable:!1,value:i}),e}function tu(t){var e={variables:t.variables||{},extensions:t.extensions||{},operationName:t.operationName,query:t.query};return e.operationName||(e.operationName=typeof e.query!="string"?ai(e.query)||void 0:""),e}function Zf(t,e){return e?e(t):J.of()}function ca(t){return typeof t=="function"?new Dt(t):t}function Oo(t){return t.request.length<=1}var jm=function(t){Oe(e,t);function e(r,n){var i=t.call(this,r)||this;return i.link=n,i}return e}(Error),Dt=function(){function t(e){e&&(this.request=e)}return t.empty=function(){return new t(function(){return J.of()})},t.from=function(e){return e.length===0?t.empty():e.map(ca).reduce(function(r,n){return r.concat(n)})},t.split=function(e,r,n){var i=ca(r),a=ca(n||new t(Zf));return Oo(i)&&Oo(a)?new t(function(o){return e(o)?i.request(o)||J.of():a.request(o)||J.of()}):new t(function(o,s){return e(o)?i.request(o,s)||J.of():a.request(o,s)||J.of()})},t.execute=function(e,r){return e.request(eu(r.context,tu(Xc(r))))||J.of()},t.concat=function(e,r){var n=ca(e);if(Oo(n))return __DEV__&&O.warn(new jm("You are calling concat on a terminating link, which will have no effect",n)),n;var i=ca(r);return Oo(i)?new t(function(a){return n.request(a,function(o){return i.request(o)||J.of()})||J.of()}):new t(function(a,o){return n.request(a,function(s){return i.request(s,o)||J.of()})||J.of()})},t.prototype.split=function(e,r,n){return this.concat(t.split(e,r,n||new t(Zf)))},t.prototype.concat=function(e){return t.concat(this,e)},t.prototype.request=function(e,r){throw __DEV__?new Q("request is not implemented"):new Q(22)},t.prototype.onError=function(e,r){if(r&&r.error)return r.error(e),!1;throw e},t.prototype.setOnError=function(e){return this.onError=e,this},t}();var li=Dt.execute;var Yf="3.7.10";function Jf(t){return!!t.body}function Xf(t){return!!t.getReader}function ep(t){return!!(Nr&&t[Symbol.asyncIterator])}function tp(t){return!!t.stream}function rp(t){return!!t.arrayBuffer}function np(t){return!!t.pipe}function ru(t){var e,r=t[Symbol.asyncIterator]();return e={next:function(){return r.next()}},e[Symbol.asyncIterator]=function(){return this},e}function nu(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 Nr&&(l[Symbol.asyncIterator]=function(){return this}),l}function iu(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 Nr&&(r[Symbol.asyncIterator]=function(){return this}),r}function Do(t){var e={next:function(){return t.read()}};return Nr&&(e[Symbol.asyncIterator]=function(){return this}),e}function ip(t){var e=t;if(Jf(t)&&(e=t.body),ep(e))return ru(e);if(Xf(e))return Do(e.getReader());if(tp(e))return Do(e.stream().getReader());if(rp(e))return iu(e.arrayBuffer());if(np(e))return nu(e);throw new Error("Unknown body type for responseIterator. Please pass a streamable response.")}var ap=Object.prototype.hasOwnProperty;function op(t,e){var r,n,i;return $t(this,void 0,void 0,function(){var a,o,s,u,c,l,d,p,f,h,y,v,S,_,b,g,I,R,k,D;return Mt(this,function(F){switch(F.label){case 0:if(TextDecoder===void 0)throw new Error("TextDecoder must be defined in the environment: please import a polyfill.");a=new TextDecoder("utf-8"),o=(r=t.headers)===null||r===void 0?void 0:r.get("content-type"),s="boundary=",u=o?.includes(s)?o?.substring(o?.indexOf(s)+s.length).replace(/['"]/g,"").replace(/\;(.*)/gm,"").trim():"-",c="--".concat(u),l="",d=ip(t),p=!0,F.label=1;case 1:return p?[4,d.next()]:[3,3];case 2:for(f=F.sent(),h=f.value,y=f.done,v=typeof h=="string"?h:a.decode(h),p=!y,l+=v,S=l.indexOf(c);S>-1;){if(_=void 0,D=[l.slice(0,S),l.slice(S+c.length)],_=D[0],l=D[1],_.trim()){if(b=_.indexOf(`\r
|
|
27
27
|
\r
|
|
28
|
-
`),
|
|
29
|
-
`,"")),(Object.keys(
|
|
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
|
+
`),g=Bm(_.slice(0,b)),I=g["content-type"],I&&I.toLowerCase().indexOf("application/json")===-1)throw new Error("Unsupported patch content type: application/json is required.");R=_.slice(b);try{k=sp(t,R.replace(`\r
|
|
29
|
+
`,"")),(Object.keys(k).length>1||"data"in k||"incremental"in k||"errors"in k)&&((n=e.next)===null||n===void 0||n.call(e,k))}catch(P){No(P,e)}}S=l.indexOf(c)}return[3,1];case 3:return(i=e.complete)===null||i===void 0||i.call(e),[2]}})})}function Bm(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 sp(t,e){if(t.status>=300){var r=function(){try{return JSON.parse(e)}catch{return e}};sa(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 No(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 cp(t,e,r){qm(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 No(n,r)})}function qm(t){return function(e){return e.text().then(function(r){return sp(e,r)}).then(function(r){return e.status>=300&&sa(e,r,"Response not successful: Received status code ".concat(e.status)),!Array.isArray(r)&&!ap.call(r,"data")&&!ap.call(r,"errors")&&sa(e,r,"Server response was missing for query '".concat(Array.isArray(t)?t.map(function(n){return n.operationName}):t.operationName,"'.")),r})}}var ua=function(t,e){var r;try{r=JSON.stringify(t)}catch(i){var n=__DEV__?new Q("Network request failed. ".concat(e," is not serializable: ").concat(i.message)):new Q(24);throw n.parseError=i,n}return r};var Vm={includeQuery:!0,includeExtensions:!1,preserveHeaderCase:!1},zm={accept:"*/*","content-type":"application/json"},Qm={method:"POST"},up={http:Vm,headers:zm,options:Qm},lp=function(t,e){return e(t)};function fp(t,e){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var i={},a={};r.forEach(function(d){i=w(w(w({},i),d.options),{headers:w(w({},i.headers),d.headers)}),d.credentials&&(i.credentials=d.credentials),a=w(w({},a),d.http)}),i.headers&&(i.headers=Gm(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,ri)),{options:i,body:l}}function Gm(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 pp=function(t){if(!t&&typeof fetch>"u")throw __DEV__?new Q(`
|
|
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 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.
|
|
38
|
+
`):new Q(23)};var dp=function(){if(typeof AbortController>"u")return{controller:!1,signal:!1};var t=new AbortController,e=t.signal;return{controller:t,signal:e}};var hp=function(t,e){var r=t.getContext(),n=r.uri;return n||(typeof e=="function"?e(t):e||"/graphql")};function mp(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=ua(e.variables,"Variables map")}catch(d){return{parseError:d}}n("variables",i)}if(e.extensions){var a=void 0;try{a=ua(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 gp=Qe(function(){return fetch}),yp=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?lp:i,o=t.includeExtensions,s=t.preserveHeaderCase,u=t.useGETForQueries,c=t.includeUnusedVariables,l=c===void 0?!1:c,d=Wt(t,["uri","fetch","print","includeExtensions","preserveHeaderCase","useGETForQueries","includeUnusedVariables"]);__DEV__&&pp(n||gp);var p={http:{includeExtensions:o,preserveHeaderCase:s},options:d.fetchOptions,credentials:d.credentials,headers:d.headers};return new Dt(function(f){var h=hp(f,r),y=f.getContext(),v={};if(y.clientAwareness){var S=y.clientAwareness,_=S.name,b=S.version;_&&(v["apollographql-client-name"]=_),b&&(v["apollographql-client-version"]=b)}var g=w(w({},v),y.headers),I={http:y.http,options:y.fetchOptions,credentials:y.credentials,headers:g},R=fp(f,a,up,p,I),k=R.options,D=R.body;if(D.variables&&!l){var F=new Set(Object.keys(D.variables));rt(f.query,{Variable:function(ne,Ht,Y){Y&&Y.kind!=="VariableDefinition"&&F.delete(ne.name.value)}}),F.size&&(D.variables=w({},D.variables),F.forEach(function(ne){delete D.variables[ne]}))}var P;if(!k.signal){var q=dp(),We=q.controller,$e=q.signal;P=We,P&&(k.signal=$e)}var V=function(ne){return ne.kind==="OperationDefinition"&&ne.operation==="mutation"};if(u&&!f.query.definitions.some(V)&&(k.method="GET"),ni(["defer"],f.query)&&(k.headers=k.headers||{},k.headers.accept="multipart/mixed; deferSpec=20220824, application/json"),k.method==="GET"){var ve=mp(h,D),be=ve.newURI,re=ve.parseError;if(re)return Io(re);h=be}else try{k.body=ua(D,"Payload")}catch(ne){return Io(ne)}return new J(function(ne){var Ht=n||Qe(function(){return fetch})||gp;return Ht(h,k).then(function(Y){var Kt;f.setContext({response:Y});var Cr=(Kt=Y.headers)===null||Kt===void 0?void 0:Kt.get("content-type");return Cr!==null&&/^multipart\/mixed/i.test(Cr)?op(Y,ne):cp(Y,f,ne)}).catch(function(Y){return No(Y,ne)}),function(){P&&P.abort()}})})};var au=function(t){Oe(e,t);function e(r){r===void 0&&(r={});var n=t.call(this,yp(r).request)||this;return n.options=r,n}return e}(Dt);var{toString:vp,hasOwnProperty:Hm}=Object.prototype,bp=Function.prototype.toString,ou=new Map;function Ee(t,e){try{return su(t,e)}finally{ou.clear()}}function su(t,e){if(t===e)return!0;let r=vp.call(t),n=vp.call(e);if(r!==n)return!1;switch(r){case"[object Array]":if(t.length!==e.length)return!1;case"[object Object]":{if(wp(t,e))return!0;let i=_p(t),a=_p(e),o=i.length;if(o!==a.length)return!1;for(let s=0;s<o;++s)if(!Hm.call(e,i[s]))return!1;for(let s=0;s<o;++s){let u=i[s];if(!su(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(wp(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&&!su(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=bp.call(t);return i!==bp.call(e)?!1:!Zm(i,Wm)}}return!1}function _p(t){return Object.keys(t).filter(Km,t)}function Km(t){return this[t]!==void 0}var Wm="{ [native code] }";function Zm(t,e){let r=t.length-e.length;return r>=0&&t.indexOf(e,r)===r}function wp(t,e){let r=ou.get(t);if(r){if(r.has(e))return!0}else ou.set(t,r=new Set);return r.add(e),!1}var Ym=function(){return Object.create(null)},Sp=Array.prototype,Jm=Sp.forEach,Xm=Sp.slice,Jt=function(){function t(e,r){e===void 0&&(e=!0),r===void 0&&(r=Ym),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 Jm.call(e,function(n){return r=r.getChildTrie(n)}),r.data||(r.data=this.makeData(Xm.call(e)))},t.prototype.getChildTrie=function(e){var r=this.weakness&&eg(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 eg(t){switch(typeof t){case"object":if(t===null)break;case"function":return!0}return!1}var Je=null,xp={},tg=1,rg=()=>class{constructor(){this.id=["slot",tg++,Date.now(),Math.random().toString(36).slice(2)].join(":")}hasValue(){for(let e=Je;e;e=e.parent)if(this.id in e.slots){let r=e.slots[this.id];if(r===xp)break;return e!==Je&&(Je.slots[this.id]=r),!0}return Je&&(Je.slots[this.id]=xp),!1}getValue(){if(this.hasValue())return Je.slots[this.id]}withValue(e,r,n,i){let a={__proto__:null,[this.id]:e},o=Je;Je={parent:o,slots:a};try{return r.apply(i,n)}finally{Je=o}}static bind(e){let r=Je;return function(){let n=Je;try{return Je=r,e.apply(this,arguments)}finally{Je=n}}}static noContext(e,r,n){if(Je){let i=Je;try{return Je=null,e.apply(n,r)}finally{Je=i}}else return e.apply(n,r)}};function Ep(t){try{return t()}catch{}}var cu="@wry/context:Slot",ng=Ep(()=>globalThis)||Ep(()=>global)||Object.create(null),Cp=ng,fi=Cp[cu]||Array[cu]||function(t){try{Object.defineProperty(Cp,cu,{value:t,enumerable:!1,writable:!1,configurable:!0})}finally{return t}}(rg());var{bind:ig,noContext:ag}=fi;function og(){}var sg=function(){function t(e,r){e===void 0&&(e=1/0),r===void 0&&(r=og),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}(),Po=new fi,uu,cg=Object.prototype.hasOwnProperty,fu=(uu=Array.from,uu===void 0?function(t){var e=[];return t.forEach(function(r){return e.push(r)}),e}:uu);function Ro(t){var e=t.unsubscribe;typeof e=="function"&&(t.unsubscribe=void 0,e())}var la=[],ug=100;function pi(t,e){if(!t)throw new Error(e||"assertion failure")}function lg(t,e){var r=t.length;return r>0&&r===e.length&&t[r-1]===e[r-1]}function Tp(t){switch(t.length){case 0:throw new Error("unknown value");case 1:return t[0];case 2:throw t[1]}}function fg(t){return t.slice(0)}var pg=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&&!Lr(this))return kp(this),this.value[0]},t.prototype.recompute=function(e){return pi(!this.recomputing,"already recomputing"),kp(this),Lr(this)?dg(this,e):Tp(this.value)},t.prototype.setDirty=function(){this.dirty||(this.dirty=!0,this.value.length=0,Ap(this),Ro(this))},t.prototype.dispose=function(){var e=this;this.setDirty(),Rp(this),pu(this,function(r,n){r.setDirty(),Pp(r,e)})},t.prototype.forget=function(){this.dispose()},t.prototype.dependOn=function(e){e.add(this),this.deps||(this.deps=la.pop()||new Set),this.deps.add(e)},t.prototype.forgetDeps=function(){var e=this;this.deps&&(fu(this.deps).forEach(function(r){return r.delete(e)}),this.deps.clear(),la.push(this.deps),this.deps=null)},t.count=0,t}();function kp(t){var e=Po.getValue();if(e)return t.parents.add(e),e.childValues.has(t)||e.childValues.set(t,[]),Lr(t)?Op(e,t):Dp(e,t),e}function dg(t,e){return Rp(t),Po.withValue(t,hg,[t,e]),gg(t,e)&&mg(t),Tp(t.value)}function hg(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 Lr(t){return t.dirty||!!(t.dirtyChildren&&t.dirtyChildren.size)}function mg(t){t.dirty=!1,!Lr(t)&&Ip(t)}function Ap(t){pu(t,Op)}function Ip(t){pu(t,Dp)}function pu(t,e){var r=t.parents.size;if(r)for(var n=fu(t.parents),i=0;i<r;++i)e(n[i],t)}function Op(t,e){pi(t.childValues.has(e)),pi(Lr(e));var r=!Lr(t);if(!t.dirtyChildren)t.dirtyChildren=la.pop()||new Set;else if(t.dirtyChildren.has(e))return;t.dirtyChildren.add(e),r&&Ap(t)}function Dp(t,e){pi(t.childValues.has(e)),pi(!Lr(e));var r=t.childValues.get(e);r.length===0?t.childValues.set(e,fg(e.value)):lg(r,e.value)||t.setDirty(),Np(t,e),!Lr(t)&&Ip(t)}function Np(t,e){var r=t.dirtyChildren;r&&(r.delete(e),r.size===0&&(la.length<ug&&la.push(r),t.dirtyChildren=null))}function Rp(t){t.childValues.size>0&&t.childValues.forEach(function(e,r){Pp(t,r)}),t.forgetDeps(),pi(t.dirtyChildren===null)}function Pp(t,e){e.parents.delete(t),t.childValues.delete(e),Np(t,e)}function gg(t,e){if(typeof t.subscribe=="function")try{Ro(t),t.unsubscribe=t.subscribe.apply(null,e)}catch{return t.setDirty(),!1}return!0}var yg={setDirty:!0,dispose:!0,forget:!0};function Lo(t){var e=new Map,r=t&&t.subscribe;function n(i){var a=Po.getValue();if(a){var o=e.get(i);o||e.set(i,o=new Set),a.dependOn(o),typeof r=="function"&&(Ro(o),o.unsubscribe=r(i))}}return n.dirty=function(a,o){var s=e.get(a);if(s){var u=o&&cg.call(yg,o)?o:"setDirty";fu(s).forEach(function(c){return c[u]()}),e.delete(a),Ro(s)}},n}function Lp(){var t=new Jt(typeof WeakMap=="function");return function(){return t.lookupArray(arguments)}}var R6=Lp(),lu=new Set;function _n(t,e){e===void 0&&(e=Object.create(null));var r=new sg(e.max||Math.pow(2,16),function(c){return c.dispose()}),n=e.keyArgs,i=e.makeCacheKey||Lp(),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 pg(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),lu.add(r),Po.hasValue()||(lu.forEach(function(p){return p.clean()}),lu.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 du=function(){function t(){this.getFragmentDoc=_n(Rc)}return t.prototype.batch=function(e){var r=this,n=typeof e.optimistic=="string"?e.optimistic:e.optimistic===!1?null:void 0,i;return this.performTransaction(function(){return i=e.update(r)},n),i},t.prototype.recordOptimisticTransaction=function(e,r){this.performTransaction(e,r)},t.prototype.transformDocument=function(e){return e},t.prototype.transformForLink=function(e){return e},t.prototype.identify=function(e){},t.prototype.gc=function(){return[]},t.prototype.modify=function(e){return!1},t.prototype.readQuery=function(e,r){return r===void 0&&(r=!!e.optimistic),this.read(w(w({},e),{rootId:e.id||"ROOT_QUERY",optimistic:r}))},t.prototype.readFragment=function(e,r){return r===void 0&&(r=!!e.optimistic),this.read(w(w({},e),{query:this.getFragmentDoc(e.fragment,e.fragmentName),rootId:e.id,optimistic:r}))},t.prototype.writeQuery=function(e){var r=e.id,n=e.data,i=Wt(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=Wt(e,["id","data","fragment","fragmentName"]);return this.write(Object.assign(o,{query:this.getFragmentDoc(i,a),dataId:r,result:n}))},t.prototype.updateQuery=function(e,r){return this.batch({update:function(n){var i=n.readQuery(e),a=r(i);return a==null?i:(n.writeQuery(w(w({},e),{data:a})),a)}})},t.prototype.updateFragment=function(e,r){return this.batch({update:function(n){var i=n.readFragment(e),a=r(i);return a==null?i:(n.writeFragment(w(w({},e),{data:a})),a)}})},t}();var fa=function(t){Oe(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 De=Object.prototype.hasOwnProperty;function pa(t){return t==null}function $o(t,e){var r=t.__typename,n=t.id,i=t._id;if(typeof r=="string"&&(e&&(e.keyObject=pa(n)?pa(i)?void 0:{_id:i}:{id:n}),pa(n)&&!pa(i)&&(n=i),!pa(n)))return"".concat(r,":").concat(typeof n=="number"||typeof n=="string"?n:JSON.stringify(n))}var Fp={dataIdFromObject:$o,addTypename:!0,resultCaching:!0,canonizeResults:!1};function $p(t){return Pr(Fp,t)}function Mo(t){var e=t.canonizeResults;return e===void 0?Fp.canonizeResults:e}function Mp(t,e){return X(e)?t.get(e.__ref,"__typename"):e&&e.__typename}var hu=/^[_a-z][_0-9a-z]*/i;function Bt(t){var e=t.match(hu);return e?e[0]:t}function Fo(t,e,r){return ie(e)?pe(e)?e.every(function(n){return Fo(t,n,r)}):t.selections.every(function(n){if(bt(n)&&pr(n,r)){var i=It(n);return De.call(e,i)&&(!n.selectionSet||Fo(n.selectionSet,e[i],r))}return!0}):!1}function Fr(t){return ie(t)&&!X(t)&&!pe(t)}function Up(){return new ft}function Uo(t,e){var r=dn(mn(t));return{fragmentMap:r,lookupFragment:function(n){var i=r[n];return!i&&e&&(i=e.lookup(n)),i||null}}}var jo=Object.create(null),mu=function(){return jo},jp=Object.create(null),di=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 ia(X(i)?n.get(i.__ref,a):i&&i[a])},this.canRead=function(i){return X(i)?n.has(i.__ref):typeof i=="object"},this.toReference=function(i,a){if(typeof i=="string")return Zt(i);if(X(i))return i;var o=n.policies.identify(i)[0];if(o){var s=Zt(o);return a&&n.merge(o,i),s}}}return t.prototype.toObject=function(){return w({},this.data)},t.prototype.has=function(e){return this.lookup(e,!0)!==void 0},t.prototype.get=function(e,r){if(this.group.depend(e,r),De.call(this.data,e)){var n=this.data[e];if(n&&De.call(n,r))return n[r]}if(r==="__typename"&&De.call(this.policies.rootTypenamesById,e))return this.policies.rootTypenamesById[e];if(this instanceof $r)return this.parent.get(e,r)},t.prototype.lookup=function(e,r){if(r&&this.group.depend(e,"__exists"),De.call(this.data,e))return this.data[e];if(this instanceof $r)return this.parent.lookup(e,r);if(this.policies.rootTypenamesById[e])return Object.create(null)},t.prototype.merge=function(e,r){var n=this,i;X(e)&&(e=e.__ref),X(r)&&(r=r.__ref);var a=typeof e=="string"?this.lookup(i=e):e,o=typeof r=="string"?this.lookup(i=r):r;if(!!o){__DEV__?O(typeof i=="string","store.merge expects a string ID"):O(typeof i=="string",1);var s=new ft(bg).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=Bt(c);l!==c&&!n.policies.hasKeyArgs(s.__typename,l)&&(u[l]=1),s[c]===void 0&&!(n instanceof $r)&&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:jo,INVALIDATE:jp,isReference:X,toReference:this.toReference,canRead:this.canRead,readField:function(c,l){return n.policies.readField(typeof c=="string"?{fieldName:c,from:l||Zt(e)}:c,{store:n})}};if(Object.keys(i).forEach(function(c){var l=Bt(c),d=i[c];if(d!==void 0){var p=typeof r=="function"?r:r[c]||r[l];if(p){var f=p===mu?jo:p(ia(d),w(w({},u),{fieldName:l,storeFieldName:c,storage:n.getStorage(e,c)}));f===jp?n.group.dirty(e,c):(f===jo&&(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 $r?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]=mu,i):mu)}return!1},t.prototype.evict=function(e,r){var n=!1;return e.id&&(De.call(this.data,e.id)&&(n=this.delete(e.id,e.fieldName,e.args)),this instanceof $r&&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){De.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&&De.call(e,a)||r.delete(a)}),e){var n=e.__META,i=Wt(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 $r?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){De.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 $r;)a=a.parent;i.forEach(function(o){return a.delete(o)})}return i},t.prototype.findChildRefIds=function(e){if(!De.call(this.refs,e)){var r=this.refs[e]=Object.create(null),n=this.data[e];if(!n)return r;var i=new Set([n]);i.forEach(function(a){X(a)&&(r[a.__ref]=!0),ie(a)&&Object.keys(a).forEach(function(o){var s=a[o];ie(s)&&i.add(s)})})}return this.refs[e]},t.prototype.makeCacheKey=function(){return this.group.keyMaker.lookupArray(arguments)},t}();var Bp=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?Lo():null,this.keyMaker=new Jt(Ot)},t.prototype.depend=function(e,r){if(this.d){this.d(gu(e,r));var n=Bt(r);n!==r&&this.d(gu(e,n)),this.parent&&this.parent.depend(e,r)}},t.prototype.dirty=function(e,r){this.d&&this.d.dirty(gu(e,r),r==="__exists"?"forget":"setDirty")},t}();function gu(t,e){return e+"#"+t}function yu(t,e){wn(t)&&t.group.depend(e,"__exists")}(function(t){var e=function(r){Oe(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 Bp(s))||this;return c.stump=new vg(c),c.storageTrie=new Jt(Ot),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})(di||(di={}));var $r=function(t){Oe(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){Ee(o[u],s[u])||n.group.dirty(a,u)}):(n.group.dirty(a,"__exists"),Object.keys(s).forEach(function(u){n.group.dirty(a,u)})):n.delete(a)}),i):i===this.parent?this:i.addLayer(this.id,this.replay)},e.prototype.toObject=function(){return w(w({},this.parent.toObject()),this.data)},e.prototype.findChildRefIds=function(r){var n=this.parent.findChildRefIds(r);return De.call(this.data,r)?w(w({},n),t.prototype.findChildRefIds.call(this,r)):n},e.prototype.getStorage=function(){for(var r=this.parent;r.parent;)r=r.parent;return r.getStorage.apply(r,arguments)},e}(di),vg=function(t){Oe(e,t);function e(r){return t.call(this,"EntityStore.Stump",r,function(){},new Bp(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}($r);function bg(t,e,r){var n=t[r],i=e[r];return Ee(n,i)?n:i}function wn(t){return!!(t instanceof di&&t.group.caching)}function _g(t){return ie(t)?pe(t)?t.slice(0):w({__proto__:Object.getPrototypeOf(t)},t):t}var Bo=function(){function t(){this.known=new(Qf?WeakSet:Set),this.pool=new Jt(Ot),this.passes=new WeakMap,this.keysByJSON=new Map,this.empty=this.admit({})}return t.prototype.isKnown=function(e){return ie(e)&&this.known.has(e)},t.prototype.pass=function(e){if(ie(e)){var r=_g(e);return this.passes.set(r,e),r}return e},t.prototype.admit=function(e){var r=this;if(ie(e)){var n=this.passes.get(e);if(n)return n;var i=Object.getPrototypeOf(e);switch(i){case Array.prototype:{if(this.known.has(e))return e;var a=e.map(this.admit,this),o=this.pool.lookupArray(a);return o.array||(this.known.add(o.array=a),__DEV__&&Object.freeze(a)),o.array}case null:case Object.prototype:{if(this.known.has(e))return e;var s=Object.getPrototypeOf(e),u=[s],c=this.sortedKeys(e);u.push(c.json);var l=u.length;c.sorted.forEach(function(f){u.push(r.admit(e[f]))});var o=this.pool.lookupArray(u);if(!o.object){var d=o.object=Object.create(s);this.known.add(d),c.sorted.forEach(function(f,h){d[f]=u[l+h]}),__DEV__&&Object.freeze(d)}return o.object}}}return e},t.prototype.sortedKeys=function(e){var r=Object.keys(e),n=this.pool.lookupArray(r);if(!n.keys){r.sort();var i=JSON.stringify(r);(n.keys=this.keysByJSON.get(i))||this.keysByJSON.set(i,n.keys={sorted:r,json:i})}return n.keys},t}();var _t=Object.assign(function(t){if(ie(t)){vu===void 0&&qp();var e=vu.admit(t),r=bu.get(e);return r===void 0&&bu.set(e,r=JSON.stringify(e)),r}return JSON.stringify(t)},{reset:qp}),vu,bu;function qp(){vu=new Bo,bu=new(Ot?WeakMap:Map)}function Vp(t){return[t.selectionSet,t.objectOrReference,t.context,t.context.canonizeResults]}var zp=function(){function t(e){var r=this;this.knownResults=new(Ot?WeakMap:Map),this.config=Pr(e,{addTypename:e.addTypename!==!1,canonizeResults:Mo(e)}),this.canon=e.canon||new Bo,this.executeSelectionSet=_n(function(n){var i,a=n.context.canonizeResults,o=Vp(n);o[3]=!a;var s=(i=r.executeSelectionSet).peek.apply(i,o);return s?a?w(w({},s),{result:r.canon.admit(s.result)}):s:(yu(n.context.store,n.enclosingRef.__ref),r.execSelectionSetImpl(n))},{max:this.config.resultCacheMaxSize,keyArgs:Vp,makeCacheKey:function(n,i,a,o){if(wn(a.store))return a.store.makeCacheKey(n,X(i)?i.__ref:i,a.varString,o)}}),this.executeSubSelectedArray=_n(function(n){return yu(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(wn(o.store))return o.store.makeCacheKey(i,a,o.varString)}})}return t.prototype.resetCanon=function(){this.canon=new Bo},t.prototype.diffQueryAgainstStore=function(e){var r=e.store,n=e.query,i=e.rootId,a=i===void 0?"ROOT_QUERY":i,o=e.variables,s=e.returnPartialData,u=s===void 0?!0:s,c=e.canonizeResults,l=c===void 0?this.config.canonizeResults:c,d=this.config.cache.policies;o=w(w({},yn(ta(n))),o);var p=Zt(a),f=this.executeSelectionSet({selectionSet:gn(n).selectionSet,objectOrReference:p,enclosingRef:p,context:w({store:r,query:n,policies:d,variables:o,varString:_t(o),canonizeResults:l},Uo(n,this.config.fragments))}),h;if(f.missing&&(h=[new fa(wg(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(wn(i.store)&&this.knownResults.get(e)===n){var a=this.executeSelectionSet.peek(n,r,i,this.canon.isKnown(e));if(a&&e===a.result)return!0}return!1},t.prototype.execSelectionSetImpl=function(e){var r=this,n=e.selectionSet,i=e.objectOrReference,a=e.enclosingRef,o=e.context;if(X(i)&&!o.policies.rootTypenamesById[i.__ref]&&!o.store.has(i.__ref))return{result:this.canon.empty,missing:"Dangling reference to missing ".concat(i.__ref," object")};var s=o.variables,u=o.policies,c=o.store,l=c.getFieldValue(i,"__typename"),d=[],p,f=new ft;this.config.addTypename&&typeof l=="string"&&!u.rootIdsByTypename[l]&&d.push({__typename:l});function h(b,g){var I;return b.missing&&(p=f.merge(p,(I={},I[g]=b.missing,I))),b.result}var y=new Set(n.selections);y.forEach(function(b){var g,I;if(!!pr(b,s))if(bt(b)){var R=u.readField({fieldName:b.name.value,field:b,variables:o.variables,from:i},o),k=It(b);R===void 0?vn.added(b)||(p=f.merge(p,(g={},g[k]="Can't find field '".concat(b.name.value,"' on ").concat(X(i)?i.__ref+" object":"object "+JSON.stringify(i,null,2)),g))):pe(R)?R=h(r.executeSubSelectedArray({field:b,array:R,enclosingRef:a,context:o}),k):b.selectionSet?R!=null&&(R=h(r.executeSelectionSet({selectionSet:b.selectionSet,objectOrReference:R,enclosingRef:X(R)?R:a,context:o}),k)):o.canonizeResults&&(R=r.canon.pass(R)),R!==void 0&&d.push((I={},I[k]=R,I))}else{var D=hn(b,o.lookupFragment);if(!D&&b.kind===Le.FRAGMENT_SPREAD)throw __DEV__?new Q("No fragment named ".concat(b.name.value)):new Q(5);D&&u.fragmentMatches(D,l)&&D.selectionSet.selections.forEach(y.add,y)}});var v=ra(d),S={result:v,missing:p},_=o.canonizeResults?this.canon.admit(S):ia(S);return _.result&&this.knownResults.set(_.result,n),_},t.prototype.execSubSelectedArrayImpl=function(e){var r=this,n=e.field,i=e.array,a=e.enclosingRef,o=e.context,s,u=new ft;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:pe(l)?c(r.executeSubSelectedArray({field:n,array:l,enclosingRef:a,context:o}),d):n.selectionSet?c(r.executeSelectionSet({selectionSet:n.selectionSet,objectOrReference:l,enclosingRef:X(l)?l:a,context:o}),d):(__DEV__&&Sg(o.store,n,l),l)}),{result:o.canonizeResults?this.canon.admit(i):i,missing:s}},t}();function wg(t){try{JSON.stringify(t,function(e,r){if(typeof r=="string")throw r;return r})}catch(e){return e}}function Sg(t,e,r){if(!e.selectionSet){var n=new Set([r]);n.forEach(function(i){ie(i)&&(__DEV__?O(!X(i),"Missing selection set for object of type ".concat(Mp(t,i)," returned for query field ").concat(e.name.value)):O(!X(i),6),Object.values(i).forEach(n.add,n))})}}var hi=new fi,Qp=new WeakMap;function da(t){var e=Qp.get(t);return e||Qp.set(t,e={vars:new Set,dep:Lo()}),e}function _u(t){da(t).vars.forEach(function(e){return e.forgetCache(t)})}function Gp(t){da(t).vars.forEach(function(e){return e.attachCache(t)})}function qo(t){var e=new Set,r=new Set,n=function(a){if(arguments.length>0){if(t!==a){t=a,e.forEach(function(u){da(u).dep.dirty(n),xg(u)});var o=Array.from(r);r.clear(),o.forEach(function(u){return u(t)})}}else{var s=hi.getValue();s&&(i(s),da(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),da(a).vars.add(n),n};return n.forgetCache=function(a){return e.delete(a)},n}function xg(t){t.broadcastWatches&&t.broadcastWatches()}var Hp=Object.create(null);function wu(t){var e=JSON.stringify(t);return Hp[e]||(Hp[e]=Object.create(null))}function Su(t){var e=wu(t);return e.keyFieldsFn||(e.keyFieldsFn=function(r,n){var i=function(o,s){return n.readField(s,o)},a=n.keyObject=Eu(t,function(o){var s=mi(n.storeObject,o,i);return s===void 0&&r!==n.storeObject&&De.call(r,o[0])&&(s=mi(r,o,Wp)),__DEV__?O(s!==void 0,"Missing field '".concat(o.join("."),"' while extracting keyFields from ").concat(JSON.stringify(r))):O(s!==void 0,2),s});return"".concat(n.typename,":").concat(JSON.stringify(a))})}function xu(t){var e=wu(t);return e.keyArgsFn||(e.keyArgsFn=function(r,n){var i=n.field,a=n.variables,o=n.fieldName,s=Eu(t,function(c){var l=c[0],d=l.charAt(0);if(d==="@"){if(i&&Me(i.directives)){var p=l.slice(1),f=i.directives.find(function(S){return S.name.value===p}),h=f&&dr(f,a);return h&&mi(h,c.slice(1))}return}if(d==="$"){var y=l.slice(1);if(a&&De.call(a,y)){var v=c.slice(0);return v[0]=y,mi(a,v)}return}if(r)return mi(r,c)}),u=JSON.stringify(s);return(r||u!=="{}")&&(o+=":"+u),o})}function Eu(t,e){var r=new ft;return Kp(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 Kp(t){var e=wu(t);if(!e.paths){var r=e.paths=[],n=[];t.forEach(function(i,a){pe(i)?(Kp(i).forEach(function(o){return r.push(n.concat(o))}),n.length=0):(n.push(i),pe(t[a+1])||(r.push(n.slice(0)),n.length=0))})}return e.paths}function Wp(t,e){return t[e]}function mi(t,e,r){return r=r||Wp,Zp(e.reduce(function n(i,a){return pe(i)?i.map(function(o){return n(o,a)}):i&&r(i,a)},t))}function Zp(t){return ie(t)?pe(t)?t.map(Zp):Eu(Object.keys(t).sort(),function(e){return mi(t,e)}):t}Xi.setStringify(_t);function Cu(t){return t.args!==void 0?t.args:t.field?dr(t.field,t.variables):null}var Eg=function(){},Yp=function(t,e){return e.fieldName},Jp=function(t,e,r){var n=r.mergeObjects;return n(t,e)},Xp=function(t,e){return e},td=function(){function t(e){this.config=e,this.typePolicies=Object.create(null),this.toBeAdded=Object.create(null),this.supertypeMap=new Map,this.fuzzySubtypes=new Map,this.rootIdsByTypename=Object.create(null),this.rootTypenamesById=Object.create(null),this.usingPossibleTypes=!1,this.config=w({dataIdFromObject:$o},e),this.cache=this.config.cache,this.setRootTypename("Query"),this.setRootTypename("Mutation"),this.setRootTypename("Subscription"),e.possibleTypes&&this.addPossibleTypes(e.possibleTypes),e.typePolicies&&this.addTypePolicies(e.typePolicies)}return t.prototype.identify=function(e,r){var n,i=this,a=r&&(r.typename||((n=r.storeObject)===null||n===void 0?void 0:n.__typename))||e.__typename;if(a===this.rootTypenamesById.ROOT_QUERY)return["ROOT_QUERY"];for(var o=r&&r.storeObject||e,s=w(w({},r),{typename:a,storeObject:o,readField:r&&r.readField||function(){var p=Vo(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(pe(d))l=Su(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=Wt(i,["queryType","mutationType","subscriptionType"]);a&&r.setRootTypename("Query",n),o&&r.setRootTypename("Mutation",n),s&&r.setRootTypename("Subscription",n),De.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?Jp:c===!1?Xp:u.merge}s(i,r.merge),i.keyFn=a===!1?Eg:pe(a)?Su(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?Yp:pe(d)?xu(d):typeof d=="function"?d:c.keyFn,typeof p=="function"&&(c.read=p),s(c,f)}c.read&&c.merge&&(c.keyFn=c.keyFn||Yp)})},t.prototype.setRootTypename=function(e,r){r===void 0&&(r=e);var n="ROOT_"+e.toUpperCase(),i=this.rootTypenamesById[n];r!==i&&(__DEV__?O(!i||i===e,"Cannot change root ".concat(e," __typename more than once")):O(!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(hu);(!a||a[0]!==i)&&r.fuzzySubtypes.set(i,new RegExp(i))})})},t.prototype.getTypePolicy=function(e){var r=this;if(!De.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=Wt(s,["fields"]);Object.assign(n,c),Object.assign(n.fields,u)})}var a=this.toBeAdded[e];return a&&a.length&&a.splice(0).forEach(function(o){r.updateTypePolicy(e,o)}),this.typePolicies[e]},t.prototype.getFieldPolicy=function(e,r,n){if(e){var i=this.getTypePolicy(e).fields;return i[r]||n&&(i[r]=Object.create(null))}},t.prototype.getSupertypeSet=function(e,r){var n=this.supertypeMap.get(e);return!n&&r&&this.supertypeMap.set(e,n=new Set),n},t.prototype.fragmentMatches=function(e,r,n,i){var a=this;if(!e.typeCondition)return!0;if(!r)return!1;var o=e.typeCondition.name.value;if(r===o)return!0;if(this.usingPossibleTypes&&this.supertypeMap.has(o))for(var s=this.getSupertypeSet(r,!0),u=[s],c=function(h){var y=a.getSupertypeSet(h,!1);y&&y.size&&u.indexOf(y)<0&&u.push(y)},l=!!(n&&this.fuzzySubtypes.size),d=!1,p=0;p<u.length;++p){var f=u[p];if(f.has(o))return s.has(o)||(d&&__DEV__&&O.warn("Inferring subtype ".concat(r," of supertype ").concat(o)),s.add(o)),!0;f.forEach(c),l&&p===u.length-1&&Fo(e.selectionSet,n,i)&&(l=!1,d=!0,this.fuzzySubtypes.forEach(function(h,y){var v=r.match(h);v&&v[0]===r&&c(y)}))}return!1},t.prototype.hasKeyArgs=function(e,r){var n=this.getFieldPolicy(e,r,!1);return!!(n&&n.keyFn)},t.prototype.getStoreFieldName=function(e){var r=e.typename,n=e.fieldName,i=this.getFieldPolicy(r,n,!1),a,o=i&&i.keyFn;if(o&&r)for(var s={typename:r,fieldName:n,field:e.field||null,variables:e.variables},u=Cu(e);o;){var c=o(u,s);if(pe(c))o=xu(c);else{a=c||n;break}}return a===void 0&&(a=e.field?Lc(e.field,e.variables):Xi(n,Cu(e))),a===!1?n:n===Bt(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=Bt(o),u=r.store.getFieldValue(n,o),c=this.getFieldPolicy(e.typename,s,!1),l=c&&c.read;if(l){var d=ed(this,n,e,r,r.store.getStorage(X(n)?n.__ref:n,o));return hi.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===Jp?rd(i.store)(e,r):u===Xp?r:(i.overwrite&&(e=void 0),u(e,r,ed(this,void 0,{typename:s,fieldName:o.name.value,field:o,variables:i.variables},i,a||Object.create(null))))},t}();function ed(t,e,r,n,i){var a=t.getStoreFieldName(r),o=Bt(a),s=r.variables||n.variables,u=n.store,c=u.toReference,l=u.canRead;return{args:Cu(r),field:r.field||null,fieldName:o,storeFieldName:a,variables:s,isReference:X,toReference:c,storage:i,cache:t.cache,canRead:l,readField:function(){return t.readField(Vo(arguments,e,s),n)},mergeObjects:rd(n.store)}}function Vo(t,e,r){var n=t[0],i=t[1],a=t.length,o;return typeof n=="string"?o={fieldName:n,from:a>1?i:e}:(o=w({},n),De.call(o,"from")||(o.from=e)),__DEV__&&o.from===void 0&&__DEV__&&O.warn("Undefined 'from' passed to readField with arguments ".concat(Wf(Array.from(t)))),o.variables===void 0&&(o.variables=r),o}function rd(t){return function(r,n){if(pe(r)||pe(n))throw __DEV__?new Q("Cannot automatically merge arrays"):new Q(4);if(ie(r)&&ie(n)){var i=t.getFieldValue(r,"__typename"),a=t.getFieldValue(n,"__typename"),o=i&&a&&i!==a;if(o)return n;if(X(r)&&Fr(n))return t.merge(r.__ref,n),r;if(Fr(r)&&X(n))return t.merge(r,n.__ref),n;if(Fr(r)&&Fr(n))return w(w({},r),n)}return n}}function ku(t,e,r){var n="".concat(e).concat(r),i=t.flavors.get(n);return i||t.flavors.set(n,i=t.clientOnly===e&&t.deferred===r?t:w(w({},t),{clientOnly:e,deferred:r})),i}var od=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=Yt(i),l=Up();s=w(w({},yn(c)),s);var d=w(w({store:e,written:Object.create(null),merge:function(f,h){return l.merge(f,h)},variables:s,varString:_t(s)},Uo(i,this.fragments)),{overwrite:!!u,incomingById:new Map,clientOnly:!1,deferred:!1,flavors:new Map}),p=this.processSelectionSet({result:a||Object.create(null),dataId:o,selectionSet:c.selectionSet,mergeTree:{map:new Map},context:d});if(!X(p))throw __DEV__?new Q("Could not identify object ".concat(JSON.stringify(a))):new Q(7);return d.incomingById.forEach(function(f,h){var y=f.storeObject,v=f.mergeTree,S=f.fieldNodeSet,_=Zt(h);if(v&&v.map.size){var b=n.applyMerges(v,_,y,d);if(X(b))return;y=b}if(__DEV__&&!d.overwrite){var g=Object.create(null);S.forEach(function(k){k.selectionSet&&(g[k.name.value]=!0)});var I=function(k){return g[Bt(k)]===!0},R=function(k){var D=v&&v.map.get(k);return Boolean(D&&D.info&&D.info.merge)};Object.keys(y).forEach(function(k){I(k)&&!R(k)&&Cg(_,y,k,d.store)})}e.merge(h,y)}),e.retain(p.__ref),p},t.prototype.processSelectionSet=function(e){var r=this,n=e.dataId,i=e.result,a=e.selectionSet,o=e.context,s=e.mergeTree,u=this.cache.policies,c=Object.create(null),l=n&&u.rootTypenamesById[n]||ea(i,a,o.fragmentMap)||n&&o.store.get(n,"__typename");typeof l=="string"&&(c.__typename=l);var d=function(){var b=Vo(arguments,c,o.variables);if(X(b.from)){var g=o.incomingById.get(b.from.__ref);if(g){var I=u.readField(w(w({},b),{from:g.storeObject}),o);if(I!==void 0)return I}}return u.readField(b,o)},p=new Set;this.flattenFields(a,i,o,l).forEach(function(b,g){var I,R=It(g),k=i[R];if(p.add(g),k!==void 0){var D=u.getStoreFieldName({typename:l,fieldName:g.name.value,field:g,variables:b.variables}),F=nd(s,D),P=r.processFieldValue(k,g,g.selectionSet?ku(b,!1,!1):b,F),q=void 0;g.selectionSet&&(X(P)||Fr(P))&&(q=d("__typename",P));var We=u.getMergeFunction(l,g.name.value,q);We?F.info={field:g,typename:l,merge:We}:id(s,D),c=b.merge(c,(I={},I[D]=P,I))}else __DEV__&&!b.clientOnly&&!b.deferred&&!vn.added(g)&&!u.getReadFunction(l,g.name.value)&&__DEV__&&O.error("Missing field '".concat(It(g),"' while writing result ").concat(JSON.stringify(i,null,2)).substring(0,1e3))});try{var f=u.identify(i,{typename:l,selectionSet:a,fragmentMap:o.fragmentMap,storeObject:c,readField:d}),h=f[0],y=f[1];n=n||h,y&&(c=o.merge(c,y))}catch(b){if(!n)throw b}if(typeof n=="string"){var v=Zt(n),S=o.written[n]||(o.written[n]=[]);if(S.indexOf(a)>=0||(S.push(a),this.reader&&this.reader.isFresh(i,v,a,o)))return v;var _=o.incomingById.get(n);return _?(_.storeObject=o.merge(_.storeObject,c),_.mergeTree=Tu(_.mergeTree,s),p.forEach(function(b){return _.fieldNodeSet.add(b)})):o.incomingById.set(n,{storeObject:c,mergeTree:zo(s)?void 0:s,fieldNodeSet:p}),v}return c},t.prototype.processFieldValue=function(e,r,n,i){var a=this;return!r.selectionSet||e===null?__DEV__?Eo(e):e:pe(e)?e.map(function(o,s){var u=a.processFieldValue(o,r,n,nd(i,s));return id(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=ea(r,e,n.fragmentMap));var a=new Map,o=this.cache.policies,s=new Jt(!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(!!pr(p,n.variables)){var f=l.clientOnly,h=l.deferred;if(!(f&&h)&&Me(p.directives)&&p.directives.forEach(function(S){var _=S.name.value;if(_==="client"&&(f=!0),_==="defer"){var b=dr(S,n.variables);(!b||b.if!==!1)&&(h=!0)}}),bt(p)){var y=a.get(p);y&&(f=f&&y.clientOnly,h=h&&y.deferred),a.set(p,ku(n,f,h))}else{var v=hn(p,n.lookupFragment);if(!v&&p.kind===Le.FRAGMENT_SPREAD)throw __DEV__?new Q("No fragment named ".concat(p.name.value)):new Q(8);v&&o.fragmentMatches(v,i,r,n.variables)&&u(v.selectionSet,ku(n,f,h))}}}))}(e,n),a},t.prototype.applyMerges=function(e,r,n,i,a){var o,s=this;if(e.map.size&&!X(n)){var u=!pe(n)&&(X(r)||Fr(r))?r:void 0,c=n;u&&!a&&(a=[X(u)?u.__ref:u]);var l,d=function(p,f){return pe(p)?typeof f=="number"?p[f]:void 0:i.store.getFieldValue(p,String(f))};e.map.forEach(function(p,f){var h=d(u,f),y=d(c,f);if(y!==void 0){a&&a.push(f);var v=s.applyMerges(p,h,y,i,a);v!==y&&(l=l||new Map,l.set(f,v)),a&&O(a.pop()===f)}}),l&&(n=pe(c)?c.slice(0):w({},c),l.forEach(function(p,f){n[f]=p}))}return e.info?this.cache.policies.runMergeFunction(r,n,e.info,i,a&&(o=i.store).getStorage.apply(o,a)):n},t}();var sd=[];function nd(t,e){var r=t.map;return r.has(e)||r.set(e,sd.pop()||{map:new Map}),r.get(e)}function Tu(t,e){if(t===e||!e||zo(e))return t;if(!t||zo(t))return e;var r=t.info&&e.info?w(w({},t.info),e.info):t.info||e.info,n=t.map.size&&e.map.size,i=n?new Map:t.map.size?t.map:e.map,a={info:r,map:i};if(n){var o=new Set(e.map.keys());t.map.forEach(function(s,u){a.map.set(u,Tu(s,e.map.get(u))),o.delete(u)}),o.forEach(function(s){a.map.set(s,Tu(e.map.get(s),t.map.get(s)))})}return a}function zo(t){return!t||!(t.info||t.map.size)}function id(t,e){var r=t.map,n=r.get(e);n&&zo(n)&&(sd.push(n),r.delete(e))}var ad=new Set;function Cg(t,e,r,n){var i=function(d){var p=n.getFieldValue(d,r);return typeof p=="object"&&p},a=i(t);if(!!a){var o=i(e);if(!!o&&!X(a)&&!Ee(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=Bt(r),c="".concat(s,".").concat(u);if(!ad.has(c)){ad.add(c);var l=[];!pe(a)&&!pe(o)&&[a,o].forEach(function(d){var p=n.getFieldValue(d,"__typename");typeof p=="string"&&!l.includes(p)&&l.push(p)}),__DEV__&&O.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 Qo=function(t){Oe(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=qo,n.txCount=0,n.config=$p(r),n.addTypename=!!n.config.addTypename,n.policies=new td({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 di.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 od(this,this.storeReader=new zp({cache:this,addTypename:this.addTypename,resultCacheMaxSize:this.config.resultCacheMaxSize,canonizeResults:Mo(this.config),canon:r?void 0:i&&i.canon,fragments:a}),a),this.maybeBroadcastWatch=_n(function(o,s){return n.broadcastWatch(o,s)},{max:this.config.resultCacheMaxSize,makeCacheKey:function(o){var s=o.optimistic?n.optimisticData:n.data;if(wn(s)){var u=o.optimistic,c=o.id,l=o.variables;return s.makeCacheKey(o.query,o.callback,_t({optimistic:u,id:c,variables:l}))}}}),new Set([this.data.group,this.optimisticData.group]).forEach(function(o){return o.resetCaching()})},e.prototype.restore=function(r){return this.init(),r&&this.data.replace(r),this},e.prototype.extract=function(r){return r===void 0&&(r=!1),(r?this.optimisticData:this.data).extract()},e.prototype.read=function(r){var n=r.returnPartialData,i=n===void 0?!1:n;try{return this.storeReader.diffQueryAgainstStore(w(w({},r),{store:r.optimistic?this.optimisticData:this.data,config:this.config,returnPartialData:i})).result||null}catch(a){if(a instanceof fa)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(De.call(r,"id")&&!r.id)return!1;var n=r.optimistic?this.optimisticData:this.data;try{return++this.txCount,n.modify(r.id||"ROOT_QUERY",r.fields)}finally{!--this.txCount&&r.broadcast!==!1&&this.broadcastWatches()}},e.prototype.diff=function(r){return this.storeReader.diffQueryAgainstStore(w(w({},r),{store:r.optimistic?this.optimisticData:this.data,rootId:r.id||"ROOT_QUERY",config:this.config}))},e.prototype.watch=function(r){var n=this;return this.watches.size||Gp(this),this.watches.add(r),r.immediate&&this.maybeBroadcastWatch(r),function(){n.watches.delete(r)&&!n.watches.size&&_u(n),n.maybeBroadcastWatch.forget(r)}},e.prototype.gc=function(r){_t.reset();var n=this.optimisticData.gc();return r&&!this.txCount&&(r.resetResultCache?this.resetResultCache(r.resetResultIdentities):r.resetResultIdentities&&this.storeReader.resetCanon()),n},e.prototype.retain=function(r,n){return(n?this.optimisticData:this.data).retain(r)},e.prototype.release=function(r,n){return(n?this.optimisticData:this.data).release(r)},e.prototype.identify=function(r){if(X(r))return r.__ref;try{return this.policies.identify(r)[0]}catch(n){__DEV__&&O.warn(n)}},e.prototype.evict=function(r){if(!r.id){if(De.call(r,"id"))return!1;r=w(w({},r),{id:"ROOT_QUERY"})}try{return++this.txCount,this.optimisticData.evict(r,this.data)}finally{!--this.txCount&&r.broadcast!==!1&&this.broadcastWatches()}},e.prototype.reset=function(r){var n=this;return this.init(),_t.reset(),r&&r.discardWatches?(this.watches.forEach(function(i){return n.maybeBroadcastWatch.forget(i)}),this.watches.clear(),_u(this)):this.broadcastWatches(),Promise.resolve()},e.prototype.removeOptimistic=function(r){var n=this.optimisticData.removeLayer(r);n!==this.optimisticData&&(this.optimisticData=n,this.broadcastWatches())},e.prototype.batch=function(r){var n=this,i=r.update,a=r.optimistic,o=a===void 0?!0:a,s=r.removeOptimistic,u=r.onWatchUpdated,c,l=function(p){var f=n,h=f.data,y=f.optimisticData;++n.txCount,p&&(n.data=n.optimisticData=p);try{return c=i(n)}finally{--n.txCount,n.data=h,n.optimisticData=y}},d=new Set;return u&&!this.txCount&&this.broadcastWatches(w(w({},r),{onWatchUpdated:function(p){return d.add(p),!1}})),typeof o=="string"?this.optimisticData=this.optimisticData.addLayer(o,l):o===!1?l(this.data):l(),typeof s=="string"&&(this.optimisticData=this.optimisticData.removeLayer(s)),u&&d.size?(this.broadcastWatches(w(w({},r),{onWatchUpdated:function(p,f){var h=u.call(this,p,f);return h!==!1&&d.delete(p),h}})),d.size&&d.forEach(function(p){return n.maybeBroadcastWatch.dirty(p)})):this.broadcastWatches(r),c},e.prototype.performTransaction=function(r,n){return this.batch({update:r,optimistic:n||n!==null})},e.prototype.transformDocument=function(r){if(this.addTypename){var n=this.typenameDocumentCache.get(r);return n||(n=vn(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||!Ee(i.result,a.result))&&r.callback(r.lastDiff=a,i)},e}(du);function cd(t){return t.hasOwnProperty("graphQLErrors")}var kg=function(t){var e="";if(Me(t.graphQLErrors)||Me(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},
|
|
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=[],
|
|
55
|
-
`)}function
|
|
51
|
+
`)),e=e.replace(/\n$/,""),e},hr=function(t){Oe(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||kg(u),u.extraInfo=s,u.__proto__=e.prototype,u}return e}(Error);var ce;(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"})(ce||(ce={}));function Mr(t){return t?t<7:!1}var Tg=Object.assign,Ag=Object.hasOwnProperty,Go=function(t){Oe(e,t);function e(r){var n=r.queryManager,i=r.queryInfo,a=r.options,o=t.call(this,function(v){try{var S=v._subscription._observer;S&&!S.error&&(S.error=Ig)}catch{}var _=!o.observers.size;o.observers.add(v);var b=o.last;return b&&b.error?v.error&&v.error(b.error):b&&b.result&&v.next&&v.next(b.result),_&&o.reobserve().catch(function(){}),function(){o.observers.delete(v)&&!o.observers.size&&o.tearDownQuery()}})||this;o.observers=new Set,o.subscriptions=new Set,o.queryInfo=i,o.queryManager=n,o.isTornDown=!1;var s=n.defaultOptions.watchQuery,u=s===void 0?{}:s,c=u.fetchPolicy,l=c===void 0?"cache-first":c,d=a.fetchPolicy,p=d===void 0?l:d,f=a.initialFetchPolicy,h=f===void 0?p==="standby"?l:p:f;o.options=w(w({},a),{initialFetchPolicy:h,fetchPolicy:p}),o.queryId=i.queryId||n.generateQueryId();var y=Yt(o.query);return o.queryName=y&&y.name&&y.name.value,o}return Object.defineProperty(e.prototype,"query",{get:function(){return this.queryManager.transform(this.options.query).document},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"variables",{get:function(){return this.options.variables},enumerable:!1,configurable:!0}),e.prototype.result=function(){var r=this;return new Promise(function(n,i){var a={next:function(s){n(s),r.observers.delete(a),r.observers.size||r.queryManager.removeQuery(r.queryId),setTimeout(function(){o.unsubscribe()},0)},error:i},o=r.subscribe(a)})},e.prototype.getCurrentResult=function(r){r===void 0&&(r=!0);var n=this.getLastResult(!0),i=this.queryInfo.networkStatus||n&&n.networkStatus||ce.ready,a=w(w({},n),{loading:Mr(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),Ee(a.data,{})&&(a.data=void 0),u.complete?(delete a.partial,u.complete&&a.networkStatus===ce.loading&&(s==="cache-first"||s==="cache-only")&&(a.networkStatus=ce.ready,a.loading=!1)):a.partial=!0,__DEV__&&!u.complete&&!this.options.partialRefetch&&!a.loading&&!a.data&&!a.error&&Iu(u.missing)}return r&&this.updateLastResult(a),a},e.prototype.isDifferentFromLastResult=function(r,n){return!this.last||!Ee(this.last.result,r)||n&&!Ee(this.last.variables,n)},e.prototype.getLast=function(r,n){var i=this.last;if(i&&i[r]&&(!n||Ee(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&&Ag.call(r,"variables")){var o=ta(this.query),s=o.variableDefinitions;(!s||!s.some(function(u){return u.variable.name.value==="variables"}))&&__DEV__&&O.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&&!Ee(this.options.variables,r)&&(i.variables=this.options.variables=w(w({},this.options.variables),r)),this.queryInfo.resetLastWrite(),this.reobserve(i,ce.refetch)},e.prototype.fetchMore=function(r){var n=this,i=w(w({},r.query?r:w(w(w(w({},this.options),{query:this.query}),r),{variables:w(w({},this.options.variables),r.variables)})),{fetchPolicy:"no-cache"}),a=this.queryManager.generateQueryId(),o=this.queryInfo,s=o.networkStatus;o.networkStatus=ce.fetchMore,i.notifyOnNetworkStatusChange&&this.observe();var u=new Set;return this.queryManager.fetchQuery(a,i,ce.fetchMore).then(function(c){return n.queryManager.removeQuery(a),o.networkStatus===ce.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)||Au(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__&&O.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 Ee(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},ce.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__?O(a,"Attempted to start a polling query without a polling interval."):O(a,13);var o=i||(this.pollingInfo={});o.interval=a;var s=function(){r.pollingInfo&&(Mr(r.queryInfo.networkStatus)?u():r.reobserve({fetchPolicy:r.options.initialFetchPolicy==="no-cache"?"no-cache":"network-only"},ce.poll).then(u,u))},u=function(){var c=r.pollingInfo;c&&(clearTimeout(c.timeout),c.timeout=setTimeout(s,c.interval))};u()}}},e.prototype.updateLastResult=function(r,n){return n===void 0&&(n=this.variables),this.last=w(w({},this.last),{result:this.queryManager.assumeImmutableResults?r:Eo(r),variables:n}),Me(r.errors)||delete this.last.error,this.last},e.prototype.reobserve=function(r,n){var i=this;this.isTornDown=!1;var a=n===ce.refetch||n===ce.fetchMore||n===ce.poll,o=this.options.variables,s=this.options.fetchPolicy,u=Pr(this.options,r||{}),c=a?u:Tg(this.options,u);a||(this.updatePolling(),r&&r.variables&&!Ee(r.variables,o)&&c.fetchPolicy!=="standby"&&c.fetchPolicy===s&&(this.applyNextFetchPolicy("variables-changed",c),n===void 0&&(n=ce.setVariables)));var l=c.variables&&w({},c.variables),d=this.fetch(c,n),p={next:function(f){i.reportResult(f,l)},error:function(f){i.reportError(f,l)}};return a||(this.concast&&this.observer&&this.concast.removeObserver(this.observer),this.concast=d,this.observer=p),d.addObserver(p),d.promise},e.prototype.observe=function(){this.reportResult(this.getCurrentResult(!1),this.variables)},e.prototype.reportResult=function(r,n){var i=this.getLastError();(i||this.isDifferentFromLastResult(r,n))&&((i||!r.partial||this.options.returnPartialData)&&this.updateLastResult(r,n),bn(this.observers,"next",r))},e.prototype.reportError=function(r,n){var i=w(w({},this.getLastResult()),{error:r,errors:r.graphQLErrors,networkStatus:ce.error,loading:!1});this.updateLastResult(i,n),bn(this.observers,"error",this.last.error=r)},e.prototype.hasObservers=function(){return this.observers.size>0},e.prototype.tearDownQuery=function(){this.isTornDown||(this.concast&&this.observer&&(this.concast.removeObserver(this.observer),delete this.concast,delete this.observer),this.stopPolling(),this.subscriptions.forEach(function(r){return r.unsubscribe()}),this.subscriptions.clear(),this.queryManager.stopQuery(this.queryId),this.observers.clear(),this.isTornDown=!0)},e}(J);ko(Go);function Au(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 Ig(t){__DEV__&&O.error("Unhandled error",t.message,t.stack)}function Iu(t){__DEV__&&t&&__DEV__&&O.debug("Missing cache result fields: ".concat(JSON.stringify(t)),t)}var Ho=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=qc(r.resolvers,n)}):this.resolvers=qc(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 $t(this,void 0,void 0,function(){return Mt(this,function(u){return r?[2,this.resolveDocument(r,n.data,i,a,this.fragmentMatcher,s).then(function(c){return w(w({},n),{data:c.result})})]:[2,n]})})},t.prototype.setFragmentMatcher=function(e){this.fragmentMatcher=e},t.prototype.getFragmentMatcher=function(){return this.fragmentMatcher},t.prototype.clientQuery=function(e){return ni(["client"],e)&&this.resolvers?e:null},t.prototype.serverQuery=function(e){return Bc(e)},t.prototype.prepareContext=function(e){var r=this.cache;return w(w({},e),{cache:r,getCacheKey:function(n){return r.identify(n)}})},t.prototype.addExportedVariables=function(e,r,n){return r===void 0&&(r={}),n===void 0&&(n={}),$t(this,void 0,void 0,function(){return Mt(this,function(i){return e?[2,this.resolveDocument(e,this.buildRootValueFromCache(e,r)||{},this.prepareContext(n),r).then(function(a){return w(w({},r),a.exportedVariables)})]:[2,w({},r)]})})},t.prototype.shouldForceResolvers=function(e){var r=!1;return rt(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 pn}}}),r},t.prototype.buildRootValueFromCache=function(e,r){return this.cache.diff({query:jc(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),$t(this,void 0,void 0,function(){var s,u,c,l,d,p,f,h,y,v,S;return Mt(this,function(_){return s=gn(e),u=mn(e),c=dn(u),l=this.collectSelectionsToResolve(s,c),d=s.operation,p=d?d.charAt(0).toUpperCase()+d.slice(1):"Query",f=this,h=f.cache,y=f.client,v={fragmentMap:c,context:w(w({},n),{cache:h,client:y}),variables:i,fragmentMatcher:a,defaultOperationType:p,exportedVariables:{},selectionsToResolve:l,onlyRunForcedResolvers:o},S=!1,[2,this.resolveSelectionSet(s.selectionSet,S,r,v).then(function(b){return{result:b,exportedVariables:v.exportedVariables}})]})})},t.prototype.resolveSelectionSet=function(e,r,n,i){return $t(this,void 0,void 0,function(){var a,o,s,u,c,l=this;return Mt(this,function(d){return a=i.fragmentMap,o=i.context,s=i.variables,u=[n],c=function(p){return $t(l,void 0,void 0,function(){var f,h;return Mt(this,function(y){return!r&&!i.selectionsToResolve.has(p)?[2]:pr(p,s)?bt(p)?[2,this.resolveField(p,r,n,i).then(function(v){var S;typeof v<"u"&&u.push((S={},S[It(p)]=v,S))})]:(Fc(p)?f=p:(f=a[p.name.value],__DEV__?O(f,"No fragment named ".concat(p.name.value)):O(f,11)),f&&f.typeCondition&&(h=f.typeCondition.name.value,i.fragmentMatcher(n,h,o))?[2,this.resolveSelectionSet(f.selectionSet,r,n,i).then(function(v){u.push(v)})]:[2]):[2]})})},[2,Promise.all(e.selections.map(c)).then(function(){return ra(u)})]})})},t.prototype.resolveField=function(e,r,n,i){return $t(this,void 0,void 0,function(){var a,o,s,u,c,l,d,p,f,h=this;return Mt(this,function(y){return n?(a=i.variables,o=e.name.value,s=It(e),u=o!==s,c=n[s]||n[o],l=Promise.resolve(c),(!i.onlyRunForcedResolvers||this.shouldForceResolvers(e))&&(d=n.__typename||i.defaultOperationType,p=this.resolvers&&this.resolvers[d],p&&(f=p[u?o:s],f&&(l=Promise.resolve(hi.withValue(this.cache,f,[n,dr(e,a),i.context,{field:e,fragmentMap:i.fragmentMap}]))))),[2,l.then(function(v){var S,_;if(v===void 0&&(v=c),e.directives&&e.directives.forEach(function(g){g.name.value==="export"&&g.arguments&&g.arguments.forEach(function(I){I.name.value==="as"&&I.value.kind==="StringValue"&&(i.exportedVariables[I.value.value]=v)})}),!e.selectionSet||v==null)return v;var b=(_=(S=e.directives)===null||S===void 0?void 0:S.some(function(g){return g.name.value==="client"}))!==null&&_!==void 0?_:!1;if(Array.isArray(v))return h.resolveSubSelectedArray(e,r||b,v,i);if(e.selectionSet)return h.resolveSelectionSet(e.selectionSet,r||b,v,i)})]):[2,null]})})},t.prototype.resolveSubSelectedArray=function(e,r,n,i){var a=this;return Promise.all(n.map(function(o){if(o===null)return null;if(Array.isArray(o))return a.resolveSubSelectedArray(e,r,o,i);if(e.selectionSet)return a.resolveSelectionSet(e.selectionSet,r,o,i)}))},t.prototype.collectSelectionsToResolve=function(e,r){var n=function(o){return!Array.isArray(o)},i=this.selectionsToResolveCache;function a(o){if(!i.has(o)){var s=new Set;i.set(o,s),rt(o,{Directive:function(u,c,l,d,p){u.name.value==="client"&&p.forEach(function(f){n(f)&&Yi(f)&&s.add(f)})},FragmentSpread:function(u,c,l,d,p){var f=r[u.name.value];__DEV__?O(f,"No fragment named ".concat(u.name.value)):O(f,12);var h=a(f);h.size>0&&(p.forEach(function(y){n(y)&&Yi(y)&&s.add(y)}),s.add(u),h.forEach(function(y){s.add(y)}))}})}return i.get(o)}return a(e)},t}();var gi=new(Ot?WeakMap:Map);function Ou(t,e){var r=t[e];typeof r=="function"&&(t[e]=function(){return gi.set(t,(gi.get(t)+1)%1e15),r.apply(this,arguments)})}function ud(t){t.notifyTimeout&&(clearTimeout(t.notifyTimeout),t.notifyTimeout=void 0)}var Ko=function(){function t(e,r){r===void 0&&(r=e.generateQueryId()),this.queryId=r,this.listeners=new Set,this.document=null,this.lastRequestId=1,this.subscriptions=new Set,this.stopped=!1,this.dirty=!1,this.observableQuery=null;var n=this.cache=e.cache;gi.has(n)||(gi.set(n,0),Ou(n,"evict"),Ou(n,"modify"),Ou(n,"reset"))}return t.prototype.init=function(e){var r=e.networkStatus||ce.loading;return this.variables&&this.networkStatus!==ce.loading&&!Ee(this.variables,e.variables)&&(r=ce.setVariables),Ee(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(){ud(this),this.dirty=!1},t.prototype.getDiff=function(e){e===void 0&&(e=this.variables);var r=this.getDiffOptions(e);if(this.lastDiff&&Ee(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&&!Ee(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():Au(e)})):delete this.oqListener)},t.prototype.notify=function(){var e=this;ud(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(Mr(this.networkStatus)&&this.observableQuery){var e=this.observableQuery.options.fetchPolicy;if(e!=="cache-only"&&e!=="cache-and-network")return!1}return!0},t.prototype.stop=function(){if(!this.stopped){this.stopped=!0,this.reset(),this.cancel(),this.cancel=t.prototype.cancel,this.subscriptions.forEach(function(r){return r.unsubscribe()});var e=this.observableQuery;e&&e.stopPolling()}},t.prototype.cancel=function(){},t.prototype.updateWatch=function(e){var r=this;e===void 0&&(e=this.variables);var n=this.observableQuery;if(!(n&&n.options.fetchPolicy==="no-cache")){var i=w(w({},this.getDiffOptions(e)),{watcher:this,callback:function(a){return r.setDiff(a)}});(!this.lastWatch||!Ee(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===gi.get(this.cache)&&Ee(r,n.variables)&&Ee(e.data,n.result.data))},t.prototype.markResult=function(e,r,n,i){var a=this,o=new ft,s=Me(e.errors)?e.errors.slice(0):[];if(this.reset(),"incremental"in e&&Me(e.incremental)){var u=To(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&&(Wo(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:gi.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=ce.ready},t.prototype.markError=function(e){return this.networkStatus=ce.error,this.lastWrite=void 0,this.reset(),e.graphQLErrors&&(this.graphQLErrors=e.graphQLErrors),e.networkError&&(this.networkError=e.networkError),e},t}();function Wo(t,e){e===void 0&&(e="none");var r=e==="ignore"||e==="all",n=!ui(t);return!n&&r&&t.data&&(n=!0),n}var Og=Object.prototype.hasOwnProperty,ld=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(Ot?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 Ho({cache:r}),this.ssrMode=c,this.assumeImmutableResults=!!f,(this.onBroadcast=s)&&(this.mutationStore=Object.create(null))}return t.prototype.stop=function(){var e=this;this.queries.forEach(function(r,n){e.stopQueryNoBroadcast(n)}),this.cancelPendingFetches(__DEV__?new Q("QueryManager stopped while query was in flight"):new Q(14))},t.prototype.cancelPendingFetches=function(e){this.fetchCancelFns.forEach(function(r){return r(e)}),this.fetchCancelFns.clear()},t.prototype.mutate=function(e){var r,n,i=e.mutation,a=e.variables,o=e.optimisticResponse,s=e.updateQueries,u=e.refetchQueries,c=u===void 0?[]:u,l=e.awaitRefetchQueries,d=l===void 0?!1:l,p=e.update,f=e.onQueryUpdated,h=e.fetchPolicy,y=h===void 0?((r=this.defaultOptions.mutate)===null||r===void 0?void 0:r.fetchPolicy)||"network-only":h,v=e.errorPolicy,S=v===void 0?((n=this.defaultOptions.mutate)===null||n===void 0?void 0:n.errorPolicy)||"none":v,_=e.keepRootFields,b=e.context;return $t(this,void 0,void 0,function(){var g,I,R,k,D,F;return Mt(this,function(P){switch(P.label){case 0:return __DEV__?O(i,"mutation option is required. You must specify your GraphQL document in the mutation option."):O(i,15),__DEV__?O(y==="network-only"||y==="no-cache","Mutations support only 'network-only' or 'no-cache' fetchPolicy strings. The default `network-only` behavior automatically writes mutation results to the cache. Passing `no-cache` skips the cache write."):O(y==="network-only"||y==="no-cache",16),g=this.generateMutationId(),I=this.transform(i),R=I.document,k=I.hasClientExports,i=this.cache.transformForLink(R),a=this.getVariables(i,a),k?[4,this.localState.addExportedVariables(i,a,b)]:[3,2];case 1:a=P.sent(),P.label=2;case 2:return D=this.mutationStore&&(this.mutationStore[g]={mutation:i,variables:a,loading:!0,error:null}),o&&this.markMutationOptimistic(o,{mutationId:g,document:i,variables:a,fetchPolicy:y,errorPolicy:S,context:b,updateQueries:s,update:p,keepRootFields:_}),this.broadcastQueries(),F=this,[2,new Promise(function(q,We){return Co(F.getObservableFromLink(i,w(w({},b),{optimisticResponse:o}),a,!1),function($e){if(ui($e)&&S==="none")throw new hr({graphQLErrors:Ao($e)});D&&(D.loading=!1,D.error=null);var V=w({},$e);return typeof c=="function"&&(c=c(V)),S==="ignore"&&ui(V)&&delete V.errors,F.markMutationResult({mutationId:g,result:V,document:i,variables:a,fetchPolicy:y,errorPolicy:S,context:b,update:p,updateQueries:s,awaitRefetchQueries:d,refetchQueries:c,removeOptimistic:o?g:void 0,onQueryUpdated:f,keepRootFields:_})}).subscribe({next:function($e){F.broadcastQueries(),(!("hasNext"in $e)||$e.hasNext===!1)&&q($e)},error:function($e){D&&(D.loading=!1,D.error=$e),o&&F.cache.removeOptimistic(g),F.broadcastQueries(),We($e instanceof hr?$e:new hr({networkError:$e}))}})})]}})})},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&&Wo(i,e.errorPolicy)){if(Rr(i)||a.push({result:i.data,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}),Rr(i)&&Me(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=To(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||!Og.call(c,h))){var y=c[h],v=n.queries.get(p),S=v.document,_=v.variables,b=r.diff({query:S,variables:_,returnPartialData:!0,optimistic:!1}),g=b.result,I=b.complete;if(I&&g){var R=y(g,{mutationResult:i,queryName:S&&ai(S)||void 0,queryVariables:_});R&&a.push({result:R,dataId:"ROOT_QUERY",query:S,variables:_})}}})}if(a.length>0||e.refetchQueries||e.update||e.onQueryUpdated||e.removeOptimistic){var l=[];if(this.refetchQueries({updateCache:function(d){o||a.forEach(function(y){return d.write(y)});var p=e.update,f=!Hf(i)||Rr(i)&&!i.hasNext;if(p){if(!o){var h=d.diff({id:"ROOT_MUTATION",query:n.transform(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0});h.complete&&(i=w(w({},i),{data:h.result}),"incremental"in i&&delete i.incremental,"hasNext"in i&&delete i.hasNext)}f&&p(d,i,{context:e.context,variables:e.variables})}!o&&!e.keepRootFields&&f&&d.modify({id:"ROOT_MUTATION",fields:function(y,v){var S=v.fieldName,_=v.DELETE;return S==="__typename"?y:_}})},include:e.refetchQueries,optimistic:!1,removeOptimistic:e.removeOptimistic,onQueryUpdated:e.onQueryUpdated||null}).forEach(function(d){return l.push(d)}),e.awaitRefetchQueries||e.onQueryUpdated)return Promise.all(l).then(function(){return i})}return Promise.resolve(i)},t.prototype.markMutationOptimistic=function(e,r){var n=this,i=typeof e=="function"?e(r.variables):e;return this.cache.recordOptimisticTransaction(function(a){try{n.markMutationResult(w(w({},r),{result:{data:i}}),a)}catch(o){__DEV__&&O.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=Uc(n),a=this.localState.clientQuery(n),o=i&&this.localState.serverQuery(i),s={document:n,hasClientExports:Nc(n),hasForcedResolvers:this.localState.shouldForceResolvers(n),clientQuery:a,serverQuery:o,defaultVars:yn(Yt(n)),asQuery:w(w({},n),{definitions:n.definitions.map(function(c){return c.kind==="OperationDefinition"&&c.operation!=="query"?w(w({},c),{operation:"query"}):c})})},u=function(c){c&&!r.has(c)&&r.set(c,s)};u(e),u(n),u(a),u(o)}return r.get(e)},t.prototype.getVariables=function(e,r){return w(w({},this.transform(e).defaultVars),r)},t.prototype.watchQuery=function(e){e=w(w({},e),{variables:this.getVariables(e.query,e.variables)}),typeof e.notifyOnNetworkStatusChange>"u"&&(e.notifyOnNetworkStatusChange=!1);var r=new Ko(this),n=new Go({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__?O(e.query,"query option is required. You must specify your GraphQL document in the query option."):O(e.query,17),__DEV__?O(e.query.kind==="Document",'You must wrap the query string in a "gql" tag.'):O(e.query.kind==="Document",18),__DEV__?O(!e.returnPartialData,"returnPartialData option only supported on watchQuery."):O(!e.returnPartialData,19),__DEV__?O(!e.pollInterval,"pollInterval option only supported on watchQuery."):O(!e.pollInterval,20),this.fetchQuery(r,e).finally(function(){return n.stopQuery(r)})},t.prototype.generateQueryId=function(){return String(this.queryIdCounter++)},t.prototype.generateRequestId=function(){return this.requestIdCounter++},t.prototype.generateMutationId=function(){return String(this.mutationIdCounter++)},t.prototype.stopQueryInStore=function(e){this.stopQueryInStoreNoBroadcast(e),this.broadcastQueries()},t.prototype.stopQueryInStoreNoBroadcast=function(e){var r=this.queries.get(e);r&&r.stop()},t.prototype.clearStore=function(e){return e===void 0&&(e={discardWatches:!0}),this.cancelPendingFetches(__DEV__?new Q("Store reset while query was in flight (not completed in link chain)"):new Q(21)),this.queries.forEach(function(r){r.observableQuery?r.networkStatus=ce.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):ie(o)&&o.query&&a.add(o)}),this.queries.forEach(function(o,s){var u=o.observableQuery,c=o.document;if(u){if(e==="all"){n.set(s,u);return}var l=u.queryName,d=u.options.fetchPolicy;if(d==="standby"||e==="active"&&!u.hasObservers())return;(e==="active"||l&&i.has(l)||c&&i.has(c))&&(n.set(s,u),l&&i.set(l,!0),c&&i.set(c,!0))}}),a.size&&a.forEach(function(o){var s=aa("legacyOneTimeQuery"),u=r.getQuery(s).init({document:o.query,variables:o.variables}),c=new Go({queryManager:r,queryInfo:u,options:w(w({},o),{fetchPolicy:"network-only"})});O(c.queryId===s),u.setObservableQuery(c),n.set(s,c)}),__DEV__&&i.size&&i.forEach(function(o,s){o||__DEV__&&O.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"&&(Wo(p,a)&&r.cache.write({query:n,result:p.data,dataId:"ROOT_SUBSCRIPTION",variables:d}),r.broadcastQueries()),ui(p))throw new hr({graphQLErrors:p.errors});return p})};if(this.transform(n).hasClientExports){var l=this.localState.addExportedVariables(n,o,u).then(c);return new J(function(d){var p=null;return l.then(function(f){return p=f.subscribe(d)},d.error),function(){return p&&p.unsubscribe()}})}return c(o)},t.prototype.stopQuery=function(e){this.stopQueryNoBroadcast(e),this.broadcastQueries()},t.prototype.stopQueryNoBroadcast=function(e){this.stopQueryInStoreNoBroadcast(e),this.removeQuery(e)},t.prototype.removeQuery=function(e){this.fetchCancelFns.delete(e),this.queries.has(e)&&(this.getQuery(e).stop(),this.queries.delete(e))},t.prototype.broadcastQueries=function(){this.onBroadcast&&this.onBroadcast(),this.queries.forEach(function(e){return e.notify()})},t.prototype.getLocalState=function(){return this.localState},t.prototype.getObservableFromLink=function(e,r,n,i){var a=this,o;i===void 0&&(i=(o=r?.queryDeduplication)!==null&&o!==void 0?o:this.queryDeduplication);var s,u=this.transform(e).serverQuery;if(u){var c=this,l=c.inFlightLinkObservables,d=c.link,p={query:u,variables:n,operationName:ai(u)||void 0,context:this.prepareContext(w(w({},r),{forceFetch:!i}))};if(r=p.context,i){var f=l.get(u)||new Map;l.set(u,f);var h=_t(n);if(s=f.get(h),!s){var y=new ci([li(d,p)]);f.set(h,s=y),y.beforeNext(function(){f.delete(h)&&f.size<1&&l.delete(u)})}}else s=new ci([li(d,p)])}else s=new ci([J.of({data:{}})]),r=this.prepareContext(r);var v=this.transform(e).clientQuery;return v&&(s=Co(s,function(S){return a.localState.runResolvers({document:v,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 Co(this.getObservableFromLink(a,n.context,n.variables),function(o){var s=Ao(o),u=s.length>0;if(i>=e.lastRequestId){if(u&&n.errorPolicy==="none")throw e.markError(new hr({graphQLErrors:s}));e.markResult(o,a,n,r),e.markReady()}var c={data:o.data,loading:!1,networkStatus:ce.ready};return u&&n.errorPolicy!=="ignore"&&(c.errors=s,c.networkStatus=ce.error),c},function(o){var s=cd(o)?o:new hr({networkError:o});throw i>=e.lastRequestId&&e.markError(s),s})},t.prototype.fetchQueryObservable=function(e,r,n){var i=this;n===void 0&&(n=ce.loading);var a=this.transform(r.query).document,o=this.getVariables(a,r.variables),s=this.getQuery(e),u=this.defaultOptions.watchQuery,c=r.fetchPolicy,l=c===void 0?u&&u.fetchPolicy||"cache-first":c,d=r.errorPolicy,p=d===void 0?u&&u.errorPolicy||"none":d,f=r.returnPartialData,h=f===void 0?!1:f,y=r.notifyOnNetworkStatusChange,v=y===void 0?!1:y,S=r.context,_=S===void 0?{}:S,b=Object.assign({},r,{query:a,variables:o,fetchPolicy:l,errorPolicy:p,returnPartialData:h,notifyOnNetworkStatusChange:v,context:_}),g=function(k){b.variables=k;var D=i.fetchQueryByPolicy(s,b,n);return b.fetchPolicy!=="standby"&&D.length>0&&s.observableQuery&&s.observableQuery.applyNextFetchPolicy("after-fetch",r),D},I=function(){return i.fetchCancelFns.delete(e)};this.fetchCancelFns.set(e,function(k){I(),setTimeout(function(){return R.cancel(k)})});var R=new ci(this.transform(b.query).hasClientExports?this.localState.addExportedVariables(b.query,b.variables,b.context).then(g):g(b.variables));return R.promise.then(I,I),R},t.prototype.refetchQueries=function(e){var r=this,n=e.updateCache,i=e.include,a=e.optimistic,o=a===void 0?!1:a,s=e.removeOptimistic,u=s===void 0?o?aa("refetchQueries"):void 0:s,c=e.onQueryUpdated,l=new Map;i&&this.getObservableQueries(i).forEach(function(p,f){l.set(f,{oq:p,lastDiff:r.getQuery(f).getDiff()})});var d=new Map;return n&&this.cache.batch({update:n,optimistic:o&&u||!1,removeOptimistic:u,onWatchUpdated:function(p,f,h){var y=p.watcher instanceof Ko&&p.watcher.observableQuery;if(y){if(c){l.delete(y.queryId);var v=c(y,f,h);return v===!0&&(v=y.refetch()),v!==!1&&d.set(y,v),v}c!==null&&l.set(y.queryId,{oq:y,lastDiff:h,diff:f})}}}),l.size&&l.forEach(function(p,f){var h=p.oq,y=p.lastDiff,v=p.diff,S;if(c){if(!v){var _=h.queryInfo;_.reset(),v=_.getDiff()}S=c(h,v,y)}(!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)},y=function(g,I){I===void 0&&(I=e.networkStatus||ce.loading);var R=g.result;__DEV__&&!l&&!Ee(R,{})&&Iu(g.missing);var k=function(D){return J.of(w({data:D,loading:Mr(I),networkStatus:I},g.complete?null:{partial:!0}))};return R&&i.transform(a).hasForcedResolvers?i.localState.runResolvers({document:a,remoteResult:{data:R},context:d,variables:o,onlyRunForcedResolvers:!0}).then(function(D){return k(D.data||void 0)}):c==="none"&&I===ce.refetch&&Array.isArray(g.missing)?k(void 0):k(R)},v=s==="no-cache"?0:n===ce.refetch&&u!=="merge"?1:2,S=function(){return i.getResultsFromLink(e,v,{variables:o,context:d,fetchPolicy:s,errorPolicy:c})},_=p&&typeof f=="number"&&f!==n&&Mr(n);switch(s){default:case"cache-first":{var b=h();return b.complete?[y(b,e.markReady())]:l||_?[y(b),S()]:[S()]}case"cache-and-network":{var b=h();return b.complete||l||_?[y(b),S()]:[S()]}case"cache-only":return[y(h(),e.markReady())];case"network-only":return _?[y(h()),S()]:[S()];case"no-cache":return _?[y(e.getDiff()),S()]:[S()];case"standby":return[]}},t.prototype.getQuery=function(e){return e&&!this.queries.has(e)&&this.queries.set(e,new Ko(this,e)),this.queries.get(e)},t.prototype.prepareContext=function(e){e===void 0&&(e={});var r=this.localState.prepareContext(e);return w(w({},r),{clientAwareness:this.clientAwareness})},t}();var fd=!1;var Du=function(){function t(e){var r=this;this.resetStoreCallbacks=[],this.clearStoreCallbacks=[];var n=e.uri,i=e.credentials,a=e.headers,o=e.cache,s=e.ssrMode,u=s===void 0?!1:s,c=e.ssrForceFetchDelay,l=c===void 0?0:c,d=e.connectToDevTools,p=d===void 0?typeof window=="object"&&!window.__APOLLO_CLIENT__&&__DEV__:d,f=e.queryDeduplication,h=f===void 0?!0:f,y=e.defaultOptions,v=e.assumeImmutableResults,S=v===void 0?!1:v,_=e.resolvers,b=e.typeDefs,g=e.fragmentMatcher,I=e.name,R=e.version,k=e.link;if(k||(k=n?new au({uri:n,credentials:i,headers:a}):Dt.empty()),!o)throw __DEV__?new Q(`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 Q(9);if(this.link=k,this.cache=o,this.disableNetworkFetches=u||l>0,this.queryDeduplication=h,this.defaultOptions=y||Object.create(null),this.typeDefs=b,l&&setTimeout(function(){return r.disableNetworkFetches=!1},l),this.watchQuery=this.watchQuery.bind(this),this.query=this.query.bind(this),this.mutate=this.mutate.bind(this),this.resetStore=this.resetStore.bind(this),this.reFetchObservableQueries=this.reFetchObservableQueries.bind(this),p&&typeof window=="object"&&(window.__APOLLO_CLIENT__=this),!fd&&p&&__DEV__&&(fd=!0,typeof window<"u"&&window.document&&window.top===window.self&&!window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__)){var D=window.navigator,F=D&&D.userAgent,P=void 0;typeof F=="string"&&(F.indexOf("Chrome/")>-1?P="https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm":F.indexOf("Firefox/")>-1&&(P="https://addons.mozilla.org/en-US/firefox/addon/apollo-developer-tools/")),P&&__DEV__&&O.log("Download the Apollo DevTools for a better development experience: "+P)}this.version=Yf,this.localState=new Ho({cache:o,client:this,resolvers:_,fragmentMatcher:g}),this.queryManager=new ld({cache:this.cache,link:this.link,defaultOptions:this.defaultOptions,queryDeduplication:h,ssrMode:u,clientAwareness:{name:I,version:R},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=oa(this.defaultOptions.watchQuery,e)),this.disableNetworkFetches&&(e.fetchPolicy==="network-only"||e.fetchPolicy==="cache-and-network")&&(e=w(w({},e),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(e)},t.prototype.query=function(e){return this.defaultOptions.query&&(e=oa(this.defaultOptions.query,e)),__DEV__?O(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."):O(e.fetchPolicy!=="cache-and-network",10),this.disableNetworkFetches&&e.fetchPolicy==="network-only"&&(e=w(w({},e),{fetchPolicy:"cache-first"})),this.queryManager.query(e)},t.prototype.mutate=function(e){return this.defaultOptions.mutate&&(e=oa(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 li(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__&&O.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}();xf(fn?"log":"silent");function it(t){return t===null?"null":Array.isArray(t)?"array":typeof t}function mr(t){return it(t)==="object"}function pd(t){return Array.isArray(t)&&t.length>0&&t.every(e=>"message"in e)}function Nu(t,e){return t.length<124?t:e}var dd="graphql-transport-ws";var pt;(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"})(pt||(pt={}));var Ne;(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"})(Ne||(Ne={}));function hd(t){if(!mr(t))throw new Error(`Message is expected to be an object, but got ${it(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 ${it(t.type)}`);switch(t.type){case Ne.ConnectionInit:case Ne.ConnectionAck:case Ne.Ping:case Ne.Pong:{if(t.payload!=null&&!mr(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 Ne.Subscribe:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${it(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);if(!mr(t.payload))throw new Error(`"${t.type}" message expects the 'payload' property to be an object, but got ${it(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 ${it(t.payload.query)}`);if(t.payload.variables!=null&&!mr(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 ${it(t.payload.variables)}`);if(t.payload.operationName!=null&&it(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 ${it(t.payload.operationName)}`);if(t.payload.extensions!=null&&!mr(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 ${it(t.payload.extensions)}`);break}case Ne.Next:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${it(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);if(!mr(t.payload))throw new Error(`"${t.type}" message expects the 'payload' property to be an object, but got ${it(t.payload)}`);break}case Ne.Error:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${it(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);if(!pd(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 Ne.Complete:{if(typeof t.id!="string")throw new Error(`"${t.type}" message expects the 'id' property to be a string, but got ${it(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 md(t,e){return hd(typeof t=="string"?JSON.parse(t,e):t)}function yi(t,e){return hd(t),JSON.stringify(t,e)}function gd(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(ve){let be=1e3;for(let re=0;re<ve;re++)be*=2;await new Promise(re=>setTimeout(re,be+Math.floor(Math.random()*(3e3-300)+300)))},shouldRetry:d=Zo,isFatalConnectionProblem:p,on:f,webSocketImpl:h,generateID:y=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,ve=>{let be=Math.random()*16|0;return(ve=="x"?be:be&3|8).toString(16)})},jsonMessageReplacer:v,jsonMessageReviver:S}=t,_;if(h){if(!Ng(h))throw new Error("Invalid WebSocket implementation provided");_=h}else typeof WebSocket<"u"?_=WebSocket:typeof global<"u"?_=global.WebSocket||global.MozWebSocket:typeof window<"u"&&(_=window.WebSocket||window.MozWebSocket);if(!_)throw new Error("WebSocket implementation missing; on Node you can `import WebSocket from 'ws';` and pass `webSocketImpl: WebSocket` to `createClient`");let b=_,g=(()=>{let V=(()=>{let be={};return{on(re,ne){return be[re]=ne,()=>{delete be[re]}},emit(re){var ne;"id"in re&&((ne=be[re.id])===null||ne===void 0||ne.call(be,re))}}})(),ve={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?[V.emit,f.message]:[V.emit],closed:f?.closed?[f.closed]:[],error:f?.error?[f.error]:[]};return{onMessage:V.on,on(be,re){let ne=ve[be];return ne.push(re),()=>{ne.splice(ne.indexOf(re),1)}},emit(be,...re){for(let ne of[...ve[be]])ne(...re)}}})();function I(V){let ve=[g.on("error",be=>{ve.forEach(re=>re()),V(be)}),g.on("closed",be=>{ve.forEach(re=>re()),V(be)})]}let R,k=0,D,F=!1,P=0,q=!1;async function We(){clearTimeout(D);let[V,ve]=await(R??(R=new Promise((ne,Ht)=>(async()=>{if(F){if(await l(P),!k)return R=void 0,Ht({code:1e3,reason:"All Subscriptions Gone"});P++}g.emit("connecting");let Y=new b(typeof e=="function"?await e():e,dd),Kt,Cr;function so(){isFinite(o)&&o>0&&(clearTimeout(Cr),Cr=setTimeout(()=>{Y.readyState===b.OPEN&&(Y.send(yi({type:Ne.Ping})),g.emit("ping",!1,void 0))},o))}I(Ze=>{R=void 0,clearTimeout(Kt),clearTimeout(Cr),Ht(Ze),Zo(Ze)&&Ze.code===4499&&(Y.close(4499,"Terminated"),Y.onerror=null,Y.onclose=null)}),Y.onerror=Ze=>g.emit("error",Ze),Y.onclose=Ze=>g.emit("closed",Ze),Y.onopen=async()=>{try{g.emit("opened",Y);let Ze=typeof r=="function"?await r():r;if(Y.readyState!==b.OPEN)return;Y.send(yi(Ze?{type:Ne.ConnectionInit,payload:Ze}:{type:Ne.ConnectionInit},v)),isFinite(u)&&u>0&&(Kt=setTimeout(()=>{Y.close(pt.ConnectionAcknowledgementTimeout,"Connection acknowledgement timeout")},u)),so()}catch(Ze){g.emit("error",Ze),Y.close(pt.InternalClientError,Nu(Ze instanceof Error?Ze.message:new Error(Ze).message,"Internal client error"))}};let Jn=!1;Y.onmessage=({data:Ze})=>{try{let Ye=md(Ze,S);if(g.emit("message",Ye),Ye.type==="ping"||Ye.type==="pong"){g.emit(Ye.type,!0,Ye.payload),Ye.type==="pong"?so():s||(Y.send(yi(Ye.payload?{type:Ne.Pong,payload:Ye.payload}:{type:Ne.Pong})),g.emit("pong",!1,Ye.payload));return}if(Jn)return;if(Ye.type!==Ne.ConnectionAck)throw new Error(`First message cannot be of type ${Ye.type}`);clearTimeout(Kt),Jn=!0,g.emit("connected",Y,Ye.payload),F=!1,P=0,ne([Y,new Promise((n3,T1)=>I(T1))])}catch(Ye){Y.onmessage=null,g.emit("error",Ye),Y.close(pt.BadResponse,Nu(Ye instanceof Error?Ye.message:new Error(Ye).message,"Bad response"))}}})())));V.readyState===b.CLOSING&&await ve;let be=()=>{},re=new Promise(ne=>be=ne);return[V,be,Promise.race([re.then(()=>{if(!k){let ne=()=>V.close(1e3,"Normal Closure");isFinite(a)&&a>0?D=setTimeout(()=>{V.readyState===b.OPEN&&ne()},a):ne()}}),ve])]}function $e(V){if(Zo(V)&&(Dg(V.code)||[pt.InternalServerError,pt.InternalClientError,pt.BadRequest,pt.BadResponse,pt.Unauthorized,pt.SubprotocolNotAcceptable,pt.SubscriberAlreadyExists,pt.TooManyInitialisationRequests].includes(V.code)))throw V;if(q)return!1;if(Zo(V)&&V.code===1e3)return k>0;if(!c||P>=c||!d(V)||p?.(V))throw V;return F=!0}return n||(async()=>{for(k++;;)try{let[,,V]=await We();await V}catch(V){try{if(!$e(V))return}catch(ve){return i?.(ve)}}})(),{on:g.on,subscribe(V,ve){let be=y(V),re=!1,ne=!1,Ht=()=>{k--,re=!0};return(async()=>{for(k++;;)try{let[Y,Kt,Cr]=await We();if(re)return Kt();let so=g.onMessage(be,Jn=>{switch(Jn.type){case Ne.Next:{ve.next(Jn.payload);return}case Ne.Error:{ne=!0,re=!0,ve.error(Jn.payload),Ht();return}case Ne.Complete:{re=!0,Ht();return}}});Y.send(yi({id:be,type:Ne.Subscribe,payload:V},v)),Ht=()=>{!re&&Y.readyState===b.OPEN&&Y.send(yi({id:be,type:Ne.Complete},v)),k--,re=!0,Kt()},await Cr.finally(so);return}catch(Y){if(!$e(Y))return}})().then(()=>{ne||ve.complete()}).catch(Y=>{ve.error(Y)}),()=>{re||Ht()}},async dispose(){if(q=!0,R){let[V]=await R;V.close(1e3,"Normal Closure")}},terminate(){R&&g.emit("closed",{code:4499,reason:"Terminated",wasClean:!1})}}}function Zo(t){return mr(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 Ng(t){return typeof t=="function"&&"constructor"in t&&"CLOSED"in t&&"CLOSING"in t&&"CONNECTING"in t&&"OPEN"in t}function Rg(t){return ie(t)&&"code"in t&&"reason"in t}var yd=function(t){Oe(e,t);function e(r){var n=t.call(this)||this;return n.client=r,n}return e.prototype.request=function(r){var n=this;return new J(function(i){return n.client.subscribe(w(w({},r),{query:ri(r.query)}),{next:i.next.bind(i),complete:i.complete.bind(i),error:function(a){return a instanceof Error?i.error(a):Rg(a)?i.error(new Error("Socket closed with event ".concat(a.code," ").concat(a.reason||""))):i.error(new hr({graphQLErrors:Array.isArray(a)?a:[a]}))}})})},e}(Dt);var Es=function(){return Es=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},Es.apply(this,arguments)};typeof SuppressedError=="function"&&SuppressedError;function us(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?us=function(r){return typeof r}:us=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},us(t)}function Pg(t){return us(t)=="object"&&t!==null}var kh=typeof Symbol=="function"&&Symbol.toStringTag!=null?Symbol.toStringTag:"@@toStringTag";function Xu(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 Lg(t){return Th(t.source,Xu(t.source,t.start))}function Th(t,e){var r=t.locationOffset.column-1,n=ls(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=[],y=0;y<d.length;y+=80)h.push(d.slice(y,y+80));return c+vd([["".concat(o),h[0]]].concat(h.slice(1,p+1).map(function(v){return["",v]}),[[" ",ls(f-1)+"^"],["",h[p+1]]]))}return c+vd([["".concat(o-1),l[i-1]],["".concat(o),d],["",ls(u-1)+"^"],["".concat(o+1),l[i+1]]])}function vd(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 Fg(r,i)+(a?" | "+a:" |")}).join(`
|
|
55
|
+
`)}function ls(t){return Array(t+1).join(" ")}function Fg(t,e){return ls(t-e.length)+e}function fs(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?fs=function(r){return typeof r}:fs=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},fs(t)}function bd(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 $g(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?bd(Object(r),!0).forEach(function(n){Mg(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):bd(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Mg(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ug(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _d(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 jg(t,e,r){return e&&_d(t.prototype,e),r&&_d(t,r),t}function Bg(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&&Ma(t,e)}function qg(t){var e=Ih();return function(){var n=Ua(t),i;if(e){var a=Ua(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return Ah(this,i)}}function Ah(t,e){return e&&(fs(e)==="object"||typeof e=="function")?e:ya(t)}function ya(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function el(t){var e=typeof Map=="function"?new Map:void 0;return el=function(n){if(n===null||!Vg(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 ps(n,arguments,Ua(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),Ma(i,n)},el(t)}function ps(t,e,r){return Ih()?ps=Reflect.construct:ps=function(i,a,o){var s=[null];s.push.apply(s,a);var u=Function.bind.apply(i,s),c=new u;return o&&Ma(c,o.prototype),c},ps.apply(null,arguments)}function Ih(){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 Vg(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function Ma(t,e){return Ma=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},Ma(t,e)}function Ua(t){return Ua=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},Ua(t)}var zg=function(t){Bg(r,t);var e=qg(r);function r(n,i,a,o,s,u,c){var l,d,p,f;Ug(this,r),f=e.call(this,n),f.name="GraphQLError",f.originalError=u??void 0,f.nodes=wd(Array.isArray(i)?i:i?[i]:void 0);for(var h=[],y=0,v=(S=f.nodes)!==null&&S!==void 0?S:[];y<v.length;y++){var S,_=v[y],b=_.loc;b!=null&&h.push(b)}h=wd(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(I){return I.start})),f.locations=o&&a?o.map(function(I){return Xu(a,I)}):(p=h)===null||p===void 0?void 0:p.map(function(I){return Xu(I.source,I.start)}),f.path=s??void 0;var g=u?.extensions;return c==null&&Pg(g)?f.extensions=$g({},g):f.extensions=c??{},Object.defineProperties(ya(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(ya(f),"stack",{value:u.stack,writable:!0,configurable:!0}),Ah(f)):(Error.captureStackTrace?Error.captureStackTrace(ya(f),r):Object.defineProperty(ya(f),"stack",{value:Error().stack,writable:!0,configurable:!0}),f)}return jg(r,[{key:"toString",value:function(){return Qg(this)}},{key:kh,get:function(){return"Object"}}]),r}(el(Error));function wd(t){return t===void 0||t.length===0?void 0:t}function Qg(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
|
+
`+Lg(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=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.
|
|
59
|
+
`+Th(t.source,s)}return e}function xt(t,e,r){return new zg("Syntax Error: ".concat(r),void 0,t,[e])}var B=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 Gg(t,e){var r=Boolean(t);if(!r)throw new Error(e??"Unexpected invariant triggered.")}var Hg=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):void 0,tl=Hg;function Oh(t){var e=t.prototype.toJSON;typeof e=="function"||Gg(0),t.prototype.inspect=e,tl&&(t.prototype[tl]=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}();Oh(Dh);var Pe=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}();Oh(Pe);var T=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 ds(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ds=function(r){return typeof r}:ds=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},ds(t)}var Kg=10,Nh=2;function Wg(t){return Ks(t,[])}function Ks(t,e){switch(ds(t)){case"string":return JSON.stringify(t);case"function":return t.name?"[function ".concat(t.name,"]"):"[function]";case"object":return t===null?"null":Zg(t,e);default:return String(t)}}function Zg(t,e){if(e.indexOf(t)!==-1)return"[Circular]";var r=[].concat(e,[t]),n=Xg(t);if(n!==void 0){var i=n.call(t);if(i!==t)return typeof i=="string"?i:Ks(i,r)}else if(Array.isArray(t))return Jg(t,r);return Yg(t,r)}function Yg(t,e){var r=Object.keys(t);if(r.length===0)return"{}";if(e.length>Nh)return"["+ey(t)+"]";var n=r.map(function(i){var a=Ks(t[i],e);return i+": "+a});return"{ "+n.join(", ")+" }"}function Jg(t,e){if(t.length===0)return"[]";if(e.length>Nh)return"[Array]";for(var r=Math.min(Kg,t.length),n=t.length-r,i=[],a=0;a<r;++a)i.push(Ks(t[a],e));return n===1?i.push("... 1 more item"):n>1&&i.push("... ".concat(n," more items")),"["+i.join(", ")+"]"}function Xg(t){var e=t[String(tl)];if(typeof e=="function")return e;if(typeof t.inspect=="function")return t.inspect}function ey(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 Ru(t,e){var r=Boolean(t);if(!r)throw new Error(e)}var ty=function(e,r){return e instanceof r};function Sd(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 ry(t,e,r){return e&&Sd(t.prototype,e),r&&Sd(t,r),t}var Rh=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"||Ru(0,"Body must be a string. Received: ".concat(Wg(e),".")),this.body=e,this.name=r,this.locationOffset=n,this.locationOffset.line>0||Ru(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||Ru(0,"column in locationOffset is 1-indexed and must be positive.")}return ry(t,[{key:kh,get:function(){return"Source"}}]),t}();function ny(t){return ty(t,Rh)}var iy=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 ay(t){var e=t.split(/\r\n|[\n\r]/g),r=oy(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&&xd(e[i]);)++i;for(var a=e.length;a>i&&xd(e[a-1]);)--a;return e.slice(i,a).join(`
|
|
60
|
+
`)}function xd(t){for(var e=0;e<t.length;++e)if(t[e]!==" "&&t[e]!==" ")return!1;return!0}function oy(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 sy=function(){function t(r){var n=new Pe(T.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!==T.EOF)do{var i;n=(i=n.next)!==null&&i!==void 0?i:n.next=uy(this,n)}while(n.kind===T.COMMENT);return n},t}();function cy(t){return t===T.BANG||t===T.DOLLAR||t===T.AMP||t===T.PAREN_L||t===T.PAREN_R||t===T.SPREAD||t===T.COLON||t===T.EQUALS||t===T.AT||t===T.BRACKET_L||t===T.BRACKET_R||t===T.BRACE_L||t===T.PIPE||t===T.BRACE_R}function Ln(t){return isNaN(t)?T.EOF:t<127?JSON.stringify(String.fromCharCode(t)):'"\\u'.concat(("00"+t.toString(16).toUpperCase()).slice(-4),'"')}function uy(t,e){for(var r=t.source,n=r.body,i=n.length,a=e.end;a<i;){var o=n.charCodeAt(a),s=t.line,u=1+a-t.lineStart;switch(o){case 65279:case 9:case 32:case 44:++a;continue;case 10:++a,++t.line,t.lineStart=a;continue;case 13:n.charCodeAt(a+1)===10?a+=2:++a,++t.line,t.lineStart=a;continue;case 33:return new Pe(T.BANG,a,a+1,s,u,e);case 35:return fy(r,a,s,u,e);case 36:return new Pe(T.DOLLAR,a,a+1,s,u,e);case 38:return new Pe(T.AMP,a,a+1,s,u,e);case 40:return new Pe(T.PAREN_L,a,a+1,s,u,e);case 41:return new Pe(T.PAREN_R,a,a+1,s,u,e);case 46:if(n.charCodeAt(a+1)===46&&n.charCodeAt(a+2)===46)return new Pe(T.SPREAD,a,a+3,s,u,e);break;case 58:return new Pe(T.COLON,a,a+1,s,u,e);case 61:return new Pe(T.EQUALS,a,a+1,s,u,e);case 64:return new Pe(T.AT,a,a+1,s,u,e);case 91:return new Pe(T.BRACKET_L,a,a+1,s,u,e);case 93:return new Pe(T.BRACKET_R,a,a+1,s,u,e);case 123:return new Pe(T.BRACE_L,a,a+1,s,u,e);case 124:return new Pe(T.PIPE,a,a+1,s,u,e);case 125:return new Pe(T.BRACE_R,a,a+1,s,u,e);case 34:return n.charCodeAt(a+1)===34&&n.charCodeAt(a+2)===34?hy(r,a,s,u,e,t):dy(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 py(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 gy(r,a,s,u,e)}throw xt(r,a,ly(o))}var c=t.line,l=1+a-t.lineStart;return new Pe(T.EOF,i,i,c,l,e)}function ly(t){return t<32&&t!==9&&t!==10&&t!==13?"Cannot contain the invalid character ".concat(Ln(t),"."):t===39?`Unexpected single quote character ('), did you mean to use a double quote (")?`:"Cannot parse the unexpected character ".concat(Ln(t),".")}function fy(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 Pe(T.COMMENT,e,s,r,n,i,a.slice(e+1,s))}function py(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 xt(t,u,"Invalid number, unexpected digit after 0: ".concat(Ln(s),"."))}else u=Pu(t,u,s),s=o.charCodeAt(u);if(s===46&&(c=!0,s=o.charCodeAt(++u),u=Pu(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=Pu(t,u,s),s=o.charCodeAt(u)),s===46||yy(s))throw xt(t,u,"Invalid number, expected digit but got: ".concat(Ln(s),"."));return new Pe(c?T.FLOAT:T.INT,e,u,n,i,a,o.slice(e,u))}function Pu(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 xt(t,i,"Invalid number, expected digit but got: ".concat(Ln(a),"."))}function dy(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 Pe(T.STRING,e,o+1,r,n,i,c);if(u<32&&u!==9)throw xt(t,o,"Invalid character within String: ".concat(Ln(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=my(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 xt(t,o,"Invalid character escape sequence: \\u".concat(d,"."))}c+=String.fromCharCode(l),o+=4;break}default:throw xt(t,o,"Invalid character escape sequence: \\".concat(String.fromCharCode(u),"."))}++o,s=o}}throw xt(t,o,"Unterminated string.")}function hy(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 Pe(T.BLOCK_STRING,e,s+3,r,n,i,ay(l));if(c<32&&c!==9&&c!==10&&c!==13)throw xt(t,s,"Invalid character within String: ".concat(Ln(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 xt(t,s,"Unterminated string.")}function my(t,e,r,n){return Yo(t)<<12|Yo(e)<<8|Yo(r)<<4|Yo(n)}function Yo(t){return t>=48&&t<=57?t-48:t>=65&&t<=70?t-55:t>=97&&t<=102?t-87:-1}function gy(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 Pe(T.NAME,e,s,r,n,i,a.slice(e,s))}function yy(t){return t===95||t>=65&&t<=90||t>=97&&t<=122}function vy(t,e){var r=new by(t,e);return r.parseDocument()}var by=function(){function t(r,n){var i=ny(r)?r:new Rh(r);this._lexer=new sy(i),this._options=n}var e=t.prototype;return e.parseName=function(){var n=this.expectToken(T.NAME);return{kind:B.NAME,value:n.value,loc:this.loc(n)}},e.parseDocument=function(){var n=this._lexer.token;return{kind:B.DOCUMENT,definitions:this.many(T.SOF,this.parseDefinition,T.EOF),loc:this.loc(n)}},e.parseDefinition=function(){if(this.peek(T.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(T.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(T.BRACE_L))return{kind:B.OPERATION_DEFINITION,operation:"query",name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet(),loc:this.loc(n)};var i=this.parseOperationType(),a;return this.peek(T.NAME)&&(a=this.parseName()),{kind:B.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(T.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(T.PAREN_L,this.parseVariableDefinition,T.PAREN_R)},e.parseVariableDefinition=function(){var n=this._lexer.token;return{kind:B.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(T.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(T.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(T.DOLLAR),{kind:B.VARIABLE,name:this.parseName(),loc:this.loc(n)}},e.parseSelectionSet=function(){var n=this._lexer.token;return{kind:B.SELECTION_SET,selections:this.many(T.BRACE_L,this.parseSelection,T.BRACE_R),loc:this.loc(n)}},e.parseSelection=function(){return this.peek(T.SPREAD)?this.parseFragment():this.parseField()},e.parseField=function(){var n=this._lexer.token,i=this.parseName(),a,o;return this.expectOptionalToken(T.COLON)?(a=i,o=this.parseName()):o=i,{kind:B.FIELD,alias:a,name:o,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(T.BRACE_L)?this.parseSelectionSet():void 0,loc:this.loc(n)}},e.parseArguments=function(n){var i=n?this.parseConstArgument:this.parseArgument;return this.optionalMany(T.PAREN_L,i,T.PAREN_R)},e.parseArgument=function(){var n=this._lexer.token,i=this.parseName();return this.expectToken(T.COLON),{kind:B.ARGUMENT,name:i,value:this.parseValueLiteral(!1),loc:this.loc(n)}},e.parseConstArgument=function(){var n=this._lexer.token;return{kind:B.ARGUMENT,name:this.parseName(),value:(this.expectToken(T.COLON),this.parseValueLiteral(!0)),loc:this.loc(n)}},e.parseFragment=function(){var n=this._lexer.token;this.expectToken(T.SPREAD);var i=this.expectOptionalKeyword("on");return!i&&this.peek(T.NAME)?{kind:B.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1),loc:this.loc(n)}:{kind:B.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:B.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:B.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 T.BRACKET_L:return this.parseList(n);case T.BRACE_L:return this.parseObject(n);case T.INT:return this._lexer.advance(),{kind:B.INT,value:i.value,loc:this.loc(i)};case T.FLOAT:return this._lexer.advance(),{kind:B.FLOAT,value:i.value,loc:this.loc(i)};case T.STRING:case T.BLOCK_STRING:return this.parseStringLiteral();case T.NAME:switch(this._lexer.advance(),i.value){case"true":return{kind:B.BOOLEAN,value:!0,loc:this.loc(i)};case"false":return{kind:B.BOOLEAN,value:!1,loc:this.loc(i)};case"null":return{kind:B.NULL,loc:this.loc(i)};default:return{kind:B.ENUM,value:i.value,loc:this.loc(i)}}case T.DOLLAR:if(!n)return this.parseVariable();break}throw this.unexpected()},e.parseStringLiteral=function(){var n=this._lexer.token;return this._lexer.advance(),{kind:B.STRING,value:n.value,block:n.kind===T.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:B.LIST,values:this.any(T.BRACKET_L,o,T.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:B.OBJECT,fields:this.any(T.BRACE_L,o,T.BRACE_R),loc:this.loc(a)}},e.parseObjectField=function(n){var i=this._lexer.token,a=this.parseName();return this.expectToken(T.COLON),{kind:B.OBJECT_FIELD,name:a,value:this.parseValueLiteral(n),loc:this.loc(i)}},e.parseDirectives=function(n){for(var i=[];this.peek(T.AT);)i.push(this.parseDirective(n));return i},e.parseDirective=function(n){var i=this._lexer.token;return this.expectToken(T.AT),{kind:B.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(n),loc:this.loc(i)}},e.parseTypeReference=function(){var n=this._lexer.token,i;return this.expectOptionalToken(T.BRACKET_L)?(i=this.parseTypeReference(),this.expectToken(T.BRACKET_R),i={kind:B.LIST_TYPE,type:i,loc:this.loc(n)}):i=this.parseNamedType(),this.expectOptionalToken(T.BANG)?{kind:B.NON_NULL_TYPE,type:i,loc:this.loc(n)}:i},e.parseNamedType=function(){var n=this._lexer.token;return{kind:B.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===T.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(T.STRING)||this.peek(T.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(T.BRACE_L,this.parseOperationTypeDefinition,T.BRACE_R);return{kind:B.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(T.COLON);var a=this.parseNamedType();return{kind:B.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:B.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:B.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(T.AMP);do i.push(this.parseNamedType());while(this.expectOptionalToken(T.AMP)||this.peek(T.NAME));return i}return this.delimitedMany(T.AMP,this.parseNamedType)},e.parseFieldsDefinition=function(){var n;return((n=this._options)===null||n===void 0?void 0:n.allowLegacySDLEmptyFields)===!0&&this.peek(T.BRACE_L)&&this._lexer.lookahead().kind===T.BRACE_R?(this._lexer.advance(),this._lexer.advance(),[]):this.optionalMany(T.BRACE_L,this.parseFieldDefinition,T.BRACE_R)},e.parseFieldDefinition=function(){var n=this._lexer.token,i=this.parseDescription(),a=this.parseName(),o=this.parseArgumentDefs();this.expectToken(T.COLON);var s=this.parseTypeReference(),u=this.parseDirectives(!0);return{kind:B.FIELD_DEFINITION,description:i,name:a,arguments:o,type:s,directives:u,loc:this.loc(n)}},e.parseArgumentDefs=function(){return this.optionalMany(T.PAREN_L,this.parseInputValueDef,T.PAREN_R)},e.parseInputValueDef=function(){var n=this._lexer.token,i=this.parseDescription(),a=this.parseName();this.expectToken(T.COLON);var o=this.parseTypeReference(),s;this.expectOptionalToken(T.EQUALS)&&(s=this.parseValueLiteral(!0));var u=this.parseDirectives(!0);return{kind:B.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:B.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:B.UNION_TYPE_DEFINITION,description:i,name:a,directives:o,types:s,loc:this.loc(n)}},e.parseUnionMemberTypes=function(){return this.expectOptionalToken(T.EQUALS)?this.delimitedMany(T.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:B.ENUM_TYPE_DEFINITION,description:i,name:a,directives:o,values:s,loc:this.loc(n)}},e.parseEnumValuesDefinition=function(){return this.optionalMany(T.BRACE_L,this.parseEnumValueDefinition,T.BRACE_R)},e.parseEnumValueDefinition=function(){var n=this._lexer.token,i=this.parseDescription(),a=this.parseName(),o=this.parseDirectives(!0);return{kind:B.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:B.INPUT_OBJECT_TYPE_DEFINITION,description:i,name:a,directives:o,fields:s,loc:this.loc(n)}},e.parseInputFieldsDefinition=function(){return this.optionalMany(T.BRACE_L,this.parseInputValueDef,T.BRACE_R)},e.parseTypeSystemExtension=function(){var n=this._lexer.lookahead();if(n.kind===T.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(T.BRACE_L,this.parseOperationTypeDefinition,T.BRACE_R);if(i.length===0&&a.length===0)throw this.unexpected();return{kind:B.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:B.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:B.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:B.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:B.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:B.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:B.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(T.AT);var a=this.parseName(),o=this.parseArgumentDefs(),s=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");var u=this.parseDirectiveLocations();return{kind:B.DIRECTIVE_DEFINITION,description:i,name:a,arguments:o,repeatable:s,locations:u,loc:this.loc(n)}},e.parseDirectiveLocations=function(){return this.delimitedMany(T.PIPE,this.parseDirectiveLocation)},e.parseDirectiveLocation=function(){var n=this._lexer.token,i=this.parseName();if(iy[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 xt(this._lexer.source,i.start,"Expected ".concat(Ph(n),", found ").concat(Lu(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===T.NAME&&i.value===n)this._lexer.advance();else throw xt(this._lexer.source,i.start,'Expected "'.concat(n,'", found ').concat(Lu(i),"."))},e.expectOptionalKeyword=function(n){var i=this._lexer.token;return i.kind===T.NAME&&i.value===n?(this._lexer.advance(),!0):!1},e.unexpected=function(n){var i=n??this._lexer.token;return xt(this._lexer.source,i.start,"Unexpected ".concat(Lu(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 Lu(t){var e=t.value;return Ph(t.kind)+(e!=null?' "'.concat(e,'"'):"")}function Ph(t){return cy(t)?'"'.concat(t,'"'):t}var hs=new Map,rl=new Map,Lh=!0,Cs=!1;function Fh(t){return t.replace(/[\s,]+/g," ").trim()}function _y(t){return Fh(t.source.body.substring(t.start,t.end))}function wy(t){var e=new Set,r=[];return t.definitions.forEach(function(n){if(n.kind==="FragmentDefinition"){var i=n.name.value,a=_y(n.loc),o=rl.get(i);o&&!o.has(a)?Lh&&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||$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){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 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=`
|
|
63
|
+
this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`):o||rl.set(i,o=new Set),o.add(a),e.has(a)||(e.add(a),r.push(n))}else r.push(n)}),Es(Es({},t),{definitions:r})}function Sy(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 xy(t){var e=Fh(t);if(!hs.has(e)){var r=vy(t,{experimentalFragmentVariables:Cs,allowLegacyFragmentVariables:Cs});if(!r||r.kind!=="Document")throw new Error("Not a valid GraphQL document.");hs.set(e,Sy(wy(r)))}return hs.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]}),xy(n)}function Ey(){hs.clear(),rl.clear()}function Cy(){Lh=!1}function ky(){Cs=!0}function Ty(){Cs=!1}var ha={gql:C,resetCaches:Ey,disableFragmentWarnings:Cy,enableExperimentalFragmentVariables:ky,disableExperimentalFragmentVariables:Ty};(function(t){t.gql=ha.gql,t.resetCaches=ha.resetCaches,t.disableFragmentWarnings=ha.disableFragmentWarnings,t.enableExperimentalFragmentVariables=ha.enableExperimentalFragmentVariables,t.disableExperimentalFragmentVariables=ha.disableExperimentalFragmentVariables})(C||(C={}));C.default=C;function A(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 Ay(){}function rn(){return Ay}var ge=rn,m=rn,Ke=rn,Ve=rn,H=rn,cr=rn,Iy=rn,El=rn,$h=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},Mh=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Fn=class{constructor(e){this.code=e}};$h([m(),Mh("design:type",String)],Fn.prototype,"code",void 0);Fn=$h([H(),Mh("design:paramtypes",[String])],Fn);var Cl=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},kl=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},nr=class{constructor(e,r){this.address=e,this.name=r}};Cl([m(),kl("design:type",String)],nr.prototype,"address",void 0);Cl([m(),kl("design:type",String)],nr.prototype,"name",void 0);nr=Cl([H(),kl("design:paramtypes",[String,String])],nr);var Te=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},Be=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Sr=class{constructor(e,r){this.key=r,this.signature=e}};Te([m(),Be("design:type",String)],Sr.prototype,"signature",void 0);Te([m(),Be("design:type",String)],Sr.prototype,"key",void 0);Te([m(),Be("design:type",Boolean)],Sr.prototype,"valid",void 0);Te([m(),Be("design:type",Boolean)],Sr.prototype,"invalid",void 0);Sr=Te([H(),Ke(),Be("design:paramtypes",[String,String])],Sr);var $n=class{};Te([m(),Be("design:type",String)],$n.prototype,"signature",void 0);Te([m(),Be("design:type",String)],$n.prototype,"key",void 0);Te([m(),Be("design:type",Boolean)],$n.prototype,"valid",void 0);Te([m(),Be("design:type",Boolean)],$n.prototype,"invalid",void 0);$n=Te([Ke()],$n);function nn(t){let e=class{constructor(n,i,a,o){this.author=n,this.timestamp=i,this.data=a,this.proof=o}};return Te([m(),Be("design:type",String)],e.prototype,"author",void 0),Te([m(),Be("design:type",String)],e.prototype,"timestamp",void 0),Te([m(),Be("design:type",Object)],e.prototype,"data",void 0),Te([m(),Be("design:type",Sr)],e.prototype,"proof",void 0),e=Te([H(),Be("design:paramtypes",[String,String,Object,Sr])],e),e}function Oy(t){let e=class{};return Te([m(),Be("design:type",String)],e.prototype,"author",void 0),Te([m(),Be("design:type",String)],e.prototype,"timestamp",void 0),Te([m(),Be("design:type",Object)],e.prototype,"data",void 0),Te([m(),Be("design:type",$n)],e.prototype,"proof",void 0),e=Te([Ke()],e),e}var Ed=class extends nn(){};Ed=Te([H()],Ed);var ks=class extends nn(){};Te([m(),Be("design:type",nr)],ks.prototype,"language",void 0);Te([m(),Be("design:type",Fn)],ks.prototype,"icon",void 0);ks=Te([H()],ks);function N7(t){return t&&t.author&&t.timestamp&&t.data}var Fe=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},tt=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Mn=class{constructor(e){this.source=e.source?e.source:"",this.target=e.target?e.target:"",this.predicate=e.predicate?e.predicate:""}};Fe([m(),tt("design:type",String)],Mn.prototype,"source",void 0);Fe([m(),tt("design:type",String)],Mn.prototype,"target",void 0);Fe([m(),tt("design:type",String)],Mn.prototype,"predicate",void 0);Mn=Fe([H(),tt("design:paramtypes",[Object])],Mn);var Ts=class{};Fe([m(),tt("design:type",Array)],Ts.prototype,"additions",void 0);Fe([m(),tt("design:type",Array)],Ts.prototype,"removals",void 0);Ts=Fe([Ke()],Ts);var As=class{constructor(e,r){this.additions=e,this.removals=r}};Fe([m(),tt("design:type",Array)],As.prototype,"additions",void 0);Fe([m(),tt("design:type",Array)],As.prototype,"removals",void 0);As=Fe([H(),tt("design:paramtypes",[Array,Array])],As);var ja=class{};Fe([m(),tt("design:type",String)],ja.prototype,"source",void 0);Fe([m(),tt("design:type",String)],ja.prototype,"target",void 0);Fe([m(),tt("design:type",String)],ja.prototype,"predicate",void 0);ja=Fe([Ke()],ja);var Zr=class extends nn(){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}};Fe([m(),tt("design:type",String)],Zr.prototype,"status",void 0);Zr=Fe([H()],Zr);var nl=class extends Oy(){};Fe([m(),tt("design:type",String)],nl.prototype,"status",void 0);nl=Fe([Ke()],nl);function U7(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 j7(t){return t&&t.source&&t.target}var Is=class{constructor(e,r){this.oldLink=e,this.newLink=r}};Fe([m(),tt("design:type",Zr)],Is.prototype,"oldLink",void 0);Fe([m(),tt("design:type",Zr)],Is.prototype,"newLink",void 0);Is=Fe([H(),tt("design:paramtypes",[Zr,Zr])],Is);var Gn=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},Ja=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},il,or=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}};Gn([m(),Ja("design:type",Array)],or.prototype,"links",void 0);or=Gn([H(),Ja("design:paramtypes",[Array])],or);var Os=class{};Gn([m(),Ja("design:type",Array)],Os.prototype,"links",void 0);Os=Gn([Ke()],Os);var al=il=class{constructor(e){e?this.links=e:this.links=[]}static fromLink(e){let r=new il;return r.links.push(e),r}};Gn([m(),Ja("design:type",Array)],al.prototype,"links",void 0);al=il=Gn([Ke(),Ja("design:paramtypes",[Array])],al);var Un=class extends nn(){};Un=Gn([H()],Un);var U=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},j=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Qr=class{constructor(e,r){this.did=e,r?this.perspective=r:this.perspective=new or}};U([m(),j("design:type",String)],Qr.prototype,"did",void 0);U([m(),j("design:type",or)],Qr.prototype,"perspective",void 0);U([m(),j("design:type",String)],Qr.prototype,"directMessageLanguage",void 0);Qr=U([H(),j("design:paramtypes",[String,or])],Qr);var Cd=class extends nn(){};Cd=U([H()],Cd);var Yr=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}};U([m(),j("design:type",String)],Yr.prototype,"did",void 0);U([m(),j("design:type",String)],Yr.prototype,"didSigningKeyId",void 0);U([m(),j("design:type",String)],Yr.prototype,"deviceKeyType",void 0);U([m(),j("design:type",String)],Yr.prototype,"deviceKey",void 0);U([m(),j("design:type",String)],Yr.prototype,"deviceKeySignedByDid",void 0);U([m(),j("design:type",String)],Yr.prototype,"didSignedByDeviceKey",void 0);Yr=U([H(),j("design:paramtypes",[String,String,String,String,String,String])],Yr);var Jr=class{constructor(e,r,n,i,a,o){this.did=e,this.didSigningKeyId=r,this.deviceKeyType=n,this.deviceKey=i,this.deviceKeySignedByDid=a,this.didSignedByDeviceKey=o}};U([m(),j("design:type",String)],Jr.prototype,"did",void 0);U([m(),j("design:type",String)],Jr.prototype,"didSigningKeyId",void 0);U([m(),j("design:type",String)],Jr.prototype,"deviceKeyType",void 0);U([m(),j("design:type",String)],Jr.prototype,"deviceKey",void 0);U([m(),j("design:type",String)],Jr.prototype,"deviceKeySignedByDid",void 0);U([m(),j("design:type",String)],Jr.prototype,"didSignedByDeviceKey",void 0);Jr=U([Ke(),j("design:paramtypes",[String,String,String,String,String,String])],Jr);var Ds=class{constructor(e,r){this.signature=e,this.publicKey=r}};U([m(),j("design:type",String)],Ds.prototype,"signature",void 0);U([m(),j("design:type",String)],Ds.prototype,"publicKey",void 0);Ds=U([H(),j("design:paramtypes",[String,String])],Ds);var Ti=class{constructor(e,r){this.domain=e,this.pointers=r}};U([m(),j("design:type",String)],Ti.prototype,"domain",void 0);U([m(),j("design:type",Array)],Ti.prototype,"pointers",void 0);Ti=U([H(),j("design:paramtypes",[String,Array])],Ti);var Ns=class{constructor(e,r){this.with=e,this.can=r}};U([m(),j("design:type",Ti)],Ns.prototype,"with",void 0);U([m(),j("design:type",Array)],Ns.prototype,"can",void 0);Ns=U([H(),j("design:paramtypes",[Ti,Array])],Ns);var xr=class{constructor(e,r,n,i,a){this.appName=e,this.appDesc=r,this.appIconPath=a,this.appUrl=n,this.capabilities=i}};U([m(),j("design:type",String)],xr.prototype,"appName",void 0);U([m(),j("design:type",String)],xr.prototype,"appDesc",void 0);U([m(),j("design:type",String)],xr.prototype,"appUrl",void 0);U([m(),j("design:type",String)],xr.prototype,"appIconPath",void 0);U([m(),j("design:type",Array)],xr.prototype,"capabilities",void 0);xr=U([H(),j("design:paramtypes",[String,String,String,Array,String])],xr);var Ai=class{constructor(e,r,n,i){this.requestId=e,this.auth=r,this.token=n,this.revoked=i}};U([m(),j("design:type",String)],Ai.prototype,"requestId",void 0);U([m(),j("design:type",String)],Ai.prototype,"token",void 0);U([m(),j("design:type",Boolean)],Ai.prototype,"revoked",void 0);U([m(),j("design:type",xr)],Ai.prototype,"auth",void 0);Ai=U([H(),j("design:paramtypes",[String,xr,String,Boolean])],Ai);var Ii=class{constructor(e,r){this.domain=e,this.pointers=r}};U([m(),j("design:type",String)],Ii.prototype,"domain",void 0);U([m(),j("design:type",Array)],Ii.prototype,"pointers",void 0);Ii=U([Ke(),j("design:paramtypes",[String,Array])],Ii);var Rs=class{constructor(e,r){this.with=e,this.can=r}};U([m(),j("design:type",Ii)],Rs.prototype,"with",void 0);U([m(),j("design:type",Array)],Rs.prototype,"can",void 0);Rs=U([Ke(),j("design:paramtypes",[Ii,Array])],Rs);var Xr=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}};U([m(),j("design:type",String)],Xr.prototype,"appName",void 0);U([m(),j("design:type",String)],Xr.prototype,"appDesc",void 0);U([m(),j("design:type",String)],Xr.prototype,"appDomain",void 0);U([m(),j("design:type",String)],Xr.prototype,"appUrl",void 0);U([m(),j("design:type",String)],Xr.prototype,"appIconPath",void 0);U([m(),j("design:type",Array)],Xr.prototype,"capabilities",void 0);Xr=U([Ke(),j("design:paramtypes",[String,String,String,String,String,Array])],Xr);var Li=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},Fi=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Rt=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)}};Li([m(),Fi("design:type",Boolean)],Rt.prototype,"isInitialized",void 0);Li([m(),Fi("design:type",Boolean)],Rt.prototype,"isUnlocked",void 0);Li([m(),Fi("design:type",String)],Rt.prototype,"did",void 0);Li([m(),Fi("design:type",String)],Rt.prototype,"didDocument",void 0);Li([m(),Fi("design:type",String)],Rt.prototype,"error",void 0);Rt=Li([H(),Fi("design:paramtypes",[Object])],Rt);var kd=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Re=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},ht,mt,ol=class{constructor(e,r){ht.set(this,void 0),mt.set(this,void 0),kd(this,ht,e,"f"),kd(this,mt,r,"f")}async otherAgents(){return await Re(this,ht,"f").otherAgents(Re(this,mt,"f"))}async hasTelepresenceAdapter(){return await Re(this,ht,"f").hasTelepresenceAdapter(Re(this,mt,"f"))}async onlineAgents(){return await Re(this,ht,"f").onlineAgents(Re(this,mt,"f"))}async setOnlineStatus(e){return await Re(this,ht,"f").setOnlineStatus(Re(this,mt,"f"),e)}async setOnlineStatusU(e){return await Re(this,ht,"f").setOnlineStatusU(Re(this,mt,"f"),e)}async sendSignal(e,r){return await Re(this,ht,"f").sendSignal(Re(this,mt,"f"),e,r)}async sendSignalU(e,r){return await Re(this,ht,"f").sendSignalU(Re(this,mt,"f"),e,r)}async sendBroadcast(e,r=!1){return await Re(this,ht,"f").sendBroadcast(Re(this,mt,"f"),e,r)}async sendBroadcastU(e,r=!1){return await Re(this,ht,"f").sendBroadcastU(Re(this,mt,"f"),e,r)}async addSignalHandler(e){await Re(this,ht,"f").addSignalHandler(Re(this,mt,"f"),e)}removeSignalHandler(e){Re(this,ht,"f").removeSignalHandler(Re(this,mt,"f"),e)}};ht=new WeakMap,mt=new WeakMap;var Hn=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},Kn=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Ct=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)}};Hn([m(),Kn("design:type",String)],Ct.prototype,"source",void 0);Hn([m(),Kn("design:type",String)],Ct.prototype,"target",void 0);Hn([m(),Kn("design:type",String)],Ct.prototype,"predicate",void 0);Hn([m(),Kn("design:type",Date)],Ct.prototype,"fromDate",void 0);Hn([m(),Kn("design:type",Date)],Ct.prototype,"untilDate",void 0);Hn([m(),Kn("design:type",Number)],Ct.prototype,"limit",void 0);Ct=Hn([H(),Ke(),Kn("design:paramtypes",[Object])],Ct);var Td=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},dt=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)},qt,yr;function Fu(t){return encodeURIComponent(t).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`)}var Qt=class{constructor(){qt.set(this,void 0),yr.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 Qt;return Td(r,yr,e,"f"),r}static from(e){let r=new Qt;return Td(r,qt,e,"f"),r}toUrl(){if(dt(this,yr,"f")&&!dt(this,qt,"f"))return dt(this,yr,"f");if(!dt(this,yr,"f")&&!dt(this,qt,"f"))throw new Error("Can't turn empty Literal into URL");let e;switch(typeof dt(this,qt,"f")){case"string":e=`string:${Fu(dt(this,qt,"f"))}`;break;case"number":e=`number:${Fu(dt(this,qt,"f"))}`;break;case"object":e=`json:${Fu(JSON.stringify(dt(this,qt,"f")))}`;break}return`literal://${e}`}get(){if(dt(this,qt,"f"))return dt(this,qt,"f");if(!dt(this,yr,"f"))throw new Error("Can't render empty Literal");if(!dt(this,yr,"f").startsWith("literal://"))throw new Error("Can't render Literal from non-literal URL");let e=dt(this,yr,"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}`)}};qt=new WeakMap,yr=new WeakMap;function Gr(t){return t.charAt(0).toUpperCase()+t.slice(1)}function Uh(t){return`set${Gr(t)}`}function wr(t){return t.endsWith("y")?t.slice(0,-1)+"ies":t+"s"}function Tl(t){return t.endsWith("ies")?t.slice(0,-3)+"y":t.endsWith("s")?t.slice(0,-1):t}function Dy(t){return`add${Gr(Tl(t))}`}function Ny(t){let e=t.substring(3),r=wr(e);return r.charAt(0).toLowerCase()+r.slice(1)}function Ry(t){return`remove${Gr(Tl(t))}`}function Py(t){let e=t.substring(6),r=wr(e);return r.charAt(0).toLowerCase()+r.slice(1)}function Ly(t){let e=t.substring(13),r=wr(e);return r.charAt(0).toLowerCase()+r.slice(1)}function Fy(t){return`setCollection${Gr(Tl(t))}`}function En(t){if(Array.isArray(t))return`[${t.map(En).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 $u=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)},at,ot,Ie,Ps=class{constructor(t,e,r){at.set(this,void 0),ot.set(this,void 0),Ie.set(this,void 0),$u(this,at,e,"f"),$u(this,ot,r,"f"),$u(this,Ie,t,"f")}get baseExpression(){return G(this,at,"f")}async init(){let isInstance=await G(this,Ie,"f").isSubjectInstance(G(this,at,"f"),G(this,ot,"f"));if(!isInstance)throw`Not a valid subject instance of ${G(this,ot,"f")} for ${G(this,at,"f")}`;let results=await G(this,Ie,"f").infer(`subject_class("${G(this,ot,"f")}", C), property(C, Property)`),properties=results.map(t=>t.Property);for(let t of properties){let e=await G(this,Ie,"f").infer(`subject_class("${G(this,ot,"f")}", C), property_resolve(C, "${t}")`);Object.defineProperty(this,t,{configurable:!0,get:async()=>{let r=await G(this,Ie,"f").infer(`subject_class("${G(this,ot,"f")}", C), property_getter(C, "${G(this,at,"f")}", "${t}", Value)`);if(r&&r.length>0){let n=r[0].Value;if(e)try{if(n){let i=await G(this,Ie,"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 G(this,Ie,"f").infer(`subject_class("${G(this,ot,"f")}", C), property_setter(C, Property, Setter)`);for(let setter of setters||[])if(setter){let property=setter.Property,actions=eval(setter.Setter),resolveLanguageResults=await G(this,Ie,"f").infer(`subject_class("${G(this,ot,"f")}", C), property_resolve_language(C, "${property}", Language)`),resolveLanguage;resolveLanguageResults&&resolveLanguageResults.length>0&&(resolveLanguage=resolveLanguageResults[0].Language),this[Uh(property)]=async t=>{resolveLanguage&&(t=await G(this,Ie,"f").createExpression(t,resolveLanguage)),await G(this,Ie,"f").executeAction(actions,G(this,at,"f"),[{name:"value",value:t}])}}let results2=await G(this,Ie,"f").infer(`subject_class("${G(this,ot,"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 G(this,Ie,"f").infer(`subject_class("${G(this,ot,"f")}", C), collection_getter(C, "${G(this,at,"f")}", "${t}", Value)`);return e&&e.length>0&&e[0].Value?e[0].Value.filter(n=>n!==""&&n!==""):[]}});let adders=await G(this,Ie,"f").infer(`subject_class("${G(this,ot,"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[Dy(collection)]=async t=>{Array.isArray(t)?await Promise.all(t.map(e=>G(this,Ie,"f").executeAction(actions,G(this,at,"f"),[{name:"value",value:e}]))):await G(this,Ie,"f").executeAction(actions,G(this,at,"f"),[{name:"value",value:t}])}}let removers=await G(this,Ie,"f").infer(`subject_class("${G(this,ot,"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[Ry(collection)]=async t=>{Array.isArray(t)?await Promise.all(t.map(e=>G(this,Ie,"f").executeAction(actions,G(this,at,"f"),[{name:"value",value:e}]))):await G(this,Ie,"f").executeAction(actions,G(this,at,"f"),[{name:"value",value:t}])}}let collectionSetters=await G(this,Ie,"f").infer(`subject_class("${G(this,ot,"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[Fy(collection)]=async t=>{Array.isArray(t)?await G(this,Ie,"f").executeAction(actions,G(this,at,"f"),t.map(e=>({name:"value",value:e}))):await G(this,Ie,"f").executeAction(actions,G(this,at,"f"),[{name:"value",value:t}])}}}};at=new WeakMap,ot=new WeakMap,Ie=new WeakMap;var vi=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},M=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)},de,_e,Cn,kn,Tn,va,Ci=class{constructor(t,e){de.set(this,void 0),_e.set(this,void 0),Cn.set(this,void 0),kn.set(this,void 0),Tn.set(this,void 0),va.set(this,void 0),vi(this,Cn,[],"f"),vi(this,kn,[],"f"),vi(this,Tn,[],"f"),vi(this,va,[],"f"),vi(this,de,t,"f"),vi(this,_e,e,"f"),this.uuid=M(this,de,"f").uuid,this.name=M(this,de,"f").name,this.sharedUrl=M(this,de,"f").sharedUrl,this.neighbourhood=M(this,de,"f").neighbourhood,this.state=M(this,de,"f").state,M(this,_e,"f").addPerspectiveLinkAddedListener(M(this,de,"f").uuid,M(this,Cn,"f")),M(this,_e,"f").addPerspectiveLinkRemovedListener(M(this,de,"f").uuid,M(this,kn,"f")),M(this,_e,"f").addPerspectiveLinkUpdatedListener(M(this,de,"f").uuid,M(this,Tn,"f")),M(this,_e,"f").addPerspectiveSyncStateChangeListener(M(this,de,"f").uuid,M(this,va,"f"))}async executeAction(t,e,r){return await M(this,_e,"f").executeCommands(M(this,de,"f").uuid,JSON.stringify(t),e,JSON.stringify(r))}async get(t){return await M(this,_e,"f").queryLinks(M(this,de,"f").uuid,t)}async infer(t){return await M(this,_e,"f").queryProlog(M(this,de,"f").uuid,t)}async add(t,e="shared"){return await M(this,_e,"f").addLink(M(this,de,"f").uuid,t,e)}async addLinks(t,e="shared"){return await M(this,_e,"f").addLinks(M(this,de,"f").uuid,t,e)}async removeLinks(t){return await M(this,_e,"f").removeLinks(M(this,de,"f").uuid,t)}async linkMutations(t,e="shared"){return await M(this,_e,"f").linkMutations(M(this,de,"f").uuid,t,e)}async addLinkExpression(t,e="shared"){return await M(this,_e,"f").addLinkExpression(M(this,de,"f").uuid,t,e)}async update(t,e){return await M(this,_e,"f").updateLink(M(this,de,"f").uuid,t,e)}async remove(t){return await M(this,_e,"f").removeLink(M(this,de,"f").uuid,t)}async getExpression(t){return await M(this,_e,"f").getExpression(t)}async createExpression(t,e){return await M(this,_e,"f").createExpression(t,e)}async addListener(t,e){t==="link-added"?M(this,Cn,"f").push(e):t==="link-removed"?M(this,kn,"f").push(e):t==="link-updated"&&M(this,Tn,"f").push(e)}async addSyncStateChangeListener(t){M(this,va,"f").push(t)}async removeListener(t,e){if(t==="link-added"){let r=M(this,Cn,"f").indexOf(e);M(this,Cn,"f").splice(r,1)}else if(t==="link-removed"){let r=M(this,kn,"f").indexOf(e);M(this,kn,"f").splice(r,1)}else if(t==="link-updated"){let r=M(this,Tn,"f").indexOf(e);M(this,Tn,"f").splice(r,1)}}async snapshot(){return M(this,_e,"f").snapshotByUUID(M(this,de,"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 Ct({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 Ct({predicate:"ad4m://sdna"}))).map(e=>e.data.target).map(e=>Qt.fromUrl(e).get())}async addSdna(t,e,r){return M(this,_e,"f").addSdna(M(this,de,"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 M(this,_e,"f").createSubject(M(this,de,"f").uuid,JSON.stringify({className:r}),e);else{let n=this.buildQueryFromTemplate(t);await M(this,_e,"f").createSubject(M(this,de,"f").uuid,JSON.stringify({query:n}),e)}return this.getSubjectProxy(e,t)}async getSubjectData(t,e){if(typeof t=="string")return JSON.parse(await M(this,_e,"f").getSubjectData(M(this,de,"f").uuid,JSON.stringify({className:t}),e));let r=this.buildQueryFromTemplate(t);return JSON.parse(await M(this,_e,"f").getSubjectData(M(this,de,"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 Ps(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, "${Ny(l)}", _)`;for(let l of s)c+=`, collection_remover(C, "${Py(l)}", _)`;for(let l of u)c+=`, collection_setter(C, "${Ly(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 M(this,_e,"f").getNeighbourhoodProxy(M(this,de,"f").uuid)}get ai(){return M(this,_e,"f").aiClient}};de=new WeakMap,_e=new WeakMap,Cn=new WeakMap,kn=new WeakMap,Tn=new WeakMap,va=new WeakMap;var Ur=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},W=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},le,ba,_a,wa,ms,Sa,gs,ys,wt=`
|
|
64
64
|
author
|
|
65
65
|
timestamp
|
|
66
66
|
status
|
|
67
67
|
data { source, predicate, target }
|
|
68
68
|
proof { valid, invalid, signature, key }
|
|
69
|
-
`,
|
|
69
|
+
`,bi=`
|
|
70
70
|
uuid
|
|
71
71
|
name
|
|
72
72
|
sharedUrl
|
|
@@ -86,62 +86,62 @@ neighbourhood {
|
|
|
86
86
|
}
|
|
87
87
|
author
|
|
88
88
|
}
|
|
89
|
-
`,
|
|
89
|
+
`,Ls=class{constructor(e,r=!0){le.set(this,void 0),ba.set(this,void 0),_a.set(this,void 0),wa.set(this,void 0),ms.set(this,void 0),Sa.set(this,void 0),gs.set(this,void 0),ys.set(this,void 0),Ur(this,le,e,"f"),Ur(this,ba,[],"f"),Ur(this,_a,[],"f"),Ur(this,wa,[],"f"),Ur(this,ms,[],"f"),r&&(this.subscribePerspectiveAdded(),this.subscribePerspectiveUpdated(),this.subscribePerspectiveRemoved())}setExpressionClient(e){Ur(this,Sa,e,"f")}setNeighbourhoodClient(e){Ur(this,gs,e,"f")}setAIClient(e){Ur(this,ys,e,"f")}get aiClient(){return W(this,ys,"f")}async all(){let{perspectives:e}=A(await W(this,le,"f").query({query:C`query perspectives {
|
|
90
90
|
perspectives {
|
|
91
|
-
${
|
|
91
|
+
${bi}
|
|
92
92
|
}
|
|
93
|
-
}`}));return e.map(r=>new
|
|
93
|
+
}`}));return e.map(r=>new Ci(r,this))}async byUUID(e){let{perspective:r}=A(await W(this,le,"f").query({query:C`query perspective($uuid: String!) {
|
|
94
94
|
perspective(uuid: $uuid) {
|
|
95
|
-
${
|
|
95
|
+
${bi}
|
|
96
96
|
}
|
|
97
|
-
}`,variables:{uuid:e}}));return r?new
|
|
97
|
+
}`,variables:{uuid:e}}));return r?new Ci(r,this):null}async snapshotByUUID(e){let{perspectiveSnapshot:r}=A(await W(this,le,"f").query({query:C`query perspectiveSnapshot($uuid: String!) {
|
|
98
98
|
perspectiveSnapshot(uuid: $uuid) {
|
|
99
|
-
links { ${
|
|
99
|
+
links { ${wt} }
|
|
100
100
|
}
|
|
101
|
-
}`,variables:{uuid:e}}));return r}async publishSnapshotByUUID(e){let{perspectivePublishSnapshot:r}=
|
|
101
|
+
}`,variables:{uuid:e}}));return r}async publishSnapshotByUUID(e){let{perspectivePublishSnapshot:r}=A(await W(this,le,"f").mutate({mutation:C`mutation perspectivePublishSnapshot($uuid: String!) {
|
|
102
102
|
perspectivePublishSnapshot(uuid: $uuid)
|
|
103
|
-
}`,variables:{uuid:e}}));return r}async queryLinks(e,r){let{perspectiveQueryLinks:n}=
|
|
103
|
+
}`,variables:{uuid:e}}));return r}async queryLinks(e,r){let{perspectiveQueryLinks:n}=A(await W(this,le,"f").query({query:C`query perspectiveQueryLinks($uuid: String!, $query: LinkQuery!) {
|
|
104
104
|
perspectiveQueryLinks(query: $query, uuid: $uuid) {
|
|
105
|
-
${
|
|
105
|
+
${wt}
|
|
106
106
|
}
|
|
107
|
-
}`,variables:{uuid:e,query:r}}));return n}async queryProlog(e,r){let{perspectiveQueryProlog:n}=
|
|
107
|
+
}`,variables:{uuid:e,query:r}}));return n}async queryProlog(e,r){let{perspectiveQueryProlog:n}=A(await W(this,le,"f").query({query:C`query perspectiveQueryProlog($uuid: String!, $query: String!) {
|
|
108
108
|
perspectiveQueryProlog(uuid: $uuid, query: $query)
|
|
109
|
-
}`,variables:{uuid:e,query:r}}));return JSON.parse(n)}async add(e){let{perspectiveAdd:r}=
|
|
109
|
+
}`,variables:{uuid:e,query:r}}));return JSON.parse(n)}async add(e){let{perspectiveAdd:r}=A(await W(this,le,"f").mutate({mutation:C`mutation perspectiveAdd($name: String!) {
|
|
110
110
|
perspectiveAdd(name: $name) {
|
|
111
|
-
${
|
|
111
|
+
${bi}
|
|
112
112
|
}
|
|
113
|
-
}`,variables:{name:e}}));return new
|
|
113
|
+
}`,variables:{name:e}}));return new Ci(r,this)}async update(e,r){let{perspectiveUpdate:n}=A(await W(this,le,"f").mutate({mutation:C`mutation perspectiveUpdate($uuid: String!, $name: String!) {
|
|
114
114
|
perspectiveUpdate(uuid: $uuid, name: $name) {
|
|
115
|
-
${
|
|
115
|
+
${bi}
|
|
116
116
|
}
|
|
117
|
-
}`,variables:{uuid:e,name:r}}));return new
|
|
117
|
+
}`,variables:{uuid:e,name:r}}));return new Ci(n,this)}async remove(e){return A(await W(this,le,"f").mutate({mutation:C`mutation perspectiveRemove($uuid: String!) {
|
|
118
118
|
perspectiveRemove(uuid: $uuid)
|
|
119
|
-
}`,variables:{uuid:e}}))}async addLink(e,r,n){let{perspectiveAddLink:i}=
|
|
119
|
+
}`,variables:{uuid:e}}))}async addLink(e,r,n){let{perspectiveAddLink:i}=A(await W(this,le,"f").mutate({mutation:C`mutation perspectiveAddLink($uuid: String!, $link: LinkInput!, $status: String){
|
|
120
120
|
perspectiveAddLink(link: $link, uuid: $uuid, status: $status) {
|
|
121
|
-
${
|
|
121
|
+
${wt}
|
|
122
122
|
}
|
|
123
|
-
}`,variables:{uuid:e,link:r,status:n}}));return i}async addLinks(e,r,n){let{perspectiveAddLinks:i}=
|
|
123
|
+
}`,variables:{uuid:e,link:r,status:n}}));return i}async addLinks(e,r,n){let{perspectiveAddLinks:i}=A(await W(this,le,"f").mutate({mutation:C`mutation perspectiveAddLinks($uuid: String!, $links: [LinkInput!]!, $status: String){
|
|
124
124
|
perspectiveAddLinks(links: $links, uuid: $uuid, status: $status) {
|
|
125
|
-
${
|
|
125
|
+
${wt}
|
|
126
126
|
}
|
|
127
|
-
}`,variables:{uuid:e,links:r,status:n}}));return i}async removeLinks(e,r){let{perspectiveRemoveLinks:n}=
|
|
127
|
+
}`,variables:{uuid:e,links:r,status:n}}));return i}async removeLinks(e,r){let{perspectiveRemoveLinks:n}=A(await W(this,le,"f").mutate({mutation:C`mutation perspectiveRemoveLinks($uuid: String!, $links: [LinkExpressionInput!]!){
|
|
128
128
|
perspectiveRemoveLinks(links: $links, uuid: $uuid) {
|
|
129
|
-
${
|
|
129
|
+
${wt}
|
|
130
130
|
}
|
|
131
|
-
}`,variables:{uuid:e,links:r}}));return n}async linkMutations(e,r,n){let{perspectiveLinkMutations:i}=
|
|
131
|
+
}`,variables:{uuid:e,links:r}}));return n}async linkMutations(e,r,n){let{perspectiveLinkMutations:i}=A(await W(this,le,"f").mutate({mutation:C`mutation perspectiveLinkMutations($uuid: String!, $mutations: LinkMutations!, $status: String){
|
|
132
132
|
perspectiveLinkMutations(mutations: $mutations, uuid: $uuid, status: $status) {
|
|
133
133
|
additions {
|
|
134
|
-
${
|
|
134
|
+
${wt}
|
|
135
135
|
}
|
|
136
136
|
removals {
|
|
137
|
-
${
|
|
137
|
+
${wt}
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
|
-
}`,variables:{uuid:e,mutations:r,status:n}}));return i}async addLinkExpression(e,r,n){let{perspectiveAddLinkExpression:i}=
|
|
140
|
+
}`,variables:{uuid:e,mutations:r,status:n}}));return i}async addLinkExpression(e,r,n){let{perspectiveAddLinkExpression:i}=A(await W(this,le,"f").mutate({mutation:C`mutation perspectiveAddLinkExpression($uuid: String!, $link: LinkExpressionInput!, $status: String){
|
|
141
141
|
perspectiveAddLinkExpression(link: $link, uuid: $uuid, status: $status) {
|
|
142
|
-
${
|
|
142
|
+
${wt}
|
|
143
143
|
}
|
|
144
|
-
}`,variables:{uuid:e,link:r}}));return i}async updateLink(e,r,n){delete r.__typename,delete r.data.__typename,delete r.proof.__typename;let{perspectiveUpdateLink:i}=
|
|
144
|
+
}`,variables:{uuid:e,link:r}}));return i}async updateLink(e,r,n){delete r.__typename,delete r.data.__typename,delete r.proof.__typename;let{perspectiveUpdateLink:i}=A(await W(this,le,"f").mutate({mutation:C`mutation perspectiveUpdateLink(
|
|
145
145
|
$uuid: String!,
|
|
146
146
|
$newLink: LinkInput!
|
|
147
147
|
$oldLink: LinkExpressionInput!
|
|
@@ -151,47 +151,47 @@ neighbourhood {
|
|
|
151
151
|
oldLink: $oldLink,
|
|
152
152
|
uuid: $uuid
|
|
153
153
|
) {
|
|
154
|
-
${
|
|
154
|
+
${wt}
|
|
155
155
|
}
|
|
156
|
-
}`,variables:{uuid:e,oldLink:r,newLink:n}}));return i.status||delete i.status,i}async removeLink(e,r){return delete r.__typename,delete r.data.__typename,delete r.proof.__typename,delete r.status,
|
|
156
|
+
}`,variables:{uuid:e,oldLink:r,newLink:n}}));return i.status||delete i.status,i}async removeLink(e,r){return delete r.__typename,delete r.data.__typename,delete r.proof.__typename,delete r.status,A(await W(this,le,"f").mutate({mutation:C`mutation perspectiveRemoveLink($link: LinkExpressionInput!, $uuid: String!) {
|
|
157
157
|
perspectiveRemoveLink(link: $link, uuid: $uuid)
|
|
158
|
-
}`,variables:{uuid:e,link:r}}))}async addSdna(e,r,n,i){return
|
|
158
|
+
}`,variables:{uuid:e,link:r}}))}async addSdna(e,r,n,i){return A(await W(this,le,"f").mutate({mutation:C`mutation perspectiveAddSdna($uuid: String!, $name: String!, $sdnaCode: String!, $sdnaType: String!) {
|
|
159
159
|
perspectiveAddSdna(uuid: $uuid, name: $name, sdnaCode: $sdnaCode, sdnaType: $sdnaType)
|
|
160
|
-
}`,variables:{uuid:e,name:r,sdnaCode:n,sdnaType:i}})).perspectiveAddSdna}async executeCommands(e,r,n,i){return
|
|
160
|
+
}`,variables:{uuid:e,name:r,sdnaCode:n,sdnaType:i}})).perspectiveAddSdna}async executeCommands(e,r,n,i){return A(await W(this,le,"f").mutate({mutation:C`mutation perspectiveExecuteCommands($uuid: String!, $commands: String!, $expression: String!, $parameters: String) {
|
|
161
161
|
perspectiveExecuteCommands(uuid: $uuid, commands: $commands, expression: $expression, parameters: $parameters)
|
|
162
|
-
}`,variables:{uuid:e,commands:r,expression:n,parameters:i}})).perspectiveExecuteCommands}async createSubject(e,r,n){return
|
|
162
|
+
}`,variables:{uuid:e,commands:r,expression:n,parameters:i}})).perspectiveExecuteCommands}async createSubject(e,r,n){return A(await W(this,le,"f").mutate({mutation:C`mutation perspectiveCreateSubject($uuid: String!, $subjectClass: String!, $expressionAddress: String!) {
|
|
163
163
|
perspectiveCreateSubject(uuid: $uuid, subjectClass: $subjectClass, expressionAddress: $expressionAddress)
|
|
164
|
-
}`,variables:{uuid:e,subjectClass:r,expressionAddress:n}})).perspectiveCreateSubject}async getSubjectData(e,r,n){return
|
|
164
|
+
}`,variables:{uuid:e,subjectClass:r,expressionAddress:n}})).perspectiveCreateSubject}async getSubjectData(e,r,n){return A(await W(this,le,"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
|
|
167
|
-
perspectiveAdded { ${
|
|
166
|
+
}`,variables:{uuid:e,subjectClass:r,expressionAddress:n}})).perspectiveGetSubjectData}async getExpression(e){return await W(this,Sa,"f").get(e)}async createExpression(e,r){return await W(this,Sa,"f").create(e,r)}addPerspectiveAddedListener(e){W(this,ba,"f").push(e)}subscribePerspectiveAdded(){W(this,le,"f").subscribe({query:C` subscription {
|
|
167
|
+
perspectiveAdded { ${bi} }
|
|
168
168
|
}
|
|
169
|
-
`}).subscribe({next:e=>{
|
|
170
|
-
perspectiveUpdated { ${
|
|
169
|
+
`}).subscribe({next:e=>{W(this,ba,"f").forEach(r=>{r(e.data.perspectiveAdded)})},error:e=>console.error(e)})}addPerspectiveUpdatedListener(e){W(this,_a,"f").push(e)}subscribePerspectiveUpdated(){W(this,le,"f").subscribe({query:C` subscription {
|
|
170
|
+
perspectiveUpdated { ${bi} }
|
|
171
171
|
}
|
|
172
|
-
`}).subscribe({next:e=>{
|
|
172
|
+
`}).subscribe({next:e=>{W(this,_a,"f").forEach(r=>{r(e.data.perspectiveUpdated)})},error:e=>console.error(e)})}addPerspectiveSyncedListener(e){W(this,ms,"f").push(e)}async addPerspectiveSyncStateChangeListener(e,r){W(this,le,"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){
|
|
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){W(this,wa,"f").push(e)}subscribePerspectiveRemoved(){W(this,le,"f").subscribe({query:C` subscription {
|
|
176
176
|
perspectiveRemoved
|
|
177
177
|
}
|
|
178
|
-
`}).subscribe({next:e=>{
|
|
179
|
-
perspectiveLinkAdded(uuid: "${e}") { ${
|
|
178
|
+
`}).subscribe({next:e=>{W(this,wa,"f").forEach(r=>{r(e.data.perspectiveRemoved)})},error:e=>console.error(e)})}async addPerspectiveLinkAddedListener(e,r){W(this,le,"f").subscribe({query:C` subscription {
|
|
179
|
+
perspectiveLinkAdded(uuid: "${e}") { ${wt} }
|
|
180
180
|
}
|
|
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){
|
|
182
|
-
perspectiveLinkRemoved(uuid: "${e}") { ${
|
|
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){W(this,le,"f").subscribe({query:C` subscription {
|
|
182
|
+
perspectiveLinkRemoved(uuid: "${e}") { ${wt} }
|
|
183
183
|
}
|
|
184
|
-
`}).subscribe({next:n=>{r.forEach(i=>{n.data.perspectiveLinkRemoved.status||delete n.data.perspectiveLinkRemoved.status,i(n.data.perspectiveLinkRemoved)})},error:n=>console.error(n)}),await new Promise(n=>setTimeout(n,500))}async addPerspectiveLinkUpdatedListener(e,r){
|
|
184
|
+
`}).subscribe({next:n=>{r.forEach(i=>{n.data.perspectiveLinkRemoved.status||delete n.data.perspectiveLinkRemoved.status,i(n.data.perspectiveLinkRemoved)})},error:n=>console.error(n)}),await new Promise(n=>setTimeout(n,500))}async addPerspectiveLinkUpdatedListener(e,r){W(this,le,"f").subscribe({query:C` subscription {
|
|
185
185
|
perspectiveLinkUpdated(uuid: "${e}") {
|
|
186
186
|
oldLink {
|
|
187
|
-
${
|
|
187
|
+
${wt}
|
|
188
188
|
}
|
|
189
189
|
newLink {
|
|
190
|
-
${
|
|
190
|
+
${wt}
|
|
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 ol(W(this,gs,"f"),e)}};le=new WeakMap,ba=new WeakMap,_a=new WeakMap,wa=new WeakMap,ms=new WeakMap,Sa=new WeakMap,gs=new WeakMap,ys=new WeakMap;var Jo=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},se=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)},he,xa,Ea,Ca,ma=`
|
|
195
195
|
did
|
|
196
196
|
directMessageLanguage
|
|
197
197
|
perspective {
|
|
@@ -205,7 +205,7 @@ neighbourhood {
|
|
|
205
205
|
}
|
|
206
206
|
}
|
|
207
207
|
}
|
|
208
|
-
`,
|
|
208
|
+
`,Xo=`
|
|
209
209
|
requestId
|
|
210
210
|
revoked
|
|
211
211
|
auth {
|
|
@@ -221,128 +221,128 @@ neighbourhood {
|
|
|
221
221
|
can
|
|
222
222
|
}
|
|
223
223
|
}
|
|
224
|
-
`,
|
|
224
|
+
`,_i=`
|
|
225
225
|
isInitialized
|
|
226
226
|
isUnlocked
|
|
227
227
|
did
|
|
228
228
|
didDocument
|
|
229
229
|
error
|
|
230
|
-
|
|
230
|
+
`,es=`
|
|
231
231
|
did
|
|
232
232
|
didSigningKeyId
|
|
233
233
|
deviceKeyType
|
|
234
234
|
deviceKey
|
|
235
235
|
deviceKeySignedByDid
|
|
236
236
|
didSignedByDeviceKey
|
|
237
|
-
|
|
237
|
+
`,$y=`
|
|
238
238
|
signature
|
|
239
239
|
publicKey
|
|
240
|
-
`,
|
|
240
|
+
`,Ba=class{constructor(e,r=!0){he.set(this,void 0),xa.set(this,void 0),Ea.set(this,void 0),Ca.set(this,void 0),Jo(this,he,e,"f"),Jo(this,Ea,[],"f"),Jo(this,Ca,[],"f"),Jo(this,xa,[],"f"),r&&(this.subscribeAgentUpdated(),this.subscribeAgentStatusChanged(),this.subscribeAppsChanged())}async me(){let{agent:e}=A(await se(this,he,"f").query({query:C`query agent { agent { ${ma} } }`})),r=new Qr(e.did,e.perspective);return r.directMessageLanguage=e.directMessageLanguage,r}async status(){let{agentStatus:e}=A(await se(this,he,"f").query({query:C`query agentStatus {
|
|
241
241
|
agentStatus {
|
|
242
|
-
${
|
|
242
|
+
${_i}
|
|
243
243
|
}
|
|
244
|
-
}`}));return new
|
|
244
|
+
}`}));return new Rt(e)}async generate(e){let{agentGenerate:r}=A(await se(this,he,"f").mutate({mutation:C`mutation agentGenerate(
|
|
245
245
|
$passphrase: String!
|
|
246
246
|
) {
|
|
247
247
|
agentGenerate(passphrase: $passphrase) {
|
|
248
|
-
${
|
|
248
|
+
${_i}
|
|
249
249
|
}
|
|
250
|
-
}`,variables:{passphrase:e}}));return new
|
|
250
|
+
}`,variables:{passphrase:e}}));return new Rt(r)}async import(e){let{did:r,didDocument:n,keystore:i,passphrase:a}=e,{agentImport:o}=A(await se(this,he,"f").mutate({mutation:C`mutation agentImport(
|
|
251
251
|
$did: String!,
|
|
252
252
|
$didDocument: String!,
|
|
253
253
|
$keystore: String!,
|
|
254
254
|
$passphrase: String!
|
|
255
255
|
) {
|
|
256
256
|
agentImport(did: $did, didDocument: $didDocument, keystore: $keystore, passphrase: $passphrase) {
|
|
257
|
-
${
|
|
257
|
+
${_i}
|
|
258
258
|
}
|
|
259
|
-
}`,variables:{did:r,didDocument:n,keystore:i,passphrase:a}}));return new
|
|
259
|
+
}`,variables:{did:r,didDocument:n,keystore:i,passphrase:a}}));return new Rt(o)}async lock(e){let{agentLock:r}=A(await se(this,he,"f").mutate({mutation:C`mutation agentLock($passphrase: String!) {
|
|
260
260
|
agentLock(passphrase: $passphrase) {
|
|
261
|
-
${
|
|
261
|
+
${_i}
|
|
262
262
|
}
|
|
263
|
-
}`,variables:{passphrase:e}}));return new
|
|
263
|
+
}`,variables:{passphrase:e}}));return new Rt(r)}async unlock(e,r=!0){let{agentUnlock:n}=A(await se(this,he,"f").mutate({mutation:C`mutation agentUnlock($passphrase: String!, $holochain: Boolean!) {
|
|
264
264
|
agentUnlock(passphrase: $passphrase, holochain: $holochain) {
|
|
265
|
-
${
|
|
265
|
+
${_i}
|
|
266
266
|
}
|
|
267
|
-
}`,variables:{passphrase:e,holochain:r}}));return new
|
|
267
|
+
}`,variables:{passphrase:e,holochain:r}}));return new Rt(n)}async byDID(e){let{agentByDID:r}=A(await se(this,he,"f").query({query:C`query agentByDID($did: String!) {
|
|
268
268
|
agentByDID(did: $did) {
|
|
269
|
-
${
|
|
269
|
+
${ma}
|
|
270
270
|
}
|
|
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}=
|
|
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}=A(await se(this,he,"f").mutate({mutation:C`mutation agentUpdatePublicPerspective($perspective: PerspectiveInput!) {
|
|
272
272
|
agentUpdatePublicPerspective(perspective: $perspective) {
|
|
273
|
-
${
|
|
273
|
+
${ma}
|
|
274
274
|
}
|
|
275
|
-
}`,variables:{perspective:r}})),i=n,a=new
|
|
275
|
+
}`,variables:{perspective:r}})),i=n,a=new Qr(i.did,i.perspective);return a.directMessageLanguage=i.directMessageLanguage,a}async mutatePublicPerspective(e){let r=new Ls(se(this,he,"f")),n=new Ba(se(this,he,"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}=A(await se(this,he,"f").mutate({mutation:C`mutation agentUpdateDirectMessageLanguage($directMessageLanguage: String!) {
|
|
276
276
|
agentUpdateDirectMessageLanguage(directMessageLanguage: $directMessageLanguage) {
|
|
277
|
-
${
|
|
277
|
+
${ma}
|
|
278
278
|
}
|
|
279
|
-
}`,variables:{directMessageLanguage:e}})),n=r,i=new
|
|
279
|
+
}`,variables:{directMessageLanguage:e}})),n=r,i=new Qr(n.did,n.perspective);return i.directMessageLanguage=n.directMessageLanguage,i}async addEntanglementProofs(e){let{agentAddEntanglementProofs:r}=A(await se(this,he,"f").mutate({mutation:C`mutation agentAddEntanglementProofs($proofs: [EntanglementProofInput!]!) {
|
|
280
280
|
agentAddEntanglementProofs(proofs: $proofs) {
|
|
281
|
-
${
|
|
281
|
+
${es}
|
|
282
282
|
}
|
|
283
|
-
}`,variables:{proofs:e}}));return r}async deleteEntanglementProofs(e){let{agentDeleteEntanglementProofs:r}=
|
|
283
|
+
}`,variables:{proofs:e}}));return r}async deleteEntanglementProofs(e){let{agentDeleteEntanglementProofs:r}=A(await se(this,he,"f").mutate({mutation:C`mutation agentDeleteEntanglementProofs($proofs: [EntanglementProofInput!]!) {
|
|
284
284
|
agentDeleteEntanglementProofs(proofs: $proofs) {
|
|
285
|
-
${
|
|
285
|
+
${es}
|
|
286
286
|
}
|
|
287
|
-
}`,variables:{proofs:e}}));return r}async getEntanglementProofs(){let{agentGetEntanglementProofs:e}=
|
|
287
|
+
}`,variables:{proofs:e}}));return r}async getEntanglementProofs(){let{agentGetEntanglementProofs:e}=A(await se(this,he,"f").query({query:C`query agentGetEntanglementProofs {
|
|
288
288
|
agentGetEntanglementProofs {
|
|
289
|
-
${
|
|
289
|
+
${es}
|
|
290
290
|
}
|
|
291
|
-
}`}));return e}async entanglementProofPreFlight(e,r){let{agentEntanglementProofPreFlight:n}=
|
|
291
|
+
}`}));return e}async entanglementProofPreFlight(e,r){let{agentEntanglementProofPreFlight:n}=A(await se(this,he,"f").mutate({mutation:C`mutation agentEntanglementProofPreFlight($deviceKey: String!, $deviceKeyType: String!) {
|
|
292
292
|
agentEntanglementProofPreFlight(deviceKey: $deviceKey, deviceKeyType: $deviceKeyType) {
|
|
293
|
-
${
|
|
293
|
+
${es}
|
|
294
294
|
}
|
|
295
|
-
}`,variables:{deviceKey:e,deviceKeyType:r}}));return n}addUpdatedListener(e){
|
|
296
|
-
agentUpdated { ${
|
|
295
|
+
}`,variables:{deviceKey:e,deviceKeyType:r}}));return n}addUpdatedListener(e){se(this,Ea,"f").push(e)}addAppChangedListener(e){se(this,xa,"f").push(e)}subscribeAgentUpdated(){se(this,he,"f").subscribe({query:C` subscription {
|
|
296
|
+
agentUpdated { ${ma} }
|
|
297
297
|
}
|
|
298
|
-
`}).subscribe({next:e=>{let r=e.data.agentUpdated;
|
|
298
|
+
`}).subscribe({next:e=>{let r=e.data.agentUpdated;se(this,Ea,"f").forEach(n=>{n(r)})},error:e=>console.error(e)})}subscribeAppsChanged(){se(this,he,"f").subscribe({query:C` subscription {
|
|
299
299
|
agentAppsChanged {
|
|
300
|
-
${
|
|
300
|
+
${Xo}
|
|
301
301
|
}
|
|
302
302
|
}
|
|
303
|
-
`}).subscribe({next:e=>{
|
|
304
|
-
agentStatusChanged { ${
|
|
303
|
+
`}).subscribe({next:e=>{se(this,xa,"f").forEach(r=>{r()})},error:e=>console.error(e)})}addAgentStatusChangedListener(e){se(this,Ca,"f").push(e)}subscribeAgentStatusChanged(){se(this,he,"f").subscribe({query:C` subscription {
|
|
304
|
+
agentStatusChanged { ${_i} }
|
|
305
305
|
}
|
|
306
|
-
`}).subscribe({next:e=>{let r=e.data.agentStatusChanged;
|
|
306
|
+
`}).subscribe({next:e=>{let r=e.data.agentStatusChanged;se(this,Ca,"f").forEach(n=>{n(r)})},error:e=>console.error(e)})}async requestCapability(e){let{agentRequestCapability:r}=A(await se(this,he,"f").mutate({mutation:C`
|
|
307
307
|
mutation agentRequestCapability($authInfo: AuthInfoInput!) {
|
|
308
308
|
agentRequestCapability(authInfo: $authInfo)
|
|
309
309
|
}
|
|
310
|
-
`,variables:{authInfo:e}}));return r}async permitCapability(e){let{agentPermitCapability:r}=
|
|
310
|
+
`,variables:{authInfo:e}}));return r}async permitCapability(e){let{agentPermitCapability:r}=A(await se(this,he,"f").mutate({mutation:C`
|
|
311
311
|
mutation agentPermitCapability($auth: String!) {
|
|
312
312
|
agentPermitCapability(auth: $auth)
|
|
313
313
|
}
|
|
314
|
-
`,variables:{auth:e}}));return r}async generateJwt(e,r){let{agentGenerateJwt:n}=
|
|
314
|
+
`,variables:{auth:e}}));return r}async generateJwt(e,r){let{agentGenerateJwt:n}=A(await se(this,he,"f").mutate({mutation:C`
|
|
315
315
|
mutation agentGenerateJwt($requestId: String!, $rand: String!) {
|
|
316
316
|
agentGenerateJwt(requestId: $requestId, rand: $rand)
|
|
317
317
|
}
|
|
318
|
-
`,variables:{requestId:e,rand:r}}));return n}async getApps(){let{agentGetApps:e}=
|
|
318
|
+
`,variables:{requestId:e,rand:r}}));return n}async getApps(){let{agentGetApps:e}=A(await se(this,he,"f").mutate({mutation:C`query agentGetApps {
|
|
319
319
|
agentGetApps {
|
|
320
|
-
${
|
|
320
|
+
${Xo}
|
|
321
321
|
}
|
|
322
|
-
}`}));return e}async removeApp(e){let{agentRemoveApp:r}=
|
|
322
|
+
}`}));return e}async removeApp(e){let{agentRemoveApp:r}=A(await se(this,he,"f").mutate({mutation:C`mutation agentRemoveApp($requestId: String!) {
|
|
323
323
|
agentRemoveApp(requestId: $requestId) {
|
|
324
|
-
${
|
|
324
|
+
${Xo}
|
|
325
325
|
}
|
|
326
|
-
}`,variables:{requestId:e}}));return r}async revokeToken(e){let{agentRevokeToken:r}=
|
|
326
|
+
}`,variables:{requestId:e}}));return r}async revokeToken(e){let{agentRevokeToken:r}=A(await se(this,he,"f").mutate({mutation:C`mutation agentRevokeToken($requestId: String!) {
|
|
327
327
|
agentRevokeToken(requestId: $requestId) {
|
|
328
|
-
${
|
|
328
|
+
${Xo}
|
|
329
329
|
}
|
|
330
|
-
}`,variables:{requestId:e}}));return r}async isLocked(){let{agentIsLocked:e}=
|
|
330
|
+
}`,variables:{requestId:e}}));return r}async isLocked(){let{agentIsLocked:e}=A(await se(this,he,"f").mutate({mutation:C`
|
|
331
331
|
query agentIsLocked {
|
|
332
332
|
agentIsLocked
|
|
333
333
|
}
|
|
334
|
-
`}));return e}async signMessage(e){let{agentSignMessage:r}=
|
|
334
|
+
`}));return e}async signMessage(e){let{agentSignMessage:r}=A(await se(this,he,"f").mutate({mutation:C`mutation agentSignMessage($message: String!) {
|
|
335
335
|
agentSignMessage(message: $message) {
|
|
336
|
-
${
|
|
336
|
+
${$y}
|
|
337
337
|
}
|
|
338
|
-
}`,variables:{message:e}}));return r}};
|
|
338
|
+
}`,variables:{message:e}}));return r}};he=new WeakMap,xa=new WeakMap,Ea=new WeakMap,Ca=new WeakMap;var My=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},jr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Vt,Ad=`
|
|
339
339
|
name
|
|
340
340
|
address
|
|
341
341
|
settings
|
|
342
342
|
icon { code }
|
|
343
343
|
constructorIcon { code }
|
|
344
344
|
settingsIcon { code }
|
|
345
|
-
`,
|
|
345
|
+
`,Id=`
|
|
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
|
+
`,sl=class{constructor(e){Vt.set(this,void 0),My(this,Vt,e,"f")}async byAddress(e){let{language:r}=A(await jr(this,Vt,"f").query({query:C`query byAddress($address: String!) {
|
|
356
356
|
language(address: $address) {
|
|
357
|
-
${
|
|
357
|
+
${Ad}
|
|
358
358
|
}
|
|
359
|
-
}`,variables:{address:e}}));return r}async byFilter(e){let{languages:r}=
|
|
359
|
+
}`,variables:{address:e}}));return r}async byFilter(e){let{languages:r}=A(await jr(this,Vt,"f").query({query:C`query byFilter($filter: String!) {
|
|
360
360
|
languages(filter: $filter) {
|
|
361
|
-
${
|
|
361
|
+
${Ad}
|
|
362
362
|
}
|
|
363
|
-
}`,variables:{filter:e}}));return r}async all(){return this.byFilter("")}async writeSettings(e,r){let{languageWriteSettings:n}=
|
|
363
|
+
}`,variables:{filter:e}}));return r}async all(){return this.byFilter("")}async writeSettings(e,r){let{languageWriteSettings:n}=A(await jr(this,Vt,"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}=
|
|
365
|
+
}`,variables:{languageAddress:e,settings:r}}));return n}async applyTemplateAndPublish(e,r){let{languageApplyTemplateAndPublish:n}=A(await jr(this,Vt,"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}=
|
|
372
|
+
}`,variables:{sourceLanguageHash:e,templateData:r}}));return n}async publish(e,r){let{languagePublish:n}=A(await jr(this,Vt,"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
|
+
${Id}
|
|
378
378
|
}
|
|
379
|
-
}`,variables:{languagePath:e,languageMeta:r}}));return n}async meta(e){let{languageMeta:r}=
|
|
379
|
+
}`,variables:{languagePath:e,languageMeta:r}}));return n}async meta(e){let{languageMeta:r}=A(await jr(this,Vt,"f").query({query:C`query languageMeta(
|
|
380
380
|
$address: String!,
|
|
381
381
|
) {
|
|
382
382
|
languageMeta(address: $address) {
|
|
383
|
-
${
|
|
383
|
+
${Id}
|
|
384
384
|
}
|
|
385
|
-
}`,variables:{address:e}}));return r}async source(e){let{languageSource:r}=
|
|
385
|
+
}`,variables:{address:e}}));return r}async source(e){let{languageSource:r}=A(await jr(this,Vt,"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}=
|
|
389
|
+
}`,variables:{address:e}}));return r}async remove(e){let{languageRemove:r}=A(await jr(this,Vt,"f").mutate({mutation:C`mutation languageRemove(
|
|
390
390
|
$address: String!,
|
|
391
391
|
) {
|
|
392
392
|
languageRemove(address: $address)
|
|
393
|
-
}`,variables:{address:e}}));return r}};
|
|
393
|
+
}`,variables:{address:e}}));return r}};Vt=new WeakMap;var Uy=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},Xe=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,An,cl=class{constructor(e){st.set(this,void 0),An.set(this,new Map),Uy(this,st,e,"f")}async publishFromPerspective(e,r,n){let{neighbourhoodPublishFromPerspective:i}=A(await Xe(this,st,"f").mutate({mutation:C`mutation neighbourhoodPublishFromPerspective(
|
|
394
394
|
$linkLanguage: String!,
|
|
395
395
|
$meta: PerspectiveInput!,
|
|
396
396
|
$perspectiveUUID: String!
|
|
@@ -400,7 +400,7 @@ neighbourhood {
|
|
|
400
400
|
meta: $meta,
|
|
401
401
|
perspectiveUUID: $perspectiveUUID
|
|
402
402
|
)
|
|
403
|
-
}`,variables:{perspectiveUUID:e,linkLanguage:r,meta:n}}));return i}async joinFromUrl(e){let{neighbourhoodJoinFromUrl:r}=
|
|
403
|
+
}`,variables:{perspectiveUUID:e,linkLanguage:r,meta:n}}));return i}async joinFromUrl(e){let{neighbourhoodJoinFromUrl:r}=A(await Xe(this,st,"f").mutate({mutation:C`mutation neighbourhoodJoinFromUrl($url: String!) {
|
|
404
404
|
neighbourhoodJoinFromUrl(url: $url) {
|
|
405
405
|
uuid
|
|
406
406
|
name
|
|
@@ -422,11 +422,11 @@ neighbourhood {
|
|
|
422
422
|
author
|
|
423
423
|
}
|
|
424
424
|
}
|
|
425
|
-
}`,variables:{url:e}}));return r}async otherAgents(e){let{neighbourhoodOtherAgents:r}=
|
|
425
|
+
}`,variables:{url:e}}));return r}async otherAgents(e){let{neighbourhoodOtherAgents:r}=A(await Xe(this,st,"f").query({query:C`query neighbourhoodOtherAgents($perspectiveUUID: String!) {
|
|
426
426
|
neighbourhoodOtherAgents(perspectiveUUID: $perspectiveUUID)
|
|
427
|
-
}`,variables:{perspectiveUUID:e}}));return r}async hasTelepresenceAdapter(e){let{neighbourhoodHasTelepresenceAdapter:r}=
|
|
427
|
+
}`,variables:{perspectiveUUID:e}}));return r}async hasTelepresenceAdapter(e){let{neighbourhoodHasTelepresenceAdapter:r}=A(await Xe(this,st,"f").query({query:C`query neighbourhoodHasTelepresenceAdapter($perspectiveUUID: String!) {
|
|
428
428
|
neighbourhoodHasTelepresenceAdapter(perspectiveUUID: $perspectiveUUID)
|
|
429
|
-
}`,variables:{perspectiveUUID:e}}));return r}async onlineAgents(e){let{neighbourhoodOnlineAgents:r}=
|
|
429
|
+
}`,variables:{perspectiveUUID:e}}));return r}async onlineAgents(e){let{neighbourhoodOnlineAgents:r}=A(await Xe(this,st,"f").query({query:C`query neighbourhoodOnlineAgents($perspectiveUUID: String!) {
|
|
430
430
|
neighbourhoodOnlineAgents(perspectiveUUID: $perspectiveUUID) {
|
|
431
431
|
did
|
|
432
432
|
status {
|
|
@@ -443,7 +443,7 @@ neighbourhood {
|
|
|
443
443
|
proof { valid, invalid, signature, key }
|
|
444
444
|
}
|
|
445
445
|
}
|
|
446
|
-
}`,variables:{perspectiveUUID:e}}));return r}async setOnlineStatus(e,r){let{neighbourhoodSetOnlineStatus:n}=
|
|
446
|
+
}`,variables:{perspectiveUUID:e}}));return r}async setOnlineStatus(e,r){let{neighbourhoodSetOnlineStatus:n}=A(await Xe(this,st,"f").mutate({mutation:C`mutation neighbourhoodSetOnlineStatus(
|
|
447
447
|
$perspectiveUUID: String!,
|
|
448
448
|
$status: PerspectiveInput!
|
|
449
449
|
) {
|
|
@@ -451,7 +451,7 @@ neighbourhood {
|
|
|
451
451
|
perspectiveUUID: $perspectiveUUID,
|
|
452
452
|
status: $status
|
|
453
453
|
)
|
|
454
|
-
}`,variables:{perspectiveUUID:e,status:r}}));return n}async setOnlineStatusU(e,r){let{neighbourhoodSetOnlineStatusU:n}=
|
|
454
|
+
}`,variables:{perspectiveUUID:e,status:r}}));return n}async setOnlineStatusU(e,r){let{neighbourhoodSetOnlineStatusU:n}=A(await Xe(this,st,"f").mutate({mutation:C`mutation neighbourhoodSetOnlineStatusU(
|
|
455
455
|
$perspectiveUUID: String!,
|
|
456
456
|
$status: PerspectiveUnsignedInput!
|
|
457
457
|
) {
|
|
@@ -459,7 +459,7 @@ neighbourhood {
|
|
|
459
459
|
perspectiveUUID: $perspectiveUUID,
|
|
460
460
|
status: $status
|
|
461
461
|
)
|
|
462
|
-
}`,variables:{perspectiveUUID:e,status:r}}));return n}async sendSignal(e,r,n){let{neighbourhoodSendSignal:i}=
|
|
462
|
+
}`,variables:{perspectiveUUID:e,status:r}}));return n}async sendSignal(e,r,n){let{neighbourhoodSendSignal:i}=A(await Xe(this,st,"f").mutate({mutation:C`mutation neighbourhoodSendSignal(
|
|
463
463
|
$perspectiveUUID: String!,
|
|
464
464
|
$remoteAgentDid: String!,
|
|
465
465
|
$payload: PerspectiveInput!
|
|
@@ -469,7 +469,7 @@ neighbourhood {
|
|
|
469
469
|
remoteAgentDid: $remoteAgentDid,
|
|
470
470
|
payload: $payload
|
|
471
471
|
)
|
|
472
|
-
}`,variables:{perspectiveUUID:e,remoteAgentDid:r,payload:n}}));return i}async sendSignalU(e,r,n){let{neighbourhoodSendSignalU:i}=
|
|
472
|
+
}`,variables:{perspectiveUUID:e,remoteAgentDid:r,payload:n}}));return i}async sendSignalU(e,r,n){let{neighbourhoodSendSignalU:i}=A(await Xe(this,st,"f").mutate({mutation:C`mutation neighbourhoodSendSignalU(
|
|
473
473
|
$perspectiveUUID: String!,
|
|
474
474
|
$remoteAgentDid: String!,
|
|
475
475
|
$payload: PerspectiveUnsignedInput!
|
|
@@ -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}=A(await Xe(this,st,"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}=A(await Xe(this,st,"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=Xe(this,An,"f").get(e);n&&n.forEach(i=>i(r))}async subscribeToSignals(e){let r=this;await Xe(this,st,"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}=
|
|
517
|
+
}`,variables:{perspectiveUUID:e}}).subscribe({next:n=>{let{neighbourhoodSignal:i}=A(n);r.dispatchSignal(e,i)}})}async addSignalHandler(e,r){let n=Xe(this,An,"f").get(e);n||(n=[],await this.subscribeToSignals(e)),n.push(r),Xe(this,An,"f").set(e,n)}removeSignalHandler(e,r){let n=Xe(this,An,"f").get(e);if(n){let i=n.indexOf(r);i>-1&&n.splice(i,1)}Xe(this,An,"f").set(e,n)}};st=new WeakMap,An=new WeakMap;var ts=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)},ee,ka,Ta,Aa,jh,rs=`
|
|
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
|
+
`,jy=`
|
|
526
530
|
description
|
|
527
531
|
appName
|
|
528
532
|
appUrl
|
|
@@ -531,85 +535,105 @@ trigger
|
|
|
531
535
|
perspectiveIds
|
|
532
536
|
webhookUrl
|
|
533
537
|
webhookAuth
|
|
534
|
-
`,
|
|
538
|
+
`,Bh=`
|
|
535
539
|
id
|
|
536
540
|
granted
|
|
537
|
-
${
|
|
538
|
-
`,
|
|
539
|
-
notification { ${
|
|
541
|
+
${jy}
|
|
542
|
+
`,By=`
|
|
543
|
+
notification { ${Bh} }
|
|
540
544
|
perspectiveId
|
|
541
545
|
triggerMatch
|
|
542
|
-
`,
|
|
546
|
+
`,ul=class{constructor(e,r=!0){ee.set(this,void 0),ka.set(this,void 0),Ta.set(this,void 0),Aa.set(this,void 0),jh.set(this,void 0),ts(this,ee,e,"f"),ts(this,ka,[],"f"),ts(this,Ta,[],"f"),ts(this,Aa,[],"f"),r&&(this.subscribeMessageReceived(),this.subscribeExceptionOccurred(),this.subscribeNotificationTriggered())}async info(){let{runtimeInfo:e}=A(await Z(this,ee,"f").query({query:C`query runtimeInfo {
|
|
543
547
|
runtimeInfo {
|
|
544
548
|
ad4mExecutorVersion,
|
|
545
549
|
isInitialized,
|
|
546
550
|
isUnlocked
|
|
547
551
|
}
|
|
548
|
-
}`}));return e}async quit(){return
|
|
552
|
+
}`}));return e}async quit(){return A(await Z(this,ee,"f").mutate({mutation:C`mutation runtimeQuit { runtimeQuit }`})).runtimeQuit}async openLink(e){let{runtimeOpenLink:r}=A(await Z(this,ee,"f").mutate({mutation:C`mutation runtimeOpenLink($url: String!) {
|
|
549
553
|
runtimeOpenLink(url: $url)
|
|
550
|
-
}`,variables:{url:e}}));return r}async addTrustedAgents(e){let{addTrustedAgents:r}=
|
|
554
|
+
}`,variables:{url:e}}));return r}async addTrustedAgents(e){let{addTrustedAgents:r}=A(await Z(this,ee,"f").mutate({mutation:C`mutation addTrustedAgents($agents: [String!]!) {
|
|
551
555
|
addTrustedAgents(agents: $agents)
|
|
552
|
-
}`,variables:{agents:e}}));return r}async deleteTrustedAgents(e){let{deleteTrustedAgents:r}=
|
|
556
|
+
}`,variables:{agents:e}}));return r}async deleteTrustedAgents(e){let{deleteTrustedAgents:r}=A(await Z(this,ee,"f").mutate({mutation:C`mutation deleteTrustedAgents($agents: [String!]!) {
|
|
553
557
|
deleteTrustedAgents(agents: $agents)
|
|
554
|
-
}`,variables:{agents:e}}));return r}async getTrustedAgents(){let{getTrustedAgents:e}=
|
|
558
|
+
}`,variables:{agents:e}}));return r}async getTrustedAgents(){let{getTrustedAgents:e}=A(await Z(this,ee,"f").query({query:C`query getTrustedAgents {
|
|
555
559
|
getTrustedAgents
|
|
556
|
-
}`}));return e}async addKnownLinkLanguageTemplates(e){let{runtimeAddKnownLinkLanguageTemplates:r}=
|
|
560
|
+
}`}));return e}async addKnownLinkLanguageTemplates(e){let{runtimeAddKnownLinkLanguageTemplates:r}=A(await Z(this,ee,"f").mutate({mutation:C`mutation runtimeAddKnownLinkLanguageTemplates($addresses: [String!]!) {
|
|
557
561
|
runtimeAddKnownLinkLanguageTemplates(addresses: $addresses)
|
|
558
|
-
}`,variables:{addresses:e}}));return r}async removeKnownLinkLanguageTemplates(e){let{runtimeRemoveKnownLinkLanguageTemplates:r}=
|
|
562
|
+
}`,variables:{addresses:e}}));return r}async removeKnownLinkLanguageTemplates(e){let{runtimeRemoveKnownLinkLanguageTemplates:r}=A(await Z(this,ee,"f").mutate({mutation:C`mutation runtimeRemoveKnownLinkLanguageTemplates($addresses: [String!]!) {
|
|
559
563
|
runtimeRemoveKnownLinkLanguageTemplates(addresses: $addresses)
|
|
560
|
-
}`,variables:{addresses:e}}));return r}async knownLinkLanguageTemplates(){let{runtimeKnownLinkLanguageTemplates:e}=
|
|
564
|
+
}`,variables:{addresses:e}}));return r}async knownLinkLanguageTemplates(){let{runtimeKnownLinkLanguageTemplates:e}=A(await Z(this,ee,"f").query({query:C`query runtimeKnownLinkLanguageTemplates {
|
|
561
565
|
runtimeKnownLinkLanguageTemplates
|
|
562
|
-
}`}));return e}async addFriends(e){let{runtimeAddFriends:r}=
|
|
566
|
+
}`}));return e}async addFriends(e){let{runtimeAddFriends:r}=A(await Z(this,ee,"f").mutate({mutation:C`mutation runtimeAddFriends($dids: [String!]!) {
|
|
563
567
|
runtimeAddFriends(dids: $dids)
|
|
564
|
-
}`,variables:{dids:e}}));return r}async removeFriends(e){let{runtimeRemoveFriends:r}=
|
|
568
|
+
}`,variables:{dids:e}}));return r}async removeFriends(e){let{runtimeRemoveFriends:r}=A(await Z(this,ee,"f").mutate({mutation:C`mutation runtimeRemoveFriends($dids: [String!]!) {
|
|
565
569
|
runtimeRemoveFriends(dids: $dids)
|
|
566
|
-
}`,variables:{dids:e}}));return r}async friends(){let{runtimeFriends:e}=
|
|
570
|
+
}`,variables:{dids:e}}));return r}async friends(){let{runtimeFriends:e}=A(await Z(this,ee,"f").query({query:C`query runtimeFriends {
|
|
567
571
|
runtimeFriends
|
|
568
|
-
}`}));return e}async hcAgentInfos(){let{runtimeHcAgentInfos:e}=
|
|
572
|
+
}`}));return e}async hcAgentInfos(){let{runtimeHcAgentInfos:e}=A(await Z(this,ee,"f").query({query:C`query runtimeHcAgentInfos {
|
|
569
573
|
runtimeHcAgentInfos
|
|
570
|
-
}`}));return e}async hcAddAgentInfos(e){let{runtimeHcAddAgentInfos:r}=
|
|
574
|
+
}`}));return e}async hcAddAgentInfos(e){let{runtimeHcAddAgentInfos:r}=A(await Z(this,ee,"f").mutate({mutation:C`mutation runtimeHcAddAgentInfos($agentInfos: String!) {
|
|
571
575
|
runtimeHcAddAgentInfos(agentInfos: $agentInfos)
|
|
572
|
-
}`,variables:{agentInfos:e}}));return r}async verifyStringSignedByDid(e,r,n,i){let{runtimeVerifyStringSignedByDid:a}=
|
|
576
|
+
}`,variables:{agentInfos:e}}));return r}async verifyStringSignedByDid(e,r,n,i){let{runtimeVerifyStringSignedByDid:a}=A(await Z(this,ee,"f").mutate({mutation:C`query runtimeVerifyStringSignedByDid($did: String!, $didSigningKeyId: String!, $data: String!, $signedData: String!) {
|
|
573
577
|
runtimeVerifyStringSignedByDid(did: $did, didSigningKeyId: $didSigningKeyId, data: $data, signedData: $signedData)
|
|
574
|
-
}`,variables:{did:e,didSigningKeyId:r,data:n,signedData:i}}));return a}async setStatus(e){let{runtimeSetStatus:r}=
|
|
578
|
+
}`,variables:{did:e,didSigningKeyId:r,data:n,signedData:i}}));return a}async setStatus(e){let{runtimeSetStatus:r}=A(await Z(this,ee,"f").mutate({mutation:C`mutation runtimeSetStatus($status: PerspectiveInput!) {
|
|
575
579
|
runtimeSetStatus(status: $status)
|
|
576
|
-
}`,variables:{status:e}}));return r}async friendStatus(e){let{runtimeFriendStatus:r}=
|
|
577
|
-
runtimeFriendStatus(did: $did) { ${
|
|
578
|
-
}`,variables:{did:e}}));return r}async friendSendMessage(e,r){let{runtimeFriendSendMessage:n}=
|
|
580
|
+
}`,variables:{status:e}}));return r}async friendStatus(e){let{runtimeFriendStatus:r}=A(await Z(this,ee,"f").query({query:C`query runtimeFriendStatus($did: String!) {
|
|
581
|
+
runtimeFriendStatus(did: $did) { ${rs} }
|
|
582
|
+
}`,variables:{did:e}}));return r}async friendSendMessage(e,r){let{runtimeFriendSendMessage:n}=A(await Z(this,ee,"f").mutate({mutation:C`mutation runtimeFriendSendMessage($did: String!, $message: PerspectiveInput!) {
|
|
579
583
|
runtimeFriendSendMessage(did: $did, message: $message)
|
|
580
|
-
}`,variables:{did:e,message:r}}));return n}async messageInbox(e){let{runtimeMessageInbox:r}=
|
|
581
|
-
runtimeMessageInbox(filter: $filter) { ${
|
|
582
|
-
}`,variables:{filter:e}}));return r}async messageOutbox(e){let{runtimeMessageOutbox:r}=
|
|
584
|
+
}`,variables:{did:e,message:r}}));return n}async messageInbox(e){let{runtimeMessageInbox:r}=A(await Z(this,ee,"f").query({query:C`query runtimeMessageInbox($filter: String) {
|
|
585
|
+
runtimeMessageInbox(filter: $filter) { ${rs} }
|
|
586
|
+
}`,variables:{filter:e}}));return r}async messageOutbox(e){let{runtimeMessageOutbox:r}=A(await Z(this,ee,"f").query({query:C`query runtimeMessageOutbox($filter: String) {
|
|
583
587
|
runtimeMessageOutbox(filter: $filter) {
|
|
584
588
|
recipient,
|
|
585
589
|
message {
|
|
586
|
-
${
|
|
590
|
+
${rs}
|
|
587
591
|
}
|
|
588
592
|
}
|
|
589
|
-
}`,variables:{filter:e}}));return r}async requestInstallNotification(e){let{runtimeRequestInstallNotification:r}=
|
|
593
|
+
}`,variables:{filter:e}}));return r}async requestInstallNotification(e){let{runtimeRequestInstallNotification:r}=A(await Z(this,ee,"f").mutate({mutation:C`mutation runtimeRequestInstallNotification($notification: NotificationInput!) {
|
|
590
594
|
runtimeRequestInstallNotification(notification: $notification)
|
|
591
|
-
}`,variables:{notification:e}}));return r}async grantNotification(e){let{runtimeGrantNotification:r}=
|
|
595
|
+
}`,variables:{notification:e}}));return r}async grantNotification(e){let{runtimeGrantNotification:r}=A(await Z(this,ee,"f").mutate({mutation:C`mutation runtimeGrantNotification($id: String!) {
|
|
592
596
|
runtimeGrantNotification(id: $id)
|
|
593
|
-
}`,variables:{id:e}}));return r}async
|
|
594
|
-
|
|
595
|
-
}
|
|
597
|
+
}`,variables:{id:e}}));return r}async exportDb(e){let{runtimeExportDb:r}=A(await Z(this,ee,"f").mutate({mutation:C`mutation runtimeExportDb($filePath: String!) {
|
|
598
|
+
runtimeExportDb(filePath: $filePath)
|
|
599
|
+
}`,variables:{filePath:e}}));return r}async importDb(e){let{runtimeImportDb:r}=A(await Z(this,ee,"f").mutate({mutation:C`mutation runtimeImportDb($filePath: String!) {
|
|
600
|
+
runtimeImportDb(filePath: $filePath) {
|
|
601
|
+
perspectives { total imported failed omitted errors }
|
|
602
|
+
links { total imported failed omitted errors }
|
|
603
|
+
expressions { total imported failed omitted errors }
|
|
604
|
+
perspectiveDiffs { total imported failed omitted errors }
|
|
605
|
+
notifications { total imported failed omitted errors }
|
|
606
|
+
models { total imported failed omitted errors }
|
|
607
|
+
defaultModels { total imported failed omitted errors }
|
|
608
|
+
tasks { total imported failed omitted errors }
|
|
609
|
+
friends { total imported failed omitted errors }
|
|
610
|
+
trustedAgents { total imported failed omitted errors }
|
|
611
|
+
knownLinkLanguages { total imported failed omitted errors }
|
|
612
|
+
}
|
|
613
|
+
}`,variables:{filePath:e}}));return r}async notifications(){let{runtimeNotifications:e}=A(await Z(this,ee,"f").query({query:C`query runtimeNotifications {
|
|
614
|
+
runtimeNotifications { ${Bh} }
|
|
615
|
+
}`}));return e}async updateNotification(e,r){let{runtimeUpdateNotification:n}=A(await Z(this,ee,"f").mutate({mutation:C`mutation runtimeUpdateNotification($id: String!, $notification: NotificationInput!) {
|
|
596
616
|
runtimeUpdateNotification(id: $id, notification: $notification)
|
|
597
|
-
}`,variables:{id:e,notification:r}}));return n}async removeNotification(e){let{runtimeRemoveNotification:r}=
|
|
617
|
+
}`,variables:{id:e,notification:r}}));return n}async removeNotification(e){let{runtimeRemoveNotification:r}=A(await Z(this,ee,"f").mutate({mutation:C`mutation runtimeRemoveNotification($id: String!) {
|
|
598
618
|
runtimeRemoveNotification(id: $id)
|
|
599
|
-
}`,variables:{id:e}}));return r}
|
|
600
|
-
|
|
619
|
+
}`,variables:{id:e}}));return r}async exportPerspective(e,r){let{runtimeExportPerspective:n}=A(await Z(this,ee,"f").mutate({mutation:C`mutation runtimeExportPerspective($perspectiveUuid: String!, $filePath: String!) {
|
|
620
|
+
runtimeExportPerspective(perspectiveUuid: $perspectiveUuid, filePath: $filePath)
|
|
621
|
+
}`,variables:{perspectiveUuid:e,filePath:r}}));return n}async importPerspective(e){let{runtimeImportPerspective:r}=A(await Z(this,ee,"f").mutate({mutation:C`mutation runtimeImportPerspective($filePath: String!) {
|
|
622
|
+
runtimeImportPerspective(filePath: $filePath)
|
|
623
|
+
}`,variables:{filePath:e}}));return r}addNotificationTriggeredCallback(e){Z(this,Aa,"f").push(e)}subscribeNotificationTriggered(){Z(this,ee,"f").subscribe({query:C` subscription {
|
|
624
|
+
runtimeNotificationTriggered { ${By} }
|
|
601
625
|
}
|
|
602
|
-
`}).subscribe({next:e=>{
|
|
603
|
-
runtimeMessageReceived { ${
|
|
626
|
+
`}).subscribe({next:e=>{Z(this,Aa,"f").forEach(r=>{r(e.data.runtimeNotificationTriggered)})},error:e=>console.error(e)})}addMessageCallback(e){Z(this,ka,"f").push(e)}subscribeMessageReceived(){Z(this,ee,"f").subscribe({query:C` subscription {
|
|
627
|
+
runtimeMessageReceived { ${rs} }
|
|
604
628
|
}
|
|
605
|
-
`}).subscribe({next:e=>{
|
|
629
|
+
`}).subscribe({next:e=>{Z(this,ka,"f").forEach(r=>{r(e.data.runtimeMessageReceived)})},error:e=>console.error(e)})}addExceptionCallback(e){Z(this,Ta,"f").push(e)}subscribeExceptionOccurred(){Z(this,ee,"f").subscribe({query:C` subscription {
|
|
606
630
|
exceptionOccurred {
|
|
607
631
|
title
|
|
608
632
|
message
|
|
609
633
|
type
|
|
610
634
|
addon
|
|
611
635
|
}
|
|
612
|
-
}`}).subscribe({next:e=>{
|
|
636
|
+
}`}).subscribe({next:e=>{Z(this,Ta,"f").forEach(r=>{r(e.data.exceptionOccurred)})},error:e=>console.error(e)})}};ee=new WeakMap,ka=new WeakMap,Ta=new WeakMap,Aa=new WeakMap,jh=new WeakMap;var qy=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},wi=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)},vr,ll=class{constructor(e){vr.set(this,void 0),qy(this,vr,e,"f")}async get(e,r=!1){if(!r)try{let i=Qt.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}=A(await wi(this,vr,"f").query({query:C`query expression($url: String!) {
|
|
613
637
|
expression(url: $url) {
|
|
614
638
|
author
|
|
615
639
|
timestamp
|
|
@@ -622,7 +646,7 @@ triggerMatch
|
|
|
622
646
|
invalid
|
|
623
647
|
}
|
|
624
648
|
}
|
|
625
|
-
}`,variables:{url:e}}));return n}async getMany(e){let{expressionMany:r}=
|
|
649
|
+
}`,variables:{url:e}}));return n}async getMany(e){let{expressionMany:r}=A(await wi(this,vr,"f").query({query:C`query expressionMany($urls: [String!]!) {
|
|
626
650
|
expressionMany(urls: $urls) {
|
|
627
651
|
author
|
|
628
652
|
timestamp
|
|
@@ -635,19 +659,19 @@ triggerMatch
|
|
|
635
659
|
invalid
|
|
636
660
|
}
|
|
637
661
|
}
|
|
638
|
-
}`,variables:{urls:e}}));return r}async getRaw(e){let{expressionRaw:r}=
|
|
662
|
+
}`,variables:{urls:e}}));return r}async getRaw(e){let{expressionRaw:r}=A(await wi(this,vr,"f").query({query:C`query expressionRaw($url: String!) {
|
|
639
663
|
expressionRaw(url: $url)
|
|
640
|
-
}`,variables:{url:e}}));return r}async create(e,r){e=JSON.stringify(e);let{expressionCreate:n}=
|
|
664
|
+
}`,variables:{url:e}}));return r}async create(e,r){e=JSON.stringify(e);let{expressionCreate:n}=A(await wi(this,vr,"f").mutate({mutation:C`mutation expressionCreate($content: String!, $languageAddress: String!){
|
|
641
665
|
expressionCreate(content: $content, languageAddress: $languageAddress)
|
|
642
|
-
}`,variables:{content:e,languageAddress:r}}));return n}async interactions(e){let{expressionInteractions:r}=
|
|
666
|
+
}`,variables:{content:e,languageAddress:r}}));return n}async interactions(e){let{expressionInteractions:r}=A(await wi(this,vr,"f").query({query:C`query expressionInteractions($url: String!) {
|
|
643
667
|
expressionInteractions(url: $url) {
|
|
644
668
|
label
|
|
645
669
|
name
|
|
646
670
|
parameters { name, type }
|
|
647
671
|
}
|
|
648
|
-
}`,variables:{url:e}}));return r}async interact(e,r){let{expressionInteract:n}=
|
|
672
|
+
}`,variables:{url:e}}));return r}async interact(e,r){let{expressionInteract:n}=A(await wi(this,vr,"f").mutate({mutation:C`mutation expressionInteract($url: String!, $interactionCall: InteractionCall!){
|
|
649
673
|
expressionInteract(url: $url, interactionCall: $interactionCall)
|
|
650
|
-
}`,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`
|
|
674
|
+
}`,variables:{url:e,interactionCall:r}}));return n}};vr=new WeakMap;var Ws={};Ws.byteLength=zy;Ws.toByteArray=Gy;Ws.fromByteArray=Wy;var tr=[],Nt=[],Vy=typeof Uint8Array<"u"?Uint8Array:Array,Mu="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Sn=0,Od=Mu.length;Sn<Od;++Sn)tr[Sn]=Mu[Sn],Nt[Mu.charCodeAt(Sn)]=Sn;var Sn,Od;Nt["-".charCodeAt(0)]=62;Nt["_".charCodeAt(0)]=63;function qh(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 zy(t){var e=qh(t),r=e[0],n=e[1];return(r+n)*3/4-n}function Qy(t,e,r){return(e+r)*3/4-r}function Gy(t){var e,r=qh(t),n=r[0],i=r[1],a=new Vy(Qy(t,n,i)),o=0,s=i>0?n-4:n,u;for(u=0;u<s;u+=4)e=Nt[t.charCodeAt(u)]<<18|Nt[t.charCodeAt(u+1)]<<12|Nt[t.charCodeAt(u+2)]<<6|Nt[t.charCodeAt(u+3)],a[o++]=e>>16&255,a[o++]=e>>8&255,a[o++]=e&255;return i===2&&(e=Nt[t.charCodeAt(u)]<<2|Nt[t.charCodeAt(u+1)]>>4,a[o++]=e&255),i===1&&(e=Nt[t.charCodeAt(u)]<<10|Nt[t.charCodeAt(u+1)]<<4|Nt[t.charCodeAt(u+2)]>>2,a[o++]=e>>8&255,a[o++]=e&255),a}function Hy(t){return tr[t>>18&63]+tr[t>>12&63]+tr[t>>6&63]+tr[t&63]}function Ky(t,e,r){for(var n,i=[],a=e;a<r;a+=3)n=(t[a]<<16&16711680)+(t[a+1]<<8&65280)+(t[a+2]&255),i.push(Hy(n));return i.join("")}function Wy(t){for(var e,r=t.length,n=r%3,i=[],a=16383,o=0,s=r-n;o<s;o+=a)i.push(Ky(t,o,o+a>s?s:o+a));return n===1?(e=t[r-1],i.push(tr[e>>2]+tr[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],i.push(tr[e>>10]+tr[e>>4&63]+tr[e<<2&63]+"=")),i.join("")}var Zy=4,Dd=0,Nd=1,Yy=2;function $i(t){let e=t.length;for(;--e>=0;)t[e]=0}var Jy=0,Vh=1,Xy=2,e0=3,t0=258,Al=29,Xa=256,qa=Xa+1+Al,ki=30,Il=19,zh=2*qa+1,Dn=15,Uu=16,r0=7,Ol=256,Qh=16,Gh=17,Hh=18,fl=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]),vs=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]),n0=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),Kh=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),i0=512,br=new Array((qa+2)*2);$i(br);var La=new Array(ki*2);$i(La);var Va=new Array(i0);$i(Va);var za=new Array(t0-e0+1);$i(za);var Dl=new Array(Al);$i(Dl);var Fs=new Array(ki);$i(Fs);function ju(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 Wh,Zh,Yh;function Bu(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}var Jh=t=>t<256?Va[t]:Va[256+(t>>>7)],Qa=(t,e)=>{t.pending_buf[t.pending++]=e&255,t.pending_buf[t.pending++]=e>>>8&255},gt=(t,e,r)=>{t.bi_valid>Uu-r?(t.bi_buf|=e<<t.bi_valid&65535,Qa(t,t.bi_buf),t.bi_buf=e>>Uu-t.bi_valid,t.bi_valid+=r-Uu):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=r)},rr=(t,e,r)=>{gt(t,r[e*2],r[e*2+1])},Xh=(t,e)=>{let r=0;do r|=t&1,t>>>=1,r<<=1;while(--e>0);return r>>>1},a0=t=>{t.bi_valid===16?(Qa(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)},o0=(t,e)=>{let r=e.dyn_tree,n=e.max_code,i=e.stat_desc.static_tree,a=e.stat_desc.has_stree,o=e.stat_desc.extra_bits,s=e.stat_desc.extra_base,u=e.stat_desc.max_length,c,l,d,p,f,h,y=0;for(p=0;p<=Dn;p++)t.bl_count[p]=0;for(r[t.heap[t.heap_max]*2+1]=0,c=t.heap_max+1;c<zh;c++)l=t.heap[c],p=r[r[l*2+1]*2+1]+1,p>u&&(p=u,y++),r[l*2+1]=p,!(l>n)&&(t.bl_count[p]++,f=0,l>=s&&(f=o[l-s]),h=r[l*2],t.opt_len+=h*(p+f),a&&(t.static_len+=h*(i[l*2+1]+f)));if(y!==0){do{for(p=u-1;t.bl_count[p]===0;)p--;t.bl_count[p]--,t.bl_count[p+1]+=2,t.bl_count[u]--,y-=2}while(y>0);for(p=u;p!==0;p--)for(l=t.bl_count[p];l!==0;)d=t.heap[--c],!(d>n)&&(r[d*2+1]!==p&&(t.opt_len+=(p-r[d*2+1])*r[d*2],r[d*2+1]=p),l--)}},e1=(t,e,r)=>{let n=new Array(Dn+1),i=0,a,o;for(a=1;a<=Dn;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]=Xh(n[s]++,s))}},s0=()=>{let t,e,r,n,i,a=new Array(Dn+1);for(r=0,n=0;n<Al-1;n++)for(Dl[n]=r,t=0;t<1<<fl[n];t++)za[r++]=n;for(za[r-1]=n,i=0,n=0;n<16;n++)for(Fs[n]=i,t=0;t<1<<vs[n];t++)Va[i++]=n;for(i>>=7;n<ki;n++)for(Fs[n]=i<<7,t=0;t<1<<vs[n]-7;t++)Va[256+i++]=n;for(e=0;e<=Dn;e++)a[e]=0;for(t=0;t<=143;)br[t*2+1]=8,t++,a[8]++;for(;t<=255;)br[t*2+1]=9,t++,a[9]++;for(;t<=279;)br[t*2+1]=7,t++,a[7]++;for(;t<=287;)br[t*2+1]=8,t++,a[8]++;for(e1(br,qa+1,a),t=0;t<ki;t++)La[t*2+1]=5,La[t*2]=Xh(t,5);Wh=new ju(br,fl,Xa+1,qa,Dn),Zh=new ju(La,vs,0,ki,Dn),Yh=new ju(new Array(0),n0,0,Il,r0)},t1=t=>{let e;for(e=0;e<qa;e++)t.dyn_ltree[e*2]=0;for(e=0;e<ki;e++)t.dyn_dtree[e*2]=0;for(e=0;e<Il;e++)t.bl_tree[e*2]=0;t.dyn_ltree[Ol*2]=1,t.opt_len=t.static_len=0,t.sym_next=t.matches=0},r1=t=>{t.bi_valid>8?Qa(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},Rd=(t,e,r,n)=>{let i=e*2,a=r*2;return t[i]<t[a]||t[i]===t[a]&&n[e]<=n[r]},qu=(t,e,r)=>{let n=t.heap[r],i=r<<1;for(;i<=t.heap_len&&(i<t.heap_len&&Rd(e,t.heap[i+1],t.heap[i],t.depth)&&i++,!Rd(e,n,t.heap[i],t.depth));)t.heap[r]=t.heap[i],r=i,i<<=1;t.heap[r]=n},Pd=(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?rr(t,i,e):(o=za[i],rr(t,o+Xa+1,e),s=fl[o],s!==0&&(i-=Dl[o],gt(t,i,s)),n--,o=Jh(n),rr(t,o,r),s=vs[o],s!==0&&(n-=Fs[o],gt(t,n,s)));while(a<t.sym_next);rr(t,Ol,e)},pl=(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=zh,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--)qu(t,r,o);c=a;do o=t.heap[1],t.heap[1]=t.heap[t.heap_len--],qu(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++,qu(t,r,1);while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],o0(t,e),e1(r,u,t.bl_count)},Ld=(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[Qh*2]++):s<=10?t.bl_tree[Gh*2]++:t.bl_tree[Hh*2]++,s=0,i=a,o===0?(u=138,c=3):a===o?(u=6,c=3):(u=7,c=4))},Fd=(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 rr(t,a,t.bl_tree);while(--s!==0);else a!==0?(a!==i&&(rr(t,a,t.bl_tree),s--),rr(t,Qh,t.bl_tree),gt(t,s-3,2)):s<=10?(rr(t,Gh,t.bl_tree),gt(t,s-3,3)):(rr(t,Hh,t.bl_tree),gt(t,s-11,7));s=0,i=a,o===0?(u=138,c=3):a===o?(u=6,c=3):(u=7,c=4)}},c0=t=>{let e;for(Ld(t,t.dyn_ltree,t.l_desc.max_code),Ld(t,t.dyn_dtree,t.d_desc.max_code),pl(t,t.bl_desc),e=Il-1;e>=3&&t.bl_tree[Kh[e]*2+1]===0;e--);return t.opt_len+=3*(e+1)+5+5+4,e},u0=(t,e,r,n)=>{let i;for(gt(t,e-257,5),gt(t,r-1,5),gt(t,n-4,4),i=0;i<n;i++)gt(t,t.bl_tree[Kh[i]*2+1],3);Fd(t,t.dyn_ltree,e-1),Fd(t,t.dyn_dtree,r-1)},l0=t=>{let e=4093624447,r;for(r=0;r<=31;r++,e>>>=1)if(e&1&&t.dyn_ltree[r*2]!==0)return Dd;if(t.dyn_ltree[9*2]!==0||t.dyn_ltree[10*2]!==0||t.dyn_ltree[13*2]!==0)return Nd;for(r=32;r<Xa;r++)if(t.dyn_ltree[r*2]!==0)return Nd;return Dd},$d=!1,f0=t=>{$d||(s0(),$d=!0),t.l_desc=new Bu(t.dyn_ltree,Wh),t.d_desc=new Bu(t.dyn_dtree,Zh),t.bl_desc=new Bu(t.bl_tree,Yh),t.bi_buf=0,t.bi_valid=0,t1(t)},n1=(t,e,r,n)=>{gt(t,(Jy<<1)+(n?1:0),3),r1(t),Qa(t,r),Qa(t,~r),r&&t.pending_buf.set(t.window.subarray(e,e+r),t.pending),t.pending+=r},p0=t=>{gt(t,Vh<<1,3),rr(t,Ol,br),a0(t)},d0=(t,e,r,n)=>{let i,a,o=0;t.level>0?(t.strm.data_type===Yy&&(t.strm.data_type=l0(t)),pl(t,t.l_desc),pl(t,t.d_desc),o=c0(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?n1(t,e,r,n):t.strategy===Zy||a===i?(gt(t,(Vh<<1)+(n?1:0),3),Pd(t,br,La)):(gt(t,(Xy<<1)+(n?1:0),3),u0(t,t.l_desc.max_code+1,t.d_desc.max_code+1,o+1),Pd(t,t.dyn_ltree,t.dyn_dtree)),t1(t),n&&r1(t)},h0=(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[(za[r]+Xa+1)*2]++,t.dyn_dtree[Jh(e)*2]++),t.sym_next===t.sym_end),m0=f0,g0=n1,y0=d0,v0=h0,b0=p0,_0={_tr_init:m0,_tr_stored_block:g0,_tr_flush_block:y0,_tr_tally:v0,_tr_align:b0},w0=(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},Ga=w0,S0=()=>{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},x0=new Uint32Array(S0()),E0=(t,e,r,n)=>{let i=x0,a=n+r;t^=-1;for(let o=n;o<a;o++)t=t>>>8^i[(t^e[o])&255];return t^-1},Ge=E0,jn={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"},Wn={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:C0,_tr_stored_block:dl,_tr_flush_block:k0,_tr_tally:Hr,_tr_align:T0}=_0,{Z_NO_FLUSH:Kr,Z_PARTIAL_FLUSH:A0,Z_FULL_FLUSH:I0,Z_FINISH:Pt,Z_BLOCK:Md,Z_OK:et,Z_STREAM_END:Ud,Z_STREAM_ERROR:ir,Z_DATA_ERROR:O0,Z_BUF_ERROR:Vu,Z_DEFAULT_COMPRESSION:D0,Z_FILTERED:N0,Z_HUFFMAN_ONLY:ns,Z_RLE:R0,Z_FIXED:P0,Z_DEFAULT_STRATEGY:L0,Z_UNKNOWN:F0,Z_DEFLATED:Zs}=Wn,$0=9,M0=15,U0=8,j0=29,B0=256,hl=B0+1+j0,q0=30,V0=19,z0=2*hl+1,Q0=15,te=3,Vr=258,ar=Vr+te+1,G0=32,Oi=42,Nl=57,ml=69,gl=73,yl=91,vl=103,Nn=113,Ia=666,ut=1,Mi=2,Bn=3,Ui=4,H0=3,Rn=(t,e)=>(t.msg=jn[e],e),jd=t=>t*2-(t>4?9:0),qr=t=>{let e=t.length;for(;--e>=0;)t[e]=0},K0=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)},W0=(t,e,r)=>(e<<t.hash_shift^r)&t.hash_mask,Wr=W0,St=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))},Et=(t,e)=>{k0(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,St(t.strm)},ue=(t,e)=>{t.pending_buf[t.pending++]=e},ga=(t,e)=>{t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=e&255},bl=(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=Ga(t.adler,e,i,r):t.state.wrap===2&&(t.adler=Ge(t.adler,e,i,r)),t.next_in+=i,t.total_in+=i,i)},i1=(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-ar?t.strstart-(t.w_size-ar):0,c=t.window,l=t.w_mask,d=t.prev,p=t.strstart+Vr,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=Vr-(p-n),n=p-Vr,a>o){if(t.match_start=e,o=a,a>=s)break;f=c[n+o-1],h=c[n+o]}}while((e=d[e&l])>u&&--r!==0);return o<=t.lookahead?o:t.lookahead},Di=t=>{let e=t.w_size,r,n,i;do{if(n=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-ar)&&(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),K0(t),n+=e),t.strm.avail_in===0)break;if(r=bl(t.strm,t.window,t.strstart+t.lookahead,n),t.lookahead+=r,t.lookahead+t.insert>=te)for(i=t.strstart-t.insert,t.ins_h=t.window[i],t.ins_h=Wr(t,t.ins_h,t.window[i+1]);t.insert&&(t.ins_h=Wr(t,t.ins_h,t.window[i+te-1]),t.prev[i&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=i,i++,t.insert--,!(t.lookahead+t.insert<te)););}while(t.lookahead<ar&&t.strm.avail_in!==0)},a1=(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!==Pt||e===Kr||n!==i+t.strm.avail_in)))break;o=e===Pt&&n===i+t.strm.avail_in?1:0,dl(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,St(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&&(bl(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?Ui:e!==Kr&&e!==Pt&&t.strm.avail_in===0&&t.strstart===t.block_start?Mi:(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&&(bl(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===Pt)&&e!==Kr&&t.strm.avail_in===0&&i<=a)&&(n=i>a?a:i,o=e===Pt&&t.strm.avail_in===0&&n===i?1:0,dl(t,t.block_start,n,o),t.block_start+=n,St(t.strm)),o?Bn:ut)},zu=(t,e)=>{let r,n;for(;;){if(t.lookahead<ar){if(Di(t),t.lookahead<ar&&e===Kr)return ut;if(t.lookahead===0)break}if(r=0,t.lookahead>=te&&(t.ins_h=Wr(t,t.ins_h,t.window[t.strstart+te-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),r!==0&&t.strstart-r<=t.w_size-ar&&(t.match_length=i1(t,r)),t.match_length>=te)if(n=Hr(t,t.strstart-t.match_start,t.match_length-te),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=te){t.match_length--;do t.strstart++,t.ins_h=Wr(t,t.ins_h,t.window[t.strstart+te-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart;while(--t.match_length!==0);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=Wr(t,t.ins_h,t.window[t.strstart+1]);else n=Hr(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(Et(t,!1),t.strm.avail_out===0))return ut}return t.insert=t.strstart<te-1?t.strstart:te-1,e===Pt?(Et(t,!0),t.strm.avail_out===0?Bn:Ui):t.sym_next&&(Et(t,!1),t.strm.avail_out===0)?ut:Mi},Si=(t,e)=>{let r,n,i;for(;;){if(t.lookahead<ar){if(Di(t),t.lookahead<ar&&e===Kr)return ut;if(t.lookahead===0)break}if(r=0,t.lookahead>=te&&(t.ins_h=Wr(t,t.ins_h,t.window[t.strstart+te-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=te-1,r!==0&&t.prev_length<t.max_lazy_match&&t.strstart-r<=t.w_size-ar&&(t.match_length=i1(t,r),t.match_length<=5&&(t.strategy===N0||t.match_length===te&&t.strstart-t.match_start>4096)&&(t.match_length=te-1)),t.prev_length>=te&&t.match_length<=t.prev_length){i=t.strstart+t.lookahead-te,n=Hr(t,t.strstart-1-t.prev_match,t.prev_length-te),t.lookahead-=t.prev_length-1,t.prev_length-=2;do++t.strstart<=i&&(t.ins_h=Wr(t,t.ins_h,t.window[t.strstart+te-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart);while(--t.prev_length!==0);if(t.match_available=0,t.match_length=te-1,t.strstart++,n&&(Et(t,!1),t.strm.avail_out===0))return ut}else if(t.match_available){if(n=Hr(t,0,t.window[t.strstart-1]),n&&Et(t,!1),t.strstart++,t.lookahead--,t.strm.avail_out===0)return ut}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=Hr(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<te-1?t.strstart:te-1,e===Pt?(Et(t,!0),t.strm.avail_out===0?Bn:Ui):t.sym_next&&(Et(t,!1),t.strm.avail_out===0)?ut:Mi},Z0=(t,e)=>{let r,n,i,a,o=t.window;for(;;){if(t.lookahead<=Vr){if(Di(t),t.lookahead<=Vr&&e===Kr)return ut;if(t.lookahead===0)break}if(t.match_length=0,t.lookahead>=te&&t.strstart>0&&(i=t.strstart-1,n=o[i],n===o[++i]&&n===o[++i]&&n===o[++i])){a=t.strstart+Vr;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=Vr-(a-i),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=te?(r=Hr(t,1,t.match_length-te),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=Hr(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&(Et(t,!1),t.strm.avail_out===0))return ut}return t.insert=0,e===Pt?(Et(t,!0),t.strm.avail_out===0?Bn:Ui):t.sym_next&&(Et(t,!1),t.strm.avail_out===0)?ut:Mi},Y0=(t,e)=>{let r;for(;;){if(t.lookahead===0&&(Di(t),t.lookahead===0)){if(e===Kr)return ut;break}if(t.match_length=0,r=Hr(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(Et(t,!1),t.strm.avail_out===0))return ut}return t.insert=0,e===Pt?(Et(t,!0),t.strm.avail_out===0?Bn:Ui):t.sym_next&&(Et(t,!1),t.strm.avail_out===0)?ut:Mi};function Xt(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 Oa=[new Xt(0,0,0,0,a1),new Xt(4,4,8,4,zu),new Xt(4,5,16,8,zu),new Xt(4,6,32,32,zu),new Xt(4,4,16,16,Si),new Xt(8,16,32,32,Si),new Xt(8,16,128,128,Si),new Xt(8,32,128,256,Si),new Xt(32,128,258,1024,Si),new Xt(32,258,258,4096,Si)],J0=t=>{t.window_size=2*t.w_size,qr(t.head),t.max_lazy_match=Oa[t.level].max_lazy,t.good_match=Oa[t.level].good_length,t.nice_match=Oa[t.level].nice_length,t.max_chain_length=Oa[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=te-1,t.match_available=0,t.ins_h=0};function X0(){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=Zs,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(z0*2),this.dyn_dtree=new Uint16Array((2*q0+1)*2),this.bl_tree=new Uint16Array((2*V0+1)*2),qr(this.dyn_ltree),qr(this.dyn_dtree),qr(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(Q0+1),this.heap=new Uint16Array(2*hl+1),qr(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*hl+1),qr(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 eo=t=>{if(!t)return 1;let e=t.state;return!e||e.strm!==t||e.status!==Oi&&e.status!==Nl&&e.status!==ml&&e.status!==gl&&e.status!==yl&&e.status!==vl&&e.status!==Nn&&e.status!==Ia?1:0},o1=t=>{if(eo(t))return Rn(t,ir);t.total_in=t.total_out=0,t.data_type=F0;let e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap===2?Nl:e.wrap?Oi:Nn,t.adler=e.wrap===2?0:1,e.last_flush=-2,C0(e),et},s1=t=>{let e=o1(t);return e===et&&J0(t.state),e},e2=(t,e)=>eo(t)||t.state.wrap!==2?ir:(t.state.gzhead=e,et),c1=(t,e,r,n,i,a)=>{if(!t)return ir;let o=1;if(e===D0&&(e=6),n<0?(o=0,n=-n):n>15&&(o=2,n-=16),i<1||i>$0||r!==Zs||n<8||n>15||e<0||e>9||a<0||a>P0||n===8&&o!==1)return Rn(t,ir);n===8&&(n=9);let s=new X0;return t.state=s,s.strm=t,s.status=Oi,s.wrap=o,s.gzhead=null,s.w_bits=n,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=i+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+te-1)/te),s.window=new Uint8Array(s.w_size*2),s.head=new Uint16Array(s.hash_size),s.prev=new Uint16Array(s.w_size),s.lit_bufsize=1<<i+6,s.pending_buf_size=s.lit_bufsize*4,s.pending_buf=new Uint8Array(s.pending_buf_size),s.sym_buf=s.lit_bufsize,s.sym_end=(s.lit_bufsize-1)*3,s.level=e,s.strategy=a,s.method=r,s1(t)},t2=(t,e)=>c1(t,e,Zs,M0,U0,L0),r2=(t,e)=>{if(eo(t)||e>Md||e<0)return t?Rn(t,ir):ir;let r=t.state;if(!t.output||t.avail_in!==0&&!t.input||r.status===Ia&&e!==Pt)return Rn(t,t.avail_out===0?Vu:ir);let n=r.last_flush;if(r.last_flush=e,r.pending!==0){if(St(t),t.avail_out===0)return r.last_flush=-1,et}else if(t.avail_in===0&&jd(e)<=jd(n)&&e!==Pt)return Rn(t,Vu);if(r.status===Ia&&t.avail_in!==0)return Rn(t,Vu);if(r.status===Oi&&r.wrap===0&&(r.status=Nn),r.status===Oi){let i=Zs+(r.w_bits-8<<4)<<8,a=-1;if(r.strategy>=ns||r.level<2?a=0:r.level<6?a=1:r.level===6?a=2:a=3,i|=a<<6,r.strstart!==0&&(i|=G0),i+=31-i%31,ga(r,i),r.strstart!==0&&(ga(r,t.adler>>>16),ga(r,t.adler&65535)),t.adler=1,r.status=Nn,St(t),r.pending!==0)return r.last_flush=-1,et}if(r.status===Nl){if(t.adler=0,ue(r,31),ue(r,139),ue(r,8),r.gzhead)ue(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)),ue(r,r.gzhead.time&255),ue(r,r.gzhead.time>>8&255),ue(r,r.gzhead.time>>16&255),ue(r,r.gzhead.time>>24&255),ue(r,r.level===9?2:r.strategy>=ns||r.level<2?4:0),ue(r,r.gzhead.os&255),r.gzhead.extra&&r.gzhead.extra.length&&(ue(r,r.gzhead.extra.length&255),ue(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=Ge(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=ml;else if(ue(r,0),ue(r,0),ue(r,0),ue(r,0),ue(r,0),ue(r,r.level===9?2:r.strategy>=ns||r.level<2?4:0),ue(r,H0),r.status=Nn,St(t),r.pending!==0)return r.last_flush=-1,et}if(r.status===ml){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=Ge(t.adler,r.pending_buf,r.pending-i,i)),r.gzindex+=s,St(t),r.pending!==0)return r.last_flush=-1,et;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=Ge(t.adler,r.pending_buf,r.pending-i,i)),r.gzindex=0}r.status=gl}if(r.status===gl){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=Ge(t.adler,r.pending_buf,r.pending-i,i)),St(t),r.pending!==0)return r.last_flush=-1,et;i=0}r.gzindex<r.gzhead.name.length?a=r.gzhead.name.charCodeAt(r.gzindex++)&255:a=0,ue(r,a)}while(a!==0);r.gzhead.hcrc&&r.pending>i&&(t.adler=Ge(t.adler,r.pending_buf,r.pending-i,i)),r.gzindex=0}r.status=yl}if(r.status===yl){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=Ge(t.adler,r.pending_buf,r.pending-i,i)),St(t),r.pending!==0)return r.last_flush=-1,et;i=0}r.gzindex<r.gzhead.comment.length?a=r.gzhead.comment.charCodeAt(r.gzindex++)&255:a=0,ue(r,a)}while(a!==0);r.gzhead.hcrc&&r.pending>i&&(t.adler=Ge(t.adler,r.pending_buf,r.pending-i,i))}r.status=vl}if(r.status===vl){if(r.gzhead.hcrc){if(r.pending+2>r.pending_buf_size&&(St(t),r.pending!==0))return r.last_flush=-1,et;ue(r,t.adler&255),ue(r,t.adler>>8&255),t.adler=0}if(r.status=Nn,St(t),r.pending!==0)return r.last_flush=-1,et}if(t.avail_in!==0||r.lookahead!==0||e!==Kr&&r.status!==Ia){let i=r.level===0?a1(r,e):r.strategy===ns?Y0(r,e):r.strategy===R0?Z0(r,e):Oa[r.level].func(r,e);if((i===Bn||i===Ui)&&(r.status=Ia),i===ut||i===Bn)return t.avail_out===0&&(r.last_flush=-1),et;if(i===Mi&&(e===A0?T0(r):e!==Md&&(dl(r,0,0,!1),e===I0&&(qr(r.head),r.lookahead===0&&(r.strstart=0,r.block_start=0,r.insert=0))),St(t),t.avail_out===0))return r.last_flush=-1,et}return e!==Pt?et:r.wrap<=0?Ud:(r.wrap===2?(ue(r,t.adler&255),ue(r,t.adler>>8&255),ue(r,t.adler>>16&255),ue(r,t.adler>>24&255),ue(r,t.total_in&255),ue(r,t.total_in>>8&255),ue(r,t.total_in>>16&255),ue(r,t.total_in>>24&255)):(ga(r,t.adler>>>16),ga(r,t.adler&65535)),St(t),r.wrap>0&&(r.wrap=-r.wrap),r.pending!==0?et:Ud)},n2=t=>{if(eo(t))return ir;let e=t.state.status;return t.state=null,e===Nn?Rn(t,O0):et},i2=(t,e)=>{let r=e.length;if(eo(t))return ir;let n=t.state,i=n.wrap;if(i===2||i===1&&n.status!==Oi||n.lookahead)return ir;if(i===1&&(t.adler=Ga(t.adler,e,r,0)),n.wrap=0,r>=n.w_size){i===0&&(qr(n.head),n.strstart=0,n.block_start=0,n.insert=0);let u=new Uint8Array(n.w_size);u.set(e.subarray(r-n.w_size,r),0),e=u,r=n.w_size}let a=t.avail_in,o=t.next_in,s=t.input;for(t.avail_in=r,t.next_in=0,t.input=e,Di(n);n.lookahead>=te;){let u=n.strstart,c=n.lookahead-(te-1);do n.ins_h=Wr(n,n.ins_h,n.window[u+te-1]),n.prev[u&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=u,u++;while(--c);n.strstart=u,n.lookahead=te-1,Di(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=te-1,n.match_available=0,t.next_in=o,t.input=s,t.avail_in=a,n.wrap=i,et},a2=t2,o2=c1,s2=s1,c2=o1,u2=e2,l2=r2,f2=n2,p2=i2,d2="pako deflate (from Nodeca project)",Fa={deflateInit:a2,deflateInit2:o2,deflateReset:s2,deflateResetKeep:c2,deflateSetHeader:u2,deflate:l2,deflateEnd:f2,deflateSetDictionary:p2,deflateInfo:d2},h2=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),m2=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)h2(r,n)&&(t[n]=r[n])}}return t},g2=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},Ys={assign:m2,flattenChunks:g2},u1=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){u1=!1}var Ha=new Uint8Array(256);for(let t=0;t<256;t++)Ha[t]=t>=252?6:t>=248?5:t>=240?4:t>=224?3:t>=192?2:1;Ha[254]=Ha[254]=1;var y2=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},v2=(t,e)=>{if(e<65534&&t.subarray&&u1)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},b2=(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=Ha[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 v2(a,i)},_2=(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+Ha[t[r]]>e?r:e},Ka={string2buf:y2,buf2string:b2,utf8border:_2};function w2(){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 l1=w2,f1=Object.prototype.toString,{Z_NO_FLUSH:S2,Z_SYNC_FLUSH:x2,Z_FULL_FLUSH:E2,Z_FINISH:C2,Z_OK:$s,Z_STREAM_END:k2,Z_DEFAULT_COMPRESSION:T2,Z_DEFAULT_STRATEGY:A2,Z_DEFLATED:I2}=Wn;function to(t){this.options=Ys.assign({level:T2,method:I2,chunkSize:16384,windowBits:15,memLevel:8,strategy:A2},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 l1,this.strm.avail_out=0;let r=Fa.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(r!==$s)throw new Error(jn[r]);if(e.header&&Fa.deflateSetHeader(this.strm,e.header),e.dictionary){let n;if(typeof e.dictionary=="string"?n=Ka.string2buf(e.dictionary):f1.call(e.dictionary)==="[object ArrayBuffer]"?n=new Uint8Array(e.dictionary):n=e.dictionary,r=Fa.deflateSetDictionary(this.strm,n),r!==$s)throw new Error(jn[r]);this._dict_set=!0}}to.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?C2:S2,typeof t=="string"?r.input=Ka.string2buf(t):f1.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===x2||a===E2)&&r.avail_out<=6){this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;continue}if(i=Fa.deflate(r,a),i===k2)return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),i=Fa.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===$s;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};to.prototype.onData=function(t){this.chunks.push(t)};to.prototype.onEnd=function(t){t===$s&&(this.result=Ys.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function Rl(t,e){let r=new to(e);if(r.push(t,!0),r.err)throw r.msg||jn[r.err];return r.result}function O2(t,e){return e=e||{},e.raw=!0,Rl(t,e)}function D2(t,e){return e=e||{},e.gzip=!0,Rl(t,e)}var N2=to,R2=Rl,P2=O2,L2=D2,F2=Wn,$2={Deflate:N2,deflate:R2,deflateRaw:P2,gzip:L2,constants:F2},is=16209,M2=16191,U2=function t(e,r){let n,i,a,o,s,u,c,l,d,p,f,h,y,v,S,_,b,g,I,R,k,D,F,P,q=e.state;n=e.next_in,F=e.input,i=n+(e.avail_in-5),a=e.next_out,P=e.output,o=a-(r-e.avail_out),s=a+(e.avail_out-257),u=q.dmax,c=q.wsize,l=q.whave,d=q.wnext,p=q.window,f=q.hold,h=q.bits,y=q.lencode,v=q.distcode,S=(1<<q.lenbits)-1,_=(1<<q.distbits)-1;e:do{h<15&&(f+=F[n++]<<h,h+=8,f+=F[n++]<<h,h+=8),b=y[f&S];t:for(;;){if(g=b>>>24,f>>>=g,h-=g,g=b>>>16&255,g===0)P[a++]=b&65535;else if(g&16){I=b&65535,g&=15,g&&(h<g&&(f+=F[n++]<<h,h+=8),I+=f&(1<<g)-1,f>>>=g,h-=g),h<15&&(f+=F[n++]<<h,h+=8,f+=F[n++]<<h,h+=8),b=v[f&_];r:for(;;){if(g=b>>>24,f>>>=g,h-=g,g=b>>>16&255,g&16){if(R=b&65535,g&=15,h<g&&(f+=F[n++]<<h,h+=8,h<g&&(f+=F[n++]<<h,h+=8)),R+=f&(1<<g)-1,R>u){e.msg="invalid distance too far back",q.mode=is;break e}if(f>>>=g,h-=g,g=a-o,R>g){if(g=R-g,g>l&&q.sane){e.msg="invalid distance too far back",q.mode=is;break e}if(k=0,D=p,d===0){if(k+=c-g,g<I){I-=g;do P[a++]=p[k++];while(--g);k=a-R,D=P}}else if(d<g){if(k+=c+d-g,g-=d,g<I){I-=g;do P[a++]=p[k++];while(--g);if(k=0,d<I){g=d,I-=g;do P[a++]=p[k++];while(--g);k=a-R,D=P}}}else if(k+=d-g,g<I){I-=g;do P[a++]=p[k++];while(--g);k=a-R,D=P}for(;I>2;)P[a++]=D[k++],P[a++]=D[k++],P[a++]=D[k++],I-=3;I&&(P[a++]=D[k++],I>1&&(P[a++]=D[k++]))}else{k=a-R;do P[a++]=P[k++],P[a++]=P[k++],P[a++]=P[k++],I-=3;while(I>2);I&&(P[a++]=P[k++],I>1&&(P[a++]=P[k++]))}}else if((g&64)===0){b=v[(b&65535)+(f&(1<<g)-1)];continue r}else{e.msg="invalid distance code",q.mode=is;break e}break}}else if((g&64)===0){b=y[(b&65535)+(f&(1<<g)-1)];continue t}else if(g&32){q.mode=M2;break e}else{e.msg="invalid literal/length code",q.mode=is;break e}break}}while(n<i&&a<s);I=h>>3,n-=I,h-=I<<3,f&=(1<<h)-1,e.next_in=n,e.next_out=a,e.avail_in=n<i?5+(i-n):5-(n-i),e.avail_out=a<s?257+(s-a):257-(a-s),q.hold=f,q.bits=h},xi=15,Bd=852,qd=592,Vd=0,Qu=1,zd=2,j2=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]),B2=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]),q2=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]),V2=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]),z2=(t,e,r,n,i,a,o,s)=>{let u=s.bits,c=0,l=0,d=0,p=0,f=0,h=0,y=0,v=0,S=0,_=0,b,g,I,R,k,D=null,F,P=new Uint16Array(xi+1),q=new Uint16Array(xi+1),We=null,$e,V,ve;for(c=0;c<=xi;c++)P[c]=0;for(l=0;l<n;l++)P[e[r+l]]++;for(f=u,p=xi;p>=1&&P[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&&P[d]===0;d++);for(f<d&&(f=d),v=1,c=1;c<=xi;c++)if(v<<=1,v-=P[c],v<0)return-1;if(v>0&&(t===Vd||p!==1))return-1;for(q[1]=0,c=1;c<xi;c++)q[c+1]=q[c]+P[c];for(l=0;l<n;l++)e[r+l]!==0&&(o[q[e[r+l]]++]=l);if(t===Vd?(D=We=o,F=20):t===Qu?(D=j2,We=B2,F=257):(D=q2,We=V2,F=0),_=0,l=0,c=d,k=a,h=f,y=0,I=-1,S=1<<f,R=S-1,t===Qu&&S>Bd||t===zd&&S>qd)return 1;for(;;){$e=c-y,o[l]+1<F?(V=0,ve=o[l]):o[l]>=F?(V=We[o[l]-F],ve=D[o[l]-F]):(V=32+64,ve=0),b=1<<c-y,g=1<<h,d=g;do g-=b,i[k+(_>>y)+g]=$e<<24|V<<16|ve|0;while(g!==0);for(b=1<<c-1;_&b;)b>>=1;if(b!==0?(_&=b-1,_+=b):_=0,l++,--P[c]===0){if(c===p)break;c=e[r+o[l]]}if(c>f&&(_&R)!==I){for(y===0&&(y=f),k+=d,h=c-y,v=1<<h;h+y<p&&(v-=P[h+y],!(v<=0));)h++,v<<=1;if(S+=1<<h,t===Qu&&S>Bd||t===zd&&S>qd)return 1;I=_&R,i[I]=f<<24|h<<16|k-a|0}}return _!==0&&(i[k+_]=c-y<<24|64<<16|0),s.bits=f,0},$a=z2,Q2=0,p1=1,d1=2,{Z_FINISH:Qd,Z_BLOCK:G2,Z_TREES:as,Z_OK:qn,Z_STREAM_END:H2,Z_NEED_DICT:K2,Z_STREAM_ERROR:Lt,Z_DATA_ERROR:h1,Z_MEM_ERROR:m1,Z_BUF_ERROR:W2,Z_DEFLATED:Gd}=Wn,Js=16180,Hd=16181,Kd=16182,Wd=16183,Zd=16184,Yd=16185,Jd=16186,Xd=16187,eh=16188,th=16189,Ms=16190,gr=16191,Gu=16192,rh=16193,Hu=16194,nh=16195,ih=16196,ah=16197,oh=16198,os=16199,ss=16200,sh=16201,ch=16202,uh=16203,lh=16204,fh=16205,Ku=16206,ph=16207,dh=16208,Ce=16209,g1=16210,y1=16211,Z2=852,Y2=592,J2=15,X2=J2,hh=t=>(t>>>24&255)+(t>>>8&65280)+((t&65280)<<8)+((t&255)<<24);function ev(){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 Zn=t=>{if(!t)return 1;let e=t.state;return!e||e.strm!==t||e.mode<Js||e.mode>y1?1:0},v1=t=>{if(Zn(t))return Lt;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=Js,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(Z2),e.distcode=e.distdyn=new Int32Array(Y2),e.sane=1,e.back=-1,qn},b1=t=>{if(Zn(t))return Lt;let e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,v1(t)},_1=(t,e)=>{let r;if(Zn(t))return Lt;let n=t.state;return e<0?(r=0,e=-e):(r=(e>>4)+5,e<48&&(e&=15)),e&&(e<8||e>15)?Lt:(n.window!==null&&n.wbits!==e&&(n.window=null),n.wrap=r,n.wbits=e,b1(t))},w1=(t,e)=>{if(!t)return Lt;let r=new ev;t.state=r,r.strm=t,r.window=null,r.mode=Js;let n=_1(t,e);return n!==qn&&(t.state=null),n},tv=t=>w1(t,X2),mh=!0,Wu,Zu,rv=t=>{if(mh){Wu=new Int32Array(512),Zu=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(p1,t.lens,0,288,Wu,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;$a(d1,t.lens,0,32,Zu,0,t.work,{bits:5}),mh=!1}t.lencode=Wu,t.lenbits=9,t.distcode=Zu,t.distbits=5},S1=(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},nv=(t,e)=>{let r,n,i,a,o,s,u,c,l,d,p,f,h,y,v=0,S,_,b,g,I,R,k,D,F=new Uint8Array(4),P,q,We=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Zn(t)||!t.output||!t.input&&t.avail_in!==0)return Lt;r=t.state,r.mode===gr&&(r.mode=Gu),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,D=qn;e:for(;;)switch(r.mode){case Js:if(r.wrap===0){r.mode=Gu;break}for(;l<16;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(r.wrap&2&&c===35615){r.wbits===0&&(r.wbits=15),r.check=0,F[0]=c&255,F[1]=c>>>8&255,r.check=Ge(r.check,F,2,0),c=0,l=0,r.mode=Hd;break}if(r.head&&(r.head.done=!1),!(r.wrap&1)||(((c&255)<<8)+(c>>8))%31){t.msg="incorrect header check",r.mode=Ce;break}if((c&15)!==Gd){t.msg="unknown compression method",r.mode=Ce;break}if(c>>>=4,l-=4,k=(c&15)+8,r.wbits===0&&(r.wbits=k),k>15||k>r.wbits){t.msg="invalid window size",r.mode=Ce;break}r.dmax=1<<r.wbits,r.flags=0,t.adler=r.check=1,r.mode=c&512?th:gr,c=0,l=0;break;case Hd:for(;l<16;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(r.flags=c,(r.flags&255)!==Gd){t.msg="unknown compression method",r.mode=Ce;break}if(r.flags&57344){t.msg="unknown header flags set",r.mode=Ce;break}r.head&&(r.head.text=c>>8&1),r.flags&512&&r.wrap&4&&(F[0]=c&255,F[1]=c>>>8&255,r.check=Ge(r.check,F,2,0)),c=0,l=0,r.mode=Kd;case Kd:for(;l<32;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}r.head&&(r.head.time=c),r.flags&512&&r.wrap&4&&(F[0]=c&255,F[1]=c>>>8&255,F[2]=c>>>16&255,F[3]=c>>>24&255,r.check=Ge(r.check,F,4,0)),c=0,l=0,r.mode=Wd;case Wd:for(;l<16;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}r.head&&(r.head.xflags=c&255,r.head.os=c>>8),r.flags&512&&r.wrap&4&&(F[0]=c&255,F[1]=c>>>8&255,r.check=Ge(r.check,F,2,0)),c=0,l=0,r.mode=Zd;case Zd:if(r.flags&1024){for(;l<16;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}r.length=c,r.head&&(r.head.extra_len=c),r.flags&512&&r.wrap&4&&(F[0]=c&255,F[1]=c>>>8&255,r.check=Ge(r.check,F,2,0)),c=0,l=0}else r.head&&(r.head.extra=null);r.mode=Yd;case Yd:if(r.flags&1024&&(f=r.length,f>s&&(f=s),f&&(r.head&&(k=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),k)),r.flags&512&&r.wrap&4&&(r.check=Ge(r.check,n,f,a)),s-=f,a+=f,r.length-=f),r.length))break e;r.length=0,r.mode=Jd;case Jd:if(r.flags&2048){if(s===0)break e;f=0;do k=n[a+f++],r.head&&k&&r.length<65536&&(r.head.name+=String.fromCharCode(k));while(k&&f<s);if(r.flags&512&&r.wrap&4&&(r.check=Ge(r.check,n,f,a)),s-=f,a+=f,k)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=Xd;case Xd:if(r.flags&4096){if(s===0)break e;f=0;do k=n[a+f++],r.head&&k&&r.length<65536&&(r.head.comment+=String.fromCharCode(k));while(k&&f<s);if(r.flags&512&&r.wrap&4&&(r.check=Ge(r.check,n,f,a)),s-=f,a+=f,k)break e}else r.head&&(r.head.comment=null);r.mode=eh;case eh: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=Ce;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=gr;break;case th:for(;l<32;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}t.adler=r.check=hh(c),c=0,l=0,r.mode=Ms;case Ms:if(r.havedict===0)return t.next_out=o,t.avail_out=u,t.next_in=a,t.avail_in=s,r.hold=c,r.bits=l,K2;t.adler=r.check=1,r.mode=gr;case gr:if(e===G2||e===as)break e;case Gu: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=rh;break;case 1:if(rv(r),r.mode=os,e===as){c>>>=2,l-=2;break e}break;case 2:r.mode=ih;break;case 3:t.msg="invalid block type",r.mode=Ce}c>>>=2,l-=2;break;case rh: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=Ce;break}if(r.length=c&65535,c=0,l=0,r.mode=Hu,e===as)break e;case Hu:r.mode=nh;case nh: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=gr;break;case ih: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=Ce;break}r.have=0,r.mode=ah;case ah:for(;r.have<r.ncode;){for(;l<3;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}r.lens[We[r.have++]]=c&7,c>>>=3,l-=3}for(;r.have<19;)r.lens[We[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,P={bits:r.lenbits},D=$a(Q2,r.lens,0,19,r.lencode,0,r.work,P),r.lenbits=P.bits,D){t.msg="invalid code lengths set",r.mode=Ce;break}r.have=0,r.mode=oh;case oh:for(;r.have<r.nlen+r.ndist;){for(;v=r.lencode[c&(1<<r.lenbits)-1],S=v>>>24,_=v>>>16&255,b=v&65535,!(S<=l);){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(b<16)c>>>=S,l-=S,r.lens[r.have++]=b;else{if(b===16){for(q=S+2;l<q;){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=Ce;break}k=r.lens[r.have-1],f=3+(c&3),c>>>=2,l-=2}else if(b===17){for(q=S+3;l<q;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}c>>>=S,l-=S,k=0,f=3+(c&7),c>>>=3,l-=3}else{for(q=S+7;l<q;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}c>>>=S,l-=S,k=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=Ce;break}for(;f--;)r.lens[r.have++]=k}}if(r.mode===Ce)break;if(r.lens[256]===0){t.msg="invalid code -- missing end-of-block",r.mode=Ce;break}if(r.lenbits=9,P={bits:r.lenbits},D=$a(p1,r.lens,0,r.nlen,r.lencode,0,r.work,P),r.lenbits=P.bits,D){t.msg="invalid literal/lengths set",r.mode=Ce;break}if(r.distbits=6,r.distcode=r.distdyn,P={bits:r.distbits},D=$a(d1,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,P),r.distbits=P.bits,D){t.msg="invalid distances set",r.mode=Ce;break}if(r.mode=os,e===as)break e;case os:r.mode=ss;case ss: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,U2(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===gr&&(r.back=-1);break}for(r.back=0;v=r.lencode[c&(1<<r.lenbits)-1],S=v>>>24,_=v>>>16&255,b=v&65535,!(S<=l);){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(_&&(_&240)===0){for(g=S,I=_,R=b;v=r.lencode[R+((c&(1<<g+I)-1)>>g)],S=v>>>24,_=v>>>16&255,b=v&65535,!(g+S<=l);){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}c>>>=g,l-=g,r.back+=g}if(c>>>=S,l-=S,r.back+=S,r.length=b,_===0){r.mode=fh;break}if(_&32){r.back=-1,r.mode=gr;break}if(_&64){t.msg="invalid literal/length code",r.mode=Ce;break}r.extra=_&15,r.mode=sh;case sh:if(r.extra){for(q=r.extra;l<q;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}r.length+=c&(1<<r.extra)-1,c>>>=r.extra,l-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=ch;case ch:for(;v=r.distcode[c&(1<<r.distbits)-1],S=v>>>24,_=v>>>16&255,b=v&65535,!(S<=l);){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if((_&240)===0){for(g=S,I=_,R=b;v=r.distcode[R+((c&(1<<g+I)-1)>>g)],S=v>>>24,_=v>>>16&255,b=v&65535,!(g+S<=l);){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}c>>>=g,l-=g,r.back+=g}if(c>>>=S,l-=S,r.back+=S,_&64){t.msg="invalid distance code",r.mode=Ce;break}r.offset=b,r.extra=_&15,r.mode=uh;case uh:if(r.extra){for(q=r.extra;l<q;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}r.offset+=c&(1<<r.extra)-1,c>>>=r.extra,l-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){t.msg="invalid distance too far back",r.mode=Ce;break}r.mode=lh;case lh: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=Ce;break}f>r.wnext?(f-=r.wnext,h=r.wsize-f):h=r.wnext-f,f>r.length&&(f=r.length),y=r.window}else y=i,h=o-r.offset,f=r.length;f>u&&(f=u),u-=f,r.length-=f;do i[o++]=y[h++];while(--f);r.length===0&&(r.mode=ss);break;case fh:if(u===0)break e;i[o++]=r.length,u--,r.mode=ss;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?Ge(r.check,i,p,o-p):Ga(r.check,i,p,o-p)),p=u,r.wrap&4&&(r.flags?c:hh(c))!==r.check){t.msg="incorrect data check",r.mode=Ce;break}c=0,l=0}r.mode=ph;case ph: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=Ce;break}c=0,l=0}r.mode=dh;case dh:D=H2;break e;case Ce:D=h1;break e;case g1:return m1;case y1:default:return Lt}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<Ce&&(r.mode<Ku||e!==Qd))&&S1(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?Ge(r.check,i,p,t.next_out-p):Ga(r.check,i,p,t.next_out-p)),t.data_type=r.bits+(r.last?64:0)+(r.mode===gr?128:0)+(r.mode===os||r.mode===Hu?256:0),(d===0&&p===0||e===Qd)&&D===qn&&(D=W2),D},iv=t=>{if(Zn(t))return Lt;let e=t.state;return e.window&&(e.window=null),t.state=null,qn},av=(t,e)=>{if(Zn(t))return Lt;let r=t.state;return(r.wrap&2)===0?Lt:(r.head=e,e.done=!1,qn)},ov=(t,e)=>{let r=e.length,n,i,a;return Zn(t)||(n=t.state,n.wrap!==0&&n.mode!==Ms)?Lt:n.mode===Ms&&(i=1,i=Ga(i,e,r,0),i!==n.check)?h1:(a=S1(t,e,r,r),a?(n.mode=g1,m1):(n.havedict=1,qn))},sv=b1,cv=_1,uv=v1,lv=tv,fv=w1,pv=nv,dv=iv,hv=av,mv=ov,gv="pako inflate (from Nodeca project)",_r={inflateReset:sv,inflateReset2:cv,inflateResetKeep:uv,inflateInit:lv,inflateInit2:fv,inflate:pv,inflateEnd:dv,inflateGetHeader:hv,inflateSetDictionary:mv,inflateInfo:gv};function yv(){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 vv=yv,x1=Object.prototype.toString,{Z_NO_FLUSH:bv,Z_FINISH:_v,Z_OK:Wa,Z_STREAM_END:Yu,Z_NEED_DICT:Ju,Z_STREAM_ERROR:wv,Z_DATA_ERROR:gh,Z_MEM_ERROR:Sv}=Wn;function ro(t){this.options=Ys.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 l1,this.strm.avail_out=0;let r=_r.inflateInit2(this.strm,e.windowBits);if(r!==Wa)throw new Error(jn[r]);if(this.header=new vv,_r.inflateGetHeader(this.strm,this.header),e.dictionary&&(typeof e.dictionary=="string"?e.dictionary=Ka.string2buf(e.dictionary):x1.call(e.dictionary)==="[object ArrayBuffer]"&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(r=_r.inflateSetDictionary(this.strm,e.dictionary),r!==Wa)))throw new Error(jn[r])}ro.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?_v:bv,x1.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=_r.inflate(r,o),a===Ju&&i&&(a=_r.inflateSetDictionary(r,i),a===Wa?a=_r.inflate(r,o):a===gh&&(a=Ju));r.avail_in>0&&a===Yu&&r.state.wrap>0&&t[r.next_in]!==0;)_r.inflateReset(r),a=_r.inflate(r,o);switch(a){case wv:case gh:case Ju:case Sv:return this.onEnd(a),this.ended=!0,!1}if(s=r.avail_out,r.next_out&&(r.avail_out===0||a===Yu))if(this.options.to==="string"){let u=Ka.utf8border(r.output,r.next_out),c=r.next_out-u,l=Ka.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===Wa&&s===0)){if(a===Yu)return a=_r.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,!0;if(r.avail_in===0)break}}return!0};ro.prototype.onData=function(t){this.chunks.push(t)};ro.prototype.onEnd=function(t){t===Wa&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Ys.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function Pl(t,e){let r=new ro(e);if(r.push(t),r.err)throw r.msg||jn[r.err];return r.result}function xv(t,e){return e=e||{},e.raw=!0,Pl(t,e)}var Ev=ro,Cv=Pl,kv=xv,Tv=Pl,Av=Wn,Iv={Inflate:Ev,inflate:Cv,inflateRaw:kv,ungzip:Tv,constants:Av},{Deflate:Ov,deflate:Dv,deflateRaw:Nv,gzip:Rv}=$2,{Inflate:Pv,inflate:Lv,inflateRaw:Fv,ungzip:$v}=Iv,Mv=Ov,Uv=Dv,jv=Nv,Bv=Rv,qv=Pv,Vv=Lv,zv=Fv,Qv=$v,Gv=Wn,Hv={Deflate:Mv,deflate:Uv,deflateRaw:jv,gzip:Bv,Inflate:qv,inflate:Vv,inflateRaw:zv,ungzip:Qv,constants:Gv},we=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},Se=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Us=class{constructor(e,r){this.input=e,this.output=r}};we([m(),Se("design:type",String)],Us.prototype,"input",void 0);we([m(),Se("design:type",String)],Us.prototype,"output",void 0);Us=we([Ke(),Se("design:paramtypes",[String,String])],Us);var js=class{constructor(e,r){this.input=e,this.output=r}};we([m(),Se("design:type",String)],js.prototype,"input",void 0);we([m(),Se("design:type",String)],js.prototype,"output",void 0);js=we([H(),Se("design:paramtypes",[String,String])],js);var en=class{constructor(e,r,n,i,a){this.name=e,this.modelId=r,this.systemPrompt=n,this.promptExamples=i,this.metaData=a}};we([m(),Se("design:type",String)],en.prototype,"name",void 0);we([m(),Se("design:type",String)],en.prototype,"modelId",void 0);we([m(),Se("design:type",String)],en.prototype,"systemPrompt",void 0);we([m(),Se("design:type",Array)],en.prototype,"promptExamples",void 0);we([m(),Se("design:type",String)],en.prototype,"metaData",void 0);en=we([Ke(),Se("design:paramtypes",[String,String,String,Array,String])],en);var sr=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}};we([m(),Se("design:type",String)],sr.prototype,"name",void 0);we([m(),Se("design:type",String)],sr.prototype,"modelId",void 0);we([m(),Se("design:type",String)],sr.prototype,"taskId",void 0);we([m(),Se("design:type",String)],sr.prototype,"systemPrompt",void 0);we([m(),Se("design:type",Array)],sr.prototype,"promptExamples",void 0);we([m(),Se("design:type",String)],sr.prototype,"metaData",void 0);we([m(),Se("design:type",String)],sr.prototype,"createdAt",void 0);we([m(),Se("design:type",String)],sr.prototype,"updatedAt",void 0);sr=we([H(),Se("design:paramtypes",[String,String,String,String,Array,String,String,String])],sr);var Vn=class{constructor(e,r,n,i,a){this.model=e,this.status=r,this.progress=n,this.downloaded=i,this.loaded=a}};we([m(),Se("design:type",String)],Vn.prototype,"model",void 0);we([m(),Se("design:type",String)],Vn.prototype,"status",void 0);we([m(),Se("design:type",Number)],Vn.prototype,"progress",void 0);we([m(),Se("design:type",Boolean)],Vn.prototype,"downloaded",void 0);we([m(),Se("design:type",Boolean)],Vn.prototype,"loaded",void 0);Vn=we([H(),Se("design:paramtypes",[String,String,Number,Boolean,Boolean])],Vn);var Kv=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)},je,bs,_l=class{constructor(e,r=!0){je.set(this,void 0),bs.set(this,new Map),Kv(this,je,e,"f")}async getModels(){let e=await qe(this,je,"f").query({query:C`
|
|
651
675
|
query {
|
|
652
676
|
aiGetModels {
|
|
653
677
|
id
|
|
@@ -671,23 +695,23 @@ triggerMatch
|
|
|
671
695
|
modelType
|
|
672
696
|
}
|
|
673
697
|
}
|
|
674
|
-
`});return
|
|
698
|
+
`});return A(e).aiGetModels}async addModel(e){let r=await qe(this,je,"f").mutate({mutation:C`
|
|
675
699
|
mutation($model: ModelInput!) {
|
|
676
700
|
aiAddModel(model: $model)
|
|
677
701
|
}
|
|
678
|
-
`,variables:{model:e}});return
|
|
702
|
+
`,variables:{model:e}});return A(r).aiAddModel}async updateModel(e,r){let n=await qe(this,je,"f").mutate({mutation:C`
|
|
679
703
|
mutation($modelId: String!, $model: ModelInput!) {
|
|
680
704
|
aiUpdateModel(modelId: $modelId, model: $model)
|
|
681
705
|
}
|
|
682
|
-
`,variables:{modelId:e,model:r}});return
|
|
706
|
+
`,variables:{modelId:e,model:r}});return A(n).aiUpdateModel}async removeModel(e){let r=await qe(this,je,"f").mutate({mutation:C`
|
|
683
707
|
mutation($modelId: String!) {
|
|
684
708
|
aiRemoveModel(modelId: $modelId)
|
|
685
709
|
}
|
|
686
|
-
`,variables:{modelId:e}});return
|
|
710
|
+
`,variables:{modelId:e}});return A(r).aiRemoveModel}async setDefaultModel(e,r){let n=await qe(this,je,"f").mutate({mutation:C`
|
|
687
711
|
mutation($modelType: ModelType!, $modelId: String!) {
|
|
688
712
|
aiSetDefaultModel(modelType: $modelType modelId: $modelId)
|
|
689
713
|
}
|
|
690
|
-
`,variables:{modelId:r,modelType:e}});return
|
|
714
|
+
`,variables:{modelId:r,modelType:e}});return A(n).aiSetDefaultModel}async getDefaultModel(e){let r=await qe(this,je,"f").query({query:C`
|
|
691
715
|
query($modelType: ModelType!) {
|
|
692
716
|
aiGetDefaultModel(modelType: $modelType) {
|
|
693
717
|
id
|
|
@@ -711,7 +735,7 @@ triggerMatch
|
|
|
711
735
|
modelType
|
|
712
736
|
}
|
|
713
737
|
}
|
|
714
|
-
`,variables:{modelType:e}});return
|
|
738
|
+
`,variables:{modelType:e}});return A(r).aiGetDefaultModel}async tasks(){let{aiTasks:e}=A(await qe(this,je,"f").query({query:C`
|
|
715
739
|
query {
|
|
716
740
|
aiTasks {
|
|
717
741
|
name
|
|
@@ -727,7 +751,7 @@ triggerMatch
|
|
|
727
751
|
updatedAt
|
|
728
752
|
}
|
|
729
753
|
}
|
|
730
|
-
`}));return e}async addTask(e,r,n,i,a){let o=new
|
|
754
|
+
`}));return e}async addTask(e,r,n,i,a){let o=new en(e,r,n,i,a),{aiAddTask:s}=A(await qe(this,je,"f").mutate({mutation:C`
|
|
731
755
|
mutation AiAddTask($task: AITaskInput!) {
|
|
732
756
|
aiAddTask(task: $task) {
|
|
733
757
|
name
|
|
@@ -743,7 +767,7 @@ triggerMatch
|
|
|
743
767
|
updatedAt
|
|
744
768
|
}
|
|
745
769
|
}
|
|
746
|
-
`,variables:{task:o}}));return s}async removeTask(e){let{aiRemoveTask:r}=
|
|
770
|
+
`,variables:{task:o}}));return s}async removeTask(e){let{aiRemoveTask:r}=A(await qe(this,je,"f").mutate({mutation:C`
|
|
747
771
|
mutation AiRemoveTask($taskId: String!) {
|
|
748
772
|
aiRemoveTask(taskId: $taskId) {
|
|
749
773
|
name
|
|
@@ -759,7 +783,7 @@ triggerMatch
|
|
|
759
783
|
updatedAt
|
|
760
784
|
}
|
|
761
785
|
}
|
|
762
|
-
`,variables:{taskId:e}}));return r}async updateTask(e,r){let{aiUpdateTask:n}=
|
|
786
|
+
`,variables:{taskId:e}}));return r}async updateTask(e,r){let{aiUpdateTask:n}=A(await qe(this,je,"f").mutate({mutation:C`
|
|
763
787
|
mutation AiUpdateTask($taskId: String!, $task: AITaskInput!) {
|
|
764
788
|
aiUpdateTask(taskId: $taskId, task: $task) {
|
|
765
789
|
name
|
|
@@ -775,7 +799,7 @@ triggerMatch
|
|
|
775
799
|
updatedAt
|
|
776
800
|
}
|
|
777
801
|
}
|
|
778
|
-
`,variables:{taskId:e,task:{name:r.name,modelId:r.modelId,systemPrompt:r.systemPrompt,promptExamples:r.promptExamples}}}));return n}async modelLoadingStatus(e){let{aiModelLoadingStatus:r}=
|
|
802
|
+
`,variables:{taskId:e,task:{name:r.name,modelId:r.modelId,systemPrompt:r.systemPrompt,promptExamples:r.promptExamples}}}));return n}async modelLoadingStatus(e){let{aiModelLoadingStatus:r}=A(await qe(this,je,"f").query({query:C`
|
|
779
803
|
query AiModelLoadingStatus($model: String!) {
|
|
780
804
|
aiModelLoadingStatus(model: $model) {
|
|
781
805
|
model
|
|
@@ -785,51 +809,51 @@ triggerMatch
|
|
|
785
809
|
downloaded
|
|
786
810
|
}
|
|
787
811
|
}
|
|
788
|
-
`,variables:{model:e}}));return r}async prompt(e,r){let{aiPrompt:n}=
|
|
812
|
+
`,variables:{model:e}}));return r}async prompt(e,r){let{aiPrompt:n}=A(await qe(this,je,"f").mutate({mutation:C`
|
|
789
813
|
mutation AiPrompt($taskId: String!, $prompt: String!) {
|
|
790
814
|
aiPrompt(taskId: $taskId, prompt: $prompt)
|
|
791
815
|
}
|
|
792
|
-
`,variables:{taskId:e,prompt:r}}));return n}async embed(e,r){let{aiEmbed:n}=
|
|
816
|
+
`,variables:{taskId:e,prompt:r}}));return n}async embed(e,r){let{aiEmbed:n}=A(await qe(this,je,"f").mutate({mutation:C`
|
|
793
817
|
mutation aiEmbed($modelId: String!, $text: String!) {
|
|
794
818
|
aiEmbed(modelId: $modelId, text: $text)
|
|
795
819
|
}
|
|
796
|
-
`,variables:{modelId:e,text:r}})),i=
|
|
797
|
-
mutation AiOpenTranscriptionStream($modelId: String
|
|
798
|
-
aiOpenTranscriptionStream(modelId: $modelId)
|
|
820
|
+
`,variables:{modelId:e,text:r}})),i=Ws.toByteArray(n);return JSON.parse(Hv.inflate(i,{to:"string"}))}async openTranscriptionStream(e,r,n){let{aiOpenTranscriptionStream:i}=A(await qe(this,je,"f").mutate({mutation:C`
|
|
821
|
+
mutation AiOpenTranscriptionStream($modelId: String!, $params: VoiceActivityParamsInput) {
|
|
822
|
+
aiOpenTranscriptionStream(modelId: $modelId, params: $params)
|
|
799
823
|
}
|
|
800
|
-
`,variables:{modelId:e}})),
|
|
801
|
-
aiTranscriptionText(streamId: "${
|
|
802
|
-
}`}).subscribe({next(
|
|
824
|
+
`,variables:{modelId:e,params:n}})),a=qe(this,je,"f").subscribe({query:C` subscription {
|
|
825
|
+
aiTranscriptionText(streamId: "${i}")
|
|
826
|
+
}`}).subscribe({next(o){return r(o.data.aiTranscriptionText),o.data.aiTranscriptionText},error(o){console.error(o)}});return qe(this,bs,"f").set(i,a),i}async closeTranscriptionStream(e){let{aiCloseTranscriptionStream:r}=A(await qe(this,je,"f").mutate({mutation:C`
|
|
803
827
|
mutation aiCloseTranscriptionStream($streamId: String!) {
|
|
804
828
|
aiCloseTranscriptionStream(streamId: $streamId)
|
|
805
829
|
}
|
|
806
|
-
`,variables:{streamId:e}})),n=
|
|
830
|
+
`,variables:{streamId:e}})),n=qe(this,bs,"f").get(e);return n.closed||n.unsubscribe(),r}async feedTranscriptionStream(e,r){let{feedTranscriptionStream:n}=A(await qe(this,je,"f").mutate({mutation:C`
|
|
807
831
|
mutation AiFeedTranscriptionStream($streamId: String!, $audio: [Float!]!) {
|
|
808
832
|
aiFeedTranscriptionStream(streamId: $streamId, audio: $audio)
|
|
809
833
|
}
|
|
810
|
-
`,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
|
-
`;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
|
|
812
|
-
`,{through:
|
|
813
|
-
`,
|
|
814
|
-
`),
|
|
815
|
-
`:
|
|
816
|
-
`,
|
|
817
|
-
`;else if(
|
|
818
|
-
`}c.push(
|
|
819
|
-
`,{through:
|
|
820
|
-
`}else
|
|
821
|
-
`;let
|
|
822
|
-
`,
|
|
823
|
-
`,
|
|
824
|
-
`}d.push(
|
|
834
|
+
`,variables:{streamId:e,audio:r}}));return n}};je=new WeakMap,bs=new WeakMap;var Br=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},Ue=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)},er,_s,Da,ws,Na,In,Ss,Ra,Bs=class{constructor(e,r=!0){er.set(this,void 0),_s.set(this,void 0),Da.set(this,void 0),ws.set(this,void 0),Na.set(this,void 0),In.set(this,void 0),Ss.set(this,void 0),Ra.set(this,void 0),Br(this,er,e,"f"),Br(this,_s,new Ba(Ue(this,er,"f"),r),"f"),Br(this,Da,new ll(Ue(this,er,"f")),"f"),Br(this,ws,new sl(Ue(this,er,"f")),"f"),Br(this,Na,new cl(Ue(this,er,"f")),"f"),Br(this,Ra,new _l(Ue(this,er,"f"),r),"f"),Br(this,In,new Ls(Ue(this,er,"f"),r),"f"),Ue(this,In,"f").setExpressionClient(Ue(this,Da,"f")),Ue(this,In,"f").setNeighbourhoodClient(Ue(this,Na,"f")),Ue(this,In,"f").setAIClient(Ue(this,Ra,"f")),Br(this,Ss,new ul(Ue(this,er,"f"),r),"f")}get agent(){return Ue(this,_s,"f")}get expression(){return Ue(this,Da,"f")}get languages(){return Ue(this,ws,"f")}get neighbourhood(){return Ue(this,Na,"f")}get perspective(){return Ue(this,In,"f")}get runtime(){return Ue(this,Ss,"f")}get ai(){return Ue(this,Ra,"f")}};er=new WeakMap,_s=new WeakMap,Da=new WeakMap,ws=new WeakMap,Na=new WeakMap,In=new WeakMap,Ss=new WeakMap,Ra=new WeakMap;var wl;(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"})(wl||(wl={}));var Ll=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},Fl=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Pn=class{constructor(e,r){this.language=e,this.expression=r}};Ll([m(),Fl("design:type",nr)],Pn.prototype,"language",void 0);Ll([m(),Fl("design:type",String)],Pn.prototype,"expression",void 0);Pn=Ll([H(),Fl("design:paramtypes",[nr,String])],Pn);function pw(t){return t.language.address==="did"?t.expression.toString():`${t.language.address}://${t.expression}`}function dw(t){if(t.startsWith("literal://")){let a=new nr;a.address="literal",a.name="literal";let o=t.substring(10);return new Pn(a,o)}let r=/^([^:^\s]+):\/\/([\s\S]+)$/.exec(t);if(r&&r.length==3){let a=r[1],o=r[2],s=new nr;return s.address=a,new Pn(s,o)}let i=/^did:([^\s]+)$/.exec(t);if(i&&i.length==2){let a=new nr;return a.address="did",new Pn(a,t)}throw new Error("Couldn't parse string as expression URL or DID: "+t)}var At=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},ur=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},qs=class{};At([m(),ur("design:type",String)],qs.prototype,"name",void 0);At([m(),ur("design:type",String)],qs.prototype,"type",void 0);qs=At([H()],qs);var Za=class{};At([m(),ur("design:type",String)],Za.prototype,"label",void 0);At([m(),ur("design:type",String)],Za.prototype,"name",void 0);At([m(),ur("design:type",Array)],Za.prototype,"parameters",void 0);Za=At([H()],Za);var Vs=class{get parameters(){return JSON.parse(this.parametersStringified)}constructor(e,r){this.name=e,this.parametersStringified=JSON.stringify(r)}};At([m(),ur("design:type",String)],Vs.prototype,"name",void 0);At([m(),ur("design:type",String)],Vs.prototype,"parametersStringified",void 0);Vs=At([Ke(),ur("design:paramtypes",[String,Object])],Vs);var zs=class{};At([m(),ur("design:type",String)],zs.prototype,"did",void 0);At([m(),ur("design:type",Un)],zs.prototype,"status",void 0);zs=At([H()],zs);var yh=class{},Yn=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},ji=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},tn=class{};Yn([m(),ji("design:type",String)],tn.prototype,"name",void 0);Yn([m(),ji("design:type",String)],tn.prototype,"address",void 0);Yn([m(),ji("design:type",String)],tn.prototype,"settings",void 0);Yn([m(),ji("design:type",Fn)],tn.prototype,"icon",void 0);Yn([m(),ji("design:type",Fn)],tn.prototype,"constructorIcon",void 0);Yn([m(),ji("design:type",Fn)],tn.prototype,"settingsIcon",void 0);tn=Yn([H()],tn);var lt=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)},Gt=class{};lt([m(),yt("design:type",String)],Gt.prototype,"name",void 0);lt([m(),yt("design:type",String)],Gt.prototype,"address",void 0);lt([m(),yt("design:type",String)],Gt.prototype,"description",void 0);lt([m(),yt("design:type",String)],Gt.prototype,"author",void 0);lt([m(),yt("design:type",Boolean)],Gt.prototype,"templated",void 0);lt([m(),yt("design:type",String)],Gt.prototype,"templateSourceLanguageAddress",void 0);lt([m(),yt("design:type",String)],Gt.prototype,"templateAppliedParams",void 0);lt([m(),yt("design:type",Array)],Gt.prototype,"possibleTemplateParams",void 0);lt([m(),yt("design:type",String)],Gt.prototype,"sourceCodeLink",void 0);Gt=lt([H()],Gt);var Ni=class{constructor(e,r){this.name=e,this.description=r,this.description||(this.description="")}};lt([m(),yt("design:type",String)],Ni.prototype,"name",void 0);lt([m(),yt("design:type",String)],Ni.prototype,"description",void 0);lt([m(),yt("design:type",Array)],Ni.prototype,"possibleTemplateParams",void 0);lt([m(),yt("design:type",String)],Ni.prototype,"sourceCodeLink",void 0);Ni=lt([Ke(),yt("design:paramtypes",[String,String])],Ni);var vh=class{},bh=class extends nn(){},_h=class{},Xs=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},$l=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Qs=class{constructor(e,r){this.linkLanguage=e,this.meta=r}};Xs([m(),$l("design:type",String)],Qs.prototype,"linkLanguage",void 0);Xs([m(),$l("design:type",or)],Qs.prototype,"meta",void 0);Qs=Xs([H(),$l("design:paramtypes",[String,or])],Qs);var Sl=class extends nn(){};Sl=Xs([H()],Sl);var Bi=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},qi=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},xl;(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"})(xl||(xl={}));var zn=class{constructor(e,r,n){this.uuid=e,this.name=r,n?this.state=n:this.state=xl.Private}};Bi([m(),qi("design:type",String)],zn.prototype,"uuid",void 0);Bi([m(),qi("design:type",String)],zn.prototype,"name",void 0);Bi([m(),qi("design:type",String)],zn.prototype,"state",void 0);Bi([m(),qi("design:type",String)],zn.prototype,"sharedUrl",void 0);Bi([m(),qi("design:type",Sl)],zn.prototype,"neighbourhood",void 0);zn=Bi([H(),qi("design:paramtypes",[String,String,String])],zn);var ec=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},E1=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Gs=class{};ec([m(),E1("design:type",Array)],Gs.prototype,"additions",void 0);ec([m(),E1("design:type",Array)],Gs.prototype,"removals",void 0);Gs=ec([H()],Gs);var wh=class extends nn(){};wh=ec([H()],wh);var Sh=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Ei=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Pa,On,cs="smart_literal://content";function Wv(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 Ya=class{constructor(e,r){Pa.set(this,void 0),On.set(this,void 0),Sh(this,Pa,e,"f"),Sh(this,On,r,"f")}get base(){return Ei(this,On,"f")}static async create(e,r){let n=Qt.from(Wv(10)).toUrl(),i=new Ya(e,n);return await i.set(r),i}static async isSmartLiteralBase(e,r){return(await e.get(new Ct({source:r,predicate:cs}))).length>0}static async getAllSmartLiterals(e){return(await e.get(new Ct({predicate:cs}))).map(n=>new Ya(e,n.data.source))}async get(){let e=await Ei(this,Pa,"f").getSingleTarget(new Ct({source:Ei(this,On,"f"),predicate:cs}));if(!e)throw`No content for smart literal ${Ei(this,On,"f")}`;return Qt.fromUrl(e).get()}async set(e){let r=Qt.from(e);await Ei(this,Pa,"f").setSingleTarget(new Mn({source:Ei(this,On,"f"),predicate:cs,target:r.toUrl()}))}};Pa=new WeakMap,On=new WeakMap;var xh=class{};function kw(t,e,r){return{action:"addLink",source:t,predicate:e,target:r}}function Tw(t){return`triple(this, "${t}", _)`}function Aw(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 Ps(a,d,s);await p.init(),o.push(p)}return o}}}function Iw(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${Gr(n)}`]=()=>{}}Object.defineProperty(e,r,{configurable:!0,writable:!0})}}function Ow(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 Dw(t){return function(e,r){e.__collections=e.__collections||{},e.__collections[r]=t;let n=r;e[`add${Gr(n)}`]=()=>{},e[`remove${Gr(n)}`]=()=>{},e[`setCollection${Gr(n)}`]=()=>{},Object.defineProperty(e,r,{configurable:!0,writable:!0})}}function C1(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 Nw(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=C1(8);r+=`subject_class("${n}", ${a}).
|
|
835
|
+
`;let o=[],s=[];i.subjectConstructor&&i.subjectConstructor.length&&(s=s.concat(i.subjectConstructor));let u=[];i.isSubjectInstance&&i.isSubjectInstance.length&&(u=u.concat(i.isSubjectInstance));let c=[],l=i.__properties||{};for(let h in l){let y=`property(${a}, "${h}").
|
|
836
|
+
`,{through:v,initial:S,required:_,resolveLanguage:b,writable:g,flag:I,getter:R,setter:k,local:D}=l[h];if(b&&(y+=`property_resolve(${a}, "${h}").
|
|
837
|
+
`,y+=`property_resolve_language(${a}, "${h}", "${b}").
|
|
838
|
+
`),R?y+=`property_getter(${a}, Base, "${h}", Value) :- ${R}.
|
|
839
|
+
`:v&&(y+=`property_getter(${a}, Base, "${h}", Value) :- triple(Base, "${v}", Value).
|
|
840
|
+
`,_&&(I?u.push(`triple(Base, "${v}", "${S}")`):u.push(`triple(Base, "${v}", _)`))),k)y+=`property_setter(${a}, "${h}", Actions) :- ${k}.
|
|
841
|
+
`;else if(g&&typeof i[Uh(h)]=="function"){let P=[{action:"setSingleTarget",source:"this",predicate:v,target:"value",...D&&{local:!0}}];y+=`property_setter(${a}, "${h}", '${En(P)}').
|
|
842
|
+
`}c.push(y),S&&(s.push({action:"addLink",source:"this",predicate:v,target:S}),o.push({action:"removeLink",source:"this",predicate:v,target:S}))}let d=[],p=i.__collections||{};for(let h in p){let y=`collection(${a}, "${h}").
|
|
843
|
+
`,{through:v,where:S,local:_}=p[h];if(v){if(S){if(!S.isInstance&&!S.condition)throw"'where' needs one of 'isInstance' or 'condition'";let R=[];if(S.isInstance){let D;S.isInstance.name?D=S.isInstance.name:D=S.isInstance,R.push(`instance(OtherClass, Target), subject_class("${D}", OtherClass)`)}S.condition&&R.push(S.condition);let k=R.join(", ");y+=`collection_getter(${a}, Base, "${h}", List) :- setof(Target, (triple(Base, "${v}", Target), ${k}), List).
|
|
844
|
+
`}else y+=`collection_getter(${a}, Base, "${h}", List) :- findall(C, triple(Base, "${v}", C), List).
|
|
845
|
+
`;let b=[{action:"addLink",source:"this",predicate:v,target:"value",..._&&{local:!0}}],g=[{action:"removeLink",source:"this",predicate:v,target:"value"}],I=[{action:"collectionSetter",source:"this",predicate:v,target:"value",..._&&{local:!0}}];y+=`collection_adder(${a}, "${wr(h)}", '${En(b)}').
|
|
846
|
+
`,y+=`collection_remover(${a}, "${wr(h)}", '${En(g)}').
|
|
847
|
+
`,y+=`collection_setter(${a}, "${wr(h)}", '${En(I)}').
|
|
848
|
+
`}d.push(y)}let f=En(s);if(r+=`constructor(${a}, '${f}').
|
|
825
849
|
`,u.length>0){let h=u.join(", ");r+=`instance(${a}, Base) :- ${h}.
|
|
826
850
|
`,r+=`
|
|
827
|
-
`}return r+=`destructor(${a}, '${
|
|
851
|
+
`}return r+=`destructor(${a}, '${En(o)}').
|
|
828
852
|
`,r+=`
|
|
829
853
|
`,r+=c.join(`
|
|
830
854
|
`),r+=`
|
|
831
855
|
`,r+=d.join(`
|
|
832
|
-
`),{sdna:r,name:n}},Object.defineProperty(e,"type",{configurable:!0})}}var
|
|
856
|
+
`),{sdna:r,name:n}},Object.defineProperty(e,"type",{configurable:!0})}}var Rw=`
|
|
833
857
|
type AIModelLoadingStatus {
|
|
834
858
|
downloaded: Boolean!
|
|
835
859
|
loaded: Boolean!
|
|
@@ -1140,7 +1164,7 @@ type Mutation {
|
|
|
1140
1164
|
aiCloseTranscriptionStream(streamId: String!): String!
|
|
1141
1165
|
aiEmbed(modelId: String!, text: String!): String!
|
|
1142
1166
|
aiFeedTranscriptionStream(audio: [Float!]!, streamId: String!): String!
|
|
1143
|
-
aiOpenTranscriptionStream(modelId: String
|
|
1167
|
+
aiOpenTranscriptionStream(modelId: String!, params: VoiceActivityParamsInput): String!
|
|
1144
1168
|
aiPrompt(prompt: String!, taskId: String!): String!
|
|
1145
1169
|
aiRemoveModel(modelId: String!): Boolean!
|
|
1146
1170
|
aiRemoveTask(taskId: String!): AITask!
|
|
@@ -1156,8 +1180,8 @@ type Mutation {
|
|
|
1156
1180
|
languageWriteSettings(languageAddress: String!, settings: String!): Boolean!
|
|
1157
1181
|
neighbourhoodJoinFromUrl(url: String!): PerspectiveHandle!
|
|
1158
1182
|
neighbourhoodPublishFromPerspective(linkLanguage: String!, meta: PerspectiveInput!, perspectiveUUID: String!): String!
|
|
1159
|
-
neighbourhoodSendBroadcast(payload: PerspectiveInput!, perspectiveUUID: String!): Boolean!
|
|
1160
|
-
neighbourhoodSendBroadcastU(payload: PerspectiveUnsignedInput!, perspectiveUUID: String!): Boolean!
|
|
1183
|
+
neighbourhoodSendBroadcast(loopback: Boolean, payload: PerspectiveInput!, perspectiveUUID: String!): Boolean!
|
|
1184
|
+
neighbourhoodSendBroadcastU(loopback: Boolean, payload: PerspectiveUnsignedInput!, perspectiveUUID: String!): Boolean!
|
|
1161
1185
|
neighbourhoodSendSignal(payload: PerspectiveInput!, perspectiveUUID: String!, remoteAgentDid: String!): Boolean!
|
|
1162
1186
|
neighbourhoodSendSignalU(payload: PerspectiveUnsignedInput!, perspectiveUUID: String!, remoteAgentDid: String!): Boolean!
|
|
1163
1187
|
neighbourhoodSetOnlineStatus(perspectiveUUID: String!, status: PerspectiveInput!): Boolean!
|
|
@@ -1179,9 +1203,13 @@ type Mutation {
|
|
|
1179
1203
|
perspectiveUpdateLink(newLink: LinkInput!, oldLink: LinkExpressionInput!, uuid: String!): LinkExpression!
|
|
1180
1204
|
runtimeAddFriends(dids: [String!]!): [String!]!
|
|
1181
1205
|
runtimeAddKnownLinkLanguageTemplates(addresses: [String!]!): [String!]!
|
|
1206
|
+
runtimeExportDb(filePath: String!): Boolean!
|
|
1207
|
+
runtimeExportPerspective(filePath: String!, perspectiveUuid: String!): Boolean!
|
|
1182
1208
|
runtimeFriendSendMessage(did: String!, message: PerspectiveInput!): Boolean!
|
|
1183
1209
|
runtimeGrantNotification(id: String!): Boolean!
|
|
1184
1210
|
runtimeHcAddAgentInfos(agentInfos: String!): Boolean!
|
|
1211
|
+
runtimeImportDb(filePath: String!): Boolean!
|
|
1212
|
+
runtimeImportPerspective(filePath: String!): Boolean!
|
|
1185
1213
|
runtimeOpenLink(url: String!): Boolean!
|
|
1186
1214
|
runtimeQuit: Boolean!
|
|
1187
1215
|
runtimeRemoveFriends(dids: [String!]!): [String!]!
|
|
@@ -1355,7 +1383,15 @@ type TriggeredNotification {
|
|
|
1355
1383
|
perspectiveId: String!
|
|
1356
1384
|
triggerMatch: String!
|
|
1357
1385
|
}
|
|
1358
|
-
`;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-dev9";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{this.notifyConnectionChange("checking_local");try{yield $s(`ws://localhost:${this.port}/graphql`,2e3);let r=this.buildClient();return yield this.checkAuth(),r}catch(r){let n=yield this.ensureConnection();return yield this.checkAuth(),n}}}catch(r){this.notifyConnectionChange("not_connected"),this.notifyAuthChange("unauthenticated")}})}loginToHosting(e,r){return 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(e){let r=yield bl(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 $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:e=>pe(this,null,function*(){if(!e.wasClean&&!this.requestedRestart)if(!this.token)this.notifyConnectionChange(this.token?"disconnected":"not_connected"),this.notifyAuthChange("unauthenticated"),this.requestedRestart=!1;else{let r=yield this.connect();r?this.ad4mClient=r:(this.notifyConnectionChange(this.token?"disconnected":"not_connected"),this.notifyAuthChange("unauthenticated"),this.requestedRestart=!1)}})}}),this.apolloClient=new 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`
|
|
1386
|
+
|
|
1387
|
+
input VoiceActivityParamsInput {
|
|
1388
|
+
endThreshold: Float
|
|
1389
|
+
endWindow: Float
|
|
1390
|
+
startThreshold: Float
|
|
1391
|
+
startWindow: Float
|
|
1392
|
+
timeBeforeSpeech: Float
|
|
1393
|
+
}
|
|
1394
|
+
`;function Eh(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 k1(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`${Eh(e)} your ${r} actions, with access to ${Eh(n)}`}var xn=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},K=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},ct,zt,xs,ke,Ch=class{constructor(t,e,r){ct.set(this,void 0),zt.set(this,void 0),xs.set(this,void 0),ke.set(this,void 0),xn(this,ct,e||Qt.from(C1(24)).toUrl(),"f"),xn(this,ke,t,"f"),xn(this,xs,r||"ad4m://self","f")}get baseExpression(){return K(this,ct,"f")}get perspective(){return K(this,ke,"f")}async getData(t){let e=t??K(this,ct,"f"),r=await K(this,ke,"f").getSubjectData(K(this,zt,"f"),e);return Object.assign(this,r),xn(this,ct,e,"f"),this}async setProperty(key,value){let setters=await K(this,ke,"f").infer(`subject_class("${K(this,zt,"f")}", C), property_setter(C, "${key}", Setter)`);if(setters&&setters.length>0){let actions=eval(setters[0].Setter),resolveLanguageResults=await K(this,ke,"f").infer(`subject_class("${K(this,zt,"f")}", C), property_resolve_language(C, "${key}", Language)`),resolveLanguage;resolveLanguageResults&&resolveLanguageResults.length>0&&(resolveLanguage=resolveLanguageResults[0].Language),resolveLanguage&&(value=await K(this,ke,"f").createExpression(value,resolveLanguage)),await K(this,ke,"f").executeAction(actions,K(this,ct,"f"),[{name:"value",value}])}}async setCollectionSetter(key,value){let collectionSetters=await K(this,ke,"f").infer(`subject_class("${K(this,zt,"f")}", C), collection_setter(C, "${wr(key)}", Setter)`);if(collectionSetters||(collectionSetters=[]),collectionSetters.length>0){let actions=eval(collectionSetters[0].Setter);value&&(Array.isArray(value)?await K(this,ke,"f").executeAction(actions,K(this,ct,"f"),value.map(t=>({name:"value",value:t}))):await K(this,ke,"f").executeAction(actions,K(this,ct,"f"),[{name:"value",value}]))}}async setCollectionAdder(key,value){let adders=await K(this,ke,"f").infer(`subject_class("${K(this,zt,"f")}", C), collection_adder(C, "${wr(key)}", Adder)`);if(adders||(adders=[]),adders.length>0){let actions=eval(adders[0].Adder);value&&(Array.isArray(value)?await Promise.all(value.map(t=>K(this,ke,"f").executeAction(actions,K(this,ct,"f"),[{name:"value",value:t}]))):await K(this,ke,"f").executeAction(actions,K(this,ct,"f"),[{name:"value",value}]))}}async setCollectionRemover(key,value){let removers=await K(this,ke,"f").infer(`subject_class("${K(this,zt,"f")}", C), collection_remover(C, "${wr(key)}", Remover)`);if(removers||(removers=[]),removers.length>0){let actions=eval(removers[0].Remover);value&&(Array.isArray(value)?await Promise.all(value.map(t=>K(this,ke,"f").executeAction(actions,K(this,ct,"f"),[{name:"value",value:t}]))):await K(this,ke,"f").executeAction(actions,K(this,ct,"f"),[{name:"value",value}]))}}async save(){xn(this,zt,await K(this,ke,"f").stringOrTemplateObjectToSubjectClass(this),"f"),await K(this,ke,"f").createSubject(this,K(this,ct,"f")),await K(this,ke,"f").add(new Mn({source:K(this,xs,"f"),predicate:"ad4m://has_child",target:this.baseExpression})),await this.update()}async update(){xn(this,zt,await K(this,ke,"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 xn(this,zt,await K(this,ke,"f").stringOrTemplateObjectToSubjectClass(this),"f"),await this.getData()}async delete(){await K(this,ke,"f").removeSubject(this,K(this,ct,"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())):[]}};ct=new WeakMap,zt=new WeakMap,xs=new WeakMap,ke=new WeakMap;var N=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},E=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},ye=function(t,e){return function(r,n){e(r,n,t)}},no=new Zr;no.author="did:ad4m:test";no.timestamp=Date.now();no.data={source:"root",target:"neighbourhood://Qm12345"};no.proof={signature:"",key:"",valid:!0};var zr=new Un;zr.author="did:ad4m:test";zr.timestamp=Date.now().toString();zr.proof=new Sr("","");zr.data=new or([no]);var Hs=class{};N([m(),E("design:type",String)],Hs.prototype,"recipient",void 0);N([m(),E("design:type",Un)],Hs.prototype,"message",void 0);Hs=N([H()],Hs);var Ri=class{};N([m(),E("design:type",String)],Ri.prototype,"ad4mExecutorVersion",void 0);N([m(),E("design:type",Boolean)],Ri.prototype,"isInitialized",void 0);N([m(),E("design:type",Boolean)],Ri.prototype,"isUnlocked",void 0);Ri=N([H()],Ri);var Qn=class{};N([m(),E("design:type",String)],Qn.prototype,"title",void 0);N([m(),E("design:type",String)],Qn.prototype,"message",void 0);N([m(),E("design:type",String)],Qn.prototype,"type",void 0);N([m(),E("design:type",String)],Qn.prototype,"addon",void 0);Qn=N([H()],Qn);var Ft=class{};N([m(),E("design:type",String)],Ft.prototype,"description",void 0);N([m(),E("design:type",String)],Ft.prototype,"appName",void 0);N([m(),E("design:type",String)],Ft.prototype,"appUrl",void 0);N([m(),E("design:type",String)],Ft.prototype,"appIconPath",void 0);N([m(),E("design:type",String)],Ft.prototype,"trigger",void 0);N([m(),E("design:type",Array)],Ft.prototype,"perspectiveIds",void 0);N([m(),E("design:type",String)],Ft.prototype,"webhookUrl",void 0);N([m(),E("design:type",String)],Ft.prototype,"webhookAuth",void 0);Ft=N([Ke()],Ft);var kt=class{};N([m(),E("design:type",String)],kt.prototype,"id",void 0);N([m(),E("design:type",Boolean)],kt.prototype,"granted",void 0);N([m(),E("design:type",String)],kt.prototype,"description",void 0);N([m(),E("design:type",String)],kt.prototype,"appName",void 0);N([m(),E("design:type",String)],kt.prototype,"appUrl",void 0);N([m(),E("design:type",String)],kt.prototype,"appIconPath",void 0);N([m(),E("design:type",String)],kt.prototype,"trigger",void 0);N([m(),E("design:type",Array)],kt.prototype,"perspectiveIds",void 0);N([m(),E("design:type",String)],kt.prototype,"webhookUrl",void 0);N([m(),E("design:type",String)],kt.prototype,"webhookAuth",void 0);kt=N([H()],kt);var Pi=class{};N([m(),E("design:type",kt)],Pi.prototype,"notification",void 0);N([m(),E("design:type",String)],Pi.prototype,"perspectiveId",void 0);N([m(),E("design:type",String)],Pi.prototype,"triggerMatch",void 0);Pi=N([H()],Pi);var He=class{};N([m(),E("design:type",Number)],He.prototype,"total",void 0);N([m(),E("design:type",Number)],He.prototype,"imported",void 0);N([m(),E("design:type",Number)],He.prototype,"failed",void 0);N([m(),E("design:type",Number)],He.prototype,"omitted",void 0);N([m(),E("design:type",Array)],He.prototype,"errors",void 0);He=N([H()],He);var Tt=class{};N([m(),E("design:type",He)],Tt.prototype,"perspectives",void 0);N([m(),E("design:type",He)],Tt.prototype,"links",void 0);N([m(),E("design:type",He)],Tt.prototype,"expressions",void 0);N([m(),E("design:type",He)],Tt.prototype,"perspectiveDiffs",void 0);N([m(),E("design:type",He)],Tt.prototype,"notifications",void 0);N([m(),E("design:type",He)],Tt.prototype,"models",void 0);N([m(),E("design:type",He)],Tt.prototype,"defaultModels",void 0);N([m(),E("design:type",He)],Tt.prototype,"tasks",void 0);N([m(),E("design:type",He)],Tt.prototype,"friends",void 0);N([m(),E("design:type",He)],Tt.prototype,"trustedAgents",void 0);N([m(),E("design:type",He)],Tt.prototype,"knownLinkLanguages",void 0);Tt=N([H()],Tt);var ae=class{runtimeQuit(){return!0}runtimeOpenLink(e){return!0}runtimeInfo(){return{ad4mExecutorVersion:"x.x.x",isInitialized:!0,isUnlocked:!0}}addTrustedAgents(e){return e}deleteTrustedAgents(e){return[]}getTrustedAgents(){return["agentPubKey"]}runtimeKnownLinkLanguageTemplates(){return["Qm12345abcdef"]}runtimeAddKnownLinkLanguageTemplates(e){return e}runtimeRemoveKnownLinkLanguageTemplates(e){return[]}runtimeFriends(){return["did:test:friend"]}runtimeAddFriends(e){return e}runtimeRemoveFriends(e){return[]}runtimeHcAgentInfos(){return JSON.stringify([{agent:{type:"Buffer",data:[9,191,231,58,255,107,202,55,206,57,9,103,17,34,206,195,207,114,5,73,77,198,56,136,17,227,242,231,194,135,128,48,170,189,119,186]},signature:{type:"Buffer",data:[195,143,170,36,234,123,255,85,188,138,124,2,91,18,53,231,44,41,240,8,80,131,100,150,165,125,146,90,17,200,190,129,114,211,11,146,150,128,198,199,79,118,157,101,194,68,58,245,98,182,79,139,140,41,143,129,8,136,87,77,180,231,218,11]},agent_info:{type:"Buffer",data:[134,165,115,112,97,99,101,196,36,203,165,212,173,24,215,165,196,25,145,248,113,246,139,205,182,241,138,57,0,26,8,217,179,23,126,59,136,128,213,110,225,173,72,197,95,165,97,103,101,110,116,196,36,9,191,231,58,255,107,202,55,206,57,9,103,17,34,206,195,207,114,5,73,77,198,56,136,17,227,242,231,194,135,128,48,170,189,119,186,164,117,114,108,115,145,217,99,107,105,116,115,117,110,101,45,112,114,111,120,121,58,47,47,101,83,52,86,112,54,109,118,80,48,122,116,85,101,104,114,117,113,89,52,102,66,53,101,69,98,121,48,69,66,100,89,84,50,95,67,48,69,112,77,111,76,111,47,107,105,116,115,117,110,101,45,113,117,105,99,47,104,47,49,57,50,46,49,54,56,46,49,55,56,46,54,48,47,112,47,55,55,52,52,47,45,45,172,115,105,103,110,101,100,95,97,116,95,109,115,207,0,0,1,123,233,104,189,50,176,101,120,112,105,114,101,115,95,97,102,116,101,114,95,109,115,206,0,18,79,128,169,109,101,116,97,95,105,110,102,111,196,34,129,187,100,104,116,95,115,116,111,114,97,103,101,95,97,114,99,95,104,97,108,102,95,108,101,110,103,116,104,206,128,0,0,1]}},{agent:{type:"Buffer",data:[98,187,145,48,115,209,94,143,31,153,102,69,138,29,133,213,34,52,39,164,157,139,178,111,23,33,118,250,28,155,78,246,128,49,179,38]},signature:{type:"Buffer",data:[233,192,38,3,59,248,124,231,57,255,40,154,50,60,119,252,68,198,154,109,175,155,106,217,211,155,109,223,249,91,221,210,17,132,72,230,11,230,247,119,72,244,145,91,75,7,67,5,130,151,44,231,52,220,28,154,212,82,58,90,203,211,236,4]},agent_info:{type:"Buffer",data:[134,165,115,112,97,99,101,196,36,203,165,212,173,24,215,165,196,25,145,248,113,246,139,205,182,241,138,57,0,26,8,217,179,23,126,59,136,128,213,110,225,173,72,197,95,165,97,103,101,110,116,196,36,98,187,145,48,115,209,94,143,31,153,102,69,138,29,133,213,34,52,39,164,157,139,178,111,23,33,118,250,28,155,78,246,128,49,179,38,164,117,114,108,115,145,217,99,107,105,116,115,117,110,101,45,112,114,111,120,121,58,47,47,55,101,77,106,48,73,83,72,56,56,81,56,45,89,51,74,89,70,53,76,72,57,83,54,68,119,71,73,49,88,45,115,87,53,68,104,66,87,121,71,119,78,115,47,107,105,116,115,117,110,101,45,113,117,105,99,47,104,47,49,57,50,46,49,54,56,46,49,55,56,46,54,48,47,112,47,55,55,52,52,47,45,45,172,115,105,103,110,101,100,95,97,116,95,109,115,207,0,0,1,123,233,103,45,197,176,101,120,112,105,114,101,115,95,97,102,116,101,114,95,109,115,206,0,18,79,128,169,109,101,116,97,95,105,110,102,111,196,34,129,187,100,104,116,95,115,116,111,114,97,103,101,95,97,114,99,95,104,97,108,102,95,108,101,110,103,116,104,206,128,0,0,1]}},{agent:{type:"Buffer",data:[181,101,115,45,214,127,198,153,159,184,30,87,67,224,208,184,203,176,130,158,236,127,153,125,243,183,188,167,154,25,118,254,101,145,210,109]},signature:{type:"Buffer",data:[88,189,229,122,44,171,194,156,90,79,148,49,207,224,34,199,219,88,24,243,103,127,123,41,87,171,127,92,6,216,198,171,26,226,237,217,122,78,98,146,55,255,68,240,202,83,58,140,147,185,3,66,15,216,210,22,99,197,73,234,120,17,74,1]},agent_info:{type:"Buffer",data:[134,165,115,112,97,99,101,196,36,203,165,212,173,24,215,165,196,25,145,248,113,246,139,205,182,241,138,57,0,26,8,217,179,23,126,59,136,128,213,110,225,173,72,197,95,165,97,103,101,110,116,196,36,181,101,115,45,214,127,198,153,159,184,30,87,67,224,208,184,203,176,130,158,236,127,153,125,243,183,188,167,154,25,118,254,101,145,210,109,164,117,114,108,115,145,217,99,107,105,116,115,117,110,101,45,112,114,111,120,121,58,47,47,114,70,71,83,100,113,104,101,68,107,70,70,56,69,102,109,45,69,116,55,119,81,101,120,83,88,55,65,112,69,51,89,86,99,45,120,102,52,104,106,77,115,77,47,107,105,116,115,117,110,101,45,113,117,105,99,47,104,47,49,57,50,46,49,54,56,46,49,55,56,46,54,48,47,112,47,55,55,52,52,47,45,45,172,115,105,103,110,101,100,95,97,116,95,109,115,207,0,0,1,123,233,113,23,220,176,101,120,112,105,114,101,115,95,97,102,116,101,114,95,109,115,206,0,18,79,128,169,109,101,116,97,95,105,110,102,111,196,34,129,187,100,104,116,95,115,116,111,114,97,103,101,95,97,114,99,95,104,97,108,102,95,108,101,110,103,116,104,206,128,0,0,1]}},{agent:{type:"Buffer",data:[3,171,237,107,186,245,165,47,237,235,211,49,245,62,113,53,255,252,223,226,75,118,148,187,23,53,70,174,160,184,64,63,94,210,227,56]},signature:{type:"Buffer",data:[129,12,55,104,239,121,138,2,86,106,136,51,219,79,170,8,195,69,81,188,225,192,247,196,54,39,164,110,75,39,240,56,245,189,154,77,72,11,97,250,202,149,242,97,128,28,47,164,236,104,136,82,212,246,44,143,132,119,255,135,112,11,20,13]},agent_info:{type:"Buffer",data:[134,165,115,112,97,99,101,196,36,203,165,212,173,24,215,165,196,25,145,248,113,246,139,205,182,241,138,57,0,26,8,217,179,23,126,59,136,128,213,110,225,173,72,197,95,165,97,103,101,110,116,196,36,3,171,237,107,186,245,165,47,237,235,211,49,245,62,113,53,255,252,223,226,75,118,148,187,23,53,70,174,160,184,64,63,94,210,227,56,164,117,114,108,115,145,217,97,107,105,116,115,117,110,101,45,112,114,111,120,121,58,47,47,104,121,112,115,86,121,103,117,80,84,115,53,118,73,80,65,102,97,112,90,88,113,117,84,115,79,80,100,67,81,79,79,117,103,57,51,82,103,106,95,114,85,73,47,107,105,116,115,117,110,101,45,113,117,105,99,47,104,47,49,54,53,46,50,50,46,51,50,46,49,49,47,112,47,53,55,55,57,47,45,45,172,115,105,103,110,101,100,95,97,116,95,109,115,207,0,0,1,123,233,113,188,123,176,101,120,112,105,114,101,115,95,97,102,116,101,114,95,109,115,206,0,18,79,128,169,109,101,116,97,95,105,110,102,111,196,34,129,187,100,104,116,95,115,116,111,114,97,103,101,95,97,114,99,95,104,97,108,102,95,108,101,110,103,116,104,206,128,0,0,1]}}])}runtimeHcAddAgentInfos(e){return!0}runtimeVerifyStringSignedByDid(e,r,n,i){return!0}runtimeSetStatus(e){return!0}runtimeFriendStatus(e){return zr}runtimeFriendSendMessage(e,r){return!0}runtimeMessageInbox(e){return[zr]}runtimeMessageOutbox(e){return[{recipient:"did:test:recipient",message:zr}]}runtimeMessageReceived(){return zr}exceptionOccurred(){return{title:"Test title",message:"Test message",type:wl.LanguageIsNotLoaded}}runtimeRequestInstallNotification(e){return"new-notification-id"}runtimeNotifications(){return[{id:"test-id",granted:!1,description:"Test description",appName:"Test app name",appUrl:"https://example.com",appIconPath:"https://fluxsocial.io/favicon",trigger:"triple(X, ad4m://has_type, flux://message)",perspectiveIds:["u983ud-jdhh38d"],webhookUrl:"https://example.com/webhook",webhookAuth:"test-auth"}]}runtimeUpdateNotification(e,r){return!0}runtimeRemoveNotification(e){return!0}runtimeGrantNotification(e){return!0}runtimeNotificationTriggered(){return{perspectiveId:"test-perspective-id",triggerMatch:"test-trigger-match",notification:{id:"test-id",granted:!1,description:"Test description",appName:"Test app name",appUrl:"https://example.com",appIconPath:"https://fluxsocial.io/favicon",trigger:"triple(X, ad4m://has_type, flux://message)",perspectiveIds:["u983ud-jdhh38d"],webhookUrl:"https://example.com/webhook",webhookAuth:"test-auth"}}}runtimeExportDb(e){return!0}runtimeImportDb(e){return!0}runtimeExportPerspective(e,r){return!0}runtimeImportPerspective(e){return!0}};N([Ve(),E("design:type",Function),E("design:paramtypes",[]),E("design:returntype",Boolean)],ae.prototype,"runtimeQuit",null);N([Ve(),ye(0,ge()),E("design:type",Function),E("design:paramtypes",[String]),E("design:returntype",Boolean)],ae.prototype,"runtimeOpenLink",null);N([cr(),E("design:type",Function),E("design:paramtypes",[]),E("design:returntype",Ri)],ae.prototype,"runtimeInfo",null);N([Ve(),ye(0,ge()),E("design:type",Function),E("design:paramtypes",[Array]),E("design:returntype",Array)],ae.prototype,"addTrustedAgents",null);N([Ve(),ye(0,ge()),E("design:type",Function),E("design:paramtypes",[Array]),E("design:returntype",Array)],ae.prototype,"deleteTrustedAgents",null);N([cr(),E("design:type",Function),E("design:paramtypes",[]),E("design:returntype",Array)],ae.prototype,"getTrustedAgents",null);N([cr(),E("design:type",Function),E("design:paramtypes",[]),E("design:returntype",Array)],ae.prototype,"runtimeKnownLinkLanguageTemplates",null);N([Ve(),ye(0,ge()),E("design:type",Function),E("design:paramtypes",[Array]),E("design:returntype",Array)],ae.prototype,"runtimeAddKnownLinkLanguageTemplates",null);N([Ve(),ye(0,ge()),E("design:type",Function),E("design:paramtypes",[Array]),E("design:returntype",Array)],ae.prototype,"runtimeRemoveKnownLinkLanguageTemplates",null);N([cr(),E("design:type",Function),E("design:paramtypes",[]),E("design:returntype",Array)],ae.prototype,"runtimeFriends",null);N([Ve(),ye(0,ge()),E("design:type",Function),E("design:paramtypes",[Array]),E("design:returntype",Array)],ae.prototype,"runtimeAddFriends",null);N([Ve(),ye(0,ge()),E("design:type",Function),E("design:paramtypes",[Array]),E("design:returntype",Array)],ae.prototype,"runtimeRemoveFriends",null);N([cr(),E("design:type",Function),E("design:paramtypes",[]),E("design:returntype",String)],ae.prototype,"runtimeHcAgentInfos",null);N([Ve(),ye(0,ge()),E("design:type",Function),E("design:paramtypes",[Object]),E("design:returntype",Boolean)],ae.prototype,"runtimeHcAddAgentInfos",null);N([cr(),ye(0,ge()),ye(1,ge()),ye(2,ge()),ye(3,ge()),E("design:type",Function),E("design:paramtypes",[String,String,String,String]),E("design:returntype",void 0)],ae.prototype,"runtimeVerifyStringSignedByDid",null);N([Ve(),ye(0,ge()),E("design:type",Function),E("design:paramtypes",[or]),E("design:returntype",Boolean)],ae.prototype,"runtimeSetStatus",null);N([cr(),ye(0,ge()),E("design:type",Function),E("design:paramtypes",[String]),E("design:returntype",Un)],ae.prototype,"runtimeFriendStatus",null);N([Ve(),ye(0,ge()),ye(1,ge()),E("design:type",Function),E("design:paramtypes",[String,Os]),E("design:returntype",Boolean)],ae.prototype,"runtimeFriendSendMessage",null);N([cr(),ye(0,ge()),E("design:type",Function),E("design:paramtypes",[String]),E("design:returntype",Array)],ae.prototype,"runtimeMessageInbox",null);N([cr(),ye(0,ge()),E("design:type",Function),E("design:paramtypes",[String]),E("design:returntype",Array)],ae.prototype,"runtimeMessageOutbox",null);N([El(),E("design:type",Function),E("design:paramtypes",[]),E("design:returntype",Un)],ae.prototype,"runtimeMessageReceived",null);N([El(),E("design:type",Function),E("design:paramtypes",[]),E("design:returntype",Qn)],ae.prototype,"exceptionOccurred",null);N([Ve(),ye(0,ge()),E("design:type",Function),E("design:paramtypes",[Ft]),E("design:returntype",String)],ae.prototype,"runtimeRequestInstallNotification",null);N([cr(),E("design:type",Function),E("design:paramtypes",[]),E("design:returntype",Array)],ae.prototype,"runtimeNotifications",null);N([Ve(),ye(0,ge()),ye(1,ge()),E("design:type",Function),E("design:paramtypes",[String,Ft]),E("design:returntype",Boolean)],ae.prototype,"runtimeUpdateNotification",null);N([Ve(),ye(0,ge()),E("design:type",Function),E("design:paramtypes",[String]),E("design:returntype",Boolean)],ae.prototype,"runtimeRemoveNotification",null);N([Ve(),ye(0,ge()),E("design:type",Function),E("design:paramtypes",[String]),E("design:returntype",Boolean)],ae.prototype,"runtimeGrantNotification",null);N([El(),E("design:type",Function),E("design:paramtypes",[]),E("design:returntype",Pi)],ae.prototype,"runtimeNotificationTriggered",null);N([Ve(),ye(0,ge()),E("design:type",Function),E("design:paramtypes",[String]),E("design:returntype",Boolean)],ae.prototype,"runtimeExportDb",null);N([Ve(),ye(0,ge()),E("design:type",Function),E("design:paramtypes",[String]),E("design:returntype",Boolean)],ae.prototype,"runtimeImportDb",null);N([Ve(),ye(0,ge()),ye(1,ge()),E("design:type",Function),E("design:paramtypes",[String,String]),E("design:returntype",Boolean)],ae.prototype,"runtimeExportPerspective",null);N([Ve(),ye(0,ge()),E("design:type",Function),E("design:paramtypes",[String]),E("design:returntype",Boolean)],ae.prototype,"runtimeImportPerspective",null);ae=N([Iy()],ae);var tc="0.10.1-release-candidate-1-dev1";var Er=12e3;function Yv(){console.log("!! timeout yo!");let t=new AbortController;return setTimeout(()=>t.abort(),20),t}function rc(t,e=1e4){return me(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 Ml(t){return me(this,null,function*(){try{let e=yield fetch(`http://localhost:${t}/graphql/`,{signal:Yv().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 Jv(){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 Ul(){try{localStorage.setItem("test",""),localStorage.removeItem("test")}catch(t){return!1}return!0}function nc(t,e){Ul()&&localStorage.setItem(`${tc}/${t}`,e)}function lr(t){return Ul()?localStorage.getItem(`${tc}/${t}`):null}function jl(t){Ul()&&localStorage.removeItem(`${tc}/${t}`)}var Xv=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 io(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 Xv(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 ao=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=Er;this.capabilities=[];this.isHosting=!1;this.listeners={authstatechange:[],configstatechange:[],connectionstatechange:[]};io(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){console.log("!!!on!!!",e,r),this.listeners[e].push(r)}connect(e){return me(this,null,function*(){try{if(e){yield rc(e),this.setUrl(e);let r=this.buildClient();return yield this.checkAuth(),r}else{this.notifyConnectionChange("checking_local");try{yield rc(`ws://localhost:${this.port}/graphql`,2e3);let r=this.buildClient();return yield this.checkAuth(),r}catch(r){let n=yield this.ensureConnection();return yield this.checkAuth(),n}}}catch(r){this.notifyConnectionChange("not_connected"),this.notifyAuthChange("unauthenticated")}})}loginToHosting(e,r){return me(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,nc("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 me(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 me(this,null,function*(){try{if(e){let r=yield Ml(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 me(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 rc(this.url),this.buildClient()}catch(i){return this.notifyConnectionChange("not_connected"),this.connectToPort()}})}findPort(){return me(this,null,function*(){let e=[...Array(10).keys()].map((i,a)=>Ml(Er+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=gd({url:this.url,connectionParams:()=>me(this,null,function*(){return{headers:{authorization:this.token}}}),on:{opened:e=>{this.activeSocket=e,e.onmessage=r=>{console.log("!!! ws.onmessage at",performance.now(),r.data)}},error:e=>{this.notifyConnectionChange("not_connected"),this.notifyAuthChange("unauthenticated")},connected:()=>{this.notifyConnectionChange("connected"),this.checkAuth()},closed:e=>me(this,null,function*(){if(!e.wasClean&&!this.requestedRestart)if(!this.token)this.notifyConnectionChange(this.token?"disconnected":"not_connected"),this.notifyAuthChange("unauthenticated"),this.requestedRestart=!1;else{let r=yield this.connect();r?this.ad4mClient=r:(this.notifyConnectionChange(this.token?"disconnected":"not_connected"),this.notifyAuthChange("unauthenticated"),this.requestedRestart=!1)}})}}),this.apolloClient=new Du({link:new yd(this.wsClient),cache:new Qo({resultCaching:!1,addTypename:!1}),defaultOptions:{watchQuery:{fetchPolicy:"no-cache"},query:{fetchPolicy:"no-cache"},mutate:{fetchPolicy:"no-cache"}}}),this.ad4mClient=new Bs(this.apolloClient),this.ad4mClient}checkAuth(){return me(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 me(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 me(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(Er),this.notifyConnectionChange("not_connected"),this.notifyAuthChange("unauthenticated")}};function Bl({unlockAgent:t,reconnect:e}){return z`
|
|
1359
1395
|
<div class="text-center">
|
|
1360
1396
|
<div class="items">
|
|
1361
1397
|
<div>
|
|
@@ -1367,7 +1403,7 @@ type TriggeredNotification {
|
|
|
1367
1403
|
<button class="button" @click=${e}>Reconnect</button>
|
|
1368
1404
|
</div>
|
|
1369
1405
|
</div>
|
|
1370
|
-
`}function
|
|
1406
|
+
`}function ql(){return z`
|
|
1371
1407
|
<div class="items">
|
|
1372
1408
|
<div class="text-center">
|
|
1373
1409
|
<h1 class="heading">Request to AD4M blocked</h1>
|
|
@@ -1388,7 +1424,7 @@ type TriggeredNotification {
|
|
|
1388
1424
|
</button>
|
|
1389
1425
|
</div>
|
|
1390
1426
|
</div>
|
|
1391
|
-
`}function
|
|
1427
|
+
`}function Vl({reconnect:t}){return z`
|
|
1392
1428
|
<div class="items items--small">
|
|
1393
1429
|
<div class="text-center">
|
|
1394
1430
|
<h1 class="heading">Could not connect to AD4M</h1>
|
|
@@ -1397,7 +1433,7 @@ type TriggeredNotification {
|
|
|
1397
1433
|
<button class="button" @click=${()=>t()}>Try again</button>
|
|
1398
1434
|
</div>
|
|
1399
1435
|
</div>
|
|
1400
|
-
`}function
|
|
1436
|
+
`}function zl(){return z`<header class="dialog__header">
|
|
1401
1437
|
<div class="dialog__logo">
|
|
1402
1438
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 38 37" fill="none">
|
|
1403
1439
|
<path
|
|
@@ -1406,7 +1442,7 @@ type TriggeredNotification {
|
|
|
1406
1442
|
/>
|
|
1407
1443
|
</svg>
|
|
1408
1444
|
</div>
|
|
1409
|
-
</header>`}function
|
|
1445
|
+
</header>`}function Ql({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 z`
|
|
1410
1446
|
<div class="text-center">
|
|
1411
1447
|
<p>
|
|
1412
1448
|
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.
|
|
@@ -1418,7 +1454,7 @@ type TriggeredNotification {
|
|
|
1418
1454
|
Back
|
|
1419
1455
|
</button>
|
|
1420
1456
|
</div>
|
|
1421
|
-
`;if(t===0)return
|
|
1457
|
+
`;if(t===0)return z`
|
|
1422
1458
|
<div class="input">
|
|
1423
1459
|
<label class="input__label">EMAIL</label>
|
|
1424
1460
|
<input
|
|
@@ -1441,7 +1477,7 @@ type TriggeredNotification {
|
|
|
1441
1477
|
</button>
|
|
1442
1478
|
</div>
|
|
1443
1479
|
</div>
|
|
1444
|
-
`;if(t===1)return
|
|
1480
|
+
`;if(t===1)return z`
|
|
1445
1481
|
<div class="input">
|
|
1446
1482
|
<label class="input__label">PASSWORD</label>
|
|
1447
1483
|
<input
|
|
@@ -1452,7 +1488,7 @@ type TriggeredNotification {
|
|
|
1452
1488
|
errortext={passwordError}
|
|
1453
1489
|
error={passwordError}
|
|
1454
1490
|
/>
|
|
1455
|
-
${u?
|
|
1491
|
+
${u?z`<p class="error">${u}</p>`:""}
|
|
1456
1492
|
<div class="buttons">
|
|
1457
1493
|
<button
|
|
1458
1494
|
class="button button--full button-secondary"
|
|
@@ -1469,7 +1505,7 @@ type TriggeredNotification {
|
|
|
1469
1505
|
</button>
|
|
1470
1506
|
</div>
|
|
1471
1507
|
</div>
|
|
1472
|
-
`;if(t===2)return
|
|
1508
|
+
`;if(t===2)return z`
|
|
1473
1509
|
<div class="text-center">
|
|
1474
1510
|
<p>
|
|
1475
1511
|
Email is not registered. Please follow the <a target="_blank" href="https://hosting.ad4m.dev/">link</a> to register.
|
|
@@ -1481,7 +1517,7 @@ type TriggeredNotification {
|
|
|
1481
1517
|
Back
|
|
1482
1518
|
</button>
|
|
1483
1519
|
</div>
|
|
1484
|
-
`}function
|
|
1520
|
+
`}function Gl(){return z`
|
|
1485
1521
|
<div>
|
|
1486
1522
|
<div class="lds-ring">
|
|
1487
1523
|
<div></div>
|
|
@@ -1490,30 +1526,30 @@ type TriggeredNotification {
|
|
|
1490
1526
|
<div></div>
|
|
1491
1527
|
</div>
|
|
1492
1528
|
</div>
|
|
1493
|
-
`}function
|
|
1529
|
+
`}function oo(){return z`
|
|
1494
1530
|
<svg width="44" height="40" viewBox="0 0 70 60" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
1495
1531
|
<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"/>
|
|
1496
1532
|
</svg>
|
|
1497
|
-
`}function
|
|
1533
|
+
`}function Hl({openModal:t}){return z`
|
|
1498
1534
|
<div class="mainlogo" @click=${t}>
|
|
1499
|
-
${
|
|
1535
|
+
${oo()}
|
|
1500
1536
|
</div>
|
|
1501
|
-
`}function
|
|
1537
|
+
`}function Kl({capabilities:t,appname:e,appiconpath:r,changeState:n,setOpen:i,requestCapability:a}){return z`
|
|
1502
1538
|
<div class="items">
|
|
1503
1539
|
<div class="text-center">
|
|
1504
1540
|
<p class="body">An external application</p>
|
|
1505
1541
|
<h1 class="heading nomargin">${e}</h1>
|
|
1506
1542
|
<p class="body">wants to access your AD4M data</p>
|
|
1507
1543
|
</div>
|
|
1508
|
-
${r&&
|
|
1544
|
+
${r&&z`<div class="dialog__connect">
|
|
1509
1545
|
<img class="dialog__connect-app" src=${r} alt="Logo" />
|
|
1510
1546
|
<div class="dialog__connect-check"></div>
|
|
1511
|
-
<div class="dialog__connect-ad4m">${
|
|
1547
|
+
<div class="dialog__connect-ad4m">${oo()}</div>
|
|
1512
1548
|
</div>`}
|
|
1513
1549
|
<div>
|
|
1514
1550
|
<p class="text-center"><b>This will allow the developer to:</b></p>
|
|
1515
1551
|
<ul class="check-list">
|
|
1516
|
-
${t.map(o=>
|
|
1552
|
+
${t.map(o=>z`<li>
|
|
1517
1553
|
<span>
|
|
1518
1554
|
<svg
|
|
1519
1555
|
xmlns="http://www.w3.org/2000/svg"
|
|
@@ -1527,7 +1563,7 @@ type TriggeredNotification {
|
|
|
1527
1563
|
/>
|
|
1528
1564
|
</svg>
|
|
1529
1565
|
</span>
|
|
1530
|
-
<span>${
|
|
1566
|
+
<span>${k1(o)}</span>
|
|
1531
1567
|
</li>`)}
|
|
1532
1568
|
</ul>
|
|
1533
1569
|
</div>
|
|
@@ -1552,7 +1588,7 @@ type TriggeredNotification {
|
|
|
1552
1588
|
Connection settings
|
|
1553
1589
|
</button>
|
|
1554
1590
|
</div>
|
|
1555
|
-
`}function
|
|
1591
|
+
`}function Wl({changeState:t,onSuccess:e,uiState:r}){function n(i){let a=new BarcodeDetector,o=i.currentTarget,s=()=>me(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 z`
|
|
1556
1592
|
<div class="qr-scanner">
|
|
1557
1593
|
<div class="qr-content">
|
|
1558
1594
|
<button
|
|
@@ -1571,7 +1607,7 @@ type TriggeredNotification {
|
|
|
1571
1607
|
></video>
|
|
1572
1608
|
</div>
|
|
1573
1609
|
</div>
|
|
1574
|
-
`}function
|
|
1610
|
+
`}function Zl({port:t,url:e,isRemote:r,connectToPort:n,changeIsRemote:i,connectRemote:a,changeState:o,changeUrl:s,changePort:u,clearState:c}){return z`
|
|
1575
1611
|
<div class="items items--small">
|
|
1576
1612
|
<div class="text-center">
|
|
1577
1613
|
<h1 class="heading">Connection Settings</h1>
|
|
@@ -1585,7 +1621,7 @@ type TriggeredNotification {
|
|
|
1585
1621
|
Remotely
|
|
1586
1622
|
</button>
|
|
1587
1623
|
</div>
|
|
1588
|
-
${r?
|
|
1624
|
+
${r?z`
|
|
1589
1625
|
<div class="input">
|
|
1590
1626
|
<label class="input__label">URL</label>
|
|
1591
1627
|
<input
|
|
@@ -1602,7 +1638,7 @@ type TriggeredNotification {
|
|
|
1602
1638
|
Connect
|
|
1603
1639
|
</button>
|
|
1604
1640
|
</div>
|
|
1605
|
-
`:
|
|
1641
|
+
`:z`
|
|
1606
1642
|
<div class="input">
|
|
1607
1643
|
<label class="input__label">PORT</label>
|
|
1608
1644
|
<input
|
|
@@ -1638,9 +1674,9 @@ type TriggeredNotification {
|
|
|
1638
1674
|
</button>
|
|
1639
1675
|
</div
|
|
1640
1676
|
</div>
|
|
1641
|
-
`}function
|
|
1677
|
+
`}function Yl({connect:t,isMobile:e,hasClickedDownload:r,changeState:n,onDownloaded:i,scanQrcode:a,hosting:o}){let u=(lr("ad4murl")||`http://localhost:${Er}`).includes("localhost");function c(l){l.preventDefault();let d=l.currentTarget;window.open(d.href,"_blank"),this.onDownloaded()}return z`
|
|
1642
1678
|
<div class="items">
|
|
1643
|
-
${r?
|
|
1679
|
+
${r?z`
|
|
1644
1680
|
<div class="text-center">
|
|
1645
1681
|
<a class="button" target="_blank" @click=${()=>t()}>
|
|
1646
1682
|
Connect to ADAM
|
|
@@ -1650,17 +1686,17 @@ type TriggeredNotification {
|
|
|
1650
1686
|
ADAM agent
|
|
1651
1687
|
</p>
|
|
1652
1688
|
</div>
|
|
1653
|
-
`:
|
|
1689
|
+
`:z`
|
|
1654
1690
|
<div class="text-center">
|
|
1655
1691
|
<h1 class="heading">Could not connect to AD4M</h1>
|
|
1656
|
-
${u?
|
|
1692
|
+
${u?z`
|
|
1657
1693
|
<p style="color: #b9b9b9; font-size: 15px; text-align: center; margin: 30px 0;">
|
|
1658
1694
|
Please make sure you have the ADAM Launcher running on your computer and there are no browser restrictions ("Shields") blocking your connection to ADAM on localhost.
|
|
1659
1695
|
<br/>
|
|
1660
1696
|
<br/>
|
|
1661
1697
|
(Safari users: please use a different browser for now. Safari is very strict about this and we are working on a solution.)
|
|
1662
1698
|
</p>
|
|
1663
|
-
`:
|
|
1699
|
+
`:z`
|
|
1664
1700
|
<p style="color: #b9b9b9; font-size: 15px; text-align: center; margin: 30px 0;">
|
|
1665
1701
|
Looks like the remote executor you are trying to connect to is not reachable.
|
|
1666
1702
|
<br/>
|
|
@@ -1668,9 +1704,9 @@ type TriggeredNotification {
|
|
|
1668
1704
|
Please try connecting to a different remote executor or check your connection settings.
|
|
1669
1705
|
</p>
|
|
1670
1706
|
`}
|
|
1671
|
-
${e?
|
|
1707
|
+
${e?z`<button class="button" @click=${()=>a()}>
|
|
1672
1708
|
Connect with QR
|
|
1673
|
-
</button>`:
|
|
1709
|
+
</button>`:z`<a
|
|
1674
1710
|
class="button"
|
|
1675
1711
|
target="_blank"
|
|
1676
1712
|
@click=${c}
|
|
@@ -1679,8 +1715,8 @@ type TriggeredNotification {
|
|
|
1679
1715
|
Download AD4M
|
|
1680
1716
|
</a>
|
|
1681
1717
|
`}
|
|
1682
|
-
${o?
|
|
1683
|
-
${o?
|
|
1718
|
+
${o?z`<p>Or</p>`:""}
|
|
1719
|
+
${o?z`<button class="button" @click=${()=>n("hosting")}>Use hosted AD4M (alpha)</button>`:""}
|
|
1684
1720
|
</div>
|
|
1685
1721
|
|
|
1686
1722
|
<div style="display: flex; flex-direction: column; align-items: center; gap: 20px; margin-top: -30px">
|
|
@@ -1704,7 +1740,7 @@ type TriggeredNotification {
|
|
|
1704
1740
|
</a>
|
|
1705
1741
|
</div>
|
|
1706
1742
|
</div>
|
|
1707
|
-
`}function
|
|
1743
|
+
`}function Jl({code:t,changeState:e,verifyCode:r,changeCode:n,isHosting:i,verifyCodeError:a}){return z`
|
|
1708
1744
|
<div class="items">
|
|
1709
1745
|
<div class="text-center">
|
|
1710
1746
|
<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>
|
|
@@ -1722,7 +1758,7 @@ type TriggeredNotification {
|
|
|
1722
1758
|
value=${t}
|
|
1723
1759
|
@change=${o=>n(o.target.value)}
|
|
1724
1760
|
/>
|
|
1725
|
-
${a?
|
|
1761
|
+
${a?z`<p class="error">${a}</p>`:""}
|
|
1726
1762
|
</div>
|
|
1727
1763
|
<div class="buttons">
|
|
1728
1764
|
<button
|
|
@@ -1736,7 +1772,7 @@ type TriggeredNotification {
|
|
|
1736
1772
|
</button>
|
|
1737
1773
|
</div>
|
|
1738
1774
|
</div>
|
|
1739
|
-
`}function
|
|
1775
|
+
`}function e3(){return[/Android/i,/webOS/i,/iPhone/i,/iPad/i,/iPod/i,/BlackBerry/i,/Windows Phone/i].some(e=>navigator.userAgent.match(e))}var t3=oc`
|
|
1740
1776
|
:host {
|
|
1741
1777
|
--primary-color: #fff;
|
|
1742
1778
|
--heading-color: #fff;
|
|
@@ -2137,16 +2173,16 @@ type TriggeredNotification {
|
|
|
2137
2173
|
width: 100vw;
|
|
2138
2174
|
object-fit: cover;
|
|
2139
2175
|
}
|
|
2140
|
-
`,
|
|
2176
|
+
`,fe=class extends Ar{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=lr("ad4mhosting")==="true"||!1;this.token=lr("ad4mToken")||"";this.port=parseInt(lr("ad4mport"))||Er;this.url=lr("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(),io(this),this.injectFont(),this._isMobile=e3(),this._client=new ao({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(lr("ad4mport"))||Er,token:this.token||lr("ad4mtoken"),url:this.url||lr("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._client.connect()}checkEmail(){return me(this,null,function*(){try{(yield this._client.checkEmail(this._email))?this._hostingStep=1:this._hostingStep=2}catch(r){console.log(r)}})}loginToHosting(){return me(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 me(this,null,function*(){yield this._client.ad4mClient.agent.unlock(r,n)})}verifyCode(r){return me(this,null,function*(){try{yield this._client.verifyCode(r)}catch(n){this._verifyCodeError="Invalid code"}})}changeUrl(r){r!==this._client.url&&(jl("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?nc("ad4m"+r,n):jl("ad4m"+r),this.requestUpdate()}handleConnectionChange(r){if(r==="checking_local"){this._isOpen=!1;return}r==="connected"&&(this.authState!=="authenticated"?(this.changeUIState("requestcap"),this._isOpen=!0):(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 me(this,null,function*(){try{window.BarcodeDetector.getSupportedFormats()}catch(n){window.BarcodeDetector=kr}yield this.changeUIState("qr"),setTimeout(()=>me(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 me(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 me(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 me(this,null,function*(){try{yield this._client.requestCapability(r),this.changeUIState("verifycode")}catch(n){console.warn(n)}})}isAuthenticated(){return me(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 Gl();if(this.uiState==="hosting")return Ql({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 Wl({changeState:this.changeUIState,onSuccess:r=>{this.changeUrl(r),this._client.connect(r)},uiState:this.uiState});if(this.authState==="locked")return Bl({unlockAgent:this.unlockAgent,reconnect:this.connect});if(this.uiState==="settings")return Zl({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 Yl({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"?Jl({code:this._code,changeCode:this.changeCode,changeState:this.changeUIState,verifyCode:this.verifyCode,isHosting:this._client.isHosting,verifyCodeError:this._verifyCodeError}):Kl({changeState:this.changeUIState,requestCapability:this.requestCapability,capabilities:this.capabilities,appname:this.appName,setOpen:this.setOpen,appiconpath:this.appIconPath});if(this.connectionState==="disconnected")return Vl({reconnect:this.connect});if(this.connectionState==="port_not_found")return ql()}mobileView(){return this.mobile?Hl({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:z`
|
|
2141
2177
|
<div class="wrapper">
|
|
2142
2178
|
<div class="dialog">
|
|
2143
|
-
${
|
|
2179
|
+
${zl()}
|
|
2144
2180
|
<main class="dialog__content">${this.renderViews()}</main>
|
|
2145
2181
|
${this.mobileView()}
|
|
2146
2182
|
</div>
|
|
2147
2183
|
<div class="ad4mConnect__backdrop" />
|
|
2148
2184
|
</div>
|
|
2149
|
-
`}};
|
|
2185
|
+
`}};fe.styles=[t3],xe([nt()],fe.prototype,"_code",2),xe([nt()],fe.prototype,"_isMobile",2),xe([nt()],fe.prototype,"_hasClickedDownload",2),xe([nt()],fe.prototype,"_isRemote",2),xe([nt()],fe.prototype,"_client",2),xe([nt()],fe.prototype,"_isOpen",2),xe([nt()],fe.prototype,"_hostingStep",2),xe([nt()],fe.prototype,"_email",2),xe([nt()],fe.prototype,"_passowrd",2),xe([nt()],fe.prototype,"_passwordError",2),xe([nt()],fe.prototype,"_hostingNotRunningError",2),xe([nt()],fe.prototype,"_verifyCodeError",2),xe([nt()],fe.prototype,"_isHostingLoading",2),xe([nt()],fe.prototype,"uiState",2),xe([vt({type:String,reflect:!0})],fe.prototype,"appName",2),xe([vt({type:String,reflect:!0})],fe.prototype,"appDesc",2),xe([vt({type:String,reflect:!0})],fe.prototype,"appDomain",2),xe([vt({type:String,reflect:!0})],fe.prototype,"appIconPath",2),xe([vt({type:Boolean,reflect:!0})],fe.prototype,"mobile",2),xe([vt({type:String,reflect:!0})],fe.prototype,"capabilities",2),xe([vt({type:Boolean,reflect:!0})],fe.prototype,"hosting",2),xe([vt({type:String})],fe.prototype,"token",2),xe([vt({type:String,reflect:!0})],fe.prototype,"port",2),xe([vt({type:String,reflect:!0})],fe.prototype,"url",2),fe=xe([wf("ad4m-connect")],fe);function r3(t){let e=new fe;return Object.entries(t).forEach(([r,n])=>{e[r]=n}),document.body.appendChild(e),e}export{fe as Ad4mConnectElement,r3 as default,Jv as getAd4mClient};
|
|
2150
2186
|
/*!
|
|
2151
2187
|
* @undecaf/barcode-detector-polyfill v0.9.20
|
|
2152
2188
|
* A WebAssembly polyfill for the Barcode Detection API
|