@coasys/ad4m-connect 0.11.2-dev.5 → 0.12.0-dev-whisper-lang

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.
Files changed (44) hide show
  1. package/dist/core.js +161 -160
  2. package/dist/index.js +130 -129
  3. package/dist/utils.js +1 -1
  4. package/dist/web.js +129 -128
  5. package/package.json +15 -15
  6. package/dist/components/icons/CheckCircleIcon.d.ts +0 -1
  7. package/dist/components/icons/TickIcon.d.ts +0 -1
  8. package/dist/components/shared/Ad4mLogo.d.ts +0 -1
  9. package/dist/components/shared/AppLogo.d.ts +0 -1
  10. package/dist/components/shared/Header.d.ts +0 -1
  11. package/dist/components/shared/Logo.d.ts +0 -1
  12. package/dist/components/states/ErrorState.d.ts +0 -6
  13. package/dist/components/views/ConnectionOverview.d.ts +0 -22
  14. package/dist/components/views/Hosting.d.ts +0 -22
  15. package/dist/components/views/MultiUserAuth.d.ts +0 -26
  16. package/dist/components/views/RemoteConnection.d.ts +0 -19
  17. package/dist/components/views/RequestCapability.d.ts +0 -16
  18. package/dist/components/views/ScanQRCode.d.ts +0 -14
  19. package/dist/components/views/Settings.d.ts +0 -19
  20. package/dist/components/views/Start.d.ts +0 -19
  21. package/dist/components/views/old/Hosting.d.ts +0 -22
  22. package/dist/components/views/old/MultiUserAuth.d.ts +0 -26
  23. package/dist/components/views/old/RemoteConnection.d.ts +0 -19
  24. package/dist/components/views/old/RequestCapability.d.ts +0 -16
  25. package/dist/components/views/old/ScanQRCode.d.ts +0 -14
  26. package/dist/components/views/old/Settings.d.ts +0 -19
  27. package/dist/components/views/old/Start.d.ts +0 -19
  28. package/dist/old/components/InvalidToken.d.ts +0 -0
  29. package/dist/old/components/VerifyCode.d.ts +0 -0
  30. package/dist/old/core.d.ts +0 -0
  31. package/dist/old/electron.d.ts +0 -0
  32. package/dist/old/state/ConnectState.d.ts +0 -0
  33. package/dist/old/state/index.d.ts +0 -0
  34. package/dist/old/utils.d.ts +0 -0
  35. package/dist/old/views/Hosting.d.ts +0 -0
  36. package/dist/old/views/MultiUserAuth.d.ts +0 -0
  37. package/dist/old/views/RemoteConnection.d.ts +0 -0
  38. package/dist/old/views/RequestCapability.d.ts +0 -0
  39. package/dist/old/views/ScanQRCode.d.ts +0 -0
  40. package/dist/old/views/Settings.d.ts +0 -0
  41. package/dist/old/views/Start.d.ts +0 -0
  42. package/dist/old/web.d.ts +0 -0
  43. package/dist/state/ConnectState.d.ts +0 -101
  44. package/dist/state/index.d.ts +0 -2
package/dist/web.js CHANGED
@@ -1,6 +1,6 @@
1
- var cu=Object.defineProperty;var lu=Object.getOwnPropertyDescriptor;var uu=Object.getPrototypeOf;var du=Reflect.get;var j=(i,e,t,r)=>{for(var n=r>1?void 0:r?lu(e,t):e,a=i.length-1,s;a>=0;a--)(s=i[a])&&(n=(r?s(e,t,n):s(n))||n);return r&&n&&cu(e,t,n),n};var So=(i,e,t)=>du(uu(i),t,e);var we=(i,e,t)=>new Promise((r,n)=>{var a=c=>{try{o(t.next(c))}catch(l){n(l)}},s=c=>{try{o(t.throw(c))}catch(l){n(l)}},o=c=>c.done?r(c.value):Promise.resolve(c.value).then(a,s);o((t=t.apply(i,e)).next())});var Cn=window,Nn=Cn.ShadowRoot&&(Cn.ShadyCSS===void 0||Cn.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Qa=Symbol(),wo=new WeakMap,Nr=class{constructor(e,t,r){if(this._$cssResult$=!0,r!==Qa)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(Nn&&e===void 0){let r=t!==void 0&&t.length===1;r&&(e=wo.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),r&&wo.set(t,e))}return e}toString(){return this.cssText}},Eo=i=>new Nr(typeof i=="string"?i:i+"",void 0,Qa),Je=(i,...e)=>{let t=i.length===1?i[0]:e.reduce((r,n,a)=>r+(s=>{if(s._$cssResult$===!0)return s.cssText;if(typeof s=="number")return s;throw Error("Value passed to 'css' function must be a 'css' function result: "+s+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+i[a+1],i[0]);return new Nr(t,i,Qa)},Wa=(i,e)=>{Nn?i.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet):e.forEach(t=>{let r=document.createElement("style"),n=Cn.litNonce;n!==void 0&&r.setAttribute("nonce",n),r.textContent=t.cssText,i.appendChild(r)})},Ln=Nn?i=>i:i=>i instanceof CSSStyleSheet?(e=>{let t="";for(let r of e.cssRules)t+=r.cssText;return Eo(t)})(i):i;var Za,Pn=window,xo=Pn.trustedTypes,pu=xo?xo.emptyScript:"",Ao=Pn.reactiveElementPolyfillSupport,Ya={toAttribute(i,e){switch(e){case Boolean:i=i?pu:null;break;case Object:case Array:i=i==null?i:JSON.stringify(i)}return i},fromAttribute(i,e){let t=i;switch(e){case Boolean:t=i!==null;break;case Number:t=i===null?null:Number(i);break;case Object:case Array:try{t=JSON.parse(i)}catch{t=null}}return t}},$o=(i,e)=>e!==i&&(e==e||i==i),Ja={attribute:!0,type:String,converter:Ya,reflect:!1,hasChanged:$o},Xa="finalized",Ct=class extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this._$Eu()}static addInitializer(e){var t;this.finalize(),((t=this.h)!==null&&t!==void 0?t:this.h=[]).push(e)}static get observedAttributes(){this.finalize();let e=[];return this.elementProperties.forEach((t,r)=>{let n=this._$Ep(r,t);n!==void 0&&(this._$Ev.set(n,r),e.push(n))}),e}static createProperty(e,t=Ja){if(t.state&&(t.attribute=!1),this.finalize(),this.elementProperties.set(e,t),!t.noAccessor&&!this.prototype.hasOwnProperty(e)){let r=typeof e=="symbol"?Symbol():"__"+e,n=this.getPropertyDescriptor(e,r,t);n!==void 0&&Object.defineProperty(this.prototype,e,n)}}static getPropertyDescriptor(e,t,r){return{get(){return this[t]},set(n){let a=this[e];this[t]=n,this.requestUpdate(e,a,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)||Ja}static finalize(){if(this.hasOwnProperty(Xa))return!1;this[Xa]=!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 t=this.properties,r=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(let n of r)this.createProperty(n,t[n])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let r=new Set(e.flat(1/0).reverse());for(let n of r)t.unshift(Ln(n))}else e!==void 0&&t.push(Ln(e));return t}static _$Ep(e,t){let r=t.attribute;return r===!1?void 0:typeof r=="string"?r:typeof e=="string"?e.toLowerCase():void 0}_$Eu(){var e;this._$E_=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$Eg(),this.requestUpdate(),(e=this.constructor.h)===null||e===void 0||e.forEach(t=>t(this))}addController(e){var t,r;((t=this._$ES)!==null&&t!==void 0?t:this._$ES=[]).push(e),this.renderRoot!==void 0&&this.isConnected&&((r=e.hostConnected)===null||r===void 0||r.call(e))}removeController(e){var t;(t=this._$ES)===null||t===void 0||t.splice(this._$ES.indexOf(e)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach((e,t)=>{this.hasOwnProperty(t)&&(this._$Ei.set(t,this[t]),delete this[t])})}createRenderRoot(){var e;let t=(e=this.shadowRoot)!==null&&e!==void 0?e:this.attachShadow(this.constructor.shadowRootOptions);return Wa(t,this.constructor.elementStyles),t}connectedCallback(){var e;this.renderRoot===void 0&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$ES)===null||e===void 0||e.forEach(t=>{var r;return(r=t.hostConnected)===null||r===void 0?void 0:r.call(t)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$ES)===null||e===void 0||e.forEach(t=>{var r;return(r=t.hostDisconnected)===null||r===void 0?void 0:r.call(t)})}attributeChangedCallback(e,t,r){this._$AK(e,r)}_$EO(e,t,r=Ja){var n;let a=this.constructor._$Ep(e,r);if(a!==void 0&&r.reflect===!0){let s=(((n=r.converter)===null||n===void 0?void 0:n.toAttribute)!==void 0?r.converter:Ya).toAttribute(t,r.type);this._$El=e,s==null?this.removeAttribute(a):this.setAttribute(a,s),this._$El=null}}_$AK(e,t){var r;let n=this.constructor,a=n._$Ev.get(e);if(a!==void 0&&this._$El!==a){let s=n.getPropertyOptions(a),o=typeof s.converter=="function"?{fromAttribute:s.converter}:((r=s.converter)===null||r===void 0?void 0:r.fromAttribute)!==void 0?s.converter:Ya;this._$El=a,this[a]=o.fromAttribute(t,s.type),this._$El=null}}requestUpdate(e,t,r){let n=!0;e!==void 0&&(((r=r||this.constructor.getPropertyOptions(e)).hasChanged||$o)(this[e],t)?(this._$AL.has(e)||this._$AL.set(e,t),r.reflect===!0&&this._$El!==e&&(this._$EC===void 0&&(this._$EC=new Map),this._$EC.set(e,r))):n=!1),!this.isUpdatePending&&n&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(t){Promise.reject(t)}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((n,a)=>this[a]=n),this._$Ei=void 0);let t=!1,r=this._$AL;try{t=this.shouldUpdate(r),t?(this.willUpdate(r),(e=this._$ES)===null||e===void 0||e.forEach(n=>{var a;return(a=n.hostUpdate)===null||a===void 0?void 0:a.call(n)}),this.update(r)):this._$Ek()}catch(n){throw t=!1,this._$Ek(),n}t&&this._$AE(r)}willUpdate(e){}_$AE(e){var t;(t=this._$ES)===null||t===void 0||t.forEach(r=>{var n;return(n=r.hostUpdated)===null||n===void 0?void 0:n.call(r)}),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((t,r)=>this._$EO(r,this[r],t)),this._$EC=void 0),this._$Ek()}updated(e){}firstUpdated(e){}};Ct[Xa]=!0,Ct.elementProperties=new Map,Ct.elementStyles=[],Ct.shadowRootOptions={mode:"open"},Ao?.({ReactiveElement:Ct}),((Za=Pn.reactiveElementVersions)!==null&&Za!==void 0?Za:Pn.reactiveElementVersions=[]).push("1.6.3");var es,Rn=window,Yi=Rn.trustedTypes,Io=Yi?Yi.createPolicy("lit-html",{createHTML:i=>i}):void 0,is="$lit$",Ft=`lit$${(Math.random()+"").slice(9)}$`,Ro="?"+Ft,fu=`<${Ro}>`,di=document,Pr=()=>di.createComment(""),Rr=i=>i===null||typeof i!="object"&&typeof i!="function",Oo=Array.isArray,hu=i=>Oo(i)||typeof i?.[Symbol.iterator]=="function",ts=`[
1
+ var cu=Object.defineProperty;var lu=Object.getOwnPropertyDescriptor;var uu=Object.getPrototypeOf;var du=Reflect.get;var j=(i,e,t,r)=>{for(var n=r>1?void 0:r?lu(e,t):e,a=i.length-1,s;a>=0;a--)(s=i[a])&&(n=(r?s(e,t,n):s(n))||n);return r&&n&&cu(e,t,n),n};var So=(i,e,t)=>du(uu(i),t,e);var we=(i,e,t)=>new Promise((r,n)=>{var a=l=>{try{o(t.next(l))}catch(c){n(c)}},s=l=>{try{o(t.throw(l))}catch(c){n(c)}},o=l=>l.done?r(l.value):Promise.resolve(l.value).then(a,s);o((t=t.apply(i,e)).next())});var Cn=window,Nn=Cn.ShadowRoot&&(Cn.ShadyCSS===void 0||Cn.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Qa=Symbol(),wo=new WeakMap,Nr=class{constructor(e,t,r){if(this._$cssResult$=!0,r!==Qa)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(Nn&&e===void 0){let r=t!==void 0&&t.length===1;r&&(e=wo.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),r&&wo.set(t,e))}return e}toString(){return this.cssText}},Eo=i=>new Nr(typeof i=="string"?i:i+"",void 0,Qa),Je=(i,...e)=>{let t=i.length===1?i[0]:e.reduce((r,n,a)=>r+(s=>{if(s._$cssResult$===!0)return s.cssText;if(typeof s=="number")return s;throw Error("Value passed to 'css' function must be a 'css' function result: "+s+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+i[a+1],i[0]);return new Nr(t,i,Qa)},Ga=(i,e)=>{Nn?i.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet):e.forEach(t=>{let r=document.createElement("style"),n=Cn.litNonce;n!==void 0&&r.setAttribute("nonce",n),r.textContent=t.cssText,i.appendChild(r)})},Ln=Nn?i=>i:i=>i instanceof CSSStyleSheet?(e=>{let t="";for(let r of e.cssRules)t+=r.cssText;return Eo(t)})(i):i;var Za,Pn=window,xo=Pn.trustedTypes,pu=xo?xo.emptyScript:"",Ao=Pn.reactiveElementPolyfillSupport,Ya={toAttribute(i,e){switch(e){case Boolean:i=i?pu:null;break;case Object:case Array:i=i==null?i:JSON.stringify(i)}return i},fromAttribute(i,e){let t=i;switch(e){case Boolean:t=i!==null;break;case Number:t=i===null?null:Number(i);break;case Object:case Array:try{t=JSON.parse(i)}catch{t=null}}return t}},$o=(i,e)=>e!==i&&(e==e||i==i),Ja={attribute:!0,type:String,converter:Ya,reflect:!1,hasChanged:$o},Xa="finalized",Ct=class extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this._$Eu()}static addInitializer(e){var t;this.finalize(),((t=this.h)!==null&&t!==void 0?t:this.h=[]).push(e)}static get observedAttributes(){this.finalize();let e=[];return this.elementProperties.forEach((t,r)=>{let n=this._$Ep(r,t);n!==void 0&&(this._$Ev.set(n,r),e.push(n))}),e}static createProperty(e,t=Ja){if(t.state&&(t.attribute=!1),this.finalize(),this.elementProperties.set(e,t),!t.noAccessor&&!this.prototype.hasOwnProperty(e)){let r=typeof e=="symbol"?Symbol():"__"+e,n=this.getPropertyDescriptor(e,r,t);n!==void 0&&Object.defineProperty(this.prototype,e,n)}}static getPropertyDescriptor(e,t,r){return{get(){return this[t]},set(n){let a=this[e];this[t]=n,this.requestUpdate(e,a,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)||Ja}static finalize(){if(this.hasOwnProperty(Xa))return!1;this[Xa]=!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 t=this.properties,r=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(let n of r)this.createProperty(n,t[n])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let r=new Set(e.flat(1/0).reverse());for(let n of r)t.unshift(Ln(n))}else e!==void 0&&t.push(Ln(e));return t}static _$Ep(e,t){let r=t.attribute;return r===!1?void 0:typeof r=="string"?r:typeof e=="string"?e.toLowerCase():void 0}_$Eu(){var e;this._$E_=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$Eg(),this.requestUpdate(),(e=this.constructor.h)===null||e===void 0||e.forEach(t=>t(this))}addController(e){var t,r;((t=this._$ES)!==null&&t!==void 0?t:this._$ES=[]).push(e),this.renderRoot!==void 0&&this.isConnected&&((r=e.hostConnected)===null||r===void 0||r.call(e))}removeController(e){var t;(t=this._$ES)===null||t===void 0||t.splice(this._$ES.indexOf(e)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach((e,t)=>{this.hasOwnProperty(t)&&(this._$Ei.set(t,this[t]),delete this[t])})}createRenderRoot(){var e;let t=(e=this.shadowRoot)!==null&&e!==void 0?e:this.attachShadow(this.constructor.shadowRootOptions);return Ga(t,this.constructor.elementStyles),t}connectedCallback(){var e;this.renderRoot===void 0&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$ES)===null||e===void 0||e.forEach(t=>{var r;return(r=t.hostConnected)===null||r===void 0?void 0:r.call(t)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$ES)===null||e===void 0||e.forEach(t=>{var r;return(r=t.hostDisconnected)===null||r===void 0?void 0:r.call(t)})}attributeChangedCallback(e,t,r){this._$AK(e,r)}_$EO(e,t,r=Ja){var n;let a=this.constructor._$Ep(e,r);if(a!==void 0&&r.reflect===!0){let s=(((n=r.converter)===null||n===void 0?void 0:n.toAttribute)!==void 0?r.converter:Ya).toAttribute(t,r.type);this._$El=e,s==null?this.removeAttribute(a):this.setAttribute(a,s),this._$El=null}}_$AK(e,t){var r;let n=this.constructor,a=n._$Ev.get(e);if(a!==void 0&&this._$El!==a){let s=n.getPropertyOptions(a),o=typeof s.converter=="function"?{fromAttribute:s.converter}:((r=s.converter)===null||r===void 0?void 0:r.fromAttribute)!==void 0?s.converter:Ya;this._$El=a,this[a]=o.fromAttribute(t,s.type),this._$El=null}}requestUpdate(e,t,r){let n=!0;e!==void 0&&(((r=r||this.constructor.getPropertyOptions(e)).hasChanged||$o)(this[e],t)?(this._$AL.has(e)||this._$AL.set(e,t),r.reflect===!0&&this._$El!==e&&(this._$EC===void 0&&(this._$EC=new Map),this._$EC.set(e,r))):n=!1),!this.isUpdatePending&&n&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(t){Promise.reject(t)}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((n,a)=>this[a]=n),this._$Ei=void 0);let t=!1,r=this._$AL;try{t=this.shouldUpdate(r),t?(this.willUpdate(r),(e=this._$ES)===null||e===void 0||e.forEach(n=>{var a;return(a=n.hostUpdate)===null||a===void 0?void 0:a.call(n)}),this.update(r)):this._$Ek()}catch(n){throw t=!1,this._$Ek(),n}t&&this._$AE(r)}willUpdate(e){}_$AE(e){var t;(t=this._$ES)===null||t===void 0||t.forEach(r=>{var n;return(n=r.hostUpdated)===null||n===void 0?void 0:n.call(r)}),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((t,r)=>this._$EO(r,this[r],t)),this._$EC=void 0),this._$Ek()}updated(e){}firstUpdated(e){}};Ct[Xa]=!0,Ct.elementProperties=new Map,Ct.elementStyles=[],Ct.shadowRootOptions={mode:"open"},Ao?.({ReactiveElement:Ct}),((Za=Pn.reactiveElementVersions)!==null&&Za!==void 0?Za:Pn.reactiveElementVersions=[]).push("1.6.3");var es,Rn=window,Yi=Rn.trustedTypes,Io=Yi?Yi.createPolicy("lit-html",{createHTML:i=>i}):void 0,is="$lit$",Ft=`lit$${(Math.random()+"").slice(9)}$`,Ro="?"+Ft,fu=`<${Ro}>`,di=document,Pr=()=>di.createComment(""),Rr=i=>i===null||typeof i!="object"&&typeof i!="function",Oo=Array.isArray,hu=i=>Oo(i)||typeof i?.[Symbol.iterator]=="function",ts=`[
2
2
  \f\r]`,Lr=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,ko=/-->/g,To=/>/g,li=RegExp(`>|${ts}(?:([^\\s"'>=/]+)(${ts}*=${ts}*(?:[^
3
- \f\r"'\`<>=]|("|')|))|$)`,"g"),Co=/'/g,No=/"/g,Do=/^(?:script|style|textarea|title)$/i,Mo=i=>(e,...t)=>({_$litType$:i,strings:e,values:t}),L=Mo(1),Zh=Mo(2),pi=Symbol.for("lit-noChange"),Ee=Symbol.for("lit-nothing"),Lo=new WeakMap,ui=di.createTreeWalker(di,129,null,!1);function Uo(i,e){if(!Array.isArray(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return Io!==void 0?Io.createHTML(e):e}var gu=(i,e)=>{let t=i.length-1,r=[],n,a=e===2?"<svg>":"",s=Lr;for(let o=0;o<t;o++){let c=i[o],l,u,m=-1,h=0;for(;h<c.length&&(s.lastIndex=h,u=s.exec(c),u!==null);)h=s.lastIndex,s===Lr?u[1]==="!--"?s=ko:u[1]!==void 0?s=To:u[2]!==void 0?(Do.test(u[2])&&(n=RegExp("</"+u[2],"g")),s=li):u[3]!==void 0&&(s=li):s===li?u[0]===">"?(s=n??Lr,m=-1):u[1]===void 0?m=-2:(m=s.lastIndex-u[2].length,l=u[1],s=u[3]===void 0?li:u[3]==='"'?No:Co):s===No||s===Co?s=li:s===ko||s===To?s=Lr:(s=li,n=void 0);let d=s===li&&i[o+1].startsWith("/>")?" ":"";a+=s===Lr?c+fu:m>=0?(r.push(l),c.slice(0,m)+is+c.slice(m)+Ft+d):c+Ft+(m===-2?(r.push(void 0),o):d)}return[Uo(i,a+(i[t]||"<?>")+(e===2?"</svg>":"")),r]},fi=class{constructor({strings:e,_$litType$:t},r){let n;this.parts=[];let a=0,s=0,o=e.length-1,c=this.parts,[l,u]=gu(e,t);if(this.el=fi.createElement(l,r),ui.currentNode=this.el.content,t===2){let m=this.el.content,h=m.firstChild;h.remove(),m.append(...h.childNodes)}for(;(n=ui.nextNode())!==null&&c.length<o;){if(n.nodeType===1){if(n.hasAttributes()){let m=[];for(let h of n.getAttributeNames())if(h.endsWith(is)||h.startsWith(Ft)){let d=u[s++];if(m.push(h),d!==void 0){let g=n.getAttribute(d.toLowerCase()+is).split(Ft),v=/([.?@])?(.*)/.exec(d);c.push({type:1,index:a,name:v[2],strings:g,ctor:v[1]==="."?ns:v[1]==="?"?as:v[1]==="@"?ss:er})}else c.push({type:6,index:a})}for(let h of m)n.removeAttribute(h)}if(Do.test(n.tagName)){let m=n.textContent.split(Ft),h=m.length-1;if(h>0){n.textContent=Yi?Yi.emptyScript:"";for(let d=0;d<h;d++)n.append(m[d],Pr()),ui.nextNode(),c.push({type:2,index:++a});n.append(m[h],Pr())}}}else if(n.nodeType===8)if(n.data===Ro)c.push({type:2,index:a});else{let m=-1;for(;(m=n.data.indexOf(Ft,m+1))!==-1;)c.push({type:7,index:a}),m+=Ft.length-1}a++}}static createElement(e,t){let r=di.createElement("template");return r.innerHTML=e,r}};function Xi(i,e,t=i,r){var n,a,s,o;if(e===pi)return e;let c=r!==void 0?(n=t._$Co)===null||n===void 0?void 0:n[r]:t._$Cl,l=Rr(e)?void 0:e._$litDirective$;return c?.constructor!==l&&((a=c?._$AO)===null||a===void 0||a.call(c,!1),l===void 0?c=void 0:(c=new l(i),c._$AT(i,t,r)),r!==void 0?((s=(o=t)._$Co)!==null&&s!==void 0?s:o._$Co=[])[r]=c:t._$Cl=c),c!==void 0&&(e=Xi(i,c._$AS(i,e.values),c,r)),e}var rs=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){var t;let{el:{content:r},parts:n}=this._$AD,a=((t=e?.creationScope)!==null&&t!==void 0?t:di).importNode(r,!0);ui.currentNode=a;let s=ui.nextNode(),o=0,c=0,l=n[0];for(;l!==void 0;){if(o===l.index){let u;l.type===2?u=new hi(s,s.nextSibling,this,e):l.type===1?u=new l.ctor(s,l.name,l.strings,this,e):l.type===6&&(u=new os(s,this,e)),this._$AV.push(u),l=n[++c]}o!==l?.index&&(s=ui.nextNode(),o++)}return ui.currentNode=di,a}v(e){let t=0;for(let r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(e,r,t),t+=r.strings.length-2):r._$AI(e[t])),t++}},hi=class{constructor(e,t,r,n){var a;this.type=2,this._$AH=Ee,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=r,this.options=n,this._$Cp=(a=n?.isConnected)===null||a===void 0||a}get _$AU(){var e,t;return(t=(e=this._$AM)===null||e===void 0?void 0:e._$AU)!==null&&t!==void 0?t:this._$Cp}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=Xi(this,e,t),Rr(e)?e===Ee||e==null||e===""?(this._$AH!==Ee&&this._$AR(),this._$AH=Ee):e!==this._$AH&&e!==pi&&this._(e):e._$litType$!==void 0?this.g(e):e.nodeType!==void 0?this.$(e):hu(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!==Ee&&Rr(this._$AH)?this._$AA.nextSibling.data=e:this.$(di.createTextNode(e)),this._$AH=e}g(e){var t;let{values:r,_$litType$:n}=e,a=typeof n=="number"?this._$AC(e):(n.el===void 0&&(n.el=fi.createElement(Uo(n.h,n.h[0]),this.options)),n);if(((t=this._$AH)===null||t===void 0?void 0:t._$AD)===a)this._$AH.v(r);else{let s=new rs(a,this),o=s.u(this.options);s.v(r),this.$(o),this._$AH=s}}_$AC(e){let t=Lo.get(e.strings);return t===void 0&&Lo.set(e.strings,t=new fi(e)),t}T(e){Oo(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,r,n=0;for(let a of e)n===t.length?t.push(r=new hi(this.k(Pr()),this.k(Pr()),this,this.options)):r=t[n],r._$AI(a),n++;n<t.length&&(this._$AR(r&&r._$AB.nextSibling,n),t.length=n)}_$AR(e=this._$AA.nextSibling,t){var r;for((r=this._$AP)===null||r===void 0||r.call(this,!1,!0,t);e&&e!==this._$AB;){let n=e.nextSibling;e.remove(),e=n}}setConnected(e){var t;this._$AM===void 0&&(this._$Cp=e,(t=this._$AP)===null||t===void 0||t.call(this,e))}},er=class{constructor(e,t,r,n,a){this.type=1,this._$AH=Ee,this._$AN=void 0,this.element=e,this.name=t,this._$AM=n,this.options=a,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=Ee}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(e,t=this,r,n){let a=this.strings,s=!1;if(a===void 0)e=Xi(this,e,t,0),s=!Rr(e)||e!==this._$AH&&e!==pi,s&&(this._$AH=e);else{let o=e,c,l;for(e=a[0],c=0;c<a.length-1;c++)l=Xi(this,o[r+c],t,c),l===pi&&(l=this._$AH[c]),s||(s=!Rr(l)||l!==this._$AH[c]),l===Ee?e=Ee:e!==Ee&&(e+=(l??"")+a[c+1]),this._$AH[c]=l}s&&!n&&this.j(e)}j(e){e===Ee?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},ns=class extends er{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===Ee?void 0:e}},mu=Yi?Yi.emptyScript:"",as=class extends er{constructor(){super(...arguments),this.type=4}j(e){e&&e!==Ee?this.element.setAttribute(this.name,mu):this.element.removeAttribute(this.name)}},ss=class extends er{constructor(e,t,r,n,a){super(e,t,r,n,a),this.type=5}_$AI(e,t=this){var r;if((e=(r=Xi(this,e,t,0))!==null&&r!==void 0?r:Ee)===pi)return;let n=this._$AH,a=e===Ee&&n!==Ee||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,s=e!==Ee&&(n===Ee||a);a&&this.element.removeEventListener(this.name,this,n),s&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var t,r;typeof this._$AH=="function"?this._$AH.call((r=(t=this.options)===null||t===void 0?void 0:t.host)!==null&&r!==void 0?r:this.element,e):this._$AH.handleEvent(e)}},os=class{constructor(e,t,r){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(e){Xi(this,e)}};var Po=Rn.litHtmlPolyfillSupport;Po?.(fi,hi),((es=Rn.litHtmlVersions)!==null&&es!==void 0?es:Rn.litHtmlVersions=[]).push("2.8.0");var Fo=(i,e,t)=>{var r,n;let a=(r=t?.renderBefore)!==null&&r!==void 0?r:e,s=a._$litPart$;if(s===void 0){let o=(n=t?.renderBefore)!==null&&n!==void 0?n:null;a._$litPart$=s=new hi(e.insertBefore(Pr(),o),o,void 0,t??{})}return s._$AI(i),s};var cs,ls;var Re=class extends Ct{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e,t;let r=super.createRenderRoot();return(e=(t=this.renderOptions).renderBefore)!==null&&e!==void 0||(t.renderBefore=r.firstChild),r}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Fo(t,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 pi}};Re.finalized=!0,Re._$litElement$=!0,(cs=globalThis.litElementHydrateSupport)===null||cs===void 0||cs.call(globalThis,{LitElement:Re});var jo=globalThis.litElementPolyfillSupport;jo?.({LitElement:Re});((ls=globalThis.litElementVersions)!==null&&ls!==void 0?ls:globalThis.litElementVersions=[]).push("3.3.3");var mt=i=>e=>typeof e=="function"?((t,r)=>(customElements.define(t,r),r))(i,e):((t,r)=>{let{kind:n,elements:a}=r;return{kind:n,elements:a,finisher(s){customElements.define(t,s)}}})(i,e);var yu=(i,e)=>e.kind==="method"&&e.descriptor&&!("value"in e.descriptor)?{...e,finisher(t){t.createProperty(e.key,i)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){typeof e.initializer=="function"&&(this[e.key]=e.initializer.call(this))},finisher(t){t.createProperty(e.key,i)}},vu=(i,e,t)=>{e.constructor.createProperty(t,i)};function de(i){return(e,t)=>t!==void 0?vu(i,e,t):yu(i,e)}function ce(i){return de({...i,state:!0})}var us,Eg=((us=window.HTMLSlotElement)===null||us===void 0?void 0:us.prototype.assignedElements)!=null?(i,e)=>i.assignedElements(e):(i,e)=>i.assignedNodes(e).filter(t=>t.nodeType===Node.ELEMENT_NODE);var bu=i=>{let e=new Set;do for(let t of Reflect.ownKeys(i))e.add([i,t]);while((i=Reflect.getPrototypeOf(i))&&i!==Object.prototype);return e};function ds(i,{include:e,exclude:t}={}){let r=n=>{let a=s=>typeof s=="string"?n===s:s.test(n);return e?e.some(a):t?!t.some(a):!0};for(let[n,a]of bu(i.constructor.prototype)){if(a==="constructor"||!r(a))continue;let s=Reflect.getOwnPropertyDescriptor(n,a);s&&typeof s.value=="function"&&(i[a]=i[a].bind(i))}return i}var Bo="0.11.2-dev";function Su(){try{localStorage.setItem("test",""),localStorage.removeItem("test")}catch(i){return!1}return!0}function On(i,e){Su()&&localStorage.setItem(`${Bo}/${i}`,e)}function Dn(i,e=1e4){return we(this,null,function*(){return Promise.race([new Promise((t,r)=>{let n;try{n=new WebSocket(i,"graphql-transport-ws"),n.onopen=()=>{n.close(),t(n)},n.onerror=a=>{r(a)},n.onclose=a=>{a.code!==1e3&&r(new Error(`WebSocket closed with code ${a.code}: ${a.reason}`))}}catch(a){n&&n.close(),r(a)}}),new Promise((t,r)=>{setTimeout(()=>{r(new Error("WebSocket connection timed out"))},e)})])})}function gi(){return L`
3
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),Co=/'/g,No=/"/g,Do=/^(?:script|style|textarea|title)$/i,Mo=i=>(e,...t)=>({_$litType$:i,strings:e,values:t}),L=Mo(1),Zh=Mo(2),pi=Symbol.for("lit-noChange"),Ee=Symbol.for("lit-nothing"),Lo=new WeakMap,ui=di.createTreeWalker(di,129,null,!1);function Uo(i,e){if(!Array.isArray(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return Io!==void 0?Io.createHTML(e):e}var gu=(i,e)=>{let t=i.length-1,r=[],n,a=e===2?"<svg>":"",s=Lr;for(let o=0;o<t;o++){let l=i[o],c,u,m=-1,h=0;for(;h<l.length&&(s.lastIndex=h,u=s.exec(l),u!==null);)h=s.lastIndex,s===Lr?u[1]==="!--"?s=ko:u[1]!==void 0?s=To:u[2]!==void 0?(Do.test(u[2])&&(n=RegExp("</"+u[2],"g")),s=li):u[3]!==void 0&&(s=li):s===li?u[0]===">"?(s=n??Lr,m=-1):u[1]===void 0?m=-2:(m=s.lastIndex-u[2].length,c=u[1],s=u[3]===void 0?li:u[3]==='"'?No:Co):s===No||s===Co?s=li:s===ko||s===To?s=Lr:(s=li,n=void 0);let d=s===li&&i[o+1].startsWith("/>")?" ":"";a+=s===Lr?l+fu:m>=0?(r.push(c),l.slice(0,m)+is+l.slice(m)+Ft+d):l+Ft+(m===-2?(r.push(void 0),o):d)}return[Uo(i,a+(i[t]||"<?>")+(e===2?"</svg>":"")),r]},fi=class{constructor({strings:e,_$litType$:t},r){let n;this.parts=[];let a=0,s=0,o=e.length-1,l=this.parts,[c,u]=gu(e,t);if(this.el=fi.createElement(c,r),ui.currentNode=this.el.content,t===2){let m=this.el.content,h=m.firstChild;h.remove(),m.append(...h.childNodes)}for(;(n=ui.nextNode())!==null&&l.length<o;){if(n.nodeType===1){if(n.hasAttributes()){let m=[];for(let h of n.getAttributeNames())if(h.endsWith(is)||h.startsWith(Ft)){let d=u[s++];if(m.push(h),d!==void 0){let g=n.getAttribute(d.toLowerCase()+is).split(Ft),v=/([.?@])?(.*)/.exec(d);l.push({type:1,index:a,name:v[2],strings:g,ctor:v[1]==="."?ns:v[1]==="?"?as:v[1]==="@"?ss:er})}else l.push({type:6,index:a})}for(let h of m)n.removeAttribute(h)}if(Do.test(n.tagName)){let m=n.textContent.split(Ft),h=m.length-1;if(h>0){n.textContent=Yi?Yi.emptyScript:"";for(let d=0;d<h;d++)n.append(m[d],Pr()),ui.nextNode(),l.push({type:2,index:++a});n.append(m[h],Pr())}}}else if(n.nodeType===8)if(n.data===Ro)l.push({type:2,index:a});else{let m=-1;for(;(m=n.data.indexOf(Ft,m+1))!==-1;)l.push({type:7,index:a}),m+=Ft.length-1}a++}}static createElement(e,t){let r=di.createElement("template");return r.innerHTML=e,r}};function Xi(i,e,t=i,r){var n,a,s,o;if(e===pi)return e;let l=r!==void 0?(n=t._$Co)===null||n===void 0?void 0:n[r]:t._$Cl,c=Rr(e)?void 0:e._$litDirective$;return l?.constructor!==c&&((a=l?._$AO)===null||a===void 0||a.call(l,!1),c===void 0?l=void 0:(l=new c(i),l._$AT(i,t,r)),r!==void 0?((s=(o=t)._$Co)!==null&&s!==void 0?s:o._$Co=[])[r]=l:t._$Cl=l),l!==void 0&&(e=Xi(i,l._$AS(i,e.values),l,r)),e}var rs=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){var t;let{el:{content:r},parts:n}=this._$AD,a=((t=e?.creationScope)!==null&&t!==void 0?t:di).importNode(r,!0);ui.currentNode=a;let s=ui.nextNode(),o=0,l=0,c=n[0];for(;c!==void 0;){if(o===c.index){let u;c.type===2?u=new hi(s,s.nextSibling,this,e):c.type===1?u=new c.ctor(s,c.name,c.strings,this,e):c.type===6&&(u=new os(s,this,e)),this._$AV.push(u),c=n[++l]}o!==c?.index&&(s=ui.nextNode(),o++)}return ui.currentNode=di,a}v(e){let t=0;for(let r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(e,r,t),t+=r.strings.length-2):r._$AI(e[t])),t++}},hi=class{constructor(e,t,r,n){var a;this.type=2,this._$AH=Ee,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=r,this.options=n,this._$Cp=(a=n?.isConnected)===null||a===void 0||a}get _$AU(){var e,t;return(t=(e=this._$AM)===null||e===void 0?void 0:e._$AU)!==null&&t!==void 0?t:this._$Cp}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=Xi(this,e,t),Rr(e)?e===Ee||e==null||e===""?(this._$AH!==Ee&&this._$AR(),this._$AH=Ee):e!==this._$AH&&e!==pi&&this._(e):e._$litType$!==void 0?this.g(e):e.nodeType!==void 0?this.$(e):hu(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!==Ee&&Rr(this._$AH)?this._$AA.nextSibling.data=e:this.$(di.createTextNode(e)),this._$AH=e}g(e){var t;let{values:r,_$litType$:n}=e,a=typeof n=="number"?this._$AC(e):(n.el===void 0&&(n.el=fi.createElement(Uo(n.h,n.h[0]),this.options)),n);if(((t=this._$AH)===null||t===void 0?void 0:t._$AD)===a)this._$AH.v(r);else{let s=new rs(a,this),o=s.u(this.options);s.v(r),this.$(o),this._$AH=s}}_$AC(e){let t=Lo.get(e.strings);return t===void 0&&Lo.set(e.strings,t=new fi(e)),t}T(e){Oo(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,r,n=0;for(let a of e)n===t.length?t.push(r=new hi(this.k(Pr()),this.k(Pr()),this,this.options)):r=t[n],r._$AI(a),n++;n<t.length&&(this._$AR(r&&r._$AB.nextSibling,n),t.length=n)}_$AR(e=this._$AA.nextSibling,t){var r;for((r=this._$AP)===null||r===void 0||r.call(this,!1,!0,t);e&&e!==this._$AB;){let n=e.nextSibling;e.remove(),e=n}}setConnected(e){var t;this._$AM===void 0&&(this._$Cp=e,(t=this._$AP)===null||t===void 0||t.call(this,e))}},er=class{constructor(e,t,r,n,a){this.type=1,this._$AH=Ee,this._$AN=void 0,this.element=e,this.name=t,this._$AM=n,this.options=a,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=Ee}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(e,t=this,r,n){let a=this.strings,s=!1;if(a===void 0)e=Xi(this,e,t,0),s=!Rr(e)||e!==this._$AH&&e!==pi,s&&(this._$AH=e);else{let o=e,l,c;for(e=a[0],l=0;l<a.length-1;l++)c=Xi(this,o[r+l],t,l),c===pi&&(c=this._$AH[l]),s||(s=!Rr(c)||c!==this._$AH[l]),c===Ee?e=Ee:e!==Ee&&(e+=(c??"")+a[l+1]),this._$AH[l]=c}s&&!n&&this.j(e)}j(e){e===Ee?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},ns=class extends er{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===Ee?void 0:e}},mu=Yi?Yi.emptyScript:"",as=class extends er{constructor(){super(...arguments),this.type=4}j(e){e&&e!==Ee?this.element.setAttribute(this.name,mu):this.element.removeAttribute(this.name)}},ss=class extends er{constructor(e,t,r,n,a){super(e,t,r,n,a),this.type=5}_$AI(e,t=this){var r;if((e=(r=Xi(this,e,t,0))!==null&&r!==void 0?r:Ee)===pi)return;let n=this._$AH,a=e===Ee&&n!==Ee||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,s=e!==Ee&&(n===Ee||a);a&&this.element.removeEventListener(this.name,this,n),s&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var t,r;typeof this._$AH=="function"?this._$AH.call((r=(t=this.options)===null||t===void 0?void 0:t.host)!==null&&r!==void 0?r:this.element,e):this._$AH.handleEvent(e)}},os=class{constructor(e,t,r){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(e){Xi(this,e)}};var Po=Rn.litHtmlPolyfillSupport;Po?.(fi,hi),((es=Rn.litHtmlVersions)!==null&&es!==void 0?es:Rn.litHtmlVersions=[]).push("2.8.0");var Fo=(i,e,t)=>{var r,n;let a=(r=t?.renderBefore)!==null&&r!==void 0?r:e,s=a._$litPart$;if(s===void 0){let o=(n=t?.renderBefore)!==null&&n!==void 0?n:null;a._$litPart$=s=new hi(e.insertBefore(Pr(),o),o,void 0,t??{})}return s._$AI(i),s};var cs,ls;var Re=class extends Ct{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e,t;let r=super.createRenderRoot();return(e=(t=this.renderOptions).renderBefore)!==null&&e!==void 0||(t.renderBefore=r.firstChild),r}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Fo(t,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 pi}};Re.finalized=!0,Re._$litElement$=!0,(cs=globalThis.litElementHydrateSupport)===null||cs===void 0||cs.call(globalThis,{LitElement:Re});var jo=globalThis.litElementPolyfillSupport;jo?.({LitElement:Re});((ls=globalThis.litElementVersions)!==null&&ls!==void 0?ls:globalThis.litElementVersions=[]).push("3.3.3");var mt=i=>e=>typeof e=="function"?((t,r)=>(customElements.define(t,r),r))(i,e):((t,r)=>{let{kind:n,elements:a}=r;return{kind:n,elements:a,finisher(s){customElements.define(t,s)}}})(i,e);var yu=(i,e)=>e.kind==="method"&&e.descriptor&&!("value"in e.descriptor)?{...e,finisher(t){t.createProperty(e.key,i)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){typeof e.initializer=="function"&&(this[e.key]=e.initializer.call(this))},finisher(t){t.createProperty(e.key,i)}},vu=(i,e,t)=>{e.constructor.createProperty(t,i)};function pe(i){return(e,t)=>t!==void 0?vu(i,e,t):yu(i,e)}function le(i){return pe({...i,state:!0})}var us,Eg=((us=window.HTMLSlotElement)===null||us===void 0?void 0:us.prototype.assignedElements)!=null?(i,e)=>i.assignedElements(e):(i,e)=>i.assignedNodes(e).filter(t=>t.nodeType===Node.ELEMENT_NODE);var bu=i=>{let e=new Set;do for(let t of Reflect.ownKeys(i))e.add([i,t]);while((i=Reflect.getPrototypeOf(i))&&i!==Object.prototype);return e};function ds(i,{include:e,exclude:t}={}){let r=n=>{let a=s=>typeof s=="string"?n===s:s.test(n);return e?e.some(a):t?!t.some(a):!0};for(let[n,a]of bu(i.constructor.prototype)){if(a==="constructor"||!r(a))continue;let s=Reflect.getOwnPropertyDescriptor(n,a);s&&typeof s.value=="function"&&(i[a]=i[a].bind(i))}return i}var Bo="0.12.0-rc1";function Su(){try{localStorage.setItem("test",""),localStorage.removeItem("test")}catch(i){return!1}return!0}function On(i,e){Su()&&localStorage.setItem(`${Bo}/${i}`,e)}function Dn(i,e=1e4){return we(this,null,function*(){return Promise.race([new Promise((t,r)=>{let n;try{n=new WebSocket(i,"graphql-transport-ws"),n.onopen=()=>{n.close(),t(n)},n.onerror=a=>{r(a)},n.onclose=a=>{a.code!==1e3&&r(new Error(`WebSocket closed with code ${a.code}: ${a.reason}`))}}catch(a){n&&n.close(),r(a)}}),new Promise((t,r)=>{setTimeout(()=>{r(new Error("WebSocket connection timed out"))},e)})])})}function gi(){return L`
4
4
  <svg viewBox="0 0 63.6 60" fill="none" xmlns="http://www.w3.org/2000/svg">
5
5
  <path fill="currentColor" 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" />
6
6
  </svg>
@@ -26,7 +26,7 @@ var cu=Object.defineProperty;var lu=Object.getOwnPropertyDescriptor;var uu=Objec
26
26
  <rect width="256" height="256" fill="none"/>
27
27
  <polyline points="40 144 96 200 224 72" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/>
28
28
  </svg>
29
- `}function Ue(){return L`
29
+ `}function Fe(){return L`
30
30
  <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="currentColor" viewBox="0 0 256 256">
31
31
  <path d="M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"></path>
32
32
  </svg>
@@ -331,7 +331,7 @@ var cu=Object.defineProperty;var lu=Object.getOwnPropertyDescriptor;var uu=Objec
331
331
  </button>
332
332
  `:L`
333
333
  <div class="state danger">
334
- ${Ue()}
334
+ ${Fe()}
335
335
  <p>No local node detected on port ${this.port}</p>
336
336
  </div>
337
337
 
@@ -382,7 +382,7 @@ var cu=Object.defineProperty;var lu=Object.getOwnPropertyDescriptor;var uu=Objec
382
382
 
383
383
  ${this.remoteNodeError?L`
384
384
  <div class="state danger">
385
- ${Ue()}
385
+ ${Fe()}
386
386
  <p>Unable to connect to remote node</p>
387
387
  </div>
388
388
  `:""}
@@ -427,17 +427,17 @@ var cu=Object.defineProperty;var lu=Object.getOwnPropertyDescriptor;var uu=Objec
427
427
  button {
428
428
  width: 100%;
429
429
  }
430
- `],j([de({type:Number})],ke.prototype,"port",2),j([de({type:String})],ke.prototype,"remoteUrl",2),j([de({type:Boolean})],ke.prototype,"connectingToRemoteNode",2),j([de({type:Boolean})],ke.prototype,"remoteNodeError",2),j([de({type:Boolean})],ke.prototype,"showMultiUserOption",2),j([ce()],ke.prototype,"loading",2),j([ce()],ke.prototype,"localNodeDetected",2),j([ce()],ke.prototype,"newPort",2),j([ce()],ke.prototype,"newRemoteUrl",2),j([ce()],ke.prototype,"isMobile",2),ke=j([mt("connection-options")],ke);var va=function(){return va=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},va.apply(this,arguments)};typeof SuppressedError=="function"&&SuppressedError;function Xn(i){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Xn=function(t){return typeof t}:Xn=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xn(i)}function wu(i){return Xn(i)=="object"&&i!==null}var sl=typeof Symbol=="function"&&Symbol.toStringTag!=null?Symbol.toStringTag:"@@toStringTag";function Ns(i,e){for(var t=/\r\n|[\n\r]/g,r=1,n=e+1,a;(a=t.exec(i.body))&&a.index<e;)r+=1,n=e+1-(a.index+a[0].length);return{line:r,column:n}}function Eu(i){return ol(i.source,Ns(i.source,i.start))}function ol(i,e){var t=i.locationOffset.column-1,r=ea(t)+i.body,n=e.line-1,a=i.locationOffset.line-1,s=e.line+a,o=e.line===1?t:0,c=e.column+o,l="".concat(i.name,":").concat(s,":").concat(c,`
431
- `),u=r.split(/\r\n|[\n\r]/g),m=u[n];if(m.length>120){for(var h=Math.floor(c/80),d=c%80,g=[],v=0;v<m.length;v+=80)g.push(m.slice(v,v+80));return l+qo([["".concat(s),g[0]]].concat(g.slice(1,h+1).map(function(E){return["",E]}),[[" ",ea(d-1)+"^"],["",g[h+1]]]))}return l+qo([["".concat(s-1),u[n-1]],["".concat(s),m],["",ea(c-1)+"^"],["".concat(s+1),u[n+1]]])}function qo(i){var e=i.filter(function(r){r[0];var n=r[1];return n!==void 0}),t=Math.max.apply(Math,e.map(function(r){var n=r[0];return n.length}));return e.map(function(r){var n=r[0],a=r[1];return xu(t,n)+(a?" | "+a:" |")}).join(`
432
- `)}function ea(i){return Array(i+1).join(" ")}function xu(i,e){return ea(i-e.length)+e}function ta(i){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ta=function(t){return typeof t}:ta=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ta(i)}function Vo(i,e){var t=Object.keys(i);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(i);e&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(i,n).enumerable})),t.push.apply(t,r)}return t}function Au(i){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Vo(Object(t),!0).forEach(function(r){$u(i,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(t)):Vo(Object(t)).forEach(function(r){Object.defineProperty(i,r,Object.getOwnPropertyDescriptor(t,r))})}return i}function $u(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function Iu(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function zo(i,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(i,r.key,r)}}function ku(i,e,t){return e&&zo(i.prototype,e),t&&zo(i,t),i}function Tu(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),e&&ln(i,e)}function Cu(i){var e=ll();return function(){var r=un(i),n;if(e){var a=un(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return cl(this,n)}}function cl(i,e){return e&&(ta(e)==="object"||typeof e=="function")?e:jr(i)}function jr(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}function Ls(i){var e=typeof Map=="function"?new Map:void 0;return Ls=function(r){if(r===null||!Nu(r))return r;if(typeof r!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(r))return e.get(r);e.set(r,n)}function n(){return ia(r,arguments,un(this).constructor)}return n.prototype=Object.create(r.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),ln(n,r)},Ls(i)}function ia(i,e,t){return ll()?ia=Reflect.construct:ia=function(n,a,s){var o=[null];o.push.apply(o,a);var c=Function.bind.apply(n,o),l=new c;return s&&ln(l,s.prototype),l},ia.apply(null,arguments)}function ll(){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 Nu(i){return Function.toString.call(i).indexOf("[native code]")!==-1}function ln(i,e){return ln=Object.setPrototypeOf||function(r,n){return r.__proto__=n,r},ln(i,e)}function un(i){return un=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},un(i)}var Lu=function(i){Tu(t,i);var e=Cu(t);function t(r,n,a,s,o,c,l){var u,m,h,d;Iu(this,t),d=e.call(this,r),d.name="GraphQLError",d.originalError=c??void 0,d.nodes=Ho(Array.isArray(n)?n:n?[n]:void 0);for(var g=[],v=0,E=($=d.nodes)!==null&&$!==void 0?$:[];v<E.length;v++){var $,N=E[v],O=N.loc;O!=null&&g.push(O)}g=Ho(g),d.source=a??((u=g)===null||u===void 0?void 0:u[0].source),d.positions=s??((m=g)===null||m===void 0?void 0:m.map(function(k){return k.start})),d.locations=s&&a?s.map(function(k){return Ns(a,k)}):(h=g)===null||h===void 0?void 0:h.map(function(k){return Ns(k.source,k.start)}),d.path=o??void 0;var A=c?.extensions;return l==null&&wu(A)?d.extensions=Au({},A):d.extensions=l??{},Object.defineProperties(jr(d),{message:{enumerable:!0},locations:{enumerable:d.locations!=null},path:{enumerable:d.path!=null},extensions:{enumerable:d.extensions!=null&&Object.keys(d.extensions).length>0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),c!=null&&c.stack?(Object.defineProperty(jr(d),"stack",{value:c.stack,writable:!0,configurable:!0}),cl(d)):(Error.captureStackTrace?Error.captureStackTrace(jr(d),t):Object.defineProperty(jr(d),"stack",{value:Error().stack,writable:!0,configurable:!0}),d)}return ku(t,[{key:"toString",value:function(){return Pu(this)}},{key:sl,get:function(){return"Object"}}]),t}(Ls(Error));function Ho(i){return i===void 0||i.length===0?void 0:i}function Pu(i){var e=i.message;if(i.nodes)for(var t=0,r=i.nodes;t<r.length;t++){var n=r[t];n.loc&&(e+=`
430
+ `],j([pe({type:Number})],ke.prototype,"port",2),j([pe({type:String})],ke.prototype,"remoteUrl",2),j([pe({type:Boolean})],ke.prototype,"connectingToRemoteNode",2),j([pe({type:Boolean})],ke.prototype,"remoteNodeError",2),j([pe({type:Boolean})],ke.prototype,"showMultiUserOption",2),j([le()],ke.prototype,"loading",2),j([le()],ke.prototype,"localNodeDetected",2),j([le()],ke.prototype,"newPort",2),j([le()],ke.prototype,"newRemoteUrl",2),j([le()],ke.prototype,"isMobile",2),ke=j([mt("connection-options")],ke);var va=function(){return va=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},va.apply(this,arguments)};typeof SuppressedError=="function"&&SuppressedError;function Xn(i){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Xn=function(t){return typeof t}:Xn=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xn(i)}function wu(i){return Xn(i)=="object"&&i!==null}var sl=typeof Symbol=="function"&&Symbol.toStringTag!=null?Symbol.toStringTag:"@@toStringTag";function Ns(i,e){for(var t=/\r\n|[\n\r]/g,r=1,n=e+1,a;(a=t.exec(i.body))&&a.index<e;)r+=1,n=e+1-(a.index+a[0].length);return{line:r,column:n}}function Eu(i){return ol(i.source,Ns(i.source,i.start))}function ol(i,e){var t=i.locationOffset.column-1,r=ea(t)+i.body,n=e.line-1,a=i.locationOffset.line-1,s=e.line+a,o=e.line===1?t:0,l=e.column+o,c="".concat(i.name,":").concat(s,":").concat(l,`
431
+ `),u=r.split(/\r\n|[\n\r]/g),m=u[n];if(m.length>120){for(var h=Math.floor(l/80),d=l%80,g=[],v=0;v<m.length;v+=80)g.push(m.slice(v,v+80));return c+qo([["".concat(s),g[0]]].concat(g.slice(1,h+1).map(function(E){return["",E]}),[[" ",ea(d-1)+"^"],["",g[h+1]]]))}return c+qo([["".concat(s-1),u[n-1]],["".concat(s),m],["",ea(l-1)+"^"],["".concat(s+1),u[n+1]]])}function qo(i){var e=i.filter(function(r){r[0];var n=r[1];return n!==void 0}),t=Math.max.apply(Math,e.map(function(r){var n=r[0];return n.length}));return e.map(function(r){var n=r[0],a=r[1];return xu(t,n)+(a?" | "+a:" |")}).join(`
432
+ `)}function ea(i){return Array(i+1).join(" ")}function xu(i,e){return ea(i-e.length)+e}function ta(i){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ta=function(t){return typeof t}:ta=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ta(i)}function Vo(i,e){var t=Object.keys(i);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(i);e&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(i,n).enumerable})),t.push.apply(t,r)}return t}function Au(i){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Vo(Object(t),!0).forEach(function(r){$u(i,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(t)):Vo(Object(t)).forEach(function(r){Object.defineProperty(i,r,Object.getOwnPropertyDescriptor(t,r))})}return i}function $u(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function Iu(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function zo(i,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(i,r.key,r)}}function ku(i,e,t){return e&&zo(i.prototype,e),t&&zo(i,t),i}function Tu(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),e&&ln(i,e)}function Cu(i){var e=ll();return function(){var r=un(i),n;if(e){var a=un(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return cl(this,n)}}function cl(i,e){return e&&(ta(e)==="object"||typeof e=="function")?e:jr(i)}function jr(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}function Ls(i){var e=typeof Map=="function"?new Map:void 0;return Ls=function(r){if(r===null||!Nu(r))return r;if(typeof r!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(r))return e.get(r);e.set(r,n)}function n(){return ia(r,arguments,un(this).constructor)}return n.prototype=Object.create(r.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),ln(n,r)},Ls(i)}function ia(i,e,t){return ll()?ia=Reflect.construct:ia=function(n,a,s){var o=[null];o.push.apply(o,a);var l=Function.bind.apply(n,o),c=new l;return s&&ln(c,s.prototype),c},ia.apply(null,arguments)}function ll(){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 Nu(i){return Function.toString.call(i).indexOf("[native code]")!==-1}function ln(i,e){return ln=Object.setPrototypeOf||function(r,n){return r.__proto__=n,r},ln(i,e)}function un(i){return un=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},un(i)}var Lu=function(i){Tu(t,i);var e=Cu(t);function t(r,n,a,s,o,l,c){var u,m,h,d;Iu(this,t),d=e.call(this,r),d.name="GraphQLError",d.originalError=l??void 0,d.nodes=Ho(Array.isArray(n)?n:n?[n]:void 0);for(var g=[],v=0,E=(A=d.nodes)!==null&&A!==void 0?A:[];v<E.length;v++){var A,C=E[v],O=C.loc;O!=null&&g.push(O)}g=Ho(g),d.source=a??((u=g)===null||u===void 0?void 0:u[0].source),d.positions=s??((m=g)===null||m===void 0?void 0:m.map(function(T){return T.start})),d.locations=s&&a?s.map(function(T){return Ns(a,T)}):(h=g)===null||h===void 0?void 0:h.map(function(T){return Ns(T.source,T.start)}),d.path=o??void 0;var $=l?.extensions;return c==null&&wu($)?d.extensions=Au({},$):d.extensions=c??{},Object.defineProperties(jr(d),{message:{enumerable:!0},locations:{enumerable:d.locations!=null},path:{enumerable:d.path!=null},extensions:{enumerable:d.extensions!=null&&Object.keys(d.extensions).length>0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),l!=null&&l.stack?(Object.defineProperty(jr(d),"stack",{value:l.stack,writable:!0,configurable:!0}),cl(d)):(Error.captureStackTrace?Error.captureStackTrace(jr(d),t):Object.defineProperty(jr(d),"stack",{value:Error().stack,writable:!0,configurable:!0}),d)}return ku(t,[{key:"toString",value:function(){return Pu(this)}},{key:sl,get:function(){return"Object"}}]),t}(Ls(Error));function Ho(i){return i===void 0||i.length===0?void 0:i}function Pu(i){var e=i.message;if(i.nodes)for(var t=0,r=i.nodes;t<r.length;t++){var n=r[t];n.loc&&(e+=`
433
433
 
434
434
  `+Eu(n.loc))}else if(i.source&&i.locations)for(var a=0,s=i.locations;a<s.length;a++){var o=s[a];e+=`
435
435
 
436
- `+ol(i.source,o)}return e}function Xe(i,e,t){return new Lu("Syntax Error: ".concat(t),void 0,i,[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 Ru(i,e){var t=Boolean(i);if(!t)throw new Error(e??"Unexpected invariant triggered.")}var Ou=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):void 0,Ps=Ou;function ul(i){var e=i.prototype.toJSON;typeof e=="function"||Ru(0),i.prototype.inspect=e,Ps&&(i.prototype[Ps]=e)}var dl=function(){function i(t,r,n){this.start=t.start,this.end=r.end,this.startToken=t,this.endToken=r,this.source=n}var e=i.prototype;return e.toJSON=function(){return{start:this.start,end:this.end}},i}();ul(dl);var he=function(){function i(t,r,n,a,s,o,c){this.kind=t,this.start=r,this.end=n,this.line=a,this.column=s,this.value=c,this.prev=o,this.next=null}var e=i.prototype;return e.toJSON=function(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}},i}();ul(he);var S=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 ra(i){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ra=function(t){return typeof t}:ra=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ra(i)}var Du=10,pl=2;function Mu(i){return Ba(i,[])}function Ba(i,e){switch(ra(i)){case"string":return JSON.stringify(i);case"function":return i.name?"[function ".concat(i.name,"]"):"[function]";case"object":return i===null?"null":Uu(i,e);default:return String(i)}}function Uu(i,e){if(e.indexOf(i)!==-1)return"[Circular]";var t=[].concat(e,[i]),r=Bu(i);if(r!==void 0){var n=r.call(i);if(n!==i)return typeof n=="string"?n:Ba(n,t)}else if(Array.isArray(i))return ju(i,t);return Fu(i,t)}function Fu(i,e){var t=Object.keys(i);if(t.length===0)return"{}";if(e.length>pl)return"["+qu(i)+"]";var r=t.map(function(n){var a=Ba(i[n],e);return n+": "+a});return"{ "+r.join(", ")+" }"}function ju(i,e){if(i.length===0)return"[]";if(e.length>pl)return"[Array]";for(var t=Math.min(Du,i.length),r=i.length-t,n=[],a=0;a<t;++a)n.push(Ba(i[a],e));return r===1?n.push("... 1 more item"):r>1&&n.push("... ".concat(r," more items")),"["+n.join(", ")+"]"}function Bu(i){var e=i[String(Ps)];if(typeof e=="function")return e;if(typeof i.inspect=="function")return i.inspect}function qu(i){var e=Object.prototype.toString.call(i).replace(/^\[object /,"").replace(/]$/,"");if(e==="Object"&&typeof i.constructor=="function"){var t=i.constructor.name;if(typeof t=="string"&&t!=="")return t}return e}function ps(i,e){var t=Boolean(i);if(!t)throw new Error(e)}var Vu=function(e,t){return e instanceof t};function Go(i,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(i,r.key,r)}}function zu(i,e,t){return e&&Go(i.prototype,e),t&&Go(i,t),i}var fl=function(){function i(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"GraphQL request",r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{line:1,column:1};typeof e=="string"||ps(0,"Body must be a string. Received: ".concat(Mu(e),".")),this.body=e,this.name=t,this.locationOffset=r,this.locationOffset.line>0||ps(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||ps(0,"column in locationOffset is 1-indexed and must be positive.")}return zu(i,[{key:sl,get:function(){return"Source"}}]),i}();function Hu(i){return Vu(i,fl)}var Gu=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 Ku(i){var e=i.split(/\r\n|[\n\r]/g),t=Qu(i);if(t!==0)for(var r=1;r<e.length;r++)e[r]=e[r].slice(t);for(var n=0;n<e.length&&Ko(e[n]);)++n;for(var a=e.length;a>n&&Ko(e[a-1]);)--a;return e.slice(n,a).join(`
437
- `)}function Ko(i){for(var e=0;e<i.length;++e)if(i[e]!==" "&&i[e]!==" ")return!1;return!0}function Qu(i){for(var e,t=!0,r=!0,n=0,a=null,s=0;s<i.length;++s)switch(i.charCodeAt(s)){case 13:i.charCodeAt(s+1)===10&&++s;case 10:t=!1,r=!0,n=0;break;case 9:case 32:++n;break;default:r&&!t&&(a===null||n<a)&&(a=n),r=!1}return(e=a)!==null&&e!==void 0?e:0}var Wu=function(){function i(t){var r=new he(S.SOF,0,0,0,0,null);this.source=t,this.lastToken=r,this.token=r,this.line=1,this.lineStart=0}var e=i.prototype;return e.advance=function(){this.lastToken=this.token;var r=this.token=this.lookahead();return r},e.lookahead=function(){var r=this.token;if(r.kind!==S.EOF)do{var n;r=(n=r.next)!==null&&n!==void 0?n:r.next=Ju(this,r)}while(r.kind===S.COMMENT);return r},i}();function Zu(i){return i===S.BANG||i===S.DOLLAR||i===S.AMP||i===S.PAREN_L||i===S.PAREN_R||i===S.SPREAD||i===S.COLON||i===S.EQUALS||i===S.AT||i===S.BRACKET_L||i===S.BRACKET_R||i===S.BRACE_L||i===S.PIPE||i===S.BRACE_R}function Li(i){return isNaN(i)?S.EOF:i<127?JSON.stringify(String.fromCharCode(i)):'"\\u'.concat(("00"+i.toString(16).toUpperCase()).slice(-4),'"')}function Ju(i,e){for(var t=i.source,r=t.body,n=r.length,a=e.end;a<n;){var s=r.charCodeAt(a),o=i.line,c=1+a-i.lineStart;switch(s){case 65279:case 9:case 32:case 44:++a;continue;case 10:++a,++i.line,i.lineStart=a;continue;case 13:r.charCodeAt(a+1)===10?a+=2:++a,++i.line,i.lineStart=a;continue;case 33:return new he(S.BANG,a,a+1,o,c,e);case 35:return Xu(t,a,o,c,e);case 36:return new he(S.DOLLAR,a,a+1,o,c,e);case 38:return new he(S.AMP,a,a+1,o,c,e);case 40:return new he(S.PAREN_L,a,a+1,o,c,e);case 41:return new he(S.PAREN_R,a,a+1,o,c,e);case 46:if(r.charCodeAt(a+1)===46&&r.charCodeAt(a+2)===46)return new he(S.SPREAD,a,a+3,o,c,e);break;case 58:return new he(S.COLON,a,a+1,o,c,e);case 61:return new he(S.EQUALS,a,a+1,o,c,e);case 64:return new he(S.AT,a,a+1,o,c,e);case 91:return new he(S.BRACKET_L,a,a+1,o,c,e);case 93:return new he(S.BRACKET_R,a,a+1,o,c,e);case 123:return new he(S.BRACE_L,a,a+1,o,c,e);case 124:return new he(S.PIPE,a,a+1,o,c,e);case 125:return new he(S.BRACE_R,a,a+1,o,c,e);case 34:return r.charCodeAt(a+1)===34&&r.charCodeAt(a+2)===34?id(t,a,o,c,e,i):td(t,a,o,c,e);case 45:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return ed(t,a,s,o,c,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 nd(t,a,o,c,e)}throw Xe(t,a,Yu(s))}var l=i.line,u=1+a-i.lineStart;return new he(S.EOF,n,n,l,u,e)}function Yu(i){return i<32&&i!==9&&i!==10&&i!==13?"Cannot contain the invalid character ".concat(Li(i),"."):i===39?`Unexpected single quote character ('), did you mean to use a double quote (")?`:"Cannot parse the unexpected character ".concat(Li(i),".")}function Xu(i,e,t,r,n){var a=i.body,s,o=e;do s=a.charCodeAt(++o);while(!isNaN(s)&&(s>31||s===9));return new he(S.COMMENT,e,o,t,r,n,a.slice(e+1,o))}function ed(i,e,t,r,n,a){var s=i.body,o=t,c=e,l=!1;if(o===45&&(o=s.charCodeAt(++c)),o===48){if(o=s.charCodeAt(++c),o>=48&&o<=57)throw Xe(i,c,"Invalid number, unexpected digit after 0: ".concat(Li(o),"."))}else c=fs(i,c,o),o=s.charCodeAt(c);if(o===46&&(l=!0,o=s.charCodeAt(++c),c=fs(i,c,o),o=s.charCodeAt(c)),(o===69||o===101)&&(l=!0,o=s.charCodeAt(++c),(o===43||o===45)&&(o=s.charCodeAt(++c)),c=fs(i,c,o),o=s.charCodeAt(c)),o===46||ad(o))throw Xe(i,c,"Invalid number, expected digit but got: ".concat(Li(o),"."));return new he(l?S.FLOAT:S.INT,e,c,r,n,a,s.slice(e,c))}function fs(i,e,t){var r=i.body,n=e,a=t;if(a>=48&&a<=57){do a=r.charCodeAt(++n);while(a>=48&&a<=57);return n}throw Xe(i,n,"Invalid number, expected digit but got: ".concat(Li(a),"."))}function td(i,e,t,r,n){for(var a=i.body,s=e+1,o=s,c=0,l="";s<a.length&&!isNaN(c=a.charCodeAt(s))&&c!==10&&c!==13;){if(c===34)return l+=a.slice(o,s),new he(S.STRING,e,s+1,t,r,n,l);if(c<32&&c!==9)throw Xe(i,s,"Invalid character within String: ".concat(Li(c),"."));if(++s,c===92){switch(l+=a.slice(o,s-1),c=a.charCodeAt(s),c){case 34:l+='"';break;case 47:l+="/";break;case 92:l+="\\";break;case 98:l+="\b";break;case 102:l+="\f";break;case 110:l+=`
438
- `;break;case 114:l+="\r";break;case 116:l+=" ";break;case 117:{var u=rd(a.charCodeAt(s+1),a.charCodeAt(s+2),a.charCodeAt(s+3),a.charCodeAt(s+4));if(u<0){var m=a.slice(s+1,s+5);throw Xe(i,s,"Invalid character escape sequence: \\u".concat(m,"."))}l+=String.fromCharCode(u),s+=4;break}default:throw Xe(i,s,"Invalid character escape sequence: \\".concat(String.fromCharCode(c),"."))}++s,o=s}}throw Xe(i,s,"Unterminated string.")}function id(i,e,t,r,n,a){for(var s=i.body,o=e+3,c=o,l=0,u="";o<s.length&&!isNaN(l=s.charCodeAt(o));){if(l===34&&s.charCodeAt(o+1)===34&&s.charCodeAt(o+2)===34)return u+=s.slice(c,o),new he(S.BLOCK_STRING,e,o+3,t,r,n,Ku(u));if(l<32&&l!==9&&l!==10&&l!==13)throw Xe(i,o,"Invalid character within String: ".concat(Li(l),"."));l===10?(++o,++a.line,a.lineStart=o):l===13?(s.charCodeAt(o+1)===10?o+=2:++o,++a.line,a.lineStart=o):l===92&&s.charCodeAt(o+1)===34&&s.charCodeAt(o+2)===34&&s.charCodeAt(o+3)===34?(u+=s.slice(c,o)+'"""',o+=4,c=o):++o}throw Xe(i,o,"Unterminated string.")}function rd(i,e,t,r){return jn(i)<<12|jn(e)<<8|jn(t)<<4|jn(r)}function jn(i){return i>=48&&i<=57?i-48:i>=65&&i<=70?i-55:i>=97&&i<=102?i-87:-1}function nd(i,e,t,r,n){for(var a=i.body,s=a.length,o=e+1,c=0;o!==s&&!isNaN(c=a.charCodeAt(o))&&(c===95||c>=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122);)++o;return new he(S.NAME,e,o,t,r,n,a.slice(e,o))}function ad(i){return i===95||i>=65&&i<=90||i>=97&&i<=122}function sd(i,e){var t=new od(i,e);return t.parseDocument()}var od=function(){function i(t,r){var n=Hu(t)?t:new fl(t);this._lexer=new Wu(n),this._options=r}var e=i.prototype;return e.parseName=function(){var r=this.expectToken(S.NAME);return{kind:B.NAME,value:r.value,loc:this.loc(r)}},e.parseDocument=function(){var r=this._lexer.token;return{kind:B.DOCUMENT,definitions:this.many(S.SOF,this.parseDefinition,S.EOF),loc:this.loc(r)}},e.parseDefinition=function(){if(this.peek(S.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(S.BRACE_L))return this.parseOperationDefinition();if(this.peekDescription())return this.parseTypeSystemDefinition()}throw this.unexpected()},e.parseOperationDefinition=function(){var r=this._lexer.token;if(this.peek(S.BRACE_L))return{kind:B.OPERATION_DEFINITION,operation:"query",name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet(),loc:this.loc(r)};var n=this.parseOperationType(),a;return this.peek(S.NAME)&&(a=this.parseName()),{kind:B.OPERATION_DEFINITION,operation:n,name:a,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(r)}},e.parseOperationType=function(){var r=this.expectToken(S.NAME);switch(r.value){case"query":return"query";case"mutation":return"mutation";case"subscription":return"subscription"}throw this.unexpected(r)},e.parseVariableDefinitions=function(){return this.optionalMany(S.PAREN_L,this.parseVariableDefinition,S.PAREN_R)},e.parseVariableDefinition=function(){var r=this._lexer.token;return{kind:B.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(S.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(S.EQUALS)?this.parseValueLiteral(!0):void 0,directives:this.parseDirectives(!0),loc:this.loc(r)}},e.parseVariable=function(){var r=this._lexer.token;return this.expectToken(S.DOLLAR),{kind:B.VARIABLE,name:this.parseName(),loc:this.loc(r)}},e.parseSelectionSet=function(){var r=this._lexer.token;return{kind:B.SELECTION_SET,selections:this.many(S.BRACE_L,this.parseSelection,S.BRACE_R),loc:this.loc(r)}},e.parseSelection=function(){return this.peek(S.SPREAD)?this.parseFragment():this.parseField()},e.parseField=function(){var r=this._lexer.token,n=this.parseName(),a,s;return this.expectOptionalToken(S.COLON)?(a=n,s=this.parseName()):s=n,{kind:B.FIELD,alias:a,name:s,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(S.BRACE_L)?this.parseSelectionSet():void 0,loc:this.loc(r)}},e.parseArguments=function(r){var n=r?this.parseConstArgument:this.parseArgument;return this.optionalMany(S.PAREN_L,n,S.PAREN_R)},e.parseArgument=function(){var r=this._lexer.token,n=this.parseName();return this.expectToken(S.COLON),{kind:B.ARGUMENT,name:n,value:this.parseValueLiteral(!1),loc:this.loc(r)}},e.parseConstArgument=function(){var r=this._lexer.token;return{kind:B.ARGUMENT,name:this.parseName(),value:(this.expectToken(S.COLON),this.parseValueLiteral(!0)),loc:this.loc(r)}},e.parseFragment=function(){var r=this._lexer.token;this.expectToken(S.SPREAD);var n=this.expectOptionalKeyword("on");return!n&&this.peek(S.NAME)?{kind:B.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1),loc:this.loc(r)}:{kind:B.INLINE_FRAGMENT,typeCondition:n?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(r)}},e.parseFragmentDefinition=function(){var r,n=this._lexer.token;return this.expectKeyword("fragment"),((r=this._options)===null||r===void 0?void 0:r.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(n)}:{kind:B.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(n)}},e.parseFragmentName=function(){if(this._lexer.token.value==="on")throw this.unexpected();return this.parseName()},e.parseValueLiteral=function(r){var n=this._lexer.token;switch(n.kind){case S.BRACKET_L:return this.parseList(r);case S.BRACE_L:return this.parseObject(r);case S.INT:return this._lexer.advance(),{kind:B.INT,value:n.value,loc:this.loc(n)};case S.FLOAT:return this._lexer.advance(),{kind:B.FLOAT,value:n.value,loc:this.loc(n)};case S.STRING:case S.BLOCK_STRING:return this.parseStringLiteral();case S.NAME:switch(this._lexer.advance(),n.value){case"true":return{kind:B.BOOLEAN,value:!0,loc:this.loc(n)};case"false":return{kind:B.BOOLEAN,value:!1,loc:this.loc(n)};case"null":return{kind:B.NULL,loc:this.loc(n)};default:return{kind:B.ENUM,value:n.value,loc:this.loc(n)}}case S.DOLLAR:if(!r)return this.parseVariable();break}throw this.unexpected()},e.parseStringLiteral=function(){var r=this._lexer.token;return this._lexer.advance(),{kind:B.STRING,value:r.value,block:r.kind===S.BLOCK_STRING,loc:this.loc(r)}},e.parseList=function(r){var n=this,a=this._lexer.token,s=function(){return n.parseValueLiteral(r)};return{kind:B.LIST,values:this.any(S.BRACKET_L,s,S.BRACKET_R),loc:this.loc(a)}},e.parseObject=function(r){var n=this,a=this._lexer.token,s=function(){return n.parseObjectField(r)};return{kind:B.OBJECT,fields:this.any(S.BRACE_L,s,S.BRACE_R),loc:this.loc(a)}},e.parseObjectField=function(r){var n=this._lexer.token,a=this.parseName();return this.expectToken(S.COLON),{kind:B.OBJECT_FIELD,name:a,value:this.parseValueLiteral(r),loc:this.loc(n)}},e.parseDirectives=function(r){for(var n=[];this.peek(S.AT);)n.push(this.parseDirective(r));return n},e.parseDirective=function(r){var n=this._lexer.token;return this.expectToken(S.AT),{kind:B.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(r),loc:this.loc(n)}},e.parseTypeReference=function(){var r=this._lexer.token,n;return this.expectOptionalToken(S.BRACKET_L)?(n=this.parseTypeReference(),this.expectToken(S.BRACKET_R),n={kind:B.LIST_TYPE,type:n,loc:this.loc(r)}):n=this.parseNamedType(),this.expectOptionalToken(S.BANG)?{kind:B.NON_NULL_TYPE,type:n,loc:this.loc(r)}:n},e.parseNamedType=function(){var r=this._lexer.token;return{kind:B.NAMED_TYPE,name:this.parseName(),loc:this.loc(r)}},e.parseTypeSystemDefinition=function(){var r=this.peekDescription()?this._lexer.lookahead():this._lexer.token;if(r.kind===S.NAME)switch(r.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(r)},e.peekDescription=function(){return this.peek(S.STRING)||this.peek(S.BLOCK_STRING)},e.parseDescription=function(){if(this.peekDescription())return this.parseStringLiteral()},e.parseSchemaDefinition=function(){var r=this._lexer.token,n=this.parseDescription();this.expectKeyword("schema");var a=this.parseDirectives(!0),s=this.many(S.BRACE_L,this.parseOperationTypeDefinition,S.BRACE_R);return{kind:B.SCHEMA_DEFINITION,description:n,directives:a,operationTypes:s,loc:this.loc(r)}},e.parseOperationTypeDefinition=function(){var r=this._lexer.token,n=this.parseOperationType();this.expectToken(S.COLON);var a=this.parseNamedType();return{kind:B.OPERATION_TYPE_DEFINITION,operation:n,type:a,loc:this.loc(r)}},e.parseScalarTypeDefinition=function(){var r=this._lexer.token,n=this.parseDescription();this.expectKeyword("scalar");var a=this.parseName(),s=this.parseDirectives(!0);return{kind:B.SCALAR_TYPE_DEFINITION,description:n,name:a,directives:s,loc:this.loc(r)}},e.parseObjectTypeDefinition=function(){var r=this._lexer.token,n=this.parseDescription();this.expectKeyword("type");var a=this.parseName(),s=this.parseImplementsInterfaces(),o=this.parseDirectives(!0),c=this.parseFieldsDefinition();return{kind:B.OBJECT_TYPE_DEFINITION,description:n,name:a,interfaces:s,directives:o,fields:c,loc:this.loc(r)}},e.parseImplementsInterfaces=function(){var r;if(!this.expectOptionalKeyword("implements"))return[];if(((r=this._options)===null||r===void 0?void 0:r.allowLegacySDLImplementsInterfaces)===!0){var n=[];this.expectOptionalToken(S.AMP);do n.push(this.parseNamedType());while(this.expectOptionalToken(S.AMP)||this.peek(S.NAME));return n}return this.delimitedMany(S.AMP,this.parseNamedType)},e.parseFieldsDefinition=function(){var r;return((r=this._options)===null||r===void 0?void 0:r.allowLegacySDLEmptyFields)===!0&&this.peek(S.BRACE_L)&&this._lexer.lookahead().kind===S.BRACE_R?(this._lexer.advance(),this._lexer.advance(),[]):this.optionalMany(S.BRACE_L,this.parseFieldDefinition,S.BRACE_R)},e.parseFieldDefinition=function(){var r=this._lexer.token,n=this.parseDescription(),a=this.parseName(),s=this.parseArgumentDefs();this.expectToken(S.COLON);var o=this.parseTypeReference(),c=this.parseDirectives(!0);return{kind:B.FIELD_DEFINITION,description:n,name:a,arguments:s,type:o,directives:c,loc:this.loc(r)}},e.parseArgumentDefs=function(){return this.optionalMany(S.PAREN_L,this.parseInputValueDef,S.PAREN_R)},e.parseInputValueDef=function(){var r=this._lexer.token,n=this.parseDescription(),a=this.parseName();this.expectToken(S.COLON);var s=this.parseTypeReference(),o;this.expectOptionalToken(S.EQUALS)&&(o=this.parseValueLiteral(!0));var c=this.parseDirectives(!0);return{kind:B.INPUT_VALUE_DEFINITION,description:n,name:a,type:s,defaultValue:o,directives:c,loc:this.loc(r)}},e.parseInterfaceTypeDefinition=function(){var r=this._lexer.token,n=this.parseDescription();this.expectKeyword("interface");var a=this.parseName(),s=this.parseImplementsInterfaces(),o=this.parseDirectives(!0),c=this.parseFieldsDefinition();return{kind:B.INTERFACE_TYPE_DEFINITION,description:n,name:a,interfaces:s,directives:o,fields:c,loc:this.loc(r)}},e.parseUnionTypeDefinition=function(){var r=this._lexer.token,n=this.parseDescription();this.expectKeyword("union");var a=this.parseName(),s=this.parseDirectives(!0),o=this.parseUnionMemberTypes();return{kind:B.UNION_TYPE_DEFINITION,description:n,name:a,directives:s,types:o,loc:this.loc(r)}},e.parseUnionMemberTypes=function(){return this.expectOptionalToken(S.EQUALS)?this.delimitedMany(S.PIPE,this.parseNamedType):[]},e.parseEnumTypeDefinition=function(){var r=this._lexer.token,n=this.parseDescription();this.expectKeyword("enum");var a=this.parseName(),s=this.parseDirectives(!0),o=this.parseEnumValuesDefinition();return{kind:B.ENUM_TYPE_DEFINITION,description:n,name:a,directives:s,values:o,loc:this.loc(r)}},e.parseEnumValuesDefinition=function(){return this.optionalMany(S.BRACE_L,this.parseEnumValueDefinition,S.BRACE_R)},e.parseEnumValueDefinition=function(){var r=this._lexer.token,n=this.parseDescription(),a=this.parseName(),s=this.parseDirectives(!0);return{kind:B.ENUM_VALUE_DEFINITION,description:n,name:a,directives:s,loc:this.loc(r)}},e.parseInputObjectTypeDefinition=function(){var r=this._lexer.token,n=this.parseDescription();this.expectKeyword("input");var a=this.parseName(),s=this.parseDirectives(!0),o=this.parseInputFieldsDefinition();return{kind:B.INPUT_OBJECT_TYPE_DEFINITION,description:n,name:a,directives:s,fields:o,loc:this.loc(r)}},e.parseInputFieldsDefinition=function(){return this.optionalMany(S.BRACE_L,this.parseInputValueDef,S.BRACE_R)},e.parseTypeSystemExtension=function(){var r=this._lexer.lookahead();if(r.kind===S.NAME)switch(r.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(r)},e.parseSchemaExtension=function(){var r=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");var n=this.parseDirectives(!0),a=this.optionalMany(S.BRACE_L,this.parseOperationTypeDefinition,S.BRACE_R);if(n.length===0&&a.length===0)throw this.unexpected();return{kind:B.SCHEMA_EXTENSION,directives:n,operationTypes:a,loc:this.loc(r)}},e.parseScalarTypeExtension=function(){var r=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");var n=this.parseName(),a=this.parseDirectives(!0);if(a.length===0)throw this.unexpected();return{kind:B.SCALAR_TYPE_EXTENSION,name:n,directives:a,loc:this.loc(r)}},e.parseObjectTypeExtension=function(){var r=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");var n=this.parseName(),a=this.parseImplementsInterfaces(),s=this.parseDirectives(!0),o=this.parseFieldsDefinition();if(a.length===0&&s.length===0&&o.length===0)throw this.unexpected();return{kind:B.OBJECT_TYPE_EXTENSION,name:n,interfaces:a,directives:s,fields:o,loc:this.loc(r)}},e.parseInterfaceTypeExtension=function(){var r=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");var n=this.parseName(),a=this.parseImplementsInterfaces(),s=this.parseDirectives(!0),o=this.parseFieldsDefinition();if(a.length===0&&s.length===0&&o.length===0)throw this.unexpected();return{kind:B.INTERFACE_TYPE_EXTENSION,name:n,interfaces:a,directives:s,fields:o,loc:this.loc(r)}},e.parseUnionTypeExtension=function(){var r=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");var n=this.parseName(),a=this.parseDirectives(!0),s=this.parseUnionMemberTypes();if(a.length===0&&s.length===0)throw this.unexpected();return{kind:B.UNION_TYPE_EXTENSION,name:n,directives:a,types:s,loc:this.loc(r)}},e.parseEnumTypeExtension=function(){var r=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");var n=this.parseName(),a=this.parseDirectives(!0),s=this.parseEnumValuesDefinition();if(a.length===0&&s.length===0)throw this.unexpected();return{kind:B.ENUM_TYPE_EXTENSION,name:n,directives:a,values:s,loc:this.loc(r)}},e.parseInputObjectTypeExtension=function(){var r=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");var n=this.parseName(),a=this.parseDirectives(!0),s=this.parseInputFieldsDefinition();if(a.length===0&&s.length===0)throw this.unexpected();return{kind:B.INPUT_OBJECT_TYPE_EXTENSION,name:n,directives:a,fields:s,loc:this.loc(r)}},e.parseDirectiveDefinition=function(){var r=this._lexer.token,n=this.parseDescription();this.expectKeyword("directive"),this.expectToken(S.AT);var a=this.parseName(),s=this.parseArgumentDefs(),o=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");var c=this.parseDirectiveLocations();return{kind:B.DIRECTIVE_DEFINITION,description:n,name:a,arguments:s,repeatable:o,locations:c,loc:this.loc(r)}},e.parseDirectiveLocations=function(){return this.delimitedMany(S.PIPE,this.parseDirectiveLocation)},e.parseDirectiveLocation=function(){var r=this._lexer.token,n=this.parseName();if(Gu[n.value]!==void 0)return n;throw this.unexpected(r)},e.loc=function(r){var n;if(((n=this._options)===null||n===void 0?void 0:n.noLocation)!==!0)return new dl(r,this._lexer.lastToken,this._lexer.source)},e.peek=function(r){return this._lexer.token.kind===r},e.expectToken=function(r){var n=this._lexer.token;if(n.kind===r)return this._lexer.advance(),n;throw Xe(this._lexer.source,n.start,"Expected ".concat(hl(r),", found ").concat(hs(n),"."))},e.expectOptionalToken=function(r){var n=this._lexer.token;if(n.kind===r)return this._lexer.advance(),n},e.expectKeyword=function(r){var n=this._lexer.token;if(n.kind===S.NAME&&n.value===r)this._lexer.advance();else throw Xe(this._lexer.source,n.start,'Expected "'.concat(r,'", found ').concat(hs(n),"."))},e.expectOptionalKeyword=function(r){var n=this._lexer.token;return n.kind===S.NAME&&n.value===r?(this._lexer.advance(),!0):!1},e.unexpected=function(r){var n=r??this._lexer.token;return Xe(this._lexer.source,n.start,"Unexpected ".concat(hs(n),"."))},e.any=function(r,n,a){this.expectToken(r);for(var s=[];!this.expectOptionalToken(a);)s.push(n.call(this));return s},e.optionalMany=function(r,n,a){if(this.expectOptionalToken(r)){var s=[];do s.push(n.call(this));while(!this.expectOptionalToken(a));return s}return[]},e.many=function(r,n,a){this.expectToken(r);var s=[];do s.push(n.call(this));while(!this.expectOptionalToken(a));return s},e.delimitedMany=function(r,n){this.expectOptionalToken(r);var a=[];do a.push(n.call(this));while(this.expectOptionalToken(r));return a},i}();function hs(i){var e=i.value;return hl(i.kind)+(e!=null?' "'.concat(e,'"'):"")}function hl(i){return Zu(i)?'"'.concat(i,'"'):i}var na=new Map,Rs=new Map,gl=!0,ba=!1;function ml(i){return i.replace(/[\s,]+/g," ").trim()}function cd(i){return ml(i.source.body.substring(i.start,i.end))}function ld(i){var e=new Set,t=[];return i.definitions.forEach(function(r){if(r.kind==="FragmentDefinition"){var n=r.name.value,a=cd(r.loc),s=Rs.get(n);s&&!s.has(a)?gl&&console.warn("Warning: fragment with name "+n+` already exists.
436
+ `+ol(i.source,o)}return e}function Xe(i,e,t){return new Lu("Syntax Error: ".concat(t),void 0,i,[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 Ru(i,e){var t=Boolean(i);if(!t)throw new Error(e??"Unexpected invariant triggered.")}var Ou=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):void 0,Ps=Ou;function ul(i){var e=i.prototype.toJSON;typeof e=="function"||Ru(0),i.prototype.inspect=e,Ps&&(i.prototype[Ps]=e)}var dl=function(){function i(t,r,n){this.start=t.start,this.end=r.end,this.startToken=t,this.endToken=r,this.source=n}var e=i.prototype;return e.toJSON=function(){return{start:this.start,end:this.end}},i}();ul(dl);var ge=function(){function i(t,r,n,a,s,o,l){this.kind=t,this.start=r,this.end=n,this.line=a,this.column=s,this.value=l,this.prev=o,this.next=null}var e=i.prototype;return e.toJSON=function(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}},i}();ul(ge);var S=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 ra(i){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ra=function(t){return typeof t}:ra=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ra(i)}var Du=10,pl=2;function Mu(i){return Ba(i,[])}function Ba(i,e){switch(ra(i)){case"string":return JSON.stringify(i);case"function":return i.name?"[function ".concat(i.name,"]"):"[function]";case"object":return i===null?"null":Uu(i,e);default:return String(i)}}function Uu(i,e){if(e.indexOf(i)!==-1)return"[Circular]";var t=[].concat(e,[i]),r=Bu(i);if(r!==void 0){var n=r.call(i);if(n!==i)return typeof n=="string"?n:Ba(n,t)}else if(Array.isArray(i))return ju(i,t);return Fu(i,t)}function Fu(i,e){var t=Object.keys(i);if(t.length===0)return"{}";if(e.length>pl)return"["+qu(i)+"]";var r=t.map(function(n){var a=Ba(i[n],e);return n+": "+a});return"{ "+r.join(", ")+" }"}function ju(i,e){if(i.length===0)return"[]";if(e.length>pl)return"[Array]";for(var t=Math.min(Du,i.length),r=i.length-t,n=[],a=0;a<t;++a)n.push(Ba(i[a],e));return r===1?n.push("... 1 more item"):r>1&&n.push("... ".concat(r," more items")),"["+n.join(", ")+"]"}function Bu(i){var e=i[String(Ps)];if(typeof e=="function")return e;if(typeof i.inspect=="function")return i.inspect}function qu(i){var e=Object.prototype.toString.call(i).replace(/^\[object /,"").replace(/]$/,"");if(e==="Object"&&typeof i.constructor=="function"){var t=i.constructor.name;if(typeof t=="string"&&t!=="")return t}return e}function ps(i,e){var t=Boolean(i);if(!t)throw new Error(e)}var Vu=function(e,t){return e instanceof t};function Ko(i,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(i,r.key,r)}}function zu(i,e,t){return e&&Ko(i.prototype,e),t&&Ko(i,t),i}var fl=function(){function i(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"GraphQL request",r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{line:1,column:1};typeof e=="string"||ps(0,"Body must be a string. Received: ".concat(Mu(e),".")),this.body=e,this.name=t,this.locationOffset=r,this.locationOffset.line>0||ps(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||ps(0,"column in locationOffset is 1-indexed and must be positive.")}return zu(i,[{key:sl,get:function(){return"Source"}}]),i}();function Hu(i){return Vu(i,fl)}var Ku=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 Wu(i){var e=i.split(/\r\n|[\n\r]/g),t=Qu(i);if(t!==0)for(var r=1;r<e.length;r++)e[r]=e[r].slice(t);for(var n=0;n<e.length&&Wo(e[n]);)++n;for(var a=e.length;a>n&&Wo(e[a-1]);)--a;return e.slice(n,a).join(`
437
+ `)}function Wo(i){for(var e=0;e<i.length;++e)if(i[e]!==" "&&i[e]!==" ")return!1;return!0}function Qu(i){for(var e,t=!0,r=!0,n=0,a=null,s=0;s<i.length;++s)switch(i.charCodeAt(s)){case 13:i.charCodeAt(s+1)===10&&++s;case 10:t=!1,r=!0,n=0;break;case 9:case 32:++n;break;default:r&&!t&&(a===null||n<a)&&(a=n),r=!1}return(e=a)!==null&&e!==void 0?e:0}var Gu=function(){function i(t){var r=new ge(S.SOF,0,0,0,0,null);this.source=t,this.lastToken=r,this.token=r,this.line=1,this.lineStart=0}var e=i.prototype;return e.advance=function(){this.lastToken=this.token;var r=this.token=this.lookahead();return r},e.lookahead=function(){var r=this.token;if(r.kind!==S.EOF)do{var n;r=(n=r.next)!==null&&n!==void 0?n:r.next=Ju(this,r)}while(r.kind===S.COMMENT);return r},i}();function Zu(i){return i===S.BANG||i===S.DOLLAR||i===S.AMP||i===S.PAREN_L||i===S.PAREN_R||i===S.SPREAD||i===S.COLON||i===S.EQUALS||i===S.AT||i===S.BRACKET_L||i===S.BRACKET_R||i===S.BRACE_L||i===S.PIPE||i===S.BRACE_R}function Li(i){return isNaN(i)?S.EOF:i<127?JSON.stringify(String.fromCharCode(i)):'"\\u'.concat(("00"+i.toString(16).toUpperCase()).slice(-4),'"')}function Ju(i,e){for(var t=i.source,r=t.body,n=r.length,a=e.end;a<n;){var s=r.charCodeAt(a),o=i.line,l=1+a-i.lineStart;switch(s){case 65279:case 9:case 32:case 44:++a;continue;case 10:++a,++i.line,i.lineStart=a;continue;case 13:r.charCodeAt(a+1)===10?a+=2:++a,++i.line,i.lineStart=a;continue;case 33:return new ge(S.BANG,a,a+1,o,l,e);case 35:return Xu(t,a,o,l,e);case 36:return new ge(S.DOLLAR,a,a+1,o,l,e);case 38:return new ge(S.AMP,a,a+1,o,l,e);case 40:return new ge(S.PAREN_L,a,a+1,o,l,e);case 41:return new ge(S.PAREN_R,a,a+1,o,l,e);case 46:if(r.charCodeAt(a+1)===46&&r.charCodeAt(a+2)===46)return new ge(S.SPREAD,a,a+3,o,l,e);break;case 58:return new ge(S.COLON,a,a+1,o,l,e);case 61:return new ge(S.EQUALS,a,a+1,o,l,e);case 64:return new ge(S.AT,a,a+1,o,l,e);case 91:return new ge(S.BRACKET_L,a,a+1,o,l,e);case 93:return new ge(S.BRACKET_R,a,a+1,o,l,e);case 123:return new ge(S.BRACE_L,a,a+1,o,l,e);case 124:return new ge(S.PIPE,a,a+1,o,l,e);case 125:return new ge(S.BRACE_R,a,a+1,o,l,e);case 34:return r.charCodeAt(a+1)===34&&r.charCodeAt(a+2)===34?id(t,a,o,l,e,i):td(t,a,o,l,e);case 45:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return ed(t,a,s,o,l,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 nd(t,a,o,l,e)}throw Xe(t,a,Yu(s))}var c=i.line,u=1+a-i.lineStart;return new ge(S.EOF,n,n,c,u,e)}function Yu(i){return i<32&&i!==9&&i!==10&&i!==13?"Cannot contain the invalid character ".concat(Li(i),"."):i===39?`Unexpected single quote character ('), did you mean to use a double quote (")?`:"Cannot parse the unexpected character ".concat(Li(i),".")}function Xu(i,e,t,r,n){var a=i.body,s,o=e;do s=a.charCodeAt(++o);while(!isNaN(s)&&(s>31||s===9));return new ge(S.COMMENT,e,o,t,r,n,a.slice(e+1,o))}function ed(i,e,t,r,n,a){var s=i.body,o=t,l=e,c=!1;if(o===45&&(o=s.charCodeAt(++l)),o===48){if(o=s.charCodeAt(++l),o>=48&&o<=57)throw Xe(i,l,"Invalid number, unexpected digit after 0: ".concat(Li(o),"."))}else l=fs(i,l,o),o=s.charCodeAt(l);if(o===46&&(c=!0,o=s.charCodeAt(++l),l=fs(i,l,o),o=s.charCodeAt(l)),(o===69||o===101)&&(c=!0,o=s.charCodeAt(++l),(o===43||o===45)&&(o=s.charCodeAt(++l)),l=fs(i,l,o),o=s.charCodeAt(l)),o===46||ad(o))throw Xe(i,l,"Invalid number, expected digit but got: ".concat(Li(o),"."));return new ge(c?S.FLOAT:S.INT,e,l,r,n,a,s.slice(e,l))}function fs(i,e,t){var r=i.body,n=e,a=t;if(a>=48&&a<=57){do a=r.charCodeAt(++n);while(a>=48&&a<=57);return n}throw Xe(i,n,"Invalid number, expected digit but got: ".concat(Li(a),"."))}function td(i,e,t,r,n){for(var a=i.body,s=e+1,o=s,l=0,c="";s<a.length&&!isNaN(l=a.charCodeAt(s))&&l!==10&&l!==13;){if(l===34)return c+=a.slice(o,s),new ge(S.STRING,e,s+1,t,r,n,c);if(l<32&&l!==9)throw Xe(i,s,"Invalid character within String: ".concat(Li(l),"."));if(++s,l===92){switch(c+=a.slice(o,s-1),l=a.charCodeAt(s),l){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+=`
438
+ `;break;case 114:c+="\r";break;case 116:c+=" ";break;case 117:{var u=rd(a.charCodeAt(s+1),a.charCodeAt(s+2),a.charCodeAt(s+3),a.charCodeAt(s+4));if(u<0){var m=a.slice(s+1,s+5);throw Xe(i,s,"Invalid character escape sequence: \\u".concat(m,"."))}c+=String.fromCharCode(u),s+=4;break}default:throw Xe(i,s,"Invalid character escape sequence: \\".concat(String.fromCharCode(l),"."))}++s,o=s}}throw Xe(i,s,"Unterminated string.")}function id(i,e,t,r,n,a){for(var s=i.body,o=e+3,l=o,c=0,u="";o<s.length&&!isNaN(c=s.charCodeAt(o));){if(c===34&&s.charCodeAt(o+1)===34&&s.charCodeAt(o+2)===34)return u+=s.slice(l,o),new ge(S.BLOCK_STRING,e,o+3,t,r,n,Wu(u));if(c<32&&c!==9&&c!==10&&c!==13)throw Xe(i,o,"Invalid character within String: ".concat(Li(c),"."));c===10?(++o,++a.line,a.lineStart=o):c===13?(s.charCodeAt(o+1)===10?o+=2:++o,++a.line,a.lineStart=o):c===92&&s.charCodeAt(o+1)===34&&s.charCodeAt(o+2)===34&&s.charCodeAt(o+3)===34?(u+=s.slice(l,o)+'"""',o+=4,l=o):++o}throw Xe(i,o,"Unterminated string.")}function rd(i,e,t,r){return jn(i)<<12|jn(e)<<8|jn(t)<<4|jn(r)}function jn(i){return i>=48&&i<=57?i-48:i>=65&&i<=70?i-55:i>=97&&i<=102?i-87:-1}function nd(i,e,t,r,n){for(var a=i.body,s=a.length,o=e+1,l=0;o!==s&&!isNaN(l=a.charCodeAt(o))&&(l===95||l>=48&&l<=57||l>=65&&l<=90||l>=97&&l<=122);)++o;return new ge(S.NAME,e,o,t,r,n,a.slice(e,o))}function ad(i){return i===95||i>=65&&i<=90||i>=97&&i<=122}function sd(i,e){var t=new od(i,e);return t.parseDocument()}var od=function(){function i(t,r){var n=Hu(t)?t:new fl(t);this._lexer=new Gu(n),this._options=r}var e=i.prototype;return e.parseName=function(){var r=this.expectToken(S.NAME);return{kind:B.NAME,value:r.value,loc:this.loc(r)}},e.parseDocument=function(){var r=this._lexer.token;return{kind:B.DOCUMENT,definitions:this.many(S.SOF,this.parseDefinition,S.EOF),loc:this.loc(r)}},e.parseDefinition=function(){if(this.peek(S.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(S.BRACE_L))return this.parseOperationDefinition();if(this.peekDescription())return this.parseTypeSystemDefinition()}throw this.unexpected()},e.parseOperationDefinition=function(){var r=this._lexer.token;if(this.peek(S.BRACE_L))return{kind:B.OPERATION_DEFINITION,operation:"query",name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet(),loc:this.loc(r)};var n=this.parseOperationType(),a;return this.peek(S.NAME)&&(a=this.parseName()),{kind:B.OPERATION_DEFINITION,operation:n,name:a,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(r)}},e.parseOperationType=function(){var r=this.expectToken(S.NAME);switch(r.value){case"query":return"query";case"mutation":return"mutation";case"subscription":return"subscription"}throw this.unexpected(r)},e.parseVariableDefinitions=function(){return this.optionalMany(S.PAREN_L,this.parseVariableDefinition,S.PAREN_R)},e.parseVariableDefinition=function(){var r=this._lexer.token;return{kind:B.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(S.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(S.EQUALS)?this.parseValueLiteral(!0):void 0,directives:this.parseDirectives(!0),loc:this.loc(r)}},e.parseVariable=function(){var r=this._lexer.token;return this.expectToken(S.DOLLAR),{kind:B.VARIABLE,name:this.parseName(),loc:this.loc(r)}},e.parseSelectionSet=function(){var r=this._lexer.token;return{kind:B.SELECTION_SET,selections:this.many(S.BRACE_L,this.parseSelection,S.BRACE_R),loc:this.loc(r)}},e.parseSelection=function(){return this.peek(S.SPREAD)?this.parseFragment():this.parseField()},e.parseField=function(){var r=this._lexer.token,n=this.parseName(),a,s;return this.expectOptionalToken(S.COLON)?(a=n,s=this.parseName()):s=n,{kind:B.FIELD,alias:a,name:s,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(S.BRACE_L)?this.parseSelectionSet():void 0,loc:this.loc(r)}},e.parseArguments=function(r){var n=r?this.parseConstArgument:this.parseArgument;return this.optionalMany(S.PAREN_L,n,S.PAREN_R)},e.parseArgument=function(){var r=this._lexer.token,n=this.parseName();return this.expectToken(S.COLON),{kind:B.ARGUMENT,name:n,value:this.parseValueLiteral(!1),loc:this.loc(r)}},e.parseConstArgument=function(){var r=this._lexer.token;return{kind:B.ARGUMENT,name:this.parseName(),value:(this.expectToken(S.COLON),this.parseValueLiteral(!0)),loc:this.loc(r)}},e.parseFragment=function(){var r=this._lexer.token;this.expectToken(S.SPREAD);var n=this.expectOptionalKeyword("on");return!n&&this.peek(S.NAME)?{kind:B.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1),loc:this.loc(r)}:{kind:B.INLINE_FRAGMENT,typeCondition:n?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(r)}},e.parseFragmentDefinition=function(){var r,n=this._lexer.token;return this.expectKeyword("fragment"),((r=this._options)===null||r===void 0?void 0:r.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(n)}:{kind:B.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(n)}},e.parseFragmentName=function(){if(this._lexer.token.value==="on")throw this.unexpected();return this.parseName()},e.parseValueLiteral=function(r){var n=this._lexer.token;switch(n.kind){case S.BRACKET_L:return this.parseList(r);case S.BRACE_L:return this.parseObject(r);case S.INT:return this._lexer.advance(),{kind:B.INT,value:n.value,loc:this.loc(n)};case S.FLOAT:return this._lexer.advance(),{kind:B.FLOAT,value:n.value,loc:this.loc(n)};case S.STRING:case S.BLOCK_STRING:return this.parseStringLiteral();case S.NAME:switch(this._lexer.advance(),n.value){case"true":return{kind:B.BOOLEAN,value:!0,loc:this.loc(n)};case"false":return{kind:B.BOOLEAN,value:!1,loc:this.loc(n)};case"null":return{kind:B.NULL,loc:this.loc(n)};default:return{kind:B.ENUM,value:n.value,loc:this.loc(n)}}case S.DOLLAR:if(!r)return this.parseVariable();break}throw this.unexpected()},e.parseStringLiteral=function(){var r=this._lexer.token;return this._lexer.advance(),{kind:B.STRING,value:r.value,block:r.kind===S.BLOCK_STRING,loc:this.loc(r)}},e.parseList=function(r){var n=this,a=this._lexer.token,s=function(){return n.parseValueLiteral(r)};return{kind:B.LIST,values:this.any(S.BRACKET_L,s,S.BRACKET_R),loc:this.loc(a)}},e.parseObject=function(r){var n=this,a=this._lexer.token,s=function(){return n.parseObjectField(r)};return{kind:B.OBJECT,fields:this.any(S.BRACE_L,s,S.BRACE_R),loc:this.loc(a)}},e.parseObjectField=function(r){var n=this._lexer.token,a=this.parseName();return this.expectToken(S.COLON),{kind:B.OBJECT_FIELD,name:a,value:this.parseValueLiteral(r),loc:this.loc(n)}},e.parseDirectives=function(r){for(var n=[];this.peek(S.AT);)n.push(this.parseDirective(r));return n},e.parseDirective=function(r){var n=this._lexer.token;return this.expectToken(S.AT),{kind:B.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(r),loc:this.loc(n)}},e.parseTypeReference=function(){var r=this._lexer.token,n;return this.expectOptionalToken(S.BRACKET_L)?(n=this.parseTypeReference(),this.expectToken(S.BRACKET_R),n={kind:B.LIST_TYPE,type:n,loc:this.loc(r)}):n=this.parseNamedType(),this.expectOptionalToken(S.BANG)?{kind:B.NON_NULL_TYPE,type:n,loc:this.loc(r)}:n},e.parseNamedType=function(){var r=this._lexer.token;return{kind:B.NAMED_TYPE,name:this.parseName(),loc:this.loc(r)}},e.parseTypeSystemDefinition=function(){var r=this.peekDescription()?this._lexer.lookahead():this._lexer.token;if(r.kind===S.NAME)switch(r.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(r)},e.peekDescription=function(){return this.peek(S.STRING)||this.peek(S.BLOCK_STRING)},e.parseDescription=function(){if(this.peekDescription())return this.parseStringLiteral()},e.parseSchemaDefinition=function(){var r=this._lexer.token,n=this.parseDescription();this.expectKeyword("schema");var a=this.parseDirectives(!0),s=this.many(S.BRACE_L,this.parseOperationTypeDefinition,S.BRACE_R);return{kind:B.SCHEMA_DEFINITION,description:n,directives:a,operationTypes:s,loc:this.loc(r)}},e.parseOperationTypeDefinition=function(){var r=this._lexer.token,n=this.parseOperationType();this.expectToken(S.COLON);var a=this.parseNamedType();return{kind:B.OPERATION_TYPE_DEFINITION,operation:n,type:a,loc:this.loc(r)}},e.parseScalarTypeDefinition=function(){var r=this._lexer.token,n=this.parseDescription();this.expectKeyword("scalar");var a=this.parseName(),s=this.parseDirectives(!0);return{kind:B.SCALAR_TYPE_DEFINITION,description:n,name:a,directives:s,loc:this.loc(r)}},e.parseObjectTypeDefinition=function(){var r=this._lexer.token,n=this.parseDescription();this.expectKeyword("type");var a=this.parseName(),s=this.parseImplementsInterfaces(),o=this.parseDirectives(!0),l=this.parseFieldsDefinition();return{kind:B.OBJECT_TYPE_DEFINITION,description:n,name:a,interfaces:s,directives:o,fields:l,loc:this.loc(r)}},e.parseImplementsInterfaces=function(){var r;if(!this.expectOptionalKeyword("implements"))return[];if(((r=this._options)===null||r===void 0?void 0:r.allowLegacySDLImplementsInterfaces)===!0){var n=[];this.expectOptionalToken(S.AMP);do n.push(this.parseNamedType());while(this.expectOptionalToken(S.AMP)||this.peek(S.NAME));return n}return this.delimitedMany(S.AMP,this.parseNamedType)},e.parseFieldsDefinition=function(){var r;return((r=this._options)===null||r===void 0?void 0:r.allowLegacySDLEmptyFields)===!0&&this.peek(S.BRACE_L)&&this._lexer.lookahead().kind===S.BRACE_R?(this._lexer.advance(),this._lexer.advance(),[]):this.optionalMany(S.BRACE_L,this.parseFieldDefinition,S.BRACE_R)},e.parseFieldDefinition=function(){var r=this._lexer.token,n=this.parseDescription(),a=this.parseName(),s=this.parseArgumentDefs();this.expectToken(S.COLON);var o=this.parseTypeReference(),l=this.parseDirectives(!0);return{kind:B.FIELD_DEFINITION,description:n,name:a,arguments:s,type:o,directives:l,loc:this.loc(r)}},e.parseArgumentDefs=function(){return this.optionalMany(S.PAREN_L,this.parseInputValueDef,S.PAREN_R)},e.parseInputValueDef=function(){var r=this._lexer.token,n=this.parseDescription(),a=this.parseName();this.expectToken(S.COLON);var s=this.parseTypeReference(),o;this.expectOptionalToken(S.EQUALS)&&(o=this.parseValueLiteral(!0));var l=this.parseDirectives(!0);return{kind:B.INPUT_VALUE_DEFINITION,description:n,name:a,type:s,defaultValue:o,directives:l,loc:this.loc(r)}},e.parseInterfaceTypeDefinition=function(){var r=this._lexer.token,n=this.parseDescription();this.expectKeyword("interface");var a=this.parseName(),s=this.parseImplementsInterfaces(),o=this.parseDirectives(!0),l=this.parseFieldsDefinition();return{kind:B.INTERFACE_TYPE_DEFINITION,description:n,name:a,interfaces:s,directives:o,fields:l,loc:this.loc(r)}},e.parseUnionTypeDefinition=function(){var r=this._lexer.token,n=this.parseDescription();this.expectKeyword("union");var a=this.parseName(),s=this.parseDirectives(!0),o=this.parseUnionMemberTypes();return{kind:B.UNION_TYPE_DEFINITION,description:n,name:a,directives:s,types:o,loc:this.loc(r)}},e.parseUnionMemberTypes=function(){return this.expectOptionalToken(S.EQUALS)?this.delimitedMany(S.PIPE,this.parseNamedType):[]},e.parseEnumTypeDefinition=function(){var r=this._lexer.token,n=this.parseDescription();this.expectKeyword("enum");var a=this.parseName(),s=this.parseDirectives(!0),o=this.parseEnumValuesDefinition();return{kind:B.ENUM_TYPE_DEFINITION,description:n,name:a,directives:s,values:o,loc:this.loc(r)}},e.parseEnumValuesDefinition=function(){return this.optionalMany(S.BRACE_L,this.parseEnumValueDefinition,S.BRACE_R)},e.parseEnumValueDefinition=function(){var r=this._lexer.token,n=this.parseDescription(),a=this.parseName(),s=this.parseDirectives(!0);return{kind:B.ENUM_VALUE_DEFINITION,description:n,name:a,directives:s,loc:this.loc(r)}},e.parseInputObjectTypeDefinition=function(){var r=this._lexer.token,n=this.parseDescription();this.expectKeyword("input");var a=this.parseName(),s=this.parseDirectives(!0),o=this.parseInputFieldsDefinition();return{kind:B.INPUT_OBJECT_TYPE_DEFINITION,description:n,name:a,directives:s,fields:o,loc:this.loc(r)}},e.parseInputFieldsDefinition=function(){return this.optionalMany(S.BRACE_L,this.parseInputValueDef,S.BRACE_R)},e.parseTypeSystemExtension=function(){var r=this._lexer.lookahead();if(r.kind===S.NAME)switch(r.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(r)},e.parseSchemaExtension=function(){var r=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");var n=this.parseDirectives(!0),a=this.optionalMany(S.BRACE_L,this.parseOperationTypeDefinition,S.BRACE_R);if(n.length===0&&a.length===0)throw this.unexpected();return{kind:B.SCHEMA_EXTENSION,directives:n,operationTypes:a,loc:this.loc(r)}},e.parseScalarTypeExtension=function(){var r=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");var n=this.parseName(),a=this.parseDirectives(!0);if(a.length===0)throw this.unexpected();return{kind:B.SCALAR_TYPE_EXTENSION,name:n,directives:a,loc:this.loc(r)}},e.parseObjectTypeExtension=function(){var r=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");var n=this.parseName(),a=this.parseImplementsInterfaces(),s=this.parseDirectives(!0),o=this.parseFieldsDefinition();if(a.length===0&&s.length===0&&o.length===0)throw this.unexpected();return{kind:B.OBJECT_TYPE_EXTENSION,name:n,interfaces:a,directives:s,fields:o,loc:this.loc(r)}},e.parseInterfaceTypeExtension=function(){var r=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");var n=this.parseName(),a=this.parseImplementsInterfaces(),s=this.parseDirectives(!0),o=this.parseFieldsDefinition();if(a.length===0&&s.length===0&&o.length===0)throw this.unexpected();return{kind:B.INTERFACE_TYPE_EXTENSION,name:n,interfaces:a,directives:s,fields:o,loc:this.loc(r)}},e.parseUnionTypeExtension=function(){var r=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");var n=this.parseName(),a=this.parseDirectives(!0),s=this.parseUnionMemberTypes();if(a.length===0&&s.length===0)throw this.unexpected();return{kind:B.UNION_TYPE_EXTENSION,name:n,directives:a,types:s,loc:this.loc(r)}},e.parseEnumTypeExtension=function(){var r=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");var n=this.parseName(),a=this.parseDirectives(!0),s=this.parseEnumValuesDefinition();if(a.length===0&&s.length===0)throw this.unexpected();return{kind:B.ENUM_TYPE_EXTENSION,name:n,directives:a,values:s,loc:this.loc(r)}},e.parseInputObjectTypeExtension=function(){var r=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");var n=this.parseName(),a=this.parseDirectives(!0),s=this.parseInputFieldsDefinition();if(a.length===0&&s.length===0)throw this.unexpected();return{kind:B.INPUT_OBJECT_TYPE_EXTENSION,name:n,directives:a,fields:s,loc:this.loc(r)}},e.parseDirectiveDefinition=function(){var r=this._lexer.token,n=this.parseDescription();this.expectKeyword("directive"),this.expectToken(S.AT);var a=this.parseName(),s=this.parseArgumentDefs(),o=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");var l=this.parseDirectiveLocations();return{kind:B.DIRECTIVE_DEFINITION,description:n,name:a,arguments:s,repeatable:o,locations:l,loc:this.loc(r)}},e.parseDirectiveLocations=function(){return this.delimitedMany(S.PIPE,this.parseDirectiveLocation)},e.parseDirectiveLocation=function(){var r=this._lexer.token,n=this.parseName();if(Ku[n.value]!==void 0)return n;throw this.unexpected(r)},e.loc=function(r){var n;if(((n=this._options)===null||n===void 0?void 0:n.noLocation)!==!0)return new dl(r,this._lexer.lastToken,this._lexer.source)},e.peek=function(r){return this._lexer.token.kind===r},e.expectToken=function(r){var n=this._lexer.token;if(n.kind===r)return this._lexer.advance(),n;throw Xe(this._lexer.source,n.start,"Expected ".concat(hl(r),", found ").concat(hs(n),"."))},e.expectOptionalToken=function(r){var n=this._lexer.token;if(n.kind===r)return this._lexer.advance(),n},e.expectKeyword=function(r){var n=this._lexer.token;if(n.kind===S.NAME&&n.value===r)this._lexer.advance();else throw Xe(this._lexer.source,n.start,'Expected "'.concat(r,'", found ').concat(hs(n),"."))},e.expectOptionalKeyword=function(r){var n=this._lexer.token;return n.kind===S.NAME&&n.value===r?(this._lexer.advance(),!0):!1},e.unexpected=function(r){var n=r??this._lexer.token;return Xe(this._lexer.source,n.start,"Unexpected ".concat(hs(n),"."))},e.any=function(r,n,a){this.expectToken(r);for(var s=[];!this.expectOptionalToken(a);)s.push(n.call(this));return s},e.optionalMany=function(r,n,a){if(this.expectOptionalToken(r)){var s=[];do s.push(n.call(this));while(!this.expectOptionalToken(a));return s}return[]},e.many=function(r,n,a){this.expectToken(r);var s=[];do s.push(n.call(this));while(!this.expectOptionalToken(a));return s},e.delimitedMany=function(r,n){this.expectOptionalToken(r);var a=[];do a.push(n.call(this));while(this.expectOptionalToken(r));return a},i}();function hs(i){var e=i.value;return hl(i.kind)+(e!=null?' "'.concat(e,'"'):"")}function hl(i){return Zu(i)?'"'.concat(i,'"'):i}var na=new Map,Rs=new Map,gl=!0,ba=!1;function ml(i){return i.replace(/[\s,]+/g," ").trim()}function cd(i){return ml(i.source.body.substring(i.start,i.end))}function ld(i){var e=new Set,t=[];return i.definitions.forEach(function(r){if(r.kind==="FragmentDefinition"){var n=r.name.value,a=cd(r.loc),s=Rs.get(n);s&&!s.has(a)?gl&&console.warn("Warning: fragment with name "+n+` already exists.
439
439
  graphql-tag enforces all fragment names across your application to be unique; read more about
440
- this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`):s||Rs.set(n,s=new Set),s.add(a),e.has(a)||(e.add(a),t.push(r))}else t.push(r)}),va(va({},i),{definitions:t})}function ud(i){var e=new Set(i.definitions);e.forEach(function(r){r.loc&&delete r.loc,Object.keys(r).forEach(function(n){var a=r[n];a&&typeof a=="object"&&e.add(a)})});var t=i.loc;return t&&(delete t.startToken,delete t.endToken),i}function dd(i){var e=ml(i);if(!na.has(e)){var t=sd(i,{experimentalFragmentVariables:ba,allowLegacyFragmentVariables:ba});if(!t||t.kind!=="Document")throw new Error("Not a valid GraphQL document.");na.set(e,ud(ld(t)))}return na.get(e)}function y(i){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];typeof i=="string"&&(i=[i]);var r=i[0];return e.forEach(function(n,a){n&&n.kind==="Document"?r+=n.loc.source.body:r+=n,r+=i[a+1]}),dd(r)}function pd(){na.clear(),Rs.clear()}function fd(){gl=!1}function hd(){ba=!0}function gd(){ba=!1}var Dr={gql:y,resetCaches:pd,disableFragmentWarnings:fd,enableExperimentalFragmentVariables:hd,disableExperimentalFragmentVariables:gd};(function(i){i.gql=Dr.gql,i.resetCaches=Dr.resetCaches,i.disableFragmentWarnings=Dr.disableFragmentWarnings,i.enableExperimentalFragmentVariables=Dr.enableExperimentalFragmentVariables,i.disableExperimentalFragmentVariables=Dr.disableExperimentalFragmentVariables})(y||(y={}));y.default=y;function b(i){if(!i)throw"Got no result from Apollo";if(i.error)throw i.error;if(i.errors)throw i.errors;return i.data}function md(){}function si(){return md}var z=si,p=si,$e=si,ne=si,q=si,rt=si,yd=si,no=si,yl=function(i,e,t,r){var n=arguments.length,a=n<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(i,e,t,r);else for(var o=i.length-1;o>=0;o--)(s=i[o])&&(a=(n<3?s(a):n>3?s(e,t,a):s(e,t))||a);return n>3&&a&&Object.defineProperty(e,t,a),a},vl=function(i,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,e)},Pi=class{constructor(e){this.code=e}};yl([p(),vl("design:type",String)],Pi.prototype,"code",void 0);Pi=yl([q(),vl("design:paramtypes",[String])],Pi);var ao=function(i,e,t,r){var n=arguments.length,a=n<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(i,e,t,r);else for(var o=i.length-1;o>=0;o--)(s=i[o])&&(a=(n<3?s(a):n>3?s(e,t,a):s(e,t))||a);return n>3&&a&&Object.defineProperty(e,t,a),a},so=function(i,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,e)},Et=class{constructor(e,t){this.address=e,this.name=t}};ao([p(),so("design:type",String)],Et.prototype,"address",void 0);ao([p(),so("design:type",String)],Et.prototype,"name",void 0);Et=ao([q(),so("design:paramtypes",[String,String])],Et);var ue=function(i,e,t,r){var n=arguments.length,a=n<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(i,e,t,r);else for(var o=i.length-1;o>=0;o--)(s=i[o])&&(a=(n<3?s(a):n>3?s(e,t,a):s(e,t))||a);return n>3&&a&&Object.defineProperty(e,t,a),a},be=function(i,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,e)},Mt=class{constructor(e,t){this.key=t,this.signature=e}};ue([p(),be("design:type",String)],Mt.prototype,"signature",void 0);ue([p(),be("design:type",String)],Mt.prototype,"key",void 0);ue([p(),be("design:type",Boolean)],Mt.prototype,"valid",void 0);ue([p(),be("design:type",Boolean)],Mt.prototype,"invalid",void 0);Mt=ue([q(),$e(),be("design:paramtypes",[String,String])],Mt);var Ri=class{};ue([p(),be("design:type",String)],Ri.prototype,"signature",void 0);ue([p(),be("design:type",String)],Ri.prototype,"key",void 0);ue([p(),be("design:type",Boolean)],Ri.prototype,"valid",void 0);ue([p(),be("design:type",Boolean)],Ri.prototype,"invalid",void 0);Ri=ue([$e()],Ri);function oi(i){let e=class{constructor(r,n,a,s){this.author=r,this.timestamp=n,this.data=a,this.proof=s}};return ue([p(),be("design:type",String)],e.prototype,"author",void 0),ue([p(),be("design:type",String)],e.prototype,"timestamp",void 0),ue([p(),be("design:type",Object)],e.prototype,"data",void 0),ue([p(),be("design:type",Mt)],e.prototype,"proof",void 0),e=ue([q(),be("design:paramtypes",[String,String,Object,Mt])],e),e}function vd(i){let e=class{};return ue([p(),be("design:type",String)],e.prototype,"author",void 0),ue([p(),be("design:type",String)],e.prototype,"timestamp",void 0),ue([p(),be("design:type",Object)],e.prototype,"data",void 0),ue([p(),be("design:type",Ri)],e.prototype,"proof",void 0),e=ue([$e()],e),e}var Qo=class extends oi(){};Qo=ue([q()],Qo);var _a=class extends oi(){};ue([p(),be("design:type",Et)],_a.prototype,"language",void 0);ue([p(),be("design:type",Pi)],_a.prototype,"icon",void 0);_a=ue([q()],_a);function Bm(i){return i&&i.author&&i.timestamp&&i.data}var me=function(i,e,t,r){var n=arguments.length,a=n<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(i,e,t,r);else for(var o=i.length-1;o>=0;o--)(s=i[o])&&(a=(n<3?s(a):n>3?s(e,t,a):s(e,t))||a);return n>3&&a&&Object.defineProperty(e,t,a),a},Pe=function(i,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,e)},Oi=class{constructor(e){this.source=e.source?e.source:"",this.target=e.target?e.target:"",this.predicate=e.predicate?e.predicate:""}};me([p(),Pe("design:type",String)],Oi.prototype,"source",void 0);me([p(),Pe("design:type",String)],Oi.prototype,"target",void 0);me([p(),Pe("design:type",String)],Oi.prototype,"predicate",void 0);Oi=me([q(),Pe("design:paramtypes",[Object])],Oi);var Sa=class{};me([p(),Pe("design:type",Array)],Sa.prototype,"additions",void 0);me([p(),Pe("design:type",Array)],Sa.prototype,"removals",void 0);Sa=me([$e()],Sa);var wa=class{constructor(e,t){this.additions=e,this.removals=t}};me([p(),Pe("design:type",Array)],wa.prototype,"additions",void 0);me([p(),Pe("design:type",Array)],wa.prototype,"removals",void 0);wa=me([q(),Pe("design:paramtypes",[Array,Array])],wa);var dn=class{};me([p(),Pe("design:type",String)],dn.prototype,"source",void 0);me([p(),Pe("design:type",String)],dn.prototype,"target",void 0);me([p(),Pe("design:type",String)],dn.prototype,"predicate",void 0);dn=me([$e()],dn);var ei=class extends oi(){hash(){let e=JSON.stringify(this.data,Object.keys(this.data).sort())+JSON.stringify(this.author)+this.timestamp,t=0,r,n;for(r=0;r<e.length;r++)n=e.charCodeAt(r),t=(t<<5)-t+n,t|=0;return t}};me([p(),Pe("design:type",String)],ei.prototype,"status",void 0);ei=me([q()],ei);var Os=class extends vd(){};me([p(),Pe("design:type",String)],Os.prototype,"status",void 0);Os=me([$e()],Os);function Qm(i,e){return i.author==e.author&&i.timestamp==e.timestamp&&i.data.source==e.data.source&&i.data.predicate==e.data.predicate&&i.data.target==e.data.target}function Wm(i){return i&&i.source&&i.target}var Ea=class{constructor(e,t){this.oldLink=e,this.newLink=t}};me([p(),Pe("design:type",ei)],Ea.prototype,"oldLink",void 0);me([p(),Pe("design:type",ei)],Ea.prototype,"newLink",void 0);Ea=me([q(),Pe("design:paramtypes",[ei,ei])],Ea);var zi=function(i,e,t,r){var n=arguments.length,a=n<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(i,e,t,r);else for(var o=i.length-1;o>=0;o--)(s=i[o])&&(a=(n<3?s(a):n>3?s(e,t,a):s(e,t))||a);return n>3&&a&&Object.defineProperty(e,t,a),a},En=function(i,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,e)},Ds,$t=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 r=JSON.parse(JSON.stringify(this.links));return e.target&&(r=r.filter(n=>n.data.target===e.target)),e.predicate&&(r=r.filter(n=>n.data.predicate===e.predicate)),e.fromDate&&(r=r.filter(n=>new Date(n.timestamp)>=e.fromDate)),e.untilDate&&(r=r.filter(n=>new Date(n.timestamp)<=e.untilDate)),e.limit&&(r=r.slice(0,e.limit)),r}if(e.target){let r=JSON.parse(JSON.stringify(this.links));return e.predicate&&(r=r.filter(n=>n.data.predicate===e.predicate)),e.fromDate&&(r=r.filter(n=>new Date(n.timestamp)>=e.fromDate)),e.untilDate&&(r=r.filter(n=>new Date(n.timestamp)<=e.untilDate)),e.limit&&(r=r.slice(0,e.limit)),r}let t=JSON.parse(JSON.stringify(this.links));return t=t.filter(r=>r.data.predicate===e.predicate),e.limit&&(t=t.slice(0,e.limit)),t}getSingleTarget(e){delete e.target;let t=this.get(e);return t.length?t[0].data.target:null}};zi([p(),En("design:type",Array)],$t.prototype,"links",void 0);$t=zi([q(),En("design:paramtypes",[Array])],$t);var xa=class{};zi([p(),En("design:type",Array)],xa.prototype,"links",void 0);xa=zi([$e()],xa);var Ms=Ds=class{constructor(e){e?this.links=e:this.links=[]}static fromLink(e){let t=new Ds;return t.links.push(e),t}};zi([p(),En("design:type",Array)],Ms.prototype,"links",void 0);Ms=Ds=zi([$e(),En("design:paramtypes",[Array])],Ms);var Di=class extends oi(){};Di=zi([q()],Di);var P=function(i,e,t,r){var n=arguments.length,a=n<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(i,e,t,r);else for(var o=i.length-1;o>=0;o--)(s=i[o])&&(a=(n<3?s(a):n>3?s(e,t,a):s(e,t))||a);return n>3&&a&&Object.defineProperty(e,t,a),a},R=function(i,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,e)},Wt=class{constructor(e,t){this.did=e,t?this.perspective=t:this.perspective=new $t}};P([p(),R("design:type",String)],Wt.prototype,"did",void 0);P([p(),R("design:type",$t)],Wt.prototype,"perspective",void 0);P([p(),R("design:type",String)],Wt.prototype,"directMessageLanguage",void 0);Wt=P([q(),R("design:paramtypes",[String,$t])],Wt);var Wo=class extends oi(){};Wo=P([q()],Wo);var ti=class{constructor(e,t,r,n,a,s){this.did=e,this.didSigningKeyId=t,this.deviceKeyType=r,this.deviceKey=n,this.deviceKeySignedByDid=a,this.didSignedByDeviceKey=s}};P([p(),R("design:type",String)],ti.prototype,"did",void 0);P([p(),R("design:type",String)],ti.prototype,"didSigningKeyId",void 0);P([p(),R("design:type",String)],ti.prototype,"deviceKeyType",void 0);P([p(),R("design:type",String)],ti.prototype,"deviceKey",void 0);P([p(),R("design:type",String)],ti.prototype,"deviceKeySignedByDid",void 0);P([p(),R("design:type",String)],ti.prototype,"didSignedByDeviceKey",void 0);ti=P([q(),R("design:paramtypes",[String,String,String,String,String,String])],ti);var ii=class{constructor(e,t,r,n,a,s){this.did=e,this.didSigningKeyId=t,this.deviceKeyType=r,this.deviceKey=n,this.deviceKeySignedByDid=a,this.didSignedByDeviceKey=s}};P([p(),R("design:type",String)],ii.prototype,"did",void 0);P([p(),R("design:type",String)],ii.prototype,"didSigningKeyId",void 0);P([p(),R("design:type",String)],ii.prototype,"deviceKeyType",void 0);P([p(),R("design:type",String)],ii.prototype,"deviceKey",void 0);P([p(),R("design:type",String)],ii.prototype,"deviceKeySignedByDid",void 0);P([p(),R("design:type",String)],ii.prototype,"didSignedByDeviceKey",void 0);ii=P([$e(),R("design:paramtypes",[String,String,String,String,String,String])],ii);var Aa=class{constructor(e,t){this.signature=e,this.publicKey=t}};P([p(),R("design:type",String)],Aa.prototype,"signature",void 0);P([p(),R("design:type",String)],Aa.prototype,"publicKey",void 0);Aa=P([q(),R("design:paramtypes",[String,String])],Aa);var mr=class{constructor(e,t){this.domain=e,this.pointers=t}};P([p(),R("design:type",String)],mr.prototype,"domain",void 0);P([p(),R("design:type",Array)],mr.prototype,"pointers",void 0);mr=P([q(),R("design:paramtypes",[String,Array])],mr);var $a=class{constructor(e,t){this.with=e,this.can=t}};P([p(),R("design:type",mr)],$a.prototype,"with",void 0);P([p(),R("design:type",Array)],$a.prototype,"can",void 0);$a=P([q(),R("design:paramtypes",[mr,Array])],$a);var Ut=class{constructor(e,t,r,n,a){this.appName=e,this.appDesc=t,this.appIconPath=a,this.appUrl=r,this.capabilities=n}};P([p(),R("design:type",String)],Ut.prototype,"appName",void 0);P([p(),R("design:type",String)],Ut.prototype,"appDesc",void 0);P([p(),R("design:type",String)],Ut.prototype,"appUrl",void 0);P([p(),R("design:type",String)],Ut.prototype,"appIconPath",void 0);P([p(),R("design:type",Array)],Ut.prototype,"capabilities",void 0);Ut=P([q(),R("design:paramtypes",[String,String,String,Array,String])],Ut);var yr=class{constructor(e,t,r,n){this.requestId=e,this.auth=t,this.token=r,this.revoked=n}};P([p(),R("design:type",String)],yr.prototype,"requestId",void 0);P([p(),R("design:type",String)],yr.prototype,"token",void 0);P([p(),R("design:type",Boolean)],yr.prototype,"revoked",void 0);P([p(),R("design:type",Ut)],yr.prototype,"auth",void 0);yr=P([q(),R("design:paramtypes",[String,Ut,String,Boolean])],yr);var vr=class{constructor(e,t){this.domain=e,this.pointers=t}};P([p(),R("design:type",String)],vr.prototype,"domain",void 0);P([p(),R("design:type",Array)],vr.prototype,"pointers",void 0);vr=P([$e(),R("design:paramtypes",[String,Array])],vr);var Ia=class{constructor(e,t){this.with=e,this.can=t}};P([p(),R("design:type",vr)],Ia.prototype,"with",void 0);P([p(),R("design:type",Array)],Ia.prototype,"can",void 0);Ia=P([$e(),R("design:paramtypes",[vr,Array])],Ia);var It=class{constructor(e,t,r,n,a,s){this.appName=e,this.appDesc=t,this.appUrl=n,this.appDomain=r,this.capabilities=s,this.appIconPath=a}};P([p(),R("design:type",String)],It.prototype,"appName",void 0);P([p(),R("design:type",String)],It.prototype,"appDesc",void 0);P([p(),R("design:type",String)],It.prototype,"appDomain",void 0);P([p(),R("design:type",String)],It.prototype,"appUrl",void 0);P([p(),R("design:type",String)],It.prototype,"appIconPath",void 0);P([p(),R("design:type",Array)],It.prototype,"capabilities",void 0);It=P([$e(),R("design:paramtypes",[String,String,String,String,String,Array])],It);var Mi=class{constructor(e,t,r){this.did=e,this.success=t,this.error=r}};P([p(),R("design:type",String)],Mi.prototype,"did",void 0);P([p(),R("design:type",Boolean)],Mi.prototype,"success",void 0);P([p(),R("design:type",String)],Mi.prototype,"error",void 0);Mi=P([q(),R("design:paramtypes",[String,Boolean,String])],Mi);var Ar=function(i,e,t,r){var n=arguments.length,a=n<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(i,e,t,r);else for(var o=i.length-1;o>=0;o--)(s=i[o])&&(a=(n<3?s(a):n>3?s(e,t,a):s(e,t))||a);return n>3&&a&&Object.defineProperty(e,t,a),a},$r=function(i,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,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)}};Ar([p(),$r("design:type",Boolean)],ct.prototype,"isInitialized",void 0);Ar([p(),$r("design:type",Boolean)],ct.prototype,"isUnlocked",void 0);Ar([p(),$r("design:type",String)],ct.prototype,"did",void 0);Ar([p(),$r("design:type",String)],ct.prototype,"didDocument",void 0);Ar([p(),$r("design:type",String)],ct.prototype,"error",void 0);ct=Ar([q(),$r("design:paramtypes",[Object])],ct);var Zo=function(i,e,t,r,n){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?i!==e||!n:!e.has(i))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?n.call(i,t):n?n.value=t:e.set(i,t),t},pe=function(i,e,t,r){if(t==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?i!==e||!r:!e.has(i))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?r:t==="a"?r.call(i):r?r.value:e.get(i)},Ge,Ke,Us=class{constructor(e,t){Ge.set(this,void 0),Ke.set(this,void 0),Zo(this,Ge,e,"f"),Zo(this,Ke,t,"f")}async otherAgents(){return await pe(this,Ge,"f").otherAgents(pe(this,Ke,"f"))}async hasTelepresenceAdapter(){return await pe(this,Ge,"f").hasTelepresenceAdapter(pe(this,Ke,"f"))}async onlineAgents(){return await pe(this,Ge,"f").onlineAgents(pe(this,Ke,"f"))}async setOnlineStatus(e){return await pe(this,Ge,"f").setOnlineStatus(pe(this,Ke,"f"),e)}async setOnlineStatusU(e){return await pe(this,Ge,"f").setOnlineStatusU(pe(this,Ke,"f"),e)}async sendSignal(e,t){return await pe(this,Ge,"f").sendSignal(pe(this,Ke,"f"),e,t)}async sendSignalU(e,t){return await pe(this,Ge,"f").sendSignalU(pe(this,Ke,"f"),e,t)}async sendBroadcast(e,t=!1){return await pe(this,Ge,"f").sendBroadcast(pe(this,Ke,"f"),e,t)}async sendBroadcastU(e,t=!1){return await pe(this,Ge,"f").sendBroadcastU(pe(this,Ke,"f"),e,t)}async addSignalHandler(e){await pe(this,Ge,"f").addSignalHandler(pe(this,Ke,"f"),e)}removeSignalHandler(e){pe(this,Ge,"f").removeSignalHandler(pe(this,Ke,"f"),e)}};Ge=new WeakMap,Ke=new WeakMap;var Hi=function(i,e,t,r){var n=arguments.length,a=n<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(i,e,t,r);else for(var o=i.length-1;o>=0;o--)(s=i[o])&&(a=(n<3?s(a):n>3?s(e,t,a):s(e,t))||a);return n>3&&a&&Object.defineProperty(e,t,a),a},Gi=function(i,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,e)},Ne=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)}};Hi([p(),Gi("design:type",String)],Ne.prototype,"source",void 0);Hi([p(),Gi("design:type",String)],Ne.prototype,"target",void 0);Hi([p(),Gi("design:type",String)],Ne.prototype,"predicate",void 0);Hi([p(),Gi("design:type",Date)],Ne.prototype,"fromDate",void 0);Hi([p(),Gi("design:type",Date)],Ne.prototype,"untilDate",void 0);Hi([p(),Gi("design:type",Number)],Ne.prototype,"limit",void 0);Ne=Hi([q(),$e(),Gi("design:paramtypes",[Object])],Ne);var Jo=function(i,e,t,r,n){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?i!==e||!n:!e.has(i))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?n.call(i,t):n?n.value=t:e.set(i,t),t},Te=function(i,e,t,r){if(t==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?i!==e||!r:!e.has(i))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?r:t==="a"?r.call(i):r?r.value:e.get(i)},Qe,Lt;function Bn(i){return encodeURIComponent(i).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`)}var Le=class{constructor(){Qe.set(this,void 0),Lt.set(this,void 0)}static fromUrl(e){if(!e||!e.startsWith("literal://"))throw new Error("Can't create Literal from non-literal URL");let t=new Le;return Jo(t,Lt,e,"f"),t}static from(e){let t=new Le;return Jo(t,Qe,e,"f"),t}toUrl(){if(Te(this,Lt,"f")&&!Te(this,Qe,"f"))return Te(this,Lt,"f");if(!Te(this,Lt,"f")&&(Te(this,Qe,"f")===void 0||Te(this,Qe,"f")===""||Te(this,Qe,"f")===null))throw new Error("Can't turn empty Literal into URL");let e;switch(typeof Te(this,Qe,"f")){case"string":e=`string:${Bn(Te(this,Qe,"f"))}`;break;case"number":e=`number:${Bn(Te(this,Qe,"f"))}`;break;case"boolean":e=`boolean:${Bn(Te(this,Qe,"f"))}`;break;case"object":e=`json:${Bn(JSON.stringify(Te(this,Qe,"f")))}`;break}return`literal://${e}`}get(){if(Te(this,Qe,"f"))return Te(this,Qe,"f");if(!Te(this,Lt,"f"))throw new Error("Can't render empty Literal");if(!Te(this,Lt,"f").startsWith("literal://"))throw new Error("Can't render Literal from non-literal URL");let e=Te(this,Lt,"f").substring(10);if(e.startsWith("string:"))return decodeURIComponent(e.substring(7));if(e.startsWith("number:")){let t=e.substring(7);return parseFloat(t)}if(e.startsWith("json:")){let t=e.substring(5);return JSON.parse(decodeURIComponent(t))}throw new Error(`Can't parse unknown literal: ${e}`)}};Qe=new WeakMap,Lt=new WeakMap;function Zt(i){return i.charAt(0).toUpperCase()+i.slice(1)}function oo(i){return`set${Zt(i)}`}function fr(i){return i.endsWith("y")?i.slice(0,-1)+"ies":i+"s"}function co(i){return i.endsWith("ies")?i.slice(0,-3)+"y":i.endsWith("s")?i.slice(0,-1):i}function bd(i){return`add${Zt(co(i))}`}function _d(i){let e=i.substring(3),t=fr(e);return t.charAt(0).toLowerCase()+t.slice(1)}function Sd(i){return`remove${Zt(co(i))}`}function wd(i){let e=i.substring(6),t=fr(e);return t.charAt(0).toLowerCase()+t.slice(1)}function Ed(i){let e=i.substring(13),t=fr(e);return t.charAt(0).toLowerCase()+t.slice(1)}function xd(i){return`setCollection${Zt(co(i))}`}function yi(i){if(Array.isArray(i))return`[${i.map(yi).join(", ")}]`;let e=Object.keys(i),t=[];for(let r of e){let n=JSON.stringify(i[r]),a=`${r}: ${n}`;t.push(a)}return`{${t.join(", ")}}`}var gs=function(i,e,t,r,n){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?i!==e||!n:!e.has(i))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?n.call(i,t):n?n.value=t:e.set(i,t),t},G=function(i,e,t,r){if(t==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?i!==e||!r:!e.has(i))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?r:t==="a"?r.call(i):r?r.value:e.get(i)},je,Be,fe,hr=class{constructor(i,e,t){je.set(this,void 0),Be.set(this,void 0),fe.set(this,void 0),gs(this,je,e,"f"),gs(this,Be,t,"f"),gs(this,fe,i,"f")}get baseExpression(){return G(this,je,"f")}async init(){let isInstance=await G(this,fe,"f").isSubjectInstance(G(this,je,"f"),G(this,Be,"f"));if(!isInstance)throw`Not a valid subject instance of ${G(this,Be,"f")} for ${G(this,je,"f")}`;let results=await G(this,fe,"f").infer(`subject_class("${G(this,Be,"f")}", C), property(C, Property)`),properties=results.map(i=>i.Property);for(let i of properties)await G(this,fe,"f").infer(`subject_class("${G(this,Be,"f")}", C), property_resolve(C, "${i}")`),Object.defineProperty(this,i,{configurable:!0,get:async()=>{try{return await G(this,fe,"f").getPropertyValueViaSurreal(G(this,je,"f"),G(this,Be,"f"),i)}catch(e){console.warn(`Failed to get property ${i} via SurrealDB:`,e);return}}});let setters=await G(this,fe,"f").infer(`subject_class("${G(this,Be,"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,fe,"f").infer(`subject_class("${G(this,Be,"f")}", C), property_resolve_language(C, "${property}", Language)`),resolveLanguage;resolveLanguageResults&&resolveLanguageResults.length>0&&(resolveLanguage=resolveLanguageResults[0].Language),this[oo(property)]=async i=>{resolveLanguage&&(i=await G(this,fe,"f").createExpression(i,resolveLanguage)),await G(this,fe,"f").executeAction(actions,G(this,je,"f"),[{name:"value",value:i}])}}let results2=await G(this,fe,"f").infer(`subject_class("${G(this,Be,"f")}", C), collection(C, Collection)`);results2||(results2=[]);let collections=results2.map(i=>i.Collection);for(let i of collections)Object.defineProperty(this,i,{configurable:!0,get:async()=>{try{return await G(this,fe,"f").getCollectionValuesViaSurreal(G(this,je,"f"),G(this,Be,"f"),i)}catch(e){return console.warn(`Failed to get collection ${i} via SurrealDB:`,e),[]}}});let adders=await G(this,fe,"f").infer(`subject_class("${G(this,Be,"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[bd(collection)]=async i=>{Array.isArray(i)?await Promise.all(i.map(e=>G(this,fe,"f").executeAction(actions,G(this,je,"f"),[{name:"value",value:e}]))):await G(this,fe,"f").executeAction(actions,G(this,je,"f"),[{name:"value",value:i}])}}let removers=await G(this,fe,"f").infer(`subject_class("${G(this,Be,"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[Sd(collection)]=async i=>{Array.isArray(i)?await Promise.all(i.map(e=>G(this,fe,"f").executeAction(actions,G(this,je,"f"),[{name:"value",value:e}]))):await G(this,fe,"f").executeAction(actions,G(this,je,"f"),[{name:"value",value:i}])}}let collectionSetters=await G(this,fe,"f").infer(`subject_class("${G(this,Be,"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[xd(collection)]=async i=>{Array.isArray(i)?await G(this,fe,"f").executeAction(actions,G(this,je,"f"),i.map(e=>({name:"value",value:e}))):await G(this,fe,"f").executeAction(actions,G(this,je,"f"),[{name:"value",value:i}])}}}};je=new WeakMap,Be=new WeakMap,fe=new WeakMap;function Yo(i){return i?.length?i.length===1?i.toString():i.length===2?i.join(" and "):i.slice(0,-1).join(", ")+", and "+i.slice(-1):""}function bl(i){let e=i.can.includes("*")?["READ","WRITE","UPDATE"]:i.can,t=i.with.domain==="*"?"":i.with.domain,r=i.with.pointers.includes("*")?["all AD4M data"]:i.with.pointers;return`${Yo(e)} your ${t} actions, with access to ${Yo(r)}`}function oe(i){return i.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")}var re=function(i,e,t,r,n){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?i!==e||!n:!e.has(i))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?n.call(i,t):n?n.value=t:e.set(i,t),t},_=function(i,e,t,r){if(t==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?i!==e||!r:!e.has(i))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?r:t==="a"?r.call(i):r?r.value:e.get(i)},aa,Pt,vt,bt,$i,zt,Ht,vi,Br,sa,bi,_i,st,ur,Fs,Y,ee,Si,wi,Ei,qr,ka=class{constructor(e,t,r){aa.add(this),Pt.set(this,void 0),vt.set(this,void 0),bt.set(this,void 0),$i.set(this,void 0),zt.set(this,void 0),Ht.set(this,void 0),vi.set(this,void 0),Br.set(this,!1),sa.set(this,void 0),bi.set(this,void 0),_i.set(this,void 0),st.set(this,void 0),ur.set(this,void 0),this.isSurrealDB=!1,re(this,Pt,e,"f"),re(this,ur,t,"f"),re(this,bt,r,"f"),re(this,$i,new Set,"f"),re(this,vi,null,"f"),re(this,sa,new Promise((n,a)=>{re(this,bi,n,"f"),re(this,_i,a,"f")}),"f")}async subscribe(){_(this,Ht,"f")&&(_(this,Ht,"f").call(this),re(this,Ht,void 0,"f")),_(this,st,"f")&&(clearTimeout(_(this,st,"f")),re(this,st,void 0,"f")),_(this,zt,"f")&&(clearTimeout(_(this,zt,"f")),re(this,zt,void 0,"f"));try{let t;this.isSurrealDB?t=await _(this,bt,"f").perspectiveSubscribeSurrealQuery(_(this,Pt,"f"),_(this,ur,"f")):t=await _(this,bt,"f").subscribeQuery(_(this,Pt,"f"),_(this,ur,"f")),re(this,vt,t.subscriptionId,"f"),t.result?(re(this,vi,t.result,"f"),_(this,aa,"m",Fs).call(this,t.result)):console.warn("\u26A0\uFE0F No initial result returned from subscribeQuery!"),re(this,st,setTimeout(()=>{console.error("Subscription initialization timed out after 30 seconds. Resubscribing..."),this.subscribe().catch(r=>{console.error("Error during subscription retry after timeout:",r)})},3e4),"f"),re(this,Ht,_(this,bt,"f").subscribeToQueryUpdates(_(this,vt,"f"),r=>{_(this,st,"f")&&(clearTimeout(_(this,st,"f")),re(this,st,void 0,"f")),_(this,bi,"f")&&(_(this,bi,"f").call(this,!0),re(this,bi,void 0,"f"),re(this,_i,void 0,"f")),!(r.isInit&&_(this,vi,"f"))&&(re(this,vi,r,"f"),_(this,aa,"m",Fs).call(this,r))}),"f")}catch(t){throw console.error("Error setting up subscription:",t),_(this,_i,"f")&&(_(this,_i,"f").call(this,t),re(this,bi,void 0,"f"),re(this,_i,void 0,"f")),t}let e=async()=>{if(!_(this,Br,"f")){try{this.isSurrealDB?await _(this,bt,"f").perspectiveKeepAliveSurrealQuery(_(this,Pt,"f"),_(this,vt,"f")):await _(this,bt,"f").keepAliveQuery(_(this,Pt,"f"),_(this,vt,"f"))}catch(t){console.error("Error in keepalive:",t),console.log("Reinitializing subscription for query:",_(this,ur,"f"));try{await this.subscribe(),console.log("Subscription reinitialized")}catch(r){console.error("Error during resubscription from keepalive:",r);return}}_(this,Br,"f")||re(this,zt,setTimeout(e,3e4),"f")}};re(this,zt,setTimeout(e,3e4),"f")}get id(){return _(this,vt,"f")}get initialized(){return _(this,sa,"f")}get result(){return _(this,vi,"f")}onResult(e){return _(this,$i,"f").add(e),()=>_(this,$i,"f").delete(e)}dispose(){re(this,Br,!0,"f"),clearTimeout(_(this,zt,"f")),_(this,Ht,"f")&&_(this,Ht,"f").call(this),_(this,$i,"f").clear(),_(this,st,"f")&&(clearTimeout(_(this,st,"f")),re(this,st,void 0,"f")),_(this,vt,"f")&&(this.isSurrealDB?_(this,bt,"f").perspectiveDisposeSurrealQuerySubscription(_(this,Pt,"f"),_(this,vt,"f")).catch(e=>console.error("Error disposing surreal query subscription:",e)):_(this,bt,"f").disposeQuerySubscription(_(this,Pt,"f"),_(this,vt,"f")).catch(e=>console.error("Error disposing query subscription:",e)))}};Pt=new WeakMap,vt=new WeakMap,bt=new WeakMap,$i=new WeakMap,zt=new WeakMap,Ht=new WeakMap,vi=new WeakMap,Br=new WeakMap,sa=new WeakMap,bi=new WeakMap,_i=new WeakMap,st=new WeakMap,ur=new WeakMap,aa=new WeakSet,Fs=function i(e){for(let t of _(this,$i,"f"))try{t(e)}catch(r){console.error("Error in query subscription callback:",r)}};var pr=class{constructor(i,e){Y.set(this,void 0),ee.set(this,void 0),Si.set(this,void 0),wi.set(this,void 0),Ei.set(this,void 0),qr.set(this,void 0),re(this,Si,[],"f"),re(this,wi,[],"f"),re(this,Ei,[],"f"),re(this,qr,[],"f"),re(this,Y,i,"f"),re(this,ee,e,"f"),this.uuid=_(this,Y,"f").uuid,this.name=_(this,Y,"f").name,this.owners=_(this,Y,"f").owners,this.sharedUrl=_(this,Y,"f").sharedUrl,this.neighbourhood=_(this,Y,"f").neighbourhood,this.state=_(this,Y,"f").state,_(this,ee,"f").addPerspectiveLinkAddedListener(_(this,Y,"f").uuid,_(this,Si,"f")),_(this,ee,"f").addPerspectiveLinkRemovedListener(_(this,Y,"f").uuid,_(this,wi,"f")),_(this,ee,"f").addPerspectiveLinkUpdatedListener(_(this,Y,"f").uuid,_(this,Ei,"f")),_(this,ee,"f").addPerspectiveSyncStateChangeListener(_(this,Y,"f").uuid,_(this,qr,"f"))}escapeRegExp(i){return i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}async executeAction(i,e,t,r){return await _(this,ee,"f").executeCommands(_(this,Y,"f").uuid,JSON.stringify(i),e,JSON.stringify(t),r)}async get(i){return await _(this,ee,"f").queryLinks(_(this,Y,"f").uuid,i)}async infer(i){return await _(this,ee,"f").queryProlog(_(this,Y,"f").uuid,i)}async querySurrealDB(i){return await _(this,ee,"f").querySurrealDB(_(this,Y,"f").uuid,i)}async add(i,e="shared",t){return await _(this,ee,"f").addLink(_(this,Y,"f").uuid,i,e,t)}async addLinks(i,e="shared",t){return await _(this,ee,"f").addLinks(_(this,Y,"f").uuid,i,e,t)}async removeLinks(i,e){return await _(this,ee,"f").removeLinks(_(this,Y,"f").uuid,i,e)}async linkMutations(i,e="shared"){return await _(this,ee,"f").linkMutations(_(this,Y,"f").uuid,i,e)}async addLinkExpression(i,e="shared",t){return await _(this,ee,"f").addLinkExpression(_(this,Y,"f").uuid,i,e,t)}async update(i,e,t){return await _(this,ee,"f").updateLink(_(this,Y,"f").uuid,i,e,t)}async remove(i,e){return await _(this,ee,"f").removeLink(_(this,Y,"f").uuid,i,e)}async createBatch(){return await _(this,ee,"f").createBatch(_(this,Y,"f").uuid)}async commitBatch(i){return await _(this,ee,"f").commitBatch(_(this,Y,"f").uuid,i)}async getExpression(i){return await _(this,ee,"f").getExpression(i)}async createExpression(i,e){return await _(this,ee,"f").createExpression(i,e)}async addListener(i,e){i==="link-added"?_(this,Si,"f").push(e):i==="link-removed"?_(this,wi,"f").push(e):i==="link-updated"&&_(this,Ei,"f").push(e)}async addSyncStateChangeListener(i){_(this,qr,"f").push(i)}async removeListener(i,e){if(i==="link-added"){let t=_(this,Si,"f").indexOf(e);_(this,Si,"f").splice(t,1)}else if(i==="link-removed"){let t=_(this,wi,"f").indexOf(e);_(this,wi,"f").splice(t,1)}else if(i==="link-updated"){let t=_(this,Ei,"f").indexOf(e);_(this,Ei,"f").splice(t,1)}}async snapshot(){return _(this,ee,"f").snapshotByUUID(_(this,Y,"f").uuid)}async loadSnapshot(i){let e=JSON.parse(JSON.stringify(i));delete e.__typename,e.links.forEach(t=>{delete t.data.__typename});for(let t of e.links)await this.addLinkExpression(t)}async getSingleTarget(i){delete i.target;let e=await this.get(i);return e.length?e[0].data.target:null}async setSingleTarget(i,e="shared"){let t=new Ne({source:i.source,predicate:i.predicate}),r=await this.get(t),n=[];for(let s of r)delete s.__typename,delete s.data.__typename,delete s.proof.__typename,n.push(s);let a=[i];await this.linkMutations({additions:a,removals:n},e)}async sdnaFlows(){return(await this.infer("register_sdna_flow(X, _)")).map(e=>e.X)}async availableFlows(i){return(await this.infer(`flowable("${i}", F), register_sdna_flow(X, F)`)).map(t=>t.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(i,e){return(await this.infer(`register_sdna_flow("${i}", F), flow_state(X, ${e}, F)`)).map(r=>r.X)}async flowState(i,e){return(await this.infer(`register_sdna_flow("${i}", F), flow_state("${e}", X, F)`))[0].X}async flowActions(i,e){return(await this.infer(`register_sdna_flow("${i}", Flow), flow_state("${e}", State, Flow), action(State, Name, _, _)`)).map(r=>r.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 i=["ad4m://has_subject_class","ad4m://has_flow","ad4m://has_custom_sdna"],e=[];for(let t of i){let r=await this.get(new Ne({source:"ad4m://self",predicate:t}));for(let n of r){let a=n.data.target,s=await this.get(new Ne({source:a,predicate:"ad4m://sdna"}));for(let o of s){let c=Le.fromUrl(o.data.target).get();typeof c=="string"&&e.push(c)}}}return e}async getSdnaForClass(i){let e=Le.from(i);if((await this.get(new Ne({source:"ad4m://self",target:e.toUrl(),predicate:"ad4m://has_subject_class"}))).length===0)return null;let r=await this.get(new Ne({source:e.toUrl(),predicate:"ad4m://sdna"}));if(r.length===0)return null;let n=Le.fromUrl(r[0].data.target).get();return typeof n=="string"?n:null}async addSdna(i,e,t){return _(this,ee,"f").addSdna(_(this,Y,"f").uuid,i,e,t)}async subjectClasses(){try{return(await this.infer("subject_class(X, _)")).map(i=>i.X)}catch{return[]}}async stringOrTemplateObjectToSubjectClassName(i){if(typeof i=="string")return i;{let e=await this.subjectClassesByTemplate(i);return e[0]?e[0]:i.className}}async createSubject(i,e,t,r){let n;if(typeof i=="string")n=i,await _(this,ee,"f").createSubject(_(this,Y,"f").uuid,JSON.stringify({className:n,initialValues:t}),e,t?JSON.stringify(t):void 0,r);else{let a=this.buildQueryFromTemplate(i);await _(this,ee,"f").createSubject(_(this,Y,"f").uuid,JSON.stringify({query:a,initialValues:t}),e,t?JSON.stringify(t):void 0,r)}return r?e:this.getSubjectProxy(e,i)}async getSubjectData(i,e){if(typeof i=="string")return JSON.parse(await _(this,ee,"f").getSubjectData(_(this,Y,"f").uuid,JSON.stringify({className:i}),e));let t=this.buildQueryFromTemplate(i);return JSON.parse(await _(this,ee,"f").getSubjectData(_(this,Y,"f").uuid,JSON.stringify({query:t}),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(i,e){let t=await this.stringOrTemplateObjectToSubjectClassName(e),r=await this.getSubjectClassMetadataFromSDNA(t);if(!r)try{let n=t.replace(/"/g,'\\"'),a=i.replace(/"/g,'\\"'),s=await this.infer(`subject_class("${n}", C), instance(C, "${a}")`);return s&&s.length>0}catch(n){return console.warn(`Failed to check instance via Prolog for class ${t}:`,n),!1}if(r.requiredTriples.length===0){let a=`SELECT count() AS count FROM link WHERE in.uri = '${oe(i)}'`,o=(await this.querySurrealDB(a))[0]?.count??0;return(typeof o=="object"&&o?.Int!==void 0?o.Int:o)>0}for(let n of r.requiredTriples){let a=oe(i),s=oe(n.predicate),o;if(n.target){let m=oe(n.target);o=`SELECT count() AS count FROM link WHERE in.uri = '${a}' AND predicate = '${s}' AND out.uri = '${m}'`}else o=`SELECT count() AS count FROM link WHERE in.uri = '${a}' AND predicate = '${s}'`;let c=await this.querySurrealDB(o);if(!c||c.length===0)return!1;let l=c[0]?.count??0;if((typeof l=="object"&&l?.Int!==void 0?l.Int:l)===0)return!1}return!0}async getSubjectProxy(i,e){if(!await this.isSubjectInstance(i,e))throw`Expression ${i} is not a subject instance of given class: ${JSON.stringify(e)}`;let t=await this.stringOrTemplateObjectToSubjectClassName(e),r=new hr(this,i,t);return await r.init(),r}async getSubjectClassMetadataFromSDNA(i){try{let e=await this.get(new Ne({source:Le.from(i).toUrl(),predicate:"ad4m://sdna"}));if(!e||e.length===0)return console.warn(`No SDNA found for class ${i}`),null;if(!e[0].data.target)return console.error(`SDNA link for ${i} has no target:`,e[0]),null;let t=Le.fromUrl(e[0].data.target).get(),r=[],n=/instance\([^)]+\)\s*:-\s*([^.]+)\./g,a,s=!1;for(;(a=n.exec(t))!==null;){s=!0;let h=a[1],d=/triple\([^,]+,\s*"([^"]+)",\s*(?:"([^"]+)"|_)\)/g,g;for(;(g=d.exec(h))!==null;){let v=g[1],E=g[2];r.push({predicate:v,target:E})}}s||console.warn(`No instance rule found in SDNA for ${i}`);let o=r.map(h=>h.predicate),c=new Map,l=await this.infer(`subject_class("${i}", C), property(C, P)`);if(l)for(let h of l){let d=h.P,g=null,v=await this.infer(`subject_class("${i}", C), property_setter(C, "${d}", Setter)`);if(v&&v.length>0){let $=v[0].Setter.match(/predicate:\s*"([^"]+)"|predicate:\s*([^,}\]]+)/);$&&(g=$[1]||$[2])}if(!g){let E=this.escapeRegExp(d),$=t.match(new RegExp(`property_getter\\([^,]+,\\s*[^,]+,\\s*"${E}"[^)]*\\)\\s*:-\\s*triple\\([^,]+,\\s*"([^"]+)"`));$&&(g=$[1])}if(g){let E=await this.infer(`subject_class("${i}", C), property_resolve_language(C, "${d}", Lang)`),$=E&&E.length>0?E[0].Lang:void 0;c.set(d,{predicate:g,resolveLanguage:$})}}let u=new Map,m=await this.infer(`subject_class("${i}", C), collection(C, Coll)`);if(m)for(let h of m){let d=h.Coll,g=null,v,E=await this.infer(`subject_class("${i}", C), collection_adder(C, "${d}", Adder)`);if(E&&E.length>0){let k=E[0].Adder.match(/predicate:\s*"([^"]+)"|predicate:\s*([^,}\]]+)/);k&&(g=k[1]||k[2])}let $=this.escapeRegExp(d),N=new RegExp(`collection_getter\\([^,]+,\\s*[^,]+,\\s*"${$}"[^)]*\\)\\s*:-[^.]+\\.`),O=t.match(N);if(O){let A=O[0],k=/(?:setof|findall)\([^,]+,\s*(.+),\s*\w+\)\./,Z=A.match(k);if(Z){let I=Z[1];if(I.startsWith("(")&&I.endsWith(")")&&(I=I.substring(1,I.length-1)),!g){let C=I.match(/triple\([^,]+,\s*"([^"]+)"/);C&&(g=C[1])}let K=I.match(/subject_class\("([^"]+)"/);K&&(v=K[1])}}g&&u.set(d,{predicate:g,instanceFilter:v})}return{requiredPredicates:o,requiredTriples:r,properties:c,collections:u}}catch(e){return console.error(`Error getting metadata for ${i}:`,e),null}}generateSurrealInstanceQuery(i){return i.requiredTriples.length===0?"SELECT DISTINCT uri AS base FROM node WHERE count(->link) > 0":`SELECT uri AS base FROM node WHERE ${i.requiredTriples.map(t=>{let r=oe(t.predicate);if(t.target){let n=oe(t.target);return`count(->link[WHERE predicate = '${r}' AND out.uri = '${n}']) > 0`}else return`count(->link[WHERE predicate = '${r}']) > 0`}).join(" AND ")}`}async getPropertyValueViaSurreal(i,e,t){let r=await this.getSubjectClassMetadataFromSDNA(e);if(!r)return;let n=r.properties.get(t);if(!n)return;let a=oe(i),s=oe(n.predicate),o=`SELECT out.uri AS value FROM link WHERE in.uri = '${a}' AND predicate = '${s}' LIMIT 1`,c=await this.querySurrealDB(o);if(!c||c.length===0)return;let l=c[0].value;if(n.resolveLanguage&&l)try{let u=await this.getExpression(l);try{return JSON.parse(u.data)}catch{return u.data}}catch{return l}return l}async getCollectionValuesViaSurreal(i,e,t){let r=await this.getSubjectClassMetadataFromSDNA(e);if(!r)return[];let n=r.collections.get(t);if(!n)return[];let a=oe(i),s=oe(n.predicate),o=`SELECT out.uri AS value, timestamp FROM link WHERE in.uri = '${a}' AND predicate = '${s}' ORDER BY timestamp ASC`,c=await this.querySurrealDB(o);if(!c||c.length===0)return[];let l=c.map(u=>u.value).filter(u=>u!==""&&u!=="");if(n.instanceFilter)try{let u=await this.getSubjectClassMetadataFromSDNA(n.instanceFilter);return u?await this.batchCheckSubjectInstances(l,u):this.filterInstancesSequential(l,n.instanceFilter)}catch{return this.filterInstancesSequential(l,n.instanceFilter)}return l}async batchCheckSubjectInstances(i,e){if(i.length===0)return[];if(e.requiredTriples.length===0){let a=`SELECT in.uri AS uri FROM link WHERE in.uri IN [${i.map(o=>`'${oe(o)}'`).join(", ")}] GROUP BY in.uri HAVING count() > 0`;return(await this.querySurrealDB(a)).map(o=>o.uri)}let t=[];for(let n of e.requiredTriples){let a=i.map(l=>`'${oe(l)}'`).join(", "),s=oe(n.predicate),o;if(n.target){let l=oe(n.target);o=`SELECT in.uri AS uri FROM link WHERE in.uri IN [${a}] AND predicate = '${s}' AND out.uri = '${l}' GROUP BY in.uri`}else o=`SELECT in.uri AS uri FROM link WHERE in.uri IN [${a}] AND predicate = '${s}' GROUP BY in.uri`;let c=await this.querySurrealDB(o);t.push(new Set(c.map(l=>l.uri)))}return t.length===0?i:i.filter(n=>t.every(a=>a.has(n)))}async filterInstancesSequential(i,e){let t=[];for(let r of i)try{await this.isSubjectInstance(r,e)&&t.push(r)}catch{continue}return t}async getAllSubjectInstances(i){let e=[];typeof i=="string"?e=[i]:e=await this.subjectClassesByTemplate(i);let t=[];for(let r of e){let n=await this.getSubjectClassMetadataFromSDNA(r);if(n){let a=this.generateSurrealInstanceQuery(n),s=await this.querySurrealDB(a);for(let o of s||[])try{let c=new hr(this,o.base,r);await c.init(),t.push(c)}catch{}}}return t}async getAllSubjectProxies(i){let e=[];typeof i=="string"?e=[i]:e=await this.subjectClassesByTemplate(i);let t=[];for(let r of e){let n=await this.getSubjectClassMetadataFromSDNA(r);if(n){let a=this.generateSurrealInstanceQuery(n),s=await this.querySurrealDB(a);for(let o of s||[])try{let c=new hr(this,o.base,r);await c.init(),t.push(c)}catch{}}}return t}buildQueryFromTemplate(i){let e;return function(t){let r=[],n=[];Object.getPrototypeOf(t).__properties?Object.keys(Object.getPrototypeOf(t).__properties).forEach(u=>r.push(u)):r.push(...Object.keys(t).filter(u=>!Array.isArray(t[u]))),Object.getPrototypeOf(t).__collections?Object.keys(Object.getPrototypeOf(t).__collections).filter(u=>u!=="isSubjectInstance").forEach(u=>{n.includes(u)||n.push(u)}):n.push(...Object.keys(t).filter(u=>Array.isArray(t[u])).filter(u=>u!=="isSubjectInstance"));let a=Object.getOwnPropertyNames(t).filter(u=>typeof t[u]=="function"&&u.startsWith("set")&&!u.startsWith("setCollection"));a=a.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(t)).filter(u=>{let m=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(t),u);return m&&typeof m.value=="function"&&u.startsWith("set")&&!u.startsWith("setCollection")}));let s=Object.getOwnPropertyNames(t).filter(u=>Object.prototype.hasOwnProperty.call(t,u)&&typeof t[u]=="function"&&u.startsWith("add"));s=s.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(t)).filter(u=>{let m=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(t),u);return m&&typeof m.value=="function"&&u.startsWith("add")}));let o=Object.getOwnPropertyNames(t).filter(u=>Object.prototype.hasOwnProperty.call(t,u)&&typeof t[u]=="function"&&u.startsWith("remove"));o=o.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(t)).filter(u=>{let m=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(t),u);return m&&typeof m.value=="function"&&u.startsWith("remove")}));let c=Object.getOwnPropertyNames(t).filter(u=>Object.prototype.hasOwnProperty.call(t,u)&&typeof t[u]=="function"&&u.startsWith("setCollection"));c=c.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(t)).filter(u=>{let m=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(t),u);return m&&typeof m.value=="function"&&u.startsWith("setCollection")}));let l="subject_class(Class, C)";for(let u of r)l+=`, property(C, "${u}")`;for(let u of n)l+=`, collection(C, "${u}")`;for(let u of a){let m=u.substring(3);m=m.charAt(0).toLowerCase()+m.slice(1),l+=`, property_setter(C, "${m}", _)`}for(let u of s)l+=`, collection_adder(C, "${_d(u)}", _)`;for(let u of o)l+=`, collection_remover(C, "${wd(u)}", _)`;for(let u of c)l+=`, collection_setter(C, "${Ed(u)}", _)`;l+=".",e=l}(i),e}async subjectClassesByTemplate(i){let e=this.buildQueryFromTemplate(i),t=await this.infer(e);return t?t.map(r=>r.Class):[]}async ensureSDNASubjectClass(i){if((await this.subjectClassesByTemplate(new i)).length>0)return;let{name:t,sdna:r}=i.generateSDNA();await this.addSdna(t,r,"subject_class")}getNeighbourhoodProxy(){return _(this,ee,"f").getNeighbourhoodProxy(_(this,Y,"f").uuid)}get ai(){return _(this,ee,"f").aiClient}async subscribeInfer(i){let e=new ka(this.uuid,i,_(this,ee,"f"));return await e.subscribe(),await e.initialized,e}async subscribeSurrealDB(i){let e=new ka(this.uuid,i,_(this,ee,"f"));return e.isSurrealDB=!0,await e.subscribe(),await e.initialized,e}};Y=new WeakMap,ee=new WeakMap,Si=new WeakMap,wi=new WeakMap,Ei=new WeakMap,qr=new WeakMap;var Bt=function(i,e,t,r,n){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?i!==e||!n:!e.has(i))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?n.call(i,t):n?n.value=t:e.set(i,t),t},U=function(i,e,t,r){if(t==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?i!==e||!r:!e.has(i))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?r:t==="a"?r.call(i):r?r.value:e.get(i)},Q,Vr,zr,Hr,oa,Gr,ca,la,Fe=`
440
+ this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`):s||Rs.set(n,s=new Set),s.add(a),e.has(a)||(e.add(a),t.push(r))}else t.push(r)}),va(va({},i),{definitions:t})}function ud(i){var e=new Set(i.definitions);e.forEach(function(r){r.loc&&delete r.loc,Object.keys(r).forEach(function(n){var a=r[n];a&&typeof a=="object"&&e.add(a)})});var t=i.loc;return t&&(delete t.startToken,delete t.endToken),i}function dd(i){var e=ml(i);if(!na.has(e)){var t=sd(i,{experimentalFragmentVariables:ba,allowLegacyFragmentVariables:ba});if(!t||t.kind!=="Document")throw new Error("Not a valid GraphQL document.");na.set(e,ud(ld(t)))}return na.get(e)}function y(i){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];typeof i=="string"&&(i=[i]);var r=i[0];return e.forEach(function(n,a){n&&n.kind==="Document"?r+=n.loc.source.body:r+=n,r+=i[a+1]}),dd(r)}function pd(){na.clear(),Rs.clear()}function fd(){gl=!1}function hd(){ba=!0}function gd(){ba=!1}var Dr={gql:y,resetCaches:pd,disableFragmentWarnings:fd,enableExperimentalFragmentVariables:hd,disableExperimentalFragmentVariables:gd};(function(i){i.gql=Dr.gql,i.resetCaches=Dr.resetCaches,i.disableFragmentWarnings=Dr.disableFragmentWarnings,i.enableExperimentalFragmentVariables=Dr.enableExperimentalFragmentVariables,i.disableExperimentalFragmentVariables=Dr.disableExperimentalFragmentVariables})(y||(y={}));y.default=y;function b(i){if(!i)throw"Got no result from Apollo";if(i.error)throw i.error;if(i.errors)throw i.errors;return i.data}function md(){}function si(){return md}var z=si,p=si,$e=si,ne=si,q=si,rt=si,yd=si,no=si,yl=function(i,e,t,r){var n=arguments.length,a=n<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(i,e,t,r);else for(var o=i.length-1;o>=0;o--)(s=i[o])&&(a=(n<3?s(a):n>3?s(e,t,a):s(e,t))||a);return n>3&&a&&Object.defineProperty(e,t,a),a},vl=function(i,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,e)},Pi=class{constructor(e){this.code=e}};yl([p(),vl("design:type",String)],Pi.prototype,"code",void 0);Pi=yl([q(),vl("design:paramtypes",[String])],Pi);var ao=function(i,e,t,r){var n=arguments.length,a=n<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(i,e,t,r);else for(var o=i.length-1;o>=0;o--)(s=i[o])&&(a=(n<3?s(a):n>3?s(e,t,a):s(e,t))||a);return n>3&&a&&Object.defineProperty(e,t,a),a},so=function(i,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,e)},Et=class{constructor(e,t){this.address=e,this.name=t}};ao([p(),so("design:type",String)],Et.prototype,"address",void 0);ao([p(),so("design:type",String)],Et.prototype,"name",void 0);Et=ao([q(),so("design:paramtypes",[String,String])],Et);var de=function(i,e,t,r){var n=arguments.length,a=n<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(i,e,t,r);else for(var o=i.length-1;o>=0;o--)(s=i[o])&&(a=(n<3?s(a):n>3?s(e,t,a):s(e,t))||a);return n>3&&a&&Object.defineProperty(e,t,a),a},be=function(i,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,e)},Mt=class{constructor(e,t){this.key=t,this.signature=e}};de([p(),be("design:type",String)],Mt.prototype,"signature",void 0);de([p(),be("design:type",String)],Mt.prototype,"key",void 0);de([p(),be("design:type",Boolean)],Mt.prototype,"valid",void 0);de([p(),be("design:type",Boolean)],Mt.prototype,"invalid",void 0);Mt=de([q(),$e(),be("design:paramtypes",[String,String])],Mt);var Ri=class{};de([p(),be("design:type",String)],Ri.prototype,"signature",void 0);de([p(),be("design:type",String)],Ri.prototype,"key",void 0);de([p(),be("design:type",Boolean)],Ri.prototype,"valid",void 0);de([p(),be("design:type",Boolean)],Ri.prototype,"invalid",void 0);Ri=de([$e()],Ri);function oi(i){let e=class{constructor(r,n,a,s){this.author=r,this.timestamp=n,this.data=a,this.proof=s}};return de([p(),be("design:type",String)],e.prototype,"author",void 0),de([p(),be("design:type",String)],e.prototype,"timestamp",void 0),de([p(),be("design:type",Object)],e.prototype,"data",void 0),de([p(),be("design:type",Mt)],e.prototype,"proof",void 0),e=de([q(),be("design:paramtypes",[String,String,Object,Mt])],e),e}function vd(i){let e=class{};return de([p(),be("design:type",String)],e.prototype,"author",void 0),de([p(),be("design:type",String)],e.prototype,"timestamp",void 0),de([p(),be("design:type",Object)],e.prototype,"data",void 0),de([p(),be("design:type",Ri)],e.prototype,"proof",void 0),e=de([$e()],e),e}var Qo=class extends oi(){};Qo=de([q()],Qo);var _a=class extends oi(){};de([p(),be("design:type",Et)],_a.prototype,"language",void 0);de([p(),be("design:type",Pi)],_a.prototype,"icon",void 0);_a=de([q()],_a);function Bm(i){return i&&i.author&&i.timestamp&&i.data}var me=function(i,e,t,r){var n=arguments.length,a=n<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(i,e,t,r);else for(var o=i.length-1;o>=0;o--)(s=i[o])&&(a=(n<3?s(a):n>3?s(e,t,a):s(e,t))||a);return n>3&&a&&Object.defineProperty(e,t,a),a},Pe=function(i,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,e)},Oi=class{constructor(e){this.source=e.source?e.source:"",this.target=e.target?e.target:"",this.predicate=e.predicate?e.predicate:""}};me([p(),Pe("design:type",String)],Oi.prototype,"source",void 0);me([p(),Pe("design:type",String)],Oi.prototype,"target",void 0);me([p(),Pe("design:type",String)],Oi.prototype,"predicate",void 0);Oi=me([q(),Pe("design:paramtypes",[Object])],Oi);var Sa=class{};me([p(),Pe("design:type",Array)],Sa.prototype,"additions",void 0);me([p(),Pe("design:type",Array)],Sa.prototype,"removals",void 0);Sa=me([$e()],Sa);var wa=class{constructor(e,t){this.additions=e,this.removals=t}};me([p(),Pe("design:type",Array)],wa.prototype,"additions",void 0);me([p(),Pe("design:type",Array)],wa.prototype,"removals",void 0);wa=me([q(),Pe("design:paramtypes",[Array,Array])],wa);var dn=class{};me([p(),Pe("design:type",String)],dn.prototype,"source",void 0);me([p(),Pe("design:type",String)],dn.prototype,"target",void 0);me([p(),Pe("design:type",String)],dn.prototype,"predicate",void 0);dn=me([$e()],dn);var ei=class extends oi(){hash(){let e=JSON.stringify(this.data,Object.keys(this.data).sort())+JSON.stringify(this.author)+this.timestamp,t=0,r,n;for(r=0;r<e.length;r++)n=e.charCodeAt(r),t=(t<<5)-t+n,t|=0;return t}};me([p(),Pe("design:type",String)],ei.prototype,"status",void 0);ei=me([q()],ei);var Os=class extends vd(){};me([p(),Pe("design:type",String)],Os.prototype,"status",void 0);Os=me([$e()],Os);function Qm(i,e){return i.author==e.author&&i.timestamp==e.timestamp&&i.data.source==e.data.source&&i.data.predicate==e.data.predicate&&i.data.target==e.data.target}function Gm(i){return i&&i.source&&i.target}var Ea=class{constructor(e,t){this.oldLink=e,this.newLink=t}};me([p(),Pe("design:type",ei)],Ea.prototype,"oldLink",void 0);me([p(),Pe("design:type",ei)],Ea.prototype,"newLink",void 0);Ea=me([q(),Pe("design:paramtypes",[ei,ei])],Ea);var zi=function(i,e,t,r){var n=arguments.length,a=n<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(i,e,t,r);else for(var o=i.length-1;o>=0;o--)(s=i[o])&&(a=(n<3?s(a):n>3?s(e,t,a):s(e,t))||a);return n>3&&a&&Object.defineProperty(e,t,a),a},En=function(i,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,e)},Ds,$t=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 r=JSON.parse(JSON.stringify(this.links));return e.target&&(r=r.filter(n=>n.data.target===e.target)),e.predicate&&(r=r.filter(n=>n.data.predicate===e.predicate)),e.fromDate&&(r=r.filter(n=>new Date(n.timestamp)>=e.fromDate)),e.untilDate&&(r=r.filter(n=>new Date(n.timestamp)<=e.untilDate)),e.limit&&(r=r.slice(0,e.limit)),r}if(e.target){let r=JSON.parse(JSON.stringify(this.links));return e.predicate&&(r=r.filter(n=>n.data.predicate===e.predicate)),e.fromDate&&(r=r.filter(n=>new Date(n.timestamp)>=e.fromDate)),e.untilDate&&(r=r.filter(n=>new Date(n.timestamp)<=e.untilDate)),e.limit&&(r=r.slice(0,e.limit)),r}let t=JSON.parse(JSON.stringify(this.links));return t=t.filter(r=>r.data.predicate===e.predicate),e.limit&&(t=t.slice(0,e.limit)),t}getSingleTarget(e){delete e.target;let t=this.get(e);return t.length?t[0].data.target:null}};zi([p(),En("design:type",Array)],$t.prototype,"links",void 0);$t=zi([q(),En("design:paramtypes",[Array])],$t);var xa=class{};zi([p(),En("design:type",Array)],xa.prototype,"links",void 0);xa=zi([$e()],xa);var Ms=Ds=class{constructor(e){e?this.links=e:this.links=[]}static fromLink(e){let t=new Ds;return t.links.push(e),t}};zi([p(),En("design:type",Array)],Ms.prototype,"links",void 0);Ms=Ds=zi([$e(),En("design:paramtypes",[Array])],Ms);var Di=class extends oi(){};Di=zi([q()],Di);var P=function(i,e,t,r){var n=arguments.length,a=n<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(i,e,t,r);else for(var o=i.length-1;o>=0;o--)(s=i[o])&&(a=(n<3?s(a):n>3?s(e,t,a):s(e,t))||a);return n>3&&a&&Object.defineProperty(e,t,a),a},R=function(i,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,e)},Gt=class{constructor(e,t){this.did=e,t?this.perspective=t:this.perspective=new $t}};P([p(),R("design:type",String)],Gt.prototype,"did",void 0);P([p(),R("design:type",$t)],Gt.prototype,"perspective",void 0);P([p(),R("design:type",String)],Gt.prototype,"directMessageLanguage",void 0);Gt=P([q(),R("design:paramtypes",[String,$t])],Gt);var Go=class extends oi(){};Go=P([q()],Go);var ti=class{constructor(e,t,r,n,a,s){this.did=e,this.didSigningKeyId=t,this.deviceKeyType=r,this.deviceKey=n,this.deviceKeySignedByDid=a,this.didSignedByDeviceKey=s}};P([p(),R("design:type",String)],ti.prototype,"did",void 0);P([p(),R("design:type",String)],ti.prototype,"didSigningKeyId",void 0);P([p(),R("design:type",String)],ti.prototype,"deviceKeyType",void 0);P([p(),R("design:type",String)],ti.prototype,"deviceKey",void 0);P([p(),R("design:type",String)],ti.prototype,"deviceKeySignedByDid",void 0);P([p(),R("design:type",String)],ti.prototype,"didSignedByDeviceKey",void 0);ti=P([q(),R("design:paramtypes",[String,String,String,String,String,String])],ti);var ii=class{constructor(e,t,r,n,a,s){this.did=e,this.didSigningKeyId=t,this.deviceKeyType=r,this.deviceKey=n,this.deviceKeySignedByDid=a,this.didSignedByDeviceKey=s}};P([p(),R("design:type",String)],ii.prototype,"did",void 0);P([p(),R("design:type",String)],ii.prototype,"didSigningKeyId",void 0);P([p(),R("design:type",String)],ii.prototype,"deviceKeyType",void 0);P([p(),R("design:type",String)],ii.prototype,"deviceKey",void 0);P([p(),R("design:type",String)],ii.prototype,"deviceKeySignedByDid",void 0);P([p(),R("design:type",String)],ii.prototype,"didSignedByDeviceKey",void 0);ii=P([$e(),R("design:paramtypes",[String,String,String,String,String,String])],ii);var Aa=class{constructor(e,t){this.signature=e,this.publicKey=t}};P([p(),R("design:type",String)],Aa.prototype,"signature",void 0);P([p(),R("design:type",String)],Aa.prototype,"publicKey",void 0);Aa=P([q(),R("design:paramtypes",[String,String])],Aa);var mr=class{constructor(e,t){this.domain=e,this.pointers=t}};P([p(),R("design:type",String)],mr.prototype,"domain",void 0);P([p(),R("design:type",Array)],mr.prototype,"pointers",void 0);mr=P([q(),R("design:paramtypes",[String,Array])],mr);var $a=class{constructor(e,t){this.with=e,this.can=t}};P([p(),R("design:type",mr)],$a.prototype,"with",void 0);P([p(),R("design:type",Array)],$a.prototype,"can",void 0);$a=P([q(),R("design:paramtypes",[mr,Array])],$a);var Ut=class{constructor(e,t,r,n,a){this.appName=e,this.appDesc=t,this.appIconPath=a,this.appUrl=r,this.capabilities=n}};P([p(),R("design:type",String)],Ut.prototype,"appName",void 0);P([p(),R("design:type",String)],Ut.prototype,"appDesc",void 0);P([p(),R("design:type",String)],Ut.prototype,"appUrl",void 0);P([p(),R("design:type",String)],Ut.prototype,"appIconPath",void 0);P([p(),R("design:type",Array)],Ut.prototype,"capabilities",void 0);Ut=P([q(),R("design:paramtypes",[String,String,String,Array,String])],Ut);var yr=class{constructor(e,t,r,n){this.requestId=e,this.auth=t,this.token=r,this.revoked=n}};P([p(),R("design:type",String)],yr.prototype,"requestId",void 0);P([p(),R("design:type",String)],yr.prototype,"token",void 0);P([p(),R("design:type",Boolean)],yr.prototype,"revoked",void 0);P([p(),R("design:type",Ut)],yr.prototype,"auth",void 0);yr=P([q(),R("design:paramtypes",[String,Ut,String,Boolean])],yr);var vr=class{constructor(e,t){this.domain=e,this.pointers=t}};P([p(),R("design:type",String)],vr.prototype,"domain",void 0);P([p(),R("design:type",Array)],vr.prototype,"pointers",void 0);vr=P([$e(),R("design:paramtypes",[String,Array])],vr);var Ia=class{constructor(e,t){this.with=e,this.can=t}};P([p(),R("design:type",vr)],Ia.prototype,"with",void 0);P([p(),R("design:type",Array)],Ia.prototype,"can",void 0);Ia=P([$e(),R("design:paramtypes",[vr,Array])],Ia);var It=class{constructor(e,t,r,n,a,s){this.appName=e,this.appDesc=t,this.appUrl=n,this.appDomain=r,this.capabilities=s,this.appIconPath=a}};P([p(),R("design:type",String)],It.prototype,"appName",void 0);P([p(),R("design:type",String)],It.prototype,"appDesc",void 0);P([p(),R("design:type",String)],It.prototype,"appDomain",void 0);P([p(),R("design:type",String)],It.prototype,"appUrl",void 0);P([p(),R("design:type",String)],It.prototype,"appIconPath",void 0);P([p(),R("design:type",Array)],It.prototype,"capabilities",void 0);It=P([$e(),R("design:paramtypes",[String,String,String,String,String,Array])],It);var Mi=class{constructor(e,t,r){this.did=e,this.success=t,this.error=r}};P([p(),R("design:type",String)],Mi.prototype,"did",void 0);P([p(),R("design:type",Boolean)],Mi.prototype,"success",void 0);P([p(),R("design:type",String)],Mi.prototype,"error",void 0);Mi=P([q(),R("design:paramtypes",[String,Boolean,String])],Mi);var Ar=function(i,e,t,r){var n=arguments.length,a=n<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(i,e,t,r);else for(var o=i.length-1;o>=0;o--)(s=i[o])&&(a=(n<3?s(a):n>3?s(e,t,a):s(e,t))||a);return n>3&&a&&Object.defineProperty(e,t,a),a},$r=function(i,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,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)}};Ar([p(),$r("design:type",Boolean)],ct.prototype,"isInitialized",void 0);Ar([p(),$r("design:type",Boolean)],ct.prototype,"isUnlocked",void 0);Ar([p(),$r("design:type",String)],ct.prototype,"did",void 0);Ar([p(),$r("design:type",String)],ct.prototype,"didDocument",void 0);Ar([p(),$r("design:type",String)],ct.prototype,"error",void 0);ct=Ar([q(),$r("design:paramtypes",[Object])],ct);var Zo=function(i,e,t,r,n){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?i!==e||!n:!e.has(i))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?n.call(i,t):n?n.value=t:e.set(i,t),t},fe=function(i,e,t,r){if(t==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?i!==e||!r:!e.has(i))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?r:t==="a"?r.call(i):r?r.value:e.get(i)},Ke,We,Us=class{constructor(e,t){Ke.set(this,void 0),We.set(this,void 0),Zo(this,Ke,e,"f"),Zo(this,We,t,"f")}async otherAgents(){return await fe(this,Ke,"f").otherAgents(fe(this,We,"f"))}async hasTelepresenceAdapter(){return await fe(this,Ke,"f").hasTelepresenceAdapter(fe(this,We,"f"))}async onlineAgents(){return await fe(this,Ke,"f").onlineAgents(fe(this,We,"f"))}async setOnlineStatus(e){return await fe(this,Ke,"f").setOnlineStatus(fe(this,We,"f"),e)}async setOnlineStatusU(e){return await fe(this,Ke,"f").setOnlineStatusU(fe(this,We,"f"),e)}async sendSignal(e,t){return await fe(this,Ke,"f").sendSignal(fe(this,We,"f"),e,t)}async sendSignalU(e,t){return await fe(this,Ke,"f").sendSignalU(fe(this,We,"f"),e,t)}async sendBroadcast(e,t=!1){return await fe(this,Ke,"f").sendBroadcast(fe(this,We,"f"),e,t)}async sendBroadcastU(e,t=!1){return await fe(this,Ke,"f").sendBroadcastU(fe(this,We,"f"),e,t)}async addSignalHandler(e){await fe(this,Ke,"f").addSignalHandler(fe(this,We,"f"),e)}removeSignalHandler(e){fe(this,Ke,"f").removeSignalHandler(fe(this,We,"f"),e)}};Ke=new WeakMap,We=new WeakMap;var Hi=function(i,e,t,r){var n=arguments.length,a=n<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(i,e,t,r);else for(var o=i.length-1;o>=0;o--)(s=i[o])&&(a=(n<3?s(a):n>3?s(e,t,a):s(e,t))||a);return n>3&&a&&Object.defineProperty(e,t,a),a},Ki=function(i,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,e)},Ne=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)}};Hi([p(),Ki("design:type",String)],Ne.prototype,"source",void 0);Hi([p(),Ki("design:type",String)],Ne.prototype,"target",void 0);Hi([p(),Ki("design:type",String)],Ne.prototype,"predicate",void 0);Hi([p(),Ki("design:type",Date)],Ne.prototype,"fromDate",void 0);Hi([p(),Ki("design:type",Date)],Ne.prototype,"untilDate",void 0);Hi([p(),Ki("design:type",Number)],Ne.prototype,"limit",void 0);Ne=Hi([q(),$e(),Ki("design:paramtypes",[Object])],Ne);var Jo=function(i,e,t,r,n){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?i!==e||!n:!e.has(i))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?n.call(i,t):n?n.value=t:e.set(i,t),t},Te=function(i,e,t,r){if(t==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?i!==e||!r:!e.has(i))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?r:t==="a"?r.call(i):r?r.value:e.get(i)},Qe,Lt;function Bn(i){return encodeURIComponent(i).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`)}var Le=class{constructor(){Qe.set(this,void 0),Lt.set(this,void 0)}static fromUrl(e){if(!e||!e.startsWith("literal://"))throw new Error("Can't create Literal from non-literal URL");let t=new Le;return Jo(t,Lt,e,"f"),t}static from(e){let t=new Le;return Jo(t,Qe,e,"f"),t}toUrl(){if(Te(this,Lt,"f")&&!Te(this,Qe,"f"))return Te(this,Lt,"f");if(!Te(this,Lt,"f")&&(Te(this,Qe,"f")===void 0||Te(this,Qe,"f")===""||Te(this,Qe,"f")===null))throw new Error("Can't turn empty Literal into URL");let e;switch(typeof Te(this,Qe,"f")){case"string":e=`string:${Bn(Te(this,Qe,"f"))}`;break;case"number":e=`number:${Bn(Te(this,Qe,"f"))}`;break;case"boolean":e=`boolean:${Bn(Te(this,Qe,"f"))}`;break;case"object":e=`json:${Bn(JSON.stringify(Te(this,Qe,"f")))}`;break}return`literal://${e}`}get(){if(Te(this,Qe,"f"))return Te(this,Qe,"f");if(!Te(this,Lt,"f"))throw new Error("Can't render empty Literal");if(!Te(this,Lt,"f").startsWith("literal://"))throw new Error("Can't render Literal from non-literal URL");let e=Te(this,Lt,"f").substring(10);if(e.startsWith("string:"))return decodeURIComponent(e.substring(7));if(e.startsWith("number:")){let t=e.substring(7);return parseFloat(t)}if(e.startsWith("json:")){let t=e.substring(5);return JSON.parse(decodeURIComponent(t))}throw new Error(`Can't parse unknown literal: ${e}`)}};Qe=new WeakMap,Lt=new WeakMap;function Zt(i){return i.charAt(0).toUpperCase()+i.slice(1)}function oo(i){return`set${Zt(i)}`}function fr(i){return i.endsWith("y")?i.slice(0,-1)+"ies":i+"s"}function co(i){return i.endsWith("ies")?i.slice(0,-3)+"y":i.endsWith("s")?i.slice(0,-1):i}function bd(i){return`add${Zt(co(i))}`}function _d(i){let e=i.substring(3),t=fr(e);return t.charAt(0).toLowerCase()+t.slice(1)}function Sd(i){return`remove${Zt(co(i))}`}function wd(i){let e=i.substring(6),t=fr(e);return t.charAt(0).toLowerCase()+t.slice(1)}function Ed(i){let e=i.substring(13),t=fr(e);return t.charAt(0).toLowerCase()+t.slice(1)}function xd(i){return`setCollection${Zt(co(i))}`}function yi(i){if(Array.isArray(i))return`[${i.map(yi).join(", ")}]`;let e=Object.keys(i),t=[];for(let r of e){let n=JSON.stringify(i[r]),a=`${r}: ${n}`;t.push(a)}return`{${t.join(", ")}}`}var gs=function(i,e,t,r,n){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?i!==e||!n:!e.has(i))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?n.call(i,t):n?n.value=t:e.set(i,t),t},W=function(i,e,t,r){if(t==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?i!==e||!r:!e.has(i))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?r:t==="a"?r.call(i):r?r.value:e.get(i)},Be,qe,he,hr=class{constructor(i,e,t){Be.set(this,void 0),qe.set(this,void 0),he.set(this,void 0),gs(this,Be,e,"f"),gs(this,qe,t,"f"),gs(this,he,i,"f")}get baseExpression(){return W(this,Be,"f")}async init(){let isInstance=await W(this,he,"f").isSubjectInstance(W(this,Be,"f"),W(this,qe,"f"));if(!isInstance)throw`Not a valid subject instance of ${W(this,qe,"f")} for ${W(this,Be,"f")}`;let results=await W(this,he,"f").infer(`subject_class("${W(this,qe,"f")}", C), property(C, Property)`),properties=results.map(i=>i.Property);for(let i of properties)await W(this,he,"f").infer(`subject_class("${W(this,qe,"f")}", C), property_resolve(C, "${i}")`),Object.defineProperty(this,i,{configurable:!0,get:async()=>{try{return await W(this,he,"f").getPropertyValueViaSurreal(W(this,Be,"f"),W(this,qe,"f"),i)}catch(e){console.warn(`Failed to get property ${i} via SurrealDB:`,e);return}}});let setters=await W(this,he,"f").infer(`subject_class("${W(this,qe,"f")}", C), property_setter(C, Property, Setter)`);for(let setter of setters||[])if(setter){let property=setter.Property,actions=eval(setter.Setter),resolveLanguageResults=await W(this,he,"f").infer(`subject_class("${W(this,qe,"f")}", C), property_resolve_language(C, "${property}", Language)`),resolveLanguage;resolveLanguageResults&&resolveLanguageResults.length>0&&(resolveLanguage=resolveLanguageResults[0].Language),this[oo(property)]=async i=>{resolveLanguage&&(i=await W(this,he,"f").createExpression(i,resolveLanguage)),await W(this,he,"f").executeAction(actions,W(this,Be,"f"),[{name:"value",value:i}])}}let results2=await W(this,he,"f").infer(`subject_class("${W(this,qe,"f")}", C), collection(C, Collection)`);results2||(results2=[]);let collections=results2.map(i=>i.Collection);for(let i of collections)Object.defineProperty(this,i,{configurable:!0,get:async()=>{try{return await W(this,he,"f").getCollectionValuesViaSurreal(W(this,Be,"f"),W(this,qe,"f"),i)}catch(e){return console.warn(`Failed to get collection ${i} via SurrealDB:`,e),[]}}});let adders=await W(this,he,"f").infer(`subject_class("${W(this,qe,"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[bd(collection)]=async i=>{Array.isArray(i)?await Promise.all(i.map(e=>W(this,he,"f").executeAction(actions,W(this,Be,"f"),[{name:"value",value:e}]))):await W(this,he,"f").executeAction(actions,W(this,Be,"f"),[{name:"value",value:i}])}}let removers=await W(this,he,"f").infer(`subject_class("${W(this,qe,"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[Sd(collection)]=async i=>{Array.isArray(i)?await Promise.all(i.map(e=>W(this,he,"f").executeAction(actions,W(this,Be,"f"),[{name:"value",value:e}]))):await W(this,he,"f").executeAction(actions,W(this,Be,"f"),[{name:"value",value:i}])}}let collectionSetters=await W(this,he,"f").infer(`subject_class("${W(this,qe,"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[xd(collection)]=async i=>{Array.isArray(i)?await W(this,he,"f").executeAction(actions,W(this,Be,"f"),i.map(e=>({name:"value",value:e}))):await W(this,he,"f").executeAction(actions,W(this,Be,"f"),[{name:"value",value:i}])}}}};Be=new WeakMap,qe=new WeakMap,he=new WeakMap;function Yo(i){return i?.length?i.length===1?i.toString():i.length===2?i.join(" and "):i.slice(0,-1).join(", ")+", and "+i.slice(-1):""}function bl(i){let e=i.can.includes("*")?["READ","WRITE","UPDATE"]:i.can,t=i.with.domain==="*"?"":i.with.domain,r=i.with.pointers.includes("*")?["all AD4M data"]:i.with.pointers;return`${Yo(e)} your ${t} actions, with access to ${Yo(r)}`}function oe(i){return i.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")}var re=function(i,e,t,r,n){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?i!==e||!n:!e.has(i))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?n.call(i,t):n?n.value=t:e.set(i,t),t},_=function(i,e,t,r){if(t==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?i!==e||!r:!e.has(i))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?r:t==="a"?r.call(i):r?r.value:e.get(i)},aa,Pt,vt,bt,$i,zt,Ht,vi,Br,sa,bi,_i,st,ur,Fs,X,te,Si,wi,Ei,qr,ka=class{constructor(e,t,r){aa.add(this),Pt.set(this,void 0),vt.set(this,void 0),bt.set(this,void 0),$i.set(this,void 0),zt.set(this,void 0),Ht.set(this,void 0),vi.set(this,void 0),Br.set(this,!1),sa.set(this,void 0),bi.set(this,void 0),_i.set(this,void 0),st.set(this,void 0),ur.set(this,void 0),this.isSurrealDB=!1,re(this,Pt,e,"f"),re(this,ur,t,"f"),re(this,bt,r,"f"),re(this,$i,new Set,"f"),re(this,vi,null,"f"),re(this,sa,new Promise((n,a)=>{re(this,bi,n,"f"),re(this,_i,a,"f")}),"f")}async subscribe(){_(this,Ht,"f")&&(_(this,Ht,"f").call(this),re(this,Ht,void 0,"f")),_(this,st,"f")&&(clearTimeout(_(this,st,"f")),re(this,st,void 0,"f")),_(this,zt,"f")&&(clearTimeout(_(this,zt,"f")),re(this,zt,void 0,"f"));try{let t;this.isSurrealDB?t=await _(this,bt,"f").perspectiveSubscribeSurrealQuery(_(this,Pt,"f"),_(this,ur,"f")):t=await _(this,bt,"f").subscribeQuery(_(this,Pt,"f"),_(this,ur,"f")),re(this,vt,t.subscriptionId,"f"),t.result?(re(this,vi,t.result,"f"),_(this,aa,"m",Fs).call(this,t.result)):console.warn("\u26A0\uFE0F No initial result returned from subscribeQuery!"),re(this,st,setTimeout(()=>{console.error("Subscription initialization timed out after 30 seconds. Resubscribing..."),this.subscribe().catch(r=>{console.error("Error during subscription retry after timeout:",r)})},3e4),"f"),re(this,Ht,_(this,bt,"f").subscribeToQueryUpdates(_(this,vt,"f"),r=>{_(this,st,"f")&&(clearTimeout(_(this,st,"f")),re(this,st,void 0,"f")),_(this,bi,"f")&&(_(this,bi,"f").call(this,!0),re(this,bi,void 0,"f"),re(this,_i,void 0,"f")),!(r.isInit&&_(this,vi,"f"))&&(re(this,vi,r,"f"),_(this,aa,"m",Fs).call(this,r))}),"f")}catch(t){throw console.error("Error setting up subscription:",t),_(this,_i,"f")&&(_(this,_i,"f").call(this,t),re(this,bi,void 0,"f"),re(this,_i,void 0,"f")),t}let e=async()=>{if(!_(this,Br,"f")){try{this.isSurrealDB?await _(this,bt,"f").perspectiveKeepAliveSurrealQuery(_(this,Pt,"f"),_(this,vt,"f")):await _(this,bt,"f").keepAliveQuery(_(this,Pt,"f"),_(this,vt,"f"))}catch(t){console.error("Error in keepalive:",t),console.log("Reinitializing subscription for query:",_(this,ur,"f"));try{await this.subscribe(),console.log("Subscription reinitialized")}catch(r){console.error("Error during resubscription from keepalive:",r);return}}_(this,Br,"f")||re(this,zt,setTimeout(e,3e4),"f")}};re(this,zt,setTimeout(e,3e4),"f")}get id(){return _(this,vt,"f")}get initialized(){return _(this,sa,"f")}get result(){return _(this,vi,"f")}onResult(e){return _(this,$i,"f").add(e),()=>_(this,$i,"f").delete(e)}dispose(){re(this,Br,!0,"f"),clearTimeout(_(this,zt,"f")),_(this,Ht,"f")&&_(this,Ht,"f").call(this),_(this,$i,"f").clear(),_(this,st,"f")&&(clearTimeout(_(this,st,"f")),re(this,st,void 0,"f")),_(this,vt,"f")&&(this.isSurrealDB?_(this,bt,"f").perspectiveDisposeSurrealQuerySubscription(_(this,Pt,"f"),_(this,vt,"f")).catch(e=>console.error("Error disposing surreal query subscription:",e)):_(this,bt,"f").disposeQuerySubscription(_(this,Pt,"f"),_(this,vt,"f")).catch(e=>console.error("Error disposing query subscription:",e)))}};Pt=new WeakMap,vt=new WeakMap,bt=new WeakMap,$i=new WeakMap,zt=new WeakMap,Ht=new WeakMap,vi=new WeakMap,Br=new WeakMap,sa=new WeakMap,bi=new WeakMap,_i=new WeakMap,st=new WeakMap,ur=new WeakMap,aa=new WeakSet,Fs=function i(e){for(let t of _(this,$i,"f"))try{t(e)}catch(r){console.error("Error in query subscription callback:",r)}};var pr=class{constructor(i,e){X.set(this,void 0),te.set(this,void 0),Si.set(this,void 0),wi.set(this,void 0),Ei.set(this,void 0),qr.set(this,void 0),re(this,Si,[],"f"),re(this,wi,[],"f"),re(this,Ei,[],"f"),re(this,qr,[],"f"),re(this,X,i,"f"),re(this,te,e,"f"),this.uuid=_(this,X,"f").uuid,this.name=_(this,X,"f").name,this.owners=_(this,X,"f").owners,this.sharedUrl=_(this,X,"f").sharedUrl,this.neighbourhood=_(this,X,"f").neighbourhood,this.state=_(this,X,"f").state,_(this,te,"f").addPerspectiveLinkAddedListener(_(this,X,"f").uuid,_(this,Si,"f")),_(this,te,"f").addPerspectiveLinkRemovedListener(_(this,X,"f").uuid,_(this,wi,"f")),_(this,te,"f").addPerspectiveLinkUpdatedListener(_(this,X,"f").uuid,_(this,Ei,"f")),_(this,te,"f").addPerspectiveSyncStateChangeListener(_(this,X,"f").uuid,_(this,qr,"f"))}escapeRegExp(i){return i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}async executeAction(i,e,t,r){return await _(this,te,"f").executeCommands(_(this,X,"f").uuid,JSON.stringify(i),e,JSON.stringify(t),r)}async get(i){return await _(this,te,"f").queryLinks(_(this,X,"f").uuid,i)}async infer(i){return await _(this,te,"f").queryProlog(_(this,X,"f").uuid,i)}async querySurrealDB(i){return await _(this,te,"f").querySurrealDB(_(this,X,"f").uuid,i)}async add(i,e="shared",t){return await _(this,te,"f").addLink(_(this,X,"f").uuid,i,e,t)}async addLinks(i,e="shared",t){return await _(this,te,"f").addLinks(_(this,X,"f").uuid,i,e,t)}async removeLinks(i,e){return await _(this,te,"f").removeLinks(_(this,X,"f").uuid,i,e)}async linkMutations(i,e="shared"){return await _(this,te,"f").linkMutations(_(this,X,"f").uuid,i,e)}async addLinkExpression(i,e="shared",t){return await _(this,te,"f").addLinkExpression(_(this,X,"f").uuid,i,e,t)}async update(i,e,t){return await _(this,te,"f").updateLink(_(this,X,"f").uuid,i,e,t)}async remove(i,e){return await _(this,te,"f").removeLink(_(this,X,"f").uuid,i,e)}async createBatch(){return await _(this,te,"f").createBatch(_(this,X,"f").uuid)}async commitBatch(i){return await _(this,te,"f").commitBatch(_(this,X,"f").uuid,i)}async getExpression(i){return await _(this,te,"f").getExpression(i)}async createExpression(i,e){return await _(this,te,"f").createExpression(i,e)}async addListener(i,e){i==="link-added"?_(this,Si,"f").push(e):i==="link-removed"?_(this,wi,"f").push(e):i==="link-updated"&&_(this,Ei,"f").push(e)}async addSyncStateChangeListener(i){_(this,qr,"f").push(i)}async removeListener(i,e){if(i==="link-added"){let t=_(this,Si,"f").indexOf(e);_(this,Si,"f").splice(t,1)}else if(i==="link-removed"){let t=_(this,wi,"f").indexOf(e);_(this,wi,"f").splice(t,1)}else if(i==="link-updated"){let t=_(this,Ei,"f").indexOf(e);_(this,Ei,"f").splice(t,1)}}async snapshot(){return _(this,te,"f").snapshotByUUID(_(this,X,"f").uuid)}async loadSnapshot(i){let e=JSON.parse(JSON.stringify(i));delete e.__typename,e.links.forEach(t=>{delete t.data.__typename});for(let t of e.links)await this.addLinkExpression(t)}async getSingleTarget(i){delete i.target;let e=await this.get(i);return e.length?e[0].data.target:null}async setSingleTarget(i,e="shared"){let t=new Ne({source:i.source,predicate:i.predicate}),r=await this.get(t),n=[];for(let s of r)delete s.__typename,delete s.data.__typename,delete s.proof.__typename,n.push(s);let a=[i];await this.linkMutations({additions:a,removals:n},e)}async sdnaFlows(){return(await this.infer("register_sdna_flow(X, _)")).map(e=>e.X)}async availableFlows(i){return(await this.infer(`flowable("${i}", F), register_sdna_flow(X, F)`)).map(t=>t.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(i,e){return(await this.infer(`register_sdna_flow("${i}", F), flow_state(X, ${e}, F)`)).map(r=>r.X)}async flowState(i,e){return(await this.infer(`register_sdna_flow("${i}", F), flow_state("${e}", X, F)`))[0].X}async flowActions(i,e){return(await this.infer(`register_sdna_flow("${i}", Flow), flow_state("${e}", State, Flow), action(State, Name, _, _)`)).map(r=>r.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 i=["ad4m://has_subject_class","ad4m://has_flow","ad4m://has_custom_sdna"],e=[];for(let t of i){let r=await this.get(new Ne({source:"ad4m://self",predicate:t}));for(let n of r){let a=n.data.target,s=await this.get(new Ne({source:a,predicate:"ad4m://sdna"}));for(let o of s){let l=Le.fromUrl(o.data.target).get();typeof l=="string"&&e.push(l)}}}return e}async getSdnaForClass(i){let e=Le.from(i);if((await this.get(new Ne({source:"ad4m://self",target:e.toUrl(),predicate:"ad4m://has_subject_class"}))).length===0)return null;let r=await this.get(new Ne({source:e.toUrl(),predicate:"ad4m://sdna"}));if(r.length===0)return null;let n=Le.fromUrl(r[0].data.target).get();return typeof n=="string"?n:null}async addSdna(i,e,t){return _(this,te,"f").addSdna(_(this,X,"f").uuid,i,e,t)}async subjectClasses(){try{return(await this.infer("subject_class(X, _)")).map(i=>i.X)}catch{return[]}}async stringOrTemplateObjectToSubjectClassName(i){if(typeof i=="string")return i;{let e=await this.subjectClassesByTemplate(i);return e[0]?e[0]:i.className}}async createSubject(i,e,t,r){let n;if(typeof i=="string")n=i,await _(this,te,"f").createSubject(_(this,X,"f").uuid,JSON.stringify({className:n,initialValues:t}),e,t?JSON.stringify(t):void 0,r);else{let a=this.buildQueryFromTemplate(i);await _(this,te,"f").createSubject(_(this,X,"f").uuid,JSON.stringify({query:a,initialValues:t}),e,t?JSON.stringify(t):void 0,r)}return r?e:this.getSubjectProxy(e,i)}async getSubjectData(i,e){if(typeof i=="string")return JSON.parse(await _(this,te,"f").getSubjectData(_(this,X,"f").uuid,JSON.stringify({className:i}),e));let t=this.buildQueryFromTemplate(i);return JSON.parse(await _(this,te,"f").getSubjectData(_(this,X,"f").uuid,JSON.stringify({query:t}),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(i,e){let t=await this.stringOrTemplateObjectToSubjectClassName(e),r=await this.getSubjectClassMetadataFromSDNA(t);if(!r)try{let n=t.replace(/"/g,'\\"'),a=i.replace(/"/g,'\\"'),s=await this.infer(`subject_class("${n}", C), instance(C, "${a}")`);return s&&s.length>0}catch(n){return console.warn(`Failed to check instance via Prolog for class ${t}:`,n),!1}if(r.requiredTriples.length===0){let a=`SELECT count() AS count FROM link WHERE in.uri = '${oe(i)}'`,o=(await this.querySurrealDB(a))[0]?.count??0;return(typeof o=="object"&&o?.Int!==void 0?o.Int:o)>0}for(let n of r.requiredTriples){let a=oe(i),s=oe(n.predicate),o;if(n.target){let m=oe(n.target);o=`SELECT count() AS count FROM link WHERE in.uri = '${a}' AND predicate = '${s}' AND out.uri = '${m}'`}else o=`SELECT count() AS count FROM link WHERE in.uri = '${a}' AND predicate = '${s}'`;let l=await this.querySurrealDB(o);if(!l||l.length===0)return!1;let c=l[0]?.count??0;if((typeof c=="object"&&c?.Int!==void 0?c.Int:c)===0)return!1}return!0}async getSubjectProxy(i,e){if(!await this.isSubjectInstance(i,e))throw`Expression ${i} is not a subject instance of given class: ${JSON.stringify(e)}`;let t=await this.stringOrTemplateObjectToSubjectClassName(e),r=new hr(this,i,t);return await r.init(),r}async getSubjectClassMetadataFromSDNA(i){try{let e=await this.get(new Ne({source:Le.from(i).toUrl(),predicate:"ad4m://sdna"}));if(!e||e.length===0)return console.warn(`No SDNA found for class ${i}`),null;if(!e[0].data.target)return console.error(`SDNA link for ${i} has no target:`,e[0]),null;let t=Le.fromUrl(e[0].data.target).get(),r=[],n=/instance\([^)]+\)\s*:-\s*([^.]+)\./g,a,s=!1;for(;(a=n.exec(t))!==null;){s=!0;let h=a[1],d=/triple\([^,]+,\s*"([^"]+)",\s*(?:"([^"]+)"|_)\)/g,g;for(;(g=d.exec(h))!==null;){let v=g[1],E=g[2];r.push({predicate:v,target:E})}}s||console.warn(`No instance rule found in SDNA for ${i}`);let o=r.map(h=>h.predicate),l=new Map,c=await this.infer(`subject_class("${i}", C), property(C, P)`);if(c)for(let h of c){let d=h.P,g=null,v=await this.infer(`subject_class("${i}", C), property_setter(C, "${d}", Setter)`);if(v&&v.length>0){let A=v[0].Setter.match(/predicate:\s*"([^"]+)"|predicate:\s*([^,}\]]+)/);A&&(g=A[1]||A[2])}if(!g){let E=this.escapeRegExp(d),A=t.match(new RegExp(`property_getter\\([^,]+,\\s*[^,]+,\\s*"${E}"[^)]*\\)\\s*:-\\s*triple\\([^,]+,\\s*"([^"]+)"`));A&&(g=A[1])}if(g){let E=await this.infer(`subject_class("${i}", C), property_resolve_language(C, "${d}", Lang)`),A=E&&E.length>0?E[0].Lang:void 0;l.set(d,{predicate:g,resolveLanguage:A})}}let u=new Map,m=await this.infer(`subject_class("${i}", C), collection(C, Coll)`);if(m)for(let h of m){let d=h.Coll,g=null,v,E,A=await this.infer(`subject_class("${i}", C), collection_adder(C, "${d}", Adder)`);if(A&&A.length>0){let G=A[0].Adder.match(/predicate:\s*"([^"]+)"|predicate:\s*([^,}\]]+)/);G&&(g=G[1]||G[2])}let C=this.escapeRegExp(d),O=new RegExp(`collection_getter\\([^,]+,\\s*[^,]+,\\s*"${C}"[^)]*\\)\\s*:-[^.]+\\.`),$=t.match(O);if($){let T=$[0],G=/(?:setof|findall)\([^,]+,\s*(.+),\s*\w+\)\./,I=T.match(G);if(I){let K=I[1];if(K.startsWith("(")&&K.endsWith(")")&&(K=K.substring(1,K.length-1)),!g){let k=K.match(/triple\([^,]+,\s*"([^"]+)"/);k&&(g=k[1])}let N=K.match(/subject_class\("([^"]+)"/);N&&(v=N[1])}}g&&u.set(d,{predicate:g,instanceFilter:v,condition:E})}return{requiredPredicates:o,requiredTriples:r,properties:l,collections:u}}catch(e){return console.error(`Error getting metadata for ${i}:`,e),null}}generateSurrealInstanceQuery(i){return i.requiredTriples.length===0?"SELECT DISTINCT uri AS base FROM node WHERE count(->link) > 0":`SELECT uri AS base FROM node WHERE ${i.requiredTriples.map(t=>{let r=oe(t.predicate);if(t.target){let n=oe(t.target);return`count(->link[WHERE predicate = '${r}' AND out.uri = '${n}']) > 0`}else return`count(->link[WHERE predicate = '${r}']) > 0`}).join(" AND ")}`}async getPropertyValueViaSurreal(i,e,t){let r=await this.getSubjectClassMetadataFromSDNA(e);if(!r)return;let n=r.properties.get(t);if(!n)return;let a=oe(i),s=oe(n.predicate),o=`SELECT out.uri AS value FROM link WHERE in.uri = '${a}' AND predicate = '${s}' LIMIT 1`,l=await this.querySurrealDB(o);if(!l||l.length===0)return;let c=l[0].value;if(n.resolveLanguage&&c)try{let u=await this.getExpression(c);try{return JSON.parse(u.data)}catch{return u.data}}catch{return c}return c}async getCollectionValuesViaSurreal(i,e,t){let r=await this.getSubjectClassMetadataFromSDNA(e);if(!r)return[];let n=r.collections.get(t);if(!n)return[];let a=oe(i),s=oe(n.predicate),o=`SELECT out.uri AS value, timestamp FROM link WHERE in.uri = '${a}' AND predicate = '${s}' ORDER BY timestamp ASC`,l=await this.querySurrealDB(o);if(!l||l.length===0)return[];let c=l.map(u=>u.value).filter(u=>u!==""&&u!=="");if(n.condition&&c.length>0)try{let u=[];for(let m of c){let h=n.condition.replace(/\$perspective/g,`'${this.uuid}'`).replace(/\$base/g,`'${i}'`).replace(/Target/g,`'${m.replace(/'/g,"\\'")}'`);h.trim().startsWith("WHERE")&&(h=`array::len(SELECT * FROM link ${h}) > 0`);let d=await this.querySurrealDB(`RETURN ${h}`);(d===!0||Array.isArray(d)&&d.length>0&&d[0]===!0)&&u.push(m)}c=u}catch(u){console.warn(`Failed to apply condition filter for ${t}:`,u)}if(n.instanceFilter)try{let u=await this.getSubjectClassMetadataFromSDNA(n.instanceFilter);return u?await this.batchCheckSubjectInstances(c,u):this.filterInstancesSequential(c,n.instanceFilter)}catch{return this.filterInstancesSequential(c,n.instanceFilter)}return c}async batchCheckSubjectInstances(i,e){if(i.length===0)return[];if(e.requiredTriples.length===0){let a=`SELECT in.uri AS uri FROM link WHERE in.uri IN [${i.map(o=>`'${oe(o)}'`).join(", ")}] GROUP BY in.uri HAVING count() > 0`;return(await this.querySurrealDB(a)).map(o=>o.uri)}let t=[];for(let n of e.requiredTriples){let a=i.map(c=>`'${oe(c)}'`).join(", "),s=oe(n.predicate),o;if(n.target){let c=oe(n.target);o=`SELECT in.uri AS uri FROM link WHERE in.uri IN [${a}] AND predicate = '${s}' AND out.uri = '${c}'`}else o=`SELECT in.uri AS uri FROM link WHERE in.uri IN [${a}] AND predicate = '${s}'`;let l=await this.querySurrealDB(o);t.push(new Set(l.map(c=>c.uri)))}return t.length===0?i:i.filter(n=>t.every(a=>a.has(n)))}async filterInstancesSequential(i,e){let t=[];for(let r of i)try{await this.isSubjectInstance(r,e)&&t.push(r)}catch{continue}return t}async getAllSubjectInstances(i){let e=[];typeof i=="string"?e=[i]:e=await this.subjectClassesByTemplate(i);let t=[];for(let r of e){let n=await this.getSubjectClassMetadataFromSDNA(r);if(n){let a=this.generateSurrealInstanceQuery(n),s=await this.querySurrealDB(a);for(let o of s||[])try{let l=new hr(this,o.base,r);await l.init(),t.push(l)}catch{}}}return t}async getAllSubjectProxies(i){let e=[];typeof i=="string"?e=[i]:e=await this.subjectClassesByTemplate(i);let t=[];for(let r of e){let n=await this.getSubjectClassMetadataFromSDNA(r);if(n){let a=this.generateSurrealInstanceQuery(n),s=await this.querySurrealDB(a);for(let o of s||[])try{let l=new hr(this,o.base,r);await l.init(),t.push(l)}catch{}}}return t}buildQueryFromTemplate(i){let e;return function(t){let r=[],n=[];Object.getPrototypeOf(t).__properties?Object.keys(Object.getPrototypeOf(t).__properties).forEach(u=>r.push(u)):r.push(...Object.keys(t).filter(u=>!Array.isArray(t[u]))),Object.getPrototypeOf(t).__collections?Object.keys(Object.getPrototypeOf(t).__collections).filter(u=>u!=="isSubjectInstance").forEach(u=>{n.includes(u)||n.push(u)}):n.push(...Object.keys(t).filter(u=>Array.isArray(t[u])).filter(u=>u!=="isSubjectInstance"));let a=Object.getOwnPropertyNames(t).filter(u=>typeof t[u]=="function"&&u.startsWith("set")&&!u.startsWith("setCollection"));a=a.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(t)).filter(u=>{let m=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(t),u);return m&&typeof m.value=="function"&&u.startsWith("set")&&!u.startsWith("setCollection")}));let s=Object.getOwnPropertyNames(t).filter(u=>Object.prototype.hasOwnProperty.call(t,u)&&typeof t[u]=="function"&&u.startsWith("add"));s=s.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(t)).filter(u=>{let m=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(t),u);return m&&typeof m.value=="function"&&u.startsWith("add")}));let o=Object.getOwnPropertyNames(t).filter(u=>Object.prototype.hasOwnProperty.call(t,u)&&typeof t[u]=="function"&&u.startsWith("remove"));o=o.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(t)).filter(u=>{let m=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(t),u);return m&&typeof m.value=="function"&&u.startsWith("remove")}));let l=Object.getOwnPropertyNames(t).filter(u=>Object.prototype.hasOwnProperty.call(t,u)&&typeof t[u]=="function"&&u.startsWith("setCollection"));l=l.concat(Object.getOwnPropertyNames(Object.getPrototypeOf(t)).filter(u=>{let m=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(t),u);return m&&typeof m.value=="function"&&u.startsWith("setCollection")}));let c="subject_class(Class, C)";for(let u of r)c+=`, property(C, "${u}")`;for(let u of n)c+=`, collection(C, "${u}")`;for(let u of a){let m=u.substring(3);m=m.charAt(0).toLowerCase()+m.slice(1),c+=`, property_setter(C, "${m}", _)`}for(let u of s)c+=`, collection_adder(C, "${_d(u)}", _)`;for(let u of o)c+=`, collection_remover(C, "${wd(u)}", _)`;for(let u of l)c+=`, collection_setter(C, "${Ed(u)}", _)`;c+=".",e=c}(i),e}async subjectClassesByTemplate(i){let e=this.buildQueryFromTemplate(i),t=await this.infer(e);return t?t.map(r=>r.Class):[]}async ensureSDNASubjectClass(i){if((await this.subjectClassesByTemplate(new i)).length>0)return;let{name:t,sdna:r}=i.generateSDNA();await this.addSdna(t,r,"subject_class")}getNeighbourhoodProxy(){return _(this,te,"f").getNeighbourhoodProxy(_(this,X,"f").uuid)}get ai(){return _(this,te,"f").aiClient}async subscribeInfer(i){let e=new ka(this.uuid,i,_(this,te,"f"));return await e.subscribe(),await e.initialized,e}async subscribeSurrealDB(i){let e=new ka(this.uuid,i,_(this,te,"f"));return e.isSurrealDB=!0,await e.subscribe(),await e.initialized,e}};X=new WeakMap,te=new WeakMap,Si=new WeakMap,wi=new WeakMap,Ei=new WeakMap,qr=new WeakMap;var Bt=function(i,e,t,r,n){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?i!==e||!n:!e.has(i))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?n.call(i,t):n?n.value=t:e.set(i,t),t},U=function(i,e,t,r){if(t==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?i!==e||!r:!e.has(i))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?r:t==="a"?r.call(i):r?r.value:e.get(i)},Q,Vr,zr,Hr,oa,Kr,ca,la,je=`
441
441
  author
442
442
  timestamp
443
443
  status
@@ -464,7 +464,7 @@ neighbourhood {
464
464
  }
465
465
  author
466
466
  }
467
- `,Ta=class{constructor(e,t=!0){Q.set(this,void 0),Vr.set(this,void 0),zr.set(this,void 0),Hr.set(this,void 0),oa.set(this,void 0),Gr.set(this,void 0),ca.set(this,void 0),la.set(this,void 0),Bt(this,Q,e,"f"),Bt(this,Vr,[],"f"),Bt(this,zr,[],"f"),Bt(this,Hr,[],"f"),Bt(this,oa,[],"f"),t&&(this.subscribePerspectiveAdded(),this.subscribePerspectiveUpdated(),this.subscribePerspectiveRemoved())}setExpressionClient(e){Bt(this,Gr,e,"f")}setNeighbourhoodClient(e){Bt(this,ca,e,"f")}setAIClient(e){Bt(this,la,e,"f")}get aiClient(){return U(this,la,"f")}async all(){let{perspectives:e}=b(await U(this,Q,"f").query({query:y`query perspectives {
467
+ `,Ta=class{constructor(e,t=!0){Q.set(this,void 0),Vr.set(this,void 0),zr.set(this,void 0),Hr.set(this,void 0),oa.set(this,void 0),Kr.set(this,void 0),ca.set(this,void 0),la.set(this,void 0),Bt(this,Q,e,"f"),Bt(this,Vr,[],"f"),Bt(this,zr,[],"f"),Bt(this,Hr,[],"f"),Bt(this,oa,[],"f"),t&&(this.subscribePerspectiveAdded(),this.subscribePerspectiveUpdated(),this.subscribePerspectiveRemoved())}setExpressionClient(e){Bt(this,Kr,e,"f")}setNeighbourhoodClient(e){Bt(this,ca,e,"f")}setAIClient(e){Bt(this,la,e,"f")}get aiClient(){return U(this,la,"f")}async all(){let{perspectives:e}=b(await U(this,Q,"f").query({query:y`query perspectives {
468
468
  perspectives {
469
469
  ${nr}
470
470
  }
@@ -474,13 +474,13 @@ neighbourhood {
474
474
  }
475
475
  }`,variables:{uuid:e}}));return t?new pr(t,this):null}async snapshotByUUID(e){let{perspectiveSnapshot:t}=b(await U(this,Q,"f").query({query:y`query perspectiveSnapshot($uuid: String!) {
476
476
  perspectiveSnapshot(uuid: $uuid) {
477
- links { ${Fe} }
477
+ links { ${je} }
478
478
  }
479
479
  }`,variables:{uuid:e}}));return t}async publishSnapshotByUUID(e){let{perspectivePublishSnapshot:t}=b(await U(this,Q,"f").mutate({mutation:y`mutation perspectivePublishSnapshot($uuid: String!) {
480
480
  perspectivePublishSnapshot(uuid: $uuid)
481
481
  }`,variables:{uuid:e}}));return t}async queryLinks(e,t){let{perspectiveQueryLinks:r}=b(await U(this,Q,"f").query({query:y`query perspectiveQueryLinks($uuid: String!, $query: LinkQuery!) {
482
482
  perspectiveQueryLinks(query: $query, uuid: $uuid) {
483
- ${Fe}
483
+ ${je}
484
484
  }
485
485
  }`,variables:{uuid:e,query:t}}));return r}async queryProlog(e,t){let{perspectiveQueryProlog:r}=b(await U(this,Q,"f").query({query:y`query perspectiveQueryProlog($uuid: String!, $query: String!) {
486
486
  perspectiveQueryProlog(uuid: $uuid, query: $query)
@@ -491,12 +491,12 @@ neighbourhood {
491
491
  subscriptionId
492
492
  result
493
493
  }
494
- }`,variables:{uuid:e,query:t}})),{subscriptionId:n,result:a}=r,s=a,o=!1;s.startsWith("#init#")&&(s=s.substring(6),o=!0);try{s=JSON.parse(s)}catch(c){console.error("Error parsing perspectiveSubscribeQuery result:",c)}return{subscriptionId:n,result:s,isInit:o}}async perspectiveSubscribeSurrealQuery(e,t){let{perspectiveSubscribeSurrealQuery:r}=b(await U(this,Q,"f").mutate({mutation:y`mutation perspectiveSubscribeSurrealQuery($uuid: String!, $query: String!) {
494
+ }`,variables:{uuid:e,query:t}})),{subscriptionId:n,result:a}=r,s=a,o=!1;s.startsWith("#init#")&&(s=s.substring(6),o=!0);try{s=JSON.parse(s)}catch(l){console.error("Error parsing perspectiveSubscribeQuery result:",l)}return{subscriptionId:n,result:s,isInit:o}}async perspectiveSubscribeSurrealQuery(e,t){let{perspectiveSubscribeSurrealQuery:r}=b(await U(this,Q,"f").mutate({mutation:y`mutation perspectiveSubscribeSurrealQuery($uuid: String!, $query: String!) {
495
495
  perspectiveSubscribeSurrealQuery(uuid: $uuid, query: $query) {
496
496
  subscriptionId
497
497
  result
498
498
  }
499
- }`,variables:{uuid:e,query:t}})),{subscriptionId:n,result:a}=r,s=a,o=!1;s.startsWith("#init#")&&(s=s.substring(6),o=!0);try{s=JSON.parse(s)}catch(c){console.error("Error parsing perspectiveSubscribeSurrealQuery result:",c)}return{subscriptionId:n,result:s,isInit:o}}async perspectiveKeepAliveSurrealQuery(e,t){let{perspectiveKeepAliveSurrealQuery:r}=b(await U(this,Q,"f").mutate({mutation:y`mutation perspectiveKeepAliveSurrealQuery($uuid: String!, $subscriptionId: String!) {
499
+ }`,variables:{uuid:e,query:t}})),{subscriptionId:n,result:a}=r,s=a,o=!1;s.startsWith("#init#")&&(s=s.substring(6),o=!0);try{s=JSON.parse(s)}catch(l){console.error("Error parsing perspectiveSubscribeSurrealQuery result:",l)}return{subscriptionId:n,result:s,isInit:o}}async perspectiveKeepAliveSurrealQuery(e,t){let{perspectiveKeepAliveSurrealQuery:r}=b(await U(this,Q,"f").mutate({mutation:y`mutation perspectiveKeepAliveSurrealQuery($uuid: String!, $subscriptionId: String!) {
500
500
  perspectiveKeepAliveSurrealQuery(uuid: $uuid, subscriptionId: $subscriptionId)
501
501
  }`,variables:{uuid:e,subscriptionId:t}}));return r}async perspectiveDisposeSurrealQuerySubscription(e,t){let{perspectiveDisposeSurrealQuerySubscription:r}=b(await U(this,Q,"f").mutate({mutation:y`mutation perspectiveDisposeSurrealQuerySubscription($uuid: String!, $subscriptionId: String!) {
502
502
  perspectiveDisposeSurrealQuerySubscription(uuid: $uuid, subscriptionId: $subscriptionId)
@@ -520,32 +520,32 @@ neighbourhood {
520
520
  perspectiveRemove(uuid: $uuid)
521
521
  }`,variables:{uuid:e}}))}async addLink(e,t,r="shared",n){let{perspectiveAddLink:a}=b(await U(this,Q,"f").mutate({mutation:y`mutation perspectiveAddLink($uuid: String!, $link: LinkInput!, $status: String!, $batchId: String) {
522
522
  perspectiveAddLink(uuid: $uuid, link: $link, status: $status, batchId: $batchId) {
523
- ${Fe}
523
+ ${je}
524
524
  }
525
525
  }`,variables:{uuid:e,link:t,status:r,batchId:n}}));return a}async addLinks(e,t,r="shared",n){let{perspectiveAddLinks:a}=b(await U(this,Q,"f").mutate({mutation:y`mutation perspectiveAddLinks($uuid: String!, $links: [LinkInput!]!, $status: String!, $batchId: String) {
526
526
  perspectiveAddLinks(uuid: $uuid, links: $links, status: $status, batchId: $batchId) {
527
- ${Fe}
527
+ ${je}
528
528
  }
529
529
  }`,variables:{uuid:e,links:t,status:r,batchId:n}}));return a}async removeLinks(e,t,r){let{perspectiveRemoveLinks:n}=b(await U(this,Q,"f").mutate({mutation:y`mutation perspectiveRemoveLinks($uuid: String!, $links: [LinkExpressionInput!]!, $batchId: String) {
530
530
  perspectiveRemoveLinks(uuid: $uuid, links: $links, batchId: $batchId) {
531
- ${Fe}
531
+ ${je}
532
532
  }
533
533
  }`,variables:{uuid:e,links:t,batchId:r}}));return n}async linkMutations(e,t,r){let{perspectiveLinkMutations:n}=b(await U(this,Q,"f").mutate({mutation:y`mutation perspectiveLinkMutations($uuid: String!, $mutations: LinkMutations!, $status: String){
534
534
  perspectiveLinkMutations(mutations: $mutations, uuid: $uuid, status: $status) {
535
535
  additions {
536
- ${Fe}
536
+ ${je}
537
537
  }
538
538
  removals {
539
- ${Fe}
539
+ ${je}
540
540
  }
541
541
  }
542
542
  }`,variables:{uuid:e,mutations:t,status:r}}));return n}async addLinkExpression(e,t,r="shared",n){let{perspectiveAddLinkExpression:a}=b(await U(this,Q,"f").mutate({mutation:y`mutation perspectiveAddLinkExpression($uuid: String!, $link: LinkExpressionInput!, $status: String!, $batchId: String) {
543
543
  perspectiveAddLinkExpression(uuid: $uuid, link: $link, status: $status, batchId: $batchId) {
544
- ${Fe}
544
+ ${je}
545
545
  }
546
546
  }`,variables:{uuid:e,link:t,status:r,batchId:n}}));return a}async updateLink(e,t,r,n){let{perspectiveUpdateLink:a}=b(await U(this,Q,"f").mutate({mutation:y`mutation perspectiveUpdateLink($uuid: String!, $oldLink: LinkExpressionInput!, $newLink: LinkInput!, $batchId: String) {
547
547
  perspectiveUpdateLink(uuid: $uuid, oldLink: $oldLink, newLink: $newLink, batchId: $batchId) {
548
- ${Fe}
548
+ ${je}
549
549
  }
550
550
  }`,variables:{uuid:e,oldLink:t,newLink:r,batchId:n}}));return a}async removeLink(e,t,r){delete t.__typename,delete t.data.__typename,delete t.proof.__typename,delete t.status;let{perspectiveRemoveLink:n}=b(await U(this,Q,"f").mutate({mutation:y`mutation perspectiveRemoveLink($link: LinkExpressionInput!, $uuid: String!, $batchId: String) {
551
551
  perspectiveRemoveLink(link: $link, uuid: $uuid, batchId: $batchId)
@@ -557,7 +557,7 @@ neighbourhood {
557
557
  perspectiveCreateSubject(uuid: $uuid, subjectClass: $subjectClass, expressionAddress: $expressionAddress, initialValues: $initialValues, batchId: $batchId)
558
558
  }`,variables:{uuid:e,subjectClass:t,expressionAddress:r,initialValues:n,batchId:a}})).perspectiveCreateSubject}async getSubjectData(e,t,r){return b(await U(this,Q,"f").mutate({mutation:y`mutation perspectiveGetSubjectData($uuid: String!, $subjectClass: String!, $expressionAddress: String!) {
559
559
  perspectiveGetSubjectData(uuid: $uuid, subjectClass: $subjectClass, expressionAddress: $expressionAddress)
560
- }`,variables:{uuid:e,subjectClass:t,expressionAddress:r}})).perspectiveGetSubjectData}async getExpression(e){return await U(this,Gr,"f").get(e)}async createExpression(e,t){return await U(this,Gr,"f").create(e,t)}addPerspectiveAddedListener(e){U(this,Vr,"f").push(e)}subscribePerspectiveAdded(){U(this,Q,"f").subscribe({query:y` subscription {
560
+ }`,variables:{uuid:e,subjectClass:t,expressionAddress:r}})).perspectiveGetSubjectData}async getExpression(e){return await U(this,Kr,"f").get(e)}async createExpression(e,t){return await U(this,Kr,"f").create(e,t)}addPerspectiveAddedListener(e){U(this,Vr,"f").push(e)}subscribePerspectiveAdded(){U(this,Q,"f").subscribe({query:y` subscription {
561
561
  perspectiveAdded { ${nr} }
562
562
  }
563
563
  `}).subscribe({next:e=>{U(this,Vr,"f").forEach(t=>{t(e.data.perspectiveAdded)})},error:e=>console.error(e)})}addPerspectiveUpdatedListener(e){U(this,zr,"f").push(e)}subscribePerspectiveUpdated(){U(this,Q,"f").subscribe({query:y` subscription {
@@ -570,18 +570,18 @@ neighbourhood {
570
570
  perspectiveRemoved
571
571
  }
572
572
  `}).subscribe({next:e=>{U(this,Hr,"f").forEach(t=>{t(e.data.perspectiveRemoved)})},error:e=>console.error(e)})}async addPerspectiveLinkAddedListener(e,t){U(this,Q,"f").subscribe({query:y` subscription {
573
- perspectiveLinkAdded(uuid: "${e}") { ${Fe} }
573
+ perspectiveLinkAdded(uuid: "${e}") { ${je} }
574
574
  }
575
575
  `}).subscribe({next:r=>{t.forEach(n=>{n(r.data.perspectiveLinkAdded)})},error:r=>console.error(r)}),await new Promise(r=>setTimeout(r,500))}async addPerspectiveLinkRemovedListener(e,t){U(this,Q,"f").subscribe({query:y` subscription {
576
- perspectiveLinkRemoved(uuid: "${e}") { ${Fe} }
576
+ perspectiveLinkRemoved(uuid: "${e}") { ${je} }
577
577
  }
578
578
  `}).subscribe({next:r=>{t.forEach(n=>{r.data.perspectiveLinkRemoved.status||delete r.data.perspectiveLinkRemoved.status,n(r.data.perspectiveLinkRemoved)})},error:r=>console.error(r)}),await new Promise(r=>setTimeout(r,500))}async addPerspectiveLinkUpdatedListener(e,t){U(this,Q,"f").subscribe({query:y` subscription {
579
579
  perspectiveLinkUpdated(uuid: "${e}") {
580
580
  oldLink {
581
- ${Fe}
581
+ ${je}
582
582
  }
583
583
  newLink {
584
- ${Fe}
584
+ ${je}
585
585
  }
586
586
  }
587
587
  }
@@ -590,13 +590,13 @@ neighbourhood {
590
590
  }`,variables:{uuid:e}}));return t}async commitBatch(e,t){let{perspectiveCommitBatch:r}=b(await U(this,Q,"f").mutate({mutation:y`mutation perspectiveCommitBatch($uuid: String!, $batchId: String!) {
591
591
  perspectiveCommitBatch(uuid: $uuid, batchId: $batchId) {
592
592
  additions {
593
- ${Fe}
593
+ ${je}
594
594
  }
595
595
  removals {
596
- ${Fe}
596
+ ${je}
597
597
  }
598
598
  }
599
- }`,variables:{uuid:e,batchId:t}}));return r}};Q=new WeakMap,Vr=new WeakMap,zr=new WeakMap,Hr=new WeakMap,oa=new WeakMap,Gr=new WeakMap,ca=new WeakMap,la=new WeakMap;var qn=function(i,e,t,r,n){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?i!==e||!n:!e.has(i))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?n.call(i,t):n?n.value=t:e.set(i,t),t},W=function(i,e,t,r){if(t==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?i!==e||!r:!e.has(i))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?r:t==="a"?r.call(i):r?r.value:e.get(i)},X,Kr,Qr,Wr,Mr=`
599
+ }`,variables:{uuid:e,batchId:t}}));return r}};Q=new WeakMap,Vr=new WeakMap,zr=new WeakMap,Hr=new WeakMap,oa=new WeakMap,Kr=new WeakMap,ca=new WeakMap,la=new WeakMap;var qn=function(i,e,t,r,n){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?i!==e||!n:!e.has(i))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?n.call(i,t):n?n.value=t:e.set(i,t),t},Z=function(i,e,t,r){if(t==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?i!==e||!r:!e.has(i))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?r:t==="a"?r.call(i):r?r.value:e.get(i)},ee,Wr,Qr,Gr,Mr=`
600
600
  did
601
601
  directMessageLanguage
602
602
  perspective {
@@ -642,17 +642,17 @@ neighbourhood {
642
642
  `,Ad=`
643
643
  signature
644
644
  publicKey
645
- `,pn=class{constructor(e,t=!0){X.set(this,void 0),Kr.set(this,void 0),Qr.set(this,void 0),Wr.set(this,void 0),qn(this,X,e,"f"),qn(this,Qr,[],"f"),qn(this,Wr,[],"f"),qn(this,Kr,[],"f"),t&&(this.subscribeAgentUpdated(),this.subscribeAgentStatusChanged(),this.subscribeAppsChanged())}async me(){let{agent:e}=b(await W(this,X,"f").query({query:y`query agent { agent { ${Mr} } }`})),t=new Wt(e.did,e.perspective);return t.directMessageLanguage=e.directMessageLanguage,t}async status(){let{agentStatus:e}=b(await W(this,X,"f").query({query:y`query agentStatus {
645
+ `,pn=class{constructor(e,t=!0){ee.set(this,void 0),Wr.set(this,void 0),Qr.set(this,void 0),Gr.set(this,void 0),qn(this,ee,e,"f"),qn(this,Qr,[],"f"),qn(this,Gr,[],"f"),qn(this,Wr,[],"f"),t&&(this.subscribeAgentUpdated(),this.subscribeAgentStatusChanged(),this.subscribeAppsChanged())}async me(){let{agent:e}=b(await Z(this,ee,"f").query({query:y`query agent { agent { ${Mr} } }`})),t=new Gt(e.did,e.perspective);return t.directMessageLanguage=e.directMessageLanguage,t}async status(){let{agentStatus:e}=b(await Z(this,ee,"f").query({query:y`query agentStatus {
646
646
  agentStatus {
647
647
  ${ar}
648
648
  }
649
- }`}));return new ct(e)}async generate(e){let{agentGenerate:t}=b(await W(this,X,"f").mutate({mutation:y`mutation agentGenerate(
649
+ }`}));return new ct(e)}async generate(e){let{agentGenerate:t}=b(await Z(this,ee,"f").mutate({mutation:y`mutation agentGenerate(
650
650
  $passphrase: String!
651
651
  ) {
652
652
  agentGenerate(passphrase: $passphrase) {
653
653
  ${ar}
654
654
  }
655
- }`,variables:{passphrase:e}}));return new ct(t)}async import(e){let{did:t,didDocument:r,keystore:n,passphrase:a}=e,{agentImport:s}=b(await W(this,X,"f").mutate({mutation:y`mutation agentImport(
655
+ }`,variables:{passphrase:e}}));return new ct(t)}async import(e){let{did:t,didDocument:r,keystore:n,passphrase:a}=e,{agentImport:s}=b(await Z(this,ee,"f").mutate({mutation:y`mutation agentImport(
656
656
  $did: String!,
657
657
  $didDocument: String!,
658
658
  $keystore: String!,
@@ -661,103 +661,103 @@ neighbourhood {
661
661
  agentImport(did: $did, didDocument: $didDocument, keystore: $keystore, passphrase: $passphrase) {
662
662
  ${ar}
663
663
  }
664
- }`,variables:{did:t,didDocument:r,keystore:n,passphrase:a}}));return new ct(s)}async lock(e){let{agentLock:t}=b(await W(this,X,"f").mutate({mutation:y`mutation agentLock($passphrase: String!) {
664
+ }`,variables:{did:t,didDocument:r,keystore:n,passphrase:a}}));return new ct(s)}async lock(e){let{agentLock:t}=b(await Z(this,ee,"f").mutate({mutation:y`mutation agentLock($passphrase: String!) {
665
665
  agentLock(passphrase: $passphrase) {
666
666
  ${ar}
667
667
  }
668
- }`,variables:{passphrase:e}}));return new ct(t)}async unlock(e,t=!0){let{agentUnlock:r}=b(await W(this,X,"f").mutate({mutation:y`mutation agentUnlock($passphrase: String!, $holochain: Boolean!) {
668
+ }`,variables:{passphrase:e}}));return new ct(t)}async unlock(e,t=!0){let{agentUnlock:r}=b(await Z(this,ee,"f").mutate({mutation:y`mutation agentUnlock($passphrase: String!, $holochain: Boolean!) {
669
669
  agentUnlock(passphrase: $passphrase, holochain: $holochain) {
670
670
  ${ar}
671
671
  }
672
- }`,variables:{passphrase:e,holochain:t}}));return new ct(r)}async byDID(e){let{agentByDID:t}=b(await W(this,X,"f").query({query:y`query agentByDID($did: String!) {
672
+ }`,variables:{passphrase:e,holochain:t}}));return new ct(r)}async byDID(e){let{agentByDID:t}=b(await Z(this,ee,"f").query({query:y`query agentByDID($did: String!) {
673
673
  agentByDID(did: $did) {
674
674
  ${Mr}
675
675
  }
676
- }`,variables:{did:e}}));return t}async updatePublicPerspective(e){let t=JSON.parse(JSON.stringify(e));delete t.__typename,t.links.forEach(s=>{delete s.__typename,delete s.data.__typename,delete s.proof.__typename,delete s.status});let{agentUpdatePublicPerspective:r}=b(await W(this,X,"f").mutate({mutation:y`mutation agentUpdatePublicPerspective($perspective: PerspectiveInput!) {
676
+ }`,variables:{did:e}}));return t}async updatePublicPerspective(e){let t=JSON.parse(JSON.stringify(e));delete t.__typename,t.links.forEach(s=>{delete s.__typename,delete s.data.__typename,delete s.proof.__typename,delete s.status});let{agentUpdatePublicPerspective:r}=b(await Z(this,ee,"f").mutate({mutation:y`mutation agentUpdatePublicPerspective($perspective: PerspectiveInput!) {
677
677
  agentUpdatePublicPerspective(perspective: $perspective) {
678
678
  ${Mr}
679
679
  }
680
- }`,variables:{perspective:t}})),n=r,a=new Wt(n.did,n.perspective);return a.directMessageLanguage=n.directMessageLanguage,a}async mutatePublicPerspective(e){let t=new Ta(W(this,X,"f")),r=new pn(W(this,X,"f")),n=await t.add("Agent Perspective Proxy"),a=await r.me();a.perspective&&await n.loadSnapshot(a.perspective);for(let c of e.additions)await n.add(c);for(let c of e.removals)await n.remove(c);let s=await n.snapshot(),o=await this.updatePublicPerspective(s);return await t.remove(n.uuid),o}async updateDirectMessageLanguage(e){let{agentUpdateDirectMessageLanguage:t}=b(await W(this,X,"f").mutate({mutation:y`mutation agentUpdateDirectMessageLanguage($directMessageLanguage: String!) {
680
+ }`,variables:{perspective:t}})),n=r,a=new Gt(n.did,n.perspective);return a.directMessageLanguage=n.directMessageLanguage,a}async mutatePublicPerspective(e){let t=new Ta(Z(this,ee,"f")),r=new pn(Z(this,ee,"f")),n=await t.add("Agent Perspective Proxy"),a=await r.me();a.perspective&&await n.loadSnapshot(a.perspective);for(let l of e.additions)await n.add(l);for(let l of e.removals)await n.remove(l);let s=await n.snapshot(),o=await this.updatePublicPerspective(s);return await t.remove(n.uuid),o}async updateDirectMessageLanguage(e){let{agentUpdateDirectMessageLanguage:t}=b(await Z(this,ee,"f").mutate({mutation:y`mutation agentUpdateDirectMessageLanguage($directMessageLanguage: String!) {
681
681
  agentUpdateDirectMessageLanguage(directMessageLanguage: $directMessageLanguage) {
682
682
  ${Mr}
683
683
  }
684
- }`,variables:{directMessageLanguage:e}})),r=t,n=new Wt(r.did,r.perspective);return n.directMessageLanguage=r.directMessageLanguage,n}async addEntanglementProofs(e){let{agentAddEntanglementProofs:t}=b(await W(this,X,"f").mutate({mutation:y`mutation agentAddEntanglementProofs($proofs: [EntanglementProofInput!]!) {
684
+ }`,variables:{directMessageLanguage:e}})),r=t,n=new Gt(r.did,r.perspective);return n.directMessageLanguage=r.directMessageLanguage,n}async addEntanglementProofs(e){let{agentAddEntanglementProofs:t}=b(await Z(this,ee,"f").mutate({mutation:y`mutation agentAddEntanglementProofs($proofs: [EntanglementProofInput!]!) {
685
685
  agentAddEntanglementProofs(proofs: $proofs) {
686
686
  ${zn}
687
687
  }
688
- }`,variables:{proofs:e}}));return t}async deleteEntanglementProofs(e){let{agentDeleteEntanglementProofs:t}=b(await W(this,X,"f").mutate({mutation:y`mutation agentDeleteEntanglementProofs($proofs: [EntanglementProofInput!]!) {
688
+ }`,variables:{proofs:e}}));return t}async deleteEntanglementProofs(e){let{agentDeleteEntanglementProofs:t}=b(await Z(this,ee,"f").mutate({mutation:y`mutation agentDeleteEntanglementProofs($proofs: [EntanglementProofInput!]!) {
689
689
  agentDeleteEntanglementProofs(proofs: $proofs) {
690
690
  ${zn}
691
691
  }
692
- }`,variables:{proofs:e}}));return t}async getEntanglementProofs(){let{agentGetEntanglementProofs:e}=b(await W(this,X,"f").query({query:y`query agentGetEntanglementProofs {
692
+ }`,variables:{proofs:e}}));return t}async getEntanglementProofs(){let{agentGetEntanglementProofs:e}=b(await Z(this,ee,"f").query({query:y`query agentGetEntanglementProofs {
693
693
  agentGetEntanglementProofs {
694
694
  ${zn}
695
695
  }
696
- }`}));return e}async entanglementProofPreFlight(e,t){let{agentEntanglementProofPreFlight:r}=b(await W(this,X,"f").mutate({mutation:y`mutation agentEntanglementProofPreFlight($deviceKey: String!, $deviceKeyType: String!) {
696
+ }`}));return e}async entanglementProofPreFlight(e,t){let{agentEntanglementProofPreFlight:r}=b(await Z(this,ee,"f").mutate({mutation:y`mutation agentEntanglementProofPreFlight($deviceKey: String!, $deviceKeyType: String!) {
697
697
  agentEntanglementProofPreFlight(deviceKey: $deviceKey, deviceKeyType: $deviceKeyType) {
698
698
  ${zn}
699
699
  }
700
- }`,variables:{deviceKey:e,deviceKeyType:t}}));return r}addUpdatedListener(e){W(this,Qr,"f").push(e)}addAppChangedListener(e){W(this,Kr,"f").push(e)}subscribeAgentUpdated(){W(this,X,"f").subscribe({query:y` subscription {
700
+ }`,variables:{deviceKey:e,deviceKeyType:t}}));return r}addUpdatedListener(e){Z(this,Qr,"f").push(e)}addAppChangedListener(e){Z(this,Wr,"f").push(e)}subscribeAgentUpdated(){Z(this,ee,"f").subscribe({query:y` subscription {
701
701
  agentUpdated { ${Mr} }
702
702
  }
703
- `}).subscribe({next:e=>{let t=e.data.agentUpdated;W(this,Qr,"f").forEach(r=>{r(t)})},error:e=>console.error(e)})}subscribeAppsChanged(){W(this,X,"f").subscribe({query:y` subscription {
703
+ `}).subscribe({next:e=>{let t=e.data.agentUpdated;Z(this,Qr,"f").forEach(r=>{r(t)})},error:e=>console.error(e)})}subscribeAppsChanged(){Z(this,ee,"f").subscribe({query:y` subscription {
704
704
  agentAppsChanged {
705
705
  ${Vn}
706
706
  }
707
707
  }
708
- `}).subscribe({next:e=>{W(this,Kr,"f").forEach(t=>{t()})},error:e=>console.error(e)})}addAgentStatusChangedListener(e){W(this,Wr,"f").push(e)}subscribeAgentStatusChanged(){W(this,X,"f").subscribe({query:y` subscription {
708
+ `}).subscribe({next:e=>{Z(this,Wr,"f").forEach(t=>{t()})},error:e=>console.error(e)})}addAgentStatusChangedListener(e){Z(this,Gr,"f").push(e)}subscribeAgentStatusChanged(){Z(this,ee,"f").subscribe({query:y` subscription {
709
709
  agentStatusChanged { ${ar} }
710
710
  }
711
- `}).subscribe({next:e=>{let t=e.data.agentStatusChanged;W(this,Wr,"f").forEach(r=>{r(t)})},error:e=>console.error(e)})}async requestCapability(e){let{agentRequestCapability:t}=b(await W(this,X,"f").mutate({mutation:y`
711
+ `}).subscribe({next:e=>{let t=e.data.agentStatusChanged;Z(this,Gr,"f").forEach(r=>{r(t)})},error:e=>console.error(e)})}async requestCapability(e){let{agentRequestCapability:t}=b(await Z(this,ee,"f").mutate({mutation:y`
712
712
  mutation agentRequestCapability($authInfo: AuthInfoInput!) {
713
713
  agentRequestCapability(authInfo: $authInfo)
714
714
  }
715
- `,variables:{authInfo:e}}));return t}async permitCapability(e){let{agentPermitCapability:t}=b(await W(this,X,"f").mutate({mutation:y`
715
+ `,variables:{authInfo:e}}));return t}async permitCapability(e){let{agentPermitCapability:t}=b(await Z(this,ee,"f").mutate({mutation:y`
716
716
  mutation agentPermitCapability($auth: String!) {
717
717
  agentPermitCapability(auth: $auth)
718
718
  }
719
- `,variables:{auth:e}}));return t}async generateJwt(e,t){let{agentGenerateJwt:r}=b(await W(this,X,"f").mutate({mutation:y`
719
+ `,variables:{auth:e}}));return t}async generateJwt(e,t){let{agentGenerateJwt:r}=b(await Z(this,ee,"f").mutate({mutation:y`
720
720
  mutation agentGenerateJwt($requestId: String!, $rand: String!) {
721
721
  agentGenerateJwt(requestId: $requestId, rand: $rand)
722
722
  }
723
- `,variables:{requestId:e,rand:t}}));return r}async getApps(){let{agentGetApps:e}=b(await W(this,X,"f").mutate({mutation:y`query agentGetApps {
723
+ `,variables:{requestId:e,rand:t}}));return r}async getApps(){let{agentGetApps:e}=b(await Z(this,ee,"f").mutate({mutation:y`query agentGetApps {
724
724
  agentGetApps {
725
725
  ${Vn}
726
726
  }
727
- }`}));return e}async removeApp(e){let{agentRemoveApp:t}=b(await W(this,X,"f").mutate({mutation:y`mutation agentRemoveApp($requestId: String!) {
727
+ }`}));return e}async removeApp(e){let{agentRemoveApp:t}=b(await Z(this,ee,"f").mutate({mutation:y`mutation agentRemoveApp($requestId: String!) {
728
728
  agentRemoveApp(requestId: $requestId) {
729
729
  ${Vn}
730
730
  }
731
- }`,variables:{requestId:e}}));return t}async revokeToken(e){let{agentRevokeToken:t}=b(await W(this,X,"f").mutate({mutation:y`mutation agentRevokeToken($requestId: String!) {
731
+ }`,variables:{requestId:e}}));return t}async revokeToken(e){let{agentRevokeToken:t}=b(await Z(this,ee,"f").mutate({mutation:y`mutation agentRevokeToken($requestId: String!) {
732
732
  agentRevokeToken(requestId: $requestId) {
733
733
  ${Vn}
734
734
  }
735
- }`,variables:{requestId:e}}));return t}async isLocked(){let{agentIsLocked:e}=b(await W(this,X,"f").mutate({mutation:y`
735
+ }`,variables:{requestId:e}}));return t}async isLocked(){let{agentIsLocked:e}=b(await Z(this,ee,"f").mutate({mutation:y`
736
736
  query agentIsLocked {
737
737
  agentIsLocked
738
738
  }
739
- `}));return e}async signMessage(e){let{agentSignMessage:t}=b(await W(this,X,"f").mutate({mutation:y`mutation agentSignMessage($message: String!) {
739
+ `}));return e}async signMessage(e){let{agentSignMessage:t}=b(await Z(this,ee,"f").mutate({mutation:y`mutation agentSignMessage($message: String!) {
740
740
  agentSignMessage(message: $message) {
741
741
  ${Ad}
742
742
  }
743
- }`,variables:{message:e}}));return t}async createUser(e,t,r){let{runtimeCreateUser:n}=b(await W(this,X,"f").mutate({mutation:y`mutation runtimeCreateUser($email: String!, $password: String!, $appInfo: AuthInfoInput) {
743
+ }`,variables:{message:e}}));return t}async createUser(e,t,r){let{runtimeCreateUser:n}=b(await Z(this,ee,"f").mutate({mutation:y`mutation runtimeCreateUser($email: String!, $password: String!, $appInfo: AuthInfoInput) {
744
744
  runtimeCreateUser(email: $email, password: $password, appInfo: $appInfo) {
745
745
  did
746
746
  success
747
747
  error
748
748
  }
749
- }`,variables:{email:e,password:t,appInfo:r}}));return n}async loginUser(e,t){let{runtimeLoginUser:r}=b(await W(this,X,"f").mutate({mutation:y`mutation runtimeLoginUser($email: String!, $password: String!) {
749
+ }`,variables:{email:e,password:t,appInfo:r}}));return n}async loginUser(e,t){let{runtimeLoginUser:r}=b(await Z(this,ee,"f").mutate({mutation:y`mutation runtimeLoginUser($email: String!, $password: String!) {
750
750
  runtimeLoginUser(email: $email, password: $password)
751
- }`,variables:{email:e,password:t}}));return r}async requestLoginVerification(e,t){let{runtimeRequestLoginVerification:r}=b(await W(this,X,"f").mutate({mutation:y`mutation runtimeRequestLoginVerification($email: String!, $appInfo: AuthInfoInput) {
751
+ }`,variables:{email:e,password:t}}));return r}async requestLoginVerification(e,t){let{runtimeRequestLoginVerification:r}=b(await Z(this,ee,"f").mutate({mutation:y`mutation runtimeRequestLoginVerification($email: String!, $appInfo: AuthInfoInput) {
752
752
  runtimeRequestLoginVerification(email: $email, appInfo: $appInfo) {
753
753
  success
754
754
  message
755
755
  requiresPassword
756
756
  isExistingUser
757
757
  }
758
- }`,variables:{email:e,appInfo:t}}));return r}async verifyEmailCode(e,t,r){let{runtimeVerifyEmailCode:n}=b(await W(this,X,"f").mutate({mutation:y`mutation runtimeVerifyEmailCode($email: String!, $code: String!, $verificationType: String!) {
758
+ }`,variables:{email:e,appInfo:t}}));return r}async verifyEmailCode(e,t,r){let{runtimeVerifyEmailCode:n}=b(await Z(this,ee,"f").mutate({mutation:y`mutation runtimeVerifyEmailCode($email: String!, $code: String!, $verificationType: String!) {
759
759
  runtimeVerifyEmailCode(email: $email, code: $code, verificationType: $verificationType)
760
- }`,variables:{email:e,code:t,verificationType:r}}));return n}};X=new WeakMap,Kr=new WeakMap,Qr=new WeakMap,Wr=new WeakMap;var $d=function(i,e,t,r,n){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?i!==e||!n:!e.has(i))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?n.call(i,t):n?n.value=t:e.set(i,t),t},qt=function(i,e,t,r){if(t==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?i!==e||!r:!e.has(i))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?r:t==="a"?r.call(i):r?r.value:e.get(i)},ft,Xo=`
760
+ }`,variables:{email:e,code:t,verificationType:r}}));return n}};ee=new WeakMap,Wr=new WeakMap,Qr=new WeakMap,Gr=new WeakMap;var $d=function(i,e,t,r,n){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?i!==e||!n:!e.has(i))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?n.call(i,t):n?n.value=t:e.set(i,t),t},qt=function(i,e,t,r){if(t==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?i!==e||!r:!e.has(i))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?r:t==="a"?r.call(i):r?r.value:e.get(i)},ft,Xo=`
761
761
  name
762
762
  address
763
763
  settings
@@ -812,7 +812,7 @@ neighbourhood {
812
812
  $address: String!,
813
813
  ) {
814
814
  languageRemove(address: $address)
815
- }`,variables:{address:e}}));return t}};ft=new WeakMap;var Id=function(i,e,t,r,n){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?i!==e||!n:!e.has(i))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?n.call(i,t):n?n.value=t:e.set(i,t),t},Oe=function(i,e,t,r){if(t==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?i!==e||!r:!e.has(i))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?r:t==="a"?r.call(i):r?r.value:e.get(i)},qe,dr,Bs=class{constructor(e){qe.set(this,void 0),dr.set(this,new Map),Id(this,qe,e,"f")}async publishFromPerspective(e,t,r){let{neighbourhoodPublishFromPerspective:n}=b(await Oe(this,qe,"f").mutate({mutation:y`mutation neighbourhoodPublishFromPerspective(
815
+ }`,variables:{address:e}}));return t}};ft=new WeakMap;var Id=function(i,e,t,r,n){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?i!==e||!n:!e.has(i))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?n.call(i,t):n?n.value=t:e.set(i,t),t},Oe=function(i,e,t,r){if(t==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?i!==e||!r:!e.has(i))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?r:t==="a"?r.call(i):r?r.value:e.get(i)},Ve,dr,Bs=class{constructor(e){Ve.set(this,void 0),dr.set(this,new Map),Id(this,Ve,e,"f")}async publishFromPerspective(e,t,r){let{neighbourhoodPublishFromPerspective:n}=b(await Oe(this,Ve,"f").mutate({mutation:y`mutation neighbourhoodPublishFromPerspective(
816
816
  $linkLanguage: String!,
817
817
  $meta: PerspectiveInput!,
818
818
  $perspectiveUUID: String!
@@ -822,7 +822,7 @@ neighbourhood {
822
822
  meta: $meta,
823
823
  perspectiveUUID: $perspectiveUUID
824
824
  )
825
- }`,variables:{perspectiveUUID:e,linkLanguage:t,meta:r}}));return n}async joinFromUrl(e){let{neighbourhoodJoinFromUrl:t}=b(await Oe(this,qe,"f").mutate({mutation:y`mutation neighbourhoodJoinFromUrl($url: String!) {
825
+ }`,variables:{perspectiveUUID:e,linkLanguage:t,meta:r}}));return n}async joinFromUrl(e){let{neighbourhoodJoinFromUrl:t}=b(await Oe(this,Ve,"f").mutate({mutation:y`mutation neighbourhoodJoinFromUrl($url: String!) {
826
826
  neighbourhoodJoinFromUrl(url: $url) {
827
827
  uuid
828
828
  name
@@ -844,11 +844,11 @@ neighbourhood {
844
844
  author
845
845
  }
846
846
  }
847
- }`,variables:{url:e}}));return t}async otherAgents(e){let{neighbourhoodOtherAgents:t}=b(await Oe(this,qe,"f").query({query:y`query neighbourhoodOtherAgents($perspectiveUUID: String!) {
847
+ }`,variables:{url:e}}));return t}async otherAgents(e){let{neighbourhoodOtherAgents:t}=b(await Oe(this,Ve,"f").query({query:y`query neighbourhoodOtherAgents($perspectiveUUID: String!) {
848
848
  neighbourhoodOtherAgents(perspectiveUUID: $perspectiveUUID)
849
- }`,variables:{perspectiveUUID:e}}));return t}async hasTelepresenceAdapter(e){let{neighbourhoodHasTelepresenceAdapter:t}=b(await Oe(this,qe,"f").query({query:y`query neighbourhoodHasTelepresenceAdapter($perspectiveUUID: String!) {
849
+ }`,variables:{perspectiveUUID:e}}));return t}async hasTelepresenceAdapter(e){let{neighbourhoodHasTelepresenceAdapter:t}=b(await Oe(this,Ve,"f").query({query:y`query neighbourhoodHasTelepresenceAdapter($perspectiveUUID: String!) {
850
850
  neighbourhoodHasTelepresenceAdapter(perspectiveUUID: $perspectiveUUID)
851
- }`,variables:{perspectiveUUID:e}}));return t}async onlineAgents(e){let{neighbourhoodOnlineAgents:t}=b(await Oe(this,qe,"f").query({query:y`query neighbourhoodOnlineAgents($perspectiveUUID: String!) {
851
+ }`,variables:{perspectiveUUID:e}}));return t}async onlineAgents(e){let{neighbourhoodOnlineAgents:t}=b(await Oe(this,Ve,"f").query({query:y`query neighbourhoodOnlineAgents($perspectiveUUID: String!) {
852
852
  neighbourhoodOnlineAgents(perspectiveUUID: $perspectiveUUID) {
853
853
  did
854
854
  status {
@@ -865,7 +865,7 @@ neighbourhood {
865
865
  proof { valid, invalid, signature, key }
866
866
  }
867
867
  }
868
- }`,variables:{perspectiveUUID:e}}));return t}async setOnlineStatus(e,t){let{neighbourhoodSetOnlineStatus:r}=b(await Oe(this,qe,"f").mutate({mutation:y`mutation neighbourhoodSetOnlineStatus(
868
+ }`,variables:{perspectiveUUID:e}}));return t}async setOnlineStatus(e,t){let{neighbourhoodSetOnlineStatus:r}=b(await Oe(this,Ve,"f").mutate({mutation:y`mutation neighbourhoodSetOnlineStatus(
869
869
  $perspectiveUUID: String!,
870
870
  $status: PerspectiveInput!
871
871
  ) {
@@ -873,7 +873,7 @@ neighbourhood {
873
873
  perspectiveUUID: $perspectiveUUID,
874
874
  status: $status
875
875
  )
876
- }`,variables:{perspectiveUUID:e,status:t}}));return r}async setOnlineStatusU(e,t){let{neighbourhoodSetOnlineStatusU:r}=b(await Oe(this,qe,"f").mutate({mutation:y`mutation neighbourhoodSetOnlineStatusU(
876
+ }`,variables:{perspectiveUUID:e,status:t}}));return r}async setOnlineStatusU(e,t){let{neighbourhoodSetOnlineStatusU:r}=b(await Oe(this,Ve,"f").mutate({mutation:y`mutation neighbourhoodSetOnlineStatusU(
877
877
  $perspectiveUUID: String!,
878
878
  $status: PerspectiveUnsignedInput!
879
879
  ) {
@@ -881,7 +881,7 @@ neighbourhood {
881
881
  perspectiveUUID: $perspectiveUUID,
882
882
  status: $status
883
883
  )
884
- }`,variables:{perspectiveUUID:e,status:t}}));return r}async sendSignal(e,t,r){let{neighbourhoodSendSignal:n}=b(await Oe(this,qe,"f").mutate({mutation:y`mutation neighbourhoodSendSignal(
884
+ }`,variables:{perspectiveUUID:e,status:t}}));return r}async sendSignal(e,t,r){let{neighbourhoodSendSignal:n}=b(await Oe(this,Ve,"f").mutate({mutation:y`mutation neighbourhoodSendSignal(
885
885
  $perspectiveUUID: String!,
886
886
  $remoteAgentDid: String!,
887
887
  $payload: PerspectiveInput!
@@ -891,7 +891,7 @@ neighbourhood {
891
891
  remoteAgentDid: $remoteAgentDid,
892
892
  payload: $payload
893
893
  )
894
- }`,variables:{perspectiveUUID:e,remoteAgentDid:t,payload:r}}));return n}async sendSignalU(e,t,r){let{neighbourhoodSendSignalU:n}=b(await Oe(this,qe,"f").mutate({mutation:y`mutation neighbourhoodSendSignalU(
894
+ }`,variables:{perspectiveUUID:e,remoteAgentDid:t,payload:r}}));return n}async sendSignalU(e,t,r){let{neighbourhoodSendSignalU:n}=b(await Oe(this,Ve,"f").mutate({mutation:y`mutation neighbourhoodSendSignalU(
895
895
  $perspectiveUUID: String!,
896
896
  $remoteAgentDid: String!,
897
897
  $payload: PerspectiveUnsignedInput!
@@ -901,7 +901,7 @@ neighbourhood {
901
901
  remoteAgentDid: $remoteAgentDid,
902
902
  payload: $payload
903
903
  )
904
- }`,variables:{perspectiveUUID:e,remoteAgentDid:t,payload:r}}));return n}async sendBroadcast(e,t,r=!1){let{neighbourhoodSendBroadcast:n}=b(await Oe(this,qe,"f").mutate({mutation:y`mutation neighbourhoodSendBroadcast(
904
+ }`,variables:{perspectiveUUID:e,remoteAgentDid:t,payload:r}}));return n}async sendBroadcast(e,t,r=!1){let{neighbourhoodSendBroadcast:n}=b(await Oe(this,Ve,"f").mutate({mutation:y`mutation neighbourhoodSendBroadcast(
905
905
  $perspectiveUUID: String!,
906
906
  $payload: PerspectiveInput!,
907
907
  $loopback: Boolean
@@ -911,7 +911,7 @@ neighbourhood {
911
911
  payload: $payload,
912
912
  loopback: $loopback
913
913
  )
914
- }`,variables:{perspectiveUUID:e,payload:t,loopback:r}}));return n}async sendBroadcastU(e,t,r=!1){let{neighbourhoodSendBroadcastU:n}=b(await Oe(this,qe,"f").mutate({mutation:y`mutation neighbourhoodSendBroadcastU(
914
+ }`,variables:{perspectiveUUID:e,payload:t,loopback:r}}));return n}async sendBroadcastU(e,t,r=!1){let{neighbourhoodSendBroadcastU:n}=b(await Oe(this,Ve,"f").mutate({mutation:y`mutation neighbourhoodSendBroadcastU(
915
915
  $perspectiveUUID: String!,
916
916
  $payload: PerspectiveUnsignedInput!,
917
917
  $loopback: Boolean
@@ -921,7 +921,7 @@ neighbourhood {
921
921
  payload: $payload,
922
922
  loopback: $loopback
923
923
  )
924
- }`,variables:{perspectiveUUID:e,payload:t,loopback:r}}));return n}dispatchSignal(e,t){let r=Oe(this,dr,"f").get(e);r&&r.forEach(n=>n(t))}async subscribeToSignals(e){let t=this;await Oe(this,qe,"f").subscribe({query:y`subscription neighbourhoodSignal($perspectiveUUID: String!) {
924
+ }`,variables:{perspectiveUUID:e,payload:t,loopback:r}}));return n}dispatchSignal(e,t){let r=Oe(this,dr,"f").get(e);r&&r.forEach(n=>n(t))}async subscribeToSignals(e){let t=this;await Oe(this,Ve,"f").subscribe({query:y`subscription neighbourhoodSignal($perspectiveUUID: String!) {
925
925
  neighbourhoodSignal(perspectiveUUID: $perspectiveUUID) {
926
926
  author
927
927
  timestamp
@@ -936,7 +936,7 @@ neighbourhood {
936
936
  }
937
937
  proof { valid, invalid, signature, key }
938
938
  }
939
- }`,variables:{perspectiveUUID:e}}).subscribe({next:r=>{let{neighbourhoodSignal:n}=b(r);t.dispatchSignal(e,n)}})}async addSignalHandler(e,t){let r=Oe(this,dr,"f").get(e);r||(r=[],Oe(this,dr,"f").set(e,r),await this.subscribeToSignals(e)),r.push(t)}removeSignalHandler(e,t){let r=Oe(this,dr,"f").get(e);if(r){let n=r.indexOf(t);n>-1&&r.splice(n,1)}}};qe=new WeakMap,dr=new WeakMap;var Hn=function(i,e,t,r,n){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?i!==e||!n:!e.has(i))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?n.call(i,t):n?n.value=t:e.set(i,t),t},F=function(i,e,t,r){if(t==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?i!==e||!r:!e.has(i))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?r:t==="a"?r.call(i):r?r.value:e.get(i)},V,Zr,Jr,Yr,_l,Gn=`
939
+ }`,variables:{perspectiveUUID:e}}).subscribe({next:r=>{let{neighbourhoodSignal:n}=b(r);t.dispatchSignal(e,n)}})}async addSignalHandler(e,t){let r=Oe(this,dr,"f").get(e);r||(r=[],Oe(this,dr,"f").set(e,r),await this.subscribeToSignals(e)),r.push(t)}removeSignalHandler(e,t){let r=Oe(this,dr,"f").get(e);if(r){let n=r.indexOf(t);n>-1&&r.splice(n,1)}}};Ve=new WeakMap,dr=new WeakMap;var Hn=function(i,e,t,r,n){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?i!==e||!n:!e.has(i))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?n.call(i,t):n?n.value=t:e.set(i,t),t},F=function(i,e,t,r){if(t==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?i!==e||!r:!e.has(i))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?r:t==="a"?r.call(i):r?r.value:e.get(i)},V,Zr,Jr,Yr,_l,Kn=`
940
940
  author
941
941
  timestamp
942
942
  data {
@@ -1004,16 +1004,16 @@ triggerMatch
1004
1004
  }`,variables:{did:e,didSigningKeyId:t,data:r,signedData:n}}));return a}async setStatus(e){let{runtimeSetStatus:t}=b(await F(this,V,"f").mutate({mutation:y`mutation runtimeSetStatus($status: PerspectiveInput!) {
1005
1005
  runtimeSetStatus(status: $status)
1006
1006
  }`,variables:{status:e}}));return t}async friendStatus(e){let{runtimeFriendStatus:t}=b(await F(this,V,"f").query({query:y`query runtimeFriendStatus($did: String!) {
1007
- runtimeFriendStatus(did: $did) { ${Gn} }
1007
+ runtimeFriendStatus(did: $did) { ${Kn} }
1008
1008
  }`,variables:{did:e}}));return t}async friendSendMessage(e,t){let{runtimeFriendSendMessage:r}=b(await F(this,V,"f").mutate({mutation:y`mutation runtimeFriendSendMessage($did: String!, $message: PerspectiveInput!) {
1009
1009
  runtimeFriendSendMessage(did: $did, message: $message)
1010
1010
  }`,variables:{did:e,message:t}}));return r}async messageInbox(e){let{runtimeMessageInbox:t}=b(await F(this,V,"f").query({query:y`query runtimeMessageInbox($filter: String) {
1011
- runtimeMessageInbox(filter: $filter) { ${Gn} }
1011
+ runtimeMessageInbox(filter: $filter) { ${Kn} }
1012
1012
  }`,variables:{filter:e}}));return t}async messageOutbox(e){let{runtimeMessageOutbox:t}=b(await F(this,V,"f").query({query:y`query runtimeMessageOutbox($filter: String) {
1013
1013
  runtimeMessageOutbox(filter: $filter) {
1014
1014
  recipient,
1015
1015
  message {
1016
- ${Gn}
1016
+ ${Kn}
1017
1017
  }
1018
1018
  }
1019
1019
  }`,variables:{filter:e}}));return t}async requestInstallNotification(e){let{runtimeRequestInstallNotification:t}=b(await F(this,V,"f").mutate({mutation:y`mutation runtimeRequestInstallNotification($notification: NotificationInput!) {
@@ -1071,7 +1071,7 @@ triggerMatch
1071
1071
  runtimeNotificationTriggered { ${Td} }
1072
1072
  }
1073
1073
  `}).subscribe({next:e=>{F(this,Yr,"f").forEach(t=>{t(e.data.runtimeNotificationTriggered)})},error:e=>console.error(e)})}addMessageCallback(e){F(this,Zr,"f").push(e)}subscribeMessageReceived(){F(this,V,"f").subscribe({query:y` subscription {
1074
- runtimeMessageReceived { ${Gn} }
1074
+ runtimeMessageReceived { ${Kn} }
1075
1075
  }
1076
1076
  `}).subscribe({next:e=>{F(this,Zr,"f").forEach(t=>{t(e.data.runtimeMessageReceived)})},error:e=>console.error(e)})}addExceptionCallback(e){F(this,Jr,"f").push(e)}subscribeExceptionOccurred(){F(this,V,"f").subscribe({query:y` subscription {
1077
1077
  exceptionOccurred {
@@ -1118,7 +1118,7 @@ triggerMatch
1118
1118
  }
1119
1119
  }`,variables:{url:e}}));return t}async interact(e,t){let{expressionInteract:r}=b(await sr(this,Rt,"f").mutate({mutation:y`mutation expressionInteract($url: String!, $interactionCall: InteractionCall!){
1120
1120
  expressionInteract(url: $url, interactionCall: $interactionCall)
1121
- }`,variables:{url:e,interactionCall:t}}));return r}};Rt=new WeakMap;var qa={};qa.byteLength=Ld;qa.toByteArray=Rd;qa.fromByteArray=Md;var St=[],ot=[],Nd=typeof Uint8Array<"u"?Uint8Array:Array,ms="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(mi=0,tc=ms.length;mi<tc;++mi)St[mi]=ms[mi],ot[ms.charCodeAt(mi)]=mi;var mi,tc;ot["-".charCodeAt(0)]=62;ot["_".charCodeAt(0)]=63;function wl(i){var e=i.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var t=i.indexOf("=");t===-1&&(t=e);var r=t===e?0:4-t%4;return[t,r]}function Ld(i){var e=wl(i),t=e[0],r=e[1];return(t+r)*3/4-r}function Pd(i,e,t){return(e+t)*3/4-t}function Rd(i){var e,t=wl(i),r=t[0],n=t[1],a=new Nd(Pd(i,r,n)),s=0,o=n>0?r-4:r,c;for(c=0;c<o;c+=4)e=ot[i.charCodeAt(c)]<<18|ot[i.charCodeAt(c+1)]<<12|ot[i.charCodeAt(c+2)]<<6|ot[i.charCodeAt(c+3)],a[s++]=e>>16&255,a[s++]=e>>8&255,a[s++]=e&255;return n===2&&(e=ot[i.charCodeAt(c)]<<2|ot[i.charCodeAt(c+1)]>>4,a[s++]=e&255),n===1&&(e=ot[i.charCodeAt(c)]<<10|ot[i.charCodeAt(c+1)]<<4|ot[i.charCodeAt(c+2)]>>2,a[s++]=e>>8&255,a[s++]=e&255),a}function Od(i){return St[i>>18&63]+St[i>>12&63]+St[i>>6&63]+St[i&63]}function Dd(i,e,t){for(var r,n=[],a=e;a<t;a+=3)r=(i[a]<<16&16711680)+(i[a+1]<<8&65280)+(i[a+2]&255),n.push(Od(r));return n.join("")}function Md(i){for(var e,t=i.length,r=t%3,n=[],a=16383,s=0,o=t-r;s<o;s+=a)n.push(Dd(i,s,s+a>o?o:s+a));return r===1?(e=i[t-1],n.push(St[e>>2]+St[e<<4&63]+"==")):r===2&&(e=(i[t-2]<<8)+i[t-1],n.push(St[e>>10]+St[e>>4&63]+St[e<<2&63]+"=")),n.join("")}var Ud=4,ic=0,rc=1,Fd=2;function Ir(i){let e=i.length;for(;--e>=0;)i[e]=0}var jd=0,El=1,Bd=2,qd=3,Vd=258,lo=29,xn=256,fn=xn+1+lo,gr=30,uo=19,xl=2*fn+1,Ii=15,ys=16,zd=7,po=256,Al=16,$l=17,Il=18,zs=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]),ua=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]),Hd=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),kl=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Gd=512,Ot=new Array((fn+2)*2);Ir(Ot);var sn=new Array(gr*2);Ir(sn);var hn=new Array(Gd);Ir(hn);var gn=new Array(Vd-qd+1);Ir(gn);var fo=new Array(lo);Ir(fo);var Ca=new Array(gr);Ir(Ca);function vs(i,e,t,r,n){this.static_tree=i,this.extra_bits=e,this.extra_base=t,this.elems=r,this.max_length=n,this.has_stree=i&&i.length}var Tl,Cl,Nl;function bs(i,e){this.dyn_tree=i,this.max_code=0,this.stat_desc=e}var Ll=i=>i<256?hn[i]:hn[256+(i>>>7)],mn=(i,e)=>{i.pending_buf[i.pending++]=e&255,i.pending_buf[i.pending++]=e>>>8&255},We=(i,e,t)=>{i.bi_valid>ys-t?(i.bi_buf|=e<<i.bi_valid&65535,mn(i,i.bi_buf),i.bi_buf=e>>ys-i.bi_valid,i.bi_valid+=t-ys):(i.bi_buf|=e<<i.bi_valid&65535,i.bi_valid+=t)},wt=(i,e,t)=>{We(i,t[e*2],t[e*2+1])},Pl=(i,e)=>{let t=0;do t|=i&1,i>>>=1,t<<=1;while(--e>0);return t>>>1},Kd=i=>{i.bi_valid===16?(mn(i,i.bi_buf),i.bi_buf=0,i.bi_valid=0):i.bi_valid>=8&&(i.pending_buf[i.pending++]=i.bi_buf&255,i.bi_buf>>=8,i.bi_valid-=8)},Qd=(i,e)=>{let t=e.dyn_tree,r=e.max_code,n=e.stat_desc.static_tree,a=e.stat_desc.has_stree,s=e.stat_desc.extra_bits,o=e.stat_desc.extra_base,c=e.stat_desc.max_length,l,u,m,h,d,g,v=0;for(h=0;h<=Ii;h++)i.bl_count[h]=0;for(t[i.heap[i.heap_max]*2+1]=0,l=i.heap_max+1;l<xl;l++)u=i.heap[l],h=t[t[u*2+1]*2+1]+1,h>c&&(h=c,v++),t[u*2+1]=h,!(u>r)&&(i.bl_count[h]++,d=0,u>=o&&(d=s[u-o]),g=t[u*2],i.opt_len+=g*(h+d),a&&(i.static_len+=g*(n[u*2+1]+d)));if(v!==0){do{for(h=c-1;i.bl_count[h]===0;)h--;i.bl_count[h]--,i.bl_count[h+1]+=2,i.bl_count[c]--,v-=2}while(v>0);for(h=c;h!==0;h--)for(u=i.bl_count[h];u!==0;)m=i.heap[--l],!(m>r)&&(t[m*2+1]!==h&&(i.opt_len+=(h-t[m*2+1])*t[m*2],t[m*2+1]=h),u--)}},Rl=(i,e,t)=>{let r=new Array(Ii+1),n=0,a,s;for(a=1;a<=Ii;a++)n=n+t[a-1]<<1,r[a]=n;for(s=0;s<=e;s++){let o=i[s*2+1];o!==0&&(i[s*2]=Pl(r[o]++,o))}},Wd=()=>{let i,e,t,r,n,a=new Array(Ii+1);for(t=0,r=0;r<lo-1;r++)for(fo[r]=t,i=0;i<1<<zs[r];i++)gn[t++]=r;for(gn[t-1]=r,n=0,r=0;r<16;r++)for(Ca[r]=n,i=0;i<1<<ua[r];i++)hn[n++]=r;for(n>>=7;r<gr;r++)for(Ca[r]=n<<7,i=0;i<1<<ua[r]-7;i++)hn[256+n++]=r;for(e=0;e<=Ii;e++)a[e]=0;for(i=0;i<=143;)Ot[i*2+1]=8,i++,a[8]++;for(;i<=255;)Ot[i*2+1]=9,i++,a[9]++;for(;i<=279;)Ot[i*2+1]=7,i++,a[7]++;for(;i<=287;)Ot[i*2+1]=8,i++,a[8]++;for(Rl(Ot,fn+1,a),i=0;i<gr;i++)sn[i*2+1]=5,sn[i*2]=Pl(i,5);Tl=new vs(Ot,zs,xn+1,fn,Ii),Cl=new vs(sn,ua,0,gr,Ii),Nl=new vs(new Array(0),Hd,0,uo,zd)},Ol=i=>{let e;for(e=0;e<fn;e++)i.dyn_ltree[e*2]=0;for(e=0;e<gr;e++)i.dyn_dtree[e*2]=0;for(e=0;e<uo;e++)i.bl_tree[e*2]=0;i.dyn_ltree[po*2]=1,i.opt_len=i.static_len=0,i.sym_next=i.matches=0},Dl=i=>{i.bi_valid>8?mn(i,i.bi_buf):i.bi_valid>0&&(i.pending_buf[i.pending++]=i.bi_buf),i.bi_buf=0,i.bi_valid=0},nc=(i,e,t,r)=>{let n=e*2,a=t*2;return i[n]<i[a]||i[n]===i[a]&&r[e]<=r[t]},_s=(i,e,t)=>{let r=i.heap[t],n=t<<1;for(;n<=i.heap_len&&(n<i.heap_len&&nc(e,i.heap[n+1],i.heap[n],i.depth)&&n++,!nc(e,r,i.heap[n],i.depth));)i.heap[t]=i.heap[n],t=n,n<<=1;i.heap[t]=r},ac=(i,e,t)=>{let r,n,a=0,s,o;if(i.sym_next!==0)do r=i.pending_buf[i.sym_buf+a++]&255,r+=(i.pending_buf[i.sym_buf+a++]&255)<<8,n=i.pending_buf[i.sym_buf+a++],r===0?wt(i,n,e):(s=gn[n],wt(i,s+xn+1,e),o=zs[s],o!==0&&(n-=fo[s],We(i,n,o)),r--,s=Ll(r),wt(i,s,t),o=ua[s],o!==0&&(r-=Ca[s],We(i,r,o)));while(a<i.sym_next);wt(i,po,e)},Hs=(i,e)=>{let t=e.dyn_tree,r=e.stat_desc.static_tree,n=e.stat_desc.has_stree,a=e.stat_desc.elems,s,o,c=-1,l;for(i.heap_len=0,i.heap_max=xl,s=0;s<a;s++)t[s*2]!==0?(i.heap[++i.heap_len]=c=s,i.depth[s]=0):t[s*2+1]=0;for(;i.heap_len<2;)l=i.heap[++i.heap_len]=c<2?++c:0,t[l*2]=1,i.depth[l]=0,i.opt_len--,n&&(i.static_len-=r[l*2+1]);for(e.max_code=c,s=i.heap_len>>1;s>=1;s--)_s(i,t,s);l=a;do s=i.heap[1],i.heap[1]=i.heap[i.heap_len--],_s(i,t,1),o=i.heap[1],i.heap[--i.heap_max]=s,i.heap[--i.heap_max]=o,t[l*2]=t[s*2]+t[o*2],i.depth[l]=(i.depth[s]>=i.depth[o]?i.depth[s]:i.depth[o])+1,t[s*2+1]=t[o*2+1]=l,i.heap[1]=l++,_s(i,t,1);while(i.heap_len>=2);i.heap[--i.heap_max]=i.heap[1],Qd(i,e),Rl(t,c,i.bl_count)},sc=(i,e,t)=>{let r,n=-1,a,s=e[0*2+1],o=0,c=7,l=4;for(s===0&&(c=138,l=3),e[(t+1)*2+1]=65535,r=0;r<=t;r++)a=s,s=e[(r+1)*2+1],!(++o<c&&a===s)&&(o<l?i.bl_tree[a*2]+=o:a!==0?(a!==n&&i.bl_tree[a*2]++,i.bl_tree[Al*2]++):o<=10?i.bl_tree[$l*2]++:i.bl_tree[Il*2]++,o=0,n=a,s===0?(c=138,l=3):a===s?(c=6,l=3):(c=7,l=4))},oc=(i,e,t)=>{let r,n=-1,a,s=e[0*2+1],o=0,c=7,l=4;for(s===0&&(c=138,l=3),r=0;r<=t;r++)if(a=s,s=e[(r+1)*2+1],!(++o<c&&a===s)){if(o<l)do wt(i,a,i.bl_tree);while(--o!==0);else a!==0?(a!==n&&(wt(i,a,i.bl_tree),o--),wt(i,Al,i.bl_tree),We(i,o-3,2)):o<=10?(wt(i,$l,i.bl_tree),We(i,o-3,3)):(wt(i,Il,i.bl_tree),We(i,o-11,7));o=0,n=a,s===0?(c=138,l=3):a===s?(c=6,l=3):(c=7,l=4)}},Zd=i=>{let e;for(sc(i,i.dyn_ltree,i.l_desc.max_code),sc(i,i.dyn_dtree,i.d_desc.max_code),Hs(i,i.bl_desc),e=uo-1;e>=3&&i.bl_tree[kl[e]*2+1]===0;e--);return i.opt_len+=3*(e+1)+5+5+4,e},Jd=(i,e,t,r)=>{let n;for(We(i,e-257,5),We(i,t-1,5),We(i,r-4,4),n=0;n<r;n++)We(i,i.bl_tree[kl[n]*2+1],3);oc(i,i.dyn_ltree,e-1),oc(i,i.dyn_dtree,t-1)},Yd=i=>{let e=4093624447,t;for(t=0;t<=31;t++,e>>>=1)if(e&1&&i.dyn_ltree[t*2]!==0)return ic;if(i.dyn_ltree[9*2]!==0||i.dyn_ltree[10*2]!==0||i.dyn_ltree[13*2]!==0)return rc;for(t=32;t<xn;t++)if(i.dyn_ltree[t*2]!==0)return rc;return ic},cc=!1,Xd=i=>{cc||(Wd(),cc=!0),i.l_desc=new bs(i.dyn_ltree,Tl),i.d_desc=new bs(i.dyn_dtree,Cl),i.bl_desc=new bs(i.bl_tree,Nl),i.bi_buf=0,i.bi_valid=0,Ol(i)},Ml=(i,e,t,r)=>{We(i,(jd<<1)+(r?1:0),3),Dl(i),mn(i,t),mn(i,~t),t&&i.pending_buf.set(i.window.subarray(e,e+t),i.pending),i.pending+=t},ep=i=>{We(i,El<<1,3),wt(i,po,Ot),Kd(i)},tp=(i,e,t,r)=>{let n,a,s=0;i.level>0?(i.strm.data_type===Fd&&(i.strm.data_type=Yd(i)),Hs(i,i.l_desc),Hs(i,i.d_desc),s=Zd(i),n=i.opt_len+3+7>>>3,a=i.static_len+3+7>>>3,a<=n&&(n=a)):n=a=t+5,t+4<=n&&e!==-1?Ml(i,e,t,r):i.strategy===Ud||a===n?(We(i,(El<<1)+(r?1:0),3),ac(i,Ot,sn)):(We(i,(Bd<<1)+(r?1:0),3),Jd(i,i.l_desc.max_code+1,i.d_desc.max_code+1,s+1),ac(i,i.dyn_ltree,i.dyn_dtree)),Ol(i),r&&Dl(i)},ip=(i,e,t)=>(i.pending_buf[i.sym_buf+i.sym_next++]=e,i.pending_buf[i.sym_buf+i.sym_next++]=e>>8,i.pending_buf[i.sym_buf+i.sym_next++]=t,e===0?i.dyn_ltree[t*2]++:(i.matches++,e--,i.dyn_ltree[(gn[t]+xn+1)*2]++,i.dyn_dtree[Ll(e)*2]++),i.sym_next===i.sym_end),rp=Xd,np=Ml,ap=tp,sp=ip,op=ep,cp={_tr_init:rp,_tr_stored_block:np,_tr_flush_block:ap,_tr_tally:sp,_tr_align:op},lp=(i,e,t,r)=>{let n=i&65535|0,a=i>>>16&65535|0,s=0;for(;t!==0;){s=t>2e3?2e3:t,t-=s;do n=n+e[r++]|0,a=a+n|0;while(--s);n%=65521,a%=65521}return n|a<<16|0},yn=lp,up=()=>{let i,e=[];for(var t=0;t<256;t++){i=t;for(var r=0;r<8;r++)i=i&1?3988292384^i>>>1:i>>>1;e[t]=i}return e},dp=new Uint32Array(up()),pp=(i,e,t,r)=>{let n=dp,a=r+t;i^=-1;for(let s=r;s<a;s++)i=i>>>8^n[(i^e[s])&255];return i^-1},xe=pp,Ui={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"},Ki={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:fp,_tr_stored_block:Gs,_tr_flush_block:hp,_tr_tally:Jt,_tr_align:gp}=cp,{Z_NO_FLUSH:Yt,Z_PARTIAL_FLUSH:mp,Z_FULL_FLUSH:yp,Z_FINISH:lt,Z_BLOCK:lc,Z_OK:Ce,Z_STREAM_END:uc,Z_STREAM_ERROR:xt,Z_DATA_ERROR:vp,Z_BUF_ERROR:Ss,Z_DEFAULT_COMPRESSION:bp,Z_FILTERED:_p,Z_HUFFMAN_ONLY:Kn,Z_RLE:Sp,Z_FIXED:wp,Z_DEFAULT_STRATEGY:Ep,Z_UNKNOWN:xp,Z_DEFLATED:Va}=Ki,Ap=9,$p=15,Ip=8,kp=29,Tp=256,Ks=Tp+1+kp,Cp=30,Np=19,Lp=2*Ks+1,Pp=15,J=3,Kt=258,At=Kt+J+1,Rp=32,br=42,ho=57,Qs=69,Ws=73,Zs=91,Js=103,ki=113,Xr=666,ze=1,kr=2,Fi=3,Tr=4,Op=3,Ti=(i,e)=>(i.msg=Ui[e],e),dc=i=>i*2-(i>4?9:0),Gt=i=>{let e=i.length;for(;--e>=0;)i[e]=0},Dp=i=>{let e,t,r,n=i.w_size;e=i.hash_size,r=e;do t=i.head[--r],i.head[r]=t>=n?t-n:0;while(--e);e=n,r=e;do t=i.prev[--r],i.prev[r]=t>=n?t-n:0;while(--e)},Mp=(i,e,t)=>(e<<i.hash_shift^t)&i.hash_mask,Xt=Mp,Ye=i=>{let e=i.state,t=e.pending;t>i.avail_out&&(t=i.avail_out),t!==0&&(i.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+t),i.next_out),i.next_out+=t,e.pending_out+=t,i.total_out+=t,i.avail_out-=t,e.pending-=t,e.pending===0&&(e.pending_out=0))},et=(i,e)=>{hp(i,i.block_start>=0?i.block_start:-1,i.strstart-i.block_start,e),i.block_start=i.strstart,Ye(i.strm)},te=(i,e)=>{i.pending_buf[i.pending++]=e},Ur=(i,e)=>{i.pending_buf[i.pending++]=e>>>8&255,i.pending_buf[i.pending++]=e&255},Ys=(i,e,t,r)=>{let n=i.avail_in;return n>r&&(n=r),n===0?0:(i.avail_in-=n,e.set(i.input.subarray(i.next_in,i.next_in+n),t),i.state.wrap===1?i.adler=yn(i.adler,e,n,t):i.state.wrap===2&&(i.adler=xe(i.adler,e,n,t)),i.next_in+=n,i.total_in+=n,n)},Ul=(i,e)=>{let t=i.max_chain_length,r=i.strstart,n,a,s=i.prev_length,o=i.nice_match,c=i.strstart>i.w_size-At?i.strstart-(i.w_size-At):0,l=i.window,u=i.w_mask,m=i.prev,h=i.strstart+Kt,d=l[r+s-1],g=l[r+s];i.prev_length>=i.good_match&&(t>>=2),o>i.lookahead&&(o=i.lookahead);do if(n=e,!(l[n+s]!==g||l[n+s-1]!==d||l[n]!==l[r]||l[++n]!==l[r+1])){r+=2,n++;do;while(l[++r]===l[++n]&&l[++r]===l[++n]&&l[++r]===l[++n]&&l[++r]===l[++n]&&l[++r]===l[++n]&&l[++r]===l[++n]&&l[++r]===l[++n]&&l[++r]===l[++n]&&r<h);if(a=Kt-(h-r),r=h-Kt,a>s){if(i.match_start=e,s=a,a>=o)break;d=l[r+s-1],g=l[r+s]}}while((e=m[e&u])>c&&--t!==0);return s<=i.lookahead?s:i.lookahead},_r=i=>{let e=i.w_size,t,r,n;do{if(r=i.window_size-i.lookahead-i.strstart,i.strstart>=e+(e-At)&&(i.window.set(i.window.subarray(e,e+e-r),0),i.match_start-=e,i.strstart-=e,i.block_start-=e,i.insert>i.strstart&&(i.insert=i.strstart),Dp(i),r+=e),i.strm.avail_in===0)break;if(t=Ys(i.strm,i.window,i.strstart+i.lookahead,r),i.lookahead+=t,i.lookahead+i.insert>=J)for(n=i.strstart-i.insert,i.ins_h=i.window[n],i.ins_h=Xt(i,i.ins_h,i.window[n+1]);i.insert&&(i.ins_h=Xt(i,i.ins_h,i.window[n+J-1]),i.prev[n&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=n,n++,i.insert--,!(i.lookahead+i.insert<J)););}while(i.lookahead<At&&i.strm.avail_in!==0)},Fl=(i,e)=>{let t=i.pending_buf_size-5>i.w_size?i.w_size:i.pending_buf_size-5,r,n,a,s=0,o=i.strm.avail_in;do{if(r=65535,a=i.bi_valid+42>>3,i.strm.avail_out<a||(a=i.strm.avail_out-a,n=i.strstart-i.block_start,r>n+i.strm.avail_in&&(r=n+i.strm.avail_in),r>a&&(r=a),r<t&&(r===0&&e!==lt||e===Yt||r!==n+i.strm.avail_in)))break;s=e===lt&&r===n+i.strm.avail_in?1:0,Gs(i,0,0,s),i.pending_buf[i.pending-4]=r,i.pending_buf[i.pending-3]=r>>8,i.pending_buf[i.pending-2]=~r,i.pending_buf[i.pending-1]=~r>>8,Ye(i.strm),n&&(n>r&&(n=r),i.strm.output.set(i.window.subarray(i.block_start,i.block_start+n),i.strm.next_out),i.strm.next_out+=n,i.strm.avail_out-=n,i.strm.total_out+=n,i.block_start+=n,r-=n),r&&(Ys(i.strm,i.strm.output,i.strm.next_out,r),i.strm.next_out+=r,i.strm.avail_out-=r,i.strm.total_out+=r)}while(s===0);return o-=i.strm.avail_in,o&&(o>=i.w_size?(i.matches=2,i.window.set(i.strm.input.subarray(i.strm.next_in-i.w_size,i.strm.next_in),0),i.strstart=i.w_size,i.insert=i.strstart):(i.window_size-i.strstart<=o&&(i.strstart-=i.w_size,i.window.set(i.window.subarray(i.w_size,i.w_size+i.strstart),0),i.matches<2&&i.matches++,i.insert>i.strstart&&(i.insert=i.strstart)),i.window.set(i.strm.input.subarray(i.strm.next_in-o,i.strm.next_in),i.strstart),i.strstart+=o,i.insert+=o>i.w_size-i.insert?i.w_size-i.insert:o),i.block_start=i.strstart),i.high_water<i.strstart&&(i.high_water=i.strstart),s?Tr:e!==Yt&&e!==lt&&i.strm.avail_in===0&&i.strstart===i.block_start?kr:(a=i.window_size-i.strstart,i.strm.avail_in>a&&i.block_start>=i.w_size&&(i.block_start-=i.w_size,i.strstart-=i.w_size,i.window.set(i.window.subarray(i.w_size,i.w_size+i.strstart),0),i.matches<2&&i.matches++,a+=i.w_size,i.insert>i.strstart&&(i.insert=i.strstart)),a>i.strm.avail_in&&(a=i.strm.avail_in),a&&(Ys(i.strm,i.window,i.strstart,a),i.strstart+=a,i.insert+=a>i.w_size-i.insert?i.w_size-i.insert:a),i.high_water<i.strstart&&(i.high_water=i.strstart),a=i.bi_valid+42>>3,a=i.pending_buf_size-a>65535?65535:i.pending_buf_size-a,t=a>i.w_size?i.w_size:a,n=i.strstart-i.block_start,(n>=t||(n||e===lt)&&e!==Yt&&i.strm.avail_in===0&&n<=a)&&(r=n>a?a:n,s=e===lt&&i.strm.avail_in===0&&r===n?1:0,Gs(i,i.block_start,r,s),i.block_start+=r,Ye(i.strm)),s?Fi:ze)},ws=(i,e)=>{let t,r;for(;;){if(i.lookahead<At){if(_r(i),i.lookahead<At&&e===Yt)return ze;if(i.lookahead===0)break}if(t=0,i.lookahead>=J&&(i.ins_h=Xt(i,i.ins_h,i.window[i.strstart+J-1]),t=i.prev[i.strstart&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=i.strstart),t!==0&&i.strstart-t<=i.w_size-At&&(i.match_length=Ul(i,t)),i.match_length>=J)if(r=Jt(i,i.strstart-i.match_start,i.match_length-J),i.lookahead-=i.match_length,i.match_length<=i.max_lazy_match&&i.lookahead>=J){i.match_length--;do i.strstart++,i.ins_h=Xt(i,i.ins_h,i.window[i.strstart+J-1]),t=i.prev[i.strstart&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=i.strstart;while(--i.match_length!==0);i.strstart++}else i.strstart+=i.match_length,i.match_length=0,i.ins_h=i.window[i.strstart],i.ins_h=Xt(i,i.ins_h,i.window[i.strstart+1]);else r=Jt(i,0,i.window[i.strstart]),i.lookahead--,i.strstart++;if(r&&(et(i,!1),i.strm.avail_out===0))return ze}return i.insert=i.strstart<J-1?i.strstart:J-1,e===lt?(et(i,!0),i.strm.avail_out===0?Fi:Tr):i.sym_next&&(et(i,!1),i.strm.avail_out===0)?ze:kr},or=(i,e)=>{let t,r,n;for(;;){if(i.lookahead<At){if(_r(i),i.lookahead<At&&e===Yt)return ze;if(i.lookahead===0)break}if(t=0,i.lookahead>=J&&(i.ins_h=Xt(i,i.ins_h,i.window[i.strstart+J-1]),t=i.prev[i.strstart&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=i.strstart),i.prev_length=i.match_length,i.prev_match=i.match_start,i.match_length=J-1,t!==0&&i.prev_length<i.max_lazy_match&&i.strstart-t<=i.w_size-At&&(i.match_length=Ul(i,t),i.match_length<=5&&(i.strategy===_p||i.match_length===J&&i.strstart-i.match_start>4096)&&(i.match_length=J-1)),i.prev_length>=J&&i.match_length<=i.prev_length){n=i.strstart+i.lookahead-J,r=Jt(i,i.strstart-1-i.prev_match,i.prev_length-J),i.lookahead-=i.prev_length-1,i.prev_length-=2;do++i.strstart<=n&&(i.ins_h=Xt(i,i.ins_h,i.window[i.strstart+J-1]),t=i.prev[i.strstart&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=i.strstart);while(--i.prev_length!==0);if(i.match_available=0,i.match_length=J-1,i.strstart++,r&&(et(i,!1),i.strm.avail_out===0))return ze}else if(i.match_available){if(r=Jt(i,0,i.window[i.strstart-1]),r&&et(i,!1),i.strstart++,i.lookahead--,i.strm.avail_out===0)return ze}else i.match_available=1,i.strstart++,i.lookahead--}return i.match_available&&(r=Jt(i,0,i.window[i.strstart-1]),i.match_available=0),i.insert=i.strstart<J-1?i.strstart:J-1,e===lt?(et(i,!0),i.strm.avail_out===0?Fi:Tr):i.sym_next&&(et(i,!1),i.strm.avail_out===0)?ze:kr},Up=(i,e)=>{let t,r,n,a,s=i.window;for(;;){if(i.lookahead<=Kt){if(_r(i),i.lookahead<=Kt&&e===Yt)return ze;if(i.lookahead===0)break}if(i.match_length=0,i.lookahead>=J&&i.strstart>0&&(n=i.strstart-1,r=s[n],r===s[++n]&&r===s[++n]&&r===s[++n])){a=i.strstart+Kt;do;while(r===s[++n]&&r===s[++n]&&r===s[++n]&&r===s[++n]&&r===s[++n]&&r===s[++n]&&r===s[++n]&&r===s[++n]&&n<a);i.match_length=Kt-(a-n),i.match_length>i.lookahead&&(i.match_length=i.lookahead)}if(i.match_length>=J?(t=Jt(i,1,i.match_length-J),i.lookahead-=i.match_length,i.strstart+=i.match_length,i.match_length=0):(t=Jt(i,0,i.window[i.strstart]),i.lookahead--,i.strstart++),t&&(et(i,!1),i.strm.avail_out===0))return ze}return i.insert=0,e===lt?(et(i,!0),i.strm.avail_out===0?Fi:Tr):i.sym_next&&(et(i,!1),i.strm.avail_out===0)?ze:kr},Fp=(i,e)=>{let t;for(;;){if(i.lookahead===0&&(_r(i),i.lookahead===0)){if(e===Yt)return ze;break}if(i.match_length=0,t=Jt(i,0,i.window[i.strstart]),i.lookahead--,i.strstart++,t&&(et(i,!1),i.strm.avail_out===0))return ze}return i.insert=0,e===lt?(et(i,!0),i.strm.avail_out===0?Fi:Tr):i.sym_next&&(et(i,!1),i.strm.avail_out===0)?ze:kr};function yt(i,e,t,r,n){this.good_length=i,this.max_lazy=e,this.nice_length=t,this.max_chain=r,this.func=n}var en=[new yt(0,0,0,0,Fl),new yt(4,4,8,4,ws),new yt(4,5,16,8,ws),new yt(4,6,32,32,ws),new yt(4,4,16,16,or),new yt(8,16,32,32,or),new yt(8,16,128,128,or),new yt(8,32,128,256,or),new yt(32,128,258,1024,or),new yt(32,258,258,4096,or)],jp=i=>{i.window_size=2*i.w_size,Gt(i.head),i.max_lazy_match=en[i.level].max_lazy,i.good_match=en[i.level].good_length,i.nice_match=en[i.level].nice_length,i.max_chain_length=en[i.level].max_chain,i.strstart=0,i.block_start=0,i.lookahead=0,i.insert=0,i.match_length=i.prev_length=J-1,i.match_available=0,i.ins_h=0};function Bp(){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=Va,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(Lp*2),this.dyn_dtree=new Uint16Array((2*Cp+1)*2),this.bl_tree=new Uint16Array((2*Np+1)*2),Gt(this.dyn_ltree),Gt(this.dyn_dtree),Gt(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(Pp+1),this.heap=new Uint16Array(2*Ks+1),Gt(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*Ks+1),Gt(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 An=i=>{if(!i)return 1;let e=i.state;return!e||e.strm!==i||e.status!==br&&e.status!==ho&&e.status!==Qs&&e.status!==Ws&&e.status!==Zs&&e.status!==Js&&e.status!==ki&&e.status!==Xr?1:0},jl=i=>{if(An(i))return Ti(i,xt);i.total_in=i.total_out=0,i.data_type=xp;let e=i.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap===2?ho:e.wrap?br:ki,i.adler=e.wrap===2?0:1,e.last_flush=-2,fp(e),Ce},Bl=i=>{let e=jl(i);return e===Ce&&jp(i.state),e},qp=(i,e)=>An(i)||i.state.wrap!==2?xt:(i.state.gzhead=e,Ce),ql=(i,e,t,r,n,a)=>{if(!i)return xt;let s=1;if(e===bp&&(e=6),r<0?(s=0,r=-r):r>15&&(s=2,r-=16),n<1||n>Ap||t!==Va||r<8||r>15||e<0||e>9||a<0||a>wp||r===8&&s!==1)return Ti(i,xt);r===8&&(r=9);let o=new Bp;return i.state=o,o.strm=i,o.status=br,o.wrap=s,o.gzhead=null,o.w_bits=r,o.w_size=1<<o.w_bits,o.w_mask=o.w_size-1,o.hash_bits=n+7,o.hash_size=1<<o.hash_bits,o.hash_mask=o.hash_size-1,o.hash_shift=~~((o.hash_bits+J-1)/J),o.window=new Uint8Array(o.w_size*2),o.head=new Uint16Array(o.hash_size),o.prev=new Uint16Array(o.w_size),o.lit_bufsize=1<<n+6,o.pending_buf_size=o.lit_bufsize*4,o.pending_buf=new Uint8Array(o.pending_buf_size),o.sym_buf=o.lit_bufsize,o.sym_end=(o.lit_bufsize-1)*3,o.level=e,o.strategy=a,o.method=t,Bl(i)},Vp=(i,e)=>ql(i,e,Va,$p,Ip,Ep),zp=(i,e)=>{if(An(i)||e>lc||e<0)return i?Ti(i,xt):xt;let t=i.state;if(!i.output||i.avail_in!==0&&!i.input||t.status===Xr&&e!==lt)return Ti(i,i.avail_out===0?Ss:xt);let r=t.last_flush;if(t.last_flush=e,t.pending!==0){if(Ye(i),i.avail_out===0)return t.last_flush=-1,Ce}else if(i.avail_in===0&&dc(e)<=dc(r)&&e!==lt)return Ti(i,Ss);if(t.status===Xr&&i.avail_in!==0)return Ti(i,Ss);if(t.status===br&&t.wrap===0&&(t.status=ki),t.status===br){let n=Va+(t.w_bits-8<<4)<<8,a=-1;if(t.strategy>=Kn||t.level<2?a=0:t.level<6?a=1:t.level===6?a=2:a=3,n|=a<<6,t.strstart!==0&&(n|=Rp),n+=31-n%31,Ur(t,n),t.strstart!==0&&(Ur(t,i.adler>>>16),Ur(t,i.adler&65535)),i.adler=1,t.status=ki,Ye(i),t.pending!==0)return t.last_flush=-1,Ce}if(t.status===ho){if(i.adler=0,te(t,31),te(t,139),te(t,8),t.gzhead)te(t,(t.gzhead.text?1:0)+(t.gzhead.hcrc?2:0)+(t.gzhead.extra?4:0)+(t.gzhead.name?8:0)+(t.gzhead.comment?16:0)),te(t,t.gzhead.time&255),te(t,t.gzhead.time>>8&255),te(t,t.gzhead.time>>16&255),te(t,t.gzhead.time>>24&255),te(t,t.level===9?2:t.strategy>=Kn||t.level<2?4:0),te(t,t.gzhead.os&255),t.gzhead.extra&&t.gzhead.extra.length&&(te(t,t.gzhead.extra.length&255),te(t,t.gzhead.extra.length>>8&255)),t.gzhead.hcrc&&(i.adler=xe(i.adler,t.pending_buf,t.pending,0)),t.gzindex=0,t.status=Qs;else if(te(t,0),te(t,0),te(t,0),te(t,0),te(t,0),te(t,t.level===9?2:t.strategy>=Kn||t.level<2?4:0),te(t,Op),t.status=ki,Ye(i),t.pending!==0)return t.last_flush=-1,Ce}if(t.status===Qs){if(t.gzhead.extra){let n=t.pending,a=(t.gzhead.extra.length&65535)-t.gzindex;for(;t.pending+a>t.pending_buf_size;){let o=t.pending_buf_size-t.pending;if(t.pending_buf.set(t.gzhead.extra.subarray(t.gzindex,t.gzindex+o),t.pending),t.pending=t.pending_buf_size,t.gzhead.hcrc&&t.pending>n&&(i.adler=xe(i.adler,t.pending_buf,t.pending-n,n)),t.gzindex+=o,Ye(i),t.pending!==0)return t.last_flush=-1,Ce;n=0,a-=o}let s=new Uint8Array(t.gzhead.extra);t.pending_buf.set(s.subarray(t.gzindex,t.gzindex+a),t.pending),t.pending+=a,t.gzhead.hcrc&&t.pending>n&&(i.adler=xe(i.adler,t.pending_buf,t.pending-n,n)),t.gzindex=0}t.status=Ws}if(t.status===Ws){if(t.gzhead.name){let n=t.pending,a;do{if(t.pending===t.pending_buf_size){if(t.gzhead.hcrc&&t.pending>n&&(i.adler=xe(i.adler,t.pending_buf,t.pending-n,n)),Ye(i),t.pending!==0)return t.last_flush=-1,Ce;n=0}t.gzindex<t.gzhead.name.length?a=t.gzhead.name.charCodeAt(t.gzindex++)&255:a=0,te(t,a)}while(a!==0);t.gzhead.hcrc&&t.pending>n&&(i.adler=xe(i.adler,t.pending_buf,t.pending-n,n)),t.gzindex=0}t.status=Zs}if(t.status===Zs){if(t.gzhead.comment){let n=t.pending,a;do{if(t.pending===t.pending_buf_size){if(t.gzhead.hcrc&&t.pending>n&&(i.adler=xe(i.adler,t.pending_buf,t.pending-n,n)),Ye(i),t.pending!==0)return t.last_flush=-1,Ce;n=0}t.gzindex<t.gzhead.comment.length?a=t.gzhead.comment.charCodeAt(t.gzindex++)&255:a=0,te(t,a)}while(a!==0);t.gzhead.hcrc&&t.pending>n&&(i.adler=xe(i.adler,t.pending_buf,t.pending-n,n))}t.status=Js}if(t.status===Js){if(t.gzhead.hcrc){if(t.pending+2>t.pending_buf_size&&(Ye(i),t.pending!==0))return t.last_flush=-1,Ce;te(t,i.adler&255),te(t,i.adler>>8&255),i.adler=0}if(t.status=ki,Ye(i),t.pending!==0)return t.last_flush=-1,Ce}if(i.avail_in!==0||t.lookahead!==0||e!==Yt&&t.status!==Xr){let n=t.level===0?Fl(t,e):t.strategy===Kn?Fp(t,e):t.strategy===Sp?Up(t,e):en[t.level].func(t,e);if((n===Fi||n===Tr)&&(t.status=Xr),n===ze||n===Fi)return i.avail_out===0&&(t.last_flush=-1),Ce;if(n===kr&&(e===mp?gp(t):e!==lc&&(Gs(t,0,0,!1),e===yp&&(Gt(t.head),t.lookahead===0&&(t.strstart=0,t.block_start=0,t.insert=0))),Ye(i),i.avail_out===0))return t.last_flush=-1,Ce}return e!==lt?Ce:t.wrap<=0?uc:(t.wrap===2?(te(t,i.adler&255),te(t,i.adler>>8&255),te(t,i.adler>>16&255),te(t,i.adler>>24&255),te(t,i.total_in&255),te(t,i.total_in>>8&255),te(t,i.total_in>>16&255),te(t,i.total_in>>24&255)):(Ur(t,i.adler>>>16),Ur(t,i.adler&65535)),Ye(i),t.wrap>0&&(t.wrap=-t.wrap),t.pending!==0?Ce:uc)},Hp=i=>{if(An(i))return xt;let e=i.state.status;return i.state=null,e===ki?Ti(i,vp):Ce},Gp=(i,e)=>{let t=e.length;if(An(i))return xt;let r=i.state,n=r.wrap;if(n===2||n===1&&r.status!==br||r.lookahead)return xt;if(n===1&&(i.adler=yn(i.adler,e,t,0)),r.wrap=0,t>=r.w_size){n===0&&(Gt(r.head),r.strstart=0,r.block_start=0,r.insert=0);let c=new Uint8Array(r.w_size);c.set(e.subarray(t-r.w_size,t),0),e=c,t=r.w_size}let a=i.avail_in,s=i.next_in,o=i.input;for(i.avail_in=t,i.next_in=0,i.input=e,_r(r);r.lookahead>=J;){let c=r.strstart,l=r.lookahead-(J-1);do r.ins_h=Xt(r,r.ins_h,r.window[c+J-1]),r.prev[c&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=c,c++;while(--l);r.strstart=c,r.lookahead=J-1,_r(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=J-1,r.match_available=0,i.next_in=s,i.input=o,i.avail_in=a,r.wrap=n,Ce},Kp=Vp,Qp=ql,Wp=Bl,Zp=jl,Jp=qp,Yp=zp,Xp=Hp,ef=Gp,tf="pako deflate (from Nodeca project)",on={deflateInit:Kp,deflateInit2:Qp,deflateReset:Wp,deflateResetKeep:Zp,deflateSetHeader:Jp,deflate:Yp,deflateEnd:Xp,deflateSetDictionary:ef,deflateInfo:tf},rf=(i,e)=>Object.prototype.hasOwnProperty.call(i,e),nf=function(i){let e=Array.prototype.slice.call(arguments,1);for(;e.length;){let t=e.shift();if(!!t){if(typeof t!="object")throw new TypeError(t+"must be non-object");for(let r in t)rf(t,r)&&(i[r]=t[r])}}return i},af=i=>{let e=0;for(let r=0,n=i.length;r<n;r++)e+=i[r].length;let t=new Uint8Array(e);for(let r=0,n=0,a=i.length;r<a;r++){let s=i[r];t.set(s,n),n+=s.length}return t},za={assign:nf,flattenChunks:af},Vl=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(i){Vl=!1}var vn=new Uint8Array(256);for(let i=0;i<256;i++)vn[i]=i>=252?6:i>=248?5:i>=240?4:i>=224?3:i>=192?2:1;vn[254]=vn[254]=1;var sf=i=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(i);let e,t,r,n,a,s=i.length,o=0;for(n=0;n<s;n++)t=i.charCodeAt(n),(t&64512)===55296&&n+1<s&&(r=i.charCodeAt(n+1),(r&64512)===56320&&(t=65536+(t-55296<<10)+(r-56320),n++)),o+=t<128?1:t<2048?2:t<65536?3:4;for(e=new Uint8Array(o),a=0,n=0;a<o;n++)t=i.charCodeAt(n),(t&64512)===55296&&n+1<s&&(r=i.charCodeAt(n+1),(r&64512)===56320&&(t=65536+(t-55296<<10)+(r-56320),n++)),t<128?e[a++]=t:t<2048?(e[a++]=192|t>>>6,e[a++]=128|t&63):t<65536?(e[a++]=224|t>>>12,e[a++]=128|t>>>6&63,e[a++]=128|t&63):(e[a++]=240|t>>>18,e[a++]=128|t>>>12&63,e[a++]=128|t>>>6&63,e[a++]=128|t&63);return e},of=(i,e)=>{if(e<65534&&i.subarray&&Vl)return String.fromCharCode.apply(null,i.length===e?i:i.subarray(0,e));let t="";for(let r=0;r<e;r++)t+=String.fromCharCode(i[r]);return t},cf=(i,e)=>{let t=e||i.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(i.subarray(0,e));let r,n,a=new Array(t*2);for(n=0,r=0;r<t;){let s=i[r++];if(s<128){a[n++]=s;continue}let o=vn[s];if(o>4){a[n++]=65533,r+=o-1;continue}for(s&=o===2?31:o===3?15:7;o>1&&r<t;)s=s<<6|i[r++]&63,o--;if(o>1){a[n++]=65533;continue}s<65536?a[n++]=s:(s-=65536,a[n++]=55296|s>>10&1023,a[n++]=56320|s&1023)}return of(a,n)},lf=(i,e)=>{e=e||i.length,e>i.length&&(e=i.length);let t=e-1;for(;t>=0&&(i[t]&192)===128;)t--;return t<0||t===0?e:t+vn[i[t]]>e?t:e},bn={string2buf:sf,buf2string:cf,utf8border:lf};function uf(){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 zl=uf,Hl=Object.prototype.toString,{Z_NO_FLUSH:df,Z_SYNC_FLUSH:pf,Z_FULL_FLUSH:ff,Z_FINISH:hf,Z_OK:Na,Z_STREAM_END:gf,Z_DEFAULT_COMPRESSION:mf,Z_DEFAULT_STRATEGY:yf,Z_DEFLATED:vf}=Ki;function $n(i){this.options=za.assign({level:mf,method:vf,chunkSize:16384,windowBits:15,memLevel:8,strategy:yf},i||{});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 zl,this.strm.avail_out=0;let t=on.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(t!==Na)throw new Error(Ui[t]);if(e.header&&on.deflateSetHeader(this.strm,e.header),e.dictionary){let r;if(typeof e.dictionary=="string"?r=bn.string2buf(e.dictionary):Hl.call(e.dictionary)==="[object ArrayBuffer]"?r=new Uint8Array(e.dictionary):r=e.dictionary,t=on.deflateSetDictionary(this.strm,r),t!==Na)throw new Error(Ui[t]);this._dict_set=!0}}$n.prototype.push=function(i,e){let t=this.strm,r=this.options.chunkSize,n,a;if(this.ended)return!1;for(e===~~e?a=e:a=e===!0?hf:df,typeof i=="string"?t.input=bn.string2buf(i):Hl.call(i)==="[object ArrayBuffer]"?t.input=new Uint8Array(i):t.input=i,t.next_in=0,t.avail_in=t.input.length;;){if(t.avail_out===0&&(t.output=new Uint8Array(r),t.next_out=0,t.avail_out=r),(a===pf||a===ff)&&t.avail_out<=6){this.onData(t.output.subarray(0,t.next_out)),t.avail_out=0;continue}if(n=on.deflate(t,a),n===gf)return t.next_out>0&&this.onData(t.output.subarray(0,t.next_out)),n=on.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===Na;if(t.avail_out===0){this.onData(t.output);continue}if(a>0&&t.next_out>0){this.onData(t.output.subarray(0,t.next_out)),t.avail_out=0;continue}if(t.avail_in===0)break}return!0};$n.prototype.onData=function(i){this.chunks.push(i)};$n.prototype.onEnd=function(i){i===Na&&(this.result=za.flattenChunks(this.chunks)),this.chunks=[],this.err=i,this.msg=this.strm.msg};function go(i,e){let t=new $n(e);if(t.push(i,!0),t.err)throw t.msg||Ui[t.err];return t.result}function bf(i,e){return e=e||{},e.raw=!0,go(i,e)}function _f(i,e){return e=e||{},e.gzip=!0,go(i,e)}var Sf=$n,wf=go,Ef=bf,xf=_f,Af=Ki,$f={Deflate:Sf,deflate:wf,deflateRaw:Ef,gzip:xf,constants:Af},Qn=16209,If=16191,kf=function i(e,t){let r,n,a,s,o,c,l,u,m,h,d,g,v,E,$,N,O,A,k,Z,I,K,C,T,D=e.state;r=e.next_in,C=e.input,n=r+(e.avail_in-5),a=e.next_out,T=e.output,s=a-(t-e.avail_out),o=a+(e.avail_out-257),c=D.dmax,l=D.wsize,u=D.whave,m=D.wnext,h=D.window,d=D.hold,g=D.bits,v=D.lencode,E=D.distcode,$=(1<<D.lenbits)-1,N=(1<<D.distbits)-1;e:do{g<15&&(d+=C[r++]<<g,g+=8,d+=C[r++]<<g,g+=8),O=v[d&$];t:for(;;){if(A=O>>>24,d>>>=A,g-=A,A=O>>>16&255,A===0)T[a++]=O&65535;else if(A&16){k=O&65535,A&=15,A&&(g<A&&(d+=C[r++]<<g,g+=8),k+=d&(1<<A)-1,d>>>=A,g-=A),g<15&&(d+=C[r++]<<g,g+=8,d+=C[r++]<<g,g+=8),O=E[d&N];i:for(;;){if(A=O>>>24,d>>>=A,g-=A,A=O>>>16&255,A&16){if(Z=O&65535,A&=15,g<A&&(d+=C[r++]<<g,g+=8,g<A&&(d+=C[r++]<<g,g+=8)),Z+=d&(1<<A)-1,Z>c){e.msg="invalid distance too far back",D.mode=Qn;break e}if(d>>>=A,g-=A,A=a-s,Z>A){if(A=Z-A,A>u&&D.sane){e.msg="invalid distance too far back",D.mode=Qn;break e}if(I=0,K=h,m===0){if(I+=l-A,A<k){k-=A;do T[a++]=h[I++];while(--A);I=a-Z,K=T}}else if(m<A){if(I+=l+m-A,A-=m,A<k){k-=A;do T[a++]=h[I++];while(--A);if(I=0,m<k){A=m,k-=A;do T[a++]=h[I++];while(--A);I=a-Z,K=T}}}else if(I+=m-A,A<k){k-=A;do T[a++]=h[I++];while(--A);I=a-Z,K=T}for(;k>2;)T[a++]=K[I++],T[a++]=K[I++],T[a++]=K[I++],k-=3;k&&(T[a++]=K[I++],k>1&&(T[a++]=K[I++]))}else{I=a-Z;do T[a++]=T[I++],T[a++]=T[I++],T[a++]=T[I++],k-=3;while(k>2);k&&(T[a++]=T[I++],k>1&&(T[a++]=T[I++]))}}else if((A&64)===0){O=E[(O&65535)+(d&(1<<A)-1)];continue i}else{e.msg="invalid distance code",D.mode=Qn;break e}break}}else if((A&64)===0){O=v[(O&65535)+(d&(1<<A)-1)];continue t}else if(A&32){D.mode=If;break e}else{e.msg="invalid literal/length code",D.mode=Qn;break e}break}}while(r<n&&a<o);k=g>>3,r-=k,g-=k<<3,d&=(1<<g)-1,e.next_in=r,e.next_out=a,e.avail_in=r<n?5+(n-r):5-(r-n),e.avail_out=a<o?257+(o-a):257-(a-o),D.hold=d,D.bits=g},cr=15,pc=852,fc=592,hc=0,Es=1,gc=2,Tf=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]),Cf=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]),Nf=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]),Lf=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]),Pf=(i,e,t,r,n,a,s,o)=>{let c=o.bits,l=0,u=0,m=0,h=0,d=0,g=0,v=0,E=0,$=0,N=0,O,A,k,Z,I,K=null,C,T=new Uint16Array(cr+1),D=new Uint16Array(cr+1),Me=null,Ie,Se,Tn;for(l=0;l<=cr;l++)T[l]=0;for(u=0;u<r;u++)T[e[t+u]]++;for(d=c,h=cr;h>=1&&T[h]===0;h--);if(d>h&&(d=h),h===0)return n[a++]=1<<24|64<<16|0,n[a++]=1<<24|64<<16|0,o.bits=1,0;for(m=1;m<h&&T[m]===0;m++);for(d<m&&(d=m),E=1,l=1;l<=cr;l++)if(E<<=1,E-=T[l],E<0)return-1;if(E>0&&(i===hc||h!==1))return-1;for(D[1]=0,l=1;l<cr;l++)D[l+1]=D[l]+T[l];for(u=0;u<r;u++)e[t+u]!==0&&(s[D[e[t+u]]++]=u);if(i===hc?(K=Me=s,C=20):i===Es?(K=Tf,Me=Cf,C=257):(K=Nf,Me=Lf,C=0),N=0,u=0,l=m,I=a,g=d,v=0,k=-1,$=1<<d,Z=$-1,i===Es&&$>pc||i===gc&&$>fc)return 1;for(;;){Ie=l-v,s[u]+1<C?(Se=0,Tn=s[u]):s[u]>=C?(Se=Me[s[u]-C],Tn=K[s[u]-C]):(Se=32+64,Tn=0),O=1<<l-v,A=1<<g,m=A;do A-=O,n[I+(N>>v)+A]=Ie<<24|Se<<16|Tn|0;while(A!==0);for(O=1<<l-1;N&O;)O>>=1;if(O!==0?(N&=O-1,N+=O):N=0,u++,--T[l]===0){if(l===h)break;l=e[t+s[u]]}if(l>d&&(N&Z)!==k){for(v===0&&(v=d),I+=m,g=l-v,E=1<<g;g+v<h&&(E-=T[g+v],!(E<=0));)g++,E<<=1;if($+=1<<g,i===Es&&$>pc||i===gc&&$>fc)return 1;k=N&Z,n[k]=d<<24|g<<16|I-a|0}}return N!==0&&(n[I+N]=l-v<<24|64<<16|0),o.bits=d,0},cn=Pf,Rf=0,Gl=1,Kl=2,{Z_FINISH:mc,Z_BLOCK:Of,Z_TREES:Wn,Z_OK:ji,Z_STREAM_END:Df,Z_NEED_DICT:Mf,Z_STREAM_ERROR:ut,Z_DATA_ERROR:Ql,Z_MEM_ERROR:Wl,Z_BUF_ERROR:Uf,Z_DEFLATED:yc}=Ki,Ha=16180,vc=16181,bc=16182,_c=16183,Sc=16184,wc=16185,Ec=16186,xc=16187,Ac=16188,$c=16189,La=16190,Nt=16191,xs=16192,Ic=16193,As=16194,kc=16195,Tc=16196,Cc=16197,Nc=16198,Zn=16199,Jn=16200,Lc=16201,Pc=16202,Rc=16203,Oc=16204,Dc=16205,$s=16206,Mc=16207,Uc=16208,le=16209,Zl=16210,Jl=16211,Ff=852,jf=592,Bf=15,qf=Bf,Fc=i=>(i>>>24&255)+(i>>>8&65280)+((i&65280)<<8)+((i&255)<<24);function Vf(){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 Qi=i=>{if(!i)return 1;let e=i.state;return!e||e.strm!==i||e.mode<Ha||e.mode>Jl?1:0},Yl=i=>{if(Qi(i))return ut;let e=i.state;return i.total_in=i.total_out=e.total=0,i.msg="",e.wrap&&(i.adler=e.wrap&1),e.mode=Ha,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(Ff),e.distcode=e.distdyn=new Int32Array(jf),e.sane=1,e.back=-1,ji},Xl=i=>{if(Qi(i))return ut;let e=i.state;return e.wsize=0,e.whave=0,e.wnext=0,Yl(i)},eu=(i,e)=>{let t;if(Qi(i))return ut;let r=i.state;return e<0?(t=0,e=-e):(t=(e>>4)+5,e<48&&(e&=15)),e&&(e<8||e>15)?ut:(r.window!==null&&r.wbits!==e&&(r.window=null),r.wrap=t,r.wbits=e,Xl(i))},tu=(i,e)=>{if(!i)return ut;let t=new Vf;i.state=t,t.strm=i,t.window=null,t.mode=Ha;let r=eu(i,e);return r!==ji&&(i.state=null),r},zf=i=>tu(i,qf),jc=!0,Is,ks,Hf=i=>{if(jc){Is=new Int32Array(512),ks=new Int32Array(32);let e=0;for(;e<144;)i.lens[e++]=8;for(;e<256;)i.lens[e++]=9;for(;e<280;)i.lens[e++]=7;for(;e<288;)i.lens[e++]=8;for(cn(Gl,i.lens,0,288,Is,0,i.work,{bits:9}),e=0;e<32;)i.lens[e++]=5;cn(Kl,i.lens,0,32,ks,0,i.work,{bits:5}),jc=!1}i.lencode=Is,i.lenbits=9,i.distcode=ks,i.distbits=5},iu=(i,e,t,r)=>{let n,a=i.state;return a.window===null&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new Uint8Array(a.wsize)),r>=a.wsize?(a.window.set(e.subarray(t-a.wsize,t),0),a.wnext=0,a.whave=a.wsize):(n=a.wsize-a.wnext,n>r&&(n=r),a.window.set(e.subarray(t-r,t-r+n),a.wnext),r-=n,r?(a.window.set(e.subarray(t-r,t),0),a.wnext=r,a.whave=a.wsize):(a.wnext+=n,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=n))),0},Gf=(i,e)=>{let t,r,n,a,s,o,c,l,u,m,h,d,g,v,E=0,$,N,O,A,k,Z,I,K,C=new Uint8Array(4),T,D,Me=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Qi(i)||!i.output||!i.input&&i.avail_in!==0)return ut;t=i.state,t.mode===Nt&&(t.mode=xs),s=i.next_out,n=i.output,c=i.avail_out,a=i.next_in,r=i.input,o=i.avail_in,l=t.hold,u=t.bits,m=o,h=c,K=ji;e:for(;;)switch(t.mode){case Ha:if(t.wrap===0){t.mode=xs;break}for(;u<16;){if(o===0)break e;o--,l+=r[a++]<<u,u+=8}if(t.wrap&2&&l===35615){t.wbits===0&&(t.wbits=15),t.check=0,C[0]=l&255,C[1]=l>>>8&255,t.check=xe(t.check,C,2,0),l=0,u=0,t.mode=vc;break}if(t.head&&(t.head.done=!1),!(t.wrap&1)||(((l&255)<<8)+(l>>8))%31){i.msg="incorrect header check",t.mode=le;break}if((l&15)!==yc){i.msg="unknown compression method",t.mode=le;break}if(l>>>=4,u-=4,I=(l&15)+8,t.wbits===0&&(t.wbits=I),I>15||I>t.wbits){i.msg="invalid window size",t.mode=le;break}t.dmax=1<<t.wbits,t.flags=0,i.adler=t.check=1,t.mode=l&512?$c:Nt,l=0,u=0;break;case vc:for(;u<16;){if(o===0)break e;o--,l+=r[a++]<<u,u+=8}if(t.flags=l,(t.flags&255)!==yc){i.msg="unknown compression method",t.mode=le;break}if(t.flags&57344){i.msg="unknown header flags set",t.mode=le;break}t.head&&(t.head.text=l>>8&1),t.flags&512&&t.wrap&4&&(C[0]=l&255,C[1]=l>>>8&255,t.check=xe(t.check,C,2,0)),l=0,u=0,t.mode=bc;case bc:for(;u<32;){if(o===0)break e;o--,l+=r[a++]<<u,u+=8}t.head&&(t.head.time=l),t.flags&512&&t.wrap&4&&(C[0]=l&255,C[1]=l>>>8&255,C[2]=l>>>16&255,C[3]=l>>>24&255,t.check=xe(t.check,C,4,0)),l=0,u=0,t.mode=_c;case _c:for(;u<16;){if(o===0)break e;o--,l+=r[a++]<<u,u+=8}t.head&&(t.head.xflags=l&255,t.head.os=l>>8),t.flags&512&&t.wrap&4&&(C[0]=l&255,C[1]=l>>>8&255,t.check=xe(t.check,C,2,0)),l=0,u=0,t.mode=Sc;case Sc:if(t.flags&1024){for(;u<16;){if(o===0)break e;o--,l+=r[a++]<<u,u+=8}t.length=l,t.head&&(t.head.extra_len=l),t.flags&512&&t.wrap&4&&(C[0]=l&255,C[1]=l>>>8&255,t.check=xe(t.check,C,2,0)),l=0,u=0}else t.head&&(t.head.extra=null);t.mode=wc;case wc:if(t.flags&1024&&(d=t.length,d>o&&(d=o),d&&(t.head&&(I=t.head.extra_len-t.length,t.head.extra||(t.head.extra=new Uint8Array(t.head.extra_len)),t.head.extra.set(r.subarray(a,a+d),I)),t.flags&512&&t.wrap&4&&(t.check=xe(t.check,r,d,a)),o-=d,a+=d,t.length-=d),t.length))break e;t.length=0,t.mode=Ec;case Ec:if(t.flags&2048){if(o===0)break e;d=0;do I=r[a+d++],t.head&&I&&t.length<65536&&(t.head.name+=String.fromCharCode(I));while(I&&d<o);if(t.flags&512&&t.wrap&4&&(t.check=xe(t.check,r,d,a)),o-=d,a+=d,I)break e}else t.head&&(t.head.name=null);t.length=0,t.mode=xc;case xc:if(t.flags&4096){if(o===0)break e;d=0;do I=r[a+d++],t.head&&I&&t.length<65536&&(t.head.comment+=String.fromCharCode(I));while(I&&d<o);if(t.flags&512&&t.wrap&4&&(t.check=xe(t.check,r,d,a)),o-=d,a+=d,I)break e}else t.head&&(t.head.comment=null);t.mode=Ac;case Ac:if(t.flags&512){for(;u<16;){if(o===0)break e;o--,l+=r[a++]<<u,u+=8}if(t.wrap&4&&l!==(t.check&65535)){i.msg="header crc mismatch",t.mode=le;break}l=0,u=0}t.head&&(t.head.hcrc=t.flags>>9&1,t.head.done=!0),i.adler=t.check=0,t.mode=Nt;break;case $c:for(;u<32;){if(o===0)break e;o--,l+=r[a++]<<u,u+=8}i.adler=t.check=Fc(l),l=0,u=0,t.mode=La;case La:if(t.havedict===0)return i.next_out=s,i.avail_out=c,i.next_in=a,i.avail_in=o,t.hold=l,t.bits=u,Mf;i.adler=t.check=1,t.mode=Nt;case Nt:if(e===Of||e===Wn)break e;case xs:if(t.last){l>>>=u&7,u-=u&7,t.mode=$s;break}for(;u<3;){if(o===0)break e;o--,l+=r[a++]<<u,u+=8}switch(t.last=l&1,l>>>=1,u-=1,l&3){case 0:t.mode=Ic;break;case 1:if(Hf(t),t.mode=Zn,e===Wn){l>>>=2,u-=2;break e}break;case 2:t.mode=Tc;break;case 3:i.msg="invalid block type",t.mode=le}l>>>=2,u-=2;break;case Ic:for(l>>>=u&7,u-=u&7;u<32;){if(o===0)break e;o--,l+=r[a++]<<u,u+=8}if((l&65535)!==(l>>>16^65535)){i.msg="invalid stored block lengths",t.mode=le;break}if(t.length=l&65535,l=0,u=0,t.mode=As,e===Wn)break e;case As:t.mode=kc;case kc:if(d=t.length,d){if(d>o&&(d=o),d>c&&(d=c),d===0)break e;n.set(r.subarray(a,a+d),s),o-=d,a+=d,c-=d,s+=d,t.length-=d;break}t.mode=Nt;break;case Tc:for(;u<14;){if(o===0)break e;o--,l+=r[a++]<<u,u+=8}if(t.nlen=(l&31)+257,l>>>=5,u-=5,t.ndist=(l&31)+1,l>>>=5,u-=5,t.ncode=(l&15)+4,l>>>=4,u-=4,t.nlen>286||t.ndist>30){i.msg="too many length or distance symbols",t.mode=le;break}t.have=0,t.mode=Cc;case Cc:for(;t.have<t.ncode;){for(;u<3;){if(o===0)break e;o--,l+=r[a++]<<u,u+=8}t.lens[Me[t.have++]]=l&7,l>>>=3,u-=3}for(;t.have<19;)t.lens[Me[t.have++]]=0;if(t.lencode=t.lendyn,t.lenbits=7,T={bits:t.lenbits},K=cn(Rf,t.lens,0,19,t.lencode,0,t.work,T),t.lenbits=T.bits,K){i.msg="invalid code lengths set",t.mode=le;break}t.have=0,t.mode=Nc;case Nc:for(;t.have<t.nlen+t.ndist;){for(;E=t.lencode[l&(1<<t.lenbits)-1],$=E>>>24,N=E>>>16&255,O=E&65535,!($<=u);){if(o===0)break e;o--,l+=r[a++]<<u,u+=8}if(O<16)l>>>=$,u-=$,t.lens[t.have++]=O;else{if(O===16){for(D=$+2;u<D;){if(o===0)break e;o--,l+=r[a++]<<u,u+=8}if(l>>>=$,u-=$,t.have===0){i.msg="invalid bit length repeat",t.mode=le;break}I=t.lens[t.have-1],d=3+(l&3),l>>>=2,u-=2}else if(O===17){for(D=$+3;u<D;){if(o===0)break e;o--,l+=r[a++]<<u,u+=8}l>>>=$,u-=$,I=0,d=3+(l&7),l>>>=3,u-=3}else{for(D=$+7;u<D;){if(o===0)break e;o--,l+=r[a++]<<u,u+=8}l>>>=$,u-=$,I=0,d=11+(l&127),l>>>=7,u-=7}if(t.have+d>t.nlen+t.ndist){i.msg="invalid bit length repeat",t.mode=le;break}for(;d--;)t.lens[t.have++]=I}}if(t.mode===le)break;if(t.lens[256]===0){i.msg="invalid code -- missing end-of-block",t.mode=le;break}if(t.lenbits=9,T={bits:t.lenbits},K=cn(Gl,t.lens,0,t.nlen,t.lencode,0,t.work,T),t.lenbits=T.bits,K){i.msg="invalid literal/lengths set",t.mode=le;break}if(t.distbits=6,t.distcode=t.distdyn,T={bits:t.distbits},K=cn(Kl,t.lens,t.nlen,t.ndist,t.distcode,0,t.work,T),t.distbits=T.bits,K){i.msg="invalid distances set",t.mode=le;break}if(t.mode=Zn,e===Wn)break e;case Zn:t.mode=Jn;case Jn:if(o>=6&&c>=258){i.next_out=s,i.avail_out=c,i.next_in=a,i.avail_in=o,t.hold=l,t.bits=u,kf(i,h),s=i.next_out,n=i.output,c=i.avail_out,a=i.next_in,r=i.input,o=i.avail_in,l=t.hold,u=t.bits,t.mode===Nt&&(t.back=-1);break}for(t.back=0;E=t.lencode[l&(1<<t.lenbits)-1],$=E>>>24,N=E>>>16&255,O=E&65535,!($<=u);){if(o===0)break e;o--,l+=r[a++]<<u,u+=8}if(N&&(N&240)===0){for(A=$,k=N,Z=O;E=t.lencode[Z+((l&(1<<A+k)-1)>>A)],$=E>>>24,N=E>>>16&255,O=E&65535,!(A+$<=u);){if(o===0)break e;o--,l+=r[a++]<<u,u+=8}l>>>=A,u-=A,t.back+=A}if(l>>>=$,u-=$,t.back+=$,t.length=O,N===0){t.mode=Dc;break}if(N&32){t.back=-1,t.mode=Nt;break}if(N&64){i.msg="invalid literal/length code",t.mode=le;break}t.extra=N&15,t.mode=Lc;case Lc:if(t.extra){for(D=t.extra;u<D;){if(o===0)break e;o--,l+=r[a++]<<u,u+=8}t.length+=l&(1<<t.extra)-1,l>>>=t.extra,u-=t.extra,t.back+=t.extra}t.was=t.length,t.mode=Pc;case Pc:for(;E=t.distcode[l&(1<<t.distbits)-1],$=E>>>24,N=E>>>16&255,O=E&65535,!($<=u);){if(o===0)break e;o--,l+=r[a++]<<u,u+=8}if((N&240)===0){for(A=$,k=N,Z=O;E=t.distcode[Z+((l&(1<<A+k)-1)>>A)],$=E>>>24,N=E>>>16&255,O=E&65535,!(A+$<=u);){if(o===0)break e;o--,l+=r[a++]<<u,u+=8}l>>>=A,u-=A,t.back+=A}if(l>>>=$,u-=$,t.back+=$,N&64){i.msg="invalid distance code",t.mode=le;break}t.offset=O,t.extra=N&15,t.mode=Rc;case Rc:if(t.extra){for(D=t.extra;u<D;){if(o===0)break e;o--,l+=r[a++]<<u,u+=8}t.offset+=l&(1<<t.extra)-1,l>>>=t.extra,u-=t.extra,t.back+=t.extra}if(t.offset>t.dmax){i.msg="invalid distance too far back",t.mode=le;break}t.mode=Oc;case Oc:if(c===0)break e;if(d=h-c,t.offset>d){if(d=t.offset-d,d>t.whave&&t.sane){i.msg="invalid distance too far back",t.mode=le;break}d>t.wnext?(d-=t.wnext,g=t.wsize-d):g=t.wnext-d,d>t.length&&(d=t.length),v=t.window}else v=n,g=s-t.offset,d=t.length;d>c&&(d=c),c-=d,t.length-=d;do n[s++]=v[g++];while(--d);t.length===0&&(t.mode=Jn);break;case Dc:if(c===0)break e;n[s++]=t.length,c--,t.mode=Jn;break;case $s:if(t.wrap){for(;u<32;){if(o===0)break e;o--,l|=r[a++]<<u,u+=8}if(h-=c,i.total_out+=h,t.total+=h,t.wrap&4&&h&&(i.adler=t.check=t.flags?xe(t.check,n,h,s-h):yn(t.check,n,h,s-h)),h=c,t.wrap&4&&(t.flags?l:Fc(l))!==t.check){i.msg="incorrect data check",t.mode=le;break}l=0,u=0}t.mode=Mc;case Mc:if(t.wrap&&t.flags){for(;u<32;){if(o===0)break e;o--,l+=r[a++]<<u,u+=8}if(t.wrap&4&&l!==(t.total&4294967295)){i.msg="incorrect length check",t.mode=le;break}l=0,u=0}t.mode=Uc;case Uc:K=Df;break e;case le:K=Ql;break e;case Zl:return Wl;case Jl:default:return ut}return i.next_out=s,i.avail_out=c,i.next_in=a,i.avail_in=o,t.hold=l,t.bits=u,(t.wsize||h!==i.avail_out&&t.mode<le&&(t.mode<$s||e!==mc))&&iu(i,i.output,i.next_out,h-i.avail_out),m-=i.avail_in,h-=i.avail_out,i.total_in+=m,i.total_out+=h,t.total+=h,t.wrap&4&&h&&(i.adler=t.check=t.flags?xe(t.check,n,h,i.next_out-h):yn(t.check,n,h,i.next_out-h)),i.data_type=t.bits+(t.last?64:0)+(t.mode===Nt?128:0)+(t.mode===Zn||t.mode===As?256:0),(m===0&&h===0||e===mc)&&K===ji&&(K=Uf),K},Kf=i=>{if(Qi(i))return ut;let e=i.state;return e.window&&(e.window=null),i.state=null,ji},Qf=(i,e)=>{if(Qi(i))return ut;let t=i.state;return(t.wrap&2)===0?ut:(t.head=e,e.done=!1,ji)},Wf=(i,e)=>{let t=e.length,r,n,a;return Qi(i)||(r=i.state,r.wrap!==0&&r.mode!==La)?ut:r.mode===La&&(n=1,n=yn(n,e,t,0),n!==r.check)?Ql:(a=iu(i,e,t,t),a?(r.mode=Zl,Wl):(r.havedict=1,ji))},Zf=Xl,Jf=eu,Yf=Yl,Xf=zf,eh=tu,th=Gf,ih=Kf,rh=Qf,nh=Wf,ah="pako inflate (from Nodeca project)",Dt={inflateReset:Zf,inflateReset2:Jf,inflateResetKeep:Yf,inflateInit:Xf,inflateInit2:eh,inflate:th,inflateEnd:ih,inflateGetHeader:rh,inflateSetDictionary:nh,inflateInfo:ah};function sh(){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 oh=sh,ru=Object.prototype.toString,{Z_NO_FLUSH:ch,Z_FINISH:lh,Z_OK:_n,Z_STREAM_END:Ts,Z_NEED_DICT:Cs,Z_STREAM_ERROR:uh,Z_DATA_ERROR:Bc,Z_MEM_ERROR:dh}=Ki;function In(i){this.options=za.assign({chunkSize:1024*64,windowBits:15,to:""},i||{});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&&!(i&&i.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 zl,this.strm.avail_out=0;let t=Dt.inflateInit2(this.strm,e.windowBits);if(t!==_n)throw new Error(Ui[t]);if(this.header=new oh,Dt.inflateGetHeader(this.strm,this.header),e.dictionary&&(typeof e.dictionary=="string"?e.dictionary=bn.string2buf(e.dictionary):ru.call(e.dictionary)==="[object ArrayBuffer]"&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(t=Dt.inflateSetDictionary(this.strm,e.dictionary),t!==_n)))throw new Error(Ui[t])}In.prototype.push=function(i,e){let t=this.strm,r=this.options.chunkSize,n=this.options.dictionary,a,s,o;if(this.ended)return!1;for(e===~~e?s=e:s=e===!0?lh:ch,ru.call(i)==="[object ArrayBuffer]"?t.input=new Uint8Array(i):t.input=i,t.next_in=0,t.avail_in=t.input.length;;){for(t.avail_out===0&&(t.output=new Uint8Array(r),t.next_out=0,t.avail_out=r),a=Dt.inflate(t,s),a===Cs&&n&&(a=Dt.inflateSetDictionary(t,n),a===_n?a=Dt.inflate(t,s):a===Bc&&(a=Cs));t.avail_in>0&&a===Ts&&t.state.wrap>0&&i[t.next_in]!==0;)Dt.inflateReset(t),a=Dt.inflate(t,s);switch(a){case uh:case Bc:case Cs:case dh:return this.onEnd(a),this.ended=!0,!1}if(o=t.avail_out,t.next_out&&(t.avail_out===0||a===Ts))if(this.options.to==="string"){let c=bn.utf8border(t.output,t.next_out),l=t.next_out-c,u=bn.buf2string(t.output,c);t.next_out=l,t.avail_out=r-l,l&&t.output.set(t.output.subarray(c,c+l),0),this.onData(u)}else this.onData(t.output.length===t.next_out?t.output:t.output.subarray(0,t.next_out));if(!(a===_n&&o===0)){if(a===Ts)return a=Dt.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,!0;if(t.avail_in===0)break}}return!0};In.prototype.onData=function(i){this.chunks.push(i)};In.prototype.onEnd=function(i){i===_n&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=za.flattenChunks(this.chunks)),this.chunks=[],this.err=i,this.msg=this.strm.msg};function mo(i,e){let t=new In(e);if(t.push(i),t.err)throw t.msg||Ui[t.err];return t.result}function ph(i,e){return e=e||{},e.raw=!0,mo(i,e)}var fh=In,hh=mo,gh=ph,mh=mo,yh=Ki,vh={Inflate:fh,inflate:hh,inflateRaw:gh,ungzip:mh,constants:yh},{Deflate:bh,deflate:_h,deflateRaw:Sh,gzip:wh}=$f,{Inflate:Eh,inflate:xh,inflateRaw:Ah,ungzip:$h}=vh,Ih=bh,kh=_h,Th=Sh,Ch=wh,Nh=Eh,Lh=xh,Ph=Ah,Rh=$h,Oh=Ki,Dh={Deflate:Ih,deflate:kh,deflateRaw:Th,gzip:Ch,Inflate:Nh,inflate:Lh,inflateRaw:Ph,ungzip:Rh,constants:Oh},ae=function(i,e,t,r){var n=arguments.length,a=n<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(i,e,t,r);else for(var o=i.length-1;o>=0;o--)(s=i[o])&&(a=(n<3?s(a):n>3?s(e,t,a):s(e,t))||a);return n>3&&a&&Object.defineProperty(e,t,a),a},se=function(i,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,e)},Pa=class{constructor(e,t){this.input=e,this.output=t}};ae([p(),se("design:type",String)],Pa.prototype,"input",void 0);ae([p(),se("design:type",String)],Pa.prototype,"output",void 0);Pa=ae([$e(),se("design:paramtypes",[String,String])],Pa);var Ra=class{constructor(e,t){this.input=e,this.output=t}};ae([p(),se("design:type",String)],Ra.prototype,"input",void 0);ae([p(),se("design:type",String)],Ra.prototype,"output",void 0);Ra=ae([q(),se("design:paramtypes",[String,String])],Ra);var ri=class{constructor(e,t,r,n,a){this.name=e,this.modelId=t,this.systemPrompt=r,this.promptExamples=n,this.metaData=a}};ae([p(),se("design:type",String)],ri.prototype,"name",void 0);ae([p(),se("design:type",String)],ri.prototype,"modelId",void 0);ae([p(),se("design:type",String)],ri.prototype,"systemPrompt",void 0);ae([p(),se("design:type",Array)],ri.prototype,"promptExamples",void 0);ae([p(),se("design:type",String)],ri.prototype,"metaData",void 0);ri=ae([$e(),se("design:paramtypes",[String,String,String,Array,String])],ri);var kt=class{constructor(e,t,r,n,a,s,o,c){this.name=e,this.modelId=t,this.taskId=r,this.systemPrompt=n,this.promptExamples=a,this.metaData=s,this.createdAt=o,this.updatedAt=c}};ae([p(),se("design:type",String)],kt.prototype,"name",void 0);ae([p(),se("design:type",String)],kt.prototype,"modelId",void 0);ae([p(),se("design:type",String)],kt.prototype,"taskId",void 0);ae([p(),se("design:type",String)],kt.prototype,"systemPrompt",void 0);ae([p(),se("design:type",Array)],kt.prototype,"promptExamples",void 0);ae([p(),se("design:type",String)],kt.prototype,"metaData",void 0);ae([p(),se("design:type",String)],kt.prototype,"createdAt",void 0);ae([p(),se("design:type",String)],kt.prototype,"updatedAt",void 0);kt=ae([q(),se("design:paramtypes",[String,String,String,String,Array,String,String,String])],kt);var Bi=class{constructor(e,t,r,n,a){this.model=e,this.status=t,this.progress=r,this.downloaded=n,this.loaded=a}};ae([p(),se("design:type",String)],Bi.prototype,"model",void 0);ae([p(),se("design:type",String)],Bi.prototype,"status",void 0);ae([p(),se("design:type",Number)],Bi.prototype,"progress",void 0);ae([p(),se("design:type",Boolean)],Bi.prototype,"downloaded",void 0);ae([p(),se("design:type",Boolean)],Bi.prototype,"loaded",void 0);Bi=ae([q(),se("design:paramtypes",[String,String,Number,Boolean,Boolean])],Bi);var Mh=function(i,e,t,r,n){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?i!==e||!n:!e.has(i))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?n.call(i,t):n?n.value=t:e.set(i,t),t},_e=function(i,e,t,r){if(t==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?i!==e||!r:!e.has(i))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?r:t==="a"?r.call(i):r?r.value:e.get(i)},ve,da,Xs=class{constructor(e,t=!0){ve.set(this,void 0),da.set(this,new Map),Mh(this,ve,e,"f")}async getModels(){let e=await _e(this,ve,"f").query({query:y`
1121
+ }`,variables:{url:e,interactionCall:t}}));return r}};Rt=new WeakMap;var qa={};qa.byteLength=Ld;qa.toByteArray=Rd;qa.fromByteArray=Md;var St=[],ot=[],Nd=typeof Uint8Array<"u"?Uint8Array:Array,ms="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(mi=0,tc=ms.length;mi<tc;++mi)St[mi]=ms[mi],ot[ms.charCodeAt(mi)]=mi;var mi,tc;ot["-".charCodeAt(0)]=62;ot["_".charCodeAt(0)]=63;function wl(i){var e=i.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var t=i.indexOf("=");t===-1&&(t=e);var r=t===e?0:4-t%4;return[t,r]}function Ld(i){var e=wl(i),t=e[0],r=e[1];return(t+r)*3/4-r}function Pd(i,e,t){return(e+t)*3/4-t}function Rd(i){var e,t=wl(i),r=t[0],n=t[1],a=new Nd(Pd(i,r,n)),s=0,o=n>0?r-4:r,l;for(l=0;l<o;l+=4)e=ot[i.charCodeAt(l)]<<18|ot[i.charCodeAt(l+1)]<<12|ot[i.charCodeAt(l+2)]<<6|ot[i.charCodeAt(l+3)],a[s++]=e>>16&255,a[s++]=e>>8&255,a[s++]=e&255;return n===2&&(e=ot[i.charCodeAt(l)]<<2|ot[i.charCodeAt(l+1)]>>4,a[s++]=e&255),n===1&&(e=ot[i.charCodeAt(l)]<<10|ot[i.charCodeAt(l+1)]<<4|ot[i.charCodeAt(l+2)]>>2,a[s++]=e>>8&255,a[s++]=e&255),a}function Od(i){return St[i>>18&63]+St[i>>12&63]+St[i>>6&63]+St[i&63]}function Dd(i,e,t){for(var r,n=[],a=e;a<t;a+=3)r=(i[a]<<16&16711680)+(i[a+1]<<8&65280)+(i[a+2]&255),n.push(Od(r));return n.join("")}function Md(i){for(var e,t=i.length,r=t%3,n=[],a=16383,s=0,o=t-r;s<o;s+=a)n.push(Dd(i,s,s+a>o?o:s+a));return r===1?(e=i[t-1],n.push(St[e>>2]+St[e<<4&63]+"==")):r===2&&(e=(i[t-2]<<8)+i[t-1],n.push(St[e>>10]+St[e>>4&63]+St[e<<2&63]+"=")),n.join("")}var Ud=4,ic=0,rc=1,Fd=2;function Ir(i){let e=i.length;for(;--e>=0;)i[e]=0}var jd=0,El=1,Bd=2,qd=3,Vd=258,lo=29,xn=256,fn=xn+1+lo,gr=30,uo=19,xl=2*fn+1,Ii=15,ys=16,zd=7,po=256,Al=16,$l=17,Il=18,zs=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]),ua=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]),Hd=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),kl=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Kd=512,Ot=new Array((fn+2)*2);Ir(Ot);var sn=new Array(gr*2);Ir(sn);var hn=new Array(Kd);Ir(hn);var gn=new Array(Vd-qd+1);Ir(gn);var fo=new Array(lo);Ir(fo);var Ca=new Array(gr);Ir(Ca);function vs(i,e,t,r,n){this.static_tree=i,this.extra_bits=e,this.extra_base=t,this.elems=r,this.max_length=n,this.has_stree=i&&i.length}var Tl,Cl,Nl;function bs(i,e){this.dyn_tree=i,this.max_code=0,this.stat_desc=e}var Ll=i=>i<256?hn[i]:hn[256+(i>>>7)],mn=(i,e)=>{i.pending_buf[i.pending++]=e&255,i.pending_buf[i.pending++]=e>>>8&255},Ge=(i,e,t)=>{i.bi_valid>ys-t?(i.bi_buf|=e<<i.bi_valid&65535,mn(i,i.bi_buf),i.bi_buf=e>>ys-i.bi_valid,i.bi_valid+=t-ys):(i.bi_buf|=e<<i.bi_valid&65535,i.bi_valid+=t)},wt=(i,e,t)=>{Ge(i,t[e*2],t[e*2+1])},Pl=(i,e)=>{let t=0;do t|=i&1,i>>>=1,t<<=1;while(--e>0);return t>>>1},Wd=i=>{i.bi_valid===16?(mn(i,i.bi_buf),i.bi_buf=0,i.bi_valid=0):i.bi_valid>=8&&(i.pending_buf[i.pending++]=i.bi_buf&255,i.bi_buf>>=8,i.bi_valid-=8)},Qd=(i,e)=>{let t=e.dyn_tree,r=e.max_code,n=e.stat_desc.static_tree,a=e.stat_desc.has_stree,s=e.stat_desc.extra_bits,o=e.stat_desc.extra_base,l=e.stat_desc.max_length,c,u,m,h,d,g,v=0;for(h=0;h<=Ii;h++)i.bl_count[h]=0;for(t[i.heap[i.heap_max]*2+1]=0,c=i.heap_max+1;c<xl;c++)u=i.heap[c],h=t[t[u*2+1]*2+1]+1,h>l&&(h=l,v++),t[u*2+1]=h,!(u>r)&&(i.bl_count[h]++,d=0,u>=o&&(d=s[u-o]),g=t[u*2],i.opt_len+=g*(h+d),a&&(i.static_len+=g*(n[u*2+1]+d)));if(v!==0){do{for(h=l-1;i.bl_count[h]===0;)h--;i.bl_count[h]--,i.bl_count[h+1]+=2,i.bl_count[l]--,v-=2}while(v>0);for(h=l;h!==0;h--)for(u=i.bl_count[h];u!==0;)m=i.heap[--c],!(m>r)&&(t[m*2+1]!==h&&(i.opt_len+=(h-t[m*2+1])*t[m*2],t[m*2+1]=h),u--)}},Rl=(i,e,t)=>{let r=new Array(Ii+1),n=0,a,s;for(a=1;a<=Ii;a++)n=n+t[a-1]<<1,r[a]=n;for(s=0;s<=e;s++){let o=i[s*2+1];o!==0&&(i[s*2]=Pl(r[o]++,o))}},Gd=()=>{let i,e,t,r,n,a=new Array(Ii+1);for(t=0,r=0;r<lo-1;r++)for(fo[r]=t,i=0;i<1<<zs[r];i++)gn[t++]=r;for(gn[t-1]=r,n=0,r=0;r<16;r++)for(Ca[r]=n,i=0;i<1<<ua[r];i++)hn[n++]=r;for(n>>=7;r<gr;r++)for(Ca[r]=n<<7,i=0;i<1<<ua[r]-7;i++)hn[256+n++]=r;for(e=0;e<=Ii;e++)a[e]=0;for(i=0;i<=143;)Ot[i*2+1]=8,i++,a[8]++;for(;i<=255;)Ot[i*2+1]=9,i++,a[9]++;for(;i<=279;)Ot[i*2+1]=7,i++,a[7]++;for(;i<=287;)Ot[i*2+1]=8,i++,a[8]++;for(Rl(Ot,fn+1,a),i=0;i<gr;i++)sn[i*2+1]=5,sn[i*2]=Pl(i,5);Tl=new vs(Ot,zs,xn+1,fn,Ii),Cl=new vs(sn,ua,0,gr,Ii),Nl=new vs(new Array(0),Hd,0,uo,zd)},Ol=i=>{let e;for(e=0;e<fn;e++)i.dyn_ltree[e*2]=0;for(e=0;e<gr;e++)i.dyn_dtree[e*2]=0;for(e=0;e<uo;e++)i.bl_tree[e*2]=0;i.dyn_ltree[po*2]=1,i.opt_len=i.static_len=0,i.sym_next=i.matches=0},Dl=i=>{i.bi_valid>8?mn(i,i.bi_buf):i.bi_valid>0&&(i.pending_buf[i.pending++]=i.bi_buf),i.bi_buf=0,i.bi_valid=0},nc=(i,e,t,r)=>{let n=e*2,a=t*2;return i[n]<i[a]||i[n]===i[a]&&r[e]<=r[t]},_s=(i,e,t)=>{let r=i.heap[t],n=t<<1;for(;n<=i.heap_len&&(n<i.heap_len&&nc(e,i.heap[n+1],i.heap[n],i.depth)&&n++,!nc(e,r,i.heap[n],i.depth));)i.heap[t]=i.heap[n],t=n,n<<=1;i.heap[t]=r},ac=(i,e,t)=>{let r,n,a=0,s,o;if(i.sym_next!==0)do r=i.pending_buf[i.sym_buf+a++]&255,r+=(i.pending_buf[i.sym_buf+a++]&255)<<8,n=i.pending_buf[i.sym_buf+a++],r===0?wt(i,n,e):(s=gn[n],wt(i,s+xn+1,e),o=zs[s],o!==0&&(n-=fo[s],Ge(i,n,o)),r--,s=Ll(r),wt(i,s,t),o=ua[s],o!==0&&(r-=Ca[s],Ge(i,r,o)));while(a<i.sym_next);wt(i,po,e)},Hs=(i,e)=>{let t=e.dyn_tree,r=e.stat_desc.static_tree,n=e.stat_desc.has_stree,a=e.stat_desc.elems,s,o,l=-1,c;for(i.heap_len=0,i.heap_max=xl,s=0;s<a;s++)t[s*2]!==0?(i.heap[++i.heap_len]=l=s,i.depth[s]=0):t[s*2+1]=0;for(;i.heap_len<2;)c=i.heap[++i.heap_len]=l<2?++l:0,t[c*2]=1,i.depth[c]=0,i.opt_len--,n&&(i.static_len-=r[c*2+1]);for(e.max_code=l,s=i.heap_len>>1;s>=1;s--)_s(i,t,s);c=a;do s=i.heap[1],i.heap[1]=i.heap[i.heap_len--],_s(i,t,1),o=i.heap[1],i.heap[--i.heap_max]=s,i.heap[--i.heap_max]=o,t[c*2]=t[s*2]+t[o*2],i.depth[c]=(i.depth[s]>=i.depth[o]?i.depth[s]:i.depth[o])+1,t[s*2+1]=t[o*2+1]=c,i.heap[1]=c++,_s(i,t,1);while(i.heap_len>=2);i.heap[--i.heap_max]=i.heap[1],Qd(i,e),Rl(t,l,i.bl_count)},sc=(i,e,t)=>{let r,n=-1,a,s=e[0*2+1],o=0,l=7,c=4;for(s===0&&(l=138,c=3),e[(t+1)*2+1]=65535,r=0;r<=t;r++)a=s,s=e[(r+1)*2+1],!(++o<l&&a===s)&&(o<c?i.bl_tree[a*2]+=o:a!==0?(a!==n&&i.bl_tree[a*2]++,i.bl_tree[Al*2]++):o<=10?i.bl_tree[$l*2]++:i.bl_tree[Il*2]++,o=0,n=a,s===0?(l=138,c=3):a===s?(l=6,c=3):(l=7,c=4))},oc=(i,e,t)=>{let r,n=-1,a,s=e[0*2+1],o=0,l=7,c=4;for(s===0&&(l=138,c=3),r=0;r<=t;r++)if(a=s,s=e[(r+1)*2+1],!(++o<l&&a===s)){if(o<c)do wt(i,a,i.bl_tree);while(--o!==0);else a!==0?(a!==n&&(wt(i,a,i.bl_tree),o--),wt(i,Al,i.bl_tree),Ge(i,o-3,2)):o<=10?(wt(i,$l,i.bl_tree),Ge(i,o-3,3)):(wt(i,Il,i.bl_tree),Ge(i,o-11,7));o=0,n=a,s===0?(l=138,c=3):a===s?(l=6,c=3):(l=7,c=4)}},Zd=i=>{let e;for(sc(i,i.dyn_ltree,i.l_desc.max_code),sc(i,i.dyn_dtree,i.d_desc.max_code),Hs(i,i.bl_desc),e=uo-1;e>=3&&i.bl_tree[kl[e]*2+1]===0;e--);return i.opt_len+=3*(e+1)+5+5+4,e},Jd=(i,e,t,r)=>{let n;for(Ge(i,e-257,5),Ge(i,t-1,5),Ge(i,r-4,4),n=0;n<r;n++)Ge(i,i.bl_tree[kl[n]*2+1],3);oc(i,i.dyn_ltree,e-1),oc(i,i.dyn_dtree,t-1)},Yd=i=>{let e=4093624447,t;for(t=0;t<=31;t++,e>>>=1)if(e&1&&i.dyn_ltree[t*2]!==0)return ic;if(i.dyn_ltree[9*2]!==0||i.dyn_ltree[10*2]!==0||i.dyn_ltree[13*2]!==0)return rc;for(t=32;t<xn;t++)if(i.dyn_ltree[t*2]!==0)return rc;return ic},cc=!1,Xd=i=>{cc||(Gd(),cc=!0),i.l_desc=new bs(i.dyn_ltree,Tl),i.d_desc=new bs(i.dyn_dtree,Cl),i.bl_desc=new bs(i.bl_tree,Nl),i.bi_buf=0,i.bi_valid=0,Ol(i)},Ml=(i,e,t,r)=>{Ge(i,(jd<<1)+(r?1:0),3),Dl(i),mn(i,t),mn(i,~t),t&&i.pending_buf.set(i.window.subarray(e,e+t),i.pending),i.pending+=t},ep=i=>{Ge(i,El<<1,3),wt(i,po,Ot),Wd(i)},tp=(i,e,t,r)=>{let n,a,s=0;i.level>0?(i.strm.data_type===Fd&&(i.strm.data_type=Yd(i)),Hs(i,i.l_desc),Hs(i,i.d_desc),s=Zd(i),n=i.opt_len+3+7>>>3,a=i.static_len+3+7>>>3,a<=n&&(n=a)):n=a=t+5,t+4<=n&&e!==-1?Ml(i,e,t,r):i.strategy===Ud||a===n?(Ge(i,(El<<1)+(r?1:0),3),ac(i,Ot,sn)):(Ge(i,(Bd<<1)+(r?1:0),3),Jd(i,i.l_desc.max_code+1,i.d_desc.max_code+1,s+1),ac(i,i.dyn_ltree,i.dyn_dtree)),Ol(i),r&&Dl(i)},ip=(i,e,t)=>(i.pending_buf[i.sym_buf+i.sym_next++]=e,i.pending_buf[i.sym_buf+i.sym_next++]=e>>8,i.pending_buf[i.sym_buf+i.sym_next++]=t,e===0?i.dyn_ltree[t*2]++:(i.matches++,e--,i.dyn_ltree[(gn[t]+xn+1)*2]++,i.dyn_dtree[Ll(e)*2]++),i.sym_next===i.sym_end),rp=Xd,np=Ml,ap=tp,sp=ip,op=ep,cp={_tr_init:rp,_tr_stored_block:np,_tr_flush_block:ap,_tr_tally:sp,_tr_align:op},lp=(i,e,t,r)=>{let n=i&65535|0,a=i>>>16&65535|0,s=0;for(;t!==0;){s=t>2e3?2e3:t,t-=s;do n=n+e[r++]|0,a=a+n|0;while(--s);n%=65521,a%=65521}return n|a<<16|0},yn=lp,up=()=>{let i,e=[];for(var t=0;t<256;t++){i=t;for(var r=0;r<8;r++)i=i&1?3988292384^i>>>1:i>>>1;e[t]=i}return e},dp=new Uint32Array(up()),pp=(i,e,t,r)=>{let n=dp,a=r+t;i^=-1;for(let s=r;s<a;s++)i=i>>>8^n[(i^e[s])&255];return i^-1},xe=pp,Ui={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"},Wi={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:fp,_tr_stored_block:Ks,_tr_flush_block:hp,_tr_tally:Jt,_tr_align:gp}=cp,{Z_NO_FLUSH:Yt,Z_PARTIAL_FLUSH:mp,Z_FULL_FLUSH:yp,Z_FINISH:lt,Z_BLOCK:lc,Z_OK:Ce,Z_STREAM_END:uc,Z_STREAM_ERROR:xt,Z_DATA_ERROR:vp,Z_BUF_ERROR:Ss,Z_DEFAULT_COMPRESSION:bp,Z_FILTERED:_p,Z_HUFFMAN_ONLY:Wn,Z_RLE:Sp,Z_FIXED:wp,Z_DEFAULT_STRATEGY:Ep,Z_UNKNOWN:xp,Z_DEFLATED:Va}=Wi,Ap=9,$p=15,Ip=8,kp=29,Tp=256,Ws=Tp+1+kp,Cp=30,Np=19,Lp=2*Ws+1,Pp=15,Y=3,Wt=258,At=Wt+Y+1,Rp=32,br=42,ho=57,Qs=69,Gs=73,Zs=91,Js=103,ki=113,Xr=666,ze=1,kr=2,Fi=3,Tr=4,Op=3,Ti=(i,e)=>(i.msg=Ui[e],e),dc=i=>i*2-(i>4?9:0),Kt=i=>{let e=i.length;for(;--e>=0;)i[e]=0},Dp=i=>{let e,t,r,n=i.w_size;e=i.hash_size,r=e;do t=i.head[--r],i.head[r]=t>=n?t-n:0;while(--e);e=n,r=e;do t=i.prev[--r],i.prev[r]=t>=n?t-n:0;while(--e)},Mp=(i,e,t)=>(e<<i.hash_shift^t)&i.hash_mask,Xt=Mp,Ye=i=>{let e=i.state,t=e.pending;t>i.avail_out&&(t=i.avail_out),t!==0&&(i.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+t),i.next_out),i.next_out+=t,e.pending_out+=t,i.total_out+=t,i.avail_out-=t,e.pending-=t,e.pending===0&&(e.pending_out=0))},et=(i,e)=>{hp(i,i.block_start>=0?i.block_start:-1,i.strstart-i.block_start,e),i.block_start=i.strstart,Ye(i.strm)},ie=(i,e)=>{i.pending_buf[i.pending++]=e},Ur=(i,e)=>{i.pending_buf[i.pending++]=e>>>8&255,i.pending_buf[i.pending++]=e&255},Ys=(i,e,t,r)=>{let n=i.avail_in;return n>r&&(n=r),n===0?0:(i.avail_in-=n,e.set(i.input.subarray(i.next_in,i.next_in+n),t),i.state.wrap===1?i.adler=yn(i.adler,e,n,t):i.state.wrap===2&&(i.adler=xe(i.adler,e,n,t)),i.next_in+=n,i.total_in+=n,n)},Ul=(i,e)=>{let t=i.max_chain_length,r=i.strstart,n,a,s=i.prev_length,o=i.nice_match,l=i.strstart>i.w_size-At?i.strstart-(i.w_size-At):0,c=i.window,u=i.w_mask,m=i.prev,h=i.strstart+Wt,d=c[r+s-1],g=c[r+s];i.prev_length>=i.good_match&&(t>>=2),o>i.lookahead&&(o=i.lookahead);do if(n=e,!(c[n+s]!==g||c[n+s-1]!==d||c[n]!==c[r]||c[++n]!==c[r+1])){r+=2,n++;do;while(c[++r]===c[++n]&&c[++r]===c[++n]&&c[++r]===c[++n]&&c[++r]===c[++n]&&c[++r]===c[++n]&&c[++r]===c[++n]&&c[++r]===c[++n]&&c[++r]===c[++n]&&r<h);if(a=Wt-(h-r),r=h-Wt,a>s){if(i.match_start=e,s=a,a>=o)break;d=c[r+s-1],g=c[r+s]}}while((e=m[e&u])>l&&--t!==0);return s<=i.lookahead?s:i.lookahead},_r=i=>{let e=i.w_size,t,r,n;do{if(r=i.window_size-i.lookahead-i.strstart,i.strstart>=e+(e-At)&&(i.window.set(i.window.subarray(e,e+e-r),0),i.match_start-=e,i.strstart-=e,i.block_start-=e,i.insert>i.strstart&&(i.insert=i.strstart),Dp(i),r+=e),i.strm.avail_in===0)break;if(t=Ys(i.strm,i.window,i.strstart+i.lookahead,r),i.lookahead+=t,i.lookahead+i.insert>=Y)for(n=i.strstart-i.insert,i.ins_h=i.window[n],i.ins_h=Xt(i,i.ins_h,i.window[n+1]);i.insert&&(i.ins_h=Xt(i,i.ins_h,i.window[n+Y-1]),i.prev[n&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=n,n++,i.insert--,!(i.lookahead+i.insert<Y)););}while(i.lookahead<At&&i.strm.avail_in!==0)},Fl=(i,e)=>{let t=i.pending_buf_size-5>i.w_size?i.w_size:i.pending_buf_size-5,r,n,a,s=0,o=i.strm.avail_in;do{if(r=65535,a=i.bi_valid+42>>3,i.strm.avail_out<a||(a=i.strm.avail_out-a,n=i.strstart-i.block_start,r>n+i.strm.avail_in&&(r=n+i.strm.avail_in),r>a&&(r=a),r<t&&(r===0&&e!==lt||e===Yt||r!==n+i.strm.avail_in)))break;s=e===lt&&r===n+i.strm.avail_in?1:0,Ks(i,0,0,s),i.pending_buf[i.pending-4]=r,i.pending_buf[i.pending-3]=r>>8,i.pending_buf[i.pending-2]=~r,i.pending_buf[i.pending-1]=~r>>8,Ye(i.strm),n&&(n>r&&(n=r),i.strm.output.set(i.window.subarray(i.block_start,i.block_start+n),i.strm.next_out),i.strm.next_out+=n,i.strm.avail_out-=n,i.strm.total_out+=n,i.block_start+=n,r-=n),r&&(Ys(i.strm,i.strm.output,i.strm.next_out,r),i.strm.next_out+=r,i.strm.avail_out-=r,i.strm.total_out+=r)}while(s===0);return o-=i.strm.avail_in,o&&(o>=i.w_size?(i.matches=2,i.window.set(i.strm.input.subarray(i.strm.next_in-i.w_size,i.strm.next_in),0),i.strstart=i.w_size,i.insert=i.strstart):(i.window_size-i.strstart<=o&&(i.strstart-=i.w_size,i.window.set(i.window.subarray(i.w_size,i.w_size+i.strstart),0),i.matches<2&&i.matches++,i.insert>i.strstart&&(i.insert=i.strstart)),i.window.set(i.strm.input.subarray(i.strm.next_in-o,i.strm.next_in),i.strstart),i.strstart+=o,i.insert+=o>i.w_size-i.insert?i.w_size-i.insert:o),i.block_start=i.strstart),i.high_water<i.strstart&&(i.high_water=i.strstart),s?Tr:e!==Yt&&e!==lt&&i.strm.avail_in===0&&i.strstart===i.block_start?kr:(a=i.window_size-i.strstart,i.strm.avail_in>a&&i.block_start>=i.w_size&&(i.block_start-=i.w_size,i.strstart-=i.w_size,i.window.set(i.window.subarray(i.w_size,i.w_size+i.strstart),0),i.matches<2&&i.matches++,a+=i.w_size,i.insert>i.strstart&&(i.insert=i.strstart)),a>i.strm.avail_in&&(a=i.strm.avail_in),a&&(Ys(i.strm,i.window,i.strstart,a),i.strstart+=a,i.insert+=a>i.w_size-i.insert?i.w_size-i.insert:a),i.high_water<i.strstart&&(i.high_water=i.strstart),a=i.bi_valid+42>>3,a=i.pending_buf_size-a>65535?65535:i.pending_buf_size-a,t=a>i.w_size?i.w_size:a,n=i.strstart-i.block_start,(n>=t||(n||e===lt)&&e!==Yt&&i.strm.avail_in===0&&n<=a)&&(r=n>a?a:n,s=e===lt&&i.strm.avail_in===0&&r===n?1:0,Ks(i,i.block_start,r,s),i.block_start+=r,Ye(i.strm)),s?Fi:ze)},ws=(i,e)=>{let t,r;for(;;){if(i.lookahead<At){if(_r(i),i.lookahead<At&&e===Yt)return ze;if(i.lookahead===0)break}if(t=0,i.lookahead>=Y&&(i.ins_h=Xt(i,i.ins_h,i.window[i.strstart+Y-1]),t=i.prev[i.strstart&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=i.strstart),t!==0&&i.strstart-t<=i.w_size-At&&(i.match_length=Ul(i,t)),i.match_length>=Y)if(r=Jt(i,i.strstart-i.match_start,i.match_length-Y),i.lookahead-=i.match_length,i.match_length<=i.max_lazy_match&&i.lookahead>=Y){i.match_length--;do i.strstart++,i.ins_h=Xt(i,i.ins_h,i.window[i.strstart+Y-1]),t=i.prev[i.strstart&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=i.strstart;while(--i.match_length!==0);i.strstart++}else i.strstart+=i.match_length,i.match_length=0,i.ins_h=i.window[i.strstart],i.ins_h=Xt(i,i.ins_h,i.window[i.strstart+1]);else r=Jt(i,0,i.window[i.strstart]),i.lookahead--,i.strstart++;if(r&&(et(i,!1),i.strm.avail_out===0))return ze}return i.insert=i.strstart<Y-1?i.strstart:Y-1,e===lt?(et(i,!0),i.strm.avail_out===0?Fi:Tr):i.sym_next&&(et(i,!1),i.strm.avail_out===0)?ze:kr},or=(i,e)=>{let t,r,n;for(;;){if(i.lookahead<At){if(_r(i),i.lookahead<At&&e===Yt)return ze;if(i.lookahead===0)break}if(t=0,i.lookahead>=Y&&(i.ins_h=Xt(i,i.ins_h,i.window[i.strstart+Y-1]),t=i.prev[i.strstart&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=i.strstart),i.prev_length=i.match_length,i.prev_match=i.match_start,i.match_length=Y-1,t!==0&&i.prev_length<i.max_lazy_match&&i.strstart-t<=i.w_size-At&&(i.match_length=Ul(i,t),i.match_length<=5&&(i.strategy===_p||i.match_length===Y&&i.strstart-i.match_start>4096)&&(i.match_length=Y-1)),i.prev_length>=Y&&i.match_length<=i.prev_length){n=i.strstart+i.lookahead-Y,r=Jt(i,i.strstart-1-i.prev_match,i.prev_length-Y),i.lookahead-=i.prev_length-1,i.prev_length-=2;do++i.strstart<=n&&(i.ins_h=Xt(i,i.ins_h,i.window[i.strstart+Y-1]),t=i.prev[i.strstart&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=i.strstart);while(--i.prev_length!==0);if(i.match_available=0,i.match_length=Y-1,i.strstart++,r&&(et(i,!1),i.strm.avail_out===0))return ze}else if(i.match_available){if(r=Jt(i,0,i.window[i.strstart-1]),r&&et(i,!1),i.strstart++,i.lookahead--,i.strm.avail_out===0)return ze}else i.match_available=1,i.strstart++,i.lookahead--}return i.match_available&&(r=Jt(i,0,i.window[i.strstart-1]),i.match_available=0),i.insert=i.strstart<Y-1?i.strstart:Y-1,e===lt?(et(i,!0),i.strm.avail_out===0?Fi:Tr):i.sym_next&&(et(i,!1),i.strm.avail_out===0)?ze:kr},Up=(i,e)=>{let t,r,n,a,s=i.window;for(;;){if(i.lookahead<=Wt){if(_r(i),i.lookahead<=Wt&&e===Yt)return ze;if(i.lookahead===0)break}if(i.match_length=0,i.lookahead>=Y&&i.strstart>0&&(n=i.strstart-1,r=s[n],r===s[++n]&&r===s[++n]&&r===s[++n])){a=i.strstart+Wt;do;while(r===s[++n]&&r===s[++n]&&r===s[++n]&&r===s[++n]&&r===s[++n]&&r===s[++n]&&r===s[++n]&&r===s[++n]&&n<a);i.match_length=Wt-(a-n),i.match_length>i.lookahead&&(i.match_length=i.lookahead)}if(i.match_length>=Y?(t=Jt(i,1,i.match_length-Y),i.lookahead-=i.match_length,i.strstart+=i.match_length,i.match_length=0):(t=Jt(i,0,i.window[i.strstart]),i.lookahead--,i.strstart++),t&&(et(i,!1),i.strm.avail_out===0))return ze}return i.insert=0,e===lt?(et(i,!0),i.strm.avail_out===0?Fi:Tr):i.sym_next&&(et(i,!1),i.strm.avail_out===0)?ze:kr},Fp=(i,e)=>{let t;for(;;){if(i.lookahead===0&&(_r(i),i.lookahead===0)){if(e===Yt)return ze;break}if(i.match_length=0,t=Jt(i,0,i.window[i.strstart]),i.lookahead--,i.strstart++,t&&(et(i,!1),i.strm.avail_out===0))return ze}return i.insert=0,e===lt?(et(i,!0),i.strm.avail_out===0?Fi:Tr):i.sym_next&&(et(i,!1),i.strm.avail_out===0)?ze:kr};function yt(i,e,t,r,n){this.good_length=i,this.max_lazy=e,this.nice_length=t,this.max_chain=r,this.func=n}var en=[new yt(0,0,0,0,Fl),new yt(4,4,8,4,ws),new yt(4,5,16,8,ws),new yt(4,6,32,32,ws),new yt(4,4,16,16,or),new yt(8,16,32,32,or),new yt(8,16,128,128,or),new yt(8,32,128,256,or),new yt(32,128,258,1024,or),new yt(32,258,258,4096,or)],jp=i=>{i.window_size=2*i.w_size,Kt(i.head),i.max_lazy_match=en[i.level].max_lazy,i.good_match=en[i.level].good_length,i.nice_match=en[i.level].nice_length,i.max_chain_length=en[i.level].max_chain,i.strstart=0,i.block_start=0,i.lookahead=0,i.insert=0,i.match_length=i.prev_length=Y-1,i.match_available=0,i.ins_h=0};function Bp(){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=Va,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(Lp*2),this.dyn_dtree=new Uint16Array((2*Cp+1)*2),this.bl_tree=new Uint16Array((2*Np+1)*2),Kt(this.dyn_ltree),Kt(this.dyn_dtree),Kt(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(Pp+1),this.heap=new Uint16Array(2*Ws+1),Kt(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*Ws+1),Kt(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 An=i=>{if(!i)return 1;let e=i.state;return!e||e.strm!==i||e.status!==br&&e.status!==ho&&e.status!==Qs&&e.status!==Gs&&e.status!==Zs&&e.status!==Js&&e.status!==ki&&e.status!==Xr?1:0},jl=i=>{if(An(i))return Ti(i,xt);i.total_in=i.total_out=0,i.data_type=xp;let e=i.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap===2?ho:e.wrap?br:ki,i.adler=e.wrap===2?0:1,e.last_flush=-2,fp(e),Ce},Bl=i=>{let e=jl(i);return e===Ce&&jp(i.state),e},qp=(i,e)=>An(i)||i.state.wrap!==2?xt:(i.state.gzhead=e,Ce),ql=(i,e,t,r,n,a)=>{if(!i)return xt;let s=1;if(e===bp&&(e=6),r<0?(s=0,r=-r):r>15&&(s=2,r-=16),n<1||n>Ap||t!==Va||r<8||r>15||e<0||e>9||a<0||a>wp||r===8&&s!==1)return Ti(i,xt);r===8&&(r=9);let o=new Bp;return i.state=o,o.strm=i,o.status=br,o.wrap=s,o.gzhead=null,o.w_bits=r,o.w_size=1<<o.w_bits,o.w_mask=o.w_size-1,o.hash_bits=n+7,o.hash_size=1<<o.hash_bits,o.hash_mask=o.hash_size-1,o.hash_shift=~~((o.hash_bits+Y-1)/Y),o.window=new Uint8Array(o.w_size*2),o.head=new Uint16Array(o.hash_size),o.prev=new Uint16Array(o.w_size),o.lit_bufsize=1<<n+6,o.pending_buf_size=o.lit_bufsize*4,o.pending_buf=new Uint8Array(o.pending_buf_size),o.sym_buf=o.lit_bufsize,o.sym_end=(o.lit_bufsize-1)*3,o.level=e,o.strategy=a,o.method=t,Bl(i)},Vp=(i,e)=>ql(i,e,Va,$p,Ip,Ep),zp=(i,e)=>{if(An(i)||e>lc||e<0)return i?Ti(i,xt):xt;let t=i.state;if(!i.output||i.avail_in!==0&&!i.input||t.status===Xr&&e!==lt)return Ti(i,i.avail_out===0?Ss:xt);let r=t.last_flush;if(t.last_flush=e,t.pending!==0){if(Ye(i),i.avail_out===0)return t.last_flush=-1,Ce}else if(i.avail_in===0&&dc(e)<=dc(r)&&e!==lt)return Ti(i,Ss);if(t.status===Xr&&i.avail_in!==0)return Ti(i,Ss);if(t.status===br&&t.wrap===0&&(t.status=ki),t.status===br){let n=Va+(t.w_bits-8<<4)<<8,a=-1;if(t.strategy>=Wn||t.level<2?a=0:t.level<6?a=1:t.level===6?a=2:a=3,n|=a<<6,t.strstart!==0&&(n|=Rp),n+=31-n%31,Ur(t,n),t.strstart!==0&&(Ur(t,i.adler>>>16),Ur(t,i.adler&65535)),i.adler=1,t.status=ki,Ye(i),t.pending!==0)return t.last_flush=-1,Ce}if(t.status===ho){if(i.adler=0,ie(t,31),ie(t,139),ie(t,8),t.gzhead)ie(t,(t.gzhead.text?1:0)+(t.gzhead.hcrc?2:0)+(t.gzhead.extra?4:0)+(t.gzhead.name?8:0)+(t.gzhead.comment?16:0)),ie(t,t.gzhead.time&255),ie(t,t.gzhead.time>>8&255),ie(t,t.gzhead.time>>16&255),ie(t,t.gzhead.time>>24&255),ie(t,t.level===9?2:t.strategy>=Wn||t.level<2?4:0),ie(t,t.gzhead.os&255),t.gzhead.extra&&t.gzhead.extra.length&&(ie(t,t.gzhead.extra.length&255),ie(t,t.gzhead.extra.length>>8&255)),t.gzhead.hcrc&&(i.adler=xe(i.adler,t.pending_buf,t.pending,0)),t.gzindex=0,t.status=Qs;else if(ie(t,0),ie(t,0),ie(t,0),ie(t,0),ie(t,0),ie(t,t.level===9?2:t.strategy>=Wn||t.level<2?4:0),ie(t,Op),t.status=ki,Ye(i),t.pending!==0)return t.last_flush=-1,Ce}if(t.status===Qs){if(t.gzhead.extra){let n=t.pending,a=(t.gzhead.extra.length&65535)-t.gzindex;for(;t.pending+a>t.pending_buf_size;){let o=t.pending_buf_size-t.pending;if(t.pending_buf.set(t.gzhead.extra.subarray(t.gzindex,t.gzindex+o),t.pending),t.pending=t.pending_buf_size,t.gzhead.hcrc&&t.pending>n&&(i.adler=xe(i.adler,t.pending_buf,t.pending-n,n)),t.gzindex+=o,Ye(i),t.pending!==0)return t.last_flush=-1,Ce;n=0,a-=o}let s=new Uint8Array(t.gzhead.extra);t.pending_buf.set(s.subarray(t.gzindex,t.gzindex+a),t.pending),t.pending+=a,t.gzhead.hcrc&&t.pending>n&&(i.adler=xe(i.adler,t.pending_buf,t.pending-n,n)),t.gzindex=0}t.status=Gs}if(t.status===Gs){if(t.gzhead.name){let n=t.pending,a;do{if(t.pending===t.pending_buf_size){if(t.gzhead.hcrc&&t.pending>n&&(i.adler=xe(i.adler,t.pending_buf,t.pending-n,n)),Ye(i),t.pending!==0)return t.last_flush=-1,Ce;n=0}t.gzindex<t.gzhead.name.length?a=t.gzhead.name.charCodeAt(t.gzindex++)&255:a=0,ie(t,a)}while(a!==0);t.gzhead.hcrc&&t.pending>n&&(i.adler=xe(i.adler,t.pending_buf,t.pending-n,n)),t.gzindex=0}t.status=Zs}if(t.status===Zs){if(t.gzhead.comment){let n=t.pending,a;do{if(t.pending===t.pending_buf_size){if(t.gzhead.hcrc&&t.pending>n&&(i.adler=xe(i.adler,t.pending_buf,t.pending-n,n)),Ye(i),t.pending!==0)return t.last_flush=-1,Ce;n=0}t.gzindex<t.gzhead.comment.length?a=t.gzhead.comment.charCodeAt(t.gzindex++)&255:a=0,ie(t,a)}while(a!==0);t.gzhead.hcrc&&t.pending>n&&(i.adler=xe(i.adler,t.pending_buf,t.pending-n,n))}t.status=Js}if(t.status===Js){if(t.gzhead.hcrc){if(t.pending+2>t.pending_buf_size&&(Ye(i),t.pending!==0))return t.last_flush=-1,Ce;ie(t,i.adler&255),ie(t,i.adler>>8&255),i.adler=0}if(t.status=ki,Ye(i),t.pending!==0)return t.last_flush=-1,Ce}if(i.avail_in!==0||t.lookahead!==0||e!==Yt&&t.status!==Xr){let n=t.level===0?Fl(t,e):t.strategy===Wn?Fp(t,e):t.strategy===Sp?Up(t,e):en[t.level].func(t,e);if((n===Fi||n===Tr)&&(t.status=Xr),n===ze||n===Fi)return i.avail_out===0&&(t.last_flush=-1),Ce;if(n===kr&&(e===mp?gp(t):e!==lc&&(Ks(t,0,0,!1),e===yp&&(Kt(t.head),t.lookahead===0&&(t.strstart=0,t.block_start=0,t.insert=0))),Ye(i),i.avail_out===0))return t.last_flush=-1,Ce}return e!==lt?Ce:t.wrap<=0?uc:(t.wrap===2?(ie(t,i.adler&255),ie(t,i.adler>>8&255),ie(t,i.adler>>16&255),ie(t,i.adler>>24&255),ie(t,i.total_in&255),ie(t,i.total_in>>8&255),ie(t,i.total_in>>16&255),ie(t,i.total_in>>24&255)):(Ur(t,i.adler>>>16),Ur(t,i.adler&65535)),Ye(i),t.wrap>0&&(t.wrap=-t.wrap),t.pending!==0?Ce:uc)},Hp=i=>{if(An(i))return xt;let e=i.state.status;return i.state=null,e===ki?Ti(i,vp):Ce},Kp=(i,e)=>{let t=e.length;if(An(i))return xt;let r=i.state,n=r.wrap;if(n===2||n===1&&r.status!==br||r.lookahead)return xt;if(n===1&&(i.adler=yn(i.adler,e,t,0)),r.wrap=0,t>=r.w_size){n===0&&(Kt(r.head),r.strstart=0,r.block_start=0,r.insert=0);let l=new Uint8Array(r.w_size);l.set(e.subarray(t-r.w_size,t),0),e=l,t=r.w_size}let a=i.avail_in,s=i.next_in,o=i.input;for(i.avail_in=t,i.next_in=0,i.input=e,_r(r);r.lookahead>=Y;){let l=r.strstart,c=r.lookahead-(Y-1);do r.ins_h=Xt(r,r.ins_h,r.window[l+Y-1]),r.prev[l&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=l,l++;while(--c);r.strstart=l,r.lookahead=Y-1,_r(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=Y-1,r.match_available=0,i.next_in=s,i.input=o,i.avail_in=a,r.wrap=n,Ce},Wp=Vp,Qp=ql,Gp=Bl,Zp=jl,Jp=qp,Yp=zp,Xp=Hp,ef=Kp,tf="pako deflate (from Nodeca project)",on={deflateInit:Wp,deflateInit2:Qp,deflateReset:Gp,deflateResetKeep:Zp,deflateSetHeader:Jp,deflate:Yp,deflateEnd:Xp,deflateSetDictionary:ef,deflateInfo:tf},rf=(i,e)=>Object.prototype.hasOwnProperty.call(i,e),nf=function(i){let e=Array.prototype.slice.call(arguments,1);for(;e.length;){let t=e.shift();if(!!t){if(typeof t!="object")throw new TypeError(t+"must be non-object");for(let r in t)rf(t,r)&&(i[r]=t[r])}}return i},af=i=>{let e=0;for(let r=0,n=i.length;r<n;r++)e+=i[r].length;let t=new Uint8Array(e);for(let r=0,n=0,a=i.length;r<a;r++){let s=i[r];t.set(s,n),n+=s.length}return t},za={assign:nf,flattenChunks:af},Vl=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(i){Vl=!1}var vn=new Uint8Array(256);for(let i=0;i<256;i++)vn[i]=i>=252?6:i>=248?5:i>=240?4:i>=224?3:i>=192?2:1;vn[254]=vn[254]=1;var sf=i=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(i);let e,t,r,n,a,s=i.length,o=0;for(n=0;n<s;n++)t=i.charCodeAt(n),(t&64512)===55296&&n+1<s&&(r=i.charCodeAt(n+1),(r&64512)===56320&&(t=65536+(t-55296<<10)+(r-56320),n++)),o+=t<128?1:t<2048?2:t<65536?3:4;for(e=new Uint8Array(o),a=0,n=0;a<o;n++)t=i.charCodeAt(n),(t&64512)===55296&&n+1<s&&(r=i.charCodeAt(n+1),(r&64512)===56320&&(t=65536+(t-55296<<10)+(r-56320),n++)),t<128?e[a++]=t:t<2048?(e[a++]=192|t>>>6,e[a++]=128|t&63):t<65536?(e[a++]=224|t>>>12,e[a++]=128|t>>>6&63,e[a++]=128|t&63):(e[a++]=240|t>>>18,e[a++]=128|t>>>12&63,e[a++]=128|t>>>6&63,e[a++]=128|t&63);return e},of=(i,e)=>{if(e<65534&&i.subarray&&Vl)return String.fromCharCode.apply(null,i.length===e?i:i.subarray(0,e));let t="";for(let r=0;r<e;r++)t+=String.fromCharCode(i[r]);return t},cf=(i,e)=>{let t=e||i.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(i.subarray(0,e));let r,n,a=new Array(t*2);for(n=0,r=0;r<t;){let s=i[r++];if(s<128){a[n++]=s;continue}let o=vn[s];if(o>4){a[n++]=65533,r+=o-1;continue}for(s&=o===2?31:o===3?15:7;o>1&&r<t;)s=s<<6|i[r++]&63,o--;if(o>1){a[n++]=65533;continue}s<65536?a[n++]=s:(s-=65536,a[n++]=55296|s>>10&1023,a[n++]=56320|s&1023)}return of(a,n)},lf=(i,e)=>{e=e||i.length,e>i.length&&(e=i.length);let t=e-1;for(;t>=0&&(i[t]&192)===128;)t--;return t<0||t===0?e:t+vn[i[t]]>e?t:e},bn={string2buf:sf,buf2string:cf,utf8border:lf};function uf(){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 zl=uf,Hl=Object.prototype.toString,{Z_NO_FLUSH:df,Z_SYNC_FLUSH:pf,Z_FULL_FLUSH:ff,Z_FINISH:hf,Z_OK:Na,Z_STREAM_END:gf,Z_DEFAULT_COMPRESSION:mf,Z_DEFAULT_STRATEGY:yf,Z_DEFLATED:vf}=Wi;function $n(i){this.options=za.assign({level:mf,method:vf,chunkSize:16384,windowBits:15,memLevel:8,strategy:yf},i||{});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 zl,this.strm.avail_out=0;let t=on.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(t!==Na)throw new Error(Ui[t]);if(e.header&&on.deflateSetHeader(this.strm,e.header),e.dictionary){let r;if(typeof e.dictionary=="string"?r=bn.string2buf(e.dictionary):Hl.call(e.dictionary)==="[object ArrayBuffer]"?r=new Uint8Array(e.dictionary):r=e.dictionary,t=on.deflateSetDictionary(this.strm,r),t!==Na)throw new Error(Ui[t]);this._dict_set=!0}}$n.prototype.push=function(i,e){let t=this.strm,r=this.options.chunkSize,n,a;if(this.ended)return!1;for(e===~~e?a=e:a=e===!0?hf:df,typeof i=="string"?t.input=bn.string2buf(i):Hl.call(i)==="[object ArrayBuffer]"?t.input=new Uint8Array(i):t.input=i,t.next_in=0,t.avail_in=t.input.length;;){if(t.avail_out===0&&(t.output=new Uint8Array(r),t.next_out=0,t.avail_out=r),(a===pf||a===ff)&&t.avail_out<=6){this.onData(t.output.subarray(0,t.next_out)),t.avail_out=0;continue}if(n=on.deflate(t,a),n===gf)return t.next_out>0&&this.onData(t.output.subarray(0,t.next_out)),n=on.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===Na;if(t.avail_out===0){this.onData(t.output);continue}if(a>0&&t.next_out>0){this.onData(t.output.subarray(0,t.next_out)),t.avail_out=0;continue}if(t.avail_in===0)break}return!0};$n.prototype.onData=function(i){this.chunks.push(i)};$n.prototype.onEnd=function(i){i===Na&&(this.result=za.flattenChunks(this.chunks)),this.chunks=[],this.err=i,this.msg=this.strm.msg};function go(i,e){let t=new $n(e);if(t.push(i,!0),t.err)throw t.msg||Ui[t.err];return t.result}function bf(i,e){return e=e||{},e.raw=!0,go(i,e)}function _f(i,e){return e=e||{},e.gzip=!0,go(i,e)}var Sf=$n,wf=go,Ef=bf,xf=_f,Af=Wi,$f={Deflate:Sf,deflate:wf,deflateRaw:Ef,gzip:xf,constants:Af},Qn=16209,If=16191,kf=function i(e,t){let r,n,a,s,o,l,c,u,m,h,d,g,v,E,A,C,O,$,T,G,I,K,N,k,D=e.state;r=e.next_in,N=e.input,n=r+(e.avail_in-5),a=e.next_out,k=e.output,s=a-(t-e.avail_out),o=a+(e.avail_out-257),l=D.dmax,c=D.wsize,u=D.whave,m=D.wnext,h=D.window,d=D.hold,g=D.bits,v=D.lencode,E=D.distcode,A=(1<<D.lenbits)-1,C=(1<<D.distbits)-1;e:do{g<15&&(d+=N[r++]<<g,g+=8,d+=N[r++]<<g,g+=8),O=v[d&A];t:for(;;){if($=O>>>24,d>>>=$,g-=$,$=O>>>16&255,$===0)k[a++]=O&65535;else if($&16){T=O&65535,$&=15,$&&(g<$&&(d+=N[r++]<<g,g+=8),T+=d&(1<<$)-1,d>>>=$,g-=$),g<15&&(d+=N[r++]<<g,g+=8,d+=N[r++]<<g,g+=8),O=E[d&C];i:for(;;){if($=O>>>24,d>>>=$,g-=$,$=O>>>16&255,$&16){if(G=O&65535,$&=15,g<$&&(d+=N[r++]<<g,g+=8,g<$&&(d+=N[r++]<<g,g+=8)),G+=d&(1<<$)-1,G>l){e.msg="invalid distance too far back",D.mode=Qn;break e}if(d>>>=$,g-=$,$=a-s,G>$){if($=G-$,$>u&&D.sane){e.msg="invalid distance too far back",D.mode=Qn;break e}if(I=0,K=h,m===0){if(I+=c-$,$<T){T-=$;do k[a++]=h[I++];while(--$);I=a-G,K=k}}else if(m<$){if(I+=c+m-$,$-=m,$<T){T-=$;do k[a++]=h[I++];while(--$);if(I=0,m<T){$=m,T-=$;do k[a++]=h[I++];while(--$);I=a-G,K=k}}}else if(I+=m-$,$<T){T-=$;do k[a++]=h[I++];while(--$);I=a-G,K=k}for(;T>2;)k[a++]=K[I++],k[a++]=K[I++],k[a++]=K[I++],T-=3;T&&(k[a++]=K[I++],T>1&&(k[a++]=K[I++]))}else{I=a-G;do k[a++]=k[I++],k[a++]=k[I++],k[a++]=k[I++],T-=3;while(T>2);T&&(k[a++]=k[I++],T>1&&(k[a++]=k[I++]))}}else if(($&64)===0){O=E[(O&65535)+(d&(1<<$)-1)];continue i}else{e.msg="invalid distance code",D.mode=Qn;break e}break}}else if(($&64)===0){O=v[(O&65535)+(d&(1<<$)-1)];continue t}else if($&32){D.mode=If;break e}else{e.msg="invalid literal/length code",D.mode=Qn;break e}break}}while(r<n&&a<o);T=g>>3,r-=T,g-=T<<3,d&=(1<<g)-1,e.next_in=r,e.next_out=a,e.avail_in=r<n?5+(n-r):5-(r-n),e.avail_out=a<o?257+(o-a):257-(a-o),D.hold=d,D.bits=g},cr=15,pc=852,fc=592,hc=0,Es=1,gc=2,Tf=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]),Cf=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]),Nf=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]),Lf=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]),Pf=(i,e,t,r,n,a,s,o)=>{let l=o.bits,c=0,u=0,m=0,h=0,d=0,g=0,v=0,E=0,A=0,C=0,O,$,T,G,I,K=null,N,k=new Uint16Array(cr+1),D=new Uint16Array(cr+1),Ue=null,Ie,Se,Tn;for(c=0;c<=cr;c++)k[c]=0;for(u=0;u<r;u++)k[e[t+u]]++;for(d=l,h=cr;h>=1&&k[h]===0;h--);if(d>h&&(d=h),h===0)return n[a++]=1<<24|64<<16|0,n[a++]=1<<24|64<<16|0,o.bits=1,0;for(m=1;m<h&&k[m]===0;m++);for(d<m&&(d=m),E=1,c=1;c<=cr;c++)if(E<<=1,E-=k[c],E<0)return-1;if(E>0&&(i===hc||h!==1))return-1;for(D[1]=0,c=1;c<cr;c++)D[c+1]=D[c]+k[c];for(u=0;u<r;u++)e[t+u]!==0&&(s[D[e[t+u]]++]=u);if(i===hc?(K=Ue=s,N=20):i===Es?(K=Tf,Ue=Cf,N=257):(K=Nf,Ue=Lf,N=0),C=0,u=0,c=m,I=a,g=d,v=0,T=-1,A=1<<d,G=A-1,i===Es&&A>pc||i===gc&&A>fc)return 1;for(;;){Ie=c-v,s[u]+1<N?(Se=0,Tn=s[u]):s[u]>=N?(Se=Ue[s[u]-N],Tn=K[s[u]-N]):(Se=32+64,Tn=0),O=1<<c-v,$=1<<g,m=$;do $-=O,n[I+(C>>v)+$]=Ie<<24|Se<<16|Tn|0;while($!==0);for(O=1<<c-1;C&O;)O>>=1;if(O!==0?(C&=O-1,C+=O):C=0,u++,--k[c]===0){if(c===h)break;c=e[t+s[u]]}if(c>d&&(C&G)!==T){for(v===0&&(v=d),I+=m,g=c-v,E=1<<g;g+v<h&&(E-=k[g+v],!(E<=0));)g++,E<<=1;if(A+=1<<g,i===Es&&A>pc||i===gc&&A>fc)return 1;T=C&G,n[T]=d<<24|g<<16|I-a|0}}return C!==0&&(n[I+C]=c-v<<24|64<<16|0),o.bits=d,0},cn=Pf,Rf=0,Kl=1,Wl=2,{Z_FINISH:mc,Z_BLOCK:Of,Z_TREES:Gn,Z_OK:ji,Z_STREAM_END:Df,Z_NEED_DICT:Mf,Z_STREAM_ERROR:ut,Z_DATA_ERROR:Ql,Z_MEM_ERROR:Gl,Z_BUF_ERROR:Uf,Z_DEFLATED:yc}=Wi,Ha=16180,vc=16181,bc=16182,_c=16183,Sc=16184,wc=16185,Ec=16186,xc=16187,Ac=16188,$c=16189,La=16190,Nt=16191,xs=16192,Ic=16193,As=16194,kc=16195,Tc=16196,Cc=16197,Nc=16198,Zn=16199,Jn=16200,Lc=16201,Pc=16202,Rc=16203,Oc=16204,Dc=16205,$s=16206,Mc=16207,Uc=16208,ue=16209,Zl=16210,Jl=16211,Ff=852,jf=592,Bf=15,qf=Bf,Fc=i=>(i>>>24&255)+(i>>>8&65280)+((i&65280)<<8)+((i&255)<<24);function Vf(){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 Qi=i=>{if(!i)return 1;let e=i.state;return!e||e.strm!==i||e.mode<Ha||e.mode>Jl?1:0},Yl=i=>{if(Qi(i))return ut;let e=i.state;return i.total_in=i.total_out=e.total=0,i.msg="",e.wrap&&(i.adler=e.wrap&1),e.mode=Ha,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(Ff),e.distcode=e.distdyn=new Int32Array(jf),e.sane=1,e.back=-1,ji},Xl=i=>{if(Qi(i))return ut;let e=i.state;return e.wsize=0,e.whave=0,e.wnext=0,Yl(i)},eu=(i,e)=>{let t;if(Qi(i))return ut;let r=i.state;return e<0?(t=0,e=-e):(t=(e>>4)+5,e<48&&(e&=15)),e&&(e<8||e>15)?ut:(r.window!==null&&r.wbits!==e&&(r.window=null),r.wrap=t,r.wbits=e,Xl(i))},tu=(i,e)=>{if(!i)return ut;let t=new Vf;i.state=t,t.strm=i,t.window=null,t.mode=Ha;let r=eu(i,e);return r!==ji&&(i.state=null),r},zf=i=>tu(i,qf),jc=!0,Is,ks,Hf=i=>{if(jc){Is=new Int32Array(512),ks=new Int32Array(32);let e=0;for(;e<144;)i.lens[e++]=8;for(;e<256;)i.lens[e++]=9;for(;e<280;)i.lens[e++]=7;for(;e<288;)i.lens[e++]=8;for(cn(Kl,i.lens,0,288,Is,0,i.work,{bits:9}),e=0;e<32;)i.lens[e++]=5;cn(Wl,i.lens,0,32,ks,0,i.work,{bits:5}),jc=!1}i.lencode=Is,i.lenbits=9,i.distcode=ks,i.distbits=5},iu=(i,e,t,r)=>{let n,a=i.state;return a.window===null&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new Uint8Array(a.wsize)),r>=a.wsize?(a.window.set(e.subarray(t-a.wsize,t),0),a.wnext=0,a.whave=a.wsize):(n=a.wsize-a.wnext,n>r&&(n=r),a.window.set(e.subarray(t-r,t-r+n),a.wnext),r-=n,r?(a.window.set(e.subarray(t-r,t),0),a.wnext=r,a.whave=a.wsize):(a.wnext+=n,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=n))),0},Kf=(i,e)=>{let t,r,n,a,s,o,l,c,u,m,h,d,g,v,E=0,A,C,O,$,T,G,I,K,N=new Uint8Array(4),k,D,Ue=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Qi(i)||!i.output||!i.input&&i.avail_in!==0)return ut;t=i.state,t.mode===Nt&&(t.mode=xs),s=i.next_out,n=i.output,l=i.avail_out,a=i.next_in,r=i.input,o=i.avail_in,c=t.hold,u=t.bits,m=o,h=l,K=ji;e:for(;;)switch(t.mode){case Ha:if(t.wrap===0){t.mode=xs;break}for(;u<16;){if(o===0)break e;o--,c+=r[a++]<<u,u+=8}if(t.wrap&2&&c===35615){t.wbits===0&&(t.wbits=15),t.check=0,N[0]=c&255,N[1]=c>>>8&255,t.check=xe(t.check,N,2,0),c=0,u=0,t.mode=vc;break}if(t.head&&(t.head.done=!1),!(t.wrap&1)||(((c&255)<<8)+(c>>8))%31){i.msg="incorrect header check",t.mode=ue;break}if((c&15)!==yc){i.msg="unknown compression method",t.mode=ue;break}if(c>>>=4,u-=4,I=(c&15)+8,t.wbits===0&&(t.wbits=I),I>15||I>t.wbits){i.msg="invalid window size",t.mode=ue;break}t.dmax=1<<t.wbits,t.flags=0,i.adler=t.check=1,t.mode=c&512?$c:Nt,c=0,u=0;break;case vc:for(;u<16;){if(o===0)break e;o--,c+=r[a++]<<u,u+=8}if(t.flags=c,(t.flags&255)!==yc){i.msg="unknown compression method",t.mode=ue;break}if(t.flags&57344){i.msg="unknown header flags set",t.mode=ue;break}t.head&&(t.head.text=c>>8&1),t.flags&512&&t.wrap&4&&(N[0]=c&255,N[1]=c>>>8&255,t.check=xe(t.check,N,2,0)),c=0,u=0,t.mode=bc;case bc:for(;u<32;){if(o===0)break e;o--,c+=r[a++]<<u,u+=8}t.head&&(t.head.time=c),t.flags&512&&t.wrap&4&&(N[0]=c&255,N[1]=c>>>8&255,N[2]=c>>>16&255,N[3]=c>>>24&255,t.check=xe(t.check,N,4,0)),c=0,u=0,t.mode=_c;case _c:for(;u<16;){if(o===0)break e;o--,c+=r[a++]<<u,u+=8}t.head&&(t.head.xflags=c&255,t.head.os=c>>8),t.flags&512&&t.wrap&4&&(N[0]=c&255,N[1]=c>>>8&255,t.check=xe(t.check,N,2,0)),c=0,u=0,t.mode=Sc;case Sc:if(t.flags&1024){for(;u<16;){if(o===0)break e;o--,c+=r[a++]<<u,u+=8}t.length=c,t.head&&(t.head.extra_len=c),t.flags&512&&t.wrap&4&&(N[0]=c&255,N[1]=c>>>8&255,t.check=xe(t.check,N,2,0)),c=0,u=0}else t.head&&(t.head.extra=null);t.mode=wc;case wc:if(t.flags&1024&&(d=t.length,d>o&&(d=o),d&&(t.head&&(I=t.head.extra_len-t.length,t.head.extra||(t.head.extra=new Uint8Array(t.head.extra_len)),t.head.extra.set(r.subarray(a,a+d),I)),t.flags&512&&t.wrap&4&&(t.check=xe(t.check,r,d,a)),o-=d,a+=d,t.length-=d),t.length))break e;t.length=0,t.mode=Ec;case Ec:if(t.flags&2048){if(o===0)break e;d=0;do I=r[a+d++],t.head&&I&&t.length<65536&&(t.head.name+=String.fromCharCode(I));while(I&&d<o);if(t.flags&512&&t.wrap&4&&(t.check=xe(t.check,r,d,a)),o-=d,a+=d,I)break e}else t.head&&(t.head.name=null);t.length=0,t.mode=xc;case xc:if(t.flags&4096){if(o===0)break e;d=0;do I=r[a+d++],t.head&&I&&t.length<65536&&(t.head.comment+=String.fromCharCode(I));while(I&&d<o);if(t.flags&512&&t.wrap&4&&(t.check=xe(t.check,r,d,a)),o-=d,a+=d,I)break e}else t.head&&(t.head.comment=null);t.mode=Ac;case Ac:if(t.flags&512){for(;u<16;){if(o===0)break e;o--,c+=r[a++]<<u,u+=8}if(t.wrap&4&&c!==(t.check&65535)){i.msg="header crc mismatch",t.mode=ue;break}c=0,u=0}t.head&&(t.head.hcrc=t.flags>>9&1,t.head.done=!0),i.adler=t.check=0,t.mode=Nt;break;case $c:for(;u<32;){if(o===0)break e;o--,c+=r[a++]<<u,u+=8}i.adler=t.check=Fc(c),c=0,u=0,t.mode=La;case La:if(t.havedict===0)return i.next_out=s,i.avail_out=l,i.next_in=a,i.avail_in=o,t.hold=c,t.bits=u,Mf;i.adler=t.check=1,t.mode=Nt;case Nt:if(e===Of||e===Gn)break e;case xs:if(t.last){c>>>=u&7,u-=u&7,t.mode=$s;break}for(;u<3;){if(o===0)break e;o--,c+=r[a++]<<u,u+=8}switch(t.last=c&1,c>>>=1,u-=1,c&3){case 0:t.mode=Ic;break;case 1:if(Hf(t),t.mode=Zn,e===Gn){c>>>=2,u-=2;break e}break;case 2:t.mode=Tc;break;case 3:i.msg="invalid block type",t.mode=ue}c>>>=2,u-=2;break;case Ic:for(c>>>=u&7,u-=u&7;u<32;){if(o===0)break e;o--,c+=r[a++]<<u,u+=8}if((c&65535)!==(c>>>16^65535)){i.msg="invalid stored block lengths",t.mode=ue;break}if(t.length=c&65535,c=0,u=0,t.mode=As,e===Gn)break e;case As:t.mode=kc;case kc:if(d=t.length,d){if(d>o&&(d=o),d>l&&(d=l),d===0)break e;n.set(r.subarray(a,a+d),s),o-=d,a+=d,l-=d,s+=d,t.length-=d;break}t.mode=Nt;break;case Tc:for(;u<14;){if(o===0)break e;o--,c+=r[a++]<<u,u+=8}if(t.nlen=(c&31)+257,c>>>=5,u-=5,t.ndist=(c&31)+1,c>>>=5,u-=5,t.ncode=(c&15)+4,c>>>=4,u-=4,t.nlen>286||t.ndist>30){i.msg="too many length or distance symbols",t.mode=ue;break}t.have=0,t.mode=Cc;case Cc:for(;t.have<t.ncode;){for(;u<3;){if(o===0)break e;o--,c+=r[a++]<<u,u+=8}t.lens[Ue[t.have++]]=c&7,c>>>=3,u-=3}for(;t.have<19;)t.lens[Ue[t.have++]]=0;if(t.lencode=t.lendyn,t.lenbits=7,k={bits:t.lenbits},K=cn(Rf,t.lens,0,19,t.lencode,0,t.work,k),t.lenbits=k.bits,K){i.msg="invalid code lengths set",t.mode=ue;break}t.have=0,t.mode=Nc;case Nc:for(;t.have<t.nlen+t.ndist;){for(;E=t.lencode[c&(1<<t.lenbits)-1],A=E>>>24,C=E>>>16&255,O=E&65535,!(A<=u);){if(o===0)break e;o--,c+=r[a++]<<u,u+=8}if(O<16)c>>>=A,u-=A,t.lens[t.have++]=O;else{if(O===16){for(D=A+2;u<D;){if(o===0)break e;o--,c+=r[a++]<<u,u+=8}if(c>>>=A,u-=A,t.have===0){i.msg="invalid bit length repeat",t.mode=ue;break}I=t.lens[t.have-1],d=3+(c&3),c>>>=2,u-=2}else if(O===17){for(D=A+3;u<D;){if(o===0)break e;o--,c+=r[a++]<<u,u+=8}c>>>=A,u-=A,I=0,d=3+(c&7),c>>>=3,u-=3}else{for(D=A+7;u<D;){if(o===0)break e;o--,c+=r[a++]<<u,u+=8}c>>>=A,u-=A,I=0,d=11+(c&127),c>>>=7,u-=7}if(t.have+d>t.nlen+t.ndist){i.msg="invalid bit length repeat",t.mode=ue;break}for(;d--;)t.lens[t.have++]=I}}if(t.mode===ue)break;if(t.lens[256]===0){i.msg="invalid code -- missing end-of-block",t.mode=ue;break}if(t.lenbits=9,k={bits:t.lenbits},K=cn(Kl,t.lens,0,t.nlen,t.lencode,0,t.work,k),t.lenbits=k.bits,K){i.msg="invalid literal/lengths set",t.mode=ue;break}if(t.distbits=6,t.distcode=t.distdyn,k={bits:t.distbits},K=cn(Wl,t.lens,t.nlen,t.ndist,t.distcode,0,t.work,k),t.distbits=k.bits,K){i.msg="invalid distances set",t.mode=ue;break}if(t.mode=Zn,e===Gn)break e;case Zn:t.mode=Jn;case Jn:if(o>=6&&l>=258){i.next_out=s,i.avail_out=l,i.next_in=a,i.avail_in=o,t.hold=c,t.bits=u,kf(i,h),s=i.next_out,n=i.output,l=i.avail_out,a=i.next_in,r=i.input,o=i.avail_in,c=t.hold,u=t.bits,t.mode===Nt&&(t.back=-1);break}for(t.back=0;E=t.lencode[c&(1<<t.lenbits)-1],A=E>>>24,C=E>>>16&255,O=E&65535,!(A<=u);){if(o===0)break e;o--,c+=r[a++]<<u,u+=8}if(C&&(C&240)===0){for($=A,T=C,G=O;E=t.lencode[G+((c&(1<<$+T)-1)>>$)],A=E>>>24,C=E>>>16&255,O=E&65535,!($+A<=u);){if(o===0)break e;o--,c+=r[a++]<<u,u+=8}c>>>=$,u-=$,t.back+=$}if(c>>>=A,u-=A,t.back+=A,t.length=O,C===0){t.mode=Dc;break}if(C&32){t.back=-1,t.mode=Nt;break}if(C&64){i.msg="invalid literal/length code",t.mode=ue;break}t.extra=C&15,t.mode=Lc;case Lc:if(t.extra){for(D=t.extra;u<D;){if(o===0)break e;o--,c+=r[a++]<<u,u+=8}t.length+=c&(1<<t.extra)-1,c>>>=t.extra,u-=t.extra,t.back+=t.extra}t.was=t.length,t.mode=Pc;case Pc:for(;E=t.distcode[c&(1<<t.distbits)-1],A=E>>>24,C=E>>>16&255,O=E&65535,!(A<=u);){if(o===0)break e;o--,c+=r[a++]<<u,u+=8}if((C&240)===0){for($=A,T=C,G=O;E=t.distcode[G+((c&(1<<$+T)-1)>>$)],A=E>>>24,C=E>>>16&255,O=E&65535,!($+A<=u);){if(o===0)break e;o--,c+=r[a++]<<u,u+=8}c>>>=$,u-=$,t.back+=$}if(c>>>=A,u-=A,t.back+=A,C&64){i.msg="invalid distance code",t.mode=ue;break}t.offset=O,t.extra=C&15,t.mode=Rc;case Rc:if(t.extra){for(D=t.extra;u<D;){if(o===0)break e;o--,c+=r[a++]<<u,u+=8}t.offset+=c&(1<<t.extra)-1,c>>>=t.extra,u-=t.extra,t.back+=t.extra}if(t.offset>t.dmax){i.msg="invalid distance too far back",t.mode=ue;break}t.mode=Oc;case Oc:if(l===0)break e;if(d=h-l,t.offset>d){if(d=t.offset-d,d>t.whave&&t.sane){i.msg="invalid distance too far back",t.mode=ue;break}d>t.wnext?(d-=t.wnext,g=t.wsize-d):g=t.wnext-d,d>t.length&&(d=t.length),v=t.window}else v=n,g=s-t.offset,d=t.length;d>l&&(d=l),l-=d,t.length-=d;do n[s++]=v[g++];while(--d);t.length===0&&(t.mode=Jn);break;case Dc:if(l===0)break e;n[s++]=t.length,l--,t.mode=Jn;break;case $s:if(t.wrap){for(;u<32;){if(o===0)break e;o--,c|=r[a++]<<u,u+=8}if(h-=l,i.total_out+=h,t.total+=h,t.wrap&4&&h&&(i.adler=t.check=t.flags?xe(t.check,n,h,s-h):yn(t.check,n,h,s-h)),h=l,t.wrap&4&&(t.flags?c:Fc(c))!==t.check){i.msg="incorrect data check",t.mode=ue;break}c=0,u=0}t.mode=Mc;case Mc:if(t.wrap&&t.flags){for(;u<32;){if(o===0)break e;o--,c+=r[a++]<<u,u+=8}if(t.wrap&4&&c!==(t.total&4294967295)){i.msg="incorrect length check",t.mode=ue;break}c=0,u=0}t.mode=Uc;case Uc:K=Df;break e;case ue:K=Ql;break e;case Zl:return Gl;case Jl:default:return ut}return i.next_out=s,i.avail_out=l,i.next_in=a,i.avail_in=o,t.hold=c,t.bits=u,(t.wsize||h!==i.avail_out&&t.mode<ue&&(t.mode<$s||e!==mc))&&iu(i,i.output,i.next_out,h-i.avail_out),m-=i.avail_in,h-=i.avail_out,i.total_in+=m,i.total_out+=h,t.total+=h,t.wrap&4&&h&&(i.adler=t.check=t.flags?xe(t.check,n,h,i.next_out-h):yn(t.check,n,h,i.next_out-h)),i.data_type=t.bits+(t.last?64:0)+(t.mode===Nt?128:0)+(t.mode===Zn||t.mode===As?256:0),(m===0&&h===0||e===mc)&&K===ji&&(K=Uf),K},Wf=i=>{if(Qi(i))return ut;let e=i.state;return e.window&&(e.window=null),i.state=null,ji},Qf=(i,e)=>{if(Qi(i))return ut;let t=i.state;return(t.wrap&2)===0?ut:(t.head=e,e.done=!1,ji)},Gf=(i,e)=>{let t=e.length,r,n,a;return Qi(i)||(r=i.state,r.wrap!==0&&r.mode!==La)?ut:r.mode===La&&(n=1,n=yn(n,e,t,0),n!==r.check)?Ql:(a=iu(i,e,t,t),a?(r.mode=Zl,Gl):(r.havedict=1,ji))},Zf=Xl,Jf=eu,Yf=Yl,Xf=zf,eh=tu,th=Kf,ih=Wf,rh=Qf,nh=Gf,ah="pako inflate (from Nodeca project)",Dt={inflateReset:Zf,inflateReset2:Jf,inflateResetKeep:Yf,inflateInit:Xf,inflateInit2:eh,inflate:th,inflateEnd:ih,inflateGetHeader:rh,inflateSetDictionary:nh,inflateInfo:ah};function sh(){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 oh=sh,ru=Object.prototype.toString,{Z_NO_FLUSH:ch,Z_FINISH:lh,Z_OK:_n,Z_STREAM_END:Ts,Z_NEED_DICT:Cs,Z_STREAM_ERROR:uh,Z_DATA_ERROR:Bc,Z_MEM_ERROR:dh}=Wi;function In(i){this.options=za.assign({chunkSize:1024*64,windowBits:15,to:""},i||{});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&&!(i&&i.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 zl,this.strm.avail_out=0;let t=Dt.inflateInit2(this.strm,e.windowBits);if(t!==_n)throw new Error(Ui[t]);if(this.header=new oh,Dt.inflateGetHeader(this.strm,this.header),e.dictionary&&(typeof e.dictionary=="string"?e.dictionary=bn.string2buf(e.dictionary):ru.call(e.dictionary)==="[object ArrayBuffer]"&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(t=Dt.inflateSetDictionary(this.strm,e.dictionary),t!==_n)))throw new Error(Ui[t])}In.prototype.push=function(i,e){let t=this.strm,r=this.options.chunkSize,n=this.options.dictionary,a,s,o;if(this.ended)return!1;for(e===~~e?s=e:s=e===!0?lh:ch,ru.call(i)==="[object ArrayBuffer]"?t.input=new Uint8Array(i):t.input=i,t.next_in=0,t.avail_in=t.input.length;;){for(t.avail_out===0&&(t.output=new Uint8Array(r),t.next_out=0,t.avail_out=r),a=Dt.inflate(t,s),a===Cs&&n&&(a=Dt.inflateSetDictionary(t,n),a===_n?a=Dt.inflate(t,s):a===Bc&&(a=Cs));t.avail_in>0&&a===Ts&&t.state.wrap>0&&i[t.next_in]!==0;)Dt.inflateReset(t),a=Dt.inflate(t,s);switch(a){case uh:case Bc:case Cs:case dh:return this.onEnd(a),this.ended=!0,!1}if(o=t.avail_out,t.next_out&&(t.avail_out===0||a===Ts))if(this.options.to==="string"){let l=bn.utf8border(t.output,t.next_out),c=t.next_out-l,u=bn.buf2string(t.output,l);t.next_out=c,t.avail_out=r-c,c&&t.output.set(t.output.subarray(l,l+c),0),this.onData(u)}else this.onData(t.output.length===t.next_out?t.output:t.output.subarray(0,t.next_out));if(!(a===_n&&o===0)){if(a===Ts)return a=Dt.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,!0;if(t.avail_in===0)break}}return!0};In.prototype.onData=function(i){this.chunks.push(i)};In.prototype.onEnd=function(i){i===_n&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=za.flattenChunks(this.chunks)),this.chunks=[],this.err=i,this.msg=this.strm.msg};function mo(i,e){let t=new In(e);if(t.push(i),t.err)throw t.msg||Ui[t.err];return t.result}function ph(i,e){return e=e||{},e.raw=!0,mo(i,e)}var fh=In,hh=mo,gh=ph,mh=mo,yh=Wi,vh={Inflate:fh,inflate:hh,inflateRaw:gh,ungzip:mh,constants:yh},{Deflate:bh,deflate:_h,deflateRaw:Sh,gzip:wh}=$f,{Inflate:Eh,inflate:xh,inflateRaw:Ah,ungzip:$h}=vh,Ih=bh,kh=_h,Th=Sh,Ch=wh,Nh=Eh,Lh=xh,Ph=Ah,Rh=$h,Oh=Wi,Dh={Deflate:Ih,deflate:kh,deflateRaw:Th,gzip:Ch,Inflate:Nh,inflate:Lh,inflateRaw:Ph,ungzip:Rh,constants:Oh},ae=function(i,e,t,r){var n=arguments.length,a=n<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(i,e,t,r);else for(var o=i.length-1;o>=0;o--)(s=i[o])&&(a=(n<3?s(a):n>3?s(e,t,a):s(e,t))||a);return n>3&&a&&Object.defineProperty(e,t,a),a},se=function(i,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,e)},Pa=class{constructor(e,t){this.input=e,this.output=t}};ae([p(),se("design:type",String)],Pa.prototype,"input",void 0);ae([p(),se("design:type",String)],Pa.prototype,"output",void 0);Pa=ae([$e(),se("design:paramtypes",[String,String])],Pa);var Ra=class{constructor(e,t){this.input=e,this.output=t}};ae([p(),se("design:type",String)],Ra.prototype,"input",void 0);ae([p(),se("design:type",String)],Ra.prototype,"output",void 0);Ra=ae([q(),se("design:paramtypes",[String,String])],Ra);var ri=class{constructor(e,t,r,n,a){this.name=e,this.modelId=t,this.systemPrompt=r,this.promptExamples=n,this.metaData=a}};ae([p(),se("design:type",String)],ri.prototype,"name",void 0);ae([p(),se("design:type",String)],ri.prototype,"modelId",void 0);ae([p(),se("design:type",String)],ri.prototype,"systemPrompt",void 0);ae([p(),se("design:type",Array)],ri.prototype,"promptExamples",void 0);ae([p(),se("design:type",String)],ri.prototype,"metaData",void 0);ri=ae([$e(),se("design:paramtypes",[String,String,String,Array,String])],ri);var kt=class{constructor(e,t,r,n,a,s,o,l){this.name=e,this.modelId=t,this.taskId=r,this.systemPrompt=n,this.promptExamples=a,this.metaData=s,this.createdAt=o,this.updatedAt=l}};ae([p(),se("design:type",String)],kt.prototype,"name",void 0);ae([p(),se("design:type",String)],kt.prototype,"modelId",void 0);ae([p(),se("design:type",String)],kt.prototype,"taskId",void 0);ae([p(),se("design:type",String)],kt.prototype,"systemPrompt",void 0);ae([p(),se("design:type",Array)],kt.prototype,"promptExamples",void 0);ae([p(),se("design:type",String)],kt.prototype,"metaData",void 0);ae([p(),se("design:type",String)],kt.prototype,"createdAt",void 0);ae([p(),se("design:type",String)],kt.prototype,"updatedAt",void 0);kt=ae([q(),se("design:paramtypes",[String,String,String,String,Array,String,String,String])],kt);var Bi=class{constructor(e,t,r,n,a){this.model=e,this.status=t,this.progress=r,this.downloaded=n,this.loaded=a}};ae([p(),se("design:type",String)],Bi.prototype,"model",void 0);ae([p(),se("design:type",String)],Bi.prototype,"status",void 0);ae([p(),se("design:type",Number)],Bi.prototype,"progress",void 0);ae([p(),se("design:type",Boolean)],Bi.prototype,"downloaded",void 0);ae([p(),se("design:type",Boolean)],Bi.prototype,"loaded",void 0);Bi=ae([q(),se("design:paramtypes",[String,String,Number,Boolean,Boolean])],Bi);var Mh=function(i,e,t,r,n){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?i!==e||!n:!e.has(i))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?n.call(i,t):n?n.value=t:e.set(i,t),t},_e=function(i,e,t,r){if(t==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?i!==e||!r:!e.has(i))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?r:t==="a"?r.call(i):r?r.value:e.get(i)},ve,da,Xs=class{constructor(e,t=!0){ve.set(this,void 0),da.set(this,new Map),Mh(this,ve,e,"f")}async getModels(){let e=await _e(this,ve,"f").query({query:y`
1122
1122
  query {
1123
1123
  aiGetModels {
1124
1124
  id
@@ -1264,13 +1264,13 @@ triggerMatch
1264
1264
  mutation aiEmbed($modelId: String!, $text: String!) {
1265
1265
  aiEmbed(modelId: $modelId, text: $text)
1266
1266
  }
1267
- `,variables:{modelId:e,text:t}})),n=qa.toByteArray(r);return JSON.parse(Dh.inflate(n,{to:"string"}))}async openTranscriptionStream(e,t,r){let{aiOpenTranscriptionStream:n}=b(await _e(this,ve,"f").mutate({mutation:y`
1268
- mutation AiOpenTranscriptionStream($modelId: String!, $params: VoiceActivityParamsInput) {
1269
- aiOpenTranscriptionStream(modelId: $modelId, params: $params)
1267
+ `,variables:{modelId:e,text:t}})),n=qa.toByteArray(r);return JSON.parse(Dh.inflate(n,{to:"string"}))}async openTranscriptionStream(e,t,r,n){let{aiOpenTranscriptionStream:a}=b(await _e(this,ve,"f").mutate({mutation:y`
1268
+ mutation AiOpenTranscriptionStream($modelId: String!, $params: VoiceActivityParamsInput, $language: String) {
1269
+ aiOpenTranscriptionStream(modelId: $modelId, params: $params, language: $language)
1270
1270
  }
1271
- `,variables:{modelId:e,params:r}})),a=_e(this,ve,"f").subscribe({query:y` subscription {
1272
- aiTranscriptionText(streamId: "${n}")
1273
- }`}).subscribe({next(s){return t(s.data.aiTranscriptionText),s.data.aiTranscriptionText},error(s){console.error(s)}});return _e(this,da,"f").set(n,a),n}async closeTranscriptionStream(e){let{aiCloseTranscriptionStream:t}=b(await _e(this,ve,"f").mutate({mutation:y`
1271
+ `,variables:{modelId:e,params:r,language:n}})),s=_e(this,ve,"f").subscribe({query:y` subscription {
1272
+ aiTranscriptionText(streamId: "${a}")
1273
+ }`}).subscribe({next(o){return t(o.data.aiTranscriptionText),o.data.aiTranscriptionText},error(o){console.error(o)}});return _e(this,da,"f").set(a,s),a}async closeTranscriptionStream(e){let{aiCloseTranscriptionStream:t}=b(await _e(this,ve,"f").mutate({mutation:y`
1274
1274
  mutation aiCloseTranscriptionStream($streamId: String!) {
1275
1275
  aiCloseTranscriptionStream(streamId: $streamId)
1276
1276
  }
@@ -1278,26 +1278,27 @@ triggerMatch
1278
1278
  mutation AiFeedTranscriptionStream($streamIds: [String!]!, $audio: [Float!]!) {
1279
1279
  aiFeedTranscriptionStream(streamIds: $streamIds, audio: $audio)
1280
1280
  }
1281
- `,variables:{streamIds:Array.isArray(e)?e:[e],audio:t}}));return r}};ve=new WeakMap,da=new WeakMap;var Vt=function(i,e,t,r,n){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?i!==e||!n:!e.has(i))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?n.call(i,t):n?n.value=t:e.set(i,t),t},ye=function(i,e,t,r){if(t==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?i!==e||!r:!e.has(i))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?r:t==="a"?r.call(i):r?r.value:e.get(i)},_t,pa,tn,fa,rn,xi,ha,nn,qc=class{constructor(e,t=!0){_t.set(this,void 0),pa.set(this,void 0),tn.set(this,void 0),fa.set(this,void 0),rn.set(this,void 0),xi.set(this,void 0),ha.set(this,void 0),nn.set(this,void 0),Vt(this,_t,e,"f"),Vt(this,pa,new pn(ye(this,_t,"f"),t),"f"),Vt(this,tn,new Vs(ye(this,_t,"f")),"f"),Vt(this,fa,new js(ye(this,_t,"f")),"f"),Vt(this,rn,new Bs(ye(this,_t,"f")),"f"),Vt(this,nn,new Xs(ye(this,_t,"f"),t),"f"),Vt(this,xi,new Ta(ye(this,_t,"f"),t),"f"),ye(this,xi,"f").setExpressionClient(ye(this,tn,"f")),ye(this,xi,"f").setNeighbourhoodClient(ye(this,rn,"f")),ye(this,xi,"f").setAIClient(ye(this,nn,"f")),Vt(this,ha,new qs(ye(this,_t,"f"),t),"f")}get agent(){return ye(this,pa,"f")}get expression(){return ye(this,tn,"f")}get languages(){return ye(this,fa,"f")}get neighbourhood(){return ye(this,rn,"f")}get perspective(){return ye(this,xi,"f")}get runtime(){return ye(this,ha,"f")}get ai(){return ye(this,nn,"f")}};_t=new WeakMap,pa=new WeakMap,tn=new WeakMap,fa=new WeakMap,rn=new WeakMap,xi=new WeakMap,ha=new WeakMap,nn=new WeakMap;var eo;(function(i){i.LanguageIsNotLoaded="LANGUAGE_IS_NOT_LOADED",i.ExpressionIsNotVerified="EXPRESSION_IS_NOT_VERIFIED",i.AgentIsUntrusted="AGENT_IS_UNTRUSTED",i.CapabilityRequested="CAPABILITY_REQUESTED",i.InstallNotificationRequest="INSTALL_NOTIFICATION_REQUEST"})(eo||(eo={}));var yo=function(i,e,t,r){var n=arguments.length,a=n<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(i,e,t,r);else for(var o=i.length-1;o>=0;o--)(s=i[o])&&(a=(n<3?s(a):n>3?s(e,t,a):s(e,t))||a);return n>3&&a&&Object.defineProperty(e,t,a),a},vo=function(i,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,e)},Ci=class{constructor(e,t){this.language=e,this.expression=t}};yo([p(),vo("design:type",Et)],Ci.prototype,"language",void 0);yo([p(),vo("design:type",String)],Ci.prototype,"expression",void 0);Ci=yo([q(),vo("design:paramtypes",[Et,String])],Ci);function wy(i){return i.language.address==="did"?i.expression.toString():`${i.language.address}://${i.expression}`}function Ey(i){if(i.startsWith("literal://")){let a=new Et;a.address="literal",a.name="literal";let s=i.substring(10);return new Ci(a,s)}let t=/^([^:^\s]+):\/\/([\s\S]+)$/.exec(i);if(t&&t.length==3){let a=t[1],s=t[2],o=new Et;return o.address=a,new Ci(o,s)}let n=/^did:([^\s]+)$/.exec(i);if(n&&n.length==2){let a=new Et;return a.address="did",new Ci(a,i)}throw new Error("Couldn't parse string as expression URL or DID: "+i)}var nt=function(i,e,t,r){var n=arguments.length,a=n<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(i,e,t,r);else for(var o=i.length-1;o>=0;o--)(s=i[o])&&(a=(n<3?s(a):n>3?s(e,t,a):s(e,t))||a);return n>3&&a&&Object.defineProperty(e,t,a),a},Tt=function(i,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,e)},Oa=class{};nt([p(),Tt("design:type",String)],Oa.prototype,"name",void 0);nt([p(),Tt("design:type",String)],Oa.prototype,"type",void 0);Oa=nt([q()],Oa);var Sn=class{};nt([p(),Tt("design:type",String)],Sn.prototype,"label",void 0);nt([p(),Tt("design:type",String)],Sn.prototype,"name",void 0);nt([p(),Tt("design:type",Array)],Sn.prototype,"parameters",void 0);Sn=nt([q()],Sn);var Da=class{get parameters(){return JSON.parse(this.parametersStringified)}constructor(e,t){this.name=e,this.parametersStringified=JSON.stringify(t)}};nt([p(),Tt("design:type",String)],Da.prototype,"name",void 0);nt([p(),Tt("design:type",String)],Da.prototype,"parametersStringified",void 0);Da=nt([$e(),Tt("design:paramtypes",[String,Object])],Da);var Ma=class{};nt([p(),Tt("design:type",String)],Ma.prototype,"did",void 0);nt([p(),Tt("design:type",Di)],Ma.prototype,"status",void 0);Ma=nt([q()],Ma);var Vc=class{},Wi=function(i,e,t,r){var n=arguments.length,a=n<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(i,e,t,r);else for(var o=i.length-1;o>=0;o--)(s=i[o])&&(a=(n<3?s(a):n>3?s(e,t,a):s(e,t))||a);return n>3&&a&&Object.defineProperty(e,t,a),a},Cr=function(i,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,e)},ni=class{};Wi([p(),Cr("design:type",String)],ni.prototype,"name",void 0);Wi([p(),Cr("design:type",String)],ni.prototype,"address",void 0);Wi([p(),Cr("design:type",String)],ni.prototype,"settings",void 0);Wi([p(),Cr("design:type",Pi)],ni.prototype,"icon",void 0);Wi([p(),Cr("design:type",Pi)],ni.prototype,"constructorIcon",void 0);Wi([p(),Cr("design:type",Pi)],ni.prototype,"settingsIcon",void 0);ni=Wi([q()],ni);var He=function(i,e,t,r){var n=arguments.length,a=n<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(i,e,t,r);else for(var o=i.length-1;o>=0;o--)(s=i[o])&&(a=(n<3?s(a):n>3?s(e,t,a):s(e,t))||a);return n>3&&a&&Object.defineProperty(e,t,a),a},Ze=function(i,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,e)},ht=class{};He([p(),Ze("design:type",String)],ht.prototype,"name",void 0);He([p(),Ze("design:type",String)],ht.prototype,"address",void 0);He([p(),Ze("design:type",String)],ht.prototype,"description",void 0);He([p(),Ze("design:type",String)],ht.prototype,"author",void 0);He([p(),Ze("design:type",Boolean)],ht.prototype,"templated",void 0);He([p(),Ze("design:type",String)],ht.prototype,"templateSourceLanguageAddress",void 0);He([p(),Ze("design:type",String)],ht.prototype,"templateAppliedParams",void 0);He([p(),Ze("design:type",Array)],ht.prototype,"possibleTemplateParams",void 0);He([p(),Ze("design:type",String)],ht.prototype,"sourceCodeLink",void 0);ht=He([q()],ht);var Sr=class{constructor(e,t){this.name=e,this.description=t,this.description||(this.description="")}};He([p(),Ze("design:type",String)],Sr.prototype,"name",void 0);He([p(),Ze("design:type",String)],Sr.prototype,"description",void 0);He([p(),Ze("design:type",Array)],Sr.prototype,"possibleTemplateParams",void 0);He([p(),Ze("design:type",String)],Sr.prototype,"sourceCodeLink",void 0);Sr=He([$e(),Ze("design:paramtypes",[String,String])],Sr);var zc=class{},Hc=class extends oi(){},Gc=class{},Ga=function(i,e,t,r){var n=arguments.length,a=n<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(i,e,t,r);else for(var o=i.length-1;o>=0;o--)(s=i[o])&&(a=(n<3?s(a):n>3?s(e,t,a):s(e,t))||a);return n>3&&a&&Object.defineProperty(e,t,a),a},bo=function(i,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,e)},Ua=class{constructor(e,t){this.linkLanguage=e,this.meta=t}};Ga([p(),bo("design:type",String)],Ua.prototype,"linkLanguage",void 0);Ga([p(),bo("design:type",$t)],Ua.prototype,"meta",void 0);Ua=Ga([q(),bo("design:paramtypes",[String,$t])],Ua);var to=class extends oi(){};to=Ga([q()],to);var Zi=function(i,e,t,r){var n=arguments.length,a=n<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(i,e,t,r);else for(var o=i.length-1;o>=0;o--)(s=i[o])&&(a=(n<3?s(a):n>3?s(e,t,a):s(e,t))||a);return n>3&&a&&Object.defineProperty(e,t,a),a},Ji=function(i,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,e)},io;(function(i){i.Private="PRIVATE",i.NeighboudhoodCreationInitiated="NEIGHBOURHOOD_CREATION_INITIATED",i.NeighbourhoodJoinInitiated="NEIGHBOURHOOD_JOIN_INITIATED",i.LinkLanguageFailedToInstall="LINK_LANGUAGE_FAILED_TO_INSTALL",i.LinkLanguageInstalledButNotSynced="LINK_LANGUAGE_INSTALLED_BUT_NOT_SYNCED",i.Synced="SYNCED"})(io||(io={}));var ai=class{constructor(e,t,r){this.uuid=e,this.name=t,r?this.state=r:this.state=io.Private}};Zi([p(),Ji("design:type",String)],ai.prototype,"uuid",void 0);Zi([p(),Ji("design:type",String)],ai.prototype,"name",void 0);Zi([p(),Ji("design:type",String)],ai.prototype,"state",void 0);Zi([p(),Ji("design:type",String)],ai.prototype,"sharedUrl",void 0);Zi([p(),Ji("design:type",to)],ai.prototype,"neighbourhood",void 0);Zi([p(),Ji("design:type",Array)],ai.prototype,"owners",void 0);ai=Zi([q(),Ji("design:paramtypes",[String,String,String])],ai);var Ka=function(i,e,t,r){var n=arguments.length,a=n<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(i,e,t,r);else for(var o=i.length-1;o>=0;o--)(s=i[o])&&(a=(n<3?s(a):n>3?s(e,t,a):s(e,t))||a);return n>3&&a&&Object.defineProperty(e,t,a),a},nu=function(i,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,e)},Fa=class{};Ka([p(),nu("design:type",Array)],Fa.prototype,"additions",void 0);Ka([p(),nu("design:type",Array)],Fa.prototype,"removals",void 0);Fa=Ka([q()],Fa);var Kc=class extends oi(){};Kc=Ka([q()],Kc);var Qc=function(i,e,t,r,n){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?i!==e||!n:!e.has(i))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?n.call(i,t):n?n.value=t:e.set(i,t),t},lr=function(i,e,t,r){if(t==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?i!==e||!r:!e.has(i))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?r:t==="a"?r.call(i):r?r.value:e.get(i)},an,Ai,Yn="smart_literal://content";function Uh(i){let e="",t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",r=t.length;for(let n=0;n<i;n++)e+=t.charAt(Math.floor(Math.random()*r));return e}var wn=class{constructor(e,t){an.set(this,void 0),Ai.set(this,void 0),Qc(this,an,e,"f"),Qc(this,Ai,t,"f")}get base(){return lr(this,Ai,"f")}static async create(e,t){let r=Le.from(Uh(10)).toUrl(),n=new wn(e,r);return await n.set(t),n}static async isSmartLiteralBase(e,t){return(await e.get(new Ne({source:t,predicate:Yn}))).length>0}static async getAllSmartLiterals(e){return(await e.get(new Ne({predicate:Yn}))).map(r=>new wn(e,r.data.source))}async get(){let e=await lr(this,an,"f").getSingleTarget(new Ne({source:lr(this,Ai,"f"),predicate:Yn}));if(!e)throw`No content for smart literal ${lr(this,Ai,"f")}`;return Le.fromUrl(e).get()}async set(e){let t=Le.from(e);await lr(this,an,"f").setSingleTarget(new Oi({source:lr(this,Ai,"f"),predicate:Yn,target:t.toUrl()}))}};an=new WeakMap,Ai=new WeakMap;var Wc=class{};function Dy(i,e,t){return{action:"addLink",source:i,predicate:e,target:t}}function My(i){return`triple(this, "${i}", _)`}function Uy(i){return function(e,t,r){if(typeof r.value!="function")throw new Error("InstanceQuery decorator can only be applied to methods");r.value=async function(a){let s=[],o=e.name,c=`subject_class("${o}", C), instance(C, Instance)`;if(i&&i.where)for(let u in i.where){let m=i.where[u];c+=`, property_getter(C, Instance, "${u}", "${m}")`}i&&i.condition&&(c+=", "+i.condition);try{let u=await a.infer(c);if(u&&u!==!1&&typeof u!="string"&&u.length>0){for(let m of u){let h=m.Instance,d=new hr(a,h,o);await d.init(),s.push(d)}return s}}catch{}let l=await a.getAllSubjectInstances(o);if(i&&i.where){let u=[];for(let m of l){let h=!0;for(let d in i.where){let g=i.where[d];if(await m[d]!==g){h=!1;break}}h&&u.push(m)}return u}return l}}}function au(i){return function(e,t){if(typeof i.writable>"u"&&i.through&&(i.writable=!0),i.required&&!i.initial)throw new Error("SubjectProperty requires an 'initial' option if 'required' is true");if(!i.through&&!i.getter)throw new Error("SubjectProperty requires either 'through' or 'getter' option");if(e.__properties=e.__properties||{},e.__properties[t]=e.__properties[t]||{},e.__properties[t]={...e.__properties[t],...i},i.writable){let r=t;e[`set${Zt(r)}`]=()=>{}}Object.defineProperty(e,t,{configurable:!0,writable:!0})}}function Fy(i){return function(e,t){if(!i.through&&!i.value)throw new Error("SubjectFlag requires a 'through' and 'value' option");if(!i.through)throw new Error("SubjectFlag requires a 'through' option");if(!i.value)throw new Error("SubjectFlag requires a 'value' option");e.__properties=e.__properties||{},e.__properties[t]=e.__properties[t]||{},e.__properties[t]={...e.__properties[t],through:i.through,required:!0,initial:i.value,flag:!0},e[t]=i.value,Object.defineProperty(e,t,{configurable:!0,writable:!0})}}function jy(i){return function(e,t){e.__collections=e.__collections||{},e.__collections[t]=i;let r=t;e[`add${Zt(r)}`]=()=>{},e[`remove${Zt(r)}`]=()=>{},e[`setCollection${Zt(r)}`]=()=>{},Object.defineProperty(e,t,{configurable:!0,writable:!0})}}function su(i){let e="",t="abcdefghijklmnopqrstuvwxyz",r=t.length;for(let n=0;n<i;n++)e+=t.charAt(Math.floor(Math.random()*r));return e}function Fh(i){return function(e){e.prototype.className=i.name,e.className=i.name,e.generateSDNA=function(){let t="",r=i.name,n=e.prototype,a=su(8);t+=`subject_class("${r}", ${a}).
1282
- `;let s=[],o=[];n.subjectConstructor&&n.subjectConstructor.length&&(o=o.concat(n.subjectConstructor));let c=[];n.isSubjectInstance&&n.isSubjectInstance.length&&(c=c.concat(n.isSubjectInstance));let l=[],u=n.__properties||{};for(let g in u){let v=`property(${a}, "${g}").
1283
- `,{through:E,initial:$,required:N,resolveLanguage:O,writable:A,flag:k,getter:Z,setter:I,local:K}=u[g];if(O&&(v+=`property_resolve(${a}, "${g}").
1281
+ `,variables:{streamIds:Array.isArray(e)?e:[e],audio:t}}));return r}};ve=new WeakMap,da=new WeakMap;var Vt=function(i,e,t,r,n){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?i!==e||!n:!e.has(i))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?n.call(i,t):n?n.value=t:e.set(i,t),t},ye=function(i,e,t,r){if(t==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?i!==e||!r:!e.has(i))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?r:t==="a"?r.call(i):r?r.value:e.get(i)},_t,pa,tn,fa,rn,xi,ha,nn,qc=class{constructor(e,t=!0){_t.set(this,void 0),pa.set(this,void 0),tn.set(this,void 0),fa.set(this,void 0),rn.set(this,void 0),xi.set(this,void 0),ha.set(this,void 0),nn.set(this,void 0),Vt(this,_t,e,"f"),Vt(this,pa,new pn(ye(this,_t,"f"),t),"f"),Vt(this,tn,new Vs(ye(this,_t,"f")),"f"),Vt(this,fa,new js(ye(this,_t,"f")),"f"),Vt(this,rn,new Bs(ye(this,_t,"f")),"f"),Vt(this,nn,new Xs(ye(this,_t,"f"),t),"f"),Vt(this,xi,new Ta(ye(this,_t,"f"),t),"f"),ye(this,xi,"f").setExpressionClient(ye(this,tn,"f")),ye(this,xi,"f").setNeighbourhoodClient(ye(this,rn,"f")),ye(this,xi,"f").setAIClient(ye(this,nn,"f")),Vt(this,ha,new qs(ye(this,_t,"f"),t),"f")}get agent(){return ye(this,pa,"f")}get expression(){return ye(this,tn,"f")}get languages(){return ye(this,fa,"f")}get neighbourhood(){return ye(this,rn,"f")}get perspective(){return ye(this,xi,"f")}get runtime(){return ye(this,ha,"f")}get ai(){return ye(this,nn,"f")}};_t=new WeakMap,pa=new WeakMap,tn=new WeakMap,fa=new WeakMap,rn=new WeakMap,xi=new WeakMap,ha=new WeakMap,nn=new WeakMap;var eo;(function(i){i.LanguageIsNotLoaded="LANGUAGE_IS_NOT_LOADED",i.ExpressionIsNotVerified="EXPRESSION_IS_NOT_VERIFIED",i.AgentIsUntrusted="AGENT_IS_UNTRUSTED",i.CapabilityRequested="CAPABILITY_REQUESTED",i.InstallNotificationRequest="INSTALL_NOTIFICATION_REQUEST"})(eo||(eo={}));var yo=function(i,e,t,r){var n=arguments.length,a=n<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(i,e,t,r);else for(var o=i.length-1;o>=0;o--)(s=i[o])&&(a=(n<3?s(a):n>3?s(e,t,a):s(e,t))||a);return n>3&&a&&Object.defineProperty(e,t,a),a},vo=function(i,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,e)},Ci=class{constructor(e,t){this.language=e,this.expression=t}};yo([p(),vo("design:type",Et)],Ci.prototype,"language",void 0);yo([p(),vo("design:type",String)],Ci.prototype,"expression",void 0);Ci=yo([q(),vo("design:paramtypes",[Et,String])],Ci);function wy(i){return i.language.address==="did"?i.expression.toString():`${i.language.address}://${i.expression}`}function Ey(i){if(i.startsWith("literal://")){let a=new Et;a.address="literal",a.name="literal";let s=i.substring(10);return new Ci(a,s)}let t=/^([^:^\s]+):\/\/([\s\S]+)$/.exec(i);if(t&&t.length==3){let a=t[1],s=t[2],o=new Et;return o.address=a,new Ci(o,s)}let n=/^did:([^\s]+)$/.exec(i);if(n&&n.length==2){let a=new Et;return a.address="did",new Ci(a,i)}throw new Error("Couldn't parse string as expression URL or DID: "+i)}var nt=function(i,e,t,r){var n=arguments.length,a=n<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(i,e,t,r);else for(var o=i.length-1;o>=0;o--)(s=i[o])&&(a=(n<3?s(a):n>3?s(e,t,a):s(e,t))||a);return n>3&&a&&Object.defineProperty(e,t,a),a},Tt=function(i,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,e)},Oa=class{};nt([p(),Tt("design:type",String)],Oa.prototype,"name",void 0);nt([p(),Tt("design:type",String)],Oa.prototype,"type",void 0);Oa=nt([q()],Oa);var Sn=class{};nt([p(),Tt("design:type",String)],Sn.prototype,"label",void 0);nt([p(),Tt("design:type",String)],Sn.prototype,"name",void 0);nt([p(),Tt("design:type",Array)],Sn.prototype,"parameters",void 0);Sn=nt([q()],Sn);var Da=class{get parameters(){return JSON.parse(this.parametersStringified)}constructor(e,t){this.name=e,this.parametersStringified=JSON.stringify(t)}};nt([p(),Tt("design:type",String)],Da.prototype,"name",void 0);nt([p(),Tt("design:type",String)],Da.prototype,"parametersStringified",void 0);Da=nt([$e(),Tt("design:paramtypes",[String,Object])],Da);var Ma=class{};nt([p(),Tt("design:type",String)],Ma.prototype,"did",void 0);nt([p(),Tt("design:type",Di)],Ma.prototype,"status",void 0);Ma=nt([q()],Ma);var Vc=class{},Gi=function(i,e,t,r){var n=arguments.length,a=n<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(i,e,t,r);else for(var o=i.length-1;o>=0;o--)(s=i[o])&&(a=(n<3?s(a):n>3?s(e,t,a):s(e,t))||a);return n>3&&a&&Object.defineProperty(e,t,a),a},Cr=function(i,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,e)},ni=class{};Gi([p(),Cr("design:type",String)],ni.prototype,"name",void 0);Gi([p(),Cr("design:type",String)],ni.prototype,"address",void 0);Gi([p(),Cr("design:type",String)],ni.prototype,"settings",void 0);Gi([p(),Cr("design:type",Pi)],ni.prototype,"icon",void 0);Gi([p(),Cr("design:type",Pi)],ni.prototype,"constructorIcon",void 0);Gi([p(),Cr("design:type",Pi)],ni.prototype,"settingsIcon",void 0);ni=Gi([q()],ni);var He=function(i,e,t,r){var n=arguments.length,a=n<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(i,e,t,r);else for(var o=i.length-1;o>=0;o--)(s=i[o])&&(a=(n<3?s(a):n>3?s(e,t,a):s(e,t))||a);return n>3&&a&&Object.defineProperty(e,t,a),a},Ze=function(i,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,e)},ht=class{};He([p(),Ze("design:type",String)],ht.prototype,"name",void 0);He([p(),Ze("design:type",String)],ht.prototype,"address",void 0);He([p(),Ze("design:type",String)],ht.prototype,"description",void 0);He([p(),Ze("design:type",String)],ht.prototype,"author",void 0);He([p(),Ze("design:type",Boolean)],ht.prototype,"templated",void 0);He([p(),Ze("design:type",String)],ht.prototype,"templateSourceLanguageAddress",void 0);He([p(),Ze("design:type",String)],ht.prototype,"templateAppliedParams",void 0);He([p(),Ze("design:type",Array)],ht.prototype,"possibleTemplateParams",void 0);He([p(),Ze("design:type",String)],ht.prototype,"sourceCodeLink",void 0);ht=He([q()],ht);var Sr=class{constructor(e,t){this.name=e,this.description=t,this.description||(this.description="")}};He([p(),Ze("design:type",String)],Sr.prototype,"name",void 0);He([p(),Ze("design:type",String)],Sr.prototype,"description",void 0);He([p(),Ze("design:type",Array)],Sr.prototype,"possibleTemplateParams",void 0);He([p(),Ze("design:type",String)],Sr.prototype,"sourceCodeLink",void 0);Sr=He([$e(),Ze("design:paramtypes",[String,String])],Sr);var zc=class{},Hc=class extends oi(){},Kc=class{},Ka=function(i,e,t,r){var n=arguments.length,a=n<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(i,e,t,r);else for(var o=i.length-1;o>=0;o--)(s=i[o])&&(a=(n<3?s(a):n>3?s(e,t,a):s(e,t))||a);return n>3&&a&&Object.defineProperty(e,t,a),a},bo=function(i,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,e)},Ua=class{constructor(e,t){this.linkLanguage=e,this.meta=t}};Ka([p(),bo("design:type",String)],Ua.prototype,"linkLanguage",void 0);Ka([p(),bo("design:type",$t)],Ua.prototype,"meta",void 0);Ua=Ka([q(),bo("design:paramtypes",[String,$t])],Ua);var to=class extends oi(){};to=Ka([q()],to);var Zi=function(i,e,t,r){var n=arguments.length,a=n<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(i,e,t,r);else for(var o=i.length-1;o>=0;o--)(s=i[o])&&(a=(n<3?s(a):n>3?s(e,t,a):s(e,t))||a);return n>3&&a&&Object.defineProperty(e,t,a),a},Ji=function(i,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,e)},io;(function(i){i.Private="PRIVATE",i.NeighboudhoodCreationInitiated="NEIGHBOURHOOD_CREATION_INITIATED",i.NeighbourhoodJoinInitiated="NEIGHBOURHOOD_JOIN_INITIATED",i.LinkLanguageFailedToInstall="LINK_LANGUAGE_FAILED_TO_INSTALL",i.LinkLanguageInstalledButNotSynced="LINK_LANGUAGE_INSTALLED_BUT_NOT_SYNCED",i.Synced="SYNCED"})(io||(io={}));var ai=class{constructor(e,t,r){this.uuid=e,this.name=t,r?this.state=r:this.state=io.Private}};Zi([p(),Ji("design:type",String)],ai.prototype,"uuid",void 0);Zi([p(),Ji("design:type",String)],ai.prototype,"name",void 0);Zi([p(),Ji("design:type",String)],ai.prototype,"state",void 0);Zi([p(),Ji("design:type",String)],ai.prototype,"sharedUrl",void 0);Zi([p(),Ji("design:type",to)],ai.prototype,"neighbourhood",void 0);Zi([p(),Ji("design:type",Array)],ai.prototype,"owners",void 0);ai=Zi([q(),Ji("design:paramtypes",[String,String,String])],ai);var Wa=function(i,e,t,r){var n=arguments.length,a=n<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(i,e,t,r);else for(var o=i.length-1;o>=0;o--)(s=i[o])&&(a=(n<3?s(a):n>3?s(e,t,a):s(e,t))||a);return n>3&&a&&Object.defineProperty(e,t,a),a},nu=function(i,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,e)},Fa=class{};Wa([p(),nu("design:type",Array)],Fa.prototype,"additions",void 0);Wa([p(),nu("design:type",Array)],Fa.prototype,"removals",void 0);Fa=Wa([q()],Fa);var Wc=class extends oi(){};Wc=Wa([q()],Wc);var Qc=function(i,e,t,r,n){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?i!==e||!n:!e.has(i))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?n.call(i,t):n?n.value=t:e.set(i,t),t},lr=function(i,e,t,r){if(t==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?i!==e||!r:!e.has(i))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?r:t==="a"?r.call(i):r?r.value:e.get(i)},an,Ai,Yn="smart_literal://content";function Uh(i){let e="",t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",r=t.length;for(let n=0;n<i;n++)e+=t.charAt(Math.floor(Math.random()*r));return e}var wn=class{constructor(e,t){an.set(this,void 0),Ai.set(this,void 0),Qc(this,an,e,"f"),Qc(this,Ai,t,"f")}get base(){return lr(this,Ai,"f")}static async create(e,t){let r=Le.from(Uh(10)).toUrl(),n=new wn(e,r);return await n.set(t),n}static async isSmartLiteralBase(e,t){return(await e.get(new Ne({source:t,predicate:Yn}))).length>0}static async getAllSmartLiterals(e){return(await e.get(new Ne({predicate:Yn}))).map(r=>new wn(e,r.data.source))}async get(){let e=await lr(this,an,"f").getSingleTarget(new Ne({source:lr(this,Ai,"f"),predicate:Yn}));if(!e)throw`No content for smart literal ${lr(this,Ai,"f")}`;return Le.fromUrl(e).get()}async set(e){let t=Le.from(e);await lr(this,an,"f").setSingleTarget(new Oi({source:lr(this,Ai,"f"),predicate:Yn,target:t.toUrl()}))}};an=new WeakMap,Ai=new WeakMap;var Gc=class{};function Dy(i,e,t){return{action:"addLink",source:i,predicate:e,target:t}}function My(i){return`triple(this, "${i}", _)`}function Uy(i){return function(e,t,r){if(typeof r.value!="function")throw new Error("InstanceQuery decorator can only be applied to methods");r.value=async function(a){let s=[],o=e.name,l=`subject_class("${o}", C), instance(C, Instance)`;if(i&&i.where)for(let u in i.where){let m=i.where[u];l+=`, property_getter(C, Instance, "${u}", "${m}")`}i&&i.prologCondition&&(l+=", "+i.prologCondition);try{let u=await a.infer(l);if(u&&u!==!1&&typeof u!="string"&&u.length>0){for(let m of u){let h=m.Instance,d=new hr(a,h,o);await d.init(),s.push(d)}return s}}catch{}let c=await a.getAllSubjectInstances(o);if(i&&i.where){let u=[];for(let m of c){let h=!0;for(let d in i.where){let g=i.where[d];if(await m[d]!==g){h=!1;break}}h&&u.push(m)}return u}return c}}}function au(i){return function(e,t){if(typeof i.writable>"u"&&i.through&&(i.writable=!0),i.required&&!i.initial)throw new Error("SubjectProperty requires an 'initial' option if 'required' is true");if(!i.through&&!i.prologGetter)throw new Error("SubjectProperty requires either 'through' or 'prologGetter' option");if(e.__properties=e.__properties||{},e.__properties[t]=e.__properties[t]||{},e.__properties[t]={...e.__properties[t],...i},i.writable){let r=t;e[`set${Zt(r)}`]=()=>{}}Object.defineProperty(e,t,{configurable:!0,writable:!0})}}function Fy(i){return function(e,t){if(!i.through&&!i.value)throw new Error("SubjectFlag requires a 'through' and 'value' option");if(!i.through)throw new Error("SubjectFlag requires a 'through' option");if(!i.value)throw new Error("SubjectFlag requires a 'value' option");e.__properties=e.__properties||{},e.__properties[t]=e.__properties[t]||{},e.__properties[t]={...e.__properties[t],through:i.through,required:!0,initial:i.value,flag:!0},e[t]=i.value,Object.defineProperty(e,t,{configurable:!0,writable:!0})}}function jy(i){return function(e,t){e.__collections=e.__collections||{},e.__collections[t]=i;let r=t;e[`add${Zt(r)}`]=()=>{},e[`remove${Zt(r)}`]=()=>{},e[`setCollection${Zt(r)}`]=()=>{},Object.defineProperty(e,t,{configurable:!0,writable:!0})}}function su(i){let e="",t="abcdefghijklmnopqrstuvwxyz",r=t.length;for(let n=0;n<i;n++)e+=t.charAt(Math.floor(Math.random()*r));return e}function Fh(i){return function(e){e.prototype.className=i.name,e.className=i.name,e.generateSDNA=function(){let t="",r=i.name,n=e.prototype,a=su(8);t+=`subject_class("${r}", ${a}).
1282
+ `;let s=[],o=[];n.subjectConstructor&&n.subjectConstructor.length&&(o=o.concat(n.subjectConstructor));let l=[];n.isSubjectInstance&&n.isSubjectInstance.length&&(l=l.concat(n.isSubjectInstance));let c=[],u=n.__properties||{};for(let g in u){let v=`property(${a}, "${g}").
1283
+ `,{through:E,initial:A,required:C,resolveLanguage:O,writable:$,flag:T,prologGetter:G,prologSetter:I,local:K}=u[g];if(O&&(v+=`property_resolve(${a}, "${g}").
1284
1284
  `,v+=`property_resolve_language(${a}, "${g}", "${O}").
1285
- `),Z?v+=`property_getter(${a}, Base, "${g}", Value) :- ${Z}.
1285
+ `),G?v+=`property_getter(${a}, Base, "${g}", Value) :- ${G}.
1286
1286
  `:E&&(v+=`property_getter(${a}, Base, "${g}", Value) :- triple(Base, "${E}", Value).
1287
- `,N&&(k?c.push(`triple(Base, "${E}", "${$}")`):c.push(`triple(Base, "${E}", _)`))),I)v+=`property_setter(${a}, "${g}", Actions) :- ${I}.
1288
- `;else if(A&&E&&typeof n[oo(g)]=="function"){let T=[{action:"setSingleTarget",source:"this",predicate:E,target:"value",...K&&{local:!0}}];v+=`property_setter(${a}, "${g}", '${yi(T)}').
1289
- `}l.push(v),$&&(o.push({action:"addLink",source:"this",predicate:E,target:$}),s.push({action:"removeLink",source:"this",predicate:E,target:"*"}))}let m=[],h=n.__collections||{};for(let g in h){let v=`collection(${a}, "${g}").
1290
- `,{through:E,where:$,local:N}=h[g];if(E){if($){if(!$.isInstance&&!$.condition)throw"'where' needs one of 'isInstance' or 'condition'";let Z=[];if($.isInstance){let K;$.isInstance.name?K=$.isInstance.name:K=$.isInstance,Z.push(`instance(OtherClass, Target), subject_class("${K}", OtherClass)`)}$.condition&&Z.push($.condition);let I=Z.join(", ");v+=`collection_getter(${a}, Base, "${g}", List) :- setof(Target, (triple(Base, "${E}", Target), ${I}), List).
1287
+ `,C&&(T?l.push(`triple(Base, "${E}", "${A}")`):l.push(`triple(Base, "${E}", _)`))),I)v+=`property_setter(${a}, "${g}", Actions) :- ${I}.
1288
+ `;else if($&&E&&typeof n[oo(g)]=="function"){let k=[{action:"setSingleTarget",source:"this",predicate:E,target:"value",...K&&{local:!0}}];v+=`property_setter(${a}, "${g}", '${yi(k)}').
1289
+ `}c.push(v),A&&(o.push({action:"addLink",source:"this",predicate:E,target:A}),s.push({action:"removeLink",source:"this",predicate:E,target:"*"}))}let m=[],h=n.__collections||{};for(let g in h){let v=`collection(${a}, "${g}").
1290
+ `,{through:E,where:A,local:C}=h[g];if(E){if(A){if(!A.isInstance&&!A.prologCondition&&!A.condition)throw"'where' needs one of 'isInstance', 'prologCondition', or 'condition'";let G=[];if(A.isInstance){let I;A.isInstance.name?I=A.isInstance.name:I=A.isInstance,G.push(`instance(OtherClass, Target), subject_class("${I}", OtherClass)`)}if(A.prologCondition&&G.push(A.prologCondition),G.length>0){let I=G.join(", ");v+=`collection_getter(${a}, Base, "${g}", List) :- setof(Target, (triple(Base, "${E}", Target), ${I}), List).
1291
1291
  `}else v+=`collection_getter(${a}, Base, "${g}", List) :- findall(C, triple(Base, "${E}", C), List).
1292
- `;let O=[{action:"addLink",source:"this",predicate:E,target:"value",...N&&{local:!0}}],A=[{action:"removeLink",source:"this",predicate:E,target:"value"}],k=[{action:"collectionSetter",source:"this",predicate:E,target:"value",...N&&{local:!0}}];v+=`collection_adder(${a}, "${fr(g)}", '${yi(O)}').
1293
- `,v+=`collection_remover(${a}, "${fr(g)}", '${yi(A)}').
1294
- `,v+=`collection_setter(${a}, "${fr(g)}", '${yi(k)}').
1292
+ `}else v+=`collection_getter(${a}, Base, "${g}", List) :- findall(C, triple(Base, "${E}", C), List).
1293
+ `;let O=[{action:"addLink",source:"this",predicate:E,target:"value",...C&&{local:!0}}],$=[{action:"removeLink",source:"this",predicate:E,target:"value"}],T=[{action:"collectionSetter",source:"this",predicate:E,target:"value",...C&&{local:!0}}];v+=`collection_adder(${a}, "${fr(g)}", '${yi(O)}').
1294
+ `,v+=`collection_remover(${a}, "${fr(g)}", '${yi($)}').
1295
+ `,v+=`collection_setter(${a}, "${fr(g)}", '${yi(T)}').
1295
1296
  `}m.push(v)}let d=yi(o);if(t+=`constructor(${a}, '${d}').
1296
- `,c.length>0){let g=c.join(", ");t+=`instance(${a}, Base) :- ${g}.
1297
+ `,l.length>0){let g=l.join(", ");t+=`instance(${a}, Base) :- ${g}.
1297
1298
  `,t+=`
1298
1299
  `}return t+=`destructor(${a}, '${yi(s)}').
1299
1300
  `,t+=`
1300
- `,t+=l.join(`
1301
+ `,t+=c.join(`
1301
1302
  `),t+=`
1302
1303
  `,t+=m.join(`
1303
1304
  `),{sdna:t,name:r}},Object.defineProperty(e,"type",{configurable:!0})}}function By(i){return au({...i,required:!0,writable:!0,initial:i.initial||"literal://string:uninitialized"})}function qy(i){return au({...i,writable:!1})}var Vy=`
@@ -1611,7 +1612,7 @@ type Mutation {
1611
1612
  aiCloseTranscriptionStream(streamId: String!): String!
1612
1613
  aiEmbed(modelId: String!, text: String!): String!
1613
1614
  aiFeedTranscriptionStream(audio: [Float!]!, streamIds: [String!]!): String!
1614
- aiOpenTranscriptionStream(modelId: String!, params: VoiceActivityParamsInput): String!
1615
+ aiOpenTranscriptionStream(language: String, modelId: String!, params: VoiceActivityParamsInput): String!
1615
1616
  aiPrompt(prompt: String!, taskId: String!): String!
1616
1617
  aiRemoveModel(modelId: String!): Boolean!
1617
1618
  aiRemoveTask(taskId: String!): AITask!
@@ -1886,7 +1887,7 @@ input VoiceActivityParamsInput {
1886
1887
  startWindow: Float
1887
1888
  timeBeforeSpeech: Float
1888
1889
  }
1889
- `,w=function(i,e,t,r){var n=arguments.length,a=n<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(i,e,t,r);else for(var o=i.length-1;o>=0;o--)(s=i[o])&&(a=(n<3?s(a):n>3?s(e,t,a):s(e,t))||a);return n>3&&a&&Object.defineProperty(e,t,a),a},f=function(i,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,e)},H=function(i,e){return function(t,r){e(t,r,i)}},kn=new ei;kn.author="did:ad4m:test";kn.timestamp=Date.now();kn.data={source:"root",target:"neighbourhood://Qm12345"};kn.proof={signature:"",key:"",valid:!0};var Qt=new Di;Qt.author="did:ad4m:test";Qt.timestamp=Date.now().toString();Qt.proof=new Mt("","");Qt.data=new $t([kn]);var ja=class{};w([p(),f("design:type",String)],ja.prototype,"recipient",void 0);w([p(),f("design:type",Di)],ja.prototype,"message",void 0);ja=w([q()],ja);var wr=class{};w([p(),f("design:type",String)],wr.prototype,"ad4mExecutorVersion",void 0);w([p(),f("design:type",Boolean)],wr.prototype,"isInitialized",void 0);w([p(),f("design:type",Boolean)],wr.prototype,"isUnlocked",void 0);wr=w([q()],wr);var qi=class{};w([p(),f("design:type",String)],qi.prototype,"title",void 0);w([p(),f("design:type",String)],qi.prototype,"message",void 0);w([p(),f("design:type",String)],qi.prototype,"type",void 0);w([p(),f("design:type",String)],qi.prototype,"addon",void 0);qi=w([q()],qi);var dt=class{};w([p(),f("design:type",String)],dt.prototype,"description",void 0);w([p(),f("design:type",String)],dt.prototype,"appName",void 0);w([p(),f("design:type",String)],dt.prototype,"appUrl",void 0);w([p(),f("design:type",String)],dt.prototype,"appIconPath",void 0);w([p(),f("design:type",String)],dt.prototype,"trigger",void 0);w([p(),f("design:type",Array)],dt.prototype,"perspectiveIds",void 0);w([p(),f("design:type",String)],dt.prototype,"webhookUrl",void 0);w([p(),f("design:type",String)],dt.prototype,"webhookAuth",void 0);dt=w([$e()],dt);var tt=class{};w([p(),f("design:type",String)],tt.prototype,"id",void 0);w([p(),f("design:type",Boolean)],tt.prototype,"granted",void 0);w([p(),f("design:type",String)],tt.prototype,"description",void 0);w([p(),f("design:type",String)],tt.prototype,"appName",void 0);w([p(),f("design:type",String)],tt.prototype,"appUrl",void 0);w([p(),f("design:type",String)],tt.prototype,"appIconPath",void 0);w([p(),f("design:type",String)],tt.prototype,"trigger",void 0);w([p(),f("design:type",Array)],tt.prototype,"perspectiveIds",void 0);w([p(),f("design:type",String)],tt.prototype,"webhookUrl",void 0);w([p(),f("design:type",String)],tt.prototype,"webhookAuth",void 0);tt=w([q()],tt);var Er=class{};w([p(),f("design:type",tt)],Er.prototype,"notification",void 0);w([p(),f("design:type",String)],Er.prototype,"perspectiveId",void 0);w([p(),f("design:type",String)],Er.prototype,"triggerMatch",void 0);Er=w([q()],Er);var Ae=class{};w([p(),f("design:type",Number)],Ae.prototype,"total",void 0);w([p(),f("design:type",Number)],Ae.prototype,"imported",void 0);w([p(),f("design:type",Number)],Ae.prototype,"failed",void 0);w([p(),f("design:type",Number)],Ae.prototype,"omitted",void 0);w([p(),f("design:type",Array)],Ae.prototype,"errors",void 0);Ae=w([q()],Ae);var it=class{};w([p(),f("design:type",Ae)],it.prototype,"perspectives",void 0);w([p(),f("design:type",Ae)],it.prototype,"links",void 0);w([p(),f("design:type",Ae)],it.prototype,"expressions",void 0);w([p(),f("design:type",Ae)],it.prototype,"perspectiveDiffs",void 0);w([p(),f("design:type",Ae)],it.prototype,"notifications",void 0);w([p(),f("design:type",Ae)],it.prototype,"models",void 0);w([p(),f("design:type",Ae)],it.prototype,"defaultModels",void 0);w([p(),f("design:type",Ae)],it.prototype,"tasks",void 0);w([p(),f("design:type",Ae)],it.prototype,"friends",void 0);w([p(),f("design:type",Ae)],it.prototype,"trustedAgents",void 0);w([p(),f("design:type",Ae)],it.prototype,"knownLinkLanguages",void 0);it=w([q()],it);var xr=class{};w([p(),f("design:type",String)],xr.prototype,"email",void 0);w([p(),f("design:type",String)],xr.prototype,"did",void 0);w([p(),f("design:type",String)],xr.prototype,"lastSeen",void 0);w([p(),f("design:type",Number)],xr.prototype,"perspectiveCount",void 0);xr=w([q()],xr);var Vi=class{};w([p(),f("design:type",Boolean)],Vi.prototype,"success",void 0);w([p(),f("design:type",String)],Vi.prototype,"message",void 0);w([p(),f("design:type",Boolean)],Vi.prototype,"requiresPassword",void 0);w([p(),f("design:type",Boolean)],Vi.prototype,"isExistingUser",void 0);Vi=w([q()],Vi);var M=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,t,r,n){return!0}runtimeSetStatus(e){return!0}runtimeFriendStatus(e){return Qt}runtimeFriendSendMessage(e,t){return!0}runtimeMessageInbox(e){return[Qt]}runtimeMessageOutbox(e){return[{recipient:"did:test:recipient",message:Qt}]}runtimeMessageReceived(){return Qt}exceptionOccurred(){return{title:"Test title",message:"Test message",type:eo.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,t){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,t){return!0}runtimeImportPerspective(e){return!0}runtimeMultiUserEnabled(){return!1}runtimeSetMultiUserEnabled(e){return e}runtimeListUsers(){return[{email:"test@example.com",did:"did:key:test123",lastSeen:new Date().toISOString(),perspectiveCount:5}]}runtimeRequestLoginVerification(e,t){return{success:!0,message:"Verification email sent",requiresPassword:!1,isExistingUser:!0}}runtimeVerifyEmailCode(e,t,r){return"test-jwt-token-from-email-verification"}runtimeTestEmail(e){return!0}runtimeCreateUser(e,t,r){return new Mi("did:key:test123",!0)}runtimeLoginUser(e,t){return"test-jwt-token-from-password-login"}runtimeEmailTestModeEnable(){return!0}runtimeEmailTestModeDisable(){return!0}runtimeEmailTestGetCode(e){return"123456"}runtimeEmailTestClearCodes(){return!0}runtimeEmailTestSetExpiry(e,t,r){return!0}};w([ne(),f("design:type",Function),f("design:paramtypes",[]),f("design:returntype",Boolean)],M.prototype,"runtimeQuit",null);w([ne(),H(0,z()),f("design:type",Function),f("design:paramtypes",[String]),f("design:returntype",Boolean)],M.prototype,"runtimeOpenLink",null);w([rt(),f("design:type",Function),f("design:paramtypes",[]),f("design:returntype",wr)],M.prototype,"runtimeInfo",null);w([ne(),H(0,z()),f("design:type",Function),f("design:paramtypes",[Array]),f("design:returntype",Array)],M.prototype,"addTrustedAgents",null);w([ne(),H(0,z()),f("design:type",Function),f("design:paramtypes",[Array]),f("design:returntype",Array)],M.prototype,"deleteTrustedAgents",null);w([rt(),f("design:type",Function),f("design:paramtypes",[]),f("design:returntype",Array)],M.prototype,"getTrustedAgents",null);w([rt(),f("design:type",Function),f("design:paramtypes",[]),f("design:returntype",Array)],M.prototype,"runtimeKnownLinkLanguageTemplates",null);w([ne(),H(0,z()),f("design:type",Function),f("design:paramtypes",[Array]),f("design:returntype",Array)],M.prototype,"runtimeAddKnownLinkLanguageTemplates",null);w([ne(),H(0,z()),f("design:type",Function),f("design:paramtypes",[Array]),f("design:returntype",Array)],M.prototype,"runtimeRemoveKnownLinkLanguageTemplates",null);w([rt(),f("design:type",Function),f("design:paramtypes",[]),f("design:returntype",Array)],M.prototype,"runtimeFriends",null);w([ne(),H(0,z()),f("design:type",Function),f("design:paramtypes",[Array]),f("design:returntype",Array)],M.prototype,"runtimeAddFriends",null);w([ne(),H(0,z()),f("design:type",Function),f("design:paramtypes",[Array]),f("design:returntype",Array)],M.prototype,"runtimeRemoveFriends",null);w([rt(),f("design:type",Function),f("design:paramtypes",[]),f("design:returntype",String)],M.prototype,"runtimeHcAgentInfos",null);w([rt(),f("design:type",Function),f("design:paramtypes",[]),f("design:returntype",String)],M.prototype,"runtimeGetNetworkMetrics",null);w([ne(),f("design:type",Function),f("design:paramtypes",[]),f("design:returntype",Boolean)],M.prototype,"runtimeRestartHolochain",null);w([ne(),H(0,z()),f("design:type",Function),f("design:paramtypes",[Object]),f("design:returntype",Boolean)],M.prototype,"runtimeHcAddAgentInfos",null);w([rt(),H(0,z()),H(1,z()),H(2,z()),H(3,z()),f("design:type",Function),f("design:paramtypes",[String,String,String,String]),f("design:returntype",void 0)],M.prototype,"runtimeVerifyStringSignedByDid",null);w([ne(),H(0,z()),f("design:type",Function),f("design:paramtypes",[$t]),f("design:returntype",Boolean)],M.prototype,"runtimeSetStatus",null);w([rt(),H(0,z()),f("design:type",Function),f("design:paramtypes",[String]),f("design:returntype",Di)],M.prototype,"runtimeFriendStatus",null);w([ne(),H(0,z()),H(1,z()),f("design:type",Function),f("design:paramtypes",[String,xa]),f("design:returntype",Boolean)],M.prototype,"runtimeFriendSendMessage",null);w([rt(),H(0,z()),f("design:type",Function),f("design:paramtypes",[String]),f("design:returntype",Array)],M.prototype,"runtimeMessageInbox",null);w([rt(),H(0,z()),f("design:type",Function),f("design:paramtypes",[String]),f("design:returntype",Array)],M.prototype,"runtimeMessageOutbox",null);w([no(),f("design:type",Function),f("design:paramtypes",[]),f("design:returntype",Di)],M.prototype,"runtimeMessageReceived",null);w([no(),f("design:type",Function),f("design:paramtypes",[]),f("design:returntype",qi)],M.prototype,"exceptionOccurred",null);w([ne(),H(0,z()),f("design:type",Function),f("design:paramtypes",[dt]),f("design:returntype",String)],M.prototype,"runtimeRequestInstallNotification",null);w([rt(),f("design:type",Function),f("design:paramtypes",[]),f("design:returntype",Array)],M.prototype,"runtimeNotifications",null);w([ne(),H(0,z()),H(1,z()),f("design:type",Function),f("design:paramtypes",[String,dt]),f("design:returntype",Boolean)],M.prototype,"runtimeUpdateNotification",null);w([ne(),H(0,z()),f("design:type",Function),f("design:paramtypes",[String]),f("design:returntype",Boolean)],M.prototype,"runtimeRemoveNotification",null);w([ne(),H(0,z()),f("design:type",Function),f("design:paramtypes",[String]),f("design:returntype",Boolean)],M.prototype,"runtimeGrantNotification",null);w([no(),f("design:type",Function),f("design:paramtypes",[]),f("design:returntype",Er)],M.prototype,"runtimeNotificationTriggered",null);w([ne(),H(0,z()),f("design:type",Function),f("design:paramtypes",[String]),f("design:returntype",Boolean)],M.prototype,"runtimeExportDb",null);w([ne(),H(0,z()),f("design:type",Function),f("design:paramtypes",[String]),f("design:returntype",Boolean)],M.prototype,"runtimeImportDb",null);w([ne(),H(0,z()),H(1,z()),f("design:type",Function),f("design:paramtypes",[String,String]),f("design:returntype",Boolean)],M.prototype,"runtimeExportPerspective",null);w([ne(),H(0,z()),f("design:type",Function),f("design:paramtypes",[String]),f("design:returntype",Boolean)],M.prototype,"runtimeImportPerspective",null);w([rt(),f("design:type",Function),f("design:paramtypes",[]),f("design:returntype",Boolean)],M.prototype,"runtimeMultiUserEnabled",null);w([ne(),H(0,z()),f("design:type",Function),f("design:paramtypes",[Boolean]),f("design:returntype",Boolean)],M.prototype,"runtimeSetMultiUserEnabled",null);w([rt(),f("design:type",Function),f("design:paramtypes",[]),f("design:returntype",Array)],M.prototype,"runtimeListUsers",null);w([ne(),H(0,z()),H(1,z()),f("design:type",Function),f("design:paramtypes",[String,It]),f("design:returntype",Vi)],M.prototype,"runtimeRequestLoginVerification",null);w([ne(),H(0,z()),H(1,z()),H(2,z()),f("design:type",Function),f("design:paramtypes",[String,String,String]),f("design:returntype",String)],M.prototype,"runtimeVerifyEmailCode",null);w([ne(),H(0,z()),f("design:type",Function),f("design:paramtypes",[String]),f("design:returntype",Boolean)],M.prototype,"runtimeTestEmail",null);w([ne(),H(0,z()),H(1,z()),H(2,z()),f("design:type",Function),f("design:paramtypes",[String,String,It]),f("design:returntype",Mi)],M.prototype,"runtimeCreateUser",null);w([ne(),H(0,z()),H(1,z()),f("design:type",Function),f("design:paramtypes",[String,String]),f("design:returntype",String)],M.prototype,"runtimeLoginUser",null);w([ne(),f("design:type",Function),f("design:paramtypes",[]),f("design:returntype",Boolean)],M.prototype,"runtimeEmailTestModeEnable",null);w([ne(),f("design:type",Function),f("design:paramtypes",[]),f("design:returntype",Boolean)],M.prototype,"runtimeEmailTestModeDisable",null);w([ne(),H(0,z()),f("design:type",Function),f("design:paramtypes",[String]),f("design:returntype",String)],M.prototype,"runtimeEmailTestGetCode",null);w([ne(),f("design:type",Function),f("design:paramtypes",[]),f("design:returntype",Boolean)],M.prototype,"runtimeEmailTestClearCodes",null);w([ne(),H(0,z()),H(1,z()),H(2,z()),f("design:type",Function),f("design:paramtypes",[String,String,Number]),f("design:returntype",Boolean)],M.prototype,"runtimeEmailTestSetExpiry",null);M=w([yd()],M);var Fr=function(i,e,t,r,n){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?i!==e||!n:!e.has(i))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?n.call(i,t):n?n.value=t:e.set(i,t),t},ie=function(i,e,t,r){if(t==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?i!==e||!r:!e.has(i))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?r:t==="a"?r.call(i):r?r.value:e.get(i)},Ve,ga,ma,ge;function ya(i){return i.charAt(0).toUpperCase()+i.slice(1)}function Zc(i){return i?`triple("${i}", "ad4m://has_child", Base)`:""}function Jc(){return`
1890
+ `,w=function(i,e,t,r){var n=arguments.length,a=n<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(i,e,t,r);else for(var o=i.length-1;o>=0;o--)(s=i[o])&&(a=(n<3?s(a):n>3?s(e,t,a):s(e,t))||a);return n>3&&a&&Object.defineProperty(e,t,a),a},f=function(i,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,e)},H=function(i,e){return function(t,r){e(t,r,i)}},kn=new ei;kn.author="did:ad4m:test";kn.timestamp=Date.now();kn.data={source:"root",target:"neighbourhood://Qm12345"};kn.proof={signature:"",key:"",valid:!0};var Qt=new Di;Qt.author="did:ad4m:test";Qt.timestamp=Date.now().toString();Qt.proof=new Mt("","");Qt.data=new $t([kn]);var ja=class{};w([p(),f("design:type",String)],ja.prototype,"recipient",void 0);w([p(),f("design:type",Di)],ja.prototype,"message",void 0);ja=w([q()],ja);var wr=class{};w([p(),f("design:type",String)],wr.prototype,"ad4mExecutorVersion",void 0);w([p(),f("design:type",Boolean)],wr.prototype,"isInitialized",void 0);w([p(),f("design:type",Boolean)],wr.prototype,"isUnlocked",void 0);wr=w([q()],wr);var qi=class{};w([p(),f("design:type",String)],qi.prototype,"title",void 0);w([p(),f("design:type",String)],qi.prototype,"message",void 0);w([p(),f("design:type",String)],qi.prototype,"type",void 0);w([p(),f("design:type",String)],qi.prototype,"addon",void 0);qi=w([q()],qi);var dt=class{};w([p(),f("design:type",String)],dt.prototype,"description",void 0);w([p(),f("design:type",String)],dt.prototype,"appName",void 0);w([p(),f("design:type",String)],dt.prototype,"appUrl",void 0);w([p(),f("design:type",String)],dt.prototype,"appIconPath",void 0);w([p(),f("design:type",String)],dt.prototype,"trigger",void 0);w([p(),f("design:type",Array)],dt.prototype,"perspectiveIds",void 0);w([p(),f("design:type",String)],dt.prototype,"webhookUrl",void 0);w([p(),f("design:type",String)],dt.prototype,"webhookAuth",void 0);dt=w([$e()],dt);var tt=class{};w([p(),f("design:type",String)],tt.prototype,"id",void 0);w([p(),f("design:type",Boolean)],tt.prototype,"granted",void 0);w([p(),f("design:type",String)],tt.prototype,"description",void 0);w([p(),f("design:type",String)],tt.prototype,"appName",void 0);w([p(),f("design:type",String)],tt.prototype,"appUrl",void 0);w([p(),f("design:type",String)],tt.prototype,"appIconPath",void 0);w([p(),f("design:type",String)],tt.prototype,"trigger",void 0);w([p(),f("design:type",Array)],tt.prototype,"perspectiveIds",void 0);w([p(),f("design:type",String)],tt.prototype,"webhookUrl",void 0);w([p(),f("design:type",String)],tt.prototype,"webhookAuth",void 0);tt=w([q()],tt);var Er=class{};w([p(),f("design:type",tt)],Er.prototype,"notification",void 0);w([p(),f("design:type",String)],Er.prototype,"perspectiveId",void 0);w([p(),f("design:type",String)],Er.prototype,"triggerMatch",void 0);Er=w([q()],Er);var Ae=class{};w([p(),f("design:type",Number)],Ae.prototype,"total",void 0);w([p(),f("design:type",Number)],Ae.prototype,"imported",void 0);w([p(),f("design:type",Number)],Ae.prototype,"failed",void 0);w([p(),f("design:type",Number)],Ae.prototype,"omitted",void 0);w([p(),f("design:type",Array)],Ae.prototype,"errors",void 0);Ae=w([q()],Ae);var it=class{};w([p(),f("design:type",Ae)],it.prototype,"perspectives",void 0);w([p(),f("design:type",Ae)],it.prototype,"links",void 0);w([p(),f("design:type",Ae)],it.prototype,"expressions",void 0);w([p(),f("design:type",Ae)],it.prototype,"perspectiveDiffs",void 0);w([p(),f("design:type",Ae)],it.prototype,"notifications",void 0);w([p(),f("design:type",Ae)],it.prototype,"models",void 0);w([p(),f("design:type",Ae)],it.prototype,"defaultModels",void 0);w([p(),f("design:type",Ae)],it.prototype,"tasks",void 0);w([p(),f("design:type",Ae)],it.prototype,"friends",void 0);w([p(),f("design:type",Ae)],it.prototype,"trustedAgents",void 0);w([p(),f("design:type",Ae)],it.prototype,"knownLinkLanguages",void 0);it=w([q()],it);var xr=class{};w([p(),f("design:type",String)],xr.prototype,"email",void 0);w([p(),f("design:type",String)],xr.prototype,"did",void 0);w([p(),f("design:type",String)],xr.prototype,"lastSeen",void 0);w([p(),f("design:type",Number)],xr.prototype,"perspectiveCount",void 0);xr=w([q()],xr);var Vi=class{};w([p(),f("design:type",Boolean)],Vi.prototype,"success",void 0);w([p(),f("design:type",String)],Vi.prototype,"message",void 0);w([p(),f("design:type",Boolean)],Vi.prototype,"requiresPassword",void 0);w([p(),f("design:type",Boolean)],Vi.prototype,"isExistingUser",void 0);Vi=w([q()],Vi);var M=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,t,r,n){return!0}runtimeSetStatus(e){return!0}runtimeFriendStatus(e){return Qt}runtimeFriendSendMessage(e,t){return!0}runtimeMessageInbox(e){return[Qt]}runtimeMessageOutbox(e){return[{recipient:"did:test:recipient",message:Qt}]}runtimeMessageReceived(){return Qt}exceptionOccurred(){return{title:"Test title",message:"Test message",type:eo.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,t){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,t){return!0}runtimeImportPerspective(e){return!0}runtimeMultiUserEnabled(){return!1}runtimeSetMultiUserEnabled(e){return e}runtimeListUsers(){return[{email:"test@example.com",did:"did:key:test123",lastSeen:new Date().toISOString(),perspectiveCount:5}]}runtimeRequestLoginVerification(e,t){return{success:!0,message:"Verification email sent",requiresPassword:!1,isExistingUser:!0}}runtimeVerifyEmailCode(e,t,r){return"test-jwt-token-from-email-verification"}runtimeTestEmail(e){return!0}runtimeCreateUser(e,t,r){return new Mi("did:key:test123",!0)}runtimeLoginUser(e,t){return"test-jwt-token-from-password-login"}runtimeEmailTestModeEnable(){return!0}runtimeEmailTestModeDisable(){return!0}runtimeEmailTestGetCode(e){return"123456"}runtimeEmailTestClearCodes(){return!0}runtimeEmailTestSetExpiry(e,t,r){return!0}};w([ne(),f("design:type",Function),f("design:paramtypes",[]),f("design:returntype",Boolean)],M.prototype,"runtimeQuit",null);w([ne(),H(0,z()),f("design:type",Function),f("design:paramtypes",[String]),f("design:returntype",Boolean)],M.prototype,"runtimeOpenLink",null);w([rt(),f("design:type",Function),f("design:paramtypes",[]),f("design:returntype",wr)],M.prototype,"runtimeInfo",null);w([ne(),H(0,z()),f("design:type",Function),f("design:paramtypes",[Array]),f("design:returntype",Array)],M.prototype,"addTrustedAgents",null);w([ne(),H(0,z()),f("design:type",Function),f("design:paramtypes",[Array]),f("design:returntype",Array)],M.prototype,"deleteTrustedAgents",null);w([rt(),f("design:type",Function),f("design:paramtypes",[]),f("design:returntype",Array)],M.prototype,"getTrustedAgents",null);w([rt(),f("design:type",Function),f("design:paramtypes",[]),f("design:returntype",Array)],M.prototype,"runtimeKnownLinkLanguageTemplates",null);w([ne(),H(0,z()),f("design:type",Function),f("design:paramtypes",[Array]),f("design:returntype",Array)],M.prototype,"runtimeAddKnownLinkLanguageTemplates",null);w([ne(),H(0,z()),f("design:type",Function),f("design:paramtypes",[Array]),f("design:returntype",Array)],M.prototype,"runtimeRemoveKnownLinkLanguageTemplates",null);w([rt(),f("design:type",Function),f("design:paramtypes",[]),f("design:returntype",Array)],M.prototype,"runtimeFriends",null);w([ne(),H(0,z()),f("design:type",Function),f("design:paramtypes",[Array]),f("design:returntype",Array)],M.prototype,"runtimeAddFriends",null);w([ne(),H(0,z()),f("design:type",Function),f("design:paramtypes",[Array]),f("design:returntype",Array)],M.prototype,"runtimeRemoveFriends",null);w([rt(),f("design:type",Function),f("design:paramtypes",[]),f("design:returntype",String)],M.prototype,"runtimeHcAgentInfos",null);w([rt(),f("design:type",Function),f("design:paramtypes",[]),f("design:returntype",String)],M.prototype,"runtimeGetNetworkMetrics",null);w([ne(),f("design:type",Function),f("design:paramtypes",[]),f("design:returntype",Boolean)],M.prototype,"runtimeRestartHolochain",null);w([ne(),H(0,z()),f("design:type",Function),f("design:paramtypes",[Object]),f("design:returntype",Boolean)],M.prototype,"runtimeHcAddAgentInfos",null);w([rt(),H(0,z()),H(1,z()),H(2,z()),H(3,z()),f("design:type",Function),f("design:paramtypes",[String,String,String,String]),f("design:returntype",void 0)],M.prototype,"runtimeVerifyStringSignedByDid",null);w([ne(),H(0,z()),f("design:type",Function),f("design:paramtypes",[$t]),f("design:returntype",Boolean)],M.prototype,"runtimeSetStatus",null);w([rt(),H(0,z()),f("design:type",Function),f("design:paramtypes",[String]),f("design:returntype",Di)],M.prototype,"runtimeFriendStatus",null);w([ne(),H(0,z()),H(1,z()),f("design:type",Function),f("design:paramtypes",[String,xa]),f("design:returntype",Boolean)],M.prototype,"runtimeFriendSendMessage",null);w([rt(),H(0,z()),f("design:type",Function),f("design:paramtypes",[String]),f("design:returntype",Array)],M.prototype,"runtimeMessageInbox",null);w([rt(),H(0,z()),f("design:type",Function),f("design:paramtypes",[String]),f("design:returntype",Array)],M.prototype,"runtimeMessageOutbox",null);w([no(),f("design:type",Function),f("design:paramtypes",[]),f("design:returntype",Di)],M.prototype,"runtimeMessageReceived",null);w([no(),f("design:type",Function),f("design:paramtypes",[]),f("design:returntype",qi)],M.prototype,"exceptionOccurred",null);w([ne(),H(0,z()),f("design:type",Function),f("design:paramtypes",[dt]),f("design:returntype",String)],M.prototype,"runtimeRequestInstallNotification",null);w([rt(),f("design:type",Function),f("design:paramtypes",[]),f("design:returntype",Array)],M.prototype,"runtimeNotifications",null);w([ne(),H(0,z()),H(1,z()),f("design:type",Function),f("design:paramtypes",[String,dt]),f("design:returntype",Boolean)],M.prototype,"runtimeUpdateNotification",null);w([ne(),H(0,z()),f("design:type",Function),f("design:paramtypes",[String]),f("design:returntype",Boolean)],M.prototype,"runtimeRemoveNotification",null);w([ne(),H(0,z()),f("design:type",Function),f("design:paramtypes",[String]),f("design:returntype",Boolean)],M.prototype,"runtimeGrantNotification",null);w([no(),f("design:type",Function),f("design:paramtypes",[]),f("design:returntype",Er)],M.prototype,"runtimeNotificationTriggered",null);w([ne(),H(0,z()),f("design:type",Function),f("design:paramtypes",[String]),f("design:returntype",Boolean)],M.prototype,"runtimeExportDb",null);w([ne(),H(0,z()),f("design:type",Function),f("design:paramtypes",[String]),f("design:returntype",Boolean)],M.prototype,"runtimeImportDb",null);w([ne(),H(0,z()),H(1,z()),f("design:type",Function),f("design:paramtypes",[String,String]),f("design:returntype",Boolean)],M.prototype,"runtimeExportPerspective",null);w([ne(),H(0,z()),f("design:type",Function),f("design:paramtypes",[String]),f("design:returntype",Boolean)],M.prototype,"runtimeImportPerspective",null);w([rt(),f("design:type",Function),f("design:paramtypes",[]),f("design:returntype",Boolean)],M.prototype,"runtimeMultiUserEnabled",null);w([ne(),H(0,z()),f("design:type",Function),f("design:paramtypes",[Boolean]),f("design:returntype",Boolean)],M.prototype,"runtimeSetMultiUserEnabled",null);w([rt(),f("design:type",Function),f("design:paramtypes",[]),f("design:returntype",Array)],M.prototype,"runtimeListUsers",null);w([ne(),H(0,z()),H(1,z()),f("design:type",Function),f("design:paramtypes",[String,It]),f("design:returntype",Vi)],M.prototype,"runtimeRequestLoginVerification",null);w([ne(),H(0,z()),H(1,z()),H(2,z()),f("design:type",Function),f("design:paramtypes",[String,String,String]),f("design:returntype",String)],M.prototype,"runtimeVerifyEmailCode",null);w([ne(),H(0,z()),f("design:type",Function),f("design:paramtypes",[String]),f("design:returntype",Boolean)],M.prototype,"runtimeTestEmail",null);w([ne(),H(0,z()),H(1,z()),H(2,z()),f("design:type",Function),f("design:paramtypes",[String,String,It]),f("design:returntype",Mi)],M.prototype,"runtimeCreateUser",null);w([ne(),H(0,z()),H(1,z()),f("design:type",Function),f("design:paramtypes",[String,String]),f("design:returntype",String)],M.prototype,"runtimeLoginUser",null);w([ne(),f("design:type",Function),f("design:paramtypes",[]),f("design:returntype",Boolean)],M.prototype,"runtimeEmailTestModeEnable",null);w([ne(),f("design:type",Function),f("design:paramtypes",[]),f("design:returntype",Boolean)],M.prototype,"runtimeEmailTestModeDisable",null);w([ne(),H(0,z()),f("design:type",Function),f("design:paramtypes",[String]),f("design:returntype",String)],M.prototype,"runtimeEmailTestGetCode",null);w([ne(),f("design:type",Function),f("design:paramtypes",[]),f("design:returntype",Boolean)],M.prototype,"runtimeEmailTestClearCodes",null);w([ne(),H(0,z()),H(1,z()),H(2,z()),f("design:type",Function),f("design:paramtypes",[String,String,Number]),f("design:returntype",Boolean)],M.prototype,"runtimeEmailTestSetExpiry",null);M=w([yd()],M);var Fr=function(i,e,t,r,n){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?i!==e||!n:!e.has(i))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?n.call(i,t):n?n.value=t:e.set(i,t),t},J=function(i,e,t,r){if(t==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?i!==e||!r:!e.has(i))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?r:t==="a"?r.call(i):r?r.value:e.get(i)},De,ga,ma,ce;function ya(i){return i.charAt(0).toUpperCase()+i.slice(1)}function Zc(i){return i?`triple("${i}", "ad4m://has_child", Base)`:""}function Jc(){return`
1890
1891
  findall(
1891
1892
  [T, A],
1892
1893
  link(Base, _, _, T, A),
@@ -1908,39 +1909,39 @@ input VoiceActivityParamsInput {
1908
1909
  collection(SubjectClass, CollectionName),
1909
1910
  collection_getter(SubjectClass, Base, CollectionName, CollectionValues)
1910
1911
  ), Collections)
1911
- `}function Yc(i={}){function e(t){return typeof t=="string"?`"${t}"`:t}return Object.entries(i).map(([t,r])=>{let n=["base","author","timestamp"].includes(t),a=`resolve_property(SubjectClass, Base, "${t}", Value${t}, _)`,s=ya(t);if(Array.isArray(r)){let o=r.map(c=>e(c)).join(", ");return n?`member(${s}, [${o}])`:`${a}, member(Value${t}, [${o}])`}if(typeof r=="object"&&r!==null){let{not:o,between:c,lt:l,lte:u,gt:m,gte:h}=r;if(o!==void 0)if(Array.isArray(o)){let g=o.map(v=>e(v)).join(", ");return n?`\\+ member(${s}, [${g}])`:`${a}, \\+ member(Value${t}, [${g}])`}else return n?`${s} \\= ${e(o)}`:`${a}, Value${t} \\= ${e(o)}`;if(c!==void 0&&Array.isArray(c)&&c.length===2)return n?`${s} >= ${c[0]}, ${s} =< ${c[1]}`:`${a}, Value${t} >= ${c[0]}, Value${t} =< ${c[1]}`;let d=[{value:l,symbol:"<"},{value:u,symbol:"=<"},{value:m,symbol:">"},{value:h,symbol:">="}];for(let{value:g,symbol:v}of d)if(g!==void 0)return n?`${s} ${v} ${g}`:`${a}, Value${t} ${v} ${g}`}return n?`${s} = ${e(r)}`:`${a}, Value${t} = ${e(r)}`}).join(", ")}function Xc(i){return i?"length(UnsortedInstances, TotalCount)":""}function el(i){if(!i)return"SortedInstances = UnsortedInstances";let[e,t]=Object.entries(i)[0];return`sort_instances(UnsortedInstances, "${e}", "${t}", SortedInstances)`}function tl(i){return!i||i<0?"InstancesWithOffset = SortedInstances":`skipN(SortedInstances, ${i}, InstancesWithOffset)`}function il(i){return!i||i<0?"AllInstances = InstancesWithOffset":`takeN(InstancesWithOffset, ${i}, AllInstances)`}function rl(i){if(!i)return"";if(i.includes("://")){let[e,t]=i.split("://"),r=(t||"").replace(/\/+$/,"");return`${e}://${r}`}else return i.replace(/\/+$/,"")}function _o(i){if(!!i){if(typeof i=="string")return i;if(Array.isArray(i)&&i.length>0)return i.find(t=>t!=="null")||i[0]}}function ou(i,e){return _o(i.type)===e}function nl(i){return ou(i,"array")}function al(i){return ou(i,"object")}function qh(i){let e=_o(i.type);return e==="number"||e==="integer"}var Ni=class{static async getClassName(e){if(this===Ni)return await e.stringOrTemplateObjectToSubjectClassName(this);let r=this.classNamesByClass.get(this);r||(r={},this.classNamesByClass.set(this,r));let n=e.uuid;return r[n]||(r[n]=await e.stringOrTemplateObjectToSubjectClassName(this)),r[n]}get timestamp(){return this.createdAt}static getModelMetadata(){let e=this.prototype;if(!e.className||e.className==="Ad4mModel")throw new Error("Model class must be decorated with @ModelOptions");let t=e.className,r={},n=e.__properties||{};for(let[u,m]of Object.entries(n)){let h=m;r[u]={name:u,predicate:h.through||"",required:h.required||!1,writable:h.writable||!1,...h.initial!==void 0&&{initial:h.initial},...h.resolveLanguage!==void 0&&{resolveLanguage:h.resolveLanguage},...h.getter!==void 0&&{getter:h.getter},...h.surrealGetter!==void 0&&{surrealGetter:h.surrealGetter},...h.setter!==void 0&&{setter:h.setter},...h.local!==void 0&&{local:h.local},...h.transform!==void 0&&{transform:h.transform},...h.flag!==void 0&&{flag:h.flag}}}let a={},s=e.__collections||{};for(let[u,m]of Object.entries(s)){let h=m;a[u]={name:u,predicate:h.through||"",...h.where!==void 0&&{where:h.where},...h.local!==void 0&&{local:h.local},...h.surrealGetter!==void 0&&{surrealGetter:h.surrealGetter}}}let o=Object.keys(r).length>0,c=Object.keys(a).length>0;if(!(o||c)&&e.__jsonSchema){let u=e.__jsonSchema,m=e.__jsonSchemaOptions||{};if(u.properties)for(let[h,d]of Object.entries(u.properties)){let g=nl(d),v=this.determinePredicate(u,h,d,this.determineNamespace(u,m),m);if(g)a[h]={name:h,predicate:v,...d["x-ad4m"]?.local!==void 0&&{local:d["x-ad4m"].local}};else{let E=u.required?.includes(h)||!1;r[h]={name:h,predicate:v,required:E,writable:d["x-ad4m"]?.writable!==!1,...d["x-ad4m"]?.resolveLanguage&&{resolveLanguage:d["x-ad4m"].resolveLanguage},...d["x-ad4m"]?.initial&&{initial:d["x-ad4m"].initial},...d["x-ad4m"]?.local!==void 0&&{local:d["x-ad4m"].local}}}}}return{className:t,properties:r,collections:a}}constructor(e,t,r){Ve.set(this,void 0),ga.set(this,void 0),ma.set(this,void 0),ge.set(this,void 0),Fr(this,Ve,t||Le.from(su(24)).toUrl(),"f"),Fr(this,ge,e,"f"),Fr(this,ma,r||"ad4m://self","f")}get baseExpression(){return ie(this,Ve,"f")}get perspective(){return ie(this,ge,"f")}getPropertyMetadata(e){return Object.getPrototypeOf(this).__properties?.[e]}getCollectionMetadata(e){return Object.getPrototypeOf(this).__collections?.[e]}generatePropertySetterAction(e,t){if(t.writable===!1)throw new Error(`Property "${e}" is read-only and cannot be written`);if(t.setter)throw new Error(`Custom setter for property "${e}" not yet supported without Prolog. Use standard @Property decorator or enable Prolog for custom setters.`);if(!t.through)throw new Error(`Property "${e}" has no 'through' predicate defined`);return[{action:"setSingleTarget",source:"this",predicate:t.through,target:"value",...t.local&&{local:!0}}]}generateCollectionAction(e,t){let r=this.getCollectionMetadata(e);if(!r)throw new Error(`Collection "${e}" has no metadata defined`);if(!r.through)throw new Error(`Collection "${e}" has no 'through' predicate defined`);return[{action:{adder:"addLink",remover:"removeLink",setter:"collectionSetter"}[t],source:"this",predicate:r.through,target:"value",...r.local&&{local:!0}}]}static async assignValuesToInstance(e,t,r){let n=Object.fromEntries(await Promise.all(r.map(async([a,s,o])=>{let c=s;if(!o&&typeof s=="string"){let u=Array.from(s,d=>d.codePointAt(0)),m=u.every(d=>d<=255),h=u.some(d=>d>=128);if(m&&h)try{let d=Uint8Array.from(u),g=new TextDecoder("utf-8",{fatal:!0}).decode(d);g!==s&&(c=g)}catch(d){console.warn(`UTF-8 byte reconstruction failed for property "${a}"`,{value:s,error:d})}}if(o){let u=await e.getExpression(s);if(u)try{c=JSON.parse(u.data)}catch{c=u.data}}let l=t.__properties?.[a]?.transform;return l&&typeof l=="function"&&(c=l(c)),[a,c]})));Object.assign(t,n)}async getData(){try{let e=this.constructor,t=e.getModelMetadata(),n=`
1912
+ `}function Yc(i={}){function e(t){return typeof t=="string"?`"${t}"`:t}return Object.entries(i).map(([t,r])=>{let n=["base","author","timestamp"].includes(t),a=`resolve_property(SubjectClass, Base, "${t}", Value${t}, _)`,s=ya(t);if(Array.isArray(r)){let o=r.map(l=>e(l)).join(", ");return n?`member(${s}, [${o}])`:`${a}, member(Value${t}, [${o}])`}if(typeof r=="object"&&r!==null){let{not:o,between:l,lt:c,lte:u,gt:m,gte:h}=r;if(o!==void 0)if(Array.isArray(o)){let g=o.map(v=>e(v)).join(", ");return n?`\\+ member(${s}, [${g}])`:`${a}, \\+ member(Value${t}, [${g}])`}else return n?`${s} \\= ${e(o)}`:`${a}, Value${t} \\= ${e(o)}`;if(l!==void 0&&Array.isArray(l)&&l.length===2)return n?`${s} >= ${l[0]}, ${s} =< ${l[1]}`:`${a}, Value${t} >= ${l[0]}, Value${t} =< ${l[1]}`;let d=[{value:c,symbol:"<"},{value:u,symbol:"=<"},{value:m,symbol:">"},{value:h,symbol:">="}];for(let{value:g,symbol:v}of d)if(g!==void 0)return n?`${s} ${v} ${g}`:`${a}, Value${t} ${v} ${g}`}return n?`${s} = ${e(r)}`:`${a}, Value${t} = ${e(r)}`}).join(", ")}function Xc(i){return i?"length(UnsortedInstances, TotalCount)":""}function el(i){if(!i)return"SortedInstances = UnsortedInstances";let[e,t]=Object.entries(i)[0];return`sort_instances(UnsortedInstances, "${e}", "${t}", SortedInstances)`}function tl(i){return!i||i<0?"InstancesWithOffset = SortedInstances":`skipN(SortedInstances, ${i}, InstancesWithOffset)`}function il(i){return!i||i<0?"AllInstances = InstancesWithOffset":`takeN(InstancesWithOffset, ${i}, AllInstances)`}function rl(i){if(!i)return"";if(i.includes("://")){let[e,t]=i.split("://"),r=(t||"").replace(/\/+$/,"");return`${e}://${r}`}else return i.replace(/\/+$/,"")}function _o(i){if(!!i){if(typeof i=="string")return i;if(Array.isArray(i)&&i.length>0)return i.find(t=>t!=="null")||i[0]}}function ou(i,e){return _o(i.type)===e}function nl(i){return ou(i,"array")}function al(i){return ou(i,"object")}function qh(i){let e=_o(i.type);return e==="number"||e==="integer"}var Ni=class{static async getClassName(e){if(this===Ni)return await e.stringOrTemplateObjectToSubjectClassName(this);let r=this.classNamesByClass.get(this);r||(r={},this.classNamesByClass.set(this,r));let n=e.uuid;return r[n]||(r[n]=await e.stringOrTemplateObjectToSubjectClassName(this)),r[n]}get timestamp(){return this.createdAt}static getModelMetadata(){let e=this.prototype;if(!e.className||e.className==="Ad4mModel")throw new Error("Model class must be decorated with @ModelOptions");let t=e.className,r={},n=e.__properties||{};for(let[u,m]of Object.entries(n)){let h=m;r[u]={name:u,predicate:h.through||"",required:h.required||!1,writable:h.writable||!1,...h.initial!==void 0&&{initial:h.initial},...h.resolveLanguage!==void 0&&{resolveLanguage:h.resolveLanguage},...h.prologGetter!==void 0&&{prologGetter:h.prologGetter},...h.getter!==void 0&&{getter:h.getter},...h.prologSetter!==void 0&&{prologSetter:h.prologSetter},...h.local!==void 0&&{local:h.local},...h.transform!==void 0&&{transform:h.transform},...h.flag!==void 0&&{flag:h.flag}}}let a={},s=e.__collections||{};for(let[u,m]of Object.entries(s)){let h=m;a[u]={name:u,predicate:h.through||"",...h.where!==void 0&&{where:h.where},...h.local!==void 0&&{local:h.local},...h.getter!==void 0&&{getter:h.getter}}}let o=Object.keys(r).length>0,l=Object.keys(a).length>0;if(!(o||l)&&e.__jsonSchema){let u=e.__jsonSchema,m=e.__jsonSchemaOptions||{};if(u.properties)for(let[h,d]of Object.entries(u.properties)){let g=nl(d),v=this.determinePredicate(u,h,d,this.determineNamespace(u,m),m);if(g)a[h]={name:h,predicate:v,...d["x-ad4m"]?.local!==void 0&&{local:d["x-ad4m"].local}};else{let E=u.required?.includes(h)||!1;r[h]={name:h,predicate:v,required:E,writable:d["x-ad4m"]?.writable!==!1,...d["x-ad4m"]?.resolveLanguage&&{resolveLanguage:d["x-ad4m"].resolveLanguage},...d["x-ad4m"]?.initial&&{initial:d["x-ad4m"].initial},...d["x-ad4m"]?.local!==void 0&&{local:d["x-ad4m"].local}}}}}return{className:t,properties:r,collections:a}}constructor(e,t,r){De.set(this,void 0),ga.set(this,void 0),ma.set(this,void 0),ce.set(this,void 0),Fr(this,De,t||Le.from(su(24)).toUrl(),"f"),Fr(this,ce,e,"f"),Fr(this,ma,r||"ad4m://self","f")}get baseExpression(){return J(this,De,"f")}get perspective(){return J(this,ce,"f")}getPropertyMetadata(e){return Object.getPrototypeOf(this).__properties?.[e]}getCollectionMetadata(e){return Object.getPrototypeOf(this).__collections?.[e]}generatePropertySetterAction(e,t){if(t.writable===!1)throw new Error(`Property "${e}" is read-only and cannot be written`);if(t.prologSetter)throw new Error(`Custom Prolog setter for property "${e}" not yet supported without Prolog. Use standard @Property decorator or enable Prolog for custom setters.`);if(!t.through)throw new Error(`Property "${e}" has no 'through' predicate defined`);return[{action:"setSingleTarget",source:"this",predicate:t.through,target:"value",...t.local&&{local:!0}}]}generateCollectionAction(e,t){let r=this.getCollectionMetadata(e);if(!r)throw new Error(`Collection "${e}" has no metadata defined`);if(!r.through)throw new Error(`Collection "${e}" has no 'through' predicate defined`);return[{action:{adder:"addLink",remover:"removeLink",setter:"collectionSetter"}[t],source:"this",predicate:r.through,target:"value",...r.local&&{local:!0}}]}static async assignValuesToInstance(e,t,r){let n=Object.fromEntries(await Promise.all(r.map(async([s,o,l])=>{let c=o;if(!l&&typeof o=="string"){let m=Array.from(o,g=>g.codePointAt(0)),h=m.every(g=>g<=255),d=m.some(g=>g>=128);if(h&&d)try{let g=Uint8Array.from(m),v=new TextDecoder("utf-8",{fatal:!0}).decode(g);v!==o&&(c=v)}catch(g){console.warn(`UTF-8 byte reconstruction failed for property "${s}"`,{value:o,error:g})}}if(l){let m=await e.getExpression(o);if(m)try{c=JSON.parse(m.data)}catch{c=m.data}}let u=t.__properties?.[s]?.transform;return u&&typeof u=="function"&&(c=u(c)),[s,c]}))),a=Object.fromEntries(Object.entries(n).filter(([s])=>{let o=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(t),s);return o?o.get!==void 0||o.set!==void 0?o.set!==void 0:o.writable!==!1:!0}));Object.assign(t,a)}async getData(){try{let e=this.constructor,t=e.getModelMetadata(),n=`
1912
1913
  SELECT id, predicate, out.uri AS target, author, timestamp
1913
1914
  FROM link
1914
- WHERE in.uri = ${e.formatSurrealValue(ie(this,Ve,"f"))}
1915
+ WHERE in.uri = ${e.formatSurrealValue(J(this,De,"f"))}
1915
1916
  ORDER BY timestamp ASC
1916
- `,a=await ie(this,ge,"f").querySurrealDB(n);if(a&&a.length>0){let s=null,o=null,c=null,l=null;for(let[u,m]of Object.entries(t.properties)){if(m.surrealGetter)continue;let h=a.filter(d=>d.predicate===m.predicate);if(h.length>0){let d=h[h.length-1],g=d.target;if(d.timestamp&&((!s||d.timestamp<s)&&(s=d.timestamp,l=d.author),(!o||d.timestamp>o)&&(o=d.timestamp,c=d.author)),m.resolveLanguage&&m.resolveLanguage!=="literal")try{let v=await ie(this,ge,"f").getExpression(g);if(v)try{g=JSON.parse(v.data)}catch{g=v.data}}catch(v){console.warn(`Failed to resolve expression for ${u}:`,v)}else if(typeof g=="string"&&g.startsWith("literal://"))try{let v=Le.fromUrl(g).get();g=v.data!==void 0?v.data:v}catch{}m.transform&&typeof m.transform=="function"&&(g=m.transform(g)),this[u]=g}}for(let[u,m]of Object.entries(t.collections)){if(m.surrealGetter)continue;let d=a.filter(g=>g.predicate===m.predicate).map(g=>g.target);if(m.where?.isInstance&&d.length>0)try{let g=typeof m.where.isInstance=="string"?m.where.isInstance:m.where.isInstance.name,v=await ie(this,ge,"f").getSubjectClassMetadataFromSDNA(g);v&&(d=await ie(this,ge,"f").batchCheckSubjectInstances(d,v))}catch{}this[u]=d}l&&(this.author=l),s&&(this.createdAt=s),o&&(this.updatedAt=o)}await e.evaluateSurrealGettersForInstance(this,ie(this,ge,"f"),t)}catch(e){console.error(`SurrealDB getData also failed for ${ie(this,Ve,"f")}:`,e)}return this}static async queryToProlog(e,t,r){let{source:n,properties:a,collections:s,where:o,order:c,offset:l,limit:u,count:m}=t,h=r||await this.getClassName(e),d=[Jc(),Zc(n),jh(a),Bh(s),Yc(o)],g=[Xc(m),el(c),tl(l),il(u)];return`
1917
+ `,a=await J(this,ce,"f").querySurrealDB(n);if(a&&a.length>0){let s=null,o=null,l=null,c=null;for(let[u,m]of Object.entries(t.properties)){if(m.getter)continue;let h=a.filter(d=>d.predicate===m.predicate);if(h.length>0){let d=h[h.length-1],g=d.target;if(d.timestamp&&((!s||d.timestamp<s)&&(s=d.timestamp,c=d.author),(!o||d.timestamp>o)&&(o=d.timestamp,l=d.author)),m.resolveLanguage&&m.resolveLanguage!=="literal")try{let v=await J(this,ce,"f").getExpression(g);if(v)try{g=JSON.parse(v.data)}catch{g=v.data}}catch(v){console.warn(`Failed to resolve expression for ${u}:`,v)}else if(typeof g=="string"&&g.startsWith("literal://"))try{let v=Le.fromUrl(g).get();g=v.data!==void 0?v.data:v}catch{}m.transform&&typeof m.transform=="function"&&(g=m.transform(g)),this[u]=g}}for(let[u,m]of Object.entries(t.collections)){if(m.getter)continue;let d=a.filter(g=>g.predicate===m.predicate).map(g=>g.target);if(m.where?.condition&&d.length>0)try{let g=[];for(let v of d){let E=m.where.condition.replace(/\$perspective/g,`'${J(this,ce,"f").uuid}'`).replace(/\$base/g,`'${J(this,De,"f")}'`).replace(/Target/g,`'${v.replace(/'/g,"\\'")}'`);E.trim().startsWith("WHERE")&&(E=`array::len(SELECT * FROM link ${E}) > 0`);let A=`RETURN ${E}`,C=await J(this,ce,"f").querySurrealDB(A);(C===!0||Array.isArray(C)&&C.length>0&&C[0]===!0)&&g.push(v)}d=g}catch(g){console.warn(`Failed to apply condition filter for ${u}:`,g)}if(m.where?.isInstance&&d.length>0)try{let g=typeof m.where.isInstance=="string"?m.where.isInstance:m.where.isInstance.name,v=await J(this,ce,"f").getSubjectClassMetadataFromSDNA(g);v&&(d=await J(this,ce,"f").batchCheckSubjectInstances(d,v))}catch{}this[u]=d}c&&(this.author=c),s&&(this.createdAt=s),o&&(this.updatedAt=o)}await e.evaluateCustomGettersForInstance(this,J(this,ce,"f"),t);for(let[s,o]of Object.entries(t.collections))if(o.getter&&o.where?.isInstance&&this[s]?.length>0)try{let l=typeof o.where.isInstance=="string"?o.where.isInstance:o.where.isInstance.name,c=await J(this,ce,"f").getSubjectClassMetadataFromSDNA(l);if(c){let u=await J(this,ce,"f").batchCheckSubjectInstances(this[s],c);this[s]=u}}catch{}}catch(e){console.error(`SurrealDB getData also failed for ${J(this,De,"f")}:`,e)}return this}static async queryToProlog(e,t,r){let{source:n,properties:a,collections:s,where:o,order:l,offset:c,limit:u,count:m}=t,h=r||await this.getClassName(e),d=[Jc(),Zc(n),jh(a),Bh(s),Yc(o)],g=[Xc(m),el(l),tl(c),il(u)];return`
1917
1918
  findall([Base, Properties, Collections, Timestamp, Author], (
1918
1919
  subject_class("${h}", SubjectClass),
1919
1920
  instance(SubjectClass, Base),
1920
1921
  ${d.filter(E=>E).join(", ")}
1921
1922
  ), UnsortedInstances),
1922
1923
  ${g.filter(E=>E).join(", ")}
1923
- `}static async evaluateSurrealGettersForInstance(e,t,r){let n=this.formatSurrealValue(e.baseExpression);for(let[a,s]of Object.entries(r.properties))if(s.surrealGetter)try{let o=s.surrealGetter.replace(/Base/g,n),c=await t.querySurrealDB(`SELECT (${o}) AS value FROM node WHERE uri = ${n}`);c&&c.length>0&&c[0].value!==void 0&&c[0].value!==null&&c[0].value!=="None"&&c[0].value!==""&&(e[a]=c[0].value)}catch(o){console.warn(`Failed to evaluate surrealGetter for ${a}:`,o)}for(let[a,s]of Object.entries(r.collections))if(s.surrealGetter)try{let o=s.surrealGetter.replace(/Base/g,n),c=await t.querySurrealDB(`SELECT (${o}) AS value FROM node WHERE uri = ${n}`);if(c&&c.length>0&&c[0].value!==void 0&&c[0].value!==null){let l=c[0].value;e[a]=Array.isArray(l)?l.filter(u=>u&&u!==""&&u!=="None"):l}}catch(o){console.warn(`Failed to evaluate surrealGetter for ${a}:`,o)}}static async queryToSurrealQL(e,t){let r=this.getModelMetadata(),{source:n,where:a,order:s,offset:o,limit:c}=t,l=[];n&&l.push(`count(<-link[WHERE perspective = $perspective AND in.uri = ${this.formatSurrealValue(n)} AND predicate = 'ad4m://has_child']) > 0`);for(let[d,g]of Object.entries(r.properties))g.required&&(g.flag&&g.initial?l.push(`count(->link[WHERE perspective = $perspective AND predicate = '${oe(g.predicate)}' AND out.uri = '${oe(g.initial)}']) > 0`):l.push(`count(->link[WHERE perspective = $perspective AND predicate = '${oe(g.predicate)}']) > 0`));if(l.length===0){for(let[d,g]of Object.entries(r.properties))if(g.initial){g.flag?l.push(`count(->link[WHERE perspective = $perspective AND predicate = '${oe(g.predicate)}' AND out.uri = '${oe(g.initial)}']) > 0`):l.push(`count(->link[WHERE perspective = $perspective AND predicate = '${oe(g.predicate)}']) > 0`);break}}let u=this.buildGraphTraversalWhereClause(r,a),m=[];return m.push(...l),u&&m.push(u),m.push("count(->link[WHERE perspective = $perspective]) > 0"),`
1924
+ `}static async evaluateCustomGettersForInstance(e,t,r){let n=this.formatSurrealValue(e.baseExpression);for(let[a,s]of Object.entries(r.properties))if(s.getter)try{let o=s.getter.replace(/Base/g,n),l=await t.querySurrealDB(`SELECT (${o}) AS value FROM node WHERE uri = ${n}`);l&&l.length>0&&l[0].value!==void 0&&l[0].value!==null&&l[0].value!=="None"&&l[0].value!==""&&(e[a]=l[0].value)}catch(o){console.warn(`Failed to evaluate getter for ${a}:`,o)}for(let[a,s]of Object.entries(r.collections))if(s.getter)try{let o=s.getter.replace(/Base/g,n),l=await t.querySurrealDB(`SELECT (${o}) AS value FROM node WHERE uri = ${n}`);if(l&&l.length>0&&l[0].value!==void 0&&l[0].value!==null){let c=l[0].value;e[a]=Array.isArray(c)?c.filter(u=>u!=null&&u!==""&&u!=="None"):c}}catch(o){console.warn(`Failed to evaluate getter for ${a}:`,o)}}static async queryToSurrealQL(e,t){let r=this.getModelMetadata(),{source:n,where:a,order:s,offset:o,limit:l}=t,c=[];n&&c.push(`count(<-link[WHERE perspective = $perspective AND in.uri = ${this.formatSurrealValue(n)} AND predicate = 'ad4m://has_child']) > 0`);for(let[d,g]of Object.entries(r.properties))g.required&&(g.flag&&g.initial?c.push(`count(->link[WHERE perspective = $perspective AND predicate = '${oe(g.predicate)}' AND out.uri = '${oe(g.initial)}']) > 0`):c.push(`count(->link[WHERE perspective = $perspective AND predicate = '${oe(g.predicate)}']) > 0`));if(c.length===0){for(let[d,g]of Object.entries(r.properties))if(g.initial){g.flag?c.push(`count(->link[WHERE perspective = $perspective AND predicate = '${oe(g.predicate)}' AND out.uri = '${oe(g.initial)}']) > 0`):c.push(`count(->link[WHERE perspective = $perspective AND predicate = '${oe(g.predicate)}']) > 0`);break}}let u=this.buildGraphTraversalWhereClause(r,a),m=[];return m.push(...c),u&&m.push(u),m.push("count(->link[WHERE perspective = $perspective]) > 0"),`
1924
1925
  SELECT
1925
1926
  id AS source,
1926
1927
  uri AS source_uri,
1927
1928
  ->link[WHERE perspective = $perspective] AS links
1928
1929
  FROM node
1929
1930
  WHERE ${m.join(" AND ")}
1930
- `.trim()}static buildGraphTraversalWhereClause(e,t){if(!t)return"";let r=[];for(let[n,a]of Object.entries(t))if(["base","author","timestamp"].includes(n)){if(n==="author"||n==="timestamp")continue;let o="uri";if(Array.isArray(a)){let c=a.map(l=>this.formatSurrealValue(l)).join(", ");r.push(`${o} IN [${c}]`)}else if(typeof a=="object"&&a!==null){let c=a;if(c.not!==void 0)if(Array.isArray(c.not)){let l=c.not.map(u=>this.formatSurrealValue(u)).join(", ");r.push(`${o} NOT IN [${l}]`)}else r.push(`${o} != ${this.formatSurrealValue(c.not)}`);c.between!==void 0&&Array.isArray(c.between)&&c.between.length===2&&r.push(`${o} >= ${this.formatSurrealValue(c.between[0])} AND ${o} <= ${this.formatSurrealValue(c.between[1])}`),c.gt!==void 0&&r.push(`${o} > ${this.formatSurrealValue(c.gt)}`),c.gte!==void 0&&r.push(`${o} >= ${this.formatSurrealValue(c.gte)}`),c.lt!==void 0&&r.push(`${o} < ${this.formatSurrealValue(c.lt)}`),c.lte!==void 0&&r.push(`${o} <= ${this.formatSurrealValue(c.lte)}`),c.contains!==void 0&&r.push(`${o} CONTAINS ${this.formatSurrealValue(c.contains)}`)}else r.push(`${o} = ${this.formatSurrealValue(a)}`)}else{let o=e.properties[n];if(!o)continue;let c=oe(o.predicate),l=o.resolveLanguage==="literal"?"fn::parse_literal(out.uri)":"out.uri";if(Array.isArray(a)){let u=a.map(m=>this.formatSurrealValue(m)).join(", ");r.push(`count(->link[WHERE perspective = $perspective AND predicate = '${c}' AND ${l} IN [${u}]]) > 0`)}else if(typeof a=="object"&&a!==null){let u=a;if(u.not!==void 0)if(Array.isArray(u.not)){let h=u.not.map(d=>this.formatSurrealValue(d)).join(", ");r.push(`count(->link[WHERE perspective = $perspective AND predicate = '${c}' AND ${l} IN [${h}]]) = 0`)}else r.push(`count(->link[WHERE perspective = $perspective AND predicate = '${c}' AND ${l} = ${this.formatSurrealValue(u.not)}]) = 0`);(u.gt!==void 0||u.gte!==void 0||u.lt!==void 0||u.lte!==void 0||u.between!==void 0||u.contains!==void 0)&&r.push(`count(->link[WHERE perspective = $perspective AND predicate = '${c}']) > 0`)}else r.push(`count(->link[WHERE perspective = $perspective AND predicate = '${c}' AND ${l} = ${this.formatSurrealValue(a)}]) > 0`)}return r.join(" AND ")}static buildSurrealWhereClause(e,t){if(!t)return"";let r=[];for(let[n,a]of Object.entries(t))if(["base","author","timestamp"].includes(n)){if(n==="author"||n==="timestamp")continue;let o="source";if(Array.isArray(a)){let c=a.map(l=>this.formatSurrealValue(l)).join(", ");r.push(`${o} IN [${c}]`)}else if(typeof a=="object"&&a!==null){let c=a;if(c.not!==void 0)if(Array.isArray(c.not)){let l=c.not.map(u=>this.formatSurrealValue(u)).join(", ");r.push(`${o} NOT IN [${l}]`)}else r.push(`${o} != ${this.formatSurrealValue(c.not)}`);c.between!==void 0&&Array.isArray(c.between)&&c.between.length===2&&r.push(`${o} >= ${this.formatSurrealValue(c.between[0])} AND ${o} <= ${this.formatSurrealValue(c.between[1])}`),c.gt!==void 0&&r.push(`${o} > ${this.formatSurrealValue(c.gt)}`),c.gte!==void 0&&r.push(`${o} >= ${this.formatSurrealValue(c.gte)}`),c.lt!==void 0&&r.push(`${o} < ${this.formatSurrealValue(c.lt)}`),c.lte!==void 0&&r.push(`${o} <= ${this.formatSurrealValue(c.lte)}`),c.contains!==void 0&&r.push(`${o} CONTAINS ${this.formatSurrealValue(c.contains)}`)}else r.push(`${o} = ${this.formatSurrealValue(a)}`)}else{let o=e.properties[n];if(!o)continue;let c=oe(o.predicate),l=o.resolveLanguage==="literal"?"fn::parse_literal(target)":"target";if(Array.isArray(a)){let u=a.map(m=>this.formatSurrealValue(m)).join(", ");r.push(`source IN (SELECT VALUE source FROM link WHERE predicate = '${c}' AND ${l} IN [${u}])`)}else if(typeof a=="object"&&a!==null){let u=a;if(u.not!==void 0)if(Array.isArray(u.not)){let h=u.not.map(d=>this.formatSurrealValue(d)).join(", ");r.push(`source NOT IN (SELECT VALUE source FROM link WHERE predicate = '${c}' AND ${l} IN [${h}])`)}else r.push(`source NOT IN (SELECT VALUE source FROM link WHERE predicate = '${c}' AND ${l} = ${this.formatSurrealValue(u.not)})`);(u.gt!==void 0||u.gte!==void 0||u.lt!==void 0||u.lte!==void 0||u.between!==void 0||u.contains!==void 0)&&r.push(`source IN (SELECT VALUE source FROM link WHERE predicate = '${c}')`)}else r.push(`source IN (SELECT VALUE source FROM link WHERE predicate = '${c}' AND ${l} = ${this.formatSurrealValue(a)})`)}return r.join(" AND ")}static buildSurrealSelectFields(e,t,r){let n=[],a=t||Object.keys(e.properties);for(let o of a){let c=e.properties[o];if(!c)continue;let l=oe(c.predicate);n.push(`(SELECT VALUE target FROM link WHERE source = source AND predicate = '${l}' LIMIT 1) AS ${o}`)}let s=r||Object.keys(e.collections);for(let o of s){let c=e.collections[o];if(!c)continue;let l=oe(c.predicate);n.push(`(SELECT VALUE target FROM link WHERE source = source AND predicate = '${l}') AS ${o}`)}return n.push("(SELECT VALUE author FROM link WHERE source = source ORDER BY timestamp ASC LIMIT 1) AS author"),n.push("(SELECT VALUE timestamp FROM link WHERE source = source ORDER BY timestamp ASC LIMIT 1) AS createdAt"),n.push("(SELECT VALUE timestamp FROM link WHERE source = source ORDER BY timestamp DESC LIMIT 1) AS updatedAt"),n.join(`,
1931
- `)}static buildSurrealSelectFieldsWithAggregation(e,t,r){let n=[],a=t||Object.keys(e.properties);for(let o of a){let c=e.properties[o];if(!c)continue;let l=oe(c.predicate);n.push(`array::first(target[WHERE predicate = '${l}']) AS ${o}`)}let s=r||Object.keys(e.collections);for(let o of s){let c=e.collections[o];if(!c)continue;let l=oe(c.predicate);n.push(`target[WHERE predicate = '${l}'] AS ${o}`)}return n.push("array::first(author) AS author"),n.push("array::first(timestamp) AS createdAt"),n.push("array::last(timestamp) AS updatedAt"),n.join(`,
1932
- `)}static formatSurrealValue(e){return typeof e=="string"?`'${e.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")}'`:typeof e=="number"||typeof e=="boolean"?String(e):Array.isArray(e)?`[${e.map(t=>this.formatSurrealValue(t)).join(", ")}]`:String(e)}static async instancesFromPrologResult(e,t,r){if(!r?.[0]?.AllInstances)return{results:[],totalCount:0};let n=[...t?.properties||[],...t?.collections||[]];return{results:(await Promise.all(r[0].AllInstances.map(async([s,o,c,l,u])=>{try{let m=new this(e,s);n.length&&Object.keys(m).forEach(d=>{n.includes(d)||delete m[d]});let h=[...o,...c,["timestamp",l],["author",u]];return await Ni.assignValuesToInstance(e,m,h),m}catch(m){return console.error(`Failed to process instance ${s}:`,m),null}}))).filter(s=>s!==null),totalCount:r[0].TotalCount}}static async instancesFromSurrealResult(e,t,r){if(!r||r.length===0)return{results:[],totalCount:0};let n=this.getModelMetadata(),a=t?.properties||[],s=t?.collections||[],o=[];for(let h of r){let d;try{if(d=h.source_uri,!d)continue;let g=h.links||[],v=new this(e,d),E=null,$=null,N=null,O=null;for(let A=0;A<g.length;A++){let k=g[A],Z=k.predicate,I=k.target;if(I==="None")continue;k.timestamp&&((!E||k.timestamp<E)&&(E=k.timestamp,N=k.author),(!$||k.timestamp>$)&&($=k.timestamp,O=k.author));let K=!1;for(let[C,T]of Object.entries(n.properties))if(!T.surrealGetter&&T.predicate===Z){let D=v[C],Me=typeof D=="object"&&D!==null&&!Array.isArray(D)&&Object.keys(D).length===0;if(!D||D===""||D===0||Me){let Ie=I;if(I!=null&&I!==""){if(T.resolveLanguage!=null&&T.resolveLanguage!=="literal"&&typeof I=="string")try{let Se=await e.getExpression(I);if(Se)try{Ie=JSON.parse(Se.data)}catch{Ie=Se.data}}catch(Se){console.warn(`Failed to resolve expression for ${C} with target "${I}":`,Se),console.warn("Falling back to raw value"),Ie=I}else if(typeof I=="string"&&I.startsWith("literal://"))try{let Se=Le.fromUrl(I).get();Se.data!==void 0?Ie=Se.data:Ie=Se}catch{Ie=I}else if(typeof I=="string"){let Se=typeof v[C];Se==="number"?Ie=Number(I):Se==="boolean"&&(Ie=I==="true"||I==="1")}}T.transform&&typeof T.transform=="function"&&(Ie=T.transform(Ie)),v[C]=Ie}K=!0;break}if(!K){for(let[C,T]of Object.entries(n.collections))if(!T.surrealGetter&&T.predicate===Z){v[C]||(v[C]=[]);let D=`__${C}_timestamps`,Me=`__${C}_indices`;v[D]||(v[D]=[]),v[Me]||(v[Me]=[]),v[C].includes(I)||(v[C].push(I),v[D].push(k.timestamp||""),v[Me].push(A));break}}}if(N&&(v.author=N),E)if(typeof E=="string"&&E.includes("T"))v.createdAt=new Date(E).getTime();else if(typeof E=="string"){let A=parseInt(E,10);v.createdAt=isNaN(A)?E:A}else v.createdAt=E;if($)if(typeof $=="string"&&$.includes("T"))v.updatedAt=new Date($).getTime();else if(typeof $=="string"){let A=parseInt($,10);v.updatedAt=isNaN(A)?$:A}else v.updatedAt=$;for(let[A,k]of Object.entries(n.collections)){let Z=`__${A}_timestamps`,I=`__${A}_indices`;if(v[A]&&v[Z]){let K=v[A].map((C,T)=>({value:C,timestamp:v[Z][T]||"",originalIndex:v[I]?.[T]??T}));K.sort((C,T)=>{let D=String(C.timestamp||""),Me=String(T.timestamp||""),Ie=D.localeCompare(Me);return Ie!==0?Ie:C.originalIndex-T.originalIndex}),v[A]=K.map(C=>C.value).filter(C=>C&&C!==""&&C!=="None"),delete v[Z],delete v[I]}}if(a.length>0||s.length>0){let A=[...a,...s];Object.keys(v).forEach(k=>{!A.includes(k)&&k!=="timestamp"&&k!=="author"&&k!=="baseExpression"&&delete v[k]})}o.push(v)}catch(g){console.error(`Failed to process SurrealDB instance ${d}:`,g)}}for(let h of o)await this.evaluateSurrealGettersForInstance(h,e,n);for(let h of o)for(let[d,g]of Object.entries(n.collections))if(g.where?.isInstance&&h[d]?.length>0)try{let v=g.where.isInstance,E=h[d],$=typeof v=="string"?v:v.prototype?.className||v.name,N=await e.getSubjectClassMetadataFromSDNA($);if(!N)continue;let O=await e.batchCheckSubjectInstances(E,N);h[d]=O}catch{}for(let h of o)await this.evaluateSurrealGettersForInstance(h,e,n);let c=o;t.where&&(c=o.filter(h=>{for(let[d,g]of Object.entries(t.where))if(d!=="base"){if(d==="author"||d==="timestamp"){if(!this.matchesCondition(h[d],g))return!1;continue}if(typeof g=="object"&&g!==null&&!Array.isArray(g)){let v=g;if((v.gt!==void 0||v.gte!==void 0||v.lt!==void 0||v.lte!==void 0||v.between!==void 0||v.contains!==void 0)&&!this.matchesCondition(h[d],g))return!1}}return!0}));let l=t.order||(t.limit!==void 0||t.offset!==void 0?{timestamp:"ASC"}:null);if(l){let h=Object.keys(l)[0],d=Object.values(l)[0];c.sort((g,v)=>{let E=g[h],$=v[h];if(E===void 0&&$===void 0)return 0;if(E===void 0)return d==="ASC"?1:-1;if($===void 0)return d==="ASC"?-1:1;let N=0;return typeof E=="number"&&typeof $=="number"?N=E-$:typeof E=="string"&&typeof $=="string"?N=E.localeCompare($):N=String(E).localeCompare(String($)),d==="DESC"?-N:N})}let u=c.length,m=c;if(t.offset!==void 0||t.limit!==void 0){let h=t.offset||0,d=t.limit?h+t.limit:void 0;m=c.slice(h,d)}return{results:m,totalCount:u}}static matchesCondition(e,t){if(Array.isArray(t))return t.includes(e);if(typeof t=="object"&&t!==null){let r=t;if(r.not!==void 0)return Array.isArray(r.not)?!r.not.includes(e):e!==r.not;if(r.between!==void 0&&Array.isArray(r.between)&&r.between.length===2)return e>=r.between[0]&&e<=r.between[1];let n=!0;return r.gt!==void 0&&(n=n&&e>r.gt),r.gte!==void 0&&(n=n&&e>=r.gte),r.lt!==void 0&&(n=n&&e<r.lt),r.lte!==void 0&&(n=n&&e<=r.lte),r.contains!==void 0&&(typeof e=="string"?n=n&&e.includes(String(r.contains)):Array.isArray(e)?n=n&&e.includes(r.contains):n=!1),n}return e===t}static async findAll(e,t={},r=!0){if(r){let n=await this.queryToSurrealQL(e,t),a=await e.querySurrealDB(n),{results:s}=await this.instancesFromSurrealResult(e,t,a);return s}else{let n=await this.queryToProlog(e,t),a=await e.infer(n),{results:s}=await this.instancesFromPrologResult(e,t,a);return s}}static async findAllAndCount(e,t={},r=!0){if(r){let n=await this.queryToSurrealQL(e,t),a=await e.querySurrealDB(n);return await this.instancesFromSurrealResult(e,t,a)}else{let n=await this.queryToProlog(e,t),a=await e.infer(n);return await this.instancesFromPrologResult(e,t,a)}}static async paginate(e,t,r,n,a=!0){let s={...n||{},limit:t,offset:t*(r-1),count:!0};if(a){let o=await this.queryToSurrealQL(e,s),c=await e.querySurrealDB(o),{results:l,totalCount:u}=await this.instancesFromSurrealResult(e,s,c);return{results:l,totalCount:u,pageSize:t,pageNumber:r}}else{let o=await this.queryToProlog(e,s),c=await e.infer(o),{results:l,totalCount:u}=await this.instancesFromPrologResult(e,s,c);return{results:l,totalCount:u,pageSize:t,pageNumber:r}}}static async countQueryToProlog(e,t={},r){let{source:n,where:a}=t,s=r||await this.getClassName(e),o=[Jc(),Zc(n),Yc(a)],c=[Xc(!0),el(),tl(),il()];return`
1931
+ `.trim()}static buildGraphTraversalWhereClause(e,t){if(!t)return"";let r=[];for(let[n,a]of Object.entries(t))if(["base","author","timestamp"].includes(n)){if(n==="author"||n==="timestamp")continue;let o="uri";if(Array.isArray(a)){let l=a.map(c=>this.formatSurrealValue(c)).join(", ");r.push(`${o} IN [${l}]`)}else if(typeof a=="object"&&a!==null){let l=a;if(l.not!==void 0)if(Array.isArray(l.not)){let c=l.not.map(u=>this.formatSurrealValue(u)).join(", ");r.push(`${o} NOT IN [${c}]`)}else r.push(`${o} != ${this.formatSurrealValue(l.not)}`);l.between!==void 0&&Array.isArray(l.between)&&l.between.length===2&&r.push(`${o} >= ${this.formatSurrealValue(l.between[0])} AND ${o} <= ${this.formatSurrealValue(l.between[1])}`),l.gt!==void 0&&r.push(`${o} > ${this.formatSurrealValue(l.gt)}`),l.gte!==void 0&&r.push(`${o} >= ${this.formatSurrealValue(l.gte)}`),l.lt!==void 0&&r.push(`${o} < ${this.formatSurrealValue(l.lt)}`),l.lte!==void 0&&r.push(`${o} <= ${this.formatSurrealValue(l.lte)}`),l.contains!==void 0&&r.push(`${o} CONTAINS ${this.formatSurrealValue(l.contains)}`)}else r.push(`${o} = ${this.formatSurrealValue(a)}`)}else{let o=e.properties[n];if(!o)continue;let l=oe(o.predicate),c=o.resolveLanguage==="literal"?"fn::parse_literal(out.uri)":"out.uri";if(Array.isArray(a)){let u=a.map(m=>this.formatSurrealValue(m)).join(", ");r.push(`count(->link[WHERE perspective = $perspective AND predicate = '${l}' AND ${c} IN [${u}]]) > 0`)}else if(typeof a=="object"&&a!==null){let u=a;if(u.not!==void 0)if(Array.isArray(u.not)){let h=u.not.map(d=>this.formatSurrealValue(d)).join(", ");r.push(`count(->link[WHERE perspective = $perspective AND predicate = '${l}' AND ${c} IN [${h}]]) = 0`)}else r.push(`count(->link[WHERE perspective = $perspective AND predicate = '${l}' AND ${c} = ${this.formatSurrealValue(u.not)}]) = 0`);(u.gt!==void 0||u.gte!==void 0||u.lt!==void 0||u.lte!==void 0||u.between!==void 0||u.contains!==void 0)&&r.push(`count(->link[WHERE perspective = $perspective AND predicate = '${l}']) > 0`)}else r.push(`count(->link[WHERE perspective = $perspective AND predicate = '${l}' AND ${c} = ${this.formatSurrealValue(a)}]) > 0`)}return r.join(" AND ")}static buildSurrealWhereClause(e,t){if(!t)return"";let r=[];for(let[n,a]of Object.entries(t))if(["base","author","timestamp"].includes(n)){if(n==="author"||n==="timestamp")continue;let o="source";if(Array.isArray(a)){let l=a.map(c=>this.formatSurrealValue(c)).join(", ");r.push(`${o} IN [${l}]`)}else if(typeof a=="object"&&a!==null){let l=a;if(l.not!==void 0)if(Array.isArray(l.not)){let c=l.not.map(u=>this.formatSurrealValue(u)).join(", ");r.push(`${o} NOT IN [${c}]`)}else r.push(`${o} != ${this.formatSurrealValue(l.not)}`);l.between!==void 0&&Array.isArray(l.between)&&l.between.length===2&&r.push(`${o} >= ${this.formatSurrealValue(l.between[0])} AND ${o} <= ${this.formatSurrealValue(l.between[1])}`),l.gt!==void 0&&r.push(`${o} > ${this.formatSurrealValue(l.gt)}`),l.gte!==void 0&&r.push(`${o} >= ${this.formatSurrealValue(l.gte)}`),l.lt!==void 0&&r.push(`${o} < ${this.formatSurrealValue(l.lt)}`),l.lte!==void 0&&r.push(`${o} <= ${this.formatSurrealValue(l.lte)}`),l.contains!==void 0&&r.push(`${o} CONTAINS ${this.formatSurrealValue(l.contains)}`)}else r.push(`${o} = ${this.formatSurrealValue(a)}`)}else{let o=e.properties[n];if(!o)continue;let l=oe(o.predicate),c=o.resolveLanguage==="literal"?"fn::parse_literal(target)":"target";if(Array.isArray(a)){let u=a.map(m=>this.formatSurrealValue(m)).join(", ");r.push(`source IN (SELECT VALUE source FROM link WHERE predicate = '${l}' AND ${c} IN [${u}])`)}else if(typeof a=="object"&&a!==null){let u=a;if(u.not!==void 0)if(Array.isArray(u.not)){let h=u.not.map(d=>this.formatSurrealValue(d)).join(", ");r.push(`source NOT IN (SELECT VALUE source FROM link WHERE predicate = '${l}' AND ${c} IN [${h}])`)}else r.push(`source NOT IN (SELECT VALUE source FROM link WHERE predicate = '${l}' AND ${c} = ${this.formatSurrealValue(u.not)})`);(u.gt!==void 0||u.gte!==void 0||u.lt!==void 0||u.lte!==void 0||u.between!==void 0||u.contains!==void 0)&&r.push(`source IN (SELECT VALUE source FROM link WHERE predicate = '${l}')`)}else r.push(`source IN (SELECT VALUE source FROM link WHERE predicate = '${l}' AND ${c} = ${this.formatSurrealValue(a)})`)}return r.join(" AND ")}static buildSurrealSelectFields(e,t,r){let n=[],a=t||Object.keys(e.properties);for(let o of a){let l=e.properties[o];if(!l)continue;let c=oe(l.predicate);n.push(`(SELECT VALUE target FROM link WHERE source = source AND predicate = '${c}' LIMIT 1) AS ${o}`)}let s=r||Object.keys(e.collections);for(let o of s){let l=e.collections[o];if(!l)continue;let c=oe(l.predicate);n.push(`(SELECT VALUE target FROM link WHERE source = source AND predicate = '${c}') AS ${o}`)}return n.push("(SELECT VALUE author FROM link WHERE source = source ORDER BY timestamp ASC LIMIT 1) AS author"),n.push("(SELECT VALUE timestamp FROM link WHERE source = source ORDER BY timestamp ASC LIMIT 1) AS createdAt"),n.push("(SELECT VALUE timestamp FROM link WHERE source = source ORDER BY timestamp DESC LIMIT 1) AS updatedAt"),n.join(`,
1932
+ `)}static buildSurrealSelectFieldsWithAggregation(e,t,r){let n=[],a=t||Object.keys(e.properties);for(let o of a){let l=e.properties[o];if(!l)continue;let c=oe(l.predicate);n.push(`array::first(target[WHERE predicate = '${c}']) AS ${o}`)}let s=r||Object.keys(e.collections);for(let o of s){let l=e.collections[o];if(!l)continue;let c=oe(l.predicate);n.push(`target[WHERE predicate = '${c}'] AS ${o}`)}return n.push("array::first(author) AS author"),n.push("array::first(timestamp) AS createdAt"),n.push("array::last(timestamp) AS updatedAt"),n.join(`,
1933
+ `)}static formatSurrealValue(e){return typeof e=="string"?`'${e.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")}'`:typeof e=="number"||typeof e=="boolean"?String(e):Array.isArray(e)?`[${e.map(t=>this.formatSurrealValue(t)).join(", ")}]`:String(e)}static async instancesFromPrologResult(e,t,r){if(!r?.[0]?.AllInstances)return{results:[],totalCount:0};let n=[...t?.properties||[],...t?.collections||[]];return{results:(await Promise.all(r[0].AllInstances.map(async([s,o,l,c,u])=>{try{let m=new this(e,s);n.length&&Object.keys(m).forEach(d=>{n.includes(d)||delete m[d]});let h=[...o,...l,["createdAt",c],["author",u]];return await Ni.assignValuesToInstance(e,m,h),m}catch(m){return console.error(`Failed to process instance ${s}:`,m),null}}))).filter(s=>s!==null),totalCount:r[0].TotalCount}}static async instancesFromSurrealResult(e,t,r){if(!r||r.length===0)return{results:[],totalCount:0};let n=this.getModelMetadata(),a=t?.properties||[],s=t?.collections||[],o=[];for(let h of r){let d;try{if(d=h.source_uri,!d)continue;let g=h.links||[],v=new this(e,d),E=null,A=null,C=null,O=null;for(let $=0;$<g.length;$++){let T=g[$],G=T.predicate,I=T.target;if(I==="None")continue;T.timestamp&&((!E||T.timestamp<E)&&(E=T.timestamp,C=T.author),(!A||T.timestamp>A)&&(A=T.timestamp,O=T.author));let K=!1;for(let[N,k]of Object.entries(n.properties))if(!k.getter&&k.predicate===G){let D=v[N],Ue=typeof D=="object"&&D!==null&&!Array.isArray(D)&&Object.keys(D).length===0;if(!D||D===""||D===0||Ue){let Ie=I;if(I!=null&&I!==""){if(k.resolveLanguage!=null&&k.resolveLanguage!=="literal"&&typeof I=="string")try{let Se=await e.getExpression(I);if(Se)try{Ie=JSON.parse(Se.data)}catch{Ie=Se.data}}catch(Se){console.warn(`Failed to resolve expression for ${N} with target "${I}":`,Se),console.warn("Falling back to raw value"),Ie=I}else if(typeof I=="string"&&I.startsWith("literal://"))try{let Se=Le.fromUrl(I).get();Se.data!==void 0?Ie=Se.data:Ie=Se}catch{Ie=I}else if(typeof I=="string"){let Se=typeof v[N];Se==="number"?Ie=Number(I):Se==="boolean"&&(Ie=I==="true"||I==="1")}}k.transform&&typeof k.transform=="function"&&(Ie=k.transform(Ie)),v[N]=Ie}K=!0;break}if(!K){for(let[N,k]of Object.entries(n.collections))if(!k.getter&&k.predicate===G){v[N]||(v[N]=[]);let D=`__${N}_timestamps`,Ue=`__${N}_indices`;v[D]||(v[D]=[]),v[Ue]||(v[Ue]=[]),v[N].includes(I)||(v[N].push(I),v[D].push(T.timestamp||""),v[Ue].push($));break}}}if(C&&(v.author=C),E)if(typeof E=="string"&&E.includes("T"))v.createdAt=new Date(E).getTime();else if(typeof E=="string"){let $=parseInt(E,10);v.createdAt=isNaN($)?E:$}else v.createdAt=E;if(A)if(typeof A=="string"&&A.includes("T"))v.updatedAt=new Date(A).getTime();else if(typeof A=="string"){let $=parseInt(A,10);v.updatedAt=isNaN($)?A:$}else v.updatedAt=A;for(let[$,T]of Object.entries(n.collections)){let G=`__${$}_timestamps`,I=`__${$}_indices`;if(v[$]&&v[G]){let K=v[$].map((N,k)=>({value:N,timestamp:v[G][k]||"",originalIndex:v[I]?.[k]??k}));K.sort((N,k)=>{let D=String(N.timestamp||""),Ue=String(k.timestamp||""),Ie=D.localeCompare(Ue);return Ie!==0?Ie:N.originalIndex-k.originalIndex}),v[$]=K.map(N=>N.value).filter(N=>N!=null&&N!==""&&N!=="None"),delete v[G],delete v[I]}}if(a.length>0||s.length>0){let $=[...a,...s];Object.keys(v).forEach(T=>{!$.includes(T)&&T!=="createdAt"&&T!=="updatedAt"&&T!=="author"&&T!=="baseExpression"&&delete v[T]})}o.push(v)}catch(g){console.error(`Failed to process SurrealDB instance ${d}:`,g)}}for(let h of o)await this.evaluateCustomGettersForInstance(h,e,n);for(let h of o)for(let[d,g]of Object.entries(n.collections))if(g.where?.isInstance&&h[d]?.length>0)try{let v=g.where.isInstance,E=h[d],A=typeof v=="string"?v:v.prototype?.className||v.name,C=await e.getSubjectClassMetadataFromSDNA(A);if(!C)continue;let O=await e.batchCheckSubjectInstances(E,C);h[d]=O}catch{}let l=o;t.where&&(l=o.filter(h=>{for(let[d,g]of Object.entries(t.where))if(d!=="base"){if(d==="author"||d==="timestamp"){if(!this.matchesCondition(h[d],g))return!1;continue}if(typeof g=="object"&&g!==null&&!Array.isArray(g)){let v=g;if((v.gt!==void 0||v.gte!==void 0||v.lt!==void 0||v.lte!==void 0||v.between!==void 0||v.contains!==void 0)&&!this.matchesCondition(h[d],g))return!1}}return!0}));let c=t.order||(t.limit!==void 0||t.offset!==void 0?{timestamp:"ASC"}:null);if(c){let h=Object.keys(c)[0],d=Object.values(c)[0];l.sort((g,v)=>{let E=g[h],A=v[h];if(E===void 0&&A===void 0)return 0;if(E===void 0)return d==="ASC"?1:-1;if(A===void 0)return d==="ASC"?-1:1;let C=0;return typeof E=="number"&&typeof A=="number"?C=E-A:typeof E=="string"&&typeof A=="string"?C=E.localeCompare(A):C=String(E).localeCompare(String(A)),d==="DESC"?-C:C})}let u=l.length,m=l;if(t.offset!==void 0||t.limit!==void 0){let h=t.offset||0,d=t.limit?h+t.limit:void 0;m=l.slice(h,d)}return{results:m,totalCount:u}}static matchesCondition(e,t){if(Array.isArray(t))return t.includes(e);if(typeof t=="object"&&t!==null){let r=t;if(r.not!==void 0)return Array.isArray(r.not)?!r.not.includes(e):e!==r.not;if(r.between!==void 0&&Array.isArray(r.between)&&r.between.length===2)return e>=r.between[0]&&e<=r.between[1];let n=!0;return r.gt!==void 0&&(n=n&&e>r.gt),r.gte!==void 0&&(n=n&&e>=r.gte),r.lt!==void 0&&(n=n&&e<r.lt),r.lte!==void 0&&(n=n&&e<=r.lte),r.contains!==void 0&&(typeof e=="string"?n=n&&e.includes(String(r.contains)):Array.isArray(e)?n=n&&e.includes(r.contains):n=!1),n}return e===t}static async findAll(e,t={},r=!0){if(r){let n=await this.queryToSurrealQL(e,t),a=await e.querySurrealDB(n),{results:s}=await this.instancesFromSurrealResult(e,t,a);return s}else{let n=await this.queryToProlog(e,t),a=await e.infer(n),{results:s}=await this.instancesFromPrologResult(e,t,a);return s}}static async findAllAndCount(e,t={},r=!0){if(r){let n=await this.queryToSurrealQL(e,t),a=await e.querySurrealDB(n);return await this.instancesFromSurrealResult(e,t,a)}else{let n=await this.queryToProlog(e,t),a=await e.infer(n);return await this.instancesFromPrologResult(e,t,a)}}static async paginate(e,t,r,n,a=!0){let s={...n||{},limit:t,offset:t*(r-1),count:!0};if(a){let o=await this.queryToSurrealQL(e,s),l=await e.querySurrealDB(o),{results:c,totalCount:u}=await this.instancesFromSurrealResult(e,s,l);return{results:c,totalCount:u,pageSize:t,pageNumber:r}}else{let o=await this.queryToProlog(e,s),l=await e.infer(o),{results:c,totalCount:u}=await this.instancesFromPrologResult(e,s,l);return{results:c,totalCount:u,pageSize:t,pageNumber:r}}}static async countQueryToProlog(e,t={},r){let{source:n,where:a}=t,s=r||await this.getClassName(e),o=[Jc(),Zc(n),Yc(a)],l=[Xc(!0),el(),tl(),il()];return`
1933
1934
  findall([Base, Properties, Collections, Timestamp, Author], (
1934
1935
  subject_class("${s}", SubjectClass),
1935
1936
  instance(SubjectClass, Base),
1936
1937
  ${o.filter(u=>u).join(", ")}
1937
1938
  ), UnsortedInstances),
1938
- ${c.filter(u=>u).join(", ")}
1939
- `}static async countQueryToSurrealQL(e,t){let r={...t};return delete r.limit,delete r.offset,await this.queryToSurrealQL(e,r)}static async count(e,t={},r=!0){if(r){let n=await this.queryToSurrealQL(e,t),a=await e.querySurrealDB(n),{totalCount:s}=await this.instancesFromSurrealResult(e,t,a);return s}else return(await e.infer(await this.countQueryToProlog(e,t)))?.[0]?.TotalCount||0}async setProperty(e,t,r){let n=this.getPropertyMetadata(e);if(!n){console.warn(`Property "${e}" has no metadata, skipping`);return}let a=this.generatePropertySetterAction(e,n),s=n.resolveLanguage;s&&(t=await ie(this,ge,"f").createExpression(t,s)),await ie(this,ge,"f").executeAction(a,ie(this,Ve,"f"),[{name:"value",value:t}],r)}async setCollectionSetter(e,t,r){if(!this.getCollectionMetadata(e)){console.warn(`Collection "${e}" has no metadata, skipping`);return}let a=this.generateCollectionAction(e,"setter");t!=null&&(Array.isArray(t)?await ie(this,ge,"f").executeAction(a,ie(this,Ve,"f"),t.map(s=>({name:"value",value:s})),r):await ie(this,ge,"f").executeAction(a,ie(this,Ve,"f"),[{name:"value",value:t}],r))}async setCollectionAdder(e,t,r){if(!this.getCollectionMetadata(e)){console.warn(`Collection "${e}" has no metadata, skipping`);return}let a=this.generateCollectionAction(e,"adder");t!=null&&(Array.isArray(t)?await Promise.all(t.map(s=>ie(this,ge,"f").executeAction(a,ie(this,Ve,"f"),[{name:"value",value:s}],r))):await ie(this,ge,"f").executeAction(a,ie(this,Ve,"f"),[{name:"value",value:t}],r))}async setCollectionRemover(e,t,r){if(!this.getCollectionMetadata(e)){console.warn(`Collection "${e}" has no metadata, skipping`);return}let a=this.generateCollectionAction(e,"remover");t!=null&&(Array.isArray(t)?await Promise.all(t.map(s=>ie(this,ge,"f").executeAction(a,ie(this,Ve,"f"),[{name:"value",value:s}],r))):await ie(this,ge,"f").executeAction(a,ie(this,Ve,"f"),[{name:"value",value:t}],r))}async save(e){let t=!1;e||(e=await this.perspective.createBatch(),t=!0);let r={};for(let[n,a]of Object.entries(this))a!=null&&!(Array.isArray(a)&&a.length>0)&&!a?.action&&(r[n]=a);await this.perspective.createSubject(this,ie(this,Ve,"f"),r,e),await ie(this,ge,"f").add(new Oi({source:ie(this,ma,"f"),predicate:"ad4m://has_child",target:this.baseExpression}),"shared",e),await this.innerUpdate(!1,e),t&&(await this.perspective.commitBatch(e),await this.getData())}cleanCopy(){let e={},t=Object.entries(this);for(let[r,n]of t)n!=null&&r!=="author"&&r!=="timestamp"&&(e[r]=n);return e}async innerUpdate(e=!0,t){Fr(this,ga,await ie(this,ge,"f").stringOrTemplateObjectToSubjectClassName(this.cleanCopy()),"f");let r=Object.entries(this);for(let[n,a]of r)if(a!=null){if(a?.action)switch(a.action){case"setter":await this.setCollectionSetter(n,a.value,t);break;case"adder":await this.setCollectionAdder(n,a.value,t);break;case"remover":await this.setCollectionRemover(n,a.value,t);break;default:await this.setCollectionSetter(n,a.value,t);break}else if(Array.isArray(a))await this.setCollectionSetter(n,a,t);else if(a!=null&&a!==""&&e){if(this.getCollectionMetadata(n))continue;await this.setProperty(n,a,t)}}}async update(e){await this.innerUpdate(!0,e),await this.getData()}async get(){return Fr(this,ga,await ie(this,ge,"f").stringOrTemplateObjectToSubjectClassName(this.cleanCopy()),"f"),await this.getData()}async delete(e){await ie(this,ge,"f").removeSubject(this,ie(this,Ve,"f"),e)}static query(e,t){return new ro(e,this,t)}static fromJSONSchema(e,t){if(e?.properties&&Object.prototype.hasOwnProperty.call(e.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(e,t),n=class extends Ni{};if(!t.name||t.name.trim()==="")throw new Error("options.name is required and cannot be empty");n.className=t.name,n.prototype.className=t.name;let a={},s={};if(e.properties)for(let[l,u]of Object.entries(e.properties)){let m=this.determinePredicate(e,l,u,r,t),h=e.required?.includes(l)||!1,d=_o(u.type);if(nl(u)){s[l]={through:m,local:this.getPropertyOption(l,u,t,"local")},Object.defineProperty(n.prototype,l,{configurable:!0,writable:!0,value:[]});let v=`add${ya(l)}`,E=`remove${ya(l)}`,$=`setCollection${ya(l)}`;n.prototype[v]=function(){},n.prototype[E]=function(){},n.prototype[$]=function(){}}else{let v=this.getPropertyOption(l,u,t,"resolveLanguage");!v&&t.resolveLanguage&&(v=t.resolveLanguage);let E=this.getPropertyOption(l,u,t,"local"),$=this.getPropertyOption(l,u,t,"writable",!0),N=this.getPropertyOption(l,u,t,"initial");if(al(u)&&!v&&(v="literal",console.warn(`Property "${l}" is an object type. It will be stored as JSON. Consider flattening complex objects for better semantic querying.`)),v==null&&qh(u)&&(v="literal"),h&&!N&&(al(u)?N="literal://json:{}":N="ad4m://undefined"),a[l]={through:m,required:h,writable:$,...v&&{resolveLanguage:v},...E!==void 0&&{local:E},...N&&{initial:N}},Object.defineProperty(n.prototype,l,{configurable:!0,writable:!0,value:this.getDefaultValueForType(d)}),$){let O=oo(l);n.prototype[O]=function(){}}}}if(!Object.values(a).some(l=>l.initial)){let l="ad4m://type",u;if(r.includes("://")){let[m,h]=r.split("://"),d=(h||"").replace(/\/+$/,"");d?u=`${m}://${d}/instance`:u=`${m}://instance`}else u=`${r.replace(/\/+$/,"")}/instance`;a.__ad4m_type={through:l,required:!0,writable:!1,initial:u,flag:!0},Object.defineProperty(n.prototype,"__ad4m_type",{configurable:!0,writable:!1,value:u}),console.warn(`No properties with initial values found. Added automatic type flag: ${l} = ${u}`)}return n.prototype.__properties=a,n.prototype.__collections=s,n.prototype.__jsonSchema=e,n.prototype.__jsonSchemaOptions=t,Fh({name:t.name})(n),n}static determineNamespace(e,t){if(t.namespace)return t.namespace;if(e["x-ad4m"]?.namespace)return e["x-ad4m"].namespace;if(e.title)return`${e.title.toLowerCase()}://`;if(e.$id)try{let n=new URL(e.$id).pathname.split("/").filter(a=>a);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:
1939
+ ${l.filter(u=>u).join(", ")}
1940
+ `}static async countQueryToSurrealQL(e,t){let r={...t};return delete r.limit,delete r.offset,await this.queryToSurrealQL(e,r)}static async count(e,t={},r=!0){if(r){let n=await this.queryToSurrealQL(e,t),a=await e.querySurrealDB(n),{totalCount:s}=await this.instancesFromSurrealResult(e,t,a);return s}else return(await e.infer(await this.countQueryToProlog(e,t)))?.[0]?.TotalCount||0}async setProperty(e,t,r){let n=this.getPropertyMetadata(e);if(!n){console.warn(`Property "${e}" has no metadata, skipping`);return}let a=this.generatePropertySetterAction(e,n),s=n.resolveLanguage;s&&(t=await J(this,ce,"f").createExpression(t,s)),await J(this,ce,"f").executeAction(a,J(this,De,"f"),[{name:"value",value:t}],r)}async setCollectionSetter(e,t,r){if(!this.getCollectionMetadata(e)){console.warn(`Collection "${e}" has no metadata, skipping`);return}let a=this.generateCollectionAction(e,"setter");t!=null&&(Array.isArray(t)?await J(this,ce,"f").executeAction(a,J(this,De,"f"),t.map(s=>({name:"value",value:s})),r):await J(this,ce,"f").executeAction(a,J(this,De,"f"),[{name:"value",value:t}],r))}async setCollectionAdder(e,t,r){if(!this.getCollectionMetadata(e)){console.warn(`Collection "${e}" has no metadata, skipping`);return}let a=this.generateCollectionAction(e,"adder");t!=null&&(Array.isArray(t)?await Promise.all(t.map(s=>J(this,ce,"f").executeAction(a,J(this,De,"f"),[{name:"value",value:s}],r))):await J(this,ce,"f").executeAction(a,J(this,De,"f"),[{name:"value",value:t}],r))}async setCollectionRemover(e,t,r){if(!this.getCollectionMetadata(e)){console.warn(`Collection "${e}" has no metadata, skipping`);return}let a=this.generateCollectionAction(e,"remover");t!=null&&(Array.isArray(t)?await Promise.all(t.map(s=>J(this,ce,"f").executeAction(a,J(this,De,"f"),[{name:"value",value:s}],r))):await J(this,ce,"f").executeAction(a,J(this,De,"f"),[{name:"value",value:t}],r))}async save(e){let t=!1;e||(e=await this.perspective.createBatch(),t=!0);let r={};for(let[n,a]of Object.entries(this))a!=null&&!(Array.isArray(a)&&a.length>0)&&!a?.action&&(r[n]=a);await this.perspective.createSubject(this,J(this,De,"f"),r,e),await J(this,ce,"f").add(new Oi({source:J(this,ma,"f"),predicate:"ad4m://has_child",target:this.baseExpression}),"shared",e),await this.innerUpdate(!1,e),t&&(await this.perspective.commitBatch(e),await this.getData())}cleanCopy(){let e={},t=Object.entries(this);for(let[r,n]of t)n!=null&&r!=="author"&&r!=="timestamp"&&(e[r]=n);return e}async innerUpdate(e=!0,t){Fr(this,ga,await J(this,ce,"f").stringOrTemplateObjectToSubjectClassName(this.cleanCopy()),"f");let r=Object.entries(this);for(let[n,a]of r)if(a!=null){if(a?.action)switch(a.action){case"setter":await this.setCollectionSetter(n,a.value,t);break;case"adder":await this.setCollectionAdder(n,a.value,t);break;case"remover":await this.setCollectionRemover(n,a.value,t);break;default:await this.setCollectionSetter(n,a.value,t);break}else if(Array.isArray(a))await this.setCollectionSetter(n,a,t);else if(a!=null&&a!==""&&e){if(this.getCollectionMetadata(n))continue;await this.setProperty(n,a,t)}}}async update(e){await this.innerUpdate(!0,e),await this.getData()}async get(){return Fr(this,ga,await J(this,ce,"f").stringOrTemplateObjectToSubjectClassName(this.cleanCopy()),"f"),await this.getData()}async delete(e){await J(this,ce,"f").removeSubject(this,J(this,De,"f"),e)}static query(e,t){return new ro(e,this,t)}static fromJSONSchema(e,t){if(e?.properties&&Object.prototype.hasOwnProperty.call(e.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(e,t),n=class extends Ni{};if(!t.name||t.name.trim()==="")throw new Error("options.name is required and cannot be empty");n.className=t.name,n.prototype.className=t.name;let a={},s={};if(e.properties)for(let[c,u]of Object.entries(e.properties)){let m=this.determinePredicate(e,c,u,r,t),h=e.required?.includes(c)||!1,d=_o(u.type);if(nl(u)){s[c]={through:m,local:this.getPropertyOption(c,u,t,"local")},Object.defineProperty(n.prototype,c,{configurable:!0,writable:!0,value:[]});let v=`add${ya(c)}`,E=`remove${ya(c)}`,A=`setCollection${ya(c)}`;n.prototype[v]=function(){},n.prototype[E]=function(){},n.prototype[A]=function(){}}else{let v=this.getPropertyOption(c,u,t,"resolveLanguage");!v&&t.resolveLanguage&&(v=t.resolveLanguage);let E=this.getPropertyOption(c,u,t,"local"),A=this.getPropertyOption(c,u,t,"writable",!0),C=this.getPropertyOption(c,u,t,"initial");if(al(u)&&!v&&(v="literal",console.warn(`Property "${c}" is an object type. It will be stored as JSON. Consider flattening complex objects for better semantic querying.`)),v==null&&qh(u)&&(v="literal"),h&&!C&&(al(u)?C="literal://json:{}":C="ad4m://undefined"),a[c]={through:m,required:h,writable:A,...v&&{resolveLanguage:v},...E!==void 0&&{local:E},...C&&{initial:C}},Object.defineProperty(n.prototype,c,{configurable:!0,writable:!0,value:this.getDefaultValueForType(d)}),A){let O=oo(c);n.prototype[O]=function(){}}}}if(!Object.values(a).some(c=>c.initial)){let c="ad4m://type",u;if(r.includes("://")){let[m,h]=r.split("://"),d=(h||"").replace(/\/+$/,"");d?u=`${m}://${d}/instance`:u=`${m}://instance`}else u=`${r.replace(/\/+$/,"")}/instance`;a.__ad4m_type={through:c,required:!0,writable:!1,initial:u,flag:!0},Object.defineProperty(n.prototype,"__ad4m_type",{configurable:!0,writable:!1,value:u}),console.warn(`No properties with initial values found. Added automatic type flag: ${c} = ${u}`)}return n.prototype.__properties=a,n.prototype.__collections=s,n.prototype.__jsonSchema=e,n.prototype.__jsonSchemaOptions=t,Fh({name:t.name})(n),n}static determineNamespace(e,t){if(t.namespace)return t.namespace;if(e["x-ad4m"]?.namespace)return e["x-ad4m"].namespace;if(e.title)return`${e.title.toLowerCase()}://`;if(e.$id)try{let n=new URL(e.$id).pathname.split("/").filter(a=>a);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:
1940
1941
  - options.namespace
1941
1942
  - schema["x-ad4m"].namespace
1942
1943
  - schema.title
1943
- - valid schema.$id`)}static determinePredicate(e,t,r,n,a){if(a.propertyMapping?.[t])return a.propertyMapping[t];if(r["x-ad4m"]?.through)return r["x-ad4m"].through;if(a.predicateTemplate){let o=rl(n),[c,l]=o.includes("://")?o.split("://"):["",o],u=l||"";return a.predicateTemplate.replace("${namespace}",u).replace("${scheme}",c).replace("${ns}",u).replace("${title}",e.title||"").replace("${property}",t)}if(a.predicateGenerator)return a.predicateGenerator(e.title||"",t);let s=rl(n);return s.includes("://")?`${s}${t}`:`${s}://${t}`}static getPropertyOption(e,t,r,n,a){return r.propertyOptions?.[e]?.[n]!==void 0?r.propertyOptions[e][n]:t["x-ad4m"]?.[n]!==void 0?t["x-ad4m"][n]:r[n]!==void 0?r[n]:a}static getDefaultValueForType(e){switch(e){case"string":return"";case"number":return 0;case"integer":return 0;case"boolean":return!1;case"array":return[];case"object":return{};default:return""}}};Ve=new WeakMap,ga=new WeakMap,ma=new WeakMap,ge=new WeakMap;Ni.classNamesByClass=new WeakMap;var ro=class{constructor(e,t,r){this.queryParams={},this.modelClassName=null,this.useSurrealDBFlag=!0,this.perspective=e,this.ctor=t,r&&(this.queryParams=r)}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}useSurrealDB(e=!0){return this.useSurrealDBFlag=e,this}async get(){if(this.useSurrealDBFlag){let e=await this.ctor.queryToSurrealQL(this.perspective,this.queryParams),t=await this.perspective.querySurrealDB(e),{results:r}=await this.ctor.instancesFromSurrealResult(this.perspective,this.queryParams,t);return r}else{let e=await this.ctor.queryToProlog(this.perspective,this.queryParams,this.modelClassName),t=await this.perspective.infer(e),{results:r}=await this.ctor.instancesFromPrologResult(this.perspective,this.queryParams,t);return r}}async subscribe(e){if(this.dispose(),this.useSurrealDBFlag){let t=await this.ctor.queryToSurrealQL(this.perspective,this.queryParams);this.currentSubscription=await this.perspective.subscribeSurrealDB(t);let r=async a=>{let{results:s}=await this.ctor.instancesFromSurrealResult(this.perspective,this.queryParams,a);e(s)};this.currentSubscription.onResult(r);let{results:n}=await this.ctor.instancesFromSurrealResult(this.perspective,this.queryParams,this.currentSubscription.result);return n}else{let t=await this.ctor.queryToProlog(this.perspective,this.queryParams,this.modelClassName);this.currentSubscription=await this.perspective.subscribeInfer(t);let r=async a=>{let{results:s}=await this.ctor.instancesFromPrologResult(this.perspective,this.queryParams,a);e(s)};this.currentSubscription.onResult(r);let{results:n}=await this.ctor.instancesFromPrologResult(this.perspective,this.queryParams,this.currentSubscription.result);return n}}async count(){if(this.useSurrealDBFlag){let e=await this.ctor.queryToSurrealQL(this.perspective,this.queryParams),t=await this.perspective.querySurrealDB(e),{totalCount:r}=await this.ctor.instancesFromSurrealResult(this.perspective,this.queryParams,t);return r}else{let e=await this.ctor.countQueryToProlog(this.perspective,this.queryParams,this.modelClassName);return(await this.perspective.infer(e))?.[0]?.TotalCount||0}}async countSubscribe(e){if(this.dispose(),this.useSurrealDBFlag){let t=await this.ctor.queryToSurrealQL(this.perspective,this.queryParams);this.currentSubscription=await this.perspective.subscribeSurrealDB(t);let r=async a=>{let{totalCount:s}=await this.ctor.instancesFromSurrealResult(this.perspective,this.queryParams,a);e(s)};this.currentSubscription.onResult(r);let{totalCount:n}=await this.ctor.instancesFromSurrealResult(this.perspective,this.queryParams,this.currentSubscription.result);return n}else{let t=await this.ctor.countQueryToProlog(this.perspective,this.queryParams,this.modelClassName);this.currentSubscription=await this.perspective.subscribeInfer(t);let r=async n=>{let a=n?.[0]?.TotalCount||0;e(a)};return this.currentSubscription.onResult(r),this.currentSubscription.result?.[0]?.TotalCount||0}}async paginate(e,t){let r={...this.queryParams||{},limit:e,offset:e*(t-1),count:!0};if(this.useSurrealDBFlag){let n=await this.ctor.queryToSurrealQL(this.perspective,r),a=await this.perspective.querySurrealDB(n),{results:s,totalCount:o}=await this.ctor.instancesFromSurrealResult(this.perspective,r,a);return{results:s,totalCount:o,pageSize:e,pageNumber:t}}else{let n=await this.ctor.queryToProlog(this.perspective,r,this.modelClassName),a=await this.perspective.infer(n),{results:s,totalCount:o}=await this.ctor.instancesFromPrologResult(this.perspective,r,a);return{results:s,totalCount:o,pageSize:e,pageNumber:t}}}async paginateSubscribe(e,t,r){this.dispose();let n={...this.queryParams||{},limit:e,offset:e*(t-1),count:!0};if(this.useSurrealDBFlag){let a=await this.ctor.queryToSurrealQL(this.perspective,n);this.currentSubscription=await this.perspective.subscribeSurrealDB(a);let s=async l=>{let{results:u,totalCount:m}=await this.ctor.instancesFromSurrealResult(this.perspective,n,l);r({results:u,totalCount:m,pageSize:e,pageNumber:t})};this.currentSubscription.onResult(s);let{results:o,totalCount:c}=await this.ctor.instancesFromSurrealResult(this.perspective,n,this.currentSubscription.result);return{results:o,totalCount:c,pageSize:e,pageNumber:t}}else{let a=await this.ctor.queryToProlog(this.perspective,n,this.modelClassName);this.currentSubscription=await this.perspective.subscribeInfer(a);let s=async l=>{let{results:u,totalCount:m}=await this.ctor.instancesFromPrologResult(this.perspective,this.queryParams,l);r({results:u,totalCount:m,pageSize:e,pageNumber:t})};this.currentSubscription.onResult(s);let{results:o,totalCount:c}=await this.ctor.instancesFromPrologResult(this.perspective,n,this.currentSubscription.result);return{results:o,totalCount:c,pageSize:e,pageNumber:t}}}};var gt=class extends Re{constructor(){super(...arguments);this.capabilities=[];this.appname="";this.appiconpath="";this.verificationError=!1;this.requestSent=!1;this.securityCode=""}back(){this.dispatchEvent(new CustomEvent("back",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("clear-verification-error",{bubbles:!0,composed:!0}))}requestCapability(){this.dispatchEvent(new CustomEvent("request-capability",{bubbles:!0,composed:!0})),this.requestSent=!0}verifyCode(){this.dispatchEvent(new CustomEvent("verify-code",{detail:{code:this.securityCode},bubbles:!0,composed:!0}))}onInputChange(t){this.dispatchEvent(new CustomEvent("clear-verification-error",{bubbles:!0,composed:!0}));let r=t.target,n=r.value.replace(/\D/g,"").slice(0,6);r.value=n,this.securityCode=n,this.securityCode.length===6&&this.verifyCode()}render(){return L`
1944
+ - valid schema.$id`)}static determinePredicate(e,t,r,n,a){if(a.propertyMapping?.[t])return a.propertyMapping[t];if(r["x-ad4m"]?.through)return r["x-ad4m"].through;if(a.predicateTemplate){let o=rl(n),[l,c]=o.includes("://")?o.split("://"):["",o],u=c||"";return a.predicateTemplate.replace("${namespace}",u).replace("${scheme}",l).replace("${ns}",u).replace("${title}",e.title||"").replace("${property}",t)}if(a.predicateGenerator)return a.predicateGenerator(e.title||"",t);let s=rl(n);return s.includes("://")?`${s}${t}`:`${s}://${t}`}static getPropertyOption(e,t,r,n,a){return r.propertyOptions?.[e]?.[n]!==void 0?r.propertyOptions[e][n]:t["x-ad4m"]?.[n]!==void 0?t["x-ad4m"][n]:r[n]!==void 0?r[n]:a}static getDefaultValueForType(e){switch(e){case"string":return"";case"number":return 0;case"integer":return 0;case"boolean":return!1;case"array":return[];case"object":return{};default:return""}}};De=new WeakMap,ga=new WeakMap,ma=new WeakMap,ce=new WeakMap;Ni.classNamesByClass=new WeakMap;var ro=class{constructor(e,t,r){this.queryParams={},this.modelClassName=null,this.useSurrealDBFlag=!0,this.perspective=e,this.ctor=t,r&&(this.queryParams=r)}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}useSurrealDB(e=!0){return this.useSurrealDBFlag=e,this}async get(){if(this.useSurrealDBFlag){let e=await this.ctor.queryToSurrealQL(this.perspective,this.queryParams),t=await this.perspective.querySurrealDB(e),{results:r}=await this.ctor.instancesFromSurrealResult(this.perspective,this.queryParams,t);return r}else{let e=await this.ctor.queryToProlog(this.perspective,this.queryParams,this.modelClassName),t=await this.perspective.infer(e),{results:r}=await this.ctor.instancesFromPrologResult(this.perspective,this.queryParams,t);return r}}async subscribe(e){if(this.dispose(),this.useSurrealDBFlag){let t=await this.ctor.queryToSurrealQL(this.perspective,this.queryParams);this.currentSubscription=await this.perspective.subscribeSurrealDB(t);let r=async a=>{let{results:s}=await this.ctor.instancesFromSurrealResult(this.perspective,this.queryParams,a);e(s)};this.currentSubscription.onResult(r);let{results:n}=await this.ctor.instancesFromSurrealResult(this.perspective,this.queryParams,this.currentSubscription.result);return n}else{let t=await this.ctor.queryToProlog(this.perspective,this.queryParams,this.modelClassName);this.currentSubscription=await this.perspective.subscribeInfer(t);let r=async a=>{let{results:s}=await this.ctor.instancesFromPrologResult(this.perspective,this.queryParams,a);e(s)};this.currentSubscription.onResult(r);let{results:n}=await this.ctor.instancesFromPrologResult(this.perspective,this.queryParams,this.currentSubscription.result);return n}}async count(){if(this.useSurrealDBFlag){let e=await this.ctor.queryToSurrealQL(this.perspective,this.queryParams),t=await this.perspective.querySurrealDB(e),{totalCount:r}=await this.ctor.instancesFromSurrealResult(this.perspective,this.queryParams,t);return r}else{let e=await this.ctor.countQueryToProlog(this.perspective,this.queryParams,this.modelClassName);return(await this.perspective.infer(e))?.[0]?.TotalCount||0}}async countSubscribe(e){if(this.dispose(),this.useSurrealDBFlag){let t=await this.ctor.queryToSurrealQL(this.perspective,this.queryParams);this.currentSubscription=await this.perspective.subscribeSurrealDB(t);let r=async a=>{let{totalCount:s}=await this.ctor.instancesFromSurrealResult(this.perspective,this.queryParams,a);e(s)};this.currentSubscription.onResult(r);let{totalCount:n}=await this.ctor.instancesFromSurrealResult(this.perspective,this.queryParams,this.currentSubscription.result);return n}else{let t=await this.ctor.countQueryToProlog(this.perspective,this.queryParams,this.modelClassName);this.currentSubscription=await this.perspective.subscribeInfer(t);let r=async n=>{let a=n?.[0]?.TotalCount||0;e(a)};return this.currentSubscription.onResult(r),this.currentSubscription.result?.[0]?.TotalCount||0}}async paginate(e,t){let r={...this.queryParams||{},limit:e,offset:e*(t-1),count:!0};if(this.useSurrealDBFlag){let n=await this.ctor.queryToSurrealQL(this.perspective,r),a=await this.perspective.querySurrealDB(n),{results:s,totalCount:o}=await this.ctor.instancesFromSurrealResult(this.perspective,r,a);return{results:s,totalCount:o,pageSize:e,pageNumber:t}}else{let n=await this.ctor.queryToProlog(this.perspective,r,this.modelClassName),a=await this.perspective.infer(n),{results:s,totalCount:o}=await this.ctor.instancesFromPrologResult(this.perspective,r,a);return{results:s,totalCount:o,pageSize:e,pageNumber:t}}}async paginateSubscribe(e,t,r){this.dispose();let n={...this.queryParams||{},limit:e,offset:e*(t-1),count:!0};if(this.useSurrealDBFlag){let a=await this.ctor.queryToSurrealQL(this.perspective,n);this.currentSubscription=await this.perspective.subscribeSurrealDB(a);let s=async c=>{let{results:u,totalCount:m}=await this.ctor.instancesFromSurrealResult(this.perspective,n,c);r({results:u,totalCount:m,pageSize:e,pageNumber:t})};this.currentSubscription.onResult(s);let{results:o,totalCount:l}=await this.ctor.instancesFromSurrealResult(this.perspective,n,this.currentSubscription.result);return{results:o,totalCount:l,pageSize:e,pageNumber:t}}else{let a=await this.ctor.queryToProlog(this.perspective,n,this.modelClassName);this.currentSubscription=await this.perspective.subscribeInfer(a);let s=async c=>{let{results:u,totalCount:m}=await this.ctor.instancesFromPrologResult(this.perspective,this.queryParams,c);r({results:u,totalCount:m,pageSize:e,pageNumber:t})};this.currentSubscription.onResult(s);let{results:o,totalCount:l}=await this.ctor.instancesFromPrologResult(this.perspective,n,this.currentSubscription.result);return{results:o,totalCount:l,pageSize:e,pageNumber:t}}}};var gt=class extends Re{constructor(){super(...arguments);this.capabilities=[];this.appname="";this.appiconpath="";this.verificationError=!1;this.requestSent=!1;this.securityCode=""}back(){this.dispatchEvent(new CustomEvent("back",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("clear-verification-error",{bubbles:!0,composed:!0}))}requestCapability(){this.dispatchEvent(new CustomEvent("request-capability",{bubbles:!0,composed:!0})),this.requestSent=!0}verifyCode(){this.dispatchEvent(new CustomEvent("verify-code",{detail:{code:this.securityCode},bubbles:!0,composed:!0}))}onInputChange(t){this.dispatchEvent(new CustomEvent("clear-verification-error",{bubbles:!0,composed:!0}));let r=t.target,n=r.value.replace(/\D/g,"").slice(0,6);r.value=n,this.securityCode=n,this.securityCode.length===6&&this.verifyCode()}render(){return L`
1944
1945
  <div class="container">
1945
1946
  <div class="back-button" @click=${this.back}>
1946
1947
  ${rr()}
@@ -1979,7 +1980,7 @@ WHERE ${m.join(" AND ")}
1979
1980
 
1980
1981
  ${this.verificationError?L`
1981
1982
  <div class="state danger" style="margin-top: -32px; margin-bottom: 20px;">
1982
- ${Ue()}
1983
+ ${Fe()}
1983
1984
  <p>Verification failed. Please try again.</p>
1984
1985
  </div>
1985
1986
  `:""}
@@ -2079,7 +2080,7 @@ WHERE ${m.join(" AND ")}
2079
2080
  .state {
2080
2081
  justify-content: center;
2081
2082
  }
2082
- `],j([de({type:Array})],gt.prototype,"capabilities",2),j([de({type:String})],gt.prototype,"appname",2),j([de({type:String})],gt.prototype,"appiconpath",2),j([de({type:Boolean})],gt.prototype,"verificationError",2),j([ce()],gt.prototype,"requestSent",2),j([ce()],gt.prototype,"securityCode",2),gt=j([mt("local-authentication")],gt);var at=class extends Re{constructor(){super(...arguments);this.remoteAuthState=null;this.remoteAuthLoading=!1;this.emailCodeError=!1;this.passwordError=!1;this.accountCreationError=!1;this.email="";this.password="";this.emailSecurityCode=""}back(){this.dispatchEvent(new CustomEvent("back",{bubbles:!0,composed:!0})),this.remoteAuthState=null,this.password="",this.emailSecurityCode=""}emailLogin(){this.dispatchEvent(new CustomEvent("email-login",{detail:{email:this.email.trim()},bubbles:!0,composed:!0}))}verifyEmailCode(){this.dispatchEvent(new CustomEvent("verify-email-code",{detail:{email:this.email.trim(),code:this.emailSecurityCode},bubbles:!0,composed:!0}))}passwordLogin(){this.dispatchEvent(new CustomEvent("password-login",{detail:{email:this.email.trim(),password:this.password},bubbles:!0,composed:!0}))}createAccount(){this.dispatchEvent(new CustomEvent("create-account",{detail:{email:this.email.trim(),password:this.password},bubbles:!0,composed:!0}))}onEmailSecurityCodeChange(t){this.dispatchEvent(new CustomEvent("clear-email-code-error",{bubbles:!0,composed:!0}));let r=t.target,n=r.value.replace(/\D/g,"").slice(0,6);r.value=n,this.emailSecurityCode=n,this.emailSecurityCode.length===6&&!this.remoteAuthLoading&&this.verifyEmailCode()}isValidEmail(){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(this.email.trim())}render(){let t=!this.remoteAuthState,r=this.remoteAuthState&&this.remoteAuthState.success&&!this.remoteAuthState.requiresPassword,n=this.remoteAuthState&&this.remoteAuthState.requiresPassword&&this.remoteAuthState.isExistingUser,a=this.remoteAuthState&&this.remoteAuthState.requiresPassword&&!this.remoteAuthState.isExistingUser,s=this.remoteAuthState&&!this.remoteAuthState.success&&!this.remoteAuthState.requiresPassword;return L`
2083
+ `],j([pe({type:Array})],gt.prototype,"capabilities",2),j([pe({type:String})],gt.prototype,"appname",2),j([pe({type:String})],gt.prototype,"appiconpath",2),j([pe({type:Boolean})],gt.prototype,"verificationError",2),j([le()],gt.prototype,"requestSent",2),j([le()],gt.prototype,"securityCode",2),gt=j([mt("local-authentication")],gt);var at=class extends Re{constructor(){super(...arguments);this.remoteAuthState=null;this.remoteAuthLoading=!1;this.emailCodeError=!1;this.passwordError=!1;this.accountCreationError=!1;this.email="";this.password="";this.emailSecurityCode=""}back(){this.dispatchEvent(new CustomEvent("back",{bubbles:!0,composed:!0})),this.remoteAuthState=null,this.password="",this.emailSecurityCode=""}emailLogin(){this.dispatchEvent(new CustomEvent("email-login",{detail:{email:this.email.trim()},bubbles:!0,composed:!0}))}verifyEmailCode(){this.dispatchEvent(new CustomEvent("verify-email-code",{detail:{email:this.email.trim(),code:this.emailSecurityCode},bubbles:!0,composed:!0}))}passwordLogin(){this.dispatchEvent(new CustomEvent("password-login",{detail:{email:this.email.trim(),password:this.password},bubbles:!0,composed:!0}))}createAccount(){this.dispatchEvent(new CustomEvent("create-account",{detail:{email:this.email.trim(),password:this.password},bubbles:!0,composed:!0}))}onEmailSecurityCodeChange(t){this.dispatchEvent(new CustomEvent("clear-email-code-error",{bubbles:!0,composed:!0}));let r=t.target,n=r.value.replace(/\D/g,"").slice(0,6);r.value=n,this.emailSecurityCode=n,this.emailSecurityCode.length===6&&!this.remoteAuthLoading&&this.verifyEmailCode()}isValidEmail(){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(this.email.trim())}render(){let t=!this.remoteAuthState,r=this.remoteAuthState&&this.remoteAuthState.success&&!this.remoteAuthState.requiresPassword,n=this.remoteAuthState&&this.remoteAuthState.requiresPassword&&this.remoteAuthState.isExistingUser,a=this.remoteAuthState&&this.remoteAuthState.requiresPassword&&!this.remoteAuthState.isExistingUser,s=this.remoteAuthState&&!this.remoteAuthState.success&&!this.remoteAuthState.requiresPassword;return L`
2083
2084
  <div class="container">
2084
2085
  <div class="back-button" @click=${this.back}>
2085
2086
  ${rr()}
@@ -2097,7 +2098,7 @@ WHERE ${m.join(" AND ")}
2097
2098
  type="email"
2098
2099
  placeholder="email@example.com"
2099
2100
  .value=${this.email||""}
2100
- @input=${o=>{let c=o.target;this.email=c.value}}
2101
+ @input=${o=>{let l=o.target;this.email=l.value}}
2101
2102
  @keydown=${o=>{o.key==="Enter"&&!this.remoteAuthLoading&&this.isValidEmail()&&this.emailLogin()}}
2102
2103
  />
2103
2104
  </div>
@@ -2111,7 +2112,7 @@ WHERE ${m.join(" AND ")}
2111
2112
 
2112
2113
  ${s?L`
2113
2114
  <div class="state danger">
2114
- ${Ue()}
2115
+ ${Fe()}
2115
2116
  <p>${this.remoteAuthState.message||"Failed to process email. Please try again."}</p>
2116
2117
  </div>
2117
2118
 
@@ -2144,7 +2145,7 @@ WHERE ${m.join(" AND ")}
2144
2145
 
2145
2146
  ${this.emailCodeError?L`
2146
2147
  <div class="state danger" style="margin-top: -32px; margin-bottom: 20px;">
2147
- ${Ue()}
2148
+ ${Fe()}
2148
2149
  <p>Verification failed. Please try again.</p>
2149
2150
  </div>
2150
2151
  `:""}
@@ -2163,7 +2164,7 @@ WHERE ${m.join(" AND ")}
2163
2164
  type="password"
2164
2165
  placeholder="Password..."
2165
2166
  .value=${this.password||""}
2166
- @input=${o=>{let c=o.target;this.password=c.value}}
2167
+ @input=${o=>{let l=o.target;this.password=l.value}}
2167
2168
  @keydown=${o=>{o.key==="Enter"&&!this.remoteAuthLoading&&this.password.length&&this.passwordLogin()}}
2168
2169
  />
2169
2170
  </div>
@@ -2176,7 +2177,7 @@ WHERE ${m.join(" AND ")}
2176
2177
 
2177
2178
  ${this.passwordError?L`
2178
2179
  <div class="state danger" style="margin-top: -32px; margin-bottom: 20px;">
2179
- ${Ue()}
2180
+ ${Fe()}
2180
2181
  <p>Incorrect password. Please try again.</p>
2181
2182
  </div>
2182
2183
  `:""}
@@ -2184,7 +2185,7 @@ WHERE ${m.join(" AND ")}
2184
2185
 
2185
2186
  ${a?L`
2186
2187
  <div class="state danger">
2187
- ${Ue()}
2188
+ ${Fe()}
2188
2189
  <p>Email not found</p>
2189
2190
  </div>
2190
2191
 
@@ -2195,7 +2196,7 @@ WHERE ${m.join(" AND ")}
2195
2196
  type="password"
2196
2197
  placeholder="Password..."
2197
2198
  .value=${this.password||""}
2198
- @input=${o=>{let c=o.target;this.password=c.value}}
2199
+ @input=${o=>{let l=o.target;this.password=l.value}}
2199
2200
  @keydown=${o=>{o.key==="Enter"&&!this.remoteAuthLoading&&this.password.length&&this.createAccount()}}
2200
2201
  />
2201
2202
  </div>
@@ -2208,7 +2209,7 @@ WHERE ${m.join(" AND ")}
2208
2209
 
2209
2210
  ${this.accountCreationError?L`
2210
2211
  <div class="state danger" style="margin-top: -32px; margin-bottom: 20px;">
2211
- ${Ue()}
2212
+ ${Fe()}
2212
2213
  <p>Failed to create account. Please try again.</p>
2213
2214
  </div>
2214
2215
  `:""}
@@ -2261,10 +2262,10 @@ WHERE ${m.join(" AND ")}
2261
2262
  .state {
2262
2263
  justify-content: center;
2263
2264
  }
2264
- `],j([de({type:Object})],at.prototype,"remoteAuthState",2),j([de({type:Boolean})],at.prototype,"remoteAuthLoading",2),j([de({type:Boolean})],at.prototype,"emailCodeError",2),j([de({type:Boolean})],at.prototype,"passwordError",2),j([de({type:Boolean})],at.prototype,"accountCreationError",2),j([ce()],at.prototype,"email",2),j([ce()],at.prototype,"password",2),j([ce()],at.prototype,"emailSecurityCode",2),at=j([mt("remote-authentication")],at);var ci=class extends Re{constructor(){super(...arguments);this.url="";this.port=12e3;this.authState="unauthenticated"}get connectionType(){return this.url.includes("localhost")||this.url.includes("127.0.0.1")?"local":"remote"}close(){this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0}))}disconnect(){this.dispatchEvent(new CustomEvent("disconnect",{bubbles:!0,composed:!0}))}render(){let t=this.connectionType==="local";return L`
2265
+ `],j([pe({type:Object})],at.prototype,"remoteAuthState",2),j([pe({type:Boolean})],at.prototype,"remoteAuthLoading",2),j([pe({type:Boolean})],at.prototype,"emailCodeError",2),j([pe({type:Boolean})],at.prototype,"passwordError",2),j([pe({type:Boolean})],at.prototype,"accountCreationError",2),j([le()],at.prototype,"email",2),j([le()],at.prototype,"password",2),j([le()],at.prototype,"emailSecurityCode",2),at=j([mt("remote-authentication")],at);var ci=class extends Re{constructor(){super(...arguments);this.url="";this.port=12e3;this.authState="unauthenticated"}get connectionType(){return this.url.includes("localhost")||this.url.includes("127.0.0.1")?"local":"remote"}close(){this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0}))}disconnect(){this.dispatchEvent(new CustomEvent("disconnect",{bubbles:!0,composed:!0}))}render(){let t=this.connectionType==="local";return L`
2265
2266
  <div class="container">
2266
2267
  <div class="close-button" @click=${this.close}>
2267
- ${Ue()}
2268
+ ${Fe()}
2268
2269
  </div>
2269
2270
 
2270
2271
  <div class="header">
@@ -2341,7 +2342,7 @@ WHERE ${m.join(" AND ")}
2341
2342
  background: rgba(244, 54, 127, 0.2);
2342
2343
  color: var(--ac-danger-color);
2343
2344
  }
2344
- `],j([de({type:String})],ci.prototype,"url",2),j([de({type:Number})],ci.prototype,"port",2),j([de({type:String})],ci.prototype,"authState",2),ci=j([mt("current-state")],ci);var Vh=Je`
2345
+ `],j([pe({type:String})],ci.prototype,"url",2),j([pe({type:Number})],ci.prototype,"port",2),j([pe({type:String})],ci.prototype,"authState",2),ci=j([mt("current-state")],ci);var Vh=Je`
2345
2346
  @import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;700&display=swap');
2346
2347
 
2347
2348
  :host {
@@ -2419,14 +2420,14 @@ WHERE ${m.join(" AND ")}
2419
2420
  padding: 0;
2420
2421
  cursor: pointer;
2421
2422
  position: fixed;
2422
- bottom: 20px;
2423
- right: 20px;
2423
+ bottom: 10px;
2424
+ right: 10px;
2424
2425
  color: var(--ac-primary-color);
2425
- width: 40px;
2426
- height: 40px;
2426
+ width: 34px;
2427
+ height: 34px;
2427
2428
  z-index: 99999;
2428
2429
  }
2429
- `,De=class extends Re{constructor(){super(...arguments);this.modalOpen=!1;this.currentView="connection-options";this.connectingToRemoteNode=!1;this.remoteNodeError=!1;this.verificationError=!1;this.remoteAuthLoading=!1;this.remoteAuthState=null;this.emailCodeError=!1;this.passwordError=!1;this.accountCreationError=!1}connectedCallback(){super.connectedCallback(),ds(this),this.core.addEventListener("authstatechange",t=>{t.detail==="unauthenticated"&&(this.currentView="connection-options",this.modalOpen=!0),this.requestUpdate()}),this.core.token?this.core.connect().catch(t=>{console.error("[Ad4m Connect UI] Auto-connect failed:",t),this.currentView="connection-options",this.modalOpen=!0}):(this.currentView="connection-options",this.modalOpen=!0)}changePort(t){return we(this,null,function*(){this.core.port=t.detail.port,On("ad4m-port",this.core.port.toString()),this.requestUpdate()})}connectLocalNode(){return we(this,null,function*(){this.core.url=`ws://localhost:${this.core.port}/graphql`,On("ad4m-url",this.core.url);try{yield this.core.connect(),this.currentView="local-authentication"}catch(t){console.error("[Ad4m Connect UI] Local node connection failed:",t),this.currentView="connection-options"}})}verifyLocalAd4mCode(t){return we(this,null,function*(){let r=yield this.core.verifyLocalAd4mCode(t.detail.code);this.verificationError=!r,r&&(this.modalOpen=!1)})}connectRemoteNode(t){return we(this,null,function*(){this.remoteNodeError=!1,this.connectingToRemoteNode=!0,this.core.url=t.detail.remoteUrl,On("ad4m-url",this.core.url);try{if(yield Dn(t.detail.remoteUrl),console.log("[Ad4m Connect UI] Remote connection successful"),!(yield this.core.isValidAd4mAPI()))throw new Error("Server is reachable but doesn't appear to be an AD4M executor");console.log("[Ad4m Connect UI] Remote AD4M API verified");let n=yield this.core.isMultiUser();console.log("[Ad4m Connect UI] Remote multi-user detected:",n),this.currentView="remote-authentication"}catch(r){console.error("[Ad4m Connect UI] Remote connection failed:",r),this.remoteNodeError=!0}finally{this.connectingToRemoteNode=!1}})}emailLogin(t){return we(this,null,function*(){try{this.remoteAuthLoading=!0,this.remoteAuthState=yield this.core.submitEmail(t.detail.email)}finally{this.remoteAuthLoading=!1}})}verifyEmailCode(t){return we(this,null,function*(){try{this.remoteAuthLoading=!0;let r=yield this.core.verifyEmailCode(t.detail.email,t.detail.code);this.emailCodeError=!r,r&&(this.modalOpen=!1)}catch(r){this.emailCodeError=!0}finally{this.remoteAuthLoading=!1}})}passwordLogin(t){return we(this,null,function*(){try{this.remoteAuthLoading=!0;let r=yield this.core.loginWithPassword(t.detail.email,t.detail.password);this.passwordError=!r,r&&(this.modalOpen=!1)}catch(r){this.passwordError=!0}finally{this.remoteAuthLoading=!1}})}createAccount(t){return we(this,null,function*(){try{this.remoteAuthLoading=!0;let r=yield this.core.createAccount(t.detail.email,t.detail.password);this.accountCreationError=!r,r&&(this.modalOpen=!1)}catch(r){this.accountCreationError=!0}finally{this.remoteAuthLoading=!1}})}disconnect(){return we(this,null,function*(){yield this.core.disconnect(),window.location.reload()})}renderViews(){if(this.currentView==="connection-options")return L`
2430
+ `,Me=class extends Re{constructor(){super(...arguments);this.modalOpen=!1;this.currentView="connection-options";this.connectingToRemoteNode=!1;this.remoteNodeError=!1;this.verificationError=!1;this.remoteAuthLoading=!1;this.remoteAuthState=null;this.emailCodeError=!1;this.passwordError=!1;this.accountCreationError=!1}connectedCallback(){super.connectedCallback(),ds(this),this.core.addEventListener("authstatechange",t=>{t.detail==="unauthenticated"&&(this.currentView="connection-options",this.modalOpen=!0),this.requestUpdate()}),this.core.token?this.core.connect().catch(t=>{console.error("[Ad4m Connect UI] Auto-connect failed:",t),this.currentView="connection-options",this.modalOpen=!0}):(this.currentView="connection-options",this.modalOpen=!0)}changePort(t){return we(this,null,function*(){this.core.port=t.detail.port,On("ad4m-port",this.core.port.toString()),this.requestUpdate()})}connectLocalNode(){return we(this,null,function*(){this.core.url=`ws://localhost:${this.core.port}/graphql`,On("ad4m-url",this.core.url);try{yield this.core.connect(),this.currentView="local-authentication"}catch(t){console.error("[Ad4m Connect UI] Local node connection failed:",t),this.currentView="connection-options"}})}verifyLocalAd4mCode(t){return we(this,null,function*(){let r=yield this.core.verifyLocalAd4mCode(t.detail.code);this.verificationError=!r,r&&(this.modalOpen=!1)})}connectRemoteNode(t){return we(this,null,function*(){this.remoteNodeError=!1,this.connectingToRemoteNode=!0,this.core.url=t.detail.remoteUrl,On("ad4m-url",this.core.url);try{if(yield Dn(t.detail.remoteUrl),console.log("[Ad4m Connect UI] Remote connection successful"),!(yield this.core.isValidAd4mAPI()))throw new Error("Server is reachable but doesn't appear to be an AD4M executor");console.log("[Ad4m Connect UI] Remote AD4M API verified");let n=yield this.core.isMultiUser();console.log("[Ad4m Connect UI] Remote multi-user detected:",n),this.currentView="remote-authentication"}catch(r){console.error("[Ad4m Connect UI] Remote connection failed:",r),this.remoteNodeError=!0}finally{this.connectingToRemoteNode=!1}})}emailLogin(t){return we(this,null,function*(){try{this.remoteAuthLoading=!0,this.remoteAuthState=yield this.core.submitEmail(t.detail.email)}finally{this.remoteAuthLoading=!1}})}verifyEmailCode(t){return we(this,null,function*(){try{this.remoteAuthLoading=!0;let r=yield this.core.verifyEmailCode(t.detail.email,t.detail.code);this.emailCodeError=!r,r&&(this.modalOpen=!1)}catch(r){this.emailCodeError=!0}finally{this.remoteAuthLoading=!1}})}passwordLogin(t){return we(this,null,function*(){try{this.remoteAuthLoading=!0;let r=yield this.core.loginWithPassword(t.detail.email,t.detail.password);this.passwordError=!r,r&&(this.modalOpen=!1)}catch(r){this.passwordError=!0}finally{this.remoteAuthLoading=!1}})}createAccount(t){return we(this,null,function*(){try{this.remoteAuthLoading=!0;let r=yield this.core.createAccount(t.detail.email,t.detail.password);this.accountCreationError=!r,r&&(this.modalOpen=!1)}catch(r){this.accountCreationError=!0}finally{this.remoteAuthLoading=!1}})}disconnect(){return we(this,null,function*(){yield this.core.disconnect(),window.location.reload()})}renderViews(){if(this.currentView==="connection-options")return L`
2430
2431
  <connection-options
2431
2432
  .port=${this.core.port}
2432
2433
  .remoteUrl=${this.core.options.remoteUrl}
@@ -2492,7 +2493,7 @@ WHERE ${m.join(" AND ")}
2492
2493
  >
2493
2494
  ${gi()}
2494
2495
  </button>
2495
- `:null}};De.styles=[Vh],j([ce()],De.prototype,"modalOpen",2),j([ce()],De.prototype,"currentView",2),j([ce()],De.prototype,"connectingToRemoteNode",2),j([ce()],De.prototype,"remoteNodeError",2),j([ce()],De.prototype,"verificationError",2),j([ce()],De.prototype,"remoteAuthLoading",2),j([ce()],De.prototype,"remoteAuthState",2),j([ce()],De.prototype,"emailCodeError",2),j([ce()],De.prototype,"passwordError",2),j([ce()],De.prototype,"accountCreationError",2),De=j([mt("ad4m-connect")],De);function zh(i){let e=new De;return e.core=i,i.embedded?console.log("[Ad4m Connect] Running in embedded mode - UI will not be shown"):(console.log("[Ad4m Connect UI] Mounting UI to DOM"),document.body.appendChild(e)),e}export{De as Ad4mConnectElement,zh as default};
2496
+ `:null}};Me.styles=[Vh],j([le()],Me.prototype,"modalOpen",2),j([le()],Me.prototype,"currentView",2),j([le()],Me.prototype,"connectingToRemoteNode",2),j([le()],Me.prototype,"remoteNodeError",2),j([le()],Me.prototype,"verificationError",2),j([le()],Me.prototype,"remoteAuthLoading",2),j([le()],Me.prototype,"remoteAuthState",2),j([le()],Me.prototype,"emailCodeError",2),j([le()],Me.prototype,"passwordError",2),j([le()],Me.prototype,"accountCreationError",2),Me=j([mt("ad4m-connect")],Me);function zh(i){let e=new Me;return e.core=i,i.embedded?console.log("[Ad4m Connect] Running in embedded mode - UI will not be shown"):(console.log("[Ad4m Connect UI] Mounting UI to DOM"),document.body.appendChild(e)),e}export{Me as Ad4mConnectElement,zh as default};
2496
2497
  /*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */
2497
2498
  /**
2498
2499
  * @license