@coasys/ad4m-connect 0.10.0 → 0.10.1-dev-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +163 -34
- package/dist/core.d.ts +1 -1
- package/dist/core.js +423 -286
- package/dist/utils.d.ts +1 -0
- package/dist/utils.js +1 -1
- package/dist/web.js +546 -401
- package/package.json +2 -3
package/dist/web.js
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
var cm=Object.defineProperty;var um=Object.getOwnPropertyDescriptor;var ye=(t,e,r,n)=>{for(var i=n>1?void 0:n?um(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&&cm(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 Rl,scanRGBABuffer as lm,getDefaultScanner as fm}from"https://cdn.jsdelivr.net/npm/@undecaf/zbar-wasm@0.9.15/dist/main.js";function pm(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=Rl.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}},Nl;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"}(Nl||(Nl={}));var Ls=class{},dm=(()=>{try{return new OffscreenCanvas(1,1).getContext("2d")instanceof OffscreenCanvasRenderingContext2D}catch{return!1}})(),pr=class{constructor(e={}){if(e.formats!==void 0){if(!Array.isArray(e.formats)||!e.formats.length)throw new TypeError(`Barcode formats should be a non-empty array of strings but are: ${JSON.stringify(e)}`);let r=e.formats.filter(n=>!R.formats().includes(n));if(r.length)throw new TypeError(`Unsupported barcode format(s): ${r.join(", ")}`)}this.formats=e.formats||R.formats(),this.zbarConfig=e.zbar||new Ls}static getSupportedFormats(){return Promise.resolve(R.formats())}detect(e){if(!pr.isImageBitmapSource(e))throw new TypeError("BarcodeDetector.detect() argument is not an ImageBitmapSource");let r=pr.intrinsicDimensions(e);if(r.width===0||r.height===0)return Promise.resolve([]);try{return Promise.all([this.toImageData(e),this.getScanner()]).then(n=>{let i=n[0],a=n[1];return this.zbarConfig.enableCache!==void 0&&a.enableCache(this.zbarConfig.enableCache),lm(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)=>pm(this,void 0,void 0,function*(){if(!this.scanner){let n=yield fm();this.formats.length>0&&(n.setConfig(re.ZBAR_NONE,Rl.ZBAR_CFG_ENABLE,0),this.formats.forEach(i=>R.configure(n,i))),this.scanner=n}e(this.scanner)}))}toImageData(e){let r=n=>{let i=pr.intrinsicDimensions(n);this.canvas&&this.canvas.width===i.width&&this.canvas.height===i.height||(this.canvas=function(s,u){if(dm)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 Ba=window,Va=Ba.ShadowRoot&&(Ba.ShadyCSS===void 0||Ba.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,$s=Symbol(),Pl=new WeakMap,xi=class{constructor(e,r,n){if(this._$cssResult$=!0,n!==$s)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(Va&&e===void 0){let n=r!==void 0&&r.length===1;n&&(e=Pl.get(r)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&Pl.set(r,e))}return e}toString(){return this.cssText}},Ll=t=>new xi(typeof t=="string"?t:t+"",void 0,$s),Fs=(t,...e)=>{let r=t.length===1?t[0]:e.reduce((n,i,a)=>n+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[a+1],t[0]);return new xi(r,t,$s)},Ms=(t,e)=>{Va?t.adoptedStyleSheets=e.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet):e.forEach(r=>{let n=document.createElement("style"),i=Ba.litNonce;i!==void 0&&n.setAttribute("nonce",i),n.textContent=r.cssText,t.appendChild(n)})},za=Va?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let r="";for(let n of e.cssRules)r+=n.cssText;return Ll(r)})(t):t;var js,Qa=window,$l=Qa.trustedTypes,hm=$l?$l.emptyScript:"",Fl=Qa.reactiveElementPolyfillSupport,qs={toAttribute(t,e){switch(e){case Boolean:t=t?hm: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}},Ml=(t,e)=>e!==t&&(e==e||t==t),Us={attribute:!0,type:String,converter:qs,reflect:!1,hasChanged:Ml},Bs="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=Us){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)||Us}static finalize(){if(this.hasOwnProperty(Bs))return!1;this[Bs]=!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(za(i))}else e!==void 0&&r.push(za(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 Ms(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=Us){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:qs).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:qs;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||Ml)(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[Bs]=!0,Xt.elementProperties=new Map,Xt.elementStyles=[],Xt.shadowRootOptions={mode:"open"},Fl?.({ReactiveElement:Xt}),((js=Qa.reactiveElementVersions)!==null&&js!==void 0?js:Qa.reactiveElementVersions=[]).push("1.6.3");var Vs,Ga=window,$n=Ga.trustedTypes,jl=$n?$n.createPolicy("lit-html",{createHTML:t=>t}):void 0,Qs="$lit$",dr=`lit$${(Math.random()+"").slice(9)}$`,Gl="?"+dr,mm=`<${Gl}>`,zr=document,Ti=()=>zr.createComment(""),Ai=t=>t===null||typeof t!="object"&&typeof t!="function",Hl=Array.isArray,gm=t=>Hl(t)||typeof t?.[Symbol.iterator]=="function",zs=`[
|
|
2
|
-
\f\r]`,
|
|
3
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),Bl=/'/g,Vl=/"/g,Wl=/^(?:script|style|textarea|title)$/i,Kl=t=>(e,...r)=>({_$litType$:t,strings:e,values:r}),B=Kl(1),z2=Kl(2),Qr=Symbol.for("lit-noChange"),Fe=Symbol.for("lit-nothing"),zl=new WeakMap,Vr=zr.createTreeWalker(zr,129,null,!1);function Zl(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return jl!==void 0?jl.createHTML(e):e}var ym=(t,e)=>{let r=t.length-1,n=[],i,a=e===2?"<svg>":"",o=ki;for(let s=0;s<r;s++){let u=t[s],c,l,d=-1,p=0;for(;p<u.length&&(o.lastIndex=p,l=o.exec(u),l!==null);)p=o.lastIndex,o===ki?l[1]==="!--"?o=Ul:l[1]!==void 0?o=ql:l[2]!==void 0?(Wl.test(l[2])&&(i=RegExp("</"+l[2],"g")),o=Br):l[3]!==void 0&&(o=Br):o===Br?l[0]===">"?(o=i??ki,d=-1):l[1]===void 0?d=-2:(d=o.lastIndex-l[2].length,c=l[1],o=l[3]===void 0?Br:l[3]==='"'?Vl:Bl):o===Vl||o===Bl?o=Br:o===Ul||o===ql?o=ki:(o=Br,i=void 0);let f=o===Br&&t[s+1].startsWith("/>")?" ":"";a+=o===ki?u+mm:d>=0?(n.push(c),u.slice(0,d)+Qs+u.slice(d)+dr+f):u+dr+(d===-2?(n.push(void 0),s):f)}return[Zl(t,a+(t[r]||"<?>")+(e===2?"</svg>":"")),n]},Gr=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]=ym(e,r);if(this.el=Gr.createElement(c,n),Vr.currentNode=this.el.content,r===2){let d=this.el.content,p=d.firstChild;p.remove(),d.append(...p.childNodes)}for(;(i=Vr.nextNode())!==null&&u.length<s;){if(i.nodeType===1){if(i.hasAttributes()){let d=[];for(let p of i.getAttributeNames())if(p.endsWith(Qs)||p.startsWith(dr)){let f=l[o++];if(d.push(p),f!==void 0){let h=i.getAttribute(f.toLowerCase()+Qs).split(dr),g=/([.?@])?(.*)/.exec(f);u.push({type:1,index:a,name:g[2],strings:h,ctor:g[1]==="."?Hs:g[1]==="?"?Ws:g[1]==="@"?Ks:Mn})}else u.push({type:6,index:a})}for(let p of d)i.removeAttribute(p)}if(Wl.test(i.tagName)){let d=i.textContent.split(dr),p=d.length-1;if(p>0){i.textContent=$n?$n.emptyScript:"";for(let f=0;f<p;f++)i.append(d[f],Ti()),Vr.nextNode(),u.push({type:2,index:++a});i.append(d[p],Ti())}}}else if(i.nodeType===8)if(i.data===Gl)u.push({type:2,index:a});else{let d=-1;for(;(d=i.data.indexOf(dr,d+1))!==-1;)u.push({type:7,index:a}),d+=dr.length-1}a++}}static createElement(e,r){let n=zr.createElement("template");return n.innerHTML=e,n}};function Fn(t,e,r=t,n){var i,a,o,s;if(e===Qr)return e;let u=n!==void 0?(i=r._$Co)===null||i===void 0?void 0:i[n]:r._$Cl,c=Ai(e)?void 0:e._$litDirective$;return u?.constructor!==c&&((a=u?._$AO)===null||a===void 0||a.call(u,!1),c===void 0?u=void 0:(u=new c(t),u._$AT(t,r,n)),n!==void 0?((o=(s=r)._$Co)!==null&&o!==void 0?o:s._$Co=[])[n]=u:r._$Cl=u),u!==void 0&&(e=Fn(t,u._$AS(t,e.values),u,n)),e}var Gs=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:zr).importNode(n,!0);Vr.currentNode=a;let o=Vr.nextNode(),s=0,u=0,c=i[0];for(;c!==void 0;){if(s===c.index){let l;c.type===2?l=new Hr(o,o.nextSibling,this,e):c.type===1?l=new c.ctor(o,c.name,c.strings,this,e):c.type===6&&(l=new Zs(o,this,e)),this._$AV.push(l),c=i[++u]}s!==c?.index&&(o=Vr.nextNode(),s++)}return Vr.currentNode=zr,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++}},Hr=class{constructor(e,r,n,i){var a;this.type=2,this._$AH=Fe,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=Fn(this,e,r),Ai(e)?e===Fe||e==null||e===""?(this._$AH!==Fe&&this._$AR(),this._$AH=Fe):e!==this._$AH&&e!==Qr&&this._(e):e._$litType$!==void 0?this.g(e):e.nodeType!==void 0?this.$(e):gm(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!==Fe&&Ai(this._$AH)?this._$AA.nextSibling.data=e:this.$(zr.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=Gr.createElement(Zl(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 Gs(a,this),s=o.u(this.options);o.v(n),this.$(s),this._$AH=o}}_$AC(e){let r=zl.get(e.strings);return r===void 0&&zl.set(e.strings,r=new Gr(e)),r}T(e){Hl(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 Hr(this.k(Ti()),this.k(Ti()),this,this.options)):n=r[i],n._$AI(a),i++;i<r.length&&(this._$AR(n&&n._$AB.nextSibling,i),r.length=i)}_$AR(e=this._$AA.nextSibling,r){var n;for((n=this._$AP)===null||n===void 0||n.call(this,!1,!0,r);e&&e!==this._$AB;){let i=e.nextSibling;e.remove(),e=i}}setConnected(e){var r;this._$AM===void 0&&(this._$Cp=e,(r=this._$AP)===null||r===void 0||r.call(this,e))}},Mn=class{constructor(e,r,n,i,a){this.type=1,this._$AH=Fe,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=Fe}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=Fn(this,e,r,0),o=!Ai(e)||e!==this._$AH&&e!==Qr,o&&(this._$AH=e);else{let s=e,u,c;for(e=a[0],u=0;u<a.length-1;u++)c=Fn(this,s[n+u],r,u),c===Qr&&(c=this._$AH[u]),o||(o=!Ai(c)||c!==this._$AH[u]),c===Fe?e=Fe:e!==Fe&&(e+=(c??"")+a[u+1]),this._$AH[u]=c}o&&!i&&this.j(e)}j(e){e===Fe?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},Hs=class extends Mn{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===Fe?void 0:e}},vm=$n?$n.emptyScript:"",Ws=class extends Mn{constructor(){super(...arguments),this.type=4}j(e){e&&e!==Fe?this.element.setAttribute(this.name,vm):this.element.removeAttribute(this.name)}},Ks=class extends Mn{constructor(e,r,n,i,a){super(e,r,n,i,a),this.type=5}_$AI(e,r=this){var n;if((e=(n=Fn(this,e,r,0))!==null&&n!==void 0?n:Fe)===Qr)return;let i=this._$AH,a=e===Fe&&i!==Fe||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,o=e!==Fe&&(i===Fe||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)}},Zs=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){Fn(this,e)}};var Ql=Ga.litHtmlPolyfillSupport;Ql?.(Gr,Hr),((Vs=Ga.litHtmlVersions)!==null&&Vs!==void 0?Vs:Ga.litHtmlVersions=[]).push("2.8.0");var Yl=(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 Hr(e.insertBefore(Ti(),s),s,void 0,r??{})}return o._$AI(t),o};var Ys,Js;var hr=class extends Xt{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e,r;let n=super.createRenderRoot();return(e=(r=this.renderOptions).renderBefore)!==null&&e!==void 0||(r.renderBefore=n.firstChild),n}update(e){let r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Yl(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 Qr}};hr.finalized=!0,hr._$litElement$=!0,(Ys=globalThis.litElementHydrateSupport)===null||Ys===void 0||Ys.call(globalThis,{LitElement:hr});var Jl=globalThis.litElementPolyfillSupport;Jl?.({LitElement:hr});((Js=globalThis.litElementVersions)!==null&&Js!==void 0?Js:globalThis.litElementVersions=[]).push("3.3.3");var Xl=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 bm=(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)}},_m=(t,e,r)=>{e.constructor.createProperty(r,t)};function ft(t){return(e,r)=>r!==void 0?_m(t,e,r):bm(t,e)}function Ze(t){return ft({...t,state:!0})}var Xs,y3=((Xs=window.HTMLSlotElement)===null||Xs===void 0?void 0:Xs.prototype.assignedElements)!=null?(t,e)=>t.assignedElements(e):(t,e)=>t.assignedNodes(e).filter(r=>r.nodeType===Node.ELEMENT_NODE);var ec=function(t,e){return ec=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])},ec(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");ec(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 jt(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function Tt(t,e,r,n){function i(a){return a instanceof r?a:new r(function(o){o(a)})}return new(r||(r=Promise))(function(a,o){function s(l){try{c(n.next(l))}catch(d){o(d)}}function u(l){try{c(n.throw(l))}catch(d){o(d)}}function c(l){l.done?a(l.value):i(l.value).then(s,u)}c((n=n.apply(t,e||[])).next())})}function At(t,e){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(c){return function(l){return u([c,l])}}function u(c){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(r=0)),r;)try{if(n=1,i&&(a=c[0]&2?i.return:c[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,c[1])).done)return a;switch(i=0,a&&(c=[c[0]&2,a.value]),c[0]){case 0:case 1:a=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,i=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!a||c[1]>a[0]&&c[1]<a[3])){r.label=c[1];break}if(c[0]===6&&r.label<a[1]){r.label=a[1],a=c;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(c);break}a[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(l){c=[6,l],i=0}finally{n=a=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function mr(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,a;n<i;n++)(a||!(n in e))&&(a||(a=Array.prototype.slice.call(e,0,n)),a[n]=e[n]);return t.concat(a||Array.prototype.slice.call(e))}var tc="Invariant Violation",ef=Object.setPrototypeOf,wm=ef===void 0?function(t,e){return t.__proto__=e,t}:ef,V=function(t){xe(e,t);function e(r){r===void 0&&(r=tc);var n=t.call(this,typeof r=="number"?tc+": "+r+" (see https://github.com/apollographql/invariant-packages)":r)||this;return n.framesToPop=1,n.name=tc,wm(n,e.prototype),n}return e}(Error);function I(t,e){if(!t)throw new V(e)}var Wa=["debug","log","warn","error","silent"],rc=Wa.indexOf("log");function Ha(t){return function(){if(Wa.indexOf(t)>=rc){var e=console[t]||console.log;return e.apply(console,arguments)}}}(function(t){t.debug=Ha("debug"),t.log=Ha("log"),t.warn=Ha("warn"),t.error=Ha("error")})(I||(I={}));function tf(t){var e=Wa[rc];return rc=Math.max(0,Wa.indexOf(t)),e}function Me(t){try{return t()}catch{}}var Ka=Me(function(){return globalThis})||Me(function(){return window})||Me(function(){return self})||Me(function(){return global})||Me(function(){return Me.constructor("return this")()});var rf="__",nf=[rf,rf].join("DEV");function Sm(){try{return Boolean(__DEV__)}catch{return Object.defineProperty(Ka,nf,{value:Me(function(){return"production"})!=="production",enumerable:!1,configurable:!0,writable:!0}),Ka[nf]}}var Wr=Sm();function gr(t){try{return t()}catch{}}var nc=gr(function(){return globalThis})||gr(function(){return window})||gr(function(){return self})||gr(function(){return global})||gr(function(){return gr.constructor("return this")()}),ic=!1;function Em(){nc&&!gr(function(){return"production"})&&!gr(function(){return process})&&(Object.defineProperty(nc,"process",{value:{env:{NODE_ENV:"production"}},configurable:!0,enumerable:!1,writable:!0}),ic=!0)}Em();function ac(){ic&&(delete nc.process,ic=!1)}var V3=typeof Symbol=="function"&&Symbol.iterator!=null?Symbol.iterator:"@@iterator",z3=typeof Symbol=="function"&&Symbol.asyncIterator!=null?Symbol.asyncIterator:"@@asyncIterator",af=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 oc(t,e){var r=Boolean(t);if(!r)throw new Error(e??"Unexpected invariant triggered.")}var Cm=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):void 0,Oi=Cm;function Za(t){var e=t.prototype.toJSON;typeof e=="function"||oc(0),t.prototype.inspect=e,Oi&&(t.prototype[Oi]=e)}var of=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}();Za(of);var sf=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}();Za(sf);function sc(t){return t!=null&&typeof t.kind=="string"}function Ya(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ya=function(r){return typeof r}:Ya=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Ya(t)}var xm=10,cf=2;function Di(t){return Ja(t,[])}function Ja(t,e){switch(Ya(t)){case"string":return JSON.stringify(t);case"function":return t.name?"[function ".concat(t.name,"]"):"[function]";case"object":return t===null?"null":km(t,e);default:return String(t)}}function km(t,e){if(e.indexOf(t)!==-1)return"[Circular]";var r=[].concat(e,[t]),n=Im(t);if(n!==void 0){var i=n.call(t);if(i!==t)return typeof i=="string"?i:Ja(i,r)}else if(Array.isArray(t))return Am(t,r);return Tm(t,r)}function Tm(t,e){var r=Object.keys(t);if(r.length===0)return"{}";if(e.length>cf)return"["+Om(t)+"]";var n=r.map(function(i){var a=Ja(t[i],e);return i+": "+a});return"{ "+n.join(", ")+" }"}function Am(t,e){if(t.length===0)return"[]";if(e.length>cf)return"[Array]";for(var r=Math.min(xm,t.length),n=t.length-r,i=[],a=0;a<r;++a)i.push(Ja(t[a],e));return n===1?i.push("... 1 more item"):n>1&&i.push("... ".concat(n," more items")),"["+i.join(", ")+"]"}function Im(t){var e=t[String(Oi)];if(typeof e=="function")return e;if(typeof t.inspect=="function")return t.inspect}function Om(t){var e=Object.prototype.toString.call(t).replace(/^\[object /,"").replace(/]$/,"");if(e==="Object"&&typeof t.constructor=="function"){var r=t.constructor.name;if(typeof r=="string"&&r!=="")return r}return e}function Ni(t,e){var r=Boolean(t);if(!r)throw new Error(e)}function 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 Dm(t,e,r){return e&&uf(t.prototype,e),r&&uf(t,r),t}var Xa=function(){function t(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"GraphQL request",n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{line:1,column:1};typeof e=="string"||Ni(0,"Body must be a string. Received: ".concat(Di(e),".")),this.body=e,this.name=r,this.locationOffset=n,this.locationOffset.line>0||Ni(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||Ni(0,"column in locationOffset is 1-indexed and must be positive.")}return Dm(t,[{key:af,get:function(){return"Source"}}]),t}();function lf(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 X1=Object.defineProperty;var em=Object.getOwnPropertyDescriptor;var Ce=(t,e,r,n)=>{for(var i=n>1?void 0:n?em(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&&X1(e,r,i),i};var ge=(t,e,r)=>new Promise((n,i)=>{var a=u=>{try{s(r.next(u))}catch(c){i(c)}},o=u=>{try{s(r.throw(u))}catch(c){i(c)}},s=u=>u.done?n(u.value):Promise.resolve(u.value).then(a,o);s((r=r.apply(t,e)).next())});import{ZBarSymbolType as se,ZBarConfigType as yp,scanRGBABuffer as tm,getDefaultScanner as rm}from"https://cdn.jsdelivr.net/npm/@undecaf/zbar-wasm@0.9.15/dist/main.js";function nm(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=yp.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}},gp;L.formatsToConfigs={},L.typesToFormats={},L.register("codabar",new L(se.ZBAR_CODABAR)),L.register("code_39",new L(se.ZBAR_CODE39)),L.register("code_93",new L(se.ZBAR_CODE93)),L.register("code_128",new L(se.ZBAR_CODE128)),L.register("databar",new L(se.ZBAR_DATABAR)),L.register("databar_exp",new L(se.ZBAR_DATABAR_EXP)),L.register("ean_2",new L(se.ZBAR_EAN2)),L.register("ean_5",new L(se.ZBAR_EAN5)),L.register("ean_8",new L(se.ZBAR_EAN8)),L.register("ean_13",new L(se.ZBAR_EAN13)),L.register("ean_13+2",new L(se.ZBAR_EAN13)).add(new L(se.ZBAR_EAN2)),L.register("ean_13+5",new L(se.ZBAR_EAN13)).add(new L(se.ZBAR_EAN5)),L.register("isbn_10",new L(se.ZBAR_ISBN10)).add(new L(se.ZBAR_EAN13)),L.register("isbn_13",new L(se.ZBAR_ISBN13)).add(new L(se.ZBAR_EAN13)),L.register("isbn_13+2",new L(se.ZBAR_ISBN13)).add(new L(se.ZBAR_EAN13)).add(new L(se.ZBAR_EAN2)),L.register("isbn_13+5",new L(se.ZBAR_ISBN13)).add(new L(se.ZBAR_EAN13)).add(new L(se.ZBAR_EAN5)),L.register("itf",new L(se.ZBAR_I25)),L.register("qr_code",new L(se.ZBAR_QRCODE)),L.register("sq_code",new L(se.ZBAR_SQCODE)),L.register("upc_a",new L(se.ZBAR_UPCA)).add(new L(se.ZBAR_EAN13)),L.register("upc_e",new L(se.ZBAR_UPCE)).add(new L(se.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"}(gp||(gp={}));var yc=class{},im=(()=>{try{return new OffscreenCanvas(1,1).getContext("2d")instanceof OffscreenCanvasRenderingContext2D}catch{return!1}})(),Ar=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 yc}static getSupportedFormats(){return Promise.resolve(L.formats())}detect(e){if(!Ar.isImageBitmapSource(e))throw new TypeError("BarcodeDetector.detect() argument is not an ImageBitmapSource");let r=Ar.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),tm(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)=>nm(this,void 0,void 0,function*(){if(!this.scanner){let n=yield rm();this.formats.length>0&&(n.setConfig(se.ZBAR_NONE,yp.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=Ar.intrinsicDimensions(n);this.canvas&&this.canvas.width===i.width&&this.canvas.height===i.height||(this.canvas=function(s,u){if(im)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 bo=window,_o=bo.ShadowRoot&&(bo.ShadyCSS===void 0||bo.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,vc=Symbol(),vp=new WeakMap,Wi=class{constructor(e,r,n){if(this._$cssResult$=!0,n!==vc)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(_o&&e===void 0){let n=r!==void 0&&r.length===1;n&&(e=vp.get(r)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&vp.set(r,e))}return e}toString(){return this.cssText}},bp=t=>new Wi(typeof t=="string"?t:t+"",void 0,vc),bc=(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 Wi(r,t,vc)},_c=(t,e)=>{_o?t.adoptedStyleSheets=e.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet):e.forEach(r=>{let n=document.createElement("style"),i=bo.litNonce;i!==void 0&&n.setAttribute("nonce",i),n.textContent=r.cssText,t.appendChild(n)})},wo=_o?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let r="";for(let n of e.cssRules)r+=n.cssText;return bp(r)})(t):t;var wc,So=window,_p=So.trustedTypes,am=_p?_p.emptyScript:"",wp=So.reactiveElementPolyfillSupport,Cc={toAttribute(t,e){switch(e){case Boolean:t=t?am: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}},Sp=(t,e)=>e!==t&&(e==e||t==t),Sc={attribute:!0,type:String,converter:Cc,reflect:!1,hasChanged:Sp},xc="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=Sc){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)||Sc}static finalize(){if(this.hasOwnProperty(xc))return!1;this[xc]=!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(wo(i))}else e!==void 0&&r.push(wo(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 _c(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=Sc){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:Cc).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:Cc;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||Sp)(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[xc]=!0,fr.elementProperties=new Map,fr.elementStyles=[],fr.shadowRootOptions={mode:"open"},wp?.({ReactiveElement:fr}),((wc=So.reactiveElementVersions)!==null&&wc!==void 0?wc:So.reactiveElementVersions=[]).push("1.6.3");var Ec,Co=window,ri=Co.trustedTypes,Cp=ri?ri.createPolicy("lit-html",{createHTML:t=>t}):void 0,Ic="$lit$",Tr=`lit$${(Math.random()+"").slice(9)}$`,Op="?"+Tr,om=`<${Op}>`,ln=document,Zi=()=>ln.createComment(""),Ji=t=>t===null||typeof t!="object"&&typeof t!="function",Dp=Array.isArray,sm=t=>Dp(t)||typeof t?.[Symbol.iterator]=="function",kc=`[
|
|
2
|
+
\f\r]`,Ki=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,xp=/-->/g,Ep=/>/g,cn=RegExp(`>|${kc}(?:([^\\s"'>=/]+)(${kc}*=${kc}*(?:[^
|
|
3
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),kp=/'/g,Ip=/"/g,Np=/^(?:script|style|textarea|title)$/i,Pp=t=>(e,...r)=>({_$litType$:t,strings:e,values:r}),Q=Pp(1),F3=Pp(2),pn=Symbol.for("lit-noChange"),ze=Symbol.for("lit-nothing"),Ap=new WeakMap,un=ln.createTreeWalker(ln,129,null,!1);function Rp(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return Cp!==void 0?Cp.createHTML(e):e}var cm=(t,e)=>{let r=t.length-1,n=[],i,a=e===2?"<svg>":"",o=Ki;for(let s=0;s<r;s++){let u=t[s],c,l,d=-1,f=0;for(;f<u.length&&(o.lastIndex=f,l=o.exec(u),l!==null);)f=o.lastIndex,o===Ki?l[1]==="!--"?o=xp:l[1]!==void 0?o=Ep:l[2]!==void 0?(Np.test(l[2])&&(i=RegExp("</"+l[2],"g")),o=cn):l[3]!==void 0&&(o=cn):o===cn?l[0]===">"?(o=i??Ki,d=-1):l[1]===void 0?d=-2:(d=o.lastIndex-l[2].length,c=l[1],o=l[3]===void 0?cn:l[3]==='"'?Ip:kp):o===Ip||o===kp?o=cn:o===xp||o===Ep?o=Ki:(o=cn,i=void 0);let p=o===cn&&t[s+1].startsWith("/>")?" ":"";a+=o===Ki?u+om:d>=0?(n.push(c),u.slice(0,d)+Ic+u.slice(d)+Tr+p):u+Tr+(d===-2?(n.push(void 0),s):p)}return[Rp(t,a+(t[r]||"<?>")+(e===2?"</svg>":"")),n]},fn=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]=cm(e,r);if(this.el=fn.createElement(c,n),un.currentNode=this.el.content,r===2){let d=this.el.content,f=d.firstChild;f.remove(),d.append(...f.childNodes)}for(;(i=un.nextNode())!==null&&u.length<s;){if(i.nodeType===1){if(i.hasAttributes()){let d=[];for(let f of i.getAttributeNames())if(f.endsWith(Ic)||f.startsWith(Tr)){let p=l[o++];if(d.push(f),p!==void 0){let h=i.getAttribute(p.toLowerCase()+Ic).split(Tr),g=/([.?@])?(.*)/.exec(p);u.push({type:1,index:a,name:g[2],strings:h,ctor:g[1]==="."?Tc:g[1]==="?"?Oc:g[1]==="@"?Dc:ii})}else u.push({type:6,index:a})}for(let f of d)i.removeAttribute(f)}if(Np.test(i.tagName)){let d=i.textContent.split(Tr),f=d.length-1;if(f>0){i.textContent=ri?ri.emptyScript:"";for(let p=0;p<f;p++)i.append(d[p],Zi()),un.nextNode(),u.push({type:2,index:++a});i.append(d[f],Zi())}}}else if(i.nodeType===8)if(i.data===Op)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=ln.createElement("template");return n.innerHTML=e,n}};function ni(t,e,r=t,n){var i,a,o,s;if(e===pn)return e;let u=n!==void 0?(i=r._$Co)===null||i===void 0?void 0:i[n]:r._$Cl,c=Ji(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=ni(t,u._$AS(t,e.values),u,n)),e}var Ac=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:ln).importNode(n,!0);un.currentNode=a;let o=un.nextNode(),s=0,u=0,c=i[0];for(;c!==void 0;){if(s===c.index){let l;c.type===2?l=new dn(o,o.nextSibling,this,e):c.type===1?l=new c.ctor(o,c.name,c.strings,this,e):c.type===6&&(l=new Nc(o,this,e)),this._$AV.push(l),c=i[++u]}s!==c?.index&&(o=un.nextNode(),s++)}return un.currentNode=ln,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++}},dn=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=ni(this,e,r),Ji(e)?e===ze||e==null||e===""?(this._$AH!==ze&&this._$AR(),this._$AH=ze):e!==this._$AH&&e!==pn&&this._(e):e._$litType$!==void 0?this.g(e):e.nodeType!==void 0?this.$(e):sm(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&&Ji(this._$AH)?this._$AA.nextSibling.data=e:this.$(ln.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=fn.createElement(Rp(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 Ac(a,this),s=o.u(this.options);o.v(n),this.$(s),this._$AH=o}}_$AC(e){let r=Ap.get(e.strings);return r===void 0&&Ap.set(e.strings,r=new fn(e)),r}T(e){Dp(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 dn(this.k(Zi()),this.k(Zi()),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))}},ii=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=ni(this,e,r,0),o=!Ji(e)||e!==this._$AH&&e!==pn,o&&(this._$AH=e);else{let s=e,u,c;for(e=a[0],u=0;u<a.length-1;u++)c=ni(this,s[n+u],r,u),c===pn&&(c=this._$AH[u]),o||(o=!Ji(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??"")}},Tc=class extends ii{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===ze?void 0:e}},um=ri?ri.emptyScript:"",Oc=class extends ii{constructor(){super(...arguments),this.type=4}j(e){e&&e!==ze?this.element.setAttribute(this.name,um):this.element.removeAttribute(this.name)}},Dc=class extends ii{constructor(e,r,n,i,a){super(e,r,n,i,a),this.type=5}_$AI(e,r=this){var n;if((e=(n=ni(this,e,r,0))!==null&&n!==void 0?n:ze)===pn)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)}},Nc=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){ni(this,e)}};var Tp=Co.litHtmlPolyfillSupport;Tp?.(fn,dn),((Ec=Co.litHtmlVersions)!==null&&Ec!==void 0?Ec:Co.litHtmlVersions=[]).push("2.8.0");var $p=(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 dn(e.insertBefore(Zi(),s),s,void 0,r??{})}return o._$AI(t),o};var Pc,Rc;var Or=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=$p(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 pn}};Or.finalized=!0,Or._$litElement$=!0,(Pc=globalThis.litElementHydrateSupport)===null||Pc===void 0||Pc.call(globalThis,{LitElement:Or});var Lp=globalThis.litElementPolyfillSupport;Lp?.({LitElement:Or});((Rc=globalThis.litElementVersions)!==null&&Rc!==void 0?Rc:globalThis.litElementVersions=[]).push("3.3.3");var Fp=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 lm=(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)}},pm=(t,e,r)=>{e.constructor.createProperty(r,t)};function St(t){return(e,r)=>r!==void 0?pm(t,e,r):lm(t,e)}function ot(t){return St({...t,state:!0})}var $c,lb=(($c=window.HTMLSlotElement)===null||$c===void 0?void 0:$c.prototype.assignedElements)!=null?(t,e)=>t.assignedElements(e):(t,e)=>t.assignedNodes(e).filter(r=>r.nodeType===Node.ELEMENT_NODE);var Lc=function(t,e){return Lc=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])},Lc(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");Lc(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 Zt(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 jt(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 Bt(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 Dr(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 Fc="Invariant Violation",Mp=Object.setPrototypeOf,fm=Mp===void 0?function(t,e){return t.__proto__=e,t}:Mp,z=function(t){Oe(e,t);function e(r){r===void 0&&(r=Fc);var n=t.call(this,typeof r=="number"?Fc+": "+r+" (see https://github.com/apollographql/invariant-packages)":r)||this;return n.framesToPop=1,n.name=Fc,fm(n,e.prototype),n}return e}(Error);function D(t,e){if(!t)throw new z(e)}var Eo=["debug","log","warn","error","silent"],Mc=Eo.indexOf("log");function xo(t){return function(){if(Eo.indexOf(t)>=Mc){var e=console[t]||console.log;return e.apply(console,arguments)}}}(function(t){t.debug=xo("debug"),t.log=xo("log"),t.warn=xo("warn"),t.error=xo("error")})(D||(D={}));function Up(t){var e=Eo[Mc];return Mc=Math.max(0,Eo.indexOf(t)),e}function Ge(t){try{return t()}catch{}}var ko=Ge(function(){return globalThis})||Ge(function(){return window})||Ge(function(){return self})||Ge(function(){return global})||Ge(function(){return Ge.constructor("return this")()});var jp="__",Bp=[jp,jp].join("DEV");function dm(){try{return Boolean(__DEV__)}catch{return Object.defineProperty(ko,Bp,{value:Ge(function(){return"production"})!=="production",enumerable:!1,configurable:!0,writable:!0}),ko[Bp]}}var hn=dm();function Nr(t){try{return t()}catch{}}var Uc=Nr(function(){return globalThis})||Nr(function(){return window})||Nr(function(){return self})||Nr(function(){return global})||Nr(function(){return Nr.constructor("return this")()}),jc=!1;function hm(){Uc&&!Nr(function(){return"production"})&&!Nr(function(){return process})&&(Object.defineProperty(Uc,"process",{value:{env:{NODE_ENV:"production"}},configurable:!0,enumerable:!1,writable:!0}),jc=!0)}hm();function Bc(){jc&&(delete Uc.process,jc=!1)}var Lb=typeof Symbol=="function"&&Symbol.iterator!=null?Symbol.iterator:"@@iterator",Fb=typeof Symbol=="function"&&Symbol.asyncIterator!=null?Symbol.asyncIterator:"@@asyncIterator",qp=typeof Symbol=="function"&&Symbol.toStringTag!=null?Symbol.toStringTag:"@@toStringTag";var $e=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 qc(t,e){var r=Boolean(t);if(!r)throw new Error(e??"Unexpected invariant triggered.")}var mm=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):void 0,Xi=mm;function Io(t){var e=t.prototype.toJSON;typeof e=="function"||qc(0),t.prototype.inspect=e,Xi&&(t.prototype[Xi]=e)}var Vp=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}();Io(Vp);var Qp=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}();Io(Qp);function Vc(t){return t!=null&&typeof t.kind=="string"}function Ao(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ao=function(r){return typeof r}:Ao=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Ao(t)}var gm=10,zp=2;function ea(t){return To(t,[])}function To(t,e){switch(Ao(t)){case"string":return JSON.stringify(t);case"function":return t.name?"[function ".concat(t.name,"]"):"[function]";case"object":return t===null?"null":ym(t,e);default:return String(t)}}function ym(t,e){if(e.indexOf(t)!==-1)return"[Circular]";var r=[].concat(e,[t]),n=_m(t);if(n!==void 0){var i=n.call(t);if(i!==t)return typeof i=="string"?i:To(i,r)}else if(Array.isArray(t))return bm(t,r);return vm(t,r)}function vm(t,e){var r=Object.keys(t);if(r.length===0)return"{}";if(e.length>zp)return"["+wm(t)+"]";var n=r.map(function(i){var a=To(t[i],e);return i+": "+a});return"{ "+n.join(", ")+" }"}function bm(t,e){if(t.length===0)return"[]";if(e.length>zp)return"[Array]";for(var r=Math.min(gm,t.length),n=t.length-r,i=[],a=0;a<r;++a)i.push(To(t[a],e));return n===1?i.push("... 1 more item"):n>1&&i.push("... ".concat(n," more items")),"["+i.join(", ")+"]"}function _m(t){var e=t[String(Xi)];if(typeof e=="function")return e;if(typeof t.inspect=="function")return t.inspect}function wm(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 ta(t,e){var r=Boolean(t);if(!r)throw new Error(e)}function Gp(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 Sm(t,e,r){return e&&Gp(t.prototype,e),r&&Gp(t,r),t}var Oo=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"||ta(0,"Body must be a string. Received: ".concat(ea(e),".")),this.body=e,this.name=r,this.locationOffset=n,this.locationOffset.line>0||ta(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||ta(0,"column in locationOffset is 1-indexed and must be positive.")}return Sm(t,[{key:qp,get:function(){return"Source"}}]),t}();function Hp(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 Cm={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"]},mn=Object.freeze({});function nt(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Cm,n=void 0,i=Array.isArray(t),a=[t],o=-1,s=[],u=void 0,c=void 0,l=void 0,d=[],f=[],p=t;do{o++;var h=o===a.length,g=h&&s.length!==0;if(h){if(c=f.length===0?void 0:d[d.length-1],u=l,l=f.pop(),g){if(i)u=u.slice();else{for(var v={},C=0,_=Object.keys(u);C<_.length;C++){var b=_[C];v[b]=u[b]}u=v}for(var y=0,T=0;T<s.length;T++){var R=s[T][0],k=s[T][1];i&&(R-=y),i&&k===null?(u.splice(R,1),y++):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]:p,u==null)continue;l&&d.push(c)}var P=void 0;if(!Array.isArray(u)){if(!Vc(u))throw new Error("Invalid AST Node: ".concat(ea(u),"."));var F=Qc(e,u.kind,h);if(F){if(P=F.call(e,u,c,l,d,f),P===mn)break;if(P===!1){if(!h){d.pop();continue}}else if(P!==void 0&&(s.push([c,P]),!h))if(Vc(P))u=P;else{d.pop();continue}}}if(P===void 0&&g&&s.push([c,u]),h)d.pop();else{var $;n={inArray:i,index:o,keys:a,edits:s,prev:n},i=Array.isArray(u),a=i?u:($=r[u.kind])!==null&&$!==void 0?$:[],o=-1,s=[],l&&f.push(l),l=u}}while(n!==void 0);return s.length!==0&&(p=s[s.length-1][1]),p}function Qc(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 ai(t){return nt(t,{leave:Em})}var xm=80,Em={Name:function(e){return e.value},Variable:function(e){return"$"+e.name},Document:function(e){return M(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=Ie("(",M(e.variableDefinitions,", "),")"),a=M(e.directives," "),o=e.selectionSet;return!n&&!a&&!i&&r==="query"?o:M([r,M([n,i]),a,o]," ")},VariableDefinition:function(e){var r=e.variable,n=e.type,i=e.defaultValue,a=e.directives;return r+": "+n+Ie(" = ",i)+Ie(" ",M(a," "))},SelectionSet:function(e){var r=e.selections;return Vt(r)},Field:function(e){var r=e.alias,n=e.name,i=e.arguments,a=e.directives,o=e.selectionSet,s=Ie("",r,": ")+n,u=s+Ie("(",M(i,", "),")");return u.length>xm&&(u=s+Ie(`(
|
|
11
|
+
`,Do(M(i,`
|
|
12
12
|
`)),`
|
|
13
|
-
)`)),
|
|
14
|
-
`,
|
|
13
|
+
)`)),M([u,M(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+Ie(" ",M(n," "))},InlineFragment:function(e){var r=e.typeCondition,n=e.directives,i=e.selectionSet;return M(["...",Ie("on ",r),M(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(Ie("(",M(i,", "),")")," ")+"on ".concat(n," ").concat(Ie("",M(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?Hp(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"["+M(r,", ")+"]"},ObjectValue:function(e){var r=e.fields;return"{"+M(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+Ie("(",M(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:qt(function(t){var e=t.directives,r=t.operationTypes;return M(["schema",M(e," "),Vt(r)]," ")}),OperationTypeDefinition:function(e){var r=e.operation,n=e.type;return r+": "+n},ScalarTypeDefinition:qt(function(t){var e=t.name,r=t.directives;return M(["scalar",e,M(r," ")]," ")}),ObjectTypeDefinition:qt(function(t){var e=t.name,r=t.interfaces,n=t.directives,i=t.fields;return M(["type",e,Ie("implements ",M(r," & ")),M(n," "),Vt(i)]," ")}),FieldDefinition:qt(function(t){var e=t.name,r=t.arguments,n=t.type,i=t.directives;return e+(Wp(r)?Ie(`(
|
|
14
|
+
`,Do(M(r,`
|
|
15
15
|
`)),`
|
|
16
|
-
)`):
|
|
17
|
-
`,
|
|
16
|
+
)`):Ie("(",M(r,", "),")"))+": "+n+Ie(" ",M(i," "))}),InputValueDefinition:qt(function(t){var e=t.name,r=t.type,n=t.defaultValue,i=t.directives;return M([e+": "+r,Ie("= ",n),M(i," ")]," ")}),InterfaceTypeDefinition:qt(function(t){var e=t.name,r=t.interfaces,n=t.directives,i=t.fields;return M(["interface",e,Ie("implements ",M(r," & ")),M(n," "),Vt(i)]," ")}),UnionTypeDefinition:qt(function(t){var e=t.name,r=t.directives,n=t.types;return M(["union",e,M(r," "),n&&n.length!==0?"= "+M(n," | "):""]," ")}),EnumTypeDefinition:qt(function(t){var e=t.name,r=t.directives,n=t.values;return M(["enum",e,M(r," "),Vt(n)]," ")}),EnumValueDefinition:qt(function(t){var e=t.name,r=t.directives;return M([e,M(r," ")]," ")}),InputObjectTypeDefinition:qt(function(t){var e=t.name,r=t.directives,n=t.fields;return M(["input",e,M(r," "),Vt(n)]," ")}),DirectiveDefinition:qt(function(t){var e=t.name,r=t.arguments,n=t.repeatable,i=t.locations;return"directive @"+e+(Wp(r)?Ie(`(
|
|
17
|
+
`,Do(M(r,`
|
|
18
18
|
`)),`
|
|
19
|
-
)`):
|
|
20
|
-
`)}}function
|
|
21
|
-
`,
|
|
19
|
+
)`):Ie("(",M(r,", "),")"))+(n?" repeatable":"")+" on "+M(i," | ")}),SchemaExtension:function(e){var r=e.directives,n=e.operationTypes;return M(["extend schema",M(r," "),Vt(n)]," ")},ScalarTypeExtension:function(e){var r=e.name,n=e.directives;return M(["extend scalar",r,M(n," ")]," ")},ObjectTypeExtension:function(e){var r=e.name,n=e.interfaces,i=e.directives,a=e.fields;return M(["extend type",r,Ie("implements ",M(n," & ")),M(i," "),Vt(a)]," ")},InterfaceTypeExtension:function(e){var r=e.name,n=e.interfaces,i=e.directives,a=e.fields;return M(["extend interface",r,Ie("implements ",M(n," & ")),M(i," "),Vt(a)]," ")},UnionTypeExtension:function(e){var r=e.name,n=e.directives,i=e.types;return M(["extend union",r,M(n," "),i&&i.length!==0?"= "+M(i," | "):""]," ")},EnumTypeExtension:function(e){var r=e.name,n=e.directives,i=e.values;return M(["extend enum",r,M(n," "),Vt(i)]," ")},InputObjectTypeExtension:function(e){var r=e.name,n=e.directives,i=e.fields;return M(["extend input",r,M(n," "),Vt(i)]," ")}};function qt(t){return function(e){return M([e.description,t(e)],`
|
|
20
|
+
`)}}function M(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 Vt(t){return Ie(`{
|
|
21
|
+
`,Do(M(t,`
|
|
22
22
|
`)),`
|
|
23
|
-
}`)}function
|
|
24
|
-
`))}function
|
|
25
|
-
`)!==-1}function ff(t){return t!=null&&t.some(Lm)}function Ri(t){return t.kind===Oe.FIELD||t.kind===Oe.FRAGMENT_SPREAD||t.kind===Oe.INLINE_FRAGMENT}function pf(){return typeof Xa=="function"?ac():ac()}function Qm(){__DEV__?I(typeof Wr=="boolean",Wr):I(typeof Wr=="boolean",39)}pf();Qm();function er(t,e){var r=t.directives;return!r||!r.length?!0:df(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 Un(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 Kr}}),r?!n.size:n.size<i}function uc(t){return t&&Un(["client","export"],t,!0)}function Gm(t){var e=t.name.value;return e==="skip"||e==="include"}function df(t){var e=[];return t&&t.length&&t.forEach(function(r){if(!!Gm(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 lc(t,e){var r=e,n=[];t.definitions.forEach(function(a){if(a.kind==="OperationDefinition")throw __DEV__?new V("Found a ".concat(a.operation," operation").concat(a.name?" named '".concat(a.name.value,"'"):"",". ")+"No operations are allowed when using a fragment as a query. Only fragments are allowed."):new V(44);a.kind==="FragmentDefinition"&&n.push(a)}),typeof r>"u"&&(__DEV__?I(n.length===1,"Found ".concat(n.length," fragments. `fragmentName` must be provided when there is not exactly 1 fragment.")):I(n.length===1,45),r=n[0].name.value);var i=_(_({},t),{definitions:mr([{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:r}}]}}],t.definitions,!0)});return i}function Zr(t){t===void 0&&(t=[]);var e={};return t.forEach(function(r){e[r.name.value]=r}),e}function Yr(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 Ut(t){return{__ref:String(t)}}function K(t){return Boolean(t&&typeof t=="object"&&typeof t.__ref=="string")}function fc(t){return ee(t)&&t.kind==="Document"&&Array.isArray(t.definitions)}function Hm(t){return t.kind==="StringValue"}function Wm(t){return t.kind==="BooleanValue"}function Km(t){return t.kind==="IntValue"}function Zm(t){return t.kind==="FloatValue"}function Ym(t){return t.kind==="Variable"}function Jm(t){return t.kind==="ObjectValue"}function Xm(t){return t.kind==="ListValue"}function e1(t){return t.kind==="EnumValue"}function t1(t){return t.kind==="NullValue"}function yr(t,e,r,n){if(Km(r)||Zm(r))t[e.value]=Number(r.value);else if(Wm(r)||Hm(r))t[e.value]=r.value;else if(Jm(r)){var i={};r.fields.map(function(o){return yr(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(Xm(r))t[e.value]=r.values.map(function(o){var s={};return yr(s,e,o,n),s[e.value]});else if(e1(r))t[e.value]=r.value;else if(t1(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 pc(t,e){var r=null;t.directives&&(r={},t.directives.forEach(function(i){r[i.name.value]={},i.arguments&&i.arguments.forEach(function(a){var o=a.name,s=a.value;return yr(r[i.name.value],o,s,e)})}));var n=null;return t.arguments&&t.arguments.length&&(n={},t.arguments.forEach(function(i){var a=i.name,o=i.value;return yr(n,a,o,e)})),Li(t.name.value,n,r)}var r1=["connection","include","skip","client","rest","export"],Li=Object.assign(function(t,e,r){if(e&&r&&r.connection&&r.connection.key)if(r.connection.filter&&r.connection.filter.length>0){var n=r.connection.filter?r.connection.filter:[];n.sort();var i={};return n.forEach(function(s){i[s]=e[s]}),"".concat(r.connection.key,"(").concat(Pi(i),")")}else return r.connection.key;var a=t;if(e){var o=Pi(e);a+="(".concat(o,")")}return r&&Object.keys(r).forEach(function(s){r1.indexOf(s)===-1&&(r[s]&&Object.keys(r[s]).length?a+="@".concat(s,"(").concat(Pi(r[s]),")"):a+="@".concat(s))}),a},{setStringify:function(t){var e=Pi;return Pi=t,e}}),Pi=function(e){return JSON.stringify(e,n1)};function n1(t,e){return ee(e)&&!Array.isArray(e)&&(e=Object.keys(e).sort().reduce(function(r,n){return r[n]=e[n],r},{})),e}function tr(t,e){if(t.arguments&&t.arguments.length){var r={};return t.arguments.forEach(function(n){var i=n.name,a=n.value;return yr(r,i,a,e)}),r}return null}function _t(t){return t.alias?t.alias.value:t.name.value}function $i(t,e,r){if(typeof t.__typename=="string")return t.__typename;for(var n=0,i=e.selections;n<i.length;n++){var a=i[n];if(pt(a)){if(a.name.value==="__typename")return t[_t(a)]}else{var o=$i(t,Yr(a,r).selectionSet,r);if(typeof o=="string")return o}}}function pt(t){return t.kind==="Field"}function dc(t){return t.kind==="InlineFragment"}function qn(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 qn(t),t.definitions.filter(function(e){return e.kind==="OperationDefinition"})[0]}function Bn(t){return t.definitions.filter(function(e){return e.kind==="OperationDefinition"&&!!e.name}).map(function(e){return e.name.value})[0]||null}function Jr(t){return t.definitions.filter(function(e){return e.kind==="FragmentDefinition"})}function Fi(t){var e=qt(t);return __DEV__?I(e&&e.operation==="query","Must contain a query definition."):I(e&&e.operation==="query",50),e}function hc(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 Xr(t){qn(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 en(t){var e=Object.create(null),r=t&&t.variableDefinitions;return r&&r.length&&r.forEach(function(n){n.defaultValue&&yr(e,n.variable.name,n.defaultValue)}),e}var ue=Array.isArray;function Re(t){return Array.isArray(t)&&t.length>0}var hf={kind:Oe.FIELD,name:{kind:Oe.NAME,value:"__typename"}};function gf(t,e){return!t||t.selectionSet.selections.every(function(r){return r.kind===Oe.FRAGMENT_SPREAD&&gf(e[r.name.value],e)})}function i1(t){return gf(qt(t)||hc(t),Zr(Jr(t)))?null:t}function a1(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 mf(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=mf(""),n=mf(""),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=a1(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 C=i(D);C&&C.variables.add(b.name.value)}},FragmentSpread:{enter:function(b,v,m,A,D){if(c(b.directives))return d=!0,null;var C=i(D);C&&C.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(C){return C.kind===Oe.FIELD&&C.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 i1(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 tn=Object.assign(function(t){return Ke(t,{SelectionSet:{enter:function(e,r,n){if(!(n&&n.kind===Oe.OPERATION_DEFINITION)){var i=e.selections;if(!!i){var a=i.some(function(s){return pt(s)&&(s.name.value==="__typename"||s.name.value.lastIndexOf("__",0)===0)});if(!a){var o=n;if(!(pt(o)&&o.directives&&o.directives.some(function(s){return s.name.value==="export"})))return _(_({},e),{selections:mr(mr([],i,!0),[hf],!1)})}}}}}})},{added:function(t){return t===hf}}),o1={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 gc(t){return mc([o1],qn(t))}function yc(t){var e=Xr(t),r=e.operation;if(r==="query")return t;var n=Ke(t,{OperationDefinition:{enter:function(i){return _(_({},i),{operation:"query"})}}});return n}function vc(t){qn(t);var e=mc([{test:function(r){return r.name.value==="client"},remove:!0}],t);return e}var s1=Object.prototype.hasOwnProperty;function bc(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Mi(t)}function Mi(t){var e=t[0]||{},r=t.length;if(r>1)for(var n=new it,i=1;i<r;++i)e=n.merge(e,t[i]);return e}var c1=function(t,e,r){return this.merge(t[r],e[r])},it=function(){function t(e){e===void 0&&(e=c1),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(s1.call(e,o)){var s=e[o];if(r[o]!==s){var u=n.reconciler.apply(n,mr([e,r,o],i,!1));u!==s&&(e=n.shallowCopyForMerge(e),e[o]=u)}}else e=n.shallowCopyForMerge(e),e[o]=r[o]}),e):r},t.prototype.shallowCopyForMerge=function(e){return ee(e)&&(this.pastCopies.has(e)||(Array.isArray(e)?e=e.slice(0):e=_({__proto__:Object.getPrototypeOf(e)},e),this.pastCopies.add(e))),e},t}();function u1(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=l1(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 l1(t,e){if(!!t){if(typeof t=="string")return yf(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 yf(t,e)}}function yf(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 vf(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Ec(t,e,r){return e&&vf(t.prototype,e),r&&vf(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}var Cc=function(){return typeof Symbol=="function"},xc=function(t){return Cc()&&Boolean(Symbol[t])},kc=function(t){return xc(t)?Symbol[t]:"@@"+t};Cc()&&!xc("observable")&&(Symbol.observable=Symbol("observable"));var f1=kc("iterator"),wc=kc("observable"),bf=kc("species");function ro(t,e){var r=t[e];if(r!=null){if(typeof r!="function")throw new TypeError(r+" is not a function");return r}}function ji(t){var e=t.constructor;return e!==void 0&&(e=e[bf],e===null&&(e=void 0)),e!==void 0?e:H}function p1(t){return t instanceof H}function Vn(t){Vn.log?Vn.log(t):setTimeout(function(){throw t})}function to(t){Promise.resolve().then(function(){try{t()}catch(e){Vn(e)}})}function _f(t){var e=t._cleanup;if(e!==void 0&&(t._cleanup=void 0,!!e))try{if(typeof e=="function")e();else{var r=ro(e,"unsubscribe");r&&r.call(e)}}catch(n){Vn(n)}}function Sc(t){t._observer=void 0,t._queue=void 0,t._state="closed"}function d1(t){var e=t._queue;if(!!e){t._queue=void 0,t._state="ready";for(var r=0;r<e.length&&(wf(t,e[r].type,e[r].value),t._state!=="closed");++r);}}function wf(t,e,r){t._state="running";var n=t._observer;try{var i=ro(n,e);switch(e){case"next":i&&i.call(n,r);break;case"error":if(Sc(t),i)i.call(n,r);else throw r;break;case"complete":Sc(t),i&&i.call(n);break}}catch(a){Vn(a)}t._state==="closed"?_f(t):t._state==="running"&&(t._state="ready")}function _c(t,e,r){if(t._state!=="closed"){if(t._state==="buffering"){t._queue.push({type:e,value:r});return}if(t._state!=="ready"){t._state="buffering",t._queue=[{type:e,value:r}],to(function(){return d1(t)});return}wf(t,e,r)}}var h1=function(){function t(r,n){this._cleanup=void 0,this._observer=r,this._queue=void 0,this._state="initializing";var i=new m1(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"&&(Sc(this),_f(this))},Ec(t,[{key:"closed",get:function(){return this._state==="closed"}}]),t}(),m1=function(){function t(r){this._subscription=r}var e=t.prototype;return e.next=function(n){_c(this._subscription,"next",n)},e.error=function(n){_c(this._subscription,"error",n)},e.complete=function(){_c(this._subscription,"complete")},Ec(t,[{key:"closed",get:function(){return this._subscription._state==="closed"}}]),t}(),H=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 h1(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[wc]=function(){return this},t.from=function(n){var i=typeof this=="function"?this:t;if(n==null)throw new TypeError(n+" is not an object");var a=ro(n,wc);if(a){var o=a.call(n);if(Object(o)!==o)throw new TypeError(o+" is not an object");return p1(o)&&o.constructor===i?o:new i(function(s){return o.subscribe(s)})}if(xc("iterator")&&(a=ro(n,f1),a))return new i(function(s){to(function(){if(!s.closed){for(var u=u1(a.call(n)),c;!(c=u()).done;){var l=c.value;if(s.next(l),s.closed)return}s.complete()}})});if(Array.isArray(n))return new i(function(s){to(function(){if(!s.closed){for(var u=0;u<n.length;++u)if(s.next(n[u]),s.closed)return;s.complete()}})});throw new TypeError(n+" is not observable")},t.of=function(){for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];var o=typeof this=="function"?this:t;return new o(function(s){to(function(){if(!s.closed){for(var u=0;u<i.length;++u)if(s.next(i[u]),s.closed)return;s.complete()}})})},Ec(t,null,[{key:bf,get:function(){return this}}]),t}();Cc()&&Object.defineProperty(H,Symbol("extensions"),{value:{symbol:wc,hostReportError:Vn},configurable:!0});function Tc(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 zn;typeof self<"u"?zn=self:typeof window<"u"?zn=window:typeof global<"u"?zn=global:typeof module<"u"?zn=module:zn=Function("return this")();var y_=Tc(zn);var Sf=H.prototype,Ef="@@observable";Sf[Ef]||(Sf[Ef]=function(){return this});var g1=Object.prototype.toString;function no(t){return Ac(t)}function Ac(t,e){switch(g1.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]=Ac(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]=Ac(t[i],e)}),n}default:return t}}function y1(t){var e=new Set([t]);return e.forEach(function(r){ee(r)&&v1(r)===r&&Object.getOwnPropertyNames(r).forEach(function(n){ee(r[n])&&e.add(r[n])})}),t}function v1(t){if(__DEV__&&!Object.isFrozen(t))try{Object.freeze(t)}catch(e){if(e instanceof TypeError)return null;throw e}return t}function Ui(t){return __DEV__&&y1(t),t}function rn(t,e,r){var n=[];t.forEach(function(i){return i[e]&&n.push(i)}),n.forEach(function(i){return i[e](r)})}function io(t,e,r){return new H(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"&&Me(function(){return navigator.product})!=="ReactNative",Cf=typeof WeakSet=="function",Ic=typeof Symbol=="function"&&typeof Symbol.for=="function",vr=Ic&&Symbol.asyncIterator,O_=typeof Me(function(){return window.document.createElement})=="function",D_=Me(function(){return navigator.userAgent.indexOf("jsdom")>=0})||!1;function ao(t){function e(r){Object.defineProperty(t,r,{value:H})}return Ic&&Symbol.species&&e(Symbol.species),e("@@species"),t}function xf(t){return t&&typeof t.then=="function"}var Qn=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),rn(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),rn(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?xf(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"),rn(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 H(r)]),xf(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}(H);ao(Qn);function br(t){return"incremental"in t}function b1(t){return"hasNext"in t&&"data"in t}function kf(t){return br(t)||b1(t)}function oo(t,e){var r=t,n=new it;return br(e)&&Re(e.incremental)&&e.incremental.forEach(function(i){for(var a=i.data,o=i.path,s=o.length-1;s>=0;--s){var u=o[s],c=!isNaN(+u),l=c?[]:{};l[u]=a,a=l}r=n.merge(r,a)}),r}function Gn(t){var e=so(t);return Re(e)}function so(t){var e=Re(t.errors)?t.errors.slice(0):[];return br(t)&&Re(t.incremental)&&t.incremental.forEach(function(r){r.errors&&e.push.apply(e,r.errors)}),e}function _r(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=Object.create(null);return t.forEach(function(n){!n||Object.keys(n).forEach(function(i){var a=n[i];a!==void 0&&(r[i]=a)})}),r}var Tf=new Map;function qi(t){var e=Tf.get(t)||1;return Tf.set(t,e+1),"".concat(t,":").concat(e,":").concat(Math.random().toString(36).slice(2))}function Af(t){var e=qi("stringifyForDisplay");return JSON.stringify(t,function(r,n){return n===void 0?e:n}).split(JSON.stringify(e)).join("<undefined>")}function Bi(t,e){return _r(t,e,e.variables&&{variables:_(_({},t&&t.variables),e.variables)})}function co(t){return new H(function(e){e.error(t)})}var Vi=function(t,e,r){var n=new Error(r);throw n.name="ServerError",n.response=t,n.statusCode=t.status,n.result=e,n};function Oc(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 Dc(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 Nc(t){var e={variables:t.variables||{},extensions:t.extensions||{},operationName:t.operationName,query:t.query};return e.operationName||(e.operationName=typeof e.query!="string"?Bn(e.query)||void 0:""),e}function If(t,e){return e?e(t):H.of()}function zi(t){return typeof t=="function"?new St(t):t}function uo(t){return t.request.length<=1}var _1=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 H.of()})},t.from=function(e){return e.length===0?t.empty():e.map(zi).reduce(function(r,n){return r.concat(n)})},t.split=function(e,r,n){var i=zi(r),a=zi(n||new t(If));return uo(i)&&uo(a)?new t(function(o){return e(o)?i.request(o)||H.of():a.request(o)||H.of()}):new t(function(o,s){return e(o)?i.request(o,s)||H.of():a.request(o,s)||H.of()})},t.execute=function(e,r){return e.request(Dc(r.context,Nc(Oc(r))))||H.of()},t.concat=function(e,r){var n=zi(e);if(uo(n))return __DEV__&&I.warn(new _1("You are calling concat on a terminating link, which will have no effect",n)),n;var i=zi(r);return uo(i)?new t(function(a){return n.request(a,function(o){return i.request(o)||H.of()})||H.of()}):new t(function(a,o){return n.request(a,function(s){return i.request(s,o)||H.of()})||H.of()})},t.prototype.split=function(e,r,n){return this.concat(t.split(e,r,n||new t(If)))},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 Hn=St.execute;var Of="3.7.10";function Df(t){return!!t.body}function Nf(t){return!!t.getReader}function Rf(t){return!!(vr&&t[Symbol.asyncIterator])}function Pf(t){return!!t.stream}function Lf(t){return!!t.arrayBuffer}function $f(t){return!!t.pipe}function Rc(t){var e,r=t[Symbol.asyncIterator]();return e={next:function(){return r.next()}},e[Symbol.asyncIterator]=function(){return this},e}function Pc(t){var e=null,r=null,n=!1,i=[],a=[];function o(d){if(!r){if(a.length){var p=a.shift();if(Array.isArray(p)&&p[0])return p[0]({value:d,done:!1})}i.push(d)}}function s(d){r=d;var p=a.slice();p.forEach(function(f){f[1](d)}),!e||e()}function u(){n=!0;var d=a.slice();d.forEach(function(p){p[0]({value:void 0,done:!0})}),!e||e()}e=function(){e=null,t.removeListener("data",o),t.removeListener("error",s),t.removeListener("end",u),t.removeListener("finish",u),t.removeListener("close",u)},t.on("data",o),t.on("error",s),t.on("end",u),t.on("finish",u),t.on("close",u);function c(){return new Promise(function(d,p){if(r)return p(r);if(i.length)return d({value:i.shift(),done:!1});if(n)return d({value:void 0,done:!0});a.push([d,p])})}var l={next:function(){return c()}};return vr&&(l[Symbol.asyncIterator]=function(){return this}),l}function Lc(t){var e=!1,r={next:function(){return e?Promise.resolve({value:void 0,done:!0}):(e=!0,new Promise(function(n,i){t.then(function(a){n({value:a,done:!1})}).catch(i)}))}};return vr&&(r[Symbol.asyncIterator]=function(){return this}),r}function lo(t){var e={next:function(){return t.read()}};return vr&&(e[Symbol.asyncIterator]=function(){return this}),e}function Ff(t){var e=t;if(Df(t)&&(e=t.body),Rf(e))return Rc(e);if(Nf(e))return lo(e.getReader());if(Pf(e))return lo(e.stream().getReader());if(Lf(e))return Lc(e.arrayBuffer());if($f(e))return Pc(e);throw new Error("Unknown body type for responseIterator. Please pass a streamable response.")}var Mf=Object.prototype.hasOwnProperty;function jf(t,e){var r,n,i;return Tt(this,void 0,void 0,function(){var a,o,s,u,c,l,d,p,f,h,g,y,S,b,v,m,A,D,C,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=Ff(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 Ie(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";return e!=null&&e!==""?t+e+r:""}function Do(t){return Ie(" ",t.replace(/\n/g,`
|
|
24
|
+
`))}function km(t){return t.indexOf(`
|
|
25
|
+
`)!==-1}function Wp(t){return t!=null&&t.some(km)}function ra(t){return t.kind===$e.FIELD||t.kind===$e.FRAGMENT_SPREAD||t.kind===$e.INLINE_FRAGMENT}function Kp(){return typeof Oo=="function"?Bc():Bc()}function Lm(){__DEV__?D(typeof hn=="boolean",hn):D(typeof hn=="boolean",39)}Kp();Lm();function dr(t,e){var r=t.directives;return!r||!r.length?!0:Zp(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__?D(o!==void 0,"Invalid variable referenced in @".concat(i.name.value," directive.")):D(o!==void 0,40)):o=a.value.value,i.name.value==="skip"?!o:o})}function oi(t,e,r){var n=new Set(t),i=n.size;return nt(e,{Directive:function(a){if(n.delete(a.name.value)&&(!r||!n.size))return mn}}),r?!n.size:n.size<i}function zc(t){return t&&oi(["client","export"],t,!0)}function Fm(t){var e=t.name.value;return e==="skip"||e==="include"}function Zp(t){var e=[];return t&&t.length&&t.forEach(function(r){if(!!Fm(r)){var n=r.arguments,i=r.name.value;__DEV__?D(n&&n.length===1,"Incorrect number of arguments for the @".concat(i," directive.")):D(n&&n.length===1,41);var a=n[0];__DEV__?D(a.name&&a.name.value==="if","Invalid argument for the @".concat(i," directive.")):D(a.name&&a.name.value==="if",42);var o=a.value;__DEV__?D(o&&(o.kind==="Variable"||o.kind==="BooleanValue"),"Argument for the @".concat(i," directive must be a variable or a boolean value.")):D(o&&(o.kind==="Variable"||o.kind==="BooleanValue"),43),e.push({directive:r,ifArgument:a})}}),e}function Gc(t,e){var r=e,n=[];t.definitions.forEach(function(a){if(a.kind==="OperationDefinition")throw __DEV__?new z("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 z(44);a.kind==="FragmentDefinition"&&n.push(a)}),typeof r>"u"&&(__DEV__?D(n.length===1,"Found ".concat(n.length," fragments. `fragmentName` must be provided when there is not exactly 1 fragment.")):D(n.length===1,45),r=n[0].name.value);var i=w(w({},t),{definitions:Dr([{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:r}}]}}],t.definitions,!0)});return i}function gn(t){t===void 0&&(t=[]);var e={};return t.forEach(function(r){e[r.name.value]=r}),e}function yn(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__?D(n,"No fragment named ".concat(r)):D(n,46),n||null}default:return null}}function oe(t){return t!==null&&typeof t=="object"}function Jt(t){return{__ref:String(t)}}function ee(t){return Boolean(t&&typeof t=="object"&&typeof t.__ref=="string")}function Hc(t){return oe(t)&&t.kind==="Document"&&Array.isArray(t.definitions)}function Mm(t){return t.kind==="StringValue"}function Um(t){return t.kind==="BooleanValue"}function jm(t){return t.kind==="IntValue"}function Bm(t){return t.kind==="FloatValue"}function qm(t){return t.kind==="Variable"}function Vm(t){return t.kind==="ObjectValue"}function Qm(t){return t.kind==="ListValue"}function zm(t){return t.kind==="EnumValue"}function Gm(t){return t.kind==="NullValue"}function Pr(t,e,r,n){if(jm(r)||Bm(r))t[e.value]=Number(r.value);else if(Um(r)||Mm(r))t[e.value]=r.value;else if(Vm(r)){var i={};r.fields.map(function(o){return Pr(i,o.name,o.value,n)}),t[e.value]=i}else if(qm(r)){var a=(n||{})[r.name.value];t[e.value]=a}else if(Qm(r))t[e.value]=r.values.map(function(o){var s={};return Pr(s,e,o,n),s[e.value]});else if(zm(r))t[e.value]=r.value;else if(Gm(r))t[e.value]=null;else throw __DEV__?new z('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 z(55)}function Wc(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 Pr(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 Pr(n,a,o,e)})),ia(t.name.value,n,r)}var Hm=["connection","include","skip","client","rest","export"],ia=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(na(i),")")}else return r.connection.key;var a=t;if(e){var o=na(e);a+="(".concat(o,")")}return r&&Object.keys(r).forEach(function(s){Hm.indexOf(s)===-1&&(r[s]&&Object.keys(r[s]).length?a+="@".concat(s,"(").concat(na(r[s]),")"):a+="@".concat(s))}),a},{setStringify:function(t){var e=na;return na=t,e}}),na=function(e){return JSON.stringify(e,Wm)};function Wm(t,e){return oe(e)&&!Array.isArray(e)&&(e=Object.keys(e).sort().reduce(function(r,n){return r[n]=e[n],r},{})),e}function hr(t,e){if(t.arguments&&t.arguments.length){var r={};return t.arguments.forEach(function(n){var i=n.name,a=n.value;return Pr(r,i,a,e)}),r}return null}function Nt(t){return t.alias?t.alias.value:t.name.value}function aa(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(Ct(a)){if(a.name.value==="__typename")return t[Nt(a)]}else{var o=aa(t,yn(a,r).selectionSet,r);if(typeof o=="string")return o}}}function Ct(t){return t.kind==="Field"}function Kc(t){return t.kind==="InlineFragment"}function si(t){__DEV__?D(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'):D(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 z('Schema type definitions not allowed in queries. Found: "'.concat(r.kind,'"')):new z(48);return r});return __DEV__?D(e.length<=1,"Ambiguous GraphQL document: contains ".concat(e.length," operations")):D(e.length<=1,49),t}function Yt(t){return si(t),t.definitions.filter(function(e){return e.kind==="OperationDefinition"})[0]}function ci(t){return t.definitions.filter(function(e){return e.kind==="OperationDefinition"&&!!e.name}).map(function(e){return e.name.value})[0]||null}function vn(t){return t.definitions.filter(function(e){return e.kind==="FragmentDefinition"})}function oa(t){var e=Yt(t);return __DEV__?D(e&&e.operation==="query","Must contain a query definition."):D(e&&e.operation==="query",50),e}function Zc(t){__DEV__?D(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'):D(t.kind==="Document",51),__DEV__?D(t.definitions.length<=1,"Fragment must have exactly one definition."):D(t.definitions.length<=1,52);var e=t.definitions[0];return __DEV__?D(e.kind==="FragmentDefinition","Must be a fragment definition."):D(e.kind==="FragmentDefinition",53),e}function bn(t){si(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 z("Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment."):new z(54)}function _n(t){var e=Object.create(null),r=t&&t.variableDefinitions;return r&&r.length&&r.forEach(function(n){n.defaultValue&&Pr(e,n.variable.name,n.defaultValue)}),e}var he=Array.isArray;function Ue(t){return Array.isArray(t)&&t.length>0}var Jp={kind:$e.FIELD,name:{kind:$e.NAME,value:"__typename"}};function Xp(t,e){return!t||t.selectionSet.selections.every(function(r){return r.kind===$e.FRAGMENT_SPREAD&&Xp(e[r.name.value],e)})}function Km(t){return Xp(Yt(t)||Zc(t),gn(vn(t)))?null:t}function Zm(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 Yp(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 Jc(t,e){for(var r=Yp(""),n=Yp(""),i=function(_){for(var b=0,y=void 0;b<_.length&&(y=_[b]);++b)if(!he(y)){if(y.kind===$e.OPERATION_DEFINITION)return r(y.name&&y.name.value);if(y.kind===$e.FRAGMENT_DEFINITION)return n(y.name.value)}return __DEV__&&D.error("Could not find operation or fragment"),null},a=0,o=e.definitions.length-1;o>=0;--o)e.definitions[o].kind===$e.OPERATION_DEFINITION&&++a;var s=Zm(t),u=t.some(function(_){return _.remove}),c=function(_){return u&&_&&_.some(s)},l=new Map,d=!1,f={enter:function(_){if(c(_.directives))return d=!0,null}},p=nt(e,{Field:f,InlineFragment:f,VariableDefinition:{enter:function(){return!1}},Variable:{enter:function(_,b,y,T,R){var k=i(R);k&&k.variables.add(_.name.value)}},FragmentSpread:{enter:function(_,b,y,T,R){if(c(_.directives))return d=!0,null;var k=i(R);k&&k.fragmentSpreads.add(_.name.value)}},FragmentDefinition:{enter:function(_,b,y,T){l.set(JSON.stringify(T),_)},leave:function(_,b,y,T){var R=l.get(JSON.stringify(T));if(_===R)return _;if(a>0&&_.selectionSet.selections.every(function(k){return k.kind===$e.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(y){_.transitiveVars.add(y)})})),_},g=new Set;p.definitions.forEach(function(_){_.kind===$e.OPERATION_DEFINITION?h(r(_.name&&_.name.value)).fragmentSpreads.forEach(function(b){g.add(b)}):_.kind===$e.FRAGMENT_DEFINITION&&a===0&&!n(_.name.value).removed&&g.add(_.name.value)}),g.forEach(function(_){h(n(_)).fragmentSpreads.forEach(function(b){g.add(b)})});var v=function(_){return!!(!g.has(_)||n(_).removed)},C={enter:function(_){if(v(_.name.value))return null}};return Km(nt(p,{FragmentSpread:C,FragmentDefinition:C,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(y){return b.has(y.variable.name.value)})})}}}}))}var wn=Object.assign(function(t){return nt(t,{SelectionSet:{enter:function(e,r,n){if(!(n&&n.kind===$e.OPERATION_DEFINITION)){var i=e.selections;if(!!i){var a=i.some(function(s){return Ct(s)&&(s.name.value==="__typename"||s.name.value.lastIndexOf("__",0)===0)});if(!a){var o=n;if(!(Ct(o)&&o.directives&&o.directives.some(function(s){return s.name.value==="export"})))return w(w({},e),{selections:Dr(Dr([],i,!0),[Jp],!1)})}}}}}})},{added:function(t){return t===Jp}}),Jm={test:function(t){var e=t.name.value==="connection";return e&&(!t.arguments||!t.arguments.some(function(r){return r.name.value==="key"}))&&__DEV__&&D.warn("Removing an @connection directive even though it does not have a key. You may want to use the key parameter to specify a store key."),e}};function Yc(t){return Jc([Jm],si(t))}function Xc(t){var e=bn(t),r=e.operation;if(r==="query")return t;var n=nt(t,{OperationDefinition:{enter:function(i){return w(w({},i),{operation:"query"})}}});return n}function eu(t){si(t);var e=Jc([{test:function(r){return r.name.value==="client"},remove:!0}],t);return e}var Ym=Object.prototype.hasOwnProperty;function tu(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return sa(t)}function sa(t){var e=t[0]||{},r=t.length;if(r>1)for(var n=new ht,i=1;i<r;++i)e=n.merge(e,t[i]);return e}var Xm=function(t,e,r){return this.merge(t[r],e[r])},ht=function(){function t(e){e===void 0&&(e=Xm),this.reconciler=e,this.isObject=oe,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 oe(r)&&oe(e)?(Object.keys(r).forEach(function(o){if(Ym.call(e,o)){var s=e[o];if(r[o]!==s){var u=n.reconciler.apply(n,Dr([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 oe(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 eg(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=tg(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 tg(t,e){if(!!t){if(typeof t=="string")return ef(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 ef(t,e)}}function ef(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 tf(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 au(t,e,r){return e&&tf(t.prototype,e),r&&tf(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}var ou=function(){return typeof Symbol=="function"},su=function(t){return ou()&&Boolean(Symbol[t])},cu=function(t){return su(t)?Symbol[t]:"@@"+t};ou()&&!su("observable")&&(Symbol.observable=Symbol("observable"));var rg=cu("iterator"),nu=cu("observable"),rf=cu("species");function Po(t,e){var r=t[e];if(r!=null){if(typeof r!="function")throw new TypeError(r+" is not a function");return r}}function ca(t){var e=t.constructor;return e!==void 0&&(e=e[rf],e===null&&(e=void 0)),e!==void 0?e:Y}function ng(t){return t instanceof Y}function ui(t){ui.log?ui.log(t):setTimeout(function(){throw t})}function No(t){Promise.resolve().then(function(){try{t()}catch(e){ui(e)}})}function nf(t){var e=t._cleanup;if(e!==void 0&&(t._cleanup=void 0,!!e))try{if(typeof e=="function")e();else{var r=Po(e,"unsubscribe");r&&r.call(e)}}catch(n){ui(n)}}function iu(t){t._observer=void 0,t._queue=void 0,t._state="closed"}function ig(t){var e=t._queue;if(!!e){t._queue=void 0,t._state="ready";for(var r=0;r<e.length&&(af(t,e[r].type,e[r].value),t._state!=="closed");++r);}}function af(t,e,r){t._state="running";var n=t._observer;try{var i=Po(n,e);switch(e){case"next":i&&i.call(n,r);break;case"error":if(iu(t),i)i.call(n,r);else throw r;break;case"complete":iu(t),i&&i.call(n);break}}catch(a){ui(a)}t._state==="closed"?nf(t):t._state==="running"&&(t._state="ready")}function ru(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 ig(t)});return}af(t,e,r)}}var ag=function(){function t(r,n){this._cleanup=void 0,this._observer=r,this._queue=void 0,this._state="initializing";var i=new og(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"&&(iu(this),nf(this))},au(t,[{key:"closed",get:function(){return this._state==="closed"}}]),t}(),og=function(){function t(r){this._subscription=r}var e=t.prototype;return e.next=function(n){ru(this._subscription,"next",n)},e.error=function(n){ru(this._subscription,"error",n)},e.complete=function(){ru(this._subscription,"complete")},au(t,[{key:"closed",get:function(){return this._subscription._state==="closed"}}]),t}(),Y=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 ag(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=ca(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=ca(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=ca(this),o=arguments.length>1,s=!1,u=arguments[1],c=u;return new a(function(l){return i.subscribe({next:function(d){var f=!s;if(s=!0,!f||o)try{c=n(c,d)}catch(p){return l.error(p)}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=ca(this);return new s(function(u){var c,l=0;function d(f){c=f.subscribe({next:function(p){u.next(p)},error:function(p){u.error(p)},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=ca(this);return new a(function(o){var s=[],u=i.subscribe({next:function(l){if(n)try{l=n(l)}catch(f){return o.error(f)}var d=a.from(l).subscribe({next:function(f){o.next(f)},error:function(f){o.error(f)},complete:function(){var f=s.indexOf(d);f>=0&&s.splice(f,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[nu]=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=Po(n,nu);if(a){var o=a.call(n);if(Object(o)!==o)throw new TypeError(o+" is not an object");return ng(o)&&o.constructor===i?o:new i(function(s){return o.subscribe(s)})}if(su("iterator")&&(a=Po(n,rg),a))return new i(function(s){No(function(){if(!s.closed){for(var u=eg(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()}})})},au(t,null,[{key:rf,get:function(){return this}}]),t}();ou()&&Object.defineProperty(Y,Symbol("extensions"),{value:{symbol:nu,hostReportError:ui},configurable:!0});function uu(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 li;typeof self<"u"?li=self:typeof window<"u"?li=window:typeof global<"u"?li=global:typeof module<"u"?li=module:li=Function("return this")();var l_=uu(li);var of=Y.prototype,sf="@@observable";of[sf]||(of[sf]=function(){return this});var sg=Object.prototype.toString;function Ro(t){return lu(t)}function lu(t,e){switch(sg.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]=lu(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]=lu(t[i],e)}),n}default:return t}}function cg(t){var e=new Set([t]);return e.forEach(function(r){oe(r)&&ug(r)===r&&Object.getOwnPropertyNames(r).forEach(function(n){oe(r[n])&&e.add(r[n])})}),t}function ug(t){if(__DEV__&&!Object.isFrozen(t))try{Object.freeze(t)}catch(e){if(e instanceof TypeError)return null;throw e}return t}function ua(t){return __DEV__&&cg(t),t}function Sn(t,e,r){var n=[];t.forEach(function(i){return i[e]&&n.push(i)}),n.forEach(function(i){return i[e](r)})}function $o(t,e,r){return new Y(function(n){var i=n.next,a=n.error,o=n.complete,s=0,u=!1,c={then:function(p){return new Promise(function(h){return h(p())})}};function l(p,h){return p?function(g){++s;var v=function(){return p(g)};c=c.then(v,v).then(function(C){--s,i&&i.call(n,C),u&&d.complete()},function(C){throw--s,C}).catch(function(C){a&&a.call(n,C)})}: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)}},f=t.subscribe(d);return function(){return f.unsubscribe()}})}var Pt=typeof WeakMap=="function"&&Ge(function(){return navigator.product})!=="ReactNative",cf=typeof WeakSet=="function",pu=typeof Symbol=="function"&&typeof Symbol.for=="function",Rr=pu&&Symbol.asyncIterator,C_=typeof Ge(function(){return window.document.createElement})=="function",x_=Ge(function(){return navigator.userAgent.indexOf("jsdom")>=0})||!1;function Lo(t){function e(r){Object.defineProperty(t,r,{value:Y})}return pu&&Symbol.species&&e(Symbol.species),e("@@species"),t}function uf(t){return t&&typeof t.then=="function"}var pi=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),Sn(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),Sn(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?uf(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"),Sn(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 Y(r)]),uf(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}(Y);Lo(pi);function $r(t){return"incremental"in t}function lg(t){return"hasNext"in t&&"data"in t}function lf(t){return $r(t)||lg(t)}function Fo(t,e){var r=t,n=new ht;return $r(e)&&Ue(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 fi(t){var e=Mo(t);return Ue(e)}function Mo(t){var e=Ue(t.errors)?t.errors.slice(0):[];return $r(t)&&Ue(t.incremental)&&t.incremental.forEach(function(r){r.errors&&e.push.apply(e,r.errors)}),e}function Lr(){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 pf=new Map;function la(t){var e=pf.get(t)||1;return pf.set(t,e+1),"".concat(t,":").concat(e,":").concat(Math.random().toString(36).slice(2))}function ff(t){var e=la("stringifyForDisplay");return JSON.stringify(t,function(r,n){return n===void 0?e:n}).split(JSON.stringify(e)).join("<undefined>")}function pa(t,e){return Lr(t,e,e.variables&&{variables:w(w({},t&&t.variables),e.variables)})}function Uo(t){return new Y(function(e){e.error(t)})}var fa=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 fu(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 z("illegal argument: ".concat(i)):new z(27)}return t}function du(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 hu(t){var e={variables:t.variables||{},extensions:t.extensions||{},operationName:t.operationName,query:t.query};return e.operationName||(e.operationName=typeof e.query!="string"?ci(e.query)||void 0:""),e}function df(t,e){return e?e(t):Y.of()}function da(t){return typeof t=="function"?new Rt(t):t}function jo(t){return t.request.length<=1}var pg=function(t){Oe(e,t);function e(r,n){var i=t.call(this,r)||this;return i.link=n,i}return e}(Error),Rt=function(){function t(e){e&&(this.request=e)}return t.empty=function(){return new t(function(){return Y.of()})},t.from=function(e){return e.length===0?t.empty():e.map(da).reduce(function(r,n){return r.concat(n)})},t.split=function(e,r,n){var i=da(r),a=da(n||new t(df));return jo(i)&&jo(a)?new t(function(o){return e(o)?i.request(o)||Y.of():a.request(o)||Y.of()}):new t(function(o,s){return e(o)?i.request(o,s)||Y.of():a.request(o,s)||Y.of()})},t.execute=function(e,r){return e.request(du(r.context,hu(fu(r))))||Y.of()},t.concat=function(e,r){var n=da(e);if(jo(n))return __DEV__&&D.warn(new pg("You are calling concat on a terminating link, which will have no effect",n)),n;var i=da(r);return jo(i)?new t(function(a){return n.request(a,function(o){return i.request(o)||Y.of()})||Y.of()}):new t(function(a,o){return n.request(a,function(s){return i.request(s,o)||Y.of()})||Y.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 z("request is not implemented"):new z(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 di=Rt.execute;var hf="3.7.10";function mf(t){return!!t.body}function gf(t){return!!t.getReader}function yf(t){return!!(Rr&&t[Symbol.asyncIterator])}function vf(t){return!!t.stream}function bf(t){return!!t.arrayBuffer}function _f(t){return!!t.pipe}function mu(t){var e,r=t[Symbol.asyncIterator]();return e={next:function(){return r.next()}},e[Symbol.asyncIterator]=function(){return this},e}function gu(t){var e=null,r=null,n=!1,i=[],a=[];function o(d){if(!r){if(a.length){var f=a.shift();if(Array.isArray(f)&&f[0])return f[0]({value:d,done:!1})}i.push(d)}}function s(d){r=d;var f=a.slice();f.forEach(function(p){p[1](d)}),!e||e()}function u(){n=!0;var d=a.slice();d.forEach(function(f){f[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,f){if(r)return f(r);if(i.length)return d({value:i.shift(),done:!1});if(n)return d({value:void 0,done:!0});a.push([d,f])})}var l={next:function(){return c()}};return Rr&&(l[Symbol.asyncIterator]=function(){return this}),l}function yu(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 Rr&&(r[Symbol.asyncIterator]=function(){return this}),r}function Bo(t){var e={next:function(){return t.read()}};return Rr&&(e[Symbol.asyncIterator]=function(){return this}),e}function wf(t){var e=t;if(mf(t)&&(e=t.body),yf(e))return mu(e);if(gf(e))return Bo(e.getReader());if(vf(e))return Bo(e.stream().getReader());if(bf(e))return yu(e.arrayBuffer());if(_f(e))return gu(e);throw new Error("Unknown body type for responseIterator. Please pass a streamable response.")}var Sf=Object.prototype.hasOwnProperty;function Cf(t,e){var r,n,i;return jt(this,void 0,void 0,function(){var a,o,s,u,c,l,d,f,p,h,g,v,C,_,b,y,T,R,k,P;return Bt(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=wf(t),f=!0,F.label=1;case 1:return f?[4,d.next()]:[3,3];case 2:for(p=F.sent(),h=p.value,g=p.done,v=typeof h=="string"?h:a.decode(h),f=!g,l+=v,C=l.indexOf(c);C>-1;){if(_=void 0,P=[l.slice(0,C),l.slice(C+c.length)],_=P[0],l=P[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
|
+
`),y=fg(_.slice(0,b)),T=y["content-type"],T&&T.toLowerCase().indexOf("application/json")===-1)throw new Error("Unsupported patch content type: application/json is required.");R=_.slice(b);try{k=xf(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($){qo($,e)}}C=l.indexOf(c)}return[3,1];case 3:return(i=e.complete)===null||i===void 0||i.call(e),[2]}})})}function fg(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 xf(t,e){if(t.status>=300){var r=function(){try{return JSON.parse(e)}catch{return e}};fa(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 qo(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 Ef(t,e,r){dg(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 qo(n,r)})}function dg(t){return function(e){return e.text().then(function(r){return xf(e,r)}).then(function(r){return e.status>=300&&fa(e,r,"Response not successful: Received status code ".concat(e.status)),!Array.isArray(r)&&!Sf.call(r,"data")&&!Sf.call(r,"errors")&&fa(e,r,"Server response was missing for query '".concat(Array.isArray(t)?t.map(function(n){return n.operationName}):t.operationName,"'.")),r})}}var ha=function(t,e){var r;try{r=JSON.stringify(t)}catch(i){var n=__DEV__?new z("Network request failed. ".concat(e," is not serializable: ").concat(i.message)):new z(24);throw n.parseError=i,n}return r};var hg={includeQuery:!0,includeExtensions:!1,preserveHeaderCase:!1},mg={accept:"*/*","content-type":"application/json"},gg={method:"POST"},kf={http:hg,headers:mg,options:gg},If=function(t,e){return e(t)};function Af(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=yg(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,ai)),{options:i,body:l}}function yg(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 Tf=function(t){if(!t&&typeof fetch>"u")throw __DEV__?new z(`
|
|
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 Gf=function(){if(typeof AbortController>"u")return{controller:!1,signal:!1};var t=new AbortController,e=t.signal;return{controller:t,signal:e}};var Hf=function(t,e){var r=t.getContext(),n=r.uri;return n||(typeof e=="function"?e(t):e||"/graphql")};function Wf(t,e){var r=[],n=function(d,p){r.push("".concat(d,"=").concat(encodeURIComponent(p)))};if("query"in e&&n("query",e.query),e.operationName&&n("operationName",e.operationName),e.variables){var i=void 0;try{i=Qi(e.variables,"Variables map")}catch(d){return{parseError:d}}n("variables",i)}if(e.extensions){var a=void 0;try{a=Qi(e.extensions,"Extensions map")}catch(d){return{parseError:d}}n("extensions",a)}var o="",s=t,u=t.indexOf("#");u!==-1&&(o=t.substr(u),s=t.substr(0,u));var c=s.indexOf("?")===-1?"?":"&",l=s+c+r.join("&")+o;return{newURI:l}}var Kf=Me(function(){return fetch}),Zf=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?Vf:i,o=t.includeExtensions,s=t.preserveHeaderCase,u=t.useGETForQueries,c=t.includeUnusedVariables,l=c===void 0?!1:c,d=jt(t,["uri","fetch","print","includeExtensions","preserveHeaderCase","useGETForQueries","includeUnusedVariables"]);__DEV__&&Qf(n||Kf);var p={http:{includeExtensions:o,preserveHeaderCase:s},options:d.fetchOptions,credentials:d.credentials,headers:d.headers};return new St(function(f){var h=Hf(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=zf(f,a,Bf,p,A),C=D.options,O=D.body;if(O.variables&&!l){var P=new Set(Object.keys(O.variables));Ke(f.query,{Variable:function(X,Ft,G){G&&G.kind!=="VariableDefinition"&&P.delete(X.name.value)}}),P.size&&(O.variables=_({},O.variables),P.forEach(function(X){delete O.variables[X]}))}var N;if(!C.signal){var U=Gf(),qe=U.controller,Ne=U.signal;N=qe,N&&(C.signal=Ne)}var q=function(X){return X.kind==="OperationDefinition"&&X.operation==="mutation"};if(u&&!f.query.definitions.some(q)&&(C.method="GET"),Un(["defer"],f.query)&&(C.headers=C.headers||{},C.headers.accept="multipart/mixed; deferSpec=20220824, application/json"),C.method==="GET"){var de=Wf(h,O),he=de.newURI,J=de.parseError;if(J)return co(J);h=he}else try{C.body=Qi(O,"Payload")}catch(X){return co(X)}return new H(function(X){var Ft=n||Me(function(){return fetch})||Kf;return Ft(h,C).then(function(G){var Mt;f.setContext({response:G});var fr=(Mt=G.headers)===null||Mt===void 0?void 0:Mt.get("content-type");return fr!==null&&/^multipart\/mixed/i.test(fr)?jf(G,X):qf(G,f,X)}).catch(function(G){return fo(G,X)}),function(){N&&N.abort()}})})};var $c=function(t){xe(e,t);function e(r){r===void 0&&(r={});var n=t.call(this,Zf(r).request)||this;return n.options=r,n}return e}(St);var{toString:Yf,hasOwnProperty:T1}=Object.prototype,Jf=Function.prototype.toString,Fc=new Map;function be(t,e){try{return Mc(t,e)}finally{Fc.clear()}}function Mc(t,e){if(t===e)return!0;let r=Yf.call(t),n=Yf.call(e);if(r!==n)return!1;switch(r){case"[object Array]":if(t.length!==e.length)return!1;case"[object Object]":{if(ep(t,e))return!0;let i=Xf(t),a=Xf(e),o=i.length;if(o!==a.length)return!1;for(let s=0;s<o;++s)if(!T1.call(e,i[s]))return!1;for(let s=0;s<o;++s){let u=i[s];if(!Mc(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(ep(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&&!Mc(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=Jf.call(t);return i!==Jf.call(e)?!1:!O1(i,I1)}}return!1}function Xf(t){return Object.keys(t).filter(A1,t)}function A1(t){return this[t]!==void 0}var I1="{ [native code] }";function O1(t,e){let r=t.length-e.length;return r>=0&&t.indexOf(e,r)===r}function ep(t,e){let r=Fc.get(t);if(r){if(r.has(e))return!0}else Fc.set(t,r=new Set);return r.add(e),!1}var D1=function(){return Object.create(null)},tp=Array.prototype,N1=tp.forEach,R1=tp.slice,Bt=function(){function t(e,r){e===void 0&&(e=!0),r===void 0&&(r=D1),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 N1.call(e,function(n){return r=r.getChildTrie(n)}),r.data||(r.data=this.makeData(R1.call(e)))},t.prototype.getChildTrie=function(e){var r=this.weakness&&P1(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 P1(t){switch(typeof t){case"object":if(t===null)break;case"function":return!0}return!1}var ze=null,rp={},L1=1,$1=()=>class{constructor(){this.id=["slot",L1++,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===rp)break;return e!==ze&&(ze.slots[this.id]=r),!0}return ze&&(ze.slots[this.id]=rp),!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 np(t){try{return t()}catch{}}var jc="@wry/context:Slot",F1=np(()=>globalThis)||np(()=>global)||Object.create(null),ip=F1,Wn=ip[jc]||Array[jc]||function(t){try{Object.defineProperty(ip,jc,{value:t,enumerable:!1,writable:!1,configurable:!0})}finally{return t}}($1());var{bind:M1,noContext:j1}=Wn;function U1(){}var q1=function(){function t(e,r){e===void 0&&(e=1/0),r===void 0&&(r=U1),this.max=e,this.dispose=r,this.map=new Map,this.newest=null,this.oldest=null}return t.prototype.has=function(e){return this.map.has(e)},t.prototype.get=function(e){var r=this.getNode(e);return r&&r.value},t.prototype.getNode=function(e){var r=this.map.get(e);if(r&&r!==this.newest){var n=r.older,i=r.newer;i&&(i.older=n),n&&(n.newer=i),r.older=this.newest,r.older.newer=r,r.newer=null,this.newest=r,r===this.oldest&&(this.oldest=i)}return r},t.prototype.set=function(e,r){var n=this.getNode(e);return n?n.value=r:(n={key:e,value:r,newer:null,older:this.newest},this.newest&&(this.newest.newer=n),this.newest=n,this.oldest=this.oldest||n,this.map.set(e,n),n.value)},t.prototype.clean=function(){for(;this.oldest&&this.map.size>this.max;)this.delete(this.oldest.key)},t.prototype.delete=function(e){var r=this.map.get(e);return r?(r===this.newest&&(this.newest=r.older),r===this.oldest&&(this.oldest=r.newer),r.newer&&(r.newer.older=r.older),r.older&&(r.older.newer=r.newer),this.map.delete(e),this.dispose(r.value,e),!0):!1},t}(),ho=new Wn,Uc,B1=Object.prototype.hasOwnProperty,Bc=(Uc=Array.from,Uc===void 0?function(t){var e=[];return t.forEach(function(r){return e.push(r)}),e}:Uc);function po(t){var e=t.unsubscribe;typeof e=="function"&&(t.unsubscribe=void 0,e())}var Gi=[],V1=100;function Kn(t,e){if(!t)throw new Error(e||"assertion failure")}function z1(t,e){var r=t.length;return r>0&&r===e.length&&t[r-1]===e[r-1]}function op(t){switch(t.length){case 0:throw new Error("unknown value");case 1:return t[0];case 2:throw t[1]}}function Q1(t){return t.slice(0)}var G1=function(){function t(e){this.fn=e,this.parents=new Set,this.childValues=new Map,this.dirtyChildren=null,this.dirty=!0,this.recomputing=!1,this.value=[],this.deps=null,++t.count}return t.prototype.peek=function(){if(this.value.length===1&&!wr(this))return ap(this),this.value[0]},t.prototype.recompute=function(e){return Kn(!this.recomputing,"already recomputing"),ap(this),wr(this)?H1(this,e):op(this.value)},t.prototype.setDirty=function(){this.dirty||(this.dirty=!0,this.value.length=0,sp(this),po(this))},t.prototype.dispose=function(){var e=this;this.setDirty(),pp(this),Vc(this,function(r,n){r.setDirty(),dp(r,e)})},t.prototype.forget=function(){this.dispose()},t.prototype.dependOn=function(e){e.add(this),this.deps||(this.deps=Gi.pop()||new Set),this.deps.add(e)},t.prototype.forgetDeps=function(){var e=this;this.deps&&(Bc(this.deps).forEach(function(r){return r.delete(e)}),this.deps.clear(),Gi.push(this.deps),this.deps=null)},t.count=0,t}();function ap(t){var e=ho.getValue();if(e)return t.parents.add(e),e.childValues.has(t)||e.childValues.set(t,[]),wr(t)?up(e,t):lp(e,t),e}function H1(t,e){return pp(t),ho.withValue(t,W1,[t,e]),Z1(t,e)&&K1(t),op(t.value)}function W1(t,e){t.recomputing=!0,t.value.length=0;try{t.value[0]=t.fn.apply(null,e)}catch(r){t.value[1]=r}t.recomputing=!1}function wr(t){return t.dirty||!!(t.dirtyChildren&&t.dirtyChildren.size)}function K1(t){t.dirty=!1,!wr(t)&&cp(t)}function sp(t){Vc(t,up)}function cp(t){Vc(t,lp)}function Vc(t,e){var r=t.parents.size;if(r)for(var n=Bc(t.parents),i=0;i<r;++i)e(n[i],t)}function up(t,e){Kn(t.childValues.has(e)),Kn(wr(e));var r=!wr(t);if(!t.dirtyChildren)t.dirtyChildren=Gi.pop()||new Set;else if(t.dirtyChildren.has(e))return;t.dirtyChildren.add(e),r&&sp(t)}function lp(t,e){Kn(t.childValues.has(e)),Kn(!wr(e));var r=t.childValues.get(e);r.length===0?t.childValues.set(e,Q1(e.value)):z1(r,e.value)||t.setDirty(),fp(t,e),!wr(t)&&cp(t)}function fp(t,e){var r=t.dirtyChildren;r&&(r.delete(e),r.size===0&&(Gi.length<V1&&Gi.push(r),t.dirtyChildren=null))}function pp(t){t.childValues.size>0&&t.childValues.forEach(function(e,r){dp(t,r)}),t.forgetDeps(),Kn(t.dirtyChildren===null)}function dp(t,e){e.parents.delete(t),t.childValues.delete(e),fp(t,e)}function Z1(t,e){if(typeof t.subscribe=="function")try{po(t),t.unsubscribe=t.subscribe.apply(null,e)}catch{return t.setDirty(),!1}return!0}var Y1={setDirty:!0,dispose:!0,forget:!0};function mo(t){var e=new Map,r=t&&t.subscribe;function n(i){var a=ho.getValue();if(a){var o=e.get(i);o||e.set(i,o=new Set),a.dependOn(o),typeof r=="function"&&(po(o),o.unsubscribe=r(i))}}return n.dirty=function(a,o){var s=e.get(a);if(s){var u=o&&B1.call(Y1,o)?o:"setDirty";Bc(s).forEach(function(c){return c[u]()}),e.delete(a),po(s)}},n}function hp(){var t=new Bt(typeof WeakMap=="function");return function(){return t.lookupArray(arguments)}}var p6=hp(),qc=new Set;function nn(t,e){e===void 0&&(e=Object.create(null));var r=new q1(e.max||Math.pow(2,16),function(c){return c.dispose()}),n=e.keyArgs,i=e.makeCacheKey||hp(),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 G1(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),qc.add(r),ho.hasValue()||(qc.forEach(function(p){return p.clean()}),qc.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 zc=function(){function t(){this.getFragmentDoc=nn(lc)}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=jt(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=jt(e,["id","data","fragment","fragmentName"]);return this.write(Object.assign(o,{query:this.getFragmentDoc(i,a),dataId:r,result:n}))},t.prototype.updateQuery=function(e,r){return this.batch({update:function(n){var i=n.readQuery(e),a=r(i);return a==null?i:(n.writeQuery(_(_({},e),{data:a})),a)}})},t.prototype.updateFragment=function(e,r){return this.batch({update:function(n){var i=n.readFragment(e),a=r(i);return a==null?i:(n.writeFragment(_(_({},e),{data:a})),a)}})},t}();var Hi=function(t){xe(e,t);function e(r,n,i,a){var o,s=t.call(this,r)||this;if(s.message=r,s.path=n,s.query=i,s.variables=a,Array.isArray(s.path)){s.missing=s.message;for(var u=s.path.length-1;u>=0;--u)s.missing=(o={},o[s.path[u]]=s.missing,o)}else s.missing=s.path;return s.__proto__=e.prototype,s}return e}(Error);var ke=Object.prototype.hasOwnProperty;function Wi(t){return t==null}function yo(t,e){var r=t.__typename,n=t.id,i=t._id;if(typeof r=="string"&&(e&&(e.keyObject=Wi(n)?Wi(i)?void 0:{_id:i}:{id:n}),Wi(n)&&!Wi(i)&&(n=i),!Wi(n)))return"".concat(r,":").concat(typeof n=="number"||typeof n=="string"?n:JSON.stringify(n))}var mp={dataIdFromObject:yo,addTypename:!0,resultCaching:!0,canonizeResults:!1};function gp(t){return _r(mp,t)}function vo(t){var e=t.canonizeResults;return e===void 0?mp.canonizeResults:e}function yp(t,e){return K(e)?t.get(e.__ref,"__typename"):e&&e.__typename}var Qc=/^[_a-z][_0-9a-z]*/i;function Dt(t){var e=t.match(Qc);return e?e[0]:t}function go(t,e,r){return ee(e)?ue(e)?e.every(function(n){return go(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||go(n.selectionSet,e[i],r))}return!0}):!1}function Sr(t){return ee(t)&&!K(t)&&!ue(t)}function vp(){return new it}function bo(t,e){var r=Zr(Jr(t));return{fragmentMap:r,lookupFragment:function(n){var i=r[n];return!i&&e&&(i=e.lookup(n)),i||null}}}var _o=Object.create(null),Gc=function(){return _o},bp=Object.create(null),Zn=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 Ui(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 Ut(i);if(K(i))return i;var o=n.policies.identify(i)[0];if(o){var s=Ut(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(X1).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:_o,INVALIDATE:bp,isReference:K,toReference:this.toReference,canRead:this.canRead,readField:function(c,l){return n.policies.readField(typeof c=="string"?{fieldName:c,from:l||Ut(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===Gc?_o:p(Ui(d),_(_({},u),{fieldName:l,storeFieldName:c,storage:n.getStorage(e,c)}));f===bp?n.group.dirty(e,c):(f===_o&&(f=void 0),f!==d&&(a[c]=f,o=!0,d=f))}d!==void 0&&(s=!1)}}),o)return this.merge(e,a),s&&(this instanceof 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]=Gc,i):Gc)}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=jt(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 _p=function(){function t(e,r){r===void 0&&(r=null),this.caching=e,this.parent=r,this.d=null,this.resetCaching()}return t.prototype.resetCaching=function(){this.d=this.caching?mo():null,this.keyMaker=new Bt(wt)},t.prototype.depend=function(e,r){if(this.d){this.d(Hc(e,r));var n=Dt(r);n!==r&&this.d(Hc(e,n)),this.parent&&this.parent.depend(e,r)}},t.prototype.dirty=function(e,r){this.d&&this.d.dirty(Hc(e,r),r==="__exists"?"forget":"setDirty")},t}();function Hc(t,e){return e+"#"+t}function Wc(t,e){an(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 _p(s))||this;return c.stump=new J1(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})(Zn||(Zn={}));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}(Zn),J1=function(t){xe(e,t);function e(r){return t.call(this,"EntityStore.Stump",r,function(){},new _p(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 X1(t,e,r){var n=t[r],i=e[r];return be(n,i)?n:i}function an(t){return!!(t instanceof Zn&&t.group.caching)}function eg(t){return ee(t)?ue(t)?t.slice(0):_({__proto__:Object.getPrototypeOf(t)},t):t}var wo=function(){function t(){this.known=new(Cf?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=eg(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)){Kc===void 0&&wp();var e=Kc.admit(t),r=Zc.get(e);return r===void 0&&Zc.set(e,r=JSON.stringify(e)),r}return JSON.stringify(t)},{reset:wp}),Kc,Zc;function wp(){Kc=new wo,Zc=new(wt?WeakMap:Map)}function Sp(t){return[t.selectionSet,t.objectOrReference,t.context,t.context.canonizeResults]}var Ep=function(){function t(e){var r=this;this.knownResults=new(wt?WeakMap:Map),this.config=_r(e,{addTypename:e.addTypename!==!1,canonizeResults:vo(e)}),this.canon=e.canon||new wo,this.executeSelectionSet=nn(function(n){var i,a=n.context.canonizeResults,o=Sp(n);o[3]=!a;var s=(i=r.executeSelectionSet).peek.apply(i,o);return s?a?_(_({},s),{result:r.canon.admit(s.result)}):s:(Wc(n.context.store,n.enclosingRef.__ref),r.execSelectionSetImpl(n))},{max:this.config.resultCacheMaxSize,keyArgs:Sp,makeCacheKey:function(n,i,a,o){if(an(a.store))return a.store.makeCacheKey(n,K(i)?i.__ref:i,a.varString,o)}}),this.executeSubSelectedArray=nn(function(n){return Wc(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(an(o.store))return o.store.makeCacheKey(i,a,o.varString)}})}return t.prototype.resetCanon=function(){this.canon=new wo},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=_(_({},en(Fi(n))),o);var p=Ut(a),f=this.executeSelectionSet({selectionSet:Xr(n).selectionSet,objectOrReference:p,enclosingRef:p,context:_({store:r,query:n,policies:d,variables:o,varString:dt(o),canonizeResults:l},bo(n,this.config.fragments))}),h;if(f.missing&&(h=[new Hi(tg(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(an(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),C=_t(v);D===void 0?tn.added(v)||(p=f.merge(p,(m={},m[C]="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}),C):v.selectionSet?D!=null&&(D=h(r.executeSelectionSet({selectionSet:v.selectionSet,objectOrReference:D,enclosingRef:K(D)?D:a,context:o}),C)):o.canonizeResults&&(D=r.canon.pass(D)),D!==void 0&&d.push((A={},A[C]=D,A))}else{var O=Yr(v,o.lookupFragment);if(!O&&v.kind===Oe.FRAGMENT_SPREAD)throw __DEV__?new V("No fragment named ".concat(v.name.value)):new V(5);O&&u.fragmentMatches(O,l)&&O.selectionSet.selections.forEach(g.add,g)}});var y=Mi(d),S={result:y,missing:p},b=o.canonizeResults?this.canon.admit(S):Ui(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__&&rg(o.store,n,l),l)}),{result:o.canonizeResults?this.canon.admit(i):i,missing:s}},t}();function tg(t){try{JSON.stringify(t,function(e,r){if(typeof r=="string")throw r;return r})}catch(e){return e}}function rg(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(yp(t,i)," returned for query field ").concat(e.name.value)):I(!K(i),6),Object.values(i).forEach(n.add,n))})}}var Yn=new Wn,Cp=new WeakMap;function Ki(t){var e=Cp.get(t);return e||Cp.set(t,e={vars:new Set,dep:mo()}),e}function Yc(t){Ki(t).vars.forEach(function(e){return e.forgetCache(t)})}function xp(t){Ki(t).vars.forEach(function(e){return e.attachCache(t)})}function So(t){var e=new Set,r=new Set,n=function(a){if(arguments.length>0){if(t!==a){t=a,e.forEach(function(u){Ki(u).dep.dirty(n),ng(u)});var o=Array.from(r);r.clear(),o.forEach(function(u){return u(t)})}}else{var s=Yn.getValue();s&&(i(s),Ki(s).dep(n))}return t};n.onNextChange=function(a){return r.add(a),function(){r.delete(a)}};var i=n.attachCache=function(a){return e.add(a),Ki(a).vars.add(n),n};return n.forgetCache=function(a){return e.delete(a)},n}function ng(t){t.broadcastWatches&&t.broadcastWatches()}var kp=Object.create(null);function Jc(t){var e=JSON.stringify(t);return kp[e]||(kp[e]=Object.create(null))}function Xc(t){var e=Jc(t);return e.keyFieldsFn||(e.keyFieldsFn=function(r,n){var i=function(o,s){return n.readField(s,o)},a=n.keyObject=tu(t,function(o){var s=Jn(n.storeObject,o,i);return s===void 0&&r!==n.storeObject&&ke.call(r,o[0])&&(s=Jn(r,o,Ap)),__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 eu(t){var e=Jc(t);return e.keyArgsFn||(e.keyArgsFn=function(r,n){var i=n.field,a=n.variables,o=n.fieldName,s=tu(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&&Jn(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,Jn(a,y)}return}if(r)return Jn(r,c)}),u=JSON.stringify(s);return(r||u!=="{}")&&(o+=":"+u),o})}function tu(t,e){var r=new it;return Tp(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 Tp(t){var e=Jc(t);if(!e.paths){var r=e.paths=[],n=[];t.forEach(function(i,a){ue(i)?(Tp(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 Ap(t,e){return t[e]}function Jn(t,e,r){return r=r||Ap,Ip(e.reduce(function n(i,a){return ue(i)?i.map(function(o){return n(o,a)}):i&&r(i,a)},t))}function Ip(t){return ee(t)?ue(t)?t.map(Ip):tu(Object.keys(t).sort(),function(e){return Jn(t,e)}):t}Li.setStringify(dt);function ru(t){return t.args!==void 0?t.args:t.field?tr(t.field,t.variables):null}var ig=function(){},Op=function(t,e){return e.fieldName},Dp=function(t,e,r){var n=r.mergeObjects;return n(t,e)},Np=function(t,e){return e},Pp=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:yo},e),this.cache=this.config.cache,this.setRootTypename("Query"),this.setRootTypename("Mutation"),this.setRootTypename("Subscription"),e.possibleTypes&&this.addPossibleTypes(e.possibleTypes),e.typePolicies&&this.addTypePolicies(e.typePolicies)}return t.prototype.identify=function(e,r){var n,i=this,a=r&&(r.typename||((n=r.storeObject)===null||n===void 0?void 0:n.__typename))||e.__typename;if(a===this.rootTypenamesById.ROOT_QUERY)return["ROOT_QUERY"];for(var o=r&&r.storeObject||e,s=_(_({},r),{typename:a,storeObject:o,readField:r&&r.readField||function(){var p=Eo(arguments,o);return i.readField(p,{store:i.cache.data,variables:p.variables})}}),u,c=a&&this.getTypePolicy(a),l=c&&c.keyFn||this.config.dataIdFromObject;l;){var d=l(e,s);if(ue(d))l=Xc(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=jt(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?Dp:c===!1?Np:u.merge}s(i,r.merge),i.keyFn=a===!1?ig:ue(a)?Xc(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?Op:ue(d)?eu(d):typeof d=="function"?d:c.keyFn,typeof p=="function"&&(c.read=p),s(c,f)}c.read&&c.merge&&(c.keyFn=c.keyFn||Op)})},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(Qc);(!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=jt(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&&go(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=ru(e);o;){var c=o(u,s);if(ue(c))o=eu(c);else{a=c||n;break}}return a===void 0&&(a=e.field?pc(e.field,e.variables):Li(n,ru(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=Rp(this,n,e,r,r.store.getStorage(K(n)?n.__ref:n,o));return Yn.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===Dp?Lp(i.store)(e,r):u===Np?r:(i.overwrite&&(e=void 0),u(e,r,Rp(this,void 0,{typename:s,fieldName:o.name.value,field:o,variables:i.variables},i,a||Object.create(null))))},t}();function Rp(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:ru(r),field:r.field||null,fieldName:o,storeFieldName:a,variables:s,isReference:K,toReference:c,storage:i,cache:t.cache,canRead:l,readField:function(){return t.readField(Eo(arguments,e,s),n)},mergeObjects:Lp(n.store)}}function Eo(t,e,r){var n=t[0],i=t[1],a=t.length,o;return typeof n=="string"?o={fieldName:n,from:a>1?i:e}:(o=_({},n),ke.call(o,"from")||(o.from=e)),__DEV__&&o.from===void 0&&__DEV__&&I.warn("Undefined 'from' passed to readField with arguments ".concat(Af(Array.from(t)))),o.variables===void 0&&(o.variables=r),o}function Lp(t){return function(r,n){if(ue(r)||ue(n))throw __DEV__?new V("Cannot automatically merge arrays"):new V(4);if(ee(r)&&ee(n)){var i=t.getFieldValue(r,"__typename"),a=t.getFieldValue(n,"__typename"),o=i&&a&&i!==a;if(o)return n;if(K(r)&&Sr(n))return t.merge(r.__ref,n),r;if(Sr(r)&&K(n))return t.merge(r,n.__ref),n;if(Sr(r)&&Sr(n))return _(_({},r),n)}return n}}function nu(t,e,r){var n="".concat(e).concat(r),i=t.flavors.get(n);return i||t.flavors.set(n,i=t.clientOnly===e&&t.deferred===r?t:_(_({},t),{clientOnly:e,deferred:r})),i}var jp=function(){function t(e,r,n){this.cache=e,this.reader=r,this.fragments=n}return t.prototype.writeToStore=function(e,r){var n=this,i=r.query,a=r.result,o=r.dataId,s=r.variables,u=r.overwrite,c=qt(i),l=vp();s=_(_({},en(c)),s);var d=_(_({store:e,written:Object.create(null),merge:function(f,h){return l.merge(f,h)},variables:s,varString:dt(s)},bo(i,this.fragments)),{overwrite:!!u,incomingById:new Map,clientOnly:!1,deferred:!1,flavors:new Map}),p=this.processSelectionSet({result:a||Object.create(null),dataId:o,selectionSet:c.selectionSet,mergeTree:{map:new Map},context:d});if(!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=Ut(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(C){C.selectionSet&&(m[C.name.value]=!0)});var A=function(C){return m[Dt(C)]===!0},D=function(C){var O=y&&y.map.get(C);return Boolean(O&&O.info&&O.info.merge)};Object.keys(g).forEach(function(C){A(C)&&!D(C)&&ag(b,g,C,d.store)})}e.merge(h,g)}),e.retain(p.__ref),p},t.prototype.processSelectionSet=function(e){var r=this,n=e.dataId,i=e.result,a=e.selectionSet,o=e.context,s=e.mergeTree,u=this.cache.policies,c=Object.create(null),l=n&&u.rootTypenamesById[n]||$i(i,a,o.fragmentMap)||n&&o.store.get(n,"__typename");typeof l=="string"&&(c.__typename=l);var d=function(){var v=Eo(arguments,c,o.variables);if(K(v.from)){var m=o.incomingById.get(v.from.__ref);if(m){var A=u.readField(_(_({},v),{from:m.storeObject}),o);if(A!==void 0)return A}}return u.readField(v,o)},p=new Set;this.flattenFields(a,i,o,l).forEach(function(v,m){var A,D=_t(m),C=i[D];if(p.add(m),C!==void 0){var O=u.getStoreFieldName({typename:l,fieldName:m.name.value,field:m,variables:v.variables}),P=$p(s,O),N=r.processFieldValue(C,m,m.selectionSet?nu(v,!1,!1):v,P),U=void 0;m.selectionSet&&(K(N)||Sr(N))&&(U=d("__typename",N));var qe=u.getMergeFunction(l,m.name.value,U);qe?P.info={field:m,typename:l,merge:qe}:Fp(s,O),c=v.merge(c,(A={},A[O]=N,A))}else __DEV__&&!v.clientOnly&&!v.deferred&&!tn.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=Ut(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=iu(b.mergeTree,s),p.forEach(function(v){return b.fieldNodeSet.add(v)})):o.incomingById.set(n,{storeObject:c,mergeTree:Co(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__?no(e):e:ue(e)?e.map(function(o,s){var u=a.processFieldValue(o,r,n,$p(i,s));return Fp(i,s),u}):this.processSelectionSet({result:e,selectionSet:r.selectionSet,context:n,mergeTree:i})},t.prototype.flattenFields=function(e,r,n,i){i===void 0&&(i=$i(r,e,n.fragmentMap));var a=new Map,o=this.cache.policies,s=new Bt(!1);return function u(c,l){var d=s.lookup(c,l.clientOnly,l.deferred);d.visited||(d.visited=!0,c.selections.forEach(function(p){if(!!er(p,n.variables)){var f=l.clientOnly,h=l.deferred;if(!(f&&h)&&Re(p.directives)&&p.directives.forEach(function(S){var b=S.name.value;if(b==="client"&&(f=!0),b==="defer"){var v=tr(S,n.variables);(!v||v.if!==!1)&&(h=!0)}}),pt(p)){var g=a.get(p);g&&(f=f&&g.clientOnly,h=h&&g.deferred),a.set(p,nu(n,f,h))}else{var y=Yr(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,nu(n,f,h))}}}))}(e,n),a},t.prototype.applyMerges=function(e,r,n,i,a){var o,s=this;if(e.map.size&&!K(n)){var u=!ue(n)&&(K(r)||Sr(r))?r:void 0,c=n;u&&!a&&(a=[K(u)?u.__ref:u]);var l,d=function(p,f){return ue(p)?typeof f=="number"?p[f]:void 0:i.store.getFieldValue(p,String(f))};e.map.forEach(function(p,f){var h=d(u,f),g=d(c,f);if(g!==void 0){a&&a.push(f);var y=s.applyMerges(p,h,g,i,a);y!==g&&(l=l||new Map,l.set(f,y)),a&&I(a.pop()===f)}}),l&&(n=ue(c)?c.slice(0):_({},c),l.forEach(function(p,f){n[f]=p}))}return e.info?this.cache.policies.runMergeFunction(r,n,e.info,i,a&&(o=i.store).getStorage.apply(o,a)):n},t}();var Up=[];function $p(t,e){var r=t.map;return r.has(e)||r.set(e,Up.pop()||{map:new Map}),r.get(e)}function iu(t,e){if(t===e||!e||Co(e))return t;if(!t||Co(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,iu(s,e.map.get(u))),o.delete(u)}),o.forEach(function(s){a.map.set(s,iu(e.map.get(s),t.map.get(s)))})}return a}function Co(t){return!t||!(t.info||t.map.size)}function Fp(t,e){var r=t.map,n=r.get(e);n&&Co(n)&&(Up.push(n),r.delete(e))}var Mp=new Set;function ag(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(!Mp.has(c)){Mp.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 z(23)};var Of=function(){if(typeof AbortController>"u")return{controller:!1,signal:!1};var t=new AbortController,e=t.signal;return{controller:t,signal:e}};var Df=function(t,e){var r=t.getContext(),n=r.uri;return n||(typeof e=="function"?e(t):e||"/graphql")};function Nf(t,e){var r=[],n=function(d,f){r.push("".concat(d,"=").concat(encodeURIComponent(f)))};if("query"in e&&n("query",e.query),e.operationName&&n("operationName",e.operationName),e.variables){var i=void 0;try{i=ha(e.variables,"Variables map")}catch(d){return{parseError:d}}n("variables",i)}if(e.extensions){var a=void 0;try{a=ha(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 Pf=Ge(function(){return fetch}),Rf=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?If:i,o=t.includeExtensions,s=t.preserveHeaderCase,u=t.useGETForQueries,c=t.includeUnusedVariables,l=c===void 0?!1:c,d=Zt(t,["uri","fetch","print","includeExtensions","preserveHeaderCase","useGETForQueries","includeUnusedVariables"]);__DEV__&&Tf(n||Pf);var f={http:{includeExtensions:o,preserveHeaderCase:s},options:d.fetchOptions,credentials:d.credentials,headers:d.headers};return new Rt(function(p){var h=Df(p,r),g=p.getContext(),v={};if(g.clientAwareness){var C=g.clientAwareness,_=C.name,b=C.version;_&&(v["apollographql-client-name"]=_),b&&(v["apollographql-client-version"]=b)}var y=w(w({},v),g.headers),T={http:g.http,options:g.fetchOptions,credentials:g.credentials,headers:y},R=Af(p,a,kf,f,T),k=R.options,P=R.body;if(P.variables&&!l){var F=new Set(Object.keys(P.variables));nt(p.query,{Variable:function(ae,Wt,J){J&&J.kind!=="VariableDefinition"&&F.delete(ae.name.value)}}),F.size&&(P.variables=w({},P.variables),F.forEach(function(ae){delete P.variables[ae]}))}var $;if(!k.signal){var q=Of(),Ze=q.controller,Me=q.signal;$=Ze,$&&(k.signal=Me)}var V=function(ae){return ae.kind==="OperationDefinition"&&ae.operation==="mutation"};if(u&&!p.query.definitions.some(V)&&(k.method="GET"),oi(["defer"],p.query)&&(k.headers=k.headers||{},k.headers.accept="multipart/mixed; deferSpec=20220824, application/json"),k.method==="GET"){var be=Nf(h,P),_e=be.newURI,ie=be.parseError;if(ie)return Uo(ie);h=_e}else try{k.body=ha(P,"Payload")}catch(ae){return Uo(ae)}return new Y(function(ae){var Wt=n||Ge(function(){return fetch})||Pf;return Wt(h,k).then(function(J){var Kt;p.setContext({response:J});var Ir=(Kt=J.headers)===null||Kt===void 0?void 0:Kt.get("content-type");return Ir!==null&&/^multipart\/mixed/i.test(Ir)?Cf(J,ae):Ef(J,p,ae)}).catch(function(J){return qo(J,ae)}),function(){$&&$.abort()}})})};var vu=function(t){Oe(e,t);function e(r){r===void 0&&(r={});var n=t.call(this,Rf(r).request)||this;return n.options=r,n}return e}(Rt);var{toString:$f,hasOwnProperty:vg}=Object.prototype,Lf=Function.prototype.toString,bu=new Map;function xe(t,e){try{return _u(t,e)}finally{bu.clear()}}function _u(t,e){if(t===e)return!0;let r=$f.call(t),n=$f.call(e);if(r!==n)return!1;switch(r){case"[object Array]":if(t.length!==e.length)return!1;case"[object Object]":{if(Mf(t,e))return!0;let i=Ff(t),a=Ff(e),o=i.length;if(o!==a.length)return!1;for(let s=0;s<o;++s)if(!vg.call(e,i[s]))return!1;for(let s=0;s<o;++s){let u=i[s];if(!_u(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(Mf(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&&!_u(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=Lf.call(t);return i!==Lf.call(e)?!1:!wg(i,_g)}}return!1}function Ff(t){return Object.keys(t).filter(bg,t)}function bg(t){return this[t]!==void 0}var _g="{ [native code] }";function wg(t,e){let r=t.length-e.length;return r>=0&&t.indexOf(e,r)===r}function Mf(t,e){let r=bu.get(t);if(r){if(r.has(e))return!0}else bu.set(t,r=new Set);return r.add(e),!1}var Sg=function(){return Object.create(null)},Uf=Array.prototype,Cg=Uf.forEach,xg=Uf.slice,Xt=function(){function t(e,r){e===void 0&&(e=!0),r===void 0&&(r=Sg),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 Cg.call(e,function(n){return r=r.getChildTrie(n)}),r.data||(r.data=this.makeData(xg.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 Xe=null,jf={},kg=1,Ig=()=>class{constructor(){this.id=["slot",kg++,Date.now(),Math.random().toString(36).slice(2)].join(":")}hasValue(){for(let e=Xe;e;e=e.parent)if(this.id in e.slots){let r=e.slots[this.id];if(r===jf)break;return e!==Xe&&(Xe.slots[this.id]=r),!0}return Xe&&(Xe.slots[this.id]=jf),!1}getValue(){if(this.hasValue())return Xe.slots[this.id]}withValue(e,r,n,i){let a={__proto__:null,[this.id]:e},o=Xe;Xe={parent:o,slots:a};try{return r.apply(i,n)}finally{Xe=o}}static bind(e){let r=Xe;return function(){let n=Xe;try{return Xe=r,e.apply(this,arguments)}finally{Xe=n}}}static noContext(e,r,n){if(Xe){let i=Xe;try{return Xe=null,e.apply(n,r)}finally{Xe=i}}else return e.apply(n,r)}};function Bf(t){try{return t()}catch{}}var wu="@wry/context:Slot",Ag=Bf(()=>globalThis)||Bf(()=>global)||Object.create(null),qf=Ag,hi=qf[wu]||Array[wu]||function(t){try{Object.defineProperty(qf,wu,{value:t,enumerable:!1,writable:!1,configurable:!0})}finally{return t}}(Ig());var{bind:Tg,noContext:Og}=hi;function Dg(){}var Ng=function(){function t(e,r){e===void 0&&(e=1/0),r===void 0&&(r=Dg),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}(),Qo=new hi,Su,Pg=Object.prototype.hasOwnProperty,xu=(Su=Array.from,Su===void 0?function(t){var e=[];return t.forEach(function(r){return e.push(r)}),e}:Su);function Vo(t){var e=t.unsubscribe;typeof e=="function"&&(t.unsubscribe=void 0,e())}var ma=[],Rg=100;function mi(t,e){if(!t)throw new Error(e||"assertion failure")}function $g(t,e){var r=t.length;return r>0&&r===e.length&&t[r-1]===e[r-1]}function Qf(t){switch(t.length){case 0:throw new Error("unknown value");case 1:return t[0];case 2:throw t[1]}}function Lg(t){return t.slice(0)}var Fg=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&&!Fr(this))return Vf(this),this.value[0]},t.prototype.recompute=function(e){return mi(!this.recomputing,"already recomputing"),Vf(this),Fr(this)?Mg(this,e):Qf(this.value)},t.prototype.setDirty=function(){this.dirty||(this.dirty=!0,this.value.length=0,zf(this),Vo(this))},t.prototype.dispose=function(){var e=this;this.setDirty(),Zf(this),Eu(this,function(r,n){r.setDirty(),Jf(r,e)})},t.prototype.forget=function(){this.dispose()},t.prototype.dependOn=function(e){e.add(this),this.deps||(this.deps=ma.pop()||new Set),this.deps.add(e)},t.prototype.forgetDeps=function(){var e=this;this.deps&&(xu(this.deps).forEach(function(r){return r.delete(e)}),this.deps.clear(),ma.push(this.deps),this.deps=null)},t.count=0,t}();function Vf(t){var e=Qo.getValue();if(e)return t.parents.add(e),e.childValues.has(t)||e.childValues.set(t,[]),Fr(t)?Hf(e,t):Wf(e,t),e}function Mg(t,e){return Zf(t),Qo.withValue(t,Ug,[t,e]),Bg(t,e)&&jg(t),Qf(t.value)}function Ug(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 Fr(t){return t.dirty||!!(t.dirtyChildren&&t.dirtyChildren.size)}function jg(t){t.dirty=!1,!Fr(t)&&Gf(t)}function zf(t){Eu(t,Hf)}function Gf(t){Eu(t,Wf)}function Eu(t,e){var r=t.parents.size;if(r)for(var n=xu(t.parents),i=0;i<r;++i)e(n[i],t)}function Hf(t,e){mi(t.childValues.has(e)),mi(Fr(e));var r=!Fr(t);if(!t.dirtyChildren)t.dirtyChildren=ma.pop()||new Set;else if(t.dirtyChildren.has(e))return;t.dirtyChildren.add(e),r&&zf(t)}function Wf(t,e){mi(t.childValues.has(e)),mi(!Fr(e));var r=t.childValues.get(e);r.length===0?t.childValues.set(e,Lg(e.value)):$g(r,e.value)||t.setDirty(),Kf(t,e),!Fr(t)&&Gf(t)}function Kf(t,e){var r=t.dirtyChildren;r&&(r.delete(e),r.size===0&&(ma.length<Rg&&ma.push(r),t.dirtyChildren=null))}function Zf(t){t.childValues.size>0&&t.childValues.forEach(function(e,r){Jf(t,r)}),t.forgetDeps(),mi(t.dirtyChildren===null)}function Jf(t,e){e.parents.delete(t),t.childValues.delete(e),Kf(t,e)}function Bg(t,e){if(typeof t.subscribe=="function")try{Vo(t),t.unsubscribe=t.subscribe.apply(null,e)}catch{return t.setDirty(),!1}return!0}var qg={setDirty:!0,dispose:!0,forget:!0};function zo(t){var e=new Map,r=t&&t.subscribe;function n(i){var a=Qo.getValue();if(a){var o=e.get(i);o||e.set(i,o=new Set),a.dependOn(o),typeof r=="function"&&(Vo(o),o.unsubscribe=r(i))}}return n.dirty=function(a,o){var s=e.get(a);if(s){var u=o&&Pg.call(qg,o)?o:"setDirty";xu(s).forEach(function(c){return c[u]()}),e.delete(a),Vo(s)}},n}function Yf(){var t=new Xt(typeof WeakMap=="function");return function(){return t.lookupArray(arguments)}}var a9=Yf(),Cu=new Set;function Cn(t,e){e===void 0&&(e=Object.create(null));var r=new Ng(e.max||Math.pow(2,16),function(c){return c.dispose()}),n=e.keyArgs,i=e.makeCacheKey||Yf(),a=function(){var c=i.apply(null,n?n.apply(null,arguments):arguments);if(c===void 0)return t.apply(null,arguments);var l=r.get(c);l||(r.set(c,l=new Fg(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),Cu.add(r),Qo.hasValue()||(Cu.forEach(function(f){return f.clean()}),Cu.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 ku=function(){function t(){this.getFragmentDoc=Cn(Gc)}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=Zt(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=Zt(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 ga=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 ya(t){return t==null}function Ho(t,e){var r=t.__typename,n=t.id,i=t._id;if(typeof r=="string"&&(e&&(e.keyObject=ya(n)?ya(i)?void 0:{_id:i}:{id:n}),ya(n)&&!ya(i)&&(n=i),!ya(n)))return"".concat(r,":").concat(typeof n=="number"||typeof n=="string"?n:JSON.stringify(n))}var Xf={dataIdFromObject:Ho,addTypename:!0,resultCaching:!0,canonizeResults:!1};function ed(t){return Lr(Xf,t)}function Wo(t){var e=t.canonizeResults;return e===void 0?Xf.canonizeResults:e}function td(t,e){return ee(e)?t.get(e.__ref,"__typename"):e&&e.__typename}var Iu=/^[_a-z][_0-9a-z]*/i;function Qt(t){var e=t.match(Iu);return e?e[0]:t}function Go(t,e,r){return oe(e)?he(e)?e.every(function(n){return Go(t,n,r)}):t.selections.every(function(n){if(Ct(n)&&dr(n,r)){var i=Nt(n);return De.call(e,i)&&(!n.selectionSet||Go(n.selectionSet,e[i],r))}return!0}):!1}function Mr(t){return oe(t)&&!ee(t)&&!he(t)}function rd(){return new ht}function Ko(t,e){var r=gn(vn(t));return{fragmentMap:r,lookupFragment:function(n){var i=r[n];return!i&&e&&(i=e.lookup(n)),i||null}}}var Zo=Object.create(null),Au=function(){return Zo},nd=Object.create(null),gi=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 ua(ee(i)?n.get(i.__ref,a):i&&i[a])},this.canRead=function(i){return ee(i)?n.has(i.__ref):typeof i=="object"},this.toReference=function(i,a){if(typeof i=="string")return Jt(i);if(ee(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 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 Ur)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 Ur)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;ee(e)&&(e=e.__ref),ee(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__?D(typeof i=="string","store.merge expects a string ID"):D(typeof i=="string",1);var s=new ht(Qg).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=Qt(c);l!==c&&!n.policies.hasKeyArgs(s.__typename,l)&&(u[l]=1),s[c]===void 0&&!(n instanceof Ur)&&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:Zo,INVALIDATE:nd,isReference:ee,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=Qt(c),d=i[c];if(d!==void 0){var f=typeof r=="function"?r:r[c]||r[l];if(f){var p=f===Au?Zo:f(ua(d),w(w({},u),{fieldName:l,storeFieldName:c,storage:n.getStorage(e,c)}));p===nd?n.group.dirty(e,c):(p===Zo&&(p=void 0),p!==d&&(a[c]=p,o=!0,d=p))}d!==void 0&&(s=!1)}}),o)return this.merge(e,a),s&&(this instanceof Ur?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]=Au,i):Au)}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 Ur&&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=Zt(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 Ur?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 Ur;)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){ee(a)&&(r[a.__ref]=!0),oe(a)&&Object.keys(a).forEach(function(o){var s=a[o];oe(s)&&i.add(s)})})}return this.refs[e]},t.prototype.makeCacheKey=function(){return this.group.keyMaker.lookupArray(arguments)},t}();var id=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?zo():null,this.keyMaker=new Xt(Pt)},t.prototype.depend=function(e,r){if(this.d){this.d(Tu(e,r));var n=Qt(r);n!==r&&this.d(Tu(e,n)),this.parent&&this.parent.depend(e,r)}},t.prototype.dirty=function(e,r){this.d&&this.d.dirty(Tu(e,r),r==="__exists"?"forget":"setDirty")},t}();function Tu(t,e){return e+"#"+t}function Ou(t,e){xn(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 id(s))||this;return c.stump=new Vg(c),c.storageTrie=new Xt(Pt),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})(gi||(gi={}));var Ur=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){xe(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}(gi),Vg=function(t){Oe(e,t);function e(r){return t.call(this,"EntityStore.Stump",r,function(){},new id(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}(Ur);function Qg(t,e,r){var n=t[r],i=e[r];return xe(n,i)?n:i}function xn(t){return!!(t instanceof gi&&t.group.caching)}function zg(t){return oe(t)?he(t)?t.slice(0):w({__proto__:Object.getPrototypeOf(t)},t):t}var Jo=function(){function t(){this.known=new(cf?WeakSet:Set),this.pool=new Xt(Pt),this.passes=new WeakMap,this.keysByJSON=new Map,this.empty=this.admit({})}return t.prototype.isKnown=function(e){return oe(e)&&this.known.has(e)},t.prototype.pass=function(e){if(oe(e)){var r=zg(e);return this.passes.set(r,e),r}return e},t.prototype.admit=function(e){var r=this;if(oe(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(p){u.push(r.admit(e[p]))});var o=this.pool.lookupArray(u);if(!o.object){var d=o.object=Object.create(s);this.known.add(d),c.sorted.forEach(function(p,h){d[p]=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 xt=Object.assign(function(t){if(oe(t)){Du===void 0&&ad();var e=Du.admit(t),r=Nu.get(e);return r===void 0&&Nu.set(e,r=JSON.stringify(e)),r}return JSON.stringify(t)},{reset:ad}),Du,Nu;function ad(){Du=new Jo,Nu=new(Pt?WeakMap:Map)}function od(t){return[t.selectionSet,t.objectOrReference,t.context,t.context.canonizeResults]}var sd=function(){function t(e){var r=this;this.knownResults=new(Pt?WeakMap:Map),this.config=Lr(e,{addTypename:e.addTypename!==!1,canonizeResults:Wo(e)}),this.canon=e.canon||new Jo,this.executeSelectionSet=Cn(function(n){var i,a=n.context.canonizeResults,o=od(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:(Ou(n.context.store,n.enclosingRef.__ref),r.execSelectionSetImpl(n))},{max:this.config.resultCacheMaxSize,keyArgs:od,makeCacheKey:function(n,i,a,o){if(xn(a.store))return a.store.makeCacheKey(n,ee(i)?i.__ref:i,a.varString,o)}}),this.executeSubSelectedArray=Cn(function(n){return Ou(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(xn(o.store))return o.store.makeCacheKey(i,a,o.varString)}})}return t.prototype.resetCanon=function(){this.canon=new Jo},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({},_n(oa(n))),o);var f=Jt(a),p=this.executeSelectionSet({selectionSet:bn(n).selectionSet,objectOrReference:f,enclosingRef:f,context:w({store:r,query:n,policies:d,variables:o,varString:xt(o),canonizeResults:l},Ko(n,this.config.fragments))}),h;if(p.missing&&(h=[new ga(Gg(p.missing),p.missing,n,o)],!u))throw h[0];return{result:p.result,complete:!h,missing:h}},t.prototype.isFresh=function(e,r,n,i){if(xn(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(ee(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=[],f,p=new ht;this.config.addTypename&&typeof l=="string"&&!u.rootIdsByTypename[l]&&d.push({__typename:l});function h(b,y){var T;return b.missing&&(f=p.merge(f,(T={},T[y]=b.missing,T))),b.result}var g=new Set(n.selections);g.forEach(function(b){var y,T;if(!!dr(b,s))if(Ct(b)){var R=u.readField({fieldName:b.name.value,field:b,variables:o.variables,from:i},o),k=Nt(b);R===void 0?wn.added(b)||(f=p.merge(f,(y={},y[k]="Can't find field '".concat(b.name.value,"' on ").concat(ee(i)?i.__ref+" object":"object "+JSON.stringify(i,null,2)),y))):he(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:ee(R)?R:a,context:o}),k)):o.canonizeResults&&(R=r.canon.pass(R)),R!==void 0&&d.push((T={},T[k]=R,T))}else{var P=yn(b,o.lookupFragment);if(!P&&b.kind===$e.FRAGMENT_SPREAD)throw __DEV__?new z("No fragment named ".concat(b.name.value)):new z(5);P&&u.fragmentMatches(P,l)&&P.selectionSet.selections.forEach(g.add,g)}});var v=sa(d),C={result:v,missing:f},_=o.canonizeResults?this.canon.admit(C):ua(C);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 ht;function c(l,d){var f;return l.missing&&(s=u.merge(s,(f={},f[d]=l.missing,f))),l.result}return n.selectionSet&&(i=i.filter(o.store.canRead)),i=i.map(function(l,d){return l===null?null:he(l)?c(r.executeSubSelectedArray({field:n,array:l,enclosingRef:a,context:o}),d):n.selectionSet?c(r.executeSelectionSet({selectionSet:n.selectionSet,objectOrReference:l,enclosingRef:ee(l)?l:a,context:o}),d):(__DEV__&&Hg(o.store,n,l),l)}),{result:o.canonizeResults?this.canon.admit(i):i,missing:s}},t}();function Gg(t){try{JSON.stringify(t,function(e,r){if(typeof r=="string")throw r;return r})}catch(e){return e}}function Hg(t,e,r){if(!e.selectionSet){var n=new Set([r]);n.forEach(function(i){oe(i)&&(__DEV__?D(!ee(i),"Missing selection set for object of type ".concat(td(t,i)," returned for query field ").concat(e.name.value)):D(!ee(i),6),Object.values(i).forEach(n.add,n))})}}var yi=new hi,cd=new WeakMap;function va(t){var e=cd.get(t);return e||cd.set(t,e={vars:new Set,dep:zo()}),e}function Pu(t){va(t).vars.forEach(function(e){return e.forgetCache(t)})}function ud(t){va(t).vars.forEach(function(e){return e.attachCache(t)})}function Yo(t){var e=new Set,r=new Set,n=function(a){if(arguments.length>0){if(t!==a){t=a,e.forEach(function(u){va(u).dep.dirty(n),Wg(u)});var o=Array.from(r);r.clear(),o.forEach(function(u){return u(t)})}}else{var s=yi.getValue();s&&(i(s),va(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),va(a).vars.add(n),n};return n.forgetCache=function(a){return e.delete(a)},n}function Wg(t){t.broadcastWatches&&t.broadcastWatches()}var ld=Object.create(null);function Ru(t){var e=JSON.stringify(t);return ld[e]||(ld[e]=Object.create(null))}function $u(t){var e=Ru(t);return e.keyFieldsFn||(e.keyFieldsFn=function(r,n){var i=function(o,s){return n.readField(s,o)},a=n.keyObject=Fu(t,function(o){var s=vi(n.storeObject,o,i);return s===void 0&&r!==n.storeObject&&De.call(r,o[0])&&(s=vi(r,o,fd)),__DEV__?D(s!==void 0,"Missing field '".concat(o.join("."),"' while extracting keyFields from ").concat(JSON.stringify(r))):D(s!==void 0,2),s});return"".concat(n.typename,":").concat(JSON.stringify(a))})}function Lu(t){var e=Ru(t);return e.keyArgsFn||(e.keyArgsFn=function(r,n){var i=n.field,a=n.variables,o=n.fieldName,s=Fu(t,function(c){var l=c[0],d=l.charAt(0);if(d==="@"){if(i&&Ue(i.directives)){var f=l.slice(1),p=i.directives.find(function(C){return C.name.value===f}),h=p&&hr(p,a);return h&&vi(h,c.slice(1))}return}if(d==="$"){var g=l.slice(1);if(a&&De.call(a,g)){var v=c.slice(0);return v[0]=g,vi(a,v)}return}if(r)return vi(r,c)}),u=JSON.stringify(s);return(r||u!=="{}")&&(o+=":"+u),o})}function Fu(t,e){var r=new ht;return pd(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 pd(t){var e=Ru(t);if(!e.paths){var r=e.paths=[],n=[];t.forEach(function(i,a){he(i)?(pd(i).forEach(function(o){return r.push(n.concat(o))}),n.length=0):(n.push(i),he(t[a+1])||(r.push(n.slice(0)),n.length=0))})}return e.paths}function fd(t,e){return t[e]}function vi(t,e,r){return r=r||fd,dd(e.reduce(function n(i,a){return he(i)?i.map(function(o){return n(o,a)}):i&&r(i,a)},t))}function dd(t){return oe(t)?he(t)?t.map(dd):Fu(Object.keys(t).sort(),function(e){return vi(t,e)}):t}ia.setStringify(xt);function Mu(t){return t.args!==void 0?t.args:t.field?hr(t.field,t.variables):null}var Kg=function(){},hd=function(t,e){return e.fieldName},md=function(t,e,r){var n=r.mergeObjects;return n(t,e)},gd=function(t,e){return e},vd=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:Ho},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 f=Xo(arguments,o);return i.readField(f,{store:i.cache.data,variables:f.variables})}}),u,c=a&&this.getTypePolicy(a),l=c&&c.keyFn||this.config.dataIdFromObject;l;){var d=l(e,s);if(he(d))l=$u(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=Zt(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?md:c===!1?gd:u.merge}s(i,r.merge),i.keyFn=a===!1?Kg:he(a)?$u(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,f=l.read,p=l.merge;c.keyFn=d===!1?hd:he(d)?Lu(d):typeof d=="function"?d:c.keyFn,typeof f=="function"&&(c.read=f),s(c,p)}c.read&&c.merge&&(c.keyFn=c.keyFn||hd)})},t.prototype.setRootTypename=function(e,r){r===void 0&&(r=e);var n="ROOT_"+e.toUpperCase(),i=this.rootTypenamesById[n];r!==i&&(__DEV__?D(!i||i===e,"Cannot change root ".concat(e," __typename more than once")):D(!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(Iu);(!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=Zt(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,f=0;f<u.length;++f){var p=u[f];if(p.has(o))return s.has(o)||(d&&__DEV__&&D.warn("Inferring subtype ".concat(r," of supertype ").concat(o)),s.add(o)),!0;p.forEach(c),l&&f===u.length-1&&Go(e.selectionSet,n,i)&&(l=!1,d=!0,this.fuzzySubtypes.forEach(function(h,g){var v=r.match(h);v&&v[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=Mu(e);o;){var c=o(u,s);if(he(c))o=Lu(c);else{a=c||n;break}}return a===void 0&&(a=e.field?Wc(e.field,e.variables):ia(n,Mu(e))),a===!1?n:n===Qt(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=Qt(o),u=r.store.getFieldValue(n,o),c=this.getFieldPolicy(e.typename,s,!1),l=c&&c.read;if(l){var d=yd(this,n,e,r,r.store.getStorage(ee(n)?n.__ref:n,o));return yi.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===md?bd(i.store)(e,r):u===gd?r:(i.overwrite&&(e=void 0),u(e,r,yd(this,void 0,{typename:s,fieldName:o.name.value,field:o,variables:i.variables},i,a||Object.create(null))))},t}();function yd(t,e,r,n,i){var a=t.getStoreFieldName(r),o=Qt(a),s=r.variables||n.variables,u=n.store,c=u.toReference,l=u.canRead;return{args:Mu(r),field:r.field||null,fieldName:o,storeFieldName:a,variables:s,isReference:ee,toReference:c,storage:i,cache:t.cache,canRead:l,readField:function(){return t.readField(Xo(arguments,e,s),n)},mergeObjects:bd(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=w({},n),De.call(o,"from")||(o.from=e)),__DEV__&&o.from===void 0&&__DEV__&&D.warn("Undefined 'from' passed to readField with arguments ".concat(ff(Array.from(t)))),o.variables===void 0&&(o.variables=r),o}function bd(t){return function(r,n){if(he(r)||he(n))throw __DEV__?new z("Cannot automatically merge arrays"):new z(4);if(oe(r)&&oe(n)){var i=t.getFieldValue(r,"__typename"),a=t.getFieldValue(n,"__typename"),o=i&&a&&i!==a;if(o)return n;if(ee(r)&&Mr(n))return t.merge(r.__ref,n),r;if(Mr(r)&&ee(n))return t.merge(r,n.__ref),n;if(Mr(r)&&Mr(n))return w(w({},r),n)}return n}}function Uu(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 Cd=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=rd();s=w(w({},_n(c)),s);var d=w(w({store:e,written:Object.create(null),merge:function(p,h){return l.merge(p,h)},variables:s,varString:xt(s)},Ko(i,this.fragments)),{overwrite:!!u,incomingById:new Map,clientOnly:!1,deferred:!1,flavors:new Map}),f=this.processSelectionSet({result:a||Object.create(null),dataId:o,selectionSet:c.selectionSet,mergeTree:{map:new Map},context:d});if(!ee(f))throw __DEV__?new z("Could not identify object ".concat(JSON.stringify(a))):new z(7);return d.incomingById.forEach(function(p,h){var g=p.storeObject,v=p.mergeTree,C=p.fieldNodeSet,_=Jt(h);if(v&&v.map.size){var b=n.applyMerges(v,_,g,d);if(ee(b))return;g=b}if(__DEV__&&!d.overwrite){var y=Object.create(null);C.forEach(function(k){k.selectionSet&&(y[k.name.value]=!0)});var T=function(k){return y[Qt(k)]===!0},R=function(k){var P=v&&v.map.get(k);return Boolean(P&&P.info&&P.info.merge)};Object.keys(g).forEach(function(k){T(k)&&!R(k)&&Zg(_,g,k,d.store)})}e.merge(h,g)}),e.retain(f.__ref),f},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]||aa(i,a,o.fragmentMap)||n&&o.store.get(n,"__typename");typeof l=="string"&&(c.__typename=l);var d=function(){var b=Xo(arguments,c,o.variables);if(ee(b.from)){var y=o.incomingById.get(b.from.__ref);if(y){var T=u.readField(w(w({},b),{from:y.storeObject}),o);if(T!==void 0)return T}}return u.readField(b,o)},f=new Set;this.flattenFields(a,i,o,l).forEach(function(b,y){var T,R=Nt(y),k=i[R];if(f.add(y),k!==void 0){var P=u.getStoreFieldName({typename:l,fieldName:y.name.value,field:y,variables:b.variables}),F=_d(s,P),$=r.processFieldValue(k,y,y.selectionSet?Uu(b,!1,!1):b,F),q=void 0;y.selectionSet&&(ee($)||Mr($))&&(q=d("__typename",$));var Ze=u.getMergeFunction(l,y.name.value,q);Ze?F.info={field:y,typename:l,merge:Ze}:wd(s,P),c=b.merge(c,(T={},T[P]=$,T))}else __DEV__&&!b.clientOnly&&!b.deferred&&!wn.added(y)&&!u.getReadFunction(l,y.name.value)&&__DEV__&&D.error("Missing field '".concat(Nt(y),"' while writing result ").concat(JSON.stringify(i,null,2)).substring(0,1e3))});try{var p=u.identify(i,{typename:l,selectionSet:a,fragmentMap:o.fragmentMap,storeObject:c,readField:d}),h=p[0],g=p[1];n=n||h,g&&(c=o.merge(c,g))}catch(b){if(!n)throw b}if(typeof n=="string"){var v=Jt(n),C=o.written[n]||(o.written[n]=[]);if(C.indexOf(a)>=0||(C.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=ju(_.mergeTree,s),f.forEach(function(b){return _.fieldNodeSet.add(b)})):o.incomingById.set(n,{storeObject:c,mergeTree:es(s)?void 0:s,fieldNodeSet:f}),v}return c},t.prototype.processFieldValue=function(e,r,n,i){var a=this;return!r.selectionSet||e===null?__DEV__?Ro(e):e:he(e)?e.map(function(o,s){var u=a.processFieldValue(o,r,n,_d(i,s));return wd(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=aa(r,e,n.fragmentMap));var a=new Map,o=this.cache.policies,s=new Xt(!1);return function u(c,l){var d=s.lookup(c,l.clientOnly,l.deferred);d.visited||(d.visited=!0,c.selections.forEach(function(f){if(!!dr(f,n.variables)){var p=l.clientOnly,h=l.deferred;if(!(p&&h)&&Ue(f.directives)&&f.directives.forEach(function(C){var _=C.name.value;if(_==="client"&&(p=!0),_==="defer"){var b=hr(C,n.variables);(!b||b.if!==!1)&&(h=!0)}}),Ct(f)){var g=a.get(f);g&&(p=p&&g.clientOnly,h=h&&g.deferred),a.set(f,Uu(n,p,h))}else{var v=yn(f,n.lookupFragment);if(!v&&f.kind===$e.FRAGMENT_SPREAD)throw __DEV__?new z("No fragment named ".concat(f.name.value)):new z(8);v&&o.fragmentMatches(v,i,r,n.variables)&&u(v.selectionSet,Uu(n,p,h))}}}))}(e,n),a},t.prototype.applyMerges=function(e,r,n,i,a){var o,s=this;if(e.map.size&&!ee(n)){var u=!he(n)&&(ee(r)||Mr(r))?r:void 0,c=n;u&&!a&&(a=[ee(u)?u.__ref:u]);var l,d=function(f,p){return he(f)?typeof p=="number"?f[p]:void 0:i.store.getFieldValue(f,String(p))};e.map.forEach(function(f,p){var h=d(u,p),g=d(c,p);if(g!==void 0){a&&a.push(p);var v=s.applyMerges(f,h,g,i,a);v!==g&&(l=l||new Map,l.set(p,v)),a&&D(a.pop()===p)}}),l&&(n=he(c)?c.slice(0):w({},c),l.forEach(function(f,p){n[p]=f}))}return e.info?this.cache.policies.runMergeFunction(r,n,e.info,i,a&&(o=i.store).getStorage.apply(o,a)):n},t}();var xd=[];function _d(t,e){var r=t.map;return r.has(e)||r.set(e,xd.pop()||{map:new Map}),r.get(e)}function ju(t,e){if(t===e||!e||es(e))return t;if(!t||es(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,ju(s,e.map.get(u))),o.delete(u)}),o.forEach(function(s){a.map.set(s,ju(e.map.get(s),t.map.get(s)))})}return a}function es(t){return!t||!(t.info||t.map.size)}function wd(t,e){var r=t.map,n=r.get(e);n&&es(n)&&(xd.push(n),r.delete(e))}var Sd=new Set;function Zg(t,e,r,n){var i=function(d){var f=n.getFieldValue(d,r);return typeof f=="object"&&f},a=i(t);if(!!a){var o=i(e);if(!!o&&!ee(a)&&!xe(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=Qt(r),c="".concat(s,".").concat(u);if(!Sd.has(c)){Sd.add(c);var l=[];!he(a)&&!he(o)&&[a,o].forEach(function(d){var f=n.getFieldValue(d,"__typename");typeof f=="string"&&!l.includes(f)&&l.push(f)}),__DEV__&&D.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 ts=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=Yo,n.txCount=0,n.config=ed(r),n.addTypename=!!n.config.addTypename,n.policies=new vd({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 gi.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 Cd(this,this.storeReader=new sd({cache:this,addTypename:this.addTypename,resultCacheMaxSize:this.config.resultCacheMaxSize,canonizeResults:Wo(this.config),canon:r?void 0:i&&i.canon,fragments:a}),a),this.maybeBroadcastWatch=Cn(function(o,s){return n.broadcastWatch(o,s)},{max:this.config.resultCacheMaxSize,makeCacheKey:function(o){var s=o.optimistic?n.optimisticData:n.data;if(xn(s)){var u=o.optimistic,c=o.id,l=o.variables;return s.makeCacheKey(o.query,o.callback,xt({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 ga)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||ud(this),this.watches.add(r),r.immediate&&this.maybeBroadcastWatch(r),function(){n.watches.delete(r)&&!n.watches.size&&Pu(n),n.maybeBroadcastWatch.forget(r)}},e.prototype.gc=function(r){xt.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(ee(r))return r.__ref;try{return this.policies.identify(r)[0]}catch(n){__DEV__&&D.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(),xt.reset(),r&&r.discardWatches?(this.watches.forEach(function(i){return n.maybeBroadcastWatch.forget(i)}),this.watches.clear(),Pu(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(f){var p=n,h=p.data,g=p.optimisticData;++n.txCount,f&&(n.data=n.optimisticData=f);try{return c=i(n)}finally{--n.txCount,n.data=h,n.optimisticData=g}},d=new Set;return u&&!this.txCount&&this.broadcastWatches(w(w({},r),{onWatchUpdated:function(f){return d.add(f),!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(f,p){var h=u.call(this,f,p);return h!==!1&&d.delete(f),h}})),d.size&&d.forEach(function(f){return n.maybeBroadcastWatch.dirty(f)})):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=wn(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||!xe(i.result,a.result))&&r.callback(r.lastDiff=a,i)},e}(ku);function Ed(t){return t.hasOwnProperty("graphQLErrors")}var Jg=function(t){var e="";if(Ue(t.graphQLErrors)||Ue(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)||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__&&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&&(Cr(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:no(r),variables:n}),Re(r.errors)||delete this.last.error,this.last},e.prototype.reobserve=function(r,n){var i=this;this.isTornDown=!1;var a=n===ie.refetch||n===ie.fetchMore||n===ie.poll,o=this.options.variables,s=this.options.fetchPolicy,u=_r(this.options,r||{}),c=a?u:sg(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),rn(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),rn(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}(H);ao(ko);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 ug(t){__DEV__&&I.error("Unhandled error",t.message,t.stack)}function ou(t){__DEV__&&t&&__DEV__&&I.debug("Missing cache result fields: ".concat(JSON.stringify(t)),t)}var To=function(){function t(e){var r=e.cache,n=e.client,i=e.resolvers,a=e.fragmentMatcher;this.selectionsToResolveCache=new WeakMap,this.cache=r,n&&(this.client=n),i&&this.addResolvers(i),a&&this.setFragmentMatcher(a)}return t.prototype.addResolvers=function(e){var r=this;this.resolvers=this.resolvers||{},Array.isArray(e)?e.forEach(function(n){r.resolvers=bc(r.resolvers,n)}):this.resolvers=bc(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 Un(["client"],e)&&this.resolvers?e:null},t.prototype.serverQuery=function(e){return vc(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 Kr}}}),r},t.prototype.buildRootValueFromCache=function(e,r){return this.cache.diff({query:yc(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=Xr(e),u=Jr(e),c=Zr(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))})]:(dc(p)?f=p:(f=a[p.name.value],__DEV__?I(f,"No fragment named ".concat(p.name.value)):I(f,11)),f&&f.typeCondition&&(h=f.typeCondition.name.value,i.fragmentMatcher(n,h,o))?[2,this.resolveSelectionSet(f.selectionSet,r,n,i).then(function(y){u.push(y)})]:[2]):[2]})})},[2,Promise.all(e.selections.map(c)).then(function(){return Mi(u)})]})})},t.prototype.resolveField=function(e,r,n,i){return Tt(this,void 0,void 0,function(){var a,o,s,u,c,l,d,p,f,h=this;return At(this,function(g){return n?(a=i.variables,o=e.name.value,s=_t(e),u=o!==s,c=n[s]||n[o],l=Promise.resolve(c),(!i.onlyRunForcedResolvers||this.shouldForceResolvers(e))&&(d=n.__typename||i.defaultOperationType,p=this.resolvers&&this.resolvers[d],p&&(f=p[u?o:s],f&&(l=Promise.resolve(Yn.withValue(this.cache,f,[n,tr(e,a),i.context,{field:e,fragmentMap:i.fragmentMap}]))))),[2,l.then(function(y){var S,b;if(y===void 0&&(y=c),e.directives&&e.directives.forEach(function(m){m.name.value==="export"&&m.arguments&&m.arguments.forEach(function(A){A.name.value==="as"&&A.value.kind==="StringValue"&&(i.exportedVariables[A.value.value]=y)})}),!e.selectionSet||y==null)return y;var v=(b=(S=e.directives)===null||S===void 0?void 0:S.some(function(m){return m.name.value==="client"}))!==null&&b!==void 0?b:!1;if(Array.isArray(y))return h.resolveSubSelectedArray(e,r||v,y,i);if(e.selectionSet)return h.resolveSelectionSet(e.selectionSet,r||v,y,i)})]):[2,null]})})},t.prototype.resolveSubSelectedArray=function(e,r,n,i){var a=this;return Promise.all(n.map(function(o){if(o===null)return null;if(Array.isArray(o))return a.resolveSubSelectedArray(e,r,o,i);if(e.selectionSet)return a.resolveSelectionSet(e.selectionSet,r,o,i)}))},t.prototype.collectSelectionsToResolve=function(e,r){var n=function(o){return!Array.isArray(o)},i=this.selectionsToResolveCache;function a(o){if(!i.has(o)){var s=new Set;i.set(o,s),Ke(o,{Directive:function(u,c,l,d,p){u.name.value==="client"&&p.forEach(function(f){n(f)&&Ri(f)&&s.add(f)})},FragmentSpread:function(u,c,l,d,p){var f=r[u.name.value];__DEV__?I(f,"No fragment named ".concat(u.name.value)):I(f,12);var h=a(f);h.size>0&&(p.forEach(function(g){n(g)&&Ri(g)&&s.add(g)}),s.add(u),h.forEach(function(g){s.add(g)}))}})}return i.get(o)}return a(e)},t}();var Xn=new(wt?WeakMap:Map);function su(t,e){var r=t[e];typeof r=="function"&&(t[e]=function(){return Xn.set(t,(Xn.get(t)+1)%1e15),r.apply(this,arguments)})}function Bp(t){t.notifyTimeout&&(clearTimeout(t.notifyTimeout),t.notifyTimeout=void 0)}var Ao=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;Xn.has(n)||(Xn.set(n,0),su(n,"evict"),su(n,"modify"),su(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(){Bp(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():au(e)})):delete this.oqListener)},t.prototype.notify=function(){var e=this;Bp(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(Cr(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===Xn.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=oo(this.getDiff().result,e);e.data=u}else if("hasNext"in e&&e.hasNext){var c=this.getDiff();e.data=o.merge(c.result,e.data)}this.graphQLErrors=s,n.fetchPolicy==="no-cache"?this.updateLastDiff({result:e.data,complete:!0},this.getDiffOptions(n.variables)):i!==0&&(Io(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:Xn.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 Io(t,e){e===void 0&&(e="none");var r=e==="ignore"||e==="all",n=!Gn(t);return!n&&r&&t.data&&(n=!0),n}var lg=Object.prototype.hasOwnProperty,Vp=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 To({cache:r}),this.ssrMode=c,this.assumeImmutableResults=!!f,(this.onBroadcast=s)&&(this.mutationStore=Object.create(null))}return t.prototype.stop=function(){var e=this;this.queries.forEach(function(r,n){e.stopQueryNoBroadcast(n)}),this.cancelPendingFetches(__DEV__?new 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,C,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,C=A.hasClientExports,i=this.cache.transformForLink(D),a=this.getVariables(i,a),C?[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(U,qe){return io(P.getObservableFromLink(i,_(_({},v),{optimisticResponse:o}),a,!1),function(Ne){if(Gn(Ne)&&S==="none")throw new rr({graphQLErrors:so(Ne)});O&&(O.loading=!1,O.error=null);var q=_({},Ne);return typeof c=="function"&&(c=c(q)),S==="ignore"&&Gn(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)&&U(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&&Io(i,e.errorPolicy)){if(br(i)||a.push({result:i.data,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}),br(i)&&Re(i.incremental)){var s=r.diff({id:"ROOT_MUTATION",query:this.transform(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0}),u=void 0;s.result&&(u=oo(s.result,i)),typeof u<"u"&&(i.data=u,a.push({result:u,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}))}var c=e.updateQueries;c&&this.queries.forEach(function(d,p){var f=d.observableQuery,h=f&&f.queryName;if(!(!h||!lg.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&&Bn(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=!kf(i)||br(i)&&!i.hasNext;if(p){if(!o){var h=d.diff({id:"ROOT_MUTATION",query:n.transform(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0});h.complete&&(i=_(_({},i),{data:h.result}),"incremental"in i&&delete i.incremental,"hasNext"in i&&delete i.hasNext)}f&&p(d,i,{context:e.context,variables:e.variables})}!o&&!e.keepRootFields&&f&&d.modify({id:"ROOT_MUTATION",fields:function(g,y){var S=y.fieldName,b=y.DELETE;return S==="__typename"?g:b}})},include:e.refetchQueries,optimistic:!1,removeOptimistic:e.removeOptimistic,onQueryUpdated:e.onQueryUpdated||null}).forEach(function(d){return l.push(d)}),e.awaitRefetchQueries||e.onQueryUpdated)return Promise.all(l).then(function(){return i})}return Promise.resolve(i)},t.prototype.markMutationOptimistic=function(e,r){var n=this,i=typeof e=="function"?e(r.variables):e;return this.cache.recordOptimisticTransaction(function(a){try{n.markMutationResult(_(_({},r),{result:{data:i}}),a)}catch(o){__DEV__&&I.error(o)}},r.mutationId)},t.prototype.fetchQuery=function(e,r,n){return this.fetchQueryObservable(e,r,n).promise},t.prototype.getQueryStore=function(){var e=Object.create(null);return this.queries.forEach(function(r,n){e[n]={variables:r.variables,networkStatus:r.networkStatus,networkError:r.networkError,graphQLErrors:r.graphQLErrors}}),e},t.prototype.resetErrors=function(e){var r=this.queries.get(e);r&&(r.networkError=void 0,r.graphQLErrors=[])},t.prototype.transform=function(e){var r=this.transformCache;if(!r.has(e)){var n=this.cache.transformDocument(e),i=gc(n),a=this.localState.clientQuery(n),o=i&&this.localState.serverQuery(i),s={document:n,hasClientExports:uc(n),hasForcedResolvers:this.localState.shouldForceResolvers(n),clientQuery:a,serverQuery:o,defaultVars:en(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 Ao(this),n=new ko({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):fc(o)?i.set(r.transform(o).document,!1):ee(o)&&o.query&&a.add(o)}),this.queries.forEach(function(o,s){var u=o.observableQuery,c=o.document;if(u){if(e==="all"){n.set(s,u);return}var l=u.queryName,d=u.options.fetchPolicy;if(d==="standby"||e==="active"&&!u.hasObservers())return;(e==="active"||l&&i.has(l)||c&&i.has(c))&&(n.set(s,u),l&&i.set(l,!0),c&&i.set(c,!0))}}),a.size&&a.forEach(function(o){var s=qi("legacyOneTimeQuery"),u=r.getQuery(s).init({document:o.query,variables:o.variables}),c=new ko({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"&&(Io(p,a)&&r.cache.write({query:n,result:p.data,dataId:"ROOT_SUBSCRIPTION",variables:d}),r.broadcastQueries()),Gn(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 H(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:Bn(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 Qn([Hn(d,p)]);f.set(h,s=g),g.beforeNext(function(){f.delete(h)&&f.size<1&&l.delete(u)})}}else s=new Qn([Hn(d,p)])}else s=new Qn([H.of({data:{}})]),r=this.prepareContext(r);var y=this.transform(e).clientQuery;return y&&(s=io(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 io(this.getObservableFromLink(a,n.context,n.variables),function(o){var s=so(o),u=s.length>0;if(i>=e.lastRequestId){if(u&&n.errorPolicy==="none")throw e.markError(new 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=qp(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(C){v.variables=C;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(C){A(),setTimeout(function(){return D.cancel(C)})});var D=new Qn(this.transform(v.query).hasClientExports?this.localState.addExportedVariables(v.query,v.variables,v.context).then(m):m(v.variables));return D.promise.then(A,A),D},t.prototype.refetchQueries=function(e){var r=this,n=e.updateCache,i=e.include,a=e.optimistic,o=a===void 0?!1:a,s=e.removeOptimistic,u=s===void 0?o?qi("refetchQueries"):void 0:s,c=e.onQueryUpdated,l=new Map;i&&this.getObservableQueries(i).forEach(function(p,f){l.set(f,{oq:p,lastDiff:r.getQuery(f).getDiff()})});var d=new Map;return n&&this.cache.batch({update:n,optimistic:o&&u||!1,removeOptimistic:u,onWatchUpdated:function(p,f,h){var g=p.watcher instanceof Ao&&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,{})&&ou(m.missing);var C=function(O){return H.of(_({data:O,loading:Cr(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 C(O.data||void 0)}):c==="none"&&A===ie.refetch&&Array.isArray(m.missing)?C(void 0):C(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&&Cr(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 Ao(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 zp=!1;var cu=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,C=e.link;if(C||(C=n?new $c({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=C,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),!zp&&p&&__DEV__&&(zp=!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=Of,this.localState=new To({cache:o,client:this,resolvers:b,fragmentMatcher:m}),this.queryManager=new Vp({cache:this.cache,link:this.link,defaultOptions:this.defaultOptions,queryDeduplication:h,ssrMode:u,clientAwareness:{name:A,version:D},localState:this.localState,assumeImmutableResults:S,onBroadcast:p?function(){r.devToolsHookCb&&r.devToolsHookCb({action:{},state:{queries:r.queryManager.getQueryStore(),mutations:r.queryManager.mutationStore||{}},dataWithOptimisticResults:r.cache.extract(!0)})}:void 0})}return t.prototype.stop=function(){this.queryManager.stop()},t.prototype.watchQuery=function(e){return this.defaultOptions.watchQuery&&(e=Bi(this.defaultOptions.watchQuery,e)),this.disableNetworkFetches&&(e.fetchPolicy==="network-only"||e.fetchPolicy==="cache-and-network")&&(e=_(_({},e),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(e)},t.prototype.query=function(e){return this.defaultOptions.query&&(e=Bi(this.defaultOptions.query,e)),__DEV__?I(e.fetchPolicy!=="cache-and-network","The cache-and-network fetchPolicy does not work with client.query, because client.query can only return a single result. Please use client.watchQuery to receive multiple results from the cache and the network, or consider using a different fetchPolicy, such as cache-first or network-only."):I(e.fetchPolicy!=="cache-and-network",10),this.disableNetworkFetches&&e.fetchPolicy==="network-only"&&(e=_(_({},e),{fetchPolicy:"cache-first"})),this.queryManager.query(e)},t.prototype.mutate=function(e){return this.defaultOptions.mutate&&(e=Bi(this.defaultOptions.mutate,e)),this.queryManager.mutate(e)},t.prototype.subscribe=function(e){return this.queryManager.startGraphQLSubscription(e)},t.prototype.readQuery=function(e,r){return r===void 0&&(r=!1),this.cache.readQuery(e,r)},t.prototype.readFragment=function(e,r){return r===void 0&&(r=!1),this.cache.readFragment(e,r)},t.prototype.writeQuery=function(e){var r=this.cache.writeQuery(e);return e.broadcast!==!1&&this.queryManager.broadcastQueries(),r},t.prototype.writeFragment=function(e){var r=this.cache.writeFragment(e);return e.broadcast!==!1&&this.queryManager.broadcastQueries(),r},t.prototype.__actionHookForDevTools=function(e){this.devToolsHookCb=e},t.prototype.__requestRaw=function(e){return Hn(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}();tf(Wr?"log":"silent");function Ye(t){return t===null?"null":Array.isArray(t)?"array":typeof t}function nr(t){return Ye(t)==="object"}function Qp(t){return Array.isArray(t)&&t.length>0&&t.every(e=>"message"in e)}function uu(t,e){return t.length<124?t:e}var Gp="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 Hp(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(!Qp(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 Wp(t,e){return Hp(typeof t=="string"?JSON.parse(t,e):t)}function ei(t,e){return Hp(t),JSON.stringify(t,e)}function Kp(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=Oo,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(!pg(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,C=0,O,P=!1,N=0,U=!1;async function qe(){clearTimeout(O);let[q,de]=await(D??(D=new Promise((X,Ft)=>(async()=>{if(P){if(await l(N),!C)return D=void 0,Ft({code:1e3,reason:"All Subscriptions Gone"});N++}m.emit("connecting");let G=new v(typeof e=="function"?await e():e,Gp),Mt,fr;function qa(){isFinite(o)&&o>0&&(clearTimeout(fr),fr=setTimeout(()=>{G.readyState===v.OPEN&&(G.send(ei({type:Te.Ping})),m.emit("ping",!1,void 0))},o))}A(Be=>{D=void 0,clearTimeout(Mt),clearTimeout(fr),Ft(Be),Oo(Be)&&Be.code===4499&&(G.close(4499,"Terminated"),G.onerror=null,G.onclose=null)}),G.onerror=Be=>m.emit("error",Be),G.onclose=Be=>m.emit("closed",Be),G.onopen=async()=>{try{m.emit("opened",G);let Be=typeof r=="function"?await r():r;if(G.readyState!==v.OPEN)return;G.send(ei(Be?{type:Te.ConnectionInit,payload:Be}:{type:Te.ConnectionInit},y)),isFinite(u)&&u>0&&(Mt=setTimeout(()=>{G.close(at.ConnectionAcknowledgementTimeout,"Connection acknowledgement timeout")},u)),qa()}catch(Be){m.emit("error",Be),G.close(at.InternalClientError,uu(Be instanceof Error?Be.message:new Error(Be).message,"Internal client error"))}};let Ln=!1;G.onmessage=({data:Be})=>{try{let Ve=Wp(Be,S);if(m.emit("message",Ve),Ve.type==="ping"||Ve.type==="pong"){m.emit(Ve.type,!0,Ve.payload),Ve.type==="pong"?qa():s||(G.send(ei(Ve.payload?{type:Te.Pong,payload:Ve.payload}:{type:Te.Pong})),m.emit("pong",!1,Ve.payload));return}if(Ln)return;if(Ve.type!==Te.ConnectionAck)throw new Error(`First message cannot be of type ${Ve.type}`);clearTimeout(Mt),Ln=!0,m.emit("connected",G,Ve.payload),P=!1,N=0,X([G,new Promise(($2,sm)=>A(sm))])}catch(Ve){G.onmessage=null,m.emit("error",Ve),G.close(at.BadResponse,uu(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(!C){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(Oo(q)&&(fg(q.code)||[at.InternalServerError,at.InternalClientError,at.BadRequest,at.BadResponse,at.Unauthorized,at.SubprotocolNotAcceptable,at.SubscriberAlreadyExists,at.TooManyInitialisationRequests].includes(q.code)))throw q;if(U)return!1;if(Oo(q)&&q.code===1e3)return C>0;if(!c||N>=c||!d(q)||p?.(q))throw q;return P=!0}return n||(async()=>{for(C++;;)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=()=>{C--,J=!0};return(async()=>{for(C++;;)try{let[G,Mt,fr]=await qe();if(J)return Mt();let qa=m.onMessage(he,Ln=>{switch(Ln.type){case Te.Next:{de.next(Ln.payload);return}case Te.Error:{X=!0,J=!0,de.error(Ln.payload),Ft();return}case Te.Complete:{J=!0,Ft();return}}});G.send(ei({id:he,type:Te.Subscribe,payload:q},y)),Ft=()=>{!J&&G.readyState===v.OPEN&&G.send(ei({id:he,type:Te.Complete},y)),C--,J=!0,Mt()},await fr.finally(qa);return}catch(G){if(!Ne(G))return}})().then(()=>{X||de.complete()}).catch(G=>{de.error(G)}),()=>{J||Ft()}},async dispose(){if(U=!0,D){let[q]=await D;q.close(1e3,"Normal Closure")}},terminate(){D&&m.emit("closed",{code:4499,reason:"Terminated",wasClean:!1})}}}function Oo(t){return nr(t)&&"code"in t&&"reason"in t}function fg(t){return[1e3,1001,1006,1005,1012,1013,1013].includes(t)?!1:t>=1e3&&t<=1999}function pg(t){return typeof t=="function"&&"constructor"in t&&"CLOSED"in t&&"CLOSING"in t&&"CONNECTING"in t&&"OPEN"in t}function dg(t){return ee(t)&&"code"in t&&"reason"in t}var Zp=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 H(function(i){return n.client.subscribe(_(_({},r),{query:jn(r.query)}),{next:i.next.bind(i),complete:i.complete.bind(i),error:function(a){return a instanceof Error?i.error(a):dg(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 is=function(){return is=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},is.apply(this,arguments)};typeof SuppressedError=="function"&&SuppressedError;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)}function hg(t){return Vo(t)=="object"&&t!==null}var oh=typeof Symbol=="function"&&Symbol.toStringTag!=null?Symbol.toStringTag:"@@toStringTag";function Ou(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 mg(t){return sh(t.source,Ou(t.source,t.start))}function sh(t,e){var r=t.locationOffset.column-1,n=zo(r)+t.body,i=e.line-1,a=t.locationOffset.line-1,o=e.line+a,s=e.line===1?r:0,u=e.column+s,c="".concat(t.name,":").concat(o,":").concat(u,`
|
|
54
|
-
`),l=n.split(/\r\n|[\n\r]/g),d=l[i];if(d.length>120){for(var
|
|
55
|
-
`)}function
|
|
51
|
+
`)),e=e.replace(/\n$/,""),e},mr=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||Jg(u),u.extraInfo=s,u.__proto__=e.prototype,u}return e}(Error);var ue;(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"})(ue||(ue={}));function jr(t){return t?t<7:!1}var Yg=Object.assign,Xg=Object.hasOwnProperty,rs=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 C=v._subscription._observer;C&&!C.error&&(C.error=ey)}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,f=d===void 0?l:d,p=a.initialFetchPolicy,h=p===void 0?f==="standby"?l:f:p;o.options=w(w({},a),{initialFetchPolicy:h,fetchPolicy:f}),o.queryId=i.queryId||n.generateQueryId();var g=Yt(o.query);return o.queryName=g&&g.name&&g.name.value,o}return Object.defineProperty(e.prototype,"query",{get:function(){return this.queryManager.transform(this.options.query).document},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"variables",{get:function(){return this.options.variables},enumerable:!1,configurable:!0}),e.prototype.result=function(){var r=this;return new Promise(function(n,i){var a={next:function(s){n(s),r.observers.delete(a),r.observers.size||r.queryManager.removeQuery(r.queryId),setTimeout(function(){o.unsubscribe()},0)},error:i},o=r.subscribe(a)})},e.prototype.getCurrentResult=function(r){r===void 0&&(r=!0);var n=this.getLastResult(!0),i=this.queryInfo.networkStatus||n&&n.networkStatus||ue.ready,a=w(w({},n),{loading:jr(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),xe(a.data,{})&&(a.data=void 0),u.complete?(delete a.partial,u.complete&&a.networkStatus===ue.loading&&(s==="cache-first"||s==="cache-only")&&(a.networkStatus=ue.ready,a.loading=!1)):a.partial=!0,__DEV__&&!u.complete&&!this.options.partialRefetch&&!a.loading&&!a.data&&!a.error&&qu(u.missing)}return r&&this.updateLastResult(a),a},e.prototype.isDifferentFromLastResult=function(r,n){return!this.last||!xe(this.last.result,r)||n&&!xe(this.last.variables,n)},e.prototype.getLast=function(r,n){var i=this.last;if(i&&i[r]&&(!n||xe(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&&Xg.call(r,"variables")){var o=oa(this.query),s=o.variableDefinitions;(!s||!s.some(function(u){return u.variable.name.value==="variables"}))&&__DEV__&&D.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&&!xe(this.options.variables,r)&&(i.variables=this.options.variables=w(w({},this.options.variables),r)),this.queryInfo.resetLastWrite(),this.reobserve(i,ue.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=ue.fetchMore,i.notifyOnNetworkStatusChange&&this.observe();var u=new Set;return this.queryManager.fetchQuery(a,i,ue.fetchMore).then(function(c){return n.queryManager.removeQuery(a),o.networkStatus===ue.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(f){return d(f,{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)||Bu(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__&&D.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 xe(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},ue.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__?D(a,"Attempted to start a polling query without a polling interval."):D(a,13);var o=i||(this.pollingInfo={});o.interval=a;var s=function(){r.pollingInfo&&(jr(r.queryInfo.networkStatus)?u():r.reobserve({fetchPolicy:r.options.initialFetchPolicy==="no-cache"?"no-cache":"network-only"},ue.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:Ro(r),variables:n}),Ue(r.errors)||delete this.last.error,this.last},e.prototype.reobserve=function(r,n){var i=this;this.isTornDown=!1;var a=n===ue.refetch||n===ue.fetchMore||n===ue.poll,o=this.options.variables,s=this.options.fetchPolicy,u=Lr(this.options,r||{}),c=a?u:Yg(this.options,u);a||(this.updatePolling(),r&&r.variables&&!xe(r.variables,o)&&c.fetchPolicy!=="standby"&&c.fetchPolicy===s&&(this.applyNextFetchPolicy("variables-changed",c),n===void 0&&(n=ue.setVariables)));var l=c.variables&&w({},c.variables),d=this.fetch(c,n),f={next:function(p){i.reportResult(p,l)},error:function(p){i.reportError(p,l)}};return a||(this.concast&&this.observer&&this.concast.removeObserver(this.observer),this.concast=d,this.observer=f),d.addObserver(f),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),Sn(this.observers,"next",r))},e.prototype.reportError=function(r,n){var i=w(w({},this.getLastResult()),{error:r,errors:r.graphQLErrors,networkStatus:ue.error,loading:!1});this.updateLastResult(i,n),Sn(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}(Y);Lo(rs);function Bu(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 ey(t){__DEV__&&D.error("Unhandled error",t.message,t.stack)}function qu(t){__DEV__&&t&&__DEV__&&D.debug("Missing cache result fields: ".concat(JSON.stringify(t)),t)}var ns=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=tu(r.resolvers,n)}):this.resolvers=tu(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 jt(this,void 0,void 0,function(){return Bt(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 oi(["client"],e)&&this.resolvers?e:null},t.prototype.serverQuery=function(e){return eu(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={}),jt(this,void 0,void 0,function(){return Bt(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 nt(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 mn}}}),r},t.prototype.buildRootValueFromCache=function(e,r){return this.cache.diff({query:Xc(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),jt(this,void 0,void 0,function(){var s,u,c,l,d,f,p,h,g,v,C;return Bt(this,function(_){return s=bn(e),u=vn(e),c=gn(u),l=this.collectSelectionsToResolve(s,c),d=s.operation,f=d?d.charAt(0).toUpperCase()+d.slice(1):"Query",p=this,h=p.cache,g=p.client,v={fragmentMap:c,context:w(w({},n),{cache:h,client:g}),variables:i,fragmentMatcher:a,defaultOperationType:f,exportedVariables:{},selectionsToResolve:l,onlyRunForcedResolvers:o},C=!1,[2,this.resolveSelectionSet(s.selectionSet,C,r,v).then(function(b){return{result:b,exportedVariables:v.exportedVariables}})]})})},t.prototype.resolveSelectionSet=function(e,r,n,i){return jt(this,void 0,void 0,function(){var a,o,s,u,c,l=this;return Bt(this,function(d){return a=i.fragmentMap,o=i.context,s=i.variables,u=[n],c=function(f){return jt(l,void 0,void 0,function(){var p,h;return Bt(this,function(g){return!r&&!i.selectionsToResolve.has(f)?[2]:dr(f,s)?Ct(f)?[2,this.resolveField(f,r,n,i).then(function(v){var C;typeof v<"u"&&u.push((C={},C[Nt(f)]=v,C))})]:(Kc(f)?p=f:(p=a[f.name.value],__DEV__?D(p,"No fragment named ".concat(f.name.value)):D(p,11)),p&&p.typeCondition&&(h=p.typeCondition.name.value,i.fragmentMatcher(n,h,o))?[2,this.resolveSelectionSet(p.selectionSet,r,n,i).then(function(v){u.push(v)})]:[2]):[2]})})},[2,Promise.all(e.selections.map(c)).then(function(){return sa(u)})]})})},t.prototype.resolveField=function(e,r,n,i){return jt(this,void 0,void 0,function(){var a,o,s,u,c,l,d,f,p,h=this;return Bt(this,function(g){return n?(a=i.variables,o=e.name.value,s=Nt(e),u=o!==s,c=n[s]||n[o],l=Promise.resolve(c),(!i.onlyRunForcedResolvers||this.shouldForceResolvers(e))&&(d=n.__typename||i.defaultOperationType,f=this.resolvers&&this.resolvers[d],f&&(p=f[u?o:s],p&&(l=Promise.resolve(yi.withValue(this.cache,p,[n,hr(e,a),i.context,{field:e,fragmentMap:i.fragmentMap}]))))),[2,l.then(function(v){var C,_;if(v===void 0&&(v=c),e.directives&&e.directives.forEach(function(y){y.name.value==="export"&&y.arguments&&y.arguments.forEach(function(T){T.name.value==="as"&&T.value.kind==="StringValue"&&(i.exportedVariables[T.value.value]=v)})}),!e.selectionSet||v==null)return v;var b=(_=(C=e.directives)===null||C===void 0?void 0:C.some(function(y){return y.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),nt(o,{Directive:function(u,c,l,d,f){u.name.value==="client"&&f.forEach(function(p){n(p)&&ra(p)&&s.add(p)})},FragmentSpread:function(u,c,l,d,f){var p=r[u.name.value];__DEV__?D(p,"No fragment named ".concat(u.name.value)):D(p,12);var h=a(p);h.size>0&&(f.forEach(function(g){n(g)&&ra(g)&&s.add(g)}),s.add(u),h.forEach(function(g){s.add(g)}))}})}return i.get(o)}return a(e)},t}();var bi=new(Pt?WeakMap:Map);function Vu(t,e){var r=t[e];typeof r=="function"&&(t[e]=function(){return bi.set(t,(bi.get(t)+1)%1e15),r.apply(this,arguments)})}function kd(t){t.notifyTimeout&&(clearTimeout(t.notifyTimeout),t.notifyTimeout=void 0)}var is=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;bi.has(n)||(bi.set(n,0),Vu(n,"evict"),Vu(n,"modify"),Vu(n,"reset"))}return t.prototype.init=function(e){var r=e.networkStatus||ue.loading;return this.variables&&this.networkStatus!==ue.loading&&!xe(this.variables,e.variables)&&(r=ue.setVariables),xe(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(){kd(this),this.dirty=!1},t.prototype.getDiff=function(e){e===void 0&&(e=this.variables);var r=this.getDiffOptions(e);if(this.lastDiff&&xe(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&&!xe(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():Bu(e)})):delete this.oqListener)},t.prototype.notify=function(){var e=this;kd(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(jr(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||!xe(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===bi.get(this.cache)&&xe(r,n.variables)&&xe(e.data,n.result.data))},t.prototype.markResult=function(e,r,n,i){var a=this,o=new ht,s=Ue(e.errors)?e.errors.slice(0):[];if(this.reset(),"incremental"in e&&Ue(e.incremental)){var u=Fo(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&&(as(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:bi.get(a.cache)};else if(a.lastDiff&&a.lastDiff.diff.complete){e.data=a.lastDiff.diff.result;return}var d=a.getDiffOptions(n.variables),f=l.diff(d);a.stopped||a.updateWatch(n.variables),a.updateLastDiff(f,d),f.complete&&(e.data=f.result)}):this.lastWrite=void 0)},t.prototype.markReady=function(){return this.networkError=null,this.networkStatus=ue.ready},t.prototype.markError=function(e){return this.networkStatus=ue.error,this.lastWrite=void 0,this.reset(),e.graphQLErrors&&(this.graphQLErrors=e.graphQLErrors),e.networkError&&(this.networkError=e.networkError),e},t}();function as(t,e){e===void 0&&(e="none");var r=e==="ignore"||e==="all",n=!fi(t);return!n&&r&&t.data&&(n=!0),n}var ty=Object.prototype.hasOwnProperty,Id=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,f=e.localState,p=e.assumeImmutableResults;this.clientAwareness={},this.queries=new Map,this.fetchCancelFns=new Map,this.transformCache=new(Pt?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=f||new ns({cache:r}),this.ssrMode=c,this.assumeImmutableResults=!!p,(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 z("QueryManager stopped while query was in flight"):new z(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,f=e.update,p=e.onQueryUpdated,h=e.fetchPolicy,g=h===void 0?((r=this.defaultOptions.mutate)===null||r===void 0?void 0:r.fetchPolicy)||"network-only":h,v=e.errorPolicy,C=v===void 0?((n=this.defaultOptions.mutate)===null||n===void 0?void 0:n.errorPolicy)||"none":v,_=e.keepRootFields,b=e.context;return jt(this,void 0,void 0,function(){var y,T,R,k,P,F;return Bt(this,function($){switch($.label){case 0:return __DEV__?D(i,"mutation option is required. You must specify your GraphQL document in the mutation option."):D(i,15),__DEV__?D(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."):D(g==="network-only"||g==="no-cache",16),y=this.generateMutationId(),T=this.transform(i),R=T.document,k=T.hasClientExports,i=this.cache.transformForLink(R),a=this.getVariables(i,a),k?[4,this.localState.addExportedVariables(i,a,b)]:[3,2];case 1:a=$.sent(),$.label=2;case 2:return P=this.mutationStore&&(this.mutationStore[y]={mutation:i,variables:a,loading:!0,error:null}),o&&this.markMutationOptimistic(o,{mutationId:y,document:i,variables:a,fetchPolicy:g,errorPolicy:C,context:b,updateQueries:s,update:f,keepRootFields:_}),this.broadcastQueries(),F=this,[2,new Promise(function(q,Ze){return $o(F.getObservableFromLink(i,w(w({},b),{optimisticResponse:o}),a,!1),function(Me){if(fi(Me)&&C==="none")throw new mr({graphQLErrors:Mo(Me)});P&&(P.loading=!1,P.error=null);var V=w({},Me);return typeof c=="function"&&(c=c(V)),C==="ignore"&&fi(V)&&delete V.errors,F.markMutationResult({mutationId:y,result:V,document:i,variables:a,fetchPolicy:g,errorPolicy:C,context:b,update:f,updateQueries:s,awaitRefetchQueries:d,refetchQueries:c,removeOptimistic:o?y:void 0,onQueryUpdated:p,keepRootFields:_})}).subscribe({next:function(Me){F.broadcastQueries(),(!("hasNext"in Me)||Me.hasNext===!1)&&q(Me)},error:function(Me){P&&(P.loading=!1,P.error=Me),o&&F.cache.removeOptimistic(y),F.broadcastQueries(),Ze(Me instanceof mr?Me:new mr({networkError:Me}))}})})]}})})},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&&as(i,e.errorPolicy)){if($r(i)||a.push({result:i.data,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}),$r(i)&&Ue(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=Fo(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,f){var p=d.observableQuery,h=p&&p.queryName;if(!(!h||!ty.call(c,h))){var g=c[h],v=n.queries.get(f),C=v.document,_=v.variables,b=r.diff({query:C,variables:_,returnPartialData:!0,optimistic:!1}),y=b.result,T=b.complete;if(T&&y){var R=g(y,{mutationResult:i,queryName:C&&ci(C)||void 0,queryVariables:_});R&&a.push({result:R,dataId:"ROOT_QUERY",query:C,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(g){return d.write(g)});var f=e.update,p=!lf(i)||$r(i)&&!i.hasNext;if(f){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)}p&&f(d,i,{context:e.context,variables:e.variables})}!o&&!e.keepRootFields&&p&&d.modify({id:"ROOT_MUTATION",fields:function(g,v){var C=v.fieldName,_=v.DELETE;return C==="__typename"?g:_}})},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__&&D.error(o)}},r.mutationId)},t.prototype.fetchQuery=function(e,r,n){return this.fetchQueryObservable(e,r,n).promise},t.prototype.getQueryStore=function(){var e=Object.create(null);return this.queries.forEach(function(r,n){e[n]={variables:r.variables,networkStatus:r.networkStatus,networkError:r.networkError,graphQLErrors:r.graphQLErrors}}),e},t.prototype.resetErrors=function(e){var r=this.queries.get(e);r&&(r.networkError=void 0,r.graphQLErrors=[])},t.prototype.transform=function(e){var r=this.transformCache;if(!r.has(e)){var n=this.cache.transformDocument(e),i=Yc(n),a=this.localState.clientQuery(n),o=i&&this.localState.serverQuery(i),s={document:n,hasClientExports:zc(n),hasForcedResolvers:this.localState.shouldForceResolvers(n),clientQuery:a,serverQuery:o,defaultVars:_n(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 is(this),n=new rs({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__?D(e.query,"query option is required. You must specify your GraphQL document in the query option."):D(e.query,17),__DEV__?D(e.query.kind==="Document",'You must wrap the query string in a "gql" tag.'):D(e.query.kind==="Document",18),__DEV__?D(!e.returnPartialData,"returnPartialData option only supported on watchQuery."):D(!e.returnPartialData,19),__DEV__?D(!e.pollInterval,"pollInterval option only supported on watchQuery."):D(!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 z("Store reset while query was in flight (not completed in link chain)"):new z(21)),this.queries.forEach(function(r){r.observableQuery?r.networkStatus=ue.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):oe(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=la("legacyOneTimeQuery"),u=r.getQuery(s).init({document:o.query,variables:o.variables}),c=new rs({queryManager:r,queryInfo:u,options:w(w({},o),{fetchPolicy:"network-only"})});D(c.queryId===s),u.setObservableQuery(c),n.set(s,c)}),__DEV__&&i.size&&i.forEach(function(o,s){o||__DEV__&&D.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(f){if(i!=="no-cache"&&(as(f,a)&&r.cache.write({query:n,result:f.data,dataId:"ROOT_SUBSCRIPTION",variables:d}),r.broadcastQueries()),fi(f))throw new mr({graphQLErrors:f.errors});return f})};if(this.transform(n).hasClientExports){var l=this.localState.addExportedVariables(n,o,u).then(c);return new Y(function(d){var f=null;return l.then(function(p){return f=p.subscribe(d)},d.error),function(){return f&&f.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,f={query:u,variables:n,operationName:ci(u)||void 0,context:this.prepareContext(w(w({},r),{forceFetch:!i}))};if(r=f.context,i){var p=l.get(u)||new Map;l.set(u,p);var h=xt(n);if(s=p.get(h),!s){var g=new pi([di(d,f)]);p.set(h,s=g),g.beforeNext(function(){p.delete(h)&&p.size<1&&l.delete(u)})}}else s=new pi([di(d,f)])}else s=new pi([Y.of({data:{}})]),r=this.prepareContext(r);var v=this.transform(e).clientQuery;return v&&(s=$o(s,function(C){return a.localState.runResolvers({document:v,remoteResult:C,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 $o(this.getObservableFromLink(a,n.context,n.variables),function(o){var s=Mo(o),u=s.length>0;if(i>=e.lastRequestId){if(u&&n.errorPolicy==="none")throw e.markError(new mr({graphQLErrors:s}));e.markResult(o,a,n,r),e.markReady()}var c={data:o.data,loading:!1,networkStatus:ue.ready};return u&&n.errorPolicy!=="ignore"&&(c.errors=s,c.networkStatus=ue.error),c},function(o){var s=Ed(o)?o:new mr({networkError:o});throw i>=e.lastRequestId&&e.markError(s),s})},t.prototype.fetchQueryObservable=function(e,r,n){var i=this;n===void 0&&(n=ue.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,f=d===void 0?u&&u.errorPolicy||"none":d,p=r.returnPartialData,h=p===void 0?!1:p,g=r.notifyOnNetworkStatusChange,v=g===void 0?!1:g,C=r.context,_=C===void 0?{}:C,b=Object.assign({},r,{query:a,variables:o,fetchPolicy:l,errorPolicy:f,returnPartialData:h,notifyOnNetworkStatusChange:v,context:_}),y=function(k){b.variables=k;var P=i.fetchQueryByPolicy(s,b,n);return b.fetchPolicy!=="standby"&&P.length>0&&s.observableQuery&&s.observableQuery.applyNextFetchPolicy("after-fetch",r),P},T=function(){return i.fetchCancelFns.delete(e)};this.fetchCancelFns.set(e,function(k){T(),setTimeout(function(){return R.cancel(k)})});var R=new pi(this.transform(b.query).hasClientExports?this.localState.addExportedVariables(b.query,b.variables,b.context).then(y):y(b.variables));return R.promise.then(T,T),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?la("refetchQueries"):void 0:s,c=e.onQueryUpdated,l=new Map;i&&this.getObservableQueries(i).forEach(function(f,p){l.set(p,{oq:f,lastDiff:r.getQuery(p).getDiff()})});var d=new Map;return n&&this.cache.batch({update:n,optimistic:o&&u||!1,removeOptimistic:u,onWatchUpdated:function(f,p,h){var g=f.watcher instanceof is&&f.watcher.observableQuery;if(g){if(c){l.delete(g.queryId);var v=c(g,p,h);return v===!0&&(v=g.refetch()),v!==!1&&d.set(g,v),v}c!==null&&l.set(g.queryId,{oq:g,lastDiff:h,diff:p})}}}),l.size&&l.forEach(function(f,p){var h=f.oq,g=f.lastDiff,v=f.diff,C;if(c){if(!v){var _=h.queryInfo;_.reset(),v=_.getDiff()}C=c(h,v,g)}(!c||C===!0)&&(C=h.refetch()),C!==!1&&d.set(h,C),p.indexOf("legacyOneTimeQuery")>=0&&r.stopQueryNoBroadcast(p)}),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,f=r.notifyOnNetworkStatusChange,p=e.networkStatus;e.init({document:this.transform(a).document,variables:o,networkStatus:n});var h=function(){return e.getDiff(o)},g=function(y,T){T===void 0&&(T=e.networkStatus||ue.loading);var R=y.result;__DEV__&&!l&&!xe(R,{})&&qu(y.missing);var k=function(P){return Y.of(w({data:P,loading:jr(T),networkStatus:T},y.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(P){return k(P.data||void 0)}):c==="none"&&T===ue.refetch&&Array.isArray(y.missing)?k(void 0):k(R)},v=s==="no-cache"?0:n===ue.refetch&&u!=="merge"?1:2,C=function(){return i.getResultsFromLink(e,v,{variables:o,context:d,fetchPolicy:s,errorPolicy:c})},_=f&&typeof p=="number"&&p!==n&&jr(n);switch(s){default:case"cache-first":{var b=h();return b.complete?[g(b,e.markReady())]:l||_?[g(b),C()]:[C()]}case"cache-and-network":{var b=h();return b.complete||l||_?[g(b),C()]:[C()]}case"cache-only":return[g(h(),e.markReady())];case"network-only":return _?[g(h()),C()]:[C()];case"no-cache":return _?[g(e.getDiff()),C()]:[C()];case"standby":return[]}},t.prototype.getQuery=function(e){return e&&!this.queries.has(e)&&this.queries.set(e,new is(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 Ad=!1;var Qu=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,f=d===void 0?typeof window=="object"&&!window.__APOLLO_CLIENT__&&__DEV__:d,p=e.queryDeduplication,h=p===void 0?!0:p,g=e.defaultOptions,v=e.assumeImmutableResults,C=v===void 0?!1:v,_=e.resolvers,b=e.typeDefs,y=e.fragmentMatcher,T=e.name,R=e.version,k=e.link;if(k||(k=n?new vu({uri:n,credentials:i,headers:a}):Rt.empty()),!o)throw __DEV__?new z(`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 z(9);if(this.link=k,this.cache=o,this.disableNetworkFetches=u||l>0,this.queryDeduplication=h,this.defaultOptions=g||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),f&&typeof window=="object"&&(window.__APOLLO_CLIENT__=this),!Ad&&f&&__DEV__&&(Ad=!0,typeof window<"u"&&window.document&&window.top===window.self&&!window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__)){var P=window.navigator,F=P&&P.userAgent,$=void 0;typeof F=="string"&&(F.indexOf("Chrome/")>-1?$="https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm":F.indexOf("Firefox/")>-1&&($="https://addons.mozilla.org/en-US/firefox/addon/apollo-developer-tools/")),$&&__DEV__&&D.log("Download the Apollo DevTools for a better development experience: "+$)}this.version=hf,this.localState=new ns({cache:o,client:this,resolvers:_,fragmentMatcher:y}),this.queryManager=new Id({cache:this.cache,link:this.link,defaultOptions:this.defaultOptions,queryDeduplication:h,ssrMode:u,clientAwareness:{name:T,version:R},localState:this.localState,assumeImmutableResults:C,onBroadcast:f?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=pa(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=pa(this.defaultOptions.query,e)),__DEV__?D(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."):D(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=pa(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 di(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__&&D.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}();Up(hn?"log":"silent");function st(t){return t===null?"null":Array.isArray(t)?"array":typeof t}function gr(t){return st(t)==="object"}function Td(t){return Array.isArray(t)&&t.length>0&&t.every(e=>"message"in e)}function zu(t,e){return t.length<124?t:e}var Od="graphql-transport-ws";var mt;(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"})(mt||(mt={}));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 Dd(t){if(!gr(t))throw new Error(`Message is expected to be an object, but got ${st(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 ${st(t.type)}`);switch(t.type){case Ne.ConnectionInit:case Ne.ConnectionAck:case Ne.Ping:case Ne.Pong:{if(t.payload!=null&&!gr(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 ${st(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);if(!gr(t.payload))throw new Error(`"${t.type}" message expects the 'payload' property to be an object, but got ${st(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 ${st(t.payload.query)}`);if(t.payload.variables!=null&&!gr(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 ${st(t.payload.variables)}`);if(t.payload.operationName!=null&&st(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 ${st(t.payload.operationName)}`);if(t.payload.extensions!=null&&!gr(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 ${st(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 ${st(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);if(!gr(t.payload))throw new Error(`"${t.type}" message expects the 'payload' property to be an object, but got ${st(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 ${st(t.id)}`);if(!t.id)throw new Error(`"${t.type}" message requires a non-empty 'id' property`);if(!Td(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 ${st(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 Nd(t,e){return Dd(typeof t=="string"?JSON.parse(t,e):t)}function _i(t,e){return Dd(t),JSON.stringify(t,e)}function Pd(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(be){let _e=1e3;for(let ie=0;ie<be;ie++)_e*=2;await new Promise(ie=>setTimeout(ie,_e+Math.floor(Math.random()*(3e3-300)+300)))},shouldRetry:d=os,isFatalConnectionProblem:f,on:p,webSocketImpl:h,generateID:g=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,be=>{let _e=Math.random()*16|0;return(be=="x"?_e:_e&3|8).toString(16)})},jsonMessageReplacer:v,jsonMessageReviver:C}=t,_;if(h){if(!ny(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=_,y=(()=>{let V=(()=>{let _e={};return{on(ie,ae){return _e[ie]=ae,()=>{delete _e[ie]}},emit(ie){var ae;"id"in ie&&((ae=_e[ie.id])===null||ae===void 0||ae.call(_e,ie))}}})(),be={connecting:p?.connecting?[p.connecting]:[],opened:p?.opened?[p.opened]:[],connected:p?.connected?[p.connected]:[],ping:p?.ping?[p.ping]:[],pong:p?.pong?[p.pong]:[],message:p?.message?[V.emit,p.message]:[V.emit],closed:p?.closed?[p.closed]:[],error:p?.error?[p.error]:[]};return{onMessage:V.on,on(_e,ie){let ae=be[_e];return ae.push(ie),()=>{ae.splice(ae.indexOf(ie),1)}},emit(_e,...ie){for(let ae of[...be[_e]])ae(...ie)}}})();function T(V){let be=[y.on("error",_e=>{be.forEach(ie=>ie()),V(_e)}),y.on("closed",_e=>{be.forEach(ie=>ie()),V(_e)})]}let R,k=0,P,F=!1,$=0,q=!1;async function Ze(){clearTimeout(P);let[V,be]=await(R??(R=new Promise((ae,Wt)=>(async()=>{if(F){if(await l($),!k)return R=void 0,Wt({code:1e3,reason:"All Subscriptions Gone"});$++}y.emit("connecting");let J=new b(typeof e=="function"?await e():e,Od),Kt,Ir;function vo(){isFinite(o)&&o>0&&(clearTimeout(Ir),Ir=setTimeout(()=>{J.readyState===b.OPEN&&(J.send(_i({type:Ne.Ping})),y.emit("ping",!1,void 0))},o))}T(Je=>{R=void 0,clearTimeout(Kt),clearTimeout(Ir),Wt(Je),os(Je)&&Je.code===4499&&(J.close(4499,"Terminated"),J.onerror=null,J.onclose=null)}),J.onerror=Je=>y.emit("error",Je),J.onclose=Je=>y.emit("closed",Je),J.onopen=async()=>{try{y.emit("opened",J);let Je=typeof r=="function"?await r():r;if(J.readyState!==b.OPEN)return;J.send(_i(Je?{type:Ne.ConnectionInit,payload:Je}:{type:Ne.ConnectionInit},v)),isFinite(u)&&u>0&&(Kt=setTimeout(()=>{J.close(mt.ConnectionAcknowledgementTimeout,"Connection acknowledgement timeout")},u)),vo()}catch(Je){y.emit("error",Je),J.close(mt.InternalClientError,zu(Je instanceof Error?Je.message:new Error(Je).message,"Internal client error"))}};let ti=!1;J.onmessage=({data:Je})=>{try{let Ye=Nd(Je,C);if(y.emit("message",Ye),Ye.type==="ping"||Ye.type==="pong"){y.emit(Ye.type,!0,Ye.payload),Ye.type==="pong"?vo():s||(J.send(_i(Ye.payload?{type:Ne.Pong,payload:Ye.payload}:{type:Ne.Pong})),y.emit("pong",!1,Ye.payload));return}if(ti)return;if(Ye.type!==Ne.ConnectionAck)throw new Error(`First message cannot be of type ${Ye.type}`);clearTimeout(Kt),ti=!0,y.emit("connected",J,Ye.payload),F=!1,$=0,ae([J,new Promise((T3,Y1)=>T(Y1))])}catch(Ye){J.onmessage=null,y.emit("error",Ye),J.close(mt.BadResponse,zu(Ye instanceof Error?Ye.message:new Error(Ye).message,"Bad response"))}}})())));V.readyState===b.CLOSING&&await be;let _e=()=>{},ie=new Promise(ae=>_e=ae);return[V,_e,Promise.race([ie.then(()=>{if(!k){let ae=()=>V.close(1e3,"Normal Closure");isFinite(a)&&a>0?P=setTimeout(()=>{V.readyState===b.OPEN&&ae()},a):ae()}}),be])]}function Me(V){if(os(V)&&(ry(V.code)||[mt.InternalServerError,mt.InternalClientError,mt.BadRequest,mt.BadResponse,mt.Unauthorized,mt.SubprotocolNotAcceptable,mt.SubscriberAlreadyExists,mt.TooManyInitialisationRequests].includes(V.code)))throw V;if(q)return!1;if(os(V)&&V.code===1e3)return k>0;if(!c||$>=c||!d(V)||f?.(V))throw V;return F=!0}return n||(async()=>{for(k++;;)try{let[,,V]=await Ze();await V}catch(V){try{if(!Me(V))return}catch(be){return i?.(be)}}})(),{on:y.on,subscribe(V,be){let _e=g(V),ie=!1,ae=!1,Wt=()=>{k--,ie=!0};return(async()=>{for(k++;;)try{let[J,Kt,Ir]=await Ze();if(ie)return Kt();let vo=y.onMessage(_e,ti=>{switch(ti.type){case Ne.Next:{be.next(ti.payload);return}case Ne.Error:{ae=!0,ie=!0,be.error(ti.payload),Wt();return}case Ne.Complete:{ie=!0,Wt();return}}});J.send(_i({id:_e,type:Ne.Subscribe,payload:V},v)),Wt=()=>{!ie&&J.readyState===b.OPEN&&J.send(_i({id:_e,type:Ne.Complete},v)),k--,ie=!0,Kt()},await Ir.finally(vo);return}catch(J){if(!Me(J))return}})().then(()=>{ae||be.complete()}).catch(J=>{be.error(J)}),()=>{ie||Wt()}},async dispose(){if(q=!0,R){let[V]=await R;V.close(1e3,"Normal Closure")}},terminate(){R&&y.emit("closed",{code:4499,reason:"Terminated",wasClean:!1})}}}function os(t){return gr(t)&&"code"in t&&"reason"in t}function ry(t){return[1e3,1001,1006,1005,1012,1013,1013].includes(t)?!1:t>=1e3&&t<=1999}function ny(t){return typeof t=="function"&&"constructor"in t&&"CLOSED"in t&&"CLOSING"in t&&"CONNECTING"in t&&"OPEN"in t}function iy(t){return oe(t)&&"code"in t&&"reason"in t}var Rd=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 Y(function(i){return n.client.subscribe(w(w({},r),{query:ai(r.query)}),{next:i.next.bind(i),complete:i.complete.bind(i),error:function(a){return a instanceof Error?i.error(a):iy(a)?i.error(new Error("Socket closed with event ".concat(a.code," ").concat(a.reason||""))):i.error(new mr({graphQLErrors:Array.isArray(a)?a:[a]}))}})})},e}(Rt);var Fs=function(){return Fs=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},Fs.apply(this,arguments)};typeof SuppressedError=="function"&&SuppressedError;function _s(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_s=function(r){return typeof r}:_s=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},_s(t)}function ay(t){return _s(t)=="object"&&t!==null}var Zh=typeof Symbol=="function"&&Symbol.toStringTag!=null?Symbol.toStringTag:"@@toStringTag";function fl(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 oy(t){return Jh(t.source,fl(t.source,t.start))}function Jh(t,e){var r=t.locationOffset.column-1,n=ws(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 f=Math.floor(u/80),p=u%80,h=[],g=0;g<d.length;g+=80)h.push(d.slice(g,g+80));return c+$d([["".concat(o),h[0]]].concat(h.slice(1,f+1).map(function(v){return["",v]}),[[" ",ws(p-1)+"^"],["",h[f+1]]]))}return c+$d([["".concat(o-1),l[i-1]],["".concat(o),d],["",ws(u-1)+"^"],["".concat(o+1),l[i+1]]])}function $d(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 sy(r,i)+(a?" | "+a:" |")}).join(`
|
|
55
|
+
`)}function ws(t){return Array(t+1).join(" ")}function sy(t,e){return ws(t-e.length)+e}function Ss(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ss=function(r){return typeof r}:Ss=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Ss(t)}function Ld(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 cy(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Ld(Object(r),!0).forEach(function(n){uy(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ld(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function uy(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ly(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Fd(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 py(t,e,r){return e&&Fd(t.prototype,e),r&&Fd(t,r),t}function fy(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Wa(t,e)}function dy(t){var e=Xh();return function(){var n=Ka(t),i;if(e){var a=Ka(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return Yh(this,i)}}function Yh(t,e){return e&&(Ss(e)==="object"||typeof e=="function")?e:Ca(t)}function Ca(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function dl(t){var e=typeof Map=="function"?new Map:void 0;return dl=function(n){if(n===null||!hy(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 Cs(n,arguments,Ka(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),Wa(i,n)},dl(t)}function Cs(t,e,r){return Xh()?Cs=Reflect.construct:Cs=function(i,a,o){var s=[null];s.push.apply(s,a);var u=Function.bind.apply(i,s),c=new u;return o&&Wa(c,o.prototype),c},Cs.apply(null,arguments)}function Xh(){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 hy(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function Wa(t,e){return Wa=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},Wa(t,e)}function Ka(t){return Ka=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},Ka(t)}var my=function(t){fy(r,t);var e=dy(r);function r(n,i,a,o,s,u,c){var l,d,f,p;ly(this,r),p=e.call(this,n),p.name="GraphQLError",p.originalError=u??void 0,p.nodes=Md(Array.isArray(i)?i:i?[i]:void 0);for(var h=[],g=0,v=(C=p.nodes)!==null&&C!==void 0?C:[];g<v.length;g++){var C,_=v[g],b=_.loc;b!=null&&h.push(b)}h=Md(h),p.source=a??((l=h)===null||l===void 0?void 0:l[0].source),p.positions=o??((d=h)===null||d===void 0?void 0:d.map(function(T){return T.start})),p.locations=o&&a?o.map(function(T){return fl(a,T)}):(f=h)===null||f===void 0?void 0:f.map(function(T){return fl(T.source,T.start)}),p.path=s??void 0;var y=u?.extensions;return c==null&&ay(y)?p.extensions=cy({},y):p.extensions=c??{},Object.defineProperties(Ca(p),{message:{enumerable:!0},locations:{enumerable:p.locations!=null},path:{enumerable:p.path!=null},extensions:{enumerable:p.extensions!=null&&Object.keys(p.extensions).length>0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),u!=null&&u.stack?(Object.defineProperty(Ca(p),"stack",{value:u.stack,writable:!0,configurable:!0}),Yh(p)):(Error.captureStackTrace?Error.captureStackTrace(Ca(p),r):Object.defineProperty(Ca(p),"stack",{value:Error().stack,writable:!0,configurable:!0}),p)}return py(r,[{key:"toString",value:function(){return gy(this)}},{key:Zh,get:function(){return"Object"}}]),r}(dl(Error));function Md(t){return t===void 0||t.length===0?void 0:t}function gy(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
|
+
`+oy(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=Kg(a.charCodeAt(o+1),a.charCodeAt(o+2),a.charCodeAt(o+3),a.charCodeAt(o+4));if(l<0){var d=a.slice(o+1,o+5);throw 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 Wg(t,e,r,n,i,a){for(var o=t.body,s=e+3,u=s,c=0,l="";s<o.length&&!isNaN(c=o.charCodeAt(s));){if(c===34&&o.charCodeAt(s+1)===34&&o.charCodeAt(s+2)===34)return l+=o.slice(u,s),new Ie(k.BLOCK_STRING,e,s+3,r,n,i,jg(l));if(c<32&&c!==9&&c!==10&&c!==13)throw gt(t,s,"Invalid character within String: ".concat(bn(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 Kg(t,e,r,n){return Do(t)<<12|Do(e)<<8|Do(r)<<4|Do(n)}function Do(t){return t>=48&&t<=57?t-48:t>=65&&t<=70?t-55:t>=97&&t<=102?t-87:-1}function Zg(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 Yg(t){return t===95||t>=65&&t<=90||t>=97&&t<=122}function Jg(t,e){var r=new Xg(t,e);return r.parseDocument()}var Xg=function(){function t(r,n){var i=Fg(r)?r:new dh(r);this._lexer=new qg(i),this._options=n}var e=t.prototype;return e.parseName=function(){var n=this.expectToken(k.NAME);return{kind:j.NAME,value:n.value,loc:this.loc(n)}},e.parseDocument=function(){var n=this._lexer.token;return{kind:j.DOCUMENT,definitions:this.many(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:j.OPERATION_DEFINITION,operation:"query",name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet(),loc:this.loc(n)};var i=this.parseOperationType(),a;return this.peek(k.NAME)&&(a=this.parseName()),{kind:j.OPERATION_DEFINITION,operation:i,name:a,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(n)}},e.parseOperationType=function(){var n=this.expectToken(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:j.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:j.VARIABLE,name:this.parseName(),loc:this.loc(n)}},e.parseSelectionSet=function(){var n=this._lexer.token;return{kind:j.SELECTION_SET,selections:this.many(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:j.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:j.ARGUMENT,name:i,value:this.parseValueLiteral(!1),loc:this.loc(n)}},e.parseConstArgument=function(){var n=this._lexer.token;return{kind:j.ARGUMENT,name:this.parseName(),value:(this.expectToken(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:j.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1),loc:this.loc(n)}:{kind:j.INLINE_FRAGMENT,typeCondition:i?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(n)}},e.parseFragmentDefinition=function(){var n,i=this._lexer.token;return this.expectKeyword("fragment"),((n=this._options)===null||n===void 0?void 0:n.experimentalFragmentVariables)===!0?{kind:j.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(i)}:{kind:j.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(i)}},e.parseFragmentName=function(){if(this._lexer.token.value==="on")throw this.unexpected();return this.parseName()},e.parseValueLiteral=function(n){var i=this._lexer.token;switch(i.kind){case k.BRACKET_L:return this.parseList(n);case k.BRACE_L:return this.parseObject(n);case k.INT:return this._lexer.advance(),{kind:j.INT,value:i.value,loc:this.loc(i)};case k.FLOAT:return this._lexer.advance(),{kind:j.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:j.BOOLEAN,value:!0,loc:this.loc(i)};case"false":return{kind:j.BOOLEAN,value:!1,loc:this.loc(i)};case"null":return{kind:j.NULL,loc:this.loc(i)};default:return{kind:j.ENUM,value:i.value,loc:this.loc(i)}}case k.DOLLAR:if(!n)return this.parseVariable();break}throw this.unexpected()},e.parseStringLiteral=function(){var n=this._lexer.token;return this._lexer.advance(),{kind:j.STRING,value:n.value,block:n.kind===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:j.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:j.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:j.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:j.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(n),loc:this.loc(i)}},e.parseTypeReference=function(){var n=this._lexer.token,i;return this.expectOptionalToken(k.BRACKET_L)?(i=this.parseTypeReference(),this.expectToken(k.BRACKET_R),i={kind:j.LIST_TYPE,type:i,loc:this.loc(n)}):i=this.parseNamedType(),this.expectOptionalToken(k.BANG)?{kind:j.NON_NULL_TYPE,type:i,loc:this.loc(n)}:i},e.parseNamedType=function(){var n=this._lexer.token;return{kind:j.NAMED_TYPE,name:this.parseName(),loc:this.loc(n)}},e.parseTypeSystemDefinition=function(){var n=this.peekDescription()?this._lexer.lookahead():this._lexer.token;if(n.kind===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:j.SCHEMA_DEFINITION,description:i,directives:a,operationTypes:o,loc:this.loc(n)}},e.parseOperationTypeDefinition=function(){var n=this._lexer.token,i=this.parseOperationType();this.expectToken(k.COLON);var a=this.parseNamedType();return{kind:j.OPERATION_TYPE_DEFINITION,operation:i,type:a,loc:this.loc(n)}},e.parseScalarTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("scalar");var a=this.parseName(),o=this.parseDirectives(!0);return{kind:j.SCALAR_TYPE_DEFINITION,description:i,name:a,directives:o,loc:this.loc(n)}},e.parseObjectTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("type");var a=this.parseName(),o=this.parseImplementsInterfaces(),s=this.parseDirectives(!0),u=this.parseFieldsDefinition();return{kind:j.OBJECT_TYPE_DEFINITION,description:i,name:a,interfaces:o,directives:s,fields:u,loc:this.loc(n)}},e.parseImplementsInterfaces=function(){var n;if(!this.expectOptionalKeyword("implements"))return[];if(((n=this._options)===null||n===void 0?void 0:n.allowLegacySDLImplementsInterfaces)===!0){var i=[];this.expectOptionalToken(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:j.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:j.INPUT_VALUE_DEFINITION,description:i,name:a,type:o,defaultValue:s,directives:u,loc:this.loc(n)}},e.parseInterfaceTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("interface");var a=this.parseName(),o=this.parseImplementsInterfaces(),s=this.parseDirectives(!0),u=this.parseFieldsDefinition();return{kind:j.INTERFACE_TYPE_DEFINITION,description:i,name:a,interfaces:o,directives:s,fields:u,loc:this.loc(n)}},e.parseUnionTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("union");var a=this.parseName(),o=this.parseDirectives(!0),s=this.parseUnionMemberTypes();return{kind:j.UNION_TYPE_DEFINITION,description:i,name:a,directives:o,types:s,loc:this.loc(n)}},e.parseUnionMemberTypes=function(){return this.expectOptionalToken(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:j.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:j.ENUM_VALUE_DEFINITION,description:i,name:a,directives:o,loc:this.loc(n)}},e.parseInputObjectTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("input");var a=this.parseName(),o=this.parseDirectives(!0),s=this.parseInputFieldsDefinition();return{kind:j.INPUT_OBJECT_TYPE_DEFINITION,description:i,name:a,directives:o,fields:s,loc:this.loc(n)}},e.parseInputFieldsDefinition=function(){return this.optionalMany(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:j.SCHEMA_EXTENSION,directives:i,operationTypes:a,loc:this.loc(n)}},e.parseScalarTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");var i=this.parseName(),a=this.parseDirectives(!0);if(a.length===0)throw this.unexpected();return{kind:j.SCALAR_TYPE_EXTENSION,name:i,directives:a,loc:this.loc(n)}},e.parseObjectTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");var i=this.parseName(),a=this.parseImplementsInterfaces(),o=this.parseDirectives(!0),s=this.parseFieldsDefinition();if(a.length===0&&o.length===0&&s.length===0)throw this.unexpected();return{kind:j.OBJECT_TYPE_EXTENSION,name:i,interfaces:a,directives:o,fields:s,loc:this.loc(n)}},e.parseInterfaceTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");var i=this.parseName(),a=this.parseImplementsInterfaces(),o=this.parseDirectives(!0),s=this.parseFieldsDefinition();if(a.length===0&&o.length===0&&s.length===0)throw this.unexpected();return{kind:j.INTERFACE_TYPE_EXTENSION,name:i,interfaces:a,directives:o,fields:s,loc:this.loc(n)}},e.parseUnionTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");var i=this.parseName(),a=this.parseDirectives(!0),o=this.parseUnionMemberTypes();if(a.length===0&&o.length===0)throw this.unexpected();return{kind:j.UNION_TYPE_EXTENSION,name:i,directives:a,types:o,loc:this.loc(n)}},e.parseEnumTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");var i=this.parseName(),a=this.parseDirectives(!0),o=this.parseEnumValuesDefinition();if(a.length===0&&o.length===0)throw this.unexpected();return{kind:j.ENUM_TYPE_EXTENSION,name:i,directives:a,values:o,loc:this.loc(n)}},e.parseInputObjectTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");var i=this.parseName(),a=this.parseDirectives(!0),o=this.parseInputFieldsDefinition();if(a.length===0&&o.length===0)throw this.unexpected();return{kind:j.INPUT_OBJECT_TYPE_EXTENSION,name:i,directives:a,fields:o,loc:this.loc(n)}},e.parseDirectiveDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("directive"),this.expectToken(k.AT);var a=this.parseName(),o=this.parseArgumentDefs(),s=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");var u=this.parseDirectiveLocations();return{kind:j.DIRECTIVE_DEFINITION,description:i,name:a,arguments:o,repeatable:s,locations:u,loc:this.loc(n)}},e.parseDirectiveLocations=function(){return this.delimitedMany(k.PIPE,this.parseDirectiveLocation)},e.parseDirectiveLocation=function(){var n=this._lexer.token,i=this.parseName();if(Mg[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 fh(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(hh(n),", found ").concat(pu(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(pu(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(pu(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 pu(t){var e=t.value;return hh(t.kind)+(e!=null?' "'.concat(e,'"'):"")}function hh(t){return Bg(t)?'"'.concat(t,'"'):t}var Wo=new Map,Ru=new Map,mh=!0,as=!1;function gh(t){return t.replace(/[\s,]+/g," ").trim()}function ey(t){return gh(t.source.body.substring(t.start,t.end))}function ty(t){var e=new Set,r=[];return t.definitions.forEach(function(n){if(n.kind==="FragmentDefinition"){var i=n.name.value,a=ey(n.loc),o=Ru.get(i);o&&!o.has(a)?mh&&console.warn("Warning: fragment with name "+i+` already exists.
|
|
59
|
+
`+Jh(t.source,s)}return e}function kt(t,e,r){return new my("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 yy(t,e){var r=Boolean(t);if(!r)throw new Error(e??"Unexpected invariant triggered.")}var vy=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):void 0,hl=vy;function e1(t){var e=t.prototype.toJSON;typeof e=="function"||yy(0),t.prototype.inspect=e,hl&&(t.prototype[hl]=e)}var t1=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}();e1(t1);var Re=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}();e1(Re);var A=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 xs(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?xs=function(r){return typeof r}:xs=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},xs(t)}var by=10,r1=2;function _y(t){return sc(t,[])}function sc(t,e){switch(xs(t)){case"string":return JSON.stringify(t);case"function":return t.name?"[function ".concat(t.name,"]"):"[function]";case"object":return t===null?"null":wy(t,e);default:return String(t)}}function wy(t,e){if(e.indexOf(t)!==-1)return"[Circular]";var r=[].concat(e,[t]),n=xy(t);if(n!==void 0){var i=n.call(t);if(i!==t)return typeof i=="string"?i:sc(i,r)}else if(Array.isArray(t))return Cy(t,r);return Sy(t,r)}function Sy(t,e){var r=Object.keys(t);if(r.length===0)return"{}";if(e.length>r1)return"["+Ey(t)+"]";var n=r.map(function(i){var a=sc(t[i],e);return i+": "+a});return"{ "+n.join(", ")+" }"}function Cy(t,e){if(t.length===0)return"[]";if(e.length>r1)return"[Array]";for(var r=Math.min(by,t.length),n=t.length-r,i=[],a=0;a<r;++a)i.push(sc(t[a],e));return n===1?i.push("... 1 more item"):n>1&&i.push("... ".concat(n," more items")),"["+i.join(", ")+"]"}function xy(t){var e=t[String(hl)];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 Gu(t,e){var r=Boolean(t);if(!r)throw new Error(e)}var ky=function(e,r){return e instanceof r};function Ud(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 Iy(t,e,r){return e&&Ud(t.prototype,e),r&&Ud(t,r),t}var n1=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"||Gu(0,"Body must be a string. Received: ".concat(_y(e),".")),this.body=e,this.name=r,this.locationOffset=n,this.locationOffset.line>0||Gu(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||Gu(0,"column in locationOffset is 1-indexed and must be positive.")}return Iy(t,[{key:Zh,get:function(){return"Source"}}]),t}();function Ay(t){return ky(t,n1)}var Ty=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 Oy(t){var e=t.split(/\r\n|[\n\r]/g),r=Dy(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&&jd(e[i]);)++i;for(var a=e.length;a>i&&jd(e[a-1]);)--a;return e.slice(i,a).join(`
|
|
60
|
+
`)}function jd(t){for(var e=0;e<t.length;++e)if(t[e]!==" "&&t[e]!==" ")return!1;return!0}function Dy(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 Ny=function(){function t(r){var n=new Re(A.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!==A.EOF)do{var i;n=(i=n.next)!==null&&i!==void 0?i:n.next=Ry(this,n)}while(n.kind===A.COMMENT);return n},t}();function Py(t){return t===A.BANG||t===A.DOLLAR||t===A.AMP||t===A.PAREN_L||t===A.PAREN_R||t===A.SPREAD||t===A.COLON||t===A.EQUALS||t===A.AT||t===A.BRACKET_L||t===A.BRACKET_R||t===A.BRACE_L||t===A.PIPE||t===A.BRACE_R}function Mn(t){return isNaN(t)?A.EOF:t<127?JSON.stringify(String.fromCharCode(t)):'"\\u'.concat(("00"+t.toString(16).toUpperCase()).slice(-4),'"')}function Ry(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 Re(A.BANG,a,a+1,s,u,e);case 35:return Ly(r,a,s,u,e);case 36:return new Re(A.DOLLAR,a,a+1,s,u,e);case 38:return new Re(A.AMP,a,a+1,s,u,e);case 40:return new Re(A.PAREN_L,a,a+1,s,u,e);case 41:return new Re(A.PAREN_R,a,a+1,s,u,e);case 46:if(n.charCodeAt(a+1)===46&&n.charCodeAt(a+2)===46)return new Re(A.SPREAD,a,a+3,s,u,e);break;case 58:return new Re(A.COLON,a,a+1,s,u,e);case 61:return new Re(A.EQUALS,a,a+1,s,u,e);case 64:return new Re(A.AT,a,a+1,s,u,e);case 91:return new Re(A.BRACKET_L,a,a+1,s,u,e);case 93:return new Re(A.BRACKET_R,a,a+1,s,u,e);case 123:return new Re(A.BRACE_L,a,a+1,s,u,e);case 124:return new Re(A.PIPE,a,a+1,s,u,e);case 125:return new Re(A.BRACE_R,a,a+1,s,u,e);case 34:return n.charCodeAt(a+1)===34&&n.charCodeAt(a+2)===34?Uy(r,a,s,u,e,t):My(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 Fy(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 By(r,a,s,u,e)}throw kt(r,a,$y(o))}var c=t.line,l=1+a-t.lineStart;return new Re(A.EOF,i,i,c,l,e)}function $y(t){return t<32&&t!==9&&t!==10&&t!==13?"Cannot contain the invalid character ".concat(Mn(t),"."):t===39?`Unexpected single quote character ('), did you mean to use a double quote (")?`:"Cannot parse the unexpected character ".concat(Mn(t),".")}function Ly(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 Re(A.COMMENT,e,s,r,n,i,a.slice(e+1,s))}function Fy(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 kt(t,u,"Invalid number, unexpected digit after 0: ".concat(Mn(s),"."))}else u=Hu(t,u,s),s=o.charCodeAt(u);if(s===46&&(c=!0,s=o.charCodeAt(++u),u=Hu(t,u,s),s=o.charCodeAt(u)),(s===69||s===101)&&(c=!0,s=o.charCodeAt(++u),(s===43||s===45)&&(s=o.charCodeAt(++u)),u=Hu(t,u,s),s=o.charCodeAt(u)),s===46||qy(s))throw kt(t,u,"Invalid number, expected digit but got: ".concat(Mn(s),"."));return new Re(c?A.FLOAT:A.INT,e,u,n,i,a,o.slice(e,u))}function Hu(t,e,r){var n=t.body,i=e,a=r;if(a>=48&&a<=57){do a=n.charCodeAt(++i);while(a>=48&&a<=57);return i}throw kt(t,i,"Invalid number, expected digit but got: ".concat(Mn(a),"."))}function My(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 Re(A.STRING,e,o+1,r,n,i,c);if(u<32&&u!==9)throw kt(t,o,"Invalid character within String: ".concat(Mn(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=jy(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 kt(t,o,"Invalid character escape sequence: \\u".concat(d,"."))}c+=String.fromCharCode(l),o+=4;break}default:throw kt(t,o,"Invalid character escape sequence: \\".concat(String.fromCharCode(u),"."))}++o,s=o}}throw kt(t,o,"Unterminated string.")}function Uy(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 Re(A.BLOCK_STRING,e,s+3,r,n,i,Oy(l));if(c<32&&c!==9&&c!==10&&c!==13)throw kt(t,s,"Invalid character within String: ".concat(Mn(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 kt(t,s,"Unterminated string.")}function jy(t,e,r,n){return ss(t)<<12|ss(e)<<8|ss(r)<<4|ss(n)}function ss(t){return t>=48&&t<=57?t-48:t>=65&&t<=70?t-55:t>=97&&t<=102?t-87:-1}function By(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 Re(A.NAME,e,s,r,n,i,a.slice(e,s))}function qy(t){return t===95||t>=65&&t<=90||t>=97&&t<=122}function Vy(t,e){var r=new Qy(t,e);return r.parseDocument()}var Qy=function(){function t(r,n){var i=Ay(r)?r:new n1(r);this._lexer=new Ny(i),this._options=n}var e=t.prototype;return e.parseName=function(){var n=this.expectToken(A.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(A.SOF,this.parseDefinition,A.EOF),loc:this.loc(n)}},e.parseDefinition=function(){if(this.peek(A.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(A.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(A.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(A.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(A.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(A.PAREN_L,this.parseVariableDefinition,A.PAREN_R)},e.parseVariableDefinition=function(){var n=this._lexer.token;return{kind:B.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(A.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(A.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(A.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(A.BRACE_L,this.parseSelection,A.BRACE_R),loc:this.loc(n)}},e.parseSelection=function(){return this.peek(A.SPREAD)?this.parseFragment():this.parseField()},e.parseField=function(){var n=this._lexer.token,i=this.parseName(),a,o;return this.expectOptionalToken(A.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(A.BRACE_L)?this.parseSelectionSet():void 0,loc:this.loc(n)}},e.parseArguments=function(n){var i=n?this.parseConstArgument:this.parseArgument;return this.optionalMany(A.PAREN_L,i,A.PAREN_R)},e.parseArgument=function(){var n=this._lexer.token,i=this.parseName();return this.expectToken(A.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(A.COLON),this.parseValueLiteral(!0)),loc:this.loc(n)}},e.parseFragment=function(){var n=this._lexer.token;this.expectToken(A.SPREAD);var i=this.expectOptionalKeyword("on");return!i&&this.peek(A.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 A.BRACKET_L:return this.parseList(n);case A.BRACE_L:return this.parseObject(n);case A.INT:return this._lexer.advance(),{kind:B.INT,value:i.value,loc:this.loc(i)};case A.FLOAT:return this._lexer.advance(),{kind:B.FLOAT,value:i.value,loc:this.loc(i)};case A.STRING:case A.BLOCK_STRING:return this.parseStringLiteral();case A.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 A.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===A.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(A.BRACKET_L,o,A.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(A.BRACE_L,o,A.BRACE_R),loc:this.loc(a)}},e.parseObjectField=function(n){var i=this._lexer.token,a=this.parseName();return this.expectToken(A.COLON),{kind:B.OBJECT_FIELD,name:a,value:this.parseValueLiteral(n),loc:this.loc(i)}},e.parseDirectives=function(n){for(var i=[];this.peek(A.AT);)i.push(this.parseDirective(n));return i},e.parseDirective=function(n){var i=this._lexer.token;return this.expectToken(A.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(A.BRACKET_L)?(i=this.parseTypeReference(),this.expectToken(A.BRACKET_R),i={kind:B.LIST_TYPE,type:i,loc:this.loc(n)}):i=this.parseNamedType(),this.expectOptionalToken(A.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===A.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(A.STRING)||this.peek(A.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(A.BRACE_L,this.parseOperationTypeDefinition,A.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(A.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(A.AMP);do i.push(this.parseNamedType());while(this.expectOptionalToken(A.AMP)||this.peek(A.NAME));return i}return this.delimitedMany(A.AMP,this.parseNamedType)},e.parseFieldsDefinition=function(){var n;return((n=this._options)===null||n===void 0?void 0:n.allowLegacySDLEmptyFields)===!0&&this.peek(A.BRACE_L)&&this._lexer.lookahead().kind===A.BRACE_R?(this._lexer.advance(),this._lexer.advance(),[]):this.optionalMany(A.BRACE_L,this.parseFieldDefinition,A.BRACE_R)},e.parseFieldDefinition=function(){var n=this._lexer.token,i=this.parseDescription(),a=this.parseName(),o=this.parseArgumentDefs();this.expectToken(A.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(A.PAREN_L,this.parseInputValueDef,A.PAREN_R)},e.parseInputValueDef=function(){var n=this._lexer.token,i=this.parseDescription(),a=this.parseName();this.expectToken(A.COLON);var o=this.parseTypeReference(),s;this.expectOptionalToken(A.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(A.EQUALS)?this.delimitedMany(A.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(A.BRACE_L,this.parseEnumValueDefinition,A.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(A.BRACE_L,this.parseInputValueDef,A.BRACE_R)},e.parseTypeSystemExtension=function(){var n=this._lexer.lookahead();if(n.kind===A.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(A.BRACE_L,this.parseOperationTypeDefinition,A.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(A.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(A.PIPE,this.parseDirectiveLocation)},e.parseDirectiveLocation=function(){var n=this._lexer.token,i=this.parseName();if(Ty[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 t1(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 kt(this._lexer.source,i.start,"Expected ".concat(i1(n),", found ").concat(Wu(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===A.NAME&&i.value===n)this._lexer.advance();else throw kt(this._lexer.source,i.start,'Expected "'.concat(n,'", found ').concat(Wu(i),"."))},e.expectOptionalKeyword=function(n){var i=this._lexer.token;return i.kind===A.NAME&&i.value===n?(this._lexer.advance(),!0):!1},e.unexpected=function(n){var i=n??this._lexer.token;return kt(this._lexer.source,i.start,"Unexpected ".concat(Wu(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 Wu(t){var e=t.value;return i1(t.kind)+(e!=null?' "'.concat(e,'"'):"")}function i1(t){return Py(t)?'"'.concat(t,'"'):t}var Es=new Map,ml=new Map,a1=!0,Ms=!1;function o1(t){return t.replace(/[\s,]+/g," ").trim()}function zy(t){return o1(t.source.body.substring(t.start,t.end))}function Gy(t){var e=new Set,r=[];return t.definitions.forEach(function(n){if(n.kind==="FragmentDefinition"){var i=n.name.value,a=zy(n.loc),o=ml.get(i);o&&!o.has(a)?a1&&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||Ru.set(i,o=new Set),o.add(a),e.has(a)||(e.add(a),r.push(n))}else r.push(n)}),is(is({},t),{definitions:r})}function ry(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 ny(t){var e=gh(t);if(!Wo.has(e)){var r=Jg(t,{experimentalFragmentVariables:as,allowLegacyFragmentVariables:as});if(!r||r.kind!=="Document")throw new Error("Not a valid GraphQL document.");Wo.set(e,ry(ty(r)))}return Wo.get(e)}function E(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]}),ny(n)}function iy(){Wo.clear(),Ru.clear()}function ay(){mh=!1}function oy(){as=!0}function sy(){as=!1}var Zi={gql:E,resetCaches:iy,disableFragmentWarnings:ay,enableExperimentalFragmentVariables:oy,disableExperimentalFragmentVariables:sy};(function(t){t.gql=Zi.gql,t.resetCaches=Zi.resetCaches,t.disableFragmentWarnings=Zi.disableFragmentWarnings,t.enableExperimentalFragmentVariables=Zi.enableExperimentalFragmentVariables,t.disableExperimentalFragmentVariables=Zi.disableExperimentalFragmentVariables})(E||(E={}));E.default=E;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 cy(){}function rl(){return cy}var w=rl,He=rl,Z=rl,yh=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},vh=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},_n=class{constructor(e){this.code=e}};yh([w(),vh("design:type",String)],_n.prototype,"code",void 0);_n=yh([Z(),vh("design:paramtypes",[String])],_n);var nl=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},il=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}};nl([w(),il("design:type",String)],Ht.prototype,"address",void 0);nl([w(),il("design:type",String)],Ht.prototype,"name",void 0);Ht=nl([Z(),il("design:paramtypes",[String,String])],Ht);var 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},Le=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Pr=class{constructor(e,r){this.key=r,this.signature=e}};we([w(),Le("design:type",String)],Pr.prototype,"signature",void 0);we([w(),Le("design:type",String)],Pr.prototype,"key",void 0);we([w(),Le("design:type",Boolean)],Pr.prototype,"valid",void 0);we([w(),Le("design:type",Boolean)],Pr.prototype,"invalid",void 0);Pr=we([Z(),He(),Le("design:paramtypes",[String,String])],Pr);var wn=class{};we([w(),Le("design:type",String)],wn.prototype,"signature",void 0);we([w(),Le("design:type",String)],wn.prototype,"key",void 0);we([w(),Le("design:type",Boolean)],wn.prototype,"valid",void 0);we([w(),Le("design:type",Boolean)],wn.prototype,"invalid",void 0);wn=we([He()],wn);function qr(t){let e=class{constructor(n,i,a,o){this.author=n,this.timestamp=i,this.data=a,this.proof=o}};return we([w(),Le("design:type",String)],e.prototype,"author",void 0),we([w(),Le("design:type",String)],e.prototype,"timestamp",void 0),we([w(),Le("design:type",Object)],e.prototype,"data",void 0),we([w(),Le("design:type",Pr)],e.prototype,"proof",void 0),e=we([Z(),Le("design:paramtypes",[String,String,Object,Pr])],e),e}function uy(t){let e=class{};return we([w(),Le("design:type",String)],e.prototype,"author",void 0),we([w(),Le("design:type",String)],e.prototype,"timestamp",void 0),we([w(),Le("design:type",Object)],e.prototype,"data",void 0),we([w(),Le("design:type",wn)],e.prototype,"proof",void 0),e=we([He()],e),e}var nd=class extends qr(){};nd=we([Z()],nd);var os=class extends qr(){};we([w(),Le("design:type",Ht)],os.prototype,"language",void 0);we([w(),Le("design:type",_n)],os.prototype,"icon",void 0);os=we([Z()],os);function f9(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)},Sn=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)],Sn.prototype,"source",void 0);De([w(),We("design:type",String)],Sn.prototype,"target",void 0);De([w(),We("design:type",String)],Sn.prototype,"predicate",void 0);Sn=De([Z(),We("design:paramtypes",[Object])],Sn);var ss=class{};De([w(),We("design:type",Array)],ss.prototype,"additions",void 0);De([w(),We("design:type",Array)],ss.prototype,"removals",void 0);ss=De([He()],ss);var cs=class{constructor(e,r){this.additions=e,this.removals=r}};De([w(),We("design:type",Array)],cs.prototype,"additions",void 0);De([w(),We("design:type",Array)],cs.prototype,"removals",void 0);cs=De([Z(),We("design:paramtypes",[Array,Array])],cs);var wa=class{};De([w(),We("design:type",String)],wa.prototype,"source",void 0);De([w(),We("design:type",String)],wa.prototype,"target",void 0);De([w(),We("design:type",String)],wa.prototype,"predicate",void 0);wa=De([He()],wa);var En=class extends qr(){hash(){let e=JSON.stringify(this.data,Object.keys(this.data).sort())+JSON.stringify(this.author)+this.timestamp,r=0,n,i;for(n=0;n<e.length;n++)i=e.charCodeAt(n),r=(r<<5)-r+i,r|=0;return r}};De([w(),We("design:type",String)],En.prototype,"status",void 0);En=De([Z()],En);var Pu=class extends uy(){};De([w(),We("design:type",String)],Pu.prototype,"status",void 0);Pu=De([He()],Pu);function v9(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 b9(t){return t&&t.source&&t.target}var us=class{constructor(e,r){this.oldLink=e,this.newLink=r}};De([w(),We("design:type",En)],us.prototype,"oldLink",void 0);De([w(),We("design:type",En)],us.prototype,"newLink",void 0);us=De([Z(),We("design:paramtypes",[En,En])],us);var In=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},Ra=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Lu,Lr=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}};In([w(),Ra("design:type",Array)],Lr.prototype,"links",void 0);Lr=In([Z(),Ra("design:paramtypes",[Array])],Lr);var $u=class{};In([w(),Ra("design:type",Array)],$u.prototype,"links",void 0);$u=In([He()],$u);var Fu=Lu=class{constructor(e){e?this.links=e:this.links=[]}static fromLink(e){let r=new Lu;return r.links.push(e),r}};In([w(),Ra("design:type",Array)],Fu.prototype,"links",void 0);Fu=Lu=In([He(),Ra("design:paramtypes",[Array])],Fu);var Mu=class extends qr(){};Mu=In([Z()],Mu);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)},Ir=class{constructor(e,r){this.did=e,r?this.perspective=r:this.perspective=new Lr}};F([w(),M("design:type",String)],Ir.prototype,"did",void 0);F([w(),M("design:type",Lr)],Ir.prototype,"perspective",void 0);F([w(),M("design:type",String)],Ir.prototype,"directMessageLanguage",void 0);Ir=F([Z(),M("design:paramtypes",[String,Lr])],Ir);var id=class extends qr(){};id=F([Z()],id);var $r=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)],$r.prototype,"did",void 0);F([w(),M("design:type",String)],$r.prototype,"didSigningKeyId",void 0);F([w(),M("design:type",String)],$r.prototype,"deviceKeyType",void 0);F([w(),M("design:type",String)],$r.prototype,"deviceKey",void 0);F([w(),M("design:type",String)],$r.prototype,"deviceKeySignedByDid",void 0);F([w(),M("design:type",String)],$r.prototype,"didSignedByDeviceKey",void 0);$r=F([Z(),M("design:paramtypes",[String,String,String,String,String,String])],$r);var Fr=class{constructor(e,r,n,i,a,o){this.did=e,this.didSigningKeyId=r,this.deviceKeyType=n,this.deviceKey=i,this.deviceKeySignedByDid=a,this.didSignedByDeviceKey=o}};F([w(),M("design:type",String)],Fr.prototype,"did",void 0);F([w(),M("design:type",String)],Fr.prototype,"didSigningKeyId",void 0);F([w(),M("design:type",String)],Fr.prototype,"deviceKeyType",void 0);F([w(),M("design:type",String)],Fr.prototype,"deviceKey",void 0);F([w(),M("design:type",String)],Fr.prototype,"deviceKeySignedByDid",void 0);F([w(),M("design:type",String)],Fr.prototype,"didSignedByDeviceKey",void 0);Fr=F([He(),M("design:paramtypes",[String,String,String,String,String,String])],Fr);var ls=class{constructor(e,r){this.signature=e,this.publicKey=r}};F([w(),M("design:type",String)],ls.prototype,"signature",void 0);F([w(),M("design:type",String)],ls.prototype,"publicKey",void 0);ls=F([Z(),M("design:paramtypes",[String,String])],ls);var fi=class{constructor(e,r){this.domain=e,this.pointers=r}};F([w(),M("design:type",String)],fi.prototype,"domain",void 0);F([w(),M("design:type",Array)],fi.prototype,"pointers",void 0);fi=F([Z(),M("design:paramtypes",[String,Array])],fi);var fs=class{constructor(e,r){this.with=e,this.can=r}};F([w(),M("design:type",fi)],fs.prototype,"with",void 0);F([w(),M("design:type",Array)],fs.prototype,"can",void 0);fs=F([Z(),M("design:paramtypes",[fi,Array])],fs);var lr=class{constructor(e,r,n,i,a){this.appName=e,this.appDesc=r,this.appIconPath=a,this.appUrl=n,this.capabilities=i}};F([w(),M("design:type",String)],lr.prototype,"appName",void 0);F([w(),M("design:type",String)],lr.prototype,"appDesc",void 0);F([w(),M("design:type",String)],lr.prototype,"appUrl",void 0);F([w(),M("design:type",String)],lr.prototype,"appIconPath",void 0);F([w(),M("design:type",Array)],lr.prototype,"capabilities",void 0);lr=F([Z(),M("design:paramtypes",[String,String,String,Array,String])],lr);var pi=class{constructor(e,r,n,i){this.requestId=e,this.auth=r,this.token=n,this.revoked=i}};F([w(),M("design:type",String)],pi.prototype,"requestId",void 0);F([w(),M("design:type",String)],pi.prototype,"token",void 0);F([w(),M("design:type",Boolean)],pi.prototype,"revoked",void 0);F([w(),M("design:type",lr)],pi.prototype,"auth",void 0);pi=F([Z(),M("design:paramtypes",[String,lr,String,Boolean])],pi);var di=class{constructor(e,r){this.domain=e,this.pointers=r}};F([w(),M("design:type",String)],di.prototype,"domain",void 0);F([w(),M("design:type",Array)],di.prototype,"pointers",void 0);di=F([He(),M("design:paramtypes",[String,Array])],di);var ps=class{constructor(e,r){this.with=e,this.can=r}};F([w(),M("design:type",di)],ps.prototype,"with",void 0);F([w(),M("design:type",Array)],ps.prototype,"can",void 0);ps=F([He(),M("design:paramtypes",[di,Array])],ps);var Mr=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)],Mr.prototype,"appName",void 0);F([w(),M("design:type",String)],Mr.prototype,"appDesc",void 0);F([w(),M("design:type",String)],Mr.prototype,"appDomain",void 0);F([w(),M("design:type",String)],Mr.prototype,"appUrl",void 0);F([w(),M("design:type",String)],Mr.prototype,"appIconPath",void 0);F([w(),M("design:type",Array)],Mr.prototype,"capabilities",void 0);Mr=F([He(),M("design:paramtypes",[String,String,String,String,String,Array])],Mr);var yi=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},vi=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Ct=class{constructor(e){e?(this.isInitialized=e.isInitialized,this.isInitialized||(this.isInitialized=!1),this.isUnlocked=e.isUnlocked,this.isUnlocked||(this.isUnlocked=!1),this.did=e.did,this.didDocument=e.didDocument,this.error=e.error):(this.isInitialized=!1,this.isUnlocked=!1)}};yi([w(),vi("design:type",Boolean)],Ct.prototype,"isInitialized",void 0);yi([w(),vi("design:type",Boolean)],Ct.prototype,"isUnlocked",void 0);yi([w(),vi("design:type",String)],Ct.prototype,"did",void 0);yi([w(),vi("design:type",String)],Ct.prototype,"didDocument",void 0);yi([w(),vi("design:type",String)],Ct.prototype,"error",void 0);Ct=yi([Z(),vi("design:paramtypes",[Object])],Ct);var ad=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Ae=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},st,ct,ju=class{constructor(e,r){st.set(this,void 0),ct.set(this,void 0),ad(this,st,e,"f"),ad(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 On=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},Dn=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)}};On([w(),Dn("design:type",String)],vt.prototype,"source",void 0);On([w(),Dn("design:type",String)],vt.prototype,"target",void 0);On([w(),Dn("design:type",String)],vt.prototype,"predicate",void 0);On([w(),Dn("design:type",Date)],vt.prototype,"fromDate",void 0);On([w(),Dn("design:type",Date)],vt.prototype,"untilDate",void 0);On([w(),Dn("design:type",Number)],vt.prototype,"limit",void 0);vt=On([Z(),He(),Dn("design:paramtypes",[Object])],vt);var od=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},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 du(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 od(r,ar,e,"f"),r}static from(e){let r=new Lt;return od(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:${du(ot(this,Nt,"f"))}`;break;case"number":e=`number:${du(ot(this,Nt,"f"))}`;break;case"object":e=`json:${du(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 Or(t){return t.charAt(0).toUpperCase()+t.slice(1)}function bh(t){return`set${Or(t)}`}function ur(t){return t.endsWith("y")?t.slice(0,-1)+"ies":t+"s"}function al(t){return t.endsWith("ies")?t.slice(0,-3)+"y":t.endsWith("s")?t.slice(0,-1):t}function ly(t){return`add${Or(al(t))}`}function fy(t){let e=t.substring(3),r=ur(e);return r.charAt(0).toLowerCase()+r.slice(1)}function py(t){return`remove${Or(al(t))}`}function dy(t){let e=t.substring(6),r=ur(e);return r.charAt(0).toLowerCase()+r.slice(1)}function hy(t){let e=t.substring(13),r=ur(e);return r.charAt(0).toLowerCase()+r.slice(1)}function my(t){return`setCollection${Or(al(t))}`}function un(t){if(Array.isArray(t))return`[${t.map(un).join(", ")}]`;let e=Object.keys(t),r=[];for(let n of e){let i=JSON.stringify(t[n]),a=`${n}: ${i}`;r.push(a)}return`{${r.join(", ")}}`}var hu=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,ds=class{constructor(t,e,r){Je.set(this,void 0),Xe.set(this,void 0),Ee.set(this,void 0),hu(this,Je,e,"f"),hu(this,Xe,r,"f"),hu(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[bh(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[ly(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[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 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[my(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 ti=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,ve,ln,fn,pn,ea,ui=class{constructor(t,e){le.set(this,void 0),ve.set(this,void 0),ln.set(this,void 0),fn.set(this,void 0),pn.set(this,void 0),ea.set(this,void 0),ti(this,ln,[],"f"),ti(this,fn,[],"f"),ti(this,pn,[],"f"),ti(this,ea,[],"f"),ti(this,le,t,"f"),ti(this,ve,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,ve,"f").addPerspectiveLinkAddedListener($(this,le,"f").uuid,$(this,ln,"f")),$(this,ve,"f").addPerspectiveLinkRemovedListener($(this,le,"f").uuid,$(this,fn,"f")),$(this,ve,"f").addPerspectiveLinkUpdatedListener($(this,le,"f").uuid,$(this,pn,"f")),$(this,ve,"f").addPerspectiveSyncStateChangeListener($(this,le,"f").uuid,$(this,ea,"f"))}async executeAction(t,e,r){return await $(this,ve,"f").executeCommands($(this,le,"f").uuid,JSON.stringify(t),e,JSON.stringify(r))}async get(t){return await $(this,ve,"f").queryLinks($(this,le,"f").uuid,t)}async infer(t){return await $(this,ve,"f").queryProlog($(this,le,"f").uuid,t)}async add(t,e="shared"){return await $(this,ve,"f").addLink($(this,le,"f").uuid,t,e)}async addLinks(t,e="shared"){return await $(this,ve,"f").addLinks($(this,le,"f").uuid,t,e)}async removeLinks(t){return await $(this,ve,"f").removeLinks($(this,le,"f").uuid,t)}async linkMutations(t,e="shared"){return await $(this,ve,"f").linkMutations($(this,le,"f").uuid,t,e)}async addLinkExpression(t,e="shared"){return await $(this,ve,"f").addLinkExpression($(this,le,"f").uuid,t,e)}async update(t,e){return await $(this,ve,"f").updateLink($(this,le,"f").uuid,t,e)}async remove(t){return await $(this,ve,"f").removeLink($(this,le,"f").uuid,t)}async getExpression(t){return await $(this,ve,"f").getExpression(t)}async createExpression(t,e){return await $(this,ve,"f").createExpression(t,e)}async addListener(t,e){t==="link-added"?$(this,ln,"f").push(e):t==="link-removed"?$(this,fn,"f").push(e):t==="link-updated"&&$(this,pn,"f").push(e)}async addSyncStateChangeListener(t){$(this,ea,"f").push(t)}async removeListener(t,e){if(t==="link-added"){let r=$(this,ln,"f").indexOf(e);$(this,ln,"f").splice(r,1)}else if(t==="link-removed"){let r=$(this,fn,"f").indexOf(e);$(this,fn,"f").splice(r,1)}else if(t==="link-updated"){let r=$(this,pn,"f").indexOf(e);$(this,pn,"f").splice(r,1)}}async snapshot(){return $(this,ve,"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,ve,"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,ve,"f").createSubject($(this,le,"f").uuid,JSON.stringify({className:r}),e);else{let n=this.buildQueryFromTemplate(t);await $(this,ve,"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,ve,"f").getSubjectData($(this,le,"f").uuid,JSON.stringify({className:t}),e));let r=this.buildQueryFromTemplate(t);return JSON.parse(await $(this,ve,"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 ds(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, "${fy(l)}", _)`;for(let l of s)c+=`, collection_remover(C, "${dy(l)}", _)`;for(let l of u)c+=`, collection_setter(C, "${hy(l)}", _)`;c+=".",e=c}(t),e}async subjectClassesByTemplate(t){let e=this.buildQueryFromTemplate(t),r=await this.infer(e);return r?r.map(n=>n.Class):[]}async ensureSDNASubjectClass(t){if((await this.subjectClassesByTemplate(new t)).length>0)return;let{name:r,sdna:n}=t.generateSDNA();await this.addSdna(r,n,"subject_class")}getNeighbourhoodProxy(){return $(this,ve,"f").getNeighbourhoodProxy($(this,le,"f").uuid)}};le=new WeakMap,ve=new WeakMap,ln=new WeakMap,fn=new WeakMap,pn=new WeakMap,ea=new WeakMap;var on=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)},se,ta,ra,na,Ko,ia,Zo,ht=`
|
|
63
|
+
this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`):o||ml.set(i,o=new Set),o.add(a),e.has(a)||(e.add(a),r.push(n))}else r.push(n)}),Fs(Fs({},t),{definitions:r})}function Hy(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 Wy(t){var e=o1(t);if(!Es.has(e)){var r=Vy(t,{experimentalFragmentVariables:Ms,allowLegacyFragmentVariables:Ms});if(!r||r.kind!=="Document")throw new Error("Not a valid GraphQL document.");Es.set(e,Hy(Gy(r)))}return Es.get(e)}function E(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]}),Wy(n)}function Ky(){Es.clear(),ml.clear()}function Zy(){a1=!1}function Jy(){Ms=!0}function Yy(){Ms=!1}var ba={gql:E,resetCaches:Ky,disableFragmentWarnings:Zy,enableExperimentalFragmentVariables:Jy,disableExperimentalFragmentVariables:Yy};(function(t){t.gql=ba.gql,t.resetCaches=ba.resetCaches,t.disableFragmentWarnings=ba.disableFragmentWarnings,t.enableExperimentalFragmentVariables=ba.enableExperimentalFragmentVariables,t.disableExperimentalFragmentVariables=ba.disableExperimentalFragmentVariables})(E||(E={}));E.default=E;function I(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 Xy(){}function on(){return Xy}var ye=on,m=on,Ke=on,Ve=on,W=on,Ht=on,e0=on,jl=on,s1=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},c1=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Un=class{constructor(e){this.code=e}};s1([m(),c1("design:type",String)],Un.prototype,"code",void 0);Un=s1([W(),c1("design:paramtypes",[String])],Un);var Bl=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},ql=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},ar=class{constructor(e,r){this.address=e,this.name=r}};Bl([m(),ql("design:type",String)],ar.prototype,"address",void 0);Bl([m(),ql("design:type",String)],ar.prototype,"name",void 0);ar=Bl([W(),ql("design:paramtypes",[String,String])],ar);var ke=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},qe=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},xr=class{constructor(e,r){this.key=r,this.signature=e}};ke([m(),qe("design:type",String)],xr.prototype,"signature",void 0);ke([m(),qe("design:type",String)],xr.prototype,"key",void 0);ke([m(),qe("design:type",Boolean)],xr.prototype,"valid",void 0);ke([m(),qe("design:type",Boolean)],xr.prototype,"invalid",void 0);xr=ke([W(),Ke(),qe("design:paramtypes",[String,String])],xr);var jn=class{};ke([m(),qe("design:type",String)],jn.prototype,"signature",void 0);ke([m(),qe("design:type",String)],jn.prototype,"key",void 0);ke([m(),qe("design:type",Boolean)],jn.prototype,"valid",void 0);ke([m(),qe("design:type",Boolean)],jn.prototype,"invalid",void 0);jn=ke([Ke()],jn);function sn(t){let e=class{constructor(n,i,a,o){this.author=n,this.timestamp=i,this.data=a,this.proof=o}};return ke([m(),qe("design:type",String)],e.prototype,"author",void 0),ke([m(),qe("design:type",String)],e.prototype,"timestamp",void 0),ke([m(),qe("design:type",Object)],e.prototype,"data",void 0),ke([m(),qe("design:type",xr)],e.prototype,"proof",void 0),e=ke([W(),qe("design:paramtypes",[String,String,Object,xr])],e),e}function t0(t){let e=class{};return ke([m(),qe("design:type",String)],e.prototype,"author",void 0),ke([m(),qe("design:type",String)],e.prototype,"timestamp",void 0),ke([m(),qe("design:type",Object)],e.prototype,"data",void 0),ke([m(),qe("design:type",jn)],e.prototype,"proof",void 0),e=ke([Ke()],e),e}var Bd=class extends sn(){};Bd=ke([W()],Bd);var Us=class extends sn(){};ke([m(),qe("design:type",ar)],Us.prototype,"language",void 0);ke([m(),qe("design:type",Un)],Us.prototype,"icon",void 0);Us=ke([W()],Us);function iw(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},rt=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Bn=class{constructor(e){this.source=e.source?e.source:"",this.target=e.target?e.target:"",this.predicate=e.predicate?e.predicate:""}};Fe([m(),rt("design:type",String)],Bn.prototype,"source",void 0);Fe([m(),rt("design:type",String)],Bn.prototype,"target",void 0);Fe([m(),rt("design:type",String)],Bn.prototype,"predicate",void 0);Bn=Fe([W(),rt("design:paramtypes",[Object])],Bn);var js=class{};Fe([m(),rt("design:type",Array)],js.prototype,"additions",void 0);Fe([m(),rt("design:type",Array)],js.prototype,"removals",void 0);js=Fe([Ke()],js);var Bs=class{constructor(e,r){this.additions=e,this.removals=r}};Fe([m(),rt("design:type",Array)],Bs.prototype,"additions",void 0);Fe([m(),rt("design:type",Array)],Bs.prototype,"removals",void 0);Bs=Fe([W(),rt("design:paramtypes",[Array,Array])],Bs);var Za=class{};Fe([m(),rt("design:type",String)],Za.prototype,"source",void 0);Fe([m(),rt("design:type",String)],Za.prototype,"target",void 0);Fe([m(),rt("design:type",String)],Za.prototype,"predicate",void 0);Za=Fe([Ke()],Za);var Xr=class extends sn(){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(),rt("design:type",String)],Xr.prototype,"status",void 0);Xr=Fe([W()],Xr);var gl=class extends t0(){};Fe([m(),rt("design:type",String)],gl.prototype,"status",void 0);gl=Fe([Ke()],gl);function pw(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 fw(t){return t&&t.source&&t.target}var qs=class{constructor(e,r){this.oldLink=e,this.newLink=r}};Fe([m(),rt("design:type",Xr)],qs.prototype,"oldLink",void 0);Fe([m(),rt("design:type",Xr)],qs.prototype,"newLink",void 0);qs=Fe([W(),rt("design:paramtypes",[Xr,Xr])],qs);var Kn=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},co=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},yl,cr=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}};Kn([m(),co("design:type",Array)],cr.prototype,"links",void 0);cr=Kn([W(),co("design:paramtypes",[Array])],cr);var Vs=class{};Kn([m(),co("design:type",Array)],Vs.prototype,"links",void 0);Vs=Kn([Ke()],Vs);var vl=yl=class{constructor(e){e?this.links=e:this.links=[]}static fromLink(e){let r=new yl;return r.links.push(e),r}};Kn([m(),co("design:type",Array)],vl.prototype,"links",void 0);vl=yl=Kn([Ke(),co("design:paramtypes",[Array])],vl);var qn=class extends sn(){};qn=Kn([W()],qn);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)},Wr=class{constructor(e,r){this.did=e,r?this.perspective=r:this.perspective=new cr}};U([m(),j("design:type",String)],Wr.prototype,"did",void 0);U([m(),j("design:type",cr)],Wr.prototype,"perspective",void 0);U([m(),j("design:type",String)],Wr.prototype,"directMessageLanguage",void 0);Wr=U([W(),j("design:paramtypes",[String,cr])],Wr);var qd=class extends sn(){};qd=U([W()],qd);var en=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)],en.prototype,"did",void 0);U([m(),j("design:type",String)],en.prototype,"didSigningKeyId",void 0);U([m(),j("design:type",String)],en.prototype,"deviceKeyType",void 0);U([m(),j("design:type",String)],en.prototype,"deviceKey",void 0);U([m(),j("design:type",String)],en.prototype,"deviceKeySignedByDid",void 0);U([m(),j("design:type",String)],en.prototype,"didSignedByDeviceKey",void 0);en=U([W(),j("design:paramtypes",[String,String,String,String,String,String])],en);var tn=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)],tn.prototype,"did",void 0);U([m(),j("design:type",String)],tn.prototype,"didSigningKeyId",void 0);U([m(),j("design:type",String)],tn.prototype,"deviceKeyType",void 0);U([m(),j("design:type",String)],tn.prototype,"deviceKey",void 0);U([m(),j("design:type",String)],tn.prototype,"deviceKeySignedByDid",void 0);U([m(),j("design:type",String)],tn.prototype,"didSignedByDeviceKey",void 0);tn=U([Ke(),j("design:paramtypes",[String,String,String,String,String,String])],tn);var Qs=class{constructor(e,r){this.signature=e,this.publicKey=r}};U([m(),j("design:type",String)],Qs.prototype,"signature",void 0);U([m(),j("design:type",String)],Qs.prototype,"publicKey",void 0);Qs=U([W(),j("design:paramtypes",[String,String])],Qs);var Ni=class{constructor(e,r){this.domain=e,this.pointers=r}};U([m(),j("design:type",String)],Ni.prototype,"domain",void 0);U([m(),j("design:type",Array)],Ni.prototype,"pointers",void 0);Ni=U([W(),j("design:paramtypes",[String,Array])],Ni);var zs=class{constructor(e,r){this.with=e,this.can=r}};U([m(),j("design:type",Ni)],zs.prototype,"with",void 0);U([m(),j("design:type",Array)],zs.prototype,"can",void 0);zs=U([W(),j("design:paramtypes",[Ni,Array])],zs);var Er=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)],Er.prototype,"appName",void 0);U([m(),j("design:type",String)],Er.prototype,"appDesc",void 0);U([m(),j("design:type",String)],Er.prototype,"appUrl",void 0);U([m(),j("design:type",String)],Er.prototype,"appIconPath",void 0);U([m(),j("design:type",Array)],Er.prototype,"capabilities",void 0);Er=U([W(),j("design:paramtypes",[String,String,String,Array,String])],Er);var Pi=class{constructor(e,r,n,i){this.requestId=e,this.auth=r,this.token=n,this.revoked=i}};U([m(),j("design:type",String)],Pi.prototype,"requestId",void 0);U([m(),j("design:type",String)],Pi.prototype,"token",void 0);U([m(),j("design:type",Boolean)],Pi.prototype,"revoked",void 0);U([m(),j("design:type",Er)],Pi.prototype,"auth",void 0);Pi=U([W(),j("design:paramtypes",[String,Er,String,Boolean])],Pi);var Ri=class{constructor(e,r){this.domain=e,this.pointers=r}};U([m(),j("design:type",String)],Ri.prototype,"domain",void 0);U([m(),j("design:type",Array)],Ri.prototype,"pointers",void 0);Ri=U([Ke(),j("design:paramtypes",[String,Array])],Ri);var Gs=class{constructor(e,r){this.with=e,this.can=r}};U([m(),j("design:type",Ri)],Gs.prototype,"with",void 0);U([m(),j("design:type",Array)],Gs.prototype,"can",void 0);Gs=U([Ke(),j("design:paramtypes",[Ri,Array])],Gs);var rn=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)],rn.prototype,"appName",void 0);U([m(),j("design:type",String)],rn.prototype,"appDesc",void 0);U([m(),j("design:type",String)],rn.prototype,"appDomain",void 0);U([m(),j("design:type",String)],rn.prototype,"appUrl",void 0);U([m(),j("design:type",String)],rn.prototype,"appIconPath",void 0);U([m(),j("design:type",Array)],rn.prototype,"capabilities",void 0);rn=U([Ke(),j("design:paramtypes",[String,String,String,String,String,Array])],rn);var ji=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)},Lt=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)}};ji([m(),Bi("design:type",Boolean)],Lt.prototype,"isInitialized",void 0);ji([m(),Bi("design:type",Boolean)],Lt.prototype,"isUnlocked",void 0);ji([m(),Bi("design:type",String)],Lt.prototype,"did",void 0);ji([m(),Bi("design:type",String)],Lt.prototype,"didDocument",void 0);ji([m(),Bi("design:type",String)],Lt.prototype,"error",void 0);Lt=ji([W(),Bi("design:paramtypes",[Object])],Lt);var Vd=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)},gt,yt,bl=class{constructor(e,r){gt.set(this,void 0),yt.set(this,void 0),Vd(this,gt,e,"f"),Vd(this,yt,r,"f")}async otherAgents(){return await Pe(this,gt,"f").otherAgents(Pe(this,yt,"f"))}async hasTelepresenceAdapter(){return await Pe(this,gt,"f").hasTelepresenceAdapter(Pe(this,yt,"f"))}async onlineAgents(){return await Pe(this,gt,"f").onlineAgents(Pe(this,yt,"f"))}async setOnlineStatus(e){return await Pe(this,gt,"f").setOnlineStatus(Pe(this,yt,"f"),e)}async setOnlineStatusU(e){return await Pe(this,gt,"f").setOnlineStatusU(Pe(this,yt,"f"),e)}async sendSignal(e,r){return await Pe(this,gt,"f").sendSignal(Pe(this,yt,"f"),e,r)}async sendSignalU(e,r){return await Pe(this,gt,"f").sendSignalU(Pe(this,yt,"f"),e,r)}async sendBroadcast(e,r=!1){return await Pe(this,gt,"f").sendBroadcast(Pe(this,yt,"f"),e,r)}async sendBroadcastU(e,r=!1){return await Pe(this,gt,"f").sendBroadcastU(Pe(this,yt,"f"),e,r)}async addSignalHandler(e){await Pe(this,gt,"f").addSignalHandler(Pe(this,yt,"f"),e)}removeSignalHandler(e){Pe(this,gt,"f").removeSignalHandler(Pe(this,yt,"f"),e)}};gt=new WeakMap,yt=new WeakMap;var Zn=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},Jn=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},at=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)}};Zn([m(),Jn("design:type",String)],at.prototype,"source",void 0);Zn([m(),Jn("design:type",String)],at.prototype,"target",void 0);Zn([m(),Jn("design:type",String)],at.prototype,"predicate",void 0);Zn([m(),Jn("design:type",Date)],at.prototype,"fromDate",void 0);Zn([m(),Jn("design:type",Date)],at.prototype,"untilDate",void 0);Zn([m(),Jn("design:type",Number)],at.prototype,"limit",void 0);at=Zn([W(),Ke(),Jn("design:paramtypes",[Object])],at);var Qd=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},et=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,vr;function cs(t){return encodeURIComponent(t).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`)}var At=class{constructor(){vt.set(this,void 0),vr.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 At;return Qd(r,vr,e,"f"),r}static from(e){let r=new At;return Qd(r,vt,e,"f"),r}toUrl(){if(et(this,vr,"f")&&!et(this,vt,"f"))return et(this,vr,"f");if(!et(this,vr,"f")&&(et(this,vt,"f")===void 0||et(this,vt,"f")===""||et(this,vt,"f")===null))throw new Error("Can't turn empty Literal into URL");let e;switch(typeof et(this,vt,"f")){case"string":e=`string:${cs(et(this,vt,"f"))}`;break;case"number":e=`number:${cs(et(this,vt,"f"))}`;break;case"boolean":e=`boolean:${cs(et(this,vt,"f"))}`;break;case"object":e=`json:${cs(JSON.stringify(et(this,vt,"f")))}`;break}return`literal://${e}`}get(){if(et(this,vt,"f"))return et(this,vt,"f");if(!et(this,vr,"f"))throw new Error("Can't render empty Literal");if(!et(this,vr,"f").startsWith("literal://"))throw new Error("Can't render Literal from non-literal URL");let e=et(this,vr,"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}`)}};vt=new WeakMap,vr=new WeakMap;function Kr(t){return t.charAt(0).toUpperCase()+t.slice(1)}function Vl(t){return`set${Kr(t)}`}function Cr(t){return t.endsWith("y")?t.slice(0,-1)+"ies":t+"s"}function Ql(t){return t.endsWith("ies")?t.slice(0,-3)+"y":t.endsWith("s")?t.slice(0,-1):t}function r0(t){return`add${Kr(Ql(t))}`}function n0(t){let e=t.substring(3),r=Cr(e);return r.charAt(0).toLowerCase()+r.slice(1)}function i0(t){return`remove${Kr(Ql(t))}`}function a0(t){let e=t.substring(6),r=Cr(e);return r.charAt(0).toLowerCase()+r.slice(1)}function o0(t){let e=t.substring(13),r=Cr(e);return r.charAt(0).toLowerCase()+r.slice(1)}function s0(t){return`setCollection${Kr(Ql(t))}`}function kn(t){if(Array.isArray(t))return`[${t.map(kn).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 Ku=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)},ut,lt,Ae,Hs=class{constructor(t,e,r){ut.set(this,void 0),lt.set(this,void 0),Ae.set(this,void 0),Ku(this,ut,e,"f"),Ku(this,lt,r,"f"),Ku(this,Ae,t,"f")}get baseExpression(){return G(this,ut,"f")}async init(){let isInstance=await G(this,Ae,"f").isSubjectInstance(G(this,ut,"f"),G(this,lt,"f"));if(!isInstance)throw`Not a valid subject instance of ${G(this,lt,"f")} for ${G(this,ut,"f")}`;let results=await G(this,Ae,"f").infer(`subject_class("${G(this,lt,"f")}", C), property(C, Property)`),properties=results.map(t=>t.Property);for(let t of properties){let e=await G(this,Ae,"f").infer(`subject_class("${G(this,lt,"f")}", C), property_resolve(C, "${t}")`);Object.defineProperty(this,t,{configurable:!0,get:async()=>{let r=await G(this,Ae,"f").infer(`subject_class("${G(this,lt,"f")}", C), property_getter(C, "${G(this,ut,"f")}", "${t}", Value)`);if(r&&r.length>0){let n=r[0].Value;if(e)try{if(n){let i=await G(this,Ae,"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,Ae,"f").infer(`subject_class("${G(this,lt,"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,Ae,"f").infer(`subject_class("${G(this,lt,"f")}", C), property_resolve_language(C, "${property}", Language)`),resolveLanguage;resolveLanguageResults&&resolveLanguageResults.length>0&&(resolveLanguage=resolveLanguageResults[0].Language),this[Vl(property)]=async t=>{resolveLanguage&&(t=await G(this,Ae,"f").createExpression(t,resolveLanguage)),await G(this,Ae,"f").executeAction(actions,G(this,ut,"f"),[{name:"value",value:t}])}}let results2=await G(this,Ae,"f").infer(`subject_class("${G(this,lt,"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,Ae,"f").infer(`subject_class("${G(this,lt,"f")}", C), collection_getter(C, "${G(this,ut,"f")}", "${t}", Value)`);return e&&e.length>0&&e[0].Value?e[0].Value.filter(n=>n!==""&&n!==""):[]}});let adders=await G(this,Ae,"f").infer(`subject_class("${G(this,lt,"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[r0(collection)]=async t=>{Array.isArray(t)?await Promise.all(t.map(e=>G(this,Ae,"f").executeAction(actions,G(this,ut,"f"),[{name:"value",value:e}]))):await G(this,Ae,"f").executeAction(actions,G(this,ut,"f"),[{name:"value",value:t}])}}let removers=await G(this,Ae,"f").infer(`subject_class("${G(this,lt,"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[i0(collection)]=async t=>{Array.isArray(t)?await Promise.all(t.map(e=>G(this,Ae,"f").executeAction(actions,G(this,ut,"f"),[{name:"value",value:e}]))):await G(this,Ae,"f").executeAction(actions,G(this,ut,"f"),[{name:"value",value:t}])}}let collectionSetters=await G(this,Ae,"f").infer(`subject_class("${G(this,lt,"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[s0(collection)]=async t=>{Array.isArray(t)?await G(this,Ae,"f").executeAction(actions,G(this,ut,"f"),t.map(e=>({name:"value",value:e}))):await G(this,Ae,"f").executeAction(actions,G(this,ut,"f"),[{name:"value",value:t}])}}}};ut=new WeakMap,lt=new WeakMap,Ae=new WeakMap;var Le=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},O=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)},_l,Ii,Qr,In,Pn,xa,Ea,Ai,ka,ks,br,Ia,u1,pe,fe,An,Tn,On,Aa,wl=class{constructor(e,r,n){_l.add(this),Ii.set(this,void 0),Qr.set(this,void 0),In.set(this,void 0),Pn.set(this,void 0),xa.set(this,void 0),Ea.set(this,void 0),Ai.set(this,void 0),ka.set(this,!1),ks.set(this,void 0),br.set(this,void 0),Ia.set(this,void 0),Le(this,Ii,e,"f"),Le(this,Ia,r,"f"),Le(this,In,n,"f"),Le(this,Pn,new Set,"f"),Le(this,Ai,null,"f")}async subscribe(){let e=await O(this,In,"f").subscribeQuery(O(this,Ii,"f"),O(this,Ia,"f"));Le(this,Qr,e.subscriptionId,"f"),Le(this,ks,new Promise((n,i)=>{Le(this,br,setTimeout(()=>{i(new Error("Subscription initialization timed out after 30 seconds. Resubscribing...")),this.subscribe()},3e4),"f"),Le(this,Ea,O(this,In,"f").subscribeToQueryUpdates(O(this,Qr,"f"),a=>{O(this,br,"f")&&(clearTimeout(O(this,br,"f")),Le(this,br,void 0,"f")),n(!0),!(a.isInit&&O(this,Ai,"f"))&&(Le(this,Ai,a,"f"),O(this,_l,"m",u1).call(this,a))}),"f")}),"f");let r=async()=>{if(!O(this,ka,"f")){try{await O(this,In,"f").keepAliveQuery(O(this,Ii,"f"),O(this,Qr,"f"))}catch(n){console.error("Error in keepalive:",n),console.log("Reinitializing subscription for query:",O(this,Ia,"f")),await this.subscribe(),console.log("Subscription reinitialized")}O(this,ka,"f")||Le(this,xa,setTimeout(r,3e4),"f")}};Le(this,xa,setTimeout(r,3e4),"f")}get id(){return O(this,Qr,"f")}get initialized(){return O(this,ks,"f")}get result(){return O(this,Ai,"f")}onResult(e){return O(this,Pn,"f").add(e),()=>O(this,Pn,"f").delete(e)}dispose(){Le(this,ka,!0,"f"),clearTimeout(O(this,xa,"f")),O(this,Ea,"f")&&O(this,Ea,"f").call(this),O(this,Pn,"f").clear(),O(this,br,"f")&&(clearTimeout(O(this,br,"f")),Le(this,br,void 0,"f")),O(this,Qr,"f")&&O(this,In,"f").disposeQuerySubscription(O(this,Ii,"f"),O(this,Qr,"f")).catch(e=>console.error("Error disposing query subscription:",e))}};Ii=new WeakMap,Qr=new WeakMap,In=new WeakMap,Pn=new WeakMap,xa=new WeakMap,Ea=new WeakMap,Ai=new WeakMap,ka=new WeakMap,ks=new WeakMap,br=new WeakMap,Ia=new WeakMap,_l=new WeakSet,u1=function t(e){for(let r of O(this,Pn,"f"))try{r(e)}catch(n){console.error("Error in query subscription callback:",n)}};var Oi=class{constructor(t,e){pe.set(this,void 0),fe.set(this,void 0),An.set(this,void 0),Tn.set(this,void 0),On.set(this,void 0),Aa.set(this,void 0),Le(this,An,[],"f"),Le(this,Tn,[],"f"),Le(this,On,[],"f"),Le(this,Aa,[],"f"),Le(this,pe,t,"f"),Le(this,fe,e,"f"),this.uuid=O(this,pe,"f").uuid,this.name=O(this,pe,"f").name,this.sharedUrl=O(this,pe,"f").sharedUrl,this.neighbourhood=O(this,pe,"f").neighbourhood,this.state=O(this,pe,"f").state,O(this,fe,"f").addPerspectiveLinkAddedListener(O(this,pe,"f").uuid,O(this,An,"f")),O(this,fe,"f").addPerspectiveLinkRemovedListener(O(this,pe,"f").uuid,O(this,Tn,"f")),O(this,fe,"f").addPerspectiveLinkUpdatedListener(O(this,pe,"f").uuid,O(this,On,"f")),O(this,fe,"f").addPerspectiveSyncStateChangeListener(O(this,pe,"f").uuid,O(this,Aa,"f"))}async executeAction(t,e,r,n){return await O(this,fe,"f").executeCommands(O(this,pe,"f").uuid,JSON.stringify(t),e,JSON.stringify(r),n)}async get(t){return await O(this,fe,"f").queryLinks(O(this,pe,"f").uuid,t)}async infer(t){return await O(this,fe,"f").queryProlog(O(this,pe,"f").uuid,t)}async add(t,e="shared",r){return await O(this,fe,"f").addLink(O(this,pe,"f").uuid,t,e,r)}async addLinks(t,e="shared",r){return await O(this,fe,"f").addLinks(O(this,pe,"f").uuid,t,e,r)}async removeLinks(t,e){return await O(this,fe,"f").removeLinks(O(this,pe,"f").uuid,t,e)}async linkMutations(t,e="shared"){return await O(this,fe,"f").linkMutations(O(this,pe,"f").uuid,t,e)}async addLinkExpression(t,e="shared",r){return await O(this,fe,"f").addLinkExpression(O(this,pe,"f").uuid,t,e,r)}async update(t,e,r){return await O(this,fe,"f").updateLink(O(this,pe,"f").uuid,t,e,r)}async remove(t,e){return await O(this,fe,"f").removeLink(O(this,pe,"f").uuid,t,e)}async createBatch(){return await O(this,fe,"f").createBatch(O(this,pe,"f").uuid)}async commitBatch(t){return await O(this,fe,"f").commitBatch(O(this,pe,"f").uuid,t)}async getExpression(t){return await O(this,fe,"f").getExpression(t)}async createExpression(t,e){return await O(this,fe,"f").createExpression(t,e)}async addListener(t,e){t==="link-added"?O(this,An,"f").push(e):t==="link-removed"?O(this,Tn,"f").push(e):t==="link-updated"&&O(this,On,"f").push(e)}async addSyncStateChangeListener(t){O(this,Aa,"f").push(t)}async removeListener(t,e){if(t==="link-added"){let r=O(this,An,"f").indexOf(e);O(this,An,"f").splice(r,1)}else if(t==="link-removed"){let r=O(this,Tn,"f").indexOf(e);O(this,Tn,"f").splice(r,1)}else if(t==="link-updated"){let r=O(this,On,"f").indexOf(e);O(this,On,"f").splice(r,1)}}async snapshot(){return O(this,fe,"f").snapshotByUUID(O(this,pe,"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 at({source:t.source,predicate:t.predicate}),n=await this.get(r),i=[];for(let o of n)delete o.__typename,delete o.data.__typename,delete o.proof.__typename,i.push(o);let a=[t];await this.linkMutations({additions:a,removals:i},e)}async sdnaFlows(){return(await this.infer("register_sdna_flow(X, _)")).map(e=>e.X)}async availableFlows(t){return(await this.infer(`flowable("${t}", F), register_sdna_flow(X, F)`)).map(r=>r.X)}async startFlow(flowName,exprAddr){let startAction=await this.infer(`start_action(Action, F), register_sdna_flow("${flowName}", F)`);startAction=eval(startAction[0].Action),await this.executeAction(startAction,exprAddr,void 0)}async expressionsInFlowState(t,e){return(await this.infer(`register_sdna_flow("${t}", F), flow_state(X, ${e}, F)`)).map(n=>n.X)}async flowState(t,e){return(await this.infer(`register_sdna_flow("${t}", F), flow_state("${e}", X, F)`))[0].X}async flowActions(t,e){return(await this.infer(`register_sdna_flow("${t}", Flow), flow_state("${e}", State, Flow), action(State, Name, _, _)`)).map(n=>n.Name)}async runFlowAction(flowName,exprAddr,actionName){let action=await this.infer(`register_sdna_flow("${flowName}", Flow), flow_state("${exprAddr}", State, Flow), action(State, "${actionName}", _, Action)`);action=eval(action[0].Action),await this.executeAction(action,exprAddr,void 0)}async getSdna(){let t=["ad4m://has_subject_class","ad4m://has_flow","ad4m://has_custom_sdna"],e=[];for(let r of t){let n=await this.get(new at({source:"ad4m://self",predicate:r}));for(let i of n){let a=i.data.target,o=await this.get(new at({source:a,predicate:"ad4m://sdna"}));for(let s of o){let u=At.fromUrl(s.data.target).get();typeof u=="string"&&e.push(u)}}}return e}async getSdnaForClass(t){let e=At.from(t);if((await this.get(new at({source:"ad4m://self",target:e.toUrl(),predicate:"ad4m://has_subject_class"}))).length===0)return null;let n=await this.get(new at({source:e.toUrl(),predicate:"ad4m://sdna"}));if(n.length===0)return null;let i=At.fromUrl(n[0].data.target).get();return typeof i=="string"?i:null}async addSdna(t,e,r){return O(this,fe,"f").addSdna(O(this,pe,"f").uuid,t,e,r)}async subjectClasses(){try{return(await this.infer("subject_class(X, _)")).map(t=>t.X)}catch{return[]}}async stringOrTemplateObjectToSubjectClassName(t){if(typeof t=="string")return t;{let e=await this.subjectClassesByTemplate(t);return e[0]?e[0]:t.className}}async createSubject(t,e,r,n){let i;if(typeof t=="string")i=t,await O(this,fe,"f").createSubject(O(this,pe,"f").uuid,JSON.stringify({className:i,initialValues:r}),e,r?JSON.stringify(r):void 0,n);else{let a=this.buildQueryFromTemplate(t);await O(this,fe,"f").createSubject(O(this,pe,"f").uuid,JSON.stringify({query:a,initialValues:r}),e,r?JSON.stringify(r):void 0,n)}return n?e:this.getSubjectProxy(e,t)}async getSubjectData(t,e){if(typeof t=="string")return JSON.parse(await O(this,fe,"f").getSubjectData(O(this,pe,"f").uuid,JSON.stringify({className:t}),e));let r=this.buildQueryFromTemplate(t);return JSON.parse(await O(this,fe,"f").getSubjectData(O(this,pe,"f").uuid,JSON.stringify({query:r}),e))}async removeSubject(subjectClass,exprAddr,batchId){let className=await this.stringOrTemplateObjectToSubjectClassName(subjectClass),result=await this.infer(`subject_class("${className}", C), destructor(C, Actions)`);if(!result.length)throw"No destructor found for given subject class: "+className;let actions=result.map(x=>eval(x.Actions));await this.executeAction(actions[0],exprAddr,void 0,batchId)}async isSubjectInstance(t,e){let r=await this.stringOrTemplateObjectToSubjectClassName(e),n=!1,i=5,a=0;for(;a<i&&!n;)n=await this.infer(`subject_class("${r}", C), instance(C, "${t}")`),a++;return n}async getSubjectProxy(t,e){if(!await this.isSubjectInstance(t,e))throw`Expression ${t} is not a subject instance of given class: ${JSON.stringify(e)}`;let r=await this.stringOrTemplateObjectToSubjectClassName(e),n=new Hs(this,t,r);return await n.init(),n}async getAllSubjectInstances(t){let e=[];typeof t=="string"?e=[t]:e=await this.subjectClassesByTemplate(t);let r=[];for(let n of e){let i=await this.infer(`subject_class("${n}", C), instance(C, X)`),a=await Promise.all(i.map(async o=>await this.getSubjectProxy(o.X,n)));r=r.concat(a)}return r}async getAllSubjectProxies(t){let e=[];typeof t=="string"?e=[t]:e=await this.subjectClassesByTemplate(t);let r=[];for(let n of e)r=await this.infer(`subject_class("${n}", C), instance(C, X)`);return r}buildQueryFromTemplate(t){let e;return function(r){let n=[],i=[];Object.getPrototypeOf(r).__properties?Object.keys(Object.getPrototypeOf(r).__properties).forEach(l=>n.push(l)):n.push(...Object.keys(r).filter(l=>!Array.isArray(r[l]))),Object.getPrototypeOf(r).__collections?Object.keys(Object.getPrototypeOf(r).__collections).filter(l=>l!=="isSubjectInstance").forEach(l=>{i.includes(l)||i.push(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, "${n0(l)}", _)`;for(let l of s)c+=`, collection_remover(C, "${a0(l)}", _)`;for(let l of u)c+=`, collection_setter(C, "${o0(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 O(this,fe,"f").getNeighbourhoodProxy(O(this,pe,"f").uuid)}get ai(){return O(this,fe,"f").aiClient}async subscribeInfer(t){let e=new wl(this.uuid,t,O(this,fe,"f"));return await e.subscribe(),await e.initialized,e}};pe=new WeakMap,fe=new WeakMap,An=new WeakMap,Tn=new WeakMap,On=new WeakMap,Aa=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},H=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)},te,Ta,Oa,Da,Is,Na,As,Ts,ct=`
|
|
64
64
|
author
|
|
65
65
|
timestamp
|
|
66
66
|
status
|
|
67
67
|
data { source, predicate, target }
|
|
68
68
|
proof { valid, invalid, signature, key }
|
|
69
|
-
`,
|
|
69
|
+
`,wi=`
|
|
70
70
|
uuid
|
|
71
71
|
name
|
|
72
72
|
sharedUrl
|
|
@@ -86,112 +86,128 @@ neighbourhood {
|
|
|
86
86
|
}
|
|
87
87
|
author
|
|
88
88
|
}
|
|
89
|
-
`,
|
|
89
|
+
`,Ws=class{constructor(e,r=!0){te.set(this,void 0),Ta.set(this,void 0),Oa.set(this,void 0),Da.set(this,void 0),Is.set(this,void 0),Na.set(this,void 0),As.set(this,void 0),Ts.set(this,void 0),Br(this,te,e,"f"),Br(this,Ta,[],"f"),Br(this,Oa,[],"f"),Br(this,Da,[],"f"),Br(this,Is,[],"f"),r&&(this.subscribePerspectiveAdded(),this.subscribePerspectiveUpdated(),this.subscribePerspectiveRemoved())}setExpressionClient(e){Br(this,Na,e,"f")}setNeighbourhoodClient(e){Br(this,As,e,"f")}setAIClient(e){Br(this,Ts,e,"f")}get aiClient(){return H(this,Ts,"f")}async all(){let{perspectives:e}=I(await H(this,te,"f").query({query:E`query perspectives {
|
|
90
90
|
perspectives {
|
|
91
|
-
${
|
|
91
|
+
${wi}
|
|
92
92
|
}
|
|
93
|
-
}`}));return e.map(r=>new
|
|
93
|
+
}`}));return e.map(r=>new Oi(r,this))}async byUUID(e){let{perspective:r}=I(await H(this,te,"f").query({query:E`query perspective($uuid: String!) {
|
|
94
94
|
perspective(uuid: $uuid) {
|
|
95
|
-
${
|
|
95
|
+
${wi}
|
|
96
96
|
}
|
|
97
|
-
}`,variables:{uuid:e}}));return r?new
|
|
97
|
+
}`,variables:{uuid:e}}));return r?new Oi(r,this):null}async snapshotByUUID(e){let{perspectiveSnapshot:r}=I(await H(this,te,"f").query({query:E`query perspectiveSnapshot($uuid: String!) {
|
|
98
98
|
perspectiveSnapshot(uuid: $uuid) {
|
|
99
|
-
links { ${
|
|
99
|
+
links { ${ct} }
|
|
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}=I(await H(this,te,"f").mutate({mutation:E`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}=I(await H(this,te,"f").query({query:E`query perspectiveQueryLinks($uuid: String!, $query: LinkQuery!) {
|
|
104
104
|
perspectiveQueryLinks(query: $query, uuid: $uuid) {
|
|
105
|
-
${
|
|
105
|
+
${ct}
|
|
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}=I(await H(this,te,"f").query({query:E`query perspectiveQueryProlog($uuid: String!, $query: String!) {
|
|
108
108
|
perspectiveQueryProlog(uuid: $uuid, query: $query)
|
|
109
|
-
}`,variables:{uuid:e,query:r}}));return JSON.parse(n)}async
|
|
109
|
+
}`,variables:{uuid:e,query:r}}));return JSON.parse(n)}async subscribeQuery(e,r){let{perspectiveSubscribeQuery:n}=I(await H(this,te,"f").mutate({mutation:E`mutation perspectiveSubscribeQuery($uuid: String!, $query: String!) {
|
|
110
|
+
perspectiveSubscribeQuery(uuid: $uuid, query: $query) {
|
|
111
|
+
subscriptionId
|
|
112
|
+
result
|
|
113
|
+
}
|
|
114
|
+
}`,variables:{uuid:e,query:r}})),{subscriptionId:i,result:a}=n,o=a,s=!1;o.startsWith("#init#")&&(o=o.substring(6),s=!0);try{o=JSON.parse(o)}catch(u){console.error("Error parsing perspectiveSubscribeQuery result:",u)}return{subscriptionId:i,result:o,isInit:s}}subscribeToQueryUpdates(e,r){let n=H(this,te,"f").subscribe({query:E`
|
|
115
|
+
subscription perspectiveQuerySubscription($subscriptionId: String!) {
|
|
116
|
+
perspectiveQuerySubscription(subscriptionId: $subscriptionId)
|
|
117
|
+
}
|
|
118
|
+
`,variables:{subscriptionId:e}}).subscribe({next:i=>{if(i.data&&i.data.perspectiveQuerySubscription){let a=i.data.perspectiveQuerySubscription,o=!1;a.startsWith("#init#")&&(a=a.substring(6),o=!0);try{a=JSON.parse(a),o&&typeof a=="object"&&(a.isInit=!0)}catch(s){console.error("Error parsing perspectiveQuerySubscription:",s)}r(a)}},error:i=>console.error("Error in query subscription:",i)});return()=>n.unsubscribe()}async keepAliveQuery(e,r){let{perspectiveKeepAliveQuery:n}=I(await H(this,te,"f").mutate({mutation:E`mutation perspectiveKeepAliveQuery($uuid: String!, $subscriptionId: String!) {
|
|
119
|
+
perspectiveKeepAliveQuery(uuid: $uuid, subscriptionId: $subscriptionId)
|
|
120
|
+
}`,variables:{uuid:e,subscriptionId:r}}));return n}async disposeQuerySubscription(e,r){let{perspectiveDisposeQuerySubscription:n}=I(await H(this,te,"f").mutate({mutation:E`mutation perspectiveDisposeQuerySubscription($uuid: String!, $subscriptionId: String!) {
|
|
121
|
+
perspectiveDisposeQuerySubscription(uuid: $uuid, subscriptionId: $subscriptionId)
|
|
122
|
+
}`,variables:{uuid:e,subscriptionId:r}}));return n}async add(e){let{perspectiveAdd:r}=I(await H(this,te,"f").mutate({mutation:E`mutation perspectiveAdd($name: String!) {
|
|
110
123
|
perspectiveAdd(name: $name) {
|
|
111
|
-
${
|
|
124
|
+
${wi}
|
|
112
125
|
}
|
|
113
|
-
}`,variables:{name:e}}));return new
|
|
126
|
+
}`,variables:{name:e}}));return new Oi(r,this)}async update(e,r){let{perspectiveUpdate:n}=I(await H(this,te,"f").mutate({mutation:E`mutation perspectiveUpdate($uuid: String!, $name: String!) {
|
|
114
127
|
perspectiveUpdate(uuid: $uuid, name: $name) {
|
|
115
|
-
${
|
|
128
|
+
${wi}
|
|
116
129
|
}
|
|
117
|
-
}`,variables:{uuid:e,name:r}}));return new
|
|
130
|
+
}`,variables:{uuid:e,name:r}}));return new Oi(n,this)}async remove(e){return I(await H(this,te,"f").mutate({mutation:E`mutation perspectiveRemove($uuid: String!) {
|
|
118
131
|
perspectiveRemove(uuid: $uuid)
|
|
119
|
-
}`,variables:{uuid:e}}))}async addLink(e,r,n){let{perspectiveAddLink:
|
|
120
|
-
perspectiveAddLink(link: $link,
|
|
121
|
-
${
|
|
132
|
+
}`,variables:{uuid:e}}))}async addLink(e,r,n="shared",i){let{perspectiveAddLink:a}=I(await H(this,te,"f").mutate({mutation:E`mutation perspectiveAddLink($uuid: String!, $link: LinkInput!, $status: String!, $batchId: String) {
|
|
133
|
+
perspectiveAddLink(uuid: $uuid, link: $link, status: $status, batchId: $batchId) {
|
|
134
|
+
${ct}
|
|
122
135
|
}
|
|
123
|
-
}`,variables:{uuid:e,link:r,status:n}}));return
|
|
124
|
-
perspectiveAddLinks(links: $links,
|
|
125
|
-
${
|
|
136
|
+
}`,variables:{uuid:e,link:r,status:n,batchId:i}}));return a}async addLinks(e,r,n="shared",i){let{perspectiveAddLinks:a}=I(await H(this,te,"f").mutate({mutation:E`mutation perspectiveAddLinks($uuid: String!, $links: [LinkInput!]!, $status: String!, $batchId: String) {
|
|
137
|
+
perspectiveAddLinks(uuid: $uuid, links: $links, status: $status, batchId: $batchId) {
|
|
138
|
+
${ct}
|
|
126
139
|
}
|
|
127
|
-
}`,variables:{uuid:e,links:r,status:n}}));return
|
|
128
|
-
perspectiveRemoveLinks(links: $links,
|
|
129
|
-
${
|
|
140
|
+
}`,variables:{uuid:e,links:r,status:n,batchId:i}}));return a}async removeLinks(e,r,n){let{perspectiveRemoveLinks:i}=I(await H(this,te,"f").mutate({mutation:E`mutation perspectiveRemoveLinks($uuid: String!, $links: [LinkExpressionInput!]!, $batchId: String) {
|
|
141
|
+
perspectiveRemoveLinks(uuid: $uuid, links: $links, batchId: $batchId) {
|
|
142
|
+
${ct}
|
|
130
143
|
}
|
|
131
|
-
}`,variables:{uuid:e,links:r}}));return
|
|
144
|
+
}`,variables:{uuid:e,links:r,batchId:n}}));return i}async linkMutations(e,r,n){let{perspectiveLinkMutations:i}=I(await H(this,te,"f").mutate({mutation:E`mutation perspectiveLinkMutations($uuid: String!, $mutations: LinkMutations!, $status: String){
|
|
132
145
|
perspectiveLinkMutations(mutations: $mutations, uuid: $uuid, status: $status) {
|
|
133
146
|
additions {
|
|
134
|
-
${
|
|
147
|
+
${ct}
|
|
135
148
|
}
|
|
136
149
|
removals {
|
|
137
|
-
${
|
|
150
|
+
${ct}
|
|
138
151
|
}
|
|
139
152
|
}
|
|
140
|
-
}`,variables:{uuid:e,mutations:r,status:n}}));return i}async addLinkExpression(e,r,n){let{perspectiveAddLinkExpression:
|
|
141
|
-
perspectiveAddLinkExpression(link: $link,
|
|
142
|
-
${
|
|
143
|
-
}
|
|
144
|
-
}`,variables:{uuid:e,link:r}}));return
|
|
145
|
-
$uuid:
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
){
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
oldLink: $oldLink,
|
|
152
|
-
uuid: $uuid
|
|
153
|
-
) {
|
|
154
|
-
${ht}
|
|
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,T(await W(this,se,"f").mutate({mutation:E`mutation perspectiveRemoveLink($link: LinkExpressionInput!, $uuid: String!) {
|
|
157
|
-
perspectiveRemoveLink(link: $link, uuid: $uuid)
|
|
158
|
-
}`,variables:{uuid:e,link:r}}))}async addSdna(e,r,n,i){return T(await W(this,se,"f").mutate({mutation:E`mutation perspectiveAddSdna($uuid: String!, $name: String!, $sdnaCode: String!, $sdnaType: String!) {
|
|
153
|
+
}`,variables:{uuid:e,mutations:r,status:n}}));return i}async addLinkExpression(e,r,n="shared",i){let{perspectiveAddLinkExpression:a}=I(await H(this,te,"f").mutate({mutation:E`mutation perspectiveAddLinkExpression($uuid: String!, $link: LinkExpressionInput!, $status: String!, $batchId: String) {
|
|
154
|
+
perspectiveAddLinkExpression(uuid: $uuid, link: $link, status: $status, batchId: $batchId) {
|
|
155
|
+
${ct}
|
|
156
|
+
}
|
|
157
|
+
}`,variables:{uuid:e,link:r,status:n,batchId:i}}));return a}async updateLink(e,r,n,i){let{perspectiveUpdateLink:a}=I(await H(this,te,"f").mutate({mutation:E`mutation perspectiveUpdateLink($uuid: String!, $oldLink: LinkExpressionInput!, $newLink: LinkInput!, $batchId: String) {
|
|
158
|
+
perspectiveUpdateLink(uuid: $uuid, oldLink: $oldLink, newLink: $newLink, batchId: $batchId) {
|
|
159
|
+
${ct}
|
|
160
|
+
}
|
|
161
|
+
}`,variables:{uuid:e,oldLink:r,newLink:n,batchId:i}}));return a}async removeLink(e,r,n){delete r.__typename,delete r.data.__typename,delete r.proof.__typename,delete r.status;let{perspectiveRemoveLink:i}=I(await H(this,te,"f").mutate({mutation:E`mutation perspectiveRemoveLink($link: LinkExpressionInput!, $uuid: String!, $batchId: String) {
|
|
162
|
+
perspectiveRemoveLink(link: $link, uuid: $uuid, batchId: $batchId)
|
|
163
|
+
}`,variables:{uuid:e,link:r,batchId:n}}));return i}async addSdna(e,r,n,i){return I(await H(this,te,"f").mutate({mutation:E`mutation perspectiveAddSdna($uuid: String!, $name: String!, $sdnaCode: String!, $sdnaType: String!) {
|
|
159
164
|
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
|
|
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
|
|
163
|
-
perspectiveCreateSubject(uuid: $uuid, subjectClass: $subjectClass, expressionAddress: $expressionAddress)
|
|
164
|
-
}`,variables:{uuid:e,subjectClass:r,expressionAddress:n}})).perspectiveCreateSubject}async getSubjectData(e,r,n){return
|
|
165
|
+
}`,variables:{uuid:e,name:r,sdnaCode:n,sdnaType:i}})).perspectiveAddSdna}async executeCommands(e,r,n,i,a){return I(await H(this,te,"f").mutate({mutation:E`mutation perspectiveExecuteCommands($uuid: String!, $commands: String!, $expression: String!, $parameters: String, $batchId: String) {
|
|
166
|
+
perspectiveExecuteCommands(uuid: $uuid, commands: $commands, expression: $expression, parameters: $parameters, batchId: $batchId)
|
|
167
|
+
}`,variables:{uuid:e,commands:r,expression:n,parameters:i,batchId:a}})).perspectiveExecuteCommands}async createSubject(e,r,n,i,a){return I(await H(this,te,"f").mutate({mutation:E`mutation perspectiveCreateSubject($uuid: String!, $subjectClass: String!, $expressionAddress: String!, $initialValues: String, $batchId: String) {
|
|
168
|
+
perspectiveCreateSubject(uuid: $uuid, subjectClass: $subjectClass, expressionAddress: $expressionAddress, initialValues: $initialValues, batchId: $batchId)
|
|
169
|
+
}`,variables:{uuid:e,subjectClass:r,expressionAddress:n,initialValues:i,batchId:a}})).perspectiveCreateSubject}async getSubjectData(e,r,n){return I(await H(this,te,"f").mutate({mutation:E`mutation perspectiveGetSubjectData($uuid: String!, $subjectClass: String!, $expressionAddress: String!) {
|
|
165
170
|
perspectiveGetSubjectData(uuid: $uuid, subjectClass: $subjectClass, expressionAddress: $expressionAddress)
|
|
166
|
-
}`,variables:{uuid:e,subjectClass:r,expressionAddress:n}})).perspectiveGetSubjectData}async getExpression(e){return await
|
|
167
|
-
perspectiveAdded { ${
|
|
171
|
+
}`,variables:{uuid:e,subjectClass:r,expressionAddress:n}})).perspectiveGetSubjectData}async getExpression(e){return await H(this,Na,"f").get(e)}async createExpression(e,r){return await H(this,Na,"f").create(e,r)}addPerspectiveAddedListener(e){H(this,Ta,"f").push(e)}subscribePerspectiveAdded(){H(this,te,"f").subscribe({query:E` subscription {
|
|
172
|
+
perspectiveAdded { ${wi} }
|
|
168
173
|
}
|
|
169
|
-
`}).subscribe({next:e=>{
|
|
170
|
-
perspectiveUpdated { ${
|
|
174
|
+
`}).subscribe({next:e=>{H(this,Ta,"f").forEach(r=>{r(e.data.perspectiveAdded)})},error:e=>console.error(e)})}addPerspectiveUpdatedListener(e){H(this,Oa,"f").push(e)}subscribePerspectiveUpdated(){H(this,te,"f").subscribe({query:E` subscription {
|
|
175
|
+
perspectiveUpdated { ${wi} }
|
|
171
176
|
}
|
|
172
|
-
`}).subscribe({next:e=>{
|
|
177
|
+
`}).subscribe({next:e=>{H(this,Oa,"f").forEach(r=>{r(e.data.perspectiveUpdated)})},error:e=>console.error(e)})}addPerspectiveSyncedListener(e){H(this,Is,"f").push(e)}async addPerspectiveSyncStateChangeListener(e,r){H(this,te,"f").subscribe({query:E` subscription {
|
|
173
178
|
perspectiveSyncStateChange(uuid: "${e}")
|
|
174
179
|
}
|
|
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){
|
|
180
|
+
`}).subscribe({next:n=>{r.forEach(i=>{i(n.data.perspectiveSyncStateChange)})},error:n=>console.error(n)}),await new Promise(n=>setTimeout(n,500))}addPerspectiveRemovedListener(e){H(this,Da,"f").push(e)}subscribePerspectiveRemoved(){H(this,te,"f").subscribe({query:E` subscription {
|
|
176
181
|
perspectiveRemoved
|
|
177
182
|
}
|
|
178
|
-
`}).subscribe({next:e=>{
|
|
179
|
-
perspectiveLinkAdded(uuid: "${e}") { ${
|
|
183
|
+
`}).subscribe({next:e=>{H(this,Da,"f").forEach(r=>{r(e.data.perspectiveRemoved)})},error:e=>console.error(e)})}async addPerspectiveLinkAddedListener(e,r){H(this,te,"f").subscribe({query:E` subscription {
|
|
184
|
+
perspectiveLinkAdded(uuid: "${e}") { ${ct} }
|
|
180
185
|
}
|
|
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}") { ${
|
|
186
|
+
`}).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){H(this,te,"f").subscribe({query:E` subscription {
|
|
187
|
+
perspectiveLinkRemoved(uuid: "${e}") { ${ct} }
|
|
183
188
|
}
|
|
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){
|
|
189
|
+
`}).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){H(this,te,"f").subscribe({query:E` subscription {
|
|
185
190
|
perspectiveLinkUpdated(uuid: "${e}") {
|
|
186
191
|
oldLink {
|
|
187
|
-
${
|
|
192
|
+
${ct}
|
|
188
193
|
}
|
|
189
194
|
newLink {
|
|
190
|
-
${
|
|
195
|
+
${ct}
|
|
191
196
|
}
|
|
192
197
|
}
|
|
193
198
|
}
|
|
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
|
|
199
|
+
`}).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 bl(H(this,As,"f"),e)}async createBatch(e){let{perspectiveCreateBatch:r}=I(await H(this,te,"f").mutate({mutation:E`mutation perspectiveCreateBatch($uuid: String!) {
|
|
200
|
+
perspectiveCreateBatch(uuid: $uuid)
|
|
201
|
+
}`,variables:{uuid:e}}));return r}async commitBatch(e,r){let{perspectiveCommitBatch:n}=I(await H(this,te,"f").mutate({mutation:E`mutation perspectiveCommitBatch($uuid: String!, $batchId: String!) {
|
|
202
|
+
perspectiveCommitBatch(uuid: $uuid, batchId: $batchId) {
|
|
203
|
+
additions {
|
|
204
|
+
${ct}
|
|
205
|
+
}
|
|
206
|
+
removals {
|
|
207
|
+
${ct}
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}`,variables:{uuid:e,batchId:r}}));return n}};te=new WeakMap,Ta=new WeakMap,Oa=new WeakMap,Da=new WeakMap,Is=new WeakMap,Na=new WeakMap,As=new WeakMap,Ts=new WeakMap;var us=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},ce=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)},me,Pa,Ra,$a,_a=`
|
|
195
211
|
did
|
|
196
212
|
directMessageLanguage
|
|
197
213
|
perspective {
|
|
@@ -205,7 +221,7 @@ neighbourhood {
|
|
|
205
221
|
}
|
|
206
222
|
}
|
|
207
223
|
}
|
|
208
|
-
`,
|
|
224
|
+
`,ls=`
|
|
209
225
|
requestId
|
|
210
226
|
revoked
|
|
211
227
|
auth {
|
|
@@ -221,128 +237,128 @@ neighbourhood {
|
|
|
221
237
|
can
|
|
222
238
|
}
|
|
223
239
|
}
|
|
224
|
-
`,
|
|
240
|
+
`,Si=`
|
|
225
241
|
isInitialized
|
|
226
242
|
isUnlocked
|
|
227
243
|
did
|
|
228
244
|
didDocument
|
|
229
245
|
error
|
|
230
|
-
`,
|
|
246
|
+
`,ps=`
|
|
231
247
|
did
|
|
232
248
|
didSigningKeyId
|
|
233
249
|
deviceKeyType
|
|
234
250
|
deviceKey
|
|
235
251
|
deviceKeySignedByDid
|
|
236
252
|
didSignedByDeviceKey
|
|
237
|
-
`,
|
|
253
|
+
`,c0=`
|
|
238
254
|
signature
|
|
239
255
|
publicKey
|
|
240
|
-
`,
|
|
256
|
+
`,Ja=class{constructor(e,r=!0){me.set(this,void 0),Pa.set(this,void 0),Ra.set(this,void 0),$a.set(this,void 0),us(this,me,e,"f"),us(this,Ra,[],"f"),us(this,$a,[],"f"),us(this,Pa,[],"f"),r&&(this.subscribeAgentUpdated(),this.subscribeAgentStatusChanged(),this.subscribeAppsChanged())}async me(){let{agent:e}=I(await ce(this,me,"f").query({query:E`query agent { agent { ${_a} } }`})),r=new Wr(e.did,e.perspective);return r.directMessageLanguage=e.directMessageLanguage,r}async status(){let{agentStatus:e}=I(await ce(this,me,"f").query({query:E`query agentStatus {
|
|
241
257
|
agentStatus {
|
|
242
|
-
${
|
|
258
|
+
${Si}
|
|
243
259
|
}
|
|
244
|
-
}`}));return new
|
|
260
|
+
}`}));return new Lt(e)}async generate(e){let{agentGenerate:r}=I(await ce(this,me,"f").mutate({mutation:E`mutation agentGenerate(
|
|
245
261
|
$passphrase: String!
|
|
246
262
|
) {
|
|
247
263
|
agentGenerate(passphrase: $passphrase) {
|
|
248
|
-
${
|
|
264
|
+
${Si}
|
|
249
265
|
}
|
|
250
|
-
}`,variables:{passphrase:e}}));return new
|
|
266
|
+
}`,variables:{passphrase:e}}));return new Lt(r)}async import(e){let{did:r,didDocument:n,keystore:i,passphrase:a}=e,{agentImport:o}=I(await ce(this,me,"f").mutate({mutation:E`mutation agentImport(
|
|
251
267
|
$did: String!,
|
|
252
268
|
$didDocument: String!,
|
|
253
269
|
$keystore: String!,
|
|
254
270
|
$passphrase: String!
|
|
255
271
|
) {
|
|
256
272
|
agentImport(did: $did, didDocument: $didDocument, keystore: $keystore, passphrase: $passphrase) {
|
|
257
|
-
${
|
|
273
|
+
${Si}
|
|
258
274
|
}
|
|
259
|
-
}`,variables:{did:r,didDocument:n,keystore:i,passphrase:a}}));return new
|
|
275
|
+
}`,variables:{did:r,didDocument:n,keystore:i,passphrase:a}}));return new Lt(o)}async lock(e){let{agentLock:r}=I(await ce(this,me,"f").mutate({mutation:E`mutation agentLock($passphrase: String!) {
|
|
260
276
|
agentLock(passphrase: $passphrase) {
|
|
261
|
-
${
|
|
277
|
+
${Si}
|
|
262
278
|
}
|
|
263
|
-
}`,variables:{passphrase:e}}));return new
|
|
279
|
+
}`,variables:{passphrase:e}}));return new Lt(r)}async unlock(e,r=!0){let{agentUnlock:n}=I(await ce(this,me,"f").mutate({mutation:E`mutation agentUnlock($passphrase: String!, $holochain: Boolean!) {
|
|
264
280
|
agentUnlock(passphrase: $passphrase, holochain: $holochain) {
|
|
265
|
-
${
|
|
281
|
+
${Si}
|
|
266
282
|
}
|
|
267
|
-
}`,variables:{passphrase:e,holochain:r}}));return new
|
|
283
|
+
}`,variables:{passphrase:e,holochain:r}}));return new Lt(n)}async byDID(e){let{agentByDID:r}=I(await ce(this,me,"f").query({query:E`query agentByDID($did: String!) {
|
|
268
284
|
agentByDID(did: $did) {
|
|
269
|
-
${
|
|
285
|
+
${_a}
|
|
270
286
|
}
|
|
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}=
|
|
287
|
+
}`,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}=I(await ce(this,me,"f").mutate({mutation:E`mutation agentUpdatePublicPerspective($perspective: PerspectiveInput!) {
|
|
272
288
|
agentUpdatePublicPerspective(perspective: $perspective) {
|
|
273
|
-
${
|
|
289
|
+
${_a}
|
|
274
290
|
}
|
|
275
|
-
}`,variables:{perspective:r}})),i=n,a=new
|
|
291
|
+
}`,variables:{perspective:r}})),i=n,a=new Wr(i.did,i.perspective);return a.directMessageLanguage=i.directMessageLanguage,a}async mutatePublicPerspective(e){let r=new Ws(ce(this,me,"f")),n=new Ja(ce(this,me,"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}=I(await ce(this,me,"f").mutate({mutation:E`mutation agentUpdateDirectMessageLanguage($directMessageLanguage: String!) {
|
|
276
292
|
agentUpdateDirectMessageLanguage(directMessageLanguage: $directMessageLanguage) {
|
|
277
|
-
${
|
|
293
|
+
${_a}
|
|
278
294
|
}
|
|
279
|
-
}`,variables:{directMessageLanguage:e}})),n=r,i=new
|
|
295
|
+
}`,variables:{directMessageLanguage:e}})),n=r,i=new Wr(n.did,n.perspective);return i.directMessageLanguage=n.directMessageLanguage,i}async addEntanglementProofs(e){let{agentAddEntanglementProofs:r}=I(await ce(this,me,"f").mutate({mutation:E`mutation agentAddEntanglementProofs($proofs: [EntanglementProofInput!]!) {
|
|
280
296
|
agentAddEntanglementProofs(proofs: $proofs) {
|
|
281
|
-
${
|
|
297
|
+
${ps}
|
|
282
298
|
}
|
|
283
|
-
}`,variables:{proofs:e}}));return r}async deleteEntanglementProofs(e){let{agentDeleteEntanglementProofs:r}=
|
|
299
|
+
}`,variables:{proofs:e}}));return r}async deleteEntanglementProofs(e){let{agentDeleteEntanglementProofs:r}=I(await ce(this,me,"f").mutate({mutation:E`mutation agentDeleteEntanglementProofs($proofs: [EntanglementProofInput!]!) {
|
|
284
300
|
agentDeleteEntanglementProofs(proofs: $proofs) {
|
|
285
|
-
${
|
|
301
|
+
${ps}
|
|
286
302
|
}
|
|
287
|
-
}`,variables:{proofs:e}}));return r}async getEntanglementProofs(){let{agentGetEntanglementProofs:e}=
|
|
303
|
+
}`,variables:{proofs:e}}));return r}async getEntanglementProofs(){let{agentGetEntanglementProofs:e}=I(await ce(this,me,"f").query({query:E`query agentGetEntanglementProofs {
|
|
288
304
|
agentGetEntanglementProofs {
|
|
289
|
-
${
|
|
305
|
+
${ps}
|
|
290
306
|
}
|
|
291
|
-
}`}));return e}async entanglementProofPreFlight(e,r){let{agentEntanglementProofPreFlight:n}=
|
|
307
|
+
}`}));return e}async entanglementProofPreFlight(e,r){let{agentEntanglementProofPreFlight:n}=I(await ce(this,me,"f").mutate({mutation:E`mutation agentEntanglementProofPreFlight($deviceKey: String!, $deviceKeyType: String!) {
|
|
292
308
|
agentEntanglementProofPreFlight(deviceKey: $deviceKey, deviceKeyType: $deviceKeyType) {
|
|
293
|
-
${
|
|
309
|
+
${ps}
|
|
294
310
|
}
|
|
295
|
-
}`,variables:{deviceKey:e,deviceKeyType:r}}));return n}addUpdatedListener(e){
|
|
296
|
-
agentUpdated { ${
|
|
311
|
+
}`,variables:{deviceKey:e,deviceKeyType:r}}));return n}addUpdatedListener(e){ce(this,Ra,"f").push(e)}addAppChangedListener(e){ce(this,Pa,"f").push(e)}subscribeAgentUpdated(){ce(this,me,"f").subscribe({query:E` subscription {
|
|
312
|
+
agentUpdated { ${_a} }
|
|
297
313
|
}
|
|
298
|
-
`}).subscribe({next:e=>{let r=e.data.agentUpdated;
|
|
314
|
+
`}).subscribe({next:e=>{let r=e.data.agentUpdated;ce(this,Ra,"f").forEach(n=>{n(r)})},error:e=>console.error(e)})}subscribeAppsChanged(){ce(this,me,"f").subscribe({query:E` subscription {
|
|
299
315
|
agentAppsChanged {
|
|
300
|
-
${
|
|
316
|
+
${ls}
|
|
301
317
|
}
|
|
302
318
|
}
|
|
303
|
-
`}).subscribe({next:e=>{
|
|
304
|
-
agentStatusChanged { ${
|
|
319
|
+
`}).subscribe({next:e=>{ce(this,Pa,"f").forEach(r=>{r()})},error:e=>console.error(e)})}addAgentStatusChangedListener(e){ce(this,$a,"f").push(e)}subscribeAgentStatusChanged(){ce(this,me,"f").subscribe({query:E` subscription {
|
|
320
|
+
agentStatusChanged { ${Si} }
|
|
305
321
|
}
|
|
306
|
-
`}).subscribe({next:e=>{let r=e.data.agentStatusChanged;
|
|
322
|
+
`}).subscribe({next:e=>{let r=e.data.agentStatusChanged;ce(this,$a,"f").forEach(n=>{n(r)})},error:e=>console.error(e)})}async requestCapability(e){let{agentRequestCapability:r}=I(await ce(this,me,"f").mutate({mutation:E`
|
|
307
323
|
mutation agentRequestCapability($authInfo: AuthInfoInput!) {
|
|
308
324
|
agentRequestCapability(authInfo: $authInfo)
|
|
309
325
|
}
|
|
310
|
-
`,variables:{authInfo:e}}));return r}async permitCapability(e){let{agentPermitCapability:r}=
|
|
326
|
+
`,variables:{authInfo:e}}));return r}async permitCapability(e){let{agentPermitCapability:r}=I(await ce(this,me,"f").mutate({mutation:E`
|
|
311
327
|
mutation agentPermitCapability($auth: String!) {
|
|
312
328
|
agentPermitCapability(auth: $auth)
|
|
313
329
|
}
|
|
314
|
-
`,variables:{auth:e}}));return r}async generateJwt(e,r){let{agentGenerateJwt:n}=
|
|
330
|
+
`,variables:{auth:e}}));return r}async generateJwt(e,r){let{agentGenerateJwt:n}=I(await ce(this,me,"f").mutate({mutation:E`
|
|
315
331
|
mutation agentGenerateJwt($requestId: String!, $rand: String!) {
|
|
316
332
|
agentGenerateJwt(requestId: $requestId, rand: $rand)
|
|
317
333
|
}
|
|
318
|
-
`,variables:{requestId:e,rand:r}}));return n}async getApps(){let{agentGetApps:e}=
|
|
334
|
+
`,variables:{requestId:e,rand:r}}));return n}async getApps(){let{agentGetApps:e}=I(await ce(this,me,"f").mutate({mutation:E`query agentGetApps {
|
|
319
335
|
agentGetApps {
|
|
320
|
-
${
|
|
336
|
+
${ls}
|
|
321
337
|
}
|
|
322
|
-
}`}));return e}async removeApp(e){let{agentRemoveApp:r}=
|
|
338
|
+
}`}));return e}async removeApp(e){let{agentRemoveApp:r}=I(await ce(this,me,"f").mutate({mutation:E`mutation agentRemoveApp($requestId: String!) {
|
|
323
339
|
agentRemoveApp(requestId: $requestId) {
|
|
324
|
-
${
|
|
340
|
+
${ls}
|
|
325
341
|
}
|
|
326
|
-
}`,variables:{requestId:e}}));return r}async revokeToken(e){let{agentRevokeToken:r}=
|
|
342
|
+
}`,variables:{requestId:e}}));return r}async revokeToken(e){let{agentRevokeToken:r}=I(await ce(this,me,"f").mutate({mutation:E`mutation agentRevokeToken($requestId: String!) {
|
|
327
343
|
agentRevokeToken(requestId: $requestId) {
|
|
328
|
-
${
|
|
344
|
+
${ls}
|
|
329
345
|
}
|
|
330
|
-
}`,variables:{requestId:e}}));return r}async isLocked(){let{agentIsLocked:e}=
|
|
346
|
+
}`,variables:{requestId:e}}));return r}async isLocked(){let{agentIsLocked:e}=I(await ce(this,me,"f").mutate({mutation:E`
|
|
331
347
|
query agentIsLocked {
|
|
332
348
|
agentIsLocked
|
|
333
349
|
}
|
|
334
|
-
`}));return e}async signMessage(e){let{agentSignMessage:r}=
|
|
350
|
+
`}));return e}async signMessage(e){let{agentSignMessage:r}=I(await ce(this,me,"f").mutate({mutation:E`mutation agentSignMessage($message: String!) {
|
|
335
351
|
agentSignMessage(message: $message) {
|
|
336
|
-
${
|
|
352
|
+
${c0}
|
|
337
353
|
}
|
|
338
|
-
}`,variables:{message:e}}));return r}};
|
|
354
|
+
}`,variables:{message:e}}));return r}};me=new WeakMap,Pa=new WeakMap,Ra=new WeakMap,$a=new WeakMap;var u0=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},qr=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,zd=`
|
|
339
355
|
name
|
|
340
356
|
address
|
|
341
357
|
settings
|
|
342
358
|
icon { code }
|
|
343
359
|
constructorIcon { code }
|
|
344
360
|
settingsIcon { code }
|
|
345
|
-
`,
|
|
361
|
+
`,Gd=`
|
|
346
362
|
name
|
|
347
363
|
address
|
|
348
364
|
description
|
|
@@ -352,45 +368,45 @@ neighbourhood {
|
|
|
352
368
|
templateAppliedParams
|
|
353
369
|
possibleTemplateParams
|
|
354
370
|
sourceCodeLink
|
|
355
|
-
`,
|
|
371
|
+
`,Sl=class{constructor(e){zt.set(this,void 0),u0(this,zt,e,"f")}async byAddress(e){let{language:r}=I(await qr(this,zt,"f").query({query:E`query byAddress($address: String!) {
|
|
356
372
|
language(address: $address) {
|
|
357
|
-
${
|
|
373
|
+
${zd}
|
|
358
374
|
}
|
|
359
|
-
}`,variables:{address:e}}));return r}async byFilter(e){let{languages:r}=
|
|
375
|
+
}`,variables:{address:e}}));return r}async byFilter(e){let{languages:r}=I(await qr(this,zt,"f").query({query:E`query byFilter($filter: String!) {
|
|
360
376
|
languages(filter: $filter) {
|
|
361
|
-
${
|
|
377
|
+
${zd}
|
|
362
378
|
}
|
|
363
|
-
}`,variables:{filter:e}}));return r}async all(){return this.byFilter("")}async writeSettings(e,r){let{languageWriteSettings:n}=
|
|
379
|
+
}`,variables:{filter:e}}));return r}async all(){return this.byFilter("")}async writeSettings(e,r){let{languageWriteSettings:n}=I(await qr(this,zt,"f").mutate({mutation:E`mutation writeSettings($languageAddress: String!, $settings: String!) {
|
|
364
380
|
languageWriteSettings(languageAddress: $languageAddress, settings: $settings)
|
|
365
|
-
}`,variables:{languageAddress:e,settings:r}}));return n}async applyTemplateAndPublish(e,r){let{languageApplyTemplateAndPublish:n}=
|
|
381
|
+
}`,variables:{languageAddress:e,settings:r}}));return n}async applyTemplateAndPublish(e,r){let{languageApplyTemplateAndPublish:n}=I(await qr(this,zt,"f").mutate({mutation:E`mutation languageApplyTemplateAndPublish(
|
|
366
382
|
$sourceLanguageHash: String!,
|
|
367
383
|
$templateData: String!,
|
|
368
384
|
) {
|
|
369
385
|
languageApplyTemplateAndPublish(sourceLanguageHash: $sourceLanguageHash, templateData: $templateData) {
|
|
370
386
|
name, address
|
|
371
387
|
}
|
|
372
|
-
}`,variables:{sourceLanguageHash:e,templateData:r}}));return n}async publish(e,r){let{languagePublish:n}=
|
|
388
|
+
}`,variables:{sourceLanguageHash:e,templateData:r}}));return n}async publish(e,r){let{languagePublish:n}=I(await qr(this,zt,"f").mutate({mutation:E`mutation languagePublish(
|
|
373
389
|
$languagePath: String!,
|
|
374
390
|
$languageMeta: LanguageMetaInput!,
|
|
375
391
|
) {
|
|
376
392
|
languagePublish(languagePath: $languagePath, languageMeta: $languageMeta) {
|
|
377
|
-
${
|
|
393
|
+
${Gd}
|
|
378
394
|
}
|
|
379
|
-
}`,variables:{languagePath:e,languageMeta:r}}));return n}async meta(e){let{languageMeta:r}=
|
|
395
|
+
}`,variables:{languagePath:e,languageMeta:r}}));return n}async meta(e){let{languageMeta:r}=I(await qr(this,zt,"f").query({query:E`query languageMeta(
|
|
380
396
|
$address: String!,
|
|
381
397
|
) {
|
|
382
398
|
languageMeta(address: $address) {
|
|
383
|
-
${
|
|
399
|
+
${Gd}
|
|
384
400
|
}
|
|
385
|
-
}`,variables:{address:e}}));return r}async source(e){let{languageSource:r}=
|
|
401
|
+
}`,variables:{address:e}}));return r}async source(e){let{languageSource:r}=I(await qr(this,zt,"f").query({query:E`query languageSource(
|
|
386
402
|
$address: String!,
|
|
387
403
|
) {
|
|
388
404
|
languageSource(address: $address)
|
|
389
|
-
}`,variables:{address:e}}));return r}async remove(e){let{languageRemove:r}=
|
|
405
|
+
}`,variables:{address:e}}));return r}async remove(e){let{languageRemove:r}=I(await qr(this,zt,"f").mutate({mutation:E`mutation languageRemove(
|
|
390
406
|
$address: String!,
|
|
391
407
|
) {
|
|
392
408
|
languageRemove(address: $address)
|
|
393
|
-
}`,variables:{address:e}}));return r}};
|
|
409
|
+
}`,variables:{address:e}}));return r}};zt=new WeakMap;var l0=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},it=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},pt,Ti,Cl=class{constructor(e){pt.set(this,void 0),Ti.set(this,new Map),l0(this,pt,e,"f")}async publishFromPerspective(e,r,n){let{neighbourhoodPublishFromPerspective:i}=I(await it(this,pt,"f").mutate({mutation:E`mutation neighbourhoodPublishFromPerspective(
|
|
394
410
|
$linkLanguage: String!,
|
|
395
411
|
$meta: PerspectiveInput!,
|
|
396
412
|
$perspectiveUUID: String!
|
|
@@ -400,7 +416,7 @@ neighbourhood {
|
|
|
400
416
|
meta: $meta,
|
|
401
417
|
perspectiveUUID: $perspectiveUUID
|
|
402
418
|
)
|
|
403
|
-
}`,variables:{perspectiveUUID:e,linkLanguage:r,meta:n}}));return i}async joinFromUrl(e){let{neighbourhoodJoinFromUrl:r}=
|
|
419
|
+
}`,variables:{perspectiveUUID:e,linkLanguage:r,meta:n}}));return i}async joinFromUrl(e){let{neighbourhoodJoinFromUrl:r}=I(await it(this,pt,"f").mutate({mutation:E`mutation neighbourhoodJoinFromUrl($url: String!) {
|
|
404
420
|
neighbourhoodJoinFromUrl(url: $url) {
|
|
405
421
|
uuid
|
|
406
422
|
name
|
|
@@ -422,11 +438,11 @@ neighbourhood {
|
|
|
422
438
|
author
|
|
423
439
|
}
|
|
424
440
|
}
|
|
425
|
-
}`,variables:{url:e}}));return r}async otherAgents(e){let{neighbourhoodOtherAgents:r}=
|
|
441
|
+
}`,variables:{url:e}}));return r}async otherAgents(e){let{neighbourhoodOtherAgents:r}=I(await it(this,pt,"f").query({query:E`query neighbourhoodOtherAgents($perspectiveUUID: String!) {
|
|
426
442
|
neighbourhoodOtherAgents(perspectiveUUID: $perspectiveUUID)
|
|
427
|
-
}`,variables:{perspectiveUUID:e}}));return r}async hasTelepresenceAdapter(e){let{neighbourhoodHasTelepresenceAdapter:r}=
|
|
443
|
+
}`,variables:{perspectiveUUID:e}}));return r}async hasTelepresenceAdapter(e){let{neighbourhoodHasTelepresenceAdapter:r}=I(await it(this,pt,"f").query({query:E`query neighbourhoodHasTelepresenceAdapter($perspectiveUUID: String!) {
|
|
428
444
|
neighbourhoodHasTelepresenceAdapter(perspectiveUUID: $perspectiveUUID)
|
|
429
|
-
}`,variables:{perspectiveUUID:e}}));return r}async onlineAgents(e){let{neighbourhoodOnlineAgents:r}=
|
|
445
|
+
}`,variables:{perspectiveUUID:e}}));return r}async onlineAgents(e){let{neighbourhoodOnlineAgents:r}=I(await it(this,pt,"f").query({query:E`query neighbourhoodOnlineAgents($perspectiveUUID: String!) {
|
|
430
446
|
neighbourhoodOnlineAgents(perspectiveUUID: $perspectiveUUID) {
|
|
431
447
|
did
|
|
432
448
|
status {
|
|
@@ -443,7 +459,7 @@ neighbourhood {
|
|
|
443
459
|
proof { valid, invalid, signature, key }
|
|
444
460
|
}
|
|
445
461
|
}
|
|
446
|
-
}`,variables:{perspectiveUUID:e}}));return r}async setOnlineStatus(e,r){let{neighbourhoodSetOnlineStatus:n}=
|
|
462
|
+
}`,variables:{perspectiveUUID:e}}));return r}async setOnlineStatus(e,r){let{neighbourhoodSetOnlineStatus:n}=I(await it(this,pt,"f").mutate({mutation:E`mutation neighbourhoodSetOnlineStatus(
|
|
447
463
|
$perspectiveUUID: String!,
|
|
448
464
|
$status: PerspectiveInput!
|
|
449
465
|
) {
|
|
@@ -451,7 +467,7 @@ neighbourhood {
|
|
|
451
467
|
perspectiveUUID: $perspectiveUUID,
|
|
452
468
|
status: $status
|
|
453
469
|
)
|
|
454
|
-
}`,variables:{perspectiveUUID:e,status:r}}));return n}async setOnlineStatusU(e,r){let{neighbourhoodSetOnlineStatusU:n}=
|
|
470
|
+
}`,variables:{perspectiveUUID:e,status:r}}));return n}async setOnlineStatusU(e,r){let{neighbourhoodSetOnlineStatusU:n}=I(await it(this,pt,"f").mutate({mutation:E`mutation neighbourhoodSetOnlineStatusU(
|
|
455
471
|
$perspectiveUUID: String!,
|
|
456
472
|
$status: PerspectiveUnsignedInput!
|
|
457
473
|
) {
|
|
@@ -459,7 +475,7 @@ neighbourhood {
|
|
|
459
475
|
perspectiveUUID: $perspectiveUUID,
|
|
460
476
|
status: $status
|
|
461
477
|
)
|
|
462
|
-
}`,variables:{perspectiveUUID:e,status:r}}));return n}async sendSignal(e,r,n){let{neighbourhoodSendSignal:i}=
|
|
478
|
+
}`,variables:{perspectiveUUID:e,status:r}}));return n}async sendSignal(e,r,n){let{neighbourhoodSendSignal:i}=I(await it(this,pt,"f").mutate({mutation:E`mutation neighbourhoodSendSignal(
|
|
463
479
|
$perspectiveUUID: String!,
|
|
464
480
|
$remoteAgentDid: String!,
|
|
465
481
|
$payload: PerspectiveInput!
|
|
@@ -469,7 +485,7 @@ neighbourhood {
|
|
|
469
485
|
remoteAgentDid: $remoteAgentDid,
|
|
470
486
|
payload: $payload
|
|
471
487
|
)
|
|
472
|
-
}`,variables:{perspectiveUUID:e,remoteAgentDid:r,payload:n}}));return i}async sendSignalU(e,r,n){let{neighbourhoodSendSignalU:i}=
|
|
488
|
+
}`,variables:{perspectiveUUID:e,remoteAgentDid:r,payload:n}}));return i}async sendSignalU(e,r,n){let{neighbourhoodSendSignalU:i}=I(await it(this,pt,"f").mutate({mutation:E`mutation neighbourhoodSendSignalU(
|
|
473
489
|
$perspectiveUUID: String!,
|
|
474
490
|
$remoteAgentDid: String!,
|
|
475
491
|
$payload: PerspectiveUnsignedInput!
|
|
@@ -479,23 +495,27 @@ neighbourhood {
|
|
|
479
495
|
remoteAgentDid: $remoteAgentDid,
|
|
480
496
|
payload: $payload
|
|
481
497
|
)
|
|
482
|
-
}`,variables:{perspectiveUUID:e,remoteAgentDid:r,payload:n}}));return i}async sendBroadcast(e,r){let{neighbourhoodSendBroadcast:
|
|
498
|
+
}`,variables:{perspectiveUUID:e,remoteAgentDid:r,payload:n}}));return i}async sendBroadcast(e,r,n=!1){let{neighbourhoodSendBroadcast:i}=I(await it(this,pt,"f").mutate({mutation:E`mutation neighbourhoodSendBroadcast(
|
|
483
499
|
$perspectiveUUID: String!,
|
|
484
|
-
$payload: PerspectiveInput
|
|
500
|
+
$payload: PerspectiveInput!,
|
|
501
|
+
$loopback: Boolean
|
|
485
502
|
) {
|
|
486
503
|
neighbourhoodSendBroadcast(
|
|
487
504
|
perspectiveUUID: $perspectiveUUID,
|
|
488
|
-
payload: $payload
|
|
505
|
+
payload: $payload,
|
|
506
|
+
loopback: $loopback
|
|
489
507
|
)
|
|
490
|
-
}`,variables:{perspectiveUUID:e,payload:r}}));return
|
|
508
|
+
}`,variables:{perspectiveUUID:e,payload:r,loopback:n}}));return i}async sendBroadcastU(e,r,n=!1){let{neighbourhoodSendBroadcastU:i}=I(await it(this,pt,"f").mutate({mutation:E`mutation neighbourhoodSendBroadcastU(
|
|
491
509
|
$perspectiveUUID: String!,
|
|
492
|
-
$payload: PerspectiveUnsignedInput
|
|
510
|
+
$payload: PerspectiveUnsignedInput!,
|
|
511
|
+
$loopback: Boolean
|
|
493
512
|
) {
|
|
494
513
|
neighbourhoodSendBroadcastU(
|
|
495
514
|
perspectiveUUID: $perspectiveUUID,
|
|
496
|
-
payload: $payload
|
|
515
|
+
payload: $payload,
|
|
516
|
+
loopback: $loopback
|
|
497
517
|
)
|
|
498
|
-
}`,variables:{perspectiveUUID:e,payload:r}}));return
|
|
518
|
+
}`,variables:{perspectiveUUID:e,payload:r,loopback:n}}));return i}dispatchSignal(e,r){let n=it(this,Ti,"f").get(e);n&&n.forEach(i=>i(r))}async subscribeToSignals(e){let r=this;await it(this,pt,"f").subscribe({query:E`subscription neighbourhoodSignal($perspectiveUUID: String!) {
|
|
499
519
|
neighbourhoodSignal(perspectiveUUID: $perspectiveUUID) {
|
|
500
520
|
author
|
|
501
521
|
timestamp
|
|
@@ -510,7 +530,7 @@ neighbourhood {
|
|
|
510
530
|
}
|
|
511
531
|
proof { valid, invalid, signature, key }
|
|
512
532
|
}
|
|
513
|
-
}`,variables:{perspectiveUUID:e}}).subscribe({next:n=>{let{neighbourhoodSignal:i}=
|
|
533
|
+
}`,variables:{perspectiveUUID:e}}).subscribe({next:n=>{let{neighbourhoodSignal:i}=I(n);r.dispatchSignal(e,i)}})}async addSignalHandler(e,r){let n=it(this,Ti,"f").get(e);n||(n=[],it(this,Ti,"f").set(e,n),await this.subscribeToSignals(e)),n.push(r)}removeSignalHandler(e,r){let n=it(this,Ti,"f").get(e);if(n){let i=n.indexOf(r);i>-1&&n.splice(i,1)}}};pt=new WeakMap,Ti=new WeakMap;var fs=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)},X,La,Fa,Ma,l1,ds=`
|
|
514
534
|
author
|
|
515
535
|
timestamp
|
|
516
536
|
data {
|
|
@@ -522,7 +542,7 @@ data {
|
|
|
522
542
|
}
|
|
523
543
|
}
|
|
524
544
|
proof { valid, invalid, signature, key }
|
|
525
|
-
`,
|
|
545
|
+
`,p0=`
|
|
526
546
|
description
|
|
527
547
|
appName
|
|
528
548
|
appUrl
|
|
@@ -531,85 +551,109 @@ trigger
|
|
|
531
551
|
perspectiveIds
|
|
532
552
|
webhookUrl
|
|
533
553
|
webhookAuth
|
|
534
|
-
`,
|
|
554
|
+
`,p1=`
|
|
535
555
|
id
|
|
536
556
|
granted
|
|
537
|
-
${
|
|
538
|
-
`,
|
|
539
|
-
notification { ${
|
|
557
|
+
${p0}
|
|
558
|
+
`,f0=`
|
|
559
|
+
notification { ${p1} }
|
|
540
560
|
perspectiveId
|
|
541
561
|
triggerMatch
|
|
542
|
-
`,
|
|
562
|
+
`,xl=class{constructor(e,r=!0){X.set(this,void 0),La.set(this,void 0),Fa.set(this,void 0),Ma.set(this,void 0),l1.set(this,void 0),fs(this,X,e,"f"),fs(this,La,[],"f"),fs(this,Fa,[],"f"),fs(this,Ma,[],"f"),r&&(this.subscribeMessageReceived(),this.subscribeExceptionOccurred(),this.subscribeNotificationTriggered())}async info(){let{runtimeInfo:e}=I(await K(this,X,"f").query({query:E`query runtimeInfo {
|
|
543
563
|
runtimeInfo {
|
|
544
564
|
ad4mExecutorVersion,
|
|
545
565
|
isInitialized,
|
|
546
566
|
isUnlocked
|
|
547
567
|
}
|
|
548
|
-
}`}));return e}async quit(){return
|
|
568
|
+
}`}));return e}async quit(){return I(await K(this,X,"f").mutate({mutation:E`mutation runtimeQuit { runtimeQuit }`})).runtimeQuit}async openLink(e){let{runtimeOpenLink:r}=I(await K(this,X,"f").mutate({mutation:E`mutation runtimeOpenLink($url: String!) {
|
|
549
569
|
runtimeOpenLink(url: $url)
|
|
550
|
-
}`,variables:{url:e}}));return r}async addTrustedAgents(e){let{addTrustedAgents:r}=
|
|
570
|
+
}`,variables:{url:e}}));return r}async addTrustedAgents(e){let{addTrustedAgents:r}=I(await K(this,X,"f").mutate({mutation:E`mutation addTrustedAgents($agents: [String!]!) {
|
|
551
571
|
addTrustedAgents(agents: $agents)
|
|
552
|
-
}`,variables:{agents:e}}));return r}async deleteTrustedAgents(e){let{deleteTrustedAgents:r}=
|
|
572
|
+
}`,variables:{agents:e}}));return r}async deleteTrustedAgents(e){let{deleteTrustedAgents:r}=I(await K(this,X,"f").mutate({mutation:E`mutation deleteTrustedAgents($agents: [String!]!) {
|
|
553
573
|
deleteTrustedAgents(agents: $agents)
|
|
554
|
-
}`,variables:{agents:e}}));return r}async getTrustedAgents(){let{getTrustedAgents:e}=
|
|
574
|
+
}`,variables:{agents:e}}));return r}async getTrustedAgents(){let{getTrustedAgents:e}=I(await K(this,X,"f").query({query:E`query getTrustedAgents {
|
|
555
575
|
getTrustedAgents
|
|
556
|
-
}`}));return e}async addKnownLinkLanguageTemplates(e){let{runtimeAddKnownLinkLanguageTemplates:r}=
|
|
576
|
+
}`}));return e}async addKnownLinkLanguageTemplates(e){let{runtimeAddKnownLinkLanguageTemplates:r}=I(await K(this,X,"f").mutate({mutation:E`mutation runtimeAddKnownLinkLanguageTemplates($addresses: [String!]!) {
|
|
557
577
|
runtimeAddKnownLinkLanguageTemplates(addresses: $addresses)
|
|
558
|
-
}`,variables:{addresses:e}}));return r}async removeKnownLinkLanguageTemplates(e){let{runtimeRemoveKnownLinkLanguageTemplates:r}=
|
|
578
|
+
}`,variables:{addresses:e}}));return r}async removeKnownLinkLanguageTemplates(e){let{runtimeRemoveKnownLinkLanguageTemplates:r}=I(await K(this,X,"f").mutate({mutation:E`mutation runtimeRemoveKnownLinkLanguageTemplates($addresses: [String!]!) {
|
|
559
579
|
runtimeRemoveKnownLinkLanguageTemplates(addresses: $addresses)
|
|
560
|
-
}`,variables:{addresses:e}}));return r}async knownLinkLanguageTemplates(){let{runtimeKnownLinkLanguageTemplates:e}=
|
|
580
|
+
}`,variables:{addresses:e}}));return r}async knownLinkLanguageTemplates(){let{runtimeKnownLinkLanguageTemplates:e}=I(await K(this,X,"f").query({query:E`query runtimeKnownLinkLanguageTemplates {
|
|
561
581
|
runtimeKnownLinkLanguageTemplates
|
|
562
|
-
}`}));return e}async addFriends(e){let{runtimeAddFriends:r}=
|
|
582
|
+
}`}));return e}async addFriends(e){let{runtimeAddFriends:r}=I(await K(this,X,"f").mutate({mutation:E`mutation runtimeAddFriends($dids: [String!]!) {
|
|
563
583
|
runtimeAddFriends(dids: $dids)
|
|
564
|
-
}`,variables:{dids:e}}));return r}async removeFriends(e){let{runtimeRemoveFriends:r}=
|
|
584
|
+
}`,variables:{dids:e}}));return r}async removeFriends(e){let{runtimeRemoveFriends:r}=I(await K(this,X,"f").mutate({mutation:E`mutation runtimeRemoveFriends($dids: [String!]!) {
|
|
565
585
|
runtimeRemoveFriends(dids: $dids)
|
|
566
|
-
}`,variables:{dids:e}}));return r}async friends(){let{runtimeFriends:e}=
|
|
586
|
+
}`,variables:{dids:e}}));return r}async friends(){let{runtimeFriends:e}=I(await K(this,X,"f").query({query:E`query runtimeFriends {
|
|
567
587
|
runtimeFriends
|
|
568
|
-
}`}));return e}async hcAgentInfos(){let{runtimeHcAgentInfos:e}=
|
|
588
|
+
}`}));return e}async hcAgentInfos(){let{runtimeHcAgentInfos:e}=I(await K(this,X,"f").query({query:E`query runtimeHcAgentInfos {
|
|
569
589
|
runtimeHcAgentInfos
|
|
570
|
-
}`}));return e}async
|
|
590
|
+
}`}));return e}async getNetworkMetrics(){let{runtimeGetNetworkMetrics:e}=I(await K(this,X,"f").query({query:E`query runtimeGetNetworkMetrics {
|
|
591
|
+
runtimeGetNetworkMetrics
|
|
592
|
+
}`}));return e}async restartHolochain(){let{runtimeRestartHolochain:e}=I(await K(this,X,"f").mutate({mutation:E`mutation runtimeRestartHolochain {
|
|
593
|
+
runtimeRestartHolochain
|
|
594
|
+
}`}));return e}async hcAddAgentInfos(e){let{runtimeHcAddAgentInfos:r}=I(await K(this,X,"f").mutate({mutation:E`mutation runtimeHcAddAgentInfos($agentInfos: String!) {
|
|
571
595
|
runtimeHcAddAgentInfos(agentInfos: $agentInfos)
|
|
572
|
-
}`,variables:{agentInfos:e}}));return r}async verifyStringSignedByDid(e,r,n,i){let{runtimeVerifyStringSignedByDid:a}=
|
|
596
|
+
}`,variables:{agentInfos:e}}));return r}async verifyStringSignedByDid(e,r,n,i){let{runtimeVerifyStringSignedByDid:a}=I(await K(this,X,"f").mutate({mutation:E`query runtimeVerifyStringSignedByDid($did: String!, $didSigningKeyId: String!, $data: String!, $signedData: String!) {
|
|
573
597
|
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}=
|
|
598
|
+
}`,variables:{did:e,didSigningKeyId:r,data:n,signedData:i}}));return a}async setStatus(e){let{runtimeSetStatus:r}=I(await K(this,X,"f").mutate({mutation:E`mutation runtimeSetStatus($status: PerspectiveInput!) {
|
|
575
599
|
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}=
|
|
600
|
+
}`,variables:{status:e}}));return r}async friendStatus(e){let{runtimeFriendStatus:r}=I(await K(this,X,"f").query({query:E`query runtimeFriendStatus($did: String!) {
|
|
601
|
+
runtimeFriendStatus(did: $did) { ${ds} }
|
|
602
|
+
}`,variables:{did:e}}));return r}async friendSendMessage(e,r){let{runtimeFriendSendMessage:n}=I(await K(this,X,"f").mutate({mutation:E`mutation runtimeFriendSendMessage($did: String!, $message: PerspectiveInput!) {
|
|
579
603
|
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}=
|
|
604
|
+
}`,variables:{did:e,message:r}}));return n}async messageInbox(e){let{runtimeMessageInbox:r}=I(await K(this,X,"f").query({query:E`query runtimeMessageInbox($filter: String) {
|
|
605
|
+
runtimeMessageInbox(filter: $filter) { ${ds} }
|
|
606
|
+
}`,variables:{filter:e}}));return r}async messageOutbox(e){let{runtimeMessageOutbox:r}=I(await K(this,X,"f").query({query:E`query runtimeMessageOutbox($filter: String) {
|
|
583
607
|
runtimeMessageOutbox(filter: $filter) {
|
|
584
608
|
recipient,
|
|
585
609
|
message {
|
|
586
|
-
${
|
|
610
|
+
${ds}
|
|
587
611
|
}
|
|
588
612
|
}
|
|
589
|
-
}`,variables:{filter:e}}));return r}async requestInstallNotification(e){let{runtimeRequestInstallNotification:r}=
|
|
613
|
+
}`,variables:{filter:e}}));return r}async requestInstallNotification(e){let{runtimeRequestInstallNotification:r}=I(await K(this,X,"f").mutate({mutation:E`mutation runtimeRequestInstallNotification($notification: NotificationInput!) {
|
|
590
614
|
runtimeRequestInstallNotification(notification: $notification)
|
|
591
|
-
}`,variables:{notification:e}}));return r}async grantNotification(e){let{runtimeGrantNotification:r}=
|
|
615
|
+
}`,variables:{notification:e}}));return r}async grantNotification(e){let{runtimeGrantNotification:r}=I(await K(this,X,"f").mutate({mutation:E`mutation runtimeGrantNotification($id: String!) {
|
|
592
616
|
runtimeGrantNotification(id: $id)
|
|
593
|
-
}`,variables:{id:e}}));return r}async
|
|
594
|
-
|
|
595
|
-
}
|
|
617
|
+
}`,variables:{id:e}}));return r}async exportDb(e){let{runtimeExportDb:r}=I(await K(this,X,"f").mutate({mutation:E`mutation runtimeExportDb($filePath: String!) {
|
|
618
|
+
runtimeExportDb(filePath: $filePath)
|
|
619
|
+
}`,variables:{filePath:e}}));return r}async importDb(e){let{runtimeImportDb:r}=I(await K(this,X,"f").mutate({mutation:E`mutation runtimeImportDb($filePath: String!) {
|
|
620
|
+
runtimeImportDb(filePath: $filePath) {
|
|
621
|
+
perspectives { total imported failed omitted errors }
|
|
622
|
+
links { total imported failed omitted errors }
|
|
623
|
+
expressions { total imported failed omitted errors }
|
|
624
|
+
perspectiveDiffs { total imported failed omitted errors }
|
|
625
|
+
notifications { total imported failed omitted errors }
|
|
626
|
+
models { total imported failed omitted errors }
|
|
627
|
+
defaultModels { total imported failed omitted errors }
|
|
628
|
+
tasks { total imported failed omitted errors }
|
|
629
|
+
friends { total imported failed omitted errors }
|
|
630
|
+
trustedAgents { total imported failed omitted errors }
|
|
631
|
+
knownLinkLanguages { total imported failed omitted errors }
|
|
632
|
+
}
|
|
633
|
+
}`,variables:{filePath:e}}));return r}async notifications(){let{runtimeNotifications:e}=I(await K(this,X,"f").query({query:E`query runtimeNotifications {
|
|
634
|
+
runtimeNotifications { ${p1} }
|
|
635
|
+
}`}));return e}async updateNotification(e,r){let{runtimeUpdateNotification:n}=I(await K(this,X,"f").mutate({mutation:E`mutation runtimeUpdateNotification($id: String!, $notification: NotificationInput!) {
|
|
596
636
|
runtimeUpdateNotification(id: $id, notification: $notification)
|
|
597
|
-
}`,variables:{id:e,notification:r}}));return n}async removeNotification(e){let{runtimeRemoveNotification:r}=
|
|
637
|
+
}`,variables:{id:e,notification:r}}));return n}async removeNotification(e){let{runtimeRemoveNotification:r}=I(await K(this,X,"f").mutate({mutation:E`mutation runtimeRemoveNotification($id: String!) {
|
|
598
638
|
runtimeRemoveNotification(id: $id)
|
|
599
|
-
}`,variables:{id:e}}));return r}
|
|
600
|
-
|
|
639
|
+
}`,variables:{id:e}}));return r}async exportPerspective(e,r){let{runtimeExportPerspective:n}=I(await K(this,X,"f").mutate({mutation:E`mutation runtimeExportPerspective($perspectiveUuid: String!, $filePath: String!) {
|
|
640
|
+
runtimeExportPerspective(perspectiveUuid: $perspectiveUuid, filePath: $filePath)
|
|
641
|
+
}`,variables:{perspectiveUuid:e,filePath:r}}));return n}async importPerspective(e){let{runtimeImportPerspective:r}=I(await K(this,X,"f").mutate({mutation:E`mutation runtimeImportPerspective($filePath: String!) {
|
|
642
|
+
runtimeImportPerspective(filePath: $filePath)
|
|
643
|
+
}`,variables:{filePath:e}}));return r}addNotificationTriggeredCallback(e){K(this,Ma,"f").push(e)}subscribeNotificationTriggered(){K(this,X,"f").subscribe({query:E` subscription {
|
|
644
|
+
runtimeNotificationTriggered { ${f0} }
|
|
601
645
|
}
|
|
602
|
-
`}).subscribe({next:e=>{
|
|
603
|
-
runtimeMessageReceived { ${
|
|
646
|
+
`}).subscribe({next:e=>{K(this,Ma,"f").forEach(r=>{r(e.data.runtimeNotificationTriggered)})},error:e=>console.error(e)})}addMessageCallback(e){K(this,La,"f").push(e)}subscribeMessageReceived(){K(this,X,"f").subscribe({query:E` subscription {
|
|
647
|
+
runtimeMessageReceived { ${ds} }
|
|
604
648
|
}
|
|
605
|
-
`}).subscribe({next:e=>{
|
|
649
|
+
`}).subscribe({next:e=>{K(this,La,"f").forEach(r=>{r(e.data.runtimeMessageReceived)})},error:e=>console.error(e)})}addExceptionCallback(e){K(this,Fa,"f").push(e)}subscribeExceptionOccurred(){K(this,X,"f").subscribe({query:E` subscription {
|
|
606
650
|
exceptionOccurred {
|
|
607
651
|
title
|
|
608
652
|
message
|
|
609
653
|
type
|
|
610
654
|
addon
|
|
611
655
|
}
|
|
612
|
-
}`}).subscribe({next:e=>{
|
|
656
|
+
}`}).subscribe({next:e=>{K(this,Fa,"f").forEach(r=>{r(e.data.exceptionOccurred)})},error:e=>console.error(e)})}};X=new WeakMap,La=new WeakMap,Fa=new WeakMap,Ma=new WeakMap,l1=new WeakMap;var d0=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Ci=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},_r,El=class{constructor(e){_r.set(this,void 0),d0(this,_r,e,"f")}async get(e,r=!1){if(!r)try{let i=At.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}=I(await Ci(this,_r,"f").query({query:E`query expression($url: String!) {
|
|
613
657
|
expression(url: $url) {
|
|
614
658
|
author
|
|
615
659
|
timestamp
|
|
@@ -622,7 +666,7 @@ triggerMatch
|
|
|
622
666
|
invalid
|
|
623
667
|
}
|
|
624
668
|
}
|
|
625
|
-
}`,variables:{url:e}}));return n}async getMany(e){let{expressionMany:r}=
|
|
669
|
+
}`,variables:{url:e}}));return n}async getMany(e){let{expressionMany:r}=I(await Ci(this,_r,"f").query({query:E`query expressionMany($urls: [String!]!) {
|
|
626
670
|
expressionMany(urls: $urls) {
|
|
627
671
|
author
|
|
628
672
|
timestamp
|
|
@@ -635,19 +679,19 @@ triggerMatch
|
|
|
635
679
|
invalid
|
|
636
680
|
}
|
|
637
681
|
}
|
|
638
|
-
}`,variables:{urls:e}}));return r}async getRaw(e){let{expressionRaw:r}=
|
|
682
|
+
}`,variables:{urls:e}}));return r}async getRaw(e){let{expressionRaw:r}=I(await Ci(this,_r,"f").query({query:E`query expressionRaw($url: String!) {
|
|
639
683
|
expressionRaw(url: $url)
|
|
640
|
-
}`,variables:{url:e}}));return r}async create(e,r){e=JSON.stringify(e);let{expressionCreate:n}=
|
|
684
|
+
}`,variables:{url:e}}));return r}async create(e,r){e=JSON.stringify(e);let{expressionCreate:n}=I(await Ci(this,_r,"f").mutate({mutation:E`mutation expressionCreate($content: String!, $languageAddress: String!){
|
|
641
685
|
expressionCreate(content: $content, languageAddress: $languageAddress)
|
|
642
|
-
}`,variables:{content:e,languageAddress:r}}));return n}async interactions(e){let{expressionInteractions:r}=
|
|
686
|
+
}`,variables:{content:e,languageAddress:r}}));return n}async interactions(e){let{expressionInteractions:r}=I(await Ci(this,_r,"f").query({query:E`query expressionInteractions($url: String!) {
|
|
643
687
|
expressionInteractions(url: $url) {
|
|
644
688
|
label
|
|
645
689
|
name
|
|
646
690
|
parameters { name, type }
|
|
647
691
|
}
|
|
648
|
-
}`,variables:{url:e}}));return r}async interact(e,r){let{expressionInteract:n}=
|
|
692
|
+
}`,variables:{url:e}}));return r}async interact(e,r){let{expressionInteract:n}=I(await Ci(this,_r,"f").mutate({mutation:E`mutation expressionInteract($url: String!, $interactionCall: InteractionCall!){
|
|
649
693
|
expressionInteract(url: $url, interactionCall: $interactionCall)
|
|
650
|
-
}`,variables:{url:e,interactionCall:r}}));return n}};or=new WeakMap;var Ts={};Ts.byteLength=Ey;Ts.toByteArray=xy;Ts.fromByteArray=Ay;var Qt=[],Et=[],Sy=typeof Uint8Array<"u"?Uint8Array:Array,mu="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(sn=0,ud=mu.length;sn<ud;++sn)Qt[sn]=mu[sn],Et[mu.charCodeAt(sn)]=sn;var sn,ud;Et["-".charCodeAt(0)]=62;Et["_".charCodeAt(0)]=63;function Sh(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var n=r===e?0:4-r%4;return[r,n]}function Ey(t){var e=Sh(t),r=e[0],n=e[1];return(r+n)*3/4-n}function Cy(t,e,r){return(e+r)*3/4-r}function xy(t){var e,r=Sh(t),n=r[0],i=r[1],a=new Sy(Cy(t,n,i)),o=0,s=i>0?n-4:n,u;for(u=0;u<s;u+=4)e=Et[t.charCodeAt(u)]<<18|Et[t.charCodeAt(u+1)]<<12|Et[t.charCodeAt(u+2)]<<6|Et[t.charCodeAt(u+3)],a[o++]=e>>16&255,a[o++]=e>>8&255,a[o++]=e&255;return i===2&&(e=Et[t.charCodeAt(u)]<<2|Et[t.charCodeAt(u+1)]>>4,a[o++]=e&255),i===1&&(e=Et[t.charCodeAt(u)]<<10|Et[t.charCodeAt(u+1)]<<4|Et[t.charCodeAt(u+2)]>>2,a[o++]=e>>8&255,a[o++]=e&255),a}function ky(t){return Qt[t>>18&63]+Qt[t>>12&63]+Qt[t>>6&63]+Qt[t&63]}function Ty(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(ky(n));return i.join("")}function Ay(t){for(var e,r=t.length,n=r%3,i=[],a=16383,o=0,s=r-n;o<s;o+=a)i.push(Ty(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 Iy=4,ld=0,fd=1,Oy=2;function bi(t){let e=t.length;for(;--e>=0;)t[e]=0}var Dy=0,Eh=1,Ny=2,Ry=3,Py=258,ol=29,Pa=256,Ea=Pa+1+ol,li=30,sl=19,Ch=2*Ea+1,mn=15,gu=16,Ly=7,cl=256,xh=16,kh=17,Th=18,zu=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]),Yo=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]),$y=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),Ah=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Fy=512,sr=new Array((Ea+2)*2);bi(sr);var ga=new Array(li*2);bi(ga);var Ca=new Array(Fy);bi(Ca);var xa=new Array(Py-Ry+1);bi(xa);var ul=new Array(ol);bi(ul);var ms=new Array(li);bi(ms);function yu(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 Ih,Oh,Dh;function vu(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}var Nh=t=>t<256?Ca[t]:Ca[256+(t>>>7)],ka=(t,e)=>{t.pending_buf[t.pending++]=e&255,t.pending_buf[t.pending++]=e>>>8&255},ut=(t,e,r)=>{t.bi_valid>gu-r?(t.bi_buf|=e<<t.bi_valid&65535,ka(t,t.bi_buf),t.bi_buf=e>>gu-t.bi_valid,t.bi_valid+=r-gu):(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])},Rh=(t,e)=>{let r=0;do r|=t&1,t>>>=1,r<<=1;while(--e>0);return r>>>1},My=t=>{t.bi_valid===16?(ka(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=t.bi_buf&255,t.bi_buf>>=8,t.bi_valid-=8)},jy=(t,e)=>{let r=e.dyn_tree,n=e.max_code,i=e.stat_desc.static_tree,a=e.stat_desc.has_stree,o=e.stat_desc.extra_bits,s=e.stat_desc.extra_base,u=e.stat_desc.max_length,c,l,d,p,f,h,g=0;for(p=0;p<=mn;p++)t.bl_count[p]=0;for(r[t.heap[t.heap_max]*2+1]=0,c=t.heap_max+1;c<Ch;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--)}},Ph=(t,e,r)=>{let n=new Array(mn+1),i=0,a,o;for(a=1;a<=mn;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]=Rh(n[s]++,s))}},Uy=()=>{let t,e,r,n,i,a=new Array(mn+1);for(r=0,n=0;n<ol-1;n++)for(ul[n]=r,t=0;t<1<<zu[n];t++)xa[r++]=n;for(xa[r-1]=n,i=0,n=0;n<16;n++)for(ms[n]=i,t=0;t<1<<Yo[n];t++)Ca[i++]=n;for(i>>=7;n<li;n++)for(ms[n]=i<<7,t=0;t<1<<Yo[n]-7;t++)Ca[256+i++]=n;for(e=0;e<=mn;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(Ph(sr,Ea+1,a),t=0;t<li;t++)ga[t*2+1]=5,ga[t*2]=Rh(t,5);Ih=new yu(sr,zu,Pa+1,Ea,mn),Oh=new yu(ga,Yo,0,li,mn),Dh=new yu(new Array(0),$y,0,sl,Ly)},Lh=t=>{let e;for(e=0;e<Ea;e++)t.dyn_ltree[e*2]=0;for(e=0;e<li;e++)t.dyn_dtree[e*2]=0;for(e=0;e<sl;e++)t.bl_tree[e*2]=0;t.dyn_ltree[cl*2]=1,t.opt_len=t.static_len=0,t.sym_next=t.matches=0},$h=t=>{t.bi_valid>8?ka(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},pd=(t,e,r,n)=>{let i=e*2,a=r*2;return t[i]<t[a]||t[i]===t[a]&&n[e]<=n[r]},bu=(t,e,r)=>{let n=t.heap[r],i=r<<1;for(;i<=t.heap_len&&(i<t.heap_len&&pd(e,t.heap[i+1],t.heap[i],t.depth)&&i++,!pd(e,n,t.heap[i],t.depth));)t.heap[r]=t.heap[i],r=i,i<<=1;t.heap[r]=n},dd=(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=xa[i],Gt(t,o+Pa+1,e),s=zu[o],s!==0&&(i-=ul[o],ut(t,i,s)),n--,o=Nh(n),Gt(t,o,r),s=Yo[o],s!==0&&(n-=ms[o],ut(t,n,s)));while(a<t.sym_next);Gt(t,cl,e)},Qu=(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=Ch,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--)bu(t,r,o);c=a;do o=t.heap[1],t.heap[1]=t.heap[t.heap_len--],bu(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++,bu(t,r,1);while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],jy(t,e),Ph(r,u,t.bl_count)},hd=(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[xh*2]++):s<=10?t.bl_tree[kh*2]++:t.bl_tree[Th*2]++,s=0,i=a,o===0?(u=138,c=3):a===o?(u=6,c=3):(u=7,c=4))},md=(t,e,r)=>{let n,i=-1,a,o=e[0*2+1],s=0,u=7,c=4;for(o===0&&(u=138,c=3),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,xh,t.bl_tree),ut(t,s-3,2)):s<=10?(Gt(t,kh,t.bl_tree),ut(t,s-3,3)):(Gt(t,Th,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)}},qy=t=>{let e;for(hd(t,t.dyn_ltree,t.l_desc.max_code),hd(t,t.dyn_dtree,t.d_desc.max_code),Qu(t,t.bl_desc),e=sl-1;e>=3&&t.bl_tree[Ah[e]*2+1]===0;e--);return t.opt_len+=3*(e+1)+5+5+4,e},By=(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[Ah[i]*2+1],3);md(t,t.dyn_ltree,e-1),md(t,t.dyn_dtree,r-1)},Vy=t=>{let e=4093624447,r;for(r=0;r<=31;r++,e>>>=1)if(e&1&&t.dyn_ltree[r*2]!==0)return ld;if(t.dyn_ltree[9*2]!==0||t.dyn_ltree[10*2]!==0||t.dyn_ltree[13*2]!==0)return fd;for(r=32;r<Pa;r++)if(t.dyn_ltree[r*2]!==0)return fd;return ld},gd=!1,zy=t=>{gd||(Uy(),gd=!0),t.l_desc=new vu(t.dyn_ltree,Ih),t.d_desc=new vu(t.dyn_dtree,Oh),t.bl_desc=new vu(t.bl_tree,Dh),t.bi_buf=0,t.bi_valid=0,Lh(t)},Fh=(t,e,r,n)=>{ut(t,(Dy<<1)+(n?1:0),3),$h(t),ka(t,r),ka(t,~r),r&&t.pending_buf.set(t.window.subarray(e,e+r),t.pending),t.pending+=r},Qy=t=>{ut(t,Eh<<1,3),Gt(t,cl,sr),My(t)},Gy=(t,e,r,n)=>{let i,a,o=0;t.level>0?(t.strm.data_type===Oy&&(t.strm.data_type=Vy(t)),Qu(t,t.l_desc),Qu(t,t.d_desc),o=qy(t),i=t.opt_len+3+7>>>3,a=t.static_len+3+7>>>3,a<=i&&(i=a)):i=a=r+5,r+4<=i&&e!==-1?Fh(t,e,r,n):t.strategy===Iy||a===i?(ut(t,(Eh<<1)+(n?1:0),3),dd(t,sr,ga)):(ut(t,(Ny<<1)+(n?1:0),3),By(t,t.l_desc.max_code+1,t.d_desc.max_code+1,o+1),dd(t,t.dyn_ltree,t.dyn_dtree)),Lh(t),n&&$h(t)},Hy=(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[(xa[r]+Pa+1)*2]++,t.dyn_dtree[Nh(e)*2]++),t.sym_next===t.sym_end),Wy=zy,Ky=Fh,Zy=Gy,Yy=Hy,Jy=Qy,Xy={_tr_init:Wy,_tr_stored_block:Ky,_tr_flush_block:Zy,_tr_tally:Yy,_tr_align:Jy},ev=(t,e,r,n)=>{let i=t&65535|0,a=t>>>16&65535|0,o=0;for(;r!==0;){o=r>2e3?2e3:r,r-=o;do i=i+e[n++]|0,a=a+i|0;while(--o);i%=65521,a%=65521}return i|a<<16|0},Ta=ev,tv=()=>{let t,e=[];for(var r=0;r<256;r++){t=r;for(var n=0;n<8;n++)t=t&1?3988292384^t>>>1:t>>>1;e[r]=t}return e},rv=new Uint32Array(tv()),nv=(t,e,r,n)=>{let i=rv,a=n+r;t^=-1;for(let o=n;o<a;o++)t=t>>>8^i[(t^e[o])&255];return t^-1},Ue=nv,Cn={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"},Nn={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8},{_tr_init:iv,_tr_stored_block:Gu,_tr_flush_block:av,_tr_tally:Dr,_tr_align:ov}=Xy,{Z_NO_FLUSH:Nr,Z_PARTIAL_FLUSH:sv,Z_FULL_FLUSH:cv,Z_FINISH:xt,Z_BLOCK:yd,Z_OK:Ge,Z_STREAM_END:vd,Z_STREAM_ERROR:Wt,Z_DATA_ERROR:uv,Z_BUF_ERROR:_u,Z_DEFAULT_COMPRESSION:lv,Z_FILTERED:fv,Z_HUFFMAN_ONLY:Fo,Z_RLE:pv,Z_FIXED:dv,Z_DEFAULT_STRATEGY:hv,Z_UNKNOWN:mv,Z_DEFLATED:As}=Nn,gv=9,yv=15,vv=8,bv=29,_v=256,Hu=_v+1+bv,wv=30,Sv=19,Ev=2*Hu+1,Cv=15,Y=3,Ar=258,Kt=Ar+Y+1,xv=32,hi=42,ll=57,Wu=69,Ku=73,Zu=91,Yu=103,gn=113,fa=666,rt=1,_i=2,xn=3,wi=4,kv=3,yn=(t,e)=>(t.msg=Cn[e],e),bd=t=>t*2-(t>4?9:0),Tr=t=>{let e=t.length;for(;--e>=0;)t[e]=0},Tv=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)},Av=(t,e,r)=>(e<<t.hash_shift^r)&t.hash_mask,Rr=Av,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)=>{av(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,mt(t.strm)},ae=(t,e)=>{t.pending_buf[t.pending++]=e},Ji=(t,e)=>{t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=e&255},Ju=(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=Ta(t.adler,e,i,r):t.state.wrap===2&&(t.adler=Ue(t.adler,e,i,r)),t.next_in+=i,t.total_in+=i,i)},Mh=(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+Ar,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=Ar-(p-n),n=p-Ar,a>o){if(t.match_start=e,o=a,a>=s)break;f=c[n+o-1],h=c[n+o]}}while((e=d[e&l])>u&&--r!==0);return o<=t.lookahead?o:t.lookahead},mi=t=>{let e=t.w_size,r,n,i;do{if(n=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-Kt)&&(t.window.set(t.window.subarray(e,e+e-n),0),t.match_start-=e,t.strstart-=e,t.block_start-=e,t.insert>t.strstart&&(t.insert=t.strstart),Tv(t),n+=e),t.strm.avail_in===0)break;if(r=Ju(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=Rr(t,t.ins_h,t.window[i+1]);t.insert&&(t.ins_h=Rr(t,t.ins_h,t.window[i+Y-1]),t.prev[i&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=i,i++,t.insert--,!(t.lookahead+t.insert<Y)););}while(t.lookahead<Kt&&t.strm.avail_in!==0)},jh=(t,e)=>{let r=t.pending_buf_size-5>t.w_size?t.w_size:t.pending_buf_size-5,n,i,a,o=0,s=t.strm.avail_in;do{if(n=65535,a=t.bi_valid+42>>3,t.strm.avail_out<a||(a=t.strm.avail_out-a,i=t.strstart-t.block_start,n>i+t.strm.avail_in&&(n=i+t.strm.avail_in),n>a&&(n=a),n<r&&(n===0&&e!==xt||e===Nr||n!==i+t.strm.avail_in)))break;o=e===xt&&n===i+t.strm.avail_in?1:0,Gu(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&&(Ju(t.strm,t.strm.output,t.strm.next_out,n),t.strm.next_out+=n,t.strm.avail_out-=n,t.strm.total_out+=n)}while(o===0);return s-=t.strm.avail_in,s&&(s>=t.w_size?(t.matches=2,t.window.set(t.strm.input.subarray(t.strm.next_in-t.w_size,t.strm.next_in),0),t.strstart=t.w_size,t.insert=t.strstart):(t.window_size-t.strstart<=s&&(t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,t.insert>t.strstart&&(t.insert=t.strstart)),t.window.set(t.strm.input.subarray(t.strm.next_in-s,t.strm.next_in),t.strstart),t.strstart+=s,t.insert+=s>t.w_size-t.insert?t.w_size-t.insert:s),t.block_start=t.strstart),t.high_water<t.strstart&&(t.high_water=t.strstart),o?wi:e!==Nr&&e!==xt&&t.strm.avail_in===0&&t.strstart===t.block_start?_i:(a=t.window_size-t.strstart,t.strm.avail_in>a&&t.block_start>=t.w_size&&(t.block_start-=t.w_size,t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,a+=t.w_size,t.insert>t.strstart&&(t.insert=t.strstart)),a>t.strm.avail_in&&(a=t.strm.avail_in),a&&(Ju(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!==Nr&&t.strm.avail_in===0&&i<=a)&&(n=i>a?a:i,o=e===xt&&t.strm.avail_in===0&&n===i?1:0,Gu(t,t.block_start,n,o),t.block_start+=n,mt(t.strm)),o?xn:rt)},wu=(t,e)=>{let r,n;for(;;){if(t.lookahead<Kt){if(mi(t),t.lookahead<Kt&&e===Nr)return rt;if(t.lookahead===0)break}if(r=0,t.lookahead>=Y&&(t.ins_h=Rr(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=Mh(t,r)),t.match_length>=Y)if(n=Dr(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=Rr(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=Rr(t,t.ins_h,t.window[t.strstart+1]);else n=Dr(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?xn:wi):t.sym_next&&(yt(t,!1),t.strm.avail_out===0)?rt:_i},ai=(t,e)=>{let r,n,i;for(;;){if(t.lookahead<Kt){if(mi(t),t.lookahead<Kt&&e===Nr)return rt;if(t.lookahead===0)break}if(r=0,t.lookahead>=Y&&(t.ins_h=Rr(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=Mh(t,r),t.match_length<=5&&(t.strategy===fv||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=Dr(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=Rr(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=Dr(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=Dr(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?xn:wi):t.sym_next&&(yt(t,!1),t.strm.avail_out===0)?rt:_i},Iv=(t,e)=>{let r,n,i,a,o=t.window;for(;;){if(t.lookahead<=Ar){if(mi(t),t.lookahead<=Ar&&e===Nr)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+Ar;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=Ar-(a-i),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=Y?(r=Dr(t,1,t.match_length-Y),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=Dr(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?xn:wi):t.sym_next&&(yt(t,!1),t.strm.avail_out===0)?rt:_i},Ov=(t,e)=>{let r;for(;;){if(t.lookahead===0&&(mi(t),t.lookahead===0)){if(e===Nr)return rt;break}if(t.match_length=0,r=Dr(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?xn:wi):t.sym_next&&(yt(t,!1),t.strm.avail_out===0)?rt:_i};function Vt(t,e,r,n,i){this.good_length=t,this.max_lazy=e,this.nice_length=r,this.max_chain=n,this.func=i}var pa=[new Vt(0,0,0,0,jh),new Vt(4,4,8,4,wu),new Vt(4,5,16,8,wu),new Vt(4,6,32,32,wu),new Vt(4,4,16,16,ai),new Vt(8,16,32,32,ai),new Vt(8,16,128,128,ai),new Vt(8,32,128,256,ai),new Vt(32,128,258,1024,ai),new Vt(32,258,258,4096,ai)],Dv=t=>{t.window_size=2*t.w_size,Tr(t.head),t.max_lazy_match=pa[t.level].max_lazy,t.good_match=pa[t.level].good_length,t.nice_match=pa[t.level].nice_length,t.max_chain_length=pa[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=Y-1,t.match_available=0,t.ins_h=0};function Nv(){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=As,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(Ev*2),this.dyn_dtree=new Uint16Array((2*wv+1)*2),this.bl_tree=new Uint16Array((2*Sv+1)*2),Tr(this.dyn_ltree),Tr(this.dyn_dtree),Tr(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(Cv+1),this.heap=new Uint16Array(2*Hu+1),Tr(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*Hu+1),Tr(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 La=t=>{if(!t)return 1;let e=t.state;return!e||e.strm!==t||e.status!==hi&&e.status!==ll&&e.status!==Wu&&e.status!==Ku&&e.status!==Zu&&e.status!==Yu&&e.status!==gn&&e.status!==fa?1:0},Uh=t=>{if(La(t))return yn(t,Wt);t.total_in=t.total_out=0,t.data_type=mv;let e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap===2?ll:e.wrap?hi:gn,t.adler=e.wrap===2?0:1,e.last_flush=-2,iv(e),Ge},qh=t=>{let e=Uh(t);return e===Ge&&Dv(t.state),e},Rv=(t,e)=>La(t)||t.state.wrap!==2?Wt:(t.state.gzhead=e,Ge),Bh=(t,e,r,n,i,a)=>{if(!t)return Wt;let o=1;if(e===lv&&(e=6),n<0?(o=0,n=-n):n>15&&(o=2,n-=16),i<1||i>gv||r!==As||n<8||n>15||e<0||e>9||a<0||a>dv||n===8&&o!==1)return yn(t,Wt);n===8&&(n=9);let s=new Nv;return t.state=s,s.strm=t,s.status=hi,s.wrap=o,s.gzhead=null,s.w_bits=n,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=i+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+Y-1)/Y),s.window=new Uint8Array(s.w_size*2),s.head=new Uint16Array(s.hash_size),s.prev=new Uint16Array(s.w_size),s.lit_bufsize=1<<i+6,s.pending_buf_size=s.lit_bufsize*4,s.pending_buf=new Uint8Array(s.pending_buf_size),s.sym_buf=s.lit_bufsize,s.sym_end=(s.lit_bufsize-1)*3,s.level=e,s.strategy=a,s.method=r,qh(t)},Pv=(t,e)=>Bh(t,e,As,yv,vv,hv),Lv=(t,e)=>{if(La(t)||e>yd||e<0)return t?yn(t,Wt):Wt;let r=t.state;if(!t.output||t.avail_in!==0&&!t.input||r.status===fa&&e!==xt)return yn(t,t.avail_out===0?_u: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&&bd(e)<=bd(n)&&e!==xt)return yn(t,_u);if(r.status===fa&&t.avail_in!==0)return yn(t,_u);if(r.status===hi&&r.wrap===0&&(r.status=gn),r.status===hi){let i=As+(r.w_bits-8<<4)<<8,a=-1;if(r.strategy>=Fo||r.level<2?a=0:r.level<6?a=1:r.level===6?a=2:a=3,i|=a<<6,r.strstart!==0&&(i|=xv),i+=31-i%31,Ji(r,i),r.strstart!==0&&(Ji(r,t.adler>>>16),Ji(r,t.adler&65535)),t.adler=1,r.status=gn,mt(t),r.pending!==0)return r.last_flush=-1,Ge}if(r.status===ll){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>=Fo||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=Ue(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=Wu;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>=Fo||r.level<2?4:0),ae(r,kv),r.status=gn,mt(t),r.pending!==0)return r.last_flush=-1,Ge}if(r.status===Wu){if(r.gzhead.extra){let i=r.pending,a=(r.gzhead.extra.length&65535)-r.gzindex;for(;r.pending+a>r.pending_buf_size;){let s=r.pending_buf_size-r.pending;if(r.pending_buf.set(r.gzhead.extra.subarray(r.gzindex,r.gzindex+s),r.pending),r.pending=r.pending_buf_size,r.gzhead.hcrc&&r.pending>i&&(t.adler=Ue(t.adler,r.pending_buf,r.pending-i,i)),r.gzindex+=s,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=Ue(t.adler,r.pending_buf,r.pending-i,i)),r.gzindex=0}r.status=Ku}if(r.status===Ku){if(r.gzhead.name){let i=r.pending,a;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>i&&(t.adler=Ue(t.adler,r.pending_buf,r.pending-i,i)),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=Ue(t.adler,r.pending_buf,r.pending-i,i)),r.gzindex=0}r.status=Zu}if(r.status===Zu){if(r.gzhead.comment){let i=r.pending,a;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>i&&(t.adler=Ue(t.adler,r.pending_buf,r.pending-i,i)),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=Ue(t.adler,r.pending_buf,r.pending-i,i))}r.status=Yu}if(r.status===Yu){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=gn,mt(t),r.pending!==0)return r.last_flush=-1,Ge}if(t.avail_in!==0||r.lookahead!==0||e!==Nr&&r.status!==fa){let i=r.level===0?jh(r,e):r.strategy===Fo?Ov(r,e):r.strategy===pv?Iv(r,e):pa[r.level].func(r,e);if((i===xn||i===wi)&&(r.status=fa),i===rt||i===xn)return t.avail_out===0&&(r.last_flush=-1),Ge;if(i===_i&&(e===sv?ov(r):e!==yd&&(Gu(r,0,0,!1),e===cv&&(Tr(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?vd:(r.wrap===2?(ae(r,t.adler&255),ae(r,t.adler>>8&255),ae(r,t.adler>>16&255),ae(r,t.adler>>24&255),ae(r,t.total_in&255),ae(r,t.total_in>>8&255),ae(r,t.total_in>>16&255),ae(r,t.total_in>>24&255)):(Ji(r,t.adler>>>16),Ji(r,t.adler&65535)),mt(t),r.wrap>0&&(r.wrap=-r.wrap),r.pending!==0?Ge:vd)},$v=t=>{if(La(t))return Wt;let e=t.state.status;return t.state=null,e===gn?yn(t,uv):Ge},Fv=(t,e)=>{let r=e.length;if(La(t))return Wt;let n=t.state,i=n.wrap;if(i===2||i===1&&n.status!==hi||n.lookahead)return Wt;if(i===1&&(t.adler=Ta(t.adler,e,r,0)),n.wrap=0,r>=n.w_size){i===0&&(Tr(n.head),n.strstart=0,n.block_start=0,n.insert=0);let u=new Uint8Array(n.w_size);u.set(e.subarray(r-n.w_size,r),0),e=u,r=n.w_size}let a=t.avail_in,o=t.next_in,s=t.input;for(t.avail_in=r,t.next_in=0,t.input=e,mi(n);n.lookahead>=Y;){let u=n.strstart,c=n.lookahead-(Y-1);do n.ins_h=Rr(n,n.ins_h,n.window[u+Y-1]),n.prev[u&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=u,u++;while(--c);n.strstart=u,n.lookahead=Y-1,mi(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=Y-1,n.match_available=0,t.next_in=o,t.input=s,t.avail_in=a,n.wrap=i,Ge},Mv=Pv,jv=Bh,Uv=qh,qv=Uh,Bv=Rv,Vv=Lv,zv=$v,Qv=Fv,Gv="pako deflate (from Nodeca project)",ya={deflateInit:Mv,deflateInit2:jv,deflateReset:Uv,deflateResetKeep:qv,deflateSetHeader:Bv,deflate:Vv,deflateEnd:zv,deflateSetDictionary:Qv,deflateInfo:Gv},Hv=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),Wv=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)Hv(r,n)&&(t[n]=r[n])}}return t},Kv=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},Is={assign:Wv,flattenChunks:Kv},Vh=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){Vh=!1}var Aa=new Uint8Array(256);for(let t=0;t<256;t++)Aa[t]=t>=252?6:t>=248?5:t>=240?4:t>=224?3:t>=192?2:1;Aa[254]=Aa[254]=1;var Zv=t=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(t);let e,r,n,i,a,o=t.length,s=0;for(i=0;i<o;i++)r=t.charCodeAt(i),(r&64512)===55296&&i+1<o&&(n=t.charCodeAt(i+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),i++)),s+=r<128?1:r<2048?2:r<65536?3:4;for(e=new Uint8Array(s),a=0,i=0;a<s;i++)r=t.charCodeAt(i),(r&64512)===55296&&i+1<o&&(n=t.charCodeAt(i+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),i++)),r<128?e[a++]=r:r<2048?(e[a++]=192|r>>>6,e[a++]=128|r&63):r<65536?(e[a++]=224|r>>>12,e[a++]=128|r>>>6&63,e[a++]=128|r&63):(e[a++]=240|r>>>18,e[a++]=128|r>>>12&63,e[a++]=128|r>>>6&63,e[a++]=128|r&63);return e},Yv=(t,e)=>{if(e<65534&&t.subarray&&Vh)return String.fromCharCode.apply(null,t.length===e?t:t.subarray(0,e));let r="";for(let n=0;n<e;n++)r+=String.fromCharCode(t[n]);return r},Jv=(t,e)=>{let r=e||t.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(t.subarray(0,e));let n,i,a=new Array(r*2);for(i=0,n=0;n<r;){let o=t[n++];if(o<128){a[i++]=o;continue}let s=Aa[o];if(s>4){a[i++]=65533,n+=s-1;continue}for(o&=s===2?31:s===3?15:7;s>1&&n<r;)o=o<<6|t[n++]&63,s--;if(s>1){a[i++]=65533;continue}o<65536?a[i++]=o:(o-=65536,a[i++]=55296|o>>10&1023,a[i++]=56320|o&1023)}return Yv(a,i)},Xv=(t,e)=>{e=e||t.length,e>t.length&&(e=t.length);let r=e-1;for(;r>=0&&(t[r]&192)===128;)r--;return r<0||r===0?e:r+Aa[t[r]]>e?r:e},Ia={string2buf:Zv,buf2string:Jv,utf8border:Xv};function e0(){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 zh=e0,Qh=Object.prototype.toString,{Z_NO_FLUSH:t0,Z_SYNC_FLUSH:r0,Z_FULL_FLUSH:n0,Z_FINISH:i0,Z_OK:gs,Z_STREAM_END:a0,Z_DEFAULT_COMPRESSION:o0,Z_DEFAULT_STRATEGY:s0,Z_DEFLATED:c0}=Nn;function $a(t){this.options=Is.assign({level:o0,method:c0,chunkSize:16384,windowBits:15,memLevel:8,strategy:s0},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 zh,this.strm.avail_out=0;let r=ya.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(r!==gs)throw new Error(Cn[r]);if(e.header&&ya.deflateSetHeader(this.strm,e.header),e.dictionary){let n;if(typeof e.dictionary=="string"?n=Ia.string2buf(e.dictionary):Qh.call(e.dictionary)==="[object ArrayBuffer]"?n=new Uint8Array(e.dictionary):n=e.dictionary,r=ya.deflateSetDictionary(this.strm,n),r!==gs)throw new Error(Cn[r]);this._dict_set=!0}}$a.prototype.push=function(t,e){let r=this.strm,n=this.options.chunkSize,i,a;if(this.ended)return!1;for(e===~~e?a=e:a=e===!0?i0:t0,typeof t=="string"?r.input=Ia.string2buf(t):Qh.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===r0||a===n0)&&r.avail_out<=6){this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;continue}if(i=ya.deflate(r,a),i===a0)return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),i=ya.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===gs;if(r.avail_out===0){this.onData(r.output);continue}if(a>0&&r.next_out>0){this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;continue}if(r.avail_in===0)break}return!0};$a.prototype.onData=function(t){this.chunks.push(t)};$a.prototype.onEnd=function(t){t===gs&&(this.result=Is.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function fl(t,e){let r=new $a(e);if(r.push(t,!0),r.err)throw r.msg||Cn[r.err];return r.result}function u0(t,e){return e=e||{},e.raw=!0,fl(t,e)}function l0(t,e){return e=e||{},e.gzip=!0,fl(t,e)}var f0=$a,p0=fl,d0=u0,h0=l0,m0=Nn,g0={Deflate:f0,deflate:p0,deflateRaw:d0,gzip:h0,constants:m0},Mo=16209,y0=16191,v0=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,C,O,P,N,U=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=U.dmax,c=U.wsize,l=U.whave,d=U.wnext,p=U.window,f=U.hold,h=U.bits,g=U.lencode,y=U.distcode,S=(1<<U.lenbits)-1,b=(1<<U.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",U.mode=Mo;break e}if(f>>>=m,h-=m,m=a-o,D>m){if(m=D-m,m>l&&U.sane){e.msg="invalid distance too far back",U.mode=Mo;break e}if(C=0,O=p,d===0){if(C+=c-m,m<A){A-=m;do N[a++]=p[C++];while(--m);C=a-D,O=N}}else if(d<m){if(C+=c+d-m,m-=d,m<A){A-=m;do N[a++]=p[C++];while(--m);if(C=0,d<A){m=d,A-=m;do N[a++]=p[C++];while(--m);C=a-D,O=N}}}else if(C+=d-m,m<A){A-=m;do N[a++]=p[C++];while(--m);C=a-D,O=N}for(;A>2;)N[a++]=O[C++],N[a++]=O[C++],N[a++]=O[C++],A-=3;A&&(N[a++]=O[C++],A>1&&(N[a++]=O[C++]))}else{C=a-D;do N[a++]=N[C++],N[a++]=N[C++],N[a++]=N[C++],A-=3;while(A>2);A&&(N[a++]=N[C++],A>1&&(N[a++]=N[C++]))}}else if((m&64)===0){v=y[(v&65535)+(f&(1<<m)-1)];continue r}else{e.msg="invalid distance code",U.mode=Mo;break e}break}}else if((m&64)===0){v=g[(v&65535)+(f&(1<<m)-1)];continue t}else if(m&32){U.mode=y0;break e}else{e.msg="invalid literal/length code",U.mode=Mo;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),U.hold=f,U.bits=h},oi=15,_d=852,wd=592,Sd=0,Su=1,Ed=2,b0=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]),_0=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]),w0=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]),S0=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),E0=(t,e,r,n,i,a,o,s)=>{let u=s.bits,c=0,l=0,d=0,p=0,f=0,h=0,g=0,y=0,S=0,b=0,v,m,A,D,C,O=null,P,N=new Uint16Array(oi+1),U=new Uint16Array(oi+1),qe=null,Ne,q,de;for(c=0;c<=oi;c++)N[c]=0;for(l=0;l<n;l++)N[e[r+l]]++;for(f=u,p=oi;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<=oi;c++)if(y<<=1,y-=N[c],y<0)return-1;if(y>0&&(t===Sd||p!==1))return-1;for(U[1]=0,c=1;c<oi;c++)U[c+1]=U[c]+N[c];for(l=0;l<n;l++)e[r+l]!==0&&(o[U[e[r+l]]++]=l);if(t===Sd?(O=qe=o,P=20):t===Su?(O=b0,qe=_0,P=257):(O=w0,qe=S0,P=0),b=0,l=0,c=d,C=a,h=f,g=0,A=-1,S=1<<f,D=S-1,t===Su&&S>_d||t===Ed&&S>wd)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[C+(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),C+=d,h=c-g,y=1<<h;h+g<p&&(y-=N[h+g],!(y<=0));)h++,y<<=1;if(S+=1<<h,t===Su&&S>_d||t===Ed&&S>wd)return 1;A=b&D,i[A]=f<<24|h<<16|C-a|0}}return b!==0&&(i[C+b]=c-g<<24|64<<16|0),s.bits=f,0},va=E0,C0=0,Gh=1,Hh=2,{Z_FINISH:Cd,Z_BLOCK:x0,Z_TREES:jo,Z_OK:kn,Z_STREAM_END:k0,Z_NEED_DICT:T0,Z_STREAM_ERROR:kt,Z_DATA_ERROR:Wh,Z_MEM_ERROR:Kh,Z_BUF_ERROR:A0,Z_DEFLATED:xd}=Nn,Os=16180,kd=16181,Td=16182,Ad=16183,Id=16184,Od=16185,Dd=16186,Nd=16187,Rd=16188,Pd=16189,ys=16190,ir=16191,Eu=16192,Ld=16193,Cu=16194,$d=16195,Fd=16196,Md=16197,jd=16198,Uo=16199,qo=16200,Ud=16201,qd=16202,Bd=16203,Vd=16204,zd=16205,xu=16206,Qd=16207,Gd=16208,_e=16209,Zh=16210,Yh=16211,I0=852,O0=592,D0=15,N0=D0,Hd=t=>(t>>>24&255)+(t>>>8&65280)+((t&65280)<<8)+((t&255)<<24);function R0(){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 Rn=t=>{if(!t)return 1;let e=t.state;return!e||e.strm!==t||e.mode<Os||e.mode>Yh?1:0},Jh=t=>{if(Rn(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=Os,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(I0),e.distcode=e.distdyn=new Int32Array(O0),e.sane=1,e.back=-1,kn},Xh=t=>{if(Rn(t))return kt;let e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,Jh(t)},em=(t,e)=>{let r;if(Rn(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,Xh(t))},tm=(t,e)=>{if(!t)return kt;let r=new R0;t.state=r,r.strm=t,r.window=null,r.mode=Os;let n=em(t,e);return n!==kn&&(t.state=null),n},P0=t=>tm(t,N0),Wd=!0,ku,Tu,L0=t=>{if(Wd){ku=new Int32Array(512),Tu=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(va(Gh,t.lens,0,288,ku,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;va(Hh,t.lens,0,32,Tu,0,t.work,{bits:5}),Wd=!1}t.lencode=ku,t.lenbits=9,t.distcode=Tu,t.distbits=5},rm=(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},$0=(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,C,O,P=new Uint8Array(4),N,U,qe=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Rn(t)||!t.output||!t.input&&t.avail_in!==0)return kt;r=t.state,r.mode===ir&&(r.mode=Eu),o=t.next_out,i=t.output,u=t.avail_out,a=t.next_in,n=t.input,s=t.avail_in,c=r.hold,l=r.bits,d=s,p=u,O=kn;e:for(;;)switch(r.mode){case Os:if(r.wrap===0){r.mode=Eu;break}for(;l<16;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(r.wrap&2&&c===35615){r.wbits===0&&(r.wbits=15),r.check=0,P[0]=c&255,P[1]=c>>>8&255,r.check=Ue(r.check,P,2,0),c=0,l=0,r.mode=kd;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)!==xd){t.msg="unknown compression method",r.mode=_e;break}if(c>>>=4,l-=4,C=(c&15)+8,r.wbits===0&&(r.wbits=C),C>15||C>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?Pd:ir,c=0,l=0;break;case kd:for(;l<16;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(r.flags=c,(r.flags&255)!==xd){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=Ue(r.check,P,2,0)),c=0,l=0,r.mode=Td;case Td: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=Ue(r.check,P,4,0)),c=0,l=0,r.mode=Ad;case Ad: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=Ue(r.check,P,2,0)),c=0,l=0,r.mode=Id;case Id: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=Ue(r.check,P,2,0)),c=0,l=0}else r.head&&(r.head.extra=null);r.mode=Od;case Od:if(r.flags&1024&&(f=r.length,f>s&&(f=s),f&&(r.head&&(C=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),C)),r.flags&512&&r.wrap&4&&(r.check=Ue(r.check,n,f,a)),s-=f,a+=f,r.length-=f),r.length))break e;r.length=0,r.mode=Dd;case Dd:if(r.flags&2048){if(s===0)break e;f=0;do C=n[a+f++],r.head&&C&&r.length<65536&&(r.head.name+=String.fromCharCode(C));while(C&&f<s);if(r.flags&512&&r.wrap&4&&(r.check=Ue(r.check,n,f,a)),s-=f,a+=f,C)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=Nd;case Nd:if(r.flags&4096){if(s===0)break e;f=0;do C=n[a+f++],r.head&&C&&r.length<65536&&(r.head.comment+=String.fromCharCode(C));while(C&&f<s);if(r.flags&512&&r.wrap&4&&(r.check=Ue(r.check,n,f,a)),s-=f,a+=f,C)break e}else r.head&&(r.head.comment=null);r.mode=Rd;case Rd: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 Pd:for(;l<32;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}t.adler=r.check=Hd(c),c=0,l=0,r.mode=ys;case ys: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,T0;t.adler=r.check=1,r.mode=ir;case ir:if(e===x0||e===jo)break e;case Eu:if(r.last){c>>>=l&7,l-=l&7,r.mode=xu;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=Ld;break;case 1:if(L0(r),r.mode=Uo,e===jo){c>>>=2,l-=2;break e}break;case 2:r.mode=Fd;break;case 3:t.msg="invalid block type",r.mode=_e}c>>>=2,l-=2;break;case Ld: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=Cu,e===jo)break e;case Cu:r.mode=$d;case $d: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 Fd: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=Md;case Md: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=va(C0,r.lens,0,19,r.lencode,0,r.work,N),r.lenbits=N.bits,O){t.msg="invalid code lengths set",r.mode=_e;break}r.have=0,r.mode=jd;case jd:for(;r.have<r.nlen+r.ndist;){for(;y=r.lencode[c&(1<<r.lenbits)-1],S=y>>>24,b=y>>>16&255,v=y&65535,!(S<=l);){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(v<16)c>>>=S,l-=S,r.lens[r.have++]=v;else{if(v===16){for(U=S+2;l<U;){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}C=r.lens[r.have-1],f=3+(c&3),c>>>=2,l-=2}else if(v===17){for(U=S+3;l<U;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}c>>>=S,l-=S,C=0,f=3+(c&7),c>>>=3,l-=3}else{for(U=S+7;l<U;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}c>>>=S,l-=S,C=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++]=C}}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=va(Gh,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=va(Hh,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=Uo,e===jo)break e;case Uo:r.mode=qo;case qo: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,v0(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=zd;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=Ud;case Ud:if(r.extra){for(U=r.extra;l<U;){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=qd;case qd: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=Bd;case Bd:if(r.extra){for(U=r.extra;l<U;){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=Vd;case Vd: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=qo);break;case zd:if(u===0)break e;i[o++]=r.length,u--,r.mode=qo;break;case xu:if(r.wrap){for(;l<32;){if(s===0)break e;s--,c|=n[a++]<<l,l+=8}if(p-=u,t.total_out+=p,r.total+=p,r.wrap&4&&p&&(t.adler=r.check=r.flags?Ue(r.check,i,p,o-p):Ta(r.check,i,p,o-p)),p=u,r.wrap&4&&(r.flags?c:Hd(c))!==r.check){t.msg="incorrect data check",r.mode=_e;break}c=0,l=0}r.mode=Qd;case Qd: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=Gd;case Gd:O=k0;break e;case _e:O=Wh;break e;case Zh:return Kh;case Yh: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<xu||e!==Cd))&&rm(t,t.output,t.next_out,p-t.avail_out),d-=t.avail_in,p-=t.avail_out,t.total_in+=d,t.total_out+=p,r.total+=p,r.wrap&4&&p&&(t.adler=r.check=r.flags?Ue(r.check,i,p,t.next_out-p):Ta(r.check,i,p,t.next_out-p)),t.data_type=r.bits+(r.last?64:0)+(r.mode===ir?128:0)+(r.mode===Uo||r.mode===Cu?256:0),(d===0&&p===0||e===Cd)&&O===kn&&(O=A0),O},F0=t=>{if(Rn(t))return kt;let e=t.state;return e.window&&(e.window=null),t.state=null,kn},M0=(t,e)=>{if(Rn(t))return kt;let r=t.state;return(r.wrap&2)===0?kt:(r.head=e,e.done=!1,kn)},j0=(t,e)=>{let r=e.length,n,i,a;return Rn(t)||(n=t.state,n.wrap!==0&&n.mode!==ys)?kt:n.mode===ys&&(i=1,i=Ta(i,e,r,0),i!==n.check)?Wh:(a=rm(t,e,r,r),a?(n.mode=Zh,Kh):(n.havedict=1,kn))},U0=Xh,q0=em,B0=Jh,V0=P0,z0=tm,Q0=$0,G0=F0,H0=M0,W0=j0,K0="pako inflate (from Nodeca project)",cr={inflateReset:U0,inflateReset2:q0,inflateResetKeep:B0,inflateInit:V0,inflateInit2:z0,inflate:Q0,inflateEnd:G0,inflateGetHeader:H0,inflateSetDictionary:W0,inflateInfo:K0};function Z0(){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 Y0=Z0,nm=Object.prototype.toString,{Z_NO_FLUSH:J0,Z_FINISH:X0,Z_OK:Oa,Z_STREAM_END:Au,Z_NEED_DICT:Iu,Z_STREAM_ERROR:e2,Z_DATA_ERROR:Kd,Z_MEM_ERROR:t2}=Nn;function Fa(t){this.options=Is.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 zh,this.strm.avail_out=0;let r=cr.inflateInit2(this.strm,e.windowBits);if(r!==Oa)throw new Error(Cn[r]);if(this.header=new Y0,cr.inflateGetHeader(this.strm,this.header),e.dictionary&&(typeof e.dictionary=="string"?e.dictionary=Ia.string2buf(e.dictionary):nm.call(e.dictionary)==="[object ArrayBuffer]"&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(r=cr.inflateSetDictionary(this.strm,e.dictionary),r!==Oa)))throw new Error(Cn[r])}Fa.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?X0:J0,nm.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===Iu&&i&&(a=cr.inflateSetDictionary(r,i),a===Oa?a=cr.inflate(r,o):a===Kd&&(a=Iu));r.avail_in>0&&a===Au&&r.state.wrap>0&&t[r.next_in]!==0;)cr.inflateReset(r),a=cr.inflate(r,o);switch(a){case e2:case Kd:case Iu:case t2:return this.onEnd(a),this.ended=!0,!1}if(s=r.avail_out,r.next_out&&(r.avail_out===0||a===Au))if(this.options.to==="string"){let u=Ia.utf8border(r.output,r.next_out),c=r.next_out-u,l=Ia.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===Oa&&s===0)){if(a===Au)return a=cr.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,!0;if(r.avail_in===0)break}}return!0};Fa.prototype.onData=function(t){this.chunks.push(t)};Fa.prototype.onEnd=function(t){t===Oa&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Is.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function pl(t,e){let r=new Fa(e);if(r.push(t),r.err)throw r.msg||Cn[r.err];return r.result}function r2(t,e){return e=e||{},e.raw=!0,pl(t,e)}var n2=Fa,i2=pl,a2=r2,o2=pl,s2=Nn,c2={Inflate:n2,inflate:i2,inflateRaw:a2,ungzip:o2,constants:s2},{Deflate:u2,deflate:l2,deflateRaw:f2,gzip:p2}=g0,{Inflate:d2,inflate:h2,inflateRaw:m2,ungzip:g2}=c2,y2=u2,v2=l2,b2=f2,_2=p2,w2=d2,S2=h2,E2=m2,C2=g2,x2=Nn,k2={Deflate:y2,deflate:v2,deflateRaw:b2,gzip:_2,Inflate:w2,inflate:S2,inflateRaw:E2,ungzip:C2,constants:x2},me=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},ge=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},vs=class{constructor(e,r){this.input=e,this.output=r}};me([w(),ge("design:type",String)],vs.prototype,"input",void 0);me([w(),ge("design:type",String)],vs.prototype,"output",void 0);vs=me([He(),ge("design:paramtypes",[String,String])],vs);var bs=class{constructor(e,r){this.input=e,this.output=r}};me([w(),ge("design:type",String)],bs.prototype,"input",void 0);me([w(),ge("design:type",String)],bs.prototype,"output",void 0);bs=me([Z(),ge("design:paramtypes",[String,String])],bs);var jr=class{constructor(e,r,n,i,a){this.name=e,this.modelId=r,this.systemPrompt=n,this.promptExamples=i,this.metaData=a}};me([w(),ge("design:type",String)],jr.prototype,"name",void 0);me([w(),ge("design:type",String)],jr.prototype,"modelId",void 0);me([w(),ge("design:type",String)],jr.prototype,"systemPrompt",void 0);me([w(),ge("design:type",Array)],jr.prototype,"promptExamples",void 0);me([w(),ge("design:type",String)],jr.prototype,"metaData",void 0);jr=me([He(),ge("design:paramtypes",[String,String,String,Array,String])],jr);var Zt=class{constructor(e,r,n,i,a,o,s,u){this.name=e,this.modelId=r,this.taskId=n,this.systemPrompt=i,this.promptExamples=a,this.metaData=o,this.createdAt=s,this.updatedAt=u}};me([w(),ge("design:type",String)],Zt.prototype,"name",void 0);me([w(),ge("design:type",String)],Zt.prototype,"modelId",void 0);me([w(),ge("design:type",String)],Zt.prototype,"taskId",void 0);me([w(),ge("design:type",String)],Zt.prototype,"systemPrompt",void 0);me([w(),ge("design:type",Array)],Zt.prototype,"promptExamples",void 0);me([w(),ge("design:type",String)],Zt.prototype,"metaData",void 0);me([w(),ge("design:type",String)],Zt.prototype,"createdAt",void 0);me([w(),ge("design:type",String)],Zt.prototype,"updatedAt",void 0);Zt=me([Z(),ge("design:paramtypes",[String,String,String,String,Array,String,String,String])],Zt);var Tn=class{constructor(e,r,n,i,a){this.model=e,this.status=r,this.progress=n,this.downloaded=i,this.loaded=a}};me([w(),ge("design:type",String)],Tn.prototype,"model",void 0);me([w(),ge("design:type",String)],Tn.prototype,"status",void 0);me([w(),ge("design:type",Number)],Tn.prototype,"progress",void 0);me([w(),ge("design:type",Boolean)],Tn.prototype,"downloaded",void 0);me([w(),ge("design:type",Boolean)],Tn.prototype,"loaded",void 0);Tn=me([Z(),ge("design:paramtypes",[String,String,Number,Boolean,Boolean])],Tn);var T2=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},$e=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)},Pe,Jo,Xu=class{constructor(e,r=!0){Pe.set(this,void 0),Jo.set(this,new Map),T2(this,Pe,e,"f")}async getModels(){let e=await $e(this,Pe,"f").query({query:E`
|
|
694
|
+
}`,variables:{url:e,interactionCall:r}}));return n}};_r=new WeakMap;var cc={};cc.byteLength=m0;cc.toByteArray=y0;cc.fromByteArray=_0;var nr=[],$t=[],h0=typeof Uint8Array<"u"?Uint8Array:Array,Zu="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(En=0,Hd=Zu.length;En<Hd;++En)nr[En]=Zu[En],$t[Zu.charCodeAt(En)]=En;var En,Hd;$t["-".charCodeAt(0)]=62;$t["_".charCodeAt(0)]=63;function f1(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 m0(t){var e=f1(t),r=e[0],n=e[1];return(r+n)*3/4-n}function g0(t,e,r){return(e+r)*3/4-r}function y0(t){var e,r=f1(t),n=r[0],i=r[1],a=new h0(g0(t,n,i)),o=0,s=i>0?n-4:n,u;for(u=0;u<s;u+=4)e=$t[t.charCodeAt(u)]<<18|$t[t.charCodeAt(u+1)]<<12|$t[t.charCodeAt(u+2)]<<6|$t[t.charCodeAt(u+3)],a[o++]=e>>16&255,a[o++]=e>>8&255,a[o++]=e&255;return i===2&&(e=$t[t.charCodeAt(u)]<<2|$t[t.charCodeAt(u+1)]>>4,a[o++]=e&255),i===1&&(e=$t[t.charCodeAt(u)]<<10|$t[t.charCodeAt(u+1)]<<4|$t[t.charCodeAt(u+2)]>>2,a[o++]=e>>8&255,a[o++]=e&255),a}function v0(t){return nr[t>>18&63]+nr[t>>12&63]+nr[t>>6&63]+nr[t&63]}function b0(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(v0(n));return i.join("")}function _0(t){for(var e,r=t.length,n=r%3,i=[],a=16383,o=0,s=r-n;o<s;o+=a)i.push(b0(t,o,o+a>s?s:o+a));return n===1?(e=t[r-1],i.push(nr[e>>2]+nr[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],i.push(nr[e>>10]+nr[e>>4&63]+nr[e<<2&63]+"=")),i.join("")}var w0=4,Wd=0,Kd=1,S0=2;function qi(t){let e=t.length;for(;--e>=0;)t[e]=0}var C0=0,d1=1,x0=2,E0=3,k0=258,zl=29,uo=256,Ya=uo+1+zl,Di=30,Gl=19,h1=2*Ya+1,Rn=15,Ju=16,I0=7,Hl=256,m1=16,g1=17,y1=18,kl=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]),Os=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]),A0=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),v1=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),T0=512,wr=new Array((Ya+2)*2);qi(wr);var za=new Array(Di*2);qi(za);var Xa=new Array(T0);qi(Xa);var eo=new Array(k0-E0+1);qi(eo);var Wl=new Array(zl);qi(Wl);var Ks=new Array(Di);qi(Ks);function Yu(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 b1,_1,w1;function Xu(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}var S1=t=>t<256?Xa[t]:Xa[256+(t>>>7)],to=(t,e)=>{t.pending_buf[t.pending++]=e&255,t.pending_buf[t.pending++]=e>>>8&255},_t=(t,e,r)=>{t.bi_valid>Ju-r?(t.bi_buf|=e<<t.bi_valid&65535,to(t,t.bi_buf),t.bi_buf=e>>Ju-t.bi_valid,t.bi_valid+=r-Ju):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=r)},ir=(t,e,r)=>{_t(t,r[e*2],r[e*2+1])},C1=(t,e)=>{let r=0;do r|=t&1,t>>>=1,r<<=1;while(--e>0);return r>>>1},O0=t=>{t.bi_valid===16?(to(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)},D0=(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,f,p,h,g=0;for(f=0;f<=Rn;f++)t.bl_count[f]=0;for(r[t.heap[t.heap_max]*2+1]=0,c=t.heap_max+1;c<h1;c++)l=t.heap[c],f=r[r[l*2+1]*2+1]+1,f>u&&(f=u,g++),r[l*2+1]=f,!(l>n)&&(t.bl_count[f]++,p=0,l>=s&&(p=o[l-s]),h=r[l*2],t.opt_len+=h*(f+p),a&&(t.static_len+=h*(i[l*2+1]+p)));if(g!==0){do{for(f=u-1;t.bl_count[f]===0;)f--;t.bl_count[f]--,t.bl_count[f+1]+=2,t.bl_count[u]--,g-=2}while(g>0);for(f=u;f!==0;f--)for(l=t.bl_count[f];l!==0;)d=t.heap[--c],!(d>n)&&(r[d*2+1]!==f&&(t.opt_len+=(f-r[d*2+1])*r[d*2],r[d*2+1]=f),l--)}},x1=(t,e,r)=>{let n=new Array(Rn+1),i=0,a,o;for(a=1;a<=Rn;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]=C1(n[s]++,s))}},N0=()=>{let t,e,r,n,i,a=new Array(Rn+1);for(r=0,n=0;n<zl-1;n++)for(Wl[n]=r,t=0;t<1<<kl[n];t++)eo[r++]=n;for(eo[r-1]=n,i=0,n=0;n<16;n++)for(Ks[n]=i,t=0;t<1<<Os[n];t++)Xa[i++]=n;for(i>>=7;n<Di;n++)for(Ks[n]=i<<7,t=0;t<1<<Os[n]-7;t++)Xa[256+i++]=n;for(e=0;e<=Rn;e++)a[e]=0;for(t=0;t<=143;)wr[t*2+1]=8,t++,a[8]++;for(;t<=255;)wr[t*2+1]=9,t++,a[9]++;for(;t<=279;)wr[t*2+1]=7,t++,a[7]++;for(;t<=287;)wr[t*2+1]=8,t++,a[8]++;for(x1(wr,Ya+1,a),t=0;t<Di;t++)za[t*2+1]=5,za[t*2]=C1(t,5);b1=new Yu(wr,kl,uo+1,Ya,Rn),_1=new Yu(za,Os,0,Di,Rn),w1=new Yu(new Array(0),A0,0,Gl,I0)},E1=t=>{let e;for(e=0;e<Ya;e++)t.dyn_ltree[e*2]=0;for(e=0;e<Di;e++)t.dyn_dtree[e*2]=0;for(e=0;e<Gl;e++)t.bl_tree[e*2]=0;t.dyn_ltree[Hl*2]=1,t.opt_len=t.static_len=0,t.sym_next=t.matches=0},k1=t=>{t.bi_valid>8?to(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},Zd=(t,e,r,n)=>{let i=e*2,a=r*2;return t[i]<t[a]||t[i]===t[a]&&n[e]<=n[r]},el=(t,e,r)=>{let n=t.heap[r],i=r<<1;for(;i<=t.heap_len&&(i<t.heap_len&&Zd(e,t.heap[i+1],t.heap[i],t.depth)&&i++,!Zd(e,n,t.heap[i],t.depth));)t.heap[r]=t.heap[i],r=i,i<<=1;t.heap[r]=n},Jd=(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?ir(t,i,e):(o=eo[i],ir(t,o+uo+1,e),s=kl[o],s!==0&&(i-=Wl[o],_t(t,i,s)),n--,o=S1(n),ir(t,o,r),s=Os[o],s!==0&&(n-=Ks[o],_t(t,n,s)));while(a<t.sym_next);ir(t,Hl,e)},Il=(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=h1,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--)el(t,r,o);c=a;do o=t.heap[1],t.heap[1]=t.heap[t.heap_len--],el(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++,el(t,r,1);while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],D0(t,e),x1(r,u,t.bl_count)},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),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[m1*2]++):s<=10?t.bl_tree[g1*2]++:t.bl_tree[y1*2]++,s=0,i=a,o===0?(u=138,c=3):a===o?(u=6,c=3):(u=7,c=4))},Xd=(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 ir(t,a,t.bl_tree);while(--s!==0);else a!==0?(a!==i&&(ir(t,a,t.bl_tree),s--),ir(t,m1,t.bl_tree),_t(t,s-3,2)):s<=10?(ir(t,g1,t.bl_tree),_t(t,s-3,3)):(ir(t,y1,t.bl_tree),_t(t,s-11,7));s=0,i=a,o===0?(u=138,c=3):a===o?(u=6,c=3):(u=7,c=4)}},P0=t=>{let e;for(Yd(t,t.dyn_ltree,t.l_desc.max_code),Yd(t,t.dyn_dtree,t.d_desc.max_code),Il(t,t.bl_desc),e=Gl-1;e>=3&&t.bl_tree[v1[e]*2+1]===0;e--);return t.opt_len+=3*(e+1)+5+5+4,e},R0=(t,e,r,n)=>{let i;for(_t(t,e-257,5),_t(t,r-1,5),_t(t,n-4,4),i=0;i<n;i++)_t(t,t.bl_tree[v1[i]*2+1],3);Xd(t,t.dyn_ltree,e-1),Xd(t,t.dyn_dtree,r-1)},$0=t=>{let e=4093624447,r;for(r=0;r<=31;r++,e>>>=1)if(e&1&&t.dyn_ltree[r*2]!==0)return Wd;if(t.dyn_ltree[9*2]!==0||t.dyn_ltree[10*2]!==0||t.dyn_ltree[13*2]!==0)return Kd;for(r=32;r<uo;r++)if(t.dyn_ltree[r*2]!==0)return Kd;return Wd},eh=!1,L0=t=>{eh||(N0(),eh=!0),t.l_desc=new Xu(t.dyn_ltree,b1),t.d_desc=new Xu(t.dyn_dtree,_1),t.bl_desc=new Xu(t.bl_tree,w1),t.bi_buf=0,t.bi_valid=0,E1(t)},I1=(t,e,r,n)=>{_t(t,(C0<<1)+(n?1:0),3),k1(t),to(t,r),to(t,~r),r&&t.pending_buf.set(t.window.subarray(e,e+r),t.pending),t.pending+=r},F0=t=>{_t(t,d1<<1,3),ir(t,Hl,wr),O0(t)},M0=(t,e,r,n)=>{let i,a,o=0;t.level>0?(t.strm.data_type===S0&&(t.strm.data_type=$0(t)),Il(t,t.l_desc),Il(t,t.d_desc),o=P0(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?I1(t,e,r,n):t.strategy===w0||a===i?(_t(t,(d1<<1)+(n?1:0),3),Jd(t,wr,za)):(_t(t,(x0<<1)+(n?1:0),3),R0(t,t.l_desc.max_code+1,t.d_desc.max_code+1,o+1),Jd(t,t.dyn_ltree,t.dyn_dtree)),E1(t),n&&k1(t)},U0=(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[(eo[r]+uo+1)*2]++,t.dyn_dtree[S1(e)*2]++),t.sym_next===t.sym_end),j0=L0,B0=I1,q0=M0,V0=U0,Q0=F0,z0={_tr_init:j0,_tr_stored_block:B0,_tr_flush_block:q0,_tr_tally:V0,_tr_align:Q0},G0=(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},ro=G0,H0=()=>{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},W0=new Uint32Array(H0()),K0=(t,e,r,n)=>{let i=W0,a=n+r;t^=-1;for(let o=n;o<a;o++)t=t>>>8^i[(t^e[o])&255];return t^-1},He=K0,Vn={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"},Yn={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:Z0,_tr_stored_block:Al,_tr_flush_block:J0,_tr_tally:Zr,_tr_align:Y0}=z0,{Z_NO_FLUSH:Jr,Z_PARTIAL_FLUSH:X0,Z_FULL_FLUSH:e2,Z_FINISH:Ft,Z_BLOCK:th,Z_OK:tt,Z_STREAM_END:rh,Z_STREAM_ERROR:or,Z_DATA_ERROR:t2,Z_BUF_ERROR:tl,Z_DEFAULT_COMPRESSION:r2,Z_FILTERED:n2,Z_HUFFMAN_ONLY:hs,Z_RLE:i2,Z_FIXED:a2,Z_DEFAULT_STRATEGY:o2,Z_UNKNOWN:s2,Z_DEFLATED:uc}=Yn,c2=9,u2=15,l2=8,p2=29,f2=256,Tl=f2+1+p2,d2=30,h2=19,m2=2*Tl+1,g2=15,ne=3,Gr=258,sr=Gr+ne+1,y2=32,$i=42,Kl=57,Ol=69,Dl=73,Nl=91,Pl=103,$n=113,Ua=666,ft=1,Vi=2,Qn=3,Qi=4,v2=3,Ln=(t,e)=>(t.msg=Vn[e],e),nh=t=>t*2-(t>4?9:0),zr=t=>{let e=t.length;for(;--e>=0;)t[e]=0},b2=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)},_2=(t,e,r)=>(e<<t.hash_shift^r)&t.hash_mask,Yr=_2,Et=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))},It=(t,e)=>{J0(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,Et(t.strm)},le=(t,e)=>{t.pending_buf[t.pending++]=e},wa=(t,e)=>{t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=e&255},Rl=(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=ro(t.adler,e,i,r):t.state.wrap===2&&(t.adler=He(t.adler,e,i,r)),t.next_in+=i,t.total_in+=i,i)},A1=(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-sr?t.strstart-(t.w_size-sr):0,c=t.window,l=t.w_mask,d=t.prev,f=t.strstart+Gr,p=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]!==p||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<f);if(a=Gr-(f-n),n=f-Gr,a>o){if(t.match_start=e,o=a,a>=s)break;p=c[n+o-1],h=c[n+o]}}while((e=d[e&l])>u&&--r!==0);return o<=t.lookahead?o:t.lookahead},Li=t=>{let e=t.w_size,r,n,i;do{if(n=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-sr)&&(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),b2(t),n+=e),t.strm.avail_in===0)break;if(r=Rl(t.strm,t.window,t.strstart+t.lookahead,n),t.lookahead+=r,t.lookahead+t.insert>=ne)for(i=t.strstart-t.insert,t.ins_h=t.window[i],t.ins_h=Yr(t,t.ins_h,t.window[i+1]);t.insert&&(t.ins_h=Yr(t,t.ins_h,t.window[i+ne-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<ne)););}while(t.lookahead<sr&&t.strm.avail_in!==0)},T1=(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!==Ft||e===Jr||n!==i+t.strm.avail_in)))break;o=e===Ft&&n===i+t.strm.avail_in?1:0,Al(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,Et(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&&(Rl(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?Qi:e!==Jr&&e!==Ft&&t.strm.avail_in===0&&t.strstart===t.block_start?Vi:(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&&(Rl(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===Ft)&&e!==Jr&&t.strm.avail_in===0&&i<=a)&&(n=i>a?a:i,o=e===Ft&&t.strm.avail_in===0&&n===i?1:0,Al(t,t.block_start,n,o),t.block_start+=n,Et(t.strm)),o?Qn:ft)},rl=(t,e)=>{let r,n;for(;;){if(t.lookahead<sr){if(Li(t),t.lookahead<sr&&e===Jr)return ft;if(t.lookahead===0)break}if(r=0,t.lookahead>=ne&&(t.ins_h=Yr(t,t.ins_h,t.window[t.strstart+ne-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-sr&&(t.match_length=A1(t,r)),t.match_length>=ne)if(n=Zr(t,t.strstart-t.match_start,t.match_length-ne),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=ne){t.match_length--;do t.strstart++,t.ins_h=Yr(t,t.ins_h,t.window[t.strstart+ne-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=Yr(t,t.ins_h,t.window[t.strstart+1]);else n=Zr(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(It(t,!1),t.strm.avail_out===0))return ft}return t.insert=t.strstart<ne-1?t.strstart:ne-1,e===Ft?(It(t,!0),t.strm.avail_out===0?Qn:Qi):t.sym_next&&(It(t,!1),t.strm.avail_out===0)?ft:Vi},xi=(t,e)=>{let r,n,i;for(;;){if(t.lookahead<sr){if(Li(t),t.lookahead<sr&&e===Jr)return ft;if(t.lookahead===0)break}if(r=0,t.lookahead>=ne&&(t.ins_h=Yr(t,t.ins_h,t.window[t.strstart+ne-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=ne-1,r!==0&&t.prev_length<t.max_lazy_match&&t.strstart-r<=t.w_size-sr&&(t.match_length=A1(t,r),t.match_length<=5&&(t.strategy===n2||t.match_length===ne&&t.strstart-t.match_start>4096)&&(t.match_length=ne-1)),t.prev_length>=ne&&t.match_length<=t.prev_length){i=t.strstart+t.lookahead-ne,n=Zr(t,t.strstart-1-t.prev_match,t.prev_length-ne),t.lookahead-=t.prev_length-1,t.prev_length-=2;do++t.strstart<=i&&(t.ins_h=Yr(t,t.ins_h,t.window[t.strstart+ne-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=ne-1,t.strstart++,n&&(It(t,!1),t.strm.avail_out===0))return ft}else if(t.match_available){if(n=Zr(t,0,t.window[t.strstart-1]),n&&It(t,!1),t.strstart++,t.lookahead--,t.strm.avail_out===0)return ft}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=Zr(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<ne-1?t.strstart:ne-1,e===Ft?(It(t,!0),t.strm.avail_out===0?Qn:Qi):t.sym_next&&(It(t,!1),t.strm.avail_out===0)?ft:Vi},w2=(t,e)=>{let r,n,i,a,o=t.window;for(;;){if(t.lookahead<=Gr){if(Li(t),t.lookahead<=Gr&&e===Jr)return ft;if(t.lookahead===0)break}if(t.match_length=0,t.lookahead>=ne&&t.strstart>0&&(i=t.strstart-1,n=o[i],n===o[++i]&&n===o[++i]&&n===o[++i])){a=t.strstart+Gr;do;while(n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&i<a);t.match_length=Gr-(a-i),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=ne?(r=Zr(t,1,t.match_length-ne),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=Zr(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&(It(t,!1),t.strm.avail_out===0))return ft}return t.insert=0,e===Ft?(It(t,!0),t.strm.avail_out===0?Qn:Qi):t.sym_next&&(It(t,!1),t.strm.avail_out===0)?ft:Vi},S2=(t,e)=>{let r;for(;;){if(t.lookahead===0&&(Li(t),t.lookahead===0)){if(e===Jr)return ft;break}if(t.match_length=0,r=Zr(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(It(t,!1),t.strm.avail_out===0))return ft}return t.insert=0,e===Ft?(It(t,!0),t.strm.avail_out===0?Qn:Qi):t.sym_next&&(It(t,!1),t.strm.avail_out===0)?ft:Vi};function er(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 ja=[new er(0,0,0,0,T1),new er(4,4,8,4,rl),new er(4,5,16,8,rl),new er(4,6,32,32,rl),new er(4,4,16,16,xi),new er(8,16,32,32,xi),new er(8,16,128,128,xi),new er(8,32,128,256,xi),new er(32,128,258,1024,xi),new er(32,258,258,4096,xi)],C2=t=>{t.window_size=2*t.w_size,zr(t.head),t.max_lazy_match=ja[t.level].max_lazy,t.good_match=ja[t.level].good_length,t.nice_match=ja[t.level].nice_length,t.max_chain_length=ja[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=ne-1,t.match_available=0,t.ins_h=0};function x2(){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=uc,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(m2*2),this.dyn_dtree=new Uint16Array((2*d2+1)*2),this.bl_tree=new Uint16Array((2*h2+1)*2),zr(this.dyn_ltree),zr(this.dyn_dtree),zr(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(g2+1),this.heap=new Uint16Array(2*Tl+1),zr(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*Tl+1),zr(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 lo=t=>{if(!t)return 1;let e=t.state;return!e||e.strm!==t||e.status!==$i&&e.status!==Kl&&e.status!==Ol&&e.status!==Dl&&e.status!==Nl&&e.status!==Pl&&e.status!==$n&&e.status!==Ua?1:0},O1=t=>{if(lo(t))return Ln(t,or);t.total_in=t.total_out=0,t.data_type=s2;let e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap===2?Kl:e.wrap?$i:$n,t.adler=e.wrap===2?0:1,e.last_flush=-2,Z0(e),tt},D1=t=>{let e=O1(t);return e===tt&&C2(t.state),e},E2=(t,e)=>lo(t)||t.state.wrap!==2?or:(t.state.gzhead=e,tt),N1=(t,e,r,n,i,a)=>{if(!t)return or;let o=1;if(e===r2&&(e=6),n<0?(o=0,n=-n):n>15&&(o=2,n-=16),i<1||i>c2||r!==uc||n<8||n>15||e<0||e>9||a<0||a>a2||n===8&&o!==1)return Ln(t,or);n===8&&(n=9);let s=new x2;return t.state=s,s.strm=t,s.status=$i,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+ne-1)/ne),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,D1(t)},k2=(t,e)=>N1(t,e,uc,u2,l2,o2),I2=(t,e)=>{if(lo(t)||e>th||e<0)return t?Ln(t,or):or;let r=t.state;if(!t.output||t.avail_in!==0&&!t.input||r.status===Ua&&e!==Ft)return Ln(t,t.avail_out===0?tl:or);let n=r.last_flush;if(r.last_flush=e,r.pending!==0){if(Et(t),t.avail_out===0)return r.last_flush=-1,tt}else if(t.avail_in===0&&nh(e)<=nh(n)&&e!==Ft)return Ln(t,tl);if(r.status===Ua&&t.avail_in!==0)return Ln(t,tl);if(r.status===$i&&r.wrap===0&&(r.status=$n),r.status===$i){let i=uc+(r.w_bits-8<<4)<<8,a=-1;if(r.strategy>=hs||r.level<2?a=0:r.level<6?a=1:r.level===6?a=2:a=3,i|=a<<6,r.strstart!==0&&(i|=y2),i+=31-i%31,wa(r,i),r.strstart!==0&&(wa(r,t.adler>>>16),wa(r,t.adler&65535)),t.adler=1,r.status=$n,Et(t),r.pending!==0)return r.last_flush=-1,tt}if(r.status===Kl){if(t.adler=0,le(r,31),le(r,139),le(r,8),r.gzhead)le(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)),le(r,r.gzhead.time&255),le(r,r.gzhead.time>>8&255),le(r,r.gzhead.time>>16&255),le(r,r.gzhead.time>>24&255),le(r,r.level===9?2:r.strategy>=hs||r.level<2?4:0),le(r,r.gzhead.os&255),r.gzhead.extra&&r.gzhead.extra.length&&(le(r,r.gzhead.extra.length&255),le(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=He(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=Ol;else if(le(r,0),le(r,0),le(r,0),le(r,0),le(r,0),le(r,r.level===9?2:r.strategy>=hs||r.level<2?4:0),le(r,v2),r.status=$n,Et(t),r.pending!==0)return r.last_flush=-1,tt}if(r.status===Ol){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=He(t.adler,r.pending_buf,r.pending-i,i)),r.gzindex+=s,Et(t),r.pending!==0)return r.last_flush=-1,tt;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=He(t.adler,r.pending_buf,r.pending-i,i)),r.gzindex=0}r.status=Dl}if(r.status===Dl){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=He(t.adler,r.pending_buf,r.pending-i,i)),Et(t),r.pending!==0)return r.last_flush=-1,tt;i=0}r.gzindex<r.gzhead.name.length?a=r.gzhead.name.charCodeAt(r.gzindex++)&255:a=0,le(r,a)}while(a!==0);r.gzhead.hcrc&&r.pending>i&&(t.adler=He(t.adler,r.pending_buf,r.pending-i,i)),r.gzindex=0}r.status=Nl}if(r.status===Nl){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=He(t.adler,r.pending_buf,r.pending-i,i)),Et(t),r.pending!==0)return r.last_flush=-1,tt;i=0}r.gzindex<r.gzhead.comment.length?a=r.gzhead.comment.charCodeAt(r.gzindex++)&255:a=0,le(r,a)}while(a!==0);r.gzhead.hcrc&&r.pending>i&&(t.adler=He(t.adler,r.pending_buf,r.pending-i,i))}r.status=Pl}if(r.status===Pl){if(r.gzhead.hcrc){if(r.pending+2>r.pending_buf_size&&(Et(t),r.pending!==0))return r.last_flush=-1,tt;le(r,t.adler&255),le(r,t.adler>>8&255),t.adler=0}if(r.status=$n,Et(t),r.pending!==0)return r.last_flush=-1,tt}if(t.avail_in!==0||r.lookahead!==0||e!==Jr&&r.status!==Ua){let i=r.level===0?T1(r,e):r.strategy===hs?S2(r,e):r.strategy===i2?w2(r,e):ja[r.level].func(r,e);if((i===Qn||i===Qi)&&(r.status=Ua),i===ft||i===Qn)return t.avail_out===0&&(r.last_flush=-1),tt;if(i===Vi&&(e===X0?Y0(r):e!==th&&(Al(r,0,0,!1),e===e2&&(zr(r.head),r.lookahead===0&&(r.strstart=0,r.block_start=0,r.insert=0))),Et(t),t.avail_out===0))return r.last_flush=-1,tt}return e!==Ft?tt:r.wrap<=0?rh:(r.wrap===2?(le(r,t.adler&255),le(r,t.adler>>8&255),le(r,t.adler>>16&255),le(r,t.adler>>24&255),le(r,t.total_in&255),le(r,t.total_in>>8&255),le(r,t.total_in>>16&255),le(r,t.total_in>>24&255)):(wa(r,t.adler>>>16),wa(r,t.adler&65535)),Et(t),r.wrap>0&&(r.wrap=-r.wrap),r.pending!==0?tt:rh)},A2=t=>{if(lo(t))return or;let e=t.state.status;return t.state=null,e===$n?Ln(t,t2):tt},T2=(t,e)=>{let r=e.length;if(lo(t))return or;let n=t.state,i=n.wrap;if(i===2||i===1&&n.status!==$i||n.lookahead)return or;if(i===1&&(t.adler=ro(t.adler,e,r,0)),n.wrap=0,r>=n.w_size){i===0&&(zr(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,Li(n);n.lookahead>=ne;){let u=n.strstart,c=n.lookahead-(ne-1);do n.ins_h=Yr(n,n.ins_h,n.window[u+ne-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=ne-1,Li(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=ne-1,n.match_available=0,t.next_in=o,t.input=s,t.avail_in=a,n.wrap=i,tt},O2=k2,D2=N1,N2=D1,P2=O1,R2=E2,$2=I2,L2=A2,F2=T2,M2="pako deflate (from Nodeca project)",Ga={deflateInit:O2,deflateInit2:D2,deflateReset:N2,deflateResetKeep:P2,deflateSetHeader:R2,deflate:$2,deflateEnd:L2,deflateSetDictionary:F2,deflateInfo:M2},U2=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),j2=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)U2(r,n)&&(t[n]=r[n])}}return t},B2=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},lc={assign:j2,flattenChunks:B2},P1=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){P1=!1}var no=new Uint8Array(256);for(let t=0;t<256;t++)no[t]=t>=252?6:t>=248?5:t>=240?4:t>=224?3:t>=192?2:1;no[254]=no[254]=1;var q2=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&&P1)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},Q2=(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=no[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)},z2=(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+no[t[r]]>e?r:e},io={string2buf:q2,buf2string:Q2,utf8border:z2};function G2(){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 R1=G2,$1=Object.prototype.toString,{Z_NO_FLUSH:H2,Z_SYNC_FLUSH:W2,Z_FULL_FLUSH:K2,Z_FINISH:Z2,Z_OK:Zs,Z_STREAM_END:J2,Z_DEFAULT_COMPRESSION:Y2,Z_DEFAULT_STRATEGY:X2,Z_DEFLATED:ev}=Yn;function po(t){this.options=lc.assign({level:Y2,method:ev,chunkSize:16384,windowBits:15,memLevel:8,strategy:X2},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 R1,this.strm.avail_out=0;let r=Ga.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(r!==Zs)throw new Error(Vn[r]);if(e.header&&Ga.deflateSetHeader(this.strm,e.header),e.dictionary){let n;if(typeof e.dictionary=="string"?n=io.string2buf(e.dictionary):$1.call(e.dictionary)==="[object ArrayBuffer]"?n=new Uint8Array(e.dictionary):n=e.dictionary,r=Ga.deflateSetDictionary(this.strm,n),r!==Zs)throw new Error(Vn[r]);this._dict_set=!0}}po.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?Z2:H2,typeof t=="string"?r.input=io.string2buf(t):$1.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===W2||a===K2)&&r.avail_out<=6){this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;continue}if(i=Ga.deflate(r,a),i===J2)return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),i=Ga.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===Zs;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};po.prototype.onData=function(t){this.chunks.push(t)};po.prototype.onEnd=function(t){t===Zs&&(this.result=lc.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function Zl(t,e){let r=new po(e);if(r.push(t,!0),r.err)throw r.msg||Vn[r.err];return r.result}function tv(t,e){return e=e||{},e.raw=!0,Zl(t,e)}function rv(t,e){return e=e||{},e.gzip=!0,Zl(t,e)}var nv=po,iv=Zl,av=tv,ov=rv,sv=Yn,cv={Deflate:nv,deflate:iv,deflateRaw:av,gzip:ov,constants:sv},ms=16209,uv=16191,lv=function t(e,r){let n,i,a,o,s,u,c,l,d,f,p,h,g,v,C,_,b,y,T,R,k,P,F,$,q=e.state;n=e.next_in,F=e.input,i=n+(e.avail_in-5),a=e.next_out,$=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,f=q.window,p=q.hold,h=q.bits,g=q.lencode,v=q.distcode,C=(1<<q.lenbits)-1,_=(1<<q.distbits)-1;e:do{h<15&&(p+=F[n++]<<h,h+=8,p+=F[n++]<<h,h+=8),b=g[p&C];t:for(;;){if(y=b>>>24,p>>>=y,h-=y,y=b>>>16&255,y===0)$[a++]=b&65535;else if(y&16){T=b&65535,y&=15,y&&(h<y&&(p+=F[n++]<<h,h+=8),T+=p&(1<<y)-1,p>>>=y,h-=y),h<15&&(p+=F[n++]<<h,h+=8,p+=F[n++]<<h,h+=8),b=v[p&_];r:for(;;){if(y=b>>>24,p>>>=y,h-=y,y=b>>>16&255,y&16){if(R=b&65535,y&=15,h<y&&(p+=F[n++]<<h,h+=8,h<y&&(p+=F[n++]<<h,h+=8)),R+=p&(1<<y)-1,R>u){e.msg="invalid distance too far back",q.mode=ms;break e}if(p>>>=y,h-=y,y=a-o,R>y){if(y=R-y,y>l&&q.sane){e.msg="invalid distance too far back",q.mode=ms;break e}if(k=0,P=f,d===0){if(k+=c-y,y<T){T-=y;do $[a++]=f[k++];while(--y);k=a-R,P=$}}else if(d<y){if(k+=c+d-y,y-=d,y<T){T-=y;do $[a++]=f[k++];while(--y);if(k=0,d<T){y=d,T-=y;do $[a++]=f[k++];while(--y);k=a-R,P=$}}}else if(k+=d-y,y<T){T-=y;do $[a++]=f[k++];while(--y);k=a-R,P=$}for(;T>2;)$[a++]=P[k++],$[a++]=P[k++],$[a++]=P[k++],T-=3;T&&($[a++]=P[k++],T>1&&($[a++]=P[k++]))}else{k=a-R;do $[a++]=$[k++],$[a++]=$[k++],$[a++]=$[k++],T-=3;while(T>2);T&&($[a++]=$[k++],T>1&&($[a++]=$[k++]))}}else if((y&64)===0){b=v[(b&65535)+(p&(1<<y)-1)];continue r}else{e.msg="invalid distance code",q.mode=ms;break e}break}}else if((y&64)===0){b=g[(b&65535)+(p&(1<<y)-1)];continue t}else if(y&32){q.mode=uv;break e}else{e.msg="invalid literal/length code",q.mode=ms;break e}break}}while(n<i&&a<s);T=h>>3,n-=T,h-=T<<3,p&=(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=p,q.bits=h},Ei=15,ih=852,ah=592,oh=0,nl=1,sh=2,pv=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]),fv=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]),dv=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]),hv=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]),mv=(t,e,r,n,i,a,o,s)=>{let u=s.bits,c=0,l=0,d=0,f=0,p=0,h=0,g=0,v=0,C=0,_=0,b,y,T,R,k,P=null,F,$=new Uint16Array(Ei+1),q=new Uint16Array(Ei+1),Ze=null,Me,V,be;for(c=0;c<=Ei;c++)$[c]=0;for(l=0;l<n;l++)$[e[r+l]]++;for(p=u,f=Ei;f>=1&&$[f]===0;f--);if(p>f&&(p=f),f===0)return i[a++]=1<<24|64<<16|0,i[a++]=1<<24|64<<16|0,s.bits=1,0;for(d=1;d<f&&$[d]===0;d++);for(p<d&&(p=d),v=1,c=1;c<=Ei;c++)if(v<<=1,v-=$[c],v<0)return-1;if(v>0&&(t===oh||f!==1))return-1;for(q[1]=0,c=1;c<Ei;c++)q[c+1]=q[c]+$[c];for(l=0;l<n;l++)e[r+l]!==0&&(o[q[e[r+l]]++]=l);if(t===oh?(P=Ze=o,F=20):t===nl?(P=pv,Ze=fv,F=257):(P=dv,Ze=hv,F=0),_=0,l=0,c=d,k=a,h=p,g=0,T=-1,C=1<<p,R=C-1,t===nl&&C>ih||t===sh&&C>ah)return 1;for(;;){Me=c-g,o[l]+1<F?(V=0,be=o[l]):o[l]>=F?(V=Ze[o[l]-F],be=P[o[l]-F]):(V=32+64,be=0),b=1<<c-g,y=1<<h,d=y;do y-=b,i[k+(_>>g)+y]=Me<<24|V<<16|be|0;while(y!==0);for(b=1<<c-1;_&b;)b>>=1;if(b!==0?(_&=b-1,_+=b):_=0,l++,--$[c]===0){if(c===f)break;c=e[r+o[l]]}if(c>p&&(_&R)!==T){for(g===0&&(g=p),k+=d,h=c-g,v=1<<h;h+g<f&&(v-=$[h+g],!(v<=0));)h++,v<<=1;if(C+=1<<h,t===nl&&C>ih||t===sh&&C>ah)return 1;T=_&R,i[T]=p<<24|h<<16|k-a|0}}return _!==0&&(i[k+_]=c-g<<24|64<<16|0),s.bits=p,0},Ha=mv,gv=0,L1=1,F1=2,{Z_FINISH:ch,Z_BLOCK:yv,Z_TREES:gs,Z_OK:zn,Z_STREAM_END:vv,Z_NEED_DICT:bv,Z_STREAM_ERROR:Mt,Z_DATA_ERROR:M1,Z_MEM_ERROR:U1,Z_BUF_ERROR:_v,Z_DEFLATED:uh}=Yn,pc=16180,lh=16181,ph=16182,fh=16183,dh=16184,hh=16185,mh=16186,gh=16187,yh=16188,vh=16189,Js=16190,yr=16191,il=16192,bh=16193,al=16194,_h=16195,wh=16196,Sh=16197,Ch=16198,ys=16199,vs=16200,xh=16201,Eh=16202,kh=16203,Ih=16204,Ah=16205,ol=16206,Th=16207,Oh=16208,Ee=16209,j1=16210,B1=16211,wv=852,Sv=592,Cv=15,xv=Cv,Dh=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 Xn=t=>{if(!t)return 1;let e=t.state;return!e||e.strm!==t||e.mode<pc||e.mode>B1?1:0},q1=t=>{if(Xn(t))return Mt;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=pc,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(wv),e.distcode=e.distdyn=new Int32Array(Sv),e.sane=1,e.back=-1,zn},V1=t=>{if(Xn(t))return Mt;let e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,q1(t)},Q1=(t,e)=>{let r;if(Xn(t))return Mt;let n=t.state;return e<0?(r=0,e=-e):(r=(e>>4)+5,e<48&&(e&=15)),e&&(e<8||e>15)?Mt:(n.window!==null&&n.wbits!==e&&(n.window=null),n.wrap=r,n.wbits=e,V1(t))},z1=(t,e)=>{if(!t)return Mt;let r=new Ev;t.state=r,r.strm=t,r.window=null,r.mode=pc;let n=Q1(t,e);return n!==zn&&(t.state=null),n},kv=t=>z1(t,xv),Nh=!0,sl,cl,Iv=t=>{if(Nh){sl=new Int32Array(512),cl=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(Ha(L1,t.lens,0,288,sl,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;Ha(F1,t.lens,0,32,cl,0,t.work,{bits:5}),Nh=!1}t.lencode=sl,t.lenbits=9,t.distcode=cl,t.distbits=5},G1=(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},Av=(t,e)=>{let r,n,i,a,o,s,u,c,l,d,f,p,h,g,v=0,C,_,b,y,T,R,k,P,F=new Uint8Array(4),$,q,Ze=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Xn(t)||!t.output||!t.input&&t.avail_in!==0)return Mt;r=t.state,r.mode===yr&&(r.mode=il),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,f=u,P=zn;e:for(;;)switch(r.mode){case pc:if(r.wrap===0){r.mode=il;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=He(r.check,F,2,0),c=0,l=0,r.mode=lh;break}if(r.head&&(r.head.done=!1),!(r.wrap&1)||(((c&255)<<8)+(c>>8))%31){t.msg="incorrect header check",r.mode=Ee;break}if((c&15)!==uh){t.msg="unknown compression method",r.mode=Ee;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=Ee;break}r.dmax=1<<r.wbits,r.flags=0,t.adler=r.check=1,r.mode=c&512?vh:yr,c=0,l=0;break;case lh:for(;l<16;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(r.flags=c,(r.flags&255)!==uh){t.msg="unknown compression method",r.mode=Ee;break}if(r.flags&57344){t.msg="unknown header flags set",r.mode=Ee;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=He(r.check,F,2,0)),c=0,l=0,r.mode=ph;case ph: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=He(r.check,F,4,0)),c=0,l=0,r.mode=fh;case fh: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=He(r.check,F,2,0)),c=0,l=0,r.mode=dh;case dh: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=He(r.check,F,2,0)),c=0,l=0}else r.head&&(r.head.extra=null);r.mode=hh;case hh:if(r.flags&1024&&(p=r.length,p>s&&(p=s),p&&(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+p),k)),r.flags&512&&r.wrap&4&&(r.check=He(r.check,n,p,a)),s-=p,a+=p,r.length-=p),r.length))break e;r.length=0,r.mode=mh;case mh:if(r.flags&2048){if(s===0)break e;p=0;do k=n[a+p++],r.head&&k&&r.length<65536&&(r.head.name+=String.fromCharCode(k));while(k&&p<s);if(r.flags&512&&r.wrap&4&&(r.check=He(r.check,n,p,a)),s-=p,a+=p,k)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=gh;case gh:if(r.flags&4096){if(s===0)break e;p=0;do k=n[a+p++],r.head&&k&&r.length<65536&&(r.head.comment+=String.fromCharCode(k));while(k&&p<s);if(r.flags&512&&r.wrap&4&&(r.check=He(r.check,n,p,a)),s-=p,a+=p,k)break e}else r.head&&(r.head.comment=null);r.mode=yh;case yh: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=Ee;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=yr;break;case vh:for(;l<32;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}t.adler=r.check=Dh(c),c=0,l=0,r.mode=Js;case Js: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,bv;t.adler=r.check=1,r.mode=yr;case yr:if(e===yv||e===gs)break e;case il:if(r.last){c>>>=l&7,l-=l&7,r.mode=ol;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=bh;break;case 1:if(Iv(r),r.mode=ys,e===gs){c>>>=2,l-=2;break e}break;case 2:r.mode=wh;break;case 3:t.msg="invalid block type",r.mode=Ee}c>>>=2,l-=2;break;case bh: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=Ee;break}if(r.length=c&65535,c=0,l=0,r.mode=al,e===gs)break e;case al:r.mode=_h;case _h:if(p=r.length,p){if(p>s&&(p=s),p>u&&(p=u),p===0)break e;i.set(n.subarray(a,a+p),o),s-=p,a+=p,u-=p,o+=p,r.length-=p;break}r.mode=yr;break;case wh: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=Ee;break}r.have=0,r.mode=Sh;case Sh:for(;r.have<r.ncode;){for(;l<3;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}r.lens[Ze[r.have++]]=c&7,c>>>=3,l-=3}for(;r.have<19;)r.lens[Ze[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,$={bits:r.lenbits},P=Ha(gv,r.lens,0,19,r.lencode,0,r.work,$),r.lenbits=$.bits,P){t.msg="invalid code lengths set",r.mode=Ee;break}r.have=0,r.mode=Ch;case Ch:for(;r.have<r.nlen+r.ndist;){for(;v=r.lencode[c&(1<<r.lenbits)-1],C=v>>>24,_=v>>>16&255,b=v&65535,!(C<=l);){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(b<16)c>>>=C,l-=C,r.lens[r.have++]=b;else{if(b===16){for(q=C+2;l<q;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(c>>>=C,l-=C,r.have===0){t.msg="invalid bit length repeat",r.mode=Ee;break}k=r.lens[r.have-1],p=3+(c&3),c>>>=2,l-=2}else if(b===17){for(q=C+3;l<q;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}c>>>=C,l-=C,k=0,p=3+(c&7),c>>>=3,l-=3}else{for(q=C+7;l<q;){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}c>>>=C,l-=C,k=0,p=11+(c&127),c>>>=7,l-=7}if(r.have+p>r.nlen+r.ndist){t.msg="invalid bit length repeat",r.mode=Ee;break}for(;p--;)r.lens[r.have++]=k}}if(r.mode===Ee)break;if(r.lens[256]===0){t.msg="invalid code -- missing end-of-block",r.mode=Ee;break}if(r.lenbits=9,$={bits:r.lenbits},P=Ha(L1,r.lens,0,r.nlen,r.lencode,0,r.work,$),r.lenbits=$.bits,P){t.msg="invalid literal/lengths set",r.mode=Ee;break}if(r.distbits=6,r.distcode=r.distdyn,$={bits:r.distbits},P=Ha(F1,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,$),r.distbits=$.bits,P){t.msg="invalid distances set",r.mode=Ee;break}if(r.mode=ys,e===gs)break e;case ys:r.mode=vs;case vs: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,lv(t,f),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===yr&&(r.back=-1);break}for(r.back=0;v=r.lencode[c&(1<<r.lenbits)-1],C=v>>>24,_=v>>>16&255,b=v&65535,!(C<=l);){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if(_&&(_&240)===0){for(y=C,T=_,R=b;v=r.lencode[R+((c&(1<<y+T)-1)>>y)],C=v>>>24,_=v>>>16&255,b=v&65535,!(y+C<=l);){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}c>>>=y,l-=y,r.back+=y}if(c>>>=C,l-=C,r.back+=C,r.length=b,_===0){r.mode=Ah;break}if(_&32){r.back=-1,r.mode=yr;break}if(_&64){t.msg="invalid literal/length code",r.mode=Ee;break}r.extra=_&15,r.mode=xh;case xh: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=Eh;case Eh:for(;v=r.distcode[c&(1<<r.distbits)-1],C=v>>>24,_=v>>>16&255,b=v&65535,!(C<=l);){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}if((_&240)===0){for(y=C,T=_,R=b;v=r.distcode[R+((c&(1<<y+T)-1)>>y)],C=v>>>24,_=v>>>16&255,b=v&65535,!(y+C<=l);){if(s===0)break e;s--,c+=n[a++]<<l,l+=8}c>>>=y,l-=y,r.back+=y}if(c>>>=C,l-=C,r.back+=C,_&64){t.msg="invalid distance code",r.mode=Ee;break}r.offset=b,r.extra=_&15,r.mode=kh;case kh: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=Ee;break}r.mode=Ih;case Ih:if(u===0)break e;if(p=f-u,r.offset>p){if(p=r.offset-p,p>r.whave&&r.sane){t.msg="invalid distance too far back",r.mode=Ee;break}p>r.wnext?(p-=r.wnext,h=r.wsize-p):h=r.wnext-p,p>r.length&&(p=r.length),g=r.window}else g=i,h=o-r.offset,p=r.length;p>u&&(p=u),u-=p,r.length-=p;do i[o++]=g[h++];while(--p);r.length===0&&(r.mode=vs);break;case Ah:if(u===0)break e;i[o++]=r.length,u--,r.mode=vs;break;case ol:if(r.wrap){for(;l<32;){if(s===0)break e;s--,c|=n[a++]<<l,l+=8}if(f-=u,t.total_out+=f,r.total+=f,r.wrap&4&&f&&(t.adler=r.check=r.flags?He(r.check,i,f,o-f):ro(r.check,i,f,o-f)),f=u,r.wrap&4&&(r.flags?c:Dh(c))!==r.check){t.msg="incorrect data check",r.mode=Ee;break}c=0,l=0}r.mode=Th;case Th: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=Ee;break}c=0,l=0}r.mode=Oh;case Oh:P=vv;break e;case Ee:P=M1;break e;case j1:return U1;case B1:default:return Mt}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||f!==t.avail_out&&r.mode<Ee&&(r.mode<ol||e!==ch))&&G1(t,t.output,t.next_out,f-t.avail_out),d-=t.avail_in,f-=t.avail_out,t.total_in+=d,t.total_out+=f,r.total+=f,r.wrap&4&&f&&(t.adler=r.check=r.flags?He(r.check,i,f,t.next_out-f):ro(r.check,i,f,t.next_out-f)),t.data_type=r.bits+(r.last?64:0)+(r.mode===yr?128:0)+(r.mode===ys||r.mode===al?256:0),(d===0&&f===0||e===ch)&&P===zn&&(P=_v),P},Tv=t=>{if(Xn(t))return Mt;let e=t.state;return e.window&&(e.window=null),t.state=null,zn},Ov=(t,e)=>{if(Xn(t))return Mt;let r=t.state;return(r.wrap&2)===0?Mt:(r.head=e,e.done=!1,zn)},Dv=(t,e)=>{let r=e.length,n,i,a;return Xn(t)||(n=t.state,n.wrap!==0&&n.mode!==Js)?Mt:n.mode===Js&&(i=1,i=ro(i,e,r,0),i!==n.check)?M1:(a=G1(t,e,r,r),a?(n.mode=j1,U1):(n.havedict=1,zn))},Nv=V1,Pv=Q1,Rv=q1,$v=kv,Lv=z1,Fv=Av,Mv=Tv,Uv=Ov,jv=Dv,Bv="pako inflate (from Nodeca project)",Sr={inflateReset:Nv,inflateReset2:Pv,inflateResetKeep:Rv,inflateInit:$v,inflateInit2:Lv,inflate:Fv,inflateEnd:Mv,inflateGetHeader:Uv,inflateSetDictionary:jv,inflateInfo:Bv};function qv(){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=qv,H1=Object.prototype.toString,{Z_NO_FLUSH:Qv,Z_FINISH:zv,Z_OK:ao,Z_STREAM_END:ul,Z_NEED_DICT:ll,Z_STREAM_ERROR:Gv,Z_DATA_ERROR:Ph,Z_MEM_ERROR:Hv}=Yn;function fo(t){this.options=lc.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 R1,this.strm.avail_out=0;let r=Sr.inflateInit2(this.strm,e.windowBits);if(r!==ao)throw new Error(Vn[r]);if(this.header=new Vv,Sr.inflateGetHeader(this.strm,this.header),e.dictionary&&(typeof e.dictionary=="string"?e.dictionary=io.string2buf(e.dictionary):H1.call(e.dictionary)==="[object ArrayBuffer]"&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(r=Sr.inflateSetDictionary(this.strm,e.dictionary),r!==ao)))throw new Error(Vn[r])}fo.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?zv:Qv,H1.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=Sr.inflate(r,o),a===ll&&i&&(a=Sr.inflateSetDictionary(r,i),a===ao?a=Sr.inflate(r,o):a===Ph&&(a=ll));r.avail_in>0&&a===ul&&r.state.wrap>0&&t[r.next_in]!==0;)Sr.inflateReset(r),a=Sr.inflate(r,o);switch(a){case Gv:case Ph:case ll:case Hv:return this.onEnd(a),this.ended=!0,!1}if(s=r.avail_out,r.next_out&&(r.avail_out===0||a===ul))if(this.options.to==="string"){let u=io.utf8border(r.output,r.next_out),c=r.next_out-u,l=io.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===ao&&s===0)){if(a===ul)return a=Sr.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,!0;if(r.avail_in===0)break}}return!0};fo.prototype.onData=function(t){this.chunks.push(t)};fo.prototype.onEnd=function(t){t===ao&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=lc.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function Jl(t,e){let r=new fo(e);if(r.push(t),r.err)throw r.msg||Vn[r.err];return r.result}function Wv(t,e){return e=e||{},e.raw=!0,Jl(t,e)}var Kv=fo,Zv=Jl,Jv=Wv,Yv=Jl,Xv=Yn,e3={Inflate:Kv,inflate:Zv,inflateRaw:Jv,ungzip:Yv,constants:Xv},{Deflate:t3,deflate:r3,deflateRaw:n3,gzip:i3}=cv,{Inflate:a3,inflate:o3,inflateRaw:s3,ungzip:c3}=e3,u3=t3,l3=r3,p3=n3,f3=i3,d3=a3,h3=o3,m3=s3,g3=c3,y3=Yn,v3={Deflate:u3,deflate:l3,deflateRaw:p3,gzip:f3,Inflate:d3,inflate:h3,inflateRaw:m3,ungzip:g3,constants:y3},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)},Ys=class{constructor(e,r){this.input=e,this.output=r}};we([m(),Se("design:type",String)],Ys.prototype,"input",void 0);we([m(),Se("design:type",String)],Ys.prototype,"output",void 0);Ys=we([Ke(),Se("design:paramtypes",[String,String])],Ys);var Xs=class{constructor(e,r){this.input=e,this.output=r}};we([m(),Se("design:type",String)],Xs.prototype,"input",void 0);we([m(),Se("design:type",String)],Xs.prototype,"output",void 0);Xs=we([W(),Se("design:paramtypes",[String,String])],Xs);var nn=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)],nn.prototype,"name",void 0);we([m(),Se("design:type",String)],nn.prototype,"modelId",void 0);we([m(),Se("design:type",String)],nn.prototype,"systemPrompt",void 0);we([m(),Se("design:type",Array)],nn.prototype,"promptExamples",void 0);we([m(),Se("design:type",String)],nn.prototype,"metaData",void 0);nn=we([Ke(),Se("design:paramtypes",[String,String,String,Array,String])],nn);var ur=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)],ur.prototype,"name",void 0);we([m(),Se("design:type",String)],ur.prototype,"modelId",void 0);we([m(),Se("design:type",String)],ur.prototype,"taskId",void 0);we([m(),Se("design:type",String)],ur.prototype,"systemPrompt",void 0);we([m(),Se("design:type",Array)],ur.prototype,"promptExamples",void 0);we([m(),Se("design:type",String)],ur.prototype,"metaData",void 0);we([m(),Se("design:type",String)],ur.prototype,"createdAt",void 0);we([m(),Se("design:type",String)],ur.prototype,"updatedAt",void 0);ur=we([W(),Se("design:paramtypes",[String,String,String,String,Array,String,String,String])],ur);var Gn=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)],Gn.prototype,"model",void 0);we([m(),Se("design:type",String)],Gn.prototype,"status",void 0);we([m(),Se("design:type",Number)],Gn.prototype,"progress",void 0);we([m(),Se("design:type",Boolean)],Gn.prototype,"downloaded",void 0);we([m(),Se("design:type",Boolean)],Gn.prototype,"loaded",void 0);Gn=we([W(),Se("design:paramtypes",[String,String,Number,Boolean,Boolean])],Gn);var b3=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)},Be,Ds,$l=class{constructor(e,r=!0){Be.set(this,void 0),Ds.set(this,new Map),b3(this,Be,e,"f")}async getModels(){let e=await Qe(this,Be,"f").query({query:E`
|
|
651
695
|
query {
|
|
652
696
|
aiGetModels {
|
|
653
697
|
id
|
|
@@ -660,29 +704,34 @@ triggerMatch
|
|
|
660
704
|
}
|
|
661
705
|
local {
|
|
662
706
|
fileName
|
|
663
|
-
tokenizerSource
|
|
664
|
-
|
|
707
|
+
tokenizerSource {
|
|
708
|
+
repo
|
|
709
|
+
revision
|
|
710
|
+
fileName
|
|
711
|
+
}
|
|
712
|
+
huggingfaceRepo
|
|
713
|
+
revision
|
|
665
714
|
}
|
|
666
715
|
modelType
|
|
667
716
|
}
|
|
668
717
|
}
|
|
669
|
-
`});return
|
|
718
|
+
`});return I(e).aiGetModels}async addModel(e){let r=await Qe(this,Be,"f").mutate({mutation:E`
|
|
670
719
|
mutation($model: ModelInput!) {
|
|
671
720
|
aiAddModel(model: $model)
|
|
672
721
|
}
|
|
673
|
-
`,variables:{model:e}});return
|
|
722
|
+
`,variables:{model:e}});return I(r).aiAddModel}async updateModel(e,r){let n=await Qe(this,Be,"f").mutate({mutation:E`
|
|
674
723
|
mutation($modelId: String!, $model: ModelInput!) {
|
|
675
724
|
aiUpdateModel(modelId: $modelId, model: $model)
|
|
676
725
|
}
|
|
677
|
-
`,variables:{modelId:e,model:r}});return
|
|
726
|
+
`,variables:{modelId:e,model:r}});return I(n).aiUpdateModel}async removeModel(e){let r=await Qe(this,Be,"f").mutate({mutation:E`
|
|
678
727
|
mutation($modelId: String!) {
|
|
679
728
|
aiRemoveModel(modelId: $modelId)
|
|
680
729
|
}
|
|
681
|
-
`,variables:{modelId:e}});return
|
|
730
|
+
`,variables:{modelId:e}});return I(r).aiRemoveModel}async setDefaultModel(e,r){let n=await Qe(this,Be,"f").mutate({mutation:E`
|
|
682
731
|
mutation($modelType: ModelType!, $modelId: String!) {
|
|
683
732
|
aiSetDefaultModel(modelType: $modelType modelId: $modelId)
|
|
684
733
|
}
|
|
685
|
-
`,variables:{modelId:r,modelType:e}});return
|
|
734
|
+
`,variables:{modelId:r,modelType:e}});return I(n).aiSetDefaultModel}async getDefaultModel(e){let r=await Qe(this,Be,"f").query({query:E`
|
|
686
735
|
query($modelType: ModelType!) {
|
|
687
736
|
aiGetDefaultModel(modelType: $modelType) {
|
|
688
737
|
id
|
|
@@ -695,13 +744,18 @@ triggerMatch
|
|
|
695
744
|
}
|
|
696
745
|
local {
|
|
697
746
|
fileName
|
|
698
|
-
tokenizerSource
|
|
699
|
-
|
|
747
|
+
tokenizerSource {
|
|
748
|
+
repo
|
|
749
|
+
revision
|
|
750
|
+
fileName
|
|
751
|
+
}
|
|
752
|
+
huggingfaceRepo
|
|
753
|
+
revision
|
|
700
754
|
}
|
|
701
755
|
modelType
|
|
702
756
|
}
|
|
703
757
|
}
|
|
704
|
-
`,variables:{modelType:e}});return
|
|
758
|
+
`,variables:{modelType:e}});return I(r).aiGetDefaultModel}async tasks(){let{aiTasks:e}=I(await Qe(this,Be,"f").query({query:E`
|
|
705
759
|
query {
|
|
706
760
|
aiTasks {
|
|
707
761
|
name
|
|
@@ -717,7 +771,7 @@ triggerMatch
|
|
|
717
771
|
updatedAt
|
|
718
772
|
}
|
|
719
773
|
}
|
|
720
|
-
`}));return e}async addTask(e,r,n,i,a){let o=new
|
|
774
|
+
`}));return e}async addTask(e,r,n,i,a){let o=new nn(e,r,n,i,a),{aiAddTask:s}=I(await Qe(this,Be,"f").mutate({mutation:E`
|
|
721
775
|
mutation AiAddTask($task: AITaskInput!) {
|
|
722
776
|
aiAddTask(task: $task) {
|
|
723
777
|
name
|
|
@@ -733,7 +787,7 @@ triggerMatch
|
|
|
733
787
|
updatedAt
|
|
734
788
|
}
|
|
735
789
|
}
|
|
736
|
-
`,variables:{task:o}}));return s}async removeTask(e){let{aiRemoveTask:r}=
|
|
790
|
+
`,variables:{task:o}}));return s}async removeTask(e){let{aiRemoveTask:r}=I(await Qe(this,Be,"f").mutate({mutation:E`
|
|
737
791
|
mutation AiRemoveTask($taskId: String!) {
|
|
738
792
|
aiRemoveTask(taskId: $taskId) {
|
|
739
793
|
name
|
|
@@ -749,7 +803,7 @@ triggerMatch
|
|
|
749
803
|
updatedAt
|
|
750
804
|
}
|
|
751
805
|
}
|
|
752
|
-
`,variables:{taskId:e}}));return r}async updateTask(e,r){let{aiUpdateTask:n}=
|
|
806
|
+
`,variables:{taskId:e}}));return r}async updateTask(e,r){let{aiUpdateTask:n}=I(await Qe(this,Be,"f").mutate({mutation:E`
|
|
753
807
|
mutation AiUpdateTask($taskId: String!, $task: AITaskInput!) {
|
|
754
808
|
aiUpdateTask(taskId: $taskId, task: $task) {
|
|
755
809
|
name
|
|
@@ -765,7 +819,7 @@ triggerMatch
|
|
|
765
819
|
updatedAt
|
|
766
820
|
}
|
|
767
821
|
}
|
|
768
|
-
`,variables:{taskId:e,task:{name:r.name,modelId:r.modelId,systemPrompt:r.systemPrompt,promptExamples:r.promptExamples}}}));return n}async modelLoadingStatus(e){let{aiModelLoadingStatus:r}=
|
|
822
|
+
`,variables:{taskId:e,task:{name:r.name,modelId:r.modelId,systemPrompt:r.systemPrompt,promptExamples:r.promptExamples}}}));return n}async modelLoadingStatus(e){let{aiModelLoadingStatus:r}=I(await Qe(this,Be,"f").query({query:E`
|
|
769
823
|
query AiModelLoadingStatus($model: String!) {
|
|
770
824
|
aiModelLoadingStatus(model: $model) {
|
|
771
825
|
model
|
|
@@ -775,51 +829,51 @@ triggerMatch
|
|
|
775
829
|
downloaded
|
|
776
830
|
}
|
|
777
831
|
}
|
|
778
|
-
`,variables:{model:e}}));return r}async prompt(e,r){let{aiPrompt:n}=
|
|
832
|
+
`,variables:{model:e}}));return r}async prompt(e,r){let{aiPrompt:n}=I(await Qe(this,Be,"f").mutate({mutation:E`
|
|
779
833
|
mutation AiPrompt($taskId: String!, $prompt: String!) {
|
|
780
834
|
aiPrompt(taskId: $taskId, prompt: $prompt)
|
|
781
835
|
}
|
|
782
|
-
`,variables:{taskId:e,prompt:r}}));return n}async embed(e,r){let{aiEmbed:n}=
|
|
836
|
+
`,variables:{taskId:e,prompt:r}}));return n}async embed(e,r){let{aiEmbed:n}=I(await Qe(this,Be,"f").mutate({mutation:E`
|
|
783
837
|
mutation aiEmbed($modelId: String!, $text: String!) {
|
|
784
838
|
aiEmbed(modelId: $modelId, text: $text)
|
|
785
839
|
}
|
|
786
|
-
`,variables:{modelId:e,text:r}})),i=
|
|
787
|
-
mutation AiOpenTranscriptionStream($modelId: String
|
|
788
|
-
aiOpenTranscriptionStream(modelId: $modelId)
|
|
840
|
+
`,variables:{modelId:e,text:r}})),i=cc.toByteArray(n);return JSON.parse(v3.inflate(i,{to:"string"}))}async openTranscriptionStream(e,r,n){let{aiOpenTranscriptionStream:i}=I(await Qe(this,Be,"f").mutate({mutation:E`
|
|
841
|
+
mutation AiOpenTranscriptionStream($modelId: String!, $params: VoiceActivityParamsInput) {
|
|
842
|
+
aiOpenTranscriptionStream(modelId: $modelId, params: $params)
|
|
789
843
|
}
|
|
790
|
-
`,variables:{modelId:e}})),
|
|
791
|
-
aiTranscriptionText(streamId: "${
|
|
792
|
-
}`}).subscribe({next(
|
|
844
|
+
`,variables:{modelId:e,params:n}})),a=Qe(this,Be,"f").subscribe({query:E` subscription {
|
|
845
|
+
aiTranscriptionText(streamId: "${i}")
|
|
846
|
+
}`}).subscribe({next(o){return r(o.data.aiTranscriptionText),o.data.aiTranscriptionText},error(o){console.error(o)}});return Qe(this,Ds,"f").set(i,a),i}async closeTranscriptionStream(e){let{aiCloseTranscriptionStream:r}=I(await Qe(this,Be,"f").mutate({mutation:E`
|
|
793
847
|
mutation aiCloseTranscriptionStream($streamId: String!) {
|
|
794
848
|
aiCloseTranscriptionStream(streamId: $streamId)
|
|
795
849
|
}
|
|
796
|
-
`,variables:{streamId:e}})),n
|
|
797
|
-
mutation AiFeedTranscriptionStream($
|
|
798
|
-
aiFeedTranscriptionStream(
|
|
850
|
+
`,variables:{streamId:e}})),n=Qe(this,Ds,"f").get(e);return n.closed||n.unsubscribe(),r}async feedTranscriptionStream(e,r){let{aiFeedTranscriptionStream:n}=I(await Qe(this,Be,"f").mutate({mutation:E`
|
|
851
|
+
mutation AiFeedTranscriptionStream($streamIds: [String!]!, $audio: [Float!]!) {
|
|
852
|
+
aiFeedTranscriptionStream(streamIds: $streamIds, audio: $audio)
|
|
799
853
|
}
|
|
800
|
-
`,variables:{streamId:e,audio:r}}));return n}};Pe=new WeakMap,Jo=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},je=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,Xo,da,es,ha,ci,ts,rs,_s=class{constructor(e,r=!0){zt.set(this,void 0),Xo.set(this,void 0),da.set(this,void 0),es.set(this,void 0),ha.set(this,void 0),ci.set(this,void 0),ts.set(this,void 0),rs.set(this,void 0),kr(this,zt,e,"f"),kr(this,Xo,new Sa(je(this,zt,"f"),r),"f"),kr(this,da,new Vu(je(this,zt,"f")),"f"),kr(this,es,new Uu(je(this,zt,"f")),"f"),kr(this,ha,new qu(je(this,zt,"f")),"f"),kr(this,ci,new hs(je(this,zt,"f"),r),"f"),je(this,ci,"f").setExpressionClient(je(this,da,"f")),je(this,ci,"f").setNeighbourhoodClient(je(this,ha,"f")),kr(this,ts,new Bu(je(this,zt,"f"),r),"f"),kr(this,rs,new Xu(je(this,zt,"f"),r),"f")}get agent(){return je(this,Xo,"f")}get expression(){return je(this,da,"f")}get languages(){return je(this,es,"f")}get neighbourhood(){return je(this,ha,"f")}get perspective(){return je(this,ci,"f")}get runtime(){return je(this,ts,"f")}get ai(){return je(this,rs,"f")}};zt=new WeakMap,Xo=new WeakMap,da=new WeakMap,es=new WeakMap,ha=new WeakMap,ci=new WeakMap,ts=new WeakMap,rs=new WeakMap;var Zd;(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"})(Zd||(Zd={}));var dl=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},hl=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},vn=class{constructor(e,r){this.language=e,this.expression=r}};dl([w(),hl("design:type",Ht)],vn.prototype,"language",void 0);dl([w(),hl("design:type",String)],vn.prototype,"expression",void 0);vn=dl([Z(),hl("design:paramtypes",[Ht,String])],vn);function Q9(t){return t.language.address==="did"?t.expression.toString():`${t.language.address}://${t.expression}`}function G9(t){if(t.startsWith("literal://")){let a=new Ht;a.address="literal",a.name="literal";let o=t.substring(10);return new vn(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 vn(s,o)}let i=/^did:([^\s]+)$/.exec(t);if(i&&i.length==2){let a=new Ht;return a.address="did",new vn(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)},ws=class{};bt([w(),Yt("design:type",String)],ws.prototype,"name",void 0);bt([w(),Yt("design:type",String)],ws.prototype,"type",void 0);ws=bt([Z()],ws);var Da=class{};bt([w(),Yt("design:type",String)],Da.prototype,"label",void 0);bt([w(),Yt("design:type",String)],Da.prototype,"name",void 0);bt([w(),Yt("design:type",Array)],Da.prototype,"parameters",void 0);Da=bt([Z()],Da);var Ss=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)],Ss.prototype,"name",void 0);bt([w(),Yt("design:type",String)],Ss.prototype,"parametersStringified",void 0);Ss=bt([He(),Yt("design:paramtypes",[String,Object])],Ss);var Es=class{};bt([w(),Yt("design:type",String)],Es.prototype,"did",void 0);bt([w(),Yt("design:type",Mu)],Es.prototype,"status",void 0);Es=bt([Z()],Es);var Yd=class{},Pn=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},Si=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Ur=class{};Pn([w(),Si("design:type",String)],Ur.prototype,"name",void 0);Pn([w(),Si("design:type",String)],Ur.prototype,"address",void 0);Pn([w(),Si("design:type",String)],Ur.prototype,"settings",void 0);Pn([w(),Si("design:type",_n)],Ur.prototype,"icon",void 0);Pn([w(),Si("design:type",_n)],Ur.prototype,"constructorIcon",void 0);Pn([w(),Si("design:type",_n)],Ur.prototype,"settingsIcon",void 0);Ur=Pn([Z()],Ur);var nt=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},lt=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},$t=class{};nt([w(),lt("design:type",String)],$t.prototype,"name",void 0);nt([w(),lt("design:type",String)],$t.prototype,"address",void 0);nt([w(),lt("design:type",String)],$t.prototype,"description",void 0);nt([w(),lt("design:type",String)],$t.prototype,"author",void 0);nt([w(),lt("design:type",Boolean)],$t.prototype,"templated",void 0);nt([w(),lt("design:type",String)],$t.prototype,"templateSourceLanguageAddress",void 0);nt([w(),lt("design:type",String)],$t.prototype,"templateAppliedParams",void 0);nt([w(),lt("design:type",Array)],$t.prototype,"possibleTemplateParams",void 0);nt([w(),lt("design:type",String)],$t.prototype,"sourceCodeLink",void 0);$t=nt([Z()],$t);var gi=class{constructor(e,r){this.name=e,this.description=r,this.description||(this.description="")}};nt([w(),lt("design:type",String)],gi.prototype,"name",void 0);nt([w(),lt("design:type",String)],gi.prototype,"description",void 0);nt([w(),lt("design:type",Array)],gi.prototype,"possibleTemplateParams",void 0);nt([w(),lt("design:type",String)],gi.prototype,"sourceCodeLink",void 0);gi=nt([He(),lt("design:paramtypes",[String,String])],gi);var Jd=class{},Xd=class extends qr(){},eh=class{},Ds=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},ml=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Cs=class{constructor(e,r){this.linkLanguage=e,this.meta=r}};Ds([w(),ml("design:type",String)],Cs.prototype,"linkLanguage",void 0);Ds([w(),ml("design:type",Lr)],Cs.prototype,"meta",void 0);Cs=Ds([Z(),ml("design:paramtypes",[String,Lr])],Cs);var el=class extends qr(){};el=Ds([Z()],el);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},Ci=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},tl;(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"})(tl||(tl={}));var An=class{constructor(e,r,n){this.uuid=e,this.name=r,n?this.state=n:this.state=tl.Private}};Ei([w(),Ci("design:type",String)],An.prototype,"uuid",void 0);Ei([w(),Ci("design:type",String)],An.prototype,"name",void 0);Ei([w(),Ci("design:type",String)],An.prototype,"state",void 0);Ei([w(),Ci("design:type",String)],An.prototype,"sharedUrl",void 0);Ei([w(),Ci("design:type",el)],An.prototype,"neighbourhood",void 0);An=Ei([Z(),Ci("design:paramtypes",[String,String,String])],An);var Ns=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},im=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},xs=class{};Ns([w(),im("design:type",Array)],xs.prototype,"additions",void 0);Ns([w(),im("design:type",Array)],xs.prototype,"removals",void 0);xs=Ns([Z()],xs);var th=class extends qr(){};th=Ns([Z()],th);var rh=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},si=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)},ma,hn,Bo="smart_literal://content";function A2(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 Na=class{constructor(e,r){ma.set(this,void 0),hn.set(this,void 0),rh(this,ma,e,"f"),rh(this,hn,r,"f")}get base(){return si(this,hn,"f")}static async create(e,r){let n=Lt.from(A2(10)).toUrl(),i=new Na(e,n);return await i.set(r),i}static async isSmartLiteralBase(e,r){return(await e.get(new vt({source:r,predicate:Bo}))).length>0}static async getAllSmartLiterals(e){return(await e.get(new vt({predicate:Bo}))).map(n=>new Na(e,n.data.source))}async get(){let e=await si(this,ma,"f").getSingleTarget(new vt({source:si(this,hn,"f"),predicate:Bo}));if(!e)throw`No content for smart literal ${si(this,hn,"f")}`;return Lt.fromUrl(e).get()}async set(e){let r=Lt.from(e);await si(this,ma,"f").setSingleTarget(new Sn({source:si(this,hn,"f"),predicate:Bo,target:r.toUrl()}))}};ma=new WeakMap,hn=new WeakMap;var nh=class{};function a7(t,e,r){return{action:"addLink",source:t,predicate:e,target:r}}function o7(t){return`triple(this, "${t}", _)`}function s7(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 ds(a,d,s);await p.init(),o.push(p)}return o}}}function c7(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${Or(n)}`]=()=>{}}Object.defineProperty(e,r,{configurable:!0,writable:!0})}}function u7(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 l7(t){return function(e,r){e.__collections=e.__collections||{},e.__collections[r]=t;let n=r;e[`add${Or(n)}`]=()=>{},e[`remove${Or(n)}`]=()=>{},e[`setCollection${Or(n)}`]=()=>{},Object.defineProperty(e,r,{configurable:!0,writable:!0})}}function am(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 f7(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=am(8);r+=`subject_class("${n}", ${a}).
|
|
854
|
+
`,variables:{streamIds:Array.isArray(e)?e:[e],audio:r}}));return n}};Be=new WeakMap,Ds=new WeakMap;var Vr=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},je=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)},tr,Ns,Ba,Ps,qa,Dn,Rs,Va,ec=class{constructor(e,r=!0){tr.set(this,void 0),Ns.set(this,void 0),Ba.set(this,void 0),Ps.set(this,void 0),qa.set(this,void 0),Dn.set(this,void 0),Rs.set(this,void 0),Va.set(this,void 0),Vr(this,tr,e,"f"),Vr(this,Ns,new Ja(je(this,tr,"f"),r),"f"),Vr(this,Ba,new El(je(this,tr,"f")),"f"),Vr(this,Ps,new Sl(je(this,tr,"f")),"f"),Vr(this,qa,new Cl(je(this,tr,"f")),"f"),Vr(this,Va,new $l(je(this,tr,"f"),r),"f"),Vr(this,Dn,new Ws(je(this,tr,"f"),r),"f"),je(this,Dn,"f").setExpressionClient(je(this,Ba,"f")),je(this,Dn,"f").setNeighbourhoodClient(je(this,qa,"f")),je(this,Dn,"f").setAIClient(je(this,Va,"f")),Vr(this,Rs,new xl(je(this,tr,"f"),r),"f")}get agent(){return je(this,Ns,"f")}get expression(){return je(this,Ba,"f")}get languages(){return je(this,Ps,"f")}get neighbourhood(){return je(this,qa,"f")}get perspective(){return je(this,Dn,"f")}get runtime(){return je(this,Rs,"f")}get ai(){return je(this,Va,"f")}};tr=new WeakMap,Ns=new WeakMap,Ba=new WeakMap,Ps=new WeakMap,qa=new WeakMap,Dn=new WeakMap,Rs=new WeakMap,Va=new WeakMap;var Ll;(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"})(Ll||(Ll={}));var Yl=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},Xl=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Fn=class{constructor(e,r){this.language=e,this.expression=r}};Yl([m(),Xl("design:type",ar)],Fn.prototype,"language",void 0);Yl([m(),Xl("design:type",String)],Fn.prototype,"expression",void 0);Fn=Yl([W(),Xl("design:paramtypes",[ar,String])],Fn);function Mw(t){return t.language.address==="did"?t.expression.toString():`${t.language.address}://${t.expression}`}function Uw(t){if(t.startsWith("literal://")){let a=new ar;a.address="literal",a.name="literal";let o=t.substring(10);return new Fn(a,o)}let r=/^([^:^\s]+):\/\/([\s\S]+)$/.exec(t);if(r&&r.length==3){let a=r[1],o=r[2],s=new ar;return s.address=a,new Fn(s,o)}let i=/^did:([^\s]+)$/.exec(t);if(i&&i.length==2){let a=new ar;return a.address="did",new Fn(a,t)}throw new Error("Couldn't parse string as expression URL or DID: "+t)}var Dt=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},lr=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},tc=class{};Dt([m(),lr("design:type",String)],tc.prototype,"name",void 0);Dt([m(),lr("design:type",String)],tc.prototype,"type",void 0);tc=Dt([W()],tc);var oo=class{};Dt([m(),lr("design:type",String)],oo.prototype,"label",void 0);Dt([m(),lr("design:type",String)],oo.prototype,"name",void 0);Dt([m(),lr("design:type",Array)],oo.prototype,"parameters",void 0);oo=Dt([W()],oo);var rc=class{get parameters(){return JSON.parse(this.parametersStringified)}constructor(e,r){this.name=e,this.parametersStringified=JSON.stringify(r)}};Dt([m(),lr("design:type",String)],rc.prototype,"name",void 0);Dt([m(),lr("design:type",String)],rc.prototype,"parametersStringified",void 0);rc=Dt([Ke(),lr("design:paramtypes",[String,Object])],rc);var nc=class{};Dt([m(),lr("design:type",String)],nc.prototype,"did",void 0);Dt([m(),lr("design:type",qn)],nc.prototype,"status",void 0);nc=Dt([W()],nc);var Rh=class{},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},zi=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},an=class{};ei([m(),zi("design:type",String)],an.prototype,"name",void 0);ei([m(),zi("design:type",String)],an.prototype,"address",void 0);ei([m(),zi("design:type",String)],an.prototype,"settings",void 0);ei([m(),zi("design:type",Un)],an.prototype,"icon",void 0);ei([m(),zi("design:type",Un)],an.prototype,"constructorIcon",void 0);ei([m(),zi("design:type",Un)],an.prototype,"settingsIcon",void 0);an=ei([W()],an);var dt=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},wt=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Gt=class{};dt([m(),wt("design:type",String)],Gt.prototype,"name",void 0);dt([m(),wt("design:type",String)],Gt.prototype,"address",void 0);dt([m(),wt("design:type",String)],Gt.prototype,"description",void 0);dt([m(),wt("design:type",String)],Gt.prototype,"author",void 0);dt([m(),wt("design:type",Boolean)],Gt.prototype,"templated",void 0);dt([m(),wt("design:type",String)],Gt.prototype,"templateSourceLanguageAddress",void 0);dt([m(),wt("design:type",String)],Gt.prototype,"templateAppliedParams",void 0);dt([m(),wt("design:type",Array)],Gt.prototype,"possibleTemplateParams",void 0);dt([m(),wt("design:type",String)],Gt.prototype,"sourceCodeLink",void 0);Gt=dt([W()],Gt);var Fi=class{constructor(e,r){this.name=e,this.description=r,this.description||(this.description="")}};dt([m(),wt("design:type",String)],Fi.prototype,"name",void 0);dt([m(),wt("design:type",String)],Fi.prototype,"description",void 0);dt([m(),wt("design:type",Array)],Fi.prototype,"possibleTemplateParams",void 0);dt([m(),wt("design:type",String)],Fi.prototype,"sourceCodeLink",void 0);Fi=dt([Ke(),wt("design:paramtypes",[String,String])],Fi);var $h=class{},Lh=class extends sn(){},Fh=class{},fc=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},ep=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},ic=class{constructor(e,r){this.linkLanguage=e,this.meta=r}};fc([m(),ep("design:type",String)],ic.prototype,"linkLanguage",void 0);fc([m(),ep("design:type",cr)],ic.prototype,"meta",void 0);ic=fc([W(),ep("design:paramtypes",[String,cr])],ic);var Fl=class extends sn(){};Fl=fc([W()],Fl);var Gi=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},Hi=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Ml;(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"})(Ml||(Ml={}));var Hn=class{constructor(e,r,n){this.uuid=e,this.name=r,n?this.state=n:this.state=Ml.Private}};Gi([m(),Hi("design:type",String)],Hn.prototype,"uuid",void 0);Gi([m(),Hi("design:type",String)],Hn.prototype,"name",void 0);Gi([m(),Hi("design:type",String)],Hn.prototype,"state",void 0);Gi([m(),Hi("design:type",String)],Hn.prototype,"sharedUrl",void 0);Gi([m(),Hi("design:type",Fl)],Hn.prototype,"neighbourhood",void 0);Hn=Gi([W(),Hi("design:paramtypes",[String,String,String])],Hn);var dc=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},W1=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},ac=class{};dc([m(),W1("design:type",Array)],ac.prototype,"additions",void 0);dc([m(),W1("design:type",Array)],ac.prototype,"removals",void 0);ac=dc([W()],ac);var Mh=class extends sn(){};Mh=dc([W()],Mh);var Uh=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},ki=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)},Qa,Nn,bs="smart_literal://content";function _3(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 so=class{constructor(e,r){Qa.set(this,void 0),Nn.set(this,void 0),Uh(this,Qa,e,"f"),Uh(this,Nn,r,"f")}get base(){return ki(this,Nn,"f")}static async create(e,r){let n=At.from(_3(10)).toUrl(),i=new so(e,n);return await i.set(r),i}static async isSmartLiteralBase(e,r){return(await e.get(new at({source:r,predicate:bs}))).length>0}static async getAllSmartLiterals(e){return(await e.get(new at({predicate:bs}))).map(n=>new so(e,n.data.source))}async get(){let e=await ki(this,Qa,"f").getSingleTarget(new at({source:ki(this,Nn,"f"),predicate:bs}));if(!e)throw`No content for smart literal ${ki(this,Nn,"f")}`;return At.fromUrl(e).get()}async set(e){let r=At.from(e);await ki(this,Qa,"f").setSingleTarget(new Bn({source:ki(this,Nn,"f"),predicate:bs,target:r.toUrl()}))}};Qa=new WeakMap,Nn=new WeakMap;var jh=class{};function Yw(t,e,r){return{action:"addLink",source:t,predicate:e,target:r}}function Xw(t){return`triple(this, "${t}", _)`}function eS(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,f=new Hs(a,d,s);await f.init(),o.push(f)}return o}}}function K1(t){return function(e,r){if(typeof t.writable>"u"&&t.through&&(t.writable=!0),t.required&&!t.initial)throw new Error("SubjectProperty requires an 'initial' option if 'required' is true");if(!t.through&&!t.getter)throw new Error("SubjectProperty requires either 'through' or 'getter' option");if(e.__properties=e.__properties||{},e.__properties[r]=e.__properties[r]||{},e.__properties[r]={...e.__properties[r],...t},t.writable){let n=r;e[`set${Kr(n)}`]=()=>{}}Object.defineProperty(e,r,{configurable:!0,writable:!0})}}function tS(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 rS(t){return function(e,r){e.__collections=e.__collections||{},e.__collections[r]=t;let n=r;e[`add${Kr(n)}`]=()=>{},e[`remove${Kr(n)}`]=()=>{},e[`setCollection${Kr(n)}`]=()=>{},Object.defineProperty(e,r,{configurable:!0,writable:!0})}}function Z1(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 w3(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=Z1(8);r+=`subject_class("${n}", ${a}).
|
|
801
855
|
`;let o=[],s=[];i.subjectConstructor&&i.subjectConstructor.length&&(s=s.concat(i.subjectConstructor));let u=[];i.isSubjectInstance&&i.isSubjectInstance.length&&(u=u.concat(i.isSubjectInstance));let c=[],l=i.__properties||{};for(let h in l){let g=`property(${a}, "${h}").
|
|
802
|
-
`,{through:
|
|
803
|
-
`,g+=`property_resolve_language(${a}, "${h}", "${
|
|
804
|
-
`),
|
|
805
|
-
`:
|
|
806
|
-
`,
|
|
807
|
-
`;else if(
|
|
808
|
-
`}c.push(g),
|
|
809
|
-
`,{through:
|
|
810
|
-
`}else g+=`collection_getter(${a}, Base, "${h}", List) :- findall(C, triple(Base, "${
|
|
811
|
-
`;let
|
|
812
|
-
`,g+=`collection_remover(${a}, "${
|
|
813
|
-
`,g+=`collection_setter(${a}, "${
|
|
814
|
-
`}d.push(g)}let
|
|
856
|
+
`,{through:v,initial:C,required:_,resolveLanguage:b,writable:y,flag:T,getter:R,setter:k,local:P}=l[h];if(b&&(g+=`property_resolve(${a}, "${h}").
|
|
857
|
+
`,g+=`property_resolve_language(${a}, "${h}", "${b}").
|
|
858
|
+
`),R?g+=`property_getter(${a}, Base, "${h}", Value) :- ${R}.
|
|
859
|
+
`:v&&(g+=`property_getter(${a}, Base, "${h}", Value) :- triple(Base, "${v}", Value).
|
|
860
|
+
`,_&&(T?u.push(`triple(Base, "${v}", "${C}")`):u.push(`triple(Base, "${v}", _)`))),k)g+=`property_setter(${a}, "${h}", Actions) :- ${k}.
|
|
861
|
+
`;else if(y&&v&&typeof i[Vl(h)]=="function"){let $=[{action:"setSingleTarget",source:"this",predicate:v,target:"value",...P&&{local:!0}}];g+=`property_setter(${a}, "${h}", '${kn($)}').
|
|
862
|
+
`}c.push(g),C&&(s.push({action:"addLink",source:"this",predicate:v,target:C}),o.push({action:"removeLink",source:"this",predicate:v,target:"*"}))}let d=[],f=i.__collections||{};for(let h in f){let g=`collection(${a}, "${h}").
|
|
863
|
+
`,{through:v,where:C,local:_}=f[h];if(v){if(C){if(!C.isInstance&&!C.condition)throw"'where' needs one of 'isInstance' or 'condition'";let R=[];if(C.isInstance){let P;C.isInstance.name?P=C.isInstance.name:P=C.isInstance,R.push(`instance(OtherClass, Target), subject_class("${P}", OtherClass)`)}C.condition&&R.push(C.condition);let k=R.join(", ");g+=`collection_getter(${a}, Base, "${h}", List) :- setof(Target, (triple(Base, "${v}", Target), ${k}), List).
|
|
864
|
+
`}else g+=`collection_getter(${a}, Base, "${h}", List) :- findall(C, triple(Base, "${v}", C), List).
|
|
865
|
+
`;let b=[{action:"addLink",source:"this",predicate:v,target:"value",..._&&{local:!0}}],y=[{action:"removeLink",source:"this",predicate:v,target:"value"}],T=[{action:"collectionSetter",source:"this",predicate:v,target:"value",..._&&{local:!0}}];g+=`collection_adder(${a}, "${Cr(h)}", '${kn(b)}').
|
|
866
|
+
`,g+=`collection_remover(${a}, "${Cr(h)}", '${kn(y)}').
|
|
867
|
+
`,g+=`collection_setter(${a}, "${Cr(h)}", '${kn(T)}').
|
|
868
|
+
`}d.push(g)}let p=kn(s);if(r+=`constructor(${a}, '${p}').
|
|
815
869
|
`,u.length>0){let h=u.join(", ");r+=`instance(${a}, Base) :- ${h}.
|
|
816
870
|
`,r+=`
|
|
817
|
-
`}return r+=`destructor(${a}, '${
|
|
871
|
+
`}return r+=`destructor(${a}, '${kn(o)}').
|
|
818
872
|
`,r+=`
|
|
819
873
|
`,r+=c.join(`
|
|
820
874
|
`),r+=`
|
|
821
875
|
`,r+=d.join(`
|
|
822
|
-
`),{sdna:r,name:n}},Object.defineProperty(e,"type",{configurable:!0})}}var
|
|
876
|
+
`),{sdna:r,name:n}},Object.defineProperty(e,"type",{configurable:!0})}}function nS(t){return K1({...t,required:!0,writable:!0,initial:t.initial||"literal://string:uninitialized"})}function iS(t){return K1({...t,writable:!1})}var aS=`
|
|
823
877
|
type AIModelLoadingStatus {
|
|
824
878
|
downloaded: Boolean!
|
|
825
879
|
loaded: Boolean!
|
|
@@ -1067,14 +1121,16 @@ input LinkQuery {
|
|
|
1067
1121
|
|
|
1068
1122
|
type LocalModel {
|
|
1069
1123
|
fileName: String!
|
|
1070
|
-
|
|
1071
|
-
|
|
1124
|
+
huggingfaceRepo: String
|
|
1125
|
+
revision: String
|
|
1126
|
+
tokenizerSource: TokenizerSource
|
|
1072
1127
|
}
|
|
1073
1128
|
|
|
1074
1129
|
input LocalModelInput {
|
|
1075
1130
|
fileName: String!
|
|
1076
|
-
|
|
1077
|
-
|
|
1131
|
+
huggingfaceRepo: String
|
|
1132
|
+
revision: String
|
|
1133
|
+
tokenizerSource: TokenizerSourceInput
|
|
1078
1134
|
}
|
|
1079
1135
|
|
|
1080
1136
|
type Model {
|
|
@@ -1127,8 +1183,8 @@ type Mutation {
|
|
|
1127
1183
|
aiAddTask(task: AITaskInput!): AITask!
|
|
1128
1184
|
aiCloseTranscriptionStream(streamId: String!): String!
|
|
1129
1185
|
aiEmbed(modelId: String!, text: String!): String!
|
|
1130
|
-
aiFeedTranscriptionStream(audio: [Float!]!,
|
|
1131
|
-
aiOpenTranscriptionStream(modelId: String
|
|
1186
|
+
aiFeedTranscriptionStream(audio: [Float!]!, streamIds: [String!]!): String!
|
|
1187
|
+
aiOpenTranscriptionStream(modelId: String!, params: VoiceActivityParamsInput): String!
|
|
1132
1188
|
aiPrompt(prompt: String!, taskId: String!): String!
|
|
1133
1189
|
aiRemoveModel(modelId: String!): Boolean!
|
|
1134
1190
|
aiRemoveTask(taskId: String!): AITask!
|
|
@@ -1144,38 +1200,48 @@ type Mutation {
|
|
|
1144
1200
|
languageWriteSettings(languageAddress: String!, settings: String!): Boolean!
|
|
1145
1201
|
neighbourhoodJoinFromUrl(url: String!): PerspectiveHandle!
|
|
1146
1202
|
neighbourhoodPublishFromPerspective(linkLanguage: String!, meta: PerspectiveInput!, perspectiveUUID: String!): String!
|
|
1147
|
-
neighbourhoodSendBroadcast(payload: PerspectiveInput!, perspectiveUUID: String!): Boolean!
|
|
1148
|
-
neighbourhoodSendBroadcastU(payload: PerspectiveUnsignedInput!, perspectiveUUID: String!): Boolean!
|
|
1203
|
+
neighbourhoodSendBroadcast(loopback: Boolean, payload: PerspectiveInput!, perspectiveUUID: String!): Boolean!
|
|
1204
|
+
neighbourhoodSendBroadcastU(loopback: Boolean, payload: PerspectiveUnsignedInput!, perspectiveUUID: String!): Boolean!
|
|
1149
1205
|
neighbourhoodSendSignal(payload: PerspectiveInput!, perspectiveUUID: String!, remoteAgentDid: String!): Boolean!
|
|
1150
1206
|
neighbourhoodSendSignalU(payload: PerspectiveUnsignedInput!, perspectiveUUID: String!, remoteAgentDid: String!): Boolean!
|
|
1151
1207
|
neighbourhoodSetOnlineStatus(perspectiveUUID: String!, status: PerspectiveInput!): Boolean!
|
|
1152
1208
|
neighbourhoodSetOnlineStatusU(perspectiveUUID: String!, status: PerspectiveUnsignedInput!): Boolean!
|
|
1153
1209
|
perspectiveAdd(name: String!): PerspectiveHandle!
|
|
1154
|
-
perspectiveAddLink(link: LinkInput!, status: String = "shared", uuid: String!): LinkExpression!
|
|
1155
|
-
perspectiveAddLinkExpression(link: LinkExpressionInput!, status: String, uuid: String!): LinkExpression!
|
|
1156
|
-
perspectiveAddLinks(links: [LinkInput!]!, status: String, uuid: String!): [LinkExpression!]!
|
|
1210
|
+
perspectiveAddLink(batchId: String, link: LinkInput!, status: String = "shared", uuid: String!): LinkExpression!
|
|
1211
|
+
perspectiveAddLinkExpression(batchId: String, link: LinkExpressionInput!, status: String = "shared", uuid: String!): LinkExpression!
|
|
1212
|
+
perspectiveAddLinks(batchId: String, links: [LinkInput!]!, status: String = "shared", uuid: String!): [LinkExpression!]!
|
|
1157
1213
|
perspectiveAddSdna(name: String!, sdnaCode: String!, sdnaType: String!, uuid: String!): Boolean!
|
|
1158
|
-
|
|
1159
|
-
|
|
1214
|
+
perspectiveCommitBatch(batchId: String!, uuid: String!): LinkExpressionMutations!
|
|
1215
|
+
perspectiveCreateBatch(uuid: String!): String!
|
|
1216
|
+
perspectiveCreateSubject(batchId: String, expressionAddress: String!, initialValues: String, subjectClass: String!, uuid: String!): Boolean!
|
|
1217
|
+
perspectiveDisposeQuerySubscription(subscriptionId: String!, uuid: String!): Boolean!
|
|
1218
|
+
perspectiveExecuteCommands(batchId: String, commands: String!, expression: String!, parameters: String, uuid: String!): Boolean!
|
|
1160
1219
|
perspectiveGetSubjectData(expressionAddress: String!, subjectClass: String!, uuid: String!): String!
|
|
1220
|
+
perspectiveKeepAliveQuery(subscriptionId: String!, uuid: String!): Boolean!
|
|
1161
1221
|
perspectiveLinkMutations(mutations: LinkMutations!, status: String, uuid: String!): LinkExpressionMutations!
|
|
1162
1222
|
perspectivePublishSnapshot(uuid: String!): String
|
|
1163
1223
|
perspectiveRemove(uuid: String!): Boolean!
|
|
1164
|
-
perspectiveRemoveLink(link: LinkExpressionInput!, uuid: String!): Boolean!
|
|
1165
|
-
perspectiveRemoveLinks(links: [LinkExpressionInput!]!, uuid: String!): [LinkExpression!]!
|
|
1224
|
+
perspectiveRemoveLink(batchId: String, link: LinkExpressionInput!, uuid: String!): Boolean!
|
|
1225
|
+
perspectiveRemoveLinks(batchId: String, links: [LinkExpressionInput!]!, uuid: String!): [LinkExpression!]!
|
|
1226
|
+
perspectiveSubscribeQuery(query: String!, uuid: String!): QuerySubscription!
|
|
1166
1227
|
perspectiveUpdate(name: String!, uuid: String!): PerspectiveHandle
|
|
1167
|
-
perspectiveUpdateLink(newLink: LinkInput!, oldLink: LinkExpressionInput!, uuid: String!): LinkExpression!
|
|
1228
|
+
perspectiveUpdateLink(batchId: String, newLink: LinkInput!, oldLink: LinkExpressionInput!, uuid: String!): LinkExpression!
|
|
1168
1229
|
runtimeAddFriends(dids: [String!]!): [String!]!
|
|
1169
1230
|
runtimeAddKnownLinkLanguageTemplates(addresses: [String!]!): [String!]!
|
|
1231
|
+
runtimeExportDb(filePath: String!): Boolean!
|
|
1232
|
+
runtimeExportPerspective(filePath: String!, perspectiveUuid: String!): Boolean!
|
|
1170
1233
|
runtimeFriendSendMessage(did: String!, message: PerspectiveInput!): Boolean!
|
|
1171
1234
|
runtimeGrantNotification(id: String!): Boolean!
|
|
1172
1235
|
runtimeHcAddAgentInfos(agentInfos: String!): Boolean!
|
|
1236
|
+
runtimeImportDb(filePath: String!): Boolean!
|
|
1237
|
+
runtimeImportPerspective(filePath: String!): Boolean!
|
|
1173
1238
|
runtimeOpenLink(url: String!): Boolean!
|
|
1174
1239
|
runtimeQuit: Boolean!
|
|
1175
1240
|
runtimeRemoveFriends(dids: [String!]!): [String!]!
|
|
1176
1241
|
runtimeRemoveKnownLinkLanguageTemplates(addresses: [String!]!): [String!]!
|
|
1177
1242
|
runtimeRemoveNotification(id: String!): Boolean!
|
|
1178
1243
|
runtimeRequestInstallNotification(notification: NotificationInput!): String!
|
|
1244
|
+
runtimeRestartHolochain: Boolean!
|
|
1179
1245
|
runtimeSetStatus(status: PerspectiveInput!): Boolean!
|
|
1180
1246
|
runtimeUpdateNotification(id: String!, notification: NotificationInput!): Boolean!
|
|
1181
1247
|
}
|
|
@@ -1278,6 +1344,7 @@ type Query {
|
|
|
1278
1344
|
perspectives: [PerspectiveHandle!]!
|
|
1279
1345
|
runtimeFriendStatus(did: String!): PerspectiveExpression
|
|
1280
1346
|
runtimeFriends: [String!]!
|
|
1347
|
+
runtimeGetNetworkMetrics: String!
|
|
1281
1348
|
runtimeHcAgentInfos: String!
|
|
1282
1349
|
runtimeInfo: RuntimeInfo!
|
|
1283
1350
|
runtimeKnownLinkLanguageTemplates: [String!]!
|
|
@@ -1287,6 +1354,11 @@ type Query {
|
|
|
1287
1354
|
runtimeVerifyStringSignedByDid(data: String!, did: String!, didSigningKeyId: String!, signedData: String!): Boolean!
|
|
1288
1355
|
}
|
|
1289
1356
|
|
|
1357
|
+
type QuerySubscription {
|
|
1358
|
+
result: String!
|
|
1359
|
+
subscriptionId: String!
|
|
1360
|
+
}
|
|
1361
|
+
|
|
1290
1362
|
type Resource {
|
|
1291
1363
|
domain: String!
|
|
1292
1364
|
pointers: [String!]!
|
|
@@ -1319,6 +1391,7 @@ type Subscription {
|
|
|
1319
1391
|
perspectiveLinkAdded(uuid: String!): LinkExpression
|
|
1320
1392
|
perspectiveLinkRemoved(uuid: String!): LinkExpression
|
|
1321
1393
|
perspectiveLinkUpdated(uuid: String!): LinkExpressionUpdated
|
|
1394
|
+
perspectiveQuerySubscription(subscriptionId: String!): String!
|
|
1322
1395
|
perspectiveRemoved: String
|
|
1323
1396
|
perspectiveSyncStateChange(uuid: String!): String!
|
|
1324
1397
|
perspectiveUpdated: PerspectiveHandle
|
|
@@ -1326,12 +1399,76 @@ type Subscription {
|
|
|
1326
1399
|
runtimeNotificationTriggered: TriggeredNotification
|
|
1327
1400
|
}
|
|
1328
1401
|
|
|
1402
|
+
type TokenizerSource {
|
|
1403
|
+
fileName: String!
|
|
1404
|
+
repo: String!
|
|
1405
|
+
revision: String!
|
|
1406
|
+
}
|
|
1407
|
+
|
|
1408
|
+
input TokenizerSourceInput {
|
|
1409
|
+
fileName: String!
|
|
1410
|
+
repo: String!
|
|
1411
|
+
revision: String!
|
|
1412
|
+
}
|
|
1413
|
+
|
|
1329
1414
|
type TriggeredNotification {
|
|
1330
1415
|
notification: Notification!
|
|
1331
1416
|
perspectiveId: String!
|
|
1332
1417
|
triggerMatch: String!
|
|
1333
1418
|
}
|
|
1334
|
-
`;function ih(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 om(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`${ih(e)} your ${r} actions, with access to ${ih(n)}`}var cn=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Q=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},tt,Pt,ns,Ce,ah=class{constructor(t,e,r){tt.set(this,void 0),Pt.set(this,void 0),ns.set(this,void 0),Ce.set(this,void 0),cn(this,tt,e||Lt.from(am(24)).toUrl(),"f"),cn(this,Ce,t,"f"),cn(this,ns,r||"ad4m://self","f")}get baseExpression(){return Q(this,tt,"f")}async getData(t){let e=t??Q(this,tt,"f"),r=await Q(this,Ce,"f").getSubjectData(Q(this,Pt,"f"),e);return Object.assign(this,r),cn(this,tt,e,"f"),this}async setProperty(key,value){let setters=await Q(this,Ce,"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,Ce,"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,Ce,"f").createExpression(value,resolveLanguage)),await Q(this,Ce,"f").executeAction(actions,Q(this,tt,"f"),[{name:"value",value}])}}async setCollectionSetter(key,value){let collectionSetters=await Q(this,Ce,"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,Ce,"f").executeAction(actions,Q(this,tt,"f"),value.map(t=>({name:"value",value:t}))):await Q(this,Ce,"f").executeAction(actions,Q(this,tt,"f"),[{name:"value",value}]))}}async setCollectionAdder(key,value){let adders=await Q(this,Ce,"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,Ce,"f").executeAction(actions,Q(this,tt,"f"),[{name:"value",value:t}]))):await Q(this,Ce,"f").executeAction(actions,Q(this,tt,"f"),[{name:"value",value}]))}}async setCollectionRemover(key,value){let removers=await Q(this,Ce,"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,Ce,"f").executeAction(actions,Q(this,tt,"f"),[{name:"value",value:t}]))):await Q(this,Ce,"f").executeAction(actions,Q(this,tt,"f"),[{name:"value",value}]))}}async save(){cn(this,Pt,await Q(this,Ce,"f").stringOrTemplateObjectToSubjectClass(this),"f"),await Q(this,Ce,"f").createSubject(this,Q(this,tt,"f")),await Q(this,Ce,"f").add(new Sn({source:Q(this,ns,"f"),predicate:"ad4m://has_child",target:this.baseExpression})),await this.update()}async update(){cn(this,Pt,await Q(this,Ce,"f").stringOrTemplateObjectToSubjectClass(this),"f");let t=Object.entries(this);for(let[e,r]of t)if(r!=null)if(r?.action)switch(r.action){case"setter":await this.setCollectionSetter(e,r.value);break;case"adder":await this.setCollectionAdder(e,r.value);break;case"remover":await this.setCollectionRemover(e,r.value);default:await this.setCollectionSetter(e,r.value);break}else Array.isArray(r)&&r.length>0?await this.setCollectionSetter(e,r):r!=null&&r!==""&&await this.setProperty(e,r);await this.getData()}async get(){return cn(this,Pt,await Q(this,Ce,"f").stringOrTemplateObjectToSubjectClass(this),"f"),await this.getData()}async delete(){await Q(this,Ce,"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=[];if(e)try{if((await t.infer(`findall([Timestamp, Base], (subject_class("${n}", C), instance(C, Base), link("${r}", Predicate, Base, Timestamp, Author)), AllData), sort(AllData, SortedData), length(SortedData, DataLength).`))[0].DataLength>=e.size){let s=`findall([Timestamp, Base], (subject_class("${n}", C), instance(C, Base), link("${r}", Predicate, Base, Timestamp, Author)), AllData), sort(AllData, SortedData), reverse(SortedData, ReverseSortedData), paginate(ReverseSortedData, ${e.page}, ${e.size}, PageData).`;i=await t.infer(s),i=i[0].PageData.map(u=>({Base:u[1],Timestamp:u[0]}))}else i=await t.infer(`subject_class("${n}", C), instance(C, Base), triple("${r}", Predicate, Base).`)}catch(o){console.log("Query failed",o)}else i=await t.infer(`subject_class("${n}", C), instance(C, Base), triple("${r}", Predicate, Base).`);return i?await Promise.all(i.map(async o=>await new this(t,o.Base).get())):[]}};tt=new WeakMap,Pt=new WeakMap,ns=new WeakMap,Ce=new WeakMap;var Rs="0.10.0";function O2(){let t=new AbortController;return setTimeout(()=>t.abort(),20),t}function gl(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 yl(t){return pe(this,null,function*(){try{let e=yield fetch(`http://localhost:${t}/graphql/`,{signal:O2().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 D2(){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 vl(){try{localStorage.setItem("test",""),localStorage.removeItem("test")}catch(t){return!1}return!0}function Ps(t,e){vl()&&localStorage.setItem(`${Rs}/${t}`,e)}function Jt(t){return vl()?localStorage.getItem(`${Rs}/${t}`):null}function bl(t){vl()&&localStorage.removeItem(`${Rs}/${t}`)}var N2=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 Ma(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 N2(t.constructor.prototype)){if(a==="constructor"||!n(a))continue;let o=Reflect.getOwnPropertyDescriptor(i,a);o&&typeof o.value=="function"&&(t[a]=t[a].bind(t))}return t}var ja=class{constructor({appName:e,appDesc:r,appIconPath:n,appUrl:i,appDomain:a,capabilities:o,port:s,token:u,url:c,hosting:l}){this.activeSocket=null;this.requestedRestart=!1;this.authState="unauthenticated";this.connectionState="not_connected";this.port=12e3;this.capabilities=[];this.isHosting=!1;this.listeners={authstatechange:[],configstatechange:[],connectionstatechange:[]};Ma(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 gl(e,1e4),this.setUrl(e);let r=this.buildClient();return yield this.checkAuth(),r}else{let r=yield this.ensureConnection();return yield this.checkAuth(),r}}catch(r){this.notifyConnectionChange("not_connected"),this.notifyAuthChange("unauthenticated")}})}loginToHosting(e,r){return pe(this,null,function*(){try{let n=yield fetch("https://hosting.ad4m.dev/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:e,password:r})});if(n.status===200){let i=yield n.json();localStorage.setItem("hosting_token",i.token);let a=localStorage.getItem("hosting_token"),o=yield fetch("https://hosting.ad4m.dev/api/service/info",{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+a}});if(o.status===200){let s=yield o.json();if(s.serviceId)if(this.setPort(s.port),this.setUrl(s.url),this.isHosting=!0,Ps("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 yl(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 gl(this.url,1e4),this.buildClient()}catch(i){return this.notifyConnectionChange("not_connected"),this.connectToPort()}})}findPort(){return pe(this,null,function*(){let e=[...Array(10).keys()].map((i,a)=>yl(12e3+a)),n=(yield Promise.allSettled(e)).find(i=>i.status==="fulfilled");if(n)return n.value;throw Error("Couldn't find an open port")})}buildClient(){this.notifyConnectionChange("connecting");try{let e=new WebSocket(this.url)}catch(e){this.notifyConnectionChange("not_connected");return}return this.apolloClient&&this.wsClient&&(this.requestedRestart=!0,this.wsClient.dispose(),this.apolloClient.stop(),this.wsClient=null,this.apolloClient=null),this.wsClient=Kp({url:this.url,connectionParams:()=>pe(this,null,function*(){return{headers:{authorization:this.token}}}),on:{opened:e=>{this.activeSocket=e},error:e=>{this.notifyConnectionChange("not_connected"),this.notifyAuthChange("unauthenticated")},connected:()=>{this.notifyConnectionChange("connected"),this.checkAuth()},closed:()=>pe(this,null,function*(){if(!this.requestedRestart)if(!this.token)this.notifyConnectionChange(this.token?"disconnected":"not_connected"),this.notifyAuthChange("unauthenticated"),this.requestedRestart=!1;else{let e=yield this.connect();e?this.ad4mClient=e:(this.notifyConnectionChange(this.token?"disconnected":"not_connected"),this.notifyAuthChange("unauthenticated"),this.requestedRestart=!1)}})}}),this.apolloClient=new cu({link:new Zp(this.wsClient),cache:new xo({resultCaching:!1,addTypename:!1}),defaultOptions:{watchQuery:{fetchPolicy:"no-cache"},query:{fetchPolicy:"no-cache"},mutate:{fetchPolicy:"no-cache"}}}),this.ad4mClient=new _s(this.apolloClient),this.ad4mClient}checkAuth(){return pe(this,null,function*(){try{return(yield this.ad4mClient.agent.isLocked())?this.notifyAuthChange("locked"):(yield this.ad4mClient.agent.status(),this.notifyAuthChange("authenticated")),!0}catch(e){return e.message==="Socket closed with event 4500 Cannot extractByTags from a ciphered wallet. You must unlock first."?(this.notifyAuthChange("locked"),!0):(this.notifyAuthChange("unauthenticated"),!1)}})}requestCapability(e=!1){return pe(this,null,function*(){var r;if(e&&this.setToken(null),this.isHosting){let n=localStorage.getItem("hosting_token");(yield fetch("https://hosting.ad4m.dev/api/service/checkStatus",{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer "+n}})).status!==200&&console.error("Looks like the client is not running you might not recieve the mail with the code, please check your dashboard logs.")}return this.requestId=yield(r=this.ad4mClient)==null?void 0:r.agent.requestCapability({appName:this.appName,appDesc:this.appDesc,appUrl:this.appUrl,appIconPath:this.appIconPath,appDomain:this.appDomain,capabilities:this.capabilities}),this.requestId})}verifyCode(e){return pe(this,null,function*(){var r;try{let n=yield(r=this.ad4mClient)==null?void 0:r.agent.generateJwt(this.requestId,e);return this.setToken(n),yield this.buildClient(),yield this.checkAuth(),this.token}catch(n){throw new Error("Invalid code")}})}clearState(){this.setToken(null),this.setPort(12e3),this.notifyConnectionChange("not_connected"),this.notifyAuthChange("unauthenticated")}};function _l({unlockAgent:t,reconnect:e}){return B`
|
|
1419
|
+
|
|
1420
|
+
input VoiceActivityParamsInput {
|
|
1421
|
+
endThreshold: Float
|
|
1422
|
+
endWindow: Float
|
|
1423
|
+
startThreshold: Float
|
|
1424
|
+
startWindow: Float
|
|
1425
|
+
timeBeforeSpeech: Float
|
|
1426
|
+
}
|
|
1427
|
+
`;function Bh(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 J1(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`${Bh(e)} your ${r} actions, with access to ${Bh(n)}`}var N=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},S=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},ve=function(t,e){return function(r,n){e(r,n,t)}},ho=new Xr;ho.author="did:ad4m:test";ho.timestamp=Date.now();ho.data={source:"root",target:"neighbourhood://Qm12345"};ho.proof={signature:"",key:"",valid:!0};var Hr=new qn;Hr.author="did:ad4m:test";Hr.timestamp=Date.now().toString();Hr.proof=new xr("","");Hr.data=new cr([ho]);var oc=class{};N([m(),S("design:type",String)],oc.prototype,"recipient",void 0);N([m(),S("design:type",qn)],oc.prototype,"message",void 0);oc=N([W()],oc);var Mi=class{};N([m(),S("design:type",String)],Mi.prototype,"ad4mExecutorVersion",void 0);N([m(),S("design:type",Boolean)],Mi.prototype,"isInitialized",void 0);N([m(),S("design:type",Boolean)],Mi.prototype,"isUnlocked",void 0);Mi=N([W()],Mi);var Wn=class{};N([m(),S("design:type",String)],Wn.prototype,"title",void 0);N([m(),S("design:type",String)],Wn.prototype,"message",void 0);N([m(),S("design:type",String)],Wn.prototype,"type",void 0);N([m(),S("design:type",String)],Wn.prototype,"addon",void 0);Wn=N([W()],Wn);var Ut=class{};N([m(),S("design:type",String)],Ut.prototype,"description",void 0);N([m(),S("design:type",String)],Ut.prototype,"appName",void 0);N([m(),S("design:type",String)],Ut.prototype,"appUrl",void 0);N([m(),S("design:type",String)],Ut.prototype,"appIconPath",void 0);N([m(),S("design:type",String)],Ut.prototype,"trigger",void 0);N([m(),S("design:type",Array)],Ut.prototype,"perspectiveIds",void 0);N([m(),S("design:type",String)],Ut.prototype,"webhookUrl",void 0);N([m(),S("design:type",String)],Ut.prototype,"webhookAuth",void 0);Ut=N([Ke()],Ut);var Tt=class{};N([m(),S("design:type",String)],Tt.prototype,"id",void 0);N([m(),S("design:type",Boolean)],Tt.prototype,"granted",void 0);N([m(),S("design:type",String)],Tt.prototype,"description",void 0);N([m(),S("design:type",String)],Tt.prototype,"appName",void 0);N([m(),S("design:type",String)],Tt.prototype,"appUrl",void 0);N([m(),S("design:type",String)],Tt.prototype,"appIconPath",void 0);N([m(),S("design:type",String)],Tt.prototype,"trigger",void 0);N([m(),S("design:type",Array)],Tt.prototype,"perspectiveIds",void 0);N([m(),S("design:type",String)],Tt.prototype,"webhookUrl",void 0);N([m(),S("design:type",String)],Tt.prototype,"webhookAuth",void 0);Tt=N([W()],Tt);var Ui=class{};N([m(),S("design:type",Tt)],Ui.prototype,"notification",void 0);N([m(),S("design:type",String)],Ui.prototype,"perspectiveId",void 0);N([m(),S("design:type",String)],Ui.prototype,"triggerMatch",void 0);Ui=N([W()],Ui);var We=class{};N([m(),S("design:type",Number)],We.prototype,"total",void 0);N([m(),S("design:type",Number)],We.prototype,"imported",void 0);N([m(),S("design:type",Number)],We.prototype,"failed",void 0);N([m(),S("design:type",Number)],We.prototype,"omitted",void 0);N([m(),S("design:type",Array)],We.prototype,"errors",void 0);We=N([W()],We);var Ot=class{};N([m(),S("design:type",We)],Ot.prototype,"perspectives",void 0);N([m(),S("design:type",We)],Ot.prototype,"links",void 0);N([m(),S("design:type",We)],Ot.prototype,"expressions",void 0);N([m(),S("design:type",We)],Ot.prototype,"perspectiveDiffs",void 0);N([m(),S("design:type",We)],Ot.prototype,"notifications",void 0);N([m(),S("design:type",We)],Ot.prototype,"models",void 0);N([m(),S("design:type",We)],Ot.prototype,"defaultModels",void 0);N([m(),S("design:type",We)],Ot.prototype,"tasks",void 0);N([m(),S("design:type",We)],Ot.prototype,"friends",void 0);N([m(),S("design:type",We)],Ot.prototype,"trustedAgents",void 0);N([m(),S("design:type",We)],Ot.prototype,"knownLinkLanguages",void 0);Ot=N([W()],Ot);var re=class{runtimeQuit(){return!0}runtimeOpenLink(e){return!0}runtimeInfo(){return{ad4mExecutorVersion:"x.x.x",isInitialized:!0,isUnlocked:!0}}addTrustedAgents(e){return e}deleteTrustedAgents(e){return[]}getTrustedAgents(){return["agentPubKey"]}runtimeKnownLinkLanguageTemplates(){return["Qm12345abcdef"]}runtimeAddKnownLinkLanguageTemplates(e){return e}runtimeRemoveKnownLinkLanguageTemplates(e){return[]}runtimeFriends(){return["did:test:friend"]}runtimeAddFriends(e){return e}runtimeRemoveFriends(e){return[]}runtimeHcAgentInfos(){return JSON.stringify([{agent:{type:"Buffer",data:[9,191,231,58,255,107,202,55,206,57,9,103,17,34,206,195,207,114,5,73,77,198,56,136,17,227,242,231,194,135,128,48,170,189,119,186]},signature:{type:"Buffer",data:[195,143,170,36,234,123,255,85,188,138,124,2,91,18,53,231,44,41,240,8,80,131,100,150,165,125,146,90,17,200,190,129,114,211,11,146,150,128,198,199,79,118,157,101,194,68,58,245,98,182,79,139,140,41,143,129,8,136,87,77,180,231,218,11]},agent_info:{type:"Buffer",data:[134,165,115,112,97,99,101,196,36,203,165,212,173,24,215,165,196,25,145,248,113,246,139,205,182,241,138,57,0,26,8,217,179,23,126,59,136,128,213,110,225,173,72,197,95,165,97,103,101,110,116,196,36,9,191,231,58,255,107,202,55,206,57,9,103,17,34,206,195,207,114,5,73,77,198,56,136,17,227,242,231,194,135,128,48,170,189,119,186,164,117,114,108,115,145,217,99,107,105,116,115,117,110,101,45,112,114,111,120,121,58,47,47,101,83,52,86,112,54,109,118,80,48,122,116,85,101,104,114,117,113,89,52,102,66,53,101,69,98,121,48,69,66,100,89,84,50,95,67,48,69,112,77,111,76,111,47,107,105,116,115,117,110,101,45,113,117,105,99,47,104,47,49,57,50,46,49,54,56,46,49,55,56,46,54,48,47,112,47,55,55,52,52,47,45,45,172,115,105,103,110,101,100,95,97,116,95,109,115,207,0,0,1,123,233,104,189,50,176,101,120,112,105,114,101,115,95,97,102,116,101,114,95,109,115,206,0,18,79,128,169,109,101,116,97,95,105,110,102,111,196,34,129,187,100,104,116,95,115,116,111,114,97,103,101,95,97,114,99,95,104,97,108,102,95,108,101,110,103,116,104,206,128,0,0,1]}},{agent:{type:"Buffer",data:[98,187,145,48,115,209,94,143,31,153,102,69,138,29,133,213,34,52,39,164,157,139,178,111,23,33,118,250,28,155,78,246,128,49,179,38]},signature:{type:"Buffer",data:[233,192,38,3,59,248,124,231,57,255,40,154,50,60,119,252,68,198,154,109,175,155,106,217,211,155,109,223,249,91,221,210,17,132,72,230,11,230,247,119,72,244,145,91,75,7,67,5,130,151,44,231,52,220,28,154,212,82,58,90,203,211,236,4]},agent_info:{type:"Buffer",data:[134,165,115,112,97,99,101,196,36,203,165,212,173,24,215,165,196,25,145,248,113,246,139,205,182,241,138,57,0,26,8,217,179,23,126,59,136,128,213,110,225,173,72,197,95,165,97,103,101,110,116,196,36,98,187,145,48,115,209,94,143,31,153,102,69,138,29,133,213,34,52,39,164,157,139,178,111,23,33,118,250,28,155,78,246,128,49,179,38,164,117,114,108,115,145,217,99,107,105,116,115,117,110,101,45,112,114,111,120,121,58,47,47,55,101,77,106,48,73,83,72,56,56,81,56,45,89,51,74,89,70,53,76,72,57,83,54,68,119,71,73,49,88,45,115,87,53,68,104,66,87,121,71,119,78,115,47,107,105,116,115,117,110,101,45,113,117,105,99,47,104,47,49,57,50,46,49,54,56,46,49,55,56,46,54,48,47,112,47,55,55,52,52,47,45,45,172,115,105,103,110,101,100,95,97,116,95,109,115,207,0,0,1,123,233,103,45,197,176,101,120,112,105,114,101,115,95,97,102,116,101,114,95,109,115,206,0,18,79,128,169,109,101,116,97,95,105,110,102,111,196,34,129,187,100,104,116,95,115,116,111,114,97,103,101,95,97,114,99,95,104,97,108,102,95,108,101,110,103,116,104,206,128,0,0,1]}},{agent:{type:"Buffer",data:[181,101,115,45,214,127,198,153,159,184,30,87,67,224,208,184,203,176,130,158,236,127,153,125,243,183,188,167,154,25,118,254,101,145,210,109]},signature:{type:"Buffer",data:[88,189,229,122,44,171,194,156,90,79,148,49,207,224,34,199,219,88,24,243,103,127,123,41,87,171,127,92,6,216,198,171,26,226,237,217,122,78,98,146,55,255,68,240,202,83,58,140,147,185,3,66,15,216,210,22,99,197,73,234,120,17,74,1]},agent_info:{type:"Buffer",data:[134,165,115,112,97,99,101,196,36,203,165,212,173,24,215,165,196,25,145,248,113,246,139,205,182,241,138,57,0,26,8,217,179,23,126,59,136,128,213,110,225,173,72,197,95,165,97,103,101,110,116,196,36,181,101,115,45,214,127,198,153,159,184,30,87,67,224,208,184,203,176,130,158,236,127,153,125,243,183,188,167,154,25,118,254,101,145,210,109,164,117,114,108,115,145,217,99,107,105,116,115,117,110,101,45,112,114,111,120,121,58,47,47,114,70,71,83,100,113,104,101,68,107,70,70,56,69,102,109,45,69,116,55,119,81,101,120,83,88,55,65,112,69,51,89,86,99,45,120,102,52,104,106,77,115,77,47,107,105,116,115,117,110,101,45,113,117,105,99,47,104,47,49,57,50,46,49,54,56,46,49,55,56,46,54,48,47,112,47,55,55,52,52,47,45,45,172,115,105,103,110,101,100,95,97,116,95,109,115,207,0,0,1,123,233,113,23,220,176,101,120,112,105,114,101,115,95,97,102,116,101,114,95,109,115,206,0,18,79,128,169,109,101,116,97,95,105,110,102,111,196,34,129,187,100,104,116,95,115,116,111,114,97,103,101,95,97,114,99,95,104,97,108,102,95,108,101,110,103,116,104,206,128,0,0,1]}},{agent:{type:"Buffer",data:[3,171,237,107,186,245,165,47,237,235,211,49,245,62,113,53,255,252,223,226,75,118,148,187,23,53,70,174,160,184,64,63,94,210,227,56]},signature:{type:"Buffer",data:[129,12,55,104,239,121,138,2,86,106,136,51,219,79,170,8,195,69,81,188,225,192,247,196,54,39,164,110,75,39,240,56,245,189,154,77,72,11,97,250,202,149,242,97,128,28,47,164,236,104,136,82,212,246,44,143,132,119,255,135,112,11,20,13]},agent_info:{type:"Buffer",data:[134,165,115,112,97,99,101,196,36,203,165,212,173,24,215,165,196,25,145,248,113,246,139,205,182,241,138,57,0,26,8,217,179,23,126,59,136,128,213,110,225,173,72,197,95,165,97,103,101,110,116,196,36,3,171,237,107,186,245,165,47,237,235,211,49,245,62,113,53,255,252,223,226,75,118,148,187,23,53,70,174,160,184,64,63,94,210,227,56,164,117,114,108,115,145,217,97,107,105,116,115,117,110,101,45,112,114,111,120,121,58,47,47,104,121,112,115,86,121,103,117,80,84,115,53,118,73,80,65,102,97,112,90,88,113,117,84,115,79,80,100,67,81,79,79,117,103,57,51,82,103,106,95,114,85,73,47,107,105,116,115,117,110,101,45,113,117,105,99,47,104,47,49,54,53,46,50,50,46,51,50,46,49,49,47,112,47,53,55,55,57,47,45,45,172,115,105,103,110,101,100,95,97,116,95,109,115,207,0,0,1,123,233,113,188,123,176,101,120,112,105,114,101,115,95,97,102,116,101,114,95,109,115,206,0,18,79,128,169,109,101,116,97,95,105,110,102,111,196,34,129,187,100,104,116,95,115,116,111,114,97,103,101,95,97,114,99,95,104,97,108,102,95,108,101,110,103,116,104,206,128,0,0,1]}}])}runtimeGetNetworkMetrics(){return JSON.stringify({metrics:{},stats:{}})}runtimeRestartHolochain(){return!0}runtimeHcAddAgentInfos(e){return!0}runtimeVerifyStringSignedByDid(e,r,n,i){return!0}runtimeSetStatus(e){return!0}runtimeFriendStatus(e){return Hr}runtimeFriendSendMessage(e,r){return!0}runtimeMessageInbox(e){return[Hr]}runtimeMessageOutbox(e){return[{recipient:"did:test:recipient",message:Hr}]}runtimeMessageReceived(){return Hr}exceptionOccurred(){return{title:"Test title",message:"Test message",type:Ll.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(),S("design:type",Function),S("design:paramtypes",[]),S("design:returntype",Boolean)],re.prototype,"runtimeQuit",null);N([Ve(),ve(0,ye()),S("design:type",Function),S("design:paramtypes",[String]),S("design:returntype",Boolean)],re.prototype,"runtimeOpenLink",null);N([Ht(),S("design:type",Function),S("design:paramtypes",[]),S("design:returntype",Mi)],re.prototype,"runtimeInfo",null);N([Ve(),ve(0,ye()),S("design:type",Function),S("design:paramtypes",[Array]),S("design:returntype",Array)],re.prototype,"addTrustedAgents",null);N([Ve(),ve(0,ye()),S("design:type",Function),S("design:paramtypes",[Array]),S("design:returntype",Array)],re.prototype,"deleteTrustedAgents",null);N([Ht(),S("design:type",Function),S("design:paramtypes",[]),S("design:returntype",Array)],re.prototype,"getTrustedAgents",null);N([Ht(),S("design:type",Function),S("design:paramtypes",[]),S("design:returntype",Array)],re.prototype,"runtimeKnownLinkLanguageTemplates",null);N([Ve(),ve(0,ye()),S("design:type",Function),S("design:paramtypes",[Array]),S("design:returntype",Array)],re.prototype,"runtimeAddKnownLinkLanguageTemplates",null);N([Ve(),ve(0,ye()),S("design:type",Function),S("design:paramtypes",[Array]),S("design:returntype",Array)],re.prototype,"runtimeRemoveKnownLinkLanguageTemplates",null);N([Ht(),S("design:type",Function),S("design:paramtypes",[]),S("design:returntype",Array)],re.prototype,"runtimeFriends",null);N([Ve(),ve(0,ye()),S("design:type",Function),S("design:paramtypes",[Array]),S("design:returntype",Array)],re.prototype,"runtimeAddFriends",null);N([Ve(),ve(0,ye()),S("design:type",Function),S("design:paramtypes",[Array]),S("design:returntype",Array)],re.prototype,"runtimeRemoveFriends",null);N([Ht(),S("design:type",Function),S("design:paramtypes",[]),S("design:returntype",String)],re.prototype,"runtimeHcAgentInfos",null);N([Ht(),S("design:type",Function),S("design:paramtypes",[]),S("design:returntype",String)],re.prototype,"runtimeGetNetworkMetrics",null);N([Ve(),S("design:type",Function),S("design:paramtypes",[]),S("design:returntype",Boolean)],re.prototype,"runtimeRestartHolochain",null);N([Ve(),ve(0,ye()),S("design:type",Function),S("design:paramtypes",[Object]),S("design:returntype",Boolean)],re.prototype,"runtimeHcAddAgentInfos",null);N([Ht(),ve(0,ye()),ve(1,ye()),ve(2,ye()),ve(3,ye()),S("design:type",Function),S("design:paramtypes",[String,String,String,String]),S("design:returntype",void 0)],re.prototype,"runtimeVerifyStringSignedByDid",null);N([Ve(),ve(0,ye()),S("design:type",Function),S("design:paramtypes",[cr]),S("design:returntype",Boolean)],re.prototype,"runtimeSetStatus",null);N([Ht(),ve(0,ye()),S("design:type",Function),S("design:paramtypes",[String]),S("design:returntype",qn)],re.prototype,"runtimeFriendStatus",null);N([Ve(),ve(0,ye()),ve(1,ye()),S("design:type",Function),S("design:paramtypes",[String,Vs]),S("design:returntype",Boolean)],re.prototype,"runtimeFriendSendMessage",null);N([Ht(),ve(0,ye()),S("design:type",Function),S("design:paramtypes",[String]),S("design:returntype",Array)],re.prototype,"runtimeMessageInbox",null);N([Ht(),ve(0,ye()),S("design:type",Function),S("design:paramtypes",[String]),S("design:returntype",Array)],re.prototype,"runtimeMessageOutbox",null);N([jl(),S("design:type",Function),S("design:paramtypes",[]),S("design:returntype",qn)],re.prototype,"runtimeMessageReceived",null);N([jl(),S("design:type",Function),S("design:paramtypes",[]),S("design:returntype",Wn)],re.prototype,"exceptionOccurred",null);N([Ve(),ve(0,ye()),S("design:type",Function),S("design:paramtypes",[Ut]),S("design:returntype",String)],re.prototype,"runtimeRequestInstallNotification",null);N([Ht(),S("design:type",Function),S("design:paramtypes",[]),S("design:returntype",Array)],re.prototype,"runtimeNotifications",null);N([Ve(),ve(0,ye()),ve(1,ye()),S("design:type",Function),S("design:paramtypes",[String,Ut]),S("design:returntype",Boolean)],re.prototype,"runtimeUpdateNotification",null);N([Ve(),ve(0,ye()),S("design:type",Function),S("design:paramtypes",[String]),S("design:returntype",Boolean)],re.prototype,"runtimeRemoveNotification",null);N([Ve(),ve(0,ye()),S("design:type",Function),S("design:paramtypes",[String]),S("design:returntype",Boolean)],re.prototype,"runtimeGrantNotification",null);N([jl(),S("design:type",Function),S("design:paramtypes",[]),S("design:returntype",Ui)],re.prototype,"runtimeNotificationTriggered",null);N([Ve(),ve(0,ye()),S("design:type",Function),S("design:paramtypes",[String]),S("design:returntype",Boolean)],re.prototype,"runtimeExportDb",null);N([Ve(),ve(0,ye()),S("design:type",Function),S("design:paramtypes",[String]),S("design:returntype",Boolean)],re.prototype,"runtimeImportDb",null);N([Ve(),ve(0,ye()),ve(1,ye()),S("design:type",Function),S("design:paramtypes",[String,String]),S("design:returntype",Boolean)],re.prototype,"runtimeExportPerspective",null);N([Ve(),ve(0,ye()),S("design:type",Function),S("design:paramtypes",[String]),S("design:returntype",Boolean)],re.prototype,"runtimeImportPerspective",null);re=N([e0()],re);var Sa=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)},bt,rr,$s,Te;function Ls(t){return t.charAt(0).toUpperCase()+t.slice(1)}function qh(t){return t?`triple("${t}", "ad4m://has_child", Base)`:""}function pl(){return`
|
|
1428
|
+
findall(
|
|
1429
|
+
[T, A],
|
|
1430
|
+
link(Base, _, _, T, A),
|
|
1431
|
+
AllLinks
|
|
1432
|
+
),
|
|
1433
|
+
sort(AllLinks, SortedLinks),
|
|
1434
|
+
SortedLinks = [[Timestamp, Author]|_]
|
|
1435
|
+
`}function Vh(t){return`
|
|
1436
|
+
findall([PropertyName, PropertyValue, Resolve], (
|
|
1437
|
+
% Constrain to specified properties if provided
|
|
1438
|
+
${t?`member(PropertyName, [${t.map(e=>`"${e}"`).join(", ")}]),`:""}
|
|
1439
|
+
resolve_property(SubjectClass, Base, PropertyName, PropertyValue, Resolve)
|
|
1440
|
+
), Properties)
|
|
1441
|
+
`}function Qh(t){return`
|
|
1442
|
+
findall([CollectionName, CollectionValues], (
|
|
1443
|
+
% Constrain to specified collections if provided
|
|
1444
|
+
${t?`member(CollectionName, [${t.map(e=>`"${e}"`).join(", ")}]),`:""}
|
|
1445
|
+
|
|
1446
|
+
collection(SubjectClass, CollectionName),
|
|
1447
|
+
collection_getter(SubjectClass, Base, CollectionName, CollectionValues)
|
|
1448
|
+
), Collections)
|
|
1449
|
+
`}function zh(t={}){function e(r){return typeof r=="string"?`"${r}"`:r}return Object.entries(t).map(([r,n])=>{let i=["base","author","timestamp"].includes(r),a=`resolve_property(SubjectClass, Base, "${r}", Value${r}, _)`,o=Ls(r);if(Array.isArray(n)){let s=n.map(u=>e(u)).join(", ");return i?`member(${o}, [${s}])`:`${a}, member(Value${r}, [${s}])`}if(typeof n=="object"&&n!==null){let{not:s,between:u,lt:c,lte:l,gt:d,gte:f}=n;if(s!==void 0)if(Array.isArray(s)){let h=s.map(g=>e(g)).join(", ");return i?`\\+ member(${o}, [${h}])`:`${a}, \\+ member(Value${r}, [${h}])`}else return i?`${o} \\= ${e(s)}`:`${a}, Value${r} \\= ${e(s)}`;if(u!==void 0&&Array.isArray(u)&&u.length===2)return i?`${o} >= ${u[0]}, ${o} =< ${u[1]}`:`${a}, Value${r} >= ${u[0]}, Value${r} =< ${u[1]}`;let p=[{value:c,symbol:"<"},{value:l,symbol:"=<"},{value:d,symbol:">"},{value:f,symbol:">="}];for(let{value:h,symbol:g}of p)if(h!==void 0)return i?`${o} ${g} ${h}`:`${a}, Value${r} ${g} ${h}`}return i?`${o} = ${e(n)}`:`${a}, Value${r} = ${e(n)}`}).join(", ")}function Gh(t){return t?"length(UnsortedInstances, TotalCount)":""}function Hh(t){if(!t)return"SortedInstances = UnsortedInstances";let[e,r]=Object.entries(t)[0];return`sort_instances(UnsortedInstances, "${e}", "${r}", SortedInstances)`}function Wh(t){return!t||t<0?"InstancesWithOffset = SortedInstances":`skipN(SortedInstances, ${t}, InstancesWithOffset)`}function Kh(t){return!t||t<0?"AllInstances = InstancesWithOffset":`takeN(InstancesWithOffset, ${t}, AllInstances)`}var _Ad4mModel=class{static async getClassName(t){if(this===_Ad4mModel)return await t.stringOrTemplateObjectToSubjectClassName(this);let r=this.classNamesByClass.get(this);r||(r={},this.classNamesByClass.set(this,r));let n=t.uuid;return r[n]||(r[n]=await t.stringOrTemplateObjectToSubjectClassName(this)),r[n]}constructor(t,e,r){bt.set(this,void 0),rr.set(this,void 0),$s.set(this,void 0),Te.set(this,void 0),Sa(this,bt,e||At.from(Z1(24)).toUrl(),"f"),Sa(this,Te,t,"f"),Sa(this,$s,r||"ad4m://self","f")}get baseExpression(){return Z(this,bt,"f")}get perspective(){return Z(this,Te,"f")}static async assignValuesToInstance(t,e,r){let n=Object.fromEntries(await Promise.all(r.map(async([i,a,o])=>{let s=a;if(!o&&typeof a=="string"){let c=Array.from(a,f=>f.codePointAt(0)),l=c.every(f=>f<=255),d=c.some(f=>f>=128);if(l&&d)try{let f=Uint8Array.from(c),p=new TextDecoder("utf-8",{fatal:!0}).decode(f);p!==a&&(s=p)}catch(f){console.warn(`UTF-8 byte reconstruction failed for property "${i}"`,{value:a,error:f})}}if(o){let c=await t.getExpression(a);if(c)try{s=JSON.parse(c.data)}catch{s=c.data}}let u=e.__properties?.[i]?.transform;return u&&typeof u=="function"&&(s=u(s)),[i,s]})));Object.assign(e,n)}async getData(){let t=[pl(),Vh(),Qh()],e=`
|
|
1450
|
+
Base = "${Z(this,bt,"f")}",
|
|
1451
|
+
subject_class("${Z(this,rr,"f")}", SubjectClass),
|
|
1452
|
+
${t.join(", ")}
|
|
1453
|
+
`,r=await Z(this,Te,"f").infer(e);if(r?.[0]){let{Properties:n,Collections:i,Timestamp:a,Author:o}=r?.[0],s=[...n,...i,["timestamp",a],["author",o]];await _Ad4mModel.assignValuesToInstance(Z(this,Te,"f"),this,s)}return this}static async queryToProlog(t,e,r){let{source:n,properties:i,collections:a,where:o,order:s,offset:u,limit:c,count:l}=e,d=r||await this.getClassName(t),f=[pl(),qh(n),Vh(i),Qh(a),zh(o)],p=[Gh(l),Hh(s),Wh(u),Kh(c)];return`
|
|
1454
|
+
findall([Base, Properties, Collections, Timestamp, Author], (
|
|
1455
|
+
subject_class("${d}", SubjectClass),
|
|
1456
|
+
instance(SubjectClass, Base),
|
|
1457
|
+
${f.filter(g=>g).join(", ")}
|
|
1458
|
+
), UnsortedInstances),
|
|
1459
|
+
${p.filter(g=>g).join(", ")}
|
|
1460
|
+
`}static async instancesFromPrologResult(t,e,r){if(!r?.[0]?.AllInstances)return{results:[],totalCount:0};let n=[...e?.properties||[],...e?.collections||[]];return{results:(await Promise.all(r[0].AllInstances.map(async([a,o,s,u,c])=>{try{let l=new this(t,a);n.length&&Object.keys(l).forEach(f=>{n.includes(f)||delete l[f]});let d=[...o,...s,["timestamp",u],["author",c]];return await _Ad4mModel.assignValuesToInstance(t,l,d),l}catch(l){return console.error(`Failed to process instance ${a}:`,l),null}}))).filter(a=>a!==null),totalCount:r[0].TotalCount}}static async findAll(t,e={}){let r=await this.queryToProlog(t,e),n=await t.infer(r),{results:i}=await this.instancesFromPrologResult(t,e,n);return i}static async findAllAndCount(t,e={}){let r=await this.queryToProlog(t,e),n=await t.infer(r);return await this.instancesFromPrologResult(t,e,n)}static async paginate(t,e,r,n){let i={...n||{},limit:e,offset:e*(r-1),count:!0},a=await this.queryToProlog(t,i),o=await t.infer(a),{results:s,totalCount:u}=await this.instancesFromPrologResult(t,i,o);return{results:s,totalCount:u,pageSize:e,pageNumber:r}}static async countQueryToProlog(t,e={},r){let{source:n,where:i}=e,a=r||await this.getClassName(t),o=[pl(),qh(n),zh(i)],s=[Gh(!0),Hh(),Wh(),Kh()];return`
|
|
1461
|
+
findall([Base, Properties, Collections, Timestamp, Author], (
|
|
1462
|
+
subject_class("${a}", SubjectClass),
|
|
1463
|
+
instance(SubjectClass, Base),
|
|
1464
|
+
${o.filter(c=>c).join(", ")}
|
|
1465
|
+
), UnsortedInstances),
|
|
1466
|
+
${s.filter(c=>c).join(", ")}
|
|
1467
|
+
`}static async count(t,e={}){return(await t.infer(await this.countQueryToProlog(t,e)))?.[0]?.TotalCount||0}async setProperty(key,value,batchId){let setters=await Z(this,Te,"f").infer(`subject_class("${Z(this,rr,"f")}", C), property_setter(C, "${key}", Setter)`);if(setters&&setters.length>0){let actions=eval(setters[0].Setter),resolveLanguageResults=await Z(this,Te,"f").infer(`subject_class("${Z(this,rr,"f")}", C), property_resolve_language(C, "${key}", Language)`),resolveLanguage;resolveLanguageResults&&resolveLanguageResults.length>0&&(resolveLanguage=resolveLanguageResults[0].Language),resolveLanguage&&(value=await Z(this,Te,"f").createExpression(value,resolveLanguage)),await Z(this,Te,"f").executeAction(actions,Z(this,bt,"f"),[{name:"value",value}],batchId)}}async setCollectionSetter(key,value,batchId){let collectionSetters=await Z(this,Te,"f").infer(`subject_class("${Z(this,rr,"f")}", C), collection_setter(C, "${Cr(key)}", Setter)`);if(collectionSetters||(collectionSetters=[]),collectionSetters.length>0){let actions=eval(collectionSetters[0].Setter);value&&(Array.isArray(value)?await Z(this,Te,"f").executeAction(actions,Z(this,bt,"f"),value.map(t=>({name:"value",value:t})),batchId):await Z(this,Te,"f").executeAction(actions,Z(this,bt,"f"),[{name:"value",value}],batchId))}}async setCollectionAdder(key,value,batchId){let adders=await Z(this,Te,"f").infer(`subject_class("${Z(this,rr,"f")}", C), collection_adder(C, "${Cr(key)}", Adder)`);if(adders||(adders=[]),adders.length>0){let actions=eval(adders[0].Adder);value&&(Array.isArray(value)?await Promise.all(value.map(t=>Z(this,Te,"f").executeAction(actions,Z(this,bt,"f"),[{name:"value",value:t}],batchId))):await Z(this,Te,"f").executeAction(actions,Z(this,bt,"f"),[{name:"value",value}],batchId))}}async setCollectionRemover(key,value,batchId){let removers=await Z(this,Te,"f").infer(`subject_class("${Z(this,rr,"f")}", C), collection_remover(C, "${Cr(key)}", Remover)`);if(removers||(removers=[]),removers.length>0){let actions=eval(removers[0].Remover);value&&(Array.isArray(value)?await Promise.all(value.map(t=>Z(this,Te,"f").executeAction(actions,Z(this,bt,"f"),[{name:"value",value:t}],batchId))):await Z(this,Te,"f").executeAction(actions,Z(this,bt,"f"),[{name:"value",value}],batchId))}}async save(t){let e=!1;t||(t=await this.perspective.createBatch(),e=!0);let r={};for(let[n,i]of Object.entries(this))i!=null&&!(Array.isArray(i)&&i.length>0)&&!i?.action&&(r[n]=i);await this.perspective.createSubject(this,Z(this,bt,"f"),r,t),await Z(this,Te,"f").add(new Bn({source:Z(this,$s,"f"),predicate:"ad4m://has_child",target:this.baseExpression}),"shared",t),await this.innerUpdate(!1,t),e&&(await this.perspective.commitBatch(t),await this.getData())}cleanCopy(){let t={},e=Object.entries(this);for(let[r,n]of e)n!=null&&r!=="author"&&r!=="timestamp"&&(t[r]=n);return t}async innerUpdate(t=!0,e){Sa(this,rr,await Z(this,Te,"f").stringOrTemplateObjectToSubjectClassName(this.cleanCopy()),"f");let r=Object.entries(this);for(let[n,i]of r)if(i!=null)if(i?.action)switch(i.action){case"setter":await this.setCollectionSetter(n,i.value,e);break;case"adder":await this.setCollectionAdder(n,i.value,e);break;case"remover":await this.setCollectionRemover(n,i.value,e);break;default:await this.setCollectionSetter(n,i.value,e);break}else Array.isArray(i)&&i.length>0?await this.setCollectionSetter(n,i,e):i!=null&&i!==""&&t&&await this.setProperty(n,i,e)}async update(t){await this.innerUpdate(!0,t),await this.getData()}async get(){return Sa(this,rr,await Z(this,Te,"f").stringOrTemplateObjectToSubjectClassName(this.cleanCopy()),"f"),await this.getData()}async delete(t){await Z(this,Te,"f").removeSubject(this,Z(this,bt,"f"),t)}static query(t,e){return new Ul(t,this,e)}static fromJSONSchema(t,e){if(t?.properties&&Object.prototype.hasOwnProperty.call(t.properties,"author"))throw new Error('JSON Schema must not define a top-level "author" property because Ad4mModel already exposes it. Please rename the property (e.g., "writer").');let r=this.determineNamespace(t,e),n=class extends _Ad4mModel{};Object.defineProperty(n,"name",{value:e.name}),n.className=e.name,n.prototype.className=e.name;let i={},a={};if(t.properties)for(let[u,c]of Object.entries(t.properties)){let l=this.determinePredicate(t,u,c,r,e),d=t.required?.includes(u)||!1;if(c.type==="array"){a[u]={through:l,local:this.getPropertyOption(u,c,e,"local")},Object.defineProperty(n.prototype,u,{configurable:!0,writable:!0,value:[]});let p=`add${Ls(u)}`,h=`remove${Ls(u)}`,g=`setCollection${Ls(u)}`;n.prototype[p]=function(){},n.prototype[h]=function(){},n.prototype[g]=function(){}}else{let p=this.getPropertyOption(u,c,e,"resolveLanguage");!p&&e.resolveLanguage&&(p=e.resolveLanguage);let h=this.getPropertyOption(u,c,e,"local"),g=this.getPropertyOption(u,c,e,"writable",!0),v=this.getPropertyOption(u,c,e,"initial");if(c.type==="object"&&!p&&(p="literal",console.warn(`Property "${u}" is an object type. It will be stored as JSON. Consider flattening complex objects for better semantic querying.`)),p==null&&(c.type==="number"||c.type==="integer")&&(p="literal"),d&&!v&&(c.type==="object"?v="literal://json:{}":v="ad4m://undefined"),i[u]={through:l,required:d,writable:g,...p&&{resolveLanguage:p},...h!==void 0&&{local:h},...v&&{initial:v}},Object.defineProperty(n.prototype,u,{configurable:!0,writable:!0,value:this.getDefaultValueForType(c.type)}),g){let C=Vl(u);n.prototype[C]=function(){}}}}if(!Object.values(i).some(u=>u.initial)){let u="ad4m://type",c=`${r.replace("://","")}://instance`;i.__ad4m_type={through:u,required:!0,writable:!1,initial:c,flag:!0},Object.defineProperty(n.prototype,"__ad4m_type",{configurable:!0,writable:!1,value:c}),console.warn(`No properties with initial values found. Added automatic type flag: ${u} = ${c}`)}return n.prototype.__properties=i,n.prototype.__collections=a,w3({name:e.name})(n),n}static determineNamespace(t,e){if(e.namespace)return e.namespace;if(t["x-ad4m"]?.namespace)return t["x-ad4m"].namespace;if(t.title)return`${t.title.toLowerCase()}://`;if(t.$id)try{let n=new URL(t.$id).pathname.split("/").filter(i=>i);if(n.length>0)return`${n[n.length-1].replace(/\.schema\.json$/,"").replace(/\.json$/,"").toLowerCase()}://`}catch{}throw new Error(`Cannot infer namespace for JSON Schema. Please provide one of:
|
|
1468
|
+
- options.namespace
|
|
1469
|
+
- schema["x-ad4m"].namespace
|
|
1470
|
+
- schema.title
|
|
1471
|
+
- valid schema.$id`)}static determinePredicate(t,e,r,n,i){return i.propertyMapping?.[e]?i.propertyMapping[e]:r["x-ad4m"]?.through?r["x-ad4m"].through:i.predicateTemplate?i.predicateTemplate.replace("${namespace}",n.replace("://","")).replace("${title}",t.title||"").replace("${property}",e):i.predicateGenerator?i.predicateGenerator(t.title||"",e):`${n.endsWith("://")?n.slice(0,-3):n}://${e}`}static getPropertyOption(t,e,r,n,i){return r.propertyOptions?.[t]?.[n]!==void 0?r.propertyOptions[t][n]:e["x-ad4m"]?.[n]!==void 0?e["x-ad4m"][n]:r[n]!==void 0?r[n]:i}static getDefaultValueForType(t){switch(t){case"string":return"";case"number":return 0;case"integer":return 0;case"boolean":return!1;case"array":return[];case"object":return{};default:return""}}};bt=new WeakMap,rr=new WeakMap,$s=new WeakMap,Te=new WeakMap;_Ad4mModel.classNamesByClass=new WeakMap;var Ul=class{constructor(e,r,n){this.queryParams={},this.modelClassName=null,this.perspective=e,this.ctor=r,n&&(this.queryParams=n)}dispose(){this.currentSubscription&&(this.currentSubscription.dispose(),this.currentSubscription=void 0)}where(e){return this.queryParams.where=e,this}order(e){return this.queryParams.order=e,this}limit(e){return this.queryParams.limit=e,this}offset(e){return this.queryParams.offset=e,this}source(e){return this.queryParams.source=e,this}properties(e){return this.queryParams.properties=e,this}collections(e){return this.queryParams.collections=e,this}overrideModelClassName(e){return this.modelClassName=e,this}async get(){let e=await this.ctor.queryToProlog(this.perspective,this.queryParams),r=await this.perspective.infer(e),{results:n}=await this.ctor.instancesFromPrologResult(this.perspective,this.queryParams,r);return n}async subscribe(e){this.dispose();let r=await this.ctor.queryToProlog(this.perspective,this.queryParams,this.modelClassName);this.currentSubscription=await this.perspective.subscribeInfer(r);let n=async a=>{let{results:o}=await this.ctor.instancesFromPrologResult(this.perspective,this.queryParams,a);e(o)};this.currentSubscription.onResult(n);let{results:i}=await this.ctor.instancesFromPrologResult(this.perspective,this.queryParams,this.currentSubscription.result);return i}async count(){let e=await this.ctor.countQueryToProlog(this.perspective,this.queryParams,this.modelClassName);return(await this.perspective.infer(e))?.[0]?.TotalCount||0}async countSubscribe(e){this.dispose();let r=await this.ctor.countQueryToProlog(this.perspective,this.queryParams,this.modelClassName);this.currentSubscription=await this.perspective.subscribeInfer(r);let n=async i=>{let a=i?.[0]?.TotalCount||0;e(a)};return this.currentSubscription.onResult(n),this.currentSubscription.result?.[0]?.TotalCount||0}async paginate(e,r){let n={...this.queryParams||{},limit:e,offset:e*(r-1),count:!0},i=await this.ctor.queryToProlog(this.perspective,n,this.modelClassName),a=await this.perspective.infer(i),{results:o,totalCount:s}=await this.ctor.instancesFromPrologResult(this.perspective,n,a);return{results:o,totalCount:s,pageSize:e,pageNumber:r}}async paginateSubscribe(e,r,n){this.dispose();let i={...this.queryParams||{},limit:e,offset:e*(r-1),count:!0},a=await this.ctor.queryToProlog(this.perspective,i,this.modelClassName);this.currentSubscription=await this.perspective.subscribeInfer(a);let o=async c=>{let{results:l,totalCount:d}=await this.ctor.instancesFromPrologResult(this.perspective,this.queryParams,c);n({results:l,totalCount:d,pageSize:e,pageNumber:r})};this.currentSubscription.onResult(o);let{results:s,totalCount:u}=await this.ctor.instancesFromPrologResult(this.perspective,i,this.currentSubscription.result);return{results:s,totalCount:u,pageSize:e,pageNumber:r}}};var hc="0.10.1-dev-1";var kr=12e3;function C3(){let t=new AbortController;return setTimeout(()=>t.abort(),20),t}function mc(t,e=1e4){return ge(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 tp(t){return ge(this,null,function*(){try{let e=yield fetch(`http://localhost:${t}/graphql/`,{signal:C3().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 x3(){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 rp(){try{localStorage.setItem("test",""),localStorage.removeItem("test")}catch(t){return!1}return!0}function gc(t,e){rp()&&localStorage.setItem(`${hc}/${t}`,e)}function pr(t){return rp()?localStorage.getItem(`${hc}/${t}`):null}function np(t){rp()&&localStorage.removeItem(`${hc}/${t}`)}var E3=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 mo(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 E3(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 go=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=kr;this.capabilities=[];this.isHosting=!1;this.listeners={authstatechange:[],configstatechange:[],connectionstatechange:[]};mo(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 ge(this,null,function*(){try{if(e){yield mc(e),this.setUrl(e);let r=this.buildClient();return yield this.checkAuth(),r}else{this.notifyConnectionChange("checking_local");try{yield mc(`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 ge(this,null,function*(){try{let n=yield fetch("https://hosting.ad4m.dev/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:e,password:r})});if(n.status===200){let i=yield n.json();localStorage.setItem("hosting_token",i.token);let a=localStorage.getItem("hosting_token"),o=yield fetch("https://hosting.ad4m.dev/api/service/info",{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+a}});if(o.status===200){let s=yield o.json();if(s.serviceId)if(this.setPort(s.port),this.setUrl(s.url),this.isHosting=!0,gc("ad4mhosting","true"),!s.paused)this.connect();else throw new Error("Hosting is not running")}}else if((yield n.json()).message==="Passwords did not match")throw new Error("Passwords did not match")}catch(n){throw console.log(n),new Error(`Error logging in ${n}`)}})}checkEmail(e){return ge(this,null,function*(){try{return(yield fetch(`https://hosting.ad4m.dev/api/auth/check-email?email=${e}`,{method:"GET",headers:{"Content-Type":"application/json"}})).status===200}catch(r){console.log(r)}})}connectToPort(e){return ge(this,null,function*(){try{if(e){let r=yield tp(e);return this.setPort(r),this.buildClient()}else if(this.url.includes("localhost")){let r=yield this.findPort();return this.setPort(r),this.buildClient()}}catch(r){this.notifyConnectionChange("not_connected"),this.notifyAuthChange("unauthenticated")}})}ensureConnection(){return ge(this,null,function*(){var r,n;if(((r=this.activeSocket)==null?void 0:r.readyState)===WebSocket.OPEN&&((n=this.activeSocket)==null?void 0:n.url)===this.url&&this.ad4mClient)return this.ad4mClient;try{return this.notifyConnectionChange("connecting"),yield mc(this.url),this.buildClient()}catch(i){return this.notifyConnectionChange("not_connected"),this.connectToPort()}})}findPort(){return ge(this,null,function*(){let e=[...Array(10).keys()].map((i,a)=>tp(kr+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=Pd({url:this.url,connectionParams:()=>ge(this,null,function*(){return{headers:{authorization:this.token}}}),on:{opened:e=>{this.activeSocket=e},error:e=>{this.notifyConnectionChange("not_connected"),this.notifyAuthChange("unauthenticated")},connected:()=>{this.notifyConnectionChange("connected"),this.checkAuth()},closed:e=>ge(this,null,function*(){if(!e.wasClean&&!this.requestedRestart)if(!this.token)this.notifyConnectionChange(this.token?"disconnected":"not_connected"),this.notifyAuthChange("unauthenticated"),this.requestedRestart=!1;else{let r=yield this.connect();r?this.ad4mClient=r:(this.notifyConnectionChange(this.token?"disconnected":"not_connected"),this.notifyAuthChange("unauthenticated"),this.requestedRestart=!1)}})}}),this.apolloClient=new Qu({link:new Rd(this.wsClient),cache:new ts({resultCaching:!1,addTypename:!1}),defaultOptions:{watchQuery:{fetchPolicy:"no-cache"},query:{fetchPolicy:"no-cache"},mutate:{fetchPolicy:"no-cache"}}}),this.ad4mClient=new ec(this.apolloClient),this.ad4mClient}checkAuth(){return ge(this,null,function*(){try{return(yield this.ad4mClient.agent.isLocked())?this.notifyAuthChange("locked"):(yield this.ad4mClient.agent.status(),this.notifyAuthChange("authenticated")),!0}catch(e){return e.message==="Socket closed with event 4500 Cannot extractByTags from a ciphered wallet. You must unlock first."?(this.notifyAuthChange("locked"),!0):(this.notifyAuthChange("unauthenticated"),!1)}})}requestCapability(e=!1){return ge(this,null,function*(){var r;if(e&&this.setToken(null),this.isHosting){let n=localStorage.getItem("hosting_token");(yield fetch("https://hosting.ad4m.dev/api/service/checkStatus",{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer "+n}})).status!==200&&console.error("Looks like the client is not running you might not recieve the mail with the code, please check your dashboard logs.")}return this.requestId=yield(r=this.ad4mClient)==null?void 0:r.agent.requestCapability({appName:this.appName,appDesc:this.appDesc,appUrl:this.appUrl,appIconPath:this.appIconPath,appDomain:this.appDomain,capabilities:this.capabilities}),this.requestId})}verifyCode(e){return ge(this,null,function*(){var r;try{let n=yield(r=this.ad4mClient)==null?void 0:r.agent.generateJwt(this.requestId,e);return this.setToken(n),yield this.buildClient(),yield this.checkAuth(),this.token}catch(n){throw new Error("Invalid code")}})}clearState(){this.setToken(null),this.setPort(kr),this.notifyConnectionChange("not_connected"),this.notifyAuthChange("unauthenticated")}};function ip({unlockAgent:t,reconnect:e}){return Q`
|
|
1335
1472
|
<div class="text-center">
|
|
1336
1473
|
<div class="items">
|
|
1337
1474
|
<div>
|
|
@@ -1343,7 +1480,7 @@ type TriggeredNotification {
|
|
|
1343
1480
|
<button class="button" @click=${e}>Reconnect</button>
|
|
1344
1481
|
</div>
|
|
1345
1482
|
</div>
|
|
1346
|
-
`}function
|
|
1483
|
+
`}function ap(){return Q`
|
|
1347
1484
|
<div class="items">
|
|
1348
1485
|
<div class="text-center">
|
|
1349
1486
|
<h1 class="heading">Request to AD4M blocked</h1>
|
|
@@ -1364,7 +1501,7 @@ type TriggeredNotification {
|
|
|
1364
1501
|
</button>
|
|
1365
1502
|
</div>
|
|
1366
1503
|
</div>
|
|
1367
|
-
`}function
|
|
1504
|
+
`}function op({reconnect:t}){return Q`
|
|
1368
1505
|
<div class="items items--small">
|
|
1369
1506
|
<div class="text-center">
|
|
1370
1507
|
<h1 class="heading">Could not connect to AD4M</h1>
|
|
@@ -1373,7 +1510,7 @@ type TriggeredNotification {
|
|
|
1373
1510
|
<button class="button" @click=${()=>t()}>Try again</button>
|
|
1374
1511
|
</div>
|
|
1375
1512
|
</div>
|
|
1376
|
-
`}function
|
|
1513
|
+
`}function sp(){return Q`<header class="dialog__header">
|
|
1377
1514
|
<div class="dialog__logo">
|
|
1378
1515
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 38 37" fill="none">
|
|
1379
1516
|
<path
|
|
@@ -1382,7 +1519,7 @@ type TriggeredNotification {
|
|
|
1382
1519
|
/>
|
|
1383
1520
|
</svg>
|
|
1384
1521
|
</div>
|
|
1385
|
-
</header>`}function
|
|
1522
|
+
</header>`}function cp({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 Q`
|
|
1386
1523
|
<div class="text-center">
|
|
1387
1524
|
<p>
|
|
1388
1525
|
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.
|
|
@@ -1394,13 +1531,13 @@ type TriggeredNotification {
|
|
|
1394
1531
|
Back
|
|
1395
1532
|
</button>
|
|
1396
1533
|
</div>
|
|
1397
|
-
`;if(t===0)return
|
|
1534
|
+
`;if(t===0)return Q`
|
|
1398
1535
|
<div class="input">
|
|
1399
1536
|
<label class="input__label">EMAIL</label>
|
|
1400
1537
|
<input
|
|
1401
1538
|
class="input__field"
|
|
1402
1539
|
value=${e}
|
|
1403
|
-
@input=${
|
|
1540
|
+
@input=${f=>r(f.target.value)}
|
|
1404
1541
|
/>
|
|
1405
1542
|
<div class="buttons">
|
|
1406
1543
|
<button
|
|
@@ -1417,18 +1554,18 @@ type TriggeredNotification {
|
|
|
1417
1554
|
</button>
|
|
1418
1555
|
</div>
|
|
1419
1556
|
</div>
|
|
1420
|
-
`;if(t===1)return
|
|
1557
|
+
`;if(t===1)return Q`
|
|
1421
1558
|
<div class="input">
|
|
1422
1559
|
<label class="input__label">PASSWORD</label>
|
|
1423
1560
|
<input
|
|
1424
1561
|
class="input__field"
|
|
1425
1562
|
value=${i}
|
|
1426
|
-
@input=${
|
|
1563
|
+
@input=${f=>a(f.target.value)}
|
|
1427
1564
|
type="password"
|
|
1428
1565
|
errortext={passwordError}
|
|
1429
1566
|
error={passwordError}
|
|
1430
1567
|
/>
|
|
1431
|
-
${u?
|
|
1568
|
+
${u?Q`<p class="error">${u}</p>`:""}
|
|
1432
1569
|
<div class="buttons">
|
|
1433
1570
|
<button
|
|
1434
1571
|
class="button button--full button-secondary"
|
|
@@ -1445,7 +1582,7 @@ type TriggeredNotification {
|
|
|
1445
1582
|
</button>
|
|
1446
1583
|
</div>
|
|
1447
1584
|
</div>
|
|
1448
|
-
`;if(t===2)return
|
|
1585
|
+
`;if(t===2)return Q`
|
|
1449
1586
|
<div class="text-center">
|
|
1450
1587
|
<p>
|
|
1451
1588
|
Email is not registered. Please follow the <a target="_blank" href="https://hosting.ad4m.dev/">link</a> to register.
|
|
@@ -1457,7 +1594,7 @@ type TriggeredNotification {
|
|
|
1457
1594
|
Back
|
|
1458
1595
|
</button>
|
|
1459
1596
|
</div>
|
|
1460
|
-
`}function
|
|
1597
|
+
`}function up(){return Q`
|
|
1461
1598
|
<div>
|
|
1462
1599
|
<div class="lds-ring">
|
|
1463
1600
|
<div></div>
|
|
@@ -1466,30 +1603,30 @@ type TriggeredNotification {
|
|
|
1466
1603
|
<div></div>
|
|
1467
1604
|
</div>
|
|
1468
1605
|
</div>
|
|
1469
|
-
`}function
|
|
1606
|
+
`}function yo(){return Q`
|
|
1470
1607
|
<svg width="44" height="40" viewBox="0 0 70 60" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
1471
1608
|
<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"/>
|
|
1472
1609
|
</svg>
|
|
1473
|
-
`}function
|
|
1610
|
+
`}function lp({openModal:t}){return Q`
|
|
1474
1611
|
<div class="mainlogo" @click=${t}>
|
|
1475
|
-
${
|
|
1612
|
+
${yo()}
|
|
1476
1613
|
</div>
|
|
1477
|
-
`}function
|
|
1614
|
+
`}function pp({capabilities:t,appname:e,appiconpath:r,changeState:n,setOpen:i,requestCapability:a}){return Q`
|
|
1478
1615
|
<div class="items">
|
|
1479
1616
|
<div class="text-center">
|
|
1480
1617
|
<p class="body">An external application</p>
|
|
1481
1618
|
<h1 class="heading nomargin">${e}</h1>
|
|
1482
1619
|
<p class="body">wants to access your AD4M data</p>
|
|
1483
1620
|
</div>
|
|
1484
|
-
${r&&
|
|
1621
|
+
${r&&Q`<div class="dialog__connect">
|
|
1485
1622
|
<img class="dialog__connect-app" src=${r} alt="Logo" />
|
|
1486
1623
|
<div class="dialog__connect-check"></div>
|
|
1487
|
-
<div class="dialog__connect-ad4m">${
|
|
1624
|
+
<div class="dialog__connect-ad4m">${yo()}</div>
|
|
1488
1625
|
</div>`}
|
|
1489
1626
|
<div>
|
|
1490
1627
|
<p class="text-center"><b>This will allow the developer to:</b></p>
|
|
1491
1628
|
<ul class="check-list">
|
|
1492
|
-
${t.map(o=>
|
|
1629
|
+
${t.map(o=>Q`<li>
|
|
1493
1630
|
<span>
|
|
1494
1631
|
<svg
|
|
1495
1632
|
xmlns="http://www.w3.org/2000/svg"
|
|
@@ -1503,7 +1640,7 @@ type TriggeredNotification {
|
|
|
1503
1640
|
/>
|
|
1504
1641
|
</svg>
|
|
1505
1642
|
</span>
|
|
1506
|
-
<span>${
|
|
1643
|
+
<span>${J1(o)}</span>
|
|
1507
1644
|
</li>`)}
|
|
1508
1645
|
</ul>
|
|
1509
1646
|
</div>
|
|
@@ -1528,7 +1665,7 @@ type TriggeredNotification {
|
|
|
1528
1665
|
Connection settings
|
|
1529
1666
|
</button>
|
|
1530
1667
|
</div>
|
|
1531
|
-
`}function
|
|
1668
|
+
`}function fp({changeState:t,onSuccess:e,uiState:r}){function n(i){let a=new BarcodeDetector,o=i.currentTarget,s=()=>ge(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 Q`
|
|
1532
1669
|
<div class="qr-scanner">
|
|
1533
1670
|
<div class="qr-content">
|
|
1534
1671
|
<button
|
|
@@ -1547,7 +1684,7 @@ type TriggeredNotification {
|
|
|
1547
1684
|
></video>
|
|
1548
1685
|
</div>
|
|
1549
1686
|
</div>
|
|
1550
|
-
`}function
|
|
1687
|
+
`}function dp({port:t,url:e,isRemote:r,connectToPort:n,changeIsRemote:i,connectRemote:a,changeState:o,changeUrl:s,changePort:u,clearState:c}){return Q`
|
|
1551
1688
|
<div class="items items--small">
|
|
1552
1689
|
<div class="text-center">
|
|
1553
1690
|
<h1 class="heading">Connection Settings</h1>
|
|
@@ -1558,66 +1695,66 @@ type TriggeredNotification {
|
|
|
1558
1695
|
Locally
|
|
1559
1696
|
</button>
|
|
1560
1697
|
<button class=${`button ${r?"button--primary":"button--secondary"}`} @click=${()=>i(!0)}>
|
|
1561
|
-
|
|
1698
|
+
Remotely
|
|
1562
1699
|
</button>
|
|
1563
1700
|
</div>
|
|
1564
|
-
${r?
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
@input=${p=>u(parseInt(p.target.value))}
|
|
1591
|
-
/>
|
|
1592
|
-
</div>
|
|
1701
|
+
${r?Q`
|
|
1702
|
+
<div class="input">
|
|
1703
|
+
<label class="input__label">URL</label>
|
|
1704
|
+
<input
|
|
1705
|
+
class="input__field"
|
|
1706
|
+
value=${e}
|
|
1707
|
+
@input=${f=>s(f.target.value)}
|
|
1708
|
+
/>
|
|
1709
|
+
</div>
|
|
1710
|
+
<div class="buttons">
|
|
1711
|
+
<button
|
|
1712
|
+
class="button button--full"
|
|
1713
|
+
@click=${()=>a(e)}
|
|
1714
|
+
>
|
|
1715
|
+
Connect
|
|
1716
|
+
</button>
|
|
1717
|
+
</div>
|
|
1718
|
+
`:Q`
|
|
1719
|
+
<div class="input">
|
|
1720
|
+
<label class="input__label">PORT</label>
|
|
1721
|
+
<input
|
|
1722
|
+
class="input__field"
|
|
1723
|
+
value=${t}
|
|
1724
|
+
@input=${f=>u(parseInt(f.target.value))}
|
|
1725
|
+
/>
|
|
1726
|
+
</div>
|
|
1593
1727
|
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1728
|
+
<div class="buttons">
|
|
1729
|
+
<button
|
|
1730
|
+
class="button button--full"
|
|
1731
|
+
@click=${()=>n(t)}
|
|
1732
|
+
>
|
|
1733
|
+
Connect
|
|
1734
|
+
</button>
|
|
1735
|
+
</div>
|
|
1736
|
+
`}
|
|
1737
|
+
|
|
1738
|
+
<div class="text-center">or</div>
|
|
1739
|
+
<div class="buttons">
|
|
1740
|
+
<button
|
|
1741
|
+
class="button button--full button--secondary"
|
|
1742
|
+
@click=${()=>o("start")}
|
|
1743
|
+
>
|
|
1744
|
+
Back
|
|
1745
|
+
</button>
|
|
1746
|
+
<button
|
|
1747
|
+
class="button button--full button--secondary"
|
|
1748
|
+
@click=${c}
|
|
1749
|
+
>
|
|
1750
|
+
Clear state
|
|
1751
|
+
</button>
|
|
1752
|
+
</div
|
|
1617
1753
|
</div>
|
|
1618
|
-
`}function
|
|
1754
|
+
`}function hp({connect:t,isMobile:e,hasClickedDownload:r,changeState:n,onDownloaded:i,scanQrcode:a,hosting:o}){let u=(pr("ad4murl")||`http://localhost:${kr}`).includes("localhost");function c(l){l.preventDefault();let d=l.currentTarget;window.open(d.href,"_blank"),this.onDownloaded()}return Q`
|
|
1619
1755
|
<div class="items">
|
|
1620
|
-
${r?
|
|
1756
|
+
${r?Q`
|
|
1757
|
+
<div class="text-center">
|
|
1621
1758
|
<a class="button" target="_blank" @click=${()=>t()}>
|
|
1622
1759
|
Connect to ADAM
|
|
1623
1760
|
</a>
|
|
@@ -1625,54 +1762,62 @@ type TriggeredNotification {
|
|
|
1625
1762
|
Please connect to ADAM once you have downloaded and setup your
|
|
1626
1763
|
ADAM agent
|
|
1627
1764
|
</p>
|
|
1628
|
-
</div
|
|
1765
|
+
</div>
|
|
1766
|
+
`:Q`
|
|
1629
1767
|
<div class="text-center">
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
>
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1768
|
+
<h1 class="heading">Could not connect to AD4M</h1>
|
|
1769
|
+
${u?Q`
|
|
1770
|
+
<p style="color: #b9b9b9; font-size: 15px; text-align: center; margin: 30px 0;">
|
|
1771
|
+
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.
|
|
1772
|
+
<br/>
|
|
1773
|
+
<br/>
|
|
1774
|
+
(Safari users: please use a different browser for now. Safari is very strict about this and we are working on a solution.)
|
|
1775
|
+
</p>
|
|
1776
|
+
`:Q`
|
|
1777
|
+
<p style="color: #b9b9b9; font-size: 15px; text-align: center; margin: 30px 0;">
|
|
1778
|
+
Looks like the remote executor you are trying to connect to is not reachable.
|
|
1779
|
+
<br/>
|
|
1780
|
+
<br/>
|
|
1781
|
+
Please try connecting to a different remote executor or check your connection settings.
|
|
1782
|
+
</p>
|
|
1783
|
+
`}
|
|
1784
|
+
${e?Q`<button class="button" @click=${()=>a()}>
|
|
1785
|
+
Connect with QR
|
|
1786
|
+
</button>`:Q`<a
|
|
1787
|
+
class="button"
|
|
1788
|
+
target="_blank"
|
|
1789
|
+
@click=${c}
|
|
1790
|
+
href="https://github.com/coasys/ad4m/releases"
|
|
1791
|
+
>
|
|
1792
|
+
Download AD4M
|
|
1793
|
+
</a>
|
|
1794
|
+
`}
|
|
1795
|
+
${o?Q`<p>Or</p>`:""}
|
|
1796
|
+
${o?Q`<button class="button" @click=${()=>n("hosting")}>Use hosted AD4M (alpha)</button>`:""}
|
|
1642
1797
|
</div>
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
</
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
<p style="height: 60px; color: red; font-size: 14px; text-align: center; margin: 0; margin-top: -30px;">
|
|
1659
|
-
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.
|
|
1660
|
-
(Safari users: please use a different browser for now. Safari is very strict about this and we are working on a solution.)
|
|
1661
|
-
</p>
|
|
1662
|
-
`:B`
|
|
1663
|
-
<p style="height: 60px; color: red; font-size: 14px; text-align: center; margin: 0; margin-top: -30px;">
|
|
1664
|
-
Looks like the remote executor you are trying to connect to is not reachable.
|
|
1665
|
-
Please try connecting to a different remote executor or check your connection settings.
|
|
1666
|
-
</p>
|
|
1667
|
-
`}
|
|
1798
|
+
|
|
1799
|
+
<div style="display: flex; flex-direction: column; align-items: center; gap: 20px; margin-top: -30px">
|
|
1800
|
+
or
|
|
1801
|
+
<button class="button button--secondary" @click=${()=>t()}>
|
|
1802
|
+
Try reconnecting
|
|
1803
|
+
</button>
|
|
1804
|
+
or
|
|
1805
|
+
<button
|
|
1806
|
+
class="button button--secondary "
|
|
1807
|
+
@click=${()=>n("settings")}
|
|
1808
|
+
>
|
|
1809
|
+
Change connection settings
|
|
1810
|
+
</button>
|
|
1811
|
+
</div>
|
|
1812
|
+
`}
|
|
1668
1813
|
|
|
1669
1814
|
<div class="text-center">
|
|
1670
|
-
<a class="button
|
|
1671
|
-
|
|
1672
|
-
>
|
|
1815
|
+
<a class="button" _target="blank" href="https://ad4m.dev">
|
|
1816
|
+
Learn more about ADAM
|
|
1817
|
+
</a>
|
|
1673
1818
|
</div>
|
|
1674
1819
|
</div>
|
|
1675
|
-
`}function
|
|
1820
|
+
`}function mp({code:t,changeState:e,verifyCode:r,changeCode:n,isHosting:i,verifyCodeError:a}){return Q`
|
|
1676
1821
|
<div class="items">
|
|
1677
1822
|
<div class="text-center">
|
|
1678
1823
|
<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>
|
|
@@ -1690,7 +1835,7 @@ type TriggeredNotification {
|
|
|
1690
1835
|
value=${t}
|
|
1691
1836
|
@change=${o=>n(o.target.value)}
|
|
1692
1837
|
/>
|
|
1693
|
-
${a?
|
|
1838
|
+
${a?Q`<p class="error">${a}</p>`:""}
|
|
1694
1839
|
</div>
|
|
1695
1840
|
<div class="buttons">
|
|
1696
1841
|
<button
|
|
@@ -1704,7 +1849,7 @@ type TriggeredNotification {
|
|
|
1704
1849
|
</button>
|
|
1705
1850
|
</div>
|
|
1706
1851
|
</div>
|
|
1707
|
-
`}function
|
|
1852
|
+
`}function k3(){return[/Android/i,/webOS/i,/iPhone/i,/iPad/i,/iPod/i,/BlackBerry/i,/Windows Phone/i].some(e=>navigator.userAgent.match(e))}var I3=bc`
|
|
1708
1853
|
:host {
|
|
1709
1854
|
--primary-color: #fff;
|
|
1710
1855
|
--heading-color: #fff;
|
|
@@ -2105,16 +2250,16 @@ type TriggeredNotification {
|
|
|
2105
2250
|
width: 100vw;
|
|
2106
2251
|
object-fit: cover;
|
|
2107
2252
|
}
|
|
2108
|
-
`,
|
|
2253
|
+
`,de=class extends Or{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=pr("ad4mhosting")==="true"||!1;this.token=pr("ad4mToken")||"";this.port=parseInt(pr("ad4mport"))||kr;this.url=pr("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(),mo(this),this.injectFont(),this._isMobile=k3(),this._client=new go({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(pr("ad4mport"))||kr,token:this.token||pr("ad4mtoken"),url:this.url||pr("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 ge(this,null,function*(){try{(yield this._client.checkEmail(this._email))?this._hostingStep=1:this._hostingStep=2}catch(r){console.log(r)}})}loginToHosting(){return ge(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 ge(this,null,function*(){yield this._client.ad4mClient.agent.unlock(r,n)})}verifyCode(r){return ge(this,null,function*(){try{yield this._client.verifyCode(r)}catch(n){this._verifyCodeError="Invalid code"}})}changeUrl(r){r!==this._client.url&&(np("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?gc("ad4m"+r,n):np("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 ge(this,null,function*(){try{window.BarcodeDetector.getSupportedFormats()}catch(n){window.BarcodeDetector=Ar}yield this.changeUIState("qr"),setTimeout(()=>ge(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 ge(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 ge(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 ge(this,null,function*(){try{yield this._client.requestCapability(r),this.changeUIState("verifycode")}catch(n){console.warn(n)}})}isAuthenticated(){return ge(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 up();if(this.uiState==="hosting")return cp({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 fp({changeState:this.changeUIState,onSuccess:r=>{this.changeUrl(r),this._client.connect(r)},uiState:this.uiState});if(this.authState==="locked")return ip({unlockAgent:this.unlockAgent,reconnect:this.connect});if(this.uiState==="settings")return dp({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 hp({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"?mp({code:this._code,changeCode:this.changeCode,changeState:this.changeUIState,verifyCode:this.verifyCode,isHosting:this._client.isHosting,verifyCodeError:this._verifyCodeError}):pp({changeState:this.changeUIState,requestCapability:this.requestCapability,capabilities:this.capabilities,appname:this.appName,setOpen:this.setOpen,appiconpath:this.appIconPath});if(this.connectionState==="disconnected")return op({reconnect:this.connect});if(this.connectionState==="port_not_found")return ap()}mobileView(){return this.mobile?lp({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:Q`
|
|
2109
2254
|
<div class="wrapper">
|
|
2110
2255
|
<div class="dialog">
|
|
2111
|
-
${
|
|
2256
|
+
${sp()}
|
|
2112
2257
|
<main class="dialog__content">${this.renderViews()}</main>
|
|
2113
2258
|
${this.mobileView()}
|
|
2114
2259
|
</div>
|
|
2115
2260
|
<div class="ad4mConnect__backdrop" />
|
|
2116
2261
|
</div>
|
|
2117
|
-
`}};
|
|
2262
|
+
`}};de.styles=[I3],Ce([ot()],de.prototype,"_code",2),Ce([ot()],de.prototype,"_isMobile",2),Ce([ot()],de.prototype,"_hasClickedDownload",2),Ce([ot()],de.prototype,"_isRemote",2),Ce([ot()],de.prototype,"_client",2),Ce([ot()],de.prototype,"_isOpen",2),Ce([ot()],de.prototype,"_hostingStep",2),Ce([ot()],de.prototype,"_email",2),Ce([ot()],de.prototype,"_passowrd",2),Ce([ot()],de.prototype,"_passwordError",2),Ce([ot()],de.prototype,"_hostingNotRunningError",2),Ce([ot()],de.prototype,"_verifyCodeError",2),Ce([ot()],de.prototype,"_isHostingLoading",2),Ce([ot()],de.prototype,"uiState",2),Ce([St({type:String,reflect:!0})],de.prototype,"appName",2),Ce([St({type:String,reflect:!0})],de.prototype,"appDesc",2),Ce([St({type:String,reflect:!0})],de.prototype,"appDomain",2),Ce([St({type:String,reflect:!0})],de.prototype,"appIconPath",2),Ce([St({type:Boolean,reflect:!0})],de.prototype,"mobile",2),Ce([St({type:String,reflect:!0})],de.prototype,"capabilities",2),Ce([St({type:Boolean,reflect:!0})],de.prototype,"hosting",2),Ce([St({type:String})],de.prototype,"token",2),Ce([St({type:String,reflect:!0})],de.prototype,"port",2),Ce([St({type:String,reflect:!0})],de.prototype,"url",2),de=Ce([Fp("ad4m-connect")],de);function A3(t){let e=new de;return Object.entries(t).forEach(([r,n])=>{e[r]=n}),document.body.appendChild(e),e}export{de as Ad4mConnectElement,A3 as default,x3 as getAd4mClient};
|
|
2118
2263
|
/*!
|
|
2119
2264
|
* @undecaf/barcode-detector-polyfill v0.9.20
|
|
2120
2265
|
* A WebAssembly polyfill for the Barcode Detection API
|